diff --git a/include/math/vector3.h b/include/math/vector3.h new file mode 100644 index 0000000..8ad1d03 --- /dev/null +++ b/include/math/vector3.h @@ -0,0 +1,10 @@ +#ifndef VECTOR3_H +#define VECTOR3_H + +typedef struct { + float x, y, z; +} Vec3; + +Vec3* vec3(float x, float y, float z); + +#endif // VECTOR3_H \ No newline at end of file diff --git a/src/math/vector3.c b/src/math/vector3.c new file mode 100644 index 0000000..e469dd4 --- /dev/null +++ b/src/math/vector3.c @@ -0,0 +1,14 @@ +#include +#include + +Vec3* vec3(float x, float y, float z) +{ + Vec3* vec = (Vec3*)malloc(sizeof(Vec3)); + if (!vec) return NULL; + + vec->x = x; + vec->y = y; + vec->z = z; + + return vec; +} \ No newline at end of file