diff options
author | Martin Poirier <theeth@yahoo.com> | 2007-05-21 22:15:24 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2007-05-21 22:15:24 +0400 |
commit | 5faddf5703c3ee380eba0e983c658736807ce5fc (patch) | |
tree | 52ce157733c3fb6a499b4a8f0d22017a302644ae /source/blender | |
parent | 7df1d78a99061ad3238e3ddd50c880024b2f4818 (diff) |
=== Bugfix ===
Fix float error in Transform Contraint with planar constraints when the plane was perpendicular to the viewport. This could cause some weird erratic behavior.
Diffstat (limited to 'source/blender')
-rwxr-xr-x | source/blender/src/transform_constraints.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/src/transform_constraints.c b/source/blender/src/transform_constraints.c index 423bee574f2..4e9004a30ef 100755 --- a/source/blender/src/transform_constraints.c +++ b/source/blender/src/transform_constraints.c @@ -218,7 +218,9 @@ static void planeProjection(TransInfo *t, float in[3], float out[3]) { VecSubf(vec, out, in); factor = Inpf(vec, norm); - if (factor == 0.0f) return; /* prevent divide by zero */ + if (fabs(factor) <= FLT_EPSILON) { + return; /* prevent divide by zero */ + } factor = Inpf(vec, vec) / factor; VECCOPY(vec, norm); |