MCPcopy
hub / github.com/sparkjsdev/spark / loadInternalAsync

Method loadInternalAsync

src/SplatLoader.ts:293–341  ·  view source on GitHub ↗
({
    packedSplats,
    extSplats,
    url,
    fileBytes,
    fileType,
    fileName,
    stream,
    streamLength,
    onProgress,
    lod,
    nonLod,
    lodAbove,
    lodBase,
  }: {
    packedSplats?: PackedSplats;
    extSplats?: ExtSplats;
    url?: string;
    fileBytes?: Uint8Array | ArrayBuffer;
    fileType?: SplatFileType;
    fileName?: string;
    stream?: ReadableStream;
    streamLength?: number;
    onProgress?: (event: ProgressEvent) => void;
    lod?: boolean;
    nonLod?: boolean;
    lodAbove?: number;
    lodBase?: number;
  })

Source from the content-addressed store, hash-verified

291 }
292
293 async loadInternalAsync({
294 packedSplats,
295 extSplats,
296 url,
297 fileBytes,
298 fileType,
299 fileName,
300 stream,
301 streamLength,
302 onProgress,
303 lod,
304 nonLod,
305 lodAbove,
306 lodBase,
307 }: {
308 packedSplats?: PackedSplats;
309 extSplats?: ExtSplats;
310 url?: string;
311 fileBytes?: Uint8Array | ArrayBuffer;
312 fileType?: SplatFileType;
313 fileName?: string;
314 stream?: ReadableStream;
315 streamLength?: number;
316 onProgress?: (event: ProgressEvent) => void;
317 lod?: boolean;
318 nonLod?: boolean;
319 lodAbove?: number;
320 lodBase?: number;
321 }) {
322 return new Promise((resolve, reject) => {
323 this.loadInternal({
324 packedSplats,
325 extSplats,
326 url,
327 fileBytes,
328 fileType,
329 fileName,
330 stream,
331 streamLength,
332 onLoad: resolve,
333 onProgress,
334 onError: reject,
335 lod,
336 nonLod,
337 lodAbove,
338 lodBase,
339 });
340 });
341 }
342}
343
344async function fetchWithProgress(

Callers 2

asyncInitializeMethod · 0.95
asyncInitializeMethod · 0.95

Calls 1

loadInternalMethod · 0.95

Tested by

no test coverage detected