Exemplo n.º 1
0
            /// <summary>
            /// Gets the vertex buffer for the specified level.
            /// </summary>
            public VBO <ColorNormalVertex> GetLevel(int Level, Polarity Direction)
            {
                if (Direction == Polarity.Negative)
                {
                    Level--;
                }
                VBO <ColorNormalVertex> c = this._Levels[Level, (int)Direction];

                if (c == null)
                {
                    IIterator <ColorNormalVertex, VBO <ColorNormalVertex> > vboc = VBO <ColorNormalVertex> .Create();

                    IBoundedPlaneSurface <Material> bps = Shape.Slice(this._StratifiedRenderer._Source, this._Axis, Level, delegate(T Lower, T Higher, Axis Axis)
                    {
                        if (Direction == Polarity.Positive && !Higher.Equals(this._StratifiedRenderer._Default))
                        {
                            return(this._StratifiedRenderer._SurfacizeFunc(Lower, this._StratifiedRenderer._Default, Axis));
                        }
                        if (Direction == Polarity.Negative && !Lower.Equals(this._StratifiedRenderer._Default))
                        {
                            return(this._StratifiedRenderer._SurfacizeFunc(this._StratifiedRenderer._Default, Higher, Axis));
                        }
                        return(Material.Default);
                    }, Material.Default);

                    QuadtreeSurface <Material> qs = bps.Extend <QuadtreeSurface <Material> >();
                    if (qs != null)
                    {
                        StaticRenderer.Send(qs, vboc, vboc);
                    }
                    else
                    {
                        StaticRenderer.Send(bps, vboc);
                    }

                    this._Levels[Level, (int)Direction] = c = vboc.End();
                }
                return(c);
            }
Exemplo n.º 2
0
 /// <summary>
 /// Sends all the vertices in the given quadtree surface to the specified iterators.
 /// </summary>
 public static void Send <R>(QuadtreeSurface <Material> Source, IIterator <ColorNormalVertex, R> Positive, IIterator <ColorNormalVertex, R> Negative)
 {
     SendQuadtree(Source.Source, Source.PlaneAxis, Source.PlaneLevel, new Point <int>(0, 0), Positive, Negative);
 }