Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Run interpolation before Update #1

Closed
wants to merge 2 commits into from

Conversation

janhohenheim
Copy link
Sponsor

@janhohenheim janhohenheim commented Aug 22, 2024

This way, systems running in Update already operate on the final Transform and we don't need to check for changes in Update. Per discussions on Discord we recently had in #ecs-dev, this schedule was determined to be the one most useful for interpolation.
See also this companion PR in Bevy: bevyengine/bevy#14881

This way, systems running in `Update` already operate on the final `Transform` and we don't need to check for changes in `Update`. 
Per discussions on Discord we recently had in `#ecs-dev`, this schedule was determined to be the one most useful for interpolation.
@janhohenheim
Copy link
Sponsor Author

janhohenheim commented Aug 24, 2024

Note: this PR will make interpolated objects ignore changes to transform that happen in RustFixedMainLoop, foo.before(run_fixed_main) :/
In effect, this means you need to make sure your camera is not interpolated. Which you of course want anyways, but it shouldn't be necessary to annotate that explicitly, as it won't be moved in fixed updates anyways.

@Jondolf
Copy link
Owner

Jondolf commented Aug 28, 2024

This breaks user changes done in e.g. Update. In those schedules, changing the translation should be equivalent to teleporting the object, which requires resetting the easing states.

An easy way to see how this breaks it is by testing the chain_2d example in Avian. The chain is moved (via mouse) in Update, but with this PR, the interpolation breaks the movement because the easing states aren't reset appropriately (I think), and as a result, the physics positions are never updated.

@janhohenheim
Copy link
Sponsor Author

Huh, I see. Unfortunately, I don't quite understand the internal workflow of the interpolation, so I'll close the PR and create an issue instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants