{"id":30116290,"url":"https://github.com/janhohenheim/rerecast","last_synced_at":"2025-08-10T09:02:40.438Z","repository":{"id":300120000,"uuid":"1003587128","full_name":"janhohenheim/rerecast","owner":"janhohenheim","description":"Rust port of Recast, the industry-standard navigation mesh generator used by Unreal, Unity, Godot, and other game engines.","archived":false,"fork":false,"pushed_at":"2025-08-10T03:23:02.000Z","size":14263,"stargazers_count":32,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-10T05:22:53.414Z","etag":null,"topics":["avian","avian3d","bevy","bevy-engine","game-development","navmesh","recast","recastnavigation"],"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/janhohenheim.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license-apache.txt","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,"zenodo":null}},"created_at":"2025-06-17T11:21:38.000Z","updated_at":"2025-08-10T03:04:32.000Z","dependencies_parsed_at":"2025-07-13T09:07:16.902Z","dependency_job_id":"164e7025-df27-4e87-ae75-a1c38f0d360f","html_url":"https://github.com/janhohenheim/rerecast","commit_stats":null,"previous_names":["janhohenheim/avian_navmesh","janhohenheim/rerecast"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/janhohenheim/rerecast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janhohenheim%2Frerecast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janhohenheim%2Frerecast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janhohenheim%2Frerecast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janhohenheim%2Frerecast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janhohenheim","download_url":"https://codeload.github.com/janhohenheim/rerecast/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janhohenheim%2Frerecast/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269699693,"owners_count":24461219,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["avian","avian3d","bevy","bevy-engine","game-development","navmesh","recast","recastnavigation"],"created_at":"2025-08-10T09:02:35.164Z","updated_at":"2025-08-10T09:02:40.426Z","avatar_url":"https://github.com/janhohenheim.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rerecast\n[![crates.io](https://img.shields.io/crates/v/rerecast)](https://crates.io/crates/rerecast)\n[![docs.rs](https://docs.rs/rerecast/badge.svg)](https://docs.rs/rerecast)\n\n![`rerecast` logo](https://raw.githubusercontent.com/janhohenheim/rerecast/refs/heads/main/media/logo.svg)\n\nRust port of [Recast](https://github.com/recastnavigation/recastnavigation), the industry-standard navigation mesh generator used\nby Unreal, Unity, Godot, and other game engines.\n\n## What's a Navmesh?\n\nA navmesh is a mesh that says where in the level a character can walk. This information is typically used for pathfinding.\nRerecast brings navmeshes in two flavors:\n\n- **Polygon Mesh**: A simplified mesh made up of polygons that is quick to use for pathfinding\n- **Detail Mesh**: A triangle mesh that is more detailed and can be optionally used to refine pathfinding, especially for vertical slopes and stairs.\n\nA typical detail mesh looks like this:\n\n![detail mesh](https://github.com/janhohenheim/rerecast/blob/main/media/editor.png?raw=true)\n\nAs you can see, it does not perfectly follow terrain, but is a very good approximation for pathfinding.\n\n## Usage\n\n### Raw Rerecast\n\nRerecast's API is fairly low level. As such, it's best if your game engine of choice provides an idiomatic interface to it.\nIf you want to build such an interface on your own, or want to use Rerecast directly in general, check out the [cpp comparison automated test](https://github.com/janhohenheim/rerecast/blob/main/crates/rerecast/tests/cpp_comparison.rs).\n\n### Bevy Rerecast\n\nTo use `bevy_rerecast`, add it to your dependencies:\n```bash\ncargo add bevy_rerecast\n```\n\nThen add the plugin to your app:\n```rust,no_run\nuse bevy::prelude::*;\nuse bevy_rerecast::prelude::*;\n\nApp::new()\n    .add_plugins(DefaultPlugins)\n    .add_plugins(NavmeshPlugins::default());\n```\n\nThe next step is to provide a *backend*. Backends decide how the current Bevy scene should be translated into a list of trimeshes that rerecast can use. There's a builtin backend called the [`Mesh3dBackendPlugin`], which will use your entities holding a [`Mesh3d`] as obstacles. We will use it in this example, but your own code should usually use a physics engine's backend instead. See the section [Backends](#backends) for more.\n\nTo add a backend, add its plugin after the [`NavmeshPlugins`]:\n\n```rust,no_run\nuse bevy::prelude::*;\nuse bevy_rerecast::prelude::*;\nuse bevy_rerecast::Mesh3dBackendPlugin;\n\nApp::new()\n    .add_plugins(DefaultPlugins)\n    .add_plugins(NavmeshPlugins::default())\n    .add_plugins(Mesh3dBackendPlugin::default());\n```\n\nNow that you've added the backend, you're ready to create a navmesh. To do this, use the [`NavmeshGenerator`] query parameter:\n\n```rust\nuse bevy::prelude::*;\nuse bevy_rerecast::prelude::*;\n\nfn some_system_that_generates_your_navmesh(mut generator: NavmeshGenerator) {\n    let agent_radius = 0.6;\n    let agent_height = 1.8;\n    let settings = NavmeshSettings::from_agent_3d(agent_radius, agent_height);\n    let navmesh_handle = generator.generate(settings);\n\n    // Now store the navmesh handle somewhere, like a resource,\n    // so it doesn't get dropped again!\n}\n```\n\nThe navmesh will be generated in the background, so the `Handle\u003cNavmesh\u003e` you received will not immediately point to an available navmesh.\nIf you want to know exactly when the navmesh is ready, you can set up a [`NavmeshReady`] observer:\n\n```rust\nuse bevy::prelude::*;\nuse bevy_rerecast::prelude::*;\n\nfn on_navmesh_ready(trigger: Trigger\u003cNavmeshReady\u003e, navmeshes: Res\u003cAssets\u003cNavmesh\u003e\u003e) {\n    let asset_id = trigger.event().0;\n\n    // We can now safely fetch the navmesh from our assets:\n    let navmesh = navmeshes.get(asset_id).unwrap();\n}\n```\n\nIf you need to regenerate a navmesh because the environment has changed, use [`NavmeshGenerator::regenerate`]. Once the navmesh was regenerated, you can observe a [`NavmeshReady`] trigger.\n\nTake a look at the [`examples`](https://github.com/janhohenheim/rerecast/tree/main/examples/examples) directory to see all of this in action!\n\n### Editor\n\n![editor demo](https://github.com/janhohenheim/rerecast/raw/refs/heads/main/media/demo.mp4)\n\n\n\u003chttps://github.com/user-attachments/assets/f1c62fbe-cd76-4dc7-9c88-574e241e0a6d\u003e\n\n\nTweaking navmesh settings by hand and restarting the game to see the changes is a very inefficient way to iterate on your game.\nInstead, navmeshes are often authored in advanced. To do this, the Bevy integration comes with an editor to help you out.\nTo use it, you must enable Bevy's BRP functionality, which is a way for Bevy processes to communicate over HTTP. To do this, enable Bevy's `remote` feature and add the [`RemotePlugin`] and [`RemoteHttpPlugin`] to your app:\n\n```rust,no_run\nuse bevy::prelude::*;\nuse bevy::remote::{RemotePlugin, http::RemoteHttpPlugin};\nuse bevy_rerecast::prelude::*;\nuse bevy_rerecast::Mesh3dBackendPlugin;\n\nApp::new()\n    .add_plugins(DefaultPlugins)\n    // Enable BRP\n    .add_plugins((RemotePlugin::default(), RemoteHttpPlugin::default()))\n    // Enable Rerecast\n    .add_plugins(NavmeshPlugins::default())\n    // Also add some backend, for example the `Mesh3dBackendPlugin`\n    .add_plugins(Mesh3dBackendPlugin::default());\n```\n\nNext, download the editor by entering the following command in your terminal:\n\n```bash\ncargo install bevy_rerecast_editor\n```\n\nAnd then run it:\n\n```bash\nbevy_rerecast_editor\n```\n\nNow, when you start your game, you can load the current level into the editor, tweak the navmesh, and save it into a `.nav` file that you can load into your game.\n\n## Third-Party Integration\n\n### Backends\n\nThe recommended way to use the navmesh generator is with a physics engine backend. That way, the generated navmesh will match the physics engine's collision geometry. Currently, the only supported physics engine is [Avian](https://github.com/Jondolf/avian). To use its backend, add the `avian_rerecast` crate to your project:\n\n```bash\ncargo add avian_rerecast\n```\n\nand then register its backend:\n\n```rust,ignore\nuse bevy::prelude::*;\nuse bevy_rerecast::prelude::*;\nuse avian_rerecast::prelude::*;\n\nApp::new()\n    .add_plugins(DefaultPlugins)\n    .add_plugins(NavmeshPlugins::default())\n    .add_plugins(AvianBackendPlugin::default());\n```\n\nThe avian backend will consider colliders that are part of a static rigid body as obstacles.\n\nCreating your own backend is *very* easy. Take a look at the implementation of the [`AvianBackendPlugin`] as an example.\n\n### Pathfinding\n\nWhen you have your navmesh, you'll need to feed it to some pathfinding library or algorithm to actually do anything.\nThe following pathfinding libraries are supported:\n\n- [vleue_navigator](https://github.com/vleue/vleue_navigator)\n- [landmass](https://github.com/andriydev/landmass)\n\nTake a look at their repos for documentation on how to use them with rerecast.\n\n## Features \u0026 Roadmap\n\n### Rerecast\n\n- [x] Generate polygon mesh\n- [x] Generate detail meshes\n- [ ] Generate tiles\n- Partitioning\n  - [x] Watershed\n  - [ ] Monotone\n  - [ ] Layer\n- [x] `no_std` support\n- [x] cross-platform determinism (use `libm` feature)\n\n### Bevy Integration\n\n- Editor\n  - [x] Extract meshes from running game\n  - [x] Configure navmesh generation\n  - [ ] Advanced config\n  - [x] Visualize navmesh\n  - [x] Save navmesh\n  - [x] Load navmeshes with their config\n- API\n  - [x] Optional editor communication\n  - [x] Generate navmeshes on demand\n  - [x] Fully regenerate navmeshes\n  - [ ] Partially regenerate navmeshes\n  - [ ] `no_std` support for `bevy_rerecast_core`\n    - Technically available, but of limited use until `bevy_asset` supports `no_std`\n  - [x] cross-platform determinism (use `libm` feature)\n\n## Compatibility\n\n| bevy  | bevy_rerecast |\n|-------|---------------|\n| 0.16  | 0.2           |\n\n\n[`AvianBackendPlugin`]: https://docs.rs/avian_rerecast/latest/avian_rerecast/struct.AvianBackendPlugin.html\n[`RemotePlugin`]: https://docs.rs/bevy/latest/bevy/remote/struct.RemotePlugin.html\n[`RemoteHttpPlugin`]: https://docs.rs/bevy/latest/bevy/remote/http/struct.RemoteHttpPlugin.html\n[`NavmeshReady`]: https://docs.rs/bevy_rerecast/latest/bevy_rerecast/generator/struct.NavmeshReady.html\n[`NavmeshGenerator`]: https://docs.rs/bevy_rerecast/latest/bevy_rerecast/generator/struct.NavmeshGenerator.html\n[`NavmeshGenerator::regenerate`]: https://docs.rs/bevy_rerecast/latest/bevy_rerecast/generator/struct.NavmeshGenerator.html#tymethod.regenerate\n[`Mesh3d`]: https://docs.rs/bevy/latest/bevy/prelude/struct.Mesh3d.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanhohenheim%2Frerecast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanhohenheim%2Frerecast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanhohenheim%2Frerecast/lists"}