public static void ProcessEdge(QuadtreeNode q1, QuadtreeNode q2, int edge, List<int> indices, List<Cell> cells)
{
if (q1.leaf && q2.leaf)
return;
for (int i = 0; i < 2; i++)
{
QuadtreeNode n1 = (q1.leaf ? q1 : q1.children[edge_children[edge, i, 0]]);
QuadtreeNode n2 = (q2.leaf ? q2 : q2.children[edge_children[edge, i, 1]]);
ProcessEdge(n1, n2, edge, indices, cells);
}
if (edge == 0)
ProcessVertices((q1.leaf ? q1 : q1.children[vertex_children[edge, 0, 0]]), (q1.leaf ? q1 : q1.children[vertex_children[edge, 0, 1]]), (q2.leaf ? q2 : q2.children[vertex_children[edge, 1, 0]]), (q2.leaf ? q2 : q2.children[vertex_children[edge, 1, 1]]), indices, cells);
else
ProcessVertices((q1.leaf ? q1 : q1.children[vertex_children[edge, 0, 0]]), (q2.leaf ? q2 : q2.children[vertex_children[edge, 1, 0]]), (q1.leaf ? q1 : q1.children[vertex_children[edge, 0, 1]]), (q2.leaf ? q2 : q2.children[vertex_children[edge, 1, 1]]), indices, cells);
}