Class Tiles3D<TMaterial, UserData>

A 3D Tiles dataset.

Type Parameters

Hierarchy (view full)

Implements

Constructors

Properties

_distance: {
    max: number;
    min: number;
}
cleanupDelay: number

The delay, in milliseconds, to cleanup unused objects.

hasLayers: true = ...

Read-only flag to check if a given object is of type HasLayers.

id: string

The unique identifier of this entity.

imageSize: Vector2 = ...
isEntity: boolean = ...

Read-only flag to check if a given object is of type Entity.

isEntity3D: boolean = ...

Read-only flag to check if a given object is of type Entity3D.

isMemoryUsage: true = ...

Readonly flag to indicate that his object implements MemoryUsage.

isPickable = true
isTiles3D: true = ...

Read-only flag to check if a given object is of type Tiles3D.

material?: TMaterial

The material to use

name: undefined | string

The name of this entity.

sseThreshold: number

The Screen Space Error (SSE) threshold to use for this tileset.

type: "Tiles3D" = ...

The name of the type of this object.

userData: UserData

An object that can be used to store custom data about the Entity.

wireframe?: boolean

Accessors

  • get clippingPlanes(): null | Plane[]
  • 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.

    Returns null | Plane[]

  • set clippingPlanes(planes): void
  • Parameters

    Returns void

  • get distance(): {
        max: number;
        min: number;
    }
  • Returns {
        max: number;
        min: number;
    }

    • max: number
    • min: number
  • get frozen(): boolean
  • 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.

    Returns boolean

  • set frozen(v): void
  • Parameters

    • v: boolean

    Returns void

  • get layerCount(): number
  • Returns the number of layers currently in this object.

    Returns number

  • get loading(): boolean
  • Gets whether this entity is currently loading data.

    Returns boolean

  • get opacity(): number
  • Gets or sets the opacity of this entity.

    Returns number

  • set opacity(v): void
  • Parameters

    • v: number

    Returns void

  • get progress(): number
  • Gets the current loading progress (between 0 and 1). Note: This property is only meaningful if loading is true.

    Returns number

  • get ready(): boolean
  • Determine if this entity is ready to use.

    Returns boolean

  • get renderOrder(): number
  • Gets or sets the render order of this entity.

    Returns number

  • set renderOrder(v): void
  • Parameters

    • v: number

    Returns void

  • get visible(): boolean
  • Gets or sets the visibility of this entity. A non-visible entity will not be automatically updated.

    Returns boolean

  • set visible(v): void
  • Parameters

    • v: boolean

    Returns void

Methods

  • Adds a listener to an event type.

    Type Parameters

    • T extends
          | "initialized"
          | "frozen-property-changed"
          | "visible-property-changed"
          | "opacity-property-changed"
          | "clippingPlanes-property-changed"
          | "renderOrder-property-changed"
          | "object-created"

    Parameters

    Returns void

  • Type Parameters

    • T extends string

    Parameters

    Returns void

  • Test whether this entity contains the given object.

    The object may be a component of the entity, or a 3D object.

    Parameters

    • obj: unknown

      The object to test.

    Returns boolean

    true if the entity contains the object.

  • Fire an event type.

    Type Parameters

    • T extends
          | "initialized"
          | "frozen-property-changed"
          | "visible-property-changed"
          | "opacity-property-changed"
          | "clippingPlanes-property-changed"
          | "renderOrder-property-changed"
          | "object-created"

    Parameters

    Returns void

  • 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.

    Returns void

  • Parameters

    • metadata: ProcessedTile
    • Optionalrequester: Tile

    Returns Promise<Tile>

  • Checks if listener is added to an event type.

    Type Parameters

    • T extends
          | "initialized"
          | "frozen-property-changed"
          | "visible-property-changed"
          | "opacity-property-changed"
          | "clippingPlanes-property-changed"
          | "renderOrder-property-changed"
          | "object-created"

    Parameters

    Returns boolean

  • Type Parameters

    • T extends string

    Parameters

    Returns boolean

  • Returns true if this object belongs to this entity.

    Parameters

    • obj: unknown

      The object to test.

    Returns boolean

  • 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.

    Parameters

    Returns void

    // In the subclass
    const obj = new Object3D();

    // Notify the parent class
    this.onObjectCreated(obj);
  • Called when the rendering context has been lost.

    Parameters

    • options: {
          canvas: HTMLCanvasElement;
      }

      The options.

      • canvas: HTMLCanvasElement

    Returns void

  • 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.

    Returns Promise<void>

    A promise that resolves when the entity is ready to be used.

  • 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.

    Returns Tile[]

    the elements to update during update().

  • Removes a listener from an event type.

    Type Parameters

    • T extends
          | "initialized"
          | "frozen-property-changed"
          | "visible-property-changed"
          | "opacity-property-changed"
          | "clippingPlanes-property-changed"
          | "renderOrder-property-changed"
          | "object-created"

    Parameters

    Returns void

  • Type Parameters

    • T extends string

    Parameters

    Returns void

  • Calculate and set the material opacity, taking into account this entity opacity and the original opacity of the object.

    Parameters

    • material: Material

      a material belonging to an object of this entity

    Returns void

  • Applies entity-level setup on new object's material.

    Subclasses can override this to setup custom logic, for instance if the entity can produce objects that are naturally transparent.

    Parameters

    • material: Material

      the material of the newly created object

    Returns void

  • This 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.

    Returns boolean

    true if should check for update

  • Parameters

    • node: undefined | Tile

      The tile to evaluate;

    Returns boolean

    true if the request can continue, false if it must be cancelled.

  • 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);

    Parameters

    • updateSource: unknown

      Source of change

    Returns boolean

    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);

    Parameters

    • updateSource: unknown

      Source of change

    Returns boolean

    true if requires an update of updateSource

  • Performs an update on an element of the entity.

    Note: this method will be called for each element returned by preUpdate().

    Parameters

    • context: Context

      the update context. This is the same object that the entity whose update() is being called.

    • node: Tile

    Returns undefined | Tile[]

    New elements to update