Skip to content

Commit 55978b5

Browse files
committed
Revert "FTI - Reduce VisualInstance3D xform notifications"
This reverts commit e10003c.
1 parent d7bdc0b commit 55978b5

File tree

4 files changed

+3
-26
lines changed

4 files changed

+3
-26
lines changed

scene/3d/camera_3d.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ void Camera3D::_update_camera() {
164164

165165
void Camera3D::_physics_interpolated_changed() {
166166
_update_process_mode();
167-
Node3D::_physics_interpolated_changed();
168167
}
169168

170169
void Camera3D::set_desired_process_modes(bool p_process_internal, bool p_physics_process_internal) {

scene/3d/node_3d.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,21 +1241,9 @@ Vector3 Node3D::to_global(Vector3 p_local) const {
12411241
return get_global_transform().xform(p_local);
12421242
}
12431243

1244-
void Node3D::_physics_interpolated_changed() {
1245-
ERR_THREAD_GUARD;
1246-
data.notify_transform = data.notify_transform_requested || (data.notify_transform_when_fti_off && !is_physics_interpolated_and_enabled());
1247-
}
1248-
1249-
void Node3D::_set_notify_transform_when_fti_off(bool p_enable) {
1250-
ERR_THREAD_GUARD;
1251-
data.notify_transform_when_fti_off = p_enable;
1252-
data.notify_transform = data.notify_transform_requested || (data.notify_transform_when_fti_off && !is_physics_interpolated_and_enabled());
1253-
}
1254-
12551244
void Node3D::set_notify_transform(bool p_enabled) {
12561245
ERR_THREAD_GUARD;
1257-
data.notify_transform_requested = p_enabled;
1258-
data.notify_transform = data.notify_transform_requested || (data.notify_transform_when_fti_off && !is_physics_interpolated_and_enabled());
1246+
data.notify_transform = p_enabled;
12591247
}
12601248

12611249
bool Node3D::is_transform_notification_enabled() const {
@@ -1537,8 +1525,6 @@ Node3D::Node3D() :
15371525
data.ignore_notification = false;
15381526
data.notify_local_transform = false;
15391527
data.notify_transform = false;
1540-
data.notify_transform_requested = false;
1541-
data.notify_transform_when_fti_off = false;
15421528

15431529
data.visible = true;
15441530
data.disable_scale = false;

scene/3d/node_3d.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ class Node3D : public Node {
134134
bool notify_local_transform : 1;
135135
bool notify_transform : 1;
136136

137-
bool notify_transform_requested : 1;
138-
bool notify_transform_when_fti_off : 1;
139-
140137
bool visible : 1;
141138
bool disable_scale : 1;
142139

@@ -202,9 +199,6 @@ class Node3D : public Node {
202199
// (e.g. changing Camera zoom even if position hasn't changed).
203200
void fti_notify_node_changed(bool p_transform_changed = true);
204201

205-
void _set_notify_transform_when_fti_off(bool p_enable);
206-
virtual void _physics_interpolated_changed() override;
207-
208202
// Opportunity after FTI to update the servers
209203
// with global_transform_interpolated,
210204
// and any custom interpolated data in derived classes.

scene/3d/visual_instance_3d.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@ void VisualInstance3D::_notification(int p_what) {
8888
} break;
8989

9090
case NOTIFICATION_TRANSFORM_CHANGED: {
91-
// NOTIFICATION normally turned off for physics interpolated cases (via
92-
// `notify_transform_when_fti_off`), however derived classes can still turn this back on,
93-
// so always wrap with is_physics_interpolation_enabled().
91+
// ToDo : Can we turn off notify transform for physics interpolated cases?
9492
if (_is_vi_visible() && !(is_inside_tree() && get_tree()->is_physics_interpolation_enabled()) && !_is_using_identity_transform()) {
9593
// Physics interpolation global off, always send.
9694
RenderingServer::get_singleton()->instance_set_transform(instance, get_global_transform());
@@ -206,7 +204,7 @@ RID VisualInstance3D::get_base() const {
206204
VisualInstance3D::VisualInstance3D() {
207205
instance = RenderingServer::get_singleton()->instance_create();
208206
RenderingServer::get_singleton()->instance_attach_object_instance_id(instance, get_instance_id());
209-
_set_notify_transform_when_fti_off(true);
207+
set_notify_transform(true);
210208
}
211209

212210
VisualInstance3D::~VisualInstance3D() {

0 commit comments

Comments
 (0)