Fix broken root motion scale and refactor API

This commit is contained in:
Silc Renew 2022-11-26 16:04:15 +09:00
parent c7ceb94e37
commit 09adf5f20e
4 changed files with 90 additions and 20 deletions

View file

@ -103,7 +103,8 @@ void RootMotionView::_notification(int p_what) {
set_physics_process_internal(false);
}
transform = tree->get_root_motion_transform();
transform.origin = tree->get_root_motion_position();
transform.basis = tree->get_root_motion_rotation(); // Scale is meaningless.
}
}
@ -113,9 +114,8 @@ void RootMotionView::_notification(int p_what) {
first = false;
transform.orthonormalize(); //don't want scale, too imprecise
accumulated = accumulated * transform;
accumulated.origin += transform.origin;
accumulated.basis *= transform.basis;
accumulated.origin.x = Math::fposmod(accumulated.origin.x, cell_size);
if (zero_y) {
accumulated.origin.y = 0;