ignore collisions between a chain of constrained bodies

gjaegy
Posts: 178
Joined: Fri Apr 18, 2008 2:20 pm

ignore collisions between a chain of constrained bodies

Post by gjaegy »

Hi,

Let's consider the following case: rigid body A is linked to B using a PointToPoint constraint, B is linked to C using another PointToPoint constraint.

Bullet easily allow to ignore collision between A & B, and between B & C.

I am trying to figure out what would be the cleanest method to ignore the collision between A & C as well.

One method would be to call btRigidBody::addConstraintRef(), which is the method actually used by bullet internally. However, this means I would have to maintain a list constraint->body to handle the situations where one constraint would be deleted from the world.

Would there be an easiest/cleanest solution ?

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

Re: ignore collisions between a chain of constrained bodies

Post by Erwin Coumans »

Currently, the easiest/cleanest solution is to derive your own version of a btCollisionDispatcher and derive the 'needsCollision' and/or 'needsResponse' method.

See also http://bulletphysics.org/mediawiki-1.5. ... _Filtering at the bottom of the page,
or this recent thread: http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=4853

Thanks,
Erwin
gjaegy
Posts: 178
Joined: Fri Apr 18, 2008 2:20 pm

Re: ignore collisions between a chain of constrained bodies

Post by gjaegy »

Thanks Erwin, I thought there were other ways when objects were chained :)
This will do the job !