Interface: ShapeBase
Defined in: physics/shapes/shape.ts:13
Common contract implemented by all collision shapes.
Properties
type
type:
ShapeType
Defined in: physics/shapes/shape.ts:17
The kind of shape this is, used to dispatch collision detection.
Methods
getArea()
getArea():
number
Defined in: physics/shapes/shape.ts:23
Calculates the area of the shape.
Returns
number
The area of the shape.
getBoundingRadius()
getBoundingRadius():
number
Defined in: physics/shapes/shape.ts:38
Calculates the radius of the smallest circle, centered on the shape's local origin, that fully contains the shape. Used for broad-phase AABB calculations.
Returns
number
The bounding radius of the shape.
getMomentOfInertia()
getMomentOfInertia(
mass):number
Defined in: physics/shapes/shape.ts:30
Calculates the moment of inertia of the shape for a given mass.
Parameters
mass
number
The mass of the body the shape belongs to.
Returns
number
The moment of inertia of the shape.