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:
@@ -74,17 +74,6 @@ void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const b
|
|||||||
|
|
||||||
|
|
||||||
int insertIndex = m_manifoldPtr->getCacheEntry(newPt);
|
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_combinedFriction = calculateCombinedFriction(m_body0,m_body1);
|
||||||
newPt.m_combinedRestitution = calculateCombinedRestitution(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);
|
(*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);
|
m_manifoldPtr->AddManifoldPoint(newPt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user