mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 04:31:47 +00:00
Optimized Quaternion vector rotation #205
This commit is contained in:
parent
a2f4df2b1d
commit
4da58d88d4
@ -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>
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user