创建由Box2D的android系统中andengine圈?(Creating circle in

2019-09-16 15:58发布

我可以用于创建例如墙创建矩形:

    final Rectangle wall = new Rectangle(CAMERA_WIDTH-2, 0, 2, CAMERA_HEIGHT -2);
    PhysicsFactory.createBoxBody(this.physicsWorld, wall, BodyType.StaticBody, FIXTURE_DEF);
    scene.attachChild(wall);

但是,我想创建圈子? 例如ball.it应的Box2D的身体像以上。

Answer 1:

它实际上是非常简单的:

Body circleBody = PhysicsFactory.createCircleBody(pWorld, pSprite, BodyType.StaticBody, FixtureDef);


文章来源: Creating circle in android andengine by box2d?