From a007ffeed3cfa6af2cbe1053c330ad11927d58de Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 18 Dec 2024 17:24:02 +0000 Subject: Add sanity checking logic to GeoData --- lib/triangle.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/triangle.h') diff --git a/lib/triangle.h b/lib/triangle.h index 888481d..d5547ab 100644 --- a/lib/triangle.h +++ b/lib/triangle.h @@ -83,6 +83,14 @@ struct Triangle : public glm::vec<3, glm::vec> { return 0.F; } + [[nodiscard]] constexpr auto + isUp() const + { + const auto edgeAB = sideDifference(1); + const auto edgeAC = sideDifference(2); + return edgeAB.x * edgeAC.y >= edgeAB.y * edgeAC.x; + } + [[nodiscard]] constexpr auto p(const glm::length_t idx) const { -- cgit v1.2.3