refresh contact points, even when they are already persistent. needs a bit more work (a 'replacedContactCallback' where optionally the user can carry over the persistent contact data)

This commit is contained in:
ejcoumans
2006-10-30 04:51:17 +00:00
parent 745828ab9c
commit dd8297c86e

View File

@@ -74,17 +74,6 @@ void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const b
int insertIndex = m_manifoldPtr->getCacheEntry(newPt);
if (insertIndex >= 0)
{
// This is not needed, just use the old info!
// const btManifoldPoint& oldPoint = m_manifoldPtr->getContactPoint(insertIndex);
// newPt.CopyPersistentInformation(oldPoint);
// m_manifoldPtr->replaceContactPoint(newPt,insertIndex);
} else
{
newPt.m_combinedFriction = calculateCombinedFriction(m_body0,m_body1);
newPt.m_combinedRestitution = calculateCombinedRestitution(m_body0,m_body1);
@@ -101,6 +90,12 @@ void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const b
(*gContactAddedCallback)(newPt,obj0,m_partId0,m_index0,obj1,m_partId1,m_index1);
}
if (insertIndex >= 0)
{
//const btManifoldPoint& oldPoint = m_manifoldPtr->getContactPoint(insertIndex);
m_manifoldPtr->replaceContactPoint(newPt,insertIndex);
} else
{
m_manifoldPtr->AddManifoldPoint(newPt);
}
}