diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-12-18 16:03:47 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-12-18 16:03:47 +0000 |
commit | 8185a79abb71aa6ad0d3ca3719047372440291c4 (patch) | |
tree | 63b32569f5b5925664eff15403c041c84ec8b4ef | |
parent | Don't make arbitrary changes to mesh for triangle boundaries (diff) | |
download | ilt-8185a79abb71aa6ad0d3ca3719047372440291c4.tar.bz2 ilt-8185a79abb71aa6ad0d3ca3719047372440291c4.tar.xz ilt-8185a79abb71aa6ad0d3ca3719047372440291c4.zip |
Don't cut internal boundaries
Existing terrain contains enough nodes, assumes input surface is flat.
For non-flat requires, submit several surfaces.
-rw-r--r-- | game/geoData.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp index 643b24b..8e662b3 100644 --- a/game/geoData.cpp +++ b/game/geoData.cpp @@ -537,12 +537,12 @@ GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip, const } }; auto doBoundary = [&doBoundaryPart, triangle = strip.begin()](const auto & verts) mutable { - const auto & [a, b, c] = verts; - doBoundaryPart(a, b, *triangle); + const auto & [a, _, c] = verts; doBoundaryPart(a, c, *triangle); triangle++; }; std::ranges::for_each(newVerts | std::views::adjacent<3>, doBoundary); + doBoundaryPart(*++newVerts.begin(), newVerts.front(), *strip.rbegin()); doBoundaryPart(*++newVerts.rbegin(), newVerts.back(), *strip.rbegin()); std::set<HalfedgeHandle> done; |