aevyrie / bevy_framepace

Framepacing and framelimiting for Bevy
https://crates.io/crates/bevy_framepace
Apache License 2.0
245 stars 23 forks source link

Store frame time, not frame rate #11

Closed alice-i-cecile closed 2 years ago

alice-i-cecile commented 2 years ago

When used, we're taking the inverse every frame (and converting it to an f32).

Instead, store an f32 frame time in the FrameRateLimit resource (see #10) and use that directly to save on wasted work and reduce complexity.

Provider helper methods to allow users to specify the settings with either frame rates or frame times.

aevyrie commented 2 years ago

Yeah, I waffled on this a bit, I think you're right that this is a better approach.