Draw a held-key world overlay of targets through the drawn camera (#132)
build / mod (push) Failing after 59s

Holding C draws square markers over the targets the player can see, each
with the class the radars estimated and the distance; an unidentified
track stays a "?", never the target's type. Stale forecast tracks fade
orange and say their age, the player's own interceptors wear small yellow
squares, and the sandbox truth mode adds white markers of the real drones
apart from the network's estimates. Letting the key go clears the HUD.

The markers project through the camera of the last drawn frame
(render.project, API 31), so they sit on the world as it is drawn and
follow the view frame by frame; the overlay stays off under a replay, the
grid J, the monitor K and the map M, which own the screen themselves. A
full raid stays inside the HUD's 1024-shape budget, keeping the nearest
markers and counting the rest behind the camera or past the edges.

Bump the engine pin to 2bcce6423 (API 31, render.project) and name API 31
in the capabilities diagnostic to match.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
This commit is contained in:
2026-11-21 00:35:15 +03:00
parent 795b1b2fcf
commit a983177d34
8 changed files with 382 additions and 6 deletions
+9 -1
View File
@@ -188,6 +188,14 @@ API мода `render.set-lights` (до 512, плавно интерполиру
песочницы: в нём белые рамки показывают даже незамеченные аппараты, а жёлтый пунктир — их цель и будущий
маршрут. Этот режим не меняет боевую логику.
**Обзор целей поверх мира:** удерживай **C** — вокруг видимых целей появляются квадратные метки с краткой
строкой: класс, который оценили РЛС (неопознанная цель — «?», без утечки типа), и дистанция; устаревший
трек-прогноз оранжевый и помечен возрастом. Свои перехватчики — маленькие жёлтые квадраты. Это данные сети
РЛС, как на радаре и карте; в режиме «Истина» (`/airdef truth on`, T на карте) добавляются белые рамки
реальных дронов с их настоящим типом — отдельно от сетевых оценок, чтобы видеть расхождение. Отпустил
клавишу — метки исчезли. Метки проектируются через камеру последнего отрисованного кадра (`render.project`,
API 31 форка) и следуют за взглядом покадрово; поверх повтора, сетки J, монитора K и карты M обзор не рисуется.
**Повторы.** Каждый налёт записывается сам: с первой цели в небе до момента, когда небо 5 с чисто
(хранятся 3 последних). Меню N → «Повторы…» или клавиша **R**:
- **карта налёта** — вид сверху: комплексы и их зоны, объекты, треки целей (красные), ложных целей (серые) и
@@ -206,7 +214,7 @@ API мода `render.set-lights` (до 512, плавно интерполиру
Чтобы в повторах и камерах комплексов была видна земля далеко от игрока, мод включает дальний ландшафт
(48 чанков, упрощённый); выключается в меню N → «Огонь, ремонт, эффекты…» → «Дальний ландшафт».
Клавиши N, K, J, R и U можно переназначить в «Настройки → Моды».
Клавиши N, K, J, R, U и C (обзор целей, удержание) можно переназначить в «Настройки → Моды».
Команды:
- `/airdef wave <тип> [кол-во] [дальность]` — налёт на ближайшую цель. Дальность старта — от 60 до 4000 блоков (в меню: 200–4000); землю для площадок, которой нет в загруженных чанках, игра подгружает сама (API 22, `render.load-chunks`, пока идёт поиск), а где подгрузить нельзя (сервер) или нет пригодного места, дроны всё равно стартуют: «за картой», с высоты полёта на заказанной дальности, без площадки. Типы: `shahed`, `geran3`, `lancet`, `gerbera`, `kh101`, `kalibr`, `kh22`, `zircon`, `iskander`, `kinzhal`, `oreshnik` и `mix` (комбинированный удар двумя секторами: «Герберы», шахеды, Герани-3, Х-101, «Калибры», Х-22, Циркон, «Искандер», «Кинжал», при 30+ — «Орешник»);
+1 -1
View File
@@ -102,7 +102,7 @@ pub fn diagnostics() -> String {
render::SmokeReason::Ready => "ready",
};
[
"Возможности движка (API 30; подготовка не означает готовый GPU-кадр, слышимый звук или файл):".into(),
"Возможности движка (API 31; подготовка не означает готовый GPU-кадр, слышимый звук или файл):".into(),
line(
"Дым",
smoke.generation,
+48
View File
@@ -21,6 +21,7 @@ mod layout;
mod map;
mod film;
mod monitor;
mod overlay;
mod panel;
mod presentation;
mod radar;
@@ -97,6 +98,10 @@ struct AirDef {
by_id: Vec<ModelInstanceId>,
/// The command map (#48).
map: map::MapUi,
/// The world overlay's key held (#132): markers over normal gameplay while it is.
overlay_held: bool,
/// The overlay's shapes are the mod's `set-hud` now: cleared when it lets go.
overlay_shown: bool,
}
/// What `/airdef replay export` was asked for.
@@ -880,6 +885,22 @@ impl AirDef {
render::set_corner(render::Corner::BottomRight, radar::SIZE, radar::height(truth_label), &radar::draw(&self.sim, player, yaw));
}
/// Whether the world overlay draws now (#132): its key held over normal gameplay — not under
/// a replay, the grid, a monitor or the map, which own the screen themselves.
fn overlay_active(&self) -> bool {
self.overlay_held
&& self.presentation.is_live()
&& !self.grid
&& self.monitor.is_none_or(|i| i >= self.sim.sams.len())
&& !self.map.open
}
fn draw_overlay(&mut self) {
let Some(p) = player() else { return };
let shapes = overlay::draw(&self.sim, DVec3::new(p.x, p.y, p.z), render::gui_size(), |w| render::project(w.x, w.y, w.z));
render::set_hud(&shapes);
}
// ------------------------------------------------ saving
/// The state as text, lines of words: the autosave's format, and the body of a scenario.
@@ -1208,6 +1229,9 @@ impl AirDef {
self.map_close();
self.grid = false;
self.grid_ids.clear();
// The overlay key lets go with the world: its camera projects nothing here anyway.
self.overlay_held = false;
self.overlay_shown = false;
// The last world's transient state: its sounds were due on its own
// clock, its picked unit may have another meaning in this one, and
// its models would stay until the next full model list.
@@ -1872,8 +1896,12 @@ impl Mod for AirDef {
model_generation: u32::MAX,
by_id: Vec::new(),
map: map::MapUi::default(),
overlay_held: false,
overlay_shown: false,
};
let _ = input::register_key("map", "Карта: командная, расстановка", "key.keyboard.m");
// C is free in vanilla's bindings and the mod's own; the player may rebind it.
let _ = input::register_key("overlay", "Обзор: метки целей вокруг видимых дронов и ракет (удерживать)", "key.keyboard.c");
let _ = input::register_key("menu", "Меню AirDef", "key.keyboard.n");
let _ = input::register_key("monitor", "Монитор ПВО: следующий комплекс", "key.keyboard.k");
let _ = input::register_key("grid", "Командный пункт: все комплексы", "key.keyboard.j");
@@ -1910,6 +1938,9 @@ impl Mod for AirDef {
for event in input::poll() {
match event {
Event::UseStart(u) => self.use_item(&u.item.id),
// The overlay is a hold, not a toggle (#132): down draws, up clears.
Event::KeyDown(k) if k == "overlay" => self.overlay_held = true,
Event::KeyUp(k) if k == "overlay" => self.overlay_held = false,
Event::KeyDown(k) if k == "map" => self.map_toggle(),
Event::KeyDown(k) if k == "menu" => {
if self.presentation.playback().is_some() {
@@ -2106,6 +2137,15 @@ impl Mod for AirDef {
render::set_views(&[]);
self.monitor_shown = false;
}
// The world overlay owns the HUD while its key is held over normal gameplay;
// the frame hook redraws it every frame, the tick keeps the ownership honest.
if self.overlay_active() {
self.draw_overlay();
self.overlay_shown = true;
} else if self.overlay_shown {
render::set_hud(&[]);
self.overlay_shown = false;
}
}
}
}
@@ -2349,6 +2389,12 @@ impl Mod for AirDef {
/// export still active there is ended, so its capture cannot go on recording the title.
fn frame(&mut self, _seconds: f32) {
if self.presentation.is_live() {
// The overlay tracks the drawn camera frame by frame (`render.project` is at most a
// frame behind); the other screens own the HUD at the tick's pace, as before.
if self.overlay_active() {
self.draw_overlay();
self.overlay_shown = true;
}
return;
}
if let Some(cleanup) = self.presentation.world_left(world_identity().as_deref()) {
@@ -2724,6 +2770,8 @@ mod tests {
model_generation: u32::MAX,
by_id: Vec::new(),
map: map::MapUi::default(),
overlay_held: false,
overlay_shown: false,
}
}
+311
View File
@@ -0,0 +1,311 @@
//! The world overlay (#132): while the player holds the overlay key, square markers over the
//! targets they can see, each with a short line — the class the radars estimated (#133) and the
//! distance. The picture is the network's, as the radar and the map read it; the sandbox's truth
//! mode adds white markers of the real drones, labelled with their actual type, apart from the
//! network's. The player's own interceptors wear small yellow squares, as the radar shows them.
//! Letting the key go hides everything. The markers are projected through the camera the last
//! drawn frame used (`render.project`, API 31), so they sit on the world as it is drawn.
use crate::panel::distance;
use crate::sim::{ClassEst, Sim, Track};
use glam::DVec3;
use horizon_mod_sdk::render::{FillShape, Point, Rect, Shape, TextShape};
/// The most markers of one picture (the network's and the truth's each): a full raid still fits
/// the HUD's 1024 shapes — a marker is four sides and a label.
const MAX_MARKERS: usize = 64;
/// A marker's side thickness, pixels.
const LINE: f32 = 1.0;
/// A label line's height (the HUD font with its shadow).
const LH: f32 = 9.0;
/// The half-size a marker clamps to, near and far.
const HALF_MIN: f32 = 5.0;
const HALF_MAX: f32 = 16.0;
const RED: u32 = 0xFF4040;
const ORANGE: u32 = 0xFFB040;
const WHITE: u32 = 0xFFFFFFFF;
const GREEN: u32 = 0xFF80FF90;
const YELLOW: u32 = 0xFFFFE070;
/// The interceptors' own colour (the radar's missile dot).
const MISSILE: u32 = 0xFFE060;
/// An interceptor's marker half-size: small, it is not a target.
const MISSILE_HALF: f32 = 3.0;
fn pt(x: f32, y: f32) -> Point {
Point { x, y }
}
fn text(t: String, x: f32, y: f32, color: u32, centered: bool) -> Shape {
Shape::Text(TextShape { text: t, at: pt(x, y), color, centered, shadow: true })
}
/// 0xAARRGGBB with this alpha (0..1).
fn alpha(rgb: u32, a: f64) -> u32 {
((a.clamp(0.0, 1.0) * 255.0) as u32) << 24 | (rgb & 0xFFFFFF)
}
/// A square outline around a screen point: four thin fills, the world's marker.
fn square_outline(x: f32, y: f32, half: f32, color: u32) -> Vec<Shape> {
let (w, h) = (half * 2.0, LINE);
vec![
Shape::Fill(FillShape { rect: Rect { x: x - half, y: y - half, w, h }, color }),
Shape::Fill(FillShape { rect: Rect { x: x - half, y: y + half - LINE, w, h }, color }),
Shape::Fill(FillShape { rect: Rect { x: x - half, y: y - half, w: h, h: w }, color }),
Shape::Fill(FillShape { rect: Rect { x: x + half - LINE, y: y - half, w: h, h: w }, color }),
]
}
/// A marker's half-size by the distance: near targets read bigger, far ones stay legible.
fn half(dist: f64) -> f32 {
(700.0 / dist.max(1.0)).clamp(HALF_MIN as f64, HALF_MAX as f64) as f32
}
/// The short line under a network marker: the estimated class's mark (#133) and the distance to
/// the forecast place; a forecast says how old it is. An unidentified track gets a `?`, never the
/// target's type.
fn track_label(t: &Track, now: u64, player: DVec3) -> String {
let mark = match t.class {
ClassEst::Unknown => "?",
c => c.mark(),
};
let mut s = format!("{mark} {}", distance(t.est(now).distance(player)));
if t.forecast(now) {
s += &format!(" ~{}с", t.age(now) / 20);
}
s
}
/// Where a marker's label sits: under the square, or over it when the bottom edge is close.
fn label_y(y: f32, half: f32, gui_h: f32, above: bool) -> f32 {
if above {
if y - half - LH - 2.0 >= 0.0 { y - half - LH - 2.0 } else { y + half + 2.0 }
} else if y + half + LH + 2.0 <= gui_h {
y + half + 2.0
} else {
y - half - LH - 2.0
}
}
/// The overlay's shapes for this frame. `project` is the game's `render.project` (the last drawn
/// frame's camera); a point behind the camera projects to None, a point off the screen still
/// projects past its edges — both are counted, not drawn. Drawn only while the key is held.
pub fn draw(sim: &Sim, player: DVec3, gui: (f32, f32), project: impl Fn(DVec3) -> Option<Point>) -> Vec<Shape> {
let mut s = Vec::new();
if gui.0 <= 0.0 || gui.1 <= 0.0 {
return s;
}
let pic = sim.air_picture();
let now = pic.now;
let truth = sim.truth && !pic.unaided;
// The network's tracks, nearest first: a full raid keeps the closest markers.
let mut tracks: Vec<&Track> = pic.tracks.iter().collect();
tracks.sort_by(|a, b| a.est(now).distance(player).total_cmp(&b.est(now).distance(player)));
let mut shown = 0usize;
let mut hidden = tracks.len().saturating_sub(MAX_MARKERS);
for t in tracks.into_iter().take(MAX_MARKERS) {
let e = t.est(now);
let dist = e.distance(player);
let Some(p) = project(e) else { hidden += 1; continue };
let h = half(dist);
if p.x < h || p.x > gui.0 - h || p.y < h || p.y > gui.1 - h {
hidden += 1;
continue;
}
// Fresh: red; a forecast: orange, fading as it ages towards the track's drop (the radar's colours).
let (color, a) = if pic.unaided {
(RED, 1.0)
} else if t.forecast(now) {
(ORANGE, (1.0 - t.age(now) as f64 / t.ttl.max(1) as f64 * 0.7).max(0.3))
} else {
(RED, 1.0)
};
let color = alpha(color, a);
s.extend(square_outline(p.x, p.y, h, color));
s.push(text(track_label(t, now, player), p.x, label_y(p.y, h, gui.1, false), color, true));
shown += 1;
}
// The truth's own markers: the real drones, even the ones no radar holds, white and labelled
// with the actual type the network never shows. A tracked drone wears both: the network's
// estimate under the square, the truth over it — the offset between them is the point.
if truth {
let mut drones: Vec<_> = sim.drones.iter().filter(|d| d.alive()).collect();
drones.sort_by(|a, b| a.pos.distance(player).total_cmp(&b.pos.distance(player)));
hidden += drones.len().saturating_sub(MAX_MARKERS);
for d in drones.into_iter().take(MAX_MARKERS) {
let Some(p) = project(d.pos) else { hidden += 1; continue };
let h = half(d.pos.distance(player)) + 2.0;
if p.x < h || p.x > gui.0 - h || p.y < h || p.y > gui.1 - h {
hidden += 1;
continue;
}
s.extend(square_outline(p.x, p.y, h, WHITE));
let label = format!("{} {}", d.kind.spec().name, distance(d.pos.distance(player)));
s.push(text(label, p.x, label_y(p.y, h, gui.1, true), WHITE, true));
shown += 1;
}
}
// The player's own interceptors: small yellow squares, no label — they are not targets, and
// the network never hid them (the radar has always shown them).
let mut missiles: Vec<_> = sim.missiles.iter().collect();
missiles.sort_by(|a, b| a.pos.distance(player).total_cmp(&b.pos.distance(player)));
for m in missiles.into_iter().take(MAX_MARKERS) {
let Some(p) = project(m.pos) else { continue };
let h = MISSILE_HALF;
if p.x < h || p.x > gui.0 - h || p.y < h || p.y > gui.1 - h {
continue;
}
s.extend(square_outline(p.x, p.y, h, MISSILE));
}
// The mode, named as the map names it: the network's data by default, the sandbox's truth
// explicitly marked. The counts say what the frame holds and what stayed behind the camera
// or past the edges.
let head = if truth {
format!("ОБЗОР · ИСТИНА (песочница): белые рамки — реальные дроны · в кадре {shown}, за кадром {hidden}")
} else {
format!("ОБЗОР · данные сети РЛС · в кадре {shown}, за кадром {hidden}")
};
s.push(text(head, gui.0 / 2.0, 2.0, if truth { YELLOW } else { GREEN }, true));
s
}
#[cfg(test)]
mod tests {
use super::*;
use crate::sim::{DroneKind, Out, Sam, SamKind};
const GUI: (f32, f32) = (800.0, 600.0);
/// A projector as the game's: the world ahead lands on the screen, behind the camera None.
/// Here: south (+z) is ahead, x spreads across the screen, the height lines up at 64.
fn ahead(p: DVec3) -> Option<Point> {
if p.z <= 0.0 {
return None;
}
Some(pt(400.0 + p.x as f32, 300.0 - (p.y - 64.0) as f32))
}
fn sim_with(kind: DroneKind, at: DVec3) -> Sim {
let mut sim = Sim::new(1);
sim.launch(kind, at, DVec3::ZERO, DVec3::new(at.x, 64.0, 5000.0), &mut Out::default());
sim
}
fn fills(shapes: &[Shape], rgb: u32) -> usize {
shapes.iter().filter(|s| matches!(s, Shape::Fill(f) if f.color & 0xFFFFFF == rgb & 0xFFFFFF)).count()
}
fn texts(shapes: &[Shape]) -> Vec<&TextShape> {
shapes.iter().filter_map(|s| match s {
Shape::Text(t) => Some(t),
_ => None,
}).collect()
}
#[test]
fn a_visible_target_gets_a_square_and_a_short_line() {
let sim = sim_with(DroneKind::Shahed, DVec3::new(0.0, 64.0, 100.0));
let shapes = draw(&sim, DVec3::new(0.0, 64.0, 0.0), GUI, ahead);
// One marker: four red sides, and a label with the firm class's mark and the distance.
assert_eq!(fills(&shapes, RED), 4, "the marker is not one square outline");
let label = texts(&shapes).into_iter().find(|t| t.text.contains("100 м")).expect("no distance label");
assert!(label.text.starts_with("Д "), "the firm drone class is not marked: {}", label.text);
assert!(label.centered && label.at.y > 300.0, "the label sits under the square");
// The header names the network's data and the counts.
let head = texts(&shapes).into_iter().find(|t| t.text.starts_with("ОБЗОР")).unwrap();
assert!(head.text.contains("данные сети РЛС") && head.text.contains("в кадре 1, за кадром 0"), "{}", head.text);
}
#[test]
fn behind_the_camera_and_off_screen_are_counted_not_drawn() {
let mut sim = sim_with(DroneKind::Shahed, DVec3::new(0.0, 64.0, 100.0));
sim.launch(DroneKind::Shahed, DVec3::new(0.0, 64.0, -100.0), DVec3::ZERO, DVec3::new(0.0, 64.0, -5000.0), &mut Out::default());
let shapes = draw(&sim, DVec3::ZERO, GUI, ahead);
assert_eq!(fills(&shapes, RED), 4, "the drone behind the camera drew a marker");
let head = texts(&shapes).into_iter().find(|t| t.text.starts_with("ОБЗОР")).unwrap();
assert!(head.text.contains("в кадре 1, за кадром 1"), "{}", head.text);
// Off the screen's edge: still a place, but no marker.
let shapes = draw(&sim, DVec3::ZERO, GUI, |_| Some(pt(-40.0, 300.0)));
assert_eq!(fills(&shapes, RED), 0);
let head = texts(&shapes).into_iter().find(|t| t.text.starts_with("ОБЗОР")).unwrap();
assert!(head.text.contains("в кадре 0, за кадром 2"), "{}", head.text);
}
#[test]
fn the_label_never_leaks_the_type_of_an_unidentified_track() {
let t = Track { id: 1, class: ClassEst::Unknown, pos: DVec3::new(0.0, 64.0, 100.0), vel: DVec3::ZERO, tick: 0, own_tick: 0, source: 0, product: crate::sim::battery::Measure::Search, quality: 40, own_product: crate::sim::battery::Measure::Search, own_quality: 0, ttl: 200, hits: 1, locked: false };
let label = track_label(&t, 0, DVec3::ZERO);
assert!(label.starts_with("? "), "{label}");
assert!(!label.contains("дрон") && !label.contains("Шахед"), "{label}");
// A probable class keeps its question mark; a firm one loses it.
let t = Track { class: ClassEst::Probable(crate::sim::Class::Cruise), ..t };
assert!(track_label(&t, 0, DVec3::ZERO).starts_with("К? "));
let t = Track { class: ClassEst::Firm(crate::sim::Class::Cruise), hits: 3, ..t };
assert!(track_label(&t, 0, DVec3::ZERO).starts_with("К "));
// A forecast says its age.
let label = track_label(&t, 100, DVec3::ZERO);
assert!(label.contains("~5с"), "{label}");
}
#[test]
fn the_truth_mode_marks_the_real_drones_apart_from_the_network() {
let mut sim = sim_with(DroneKind::Shahed, DVec3::new(0.0, 64.0, 100.0));
let id = sim.id();
sim.sams.push(Sam::new(id, SamKind::Buk, DVec3::new(0.0, 64.0, 0.0), 0.0));
// Without the truth mode: no white markers, no actual type anywhere.
let shapes = draw(&sim, DVec3::ZERO, GUI, ahead);
assert_eq!(fills(&shapes, WHITE), 0);
assert!(!texts(&shapes).iter().any(|t| t.text.contains("Шахед")), "the network overlay leaked the type");
// With it: a white square with the real type, and the header says whose picture it is.
sim.truth = true;
let shapes = draw(&sim, DVec3::new(0.0, 64.0, 0.0), GUI, ahead);
assert_eq!(fills(&shapes, WHITE), 4, "the truth marker is not one white square");
let label = texts(&shapes).into_iter().find(|t| t.text.contains("Шахед-136")).expect("no truth label");
assert!(label.text.contains("100 м") && label.at.y < 300.0, "the truth label sits over the square: {label:?}");
let head = texts(&shapes).into_iter().find(|t| t.text.starts_with("ОБЗОР")).unwrap();
assert!(head.text.contains("ИСТИНА (песочница)"), "{}", head.text);
// The truth mode with no system deployed adds nothing: the sky as it is was already shown.
sim.sams.clear();
let shapes = draw(&sim, DVec3::ZERO, GUI, ahead);
assert_eq!(fills(&shapes, WHITE), 0);
}
#[test]
fn a_full_raid_stays_inside_the_huds_shape_budget() {
let mut sim = Sim::new(1);
sim.raid(DroneKind::Shahed, DVec3::new(0.0, 64.0, 0.0), 80, 300.0, &mut Out::default());
sim.truth = true;
let shapes = draw(&sim, DVec3::ZERO, GUI, ahead);
assert!(shapes.len() <= 1024, "the overlay overflowed the HUD: {} shapes", shapes.len());
// The nearest markers were kept, the rest counted.
let head = texts(&shapes).into_iter().find(|t| t.text.starts_with("ОБЗОР")).unwrap();
assert!(head.text.contains("за кадром"), "{}", head.text);
assert!(fills(&shapes, RED) / 4 <= MAX_MARKERS);
}
#[test]
fn interceptors_wear_small_yellow_squares_without_labels() {
let mut sim = sim_with(DroneKind::Shahed, DVec3::new(0.0, 64.0, 100.0));
sim.missiles.push(crate::sim::Missile::test_at(1, DVec3::new(10.0, 70.0, 120.0), 0));
sim.missiles.push(crate::sim::Missile::test_at(2, DVec3::new(0.0, 64.0, -50.0), 0));
let shapes = draw(&sim, DVec3::ZERO, GUI, ahead);
// The one ahead: four yellow sides; the one behind the camera: nothing.
assert_eq!(fills(&shapes, MISSILE), 4);
assert!(!texts(&shapes).iter().any(|t| t.text.contains("перехват")), "an interceptor is not a target");
// The budget holds with a full salvo too.
for id in 3..100 {
sim.missiles.push(crate::sim::Missile::test_at(id, DVec3::new(id as f64, 64.0, 100.0), 0));
}
let shapes = draw(&sim, DVec3::ZERO, GUI, ahead);
assert!(shapes.len() <= 1024, "{} shapes", shapes.len());
assert!(fills(&shapes, MISSILE) / 4 <= MAX_MARKERS);
}
#[test]
fn labels_flip_over_the_square_near_the_edges() {
// Near the bottom: the label goes over the square; near the top: under it.
assert!(label_y(590.0, 10.0, 600.0, false) < 590.0);
assert!(label_y(10.0, 10.0, 600.0, true) > 10.0);
assert!(label_y(300.0, 10.0, 600.0, false) > 300.0);
assert!(label_y(300.0, 10.0, 600.0, true) < 300.0);
}
}
+8
View File
@@ -1114,6 +1114,14 @@ impl Missile {
}
}
#[cfg(any(test, feature = "test-fixtures"))]
impl Missile {
/// A missile in flight for the screens' tests: command guidance, no seeker fix.
pub fn test_at(id: u32, pos: DVec3, target: u32) -> Missile {
Missile { id, kind: MissileKind::Pac3, pos, vel: DVec3::Z, target, sam: 0, age: 20, hold: 0, fix: None, seen: 0 }
}
}
impl MissileKind {
/// How far its own seeker holds a target of average size (blocks); 0: command guidance only.
pub fn seeker(self) -> f64 {
+3 -2
View File
@@ -63,8 +63,9 @@ runtime закреплённого движка. Используется вре
## Акустика и владение захватом (API 27)
Текущий pin: `ed751714e0d24d02062976ee615e994186284170` (API 30; staging, cascades,
previous-frame motion и feature-gated DLSS SR backend #124). Акустические
Текущий pin: `2bcce642362ab5d3f04de193e390d8293cd1bf30` (API 31; `render.project` — проекция
мировых точек через камеру последнего отрисованного кадра, #132; ниже — staging, cascades,
previous-frame motion и feature-gated DLSS SR backend #124, API 30). Акустические
`render.acoustics-status` и `render.capture-owner-status` возвращают поколение,
`available`, `enabled`, `request-accepted`, `prepared` и причину. В игре всё это показывает
`/airdef capabilities`. Отсутствие запроса, выключение, ожидание backend и ошибка различаются.
+1 -1
View File
@@ -8,7 +8,7 @@
для Rust и Python; #102: измеренный fuel, API29 light/source milestones, API30 camera-status
и изоляция камер; #96: массовый deterministic offline capture; #115: authored Lancet/Х-101
и кадры инстансов.
Текущий engine pin — API30; старые номера/числа ниже описывают предыдущие этапы.
Текущий engine pin — API31 (`render.project`, #132); старые номера/числа ниже описывают предыдущие этапы.
Проблема нормалей модели #123 исправлена в engine `45b43f00d`; парные HD-кадры и ночная проверка Lancet записаны в галерее.
| Issue | Реализовано | Что остаётся для полной приёмки |
+1 -1
Submodule horizon updated: a861c1ed24...2bcce64236