Interface XGFViewStreamControllerParams

Parameters for XGFViewStreamController.

interface XGFViewStreamControllerParams {
    backpressure?: XGFViewStreamBackpressure;
    batchSize?: number;
    cacheFileData?: boolean;
    cameraDebounceMs?: number;
    chunkFilter?: (manifest: XGFChunkManifest) => boolean;
    chunkPriorityTarget?: XGFChunkPriorityTarget;
    commitFrameBudgetMs?: number;
    enableLRUEviction?: boolean;
    fetchConcurrency?: number;
    frustumDepthMultiplier?: number;
    frustumMinDepth?: number;
    frustumOnly?: boolean;
    getStreamIndex?: (
        stream: XGFSubstreamManifest,
        signal?: AbortSignal,
    ) => any;
    index: XGFStreamingIndex;
    loader?: XGFStreamingLoader;
    loadOptions?: XGFChunkLoadOptions;
    maxCachedFileBytes?: number;
    maxResidentChunks?: number;
    minProjectedChunkSizePixels?: number;
    onChunkLoaded?: (manifest: XGFChunkManifest) => void;
    onChunkLoadStats?: (stats: XGFChunkLoadStats) => void;
    onChunksLoading?: (manifests: XGFChunkManifest[]) => void;
    onError?: (error: unknown) => void;
    onProgress?: (progress: XGFViewStreamProgress) => void;
    onStatus?: (status: string) => void;
    progressCadenceMs?: number;
    sceneModel: SceneModel;
    streamIndexBaseURI?: string;
    unloadInactiveStreams?: boolean;
    view: View;
}

Properties

Optional loading backpressure gate checked between chunk commits.

batchSize?: number

Maximum number of chunks committed per scheduling batch.

cacheFileData?: boolean

When true, keeps resolved XGF file bytes in memory for reuse after chunk unload/reload.

cameraDebounceMs?: number

Debounce delay after schedule() before a streaming pass begins.

chunkFilter?: (manifest: XGFChunkManifest) => boolean

Optional filter for references-only chunks controlled by this instance.

chunkPriorityTarget?: XGFChunkPriorityTarget

Camera point used to prioritize nearer chunks. Defaults to "look".

commitFrameBudgetMs?: number

Approximate per-frame commit budget, in milliseconds.

enableLRUEviction?: boolean

When true, unloads least-recently-used references-only chunks after loads exceed maxResidentChunks.

fetchConcurrency?: number

Maximum number of chunk fetches allowed at the same time.

frustumDepthMultiplier?: number

Optional multiplier applied to the camera eye-to-look distance to cap the streaming frustum depth. This only affects chunk scheduling; it does not change the view's render far clip.

frustumMinDepth?: number

Optional minimum depth, in view units, for the streaming frustum cap. This prevents close-focus viewpoints from capping streaming to only a few meters while preserving the render camera's far clip.

frustumOnly?: boolean

When true, only chunks intersecting the current frustum are committed.

getStreamIndex?: (stream: XGFSubstreamManifest, signal?: AbortSignal) => any

Optional child stream index resolver. Defaults to fetch(stream.uri).json().

Stream index containing asset-library and references-only chunks.

Optional loader instance. A default XGFStreamingLoader is created when omitted.

loadOptions?: XGFChunkLoadOptions

Options forwarded to chunk loads.

maxCachedFileBytes?: number

Maximum bytes of resolved XGF file data to retain when cacheFileData is enabled.

maxResidentChunks?: number

Maximum resident references-only chunks to keep when LRU eviction is enabled.

minProjectedChunkSizePixels?: number

Optional CSS-pixel threshold for view-driven streaming. Chunks whose AABB projects smaller than this size on both canvas axes are treated as not visible for scheduling and unload decisions. Conservative cases such as hidden canvases or near-plane intersections remain visible.

onChunkLoaded?: (manifest: XGFChunkManifest) => void

Called after one chunk has loaded.

onChunkLoadStats?: (stats: XGFChunkLoadStats) => void

Called with per-chunk timing and creation stats.

onChunksLoading?: (manifests: XGFChunkManifest[]) => void

Called before a batch of chunks begins loading.

onError?: (error: unknown) => void

Called when an async controller operation fails unexpectedly.

onProgress?: (progress: XGFViewStreamProgress) => void

Called when queue progress changes.

onStatus?: (status: string) => void

Called with coarse controller status messages.

progressCadenceMs?: number

Minimum time between non-final progress callbacks, in milliseconds.

This lets streaming UIs batch redraws while chunks are being committed. Omit or set to zero to emit progress after every chunk, matching the default behavior.

sceneModel: SceneModel

SceneModel that receives streamed chunk content.

streamIndexBaseURI?: string

Base URI used to resolve child stream URIs in index.streams.

unloadInactiveStreams?: boolean

When true, unloads child stream chunks and unregisters their manifests after their stream AABB leaves the frustum.

view: View

View whose camera/frustum drives stream prioritization.