Browse Source

Update closest_point.hpp

Algorithm works fine with 2d points as well...
SiliconKiwi 11 years ago
parent
commit
ad85092433
1 changed files with 7 additions and 0 deletions
  1. 7 0
      glm/gtx/closest_point.hpp

+ 7 - 0
glm/gtx/closest_point.hpp

@@ -56,6 +56,13 @@ namespace glm
 		detail::tvec3<T, P> const & point,
 		detail::tvec3<T, P> const & point,
 		detail::tvec3<T, P> const & a, 
 		detail::tvec3<T, P> const & a, 
 		detail::tvec3<T, P> const & b);
 		detail::tvec3<T, P> const & b);
+	
+	/// 2d lines work as well	
+	template <typename T, precision P>
+	GLM_FUNC_DECL detail::tvec2<T, P> closestPointOnLine(
+		detail::tvec2<T, P> const & point,
+		detail::tvec2<T, P> const & a, 
+		detail::tvec2<T, P> const & b);	
 
 
 	/// @}
 	/// @}
 }// namespace glm
 }// namespace glm