forked from Jondolf/avian
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix fixed timestep using
max_delta_overstep
(Jondolf#225)
# Objective Fixes Jondolf#223. In the migration to Bevy 0.12, the time resources were changed to use Bevy's unified `Time` APIs. However, the fixed timestep broke, as it now runs once every frame with the same timestep, which causes frame rate dependent behavior where bodies seem to move faster at higher frame rates. ## Solution Add a `max_delta_overstep` property to `TimestepMode::Fixed` that limits how much time can be added to the accumulated `overstep` during a single frame. This is mostly equivalent to getting the elapsed time using `Time<Virtual>` with some `max_delta`, but for now, it's nice to keep the `Time<Physics>` behavior separate from the virtual clock.
- Loading branch information
Showing
2 changed files
with
40 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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