コード例 #1
0
        public void InsertNode(SceneNode node, PartitionCategories category)
        {
            switch (category)
            {
            case PartitionCategories.Dynamic:
                mDynamicRoot.AddChild(node);
                break;

            case PartitionCategories.Static:
                ImplicitBoundingBoxNode boxNode = node as ImplicitBoundingBoxNode;
                if (boxNode == null)
                {
                    boxNode = new ImplicitBoundingBoxNode(true);
                    boxNode.AddChild(node);
                    boxNode.RecalculateBound();
                }

                if (mStaticTreeRoot == null)
                {
                    mStaticTreeRoot = boxNode;
                }
                else
                {
                    mStaticTreeRoot.InsertNodeIntoBVH(boxNode);
                }
                break;

            case PartitionCategories.Skybox:
                mSkyboxRoot.AddChild(node);
                break;
            }
        }
コード例 #2
0
ファイル: SceneGraphRoot.cs プロジェクト: Tengato/Mechadrone1
        public void InsertNode(SceneNode node, PartitionCategories category)
        {
            switch (category)
            {
                case PartitionCategories.Dynamic:
                    mDynamicRoot.AddChild(node);
                    break;
                case PartitionCategories.Static:
                    ImplicitBoundingBoxNode boxNode = node as ImplicitBoundingBoxNode;
                    if (boxNode == null)
                    {
                        boxNode = new ImplicitBoundingBoxNode(true);
                        boxNode.AddChild(node);
                        boxNode.RecalculateBound();
                    }

                    if (mStaticTreeRoot == null)
                    {
                        mStaticTreeRoot = boxNode;
                    }
                    else
                    {
                        mStaticTreeRoot.InsertNodeIntoBVH(boxNode);
                    }
                    break;
                case PartitionCategories.Skybox:
                    mSkyboxRoot.AddChild(node);
                    break;
            }
        }