Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve visual interpolation for examples #825

Merged
merged 1 commit into from
Jan 17, 2025
Merged

Conversation

cBournhonesque
Copy link
Owner

The current flow of visual interpolation for examples is:

  • visually interpolate Position/Rotation

  • to make sure that changes in Position are reflected in Transform, we:

    • put the avian SyncPlugin in PostUpdate (so that even if FixedUpdate doesn't run, we still have visual interpolation run, and then the Position/Rotation gets synced to Transform)
    • add the ordering in PostUpdate: VisualInterpolation -> Sync -> TransformPropagate
    • make sure that UpdateVisualInterpolation runs after PhysicsSet::Simulation in FixedPostUpdate

    All of this is pretty convoluted and very error-prone, instead what we want todo:

    • visually interpolate Transform (for this we need to make sure that an interpolation fn has been registered for Transform)
    • we don't need to touch the SyncPlugin; Pos/Rot are synced to transform in PostUpdate

This is much simpler!
As an extra optimization we can move SyncPlugin to RunFixedMainLoop so that it doesn't run on rollbacks.

Also add visual_interpolation to avian_physics example.

@cBournhonesque cBournhonesque added A-Prediction C-Example A change/addition to an example labels Jan 17, 2025
@cBournhonesque cBournhonesque merged commit 6574b19 into main Jan 17, 2025
1 of 4 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-Prediction C-Example A change/addition to an example
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant