diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-12-03 14:44:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-12-03 14:45:33 +0300 |
commit | 8c453b599596fa8b1112b165e5c8dcb717264f30 (patch) | |
tree | d0c4302bf4249022251732f45f1863baafd7f2c0 /source | |
parent | 80fa528529e28218084830d4c741bde24b6a8483 (diff) |
Remove redundant zero area face check
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 14e494ab2df..0ff12ebcaa9 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -2401,22 +2401,15 @@ bool isect_point_tri_v3(const float p[3], const float v1[3], const float v2[3], float r_vi[3]) { if (isect_point_tri_prism_v3(p, v1, v2, v3)) { - float no[3], n1[3], n2[3]; + float plane[4]; + float no[3]; /* Could use normal_tri_v3, but doesn't have to be unit-length */ - sub_v3_v3v3(n1, v1, v2); - sub_v3_v3v3(n2, v2, v3); - cross_v3_v3v3(no, n1, n2); - - if (LIKELY(len_squared_v3(no) != 0.0f)) { - float plane[4]; - plane_from_point_normal_v3(plane, v1, no); - closest_to_plane_v3(r_vi, plane, p); - } - else { - /* degenerate */ - copy_v3_v3(r_vi, p); - } + cross_tri_v3(no, v1, v2, v3); + BLI_assert(len_squared_v3(no) != 0.0f); + + plane_from_point_normal_v3(plane, v1, no); + closest_to_plane_v3(r_vi, plane, p); return true; } |