mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-28 02:58:35 +02:00
~ | Better camera managment
This commit is contained in:
@ -15,6 +15,14 @@
|
||||
|
||||
# include "RT.hpp"
|
||||
|
||||
struct GPUCamera
|
||||
{
|
||||
glm::mat4 view_matrix;
|
||||
alignas(16) glm::vec3 camera_position;
|
||||
float aperture_size;
|
||||
float focus_distance;
|
||||
};
|
||||
|
||||
class Camera
|
||||
{
|
||||
public:
|
||||
@ -27,13 +35,20 @@ class Camera
|
||||
void processMouse(float xoffset, float yoffset, bool constrainPitch);
|
||||
void processKeyboard(bool forward, bool backward, bool left, bool right, bool up, bool down);
|
||||
|
||||
glm::mat4 getViewMatrix();
|
||||
void updateCameraVectors();
|
||||
|
||||
glm::vec3 getPosition();
|
||||
glm::vec2 getDirection();
|
||||
glm::vec2 getDOV();
|
||||
glm::mat4 getViewMatrix();
|
||||
|
||||
GPUCamera getGPUData();
|
||||
|
||||
void setPosition(glm::vec3 position);
|
||||
void setDirection(float pitch, float yaw);
|
||||
void setDOV(float aperture, float focus);
|
||||
|
||||
private:
|
||||
void updateCameraVectors();
|
||||
|
||||
glm::vec3 _position;
|
||||
glm::vec3 _forward;
|
||||
@ -50,6 +65,9 @@ class Camera
|
||||
float _acceleration_rate = 40.0f;
|
||||
float _deceleration_rate = 10000.0f;
|
||||
float _sensitivity = 0.2f;
|
||||
|
||||
float _aperture_size = 0.0f;
|
||||
float _focus_distance = 1.0f;
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user