[name]

Base class for implementing loaders.

Constructor

[name]()

Creates a new [name]. This should be called as base class.

Properties

[property:Function onLoadStart]

Will be called when load starts.

The default is a function with empty body.

[property:Function onLoadProgress]

Will be called while load progresses.

The default is a function with empty body.

[property:Function onLoadComplete]

Will be called when load completes.

The default is a function with empty body.

[property:string crossOrigin]

The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS. Default is *"anonymous"*.

Methods

[method:Material createMaterial]( [param:object m], [param:string texturePath] )

[page:Object m] — The parameters to create the material.
[page:String texturePath] — The base path of the textures.

Creates the Material based on the parameters m.

[method:Array initMaterials]( [param:Array materials], [param:string texturePath] )

[page:Array materials] — an array of parameters to create materials.
[page:String texturePath] — The base path of the textures.

Creates an array of [page:Material] based on the array of parameters m. The index of the parameters decide the correct index of the materials.

Handlers

*[name].Handlers* is a special object normally used by other loaders like [page:GLTFLoader] or [page:MTLLoader]. It provides an API that allows the definition of special mappings: What loaders should be used in order to load specific files. A typical use case is to overwrite the default loader for textures.

Note: It's only possible to use *[name].Handlers* if the respective loader support the usage.

[method:null add]( [param:Object regex], [param:Loader loader] )

[page:Object regex] — A regular expression.
[page:Loader loader] — The loader.

Registers a loader with the given regular expression.

[method:null get]( [param:String file] )

[page:String file] — The file path.

Can be used to retrieve the registered loader for the given file path.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]