[−][src]Struct amethyst_physics::PhysicsTime
This resource is used by amethyst_physics
to keep track of the physics time.
You can use it to know the actual physics delta time, or to change the physics frame per second.
Max sub steps
Depending on the PhysicsTime::_time_bank
value, could be necessary run the stepping, multiple
times on the same frame.
Each frame, to the _time_bank
is added the frame delta time (which is variable).
Sometimes, could happens that the Timer::delta_time
is so big that too much sub steps have to
be processed in order to consume the _time_bank
.
This process, will increase the delta time of the next frame, entering so
in a spiral that will drop the performances.
To break this behavior a fall back algorithm, will clamp the maximum size of the _time_bank
.
You can control the maximum _time_bank
by changing the max_sub_steps
.
Methods
impl PhysicsTime
[src]
pub fn delta_seconds(&self) -> f32
[src]
Get the physics delta seconds
pub fn in_sub_step(&self) -> bool
[src]
Returns true if the sub stepping is in process.
pub fn with_frames_per_second(self, frames_per_seconds: u32) -> Self
[src]
Set the physics frames per seconds.
pub fn set_frames_per_seconds(&mut self, frames_per_seconds: u32)
[src]
Set the physics frames per seconds.
pub fn with_max_sub_steps(self, max_sub_steps: u32) -> Self
[src]
Set the physics max sub steps. This controls how much physics step can be executed in a single frame. It's used to avoid spiral performance degradation. Set it to an too high value, will make this mechanism ineffective, and a too low value will make the physics unstable. Is advised to keep the default
pub fn set_max_sub_steps(&mut self, max_sub_steps: u32)
[src]
Set the physics max sub steps. This controls how much physics step can be executed in a single frame. It's used to avoid spiral performance degradation. Set it to an too high value, will make this mechanism ineffective, and a too low value will make the physics unstable. Is advised to keep the default
pub fn sub_max_sub_steps(&self) -> u32
[src]
Returns the max sub steps
Trait Implementations
impl Default for PhysicsTime
[src]
impl Debug for PhysicsTime
[src]
Auto Trait Implementations
impl Send for PhysicsTime
impl Unpin for PhysicsTime
impl Sync for PhysicsTime
impl UnwindSafe for PhysicsTime
impl RefUnwindSafe for PhysicsTime
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Resource for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> TryDefault for T where
T: Default,
T: Default,
fn try_default() -> Result<T, String>
fn unwrap_default() -> Self
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,