diff --git a/include/glm/gtc/quaternion.inl b/include/glm/gtc/quaternion.inl index 4c8565b..284f4fe 100644 --- a/include/glm/gtc/quaternion.inl +++ b/include/glm/gtc/quaternion.inl @@ -591,7 +591,7 @@ namespace detail template GLM_FUNC_QUALIFIER T yaw(tquat 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