18 #ifndef INCLUDED_UNITANIMATION
19 #define INCLUDED_UNITANIMATION
65 void SetAnimationState(
const CStr& name,
bool once,
float speed,
float desync,
const CStrW& actionSound);
98 std::vector<CSkeletonAnim*>
anims;
122 #endif // INCLUDED_UNITANIMATION
void AddModel(CModel *model, const CObjectEntry *object)
std::vector< CSkeletonAnim * > anims
void SetEntityID(entity_id_t ent)
Change the entity ID associated with this animation (currently used for playing locational sound effe...
void Update(float time)
Advance the animation state.
void ReloadUnit(CModel *model, const CObjectEntry *object)
Regenerate internal animation state from the models in the current unit.
void SetAnimationState(const CStr &name, bool once, float speed, float desync, const CStrW &actionSound)
Start playing an animation.
void SetAnimationSyncRepeat(float repeatTime)
Adjust the speed of the current animation, so that Update(repeatTime) will do a complete animation lo...
NONCOPYABLE(CUnitAnimation)
Deals with synchronisation issues between raw animation data (CModel, CSkeletonAnim) and the simulati...
std::vector< SModelAnimState > m_AnimStates
CUnitAnimation(entity_id_t ent, CModel *model, CObjectEntry *object)
Construct for a given unit, defaulting to the "idle" animation.
u32 entity_id_t
Entity ID type.
void SetAnimationSyncOffset(float actionTime)
Adjust the offset of the current animation, so that Update(actionTime) will advance it to the 'action...
const CObjectEntry * m_Object