]> git.localhorst.tv Git - blank.git/blob - src/camera.hpp
fix dec/rad error in camera FOV
[blank.git] / src / camera.hpp
1 #ifndef BLANK_CAMERA_HPP_
2 #define BLANK_CAMERA_HPP_
3
4 #include <glm/glm.hpp>
5
6
7 namespace blank {
8
9 class Camera {
10
11 public:
12         Camera();
13
14         void Viewport(int width, int height);
15         void Viewport(int x, int y, int width, int height);
16
17         /// FOV in radians
18         void FOV(float f);
19         void Aspect(float r);
20         void Aspect(float w, float h);
21         void Clip(float near, float far);
22
23         const glm::mat4 &Projection() { return projection; }
24
25 private:
26         void UpdateProjection();
27
28 private:
29         float fov;
30         float aspect;
31         float near_clip;
32         float far_clip;
33
34         glm::mat4 projection;
35
36 };
37
38 }
39
40 #endif