I'm using a hinge constraint for a servo. You can see it in this image. The small part and the big part are used for the hinge and they are rotating around the global y-axis (actually I used (0,0,1), because there are some rotations involved). I got the following values for the axis when I called getHingeAngle():
Code: Select all
const btVector3 refAxis0(-0.0f,-1.0f, 0.0f);
const btVector3 refAxis1( 0.0f, 0.0f,-0.0f);
const btVector3 swingAxis(0.0f, 0.0f, 0.0f);
btScalar Dot1 = swingAxis.dot(refAxis0);
btScalar Dot2 = swingAxis.dot(refAxis1);
btScalar tanRes = btAtan2Fast( Dot1, Dot2);
But the 0 isn't changing (-> I don't get a proper angle), although the small part is rotating as it should.
Any ideas how to get the angle calculation to work again?
Thanks!