ThreePipe
    Preparing search index...

    Class Object3DWidgetsPlugin

    Automatically creates and manages helper widgets for lights, cameras, lines, and skeletons. Lights and cameras get a round icon that keeps its size in pixels and is drawn on top (showIcons, iconSize, iconMode); a click on it selects the light or the camera. Each kind of light and camera has its own colour for its icon and lines (widgetKinds). The widgets are not tone mapped (toneMapped: false): their pixels write only their GBuffer flags, so the plugin depends on GBufferPlugin and adds it to the viewer. Without the GBuffer flags, the tone mapping applies to all pixels. Custom widget types can be registered via the helpers array. See https://threepipe.org/notes/widgets-and-helpers for the full widget system documentation.

    Hierarchy (View Summary)

    Index
    _dirty: boolean = false
    _viewer?: ThreeViewer
    _viewerListeners: PartialRecord<IViewerEventTypes, (e: IViewerEvent) => void> = ...
    constructor: typeof AViewerPluginSync & typeof AViewerPlugin
    dependencies: typeof GBufferPlugin[] = ...

    The GBuffer flags keep the colours of the widgets out of the tone mapping (see the class docs)

    enabled: boolean = true
    helpers: IObject3DHelper<IWidget>[] = ...
    iconMode: WidgetIconMode = 'dom'

    How the icons of lights and cameras are drawn. Changing it switches all icons at once.

    • dom (default): SVG elements in a layer over the canvas (WidgetIconOverlay). Sharp at any pixel ratio, and never in a render, screenshot or recording of the canvas. Not seen in WebXR; without a viewer container in a page (an offscreen canvas) the icons are sprites.
    • sprite: quads in the scene that face the camera (WidgetIcon), drawn at about one texel per device pixel. Seen in WebXR and with an offscreen canvas, and part of a render or screenshot of the canvas.
    iconSize: number = 22

    The diameter of the icons of lights and cameras, in CSS pixels

    inSceneRoot: boolean = false
    isViewerPluginSync: true = ...
    showIcons: boolean = true

    Show the icons of lights and cameras

    showShadowFrustum: boolean = false

    Draw the frustum of the shadow camera of directional and spot lights that cast shadows

    toJSON: any = null
    uiConfig: UiObjectConfig = ...
    widgets: IWidget[] = []
    OldPluginType?: string
    PluginType: "Object3DWidgetsPlugin" = 'Object3DWidgetsPlugin'