Attributes: Add quaternion rotation type #108678
|
@ -74,12 +74,6 @@ template<typename T> struct AngleRadianBase {
|
||||||
|
|
||||||
/** Methods. */
|
/** Methods. */
|
||||||
|
|
||||||
/* 'mod_inline(-3, 4)= 1', 'fmod(-3, 4)= -3' */
|
|
||||||
static float mod_inline(float a, float b)
|
|
||||||
{
|
|
||||||
return a - (b * floorf(a / b));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the angle wrapped inside [-pi..pi] interval. Basically `(angle + pi) % 2pi - pi`.
|
* Return the angle wrapped inside [-pi..pi] interval. Basically `(angle + pi) % 2pi - pi`.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -680,7 +680,7 @@ template<typename T> QuaternionBase<T> QuaternionBase<T>::expmap(const VecBase<T
|
||||||
T angle;
|
T angle;
|
||||||
const VecBase<T, 3> axis = normalize_and_get_length(expmap, angle);
|
const VecBase<T, 3> axis = normalize_and_get_length(expmap, angle);
|
||||||
if (LIKELY(angle != T(0))) {
|
if (LIKELY(angle != T(0))) {
|
||||||
return to_quaternion(AxisAngleT(axis, angle_wrap_rad(angle)));
|
return to_quaternion(AxisAngleT(axis, AngleRadianBase<T>(angle).wrapped()));
|
||||||
}
|
}
|
||||||
return QuaternionBase<T>::identity();
|
return QuaternionBase<T>::identity();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue