cameras.tests.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #include <planet/camera/target3d.hpp> #include <felspar/test.hpp> namespace { auto const suite = felspar::testsuite("cameras"); auto const t3d = suite.test("target3dxy", [](auto check) { planet::camera::target3dxy camera; planet::affine::point3d p{}; auto const v = camera.view.into(p); check(v.x()) == 0.0f; check(v.y()) == 0.0f; check(v.z()) == -3.0f; check(v.h) == 1.0f; auto const f = camera.perspective.into() * v; check(f.x()) == 0.0f; check(f.y()) == 0.0f; check(f.z()) == 1.0f / 3.0f; }); } |