mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
mathutil: Fix Triangulator bug cleaning up hole indices
This commit is contained in:
parent
73b5316c6c
commit
43507dd118
@ -263,7 +263,7 @@ cleanup_polygon_indices(vector_int &polygon) {
|
|||||||
++pi;
|
++pi;
|
||||||
} else {
|
} else {
|
||||||
// This index is out-of-bounds; remove it.
|
// 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;
|
++pi;
|
||||||
} else {
|
} else {
|
||||||
// This vertex repeats the previous one; remove it.
|
// 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.
|
// The last vertex repeats the first one; remove it.
|
||||||
polygon.pop_back();
|
polygon.pop_back();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user