summaryrefslogtreecommitdiff
path: root/game/network/network.impl.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-01-13 01:45:43 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2025-01-21 20:58:55 +0000
commit1aba027462a861f2c1155672792dbbe555d7dc0a (patch)
treef406c86cc0c610c05da63fc508d8963f0cb61ba4 /game/network/network.impl.h
parentAdd default Q = glm::defaultp to maths functions (diff)
downloadilt-1aba027462a861f2c1155672792dbbe555d7dc0a.tar.bz2
ilt-1aba027462a861f2c1155672792dbbe555d7dc0a.tar.xz
ilt-1aba027462a861f2c1155672792dbbe555d7dc0a.zip
Add distance helperterrain-for-networks
Works with integer positions, first template param allows forcing to N dimensions
Diffstat (limited to 'game/network/network.impl.h')
-rw-r--r--game/network/network.impl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/game/network/network.impl.h b/game/network/network.impl.h
index ff29088..33b0a86 100644
--- a/game/network/network.impl.h
+++ b/game/network/network.impl.h
@@ -52,7 +52,7 @@ template<typename T, typename... Links>
Link::CCollection
NetworkOf<T, Links...>::candidateJoins(GlobalPosition3D start, GlobalPosition3D end)
{
- if (glm::length(RelativePosition3D(start - end)) < 2000.F) {
+ if (::distance(start, end) < 2000.F) {
return {};
}
const auto defs = genCurveDef(
@@ -81,7 +81,7 @@ template<typename T, typename... Links>
Link::CCollection
NetworkOf<T, Links...>::addJoins(GlobalPosition3D start, GlobalPosition3D end)
{
- if (glm::length(RelativePosition3D(start - end)) < 2000.F) {
+ if (::distance(start, end) < 2000.F) {
return {};
}
const auto defs = genCurveDef(start, end, findNodeDirection(nodeAt(start)), findNodeDirection(nodeAt(end)));