summaryrefslogtreecommitdiff
path: root/src/maths.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/maths.c')
-rw-r--r--src/maths.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/maths.c b/src/maths.c
index fbfcd72..10fa9e0 100644
--- a/src/maths.c
+++ b/src/maths.c
@@ -2,6 +2,10 @@
vec3 vec3_create(f32 x, f32 y, f32 z) { return (vec3){ x, y, z }; }
+vec3 vec3_add(vec3 u, vec3 v) {
+ return (vec3){ .x = u.x + v.x, .y = u.y + v.y, .z = u.z + v.z };
+}
+
vec4 vec4_create(f32 x, f32 y, f32 z, f32 w) { return (vec4){ x, y, z, w }; }
mat4 mat4_ident() { return (mat4){ .data = { 1.0, 0., 0., 0., 0., 1., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1.0 } }; }
@@ -35,3 +39,7 @@ mat4 mat4_perspective(f32 fov_radians, f32 aspect_ratio, f32 near_z, f32 far_z)
out_matrix.data[14] = -((2.0f * far_z * near_z) / (far_z - near_z));
return out_matrix;
}
+
+mat4 mat4_look_at(vec3 position, vec3 target, vec3 up) {
+ // TODO
+} \ No newline at end of file