summaryrefslogtreecommitdiff
path: root/src/camera.h
diff options
context:
space:
mode:
authorOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-02-24 22:47:46 +1100
committerOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-02-24 22:47:46 +1100
commit7b3afcaf77f96e7d62f6cd1623ead7f17512d79f (patch)
treeb5f82c64e9c06a84e4d095ab4ac48712e860b673 /src/camera.h
parentb047be5252aeb981faea077409c1768fda0301d9 (diff)
repo init. partial port of existing code
Diffstat (limited to 'src/camera.h')
-rw-r--r--src/camera.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/camera.h b/src/camera.h
new file mode 100644
index 0000000..226f80e
--- /dev/null
+++ b/src/camera.h
@@ -0,0 +1,26 @@
+/**
+ * @file camera.h
+ * @author your name (you@domain.com)
+ * @brief
+ * @version 0.1
+ * @date 2024-02-24
+ *
+ * @copyright Copyright (c) 2024
+ *
+ */
+#pragma once
+
+#include "maths_types.h"
+
+typedef struct camera {
+ vec3 position;
+ vec3 front;
+ vec3 up;
+ f32 fov;
+} camera;
+
+/** @brief create a camera */
+camera camera_create(vec3 pos, vec3 front, vec3 up, f32 fov);
+
+/** @brief get a 4x4 transform matrix for the view and perspective projection */
+void camera_view_projection(camera *c, f32 screen_height, f32 screen_width, mat4 *out_view_proj); \ No newline at end of file