Migrate 32 engine definitions into validated startup-loaded TOML files and separate configuration and snapshots from scenario assembly. Add camera-based stereo propagation from shared pipe geometry, preserve exhaust character, tune carburetor mixtures and idle, use ignition cuts for carb engines, and support returning to the scenario menu. Validation: full Windows build and all 14 CTest checks passed.
20 lines
536 B
C++
20 lines
536 B
C++
#pragma once
|
|
|
|
namespace fluidsim::port {
|
|
|
|
struct AudioFrame { float left{}, right{}; };
|
|
struct Vec3 { float x{}, y{}, z{}; };
|
|
struct AudioListener { Vec3 position{}, right{1,0,0}; };
|
|
|
|
// Simple flow-derivative source used by the Helmholtz and pulse scenarios.
|
|
class SoundProcessor {
|
|
public:
|
|
float gain{0.005f};
|
|
explicit SoundProcessor(int sample_rate = 44100, float listener_distance = 1.0f);
|
|
float process(float mass_flow_out);
|
|
private:
|
|
float dt_{}, scale_factor_{}, previous_flow_{};
|
|
};
|
|
|
|
} // namespace fluidsim::port
|