[Bf-blender-cvs] [ae792e9] master: Fix T39479: Transform mouse constraint fails in some situations.

Bastien Montagne noreply at git.blender.org
Sun Apr 6 11:16:03 CEST 2014


Commit: ae792e930c30157e6e591e79d590f1bbe60c8890
Author: Bastien Montagne
Date:   Sun Apr 6 11:11:56 2014 +0200
https://developer.blender.org/rBae792e930c30157e6e591e79d590f1bbe60c8890

Fix T39479: Transform mouse constraint fails in some situations.

Some more float precision issue...

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

M	source/blender/editors/transform/transform_constraints.c

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

diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index 9cc65c2..4cc8833 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -969,13 +969,13 @@ static void setNearestAxis3d(TransInfo *t)
 		sub_v2_v2v2(axis, axis_2d, t->center2d);
 		axis[2] = 0.0f;
 
-		if (normalize_v3(axis) != 0.0f) {
+		if (normalize_v3(axis) > 1e-3f) {
 			project_v3_v3v3(proj, mvec, axis);
 			sub_v3_v3v3(axis, mvec, proj);
 			len[i] = normalize_v3(axis);
 		}
 		else {
-			len[i] = 10000000000.0f;
+			len[i] = 1e10f;
 		}
 	}




More information about the Bf-blender-cvs mailing list