@@ -69,11 +69,7 @@ public class MSTSSkyDrawer
6969 public Orts . Viewer3D . SkyViewer . Date date ;
7070
7171 private SkySteps skySteps = new SkySteps ( ) ;
72- // Size of the sun- and moon-position lookup table arrays.
73- // Must be an integral divisor of 1440 (which is the number of minutes in a day).
74- //private int maxSteps = 72;
75- //private double mstsskyoldClockTime;
76- //private int step1, step2;
72+
7773 // Phase of the moon
7874 public int mstsskymoonPhase ;
7975 // Wind speed and direction
@@ -210,51 +206,6 @@ public void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
210206 }
211207 }
212208
213- //////////////////////////////////////////////////////////////////////
214-
215- //// Current solar and lunar position are calculated by interpolation in the lookup arrays.
216- //// Using the Lerp() function, so need to calculate the in-between differential
217- //float diff = (float)(MSTSSkyViewer.Simulator.ClockTime - mstsskyoldClockTime) / 1200;
218- //// The rest of this increments/decrements the array indices and checks for overshoot/undershoot.
219- //if (MSTSSkyViewer.Simulator.ClockTime >= (mstsskyoldClockTime + 1200)) // Plus key, or normal forward in time
220- //{
221- // step1++;
222- // step2++;
223- // mstsskyoldClockTime = MSTSSkyViewer.Simulator.ClockTime;
224- // diff = 0;
225- // if (step2 >= maxSteps) // Midnight.
226- // {
227- // step2 = 0;
228- // }
229- // if (step1 >= maxSteps) // Midnight.
230- // {
231- // step1 = 0;
232- // }
233- //}
234- //if (MSTSSkyViewer.Simulator.ClockTime <= (mstsskyoldClockTime - 1200)) // Minus key
235- //{
236- // step1--;
237- // step2--;
238- // mstsskyoldClockTime = MSTSSkyViewer.Simulator.ClockTime;
239- // diff = 0;
240- // if (step1 < 0) // Midnight.
241- // {
242- // step1 = maxSteps - 1;
243- // }
244- // if (step2 < 0) // Midnight.
245- // {
246- // step2 = maxSteps - 1;
247- // }
248- //}
249-
250-
251- //mstsskysolarDirection.X = MathHelper.Lerp(mstsskysolarPosArray[step1].X, mstsskysolarPosArray[step2].X, diff);
252- //mstsskysolarDirection.Y = MathHelper.Lerp(mstsskysolarPosArray[step1].Y, mstsskysolarPosArray[step2].Y, diff);
253- //mstsskysolarDirection.Z = MathHelper.Lerp(mstsskysolarPosArray[step1].Z, mstsskysolarPosArray[step2].Z, diff);
254- //mstsskylunarDirection.X = MathHelper.Lerp(mstsskylunarPosArray[step1].X, mstsskylunarPosArray[step2].X, diff);
255- //mstsskylunarDirection.Y = MathHelper.Lerp(mstsskylunarPosArray[step1].Y, mstsskylunarPosArray[step2].Y, diff);
256- //mstsskylunarDirection.Z = MathHelper.Lerp(mstsskylunarPosArray[step1].Z, mstsskylunarPosArray[step2].Z, diff);
257-
258209 skySteps . SetSunAndMoonDirection ( ref mstsskysolarDirection , ref mstsskylunarDirection , ref mstsskysolarPosArray , ref mstsskylunarPosArray ,
259210 MSTSSkyViewer . Simulator . ClockTime ) ;
260211
0 commit comments