]> git.localhorst.tv Git - blank.git/blob - src/camera.hpp
rename model -> controller
[blank.git] / src / camera.hpp
1 #ifndef BLANK_CAMERA_HPP_
2 #define BLANK_CAMERA_HPP_
3
4 #include <glm/glm.hpp>
5
6 #include "controller.hpp"
7
8
9 namespace blank {
10
11 class Camera
12 : public FPSController {
13
14 public:
15         Camera();
16         ~Camera();
17
18         Camera(const Camera &) = delete;
19         Camera &operator =(const Camera &) = delete;
20
21         glm::mat4 MakeMVP(const glm::mat4 &m) const { return vp * m; }
22
23         void Viewport(int width, int height);
24         void Viewport(int x, int y, int width, int height);
25
26         void FOV(float f);
27         void Aspect(float r);
28         void Aspect(float w, float h);
29         void Clip(float near, float far);
30
31         void Update(int dt);
32
33 private:
34         void UpdateProjection();
35
36 private:
37         float fov;
38         float aspect;
39         float near_clip;
40         float far_clip;
41
42         glm::mat4 projection;
43         glm::mat4 vp;
44
45 };
46
47 }
48
49 #endif