コード例 #1
0
ファイル: BspBuilder.cs プロジェクト: WChrisK/HelionUnity
        private void ExecuteSplitFinalization()
        {
            WorkItem currentWorkItem = workItems.Pop();

            BspNode parentNode = currentWorkItem.Node;
            BspNode leftChild  = new BspNode();
            BspNode rightChild = new BspNode();

            parentNode.SetChildren(leftChild, rightChild);
            parentNode.Splitter = SplitCalculator.States.BestSplitter;

            List <BspSegment> rightSegs = Partitioner.States.RightSegments;
            List <BspSegment> leftSegs  = Partitioner.States.LeftSegments;

            rightSegs.AddRange(MinisegCreator.States.Minisegs);
            leftSegs.AddRange(MinisegCreator.States.Minisegs);

            string path = currentWorkItem.BranchPath;

            if (BspConfig.BranchRight)
            {
                workItems.Push(new WorkItem(leftChild, leftSegs, path + "L"));
                workItems.Push(new WorkItem(rightChild, rightSegs, path + "R"));
            }
            else
            {
                workItems.Push(new WorkItem(rightChild, rightSegs, path + "R"));
                workItems.Push(new WorkItem(leftChild, leftSegs, path + "L"));
            }

            LoadNextWorkItem();
        }