Bullet specific collision grouping


I’m relatively new to using Panda3D, but I’ve begun working on my own setup for a fps type game using the Bullet module. The basic idea for this experimental version of the game is to have items drop at some point in the world and collide with the environment, such as the ground and the player, but to not collide with other items. (I don’t want the items to stack up on top of each other)

I tried searching this forum, as well as Bullet’s forum, for the answer, but found nothing. Perhaps I don’t know what to search for and this has already been answered.

In my demo script, I have a Bullet Plane to ‘catch’ the rigid body objects that I add above it. The plane is temporary, and I will eventually be adding a finite environment to interact with. I have also created rigid body boxes to act as the items.

I set the collision mask on the item boxes to 0 (also tried BitMask.allOff()), thinking they would not collide with each other. This proved to be true, but I noticed that they did collide with the infinite plane that I mentioned before. So I replaced the plane with a flat rigid body box, but the items fell through it (logically).

Because this game won’t be based on an infinite plane, I would like to know if there is any way to do what was asked at the top:
Getting objects to collide with other [finite] objects, but not those of their own kind/collision mask.


the default collision filter algorithm, as described on the manual page (http://www.panda3d.org/manual/index.php/Bullet_Collision_Filtering), won’t be sufficient for your needs. But we have implemented two other collision filter algorithms. See for example this post: [url]Panda Bullet].

The zip-file with samples (can be downloaded from the manual pages) have demos for all three implementations:

  • 04_Filtering.py : the “default” algorithm
  • 05_FilteringExtended.py : <-- this is what you need, the “group-mask” algorithm
  • 06_FilteringPython.py : callback-based

Thanks enn0x, that was what I was looking for.