Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.0 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef MAPANIMATOR_H
  8. #define MAPANIMATOR_H
  9. #pragma once
  10. #include "MapClass.h"
  11. #include "MapKeyFrame.h"
  12. class CMapAnimator : public CMapKeyFrame
  13. {
  14. public:
  15. DECLARE_MAPCLASS( CMapAnimator, CMapKeyFrame );
  16. //
  17. // Factories.
  18. //
  19. static CMapClass *CreateMapAnimator(CHelperInfo *pHelperInfo, CMapEntity *pParent);
  20. //
  21. // Construction/destruction.
  22. //
  23. CMapAnimator();
  24. ~CMapAnimator();
  25. virtual size_t GetSize( void ) { return sizeof(*this); }
  26. virtual CMapClass *Copy(bool bUpdateDependencies);
  27. virtual CMapClass *CopyFrom(CMapClass *pFrom, bool bUpdateDependencies);
  28. virtual void UpdateAnimation( float animTime );
  29. virtual void OnClone( CMapClass *pClone, CMapWorld *pWorld, const CMapObjectList &OriginalList, CMapObjectList &NewList );
  30. virtual bool GetTransformMatrix( VMatrix& matrix );
  31. virtual void OnParentKeyChanged( const char* key, const char* value );
  32. virtual CMapAnimator *GetAnimator(void) { return this; }
  33. void RebuildPath( void );
  34. float GetKeyFramesAtTime( float time, CMapKeyFrame *&pKeyFrame, CMapKeyFrame *&pPrevKeyFrame );
  35. CMapEntity *CreateNewKeyFrame( float time );
  36. void GetAnimationAtTime( float animTime, Vector& newOrigin, Quaternion &newAngles );
  37. static void GetAnimationAtTime( CMapKeyFrame *currentKey, CMapKeyFrame *pPrevKey, float animTime, Vector& newOrigin, Quaternion &newAngles, int posInterpolator, int rotInterpolator );
  38. int GetNumKeysChanged() {return m_nKeysChanged;}
  39. private:
  40. // Used by the keys to detect when changes need to be sent to the position interpolators.
  41. int m_nKeysChanged;
  42. VMatrix m_CoordFrame;
  43. bool m_bCurrentlyAnimating;
  44. CMapKeyFrame *m_pCurrentKeyFrame; // keyframe it's currently at
  45. int m_iTimeModifier;
  46. int m_iPositionInterpolator;
  47. int m_iRotationInterpolator;
  48. friend CMapKeyFrame;
  49. };
  50. #endif // MAPANIMATOR_H