[Bf-blender-cvs] [3910962] master: Fix T42638: Roll angle inconsistent flip in edit mode.

Bastien Montagne noreply at git.blender.org
Thu Nov 20 15:06:42 CET 2014


Commit: 391096252b8848099517f4e78dec020e4707f2a3
Author: Bastien Montagne
Date:   Thu Nov 20 14:57:35 2014 +0100
Branches: master
https://developer.blender.org/rB391096252b8848099517f4e78dec020e4707f2a3

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!

===================================================================

M	source/blender/blenlib/intern/math_rotation.c

===================================================================

diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 9a6515d..3ac031d 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 */




More information about the Bf-blender-cvs mailing list