Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...
    Index
    renderingControls?: RenderingControlsHandle
    savedCanvasStyle: string | null = null

    The canvas style attribute as it was just before we entered fullscreen, so exiting restores exactly what the embedder authored (e.g. width:100%;height:100% inside their container) instead of wiping every inline style. null when not in fullscreen.

    sceneManager: SceneManager
    animationController: AnimationController
    • Register the three window/document listeners and append the unregistration thunks to cleanups. Returns nothing — the cleanups array is the caller's source of truth.

      Parameters

      • cleanups: (() => void)[]

      Returns void

    • Handle fullscreen enter/exit. While in fullscreen, force the canvas to fill the viewport via inline styles; on exit, drop the style attribute entirely.

      The single rAF after the style change is intentional: modern browsers fire fullscreenchange after the viewport transition completes, so one frame is enough to capture final dimensions before calling updateSize().

      Returns void

    • Handle mouse-wheel events. Orbit/ortho controls own the actual zoom math (they listen for wheel on the canvas separately). All we do here is:

      • For canvas-originated events, poke the animation loop so the scene keeps rendering during continuous wheel input.
      • On Ctrl+wheel / Cmd+wheel, suppress page zoom across the viewer container, but apply FOV control only to canvas-originated events. The FOV wheel path is gated to a perspective camera: in ortho the orbit controls own modifier-wheel (and trackpad-pinch) zoom. updateFOV now persists the perspective FOV stash even in ortho for DELIBERATE reset/zarr/panel applies, so the interactive wheel must be gated here or a pinch would corrupt that stash. The delta handed to updateFOV is normalized to pixel-mode equivalent (normalizeWheelDelta), which puts a line-mode browser's notch in the same ballpark as a pixel-mode one — 2.4 vs 5.0 degrees, instead of 0.15 vs 5.0 before. When the FOV actually changed, switch the rendering-controls preset to "Custom" so the panel value matches the slider.

      Parameters

      • event: WheelEvent

      Returns void