Пример #1
0
        public xxxFollowLeader(IBoid host)
        {
            _host     = host;
            _flockers = new List <IBoid>();

            _behind              = new Boid();
            _behind._position    = _host._Position;
            _behind._velocity    = _host._Velocity;
            _behind._maxVelocity = _host._MaxVelocity;

            _ahead              = new Boid();
            _ahead._position    = _host._Position;
            _ahead._velocity    = _host._Velocity;
            _ahead._maxVelocity = _host._MaxVelocity;

            _arrive     = new Arrive(_host);
            _evade      = new Evade(_host);
            _separation = new Separation(_host);
            _aligement  = new Aligement(_host);

            _separation._boids = _flockers;
            _aligement._boids  = _flockers;

            _aligement._RADIUS  = 15f;
            _separation._RADIUS = 3f;

            _aligement._WEIGHT  = 1f;
            _separation._WEIGHT = 9f;
        }
Пример #2
0
        public xxxFlock(IBoid host)
        {
            _host     = host;
            _flockers = new List <IBoid>();

            _cohesion   = new Cohesion(_host);
            _aligement  = new Aligement(_host);
            _separation = new Separation(_host);

            _cohesion._boids   = _flockers;
            _aligement._boids  = _flockers;
            _separation._boids = _flockers;

            _cohesion._RADIUS   = 15f;
            _aligement._RADIUS  = 15f;
            _separation._RADIUS = 3f;

            _cohesion._WEIGHT   = 1f;
            _aligement._WEIGHT  = 1f;
            _separation._WEIGHT = 10f;
        }