Package com.threerings.miso.util

Examples of com.threerings.miso.util.ObjectSet


        // 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();
    }
View Full Code Here

TOP

Related Classes of com.threerings.miso.util.ObjectSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.