コード例 #1
0
        public IEnumerable <IFlockBoid> UpdateNeighbourList(IEnumerable <IFlockBoid> neighbours = null)
        {
            if (neighbours != null)
            {
                Neighbours.UnionWith(neighbours);
            }

            var maxInfluenceRange = Mathf.Max(Influences.Alignment.Range, Influences.Cohesion.Range, Influences.Separation.Range);

            Neighbours.RemoveWhere(n => (n.Position - Position).magnitude > maxInfluenceRange);

            return(Neighbours);
        }
コード例 #2
0
ファイル: MeshFace.cs プロジェクト: Daloupe/MeshReconstructor
 // Methods
 public void GetNeighbours()
 {
     Vertices.ForEach(a => Neighbours.UnionWith(a.GetAdjacentFaces(this)));
 }