initial commit

This commit is contained in:
ZY4N
2024-12-10 13:50:21 +01:00
parent 20bbd06a89
commit 275d47b7c6
33 changed files with 1066 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#pragma once
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include <numbers>
struct camera_view
{
glm::vec3 position;
glm::vec3 front;
glm::vec3 right;
glm::vec3 up;
float aspect_ratio;
float fov;
[[nodiscard]] glm::mat4 create_view_matrix() const {
return glm::lookAt(position, position + front, up);
}
[[nodiscard]] glm::mat4 create_projection_matrix() const {
return glm::perspective(
fov,
aspect_ratio,
0.1f, 1000.0f
);
}
};