LineBasicMaterial.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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.morphTargets = 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. this.morphTargets = source.morphTargets;
  36. return this;
  37. };
  38. export { LineBasicMaterial };
粤ICP备19079148号