mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
FTI - Reduce VisualInstance3D
xform notifications
This commit is contained in:
parent
b89c47bb85
commit
e10003ce33
4 changed files with 26 additions and 3 deletions
|
@ -88,7 +88,9 @@ void VisualInstance3D::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_TRANSFORM_CHANGED: {
|
||||
// ToDo : Can we turn off notify transform for physics interpolated cases?
|
||||
// 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_vi_visible() && !(is_inside_tree() && get_tree()->is_physics_interpolation_enabled()) && !_is_using_identity_transform()) {
|
||||
// Physics interpolation global off, always send.
|
||||
RenderingServer::get_singleton()->instance_set_transform(instance, get_global_transform());
|
||||
|
@ -204,7 +206,7 @@ RID VisualInstance3D::get_base() const {
|
|||
VisualInstance3D::VisualInstance3D() {
|
||||
instance = RenderingServer::get_singleton()->instance_create();
|
||||
RenderingServer::get_singleton()->instance_attach_object_instance_id(instance, get_instance_id());
|
||||
set_notify_transform(true);
|
||||
_set_notify_transform_when_fti_off(true);
|
||||
}
|
||||
|
||||
VisualInstance3D::~VisualInstance3D() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue