This commit is contained in:
2025-11-24 13:25:31 +00:00
parent 767796919a
commit c17279960c
4 changed files with 92 additions and 10 deletions

32
inc/engine/camera.hpp Normal file
View File

@@ -0,0 +1,32 @@
#ifndef CAMERA_HPP
#define CAMERA_HPP
// Includes
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
// Camera Class
class Camera {
public:
Camera(const glm::vec3& position, const glm::vec3& target, const glm::vec3& up);
glm::mat4 getViewMatrix() const;
glm::mat4 getProjectionMatrix() const;
void setProjectionMatrix(float fov, float aspectRatio, float nearPlane, float farPlane);
void setPosition(const glm::vec3& position);
void setTarget(const glm::vec3& target);
void setUp(const glm::vec3& up);
glm::vec3 getPosition() const;
float fov = 45.0f;
private:
glm::vec3 position;
glm::vec3 target;
glm::vec3 up;
float aspectRatio = 4.0f / 3.0f;
float nearPlane = 0.1f;
float farPlane = 100.0f;
};
#endif