3DBAG buildings as an optional checkbox (on by default) #12
Labels
No labels
agent
agent:ci
agent:done
agent:failed
agent:needs-input
agent:refined
agent:refining
agent:running
agent:skip
autonomous
driven
local
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jeroen/cartopolis#12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
3DBAG can only be disabled at the environment level (
VIBE_3DBAG_URL="",crates/viberfox/src/systems/osm_buildings.rs:64). In the Layers panel it isjust a static caption under the Buildings checkbox
(
crates/viberfox/src/systems/data_layers.rs:1187-1195); the onebuildings_enabledflag governs OSM meshes, window glow and the 3DBAG LoD2.2meshes together (
data_layers.rs:1008-1017). There is no way to run pure-OSMbuildings at runtime.
Approach
Add
tdbag_enabled: bool(defaulttrue) toDataLayers(
data_layers.rs:300), rendered as an indented checkbox "3DBAG (NL)" underBuildings — shown only when
tdbag_attribution()reports coverage, replacingthe static caption (an "OSM 3D buildings" label remains).
Route the flag through the existing coverage predicates rather than adding new
branches: mirror it into an
AtomicBoolinosm_buildingsand maketdbag_covers()(osm_buildings.rs:161) andlod22_covers()(
osm_buildings.rs:170) returnfalsewhile disabled. Toggling off thenbehaves exactly like the already-handled "host unreachable" case
(
osm_buildings.rs:104), and every fallback comes for free:update_lod22stops queueing covered cells (lod22.rs:194)osm_buildings.rs:510-520)osm_buildings.rs:610-615)osm_buildings.rs:1721)Two pieces of explicit cleanup on the off-edge, mirroring the re-anchor
teardown (
lod22.rs:136-148): despawn the spawnedLod22Meshcells, callcolliders.clear_lod22(), and clearlod.requestedso re-enabling re-queuesthem. Track the previous toggle state in
Lod22Buildings(or aLocal) torun this once per edge. Re-enabling needs no extra work: lod22 cells re-queue,
and the existing
over_lod22path despawns the OSM detail patch(
osm_buildings.rs:514-517).Acceptance criteria
Verification
cargo check -p viberfoxcargo test -p viberfox --bin viberfoxVIBE_3DBAG_URL="" cargo shots --only <groningen preset>should look identical to the toggled-off panel state.Out of scope
osm_buildings.rs:190) and wash out on the next re-anchor. The attribution footer therefore also stays gated on coverage presence, not on the toggle.Branch:
feat/12-3dbag-toggle