#recast #detour #navigation #mesh #pathfinding

sys recastnavigation-sys

Raw FFI bindings for recastnavigation

3 stable releases

1.0.2 Sep 30, 2023
1.0.1 May 6, 2023
1.0.0 May 1, 2023

#931 in Game dev

Download history 17/week @ 2023-08-06 25/week @ 2023-08-13 20/week @ 2023-08-20 10/week @ 2023-08-27 24/week @ 2023-09-03 29/week @ 2023-09-10 15/week @ 2023-09-17 38/week @ 2023-09-24 30/week @ 2023-10-01 16/week @ 2023-10-08 17/week @ 2023-10-15 26/week @ 2023-10-22 18/week @ 2023-10-29 20/week @ 2023-11-05 21/week @ 2023-11-12 20/week @ 2023-11-19

82 downloads per month
Used in 3 crates

Custom license

40K SLoC

C++ 38K SLoC // 0.1% comments Rust 1K SLoC // 0.0% comments C 404 SLoC // 0.2% comments Lua 223 SLoC // 0.1% comments C# 69 SLoC // 0.3% comments


Raw Rust bindings for recastnavigation, including Recast, Detour, DetourCrowd, and DetourTileCache.

Structure of the crate

These are the raw FFI bindings for all libraries in recastnavigation. Each library is enabled by a feature flag with the corresponding name:

  • recast -> Recast
  • detour -> Detour
  • detour_crowd -> DetourCrowd
  • detour_tile_cache -> DetourTileCache

In addition to the library feature flags are the "extra features". Currently, these are:

  • detour_large_nav_meshes - enables 64-bit dtPolyRefs, allowing for larger navigation meshes in Detour (and its dependents). Note this means wrappers around Detour should be aware that dtPolyRefs can have different sizes and either have a static assertion of the expected dtPolyRef size, or ensure that your wrapper can handle both dtPolyRef sizes.

Finding vs vendoring

By default, this crate will first look for recastnavigation using pkgconfig. If recastnavigation cannot be found, this crate will build it from the recastnavigation directory (aka vendoring).

To always vendor, set RECAST_VENDOR=true in your environment variables. This will not search for a system-installed recastnavigation and instead will always build recastnavigation from the source in this crate.

To never vendor, set RECAST_NO_VENDOR=true in your environment variables. This will search for a system-installed recastnavigation and will fail to build this crate if it is missing. Note this takes precedence over RECAST_VENDOR=true.


Unfortunately, recastnavigation does not have a regular release process. First this means that requiring a certain version from pkgconfig is unreliable - hopefully, compilation errors will make it clear that recastnavigation is stale. Second, this crate's version number cannot really track recastnavigation's version. The goal is to track recastnavigation changes using semantic versioning, although practically not every commit to recastnavigation will correspond to a version of this crate. Bumping recastnavigation should be requested with an issue if necessary.


Licensed under the MIT license. This does not extend to the recastnavigation directory, which contains the contents of the recastnavigation project (as a Git submodule).