ParticleSystem.js 872 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * @author alteredq / http://alteredqualia.com/
  3. */
  4. THREE.ParticleSystem = function ( geometry, material ) {
  5. THREE.Object3D.call( this );
  6. this.geometry = geometry;
  7. this.material = ( material !== undefined ) ? material : new THREE.ParticleBasicMaterial( { color: Math.random() * 0xffffff } );
  8. this.sortParticles = false;
  9. if ( this.geometry ) {
  10. // calc bound radius
  11. if( this.geometry.boundingSphere === null ) {
  12. this.geometry.computeBoundingSphere();
  13. }
  14. }
  15. this.frustumCulled = false;
  16. };
  17. THREE.ParticleSystem.prototype = Object.create( THREE.Object3D.prototype );
  18. THREE.ParticleSystem.prototype.clone = function ( object ) {
  19. if ( object === undefined ) object = new THREE.ParticleSystem( this.geometry, this.material );
  20. object.sortParticles = this.sortParticles;
  21. THREE.Object3D.prototype.clone.call( this, object );
  22. return object;
  23. };
粤ICP备19079148号