PrepareSimulation() 공개 메소드

public PrepareSimulation ( List parts, double theGravity, double theAtmosphere, double theVelocity, bool dumpTree = false, bool vectoredThrust = false ) : bool
parts List
theGravity double
theAtmosphere double
theVelocity double
dumpTree bool
vectoredThrust bool
리턴 bool
예제 #1
0
        private static void StartSimulation()
        {
            try
            {
                bRunning = true;
                ClearResults();
                timer.Start();

                List <Part> parts = HighLogic.LoadedSceneIsEditor ? EditorLogic.SortedShipList : FlightGlobals.ActiveVessel.Parts;

                // Create the Simulation object in this thread
                Simulation sim = new Simulation();

                // This call doesn't ever fail at the moment but we'll check and return a sensible error for display
                if (sim.PrepareSimulation(parts, Gravity, Atmosphere, Velocity, dumpTree, vectoredThrust))
                {
                    ThreadPool.QueueUserWorkItem(new WaitCallback(RunSimulation), sim);
                }
                else
                {
                    failMessage = "PrepareSimulation failed";
                    bRunning    = false;
                    logOutput   = false;
                }
            }
            catch (Exception e)
            {
                MonoBehaviour.print("Exception in StartSimulation: " + e);
                failMessage = e.ToString();
                bRunning    = false;
                logOutput   = false;
            }
            dumpTree = false;
        }
예제 #2
0
        private static void StartSimulation()
        {
            try
            {
                bRunning = true;
                ClearResults();
                timer.Start();

                List<Part> parts = HighLogic.LoadedSceneIsEditor ? EditorLogic.SortedShipList : FlightGlobals.ActiveVessel.Parts;

                // Create the Simulation object in this thread
                Simulation sim = new Simulation();

                // This call doesn't ever fail at the moment but we'll check and return a sensible error for display
                if (sim.PrepareSimulation(parts, Gravity, Atmosphere, Velocity, dumpTree, vectoredThrust))
                {
                    ThreadPool.QueueUserWorkItem(new WaitCallback(RunSimulation), sim);
                }
                else
                {
                    failMessage = "PrepareSimulation failed";
                    bRunning = false;
                    logOutput = false;
                }
            }
            catch (Exception e)
            {
                MonoBehaviour.print("Exception in StartSimulation: " + e);
                failMessage = e.ToString();
                bRunning = false;
                logOutput = false;
            }
            dumpTree = false;
        }