@adatechnology/game-destruction-three 0.24.1 → 0.24.2

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.
@@ -7829,6 +7829,7 @@ var GameDestructionThree = (() => {
7829
7829
  const key = event.stage !== void 0 ? String(event.stage) : event.material;
7830
7830
  return key === void 0 ? void 0 : entry[key];
7831
7831
  }
7832
+ var DEGREES = 180 / Math.PI;
7832
7833
 
7833
7834
  // ../game-render-three/dist/index.js
7834
7835
  var DEFAULT_ANGLE = Math.PI / 3;
@@ -9359,6 +9360,42 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
9359
9360
  }
9360
9361
  var LIGHT_BUDGET = EVENT_BUDGET.blastLights + EVENT_BUDGET.fireLights;
9361
9362
 
9363
+ // ../game-vfx-three/dist/index.js
9364
+ var NOISE = `float wHash(vec2 p){return fract(sin(dot(p,vec2(12.9898,78.233)))*43758.5453);}
9365
+ float wNoise(vec2 p){vec2 i=floor(p);vec2 f=fract(p);f=f*f*(3.-2.*f);return mix(mix(wHash(i),wHash(i+vec2(1.,0.)),f.x),mix(wHash(i+vec2(0.,1.)),wHash(i+vec2(1.,1.)),f.x),f.y);}`;
9366
+ var OUTPUT = `
9367
+ #include <tonemapping_fragment>
9368
+ #include <colorspace_fragment>`;
9369
+ var WATER_SURFACE_FRAGMENT = `uniform vec3 uFoam;varying vec2 vU;varying vec3 vD;${NOISE}
9370
+ void main(){float r=length(vU);if(r>1.)discard;float a=atan(vU.y,vU.x);float kind=vD.y;float s=vD.z;float m;
9371
+ if(kind>2.5){float n=wNoise(vU*7.+s*13.)*.6+wNoise(vU*19.-s*7.)*.4;m=smoothstep(1.,.55,r)*smoothstep(.25,.6,n);}
9372
+ else{float w=kind>1.5?.16:kind>.5?.05:.09;float band=smoothstep(1.,1.-w,r)*smoothstep(1.-w*3.,1.-w,r);float broken=kind>.5?1.:.65+.35*wNoise(vec2(a*5.+s*20.,s));m=band*broken;}
9373
+ float alpha=m*vD.x;if(alpha<.004)discard;gl_FragColor=vec4(uFoam,alpha);${OUTPUT}
9374
+ }`;
9375
+ var WATER_SPRITE_FRAGMENT = `uniform vec3 uFoam;uniform vec3 uDeep;varying vec2 vU;varying vec3 vD;${NOISE}
9376
+ void main(){float r=length(vU);if(r>1.)discard;float kind=vD.y;float m;vec3 c=uFoam;
9377
+ if(kind>1.5){m=exp(-r*r*3.)*(.75+.25*wNoise(vU*3.+vD.z*9.));}
9378
+ else if(kind>.5){m=smoothstep(.55,.85,r)*smoothstep(1.,.88,r)+.25*smoothstep(.5,.2,length(vU-vec2(-.3,.3)));c=mix(uDeep,uFoam,.8);}
9379
+ else{m=smoothstep(1.,.6,r);c=mix(uDeep,uFoam,.55+.45*smoothstep(.2,.8,1.-length(vU-vec2(-.3,.35))));}
9380
+ float alpha=m*vD.x;if(alpha<.004)discard;gl_FragColor=vec4(c,alpha);${OUTPUT}
9381
+ }`;
9382
+ var WATER_COLUMN_VERTEX = `attribute vec4 aP;attribute vec4 aD;attribute vec2 aK;varying float vY;varying float vA;varying vec2 vK;varying float vF;${NOISE}
9383
+ void main(){vY=position.y;float ang=atan(position.z,position.x);vK=aK;
9384
+ float dome=aK.x;float s=aK.y;float h=position.y;
9385
+ float jag=.8+.4*wNoise(vec2(ang*3.+s*17.,h*4.+s));
9386
+ float flare=dome>.5?1.:(.55+.9*h*h)*jag;
9387
+ vec3 p=vec3(position.x*aP.w*flare,position.y*aD.x,position.z*aP.w*flare);
9388
+ p.x+=aD.z*aD.x*h*h;p.z+=aD.w*aD.x*h*h;
9389
+ vec3 w=aP.xyz+p;vec3 n=normalize(vec3(position.x,dome>.5?position.y:.25,position.z));
9390
+ vec3 v=normalize(cameraPosition-w);vF=abs(dot(n,v));
9391
+ vA=aD.y;gl_Position=projectionMatrix*viewMatrix*vec4(w,1.);}`;
9392
+ var WATER_COLUMN_FRAGMENT = `uniform vec3 uFoam;uniform vec3 uDeep;varying float vY;varying float vA;varying vec2 vK;varying float vF;${NOISE}
9393
+ void main(){float dome=vK.x;float s=vK.y;
9394
+ float streak=wNoise(vec2(gl_FragCoord.x*.05+s*31.,vY*6.+s));
9395
+ float body=dome>.5?mix(.95,.5,vY)*(.6+.4*(1.-vF)):(1.-smoothstep(.55,1.,vY))*(.45+.55*streak)*(.55+.45*(1.-vF*.6));
9396
+ vec3 c=mix(uDeep,uFoam,dome>.5?.8:.65+.35*vY);float alpha=body*vA;if(alpha<.004)discard;gl_FragColor=vec4(c,alpha);${OUTPUT}
9397
+ }`;
9398
+
9362
9399
  // src/fitted-boxes.ts
9363
9400
  var SLICE_LENGTH = 0.12;
9364
9401
  var MAX_SLICES = 12;
@@ -9852,6 +9889,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
9852
9889
  rouse(f) {
9853
9890
  f.asleep = false;
9854
9891
  f.rest = 0;
9892
+ f.floor = null;
9855
9893
  f.mesh.matrixAutoUpdate = true;
9856
9894
  }
9857
9895
  /** What lies inside the disc looks at the ground again: it was dug or heaped under it. */
@@ -9897,6 +9935,7 @@ void main(){vec2 d=gl_PointCoord-.5;float r=length(d)*2.;if(r>1.)discard;float a
9897
9935
  if (!f.asleep || f.dying) continue;
9898
9936
  const e = this.m.makeRotationFromQuaternion(f.mesh.quaternion).elements;
9899
9937
  const ext = Math.abs(e[1]) * f.half.x + Math.abs(e[5]) * f.half.y + Math.abs(e[9]) * f.half.z;
9938
+ f.floor = null;
9900
9939
  if (f.mesh.position.y - ext > this.floorUnder(f) + SUPPORT_GAP) this.rouse(f);
9901
9940
  }
9902
9941
  }