Esempio n. 1
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;
        }
Esempio n. 2
0
        public Engagement(IBoid host)
        {
            _host     = host;
            _flockers = new List <IBoid>();

            _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);

            _arrive._target = _target;
            _evade._target  = _ahead;

            _separation._boids  = _flockers;
            _separation._RADIUS = 1.0f;
            _separation._WEIGHT = 0.75f;
        }