Exemplo n.º 1
0
 public static MeshRaycastHit[] RaycastAll(Ray ray, Octree parentOctree)
 {
     return(CheckRaycastAll(ray, parentOctree).ToArray());
 }
Exemplo n.º 2
0
        public static MeshRaycastHit[] RaycastAll(Ray ray, float dist, LayerMask mask, Octree parentOctree)
        {
            var hits = CheckRaycastAll(ray, parentOctree);

            for (var i = 0; i < hits.Count; i++)
            {
                if (hits[i].distance > dist)
                {
                    hits.RemoveAt(i);
                }
                if (((1 << hits[i].transform.gameObject.layer) & mask.value) != 1 << hits[i].transform.gameObject.layer)
                {
                    hits.RemoveAt(i);
                }
            }
            return(hits.ToArray());
        }
Exemplo n.º 3
0
 public Octree()
 {
     Children  = new List <Octree>();
     Triangles = new List <Triangle>();
     Parent    = null;
 }