InstancedOGC3DTile

Similarly to OGC3DTile, this class that extends THREE.Object3D loads a tiled and multileveled OGC3DTiles 1.0 or 1.1 dataset. The difference is that tiles are instanced. This is useful when one wants to load the same tileset hundreds or even thousands of times. Imagine rendering hundreds of very high detail cars driving in a city. Each tile content is instanced but each InstancedOGC3DTile object also has it's own LOD tree making this scenario very efficient.

Constructor

new InstancedOGC3DTile(propertiesopt)

Parameters:
NameTypeAttributesDescription
propertiesObject<optional>
the properties for this tileset
Properties
NameTypeAttributesDefaultDescription
urlObject<optional>
the url to the parent tileset.json
pathParamsObject<optional>
optional, path params to add to individual tile urls (starts with "?").
geometricErrorMultiplierObject<optional>
the geometric error of the parent. 1.0 by default corresponds to a maxScreenSpaceError of 16
loadOutsideViewObject<optional>
if truthy, tiles otside the camera frustum will be loaded with the least possible amount of detail
tileLoaderObject<optional>
A tile loader that can be shared among tilesets in order to share a common cache.
pointsCallbackObject<optional>
A callback function that will be called on every points
onLoadCallbackObject<optional>
A callback function that will be called when the root tile has been loaded
occlusionCullingServiceObject<optional>
A service that handles occlusion culling
centerModelObject<optional>
If true, the tileset will be centered on 0,0,0 and in the case of georeferenced tilesets that use the "region" bounding volume, it will also be rotated so that the up axis matched the world y axis.
staticObject<optional>
If true, the tileset is considered static which improves performance but the tileset cannot be moved
rootPathObject<optional>
optional the root path for fetching children
jsonObject<optional>
optional json object representing the tileset sub-tree
parentGeometricErrorObject<optional>
optional geometric error of the parent
parentBoundingVolumeObject<optional>
optional bounding volume of the parent
parentRefinementObject<optional>
optional refinement strategy of the parent of the parent
cameraOnLoadObject<optional>
optional the camera used when loading this particular sub-tile
parentTileObject<optional>
optional the OGC3DTile object that loaded this tile as a child
domWidthNumber<optional>
1000optional the canvas width (used to calculate geometric error). If a renderer is provided, it'll be used instead, else a default value is used.
domHeightNumber<optional>
1000optional the canvas height (used to calculate geometric error). If a renderer is provided, it'll be used instead, else a default value is used.
rendererObject<optional>
optional the renderer is used to infer the canvas size and compute tiles geometric error.
distanceBiasNumber<optional>
optional a bias that allows loading more or less detail closer to the camera relative to far away. The value should be a positive number. A value below 1 loads less detail near the camera and a value above 1 loads more detail near the camera. This needs to be compensated by the geometricErrorMultiplier in order to load a reasonable number of tiles.

Methods

setCanvasSize(width, height)

Call this to specify the canvas width/height when it changes (used to compute tiles geometric error that controls tile refinement). It's unnecessary to call this when the OGC3DTile is instantiated with the renderer.
Parameters:
NameTypeDescription
widthNumber
heightNumber

setGeometricErrorMultiplier(geometricErrorMultiplier)

Set the Geometric Error Multiplier for the tileset. the {@param geometricErrorMultiplier} can be a number between 1 and infinity. A {@param geometricErrorMultiplier} of 1 (default) corresponds to a max ScreenSpace error (MSE) of 16. A lower {@param geometricErrorMultiplier} loads less detail (higher MSE) and a higher {@param geometricErrorMultiplier} loads more detail (lower MSE)
Parameters:
NameTypeDescription
geometricErrorMultiplierNumberset the LOD multiplier for the entire tileset

update(camera)

To be called in the render loop.
Parameters:
NameTypeDescription
cameraThree.Cameraa camera that the tileset will be rendered with.