Beispiel #1
0
            public bool Sparsen(Boxl bounds)
            {
                if (Children == null || bounds.Size == Size3i.Unit)
                {
                    return(true);
                }

                Size3l size = bounds.Size / 2;

                bool sparsen = true;

                sparsen &= Children[0].Sparsen(Subbounds(0, bounds, size));
                sparsen &= Children[1].Sparsen(Subbounds(1, bounds, size));
                sparsen &= Children[2].Sparsen(Subbounds(2, bounds, size));
                sparsen &= Children[3].Sparsen(Subbounds(3, bounds, size));
                sparsen &= Children[4].Sparsen(Subbounds(4, bounds, size));
                sparsen &= Children[5].Sparsen(Subbounds(5, bounds, size));
                sparsen &= Children[6].Sparsen(Subbounds(6, bounds, size));
                sparsen &= Children[7].Sparsen(Subbounds(7, bounds, size));

                if (sparsen)
                {
                    return(Sparsen());
                }

                return(false);
            }
Beispiel #2
0
            private Boxl Subbounds(int index, Boxl bounds, Size3l size)
            {
                long x = (index & 1) == 0 ? 0 : size.Width;
                long y = (index & 2) == 0 ? 0 : size.Height;
                long z = (index & 4) == 0 ? 0 : size.Depth;

                return(new Boxl(bounds.X + x, bounds.Y + y, bounds.Z + z, size));
            }
Beispiel #3
0
 public Raytracer(Size3l grid_size)
 {
     GridSize = grid_size;
 }
Beispiel #4
0
 public Raytracer(Size2l grid_size)
 {
     GridSize = new Size3l(grid_size.Width, grid_size.Height, 0);
 }
Beispiel #5
0
 public VirtualVoxelVolume(int pageSize = 16, int uncompressedCapacity = 32, int capacity = 1024)
 {
     PageSize          = new Size3l(pageSize, pageSize, pageSize);
     UncompressedCache = new Collections.Cache <Page>(uncompressedCapacity, EvictPage);
     Capacity          = capacity;
 }
Beispiel #6
0
 public Raytracer(Size3l grid_size)
 {
     GridSize = grid_size;
 }
Beispiel #7
0
 public Raytracer(Size2l grid_size)
 {
     GridSize = new Size3l(grid_size.Width, grid_size.Height, 0);
 }