瀏覽代碼

Fixing issues with Sandbox and drag'n'drop

David Catuhe 9 年之前
父節點
當前提交
70fcc083e9

File diff suppressed because it is too large
+ 18 - 18
dist/preview release/babylon.core.js


File diff suppressed because it is too large
+ 3130 - 3128
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 23 - 23
dist/preview release/babylon.js


+ 14 - 4
dist/preview release/babylon.max.js

@@ -4422,7 +4422,7 @@ var BABYLON;
                 }
                 else {
                     try {
-                        var textureName = url.substring(5);
+                        var textureName = url.substring(5).toLowerCase();
                         var blobURL;
                         try {
                             blobURL = URL.createObjectURL(BABYLON.FilesInput.FilesTextures[textureName], { oneTimeOnly: true });
@@ -10314,8 +10314,10 @@ var BABYLON;
             var light = scene.getLightByID(parsedShadowGenerator.lightId);
             var shadowGenerator = new ShadowGenerator(parsedShadowGenerator.mapSize, light);
             for (var meshIndex = 0; meshIndex < parsedShadowGenerator.renderList.length; meshIndex++) {
-                var mesh = scene.getMeshByID(parsedShadowGenerator.renderList[meshIndex]);
-                shadowGenerator.getShadowMap().renderList.push(mesh);
+                var meshes = scene.getMeshesByID(parsedShadowGenerator.renderList[meshIndex]);
+                meshes.forEach(function (mesh) {
+                    shadowGenerator.getShadowMap().renderList.push(mesh);
+                });
             }
             if (parsedShadowGenerator.usePoissonSampling) {
                 shadowGenerator.usePoissonSampling = true;
@@ -15403,6 +15405,11 @@ var BABYLON;
             }
             return null;
         };
+        Scene.prototype.getMeshesByID = function (id) {
+            return this.meshes.filter(function (m) {
+                return m.id === id;
+            });
+        };
         /**
          * Get a mesh with its auto-generated unique id
          * @param {number} uniqueId - the unique id to search for
@@ -16100,7 +16107,9 @@ var BABYLON;
             // Debug layer
             this.debugLayer.hide();
             // Events
-            this.onDisposeObservable.notifyObservers(this);
+            if (this.onDispose) {
+                this.onDispose();
+            }
             this.onBeforeRenderObservable.clear();
             this.onAfterRenderObservable.clear();
             this.detachControl();
@@ -18241,6 +18250,7 @@ var BABYLON;
          * - setPivotMatrix
          * - scaling
          * tuto : http://doc.babylonjs.com/tutorials/How_to_use_Instances
+         * Warning : this method is not supported for `Line` mesh and `LineSystem`
          */
         Mesh.prototype.createInstance = function (name) {
             return new BABYLON.InstancedMesh(name, this);

File diff suppressed because it is too large
+ 23 - 23
dist/preview release/babylon.noworker.js


+ 4 - 2
src/Lights/Shadows/babylon.shadowGenerator.js

@@ -371,8 +371,10 @@ var BABYLON;
             var light = scene.getLightByID(parsedShadowGenerator.lightId);
             var shadowGenerator = new ShadowGenerator(parsedShadowGenerator.mapSize, light);
             for (var meshIndex = 0; meshIndex < parsedShadowGenerator.renderList.length; meshIndex++) {
-                var mesh = scene.getMeshByID(parsedShadowGenerator.renderList[meshIndex]);
-                shadowGenerator.getShadowMap().renderList.push(mesh);
+                var meshes = scene.getMeshesByID(parsedShadowGenerator.renderList[meshIndex]);
+                meshes.forEach(function (mesh) {
+                    shadowGenerator.getShadowMap().renderList.push(mesh);
+                });
             }
             if (parsedShadowGenerator.usePoissonSampling) {
                 shadowGenerator.usePoissonSampling = true;

+ 1 - 1
src/Lights/Shadows/babylon.shadowGenerator.ts

@@ -437,7 +437,7 @@
 
             for (var meshIndex = 0; meshIndex < parsedShadowGenerator.renderList.length; meshIndex++) {
                 var meshes = scene.getMeshesByID(parsedShadowGenerator.renderList[meshIndex]);
-                meshes.forEach(function(mesh) {
+                meshes.forEach(function (mesh) {
                     shadowGenerator.getShadowMap().renderList.push(mesh);
                 });
             }

+ 1 - 0
src/Mesh/babylon.mesh.js

@@ -1406,6 +1406,7 @@ var BABYLON;
          * - setPivotMatrix
          * - scaling
          * tuto : http://doc.babylonjs.com/tutorials/How_to_use_Instances
+         * Warning : this method is not supported for `Line` mesh and `LineSystem`
          */
         Mesh.prototype.createInstance = function (name) {
             return new BABYLON.InstancedMesh(name, this);

+ 1 - 1
src/Tools/babylon.tools.js

@@ -255,7 +255,7 @@ var BABYLON;
                 }
                 else {
                     try {
-                        var textureName = url.substring(5);
+                        var textureName = url.substring(5).toLowerCase();
                         var blobURL;
                         try {
                             blobURL = URL.createObjectURL(BABYLON.FilesInput.FilesTextures[textureName], { oneTimeOnly: true });

+ 1 - 1
src/Tools/babylon.tools.ts

@@ -316,7 +316,7 @@
                 }
                 else {
                     try {
-                        var textureName = url.substring(5);
+                        var textureName = url.substring(5).toLowerCase();
                         var blobURL;
                         try {
                             blobURL = URL.createObjectURL(FilesInput.FilesTextures[textureName], { oneTimeOnly: true });

+ 8 - 1
src/babylon.scene.js

@@ -1244,6 +1244,11 @@ var BABYLON;
             }
             return null;
         };
+        Scene.prototype.getMeshesByID = function (id) {
+            return this.meshes.filter(function (m) {
+                return m.id === id;
+            });
+        };
         /**
          * Get a mesh with its auto-generated unique id
          * @param {number} uniqueId - the unique id to search for
@@ -1941,7 +1946,9 @@ var BABYLON;
             // Debug layer
             this.debugLayer.hide();
             // Events
-            this.onDisposeObservable.notifyObservers(this);
+            if (this.onDispose) {
+                this.onDispose();
+            }
             this.onBeforeRenderObservable.clear();
             this.onAfterRenderObservable.clear();
             this.detachControl();

+ 3 - 2
src/babylon.scene.ts

@@ -2361,7 +2361,9 @@
             this.debugLayer.hide();
 
             // Events
-            this.onDisposeObservable.notifyObservers(this);
+            if (this.onDispose) {
+                this.onDispose();
+            }
 
             this.onBeforeRenderObservable.clear();
             this.onAfterRenderObservable.clear();
@@ -2802,4 +2804,3 @@
         }
     }
 }
-