Robmaister / SharpNav

Advanced Pathfinding for C#
sharpnav.com
Other
534 stars 165 forks source link

Fixed Triangulate incorrect DiagonalLoose call #66

Closed Andres-Barrera closed 7 years ago

Andres-Barrera commented 7 years ago

Inside the Triangulate function, the incorrect call to DiagonalieLoose (instead of DiagonalLoose) can cause overlapping triangles in PolyMesh, with the possibility of non-convex polygons and wrong pathfinding as a consecuence in some cases.

Fix found using original recast C++ code as guide. https://github.com/recastnavigation/recastnavigation/blob/master/Recast/Source/RecastMesh.cpp

Robmaister commented 7 years ago

Awesome! I've done a few passes through the original Recast code since the original port and found plenty of little problems like this, especially in Triangulate.