UNPKG

phy-engine

Version:

JavaScript 3D Physics for three.js

1 lines 2.26 MB
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:[],point:{},contact:{},velocity:{},stat:{fps:0,delta:0,ms:0}}};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,K=k/180,h=180/k,U=Number.EPSILON,y=.5*k,N={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:h,torad:K,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)),smoothstep:(A,I,g)=>A*(g=-2*(g=N.clamp(g))*g*g+3*g*g)+I*(1-g),remap:(A,I,g,C,B)=>C+(A-I)*(B-C)/(g-I),lerp:(A,I,g)=>(1-g)*A+g*I,damp:(A,I,g,C)=>N.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?h:1),unwrapDeg:A=>A-360*Math.floor((A+180)/360),unwrapRad:A=>Math.atan2(Math.sin(A),Math.cos(A)),nearEquals:(A,I,g=1e-4)=>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=N.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=N.composeMatrixArray(A,I),E=N.composeMatrixArray(g,C);return B&&(Q=N.invertMatrixArray(Q)),Q=N.multiplyMatrixArray(Q,E),[Q[12],Q[13],Q[14]]},fromTransformToQ:(A,I,g=!1)=>{let C=N.composeMatrixArray(A,I),B=N.decomposeFullMatrixArray(C).q;return g&&(B=N.quatInvert(B)),B},lerpTransform:(A,I,g)=>{let C=A[0],B=A[1],Q=I[0],E=I[1];return Q=N.lerpArray(C,Q,g),E=N.slerpQuatArray(B,E,g),[Q,E]},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,K=B*o,h=Q*o,U=E*i,y=E*D,N=E*o,M=g[0],J=g[1],a=g[2];return[(1-(k+h))*M,(w+N)*M,(G-y)*M,0,(w-N)*J,(1-(S+h))*J,(K+U)*J,0,(G+y)*a,(K-U)*a,(1-(S+k))*a,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],K=g[6],h=g[10],U=g[14],y=g[3],N=g[7],M=g[11],J=g[15],a=C[0],F=C[4],s=C[8],R=C[12],q=C[1],c=C[5],Y=C[9],L=C[13],l=C[2],t=C[6],H=C[10],r=C[14],p=C[3],e=C[7],n=C[11],T=C[15];return B[0]=Q*a+E*q+i*l+D*p,B[4]=Q*F+E*c+i*t+D*e,B[8]=Q*s+E*Y+i*H+D*n,B[12]=Q*R+E*L+i*r+D*T,B[1]=o*a+S*q+w*l+G*p,B[5]=o*F+S*c+w*t+G*e,B[9]=o*s+S*Y+w*H+G*n,B[13]=o*R+S*L+w*r+G*T,B[2]=k*a+K*q+h*l+U*p,B[6]=k*F+K*c+h*t+U*e,B[10]=k*s+K*Y+h*H+U*n,B[14]=k*R+K*L+h*r+U*T,B[3]=y*a+N*q+M*l+J*p,B[7]=y*F+N*c+M*t+J*e,B[11]=y*s+N*Y+M*H+J*n,B[15]=y*R+N*L+M*r+J*T,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],K=I[12],h=I[13],U=I[14],y=I[15],N=w*U*o-h*G*o+h*D*k-i*U*k-w*D*y+i*G*y,M=K*G*o-S*U*o-K*D*k+E*U*k+S*D*y-E*G*y,J=S*h*o-K*w*o+K*i*k-E*h*k-S*i*y+E*w*y,a=K*w*D-S*h*D-K*i*G+E*h*G+S*i*U-E*w*U,F=g*N+C*M+B*J+Q*a;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]=N*s,I[1]=(h*G*Q-w*U*Q-h*B*k+C*U*k+w*B*y-C*G*y)*s,I[2]=(i*U*Q-h*D*Q+h*B*o-C*U*o-i*B*y+C*D*y)*s,I[3]=(w*D*Q-i*G*Q-w*B*o+C*G*o+i*B*k-C*D*k)*s,I[4]=M*s,I[5]=(S*U*Q-K*G*Q+K*B*k-g*U*k-S*B*y+g*G*y)*s,I[6]=(K*D*Q-E*U*Q-K*B*o+g*U*o+E*B*y-g*D*y)*s,I[7]=(E*G*Q-S*D*Q+S*B*o-g*G*o-E*B*k+g*D*k)*s,I[8]=J*s,I[9]=(K*w*Q-S*h*Q-K*C*k+g*h*k+S*C*y-g*w*y)*s,I[10]=(E*h*Q-K*i*Q+K*C*o-g*h*o-E*C*y+g*i*y)*s,I[11]=(S*i*Q-E*w*Q-S*C*o+g*w*o+E*C*k-g*i*k)*s,I[12]=a*s,I[13]=(S*h*B-K*w*B+K*C*G-g*h*G-S*C*U+g*w*U)*s,I[14]=(K*i*B-E*h*B-K*C*D+g*h*D+E*C*U-g*i*U)*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=N.lengthArray([I[0],I[1],I[2]]);const C=N.lengthArray([I[4],I[5],I[6]]),B=N.lengthArray([I[8],I[9],I[10]]);N.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=N.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=N.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<=U){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],N.quatNomalize(C)}const K=Math.sqrt(k),h=Math.atan2(K,G),y=Math.sin((1-g)*h)/K,M=Math.sin(g*h)/K;return C[3]=i*y+C[3]*M,C[0]=B*y+C[0]*M,C[1]=Q*y+C[1]*M,C[2]=E*y+C[2]*M,C},toLocalQuatArray:(A=[0,0,0],I)=>{let g=N.quatFromEuler(A),C=N.quatInvert(I.quaternion.toArray());return N.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?K: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?K:1),B=Math.sin(C);return[A[0]*B,A[1]*B,A[2]*B,Math.cos(C)]},quatNomalize:A=>{let I=N.lengthArray(A);return 0===I?[0,0,0,1]:(I=1/I,N.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(N.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(N.clamp(N.dotArray(A,I),-1,1))),fixedArray:(A,I)=>{let g=A.length,C=[];for(;g--;)C[g]=N.toFixed(A[g],I);return C},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>y?g-=y:g+=y;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)=>N.mulArray(A,1/I,g),scaleArray:(A,I,g)=>N.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])=>N.lengthArray(N.subArray(A,I)),normalizeArray:A=>N.divArray(A,N.lengthArray(A)||1),normalArray:(A,I=[0,0,0])=>N.normalizeArray(N.subArray(I,A)),getCenter:(A,I)=>(A.computeBoundingBox(),A.boundingBox.getCenter(I)),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=N.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,getSameVertex:A=>{const I=A.getAttribute("position"),g=I.array,C=[],B=[],Q={};new THREE.Vector3;let E,i=0;N.getHash(A);let D,o,S=!1,w=0;for(let A=0;A<I.count;A++){i=3*A,D={x:g[i],y:g[i+1],z:g[i+2],id:A},S=!1,E=C.length;for(let I=0;I<E;I++)o=C[I],D.x===o.x&&D.y===o.y&&D.z===o.z&&(S=!0,Q[A]=o.id);S||(D.id=w++,C.push(D),B.push([D.x,D.y,D.z]))}return[B,Q]},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},getConnectedFaces:A=>{const I=[];let g,C,B,Q,E,i,D,o=A.length,S=o;for(;S--;)for(C=A[S],g=o;g--;)g!==S&&(B=A[g],Q=C.filter((A=>B.includes(A))),Q.length>1&&(D=[],E=[...C],i=E.indexOf(Q[0]),E.splice(i,1),i=E.indexOf(Q[1]),E.splice(i,1),D.push(E[0]),E=[...B],i=E.indexOf(Q[0]),E.splice(i,1),i=E.indexOf(Q[1]),E.splice(i,1),D.push(E[0]),I.push(D)));return I},reduce:A=>{},barycentric:(A,I)=>{},solve:(A,I)=>{},getHash:(A,I=1e-4)=>{I=Math.max(I,Number.EPSILON);const g={},C={},B=A.getAttribute("position"),Q=B.count,E=B.array,i=.5*I,D=Math.log10(1/I),o=Math.pow(10,D),S=i*o;let w;for(let A=0;A<Q;A++){w=3*A;let I=`${~~(E[w]*o+S)},${~~(E[w+1]*o+S)},${~~(E[w+2]*o+S)}`;g[I]?g[I].push(A):g[I]=[A]}let G=0;for(let A in g)C[G++]=g[A];return C}},M=N;class J 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=M.distanceArray(Q[0],Q[1]),A[B+1]=D,this.v2.fromArray(M.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]=M.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 a(A);this.addToWorld(I,A.id)}set(A={},I=null){}}class a{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.noRotation=A.noRotation||!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=this.noRotation?[0,0,0,1]:[g.x,g.y,g.z,g.w];return[M.applyTransformArray(this.begin,C,B),M.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=M.densityFromMass(A.mass,M.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=M.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:K;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 q(A);this.addToWorld(I,A.id)}}class q{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 c;const Y=new Array(128).fill(void 0);function L(A){return Y[A]}Y.push(void 0,null,!0,!1);let l=Y.length;function t(A){l===Y.length&&Y.push(Y.length+1);const I=l;return l=Y[I],Y[I]=A,I}function H(A,I){try{return A.apply(this,I)}catch(A){c.__wbindgen_export_0(t(A))}}function r(A){return null==A}let p=null;function e(){return(null===p||!0===p.buffer.detached||void 0===p.buffer.detached&&p.buffer!==c.memory.buffer)&&(p=new DataView(c.memory.buffer)),p}function n(A){const I=L(A);return(g=A)<132||(Y[g]=l,l=g),I;var g}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 d(A,I){return A>>>=0,T.decode((null!==O&&0!==O.byteLength||(O=new Uint8Array(c.memory.buffer)),O).subarray(A,A+I))}function Z(A,I){if(!(A instanceof I))throw new Error(`expected instance of ${I.name}`)}let b=128;function x(A){if(1==b)throw new Error("out of js stack");return Y[--b]=A,b}let W=null;let j=null;function m(){return null!==j&&0!==j.byteLength||(j=new Float32Array(c.memory.buffer)),j}function f(A,I){return A>>>=0,m().subarray(A/4,A/4+I)}let X=null;function V(){return null!==X&&0!==X.byteLength||(X=new Uint32Array(c.memory.buffer)),X}let u=0;function P(A,I){const g=I(4*A.length,4)>>>0;return V().set(A,g/4),u=A.length,g}function z(A,I){const g=I(4*A.length,4)>>>0;return m().set(A,g/4),u=A.length,g}const v=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"}),$=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",Voxels:18,18:"Voxels"}),AA=Object.freeze({PseudoBall:0,0:"PseudoBall",PseudoCube:1,1:"PseudoCube"}),IA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>c.__wbg_rawbroadphase_free(A>>>0,1)));let gA=class A{static __wrap(I){I>>>=0;const g=Object.create(A.prototype);return g.__wbg_ptr=I,IA.register(g,g.__wbg_ptr,g),g}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,IA.unregister(this),A}free(){const A=this.__destroy_into_raw();c.__wbg_rawbroadphase_free(A,0)}constructor(){const A=c.rawbroadphase_new();return this.__wbg_ptr=A>>>0,IA.register(this,this.__wbg_ptr,this),this}};const CA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>c.__wbg_rawccdsolver_free(A>>>0,1)));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();c.__wbg_rawccdsolver_free(A,0)}constructor(){const A=c.rawccdsolver_new();return this.__wbg_ptr=A>>>0,CA.register(this,this.__wbg_ptr,this),this}}const QA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>c.__wbg_rawcharactercollision_free(A>>>0,1)));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();c.__wbg_rawcharactercollision_free(A,0)}constructor(){const A=c.rawcharactercollision_new();return this.__wbg_ptr=A>>>0,QA.register(this,this.__wbg_ptr,this),this}handle(){return c.rawcharactercollision_handle(this.__wbg_ptr)}translationDeltaApplied(){const A=c.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);return UI.__wrap(A)}translationDeltaRemaining(){const A=c.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);return UI.__wrap(A)}toi(){return c.rawcharactercollision_toi(this.__wbg_ptr)}worldWitness1(){const A=c.rawcharactercollision_worldWitness1(this.__wbg_ptr);return UI.__wrap(A)}worldWitness2(){const A=c.rawcharactercollision_worldWitness2(this.__wbg_ptr);return UI.__wrap(A)}worldNormal1(){const A=c.rawcharactercollision_worldNormal1(this.__wbg_ptr);return UI.__wrap(A)}worldNormal2(){const A=c.rawcharactercollision_worldNormal2(this.__wbg_ptr);return UI.__wrap(A)}}const iA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>c.__wbg_rawcolliderset_free(A>>>0,1)));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();c.__wbg_rawcolliderset_free(A,0)}coTranslation(A){const I=c.rawcolliderset_coTranslation(this.__wbg_ptr,A);return UI.__wrap(I)}coRotation(A){const I=c.rawcolliderset_coRotation(this.__wbg_ptr,A);return BI.__wrap(I)}coSetTranslation(A,I,g,C){c.rawcolliderset_coSetTranslation(this.__wbg_ptr,A,I,g,C)}coSetTranslationWrtParent(A,I,g,C){c.rawcolliderset_coSetTranslationWrtParent(this.__wbg_ptr,A,I,g,C)}coSetRotation(A,I,g,C,B){c.rawcolliderset_coSetRotation(this.__wbg_ptr,A,I,g,C,B)}coSetRotationWrtParent(A,I,g,C,B){c.rawcolliderset_coSetRotationWrtParent(this.__wbg_ptr,A,I,g,C,B)}coIsSensor(A){return 0!==c.rawcolliderset_coIsSensor(this.__wbg_ptr,A)}coShapeType(A){return c.rawcolliderset_coShapeType(this.__wbg_ptr,A)}coHalfspaceNormal(A){const I=c.rawcolliderset_coHalfspaceNormal(this.__wbg_ptr,A);return 0===I?void 0:UI.__wrap(I)}coHalfExtents(A){const I=c.rawcolliderset_coHalfExtents(this.__wbg_ptr,A);return 0===I?void 0:UI.__wrap(I)}coSetHalfExtents(A,I){Z(I,UI),c.rawcolliderset_coSetHalfExtents(this.__wbg_ptr,A,I.__wbg_ptr)}coRadius(A){const I=c.rawcolliderset_coRadius(this.__wbg_ptr,A);return 4294967297===I?void 0:I}coSetRadius(A,I){c.rawcolliderset_coSetRadius(this.__wbg_ptr,A,I)}coHalfHeight(A){const I=c.rawcolliderset_coHalfHeight(this.__wbg_ptr,A);return 4294967297===I?void 0:I}coSetHalfHeight(A,I){c.rawcolliderset_coSetHalfHeight(this.__wbg_ptr,A,I)}coRoundRadius(A){const I=c.rawcolliderset_coRoundRadius(this.__wbg_ptr,A);return 4294967297===I?void 0:I}coSetRoundRadius(A,I){c.rawcolliderset_coSetRoundRadius(this.__wbg_ptr,A,I)}coVoxelData(A){try{const C=c.__wbindgen_add_to_stack_pointer(-16);c.rawcolliderset_coVoxelData(C,this.__wbg_ptr,A);var I=e().getInt32(C+0,!0),g=e().getInt32(C+4,!0);let B;return 0!==I&&(B=function(A,I){return A>>>=0,(null!==W&&0!==W.byteLength||(W=new Int32Array(c.memory.buffer)),W).subarray(A/4,A/4+I)}(I,g).slice(),c.__wbindgen_export_1(I,4*g,4)),B}finally{c.__wbindgen_add_to_stack_pointer(16)}}coVoxelPrimitiveGeometry(A){const I=c.rawcolliderset_coVoxelPrimitiveGeometry(this.__wbg_ptr,A);return 2===I?void 0:I}coVoxelSize(A){const I=c.rawcolliderset_coVoxelSize(this.__wbg_ptr,A);return 0===I?void 0:UI.__wrap(I)}coSetVoxel(A,I,g,C,B){c.rawcolliderset_coSetVoxel(this.__wbg_ptr,A,I,g,C,B)}coVertices(A){try{const C=c.__wbindgen_add_to_stack_pointer(-16);c.rawcolliderset_coVertices(C,this.__wbg_ptr,A);var I=e().getInt32(C+0,!0),g=e().getInt32(C+4,!0);let B;return 0!==I&&(B=f(I,g).slice(),c.__wbindgen_export_1(I,4*g,4)),B}finally{c.__wbindgen_add_to_stack_pointer(16)}}coIndices(A){try{const Q=c.__wbindgen_add_to_stack_pointer(-16);c.rawcolliderset_coIndices(Q,this.__wbg_ptr,A);var I=e().getInt32(Q+0,!0),g=e().getInt32(Q+4,!0);let E;return 0!==I&&(E=(C=I,B=g,C>>>=0,V().subarray(C/4,C/4+B)).slice(),c.__wbindgen_export_1(I,4*g,4)),E}finally{c.__wbindgen_add_to_stack_pointer(16)}var C,B}coTriMeshFlags(A){const I=c.rawcolliderset_coTriMeshFlags(this.__wbg_ptr,A);return 4294967297===I?void 0:I}coHeightFieldFlags(A){const I=c.rawcolliderset_coHeightFieldFlags(this.__wbg_ptr,A);return 4294967297===I?void 0:I}coHeightfieldHeights(A){try{const C=c.__wbindgen_add_to_stack_pointer(-16);c.rawcolliderset_coHeightfieldHeights(C,this.__wbg_ptr,A);var I=e().getInt32(C+0,!0),g=e().getInt32(C+4,!0);let B;return 0!==I&&(B=f(I,g).slice(),c.__wbindgen_export_1(I,4*g,4)),B}finally{c.__wbindgen_add_to_stack_pointer(16)}}coHeightfieldScale(A){const I=c.rawcolliderset_coHeightfieldScale(this.__wbg_ptr,A);return 0===I?void 0:UI.__wrap(I)}coHeightfieldNRows(A){const I=c.rawcolliderset_coHeightfieldNRows(this.__wbg_ptr,A);return 4294967297===I?void 0:I}coHeightfieldNCols(A){const I=c.rawcolliderset_coHeightfieldNCols(this.__wbg_ptr,A);return 4294967297===I?void 0:I}coParent(A){try{const C=c.__wbindgen_add_to_stack_pointer(-16);c.rawcolliderset_coParent(C,this.__wbg_ptr,A);var I=e().getInt32(C+0,!0),g=e().getFloat64(C+8,!0);return 0===I?void 0:g}finally{c.__wbindgen_add_to_stack_pointer(16)}}coSetEnabled(A,I){c.rawcolliderset_coSetEnabled(this.__wbg_ptr,A,I)}coIsEnabled(A){return 0!==c.rawcolliderset_coIsEnabled(this.__wbg_ptr,A)}coSetContactSkin(A,I){c.rawcolliderset_coSetContactSkin(this.__wbg_ptr,A,I)}coContactSkin(A){return c.rawcolliderset_coContactSkin(this.__wbg_ptr,A)}coFriction(A){return c.rawcolliderset_coFriction(this.__wbg_ptr,A)}coRestitution(A){return c.rawcolliderset_coRestitution(this.__wbg_ptr,A)}coDensity(A){return c.rawcolliderset_coDensity(this.__wbg_ptr,A)}coMass(A){return c.rawcolliderset_coMass(this.__wbg_ptr,A)}coVolume(A){return c.rawcolliderset_coVolume(this.__wbg_ptr,A)}coCollisionGroups(A){return c.rawcolliderset_coCollisionGroups(this.__wbg_ptr,A)>>>0}coSolverGroups(A){return c.rawcolliderset_coSolverGroups(this.__wbg_ptr,A)>>>0}coActiveHooks(A){return c.rawcolliderset_coActiveHooks(this.__wbg_ptr,A)>>>0}coActiveCollisionTypes(A){return c.rawcolliderset_coActiveCollisionTypes(this.__wbg_ptr,A)}coActiveEvents(A){return c.rawcolliderset_coActiveEvents(this.__wbg_ptr,A)>>>0}coContactForceEventThreshold(A){return c.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr,A)}coContainsPoint(A,I){return Z(I,UI),0!==c.rawcolliderset_coContainsPoint(this.__wbg_ptr,A,I.__wbg_ptr)}coCastShape(A,I,g,C,B,Q,E,i,D){Z(I,UI),Z(g,SI),Z(C,UI),Z(B,BI),Z(Q,UI);const o=c.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:GI.__wrap(o)}coCastCollider(A,I,g,C,B,Q,E){Z(I,UI),Z(C,UI);const i=c.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 Z(I,SI),Z(g,UI),Z(C,BI),0!==c.rawcolliderset_coIntersectsShape(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C.__wbg_ptr)}coContactShape(A,I,g,C,B){Z(I,SI),Z(g,UI),Z(C,BI);const Q=c.rawcolliderset_coContactShape(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C.__wbg_ptr,B);return 0===Q?void 0:KI.__wrap(Q)}coContactCollider(A,I,g){const C=c.rawcolliderset_coContactCollider(this.__wbg_ptr,A,I,g);return 0===C?void 0:KI.__wrap(C)}coProjectPoint(A,I,g){Z(I,UI);const C=c.rawcolliderset_coProjectPoint(this.__wbg_ptr,A,I.__wbg_ptr,g);return XA.__wrap(C)}coIntersectsRay(A,I,g,C){return Z(I,UI),Z(g,UI),0!==c.rawcolliderset_coIntersectsRay(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C)}coCastRay(A,I,g,C,B){return Z(I,UI),Z(g,UI),c.rawcolliderset_coCastRay(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C,B)}coCastRayAndGetNormal(A,I,g,C,B){Z(I,UI),Z(g,UI);const Q=c.rawcolliderset_coCastRayAndGetNormal(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C,B);return 0===Q?void 0:AI.__wrap(Q)}coSetSensor(A,I){c.rawcolliderset_coSetSensor(this.__wbg_ptr,A,I)}coSetRestitution(A,I){c.rawcolliderset_coSetRestitution(this.__wbg_ptr,A,I)}coSetFriction(A,I){c.rawcolliderset_coSetFriction(this.__wbg_ptr,A,I)}coFrictionCombineRule(A){return c.rawcolliderset_coFrictionCombineRule(this.__wbg_ptr,A)>>>0}coSetFrictionCombineRule(A,I){c.rawcolliderset_coSetFrictionCombineRule(this.__wbg_ptr,A,I)}coRestitutionCombineRule(A){return c.rawcolliderset_coRestitutionCombineRule(this.__wbg_ptr,A)>>>0}coSetRestitutionCombineRule(A,I){c.rawcolliderset_coSetRestitutionCombineRule(this.__wbg_ptr,A,I)}coSetCollisionGroups(A,I){c.rawcolliderset_coSetCollisionGroups(this.__wbg_ptr,A,I)}coSetSolverGroups(A,I){c.rawcolliderset_coSetSolverGroups(this.__wbg_ptr,A,I)}coSetActiveHooks(A,I){c.rawcolliderset_coSetActiveHooks(this.__wbg_ptr,A,I)}coSetActiveEvents(A,I){c.rawcolliderset_coSetActiveEvents(this.__wbg_ptr,A,I)}coSetActiveCollisionTypes(A,I){c.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr,A,I)}coSetShape(A,I){Z(I,SI),c.rawcolliderset_coSetShape(this.__wbg_ptr,A,I.__wbg_ptr)}coSetContactForceEventThreshold(A,I){c.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr,A,I)}coSetDensity(A,I){c.rawcolliderset_coSetDensity(this.__wbg_ptr,A,I)}coSetMass(A,I){c.rawcolliderset_coSetMass(this.__wbg_ptr,A,I)}coSetMassProperties(A,I,g,C,B){Z(g,UI),Z(C,UI),Z(B,BI),c.rawcolliderset_coSetMassProperties(this.__wbg_ptr,A,I,g.__wbg_ptr,C.__wbg_ptr,B.__wbg_ptr)}constructor(){const A=c.rawcolliderset_new();return this.__wbg_ptr=A>>>0,iA.register(this,this.__wbg_ptr,this),this}len(){return c.rawcolliderset_len(this.__wbg_ptr)>>>0}contains(A){return 0!==c.rawcolliderset_contains(this.__wbg_ptr,A)}createCollider(A,I,g,C,B,Q,E,i,D,o,S,w,G,k,K,h,U,y,N,M,J,a,F,s,R){try{const L=c.__wbindgen_add_to_stack_pointer(-16);Z(I,SI),Z(g,UI),Z(C,BI),Z(E,UI),Z(i,UI),Z(D,BI),Z(R,gI),c.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,K,h,U,y,N,M,J,a,F,s,R.__wbg_ptr);var q=e().getInt32(L+0,!0),Y=e().getFloat64(L+8,!0);return 0===q?void 0:Y}finally{c.__wbindgen_add_to_stack_pointer(16)}}remove(A,I,g,C){Z(I,rA),Z(g,gI),c.rawcolliderset_remove(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C)}isHandleValid(A){return 0!==c.rawcolliderset_contains(this.__wbg_ptr,A)}forEachColliderHandle(A){try{c.rawcolliderset_forEachColliderHandle(this.__wbg_ptr,x(A))}finally{Y[b++]=void 0}}}const oA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>c.__wbg_rawcollidershapecasthit_free(A>>>0,1)));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();c.__wbg_rawcollidershapecasthit_free(A,0)}colliderHandle(){return c.rawcharactercollision_handle(this.__wbg_ptr)}time_of_impact(){return c.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr)}witness1(){const A=c.rawcollidershapecasthit_witness1(this.__wbg_ptr);return UI.__wrap(A)}witness2(){const A=c.rawcollidershapecasthit_witness2(this.__wbg_ptr);return UI.__wrap(A)}normal1(){const A=c.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);return UI.__wrap(A)}normal2(){const A=c.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);return UI.__wrap(A)}}const wA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>c.__wbg_rawcontactforceevent_free(A>>>0,1)));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();c.__wbg_rawcontactforceevent_free(A,0)}collider1(){return c.rawcharactercollision_handle(this.__wbg_ptr)}collider2(){return c.rawcontactforceevent_collider2(this.__wbg_ptr)}total_force(){const A=c.rawcontactforceevent_total_force(this.__wbg_ptr);return UI.__wrap(A)}total_force_magnitude(){return c.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr)}max_force_direction(){const A=c.rawcontactforceevent_max_force_direction(this.__wbg_ptr);return UI.__wrap(A)}max_force_magnitude(){return c.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr)}}const kA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>c.__wbg_rawcontactmanifold_free(A>>>0,1)));class KA{static __wrap(A){A>>>=0;const I=Object.create(KA.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();c.__wbg_rawcontactmanifold_free(A,0)}normal(){const A=c.rawcontactmanifold_normal(this.__wbg_ptr);return UI.__wrap(A)}local_n1(){const A=c.rawcontactmanifold_local_n1(this.__wbg_ptr);return UI.__wrap(A)}local_n2(){const A=c.rawcontactmanifold_local_n2(this.__wbg_ptr);return UI.__wrap(A)}subshape1(){return c.rawcontactmanifold_subshape1(this.__wbg_ptr)>>>0}subshape2(){return c.rawcontactmanifold_subshape2(this.__wbg_ptr)>>>0}num_contacts(){return c.rawcontactmanifold_num_contacts(this.__wbg_ptr)>>>0}contact_local_p1(A){const I=c.rawcontactmanifold_contact_local_p1(this.__wbg_ptr,A);return 0===I?void 0:UI.__wrap(I)}contact_local_p2(A){const I=c.rawcontactmanifold_contact_local_p2(this.__wbg_ptr,A);return 0===I?void 0:UI.__wrap(I)}contact_dist(A){return c.rawcontactmanifold_contact_dist(this.__wbg_ptr,A)}contact_fid1(A){return c.rawcontactmanifold_contact_fid1(this.__wbg_ptr,A)>>>0}contact_fid2(A){return c.rawcontactmanifold_contact_fid2(this.__wbg_ptr,A)>>>0}contact_impulse(A){return c.rawcontactmanifold_contact_impulse(this.__wbg_ptr,A)}contact_tangent_impulse_x(A){return c.rawcontactmanifold_contact_tangent_impulse_x(this.__wbg_ptr,A)}contact_tangent_impulse_y(A){return c.rawcontactmanifold_contact_tangent_impulse_y(this.__wbg_ptr,A)}num_solver_contacts(){return c.rawcontactmanifold_num_solver_contacts(this.__wbg_ptr)>>>0}solver_contact_point(A){const I=c.rawcontactmanifold_solver_contact_point(this.__wbg_ptr,A);return 0===I?void 0:UI.__wrap(I)}solver_contact_dist(A){return c.rawcontactmanifold_solver_contact_dist(this.__wbg_ptr,A)}solver_contact_friction(A){return c.rawcontactmanifold_solver_contact_friction(this.__wbg_ptr,A)}solver_contact_restitution(A){return c.rawcontactmanifold_solver_contact_restitution(this.__wbg_ptr,A)}solver_contact_tangent_velocity(A){const I=c.rawcontactmanifold_solver_contact_tangent_velocity(this.__wbg_ptr,A);return UI.__wrap(I)}}const hA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>c.__wbg_rawcontactpair_free(A>>>0,1)));class UA{static __wrap(A){A>>>=0;const I=Object.create(UA.prototype);return I.__wbg_ptr=A,hA.register(I,I.__wbg_ptr,I),I}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,hA.unregister(this),A}free(){const A=this.__destroy_into_raw();c.__wbg_rawcontactpair_free(A,0)}collider1(){return c.rawcontactpair_collider1(this.__wbg_ptr)}collider2(){return c.rawcontactpair_collider2(this.__wbg_ptr)}numContactManifolds(){return c.rawcontactpair_numContactManifolds(this.__wbg_ptr)>>>0}contactManifold(A){const I=c.rawcontactpair_contactManifold(this.__wbg_ptr,A);return 0===I?void 0:KA.__wrap(I)}}const yA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>c.__wbg_rawdebugrenderpipeline_free(A>>>0,1)));class NA{__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,yA.unregister(this),A}free(){const A=this.__destroy_into_raw();c.__wbg_rawdebugrenderpipeline_free(A,0)}constructor(){const A=c.rawdebugrenderpipeline_new();return this.__wbg_ptr=A>>>0,yA.register(this,this.__wbg_ptr,this),this}vertices(){return n(c.rawdebugrenderpipeline_vertices(this.__wbg_ptr))}colors(){return n(c.rawdebugrenderpipeline_colors(this.__wbg_ptr))}render(A,I,g,C,B){Z(A,gI),Z(I,DA),Z(g,LA),Z(C,TA),Z(B,dA),c.rawdebugrenderpipeline_render(this.__wbg_ptr,A.__wbg_ptr,I.__wbg_ptr,g.__wbg_ptr,C.__wbg_ptr,B.__wbg_ptr)}}const MA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>c.__wbg_rawdeserializedworld_free(A>>>0,1)));class JA{static __wrap(A){A>>>=0;const I=Object.create(JA.prototype);return I.__wbg_ptr=A,MA.register(I,I.__wbg_ptr,I),I}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,MA.unregister(this),A}free(){const A=this.__destroy_into_raw();c.__wbg_rawdeserializedworld_free(A,0)}takeGravity(){const A=c.rawdeserializedworld_takeGravity(this.__wbg_ptr);return 0===A?void 0:UI.__wrap(A)}takeIntegrationParameters(){const A=c.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr);return 0===A?void 0:tA.__wrap(A)}takeIslandManager(){const A=c.rawdeserializedworld_takeIslandManager(this.__wbg_ptr);return 0===A?void 0:rA.__wrap(A)}takeBroadPhase(){const A=c.rawdeserializedworld_takeBroadPhase(this.__wbg_ptr);return 0===A?void 0:gA.__wrap(A)}takeNarrowPhase(){const A=c.rawdeserializedworld_takeNarrowPhase(this.__wbg_ptr);return 0===A?void 0:dA.__wrap(A)}takeBodies(){const A=c.rawdeserializedworld_takeBodies(this.__wbg_ptr);return 0===A?void 0:gI.__wrap(A)}takeColliders(){const A=c.rawdeserializedworld_takeColliders(this.__wbg_ptr);return 0===A?void 0:DA.__wrap(A)}takeImpulseJoints(){const A=c.rawdeserializedworld_takeImpulseJoints(this.__wbg_ptr);return 0===A?void 0:LA.__wrap(A)}takeMultibodyJoints(){const A=c.rawdeserializedworld_takeMultibodyJoints(this.__wbg_ptr);return 0===A?void 0:TA.__wrap(A)}}const aA="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((A=>c.__wbg_rawdynamicraycastvehiclecontroller_free(A>>>0,1)));class FA{__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,aA.unregister(this),A}free(){const A=this.__destroy_into_raw();c.__wbg_rawdynamicraycastvehiclecontroller_free(A,0)}constructor(A){const I=c.rawdynamicraycastvehiclecontroller_new(A);return this.__wbg_ptr=I>>>0,aA.register(this,this.__wbg_ptr,this),this}current_vehicle_speed(){return c.rawdynamicraycastvehiclecontroller_current_vehicle_speed(this.__wbg_ptr)}chassis(){return c.rawdynamicraycastvehiclecontroller_chassis(this.__wbg_ptr)}index_up_axis(){return c.rawdynamicraycastvehiclecontroller_index_up_axis(this.__wbg_ptr)>>>0}set_index_up_axis(A){c.rawdynamicraycastvehiclecontroller_set_index_up_axis(this.__wbg_ptr,A)}index_forward_axis(){return c.rawdynamicraycastvehiclecontroller_index_forward_axis(this.__wbg_ptr)>>>0}set_index_forward_axis(A){c.rawdynamicraycastvehiclecontroller_set_index_forward_axis(this.__wbg_ptr,A)}add_wheel(A,I,g,C,B){Z(A,UI),Z(I,UI),Z(g,UI),c.rawdynamicraycastvehiclecontroller_add_wheel(this.__wbg_ptr,A.__wbg_ptr,I.__wbg_ptr,g.__wbg_ptr,C,B)}num_wheels(){return c.rawdynamicraycastvehiclecontroller_num_wheels(this.__wbg_ptr)>>>0}update_vehicle(A,I,g,C,B,Q,E){try{Z(I,gI),Z(g,DA),Z(C,uA),c.rawdynamicraycastvehiclecontroller_update_vehicle(this.__wbg_ptr,A,I.__wbg_ptr,g.__wbg_ptr,C.__wbg_ptr,B,r(Q)?4294967297:Q>>>0,x(E))}finally{Y[b++]=void 0}}wheel_chassis_connection_point_cs(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_chassis_connection_point_cs(this.__wbg_ptr,A);return 0===I?void 0:UI.__wrap(I)}set_wheel_chassis_connection_point_cs(A,I){Z(I,UI),c.rawdynamicraycastvehiclecontroller_set_wheel_chassis_connection_point_cs(this.__wbg_ptr,A,I.__wbg_ptr)}wheel_suspension_rest_length(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_suspension_rest_length(this.__wbg_ptr,A);return 4294967297===I?void 0:I}set_wheel_suspension_rest_length(A,I){c.rawdynamicraycastvehiclecontroller_set_wheel_suspension_rest_length(this.__wbg_ptr,A,I)}wheel_max_suspension_travel(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_max_suspension_travel(this.__wbg_ptr,A);return 4294967297===I?void 0:I}set_wheel_max_suspension_travel(A,I){c.rawdynamicraycastvehiclecontroller_set_wheel_max_suspension_travel(this.__wbg_ptr,A,I)}wheel_radius(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_radius(this.__wbg_ptr,A);return 4294967297===I?void 0:I}set_wheel_radius(A,I){c.rawdynamicraycastvehiclecontroller_set_wheel_radius(this.__wbg_ptr,A,I)}wheel_suspension_stiffness(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_suspension_stiffness(this.__wbg_ptr,A);return 4294967297===I?void 0:I}set_wheel_suspension_stiffness(A,I){c.rawdynamicraycastvehiclecontroller_set_wheel_suspension_stiffness(this.__wbg_ptr,A,I)}wheel_suspension_compression(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_suspension_compression(this.__wbg_ptr,A);return 4294967297===I?void 0:I}set_wheel_suspension_compression(A,I){c.rawdynamicraycastvehiclecontroller_set_wheel_suspension_compression(this.__wbg_ptr,A,I)}wheel_suspension_relaxation(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_suspension_relaxation(this.__wbg_ptr,A);return 4294967297===I?void 0:I}set_wheel_suspension_relaxation(A,I){c.rawdynamicraycastvehiclecontroller_set_wheel_suspension_relaxation(this.__wbg_ptr,A,I)}wheel_max_suspension_force(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_max_suspension_force(this.__wbg_ptr,A);return 4294967297===I?void 0:I}set_wheel_max_suspension_force(A,I){c.rawdynamicraycastvehiclecontroller_set_wheel_max_suspension_force(this.__wbg_ptr,A,I)}wheel_brake(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_brake(this.__wbg_ptr,A);return 4294967297===I?void 0:I}set_wheel_brake(A,I){c.rawdynamicraycastvehiclecontroller_set_wheel_brake(this.__wbg_ptr,A,I)}wheel_steering(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_steering(this.__wbg_ptr,A);return 4294967297===I?void 0:I}set_wheel_steering(A,I){c.rawdynamicraycastvehiclecontroller_set_wheel_steering(this.__wbg_ptr,A,I)}wheel_engine_force(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_engine_force(this.__wbg_ptr,A);return 4294967297===I?void 0:I}set_wheel_engine_force(A,I){c.rawdynamicraycastvehiclecontroller_set_wheel_engine_force(this.__wbg_ptr,A,I)}wheel_direction_cs(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_direction_cs(this.__wbg_ptr,A);return 0===I?void 0:UI.__wrap(I)}set_wheel_direction_cs(A,I){Z(I,UI),c.rawdynamicraycastvehiclecontroller_set_wheel_direction_cs(this.__wbg_ptr,A,I.__wbg_ptr)}wheel_axle_cs(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_axle_cs(this.__wbg_ptr,A);return 0===I?void 0:UI.__wrap(I)}set_wheel_axle_cs(A,I){Z(I,UI),c.rawdynamicraycastvehiclecontroller_set_wheel_axle_cs(this.__wbg_ptr,A,I.__wbg_ptr)}wheel_friction_slip(A){const I=c.rawdynamicraycastvehiclecontroller_wheel_friction_slip(this.__wbg_ptr,A);return 4294967297===I?void 0:I}set_wheel_friction_slip(A,I){c.rawdynamicraycastvehiclecontroller_set_wheel_friction_slip(this.__wbg_ptr,A,I)