public void clearModels() {
		Map<Integer, Integer> toRemove = new HashMap<>();
		for (Integer id : models.keySet()) {
			for (ArModel model : models.get(id)) {
				if (model.isRendered()) {
					model.setRendered(false);
				} else {
					Integer count = toRemove.get(id);
					count = (count == null ? 1 : count + 1);
					toRemove.put(id, count);
				}
			}
		}
		for (Integer id : toRemove.keySet()) {
			for (int i = 0; i < toRemove.get(id); i++) {
				LinkedList<ArModel> mods = models.get(id);
				LinkedList<TransformGroup> tgs = transforms.get(id);
				LinkedList<BranchGroup> bgs = innerContents.get(id);
				if (!mods.isEmpty()) {
					ArModel mod = mods.removeLast();
					mod.setRendered(false);
				}
				if (!tgs.isEmpty()) {
					TransformGroup trans = tgs.removeLast();
					trans.removeAllChildren();
				}
				if (!bgs.isEmpty()) {
					BranchGroup bg = bgs.removeLast();
					scene.removeChild(bg);
				}
			}
		}
	}