Commit 126092e1 authored by Julian Schakib's avatar Julian Schakib
Browse files

ray-ray intersection test with eps

parent 88739233
Pipeline #13529 passed with stage
in 6 minutes and 16 seconds
typed-geometry @ f3b9859f
Subproject commit 3fcbf2c6fe9aa9cf40279a2888638e1faaf009e1
Subproject commit f3b9859f95bdc21efe883587360bc6537fb48a6c
......@@ -139,12 +139,12 @@ TG_FUZZ_TEST(TypedGeometry, IntersectionRay3Ray3)
{
// same direction, offset from origin
auto off = uniform(rng, 0.1f, 1.0f);
auto off = uniform(rng, 0.2f, 1.0f);
auto r2 = tg::ray3(r1.origin - r1.dir * off, r1.dir);
CHECK(distance(r2.origin + r2.dir * off, r1.origin) <= tg::epsilon<tg::f32> * 10);
// ray 2 hits origin 1
CHECK(tg::intersects(r1, r2));
CHECK(tg::intersects(r1, r2, tg::epsilon<tg::f32> * 10));
}
{
......@@ -160,7 +160,7 @@ TG_FUZZ_TEST(TypedGeometry, IntersectionRay3Ray3)
{
// flipped direction, offset from origin
// r1 dir flipped too!
auto off = uniform(rng, 0.1f, 1.0f);
auto off = uniform(rng, 0.2f, 1.0f);
auto r2 = tg::ray3(r1.origin - r1.dir * off, -r1.dir); // flipped
// flip r1
......@@ -169,7 +169,7 @@ TG_FUZZ_TEST(TypedGeometry, IntersectionRay3Ray3)
CHECK(distance(r1.origin + r1.dir * off, r2.origin) <= tg::epsilon<tg::f32> * 10);
// ray 1 hits origin 2
CHECK(tg::intersects(r1, r2));
CHECK(tg::intersects(r1, r2, tg::epsilon<tg::f32> * 10));
}
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment