Skip to content

copper3d / Modules / Loader/copperGltfLoader

Module: Loader/copperGltfLoader ​

Table of contents ​

Interfaces ​

Functions ​

Functions ​

copperGltfLoader ​

▸ copperGltfLoader(renderer): GLTFLoader

A GLTFLoader wired to the shared Draco and KTX2 loaders.

Exported so callers who need their own loader -- their own LoadingManager, onError, or a load not going through a copper3d scene -- do not have to rebuild the decoder wiring and get the paths right again.

Parameters ​

NameType
rendererWebGLRenderer

Returns ​

GLTFLoader

Defined in ​

src/Loader/copperGltfLoader.ts:75


setDracoDecoderPath ​

▸ setDracoDecoderPath(path): void

Points the Draco decoder at path, which must end in a slash -- three appends draco_wasm_wrapper.js and draco_decoder.wasm to it directly.

On a subpath deploy the base URL has to be included: a decoder served from /te-uma/draco/ is not found at /draco/.

Call once at startup. The decoder module is fetched on first use and cached inside DRACOLoader, so a later change does not re-fetch it.

Parameters ​

NameType
pathstring

Returns ​

void

Defined in ​

src/Loader/copperGltfLoader.ts:43


setKTX2TranscoderPath ​

▸ setKTX2TranscoderPath(path): void

The same, for the Basis/KTX2 transcoder. Also expects a trailing slash.

Parameters ​

NameType
pathstring

Returns ​

void

Defined in ​

src/Loader/copperGltfLoader.ts:48