public MeshBuilder() { vertices = new List <VertexEntry>(); faces = new List <FaceEntry>(); edges = new List <EdgeEntry>(); spatialTree = new Spatial3DTree <VertexEntry>(); sphereCastEnumerator = new SphereCastEnumerator <VertexEntry>(spatialTree, Vector3.zero, maxDistForVertEq); }
public static IList <T> SphereCast <T>([NotNull] this Spatial3DTree <T> tree, Vector3 center, float radius) where T : class { if (tree == null) { throw new ArgumentNullException(nameof(tree)); } var result = new List <T>(); var enumerator = new SphereCastEnumerator <T>(tree, center, radius); while (enumerator.MoveNext()) { result.Add(enumerator.Current); } return(result); }