blob: e52788b3a6da5eae58c31604cfb491d06cccadd0 (
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
// FIXME: Should we just pass the Particle draw members directly as
// arguments to IParticleEffect::SimulateAndRender?
// This file defines and implements the ParticleDraw class, which is used
// by ParticleEffects to render particles. It simply stores render + simulation
// state
//
#ifndef PARTICLEDRAW_H
#define PARTICLEDRAW_H
class IMaterial;
class CMeshBuilder;
class CParticleSubTexture;
class ParticleDraw
{
friend class CParticleEffectBinding;
public:
ParticleDraw();
void Init( CMeshBuilder *pMeshBuilder, IMaterial *pMaterial, float fTimeDelta );
// Time delta..
float GetTimeDelta() const;
// Get the material being used (mostly useful for getting the tcoord padding).
//IMaterial* GetPMaterial();
// This can return NULL if the particle system is only being simulated.
CMeshBuilder* GetMeshBuilder();
CParticleSubTexture *m_pSubTexture;
private:
CMeshBuilder *m_pMeshBuilder;
IMaterial *m_pMaterial;
float m_fTimeDelta;
};
// ------------------------------------------------------------------------- //
// Inlines
// ------------------------------------------------------------------------- //
inline ParticleDraw::ParticleDraw()
{
m_pMaterial = 0;
}
inline void ParticleDraw::Init( CMeshBuilder *pMeshBuilder, IMaterial *pMaterial, float fTimeDelta )
{
m_pMeshBuilder = pMeshBuilder;
m_pMaterial = pMaterial;
m_fTimeDelta = fTimeDelta;
}
inline float ParticleDraw::GetTimeDelta() const
{
return m_fTimeDelta;
}
inline CMeshBuilder* ParticleDraw::GetMeshBuilder()
{
return m_pMeshBuilder;
}
#endif
|