From d07496460a39d7a94846e6e8eb040bd4d3e8f698 Mon Sep 17 00:00:00 2001 From: Dave Reid Date: Wed, 24 Apr 2013 09:54:28 +1000 Subject: [PATCH] Add the ability to convert a SIMD quat to a standard mat4. --- glm/gtx/simd_quat.hpp | 5 +++++ glm/gtx/simd_quat.inl | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/glm/gtx/simd_quat.hpp b/glm/gtx/simd_quat.hpp index cce5ee61..b60b5650 100644 --- a/glm/gtx/simd_quat.hpp +++ b/glm/gtx/simd_quat.hpp @@ -189,6 +189,11 @@ namespace detail detail::fmat4x4SIMD mat4SIMD_cast( detail::fquatSIMD const & q); + //! Converts a simdQuat to a standard mat4. + //! (From GLM_GTX_simd_quat extension) + mat4 mat4_cast( + detail::fquatSIMD const & q); + /// Returns the length of the quaternion. /// diff --git a/glm/gtx/simd_quat.inl b/glm/gtx/simd_quat.inl index 90b9a730..d4fc4f3a 100644 --- a/glm/gtx/simd_quat.inl +++ b/glm/gtx/simd_quat.inl @@ -365,6 +365,14 @@ GLM_FUNC_QUALIFIER detail::fmat4x4SIMD mat4SIMD_cast return result; } +GLM_FUNC_QUALIFIER mat4 mat4_cast +( + detail::fquatSIMD const & q +) +{ + return mat4_cast(mat4SIMD_cast(q)); +} + GLM_FUNC_QUALIFIER float length