mirror of
https://github.com/guezoloic/t3dsr.git
synced 2026-01-25 09:34:24 +00:00
rework: change struct to full c
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
#include "vec3.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
#ifdef SIMD_X86
|
||||
#include <xmmintrin.h>
|
||||
#elif defined(SIMD_ARCH)
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
|
||||
Vec3f_t vec3f(float x, float y, float z)
|
||||
{
|
||||
Vec3f_t vec = {.x = x, .y = y, .z = z};
|
||||
@@ -160,6 +170,11 @@ float vec3f_dot(Vec3f_t a, Vec3f_t b)
|
||||
#endif
|
||||
}
|
||||
|
||||
float vec3f_len(Vec3f_t v)
|
||||
{
|
||||
return sqrtf(vec3f_dot(v, v));
|
||||
}
|
||||
|
||||
Vec3f_t* vec3f_norm_r(Vec3f_t *__restrict v)
|
||||
{
|
||||
float length = vec3f_len(*v);
|
||||
|
||||
Reference in New Issue
Block a user