packed intersection and matrix

This commit is contained in:
Jorijn van der Graaf 2026-05-18 19:57:40 +02:00
commit f0becd1582
7 changed files with 948 additions and 557 deletions

View file

@ -270,12 +270,12 @@ namespace Crafter {
// R0 = up × R2 is linear in R2, so its normalized direction does
// not depend on whether we hand R2 in before or after its own
// normalize. Computing R0_raw from the un-normalized R2 lets us
// satisfy the 4-input Normalize requirement with one batched call
// (duplicating R2 and R0 in the padding slots).
// satisfy the VectorF32<3,1>::BatchSize Normalize requirement with
// one batched call (duplicating R2 and R0 in the padding slots).
VectorF32<3, 1> R0Raw = VectorF32<3, 1>::Cross(upDirection, eyeDirection);
auto normalized = VectorF32<3, 1>::Normalize(eyeDirection, R0Raw, eyeDirection, R0Raw);
VectorF32<3, 1> R2 = std::get<0>(normalized);
VectorF32<3, 1> R0 = std::get<1>(normalized);
VectorF32<3, 1> R2 = normalized[0];
VectorF32<3, 1> R0 = normalized[1];
VectorF32<3, 1> R1 = VectorF32<3, 1>::Cross(R2, R0);
VectorF32<3, 1> negEye = -eyePosition;