DrawPolygon() public method

Draw a closed polygon provided in CCW order. This implementation uses {@link #drawSegment(Vec2, Vec2, Color3f)} to draw each side of the polygon.
public DrawPolygon ( Vec2 vertices, int vertexCount, Color3f color ) : void
vertices Box2D.Common.Vec2
vertexCount int
color Box2D.Common.Color3f
return void
Beispiel #1
0
        public void DrawTree(DebugDraw argDraw, int nodeId, int spot, int height)
        {
            TreeNode node = m_nodes[nodeId];
            node.AABB.GetVertices(drawVecs);

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

            argDraw.ViewportTranform.GetWorldToScreen(node.AABB.UpperBound, textVec);
            argDraw.DrawString(textVec.X, textVec.Y, nodeId + "-" + (spot + 1) + "/" + height, color);

            if (node.Child1 != TreeNode.NULL_NODE)
            {
                DrawTree(argDraw, node.Child1, spot + 1, height);
            }
            if (node.Child2 != TreeNode.NULL_NODE)
            {
                DrawTree(argDraw, node.Child2, spot + 1, height);
            }
        }