Open
Description
hi ~ Think you and thank your code. I am learning quadtree. I have some questions.
-
In the DemoScript.Update()
`
// refresh QuadTree each frame if bodies can move_quadTree.Clear(); foreach(var b in _quadTreeBodies) { _quadTree.AddBody(b); }
`
I understand that there is rebuild QuadTree in per frame. I know do it because bodies is moving in per frame. I think maybe there is a way that deal it without rebuild QuadTree. But I do not know. So I ask you.
2 . In the QuadTree's 2nd Constructors function
`
private QuadTree(Rect bounds, QuadTree parent)
: this(bounds, parent._maxBodiesPerNode, parent._maxLevel)
{
_parent = parent;
_curLevel = parent._curLevel + 1;
}
`
why _maxLevel is parent._maxLevel? I think _maxLevel = parent._maxLevel - 1
Metadata
Metadata
Assignees
Labels
No labels