New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Island system #352
base: main
Are you sure you want to change the base?
Island system #352
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I like this kind of functionality a lot, but I don't think this implementation quite gets us there. With an implementation of this we clearly need to document what the limitations are. The biggest being that it only works on static meshes. I have also noted that your implementation does not support unidirectional offmesh connections, which is a correctness issue.
The static mesh thing is pretty hard to resolve, but we can definitely support unidirectional offmesh connections. I have implemented this functionality before, and my approach was to compute strongly connected components of the mesh and then take the transitive closure. That would be an alternative strategy to try out, but we do need to support directed traversal.
There is also more low-hanging fruit when you have this kind of thing. One thing that I can think of is supplying variants of findNearestPoly
-- findNearestNavigableToPoly
and findNearestNavigableFromPoly
-- which guarantee that the returned poly can be navigated to from some point, or can navigate to some point.
Detour/Source/DetourNavMesh.cpp
Outdated
if (islandIndexFrom != islandIndexTo) | ||
return false; | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not checked your implementation closely, but I don't see how this can be correct. This will give symmetric answers, i.e. checkPathExists(a, b) == checkPathExists(b, a)
. But that is certainly not correct in the face of unidirectional offmesh connections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My system not work with offmesh connections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I will do this system with offmesh connections, but later.
Island system: use in quick check passability from one polygon to another polygon (This system works on compares polygon island indices).
To activate this system you need uncomment define NAVMESH_ISLAND_SYSTEM in file: "DetourNavMesh.h".
To split a mesh into islands you must use a class dtIslandManager in the file: "DetourNavMesh.h".