In my Box2D world, I have a ground and a Dynamic Object.
The ground is initially created as a box:
Vec2 gravity = new Vec2(0.0f, 10.0f);
world = new World(gravity);
world.setWarmStarting(true);
BodyDef groundBodyDef = new BodyDef();
groundBodyDef.type = BodyType.STATIC;
groundBodyDef.position.set(0, TOTAL_HEIGHT);
PolygonShape bottomShape = new PolygonShape();
bottomShape.setAsBox(TOTAL_WIDTH, GROUND_HEIGHT);
Body groundBody = world.createBody(groundBodyDef);
groundBody.createFixture(bottomShape, 0.0f);
I would like to add random holes in the ground:
Is it possible to remove
parts of the ground in order to make holes in it, or should I remove the existing ground and then add separate "grounds" according to the number of holes I have?