drawTreeX method

void drawTreeX(
  1. DebugDraw argDraw,
  2. DynamicTreeNode node,
  3. int spot,
  4. int height
)

Implementation

void drawTreeX(
    DebugDraw argDraw, DynamicTreeNode node, int spot, int height) {
  node.aabb.getVertices(drawVecs);

  _color.setFromRGBd(
      1.0, (height - spot) * 1.0 / height, (height - spot) * 1.0 / height);
  argDraw.drawPolygon(drawVecs, 4, _color);

  Vector2 textVec =
      argDraw.getViewportTranform().getWorldToScreen(node.aabb.upperBound);
  argDraw.drawStringXY(
      textVec.x, textVec.y, "$node.id-${(spot + 1)}/$height", _color);

  if (node.child1 != null) {
    drawTreeX(argDraw, node.child1, spot + 1, height);
  }
  if (node.child2 != null) {
    drawTreeX(argDraw, node.child2, spot + 1, height);
  }
}