- A* version: 5.4.6
- Unity version: 6000.3.10
I’ve been trying to resolve some issues and looking through the code a bit and I saw this on lines 166-169 of VoxelRasterization.cs:
minX = math.clamp(minX, 0, cropX);
maxX = math.clamp(maxX, 0, cropX);
minZ = math.clamp(minZ, 0, cropZ);
maxZ = math.clamp(maxZ, cropZ, cropZ);
I was going to change “maxZ = math.clamp(maxZ, cropZ, cropZ);” to “maxZ = math.clamp(maxZ, 0, cropZ);” locally but wanted to flag it here in case it’s a legit bug that can be resolved in a future update so I don’t need to keep making the change locally. I assume it is because it doesn’t make sense at the moment and just forces maxZ to equal cropZ.
What’s the issue you’ve been having?
I use onCollectMeshes with RecastMeshGatherer and add my own RecastMeshGatherer.GatheredMesh data during updates as I move the pathfinding bounds around my open world. Right now I don’t seem to have any issues with this except I do get lots of “Vertex has multiple shared edges. This should not happen. Navmesh must be corrupt. Trying to not make it worse.” errors from “if (multiSharedEdges > 0)” in CanRemoveVertex in VoxelMesh.cs.
I’ve just commented out that error for now because I haven’t been able to resolve it by changing the input data as yet. I haven’t been able to identify any reason the mesh data I’m adding would lead to that. It’s seemingly working fine though.
What had me looking at VoxelRasterization.cs was partially that and partially trying to resolve a crash I was having that I believe was a race condition on my end that I resolved. I just noticed the “maxZ = math.clamp(maxZ, cropZ, cropZ);” line while looking through that method. It’s unrelated to any issue I was having, I just saw it and thought it was wrong and was just wasting performance by always making the bounds be possibly larger than needed.
On the “onCollectMeshes → (multiSharedEdges > 0)” issue I’m having, when I have time I can try put together a small project reproducing it if you’re interested. Maybe it’s a bug on the astar side or it might be something on my side.
This would be great if you can. Sorry for the late response btw.