Add NavigationMesh border_size
property for tile baking
#87378
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds NavigationMesh
border_size
property for tile baking.This allows users to partition larger game worlds into regions that have navigation meshes with easy to align tile edges. This tile edges can be efficiently merged by the navigation map using edgekeys. It also avoids problems with the agent_radius offset affecting the tile edges.
The difference between baking AABB and border size is, that the AABB limits the entire source geometry used in the baking as a bounding area while the border size limits the surface of the resulting navigation mesh.
This means in conjunction they can be used to limit the final navigation mesh without having unwanted offsets by e.g. agent radius at tile edges.
When users do the setup the border_size should be larger than the agent_radius and the AABB should be grown by the exact amount of the border_size.
The border size that ReCast uses internally is in voxel units, so the Godot border size float is ceiled to the cell size.
To bake a "perfect" aligned tile navigation mesh additional properties need to be considered. E.g. the edge_max_error should be at or blow 1.0.