Fixed ticket #112, euler angle functions return degrees.

master
Christophe Riccio ago%!(EXTRA string=14 years)
parent 7559439c93
commit 1e3a12d8b5
  1. 8
      glm/gtx/quaternion.hpp
  2. 8
      glm/gtx/quaternion.inl

@ -141,19 +141,19 @@ namespace quaternion ///< GLM_GTX_quaternion extension: Quaternion types and fun
valType extractRealComponent( valType extractRealComponent(
detail::tquat<valType> const & q); detail::tquat<valType> const & q);
//! Returns roll value of euler angles. //! Returns roll value of euler angles in degrees.
//! From GLM_GTX_quaternion extension. //! From GLM_GTX_quaternion extension.
template <typename valType> template <typename valType>
valType roll( valType roll(
detail::tquat<valType> const & x); detail::tquat<valType> const & x);
//! Returns pitch value of euler angles. //! Returns pitch value of euler angles in degrees.
//! From GLM_GTX_quaternion extension. //! From GLM_GTX_quaternion extension.
template <typename valType> template <typename valType>
valType pitch( valType pitch(
detail::tquat<valType> const & x); detail::tquat<valType> const & x);
//! Returns yaw value of euler angles. //! Returns yaw value of euler angles in degrees.
//! From GLM_GTX_quaternion extension. //! From GLM_GTX_quaternion extension.
template <typename valType> template <typename valType>
valType yaw( 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. //! Returns euler angles, yitch as x, yaw as y, roll as z.
//! From GLM_GTX_quaternion extension. //! From GLM_GTX_quaternion extension.
template <typename valType> template <typename valType>
detail::tvec3<valType> eularAngles( detail::tvec3<valType> eulerAngles(
detail::tquat<valType> const & x); detail::tquat<valType> const & x);
//! Converts a quaternion to a 3 * 3 matrix. //! Converts a quaternion to a 3 * 3 matrix.

@ -215,7 +215,7 @@ namespace quaternion
detail::tquat<valType> const & q detail::tquat<valType> 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 <typename valType> template <typename valType>
@ -224,7 +224,7 @@ namespace quaternion
detail::tquat<valType> const & q detail::tquat<valType> 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 <typename valType> template <typename valType>
@ -233,11 +233,11 @@ namespace quaternion
detail::tquat<valType> const & q detail::tquat<valType> 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 <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec3<valType> eularAngles GLM_FUNC_QUALIFIER detail::tvec3<valType> eulerAngles
( (
detail::tquat<valType> const & x detail::tquat<valType> const & x
) )

Loading…
Cancel
Save