public void RenderMesh(Mesh mesh)
{
Face f;
/* Make a list of separate triangles so we can render them all at once */
this.lonelyTriList = null;
for (f = mesh.faceHead.nextFace; f != mesh.faceHead; f = f.nextFace)
{
f.marked = false;
}
for (f = mesh.faceHead.nextFace; f != mesh.faceHead; f = f.nextFace)
{
/* We examine all faces in an arbitrary order. Whenever we find
* an unprocessed face F, we output a group of faces including F
* whose size is maximum.
*/
if (f.isInterior && !f.marked)
{
RenderMaximumFaceGroup(f);
if (!f.marked)
{
throw new System.Exception();
}
}
}
if (this.lonelyTriList != null)
{
RenderLonelyTriangles(this.lonelyTriList);
this.lonelyTriList = null;
}
}