summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-07-07 21:58:51 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-07-07 21:58:51 +0200
commitaec5c85acb7e052c64588b708c8ee6d22b3a6489 (patch)
tree75f7986a1abccebe28bc2a89ec0fbec3f08e6adb
parentd7b1d8440c4d3aafd3e5cbe1d15eccf4d8529eb9 (diff)
parentceadbaa29948be354eb20d75cf9dd1ebbda32260 (diff)
downloadredot-engine-aec5c85acb7e052c64588b708c8ee6d22b3a6489.tar.gz
Merge pull request #94036 from rburing/fti_fix_pause
Physics Interpolation: Fix behaviour on pause
-rw-r--r--scene/2d/camera_2d.cpp6
-rw-r--r--scene/main/node.cpp6
2 files changed, 12 insertions, 0 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index 514c5e7a8f..7020d162fe 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -302,6 +302,12 @@ void Camera2D::_notification(int p_what) {
_interpolation_data.xform_prev = _interpolation_data.xform_curr;
} break;
+ case NOTIFICATION_PAUSED: {
+ if (is_physics_interpolated_and_enabled()) {
+ _update_scroll();
+ }
+ } break;
+
case NOTIFICATION_TRANSFORM_CHANGED: {
if ((!position_smoothing_enabled && !is_physics_interpolated_and_enabled()) || _is_editing_in_editor()) {
_update_scroll();
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 5bbf8ebff4..0396f3ab4a 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -177,6 +177,12 @@ void Node::_notification(int p_notification) {
}
} break;
+ case NOTIFICATION_PAUSED: {
+ if (is_physics_interpolated_and_enabled() && is_inside_tree()) {
+ reset_physics_interpolation();
+ }
+ } break;
+
case NOTIFICATION_PATH_RENAMED: {
if (data.path_cache) {
memdelete(data.path_cache);