Пример #1
0
        static public BoundsTree <T> CreatePlanarQuadtree(Bounds bounds, int depth, int target_number_items, Operation <Bounds, T> operation, IEnumerable <T> items)
        {
            BoundsTree <T> tree = CreatePlanarQuadtree(bounds, depth, target_number_items, operation);

            tree.AddRange(items);
            return(tree);
        }
Пример #2
0
 public MeshDissector(Mesh mesh, int depth, int target_number_triangles)
 {
     triangles = BoundsTree <MeshDissectorTriangle> .CreateOctree(
         mesh.bounds.GetEnlarged(0.1f),
         depth,
         target_number_triangles,
         t => t.bounds,
         mesh.GetTriangles().Convert(t => new MeshDissectorTriangle(t))
         );
 }
Пример #3
0
 static public IEnumerable <T> GetItemsWithin <T>(this BoundsTree <T> item, Plane plane)
 {
     return(item.GetItemsWithin(b => b.IsIntersecting(plane)));
 }
Пример #4
0
 static public void AddRange <T>(this BoundsTree <T> item, params T[] to_add)
 {
     item.AddRange((IEnumerable <T>)to_add);
 }
Пример #5
0
 static public void AddRange <T>(this BoundsTree <T> item, IEnumerable <T> to_add)
 {
     to_add.Process(i => item.Add(i));
 }