Attributes: Add quaternion rotation type #108678

Merged
Hans Goudey merged 10 commits from HooglyBoogly/blender:attributes-quaternion-type into main 2023-06-12 15:49:57 +02:00
2 changed files with 1 additions and 7 deletions
Showing only changes of commit 8daa55d5e3 - Show all commits

View File

@ -74,12 +74,6 @@ template<typename T> struct AngleRadianBase {
/** 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`.
*/

View File

@ -680,7 +680,7 @@ template<typename T> QuaternionBase<T> QuaternionBase<T>::expmap(const VecBase<T
T angle;
const VecBase<T, 3> axis = normalize_and_get_length(expmap, angle);
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();
}