aboutsummaryrefslogtreecommitdiff
path: root/source/Game/Camera.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-06-03 23:26:44 -0700
committerrtk0c <[email protected]>2022-06-03 23:26:44 -0700
commit60ccc62f4934e44ad5b905fdbcf458302b8d8a09 (patch)
tree02ec83cc8387abfd08bd5ee7ea4e8115f1bfb8d0 /source/Game/Camera.hpp
parentc2ef7737536bf1f8c81fcfae95c0183b21c9753f (diff)
Changeset: 63 [WIP] Rename directories
Diffstat (limited to 'source/Game/Camera.hpp')
-rw-r--r--source/Game/Camera.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/source/Game/Camera.hpp b/source/Game/Camera.hpp
new file mode 100644
index 0000000..7bf0a6c
--- /dev/null
+++ b/source/Game/Camera.hpp
@@ -0,0 +1,35 @@
+#pragma once
+
+#include <glm/glm.hpp>
+#include <string>
+
+class Camera {
+public:
+ std::string name;
+ glm::vec3 eye;
+ glm::vec3 target;
+
+ // --- Orthographic settings ---
+ float pixelsPerMeter;
+ // --- Orthographic settings ---
+
+ // ---- Perspective settings ---
+ /// In radians
+ float fov;
+ // ---- Perspective settings ---
+
+ bool perspective;
+
+public:
+ Camera();
+
+ void SetEyePos(glm::vec3 pos);
+ void SetTargetPos(glm::vec3 pos);
+ void SetTargetDirection(glm::vec3 lookVector);
+
+ bool HasPerspective() const { return perspective; }
+ void SetHasPerspective(bool perspective);
+
+ glm::mat4 CalcViewMatrix() const;
+ glm::mat4 CalcProjectionMatrix() const;
+};