Collisions and Joint Constraints

kmon7485
Posts: 11
Joined: Mon Jan 04, 2010 5:48 am

Collisions and Joint Constraints

Post by kmon7485 »

Do two bodies connected by a hinge or slider constraint no longer undergo collisions with one another?
e.g If you have two boxes connected by a slider joint and you apply a force such that one box runs into
the other, can you make them collide?

At the moment mine just pass through each other, but once
the joint is disconnected they collide properly
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Collisions and Joint Constraints

Post by Erwin Coumans »

When you add a constraint to the dynamics world, you can specify to enable collisions between connected bodies or not, as second argument:

Code: Select all

virtual void	addConstraint(btTypedConstraint* constraint, bool disableCollisionsBetweenLinkedBodies=false);
Have you tried setting the second argument to 'false' ?
Thanks,
Erwin
kmon7485
Posts: 11
Joined: Mon Jan 04, 2010 5:48 am

Re: Collisions and Joint Constraints

Post by kmon7485 »

Thank you so much, that has completely fixed my simulation :D