From a7e19d4ea8662dbadb4ce04e3e7d3047d9c41e92 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 28 Feb 2021 13:27:54 +0000 Subject: Just use addLinksBetween --- application/main.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/application/main.cpp b/application/main.cpp index 49b7cda..2f37c59 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -1,6 +1,8 @@ #include +#include #include #include +#include #include #include #include @@ -16,6 +18,7 @@ #include #include #include +#include #include static const int DISPLAY_WIDTH = 1280; @@ -65,20 +68,17 @@ public: auto rl = world.create(); { - const glm::vec3 j {-1100, 15, -1100}, k {-1100, 15, -1000}, l {-1150, 10, -1050}, m {-1050, 10, -1050}; - rl->addLink(j, k); + const glm::vec3 j {-1100, 15, -1100}, k {-1100, 15, -1000}; + auto l3 = rl->addLinksBetween(j, k); auto e = rl->addLinksBetween(k, {-1000, 20, -800})->ends[1].first->pos; e = rl->addLinksBetween(e, {-900, 30, -600})->ends[0].first->pos; e = rl->addLinksBetween(e, {-600, 32, -500})->ends[1].first->pos; e = rl->addLinksBetween(e, {-500, 30, -800})->ends[1].first->pos; e = rl->addLinksBetween(e, {-600, 25, -900})->ends[1].first->pos; - e = rl->addLinksBetween(e, {-1000, 10, -1129})->ends[0].first->pos; - e = rl->addLinksBetween(e, j)->ends[0].first->pos; - rl->addLink(l, k, glm::vec2 {l.x, k.z}); - auto l3 = rl->addLink(l, m); - rl->addLink(m, j, glm::vec2 {m.x, j.z}); - rl->addLink(k, m, glm::vec2 {m.x, k.z}); - rl->addLink(j, l, glm::vec2 {l.x, j.z}); + auto e1 = rl->addLinksBetween(e, {-1025, 10, -1175})->ends[0].first->pos; + rl->addLinksBetween(e1, j); + auto e2 = rl->addLinksBetween(e, {-925, 10, -1075})->ends[0].first->pos; + rl->addLinksBetween(e2, j); auto loco = world.create(l3); for (int n = 0; n < 6; n++) { loco->wagons.push_back(world.create(l3)); -- cgit v1.2.3