LineBasicMaterial.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { Material } from './Material.js';
  2. import { Color } from '../math/Color.js';
  3. /**
  4. * @author mrdoob / http://mrdoob.com/
  5. * @author alteredq / http://alteredqualia.com/
  6. *
  7. * parameters = {
  8. * color: <hex>,
  9. * opacity: <float>,
  10. *
  11. * linewidth: <float>,
  12. * linecap: "round",
  13. * linejoin: "round"
  14. * }
  15. */
  16. function LineBasicMaterial( parameters ) {
  17. Material.call( this );
  18. this.type = 'LineBasicMaterial';
  19. this.color = new Color( 0xffffff );
  20. this.linewidth = 1;
  21. this.linecap = 'round';
  22. this.linejoin = 'round';
  23. this.setValues( parameters );
  24. }
  25. LineBasicMaterial.prototype = Object.create( Material.prototype );
  26. LineBasicMaterial.prototype.constructor = LineBasicMaterial;
  27. LineBasicMaterial.prototype.isLineBasicMaterial = true;
  28. LineBasicMaterial.prototype.copy = function ( source ) {
  29. Material.prototype.copy.call( this, source );
  30. this.color.copy( source.color );
  31. this.linewidth = source.linewidth;
  32. this.linecap = source.linecap;
  33. this.linejoin = source.linejoin;
  34. return this;
  35. };
  36. export { LineBasicMaterial };
粤ICP备19079148号