Terrain3D
Terrain3D copied to clipboard
Navigating different terrain types, i.e. making sub-NavigationRegions
Description
Present state of the NavigationServer
support covers all the basics and them some, however, there isn't anything about navigating different terrain types. Texturing terrain basically does that, i.e. defines various terrain subtypes within the terrain, however, navigation mesh baking still outputs one big mesh. Documentation mentions the way to define 'baking AABB' to produce multiple navigation meshes, but it won't work properly for some free-shape regions and even if it does - it's extremely cumbersome to build this sub-regions by hand.
Now the solution might be actually quite easy:
- Per each texture of the terrain define something like 'terrain type id', that will allow user to group visual material and 'physical' terrain types
- While baking, produce N regions using not only 'navigable area' map, but also texture map to identify whether specific portion of the terrain belong to the corresponding NavigationRegion
- Hopefully, that will produce auto-linkable meshes right away, although some extra work might be needed to make sure those meshes share edges
The last one is the biggest question that would need proper investigation, but the first seem really straighforward and prototyping the feature should be a quick one.