diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test-maths.cpp | 10 | ||||
-rw-r--r-- | test/test-render.cpp | 6 |
2 files changed, 7 insertions, 9 deletions
diff --git a/test/test-maths.cpp b/test/test-maths.cpp index 70cf206..d6c0fc1 100644 --- a/test/test-maths.cpp +++ b/test/test-maths.cpp @@ -256,7 +256,7 @@ BOOST_AUTO_TEST_CASE(camera_clicks) { Camera camera {::origin, ::half_pi, 1.25F, .1F, 10000.F}; constexpr float centre {0.5F}, right {0.9F}, left {0.1F}, top {1.F}, bottom {0.F}; - camera.forward = ::north; + camera.setForward(::north); BOOST_CHECK_EQUAL(camera.unProject({centre, centre}).start, ::origin); BOOST_CHECK_CLOSE_VEC(camera.unProject({centre, centre}).direction, ::north); BOOST_CHECK_CLOSE_VEC(camera.unProject({left, centre}).direction, glm::normalize(::north + ::west)); @@ -268,20 +268,20 @@ BOOST_AUTO_TEST_CASE(camera_clicks) BOOST_CHECK_CLOSE_VEC(camera.unProject({left, bottom}).direction, glm::normalize(::north + ::west + ::down)); BOOST_CHECK_CLOSE_VEC(camera.unProject({right, bottom}).direction, glm::normalize(::north + ::east + ::down)); - camera.forward = ::east; + camera.setForward(::east); BOOST_CHECK_CLOSE_VEC(camera.unProject({centre, centre}).direction, ::east); BOOST_CHECK_CLOSE_VEC(camera.unProject({left, centre}).direction, glm::normalize(::north + ::east)); BOOST_CHECK_CLOSE_VEC(camera.unProject({right, centre}).direction, glm::normalize(::south + ::east)); - camera.forward = glm::normalize(::north + ::down); + camera.setForward(glm::normalize(::north + ::down)); BOOST_CHECK_CLOSE_VEC(camera.unProject({centre, centre}).direction, glm::normalize(::north + ::down)); BOOST_CHECK_CLOSE_VEC(camera.unProject({centre, top}).direction, glm::normalize(::north)); - camera.forward = glm::normalize(::north + ::west + ::down); + camera.setForward(glm::normalize(::north + ::west + ::down)); BOOST_CHECK_CLOSE_VEC(camera.unProject({centre, centre}).direction, glm::normalize(::north + ::west + ::down)); BOOST_CHECK_CLOSE_VEC(camera.unProject({centre, top}).direction, glm::normalize(::north + ::west + ::up * 0.2F)); - camera.forward = glm::normalize(::north + ::west); + camera.setForward(glm::normalize(::north + ::west)); BOOST_CHECK_CLOSE_VEC(camera.unProject({centre, centre}).direction, glm::normalize(::north + ::west)); BOOST_CHECK_CLOSE_VEC(camera.unProject({centre, top}).direction, glm::normalize(::north + ::west + ::up * 1.2F)); BOOST_CHECK_CLOSE_VEC(camera.unProject({right, centre}).direction, glm::normalize(::north)); diff --git a/test/test-render.cpp b/test/test-render.cpp index d6e4094..77501ac 100644 --- a/test/test-render.cpp +++ b/test/test-render.cpp @@ -100,8 +100,7 @@ BOOST_FIXTURE_TEST_SUITE(w, TestRenderOutput); BOOST_AUTO_TEST_CASE(basic) { SceneRenderer ss {size, output}; - ss.camera.pos = {-10, -10, 60}; - ss.camera.forward = glm::normalize(glm::vec3 {1, 1, -0.5F}); + ss.camera.setView({-10, -10, 60}, glm::normalize(glm::vec3 {1, 1, -0.5F})); TestScene scene; ss.render(scene); glDisable(GL_DEBUG_OUTPUT); @@ -111,8 +110,7 @@ BOOST_AUTO_TEST_CASE(basic) BOOST_AUTO_TEST_CASE(pointlight) { SceneRenderer ss {size, output}; - ss.camera.pos = {-10, -10, 60}; - ss.camera.forward = glm::normalize(glm::vec3 {1, 1, -0.5F}); + ss.camera.setView({-10, -10, 60}, glm::normalize(glm::vec3 {1, 1, -0.5F})); class PointLightScene : public TestScene { public: void |