From 7dc3fa64ffe64d5fa01c59f7deed87dbc3b48c45 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 26 Apr 2024 14:50:42 +0100 Subject: Don't return newly created faces from split It's not as simple as it looks as adjacent faces may also be split, making this a bit misleading. --- game/geoData.cpp | 12 +++++------- game/geoData.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/game/geoData.cpp b/game/geoData.cpp index e465ba0..68a1298 100644 --- a/game/geoData.cpp +++ b/game/geoData.cpp @@ -409,7 +409,7 @@ GeoData::triangleContainsTriangle(const Triangle<2> & a, const Triangle<2> & b) return triangleContainsPoint(a.x, b) && triangleContainsPoint(a.y, b) && triangleContainsPoint(a.z, b); } -std::array +void GeoData::split(FaceHandle _fh) { // Collect halfedges of face @@ -457,12 +457,10 @@ GeoData::split(FaceHandle _fh) } // Retriangulate - return { - add_face(v0, p0, v1), - add_face(p2, v0, v2), - add_face(v2, v1, p1), - add_face(v2, v0, v1), - }; + add_face(v0, p0, v1); + add_face(p2, v0, v2); + add_face(v2, v1, p1); + add_face(v2, v0, v1); } void diff --git a/game/geoData.h b/game/geoData.h index 5586023..0c5cc6c 100644 --- a/game/geoData.h +++ b/game/geoData.h @@ -186,7 +186,7 @@ protected: void update_vertex_normals_only(VertexIter start); using OpenMesh::TriMesh_ArrayKernelT::split; - std::array split(FaceHandle); + void split(FaceHandle); private: GlobalPosition3D lowerExtent {}, upperExtent {}; -- cgit v1.2.3