Struct vek::tween::Tween
[−]
[src]
pub struct Tween<T, Progress = f32> { pub start: T, pub end: T, pub progress: Progress, }
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.
Methods
impl<T, Progress> Tween<T, Progress>
[src]
fn new(start: T, end: T) -> Self where
Progress: Zero,
[src]
Progress: Zero,
Creates a new Tween
from start
and end
values, setting progress
to zero.
fn with_progress(start: T, end: T, progress: Progress) -> Self
[src]
Creates a new Tween
from start
, end
and progress
values.
fn get(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 get_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_range(self) -> Range<T>
[src]
Converts this into a Range
, dropping the progress
value.
Trait Implementations
impl<T: Debug, Progress: Debug> Debug for Tween<T, Progress>
[src]
impl<T: Clone, Progress: Clone> Clone for Tween<T, Progress>
[src]
fn clone(&self) -> Tween<T, 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, Progress: Copy> Copy for Tween<T, Progress>
[src]
impl<T: Hash, Progress: Hash> Hash for Tween<T, Progress>
[src]
fn hash<__HTProgress: Hasher>(&self, __arg_0: &mut __HTProgress)
[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, Progress: PartialEq> PartialEq for Tween<T, Progress>
[src]
fn eq(&self, __arg_0: &Tween<T, 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: &Tween<T, Progress>) -> bool
[src]
This method tests for !=
.