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.

53 lines
1.6 KiB

  1. //========= Copyright 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. // Find out how many DmeDag's have this DmeShape as their shape, could be 0
  31. int GetParentCount() const;
  32. // Get the nth DmeDag that has this DmeShape as its shape. The order is defined by g_pDataModel->FirstAttributeReferencingElement/NextAttr...
  33. CDmeDag *GetParent( int nParentIndex = 0 ) const;
  34. // Get the Nth World Matrix for the shape (the world matrix of the Nth DmeDag parent)
  35. void GetShapeToWorldTransform( matrix3x4_t &mat, int nParentIndex = 0 ) const;
  36. protected:
  37. CDmaVar< bool > m_visible;
  38. };
  39. #endif // DMESHAPE_H