32 lines
785 B
C++
32 lines
785 B
C++
#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 |