refactoring (broken right now)

This commit is contained in:
2026-05-06 15:24:39 +02:00
parent bc4e077924
commit bc0df51ddb
25 changed files with 1184 additions and 1983 deletions

View File

@@ -3,6 +3,7 @@ using SFML.Window;
using SFML.System;
using System.Diagnostics;
using FluidSim.Core;
using FluidSim.Tests;
namespace FluidSim;
@@ -42,7 +43,7 @@ public class Program
soundEngine.Volume = 100;
soundEngine.Start();
scenario = new EngineScenario();
scenario = new TestScenario();
scenario.Initialize(SampleRate);
var stopwatch = Stopwatch.StartNew();
@@ -72,12 +73,6 @@ public class Program
double speedSmoothing = 8.0;
currentSpeed += (desiredSpeed - currentSpeed) * (1.0 - Math.Exp(-speedSmoothing * dtClock));
// ---- THROTTLE INPUT ----
targetThrottle = Keyboard.IsKeyPressed(Keyboard.Key.W) ? 1.0 : 0.0;
currentThrottle += (targetThrottle - currentThrottle) * (1.0 - Math.Exp(-ThrottleSmoothing * dtClock));
// Push to engine scenario (if it's an EngineScenario)
if (scenario is EngineScenario engine)
engine.Throttle = currentThrottle;
// Generate audio
double targetAudioClock = currentRealTime + 0.05;