The dynamics engine is an impulse based rigid body physics simulator. The simulation
by default uses SI (m/kg/s) units. This can be changed, but all settings within the
Settings singleton must be set to the new units. Instead
its recommended to use the
UnitConversion class to convert all
values to MKS.
A constraint based approach is used to solving contacts and joints.
World object to gain access the dynamics engine. Create
Bodys and add them to the
AbstractPhysicsWorld.update(double) method to your game loop (notice the
AbstractPhysicsWorld.update(double) method requires the elapsed time to
be in seconds).
Upon creating a
object may be supplied. The
Bounds will determine when
Bodys go out of bounds and deactivate them. Using the
World() constructor will create a world that has no bounds,
in which case the
AbstractCollisionWorld.getBounds() method will return null.
World object also contains a number listeners that can be used to
respond to events that happen within the world, contact for instance.
BoundsListenerfor responding to out of bounds bodies
DestructionListenerfor responding to bodies and joints that are implicitly destroyed by some other action
StepListenerfor performing logic at the end/beginning of a time step
CollisionListenerfor responding to collision detection events
ContactListenerfor responding to contact events
TimeOfImpactListenerfor responding to time of impact events
Worldobject may not be allowed inside the listener methods.
The gravity of the
World object can be changed, and can be in any
direction via the
The dynamics engine may require some configuration. The defaults should cover most applications,
however, they can be changed using the
Settings class on the
World. Any setting can be changed at runtime so that no source code
modification is needed. Refer to the source of
Settings and the
Sandbox for details on what each individual setting controls.
- William Bittle
Interface Summary Interface Description BroadphaseCollisionData<T extends CollisionBody<E>,E extends Fixture>Represents a broadphase collision. BroadphaseFilter<T extends CollisionBody<E>,E extends Fixture>Represents a class that defines rules to exclude results from
CoefficientMixerInterface used to customize the way friction and restitution coefficients are mixed. CollisionData<T extends CollisionBody<E>,E extends Fixture>Represents a container for all the collision information between a
CollisionWorld<T extends CollisionBody<E>,E extends Fixture,V extends CollisionData<T,E>>Represents a world where
CollisionBodys are added to participate in collision detection.
ContactCollisionData<T extends PhysicsBody>Interaface for collision data that contains a
ManifoldCollisionData<T extends CollisionBody<E>,E extends Fixture>Represents a manifold collision. NarrowphaseCollisionData<T extends CollisionBody<E>,E extends Fixture>Represents a narrowphase collision. PhysicsWorld<T extends PhysicsBody,V extends ContactCollisionData<T>>Represents a
CollisionWorldthat resolves collision using Newton's laws of physics.
Class Summary Class Description AbstractCollisionWorld<T extends CollisionBody<E>,E extends Fixture,V extends CollisionData<T,E>>Abstract implementation of the
AbstractPhysicsWorld<T extends PhysicsBody,V extends ContactCollisionData<T>>Abstract implementation of the
BroadphaseFilterAdapter<T extends CollisionBody<E>,E extends Fixture>Helper class to avoid having to override all the methods of the
CollisionBodyBroadphaseFilter<T extends CollisionBody<E>,E extends Fixture> ConstraintGraph<T extends PhysicsBody>Represents an undirected graph of constraints involving
PhysicsBodys with the desire to split the simulation into smaller, solvable chunks.
ConstraintGraphNode<T extends PhysicsBody>Represents a node in the constraint graph. DetectFilter<T extends CollisionBody<E>,E extends Fixture>Represents the filters for queries against a
Island<T extends PhysicsBody>Used to solve the contact constraints and joints for a group of interconnected bodies. PhysicsBodyBroadphaseFilter<T extends PhysicsBody>Encapsulates logic used to filter the broadphase pairs based on filters, body state, etc. World<T extends PhysicsBody> WorldCollisionData<T extends PhysicsBody>Represents the collision data for the