DynamicTree constructor

DynamicTree()

Implementation

DynamicTree() {
  // Build a linked list for the free list.
  for (int i = _nodeCapacity - 1; i >= 0; i--) {
    _nodes[i] = DynamicTreeNode(i);
    _nodes[i].parent = (i == _nodeCapacity - 1) ? null : _nodes[i + 1];
    _nodes[i].height = -1;
  }

  for (int i = 0; i < drawVecs.length; i++) {
    drawVecs[i] = Vector2.zero();
  }
}