summaryrefslogtreecommitdiff
path: root/game/client/dod/c_grenadetrail.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/dod/c_grenadetrail.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/dod/c_grenadetrail.h')
-rw-r--r--game/client/dod/c_grenadetrail.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/game/client/dod/c_grenadetrail.h b/game/client/dod/c_grenadetrail.h
new file mode 100644
index 0000000..f0b37da
--- /dev/null
+++ b/game/client/dod/c_grenadetrail.h
@@ -0,0 +1,100 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+// This defines the client-side SmokeTrail entity. It can also be used without
+// an entity, in which case you must pass calls to it and set its position each frame.
+
+#ifndef PARTICLE_SMOKETRAIL_H
+#define PARTICLE_SMOKETRAIL_H
+
+#include "particlemgr.h"
+#include "particle_prototype.h"
+#include "particle_util.h"
+#include "particles_simple.h"
+#include "c_baseentity.h"
+#include "baseparticleentity.h"
+
+#include "fx_trail.h"
+
+//
+// Smoke Trail
+//
+
+class C_GrenadeTrail : public C_BaseParticleEntity, public IPrototypeAppEffect
+{
+public:
+ DECLARE_CLASS( C_GrenadeTrail, C_BaseParticleEntity );
+ DECLARE_CLIENTCLASS();
+
+ C_GrenadeTrail();
+ virtual ~C_GrenadeTrail();
+
+public:
+
+ //For attachments
+ void GetAimEntOrigin( IClientEntity *pAttachedTo, Vector *pAbsOrigin, QAngle *pAbsAngles );
+
+ // Enable/disable emission.
+ void SetEmit(bool bEmit);
+
+ // Change the spawn rate.
+ void SetSpawnRate(float rate);
+
+// C_BaseEntity.
+public:
+ virtual void OnDataChanged(DataUpdateType_t updateType);
+
+// IPrototypeAppEffect.
+public:
+ virtual void Start(CParticleMgr *pParticleMgr, IPrototypeArgAccess *pArgs);
+
+// IParticleEffect.
+public:
+ virtual void Update(float fTimeDelta);
+ virtual void RenderParticles( CParticleRenderIterator *pIterator );
+ virtual void SimulateParticles( CParticleSimulateIterator *pIterator );
+
+
+public:
+ // Effect parameters. These will assume default values but you can change them.
+ float m_SpawnRate; // How many particles per second.
+
+ Vector m_StartColor; // Fade between these colors.
+ Vector m_EndColor;
+ float m_Opacity;
+
+ float m_ParticleLifetime; // How long do the particles live?
+ float m_StopEmitTime; // When do I stop emitting particles? (-1 = never)
+
+ float m_MinSpeed; // Speed range.
+ float m_MaxSpeed;
+
+ float m_MinDirectedSpeed; // Directed speed range.
+ float m_MaxDirectedSpeed;
+
+ float m_StartSize; // Size ramp.
+ float m_EndSize;
+
+ float m_SpawnRadius;
+
+ Vector m_VelocityOffset; // Emit the particles in a certain direction.
+
+ bool m_bEmit; // Keep emitting particles?
+
+ int m_nAttachment;
+
+private:
+ PMaterialHandle m_MaterialHandle[2];
+ TimedEvent m_ParticleSpawn;
+
+ CParticleMgr *m_pParticleMgr;
+ CSmartPtr<CSimpleEmitter> m_pSmokeEmitter;
+
+ C_GrenadeTrail( const C_GrenadeTrail & );
+};
+
+#endif //PARTICLE_SMOKETRAIL_H \ No newline at end of file