summaryrefslogtreecommitdiff
path: root/game/geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-12-18 16:03:47 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-12-18 16:03:47 +0000
commit8185a79abb71aa6ad0d3ca3719047372440291c4 (patch)
tree63b32569f5b5925664eff15403c041c84ec8b4ef /game/geoData.cpp
parentDon't make arbitrary changes to mesh for triangle boundaries (diff)
downloadilt-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.
Diffstat (limited to 'game/geoData.cpp')
-rw-r--r--game/geoData.cpp4
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;