This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public double TrueAlt() | |
{ | |
Vector3 pos= this.part.transform.position; //or this.vessel.GetWorldPos3D() | |
double ASL = FlightGlobals.getAltitudeAtPos(pos); | |
if (this.vessel.mainBody.pqsController == null) { return ASL; } | |
double terrainAlt = this.vessel.pqsAltitude; | |
if (this.vessel.mainBody.ocean && terrainAltitude <= 0) { return ASL; } //Checks for oceans | |
return ASL - terrainAlt; | |
} |