center on the horizontal axis
center on the vertical axis
center on the depth axis
the radius of the cylinder and its ends
the total height, ends included
OptionalcollisionOptionalcollisionOptional per-shape collision settings (see Body#addShape).
the total height, rounded ends included; never less than 2 × radius
Optionalisfalse takes this shape out of collision without removing it
Optionalistrue reports contacts but skips the position correction
the center of the capsule, as an offset from the owning body's position
the radius of the cylinder and of its two rounded ends
the shape type (used internally)
half the length of the straight part between the two rounded ends: 0
for a capsule that is a sphere, and never less, whatever radius and
height were set to since Capsule3d#setShape. What Rapier
calls the capsule's half height.
true if this capsule contains the given point
point x, or a vector carrying the whole point
Optionaly: number = 0
point y
Optionalz: number = 0
point z
set a new position and size
center on the horizontal axis
center on the vertical axis
center on the depth axis
the radius of the cylinder and its ends
the total height, ends included
this capsule, for chaining
The axis-aligned box around this capsule: what the built-in physics resolves it as.
a new Box3d
A capsule standing upright: a vertical cylinder with a half-sphere on each end, usable as a Body collision shape. The shape for a character in a 3D world: its rounded bottom slides up slopes and steps instead of catching on every edge, as a box would.
Like Box3d and Sphere,
posis the center, and the convention is the engine's 3D one (see Camera3d): Y-down, +Z forward. It stands along Y; a physics engine that turns bodies turns it with its body.A 3D physics adapter (
@melonjs/rapier3d-adapter) builds it exactly. The built-in physics approximates it by its bounding Box3d, and the 2D adapters refuse it.Example