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

The value when progress gets close to 0.

The value when progress gets close to 1.

Expected to be between 0 and 1.

Functor that maps the current progress value to a LERP factor.

Methods

impl<T, F, Progress> Transition<T, F, Progress>
[src]

[src]

Creates a new Transition from start and end values and progress_mapper, setting progress to zero.

[src]

Creates a new Transition from start, end, progress_mapper and progress values.

[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]

[src]

Gets the transition's current state, clamping progress to [0;1].

[src]

Gets the transition's current state using the progress value as-is.

[src]

Gets the transition's current state, clamping progress to [0;1].

[src]

Gets the transition's current state using the progress value as-is.

[src]

Gets the transition's current state, clamping progress to [0;1].

[src]

Gets the transition's current state using the progress value as-is.

[src]

Gets the transition's current state, clamping progress to [0;1].

[src]

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]

[src]

Formats the value using the given formatter.

impl<T: Clone, F: Clone, Progress: Clone> Clone for Transition<T, F, Progress>
[src]

[src]

Returns a copy of the value. Read more

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]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

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]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T: Eq, F: Eq, Progress: Eq> Eq for Transition<T, F, Progress>
[src]

impl<T: Default, F: Default, Progress: Zero> Default for Transition<T, F, Progress>
[src]

[src]

Returns the "default value" for a type. Read more

impl<T, F: Default, Progress: Zero> From<Range<T>> for Transition<T, F, Progress>
[src]

[src]

Performs the conversion.