[][src]Struct amethyst_core::timing::Time

pub struct Time { /* fields omitted */ }

Frame timing values.

Methods

impl Time[src]

pub fn delta_seconds(&self) -> f32[src]

Gets the time difference between frames in seconds.

This function should not be used during fixed_updates, use fixed_seconds instead.

pub fn delta_time(&self) -> Duration[src]

Gets the time difference between frames.

This function should not be used during fixed_updates, use fixed_time instead.

pub fn delta_real_seconds(&self) -> f32[src]

Gets the time difference between frames in seconds ignoring the time speed multiplier.

This function should not be used during fixed_updates.

pub fn delta_real_time(&self) -> Duration[src]

Gets the time difference between frames ignoring the time speed multiplier.

pub fn fixed_seconds(&self) -> f32[src]

Gets the fixed time step in seconds.

pub fn fixed_time(&self) -> Duration[src]

Gets the fixed time step.

pub fn frame_number(&self) -> u64[src]

Gets the current frame number. This increments by 1 every frame. There is no frame 0.

pub fn absolute_time(&self) -> Duration[src]

Gets the time since the start of the game, taking into account the speed multiplier.

pub fn absolute_time_seconds(&self) -> f64[src]

Gets the time since the start of the game as seconds, taking into account the speed multiplier.

pub fn absolute_real_time(&self) -> Duration[src]

Gets the time since the start of the game, ignoring the speed multiplier.

pub fn absolute_real_time_seconds(&self) -> f64[src]

Gets the time since the start of the game as seconds, ignoring the speed multiplier.

pub fn time_scale(&self) -> f32[src]

Gets the current time speed multiplier.

pub fn interpolation_alpha(&self) -> f32[src]

Gets the current interpolation alpha factor.

pub fn set_delta_seconds(&mut self, secs: f32)[src]

Gets the total number of frames that have been played in this session. Sets both delta_seconds and delta_time based on the seconds given.

This should only be called by the engine. Bad things might happen if you call this in your game.

pub fn set_delta_time(&mut self, time: Duration)[src]

Sets both delta_time and delta_seconds based on the duration given.

This should only be called by the engine. Bad things might happen if you call this in your game.

pub fn set_fixed_seconds(&mut self, secs: f32)[src]

Sets both fixed_seconds and fixed_time based on the seconds given.

pub fn set_fixed_time(&mut self, time: Duration)[src]

Sets both fixed_time and fixed_seconds based on the duration given.

pub fn increment_frame_number(&mut self)[src]

Increments the current frame number by 1.

This should only be called by the engine. Bad things might happen if you call this in your game.

pub fn set_time_scale(&mut self, multiplier: f32)[src]

Sets the time multiplier that affects how time values are computed, effectively slowing or speeding up your game.

Panics

This will panic if multiplier is NaN, Infinity, or less than 0.

pub fn start_fixed_update(&mut self)[src]

Restarts the internal fixed update accumulator to the desired fixed update delta time.

This should only be called by the engine. Bad things might happen if you call this in your game.

pub fn step_fixed_update(&mut self) -> bool[src]

Checks to see if we should perform another fixed update iteration, and if so, returns true and reduces the accumulator.

This should only be called by the engine. Bad things might happen if you call this in your game.

pub fn finish_fixed_update(&mut self)[src]

Updates the interpolation alpha factor given the current fixed update rate and accumulator.

This should only be called by the engine. Bad things might happen if you call this in your game.

Trait Implementations

impl Default for Time[src]

impl Clone for Time[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Copy for Time[src]

impl PartialEq<Time> for Time[src]

impl Debug for Time[src]

Auto Trait Implementations

impl Send for Time

impl Sync for Time

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> Scalar for T where
    T: Copy + PartialEq<T> + Any + Debug
[src]

fn is<T>() -> bool where
    T: Scalar
[src]

Tests if Self the same as the type T Read more

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> TryDefault for T where
    T: Default

fn unwrap_default() -> Self

Calls try_default and panics on an error case.

impl<T> Any for T where
    T: Any

impl<T> Event for T where
    T: Send + Sync + 'static,