37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
#ifndef ORTHOGRAPHIC_CAMERA_HPP
|
|
#define ORTHOGRAPHIC_CAMERA_HPP
|
|
|
|
#include <glm/fwd.hpp>
|
|
#include <glm/glm.hpp>
|
|
|
|
namespace OpenEngine {
|
|
class OrthographicCamera
|
|
{
|
|
public:
|
|
OrthographicCamera(float left, float right, float bottom, float top);
|
|
void SetProjection(float left, float right, float bottom, float top);
|
|
|
|
const glm::vec3& GetPosition() const { return position; };
|
|
void SetPosition(const glm::vec3& position) { this->position = position; RecalculateViewMatrix(); };
|
|
|
|
const float& GetRotation() const { return rotation; };
|
|
void SetRotation(float rotation) { this->rotation = rotation; RecalculateViewMatrix(); };
|
|
|
|
const glm::mat4& GetProjectionMatrix() const { return projection_matrix; };
|
|
const glm::mat4& GetViewMatrix() const { return view_matrix; };
|
|
const glm::mat4& GetViewProjectionMatrix() const { return view_projection_matrix; };
|
|
|
|
private:
|
|
void RecalculateViewMatrix();
|
|
|
|
glm::mat4 projection_matrix;
|
|
glm::mat4 view_matrix;
|
|
glm::mat4 view_projection_matrix;
|
|
|
|
glm::vec3 position{0.0f};
|
|
float rotation = 0.0f;
|
|
};
|
|
}
|
|
|
|
#endif // ORTHOGRAPHIC_CAMERA_HPP
|