X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcamera.hpp;h=805109c313af3a8f0fd692448e02c7bab7190b0c;hb=41e0223ec090142bf03066f4f5fc1f5005095072;hp=1ab086aeb66d257ac3c773f0cf1ae37dc30f6042;hpb=49c81f76b80e0de99ca57db49510eb5e3385e1d1;p=blank.git diff --git a/src/camera.hpp b/src/camera.hpp index 1ab086a..805109c 100644 --- a/src/camera.hpp +++ b/src/camera.hpp @@ -3,23 +3,21 @@ #include -#include "model.hpp" +#include "controller.hpp" +#include "geometry.hpp" namespace blank { class Camera -: public Model { +: public FPSController { 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); @@ -28,6 +26,11 @@ public: void Aspect(float w, float h); void Clip(float near, float far); + Ray Aim() const; + + const glm::mat4 &Projection() { return projection; } + const glm::mat4 &View() { return view; } + void Update(int dt); private: @@ -40,7 +43,7 @@ private: float far_clip; glm::mat4 projection; - glm::mat4 vp; + glm::mat4 view; };