Add Circle shape

(Anas Altair) #1

Box2d doesn’t support Ellipse body :sweat:, i am working with (libGdx & Box2D) and using this method to convert Ellipse shape to Circle shape :

private Shape getCircle(EllipseMapObject ellipseObject) {
		Ellipse ellipse = ellipseObject.getEllipse();
		float radius = ellipse.width * .5f;
		CircleShape circleShape = new CircleShape();
		circleShape.setPosition(new Vector2(ellipse.x + radius, ellipse.y + radius));
		return circleShape;

it is works fine ! but, it will be nice to add Circle Shape to Tiled Editor.
thank you.