name | type | arguments | Default | description |
---|---|---|---|---|
label | string | <optional> | 'Body' |
An arbitrary string-based name to help identify this body. |
parts | Array.<MatterJS.BodyType> | <optional> |
An array of bodies that make up this body. The first body in the array must always be a self reference to the current body instance. All bodies in the |
|
plugin | any | <optional> |
An object reserved for storing plugin-specific properties. |
|
angle | number | <optional> | 0 |
A number specifying the angle of the body, in radians. |
vertices | Array.<Phaser.Types.Math.Vector2Like> | <optional> | null |
An array of |
position | Phaser.Types.Math.Vector2Like | <optional> |
A |
|
force | Phaser.Types.Math.Vector2Like | <optional> |
A |
|
torque | number | <optional> | 0 |
A |
isSensor | boolean | <optional> | false |
A flag that indicates whether a body is a sensor. Sensor triggers collision events, but doesn't react with colliding body physically. |
isStatic | boolean | <optional> | false |
A flag that indicates whether a body is considered static. A static body can never change position or angle and is completely fixed. |
sleepThreshold | number | <optional> | 60 |
A |
density | number | <optional> | 0.001 |
A |
restitution | number | <optional> | 0 |
A |
friction | number | <optional> | 0.1 |
A |
frictionStatic | number | <optional> | 0.5 |
A |
frictionAir | number | <optional> | 0.01 |
A |
collisionFilter | Phaser.Types.Physics.Matter.MatterCollisionFilter | <optional> |
An |
|
slop | number | <optional> | 0.05 |
A |
timeScale | number | <optional> | 1 |
A |
chamfer | number | Array.<number> | Phaser.Types.Physics.Matter.MatterChamferConfig | <optional> | null |
A number, or array of numbers, to chamfer the vertices of the body, or a full Chamfer configuration object. |
circleRadius | number | <optional> | 0 |
The radius of this body if a circle. |
mass | number | <optional> | 0 |
A |
inverseMass | number | <optional> | 0 |
A |
scale | Phaser.Types.Math.Vector2Like | <optional> |
A |
|
gravityScale | Phaser.Types.Math.Vector2Like | <optional> |
A |
|
ignoreGravity | boolean | <optional> | false |
A boolean that toggles if this body should ignore world gravity or not. |
ignorePointer | boolean | <optional> | false |
A boolean that toggles if this body should ignore pointer / mouse constraints or not. |
render | Phaser.Types.Physics.Matter.MatterBodyRenderConfig | <optional> |
The Debug Render configuration object for this body. |
|
onCollideCallback | function | <optional> |
A callback that is invoked when this Body starts colliding with any other Body. You can register callbacks by providing a function of type |
|
onCollideEndCallback | function | <optional> |
A callback that is invoked when this Body stops colliding with any other Body. You can register callbacks by providing a function of type |
|
onCollideActiveCallback | function | <optional> |
A callback that is invoked for the duration that this Body is colliding with any other Body. You can register callbacks by providing a function of type |
|
onCollideWith | any | <optional> |
A collision callback dictionary used by the |