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.

60 lines
1.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef PHYSICSCLONEAREA_H
  8. #define PHYSICSCLONEAREA_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "baseentity.h"
  13. class CPortal_Base2D;
  14. class CPortalSimulator;
  15. class CPhysicsCloneArea : public CBaseEntity
  16. {
  17. public:
  18. DECLARE_CLASS( CPhysicsCloneArea, CBaseEntity );
  19. //static const Vector vLocalMins;
  20. //static const Vector vLocalMaxs;
  21. virtual void StartTouch( CBaseEntity *pOther );
  22. virtual void Touch( CBaseEntity *pOther );
  23. virtual void EndTouch( CBaseEntity *pOther );
  24. virtual void Spawn( void );
  25. virtual void Activate( void );
  26. virtual int ObjectCaps( void );
  27. void UpdatePosition( void );
  28. void CloneTouchingEntities( void );
  29. void CloneNearbyEntities( void );
  30. static CPhysicsCloneArea *CreatePhysicsCloneArea( CPortal_Base2D *pFollowPortal );
  31. inline Vector GetLocalMins( void ) const { return Vector( 3.0f, -m_fHalfWidth, -m_fHalfHeight ); }
  32. inline Vector GetLocalMaxs( void ) const { return Vector( m_fHalfDepth, m_fHalfWidth, m_fHalfHeight ); }
  33. void Resize( float fPortalHalfWidth, float fPortalHalfHeight );
  34. private:
  35. CPortal_Base2D *m_pAttachedPortal;
  36. CPortalSimulator *m_pAttachedSimulator;
  37. bool m_bActive;
  38. float m_fHalfWidth, m_fHalfHeight, m_fHalfDepth;
  39. static const float s_fPhysicsCloneAreaScale;
  40. };
  41. #endif //#ifndef PHYSICSCLONEAREA_H