com.bulletphysics.collision.narrowphase
Class DiscreteCollisionDetectorInterface
java.lang.Object
com.bulletphysics.collision.narrowphase.DiscreteCollisionDetectorInterface
- Direct Known Subclasses:
- GjkPairDetector
public abstract class DiscreteCollisionDetectorInterface
- extends Object
This interface is made to be used by an iterative approach to do TimeOfImpact calculations.
This interface allows to query for closest points and penetration depth between two (convex) objects
the closest point is on the second object (B), and the normal points from the surface on B towards A.
distance is between closest points on B and closest point on A. So you can calculate closest point on A
by taking closestPointInA = closestPointInB + distance * normalOnSurfaceB
.
DiscreteCollisionDetectorInterface
public DiscreteCollisionDetectorInterface()
getClosestPoints
public final void getClosestPoints(DiscreteCollisionDetectorInterface.ClosestPointInput input,
DiscreteCollisionDetectorInterface.Result output,
IDebugDraw debugDraw)
- Give either closest points (distance > 0) or penetration (distance)
the normal always points from B towards A.
getClosestPoints
public abstract void getClosestPoints(DiscreteCollisionDetectorInterface.ClosestPointInput input,
DiscreteCollisionDetectorInterface.Result output,
IDebugDraw debugDraw,
boolean swapResults)
- Give either closest points (distance > 0) or penetration (distance)
the normal always points from B towards A.