|
@@ -52834,12 +52834,12 @@ var BABYLON;
|
|
if (sceneFilename.name) {
|
|
if (sceneFilename.name) {
|
|
sceneFilename = sceneFilename.name;
|
|
sceneFilename = sceneFilename.name;
|
|
}
|
|
}
|
|
- var dotPosition = sceneFilename.lastIndexOf(".");
|
|
|
|
var queryStringPosition = sceneFilename.indexOf("?");
|
|
var queryStringPosition = sceneFilename.indexOf("?");
|
|
- if (queryStringPosition === -1) {
|
|
|
|
- queryStringPosition = sceneFilename.length;
|
|
|
|
|
|
+ if (queryStringPosition !== -1) {
|
|
|
|
+ sceneFilename = sceneFilename.substring(0, queryStringPosition);
|
|
}
|
|
}
|
|
- var extension = sceneFilename.substring(dotPosition, queryStringPosition).toLowerCase();
|
|
|
|
|
|
+ var dotPosition = sceneFilename.lastIndexOf(".");
|
|
|
|
+ var extension = sceneFilename.substring(dotPosition, sceneFilename.length).toLowerCase();
|
|
return SceneLoader._getPluginForExtension(extension);
|
|
return SceneLoader._getPluginForExtension(extension);
|
|
};
|
|
};
|
|
// use babylon file loader directly if sceneFilename is prefixed with "data:"
|
|
// use babylon file loader directly if sceneFilename is prefixed with "data:"
|
|
@@ -80386,6 +80386,14 @@ var BABYLON;
|
|
this._loaderPendingCount = 0;
|
|
this._loaderPendingCount = 0;
|
|
this._loaderTrackers = new Array();
|
|
this._loaderTrackers = new Array();
|
|
this._parent = parent;
|
|
this._parent = parent;
|
|
|
|
+ if (!GLTFLoader._progressEventFactory) {
|
|
|
|
+ if (typeof window["ProgressEvent"] === "function") {
|
|
|
|
+ GLTFLoader._progressEventFactory = GLTFLoader._createProgressEventByConstructor;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ GLTFLoader._progressEventFactory = GLTFLoader._createProgressEventByDocument;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
GLTFLoader.RegisterExtension = function (extension) {
|
|
GLTFLoader.RegisterExtension = function (extension) {
|
|
if (GLTFLoader.Extensions[extension.name]) {
|
|
if (GLTFLoader.Extensions[extension.name]) {
|
|
@@ -80396,6 +80404,14 @@ var BABYLON;
|
|
// Keep the order of registration so that extensions registered first are called first.
|
|
// Keep the order of registration so that extensions registered first are called first.
|
|
GLTF2.GLTFLoaderExtension._Extensions.push(extension);
|
|
GLTF2.GLTFLoaderExtension._Extensions.push(extension);
|
|
};
|
|
};
|
|
|
|
+ GLTFLoader._createProgressEventByConstructor = function (name, data) {
|
|
|
|
+ return new ProgressEvent(name, data);
|
|
|
|
+ };
|
|
|
|
+ GLTFLoader._createProgressEventByDocument = function (name, data) {
|
|
|
|
+ var event = document.createEvent("ProgressEvent");
|
|
|
|
+ event.initProgressEvent(name, false, false, data.lengthComputable, data.loaded, data.total);
|
|
|
|
+ return event;
|
|
|
|
+ };
|
|
GLTFLoader.prototype.dispose = function () {
|
|
GLTFLoader.prototype.dispose = function () {
|
|
if (this._disposed) {
|
|
if (this._disposed) {
|
|
return;
|
|
return;
|
|
@@ -80456,7 +80472,7 @@ var BABYLON;
|
|
loaded += request._loaded;
|
|
loaded += request._loaded;
|
|
total += request._total;
|
|
total += request._total;
|
|
}
|
|
}
|
|
- this._progressCallback(new ProgressEvent("GLTFLoaderProgress", {
|
|
|
|
|
|
+ this._progressCallback(GLTFLoader._progressEventFactory("GLTFLoaderProgress", {
|
|
lengthComputable: true,
|
|
lengthComputable: true,
|
|
loaded: loaded,
|
|
loaded: loaded,
|
|
total: total
|
|
total: total
|