From 014a7f8404410b9f384f91db4cc961852ebc7c87 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 16 Dec 2015 15:57:29 +0100 Subject: [PATCH] This fixes #461 --- glm/gtc/quaternion.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index e5fe5505..b46cd62c 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -664,7 +664,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