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.

84 lines
2.2 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
  2. //
  3. // A class representing an MDL
  4. //
  5. //=============================================================================
  6. #ifndef DMEMDL_H
  7. #define DMEMDL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "datamodel/dmelement.h"
  12. #include "datamodel/dmattribute.h"
  13. #include "datamodel/dmattributevar.h"
  14. #include "movieobjects/dmeshape.h"
  15. #include "datacache/imdlcache.h"
  16. #include "tier3/mdlutils.h"
  17. #include "mathlib/vector.h"
  18. #include <string>
  19. #include <vector>
  20. //-----------------------------------------------------------------------------
  21. // Forward declarations
  22. //-----------------------------------------------------------------------------
  23. class CDmeTransform;
  24. class IMorph;
  25. class IMaterial;
  26. struct SubdivMesh_t;
  27. class IMesh;
  28. class CDmeDrawSettings;
  29. struct matrix3x4_t;
  30. class CStudioHdr;
  31. //-----------------------------------------------------------------------------
  32. // A class representing an MDL
  33. //-----------------------------------------------------------------------------
  34. class CDmeMDL : public CDmeShape
  35. {
  36. DEFINE_ELEMENT( CDmeMDL, CDmeShape );
  37. public:
  38. virtual void Draw( const matrix3x4_t& shapeToWorld, CDmeDrawSettings *pDrawSettings = NULL );
  39. void DrawInEngine( bool bDrawInEngine );
  40. bool IsDrawingInEngine() const;
  41. void ZUp( bool bZUp );
  42. bool IsZUp() const;
  43. void SetMDL( MDLHandle_t handle );
  44. MDLHandle_t GetMDL( ) const;
  45. float GetRadius() const; // NOTE: This radius is one that is centered at the origin
  46. void GetBoundingSphere( Vector &vecCenter, float &flRadius );
  47. void GetBoundingBox( Vector *pMins, Vector *pMaxs ) const;
  48. // Computes bone-to-world transforms
  49. void SetUpBones( const matrix3x4_t& shapeToWorld, int nMaxBoneCount, matrix3x4_t *pOutputMatrices );
  50. public:
  51. CDmaColor m_Color;
  52. CDmaVar<int> m_nSkin;
  53. CDmaVar<int> m_nBody;
  54. CDmaVar<int> m_nSequence;
  55. CDmaVar<int> m_nLOD;
  56. CDmaVar<float> m_flPlaybackRate;
  57. CDmaVar<float> m_flTime;
  58. CDmaVar<Vector> m_vecViewTarget;
  59. CDmaVar<bool> m_bWorldSpaceViewTarget;
  60. virtual void GetBoundingBox( Vector &min, Vector &max ) const { return GetBoundingBox( &min, &max ); }
  61. private:
  62. void UpdateMDL();
  63. CMDL m_MDL;
  64. bool m_bDrawInEngine;
  65. bool m_bZUp;
  66. };
  67. #endif // DMEMDL_H