]> git.localhorst.tv Git - blank.git/blobdiff - src/camera.hpp
minor optimizations in chunk
[blank.git] / src / camera.hpp
index 5be71e24295a7142f0bc2db146d1a3f3c2065ea8..717da243eefe26b060da588bb72c2fa0fd5497c6 100644 (file)
@@ -9,30 +9,21 @@ namespace blank {
 class Camera {
 
 public:
-       Camera();
-       ~Camera();
+       Camera() noexcept;
 
-       Camera(const Camera &) = delete;
-       Camera &operator =(const Camera &) = delete;
+       void Viewport(int width, int height) noexcept;
+       void Viewport(int x, int y, int width, int height) noexcept;
 
-       glm::mat4 MakeMVP(const glm::mat4 &m) const { return vp * m; }
+       /// FOV in radians
+       void FOV(float f) noexcept;
+       void Aspect(float r) noexcept;
+       void Aspect(float w, float h) noexcept;
+       void Clip(float near, float far) noexcept;
 
-       void Viewport(int width, int height);
-       void Viewport(int x, int y, int width, int height);
-
-       void FOV(float f);
-       void Aspect(float r);
-       void Aspect(float w, float h);
-       void Clip(float near, float far);
-
-       void Position(glm::vec3 pos) { position = pos; UpdateView(); }
-       void Move(glm::vec3 delta) { position += delta; UpdateView(); }
-
-       void LookAt(glm::vec3 tgt) { target = tgt; UpdateView(); }
+       const glm::mat4 &Projection() noexcept { return projection; }
 
 private:
-       void UpdateProjection();
-       void UpdateView();
+       void UpdateProjection() noexcept;
 
 private:
        float fov;
@@ -40,13 +31,7 @@ private:
        float near_clip;
        float far_clip;
 
-       glm::vec3 position;
-       glm::vec3 target;
-       glm::vec3 up;
-
        glm::mat4 projection;
-       glm::mat4 view;
-       glm::mat4 vp;
 
 };