mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-15 07:56:00 +10:00
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).
This commit is contained in:
@@ -11,6 +11,22 @@ THREE.ParticleSystem = function ( geometry, 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();
|
||||
|
||||
Reference in New Issue
Block a user