Beispiel #1
0
        public static double RelativeVel()
        {
            Vessel   target = mjvessel.targetObject as Vessel;
            Vector3d deltav = OrbitalManeuverCalculator.DeltaVToMatchVelocities(mjvessel.orbit, Planetarium.GetUniversalTime(), target.orbit);

            return(deltav.magnitude);
        }
Beispiel #2
0
        public static void MPMatchVelocity(double time)
        {
            MechJebCore activejeb = GetJeb();

            if (activejeb != null)
            {
                Vessel   target = activejeb.vessel.targetObject as Vessel;
                Vector3d deltav = OrbitalManeuverCalculator.DeltaVToMatchVelocities(activejeb.vessel.orbit, time, target.orbit);
                activejeb.vessel.PlaceManeuverNode(activejeb.vessel.orbit, deltav, time);
            }
        }
Beispiel #3
0
        public override ManeuverParameters MakeNodeImpl(Orbit o, double universalTime, MechJebModuleTargetController target)
        {
            if (!target.NormalTargetExists)
            {
                throw new OperationException("must select a target to match velocities with.");
            }
            else if (o.referenceBody != target.TargetOrbit.referenceBody)
            {
                throw new OperationException("target must be in the same sphere of influence.");
            }

            double UT = timeSelector.ComputeManeuverTime(o, universalTime, target);

            var dV = OrbitalManeuverCalculator.DeltaVToMatchVelocities(o, UT, target.TargetOrbit);

            return(new ManeuverParameters(dV, UT));
        }
Beispiel #4
0
        public static double ClosestAppVel()
        {
            Vector3d dV = OrbitalManeuverCalculator.DeltaVToMatchVelocities(mjvessel.orbit, Planetarium.GetUniversalTime(), mjvessel.targetObject.GetOrbit());

            return(dV.magnitude);
        }