aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-26 19:09:41 +0300
committerValentin Popov <valentin@popov.link>2026-11-26 19:09:41 +0300
commit2e0a4571af587f28ba5ea580f177a225d0d352e2 (patch)
treeaf456896c423edd6bc8b45666e64f46689cd7bcf /crates
parent4367287f9e07aca6a173a5eaef641a75918d66e0 (diff)
downloadfparkan-2e0a4571af587f28ba5ea580f177a225d0d352e2.tar.xz
fparkan-2e0a4571af587f28ba5ea580f177a225d0d352e2.zip
fix(audio): attach the engine loop to the player's missile
Prepare velocity-driven Op2 sounds with the projectile's CTL attachment. Move their source with the active flight and stop it when the flight ends or its slot is reused. Keep launch as a separate one-shot. The GOG phase function confirms the missile's 0 to 1 phase range. In the stock Firing Line window the engine loop began at the tail and stopped on terrain contact.
Diffstat (limited to 'crates')
-rw-r--r--crates/fparkan-fx/src/ambient_sound.rs5
-rw-r--r--crates/fparkan-runtime/src/projectile.rs5
2 files changed, 10 insertions, 0 deletions
diff --git a/crates/fparkan-fx/src/ambient_sound.rs b/crates/fparkan-fx/src/ambient_sound.rs
index 7e8a57a6..199baebf 100644
--- a/crates/fparkan-fx/src/ambient_sound.rs
+++ b/crates/fparkan-fx/src/ambient_sound.rs
@@ -113,6 +113,11 @@ impl Op2SoundCommand {
!self.looping && self.start == 0.0
}
+ /// Whether the command sustains a source throughout its phase window.
+ pub fn is_looping(&self) -> bool {
+ self.looping
+ }
+
/// Evaluates Effect.dll's phase crossings and current source parameters.
/// `playing` comes from the audio owner, since a one-shot can finish between
/// updates. The matrix maps local command coordinates into world space.
diff --git a/crates/fparkan-runtime/src/projectile.rs b/crates/fparkan-runtime/src/projectile.rs
index ff745655..312371d8 100644
--- a/crates/fparkan-runtime/src/projectile.rs
+++ b/crates/fparkan-runtime/src/projectile.rs
@@ -134,6 +134,11 @@ impl PlayerProjectile {
})
}
+ /// Queue time at launch, retained when the projectile's pose changes.
+ pub fn born_ms(&self) -> u32 {
+ self.born_ms
+ }
+
/// Advances this projectile and returns whether it remains in flight.
/// The callback identifies contacts with the world along the traveled segment.
pub fn advance(