31#include <glm/gtc/matrix_transform.hpp>
223 Camera(Enums::CameraType camera_type, Enums::ProjectionType projection_type,
224 glm::vec3 position, glm::vec3 worldUp, glm::vec3
center,
225 float movementSpeed,
float mouseSensitivity,
float zoom,
388 void SetUp(glm::vec3 up);
443 Enums::CameraType camera_type = Enums::CameraType::AIRCRAFT;
444 Enums::ProjectionType projection_type = Enums::ProjectionType::PERSPECTIVE;
445 glm::vec3 position = glm::vec3(0.0f, 0.0f, 0.0f);
446 glm::vec3 worldUp = glm::vec3(0.0f, 1.0f, 0.0f);
447 glm::vec3 center = glm::vec3(0.0f, 0.0f, 0.0f);
448 float movementSpeed = 2.5f;
449 float mouseSensitivity = 0.1f;
451 glm::vec3 front = glm::vec3(0.0f, 0.0f, -1.0f);
452 glm::vec3 up = glm::vec3(0.0f, 1.0f, 0.0f);
453 glm::vec3 right = glm::vec3(1.0f, 0.0f, 0.0f);
458 Builder &set_camera_type(Enums::CameraType camera_type);
459 Builder &set_projection_type(Enums::ProjectionType projection_type);
460 Builder &set_position(glm::vec3 position);
461 Builder &set_world_up(glm::vec3 worldUp);
462 Builder &set_center(glm::vec3 center);
463 Builder &set_movement_speed(
float movementSpeed);
464 Builder &set_mouse_sensitivity(
float mouseSensitivity);
469 Builder &set_front(glm::vec3 front);
471 Builder &set_right(glm::vec3 right);
Builder pattern for the Camera class.
glm::vec3 Position
Camera position.
Types::EulerAngles GetEulerAngles()
Get the euler angles of the camera.
Types::SphericalCoordinates GetSphericalCoordinates()
Get the spherical coordinates of the camera.
Types::SphericalCoordinates sphericalCoordinates
Spherical coordinates.
float GetLastX()
Get the last x position of the mouse.
float lastX
Last x position of the mouse.
void updateCameraEuler()
Update the camera euler angles.
float MouseSensitivity
Mouse sensitivity.
Enums::ProjectionType GetProjectionType()
Get the projection type.
void SetZoom(float zoom)
Set the zoom level.
Enums::CameraType GetCameraType()
Get the camera type.
void SetMovementSpeed(float movementSpeed)
Set the movement speed.
float GetZoom()
Get the zoom level.
glm::vec3 WorldUp
The world up vector.
void SetPosition(glm::vec3 position)
Set the position of the camera.
void SetLastY(float lastY)
Set the last y position of the mouse.
void SetCameraType(Enums::CameraType camera_type)
Set the camera type.
glm::vec3 GetRight()
Get the right vector.
float lastY
Last y position of the mouse.
Types::EulerAngles eulerAngles
Euler angles.
glm::vec3 GetPosition()
Get the position of the camera.
float GetMovementSpeed()
Get the movement speed.
float GetLastY()
Get the last y position of the mouse.
float MovementSpeed
Space translational movement speed.
bool firstMouse
Is the first mouse movement?
void SetRight(glm::vec3 right)
Set the right vector.
void SetEulerAngles(Types::EulerAngles eulerAngles)
Set the euler angles of the camera.
glm::vec3 GetCenter()
Get the center of the sphere.
void SetWorldUp(glm::vec3 worldUp)
Set the world up vector.
void SetLastX(float lastX)
Set the last x position of the mouse.
void SetCenter(glm::vec3 center)
Set the center of the sphere.
void SetProjectionType(Enums::ProjectionType projection_type)
Set the projection type.
float Zoom
Zoom level (field of view)
float GetMouseSensitivity()
Get the mouse sensitivity.
Enums::CameraType CameraType
Camera type.
Camera()=default
Default constructor.
glm::mat4 GetProjectionMatrix()
Get the projection matrix.
void SetFirstMouse(bool firstMouse)
Set the first mouse flag.
void SetUp(glm::vec3 up)
Set the up vector.
glm::vec3 Front
Front vector.
void SetSphericalCoordinates(Types::SphericalCoordinates sphericalCoordinates)
Set the spherical coordinates of the camera.
glm::vec3 GetWorldUp()
Get the world up vector.
glm::vec3 Right
Right vector.
void SetMouseSensitivity(float mouseSensitivity)
Set the mouse sensitivity.
bool GetFirstMouse()
Get the first mouse flag.
void SetFront(glm::vec3 front)
Set the front vector.
glm::vec3 GetFront()
Get the front vector.
glm::vec3 center
The center of the spehere.
Enums::ProjectionType ProjectionType
Projection type.
void SphericalToCartesian()
Update the camera spherical coordinates.
glm::vec3 GetUp()
Get the up vector.
glm::mat4 GetViewMatrix()
Get the view matrix.