public MeshOcTreeNode Insert(OTMeshTriangle item, int depth, int maxDepth, List <MeshOcTreeNode> nodeList) { if (depth < maxDepth) { MeshOcTreeNode node = GetContainerNode(item, nodeList); if (node != null) { return(node.Insert(item, depth + 1, maxDepth, nodeList)); } } m_ItemList.Add(item); return(this); }
/// <summary> /// 插入数据 /// </summary> /// <param name="item"></param> public void Add(OTMeshTriangle item) { if (m_NodeLists != null && m_NodeLists.Count > 0) { MeshOcTreeNode node = m_NodeLists[0].Insert(item, 0, maxDepth, m_NodeLists); if (node != null) { int index = m_NodeLists.IndexOf(node); if (index >= 0) { m_DataList.Add(item); m_NodeIndexList.Add(index); m_Count++; } } } }