-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstructs.h
94 lines (84 loc) · 1.57 KB
/
structs.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
#pragma once
#include "commons.h"
typedef struct {
int state;
float deltaTime;
unsigned long timeSinceStart; // milliseconds from glutInit() call
int fps;
int stageLevel;
int totalScore;
int stageScore;
int stageBulletShot;
int stageAsteroidsHit;
int totalBulletShot;
int totalAsteroidsHit;
time_t startTime;
time_t pausedStartTime;
time_t totalTime;
time_t stageTime;
int lives;
unsigned int MatProj;
unsigned int MatModel;
glm::mat4 Projection; // Projection matrix
bool showLines;
bool showColliders;
} Game;
typedef struct {
float x, y, z;
} Point3D;
typedef struct {
float r, g, b, a;
} ColorRGBA;
typedef struct {
float x, y, z;
float r, g, b, a;
} ColoredPoint;
typedef struct {
int id;
GLuint VAO;
GLuint VBO_Geom; // VBO vertices geometry
GLuint VBO_Col; // VBO vertices colors
// Vertices
std::vector<Point3D> vertices;
std::vector<ColorRGBA> colors;
int drawMode;
float sizePoints;
float widthLines;
} Figure;
typedef struct {
Figure figure;
Point3D pos;
float radius;
ColorRGBA color;
} CircleCollider;
typedef struct {
std::vector<Figure> figures;
CircleCollider collider;
Point3D pos;
float heading;
float originalRadius;
float radius;
float scale;
float forwardSpeed;
float angularSpeed;
bool openPorthole;
bool respawning;
bool invulnerable;
float invulnerabilityTime;
} Spaceship;
typedef struct {
Point3D pos;
ColorRGBA color;
Point3D speed;
float size;
} Particle;
typedef struct {
Figure figure;
CircleCollider collider;
Point3D pos;
Point3D speed;
float heading;
float radius;
int type;
float scale;
} Asteroid;