示例#1
0
        /// <summary>
        /// Unload the elements used in the <c>OcTree</c>.
        /// </summary>
        public void Unload()
        {
            Stack <OcTreeNode> auxStack = new Stack <OcTreeNode>();

            auxStack.Push(RootNode);

            while (auxStack.Count != 0)
            {
                OcTreeNode node = auxStack.Pop();

                if (node.ChildList.Count == 0)
                {
                    node.Unload();
                }
                else
                {
                    for (int i = node.ChildList.Count - 1; i >= 0; i--)
                    {
                        auxStack.Push(node.ChildList[i]);
                    }
                }
            }

            _cubeVertexBuffer.Dispose();
            _cubeIndexBuffer.Dispose();
        }