Hana
Loading...
Searching...
No Matches
OrthographicCamera.h
1#pragma once
2
3#include <glm/glm.hpp>
4
5namespace Hana
6{
7 class OrthographicCamera
8 {
9 public:
10 OrthographicCamera(float left, float right, float bottom, float top);
11
12 void SetProjection(float left, float right, float bottom, float top);
13
14 const glm::vec3& GetPosition() const { return m_Position; }
15 void SetPosition(const glm::vec3& position) { m_Position = position; RecalculateViewMatrix(); }
16
17 float GetRotation() const { return m_Rotation; }
18 void SetRotation(float rotation) { m_Rotation = rotation; RecalculateViewMatrix(); }
19
20 const glm::mat4& GetProjectionMatrix() const { return m_ProjectionMatrix; }
21 const glm::mat4& GetViewMatrix() const { return m_ViewMatrix; }
22 const glm::mat4& GetViewProjectionMatrix() const { return m_ViewProjectionMatrix; }
23
24 private:
25 void RecalculateViewMatrix();
26
27 glm::mat4 m_ProjectionMatrix;
28 glm::mat4 m_ViewMatrix;
29 glm::mat4 m_ViewProjectionMatrix;
30
31 glm::vec3 m_Position = { 0.0f, 0.0f, 0.0f };
32 float m_Rotation = 0.0f;
33 };
34}