@@ -34,6 +34,12 @@ THREE.Layers.prototype = {
this.mask &= ~ ( 1 << channel );
+ },
+
+ test: function ( layers ) {
+ return ( this.mask & layers.mask ) !== 0;
}
};
@@ -1240,7 +1240,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( object.visible === false ) return;
- if ( ( object.layers.mask & camera.layers.mask ) !== 0 ) {
+ if ( object.layers.test( camera.layers ) ) {
if ( object instanceof THREE.Light ) {