diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-19 08:37:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-19 08:37:28 +0400 |
commit | c68d5325d0706305937372e42bd981197440de24 (patch) | |
tree | a05ad791acc1fd82a8cb7dd3862599b275b03e27 /source/blender/blenlib/intern/math_rotation.c | |
parent | 926e0e7eb71726fdd1be3f9d299bf3d9c3ad0a7a (diff) |
fix for [#34283] wasn't working in my tests (attached to original report),
made bone roll get compatible angle values with the original roll.
Diffstat (limited to 'source/blender/blenlib/intern/math_rotation.c')
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index c0ea817ae4a..26576b2dcb2 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -1740,6 +1740,12 @@ float angle_wrap_deg(float angle) return mod_inline(angle + 180.0f, 360.0f) - 180.0f; } +/* returns an angle compatible with angle_compat */ +float angle_compat_rad(float angle, float angle_compat) +{ + return angle + (floorf(((angle_compat - angle) / (float)M_PI) + 0.5f)) * (float)M_PI; +} + /* axis conversion */ static float _axis_convert_matrix[23][3][3] = { {{-1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, {0.0, 0.0, 1.0}}, |