|
@@ -32535,6 +32535,7 @@ var BABYLON;
|
|
|
if (buffer === void 0) { buffer = null; }
|
|
|
if (this.url) {
|
|
|
this.releaseInternalTexture();
|
|
|
+ this.getScene().markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag);
|
|
|
}
|
|
|
this.url = url;
|
|
|
this._buffer = buffer;
|
|
@@ -55125,7 +55126,12 @@ var BABYLON;
|
|
|
* This observable will notify when all animations have paused.
|
|
|
*/
|
|
|
this.onAnimationGroupPauseObservable = new BABYLON.Observable();
|
|
|
+ /**
|
|
|
+ * This observable will notify when all animations are playing.
|
|
|
+ */
|
|
|
+ this.onAnimationGroupPlayObservable = new BABYLON.Observable();
|
|
|
this._scene = scene || BABYLON.Engine.LastCreatedScene;
|
|
|
+ this.uniqueId = this._scene.getUniqueId();
|
|
|
this._scene.animationGroups.push(this);
|
|
|
}
|
|
|
Object.defineProperty(AnimationGroup.prototype, "from", {
|
|
@@ -55158,6 +55164,16 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ Object.defineProperty(AnimationGroup.prototype, "isPlaying", {
|
|
|
+ /**
|
|
|
+ * Gets a value indicating that the current group is playing
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return this._isStarted && !this._isPaused;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
Object.defineProperty(AnimationGroup.prototype, "speedRatio", {
|
|
|
/**
|
|
|
* Gets or sets the speed ratio to use for all animations
|
|
@@ -55301,6 +55317,8 @@ var BABYLON;
|
|
|
this._speedRatio = -speedRatio;
|
|
|
}
|
|
|
this._isStarted = true;
|
|
|
+ this._isPaused = false;
|
|
|
+ this.onAnimationGroupPlayObservable.notifyObservers(this);
|
|
|
return this;
|
|
|
};
|
|
|
/**
|
|
@@ -55311,6 +55329,7 @@ var BABYLON;
|
|
|
if (!this._isStarted) {
|
|
|
return this;
|
|
|
}
|
|
|
+ this._isPaused = true;
|
|
|
for (var index = 0; index < this._animatables.length; index++) {
|
|
|
var animatable = this._animatables[index];
|
|
|
animatable.pause();
|
|
@@ -55339,6 +55358,7 @@ var BABYLON;
|
|
|
this.stop();
|
|
|
this.start(loop, this._speedRatio);
|
|
|
}
|
|
|
+ this._isPaused = false;
|
|
|
return this;
|
|
|
};
|
|
|
/**
|
|
@@ -55367,6 +55387,7 @@ var BABYLON;
|
|
|
var animatable = this._animatables[index];
|
|
|
animatable.restart();
|
|
|
}
|
|
|
+ this.onAnimationGroupPlayObservable.notifyObservers(this);
|
|
|
return this;
|
|
|
};
|
|
|
/**
|
|
@@ -67007,14 +67028,15 @@ var BABYLON;
|
|
|
/**
|
|
|
* Renders a specified physic impostor
|
|
|
* @param impostor defines the impostor to render
|
|
|
+ * @returns the new debug mesh used to render the impostor
|
|
|
*/
|
|
|
PhysicsViewer.prototype.showImpostor = function (impostor) {
|
|
|
if (!this._scene) {
|
|
|
- return;
|
|
|
+ return null;
|
|
|
}
|
|
|
for (var i = 0; i < this._numMeshes; i++) {
|
|
|
if (this._impostors[i] == impostor) {
|
|
|
- return;
|
|
|
+ return null;
|
|
|
}
|
|
|
}
|
|
|
var debugMesh = this._getDebugMesh(impostor, this._scene);
|
|
@@ -67027,6 +67049,7 @@ var BABYLON;
|
|
|
}
|
|
|
this._numMeshes++;
|
|
|
}
|
|
|
+ return debugMesh;
|
|
|
};
|
|
|
/**
|
|
|
* Hides a specified physic impostor
|
|
@@ -73802,6 +73825,13 @@ var BABYLON;
|
|
|
return new CubeTexture(url, scene, null, false, null, null, null, undefined, true, forcedExtension, createPolynomials);
|
|
|
};
|
|
|
/**
|
|
|
+ * Get the current class name of the texture useful for serialization or dynamic coding.
|
|
|
+ * @returns "CubeTexture"
|
|
|
+ */
|
|
|
+ CubeTexture.prototype.getClassName = function () {
|
|
|
+ return "CubeTexture";
|
|
|
+ };
|
|
|
+ /**
|
|
|
* Update the url (and optional buffer) of this texture if url was null during construction.
|
|
|
* @param url the url of the texture
|
|
|
* @param forcedExtension defines the extension to use
|
|
@@ -73810,6 +73840,7 @@ var BABYLON;
|
|
|
CubeTexture.prototype.updateURL = function (url, forcedExtension, onLoad) {
|
|
|
if (this.url) {
|
|
|
this.releaseInternalTexture();
|
|
|
+ this.getScene().markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag);
|
|
|
}
|
|
|
this.url = url;
|
|
|
this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED;
|
|
@@ -73854,6 +73885,13 @@ var BABYLON;
|
|
|
* @param value Reflection texture matrix
|
|
|
*/
|
|
|
CubeTexture.prototype.setReflectionTextureMatrix = function (value) {
|
|
|
+ var _this = this;
|
|
|
+ if (value.updateFlag === this._textureMatrix.updateFlag) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (value.isIdentity() !== this._textureMatrix.isIdentity()) {
|
|
|
+ this.getScene().markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag, function (mat) { return mat.getActiveTextures().indexOf(_this) !== -1; });
|
|
|
+ }
|
|
|
this._textureMatrix = value;
|
|
|
};
|
|
|
/**
|
|
@@ -78716,7 +78754,7 @@ var BABYLON;
|
|
|
dataCallback(directLoad);
|
|
|
return plugin;
|
|
|
}
|
|
|
- var file = BABYLON.FilesInput.FilesToLoad[fileInfo.name.toLowerCase()];
|
|
|
+ var file = fileInfo.file || BABYLON.FilesInput.FilesToLoad[fileInfo.name.toLowerCase()];
|
|
|
if (fileInfo.rootUrl.indexOf("file:") === -1 || (fileInfo.rootUrl.indexOf("file:") !== -1 && !file)) {
|
|
|
var engine = scene.getEngine();
|
|
|
var canUseOfflineSupport = engine.enableOfflineSupport;
|
|
@@ -78754,11 +78792,17 @@ var BABYLON;
|
|
|
SceneLoader._getFileInfo = function (rootUrl, sceneFilename) {
|
|
|
var url;
|
|
|
var name;
|
|
|
+ var file = null;
|
|
|
if (!sceneFilename) {
|
|
|
url = rootUrl;
|
|
|
name = BABYLON.Tools.GetFilename(rootUrl);
|
|
|
rootUrl = BABYLON.Tools.GetFolderPath(rootUrl);
|
|
|
}
|
|
|
+ else if (sceneFilename instanceof File) {
|
|
|
+ url = rootUrl + sceneFilename.name;
|
|
|
+ name = sceneFilename.name;
|
|
|
+ file = sceneFilename;
|
|
|
+ }
|
|
|
else {
|
|
|
if (sceneFilename.substr(0, 1) === "/") {
|
|
|
BABYLON.Tools.Error("Wrong sceneFilename parameter");
|
|
@@ -78770,7 +78814,8 @@ var BABYLON;
|
|
|
return {
|
|
|
url: url,
|
|
|
rootUrl: rootUrl,
|
|
|
- name: name
|
|
|
+ name: name,
|
|
|
+ file: file
|
|
|
};
|
|
|
};
|
|
|
// Public functions
|
|
@@ -78816,7 +78861,7 @@ var BABYLON;
|
|
|
* Import meshes into a scene
|
|
|
* @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
|
|
|
* @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
|
|
|
- * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
|
|
|
+ * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
|
|
|
* @param scene the instance of BABYLON.Scene to append to
|
|
|
* @param onSuccess a callback with a list of imported meshes, particleSystems, and skeletons when import succeeds
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
@@ -78905,7 +78950,7 @@ var BABYLON;
|
|
|
* Import meshes into a scene
|
|
|
* @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
|
|
|
* @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
|
|
|
- * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
|
|
|
+ * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
|
|
|
* @param scene the instance of BABYLON.Scene to append to
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
|
* @param pluginExtension the extension used to determine the plugin
|
|
@@ -78932,7 +78977,7 @@ var BABYLON;
|
|
|
/**
|
|
|
* Load a scene
|
|
|
* @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
|
|
|
- * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
|
|
|
+ * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
|
|
|
* @param engine is the instance of BABYLON.Engine to use to create the scene
|
|
|
* @param onSuccess a callback with the scene when import succeeds
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
@@ -78941,22 +78986,30 @@ var BABYLON;
|
|
|
* @returns The loaded plugin
|
|
|
*/
|
|
|
SceneLoader.Load = function (rootUrl, sceneFilename, engine, onSuccess, onProgress, onError, pluginExtension) {
|
|
|
+ if (sceneFilename === void 0) { sceneFilename = ""; }
|
|
|
+ if (engine === void 0) { engine = BABYLON.Engine.LastCreatedEngine; }
|
|
|
if (onSuccess === void 0) { onSuccess = null; }
|
|
|
if (onProgress === void 0) { onProgress = null; }
|
|
|
if (onError === void 0) { onError = null; }
|
|
|
if (pluginExtension === void 0) { pluginExtension = null; }
|
|
|
+ if (!engine) {
|
|
|
+ BABYLON.Tools.Error("No engine available");
|
|
|
+ return null;
|
|
|
+ }
|
|
|
return SceneLoader.Append(rootUrl, sceneFilename, new BABYLON.Scene(engine), onSuccess, onProgress, onError, pluginExtension);
|
|
|
};
|
|
|
/**
|
|
|
* Load a scene
|
|
|
* @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
|
|
|
- * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
|
|
|
+ * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
|
|
|
* @param engine is the instance of BABYLON.Engine to use to create the scene
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
|
* @param pluginExtension the extension used to determine the plugin
|
|
|
* @returns The loaded scene
|
|
|
*/
|
|
|
SceneLoader.LoadAsync = function (rootUrl, sceneFilename, engine, onProgress, pluginExtension) {
|
|
|
+ if (sceneFilename === void 0) { sceneFilename = ""; }
|
|
|
+ if (engine === void 0) { engine = BABYLON.Engine.LastCreatedEngine; }
|
|
|
if (onProgress === void 0) { onProgress = null; }
|
|
|
if (pluginExtension === void 0) { pluginExtension = null; }
|
|
|
return new Promise(function (resolve, reject) {
|
|
@@ -78970,7 +79023,7 @@ var BABYLON;
|
|
|
/**
|
|
|
* Append a scene
|
|
|
* @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
|
|
|
- * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
|
|
|
+ * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
|
|
|
* @param scene is the instance of BABYLON.Scene to append to
|
|
|
* @param onSuccess a callback with the scene when import succeeds
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
@@ -79060,7 +79113,7 @@ var BABYLON;
|
|
|
/**
|
|
|
* Append a scene
|
|
|
* @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
|
|
|
- * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
|
|
|
+ * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
|
|
|
* @param scene is the instance of BABYLON.Scene to append to
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
|
* @param pluginExtension the extension used to determine the plugin
|
|
@@ -79082,7 +79135,7 @@ var BABYLON;
|
|
|
/**
|
|
|
* Load a scene into an asset container
|
|
|
* @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
|
|
|
- * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
|
|
|
+ * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene or a File object (default: empty string)
|
|
|
* @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
|
|
|
* @param onSuccess a callback with the scene when import succeeds
|
|
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
@@ -79848,7 +79901,8 @@ var BABYLON;
|
|
|
if (parsedData.createDefaultSkybox === true) {
|
|
|
var skyboxScale = (scene.activeCamera !== undefined && scene.activeCamera !== null) ? (scene.activeCamera.maxZ - scene.activeCamera.minZ) / 2 : 1000;
|
|
|
var skyboxBlurLevel = parsedData.skyboxBlurLevel || 0;
|
|
|
- scene.createDefaultSkybox(undefined, true, skyboxScale, skyboxBlurLevel);
|
|
|
+ var skyboxIsPBR = parsedData.skyboxIsPBR !== undefined ? parsedData.skyboxIsPBR : true;
|
|
|
+ scene.createDefaultSkybox(scene.environmentTexture, skyboxIsPBR, skyboxScale, skyboxBlurLevel);
|
|
|
}
|
|
|
}
|
|
|
// Finish
|
|
@@ -80092,7 +80146,7 @@ var BABYLON;
|
|
|
}
|
|
|
this._engine.stopRenderLoop();
|
|
|
}
|
|
|
- BABYLON.SceneLoader.LoadAsync("file:", this._sceneFileToLoad.name, this._engine, function (progress) {
|
|
|
+ BABYLON.SceneLoader.LoadAsync("file:", this._sceneFileToLoad, this._engine, function (progress) {
|
|
|
if (_this._progressCallback) {
|
|
|
_this._progressCallback(progress);
|
|
|
}
|
|
@@ -95399,6 +95453,13 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
/**
|
|
|
+ * Get the current class name of the texture useful for serialization or dynamic coding.
|
|
|
+ * @returns "HDRCubeTexture"
|
|
|
+ */
|
|
|
+ HDRCubeTexture.prototype.getClassName = function () {
|
|
|
+ return "HDRCubeTexture";
|
|
|
+ };
|
|
|
+ /**
|
|
|
* Occurs when the file is raw .hdr file.
|
|
|
*/
|
|
|
HDRCubeTexture.prototype.loadTexture = function () {
|
|
@@ -95507,7 +95568,14 @@ var BABYLON;
|
|
|
* @param value Define the reflection matrix to set
|
|
|
*/
|
|
|
HDRCubeTexture.prototype.setReflectionTextureMatrix = function (value) {
|
|
|
+ var _this = this;
|
|
|
this._textureMatrix = value;
|
|
|
+ if (value.updateFlag === this._textureMatrix.updateFlag) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (value.isIdentity() !== this._textureMatrix.isIdentity()) {
|
|
|
+ this.getScene().markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag, function (mat) { return mat.getActiveTextures().indexOf(_this) !== -1; });
|
|
|
+ }
|
|
|
};
|
|
|
/**
|
|
|
* Parses a JSON representation of an HDR Texture in order to create the texture
|