fixed to potential issues, reported by marshall. Thanks!

This commit is contained in:
ejcoumans
2007-06-13 20:05:02 +00:00
parent 4f9d719493
commit 68b4f60033
2 changed files with 33 additions and 26 deletions

View File

@@ -108,9 +108,15 @@ public:
clearUserCache(m_pointCache[index]);
int lastUsedIndex = getNumContacts() - 1;
m_pointCache[index] = m_pointCache[lastUsedIndex];
//get rid of duplicated userPersistentData pointer
m_pointCache[lastUsedIndex].m_userPersistentData = 0;
// m_pointCache[index] = m_pointCache[lastUsedIndex];
if(index != lastUsedIndex)
{
m_pointCache[index] = m_pointCache[lastUsedIndex];
//get rid of duplicated userPersistentData pointer
m_pointCache[lastUsedIndex].m_userPersistentData = 0;
}
btAssert(m_pointCache[lastUsedIndex].m_userPersistentData==0);
m_cachedPoints--;
}
void replaceContactPoint(const btManifoldPoint& newPoint,int insertIndex)