From f03b144907be8ad8cec2e1c7487b5d9e0a43f13e Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 1 Dec 2026 15:37:59 +0400 Subject: fix(combat): continue projectile flight after piercing shields Resolve shield sphere entrances before the first physical hit. Carry leftover volume into later ticks for both player and autonomous fire and let a geometric miss pass through a warbot bounding sphere. Checked Control.dll RVAs 0x1e9f0 and 0xd0c0 in-process with a sphere-only contact. The AutoDemo corpus covers a charged stop, a pierced field, and an unchanged hull on a miss. Ran the workspace suite and AutoDemo in the game window with Vulkan validation. --- crates/fparkan-runtime/src/projectile_parts.rs | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'crates/fparkan-runtime/src/projectile_parts.rs') diff --git a/crates/fparkan-runtime/src/projectile_parts.rs b/crates/fparkan-runtime/src/projectile_parts.rs index 2a035e2f..eef5422f 100644 --- a/crates/fparkan-runtime/src/projectile_parts.rs +++ b/crates/fparkan-runtime/src/projectile_parts.rs @@ -57,7 +57,6 @@ pub(super) fn chassis_part_contact( handle: ObjectHandle, state: TransformState, segment: [[f32; 3]; 2], - (center, radius): ([f32; 3], f32), sphere_fraction: Option, poses: Option<&WeaponPoses>, ) -> Option<(f32, Option)> { @@ -102,26 +101,11 @@ pub(super) fn chassis_part_contact( viable, ) }); - if let Some((fraction, node)) = chassis + chassis .into_iter() .chain(mounted) .min_by(|a, b| a.0.total_cmp(&b.0)) - { - return Some((fraction, Some(node))); - } - // shortcut: keep the hull sphere for unresolved mounted geometry, but - // give the chassis mesh priority until the projectile exits the sphere. - sphere_fraction?; - let [start, end] = segment; - if (0..3) - .map(|axis| (end[axis] - center[axis]).powi(2)) - .sum::() - <= radius * radius - { - return None; - } - let reverse = segment_sphere_fraction([end, start], center, radius)?; - Some((1.0 - reverse, None)) + .map(|(fraction, node)| (fraction, Some(node))) } fn mounted_triangle_hit( -- cgit v1.2.3