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.

112 lines
2.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // game model input - gets its values from an MDL within the game
  4. //
  5. //=============================================================================
  6. #ifndef DMEGAMEMODELINPUT_H
  7. #define DMEGAMEMODELINPUT_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/dmeinput.h"
  15. //-----------------------------------------------------------------------------
  16. //
  17. //-----------------------------------------------------------------------------
  18. class CDmeGameModelInput : public CDmeInput
  19. {
  20. DEFINE_ELEMENT( CDmeGameModelInput, CDmeInput );
  21. public:
  22. virtual bool IsDirty(); // ie needs to operate
  23. virtual void Operate();
  24. virtual void GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs );
  25. public:
  26. void AddBone( const Vector& pos, const Quaternion& rot );
  27. void SetBone( uint index, const Vector& pos, const Quaternion& rot );
  28. void SetRootBone( const Vector& pos, const Quaternion& rot );
  29. uint NumBones() const;
  30. void SetFlexWeights( uint nFlexWeights, const float* flexWeights );
  31. uint NumFlexWeights() const;
  32. const Vector& GetViewTarget() const;
  33. void SetViewTarget( const Vector &viewTarget );
  34. void SetFlags( int nFlags );
  35. public:
  36. CDmaVar< int > m_skin;
  37. CDmaVar< int > m_body;
  38. CDmaVar< int > m_sequence;
  39. CDmaVar< bool > m_visible;
  40. protected:
  41. CDmaVar< int > m_flags;
  42. CDmaArray< float > m_flexWeights;
  43. CDmaVar< Vector > m_viewTarget;
  44. CDmaArray< Vector > m_bonePositions;
  45. CDmaArray< Quaternion > m_boneRotations;
  46. CDmaVar< Vector > m_position;
  47. CDmaVar< Quaternion > m_rotation;
  48. };
  49. class CDmeGameSpriteInput : public CDmeInput
  50. {
  51. DEFINE_ELEMENT( CDmeGameSpriteInput, CDmeInput );
  52. public:
  53. virtual bool IsDirty(); // ie needs to operate
  54. virtual void Operate();
  55. virtual void GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs );
  56. public:
  57. void SetState( bool bVisible, float nFrame, int nRenderMode, int nRenderFX, float flRenderScale, float flProxyRadius, const Vector &pos, const Quaternion &rot, const Color &color );
  58. protected:
  59. CDmaVar< bool > m_visible;
  60. CDmaVar< float > m_frame;
  61. CDmaVar< int > m_rendermode;
  62. CDmaVar< int > m_renderfx;
  63. CDmaVar< float > m_renderscale;
  64. CDmaVar< float > m_proxyRadius;
  65. CDmaVar< Vector > m_position;
  66. CDmaVar< Quaternion > m_rotation;
  67. CDmaVar< Color > m_color;
  68. };
  69. class CDmeGameCameraInput : public CDmeInput
  70. {
  71. DEFINE_ELEMENT( CDmeGameCameraInput, CDmeInput );
  72. public:
  73. virtual bool IsDirty(); // ie needs to operate
  74. virtual void Operate();
  75. virtual void GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs );
  76. public:
  77. void SetPosition( const Vector& pos );
  78. void SetOrientation( const Quaternion& rot );
  79. void SetFOV( float fov );
  80. protected:
  81. CDmaVar< Vector > m_position;
  82. CDmaVar< Quaternion > m_rotation;
  83. CDmaVar< float > m_fov;
  84. };
  85. #endif // DMEGAMEMODELINPUT_H