/*
* 检索功能:
* 给出一个物体对象,该函数负责将该物体可能发生碰撞的所有物体选取出来。该函数先查找物体所属的象限,该象限下的物体都是有可能发生碰撞的,然后再递归地查找子象限..
*/
public FastList <CollisionComponent> Retrieve(CollisionComponent coll)
{
listCache.Clear();
//Debug.Log("m_childListCount " + m_childListCount);
if (m_childListCount != 0)
{
bool[] indexList = GetRetrieveIndex(coll.area);
for (int i = 0; i < 4; i++)
{
if (indexList[i])
{
listCache.AddRange(m_childList[i].Retrieve(coll));
}
}
}
listCache.AddRange(m_objectList);
//Debug.Log("Retrieve " + listCache.Count + " depth " + m_depth);
return(listCache);
}