diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 21:27:58 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 21:27:58 +0300 |
| commit | 882105f571231acd562aa403fc4767585f70ac54 (patch) | |
| tree | e719e18d8b3f89c0362a906e6f365de168953c85 /crates | |
| parent | fd159dbfa3e0ae399658a2cbea305d0a35debf77 (diff) | |
| download | fparkan-882105f571231acd562aa403fc4767585f70ac54.tar.xz fparkan-882105f571231acd562aa403fc4767585f70ac54.zip | |
test(ui): verify targeter sphere stays stable across damage stages
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/fparkan-runtime/src/cockpit_instruments.rs | 3 | ||||
| -rw-r--r-- | crates/fparkan-runtime/src/projectile.rs | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/crates/fparkan-runtime/src/cockpit_instruments.rs b/crates/fparkan-runtime/src/cockpit_instruments.rs index 9911d52e..4948773e 100644 --- a/crates/fparkan-runtime/src/cockpit_instruments.rs +++ b/crates/fparkan-runtime/src/cockpit_instruments.rs @@ -91,7 +91,8 @@ pub fn instrument_readout( }) } -/// Local sphere used by AniMesh selector 2 with the targeter's node filter. +/// Initial local sphere used by AniMesh selector 2 with the targeter's node +/// filter. Changing a node's damage stage does not invalidate this sphere. pub fn instrument_bounds(engine: &Engine, object_index: usize) -> Option<([f32; 3], f32)> { let mission = engine.loaded.as_ref()?; let draft = mission.object_drafts.get(object_index)?; diff --git a/crates/fparkan-runtime/src/projectile.rs b/crates/fparkan-runtime/src/projectile.rs index 66cdbc8b..dd3a857d 100644 --- a/crates/fparkan-runtime/src/projectile.rs +++ b/crates/fparkan-runtime/src/projectile.rs @@ -738,6 +738,7 @@ mod tests { ) .unwrap(); let plant = handle_by_original_id(&engine.world, OriginalObjectId(5)).unwrap(); + let intact_bounds = crate::cockpit_instruments::instrument_bounds(&engine, 5).unwrap(); let table = engine .loaded .as_mut() @@ -795,6 +796,10 @@ mod tests { .any(|state| state == ((0, 1), Some(1))) ); assert_eq!( + crate::cockpit_instruments::instrument_bounds(&engine, 5), + Some(intact_bounds) + ); + assert_eq!( crate::control_node_provider_row(table, 3) .unwrap() .mesh_state |
