diff --git a/include/math/vector.h b/include/math/vector.h new file mode 100644 index 0000000..0be67f8 --- /dev/null +++ b/include/math/vector.h @@ -0,0 +1,10 @@ +#ifndef VECTOR_H +#define VECTOR_H + +#include "math/vector3.h" +#include "math/vector4.h" + +Vec3* Vec4ToVec3(Vec4* v); +Vec4* Vec3ToVec4(Vec3* v); + +#endif // VECTOR_H \ No newline at end of file diff --git a/src/math/vector.c b/src/math/vector.c new file mode 100644 index 0000000..47498d8 --- /dev/null +++ b/src/math/vector.c @@ -0,0 +1,11 @@ +#include "math/vector.h" + +Vec3* Vec4ToVec3(Vec4* v) +{ + return vec3(v->x, v->y, v->z); +} + +Vec4* Vec3ToVec4(Vec3* v) +{ + return vec4(v->x, v->y, v->z, 0); +}