Browse Source

Merge pull request #442 from Palmer-JC/master

added includeOnlyWithLayerMask for filtering meshes
David Catuhe 10 years ago
parent
commit
bac465fadd
1 changed files with 5 additions and 0 deletions
  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;
         }