pub struct FixedStep { /* private fields */ }Implementations§
Source§impl FixedStep
impl FixedStep
Sourcepub fn start(hz: f64) -> Self
pub fn start(hz: f64) -> Self
Create and start a new fixedstep timer with the given frequency in Hz
Sourcepub fn limit(self, limit: u32) -> Self
pub fn limit(self, limit: u32) -> Self
Set the limit for how many updates can be performed between rendering. ie: the maximum number of times update() will return true between calls to render_delta
Use this if rendering on time is more important than keeping the simulation on time (which is usually the case for video games).
Sourcepub fn update(&mut self) -> bool
pub fn update(&mut self) -> bool
Returns true if enough time has elapsed to perform another update.
Sourcepub fn render_delta(&mut self) -> f64
pub fn render_delta(&mut self) -> f64
Return the amount of time (relative to the update period) since the last update tick.
Also refreshes the update counter (see the limit method)
Auto Trait Implementations§
impl Freeze for FixedStep
impl RefUnwindSafe for FixedStep
impl Send for FixedStep
impl Sync for FixedStep
impl Unpin for FixedStep
impl UnwindSafe for FixedStep
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more