MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / Camera

Method Camera

src/Scene/Camera.cpp:4–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <glm/gtx/quaternion.hpp>
3
4Camera::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
17void Camera::resetView() {
18 position = initialPosition;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected