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.

164 lines
5.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // The morph operator class - sets morph target weights on meshes
  4. //
  5. //=============================================================================
  6. #ifndef DMEUNPACKOPERATORS_H
  7. #define DMEUNPACKOPERATORS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "movieobjects/dmeoperator.h"
  12. //-----------------------------------------------------------------------------
  13. // CDmeUnpackColorOperator - extracts floats from a color
  14. //-----------------------------------------------------------------------------
  15. class CDmeUnpackColorOperator : public CDmeOperator
  16. {
  17. DEFINE_ELEMENT( CDmeUnpackColorOperator, CDmeOperator );
  18. public:
  19. virtual bool IsDirty(); // ie needs to operate
  20. virtual void Operate();
  21. virtual void GetInputAttributes ( CUtlVector< CDmAttribute * > &attrs );
  22. virtual void GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs );
  23. protected:
  24. CDmaVar< Color > m_color;
  25. CDmaVar< float> m_red;
  26. CDmaVar< float> m_green;
  27. CDmaVar< float> m_blue;
  28. CDmaVar< float> m_alpha;
  29. };
  30. //-----------------------------------------------------------------------------
  31. // CDmeUnpackVector2Operator - extracts floats from a vector2
  32. //-----------------------------------------------------------------------------
  33. class CDmeUnpackVector2Operator : public CDmeOperator
  34. {
  35. DEFINE_ELEMENT( CDmeUnpackVector2Operator, CDmeOperator );
  36. public:
  37. virtual bool IsDirty(); // ie needs to operate
  38. virtual void Operate();
  39. virtual void GetInputAttributes ( CUtlVector< CDmAttribute * > &attrs );
  40. virtual void GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs );
  41. protected:
  42. CDmaVar< Vector2D > m_vector;
  43. CDmaVar< float> m_x;
  44. CDmaVar< float> m_y;
  45. };
  46. //-----------------------------------------------------------------------------
  47. // CDmeUnpackVector3Operator - extracts floats from a vector
  48. //-----------------------------------------------------------------------------
  49. class CDmeUnpackVector3Operator : public CDmeOperator
  50. {
  51. DEFINE_ELEMENT( CDmeUnpackVector3Operator, CDmeOperator );
  52. public:
  53. virtual bool IsDirty(); // ie needs to operate
  54. virtual void Operate();
  55. virtual void GetInputAttributes ( CUtlVector< CDmAttribute * > &attrs );
  56. virtual void GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs );
  57. protected:
  58. CDmaVar< Vector > m_vector;
  59. CDmaVar< float> m_x;
  60. CDmaVar< float> m_y;
  61. CDmaVar< float> m_z;
  62. };
  63. //-----------------------------------------------------------------------------
  64. // CDmeUnpackVector4Operator - extracts floats from a vector4
  65. //-----------------------------------------------------------------------------
  66. class CDmeUnpackVector4Operator : public CDmeOperator
  67. {
  68. DEFINE_ELEMENT( CDmeUnpackVector4Operator, CDmeOperator );
  69. public:
  70. virtual bool IsDirty(); // ie needs to operate
  71. virtual void Operate();
  72. virtual void GetInputAttributes ( CUtlVector< CDmAttribute * > &attrs );
  73. virtual void GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs );
  74. protected:
  75. CDmaVar< Vector4D > m_vector;
  76. CDmaVar< float> m_x;
  77. CDmaVar< float> m_y;
  78. CDmaVar< float> m_z;
  79. CDmaVar< float> m_w;
  80. };
  81. //-----------------------------------------------------------------------------
  82. // CDmeUnpackQAngleOperator - extracts floats from a qangle
  83. //-----------------------------------------------------------------------------
  84. class CDmeUnpackQAngleOperator : public CDmeOperator
  85. {
  86. DEFINE_ELEMENT( CDmeUnpackQAngleOperator, CDmeOperator );
  87. public:
  88. virtual bool IsDirty(); // ie needs to operate
  89. virtual void Operate();
  90. virtual void GetInputAttributes ( CUtlVector< CDmAttribute * > &attrs );
  91. virtual void GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs );
  92. protected:
  93. CDmaVar< QAngle > m_qangle;
  94. CDmaVar< float> m_x;
  95. CDmaVar< float> m_y;
  96. CDmaVar< float> m_z;
  97. };
  98. //-----------------------------------------------------------------------------
  99. // CDmeUnpackQuaternionOperator - extracts floats from a quaternion
  100. //-----------------------------------------------------------------------------
  101. class CDmeUnpackQuaternionOperator : public CDmeOperator
  102. {
  103. DEFINE_ELEMENT( CDmeUnpackQuaternionOperator, CDmeOperator );
  104. public:
  105. virtual bool IsDirty(); // ie needs to operate
  106. virtual void Operate();
  107. virtual void GetInputAttributes ( CUtlVector< CDmAttribute * > &attrs );
  108. virtual void GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs );
  109. protected:
  110. CDmaVar< Quaternion > m_quaternion;
  111. CDmaVar< float> m_x;
  112. CDmaVar< float> m_y;
  113. CDmaVar< float> m_z;
  114. CDmaVar< float> m_w;
  115. };
  116. //-----------------------------------------------------------------------------
  117. // CDmeUnpackVMatrixOperator - extracts floats from a VMatrix
  118. //-----------------------------------------------------------------------------
  119. class CDmeUnpackVMatrixOperator : public CDmeOperator
  120. {
  121. DEFINE_ELEMENT( CDmeUnpackVMatrixOperator, CDmeOperator );
  122. public:
  123. virtual bool IsDirty(); // ie needs to operate
  124. virtual void Operate();
  125. virtual void GetInputAttributes ( CUtlVector< CDmAttribute * > &attrs );
  126. virtual void GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs );
  127. protected:
  128. CDmaVar< VMatrix > m_vmatrix;
  129. CDmaVar< float > m_cells[ 16 ];
  130. };
  131. #endif // DMEUNPACKOPERATORS_H