Exemplo n.º 1
0
        public float[] GetAreaTess(TessTool tess, TessTriangleTechnique tech)
        {
#if DEBUG
            if (this.TessTriangleTech == 0)
            {
            }
#endif

            if (TessTriangleTech != tech)
            {
                //re tess again
                this.TessTriangleTech = tech;
                //***
                if (this.TessTriangleTech == TessTriangleTechnique.DrawArray)
                {
                    return(_areaTess ??
                           (_areaTess = tess.TessAsTriVertexArray(coordXYs, null, out _tessAreaVertexCount)));
                }
                else
                {
                    _indexListArray = tess.TessAsTriIndexArray(coordXYs,
                                                               null,
                                                               out _areaTess,
                                                               out _tessAreaVertexCount);
                    return(_areaTess);
                }
            }
            else
            {
                //if equal
                return(_areaTess);
            }
        }
Exemplo n.º 2
0
        public float[] GetAreaTess(TessTool tess, Tesselate.Tesselator.WindingRuleType windingRuleType, TessTriangleTechnique tessTechnique)
        {
#if DEBUG
            if (this.TessTriangleTech == 0)
            {
            }
#endif

            if (TessTriangleTech != tessTechnique)
            {
                //re tess again
                this.TessTriangleTech = tessTechnique;
                //***
                using (Borrow(out ReusableCoordList resuableCoordList))
                {
                    List <float> coordXYs         = resuableCoordList._coordXYs;
                    List <int>   contourEndPoints = resuableCoordList._contourEndPoints;


                    for (int i = 0; i < _figures.Length; ++i)
                    {
                        Figure figure = _figures[i];
                        coordXYs.AddRange(figure.coordXYs);
                        contourEndPoints.Add(coordXYs.Count - 1);
                    }


                    if (this.TessTriangleTech == TessTriangleTechnique.DrawArray)
                    {
                        tess.WindingRuleType = windingRuleType;
                        return(_areaTess = tess.TessAsTriVertexArray(
                                   coordXYs.ToArray(),
                                   contourEndPoints.ToArray(),
                                   out _tessAreaVertexCount));
                    }
                    else
                    {
                        tess.WindingRuleType = windingRuleType;
                        _areaTessIndexList   = tess.TessAsTriIndexArray(
                            coordXYs.ToArray(),
                            contourEndPoints.ToArray(),
                            out _areaTess,
                            out _tessAreaVertexCount);
                        return(_areaTess);
                    }
                }
            }
            else
            {
                //if equal
                return(_areaTess);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// vertex buffer of the solid area part
 /// </summary>
 public VertexBufferObject GetAreaTessAsVBO(TessTool tess)
 {
     if (_vboArea == null)
     {
         //tess
         indexListArray = tess.TessAsTriIndexArray(coordXYs, null,
                                                   out tessXYCoords2, out this._tessAreaVertexCount);
         _vboArea = new VertexBufferObject();
         _vboArea.CreateBuffers(tessXYCoords2, indexListArray, null);
     }
     return(_vboArea);
 }