API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classCapsuleShape
A capsule: the set of points within `radius` of the segment between two local-space endpoints. Exact geometry, never a polygon approximation - the mass model and the narrow phase both work on the spine and the radius, so nothing about a capsule depends on a tessellation constant. The spine is given as two points rather than a centre, a half-height and an angle: every consumer needs the two endpoints, and the collider already carries a local rotation, so an angle on the shape would be a second and redundant orientation. A zero-length spine is rejected rather than quietly becoming a circle - use CircleShape to say that.
import { CapsuleShape } from '@codexo/exojs-physics'A capsule: the set of points within `radius` of the segment between two local-space endpoints. Exact geometry, never a polygon approximation - the mass model and the narrow phase both work on the spine and the radius, so nothing about a capsule depends on a tessellation constant.
The spine is given as two points rather than a centre, a half-height and an angle: every consumer needs the two endpoints, and the collider already carries a local rotation, so an angle on the shape would be a second and redundant orientation.
A zero-length spine is rejected rather than quietly becoming a circle - use CircleShape to say that.
new(x0: number, y0: number, x1: number, y1: number, radius: number): CapsuleShapeboundingRadius: numberlength: numbernormals: readonly number[]radius: numbertype: "capsule"vertices: readonly number[]