Skip to content
Snippets Groups Projects
Commit 8d29e1b6 authored by Aaron Grabowy's avatar Aaron Grabowy
Browse files

Added ray intersection tests for capsule, cylinder, and hemisphere

parent 406819b7
No related branches found
No related tags found
1 merge request!40Tests for ray/line - object intersections
Pipeline #15773 failed
typed-geometry @ 554dc026
Subproject commit 3a9f8048463c4ce8197fae53a12d2c4e0f151454
Subproject commit 554dc0264512b88aaa64c3215bc3bcd9d8f90492
......@@ -81,7 +81,6 @@ TG_FUZZ_TEST(Ray, Intersect)
CHECK(contains(obj, ray[iBounds.value()], tolerance));
}
};
(void)test_obj_and_boundary_no_caps; // TODO: Remove
const auto r = uniform(rng, 0.0f, 10.0f);
const auto h = uniform(rng, 0.0f, 10.0f);
......@@ -148,14 +147,20 @@ TG_FUZZ_TEST(Ray, Intersect)
test_obj_and_boundary(ray1, tg::box1(pos10, m1));
test_obj_and_boundary(ray2, tg::box2(pos20, m2));
test_obj_and_boundary(ray3, tg::box3(pos30, m3));
// capsule
test_obj_and_boundary(ray3, tg::capsule3(axis0, r));
// cylinder
// test_obj(ray3, tg::cylinder_boundary<3, float>(axis0, r));
test_obj(ray3, tg::cylinder_boundary_no_caps<3, float>(axis0, r));
test_obj_and_boundary_no_caps(ray3, tg::cylinder<3, float>(axis0, r));
// halfspace
test_solid_obj(ray1, tg::halfspace1(n1, h));
test_solid_obj(ray2, tg::halfspace2(n2, h));
test_solid_obj(ray3, tg::halfspace3(n3, h));
test_solid_obj(ray4, tg::halfspace4(n4, h));
// hemisphere
test_obj_and_boundary_no_caps(ray1, tg::hemisphere1(pos10, r, n1));
test_obj_and_boundary_no_caps(ray2, tg::hemisphere2(pos20, r, n2));
test_obj_and_boundary_no_caps(ray3, tg::hemisphere3(pos30, r, n3));
// test_obj_and_boundary_no_caps(ray4, tg::hemisphere4(pos40, r, n4));
// line
test_obj(ray2, tg::line2(pos20, n2));
// plane
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment