Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a custom body which have very random shape like a table. So how to add/combine multiple fixtures into a body?

share|improve this question
up vote 1 down vote accepted

You have to use physics editor and using that you have to generate xml file which contains the fixture and body information. Using parsing you have to create PolygonShape, create a new fixture and assign it to the body.

for (int l = 0; l < size; l++)
    vector2s[l] = vectorList.get(l);

PolygonShape polygonShape = new PolygonShape();
FixtureDef fixtureDef = new FixtureDef();
fixtureDef = PhysicsFactory.createFixtureDef(1, 0, 0.8f,
               false, Constants.CATEGORYBIT_BOMB,
                Constants.MASKBIT_BOMB, (short) 0);
fixtureDef.shape = polygonShape;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.