-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticleSystem.h
More file actions
63 lines (51 loc) · 1.05 KB
/
ParticleSystem.h
File metadata and controls
63 lines (51 loc) · 1.05 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
57
58
59
60
61
62
63
#ifndef _PARTICLE_SYSTEM_H
#define _PARTICLE_SYSTEM_H
#include "stdafx.h"
using namespace std;
class ParticleSystem
{
public:
ParticleSystem();
virtual ~ParticleSystem();
struct particle
{
vuVec3d p; //位置
vuVec3d v; //速度
vuVec3d a; //加速度
vuVec3d dimension; //尺寸
vuVec3d scale; //缩放
vuVec3d rotate; //旋转
int life; //剩余生命
int fade; //生命消逝速度
};
struct environment
{
int areaTop; //定义粒子生成区域
int areaButtom;
int areaLeft;
int areaRight;
int areaFront;
int areaBack;
vuVec3d areaCenter;
int areaRange;
vuVec3d rotate; //视点的俯仰滚角
int quantity; //粒子数量
int total; //例子数量上限
GLuint tex; //纹理编号
};
particle particleData;
environment environmentData;
void initData();
int loadTextures();
AUX_RGBImageRec* loadBMP(const char *);
void setParticle(vector<particle>::iterator &);
void draw();
void create(vector<particle>::iterator &);
protected:
private:
vector<particle> particles;
GLuint texture[2];
GLuint list;
bool isInit;
};
#endif