Creates a Entity3D with the specified parameters.
the unique identifier of this entity
the root Three.js of this entity
Private
_attachedPrivate
_clippingProtected
_distanceProtected
_instancePrivate
_object3dPrivate
_opacityPrivate
_renderPrivate
_visibleReadonly
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.
The name of the type of this object.
The layers attached to this entity.
Gets 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.
Entity3D#clippingPlanes-property-changed
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.
Gets whether this entity is currently loading data.
Returns the root object of this entity.
Gets or sets the opacity of this entity.
Entity3D#opacity-property-changed
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.
Entity3D#renderOrder-property-changed
Gets or sets the visibility of this entity. A non-visible entity will not be automatically updated.
Entity3D#visible-property-changed
Adds a listener to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Fire an event type.
The event that gets fired.
Disposes 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.
Get all the layers attached to this object.
Optional filter function for attached layers
the layers attached to this object
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.
Checks if listener is added to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Applies 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);
Picks objects given a position and a radius from the layer.
The x/y position in the layer
Optional
options: anyOptional properties. See Instance.pickObjectsAt
Optional
target: anyTarget array to fill
Picked objects (node)
Method called after update().
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 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.
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.
Removes a listener from an event type.
The type of the listener that gets removed.
The listener function that gets removed.
Traverses 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.
Generated using TypeDoc
Base class for entities that display 3D objects.
Subclasses must call
onObjectCreated
when creating new Object3D, before adding them to the scene