// our intersection rect, any object that is *so* large that its
// origin falls outside of this rectangle but that still
// intersects this rectangle can go to hell; it's either this or
// we iterate over every object in the whole goddamned scene which
// is so hairily inefficient i can't even bear to contemplate it
ObjectSet objs = new ObjectSet();
Rectangle orect = new Rectangle(rect);
orect.grow(MAX_OBJECT_SIZE, MAX_OBJECT_SIZE);
StageMisoSceneModel mmodel = StageMisoSceneModel.getSceneModel(model);
mmodel.getObjects(orect, objs);
// now prune from this set any and all objects that don't actually
// overlap the specified rectangle
Rectangle foot = new Rectangle();
for (int ii = 0; ii < objs.size(); ii++) {
ObjectInfo info = objs.get(ii);
if (getObjectFootprint(tmgr, info.tileId, info.x, info.y, foot)) {
if (!foot.intersects(rect)) {
objs.remove(ii--);
}
} else {
log.warning("Unknown potentially intersecting object?! " +
"[scene=" + model.name + " (" + model.sceneId +
"), info=" + info + "].");
}
}
return objs.toArray();
}