-
Notifications
You must be signed in to change notification settings - Fork 1
/
engine.h
63 lines (47 loc) · 1.28 KB
/
engine.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
#ifndef ENGINE_H
#define ENGINE_H
#include <assert.h>
#include <random>
#include "window.h"
#include "graphics.h"
#include "orbit.h"
class Engine
{
public:
Engine(const char* name, int width, int height);
~Engine();
bool Initialize();
void Run();
void ProcessInput();
double getDT();
long long GetCurrentTimeMillis();
void Display(GLFWwindow*, double);
static void cursor_position_callback(GLFWwindow* window, double xpos, double ypos);
static void scroll_callback(GLFWwindow* window, double xOffset, double yOffset);
private:
void updateDelta();
// Window related variables
Window *m_window;
const char* m_WINDOW_NAME;
int m_WINDOW_WIDTH;
int m_WINDOW_HEIGHT;
bool m_FULLSCREEN, m_swap, m_moveLeft, m_moveRight;
double oldX, oldY, oldTime;
double deltaTime;
int planetIndex;
bool planetaryObservation;
float throttle;
float yaw, pitch;
Graphics *m_graphics;
SceneNode* player;
std::vector<SceneNode*> planets;
std::vector<Orbit*> orbits;
SceneNode* skybox;
glm::vec3 cameraPosition;
glm::vec3 cameraTarget;
glm::vec3 cameraUp;
std::default_random_engine rand;
std::uniform_real_distribution<float> urd;
bool m_running;
};
#endif // ENGINE_H