]> git.localhorst.tv Git - tacos.git/blobdiff - src/graphics/camera.hpp
controllable camera
[tacos.git] / src / graphics / camera.hpp
index a1660ca75cb2f11cb15720457ad601096fc72176..9d1953a27a6f74916efa0ca020f22822086b78a3 100644 (file)
@@ -13,17 +13,29 @@ namespace tacos {
 class Camera {
 
 public:
-       explicit Camera(const glm::vec3 &focus);
+       Camera();
 
        glm::mat4 View() const noexcept;
 
-       void Focus(const glm::vec3 &) noexcept;
+       /// set focal point to given position
+       void Warp(const glm::vec3 &position) noexcept { focus = position; }
+       /// move focal point by given delta
+       void Move(const glm::vec3 &delta) noexcept;
+
+       /// set distance of camera to focal point
+       void Distance(float dist) noexcept { distance = dist; }
+       /// adjust distance of camera to focal point
+       void BackOff(float delta) noexcept { distance += delta; }
+
+       /// set pitch and yaw
+       void Orient(const glm::vec2 &orient) noexcept { orientation = orient; }
+       /// change pitch and yaw
+       void Rotate(const glm::vec2 &delta) noexcept;
 
 private:
-       const glm::vec3 *focus;
+       glm::vec3 focus;
        float distance;
-       float pitch;
-       float yaw;
+       glm::vec2 orientation;
 
 };