1#ifndef OE_SCENE_CAMERA_H
2#define OE_SCENE_CAMERA_H
6#include <glm/mat4x4.hpp>
9#include "camera_projections.h"
40 template <CameraProjection ProjectionSettings>
41 Camera(
const ProjectionSettings& projection_settings)
51 template <CameraProjection ProjectionSettings>
54 _projection = projection_settings.getProjectionMatrix();
63 void lookAt(
const glm::vec3& target);
80 bool isInFrustum(
const glm::vec3& center,
const float& radius)
const;
104 const glm::mat4& getInverseView()
const;
105 const glm::mat4& getInverseProjection()
const;
115 const glm::mat4& getInverseTransform() const noexcept;
117 float getPitch() const noexcept
122 float getYaw() const noexcept
127 float getRoll() const noexcept
132 void setPitch(
const float pitch);
133 void setYaw(
const float yaw);
134 void setRoll(
const float roll);
136 inline bool isDirty()
const
142 mutable bool _is_dirty =
true;
153 mutable glm::mat4 _view{1.0f};
154 mutable glm::mat4 _projection{1.0f};
156 mutable glm::mat4 _inv_view{1.0f};
157 mutable glm::mat4 _inv_projection{1.0f};
159 mutable glm::mat4 _transform{1.0f};
160 mutable glm::mat4 _inv_transform{1.0f};
162 mutable glm::vec4 _frustum_planes[6];
163 mutable glm::vec3 _frustum_points[8];
165 void _recompute_rotation();
166 void _recompute_matrices()
const;
Axis-aligned bounding box.
Definition aabb.h:13
The "eye of the scene".
Definition camera.h:33
Camera(const ProjectionSettings &projection_settings)
Constructor.
Definition camera.h:41
void setProjectionSettings(const ProjectionSettings &projection_settings)
Update the camera's projection matrix by recomputing it based on the provided settings.
Definition camera.h:52
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