Page 1 of 1

How to know the condition of constraint

Posted: Fri Jun 26, 2015 1:02 pm
by yamasaki
Hi.

I constrain two rigid bodies with btConeTwistConstraint.
If a condition of constraint can't be satisfied, is there a way to know that?

Thank you in advance.

Re: How to know the condition of constraint

Posted: Sun Jun 28, 2015 2:50 am
by Basroil
You can always do the calculation yourself using the local transforms of the constraint point. Fairly easy to do with fixed (zero DOF), point (3DOF in rotation, but you can ignore orientation), hinge (one DOF in Z rotation), and slider constraints (one linear DOF), but cone shouldn't be any different (even with restricted 3DOF). Just see if the constraint point as seen from bodyA matches the same position and orientation as the constraint point as seen from bodyB. If they are significantly different then your constraint is probably broken in the current step. For a cone-twist, a significant difference for position is anything larger than the floating point error, and for orientation it's anything outside the cone.

Re: How to know the condition of constraint

Posted: Wed Jul 01, 2015 6:00 am
by yamasaki
Mr. Basroil

Thank you for your reply.
I got what I want to know in your answer.