mirror of
https://github.com/guezoloic/t3dsr.git
synced 2026-01-25 13:34:24 +00:00
feat(vector): add all basic functions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifndef VECTOR3_H
|
||||
#define VECTOR3_H
|
||||
#ifndef VEC3_H
|
||||
#define VEC3_H
|
||||
|
||||
typedef struct {
|
||||
float x, y, z;
|
||||
@@ -7,4 +7,22 @@ typedef struct {
|
||||
|
||||
Vec3* vec3(float x, float y, float z);
|
||||
|
||||
#endif // VECTOR3_H
|
||||
Vec3* vec3Add(Vec3* v1, Vec3* v2);
|
||||
Vec3* vec3Sub(Vec3* v1, Vec3* v2);
|
||||
Vec3* vec3Scale(Vec3* v, float scalar);
|
||||
|
||||
float vec3Dot(Vec3* a, Vec3* b);
|
||||
float vec3Len(Vec3* v);
|
||||
|
||||
Vec3* vec3Norm(Vec3* v);
|
||||
Vec3* vec3Lerp(Vec3* a, Vec3* b, float t);
|
||||
Vec3* vec3Cross(Vec3* a, Vec3* b);
|
||||
float vec3Angle(Vec3* a, Vec3* b);
|
||||
Vec3* vec3Proj(Vec3* a, Vec3* b);
|
||||
Vec3* vec3Refl(Vec3* v, Vec3* normal);
|
||||
float vec3Dist(Vec3* a, Vec3* b);
|
||||
Vec3* vec3Rotate(Vec3* v, Vec3* axis, float angle);
|
||||
|
||||
void vec3Free(Vec3* v);
|
||||
|
||||
#endif // VEC3_H
|
||||
Reference in New Issue
Block a user