Class: PhysicsBody
A rigid body model added to a node to enable physics simulation.
Param
Implements
Constructors
new PhysicsBody()
new PhysicsBody(
options
):PhysicsBody
Parameters
• options: PhysicsBodyOptions
Returns
Defined in
m2c2kit/packages/physics/src/PhysicsBody.ts:23
Properties
_body?
optional
_body:Body
Defined in
m2c2kit/packages/physics/src/PhysicsBody.ts:14
_node?
optional
_node:M2Node
Defined in
m2c2kit/packages/physics/src/PhysicsBody.ts:13
needsInitialization
needsInitialization:
boolean
=true
Defined in
m2c2kit/packages/physics/src/PhysicsBody.ts:16
options
options:
PhysicsBodyOptions
Defined in
m2c2kit/packages/physics/src/PhysicsBody.ts:15
Accessors
allowsRotation
Get Signature
get allowsRotation():
boolean
Whether or not the body can rotate. Defaults to true.
Remarks
If true, this sets the Matter.js inertia
property to Infinity
.
Returns
boolean
Set Signature
set allowsRotation(
allowsRotation
):void
Whether or not the body can rotate. Defaults to true.
Remarks
If true, this sets the Matter.js inertia
property to Infinity
.
Parameters
• allowsRotation: boolean