ParticleBasicMaterial.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. *
  12. * blending: THREE.NormalBlending,
  13. * depthTest: <bool>,
  14. * depthWrite: <bool>,
  15. *
  16. * vertexColors: <bool>,
  17. *
  18. * fog: <bool>
  19. * }
  20. */
  21. THREE.ParticleBasicMaterial = function ( parameters ) {
  22. THREE.Material.call( this );
  23. this.color = new THREE.Color( 0xffffff );
  24. this.map = null;
  25. this.size = 1;
  26. this.sizeAttenuation = true;
  27. this.vertexColors = false;
  28. this.fog = true;
  29. this.setValues( parameters );
  30. };
  31. THREE.ParticleBasicMaterial.prototype = Object.create( THREE.Material.prototype );
  32. THREE.ParticleBasicMaterial.prototype.clone = function () {
  33. var material = new THREE.ParticleBasicMaterial();
  34. THREE.Material.prototype.clone.call( this, material );
  35. material.color.copy( this.color );
  36. material.map = this.map;
  37. material.size = this.size;
  38. material.sizeAttenuation = this.sizeAttenuation;
  39. material.vertexColors = this.vertexColors;
  40. material.fog = this.fog;
  41. return material;
  42. };
粤ICP备19079148号