X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=tst%2Fmath%2FIntersectTest.cpp;h=904d682325d89915c8a08d042fa68d82879d75eb;hp=f428aaa59a585ce0f3a84f941ff8df12fe23b3e2;hb=99bac662c454fcf3680fa9c080c90e24319d8d3d;hpb=82c3e2c1e27f05b9617a4da8e4806ace7d38a5e1 diff --git a/tst/math/IntersectTest.cpp b/tst/math/IntersectTest.cpp index f428aaa..904d682 100644 --- a/tst/math/IntersectTest.cpp +++ b/tst/math/IntersectTest.cpp @@ -258,7 +258,7 @@ void IntersectTest::testRaySphereIntersection() { ); // corner case: ray origin exactly on sphere (should "intersect") - ray.Origin({ 1.0, 0.0, 0.0 }); + ray = glm::translate(glm::dvec3(0.5, 0, 0)) * ray; CPPUNIT_ASSERT_MESSAGE( "ray touching sphere does not intersect it", Intersect(ray, sphere, normal, dist) @@ -296,6 +296,7 @@ void IntersectTest::testRaySphereIntersection() { // should be 5 units apart, minus one for the radius ray.Origin({ 0.0, 4.0, 0.0 }); ray.Direction(glm::normalize(glm::dvec3(3.0, -4.0, 0.0))); + sphere = glm::translate(glm::dvec3(3.0, 0, 0)) * sphere; sphere.origin = { 3.0, 0.0, 0.0 }; CPPUNIT_ASSERT_MESSAGE( "diagonal ray does not intersect sphere",