예제 #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
파일: Boid.cs 프로젝트: agustinsantos/Sxta
        protected Boid(float velFactor, BoidsManager bh, Vector3 floorCenter, string boidColor)
        {
            maxSpeed = MAX_SPEED * velFactor;    // to vary the maxSpeed
            beh      = bh;
            //center = floorCenter;
            MAX_PT += floorCenter;
            MIN_PT += floorCenter;

            Position = floorCenter + new Vector3(RandPosn(),
                                                 (float)(random.NextDouble() * 6.0),
                                                 RandPosn());
            Velocity = new Vector3(RandVel(), RandVel(), RandVel());
            Color    = boidColor;
        }
예제 #3
0
파일: Boid.cs 프로젝트: superliujian/Sxta
        protected Boid(float velFactor, BoidsManager bh, Vector3 floorCenter, string boidColor)
        {
            maxSpeed = MAX_SPEED * velFactor;    // to vary the maxSpeed
            beh = bh;
            //center = floorCenter;
            MAX_PT += floorCenter;
            MIN_PT += floorCenter;

            Position = floorCenter + new Vector3(RandPosn(),
                                                (float)(random.NextDouble() * 6.0),
                                                RandPosn());
            Velocity = new Vector3(RandVel(), RandVel(), RandVel());
            Color = boidColor;
        }
예제 #4
0
파일: Boid.cs 프로젝트: agustinsantos/Sxta
 public static Boid NewBoid(float velFactor, BoidsManager bh, Vector3 floorCenter, string boidColor)
 {
     return((Boid)NewInstance(myCallType, velFactor, bh, floorCenter, boidColor));
 }
예제 #5
0
파일: Boid.cs 프로젝트: superliujian/Sxta
 public static Boid NewBoid(float velFactor, BoidsManager bh, Vector3 floorCenter, string boidColor)
 {
     return (Boid)NewInstance(myCallType, velFactor, bh, floorCenter, boidColor);
 }
예제 #6
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);
            }
        }
예제 #7
0
 public BoidsSample(BoidsManager manager, string boidColor)
 {
     boidsManager = manager;
     color        = boidColor;
 }
예제 #8
0
 public BoidsSample(BoidsManager manager, string boidColor)
 {
     boidsManager = manager;
     color = boidColor;
 }