Struct catchit::Transition
[−]
[src]
pub struct Transition { pub v1: Scalar, pub v2: Scalar, pub current: Scalar, pub transition_time_s: f64, pub direction: TransitionDirection, pub state_time: f64, }
Fields
v1 | |
v2 | |
current | |
transition_time_s | Time it takes to make transition |
direction | |
state_time | Keeps timing information, helpful to determine how long a state is held |
Methods
impl Transition
fn new(from: Scalar, to: Scalar, transition_time_s: f64) -> Transition
fn from(&self) -> Scalar
fn to(&self) -> Scalar
fn state(&self) -> TransitionState
fn is_pristine(&self) -> bool
fn advance(&mut self, dt: f64) -> &mut Self
Move transition towards the finished state
dt
is in seconds and signals the passed time since the last advance
call.
Advances the state_time
as well
fn reverse(&mut self) -> &mut Self
Reverse direction and reset state_time
if we are Finished