An object within a View.

Every View automatically maintains within itself a ViewObject for each SceneObject that exists in the Viewer.

Whenever we create a SceneObject, each View will automatically create a corresponding ViewObject within itself. When we destroy a SceneObject, each View will automatically destroy its corresponding ViewObject. The ViewObjects in a View are therefore a manifest of the ViewerObjects in the View.

See @xeokit/sdk/viewer for usage.

Properties

id: string

Unique ID of this ViewObject within ViewLayer.objects.

layer: ViewLayer

The ViewLayer to which this ViewObject belongs.

originalSystemId: string

ID of this ViewObject within the originating system.

sceneObject: SceneObject

The corresponding scene!SceneObject.

Accessors

  • get opacity(): number
  • Gets the opacity factor for this ViewObject.

    • This is a factor in range [0..1] which multiplies by the rendered fragment alphas.
    • Use ViewLayer.setObjectsOpacity to batch-update the opacities of ViewObjects.

    Returns number

  • set opacity(opacity: number): void
  • Sets the opacity factor for this ViewObject.

    • This is a factor in range [0..1] which multiplies by the rendered fragment alphas.
    • Set to null or undefined to reset the opacity to its default value of 1.
    • Use ViewLayer.setObjectsOpacity to batch-update the opacities of ViewObjects.

    Parameters

    • opacity: number

    Returns void