From 2f75b9792c98c4d32b0349810080dd226357b505 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 09:42:38 +0400 Subject: feat(render): throw detached chassis nodes as fragments Pass the depleted node to an authored Op10 with a built-in mesh request. Reuse its existing draw ranges for the flight and keep the hull alive. The fixed-camera fixture shows the heavy track section separate and rotate after impact. --- apps/fparkan-game/src/destruction_effects.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'apps/fparkan-game/src/destruction_effects.rs') diff --git a/apps/fparkan-game/src/destruction_effects.rs b/apps/fparkan-game/src/destruction_effects.rs index 97f7436a..5f05e2f9 100644 --- a/apps/fparkan-game/src/destruction_effects.rs +++ b/apps/fparkan-game/src/destruction_effects.rs @@ -13,7 +13,9 @@ use fparkan_fx::{ FxCommand, FxOpcode, }; use fparkan_render_vulkan::{VulkanPointLight, VulkanStaticMesh}; -use fparkan_runtime::{unit_destruction_effect_sources, Engine, UnitDestructionEffect}; +use fparkan_runtime::{ + unit_destruction_effect_sources, DestroyedMesh, Engine, UnitDestructionEffect, +}; use std::{ collections::{BTreeMap, HashMap, HashSet}, path::{Path, PathBuf}, @@ -44,7 +46,7 @@ mod tests { let position = [23.0, 45.0, 10.0]; effects.start( vec![UnitDestructionEffect { - object_index: None, + mesh: None, position, archive: "system.rlb".into(), name: "explode_rbr_b.exp".into(), @@ -244,10 +246,10 @@ impl DestructionEffects { events: Vec, now: u32, mut audio: Option<&mut GameAudio>, - mut capture_fragments: impl FnMut(usize, [f32; 3]) -> Vec, + mut capture_fragments: impl FnMut(DestroyedMesh, [f32; 3]) -> Vec, ) { for UnitDestructionEffect { - object_index, + mesh, position, archive, name, @@ -291,9 +293,9 @@ impl DestructionEffects { effect: Arc::clone(effect), clock, position, - fragments: object_index + fragments: mesh .filter(|_| effect.fragments) - .map_or_else(Vec::new, |index| capture_fragments(index, position)), + .map_or_else(Vec::new, |geometry| capture_fragments(geometry, position)), }); } } -- cgit v1.2.3