Load engines from TOML and improve scenario audio and carb tuning
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.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "FluidSim/Scenario.hpp"
|
||||
#include "FluidSim/ScenarioSnapshot.hpp"
|
||||
#include "FluidSim/DynoCurve.hpp"
|
||||
#include "FluidSim/Desktop/PedalControl.hpp"
|
||||
#include "FluidSim/Desktop/EngineRenderer3D.hpp"
|
||||
@@ -22,6 +22,7 @@ public:
|
||||
void nudge_pedal(float amount) {pedal_.set(pedal_.value()+amount);}
|
||||
void update_pedal(float dt,bool raise,bool lower) {if(!pedal_drag_)pedal_.advance(dt,raise,lower);}
|
||||
bool handle_event(const sf::Event&,sf::Vector2u);
|
||||
AudioListener listener(const ScenarioSnapshot&,sf::Vector2u);
|
||||
void draw(sf::RenderWindow&,const sf::Font*,const ScenarioSnapshot&,const PlaybackInfo&);
|
||||
private:
|
||||
DynoCurve dyno_;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "FluidSim/Scenario.hpp"
|
||||
#include "FluidSim/ScenarioSnapshot.hpp"
|
||||
#include "FluidSim/Desktop/OrbitCamera.hpp"
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <memory>
|
||||
|
||||
@@ -7,6 +7,13 @@ namespace fluidsim::port::desktop {
|
||||
struct OrbitCamera {
|
||||
Vec3 target{.12f,.25f,0};
|
||||
float yaw{-28},pitch{24},distance{2.2f};
|
||||
AudioListener listener(float distance_scale=1, float target_offset_x=0) const {
|
||||
const float y=yaw*.017453293f,p=pitch*.017453293f,d=distance*distance_scale;
|
||||
// Inverse of the renderer's pitch/yaw world-to-view rotation.
|
||||
return {{target.x+target_offset_x-std::sin(y)*std::cos(p)*d,
|
||||
target.y+std::sin(p)*d,target.z+std::cos(y)*std::cos(p)*d},
|
||||
{std::cos(y),0,std::sin(y)}};
|
||||
}
|
||||
void reset(float aspect) {target={.12f,.25f,0};yaw=-28;pitch=24;distance=std::max(.65f,1.6f/aspect)/.414214f;}
|
||||
void orbit(sf::Vector2i delta) {yaw+=delta.x*.35f;pitch=std::clamp(pitch+delta.y*.3f,-75.f,80.f);}
|
||||
void pan(sf::Vector2i delta,float height) {
|
||||
|
||||
Reference in New Issue
Block a user