Manages cameras.
More...
#include <camera.h>
|
| Camera (glm::vec3 position, glm::vec3 direction, glm::vec3 up) |
void | update_view_matrix () |
| Recalculates the view matrix.
|
virtual void | update_projection_matrix ()=0 |
| Recalculates the projection matrix.
|
void | move_up (float delta) |
| Move the camera along the up vector.
|
void | move_right (float delta) |
| Move the camera along the right vector.
|
void | move_forward (float delta) |
| Move the camera along the forward vector.
|
void | move_by (float x, float y, float z) |
| Move the camera by the vector (x, y, z)
|
void | move_by (glm::vec3 vector) |
| Move the camera by the vector.
|
void | yaw (float angle) |
| Rotate the camera using the up vector as the axis.
|
void | roll (float angle) |
| Rotate the camera using the forward vector as the axis.
|
void | pitch (float angle) |
| Rotate the camera using the right vector as the axis.
|
|
glm::mat4 | view_matrix |
| The view matrix.
|
glm::mat4 | projection_matrix |
| The perspective projection matrix.
|
float | width |
| Viewport width.
|
float | height |
| Viewport height.
|
float | fovy |
| The vertical field of view angle of the camera.
|
float | far_plane |
| The far plane of the camera frustum.
|
float | near_plane |
| The near plane of the camera frustum.
|
glm::vec3 | position |
| The camera position.
|
glm::vec3 | direction |
| The direction the camera is pointing.
|
glm::vec3 | up |
| The up vector of the camera.
|
glm::vec3 | right |
| The right vector of the camera.
|
Manages cameras.
Definition at line 12 of file camera.h.
◆ Camera()
Camera::Camera |
( |
glm::vec3 | position, |
|
|
glm::vec3 | direction, |
|
|
glm::vec3 | up ) |
- Parameters
-
position | The camera position |
direction | The view direction |
up | The up vector |
Definition at line 5 of file camera.cpp.
◆ ~Camera()
◆ move_by() [1/2]
void Camera::move_by |
( |
float | x, |
|
|
float | y, |
|
|
float | z ) |
Move the camera by the vector (x, y, z)
- Parameters
-
x | The x component |
y | The y component |
z | The z component |
Definition at line 41 of file camera.cpp.
◆ move_by() [2/2]
void Camera::move_by |
( |
glm::vec3 | vector | ) |
|
Move the camera by the vector.
- Parameters
-
vector | The vector to move the camera by |
Definition at line 47 of file camera.cpp.
◆ move_forward()
void Camera::move_forward |
( |
float | delta | ) |
|
Move the camera along the forward vector.
- Parameters
-
delta | The distance to move the camera |
Definition at line 37 of file camera.cpp.
◆ move_right()
void Camera::move_right |
( |
float | delta | ) |
|
Move the camera along the right vector.
- Parameters
-
delta | The distance to move the camera |
Definition at line 33 of file camera.cpp.
◆ move_up()
void Camera::move_up |
( |
float | delta | ) |
|
Move the camera along the up vector.
- Parameters
-
delta | The distance to move the camera |
Definition at line 29 of file camera.cpp.
◆ pitch()
void Camera::pitch |
( |
float | angle | ) |
|
Rotate the camera using the right vector as the axis.
- Parameters
-
angle | The angle to rotate the camera |
Definition at line 63 of file camera.cpp.
◆ roll()
void Camera::roll |
( |
float | angle | ) |
|
Rotate the camera using the forward vector as the axis.
- Parameters
-
angle | The angle to rotate the camera |
Definition at line 57 of file camera.cpp.
◆ update_projection_matrix()
virtual void sgltk::Camera::update_projection_matrix |
( |
| ) |
|
|
pure virtual |
◆ update_view_matrix()
void Camera::update_view_matrix |
( |
| ) |
|
Recalculates the view matrix.
Definition at line 25 of file camera.cpp.
◆ yaw()
void Camera::yaw |
( |
float | angle | ) |
|
Rotate the camera using the up vector as the axis.
- Parameters
-
angle | The angle to rotate the camera |
Definition at line 51 of file camera.cpp.
◆ direction
glm::vec3 sgltk::Camera::direction |
The direction the camera is pointing.
Definition at line 49 of file camera.h.
◆ far_plane
float sgltk::Camera::far_plane |
The far plane of the camera frustum.
Definition at line 37 of file camera.h.
◆ fovy
float sgltk::Camera::fovy |
The vertical field of view angle of the camera.
Definition at line 33 of file camera.h.
◆ height
float sgltk::Camera::height |
Viewport height.
Definition at line 29 of file camera.h.
◆ near_plane
float sgltk::Camera::near_plane |
The near plane of the camera frustum.
Definition at line 41 of file camera.h.
◆ position
glm::vec3 sgltk::Camera::position |
The camera position.
Definition at line 45 of file camera.h.
◆ projection_matrix
glm::mat4 sgltk::Camera::projection_matrix |
The perspective projection matrix.
Definition at line 21 of file camera.h.
◆ right
glm::vec3 sgltk::Camera::right |
The right vector of the camera.
Definition at line 57 of file camera.h.
◆ up
glm::vec3 sgltk::Camera::up |
The up vector of the camera.
Definition at line 53 of file camera.h.
◆ view_matrix
glm::mat4 sgltk::Camera::view_matrix |
The view matrix.
Definition at line 17 of file camera.h.
◆ width
float sgltk::Camera::width |
Viewport width.
Definition at line 25 of file camera.h.
The documentation for this class was generated from the following files:
- /home/fstdb/proj/sgltk_example/sgltk/src/camera.h
- /home/fstdb/proj/sgltk_example/sgltk/src/camera.cpp