#[non_exhaustive]pub struct Pedestrian3D {
pub base: Pedestrian,
pub floor: FloorId,
pub z_offset: f64,
pub transition: Option<ActiveTransition>,
pub target_floor: Option<FloorId>,
}Expand description
A pedestrian in a layered 2.5-D environment.
Construct with Pedestrian3D::grounded or
Pedestrian3D::heading_to_floor — the type is #[non_exhaustive]
so future field additions (e.g. lift call-button state, floor
preferences) are non-breaking for downstream callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.base: Pedestrian2-D pose on the current floor.
floor: FloorIdFloor index.
z_offset: f64Vertical offset from the floor slab (m). Non-zero while on a connector; 0 when grounded on the floor.
transition: Option<ActiveTransition>Optional ongoing vertical transition.
target_floor: Option<FloorId>Planner-owned floor intent. Some(f) means the pedestrian wants
to reach floor f; None means “stay on current floor”.
Boarding a connector is gated on target_floor != Some(self.floor),
so an agent whose 2-D destination happens to overlap a boarding
zone on the same floor (or an agent that just alighted onto
that destination) will not re-enter the connector. This
fixes a long-standing re-entry bug in naïve spatial-only boarding.
Implementations§
Source§impl Pedestrian3D
impl Pedestrian3D
Sourcepub fn grounded(base: Pedestrian, floor: FloorId) -> Self
pub fn grounded(base: Pedestrian, floor: FloorId) -> Self
Convenience constructor grounded on floor with no vertical intent.
Sourcepub fn heading_to_floor(
base: Pedestrian,
floor: FloorId,
target: FloorId,
) -> Self
pub fn heading_to_floor( base: Pedestrian, floor: FloorId, target: FloorId, ) -> Self
Grounded constructor that explicitly requests a target floor.
Sourcepub fn pos_3d(&self, space: &LayeredSpace) -> Vec3
pub fn pos_3d(&self, space: &LayeredSpace) -> Vec3
Full 3-D position, combining the floor elevation provided by the
LayeredSpace with the local 2-D pose and vertical offset.
Trait Implementations§
Source§impl Clone for Pedestrian3D
impl Clone for Pedestrian3D
Source§fn clone(&self) -> Pedestrian3D
fn clone(&self) -> Pedestrian3D
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more