Skip to main content

sample_scalar

Function sample_scalar 

Source
pub fn sample_scalar(
    animation: &Animated<f32>,
    time: MediaTime,
    context: &SampleContext<'_>,
) -> f32
Expand description

Samples one animated scalar with the project’s keyframe semantics.

Times outside the keyframes clamp to the first or last value, and a alpha2_model::Interpolation::Hold segment keeps its left value. Interpolation is numeric, so a rotation from 0 to 720 degrees turns twice. A data binding reads its channel through context, and is zero without a value.