*/
public static <R extends RenderableToPrimitiveTarget> void renderWorldObjects(
final Iterator<? extends Target<R>> targetIterator,
final MapData mapData, final int primitiveThresholdPerTarget) {
final StatisticsTarget primitiveCounter = new StatisticsTarget();
iterate(mapData.getMapElements(), new Operation<MapElement>() {
Target<R> currentTarget = targetIterator.next();
@Override public void perform(MapElement e) {
for (WorldObject r : e.getRepresentations()) {
renderObject(primitiveCounter, r);
renderObject(currentTarget, r);
if (primitiveCounter.getGlobalCount(PRIMITIVE_COUNT)
>= primitiveThresholdPerTarget) {
currentTarget = targetIterator.next();
primitiveCounter.clear();
}
}
}