From 3b3dcd7d03f51a921bd2ac70cf615cba36c18a3a Mon Sep 17 00:00:00 2001 From: plasmacel Date: Mon, 24 Nov 2014 01:10:21 +0100 Subject: [PATCH 1/4] Update quaternion.hpp --- glm/gtc/quaternion.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 12730932..cdf63534 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -102,7 +102,11 @@ namespace glm template GLM_FUNC_DECL tquat(tquat const & q); # endif - + + // explicit conversion operators + GLM_FUNC_DECL explicit operator tmat3(); + GLM_FUNC_DECL explicit operator tmat4(); + /// Create a quaternion from two normalized axis /// /// @param u A first normalized axis From 4581d25ec9218aa56a31a43f459337dea824681d Mon Sep 17 00:00:00 2001 From: plasmacel Date: Mon, 24 Nov 2014 01:16:07 +0100 Subject: [PATCH 2/4] Update quaternion.inl --- glm/gtc/quaternion.inl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 70587b86..18cf0ac0 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -172,6 +172,16 @@ namespace detail { *this = quat_cast(m); } + + GLM_FUNC_DECL explicit operator tmat3() + { + return mat3_cast(*this); + } + + GLM_FUNC_DECL explicit operator tmat4() + { + return mat4_cast(*this); + } template GLM_FUNC_QUALIFIER tquat conjugate(tquat const & q) From 36075c49947a3ce16dd052d858411874a1eac0eb Mon Sep 17 00:00:00 2001 From: plasmacel Date: Mon, 24 Nov 2014 01:33:29 +0100 Subject: [PATCH 3/4] Update quaternion.hpp --- glm/gtc/quaternion.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index cdf63534..31fe68e6 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -104,8 +104,8 @@ namespace glm # endif // explicit conversion operators - GLM_FUNC_DECL explicit operator tmat3(); - GLM_FUNC_DECL explicit operator tmat4(); + GLM_FUNC_DECL explicit operator tmat3x3(); + GLM_FUNC_DECL explicit operator tmat4x4(); /// Create a quaternion from two normalized axis /// From 017e97d5547053ea328a1ae4f90eed4764d3137a Mon Sep 17 00:00:00 2001 From: plasmacel Date: Mon, 24 Nov 2014 01:34:36 +0100 Subject: [PATCH 4/4] Update quaternion.inl --- glm/gtc/quaternion.inl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 18cf0ac0..049df569 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -173,12 +173,14 @@ namespace detail *this = quat_cast(m); } - GLM_FUNC_DECL explicit operator tmat3() + template + GLM_FUNC_QUALIFIER tquat::operator tmat3x3() { return mat3_cast(*this); } - GLM_FUNC_DECL explicit operator tmat4() + template + GLM_FUNC_QUALIFIER tquat::operator tmat4x4() { return mat4_cast(*this); }