Type Alias vek::transition::LinearTransition
source · pub type LinearTransition<T, Progress = f32> = Transition<T, IdentityProgressMapper, Progress>;
Expand description
A convenience structure for storing a linear progression from one value to another.
Aliased Type§
struct LinearTransition<T, Progress = f32> {
pub start: T,
pub end: T,
pub progress: Progress,
pub progress_mapper: IdentityProgressMapper,
}
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: IdentityProgressMapper
Functor that maps the current progress value to a LERP factor.
Implementations§
source§impl<T, Progress> LinearTransition<T, Progress>
impl<T, Progress> LinearTransition<T, Progress>
sourcepub fn new(start: T, end: T) -> Selfwhere
Progress: Zero,
pub fn new(start: T, end: T) -> Selfwhere
Progress: Zero,
Creates a new LinearTransition
from start
and end
values, setting progress
to zero.
sourcepub fn with_progress(start: T, end: T, progress: Progress) -> Self
pub fn with_progress(start: T, end: T, progress: Progress) -> Self
Creates a new LinearTransition
from start
, end
and progress
values.