static void RenderFan(Tesselator tess, HalfEdge e, int size)
{
/* Render as many CCW triangles as possible in a fan starting from
* edge "e". The fan *should* contain exactly "size" triangles
* (otherwise we've goofed up somewhere).
*/
tess.CallBegin(Tesselator.TriangleListType.TriangleFan);
tess.CallVertex(e.originVertex.clientIndex);
tess.CallVertex(e.directionVertex.clientIndex);
while (!e.leftFace.Marked())
{
e.leftFace.marked = true;
--size;
e = e.nextEdgeCCWAroundOrigin;
tess.CallVertex(e.directionVertex.clientIndex);
}
if (size != 0)
{
throw new Exception();
}
tess.CallEnd();
}