LineBasicMaterial.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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.lights = false;
  24. this.setValues( parameters );
  25. }
  26. LineBasicMaterial.prototype = Object.create( Material.prototype );
  27. LineBasicMaterial.prototype.constructor = LineBasicMaterial;
  28. LineBasicMaterial.prototype.isLineBasicMaterial = true;
  29. LineBasicMaterial.prototype.copy = function ( source ) {
  30. Material.prototype.copy.call( this, source );
  31. this.color.copy( source.color );
  32. this.linewidth = source.linewidth;
  33. this.linecap = source.linecap;
  34. this.linejoin = source.linejoin;
  35. return this;
  36. };
  37. export { LineBasicMaterial };