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

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef PVS_EXTENDER_H
  8. #define PVS_EXTENDER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. class CPVS_Extender
  13. {
  14. public:
  15. CPVS_Extender( void ); //self-registration
  16. virtual ~CPVS_Extender( void ); //self-unregistration
  17. struct VisExtensionChain_t
  18. {
  19. VisExtensionChain_t *pParentChain;
  20. int m_nArea;
  21. CPVS_Extender *pExtender;
  22. };
  23. virtual CServerNetworkProperty *GetExtenderNetworkProp( void )= 0;
  24. virtual const edict_t *GetExtenderEdict( void ) const = 0;
  25. virtual bool IsExtenderValid( void ) = 0;
  26. virtual Vector GetExtensionPVSOrigin( void ) = 0;
  27. //given an entity and initial pvs. Extend that pvs through any visible portals
  28. static void ComputeExtendedPVS( const CBaseEntity *pViewEntity, const Vector &vVisOrigin, unsigned char *outputPVS, int pvssize, int iMaxRecursions );
  29. //This extender is decidedly visible, recursively extend the visibility problem
  30. virtual void ComputeSubVisibility( CPVS_Extender **pExtenders, int iExtenderCount, unsigned char *outputPVS, int pvssize, const Vector &vVisOrigin, const VPlane *pVisFrustum, int iVisFrustumPlanes, VisExtensionChain_t *pVisChain, int iAreasNetworked[MAX_MAP_AREAS], int iMaxRecursionsLeft ) = 0;
  31. //cached data to make the algorithms a bit simpler in recursions
  32. struct ExtenderInstanceData_t
  33. {
  34. unsigned char iPVSBits[MAX_MAP_LEAFS/8];
  35. bool bAddedToPVSAlready; //no need to add our data to the PVS again, but should still recurse if we alter the frustum at all
  36. };
  37. protected:
  38. ExtenderInstanceData_t *m_pExtenderData;
  39. };
  40. #endif //#ifndef PVS_EXTENDER_H