Пример #1
0
        public void Mesh()
        {
            //Stopwatch sw = new Stopwatch();
            //sw.Start();
            for (int i = 0; i < HEIGHT; i++)
            {
                SubChunk sc = subChunks[i];
                sc.Mesh = ChunkMesher.Mesh(sc);
            }
            //sw.Stop();

            //Console.WriteLine("Chunk mesh took:" + sw.ElapsedMilliseconds);
            IsMeshed = true;
            Changed  = false;
            QueueToRender();
        }
Пример #2
0
 public void Rebuild()
 {
     for (int i = 0; i < HEIGHT; i++)
     {
         SubChunk sc = subChunks[i];
         if (sc.NeedRebuild)
         {
             sc.Mesh        = ChunkMesher.Mesh(sc);
             sc.NeedRebuild = false;
             Renderer.UpdateVertexBuffer(sc);
         }
     }
     for (int i = 0; i < HEIGHT; i++)
     {
         SubChunk sc = subChunks[i];
         Renderer.UpdateVertexBuffer(sc);
     }
     Changed = false;
 }