Hi again serengeor, thank you again for your testing.
The code that you posted there, is probably taken from
There. The problem of this algorithm is the following:
"
This should be done during a simulation tick (substep) callback, because contacts might be added and removed during several substeps of a single stepSimulation call. "
So maybe this is the problem that you're complaining about.
Another things that you forgot to insert in the algorithm is the contact points distance control:
Code: Select all
for (int j=0;j<numContacts;j++)
{
btManifoldPoint& pt = contactManifold->getContactPoint(j);
if (pt.getDistance()<0.f)
{
const btVector3& ptA = pt.getPositionWorldOnA();
const btVector3& ptB = pt.getPositionWorldOnB();
const btVector3& normalOnB = pt.m_normalWorldOnB;
}
}
You can also see(and use, of course) the complete source in the isBodyColliding() function in CIrrBPWorld.
To avoid this kind of problem and get in an endless loop searching for the bug, you can use the better stable function to see if a pair of object is currently colliding:
GameCore::instance()->GetPhysicsManager()->getWorld()->isPairColliding(ent,ent2)
edit: I saw now your edit (I forgot to press the submit button and i changed tab...nice to hear that!
![Wink ;)](./images/smilies/icon_wink.gif)