@@ -12,34 +12,34 @@ public void Start()
1212 {
1313 PluginConfiguration cfg = KSP . IO . PluginConfiguration . CreateForType < NavBallDockingAlignmentIndicator > ( ) ;
1414 cfg . load ( ) ;
15- Vector3 tmp = cfg . GetValue < Vector3 > ( "alignmentmarkercolor" , new Vector3 ( 1f , 0f , 0f ) ) ; //default: red
15+ Vector3 tmp = cfg . GetValue < Vector3 > ( "alignmentmarkercolor" , new Vector3 ( 1f , 0f , 0f ) ) ; // default: red
1616 Color alignmentmarkercolor = new Color ( tmp . x , tmp . y , tmp . z ) ;
17- Vector2 alignmentmarkertexture = cfg . GetValue < Vector2 > ( "alignmentmarkertexture" , new Vector2 ( 0f , 2f ) ) ; //default: prograde marker
17+ Vector2 alignmentmarkertexture = cfg . GetValue < Vector2 > ( "alignmentmarkertexture" , new Vector2 ( 0f , 2f ) ) ; // default: prograde marker
1818 cfg . save ( ) ;
1919 float texturescalefactor = 1f / 3f ;
2020
21- //get navball object
21+ // get navball object
2222 GameObject navBall = GameObject . Find ( "NavBall" ) ;
2323 Transform navBallVectorsPivotTransform = navBall . transform . FindChild ( "vectorsPivot" ) ;
2424 navBallBehaviour = navBall . GetComponent < NavBall > ( ) ;
2525
26- //get indicator texture (use the prograde marker, since it has a clear 'upwards' direction)
26+ // get indicator texture (use the prograde marker, since it has a clear 'upwards' direction)
2727 ManeuverGizmo maneuverGizmo = MapView . ManeuverNodePrefab . GetComponent < ManeuverGizmo > ( ) ;
2828 ManeuverGizmoHandle maneuverGizmoHandle = maneuverGizmo . handleNormal ;
2929 Transform transform = maneuverGizmoHandle . flag ;
3030 Renderer renderer = transform . renderer ;
3131 Material maneuverTexture = renderer . sharedMaterial ;
3232
33- //create alignment indicator game object
33+ // create alignment indicator game object
3434 indicator = Create2DObject (
3535 name : "navballalignmentindicator" ,
36- size : 0.025f , //the same size as all other markers
36+ size : 0.025f , // the same size as all other markers
3737 col : alignmentmarkercolor ,
3838 texture : maneuverTexture ,
3939 textureScale : Vector2 . one * texturescalefactor ,
4040 textureOffset : alignmentmarkertexture * texturescalefactor ,
4141 parentTransform : navBallVectorsPivotTransform ,
42- layer : 12 //the navball layer
42+ layer : 12 // the navball layer
4343 ) ;
4444 }
4545
@@ -108,8 +108,9 @@ private GameObject Create2DObject(
108108
109109 public void LateUpdate ( )
110110 {
111- if ( FlightGlobals . ready == false )
111+ if ( FlightGlobals . ready == false ) {
112112 return ;
113+ }
113114
114115 if ( FlightGlobals . fetch != null ) {
115116 if ( FlightGlobals . fetch . VesselTarget != null ) {
@@ -118,13 +119,13 @@ public void LateUpdate()
118119 Transform targetTransform = targetPort . GetTransform ( ) ;
119120 Transform selfTransform = FlightGlobals . ActiveVessel . ReferenceTransform ;
120121
121- //indicator position
122+ // indicator position
122123 Vector3 targetPortOutVector = targetTransform . forward . normalized ;
123124 Vector3 targetPortInVector = - targetPortOutVector ;
124125 Vector3 rotatedTargetPortInVector = navBallBehaviour . attitudeGymbal * targetPortInVector ;
125126 indicator . transform . localPosition = rotatedTargetPortInVector * navBallBehaviour . progradeVector . localPosition . magnitude ;
126127
127- //indicator rotation
128+ // indicator rotation
128129 Vector3 v1 = Vector3 . Cross ( selfTransform . up , - targetTransform . up ) ;
129130 Vector3 v2 = Vector3 . Cross ( selfTransform . up , selfTransform . forward ) ;
130131 float ang = Vector3 . Angle ( v1 , v2 ) ;
@@ -133,15 +134,15 @@ public void LateUpdate()
133134 }
134135 indicator . transform . rotation = Quaternion . Euler ( 90 + ang , 90 , 270 ) ;
135136
136- //indicator visibility (invisible if on back half sphere)
137+ // indicator visibility (invisible if on back half sphere)
137138 indicator . SetActive ( indicator . transform . localPosition . z > 0.0d ) ;
138139
139140 return ;
140141 }
141142 }
142143 }
143144
144- //no docking port is currently selected
145+ // no docking port is currently selected
145146 indicator . SetActive ( false ) ;
146147 return ;
147148 }
0 commit comments