Struct vek::transition::Transition
[−]
[src]
pub struct Transition<T, F, Progress = f32> { pub start: T, pub end: T, pub progress: Progress, pub progress_mapper: F, }
A convenience structure for storing a progression from one value to another.
Fields
start: T
The value when progress gets close to 0.
end: T
The value when progress gets close to 1.
progress: Progress
Expected to be between 0 and 1.
progress_mapper: F
Functor that maps the current progress value to a LERP factor.
Methods
impl<T, F, Progress> Transition<T, F, Progress>
[src]
fn with_mapper(start: T, end: T, progress_mapper: F) -> Self where
Progress: Zero,
[src]
Progress: Zero,
Creates a new Transition
from start
and end
values and progress_mapper
, setting progress
to zero.
fn with_mapper_and_progress(
start: T,
end: T,
progress_mapper: F,
progress: Progress
) -> Self
[src]
start: T,
end: T,
progress_mapper: F,
progress: Progress
) -> Self
Creates a new Transition
from start
, end
, progress_mapper
and progress
values.
fn into_range(self) -> Range<T>
[src]
Converts this into a Range
, dropping the progress
and progress_mapper
values.
impl<T, F, Progress> Transition<T, F, Progress> where
F: ProgressMapper<Progress>,
[src]
F: ProgressMapper<Progress>,
fn into_current(self) -> T where
T: Lerp<Progress, Output = T>,
Progress: Clamp + Zero + One,
[src]
T: Lerp<Progress, Output = T>,
Progress: Clamp + Zero + One,
Gets the transition's current state, clamping progress to [0;1].
fn into_current_unclamped(self) -> T where
T: Lerp<Progress, Output = T>,
[src]
T: Lerp<Progress, Output = T>,
Gets the transition's current state using the progress
value as-is.
fn into_current_precise(self) -> T where
T: Lerp<Progress, Output = T>,
Progress: Clamp + Zero + One,
[src]
T: Lerp<Progress, Output = T>,
Progress: Clamp + Zero + One,
Gets the transition's current state, clamping progress to [0;1].
fn into_current_unclamped_precise(self) -> T where
T: Lerp<Progress, Output = T>,
[src]
T: Lerp<Progress, Output = T>,
Gets the transition's current state using the progress
value as-is.
fn current<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy + Clamp + Zero + One,
[src]
&'a T: Lerp<Progress, Output = T>,
Progress: Copy + Clamp + Zero + One,
Gets the transition's current state, clamping progress to [0;1].
fn current_unclamped<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy,
[src]
&'a T: Lerp<Progress, Output = T>,
Progress: Copy,
Gets the transition's current state using the progress
value as-is.
fn current_precise<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy + Clamp + Zero + One,
[src]
&'a T: Lerp<Progress, Output = T>,
Progress: Copy + Clamp + Zero + One,
Gets the transition's current state, clamping progress to [0;1].
fn current_unclamped_precise<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy,
[src]
&'a T: Lerp<Progress, Output = T>,
Progress: Copy,
Gets the transition's current state using the progress
value as-is.
Trait Implementations
impl<T: Debug, F: Debug, Progress: Debug> Debug for Transition<T, F, Progress>
[src]
impl<T: Clone, F: Clone, Progress: Clone> Clone for Transition<T, F, Progress>
[src]
fn clone(&self) -> Transition<T, F, Progress>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Copy, F: Copy, Progress: Copy> Copy for Transition<T, F, Progress>
[src]
impl<T: Hash, F: Hash, Progress: Hash> Hash for Transition<T, F, Progress>
[src]
fn hash<__HTFProgress: Hasher>(&self, __arg_0: &mut __HTFProgress)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: PartialEq, F: PartialEq, Progress: PartialEq> PartialEq for Transition<T, F, Progress>
[src]
fn eq(&self, __arg_0: &Transition<T, F, Progress>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Transition<T, F, Progress>) -> bool
[src]
This method tests for !=
.