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.

270 lines
7.3 KiB

  1. //===== Copyright (c) 1996-2009, Valve Corporation, All rights reserved. ====
  2. //
  3. // Animation commands
  4. //
  5. //===========================================================================
  6. #ifndef DMEANIMCMD_H
  7. #define DMEANIMCMD_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. // Valve includes
  12. #include "datamodel/dmelement.h"
  13. #include "datamodel/dmattributevar.h"
  14. #include "movieobjects/dmelog.h"
  15. // Forward declarations
  16. class CDmeMotionControl;
  17. class CDmeSequenceBase;
  18. class CDmeSequence;
  19. //-----------------------------------------------------------------------------
  20. // Animation commands
  21. //-----------------------------------------------------------------------------
  22. class CDmeAnimCmd : public CDmElement
  23. {
  24. DEFINE_ELEMENT( CDmeAnimCmd, CDmElement );
  25. public:
  26. static const char *GetAssemblyDmElementTypeString() { return ""; }
  27. bool HasAssemblyDmElement() const { return Q_strcmp( "", GetAssemblyDmElementTypeString() ) != 0; }
  28. };
  29. //-----------------------------------------------------------------------------
  30. // QC fixuploop
  31. //-----------------------------------------------------------------------------
  32. class CDmeAnimCmdFixupLoop : public CDmeAnimCmd
  33. {
  34. DEFINE_ELEMENT( CDmeAnimCmdFixupLoop, CDmeAnimCmd );
  35. public:
  36. static const char *GetAssemblyDmElementTypeString();
  37. CDmaVar< int > m_nStartFrame;
  38. CDmaVar< int > m_nEndFrame;
  39. };
  40. //-----------------------------------------------------------------------------
  41. // QC weightlisrt
  42. //-----------------------------------------------------------------------------
  43. class CDmeAnimCmdWeightList : public CDmeAnimCmd
  44. {
  45. DEFINE_ELEMENT( CDmeAnimCmdWeightList, CDmeAnimCmd );
  46. public:
  47. static const char *GetAssemblyDmElementTypeString() { return ""; }
  48. CDmaString m_sWeightListName;
  49. };
  50. //-----------------------------------------------------------------------------
  51. // QC subtract
  52. //-----------------------------------------------------------------------------
  53. class CDmeAnimCmdSubtract : public CDmeAnimCmd
  54. {
  55. DEFINE_ELEMENT( CDmeAnimCmdSubtract, CDmeAnimCmd );
  56. public:
  57. static const char *GetAssemblyDmElementTypeString();
  58. CDmaElement< CDmeSequenceBase > m_eAnimation;
  59. CDmaVar< int > m_nFrame;
  60. };
  61. //-----------------------------------------------------------------------------
  62. // QC presubtract
  63. //-----------------------------------------------------------------------------
  64. class CDmeAnimCmdPreSubtract : public CDmeAnimCmdSubtract
  65. {
  66. DEFINE_ELEMENT( CDmeAnimCmdPreSubtract, CDmeAnimCmdSubtract );
  67. public:
  68. static const char *GetAssemblyDmElementTypeString();
  69. };
  70. //-----------------------------------------------------------------------------
  71. // QC align, alignto, alignbone, alignboneto
  72. //
  73. // align animationName, boneName = "", any motion, sourceFrame, destinationFrame
  74. // alignTo animationName, boneName = "", motion = X | Y, sourceFrame = 0, destinationFrame = 0
  75. // alignBone animationName, bone, any motion, sourceFrame, destinationFrame
  76. // alignBoneTo animationName, bone, motion = X | Y, sourceFrame = 0, destinationFrame = 0
  77. //-----------------------------------------------------------------------------
  78. class CDmeAnimCmdAlign : public CDmeAnimCmd
  79. {
  80. DEFINE_ELEMENT( CDmeAnimCmdAlign, CDmeAnimCmd );
  81. public:
  82. static const char *GetAssemblyDmElementTypeString() { return ""; }
  83. CDmaElement< CDmeSequenceBase > m_eAnimation;
  84. CDmaString m_sBoneName;
  85. CDmaVar< int > m_nSourceFrame;
  86. CDmaVar< int > m_nDestinatonFrame;
  87. CDmaElement< CDmeMotionControl > m_eMotionControl;
  88. };
  89. // TODO: QC match
  90. // TODO: QC matchblend
  91. // TODO: QC worldspaceblend
  92. // TODO: QC worldspaceblendloop
  93. //-----------------------------------------------------------------------------
  94. // QC rotateTo
  95. //-----------------------------------------------------------------------------
  96. class CDmeAnimCmdRotateTo : public CDmeAnimCmd
  97. {
  98. DEFINE_ELEMENT( CDmeAnimCmdRotateTo, CDmeAnimCmd );
  99. public:
  100. static const char *GetAssemblyDmElementTypeString();
  101. CDmaVar< float > m_flAngle; // Specified in degrees
  102. };
  103. // ikRule, ikFixup handled separately
  104. //-----------------------------------------------------------------------------
  105. // QC walkframe
  106. //-----------------------------------------------------------------------------
  107. class CDmeAnimCmdWalkFrame : public CDmeAnimCmd
  108. {
  109. DEFINE_ELEMENT( CDmeAnimCmdWalkFrame, CDmeAnimCmd );
  110. public:
  111. static const char *GetAssemblyDmElementTypeString() { return ""; }
  112. CDmaElement< CDmeMotionControl > m_eMotionControl;
  113. CDmaVar< int > m_nEndFrame;
  114. };
  115. // TODO: QC walkalignto
  116. // TODO: QC walkalign
  117. //-----------------------------------------------------------------------------
  118. // QC derivative
  119. //-----------------------------------------------------------------------------
  120. class CDmeAnimCmdDerivative : public CDmeAnimCmd
  121. {
  122. DEFINE_ELEMENT( CDmeAnimCmdDerivative, CDmeAnimCmd );
  123. public:
  124. static const char *GetAssemblyDmElementTypeString() { return ""; }
  125. CDmaVar< float > m_flScale;
  126. };
  127. // TODO: QC noanimation
  128. //-----------------------------------------------------------------------------
  129. // QC lineardelta
  130. //-----------------------------------------------------------------------------
  131. class CDmeAnimCmdLinearDelta : public CDmeAnimCmd
  132. {
  133. DEFINE_ELEMENT( CDmeAnimCmdLinearDelta, CDmeAnimCmd );
  134. public:
  135. static const char *GetAssemblyDmElementTypeString() { return ""; }
  136. };
  137. //-----------------------------------------------------------------------------
  138. // QC splinedelta
  139. //-----------------------------------------------------------------------------
  140. class CDmeAnimCmdSplineDelta : public CDmeAnimCmd
  141. {
  142. DEFINE_ELEMENT( CDmeAnimCmdSplineDelta, CDmeAnimCmd );
  143. public:
  144. static const char *GetAssemblyDmElementTypeString() { return ""; }
  145. };
  146. //-----------------------------------------------------------------------------
  147. // QC compress
  148. //-----------------------------------------------------------------------------
  149. class CDmeAnimCmdCompress : public CDmeAnimCmd
  150. {
  151. DEFINE_ELEMENT( CDmeAnimCmdCompress, CDmeAnimCmd );
  152. public:
  153. static const char *GetAssemblyDmElementTypeString() { return ""; }
  154. CDmaVar< int > m_nSkipFrames;
  155. };
  156. //-----------------------------------------------------------------------------
  157. // QC numframes
  158. //-----------------------------------------------------------------------------
  159. class CDmeAnimCmdNumFrames : public CDmeAnimCmd
  160. {
  161. DEFINE_ELEMENT( CDmeAnimCmdNumFrames, CDmeAnimCmd );
  162. public:
  163. static const char *GetAssemblyDmElementTypeString() { return ""; }
  164. CDmaVar< int > m_nFrames;
  165. };
  166. // TODO: counterrotate
  167. // TODO: counterrotateto
  168. // TODO: localhierarchy
  169. //-----------------------------------------------------------------------------
  170. //
  171. //-----------------------------------------------------------------------------
  172. class CDmeAnimCmdLocalHierarchy : public CDmeAnimCmd
  173. {
  174. DEFINE_ELEMENT( CDmeAnimCmdLocalHierarchy, CDmeAnimCmd );
  175. public:
  176. static const char *GetAssemblyDmElementTypeString() { return ""; }
  177. CDmaString m_sBoneName;
  178. CDmaString m_sParentBoneName;
  179. CDmaVar< float > m_flStartFrame;
  180. CDmaVar< float > m_flPeakFrame;
  181. CDmaVar< float > m_flTailFrame;
  182. CDmaVar< float > m_flEndFrame;
  183. };
  184. //-----------------------------------------------------------------------------
  185. //
  186. //-----------------------------------------------------------------------------
  187. class CDmeAnimCmdNoAnimation : public CDmeAnimCmd
  188. {
  189. DEFINE_ELEMENT( CDmeAnimCmdNoAnimation, CDmeAnimCmd );
  190. public:
  191. static const char *GetAssemblyDmElementTypeString() { return ""; }
  192. CDmaVar< bool > m_bNullAttr;
  193. };
  194. #endif // DMEANIMCMD_H