From f3f926c97efe365afecd54d06d830961376bae30 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 17 Dec 2023 18:56:23 +0000 Subject: Use new calc types in geoData --- game/geoData.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/game/geoData.cpp b/game/geoData.cpp index e2b7f66..97f4a26 100644 --- a/game/geoData.cpp +++ b/game/geoData.cpp @@ -120,7 +120,8 @@ namespace { [[nodiscard]] constexpr inline auto pointLineOp(const GlobalPosition2D p, const GlobalPosition2D e1, const GlobalPosition2D e2) { - return Op {}(int64_t(e2.x - e1.x) * int64_t(p.y - e1.y), int64_t(e2.y - e1.y) * int64_t(p.x - e1.x)); + return Op {}(CalcDistance(e2.x - e1.x) * CalcDistance(p.y - e1.y), + CalcDistance(e2.y - e1.y) * CalcDistance(p.x - e1.x)); } constexpr auto pointLeftOfLine = pointLineOp; @@ -159,7 +160,7 @@ namespace { constexpr GlobalPosition3D positionOnTriangle(const GlobalPosition2D point, const GeoData::Triangle<3> & t) { - const glm::vec<3, int64_t> a = t[1] - t[0], b = t[2] - t[0]; + const CalcPosition3D a = t[1] - t[0], b = t[2] - t[0]; const auto n = crossInt(a, b); return {point, ((n.x * t[0].x) + (n.y * t[0].y) + (n.z * t[0].z) - (n.x * point.x) - (n.y * point.y)) / n.z}; } -- cgit v1.2.3