LineDashedMaterial.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * @author alteredq / http://alteredqualia.com/
  3. *
  4. * parameters = {
  5. * color: <hex>,
  6. * opacity: <float>,
  7. *
  8. * blending: THREE.NormalBlending,
  9. * depthTest: <bool>,
  10. * depthWrite: <bool>,
  11. *
  12. * linewidth: <float>,
  13. *
  14. * scale: <float>,
  15. * dashSize: <float>,
  16. * gapSize: <float>,
  17. *
  18. * vertexColors: <bool>
  19. *
  20. * fog: <bool>
  21. * }
  22. */
  23. THREE.LineDashedMaterial = function ( parameters ) {
  24. THREE.Material.call( this );
  25. this.type = 'LineDashedMaterial';
  26. this.color = new THREE.Color( 0xffffff );
  27. this.linewidth = 1;
  28. this.scale = 1;
  29. this.dashSize = 3;
  30. this.gapSize = 1;
  31. this.vertexColors = false;
  32. this.fog = true;
  33. this.setValues( parameters );
  34. };
  35. THREE.LineDashedMaterial.prototype = Object.create( THREE.Material.prototype );
  36. THREE.LineDashedMaterial.prototype.constructor = THREE.LineDashedMaterial;
  37. THREE.LineDashedMaterial.prototype.clone = function () {
  38. var material = new THREE.LineDashedMaterial();
  39. THREE.Material.prototype.clone.call( this, material );
  40. material.color.copy( this.color );
  41. material.linewidth = this.linewidth;
  42. material.scale = this.scale;
  43. material.dashSize = this.dashSize;
  44. material.gapSize = this.gapSize;
  45. material.vertexColors = this.vertexColors;
  46. material.fog = this.fog;
  47. return material;
  48. };
粤ICP备19079148号