InstancedTileLoader

A Tile loader that manages caching and load order for instanced tiles. The cache is an LRU cache and is defined by the number of items it can hold. The actual number of cached items might grow beyond max if all items are in use. The load order is designed for optimal perceived loading speed (nearby tiles are refined first).

Constructor

new InstancedTileLoader(sceneopt, optionsopt)

Creates a tile loader with a maximum number of cached items and callbacks. The only required property is a renderer that will be used to visualize the tiles. The maxCachedItems property is the size of the cache in number of objects, mesh tile and tileset.json files. The mesh and point callbacks will be called for every incoming mesh or points.
Parameters:
NameTypeAttributesDescription
scenescene<optional>
a threejs scene.
optionsObject<optional>
Optional configuration object.
Properties
NameTypeAttributesDefaultDescription
maxCachedItemsnumber<optional>
100the cache size.
maxInstancesnumber<optional>
1the cache size.
meshCallbackfunction<optional>
A callback to call on newly decoded meshes.
pointsCallbackfunction<optional>
A callback to call on newly decoded points.
proxysring<optional>
An optional proxy that tile requests will be directed too as POST requests with the actual tile url in the body of the request.
ktx2LoaderKTX2Loader<optional>
A KTX2Loader (three/addons)
dracoLoaderDRACOLoader<optional>
A DRACOLoader (three/addons)
rendererrenderer<optional>
optional the renderer, this is required only for on the fly ktx2 support. not needed if you pass a ktx2Loader manually

Methods

get(abortController, path, uuid, instancedOGC3DTile, distanceFunction, getSiblings, level, sceneZupToYup, meshZupToYup, geometricError)

Schedules a tile content to be downloaded
Parameters:
NameTypeDescription
abortControllerAbortController
pathstringpath or url to tile content
uuidstring | Numbertile id
instancedOGC3DTileInstancedOGC3DTile
distanceFunctionfunction
getSiblingsfunction
levelNumber
sceneZupToYupBoolean
meshZupToYupBoolean
geometricErrorNumber

update()

To be called in the render loop or at regular intervals. launches tile downloading and loading in an orderly fashion.