MechJeb2

MechJeb2

4M Downloads

CelestialBodyExtensions.RealMaxAtmosphereAltitude()

Starwaster opened this issue ยท 1 comments

commented

Suggest the following change to RealMaxAtmosphereAltitude()

        if (body.useLegacyAtmosphere)
            return -body.atmosphereScaleHeight * 1000 * Math.Log(1e-6);
        else
            return body.pressureCurve.keys.Last().time;

Reason for this change is that an upcoming version of Real Solar System will enable the use of pressureCurve data. If useLegacyAtmosphere is set to false then pressureCurve will be used to determine atmospheric pressure. The highest atmospheric altitude is the last key in pressureCurve and is immune to the 1e-6 issue. Alternatively, body.maxAtmosphereAltitude could be returned instead but depends on being properly set in the RSS configuration for that body. (by convention it's intended that it be set to the last altitude in the pressureCurve data so should be correct)

commented

Correction: Should be:

    if (body.useLegacyAtmosphere)
        return -body.atmosphereScaleHeight * 1000 * Math.Log(1e-6);
    else
        return body.pressureCurve.keys.Last().time*1000;

Other parts of the code might need checking too.