mirror of
https://github.com/guezoloic/t3dsr.git
synced 2026-01-25 10:34:23 +00:00
feat(vector): Initialize module and add conversion functions
This commit is contained in:
10
include/math/vector.h
Normal file
10
include/math/vector.h
Normal file
@@ -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
|
||||
11
src/math/vector.c
Normal file
11
src/math/vector.c
Normal file
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user