-
Notifications
You must be signed in to change notification settings - Fork 0
/
Controller.h
42 lines (33 loc) · 1.01 KB
/
Controller.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
#ifndef __CONTROLLER_H__
#define __CONTROLLER_H__
#include "View.h"
#include "Model.h"
#include "Callbacks.h"
#include "CameraBehaviors.hpp"
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
class Controller: public Callbacks
{
public:
Controller(istream& scenegraphFile, Model& m,View& v);
~Controller();
void run();
virtual void reshape(int width, int height);
virtual void dispose();
virtual void onkey(int key, int scancode, int action, int mods);
virtual void mousePosition(double xpos, double ypos);
virtual void error_callback(int error, const char* description);
virtual void mouseButton(int button, int action, int mods);
private:
void initScenegraph(istream& scenegraphFile);
View& view;
Model& model;
StationaryCamera* globalCamera, *globalCamera2;
HelicopterCamera* helicopterCamera;
FirstPersonCamera* firstPersonCamera;
vector<Camera*> cameras;
int activeCameraIndex = 0;
glm::vec2 currentMousePos;
bool isMousePressed;
};
#endif