Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NavigationMesh border_size property for tile baking #87378

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Jan 19, 2024

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.

nav_mesh_border_size

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.

Adds NavigationMesh border_size property for tile baking.
@smix8 smix8 added this to the 4.3 milestone Jan 19, 2024
@smix8 smix8 requested a review from a team as a code owner January 19, 2024 16:35
@smix8 smix8 changed the title Add NavigationMesh border_size property for tile baking Add NavigationMesh border_size property for tile baking Feb 6, 2024
@akien-mga
Copy link
Member

We merged the 2D counterpart, is this one also good to go? CC @Scony

@Scony
Copy link
Contributor

Scony commented Feb 7, 2024

All good @akien-mga

Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style and docs look good

@akien-mga akien-mga merged commit 261952a into godotengine:master Feb 8, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants