how do i disable collisions between a group of objects?
what i want is to add a new set of objects to the world that will collide with everything except each other.
i have used getBroadphaseProxy()->m_collisionFilterGroup to give them all their own group, but if i set m_collisionFilterMask to zero then they won't collide with anything at all, and if i leave it as is, then they will collide with everything (including themselves)
how should i be setting this up?
disable collisions
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: disable collisions
For games you will run soon into collision filter problems that can't be matched by Bullets functionality.
I suggest you do your own collision match system and implement an own customNearCallback.
void customNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, btDispatcherInfo& dispatchInfo)
{
..your collision match system here..
// if objects should have normal bullet collision:
dispatcher.defaultNearCallback(collisionPair, dispatcher, dispatchInfo);
}
bltDispatcher ->setNearCallback(yourCustomNearCallback);
I suggest you do your own collision match system and implement an own customNearCallback.
void customNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, btDispatcherInfo& dispatchInfo)
{
..your collision match system here..
// if objects should have normal bullet collision:
dispatcher.defaultNearCallback(collisionPair, dispatcher, dispatchInfo);
}
bltDispatcher ->setNearCallback(yourCustomNearCallback);
-
- Posts: 2
- Joined: Mon May 26, 2008 7:21 am
Re: disable collisions
great, thanks for the tip pico, its all working fine now, just a bit of a shame there wasn't "out of the box" support from bullet..
-
- Posts: 145
- Joined: Tue Oct 30, 2007 9:23 pm
Re: disable collisions
Bullet can do it based on collision masks, I documented it here: http://chunkyks.com/bulletthings.pdf
Gary (-;
Gary (-;