{"id":15017991,"url":"https://github.com/thegrimsey/oxidized_navigation","last_synced_at":"2025-04-08T01:35:21.966Z","repository":{"id":65329755,"uuid":"576988934","full_name":"TheGrimsey/oxidized_navigation","owner":"TheGrimsey","description":"A runtime Nav-Mesh generation plugin for Bevy Engine in Rust.","archived":false,"fork":false,"pushed_at":"2025-01-25T20:31:41.000Z","size":299,"stargazers_count":183,"open_issues_count":11,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T01:35:18.916Z","etag":null,"topics":["bevy","gamedev","navmesh","navmesh-generation","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheGrimsey.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"thegrimsey"}},"created_at":"2022-12-11T16:26:31.000Z","updated_at":"2025-02-04T00:11:06.000Z","dependencies_parsed_at":"2023-02-16T10:01:34.893Z","dependency_job_id":"ff25f0b7-cc4d-49b8-91b3-15bcbfb0bcb5","html_url":"https://github.com/TheGrimsey/oxidized_navigation","commit_stats":{"total_commits":105,"total_committers":3,"mean_commits":35.0,"dds":0.02857142857142858,"last_synced_commit":"0eb0edb0f6400d30704b8b072d3e5f52c060925e"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheGrimsey%2Foxidized_navigation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheGrimsey%2Foxidized_navigation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheGrimsey%2Foxidized_navigation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheGrimsey%2Foxidized_navigation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheGrimsey","download_url":"https://codeload.github.com/TheGrimsey/oxidized_navigation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761051,"owners_count":20991531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bevy","gamedev","navmesh","navmesh-generation","rust","rust-lang"],"created_at":"2024-09-24T19:51:17.684Z","updated_at":"2025-04-08T01:35:21.931Z","avatar_url":"https://github.com/TheGrimsey.png","language":"Rust","funding_links":["https://github.com/sponsors/thegrimsey"],"categories":[],"sub_categories":[],"readme":"# Oxidized Navigation\n[![Crates.io](https://img.shields.io/crates/v/oxidized_navigation)](https://crates.io/crates/oxidized_navigation/)\n![Crates.io](https://img.shields.io/crates/l/oxidized_navigation)\n\nTiled **Runtime** Nav-mesh generation for 3D worlds in [Bevy](https://bevyengine.org/). Based on [Recast's Nav-mesh generation](https://github.com/recastnavigation/recastnavigation/) but in Rust.\n\nTakes in [Parry3d](https://crates.io/crates/parry3d) colliders that implement the ``OxidizedCollider`` trait from entities with the ``NavMeshAffector`` component and **asynchronously** generates tiles of navigation meshes based on ``NavMeshSettings``. ``OxidizedCollider`` implementations for [Bevy Rapier3D](https://crates.io/crates/bevy_rapier3d) and [Avian 3d](https://crates.io/crates/avian3d) are included under the `rapier` and `avian` features.\n\n## Quick-start:\n**Nav-mesh generation:**\n1. Choose which backend you're going to use (bevy_rapier3d, avian_3d, or custom parry3d based colliders) and enable the relevant crate features (`rapier`, `avian`, or `parry3d` features).\n2. If you opted for custom parry3d colliders, implement the `OxidizedCollider` trait for your collider component that wraps a `parry3d::shape::SharedShape`. This is already done for `bevy_rapier3d` and `avian_3d`.\n3. Add ``OxidizedNavigationPlugin`` as a plugin. (eg. for avian `OxidizedNavigationPlugin::\u003cCollider\u003e::new(NavMeshSettings {...}`)\n4. Attach a ``NavMeshAffector`` component and a collider that implements the `OxidizedCollider` trait (already implemented for `bevy_rapier3d` and `avian_3d`) to any entity you want to affect the nav-mesh.\n\n*At this point nav-meshes will be automatically generated whenever the collider or ``GlobalTransform`` of any entity with a ``NavMeshAffector`` is changed.*\n\n**Querying the nav-mesh / Pathfinding:**\n1. Your system needs to take in the ``NavMesh`` resource.\n2. Get the underlying data from the nav-mesh using ``NavMesh::get``. This data is wrapped in an ``RwLock``.\n3. 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.*\n4. Call ``query::find_path`` with the ``NavMeshTiles`` returned from the ``RwLock``. \n\n*Also see the [examples](https://github.com/TheGrimsey/oxidized_navigation/tree/master/examples) for how to run pathfinding in an async task which may be preferable.*\n\n## FAQ\n\n\u003e I added the `OxidizedNavigationPlugin` to my app and now it won't compile.\n\nYou need to use `OxidizedNavigationPlugin::\u003cCollider\u003e::new(NavMeshSettings {...}`, where `Collider` is either a rapier or avian `Collider`, or your own custom collider that implements the `OxidizedCollider` trait. This is necessary to allow us to be generic over different `Collider` components.\n\n\u003e When enabling XPBD, I get the error \"You must pick a single parry3d feature.\"\n\nYou need to disable the default `parry_016` feature as XPBD uses a different version of `Parry3d`. \n\n*A version of `Parry3d` needs to be enabled by default for the crate to be compilable \u0026 publishable.*\n\n\u003e I don't want to use the Rapier3d or XPBD3d physics engines just to generate a navmesh. How do I create my own `parry3d` wrapper component?\n\nYou need to create a component that contains a parry3d `SharedShape`, then implement the `OxidizedCollider` trait. See the [parry3d example](./examples/parry3d.rs) for a basic example.\n\n\u003e Can I use this with the builtin bevy shapes, or my own custom shapes?\n\nCurrently only `parry3d` colliders are supported, or crates using `parry3d` colliders. You'd have to write a function to convert your shapes/bevy shapes into `parry3d` colliders.\n\n\u003e Why aren't my Xpbd/Parry3d colliders scaled properly?\n\nYou need to manually apply your transform's scale to the Xpbd/Parry3d collider's shape.\n\n\u003e My physics crate updated and now my nav-meshes won't generate.\n\nThis is due to how dependencies are handled, Oxidized Navigation will only interact with the versions specified in [Supported Versions](#supported-versions). If you want to use other versions you can [make cargo use a different version](https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section).\n\n\u003e How do I draw the Nav-mesh for debugging?\n\nDebug draw is available behind the ``debug_draw`` feature and using the ``OxidizedNavigationDebugDrawPlugin`` see usage in examples.\n\n## Supported versions\n\n| Crate Version | Bevy Version | Bevy Rapier 3D Version | Bevy Xpbd 3D Version | Avian3D Version     | Parry3d Version |\n|---------------|--------------|------------------------|----------------------|---------------------|-----------------|\n| 0.12.0        | 0.15         | 0.28                   | unsupported          | git-rev-52cbcec (1) | 0.17            |\n| 0.11.0        | 0.14         | 0.27                   | 0.5                  | unsupported         | 0.15/0.16       |\n| 0.9.0         | 0.12         | 0.24                   | 0.3                  | unsupported         | 0.13            |\n| 0.10.0        | 0.13         | 0.25                   | 0.4                  | unsupported         | 0.13            |\n| 0.8.0         | 0.12         | 0.23                   | 0.3                  | unsupported         | 0.13            |\n| 0.7.0         | 0.11         | 0.22                   | 0.2                  | unsupported         | 0.13            |\n| 0.6.0         | 0.11         | 0.22                   | unsupported          | unsupported         | unsupported     |\n| 0.5.X         | 0.10.X       | 0.21                   | unsupported          | unsupported         | unsupported     |\n| 0.4.0         | 0.10.X       | 0.21                   | unsupported          | unsupported         | unsupported     |\n| 0.3.0         | 0.10.0       | 0.21                   | unsupported          | unsupported         | unsupported     |\n| 0.2.0         | 0.9.X        | 0.20                   | unsupported          | unsupported         | unsupported     |\n| 0.1.X         | 0.9.X        | 0.19                   | unsupported          | unsupported         | unsupported     |\n\n### (1)\n- Avian3D has yet to publish an official bevy-0.15 release. There will be a 0.12.1 release when they do\n- You will need to use a `[patch.crates-io]` override for now see [MIGRATING - 0.12.0](https://github.com/TheGrimsey/oxidized_navigation/blob/master/MIGRATING.md#0120)\n- The minimum git rev sha supported is [52cbcec](https://github.com/Jondolf/avian/commit/52cbcecce0fd05a65005ab6935ebeb231373c2c6)\n- Newer git revs will possibly (probably) work but are untested with this crate, YMMV 🤷🏼\n\n**Using an unsupported Rapier, Xpbd, Avian3d or parry3d version will cause Oxidized Navigation to fail as it tries to get the wrong version of components.**\nIn this case you may be able to [override which version Oxidized Navigation depends on](https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html).\n\n## Non-exhaustive TODO-list:\n\n- [ ] Allow creating nav-mesh from meshes (probably add an option to ``NavMeshAffector``).\n- [ ] Rebuild all tiles when ``NavMeshSettings`` are changed.\n\n- [ ] Nav-mesh \"layers\" using different ``NavMeshSettings``.\n- [ ] Pathfinding ticket system (Call to pathfinding returns a ticket that one can check later, controlling async pathfinding like this allows us to limit the amount of parallel tasks \u0026 prioritize them)\n- [ ] Remove ``create_nav_mesh_tile_from_poly_mesh`` in favor of creating data in the right format from the start.\n\n- [ ] Add local nav-mesh sub-grids that can be used for moving objects (platforms, ships, etc) without needing to regenerate it's interior every update.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthegrimsey%2Foxidized_navigation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthegrimsey%2Foxidized_navigation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthegrimsey%2Foxidized_navigation/lists"}