-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));
+void Camera::Move(const glm::vec3 &delta) noexcept {
+ focus += rotateY(delta, orientation.y);
+}
+
+void Camera::Rotate(const glm::vec2 &delta) noexcept {
+ orientation += delta;
+ orientation.x = glm::clamp(orientation.x, 0.0f, 1.55f);
+ while (orientation.y > 3.14159265358979323844f) { // π
+ orientation.y -= 6.28318530717958647688f; // 2π
+ }
+ while (orientation.y < -3.14159265358979323844f) {
+ orientation.y += 6.28318530717958647688f;
+ }