-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcamera_single_component.h
26 lines (21 loc) · 998 Bytes
/
camera_single_component.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
#include <entt/entity/registry.hpp>
#include <glm/ext/quaternion_float.hpp>
#include <glm/mat4x4.hpp>
namespace hg {
/** `CameraSingleComponent` points to an active camera entity. */
struct CameraSingleComponent final {
entt::entity active_camera = entt::null;
glm::vec3 translation = glm::vec3(0.f);
glm::quat rotation = glm::quat(1.f, 0.f, 0.f, 0.f);
float fov = glm::radians(60.f);
float z_near = 0.1f;
float z_far = 1000.f;
glm::mat4 view_matrix = glm::mat4(1.f);
glm::mat4 projection_matrix = glm::mat4(1.f);
glm::mat4 view_projection_matrix = glm::mat4(1.f);
glm::mat4 inverse_view_matrix = glm::mat4(1.f);
glm::mat4 inverse_projection_matrix = glm::mat4(1.f);
glm::mat4 inverse_view_projection_matrix = glm::mat4(1.f);
};
} // namespace hg