public class PersistentManifold extends Object
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.
Modifier and Type | Field and Description |
---|---|
int |
index1a |
static int |
MANIFOLD_CACHE_SIZE |
Constructor and Description |
---|
PersistentManifold() |
PersistentManifold(Object body0,
Object body1,
int bla) |
Modifier and Type | Method and Description |
---|---|
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) |
public static final int MANIFOLD_CACHE_SIZE
public int index1a
public Object getBody0()
public Object getBody1()
public void clearUserCache(ManifoldPoint pt)
public int getNumContacts()
public ManifoldPoint getContactPoint(int index)
public float getContactBreakingThreshold()
public int getCacheEntry(ManifoldPoint newPoint)
public int addManifoldPoint(ManifoldPoint newPoint)
public void removeContactPoint(int index)
public void replaceContactPoint(ManifoldPoint newPoint, int insertIndex)
public void clearManifold()
Copyright © 2013. All Rights Reserved.