From 752d34af83acf9a818e22c621fb034913079acff Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 01:04:24 +0400 Subject: feat(ui): plot local detections on the cockpit radar Draw each current detection from the occupied unit sensor in camera-relative coordinates, with the original range scale, clan color and screen-pixel marks. Check stock Two Fortresses before and after a free-look turn and exercise the native rectangle and line callbacks. --- apps/fparkan-game/src/mission_overlay.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'apps/fparkan-game/src/mission_overlay.rs') diff --git a/apps/fparkan-game/src/mission_overlay.rs b/apps/fparkan-game/src/mission_overlay.rs index fb669e8d..66c0f837 100644 --- a/apps/fparkan-game/src/mission_overlay.rs +++ b/apps/fparkan-game/src/mission_overlay.rs @@ -1,6 +1,6 @@ use super::{ - altimeter_hud::AltimeterHud, course_hud::CourseHud, horizontal_fov, - satellite_map::SatelliteMap, StaticPreviewScene, StaticVulkanApp, + altimeter_hud::AltimeterHud, cockpit_radar_hud::CockpitRadarHud, course_hud::CourseHud, + horizontal_fov, satellite_map::SatelliteMap, StaticPreviewScene, StaticVulkanApp, }; #[cfg(windows)] use super::{mission_hints::MissionHints, weapon_hud::WeaponHud}; @@ -28,6 +28,7 @@ pub(super) struct MissionOverlay { pub(super) satellite_map: Option, course: Option, altimeter: Option, + pub(super) radar: Option, #[cfg(windows)] pub(super) hints: Option, #[cfg(windows)] @@ -62,6 +63,14 @@ impl MissionOverlay { None }) }); + let radar = cockpit.and_then(|_| { + CockpitRadarHud::load(preview) + .map(Some) + .unwrap_or_else(|error| { + eprintln!("cockpit_radar_unavailable reason={error}"); + None + }) + }); #[cfg(windows)] let hints = MissionHints::load(root, mission, preview) .map(Some) @@ -87,6 +96,7 @@ impl MissionOverlay { satellite_map, course, altimeter, + radar, #[cfg(windows)] hints, #[cfg(windows)] @@ -113,6 +123,9 @@ impl MissionOverlay { if let Some(altimeter) = &self.altimeter { remove(altimeter.range_index(), ranges, counts); } + if let Some(radar) = &self.radar { + remove(radar.range_index, ranges, counts); + } if let Some(course) = &self.course { for range in course.ranges() { remove(range, ranges, counts); -- cgit v1.2.3