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.

54 lines
1.6 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
  2. //
  3. // A class representing a transform
  4. //
  5. //=============================================================================
  6. #ifndef DMETRANSFORM_H
  7. #define DMETRANSFORM_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "datamodel/dmelement.h"
  12. static const char TRANSFORM_POSITION[] = "position";
  13. static const char TRANSFORM_ORIENTATION[] = "orientation";
  14. //-----------------------------------------------------------------------------
  15. // Forward declarations
  16. //-----------------------------------------------------------------------------
  17. struct matrix3x4_t;
  18. class CDmeDag;
  19. //-----------------------------------------------------------------------------
  20. // A class representing a transformation matrix
  21. //-----------------------------------------------------------------------------
  22. class CDmeTransform : public CDmElement
  23. {
  24. DEFINE_ELEMENT( CDmeTransform, CDmElement );
  25. public:
  26. virtual void OnAttributeChanged( CDmAttribute *pAttribute );
  27. void SetTransform( const matrix3x4_t &transform );
  28. void GetTransform( matrix3x4_t &transform );
  29. const Vector &GetPosition() const;
  30. void SetPosition( const Vector &vecPosition );
  31. const Quaternion &GetOrientation() const;
  32. void SetOrientation( const Quaternion &orientation );
  33. CDmAttribute *GetPositionAttribute();
  34. CDmAttribute *GetOrientationAttribute();
  35. // If transform is contained inside some kind of CDmeDag, return that (it's "parent")
  36. CDmeDag *GetDag();
  37. private:
  38. CDmaVar<Vector> m_Position;
  39. CDmaVar<Quaternion> m_Orientation;
  40. };
  41. #endif // DMETRANSFORM_H