Commit 601bcf81 authored by Aaron Grabowy's avatar Aaron Grabowy
Browse files

Added tests for project onto box

parent 7dac2226
Pipeline #13110 failed with stage
in 6 minutes and 39 seconds
typed-geometry @ a0e8302a
Subproject commit 35bf44935908ad139efe538384ea704e6ff6117b
Subproject commit a0e8302a24a969b41bf90636d5189680928369eb
......@@ -67,6 +67,20 @@ TG_FUZZ_TEST_MAX_ITS(TypedGeometry, Project, 20)
const auto axis0 = tg::segment3(pos30, pos31);
const auto disk0 = tg::disk3(pos30, r, n3);
auto d20 = tg::uniform<tg::dir2>(rng);
auto d21 = tg::perpendicular(d20);
auto m2 = tg::mat2();
m2[0] = d20 * uniform(rng, 1.0f, 3.0f);
m2[1] = d21 * uniform(rng, 1.0f, 3.0f);
auto d30 = tg::uniform<tg::dir3>(rng);
auto d31 = any_normal(d30);
auto d32 = normalize(cross(d30, d31));
auto m3 = tg::mat3();
m3[0] = d30 * uniform(rng, 1.0f, 3.0f);
m3[1] = d31 * uniform(rng, 1.0f, 3.0f);
m3[2] = d32 * uniform(rng, 1.0f, 3.0f);
// aabb
test_obj(p1, tg::aabb1(minPos1, maxPos1));
test_obj(p2, tg::aabb2(minPos2, maxPos2));
......@@ -77,7 +91,9 @@ TG_FUZZ_TEST_MAX_ITS(TypedGeometry, Project, 20)
test_obj(p2, tg::ball2(pos20, r));
test_obj(p3, tg::ball3(pos30, r));
test_obj(p4, tg::ball4(pos40, r));
// TODO: box once implemented
// box
test_obj(p2, tg::box2(pos20, m2));
test_obj(p3, tg::box3(pos30, m3));
// capsule
test_obj(p3, tg::capsule3(axis0, r));
// circle
......
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