Exemplo n.º 1
0
    public void CreateOctree()
    {
        octree = new OctTree <BoxObject>(new AABBBoundBox(-5000f * Vector3.one, 5000f * Vector3.one));
        for (int i = 0; i < collisionObjects.Count; i++)
        {
            octree.Insert(collisionObjects[i]);
        }
        octree.UpdateTree();
        int d = octree.GetMaxTreeDepth();

        Debug.Log(d + " " + Mathf.Pow(8, d) / (d - 1));
    }