From e2fbfb76a9a9ea67dafc89d5262813bb203b8362 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sat, 7 Mar 2026 20:10:09 +0100 Subject: [PATCH] sphere box test --- interfaces/Crafter.Math-Intersection.cppm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interfaces/Crafter.Math-Intersection.cppm b/interfaces/Crafter.Math-Intersection.cppm index b4df8a1..92d151d 100755 --- a/interfaces/Crafter.Math-Intersection.cppm +++ b/interfaces/Crafter.Math-Intersection.cppm @@ -195,13 +195,13 @@ namespace Crafter { export template constexpr bool IntersectionTestSphereOrientatedBox(Vector spherePos, T sphereRadius, Vector boxSize, MatrixRowMajor boxMat) { - Vector d = spherePos - Vector(boxMat[4][0], boxMat[4][1], boxMat[4][2]); + Vector d = spherePos - Vector(boxMat.m[4][0], boxMat.m[4][1], boxMat.m[4][2]); T distSq = 0.0f; for (std::uint32_t i = 0; i < 3; ++i) { - Vector axis(boxMat[i][0], boxMat[i][1], boxMat[i][2]); + Vector axis(boxMat.m[i][0], boxMat.m[i][1], boxMat.m[i][2]); T dist = Vector::Dot(d, axis); T excess = std::fabs(dist) - boxSize.v[i]; excess = std::max(excess, 0.0f);