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. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #include "cbase.h"
  14. #include "c_te_basebeam.h"
  15. #include "iviewrender_beams.h"
  16. // memdbgon must be the last include file in a .cpp file!!!
  17. #include "tier0/memdbgon.h"
  18. //-----------------------------------------------------------------------------
  19. // Purpose: BeamRingPoint TE
  20. //-----------------------------------------------------------------------------
  21. class C_TEBeamRingPoint : public C_TEBaseBeam
  22. {
  23. public:
  24. DECLARE_CLASS( C_TEBeamRingPoint, C_TEBaseBeam );
  25. DECLARE_CLIENTCLASS();
  26. C_TEBeamRingPoint( void );
  27. virtual ~C_TEBeamRingPoint( void );
  28. virtual void PostDataUpdate( DataUpdateType_t updateType );
  29. public:
  30. Vector m_vecCenter;
  31. float m_flStartRadius;
  32. float m_flEndRadius;
  33. };
  34. //-----------------------------------------------------------------------------
  35. // Purpose:
  36. //-----------------------------------------------------------------------------
  37. C_TEBeamRingPoint::C_TEBeamRingPoint( void )
  38. {
  39. m_vecCenter.Init();
  40. m_flStartRadius = 0.0f;
  41. m_flEndRadius = 0.0f;
  42. }
  43. //-----------------------------------------------------------------------------
  44. // Purpose:
  45. //-----------------------------------------------------------------------------
  46. C_TEBeamRingPoint::~C_TEBeamRingPoint( void )
  47. {
  48. }
  49. void TE_BeamRingPoint( IRecipientFilter& filter, float delay,
  50. const Vector& center, float start_radius, float end_radius, int modelindex, int haloindex, int startframe, int framerate,
  51. float life, float width, int spread, float amplitude, int r, int g, int b, int a, int speed, int flags )
  52. {
  53. beams->CreateBeamRingPoint( center, start_radius, end_radius, modelindex, haloindex, 0.0f,
  54. life, width, 0.1 * spread, 0.0f, amplitude, a, 0.1 * speed,
  55. startframe, 0.1 * framerate, r, g, b, flags );
  56. }
  57. //-----------------------------------------------------------------------------
  58. // Purpose:
  59. // Input : bool -
  60. //-----------------------------------------------------------------------------
  61. void C_TEBeamRingPoint::PostDataUpdate( DataUpdateType_t updateType )
  62. {
  63. beams->CreateBeamRingPoint( m_vecCenter, m_flStartRadius, m_flEndRadius, m_nModelIndex, m_nHaloIndex, 0.0f,
  64. m_fLife, m_fWidth, m_fEndWidth, m_nFadeLength, m_fAmplitude, a, 0.1 * m_nSpeed,
  65. m_nStartFrame, 0.1 * m_nFrameRate, r, g, b, m_nFlags );
  66. }
  67. IMPLEMENT_CLIENTCLASS_EVENT_DT(C_TEBeamRingPoint, DT_TEBeamRingPoint, CTEBeamRingPoint)
  68. RecvPropVector( RECVINFO(m_vecCenter)),
  69. RecvPropFloat( RECVINFO(m_flStartRadius)),
  70. RecvPropFloat( RECVINFO(m_flEndRadius)),
  71. END_RECV_TABLE()