Any examples to build the NavMesh on my own and only use Detour lib separately?

131 views
Skip to first unread message

lhhts...@gmail.com

unread,
Feb 14, 2021, 4:36:10 PM2/14/21
to recastnavigation
Hi, 

I have some very specific requirements for my nav mesh. And it is mainly 2D with lots of other requirements, e.g. area cost, area shape, etc. I'd like to build the nav mesh data manually and verify it on my own. Then only use Detour purely for the FindPath function.
Is this easy? Any examples about that? What kind of API and data structure I should use?


For example, I was looking for something like:

dtNavMesh nav_mesh;
nav_mesh.init(...)

...
// add my custom polygons one by one
nav_mesh.addPolygon(poly_data);
// set polygon neighbors
nav_mesh.setNeighbor(poly, neighboring_ploys);
// set polygon area cost
nav_mesh.setArea(poly, area);

// then some post processing for the nav_mesh to prepare for path finding;
nav_mesh.doSomething();


// then I can directly query path finding using Detour lib.
dtNavMeshQuery.findPath(...)

Reply all
Reply to author
Forward
0 new messages