示例#1
0
        public static void SetOrbit(string body, double semiMajorAxis, double eccentricity, double inclination, double longitudeOfAscendingNode, double argumentOfPeriapsis, double meanAnomalyAtEpoch, double epoch)
        {
            var celestialBody = FlightGlobals.Bodies.First(b => b.bodyName == body);

            OrbitTools.OrbitDriver.orbit.Set(OrbitTools.CreateOrbit(celestialBody, semiMajorAxis, eccentricity, inclination, longitudeOfAscendingNode, argumentOfPeriapsis, meanAnomalyAtEpoch, epoch));
            throw new YieldException(new ParameterizedContinuationVoid <int> (WaitForVesselSwitch, 0));
        }
示例#2
0
        public static void SetCircularOrbit(string body, double altitude)
        {
            var celestialBody = FlightGlobals.Bodies.First(b => b.bodyName == body);
            var semiMajorAxis = celestialBody.Radius + altitude;

            OrbitTools.OrbitDriver.orbit.Set(OrbitTools.CreateOrbit(celestialBody, semiMajorAxis, 0, 0, 0, 0, 0, 0));
            throw new YieldException(new ParameterizedContinuationVoid <int> (WaitForVesselSwitch, 0));
        }