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.

433 lines
15 KiB

  1. //===== Copyright (c) 1996-2009, Valve Corporation, All rights reserved. ====
  2. //
  3. // Animation commands
  4. //
  5. //==========================================================================
  6. // Valve includes
  7. #include "datamodel/dmelementfactoryhelper.h"
  8. #include "mdlobjects/dmeanimcmd.h"
  9. #include "mdlobjects/dmemotioncontrol.h"
  10. #include "mdlobjects/dmesequence.h"
  11. #include "mdlobjects/dmeanimationassemblycommand.h"
  12. #include "movieobjects/dmechannel.h"
  13. #include "bone_setup.h"
  14. // memdbgon must be the last include file in a .cpp file!!!
  15. #include "tier0/memdbgon.h"
  16. //-----------------------------------------------------------------------------
  17. // Expose this class to the scene database
  18. //-----------------------------------------------------------------------------
  19. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmd, CDmeAnimCmd );
  20. //-----------------------------------------------------------------------------
  21. //
  22. //-----------------------------------------------------------------------------
  23. void CDmeAnimCmd::OnConstruction()
  24. {
  25. }
  26. //-----------------------------------------------------------------------------
  27. //
  28. //-----------------------------------------------------------------------------
  29. void CDmeAnimCmd::OnDestruction()
  30. {
  31. }
  32. //-----------------------------------------------------------------------------
  33. // Expose this class to the scene database
  34. //-----------------------------------------------------------------------------
  35. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdFixupLoop, CDmeAnimCmdFixupLoop );
  36. //-----------------------------------------------------------------------------
  37. //
  38. //-----------------------------------------------------------------------------
  39. void CDmeAnimCmdFixupLoop::OnConstruction()
  40. {
  41. m_nStartFrame.Init( this, "startFrame" );
  42. m_nEndFrame.Init( this, "endFrame" );
  43. }
  44. //-----------------------------------------------------------------------------
  45. //
  46. //-----------------------------------------------------------------------------
  47. void CDmeAnimCmdFixupLoop::OnDestruction()
  48. {
  49. }
  50. //-----------------------------------------------------------------------------
  51. //
  52. //-----------------------------------------------------------------------------
  53. const char *CDmeAnimCmdFixupLoop::GetAssemblyDmElementTypeString()
  54. {
  55. return CDmeFixupLoop::GetStaticTypeSymbol().String();
  56. }
  57. //-----------------------------------------------------------------------------
  58. // Expose this class to the scene database
  59. //-----------------------------------------------------------------------------
  60. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdWeightList, CDmeAnimCmdWeightList );
  61. //-----------------------------------------------------------------------------
  62. //
  63. //-----------------------------------------------------------------------------
  64. void CDmeAnimCmdWeightList::OnConstruction()
  65. {
  66. m_sWeightListName.Init( this, "weightListName" );
  67. }
  68. //-----------------------------------------------------------------------------
  69. //
  70. //-----------------------------------------------------------------------------
  71. void CDmeAnimCmdWeightList::OnDestruction()
  72. {
  73. }
  74. //-----------------------------------------------------------------------------
  75. // Expose this class to the scene database
  76. //-----------------------------------------------------------------------------
  77. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdSubtract, CDmeAnimCmdSubtract );
  78. //-----------------------------------------------------------------------------
  79. //
  80. //-----------------------------------------------------------------------------
  81. void CDmeAnimCmdSubtract::OnConstruction()
  82. {
  83. m_eAnimation.Init( this, "animation", FATTRIB_NEVERCOPY );
  84. m_nFrame.Init( this, "frame" );
  85. }
  86. //-----------------------------------------------------------------------------
  87. //
  88. //-----------------------------------------------------------------------------
  89. void CDmeAnimCmdSubtract::OnDestruction()
  90. {
  91. }
  92. //-----------------------------------------------------------------------------
  93. //
  94. //-----------------------------------------------------------------------------
  95. const char *CDmeAnimCmdSubtract::GetAssemblyDmElementTypeString()
  96. {
  97. return CDmeSubtract::GetStaticTypeSymbol().String();
  98. }
  99. //-----------------------------------------------------------------------------
  100. // Expose this class to the scene database
  101. //-----------------------------------------------------------------------------
  102. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdPreSubtract, CDmeAnimCmdPreSubtract );
  103. //-----------------------------------------------------------------------------
  104. //
  105. //-----------------------------------------------------------------------------
  106. void CDmeAnimCmdPreSubtract::OnConstruction()
  107. {
  108. }
  109. //-----------------------------------------------------------------------------
  110. //
  111. //-----------------------------------------------------------------------------
  112. void CDmeAnimCmdPreSubtract::OnDestruction()
  113. {
  114. }
  115. //-----------------------------------------------------------------------------
  116. //
  117. //-----------------------------------------------------------------------------
  118. const char *CDmeAnimCmdPreSubtract::GetAssemblyDmElementTypeString()
  119. {
  120. return CDmePreSubtract::GetStaticTypeSymbol().String();
  121. }
  122. //-----------------------------------------------------------------------------
  123. // CDmeAnimCmdAlign
  124. //-----------------------------------------------------------------------------
  125. //-----------------------------------------------------------------------------
  126. // Expose this class to the scene database
  127. //-----------------------------------------------------------------------------
  128. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdAlign, CDmeAnimCmdAlign );
  129. //-----------------------------------------------------------------------------
  130. //
  131. //-----------------------------------------------------------------------------
  132. void CDmeAnimCmdAlign::OnConstruction()
  133. {
  134. m_eAnimation.Init( this, "animation", FATTRIB_NEVERCOPY );
  135. m_sBoneName.Init( this, "boneName" );
  136. m_nSourceFrame.Init( this, "sourceFrame" );
  137. m_nDestinatonFrame.Init( this, "destinationFrame" );
  138. m_eMotionControl.InitAndCreate( this, "motionControl" );
  139. }
  140. //-----------------------------------------------------------------------------
  141. //
  142. //-----------------------------------------------------------------------------
  143. void CDmeAnimCmdAlign::OnDestruction()
  144. {
  145. }
  146. //-----------------------------------------------------------------------------
  147. // CDmeAnimCmdRotateTo
  148. //-----------------------------------------------------------------------------
  149. //-----------------------------------------------------------------------------
  150. // Expose this class to the scene database
  151. //-----------------------------------------------------------------------------
  152. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdRotateTo, CDmeAnimCmdRotateTo );
  153. //-----------------------------------------------------------------------------
  154. //
  155. //-----------------------------------------------------------------------------
  156. void CDmeAnimCmdRotateTo::OnConstruction()
  157. {
  158. m_flAngle.Init( this, "angle" );
  159. }
  160. //-----------------------------------------------------------------------------
  161. //
  162. //-----------------------------------------------------------------------------
  163. void CDmeAnimCmdRotateTo::OnDestruction()
  164. {
  165. }
  166. //-----------------------------------------------------------------------------
  167. //
  168. //-----------------------------------------------------------------------------
  169. const char *CDmeAnimCmdRotateTo::GetAssemblyDmElementTypeString()
  170. {
  171. return CDmeRotateTo::GetStaticTypeSymbol().String();
  172. }
  173. //-----------------------------------------------------------------------------
  174. // Expose this class to the scene database
  175. //-----------------------------------------------------------------------------
  176. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdWalkFrame, CDmeAnimCmdWalkFrame );
  177. //-----------------------------------------------------------------------------
  178. //
  179. //-----------------------------------------------------------------------------
  180. void CDmeAnimCmdWalkFrame::OnConstruction()
  181. {
  182. m_eMotionControl.InitAndCreate( this, "motionControl" );
  183. m_nEndFrame.Init( this, "endFrame" );
  184. }
  185. //-----------------------------------------------------------------------------
  186. //
  187. //-----------------------------------------------------------------------------
  188. void CDmeAnimCmdWalkFrame::OnDestruction()
  189. {
  190. }
  191. //-----------------------------------------------------------------------------
  192. // CDmeAnimCmdDerivative
  193. //-----------------------------------------------------------------------------
  194. //-----------------------------------------------------------------------------
  195. // Expose this class to the scene database
  196. //-----------------------------------------------------------------------------
  197. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdDerivative, CDmeAnimCmdDerivative );
  198. //-----------------------------------------------------------------------------
  199. //
  200. //-----------------------------------------------------------------------------
  201. void CDmeAnimCmdDerivative::OnConstruction()
  202. {
  203. m_flScale.InitAndSet( this, "scale", 1.0f );
  204. }
  205. //-----------------------------------------------------------------------------
  206. //
  207. //-----------------------------------------------------------------------------
  208. void CDmeAnimCmdDerivative::OnDestruction()
  209. {
  210. }
  211. //-----------------------------------------------------------------------------
  212. // CDmeAnimCmdLinearDelta
  213. //-----------------------------------------------------------------------------
  214. //-----------------------------------------------------------------------------
  215. // Expose this class to the scene database
  216. //-----------------------------------------------------------------------------
  217. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdLinearDelta, CDmeAnimCmdLinearDelta );
  218. //-----------------------------------------------------------------------------
  219. //
  220. //-----------------------------------------------------------------------------
  221. void CDmeAnimCmdLinearDelta::OnConstruction()
  222. {
  223. }
  224. //-----------------------------------------------------------------------------
  225. //
  226. //-----------------------------------------------------------------------------
  227. void CDmeAnimCmdLinearDelta::OnDestruction()
  228. {
  229. }
  230. //-----------------------------------------------------------------------------
  231. // CDmeAnimCmdSplineDelta
  232. //-----------------------------------------------------------------------------
  233. //-----------------------------------------------------------------------------
  234. // Expose this class to the scene database
  235. //-----------------------------------------------------------------------------
  236. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdSplineDelta, CDmeAnimCmdSplineDelta );
  237. //-----------------------------------------------------------------------------
  238. //
  239. //-----------------------------------------------------------------------------
  240. void CDmeAnimCmdSplineDelta::OnConstruction()
  241. {
  242. }
  243. //-----------------------------------------------------------------------------
  244. //
  245. //-----------------------------------------------------------------------------
  246. void CDmeAnimCmdSplineDelta::OnDestruction()
  247. {
  248. }
  249. //-----------------------------------------------------------------------------
  250. // CDmeAnimCmdCompress
  251. //-----------------------------------------------------------------------------
  252. //-----------------------------------------------------------------------------
  253. // Expose this class to the scene database
  254. //-----------------------------------------------------------------------------
  255. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdCompress, CDmeAnimCmdCompress );
  256. //-----------------------------------------------------------------------------
  257. //
  258. //-----------------------------------------------------------------------------
  259. void CDmeAnimCmdCompress::OnConstruction()
  260. {
  261. m_nSkipFrames.Init( this, "skipFrames" );
  262. }
  263. //-----------------------------------------------------------------------------
  264. //
  265. //-----------------------------------------------------------------------------
  266. void CDmeAnimCmdCompress::OnDestruction()
  267. {
  268. }
  269. //-----------------------------------------------------------------------------
  270. // CDmeAnimCmdNumFrames
  271. //-----------------------------------------------------------------------------
  272. //-----------------------------------------------------------------------------
  273. // Expose this class to the scene database
  274. //-----------------------------------------------------------------------------
  275. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdNumFrames, CDmeAnimCmdNumFrames );
  276. //-----------------------------------------------------------------------------
  277. //
  278. //-----------------------------------------------------------------------------
  279. void CDmeAnimCmdNumFrames::OnConstruction()
  280. {
  281. m_nFrames.Init( this, "frames" );
  282. }
  283. //-----------------------------------------------------------------------------
  284. //
  285. //-----------------------------------------------------------------------------
  286. void CDmeAnimCmdNumFrames::OnDestruction()
  287. {
  288. }
  289. //-----------------------------------------------------------------------------
  290. // CDmeAnimCmdLocalHierarchy
  291. //-----------------------------------------------------------------------------
  292. //-----------------------------------------------------------------------------
  293. // Expose this class to the scene database
  294. //-----------------------------------------------------------------------------
  295. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdLocalHierarchy, CDmeAnimCmdLocalHierarchy );
  296. //-----------------------------------------------------------------------------
  297. //
  298. //-----------------------------------------------------------------------------
  299. void CDmeAnimCmdLocalHierarchy::OnConstruction()
  300. {
  301. m_sBoneName.Init( this, "boneName" );
  302. m_sParentBoneName.Init( this, "parentBoneName" );
  303. m_flStartFrame.Init( this, "startFrame" );
  304. m_flPeakFrame.Init( this, "peakFrame" );
  305. m_flTailFrame.Init( this, "tailFrame" );
  306. m_flEndFrame.Init( this, "endFrame" );
  307. }
  308. //-----------------------------------------------------------------------------
  309. //
  310. //-----------------------------------------------------------------------------
  311. void CDmeAnimCmdLocalHierarchy::OnDestruction()
  312. {
  313. }
  314. //-----------------------------------------------------------------------------
  315. // CDmeAnimCmdNoAnimation
  316. //-----------------------------------------------------------------------------
  317. //-----------------------------------------------------------------------------
  318. // Expose this class to the scene database
  319. //-----------------------------------------------------------------------------
  320. IMPLEMENT_ELEMENT_FACTORY( DmeAnimCmdNoAnimation, CDmeAnimCmdNoAnimation );
  321. //-----------------------------------------------------------------------------
  322. //
  323. //-----------------------------------------------------------------------------
  324. void CDmeAnimCmdNoAnimation::OnConstruction()
  325. {
  326. m_bNullAttr.Init( this, "nullAttr" );
  327. }
  328. //-----------------------------------------------------------------------------
  329. //
  330. //-----------------------------------------------------------------------------
  331. void CDmeAnimCmdNoAnimation::OnDestruction()
  332. {
  333. }