Per shape collision group

User avatar
IvanEfimov
Posts: 3
Joined: Mon Dec 12, 2011 6:44 pm
Location: Kazan, Russia

Per shape collision group

Post by IvanEfimov »

Hi,
First of all want say thanks for the great physics library!

I have body with btCompoundShape, which contains many shapes. Need to have ability to define contact group for each shape in the body.
Please tell, how best to make per shape contact group filtering?

I found old similar topic about it, but this is not helps: http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=1324
btUniformScalingShape can't contain btBvhTriangleMeshShape because this class is not delivered from btConvexShape.
Our bodies can contain btBvhTriangleMeshShape.
User avatar
IvanEfimov
Posts: 3
Joined: Mon Dec 12, 2011 6:44 pm
Location: Kazan, Russia

Re: Per shape collision group

Post by IvanEfimov »

up
kloplop321
Posts: 55
Joined: Sun Jan 01, 2012 7:37 pm

Re: Per shape collision group

Post by kloplop321 »

Only bodies can have their own contact/collision groups. Not shapes.
If you want to have different collision flags, you need to treat each desired collision group as its own possibly compound body.
Then, if you want the body to stay together, use constraints.
mi076
Posts: 144
Joined: Fri Aug 01, 2008 6:36 am
Location: Bonn, Germany

Re: Per shape collision group

Post by mi076 »

I have body with btCompoundShape, which contains many shapes.
...
Our bodies can contain btBvhTriangleMeshShape.
afaik btBvhTriangleMeshShape is not supported as child shape for compound, gimpact too....
(use convex hull). You can also use several submeshes in mesh shapes instead.
Collision tests return part id and index id, so you can identify child shape of compound or submesh of mesh shape with it.
User avatar
IvanEfimov
Posts: 3
Joined: Mon Dec 12, 2011 6:44 pm
Location: Kazan, Russia

Re: Per shape collision group

Post by IvanEfimov »

Thanks for replies!

Oh, It is impossible make body with two Box shapes, each of which will have its own contact group?
PhysX, ODE can.
Maybe exists a sightly way?