Counter Strike : Global Offensive Source Code
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.

65 lines
1.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #if !defined( SIMPLE3D_H )
  14. #define SIMPLE3D_H
  15. #ifdef _WIN32
  16. #pragma once
  17. #endif
  18. #include "particles_simple.h"
  19. #include "particle_collision.h"
  20. // Particle3D
  21. class Particle3D : public Particle
  22. {
  23. public:
  24. Vector m_vecVelocity;
  25. QAngle m_vAngles;
  26. float m_flAngSpeed; // Is same on all axis
  27. // NOTE: This particle already takes the full 64-bytes. So fade over a hardcoded 2 seconds instead of the entire lifetime
  28. float GetFadeFraction() const { return m_flLifeRemaining >= 2.0f ? 1 : (m_flLifeRemaining * 0.5f); }
  29. bool IsDead() const { return m_flLifeRemaining >= 0 ? false : true; }
  30. float m_flLifeRemaining; // How long it lives for.
  31. public:
  32. byte m_uchFrontColor[3];
  33. byte m_uchSize;
  34. byte m_uchBackColor[3];
  35. byte m_pad; // Pad to 8 bytes.
  36. };
  37. //
  38. // CSimple3DEmitter
  39. //
  40. class CSimple3DEmitter : public CSimpleEmitter
  41. {
  42. public:
  43. explicit CSimple3DEmitter( const char *pDebugName ) : CSimpleEmitter( pDebugName ) {}
  44. static CSmartPtr<CSimple3DEmitter> Create( const char *pDebugName );
  45. virtual void RenderParticles( CParticleRenderIterator *pIterator );
  46. virtual void SimulateParticles( CParticleSimulateIterator *pIterator );
  47. CParticleCollision m_ParticleCollision;
  48. private:
  49. CSimple3DEmitter( const CSimple3DEmitter & );
  50. };
  51. #endif //SIMPLE3D_H