From 582ac127f763f512c45f35e17b768487e3b51796 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 4 Nov 2023 17:07:58 +0000 Subject: Rename TerrainMesh to GeoData to drop inplace --- application/main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'application') diff --git a/application/main.cpp b/application/main.cpp index 532c23d..9e4ca33 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -34,11 +34,11 @@ static const int DISPLAY_HEIGHT = 1024; class MainApplication : public GameState, public ApplicationBase { public: using Windows = Collection; + int run() { - geoData = std::make_shared(GeoData::Limits {{-120, -120}, {120, 120}}, 10.F); - geoData->generateRandom(); + geoData = std::make_shared(GeoData::loadFromAsciiGrid("test/fixtures/height/SD19.asc")); Windows windows; windows.create(DISPLAY_WIDTH, DISPLAY_HEIGHT); @@ -78,12 +78,12 @@ public: train->orders.create(&train->orders, l3->ends[1], l3->length, rl->findNodeAt({-1100, -450, 15})); train->currentActivity = train->orders.current()->createActivity(); - auto foliage = std::dynamic_pointer_cast(assets.at("Tree-01-1")); - for (float x = 900; x < 1100; x += 3) { - for (float y = 900; y < 1100; y += 3) { - world.create(foliage, Location {geoData->positionAt({-x, -y})}); - } - } + // auto foliage = std::dynamic_pointer_cast(assets.at("Tree-01-1")); + // for (float x = 900; x < 1100; x += 3) { + // for (float y = 900; y < 1100; y += 3) { + // world.create(foliage, Location {terrainMesh->positionAt(glm::vec2 {-x, -y})}); + //} + //} } auto t_start = std::chrono::high_resolution_clock::now(); -- cgit v1.2.3 From d6e99a696aa582b81018078b68f6600c8030d643 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 7 Nov 2023 02:51:42 +0000 Subject: WIP typedefing all the things - headers --- application/main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'application') diff --git a/application/main.cpp b/application/main.cpp index 0e880c0..ffdaf63 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -26,7 +26,6 @@ #include #include #include -#include static const int DISPLAY_WIDTH = 1280; static const int DISPLAY_HEIGHT = 1024; @@ -49,10 +48,10 @@ public: { auto rl = world.create(); - const glm::vec3 j {-1120, -1100, 3}, k {-1100, -1000, 15}, l {-1000, -800, 20}, m {-900, -600, 30}, + const Position3D 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}, r {-925, -1075, 10}; - const glm::vec3 s {-1100, -500, 15}, t {-1100, -450, 15}, u {-1000, -400, 15}; + const Position3D s {-1100, -500, 15}, t {-1100, -450, 15}, u {-1000, -400, 15}; auto l3 = rl->addLinksBetween(j, k); rl->addLinksBetween(k, l); rl->addLinksBetween(l, m); -- cgit v1.2.3 From 685b33980cc7a346574b24732464f0cbe3115a1f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 15 Nov 2023 01:29:24 +0000 Subject: Switch to millimeters for spatial units Mostly a case of changing far too many magic numbers, something else to fix I guess. I probably missed something. Also there's some hackery when loading 3D models, which are still assumed to be in metres. --- application/main.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'application') diff --git a/application/main.cpp b/application/main.cpp index ffdaf63..01e6561 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -37,7 +37,7 @@ public: int run() { - geoData = std::make_shared(GeoData::Limits {{-120, -120}, {120, 120}}, 10.F); + geoData = std::make_shared(GeoData::Limits {{-120, -120}, {120, 120}}, 10000.F); geoData->generateRandom(); Windows windows; @@ -48,10 +48,10 @@ public: { auto rl = world.create(); - const Position3D 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}, - r {-925, -1075, 10}; - const Position3D s {-1100, -500, 15}, t {-1100, -450, 15}, u {-1000, -400, 15}; + const Position3D j {-1120000, -1100000, 3000}, k {-1100000, -1000000, 15000}, l {-1000000, -800000, 20000}, + m {-900000, -600000, 30000}, n {-600000, -500000, 32000}, o {-500000, -800000, 30000}, + p {-600000, -900000, 25000}, q {-1025000, -1175000, 10000}, r {-925000, -1075000, 10000}; + const Position3D s {-1100000, -500000, 15000}, t {-1100000, -450000, 15000}, u {-1000000, -400000, 15000}; auto l3 = rl->addLinksBetween(j, k); rl->addLinksBetween(k, l); rl->addLinksBetween(l, m); @@ -75,12 +75,13 @@ public: train->create(b47); } train->orders.removeAll(); - train->orders.create(&train->orders, l3->ends[1], l3->length, rl->findNodeAt({-1100, -450, 15})); + train->orders.create( + &train->orders, l3->ends[1], l3->length, rl->findNodeAt({-1100000, -450000, 15000})); train->currentActivity = train->orders.current()->createActivity(); auto foliage = std::dynamic_pointer_cast(assets.at("Tree-01-1")); - for (float x = 900; x < 1100; x += 3) { - for (float y = 900; y < 1100; y += 3) { + for (float x = 900000; x < 1100000; x += 3000) { + for (float y = 900000; y < 1100000; y += 3000) { world.create(foliage, Location {geoData->positionAt({-x, -y})}); } } -- cgit v1.2.3 From 4c4328d6091ff467fd590c1cc1dc9435c920f6a7 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 25 Nov 2023 14:08:02 +0000 Subject: Spread the trees out --- application/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application') diff --git a/application/main.cpp b/application/main.cpp index 01e6561..e4e71c7 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -80,8 +80,8 @@ public: train->currentActivity = train->orders.current()->createActivity(); auto foliage = std::dynamic_pointer_cast(assets.at("Tree-01-1")); - for (float x = 900000; x < 1100000; x += 3000) { - for (float y = 900000; y < 1100000; y += 3000) { + for (float x = 900000; x < 1100000; x += 5000) { + for (float y = 900000; y < 1100000; y += 5000) { world.create(foliage, Location {geoData->positionAt({-x, -y})}); } } -- cgit v1.2.3 From 8b5dc3a7faaf0e00135f30ddf96fd4d0cdac324e Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 26 Nov 2023 19:02:17 +0000 Subject: Restore some trees --- application/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'application') diff --git a/application/main.cpp b/application/main.cpp index 5db2539..600bbe3 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -78,12 +78,12 @@ public: &train->orders, l3->ends[1], l3->length, rl->findNodeAt({-1100000, -450000, 15000})); train->currentActivity = train->orders.current()->createActivity(); - // auto foliage = std::dynamic_pointer_cast(assets.at("Tree-01-1")); - // for (float x = 900000; x < 1100000; x += 5000) { - // for (float y = 900000; y < 1100000; y += 5000) { - // world.create(foliage, Location {geoData->positionAt({{-x, -y}})}); - //} - //} + auto foliage = std::dynamic_pointer_cast(assets.at("Tree-01-1")); + for (auto x = 311000000; x < 311830000; x += 5000) { + for (auto y = 491100000; y < 491130000; y += 5000) { + world.create(foliage, Location {geoData->positionAt({{x, y}})}); + } + } } auto t_start = std::chrono::high_resolution_clock::now(); -- cgit v1.2.3 From 69e6b7d2d349dcc42d2d415a72181ba729d5a19d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 1 Jan 2024 15:53:54 +0000 Subject: Remove more use of legacy types --- application/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'application') diff --git a/application/main.cpp b/application/main.cpp index 600bbe3..adaec9b 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -47,10 +47,11 @@ public: { auto rl = world.create(); - const Position3D j {-1120000, -1100000, 3000}, k {-1100000, -1000000, 15000}, l {-1000000, -800000, 20000}, - m {-900000, -600000, 30000}, n {-600000, -500000, 32000}, o {-500000, -800000, 30000}, - p {-600000, -900000, 25000}, q {-1025000, -1175000, 10000}, r {-925000, -1075000, 10000}; - const Position3D s {-1100000, -500000, 15000}, t {-1100000, -450000, 15000}, u {-1000000, -400000, 15000}; + const GlobalPosition3D j {-1120000, -1100000, 3000}, k {-1100000, -1000000, 15000}, + l {-1000000, -800000, 20000}, m {-900000, -600000, 30000}, n {-600000, -500000, 32000}, + o {-500000, -800000, 30000}, p {-600000, -900000, 25000}, q {-1025000, -1175000, 10000}, + r {-925000, -1075000, 10000}, s {-1100000, -500000, 15000}, t {-1100000, -450000, 15000}, + u {-1000000, -400000, 15000}; auto l3 = rl->addLinksBetween(j, k); rl->addLinksBetween(k, l); rl->addLinksBetween(l, m); -- cgit v1.2.3