private void DrawShape(Fixture fixture, Transform xf, Color color)
{
Color coreColor = new Color(0.9f, 0.6f, 0.6f);
switch (fixture.GetType())
{
case ShapeType.CircleShape:
{
CircleShape circle = (CircleShape)fixture.GetShape();
Vec2 center = Math.Mul(xf, circle._p);
float radius = circle._radius;
Vec2 axis = xf.R.Col1;
_debugDraw.DrawSolidCircle(center, radius, axis, color);
}
break;
case ShapeType.PolygonShape:
{
PolygonShape poly = (PolygonShape)fixture.GetShape();
int vertexCount = poly.VertexCount;
Box2DXDebug.Assert(vertexCount <= Settings.MaxPolygonVertices);
Vec2[] vertices = new Vec2[Settings.MaxPolygonVertices];
for (int i = 0; i < vertexCount; ++i)
{
vertices[i] = Math.Mul(xf, poly.Vertices[i]);
}
_debugDraw.DrawSolidPolygon(vertices, vertexCount, color);
}
break;
}
}