-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathParticleEmitter.h
More file actions
56 lines (43 loc) · 981 Bytes
/
ParticleEmitter.h
File metadata and controls
56 lines (43 loc) · 981 Bytes
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
#ifndef PARTICLE_EMITTER_H
#define PARTICLE_EMITTER_H
enum EmitterType {
FIRE,
SMOKE,
PLASMA,
EXPLOSION,
NUM_EMITTER_TYPES
};
#include "Framework.h"
#include "Shader.h"
#include "btBulletDynamicsCommon.h"
#include "Particle.h"
#include "Ship.h"
#include <string>
#include <vector>
using namespace std;
struct explosion{
GLfloat time, duration;
};
class ParticleEmitter{
public:
ParticleEmitter(btVector3* pos, Shader* particleShader, sf::Image* tex,
int width, bool fast, EmitterType ty);
void updateEmitter(float tstep, bool fast);
void spawnParticles();
void renderParticles(bool fast);
float age;
EmitterType type;
private:
void startExplosion();
void updateExplosion(float tstep);
void randomizeVelocities(float& x, float& y, float& z);
int chooseZOffset();
vector<Particle> particles;
btVector3* position;
sf::Image* particleImage;
Shader* particleShader;
int screenWidth;
bool onlyWhenFast;
explosion curExplosion;
};
#endif