summaryrefslogtreecommitdiff
path: root/src/camera.h
diff options
context:
space:
mode:
authorAaditya Dhruv <[email protected]>2026-01-28 14:20:23 -0600
committerAaditya Dhruv <[email protected]>2026-01-28 14:20:23 -0600
commit17d2d2589694030f79f2a37732d72d4e433fd745 (patch)
tree918cc9f51276c7401c273fe05ad12d10edfaa40f /src/camera.h
parent77dddef4153688218bec0b50f547622daa18903d (diff)
Add camera handling and movement
Camera related movements have been moved to camera.c - it tracks the matrices as well so we don't have to call it in block_update The player class is empty right now, but the camera will be a child of the player, and the player a child of the engine
Diffstat (limited to 'src/camera.h')
-rw-r--r--src/camera.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/camera.h b/src/camera.h
new file mode 100644
index 0000000..199f0b4
--- /dev/null
+++ b/src/camera.h
@@ -0,0 +1,17 @@
+#pragma once
+#include "cglm/types.h"
+#include "shader.h"
+
+struct camera {
+ vec3 position;
+ vec3 direction;
+ vec3 up;
+ mat4 view;
+ mat4 perspective;
+ float fov;
+};
+
+void camera_init(struct camera** camera);
+void camera_update(struct camera* camera, struct shader* shader);
+void camera_set_position(struct camera* camera, vec3 pos);
+void camera_move(struct camera* camera, vec3 move);