mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
mathutil: error instead of infinite loop if triangulation failed
Fixes #985
This commit is contained in:
parent
32143055bd
commit
9c4cb28805
@ -150,7 +150,11 @@ triangulate() {
|
||||
}
|
||||
*/
|
||||
|
||||
int attempts = 0;
|
||||
|
||||
while (construct_trapezoids(num_segments) != 0) {
|
||||
nassertv_always(attempts++ < 100);
|
||||
|
||||
// If there's an error, re-shuffle the index and try again.
|
||||
Randomizer randomizer;
|
||||
for (i = 0; i < num_segments; ++i) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user