6#include <glm/gtc/matrix_transform.hpp>
17 const glm::dvec3 & pos,
const glm::dvec3 & front,
const glm::dvec3 & up,
18 const double fov,
const double ratio,
const double nearD,
const double farD
27 glm::dvec3 m_camera_position;
28 glm::dvec3 m_x, m_y, m_z;
29 double m_nearD, m_farD;
32 double m_nearH, m_nearW;
33 double m_farH, m_farW;
34 double m_sphereFactorX, m_sphereFactorY;
47 glm::mat4
view = glm::mat4(1.0f);
49 glm::dvec3
position = glm::dvec3(0.0f, 0.0f, 0.0f);
54 glm::dvec3(0.0f, 0.0f, 0.0f),
55 glm::dvec3(0.0f, 0.0f, 0.0f),
56 glm::dvec3(0.0f, 0.0f, 0.0f),
57 0.0f, 0.0f, 0.0f, 0.0f
65 const glm::dvec3 & position,
81 position(camera.position),
86 near_plane(camera.near_plane),
87 far_plane(camera.far_plane)
93 std::lock_guard lock(m_mutex);
94 position = camera.position;
99 near_plane = camera.near_plane;
100 far_plane = camera.far_plane;
106 position(camera.position),
111 near_plane(camera.near_plane),
112 far_plane(camera.far_plane)
120 std::lock_guard lock(m_mutex);
121 position = camera.position;
122 pitch = camera.pitch;
126 near_plane = camera.near_plane;
127 far_plane = camera.far_plane;
134 std::lock_guard lock(m_mutex);
137 getProjectionMatrix(aspect_ratio),
142 getViewFrustum(aspect_ratio)
156 mutable TracyLockableN(std::mutex, m_mutex,
"Camera Mutex");
158 glm::dvec3 direction()
const;
160 glm::mat4 getViewMatrix()
const;
162 glm::mat4 getProjectionMatrix(
double aspect_ratio)
const;
164 ViewFrustum getViewFrustum(
double aspect_ratio)
const;
A simple camera class.
Definition: Camera.hpp:41
Camera(const glm::dvec3 &position, double pitch, double yaw, double far_plane)
Definition: Camera.hpp:64
Camera(const Camera &camera)
Definition: Camera.hpp:80
RenderInfo getRenderInfo(double aspect_ratio) const
Definition: Camera.hpp:132
Camera & operator=(Camera &&camera)
Definition: Camera.hpp:116
Camera & operator=(const Camera &camera)
Definition: Camera.hpp:91
Camera(Camera &&camera)
Definition: Camera.hpp:105
Definition: Camera.hpp:12
glm::dvec3 nbl
Definition: Camera.hpp:23
glm::dvec3 ftr
Definition: Camera.hpp:23
glm::dvec3 ntr
Definition: Camera.hpp:23
glm::dvec3 nbr
Definition: Camera.hpp:23
glm::dvec3 fbr
Definition: Camera.hpp:23
glm::dvec3 fbl
Definition: Camera.hpp:23
glm::dvec3 ftl
Definition: Camera.hpp:23
bool sphereInFrustum(const glm::dvec3 ¢er, double radius) const
Definition: Camera.cpp:52
glm::dvec3 ntl
Definition: Camera.hpp:23
Definition: Camera.hpp:46
glm::mat4 projection
Definition: Camera.hpp:48
glm::mat4 view
Definition: Camera.hpp:47
glm::dvec3 position
Definition: Camera.hpp:49
double near_plane
Definition: Camera.hpp:51
ViewFrustum view_frustum
Definition: Camera.hpp:53
double fov
Definition: Camera.hpp:50
double far_plane
Definition: Camera.hpp:52