| 2 | #include <glm/gtx/quaternion.hpp> |
| 3 | |
| 4 | Camera::Camera(glm::vec3 initial_position, float FoV, float horizontal_angle, float vertical_angle, GLFWwindow *gl_window) { |
| 5 | window = gl_window; |
| 6 | // Initial position : on +Z |
| 7 | position = initial_position; |
| 8 | initialPosition = initial_position; |
| 9 | // Initial Field of View |
| 10 | initialFoV = FoV; |
| 11 | horizontalAngle = horizontal_angle; |
| 12 | verticalAngle = vertical_angle; |
| 13 | // Projection matrix : 45deg Field of View, 4:3 ratio, display range : 0.1 unit <-> 100 units |
| 14 | ProjectionMatrix = glm::perspective(glm::radians(FoV), 4.0f / 3.0f, 0.1f, 1000.0f); |
| 15 | } |
| 16 | |
| 17 | void Camera::resetView() { |
| 18 | position = initialPosition; |
nothing calls this directly
no outgoing calls
no test coverage detected