double correct_launch(bool allow_wait = true)
        {
            var TTR = AngleDelta(TargetOrbit, ToOrbit.Target, ToOrbit.ApAUT) / 360 * TargetOrbit.period;

            ToOrbit.LaunchUT += TTR;
            if (allow_wait && ToOrbit.LaunchUT - VSL.Physics.UT <= 0)
            {
                ToOrbit.LaunchUT += TargetOrbit.period;
            }
            ToOrbit.ApAUT = ToOrbit.LaunchUT +
                            AtmoSim.FromSurfaceTTA(VSL, ToOrbit.TargetR - Body.Radius,
                                                   ToOrbit.ArcDistance, GLB.ORB.GTurnCurve,
                                                   Vector3d.Dot(SurfaceVel, Vector3d.Exclude(VesselOrbit.pos, ToOrbit.Target - VesselOrbit.pos).normalized));
            ToOrbit.Target = QuaternionD.AngleAxis((VSL.Physics.UT - ToOrbit.LaunchUT) / Body.rotationPeriod * 360, Body.angularVelocity.xzy) *
                             ToOrbitIniApV.normalized * TargetOrbit.getRelativePositionAtUT(ToOrbit.ApAUT).magnitude;
//			LogF("TTR: {}, LaunchT {}, ApAT {}", TTR, ToOrbit.LaunchUT-VSL.Physics.UT, ToOrbit.ApAUT-ToOrbit.LaunchUT);//debug
            return(TTR);
        }
Esempio n. 2
0
        public static double FromSurfaceTTA(VesselWrapper VSL, double ApA, double alpha, double gturn_curve, double surface_vel)
        {
            var sim = new AtmoSim(VSL);

            return(sim.FromSurfaceTTA(ApA, alpha, gturn_curve, surface_vel));
        }
 public static double FromSurfaceTTA(VesselWrapper VSL, double ApA, double alpha, double gturn_curve, double surface_vel)
 {
     var sim = new AtmoSim(VSL.Body, VSL);
     return sim.FromSurfaceTTA(ApA, alpha, gturn_curve, surface_vel);
 }