1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 11:52:40 +01:00
openrw/tests/test_renderer.cpp
2016-09-09 21:13:22 +01:00

28 lines
807 B
C++

#include <boost/test/unit_test.hpp>
#include <render/GameRenderer.hpp>
#include "test_globals.hpp"
BOOST_AUTO_TEST_SUITE(RendererTests)
BOOST_AUTO_TEST_CASE(frustum_test_visible) {
{
ViewFrustum f(0.1f, 100.f, glm::half_pi<float>(), 1.f);
f.update(f.projection());
BOOST_CHECK(f.intersects({10.f, 0.f, -10.f}, 1.f));
BOOST_CHECK(!f.intersects({0.f, 0.f, 10.f}, 1.f));
BOOST_CHECK(!f.intersects({0.f, 10.f, 0.f}, 1.f));
BOOST_CHECK(!f.intersects({0.f, -10.f, 0.f}, 1.f));
BOOST_CHECK(!f.intersects({10.f, 0.f, 0.f}, 1.f));
BOOST_CHECK(!f.intersects({-10.f, 0.f, 0.f}, 1.f));
BOOST_CHECK(f.intersects({10.f, 0.f, -10.f}, 1.f));
BOOST_CHECK(f.intersects({-10.f, 0.f, -10.f}, 1.f));
}
}
BOOST_AUTO_TEST_SUITE_END()