PointsMaterial.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. * @author alteredq / http://alteredqualia.com/
  4. *
  5. * parameters = {
  6. * color: <hex>,
  7. * opacity: <float>,
  8. * map: new THREE.Texture( <Image> ),
  9. *
  10. * size: <float>,
  11. * sizeAttenuation: <bool>,
  12. *
  13. * blending: THREE.NormalBlending,
  14. * depthTest: <bool>,
  15. * depthWrite: <bool>,
  16. *
  17. * vertexColors: <bool>,
  18. *
  19. * fog: <bool>
  20. * }
  21. */
  22. THREE.PointsMaterial = function ( parameters ) {
  23. THREE.Material.call( this );
  24. this.type = 'PointsMaterial';
  25. this.color = new THREE.Color( 0xffffff );
  26. this.map = null;
  27. this.size = 1;
  28. this.sizeAttenuation = true;
  29. this.blending = THREE.NormalBlending;
  30. this.vertexColors = THREE.NoColors;
  31. this.fog = true;
  32. this.setValues( parameters );
  33. };
  34. THREE.PointsMaterial.prototype = Object.create( THREE.Material.prototype );
  35. THREE.PointsMaterial.prototype.constructor = THREE.PointsMaterial;
  36. THREE.PointsMaterial.prototype.copy = function ( source ) {
  37. THREE.Material.prototype.copy.call( this, source );
  38. this.color.copy( source.color );
  39. this.map = source.map;
  40. this.size = source.size;
  41. this.sizeAttenuation = source.sizeAttenuation;
  42. this.vertexColors = source.vertexColors;
  43. this.fog = source.fog;
  44. return this;
  45. };