From 1e3a12d8b5bde23b3b6dc6197eb5b7afeeb83788 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 15 Jun 2011 19:35:33 +0100 Subject: [PATCH] Fixed ticket #112, euler angle functions return degrees. --- glm/gtx/quaternion.hpp | 8 ++++---- glm/gtx/quaternion.inl | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/glm/gtx/quaternion.hpp b/glm/gtx/quaternion.hpp index 91a09300..c41c0f92 100644 --- a/glm/gtx/quaternion.hpp +++ b/glm/gtx/quaternion.hpp @@ -141,19 +141,19 @@ namespace quaternion ///< GLM_GTX_quaternion extension: Quaternion types and fun valType extractRealComponent( detail::tquat const & q); - //! Returns roll value of euler angles. + //! Returns roll value of euler angles in degrees. //! From GLM_GTX_quaternion extension. template valType roll( detail::tquat const & x); - //! Returns pitch value of euler angles. + //! Returns pitch value of euler angles in degrees. //! From GLM_GTX_quaternion extension. template valType pitch( detail::tquat const & x); - //! Returns yaw value of euler angles. + //! Returns yaw value of euler angles in degrees. //! From GLM_GTX_quaternion extension. template valType yaw( @@ -162,7 +162,7 @@ namespace quaternion ///< GLM_GTX_quaternion extension: Quaternion types and fun //! Returns euler angles, yitch as x, yaw as y, roll as z. //! From GLM_GTX_quaternion extension. template - detail::tvec3 eularAngles( + detail::tvec3 eulerAngles( detail::tquat const & x); //! Converts a quaternion to a 3 * 3 matrix. diff --git a/glm/gtx/quaternion.inl b/glm/gtx/quaternion.inl index 910cdd78..b63f8025 100644 --- a/glm/gtx/quaternion.inl +++ b/glm/gtx/quaternion.inl @@ -215,7 +215,7 @@ namespace quaternion detail::tquat const & q ) { - return atan2(valType(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z); + return glm::degrees(atan2(valType(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z)); } template @@ -224,7 +224,7 @@ namespace quaternion detail::tquat const & q ) { - return atan2(valType(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z); + return glm::degrees(atan2(valType(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z)); } template @@ -233,11 +233,11 @@ namespace quaternion detail::tquat const & q ) { - return asin(valType(-2) * (q.x * q.z - q.w * q.y)); + return glm::degrees(asin(valType(-2) * (q.x * q.z - q.w * q.y))); } template - GLM_FUNC_QUALIFIER detail::tvec3 eularAngles + GLM_FUNC_QUALIFIER detail::tvec3 eulerAngles ( detail::tquat const & x )