com.bulletphysics.collision.narrowphase
Class PersistentManifold

java.lang.Object
  extended by com.bulletphysics.collision.narrowphase.PersistentManifold

public class PersistentManifold
extends Object

PersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping in the broadphase. Those contact points are created by the collision narrow phase.

The cache can be empty, or hold 1, 2, 3 or 4 points. Some collision algorithms (GJK) might only add one point at a time, updates/refreshes old contact points, and throw them away if necessary (distance becomes too large).

Reduces the cache to 4 points, when more then 4 points are added, using following rules: the contact point with deepest penetration is always kept, and it tries to maximize the area covered by the points.

Note that some pairs of objects might have more then one contact manifold.


Field Summary
 int index1a
           
static int MANIFOLD_CACHE_SIZE
           
 
Constructor Summary
PersistentManifold()
           
PersistentManifold(Object body0, Object body1, int bla)
           
 
Method Summary
 int addManifoldPoint(ManifoldPoint newPoint)
           
 void clearManifold()
           
 void clearUserCache(ManifoldPoint pt)
           
 Object getBody0()
           
 Object getBody1()
           
 int getCacheEntry(ManifoldPoint newPoint)
           
 float getContactBreakingThreshold()
           
 ManifoldPoint getContactPoint(int index)
           
 int getNumContacts()
           
 void init(Object body0, Object body1, int bla)
           
 void refreshContactPoints(Transform trA, Transform trB)
           
 void removeContactPoint(int index)
           
 void replaceContactPoint(ManifoldPoint newPoint, int insertIndex)
           
 void setBodies(Object body0, Object body1)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MANIFOLD_CACHE_SIZE

public static final int MANIFOLD_CACHE_SIZE
See Also:
Constant Field Values

index1a

public int index1a
Constructor Detail

PersistentManifold

public PersistentManifold()

PersistentManifold

public PersistentManifold(Object body0,
                          Object body1,
                          int bla)
Method Detail

init

public void init(Object body0,
                 Object body1,
                 int bla)

getBody0

public Object getBody0()

getBody1

public Object getBody1()

setBodies

public void setBodies(Object body0,
                      Object body1)

clearUserCache

public void clearUserCache(ManifoldPoint pt)

getNumContacts

public int getNumContacts()

getContactPoint

public ManifoldPoint getContactPoint(int index)

getContactBreakingThreshold

public float getContactBreakingThreshold()

getCacheEntry

public int getCacheEntry(ManifoldPoint newPoint)

addManifoldPoint

public int addManifoldPoint(ManifoldPoint newPoint)

removeContactPoint

public void removeContactPoint(int index)

replaceContactPoint

public void replaceContactPoint(ManifoldPoint newPoint,
                                int insertIndex)

refreshContactPoints

public void refreshContactPoints(Transform trA,
                                 Transform trB)

clearManifold

public void clearManifold()