MeshBasicMaterial.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. * @author alteredq / http://alteredqualia.com/
  4. *
  5. * parameters = {
  6. * color: <hex>,
  7. * opacity: <float>,
  8. * map: new THREE.Texture( <Image> ),
  9. *
  10. * lightMap: 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. * shading: THREE.SmoothShading,
  22. * blending: THREE.NormalBlending,
  23. * depthTest: <bool>,
  24. * depthWrite: <bool>,
  25. *
  26. * wireframe: <boolean>,
  27. * wireframeLinewidth: <float>,
  28. *
  29. * vertexColors: THREE.NoColors / THREE.VertexColors / THREE.FaceColors,
  30. *
  31. * skinning: <bool>,
  32. * morphTargets: <bool>,
  33. *
  34. * fog: <bool>
  35. * }
  36. */
  37. THREE.MeshBasicMaterial = function ( parameters ) {
  38. THREE.Material.call( this );
  39. this.type = 'MeshBasicMaterial';
  40. this.color = new THREE.Color( 0xffffff ); // emissive
  41. this.map = null;
  42. this.lightMap = 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.shading = THREE.SmoothShading;
  51. this.wireframe = false;
  52. this.wireframeLinewidth = 1;
  53. this.wireframeLinecap = 'round';
  54. this.wireframeLinejoin = 'round';
  55. this.vertexColors = THREE.NoColors;
  56. this.skinning = false;
  57. this.morphTargets = false;
  58. this.setValues( parameters );
  59. };
  60. THREE.MeshBasicMaterial.prototype = Object.create( THREE.Material.prototype );
  61. THREE.MeshBasicMaterial.prototype.constructor = THREE.MeshBasicMaterial;
  62. THREE.MeshBasicMaterial.prototype.clone = function () {
  63. var material = new THREE.MeshBasicMaterial();
  64. THREE.Material.prototype.clone.call( this, material );
  65. material.color.copy( this.color );
  66. material.map = this.map;
  67. material.lightMap = this.lightMap;
  68. material.specularMap = this.specularMap;
  69. material.alphaMap = this.alphaMap;
  70. material.envMap = this.envMap;
  71. material.combine = this.combine;
  72. material.reflectivity = this.reflectivity;
  73. material.refractionRatio = this.refractionRatio;
  74. material.fog = this.fog;
  75. material.shading = this.shading;
  76. material.wireframe = this.wireframe;
  77. material.wireframeLinewidth = this.wireframeLinewidth;
  78. material.wireframeLinecap = this.wireframeLinecap;
  79. material.wireframeLinejoin = this.wireframeLinejoin;
  80. material.vertexColors = this.vertexColors;
  81. material.skinning = this.skinning;
  82. material.morphTargets = this.morphTargets;
  83. return material;
  84. };