G-code Preview — API Reference
    Preparing search index...
    interface InteractiveStageOptions {
        cameraMode?: CameraMode;
        canvas: RenderTargetCanvas;
        createControls?: (
            camera: PerspectiveCamera | OrthographicCamera,
            domElement: HTMLElement,
        ) => ControlsLike;
        createRenderer?: (canvas: RenderTargetCanvas) => GLRendererLike;
        displayEnv?: DisplayEnv;
        interactionQuality?: "auto" | "off";
        onCameraChanged?: (state: CameraState) => void;
        onContextLost?: () => void;
        onContextRestored?: () => void;
        onInteractionStart?: () => void;
        pixelRatio?: PixelRatioOption;
        preserveDrawingBuffer?: boolean;
        scene: Scene;
    }
    Index
    cameraMode?: CameraMode
    createControls?: (
        camera: PerspectiveCamera | OrthographicCamera,
        domElement: HTMLElement,
    ) => ControlsLike

    Injectable controls (tests). Default: three OrbitControls; skipped on a non-DOM canvas.

    createRenderer?: (canvas: RenderTargetCanvas) => GLRendererLike

    Injectable GL (tests / exotic hosts). Default: the shared stage builder.

    displayEnv?: DisplayEnv

    Injectable display for 'device' (tests). Default: globalThis (the window in a browser).

    interactionQuality?: "auto" | "off"

    DD-020 interaction-aware quality; default 'off'.

    onCameraChanged?: (state: CameraState) => void

    Emitted once per gesture after the camera settles, with the new pose (#275/M6).

    onContextLost?: () => void

    WebGL context lost — the owner should treat GPU resources as gone.

    onContextRestored?: () => void

    WebGL context restored — the owner rebuilds its scene content here.

    onInteractionStart?: () => void

    Emitted when the USER moves the camera (orbit/zoom/pan by pointer, wheel, touch, or keyboard) — on each such camera change, never for the stage's own programmatic moves, and not for a bare click that leaves the camera where it was.

    pixelRatio?: PixelRatioOption

    Resting pixel ratio: a number in (0, 4], or 'device' (the display's DPR capped at 2, followed live). Unset, the renderer keeps its own ratio. Throws RangeError otherwise, before any GL work.

    preserveDrawingBuffer?: boolean

    Preserve the drawing buffer so the canvas is readable after a render (headless still).

    scene: Scene

    The scene the stage renders. The owner creates it, adds content/lights, and rebuilds it on restore.