示例#1
0
        public void drawTree(DebugDraw argDraw, DynamicTreeNode node, int spot, int height)
        {
            node.aabb.getVertices(drawVecs);

            color.set(1, (height - spot)*1f/height, (height - spot)*1f/height);
            argDraw.drawPolygon(drawVecs, 4, color);

            argDraw.getViewportTranform().getWorldToScreen(node.aabb.upperBound, textVec);
            argDraw.drawString(textVec.x, textVec.y, node.id + "-" + (spot + 1) + "/" + height, color);

            if (node.child1 != null)
            {
                drawTree(argDraw, node.child1, spot + 1, height);
            }
            if (node.child2 != null)
            {
                drawTree(argDraw, node.child2, spot + 1, height);
            }
        }
示例#2
0
        public void drawTree(DebugDraw argDraw, int node, int spot, int height)
        {
            AABB a = m_aabb[node];
            a.getVertices(drawVecs);

            color.set(1, (height - spot)*1f/height, (height - spot)*1f/height);
            argDraw.drawPolygon(drawVecs, 4, color);

            argDraw.getViewportTranform().getWorldToScreen(a.upperBound, textVec);
            argDraw.drawString(textVec.x, textVec.y, node + "-" + (spot + 1) + "/" + height, color);

            int c1 = m_child1[node];
            int c2 = m_child2[node];
            if (c1 != NULL_NODE)
            {
                drawTree(argDraw, c1, spot + 1, height);
            }
            if (c2 != NULL_NODE)
            {
                drawTree(argDraw, c2, spot + 1, height);
            }
        }