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.7 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
  2. //
  3. // A class representing an abstract shape (ie drawable object)
  4. //
  5. //=============================================================================
  6. #ifndef DMESHAPE_H
  7. #define DMESHAPE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "mathlib/mathlib.h"
  12. #include "datamodel/dmelement.h"
  13. #include "datamodel/dmattribute.h"
  14. #include "datamodel/dmattributevar.h"
  15. //-----------------------------------------------------------------------------
  16. // Forward declarations
  17. //-----------------------------------------------------------------------------
  18. class CDmeTransform;
  19. class CDmeDrawSettings;
  20. class CDmeDag;
  21. //-----------------------------------------------------------------------------
  22. // A class representing a camera
  23. //-----------------------------------------------------------------------------
  24. class CDmeShape : public CDmElement
  25. {
  26. DEFINE_ELEMENT( CDmeShape, CDmElement );
  27. public:
  28. virtual void Draw( const matrix3x4_t &shapeToWorld, CDmeDrawSettings *pDmeDrawSettings = NULL );
  29. virtual void GetBoundingSphere( Vector &c, float &r ) const;
  30. virtual void GetBoundingBox( Vector &min, Vector &max ) const { min.Zero(); max.Zero(); }
  31. // Find out how many DmeDag's have this DmeShape as their shape, could be 0
  32. int GetParentCount() const;
  33. // Get the nth DmeDag that has this DmeShape as its shape. The order is defined by g_pDataModel->FirstAttributeReferencingElement/NextAttr...
  34. CDmeDag *GetParent( int nParentIndex = 0 ) const;
  35. // Get the Nth World Matrix for the shape (the world matrix of the Nth DmeDag parent)
  36. void GetShapeToWorldTransform( matrix3x4_t &mat, int nParentIndex = 0 ) const;
  37. protected:
  38. CDmaVar< bool > m_visible;
  39. };
  40. #endif // DMESHAPE_H