Merge branch '0.9.4' into 0.9.5
This commit is contained in:
commit
7b57810a34
@ -94,8 +94,7 @@ namespace glm
|
|||||||
/// @see gtx_quaternion
|
/// @see gtx_quaternion
|
||||||
template <typename valType>
|
template <typename valType>
|
||||||
detail::tquat<valType> exp(
|
detail::tquat<valType> exp(
|
||||||
detail::tquat<valType> const & q,
|
detail::tquat<valType> const & q);
|
||||||
valType const & exponent);
|
|
||||||
|
|
||||||
//! Returns a log of a quaternion.
|
//! Returns a log of a quaternion.
|
||||||
///
|
///
|
||||||
|
@ -40,7 +40,7 @@ namespace glm
|
|||||||
detail::tquat<T> const & s2,
|
detail::tquat<T> const & s2,
|
||||||
T const & h)
|
T const & h)
|
||||||
{
|
{
|
||||||
return mix(mix(q1, q2, h), mix(s1, s2, h), T(2) * h (T(1) - h));
|
return mix(mix(q1, q2, h), mix(s1, s2, h), T(2) * (T(1) - h) * h);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -52,20 +52,19 @@ namespace glm
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
detail::tquat<T> invQuat = inverse(curr);
|
detail::tquat<T> invQuat = inverse(curr);
|
||||||
return ext((log(next + invQuat) + log(prev + invQuat)) / T(-4)) * curr;
|
return exp((log(next + invQuat) + log(prev + invQuat)) / T(-4)) * curr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER detail::tquat<T> exp
|
GLM_FUNC_QUALIFIER detail::tquat<T> exp
|
||||||
(
|
(
|
||||||
detail::tquat<T> const & q,
|
detail::tquat<T> const & q
|
||||||
T const & exponent
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
detail::tvec3<T> u(q.x, q.y, q.z);
|
detail::tvec3<T> u(q.x, q.y, q.z);
|
||||||
float a = glm::length(u);
|
float Angle = glm::length(u);
|
||||||
detail::tvec3<T> v(u / a);
|
detail::tvec3<T> v(u / Angle);
|
||||||
return detail::tquat<T>(cos(a), sin(a) * v);
|
return detail::tquat<T>(cos(Angle), sin(Angle) * v);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
Loading…
Reference in New Issue
Block a user