@@ -186,7 +186,7 @@ private static void DrawOrbitSegment(
186186 Vector3 midStraight = ( startVertex + endVertex ) * 0.5f ;
187187 // Debug.Log($"startTA: {startTA}, endTA: {endTA}, startVertex: {startVertex}, endVertex: {endVertex}, midVertex: {midVertex}, midStraight: {midStraight}");
188188
189- if ( Math . Abs ( startTA - endTA ) < 0.01 || ( midStraight - midVertex ) . sqrMagnitude < 9 .0)
189+ if ( Math . Abs ( startTA - endTA ) < 0.01 || ( midStraight - midVertex ) . sqrMagnitude < 16 .0)
190190 {
191191 GL . Vertex3 ( startVertex . x , startVertex . y , 0.0f ) ;
192192 GL . Vertex3 ( midVertex . x , midVertex . y , 0.0f ) ;
@@ -569,29 +569,31 @@ public bool RenderOrbit(RenderTexture screen, float cameraAspect)
569569 {
570570 var orbit = ( targetVessel != null ) ? targetVessel . GetOrbit ( ) : targetBody . GetOrbit ( ) ;
571571
572- double tClosestApproach , dClosestApproach ;
572+ double tClosestApproach ;
573573
574574 if ( targetVessel != null && targetVessel . LandedOrSplashed )
575575 {
576- orbit = JUtil . ClosestApproachSrfOrbit ( selectedPatch , targetVessel , out tClosestApproach , out dClosestApproach ) ;
576+ Vector3d position = JUtil . ClosestApproachSrfOrbit ( selectedPatch , targetVessel , out tClosestApproach , out double _ ) ;
577+ transformedPosition = screenTransform . MultiplyPoint3x4 ( position ) ;
578+ DrawIcon ( transformedPosition . x , transformedPosition . y , targetVessel . vesselType , iconColorTargetValue ) ;
577579 }
578580 else
579581 {
580- dClosestApproach = JUtil . GetClosestApproach ( selectedPatch , orbit , out tClosestApproach ) ;
582+ JUtil . GetClosestApproach ( selectedPatch , orbit , out tClosestApproach ) ;
581583
582584 DrawNextPe ( orbit , selectedPatch . referenceBody , now , iconColorTargetValue , screenTransform ) ;
583585 DrawNextAp ( orbit , selectedPatch . referenceBody , now , iconColorTargetValue , screenTransform ) ;
584- }
585586
586- if ( targetBody != null )
587- {
588- transformedPosition = screenTransform . MultiplyPoint3x4 ( targetBody . getTruePositionAtUT ( now ) - selectedPatch . referenceBody . getTruePositionAtUT ( now ) ) ;
589- DrawIcon ( transformedPosition . x , transformedPosition . y , VesselType . Unknown , iconColorTargetValue , MapIcons . OtherIcon . PLANET ) ;
590- }
591- else
592- {
593- transformedPosition = screenTransform . MultiplyPoint3x4 ( orbit . SwappedRelativePositionAtUT ( now ) ) ;
594- DrawIcon ( transformedPosition . x , transformedPosition . y , targetVessel . vesselType , iconColorTargetValue ) ;
587+ if ( targetBody != null )
588+ {
589+ transformedPosition = screenTransform . MultiplyPoint3x4 ( targetBody . getTruePositionAtUT ( now ) - selectedPatch . referenceBody . getTruePositionAtUT ( now ) ) ;
590+ DrawIcon ( transformedPosition . x , transformedPosition . y , VesselType . Unknown , iconColorTargetValue , MapIcons . OtherIcon . PLANET ) ;
591+ }
592+ else
593+ {
594+ transformedPosition = screenTransform . MultiplyPoint3x4 ( orbit . SwappedRelativePositionAtUT ( now ) ) ;
595+ DrawIcon ( transformedPosition . x , transformedPosition . y , targetVessel . vesselType , iconColorTargetValue ) ;
596+ }
595597 }
596598
597599 if ( selectedPatch . AscendingNodeExists ( orbit ) )
@@ -621,10 +623,13 @@ public bool RenderOrbit(RenderTexture screen, float cameraAspect)
621623 DrawIcon ( transformedPosition . x , transformedPosition . y , VesselType . Unknown , iconColorClosestApproachValue , MapIcons . OtherIcon . SHIPATINTERCEPT ) ;
622624 }
623625
624- // Unconditionally try to draw the closest approach point on
625- // the target orbit.
626- transformedPosition = screenTransform . MultiplyPoint3x4 ( orbit . SwappedRelativePositionAtUT ( tClosestApproach ) ) ;
627- DrawIcon ( transformedPosition . x , transformedPosition . y , VesselType . Unknown , iconColorClosestApproachValue , MapIcons . OtherIcon . TGTATINTERCEPT ) ;
626+ if ( ! targetVessel . LandedOrSplashed )
627+ {
628+ // Unconditionally try to draw the closest approach point on
629+ // the target orbit.
630+ transformedPosition = screenTransform . MultiplyPoint3x4 ( orbit . SwappedRelativePositionAtUT ( tClosestApproach ) ) ;
631+ DrawIcon ( transformedPosition . x , transformedPosition . y , VesselType . Unknown , iconColorClosestApproachValue , MapIcons . OtherIcon . TGTATINTERCEPT ) ;
632+ }
628633 }
629634 else
630635 {
0 commit comments