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.

63 lines
1.9 KiB

  1. //========= Copyright � 1996-2009, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: radius occlusion for Fog of War
  4. //
  5. // $NoKeywords: $
  6. //=====================================================================================//
  7. #ifndef FOW_RADIUSOCCLUDER_H
  8. #define FOW_RADIUSOCCLUDER_H
  9. #if defined( COMPILER_MSVC )
  10. #pragma once
  11. #endif
  12. #include "mathlib/vector.h"
  13. class CFoW;
  14. class CFoW_Viewer;
  15. class CFoW_RadiusOccluder
  16. {
  17. public:
  18. // constructor to init this occluder with the id
  19. CFoW_RadiusOccluder( int nID );
  20. // update the radius of this occluder
  21. void UpdateSize( float flRadius );
  22. // update the location of this occluder
  23. void UpdateLocation( Vector &vLocation );
  24. // update the height group of this occluder
  25. void UpdateHeightGroup( uint8 nHeightGroup );
  26. // get the radius of this occluder
  27. inline float GetSize( void ) { return m_flRadius; }
  28. // get the location of this occluder
  29. inline Vector &GetLocation( void ) { return m_vLocation; }
  30. //
  31. inline uint8 GetHeightGroup( void ) { return m_nHeightGroup; }
  32. //
  33. inline bool IsEnabled( ) { return m_bEnabled; }
  34. //
  35. inline void SetEnable( bool bEnable ) { m_bEnabled = bEnable; }
  36. // is the occluder within range of the viewer?
  37. bool IsInRange( CFoW_Viewer *pViewer );
  38. // obstruct the viewer by updating the local viewer grid
  39. void ObstructViewerGrid( CFoW *pFoW, CFoW_Viewer *pViewer );
  40. // obstruct the viewer by updating the depth circle
  41. void ObstructViewerRadius( CFoW *pFoW, CFoW_Viewer *pViewer );
  42. //
  43. void DrawDebugInfo( Vector &vLocation, float flViewRadius, unsigned nFlags );
  44. private:
  45. int m_nID; // the id of this occluder
  46. float m_flRadius; // the radius of this occluder
  47. Vector m_vLocation; // the location of this occluder
  48. bool m_bEnabled;
  49. uint8 m_nHeightGroup; // the height group this occluder belongs to
  50. };
  51. #endif // FOW_RADIUSOCCLUDER_H