Skip to content

Neighbor polys and edges in Detour? #602

Answered by S41L0R
S41L0R asked this question in Q&A
Discussion options

You must be logged in to vote

Resolved!

Here's the solution I used for people looking at this in future:

  • If the neighbor from dtPoly->neis & DT_EXT_LINK (0x8000), the link is external.
  • If not, you can find the neighbor poly index by subtracting 1 from the neighbor. You can find the neighbor edge index by iterating through the neighbor poly and checking which edge shares vertices with the seeking edge.
  • If it is external, you need to look at dtMeshTile->links. Documentation doesn't seem to be too great on that, so here's what I want to say about using that:
    • Each dtPoly has an index into dtMeshTile->links. This represents where the first link is, and you can iterate like this:
      for (unsigned int i = srcPoly->firstLink; …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by S41L0R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant