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 "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);