LineDashedMaterial.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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.clone = function () {
  37. var material = new THREE.LineDashedMaterial();
  38. THREE.Material.prototype.clone.call( this, material );
  39. material.color.copy( this.color );
  40. material.linewidth = this.linewidth;
  41. material.scale = this.scale;
  42. material.dashSize = this.dashSize;
  43. material.gapSize = this.gapSize;
  44. material.vertexColors = this.vertexColors;
  45. material.fog = this.fog;
  46. return material;
  47. };
粤ICP备19079148号