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/viewing/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 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 opacityUpdated(): boolean

    true when the ViewObject's opacity is currently overriding the underlying SceneMesh material's alpha — i.e. the caller has set opacity to a value (any number, including 1). Cleared when the caller passes null / undefined to the setter, returning the renderer to the material's native alpha.

    The renderer's mesh-batch state-update bridge reads this flag to distinguish "user wants opacity = 1" (override on, alpha forced to 1.0, naturally-transparent meshes routed through the opaque bin) from "user has cleared the opacity override" (read material alpha — typically how a 4D scheduler returns finished objects to their native appearance).

    Returns boolean