API

Type Alias ViewerDetails

type ViewerDetails = {
    camera: ArcRotateCamera;
    isIdle: boolean;
    model: Nullable<Model>;
    scene: Scene;
    markSceneMutated(): void;
    pick(screenX: number, screenY: number): Promise<Nullable<PickingInfo>>;
    suspendRendering(): IDisposable;
}
Index
camera: ArcRotateCamera

Provides access to the Camera managed by the Viewer.

isIdle: boolean

True if the viewer's render loop is currently suspended (not actively rendering).

model: Nullable<Model>

Provides access to the currently loaded model.

scene: Scene

Provides access to the Scene managed by the Viewer.

  • Picks the object at the given screen coordinates.

    Parameters

    • screenX: number

      The x coordinate in screen space.

    • screenY: number

      The y coordinate in screen space.

    Returns Promise<Nullable<PickingInfo>>

    A PickingInfo if an object was picked, otherwise null.

    This function ensures skeletal and morph target animations are up to date before picking, and typically should not be called at high frequency (e.g. every frame, on pointer move, etc.).

  • Suspends the render loop.

    Returns IDisposable

    A token that should be disposed when the request for suspending rendering is no longer needed.