LineBasicMaterial.js 914 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. Object.defineProperty( this, 'isLineBasicMaterial', { value: true } );
  17. this.type = 'LineBasicMaterial';
  18. this.color = new Color( 0xffffff );
  19. this.linewidth = 1;
  20. this.linecap = 'round';
  21. this.linejoin = 'round';
  22. this.morphTargets = false;
  23. this.setValues( parameters );
  24. }
  25. copy( source ) {
  26. Material.prototype.copy.call( this, source );
  27. this.color.copy( source.color );
  28. this.linewidth = source.linewidth;
  29. this.linecap = source.linecap;
  30. this.linejoin = source.linejoin;
  31. this.morphTargets = source.morphTargets;
  32. return this;
  33. }
  34. }
  35. export { LineBasicMaterial };
粤ICP备19079148号