rework: change struct to full c

This commit is contained in:
2025-08-28 21:21:03 +02:00
parent a5a9cc596d
commit 471b21b952
14 changed files with 84 additions and 385 deletions

View File

@@ -1,5 +1,15 @@
#include "vec4.h"
#include <math.h>
#include <float.h>
#ifdef SIMD_X86
#include <xmmintrin.h>
#elif defined(SIMD_ARCH)
#include <arm_neon.h>
#endif
Vec4f_t vec4f(float x, float y, float z, float w)
{
return (Vec4f_t){.x = x, .y = y, .z = z, .w = w};
@@ -161,6 +171,12 @@ float vec4f_dot(Vec4f_t a, Vec4f_t b)
#endif
}
float vec4f_len(Vec4f_t v)
{
return sqrtf(vec4f_dot(v, v));
}
Vec4f_t* vec4f_norm_r(Vec4f_t *__restrict v)
{
float length = vec4f_len(*v);