コード例 #1
0
 void update_overheat_info(LandingPath trj, double startT)
 {
     trj.UpdateOverheatInto(startT);
     MaxShipTemperature = trj.MaxShipTemperature;
     MaxDynamicPressure = Math.Max(MaxDynamicPressure, trj.MaxDynamicPressure / 1000);
     WillOverheat       = MaxShipTemperature > VSL.Physics.MinMaxTemperature;
 }
コード例 #2
0
 void update_landing_site_after_brake()
 {
     SetBrakeDeltaV(-LandingTrajectoryAutopilot
                    .CorrectedBrakeVelocity(VSL, BrakeEndPoint.vel, BrakeEndPoint.pos,
                                            BrakeEndPoint.DynamicPressure / 1000 / LandingTrajectoryAutopilot.C.MinDPressure,
                                            AtTargetUT - BrakeEndPoint.UT));
     BrakeStartPoint = Path.PointAtUT(Math.Max(BrakeEndPoint.UT - MatchVelocityAutopilot
                                               .BrakingOffset((float)BrakeDeltaV.magnitude, VSL, out BrakeDuration), StartUT));
     AfterBrakePath = new LandingPath(VSL,
                                      BrakeStartPoint.OrbitFromHere(),
                                      TargetAltitude,
                                      BrakeStartPoint.UT,
                                      (AtTargetUT - BrakeStartPoint.UT) / 20,
                                      VSL.Physics.M - ManeuverFuel,
                                      VSL.Engines.AvailableFuelMass - ManeuverFuel,
                                      BrakeDeltaV.magnitude);
     if (Path.Atmosphere)
     {
         update_overheat_info(AfterBrakePath, BrakeStartPoint.ShipTemperature);
     }
     BrakeDeltaV = BrakeDeltaV.normalized * AfterBrakePath.BrakeDeltaV;
     BrakeFuel   = (float)AfterBrakePath.FuelUsed;
     FullBrake   = (VSL.Engines.AvailableFuelMass
                    - ManeuverFuel - BrakeFuel
                    - VSL.Engines.MaxMassFlow * LandingTrajectoryAutopilot.C.LandingThrustTime > 0);
     AtTargetVel  = AfterBrakePath.LastPoint.vel;
     AtTargetPos  = AfterBrakePath.LastPoint.pos;
     AtTargetUT   = AfterBrakePath.LastPoint.UT;
     TransferTime = AtTargetUT - StartUT;
     update_landing_site(AfterBrakePath);
 }
コード例 #3
0
        void update_landing_site(LandingPath path)
        {
            var at_target_rot = TrajectoryCalculator.BodyRotationAtdT(Body, -TimeToTarget);

            approach     = new Coordinates((at_target_rot * path.PointAtUT(path.EndUT - 1).pos).xzy + Body.position, Body);
            SurfacePoint = new WayPoint((at_target_rot * AtTargetPos).xzy + Body.position, Body);
            SurfacePoint.Pos.SetAlt2Surface(Body);
            SurfacePoint.Name = "Landing Site";
        }
コード例 #4
0
        void update_from_orbit()
        {
            AtTargetUT = Body.atmosphere && Orbit.altitude > Body.atmosphereDepth ?
                         TrajectoryCalculator.NearestRadiusUT(Orbit, Body.Radius + Body.atmosphereDepth, StartUT) + 1 : StartUT;
            var end_alt = Math.Max(Orbit.PeA + 10, TargetAltitude);

            Path = new LandingPath(VSL, Orbit, end_alt,
                                   AtTargetUT,
                                   Math.Min(LandingTrajectoryAutopilot.C.AtmoTrajectoryResolution,
                                            Utils.ClampL((VSL.Altitude.Absolute - TargetAltitude) / Math.Abs(VSL.VerticalSpeed.Absolute) / 20, 0.1)),
                                   VSL.Physics.M - ManeuverFuel);
            update_overheat_info(Path, VSL.TCA.part.temperature);
            AtTargetVel  = Path.LastPoint.vel;
            AtTargetPos  = Path.LastPoint.pos;
            AtTargetUT   = Path.LastPoint.UT;
            TransferTime = AtTargetUT - StartUT;
            update_landing_site(Path);
        }