MeshBasicMaterial.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /**
  2. * @author mr.doob / 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. * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ),
  13. * combine: THREE.Multiply,
  14. * reflectivity: <float>,
  15. * refractionRatio: <float>,
  16. *
  17. * shading: THREE.SmoothShading,
  18. * blending: THREE.NormalBlending,
  19. * depthTest: <bool>,
  20. *
  21. * wireframe: <boolean>,
  22. * wireframeLinewidth: <float>,
  23. *
  24. * vertexColors: THREE.NoColors / THREE.VertexColors / THREE.FaceColors,
  25. *
  26. * skinning: <bool>,
  27. * morphTargets: <bool>,
  28. *
  29. * fog: <bool>
  30. * }
  31. */
  32. THREE.MeshBasicMaterial = function ( parameters ) {
  33. THREE.Material.call( this );
  34. this.color = new THREE.Color( 0xffffff ); // emissive
  35. this.map = null;
  36. this.lightMap = null;
  37. this.envMap = null;
  38. this.combine = THREE.MultiplyOperation;
  39. this.reflectivity = 1;
  40. this.refractionRatio = 0.98;
  41. this.fog = true;
  42. this.shading = THREE.SmoothShading;
  43. this.wireframe = false;
  44. this.wireframeLinewidth = 1;
  45. this.wireframeLinecap = 'round';
  46. this.wireframeLinejoin = 'round';
  47. this.vertexColors = THREE.NoColors;
  48. this.skinning = false;
  49. this.morphTargets = false;
  50. this.setValues( parameters );
  51. };
  52. THREE.MeshBasicMaterial.prototype = Object.create( THREE.Material.prototype );
  53. THREE.MeshBasicMaterial.prototype.clone = function () {
  54. var material = new THREE.MeshBasicMaterial();
  55. material.color.copy( this.color );
  56. material.map = this.map;
  57. material.lightMap = this.lightMap;
  58. material.envMap = this.envMap;
  59. material.combine = this.combine;
  60. material.reflectivity = this.reflectivity;
  61. material.refractionRatio = this.refractionRatio;
  62. material.fog = this.fog;
  63. material.shading = this.shading;
  64. material.wireframe = this.wireframe;
  65. material.wireframeLinewidth = this.wireframeLinewidth;
  66. material.wireframeLinecap = this.wireframeLinecap;
  67. material.wireframeLinejoin = this.wireframeLinejoin;
  68. material.vertexColors = this.vertexColors;
  69. material.skinning = this.skinning;
  70. material.morphTargets = this.morphTargets;
  71. return material;
  72. };