diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-02-24 00:10:07 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-02-24 00:10:07 +0000 |
commit | 7c04c368fe0694b38e2ab46aca078d921c7d44b1 (patch) | |
tree | c62c4f0f61ad5caf41ad0a91154cb04e8f099f30 /game/geoData.cpp | |
parent | Improve number of segments in LinkCurve bases (diff) | |
download | ilt-7c04c368fe0694b38e2ab46aca078d921c7d44b1.tar.bz2 ilt-7c04c368fe0694b38e2ab46aca078d921c7d44b1.tar.xz ilt-7c04c368fe0694b38e2ab46aca078d921c7d44b1.zip |
Don't rely on triangle centroid not already having a surface
Diffstat (limited to 'game/geoData.cpp')
-rw-r--r-- | game/geoData.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp index d577392..4291a64 100644 --- a/game/geoData.cpp +++ b/game/geoData.cpp @@ -319,7 +319,7 @@ GeoData::setPoint(GlobalPosition3D tsPoint, const RelativeDistance nearNodeToler return split_copy(face, tsPoint); }; -std::vector<GeoData::FaceHandle> +std::set<GeoData::FaceHandle> GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip, const SetHeightsOpts & opts) { if (triangleStrip.size() < 3) { @@ -532,14 +532,14 @@ GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip, const } } - std::vector<FaceHandle> + std::set<FaceHandle> setSurface(const Surface * surface) { - std::vector<FaceHandle> out; + std::set<FaceHandle> out; auto surfaceStripWalk = [this, surface, &out](const auto & surfaceStripWalk, const auto & face) -> void { - if (!geoData->property(geoData->surface, face)) { + if (!out.contains(face)) { geoData->property(geoData->surface, face) = surface; - out.emplace_back(face); + out.emplace(face); std::ranges::for_each( geoData->ff_range(face), [this, &surfaceStripWalk](const auto & adjacentFaceHandle) { if (getTriangle(geoData->triangle<2>(adjacentFaceHandle).centroid())) { @@ -554,7 +554,7 @@ GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip, const return out; } - std::vector<GeoData::FaceHandle> + std::set<GeoData::FaceHandle> run(const SetHeightsOpts & opts) { const std::vector<VertexHandle> newVerts = createVerticesForStrip(opts.nearNodeTolerance); |