private void DrawFixture(Fixture fixture) { var color = Color.FromArgb(242, 242, 153); var xf = fixture.Body.GetTransform(); switch (fixture.Shape) { case CircleShape circle: { var center = MathUtils.Mul(xf, circle.Position); var radius = circle.Radius + 0.01f; _drawer.DrawCircle(center, radius, color); } break; case PolygonShape polygonShape: { var vertexCount = polygonShape.Count; Debug.Assert(vertexCount <= Settings.MaxPolygonVertices); var vertices = new Vector2[Settings.MaxPolygonVertices]; for (var i = 0; i < vertexCount; ++i) { var v = MathUtils.Mul(xf, polygonShape.Vertices[i]); v.X += 0.01f; v.Y += 0.01f; vertices[i] = v; } _drawer.DrawPolygon(vertices, vertexCount, color); } break; } }
public void Draw(IDrawer drawer) { drawer.DrawCircle(this); }
public override void Draw(IDrawer drawer) { drawer.DrawCircle(X, Y, Radius, Type); }