Beispiel #1
0
 /// <summary>
 /// Sends the vertices in the set of slices to the accumulator.
 /// </summary>
 private static void _SendVertices(Quadtree <Material>[,] Slices, Axis Direction, int DirectionBound, List <ColorNormalVertex>[,] Accum)
 {
     for (int iax = 0; iax < 3; iax++)
     {
         Axis ax = (Axis)iax;
         if (ax != Direction)
         {
             for (int l = 0; l < DirectionBound - 1; l++)
             {
                 foreach (KeyValuePair <Point <int>, Material> bord in Slices[iax, l].Enumerate(Material.Default))
                 {
                     Vector <int> pos = new Vector <int>(l, bord.Key.X, bord.Key.Y).AxisUnorder(ax);
                     IRenderable  ren = Material.CreateRenderable(new Border <Material>()
                     {
                         Direction = ax, Position = pos, Value = bord.Value
                     });
                     IVertexRenderable <ColorNormalVertex> cnv = ren as IVertexRenderable <ColorNormalVertex>;
                     if (cnv != null)
                     {
                         Accum[pos[Direction], 1].AddRange(cnv.Vertices);
                     }
                 }
             }
         }
         else
         {
             for (int l = 0; l < DirectionBound - 1; l++)
             {
                 var posit = Iterator.ListIterator(Accum[l, 2]);
                 var negit = Iterator.ListIterator(Accum[l + 1, 0]);
                 StaticRenderer.SendQuadtree(Slices[iax, l], Direction, l, new Point <int>(0, 0), posit, negit);
             }
         }
     }
 }