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:
2019-08-12 17:13:23 -03:00
parent 1a8dccd70a
commit bb1719ddb5

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;