|
@@ -55,134 +55,134 @@ import { Color } from '../math/Color.js';
|
|
|
* }
|
|
|
*/
|
|
|
|
|
|
-function MeshStandardMaterial( parameters ) {
|
|
|
+class MeshStandardMaterial extends Material {
|
|
|
|
|
|
- Material.call( this );
|
|
|
+ constructor( parameters ) {
|
|
|
|
|
|
- this.defines = { 'STANDARD': '' };
|
|
|
+ super();
|
|
|
|
|
|
- this.type = 'MeshStandardMaterial';
|
|
|
+ this.defines = { 'STANDARD': '' };
|
|
|
|
|
|
- this.color = new Color( 0xffffff ); // diffuse
|
|
|
- this.roughness = 1.0;
|
|
|
- this.metalness = 0.0;
|
|
|
+ this.type = 'MeshStandardMaterial';
|
|
|
|
|
|
- this.map = null;
|
|
|
+ this.color = new Color( 0xffffff ); // diffuse
|
|
|
+ this.roughness = 1.0;
|
|
|
+ this.metalness = 0.0;
|
|
|
|
|
|
- this.lightMap = null;
|
|
|
- this.lightMapIntensity = 1.0;
|
|
|
+ this.map = null;
|
|
|
|
|
|
- this.aoMap = null;
|
|
|
- this.aoMapIntensity = 1.0;
|
|
|
+ this.lightMap = null;
|
|
|
+ this.lightMapIntensity = 1.0;
|
|
|
|
|
|
- this.emissive = new Color( 0x000000 );
|
|
|
- this.emissiveIntensity = 1.0;
|
|
|
- this.emissiveMap = null;
|
|
|
+ this.aoMap = null;
|
|
|
+ this.aoMapIntensity = 1.0;
|
|
|
|
|
|
- this.bumpMap = null;
|
|
|
- this.bumpScale = 1;
|
|
|
+ this.emissive = new Color( 0x000000 );
|
|
|
+ this.emissiveIntensity = 1.0;
|
|
|
+ this.emissiveMap = null;
|
|
|
|
|
|
- this.normalMap = null;
|
|
|
- this.normalMapType = TangentSpaceNormalMap;
|
|
|
- this.normalScale = new Vector2( 1, 1 );
|
|
|
+ this.bumpMap = null;
|
|
|
+ this.bumpScale = 1;
|
|
|
|
|
|
- this.displacementMap = null;
|
|
|
- this.displacementScale = 1;
|
|
|
- this.displacementBias = 0;
|
|
|
+ this.normalMap = null;
|
|
|
+ this.normalMapType = TangentSpaceNormalMap;
|
|
|
+ this.normalScale = new Vector2( 1, 1 );
|
|
|
|
|
|
- this.roughnessMap = null;
|
|
|
+ this.displacementMap = null;
|
|
|
+ this.displacementScale = 1;
|
|
|
+ this.displacementBias = 0;
|
|
|
|
|
|
- this.metalnessMap = null;
|
|
|
+ this.roughnessMap = null;
|
|
|
|
|
|
- this.alphaMap = null;
|
|
|
+ this.metalnessMap = null;
|
|
|
|
|
|
- this.envMap = null;
|
|
|
- this.envMapIntensity = 1.0;
|
|
|
+ this.alphaMap = null;
|
|
|
|
|
|
- this.refractionRatio = 0.98;
|
|
|
+ this.envMap = null;
|
|
|
+ this.envMapIntensity = 1.0;
|
|
|
|
|
|
- this.wireframe = false;
|
|
|
- this.wireframeLinewidth = 1;
|
|
|
- this.wireframeLinecap = 'round';
|
|
|
- this.wireframeLinejoin = 'round';
|
|
|
+ this.refractionRatio = 0.98;
|
|
|
|
|
|
- this.skinning = false;
|
|
|
- this.morphTargets = false;
|
|
|
- this.morphNormals = false;
|
|
|
+ this.wireframe = false;
|
|
|
+ this.wireframeLinewidth = 1;
|
|
|
+ this.wireframeLinecap = 'round';
|
|
|
+ this.wireframeLinejoin = 'round';
|
|
|
|
|
|
- this.flatShading = false;
|
|
|
+ this.skinning = false;
|
|
|
+ this.morphTargets = false;
|
|
|
+ this.morphNormals = false;
|
|
|
|
|
|
- this.vertexTangents = false;
|
|
|
+ this.flatShading = false;
|
|
|
|
|
|
- this.setValues( parameters );
|
|
|
+ this.vertexTangents = false;
|
|
|
|
|
|
-}
|
|
|
+ this.setValues( parameters );
|
|
|
|
|
|
-MeshStandardMaterial.prototype = Object.create( Material.prototype );
|
|
|
-MeshStandardMaterial.prototype.constructor = MeshStandardMaterial;
|
|
|
+ }
|
|
|
|
|
|
-MeshStandardMaterial.prototype.isMeshStandardMaterial = true;
|
|
|
+ copy( source ) {
|
|
|
|
|
|
-MeshStandardMaterial.prototype.copy = function ( source ) {
|
|
|
+ super.copy( source );
|
|
|
|
|
|
- Material.prototype.copy.call( this, source );
|
|
|
+ this.defines = { 'STANDARD': '' };
|
|
|
|
|
|
- this.defines = { 'STANDARD': '' };
|
|
|
+ this.color.copy( source.color );
|
|
|
+ this.roughness = source.roughness;
|
|
|
+ this.metalness = source.metalness;
|
|
|
|
|
|
- this.color.copy( source.color );
|
|
|
- this.roughness = source.roughness;
|
|
|
- this.metalness = source.metalness;
|
|
|
+ this.map = source.map;
|
|
|
|
|
|
- this.map = source.map;
|
|
|
+ this.lightMap = source.lightMap;
|
|
|
+ this.lightMapIntensity = source.lightMapIntensity;
|
|
|
|
|
|
- this.lightMap = source.lightMap;
|
|
|
- this.lightMapIntensity = source.lightMapIntensity;
|
|
|
+ this.aoMap = source.aoMap;
|
|
|
+ this.aoMapIntensity = source.aoMapIntensity;
|
|
|
|
|
|
- this.aoMap = source.aoMap;
|
|
|
- this.aoMapIntensity = source.aoMapIntensity;
|
|
|
+ this.emissive.copy( source.emissive );
|
|
|
+ this.emissiveMap = source.emissiveMap;
|
|
|
+ this.emissiveIntensity = source.emissiveIntensity;
|
|
|
|
|
|
- this.emissive.copy( source.emissive );
|
|
|
- this.emissiveMap = source.emissiveMap;
|
|
|
- this.emissiveIntensity = source.emissiveIntensity;
|
|
|
+ this.bumpMap = source.bumpMap;
|
|
|
+ this.bumpScale = source.bumpScale;
|
|
|
|
|
|
- this.bumpMap = source.bumpMap;
|
|
|
- this.bumpScale = source.bumpScale;
|
|
|
+ this.normalMap = source.normalMap;
|
|
|
+ this.normalMapType = source.normalMapType;
|
|
|
+ this.normalScale.copy( source.normalScale );
|
|
|
|
|
|
- this.normalMap = source.normalMap;
|
|
|
- this.normalMapType = source.normalMapType;
|
|
|
- this.normalScale.copy( source.normalScale );
|
|
|
+ this.displacementMap = source.displacementMap;
|
|
|
+ this.displacementScale = source.displacementScale;
|
|
|
+ this.displacementBias = source.displacementBias;
|
|
|
|
|
|
- this.displacementMap = source.displacementMap;
|
|
|
- this.displacementScale = source.displacementScale;
|
|
|
- this.displacementBias = source.displacementBias;
|
|
|
+ this.roughnessMap = source.roughnessMap;
|
|
|
|
|
|
- this.roughnessMap = source.roughnessMap;
|
|
|
+ this.metalnessMap = source.metalnessMap;
|
|
|
|
|
|
- this.metalnessMap = source.metalnessMap;
|
|
|
+ this.alphaMap = source.alphaMap;
|
|
|
|
|
|
- this.alphaMap = source.alphaMap;
|
|
|
+ this.envMap = source.envMap;
|
|
|
+ this.envMapIntensity = source.envMapIntensity;
|
|
|
|
|
|
- this.envMap = source.envMap;
|
|
|
- this.envMapIntensity = source.envMapIntensity;
|
|
|
+ this.refractionRatio = source.refractionRatio;
|
|
|
|
|
|
- this.refractionRatio = source.refractionRatio;
|
|
|
+ this.wireframe = source.wireframe;
|
|
|
+ this.wireframeLinewidth = source.wireframeLinewidth;
|
|
|
+ this.wireframeLinecap = source.wireframeLinecap;
|
|
|
+ this.wireframeLinejoin = source.wireframeLinejoin;
|
|
|
|
|
|
- this.wireframe = source.wireframe;
|
|
|
- this.wireframeLinewidth = source.wireframeLinewidth;
|
|
|
- this.wireframeLinecap = source.wireframeLinecap;
|
|
|
- this.wireframeLinejoin = source.wireframeLinejoin;
|
|
|
+ this.skinning = source.skinning;
|
|
|
+ this.morphTargets = source.morphTargets;
|
|
|
+ this.morphNormals = source.morphNormals;
|
|
|
|
|
|
- this.skinning = source.skinning;
|
|
|
- this.morphTargets = source.morphTargets;
|
|
|
- this.morphNormals = source.morphNormals;
|
|
|
+ this.flatShading = source.flatShading;
|
|
|
|
|
|
- this.flatShading = source.flatShading;
|
|
|
+ this.vertexTangents = source.vertexTangents;
|
|
|
|
|
|
- this.vertexTangents = source.vertexTangents;
|
|
|
+ return this;
|
|
|
|
|
|
- return this;
|
|
|
+ }
|
|
|
|
|
|
-};
|
|
|
+}
|
|
|
|
|
|
+MeshStandardMaterial.prototype.isMeshStandardMaterial = true;
|
|
|
|
|
|
export { MeshStandardMaterial };
|