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.

81 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //
  8. // This file contains a little interface to deal with static prop collisions
  9. //
  10. //=============================================================================//
  11. #ifndef STATICPROPMGR_H
  12. #define STATICPROPMGR_H
  13. #include "mathlib/vector.h"
  14. #include "engine/IStaticPropMgr.h"
  15. // FIXME: Remove! Only here for the test against old code
  16. #include "enginetrace.h"
  17. //-----------------------------------------------------------------------------
  18. // foward declarations
  19. //-----------------------------------------------------------------------------
  20. class ICollideable;
  21. FORWARD_DECLARE_HANDLE( LightCacheHandle_t );
  22. class IPooledVBAllocator;
  23. //-----------------------------------------------------------------------------
  24. // The engine's static prop manager
  25. //-----------------------------------------------------------------------------
  26. abstract_class IStaticPropMgrEngine
  27. {
  28. public:
  29. virtual bool Init() = 0;
  30. virtual void Shutdown() = 0;
  31. // Call at the beginning of the level, will unserialize all static
  32. // props and add them to the main collision tree
  33. virtual void LevelInit() = 0;
  34. // Call this when there's a client, *after* LevelInit, and after the world entity is loaded
  35. virtual void LevelInitClient() = 0;
  36. // Call this when there's a client, *before* LevelShutdown
  37. virtual void LevelShutdownClient() = 0;
  38. // Call at the end of the level, cleans up the static props
  39. virtual void LevelShutdown() = 0;
  40. // Call this to recompute static prop lighting when necessary
  41. virtual void RecomputeStaticLighting() = 0;
  42. // Check if a static prop is in a particular PVS.
  43. virtual bool IsPropInPVS( IHandleEntity *pHandleEntity, const byte *pVis ) const = 0;
  44. // returns a collideable interface to static props
  45. virtual ICollideable *GetStaticProp( IHandleEntity *pHandleEntity ) = 0;
  46. // returns the lightcache handle associated with a static prop
  47. virtual LightCacheHandle_t GetLightCacheHandleForStaticProp( IHandleEntity *pHandleEntity ) = 0;
  48. // Is a base handle a static prop?
  49. virtual bool IsStaticProp( IHandleEntity *pHandleEntity ) const = 0;
  50. virtual bool IsStaticProp( CBaseHandle handle ) const = 0;
  51. // Returns the static prop index (useful for networking)
  52. virtual int GetStaticPropIndex( IHandleEntity *pHandleEntity ) const = 0;
  53. virtual bool PropHasBakedLightingDisabled( IHandleEntity *pHandleEntity) const = 0;
  54. };
  55. //-----------------------------------------------------------------------------
  56. // Singleton access
  57. //-----------------------------------------------------------------------------
  58. IStaticPropMgrEngine* StaticPropMgr();
  59. #endif // STATICPROPMGR_H