Просмотр исходного кода

Merge pull request #2161 from sebavan/Development

Allow full array setter in light include and exclude meshes.
sebavan 8 лет назад
Родитель
Сommit
316e5bc908

Разница между файлами не показана из-за своего большого размера
+ 2769 - 2769
dist/preview release/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 25 - 25
dist/preview release/babylon.js


+ 7 - 2
dist/preview release/babylon.max.js

@@ -12948,10 +12948,10 @@ var BABYLON;
             if (!mesh) {
                 return true;
             }
-            if (this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(mesh) === -1) {
+            if (this.includedOnlyMeshes && this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(mesh) === -1) {
                 return false;
             }
-            if (this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) {
+            if (this.excludedMeshes && this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) {
                 return false;
             }
             if (this.includeOnlyWithLayerMask !== 0 && (this.includeOnlyWithLayerMask & mesh.layerMask) === 0) {
@@ -13109,6 +13109,10 @@ var BABYLON;
                 }
                 return deleted;
             };
+            for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {
+                var item = array_1[_i];
+                item._resyncLighSource(this);
+            }
         };
         Light.prototype._hookArrayForIncludedOnly = function (array) {
             var _this = this;
@@ -13128,6 +13132,7 @@ var BABYLON;
                 _this._resyncMeshes();
                 return deleted;
             };
+            this._resyncMeshes();
         };
         Light.prototype._resyncMeshes = function () {
             for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) {

Разница между файлами не показана из-за своего большого размера
+ 2769 - 2769
dist/preview release/babylon.module.d.ts


Разница между файлами не показана из-за своего большого размера
+ 25 - 25
dist/preview release/babylon.worker.js


+ 8 - 2
src/Lights/babylon.light.ts

@@ -222,11 +222,11 @@
                 return true;
             }
 
-            if (this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(mesh) === -1) {
+            if (this.includedOnlyMeshes && this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(mesh) === -1) {
                 return false;
             }
 
-            if (this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) {
+            if (this.excludedMeshes && this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) {
                 return false;
             }
 
@@ -414,6 +414,10 @@
 
                 return deleted;
             }
+
+            for (var item of array) {
+                item._resyncLighSource(this);
+            }
         }
 
         private _hookArrayForIncludedOnly(array: AbstractMesh[]): void {
@@ -434,6 +438,8 @@
 
                 return deleted;
             }
+
+            this._resyncMeshes();
         }
 
         private _resyncMeshes() {