[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54268] trunk/blender/source/blender/ blenlib: add dist_to_line_v3() for completeness, ( had dist_to_line_v2 already)

Campbell Barton ideasman42 at gmail.com
Sun Feb 3 08:24:31 CET 2013


Revision: 54268
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54268
Author:   campbellbarton
Date:     2013-02-03 07:24:31 +0000 (Sun, 03 Feb 2013)
Log Message:
-----------
add dist_to_line_v3() for completeness, (had dist_to_line_v2 already)

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_math_geom.h
    trunk/blender/source/blender/blenlib/intern/math_geom.c

Modified: trunk/blender/source/blender/blenlib/BLI_math_geom.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_math_geom.h	2013-02-03 06:09:29 UTC (rev 54267)
+++ trunk/blender/source/blender/blenlib/BLI_math_geom.h	2013-02-03 07:24:31 UTC (rev 54268)
@@ -68,6 +68,7 @@
 float dist_to_plane_normalized_v3(const float p[3], const float plane_co[3], const float plane_no_unit[3]);
 float dist_to_plane_v3(const float p[3], const float plane_co[3], const float plane_no[3]);
 float dist_to_line_segment_v3(const float p[3], const float l1[3], const float l2[3]);
+float dist_to_line_v3(const float p[3], const float l1[3], const float l2[3]);
 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[3], const float p[3], const float l1[3], const float l2[3]);

Modified: trunk/blender/source/blender/blenlib/intern/math_geom.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_geom.c	2013-02-03 06:09:29 UTC (rev 54267)
+++ trunk/blender/source/blender/blenlib/intern/math_geom.c	2013-02-03 07:24:31 UTC (rev 54268)
@@ -304,6 +304,15 @@
 	return len_v3v3(closest, v1);
 }
 
+float dist_to_line_v3(const float v1[3], const float v2[3], const float v3[3])
+{
+	float closest[3];
+
+	closest_to_line_v3(closest, v1, v2, v3);
+
+	return len_v3v3(closest, v1);
+}
+
 /* Adapted from "Real-Time Collision Detection" by Christer Ericson,
  * published by Morgan Kaufmann Publishers, copyright 2005 Elsevier Inc.
  * 




More information about the Bf-blender-cvs mailing list