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
This commit is contained in:
Lyuma
2023-05-25 02:58:17 -07:00
parent 15b7a8e7f1
commit 9aa46bf3f5
2 changed files with 2 additions and 22 deletions

View File

@@ -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);
}
}