Optimized Quaternion vector rotation #205

This commit is contained in:
Christophe Riccio 2014-05-23 23:09:32 +02:00
parent a2f4df2b1d
commit 4da58d88d4
2 changed files with 5 additions and 9 deletions

View File

@ -302,16 +302,11 @@ namespace detail
detail::tvec3<T, P> const & v detail::tvec3<T, P> const & v
) )
{ {
T Two(2); detail::tvec3<T, P> u(q.x, q.y, q.z);
detail::tvec3<T, P> uv(glm::cross(u, v) * q.w);
detail::tvec3<T, P> uuv(glm::cross(u, uv));
detail::tvec3<T, P> uv, uuv; return v + (uv + uuv) * static_cast<float>(2);
detail::tvec3<T, P> 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;
} }
template <typename T, precision P> template <typename T, precision P>

View File

@ -44,6 +44,7 @@ GLM 0.9.5.4: 2014-0X-XX
- Fixed GTX_color_space - saturation #195 - Fixed GTX_color_space - saturation #195
- Fixed glm::isinf and glm::isnan for with Android NDK 9d #191 - Fixed glm::isinf and glm::isnan for with Android NDK 9d #191
- Fixed builtin GLM_ARCH_SSE4 #204 - Fixed builtin GLM_ARCH_SSE4 #204
- Optimized Quaternion vector rotation #205
================================================================================ ================================================================================
GLM 0.9.5.3: 2014-04-02 GLM 0.9.5.3: 2014-04-02