pub struct ExprTrack {
pub name: String,
pub keyframes: Vec<ExprKeyframe>,
pub loop_mode: SeqLoopMode,
}Expand description
A named sequence of ExprKeyframes.
Fields§
§name: StringHuman-readable name for this track (e.g. "happy_cycle").
keyframes: Vec<ExprKeyframe>Keyframes sorted ascending by time.
loop_mode: SeqLoopModeLooping behaviour.
Implementations§
Source§impl ExprTrack
impl ExprTrack
Sourcepub fn add_keyframe(&mut self, kf: ExprKeyframe)
pub fn add_keyframe(&mut self, kf: ExprKeyframe)
Insert a keyframe, keeping the list sorted by time.
Sourcepub fn remove_keyframe(&mut self, idx: usize)
pub fn remove_keyframe(&mut self, idx: usize)
Remove the keyframe at idx (no-op if out of bounds).
Sourcepub fn evaluate(&self, t_in: f32) -> ExprWeights
pub fn evaluate(&self, t_in: f32) -> ExprWeights
Evaluate expression weights at time t_in, respecting loop mode and easing.
Auto Trait Implementations§
impl Freeze for ExprTrack
impl RefUnwindSafe for ExprTrack
impl Send for ExprTrack
impl Sync for ExprTrack
impl Unpin for ExprTrack
impl UnsafeUnpin for ExprTrack
impl UnwindSafe for ExprTrack
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more