Collision groups per shape

Gunwizard
Posts: 2
Joined: Fri Jul 27, 2007 11:17 am

Collision groups per shape

Post by Gunwizard »

I have a question concerning collision filtering:

Atm it seems that the broadphase collision filtering happens on a per-object basis. The collision groups and masks are set for broadphase proxies, so each object has only one collision filtering setting. In ODE on the other hand you can set collision filters for each "geometry" (= shape) individually, so an object can consist of several different parts. This is useful for e.g. character movement and character projectile damage - the first would have a simple cylinder or capsule to prevent walking through obstacles, while the second shape is a ragdoll with different parts for projectile damage.

Is it possible to do a similar thing in Bullet ? Do i have to create two objects with different collision groups and glue them together somehow ? Is it a possibility for future development or does it generally interfere with Bullet's collision system ?

I am using a slightly modified version of the OgreBullet wrapper btw, but that should not be a problem.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Yes, it is possible in several ways.

Bullet provides a new btUniformScalingShape, which you can derive your own version from, and store per-instance collisionFilterFlags/Mask. Then you need to write your custom btOverlapFilterCallback, that uses this data.

ODE geometry might not be exactly the same as a Bullet shape I think. Bullet shapes can be re-used for several rigidbody instances. Does a ODE geometry carry any per-instance data, like transform?

Usually, a character is either in 'ragdoll state' or proxy, so do you already switch between states? If so, it might be better to just keep both objects in sync. A ragdoll demo just got added, and a character controller is planned. I'll keep your request in mind when writing some sample character controller.

Thanks,
Erwin
Gunwizard
Posts: 2
Joined: Fri Jul 27, 2007 11:17 am

Post by Gunwizard »

Thanks for the answer, this will surely help me :)

I am quite new to Bullet, i have to take a closer look to this and some other stuff. The ragdoll demo is a great addition, thanks for that too.

About ODE's way of handling geoms: I have used the OgreOde wrapper without caring much about the internals of the C api (OO programming is one reason among others i switched to Bullet). But afaik ODE distinguishes between placeable and non-placeable geometries, the former having transforms applied to them.
Maybe i can contribute to the OgreBullet wrapper, once i get used to the engine a little more :roll:

In case anyone is interested, we're going to use Bullet in a game project called "Verdun-Online", a multiplayer shooter game depicting the first world-war and the battle of Verdun in particular. It's still in a very early stage, but we're making good progress. Good ideas for the use of physics are always welcome 8)
http://www.verdun-online.com/index.php

Best regards
Lukas Toenne