summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-08-10 14:51:25 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-08-10 18:07:41 +0100
commit24572ed66b65adbc8960515689a2976a3488a327 (patch)
treec56cfdea6bffb87f49bc4835c63b14f9030bb6b7 /test
parentCreate standalone composed shader file and format it and the C++ code (diff)
downloadilt-24572ed66b65adbc8960515689a2976a3488a327.tar.bz2
ilt-24572ed66b65adbc8960515689a2976a3488a327.tar.xz
ilt-24572ed66b65adbc8960515689a2976a3488a327.zip
Add a tree to the test render scene
Diffstat (limited to 'test')
-rw-r--r--test/test-render.cpp8
1 files changed, 8 insertions, 0 deletions
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 <assetFactory/assetFactory.h>
#include <game/geoData.h>
#include <game/network/rail.h>
+#include <game/scenary/foliage.h>
+#include <game/scenary/plant.h>
#include <game/terrain.h>
#include <game/vehicles/railVehicle.h>
#include <game/vehicles/railVehicleClass.h>
@@ -25,7 +27,10 @@
class TestScene : public SceneProvider {
const RailVehicleClassPtr brush47rvc = std::dynamic_pointer_cast<RailVehicleClass>(
AssetFactory::loadXML(RESDIR "/brush47.xml")->assets.at("brush-47"));
+ const std::shared_ptr<Foliage> tree021f
+ = std::dynamic_pointer_cast<Foliage>(AssetFactory::loadXML(RESDIR "/foliage.xml")->assets.at("Tree-02-1"));
std::shared_ptr<RailVehicle> train1, train2;
+ std::shared_ptr<Plant> plant1;
RailLinks rail;
std::shared_ptr<GeoData> gd = std::make_shared<GeoData>(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<Plant>(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);
}
};