diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-11-19 02:07:32 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-11-19 02:07:32 +0300 |
commit | 2bb9d5471e1c43ebb1ec805648536edac9f78105 (patch) | |
tree | d240255e3763af312faa7dbe4c3ef7feb4d46df7 /source/blender/python/api2_2x/Bone.c | |
parent | 904dfcc6a294aa4be904b026295f6f759a72df1b (diff) |
Fix for bug #5250: inaccurate conversion between edit and pose mode bones.
Using acos(dot(u, v)) to find the angle between two vectors is quite
inaccurate, and there's a better way to do it, as explained here:
http://www.plunk.org/~hatch/rightway.php
Also changed the use of atan for computing roll to atan2 in some places,
the latter avoids accuracy and division by zero issues.
Diffstat (limited to 'source/blender/python/api2_2x/Bone.c')
-rw-r--r-- | source/blender/python/api2_2x/Bone.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Bone.c b/source/blender/python/api2_2x/Bone.c index 0d6594e2aef..e00ccd00477 100644 --- a/source/blender/python/api2_2x/Bone.c +++ b/source/blender/python/api2_2x/Bone.c @@ -69,7 +69,7 @@ static double boneRoll_ToArmatureSpace(struct Bone *bone) Mat3Inv(imat, postmat); Mat3MulMat3(difmat, imat, premat); - roll = atan(difmat[2][0] / difmat[2][2]); + roll = atan2(difmat[2][0], difmat[2][2]); if (difmat[0][0] < 0.0){ roll += M_PI; } |