Base class for implementing loaders.
manager — The loadingManager for the loader to use. Default is v3d.DefaultLoadingManager.
Creates a new Loader.
The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Whether the XMLHttpRequest uses credentials. See .setWithCredentials.
The loadingManager the loader is using. Default is DefaultLoadingManager.
The base path from which the asset will be loaded. Default is the empty string.
The base path from which additional resources like textures will be loaded. Default is the empty string.
The request header used in HTTP request. See .setRequestHeader. Default is empty object.
This method needs to be implement by all concrete loaders. It holds the logic for loading the asset from the backend.
url — A string containing the path/URL of the file to be loaded.
onProgress (optional) — A function to be called while the loading is in progress. The argument will be the ProgressEvent instance, which contains .lengthComputable, .total and .loaded. If the server does not set the Content-Length header; .total will be 0.
This method is equivalent to .load, but returns a Promise.
onLoad is handled by Promise.resolve and onError is handled by Promise.reject.
This method needs to be implement by all concrete loaders. It holds the logic for parsing the asset into Verge3D entities.
crossOrigin — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or
TLS client certificates. See XMLHttpRequest.withCredentials.
Note that this has no effect if you are loading files locally or from the same domain.
path — Set the base path for the asset.
resourcePath — Set the base path for dependent resources like textures.
requestHeader — key: The name of the header whose value is to be set. value: The value to set as the body of the header.
Set the request header used in HTTP request.
For more info on how to obtain the source code of this module see this page.