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.

76 lines
2.5 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_te_basebeam.h"
  11. #include "iviewrender_beams.h"
  12. // memdbgon must be the last include file in a .cpp file!!!
  13. #include "tier0/memdbgon.h"
  14. //-----------------------------------------------------------------------------
  15. // Purpose: BeamPoints TE
  16. //-----------------------------------------------------------------------------
  17. class C_TEBeamPoints : public C_TEBaseBeam
  18. {
  19. public:
  20. DECLARE_CLASS( C_TEBeamPoints, C_TEBaseBeam );
  21. DECLARE_CLIENTCLASS();
  22. C_TEBeamPoints( void );
  23. virtual ~C_TEBeamPoints( void );
  24. virtual void PostDataUpdate( DataUpdateType_t updateType );
  25. public:
  26. Vector m_vecStartPoint;
  27. Vector m_vecEndPoint;
  28. };
  29. //-----------------------------------------------------------------------------
  30. // Purpose:
  31. //-----------------------------------------------------------------------------
  32. C_TEBeamPoints::C_TEBeamPoints( void )
  33. {
  34. m_vecStartPoint.Init();
  35. m_vecEndPoint.Init();
  36. }
  37. //-----------------------------------------------------------------------------
  38. // Purpose:
  39. //-----------------------------------------------------------------------------
  40. C_TEBeamPoints::~C_TEBeamPoints( void )
  41. {
  42. }
  43. void TE_BeamPoints( IRecipientFilter& filter, float delay,
  44. const Vector* start, const Vector* end, int modelindex, int haloindex, int startframe, int framerate,
  45. float life, float width, float endWidth, int fadeLength, float amplitude,
  46. int r, int g, int b, int a, int speed )
  47. {
  48. beams->CreateBeamPoints( (Vector&)*start, (Vector&)*end, modelindex, haloindex, 0.0f,
  49. life, width, endWidth, fadeLength, amplitude, a, 0.1 * speed,
  50. startframe, 0.1 * (float)framerate, r, g, b );
  51. }
  52. //-----------------------------------------------------------------------------
  53. // Purpose:
  54. // Input : bool -
  55. //-----------------------------------------------------------------------------
  56. void C_TEBeamPoints::PostDataUpdate( DataUpdateType_t updateType )
  57. {
  58. beams->CreateBeamPoints( m_vecStartPoint, m_vecEndPoint, m_nModelIndex, m_nHaloIndex, 0.0f,
  59. m_fLife, m_fWidth, m_fEndWidth, m_nFadeLength, m_fAmplitude, a, 0.1 * m_nSpeed,
  60. m_nStartFrame, 0.1 * m_nFrameRate, r, g, b );
  61. }
  62. IMPLEMENT_CLIENTCLASS_EVENT_DT(C_TEBeamPoints, DT_TEBeamPoints, CTEBeamPoints)
  63. RecvPropVector( RECVINFO(m_vecStartPoint)),
  64. RecvPropVector( RECVINFO(m_vecEndPoint)),
  65. END_RECV_TABLE()