Example #1
0
 public static bool HasImpact()
 {
     if (Available())
     {
         return(TRWrapper.ImpactVector().HasValue);
     }
     throw new Exception("Trajectories is not available");
 }
Example #2
0
 public static KRPC.Utils.Tuple <Double, Double> ImpactPos()
 {
     if (Available())
     {
         CelestialBody body       = FlightGlobals.ActiveVessel.orbit.referenceBody;
         Vector3?      impactVect = TRWrapper.ImpactVector();
         if (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("Impact position is not available. Remember to check addons:tr:HasImpact");
     }
     throw new Exception("Trajectories is not available");
 }