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;
        interactionQuality?: "auto" | "off";
        onCameraChanged?: (state: CameraState) => void;
        onContextLost?: () => void;
        onContextRestored?: () => void;
        preserveDrawingBuffer?: boolean;
        scene: Scene;
    }
    Index

    Properties

    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.

    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.

    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.