Browse Source

mathutil: Fix Triangulator bug cleaning up hole indices

rdb 5 years ago
parent
commit
43507dd118
1 changed files with 3 additions and 3 deletions
  1. 3 3
      panda/src/mathutil/triangulator.cxx

+ 3 - 3
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();
   }