diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-07 17:29:21 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-07 17:29:21 +0000 |
commit | 067ecf8d6dfc9ecf002d3cc92ce7d1574d095ddc (patch) | |
tree | 8c913d4dcf006786df4888e036b3d83f84e87dc8 /game/network/network.impl.h | |
parent | Global positions in network data (diff) | |
download | ilt-067ecf8d6dfc9ecf002d3cc92ce7d1574d095ddc.tar.bz2 ilt-067ecf8d6dfc9ecf002d3cc92ce7d1574d095ddc.tar.xz ilt-067ecf8d6dfc9ecf002d3cc92ce7d1574d095ddc.zip |
Remove PositionxD from Network
Diffstat (limited to 'game/network/network.impl.h')
-rw-r--r-- | game/network/network.impl.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/game/network/network.impl.h b/game/network/network.impl.h index 4acbb6d..f9595ed 100644 --- a/game/network/network.impl.h +++ b/game/network/network.impl.h @@ -54,16 +54,16 @@ NetworkOf<T>::findNodeDirection(Node::AnyCPtr n) const template<typename T> Link::CCollection -NetworkOf<T>::candidateStraight(Position3D n1, Position3D n2) +NetworkOf<T>::candidateStraight(GlobalPosition3D n1, GlobalPosition3D n2) { return {candidateLink<typename T::StraightLink>(n1, n2)}; } template<typename T> Link::CCollection -NetworkOf<T>::candidateJoins(Position3D start, Position3D end) +NetworkOf<T>::candidateJoins(GlobalPosition3D start, GlobalPosition3D end) { - if (glm::distance(start, end) < 2.F) { + if (glm::length(RelativePosition3D(start - end)) < 2000.F) { return {}; } const auto defs = genCurveDef( @@ -75,7 +75,7 @@ NetworkOf<T>::candidateJoins(Position3D start, Position3D end) template<typename T> Link::CCollection -NetworkOf<T>::candidateExtend(Position3D start, Position3D end) +NetworkOf<T>::candidateExtend(GlobalPosition3D start, GlobalPosition3D end) { const auto [cstart, cend, centre] = genCurveDef(start, end, findNodeDirection(candidateNodeAt(start).first)); return {candidateLink<typename T::CurveLink>(cstart, cend, centre)}; @@ -83,16 +83,16 @@ NetworkOf<T>::candidateExtend(Position3D start, Position3D end) template<typename T> Link::CCollection -NetworkOf<T>::addStraight(Position3D n1, Position3D n2) +NetworkOf<T>::addStraight(GlobalPosition3D n1, GlobalPosition3D n2) { return {addLink<typename T::StraightLink>(n1, n2)}; } template<typename T> Link::CCollection -NetworkOf<T>::addJoins(Position3D start, Position3D end) +NetworkOf<T>::addJoins(GlobalPosition3D start, GlobalPosition3D end) { - if (glm::distance(start, end) < 2.F) { + if (glm::length(RelativePosition3D(start - end)) < 2000.F) { return {}; } const auto defs = genCurveDef(start, end, findNodeDirection(nodeAt(start)), findNodeDirection(nodeAt(end))); @@ -103,7 +103,7 @@ NetworkOf<T>::addJoins(Position3D start, Position3D end) template<typename T> Link::CCollection -NetworkOf<T>::addExtend(Position3D start, Position3D end) +NetworkOf<T>::addExtend(GlobalPosition3D start, GlobalPosition3D end) { const auto [cstart, cend, centre] = genCurveDef(start, end, findNodeDirection(nodeAt(start))); return {addLink<typename T::CurveLink>(cstart, cend, centre)}; |