]> git.localhorst.tv Git - blank.git/blob - src/camera.hpp
remove unused (explicit) destructors
[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 #include "geometry.hpp"
8
9
10 namespace blank {
11
12 class Camera
13 : public FPSController {
14
15 public:
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         Ray Aim() const;
32
33         const glm::mat4 &Projection() { return projection; }
34         const glm::mat4 &View() { return view; }
35
36         void Update(int dt);
37
38 private:
39         void UpdateProjection();
40
41 private:
42         float fov;
43         float aspect;
44         float near_clip;
45         float far_clip;
46
47         glm::mat4 projection;
48         glm::mat4 view;
49         glm::mat4 vp;
50
51 };
52
53 }
54
55 #endif