18 #ifndef INCLUDED_UNITANIMATION 19 #define INCLUDED_UNITANIMATION 67 void SetAnimationState(
const CStr& name,
bool once,
float speed,
float desync,
const CStrW& actionSound);
142 #endif // INCLUDED_UNITANIMATION entity_id_t m_Entity
Definition: UnitAnimation.h:129
void AddModel(CModel *model, const CObjectEntry *object)
Definition: UnitAnimation.cpp:58
bool pastSoundPos
Definition: UnitAnimation.h:116
bool m_Looping
Definition: UnitAnimation.h:134
CStr m_State
Definition: UnitAnimation.h:132
CModel * model
Definition: UnitAnimation.h:110
CStrW m_ActionSound
Definition: UnitAnimation.h:139
void ReloadAnimation()
Reload animation so any changes take immediate effect.
Definition: UnitAnimation.cpp:91
void SetEntityID(entity_id_t ent)
Change the entity ID associated with this animation (currently used for playing locational sound effe...
Definition: UnitAnimation.cpp:53
float time
Definition: UnitAnimation.h:113
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:125
CSkeletonAnim * anim
Definition: UnitAnimation.h:111
void Update(float time)
Advance the animation state.
Definition: UnitAnimation.cpp:162
float m_Speed
Definition: UnitAnimation.h:136
CStr m_AnimationID
Definition: UnitAnimation.h:133
void ReloadUnit(CModel *model, const CObjectEntry *object)
Regenerate internal animation state from the models in the current unit.
Definition: UnitAnimation.cpp:96
float m_Desync
Definition: UnitAnimation.h:138
void SetAnimationState(const CStr &name, bool once, float speed, float desync, const CStrW &actionSound)
Start playing an animation.
Definition: UnitAnimation.cpp:107
float m_SyncRepeatTime
Definition: UnitAnimation.h:137
void SetAnimationSyncRepeat(float repeatTime)
Adjust the speed of the current animation, so that Update(repeatTime) will do a complete animation lo...
Definition: UnitAnimation.cpp:124
NONCOPYABLE(CUnitAnimation)
const CObjectEntry * object
Definition: UnitAnimation.h:112
Definition: UnitAnimation.h:108
CModel * m_Model
Definition: UnitAnimation.h:130
Deals with synchronisation issues between raw animation data (CModel, CSkeletonAnim) and the simulati...
Definition: UnitAnimation.h:37
std::vector< SModelAnimState > m_AnimStates
Definition: UnitAnimation.h:119
float m_OriginalSpeed
Definition: UnitAnimation.h:135
CUnitAnimation(entity_id_t ent, CModel *model, CObjectEntry *object)
Construct for a given unit, defaulting to the "idle" animation.
Definition: UnitAnimation.cpp:46
bool pastLoadPos
Definition: UnitAnimation.h:114
u32 entity_id_t
Entity ID type.
Definition: Entity.h:23
void SetAnimationSyncOffset(float actionTime)
Adjust the offset of the current animation, so that Update(actionTime) will advance it to the 'action...
Definition: UnitAnimation.cpp:129
void PickAnimationID()
Picks a new animation ID from our current state.
Definition: UnitAnimation.cpp:285
Definition: ObjectEntry.h:38
bool pastActionPos
Definition: UnitAnimation.h:115
const CObjectEntry * m_Object
Definition: UnitAnimation.h:131
Definition: SkeletonAnim.h:32