Fixed ticket #112, euler angle functions return degrees.

This commit is contained in:
Christophe Riccio 2011-06-15 19:35:33 +01:00
parent 7559439c93
commit 1e3a12d8b5
2 changed files with 8 additions and 8 deletions

View File

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

View File

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