A custom mesh provider

  • A* version: 5.4.6
  • Unity version: 6000.4.1f1

I’m trying to initialize recast graph with pre-built nav mesh to avoid voxelization (it works extremely bad with my geometry). The mesh’s made at runtime with proper triangulation. I tried to implement a custom grid type, but a lot of recast related types/methods either private or internal. I could convert the mesh to the node list, but this way I lose graph tiles and ability to use agent with different radius.

Is there any reasonable approach to achieve my goal or I am forced to just copy everything related to the recast graph and replace the voxelization?

Hi

Can’t you use the NavMeshGraph in that case? That accepts a mesh as input.

Unfortunately, NavMeshGraph has two main caveats:

  1. It accepts only one mesh as an input, therefore I have no way to have different penalty values. E.g. I have a main world structure and have roads on top of it with lower penalty. I can merge it into a single mesh if needed, but I see no way to differentiate penalty in this case.

  2. The RecastGraph has a neat feature: it supports agent types of a different radius and makes proper offsets along the edge. This is not a crucial missing feature because I can offset my mesh if needed, but it’s nice to have.

I did some research regarding the tiling: it seems that adding/removing NavMeshCuts doesn’t invoke re-scan of affected tiles so my previous point regarding required tiling might be dismissed.