Class representing a camera for rendering. Primarily used to compute the view-projection matrix and pass it to the Client for rendering objects from different viewing angles.
More...
#include <camera.hpp>
Class representing a camera for rendering. Primarily used to compute the view-projection matrix and pass it to the Client for rendering objects from different viewing angles.
◆ Camera()
Constructs a new Camera object.
◆ ~Camera()
◆ getFacing()
| glm::vec3 Camera::getFacing |
( |
| ) |
|
|
inline |
Returns a normalized vector representing the direction that the camera is facing.
- Returns
- glm::vec3 A normalized vector representing the direction the camera is facing.
◆ getPos()
| glm::vec3 Camera::getPos |
( |
| ) |
|
◆ getProjection()
| glm::mat4 Camera::getProjection |
( |
| ) |
|
◆ getView()
| glm::mat4 Camera::getView |
( |
| ) |
|
◆ getViewProj()
| glm::mat4 Camera::getViewProj |
( |
| ) |
|
|
inline |
Returns the view-projection matrix of the Camera, for use in rendering.
- Returns
- glm::mat4 The view-projection matrix.
◆ move()
| glm::vec3 Camera::move |
( |
bool |
is_x_axis, |
|
|
float |
dir |
|
) |
| |
Moves the camera based on the axis, direction, and speed. Factors in the current direction of the camera to compute proper lateral and forward movement.
- Parameters
-
| is_x_axis | A flag denoting whether the movement is along the x-axis or z-axis. |
| dir | The direction that the camera is moving in. |
- Returns
- glm::vec3 An output vector representing the movement of the camera in the specified axis and direction.
◆ setAspect()
| void Camera::setAspect |
( |
float |
a | ) |
|
|
inline |
Sets the aspect ratio of the camera.
- Parameters
-
◆ setPitch()
| void Camera::setPitch |
( |
float |
pitch | ) |
|
◆ update()
| void Camera::update |
( |
float |
xpos, |
|
|
float |
ypos |
|
) |
| |
|
virtual |
Updates the the camera based on the input screen coordinates.
- Parameters
-
| xpos | New x-coordinate for the cursor. |
| ypos | New y-coordinate for the cursor. |
Reimplemented in DungeonMasterCamera.
◆ updatePos()
| void Camera::updatePos |
( |
glm::vec3 |
pos | ) |
|
Updates the position of the camera.
- Parameters
-
| pos | The new position of the camera. |
◆ aspect
◆ cameraFront
| glm::vec3 Camera::cameraFront |
|
protected |
◆ cameraPos
| glm::vec3 Camera::cameraPos |
|
protected |
◆ cameraRight
| glm::vec3 Camera::cameraRight |
|
protected |
◆ cameraUp
| glm::vec3 Camera::cameraUp |
|
protected |
◆ farClip
◆ firstMouse
◆ FOV
◆ fov
◆ lastX
◆ lastY
◆ nearClip
◆ pitch
◆ projection
| glm::mat4 Camera::projection |
|
protected |
◆ sensitivity
| float Camera::sensitivity |
|
protected |
◆ speed
◆ view
◆ viewProjMat
| glm::mat4 Camera::viewProjMat |
|
protected |
◆ worldUp
| glm::vec3 Camera::worldUp |
|
protected |
◆ yaw
The documentation for this class was generated from the following files: