Camera for the new renderer, combining view and projection into one matrix.
More...
#include <Camera.hpp>
|
| | NewCamera () |
| | Construct a NewCamera with default perspective and position.
|
| void | setAspect (float width, float height) |
| | Set the aspect ratio from pixel dimensions (modifies projection matrix).
|
| void | setFov (float fovyDegrees) |
| | Set the vertical field of view in degrees.
|
| void | setZNear (float zNear) |
| | Set the near clip plane distance.
|
| void | setZFar (float zFar) |
| | Set the far clip plane distance.
|
| void | setEye (glm::vec3 eye) |
| | Set the camera eye position in world space (modifies view matrix).
|
| void | setTarget (float pitch, float yaw, float roll) |
| | Set the view direction from pitch, yaw, and roll (all in radians).
|
| void | setUp (glm::vec3 up) |
| | Explicitly set the camera up direction, overriding setTarget's up vector.
|
| void | computeViewProjectionMatrix () |
| | Recompute the combined view-projection matrix from current parameters.
|
| glm::mat4 | getViewProjectionMatrix () const |
| | Return the combined view-projection matrix.
|
| glm::mat4 | getViewMatrix () const |
| glm::mat4 | getProjectionMatrix () const |
| glm::mat4 | getViewProjection () const |
| | Alias for getViewProjectionMatrix() — kept short for callsite ergonomics.
|
| const glm::vec3 & | getEye () const |
| glm::vec3 | getForward () const |
| glm::vec3 | getRight () const |
| const glm::vec3 & | getUp () const |
|
| glm::vec3 | eye_ {0.0f, 0.0f, 3.0f} |
| glm::vec3 | target_ {0.0f, 0.0f, 0.0f} |
| glm::vec3 | up_ {0.0f, 1.0f, 0.0f} |
| float | fovy_ = glm::radians(60.0f) |
| float | aspect_ = 1.0f |
| float | zNear_ = 5.0f |
| | Near clip (Quake units); 5 ≈ half a foot.
|
| float | zFar_ = 15000.0f |
| | Far clip; covers the 4 000-unit play area with margin.
|
| glm::mat4 | view_ {1.0f} |
| glm::mat4 | projection_ {1.0f} |
| glm::mat4 | view_projection_ {1.0f} |
Camera for the new renderer, combining view and projection into one matrix.
◆ NewCamera()
Construct a NewCamera with default perspective and position.
◆ computeViewProjectionMatrix()
| void NewCamera::computeViewProjectionMatrix |
( |
| ) |
|
Recompute the combined view-projection matrix from current parameters.
◆ getEye()
| const glm::vec3 & NewCamera::getEye |
( |
| ) |
const |
|
inlinenodiscard |
◆ getForward()
| glm::vec3 NewCamera::getForward |
( |
| ) |
const |
|
nodiscard |
◆ getProjectionMatrix()
| glm::mat4 NewCamera::getProjectionMatrix |
( |
| ) |
const |
|
inlinenodiscard |
◆ getRight()
| glm::vec3 NewCamera::getRight |
( |
| ) |
const |
|
nodiscard |
◆ getUp()
| const glm::vec3 & NewCamera::getUp |
( |
| ) |
const |
|
inlinenodiscard |
◆ getViewMatrix()
| glm::mat4 NewCamera::getViewMatrix |
( |
| ) |
const |
|
inlinenodiscard |
◆ getViewProjection()
| glm::mat4 NewCamera::getViewProjection |
( |
| ) |
const |
|
inlinenodiscard |
◆ getViewProjectionMatrix()
| glm::mat4 NewCamera::getViewProjectionMatrix |
( |
| ) |
const |
|
inlinenodiscard |
Return the combined view-projection matrix.
◆ setAspect()
| void NewCamera::setAspect |
( |
float | width, |
|
|
float | height ) |
Set the aspect ratio from pixel dimensions (modifies projection matrix).
- Parameters
-
| width | Viewport width in pixels. |
| height | Viewport height in pixels. |
◆ setEye()
| void NewCamera::setEye |
( |
glm::vec3 | eye | ) |
|
Set the camera eye position in world space (modifies view matrix).
- Parameters
-
◆ setFov()
| void NewCamera::setFov |
( |
float | fovyDegrees | ) |
|
Set the vertical field of view in degrees.
- Parameters
-
| fovyDegrees | Vertical FOV in degrees. |
◆ setTarget()
| void NewCamera::setTarget |
( |
float | pitch, |
|
|
float | yaw, |
|
|
float | roll ) |
Set the view direction from pitch, yaw, and roll (all in radians).
Roll rotates the up vector around the forward axis, used for camera tilt during wallruns.
- Parameters
-
| pitch | Pitch angle in radians. |
| yaw | Yaw angle in radians. |
| roll | Roll angle in radians. |
◆ setUp()
| void NewCamera::setUp |
( |
glm::vec3 | up | ) |
|
Explicitly set the camera up direction, overriding setTarget's up vector.
- Parameters
-
| up | The desired up direction. |
◆ setZFar()
| void NewCamera::setZFar |
( |
float | zFar | ) |
|
Set the far clip plane distance.
- Parameters
-
◆ setZNear()
| void NewCamera::setZNear |
( |
float | zNear | ) |
|
Set the near clip plane distance.
- Parameters
-
◆ aspect_
| float NewCamera::aspect_ = 1.0f |
|
private |
◆ eye_
| glm::vec3 NewCamera::eye_ {0.0f, 0.0f, 3.0f} |
|
private |
◆ fovy_
| float NewCamera::fovy_ = glm::radians(60.0f) |
|
private |
◆ projection_
| glm::mat4 NewCamera::projection_ {1.0f} |
|
private |
◆ target_
| glm::vec3 NewCamera::target_ {0.0f, 0.0f, 0.0f} |
|
private |
◆ up_
| glm::vec3 NewCamera::up_ {0.0f, 1.0f, 0.0f} |
|
private |
◆ view_
| glm::mat4 NewCamera::view_ {1.0f} |
|
private |
◆ view_projection_
| glm::mat4 NewCamera::view_projection_ {1.0f} |
|
private |
◆ zFar_
| float NewCamera::zFar_ = 15000.0f |
|
private |
Far clip; covers the 4 000-unit play area with margin.
◆ zNear_
| float NewCamera::zNear_ = 5.0f |
|
private |
Near clip (Quake units); 5 ≈ half a foot.
The documentation for this class was generated from the following files: