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.

90 lines
2.3 KiB

  1. //====== Copyright � 1996-2009, Valve Corporation, All rights reserved. =======
  2. //
  3. // DmeSkinner
  4. //
  5. //=============================================================================
  6. #ifndef DMESKINNER_H
  7. #define DMESKINNER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. // Valve includes
  12. #include "datamodel/dmattributevar.h"
  13. #include "mdlobjects/dmemdllist.h"
  14. #include "movieobjects/dmejoint.h"
  15. #include "movieobjects/dmedag.h"
  16. #include "movieobjects/dmemesh.h"
  17. //-----------------------------------------------------------------------------
  18. // Forward declarations
  19. //-----------------------------------------------------------------------------
  20. class CDmeModel;
  21. class CDmeDag;
  22. //-----------------------------------------------------------------------------
  23. // DmeSkinnerVolume
  24. //-----------------------------------------------------------------------------
  25. class CDmeSkinnerVolume : public CDmElement
  26. {
  27. DEFINE_ELEMENT( CDmeSkinnerVolume, CDmElement );
  28. public:
  29. enum FalloffType_t
  30. {
  31. FT_LINEAR = 0,
  32. FT_SMOOTH = 1,
  33. FT_SPIKE = 2,
  34. FT_DOME = 3
  35. };
  36. bool IsEllipse() const { return m_flPowerXZ == 1.0 && m_flPowerY == 1.0; }
  37. bool IsSuper() const { return m_flPowerXZ != 1.0 || m_flPowerY != 1.0; }
  38. CDmaVar< VMatrix > m_mMatrix;
  39. CDmaVar< float > m_flStrength;
  40. CDmaVar< float > m_flFalloff;
  41. CDmaVar< int > m_nFalloffType; // 0:Linear, 1:Smooth, 2:Spike, 3:Dome
  42. CDmaVar< float > m_flPowerY;
  43. CDmaVar< float > m_flPowerXZ;
  44. };
  45. //-----------------------------------------------------------------------------
  46. // DmeSkinnerJoint
  47. //-----------------------------------------------------------------------------
  48. class CDmeSkinnerJoint : public CDmeJoint
  49. {
  50. DEFINE_ELEMENT( CDmeSkinnerJoint, CDmeJoint );
  51. public:
  52. CDmAttribute *GetListAttr() { return m_eVolumeList.GetAttribute(); }
  53. CDmaVar< VMatrix > m_mBindWorldMatrix;
  54. CDmaElementArray< CDmeSkinnerVolume > m_eVolumeList;
  55. };
  56. //-----------------------------------------------------------------------------
  57. // DmeSkinner
  58. //-----------------------------------------------------------------------------
  59. class CDmeSkinner : public CDmeDag
  60. {
  61. DEFINE_ELEMENT( CDmeSkinner, CDmeDag );
  62. public:
  63. CDmAttribute *GetListAttr() { return m_Children.GetAttribute(); }
  64. bool ReskinMeshes( CDmeModel *pDmeModel, int nJointPerVertexCount );
  65. bool ReskinMesh( CDmeModel *pDmeModel, CDmeMesh *pDmeMesh, int nJointPerVertexCount );
  66. };
  67. #endif // DMESKINNER_H