Struct amethyst_core::timing::Time [−][src]
pub struct Time {
pub last_fixed_update: Instant,
// some fields omitted
}Frame timing values.
Fields
last_fixed_update: Instant
Time at which State::fixed_update was last called.
Methods
impl Time[src]
impl Timepub fn delta_seconds(&self) -> f32[src]
pub fn delta_seconds(&self) -> f32Gets the time difference between frames in seconds.
pub fn delta_time(&self) -> Duration[src]
pub fn delta_time(&self) -> DurationGets the time difference between frames.
pub fn delta_real_seconds(&self) -> f32[src]
pub fn delta_real_seconds(&self) -> f32Gets the time difference between frames in seconds ignoring the time speed multiplier.
pub fn delta_real_time(&self) -> Duration[src]
pub fn delta_real_time(&self) -> DurationGets the time difference between frames ignoring the time speed multiplier.
pub fn fixed_seconds(&self) -> f32[src]
pub fn fixed_seconds(&self) -> f32Gets the fixed time step in seconds.
pub fn fixed_time(&self) -> Duration[src]
pub fn fixed_time(&self) -> DurationGets the fixed time step.
pub fn frame_number(&self) -> u64[src]
pub fn frame_number(&self) -> u64Gets the current frame number. This increments by 1 every frame. There is no frame 0.
pub fn last_fixed_update(&self) -> Instant[src]
pub fn last_fixed_update(&self) -> InstantGets the time at which the last fixed update was called.
pub fn absolute_time(&self) -> Duration[src]
pub fn absolute_time(&self) -> DurationGets the time since the start of the game, taking into account the speed multiplier.
pub fn absolute_time_seconds(&self) -> f64[src]
pub fn absolute_time_seconds(&self) -> f64Gets the time since the start of the game as seconds, taking into account the speed multiplier.
pub fn absolute_real_time(&self) -> Duration[src]
pub fn absolute_real_time(&self) -> DurationGets the time since the start of the game, ignoring the speed multiplier.
pub fn absolute_real_time_seconds(&self) -> f64[src]
pub fn absolute_real_time_seconds(&self) -> f64Gets the time since the start of the game as seconds, ignoring the speed multiplier.
pub fn time_scale(&self) -> f32[src]
pub fn time_scale(&self) -> f32Gets the current time speed multiplier.
pub fn set_delta_seconds(&mut self, secs: f32)[src]
pub fn set_delta_seconds(&mut self, secs: f32)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]
pub fn set_delta_time(&mut self, time: Duration)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]
pub fn set_fixed_seconds(&mut self, secs: f32)Sets both fixed_seconds and fixed_time based on the seconds given.
pub fn set_fixed_time(&mut self, time: Duration)[src]
pub fn set_fixed_time(&mut self, time: Duration)Sets both fixed_time and fixed_seconds based on the duration given.
pub fn increment_frame_number(&mut self)[src]
pub fn increment_frame_number(&mut self)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]
pub fn set_time_scale(&mut self, multiplier: f32)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 finish_fixed_update(&mut self)[src]
pub fn finish_fixed_update(&mut self)Indicates a fixed update just finished.
This should only be called by the engine. Bad things might happen if you call this in your game.
Trait Implementations
impl Clone for Time[src]
impl Clone for Timefn clone(&self) -> Time[src]
fn clone(&self) -> TimeReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Copy for Time[src]
impl Copy for Timeimpl Debug for Time[src]
impl Debug for Timefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for Time[src]
impl PartialEq for Timefn eq(&self, other: &Time) -> bool[src]
fn eq(&self, other: &Time) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Time) -> bool[src]
fn ne(&self, other: &Time) -> boolThis method tests for !=.
impl Default for Time[src]
impl Default for Time