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.

82 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_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: BeamEntPoint TE
  16. //-----------------------------------------------------------------------------
  17. class C_TEBeamEntPoint : public C_TEBaseBeam
  18. {
  19. public:
  20. DECLARE_CLASS( C_TEBeamEntPoint, C_TEBaseBeam );
  21. DECLARE_CLIENTCLASS();
  22. C_TEBeamEntPoint( void );
  23. virtual ~C_TEBeamEntPoint( void );
  24. virtual void PostDataUpdate( DataUpdateType_t updateType );
  25. public:
  26. int m_nStartEntity;
  27. int m_nEndEntity;
  28. Vector m_vecStartPoint;
  29. Vector m_vecEndPoint;
  30. };
  31. //-----------------------------------------------------------------------------
  32. // Purpose:
  33. //-----------------------------------------------------------------------------
  34. C_TEBeamEntPoint::C_TEBeamEntPoint( void )
  35. {
  36. m_nStartEntity = 0;
  37. m_vecEndPoint.Init();
  38. }
  39. //-----------------------------------------------------------------------------
  40. // Purpose:
  41. //-----------------------------------------------------------------------------
  42. C_TEBeamEntPoint::~C_TEBeamEntPoint( void )
  43. {
  44. }
  45. void TE_BeamEntPoint( IRecipientFilter& filter, float delay,
  46. int nStartEntity, const Vector *pStart, int nEndEntity, const Vector* pEnd,
  47. int modelindex, int haloindex, int startframe, int framerate,
  48. float life, float width, float endWidth, int fadeLength, float amplitude,
  49. int r, int g, int b, int a, int speed )
  50. {
  51. beams->CreateBeamEntPoint( nStartEntity, pStart, nEndEntity, pEnd,
  52. modelindex, haloindex, 0.0f, life, width, endWidth, fadeLength, amplitude,
  53. a, 0.1 * (float)speed, startframe, 0.1f * (float)framerate, r, g, b );
  54. }
  55. //-----------------------------------------------------------------------------
  56. // Purpose:
  57. // Input : bool -
  58. //-----------------------------------------------------------------------------
  59. void C_TEBeamEntPoint::PostDataUpdate( DataUpdateType_t updateType )
  60. {
  61. beams->CreateBeamEntPoint( m_nStartEntity, &m_vecStartPoint, m_nEndEntity, &m_vecEndPoint,
  62. m_nModelIndex, m_nHaloIndex, 0.0f,
  63. m_fLife, m_fWidth, m_fEndWidth, m_nFadeLength, m_fAmplitude, a, 0.1 * m_nSpeed,
  64. m_nStartFrame, 0.1 * m_nFrameRate, r, g, b );
  65. }
  66. IMPLEMENT_CLIENTCLASS_EVENT_DT(C_TEBeamEntPoint, DT_TEBeamEntPoint, CTEBeamEntPoint)
  67. RecvPropInt(RECVINFO(m_nStartEntity)),
  68. RecvPropInt(RECVINFO(m_nEndEntity)),
  69. RecvPropVector(RECVINFO(m_vecStartPoint)),
  70. RecvPropVector(RECVINFO(m_vecEndPoint)),
  71. END_RECV_TABLE()