Creates a new LoadingManager.
this function will be called when all loaders are done.
this function will be called when an item is complete.
this function will be called a loader encounters errors.
This function will be called when loading starts. By default this is undefined. The arguments are:
Registers a loader with the given regular expression. Can be used to define what loader should be used in order to load specific files. A typical use case is to overwrite the default loader for textures. add handler for TGA textures manager.addHandler( /.tga$/i, new TGALoader() );
The loaded url This should be called by any loader using the manager when the loader ended loading an url.
The loaded url This should be called by any loader using the manager when the loader errors loading an url.
The url to load This should be called by any loader using the manager when the loader starts loading an url.
Will be called when item loading fails. The default is a with empty body.
The url of the item that errored.
Will be called when all items finish loading. The default is a with empty body.
Will be called for each loaded item. The default is a with empty body.
Removes the loader for the given regular expression.
A regular expression.
Given a URL, uses the URL modifier callback (if any) and returns a resolved URL. If no URL modifier is set, returns the original URL.
The url to load
If provided, the callback will be passed each resource URL before a request is sent. The callback may return the original URL, or a new URL to override loading behavior. This behavior can be used to load assets from .ZIP files, drag-and-drop APIs, and Data URIs.
URL modifier callback. Called with url argument, and must return resolvedURL.
Generated using TypeDoc
Handles and keeps track of loaded and pending data. A default global instance of this class is created and used by loaders if not supplied manually - see DefaultLoadingManager. In general that should be sufficient, however there are times when it can be useful to have separate loaders - for example if you want to show separate loading bars for objects and textures.
Code Example
This example shows how to use LoadingManager to track the progress of OBJLoader.
In addition to observing progress, a LoadingManager can be used to override resource URLs during loading. This may be helpful for assets coming from drag-and-drop events, WebSockets, WebRTC, or other APIs. An example showing how to load an in-memory model using Blob URLs is below.
Examples
WebGL / loader / fbx | WebGL / loader / obj | WebGL / materials / physical / reflectivity | WebGL / postprocesing / outline