Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion scene/3d/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ void Camera::_update_camera() {

void Camera::_physics_interpolated_changed() {
_update_process_mode();
Spatial::_physics_interpolated_changed();
}

void Camera::set_desired_process_modes(bool p_process_internal, bool p_physics_process_internal) {
Expand Down
15 changes: 1 addition & 14 deletions scene/3d/spatial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1076,18 +1076,8 @@ Vector3 Spatial::to_global(Vector3 p_local) const {
return get_global_transform().xform(p_local);
}

void Spatial::_physics_interpolated_changed() {
data.notify_transform = data.notify_transform_requested || (data.notify_transform_when_fti_off && !is_physics_interpolated_and_enabled());
}

void Spatial::_set_notify_transform_when_fti_off(bool p_enable) {
data.notify_transform_when_fti_off = p_enable;
data.notify_transform = data.notify_transform_requested || (data.notify_transform_when_fti_off && !is_physics_interpolated_and_enabled());
}

void Spatial::set_notify_transform(bool p_enable) {
data.notify_transform_requested = p_enable;
data.notify_transform = data.notify_transform_requested || (data.notify_transform_when_fti_off && !is_physics_interpolated_and_enabled());
data.notify_transform = p_enable;
}

bool Spatial::is_transform_notification_enabled() const {
Expand Down Expand Up @@ -1289,9 +1279,6 @@ Spatial::Spatial() :
#endif
data.notify_local_transform = false;
data.notify_transform = false;
data.notify_transform_requested = false;
data.notify_transform_when_fti_off = false;

data.parent = nullptr;
}

Expand Down
6 changes: 0 additions & 6 deletions scene/3d/spatial.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ class Spatial : public Node {
bool notify_local_transform : 1;
bool notify_transform : 1;

bool notify_transform_requested : 1;
bool notify_transform_when_fti_off : 1;

bool visible : 1;
bool visible_in_tree : 1;
bool disable_scale : 1;
Expand Down Expand Up @@ -179,9 +176,6 @@ class Spatial : public Node {
// (e.g. changing Camera zoom even if position hasn't changed).
void fti_notify_node_changed(bool p_transform_changed = true);

void _set_notify_transform_when_fti_off(bool p_enable);
virtual void _physics_interpolated_changed();

// Opportunity after FTI to update the servers
// with global_transform_interpolated,
// and any custom interpolated data in derived classes.
Expand Down
8 changes: 3 additions & 5 deletions scene/3d/visual_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,8 @@ void VisualInstance::_notification(int p_what) {

} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
// NOTIFICATION normally turned off for physics interpolated cases (via
// `notify_transform_when_fti_off`), however derived classes can still turn this back on,
// so always wrap with is_physics_interpolation_enabled().
if (is_visible_in_tree() && !(is_inside_tree() && get_tree()->is_physics_interpolation_enabled()) && !_is_using_identity_transform()) {
// ToDo : Can we turn off notify transform for physics interpolated cases?
if (is_visible_in_tree() && !SceneTree::is_fti_enabled() && !_is_using_identity_transform()) {
// Physics interpolation global off, always send.
VisualServer::get_singleton()->instance_set_transform(instance, get_global_transform());
}
Expand Down Expand Up @@ -209,7 +207,7 @@ VisualInstance::VisualInstance() {
layers = 1;
sorting_offset = 0.0f;
sorting_use_aabb_center = true;
_set_notify_transform_when_fti_off(true);
set_notify_transform(true);
}

VisualInstance::~VisualInstance() {
Expand Down