From 2a2271fa0f60279a94c0218026cd296fe5b4aee1 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 24 Nov 2024 01:45:31 +0000 Subject: Surface walk to set face surface property --- game/geoData.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'game/geoData.cpp') 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 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}); } -- cgit v1.2.3