Add missing findRayIntersection arguments

This commit is contained in:
Dale Glass 2022-06-06 23:25:30 +02:00
parent c4ecd39d70
commit f285cb4259

View file

@ -20,16 +20,17 @@ void AABoxCubeTests::raycastOutHitsXMinFace() {
// Raycast inside out
glm::vec3 corner(0.0f, 0.0f, 0.0f);
float size = 1.0f;
AABox box(corner, size);
glm::vec3 origin(0.5f, 0.5f, 0.5f);
glm::vec3 direction(-1.0f, 0.0f, 0.0f);
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, distance, face, surfaceNormal);
QCOMPARE(intersects, true);
QCOMPARE(distance, 0.5f);
QCOMPARE(face, MIN_X_FACE);
@ -39,15 +40,17 @@ void AABoxCubeTests::raycastOutHitsXMaxFace () {
// Raycast inside out
glm::vec3 corner(0.0f, 0.0f, 0.0f);
float size = 1.0f;
AABox box(corner, size);
glm::vec3 origin(0.5f, 0.5f, 0.5f);
glm::vec3 direction(1.0f, 0.0f, 0.0f);
float distance;
BoxFace face;
glm::vec3 surfaceNormal;
glm::vec3 invDirection; //FIXME -- what should this be set to?
bool intersects = box.findRayIntersection(origin, direction, distance, face, surfaceNormal);
bool intersects = box.findRayIntersection(origin, direction, invDirection, distance, face, surfaceNormal);
QCOMPARE(intersects, true);
QCOMPARE(distance, 0.5f);
@ -57,15 +60,16 @@ void AABoxCubeTests::raycastInHitsXMinFace () {
// Raycast outside in
glm::vec3 corner(0.5f, 0.0f, 0.0f);
float size = 0.5f;
AABox box(corner, size);
glm::vec3 origin(0.25f, 0.25f, 0.25f);
glm::vec3 direction(1.0f, 0.0f, 0.0f);
float distance;
BoxFace face;
glm::vec3 surfaceNormal;
glm::vec3 invDirection; //FIXME -- what should this be set to?
bool intersects = box.findRayIntersection(origin, direction, distance, face, surfaceNormal);
bool intersects = box.findRayIntersection(origin, direction, invDirection, distance, face, surfaceNormal);
QCOMPARE(intersects, true);
QCOMPARE(distance, 0.25f);