Beispiel #1
0
        internal VoxelHashSet Copy(VoxelizedSolid solid)
        {
            var copy = new VoxelHashSet(this.level, solid.bitLevelDistribution)
            {
                buckets   = (int[])this.buckets.Clone(),
                slots     = (Slot[])slots.Clone(),
                count     = this.count,
                lastIndex = this.lastIndex,
                freeList  = this.freeList,
            };

            return(copy);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VoxelBinClass"/> class.
 /// </summary>
 /// <param name="ID">The identifier.</param>
 /// <param name="voxelRole">The voxel role.</param>
 /// <param name="solid">The solid.</param>
 public VoxelBinClass(long ID, VoxelRoleTypes voxelRole, VoxelizedSolid solid,
                      bool btmCoordIsInside = false)
 {
     InnerVoxels = new VoxelHashSet[solid.lastLevel];
     for (int i = 1; i < solid.numberOfLevels; i++)
     {
         InnerVoxels[i - 1] = new VoxelHashSet(i, solid.bitLevelDistribution);
     }
     Role    = voxelRole;
     this.ID = Constants.ClearFlagsFromID(ID) +
               Constants.MakeFlags(Level, Role, Role == VoxelRoleTypes.Full || btmCoordIsInside);
     BtmCoordIsInside  = btmCoordIsInside;
     SideLength        = solid.VoxelSideLengths[Level];
     CoordinateIndices = Constants.GetCoordinateIndices(ID, solid.singleCoordinateShifts[0]);
     BottomCoordinate  =
         solid.GetRealCoordinates(Level, CoordinateIndices[0], CoordinateIndices[1], CoordinateIndices[2]);
 }
Beispiel #3
0
 internal VoxelEnumerator(VoxelHashSet set)
 {
     this.set = set;
     index    = 0;
     current  = 0L;// new Voxel(0L, null);
 }