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.

103 lines
4.9 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef ISTATICPROPMGR_H
  8. #define ISTATICPROPMGR_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "interface.h"
  13. #include "mathlib/vector.h"
  14. #include "utlvector.h"
  15. #include "basehandle.h"
  16. //-----------------------------------------------------------------------------
  17. // Forward declarations
  18. //-----------------------------------------------------------------------------
  19. struct vcollide_t;
  20. struct Ray_t;
  21. class IClientRenderable;
  22. class CGameTrace;
  23. typedef CGameTrace trace_t;
  24. class IVPhysicsKeyHandler;
  25. class IPhysicsEnvironment;
  26. class ICollideable;
  27. struct RenderableInstance_t;
  28. //-----------------------------------------------------------------------------
  29. // Interface versions for static props
  30. //-----------------------------------------------------------------------------
  31. #define INTERFACEVERSION_STATICPROPMGR_CLIENT "StaticPropMgrClient005"
  32. #define INTERFACEVERSION_STATICPROPMGR_SERVER "StaticPropMgrServer002"
  33. //-----------------------------------------------------------------------------
  34. // Interface for static props
  35. //-----------------------------------------------------------------------------
  36. abstract_class IStaticPropMgr
  37. {
  38. public:
  39. // Create physics representations of props
  40. virtual void CreateVPhysicsRepresentations( IPhysicsEnvironment *physenv, IVPhysicsKeyHandler *pDefaults, void *pGameData ) = 0;
  41. // Purpose: Trace a ray against the specified static Prop. Returns point of intersection in trace_t
  42. virtual void TraceRayAgainstStaticProp( const Ray_t& ray, int staticPropIndex, trace_t& tr ) = 0;
  43. // Is a base handle a static prop?
  44. virtual bool IsStaticProp( IHandleEntity *pHandleEntity ) const = 0;
  45. virtual bool IsStaticProp( CBaseHandle handle ) const = 0;
  46. // returns a collideable interface to static props
  47. virtual ICollideable *GetStaticPropByIndex( int propIndex ) = 0;
  48. };
  49. abstract_class IStaticPropMgrClient : public IStaticPropMgr
  50. {
  51. public:
  52. // Adds decals to static props, returns point of decal in trace_t
  53. virtual void AddDecalToStaticProp( const Vector& rayStart, const Vector& rayEnd,
  54. int staticPropIndex, int decalIndex, bool doTrace, trace_t& tr, void *pvProxyUserData = NULL, const Vector* saxis = NULL, int nAdditionalDecalFlags = 0 ) = 0;
  55. // Adds/removes shadows from static props
  56. virtual void AddShadowToStaticProp( unsigned short shadowHandle, IClientRenderable* pRenderable ) = 0;
  57. virtual void RemoveAllShadowsFromStaticProp( IClientRenderable* pRenderable ) = 0;
  58. // Gets the lighting + material color of a static prop
  59. virtual void GetStaticPropMaterialColorAndLighting( trace_t* pTrace,
  60. int staticPropIndex, Vector& lighting, Vector& matColor ) = 0;
  61. //Changes made specifically to support the Portal mod (smack Dave Kircher if something breaks) (Added separately to both client and server to not mess with versioning)
  62. //===================================================================
  63. virtual void GetAllStaticProps( CUtlVector<ICollideable *> *pOutput ) = 0; //testing function that will eventually be removed
  64. virtual void GetAllStaticPropsInAABB( const Vector &vMins, const Vector &vMaxs, CUtlVector<ICollideable *> *pOutput ) = 0; //get all static props that exist wholly or partially in an AABB
  65. virtual void GetAllStaticPropsInOBB( const Vector &ptOrigin, const Vector &vExtent1, const Vector &vExtent2, const Vector &vExtent3, CUtlVector<ICollideable *> *pOutput ) = 0; //get all static props that exist wholly or partially in an OBB
  66. //===================================================================
  67. virtual void DrawStaticProps( IClientRenderable **pProps, const RenderableInstance_t *pInstances, int count, bool bShadowDepth, bool drawVCollideWireframe ) = 0;
  68. // Returns the lighting origins of a number of static props
  69. virtual void GetLightingOrigins( Vector *pLightingOrigins, int nOriginStride, int nCount, IClientRenderable **ppRenderable, int nRenderableStride ) = 0;
  70. };
  71. class IStaticPropMgrServer : public IStaticPropMgr
  72. {
  73. public:
  74. //Changes made specifically to support the Portal mod (smack Dave Kircher if something breaks) (Added separately to both client and server to not mess with versioning)
  75. //===================================================================
  76. virtual void GetAllStaticProps( CUtlVector<ICollideable *> *pOutput ) = 0; //testing function that will eventually be removed
  77. virtual void GetAllStaticPropsInAABB( const Vector &vMins, const Vector &vMaxs, CUtlVector<ICollideable *> *pOutput ) = 0; //get all static props that exist wholly or partially in an AABB
  78. virtual void GetAllStaticPropsInOBB( const Vector &ptOrigin, const Vector &vExtent1, const Vector &vExtent2, const Vector &vExtent3, CUtlVector<ICollideable *> *pOutput ) = 0; //get all static props that exist wholly or partially in an OBB
  79. //===================================================================
  80. };
  81. #endif // IPROPS_H