PointsMaterial.js 899 B

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