@realsee/five 6.8.0-alpha.17 → 6.8.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/vfx/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 3/13/2026
5
- * Version: 6.8.0-alpha.17
4
+ * Generated: 3/18/2026
5
+ * Version: 6.8.0-alpha.19
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,7 +252,7 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Fe=require("three");function Te(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,t.get?t:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const n=Te(Fe);var ae=function(r,i){return ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},ae(r,i)};function Y(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");ae(r,i);function e(){this.constructor=r}r.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}var be=`
255
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`three`);c=s(c);var l=`
256
256
  uniform vec3 uColor1;
257
257
  uniform vec3 uColor2;
258
258
  uniform float uOpacity;
@@ -272,7 +272,7 @@ void main() {
272
272
  color.g = color.g * (1.0 + gradient * vNoise);
273
273
  gl_FragColor = vec4(color, alpha * uOpacity);
274
274
  }
275
- `,le=`
275
+ `,u=`
276
276
  // Simplex 4D Noise
277
277
  // by Ian McEwan, Ashima Arts
278
278
  //
@@ -376,11 +376,11 @@ float simplexNoise(vec4 v) {
376
376
  + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
377
377
 
378
378
  }
379
- `,se=`
379
+ `,d=`
380
380
  float scale(float value, float fromMin, float fromMax, float toMin, float toMax) {
381
381
  return toMin + (value - fromMin) * (toMax - toMin) / (fromMax - fromMin);
382
382
  }
383
- `,Ae=`
383
+ `,f=`
384
384
  uniform float uTime;
385
385
  uniform float uNoise;
386
386
  uniform float uSpeed;
@@ -388,8 +388,8 @@ uniform float uSpeed;
388
388
  varying vec3 vPosition;
389
389
  varying float vNoise;
390
390
 
391
- `.concat(le,`
392
- `).concat(se,`
391
+ ${u}
392
+ ${d}
393
393
 
394
394
  float fbm(vec4 x) {
395
395
  float v = 0.0;
@@ -412,7 +412,7 @@ void main() {
412
412
 
413
413
  gl_Position = projectionMatrix * modelViewMatrix * vec4(vPosition, 1.0);
414
414
  }
415
- `),Me=new n.SphereBufferGeometry(1,300,300),xe=[];for(var Q=0;Q<2;Q++)xe.push(new n.Vector2(Math.sin(Q)/2+1,Q*2-.8));var ze=new n.LatheBufferGeometry(xe,300),Ve=(function(r){Y(i,r);function i(e){var t=r.call(this)||this;t.needsRender=!0;var o;if(e instanceof n.BufferGeometry)o=e;else switch(e){case"ring":o=ze;break;case"circle":default:o=Me;break}t.uniforms={uTime:{value:0},uColor1:{value:new n.Color("rgb(255, 177, 20)")},uColor2:{value:new n.Color("rgb(255, 0, 0)")},uNoise:{value:1.2},uSpeed:{value:1},uOpacity:{value:1}},t.defines={FRAGMENTATION_DEGREE:2};var u=new n.Mesh(o,new n.ShaderMaterial({uniforms:t.uniforms,defines:t.defines,vertexShader:Ae,fragmentShader:be,transparent:!0,depthWrite:!1,side:n.BackSide})),a=new n.Mesh(o,new n.ShaderMaterial({uniforms:t.uniforms,defines:t.defines,vertexShader:Ae,fragmentShader:be,transparent:!0,depthWrite:!1,side:n.FrontSide}));return u.scale.setScalar(.1),a.scale.setScalar(.1),t.add(u),t.add(a),t}return i.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(i.prototype,"color1",{get:function(){return this.uniforms.uColor1.value},set:function(e){this.uniforms.uColor1.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"color2",{get:function(){return this.uniforms.uColor2.value},set:function(e){this.uniforms.uColor2.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"speed",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"noise",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"opacity",{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.uOpacity.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"fragmentationDegree",{get:function(){return this.defines.FRAGMENTATION_DEGREE},set:function(e){this.defines.FRAGMENTATION_DEGREE=e,this.traverse(function(t){t instanceof n.Mesh&&t.material instanceof n.ShaderMaterial&&(t.material.needsUpdate=!0)}),this.needsRender=!0},enumerable:!1,configurable:!0}),i})(n.Group),De=`
415
+ `,p=new c.SphereBufferGeometry(1,300,300),m=[];for(let e=0;e<2;e++)m.push(new c.Vector2(Math.sin(e)/2+1,e*2-.8));var h=new c.LatheBufferGeometry(m,300),g=class extends c.Group{constructor(e){super(),this.needsRender=!0;let t;if(e instanceof c.BufferGeometry)t=e;else switch(e){case`ring`:t=h;break;default:t=p;break}this.uniforms={uTime:{value:0},uColor1:{value:new c.Color(`rgb(255, 177, 20)`)},uColor2:{value:new c.Color(`rgb(255, 0, 0)`)},uNoise:{value:1.2},uSpeed:{value:1},uOpacity:{value:1}},this.defines={FRAGMENTATION_DEGREE:2};let n=new c.Mesh(t,new c.ShaderMaterial({uniforms:this.uniforms,defines:this.defines,vertexShader:f,fragmentShader:l,transparent:!0,depthWrite:!1,side:c.BackSide})),r=new c.Mesh(t,new c.ShaderMaterial({uniforms:this.uniforms,defines:this.defines,vertexShader:f,fragmentShader:l,transparent:!0,depthWrite:!1,side:c.FrontSide}));n.scale.setScalar(.1),r.scale.setScalar(.1),this.add(n),this.add(r)}setTime(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0}set color1(e){this.uniforms.uColor1.value=e,this.needsRender=!0}get color1(){return this.uniforms.uColor1.value}set color2(e){this.uniforms.uColor2.value=e,this.needsRender=!0}get color2(){return this.uniforms.uColor2.value}set speed(e){this.uniforms.uSpeed.value=e}get speed(){return this.uniforms.uSpeed.value}set noise(e){this.uniforms.uSpeed.value=e,this.needsRender=!0}get noise(){return this.uniforms.uSpeed.value}set opacity(e){this.uniforms.uOpacity.value=e,this.needsRender=!0}get opacity(){return this.uniforms.opacity.value}set fragmentationDegree(e){this.defines.FRAGMENTATION_DEGREE=e,this.traverse(e=>{e instanceof c.Mesh&&e.material instanceof c.ShaderMaterial&&(e.material.needsUpdate=!0)}),this.needsRender=!0}get fragmentationDegree(){return this.defines.FRAGMENTATION_DEGREE}},_=`
416
416
  uniform vec3 uLightColor;
417
417
  uniform vec3 uSpotPosition;
418
418
  uniform float uAttenuation;
@@ -432,7 +432,7 @@ void main() {
432
432
  intensity = intensity * angleIntensity * vNoise;
433
433
  gl_FragColor = vec4( uLightColor, intensity );
434
434
  }
435
- `,Re=`
435
+ `,v=`
436
436
 
437
437
  uniform float uTime;
438
438
 
@@ -440,8 +440,8 @@ varying vec3 vNormal;
440
440
  varying vec3 vWorldPosition;
441
441
  varying float vNoise;
442
442
 
443
- `.concat(le,`
444
- `).concat(se,`
443
+ ${u}
444
+ ${d}
445
445
 
446
446
  void main(){
447
447
 
@@ -453,7 +453,7 @@ void main(){
453
453
 
454
454
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
455
455
  }
456
- `),Ne=(function(r){Y(i,r);function i(e,t,o){e===void 0&&(e=1),t===void 0&&(t=.1),o===void 0&&(o=.2);var u=r.call(this)||this;u.needsRender=!0,u.uniforms={uTime:{value:0},uAttenuation:{value:e*.9},uAnglePower:{value:2},uSpotPosition:{value:u.position},uLightColor:{value:new n.Color(16777215)}};var a=new n.CylinderBufferGeometry(t,o,e,64,20,!0);a.applyMatrix4(new n.Matrix4().makeTranslation(0,-e/2,0)),a.applyMatrix4(new n.Matrix4().makeRotationX(-Math.PI/2));var s=new n.Mesh(a,new n.ShaderMaterial({uniforms:u.uniforms,vertexShader:Re,fragmentShader:De,transparent:!0,side:n.FrontSide,depthWrite:!1}));return u.add(s),u}return i.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(i.prototype,"attenuation",{get:function(){return this.uniforms.uAttenuation.value},set:function(e){this.uniforms.uAttenuation.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"anglePower",{get:function(){return this.uniforms.uAnglePower.value},set:function(e){this.uniforms.uAnglePower.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"color",{get:function(){return this.uniforms.uLightColor.value},set:function(e){this.uniforms.uLightColor.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),i})(n.Group),Se=`
456
+ `,y=class extends c.Group{constructor(e=1,t=.1,n=.2){super(),this.needsRender=!0,this.uniforms={uTime:{value:0},uAttenuation:{value:e*.9},uAnglePower:{value:2},uSpotPosition:{value:this.position},uLightColor:{value:new c.Color(16777215)}};let r=new c.CylinderBufferGeometry(t,n,e,64,20,!0);r.applyMatrix4(new c.Matrix4().makeTranslation(0,-e/2,0)),r.applyMatrix4(new c.Matrix4().makeRotationX(-Math.PI/2));let i=new c.Mesh(r,new c.ShaderMaterial({uniforms:this.uniforms,vertexShader:v,fragmentShader:_,transparent:!0,side:c.FrontSide,depthWrite:!1}));this.add(i)}setTime(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0}set attenuation(e){this.uniforms.uAttenuation.value=e,this.needsRender=!0}get attenuation(){return this.uniforms.uAttenuation.value}set anglePower(e){this.uniforms.uAnglePower.value=e,this.needsRender=!0}get anglePower(){return this.uniforms.uAnglePower.value}set color(e){this.uniforms.uLightColor.value=e,this.needsRender=!0}get color(){return this.uniforms.uLightColor.value}},b=`
457
457
  uniform vec3 uColor;
458
458
  uniform float uOpacity;
459
459
  varying vec3 vPosition;
@@ -463,7 +463,7 @@ void main() {
463
463
  float gradient = mix(0.0, 1.0, 1.0 + vPosition.y);
464
464
  gl_FragColor = vec4(uColor, vNoise * gradient * uOpacity);
465
465
  }
466
- `,we=`
466
+ `,x=`
467
467
 
468
468
  uniform float uTime;
469
469
  uniform float uSpeed;
@@ -472,8 +472,8 @@ uniform float uExpand;
472
472
  varying float vNoise;
473
473
  varying vec3 vPosition;
474
474
 
475
- `.concat(le,`
476
- `).concat(se,`
475
+ ${u}
476
+ ${d}
477
477
 
478
478
  void main(){
479
479
 
@@ -486,7 +486,7 @@ void main(){
486
486
 
487
487
  gl_Position = projectionMatrix * modelViewMatrix * transformed;
488
488
  }
489
- `),ue=new n.PlaneBufferGeometry(1,1,200,200);ue.translate(0,-.5,0);var Oe=(function(r){Y(i,r);function i(){var e=r.call(this)||this;e.needsRender=!0;var t=e.outer=new n.Mesh(ue,new n.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:.75},uScale:{value:2},uExpand:{value:1.2},uColor:{value:new n.Color(.5,.5,.9)},uOpacity:{value:1}},vertexShader:we,fragmentShader:Se,transparent:!0,side:n.DoubleSide,depthWrite:!1})),o=e.inner=new n.Mesh(ue,new n.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:2},uScale:{value:20},uExpand:{value:1.2},uColor:{value:new n.Color(1,1,1)},uOpacity:{value:.1}},vertexShader:we,fragmentShader:Se,transparent:!0,side:n.DoubleSide,depthWrite:!1}));return t.rotateX(-Math.PI/2),o.rotateX(-Math.PI/2),e.add(t),e.add(o),e}return i.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e);var t=(e-this.startTime)/1e3;this.inner.material.uniforms.uTime.value=t,this.outer.material.uniforms.uTime.value=t,this.needsRender=!0},Object.defineProperty(i.prototype,"expand",{get:function(){return this.outer.material.uniforms.uExpand.value},set:function(e){this.outer.material.uniforms.uExpand.value=e,this.inner.material.uniforms.uExpand.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"speed",{get:function(){return this.inner.material.uniforms.speed.value},set:function(e){this.inner.material.uniforms.speed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"color",{get:function(){return this.outer.material.uniforms.color.value},set:function(e){this.outer.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"flowColor",{get:function(){return this.inner.material.uniforms.color.value},set:function(e){this.inner.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),i})(n.Group);function q(r,i){return r+i*(Math.random()-.5)}function K(r,i){var e=new n.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new n.Vector3().addVectors(r,new n.Vector3().multiplyVectors(i,e))}function te(r,i,e){return r*e+i*e*e/2}function Ue(r,i,e){return new n.Vector3(te(r.x,i.x,e),te(r.y,i.y,e),te(r.z,i.z,e))}function oe(r,i){for(var e=r.times.length,t=0;t<e&&i>r.times[t];)t++;if(t==0)return r.values[0];if(t==e)return r.values[e-1];var o=(i-r.times[t-1])/(r.times[t]-r.times[t-1]),u=r.values[t-1],a=r.values[t];return typeof r.values[0]=="number"?u+o*(a-u):u.clone().lerp(a,o)}var je=(function(){function r(i,e,t,o,u,a,s,c,f,m,h,d,y,b){this.birthTime=i,this.deathAge=e,this.position=t.clone(),this.velocity=o.clone(),this.acceleration=u.clone(),this.angle=a,this.angleVelocity=s,this.angleAcceleration=c,this.color=f,this.colorTween=m,this.size=h,this.sizeTween=d,this.opacity=y,this.opacityTween=b}return r.prototype.getAlive=function(i){return this.deathAge>i-this.birthTime},r.prototype.getState=function(i){var e=this.getAlive(i),t=Math.min(this.deathAge,i-this.birthTime),o=Ue(this.velocity,this.acceleration,t).add(this.position),u=te(this.angleVelocity,this.angleAcceleration,t)+this.angle,a=(this.sizeTween?oe(this.sizeTween,t):0)+this.size,s=(this.colorTween?oe(this.colorTween,t):new n.Vector3).add(this.color),c=new n.Color().setHSL(s.x,s.y,s.z),f=(this.opacityTween?oe(this.opacityTween,t):0)+this.opacity;return{alive:e,age:t,position:o,angle:u,size:a,color:c,opacity:f}},r})(),Ge=`
489
+ `,S=new c.PlaneBufferGeometry(1,1,200,200);S.translate(0,-.5,0);var C=class extends c.Group{constructor(){super(),this.needsRender=!0;let e=this.outer=new c.Mesh(S,new c.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:.75},uScale:{value:2},uExpand:{value:1.2},uColor:{value:new c.Color(.5,.5,.9)},uOpacity:{value:1}},vertexShader:x,fragmentShader:b,transparent:!0,side:c.DoubleSide,depthWrite:!1})),t=this.inner=new c.Mesh(S,new c.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:2},uScale:{value:20},uExpand:{value:1.2},uColor:{value:new c.Color(1,1,1)},uOpacity:{value:.1}},vertexShader:x,fragmentShader:b,transparent:!0,side:c.DoubleSide,depthWrite:!1}));e.rotateX(-Math.PI/2),t.rotateX(-Math.PI/2),this.add(e),this.add(t)}setTime(e){this.startTime===void 0&&(this.startTime=e);let t=(e-this.startTime)/1e3;this.inner.material.uniforms.uTime.value=t,this.outer.material.uniforms.uTime.value=t,this.needsRender=!0}get expand(){return this.outer.material.uniforms.uExpand.value}set expand(e){this.outer.material.uniforms.uExpand.value=e,this.inner.material.uniforms.uExpand.value=e,this.needsRender=!0}get speed(){return this.inner.material.uniforms.speed.value}set speed(e){this.inner.material.uniforms.speed.value=e,this.needsRender=!0}get color(){return this.outer.material.uniforms.color.value}set color(e){this.outer.material.uniforms.color.value=e,this.needsRender=!0}get flowColor(){return this.inner.material.uniforms.color.value}set flowColor(e){this.inner.material.uniforms.color.value=e,this.needsRender=!0}};function w(e,t){return e+t*(Math.random()-.5)}function T(e,t){let n=new c.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new c.Vector3().addVectors(e,new c.Vector3().multiplyVectors(t,n))}function E(e,t,n){return e*n+t*n*n/2}function D(e,t,n){return new c.Vector3(E(e.x,t.x,n),E(e.y,t.y,n),E(e.z,t.z,n))}function O(e,t){let n=e.times.length,r=0;for(;r<n&&t>e.times[r];)r++;if(r==0)return e.values[0];if(r==n)return e.values[n-1];let i=(t-e.times[r-1])/(e.times[r]-e.times[r-1]),a=e.values[r-1],o=e.values[r];return typeof e.values[0]==`number`?a+i*(o-a):a.clone().lerp(o,i)}var k=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){this.birthTime=e,this.deathAge=t,this.position=n.clone(),this.velocity=r.clone(),this.acceleration=i.clone(),this.angle=a,this.angleVelocity=o,this.angleAcceleration=s,this.color=c,this.colorTween=l,this.size=u,this.sizeTween=d,this.opacity=f,this.opacityTween=p}getAlive(e){return this.deathAge>e-this.birthTime}getState(e){let t=this.getAlive(e),n=Math.min(this.deathAge,e-this.birthTime),r=D(this.velocity,this.acceleration,n).add(this.position),i=E(this.angleVelocity,this.angleAcceleration,n)+this.angle,a=(this.sizeTween?O(this.sizeTween,n):0)+this.size,o=(this.colorTween?O(this.colorTween,n):new c.Vector3).add(this.color);return{alive:t,age:n,position:r,angle:i,size:a,color:new c.Color().setHSL(o.x,o.y,o.z),opacity:(this.opacityTween?O(this.opacityTween,n):0)+this.opacity}}},A=`
490
490
  attribute vec3 color;
491
491
  attribute float opacity;
492
492
  attribute float size;
@@ -512,7 +512,7 @@ void main() {
512
512
  gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) );
513
513
  gl_Position = projectionMatrix * mvPosition;
514
514
  }
515
- `,Ie=`
515
+ `,j=`
516
516
  varying vec4 vColor;
517
517
 
518
518
  #if defined(USE_MAP)
@@ -536,7 +536,7 @@ void main() {
536
536
  gl_FragColor = vColor * rotatedTexture;
537
537
  #endif
538
538
  }
539
- `,He=(function(r){Y(i,r);function i(e){var t=this,o,u,a,s,c,f,m,h,d,y,b,S,g,_,C,E,B,P,F,T,M,z,V,D,R,N,O,U,j,G,I,H,X,k,v,p,w,x,A=new n.BufferGeometry;A.setAttribute("position",new n.BufferAttribute(new Float32Array,3)),A.setAttribute("alive",new n.BufferAttribute(new Float32Array,1)),A.setAttribute("color",new n.BufferAttribute(new Float32Array,3)),A.setAttribute("opacity",new n.BufferAttribute(new Float32Array,1)),A.setAttribute("size",new n.BufferAttribute(new Float32Array,1)),A.setAttribute("angle",new n.BufferAttribute(new Float32Array,1));var Z=new n.ShaderMaterial({uniforms:{map:{value:(o=e.texture)!==null&&o!==void 0?o:null}},defines:{USE_MAP:!!e.texture},vertexShader:Ge,fragmentShader:Ie,transparent:!0,blending:(u=e.blending)!==null&&u!==void 0?u:n.NormalBlending,depthWrite:!1});return t=r.call(this,A,Z)||this,t.instances=[],t.needsRender=!0,t.birthTime=Date.now()/1e3,t.disposed=!1,t.paused=!1,t.positionBase=(s=(a=e.positionBase)===null||a===void 0?void 0:a.clone())!==null&&s!==void 0?s:new n.Vector3,t.positionStyle=(c=e.positionStyle)!==null&&c!==void 0?c:"CUBE",t.positionCubeSpread=(m=(f=e.positionCubeSpread)===null||f===void 0?void 0:f.clone())!==null&&m!==void 0?m:new n.Vector3,t.positionSphereSpread=(h=e.positionSphereSpread)!==null&&h!==void 0?h:0,t.velocityStyle=(d=e.velocityStyle)!==null&&d!==void 0?d:"CUBE",t.velocityCubeBase=(b=(y=e.velocityCubeBase)===null||y===void 0?void 0:y.clone())!==null&&b!==void 0?b:new n.Vector3,t.velocityCubeSpread=(g=(S=e.velocityCubeSpread)===null||S===void 0?void 0:S.clone())!==null&&g!==void 0?g:new n.Vector3,t.velocitySphereBase=(_=e.velocitySphereBase)!==null&&_!==void 0?_:0,t.velocitySphereSpread=(C=e.velocitySphereSpread)!==null&&C!==void 0?C:0,t.accelerationBase=(B=(E=e.accelerationBase)===null||E===void 0?void 0:E.clone())!==null&&B!==void 0?B:new n.Vector3,t.accelerationSpread=(F=(P=e.accelerationSpread)===null||P===void 0?void 0:P.clone())!==null&&F!==void 0?F:new n.Vector3,t.angleBase=(T=e.angleBase)!==null&&T!==void 0?T:0,t.angleSpread=(M=e.angleSpread)!==null&&M!==void 0?M:0,t.angleVelocityBase=(z=e.angleVelocityBase)!==null&&z!==void 0?z:0,t.angleVelocitySpread=(V=e.angleVelocitySpread)!==null&&V!==void 0?V:0,t.angleAccelerationBase=(D=e.angleAccelerationBase)!==null&&D!==void 0?D:0,t.angleAccelerationSpread=(R=e.angleAccelerationSpread)!==null&&R!==void 0?R:0,t.sizeBase=(N=e.sizeBase)!==null&&N!==void 0?N:.1,t.sizeSpread=(O=e.sizeSpread)!==null&&O!==void 0?O:0,t.sizeTween=(U=e.sizeTween)!==null&&U!==void 0?U:null,t.colorBase=(G=(j=e.colorBase)===null||j===void 0?void 0:j.clone())!==null&&G!==void 0?G:new n.Vector3,t.colorSpread=(H=(I=e.colorSpread)===null||I===void 0?void 0:I.clone())!==null&&H!==void 0?H:new n.Vector3,t.colorTween=(X=e.colorTween)!==null&&X!==void 0?X:null,t.opacityBase=((k=e.opacityBase)!==null&&k!==void 0?k:e.opacityTween)?0:1,t.opacitySpread=(v=e.opacitySpread)!==null&&v!==void 0?v:0,t.opacityTween=(p=e.opacityTween)!==null&&p!==void 0?p:null,t.particlesPerSecond=(w=e.particlesPerSecond)!==null&&w!==void 0?w:60,t.particleDeathAge=(x=e.particleDeathAge)!==null&&x!==void 0?x:1,t}return Object.defineProperty(i.prototype,"texture",{get:function(){return this.material.uniforms.map.value},set:function(e){this.material.uniforms.map.value=e,e===null?this.material.defines.USE_MAP!==!1&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):this.material.defines.USE_MAP!==!0&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"blending",{get:function(){return this.material.blending},set:function(e){this.material.blending=e},enumerable:!1,configurable:!0}),i.prototype.createInstance=function(e){var t=this.positionBase.clone();switch(this.positionStyle){case"CUBE":{t=K(this.positionBase,this.positionCubeSpread);break}case"SPHERE":{var o=2*Math.random()-1,u=Math.PI*2*Math.random(),a=Math.sqrt(1-o*o),s=new n.Vector3(a*Math.cos(u),a*Math.sin(u),o);t=new n.Vector3().addVectors(this.positionBase,s.multiplyScalar(this.positionSphereSpread));break}}var c=new n.Vector3;switch(this.velocityStyle){case"CUBE":{c=K(this.velocityCubeBase,this.velocityCubeSpread);break}case"SPHERE":{var f=new n.Vector3().subVectors(t,this.positionBase),m=q(this.velocitySphereBase,this.velocitySphereSpread);c=f.normalize().multiplyScalar(m);break}}var h=new je(e,this.particleDeathAge,t,c,K(this.accelerationBase,this.accelerationSpread),q(this.angleBase,this.angleSpread),q(this.angleVelocityBase,this.angleVelocitySpread),q(this.angleAccelerationBase,this.angleAccelerationSpread),K(this.colorBase,this.colorSpread),this.colorTween,q(this.sizeBase,this.sizeSpread),this.sizeTween,q(this.opacityBase,this.opacitySpread),this.opacityTween);return h},i.prototype.pause=function(){this.paused!==!0&&(this.paused=!0,this.birthTime=Date.now()/1e3)},i.prototype.play=function(){this.paused!==!1&&(this.paused=!1,this.birthTime=Date.now()/1e3)},i.prototype.setTime=function(e){if(!this.disposed){e/=1e3;var t=e-this.birthTime,o=Math.ceil(this.particlesPerSecond*this.particleDeathAge);if(this.geometry.attributes.position.count<o){var u=new Float32Array(o*3);u.set(this.geometry.attributes.position.array,0);var a=new n.BufferAttribute(u,3);a.needsUpdate=!0,this.geometry.setAttribute("position",a)}if(this.geometry.attributes.alive.count<o){var s=new Float32Array(o);s.set(this.geometry.attributes.alive.array,0);var a=new n.BufferAttribute(s,1);a.needsUpdate=!0,this.geometry.setAttribute("alive",a)}if(this.geometry.attributes.color.count<o){var c=new Float32Array(o*3);c.set(this.geometry.attributes.color.array,0);var a=new n.BufferAttribute(c,3);a.needsUpdate=!0,this.geometry.setAttribute("color",a)}if(this.geometry.attributes.opacity.count<o){var f=new Float32Array(o);f.set(this.geometry.attributes.opacity.array,0);var a=new n.BufferAttribute(f,1);a.needsUpdate=!0,this.geometry.setAttribute("opacity",a)}if(this.geometry.attributes.size.count<o){var m=new Float32Array(o);m.set(this.geometry.attributes.size.array,0);var a=new n.BufferAttribute(m,1);a.needsUpdate=!0,this.geometry.setAttribute("size",a)}if(this.geometry.attributes.angle.count<o){var h=new Float32Array(o);h.set(this.geometry.attributes.angle.array,0);var a=new n.BufferAttribute(h,1);a.needsUpdate=!0,this.geometry.setAttribute("angle",a)}this.instances.length<o&&(this.instances.length=o);for(var d=0;d<this.instances.length;d++){var y=this.instances[d];if(d<o&&this.paused===!1&&(y===void 0||y.getAlive(e)===!1)){var b=this.particleDeathAge/o*d;if(t>b){var S=e-(t-b)%this.particleDeathAge;this.instances[d]=y=this.createInstance(S)}}if(y){var g=y.getState(e),u=g.position,s=g.alive,c=g.color,f=g.opacity,m=g.size,h=g.angle;this.geometry.attributes.position.setXYZ(d,u.x,u.y,u.z),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.alive.setX(d,s?1:0),this.geometry.attributes.alive.needsUpdate=!0,this.geometry.attributes.color.setXYZ(d,c.r,c.g,c.b),this.geometry.attributes.color.needsUpdate=!0,this.geometry.attributes.opacity.setX(d,f),this.geometry.attributes.opacity.needsUpdate=!0,this.geometry.attributes.size.setX(d,m),this.geometry.attributes.size.needsUpdate=!0,this.geometry.attributes.angle.setX(d,h),this.geometry.attributes.angle.needsUpdate=!0}}this.geometry.computeBoundingBox(),this.geometry.boundingSphere||(this.geometry.boundingSphere=new n.Sphere),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere),this.needsRender=!0}},i.prototype.dispose=function(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)===null||e===void 0||e.dispose(),this.material.dispose()},i})(n.Points);function $(r,i){return r+i*(Math.random()-.5)}function ee(r,i){var e=new n.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new n.Vector3().addVectors(r,new n.Vector3().multiplyVectors(i,e))}var Xe=`
539
+ `,M=class extends c.Points{constructor(e){var t,n,r,i,a,o,s,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,M,N,P,F,I,L,R,z,B,V;let H=new c.BufferGeometry;H.setAttribute(`position`,new c.BufferAttribute(new Float32Array,3)),H.setAttribute(`alive`,new c.BufferAttribute(new Float32Array,1)),H.setAttribute(`color`,new c.BufferAttribute(new Float32Array,3)),H.setAttribute(`opacity`,new c.BufferAttribute(new Float32Array,1)),H.setAttribute(`size`,new c.BufferAttribute(new Float32Array,1)),H.setAttribute(`angle`,new c.BufferAttribute(new Float32Array,1));let U=new c.ShaderMaterial({uniforms:{map:{value:(t=e.texture)==null?null:t}},defines:{USE_MAP:!!e.texture},vertexShader:A,fragmentShader:j,transparent:!0,blending:(n=e.blending)==null?c.NormalBlending:n,depthWrite:!1});super(H,U),this.instances=[],this.needsRender=!0,this.birthTime=Date.now()/1e3,this.disposed=!1,this.paused=!1,this.positionBase=(i=(r=e.positionBase)==null?void 0:r.clone())==null?new c.Vector3:i,this.positionStyle=(a=e.positionStyle)==null?`CUBE`:a,this.positionCubeSpread=(s=(o=e.positionCubeSpread)==null?void 0:o.clone())==null?new c.Vector3:s,this.positionSphereSpread=(l=e.positionSphereSpread)==null?0:l,this.velocityStyle=(u=e.velocityStyle)==null?`CUBE`:u,this.velocityCubeBase=(f=(d=e.velocityCubeBase)==null?void 0:d.clone())==null?new c.Vector3:f,this.velocityCubeSpread=(m=(p=e.velocityCubeSpread)==null?void 0:p.clone())==null?new c.Vector3:m,this.velocitySphereBase=(h=e.velocitySphereBase)==null?0:h,this.velocitySphereSpread=(g=e.velocitySphereSpread)==null?0:g,this.accelerationBase=(v=(_=e.accelerationBase)==null?void 0:_.clone())==null?new c.Vector3:v,this.accelerationSpread=(b=(y=e.accelerationSpread)==null?void 0:y.clone())==null?new c.Vector3:b,this.angleBase=(x=e.angleBase)==null?0:x,this.angleSpread=(S=e.angleSpread)==null?0:S,this.angleVelocityBase=(C=e.angleVelocityBase)==null?0:C,this.angleVelocitySpread=(w=e.angleVelocitySpread)==null?0:w,this.angleAccelerationBase=(T=e.angleAccelerationBase)==null?0:T,this.angleAccelerationSpread=(E=e.angleAccelerationSpread)==null?0:E,this.sizeBase=(D=e.sizeBase)==null?.1:D,this.sizeSpread=(O=e.sizeSpread)==null?0:O,this.sizeTween=(k=e.sizeTween)==null?null:k,this.colorBase=(N=(M=e.colorBase)==null?void 0:M.clone())==null?new c.Vector3:N,this.colorSpread=(F=(P=e.colorSpread)==null?void 0:P.clone())==null?new c.Vector3:F,this.colorTween=(I=e.colorTween)==null?null:I,this.opacityBase=((L=e.opacityBase)==null?e.opacityTween:L)?0:1,this.opacitySpread=(R=e.opacitySpread)==null?0:R,this.opacityTween=(z=e.opacityTween)==null?null:z,this.particlesPerSecond=(B=e.particlesPerSecond)==null?60:B,this.particleDeathAge=(V=e.particleDeathAge)==null?1:V}get texture(){return this.material.uniforms.map.value}set texture(e){this.material.uniforms.map.value=e,e===null?this.material.defines.USE_MAP!==!1&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):this.material.defines.USE_MAP!==!0&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)}get blending(){return this.material.blending}set blending(e){this.material.blending=e}createInstance(e){let t=this.positionBase.clone();switch(this.positionStyle){case`CUBE`:t=T(this.positionBase,this.positionCubeSpread);break;case`SPHERE`:{let e=2*Math.random()-1,n=Math.PI*2*Math.random(),r=Math.sqrt(1-e*e),i=new c.Vector3(r*Math.cos(n),r*Math.sin(n),e);t=new c.Vector3().addVectors(this.positionBase,i.multiplyScalar(this.positionSphereSpread));break}default:break}let n=new c.Vector3;switch(this.velocityStyle){case`CUBE`:n=T(this.velocityCubeBase,this.velocityCubeSpread);break;case`SPHERE`:{let e=new c.Vector3().subVectors(t,this.positionBase),r=w(this.velocitySphereBase,this.velocitySphereSpread);n=e.normalize().multiplyScalar(r);break}default:break}return new k(e,this.particleDeathAge,t,n,T(this.accelerationBase,this.accelerationSpread),w(this.angleBase,this.angleSpread),w(this.angleVelocityBase,this.angleVelocitySpread),w(this.angleAccelerationBase,this.angleAccelerationSpread),T(this.colorBase,this.colorSpread),this.colorTween,w(this.sizeBase,this.sizeSpread),this.sizeTween,w(this.opacityBase,this.opacitySpread),this.opacityTween)}pause(){this.paused!==!0&&(this.paused=!0,this.birthTime=Date.now()/1e3)}play(){this.paused!==!1&&(this.paused=!1,this.birthTime=Date.now()/1e3)}setTime(e){if(this.disposed)return;e/=1e3;let t=e-this.birthTime,n=Math.ceil(this.particlesPerSecond*this.particleDeathAge);if(this.geometry.attributes.position.count<n){let e=new Float32Array(n*3);e.set(this.geometry.attributes.position.array,0);let t=new c.BufferAttribute(e,3);t.needsUpdate=!0,this.geometry.setAttribute(`position`,t)}if(this.geometry.attributes.alive.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.alive.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`alive`,t)}if(this.geometry.attributes.color.count<n){let e=new Float32Array(n*3);e.set(this.geometry.attributes.color.array,0);let t=new c.BufferAttribute(e,3);t.needsUpdate=!0,this.geometry.setAttribute(`color`,t)}if(this.geometry.attributes.opacity.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.opacity.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`opacity`,t)}if(this.geometry.attributes.size.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.size.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`size`,t)}if(this.geometry.attributes.angle.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.angle.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`angle`,t)}this.instances.length<n&&(this.instances.length=n);for(let r=0;r<this.instances.length;r++){let i=this.instances[r];if(r<n&&this.paused===!1&&(i===void 0||i.getAlive(e)===!1)){let a=this.particleDeathAge/n*r;if(t>a){let n=e-(t-a)%this.particleDeathAge;this.instances[r]=i=this.createInstance(n)}}if(i){let{position:t,alive:n,color:a,opacity:o,size:s,angle:c}=i.getState(e);this.geometry.attributes.position.setXYZ(r,t.x,t.y,t.z),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.alive.setX(r,n?1:0),this.geometry.attributes.alive.needsUpdate=!0,this.geometry.attributes.color.setXYZ(r,a.r,a.g,a.b),this.geometry.attributes.color.needsUpdate=!0,this.geometry.attributes.opacity.setX(r,o),this.geometry.attributes.opacity.needsUpdate=!0,this.geometry.attributes.size.setX(r,s),this.geometry.attributes.size.needsUpdate=!0,this.geometry.attributes.angle.setX(r,c),this.geometry.attributes.angle.needsUpdate=!0}}this.geometry.computeBoundingBox(),this.geometry.boundingSphere||(this.geometry.boundingSphere=new c.Sphere),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere),this.needsRender=!0}dispose(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)==null||e.dispose(),this.material.dispose()}};function N(e,t){return e+t*(Math.random()-.5)}function P(e,t){let n=new c.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new c.Vector3().addVectors(e,new c.Vector3().multiplyVectors(t,n))}var F=`
540
540
  // 粒子初始属性
541
541
  attribute vec3 initialVelocity;
542
542
  attribute vec3 acceleration;
@@ -613,7 +613,7 @@ void main() {
613
613
  gl_PointSize = currentSize * (300.0 / length(mvPosition.xyz));
614
614
  gl_Position = projectionMatrix * mvPosition;
615
615
  }
616
- `,ke=`
616
+ `,I=`
617
617
  varying vec4 vColor;
618
618
  varying float vAngle;
619
619
 
@@ -643,4 +643,4 @@ void main() {
643
643
  gl_FragColor = vColor * textureColor;
644
644
  #endif
645
645
  }
646
- `,Le=(function(r){Y(i,r);function i(e){for(var t=this,o,u,a,s,c,f,m,h,d,y,b,S,g,_,C,E,B,P,F,T,M,z,V,D,R,N,O,U,j,G,I,H,X,k,v=Math.ceil(((o=e.particlesPerSecond)!==null&&o!==void 0?o:60)*((u=e.particleDeathAge)!==null&&u!==void 0?u:1)),p=new n.BufferGeometry,w=new Float32Array(v*3),x=new Float32Array(v*3),A=new Float32Array(v*3),Z=new Float32Array(v),ce=new Float32Array(v),de=new Float32Array(v),ve=new Float32Array(v),J=new Float32Array(v*3),fe=new Float32Array(v),pe=new Float32Array(v),me=new Float32Array(v),he=new Float32Array(v),l=0;l<v;l++){var _e=((a=e.particleDeathAge)!==null&&a!==void 0?a:1)/v*l;Z[l]=_e,ce[l]=(s=e.particleDeathAge)!==null&&s!==void 0?s:1,he[l]=l;var L=(f=(c=e.positionBase)===null||c===void 0?void 0:c.clone())!==null&&f!==void 0?f:new n.Vector3;switch((m=e.positionStyle)!==null&&m!==void 0?m:"CUBE"){case"CUBE":{L=ee((h=e.positionBase)!==null&&h!==void 0?h:new n.Vector3,(d=e.positionCubeSpread)!==null&&d!==void 0?d:new n.Vector3);break}case"SPHERE":{var ne=2*Math.random()-1,ye=Math.PI*2*Math.random(),ge=Math.sqrt(1-ne*ne),Ce=new n.Vector3(ge*Math.cos(ye),ge*Math.sin(ye),ne);L=new n.Vector3().addVectors((y=e.positionBase)!==null&&y!==void 0?y:new n.Vector3,Ce.multiplyScalar((b=e.positionSphereSpread)!==null&&b!==void 0?b:0));break}}w[l*3]=L.x,w[l*3+1]=L.y,w[l*3+2]=L.z;var W=new n.Vector3;switch((S=e.velocityStyle)!==null&&S!==void 0?S:"CUBE"){case"CUBE":{W=ee((g=e.velocityCubeBase)!==null&&g!==void 0?g:new n.Vector3,(_=e.velocityCubeSpread)!==null&&_!==void 0?_:new n.Vector3);break}case"SPHERE":{var Ee=new n.Vector3().subVectors(L,(C=e.positionBase)!==null&&C!==void 0?C:new n.Vector3),Be=$((E=e.velocitySphereBase)!==null&&E!==void 0?E:0,(B=e.velocitySphereSpread)!==null&&B!==void 0?B:0);W=Ee.normalize().multiplyScalar(Be);break}}x[l*3]=W.x,x[l*3+1]=W.y,x[l*3+2]=W.z;var ie=ee((P=e.accelerationBase)!==null&&P!==void 0?P:new n.Vector3,(F=e.accelerationSpread)!==null&&F!==void 0?F:new n.Vector3);A[l*3]=ie.x,A[l*3+1]=ie.y,A[l*3+2]=ie.z,de[l]=$((T=e.sizeBase)!==null&&T!==void 0?T:.1,(M=e.sizeSpread)!==null&&M!==void 0?M:0),ve[l]=(z=e.sizeGrowth)!==null&&z!==void 0?z:0;var re=ee((V=e.colorBase)!==null&&V!==void 0?V:new n.Vector3,(D=e.colorSpread)!==null&&D!==void 0?D:new n.Vector3);J[l*3]=re.x,J[l*3+1]=re.y,J[l*3+2]=re.z,fe[l]=$((R=e.opacityBase)!==null&&R!==void 0?R:1,(N=e.opacitySpread)!==null&&N!==void 0?N:0),pe[l]=$((O=e.angleBase)!==null&&O!==void 0?O:0,(U=e.angleSpread)!==null&&U!==void 0?U:0),me[l]=$((j=e.angleVelocityBase)!==null&&j!==void 0?j:0,(G=e.angleVelocitySpread)!==null&&G!==void 0?G:0)}p.setAttribute("position",new n.BufferAttribute(w,3)),p.setAttribute("initialVelocity",new n.BufferAttribute(x,3)),p.setAttribute("acceleration",new n.BufferAttribute(A,3)),p.setAttribute("birthTime",new n.BufferAttribute(Z,1)),p.setAttribute("lifeTime",new n.BufferAttribute(ce,1)),p.setAttribute("initialSize",new n.BufferAttribute(de,1)),p.setAttribute("sizeGrowth",new n.BufferAttribute(ve,1)),p.setAttribute("initialColor",new n.BufferAttribute(J,3)),p.setAttribute("initialOpacity",new n.BufferAttribute(fe,1)),p.setAttribute("initialAngle",new n.BufferAttribute(pe,1)),p.setAttribute("angleVelocity",new n.BufferAttribute(me,1)),p.setAttribute("particleIndex",new n.BufferAttribute(he,1));var Pe=new n.ShaderMaterial({uniforms:{map:{value:(I=e.texture)!==null&&I!==void 0?I:null},uTime:{value:0}},defines:{USE_MAP:!!e.texture},vertexShader:Xe,fragmentShader:ke,transparent:!0,blending:(H=e.blending)!==null&&H!==void 0?H:n.NormalBlending,depthWrite:!1});return t=r.call(this,p,Pe)||this,t.needsRender=!0,t.startTime=Date.now()/1e3,t.disposed=!1,t.paused=!1,t.particleCount=v,t.particlesPerSecond=(X=e.particlesPerSecond)!==null&&X!==void 0?X:60,t.particleDeathAge=(k=e.particleDeathAge)!==null&&k!==void 0?k:1,t}return Object.defineProperty(i.prototype,"texture",{get:function(){return this.material.uniforms.map.value},set:function(e){this.material.uniforms.map.value=e,e===null?this.material.defines.USE_MAP!==!1&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):this.material.defines.USE_MAP!==!0&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"blending",{get:function(){return this.material.blending},set:function(e){this.material.blending=e},enumerable:!1,configurable:!0}),i.prototype.pause=function(){this.paused!==!0&&(this.paused=!0,this.startTime=Date.now()/1e3)},i.prototype.play=function(){this.paused!==!1&&(this.paused=!1,this.startTime=Date.now()/1e3)},i.prototype.setTime=function(e){if(!(this.disposed||this.paused)){var t=e/1e3,o=t-this.startTime;this.material.uniforms.uTime.value=o,this.needsRender=!0}},i.prototype.dispose=function(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)===null||e===void 0||e.dispose(),this.material.dispose()},i})(n.Points);exports.Airflow=Oe;exports.Flame=Ve;exports.Particle=He;exports.ParticleGPU=Le;exports.SpotLight=Ne;
646
+ `,L=class extends c.Points{constructor(e){var t,n,r,i,a,o,s,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,L,R,z;let B=Math.ceil(((t=e.particlesPerSecond)==null?60:t)*((n=e.particleDeathAge)==null?1:n)),V=new c.BufferGeometry,H=new Float32Array(B*3),U=new Float32Array(B*3),W=new Float32Array(B*3),G=new Float32Array(B),K=new Float32Array(B),q=new Float32Array(B),J=new Float32Array(B),Y=new Float32Array(B*3),X=new Float32Array(B),Z=new Float32Array(B),Q=new Float32Array(B),$=new Float32Array(B);for(let t=0;t<B;t++){G[t]=((r=e.particleDeathAge)==null?1:r)/B*t,K[t]=(i=e.particleDeathAge)==null?1:i,$[t]=t;let n=(o=(a=e.positionBase)==null?void 0:a.clone())==null?new c.Vector3:o;switch((s=e.positionStyle)==null?`CUBE`:s){case`CUBE`:n=P((l=e.positionBase)==null?new c.Vector3:l,(u=e.positionCubeSpread)==null?new c.Vector3:u);break;case`SPHERE`:{let t=2*Math.random()-1,r=Math.PI*2*Math.random(),i=Math.sqrt(1-t*t),a=new c.Vector3(i*Math.cos(r),i*Math.sin(r),t);n=new c.Vector3().addVectors((d=e.positionBase)==null?new c.Vector3:d,a.multiplyScalar((f=e.positionSphereSpread)==null?0:f));break}}H[t*3]=n.x,H[t*3+1]=n.y,H[t*3+2]=n.z;let M=new c.Vector3;switch((p=e.velocityStyle)==null?`CUBE`:p){case`CUBE`:M=P((m=e.velocityCubeBase)==null?new c.Vector3:m,(h=e.velocityCubeSpread)==null?new c.Vector3:h);break;case`SPHERE`:{let t=new c.Vector3().subVectors(n,(g=e.positionBase)==null?new c.Vector3:g),r=N((_=e.velocitySphereBase)==null?0:_,(v=e.velocitySphereSpread)==null?0:v);M=t.normalize().multiplyScalar(r);break}}U[t*3]=M.x,U[t*3+1]=M.y,U[t*3+2]=M.z;let F=P((y=e.accelerationBase)==null?new c.Vector3:y,(b=e.accelerationSpread)==null?new c.Vector3:b);W[t*3]=F.x,W[t*3+1]=F.y,W[t*3+2]=F.z,q[t]=N((x=e.sizeBase)==null?.1:x,(S=e.sizeSpread)==null?0:S),J[t]=(C=e.sizeGrowth)==null?0:C;let I=P((w=e.colorBase)==null?new c.Vector3:w,(T=e.colorSpread)==null?new c.Vector3:T);Y[t*3]=I.x,Y[t*3+1]=I.y,Y[t*3+2]=I.z,X[t]=N((E=e.opacityBase)==null?1:E,(D=e.opacitySpread)==null?0:D),Z[t]=N((O=e.angleBase)==null?0:O,(k=e.angleSpread)==null?0:k),Q[t]=N((A=e.angleVelocityBase)==null?0:A,(j=e.angleVelocitySpread)==null?0:j)}V.setAttribute(`position`,new c.BufferAttribute(H,3)),V.setAttribute(`initialVelocity`,new c.BufferAttribute(U,3)),V.setAttribute(`acceleration`,new c.BufferAttribute(W,3)),V.setAttribute(`birthTime`,new c.BufferAttribute(G,1)),V.setAttribute(`lifeTime`,new c.BufferAttribute(K,1)),V.setAttribute(`initialSize`,new c.BufferAttribute(q,1)),V.setAttribute(`sizeGrowth`,new c.BufferAttribute(J,1)),V.setAttribute(`initialColor`,new c.BufferAttribute(Y,3)),V.setAttribute(`initialOpacity`,new c.BufferAttribute(X,1)),V.setAttribute(`initialAngle`,new c.BufferAttribute(Z,1)),V.setAttribute(`angleVelocity`,new c.BufferAttribute(Q,1)),V.setAttribute(`particleIndex`,new c.BufferAttribute($,1));let ee=new c.ShaderMaterial({uniforms:{map:{value:(M=e.texture)==null?null:M},uTime:{value:0}},defines:{USE_MAP:!!e.texture},vertexShader:F,fragmentShader:I,transparent:!0,blending:(L=e.blending)==null?c.NormalBlending:L,depthWrite:!1});super(V,ee),this.needsRender=!0,this.startTime=Date.now()/1e3,this.disposed=!1,this.paused=!1,this.particleCount=B,this.particlesPerSecond=(R=e.particlesPerSecond)==null?60:R,this.particleDeathAge=(z=e.particleDeathAge)==null?1:z}get texture(){return this.material.uniforms.map.value}set texture(e){this.material.uniforms.map.value=e,e===null?this.material.defines.USE_MAP!==!1&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):this.material.defines.USE_MAP!==!0&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)}get blending(){return this.material.blending}set blending(e){this.material.blending=e}pause(){this.paused!==!0&&(this.paused=!0,this.startTime=Date.now()/1e3)}play(){this.paused!==!1&&(this.paused=!1,this.startTime=Date.now()/1e3)}setTime(e){if(this.disposed||this.paused)return;let t=e/1e3-this.startTime;this.material.uniforms.uTime.value=t,this.needsRender=!0}dispose(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)==null||e.dispose(),this.material.dispose()}};exports.Airflow=C,exports.Flame=g,exports.Particle=M,exports.ParticleGPU=L,exports.SpotLight=y;