phy-engine
Version:
JavaScript 3D Physics for three.js
1 lines • 2.08 MB
JavaScript
const A=new Map,I=new Map,g={Ar:null,ArPos:{},world:null,timestep:1/60,tmpStep:0,delta:0,ms:0,invDelta:0,gravity:null,key:[],reflow:{ray:[],stat:{fps:0,delta:0,ms:0},velocity:{}}};class C{static clear(){A.clear(),I.clear()}static byName(I){return A.has(I)?A.get(I):null}static add(I){A.set(I.name,I)}static remove(C){if("ray"!==C.type&&"contact"!==C.type)switch(C.type){case"joint":g.world.removeImpulseJoint(C);break;case"body":case"solid":if(C.isValid()){let A=C.numColliders();for(;A--;)I.delete(C.collider(A));g.world.removeRigidBody(C)}}A.delete(C.name)}static stats(){}}class B{constructor(A=0,I=0,g=0){this.x=A,this.y=I,this.z=g}copy(A){return this.x=A.x,this.y=A.y,this.z=A.z,this}toArray(A,I){let g=void 0!==A;if(g||(A=[]),A[I=I||0]=this.x,A[I+1]=this.y,A[I+2]=this.z,!g)return A}fromArray(A,I){return I=I||0,this.x=A[I],this.y=A[I+1],this.z=A[I+2],this}sub(A){return this.x-=A.x,this.y-=A.y,this.z-=A.z,this}add(A){return this.x+=A.x,this.y+=A.y,this.z+=A.z,this}set(A,I,g){return this.x=A,this.y=I,this.z=g,this}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distanceTo(A){const I=this.x-A.x,g=this.y-A.y,C=this.z-A.z;return Math.sqrt(I*I+g*g+C*C)}multiplyScalar(A){return this.x*=A,this.y*=A,this.z*=A,this}divideScalar(A){return this.multiplyScalar(1/A)}normalize(){return this.divideScalar(this.length()||1)}}class Q{constructor(A=0,I=0,g=0,C=1){this.x=A,this.y=I,this.z=g,this.w=C}copy(A){return this.x=A.x,this.y=A.y,this.z=A.z,this.w=A.w,this}toArray(A,I){let g=void 0!==A;if(g||(A=[]),A[I=I||0]=this.x,A[I+1]=this.y,A[I+2]=this.z,A[I+3]=this.w,!g)return A}fromArray(A,I){return I=I||0,this.x=A[I],this.y=A[I+1],this.z=A[I+2],this.w=A[I+3],this}set(A,I,g,C){return this.x=A,this.y=I,this.z=g,this.w=C,this}}const E=4e3,i=1e3,D=4e3,o=100,S=100,w={bodyFull:14,body:8,joint:16,contact:1,ray:11,character:16,vehicle:72,solver:128};class G{constructor(){this.id=0,this.list=[],this.type="item",this.Utils=null}reset(){let A=this.list.length;for(;A--;)this.dispose(this.list[A]);this.list=[],this.id=0}byName(A){return this.Utils.byName(A)}setName(A={}){let I=void 0!==A.name?A.name:this.type+this.id++;return A.id=this.remove(I,!0),A.name=I,I}addToWorld(A,I=-1){this.Utils.add(A),-1!==I?this.list[I]=A:this.list.push(A)}remove(A,I){let g=this.byName(A);return g?this.clear(g,I):-1}clear(A,I){let g=this.list.indexOf(A);return-1===g||I?this.list[g]=null:this.list.splice(g,1),this.dispose(A),g}dispose(A){null!==A&&this.Utils.remove(A)}add(A={}){}set(A={}){}step(A,I){}}const k=Math.PI,h=k/180,K=180/k,J=Number.EPSILON,U=.5*k,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:A=>Math.pow(A,5),candelaToLumens:A=>4*A*Math.PI,lumensToCandela:A=>A/(4*Math.PI),todeg:K,torad:h,toFixed:(A,I=3)=>1*A.toFixed(I),toRound:(A,I=3)=>Math.trunc(A),clamp:(A,I=0,g=1)=>A=(A=A<I?I:A)>g?g:A,clampA:(A,I,g)=>Math.max(I,Math.min(g,A)),lerp:(A,I,g)=>(1-g)*A+g*I,damp:(A,I,g,C)=>y.lerp(A,I,1-Math.exp(-g*C)),nearAngle:(A,I,g=!1)=>I+Math.atan2(Math.sin(A-I),Math.cos(A-I))*(g?K:1),unwrapDeg:A=>A-360*Math.floor((A+180)/360),unwrapRad:A=>Math.atan2(Math.sin(A),Math.cos(A)),nearEquals:(A,I,g)=>Math.abs(A-I)<=g,autoSize:(A=[1,1,1],I="box")=>{1===A.length&&(A[1]=A[0]);let g=A[0],C=A[1];return"sphere"===I&&(A=[g,g,g]),"cylinder"!==I&&"wheel"!==I&&"capsule"!==I||(A=[g,C,g]),"cone"!==I&&"pyramid"!==I||(A=[g,C,g]),2===A.length&&(A[2]=A[0]),A},shuffle:A=>{let I=A.map((A=>({value:A,sort:Math.random()}))).sort(((A,I)=>A.sort-I.sort)).map((({value:A})=>A));return I},randomSign:()=>Math.random()<.5?-1:1,randSpread:A=>A*(.5-Math.random()),rand:(A=0,I=1)=>A+Math.random()*(I-A),randInt:(A,I)=>A+Math.floor(Math.random()*(I-A+1)),randIntUnic:(A,I,g)=>{for(var C=[];C.length<g;){var B=y.randInt(A,I);-1===C.indexOf(B)&&C.push(B)}return C},fromTransform:(A,I,g,C=[0,0,0,1],B=!1)=>{let Q=y.composeMatrixArray(A,I),E=y.composeMatrixArray(g,C);return B&&(Q=y.invertMatrixArray(Q)),Q=y.multiplyMatrixArray(Q,E),[Q[12],Q[13],Q[14]]},fromTransformToQ:(A,I,g=!1)=>{let C=y.composeMatrixArray(A,I),B=y.decomposeFullMatrixArray(C).q;return g&&(B=y.quatInvert(B)),B},composeMatrixArray:(A,I,g=[1,1,1])=>{const C=I[0],B=I[1],Q=I[2],E=I[3],i=C+C,D=B+B,o=Q+Q,S=C*i,w=C*D,G=C*o,k=B*D,h=B*o,K=Q*o,J=E*i,U=E*D,y=E*o,N=g[0],a=g[1],M=g[2];return[(1-(k+K))*N,(w+y)*N,(G-U)*N,0,(w-y)*a,(1-(S+K))*a,(h+J)*a,0,(G+U)*M,(h-J)*M,(1-(S+k))*M,0,A[0],A[1],A[2],1]},multiplyMatrixArray:(A,I)=>{const g=A,C=I,B=[],Q=g[0],E=g[4],i=g[8],D=g[12],o=g[1],S=g[5],w=g[9],G=g[13],k=g[2],h=g[6],K=g[10],J=g[14],U=g[3],y=g[7],N=g[11],a=g[15],M=C[0],F=C[4],s=C[8],R=C[12],c=C[1],q=C[5],Y=C[9],l=C[13],L=C[2],t=C[6],H=C[10],p=C[14],e=C[3],r=C[7],n=C[11],d=C[15];return B[0]=Q*M+E*c+i*L+D*e,B[4]=Q*F+E*q+i*t+D*r,B[8]=Q*s+E*Y+i*H+D*n,B[12]=Q*R+E*l+i*p+D*d,B[1]=o*M+S*c+w*L+G*e,B[5]=o*F+S*q+w*t+G*r,B[9]=o*s+S*Y+w*H+G*n,B[13]=o*R+S*l+w*p+G*d,B[2]=k*M+h*c+K*L+J*e,B[6]=k*F+h*q+K*t+J*r,B[10]=k*s+h*Y+K*H+J*n,B[14]=k*R+h*l+K*p+J*d,B[3]=U*M+y*c+N*L+a*e,B[7]=U*F+y*q+N*t+a*r,B[11]=U*s+y*Y+N*H+a*n,B[15]=U*R+y*l+N*p+a*d,B},invertMatrixArray:A=>{const I=A,g=I[0],C=I[1],B=I[2],Q=I[3],E=I[4],i=I[5],D=I[6],o=I[7],S=I[8],w=I[9],G=I[10],k=I[11],h=I[12],K=I[13],J=I[14],U=I[15],y=w*J*o-K*G*o+K*D*k-i*J*k-w*D*U+i*G*U,N=h*G*o-S*J*o-h*D*k+E*J*k+S*D*U-E*G*U,a=S*K*o-h*w*o+h*i*k-E*K*k-S*i*U+E*w*U,M=h*w*D-S*K*D-h*i*G+E*K*G+S*i*J-E*w*J,F=g*y+C*N+B*a+Q*M;if(0===F)return[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];const s=1/F;return I[0]=y*s,I[1]=(K*G*Q-w*J*Q-K*B*k+C*J*k+w*B*U-C*G*U)*s,I[2]=(i*J*Q-K*D*Q+K*B*o-C*J*o-i*B*U+C*D*U)*s,I[3]=(w*D*Q-i*G*Q-w*B*o+C*G*o+i*B*k-C*D*k)*s,I[4]=N*s,I[5]=(S*J*Q-h*G*Q+h*B*k-g*J*k-S*B*U+g*G*U)*s,I[6]=(h*D*Q-E*J*Q-h*B*o+g*J*o+E*B*U-g*D*U)*s,I[7]=(E*G*Q-S*D*Q+S*B*o-g*G*o-E*B*k+g*D*k)*s,I[8]=a*s,I[9]=(h*w*Q-S*K*Q-h*C*k+g*K*k+S*C*U-g*w*U)*s,I[10]=(E*K*Q-h*i*Q+h*C*o-g*K*o-E*C*U+g*i*U)*s,I[11]=(S*i*Q-E*w*Q-S*C*o+g*w*o+E*C*k-g*i*k)*s,I[12]=M*s,I[13]=(S*K*B-h*w*B+h*C*G-g*K*G-S*C*J+g*w*J)*s,I[14]=(h*i*B-E*K*B-h*C*D+g*K*D+E*C*J-g*i*J)*s,I[15]=(E*w*B-S*i*B+S*C*D-g*w*D-E*C*G+g*i*G)*s,I},matrixArrayDeterminant:A=>{const I=A,g=I[0],C=I[4],B=I[8],Q=I[12],E=I[1],i=I[5],D=I[9],o=I[13],S=I[2],w=I[6],G=I[10],k=I[14];return I[3]*(+Q*D*w-B*o*w-Q*i*G+C*o*G+B*i*k-C*D*k)+I[7]*(+g*D*k-g*o*G+Q*E*G-B*E*k+B*o*S-Q*D*S)+I[11]*(+g*o*w-g*i*k-Q*E*w+C*E*k+Q*i*S-C*o*S)+I[15]*(-B*i*S-g*D*w+g*i*G+B*E*w-C*E*G+C*D*S)},decomposeMatrixArray:A=>[A[12],A[13],A[14]],decomposeFullMatrixArray:A=>{const I=A;let g=y.lengthArray([I[0],I[1],I[2]]);const C=y.lengthArray([I[4],I[5],I[6]]),B=y.lengthArray([I[8],I[9],I[10]]);y.matrixArrayDeterminant(A)<0&&(g=-g);let Q=[...A];const E=1/g,i=1/C,D=1/B;Q[0]*=E,Q[1]*=E,Q[2]*=E,Q[4]*=i,Q[5]*=i,Q[6]*=i,Q[8]*=D,Q[9]*=D,Q[10]*=D;let o=y.quatFromRotationMatrix(Q);return{p:[A[12],A[13],A[14]],q:o,s:[g,C,B]}},applyTransformArray:(A,I,g,C=[1,1,1])=>{const B=y.composeMatrixArray(I,g,C),Q=A[0],E=A[1],i=A[2],D=1/(B[3]*Q+B[7]*E+B[11]*i+B[15]);return[(B[0]*Q+B[4]*E+B[8]*i+B[12])*D,(B[1]*Q+B[5]*E+B[9]*i+B[13])*D,(B[2]*Q+B[6]*E+B[10]*i+B[14])*D]},slerpQuatArray:(A,I,g)=>{if(0===g)return A;if(1===g)return I;let C=[...A];const B=A[0],Q=A[1],E=A[2],i=A[3],D=I[0],o=I[1],S=I[2],w=I[3];let G=i*w+B*D+Q*o+E*S;if(G<0?(C=[-D,-o,-S,-w],G=-G):C=[...I],G>=1)return A;const k=1-G*G;if(k<=J){const A=1-g;return C[3]=A*i+g*C[3],C[0]=A*B+g*C[0],C[1]=A*Q+g*C[1],C[2]=A*E+g*C[2],y.quatNomalize(C)}const h=Math.sqrt(k),K=Math.atan2(h,G),U=Math.sin((1-g)*K)/h,N=Math.sin(g*K)/h;return C[3]=i*U+C[3]*N,C[0]=B*U+C[0]*N,C[1]=Q*U+C[1]*N,C[2]=E*U+C[2]*N,C},toLocalQuatArray:(A=[0,0,0],I)=>{let g=y.quatFromEuler(A),C=y.quatInvert(I.quaternion.toArray());return y.quatMultiply(C,g)},quatFromRotationMatrix:A=>{let I=[0,0,0,1];const g=A,C=g[0],B=g[4],Q=g[8],E=g[1],i=g[5],D=g[9],o=g[2],S=g[6],w=g[10],G=C+i+w;if(G>0){const A=.5/Math.sqrt(G+1);I[3]=.25/A,I[0]=(S-D)*A,I[1]=(Q-o)*A,I[2]=(E-B)*A}else if(C>i&&C>w){const A=2*Math.sqrt(1+C-i-w);I[3]=(S-D)/A,I[0]=.25*A,I[1]=(B+E)/A,I[2]=(Q+o)/A}else if(i>w){const A=2*Math.sqrt(1+i-C-w);I[3]=(Q-o)/A,I[0]=(B+E)/A,I[1]=.25*A,I[2]=(D+S)/A}else{const A=2*Math.sqrt(1+w-C-i);I[3]=(E-B)/A,I[0]=(Q+o)/A,I[1]=(D+S)/A,I[2]=.25*A}return I},quatFromEuler:(A=[0,0,0],I=!0)=>{const g=Math.cos,C=Math.sin,B=I?h:1,Q=A[0]*B*.5,E=A[1]*B*.5,i=A[2]*B*.5,D=g(Q),o=g(E),S=g(i),w=C(Q),G=C(E),k=C(i);return[w*o*S+D*G*k,D*G*S-w*o*k,D*o*k+w*G*S,D*o*S-w*G*k]},quatFromAxis:(A=[0,0,0],I,g=!0)=>{const C=.5*I*(g?h:1),B=Math.sin(C);return[A[0]*B,A[1]*B,A[2]*B,Math.cos(C)]},quatNomalize:A=>{let I=y.lengthArray(A);return 0===I?[0,0,0,1]:(I=1/I,y.scaleArray(A,I,4))},quatInvert:A=>[-A[0],-A[1],-A[2],A[3]],quatMultiply:(A,I)=>{const g=A[0],C=A[1],B=A[2],Q=A[3],E=I[0],i=I[1],D=I[2],o=I[3];return[g*o+Q*E+C*D-B*i,C*o+Q*i+B*E-g*D,B*o+Q*D+g*i-C*E,Q*o-g*E-C*i-B*D]},quatToAxis:A=>{let I=2*Math.acos(A[3]);const g=Math.sqrt(1-A[3]*A[3]);return g<1e-4?[1,0,0]:[A[0]/g,A[1]/g,A[2]/g,I]},eulerFromMatrix:A=>{const I=A[0],g=A[4],C=A[8];A[1];const B=A[5],Q=A[9];A[2];const E=A[6],i=A[10];let D=[0,0,0];return D[1]=Math.asin(y.clamp(C,-1,1)),Math.abs(C)<.9999999?(D[0]=Math.atan2(-Q,i),D[2]=Math.atan2(-g,I)):(D[0]=Math.atan2(E,B),D[2]=0),D},angleTo:(A,I)=>2*Math.acos(Math.abs(y.clamp(y.dotArray(A,I),-1,1))),getSize:A=>.001*A.byteLength+"kb",perpendicularArray:A=>{const I=Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);let g=Math.acos(A[1]/I);const C=Math.atan2(A[2],A[0]);g>U?g-=U:g+=U;return[I*Math.sin(g)*Math.cos(C),I*Math.cos(g),I*Math.sin(g)*Math.sin(C)]},crossArray:(A,I)=>{const g=A[0],C=A[1],B=A[2],Q=I[0],E=I[1],i=I[2];return[C*i-B*E,B*Q-g*i,g*E-C*Q]},applyQuaternion:(A,I)=>{const g=A[0],C=A[1],B=A[2],Q=I[0],E=I[1],i=I[2],D=I[3],o=2*(E*B-i*C),S=2*(i*g-Q*B),w=2*(Q*C-E*g);return[g+D*o+E*w-i*S,C+D*S+i*o-Q*w,B+D*w+Q*S-E*o]},nullArray:(A,I,g)=>{let C=0;for(;g--;)C+=A[I+g];return C},equalArray:(A,I)=>{let g=A.length;for(;g--;)if(A[g]!==I[g])return!1;return!0},lerpArray:(A,I,g)=>{if(0===g)return A;if(1===g)return I;let C=A.length,B=[];for(;C--;)B[C]=A[C],B[C]+=(I[C]-B[C])*g;return B},zeroArray:(A,I=0,g)=>{for(g=g??A.length;g--;)A[I+g]=0;return A},lengthArray:A=>{let I=A.length,g=0;for(;I--;)g+=A[I]*A[I];return Math.sqrt(g)},dotArray:(A,I)=>{let g=A.length,C=0;for(;g--;)C+=A[g]*I[g];return C},addArray:(A,I,g)=>{g=g??A.length;let C=[];for(;g--;)C[g]=A[g]+I[g];return C},subArray:(A,I,g)=>{g=g??A.length;let C=[];for(;g--;)C[g]=A[g]-I[g];return C},mulArray:(A,I,g)=>{if(I instanceof Array){let C=[];for(g=g??A.length;g--;)C[g]=A[g]*I[g];return C}return A.map((A=>A*I))},divArray:(A,I,g)=>y.mulArray(A,1/I,g),scaleArray:(A,I,g)=>y.mulArray(A,I,g),fillArray:(A,I,g=0,C)=>{for(C=C??A.length;C--;)I[g+C]=A[C]},copyArray:(A,I)=>{},cloneArray:A=>[...A],distanceArray:(A,I=[0,0,0])=>y.lengthArray(y.subArray(A,I)),normalizeArray:A=>y.divArray(A,y.lengthArray(A)||1),normalArray:(A,I=[0,0,0])=>y.normalizeArray(y.subArray(I,A)),getVolume:(A,I,g=null)=>{let C=1,B=I;switch(A){case"sphere":C=4*Math.PI*B[0]*B[0]*B[0]/3;break;case"cone":C=Math.PI*B[0]*(.5*B[1])*2;break;case"box":C=.5*B[0]*8*(.5*B[1])*(.5*B[2]);break;case"cylinder":C=Math.PI*B[0]*B[0]*(.5*B[1])*2;break;case"capsule":C=4*Math.PI*B[0]*B[0]*B[0]/3+Math.PI*B[0]*B[0]*(.5*B[1])*2;break;case"convex":case"mesh":C=y.getConvexVolume(g)}return C},getConvexVolume:A=>{let I,g=A.length/3,C=[0,0,0],B=[0,0,0];for(;g--;)I=3*g,A[I]<C[0]?C[0]=A[I]:A[I]>B[0]&&(B[0]=A[I]),A[I+1]<C[1]?C[1]=A[I+1]:A[I+1]>B[1]&&(B[1]=A[I+1]),A[I+2]<C[2]?C[2]=A[I+2]:A[I+2]>B[2]&&(B[2]=A[I+2]);let Q=[B[0]-C[0],B[1]-C[1],B[2]-C[2]];return.5*Q[0]*8*(.5*Q[1])*(.5*Q[2])},massFromDensity:(A,I)=>A*I,densityFromMass:(A,I)=>A/I,toNonIndexed:A=>A.index?A.clone().toNonIndexed():A,getIndex:(A,I)=>!A.index||I?null:A.index.array||null,getVertex:(A,I)=>{let g=A.attributes.position.array;return I&&A.index&&(g=(A=A.clone().toNonIndexed()).attributes.position.array),g},getNormal:A=>A.attributes.normal.array,getFaces:A=>{let I=[];if(A.index){let g=A.getIndex();for(let A=0;A<g.count;A+=3)I.push([g.getX(A),g.getX(A+1),g.getX(A+2)])}else{let g=A.getAttribute("position").count;for(let A=0;A<g;A+=3)I.push([A,A+1,A+2])}return I},reduce:A=>{},barycentric:(A,I)=>{},solve:(A,I)=>{}},N=y;class a extends G{constructor(){super(),this.Utils=C,this.type="ray",this.ray=new RAPIER.Ray({x:0,y:0,z:0},{x:0,y:0,z:0}),this.v1=new B(0,0,0),this.v2=new B(0,0,0)}step(){const A=g.Ar,I=g.ArPos[this.type];g.reflow.ray=[];let C,B,Q,E,i=this.list.length,D=0;for(;i--;){B=I+i*w.ray,C=this.list[i],Q=C.getPoint(),A[B]=0,this.v1.fromArray(Q[0]),this.v2.fromArray(Q[1]),D=N.distanceArray(Q[0],Q[1]),A[B+1]=D,this.v2.fromArray(N.normalArray(Q[0],Q[1])),this.ray.origin=this.v1,this.ray.dir=this.v2;let o=!0;g.world.intersectionsWithRay(this.ray,D,C.solid,(I=>{let D=I.collider._parent.name;if(!C.selfHit&&C.parent&&D===C.parent)return!0;if(!o)return!0;o=!1,A[B]=1;let S=this.ray.pointAt(I.toi);E=[S.x,S.y,S.z],A[B+1]=N.distanceArray(Q[0],E),A[B+2]=Q[0][0],A[B+3]=Q[0][1],A[B+4]=Q[0][2],A[B+5]=S.x,A[B+6]=S.y,A[B+7]=S.z,A[B+8]=I.normal.x,A[B+9]=I.normal.y,A[B+10]=I.normal.z,g.reflow.ray[i]=I.collider._parent.name}))}}add(A={}){this.setName(A);let I=new M(A);this.addToWorld(I,A.id)}set(A={},I=null){}}class M{constructor(A={}){this.type="ray",this.name=A.name,this.group=void 0!==A.group||68719476735,this.parent=A.parent||"",this.selfHit=A.selfHit||!1,this.begin=A.begin||[0,0,0],this.end=A.end||[0,0,1],this.solid=!1}getPoint(){if(this.parent){const A=C.byName(this.parent);if(A){let I=A.translation(),g=A.rotation();const C=[I.x,I.y,I.z],B=[g.x,g.y,g.z,g.w];return[N.applyTransformArray(this.begin,C,B),N.applyTransformArray(this.end,C,B)]}}return[this.begin,this.end]}}class F extends G{constructor(){super(),this.Utils=C,this.type="body",this.itype="body",this.num=w[this.type],this.full=!1,this.p=new B,this.q=new Q,this.v=new B,this.v2=new B,this.r=new B}setFull(A){this.num=w[A?"bodyFull":"body"],this.full=A}step(){const A=g.Ar,I=g.ArPos[this.itype];let C,B,Q=this.list.length;for(;Q--;)C=this.list[Q],B=I+Q*this.num,A[B]=C.isSleeping()?0:1,this.p.copy(C.translation()).toArray(A,B+1),this.q.copy(C.rotation()).toArray(A,B+4),this.full&&(this.v.copy(C.linvel()).toArray(A,B+8),this.r.copy(C.angvel()).toArray(A,B+11),1===A[B]&&(A[B]=9.8*this.v.length()))}shape(A={}){let I,g,C=A.type||"box",Q=A.size||[1,1,1];switch(C){case"plane":1===Q[0]&&(Q=[300,0,300]),g=[.5*Q[0],0,.5*Q[2],.5*Q[0],0,.5*-Q[2],.5*-Q[0],0,.5*-Q[2],.5*-Q[0],0,.5*Q[2]],I=RAPIER.ColliderDesc.convexHull(g);break;case"box":I=RAPIER.ColliderDesc.cuboid(.5*Q[0],.5*Q[1],.5*Q[2]);break;case"ChamferBox":I=RAPIER.ColliderDesc.roundCuboid(.5*Q[0],.5*Q[1],.5*Q[2],A.radius);break;case"sphere":I=RAPIER.ColliderDesc.ball(Q[0]);break;case"cone":I=RAPIER.ColliderDesc.cone(.5*Q[1],Q[0]);break;case"ChamferCone":I=RAPIER.ColliderDesc.roundCone(.5*Q[1],Q[0],A.radius);break;case"cylinder":I=RAPIER.ColliderDesc.cylinder(.5*Q[1],Q[0]);break;case"ChamferCyl":I=RAPIER.ColliderDesc.roundCylinder(.5*Q[1],Q[0],A.radius);break;case"capsule":I=RAPIER.ColliderDesc.capsule(.5*Q[1],Q[0]);break;case"convex":I=RAPIER.ColliderDesc.convexHull(A.v,A.index||null);break;case"convexmesh":I=RAPIER.ColliderDesc.convexMesh(A.v,A.index||null);break;case"roundConvexHull":I=RAPIER.ColliderDesc.roundConvexHull(A.v,A.index||null,A.radius);break;case"roundConvexMesh":I=RAPIER.ColliderDesc.roundConvexMesh(A.v,A.index||null,A.radius);break;case"mesh":I=RAPIER.ColliderDesc.trimesh(A.v,A.index||null);break;case"heightfield":break;case"triangle":I=RAPIER.ColliderDesc.triangle((new B).fromArray(A.v,0),(new B).fromArray(A.v,3),(new B).fromArray(A.v,6));break;case"roundTriangle":I=RAPIER.ColliderDesc.roundTriangle((new B).fromArray(A.v,0),(new B).fromArray(A.v,3),(new B).fromArray(A.v,6),A.radius);break;case"segment":I=RAPIER.ColliderDesc.segment((new B).fromArray(A.v,0),(new B).fromArray(A.v,3));break;case"polyline":I=RAPIER.ColliderDesc.polyline(A.v,A.index||null)}let E=A.localPos||[0,0,0];I.setTranslation(E[0],E[1],E[2]),this.q.fromArray(A.localQuat||[0,0,0,1]),I.setRotation(this.q);let i=A.density||0;return void 0!==A.mass&&(i=N.densityFromMass(A.mass,N.getVolume(C,Q,A.v))),I.setDensity(i),void 0!==A.friction&&(0===A.friction&&(A.friction=1e-5),I.setFriction(A.friction)),void 0!==A.restitution&&I.setRestitution(A.restitution),void 0!==A.sensor&&I.setSensor(A.sensor),void 0!==A.isTrigger&&I.setSensor(A.isTrigger),I}add(A={}){let C,B=this.setName(A);switch(this.type){case"body":C=A.kinematic?RAPIER.RigidBodyDesc.kinematicVelocityBased():RAPIER.RigidBodyDesc.dynamic();break;case"solid":C=RAPIER.RigidBodyDesc.fixed()}let Q,E=g.world.createRigidBody(C);switch(A.type){case"null":Q=g.world.createCollider(this.shape({type:"segment",v:[-.01,0,0,.01,0,0],sensor:!0}),E),I.set(Q.handle,Q);break;case"compound":let C;for(var i=0;i<A.shapes.length;i++)C=A.shapes[i],void 0!==A.density&&(C.density=A.density),void 0!==A.friction&&(C.friction=A.friction),void 0!==A.restitution&&(C.restitution=A.restitution),void 0!==A.mask&&(C.collisionMask=A.mask),void 0!==A.group&&(C.collisionGroup=A.group),C.pos&&(C.localPos=C.pos),C.quat&&(C.localQuat=C.quat),Q=g.world.createCollider(this.shape(C),E),I.set(Q.handle,Q);break;default:A.shapeType&&(A.type=A.shapeType),Q=g.world.createCollider(this.shape(A),E),I.set(Q.handle,Q)}E.name=B,E.type=this.type,E.first=!0,E.collid=Q,E.isSensor=!!A.isTrigger&&A.isTrigger,E.isKinematic=A.kinematic||!1,A.kinematic&&(E.pos=A.pos||[0,0,0],E.quat=A.quat||[0,0,0,1]),this.addToWorld(E,A.id),this.set(A,E)}set(A={},I=null){if(null===I&&(I=this.byName(A.name)),null===I)return;let C=!A.activate||A.activate;A.sleep&&(I.sleep(),C=!1),(A.activate||A.wake)&&I.wakeUp(),A.noGravity&&I.setGravityScale(0),(A.pos||A.quat)&&(A.pos&&I.setTranslation(this.v.fromArray(A.pos),C),A.quat&&I.setRotation(this.q.fromArray(A.quat),C)),A.force&&(A.force=N.scaleArray(A.force,g.timestep,3),I.addForce(this.v.fromArray(A.force),C)),A.worldForce&&I.addForceAtPoint(this.v.fromArray(A.worldForce),this.v.fromArray(A.worldForce,3),C),A.torque&&I.addTorque(this.v.fromArray(A.torque),C),A.impulse&&(A.impulseCenter?I.applyImpulseAtPoint(this.v.fromArray(A.impulse),this.v2.fromArray(A.impulseCenter),C):I.applyImpulse(this.v.fromArray(A.impulse),C)),A.angularImpulse&&I.applyTorqueImpulse(this.v.fromArray(A.angularImpulse),C),void 0!==A.linearFactor&&I.restrictTranslations(!!A.linearFactor[0],!!A.linearFactor[1],!!A.linearFactor[2],C),void 0!==A.angularFactor&&I.restrictRotations(0!==A.angularFactor[0],0!==A.angularFactor[1],0!==A.angularFactor[2],C),void 0!==A.lockPosition&&I.lockTranslations(A.lockRotation,C),void 0!==A.lockRotation&&I.lockRotations(A.lockRotation,C),A.linearVelocity&&I.setLinvel(this.v.fromArray(A.linearVelocity),C),A.angularVelocity&&I.setAngvel(this.v.fromArray(A.angularVelocity),C),void 0!==A.gravityScale&&I.setGravityScale(A.gravityScale,C),void 0!==A.gravity&&I.setGravityScale(A.gravity?1:0),A.dominance&&I.setDominanceGroup(A.dominance),A.damping&&(I.setLinearDamping(A.damping[0]),I.setAngularDamping(A.damping[1])),A.reset&&(I.setLinvel(this.v.set(0,0,0),!1),I.setAngvel(this.v.set(0,0,0),!1)),A.massInfo&&this.getMassInfo(I)}getMassInfo(A){if("string"==typeof A&&(A=this.byName(A)),null===A)return;if("body"!==this.type)return;const I={mass:A.mass()};console.log(I)}clearShapes(A={},g=null){let C=g.numColliders();for(;C--;)I.delete(g.collider(C))}setShapes(A={},g=null){let C,B=g.numColliders();for(;B--;)C=I.get(g.collider(B)),void 0!==A.density&&C.setDensity(A.density),void 0!==A.friction&&C.setFriction(A.friction),void 0!==A.restitution&&C.setRestitution(A.restitution)}}class s extends G{constructor(){super(),this.Utils=C,this.type="joint",this.v1=new B,this.v2=new B,this.p1=new B,this.p2=new B,this.q1=new Q,this.q2=new Q,this.q3=new Q}step(){g.ArPos[this.type];let A,I=this.list.length;for(;I--;)A=this.list[I],A.visible}add(A={}){this.v;let I=this.setName(A);const C=this.byName(A.b1),B=this.byName(A.b2);C&&C.wakeUp(),B&&B.wakeUp();const Q=A.mode||"revolute";let E,i=this.v1.fromArray(A.pos1||[0,0,0]),D=this.v2.fromArray(A.pos2||[0,0,0]),o=this.q1.fromArray(A.quat1||[0,0,0,1]),S=this.q2.fromArray(A.quat2||[0,0,0,1]),w=this.p1.fromArray(A.axis1||[1,0,0]);switch(this.p2.fromArray(A.axis2||[1,0,0]),Q){case"spherical":default:E=RAPIER.JointData.spherical(i,D);break;case"hinge":case"revolute":E=RAPIER.JointData.revolute(i,D,w);break;case"slider":case"prismatic":E=RAPIER.JointData.prismatic(i,D,w);break;case"fixe":E=RAPIER.JointData.fixed(i,o,D,S)}let G=void 0!==A.collision&&A.collision;const k=g.world.createImpulseJoint(E,C,B,G);k.data=E,k.name=I,k.mode=Q,k.type=this.type,k.b1=C,k.b2=B,k.visible=!1,this.set(A,k),this.addToWorld(k,A.id)}limit(A,I=[0,0],g=!1){let C=g?1:h;A.limitsEnabled=!0,A.limits=[I[0]*C,I[1]*C]}set(A={},I=null){null===I&&(I=this.byName(A.name)),null!==I&&(void 0!==A.visible&&(I.visible=A.visible),A.lm&&this.limit(I.data,A.lm,"prismatic"===I.mode||"slider"===I.mode))}}class R extends G{constructor(){super(),this.Utils=C,this.type="contact"}step(){const A=g.Ar,I=g.ArPos[this.type];let C,B,Q=this.list.length;for(;Q--;)C=this.list[Q],B=I+Q*w.contact,null!==C.b2?C.b1.isSensor||C.b2.isSensor?A[B]=g.world.intersectionPair(C.b1,C.b2)?1:0:(A[B]=0,g.world.contactPair(C.b1,C.b2,((I,g)=>{A[B]=1}))):C.b1.isSensor?g.world.contactsWith(C.c1,(A=>{})):g.world.contactsWith(collider,(A=>{}))}add(A={}){if(this.setName(A),A.b1=this.byName(A.b1),A.b2=this.byName(A.b2),null===A.b1)return;A.b1.collid.setActiveEvents(RAPIER.ActiveEvents.COLLISION_EVENTS);let I=new c(A);this.addToWorld(I,A.id)}}class c{constructor(A={}){this.type="contact",this.name=A.name,this.b1=A.b1||null,this.b2=A.b2||null,this.c1=null,this.c2=null,this.b1&&(this.c1=this.b1.collid),this.b2&&(this.c2=this.b2.collid),this.ignore=A.ignore||[],this.result={hit:!1,point:[0,0,0],normal:[0,0,0],distance:0}}update(){}}let q;const Y=new Array(128).fill(void 0);Y.push(void 0,null,!0,!1);let l=Y.length;function L(A){l===Y.length&&Y.push(Y.length+1);const I=l;return l=Y[I],Y[I]=A,I}function t(A){return Y[A]}function H(A){const I=t(A);return(g=A)<132||(Y[g]=l,l=g),I;var g}function p(A){return null==A}let e=null;function r(){return null!==e&&0!==e.byteLength||(e=new Float64Array(q.memory.buffer)),e}let n=null;function d(){return null!==n&&0!==n.byteLength||(n=new Int32Array(q.memory.buffer)),n}const T="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&T.decode();let O=null;function Z(A,I){return A>>>=0,T.decode((null!==O&&0!==O.byteLength||(O=new Uint8Array(q.memory.buffer)),O).subarray(A,A+I))}function b(A,I){if(!(A instanceof I))throw new Error(`expected instance of ${I.name}`);return A.ptr}let x=null;function W(){return null!==x&&0!==x.byteLength||(x=new Float32Array(q.memory.buffer)),x}let m=128;function j(A){if(1==m)throw new Error("out of js stack");return Y[--m]=A,m}function f(A,I){return A>>>=0,W().subarray(A/4,A/4+I)}let V=null;function X(){return null!==V&&0!==V.byteLength||(V=new Uint32Array(q.memory.buffer)),V}let P=0;function u(A,I){const g=I(4*A.length,4)>>>0;return W().set(A,g/4),P=A.length,g}function v(A,I){const g=I(4*A.length,4)>>>0;return X().set(A,g/4),P=A.length,g}function z(A,I){try{return A.apply(this,I)}catch(A){q.__wbindgen_exn_store(L(A))}}const _=Object.freeze({LinX:0,0:"LinX",LinY:1,1:"LinY",LinZ:2,2:"LinZ",AngX:3,3:"AngX",AngY:4,4:"AngY",AngZ:5,5:"AngZ"}),$=Object.freeze({Revolute:0,0:"Revolute",Fixed:1,1:"Fixed",Prismatic:2,2:"Prismatic",Rope:3,3:"Rope",Spring:4,4:"Spring",Spherical:5,5:"Spherical",Generic:6,6:"Generic"}),AA=Object.freeze({Ball:0,0:"Ball",Cuboid:1,1:"Cuboid",Capsule:2,2:"Capsule",Segment:3,3:"Segment",Polyline:4,4:"Polyline",Triangle:5,5:"Triangle",TriMesh:6,6:"TriMesh",HeightField:7,7:"HeightField",Compound:8,8:"Compound",ConvexPolyhedron:9,9:"ConvexPolyhedron",Cylinder:10,10:"Cylinder",Cone:11,11:"Cone",RoundCuboid:12,12:"RoundCuboid",RoundTriangle:13,13:"RoundTriangle",RoundCylinder:14,14:"RoundCylinder",RoundCone:15,15:"RoundCone",RoundConvexPolyhedron:16,16:"RoundConvexPolyhedron",HalfSpace:17,17:"HalfSpace"}),IA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>q.__wbg_rawbroadphase_free(A>>>0)));class gA{static __wrap(A){A>>>=0;const I=Object.create(gA.prototype);return I.__wbg_ptr=A,IA.register(I,I.__wbg_ptr,I),I}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,IA.unregister(this),A}free(){const A=this.__destroy_into_raw();q.__wbg_rawbroadphase_free(A)}constructor(){const A=q.rawbroadphase_new();return this.__wbg_ptr=A>>>0,this}}const CA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>q.__wbg_rawccdsolver_free(A>>>0)));class BA{__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,CA.unregister(this),A}free(){const A=this.__destroy_into_raw();q.__wbg_rawccdsolver_free(A)}constructor(){const A=q.rawccdsolver_new();return this.__wbg_ptr=A>>>0,this}}const QA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>q.__wbg_rawcharactercollision_free(A>>>0)));class EA{__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,QA.unregister(this),A}free(){const A=this.__destroy_into_raw();q.__wbg_rawcharactercollision_free(A)}constructor(){const A=q.rawcharactercollision_new();return this.__wbg_ptr=A>>>0,this}handle(){return q.rawcharactercollision_handle(this.__wbg_ptr)}translationDeltaApplied(){const A=q.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);return hI.__wrap(A)}translationDeltaRemaining(){const A=q.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);return hI.__wrap(A)}toi(){return q.rawcharactercollision_toi(this.__wbg_ptr)}worldWitness1(){const A=q.rawcharactercollision_worldWitness1(this.__wbg_ptr);return hI.__wrap(A)}worldWitness2(){const A=q.rawcharactercollision_worldWitness2(this.__wbg_ptr);return hI.__wrap(A)}worldNormal1(){const A=q.rawcharactercollision_worldNormal1(this.__wbg_ptr);return hI.__wrap(A)}worldNormal2(){const A=q.rawcharactercollision_worldNormal2(this.__wbg_ptr);return hI.__wrap(A)}}const iA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>q.__wbg_rawcolliderset_free(A>>>0)));class DA{static __wrap(A){A>>>=0;const I=Object.create(DA.prototype);return I.__wbg_ptr=A,iA.register(I,I.__wbg_ptr,I),I}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,iA.unregister(this),A}free(){const A=this.__destroy_into_raw();q.__wbg_rawcolliderset_free(A)}coTranslation(A){const I=q.rawcolliderset_coTranslation(this.__wbg_ptr,A);return hI.__wrap(I)}coRotation(A){const I=q.rawcolliderset_coRotation(this.__wbg_ptr,A);return gI.__wrap(I)}coSetTranslation(A,I,g,C){q.rawcolliderset_coSetTranslation(this.__wbg_ptr,A,I,g,C)}coSetTranslationWrtParent(A,I,g,C){q.rawcolliderset_coSetTranslationWrtParent(this.__wbg_ptr,A,I,g,C)}coSetRotation(A,I,g,C,B){q.rawcolliderset_coSetRotation(this.__wbg_ptr,A,I,g,C,B)}coSetRotationWrtParent(A,I,g,C,B){q.rawcolliderset_coSetRotationWrtParent(this.__wbg_ptr,A,I,g,C,B)}coIsSensor(A){return 0!==q.rawcolliderset_coIsSensor(this.__wbg_ptr,A)}coShapeType(A){return q.rawcolliderset_coShapeType(this.__wbg_ptr,A)}coHalfspaceNormal(A){const I=q.rawcolliderset_coHalfspaceNormal(this.__wbg_ptr,A);return 0===I?void 0:hI.__wrap(I)}coHalfExtents(A){const I=q.rawcolliderset_coHalfExtents(this.__wbg_ptr,A);return 0===I?void 0:hI.__wrap(I)}coSetHalfExtents(A,I){b(I,hI),q.rawcolliderset_coSetHalfExtents(this.__wbg_ptr,A,I.__wbg_ptr)}coRadius(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawcolliderset_coRadius(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}coSetRadius(A,I){q.rawcolliderset_coSetRadius(this.__wbg_ptr,A,I)}coHalfHeight(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawcolliderset_coHalfHeight(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}coSetHalfHeight(A,I){q.rawcolliderset_coSetHalfHeight(this.__wbg_ptr,A,I)}coRoundRadius(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawcolliderset_coRoundRadius(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}coSetRoundRadius(A,I){q.rawcolliderset_coSetRoundRadius(this.__wbg_ptr,A,I)}coVertices(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawcolliderset_coVertices(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=d()[C/4+1];let B;return 0!==I&&(B=f(I,g).slice(),q.__wbindgen_free(I,4*g,4)),B}finally{q.__wbindgen_add_to_stack_pointer(16)}}coIndices(A){try{const Q=q.__wbindgen_add_to_stack_pointer(-16);q.rawcolliderset_coIndices(Q,this.__wbg_ptr,A);var I=d()[Q/4+0],g=d()[Q/4+1];let E;return 0!==I&&(E=(C=I,B=g,C>>>=0,X().subarray(C/4,C/4+B)).slice(),q.__wbindgen_free(I,4*g,4)),E}finally{q.__wbindgen_add_to_stack_pointer(16)}var C,B}coTriMeshFlags(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawcolliderset_coTriMeshFlags(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=d()[C/4+1];return 0===I?void 0:g>>>0}finally{q.__wbindgen_add_to_stack_pointer(16)}}coHeightFieldFlags(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawcolliderset_coHeightFieldFlags(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=d()[C/4+1];return 0===I?void 0:g>>>0}finally{q.__wbindgen_add_to_stack_pointer(16)}}coHeightfieldHeights(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawcolliderset_coHeightfieldHeights(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=d()[C/4+1];let B;return 0!==I&&(B=f(I,g).slice(),q.__wbindgen_free(I,4*g,4)),B}finally{q.__wbindgen_add_to_stack_pointer(16)}}coHeightfieldScale(A){const I=q.rawcolliderset_coHeightfieldScale(this.__wbg_ptr,A);return 0===I?void 0:hI.__wrap(I)}coHeightfieldNRows(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawcolliderset_coHeightfieldNRows(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=d()[C/4+1];return 0===I?void 0:g>>>0}finally{q.__wbindgen_add_to_stack_pointer(16)}}coHeightfieldNCols(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawcolliderset_coHeightfieldNCols(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=d()[C/4+1];return 0===I?void 0:g>>>0}finally{q.__wbindgen_add_to_stack_pointer(16)}}coParent(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawcolliderset_coParent(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=r()[C/8+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}coSetEnabled(A,I){q.rawcolliderset_coSetEnabled(this.__wbg_ptr,A,I)}coIsEnabled(A){return 0!==q.rawcolliderset_coIsEnabled(this.__wbg_ptr,A)}coSetContactSkin(A,I){q.rawcolliderset_coSetContactSkin(this.__wbg_ptr,A,I)}coContactSkin(A){return q.rawcolliderset_coContactSkin(this.__wbg_ptr,A)}coFriction(A){return q.rawcolliderset_coFriction(this.__wbg_ptr,A)}coRestitution(A){return q.rawcolliderset_coRestitution(this.__wbg_ptr,A)}coDensity(A){return q.rawcolliderset_coDensity(this.__wbg_ptr,A)}coMass(A){return q.rawcolliderset_coMass(this.__wbg_ptr,A)}coVolume(A){return q.rawcolliderset_coVolume(this.__wbg_ptr,A)}coCollisionGroups(A){return q.rawcolliderset_coCollisionGroups(this.__wbg_ptr,A)>>>0}coSolverGroups(A){return q.rawcolliderset_coSolverGroups(this.__wbg_ptr,A)>>>0}coActiveHooks(A){return q.rawcolliderset_coActiveHooks(this.__wbg_ptr,A)>>>0}coActiveCollisionTypes(A){return q.rawcolliderset_coActiveCollisionTypes(this.__wbg_ptr,A)}coActiveEvents(A){return q.rawcolliderset_coActiveEvents(this.__wbg_ptr,A)>>>0}coContactForceEventThreshold(A){return q.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr,A)}coContainsPoint(A,I){return b(I,hI),0!==q.rawcolliderset_coContainsPoint(this.__wbg_ptr,A,I.__wbg_ptr)}coCastShape(A,I,g,C,B,Q,E,i,D){b(I,hI),b(g,DI),b(C,hI),b(B,gI),b(Q,hI);const o=q.rawcolliderset_coCastShape(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C.__wbg_ptr,B.__wbg_ptr,Q.__wbg_ptr,E,i,D);return 0===o?void 0:SI.__wrap(o)}coCastCollider(A,I,g,C,B,Q,E){b(I,hI),b(C,hI);const i=q.rawcolliderset_coCastCollider(this.__wbg_ptr,A,I.__wbg_ptr,g,C.__wbg_ptr,B,Q,E);return 0===i?void 0:SA.__wrap(i)}coIntersectsShape(A,I,g,C){return b(I,DI),b(g,hI),b(C,gI),0!==q.rawcolliderset_coIntersectsShape(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C.__wbg_ptr)}coContactShape(A,I,g,C,B){b(I,DI),b(g,hI),b(C,gI);const Q=q.rawcolliderset_coContactShape(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C.__wbg_ptr,B);return 0===Q?void 0:GI.__wrap(Q)}coContactCollider(A,I,g){const C=q.rawcolliderset_coContactCollider(this.__wbg_ptr,A,I,g);return 0===C?void 0:GI.__wrap(C)}coProjectPoint(A,I,g){b(I,hI);const C=q.rawcolliderset_coProjectPoint(this.__wbg_ptr,A,I.__wbg_ptr,g);return jA.__wrap(C)}coIntersectsRay(A,I,g,C){return b(I,hI),b(g,hI),0!==q.rawcolliderset_coIntersectsRay(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C)}coCastRay(A,I,g,C,B){return b(I,hI),b(g,hI),q.rawcolliderset_coCastRay(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C,B)}coCastRayAndGetNormal(A,I,g,C,B){b(I,hI),b(g,hI);const Q=q.rawcolliderset_coCastRayAndGetNormal(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C,B);return 0===Q?void 0:_A.__wrap(Q)}coSetSensor(A,I){q.rawcolliderset_coSetSensor(this.__wbg_ptr,A,I)}coSetRestitution(A,I){q.rawcolliderset_coSetRestitution(this.__wbg_ptr,A,I)}coSetFriction(A,I){q.rawcolliderset_coSetFriction(this.__wbg_ptr,A,I)}coFrictionCombineRule(A){return q.rawcolliderset_coFrictionCombineRule(this.__wbg_ptr,A)>>>0}coSetFrictionCombineRule(A,I){q.rawcolliderset_coSetFrictionCombineRule(this.__wbg_ptr,A,I)}coRestitutionCombineRule(A){return q.rawcolliderset_coRestitutionCombineRule(this.__wbg_ptr,A)>>>0}coSetRestitutionCombineRule(A,I){q.rawcolliderset_coSetRestitutionCombineRule(this.__wbg_ptr,A,I)}coSetCollisionGroups(A,I){q.rawcolliderset_coSetCollisionGroups(this.__wbg_ptr,A,I)}coSetSolverGroups(A,I){q.rawcolliderset_coSetSolverGroups(this.__wbg_ptr,A,I)}coSetActiveHooks(A,I){q.rawcolliderset_coSetActiveHooks(this.__wbg_ptr,A,I)}coSetActiveEvents(A,I){q.rawcolliderset_coSetActiveEvents(this.__wbg_ptr,A,I)}coSetActiveCollisionTypes(A,I){q.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr,A,I)}coSetShape(A,I){b(I,DI),q.rawcolliderset_coSetShape(this.__wbg_ptr,A,I.__wbg_ptr)}coSetContactForceEventThreshold(A,I){q.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr,A,I)}coSetDensity(A,I){q.rawcolliderset_coSetDensity(this.__wbg_ptr,A,I)}coSetMass(A,I){q.rawcolliderset_coSetMass(this.__wbg_ptr,A,I)}coSetMassProperties(A,I,g,C,B){b(g,hI),b(C,hI),b(B,gI),q.rawcolliderset_coSetMassProperties(this.__wbg_ptr,A,I,g.__wbg_ptr,C.__wbg_ptr,B.__wbg_ptr)}constructor(){const A=q.rawcolliderset_new();return this.__wbg_ptr=A>>>0,this}len(){return q.rawcolliderset_len(this.__wbg_ptr)>>>0}contains(A){return 0!==q.rawcolliderset_contains(this.__wbg_ptr,A)}createCollider(A,I,g,C,B,Q,E,i,D,o,S,w,G,k,h,K,J,U,y,N,a,M,F,s,R){try{const l=q.__wbindgen_add_to_stack_pointer(-16);b(I,DI),b(g,hI),b(C,gI),b(E,hI),b(i,hI),b(D,gI),b(R,AI),q.rawcolliderset_createCollider(l,this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C.__wbg_ptr,B,Q,E.__wbg_ptr,i.__wbg_ptr,D.__wbg_ptr,o,S,w,G,k,h,K,J,U,y,N,a,M,F,s,R.__wbg_ptr);var c=d()[l/4+0],Y=r()[l/8+1];return 0===c?void 0:Y}finally{q.__wbindgen_add_to_stack_pointer(16)}}remove(A,I,g,C){b(I,pA),b(g,AI),q.rawcolliderset_remove(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C)}isHandleValid(A){return 0!==q.rawcolliderset_contains(this.__wbg_ptr,A)}forEachColliderHandle(A){try{q.rawcolliderset_forEachColliderHandle(this.__wbg_ptr,j(A))}finally{Y[m++]=void 0}}}const oA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>q.__wbg_rawcollidershapecasthit_free(A>>>0)));class SA{static __wrap(A){A>>>=0;const I=Object.create(SA.prototype);return I.__wbg_ptr=A,oA.register(I,I.__wbg_ptr,I),I}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,oA.unregister(this),A}free(){const A=this.__destroy_into_raw();q.__wbg_rawcollidershapecasthit_free(A)}colliderHandle(){return q.rawcharactercollision_handle(this.__wbg_ptr)}time_of_impact(){return q.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr)}witness1(){const A=q.rawcollidershapecasthit_witness1(this.__wbg_ptr);return hI.__wrap(A)}witness2(){const A=q.rawcollidershapecasthit_witness2(this.__wbg_ptr);return hI.__wrap(A)}normal1(){const A=q.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);return hI.__wrap(A)}normal2(){const A=q.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);return hI.__wrap(A)}}const wA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>q.__wbg_rawcontactforceevent_free(A>>>0)));class GA{static __wrap(A){A>>>=0;const I=Object.create(GA.prototype);return I.__wbg_ptr=A,wA.register(I,I.__wbg_ptr,I),I}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,wA.unregister(this),A}free(){const A=this.__destroy_into_raw();q.__wbg_rawcontactforceevent_free(A)}collider1(){return q.rawcharactercollision_handle(this.__wbg_ptr)}collider2(){return q.rawcontactforceevent_collider2(this.__wbg_ptr)}total_force(){const A=q.rawcontactforceevent_total_force(this.__wbg_ptr);return hI.__wrap(A)}total_force_magnitude(){return q.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr)}max_force_direction(){const A=q.rawcontactforceevent_max_force_direction(this.__wbg_ptr);return hI.__wrap(A)}max_force_magnitude(){return q.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr)}}const kA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>q.__wbg_rawcontactmanifold_free(A>>>0)));class hA{static __wrap(A){A>>>=0;const I=Object.create(hA.prototype);return I.__wbg_ptr=A,kA.register(I,I.__wbg_ptr,I),I}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,kA.unregister(this),A}free(){const A=this.__destroy_into_raw();q.__wbg_rawcontactmanifold_free(A)}normal(){const A=q.rawcontactmanifold_normal(this.__wbg_ptr);return hI.__wrap(A)}local_n1(){const A=q.rawcontactmanifold_local_n1(this.__wbg_ptr);return hI.__wrap(A)}local_n2(){const A=q.rawcontactmanifold_local_n2(this.__wbg_ptr);return hI.__wrap(A)}subshape1(){return q.rawcontactmanifold_subshape1(this.__wbg_ptr)>>>0}subshape2(){return q.rawcontactmanifold_subshape2(this.__wbg_ptr)>>>0}num_contacts(){return q.rawcontactmanifold_num_contacts(this.__wbg_ptr)>>>0}contact_local_p1(A){const I=q.rawcontactmanifold_contact_local_p1(this.__wbg_ptr,A);return 0===I?void 0:hI.__wrap(I)}contact_local_p2(A){const I=q.rawcontactmanifold_contact_local_p2(this.__wbg_ptr,A);return 0===I?void 0:hI.__wrap(I)}contact_dist(A){return q.rawcontactmanifold_contact_dist(this.__wbg_ptr,A)}contact_fid1(A){return q.rawcontactmanifold_contact_fid1(this.__wbg_ptr,A)>>>0}contact_fid2(A){return q.rawcontactmanifold_contact_fid2(this.__wbg_ptr,A)>>>0}contact_impulse(A){return q.rawcontactmanifold_contact_impulse(this.__wbg_ptr,A)}contact_tangent_impulse_x(A){return q.rawcontactmanifold_contact_tangent_impulse_x(this.__wbg_ptr,A)}contact_tangent_impulse_y(A){return q.rawcontactmanifold_contact_tangent_impulse_y(this.__wbg_ptr,A)}num_solver_contacts(){return q.rawcontactmanifold_num_solver_contacts(this.__wbg_ptr)>>>0}solver_contact_point(A){const I=q.rawcontactmanifold_solver_contact_point(this.__wbg_ptr,A);return 0===I?void 0:hI.__wrap(I)}solver_contact_dist(A){return q.rawcontactmanifold_solver_contact_dist(this.__wbg_ptr,A)}solver_contact_friction(A){return q.rawcontactmanifold_solver_contact_friction(this.__wbg_ptr,A)}solver_contact_restitution(A){return q.rawcontactmanifold_solver_contact_restitution(this.__wbg_ptr,A)}solver_contact_tangent_velocity(A){const I=q.rawcontactmanifold_solver_contact_tangent_velocity(this.__wbg_ptr,A);return hI.__wrap(I)}}const KA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>q.__wbg_rawcontactpair_free(A>>>0)));class JA{static __wrap(A){A>>>=0;const I=Object.create(JA.prototype);return I.__wbg_ptr=A,KA.register(I,I.__wbg_ptr,I),I}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,KA.unregister(this),A}free(){const A=this.__destroy_into_raw();q.__wbg_rawcontactpair_free(A)}collider1(){return q.rawcontactpair_collider1(this.__wbg_ptr)}collider2(){return q.rawcontactpair_collider2(this.__wbg_ptr)}numContactManifolds(){return q.rawcontactpair_numContactManifolds(this.__wbg_ptr)>>>0}contactManifold(A){const I=q.rawcontactpair_contactManifold(this.__wbg_ptr,A);return 0===I?void 0:hA.__wrap(I)}}const UA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>q.__wbg_rawdebugrenderpipeline_free(A>>>0)));class yA{__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,UA.unregister(this),A}free(){const A=this.__destroy_into_raw();q.__wbg_rawdebugrenderpipeline_free(A)}constructor(){const A=q.rawdebugrenderpipeline_new();return this.__wbg_ptr=A>>>0,this}vertices(){return H(q.rawdebugrenderpipeline_vertices(this.__wbg_ptr))}colors(){return H(q.rawdebugrenderpipeline_colors(this.__wbg_ptr))}render(A,I,g,C,B){b(A,AI),b(I,DA),b(g,lA),b(C,dA),b(B,OA),q.rawdebugrenderpipeline_render(this.__wbg_ptr,A.__wbg_ptr,I.__wbg_ptr,g.__wbg_ptr,C.__wbg_ptr,B.__wbg_ptr)}}const NA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>q.__wbg_rawdeserializedworld_free(A>>>0)));class aA{static __wrap(A){A>>>=0;const I=Object.create(aA.prototype);return I.__wbg_ptr=A,NA.register(I,I.__wbg_ptr,I),I}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,NA.unregister(this),A}free(){const A=this.__destroy_into_raw();q.__wbg_rawdeserializedworld_free(A)}takeGravity(){const A=q.rawdeserializedworld_takeGravity(this.__wbg_ptr);return 0===A?void 0:hI.__wrap(A)}takeIntegrationParameters(){const A=q.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr);return 0===A?void 0:tA.__wrap(A)}takeIslandManager(){const A=q.rawdeserializedworld_takeIslandManager(this.__wbg_ptr);return 0===A?void 0:pA.__wrap(A)}takeBroadPhase(){const A=q.rawdeserializedworld_takeBroadPhase(this.__wbg_ptr);return 0===A?void 0:gA.__wrap(A)}takeNarrowPhase(){const A=q.rawdeserializedworld_takeNarrowPhase(this.__wbg_ptr);return 0===A?void 0:OA.__wrap(A)}takeBodies(){const A=q.rawdeserializedworld_takeBodies(this.__wbg_ptr);return 0===A?void 0:AI.__wrap(A)}takeColliders(){const A=q.rawdeserializedworld_takeColliders(this.__wbg_ptr);return 0===A?void 0:DA.__wrap(A)}takeImpulseJoints(){const A=q.rawdeserializedworld_takeImpulseJoints(this.__wbg_ptr);return 0===A?void 0:lA.__wrap(A)}takeMultibodyJoints(){const A=q.rawdeserializedworld_takeMultibodyJoints(this.__wbg_ptr);return 0===A?void 0:dA.__wrap(A)}}const MA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>q.__wbg_rawdynamicraycastvehiclecontroller_free(A>>>0)));class FA{__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,MA.unregister(this),A}free(){const A=this.__destroy_into_raw();q.__wbg_rawdynamicraycastvehiclecontroller_free(A)}constructor(A){const I=q.rawdynamicraycastvehiclecontroller_new(A);return this.__wbg_ptr=I>>>0,this}current_vehicle_speed(){return q.rawdynamicraycastvehiclecontroller_current_vehicle_speed(this.__wbg_ptr)}chassis(){return q.rawdynamicraycastvehiclecontroller_chassis(this.__wbg_ptr)}index_up_axis(){return q.rawdynamicraycastvehiclecontroller_index_up_axis(this.__wbg_ptr)>>>0}set_index_up_axis(A){q.rawdynamicraycastvehiclecontroller_set_index_up_axis(this.__wbg_ptr,A)}index_forward_axis(){return q.rawdynamicraycastvehiclecontroller_index_forward_axis(this.__wbg_ptr)>>>0}set_index_forward_axis(A){q.rawdynamicraycastvehiclecontroller_set_index_forward_axis(this.__wbg_ptr,A)}add_wheel(A,I,g,C,B){b(A,hI),b(I,hI),b(g,hI),q.rawdynamicraycastvehiclecontroller_add_wheel(this.__wbg_ptr,A.__wbg_ptr,I.__wbg_ptr,g.__wbg_ptr,C,B)}num_wheels(){return q.rawdynamicraycastvehiclecontroller_num_wheels(this.__wbg_ptr)>>>0}update_vehicle(A,I,g,C,B,Q,E){try{b(I,AI),b(g,DA),b(C,VA),q.rawdynamicraycastvehiclecontroller_update_vehicle(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C.__wbg_ptr,B,!p(Q),p(Q)?0:Q,j(E))}finally{Y[m++]=void 0}}wheel_chassis_connection_point_cs(A){const I=q.rawdynamicraycastvehiclecontroller_wheel_chassis_connection_point_cs(this.__wbg_ptr,A);return 0===I?void 0:hI.__wrap(I)}set_wheel_chassis_connection_point_cs(A,I){b(I,hI),q.rawdynamicraycastvehiclecontroller_set_wheel_chassis_connection_point_cs(this.__wbg_ptr,A,I.__wbg_ptr)}wheel_suspension_rest_length(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_suspension_rest_length(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_suspension_rest_length(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_suspension_rest_length(this.__wbg_ptr,A,I)}wheel_max_suspension_travel(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_max_suspension_travel(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_max_suspension_travel(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_max_suspension_travel(this.__wbg_ptr,A,I)}wheel_radius(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_radius(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_radius(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_radius(this.__wbg_ptr,A,I)}wheel_suspension_stiffness(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_suspension_stiffness(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_suspension_stiffness(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_suspension_stiffness(this.__wbg_ptr,A,I)}wheel_suspension_compression(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_suspension_compression(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_suspension_compression(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_suspension_compression(this.__wbg_ptr,A,I)}wheel_suspension_relaxation(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_suspension_relaxation(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_suspension_relaxation(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_suspension_relaxation(this.__wbg_ptr,A,I)}wheel_max_suspension_force(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_max_suspension_force(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_max_suspension_force(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_max_suspension_force(this.__wbg_ptr,A,I)}wheel_brake(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_brake(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_brake(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_brake(this.__wbg_ptr,A,I)}wheel_steering(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_steering(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_steering(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_steering(this.__wbg_ptr,A,I)}wheel_engine_force(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_engine_force(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_engine_force(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_engine_force(this.__wbg_ptr,A,I)}wheel_direction_cs(A){const I=q.rawdynamicraycastvehiclecontroller_wheel_direction_cs(this.__wbg_ptr,A);return 0===I?void 0:hI.__wrap(I)}set_wheel_direction_cs(A,I){b(I,hI),q.rawdynamicraycastvehiclecontroller_set_wheel_direction_cs(this.__wbg_ptr,A,I.__wbg_ptr)}wheel_axle_cs(A){const I=q.rawdynamicraycastvehiclecontroller_wheel_axle_cs(this.__wbg_ptr,A);return 0===I?void 0:hI.__wrap(I)}set_wheel_axle_cs(A,I){b(I,hI),q.rawdynamicraycastvehiclecontroller_set_wheel_axle_cs(this.__wbg_ptr,A,I.__wbg_ptr)}wheel_friction_slip(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_friction_slip(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_friction_slip(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_friction_slip(this.__wbg_ptr,A,I)}wheel_side_friction_stiffness(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_side_friction_stiffness(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g}finally{q.__wbindgen_add_to_stack_pointer(16)}}set_wheel_side_friction_stiffness(A,I){q.rawdynamicraycastvehiclecontroller_set_wheel_side_friction_stiffness(this.__wbg_ptr,A,I)}wheel_rotation(A){try{const C=q.__wbindgen_add_to_stack_pointer(-16);q.rawdynamicraycastvehiclecontroller_wheel_rotation(C,this.__wbg_ptr,A);var I=d()[C/4+0],g=W()[C/4+1];return 0===I?void 0:g