pub struct MotionState {
pub name: String,
pub clip_name: String,
pub duration: f32,
pub loop_state: bool,
pub speed: f32,
pub morph_weights: HashMap<String, f32>,
}Expand description
A single animation state bound to one clip.
Fields§
§name: StringUnique name of this state.
clip_name: StringName of the animation clip (resolved externally).
duration: f32Total clip duration in seconds.
loop_state: boolWhether the clip should loop.
speed: f32Playback speed multiplier (1.0 = normal speed).
morph_weights: HashMap<String, f32>Base morph-target weights that apply while this state is active.
Implementations§
Source§impl MotionState
impl MotionState
Sourcepub fn new(
name: impl Into<String>,
clip_name: impl Into<String>,
duration: f32,
) -> Self
pub fn new( name: impl Into<String>, clip_name: impl Into<String>, duration: f32, ) -> Self
Create a state with sensible defaults.
Sourcepub fn with_speed(self, speed: f32) -> Self
pub fn with_speed(self, speed: f32) -> Self
Fluent setter for speed.
Sourcepub fn with_morph(self, key: impl Into<String>, value: f32) -> Self
pub fn with_morph(self, key: impl Into<String>, value: f32) -> Self
Fluent setter that adds one morph weight entry.
Auto Trait Implementations§
impl Freeze for MotionState
impl RefUnwindSafe for MotionState
impl Send for MotionState
impl Sync for MotionState
impl Unpin for MotionState
impl UnsafeUnpin for MotionState
impl UnwindSafe for MotionState
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