Apparently Basis::rotate_to_align had a bug. Ported the fix by lyuma from: 6dfa6fc50e

This commit is contained in:
Relintai 2023-05-28 07:25:27 +02:00
parent 039f173de1
commit 9e326c3000

View File

@ -412,7 +412,7 @@ void Basis::rotate_to_align(Vector3 p_start_direction, Vector3 p_end_direction)
real_t dot = p_start_direction.dot(p_end_direction);
dot = CLAMP(dot, -1.0, 1.0);
const real_t angle_rads = Math::acos(dot);
set_axis_angle(axis, angle_rads);
*this *= Basis(axis, angle_rads);
}
}