ColliderShape
ColliderShape = {
height:number;type:"box";width:number; } | {radius:number;type:"circle"; } | {axis?:"x"|"y";halfHeight:number;radius:number;type:"capsule"; } | {type:"polygon";vertices:Vec2Like[]; } | {type:"polyline";vertices:Vec2Like[]; }
Defined in: physics/src/types.ts:71
Discriminated union for collider shapes. All dimensions in pixels.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ height: number; type: "box"; width: number; }
Type Literal
Section titled “Type Literal”{ radius: number; type: "circle"; }
Type Literal
Section titled “Type Literal”{ axis?: "x" | "y"; halfHeight: number; radius: number; type: "capsule"; }
optionalaxis?:"x"|"y"
Orientation of the long axis. Default: "y" (vertical).
halfHeight
Section titled “halfHeight”halfHeight:
number
radius
Section titled “radius”radius:
number
type:
"capsule"
Type Literal
Section titled “Type Literal”{ type: "polygon"; vertices: Vec2Like[]; }
Closed convex shape. Rapier silently widens concave input to its convex
hull; use polyline for non-convex outlines.
Type Literal
Section titled “Type Literal”{ type: "polyline"; vertices: Vec2Like[]; }
Chain of line segments. Supports non-convex shapes but is static-only (no mass/inertia computed). Best for world boundaries.