You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Fix broken root motion scale and refactor API
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user