If true, the body will automatically fall to sleep.
How much to damp the body angular velocity each step. It can go from 0 to 1.
Use this property to limit the rotational motion along any world axis. (1,1,1) will allow rotation along all axes while (0,0,0) allows none.
Angular velocity of the body, in world space. Think of the angular velocity as a vector, which the body rotates around. The length of this vector determines how fast (in radians per second) the body rotates.
The collision group the body belongs to.
The collision group the body can collide with.
Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled - i.e. "collide" events will be raised, but forces will not be altered.
Set to true if you don't want the body to rotate. Make sure to run .updateMassProperties() if you change this after the body creation.
When true the body behaves like a trigger. It does not collide with other bodies but collision events are still triggered.
How much to damp the body velocity each step. It can go from 0 to 1.
Use this property to limit the motion along any world axis. (1,1,1) will allow motion along all axes while (0,0,0) allows none.
The mass of the body.
The physics material of the body. It defines the body interaction with other bodies.
World space position of the body.
World space orientation of the body.
Add a Shape to the body.
If the speed (the norm of the velocity) is smaller than this value, the body is considered sleepy.
If the body has been sleepy for this sleepTimeLimit seconds, it is considered sleeping.
One of: Body.DYNAMIC
, Body.STATIC
and Body.KINEMATIC
.
World space velocity of the body.
Dispatched after two bodies collide. This event is dispatched on each of the two bodies involved in the collision.
Dispatched after a body has fallen asleep.
Dispatched after a body has gone in to the sleepy state.
Dispatched after a sleeping body has woken up.
World space bounding box of the body and its shapes.
Indicates if the AABB needs to be updated before use.
If true, the body will automatically fall to sleep.
How much to damp the body angular velocity each step. It can go from 0 to 1.
Use this property to limit the rotational motion along any world axis. (1,1,1) will allow rotation along all axes while (0,0,0) allows none.
Angular velocity of the body, in world space. Think of the angular velocity as a vector, which the body rotates around. The length of this vector determines how fast (in radians per second) the body rotates.
Total bounding radius of the Body including its shapes, relative to body.position.
The collision group the body belongs to.
The collision group the body can collide with.
Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled - i.e. "collide" events will be raised, but forces will not be altered.
Set to true if you don't want the body to rotate. Make sure to run .updateMassProperties() if you change this after the body creation.
Linear force on the body in world space.
Identifier of the body.
Position of body in World.bodies. Updated by World and used in ArrayCollisionMatrix.
The inertia of the body.
Initial angular velocity of the body.
Initial position of the body.
Initial quaternion of the body.
Initial velocity of the body.
Interpolated position of the body.
Interpolated orientation of the body.
When true the body behaves like a trigger. It does not collide with other bodies but collision events are still triggered.
How much to damp the body velocity each step. It can go from 0 to 1.
Use this property to limit the motion along any world axis. (1,1,1) will allow motion along all axes while (0,0,0) allows none.
The mass of the body.
The physics material of the body. It defines the body interaction with other bodies.
World space position of the body.
World space orientation of the body.
Position of each Shape in the body, given in local Body space.
Orientation of each Shape, given in local Body space.
List of Shapes that have been added to the body.
If the speed (the norm of the velocity) is smaller than this value, the body is considered sleepy.
Current sleep state.
If the body has been sleepy for this sleepTimeLimit seconds, it is considered sleeping.
World space rotational force on the body, around center of mass.
One of: Body.DYNAMIC
, Body.STATIC
and Body.KINEMATIC
.
World space velocity of the body.
Reference to the world the body is living in.
AWAKE
A dynamic body is fully simulated. Can be moved manually by the user, but normally they move according to forces. A dynamic body can collide with all body types. A dynamic body always has finite, non-zero mass.
A kinematic body moves under simulation according to its velocity. They do not respond to forces. They can be moved manually, but normally a kinematic body is moved by setting its velocity. A kinematic body behaves as if it has infinite mass. Kinematic bodies do not collide with other static or kinematic bodies.
SLEEPING
SLEEPY
A static body does not move during simulation and behaves as if it has infinite mass. Static bodies can be moved manually by setting the position of the body. The velocity of a static body is always zero. Static bodies do not collide with other static or kinematic bodies.
Add an event listener
The self object, for chainability.
Add a shape to the body with a local offset and orientation.
The body object, for chainability.
Apply force to a point of the body. This could for example be a point on the Body surface. Applying force this way will add to Body.force and Body.torque.
The amount of force to add.
A point relative to the center of mass to apply the force on.
Apply impulse to a point of the body. This could for example be a point on the Body surface. An impulse is a force added to a body during a short period of time (impulse = force * time). Impulses will be added to Body.velocity and Body.angularVelocity.
The amount of impulse to add.
A point relative to the center of mass to apply the force on.
Apply torque to the body.
The amount of torque to add.
Emit an event.
The self object, for chainability.
Check if any event listener of the given type is added
Check if an event listener is added
Move the body forward in time.
Time step
Set to true to normalize the body quaternion
If the quaternion should be normalized using "fast" quaternion normalization
Remove an event listener
The self object, for chainability.
Force body sleep
Called every timestep to update internal sleep timer and change sleep state if needed.
The world time in seconds
Updates the .aabb
Update the bounding radius of the body. Should be done if any of the shapes are changed.
Update .inertiaWorld
and .invInertiaWorld
Should be called whenever you change the body shape or mass.
If the body is sleeping, it should be immovable / have infinite mass during solve. We solve it by having a separate "solve mass".
Wake the body up.
Base class for all body types.