예제 #1
0
        private BSPCollisionNode CreateNewNode(RectBox area)
        {
            byte splitAxis;
            float splitPos;
            if (area.width > area.height)
            {
                splitAxis = 0;
                splitPos = area.GetMiddleX();
            }
            else
            {
                splitAxis = 1;
                splitPos = area.GetMiddleY();
            }

            BSPCollisionNode newNode = GetBSPNode();
            newNode.SetArea(area);
            newNode.SetSplitAxis(splitAxis);
            newNode.SetSplitPos(splitPos);
            return newNode;
        }