summaryrefslogtreecommitdiff
path: root/engine/xe_camera.hpp
diff options
context:
space:
mode:
authortylermurphy534 <tylermurphy534@gmail.com>2022-09-18 21:20:51 -0400
committertylermurphy534 <tylermurphy534@gmail.com>2022-09-18 21:20:51 -0400
commit8045b8ba04aae39a4cf9733e72413f648b6ebe2b (patch)
treef90a9bd50a2316d5077df99c9e8584afc76ed656 /engine/xe_camera.hpp
downloadminecraftvulkan-8045b8ba04aae39a4cf9733e72413f648b6ebe2b.tar.gz
minecraftvulkan-8045b8ba04aae39a4cf9733e72413f648b6ebe2b.tar.bz2
minecraftvulkan-8045b8ba04aae39a4cf9733e72413f648b6ebe2b.zip
stanford dragon rendering
Diffstat (limited to 'engine/xe_camera.hpp')
-rw-r--r--engine/xe_camera.hpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/engine/xe_camera.hpp b/engine/xe_camera.hpp
new file mode 100644
index 0000000..00711cd
--- /dev/null
+++ b/engine/xe_camera.hpp
@@ -0,0 +1,37 @@
+#pragma once
+
+#include <glm/fwd.hpp>
+#define GLM_FORCE_RADIANS
+#define GLM_FORCE_DEPTH_ZERO_TO_ONE
+#include <glm/glm.hpp>
+
+namespace xe {
+
+class XeCamera {
+ public:
+
+ void setOrthographicProjection(
+ float left, float right, float top, float bottom, float near, float far);
+
+ void setPerspectiveProjection(
+ float fovy, float aspect, float near, float far);
+
+ void setViewDirection(
+ glm::vec3 position, glm::vec3 direction, glm::vec3 up = glm::vec3(0.f, -1.f, 0.f));
+
+ void setViewTarget(
+ glm::vec3 position, glm::vec3 target, glm::vec3 up = glm::vec3(0.f, -1.f, 0.f));
+
+ void setViewYXZ(
+ glm::vec3 position, glm::vec3 rotation);
+
+ const glm::mat4& getProjection() const { return projectionMatrix; }
+ const glm::mat4& getView() const { return viewMatrix; }
+
+ private:
+ glm::mat4 projectionMatrix{1.f};
+ glm::mat4 viewMatrix{1.f};
+
+};
+
+} \ No newline at end of file