浏览代码

added includeOnlyWithLayerMask for filtering meshes

jeff Palmer 10 年之前
父节点
当前提交
7920d8d8a7
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Babylon/Lights/babylon.light.ts

+ 5 - 0
Babylon/Lights/babylon.light.ts

@@ -22,6 +22,7 @@
         public specular = new Color3(1.0, 1.0, 1.0);
         public intensity = 1.0;
         public range = Number.MAX_VALUE;
+        public includeOnlyWithLayerMask = 0;
         public includedOnlyMeshes = new Array<AbstractMesh>();
         public excludedMeshes = new Array<AbstractMesh>();
 
@@ -63,6 +64,10 @@
             if (this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) {
                 return false;
             }
+            
+            if (this.includeOnlyWithLayerMask !== 0 && this.includeOnlyWithLayerMask !== mesh.layerMask){
+                return false;
+            }
 
             return true;
         }