/** * Remove an object from the world. * * @param object the object to remove */ public synchronized void removeObject(Actor object) { if (objects.remove(object)) { // we only want to remove it once. collisionChecker.removeObject(object); } object.setWorld(null); }
/** * Remove an object from the world. * * @param object the object to remove */ public void removeObject(Actor object) { if (object == null || object.world != this) { return; } objectsDisordered.remove(object); collisionChecker.removeObject(object); if (objectsDisordered != objectsInActOrder && objectsInActOrder != null) { objectsInActOrder.remove(object); } else if (objectsDisordered != objectsInPaintOrder && objectsInPaintOrder != null) { objectsInPaintOrder.remove(object); } object.setWorld(null); }