I was wondering how a btConeTwistConstraint should behave when first two parameters of its setLimit function (_swingSpan1, _swingSpan2) are different, and also a _twistSpan is set, e.g. something like this:
Code: Select all
btConeTwistConstraint *joint1 = new btConeTwistConstraint( *capsuleBody1, *capsuleBody2, localA, localB );
joint1->setLimit( DEGREETORAD( 30 ), DEGREETORAD( 60 ), DEGREETORAD( 90 ) );
localA is the transformation of the constraint in the local space of the first body, abd localB is the transform of the constraint in the local space of the second body, so when the whole system is imagined in "world space" they give the same position and orientation.
I expected the second body to be able to move inside a fixed cone defined by _swingSpan1 and _swingSpan2 independent from the actual twist value!
Instead it seems that the axes of _swingSpan1 and _swingSpan2 are rotated by the twist rotation.
Is it OK this way?
It also seems strange because if I only allow one of the two swing limits and set the other to 0, that one swing axis is not rotated by the twist rotation.
Any idea how it should work?