A DynamicsWorld object can be constructed with PhysicsDevice.createDynamicsWorld.
Summary
Updates the state of the physics simulation. Only needs to be called once per frame.
Syntax
dynamicsWorld.update();
Summary
Performs a ray query against the physics world.
Syntax
var rayHit = dynamicsWorld.rayTest({
from: hitScanStart,
to: hitScanEndPoint,
group: physicsDevice.FILTER_PROJECTILE,
exclude: ownerPhysicsObject
});
if (rayHit)
{
}
Returns a RayHit object if the test succeeded, null otherwise.
Summary
Performs a convex sweep query against the physics world.
Syntax
var hit = dynamicsWorld.convexSweepTest({
shape: queryShape,
from: transformStart,
to: transformEnd,
group: physicsDevice.FILTER_PROJECTILE,
exclude: myRigidBody
});
Returns a RayHit object if the test succeeded, null otherwise.
Summary
Adds a collision object to the simulation.
Syntax
dynamicsWorld.addCollisionObject(collisionObject);
Returns true if the collision object was added to the simulation, false otherwise.
Summary
Removes a collision object from the simulation.
Syntax
dynamicsWorld.removeCollisionObject(collisionObject);
Returns true if the collision object was removed from the simulation, false otherwise.
Summary
Adds a rigid body to the simulation.
Syntax
dynamicsWorld.addRigidBody(rigidBody);
Returns true if the rigid body was added to the simulation, false otherwise.
Summary
Removes a rigid body from the simulation.
Syntax
dynamicsWorld.removeRigidBody(rigidBody);
Returns true if the rigid body was removed from the simulation, false otherwise.
Summary
Adds a constraint to the simulation.
Syntax
dynamicsWorld.addConstraint(constraint);
Returns true if the constraint was added to the simulation, false otherwise.
Summary
Removes a constraint from the simulation.
Syntax
dynamicsWorld.removeConstraint(constraint);
Returns true if the constraint was removed from the simulation, false otherwise.
Summary
Adds a Character object to the simulation.
Syntax
dynamicsWorld.addCharacter(character);
Returns true if the character was added to the simulation, false otherwise.
Summary
The maximum number of substeps the simulation will perform per frame.
Syntax
var maxSubSteps = dynamicsWorld.maxSubSteps;
Note
Read Only
Summary
Fixed simulation time in seconds per substep.
Syntax
var fixedTimeStep = dynamicsWorld.fixedTimeStep;
Note
Read Only
Summary
Should the number of sub steps required exceed maxSubSteps then whether using fixed or variable time steps, the size of a time step will be permitted to reach a maximum of this amount to prevent loss of simulation time.
Setting to 0 means that we will not permit time step to be increased.
Syntax
var maxGiveUpTimeStep = dynamicsWorld.maxGiveUpTimeStep;
Note
Read Only, Canvas Only
Summary
Minimum simulation time in seconds per substep.
Syntax
var minimumTimeStep = dynamicsWorld.minimumTimeStep;
Note
Read Only, Canvas Only.
Summary
Maximum simulation time in seconds per substep.
Syntax
var maximumTimeStep = dynamicsWorld.maximumTimeStep;
Note
Read Only, Canvas Only.
Summary
The direction and magnitude of a global gravity force applied to the whole scene per frame.
Syntax
var gravity = dynamicsWorld.gravity;
Note
Read Only
Summary
Performance data about internal stages of the update() method, this is available only in Canvas.
Each field records the approximate number of seconds spent in the corresponding area for the previous call to update(). If more than one substep occured, this information will relate to the summation of sub-step costs.
Fields
Note
Read Only