diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/fx_explosion.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/fx_explosion.h')
| -rw-r--r-- | game/client/fx_explosion.h | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/game/client/fx_explosion.h b/game/client/fx_explosion.h new file mode 100644 index 0000000..5aa147a --- /dev/null +++ b/game/client/fx_explosion.h @@ -0,0 +1,136 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef FX_EXPLOSION_H +#define FX_EXPLOSION_H +#ifdef _WIN32 +#pragma once +#endif + +#include "particle_collision.h" +#include "glow_overlay.h" + +//JDW: For now we're clamping this value +#define EXPLOSION_FORCE_MAX 2 +#define EXPLOSION_FORCE_MIN 2 + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +class C_BaseExplosionEffect +{ +private: + static C_BaseExplosionEffect m_instance; + +public: + ~C_BaseExplosionEffect( void ) {} + + static C_BaseExplosionEffect &Instance( void ) { return m_instance; } + + virtual void Create( const Vector &position, float force, float scale, int flags ); + +protected: + C_BaseExplosionEffect( void ); + + virtual void PlaySound( void ); + + virtual void CreateCore( void ); + virtual void CreateDebris( void ); + virtual void CreateMisc( void ); + virtual void CreateDynamicLight( void ); + + float ScaleForceByDeviation( Vector &deviant, Vector &source, float spread, float *force = NULL ); + + float Probe( const Vector &origin, Vector *direction, float strength ); + void GetForceDirection( const Vector &origin, float magnitude, Vector *resultDirection, float *resultForce ); + +protected: + + Vector m_vecOrigin; + Vector m_vecDirection; + float m_flForce; + int m_fFlags; + + PMaterialHandle m_Material_Smoke; + PMaterialHandle m_Material_Embers[2]; + PMaterialHandle m_Material_FireCloud; +}; + +//Singleton accessor +extern C_BaseExplosionEffect &BaseExplosionEffect( void ); + + +// +// CExplosionOverlay +// + +class CExplosionOverlay : public CWarpOverlay +{ +public: + + virtual bool Update( void ); + +public: + + float m_flLifetime; + Vector m_vBaseColors[MAX_SUN_LAYERS]; + +}; + +//----------------------------------------------------------------------------- +// Purpose: Water explosion +//----------------------------------------------------------------------------- +class C_WaterExplosionEffect : public C_BaseExplosionEffect +{ + typedef C_BaseExplosionEffect BaseClass; +public: + static C_WaterExplosionEffect &Instance( void ) { return m_waterinstance; } + + virtual void Create( const Vector &position, float force, float scale, int flags ); + +protected: + virtual void CreateCore( void ); + virtual void CreateDebris( void ); + virtual void CreateMisc( void ); + virtual void PlaySound( void ); + +private: + Vector m_vecWaterSurface; + float m_flDepth; // Depth below the water surface (used for surface effect) + Vector m_vecColor; // Lighting tint information + float m_flLuminosity; // Luminosity information + + static C_WaterExplosionEffect m_waterinstance; +}; + +//Singleton accessor +extern C_WaterExplosionEffect &WaterExplosionEffect( void ); + +//----------------------------------------------------------------------------- +// Purpose: Water explosion +//----------------------------------------------------------------------------- +class C_MegaBombExplosionEffect : public C_BaseExplosionEffect +{ + typedef C_BaseExplosionEffect BaseClass; +public: + static C_MegaBombExplosionEffect &Instance( void ) { return m_megainstance; } + +protected: + virtual void CreateCore( void ); + + virtual void CreateDebris( void ) { }; + virtual void CreateMisc( void ) { }; + virtual void PlaySound( void ) { }; + +private: + static C_MegaBombExplosionEffect m_megainstance; +}; + +//Singleton accessor +extern C_MegaBombExplosionEffect &MegaBombExplosionEffect( void ); + +#endif // FX_EXPLOSION_H |