Collision detection can be an expensive process. To avoid unnecessary processing a two phase approach to collision detection is used. First a inaccurate, yet conservative, algorithm is used to detect possible collision pairs. This process is called the broad-phase. Next, after obtaining all the possible collision pairs, each pair is tested using an accurate algorithm. This is called the narrow-phase. After the narrow-phase is complete, another phase, Manifold generation, generates the contact points.
The narrow-phase also contains classes for supporting multiple detectors at once via the
FallbackNarrowphaseDetector class. Using the
FallbackConditions the detector will determine whether to
use the primary
NarrowphaseDetector or the fallback.
Continuous Collision Detection (CCD) and Raycasting
The process outlined above is called discrete collision detection. Outside of this process, there's continuous collision detection and raycasting.
Continuous collision detection (CCD) is the process
of detecting missed collisions that the discrete process couldn't detect. The discrete process fails
to detect some collisions due to it being run on a set interval - if a sufficiently small object is going
fast enough, for example. CCD detectors implement the
interface and return a
TimeOfImpact object when a collision is
The following is a list of implementations of the above interfaces:
- William Bittle
Interface Summary Interface Description BoundsRepresents the
Boundsof a simulation.
BoundsListener Deprecated.Deprecated in 4.0.0. Collidable<T extends Fixture> Deprecated.Deprecated in 4.0.0. CollisionBody<T extends Fixture>Represents an object that can collide with other objects. CollisionItem<T extends CollisionBody<E>,E extends Fixture> CollisionPair<T extends CollisionBody<E>,E extends Fixture> FilterInterface representing a filter for collision detection. FixtureModificationHandler<T extends Fixture>
Class Summary Class Description AbstractBoundsAbstract implementation of the
AbstractCollidable<T extends Fixture> Deprecated.Deprecated in 4.0.0. AbstractCollisionBody<T extends Fixture>A base implementation of the
AbstractCollisionItem<T extends CollisionBody<E>,E extends Fixture>Abstract implementation of the
AbstractCollisionPair<T extends CollisionBody<E>,E extends Fixture>Abstract implementation of the
AxisAlignedBoundsRepresents a bounding region that is an Axis-Aligned bounding box. BasicCollisionItem<T extends CollisionBody<E>,E extends Fixture>Represents a basic, immutable implementation of the
BasicCollisionPair<T extends CollisionBody<E>,E extends Fixture>Represents a basic, immutable implementation of the
BoundsAdapter Deprecated.Deprecated in 4.0.0. CategoryFilterA
Filterfor categorized fixtures.
CollisionsClass used to estimate collision counts and other one-off collision methods and values. FixtureRepresents a geometric piece of a