public List <int> GetPointsInSphere(BoundingSphere containmentSphere) { List <int> list = new List <int>(); root?.AccumulatePointsInSphere(containmentSphere, list); return(list); }
public void AccumulatePointsInSphere(BoundingSphere containmentSphere, List <int> list) { var containmentType = containmentSphere.Contains(ref boundingBox); if (containmentType == ContainmentType.Contains) { list.AddRange(indices); } else if (containmentType == ContainmentType.Intersects) { //note: left and right leftNode.AccumulatePointsInSphere(containmentSphere, list); rightNode.AccumulatePointsInSphere(containmentSphere, list); } else if (containmentType == ContainmentType.Disjoint) { //do nothing } else { throw new Exception("unknown containment type"); } }