def.vertices.add(new Vec2(poly.xpoints[i], poly.ypoints[i]));
}
return def;
} else if (shape instanceof Ellipse2D) {
Ellipse2D ell = (Ellipse2D) shape;
CircleDef def = new CircleDef();
def.localPosition = new Vec2((float) ell.getCenterX(), (float) ell.getCenterY());
def.radius = (float) (ell.getWidth() / 2);
def.restitution = (float) elasticity;
return def;
}