MeshNormalMaterial.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { TangentSpaceNormalMap } from '../constants.js';
  2. import { Material } from './Material.js';
  3. import { Vector2 } from '../math/Vector2.js';
  4. class MeshNormalMaterial extends Material {
  5. constructor( parameters ) {
  6. super();
  7. this.isMeshNormalMaterial = true;
  8. this.type = 'MeshNormalMaterial';
  9. this.bumpMap = null;
  10. this.bumpScale = 1;
  11. this.normalMap = null;
  12. this.normalMapType = TangentSpaceNormalMap;
  13. this.normalScale = new Vector2( 1, 1 );
  14. this.displacementMap = null;
  15. this.displacementScale = 1;
  16. this.displacementBias = 0;
  17. this.wireframe = false;
  18. this.wireframeLinewidth = 1;
  19. this.flatShading = false;
  20. this.setValues( parameters );
  21. }
  22. copy( source ) {
  23. super.copy( source );
  24. this.bumpMap = source.bumpMap;
  25. this.bumpScale = source.bumpScale;
  26. this.normalMap = source.normalMap;
  27. this.normalMapType = source.normalMapType;
  28. this.normalScale.copy( source.normalScale );
  29. this.displacementMap = source.displacementMap;
  30. this.displacementScale = source.displacementScale;
  31. this.displacementBias = source.displacementBias;
  32. this.wireframe = source.wireframe;
  33. this.wireframeLinewidth = source.wireframeLinewidth;
  34. this.flatShading = source.flatShading;
  35. return this;
  36. }
  37. }
  38. export { MeshNormalMaterial };