]> git.localhorst.tv Git - blank.git/blobdiff - src/camera.hpp
minor optimizations in chunk
[blank.git] / src / camera.hpp
index 7cdd5e527b1ca5ecc2e0c795dd5679907dd0d209..717da243eefe26b060da588bb72c2fa0fd5497c6 100644 (file)
@@ -3,38 +3,27 @@
 
 #include <glm/glm.hpp>
 
-#include "controller.hpp"
-
 
 namespace blank {
 
-class Camera
-: public FPSController {
+class Camera {
 
 public:
-       Camera();
-       ~Camera();
-
-       Camera(const Camera &) = delete;
-       Camera &operator =(const Camera &) = delete;
-
-       glm::mat4 MakeMVP(const glm::mat4 &m) const { return vp * m; }
-
-       void Viewport(int width, int height);
-       void Viewport(int x, int y, int width, int height);
+       Camera() noexcept;
 
-       void FOV(float f);
-       void Aspect(float r);
-       void Aspect(float w, float h);
-       void Clip(float near, float far);
+       void Viewport(int width, int height) noexcept;
+       void Viewport(int x, int y, int width, int height) noexcept;
 
-       const glm::mat4 &Projection() { return projection; }
-       const glm::mat4 &View() { return view; }
+       /// 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 Update(int dt);
+       const glm::mat4 &Projection() noexcept { return projection; }
 
 private:
-       void UpdateProjection();
+       void UpdateProjection() noexcept;
 
 private:
        float fov;
@@ -43,8 +32,6 @@ private:
        float far_clip;
 
        glm::mat4 projection;
-       glm::mat4 view;
-       glm::mat4 vp;
 
 };