Fields
optionalshapes:Null<Array<ShapeOptions>>
Defines an array of Shapes that the Body will use as colliders
optionalshape_instances:Null<Array<Shape>>
An array of Shape instances that the Body will use as colliders
optionalrotational_velocity:Null<Float>
The units/second that a Body
will rotate. Currently is not Implemented.
optionalrotational_drag:Null<Float>
A measure of how fast a Body will move its rotational_velocity
towards 0.
optionalmax_velocity_y:Null<Float>
The maximum velocity range that a Body
can have on the Y axis. If set to 0, the Body has no restrictions on how fast it can move.
Note: this is calculated separately from a Body's max_velocity_length
, so be careful when applying both.
optionalmax_velocity_x:Null<Float>
The maximum velocity range that a Body
can have on the X axis. If set to 0, the Body has no restrictions on how fast it can move.
Note: this is calculated separately from a Body's max_velocity_length
, so be careful when applying both.
optionalmax_velocity_length:Null<Float>
The maximum velocity that a Body
can have along the velocity's length. If set to 0, the Body has no restrictions on how fast it can move.
Note: this is calculated separately from a Body's max_velocity_x
or 'max_velocity_y', so be careful when applying both.
optionalmax_rotational_velocity:Null<Float>
The maximum rotational velocity range that a Body
can have.
If set to 0, the Body has no restrictions on how fast it can rotate.
optionalmass:Null<MassType>
The Body's mass. Affects how the Body reacts to Collisions and Acceleration Forces. The higher a Body's mass, the more resistant it is to those forces.
Can be set to a Float
value, AUTO
, or STATIC
(mass = 5
, mass = AUTO
, and mass = STATIC
are all valid).
If set to AUTO
, the Body will automatically calculate it's mass based on it's volume and material's density
.
If a Body's mass is set to STATIC
or 0
, it becomes static - unmovable by forces and collisions.
If this value is left null
, it will automatically be set to the same value as Body.default_mass
.
optionalkinematic:Null<Bool>
Flag to set how a Body is affected by Collisions.
If set to true, the Body will still Collide and move through the world, but it will not be moved by external collision forces. This is useful for things like moving platforms.
optionalgravity_scale:Null<Float>
Percentage value that represents how much a World's gravity affects the Body.
optionalelasticity:Null<Float>
Value to determine how much of a Body's velocity
should be retained during collisions (or how much should the Body
"bounce" in other words).
optionaldrag_y:Null<Float>
A measure of how fast a Body will move its velocity towards 0 on the Y axis when there is no acceleration.
Note: this is calculated separately from a Body's drag_length
, so be careful when applying both.
optionaldrag_x:Null<Float>
A measure of how fast a Body will move its velocity towards 0 on the X axis when there is no acceleration.
Note: this is calculated separately from a Body's drag_length
, so be careful when applying both.
optionaldrag_length:Null<Float>
A measure of how fast a Body will move its velocity towards 0 along the velocity's length, when there is no acceleration.
Note: this is calculated separately from a Body's drag
, so be careful when applying both.