public void remove(LBody body) { ArrayList shapes = body.getLShape().getBox2DFixtures(); for (int i = 0; i < shapes.size(); i++) { this.shapeMap.remove(shapes.get(i)); } body.removeFromWorld(this); this.bodies.remove(body); }
public void add(LBody body) { body.addToWorld(this); ArrayList<FixtureDef> shapes = body.getLShape().getBox2DFixtures(); for (int i = 0; i < shapes.size(); i++) { this.shapeMap.put(shapes.get(i), body); } this.bodies.add(body); }