-
Notifications
You must be signed in to change notification settings - Fork 2
/
System.h
102 lines (62 loc) · 1.67 KB
/
System.h
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/**
* Project Untitled
*/
#ifndef _SYSTEM_H
#define _SYSTEM_H
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
#include "typedef.h"
#include "Model/Particle.h"
#include "Model/Gravity.h"
#include "Model/Wind.h"
#include <QVector>
#include <QOpenGLExtraFunctions>
#include "enum.h"
#ifndef NBPARTICLEMAX
#define NBPARTICLEMAX 10
#endif
class System : protected QOpenGLExtraFunctions {
public:
System();
virtual ~System();
void drawGeometry(QOpenGLShaderProgram *program);
void change_wind(QVector3D *);
float getM_atmDensityFactor();
/**
* @param value
*/
void setM_atmDensityFactor(f32 value);
u16 getM_particleNb();
/**
* @param value
*/
void setM_particleNb(u16 value);
void setM_windFactor(f32);
void setM_gravity(f32);
void update_particles(s32 pRefresh_delay_s32);
void setParticleType(Particle_type pt);
void setM_windRotation(u16 value);
private:
f32 m_atmDensityFactor;
u16 m_particleNb;
Gravity m_gravity;
Wind m_wind;
QVector<Particle*> m_particleVector;
void check_life_time();
void compute_wind();
void initGeometry();
QOpenGLBuffer arrayBuf;
QOpenGLBuffer indexBuf;
static const int MAX_PARTICLES = 100000; //100 000
static const int ATM_DENSITY = 13;
static Particle_type m_particle_type;
//test buffers
GLuint billboard_vertex_buffer;
GLuint particles_position_buffer;
GLuint particles_color_buffer;
static GLfloat* g_particule_position_size_data;
static GLubyte* g_particule_color_data;
void clean_system();
};
#endif //_SYSTEM_H