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