Preserve the adapter facade and move adapter-only checks out of domain tests. Late tracks do not reveal an unseen launch origin or its timestamp. Co-Authored-By: Codex GPT-6.1 Terra <noreply@openai.com>
This commit is contained in:
@@ -69,6 +69,25 @@ pub struct Particle {
|
||||
pub scale: f32,
|
||||
}
|
||||
|
||||
/// Sound source description produced by the simulation and consumed by the audio adapter.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct EngineDecl {
|
||||
pub key: u32,
|
||||
pub event: &'static str,
|
||||
pub at: DVec3,
|
||||
/// Blocks per second.
|
||||
pub vel: DVec3,
|
||||
pub gain: f32,
|
||||
pub pitch: f32,
|
||||
pub damaged: bool,
|
||||
}
|
||||
|
||||
/// Shared distance text used by existing diagnostics and the HUD.
|
||||
/// Moving diagnostic text to the presentation adapter is a separate migration.
|
||||
pub fn distance(m: f64) -> String {
|
||||
if m >= 1000.0 { format!("{:.1} км", m / 1000.0) } else { format!("{:.0} м", m) }
|
||||
}
|
||||
|
||||
/// A blast the post-processing shader draws as a fireball, flash and shock.
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct Blast {
|
||||
@@ -89,7 +108,7 @@ pub struct Out {
|
||||
pub sounds: Vec<(&'static str, DVec3, f32, f32)>,
|
||||
/// The engines sounding this tick (persistent sources, `crate::engines`), and whether the
|
||||
/// picture cut (a replay seek or a new shot): every engine then starts afresh.
|
||||
pub engines: Vec<crate::engines::Decl>,
|
||||
pub engines: Vec<EngineDecl>,
|
||||
pub engine_cut: bool,
|
||||
pub commands: Vec<String>,
|
||||
/// Camera jolt (strength, seconds), the strongest this tick.
|
||||
@@ -121,7 +140,7 @@ impl Out {
|
||||
}
|
||||
/// An engine that sounds: `vel` is the simulation's, blocks a tick.
|
||||
pub fn engine(&mut self, key: u32, event: &'static str, at: DVec3, vel: DVec3, gain: f32, pitch: f32, damaged: bool) {
|
||||
self.engines.push(crate::engines::Decl { key, event, at, vel: vel * 20.0, gain, pitch, damaged });
|
||||
self.engines.push(EngineDecl { key, event, at, vel: vel * 20.0, gain, pitch, damaged });
|
||||
}
|
||||
fn jolt(&mut self, strength: f32, seconds: f32) {
|
||||
if self.shake.is_none_or(|(s, _)| s < strength) {
|
||||
|
||||
Reference in New Issue
Block a user