WIP: Fix #119703: Incorrect conversion of identity quaternion to axis angle #119762

Draft
Iliya Katushenock wants to merge 1 commits from mod_moder/blender:fix_119703 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 3 additions and 2 deletions

View File

@ -630,8 +630,9 @@ AxisAngleBase<T, AngleT> to_axis_angle(const QuaternionBase<T> &quat)
T sin_half_angle = math::length(axis);
/* Prevent division by zero for axis conversion. */
if (sin_half_angle < T(0.0005)) {
sin_half_angle = T(1);
axis[1] = T(1);
AngleT angle = AngleT(cos_half_angle, sin_half_angle) * 2;
VecBase<T, 3> &identity_axis = AxisAngleBase<T, AngleT>::identity().axis();
return AxisAngleBase<T, AngleT>(identity_axis, angle);
}
/* Normalize the axis. */
axis /= sin_half_angle;