diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-20 16:57:35 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-20 17:02:48 +0300 |
commit | 391096252b8848099517f4e78dec020e4707f2a3 (patch) | |
tree | 3d9ec9df362c43422f5f8bd420e917d369584bae /source/blender/blenlib | |
parent | d4315398fc7f2a0b02f83d23f4d942e10df51059 (diff) |
Fix T42638: Roll angle inconsistent flip in edit mode.
Basically, `angle_compat_rad()` was completely broken -
example of result it could produce:
| new angle | compat angle | result
| -0.000000 | 3.141593 | -> 3.141593
... Where 0.0 (or 2 * PI) would be expected!
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 9a6515daf68..3ac031d7b90 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -1867,7 +1867,7 @@ float angle_wrap_deg(float angle) /* 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; + return angle_compat + angle_wrap_rad(angle - angle_compat); } /* axis conversion */ |