Ejemplo n.º 1
0
 public OctTree(BoundingCuboid boundary, int maxItems, ISimpleOctTreeDivisionStrategy <T> simpleOctTreeDivisionStrategy)
 {
     Boundary = boundary;
     MaxItems = maxItems;
     SimpleOctTreeDivisionStrategy = simpleOctTreeDivisionStrategy;
     Points = new Point3Int <T> [0];
 }
Ejemplo n.º 2
0
 private void GetLocalPointsInCuboid(BoundingCuboid cuboid, ref List <Point3Int <T> > points)
 {
     for (int i = 0; i < Points.Length; i++)
     {
         if (cuboid.ContainsPoint(Points[i].Point))
         {
             points.Add(Points[i]);
         }
     }
 }
Ejemplo n.º 3
0
        public void GetPointsWithinBoundary(BoundingCuboid area, ref List <Point3Int <T> > points)
        {
            if (!Boundary.DoesBoundaryCuboidIntersect(area))
            {
                return;
            }

            if (Points != null)
            {
                GetLocalPointsInCuboid(area, ref points);
            }
            else
            {
                ULF.GetPointsWithinBoundary(area, ref points);
                URF.GetPointsWithinBoundary(area, ref points);
                URB.GetPointsWithinBoundary(area, ref points);
                ULB.GetPointsWithinBoundary(area, ref points);
                BLF.GetPointsWithinBoundary(area, ref points);
                BRF.GetPointsWithinBoundary(area, ref points);
                BLB.GetPointsWithinBoundary(area, ref points);
                BRB.GetPointsWithinBoundary(area, ref points);
            }
        }