Example #1
0
        /// <summary>
        /// 获取或修改子结点
        /// </summary>
        /// <param name="direction"></param>
        /// <returns></returns>
        public QuadNode this[QuadNodeDirection direction]
        {
            get
            {
                if (IsLeaf)
                {
                    return(null);
                }
                return(ChildNodes[(int)direction - 1]);
            }
            internal set
            {
                ChildNodes[(int)direction - 1] = value;

                if (value != null)
                {
                    value.ParentNode = this;
                }
            }
        }
Example #2
0
 /// <summary>
 /// 设置结点中的数据,为了节省内存已创建的结点将会使用缓存池循环使用
 /// </summary>
 /// <param name="depth"></param>
 /// <param name="direction"></param>
 /// <param name="bounds"></param>
 internal void SetData(int depth, QuadNodeDirection direction, AABB2D bounds)
 {
     Depth     = depth;
     Bounds    = bounds;
     Direction = direction;
 }