-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticleSystem.h
More file actions
executable file
·56 lines (41 loc) · 1.17 KB
/
ParticleSystem.h
File metadata and controls
executable file
·56 lines (41 loc) · 1.17 KB
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
#ifndef PARTICLE_SYSTEM_H
#define PARTICLE_SYSTEM_H
#include "d3dApp.h"
#include <string>
#include <vector>
#include "Camera.h"
#include "Effect.h"
class ParticleSystem
{
public:
ParticleSystem();
~ParticleSystem();
float GetAge()const;
void SetEyePos(const XMFLOAT3& eyePosW);
void SetEmitPos(const XMFLOAT3& emitPosW);
void SetEmitDir(const XMFLOAT3& emitDirW);
void Init(ID3D11Device* device, ParticleEffect* fx,ID3D11ShaderResourceView* texArraySRV, ID3D11ShaderResourceView* randomTexSRV, UINT maxParticles);
void Reset();
void Update(float dt, float gameTime);
void Draw(ID3D11DeviceContext* dc, const Camera& cam);
private:
void BuildVB(ID3D11Device* device);
ParticleSystem(const ParticleSystem& rhs);
ParticleSystem& operator=(const ParticleSystem& rhs);
private:
UINT mMaxParticle;
bool mFirstRun;
float mGameTime;
float mTimeStep;
float mAge;
XMFLOAT3 mEyePosW;
XMFLOAT3 mEmitPosW;
XMFLOAT3 mEmitDirW;
ParticleEffect* mFX;
ID3D11Buffer* mInitVB;
ID3D11Buffer* mDrawVB;
ID3D11Buffer* mStreamOutVB;
ID3D11ShaderResourceView* mTexArraySRV;
ID3D11ShaderResourceView* mRandomTexSRV;
};
#endif