18#ifndef INCLUDED_UNITANIMATION
19#define INCLUDED_UNITANIMATION
60 void SetAnimationState(
const CStr& name,
bool once,
float speed,
float desync,
const CStrW& actionSound);
Definition: ObjectEntry.h:38
Definition: SkeletonAnim.h:33
Deals with synchronisation issues between raw animation data (CModel, CSkeletonAnim) and the simulati...
Definition: UnitAnimation.h:37
void Update(float time)
Advance the animation state.
Definition: UnitAnimation.cpp:157
void SetAnimationState(const CStr &name, bool once, float speed, float desync, const CStrW &actionSound)
Start playing an animation.
Definition: UnitAnimation.cpp:102
CModel * m_Model
Definition: UnitAnimation.h:123
NONCOPYABLE(CUnitAnimation)
const CObjectEntry * m_Object
Definition: UnitAnimation.h:124
CStr m_State
Definition: UnitAnimation.h:125
float m_OriginalSpeed
Definition: UnitAnimation.h:128
void SetAnimationSyncRepeat(float repeatTime)
Adjust the speed of the current animation, so that Update(repeatTime) will do a complete animation lo...
Definition: UnitAnimation.cpp:119
bool m_Looping
Definition: UnitAnimation.h:127
CStrW m_ActionSound
Definition: UnitAnimation.h:132
CStr m_AnimationID
Definition: UnitAnimation.h:126
float m_Speed
Definition: UnitAnimation.h:129
void SetAnimationSyncOffset(float actionTime)
Adjust the offset of the current animation, so that Update(actionTime) will advance it to the 'action...
Definition: UnitAnimation.cpp:124
void AddModel(CModel *model, const CObjectEntry *object)
Definition: UnitAnimation.cpp:53
CUnitAnimation(entity_id_t ent, CModel *model, CObjectEntry *object)
Construct for a given unit, defaulting to the "idle" animation.
Definition: UnitAnimation.cpp:46
entity_id_t m_Entity
Definition: UnitAnimation.h:122
float m_Desync
Definition: UnitAnimation.h:131
float m_SyncRepeatTime
Definition: UnitAnimation.h:130
void ReloadAnimation()
Reload animation so any changes take immediate effect.
Definition: UnitAnimation.cpp:86
std::vector< SModelAnimState > m_AnimStates
Definition: UnitAnimation.h:112
void ReloadUnit(CModel *model, const CObjectEntry *object)
Regenerate internal animation state from the models in the current unit.
Definition: UnitAnimation.cpp:91
bool m_AnimStatesAreStatic
True if all the current AnimStates are static, so Update() doesn't need to do any work at all.
Definition: UnitAnimation.h:118
void PickAnimationID()
Picks a new animation ID from our current state.
Definition: UnitAnimation.cpp:280
u32 entity_id_t
Entity ID type.
Definition: Entity.h:29
Definition: UnitAnimation.h:102
const CObjectEntry * object
Definition: UnitAnimation.h:105
bool pastSoundPos
Definition: UnitAnimation.h:109
float time
Definition: UnitAnimation.h:106
CSkeletonAnim * anim
Definition: UnitAnimation.h:104
bool pastActionPos
Definition: UnitAnimation.h:108
bool pastLoadPos
Definition: UnitAnimation.h:107
CModel * model
Definition: UnitAnimation.h:103