public static ServoGroup ServoGroupWithName(KRPC.SpaceCenter.Services.Vessel vessel, string name) { CheckAPI(); var servoGroup = IRWrapper.IRController.ServoGroups.FirstOrDefault(x => x.Vessel.id == vessel.Id && x.Name == name); return(servoGroup != null ? new ServoGroup(servoGroup) : null); }
public static void ClearRotation(KRPC.SpaceCenter.Services.Vessel vessel = null) { Vessel internalVessel = vessel == null ? FlightGlobals.ActiveVessel : vessel.InternalVessel; internalVessel.GoOnRails(); internalVessel.SetRotation(ZeroRotation); }
internal Comms(KRPC.SpaceCenter.Services.Vessel innerVessel) { if (!API.IsAvailable) { throw new InvalidOperationException("RemoteTech is not installed"); } vessel = innerVessel; vesselId = vessel.InternalVessel.id; }
public static Servo ServoWithName(KRPC.SpaceCenter.Services.Vessel vessel, string name) { CheckAPI(); var servo = IRWrapper.IRController.ServoGroups .Where(x => x.Vessel.id == vessel.Id) .SelectMany(x => x.Servos) .FirstOrDefault(x => x.Name == name); return(servo != null ? new Servo(servo) : null); }
public static void AscentRdzv(KRPC.SpaceCenter.Services.Vessel Targ) { MechJebCore activejeb = GetJeb(); if (activejeb != null) { MechJebModuleAscentAutopilot activeasc = activejeb.GetComputerModule("MechJebModuleAscentAutopilot") as MechJebModuleAscentAutopilot; if (activeasc != null) { activeasc.core.target.Set(Targ.InternalVessel); activeasc.core.vessel.targetObject = Targ.InternalVessel; activeasc.StartCountdown(activeasc.vesselState.time + LaunchTiming.TimeToPhaseAngle(activeasc.launchPhaseAngle, activeasc.vessel.mainBody, activeasc.vessel.longitude, activeasc.core.target.TargetOrbit)); activeasc.enabled = true; } } }
public static IList <ServoGroup> ServoGroups(KRPC.SpaceCenter.Services.Vessel vessel) { CheckAPI(); return(IRWrapper.IRController.ServoGroups.Where(x => x.Vessel.id == vessel.Id).Select(x => new ServoGroup(x)).ToList()); }
public static void ApplyRotation(float angle, KRPC.Utils.Tuple <float, float, float> axis, KRPC.SpaceCenter.Services.Vessel vessel = null) { Vessel internalVessel = vessel == null ? FlightGlobals.ActiveVessel : vessel.InternalVessel; var axisVector = new Vector3(axis.Item1, axis.Item2, axis.Item3).normalized; var rotation = internalVessel.transform.rotation * Quaternion.AngleAxis(angle, axisVector); internalVessel.SetRotation(rotation); }
public double SignalDelayToVessel(KRPC.SpaceCenter.Services.Vessel other) { return(API.GetSignalDelayToSatellite(vesselId, other.Id)); }
public static Comms Comms(KRPC.SpaceCenter.Services.Vessel vessel) { CheckAPI(); return(new Comms(vessel)); }