Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Architecture Overview

Workspace Layout

recast-rs/
├── crates/
│   ├── landmark-common/      # Shared utilities, math, error types
│   ├── landmark/             # Navigation mesh generation
│   ├── waymark/              # Pathfinding and navigation queries
│   ├── waymark-crowd/        # Multi-agent crowd simulation
│   ├── waymark-tilecache/    # Dynamic obstacle management
│   ├── waymark-dynamic/      # Dynamic navmesh support
│   └── landmark-cli/         # Command-line tool
├── docs/                     # This mdbook documentation
├── .github/workflows/        # CI: ci.yml, cross-build.yml
└── .cargo/config.toml        # Build settings

Unit tests are inline #[cfg(test)] modules. Integration tests in crates/landmark/tests/ and crates/waymark/tests/. Examples in examples/. Benchmarks in per-crate benches/ directories.

C++ Module Mapping

C++ ModuleRust CrateC++ PrefixRust Module
Recastlandmarkrclandmark::
Detourwaymarkdtwaymark::
DetourCrowdwaymark-crowddtwaymark_crowd::
DetourTileCachewaymark-tilecachedtwaymark_tilecache::
DebugUtilslandmark-common::debugdulandmark_common::debug::
(none)waymark-dynamic-waymark_dynamic::

The waymark-dynamic crate has no C++ equivalent. It extends the original library with 7 collider types, async operations, and a checkpoint system.

Key Dependencies

PurposeCrateNotes
Vector mathglam 0.30WASM-compatible, game-oriented
Error typesthiserror 2.0Library error derivation
Bit flagsbitflags 2.10PolyFlags, NavMeshFlags
Byte orderbyteorder 1.5C++ binary format compatibility
Logginglog 0.4Logging facade
Float orderingordered-float 5.1Ordered floats for collections
Timingweb-time 1.1WASM-compatible Instant
Async (WASM)async-lock 3.4 + futures-lite 2.6Runtime-agnostic
Serializationserde 1.0 + postcard 1.1Optional feature
Compressionlz4_flex 0.12Pure Rust LZ4, WASM-compatible

Type Mappings from C++

C++Rust
floatf32
inti32
unsigned intu32
unsigned shortu16
unsigned charu8
float[3]glam::Vec3 or [f32; 3]
Raw pointer + size&[T] slice
Output parameterReturn value or &mut T
rcAlloc/rcFreeBox<T> or Vec<T>
rcContext*RecastContext + log crate
Return bool + output paramReturn Result<T, E>
Null pointer checkOption<T>
Virtual methodsTrait objects
dtPolyQueryPolyQuery trait