public static float GetTotalTime() { Simulation pSim = Simulation.PrivGetInstance(); Debug.Assert(pSim != null); return(pSim.totalWatch); }
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; }
public static float GetTimeStep() { Simulation pSim = Simulation.PrivGetInstance(); Debug.Assert(pSim != null); return(pSim.timeStep); }
public static State GetState() { Simulation pSim = Simulation.PrivGetInstance(); Debug.Assert(pSim != null); return(pSim.PrivGetState()); }
public static void SetState(State simState) { Simulation pSim = Simulation.PrivGetInstance(); Debug.Assert(pSim != null); pSim.PrivSetState(simState); }
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; }
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; }