diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-12-18 17:24:02 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-12-18 17:24:02 +0000 |
commit | a007ffeed3cfa6af2cbe1053c330ad11927d58de (patch) | |
tree | 8b97f30bda1e49ee12191e11f68145b2c4dc5e88 /game/geoData.cpp | |
parent | Midpoint for integral vectors (diff) | |
download | ilt-a007ffeed3cfa6af2cbe1053c330ad11927d58de.tar.bz2 ilt-a007ffeed3cfa6af2cbe1053c330ad11927d58de.tar.xz ilt-a007ffeed3cfa6af2cbe1053c330ad11927d58de.zip |
Add sanity checking logic to GeoData
Diffstat (limited to 'game/geoData.cpp')
-rw-r--r-- | game/geoData.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp index 8e662b3..eef5dc7 100644 --- a/game/geoData.cpp +++ b/game/geoData.cpp @@ -601,3 +601,13 @@ GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip, const updateAllVertexNormals(newOrChangedVerts); } + +void +GeoData::sanityCheck() const +{ + if (!std::ranges::all_of(faces(), [this](const auto face) { + return triangle<2>(face).isUp(); + })) { + throw std::logic_error("Upside down faces detected"); + } +} |