diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-10-18 17:54:31 +1100 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-10-18 17:54:31 +1100 |
commit | 28bd234a45995b62544e6b5f70d40dfe39ef2e99 (patch) | |
tree | 1aca5cd820091e6b9652ee7d104b9b337343e0fb /src/maths.c | |
parent | 68f590c848e0e91d70e7116655464f392ed6df46 (diff) |
recompile .o files when header changes
Diffstat (limited to 'src/maths.c')
-rw-r--r-- | src/maths.c | 8 |
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 |