@@ -234,9 +234,12 @@ public bool RenderPFD(RenderTexture screen, float aspect)
234234
235235 Quaternion gymbal = comp . AttitudeGymbal ;
236236
237+ double speedInCurrentMode = 0 ;
238+
237239 if ( FlightGlobals . speedDisplayMode == FlightGlobals . SpeedDisplayModes . Orbit )
238240 {
239241 Vector3 velocityVesselOrbitUnit = comp . Prograde ;
242+ speedInCurrentMode = FlightGlobals . ship_obtSpeed ;
240243 Vector3 radialPlus = comp . RadialOut ;
241244 Vector3 normalPlus = comp . NormalPlus ;
242245 // stockNavBall.relativeGymbal * (stockNavBall.progradeVector.localRotation * stockNavBall.progradeVector.right == gymbal * velocityVesselOrbitUnit
@@ -259,17 +262,23 @@ public bool RenderPFD(RenderTexture screen, float aspect)
259262 else if ( FlightGlobals . speedDisplayMode == FlightGlobals . SpeedDisplayModes . Surface )
260263 {
261264 Vector3 velocityVesselSurfaceUnit = vessel . srf_velocity . normalized ;
265+ speedInCurrentMode = FlightGlobals . ship_srfSpeed ;
262266 MoveMarker ( markerPrograde , velocityVesselSurfaceUnit , gymbal ) ;
263267 MoveMarker ( markerRetrograde , - velocityVesselSurfaceUnit , gymbal ) ;
264268 }
265269 else // FlightGlobals.speedDisplayMode == FlightGlobals.SpeedDisplayModes.Target
266270 {
267271 Vector3 targetDirection = FlightGlobals . ship_tgtVelocity . normalized ;
272+ speedInCurrentMode = FlightGlobals . ship_tgtSpeed ;
268273
269274 MoveMarker ( markerPrograde , targetDirection , gymbal ) ;
270275 MoveMarker ( markerRetrograde , - targetDirection , gymbal ) ;
271276 }
272277
278+ bool progradeVisible = speedInCurrentMode >= 0.05 ;
279+ markerPrograde . visible = progradeVisible ;
280+ markerRetrograde . visible = progradeVisible ;
281+
273282 if ( vessel . patchedConicSolver != null && vessel . patchedConicSolver . maneuverNodes . Count > 0 )
274283 {
275284 Vector3 burnVector = vessel . patchedConicSolver . maneuverNodes [ 0 ] . GetBurnVector ( vessel . orbit ) . normalized ;
@@ -340,9 +349,6 @@ public bool RenderPFD(RenderTexture screen, float aspect)
340349 markerTargetMinus . visible = true ;
341350 }
342351
343- markerPrograde . visible = true ;
344- markerRetrograde . visible = true ;
345-
346352 // I wonder if doing this as a command buffer might be more efficient?
347353
348354 GL . PushMatrix ( ) ;
@@ -366,6 +372,19 @@ public bool RenderPFD(RenderTexture screen, float aspect)
366372 DrawMarker ( markerDockingAlignment ) ;
367373 DrawMarker ( markerNavWaypoint ) ;
368374
375+ markerPrograde . visible = false ;
376+ markerRetrograde . visible = false ;
377+ markerManeuver . visible = false ;
378+ markerManeuverMinus . visible = false ;
379+ markerTarget . visible = false ;
380+ markerTargetMinus . visible = false ;
381+ markerNormal . visible = false ;
382+ markerNormalMinus . visible = false ;
383+ markerRadial . visible = false ;
384+ markerRadialMinus . visible = false ;
385+ markerDockingAlignment . visible = false ;
386+ markerNavWaypoint . visible = false ;
387+
369388 if ( overlay != null )
370389 {
371390 var overlayMesh = overlay . GetComponent < MeshFilter > ( ) . mesh ;
0 commit comments