Isosurface.ManifoldDC.OctreeNode.ProcessEdge C# (CSharp) Method

ProcessEdge() public static method

public static ProcessEdge ( OctreeNode nodes, int direction, List indexes, List tri_count, float threshold ) : void
nodes OctreeNode
direction int
indexes List
tri_count List
threshold float
return void
        public static void ProcessEdge(OctreeNode[] nodes, int direction, List<int> indexes, List<int> tri_count, float threshold)
        {
            if (nodes[0] == null || nodes[1] == null || nodes[2] == null || nodes[3] == null)
                return;

            if (nodes[0].type == NodeType.Leaf && nodes[1].type == NodeType.Leaf && nodes[2].type == NodeType.Leaf && nodes[3].type == NodeType.Leaf)
            {
                ProcessIndexes(nodes, direction, indexes, tri_count, threshold);
            }
            else
            {
                for (int i = 0; i < 2; i++)
                {
                    OctreeNode[] edge_nodes = new OctreeNode[4];

                    for (int j = 0; j < 4; j++)
                    {
                        if (nodes[j].type == NodeType.Leaf)
                            edge_nodes[j] = nodes[j];
                        else
                            edge_nodes[j] = nodes[j].children[Utilities.TEdgeProcEdgeMask[direction, i, j]];
                    }

                    ProcessEdge(edge_nodes, Utilities.TEdgeProcEdgeMask[direction, i, 4], indexes, tri_count, threshold);
                }
            }
        }