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); } } }
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; }
public static Boid NewBoid(float velFactor, BoidsManager bh, Vector3 floorCenter, string boidColor) { return((Boid)NewInstance(myCallType, velFactor, bh, floorCenter, boidColor)); }
public static Boid NewBoid(float velFactor, BoidsManager bh, Vector3 floorCenter, string boidColor) { return (Boid)NewInstance(myCallType, velFactor, bh, floorCenter, boidColor); }
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); } }
public BoidsSample(BoidsManager manager, string boidColor) { boidsManager = manager; color = boidColor; }