Jelajahi Sumber

Added physics to scene proeprty grid (inspector)

David Catuhe 6 tahun lalu
induk
melakukan
d114e74759

File diff ditekan karena terlalu besar
+ 3307 - 3307
Playground/babylon.d.txt


File diff ditekan karena terlalu besar
+ 3309 - 3309
dist/preview release/babylon.d.ts


File diff ditekan karena terlalu besar
+ 1 - 1
dist/preview release/babylon.js


+ 27 - 10
dist/preview release/babylon.max.js

@@ -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;
@@ -73810,6 +73811,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;
@@ -78716,7 +78718,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 +78756,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 +78778,8 @@ var BABYLON;
             return {
                 url: url,
                 rootUrl: rootUrl,
-                name: name
+                name: name,
+                file: file
             };
         };
         // Public functions
@@ -78816,7 +78825,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 +78914,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 +78941,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 +78950,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 +78987,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 +79077,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 +79099,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
@@ -80092,7 +80109,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);
                     }

+ 27 - 10
dist/preview release/babylon.no-module.max.js

@@ -32502,6 +32502,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;
@@ -73777,6 +73778,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;
@@ -78683,7 +78685,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;
@@ -78721,11 +78723,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");
@@ -78737,7 +78745,8 @@ var BABYLON;
             return {
                 url: url,
                 rootUrl: rootUrl,
-                name: name
+                name: name,
+                file: file
             };
         };
         // Public functions
@@ -78783,7 +78792,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
@@ -78872,7 +78881,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
@@ -78899,7 +78908,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
@@ -78908,22 +78917,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) {
@@ -78937,7 +78954,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
@@ -79027,7 +79044,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
@@ -79049,7 +79066,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
@@ -80059,7 +80076,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);
                     }

File diff ditekan karena terlalu besar
+ 1 - 1
dist/preview release/babylon.worker.js


+ 27 - 10
dist/preview release/es6.js

@@ -32502,6 +32502,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;
@@ -73777,6 +73778,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;
@@ -78683,7 +78685,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;
@@ -78721,11 +78723,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");
@@ -78737,7 +78745,8 @@ var BABYLON;
             return {
                 url: url,
                 rootUrl: rootUrl,
-                name: name
+                name: name,
+                file: file
             };
         };
         // Public functions
@@ -78783,7 +78792,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
@@ -78872,7 +78881,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
@@ -78899,7 +78908,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
@@ -78908,22 +78917,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) {
@@ -78937,7 +78954,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
@@ -79027,7 +79044,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
@@ -79049,7 +79066,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
@@ -80059,7 +80076,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);
                     }

File diff ditekan karena terlalu besar
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.js


File diff ditekan karena terlalu besar
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.js.map


File diff ditekan karena terlalu besar
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


File diff ditekan karena terlalu besar
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 5 - 0
inspector/src/components/actionTabs/lines/floatLineComponent.tsx

@@ -6,6 +6,7 @@ interface IFloatLineComponentProps {
     label: string,
     target: any,
     propertyName: string,
+    onChange?: (newValue: number) => void,
     onPropertyChangedObservable?: Observable<PropertyChangedEvent>,
     additionalClass?: string
 }
@@ -37,6 +38,10 @@ export class FloatLineComponent extends React.Component<IFloatLineComponentProps
     }
 
     raiseOnPropertyChanged(newValue: number, previousValue: number) {
+        if (this.props.onChange) {
+            this.props.onChange(newValue);
+        }
+
         if (!this.props.onPropertyChangedObservable) {
             return;
         }

+ 5 - 0
inspector/src/components/actionTabs/lines/vector3LineComponent.tsx

@@ -9,6 +9,7 @@ interface IVector3LineComponentProps {
     label: string,
     target: any,
     propertyName: string,
+    onChange?: (newvalue: Vector3) => void,
     onPropertyChangedObservable?: Observable<PropertyChangedEvent>
 }
 
@@ -38,6 +39,10 @@ export class Vector3LineComponent extends React.Component<IVector3LineComponentP
     }
 
     raiseOnPropertyChanged(previousValue: Vector3) {
+        if (this.props.onChange) {
+            this.props.onChange(this.state.value);
+        }
+
         if (!this.props.onPropertyChangedObservable) {
             return;
         }

+ 37 - 1
inspector/src/components/actionTabs/tabs/propertyGrids/scenePropertyGridComponent.tsx

@@ -1,5 +1,5 @@
 import * as React from "react";
-import { Observable, Scene, BaseTexture, Nullable } from "babylonjs";
+import { Observable, Scene, BaseTexture, Nullable, Vector3 } from "babylonjs";
 import { PropertyChangedEvent } from "../../../propertyChangedEvent";
 import { LineContainerComponent } from "../../lineContainerComponent";
 import { RadioButtonLineComponent } from "../../lines/radioLineComponent";
@@ -8,6 +8,8 @@ import { CheckBoxLineComponent } from "../../lines/checkBoxLineComponent";
 import { FogPropertyGridComponent } from "./fogPropertyGridComponent";
 import { FileButtonLineComponent } from "../../lines/fileButtonLineComponent";
 import { TextureLinkLineComponent } from "../../lines/textureLinkLineComponent";
+import { Vector3LineComponent } from "../../lines/vector3LineComponent";
+import { FloatLineComponent } from "../../lines/floatLineComponent";
 
 interface IScenePropertyGridComponentProps {
     scene: Scene,
@@ -71,11 +73,35 @@ export class ScenePropertyGridComponent extends React.Component<IScenePropertyGr
         }, undefined, true);
     }
 
+    updateGravity(newValue: Vector3) {
+        const scene = this.props.scene;
+        const physicsEngine = scene.getPhysicsEngine()!;
+
+        physicsEngine.setGravity(newValue);
+    }
+
+    updateTimeStep(newValue: number) {
+        const scene = this.props.scene;
+        const physicsEngine = scene.getPhysicsEngine()!;
+
+        physicsEngine.setTimeStep(newValue);
+    }
+
     render() {
         const scene = this.props.scene;
 
         const renderingModeGroupObservable = new BABYLON.Observable<RadioButtonLineComponent>();
 
+        const physicsEngine = scene.getPhysicsEngine();
+        let dummy: Nullable<{ gravity: Vector3, timeStep: number }> = null;
+
+        if (physicsEngine) {
+            dummy = {
+                gravity: physicsEngine.gravity,
+                timeStep: physicsEngine.getTimeStep()
+            }
+        }
+
         return (
             <div className="pane">
                 <LineContainerComponent title="RENDERING MODE">
@@ -95,6 +121,16 @@ export class ScenePropertyGridComponent extends React.Component<IScenePropertyGr
                     <FileButtonLineComponent label="Update environment texture" onClick={(file) => this.updateEnvironmentTexture(file)} accept=".dds, .env" />
                     <FogPropertyGridComponent scene={scene} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                 </LineContainerComponent>
+                {
+                    dummy !== null &&
+                    <LineContainerComponent title="PHYSICS" closed={true}>
+                        <FloatLineComponent label="Time step" target={dummy} propertyName="timeStep" onChange={newValue => this.updateTimeStep(newValue)} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                        <Vector3LineComponent label="Gravity" target={dummy} propertyName="gravity" onChange={newValue => this.updateGravity(newValue)} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                    </LineContainerComponent>
+                }
+                <LineContainerComponent title="COLLISIONS" closed={true}>
+                    <Vector3LineComponent label="Gravity" target={scene} propertyName="gravity" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                </LineContainerComponent>
             </div>
         );
     }

+ 1 - 1
src/Engine/babylon.engine.ts

@@ -4332,7 +4332,7 @@ module BABYLON {
                     loader!.loadData(data as ArrayBuffer, texture, (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void, loadFailed) => {
                         if (loadFailed) {
                             onInternalError("TextureLoader failed to load data");
-                        }else {
+                        } else {
                             this._prepareWebGLTexture(texture, scene, width, height, invertY, !loadMipmap, isCompressed, () => {
                                 done();
                                 return false;

+ 1 - 0
src/Materials/Textures/babylon.cubeTexture.ts

@@ -207,6 +207,7 @@ module BABYLON {
         public updateURL(url: string, forcedExtension?: string, onLoad?: () => void): void {
             if (this.url) {
                 this.releaseInternalTexture();
+                this.getScene()!.markAllMaterialsAsDirty(Material.TextureDirtyFlag);
             }
 
             this.url = url;

+ 1 - 0
src/Materials/Textures/babylon.texture.ts

@@ -297,6 +297,7 @@ module BABYLON {
         public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
             if (this.url) {
                 this.releaseInternalTexture();
+                this.getScene()!.markAllMaterialsAsDirty(Material.TextureDirtyFlag);
             }
 
             this.url = url;