Oxidized Navigation

Crates.io Crates.io

Tiled Runtime Nav-mesh generation for 3D worlds in Bevy. Based on Recast's Nav-mesh generation but in Rust.

Takes in Bevy Rapier3D colliders from entities with the NavMeshAffector component and asynchronously generates tiles of navigation meshes based on NavMeshSettings.

Quick-start:

Nav-mesh generation: 1. Add OxidizedNavigationPlugin as a plugin. 2. Attach a NavMeshAffector component and a rapier collider to any entity you want to affect the nav-mesh.

At this point nav-meshes will be automatically generated whenever the collider or GlobalTransform of any entity with a NavMeshAffector is changed.

Querying the nav-mesh / Pathfinding: 1. Your system needs to take in the NavMesh resource. 2. Get the underlying data from the nav-mesh using NavMesh::get. This data is wrapped in an RwLock. 3. To access the data call RwLock::read. This will block until you get read acces on the lock. If a task is already writing to the lock it may take time. 4. Call query::find_path with the NavMeshTiles returned from the RwLock.

Also see the examples for how to run pathfinding in an async task which may be preferable.

Supported versions

| Crate Version | Bevy Version | Bevy Rapier 3D Version | | ------------- | ------------ | ---------------------- | | 0.6.0 | 0.11 | 0.22 | | 0.5.X | 0.10.X | 0.21 | | 0.4.0 | 0.10.X | 0.21 | | 0.3.0 | 0.10.0 | 0.21 | | 0.2.0 | 0.9.X | 0.20 | | 0.1.X | 0.9.X | 0.19 |

Using an unsupported Rapier version will cause Oxidized Navigation to fail as it tries to get wrongly versioned components. In this case you may be able to override which version Oxidized Navigation depends on.

Non-exhaustive TODO-list:

Debug draw.

Whilst not included in the plugin currently, you can use Bevy Prototype Debug Lines and the draw_nav_mesh_system in the blocking_async example to render the nav mesh.