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