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

destroyed: boolean = false

True if this ViewObject has been destroyed.

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.

view: View

The View to which this ViewObject belongs.

viewTransform: ViewTransform

The ViewTransform that defines the local transform of this ViewObject, if any.

Accessors

  • get colorize(): Vec3

    Gets the RGB colorize color for this ViewObject, if set.

    • Multiplies by rendered fragment colors.
    • Each element of the color is in range [0..1].
    • Use ViewLayer.setObjectsColorized to batch-update the colorized state of ViewObjects.

    Returns Vec3

  • set colorize(value: Vec3): void

    Sets the RGB colorize color for this ViewObject.

    • Multiplies by rendered fragment colors.
    • Each element of the color is in range [0..1].
    • Set to null or undefined to reset the colorize color to its default value of [1,1,1].
    • Use ViewLayer.setObjectsColorized to batch-update the colorized state of ViewObjects.

    Parameters

    • value: Vec3

    Returns void

  • 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