How to know the condition of constraint

Post Reply
yamasaki
Posts: 7
Joined: Mon Apr 01, 2013 2:32 am

How to know the condition of constraint

Post 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.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: How to know the condition of constraint

Post 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.
yamasaki
Posts: 7
Joined: Mon Apr 01, 2013 2:32 am

Re: How to know the condition of constraint

Post by yamasaki »

Mr. Basroil

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