pass in reference to actual contact point in cache, rather then temporary value, should fix issue 53

http://code.google.com/p/bullet/issues/detail?id=53
Thanks Alex Silverman for reporting and suggested fix
Changed addContactPoint to lowercase
This commit is contained in:
erwin.coumans
2008-06-22 03:30:55 +00:00
parent 441c729169
commit d16c1b615f
4 changed files with 7 additions and 6 deletions

View File

@@ -100,9 +100,9 @@ void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const b
m_manifoldPtr->replaceContactPoint(newPt,insertIndex);
} else
{
m_manifoldPtr->AddManifoldPoint(newPt);
insertIndex = m_manifoldPtr->addManifoldPoint(newPt);
}
//User can override friction and/or restitution
if (gContactAddedCallback &&
//and if either of the two bodies requires custom material
@@ -112,7 +112,7 @@ void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const b
//experimental feature info, for per-triangle material etc.
btCollisionObject* obj0 = isSwapped? m_body1 : m_body0;
btCollisionObject* obj1 = isSwapped? m_body0 : m_body1;
(*gContactAddedCallback)(newPt,obj0,m_partId0,m_index0,obj1,m_partId1,m_index1);
(*gContactAddedCallback)(m_manifoldPtr->getContactPoint(insertIndex),obj0,m_partId0,m_index0,obj1,m_partId1,m_index1);
}
}