我用这两个身体连接。球员身体和他的脚身。但是脚身不跟随球员身体。?
final FixtureDef fixtureDef = PhysicsFactory.createFixtureDef(0, 0, 0.1f);
this.body = PhysicsFactory.createBoxBody(this.mPhysicsWorld, this, BodyType.DynamicBody, fixtureDef);
this.body.setUserData("player");
this.body.setFixedRotation(true);
this.mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(this, this.body, true, true));
this.setCurrentTileIndex(8); //Başlangıç resmi
this.foot = new Rectangle(this.getX()-20, this.getY(), 10, 50);
final FixtureDef footFixtureDef = PhysicsFactory.createFixtureDef(0, 0, 0, true);
footFixtureDef.isSensor = true;
this.footBody=PhysicsFactory.createBoxBody(this.mPhysicsWorld, this.foot, BodyType.DynamicBody, footFixtureDef);
this.footBody.setUserData("foot");
this.foot.setColor(0.9f, 0.3f, 0.6f);
this.mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(this.foot, this.footBody, true, true));
final WeldJointDef joint = new WeldJointDef();
joint.initialize(this.body, this.footBody, this.body.getWorldCenter());
this.mPhysicsWorld.createJoint(joint);