Interface: RigidBodyOptions
Defined in: physics/rigid-body.ts:7
Options for creating a RigidBody.
Properties
angle?
optionalangle:number
Defined in: physics/rigid-body.ts:21
The world-space rotation of the body, in radians.
density?
optionaldensity:number
Defined in: physics/rigid-body.ts:41
The density of the body, used to calculate mass and inertia from the shape's area. Ignored for static bodies.
friction?
optionalfriction:number
Defined in: physics/rigid-body.ts:51
The friction coefficient of the body, clamped to the range [0, 1].
isSensor?
optionalisSensor:boolean
Defined in: physics/rigid-body.ts:35
Whether the body is a sensor. Sensor bodies still participate in
collision detection (and so still produce collisionStarts /
collisionEnds events), but are skipped during collision resolution -
they apply no impulses or positional correction to either body in the
pair.
isStatic?
optionalisStatic:boolean
Defined in: physics/rigid-body.ts:26
Whether the body is static (immovable, infinite mass).
position?
optionalposition:Vector2
Defined in: physics/rigid-body.ts:16
The world-space position of the body's center of mass.
restitution?
optionalrestitution:number
Defined in: physics/rigid-body.ts:46
The restitution (bounciness) of the body, clamped to the range [0, 1].
shape
shape:
Shape
Defined in: physics/rigid-body.ts:11
The collision shape of the body.