void DrawMapViewTarget()
        {
            if (HighLogic.LoadedSceneIsEditor)
            {
                return;
            }
            if (!MapView.MapIsEnabled)
            {
                return;
            }
            if (!vessel.isActiveVessel || vessel.GetMasterMechJeb() != core)
            {
                return;
            }

            if (target == null)
            {
                return;
            }
            if (!(target is PositionTarget) && !(target is Vessel))
            {
                return;
            }
            if ((target is Vessel) && (!((Vessel)target).LandedOrSplashed || (((Vessel)target).mainBody != vessel.mainBody)))
            {
                return;
            }
            if (target is DirectionTarget)
            {
                return;
            }

            GLUtils.DrawGroundMarker(targetBody, targetLatitude, targetLongitude, Color.red, true);
        }
        void DoCoordinatePicking()
        {
            if (pickingPositionTarget && !MapView.MapIsEnabled)
            {
                StopPickPositionTargetOnMap();  //stop picking on leaving map view
            }
            if (!pickingPositionTarget)
            {
                return;
            }

            if (MapView.MapIsEnabled && vessel.isActiveVessel)
            {
                if (!GuiUtils.MouseIsOverWindow(core))
                {
                    Coordinates mouseCoords = GuiUtils.GetMouseCoordinates(mainBody);

                    if (mouseCoords != null)
                    {
                        GLUtils.DrawGroundMarker(mainBody, mouseCoords.latitude, mouseCoords.longitude, new Color(1.0f, 0.56f, 0.0f), true, 60);

                        string biome = mainBody.GetExperimentBiomeSafe(mouseCoords.latitude, mouseCoords.longitude);
                        GUI.Label(new Rect(Input.mousePosition.x + 15, Screen.height - Input.mousePosition.y, 200, 50), mouseCoords.ToStringDecimal() + "\n" + biome);

                        if (Input.GetMouseButtonDown(0))
                        {
                            SetPositionTarget(mainBody, mouseCoords.latitude, mouseCoords.longitude);
                            StopPickPositionTargetOnMap();
                        }
                    }
                }
            }
        }
コード例 #3
0
        void DoMapView()
        {
            if ((MapView.MapIsEnabled || camTrajectory) && !vessel.LandedOrSplashed && this.enabled)
            {
                ReentrySimulation.Result drawnResult = Result;
                if (drawnResult != null)
                {
                    if (drawnResult.outcome == ReentrySimulation.Outcome.LANDED)
                    {
                        GLUtils.DrawGroundMarker(drawnResult.body, drawnResult.endPosition.latitude, drawnResult.endPosition.longitude, Color.blue, MapView.MapIsEnabled, 60);
                    }

                    if (showTrajectory && drawnResult.outcome != ReentrySimulation.Outcome.ERROR && drawnResult.outcome != ReentrySimulation.Outcome.NO_REENTRY)
                    {
                        double interval = Math.Max(Math.Min((drawnResult.endUT - drawnResult.input_UT) / 1000, 10), 0.1);
                        //using (var list = drawnResult.WorldTrajectory(interval, worldTrajectory && MapView.MapIsEnabled))
                        using (var list = drawnResult.WorldTrajectory(interval, worldTrajectory))
                        {
                            if (!MapView.MapIsEnabled && (noSkipToFreefall || vessel.staticPressurekPa > 0))
                            {
                                list.value[0] = vesselState.CoM;
                            }
                            GLUtils.DrawPath(drawnResult.body, list.value, Color.red, MapView.MapIsEnabled);
                        }
                    }
                }
            }
        }
コード例 #4
0
 void DoMapView()
 {
     ReentrySimulation.Result drawnResult = GetResult();
     if (MapView.MapIsEnabled && this.enabled && drawnResult != null)
     {
         if (drawnResult.outcome == ReentrySimulation.Outcome.LANDED)
         {
             GLUtils.DrawMapViewGroundMarker(drawnResult.body, drawnResult.endPosition.latitude, drawnResult.endPosition.longitude, Color.blue, 60);
         }
     }
 }
コード例 #5
0
        void DrawBoundingBox()
        {
            if (drawBoundingBox && vessel == FlightGlobals.ActiveVessel)
            {
                vesselBoundingBox = vessel.GetBoundingBox();
                GLUtils.DrawBoundingBox(vessel.mainBody, vessel, vesselBoundingBox, Color.green);

                if (core.target.Target != null)
                {
                    Vessel targetVessel = core.target.Target.GetVessel();
                    targetBoundingBox = targetVessel.GetBoundingBox();
                    GLUtils.DrawBoundingBox(targetVessel.mainBody, targetVessel, targetBoundingBox, Color.blue);
                }
            }
        }
コード例 #6
0
        void DoMapView()
        {
            if (MapView.MapIsEnabled && vessel.isActiveVessel && this.enabled)
            {
                ReentrySimulation.Result drawnResult = GetResult();
                if (drawnResult != null)
                {
                    if (drawnResult.outcome == ReentrySimulation.Outcome.LANDED)
                    {
                        GLUtils.DrawMapViewGroundMarker(drawnResult.body, drawnResult.endPosition.latitude, drawnResult.endPosition.longitude, Color.blue, 60);
                    }

                    if (showTrajectory && drawnResult.outcome != ReentrySimulation.Outcome.ERROR && drawnResult.outcome != ReentrySimulation.Outcome.NO_REENTRY)
                    {
                        double interval = (drawnResult.endUT - drawnResult.input_UT) / 100;
                        GLUtils.DrawPath(drawnResult.body, drawnResult.WorldTrajectory(interval, worldTrajectory), Color.red);
                    }
                }
            }
        }