Handling colision between 2 colshapes

bonjovi
Posts: 35
Joined: Mon Jul 20, 2009 12:58 pm

Handling colision between 2 colshapes

Post by bonjovi »

Hi,

I would like to handle collisions from colshapes: It seems that using the callbacks (nearcallback, broadphase, custommaterial etc.), we can handle collision between bodies only. In our case, we are using compound geom (and bodies with only 1 geom), and it is impossible to know exactly what is the colshape that is in contact (the callbacks give the body-> the compound-> that contains several colshapes <- what is the one that is in contact).

So is there a way to handle collision between colshapes ?

Also (for our futur) this information is very important because i would like to attach differents materials on colshapes and handle it. For exemple, the foots of a table don't have the same material than the rectangle -> but are inside an unique compound ...

In ODE (grrr) the nearcallback gives this information (colision from colshape1 with colshape2). Using this information it is easy to get bodies (if required) . It seems that is the inverse in Bullet ?

Thank you for your help.
rrck
Posts: 26
Joined: Mon Sep 21, 2009 7:30 am

Re: Handling colision between 2 colshapes

Post by rrck »

As I understand(reading change log), in last library version was added possibility to know with which shape (from compound shape) was collided. In contact added callback partId should be setted to shape id.
bonjovi
Posts: 35
Joined: Mon Jul 20, 2009 12:58 pm

Re: Handling colision between 2 colshapes

Post by bonjovi »

Thank you for help !!