提交 0dac7b9c 编写于 作者: J Jean Carlo Deconto

fix copy material

上级 143b519d
...@@ -112,59 +112,64 @@ THREE.MeshPhongMaterial = function ( parameters ) { ...@@ -112,59 +112,64 @@ THREE.MeshPhongMaterial = function ( parameters ) {
THREE.MeshPhongMaterial.prototype = Object.create( THREE.Material.prototype ); THREE.MeshPhongMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.MeshPhongMaterial.prototype.constructor = THREE.MeshPhongMaterial; THREE.MeshPhongMaterial.prototype.constructor = THREE.MeshPhongMaterial;
THREE.MeshPhongMaterial.prototype.clone = function () { THREE.MeshPhongMaterial.prototype.copy = function ( source ) {
var material = new THREE.MeshPhongMaterial(); THREE.Material.prototype.copy.call( this, source );
THREE.Material.prototype.clone.call( this, material ); this.color.copy( source.color );
this.emissive.copy( source.emissive );
this.specular.copy( source.specular );
this.shininess = source.shininess;
material.color.copy( this.color ); this.metal = source.metal;
material.emissive.copy( this.emissive );
material.specular.copy( this.specular );
material.shininess = this.shininess;
material.metal = this.metal; this.map = source.map;
material.map = this.map; this.lightMap = source.lightMap;
this.lightMapIntensity = source.lightMapIntensity;
material.lightMap = this.lightMap; this.aoMap = source.aoMap;
material.lightMapIntensity = this.lightMapIntensity; this.aoMapIntensity = source.aoMapIntensity;
material.aoMap = this.aoMap; this.emissiveMap = source.emissiveMap;
material.aoMapIntensity = this.aoMapIntensity;
material.emissiveMap = this.emissiveMap; this.bumpMap = source.bumpMap;
this.bumpScale = source.bumpScale;
material.bumpMap = this.bumpMap; this.normalMap = source.normalMap;
material.bumpScale = this.bumpScale; this.normalScale.copy( source.normalScale );
material.normalMap = this.normalMap; this.specularMap = source.specularMap;
material.normalScale.copy( this.normalScale );
material.specularMap = this.specularMap; this.alphaMap = source.alphaMap;
material.alphaMap = this.alphaMap; this.envMap = source.envMap;
this.combine = source.combine;
this.reflectivity = source.reflectivity;
this.refractionRatio = source.refractionRatio;
material.envMap = this.envMap; this.fog = source.fog;
material.combine = this.combine;
material.reflectivity = this.reflectivity;
material.refractionRatio = this.refractionRatio;
material.fog = this.fog; this.shading = source.shading;
material.shading = this.shading; this.wireframe = source.wireframe;
this.wireframeLinewidth = source.wireframeLinewidth;
this.wireframeLinecap = source.wireframeLinecap;
this.wireframeLinejoin = source.wireframeLinejoin;
material.wireframe = this.wireframe; this.vertexColors = source.vertexColors;
material.wireframeLinewidth = this.wireframeLinewidth;
material.wireframeLinecap = this.wireframeLinecap;
material.wireframeLinejoin = this.wireframeLinejoin;
material.vertexColors = this.vertexColors; this.skinning = source.skinning;
this.morphTargets = source.morphTargets;
this.morphNormals = source.morphNormals;
material.skinning = this.skinning; return this;
material.morphTargets = this.morphTargets;
material.morphNormals = this.morphNormals; };
return material; THREE.MeshPhongMaterial.prototype.clone = function () {
var material = new THREE.MeshPhongMaterial();
return material.copy( this );
}; };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册