diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-22 19:06:42 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-22 19:06:42 +0100 |
commit | d1f79b4c438ebf0822741e103b2cb06bdee4514e (patch) | |
tree | a4d574d12cd81d5e33886ce7ca961f7dbe872fcf /application/main.cpp | |
parent | Rename lots of shader files (diff) | |
parent | Keep the instance unused vector sorted and binary search it (diff) | |
download | ilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.tar.bz2 ilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.tar.xz ilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.zip |
Merge branch 'instancing'
Diffstat (limited to 'application/main.cpp')
-rw-r--r-- | application/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/application/main.cpp b/application/main.cpp index aea3d2e..9feb80b 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -44,9 +44,9 @@ public: windows.create<GameMainWindow>(DISPLAY_WIDTH, DISPLAY_HEIGHT); world.create<Terrain>(geoData); + assets = AssetFactory::loadAll("res"); { - 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}, @@ -79,7 +79,11 @@ public: 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}}); + for (float x = 900; x < 1100; x += 3) { + for (float y = 900; y < 1100; y += 3) { + world.create<Plant>(foliage, Location {geoData->positionAt({-x, -y})}); + } + } } auto t_start = std::chrono::high_resolution_clock::now(); |