2014-06-17 22:46:54 +02:00
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
#include <render/GameRenderer.hpp>
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE(RendererTests)
|
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(frustum_test_visible) {
|
|
|
|
{
|
|
|
|
ViewFrustum f(0.1f, 100.f, glm::half_pi<float>(), 1.f);
|
2014-08-12 22:15:26 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
f.update(f.projection());
|
2014-06-17 22:46:54 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_CHECK(f.intersects({10.f, 0.f, -10.f}, 1.f));
|
|
|
|
BOOST_CHECK(!f.intersects({0.f, 0.f, 10.f}, 1.f));
|
2014-06-17 22:46:54 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_CHECK(!f.intersects({0.f, 10.f, 0.f}, 1.f));
|
|
|
|
BOOST_CHECK(!f.intersects({0.f, -10.f, 0.f}, 1.f));
|
2014-06-17 22:46:54 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_CHECK(!f.intersects({10.f, 0.f, 0.f}, 1.f));
|
|
|
|
BOOST_CHECK(!f.intersects({-10.f, 0.f, 0.f}, 1.f));
|
2016-05-02 18:38:04 +02:00
|
|
|
|
2016-09-09 22:13:22 +02:00
|
|
|
BOOST_CHECK(f.intersects({10.f, 0.f, -10.f}, 1.f));
|
|
|
|
BOOST_CHECK(f.intersects({-10.f, 0.f, -10.f}, 1.f));
|
|
|
|
}
|
2014-06-17 22:46:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|