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.

63 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "particlemgr.h"
  8. #include "particle_prototype.h"
  9. #include "particle_util.h"
  10. #include "particles_simple.h"
  11. #include "c_baseentity.h"
  12. #include "baseparticleentity.h"
  13. #include "engine/ivdebugoverlay.h"
  14. // memdbgon must be the last include file in a .cpp file!!!
  15. #include "tier0/memdbgon.h"
  16. //==================================================
  17. // SporeSmokeEffect
  18. //==================================================
  19. class SporeSmokeEffect : public CSimpleEmitter
  20. {
  21. public:
  22. SporeSmokeEffect( const char *pDebugName ) : CSimpleEmitter( pDebugName ) {}
  23. static SporeSmokeEffect* Create( const char *pDebugName );
  24. virtual void UpdateVelocity( SimpleParticle *pParticle, float timeDelta );
  25. virtual float UpdateAlpha( const SimpleParticle *pParticle );
  26. private:
  27. SporeSmokeEffect( const SporeSmokeEffect & );
  28. };
  29. SporeSmokeEffect* SporeSmokeEffect::Create( const char *pDebugName )
  30. {
  31. return new SporeSmokeEffect( pDebugName );
  32. }
  33. //-----------------------------------------------------------------------------
  34. // Purpose:
  35. // Input : *pParticle -
  36. // timeDelta -
  37. // Output : float
  38. //-----------------------------------------------------------------------------
  39. float SporeSmokeEffect::UpdateAlpha( const SimpleParticle *pParticle )
  40. {
  41. //return ( ((float)pParticle->m_uchStartAlpha/255.0f) * sin( M_PI * (pParticle->m_flLifetime / pParticle->m_flDieTime) ) );
  42. return (pParticle->m_uchStartAlpha/255.0f) + ( (float)(pParticle->m_uchEndAlpha/255.0f) - (float)(pParticle->m_uchStartAlpha/255.0f) ) * (pParticle->m_flLifetime / pParticle->m_flDieTime);
  43. }
  44. //-----------------------------------------------------------------------------
  45. // Purpose:
  46. // Input : *pParticle -
  47. // timeDelta -
  48. //-----------------------------------------------------------------------------
  49. void SporeSmokeEffect::UpdateVelocity( SimpleParticle *pParticle, float timeDelta )
  50. {
  51. }