From 24572ed66b65adbc8960515689a2976a3488a327 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 10 Aug 2024 14:51:25 +0100 Subject: Add a tree to the test render scene --- test/test-render.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test-render.cpp b/test/test-render.cpp index 2c4efea..b9a809e 100644 --- a/test/test-render.cpp +++ b/test/test-render.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include #include @@ -25,7 +27,10 @@ class TestScene : public SceneProvider { const RailVehicleClassPtr brush47rvc = std::dynamic_pointer_cast( AssetFactory::loadXML(RESDIR "/brush47.xml")->assets.at("brush-47")); + const std::shared_ptr tree021f + = std::dynamic_pointer_cast(AssetFactory::loadXML(RESDIR "/foliage.xml")->assets.at("Tree-02-1")); std::shared_ptr train1, train2; + std::shared_ptr plant1; RailLinks rail; std::shared_ptr gd = std::make_shared(GeoData::createFlat({0, 0}, {1000000, 1000000}, 1)); @@ -43,6 +48,7 @@ public: train2->location.setPosition({52000, 30000, 2000}); train2->bogies.front().setPosition(train2->bogies.front().position() + train2->location.position()); train2->bogies.back().setPosition(train2->bogies.back().position() + train2->location.position()); + plant1 = std::make_shared(tree021f, Location {{40000, 60000, 1}, {}}); rail.addLinksBetween({42000, 50000, 1000}, {65000, 50000, 1000}); rail.addLinksBetween({65000, 50000, 1000}, {75000, 45000, 2000}); } @@ -53,6 +59,7 @@ public: terrain.render(shader); water.render(shader); brush47rvc->render(shader); + tree021f->render(shader); rail.render(shader); } @@ -66,6 +73,7 @@ public: { terrain.shadows(shadowMapper); brush47rvc->shadows(shadowMapper); + tree021f->shadows(shadowMapper); } }; -- cgit v1.2.3