pub struct AnimCurve<T: AnimCurveValue> { /* private fields */ }Expand description
Immutable sparse animation curve over keyframe times.
Construction is validated through super::create_curve; keyframe times
are strictly increasing and every value and tangent is finite.
Donor: oa::AnimCurve<T>.
Implementations§
Source§impl<T: AnimCurveValue> AnimCurve<T>
impl<T: AnimCurveValue> AnimCurve<T>
Sourcepub fn interpolation(&self) -> AnimInterpolation
pub fn interpolation(&self) -> AnimInterpolation
Interpolation mode between adjacent keys.
Sourcepub fn keyframe_count(&self) -> u32
pub fn keyframe_count(&self) -> u32
Number of stored keyframes.
Sourcepub fn keyframes(&self) -> &[Keyframe<T>]
pub fn keyframes(&self) -> &[Keyframe<T>]
Borrowed keyframes in strictly increasing time order.
Sourcepub fn start_time(&self) -> Duration
pub fn start_time(&self) -> Duration
Sourcepub fn duration(&self) -> Duration
pub fn duration(&self) -> Duration
Span between the last and first keyframe times.
The span is guaranteed representable by the construction-time
validation of super::create_curve.
Sourcepub fn sample(&self, time: Duration, wrap_mode: AnimWrapMode) -> Result<T>
pub fn sample(&self, time: Duration, wrap_mode: AnimWrapMode) -> Result<T>
Sample the curve at time under wrap_mode.
Convenience delegate of super::sample_curve.
§Errors
Returns an error when interpolation produces a non-finite or non-normalizable value.
Trait Implementations§
impl<T: PartialEq + AnimCurveValue> StructuralPartialEq for AnimCurve<T>
Auto Trait Implementations§
impl<T> Forget for AnimCurve<T>
impl<T> Freeze for AnimCurve<T>
impl<T> Move for AnimCurve<T>
impl<T> RefUnwindSafe for AnimCurve<T>
impl<T> Send for AnimCurve<T>
impl<T> Sync for AnimCurve<T>
impl<T> Unpin for AnimCurve<T>
impl<T> UnsafeUnpin for AnimCurve<T>
impl<T> UnwindSafe for AnimCurve<T>
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