8#define NUM_FRUSTUM_PLANES 6
30 void setAspect(
float width,
float height);
34 void setFov(
float fovyDegrees);
46 void setEye(glm::vec3 eye);
55 void setTarget(
float pitch,
float yaw,
float roll);
59 void setUp(glm::vec3 up);
75 [[nodiscard]]
const glm::vec3&
getEye()
const {
return eye_; }
77 [[nodiscard]] glm::vec3
getRight()
const;
78 [[nodiscard]]
const glm::vec3&
getUp()
const {
return up_; }
81 glm::vec3
eye_{0.0f, 0.0f, 3.0f};
83 glm::vec3
up_{0.0f, 1.0f, 0.0f};
86 float fovy_ = glm::radians(60.0f);
glm::mat4 view_projection_
Definition Camera.hpp:93
glm::vec3 up_
Definition Camera.hpp:83
float fovy_
Definition Camera.hpp:86
float zFar_
Far clip; covers the 4 000-unit play area with margin.
Definition Camera.hpp:89
void setEye(glm::vec3 eye)
Set the camera eye position in world space (modifies view matrix).
Definition Camera.cpp:36
float zNear_
Near clip (Quake units); 1 ≈ a tenth of a foot (close enough for the FP viewmodel).
Definition Camera.hpp:88
const glm::vec3 & getUp() const
Definition Camera.hpp:78
void setZFar(float zFar)
Set the far clip plane distance.
Definition Camera.cpp:31
glm::vec3 target_
Definition Camera.hpp:82
void setUp(glm::vec3 up)
Explicitly set the camera up direction, overriding setTarget's up vector.
Definition Camera.cpp:76
void computeViewProjectionMatrix()
Recompute the combined view-projection matrix from current parameters.
Definition Camera.cpp:81
glm::mat4 getViewProjectionMatrix() const
Return the combined view-projection matrix.
Definition Camera.hpp:67
NewCamera()
Construct a NewCamera with default perspective and position.
Definition Camera.cpp:11
glm::vec3 eye_
Definition Camera.hpp:81
const glm::vec3 & getEye() const
Definition Camera.hpp:75
void setAspect(float width, float height)
Set the aspect ratio from pixel dimensions (modifies projection matrix).
Definition Camera.cpp:16
void setFov(float fovyDegrees)
Set the vertical field of view in degrees.
Definition Camera.cpp:21
glm::vec3 getRight() const
Definition Camera.cpp:116
FrustumPlanes viewProjectionFrustumPlanes_
Definition Camera.hpp:95
void setZNear(float zNear)
Set the near clip plane distance.
Definition Camera.cpp:26
FrustumPlanes getViewProjectionFrustumPlane() const
Definition Camera.hpp:68
glm::mat4 getViewProjection() const
Alias for getViewProjectionMatrix() — kept short for callsite ergonomics.
Definition Camera.hpp:73
glm::mat4 view_
Definition Camera.hpp:91
glm::mat4 getViewMatrix() const
Definition Camera.hpp:69
glm::mat4 getProjectionMatrix() const
Definition Camera.hpp:70
static FrustumPlanes gribbHartmannFrustumPlanes(const glm::mat4 &viewProjectionMat)
Definition Camera.cpp:92
glm::mat4 projection_
Definition Camera.hpp:92
float aspect_
Definition Camera.hpp:87
glm::vec3 getForward() const
Definition Camera.cpp:111
void setTarget(float pitch, float yaw, float roll)
Set the view direction from pitch, yaw, and roll (all in radians).
Definition Camera.cpp:41
glm::vec4 left
Definition Camera.hpp:12
glm::vec4 far
Definition Camera.hpp:17
glm::vec4 near
Definition Camera.hpp:16
glm::vec4 right
Definition Camera.hpp:13
glm::vec4 bottom
Definition Camera.hpp:14
glm::vec4 top
Definition Camera.hpp:15