add normal safety

wrap safety around normal checks, this was done on the scalar math may as well do it here just in case.

Ad the impl.inl files to libraries so they can actually be found.
This commit is contained in:
marauder2k7 2026-03-04 23:49:08 +00:00
parent 5a6467d54a
commit 8c1acbd1da
7 changed files with 61 additions and 14 deletions

View file

@ -85,9 +85,8 @@ namespace math_backend::float3
inline void float3_normalize_impl(float* a)
{
f32x4 va = v_load3_vec(a);
f32x4 invLen = v_rsqrt_nr(v_dot3(va, va)); // fully abstracted
f32x4 vnorm = v_mul(va, invLen);
v_store3(a, vnorm);
f32x4 vr = v_normalize3(va);
v_store3(a, vr);
}
// Normalize with magnitude: r = normalize(a) * r