load method
dynamic
load(])
override
Implementation
@override
load(url, onLoad, [onProgress, onError]) {
var scope = this;
var path = (this.path == '') ? LoaderUtils.extractUrlBase(url) : this.path;
resourcePath = resourcePath ?? path;
var loader = FileLoader(manager);
loader.setPath(this.path);
loader.setRequestHeader(requestHeader);
loader.setWithCredentials(withCredentials);
loader.load(url, (text) {
var json;
try {
json = convert.jsonDecode(text);
} catch (error) {
if (onError != null) onError(error);
print('THREE:ObjectLoader: Can\'t parse ' + url + '.$error');
return;
}
var metadata = json.metadata;
if (metadata == null ||
metadata.type == null ||
metadata.type.toLowerCase() == 'geometry') {
print('THREE.ObjectLoader: Can\'t load ' + url);
return;
}
scope.parse(json, null, onLoad);
}, onProgress, onError);
}