engine almost working, backup before adding gas types.

This commit is contained in:
max
2026-05-07 20:07:15 +02:00
parent 14f5ba925f
commit 92d84eacfe
18 changed files with 1236 additions and 587 deletions

View File

@@ -23,7 +23,7 @@ namespace FluidSim.Core
scaleFactor = 1.0 / (4.0 * Math.PI * listenerDistanceMeters);
// Smoothing time constant for the derivative: 10 ms (much smoother)
double tau = 0.010; // 10 ms
double tau = 0.005; // 10 ms
alpha = Math.Exp(-dt / tau);
// Lowpass time constant for the mass flow: 5 ms (kneecap highfreq directly)
@@ -49,7 +49,7 @@ namespace FluidSim.Core
double pressure = smoothDMdt * scaleFactor * Gain;
// Soft clip to ±1 (should rarely trigger now)
return (float)Math.Tanh(pressure);
return (float)pressure;
}
}
}