From 391096252b8848099517f4e78dec020e4707f2a3 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 20 Nov 2014 14:57:35 +0100 Subject: 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! --- source/blender/blenlib/intern/math_rotation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') 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 */ -- cgit v1.2.3