public void writeRegionKeys(DS.CacheWriter cw, BoundingBox bb) { JSONObject json = new JSONObject(); JSONArray jarray = new JSONArray(); json.put("keys", jarray); for (Map.Entry<BoundingBox, List<Pair<BoundingBox, Key>>> entry : boxList.entrySet()) { if (bb.isIntersecting(entry.getKey())) { for (Pair<BoundingBox, Key> pair : entry.getValue()) { if (bb.isIntersecting(pair.getFirst())) { jarray.put(KeyFactory.keyToString(pair.getSecond())); } } } } for (Pair<GeoPt, Key> pair : locationList) { if (bb.isInside(pair.getFirst())) { jarray.put(KeyFactory.keyToString(pair.getSecond())); } } if (firstPlacemarkKey != null && bb.isIntersecting(placemarkBoundingBox)) { jarray.put(KeyFactory.keyToString(firstPlacemarkKey)); } json.write(cw); cw.cache(); }
public boolean hitsBB(Vec2 pointInViewSpace) { Vec2 v = new Vec2(pointInViewSpace); transform.getViewToLocalMatrix().transform(v); return boundingBox.isInside(v); }