Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...
    Index
    pickingSystem: PickingSystem | null = null
    materials: MaterialManager | null = null

    The host's material manager, or null for the LuxarApp's (see the module doc).

    • Run a node-creating call against the host's material manager.

      Type Parameters

      • T

      Parameters

      • fn: () => T

      Returns T

    • Invalidate the cached pick buffer (call after geometry updates). Also invalidates the picking system's world-AABB cache, since geometry changes can move the bounding box. (Camera-only motion does NOT need to invalidate boxes and reaches markDirty() via the controls 'change' event, not this method.)

      Parameters

      • drawn: boolean = true

        Whether any committed node was on screen (default true); forwarded on geometry-committed (emitted for the LuxarApp's factories only).

      Returns void

    • Retroactively register already-loaded scene nodes with the picking system.

      This — not the per-node factory — is the path production actually takes. The scene loads before picking is wired up (initPicking traverses the finished scene to decide whether any node declares labels, and only then constructs the PickingSystem and calls setPickingSystem), so at node-creation time this.pickingSystem is still null on a first load. A geometry type wired into createEmptyXNode but missing HERE is unpickable in every real scene, and appears to work only on a SECOND dataset load. Hence the table above rather than an else if chain: adding a geometry type is a compile error at one place instead of a branch someone forgets.

      Parameters

      • root: Object3D

      Returns void

    • Rebuild picking-system registrations after a WebGL context-restore event. The pick materials in pickingSystem.nodeMap were compiled against the now-dead WebGL context, so we drop the registrations (without disposing — see PickingSystem.clearRegistrationsForRebuild) and re-create them via registerExistingSceneNodes, which produces fresh pick materials against the new context.

      The last step of the restore sequence in scene/scene-manager/render-pipeline/webgl-context-recovery.ts (post-processing → materials → nodes): that module dispatches webgl-context-restored, whose subscriber (core/app/init/pipeline.ts, or LuxarLayer for a host renderer) calls this. The materials step, MaterialManager.rebuildAfterContextRestore, is a deliberate no-op — materials are per node, so the registrations rebuilt here are the per-context state that actually needs work.

      Also re-uploads geometry GPU buffers for every POOLED geometry type. A context loss zeroes the GPU-side storage — the element textures + aSortedIndex (gsplats, points, and lines alike since the lines texture-storage migration) — while the CPU mirror survives, so we mark everything full-dirty (empty ranges → three's full upload) and clear the append-fast-path flag gpuPrefixIntact (depth-sorting Phase 4 Stage 2). The flag is load-bearing: without it the next commit could take the append path and DOWNGRADE the pending full upload to a suffix-only partial, leaving the prefix stale. This runs unconditionally (picking may be disabled).

      Parameters

      • root: Object3D

      Returns void

    • Create an empty placeholder for a mesh node — a plain THREE.Mesh with an indexed BufferGeometry, not an instanced quad.

      attrs is the COMPOSED effective attrs and leafAttrs the node's RAW ones — the same two-bag arrangement the three siblings use, needed for exactly one decision: telling a leaf-authored colormap window from an inherited ancestor gain (resolveColormapWindow). The order is reversed from the siblings' because the raw bag is optional here, and it defaults to attrs, which is right whenever no ancestor authored a gain.

      Registers a pick node like the three siblings do, with its own pick material pair: mesh picking keys on gl_VertexID rather than an element-texture texel (spec §6.5), so it could not reuse theirs.

      Parameters

      Returns Mesh

    • Parameters

      • colors:
            | Uint8Array<ArrayBufferLike>
            | Float32Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>
      • nodeMetadata: Record<string, unknown> | null | undefined

      Returns void

    • Parameters

      • object: Object3D
      • transform: readonly number[]

      Returns void