summaryrefslogtreecommitdiff
path: root/test/test-network.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-10-25 18:49:19 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-10-28 02:10:47 +0100
commit37b135e59ba22cf9ace1141b9dd21d0819fe3d1d (patch)
tree1b24085262116f04c8869365e50f971af56f7d3d /test/test-network.cpp
parentMove findDir into member function findNodeDirection (diff)
downloadilt-37b135e59ba22cf9ace1141b9dd21d0819fe3d1d.tar.bz2
ilt-37b135e59ba22cf9ace1141b9dd21d0819fe3d1d.tar.xz
ilt-37b135e59ba22cf9ace1141b9dd21d0819fe3d1d.zip
Implement extending a network into open space
Diffstat (limited to 'test/test-network.cpp')
-rw-r--r--test/test-network.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/test-network.cpp b/test/test-network.cpp
index fb4c87c..dc2b52f 100644
--- a/test/test-network.cpp
+++ b/test/test-network.cpp
@@ -19,9 +19,11 @@
#include <vector>
struct TestLink : public LinkStraight {
- TestLink(Node::Ptr a, Node::Ptr b) : TestLink {a, b, glm::distance(a->pos, b->pos)} { }
+ TestLink(Node::Ptr a, Node::Ptr b) : TestLink {a, b, (a->pos - b->pos)} { }
+ TestLink(Node::Ptr a, Node::Ptr b, glm::vec2 l) : Link {{std::move(a), 0}, {std::move(b), pi}, glm::length(l)} { }
TestLink(Node::Ptr a, Node::Ptr b, float l) : Link {{std::move(a), 0}, {std::move(b), pi}, l} { }
using StraightLink = TestLink;
+ using CurveLink = TestLink;
};
constexpr glm::vec3 p000 {0, 0, 0}, p100 {1, 0, 0}, p200 {2, 0, 0}, p300 {3, 0, 0};