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); } } }
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); } } }
m_debugDraw.drawPolygon(vertices, vertexCount, color); } else { m_debugDraw.drawSolidPolygon(vertices, vertexCount, color);
vs[2].set(aabb.upperBound.x, aabb.upperBound.y); vs[3].set(aabb.lowerBound.x, aabb.upperBound.y); m_debugDraw.drawPolygon(vs, 4, color);
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); } } }
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); } } }
void DrawFixture(Fixture fixture) { Color3f color = new Color3f(0.95f, 0.95f, 0.6f); final Transform xf = fixture.getBody().getTransform(); switch (fixture.getType()) { case CIRCLE: { CircleShape circle = (CircleShape) fixture.getShape(); Vec2 center = Transform.mul(xf, circle.m_p); float radius = circle.m_radius; debugDraw.drawCircle(center, radius, color); } break; case POLYGON: { PolygonShape poly = (PolygonShape) fixture.getShape(); int vertexCount = poly.m_count; assert (vertexCount <= Settings.maxPolygonVertices); Vec2 vertices[] = new Vec2[Settings.maxPolygonVertices]; for (int i = 0; i < vertexCount; ++i) { vertices[i] = Transform.mul(xf, poly.m_vertices[i]); } debugDraw.drawPolygon(vertices, vertexCount, color); } break; default: break; } }
Transform.mulToOutUnsafe(m_transformA, m_polygonA.m_vertices[i], v[i]); getDebugDraw().drawPolygon(v, m_polygonA.m_count, color); getDebugDraw().drawPolygon(v, m_polygonB.m_count, color);
@Override public synchronized void step(TestbedSettings settings) { super.step(settings); shape.set(m_points, m_count); addTextLine("Press g to generate a new random convex hull"); getDebugDraw().drawPolygon(shape.m_vertices, shape.m_count, color); for (int i = 0; i < m_count; ++i) { getDebugDraw().drawPoint(m_points[i], 2.0f, color2); getDebugDraw().drawString(m_points[i].add(new Vec2(0.05f, 0.05f)), i + "", Color3f.WHITE); } assert (shape.validate()); if (m_auto) { generate(); } }
getDebugDraw().drawPolygon(vecs, 4, c); getDebugDraw().drawPolygon(vecs, 4, c);
m_debugDraw.drawPolygon(vertices, vertexCount, color); } else { m_debugDraw.drawSolidPolygon(vertices, vertexCount, color);
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); } }
public void drawTree(DebugDraw argDraw, DynamicTreeNode node, int spot, int height) { node.aabb.getVertices(drawVecs); Color color = Color.color(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); } } }
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); } } }
public void drawTree(DebugDraw argDraw, int node, int spot, int height) { AABB a = m_aabb[node]; a.getVertices(drawVecs); Color color = Color.color(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); } } }
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); } } }
vs[2].set(aabb.upperBound.x, aabb.upperBound.y); vs[3].set(aabb.lowerBound.x, aabb.upperBound.y); m_debugDraw.drawPolygon(vs, 4, color);
void DrawFixture(Fixture fixture) { Color3f color = new Color3f(0.95f, 0.95f, 0.6f); final Transform xf = fixture.getBody().getTransform(); switch (fixture.getType()) { case CIRCLE: { CircleShape circle = (CircleShape) fixture.getShape(); Vec2 center = Transform.mul(xf, circle.m_p); float radius = circle.m_radius; debugDraw.drawCircle(center, radius, color); } break; case POLYGON: { PolygonShape poly = (PolygonShape) fixture.getShape(); int vertexCount = poly.m_count; assert (vertexCount <= Settings.maxPolygonVertices); Vec2 vertices[] = new Vec2[Settings.maxPolygonVertices]; for (int i = 0; i < vertexCount; ++i) { vertices[i] = Transform.mul(xf, poly.m_vertices[i]); } debugDraw.drawPolygon(vertices, vertexCount, color); } break; default: break; } }
@Override public synchronized void step(TestbedSettings settings) { super.step(settings); shape.set(m_points, count); addTextLine("Press g to generate a new random convex hull"); getDebugDraw().drawPolygon(shape.m_vertices, shape.m_count, color); for (int i = 0; i < count; ++i) { getDebugDraw().drawPoint(m_points[i], 2.0f, color2); getDebugDraw().drawString(m_points[i].add(new Vec2(0.05f, 0.05f)), i + "", Color3f.WHITE); } assert (shape.validate()); if (m_auto) { generate(); } }
Transform.mulToOutUnsafe(m_transformA, m_polygonA.m_vertices[i], v[i]); getDebugDraw().drawPolygon(v, m_polygonA.m_count, color); getDebugDraw().drawPolygon(v, m_polygonB.m_count, color);