16 #ifndef BT_PERSISTENT_MANIFOLD_H
17 #define BT_PERSISTENT_MANIFOLD_H
26 struct btCollisionResult;
43 #define MANIFOLD_CACHE_SIZE 4
88 m_body0(body0),m_body1(body1),m_cachedPoints(0),
89 m_contactBreakingThreshold(contactBreakingThreshold),
90 m_contactProcessingThreshold(contactProcessingThreshold)
105 #ifdef DEBUG_PERSISTENCY
106 void DebugPersistency();
113 m_cachedPoints = cachedPoints;
120 return m_pointCache[index];
126 return m_pointCache[index];
130 btScalar getContactBreakingThreshold()
const;
134 return m_contactProcessingThreshold;
139 m_contactBreakingThreshold = contactBreakingThreshold;
144 m_contactProcessingThreshold = contactProcessingThreshold;
152 int addManifoldPoint(
const btManifoldPoint& newPoint,
bool isPredictive=
false);
156 clearUserCache(m_pointCache[index]);
158 int lastUsedIndex = getNumContacts() - 1;
160 if(index != lastUsedIndex)
162 m_pointCache[index] = m_pointCache[lastUsedIndex];
172 btAssert(m_pointCache[lastUsedIndex].m_userPersistentData==0);
177 btAssert(validContactDistance(newPoint));
179 #define MAINTAIN_PERSISTENCY 1
180 #ifdef MAINTAIN_PERSISTENCY
181 int lifeTime = m_pointCache[insertIndex].
getLifeTime();
192 m_pointCache[insertIndex] = newPoint;
204 m_pointCache[insertIndex].
m_lifeTime = lifeTime;
206 clearUserCache(m_pointCache[insertIndex]);
207 m_pointCache[insertIndex] = newPoint;
215 return pt.
m_distance1 <= getContactBreakingThreshold();
224 for (i=0;i<m_cachedPoints;i++)
226 clearUserCache(m_pointCache[i]);
240 #endif //BT_PERSISTENT_MANIFOLD_H