LineBasicMaterial.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. * depthWrite: <bool>,
  12. *
  13. * linewidth: <float>,
  14. * linecap: "round",
  15. * linejoin: "round",
  16. *
  17. * vertexColors: <bool>
  18. *
  19. * fog: <bool>
  20. * }
  21. */
  22. THREE.LineBasicMaterial = function ( parameters ) {
  23. THREE.Material.call( this );
  24. this.type = 'LineBasicMaterial';
  25. this.color = new THREE.Color( 0xffffff );
  26. this.linewidth = 1;
  27. this.linecap = 'round';
  28. this.linejoin = 'round';
  29. this.vertexColors = THREE.NoColors;
  30. this.fog = true;
  31. this.setValues( parameters );
  32. };
  33. THREE.LineBasicMaterial.prototype = Object.create( THREE.Material.prototype );
  34. THREE.LineBasicMaterial.prototype.constructor = THREE.LineBasicMaterial;
  35. THREE.LineBasicMaterial.prototype.clone = function () {
  36. var material = new THREE.LineBasicMaterial();
  37. THREE.Material.prototype.clone.call( this, material );
  38. material.color.copy( this.color );
  39. material.linewidth = this.linewidth;
  40. material.linecap = this.linecap;
  41. material.linejoin = this.linejoin;
  42. material.vertexColors = this.vertexColors;
  43. material.fog = this.fog;
  44. return material;
  45. };
粤ICP备19079148号