Пример #1
0
 public static bool HasImpact()
 {
     if (Available())
     {
         return(TRWrapper.ImpactVector().HasValue);
     }
     throw new Exception("Trajectories is not available");
 }
Пример #2
0
 public static Double GetImpactTime()
 {
     if (Available())
     {
         if (TRWrapper.GetTimeTillImpact() != null)
         {
             return((double)TRWrapper.GetTimeTillImpact());
         }
         throw new Exception("Impact time is not available. Remember to check addons:tr:HasImpact");
     }
     throw new Exception("Trajectories is not available");
 }
Пример #3
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");
 }
Пример #4
0
 public void Start()
 {
     TRWrapper.init();
 }