Skip to content

cf_make_capsule2

Category: math
GitHub: cute_math.h


Returns a capsule.

CF_Capsule cf_make_capsule2(CF_V2 p, float height, float radius)
Parameters Description
p The position the capsule stands upon.
height The total length of the capsule, from end to end.
radius How thick the capsule is. Make sure this is less than or equal to height (or you'll get a sphere).

Remarks

The height is measured from the end of each cap, covering the full length of the capsule. The capsule is constructed standing straight up on the y-axis. You should make sure height is taller than the radius. a is the center of the bottom cap, while b is the center of the top cap.

CF_Capsule