PointsMaterial.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { Material } from './Material';
  2. import { Color } from '../math/Color';
  3. /**
  4. * @author mrdoob / http://mrdoob.com/
  5. * @author alteredq / http://alteredqualia.com/
  6. *
  7. * parameters = {
  8. * color: <hex>,
  9. * opacity: <float>,
  10. * map: new THREE.Texture( <Image> ),
  11. *
  12. * size: <float>,
  13. * sizeAttenuation: <bool>
  14. * }
  15. */
  16. function PointsMaterial( parameters ) {
  17. Material.call( this );
  18. this.type = 'PointsMaterial';
  19. this.color = new Color( 0xffffff );
  20. this.map = null;
  21. this.size = 1;
  22. this.sizeAttenuation = true;
  23. this.lights = false;
  24. this.setValues( parameters );
  25. }
  26. PointsMaterial.prototype = Object.create( Material.prototype );
  27. PointsMaterial.prototype.constructor = PointsMaterial;
  28. PointsMaterial.prototype.isPointsMaterial = true;
  29. PointsMaterial.prototype.copy = function ( source ) {
  30. Material.prototype.copy.call( this, source );
  31. this.color.copy( source.color );
  32. this.map = source.map;
  33. this.size = source.size;
  34. this.sizeAttenuation = source.sizeAttenuation;
  35. return this;
  36. };
  37. export { PointsMaterial };
粤ICP备19079148号