Esempio n. 1
0
        // ----------------------------------------------------------------------------

        protected virtual void Awake()
        {
            m_octTree = new OctTree(null, m_bounds);

            if (m_statistics != null)
            {
                m_statistics.Initialise(m_octTree);
            }
        }
        // --------------------------------------------------------------------------------

        public void Initialise(OctTree octTree)
        {
            m_octTree = octTree;

            m_peakMigrants     = 0;
            m_currentMigrants  = 0;
            m_peakNodes        = 0;
            m_currentNodes     = 0;
            m_peakLeafNodes    = 0;
            m_currentLeafNodes = 0;
        }
Esempio n. 3
0
        // ----------------------------------------------------------------------------

        public int GetDepth()
        {
            int     depth   = 1;
            OctTree current = this;

            while (current != null)
            {
                ++depth;
                current = current.m_parent;
            }

            return(depth);
        }
Esempio n. 4
0
        // ----------------------------------------------------------------------------

        public OctTree(OctTree parent, AreaBounds bounds)
        {
            m_parent = parent;
            m_bounds = bounds;
        }