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.

64 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef C_GIB_H
  7. #define C_GIB_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #define DEFAULT_GIB_LIFETIME 4.0f
  12. // Base client gibs
  13. class C_Gib : public C_BaseAnimating
  14. {
  15. typedef C_BaseAnimating BaseClass;
  16. public:
  17. ~C_Gib( void );
  18. static C_Gib *CreateClientsideGib( const char *pszModelName, Vector vecOrigin, Vector vecForceDir, AngularImpulse vecAngularImp, float flLifetime = DEFAULT_GIB_LIFETIME );
  19. bool InitializeGib( const char *pszModelName, Vector vecOrigin, Vector vecForceDir, AngularImpulse vecAngularImp, float flLifetime = DEFAULT_GIB_LIFETIME );
  20. void ClientThink( void );
  21. void StartTouch( C_BaseEntity *pOther );
  22. virtual void HitSurface( C_BaseEntity *pOther );
  23. protected:
  24. float m_flTouchDelta; // Amount of time that must pass before another touch function can be called
  25. };
  26. #ifdef HL2_CLIENT_DLL
  27. class CAntlionGibManager : public CAutoGameSystemPerFrame
  28. {
  29. public:
  30. CAntlionGibManager( char const *name ) : CAutoGameSystemPerFrame( name )
  31. {
  32. }
  33. // Methods of IGameSystem
  34. virtual void Update( float frametime );
  35. virtual void LevelInitPreEntity( void );
  36. void AddGib( C_BaseEntity *pEntity );
  37. void RemoveGib( C_BaseEntity *pEntity );
  38. private:
  39. typedef CHandle<C_BaseEntity> CGibHandle;
  40. CUtlLinkedList< CGibHandle > m_LRU;
  41. };
  42. extern CAntlionGibManager s_AntlionGibManager;
  43. #endif
  44. #endif // C_GIB_H