Commit 9f324c85 authored by Julian Schakib's avatar Julian Schakib
Browse files

new tg, more intersection tests for ray and infcone3

parent 12c214c8
Pipeline #13405 passed with stage
in 6 minutes and 38 seconds
typed-geometry @ c2b6cbcb
Subproject commit 142498d69cea6f734ebdeb05c05e6b788f0cb86c
Subproject commit c2b6cbcbb28194a28ac85fab30271060de82edce
......@@ -10,8 +10,8 @@ TG_FUZZ_TEST(TypedGeometry, IntersectionRay3InfCone3)
auto r1 = tg::ray3(uniform(rng, box3), normalize(tg::vec3(uniform(rng, box3))));
auto mirrored = tg::ray3(r1.origin - r1.dir * 0.01f, -r1.dir);
auto cone = tg::inf_cone3(r1.origin, r1.dir, tg::radians(tg::pi_scalar<tg::f32> / 3));
// random cone with random opening angle in (pi / 2, pi / 4]
auto cone = tg::inf_cone3(r1.origin, r1.dir, tg::radians(tg::pi_scalar<tg::f32> / uniform(rng, 2.0f + tg::epsilon<tg::f32> * 10, 4.0f)));
CHECK(tg::intersects(r1, cone));
CHECK(!tg::intersects(mirrored, cone));
......@@ -19,6 +19,17 @@ TG_FUZZ_TEST(TypedGeometry, IntersectionRay3InfCone3)
auto boundaryDir = normalize(cone.opening_dir + tg::any_normal(cone.opening_dir) * tan(cone.opening_angle + eps));
auto borderRay = tg::ray3(cone.apex, boundaryDir);
CHECK(tg::intersects(borderRay, cone));
{
auto boundaryDir = normalize(cone.opening_dir + tg::any_normal(cone.opening_dir) * tan(cone.opening_angle));
auto borderRay = tg::ray3(cone.apex, boundaryDir);
CHECK(tg::intersects(borderRay, cone));
}
// does not intersect boundary but the inside of the cone!
auto innerRay = tg::ray3(cone.apex + cone.opening_dir, cone.opening_dir);
CHECK(!tg::intersects(innerRay, cone));
// CHECK(tg::contains(cone, innerRay.origin));
}
TG_FUZZ_TEST(TypedGeometry, IntersectionRay3Ray3)
......
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