com.bulletphysics.dynamics
Class DiscreteDynamicsWorld
java.lang.Object
com.bulletphysics.collision.dispatch.CollisionWorld
com.bulletphysics.dynamics.DynamicsWorld
com.bulletphysics.dynamics.DiscreteDynamicsWorld
public class DiscreteDynamicsWorld
- extends DynamicsWorld
DiscreteDynamicsWorld provides discrete rigid body simulation.
Method Summary |
void |
addAction(ActionInterface action)
|
void |
addConstraint(TypedConstraint constraint,
boolean disableCollisionsBetweenLinkedBodies)
|
void |
addRigidBody(RigidBody body)
|
void |
addRigidBody(RigidBody body,
short group,
short mask)
|
void |
addVehicle(RaycastVehicle vehicle)
|
void |
applyGravity()
Apply gravity, call this once per timestep. |
void |
clearForces()
|
void |
debugDrawObject(Transform worldTransform,
CollisionShape shape,
Vector3f color)
|
void |
debugDrawWorld()
|
ActionInterface |
getAction(int index)
|
CollisionWorld |
getCollisionWorld()
|
TypedConstraint |
getConstraint(int index)
|
ConstraintSolver |
getConstraintSolver()
|
Vector3f |
getGravity(Vector3f out)
|
int |
getNumActions()
|
int |
getNumConstraints()
|
SimulationIslandManager |
getSimulationIslandManager()
|
DynamicsWorldType |
getWorldType()
|
void |
removeAction(ActionInterface action)
|
void |
removeConstraint(TypedConstraint constraint)
|
void |
removeRigidBody(RigidBody body)
|
void |
removeVehicle(RaycastVehicle vehicle)
|
void |
setConstraintSolver(ConstraintSolver solver)
|
void |
setGravity(Vector3f gravity)
Once a rigidbody is added to the dynamics world, it will get this gravity assigned. |
void |
setNumTasks(int numTasks)
|
int |
stepSimulation(float timeStep,
int maxSubSteps,
float fixedTimeStep)
Proceeds the simulation over 'timeStep', units in preferably in seconds. |
void |
updateActions(float timeStep)
|
Methods inherited from class com.bulletphysics.collision.dispatch.CollisionWorld |
addCollisionObject, addCollisionObject, convexSweepTest, destroy, getBroadphase, getCollisionObjectArray, getDebugDrawer, getDispatcher, getDispatchInfo, getNumCollisionObjects, getPairCache, objectQuerySingle, performDiscreteCollisionDetection, rayTest, rayTestSingle, removeCollisionObject, setBroadphase, setDebugDrawer, updateAabbs, updateSingleAabb |
DiscreteDynamicsWorld
public DiscreteDynamicsWorld(Dispatcher dispatcher,
BroadphaseInterface pairCache,
ConstraintSolver constraintSolver,
CollisionConfiguration collisionConfiguration)
debugDrawWorld
public void debugDrawWorld()
- Specified by:
debugDrawWorld
in class DynamicsWorld
clearForces
public void clearForces()
- Specified by:
clearForces
in class DynamicsWorld
applyGravity
public void applyGravity()
- Apply gravity, call this once per timestep.
stepSimulation
public int stepSimulation(float timeStep,
int maxSubSteps,
float fixedTimeStep)
- Description copied from class:
DynamicsWorld
- Proceeds the simulation over 'timeStep', units in preferably in seconds.
By default, Bullet will subdivide the timestep in constant substeps of each
'fixedTimeStep'.
In order to keep the simulation real-time, the maximum number of substeps can
be clamped to 'maxSubSteps'.
You can disable subdividing the timestep/substepping by passing maxSubSteps=0
as second argument to stepSimulation, but in that case you have to keep the
timeStep constant.
- Specified by:
stepSimulation
in class DynamicsWorld
setGravity
public void setGravity(Vector3f gravity)
- Description copied from class:
DynamicsWorld
- Once a rigidbody is added to the dynamics world, it will get this gravity assigned.
Existing rigidbodies in the world get gravity assigned too, during this method.
- Specified by:
setGravity
in class DynamicsWorld
getGravity
public Vector3f getGravity(Vector3f out)
- Specified by:
getGravity
in class DynamicsWorld
removeRigidBody
public void removeRigidBody(RigidBody body)
- Specified by:
removeRigidBody
in class DynamicsWorld
addRigidBody
public void addRigidBody(RigidBody body)
- Specified by:
addRigidBody
in class DynamicsWorld
addRigidBody
public void addRigidBody(RigidBody body,
short group,
short mask)
updateActions
public void updateActions(float timeStep)
addConstraint
public void addConstraint(TypedConstraint constraint,
boolean disableCollisionsBetweenLinkedBodies)
- Overrides:
addConstraint
in class DynamicsWorld
removeConstraint
public void removeConstraint(TypedConstraint constraint)
- Overrides:
removeConstraint
in class DynamicsWorld
addAction
public void addAction(ActionInterface action)
- Overrides:
addAction
in class DynamicsWorld
removeAction
public void removeAction(ActionInterface action)
- Overrides:
removeAction
in class DynamicsWorld
addVehicle
public void addVehicle(RaycastVehicle vehicle)
- Overrides:
addVehicle
in class DynamicsWorld
removeVehicle
public void removeVehicle(RaycastVehicle vehicle)
- Overrides:
removeVehicle
in class DynamicsWorld
debugDrawObject
public void debugDrawObject(Transform worldTransform,
CollisionShape shape,
Vector3f color)
setConstraintSolver
public void setConstraintSolver(ConstraintSolver solver)
- Specified by:
setConstraintSolver
in class DynamicsWorld
getConstraintSolver
public ConstraintSolver getConstraintSolver()
- Specified by:
getConstraintSolver
in class DynamicsWorld
getNumConstraints
public int getNumConstraints()
- Overrides:
getNumConstraints
in class DynamicsWorld
getConstraint
public TypedConstraint getConstraint(int index)
- Overrides:
getConstraint
in class DynamicsWorld
getNumActions
public int getNumActions()
- Overrides:
getNumActions
in class DynamicsWorld
getAction
public ActionInterface getAction(int index)
- Overrides:
getAction
in class DynamicsWorld
getSimulationIslandManager
public SimulationIslandManager getSimulationIslandManager()
getCollisionWorld
public CollisionWorld getCollisionWorld()
getWorldType
public DynamicsWorldType getWorldType()
- Specified by:
getWorldType
in class DynamicsWorld
setNumTasks
public void setNumTasks(int numTasks)