pub struct PlayerAnimController {
pub current_state: PlayerAnimState,
pub prev_state: PlayerAnimState,
pub blend_factor: f32,
pub transition_time: f32,
pub state_timer: f32,
pub damage_direction: Vec3,
pub move_direction: Vec3,
pub movement_speed: f32,
pub ik_targets: HashMap<String, IKTarget>,
/* private fields */
}Expand description
Drives per-glyph transforms for a player entity based on the current state.
Fields§
§current_state: PlayerAnimState§prev_state: PlayerAnimState§blend_factor: f32Blend factor between prev and current (0 = fully prev, 1 = fully current).
transition_time: f32Total time for the current transition (seconds).
state_timer: f32Elapsed time in the current state.
damage_direction: Vec3Direction toward the current damage source (for Hurt recoil).
move_direction: Vec3Direction of movement (for Dodge squash-stretch).
movement_speed: f32Movement speed parameter [0, 1] for idle/walk blend.
ik_targets: HashMap<String, IKTarget>IK targets active on this controller.
Implementations§
Source§impl PlayerAnimController
impl PlayerAnimController
pub fn new(glyph_count: usize) -> Self
Sourcepub fn transition_to(&mut self, new_state: PlayerAnimState) -> bool
pub fn transition_to(&mut self, new_state: PlayerAnimState) -> bool
Attempt to transition to a new state. Returns true if the transition was accepted.
Auto Trait Implementations§
impl Freeze for PlayerAnimController
impl RefUnwindSafe for PlayerAnimController
impl Send for PlayerAnimController
impl Sync for PlayerAnimController
impl Unpin for PlayerAnimController
impl UnsafeUnpin for PlayerAnimController
impl UnwindSafe for PlayerAnimController
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.