drawTreeX method

void drawTreeX (DebugDraw argDraw, int node, int spot, int height)

Implementation

void drawTreeX(DebugDraw argDraw, int node, int spot, int height) {
  AABB a = _aabb[node];
  a.getVertices(drawVecs);

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

  argDraw.getViewportTranform().getWorldToScreen(a.upperBound, _textVec);
  argDraw.drawStringXY(
      _textVec.x, _textVec.y, "$node-${(spot + 1)}/$height", _color);

  int c1 = _child1[node];
  int c2 = _child2[node];
  if (c1 != NULL_NODE) {
    drawTreeX(argDraw, c1, spot + 1, height);
  }
  if (c2 != NULL_NODE) {
    drawTreeX(argDraw, c2, spot + 1, height);
  }
}