From fcfe67b02a85837a897978b1cb0f2e01e1486c63 Mon Sep 17 00:00:00 2001 From: max Date: Thu, 26 Mar 2026 12:12:11 +0100 Subject: [PATCH] more realistic settings, changed engine sound --- Car simulation/Audio/EngineSound.cs | 4 ++-- Car simulation/Core/Components/Drivetrain.cs | 2 +- Car simulation/Core/Components/WheelSystem.cs | 2 +- Car simulation/Core/Models/Car.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Car simulation/Audio/EngineSound.cs b/Car simulation/Audio/EngineSound.cs index dd3adbf..d95a98d 100644 --- a/Car simulation/Audio/EngineSound.cs +++ b/Car simulation/Audio/EngineSound.cs @@ -20,7 +20,7 @@ namespace Car_simulation.Audio // Engine harmonics private readonly float[] _harmonicMultiples = { 1f, 2f, 3f, 4f }; - private readonly float[] _harmonicAmps = { 0.3f, 0.6f, 0.4f, 0.2f }; + private readonly float[] _harmonicAmps = { 0.3f, 0.6f, 0.2f, 0.4f }; private readonly float[] _harmonicPhases = new float[4]; public EngineSound() @@ -34,7 +34,7 @@ namespace Car_simulation.Audio { _currentRPM = rpm; _currentThrottle = throttle; - _volume = 0.1f + 0.4f * throttle; + _volume = 0.1f + 2e-4f * throttle * rpm; } public void StartSound() diff --git a/Car simulation/Core/Components/Drivetrain.cs b/Car simulation/Core/Components/Drivetrain.cs index 15e7ac6..4940b9a 100644 --- a/Car simulation/Core/Components/Drivetrain.cs +++ b/Car simulation/Core/Components/Drivetrain.cs @@ -8,7 +8,7 @@ namespace Car_simulation.Core.Components public WheelSystem WheelSystem { get; private set; } private int _currentGear = 1; - public float[] GearRatios { get; set; } = { 3.8f, 2.5f, 1.8f, 1.3f, 1.0f, 0.8f, 0.65f }; + public float[] GearRatios { get; set; } = { 3.8f, 2.5f, 1.8f, 1.3f, 1.0f, 0.8f}; public float FinalDriveRatio { get; set; } = 4.0f; public float Efficiency { get; set; } = 0.95f; public float ClutchEngagement { get; set; } = 0f; diff --git a/Car simulation/Core/Components/WheelSystem.cs b/Car simulation/Core/Components/WheelSystem.cs index 3b030df..44e3098 100644 --- a/Car simulation/Core/Components/WheelSystem.cs +++ b/Car simulation/Core/Components/WheelSystem.cs @@ -7,7 +7,7 @@ namespace Car_simulation.Core.Components // Physical properties public float Radius { get; set; } = 0.3f; public float WheelInertia { get; set; } = 2.0f; - public float CarMass { get; set; } = 1500f; + public float CarMass; public int WheelCount { get; set; } = 4; public int DrivenWheels { get; set; } = 2; diff --git a/Car simulation/Core/Models/Car.cs b/Car simulation/Core/Models/Car.cs index c9ec9a1..7dd50b7 100644 --- a/Car simulation/Core/Models/Car.cs +++ b/Car simulation/Core/Models/Car.cs @@ -8,7 +8,7 @@ namespace Car_simulation.Core.Models { // Basic properties public Vector2 Position = new Vector2(0, 0); - public float Mass { get; set; } = 2000f; + public float Mass { get; set; } = 1400f; // Inputs public float ThrottleInput = 0f;