refactoring (broken right now)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user