From 2d813b587a1e5cd954ead889b89f91dcd68250c6 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 83a1b66f..043a6a1b 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -597,7 +597,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