pub struct AnimationManager {
pub player_controllers: HashMap<EntityId, PlayerAnimController>,
pub enemy_controllers: HashMap<EntityId, EnemyAnimController>,
pub boss_controllers: HashMap<EntityId, BossAnimController>,
pub ik_limbs: HashMap<(EntityId, String), IKLimb>,
pub entity_positions: HashMap<EntityId, Vec3>,
/* private fields */
}Expand description
Centralized animation manager owning all active controllers.
Fields§
§player_controllers: HashMap<EntityId, PlayerAnimController>Player controllers keyed by entity ID.
enemy_controllers: HashMap<EntityId, EnemyAnimController>Enemy controllers keyed by entity ID.
boss_controllers: HashMap<EntityId, BossAnimController>Boss controllers keyed by entity ID.
ik_limbs: HashMap<(EntityId, String), IKLimb>IK limbs keyed by (entity_id, limb_name).
entity_positions: HashMap<EntityId, Vec3>Known entity positions (updated externally).
Implementations§
Source§impl AnimationManager
impl AnimationManager
pub fn new() -> Self
Sourcepub fn register_player(&mut self, entity_id: EntityId, glyph_count: usize)
pub fn register_player(&mut self, entity_id: EntityId, glyph_count: usize)
Register a player entity for animation.
Sourcepub fn register_enemy(&mut self, entity_id: EntityId, glyph_count: usize)
pub fn register_enemy(&mut self, entity_id: EntityId, glyph_count: usize)
Register an enemy entity for animation.
Sourcepub fn register_boss(
&mut self,
entity_id: EntityId,
controller: BossAnimController,
)
pub fn register_boss( &mut self, entity_id: EntityId, controller: BossAnimController, )
Register a boss entity.
Sourcepub fn register_ik_limb(&mut self, entity_id: EntityId, limb: IKLimb)
pub fn register_ik_limb(&mut self, entity_id: EntityId, limb: IKLimb)
Register an IK limb for an entity.
Sourcepub fn trigger_player_state(
&mut self,
entity_id: EntityId,
new_state: PlayerAnimState,
) -> bool
pub fn trigger_player_state( &mut self, entity_id: EntityId, new_state: PlayerAnimState, ) -> bool
Trigger a state transition on a player entity.
Sourcepub fn trigger_enemy_state(
&mut self,
entity_id: EntityId,
new_state: EnemyAnimState,
) -> bool
pub fn trigger_enemy_state( &mut self, entity_id: EntityId, new_state: EnemyAnimState, ) -> bool
Trigger a state transition on an enemy entity.
Sourcepub fn set_ik_target(
&mut self,
entity_id: EntityId,
chain_name: &str,
target: IKTarget,
)
pub fn set_ik_target( &mut self, entity_id: EntityId, chain_name: &str, target: IKTarget, )
Set an IK target for a named limb on an entity.
Sourcepub fn get_glyph_transforms(&self, entity_id: EntityId) -> Vec<GlyphTransform>
pub fn get_glyph_transforms(&self, entity_id: EntityId) -> Vec<GlyphTransform>
Get the output transforms for an entity (after update).
Sourcepub fn remove_entity(&mut self, entity_id: EntityId)
pub fn remove_entity(&mut self, entity_id: EntityId)
Remove all controllers for a despawned entity.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnimationManager
impl RefUnwindSafe for AnimationManager
impl Send for AnimationManager
impl Sync for AnimationManager
impl Unpin for AnimationManager
impl UnsafeUnpin for AnimationManager
impl UnwindSafe for AnimationManager
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.