Пример #1
0
        public void createSponge()
        {
            int[] voxels  = new int[256 * 64 * 256];
            int[] heights = new int[256 * 256];
            int   size    = 3;

            for (int i = 0; i < voxels.Length; i++)
            {
                voxels[i] = 0;
            }
            for (int i = 0; i < heights.Length; i++)
            {
                heights[i] = 255;
            }

            while (size * 3 <= 256)
            {
                size *= 3;
            }

            putSponge(voxels, size, 0, 0, 0);

            MapVoxels.SetData(voxels);
            MapHeights.SetData(heights);
        }
Пример #2
0
        public int[] getVoxels()
        {
            int[] buffer = new int[64 * 256 * 256];

            MapVoxels.GetData(buffer);

            return(buffer);
        }
Пример #3
0
        //public int[] getVoxels()
        //{
        //int[] buffer = new int[64 * 256 * 256];

        //  MapVoxels.GetData( buffer );

        //  return buffer;
        //}


        //public int[] getHeights()
        //{
        //int[] buffer = new int[256 * 256];

        //  MapHeights.GetData( buffer );

        //  return buffer;
        //}


        public void releaseTemporaryBuffers()
        {
            if (null != MapVoxels)
            {
                MapVoxels.Release();
            }
            MapVoxels = null;

            if (null != MapHeights)
            {
                MapHeights.Release();
            }
            MapHeights = null;
        }
Пример #4
0
 void SetMapVoxels(NeighborChunkGenData nei)
 {
     MapVoxels.SetData(nei.centerChunkData.lods[0]);
     MapVoxelsLOD2.SetData(nei.centerChunkData.lods[1]);
     MapVoxelsLOD4.SetData(nei.centerChunkData.lods[2]);
 }
Пример #5
0
 public uint[] TestGetMapVoxelData()
 {
     uint[] mvs = new uint[MapVoxels.count];
     MapVoxels.GetData(mvs);
     return(mvs);
 }