GetTerrainAltitude() public method

Returns the ground's altitude above sea level at this geo position.
public GetTerrainAltitude ( ) : ScalarValue
return ScalarValue
Beispiel #1
0
        /// <summary>
        /// Interpret the vector given as a 3D position, and return the altitude above terrain unless
        /// that terrain is below sea level on a world that has a sea, in which case return the sea
        /// level atitude instead, similar to how radar altitude is displayed to the player.
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        public ScalarValue RadarAltitudeFromPosition(Vector position)
        {
            GeoCoordinates geo           = GeoCoordinatesFromPosition(position);
            ScalarValue    terrainHeight = geo.GetTerrainAltitude();
            ScalarValue    seaAlt        = AltitudeFromPosition(position);

            if (Body.ocean && terrainHeight < 0)
            {
                return(seaAlt);
            }
            else
            {
                return(seaAlt - terrainHeight);
            }
        }
Beispiel #2
0
        public ScalarValue BuildSeaLevelAltitude()
        {
            GeoCoordinates gCoord = BuildGeoCoordinates();

            return(gCoord.GetTerrainAltitude() + WrappedWaypoint.altitude);
        }
Beispiel #3
0
        public double BuildSeaLevelAltitude()
        {
            GeoCoordinates gCoord = BuildGeoCoordinates();

            return(gCoord.GetTerrainAltitude() + WayPoint.altitude);
        }
Beispiel #4
0
 private void SetTarget(GeoCoordinates target)
 {
     if (shared.Vessel != FlightGlobals.ActiveVessel)
     {
         throw new KOSException("You may only call addons:TR:setTarget from the active vessel. Always check addons:tr:hasImpact");
     }
     if (Available())
     {
         TRWrapper.SetTarget(target.Latitude, target.Longitude, target.GetTerrainAltitude());
     }
     else
     {
         throw new KOSUnavailableAddonException("SETTARGET", "Trajectories");
     }
 }