Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
camera_projections.h
1#ifndef OE_SCENE_CAMERA_PROJECTIONS_H
2#define OE_SCENE_CAMERA_PROJECTIONS_H
3
4#include <concepts>
5#include <glm/mat4x4.hpp>
6
7#include "../util/angle.h"
8
9namespace oe::scene
10{
11 template <typename T>
12 concept CameraProjection = requires(T t)
13 {
14 { t.getProjectionMatrix() } -> std::same_as<glm::mat4>;
15 };
16
21 {
25 glm::mat4 getProjectionMatrix() const noexcept;
26
30 lit::Angle fov;
31
38
44 float near;
45
51 float far;
52 };
53
60 {
64 glm::mat4 getProjectionMatrix() const noexcept;
65
69 float left;
70
74 float right;
75
79 float bottom;
80
84 float top;
85
91 float near;
92
98 float far;
99 };
100
108 {
112 glm::mat4 getProjectionMatrix() const noexcept;
113
117 float left;
118
122 float right;
123
127 float bottom;
128
132 float top;
133
139 float near;
140
146 float far;
147 };
148}
149
150#endif
Definition camera_projections.h:12
Scene related management (Render-agnostic Geometry, Manger, etc...)
Definition debug.h:19
Special case of perspective projection where you need to provide frustum extents.
Definition camera_projections.h:60
glm::mat4 getProjectionMatrix() const noexcept
Return a projection matrix computed from the settings.
Non realistic projection where all objects lines are orthogonal to the projection plane giving the id...
Definition camera_projections.h:108
glm::mat4 getProjectionMatrix() const noexcept
Return a projection matrix computed from the settings.
Realistic projection where distant objects appear smaller than closer objects.
Definition camera_projections.h:21
float near
Near place distance.
Definition camera_projections.h:44
float far
Far place distance.
Definition camera_projections.h:51
glm::mat4 getProjectionMatrix() const noexcept
Return a projection matrix computed from the settings.
lit::Angle fov
Field of view.
Definition camera_projections.h:30
float aspect_ratio
Screen/Buffer ratio.
Definition camera_projections.h:37