feat: add lookAt function

This commit is contained in:
2025-08-29 21:40:30 +02:00
parent d94ccfbbaa
commit e056058ba3
5 changed files with 105 additions and 44 deletions

View File

@@ -9,29 +9,33 @@
#define vec3_h
#ifndef SIMD
#if defined(__x86_64__) || defined(__amd64__) || defined(_M_X64)
#define SIMD_X86
#include <xmmintrin.h>
#elif defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64)
#define SIMD_ARCH
#include <arm_neon.h>
#else
#endif
#define SIMD
#endif
#ifndef ALIGN16_VEC
#ifdef _MSC_VER
#define ALIGN16 __declspec(align(16))
#define ALIGN16_VEC __declspec(align(16))
#else
#define ALIGN16 __attribute__((aligned(16)))
#define ALIGN16_VEC __attribute__((aligned(16)))
#endif
#endif
#define VEC_SIZE 3
typedef union {
struct { float x, y, z; };
float data[4];
} ALIGN16 Vec3f_t;
} ALIGN16_VEC Vec3f_t;
Vec3f_t vec3f_from_array(const float *__restrict val);
Vec3f_t vec3f(float x, float y, float z);