--- /dev/null
+#include "camera.hpp"
+
+#include <glm/gtx/rotate_vector.hpp>
+
+
+namespace tacos {
+
+Camera::Camera(const glm::vec3 &f)
+: focus(&f)
+, distance(100.0f)
+, pitch(1.04719755119659774614f) // π/3
+, yaw(0.0f) {
+
+}
+
+void Camera::Focus(const glm::vec3 &f) noexcept {
+ focus = &f;
+}
+
+glm::mat4 Camera::View() const noexcept {
+ const glm::vec3 position(*focus - distance * rotateY(rotateX(glm::vec3(0.0f, 0.0f, 1.0f), pitch), yaw));
+ return glm::lookAt(position, *focus, glm::vec3(0.0f, 1.0f, 0.0f));
+}
+
+}