pub struct SplineKeyframes { /* private fields */ }Expand description
A keyframe animation specification with smooth cubic Hermite spline interpolation.
Provides C1 continuity (smooth derivatives at keyframe boundaries),
unlike KeyframesSpec which uses C0 linear interpolation.
Uses the Fritsch–Carlson monotonicity-preserving Hermite spline
Implementations§
Source§impl SplineKeyframes
impl SplineKeyframes
Sourcepub fn new(keyframes: Vec<(f32, f32)>) -> Self
pub fn new(keyframes: Vec<(f32, f32)>) -> Self
Build a spline keyframe from time/value pairs.
Times should be in [0.0, 1.0] and sorted ascending. At least 2 keyframes are required.
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Stable fingerprint of the keyframe times/values for change detection.
Used by animate_spline_keyframes to restart when keyframes change
without exposing the private spline internals.
Trait Implementations§
Source§impl Clone for SplineKeyframes
impl Clone for SplineKeyframes
Source§fn clone(&self) -> SplineKeyframes
fn clone(&self) -> SplineKeyframes
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SplineKeyframes
impl RefUnwindSafe for SplineKeyframes
impl Send for SplineKeyframes
impl Sync for SplineKeyframes
impl Unpin for SplineKeyframes
impl UnsafeUnpin for SplineKeyframes
impl UnwindSafe for SplineKeyframes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more