From bfb64e765731818614cb6fea7b30ccebb7c1cd05 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 4 Jun 2016 23:48:05 +0200 Subject: [PATCH] Fixed missing vec1 overload to length2 and distance2 functions #431 --- glm/gtx/norm.hpp | 31 +++++------------- glm/gtx/norm.inl | 85 ++++++++++++++---------------------------------- readme.md | 1 + 3 files changed, 34 insertions(+), 83 deletions(-) diff --git a/glm/gtx/norm.hpp b/glm/gtx/norm.hpp index f1d8d1b2..87fd5b04 100644 --- a/glm/gtx/norm.hpp +++ b/glm/gtx/norm.hpp @@ -55,31 +55,18 @@ namespace glm /// @addtogroup gtx_norm /// @{ - //! Returns the squared length of x. - //! From GLM_GTX_norm extension. - template + /// Returns the squared length of x. + /// From GLM_GTX_norm extension. + template class vecType> GLM_FUNC_DECL T length2( - T const & x); + vecType const & x); - //! Returns the squared length of x. - //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL typename genType::value_type length2( - genType const & x); - - //! Returns the squared distance between p0 and p1, i.e., length2(p0 - p1). - //! From GLM_GTX_norm extension. - template + /// Returns the squared distance between p0 and p1, i.e., length2(p0 - p1). + /// From GLM_GTX_norm extension. + template class vecType> GLM_FUNC_DECL T distance2( - T const & p0, - T const & p1); - - //! Returns the squared distance between p0 and p1, i.e., length2(p0 - p1). - //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL typename genType::value_type distance2( - genType const & p0, - genType const & p1); + vecType const & p0, + vecType const & p1); //! Returns the L1 norm between x and y. //! From GLM_GTX_norm extension. diff --git a/glm/gtx/norm.inl b/glm/gtx/norm.inl index 2b8e9820..29ee52b0 100644 --- a/glm/gtx/norm.inl +++ b/glm/gtx/norm.inl @@ -30,81 +30,44 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// -namespace glm +namespace glm{ +namespace detail { - template - GLM_FUNC_QUALIFIER T length2 - ( - T const & x - ) + template