Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...

    Interface AudioEngineDeps

    The pieces of the viewer the engine reads, as ports (see module docs).

    interface AudioEngineDeps {
        getCamera(): Object3D;
        onCameraReplaced(cb: () => void): Unsubscribe;
        getDims(): SimpleDims | null;
        onDimsChanged(cb: () => void): Unsubscribe;
        getSceneNodeIndex(): SceneNodeIndex | null;
        getSceneScale(): number;
        container(): HTMLElement;
        emit(
            event: "sound-ended" | "sound-started",
            payload: { name: string },
        ): void;
        notifyUiChanged(): void;
        resolveNodeCenter?(name: string): Vector3 | null;
    }
    Index
    • The loader's path index over the scene graph (SceneLoader.sceneNodeIndex), or null before a scene loads. Audibility reads each sound's world nd_transform from it in O(1); its root is the graph itself.

      Returns SceneNodeIndex | null

    • Scene characteristic size — the distance defaults derive from it.

      Returns number

    • Parameters

      • event: "sound-ended" | "sound-started"
      • payload: { name: string }

      Returns void

    • World-space bounding-box centre of the scene node called name, or null when it is unknown or not loaded yet — what attach_to sources follow.

      Parameters

      • name: string

      Returns Vector3 | null