RecastNavMesh get NavMeshEdges in Box

Hi,

I am trying to get a NavMeshEdges in Box extents from RecastNavMesh,
So far I found how to get NavPolys Array from the NavMesh (NavMesh->GetPolysInBox(...))
But I am struggling to understand how would I extract them from the NavPoly.

What are NavPolys and what are NavTiles - how would I get a NavMeshEdges ?

P.S. (Don’t link Rama’s tutorial it doesn’t cover that up).

I can suggest looking at FNavMeshSceneProxyData::GatherData which in turn calls FPImplRecastNavMesh::GetDebugGeometry which essentially translates recast’s navigation graph into polygons and edges. This should give you some idea how that data is stored in Recast an may be even enough for your use case (and definitely good enough for a POC).

Cheers

–mieszko

Dziękuję Mieszko!

Interestingly enough I tired to do exactly the same yesterday to access the debug array, but it always returned an empty array so I left it be and tried another way - after your answer I realized that I had to set the FRecastDebugGeometry::bGatherNavMeshEdges to true

As far as I understand the Edges amount must be an Even number - because a wall represented by 2 Edges ? (And there is no Edge share → since it is an FVectors array).
So to get a wall segment would be NavMeshEdges[i] NavMeshEdges[i+1] i+=2 ?

Or do I miss something ?

Thank you very much !!!

I managed to get a POC -
Video

The agents seems to stop to enter inside the objects → which is good :slight_smile:
However the RVO quality is below desired level :(.

Should I try to Integrate RVO2 instead of the built in ?
Or the result will be roughly the same and does not worth the time wasted ?

And to answer my own question:
Implementing RVO2 was just a waste of time - at some cases it works better at some worse at some same :-(…