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.

52 lines
1.6 KiB

  1. //========= Copyright � 1996-2009, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: stores all line occlusions ( horizontal slices ) for the tri soup for the Fog of War
  4. //
  5. // $NoKeywords: $
  6. //=====================================================================================//
  7. #ifndef FOW_TRISOUP_H
  8. #define FOW_TRISOUP_H
  9. #if defined( COMPILER_MSVC )
  10. #pragma once
  11. #endif
  12. #include "utlvector.h"
  13. #include "mathlib/vector.h"
  14. class CFoW;
  15. class CFoW_Viewer;
  16. class CFoW_LineOccluder;
  17. class CFoW_TriSoupCollection
  18. {
  19. public:
  20. // constructor to init this collection with the id
  21. CFoW_TriSoupCollection( unsigned nID );
  22. // destructor to dealloc the occluders
  23. ~CFoW_TriSoupCollection( void );
  24. // clears all entries from the collection ( useful for hammer editing only )
  25. void Clear( void );
  26. // adds a tri to the collection. this is immediately split up into the horizontal slices. very slow!
  27. void AddTri( CFoW *pFoW, Vector &vPointA, Vector &vPointB, Vector &vPointC );
  28. // adds all occluders back into the visibility tree
  29. void RepopulateOccluders( CFoW *pFoW );
  30. // void ObstructViewer( CFoW *FoW, CFoW_Viewer *Viewer );
  31. //
  32. int GetNumOccluders( ) { return m_Occluders.Count(); }
  33. //
  34. CFoW_LineOccluder *GetOccluder( int nIndex ) { return m_Occluders[ nIndex ]; }
  35. private:
  36. // attempt to split the tri horizontally given the distance / offset from z 0.0
  37. int HorizontalSplitTri( Vector *pInVerts, int nVertCount, Vector *pOutVerts, float flDist, float flOnPlaneEpsilon );
  38. CUtlVector< CFoW_LineOccluder * > m_Occluders;
  39. };
  40. #endif // FOW_TRISOUP_H