diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-14 18:03:34 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-14 18:03:34 +0100 |
commit | 5776a36b454fac04617313da011d7aa2b0e834d3 (patch) | |
tree | 1eb96d07e9a17a51e5763f397fc003f762cd2e75 /application/main.cpp | |
parent | Merge branch 'model-factory-textures' (diff) | |
parent | Add an asset template and use it to define all the foliage assets in the plan... (diff) | |
download | ilt-5776a36b454fac04617313da011d7aa2b0e834d3.tar.bz2 ilt-5776a36b454fac04617313da011d7aa2b0e834d3.tar.xz ilt-5776a36b454fac04617313da011d7aa2b0e834d3.zip |
Merge branch 'assimp'
Diffstat (limited to 'application/main.cpp')
-rw-r--r-- | application/main.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/application/main.cpp b/application/main.cpp index 1f91dab..aea3d2e 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -1,4 +1,5 @@ #include <array> +#include <assetFactory/assetFactory.h> #include <chrono> #include <collection.hpp> #include <game/activities/go.h> @@ -11,6 +12,8 @@ #include <game/objective.h> #include <game/objectives/goto.h> #include <game/orders.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> @@ -43,6 +46,7 @@ public: world.create<Terrain>(geoData); { + const auto assets = AssetFactory::loadAll("res"); auto rl = world.create<RailLinks>(); const glm::vec3 j {-1120, -1100, 3}, k {-1100, -1000, 15}, l {-1000, -800, 20}, m {-900, -600, 30}, n {-600, -500, 32}, o {-500, -800, 30}, p {-600, -900, 25}, q {-1025, -1175, 10}, @@ -66,13 +70,16 @@ public: rl->addLinksBetween(t, u); rl->addLinksBetween(u, m); const std::shared_ptr<Train> train = world.create<Train>(l3); - auto b47 = std::make_shared<RailVehicleClass>("brush47"); + auto b47 = std::dynamic_pointer_cast<RailVehicleClass>(assets.at("brush-47")); for (int N = 0; N < 6; N++) { train->create<RailVehicle>(b47); } train->orders.removeAll(); train->orders.create<GoTo>(&train->orders, l3->ends[1], l3->length, rl->findNodeAt({-1100, -450, 15})); train->currentActivity = train->orders.current()->createActivity(); + + auto foliage = std::dynamic_pointer_cast<Foliage>(assets.at("Tree-01-1")); + world.create<Plant>(foliage, Location {{-1100, -1100, 0}}); } auto t_start = std::chrono::high_resolution_clock::now(); |