-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminewidget.h
More file actions
103 lines (89 loc) · 2.43 KB
/
minewidget.h
File metadata and controls
103 lines (89 loc) · 2.43 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
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
103
#ifndef MINEWIDGET_H
#define MINEWIDGET_H
#include <QWidget>
#include <QGLWidget>
#include <QString>
#include <math.h>
struct materialStruct;
class MineWidget : public QGLWidget
{
Q_OBJECT
public:
explicit MineWidget(QWidget *parent = nullptr);
void keyPressEvent(QKeyEvent* event);
void moveGluLook(float x, float y, float z);
void moveGluLookAt(float x, float y, float z);
float cartAngle;
float cartBeamInc;
float cartBeamAngle;
void changeCartSpeed(int i);
public slots:
void updateCart();
void changeGluX(double d);
void changeGluY(double d);
void changeGluZ(double d);
void changeGluATX(double d);
void changeGluATY(double d);
void changeGluATZ(double d);
void setPyramidHeight(int d);
void setDoorAnimate(int in);
void switchLight1(int in);
void switchLight2(int in);
void changeCameraPos(int index);
void changeCartColour(int index);
void changeAmbience(int value);
protected:
// called when OpenGL context is set up
void initializeGL();
// called every time the widget is resized
void resizeGL(int w, int h);
// called every time the widget needs painting
void paintGL();
private:
float gluX, gluY, gluZ, gluAtX, gluAtY, gluAtZ;
float OrthoX, OrthoY, OrthoZ;
void mineRectangle(float d, float w, float l, const materialStruct& material);
void mineCart();
void minePole(float r, float h, const materialStruct& material);
void mineTrack(float r);
void paintScene();
void wall(float width, float height);
void drawCrates(const materialStruct& material, int scale);
QVector<float> loadObj(QString name, int objNumber);
void processObjLine(QVector<float> obj, int scale, bool tex);
void drawWheel(int scale);
QVector<float> crate;
QVector<float> wheel;
void floor(float width);
void DrawRocks(const materialStruct& material, float scale);
QImage crateImg;
QImage rockImg;
QImage wallImg;
QImage floorImg;
QImage markusImg;
QImage markImg;
QImage mercatorImg;
QVector<float> rock;
float mineCartX, mineCartY, mineCartZ;
float idolAngle;
float doorAngle;
float doorAngleInc;
bool light1, light2;
void setToFollow();
const double pi = 3.14159265359;
float heightOfPyramid;
void drawIdolCube(float crateScale);
void door();
bool doorAnimate;
float cameraX, cameraY, cameraZ;
float cameraAtX, cameraAtY, cameraAtZ;
float cameraPosIndex;
GLuint wallBind;
float cartAngleInc;
int CartSpeed;
int colourChangeIndex;
bool ambientEngaged;
float ambientLevel;
signals:
};
#endif // MINEWIDGET_H