API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classShape

@codexo/exojs-physics / physics / stable

Immutable local-space collision geometry. A `Shape` carries no transform — a Collider positions it in a body. Shapes also expose the area-based mass properties (`area`, `centroid`, `unitInertia`) the body uses to derive mass and rotational inertia from a density; these are computed once at construction and frozen. `unitInertia` is the second moment of area about the shape's own centroid (∫ r² dA). Multiplying by density yields the rotational inertia contribution of the shape about its centroid.

6
props
0
methods
0
events
Import
import { Shape } from '@codexo/exojs-physics'

Immutable local-space collision geometry. A `Shape` carries no transform — a Collider positions it in a body. Shapes also expose the area-based mass properties (`area`, `centroid`, `unitInertia`) the body uses to derive mass and rotational inertia from a density; these are computed once at construction and frozen.

`unitInertia` is the second moment of area about the shape's own centroid (∫ r² dA). Multiplying by density yields the rotational inertia contribution of the shape about its centroid.

Constructors 1
new(): Shape
Properties 6
area: number
boundingRadius: number
centroidX: number
centroidY: number
type: ShapeType
unitInertia: number
Source