private void RemoveBoidFromFlock() { if (_population <= 0) { return; } // save a pointer to the last boid, then remove it from the flock _population--; Boid boid = _flock[_population]; _flock.RemoveAt(_population); // if it is Demo's selected vehicle, unselect it if (boid == Demo.SelectedVehicle) { Demo.SelectedVehicle = null; } }
public override void Open() { // make the database used to accelerate proximity queries _cyclePD = -1; NextPD(); // make default-sized flock _population = 0; for (int i = 0; i < 200; i++) AddBoidToFlock(); // initialize camera Demo.Init3dCamera(Demo.SelectedVehicle); Demo.Camera.Mode = Camera.CameraMode.Fixed; Demo.Camera.FixedDistanceDistance = Demo.CAMERA_TARGET_DISTANCE; Demo.Camera.FixedDistanceVerticalOffset = 0; Demo.Camera.LookDownDistance = 20; Demo.Camera.AimLeadTime = 0.5f; Demo.Camera.PovOffset.X = 0; Demo.Camera.PovOffset.Y = 0.5f; Demo.Camera.PovOffset.Z = -2; Boid.InitializeObstacles(); }
private void AddBoidToFlock() { _population++; Boid boid = new Boid(_pd, Annotations); _flock.Add(boid); if (_population == 1) Demo.SelectedVehicle = boid; }