예제 #1
0
 /// <summary>
 /// Allows selecting new object to be center of view.
 /// </summary>
 /// <remarks>
 /// View will follow selected object keeping it in the middle.
 /// </remarks>
 /// <param name="name">Name of object to be followed by view</param>
 public void SelectNewCenter(string name)
 {
     selectedObject = system.SelectObject(name);
 }
예제 #2
0
        private static (long sunEarth, long earthMoon, long marsPhobos, long marsDeimos, long earthMars, long serialTime) RunSerial(int eulerSteps, double eulerTimeStep)
        {
            system.Reset("system.json", eulerTimeStep);
            stopwatch.Reset();
            stopwatch.Start();
            for (int i = 0; i < eulerSteps; i++)
            {
                system.CalculateStep();
            }
            stopwatch.Stop();
            long[] sun        = system.SelectObject("Sun").Position;
            long[] earth      = system.SelectObject("Earth").Position;
            long[] moon       = system.SelectObject("Moon").Position;
            long[] mars       = system.SelectObject("Mars").Position;
            long[] phobos     = system.SelectObject("Phobos").Position;
            long[] deimos     = system.SelectObject("Deimos").Position;
            long   sunEarth   = CalculateDistance(sun, earth);
            long   earthMoon  = CalculateDistance(earth, moon);
            long   marsPhobos = CalculateDistance(mars, phobos);
            long   marsDeimos = CalculateDistance(mars, deimos);
            long   earthMars  = CalculateDistance(earth, mars);
            long   serialTime = stopwatch.ElapsedMilliseconds;

            return(sunEarth, earthMoon, marsPhobos, marsDeimos, earthMars, serialTime);
        }