Constructs a Tiles3D object.
The unique identifier of the entity.
The data source.
Optional properties.
Protected
_distanceProtected
_instanceThe delay, in milliseconds, to cleanup unused objects.
Readonly
hasRead-only flag to check if a given object is of type HasLayers.
Readonly
isRead-only flag to check if a given object is of type Entity.
Readonly
isRead-only flag to check if a given object is of type Entity3D.
Readonly
isReadonly
isRead-only flag to check if a given object is of type Tiles3D.
Optional
materialThe material to use
Optional
readyThe Screen Space Error (SSE) threshold to use for this tileset.
The name of the type of this object.
Readonly
userAn object that can be used to store custom data about the Entity.
Optional
whenOptional
wireframeGets or sets the clipping planes set on this entity. Default is null
(no clipping planes).
Note: custom entities must ensure that the materials and shaders used do support the clipping plane feature of three.js. Refer to the three.js documentation for more information.
Gets or sets the frozen status of this entity. A frozen entity is still visible but will not be updated automatically.
Useful for debugging purposes.
Gets the unique identifier of this entity.
Returns the number of layers currently in this object.
Gets whether this entity is currently loading data.
Network options of the source.
Deprecated.
Returns the root object of this entity.
Gets or sets the opacity of this entity.
Gets the current loading progress (between 0 and 1).
Note: This property is only meaningful if loading is true
.
Gets or sets the render order of this entity.
Gets or sets the visibility of this entity. A non-visible entity will not be automatically updated.
Protected
cleanup3dDisposes this entity and all resources associated with it.
The default implementation of this method does nothing. You should implement it in your custom entities to handle any special logic of disposal.
For example: disposing materials, geometries, stopping HTTP requests, etc.
Filters what objects need to be updated, based on updatedSources
.
The returned objects are then passed to preUpdate and postUpdate.
Inherited classes should override shouldFullUpdate and shouldUpdate if they need to change this behavior.
Sources that triggered an update
Set of objects to update
Applies the callback to each layer in the object.
Returns a new array containing the layers in this object. Optionally, the predicate can be used to filter out unwanted layers.
// Get all layers from the object.
const allLayers = obj.getLayers();
// Get all color layers from the object.
const colorLayers = obj.getLayers((layer) => layer.isColorLayer);
Optional
predicate: ((arg0) => boolean)Returns an approximation of the memory used by this object, in bytes.
The graphics context.
Optional
target: MemoryUsageReportIf specified, the values computed during this call must be added to the existing values in the target. Otherwise, a new report must be built.
The memory usage report. If target is specified, then this must be returned.
Attached layers expect to receive the visual representation of a layer (= THREE object with a material). So if a layer's update function don't process this kind of object, the layer must provide a getObjectToUpdateForAttachedLayers function that returns the correct object to update for attached layer from the objects returned by preUpdate.
the Mesh or the object containing a Mesh. These are the objects returned by preUpdate or update.
an object passed to the update function of attached layers.
Protected
isProtected
markProtected
onApplies entity-level setup on a new object.
Note: this method should be called from the subclassed entity to notify the parent class that a new 3D object has just been created, so that it can be setup with entity-wide parameters.
The object to prepare.
// In the subclass
const obj = new Object3D();
// Notify the parent class
this.onObjectCreated(obj);
Optional
options: PickOptionsMethod called after Entity.update.
the update context.
the objects that triggered an update step. This is useful to filter out unnecessary updates if no sources are relevant to this entity. For example, if one of the sources is a camera that moved during the previous frame, any entity that depends on the camera's field of view should be updated.
This method is called just before update()
to filter and select
which elements should be actually updated. For example, in the
case of complex entities made of a hierarchy of elements, the entire
hierarchy may not need to be updated.
Use this method to optimize the update step by reducing the number of elements to process.
Note: if this functions returns nothing, update()
will not be called.
the elements to update during update()
.
Asynchronously preprocess the entity. This method may be overriden to perform any operation that must be done before the entity can be used in the scene, such as fetching metadata about a dataset, etc.
A promise that resolves when the entity is ready to be used.
Protected
setProtected
setupThis method is called before update
to check if the MainLoop
should try to update this entity or not. For better performances,
it should return false
if the entity has no impact on the
rendering (e.g. the element is not visible).
The inherited child can completely ignore this value if it makes sense.
true
if should check for update
This method is called at the beginning of the update
step to determine
if we should do a full render of the object. This should be the case if, for
instance, the source is the camera.
You can override this depending on your needs. The inherited child should
not ignore this value, it should do a boolean OR, e.g.:
return super.shouldFullUpdate(updateSource) || this.contains(updateSource);
Source of change
true
if requires a full update of this object
This method is called at the beginning of the update
step to determine
if we should re-render updateSource
.
Not used when shouldFullUpdate
returns true
.
You can override this depending on your needs. The inherited child should
not ignore this value, it should do a boolean OR, e.g.:
return super.shouldUpdate(updateSource) || this.contains(updateSource);
Source of change
true
if requires an update of updateSource
Protected
subdivideProtected
subdivideProtected
subdivideProtected
subdivisionTraverses all objects in the hierarchy of this entity.
The callback.
The traversal root. If undefined, the traversal starts at the root object of this entity.
Traverses all materials in the hierarchy of this entity.
The callback.
The traversal root. If undefined, the traversal starts at the root object of this entity.
Traverses all meshes in the hierarchy of this entity.
The callback.
The raversal root. If undefined, the traversal starts at the root object of this entity.
Protected
unmark
A 3D Tiles dataset.