Exemple #1
0
            public INode Split(bool isTerminal)
            {
                INode node;

                if (isTerminal)
                {
                    var terminal = new TerminalLeafNode();
                    for (int i = 0; i < 8; i++)
                    {
                        terminal.children[i] = voxel;
                    }
                    node = terminal;
                }
                else
                {
                    node = new Node();
                    for (int i = 0; i < 8; i++)
                    {
                        node.SetChild(i, new MetaLeafNode()
                        {
                            voxel = voxel
                        });
                    }
                }
                return(node);
            }
Exemple #2
0
            public INode MakeChild(int index, bool isLeaf)
            {
                INode child;

                if (isLeaf)
                {
                    child = new TerminalLeafNode();
                }
                else
                {
                    child = new Node();
                }
                children[index] = child;
                return(child);
            }