PointsMaterial.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { Material } from './Material.js';
  2. import { Color } from '../math/Color.js';
  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. * morphTargets: <bool>
  16. * }
  17. */
  18. function PointsMaterial( parameters ) {
  19. Material.call( this );
  20. this.type = 'PointsMaterial';
  21. this.color = new Color( 0xffffff );
  22. this.map = null;
  23. this.size = 1;
  24. this.sizeAttenuation = true;
  25. this.morphTargets = false;
  26. this.setValues( parameters );
  27. }
  28. PointsMaterial.prototype = Object.create( Material.prototype );
  29. PointsMaterial.prototype.constructor = PointsMaterial;
  30. PointsMaterial.prototype.isPointsMaterial = true;
  31. PointsMaterial.prototype.copy = function ( source ) {
  32. Material.prototype.copy.call( this, source );
  33. this.color.copy( source.color );
  34. this.map = source.map;
  35. this.size = source.size;
  36. this.sizeAttenuation = source.sizeAttenuation;
  37. this.morphTargets = source.morphTargets;
  38. return this;
  39. };
  40. export { PointsMaterial };
粤ICP备19079148号