Files
three.js/src/objects/ParticleSystem.js
T
alteredq 43036191c6 Added frustum culling also for ParticleSystems.
This is optional, for now by default it's off, like it was before. It's up to application to update geometry bounding sphere if vertex positions change (like for meshes).
2011-11-22 06:26:00 +01:00

34 lines
583 B
JavaScript

/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.ParticleSystem = function ( geometry, material ) {
THREE.Object3D.call( this );
this.geometry = geometry;
this.material = material;
this.sortParticles = false;
if ( this.geometry ) {
// calc bound radius
if( !this.geometry.boundingSphere ) {
this.geometry.computeBoundingSphere();
}
this.boundRadius = geometry.boundingSphere.radius;
}
this.frustumCulled = false;
};
THREE.ParticleSystem.prototype = new THREE.Object3D();
THREE.ParticleSystem.prototype.constructor = THREE.ParticleSystem;