1#ifndef OE_SCENE_CAMERA_H
2#define OE_SCENE_CAMERA_H
4#include <glm/mat4x4.hpp>
7#include "camera_projections.h"
38 template <CameraProjection ProjectionSettings>
39 Camera(
const ProjectionSettings& projection_settings)
49 template <CameraProjection ProjectionSettings>
52 _projection = projection_settings.getProjectionMatrix();
61 void lookAt(
const glm::vec3& target);
78 bool isInFrustum(
const glm::vec3& center,
const float& radius)
const;
102 const glm::mat4& getInverseView()
const;
103 const glm::mat4& getInverseProjection()
const;
113 const glm::mat4& getInverseTransform() const noexcept;
115 float getPitch() const noexcept
120 float getYaw() const noexcept
125 float getRoll() const noexcept
130 void setPitch(
const float pitch);
131 void setYaw(
const float yaw);
132 void setRoll(
const float roll);
140 mutable bool _is_dirty =
true;
151 mutable glm::mat4 _view{1.0f};
152 mutable glm::mat4 _projection{1.0f};
154 mutable glm::mat4 _inv_view{1.0f};
155 mutable glm::mat4 _inv_projection{1.0f};
157 mutable glm::mat4 _transform{1.0f};
158 mutable glm::mat4 _inv_transform{1.0f};
160 mutable glm::vec4 _frustum_planes[6];
161 mutable glm::vec3 _frustum_points[8];
163 void _recompute_rotation();
164 void _recompute_matrices()
const;
Axis-aligned bounding box.
Definition aabb.h:13
Camera(const ProjectionSettings &projection_settings)
Constructor.
Definition camera.h:39
void setProjectionSettings(const ProjectionSettings &projection_settings)
Update the camera's projection matrix by recomputing it based on the provided settings.
Definition camera.h:50
const glm::mat4 & getProjection() const
Get the projection matrix of the camera.
bool isInFrustum(const glm::vec3 &point) const
Check if a point is visible from the camera point of view.
const glm::mat4 & getView() const
Get the view matrix of the camera.
bool isInFrustum(const AABB &box) const
Check if a AABB is visible from the camera point of view.
const glm::mat4 & getTransform() const noexcept
Get the transformation matrix of the camera.
bool isInFrustum(const glm::vec3 ¢er, const float &radius) const
Check if a sphere is visible from the camera point of view.
void lookAt(const glm::vec3 &target)
Orient the camera to stare at a specified target.
Scene related management (Render-agnostic Geometry, Manger, etc...).
Definition debug.h:19