UNPKG

three

Version:

JavaScript 3D library

104 lines (76 loc) 2.4 kB
/** * @author mrdoob / http://mrdoob.com/ * @author alteredq / http://alteredqualia.com/ * * parameters = { * color: <hex>, * opacity: <float>, * map: new THREE.Texture( <Image> ), * * aoMap: new THREE.Texture( <Image> ), * aoMapIntensity: <float> * * specularMap: new THREE.Texture( <Image> ), * * alphaMap: new THREE.Texture( <Image> ), * * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ), * combine: THREE.Multiply, * reflectivity: <float>, * refractionRatio: <float>, * * shading: THREE.SmoothShading, * depthTest: <bool>, * depthWrite: <bool>, * * wireframe: <boolean>, * wireframeLinewidth: <float>, * * skinning: <bool>, * morphTargets: <bool> * } */ THREE.MeshBasicMaterial = function ( parameters ) { THREE.Material.call( this ); this.type = 'MeshBasicMaterial'; this.color = new THREE.Color( 0xffffff ); // emissive this.map = null; this.aoMap = null; this.aoMapIntensity = 1.0; this.specularMap = null; this.alphaMap = null; this.envMap = null; this.combine = THREE.MultiplyOperation; this.reflectivity = 1; this.refractionRatio = 0.98; this.wireframe = false; this.wireframeLinewidth = 1; this.wireframeLinecap = 'round'; this.wireframeLinejoin = 'round'; this.skinning = false; this.morphTargets = false; this.lights = false; this.setValues( parameters ); }; THREE.MeshBasicMaterial.prototype = Object.create( THREE.Material.prototype ); THREE.MeshBasicMaterial.prototype.constructor = THREE.MeshBasicMaterial; THREE.MeshBasicMaterial.prototype.copy = function ( source ) { THREE.Material.prototype.copy.call( this, source ); this.color.copy( source.color ); this.map = source.map; this.aoMap = source.aoMap; this.aoMapIntensity = source.aoMapIntensity; this.specularMap = source.specularMap; this.alphaMap = source.alphaMap; this.envMap = source.envMap; this.combine = source.combine; this.reflectivity = source.reflectivity; this.refractionRatio = source.refractionRatio; this.wireframe = source.wireframe; this.wireframeLinewidth = source.wireframeLinewidth; this.wireframeLinecap = source.wireframeLinecap; this.wireframeLinejoin = source.wireframeLinejoin; this.skinning = source.skinning; this.morphTargets = source.morphTargets; return this; };