spatial-monorepo / wayfinding/src / detectFloorTransitions
Function: detectFloorTransitions()
detectFloorTransitions(
route,graph):FloorTransition[]
Defined in: packages/wayfinding/src/transitions.ts:40
Detect floor transitions in a route by comparing consecutive leg levelIds.
For each pair of adjacent legs where the floor changes:
- The transition coordinate is the last point of the departing leg.
- The category is read from the departing leg's own
floorChange.viainstruction when present (grid engine); otherwise it falls back to the nearest graph node withinVERTICAL_NODE_SEARCH_RADIUS_Mof the transition coordinate (legacy engine, whose leg endpoint IS the node coordinate). - If neither source resolves a category, it defaults to
'elevator'.
