From 94471abdfeefb37aba024cf593f72823856d6ae1 Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Fri, 29 Sep 2023 10:46:25 -0700 Subject: [PATCH] content: Add exhibit entrances. --- all-is-cubes-content/src/city.rs | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/all-is-cubes-content/src/city.rs b/all-is-cubes-content/src/city.rs index f1a6c25b9..2f481627d 100644 --- a/all-is-cubes-content/src/city.rs +++ b/all-is-cubes-content/src/city.rs @@ -380,7 +380,38 @@ async fn place_exhibits_in_city( space.fill_uniform(enclosure, &demo_blocks[ExhibitBackground])?; exhibit_progress.progress(0.4).await; - // TODO: Add "entrances" so it's clear what the "front" of the exhibit is supposed to be. + // Cut an "entranceway" into the curb and grass + { + let front_face = plot_transform.rotation.transform(Face6::PZ); + // Compute the surface that needs to be clear for walking + let entrance_plane = enclosure + .expand(FaceMap { + // subtract enclosure bounds + nx: -1, + ny: 0, + nz: -1, + px: -1, + py: 0, + pz: -1, + }) + .abut(Face6::PY, 0) + .unwrap() + .abut(front_face, 1) // re-add enclosure bounds + .unwrap() + .abut( + front_face, + CityPlanner::PLOT_FRONT_RADIUS - CityPlanner::ROAD_RADIUS + 1, + ) + .unwrap(); + + let walkway = entrance_plane.abut(Face6::NY, 1).unwrap(); + space.fill_uniform(walkway, &demo_blocks[DemoBlocks::Road])?; + + let walking_volume = entrance_plane.abut(Face6::PY, 2).unwrap(); + space.fill_uniform(walking_volume, &AIR)?; + + planner.occupied_plots.push(walking_volume); + } // Draw exhibit info {