# RecastNavMesh get NavMeshEdges in Box

**URL:** <https://forums.unrealengine.com/t/recastnavmesh-get-navmeshedges-in-box/412510>\
**Category:** World Creation\
**Tags:** unreal-engine, navmesh, walls, question\
**Created:** [December 17, 2017, 11:57pm UTC](https://forums.unrealengine.com/t/recastnavmesh-get-navmeshedges-in-box/412510 "2017-12-17T23:57:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [December 17, 2017, 11:57pm UTC](https://forums.unrealengine.com/t/recastnavmesh-get-navmeshedges-in-box/412510/1 "2017-12-17T23:57:07Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![MieszkoZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MieszkoZ](https://forums.unrealengine.com/u/MieszkoZ)\
**Post date:** [December 18, 2017, 9:31am UTC](https://forums.unrealengine.com/t/recastnavmesh-get-navmeshedges-in-box/412510/2 "2017-12-18T09:31:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [December 18, 2017, 12:47pm UTC](https://forums.unrealengine.com/t/recastnavmesh-get-navmeshedges-in-box/412510/3 "2017-12-18T12:47:35Z")

</div>

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 !!!

---

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [December 19, 2017, 12:26am UTC](https://forums.unrealengine.com/t/recastnavmesh-get-navmeshedges-in-box/412510/4 "2017-12-19T00:26:25Z")

</div>

I managed to get a POC -  
[Video](https://drive.google.com/open?id=1pauf9gcDfSeoTL46wazD92gM4Ygmhi7H)

The agents seems to stop to enter inside the objects → which is good 🙂  
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 ?

---

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [December 25, 2017, 1:53pm UTC](https://forums.unrealengine.com/t/recastnavmesh-get-navmeshedges-in-box/412510/5 "2017-12-25T13:53:53Z")

</div>

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 :-(…
