LineBasicMaterial.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. * @author alteredq / http://alteredqualia.com/
  4. *
  5. * parameters = {
  6. * color: <hex>,
  7. * opacity: <float>,
  8. *
  9. * blending: THREE.NormalBlending,
  10. * depthTest: <bool>,
  11. *
  12. * linewidth: <float>,
  13. * linecap: "round",
  14. * linejoin: "round",
  15. *
  16. * vertexColors: <bool>
  17. *
  18. * fog: <bool>
  19. * }
  20. */
  21. THREE.LineBasicMaterial = function ( parameters ) {
  22. THREE.Material.call( this );
  23. this.color = new THREE.Color( 0xffffff );
  24. this.linewidth = 1;
  25. this.linecap = 'round';
  26. this.linejoin = 'round';
  27. this.vertexColors = false;
  28. this.fog = true;
  29. this.setValues( parameters );
  30. };
  31. THREE.LineBasicMaterial.prototype = Object.create( THREE.Material.prototype );
  32. THREE.LineBasicMaterial.prototype.clone = function () {
  33. var material = new THREE.LineBasicMaterial();
  34. THREE.Material.prototype.clone.call( this, material );
  35. material.color.copy( this.color );
  36. material.linewidth = this.linewidth;
  37. material.linecap = this.linecap;
  38. material.linejoin = this.linejoin;
  39. material.vertexColors = this.vertexColors;
  40. material.fog = this.fog;
  41. return material;
  42. };