You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been investigating problems with incorrect pathing, e.g.
After some digging, I've found that the root cause is the logic that removes vertices on tile borders while building polymeshes.
There is a parameter that controls the max edge length while tracing contours, it correctly creates 'small' areas:
When later poly mesh is built, it builds a triangulation for each contour. However, there is a piece of code (see RcMeshs.BuildPolyMesh) that marks vertices on the tile borders for removal:
if ((cont.verts[v + 3] & RC_BORDER_VERTEX) != 0)
{
// This vertex should be removed.
vflags[indices[j]] = 1;
}
As a result, recast creates a huge polygons on tile borders:
Presumably this is done for better tile stitching? However, it creates problems for pathfinding (since the pathfinding considers edge midpoints, it thinks that going 'around' this polygon is 'shorter' than crossing long edge midpoint).
Removing this vertex removal bit fixes the triangulation (and consequently pathfinding), and doesn't seem to break stitching in my limited testing so far:
However, I don't quite understand all implications. I suspect this part is directly ported from recast?
The text was updated successfully, but these errors were encountered:
There are parts that I also haven't fully understood, so it's difficult for me to respond.
Firstly, the part that I don't understand from the perspective of porting is the technical porting.
I've been investigating problems with incorrect pathing, e.g.
After some digging, I've found that the root cause is the logic that removes vertices on tile borders while building polymeshes.
There is a parameter that controls the max edge length while tracing contours, it correctly creates 'small' areas:
When later poly mesh is built, it builds a triangulation for each contour. However, there is a piece of code (see RcMeshs.BuildPolyMesh) that marks vertices on the tile borders for removal:
As a result, recast creates a huge polygons on tile borders:
Presumably this is done for better tile stitching? However, it creates problems for pathfinding (since the pathfinding considers edge midpoints, it thinks that going 'around' this polygon is 'shorter' than crossing long edge midpoint).
Removing this vertex removal bit fixes the triangulation (and consequently pathfinding), and doesn't seem to break stitching in my limited testing so far:
However, I don't quite understand all implications. I suspect this part is directly ported from recast?
The text was updated successfully, but these errors were encountered: