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).
This commit is contained in:
Germano Cavalcante 2019-08-12 17:13:23 -03:00
parent 1a8dccd70a
commit bb1719ddb5
Notes: blender-bot 2023-02-14 04:40:22 +01:00
Referenced by issue #68547, Transform operator constrained to 2 axes snaps when it shouldn't on small scales.
1 changed files with 1 additions and 1 deletions

View File

@ -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;