Collisions on multiple shape

fredb219
Posts: 1
Joined: Mon Jun 29, 2009 9:11 pm

Collisions on multiple shape

Post by fredb219 »

I have rigidBody with multiple shape so I use and CompoundShape. However, i need to know the child shape which collide and not only the rigidBody and the location.

There is a mean to know the colliding child shape in a compoundShape ?

I also can create a class with several rigidBody to solve my problem but I dont't found joint to fix 2 rigidBody together.

If you have an idea ...

Thanks !
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Collisions on multiple shape

Post by Erwin Coumans »

You can get access to the child shape index of the colliding btCompoundShape, by using a collision contact callback.

See this wiki page on contact callbacks. The partId/index contains the child index.

** edit ** after checking it, this feature is currently not working for btCompoundShape. Please wait for final Bullet 2.75 release later this week, the Bullet/Demos/ConvexDecompositionDemo will show how to get access to child indices for compound shapes.
Hope this helps,
Erwin