// Required for all IDumpers for them to work, but can't enforced by the interface because it's static: public static GeoCoordinates CreateFromDump(SafeSharedObjects shared, Dump d) { var newObj = new GeoCoordinates(); newObj.Shared = (SharedObjects)shared; newObj.LoadDump(d); return(newObj); }
public override void Execute(SharedObjects shared) { double longitude = GetDouble(shared.Cpu.PopValue()); double latitude = GetDouble(shared.Cpu.PopValue()); var result = new GeoCoordinates(shared, latitude, longitude); shared.Cpu.PushStack(result); }
/// <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); } }
public override void Execute(SharedObjects shared) { double longitude = GetDouble(PopValueAssert(shared)); double latitude = GetDouble(PopValueAssert(shared)); AssertArgBottomAndConsume(shared); var result = new GeoCoordinates(shared, latitude, longitude); ReturnValue = result; }
public ScalarValue BuildSeaLevelAltitude() { GeoCoordinates gCoord = BuildGeoCoordinates(); return(gCoord.GetTerrainAltitude() + WrappedWaypoint.altitude); }
public double BuildSeaLevelAltitude() { GeoCoordinates gCoord = BuildGeoCoordinates(); return(gCoord.GetTerrainAltitude() + WayPoint.altitude); }
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"); } }