Pass:capsule

Draws a capsule. A capsule is shaped like a cylinder with a hemisphere on each end.


Pass:capsule(transform, segments)

Arguments

NameTypeDefaultDescription
transformMat4 The transform of the capsule. Can also be provided as position, scale, and rotation using a mix of Vectors or numbers. When using numbers for the scale, 2 should be provided: one for the radius and one for the length. When using a matrix or a vector for the scale, the X and Y components are the radius and the Z component is the length.
segmentsnumber32 The number of circular segments to render.

Returns

Nothing


Draws a capsule between two points.

Pass:capsule(p1, p2, radius, segments)

Arguments

NameTypeDefaultDescription
p1Vec3 The starting point of the capsule.
p2Vec3 The ending point of the capsule.
radiusnumber1.0 The radius of the capsule.
segmentsnumber32 The number of circular segments to render.

Returns

Nothing

Notes

The length of the capsule does not include the end caps. The local origin of the capsule is in the center, and the local z axis points towards the end caps.

See also