public AttitudeController(Vessel vessel) { this.vessel = new KRPC.SpaceCenter.Services.Vessel(vessel); ReferenceFrame = this.vessel.SurfaceReferenceFrame; StoppingTime = new Vector3d(0.5, 0.5, 0.5); DecelerationTime = new Vector3d(5, 5, 5); AttenuationAngle = new Vector3d(1, 1, 1); RollThreshold = 5; AutoTune = true; Overshoot = new Vector3d(0.01, 0.01, 0.01); TimeToPeak = new Vector3d(3, 3, 3); Start(); }
public static KRPC.Utils.Tuple <Double, Double> ImpactPos(KRPC.SpaceCenter.Services.Vessel vessel) { Class1 pr = new Class1(vessel.InternalVessel); CelestialBody body = vessel.InternalVessel.orbit.referenceBody; Vector3? impactVect = GetImpactPosition(pr, vessel.InternalVessel); /*if (vessel.Situation.Equals("Flying") || vessel.Situation.Equals(VesselSituation.SubOrbital)) * {*/ while (impactVect != null) { var worldImpactPos = (Vector3d)impactVect + body.position; var lat = body.GetLatitude(worldImpactPos); var lng = DegreeFix(body.GetLongitude(worldImpactPos), -180); return(new KRPC.Utils.Tuple <Double, Double>(lat, lng)); } throw new Exception("No impact pos"); /*} * throw new Exception("Cannot calculate, the vessel is in not in flight. ("+ vessel.Situation+")");*/ }