Add control / update logic

This commit is contained in:
Camden Dixie O'Brien
2025-10-13 18:43:40 +01:00
parent e6ed2194c3
commit 9bbe8f71ec
5 changed files with 179 additions and 17 deletions

27
maths.h
View File

@@ -1,24 +1,35 @@
#ifndef MATHS_H
#define MATHS_H
#define PI 3.14159265358979323846264
typedef struct {
float x;
float y;
float x, y;
} vec2_t;
typedef struct {
float x;
float y;
float z;
vec2_t x, y;
} mat2_t;
typedef struct {
float x, y, z;
} vec3_t;
typedef struct {
vec3_t x;
vec3_t y;
vec3_t z;
vec3_t x, y, z;
} mat3_t;
vec2_t vec2_add(vec2_t v1, vec2_t v2);
vec2_t vec2_scale(vec2_t v, float s);
vec3_t vec2_extend(vec2_t v);
mat2_t mat2_rotation(float theta);
vec2_t mat2_mul_vec2(mat2_t m, vec2_t v);
mat2_t mat2_mul_mat2(mat2_t m1, mat2_t m2);
mat3_t mat2_extend(mat2_t m);
mat3_t mat3_translation(vec2_t v);
vec3_t mat3_mul_vec3(mat3_t m, vec3_t v);
mat3_t mat3_mul_mat3(mat3_t m1, mat3_t m2);
#endif