I have been trying to get some NavMesh data from the Recast NavMesh Extension.
I gave up on directly accessing promisingly sounding properties on the Recast object. All getters seem to return nothing really. I guess you cannot easily access the C++ data. Or can you?
Anyway, I then tried to use the debug navmesh. This is in fact a Babylon mesh. However, when I try to access its facet data I only get a bunch of zero vectors (pos and norm). See here:
See console.log on line 53
What do you want to query about the computed navmesh?
Did you try to get mesh positions like ?
var positions = navmeshdebug.getVerticesData(BABYLON.VertexBuffer.PositionKind);
Thanks @Cedric. The goal is to calculate “cover plates”; think modern X-Com when you mouseover the ground and it is displayed the cover icon on walls, etc.
After visualising the vertices from getVerticesData() it does seem like these data are even better suited than facets.
If you do not mind me asking. Since the facet data seem to be corrupted, is the debug navmesh a reliable data source? I mean it says “debug”. The final use case, as I can imagine it now, would be something like:
- In an extra build step
- use NullEngine
- load level geometry
- build navmesh
- analyse debugNavmesh
- store cover data for ingame use
The topology of the debugnavmesh is the same as what’s being used for navigation. Some infos on connectivity for example and other datas used for navigation are obviously not present in the mesh.
It’s ‘debug’ in the sense of displaying a part of the data used for navigation.
Yes, it sounds like a good plan. Also, try to change navmesh creation parameters so it’s easier for you to compute the cover datas. For example, lowering the simplification will resulting in blocky navmesh that may be more easier to process.
Hello @Joe_Kerr just checking in, was your question answered?
Oh, erm, I kind of forgot. Sorry.
The question has been answered for me personally. I have the cover system in a future milestone and will follow Cedric’s advice.
I cannot really remember what the problem was with the facet data