MeshBasicMaterial.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. import { Material } from './Material.js';
  2. import { MultiplyOperation } from '../constants.js';
  3. import { Color } from '../math/Color.js';
  4. /**
  5. * parameters = {
  6. * color: <hex>,
  7. * opacity: <float>,
  8. * map: new THREE.Texture( <Image> ),
  9. *
  10. * lightMap: new THREE.Texture( <Image> ),
  11. * lightMapIntensity: <float>
  12. *
  13. * aoMap: new THREE.Texture( <Image> ),
  14. * aoMapIntensity: <float>
  15. *
  16. * specularMap: new THREE.Texture( <Image> ),
  17. *
  18. * alphaMap: new THREE.Texture( <Image> ),
  19. *
  20. * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),
  21. * combine: THREE.Multiply,
  22. * reflectivity: <float>,
  23. * refractionRatio: <float>,
  24. *
  25. * depthTest: <bool>,
  26. * depthWrite: <bool>,
  27. *
  28. * wireframe: <boolean>,
  29. * wireframeLinewidth: <float>,
  30. * }
  31. */
  32. class MeshBasicMaterial extends Material {
  33. constructor( parameters ) {
  34. super();
  35. this.type = 'MeshBasicMaterial';
  36. this.color = new Color( 0xffffff ); // emissive
  37. this.map = null;
  38. this.lightMap = null;
  39. this.lightMapIntensity = 1.0;
  40. this.aoMap = null;
  41. this.aoMapIntensity = 1.0;
  42. this.specularMap = null;
  43. this.alphaMap = null;
  44. this.envMap = null;
  45. this.combine = MultiplyOperation;
  46. this.reflectivity = 1;
  47. this.refractionRatio = 0.98;
  48. this.wireframe = false;
  49. this.wireframeLinewidth = 1;
  50. this.wireframeLinecap = 'round';
  51. this.wireframeLinejoin = 'round';
  52. this.setValues( parameters );
  53. }
  54. copy( source ) {
  55. super.copy( source );
  56. this.color.copy( source.color );
  57. this.map = source.map;
  58. this.lightMap = source.lightMap;
  59. this.lightMapIntensity = source.lightMapIntensity;
  60. this.aoMap = source.aoMap;
  61. this.aoMapIntensity = source.aoMapIntensity;
  62. this.specularMap = source.specularMap;
  63. this.alphaMap = source.alphaMap;
  64. this.envMap = source.envMap;
  65. this.combine = source.combine;
  66. this.reflectivity = source.reflectivity;
  67. this.refractionRatio = source.refractionRatio;
  68. this.wireframe = source.wireframe;
  69. this.wireframeLinewidth = source.wireframeLinewidth;
  70. this.wireframeLinecap = source.wireframeLinecap;
  71. this.wireframeLinejoin = source.wireframeLinejoin;
  72. return this;
  73. }
  74. }
  75. MeshBasicMaterial.prototype.isMeshBasicMaterial = true;
  76. export { MeshBasicMaterial };
粤ICP备19079148号