Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
linbingquan committed Aug 19, 2020
1 parent a21b664 commit 6268611
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 40 deletions.
4 changes: 2 additions & 2 deletions examples/jsm/lines/LineMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ class LineMaterial extends ShaderMaterial {

this.dashed = false;

Object.defineProperty( this, 'isLineMaterial', { value: true } );

Object.defineProperties( this, {

color: {
Expand Down Expand Up @@ -398,6 +400,4 @@ class LineMaterial extends ShaderMaterial {

}

LineMaterial.prototype.isLineMaterial = true;

export { LineMaterial };
4 changes: 2 additions & 2 deletions examples/jsm/nodes/materials/NodeMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class NodeMaterial extends ShaderMaterial {

super();

Object.defineProperty( this, 'isNodeMaterial', { value: true } );

this.vertex = vertex || new RawNode( new PositionNode( PositionNode.PROJECTION ) );
this.fragment = fragment || new RawNode( new ColorNode( 0xFF0000 ) );

Expand Down Expand Up @@ -214,6 +216,4 @@ class NodeMaterial extends ShaderMaterial {

}

NodeMaterial.prototype.isNodeMaterial = true;

export { NodeMaterial };
5 changes: 3 additions & 2 deletions src/materials/LineBasicMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class LineBasicMaterial extends Material {
constructor( parameters ) {

super();

Object.defineProperty( this, 'isLineBasicMaterial', { value: true } );

this.type = 'LineBasicMaterial';

this.color = new Color( 0xffffff );
Expand Down Expand Up @@ -50,6 +53,4 @@ class LineBasicMaterial extends Material {

}

LineBasicMaterial.prototype.isLineBasicMaterial = true;

export { LineBasicMaterial };
4 changes: 2 additions & 2 deletions src/materials/LineDashedMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class LineDashedMaterial extends LineBasicMaterial {

super();

Object.defineProperty( this, 'isLineDashedMaterial', { value: true } );

this.type = 'LineDashedMaterial';

this.scale = 1;
Expand All @@ -43,6 +45,4 @@ class LineDashedMaterial extends LineBasicMaterial {

}

LineDashedMaterial.prototype.isLineDashedMaterial = true;

export { LineDashedMaterial };
4 changes: 2 additions & 2 deletions src/materials/Material.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class Material extends EventDispatcher {

super();

Object.defineProperty( this, 'isMaterial', { value: true } );

Object.defineProperty( this, 'id', { value: materialId ++ } );

this.uuid = MathUtils.generateUUID();
Expand Down Expand Up @@ -440,6 +442,4 @@ class Material extends EventDispatcher {

}

Material.prototype.isMaterial = true;

export { Material };
4 changes: 2 additions & 2 deletions src/materials/MeshBasicMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class MeshBasicMaterial extends Material {

super();

Object.defineProperty( this, 'isMeshBasicMaterial', { value: true } );

this.type = 'MeshBasicMaterial';

this.color = new Color( 0xffffff ); // emissive
Expand Down Expand Up @@ -110,6 +112,4 @@ class MeshBasicMaterial extends Material {

}

MeshBasicMaterial.prototype.isMeshBasicMaterial = true;

export { MeshBasicMaterial };
4 changes: 2 additions & 2 deletions src/materials/MeshDepthMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class MeshDepthMaterial extends Material {

super();

Object.defineProperty( this, 'isMeshDepthMaterial', { value: true } );

this.type = 'MeshDepthMaterial';

this.depthPacking = BasicDepthPacking;
Expand Down Expand Up @@ -75,6 +77,4 @@ class MeshDepthMaterial extends Material {

}

MeshDepthMaterial.prototype.isMeshDepthMaterial = true;

export { MeshDepthMaterial };
4 changes: 2 additions & 2 deletions src/materials/MeshDistanceMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class MeshDistanceMaterial extends Material {

super();

Object.defineProperty( this, 'isMeshDistanceMaterial', { value: true } );

this.type = 'MeshDistanceMaterial';

this.referencePosition = new Vector3();
Expand Down Expand Up @@ -76,6 +78,4 @@ class MeshDistanceMaterial extends Material {

}

MeshDistanceMaterial.prototype.isMeshDistanceMaterial = true;

export { MeshDistanceMaterial };
4 changes: 2 additions & 2 deletions src/materials/MeshLambertMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class MeshLambertMaterial extends Material {

super();

Object.defineProperty( this, 'isMeshLambertMaterial', { value: true } );

this.type = 'MeshLambertMaterial';

this.color = new Color( 0xffffff ); // diffuse
Expand Down Expand Up @@ -123,6 +125,4 @@ class MeshLambertMaterial extends Material {

}

MeshLambertMaterial.prototype.isMeshLambertMaterial = true;

export { MeshLambertMaterial };
4 changes: 2 additions & 2 deletions src/materials/MeshMatcapMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class MeshMatcapMaterial extends Material {

super();

Object.defineProperty( this, 'isMeshMatcapMaterial', { value: true } );

this.defines = { 'MATCAP': '' };

this.type = 'MeshMatcapMaterial';
Expand Down Expand Up @@ -104,6 +106,4 @@ class MeshMatcapMaterial extends Material {

}

MeshMatcapMaterial.prototype.isMeshMatcapMaterial = true;

export { MeshMatcapMaterial };
4 changes: 2 additions & 2 deletions src/materials/MeshNormalMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class MeshNormalMaterial extends Material {

super();

Object.defineProperty( this, 'isMeshNormalMaterial', { value: true } );

this.type = 'MeshNormalMaterial';

this.bumpMap = null;
Expand Down Expand Up @@ -86,6 +88,4 @@ class MeshNormalMaterial extends Material {

}

MeshNormalMaterial.prototype.isMeshNormalMaterial = true;

export { MeshNormalMaterial };
4 changes: 2 additions & 2 deletions src/materials/MeshPhongMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class MeshPhongMaterial extends Material {

super();

Object.defineProperty( this, 'isMeshPhongMaterial', { value: true } );

this.type = 'MeshPhongMaterial';

this.color = new Color( 0xffffff ); // diffuse
Expand Down Expand Up @@ -163,6 +165,4 @@ class MeshPhongMaterial extends Material {

}

MeshPhongMaterial.prototype.isMeshPhongMaterial = true;

export { MeshPhongMaterial };
4 changes: 2 additions & 2 deletions src/materials/MeshPhysicalMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {

super();

Object.defineProperty( this, 'isMeshPhysicalMaterial', { value: true } );

this.defines = {

'STANDARD': '',
Expand Down Expand Up @@ -92,6 +94,4 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {

}

MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true;

export { MeshPhysicalMaterial };
4 changes: 2 additions & 2 deletions src/materials/MeshStandardMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class MeshStandardMaterial extends Material {

super();

Object.defineProperty( this, 'isMeshStandardMaterial', { value: true } );

this.defines = { 'STANDARD': '' };

this.type = 'MeshStandardMaterial';
Expand Down Expand Up @@ -177,6 +179,4 @@ class MeshStandardMaterial extends Material {

}

MeshStandardMaterial.prototype.isMeshStandardMaterial = true;

export { MeshStandardMaterial };
4 changes: 2 additions & 2 deletions src/materials/MeshToonMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class MeshToonMaterial extends Material {

super();

Object.defineProperty( this, 'isMeshToonMaterial', { value: true } );

this.defines = { 'TOON': '' };

this.type = 'MeshToonMaterial';
Expand Down Expand Up @@ -140,6 +142,4 @@ class MeshToonMaterial extends Material {

}

MeshToonMaterial.prototype.isMeshToonMaterial = true;

export { MeshToonMaterial };
4 changes: 2 additions & 2 deletions src/materials/PointsMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class PointsMaterial extends Material {

super();

Object.defineProperty( this, 'isPointsMaterial', { value: true } );

this.type = 'PointsMaterial';

this.color = new Color( 0xffffff );
Expand Down Expand Up @@ -59,6 +61,4 @@ class PointsMaterial extends Material {

}

PointsMaterial.prototype.isPointsMaterial = true;

export { PointsMaterial };
4 changes: 2 additions & 2 deletions src/materials/RawShaderMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
4 changes: 2 additions & 2 deletions src/materials/ShaderMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class ShaderMaterial extends Material {

super();

Object.defineProperty( this, 'isShaderMaterial', { value: true } );

this.type = 'ShaderMaterial';

this.defines = {};
Expand Down Expand Up @@ -212,6 +214,4 @@ class ShaderMaterial extends Material {

}

ShaderMaterial.prototype.isShaderMaterial = true;

export { ShaderMaterial };
4 changes: 2 additions & 2 deletions src/materials/ShadowMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class ShadowMaterial extends Material {

super();

Object.defineProperty( this, 'isShadowMaterial', { value: true } );

this.type = 'ShadowMaterial';

this.color = new Color( 0x000000 );
Expand All @@ -34,6 +36,4 @@ class ShadowMaterial extends Material {

}

ShadowMaterial.prototype.isShadowMaterial = true;

export { ShadowMaterial };
4 changes: 2 additions & 2 deletions src/materials/SpriteMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class SpriteMaterial extends Material {

super();

Object.defineProperty( this, 'isSpriteMaterial', { value: true } );

this.type = 'SpriteMaterial';

this.color = new Color( 0xffffff );
Expand Down Expand Up @@ -55,6 +57,4 @@ class SpriteMaterial extends Material {

}

SpriteMaterial.prototype.isSpriteMaterial = true;

export { SpriteMaterial };

0 comments on commit 6268611

Please sign in to comment.