Collision mask oddity.

Emmanuel Julien
Posts: 2
Joined: Mon Aug 02, 2010 10:49 am
Location: France

Collision mask oddity.

Post by Emmanuel Julien »

Hi,

I'm having a strange issue with the collision masks. It works as it should in most case except when I change an item collision mask in reaction to a collision in order to prevent further collisions with the offending item collision group.

Eg. Ship collides with an item from the 'Colliders' group so the ship energy is decreased and the 'Colliders' bit is removed from the ship collision mask for 5 seconds.

What's happening is that the filter won't be 'updated' until the current collision first stops. I'm pretty sure it has to do with collision pair caching and the filtering mechanism happening much earlier in the pipeline. Am I missing some function to call to flush the collision pair cache? And if not, how should I proceed to solve this bug?

Thanks, have a good day.
Emmanuel Julien
Posts: 2
Joined: Mon Aug 02, 2010 10:49 am
Location: France

Re: Collision mask oddity.

Post by Emmanuel Julien »

In case somebody is looking for the answer (as it is a pretty common use case, or so I thought :roll: ):

Code: Select all

btworld->getBroadphase()->getOverlappingPairCache()->removeOverlappingPairsContainingProxy(rigid_body->getBroadphaseHandle(), btworld->getDispatcher());
magicchicken
Posts: 11
Joined: Tue Dec 09, 2008 9:42 pm

Re: Collision mask oddity.

Post by magicchicken »

Thank you, i just need this!