From 033797264ff58a1994765d7b99cf07be657a226e Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 6 Feb 2021 16:54:54 +0000 Subject: Fix up the maths in creating curved rails --- application/main.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'application') diff --git a/application/main.cpp b/application/main.cpp index a723b20..73d4440 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -1,8 +1,6 @@ #include -#include #include #include -#include #include #include #include @@ -14,9 +12,9 @@ #include #include #include +#include #include #include -#include #include #include @@ -66,11 +64,22 @@ public: Worker w; world.create(); + auto rl = world.create(); - auto a = rl->addLink({-1190, 5, -1190}, {-1190, 6, -1180}); - auto b = rl->addLink(a->ends.back().first->pos, {-1180, 5, -1180}, {-1185, -1180}); - auto c = rl->addLink(b->ends.back().first->pos, {-1180, 4, -1190}); - rl->addLink(c->ends.back().first->pos, a->ends.front().first->pos, {-1185, -1190}); + { + const glm::vec3 j {-1100, 5, -1100}, k {-1100, 5, -1000}, l {-1150, 10, -1050}, m {-1050, 10, -1050}; + rl->addLink(j, k); + rl->addLink(k, l, {l.x, k.z}); + rl->addLink(l, m); + rl->addLink(j, m, {m.x, j.z}); + } + { + const glm::vec3 j {-1190, 5, -1190}, k {-1190, 6, -1180}, l {-1180, 4, -1180}, m {-1180, 4, -1190}; + rl->addLink(j, k); + rl->addLink(l, k, {-1185, k.z}); + rl->addLink(l, m); + rl->addLink(j, m, {-1185, m.z}); + } Shader shader; Camera camera({-1250.0F, 35.0F, -1250.0F}, 70.0F, (float)DISPLAY_WIDTH / (float)DISPLAY_HEIGHT, 0.1F, 10000.0F); -- cgit v1.2.3