summaryrefslogtreecommitdiff
path: root/game/client/tf/tf_fx_muzzleflash.h
blob: 2f306a87e327e2ec5c160439fc29b7c769625199 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//

#ifndef TF_FX_MUZZLEFLASH_H
#define TF_FX_MUZZLEFLASH_H

#include "particles_simple.h"
#include "particles_localspace.h"
#include "fx.h"
#include "c_te_effect_dispatch.h"
#include "c_baseanimating.h"

class CMuzzleFlashEmitter_1stPerson : public CLocalSpaceEmitter
{
public:
	DECLARE_CLASS( CMuzzleFlashEmitter_1stPerson, CLocalSpaceEmitter );

	static CSmartPtr<CMuzzleFlashEmitter_1stPerson> Create( const char *pDebugName, int entIndex, int nAttachment, int fFlags = 0 );

	virtual void Update( float t ) { BaseClass::Update(t); }

protected:
	CMuzzleFlashEmitter_1stPerson( const char *pDebugName );

private:
	CMuzzleFlashEmitter_1stPerson( const CMuzzleFlashEmitter_1stPerson & );

	int m_iMuzzleFlashType;
};

// Model versions of muzzle flashes
class C_MuzzleFlashModel : public C_BaseAnimating
{
	DECLARE_CLASS( C_MuzzleFlashModel, C_BaseAnimating );
public:
	static C_MuzzleFlashModel *CreateMuzzleFlashModel( const char *pszModelName, C_BaseEntity *pParent, int iAttachment, float flLifetime = 0.2 );
	bool	InitializeMuzzleFlash( const char *pszModelName, C_BaseEntity *pParent, int iAttachment, float flLifetime );
	void	ClientThink( void );

	void	SetLifetime( float flLifetime );

	// Recording
	virtual void GetToolRecordingState( KeyValues *msg );
	virtual bool SetupBones( matrix3x4_t *pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime );

	void	SetIs3rdPersonFlash( bool bEnable );

private:
	float	m_flExpiresAt;
	float	m_flRotateAt;
	bool	m_bIs3rdPersonFlash;
};

#endif //TF_FX_MUZZLEFLASH_H