LineDashedMaterial.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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: THREE.NoColors / THREE.FaceColors / THREE.VertexColors
  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 = THREE.NoColors;
  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.copy = function ( source ) {
  38. THREE.Material.prototype.copy.call( this, source );
  39. this.color.copy( source.color );
  40. this.linewidth = source.linewidth;
  41. this.scale = source.scale;
  42. this.dashSize = source.dashSize;
  43. this.gapSize = source.gapSize;
  44. this.vertexColors = source.vertexColors;
  45. this.fog = source.fog;
  46. return this;
  47. };
粤ICP备19079148号