public void ParseStreamForTesselator(Tesselate.Tesselator tesselator, int instructionStreamIndex) { m_VertexList.Clear(); m_CurrentOutput = 0; string[] instructionStream = m_InsructionStream[instructionStreamIndex]; for (int curInstruction = 0; curInstruction < instructionStream.Length; curInstruction++) { switch (instructionStream[curInstruction]) { case "BP": tesselator.BeginPolygon(); break; case "BC": tesselator.BeginContour(); break; case "V": double x = Convert.ToDouble(instructionStream[curInstruction + 1]); double y = Convert.ToDouble(instructionStream[curInstruction + 2]); curInstruction += 2; double[] coords = new double[3]; coords[0] = x; coords[1] = y; tesselator.AddVertex(coords, m_VertexList.Count); m_VertexList.Add(new Vertex(x, y)); break; case "EC": tesselator.EndContour(); break; case "EP": tesselator.EndPolygon(); break; default: throw new Exception(); } } }
public void Connect(Tesselate.Tesselator tesselator, bool setEdgeFlag) { tesselator.callBegin = BeginCallBack; tesselator.callEnd = EndCallBack; tesselator.callVertex = VertexCallBack; tesselator.callCombine = CombineCallBack; if (setEdgeFlag) { tesselator.callEdgeFlag = EdgeFlagCallBack; } }
public TessTool(Tesselate.Tesselator tess) { this.tess = tess; this.tessListener = new TessListener2(); tessListener.Connect(tess, true); }