Пример #1
0
        public VoxelChunk(double size, Vector3d lowerCorner, int iOffset, int jOffset, int kOffset, HashSet <Part> overridingParts, bool usePartSize256)
        {
            _size  = size;
            offset = iOffset + 8 * jOffset + 64 * kOffset;
            //voxelPoints = new Part[512];
            //voxelSize = new float[512];
            voxelPoints = new PartSizePair[512];
            if (usePartSize256)
            {
                maxLocation = 255;
                for (int i = 0; i < voxelPoints.Length; i++)
                {
                    voxelPoints[i] = new PartSizePair8Bit();
                }
            }
            else
            {
                maxLocation = 15;
                for (int i = 0; i < voxelPoints.Length; i++)
                {
                    voxelPoints[i] = new PartSizePair4Bit();
                }
            }


            this.lowerCorner     = lowerCorner;
            this.overridingParts = overridingParts;
        }
        public VoxelChunk(
            double size,
            Vector3d lowerCorner,
            int iOffset,
            int jOffset,
            int kOffset,
            Dictionary <Part, int> partPriorities,
            bool usePartSize256
            )
        {
            _size       = size;
            offset      = iOffset + 8 * jOffset + 64 * kOffset;
            voxelPoints = new PartSizePair[512];
            if (usePartSize256)
            {
                for (int i = 0; i < voxelPoints.Length; i++)
                {
                    voxelPoints[i] = new PartSizePair8Bit();
                }
            }
            else
            {
                for (int i = 0; i < voxelPoints.Length; i++)
                {
                    voxelPoints[i] = new PartSizePair4Bit();
                }
            }


            this.lowerCorner    = lowerCorner;
            this.partPriorities = partPriorities;
        }