-
Notifications
You must be signed in to change notification settings - Fork 8
/
Camera.h
80 lines (58 loc) · 1.71 KB
/
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
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
// +------------------------------------------------------------+
// | University Racer |
// | Projekt do PGR a GMU, FIT VUT v Brne, 2011 |
// +------------------------------------------------------------+
// | Autori: Tomáš Kimer, xkimer00@stud.fit.vutbr.cz |
// | Tomáš Sychra, xsychr03@stud.fit.vutbr.cz |
// | David Šabata, xsabat01@stud.fit.vutbr.cz |
// +------------------------------------------------------------+
#ifndef CAMERA_H
#define CAMERA_H
#include <stdint.h>
#ifndef GLM_INCLUDED
#define GLM_INCLUDED
#include <glm/glm.hpp>
# ifndef USE_ONE
# include <glm/gtc/matrix_projection.hpp>
# endif
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#endif
#include <glm/gtx/transform2.hpp>
#include "Debug.h"
#include "Utils.h"
class Camera {
public:
Camera(void);
void Reset();
void Move(float x, float y, float z);
void Aim(float vertical_angle, float horizontal_angle);
glm::mat4 GetMatrix();
void DebugDump();
void Follow(glm::mat4 & targetMat, glm::vec3 targetVelocity, const GameTime & gameTime);
void ResetFollow() { currentSettleTime = 0.0f; }
//void toggleObserve();
inline glm::vec3 getEye()
{
return eye;
}
inline glm::vec3 getTarget()
{
return target;
}
private:
glm::vec3 eye; // pozice kamery
glm::vec3 target; // smer pohledu
glm::vec3 up; // up vektor kamery
float angle_horiz;
float angle_vert;
float currentSettleTime; // pomocna promenna pro "intro" follow kamery
/*
bool isObserving;
Vector3f observeCenter;
float observeRadius;
float observeSpeed;
CTimer observeTimer;
*/
};
#endif