@@ -4,6 +4,7 @@ A Rust port of [RecastNavigation](https://github.com/recastnavigation/recastnavi
44
55[ ![ License] ( https://img.shields.io/badge/license-MIT%2FApache--2.0-blue )] ( LICENSE-MIT )
66[ ![ Rust Version] ( https://img.shields.io/badge/rust-1.85+-orange.svg )] ( https://www.rust-lang.org )
7+ [ ![ WASM Compatible] ( https://img.shields.io/badge/WASM-compatible-green.svg )] ( https://webassembly.org/ )
78
89> ** Note** : This port is developed for the [ WoW Emulation project] [ wowemu ] and
910> has not been used outside of that context. The API may change as the project
@@ -18,20 +19,15 @@ It is a Rust 2024 edition port of Mikko Mononen's RecastNavigation C++ library.
1819
1920## Workspace Structure
2021
21- ``` text
22- recast-rs/
23- ├── crates/
24- │ ├── recast-common/ # Shared utilities, math, error types
25- │ ├── recast/ # Navigation mesh generation
26- │ ├── detour/ # Pathfinding and navigation queries
27- │ ├── detour-crowd/ # Multi-agent crowd simulation
28- │ ├── detour-tilecache/ # Dynamic obstacle management
29- │ ├── detour-dynamic/ # Dynamic navmesh support
30- │ └── recast-cli/ # Command-line tool
31- ├── examples/ # Example applications
32- ├── benches/ # Performance benchmarks
33- └── tests/ # Integration tests
34- ```
22+ | Crate | Description | WASM |
23+ | -------| -------------| ------|
24+ | ` recast-common ` | Shared utilities, math, error types | Yes |
25+ | ` recast ` | Navigation mesh generation | Yes |
26+ | ` detour ` | Pathfinding and navigation queries | Yes |
27+ | ` detour-crowd ` | Multi-agent crowd simulation | Yes |
28+ | ` detour-tilecache ` | Dynamic obstacle management | Yes |
29+ | ` detour-dynamic ` | Dynamic navmesh support | Yes |
30+ | ` recast-cli ` | Command-line tool | No |
3531
3632### Crate Dependencies
3733
@@ -124,7 +120,7 @@ cargo build --release
124120
125121- ` serialization ` - Save/load navigation meshes
126122- ` parallel ` - Multi-threaded mesh generation (not WASM-compatible)
127- - ` async ` - Async I/O operations (not WASM-compatible)
123+ - ` tokio ` - Tokio runtime integration for ` detour-dynamic ` (not WASM-compatible)
128124
129125### Platform Support
130126
@@ -133,6 +129,34 @@ cargo build --release
133129- Windows (x86_64)
134130- WebAssembly (wasm32-unknown-unknown)
135131
132+ ## WebAssembly Support
133+
134+ All library crates support WebAssembly (` wasm32-unknown-unknown ` ). Build for WASM with:
135+
136+ ``` bash
137+ cargo build --target wasm32-unknown-unknown -p recast -p detour
138+ ```
139+
140+ ### WASM-Compatible Features
141+
142+ | Feature | Native | WASM | Notes |
143+ | ---------| --------| ------| -------|
144+ | Mesh generation | Yes | Yes | Full support |
145+ | Pathfinding | Yes | Yes | Full support |
146+ | Crowd simulation | Yes | Yes | Full support |
147+ | Dynamic obstacles | Yes | Yes | Full support |
148+ | Async operations | Yes | Yes | Runtime-agnostic via ` async-lock ` |
149+ | File I/O | Yes | No | Use ` std ` feature to disable |
150+ | Parallel processing | Yes | No | Disable ` parallel ` feature |
151+ | Serialization | Yes | Yes | In-memory only on WASM |
152+
153+ ### WASM Usage Notes
154+
155+ - ** recast-common** : Disable file I/O with ` default-features = false `
156+ - ** detour** : Serialization works with in-memory buffers
157+ - ** detour-tilecache** : Uses pure Rust LZ4 (` lz4_flex ` )
158+ - ** detour-dynamic** : Async via ` async-lock ` and ` futures-lite ` (no tokio required)
159+
136160## License
137161
138162Dual-licensed under either:
0 commit comments