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.

57 lines
1.5 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =====//
  2. //
  3. // Dme version of an axis aligned bounding box
  4. //
  5. //===========================================================================//
  6. #ifndef DMEBBOX_H
  7. #define DMEBBOX_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. // Valve includes
  12. #include "movieobjects/dmeshape.h"
  13. //-----------------------------------------------------------------------------
  14. // Forward Declarations
  15. //-----------------------------------------------------------------------------
  16. class CDmeDrawSettings;
  17. struct matrix3x4_t;
  18. //-----------------------------------------------------------------------------
  19. // A class representing an axis aligned bounding box
  20. //-----------------------------------------------------------------------------
  21. class CDmeBBox : public CDmeShape
  22. {
  23. DEFINE_ELEMENT( CDmeBBox, CDmeShape );
  24. public:
  25. void Clear();
  26. bool Empty() const;
  27. void TransformUsing ( const matrix3x4_t &mMatrix );
  28. void Expand( const Vector &vPoint );
  29. void Expand( const CDmeBBox &bbox );
  30. bool Contains( const Vector &vPoint ) const;
  31. bool Intersects( const CDmeBBox &bbox ) const;
  32. float Width() const; // X
  33. float Height() const; // Y
  34. float Depth() const; // Z
  35. Vector Center() const;
  36. const Vector &Min() const;
  37. const Vector &Max() const;
  38. CDmaVar< Vector > m_vMinBounds;
  39. CDmaVar< Vector > m_vMaxBounds;
  40. // From CDmeShape
  41. virtual void Draw( const matrix3x4_t &shapeToWorld, CDmeDrawSettings *pDrawSettings = NULL );
  42. };
  43. #endif // DMEBBOX_H