diff --git a/Assets/Scripts/Constants.cs b/Assets/Scripts/Constants.cs index 6ccb3a9..4256044 100644 --- a/Assets/Scripts/Constants.cs +++ b/Assets/Scripts/Constants.cs @@ -3,10 +3,10 @@ using System; public static class Constants { // Constants (these should be defined with appropriate values) - private const double kAirDensity = 1.204; // Sea level air density in kg/m^3 - private const double kAirDensityScaleHeight = 10.4; // Scale height in km - private const double kGravity = 9.80665; // Standard gravity in m/s^2 - private const double kEarthMeanRadius = 6378137; // Earth's mean radius in meters + public const double kAirDensity = 1.204; // Sea level air density in kg/m^3 + public const double kAirDensityScaleHeight = 10.4; // Scale height in km + public const double kGravity = 9.80665; // Standard gravity in m/s^2 + public const double kEarthMeanRadius = 6378137; // Earth's mean radius in meters public static double CalculateAirDensityAtAltitude(double altitude) { diff --git a/Assets/Scripts/Interceptors/Micromissile.cs b/Assets/Scripts/Interceptors/Micromissile.cs index 9062ab6..b69acf8 100644 --- a/Assets/Scripts/Interceptors/Micromissile.cs +++ b/Assets/Scripts/Interceptors/Micromissile.cs @@ -4,7 +4,7 @@ using UnityEngine; public class Micromissile : Missile { - [SerializeField] private float _navigationGain = 5f; // Typically 3-5 + [SerializeField] private float _navigationGain = 3f; // Typically 3-5 private Vector3 _previousLOS; private Vector3 _accelerationCommand; diff --git a/Assets/Scripts/Missile.cs b/Assets/Scripts/Missile.cs index 8e1b68b..7905cf4 100644 --- a/Assets/Scripts/Missile.cs +++ b/Assets/Scripts/Missile.cs @@ -112,7 +112,7 @@ public class Missile : Agent protected float CalculateMaxAcceleration() { - float maxReferenceAcceleration = StaticConfig.accelerationConfig.maxReferenceAcceleration * Physics.gravity.magnitude; + float maxReferenceAcceleration = (float)(StaticConfig.accelerationConfig.maxReferenceAcceleration * Constants.kGravity); float referenceSpeed = StaticConfig.accelerationConfig.referenceSpeed; return Mathf.Pow(GetComponent().velocity.magnitude / referenceSpeed, 2) * maxReferenceAcceleration; }