Makes bodies go to sleep when they've been inactive.
The broadphase algorithm to use.
Gravity to use when approximating the friction max force (mumassgravity). If undefined, global gravity will be used.
The gravity of the world.
Set to true to use fast quaternion normalization. It is often enough accurate to use. If bodies tend to explode, set to false.
How often to normalize quaternions. Set to 0 for every step, 1 for every second etc.. A larger value increases performance. If bodies tend to explode, set to a smaller value (zero to be sure nothing can go wrong).
The solver algorithm to use.
Time accumulator for interpolation.
Dispatched after a body has been added to the world.
Makes bodies go to sleep when they've been inactive.
All bodies in this world
The broadphase algorithm to use.
collisionMatrix
CollisionMatrix from the previous step.
Used to look up a ContactMaterial given two instances of Material.
All added contactmaterials.
All the current contacts (instances of ContactEquation) in the world.
This contact material is used if no suitable contactmaterial is found for a contact.
The default material of the bodies.
Default and last timestep sizes.
Currently / last used timestep. Is set to -1 if not available. This value is updated before each internal step, which means that it is "fresh" inside event callbacks.
Gravity to use when approximating the friction max force (mu * mass * gravity). If undefined, global gravity will be used. Use to enable friction in a World with a null gravity vector (no gravity).
The gravity of the world.
True if any bodies are not sleeping, false if every body is sleeping.
Set to true to use fast quaternion normalization. It is often enough accurate to use. If bodies tend to explode, set to false.
How often to normalize quaternions. Set to 0 for every step, 1 for every second etc.. A larger value increases performance. If bodies tend to explode, set to a smaller value (zero to be sure nothing can go wrong).
Dispatched after a body has been removed from the world.
The solver algorithm to use.
Number of timesteps taken since start.
The wall-clock time since simulation start.
Add a rigid body to the simulation.
Add a constraint to the simulation.
Adds a contact material to the World
Add an event listener
The self object, for chainability.
Sets all body forces in the world to zero.
Store old collision state info
Emit an event.
The self object, for chainability.
Step the simulation forward keeping track of last called time to be able to step the world at a fixed rate, independently of framerate.
The fixed time step size to use (default: 1 / 60).
Maximum number of fixed steps to take per function call (default: 10).
Get the contact material between materials m1 and m2
The contact material if it was found.
Check if any event listener of the given type is added
Check if an event listener is added
Raycast test
Ray cast against all bodies. The provided callback will be executed for each hit with a RaycastResult as single argument.
True if any body was hit.
Ray cast, and stop at the first result. Note that the order is random - but the method is fast.
True if any body was hit.
Ray cast, and return information of the closest hit.
True if any body was hit.
Remove a rigid body from the simulation.
Removes a constraint
Removes a contact material from the World.
Remove an event listener
The self object, for chainability.
Step the physics world forward in time.
There are two modes. The simple mode is fixed timestepping without interpolation. In this case you only use the first argument. The second case uses interpolation. In that you also provide the time since the function was last used, as well as the maximum fixed timesteps to take.
The fixed time step size to use.
The time elapsed since the function was last called.
Maximum number of fixed steps to take per function call (default: 10).
The physics world