phy-engine
Version:
JavaScript 3D Physics for three.js
1 lines • 3.51 MB
JavaScript
const t=new Map,A=new Map,e={LAYER_NON_MOVING:0,LAYER_MOVING:1,LAYER_ALL:1,Ar:null,ArPos:{},ms:0,deltaTime:0,invDelta:0,physicsSystem:null,bodyInterface:null,world:null,groupFilter:null,delta:0,tmpStep:0,gravity:null,key:[],reflow:{ray:[],point:{},contact:{},velocity:{},stat:{fps:0,delta:0,ms:0}}},n={clear:()=>{t.clear(),A.clear()},byName:A=>t.has(A)?t.get(A):null,byContact:t=>A.has(t),clearContact:()=>{A.clear()},addContact:(t,e={})=>{n.byContact(t)||A.set(t,e)},removeContact:t=>{A.delete(t)},add:A=>{if("ray"!==A.type&&"contact"!==A.type)switch(A.type){case"joint":e.physicsSystem.AddConstraint(A);break;case"body":case"solid":e.bodyInterface.AddBody(A.GetID(),Jolt.EActivation_Activate)}t.set(A.name,A)},remove:A=>{if("ray"!==A.type&&"contact"!==A.type)switch(A.type){case"terrain":A.release();break;case"joint":e.physicsSystem.RemoveConstraint(A);break;case"body":case"solid":e.bodyInterface.RemoveBody(A.GetID()),e.bodyInterface.DestroyBody(A.GetID())}t.delete(A.name)},stats:()=>{},extends:()=>{Jolt.Vec3.prototype.set=function(t,A,e){return this.Set(t,A,e),this},Jolt.Vec3.prototype.clone=function(t){return new Jolt.RVec3(t.GetX(),t.GetY(),t.GetZ())},Jolt.Vec3.prototype.fromArray=function(t,A){return A=A||0,this.Set(t[A],t[A+1],t[A+2]),this},Jolt.Vec3.prototype.toArray=function(t,A){let e=void 0!==t;if(e||(t=[]),t[A=A||0]=this.GetX(),t[A+1]=this.GetY(),t[A+2]=this.GetZ(),!e)return t},Jolt.RVec3.prototype.set=function(t,A,e){return this.Set(t,A,e),this},Jolt.RVec3.prototype.clone=function(t){return new Jolt.RVec3(t.GetX(),t.GetY(),t.GetZ())},Jolt.RVec3.prototype.fromArray=function(t,A){return A=A||0,this.Set(t[A],t[A+1],t[A+2]),this},Jolt.RVec3.prototype.toArray=function(t,A){let e=void 0!==t;if(e||(t=[]),t[A=A||0]=this.GetX(),t[A+1]=this.GetY(),t[A+2]=this.GetZ(),!e)return t},Jolt.Quat.prototype.set=function(t,A,e,n){return this.Set(t,A,e,n),this},Jolt.Quat.prototype.fromArray=function(t,A){return A=A||0,this.Set(t[A],t[A+1],t[A+2],t[A+3]),this},Jolt.Quat.prototype.toArray=function(t,A){let e=void 0!==t;if(e||(t=[]),t[A=A||0]=this.GetX(),t[A+1]=this.GetY(),t[A+2]=this.GetZ(),t[A+3]=this.GetW(),!e)return t},Jolt.Quat.prototype.identity=function(){return this.Set(0,0,0,1),this},Jolt.Mat44.prototype.toArray=function(t,A){return[this.GetTranslation().toArray(),this.GetQuaternion().toArray()]}}},r=4e3,o=1e3,b=4e3,f=100,i=100,v={bodyFull:14,body:8,joint:16,contact:1,ray:11,character:16,vehicle:72,solver:128};class a{constructor(){this.id=0,this.list=[],this.type="item",this.Utils=null}reset(){let t=this.list.length;for(;t--;)this.dispose(this.list[t]);this.list=[],this.id=0}byName(t){return this.Utils.byName(t)}setName(t={}){let A=void 0!==t.name?t.name:this.type+this.id++;return t.id=this.remove(A,!0),t.name=A,A}addToWorld(t,A=-1){this.Utils.add(t),-1!==A?this.list[A]=t:this.list.push(t)}remove(t,A){let e=this.byName(t);return e?this.clear(e,A):-1}clear(t,A){let e=this.list.indexOf(t);return-1===e||A?this.list[e]=null:this.list.splice(e,1),this.dispose(t),e}dispose(t){null!==t&&this.Utils.remove(t)}add(t={}){}set(t={}){}step(t,A){}}const p=3.141592653589793,_=p/180,j=180/p,s=Number.EPSILON,c=.5*p,y={luminousPowers:{"110000 lm (1000W)":11e4,"3500 lm (300W)":3500,"1700 lm (100W)":1700,"800 lm (60W)":800,"400 lm (40W)":400,"180 lm (25W)":180,"20 lm (4W)":20,Off:0},luminousIrradiances:{"0.0001 lx (Moonless Night)":1e-4,"0.002 lx (Night Airglow)":.002,"0.5 lx (Full Moon)":.5,"3.4 lx (City Twilight)":3.4,"50 lx (Living Room)":50,"100 lx (Very Overcast)":100,"350 lx (Office Room)":350,"400 lx (Sunrise/Sunset)":400,"1000 lx (Overcast)":1e3,"18000 lx (Daylight)":18e3,"50000 lx (Direct Sun)":5e4},exposure:t=>Math.pow(t,5),candelaToLumens:t=>4*t*Math.PI,lumensToCandela:t=>t/(4*Math.PI),average:t=>t?.reduce(((t,A)=>t+A),0)/t.length,atan2:(t,A)=>Math.fround(Math.atan2(t,A)),pow:(t,A)=>Math.fround(Math.pow(t,A)),sin:t=>Math.fround(Math.sin(t)),cos:t=>Math.fround(Math.cos(t)),sqrt:t=>Math.fround(Math.sqrt(t)),exp:t=>Math.fround(Math.exp(t)),todeg:j,torad:_,toFixed:(t,A=3)=>1*t.toFixed(A),toRound:(t,A=3)=>Math.trunc(t),clamp:(t,A=0,e=1)=>t<A?A:t>e?e:t,min:(t,A)=>t<A?t:A,max:(t,A)=>t>A?t:A,lerp:(t,A,e)=>(1-e)*t+e*A,sign:t=>t>0?1:t<0?-1:0,fast_negexp:t=>1/(1+t+.48*t*t+.235*t*t*t),fast_atan:t=>{let A=Math.abs(t),e=A>1?1/A:A,n=p/4*e-e*(e-1)*(.2447+.0663*e);return copysign(A>1?p/2-n:n,t)},clampA:(t,A,e)=>Math.max(A,Math.min(e,t)),smoothstep:(t,A,e)=>t*(e=-2*(e=y.clamp(e))*e*e+3*e*e)+A*(1-e),remap:(t,A,e,n,r)=>n+(t-A)*(r-n)/(e-A),damp:(t,A,e,n)=>y.lerp(t,A,1-Math.exp(-e*n)),nearAngle:(t,A,e=!1)=>A+Math.atan2(Math.sin(t-A),Math.cos(t-A))*(e?j:1),unwrapDeg:t=>t-360*Math.floor((t+180)/360),unwrapRad:t=>Math.atan2(Math.sin(t),Math.cos(t)),nearEquals:(t,A,e=1e-4)=>Math.abs(t-A)<=e,autoSize:(t=[1,1,1],A="box")=>{1===t.length&&(t[1]=t[0]);let e=t[0],n=t[1];return"sphere"===A&&(t=[e,e,e]),"cylinder"!==A&&"wheel"!==A&&"capsule"!==A||(t=[e,n,e]),"cone"!==A&&"pyramid"!==A||(t=[e,n,e]),2===t.length&&(t[2]=t[0]),t},shuffle:t=>t.map((t=>({value:t,sort:Math.random()}))).sort(((t,A)=>t.sort-A.sort)).map((({value:t})=>t)),randomSign:()=>Math.random()<.5?-1:1,randSpread:t=>t*(.5-Math.random()),rand:(t=0,A=1)=>t+Math.random()*(A-t),randInt:(t,A)=>t+Math.floor(Math.random()*(A-t+1)),randIntUnic:(t,A,e)=>{for(var n=[];n.length<e;){var r=y.randInt(t,A);-1===n.indexOf(r)&&n.push(r)}return n},fromTransform:(t,A,e,n=[0,0,0,1],r=!1)=>{let o=y.composeMatrixArray(t,A),b=y.composeMatrixArray(e,n);return r&&(o=y.invertMatrixArray(o)),o=y.multiplyMatrixArray(o,b),[o[12],o[13],o[14]]},fromTransformToQ:(t,A,e=!1)=>{let n=y.composeMatrixArray(t,A),r=y.decomposeFullMatrixArray(n).q;return e&&(r=y.quatInvert(r)),r},lerpTransform:(t,A,e)=>{let n=t[0],r=t[1],o=A[0],b=A[1];return o=y.lerpArray(n,o,e),b=y.slerpQuatArray(r,b,e),[o,b]},Mat3FromQuatArray:t=>{let A=t[3],e=t[0],n=t[1],r=t[2];return[[2*(A*A+e*e)-1,2*(e*n+A*r),2*(e*r-A*n)],[2*(e*n-A*r),2*(A*A+n*n)-1,2*(n*r+A*e)],[2*(e*r+A*n),2*(n*r-A*e),2*(A*A+r*r)-1]]},composeMatrixArray:(t,A,e=[1,1,1])=>{const n=A[0],r=A[1],o=A[2],b=A[3],f=n+n,i=r+r,v=o+o,a=n*f,p=n*i,_=n*v,j=r*i,s=r*v,c=o*v,y=b*f,x=b*i,C=b*v,d=e[0],l=e[1],u=e[2];return[(1-(j+c))*d,(p+C)*d,(_-x)*d,0,(p-C)*l,(1-(a+c))*l,(s+y)*l,0,(_+x)*u,(s-y)*u,(1-(a+j))*u,0,t[0],t[1],t[2],1]},multiplyMatrixArray:(t,A)=>{const e=t,n=A,r=[],o=e[0],b=e[4],f=e[8],i=e[12],v=e[1],a=e[5],p=e[9],_=e[13],j=e[2],s=e[6],c=e[10],y=e[14],x=e[3],C=e[7],d=e[11],l=e[15],u=n[0],h=n[4],D=n[8],$=n[12],m=n[1],k=n[5],S=n[9],B=n[13],q=n[2],g=n[6],E=n[10],G=n[14],P=n[3],F=n[7],I=n[11],O=n[15];return r[0]=o*u+b*m+f*q+i*P,r[4]=o*h+b*k+f*g+i*F,r[8]=o*D+b*S+f*E+i*I,r[12]=o*$+b*B+f*G+i*O,r[1]=v*u+a*m+p*q+_*P,r[5]=v*h+a*k+p*g+_*F,r[9]=v*D+a*S+p*E+_*I,r[13]=v*$+a*B+p*G+_*O,r[2]=j*u+s*m+c*q+y*P,r[6]=j*h+s*k+c*g+y*F,r[10]=j*D+s*S+c*E+y*I,r[14]=j*$+s*B+c*G+y*O,r[3]=x*u+C*m+d*q+l*P,r[7]=x*h+C*k+d*g+l*F,r[11]=x*D+C*S+d*E+l*I,r[15]=x*$+C*B+d*G+l*O,r},invertMatrixArray:t=>{const A=t,e=A[0],n=A[1],r=A[2],o=A[3],b=A[4],f=A[5],i=A[6],v=A[7],a=A[8],p=A[9],_=A[10],j=A[11],s=A[12],c=A[13],y=A[14],x=A[15],C=p*y*v-c*_*v+c*i*j-f*y*j-p*i*x+f*_*x,d=s*_*v-a*y*v-s*i*j+b*y*j+a*i*x-b*_*x,l=a*c*v-s*p*v+s*f*j-b*c*j-a*f*x+b*p*x,u=s*p*i-a*c*i-s*f*_+b*c*_+a*f*y-b*p*y,h=e*C+n*d+r*l+o*u;if(0===h)return[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];const D=1/h;return A[0]=C*D,A[1]=(c*_*o-p*y*o-c*r*j+n*y*j+p*r*x-n*_*x)*D,A[2]=(f*y*o-c*i*o+c*r*v-n*y*v-f*r*x+n*i*x)*D,A[3]=(p*i*o-f*_*o-p*r*v+n*_*v+f*r*j-n*i*j)*D,A[4]=d*D,A[5]=(a*y*o-s*_*o+s*r*j-e*y*j-a*r*x+e*_*x)*D,A[6]=(s*i*o-b*y*o-s*r*v+e*y*v+b*r*x-e*i*x)*D,A[7]=(b*_*o-a*i*o+a*r*v-e*_*v-b*r*j+e*i*j)*D,A[8]=l*D,A[9]=(s*p*o-a*c*o-s*n*j+e*c*j+a*n*x-e*p*x)*D,A[10]=(b*c*o-s*f*o+s*n*v-e*c*v-b*n*x+e*f*x)*D,A[11]=(a*f*o-b*p*o-a*n*v+e*p*v+b*n*j-e*f*j)*D,A[12]=u*D,A[13]=(a*c*r-s*p*r+s*n*_-e*c*_-a*n*y+e*p*y)*D,A[14]=(s*f*r-b*c*r-s*n*i+e*c*i+b*n*y-e*f*y)*D,A[15]=(b*p*r-a*f*r+a*n*i-e*p*i-b*n*_+e*f*_)*D,A},matrixArrayDeterminant:t=>{const A=t,e=A[0],n=A[4],r=A[8],o=A[12],b=A[1],f=A[5],i=A[9],v=A[13],a=A[2],p=A[6],_=A[10],j=A[14];return A[3]*(+o*i*p-r*v*p-o*f*_+n*v*_+r*f*j-n*i*j)+A[7]*(+e*i*j-e*v*_+o*b*_-r*b*j+r*v*a-o*i*a)+A[11]*(+e*v*p-e*f*j-o*b*p+n*b*j+o*f*a-n*v*a)+A[15]*(-r*f*a-e*i*p+e*f*_+r*b*p-n*b*_+n*i*a)},decomposeMatrixArray:t=>[t[12],t[13],t[14]],decomposeFullMatrixArray:t=>{const A=t;let e=y.lengthArray([A[0],A[1],A[2]]);const n=y.lengthArray([A[4],A[5],A[6]]),r=y.lengthArray([A[8],A[9],A[10]]);y.matrixArrayDeterminant(t)<0&&(e=-e);let o=[...t];const b=1/e,f=1/n,i=1/r;o[0]*=b,o[1]*=b,o[2]*=b,o[4]*=f,o[5]*=f,o[6]*=f,o[8]*=i,o[9]*=i,o[10]*=i;let v=y.quatFromRotationMatrix(o);return{p:[t[12],t[13],t[14]],q:v,s:[e,n,r]}},applyTransformArray:(t,A,e,n=[1,1,1])=>{const r=y.composeMatrixArray(A,e,n),o=t[0],b=t[1],f=t[2],i=1/(r[3]*o+r[7]*b+r[11]*f+r[15]);return[(r[0]*o+r[4]*b+r[8]*f+r[12])*i,(r[1]*o+r[5]*b+r[9]*f+r[13])*i,(r[2]*o+r[6]*b+r[10]*f+r[14])*i]},slerpQuatArray:(t,A,e)=>{if(0===e)return t;if(1===e)return A;let n=[...t];const r=t[0],o=t[1],b=t[2],f=t[3],i=A[0],v=A[1],a=A[2],p=A[3];let _=f*p+r*i+o*v+b*a;if(_<0?(n=[-i,-v,-a,-p],_=-_):n=[...A],_>=1)return t;const j=1-_*_;if(j<=s){const t=1-e;return n[3]=t*f+e*n[3],n[0]=t*r+e*n[0],n[1]=t*o+e*n[1],n[2]=t*b+e*n[2],y.quatNomalize(n)}const c=Math.sqrt(j),x=Math.atan2(c,_),C=Math.sin((1-e)*x)/c,d=Math.sin(e*x)/c;return n[3]=f*C+n[3]*d,n[0]=r*C+n[0]*d,n[1]=o*C+n[1]*d,n[2]=b*C+n[2]*d,n},toLocalQuatArray:(t=[0,0,0],A)=>{let e=y.quatFromEuler(t),n=y.quatInvert(A.quaternion.toArray());return y.quatMultiply(n,e)},quatFromRotationMatrix:t=>{let A=[0,0,0,1];const e=t,n=e[0],r=e[4],o=e[8],b=e[1],f=e[5],i=e[9],v=e[2],a=e[6],p=e[10],_=n+f+p;if(_>0){const t=.5/Math.sqrt(_+1);A[3]=.25/t,A[0]=(a-i)*t,A[1]=(o-v)*t,A[2]=(b-r)*t}else if(n>f&&n>p){const t=2*Math.sqrt(1+n-f-p);A[3]=(a-i)/t,A[0]=.25*t,A[1]=(r+b)/t,A[2]=(o+v)/t}else if(f>p){const t=2*Math.sqrt(1+f-n-p);A[3]=(o-v)/t,A[0]=(r+b)/t,A[1]=.25*t,A[2]=(i+a)/t}else{const t=2*Math.sqrt(1+p-n-f);A[3]=(b-r)/t,A[0]=(o+v)/t,A[1]=(i+a)/t,A[2]=.25*t}return A},quatFromEuler:(t=[0,0,0],A=!0)=>{const e=Math.cos,n=Math.sin,r=A?_:1,o=t[0]*r*.5,b=t[1]*r*.5,f=t[2]*r*.5,i=e(o),v=e(b),a=e(f),p=n(o),j=n(b),s=n(f);return[p*v*a+i*j*s,i*j*a-p*v*s,i*v*s+p*j*a,i*v*a-p*j*s]},quatFromAxis:(t=[0,0,0],A,e=!0)=>{const n=.5*A*(e?_:1),r=Math.sin(n);return[t[0]*r,t[1]*r,t[2]*r,Math.cos(n)]},quatNomalize:t=>{let A=y.lengthArray(t);return 0===A?[0,0,0,1]:(A=1/A,y.scaleArray(t,A,4))},quatInvert:t=>[-t[0],-t[1],-t[2],t[3]],quatMultiply:(t,A)=>{const e=t[0],n=t[1],r=t[2],o=t[3],b=A[0],f=A[1],i=A[2],v=A[3];return[e*v+o*b+n*i-r*f,n*v+o*f+r*b-e*i,r*v+o*i+e*f-n*b,o*v-e*b-n*f-r*i]},quatToAxis:t=>{Math.acos(t[3]);let A=Math.sqrt(1-t[3]*t[3]);return A<1e-5&&(A=1),[t[0]/A,t[1]/A,t[2]/A]},eulerFromMatrix:t=>{const A=t[0],e=t[4],n=t[8];t[1];const r=t[5],o=t[9];t[2];const b=t[6],f=t[10];let i=[0,0,0];return i[1]=Math.asin(y.clamp(n,-1,1)),Math.abs(n)<.9999999?(i[0]=Math.atan2(-o,f),i[2]=Math.atan2(-e,A)):(i[0]=Math.atan2(b,r),i[2]=0),i},angleTo:(t,A)=>2*Math.acos(Math.abs(y.clamp(y.dotArray(t,A),-1,1))),fixedArray:(t,A)=>{let e=t.length,n=[];for(;e--;)n[e]=y.toFixed(t[e],A);return n},getSize:t=>.001*t.byteLength+"kb",perpendicularArray0:t=>{const A=t[0],e=t[1],n=t[2],r=A*A,o=e*e,b=n*n;let f,i;switch(i=r<o?r<b?"X":"Z":o<b?"Y":"Z",i){case"X":return f=1/Math.sqrt(o+b),[0,n*f,-e*f];case"Y":return f=1/Math.sqrt(b+r),[-n*f,0,A*f];case"Z":return f=1/Math.sqrt(r+o),[e*f,-A*f,0]}},perpendicularArray:t=>{const A=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);let e=Math.acos(t[1]/A);const n=Math.atan2(t[2],t[0]);e-=c;return[A*Math.sin(e)*Math.cos(n),A*Math.cos(e),A*Math.sin(e)*Math.sin(n)]},crossArray:(t,A)=>{const e=t[0],n=t[1],r=t[2],o=A[0],b=A[1],f=A[2];return[n*f-r*b,r*o-e*f,e*b-n*o]},applyQuaternion:(t,A)=>{const e=t[0],n=t[1],r=t[2],o=A[0],b=A[1],f=A[2],i=A[3],v=2*(b*r-f*n),a=2*(f*e-o*r),p=2*(o*n-b*e);return[e+i*v+b*p-f*a,n+i*a+f*v-o*p,r+i*p+o*a-b*v]},nullArray:(t,A,e)=>{let n=0;for(;e--;)n+=t[A+e];return n},equalArray:(t,A)=>{let e=t.length;for(;e--;)if(t[e]!==A[e])return!1;return!0},lerpArray:(t,A,e)=>{if(0===e)return t;if(1===e)return A;let n=t.length,r=[];for(;n--;)r[n]=t[n],r[n]+=(A[n]-r[n])*e;return r},zeroArray:(t,A=0,e)=>{for(e=e??t.length;e--;)t[A+e]=0;return t},lengthArray:t=>{let A=t.length,e=0;for(;A--;)e+=t[A]*t[A];return Math.sqrt(e)},dotArray:(t,A)=>{let e=t.length,n=0;for(;e--;)n+=t[e]*A[e];return n},addArray:(t,A,e)=>{e=e??t.length;let n=[];for(;e--;)n[e]=t[e]+A[e];return n},subArray:(t,A,e)=>{e=e??t.length;let n=[];for(;e--;)n[e]=t[e]-A[e];return n},mulArray:(t,A,e)=>{if(A instanceof Array){let n=[];for(e=e??t.length;e--;)n[e]=t[e]*A[e];return n}return t.map((t=>t*A))},worldscale:(t,A)=>t.map((t=>t*A)),divArray:(t,A,e)=>y.mulArray(t,1/A,e),scaleArray:(t,A,e)=>y.mulArray(t,A,e),fillArray:(t,A,e=0,n)=>{for(n=n??t.length;n--;)A[e+n]=t[n]},copyArray:(t,A)=>{},cloneArray:t=>[...t],distanceArray:(t,A=[0,0,0])=>y.lengthArray(y.subArray(t,A)),normalizeArray:t=>y.divArray(t,y.lengthArray(t)||1),normalArray:(t,A=[0,0,0])=>y.normalizeArray(y.subArray(A,t)),getCenter:(t,A)=>(t.computeBoundingBox(),t.boundingBox.getCenter(A)),getVolume:(t,A,e=null)=>{let n=1,r=A;switch(t){case"sphere":n=4*Math.PI*r[0]*r[0]*r[0]/3;break;case"cone":n=Math.PI*r[0]*(.5*r[1])*2;break;case"box":n=.5*r[0]*8*(.5*r[1])*(.5*r[2]);break;case"cylinder":n=Math.PI*r[0]*r[0]*(.5*r[1])*2;break;case"capsule":n=4*Math.PI*r[0]*r[0]*r[0]/3+Math.PI*r[0]*r[0]*(.5*r[1])*2;break;case"convex":case"mesh":n=y.getConvexVolume(e)}return n},getConvexVolume:t=>{let A,e=t.length/3,n=[0,0,0],r=[0,0,0];for(;e--;)A=3*e,t[A]<n[0]?n[0]=t[A]:t[A]>r[0]&&(r[0]=t[A]),t[A+1]<n[1]?n[1]=t[A+1]:t[A+1]>r[1]&&(r[1]=t[A+1]),t[A+2]<n[2]?n[2]=t[A+2]:t[A+2]>r[2]&&(r[2]=t[A+2]);let o=[r[0]-n[0],r[1]-n[1],r[2]-n[2]];return.5*o[0]*8*(.5*o[1])*(.5*o[2])},massFromDensity:(t,A)=>t*A,densityFromMass:(t,A)=>t/A,toNonIndexed:t=>t.index?t.clone().toNonIndexed():t,getIndex:(t,A)=>!t.index||A?null:t.index.array||null,getSameVertex:t=>{const A=t.getAttribute("position"),e=A.array,n=[],r=[],o={};new THREE.Vector3;let b,f=0;y.getHash(t);let i,v,a=!1,p=0;for(let t=0;t<A.count;t++){f=3*t,i={x:e[f],y:e[f+1],z:e[f+2],id:t},a=!1,b=n.length;for(let A=0;A<b;A++)v=n[A],i.x===v.x&&i.y===v.y&&i.z===v.z&&(a=!0,o[t]=v.id);a||(i.id=p++,n.push(i),r.push([i.x,i.y,i.z]))}return[r,o]},getVertex:(t,A)=>{let e=t.attributes.position.array;return A&&t.index&&(e=(t=t.clone().toNonIndexed()).attributes.position.array),e},getNormal:t=>t.attributes.normal.array,getFaces:t=>{let A=[];if(t.index){let e=t.getIndex();for(let t=0;t<e.count;t+=3)A.push([e.getX(t),e.getX(t+1),e.getX(t+2)])}else{let e=t.getAttribute("position").count;for(let t=0;t<e;t+=3)A.push([t,t+1,t+2])}return A},getConnectedFaces:t=>{const A=[];let e,n,r,o,b,f,i,v=t.length,a=v;for(;a--;)for(n=t[a],e=v;e--;)e!==a&&(r=t[e],o=n.filter((t=>r.includes(t))),o.length>1&&(i=[],b=[...n],f=b.indexOf(o[0]),b.splice(f,1),f=b.indexOf(o[1]),b.splice(f,1),i.push(b[0]),b=[...r],f=b.indexOf(o[0]),b.splice(f,1),f=b.indexOf(o[1]),b.splice(f,1),i.push(b[0]),A.push(i)));return A},reduce:t=>{},barycentric:(t,A)=>{},solve:(t,A)=>{},getHash:(t,A=1e-4)=>{A=Math.max(A,Number.EPSILON);const e={},n={},r=t.getAttribute("position"),o=r.count,b=r.array,f=.5*A,i=Math.log10(1/A),v=Math.pow(10,i),a=f*v;let p;for(let t=0;t<o;t++){p=3*t;let A=`${~~(b[p]*v+a)},${~~(b[p+1]*v+a)},${~~(b[p+2]*v+a)}`;e[A]?e[A].push(t):e[A]=[t]}let _=0;for(let t in e)n[_++]=e[t];return n}},x=y;class C extends a{constructor(){super(),this.Utils=n,this.type="body",this.itype="body",this.num=v[this.type],this.full=!1,this.v=new Jolt.RVec3,this.q=new Jolt.Quat,this.v2=new Jolt.RVec3,this.q2=new Jolt.Quat}setFull(t){this.num=v[t?"bodyFull":"body"],this.full=t}step(){const t=e.Ar,A=e.ArPos[this.itype];let n,r,o,b,f,i,v=this.list.length;for(;v--;)n=this.list[v],n&&(r=A+v*this.num,n.lockPos&&e.bodyInterface.MoveKinematic(n.GetID(),n.GetPosition(),n.GetRotation(),e.deltaTime),t[r]=n.IsActive()?1:0,o=n.GetPosition(),b=n.GetRotation(),o.toArray(t,r+1),b.toArray(t,r+4),this.full?(f=n.GetLinearVelocity(),i=n.GetAngularVelocity(),f.toArray(t,r+8),i.toArray(t,r+11),1===t[r]&&(t[r]=9.8*f.Length())):n.getVelocity&&(f=n.GetLinearVelocity().toArray(),i=n.GetAngularVelocity().toArray(),e.reflow.velocity[n.name]=[...f,...i]))}shape(t={}){let A,e,n,r,o=null,b=t.type||"box",f=t.size||[1,1,1],i=.01,v=null;switch(b){case"plane":f=[300,1,300],r=new Jolt.ConvexHullShapeSettings;let b=[.5*f[0],0,.5*f[2],.5*f[0],0,.5*-f[2],.5*-f[0],0,.5*-f[2],.5*-f[0],0,.5*f[2]];for(A=4;A--;)e=3*A,r.mPoints.push_back(this.v.fromArray(b,e));o=r.Create().Get();break;case"box":o=new Jolt.BoxShape(this.v.set(.5*f[0],.5*f[1],.5*f[2]),i,v);break;case"sphere":o=new Jolt.SphereShape(f[0],v);break;case"cylinder":o=new Jolt.CylinderShape(.5*f[1],f[0],i,v);break;case"capsule":o=new Jolt.CapsuleShape(.5*f[1],f[0],i,v);break;case"particle":o=new Jolt.SphereShape(t.pSize||.05,v);break;case"convex":for(r=new Jolt.ConvexHullShapeSettings,A=Math.floor(t.v.length/3),n=0;A--;)e=3*n,r.mPoints.push_back(this.v.fromArray(t.v,e)),n++;o=r.Create().Get();break;case"mesh":let a=new Jolt.TriangleList,p=t.v,_=Math.floor(p.length/3);for(a.resize(_),A=_/3,n=0;A--;){e=9*n;let t=a.at(n),A=t.get_mV(0),r=t.get_mV(1),o=t.get_mV(2);A.x=p[e+0],A.y=p[e+1],A.z=p[e+2],r.x=p[e+3],r.y=p[e+4],r.z=p[e+5],o.x=p[e+6],o.y=p[e+7],o.z=p[e+8],n++}o=new Jolt.MeshShapeSettings(a,v).Create().Get()}return t.density&&o.SetDensity,o.volume=x.getVolume(b,f,t.v),o}shapeSetting(t={}){let A,e,n,r=null,o=t.type||"box",b=t.size||[1,1,1],f=null;switch(o){case"box":r=new Jolt.BoxShapeSettings(this.v.set(.5*b[0],.5*b[1],.5*b[2]),0,f);break;case"sphere":r=new Jolt.SphereShapeSettings(b[0],f);break;case"cylinder":r=new Jolt.CylinderShapeSettings(.5*b[1],b[0],0,f);break;case"capsule":r=new Jolt.CapsuleShapeSettings(.5*b[1],b[0],0,f);break;case"convex":for(r=new Jolt.ConvexHullShapeSettings,A=Math.floor(t.v.length/3),n=0;A--;)e=3*n,r.mPoints.push_back(this.v.fromArray(t.v,e)),n++;break;case"mesh":let o=new Jolt.TriangleList,i=t.v,v=Math.floor(i.length/3);for(o.resize(v),A=v/3,n=0;A--;){e=9*n;let t=o.at(n),A=t.get_mV(0),r=t.get_mV(1),b=t.get_mV(2);A.x=i[e+0],A.y=i[e+1],A.z=i[e+2],r.x=i[e+3],r.y=i[e+4],r.z=i[e+5],b.x=i[e+6],b.y=i[e+7],b.z=i[e+8],n++}r=new Jolt.MeshShapeSettings(o,f)}return r.volume=x.getVolume(o,b,t.v),r}add(t={}){let A,n=this.setName(t),r="body"===this.type?t.kinematic?Jolt.EMotionType_Kinematic:Jolt.EMotionType_Dynamic:Jolt.EMotionType_Static,o="body"===this.type?e.LAYER_MOVING:e.LAYER_NON_MOVING,b=0;switch(void 0!==t.move&&(o=t.move?e.LAYER_MOVING:e.LAYER_NON_MOVING),this.v.fromArray(t.pos||[0,0,0]),this.q.fromArray(t.quat||[0,0,0,1]),t.type){case"null":A=new Jolt.BodyCreationSettings(this.shape({type:"sphere",size:[.01]}),this.v.fromArray(t.pos||[0,0,0]),this.q.fromArray(t.quat||[0,0,0,1]),r,o);break;case"compound":let e,n,i=new Jolt.StaticCompoundShapeSettings;for(var f=0;f<t.shapes.length;f++)e=t.shapes[f],n=this.shapeSetting(e),b+=n.volume,i.AddShape(this.v2.fromArray(e.pos||[0,0,0]),this.q2.fromArray(e.quat||[0,0,0,1]),n);A=new Jolt.BodyCreationSettings(i.Create().Get(),this.v.fromArray(t.pos||[0,0,0]),this.q.fromArray(t.quat||[0,0,0,1]),r,o),Jolt.destroy(i);break;default:t.shapeType&&(t.type=t.shapeType);let v=this.shape(t);b=v.volume,A=new Jolt.BodyCreationSettings(v,this.v.fromArray(t.pos||[0,0,0]),this.q.fromArray(t.quat||[0,0,0,1]),r,o)}if(t.density&&(t.mass=x.massFromDensity(t.density||0,b)),t.mass&&(A.mOverrideMassProperties=1,A.mMassPropertiesOverride.mMass=t.mass),t.massCenter&&console.log(A.mMassPropertiesOverride),t.inertia&&(A.mOverrideMassProperties=1,A.mMassPropertiesOverride.mInertia.PostScaled(this.v.fromArray(t.inertia))),t.linearFactor||t.angularFactor){let e=0;t.linearFactor?(t.linearFactor[0]>0&&(e|=Jolt.EAllowedDOFs_TranslationX),t.linearFactor[1]>0&&(e|=Jolt.EAllowedDOFs_TranslationY),t.linearFactor[2]>0&&(e|=Jolt.EAllowedDOFs_TranslationZ)):e|=Jolt.EAllowedDOFs_TranslationX|Jolt.EAllowedDOFs_TranslationY|Jolt.EAllowedDOFs_TranslationZ,t.angularFactor?(t.angularFactor[0]>0&&(e|=Jolt.EAllowedDOFs_RotationX),t.angularFactor[1]>0&&(e|=Jolt.EAllowedDOFs_RotationY),t.angularFactor[2]>0&&(e|=Jolt.EAllowedDOFs_RotationZ)):e|=Jolt.EAllowedDOFs_RotationX|Jolt.EAllowedDOFs_RotationY|Jolt.EAllowedDOFs_RotationZ,A.mAllowedDOFs=e}void 0!==t.motionQuality&&(A.mMotionQuality=t.motionQuality),void 0!==t.useCCD&&(A.mMotionQuality=1),void 0!==t.maxLinear&&(A.mMaxLinearVelocity=t.maxLinear),void 0!==t.maxAngular&&(A.mMaxAngularVelocity=t.maxAngular),void 0!==t.noGravity&&(A.mGravityFactor=t.noGravity?0:1),void 0!==t.gravityScale&&(A.mGravityFactor=t.gravityScale),void 0!==t.kinematic&&(A.mAllowDynamicOrKinematic=t.kinematic),void 0!==t.sensor&&(A.mIsSensor=t.sensor),void 0!==t.damping&&(A.mLinearDamping=t.damping[0],A.mAngularDamping=t.damping[1]);const i=e.bodyInterface.CreateBody(A);Jolt.destroy(A),i.name=n,i.type=this.type,i.isKinematic=t.kinematic||!1,i.breakable=t.breakable||!1,this.addToWorld(i,t.id),delete t.pos,delete t.quat,delete t.mass,delete t.kinematic,this.set(t,i)}set(t={},A=null){if(null===A&&(A=this.byName(t.name)),null!==A){if(void 0!==t.getVelocity&&(A.getVelocity=t.getVelocity),void 0!==t.friction&&A.SetFriction(t.friction),void 0!==t.restitution&&A.SetRestitution(t.restitution),void 0!==t.group&&void 0!==t.mask&&(t.filter=[t.group,t.mask]),t.filter){const n=A.GetCollisionGroup();n.SetGroupFilter(e.groupFilter),n.SetGroupID(t.filter[0]),n.SetSubGroupID(t.filter[1])}if(void 0!==t.kinematic&&"body"===A.type&&(A.isKinematic=t.kinematic||!1,A.mMotionType=0==t.kinematic?Jolt.EMotionType_Kinematic:Jolt.EMotionType_Dynamic),void 0!==t.bullet&&e.bodyInterface.SetMotionQuality(A.GetID(),t.bullet?1:0),void 0!==t.motionQuality&&e.bodyInterface.SetMotionQuality(A.GetID(),t.motionQuality),t.gravityScale&&e.bodyInterface.SetGravityFactor(A.GetID(),t.gravityScale),t.sleep&&e.bodyInterface.DeactivateBody(A.GetID()),(t.activate||t.wake)&&e.bodyInterface.ActivateBody(A.GetID()),void 0!==t.neverSleep&&A.SetAllowSleeping(!t.neverSleep),t.noGravity,void 0!==t.linearVelocity&&A.SetLinearVelocity(this.v.fromArray(t.linearVelocity)),void 0!==t.linearVelocityClamped&&A.SetLinearVelocityClamped(this.v.fromArray(t.linearVelocityClamped)),void 0!==t.angularVelocity&&A.SetAngularVelocity(this.v.fromArray(t.angularVelocity)),void 0!==t.angularVelocityClamped&&A.SetAngularVelocityClamped(this.v.fromArray(t.angularVelocityClamped)),t.angularFactor,t.reset&&(A.SetLinearVelocity(this.v.set(0,0,0)),A.SetAngularVelocity(this.v.set(0,0,0)),A.ResetForce(),A.ResetTorque()),t.pos||t.quat)if(A.isKinematic){let n=t.pos?this.v.fromArray(t.pos):A.GetPosition(),r=t.quat?this.q.fromArray(t.quat):A.GetRotation();e.bodyInterface.MoveKinematic(A.GetID(),n,r,e.deltaTime),A.old={p:n,q:r},A.lockPos=!0}else t.pos&&e.bodyInterface.SetPosition(A.GetID(),this.v.fromArray(t.pos),null),t.quat&&e.bodyInterface.SetRotation(A.GetID(),this.q.fromArray(t.quat),null);if(t.impulse&&(A.IsActive()||e.bodyInterface.ActivateBody(A.GetID()),A.AddImpulse(this.v.fromArray(t.impulse),t.impulseCenter?this.v2.fromArray(t.impulseCenter):A.GetPosition())),t.angularImpulse&&A.AddAngularImpulse(this.v.fromArray(t.angularImpulse)),t.force&&A.AddForce(this.v.fromArray(t.force),t.forcePosition?this.v2.fromArray(t.forcePosition):A.GetPosition()),t.torque&&A.AddTorque(this.v.fromArray(t.torque)),void 0!==t.useManifoldReduction&&A.SetUseManifoldReduction(t.useManifoldReduction),A.GetMotionProperties&&(t.massInfo&&this.getMassInfo(A),t.mass&&this.setMass(A,t.mass),void 0!==t.damping&&(A.GetMotionProperties().SetLinearDamping(t.damping[0]),A.GetMotionProperties().SetAngularDamping(t.damping[1])),void 0!==t.inertiaScale)){let e=A.GetMotionProperties().GetInverseInertiaDiagonal().toArray(),n=A.GetMotionProperties().GetInertiaRotation();e=x.mulArray(e,1/t.inertiaScale),A.GetMotionProperties().SetInverseInertia(this.v2.fromArray(e),n)}}}setMass(t,A){t.GetMotionProperties().SetInverseMass(1/A)}getMassInfo(t){if("string"==typeof t&&(t=this.byName(t)),null===t)return;if("body"!==this.type)return;const A={invMass:t.GetMotionProperties().GetInverseMass(),massCenter:t.GetCenterOfMassPosition().toArray(),inertia:t.GetMotionProperties().GetInverseInertiaDiagonal().toArray(),inertiaRotation:t.GetMotionProperties().GetInertiaRotation().toArray(),invInertia:t.GetInverseInertia().toArray(),damping:[t.GetMotionProperties().GetLinearDamping(),t.GetMotionProperties().GetAngularDamping()]};console.log(A)}getShape(t){return t.GetShape()}}class d extends a{constructor(){super(),this.Utils=n,this.type="joint",this.v=new Jolt.RVec3,this.min=new Jolt.RVec3(0,0,0),this.max=new Jolt.RVec3(0,0,0),this.Rmin=new Jolt.RVec3(0,0,0),this.Rmax=new Jolt.RVec3(0,0,0),this.convert={x:"y",y:"y",z:"z",rx:"rx",ry:"ry",rz:"rz",twist:"rx",swing1:"ry",swing2:"rz"},this.angulars=["rx","ry","rz"]}step(){}add(t={}){let A,e=this.setName(t),n=t.mode||"hinge",r=this.byName(t.b1),o=this.byName(t.b2),b=t.pos1?t.pos1:[0,0,0],f=t.axis1?t.axis1:[1,0,0],i=t.pos2?t.pos2:[0,0,0],v=t.axis2?t.axis2:[1,0,0],a=x.perpendicularArray(f),p=x.perpendicularArray(v),_=null;switch(n){case"fixe":A=new Jolt.FixedConstraintSettings,A.mAutoDetectPoint=!0,_="FixedConstraint";break;case"hinge":A=new Jolt.HingeConstraintSettings,_="HingeConstraint";break;case"distance":A=new Jolt.DistanceConstraintSettings,_="DistanceConstraint";break;case"prismatic":A=new Jolt.SliderConstraintSettings,_="SliderConstraint";break;case"spherical":A=new Jolt.PointConstraintSettings,_="PointConstraintConstraint";break;case"cone":A=new Jolt.ConeConstraintSettings,_="ConeConstraint";break;case"ragdoll":case"generic":case"cylindrical":A=new Jolt.SixDOFConstraintSettings,_="SixDOFConstraint"}if(!A)return;switch(A.mPoint1&&A.mPoint1.fromArray(b),A.mPoint2&&A.mPoint2.fromArray(i),A.mPosition1&&A.mPosition1.fromArray(b),A.mPosition2&&A.mPosition2.fromArray(i),A.mAxisX1&&A.mAxisX1.fromArray(f),A.mAxisY1&&A.mAxisY1.fromArray(a),A.mAxisX2&&A.mAxisX2.fromArray(v),A.mAxisY2&&A.mAxisY2.fromArray(p),A.mHingeAxis1&&A.mHingeAxis1.fromArray(f),A.mHingeAxis2&&A.mHingeAxis2.fromArray(v),A.mSliderAxis1&&A.mSliderAxis1.fromArray(f),A.mSliderAxis2&&A.mSliderAxis2.fromArray(v),A.mNormalAxis1&&A.mNormalAxis1.fromArray(a),A.mNormalAxis2&&A.mNormalAxis2.fromArray(p),A.mSpace&&(A.mSpace=0),n){case"generic":A.MakeFixedAxis(0),A.MakeFixedAxis(1),A.MakeFixedAxis(2),A.MakeFixedAxis(3),A.MakeFixedAxis(4),A.MakeFixedAxis(5);break;case"cylindrical":A.MakeFixedAxis(1),A.MakeFixedAxis(2),A.MakeFixedAxis(4),A.MakeFixedAxis(5)}const j=Jolt.castObject(A.Create(r,o),Jolt[_]);j.name=e,j.type=this.type,j.mode=n,j.visible=void 0===t.visible||t.visible,Jolt.destroy(A),this.set(t,j),this.addToWorld(j)}set(t={},A=null){if(null===A&&(A=this.byName(t.name)),null!==A)switch(void 0!==t.enable&&A.SetEnabled(t.enable),A.mode){case"hinge":t.lm&&A.SetLimits(t.lm[0]*_,t.lm[1]*_);break;case"spherical":break;case"prismatic":if(t.lm&&(A.SetLimits(t.lm[0],t.lm[1]),t.spring)){let e=A.GetLimitsSpringSettings();e.mStiffness=t.spring[0],e.mDamping=t.spring[1],e.mFrequency=t.spring[0],e.mMode=1}break;case"cylindrical":t.lm&&(this.min.set(t.lm[0],0,0),this.max.set(t.lm[1],0,0),A.SetTranslationLimits(this.min,this.max)),t.lmr&&(this.min.set(t.lmr[0]*_,0,0),this.max.set(t.lmr[1]*_,0,0),A.SetRotationLimits(this.min,this.max)),A.SetEnabled(!0);break;case"generic":case"ragdoll":if(t.lm){this.min.set(0,0,0),this.max.set(0,0,0),this.Rmin.set(0,0,0),this.Rmax.set(0,0,0);let e=t.lm.length;for(;e--;)this.setLimit(t.lm[e]);A.SetTranslationLimits(this.min,this.max),A.SetRotationLimits(this.Rmin,this.Rmax)}}}setLimit(t){const A=this.convert[t[0]],e=-1!==this.angulars.indexOf(A)?_:1;let n=1!==e?A.substring(1):A;console.log(n),1!==e?(this.Rmin[n]=t[1]*e,this.Rmax[n]=t[2]*e):(this.min[n]=t[1],this.max[n]=t[2])}setSpring(t,A){}}class l extends a{constructor(){super(),this.Utils=n,this.type="ray",this.initRay=!1}reset(){super.reset(),this.initRay&&(this.initRay=!1,Jolt.destroy(this.ray),Jolt.destroy(this.bp_filter),Jolt.destroy(this.object_filter),Jolt.destroy(this.body_filter),Jolt.destroy(this.shape_filter),this.collector.body=null,this.collector.OnBody=null,this.collector.AddHit=null,Jolt.destroy(this.collector))}init(){this.initRay||(this.initRay=!0,this.v1=new Jolt.RVec3,this.v2=new Jolt.RVec3,this.ray=new Jolt.RRayCast,this.ray_settings=new Jolt.RayCastSettings,this.ray_settings.mTreatConvexAsSolid=!1,this.bp_filter=new Jolt.DefaultBroadPhaseLayerFilter(e.world.GetObjectVsBroadPhaseLayerFilter(),e.LAYER_MOVING),this.object_filter=new Jolt.DefaultObjectLayerFilter(e.world.GetObjectLayerPairFilter(),e.LAYER_ALL),this.body_filter=new Jolt.BodyFilter,this.shape_filter=new Jolt.ShapeFilter,this.collector=new Jolt.CastRayCollectorJS,this.collector.OnBody=function(t){t=Jolt.wrapPointer(t,Jolt.Body),this.collector.body=t}.bind(this),this.collector.AddHit=function(t){t=Jolt.wrapPointer(t,Jolt.RayCastResult);const A=this.ray.n,n=e.Ar;if(0!==n[A])return;let r=this.ray.GetPointOnRay(t.mFraction),o=this.collector.body.GetWorldSpaceSurfaceNormal(t.mSubShapeID2,r),b=this.ray.mOrigin.toArray(),f=r.toArray();o.toArray(n,A+8),n[A]=1,n[A+1]=x.distanceArray(b,f),n[A+2]=b[0],n[A+3]=b[1],n[A+4]=b[2],n[A+5]=f[0],n[A+6]=f[1],n[A+7]=f[2],e.reflow.ray[this.ray.id]=this.collector.body.name}.bind(this),this.collector.Reset=function(){this.collector.ResetEarlyOutFraction()}.bind(this))}step(){const t=e.Ar,A=e.ArPos[this.type];e.reflow.ray=[];let n,r,o,b=this.list.length;for(;b--;)r=A+b*v.ray,n=this.list[b],o=n.getPoint(),this.ray.mOrigin.fromArray(o[0]),this.ray.mDirection.fromArray(x.subArray(o[1],o[0])),this.ray.n=r,this.ray.id=b,t[r]=0,this.collector.Reset(),this.ray_settings.mTreatConvexAsSolid=n.selfHit,e.physicsSystem.GetNarrowPhaseQuery().CastRay(this.ray,this.ray_settings,this.collector,this.bp_filter,this.object_filter,this.body_filter,this.shape_filter)}add(t={}){this.setName(t);let A=new u(t);this.addToWorld(A,t.id),this.init()}set(t={},A=null){null===A&&(A=this.byName(t.name)),null!==A&&(t.begin&&(A.begin=t.begin),t.end&&(A.end=t.end))}}class u{constructor(t={}){this.type="ray",this.name=t.name,this.parent=t.parent||"",this.selfHit=t.selfHit||!1,this.noRotation=t.noRotation||!1,this.begin=t.begin||[0,0,0],this.end=t.end||[0,0,1]}getPoint(){if(this.parent){const t=n.byName(this.parent);if(t){const A=t.GetPosition().toArray(),e=this.noRotation?[0,0,0,1]:t.GetRotation().toArray();return[x.applyTransformArray(this.begin,A,e),x.applyTransformArray(this.end,A,e)]}}return[this.begin,this.end]}}class h extends a{constructor(){super(),this.Utils=n,this.type="contact",this.initContact=!1}reset(){super.reset(),this.initContact&&(this.initContact=!1,Jolt.destroy(this.contactListener))}init(){this.initContact||(this.initContact=!0,this.contactListener=new Jolt.ContactListenerJS,this.contactListener.OnContactValidate=(t,A,e,n)=>{t=Jolt.wrapPointer(t,Jolt.Body),A=Jolt.wrapPointer(A,Jolt.Body);const r=t.name,o=A.name;return r&&o&&(n=Jolt.wrapPointer(n,Jolt.CollideShapeResult)),Jolt.ValidateResult_AcceptAllContactsForThisBodyPair},this.contactListener.OnContactAdded=(t,A,e,r)=>{t=Jolt.wrapPointer(t,Jolt.Body),A=Jolt.wrapPointer(A,Jolt.Body);const o=t.name,b=A.name;e=Jolt.wrapPointer(e,Jolt.ContactManifold),(r=Jolt.wrapPointer(r,Jolt.ContactSettings)).mCombinedRestitution=.5,o&&b&&n.addContact(o+"_"+b)},this.contactListener.OnContactPersisted=(t,A,e,r)=>{t=Jolt.wrapPointer(t,Jolt.Body),A=Jolt.wrapPointer(A,Jolt.Body);const o=t.name,b=A.name;e=Jolt.wrapPointer(e,Jolt.ContactManifold),(r=Jolt.wrapPointer(r,Jolt.ContactSettings)).mCombinedRestitution=.5,o&&b&&n.addContact(o+"_"+b)},this.contactListener.OnContactRemoved=t=>{},e.physicsSystem.SetContactListener(this.contactListener))}step(){const t=e.Ar,A=e.ArPos[this.type];let r,o,b,f=this.list.length;for(;f--;)r=this.list[f],o=A+f*v.contact,b=n.byContact(r.cc)?1:0,b||(b=n.byContact(r.cr)?1:0),t[o]=b;n.clearContact()}add(t={}){this.setName(t);let A=this.byName(t.b1);if(this.byName(t.b2),null===A)return;let e=new D(t);this.addToWorld(e,t.id),this.init()}}class D{constructor(t={}){this.type="contact",this.name=t.name,this.cc=t.b1+"_"+t.b2,this.cr=t.b2+"_"+t.b1}}class $ extends a{constructor(){super(),this.type="terrain",this.Utils=n}add(t){this.setName(t);let A=new m(t);this.addToWorld(A,t.id)}set(t={},A=null){null===A&&(A=this.byName(t.name)),null!==A&&A.set(t)}}class m{constructor(t){this.type="terrain",this.name=t.name,this.needUpdate=!1,this.heightField=null,this.heights=null,this.shape=null,this.init(t)}init(t){this.size=t.size,this.sample=t.sample,this.squarSize=[this.size[0]/(this.sample[0]-1),this.size[2]/(this.sample[1]-1)],this.scale=[this.squarSize[0],this.size[1],this.squarSize[1]],this.setData(t);let A=t.pos||[0,0,0];A[0]=A[0]-.5*this.size[0],A[2]=A[2]-.5*this.size[2];const n=new Jolt.RVec3(0,0,0).fromArray(A),r=new Jolt.Quat(0,0,0,1);let o=new Jolt.BodyCreationSettings(this.shape,n,r,Jolt.EMotionType_Static,e.LAYER_NON_MOVING);this.body=e.bodyInterface.CreateBody(o),Jolt.destroy(o),e.bodyInterface.AddBody(this.body.GetID(),Jolt.EActivation_Activate)}setData(t){let A=t.heightData;const e=new Jolt.HeightFieldShapeSettings;e.mOffset.Set(0,0,0),e.mScale.Set(this.scale[0],this.scale[1],this.scale[2]),e.mSampleCount=this.sample[0],e.mBlockSize=2;const n=A.length;e.mHeightSamples.resize(n),this.heightSamples=new Float32Array(Jolt.HEAPF32.buffer,Jolt.getPointer(e.mHeightSamples.data()),n);for(let t=0;t<n;t++)this.heightSamples[t]=A[t];this.shape=e.Create().Get()}release(){e.bodyInterface.RemoveBody(this.body.GetID()),e.bodyInterface.DestroyBody(this.body.GetID()),Jolt.destroy(this.shape)}set(t){if(t.heightData){let A=t.heightData;const n=this.sample[0],r=Jolt._webidl_malloc(n*n*4),o=new Float32Array(Jolt.HEAPF32.buffer,r,n*n),b=Jolt.castObject(this.body.GetShape(),Jolt.HeightFieldShape),f=A.length;for(let t=0;t<f;t++)o[t]=A[t]*this.size[1];const i=this.body.GetCenterOfMassPosition();b.SetHeights(0,0,n,n,r,n,e.world.GetTempAllocator()),e.bodyInterface.NotifyShapeChanged(this.body,i,!1,Jolt.EActivation_Activate)}}}async function k(t={}){var A=t,e=!!globalThis.window,n=!!globalThis.WorkerGlobalScope,r=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(r){const{createRequire:t}=await import("module");var o=t(import.meta.url)}var b="./this.program",f=import.meta.url;if(r)o("fs"),f.startsWith("file:")&&o("path").dirname(o("url").fileURLToPath(f)),1<process.argv.length&&(b=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2);else if(e||n)try{new URL(".",f)}catch{}var i=console.log.bind(console),v=console.error.bind(console),a=!1;var p,_,j,s,c,y,x,C,d=!1;function l(t){throw A.onAbort?.(t),v(t="Aborted("+t+")"),a=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),_?.(t),t}async function u(t){return async function(t){var A=C;try{var e=await async function(t){return t}(A);return await WebAssembly.instantiate(e,t)}catch(t){v(`failed to asynchronously prepare wasm: ${t}`),l(t)}}(t)}for(var h,D=t=>{for(;0<t.length;)t.shift()(A)},$=[],m=[],k=()=>{var t=A.preRun.shift();m.push(t)},S=(t,A,e,n)=>{if(!(0<n))return 0;var r=e;n=e+n-1;for(var o=0;o<t.length;++o){var b=t.codePointAt(o);if(127>=b){if(e>=n)break;A[e++]=b}else if(2047>=b){if(e+1>=n)break;A[e++]=192|b>>6,A[e++]=128|63&b}else if(65535>=b){if(e+2>=n)break;A[e++]=224|b>>12,A[e++]=128|b>>6&63,A[e++]=128|63&b}else{if(e+3>=n)break;A[e++]=240|b>>18,A[e++]=128|b>>12&63,A[e++]=128|b>>6&63,A[e++]=128|63&b,o++}}return A[e]=0,e-r},B=[],q=(t,A,e)=>{B.length=0;for(var n;n=s[A++];){var r=105!=n;e+=(r&=112!=n)&&e%8?4:0,B.push(112==n?y[e>>2]:105==n?c[e>>2]:x[e>>3]),e+=r?8:4}return Oqt[t](...B)},g={},E=()=>{if(!h){var t,A={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:b||"./this.program"};for(t in g)void 0===g[t]?delete A[t]:A[t]=g[t];var e=[];for(t in A)e.push(`${t}=${A[t]}`);h=e}return h},G=t=>{for(var A=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);127>=n?A++:2047>=n?A+=2:55296<=n&&57343>=n?(A+=4,++e):A+=3}return A},P=[null,[],[]],F=globalThis.TextDecoder&&new TextDecoder,I=(t,A=0)=>{for(var e=A,n=e+void 0;t[e]&&!(e>=n);)++e;if(16<e-A&&t.buffer&&F)return F.decode(t.subarray(A,e));for(n="";A<e;){var r=t[A++];if(128&r){var o=63&t[A++];if(192==(224&r))n+=String.fromCharCode((31&r)<<6|o);else{var b=63&t[A++];65536>(r=224==(240&r)?(15&r)<<12|o<<6|b:(7&r)<<18|o<<12|b<<6|63&t[A++])?n+=String.fromCharCode(r):(r-=65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}}else n+=String.fromCharCode(r)}return n},O=[],H=new Uint8Array(123),M=25;0<=M;--M)H[48+M]=52+M,H[65+M]=M,H[97+M]=26+M;if(H[43]=62,H[47]=63,A.print&&(i=A.print),A.printErr&&(v=A.printErr),A.thisProgram&&(b=A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