Team Fortress 2 Source Code as on 22/4/2020
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.

79 lines
2.0 KiB

  1. //========= Copyright 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 SetMDL( MDLHandle_t handle );
  42. MDLHandle_t GetMDL( ) const;
  43. float GetRadius() const; // NOTE: This radius is one that is centered at the origin
  44. void GetBoundingSphere( Vector &vecCenter, float &flRadius );
  45. void GetBoundingBox( Vector *pMins, Vector *pMaxs ) const;
  46. // Computes bone-to-world transforms
  47. void SetUpBones( const matrix3x4_t& shapeToWorld, int nMaxBoneCount, matrix3x4_t *pOutputMatrices );
  48. public:
  49. CDmaColor m_Color;
  50. CDmaVar<int> m_nSkin;
  51. CDmaVar<int> m_nBody;
  52. CDmaVar<int> m_nSequence;
  53. CDmaVar<int> m_nLOD;
  54. CDmaVar<float> m_flPlaybackRate;
  55. CDmaVar<float> m_flTime;
  56. CDmaVar<Vector> m_vecViewTarget;
  57. CDmaVar<bool> m_bWorldSpaceViewTarget;
  58. private:
  59. void UpdateMDL();
  60. CMDL m_MDL;
  61. bool m_bDrawInEngine;
  62. };
  63. #endif // DMEMDL_H