Loader

new Loader(manager?: LoadingManager)
THREE: THREE.Loader

Abstract base class for all loaders. Provides path, crossOrigin, and request header configuration.

Differs from THREE.js

crossOrigin defaults to empty string, not 'anonymous'. load() is abstract.

Properties

NameTypeDescription
manager

LoadingManager

The LoadingManager this loader reports to.

path

string

Base path prepended to all URLs.

crossOrigin

string

Cross-origin attribute value. Defaults to empty string (not 'anonymous').

requestHeader

Record<string, string>

HTTP headers sent with each request.

Methods

MethodDescription
setPath(path: string): this

Sets the base path for URLs.

setCrossOrigin(crossOrigin: string): this

Sets the cross-origin attribute.

setRequestHeader(header: Record<string, string>): this

Sets HTTP headers for requests.

loadAsync(url: string): Promise<*>

Promise wrapper around load().