MeshLambertMaterial.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. * @author alteredq / http://alteredqualia.com/
  4. *
  5. * parameters = {
  6. * color: <hex>,
  7. * emissive: <hex>,
  8. * opacity: <float>,
  9. *
  10. * map: new THREE.Texture( <Image> ),
  11. *
  12. * specularMap: new THREE.Texture( <Image> ),
  13. *
  14. * alphaMap: new THREE.Texture( <Image> ),
  15. *
  16. * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ),
  17. * combine: THREE.Multiply,
  18. * reflectivity: <float>,
  19. * refractionRatio: <float>,
  20. *
  21. * blending: THREE.NormalBlending,
  22. * depthTest: <bool>,
  23. * depthWrite: <bool>,
  24. *
  25. * wireframe: <boolean>,
  26. * wireframeLinewidth: <float>,
  27. *
  28. * vertexColors: THREE.NoColors / THREE.VertexColors / THREE.FaceColors,
  29. *
  30. * skinning: <bool>,
  31. * morphTargets: <bool>,
  32. * morphNormals: <bool>,
  33. *
  34. * fog: <bool>
  35. * }
  36. */
  37. THREE.MeshLambertMaterial = function ( parameters ) {
  38. THREE.Material.call( this );
  39. this.type = 'MeshLambertMaterial';
  40. this.color = new THREE.Color( 0xffffff ); // diffuse
  41. this.emissive = new THREE.Color( 0x000000 );
  42. this.map = null;
  43. this.specularMap = null;
  44. this.alphaMap = null;
  45. this.envMap = null;
  46. this.combine = THREE.MultiplyOperation;
  47. this.reflectivity = 1;
  48. this.refractionRatio = 0.98;
  49. this.fog = true;
  50. this.wireframe = false;
  51. this.wireframeLinewidth = 1;
  52. this.wireframeLinecap = 'round';
  53. this.wireframeLinejoin = 'round';
  54. this.vertexColors = THREE.NoColors;
  55. this.skinning = false;
  56. this.morphTargets = false;
  57. this.morphNormals = false;
  58. this.setValues( parameters );
  59. };
  60. THREE.MeshLambertMaterial.prototype = Object.create( THREE.Material.prototype );
  61. THREE.MeshLambertMaterial.prototype.constructor = THREE.MeshLambertMaterial;
  62. THREE.MeshLambertMaterial.prototype.copy = function ( source ) {
  63. THREE.Material.prototype.copy.call( this, source );
  64. this.color.copy( source.color );
  65. this.emissive.copy( source.emissive );
  66. this.map = source.map;
  67. this.specularMap = source.specularMap;
  68. this.alphaMap = source.alphaMap;
  69. this.envMap = source.envMap;
  70. this.combine = source.combine;
  71. this.reflectivity = source.reflectivity;
  72. this.refractionRatio = source.refractionRatio;
  73. this.fog = source.fog;
  74. this.wireframe = source.wireframe;
  75. this.wireframeLinewidth = source.wireframeLinewidth;
  76. this.wireframeLinecap = source.wireframeLinecap;
  77. this.wireframeLinejoin = source.wireframeLinejoin;
  78. this.vertexColors = source.vertexColors;
  79. this.skinning = source.skinning;
  80. this.morphTargets = source.morphTargets;
  81. this.morphNormals = source.morphNormals;
  82. return this;
  83. };
粤ICP备19079148号