From d2a9f21927fd20c15f02bcf4af791f18c309b072 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 10:04:16 +0400 Subject: fix(ui): clear building roofs with the strategic camera --- crates/fparkan-runtime/src/strategic_view.rs | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'crates') diff --git a/crates/fparkan-runtime/src/strategic_view.rs b/crates/fparkan-runtime/src/strategic_view.rs index b22555f6..81d822eb 100644 --- a/crates/fparkan-runtime/src/strategic_view.rs +++ b/crates/fparkan-runtime/src/strategic_view.rs @@ -76,8 +76,13 @@ fn has_command_link(devices: &[crate::EffectiveControlDevice]) -> bool { } /// Initial external viewpoint of a command post, sampled from the current world. +/// `building_height` returns the highest building hit on the downward segment. #[must_use] -pub fn command_view(engine: &Engine, post: CommandPost) -> Option { +pub fn command_view( + engine: &Engine, + post: CommandPost, + building_height: impl FnOnce([[f32; 3]; 2]) -> Option, +) -> Option { let (handle, clearance) = match post { CommandPost::Bunker(handle) => (handle, 36.0), CommandPost::Warbot(handle) => (handle, 2.5), @@ -87,11 +92,15 @@ pub fn command_view(engine: &Engine, post: CommandPost) -> Option