API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
typeAnyShape
@codexo/exojs-physics / physics / stable
Discriminated union of the concrete shape kinds. Narrow via the literal `shape.type` discriminant (`'circle'` → CircleShape, `'capsule'` → CapsuleShape, `'polygon'` → PolygonShape) - no `as` casts needed. BoxShape is a PolygonShape subclass and carries `type: 'polygon'`.
0
props
0
methods
0
events
Import
import { AnyShape } from '@codexo/exojs-physics'Discriminated union of the concrete shape kinds. Narrow via the literal `shape.type` discriminant (`'circle'` → CircleShape, `'capsule'` → CapsuleShape, `'polygon'` → PolygonShape) - no `as` casts needed. BoxShape is a PolygonShape subclass and carries `type: 'polygon'`.
Definition1
CapsuleShapeA capsule: the set of points within `radius` of the segment between two local-space endpoints. Exact geometry, never a polygon approximation - the mass model a… | ChainShapeA connected boundary through a run of local-space vertices: level outlines, terrain, the ground of a side-scroller. Open (a polyline) or closed (a loop). A cha… | CircleShapeA circle of the given `radius` centred on the collider's local origin. The cheapest shape for both broad- and narrow-phase. | PolygonShapeA convex polygon defined by ≥3 local-space vertices. Input vertices may be given in either winding; they are canonicalised to counter-clockwise and the outward… | SegmentShapeA zero-thickness boundary between two local-space endpoints: level edges, one-off walls, the geometry a body may not cross. It has no interior, so Shape.massPr…Source