From 37b135e59ba22cf9ace1141b9dd21d0819fe3d1d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 25 Oct 2022 18:49:19 +0100 Subject: Implement extending a network into open space --- game/network/network.impl.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'game/network/network.impl.h') diff --git a/game/network/network.impl.h b/game/network/network.impl.h index cee8155..859d1ac 100644 --- a/game/network/network.impl.h +++ b/game/network/network.impl.h @@ -68,9 +68,10 @@ NetworkOf::candidateJoins(glm::vec3 n1, glm::vec3 n2) template Link::CCollection -NetworkOf::candidateExtend(glm::vec3 n1, glm::vec3 n2) +NetworkOf::candidateExtend(glm::vec3 start, glm::vec3 end) { - return {candidateLink(n1, n2)}; + const auto [cstart, cend, centre] = genCurveDef(start, end, findNodeDirection(candidateNodeAt(start).first)); + return {candidateLink(cstart, cend, centre)}; } template @@ -89,7 +90,8 @@ NetworkOf::addJoins(glm::vec3 n1, glm::vec3 n2) template Link::CCollection -NetworkOf::addExtend(glm::vec3 n1, glm::vec3 n2) +NetworkOf::addExtend(glm::vec3 start, glm::vec3 end) { - return {addLink(n1, n2)}; + const auto [cstart, cend, centre] = genCurveDef(start, end, findNodeDirection(nodeAt(start))); + return {addLink(cstart, cend, centre)}; } -- cgit v1.2.3