From 96fa58e22cde8329bfc5639f9a68c85be9473b1d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 31 Aug 2015 20:05:49 +1000 Subject: Math Lib: Add closest_to_plane helper functions - closest_to_plane3 (for float3 planes) - closest_to_plane*_normalized_v3 (for unit length planes) Use when the plane is known to be unit length --- source/blender/blenlib/BLI_math_geom.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/blenlib/BLI_math_geom.h') diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 1a25f9f897f..c4bb3cc7778 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -119,7 +119,10 @@ float dist_signed_squared_to_corner_v3v3v3( float closest_to_line_v3(float r[3], const float p[3], const float l1[3], const float l2[3]); float closest_to_line_v2(float r[2], const float p[2], const float l1[2], const float l2[2]); void closest_to_line_segment_v3(float r_close[3], const float p[3], const float l1[3], const float l2[3]); +void closest_to_plane_normalized_v3(float r_close[3], const float plane[4], const float pt[3]); void closest_to_plane_v3(float r_close[3], const float plane[4], const float pt[3]); +void closest_to_plane3_normalized_v3(float r_close[3], const float plane[3], const float pt[3]); +void closest_to_plane3_v3(float r_close[3], const float plane[3], const float pt[3]); /* 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]); -- cgit v1.2.3