-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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 navigation mesh source geometry parsers and callbacks #90876
Conversation
@Zylann and @TokisanGames might be interested in (reviewing) this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not do a technical review.
Would be good to squeeze into 4.3 as it would be many more months of hanging dry addons and extensions that can not really get their users to use the hot master build.
Would be good for gdextension authors as a quality of life enhancement.
@tcoxon is our resident expert on navigation in Terrain3D. |
Adds navigation source geometry parser callbacks so that externals can hook their own geometry into the navigation mesh baking process.
92709e7
to
58593d1
Compare
Thanks! |
Signifcant rewrite/reorg of HexMap to improve maintainability. Key changes: * split octants out of HexMap and into a dedicated class * moved IndexKey into HexMapCellId::Key * added NavigationMesh baking support[^1] * added "cells_changed" signal * emitted only when cells are changed * will group changed cells into a single signal * cell ids emitted as Array<Vector3i> for performance reasons * removed stale code & simplified feature set * dropped tile scaling; scale prior to export to the MeshLibrary, or scale in the MeshLibrary * dropped baked per-tile navigation mesh [^2]; use parent NavigationRegion and bake the NavigationMesh * dropped override support for baked NavigationMesh regions * dropped center-x and center-z toggles; these do not make sense to disable for hexagonal meshes * converted HexMap functions to use CellId instead of Vector3i * GDScript functions do exist for Vector3i implementations to avoid the performance hit of Ref<T> * switched from cell size to cell height & radius * added property to display collision debug mesh * Debug->Visible Collision Shapes doesn't apply to the editor * allows viewing of collision shape in editor * added minimal profiling stuff for macos only * moved HexMap::Planes out into HexMapPlanes * fixed an #include problem [^1]: godotengine/godot#90876 [^2]: https://chat.godotengine.org/channel/devel?msg=BnEXWRwfXsepXHmDg
Add navigation mesh source geometry parsers and callbacks so that externals can hook their own geometry into the internal navigation mesh baking process.
Proposal godotengine/godot-proposals#5138
This can be used to hook addons, modules and extensions into the navigation mesh baking process.
E.g. Terrain3D or VoxelTool to name some examples. What all those extensions have currently in common is that they need to use suboptimal processes to add their geometry for navmesh baking and can't work frictionless with the default baking.
If a parser with callback is registered the
Callable
will be called for every single node that gets parsed when the NavigationServerparse_source_geometry_data()
is used by something.The Callable will get called with 3 args, the navigation mesh for the parse and bake properties, the source geometry object to add geometry to, and the actual node that gets parsed.
If the parser is no longer needed, e.g. because addon gets disabled, free the parser RID with the NavigationServer.
2D
3D