vincent / recast.js

A wrapper for the RecastDetour navigation library for node and the browser
http://vincent.github.io/recast.js/tests/test.webgl.html
108 stars 21 forks source link

getNavMeshVertices does not work on tiled navmesh #22

Closed GGAlanSmithee closed 6 years ago

GGAlanSmithee commented 7 years ago

Trying to visually debug the navmesh, I attempted to duplicate what you (@vincent) did here in the recast.js editor.

However, getNavMeshVertices never returns any vertices. The method is not documented, so not sure if it's supported. If so, is there any other way to output the navmesh visually? I know it's possible to get the polygons using queryPolygons, but not quite sure how to draw them since there are no indecis.

Thanks in advance.

vincent commented 7 years ago

Yeah I remember I wasn't satisfied of the method, it's both buggy and performance hungry :(

How do you build the navmesh ? Tiled or Solo ? Try both, maybe there is a bug in one.

queryPolygons should return the list of polys from one point to another, as a path.

GGAlanSmithee commented 7 years ago

@vincent thanks for the very quick answer!

I was using buildTiled. Using buildSolo does indeed work! Unfortunatley, I guess the two methods won't build the same navmesh?

vincent commented 7 years ago

Honestly I don't remember exactly, I guess they won't.

getNavMeshVertices should probably be rewitten to handle tiles.

GGAlanSmithee commented 7 years ago

@vincent ok, thanks again! This is a great start, I will see what I can make of it. I might take a stab at getting getNavMeshVertices support tiles if I get some time over.

vincent commented 6 years ago

Closing. Feel free to reopen if needed.