ParticleBasicMaterial.js 1017 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * @author mr.doob / http://mrdoob.com/
  3. *
  4. * parameters = {
  5. * color: <hex>,
  6. * map: new THREE.Texture( <Image> ),
  7. * opacity: <float>,
  8. * blending: THREE.NormalBlending
  9. * }
  10. */
  11. THREE.ParticleBasicMaterial = function ( parameters ) {
  12. this.color = new THREE.Color( 0xff0000 );
  13. this.map = null;
  14. this.opacity = 1;
  15. this.blending = THREE.NormalBlending;
  16. this.offset = new THREE.Vector2(); // TODO: expose to parameters
  17. if ( parameters ) {
  18. if ( parameters.color !== undefined ) this.color.setHex( parameters.color );
  19. if ( parameters.map !== undefined ) this.map = parameters.map;
  20. if ( parameters.opacity !== undefined ) this.opacity = parameters.opacity;
  21. if ( parameters.blending !== undefined ) this.blending = parameters.blending;
  22. }
  23. this.toString = function () {
  24. return 'THREE.ParticleBasicMaterial (<br/>' +
  25. 'color: ' + this.color + '<br/>' +
  26. 'map: ' + this.map + '<br/>' +
  27. 'opacity: ' + this.opacity + '<br/>' +
  28. 'blending: ' + this.blending + '<br/>' +
  29. ')';
  30. };
  31. };
粤ICP备19079148号