TOPVERSE_Official/.output/public/_nuxt/cannon-es.73300c7b.js

2 lines
122 KiB
JavaScript
Raw Normal View History

2023-05-28 15:00:40 +08:00
class Go{constructor(){this.matrix={}}get(t,e){let{id:s}=t,{id:i}=e;if(i>s){const n=i;i=s,s=n}return`${s}-${i}`in this.matrix}set(t,e,s){let{id:i}=t,{id:n}=e;if(n>i){const o=n;n=i,i=o}s?this.matrix[`${i}-${n}`]=!0:delete this.matrix[`${i}-${n}`]}reset(){this.matrix={}}setNumObjects(t){}}class et{constructor(t){t===void 0&&(t=[0,0,0,0,0,0,0,0,0]),this.elements=t}identity(){const t=this.elements;t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1}setZero(){const t=this.elements;t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0}setTrace(t){const e=this.elements;e[0]=t.x,e[4]=t.y,e[8]=t.z}getTrace(t){t===void 0&&(t=new l);const e=this.elements;return t.x=e[0],t.y=e[4],t.z=e[8],t}vmult(t,e){e===void 0&&(e=new l);const s=this.elements,i=t.x,n=t.y,o=t.z;return e.x=s[0]*i+s[1]*n+s[2]*o,e.y=s[3]*i+s[4]*n+s[5]*o,e.z=s[6]*i+s[7]*n+s[8]*o,e}smult(t){for(let e=0;e<this.elements.length;e++)this.elements[e]*=t}mmult(t,e){e===void 0&&(e=new et);const s=this.elements,i=t.elements,n=e.elements,o=s[0],r=s[1],c=s[2],a=s[3],h=s[4],u=s[5],d=s[6],f=s[7],p=s[8],m=i[0],v=i[1],w=i[2],y=i[3],x=i[4],g=i[5],A=i[6],E=i[7],I=i[8];return n[0]=o*m+r*y+c*A,n[1]=o*v+r*x+c*E,n[2]=o*w+r*g+c*I,n[3]=a*m+h*y+u*A,n[4]=a*v+h*x+u*E,n[5]=a*w+h*g+u*I,n[6]=d*m+f*y+p*A,n[7]=d*v+f*x+p*E,n[8]=d*w+f*g+p*I,e}scale(t,e){e===void 0&&(e=new et);const s=this.elements,i=e.elements;for(let n=0;n!==3;n++)i[3*n+0]=t.x*s[3*n+0],i[3*n+1]=t.y*s[3*n+1],i[3*n+2]=t.z*s[3*n+2];return e}solve(t,e){e===void 0&&(e=new l);const s=3,i=4,n=[];let o,r;for(o=0;o<s*i;o++)n.push(0);for(o=0;o<3;o++)for(r=0;r<3;r++)n[o+i*r]=this.elements[o+3*r];n[3+4*0]=t.x,n[3+4*1]=t.y,n[3+4*2]=t.z;let c=3;const a=c;let h;const u=4;let d;do{if(o=a-c,n[o+i*o]===0){for(r=o+1;r<a;r++)if(n[o+i*r]!==0){h=u;do d=u-h,n[d+i*o]+=n[d+i*r];while(--h);break}}if(n[o+i*o]!==0)for(r=o+1;r<a;r++){const f=n[o+i*r]/n[o+i*o];h=u;do d=u-h,n[d+i*r]=d<=o?0:n[d+i*r]-n[d+i*o]*f;while(--h)}}while(--c);if(e.z=n[2*i+3]/n[2*i+2],e.y=(n[1*i+3]-n[1*i+2]*e.z)/n[1*i+1],e.x=(n[0*i+3]-n[0*i+2]*e.z-n[0*i+1]*e.y)/n[0*i+0],isNaN(e.x)||isNaN(e.y)||isNaN(e.z)||e.x===1/0||e.y===1/0||e.z===1/0)throw`Could not solve equation! Got x=[${e.toString()}], b=[${t.toString()}], A=[${this.toString()}]`;return e}e(t,e,s){if(s===void 0)return this.elements[e+3*t];this.elements[e+3*t]=s}copy(t){for(let e=0;e<t.elements.length;e++)this.elements[e]=t.elements[e];return this}toString(){let t="";const e=",";for(let s=0;s<9;s++)t+=this.elements[s]+e;return t}reverse(t){t===void 0&&(t=new et);const e=3,s=6,i=Xe;let n,o;for(n=0;n<3;n++)for(o=0;o<3;o++)i[n+s*o]=this.elements[n+3*o];i[3+6*0]=1,i[3+6*1]=0,i[3+6*2]=0,i[4+6*0]=0,i[4+6*1]=1,i[4+6*2]=0,i[5+6*0]=0,i[5+6*1]=0,i[5+6*2]=1;let r=3;const c=r;let a;const h=s;let u;do{if(n=c-r,i[n+s*n]===0){for(o=n+1;o<c;o++)if(i[n+s*o]!==0){a=h;do u=h-a,i[u+s*n]+=i[u+s*o];while(--a);break}}if(i[n+s*n]!==0)for(o=n+1;o<c;o++){const d=i[n+s*o]/i[n+s*n];a=h;do u=h-a,i[u+s*o]=u<=n?0:i[u+s*o]-i[u+s*n]*d;while(--a)}}while(--r);n=2;do{o=n-1;do{const d=i[n+s*o]/i[n+s*n];a=s;do u=s-a,i[u+s*o]=i[u+s*o]-i[u+s*n]*d;while(--a)}while(o--)}while(--n);n=2;do{const d=1/i[n+s*n];a=s;do u=s-a,i[u+s*n]=i[u+s*n]*d;while(--a)}while(n--);n=2;do{o=2;do{if(u=i[e+o+s*n],isNaN(u)||u===1/0)throw`Could not reverse! A=[${this.toString()}]`;t.e(n,o,u)}while(o--)}while(n--);return t}setRotationFromQuaternion(t){const e=t.x,s=t.y,i=t.z,n=t.w,o=e+e,r=s+s,c=i+i,a=e*o,h=e*r,u=e*c,d=s*r,f=s*c,p=i*c,m=n*o,v=n*r,w=n*c,y=this.elements;return y[3*0+0]=1-(d+p),y[3*0+1]=h-w,y[3*0+2]=u+v,y[3*1+0]=h+w,y[3*1+1]=1-(a+p),y[3*1+2]=f-m,y[3*2+0]=u-v,y[3*2+1]=f+m,y[3*2+2]=1-(a+d),this}transpose(t){t===void 0&&(t=new et);const e=this.elements,s=t.elements;let i;return s[0]=e[0],s[4]=e[4],s[8]=e[8],i=e[1],s[1]=e[3],s[3]=i,i=e[2],s[2]=e[6],s[6]=i,i=e[5],s[5]=e[7],s[7]=i,t}}const Xe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];class l{constructor(t,e,s){t===void 0&&(t=0),e===void 0&&(e=0),s===void 0&&(s=0),this.x=t,this.y=e,this.z=s}cross(t,e){e===void 0&&(e=new l);const s=t.x,i=t.y,n=t.z,o=this.x,r=this.y,c=this.z;return e.x=r*n-c*i,e.y=c*s-o*n,e.z=o*i-r*s,e}set(t,e,s){ret