diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-08-31 15:15:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-08-31 15:15:27 +0300 |
commit | 6a53e658d31220de0399d1460747307ce4b5d81f (patch) | |
tree | e24f7877abd460cf2c05bd2faa064ca80654f6e2 /source/blender/blenlib/BLI_math_geom.h | |
parent | e503e37333bd5d9d409530448d767bcd709f4a5a (diff) |
Alternate fix for T45849: tri-tri intersect error
Project both triangles onto the same plane to simplify calculations.
Diffstat (limited to 'source/blender/blenlib/BLI_math_geom.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_geom.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index c4bb3cc7778..0f389fb7045 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -127,9 +127,17 @@ void closest_to_plane3_v3(float r_close[3], const float plane[3], const float pt /* Set 'r' to the point in triangle (t1, t2, t3) closest to point 'p' */ void closest_on_tri_to_point_v3(float r[3], const float p[3], const float t1[3], const float t2[3], const float t3[3]); - -float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3]); -float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2]); +float line_point_factor_v3_ex( + const float p[3], const float l1[3], const float l2[3], + const float epsilon, const float fallback); +float line_point_factor_v3( + const float p[3], const float l1[3], const float l2[3]); + +float line_point_factor_v2_ex( + const float p[2], const float l1[2], const float l2[2], + const float epsilon, const float fallback); +float line_point_factor_v2( + const float p[2], const float l1[2], const float l2[2]); float line_plane_factor_v3(const float plane_co[3], const float plane_no[3], const float l1[3], const float l2[3]); |