Expand description
Layered 2.5-D crowd locomotion for multi-storey environments.
In real buildings (stations, airports, malls, stadiums) pedestrians spend the vast majority of their time walking on a floor and only occasionally transition vertically via stairs, escalators, ramps, or lifts. Running full 3-D collision physics for every pedestrian all of the time is wasteful and numerically fragile.
The industry-standard approach (used by JuPedSim, MassMotion, Legion)
is layered 2.5-D: each pedestrian lives on a floor (integer
index) and its planar (x, y) motion is advanced by one of the 2-D
models in the crate (Social Force by default). Vertical motion is
scripted by the rustsim-mobility crate through
FloorTransitions — the pedestrian reaches a connector, is placed
on the next floor, and its planar state is preserved.
This module defines the data model:
Pedestrian3D— 2-D pose plus floor index and vertical offset.WallPolygon3D— a polyline of 3-D segments, one per floor, used by renderers and per-floor-physics setup.FloorTransition— a connector (stair, escalator, ramp, lift) that maps a 2-D region on floor A to a 2-D region on floor B with an associated travel time.LayeredSpace— a container of floors, walls, and connectors.step_layered— advance every pedestrian by one tick, delegating per-floor motion to a provided 2-D model step function.
Structs§
- Active
Transition - An active transition a pedestrian is currently riding.
- Floor
Transition - A connector between two floors.
- Layered
Scratch - Advance every pedestrian in
pedsbydtusingplanar_stepas the per-floor physics andspacefor walls and connectors. - Layered
Space - A multi-floor environment.
- Pedestrian3D
- A pedestrian in a layered 2.5-D environment.
- Wall
Polygon3D - A polyline wall that spans a single floor.
Enums§
- Connector
Kind - Kind of vertical connector.
Traits§
- Layered
Observer - Per-pedestrian post-step observation hook for the layered 2.5-D drive.
Functions§
- step_
layered - Advance every pedestrian in
pedsbydt. Convenience wrapper that allocates oneLayeredScratchper call and immediately drops it; preferstep_layered_scratchwhen the same simulation drives successive ticks. - step_
layered_ scratch - Zero-allocation variant of
step_layered. - step_
layered_ scratch_ observed - Observed variant of
step_layered_scratch: identical semantics, plus a post-tick callback for every pedestrian.
Type Aliases§
- FloorId
- Integer floor index. 0 = ground floor, 1 = first floor, etc.
- Planar
Step Fn - Function that advances a slice of 2-D pedestrians on a single floor by
dt.