]> git.localhorst.tv Git - tacos.git/blobdiff - src/graphics/camera.hpp
basic floor idea
[tacos.git] / src / graphics / camera.hpp
diff --git a/src/graphics/camera.hpp b/src/graphics/camera.hpp
new file mode 100644 (file)
index 0000000..a1660ca
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef TACOS_GRAPHICS_CAMERA_HPP_
+#define TACOS_GRAPHICS_CAMERA_HPP_
+
+#include <glm/glm.hpp>
+
+
+namespace tacos {
+
+/// Camera is facing a focus point. Its position is determined by
+/// displacing said focus point by a distance in the direction indicated
+/// by pitch and yaw.
+/// The up direction is fixed to positive Y.
+class Camera {
+
+public:
+       explicit Camera(const glm::vec3 &focus);
+
+       glm::mat4 View() const noexcept;
+
+       void Focus(const glm::vec3 &) noexcept;
+
+private:
+       const glm::vec3 *focus;
+       float distance;
+       float pitch;
+       float yaw;
+
+};
+
+}
+
+#endif