From e95993407c22b86225489d4b70bfd8ed089dabb3 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 18 Dec 2013 18:36:54 +0100 Subject: [PATCH] Back ported to GLM 0.9.4 of glm::oriented[angle] not supporting GLM_FORCE_RADIANS #143 --- glm/gtx/vector_angle.inl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/glm/gtx/vector_angle.inl b/glm/gtx/vector_angle.inl index ad221b15..a354f560 100644 --- a/glm/gtx/vector_angle.inl +++ b/glm/gtx/vector_angle.inl @@ -16,7 +16,11 @@ namespace glm genType const & y ) { +#ifdef GLM_FORCE_RADIANS + return acos(dot(x, y)); +#else return degrees(acos(dot(x, y))); +#endif } //! \todo epsilon is hard coded to 0.01 @@ -47,7 +51,11 @@ namespace glm detail::tvec3 const & ref ) { - valType const Angle(glm::degrees(glm::acos(glm::dot(x, y)))); +#ifdef GLM_FORCE_RADIANS + valType const Angle(acos(dot(x, y))); +#else + valType const Angle(glm::degrees(acos(dot(x, y)))); +#endif if(glm::dot(ref, glm::cross(x, y)) < valType(0)) return -Angle;