ParticleBasicMaterial.js 1.1 KB

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