[Bf-blender-cvs] [bb1719ddb5d] master: Fix T68547: Plane Constraint inaccuracy

mano-wii noreply at git.blender.org
Mon Aug 12 22:13:42 CEST 2019


Commit: bb1719ddb5d07746ff443f87e8e019195728abd9
Author: mano-wii
Date:   Mon Aug 12 17:13:23 2019 -0300
Branches: master
https://developer.blender.org/rBbb1719ddb5d07746ff443f87e8e019195728abd9

Fix T68547: Plane Constraint inaccuracy

If it is to prevent division by zero just check if the `factor` is zero (instead of using an epsilon).

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

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 f78f5c5e623..6a6d3b78d38 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -326,7 +326,7 @@ static void planeProjection(const TransInfo *t, const float in[3], float out[3])
   sub_v3_v3v3(vec, out, in);
 
   factor = dot_v3v3(vec, norm);
-  if (fabsf(factor) <= 0.001f) {
+  if (factor == 0.0f) {
     return; /* prevent divide by zero */
   }
   factor = dot_v3v3(vec, vec) / factor;



More information about the Bf-blender-cvs mailing list