summaryrefslogtreecommitdiff
path: root/src/core/camera.c
diff options
context:
space:
mode:
authoromnisci3nce <omniscient.oce@gmail.com>2024-07-12 12:47:07 +1000
committeromnisci3nce <omniscient.oce@gmail.com>2024-07-12 12:47:07 +1000
commitf74cf52946f4e569a26bc81105537b40be95c2c7 (patch)
tree1d000367350d0e28eb7cfbc800286a0ed30a4e6c /src/core/camera.c
parentfedba7ff68924ff50022405fc9103a5acf7013fe (diff)
wip: big makeover
Diffstat (limited to 'src/core/camera.c')
-rw-r--r--src/core/camera.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/camera.c b/src/core/camera.c
index 50c4054..428a50d 100644
--- a/src/core/camera.c
+++ b/src/core/camera.c
@@ -2,16 +2,15 @@
#include "maths.h"
-Camera Camera_Create(vec3 pos, vec3 front, vec3 up, f32 fov) {
+Camera Camera_Create(Vec3 pos, Vec3 front, Vec3 up, f32 fov) {
Camera c = { .position = pos, .front = front, .up = up, .fov = fov };
return c;
}
-mat4 Camera_ViewProj(Camera *c, f32 lens_height, f32 lens_width, mat4 *out_view,
- mat4 *out_proj) {
- mat4 proj = mat4_perspective(c->fov, lens_width / lens_height, 0.1, 100.0);
- vec3 camera_direction = vec3_add(c->position, c->front);
- mat4 view = mat4_look_at(c->position, camera_direction, c->up);
+Mat4 Camera_ViewProj(Camera *c, f32 lens_height, f32 lens_width, Mat4 *out_view, Mat4 *out_proj) {
+ Mat4 proj = mat4_perspective(c->fov, lens_width / lens_height, 0.1, 100.0);
+ Vec3 camera_direction = vec3_add(c->position, c->front);
+ Mat4 view = mat4_look_at(c->position, camera_direction, c->up);
if (out_view) {
*out_view = view;
}