Skip to content

Commit

Permalink
Merge pull request #87817 from Dheatly23/fix-87813
Browse files Browse the repository at this point in the history
Fix quaternion keyframe optimization for collinear rotation over 180 degrees
  • Loading branch information
akien-mga committed Feb 12, 2024
2 parents f12d737 + 9862056 commit 27575c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scene/resources/animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4016,7 +4016,7 @@ bool Animation::_quaternion_track_optimize_key(const TKey<Quaternion> t0, const
if (q0.get_axis().dot(q1.get_axis()) >= 1.0 - p_allowed_angular_error * 2.0) {
double a0 = Math::acos(t0.value.dot(t1.value));
double a1 = Math::acos(t1.value.dot(t2.value));
if (a0 + a1 >= Math_PI) {
if (a0 + a1 >= Math_PI / 2) {
return false; // Rotation is more than 180 deg, keep key.
}
// Calc velocities.
Expand Down

0 comments on commit 27575c4

Please sign in to comment.