aboutsummaryrefslogtreecommitdiff
path: root/09-september/tomcat/renderer/camera.h
diff options
context:
space:
mode:
authorThomas Guillermo Albers Raviola <thomas@thomaslabs.org>2026-01-16 23:02:32 +0100
committerThomas Guillermo Albers Raviola <thomas@thomaslabs.org>2026-01-16 23:02:32 +0100
commit6b8af9cf83851c075c6c9514b1deaa931c2b19a4 (patch)
tree428986b49c32e21d3f7a3c2dfa41858ae0153209 /09-september/tomcat/renderer/camera.h
Initial commit
Diffstat (limited to '09-september/tomcat/renderer/camera.h')
-rw-r--r--09-september/tomcat/renderer/camera.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/09-september/tomcat/renderer/camera.h b/09-september/tomcat/renderer/camera.h
new file mode 100644
index 0000000..0c63178
--- /dev/null
+++ b/09-september/tomcat/renderer/camera.h
@@ -0,0 +1,32 @@
+#ifndef CAMERA_H
+#define CAMERA_H
+
+#include "../math/matrix4x4.h"
+#include "../math/vector.h"
+#include <stdbool.h>
+
+typedef struct
+{
+ Vec3 position;
+ Vec3 viewDirection;
+ Vec3 up;
+ Mat4 projectionMatrix;
+ Mat4 viewMatrix;
+ Vec2 mousePosition;
+ bool needsUpdate;
+} Camera;
+
+extern Camera *camera_new();
+extern void camera_move_up(Camera *camera);
+extern void camera_move_down(Camera *camera);
+extern void camera_move_left(Camera *camera);
+extern void camera_move_right(Camera *camera);
+extern void camera_move_foward(Camera *camera);
+extern void camera_move_backward(Camera *camera);
+extern void camera_mouse_update(Camera *camera, const Vec2 *newMousePosition);
+extern void camera_free(Camera *camera);
+
+/* Consigue la viewMatrix */
+extern Mat4 camera_get_model_to_view_matrix(Camera *camera);
+
+#endif // CAMERA_H