diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 6422cf6b..9e926ee9 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -302,16 +302,11 @@ namespace detail detail::tvec3 const & v ) { - T Two(2); + detail::tvec3 u(q.x, q.y, q.z); + detail::tvec3 uv(glm::cross(u, v) * q.w); + detail::tvec3 uuv(glm::cross(u, uv)); - detail::tvec3 uv, uuv; - detail::tvec3 QuatVector(q.x, q.y, q.z); - uv = glm::cross(QuatVector, v); - uuv = glm::cross(QuatVector, uv); - uv *= (Two * q.w); - uuv *= Two; - - return v + uv + uuv; + return v + (uv + uuv) * static_cast(2); } template diff --git a/readme.txt b/readme.txt index 0c7f374b..3c6c6905 100644 --- a/readme.txt +++ b/readme.txt @@ -44,6 +44,7 @@ GLM 0.9.5.4: 2014-0X-XX - Fixed GTX_color_space - saturation #195 - Fixed glm::isinf and glm::isnan for with Android NDK 9d #191 - Fixed builtin GLM_ARCH_SSE4 #204 +- Optimized Quaternion vector rotation #205 ================================================================================ GLM 0.9.5.3: 2014-04-02