Example #1
0
        public static float GetTotalTime()
        {
            Simulation pSim = Simulation.PrivGetInstance();

            Debug.Assert(pSim != null);
            return(pSim.totalWatch);
        }
Example #2
0
        public static void Update(float systemTime)
        {
            Simulation pSim = Simulation.PrivGetInstance();

            Debug.Assert(pSim != null);

            // update input
            pSim.PrivProcessInput();

            // Time update.
            //      Get the time that has passed.
            //      Feels backwards, but its not, need to see how much time has passed
            pSim.stopWatch_toc = systemTime - pSim.stopWatch_tic;
            pSim.stopWatch_tic = systemTime;

            if (pSim.PrivGetState() == State.FixedStep)
            {
                pSim.timeStep = SIM_SINGLE_TIME_STEP;
            }
            else if (pSim.PrivGetState() == State.Realtime)
            {
                pSim.timeStep = pSim.stopWatch_toc;
            }
            else if (pSim.PrivGetState() == State.SingleStep)
            {
                pSim.timeStep = SIM_SINGLE_TIME_STEP;
                pSim.PrivSetState(State.Pause);
            }
            else //  pSim->getState() == SimulationEnum::Pause
            {
                pSim.timeStep = 0.0f;
            }

            pSim.totalWatch += pSim.timeStep;
        }
Example #3
0
        public static float GetTimeStep()
        {
            Simulation pSim = Simulation.PrivGetInstance();

            Debug.Assert(pSim != null);
            return(pSim.timeStep);
        }
Example #4
0
        public static State GetState()
        {
            Simulation pSim = Simulation.PrivGetInstance();

            Debug.Assert(pSim != null);

            return(pSim.PrivGetState());
        }
Example #5
0
        public static void SetState(State simState)
        {
            Simulation pSim = Simulation.PrivGetInstance();

            Debug.Assert(pSim != null);

            pSim.PrivSetState(simState);
        }
Example #6
0
        public static void Destroy()
        {
            Simulation pSim = Simulation.PrivGetInstance();

            Debug.Assert(pSim != null);

#if (TRACK_DESTRUCTOR_MAN)
            Debug.WriteLine("Simulation.Destroy()");
#endif


#if (TRACK_DESTRUCTOR_MAN)
            Debug.WriteLine("     {0} ({1})", Simulation.pInstance, Simulation.pInstance.GetHashCode());
#endif
            Simulation.pInstance = null;
        }
Example #7
0
        public static void Destroy()
        {
            // Get the instance
            Simulation pSim = Simulation.PrivGetInstance();

            Debug.Assert(pSim != null);
#if (TRACK_DESTRUCTOR_MAN)
            Debug.WriteLine("--->Simulation.Destroy()");
#endif
#if (TRACK_DESTRUCTOR_MAN)
            Debug.WriteLine("     {0} ({1})", pMan.poNodeCompare, pMan.poNodeCompare.GetHashCode());
            Debug.WriteLine("     {0} ({1})", Simulation.pInstance, Simulation.pInstance.GetHashCode());
#endif

            Simulation.pInstance = null;
            Simulation.oldKey    = false;
        }