ParticleSystem.js 767 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * @author alteredq / http://alteredqualia.com/
  3. */
  4. THREE.ParticleSystem = function ( geometry, material ) {
  5. THREE.Object3D.call( this );
  6. this.geometry = geometry !== undefined ? geometry : new THREE.Geometry();
  7. this.material = material !== undefined ? material : new THREE.ParticleSystemMaterial( { color: Math.random() * 0xffffff } );
  8. this.sortParticles = false;
  9. this.frustumCulled = false;
  10. };
  11. THREE.ParticleSystem.prototype = Object.create( THREE.Object3D.prototype );
  12. THREE.ParticleSystem.prototype.clone = function ( object ) {
  13. if ( object === undefined ) object = new THREE.ParticleSystem( this.geometry, this.material );
  14. object.sortParticles = this.sortParticles;
  15. THREE.Object3D.prototype.clone.call( this, object );
  16. return object;
  17. };