I'm using Bullet only for collision detection with my own integrator.
To do complex collision response with friction, I need to keep track of the contact in time.
I retrieve contactPoint for each contact and inject them in my collision computation. But these contacts points are sorted by penetration distance, so they cannot be "identified" by their index. So if penetration distance change, the order change too, and i cannot retrieve in the new frame which contact point correspond to the old contact point.
I'm looking for a way to identify these contact point in this forum, but i found nothing to solve my problem.
Do i miss something ? Is there a way to do that in bullet ?
I see that btManifoldPoint has a lifetime : can i use this information for my purpose ?
I retrieve the contacts points with :
Code: Select all
m_world->performDiscreteCollisionDetection();
int numManifolds = m_world->getDispatcher()->getNumManifolds();
for (int i=0;i<numManifolds;i++) {
btPersistentManifold* contactManifold = m_world->getDispatcher()->getManifoldByIndexInternal(i);
for (int j = 0; j< contactManifold->getNumContacts(); ++j) {
btManifoldPoint pt = contactManifold ->getContactPoint(j);
// process contact point
}
}
and forgive my English