Files
RT_GPU/includes/RT/Camera.hpp
2024-12-27 12:05:22 +01:00

53 lines
1.7 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Camera.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/15 13:59:57 by TheRed #+# #+# */
/* Updated: 2024/12/23 17:42:18 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef RT_CAMERA__HPP
# define RT_CAMERA__HPP
# include "RT.hpp"
class Camera
{
public:
Camera(glm::vec3 startPos, glm::vec3 startUp, float startYaw, float startPitch);
~Camera(void);
void update(float deltaTime);
void process_mouse(float xoffset, float yoffset, bool constrainPitch);
void process_keyboard(bool forward, bool backward, bool left, bool right, bool up, bool down);
glm::mat4 get_view_matrix();
glm::vec3 get_position();
private:
void update_camera_vectors();
glm::vec3 _position;
glm::vec3 _forward;
glm::vec3 _up;
glm::vec3 _right;
float _pitch;
float _yaw;
glm::vec3 _velocity;
glm::vec3 _acceleration;
float _maxSpeed = 8.0f;
float _acceleration_rate = 40.0f;
float _deceleration_rate = 40.0f;
float _sensitivity = 0.2f;
};
#endif