[3.x] Physics Interpolation - Fix non-interpolated resting xforms#105141
Merged
lawnjelly merged 1 commit intogodotengine:3.xfrom Apr 9, 2025
Merged
[3.x] Physics Interpolation - Fix non-interpolated resting xforms#105141lawnjelly merged 1 commit intogodotengine:3.xfrom
lawnjelly merged 1 commit intogodotengine:3.xfrom
Conversation
513f196 to
5649691
Compare
rburing
approved these changes
Apr 8, 2025
Member
rburing
left a comment
There was a problem hiding this comment.
Makes sense as described, thanks for the quick fix!
Ensure servers are updated for non-interpolated Spatials, either during the scene tree update or a final pass. Ensure properties and xforms are given a final server update in the final resting positions after removal from tick lists. Fixes dirty local xform bug.
5649691 to
2bb3273
Compare
Member
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ensure servers are updated for non-interpolated Spatials, during the
SceneTreeFTItraversal update.Ensure properties and xforms are given a final server update in the final resting positions after removal from tick lists. Fixes dirty local xform bug.
Fixes dirty global xform bug.
As discussed with @rburing yesterday this fixes a number of last minute bugs I noticed in the new system.
Regression in non-interpolated objects
I noticed in WroughtFlesh that on the loading scene, some non-interpolated objects weren't in their correct positions. #104854 was leaving it to
SceneTreeFTIto be in charge of updating non-interpolated object xforms, but one small snag, these were being ignored completely bySceneTreeFTI.Now these nodes have a flag set which activates their processing during
_update_dirty_spatials().This should ensure they get one and (hopefully) only one update to the server, keeping things as efficient as possible. An alternative would have been to revert #104854 but I think this arrangement should be the most optimal solution for reducing server updates to bare minimum.
Ensure servers are updated when removing xforms and properties from their tick lists
This was a slight oversight, as it wasn't necessary with the old server based approach. Now we scene side FTI, we can't just pump the data on the nodes when removing from tick lists, we have to ensure the server is also updated.
For properties, we can update them immediately on removal from the tick list.
For xforms, for the best results, we not only need to update the spatial itself with the final resting xform, we want to ensure all the children are also updated with the final resting xform. We do this by adding another flag to the spatial,
fti_frame_xform_force_update, which forces the scene tree traversal to do one last update of any node we choose. This flag is cleared on each traversal, but allows us a way of using the existing mechanisms to ensure the entire branch is updated to the resting xforms.Ensure
local_transformis up to date during interpolationI noticed on
3D platformeron low tick rate that animated rotating coins were not interpolating as they should. It turned out that theset_rotate()call makes the local dirty, this means thelocal_transformcan be stale at the time of interpolation.The solution was rather simple, replace all the references to
local_transformwithget_transform()wrapper function, which ensures that any dirty data is updated.The coins now interpolate correctly.
Ensure
global_transformis up to date during interpolationNoticed bone attachment wasn't working in WroughtFlesh. Worked out again it was due to a dirty transform, this time global, so now this is updated when dirty when traversing the scene tree in
SceneTreeFTI.Notes