Fixed GLM quaternion floating point error edge case when converting to euler angles

This commit is contained in:
2015-12-16 15:28:23 +01:00
parent f20b9cc13b
commit e63991581a
+1 -1
View File
@@ -591,7 +591,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T yaw(tquat<T, P> const & q) GLM_FUNC_QUALIFIER T yaw(tquat<T, P> const & q)
{ {
return asin(T(-2) * (q.x * q.z - q.w * q.y)); return asin(clamp(T(-2) * (q.x * q.z - q.w * q.y), T(-1), T(1)));
} }
template <typename T, precision P> template <typename T, precision P>