Function zng_var::types::slerp_sampler

source ·
pub fn slerp_sampler<T: Transitionable>(
    t: &Transition<T>,
    step: EasingStep
) -> T
Expand description

Spherical linear interpolation sampler.

Animates rotations over the shortest change between angles by modulo wrapping. A transition from 358º to 1º goes directly to 361º (modulo normalized to 1º).

Types that support this use the is_slerp_enabled function inside Transitionable::lerp to change mode, types that don’t support this use the normal linear interpolation. All angle and transform units implement this.

Samplers can be set in animations using the Var::easing_with method.