Hi,
I have setted up my own filter callback.
But unfortunately disabled pair appear in the collide result , using the following code, what is wrong ????
for (int i=0;i<numManifolds;i++)
{
btPersistentManifold* contactManifold = physicalWorld->getDispatcher()->getManifoldByIndexInternal(i);
btCollisionObject* obA = static_cast<btCollisionObject*>(contactManifold->getBody0());
btCollisionObject* obB = static_cast<btCollisionObject*>(contactManifold->getBody1());
int numContacts = contactManifold->getNumContacts();
if (numContacts > 0)
{
string *name0, *name1;
//printf("collision !\n");
name0 = (string *)obA->getUserPointer();
name1 = (string *)obB->getUserPointer();
printf("%s %s\n",name0->c_str(), name1->c_str());
ret = 1;
}
Regards,
Steph
Pair responses inhibited appear in collide result !
-
- Posts: 6
- Joined: Thu Jun 07, 2012 12:49 pm
-
- Posts: 6
- Joined: Thu Jun 07, 2012 12:49 pm
Re: Pair responses inhibited appear in collide result !
It happens with btDbvtBroadphase, but not with btSimpleBroadphase .
-
- Posts: 6
- Joined: Thu Jun 07, 2012 12:49 pm
Re: Pair responses inhibited appear in collide result !
btBdvtBroadphase.cpp
the following code seems buggy :
pbp->m_paircache->addOverlappingPair(pa,pb);
++pbp->m_newpairs;
it should be :
if (pbp->m_paircache->addOverlappingPair(pa,pb) != 0)
++pbp->m_newpairs;
But this is not enough, problem is always there
the following code seems buggy :
pbp->m_paircache->addOverlappingPair(pa,pb);
++pbp->m_newpairs;
it should be :
if (pbp->m_paircache->addOverlappingPair(pa,pb) != 0)
++pbp->m_newpairs;
But this is not enough, problem is always there