mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add root_motion_local option to AnimationMixer
This commit is contained in:
@@ -94,7 +94,6 @@ void RootMotionView::_notification(int p_what) {
|
||||
|
||||
if (has_node(path)) {
|
||||
Node *node = get_node(path);
|
||||
|
||||
AnimationMixer *mixer = Object::cast_to<AnimationMixer>(node);
|
||||
if (mixer && mixer->is_active() && mixer->get_root_motion_track() != NodePath()) {
|
||||
if (is_processing_internal() && mixer->get_callback_mode_process() == AnimationMixer::ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS) {
|
||||
@@ -106,12 +105,12 @@ void RootMotionView::_notification(int p_what) {
|
||||
set_process_internal(true);
|
||||
set_physics_process_internal(false);
|
||||
}
|
||||
|
||||
transform.origin = mixer->get_root_motion_position();
|
||||
transform.basis = mixer->get_root_motion_rotation(); // Scale is meaningless.
|
||||
diff = mixer->get_root_motion_rotation_accumulator();
|
||||
diff = mixer->is_root_motion_local() ? Quaternion() : mixer->get_root_motion_rotation_accumulator();
|
||||
}
|
||||
}
|
||||
|
||||
if (!first && transform == Transform3D()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user