mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
Fix broken root motion scale and refactor API
This commit is contained in:
parent
c7ceb94e37
commit
09adf5f20e
4 changed files with 90 additions and 20 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue