Skip to content

[3.x] FTI - Fix 3D auto-resets#105463

Merged
lawnjelly merged 1 commit intogodotengine:3.xfrom
lawnjelly:fti_fix_auto_resets2
Apr 20, 2025
Merged

[3.x] FTI - Fix 3D auto-resets#105463
lawnjelly merged 1 commit intogodotengine:3.xfrom
lawnjelly:fti_fix_auto_resets2

Conversation

@lawnjelly
Copy link
Copy Markdown
Member

  • Ensure NOTIFICATION_RESET_PHYSICS_INTERPOLATION is sent to derived classes
  • Add deferred auto-resets for all Spatials on entering the tree

Notes

  • @Calinou noticed in Physics Interpolation - Move 3D FTI to SceneTree #104269 that some of the auto-resets weren't working correctly (for the bullets)
  • These weren't working because the root nodes of the bullet scene was a KinematicBody / CharacterBody3D which isn't derived from VisualInstance
  • After some testing I discovered a number of auto-reset situations weren't working correctly for SceneTreeFTI so took the opportunity to rewrite them to work more sensibly with the new system.
  • Now Spatials entering the scene tree add themselves to a list in the SceneTreeFTI, and all items on that list are reset prior to the tick and frame update. This ensures that all Spatials (not just VisualInstances) are reset, and only reset once on their first tick / frame on entering the tree.
  • The exception is Spatials that have reset_physics_interpolation() called on them manually during the first tick / frame. This allows users to prime instances for moving starts, when desired.

* Ensure NOTIFICATION_RESET_PHYSICS_INTERPOLATION is sent to derived classes
* Add deferred auto-resets for all `Spatials` on entering the tree
Copy link
Copy Markdown
Member

@rburing rburing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, handles more cases. LGTM.

@lawnjelly lawnjelly merged commit 009e0c5 into godotengine:3.x Apr 20, 2025
14 checks passed
@lawnjelly lawnjelly deleted the fti_fix_auto_resets2 branch April 20, 2025 08:44
@lawnjelly
Copy link
Copy Markdown
Member Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants