public static void ClusterEdge(OctreeNode[] nodes, int direction, ref int surface_index, List<Vertex> collected_vertices)
{
if ((nodes[0] == null || nodes[0].type != NodeType.Internal) && (nodes[1] == null || nodes[1].type != NodeType.Internal) && (nodes[2] == null || nodes[2].type != NodeType.Internal) && (nodes[3] == null || nodes[3].type != NodeType.Internal))
{
ClusterIndexes(nodes, direction, ref surface_index, collected_vertices);
}
else
{
for (int i = 0; i < 2; i++)
{
OctreeNode[] edge_nodes = new OctreeNode[4];
for (int j = 0; j < 4; j++)
{
if (nodes[j] == null)
continue;
if (nodes[j].type == NodeType.Leaf)
edge_nodes[j] = nodes[j];
else
edge_nodes[j] = nodes[j].children[Utilities.TEdgeProcEdgeMask[direction, i, j]];
}
ClusterEdge(edge_nodes, Utilities.TEdgeProcEdgeMask[direction, i, 4], ref surface_index, collected_vertices);
}
}
}