How do I force bullet to update the collision pairs?

Adversus
Posts: 19
Joined: Mon Nov 10, 2008 11:24 am

How do I force bullet to update the collision pairs?

Post by Adversus »

I've defined and set a btOverlapFilterCallback and defined a new needBroadphaseCollision().

The only problem is I then cast to my own class using:
(ICollisionNode*) ((btCollisionObject*)proxy0->m_clientObject)->getUserPointer() where I use flags to determine if these objects collide. The only problem with this is that these cached pairs aren't updated when I change these flags and I don't know how to force this to happen.

I tried:

Code: Select all

broadphasePairCache->getOverlappingPairCache()->removeOverlappingPairsContainingProxy( bulletObject->getBroadphaseHandle(), collisionDispatcher );
broadphasePairCache->calculateOverlappingPairs(collisionDispatcher);
but that didn't work, does anyone know a solution for this?

Cheers,
Adversus.
Adversus
Posts: 19
Joined: Mon Nov 10, 2008 11:24 am

Re: How do I force bullet to update the collision pairs?

Post by Adversus »

Ok from the code it looks like I can't do this directly at least through the interfaces. I think I might be able to do it by calling the sortMinDown etc functions directly however that was messy so I didn't pursue it.

What I did was just remove and add it again, is there a better/faster way, and should I be concerned about doing it this way?

Cheers,
Adversus.