Label buildings and signs on the top-down map #53

Merged
sermuns merged 1 commit from issue-36-map-labels into main 2026-10-19 19:26:42 +00:00
Owner

Closes #36.

The M overview now carries text: one name per named building at its footprint
centroid, plus named POIs once the view is zoomed in far enough to read them.
Map labels go through the same WorldLabel pipe as first-person labels, so no
bake text is copied.

How

  • HudInfo.in_map became HudInfo.map: Option<MapView>. MapView carries the
    ortho focus and world-unit height, and FrameView::Map uses it too, so the
    HUD projects through exactly the camera that rts_pick reads.
  • liuverse_world::rts_project is the inverse of rts_pick, with a roundtrip
    test, so map labels and map clicks share one camera contract.
  • hud::map_labels culls to the visible ENU rectangle derived from the map
    height and viewport, which makes the label set follow the zoom.
  • Building names are keyed by building, not proximity: a hall is named once at
    campus scale however many floors it has.
  • Signs are limited to named POIs and only below SIGN_LABEL_HEIGHT; two signs
    with the same text within a couple of metres are deduped, so a café repeated
    on every floor becomes one label.

Room labels

The issue mentions room labels, which I left out deliberately. The bake has
6319 room markers with a median spacing around 1.2 m; from above they collapse
into a wall of text even at close zoom. First-person signage already shows the
room you are in. Stairs and elevators are left out for the same reason. Happy to
revisit if you want a zoom threshold where room codes appear.

Checks

just check passes fmt, clippy and deny. cargo test --workspace needed
CARGO_BUILD_RUSTDOC=/usr/bin/rustdoc because .cargo/config.toml points
build.rustdoc at a kache shim that is not installed here; that is an
environment issue, unrelated to this change.

Closes #36. The `M` overview now carries text: one name per named building at its footprint centroid, plus named POIs once the view is zoomed in far enough to read them. Map labels go through the same `WorldLabel` pipe as first-person labels, so no bake text is copied. ## How - `HudInfo.in_map` became `HudInfo.map: Option<MapView>`. `MapView` carries the ortho focus and world-unit height, and `FrameView::Map` uses it too, so the HUD projects through exactly the camera that `rts_pick` reads. - `liuverse_world::rts_project` is the inverse of `rts_pick`, with a roundtrip test, so map labels and map clicks share one camera contract. - `hud::map_labels` culls to the visible ENU rectangle derived from the map height and viewport, which makes the label set follow the zoom. - Building names are keyed by building, not proximity: a hall is named once at campus scale however many floors it has. - Signs are limited to named POIs and only below `SIGN_LABEL_HEIGHT`; two signs with the same text within a couple of metres are deduped, so a café repeated on every floor becomes one label. ## Room labels The issue mentions room labels, which I left out deliberately. The bake has 6319 room markers with a median spacing around 1.2 m; from above they collapse into a wall of text even at close zoom. First-person signage already shows the room you are in. Stairs and elevators are left out for the same reason. Happy to revisit if you want a zoom threshold where room codes appear. ## Checks `just check` passes fmt, clippy and deny. `cargo test --workspace` needed `CARGO_BUILD_RUSTDOC=/usr/bin/rustdoc` because `.cargo/config.toml` points `build.rustdoc` at a kache shim that is not installed here; that is an environment issue, unrelated to this change.
The map drew no text at all. Reuse the world label pipe with a map
projection: one name per named building at its footprint centroid, and
named POIs while the view is close enough to read them. Rooms, stairs and
elevators stay out: they are metres apart and collapse into a wall of
text from above, while first-person signage already covers them.

MapView replaces HudInfo.in_map so the HUD projects through the same ortho
camera as picking; liuverse_world::rts_project is its inverse.

closes #36
sermuns force-pushed issue-36-map-labels from bea105c7a2 to 2116f66421 2026-10-19 19:24:24 +00:00 Compare
Sign in to join this conversation.
No description provided.