more realistic settings, changed engine sound
This commit is contained in:
@@ -20,7 +20,7 @@ namespace Car_simulation.Audio
|
|||||||
|
|
||||||
// Engine harmonics
|
// Engine harmonics
|
||||||
private readonly float[] _harmonicMultiples = { 1f, 2f, 3f, 4f };
|
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];
|
private readonly float[] _harmonicPhases = new float[4];
|
||||||
|
|
||||||
public EngineSound()
|
public EngineSound()
|
||||||
@@ -34,7 +34,7 @@ namespace Car_simulation.Audio
|
|||||||
{
|
{
|
||||||
_currentRPM = rpm;
|
_currentRPM = rpm;
|
||||||
_currentThrottle = throttle;
|
_currentThrottle = throttle;
|
||||||
_volume = 0.1f + 0.4f * throttle;
|
_volume = 0.1f + 2e-4f * throttle * rpm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartSound()
|
public void StartSound()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Car_simulation.Core.Components
|
|||||||
public WheelSystem WheelSystem { get; private set; }
|
public WheelSystem WheelSystem { get; private set; }
|
||||||
|
|
||||||
private int _currentGear = 1;
|
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 FinalDriveRatio { get; set; } = 4.0f;
|
||||||
public float Efficiency { get; set; } = 0.95f;
|
public float Efficiency { get; set; } = 0.95f;
|
||||||
public float ClutchEngagement { get; set; } = 0f;
|
public float ClutchEngagement { get; set; } = 0f;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace Car_simulation.Core.Components
|
|||||||
// Physical properties
|
// Physical properties
|
||||||
public float Radius { get; set; } = 0.3f;
|
public float Radius { get; set; } = 0.3f;
|
||||||
public float WheelInertia { get; set; } = 2.0f;
|
public float WheelInertia { get; set; } = 2.0f;
|
||||||
public float CarMass { get; set; } = 1500f;
|
public float CarMass;
|
||||||
public int WheelCount { get; set; } = 4;
|
public int WheelCount { get; set; } = 4;
|
||||||
public int DrivenWheels { get; set; } = 2;
|
public int DrivenWheels { get; set; } = 2;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Car_simulation.Core.Models
|
|||||||
{
|
{
|
||||||
// Basic properties
|
// Basic properties
|
||||||
public Vector2 Position = new Vector2(0, 0);
|
public Vector2 Position = new Vector2(0, 0);
|
||||||
public float Mass { get; set; } = 2000f;
|
public float Mass { get; set; } = 1400f;
|
||||||
|
|
||||||
// Inputs
|
// Inputs
|
||||||
public float ThrottleInput = 0f;
|
public float ThrottleInput = 0f;
|
||||||
|
|||||||
Reference in New Issue
Block a user