Skip to content

copper3d / Modules / Loader/copperGltfLoader / GltfLoadOpts

Interface: GltfLoadOpts ​

Loader/copperGltfLoader.GltfLoadOpts

Optional callbacks for scene.loadGltf.

Until 3.9.0 there were none, and the third argument every loadGltf passed to GLTFLoader.load was an empty function NAMED error sitting in the onProgress slot -- so a failed fetch or a corrupt file invoked nothing at all, and the caller's callback simply never fired. A load that fails and a load that is merely slow were indistinguishable from outside.

Table of contents ​

Properties ​

Properties ​

onError ​

• Optional onError: (error: unknown) => void

Type declaration ​

▸ (error): void

Fetch or parse failure. The one signal that a load is never coming.

Parameters ​
NameType
errorunknown
Returns ​

void

Defined in ​

src/Loader/copperGltfLoader.ts:65


onProgress ​

• Optional onProgress: (event: ProgressEvent<EventTarget>) => void

Type declaration ​

▸ (event): void

Download progress. Fires only when the server sends a Content-Length.

Parameters ​
NameType
eventProgressEvent<EventTarget>
Returns ​

void

Defined in ​

src/Loader/copperGltfLoader.ts:63