com.bulletphysics.collision.narrowphase
Class PersistentManifold
java.lang.Object
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.
MANIFOLD_CACHE_SIZE
public static final int MANIFOLD_CACHE_SIZE
- See Also:
- Constant Field Values
index1a
public int index1a
PersistentManifold
public PersistentManifold()
PersistentManifold
public PersistentManifold(Object body0,
Object body1,
int bla)
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()