From 0f50b6b608bf62d97fb861d84e08c024dedc77a9 Mon Sep 17 00:00:00 2001 From: Valden Date: Tue, 21 May 2024 21:21:18 +0200 Subject: [PATCH] Propagate reset_physics_interpolation through RemoteTransform2D/3D --- scene/2d/remote_transform_2d.cpp | 10 ++++++++++ scene/3d/remote_transform_3d.cpp | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp index 5ea5098475f..920f5720fa3 100644 --- a/scene/2d/remote_transform_2d.cpp +++ b/scene/2d/remote_transform_2d.cpp @@ -114,6 +114,16 @@ void RemoteTransform2D::_notification(int p_what) { _update_cache(); } break; + case NOTIFICATION_RESET_PHYSICS_INTERPOLATION: { + if (cache.is_valid()) { + _update_remote(); + Node2D *n = Object::cast_to(ObjectDB::get_instance(cache)); + if (n) { + n->reset_physics_interpolation(); + } + } + } break; + case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: case NOTIFICATION_TRANSFORM_CHANGED: { if (!is_inside_tree()) { diff --git a/scene/3d/remote_transform_3d.cpp b/scene/3d/remote_transform_3d.cpp index 8d6e7171321..e580882c46a 100644 --- a/scene/3d/remote_transform_3d.cpp +++ b/scene/3d/remote_transform_3d.cpp @@ -113,6 +113,16 @@ void RemoteTransform3D::_notification(int p_what) { _update_cache(); } break; + case NOTIFICATION_RESET_PHYSICS_INTERPOLATION: { + if (cache.is_valid()) { + _update_remote(); + Node3D *n = Object::cast_to(ObjectDB::get_instance(cache)); + if (n) { + n->reset_physics_interpolation(); + } + } + } break; + case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: case NOTIFICATION_TRANSFORM_CHANGED: { if (!is_inside_tree()) {