15#include <glm/gtc/matrix_transform.hpp>
45 Camera(
float fov = 45.0f,
float aspect = 16.0f / 9.0f,
float near = 0.1f,
float far = 100.0f);
71 void set_orthographic(
float left,
float right,
float bottom,
float top,
float near,
float far);
81 m_position = position;
104 inline void set_up(
const glm::vec3 &up) {
121 inline const glm::vec3 &
get_target()
const {
return m_target; }
128 inline const glm::vec3 &
get_up()
const {
return m_up; }
170 glm::vec3
unproject(
float screen_x,
float screen_y,
float screen_width,
float screen_height)
const;
199 glm::vec3 m_position;
208 mutable glm::mat4 m_view;
211 glm::mat4 m_projection;
217 mutable bool m_view_dirty;
void set_orthographic(float left, float right, float bottom, float top, float near, float far)
Set the camera to orthographic projection mode.
Definition camera.cpp:40
void set_up(const glm::vec3 &up)
Set the camera's up vector.
Definition camera.hpp:104
glm::vec3 unproject(float screen_x, float screen_y, float screen_width, float screen_height) const
Unproject screen coordinates to world space.
Definition camera.cpp:57
const glm::vec3 & get_target() const
Get the camera target.
Definition camera.hpp:121
ProjectionMode
Projection mode for the camera.
Definition camera.hpp:33
float get_aspect() const
Get the current aspect ratio.
Definition camera.hpp:184
void set_perspective(float fov, float aspect, float near, float far)
Set the camera to perspective projection mode.
Definition camera.cpp:24
ProjectionMode get_projection_mode() const
Get the current projection mode.
Definition camera.hpp:177
Camera(float fov=45.0f, float aspect=16.0f/9.0f, float near=0.1f, float far=100.0f)
Constructor for the Camera class.
Definition camera.cpp:9
void set_target(const glm::vec3 &target)
Set the camera target/look-at point.
Definition camera.hpp:92
const glm::mat4 & get_projection_matrix() const
Get the projection matrix.
Definition camera.hpp:147
glm::mat4 get_view_projection_matrix() const
Get the combined view-projection matrix.
Definition camera.cpp:55
void set_aspect(float aspect)
Set a new aspect ratio.
Definition camera.cpp:33
const glm::vec3 & get_position() const
Get the camera position.
Definition camera.hpp:114
const glm::mat4 & get_view_matrix() const
Get the view matrix.
Definition camera.cpp:47
void set_position(const glm::vec3 &position)
Set the camera position.
Definition camera.hpp:80
const glm::vec3 & get_up() const
Get the camera up vector.
Definition camera.hpp:128
Namespace for scene-related classes and functions.
Definition camera.cpp:7
Forward declarations for Assimp Material structure.
Definition model_loader.cpp:12