From ad8509243347e8e3abce1031cfaade2f382599c9 Mon Sep 17 00:00:00 2001 From: SiliconKiwi Date: Tue, 16 Sep 2014 09:09:39 +1200 Subject: [PATCH] Update closest_point.hpp Algorithm works fine with 2d points as well... --- glm/gtx/closest_point.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/glm/gtx/closest_point.hpp b/glm/gtx/closest_point.hpp index d0f17155..eb893291 100644 --- a/glm/gtx/closest_point.hpp +++ b/glm/gtx/closest_point.hpp @@ -56,6 +56,13 @@ namespace glm detail::tvec3 const & point, detail::tvec3 const & a, detail::tvec3 const & b); + + /// 2d lines work as well + template + GLM_FUNC_DECL detail::tvec2 closestPointOnLine( + detail::tvec2 const & point, + detail::tvec2 const & a, + detail::tvec2 const & b); /// @} }// namespace glm