var PHOTONS=PHOTONS||{};PHOTONS.Atlas=function(a,b){this.texture=a;this.imageCount=0;this.imageDescriptors=[];b&&this.addImageDescriptor(0,1,1,0)};PHOTONS.Atlas.ImageDescriptor=function(a,b,c,e){this.left=a;this.top=b;this.right=c;this.bottom=e};PHOTONS.Atlas.prototype.addImageDescriptor=function(a,b,c,e){this.imageDescriptors[this.imageCount]=new PHOTONS.Atlas.ImageDescriptor(a,b,c,e);this.imageCount++};PHOTONS.Atlas.prototype.getImageDescriptor=function(a){return this.imageDescriptors[a]}; PHOTONS.Atlas.prototype.getTexture=function(){return this.texture};PHOTONS.Atlas.createGridAtlas=function(a,b,c,e,f,d,g,h,k){a=new PHOTONS.Atlas(a);e=(e-b)/d;c=(c-f)/g;var n=1,l=1,m=0,p=0,q=d,r=g;h&&(n=-1,m=d-1,q=-1);k&&(l=-1,p=g-1,r=-1);for(d=p;d!=r;d+=l)for(g=m;g!=q;g+=n)h=b+e*g,k=f+c*(d+1),a.addImageDescriptor(h,k,h+e,k-c);return a};PHOTONS=PHOTONS||{};PHOTONS.Modifier=function(){};PHOTONS.RandomModifier=function(a){PHOTONS.Modifier.call(this);a||(a={});if(!a.range)throw"Particles.RandomModifier: No range specified.";if(!a.offset)throw"Particles.RandomModifier: No offset specified.";this.range=a.range;this.offset=a.offset;this.rangeType=a.rangeType||PHOTONS.RangeType.Cube;this.rangeEdgeClamp=void 0!==a.rangeEdgeClamp&&null!==a.rangeEdgeClamp?a.rangeEdgeClamp:!1};PHOTONS.RandomModifier.prototype=Object.create(PHOTONS.Modifier.prototype); PHOTONS.RandomModifier.prototype.update=function(a,b){this.rangeType==PHOTONS.RangeType.Cube?PHOTONS.Random.getRandomVectorCube(b,this.offset,this.range,this.rangeEdgeClamp):this.rangeType==PHOTONS.RangeType.Sphere&&PHOTONS.Random.getRandomVectorSphere(b,this.offset,this.range,this.rangeEdgeClamp)};PHOTONS.FrameSetModifier=function(a){PHOTONS.Modifier.call(this);this.frameset=a};PHOTONS.FrameSetModifier.prototype=Object.create(PHOTONS.Modifier.prototype); PHOTONS.FrameSetModifier.prototype.update=function(a,b){this.frameset.interpolateFrameValues(a.age,b)};PHOTONS.EvenIntervalIndexModifier=function(a){PHOTONS.Modifier.call(this);this.totalSteps=Math.floor(a||1)};PHOTONS.EvenIntervalIndexModifier.prototype=Object.create(PHOTONS.Modifier.prototype);PHOTONS.EvenIntervalIndexModifier.prototype.update=function(a,b){var c=Math.floor(a.age/a.lifeSpan*this.totalSteps);c==this.totalSteps&&0b;b++)a+=this.particleLifeSpan;this.averageParticleLifeSpan=a/100};PHOTONS.ParticleSystem.prototype.calculateMaxParticleCount=function(){if(this.releaseAtOnce)this.maxParticleCount=this.releaseAtOnceCount;else{var a=this.particleLifeSpan;0!=this.lifespan&&this.lifespane.lifeSpan&&(this.killParticle(e),b++)}0b;){for(;0==this.liveParticleArray[a].alive&&0c&&0>=this.liveParticleCount)this.activateParticles(this.maxParticleCount),this.timeSinceLastEmit=0,this.hasInitialReleaseOccurred=!0}else if(c=1/this.particleReleaseRate,!this.hasInitialReleaseOccurred||this.timeSinceLastEmit>c)this.activateParticles(Math.max(1, Math.floor(this.timeSinceLastEmit/c))),this.timeSinceLastEmit=0,this.hasInitialReleaseOccurred=!0;this.advanceParticles(b);this.zSort&&(this.camera.updateMatrixWorld(),a.copy(this.camera.matrixWorld),a.getInverse(a),this.sortParticleArray(a));this.updateAttributesWithParticleData();this.age+=b;0!=this.lifespan&&this.age>this.lifespan&&(this.emitting=!1);this.simulateInLocalSpace&&(this.particleMesh.matrix.copy(this.matrixWorld),this.particleMesh.updateMatrixWorld())}}}(); PHOTONS.ParticleSystem.prototype.deactivate=function(){this.isActive&&(this.scene.remove(this.particleMesh),this.isActive=!1)};PHOTONS.ParticleSystem.prototype.activate=function(){this.isActive||(this.scene.add(this.particleMesh),this.isActive=!0)};PHOTONS.ParticleSystem.DefaultPositionUpdater={update:function(a,b,c){a._tempVector3.copy(a.velocity);a._tempVector3.multiplyScalar(c);a.position.add(a._tempVector3)}}; PHOTONS.ParticleSystem.DefaultVelocityUpdater={update:function(a,b,c){a._tempVector3.copy(a.acceleration);a._tempVector3.multiplyScalar(c);a.velocity.add(a._tempVector3)}};PHOTONS.ParticleSystem.DefaultRotationUpdater={update:function(a,b,c){a.rotation.set(a.rotation.x+=a.rotationalSpeed.x*c)}};PHOTONS.ParticleSystem.DefaultRotationalSpeedUpdater={update:function(a,b,c){a.rotationalSpeed.set(a.rotationalSpeed.x+=a.rotationalAcceleration.x*c)}}; PHOTONS.ParticleSystem.DefaultUpdater={update:function(a,b,c){}};PHOTONS.ParticleSystem.DefaultInitializer={update:function(a,b,c){b.set(0,0,0,0)}}; PHOTONS.Particle=function(){this.lifeSpan=this.alive=this.age=0;this.size=new THREE.Vector3;this.color=new THREE.Color;this.alpha=new PHOTONS.SingularVector(0);this.atlasIndex=new PHOTONS.SingularVector(0);this.position=new THREE.Vector3;this.velocity=new THREE.Vector3;this.acceleration=new THREE.Vector3;this.rotation=new PHOTONS.SingularVector(0);this.rotationalSpeed=new PHOTONS.SingularVector(0);this.rotationalAcceleration=new PHOTONS.SingularVector(0);this._tempVector3=new THREE.Vector3};PHOTONS=PHOTONS||{};PHOTONS.FrameSet=function(a,b,c){this.timeFrames=a||[];this.valueFrames=b||[]};PHOTONS.FrameSet.prototype.findNextFrameForTimeValue=function(a){for(var b=0;b