From b13db9ea3dd6b9ac9f3abd14faa2b41411470fba Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Tue, 7 Jun 2022 16:49:15 +0200 Subject: [PATCH] Fix AABoxCubeTest Set invDirection to the right value now. --- tests/octree/src/AABoxCubeTests.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/octree/src/AABoxCubeTests.cpp b/tests/octree/src/AABoxCubeTests.cpp index 5e2e55eae8..e38c9b4b8d 100644 --- a/tests/octree/src/AABoxCubeTests.cpp +++ b/tests/octree/src/AABoxCubeTests.cpp @@ -27,9 +27,8 @@ void AABoxCubeTests::raycastOutHitsXMinFace() { float distance; BoxFace face; glm::vec3 surfaceNormal; - glm::vec3 invDirection; //FIXME -- what should this be set to? - bool intersects = box.findRayIntersection(origin, direction, invDirection, distance, face, surfaceNormal); + bool intersects = box.findRayIntersection(origin, direction, 1.0f / direction, distance, face, surfaceNormal); QCOMPARE(intersects, true); QCOMPARE(distance, 0.5f); @@ -47,10 +46,8 @@ void AABoxCubeTests::raycastOutHitsXMaxFace () { float distance; BoxFace face; glm::vec3 surfaceNormal; - glm::vec3 invDirection; //FIXME -- what should this be set to? - - bool intersects = box.findRayIntersection(origin, direction, invDirection, distance, face, surfaceNormal); + bool intersects = box.findRayIntersection(origin, direction, 1.0f / direction, distance, face, surfaceNormal); QCOMPARE(intersects, true); QCOMPARE(distance, 0.5f); @@ -67,9 +64,8 @@ void AABoxCubeTests::raycastInHitsXMinFace () { float distance; BoxFace face; glm::vec3 surfaceNormal; - glm::vec3 invDirection; //FIXME -- what should this be set to? - bool intersects = box.findRayIntersection(origin, direction, invDirection, distance, face, surfaceNormal); + bool intersects = box.findRayIntersection(origin, direction, 1.0f / direction, distance, face, surfaceNormal); QCOMPARE(intersects, true); QCOMPARE(distance, 0.25f);