summaryrefslogtreecommitdiffstats
path: root/core/math/basis.cpp
diff options
context:
space:
mode:
authorLyuma <xn.lyuma@gmail.com>2023-05-25 02:58:17 -0700
committerLyuma <xn.lyuma@gmail.com>2023-06-05 20:44:45 -0700
commit9aa46bf3f551296c7a19db03d373fbabebcd09da (patch)
treef89e41eca8a3a96c32b744f83955ae0ab5d16f8e /core/math/basis.cpp
parent15b7a8e7f1c645a7fc868a0053379d1ae196c3b6 (diff)
downloadredot-engine-9aa46bf3f551296c7a19db03d373fbabebcd09da.tar.gz
Fix for SkeletonIK3D interpolation and bone roll
Fix bug in internal Basis::rotate_to_align function (also used with identity Basis in scene/resources/curve.cpp) Use ChainItem children rather than local bone rest to determine IK bone roll to match Godot 3.x behavior
Diffstat (limited to 'core/math/basis.cpp')
-rw-r--r--core/math/basis.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/basis.cpp b/core/math/basis.cpp
index 1481dbc32e..6b0ecadc7f 100644
--- a/core/math/basis.cpp
+++ b/core/math/basis.cpp
@@ -397,7 +397,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.0f, 1.0f);
const real_t angle_rads = Math::acos(dot);
- set_axis_angle(axis, angle_rads);
+ *this = Basis(axis, angle_rads) * (*this);
}
}