[][src]Trait gravitas::Simulation

pub trait Simulation {
    fn x(&self, time: f32) -> f32;
fn dx(&self, time: f32) -> f32;
fn is_done(&self, time: f32) -> bool; }

common methods implemented by every simulation allowing easy integration into an animation system.

Required methods

fn x(&self, time: f32) -> f32

Return the position for the given time (in seconds).

fn dx(&self, time: f32) -> f32

Return the velocity for the given time (in seconds).

fn is_done(&self, time: f32) -> bool

Return true if the simulation has reached a final position at the given time (in seconds).

Loading content...

Implementors

impl Simulation for Friction[src]

impl Simulation for Gravity[src]

impl Simulation for Scroll[src]

impl Simulation for Spring[src]

Loading content...