From 37d11907d0a96a68d1200bf57c6efdb31f4692e4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 6 Dec 2007 19:44:17 +0000 Subject: Bugfix for IK locked axes with an initial rotation, gave wrong starting angle in some cases, but wasn't always noticeable due to the IK solver changing it anyway. Bugfix for hidden bones in pose mode still being active, and preventing other bones from becoming active. --- intern/iksolver/intern/IK_QSegment.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'intern/iksolver') diff --git a/intern/iksolver/intern/IK_QSegment.cpp b/intern/iksolver/intern/IK_QSegment.cpp index a5217ed91d6..bf38c369363 100644 --- a/intern/iksolver/intern/IK_QSegment.cpp +++ b/intern/iksolver/intern/IK_QSegment.cpp @@ -61,11 +61,11 @@ static MT_Scalar EulerAngleFromMatrix(const MT_Matrix3x3& R, int axis) MT_Scalar t = sqrt(R[0][0]*R[0][0] + R[0][1]*R[0][1]); if (t > 16.0*MT_EPSILON) { - if (axis == 0) return atan2(R[1][2], R[2][2]); + if (axis == 0) return -atan2(R[1][2], R[2][2]); else if(axis == 1) return atan2(-R[0][2], t); - else return atan2(R[0][1], R[0][0]); + else return -atan2(R[0][1], R[0][0]); } else { - if (axis == 0) return atan2(-R[2][1], R[1][1]); + if (axis == 0) return -atan2(-R[2][1], R[1][1]); else if(axis == 1) return atan2(-R[0][2], t); else return 0.0f; } -- cgit v1.2.3