bevy_orca
Walkers that steer around each other without colliding. ORCA (optimal reciprocal collision avoidance) gives each agent the velocity closest to the one it wanted that no neighbour can object to, assuming every neighbour reasons the same way and each takes half the dodge. It is a plain library on bevy_math’s Vec2, with no ECS, plugin or schedule: you call a function and get a velocity back.
Add it
cargo add bevy_orca
The README has a single-agent quick start that is compiled on every cargo test.
What it gives you
new_velocityfor one agent, with a documented, finite answer for every unusable input and never a velocity overmax_speed(one agent).Crowdfor many: a neighbour grid, a deterministic tie-break, a sidewaysnudge, and no allocation once warm (a whole crowd).- Right of way through
priority, andCrowd::begin/CrowdStep::solve_rangeto split a step over your own thread pool with bit-identical results. ObstaclesBuilderfor buildings, walls, polygons and tile maps, as RVO2’s obstacle lines (static obstacles).serdeandreflectfeatures onAgent,CrowdMemberandCrowdParams.
Use it in the Cauldron
The Cauldron takes this crate behind its bevy_orca feature for the crowd preview (issue #107): it walks N people from one area of a map to another, each stepping with bevy_orca’s Crowd against its neighbours and against the cells the map’s pieces make solid, and lays their trails and congestion into a bevy_stigmergy field. The editor draws the result over the map with how many arrived and where congestion peaks, and saves nothing to the map. The settings it passes are the crate’s own CrowdParams, which are Serialize/Deserialize behind the serde feature.
Links
- Repository · docs.rs · crates.io · CHANGELOG