-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnaivetree.h
69 lines (52 loc) · 1.35 KB
/
naivetree.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
#ifndef NAIVETREE_H
#define NAIVETREE_H
#include "snow.h"
#include <QObject>
#include <QGLWidget>
#include <QVector>
#include <GL/glu.h>
class Terrain;
class Snow;
struct NaiveTreeInfo {
float posX, posZ;
float base_radius, height, leaf_base_radius;
float rootR, rootG, rootB;
float leafR, leafG, leafB;
};
class NaiveTree : public QObject
{
Q_OBJECT
public:
explicit NaiveTree(QObject *parent = 0);
NaiveTree(Terrain *tr, Snow *snow, float posX = 0, float posZ = 0, QObject *parent = 0);
~NaiveTree();
void render(GLenum style);
float getX() const;
float getZ() const;
NaiveTreeInfo getInfo() const;
void setInfo(NaiveTreeInfo info);
void setBaseRadius(float radius);
void setHeight(float height);
void setLeafRadius(float radius);
void setRootR(int value);
void setRootG(int value);
void setRootB(int value);
void setLeafR(int value);
void setLeafG(int value);
void setLeafB(int value);
bool hit(Particle p, QVector<Particle> &generate);
signals:
public slots:
private:
void draw_level(int i);
GLUquadricObj *qobj;
Terrain *terrain;
Snow *snow;
float posX, posZ;
float base_radius, height, leaf_base_radius;
float rootR, rootG, rootB;
float leafR, leafG, leafB;
int frame_count;
QVector<Particle> particles[3];
};
#endif // NAIVETREE_H