コード例 #1
0
        public override void StartSimulation(IRTIambassador rtiAmb)
        {
            if (log.IsInfoEnabled)
            {
                log.Info("Start Boids simulation");
            }

            JoinSimulation(rtiAmb, color, "Boids");

            try
            {
                simulationThread = new Thread(new ThreadStart(SimulationLoop));
                boidsManager     = new BoidsManager(federateAmbassador);
                boidsManager.BuildBoids(NUMBER_BOIDS, new Vector3(750, 60, 750), color);
                BoidsSample app = new BoidsSample(boidsManager, color);
                simulationThread.Start();
                app.Go();
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("Failed running simulation. Exception :" + e.Message);
                }
            }
        }
コード例 #2
0
 static void Main(string[] args)
 {
     try
     {
         BoidsSample app = new BoidsSample(null, "");
         app.Go();
     }
     catch
     {
         // Check if it's an Ogre Exception
         if (Mogre.OgreException.IsThrown)
             Example.ShowOgreException();
         else
             throw;
     }
 }
コード例 #3
0
 static void Main(string[] args)
 {
     try
     {
         BoidsSample app = new BoidsSample(null, "");
         app.Go();
     }
     catch
     {
         // Check if it's an Ogre Exception
         if (Mogre.OgreException.IsThrown)
         {
             Example.ShowOgreException();
         }
         else
         {
             throw;
         }
     }
 }
コード例 #4
0
ファイル: BoidsSimulation.cs プロジェクト: superliujian/Sxta
        public override void StartSimulation(IRTIambassador rtiAmb)
        {
            if (log.IsInfoEnabled)
                log.Info("Start Boids simulation");

            JoinSimulation(rtiAmb, color, "Boids");

            try
            {
                simulationThread = new Thread(new ThreadStart(SimulationLoop));
                boidsManager = new BoidsManager(federateAmbassador);
                boidsManager.BuildBoids(NUMBER_BOIDS, new Vector3(750, 60, 750), color);
                BoidsSample app = new BoidsSample(boidsManager, color);
                simulationThread.Start();
                app.Go();
            }
            catch (Exception e)
            {
                if (log.IsErrorEnabled)
                    log.Error("Failed running simulation. Exception :" + e.Message);
            }
        }