diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 5b669c8b..037d16c7 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -204,6 +204,13 @@ namespace detail typename detail::tquat::value_type const & angle, detail::tvec3 const & v); + /// Returns euler angles, yitch as x, yaw as y, roll as z. + /// + /// @see gtc_quaternion + template + detail::tvec3 eulerAngles( + detail::tquat const & x); + /// Converts a quaternion to a 3 * 3 matrix. /// /// @see gtc_quaternion diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 3cb4a604..607a7209 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -31,6 +31,12 @@ namespace glm{ namespace detail { + template + GLM_FUNC_QUALIFIER typename tquat::size_type tquat::length() const + { + return 4; + } + template GLM_FUNC_QUALIFIER tquat::tquat() : x(0), @@ -494,6 +500,15 @@ namespace detail //return gtc::quaternion::cross(q, detail::tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); } + template + GLM_FUNC_QUALIFIER detail::tvec3 eulerAngles + ( + detail::tquat const & x + ) + { + return detail::tvec3(pitch(x), yaw(x), roll(x)); + } + template GLM_FUNC_QUALIFIER detail::tmat3x3 mat3_cast ( diff --git a/glm/gtx/quaternion.hpp b/glm/gtx/quaternion.hpp index e5e3e404..78e6ffd3 100644 --- a/glm/gtx/quaternion.hpp +++ b/glm/gtx/quaternion.hpp @@ -176,12 +176,6 @@ namespace glm template valType yaw( detail::tquat const & x); - - //! Returns euler angles, yitch as x, yaw as y, roll as z. - //! From GLM_GTX_quaternion extension. - template - detail::tvec3 eulerAngles( - detail::tquat const & x); //! Converts a quaternion to a 3 * 3 matrix. //! From GLM_GTX_quaternion extension. diff --git a/glm/gtx/quaternion.inl b/glm/gtx/quaternion.inl index b8805a14..e2a4007d 100644 --- a/glm/gtx/quaternion.inl +++ b/glm/gtx/quaternion.inl @@ -234,15 +234,6 @@ namespace glm return glm::degrees(asin(valType(-2) * (q.x * q.z - q.w * q.y))); } - template - GLM_FUNC_QUALIFIER detail::tvec3 eulerAngles - ( - detail::tquat const & x - ) - { - return detail::tvec3(pitch(x), yaw(x), roll(x)); - } - template GLM_FUNC_QUALIFIER detail::tquat shortMix ( diff --git a/test/gtx/gtx_simd_mat4.cpp b/test/gtx/gtx_simd_mat4.cpp index 44a6426a..fbfa6af4 100644 --- a/test/gtx/gtx_simd_mat4.cpp +++ b/test/gtx/gtx_simd_mat4.cpp @@ -181,7 +181,9 @@ void test_mulD(std::vector const & Data, std::vector & Out { _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); glm::simdMat4 m(Data[i]); - glm::detail::sse_mul_ps((__m128 const * const)&m, (__m128 const * const)&m, (__m128*)&Out[i]); + glm::simdMat4 o; + glm::detail::sse_mul_ps((__m128 const * const)&m, (__m128 const * const)&m, (__m128*)&o); + Out[i] = *(glm::mat4*)&o; } std::clock_t TimeEnd = clock();