protected void recomputeVisible ( ) { // flush our visible object set which we'll recreate later _vizobjs . clear ( ) ; Rectangle vbounds = new Rectangle ( _vbounds . x - _metrics . tilewid , _vbounds . y - _metrics . tilehei , _vbounds . width + 2 * _metrics . tilewid , _vbounds . height + 2 * _metrics . tilehei ) ; for ( SceneBlock block : _blocks . values ( ) ) { if ( ! block . isResolved ( ) ) { continue ; } // links this block to its neighbors; computes coverage block . update ( _blocks ) ; // see which of this block's objects are visible SceneObject [ ] objs = block . getObjects ( ) ; for ( SceneObject obj : objs ) { if ( obj . bounds != null && vbounds . intersects ( obj . bounds ) ) { _vizobjs . add ( obj ) ; } } } // recompute our object indicators computeIndicators ( ) ; // Log.info("Computed " + _vizobjs.size() + " visible objects from " + // _blocks.size() + " blocks."); // Log.info(StringUtil.listToString(_vizobjs, new StringUtil.Formatter() { // public String toString (Object object) { // SceneObject scobj = (SceneObject)object; // return (TileUtil.getTileSetId(scobj.info.tileId) + ":" + // TileUtil.getTileIndex(scobj.info.tileId)); // } // })); }
Recomputes our set of visible objects and their indicators .