LineBasicMaterial.js 1.0 KB

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