Skip to main content

TrackValue

Trait TrackValue 

Source
pub trait TrackValue: Copy {
    // Required methods
    fn linear(self, other: Self, amount: f32) -> Self;
    fn cubic(
        start: Self,
        start_tangent: Self,
        end: Self,
        end_tangent: Self,
        amount: f32,
        duration: f32,
    ) -> Self;
    fn is_finite(self) -> bool;

    // Provided methods
    fn is_valid_value(self) -> bool { ... }
    fn normalized(self) -> Self { ... }
}
Expand description

Operations required to evaluate a typed animation track.

Required Methods§

Source

fn linear(self, other: Self, amount: f32) -> Self

Interpolates between two values for a LINEAR sampler.

Source

fn cubic( start: Self, start_tangent: Self, end: Self, end_tangent: Self, amount: f32, duration: f32, ) -> Self

Evaluates a Hermite segment. Tangents are derivatives and are scaled by the segment duration as required by glTF.

Source

fn is_finite(self) -> bool

Reports whether a value contains only finite components.

Provided Methods§

Source

fn is_valid_value(self) -> bool

Reports whether a sampled value is valid. Quaternion values additionally reject zero length, while tangents only need to be finite.

Source

fn normalized(self) -> Self

Normalizes values that require a canonical sampled representation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TrackValue for Quat

Source§

fn linear(self, other: Self, amount: f32) -> Self

Source§

fn cubic( start: Self, start_tangent: Self, end: Self, end_tangent: Self, amount: f32, duration: f32, ) -> Self

Source§

fn is_finite(self) -> bool

Source§

fn is_valid_value(self) -> bool

Source§

fn normalized(self) -> Self

Source§

impl TrackValue for Vec3

Source§

fn linear(self, other: Self, amount: f32) -> Self

Source§

fn cubic( start: Self, start_tangent: Self, end: Self, end_tangent: Self, amount: f32, duration: f32, ) -> Self

Source§

fn is_finite(self) -> bool

Source§

impl TrackValue for f32

Source§

fn linear(self, other: Self, amount: f32) -> Self

Source§

fn cubic( start: Self, start_tangent: Self, end: Self, end_tangent: Self, amount: f32, duration: f32, ) -> Self

Source§

fn is_finite(self) -> bool

Implementors§