void RenderLonelyTriangles(Face f)
{
/* Now we render all the separate triangles which could not be
* grouped into a triangle fan or strip.
*/
HalfEdge e;
bool newState = false;
bool edgeState = false; /* force edge state output for first vertex */
bool sentFirstEdge = false;
this.CallBegin(Tesselator.TriangleListType.Triangles);
for (; f != null; f = f.trail)
{
/* Loop once for each edge (there will always be 3 edges) */
e = f.halfEdgeThisIsLeftFaceOf;
do
{
if (this.EdgeCallBackSet)
{
/* Set the "edge state" to TRUE just before we output the
* first vertex of each edge on the polygon boundary.
*/
newState = !e.rightFace.isInterior;
if (edgeState != newState || !sentFirstEdge)
{
sentFirstEdge = true;
edgeState = newState;
this.CallEdgeFlag(edgeState);
}
}
this.CallVertex(e.originVertex.clientIndex);
e = e.nextEdgeCCWAroundLeftFace;
} while (e != f.halfEdgeThisIsLeftFaceOf);
}
this.CallEnd();
}