mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-09 12:22:34 +01:00
ba7eb63941
rwengine + Make renderWorld() take a ViewCamera parameter. + add rotation and getView to ViewCamera + correct directions for vehicle and character movement. rwgame + Remove GenericState + Add State::getCamera() to control the ViewCamera used for rendering + Clean up state camera control + Remove now unused view parameters from main
25 lines
587 B
C++
25 lines
587 B
C++
#include <boost/test/unit_test.hpp>
|
|
#include "test_globals.hpp"
|
|
#include <render/GameRenderer.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, 0.f}, 1.f ) );
|
|
BOOST_CHECK(!f.intersects({-10.f, 0.f, 0.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, 10.f, 0.f}, 1.f ) );
|
|
}
|
|
}
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|