-
Notifications
You must be signed in to change notification settings - Fork 0
/
Camera.h
54 lines (40 loc) · 820 Bytes
/
Camera.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
#include <glm\glm.hpp>
#pragma once
#include "EngineObject.h"
#include "Util.h"
#include "ScreenCallbacks.h"
class RenderingEngine;
class Shader;
class Screen;
NSP_UTIL
NSP_GLM
class Camera :
public EngineObject,
public KeyCallback
{
public:
Camera();
void update(ThreadManager&);
void render(Shader&, RenderingEngine::RenderState);
void setFoV(float);
void setAspect(float);
vec3 getPos() { return _pos; }
void onMouseMove(double x, double y); //move, cameras need to be static too
~Camera();
protected:
private:
void onCallback(char button, char action, char mods);
vec3 _pos;
vec3 forward;
vec3 up;
const string EyePos;
mat4 View;
float FoV;
float Aspect;
mat4 projection;
const string ViewProjMat;
bool _update;
double XAngle, YAngle;
static float speed;
static vec3 YAxis;
};