From 43507dd1184c7775df93b10d494a7a0c31be434e Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 18 Aug 2020 16:37:44 +0200 Subject: [PATCH] mathutil: Fix Triangulator bug cleaning up hole indices --- panda/src/mathutil/triangulator.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/panda/src/mathutil/triangulator.cxx b/panda/src/mathutil/triangulator.cxx index f179b24e83..fda047d5d6 100644 --- a/panda/src/mathutil/triangulator.cxx +++ b/panda/src/mathutil/triangulator.cxx @@ -263,7 +263,7 @@ cleanup_polygon_indices(vector_int &polygon) { ++pi; } else { // This index is out-of-bounds; remove it. - polygon.erase(_polygon.begin() + pi); + polygon.erase(polygon.begin() + pi); } } @@ -275,11 +275,11 @@ cleanup_polygon_indices(vector_int &polygon) { ++pi; } else { // This vertex repeats the previous one; remove it. - polygon.erase(_polygon.begin() + pi); + polygon.erase(polygon.begin() + pi); } } - if (polygon.size() > 1 && _vertices[polygon.back()] == _vertices[_polygon.front()]) { + if (polygon.size() > 1 && _vertices[polygon.back()] == _vertices[polygon.front()]) { // The last vertex repeats the first one; remove it. polygon.pop_back(); }