Camera class for handling movement and view transformations. More...
#include <camera.hpp>
Public Member Functions | |
| Camera (Raftel::Window *w) | |
| Constructs a Camera object. | |
| float | getMovementSpeed () const |
| Gets the current movement speed of the camera. | |
| glm::vec3 | getPosition () const |
| Gets the current position of the camera. | |
| glm::vec3 | getRotation () const |
| Gets the current rotation of the camera. | |
| glm::mat4 | getViewMatrix () const |
| Gets the view matrix of the camera. | |
| glm::mat4 | getProjectionMatrix () const |
| Gets the projection matrix of the camera. | |
| void | SetPosition (const glm::vec3 &position) |
| Sets the position of the camera. | |
| void | SetRotation (const glm::vec3 &rotation) |
| Sets the rotation of the camera. | |
| void | Update (const std::unique_ptr< Window > &window) |
| Updates the camera's transformation matrices. | |
| void | setUniforms (ShaderProgram &prg) |
| Sets shader uniforms related to the camera. | |
| void | Translate (const glm::vec3 &translation) |
| Moves the camera by a given translation vector. | |
| void | Rotate (float angle, const glm::vec3 &axis) |
| Rotates the camera around an axis. | |
| void | SetState (CameraState newState, GLFWwindow *window) |
| Sets the camera state. | |
| CameraState | GetState () const |
| Gets the current camera state. | |
| void | ToggleState (Raftel::Window *window, Raftel::Input::Keys key_) |
| Toggles the camera state using a keyboard key. | |
| void | ToggleState (Raftel::Window *window, Raftel::Input::Buttons button_) |
| Toggles the camera state using a mouse button. | |
| void | ChangeSpeedWithKey (Raftel::Window *window, Raftel::Input::Keys key_, float fastSpeed=5.0f, float normalSpeed=2.0f) |
| Changes camera movement speed when a specific key is pressed. | |
| void | ChangeSpeedWithScroll (Raftel::Window *window, float speedOffset) |
| Adjusts camera movement speed using mouse scroll input. | |
| void | PossessedInput (Raftel::Window *window) |
| Processes user input when the camera is in possessed mode. | |
Camera class for handling movement and view transformations.
Definition at line 27 of file camera.hpp.
| Raftel::Camera::Camera | ( | Raftel::Window * | w | ) |
Constructs a Camera object.
| inputRef | Pointer to the input handler. |
| void Raftel::Camera::ChangeSpeedWithKey | ( | Raftel::Window * | window, |
| Raftel::Input::Keys | key_, | ||
| float | fastSpeed = 5.0f, | ||
| float | normalSpeed = 2.0f ) |
Changes camera movement speed when a specific key is pressed.
| window | Reference to the window. |
| key_ | Key used to adjust the speed. |
| fastSpeed | Speed when the key is held. |
| normalSpeed | Default speed when the key is not held. |
| void Raftel::Camera::ChangeSpeedWithScroll | ( | Raftel::Window * | window, |
| float | speedOffset ) |
Adjusts camera movement speed using mouse scroll input.
| window | Reference to the window. |
| speedOffset | The speed adjustment factor. |
| float Raftel::Camera::getMovementSpeed | ( | ) | const |
Gets the current movement speed of the camera.
| glm::vec3 Raftel::Camera::getPosition | ( | ) | const |
Gets the current position of the camera.
| glm::mat4 Raftel::Camera::getProjectionMatrix | ( | ) | const |
Gets the projection matrix of the camera.
| glm::vec3 Raftel::Camera::getRotation | ( | ) | const |
Gets the current rotation of the camera.
| CameraState Raftel::Camera::GetState | ( | ) | const |
Gets the current camera state.
| glm::mat4 Raftel::Camera::getViewMatrix | ( | ) | const |
Gets the view matrix of the camera.
| void Raftel::Camera::PossessedInput | ( | Raftel::Window * | window | ) |
Processes user input when the camera is in possessed mode.
| window | Reference to the window. |
| void Raftel::Camera::Rotate | ( | float | angle, |
| const glm::vec3 & | axis ) |
Rotates the camera around an axis.
| angle | Rotation angle in degrees. |
| axis | Rotation axis. |
| void Raftel::Camera::SetPosition | ( | const glm::vec3 & | position | ) |
Sets the position of the camera.
| position | The new position. |
| void Raftel::Camera::SetRotation | ( | const glm::vec3 & | rotation | ) |
Sets the rotation of the camera.
| rotation | The new rotation angles. |
| void Raftel::Camera::SetState | ( | CameraState | newState, |
| GLFWwindow * | window ) |
Sets the camera state.
| newState | The new state to set. |
| window | The GLFW window reference. |
| void Raftel::Camera::setUniforms | ( | ShaderProgram & | prg | ) |
Sets shader uniforms related to the camera.
| prg | Shader program to update. |
| void Raftel::Camera::ToggleState | ( | Raftel::Window * | window, |
| Raftel::Input::Buttons | button_ ) |
Toggles the camera state using a mouse button.
| window | Reference to the window. |
| button_ | Mouse button used to toggle the state. |
| void Raftel::Camera::ToggleState | ( | Raftel::Window * | window, |
| Raftel::Input::Keys | key_ ) |
Toggles the camera state using a keyboard key.
| window | Reference to the window. |
| key_ | Key used to toggle the state. |
| void Raftel::Camera::Translate | ( | const glm::vec3 & | translation | ) |
Moves the camera by a given translation vector.
| translation | The translation vector. |
| void Raftel::Camera::Update | ( | const std::unique_ptr< Window > & | window | ) |
Updates the camera's transformation matrices.
| window | The window reference used for retrieving screen size. |