summaryrefslogtreecommitdiff
path: root/game/geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-11-24 01:45:31 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-11-24 01:50:11 +0000
commit2a2271fa0f60279a94c0218026cd296fe5b4aee1 (patch)
treed269d6b0aa04df920b547bd27a7298cb86dc6914 /game/geoData.cpp
parentAdd Triangle::centroid (diff)
downloadilt-2a2271fa0f60279a94c0218026cd296fe5b4aee1.tar.bz2
ilt-2a2271fa0f60279a94c0218026cd296fe5b4aee1.tar.xz
ilt-2a2271fa0f60279a94c0218026cd296fe5b4aee1.zip
Surface walk to set face surface property
Diffstat (limited to 'game/geoData.cpp')
-rw-r--r--game/geoData.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp
index cc9a056..cd0be29 100644
--- a/game/geoData.cpp
+++ b/game/geoData.cpp
@@ -545,5 +545,19 @@ GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip, const
}
done.insert(heh);
}
+
+ auto surfaceStripWalk = [this, &getTriangle, &opts](const auto & surfaceStripWalk, const auto & face) -> void {
+ if (!property(surface, face)) {
+ property(surface, face) = &opts.surface;
+ std::ranges::for_each(
+ ff_range(face), [this, &getTriangle, &surfaceStripWalk](const auto & adjacentFaceHandle) {
+ if (getTriangle(this->triangle<2>(adjacentFaceHandle).centroid())) {
+ surfaceStripWalk(surfaceStripWalk, adjacentFaceHandle);
+ }
+ });
+ }
+ };
+ surfaceStripWalk(surfaceStripWalk, findPoint(strip.front().centroid()));
+
update_vertex_normals_only(VertexIter {*this, vertex_handle(initialVertexCount), true});
}