This reduces the need to access Layers.mask directly when code needs to enable/disable all layers on an object.
@@ -80,6 +80,16 @@
Toggle membership of *layer*.
</p>
+ <h3>[method:null enableAll]()</h3>
+ <p>
+ Add membership to all layers.
+ </p>
+
+ <h3>[method:null disableAll]()</h3>
+ Remove membership from all layers.
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
@@ -10,4 +10,7 @@ export class Layers {
disable( channel: number ): void;
test( layers: Layers ): boolean;
+ enableAll (): void;
+ disableAll (): void;
}
@@ -38,6 +38,18 @@ Object.assign( Layers.prototype, {
return ( this.mask & layers.mask ) !== 0;
+ },
+ enableAll: function () {
+ this.mask = 0xffffffff | 0;
+ disableAll: function () {
+ this.mask = 0;
} );