summaryrefslogtreecommitdiff
path: root/lib/ray.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-02-24 01:28:14 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2025-02-24 01:28:14 +0000
commitef08a08617a1541d8aa1862d8bcfe049dcb57998 (patch)
treeabfcb0e0146a29deead395b0a730acaf8b01dc47 /lib/ray.h
parentMerge branch 'terrain-deform-2' (diff)
parentNew hardcoded test rail network (diff)
downloadilt-ef08a08617a1541d8aa1862d8bcfe049dcb57998.tar.bz2
ilt-ef08a08617a1541d8aa1862d8bcfe049dcb57998.tar.xz
ilt-ef08a08617a1541d8aa1862d8bcfe049dcb57998.zip
Merge remote-tracking branch 'origin/terrain-for-networks'
Diffstat (limited to 'lib/ray.h')
-rw-r--r--lib/ray.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/ray.h b/lib/ray.h
index a831270..793e21e 100644
--- a/lib/ray.h
+++ b/lib/ray.h
@@ -27,8 +27,7 @@ public:
const auto n2 = crossProduct(direction, n);
const auto c1 = p1 + PositionType((glm::dot(RelativePosition3D(start - p1), n2) / glm::dot(d1, n2)) * d1);
const auto difflength = glm::length(diff);
- if (glm::length(RelativePosition3D(c1 - p1)) > difflength
- || glm::length(RelativePosition3D(c1 - e1)) > difflength) {
+ if (::distance(c1, p1) > difflength || ::distance(c1, e1) > difflength) {
return std::numeric_limits<typename PositionType::value_type>::infinity();
}
return static_cast<PositionType::value_type>(glm::abs(glm::dot(n, RelativePosition3D(p1 - start))));