LineBasicMaterial.js 799 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { Material } from './Material.js';
  2. import { Color } from '../math/Color.js';
  3. /**
  4. * parameters = {
  5. * color: <hex>,
  6. * opacity: <float>,
  7. *
  8. * linewidth: <float>,
  9. * linecap: "round",
  10. * linejoin: "round"
  11. * }
  12. */
  13. class LineBasicMaterial extends Material {
  14. constructor( parameters ) {
  15. super();
  16. this.type = 'LineBasicMaterial';
  17. this.color = new Color( 0xffffff );
  18. this.linewidth = 1;
  19. this.linecap = 'round';
  20. this.linejoin = 'round';
  21. this.setValues( parameters );
  22. }
  23. copy( source ) {
  24. super.copy( source );
  25. this.color.copy( source.color );
  26. this.linewidth = source.linewidth;
  27. this.linecap = source.linecap;
  28. this.linejoin = source.linejoin;
  29. return this;
  30. }
  31. }
  32. LineBasicMaterial.prototype.isLineBasicMaterial = true;
  33. export { LineBasicMaterial };