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.

98 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #include "cbase.h"
  10. #include "c_basetempentity.h"
  11. #include "tier0/vprof.h"
  12. // memdbgon must be the last include file in a .cpp file!!!
  13. #include "tier0/memdbgon.h"
  14. extern IPhysicsSurfaceProps *physprops;
  15. class C_TEImpact : public C_BaseTempEntity
  16. {
  17. public:
  18. DECLARE_CLASS( C_TEImpact, C_BaseTempEntity );
  19. DECLARE_CLIENTCLASS();
  20. C_TEImpact( void );
  21. virtual ~C_TEImpact( void );
  22. virtual void PostDataUpdate( DataUpdateType_t updateType );
  23. virtual void Precache( void );
  24. virtual void PlayImpactSound( trace_t &tr );
  25. virtual void PerformCustomEffects( trace_t &tr, Vector &shotDir );
  26. public:
  27. Vector m_vecOrigin;
  28. Vector m_vecNormal;
  29. int m_iType;
  30. byte m_ucFlags;
  31. };
  32. //-----------------------------------------------------------------------------
  33. // Purpose:
  34. // Output :
  35. //-----------------------------------------------------------------------------
  36. C_TEImpact::C_TEImpact( void )
  37. {
  38. m_vecOrigin.Init();
  39. m_vecNormal.Init();
  40. m_iType = -1;
  41. m_ucFlags = 0;
  42. }
  43. //-----------------------------------------------------------------------------
  44. // Purpose:
  45. // Output :
  46. //-----------------------------------------------------------------------------
  47. C_TEImpact::~C_TEImpact( void )
  48. {
  49. }
  50. //-----------------------------------------------------------------------------
  51. // Purpose:
  52. //-----------------------------------------------------------------------------
  53. void C_TEImpact::Precache( void )
  54. {
  55. //TODO: Precache all materials/sounds used by impacts here
  56. }
  57. //-----------------------------------------------------------------------------
  58. // Purpose:
  59. // Input : unused -
  60. //-----------------------------------------------------------------------------
  61. void C_TEImpact::PostDataUpdate( DataUpdateType_t updateType )
  62. {
  63. VPROF( "C_TEImpact::PostDataUpdate" );
  64. }
  65. //-----------------------------------------------------------------------------
  66. // Purpose:
  67. //-----------------------------------------------------------------------------
  68. void C_TEImpact::PlayImpactSound( trace_t &tr )
  69. {
  70. }
  71. //-----------------------------------------------------------------------------
  72. // Purpose: Perform custom effects based on the Decal index
  73. //-----------------------------------------------------------------------------
  74. void C_TEImpact::PerformCustomEffects( trace_t &tr, Vector &shotDir )
  75. {
  76. }
  77. //Receive data table
  78. IMPLEMENT_CLIENTCLASS_EVENT_DT( C_TEImpact, DT_TEImpact, CTEImpact)
  79. RecvPropVector( RECVINFO( m_vecOrigin ) ),
  80. RecvPropVector( RECVINFO( m_vecNormal ) ),
  81. RecvPropInt( RECVINFO( m_iType ) ),
  82. RecvPropInt( RECVINFO( m_ucFlags ) ),
  83. END_RECV_TABLE()