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

The value when progress gets close to 0.

The value when progress gets close to 1.

Expected to be between 0 and 1.

Methods

impl<T, Progress> Tween<T, Progress>
[src]

[src]

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

[src]

Creates a new Tween from start, end and progress values.

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

Converts this into a Range, dropping the progress value.

Trait Implementations

impl<T: Debug, Progress: Debug> Debug for Tween<T, Progress>
[src]

[src]

Formats the value using the given formatter.

impl<T: Clone, Progress: Clone> Clone for Tween<T, 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, Progress: Copy> Copy for Tween<T, Progress>
[src]

impl<T: Hash, Progress: Hash> Hash for Tween<T, 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, Progress: PartialEq> PartialEq for Tween<T, 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, Progress: Eq> Eq for Tween<T, Progress>
[src]

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

[src]

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

impl<T, Progress: Zero> From<Range<T>> for Tween<T, Progress>
[src]

[src]

Performs the conversion.