Physics Interpolation - Fix behaviour on pause
This commit is contained in:
parent
b2be47e6fc
commit
49d3161ce0
3 changed files with 16 additions and 0 deletions
|
@ -295,6 +295,11 @@ void Camera2D::_notification(int p_what) {
|
||||||
_interpolation_data.xform_curr = get_camera_transform();
|
_interpolation_data.xform_curr = get_camera_transform();
|
||||||
_interpolation_data.xform_prev = _interpolation_data.xform_curr;
|
_interpolation_data.xform_prev = _interpolation_data.xform_curr;
|
||||||
} break;
|
} break;
|
||||||
|
case NOTIFICATION_PAUSED: {
|
||||||
|
if (is_physics_interpolated_and_enabled()) {
|
||||||
|
_update_scroll();
|
||||||
|
}
|
||||||
|
} break;
|
||||||
case NOTIFICATION_TRANSFORM_CHANGED: {
|
case NOTIFICATION_TRANSFORM_CHANGED: {
|
||||||
if (!smoothing_active && !is_physics_interpolated_and_enabled()) {
|
if (!smoothing_active && !is_physics_interpolated_and_enabled()) {
|
||||||
_update_scroll();
|
_update_scroll();
|
||||||
|
|
|
@ -226,6 +226,12 @@ void Camera::_notification(int p_what) {
|
||||||
_interpolation_data.xform_prev = _interpolation_data.xform_curr;
|
_interpolation_data.xform_prev = _interpolation_data.xform_curr;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case NOTIFICATION_PAUSED: {
|
||||||
|
if (is_physics_interpolated_and_enabled() && is_inside_tree() && is_visible_in_tree()) {
|
||||||
|
_physics_interpolation_ensure_transform_calculated(true);
|
||||||
|
VisualServer::get_singleton()->camera_set_transform(camera, _interpolation_data.camera_xform_interpolated);
|
||||||
|
}
|
||||||
|
} break;
|
||||||
case NOTIFICATION_EXIT_WORLD: {
|
case NOTIFICATION_EXIT_WORLD: {
|
||||||
if (!get_tree()->is_node_being_edited(this)) {
|
if (!get_tree()->is_node_being_edited(this)) {
|
||||||
if (is_current()) {
|
if (is_current()) {
|
||||||
|
|
|
@ -131,6 +131,11 @@ void Node::_notification(int p_notification) {
|
||||||
data.path_cache = nullptr;
|
data.path_cache = nullptr;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case NOTIFICATION_PAUSED: {
|
||||||
|
if (is_physics_interpolated_and_enabled() && is_inside_tree()) {
|
||||||
|
reset_physics_interpolation();
|
||||||
|
}
|
||||||
|
} break;
|
||||||
case NOTIFICATION_PATH_CHANGED: {
|
case NOTIFICATION_PATH_CHANGED: {
|
||||||
if (data.path_cache) {
|
if (data.path_cache) {
|
||||||
memdelete(data.path_cache);
|
memdelete(data.path_cache);
|
||||||
|
|
Loading…
Reference in a new issue