public static void DrawClosestApproachVessel(LineRenderer closestApproachLine, List <Orbit> orbits, List <Orbit> targetOrbits, ref bool drawn) { for (int i = 0; i < orbits.Count; i++) { for (int j = 0; j < targetOrbits.Count; j++) { if (!(orbits[i].planet != targetOrbits[j].planet)) { ClosestApproach.CalculateClosestApproach(closestApproachLine, orbits[i], targetOrbits[j], Ref.controller.globalTime, ref drawn); if (drawn) { return; } } } } }
public static void DrawClosestApproachPlanet(LineRenderer closestApproachLine, List <Orbit> orbits, CelestialBodyData targetPlanet, ref bool drawn) { for (int i = 0; i < orbits.Count; i++) { if (orbits[i].orbitType != Orbit.Type.Encounter) { if (orbits[i].planet == targetPlanet) { ClosestApproach.SetLine(closestApproachLine, Kepler.GetPosition(orbits[i].periapsis, 0.0, orbits[i].argumentOfPeriapsis), Double3.zero, Ref.map.mapRefs[targetPlanet].holder); drawn = true; return; } if (orbits[i].planet == targetPlanet.parentBody) { ClosestApproach.CalculateClosestApproach(closestApproachLine, orbits[i], targetPlanet, ref drawn); if (drawn) { return; } } } } }