Browse Source

Revert to *.prototype.is* = true

linbingquan 4 years ago
parent
commit
c627d68af7

+ 2 - 2
src/materials/LineBasicMaterial.js

@@ -18,8 +18,6 @@ class LineBasicMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isLineBasicMaterial', { value: true } );
-
 		this.type = 'LineBasicMaterial';
 
 		this.color = new Color( 0xffffff );
@@ -53,4 +51,6 @@ class LineBasicMaterial extends Material {
 
 }
 
+LineBasicMaterial.prototype.isLineBasicMaterial = true;
+
 export { LineBasicMaterial };

+ 2 - 2
src/materials/LineDashedMaterial.js

@@ -19,8 +19,6 @@ class LineDashedMaterial extends LineBasicMaterial {
 
 		super();
 
-		Object.defineProperty( this, 'isLineDashedMaterial', { value: true } );
-
 		this.type = 'LineDashedMaterial';
 
 		this.scale = 1;
@@ -45,4 +43,6 @@ class LineDashedMaterial extends LineBasicMaterial {
 
 }
 
+LineDashedMaterial.prototype.isLineDashedMaterial = true;
+
 export { LineDashedMaterial };

+ 2 - 2
src/materials/MeshBasicMaterial.js

@@ -40,8 +40,6 @@ class MeshBasicMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isMeshBasicMaterial', { value: true } );
-
 		this.type = 'MeshBasicMaterial';
 
 		this.color = new Color( 0xffffff ); // emissive
@@ -112,4 +110,6 @@ class MeshBasicMaterial extends Material {
 
 }
 
+MeshBasicMaterial.prototype.isMeshBasicMaterial = true;
+
 export { MeshBasicMaterial };

+ 2 - 2
src/materials/MeshDepthMaterial.js

@@ -25,8 +25,6 @@ class MeshDepthMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isMeshDepthMaterial', { value: true } );
-
 		this.type = 'MeshDepthMaterial';
 
 		this.depthPacking = BasicDepthPacking;
@@ -77,4 +75,6 @@ class MeshDepthMaterial extends Material {
 
 }
 
+MeshDepthMaterial.prototype.isMeshDepthMaterial = true;
+
 export { MeshDepthMaterial };

+ 2 - 2
src/materials/MeshDistanceMaterial.js

@@ -28,8 +28,6 @@ class MeshDistanceMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isMeshDistanceMaterial', { value: true } );
-
 		this.type = 'MeshDistanceMaterial';
 
 		this.referencePosition = new Vector3();
@@ -78,4 +76,6 @@ class MeshDistanceMaterial extends Material {
 
 }
 
+MeshDistanceMaterial.prototype.isMeshDistanceMaterial = true;
+
 export { MeshDistanceMaterial };

+ 2 - 2
src/materials/MeshLambertMaterial.js

@@ -43,8 +43,6 @@ class MeshLambertMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isMeshLambertMaterial', { value: true } );
-
 		this.type = 'MeshLambertMaterial';
 
 		this.color = new Color( 0xffffff ); // diffuse
@@ -125,4 +123,6 @@ class MeshLambertMaterial extends Material {
 
 }
 
+MeshLambertMaterial.prototype.isMeshLambertMaterial = true;
+
 export { MeshLambertMaterial };

+ 2 - 2
src/materials/MeshMatcapMaterial.js

@@ -39,8 +39,6 @@ class MeshMatcapMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isMeshMatcapMaterial', { value: true } );
-
 		this.defines = { 'MATCAP': '' };
 
 		this.type = 'MeshMatcapMaterial';
@@ -112,4 +110,6 @@ class MeshMatcapMaterial extends Material {
 
 }
 
+MeshMatcapMaterial.prototype.isMeshMatcapMaterial = true;
+
 export { MeshMatcapMaterial };

+ 2 - 2
src/materials/MeshNormalMaterial.js

@@ -34,8 +34,6 @@ class MeshNormalMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isMeshNormalMaterial', { value: true } );
-
 		this.type = 'MeshNormalMaterial';
 
 		this.bumpMap = null;
@@ -94,4 +92,6 @@ class MeshNormalMaterial extends Material {
 
 }
 
+MeshNormalMaterial.prototype.isMeshNormalMaterial = true;
+
 export { MeshNormalMaterial };

+ 2 - 2
src/materials/MeshPhongMaterial.js

@@ -59,8 +59,6 @@ class MeshPhongMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isMeshPhongMaterial', { value: true } );
-
 		this.type = 'MeshPhongMaterial';
 
 		this.color = new Color( 0xffffff ); // diffuse
@@ -171,4 +169,6 @@ class MeshPhongMaterial extends Material {
 
 }
 
+MeshPhongMaterial.prototype.isMeshPhongMaterial = true;
+
 export { MeshPhongMaterial };

+ 2 - 2
src/materials/MeshPhysicalMaterial.js

@@ -28,8 +28,6 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
 
 		super();
 
-		Object.defineProperty( this, 'isMeshPhysicalMaterial', { value: true } );
-
 		this.defines = {
 
 			'STANDARD': '',
@@ -110,4 +108,6 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
 
 }
 
+MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true;
+
 export { MeshPhysicalMaterial };

+ 2 - 2
src/materials/MeshStandardMaterial.js

@@ -61,8 +61,6 @@ class MeshStandardMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isMeshStandardMaterial', { value: true } );
-
 		this.defines = { 'STANDARD': '' };
 
 		this.type = 'MeshStandardMaterial';
@@ -185,4 +183,6 @@ class MeshStandardMaterial extends Material {
 
 }
 
+MeshStandardMaterial.prototype.isMeshStandardMaterial = true;
+
 export { MeshStandardMaterial };

+ 2 - 2
src/materials/MeshToonMaterial.js

@@ -48,8 +48,6 @@ class MeshToonMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isMeshToonMaterial', { value: true } );
-
 		this.defines = { 'TOON': '' };
 
 		this.type = 'MeshToonMaterial';
@@ -142,4 +140,6 @@ class MeshToonMaterial extends Material {
 
 }
 
+MeshToonMaterial.prototype.isMeshToonMaterial = true;
+
 export { MeshToonMaterial };

+ 2 - 2
src/materials/PointsMaterial.js

@@ -21,8 +21,6 @@ class PointsMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isPointsMaterial', { value: true } );
-
 		this.type = 'PointsMaterial';
 
 		this.color = new Color( 0xffffff );
@@ -61,4 +59,6 @@ class PointsMaterial extends Material {
 
 }
 
+PointsMaterial.prototype.isPointsMaterial = true;
+
 export { PointsMaterial };

+ 2 - 2
src/materials/RawShaderMaterial.js

@@ -6,12 +6,12 @@ class RawShaderMaterial extends ShaderMaterial {
 
 		super( parameters );
 
-		Object.defineProperty( this, 'isRawShaderMaterial', { value: true } );
-
 		this.type = 'RawShaderMaterial';
 
 	}
 
 }
 
+RawShaderMaterial.prototype.isRawShaderMaterial = true;
+
 export { RawShaderMaterial };

+ 2 - 2
src/materials/ShadowMaterial.js

@@ -13,8 +13,6 @@ class ShadowMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isShadowMaterial', { value: true } );
-
 		this.type = 'ShadowMaterial';
 
 		this.color = new Color( 0x000000 );
@@ -36,4 +34,6 @@ class ShadowMaterial extends Material {
 
 }
 
+ShadowMaterial.prototype.isShadowMaterial = true;
+
 export { ShadowMaterial };

+ 2 - 2
src/materials/SpriteMaterial.js

@@ -17,8 +17,6 @@ class SpriteMaterial extends Material {
 
 		super();
 
-		Object.defineProperty( this, 'isSpriteMaterial', { value: true } );
-
 		this.type = 'SpriteMaterial';
 
 		this.color = new Color( 0xffffff );
@@ -57,4 +55,6 @@ class SpriteMaterial extends Material {
 
 }
 
+SpriteMaterial.prototype.isSpriteMaterial = true;
+
 export { SpriteMaterial };