public OctTree(BoundingCuboid boundary, int maxItems, ISimpleOctTreeDivisionStrategy <T> simpleOctTreeDivisionStrategy) { Boundary = boundary; MaxItems = maxItems; SimpleOctTreeDivisionStrategy = simpleOctTreeDivisionStrategy; Points = new Point3Int <T> [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]); } } }
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); } }