wgpu-matrix
Advanced tools
Comparing version 2.6.1 to 2.7.0
@@ -362,1 +362,9 @@ import { Mat3 } from './mat3'; | ||
export declare function rotate(a: Vec2, b: Vec2, rad: number, dst?: Vec2): Vec2; | ||
/** | ||
* Treat a 2D vector as a direction and set it's length | ||
* | ||
* @param a The vec2 to lengthen | ||
* @param len The length of the resulting vector | ||
* @returns The lengthened vector | ||
*/ | ||
export declare function setLength(a: Vec2, len: number, dst?: Vec2): Vec2; |
@@ -422,1 +422,9 @@ import { Vec3, create, setDefaultType } from './vec3'; | ||
export declare function rotateZ(a: Vec3, b: Vec3, rad: number, dst?: Vec3): Vec3; | ||
/** | ||
* Treat a 3D vector as a direction and set it's length | ||
* | ||
* @param a The vec3 to lengthen | ||
* @param len The length of the resulting vector | ||
* @returns The lengthened vector | ||
*/ | ||
export declare function setLength(a: Vec3, len: number, dst?: Vec3): Vec3; |
@@ -322,1 +322,9 @@ import { Vec4, create, setDefaultType } from './vec4'; | ||
export declare function transformMat4(v: Vec4, m: Mat4, dst?: Vec4): Vec4; | ||
/** | ||
* Treat a 4D vector as a direction and set it's length | ||
* | ||
* @param a The vec4 to lengthen | ||
* @param len The length of the resulting vector | ||
* @returns The lengthened vector | ||
*/ | ||
export declare function setLength(a: Vec4, len: number, dst?: Vec4): Vec4; |
@@ -1,70 +0,70 @@ | ||
/* wgpu-matrix@2.6.1, license MIT */ | ||
(function(M,aa){"object"===typeof exports&&"undefined"!==typeof module?aa(exports):"function"===typeof define&&define.amd?define(["exports"],aa):(M="undefined"!==typeof globalThis?globalThis:M||self,aa(M.wgpuMatrix={}))})(this,function(M){function aa(a){const b=z;z=a;return b}function ba(a=0,b=0){const c=new z(2);void 0!==a&&(c[0]=a,void 0!==b&&(c[1]=b));return c}function va(a){const b=v;v=a;return b}function H(a,b,c){const d=new v(3);void 0!==a&&(d[0]=a,void 0!==b&&(d[1]=b,void 0!==c&&(d[2]=c))); | ||
return d}function wa(a,b,c){c=c||new z(2);c[0]=a[0]-b[0];c[1]=a[1]-b[1];return c}function xa(a,b,c){c=c||new z(2);c[0]=a[0]*b;c[1]=a[1]*b;return c}function ya(a,b){b=b||new z(2);b[0]=1/a[0];b[1]=1/a[1];return b}function za(a,b){return a[0]*b[0]+a[1]*b[1]}function Aa(a){const b=a[0];a=a[1];return Math.sqrt(b*b+a*a)}function Ba(a){const b=a[0];a=a[1];return b*b+a*a}function Ca(a,b){const c=a[0]-b[0];a=a[1]-b[1];return Math.sqrt(c*c+a*a)}function Da(a,b){const c=a[0]-b[0];a=a[1]-b[1];return c*c+a*a} | ||
function Ea(a,b){b=b||new z(2);b[0]=a[0];b[1]=a[1];return b}function Fa(a,b,c){c=c||new z(2);c[0]=a[0]*b[0];c[1]=a[1]*b[1];return c}function Ga(a,b,c){c=c||new z(2);c[0]=a[0]/b[0];c[1]=a[1]/b[1];return c}function Ha(a){const b=Ia;Ia=a;G=Ja.get(a);return b}function pa(a,b){b=b||G();b[0]=a[0];b[1]=a[1];b[2]=a[2];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[8]=a[8];b[9]=a[9];b[10]=a[10];return b}function Ka(a){a=a||G();a[0]=1;a[1]=0;a[2]=0;a[4]=0;a[5]=1;a[6]=0;a[8]=0;a[9]=0;a[10]=1;return a}function La(a,b){b=b|| | ||
G();const c=a[0],d=a[1],e=a[2],f=a[4],g=a[5],h=a[6],l=a[8],k=a[9];a=a[10];const m=a*g-h*k,n=-a*f+h*l,q=k*f-g*l,r=1/(c*m+d*n+e*q);b[0]=m*r;b[1]=(-a*d+e*k)*r;b[2]=(h*d-e*g)*r;b[4]=n*r;b[5]=(a*c-e*l)*r;b[6]=(-h*c+e*f)*r;b[8]=q*r;b[9]=(-k*c+d*l)*r;b[10]=(g*c-d*f)*r;return b}function Ma(a,b,c){c=c||G();const d=a[0],e=a[1],f=a[2],g=a[4],h=a[5],l=a[6],k=a[8],m=a[9];a=a[10];const n=b[0],q=b[1],r=b[2],w=b[4],u=b[5],p=b[6],E=b[8],F=b[9];b=b[10];c[0]=d*n+g*q+k*r;c[1]=e*n+h*q+m*r;c[2]=f*n+l*q+a*r;c[4]=d*w+g* | ||
u+k*p;c[5]=e*w+h*u+m*p;c[6]=f*w+l*u+a*p;c[8]=d*E+g*F+k*b;c[9]=e*E+h*F+m*b;c[10]=f*E+l*F+a*b;return c}function ca(a,b,c){c=c||new v(3);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];return c}function Na(a,b,c){c=c||new v(3);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;return c}function Oa(a,b){b=b||new v(3);b[0]=1/a[0];b[1]=1/a[1];b[2]=1/a[2];return b}function P(a,b,c){c=c||new v(3);const d=a[2]*b[0]-a[0]*b[2],e=a[0]*b[1]-a[1]*b[0];c[0]=a[1]*b[2]-a[2]*b[1];c[1]=d;c[2]=e;return c}function qa(a,b){return a[0]* | ||
b[0]+a[1]*b[1]+a[2]*b[2]}function ra(a){const b=a[0],c=a[1];a=a[2];return Math.sqrt(b*b+c*c+a*a)}function Pa(a){const b=a[0],c=a[1];a=a[2];return b*b+c*c+a*a}function Qa(a,b){const c=a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];return Math.sqrt(c*c+d*d+a*a)}function Ra(a,b){const c=a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];return c*c+d*d+a*a}function O(a,b){b=b||new v(3);const c=a[0],d=a[1];a=a[2];const e=Math.sqrt(c*c+d*d+a*a);1E-5<e?(b[0]=c/e,b[1]=d/e,b[2]=a/e):(b[0]=0,b[1]=0,b[2]=0);return b}function Sa(a,b){b=b|| | ||
new v(3);b[0]=a[0];b[1]=a[1];b[2]=a[2];return b}function Ta(a,b,c){c=c||new v(3);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];return c}function Ua(a,b,c){c=c||new v(3);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];return c}function Va(a){const b=x;x=a;return b}function sa(a,b){b=b||new x(16);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b}function Wa(a){a=a||new x(16); | ||
a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a}function Xa(a,b){b=b||new x(16);const c=a[0];var d=a[1];const e=a[2],f=a[3],g=a[4];var h=a[5];const l=a[6],k=a[7],m=a[8],n=a[9],q=a[10],r=a[11],w=a[12];var u=a[13];const p=a[14];a=a[15];const E=q*a,F=p*r,I=l*a,J=p*k,K=l*r,L=q*k,Q=e*a,R=p*f,S=e*r,T=q*f,U=e*k,V=l*f,W=m*u,X=w*n,Y=g*u,Z=w*h,da=g*n,ea=m*h,fa=c*u,ha=w*d,ia=c*n,ja=m*d,ka=c*h,la=g*d,Ya=E*h+J*n+K*u-(F*h+I*n+L*u),Za= | ||
F*d+Q*n+T*u-(E*d+R*n+S*u);u=I*d+R*h+U*u-(J*d+Q*h+V*u);d=L*d+S*h+V*n-(K*d+T*h+U*n);h=1/(c*Ya+g*Za+m*u+w*d);b[0]=h*Ya;b[1]=h*Za;b[2]=h*u;b[3]=h*d;b[4]=h*(F*g+I*m+L*w-(E*g+J*m+K*w));b[5]=h*(E*c+R*m+S*w-(F*c+Q*m+T*w));b[6]=h*(J*c+Q*g+V*w-(I*c+R*g+U*w));b[7]=h*(K*c+T*g+U*m-(L*c+S*g+V*m));b[8]=h*(W*k+Z*r+da*a-(X*k+Y*r+ea*a));b[9]=h*(X*f+fa*r+ja*a-(W*f+ha*r+ia*a));b[10]=h*(Y*f+ha*k+ka*a-(Z*f+fa*k+la*a));b[11]=h*(ea*f+ia*k+la*r-(da*f+ja*k+ka*r));b[12]=h*(Y*q+ea*p+X*l-(da*p+W*l+Z*q));b[13]=h*(ia*p+W*e+ha* | ||
q-(fa*q+ja*p+X*e));b[14]=h*(fa*l+la*p+Z*e-(ka*p+Y*e+ha*l));b[15]=h*(ka*q+da*e+ja*l-(ia*l+la*q+ea*e));return b}function $a(a,b,c){c=c||new x(16);const d=a[0],e=a[1],f=a[2],g=a[3],h=a[4],l=a[5],k=a[6],m=a[7],n=a[8],q=a[9],r=a[10],w=a[11],u=a[12],p=a[13],E=a[14];a=a[15];const F=b[0],I=b[1],J=b[2],K=b[3],L=b[4],Q=b[5],R=b[6],S=b[7],T=b[8],U=b[9],V=b[10],W=b[11],X=b[12],Y=b[13],Z=b[14];b=b[15];c[0]=d*F+h*I+n*J+u*K;c[1]=e*F+l*I+q*J+p*K;c[2]=f*F+k*I+r*J+E*K;c[3]=g*F+m*I+w*J+a*K;c[4]=d*L+h*Q+n*R+u*S;c[5]= | ||
e*L+l*Q+q*R+p*S;c[6]=f*L+k*Q+r*R+E*S;c[7]=g*L+m*Q+w*R+a*S;c[8]=d*T+h*U+n*V+u*W;c[9]=e*T+l*U+q*V+p*W;c[10]=f*T+k*U+r*V+E*W;c[11]=g*T+m*U+w*V+a*W;c[12]=d*X+h*Y+n*Z+u*b;c[13]=e*X+l*Y+q*Z+p*b;c[14]=f*X+k*Y+r*Z+E*b;c[15]=g*X+m*Y+w*Z+a*b;return c}function ab(a,b,c){c=c||new x(16);let d=a[0],e=a[1];a=a[2];var f=Math.sqrt(d*d+e*e+a*a);d/=f;e/=f;a/=f;f=d*d;const g=e*e,h=a*a,l=Math.cos(b);b=Math.sin(b);const k=1-l;c[0]=f+(1-f)*l;c[1]=d*e*k+a*b;c[2]=d*a*k-e*b;c[3]=0;c[4]=d*e*k-a*b;c[5]=g+(1-g)*l;c[6]=e*a*k+ | ||
d*b;c[7]=0;c[8]=d*a*k+e*b;c[9]=e*a*k-d*b;c[10]=h+(1-h)*l;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c}function bb(a,b,c,d){d=d||new x(16);var e=b[0],f=b[1],g=b[2];b=Math.sqrt(e*e+f*f+g*g);e/=b;f/=b;g/=b;b=e*e;var h=f*f,l=g*g,k=Math.cos(c),m=Math.sin(c),n=1-k;c=b+(1-b)*k;b=e*f*n+g*m;const q=e*g*n-f*m,r=e*f*n-g*m;h+=(1-h)*k;const w=f*g*n+e*m,u=e*g*n+f*m;e=f*g*n-e*m;f=l+(1-l)*k;g=a[0];l=a[1];k=a[2];m=a[3];n=a[4];const p=a[5],E=a[6],F=a[7],I=a[8],J=a[9],K=a[10],L=a[11];d[0]=c*g+b*n+q*I;d[1]=c*l+b* | ||
p+q*J;d[2]=c*k+b*E+q*K;d[3]=c*m+b*F+q*L;d[4]=r*g+h*n+w*I;d[5]=r*l+h*p+w*J;d[6]=r*k+h*E+w*K;d[7]=r*m+h*F+w*L;d[8]=u*g+e*n+f*I;d[9]=u*l+e*p+f*J;d[10]=u*k+e*E+f*K;d[11]=u*m+e*F+f*L;a!==d&&(d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d}function cb(a){const b=B;B=a;return b}function db(a,b,c,d){const e=new B(4);void 0!==a&&(e[0]=a,void 0!==b&&(e[1]=b,void 0!==c&&(e[2]=c,void 0!==d&&(e[3]=d))));return e}function eb(a,b,c){c=c||new B(4);b*=.5;const d=Math.sin(b);c[0]=d*a[0];c[1]=d*a[1];c[2]= | ||
d*a[2];c[3]=Math.cos(b);return c}function fb(a,b,c){c=c||new B(4);const d=a[0],e=a[1],f=a[2];a=a[3];const g=b[0],h=b[1],l=b[2];b=b[3];c[0]=d*b+a*g+e*l-f*h;c[1]=e*b+a*h+f*g-d*l;c[2]=f*b+a*l+d*h-e*g;c[3]=a*b-d*g-e*h-f*l;return c}function ma(a,b,c,d){d=d||new B(4);const e=a[0],f=a[1],g=a[2];a=a[3];let h=b[0],l=b[1],k=b[2];b=b[3];var m=e*h+f*l+g*k+a*b;0>m&&(m=-m,h=-h,l=-l,k=-k,b=-b);if(1-m>t){const n=Math.acos(m),q=Math.sin(n);m=Math.sin((1-c)*n)/q;c=Math.sin(c*n)/q}else m=1-c;d[0]=m*e+c*h;d[1]=m*f+c* | ||
l;d[2]=m*g+c*k;d[3]=m*a+c*b;return d}function gb(a,b){b=b||new B(4);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b}function hb(a,b,c){c=c||new B(4);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c}function ib(a,b,c){c=c||new B(4);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c}function jb(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function kb(a){const b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)}function lb(a){const b=a[0],c=a[1],d=a[2];a=a[3]; | ||
return b*b+c*c+d*d+a*a}function mb(a,b){b=b||new B(4);const c=a[0],d=a[1],e=a[2];a=a[3];const f=Math.sqrt(c*c+d*d+e*e+a*a);1E-5<f?(b[0]=c/f,b[1]=d/f,b[2]=e/f,b[3]=a/f):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b}function nb(a){const b=C;C=a;return b}function ob(a,b,c,d){const e=new C(4);void 0!==a&&(e[0]=a,void 0!==b&&(e[1]=b,void 0!==c&&(e[2]=c,void 0!==d&&(e[3]=d))));return e}function pb(a,b,c){c=c||new C(4);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c}function qb(a,b,c){c=c|| | ||
new C(4);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c}function rb(a,b){b=b||new C(4);b[0]=1/a[0];b[1]=1/a[1];b[2]=1/a[2];b[3]=1/a[3];return b}function sb(a){const b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)}function tb(a){const b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a}function ub(a,b){const c=a[0]-b[0],d=a[1]-b[1],e=a[2]-b[2];a=a[3]-b[3];return Math.sqrt(c*c+d*d+e*e+a*a)}function vb(a,b){const c=a[0]-b[0],d=a[1]-b[1],e=a[2]-b[2];a=a[3]-b[3];return c*c+d*d+e* | ||
e+a*a}function wb(a,b){b=b||new C(4);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b}function xb(a,b,c){c=c||new C(4);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c}function yb(a,b,c){c=c||new C(4);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c}let t=1E-6;var zb=Object.freeze({__proto__:null,get EPSILON(){return t},degToRad:function(a){return a*Math.PI/180},euclideanModulo:function(a,b){return(a%b+b)%b},inverseLerp:function(a,b,c){return Math.abs(b-a)< | ||
t?a:(c-a)/(b-a)},lerp:function(a,b,c){return a+(b-a)*c},radToDeg:function(a){return 180*a/Math.PI},setEpsilon:function(a){const b=t;t=a;return b}});let z=Float32Array,v=Float32Array;var Ab=Object.freeze({__proto__:null,add:function(a,b,c){c=c||new z(2);c[0]=a[0]+b[0];c[1]=a[1]+b[1];return c},addScaled:function(a,b,c,d){d=d||new z(2);d[0]=a[0]+b[0]*c;d[1]=a[1]+b[1]*c;return d},angle:function(a,b){var c=a[0];const d=a[1],e=a[0],f=a[1];a=(c=Math.sqrt(c*c+d*d)*Math.sqrt(e*e+f*f))&&za(a,b)/c;return Math.acos(a)}, | ||
ceil:function(a,b){b=b||new z(2);b[0]=Math.ceil(a[0]);b[1]=Math.ceil(a[1]);return b},clamp:function(a,b=0,c=1,d){d=d||new z(2);d[0]=Math.min(c,Math.max(b,a[0]));d[1]=Math.min(c,Math.max(b,a[1]));return d},clone:Ea,copy:Ea,create:ba,cross:function(a,b,c){c=c||new v(3);a=a[0]*b[1]-a[1]*b[0];c[0]=0;c[1]=0;c[2]=a;return c},dist:Ca,distSq:Da,distance:Ca,distanceSq:Da,div:Ga,divScalar:function(a,b,c){c=c||new z(2);c[0]=a[0]/b;c[1]=a[1]/b;return c},divide:Ga,dot:za,equals:function(a,b){return a[0]===b[0]&& | ||
a[1]===b[1]},equalsApproximately:function(a,b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t},floor:function(a,b){b=b||new z(2);b[0]=Math.floor(a[0]);b[1]=Math.floor(a[1]);return b},fromValues:ba,inverse:ya,invert:ya,len:Aa,lenSq:Ba,length:Aa,lengthSq:Ba,lerp:function(a,b,c,d){d=d||new z(2);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);return d},lerpV:function(a,b,c,d){d=d||new z(2);d[0]=a[0]+c[0]*(b[0]-a[0]);d[1]=a[1]+c[1]*(b[1]-a[1]);return d},max:function(a,b,c){c=c||new z(2);c[0]=Math.max(a[0], | ||
b[0]);c[1]=Math.max(a[1],b[1]);return c},min:function(a,b,c){c=c||new z(2);c[0]=Math.min(a[0],b[0]);c[1]=Math.min(a[1],b[1]);return c},mul:Fa,mulScalar:xa,multiply:Fa,negate:function(a,b){b=b||new z(2);b[0]=-a[0];b[1]=-a[1];return b},normalize:function(a,b){b=b||new z(2);const c=a[0];a=a[1];const d=Math.sqrt(c*c+a*a);1E-5<d?(b[0]=c/d,b[1]=a/d):(b[0]=0,b[1]=0);return b},random:function(a=1,b){b=b||new z(2);const c=2*Math.random()*Math.PI;b[0]=Math.cos(c)*a;b[1]=Math.sin(c)*a;return b},rotate:function(a, | ||
b,c,d){d=d||new z(2);const e=a[0]-b[0];a=a[1]-b[1];const f=Math.sin(c);c=Math.cos(c);d[0]=e*c-a*f+b[0];d[1]=e*f+a*c+b[1];return d},round:function(a,b){b=b||new z(2);b[0]=Math.round(a[0]);b[1]=Math.round(a[1]);return b},scale:xa,set:function(a,b,c){c=c||new z(2);c[0]=a;c[1]=b;return c},setDefaultType:aa,sub:wa,subtract:wa,transformMat3:function(a,b,c){c=c||new z(2);const d=a[0];a=a[1];c[0]=b[0]*d+b[4]*a+b[8];c[1]=b[1]*d+b[5]*a+b[9];return c},transformMat4:function(a,b,c){c=c||new z(2);const d=a[0]; | ||
a=a[1];c[0]=d*b[0]+a*b[4]+b[12];c[1]=d*b[1]+a*b[5]+b[13];return c},zero:function(a){a=a||new z(2);a[0]=0;a[1]=0;return a}});let Ia=Float32Array;const Ja=new Map([[Float32Array,()=>new Float32Array(12)],[Float64Array,()=>new Float64Array(12)],[Array,()=>Array(12).fill(0)]]);let G=Ja.get(Float32Array);var Bb=Object.freeze({__proto__:null,clone:pa,copy:pa,create:function(a,b,c,d,e,f,g,h,l){const k=G();k[3]=0;k[7]=0;k[11]=0;void 0!==a&&(k[0]=a,void 0!==b&&(k[1]=b,void 0!==c&&(k[2]=c,void 0!==d&&(k[4]= | ||
d,void 0!==e&&(k[5]=e,void 0!==f&&(k[6]=f,void 0!==g&&(k[8]=g,void 0!==h&&(k[9]=h,void 0!==l&&(k[10]=l)))))))));return k},determinant:function(a){const b=a[1],c=a[2],d=a[5],e=a[6],f=a[9],g=a[10];return a[0]*(d*g-f*e)-a[4]*(b*g-f*c)+a[8]*(b*e-d*c)},equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[8]===b[8]&&a[9]===b[9]&&a[10]===b[10]},equalsApproximately:function(a,b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t&&Math.abs(a[2]-b[2])< | ||
t&&Math.abs(a[4]-b[4])<t&&Math.abs(a[5]-b[5])<t&&Math.abs(a[6]-b[6])<t&&Math.abs(a[8]-b[8])<t&&Math.abs(a[9]-b[9])<t&&Math.abs(a[10]-b[10])<t},fromMat4:function(a,b){b=b||G();b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=0;b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=0;b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=0;return b},fromQuat:function(a,b){b=b||G();var c=a[0],d=a[1],e=a[2];a=a[3];var f=c+c,g=d+d;const h=e+e;c*=f;const l=d*f;d*=g;const k=e*f,m=e*g;e*=h;f*=a;g*=a;a*=h;b[0]=1-d-e;b[1]=l+a;b[2]=k-g;b[3]=0;b[4]=l-a;b[5]= | ||
1-c-e;b[6]=m+f;b[7]=0;b[8]=k+g;b[9]=m-f;b[10]=1-c-d;b[11]=0;return b},getAxis:function(a,b,c){c=c||ba();b*=4;c[0]=a[b+0];c[1]=a[b+1];return c},getScaling:function(a,b){b=b||ba();const c=a[0],d=a[1],e=a[4];a=a[5];b[0]=Math.sqrt(c*c+d*d);b[1]=Math.sqrt(e*e+a*a);return b},getTranslation:function(a,b){b=b||ba();b[0]=a[8];b[1]=a[9];return b},identity:Ka,inverse:La,invert:La,mul:Ma,multiply:Ma,negate:function(a,b){b=b||G();b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[4]=-a[4];b[5]=-a[5];b[6]=-a[6];b[8]=-a[8];b[9]= | ||
-a[9];b[10]=-a[10];return b},rotate:function(a,b,c){c=c||G();const d=a[0],e=a[1],f=a[2],g=a[4],h=a[5],l=a[6],k=Math.cos(b);b=Math.sin(b);c[0]=k*d+b*g;c[1]=k*e+b*h;c[2]=k*f+b*l;c[4]=k*g-b*d;c[5]=k*h-b*e;c[6]=k*l-b*f;a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10]);return c},rotation:function(a,b){b=b||G();const c=Math.cos(a);a=Math.sin(a);b[0]=c;b[1]=a;b[2]=0;b[4]=-a;b[5]=c;b[6]=0;b[8]=0;b[9]=0;b[10]=1;return b},scale:function(a,b,c){c=c||G();const d=b[0];b=b[1];c[0]=d*a[0];c[1]=d*a[1];c[2]=d*a[2];c[4]=b* | ||
a[4];c[5]=b*a[5];c[6]=b*a[6];a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10]);return c},scaling:function(a,b){b=b||G();b[0]=a[0];b[1]=0;b[2]=0;b[4]=0;b[5]=a[1];b[6]=0;b[8]=0;b[9]=0;b[10]=1;return b},set:function(a,b,c,d,e,f,g,h,l,k){k=k||G();k[0]=a;k[1]=b;k[2]=c;k[3]=0;k[4]=d;k[5]=e;k[6]=f;k[7]=0;k[8]=g;k[9]=h;k[10]=l;k[11]=0;return k},setAxis:function(a,b,c,d){d!==a&&(d=pa(a,d));a=4*c;d[a+0]=b[0];d[a+1]=b[1];return d},setDefaultType:Ha,setTranslation:function(a,b,c){c=c||Ka();a!==c&&(c[0]=a[0],c[1]=a[1], | ||
c[2]=a[2],c[4]=a[4],c[5]=a[5],c[6]=a[6]);c[8]=b[0];c[9]=b[1];c[10]=1;return c},translate:function(a,b,c){c=c||G();const d=b[0];b=b[1];const e=a[0],f=a[1],g=a[2],h=a[4],l=a[5],k=a[6],m=a[8],n=a[9],q=a[10];a!==c&&(c[0]=e,c[1]=f,c[2]=g,c[4]=h,c[5]=l,c[6]=k);c[8]=e*d+h*b+m;c[9]=f*d+l*b+n;c[10]=g*d+k*b+q;return c},translation:function(a,b){b=b||G();b[0]=1;b[1]=0;b[2]=0;b[4]=0;b[5]=1;b[6]=0;b[8]=a[0];b[9]=a[1];b[10]=1;return b},transpose:function(a,b){b=b||G();if(b===a){var c=a[1];a[1]=a[4];a[4]=c;c=a[2]; | ||
a[2]=a[8];a[8]=c;c=a[6];a[6]=a[9];a[9]=c;return b}c=a[1];const d=a[2],e=a[4],f=a[5],g=a[6],h=a[8],l=a[9],k=a[10];b[0]=a[0];b[1]=e;b[2]=h;b[4]=c;b[5]=f;b[6]=l;b[8]=d;b[9]=g;b[10]=k;return b},uniformScale:function(a,b,c){c=c||G();c[0]=b*a[0];c[1]=b*a[1];c[2]=b*a[2];c[4]=b*a[4];c[5]=b*a[5];c[6]=b*a[6];a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10]);return c},uniformScaling:function(a,b){b=b||G();b[0]=a;b[1]=0;b[2]=0;b[4]=0;b[5]=a;b[6]=0;b[8]=0;b[9]=0;b[10]=1;return b}}),Cb=Object.freeze({__proto__:null,add:function(a, | ||
b,c){c=c||new v(3);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];return c},addScaled:function(a,b,c,d){d=d||new v(3);d[0]=a[0]+b[0]*c;d[1]=a[1]+b[1]*c;d[2]=a[2]+b[2]*c;return d},angle:function(a,b){var c=a[0];const d=a[1],e=a[2],f=a[0],g=a[1],h=a[2];a=(c=Math.sqrt(c*c+d*d+e*e)*Math.sqrt(f*f+g*g+h*h))&&qa(a,b)/c;return Math.acos(a)},ceil:function(a,b){b=b||new v(3);b[0]=Math.ceil(a[0]);b[1]=Math.ceil(a[1]);b[2]=Math.ceil(a[2]);return b},clamp:function(a,b=0,c=1,d){d=d||new v(3);d[0]=Math.min(c,Math.max(b, | ||
a[0]));d[1]=Math.min(c,Math.max(b,a[1]));d[2]=Math.min(c,Math.max(b,a[2]));return d},clone:Sa,copy:Sa,create:H,cross:P,dist:Qa,distSq:Ra,distance:Qa,distanceSq:Ra,div:Ua,divScalar:function(a,b,c){c=c||new v(3);c[0]=a[0]/b;c[1]=a[1]/b;c[2]=a[2]/b;return c},divide:Ua,dot:qa,equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]},equalsApproximately:function(a,b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t&&Math.abs(a[2]-b[2])<t},floor:function(a,b){b=b||new v(3);b[0]=Math.floor(a[0]); | ||
b[1]=Math.floor(a[1]);b[2]=Math.floor(a[2]);return b},fromValues:H,getAxis:function(a,b,c){c=c||new v(3);b*=4;c[0]=a[b+0];c[1]=a[b+1];c[2]=a[b+2];return c},getScaling:function(a,b){b=b||new v(3);const c=a[0],d=a[1],e=a[2],f=a[4],g=a[5],h=a[6],l=a[8],k=a[9];a=a[10];b[0]=Math.sqrt(c*c+d*d+e*e);b[1]=Math.sqrt(f*f+g*g+h*h);b[2]=Math.sqrt(l*l+k*k+a*a);return b},getTranslation:function(a,b){b=b||new v(3);b[0]=a[12];b[1]=a[13];b[2]=a[14];return b},inverse:Oa,invert:Oa,len:ra,lenSq:Pa,length:ra,lengthSq:Pa, | ||
lerp:function(a,b,c,d){d=d||new v(3);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);return d},lerpV:function(a,b,c,d){d=d||new v(3);d[0]=a[0]+c[0]*(b[0]-a[0]);d[1]=a[1]+c[1]*(b[1]-a[1]);d[2]=a[2]+c[2]*(b[2]-a[2]);return d},max:function(a,b,c){c=c||new v(3);c[0]=Math.max(a[0],b[0]);c[1]=Math.max(a[1],b[1]);c[2]=Math.max(a[2],b[2]);return c},min:function(a,b,c){c=c||new v(3);c[0]=Math.min(a[0],b[0]);c[1]=Math.min(a[1],b[1]);c[2]=Math.min(a[2],b[2]);return c},mul:Ta,mulScalar:Na, | ||
multiply:Ta,negate:function(a,b){b=b||new v(3);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},normalize:O,random:function(a=1,b){b=b||new v(3);const c=2*Math.random()*Math.PI,d=2*Math.random()-1,e=Math.sqrt(1-d*d)*a;b[0]=Math.cos(c)*e;b[1]=Math.sin(c)*e;b[2]=d*a;return b},rotateX:function(a,b,c,d){d=d||new v(3);const e=[],f=[];e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];f[0]=e[0];f[1]=e[1]*Math.cos(c)-e[2]*Math.sin(c);f[2]=e[1]*Math.sin(c)+e[2]*Math.cos(c);d[0]=f[0]+b[0];d[1]=f[1]+b[1];d[2]=f[2]+b[2]; | ||
return d},rotateY:function(a,b,c,d){d=d||new v(3);const e=[],f=[];e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];f[0]=e[2]*Math.sin(c)+e[0]*Math.cos(c);f[1]=e[1];f[2]=e[2]*Math.cos(c)-e[0]*Math.sin(c);d[0]=f[0]+b[0];d[1]=f[1]+b[1];d[2]=f[2]+b[2];return d},rotateZ:function(a,b,c,d){d=d||new v(3);const e=[],f=[];e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];f[0]=e[0]*Math.cos(c)-e[1]*Math.sin(c);f[1]=e[0]*Math.sin(c)+e[1]*Math.cos(c);f[2]=e[2];d[0]=f[0]+b[0];d[1]=f[1]+b[1];d[2]=f[2]+b[2];return d},round:function(a, | ||
b){b=b||new v(3);b[0]=Math.round(a[0]);b[1]=Math.round(a[1]);b[2]=Math.round(a[2]);return b},scale:Na,set:function(a,b,c,d){d=d||new v(3);d[0]=a;d[1]=b;d[2]=c;return d},setDefaultType:va,sub:ca,subtract:ca,transformMat3:function(a,b,c){c=c||new v(3);const d=a[0],e=a[1];a=a[2];c[0]=d*b[0]+e*b[4]+a*b[8];c[1]=d*b[1]+e*b[5]+a*b[9];c[2]=d*b[2]+e*b[6]+a*b[10];return c},transformMat4:function(a,b,c){c=c||new v(3);const d=a[0],e=a[1];a=a[2];const f=b[3]*d+b[7]*e+b[11]*a+b[15]||1;c[0]=(b[0]*d+b[4]*e+b[8]* | ||
a+b[12])/f;c[1]=(b[1]*d+b[5]*e+b[9]*a+b[13])/f;c[2]=(b[2]*d+b[6]*e+b[10]*a+b[14])/f;return c},transformMat4Upper3x3:function(a,b,c){c=c||new v(3);const d=a[0],e=a[1];a=a[2];c[0]=d*b[0]+e*b[4]+a*b[8];c[1]=d*b[1]+e*b[5]+a*b[9];c[2]=d*b[2]+e*b[6]+a*b[10];return c},transformQuat:function(a,b,c){c=c||new v(3);const d=b[0],e=b[1],f=b[2];b=2*b[3];const g=a[0],h=a[1];a=a[2];const l=e*a-f*h,k=f*g-d*a,m=d*h-e*g;c[0]=g+l*b+2*(e*m-f*k);c[1]=h+k*b+2*(f*l-d*m);c[2]=a+m*b+2*(d*k-e*l);return c},zero:function(a){a= | ||
a||new v(3);a[0]=0;a[1]=0;a[2]=0;return a}});let x=Float32Array,A,D,y;var Db=Object.freeze({__proto__:null,aim:function(a,b,c,d){d=d||new x(16);A=A||H();D=D||H();y=y||H();O(ca(b,a,y),y);O(P(c,y,A),A);O(P(y,A,D),D);d[0]=A[0];d[1]=A[1];d[2]=A[2];d[3]=0;d[4]=D[0];d[5]=D[1];d[6]=D[2];d[7]=0;d[8]=y[0];d[9]=y[1];d[10]=y[2];d[11]=0;d[12]=a[0];d[13]=a[1];d[14]=a[2];d[15]=1;return d},axisRotate:bb,axisRotation:ab,cameraAim:function(a,b,c,d){d=d||new x(16);A=A||H();D=D||H();y=y||H();O(ca(a,b,y),y);O(P(c,y, | ||
A),A);O(P(y,A,D),D);d[0]=A[0];d[1]=A[1];d[2]=A[2];d[3]=0;d[4]=D[0];d[5]=D[1];d[6]=D[2];d[7]=0;d[8]=y[0];d[9]=y[1];d[10]=y[2];d[11]=0;d[12]=a[0];d[13]=a[1];d[14]=a[2];d[15]=1;return d},clone:sa,copy:sa,create:function(a,b,c,d,e,f,g,h,l,k,m,n,q,r,w,u){const p=new x(16);void 0!==a&&(p[0]=a,void 0!==b&&(p[1]=b,void 0!==c&&(p[2]=c,void 0!==d&&(p[3]=d,void 0!==e&&(p[4]=e,void 0!==f&&(p[5]=f,void 0!==g&&(p[6]=g,void 0!==h&&(p[7]=h,void 0!==l&&(p[8]=l,void 0!==k&&(p[9]=k,void 0!==m&&(p[10]=m,void 0!==n&& | ||
(p[11]=n,void 0!==q&&(p[12]=q,void 0!==r&&(p[13]=r,void 0!==w&&(p[14]=w,void 0!==u&&(p[15]=u))))))))))))))));return p},determinant:function(a){const b=a[1];var c=a[2],d=a[3];const e=a[5],f=a[6],g=a[7],h=a[9];var l=a[10],k=a[11];const m=a[13];var n=a[14],q=a[15];const r=l*q,w=n*k,u=f*q,p=n*g,E=f*k,F=l*g;q*=c;n*=d;k*=c;l*=d;c*=g;d*=f;return a[0]*(r*e+p*h+E*m-(w*e+u*h+F*m))+a[4]*(w*b+q*h+l*m-(r*b+n*h+k*m))+a[8]*(u*b+n*e+c*m-(p*b+q*e+d*m))+a[12]*(F*b+k*e+d*h-(E*b+l*e+c*h))},equals:function(a,b){return a[0]=== | ||
b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]&&a[8]===b[8]&&a[9]===b[9]&&a[10]===b[10]&&a[11]===b[11]&&a[12]===b[12]&&a[13]===b[13]&&a[14]===b[14]&&a[15]===b[15]},equalsApproximately:function(a,b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t&&Math.abs(a[2]-b[2])<t&&Math.abs(a[3]-b[3])<t&&Math.abs(a[4]-b[4])<t&&Math.abs(a[5]-b[5])<t&&Math.abs(a[6]-b[6])<t&&Math.abs(a[7]-b[7])<t&&Math.abs(a[8]-b[8])<t&&Math.abs(a[9]-b[9])<t&&Math.abs(a[10]-b[10])< | ||
t&&Math.abs(a[11]-b[11])<t&&Math.abs(a[12]-b[12])<t&&Math.abs(a[13]-b[13])<t&&Math.abs(a[14]-b[14])<t&&Math.abs(a[15]-b[15])<t},fromMat3:function(a,b){b=b||new x(16);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=0;b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=0;b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},fromQuat:function(a,b){b=b||new x(16);var c=a[0],d=a[1],e=a[2];a=a[3];var f=c+c,g=d+d;const h=e+e;c*=f;const l=d*f;d*=g;const k=e*f,m=e*g;e*=h;f*=a;g*=a;a*=h;b[0]=1-d-e;b[1]=l+a;b[2]= | ||
k-g;b[3]=0;b[4]=l-a;b[5]=1-c-e;b[6]=m+f;b[7]=0;b[8]=k+g;b[9]=m-f;b[10]=1-c-d;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},frustum:function(a,b,c,d,e,f,g){g=g||new x(16);const h=b-a,l=d-c,k=e-f;g[0]=2*e/h;g[1]=0;g[2]=0;g[3]=0;g[4]=0;g[5]=2*e/l;g[6]=0;g[7]=0;g[8]=(a+b)/h;g[9]=(d+c)/l;g[10]=f/k;g[11]=-1;g[12]=0;g[13]=0;g[14]=e*f/k;g[15]=0;return g},getAxis:function(a,b,c){c=c||H();b*=4;c[0]=a[b+0];c[1]=a[b+1];c[2]=a[b+2];return c},getScaling:function(a,b){b=b||H();const c=a[0],d=a[1],e=a[2],f=a[4], | ||
g=a[5],h=a[6],l=a[8],k=a[9];a=a[10];b[0]=Math.sqrt(c*c+d*d+e*e);b[1]=Math.sqrt(f*f+g*g+h*h);b[2]=Math.sqrt(l*l+k*k+a*a);return b},getTranslation:function(a,b){b=b||H();b[0]=a[12];b[1]=a[13];b[2]=a[14];return b},identity:Wa,inverse:Xa,invert:Xa,lookAt:function(a,b,c,d){d=d||new x(16);A=A||H();D=D||H();y=y||H();O(ca(a,b,y),y);O(P(c,y,A),A);O(P(y,A,D),D);d[0]=A[0];d[1]=D[0];d[2]=y[0];d[3]=0;d[4]=A[1];d[5]=D[1];d[6]=y[1];d[7]=0;d[8]=A[2];d[9]=D[2];d[10]=y[2];d[11]=0;d[12]=-(A[0]*a[0]+A[1]*a[1]+A[2]*a[2]); | ||
d[13]=-(D[0]*a[0]+D[1]*a[1]+D[2]*a[2]);d[14]=-(y[0]*a[0]+y[1]*a[1]+y[2]*a[2]);d[15]=1;return d},mul:$a,multiply:$a,negate:function(a,b){b=b||new x(16);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];b[4]=-a[4];b[5]=-a[5];b[6]=-a[6];b[7]=-a[7];b[8]=-a[8];b[9]=-a[9];b[10]=-a[10];b[11]=-a[11];b[12]=-a[12];b[13]=-a[13];b[14]=-a[14];b[15]=-a[15];return b},ortho:function(a,b,c,d,e,f,g){g=g||new x(16);g[0]=2/(b-a);g[1]=0;g[2]=0;g[3]=0;g[4]=0;g[5]=2/(d-c);g[6]=0;g[7]=0;g[8]=0;g[9]=0;g[10]=1/(e-f);g[11]=0;g[12]= | ||
(b+a)/(a-b);g[13]=(d+c)/(c-d);g[14]=e/(e-f);g[15]=1;return g},perspective:function(a,b,c,d,e){e=e||new x(16);a=Math.tan(.5*Math.PI-.5*a);e[0]=a/b;e[1]=0;e[2]=0;e[3]=0;e[4]=0;e[5]=a;e[6]=0;e[7]=0;e[8]=0;e[9]=0;e[11]=-1;e[12]=0;e[13]=0;e[15]=0;Infinity===d?(e[10]=-1,e[14]=-c):(b=1/(c-d),e[10]=d*b,e[14]=d*c*b);return e},rotate:bb,rotateX:function(a,b,c){c=c||new x(16);const d=a[4],e=a[5],f=a[6],g=a[7],h=a[8],l=a[9],k=a[10],m=a[11],n=Math.cos(b);b=Math.sin(b);c[4]=n*d+b*h;c[5]=n*e+b*l;c[6]=n*f+b*k;c[7]= | ||
n*g+b*m;c[8]=n*h-b*d;c[9]=n*l-b*e;c[10]=n*k-b*f;c[11]=n*m-b*g;a!==c&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]);return c},rotateY:function(a,b,c){c=c||new x(16);const d=a[0],e=a[1],f=a[2],g=a[3],h=a[8],l=a[9],k=a[10],m=a[11],n=Math.cos(b);b=Math.sin(b);c[0]=n*d-b*h;c[1]=n*e-b*l;c[2]=n*f-b*k;c[3]=n*g-b*m;c[8]=n*h+b*d;c[9]=n*l+b*e;c[10]=n*k+b*f;c[11]=n*m+b*g;a!==c&&(c[4]=a[4],c[5]=a[5],c[6]=a[6],c[7]=a[7],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]); | ||
return c},rotateZ:function(a,b,c){c=c||new x(16);const d=a[0],e=a[1],f=a[2],g=a[3],h=a[4],l=a[5],k=a[6],m=a[7],n=Math.cos(b);b=Math.sin(b);c[0]=n*d+b*h;c[1]=n*e+b*l;c[2]=n*f+b*k;c[3]=n*g+b*m;c[4]=n*h-b*d;c[5]=n*l-b*e;c[6]=n*k-b*f;c[7]=n*m-b*g;a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10],c[11]=a[11],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]);return c},rotation:ab,rotationX:function(a,b){b=b||new x(16);const c=Math.cos(a);a=Math.sin(a);b[0]=1;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=c;b[6]=a;b[7]=0;b[8]=0; | ||
b[9]=-a;b[10]=c;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},rotationY:function(a,b){b=b||new x(16);const c=Math.cos(a);a=Math.sin(a);b[0]=c;b[1]=0;b[2]=-a;b[3]=0;b[4]=0;b[5]=1;b[6]=0;b[7]=0;b[8]=a;b[9]=0;b[10]=c;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},rotationZ:function(a,b){b=b||new x(16);const c=Math.cos(a);a=Math.sin(a);b[0]=c;b[1]=a;b[2]=0;b[3]=0;b[4]=-a;b[5]=c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=1;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},scale:function(a,b,c){c=c||new x(16); | ||
const d=b[0],e=b[1];b=b[2];c[0]=d*a[0];c[1]=d*a[1];c[2]=d*a[2];c[3]=d*a[3];c[4]=e*a[4];c[5]=e*a[5];c[6]=e*a[6];c[7]=e*a[7];c[8]=b*a[8];c[9]=b*a[9];c[10]=b*a[10];c[11]=b*a[11];a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]);return c},scaling:function(a,b){b=b||new x(16);b[0]=a[0];b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=a[1];b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=a[2];b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},set:function(a,b,c,d,e,f,g,h,l,k,m,n,q,r,w,u,p){p=p||new x(16);p[0]=a;p[1]=b;p[2]=c;p[3]= | ||
d;p[4]=e;p[5]=f;p[6]=g;p[7]=h;p[8]=l;p[9]=k;p[10]=m;p[11]=n;p[12]=q;p[13]=r;p[14]=w;p[15]=u;return p},setAxis:function(a,b,c,d){d!==a&&(d=sa(a,d));a=4*c;d[a+0]=b[0];d[a+1]=b[1];d[a+2]=b[2];return d},setDefaultType:Va,setTranslation:function(a,b,c){c=c||Wa();a!==c&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[4]=a[4],c[5]=a[5],c[6]=a[6],c[7]=a[7],c[8]=a[8],c[9]=a[9],c[10]=a[10],c[11]=a[11]);c[12]=b[0];c[13]=b[1];c[14]=b[2];c[15]=1;return c},translate:function(a,b,c){c=c||new x(16);const d=b[0],e=b[1]; | ||
b=b[2];const f=a[0],g=a[1],h=a[2],l=a[3],k=a[4],m=a[5],n=a[6],q=a[7],r=a[8],w=a[9],u=a[10],p=a[11],E=a[12],F=a[13],I=a[14],J=a[15];a!==c&&(c[0]=f,c[1]=g,c[2]=h,c[3]=l,c[4]=k,c[5]=m,c[6]=n,c[7]=q,c[8]=r,c[9]=w,c[10]=u,c[11]=p);c[12]=f*d+k*e+r*b+E;c[13]=g*d+m*e+w*b+F;c[14]=h*d+n*e+u*b+I;c[15]=l*d+q*e+p*b+J;return c},translation:function(a,b){b=b||new x(16);b[0]=1;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=1;b[11]=0;b[12]=a[0];b[13]=a[1];b[14]=a[2];b[15]=1;return b},transpose:function(a, | ||
b){b=b||new x(16);if(b===a){var c=a[1];a[1]=a[4];a[4]=c;c=a[2];a[2]=a[8];a[8]=c;c=a[3];a[3]=a[12];a[12]=c;c=a[6];a[6]=a[9];a[9]=c;c=a[7];a[7]=a[13];a[13]=c;c=a[11];a[11]=a[14];a[14]=c;return b}c=a[1];const d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],l=a[7],k=a[8],m=a[9],n=a[10],q=a[11],r=a[12],w=a[13],u=a[14],p=a[15];b[0]=a[0];b[1]=f;b[2]=k;b[3]=r;b[4]=c;b[5]=g;b[6]=m;b[7]=w;b[8]=d;b[9]=h;b[10]=n;b[11]=u;b[12]=e;b[13]=l;b[14]=q;b[15]=p;return b},uniformScale:function(a,b,c){c=c||new x(16);c[0]=b*a[0];c[1]= | ||
b*a[1];c[2]=b*a[2];c[3]=b*a[3];c[4]=b*a[4];c[5]=b*a[5];c[6]=b*a[6];c[7]=b*a[7];c[8]=b*a[8];c[9]=b*a[9];c[10]=b*a[10];c[11]=b*a[11];a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]);return c},uniformScaling:function(a,b){b=b||new x(16);b[0]=a;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=a;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=a;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b}});let B=Float32Array,N,ta,ua,na,oa;var Eb=Object.freeze({__proto__:null,add:function(a,b,c){c=c||new B(4);c[0]=a[0]+b[0];c[1]=a[1]+ | ||
b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},angle:function(a,b){a=jb(a,b);return Math.acos(2*a*a-1)},clone:gb,conjugate:function(a,b){b=b||new B(4);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b},copy:gb,create:db,divScalar:function(a,b,c){c=c||new B(4);c[0]=a[0]/b;c[1]=a[1]/b;c[2]=a[2]/b;c[3]=a[3]/b;return c},dot:jb,equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]},equalsApproximately:function(a,b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t&&Math.abs(a[2]- | ||
b[2])<t&&Math.abs(a[3]-b[3])<t},fromAxisAngle:eb,fromEuler:function(a,b,c,d,e){e=e||new B(4);a*=.5;var f=.5*b;b=.5*c;c=Math.sin(a);a=Math.cos(a);const g=Math.sin(f);f=Math.cos(f);const h=Math.sin(b);b=Math.cos(b);switch(d){case "xyz":e[0]=c*f*b+a*g*h;e[1]=a*g*b-c*f*h;e[2]=a*f*h+c*g*b;e[3]=a*f*b-c*g*h;break;case "xzy":e[0]=c*f*b-a*g*h;e[1]=a*g*b-c*f*h;e[2]=a*f*h+c*g*b;e[3]=a*f*b+c*g*h;break;case "yxz":e[0]=c*f*b+a*g*h;e[1]=a*g*b-c*f*h;e[2]=a*f*h-c*g*b;e[3]=a*f*b+c*g*h;break;case "yzx":e[0]=c*f*b+a* | ||
g*h;e[1]=a*g*b+c*f*h;e[2]=a*f*h-c*g*b;e[3]=a*f*b-c*g*h;break;case "zxy":e[0]=c*f*b-a*g*h;e[1]=a*g*b+c*f*h;e[2]=a*f*h+c*g*b;e[3]=a*f*b-c*g*h;break;case "zyx":e[0]=c*f*b-a*g*h;e[1]=a*g*b+c*f*h;e[2]=a*f*h-c*g*b;e[3]=a*f*b+c*g*h;break;default:throw Error(`Unknown rotation order: ${d}`);}return e},fromMat:function(a,b){b=b||new B(4);var c=a[0]+a[5]+a[10];if(0<c)c=Math.sqrt(c+1),b[3]=.5*c,c=.5/c,b[0]=(a[6]-a[9])*c,b[1]=(a[8]-a[2])*c,b[2]=(a[1]-a[4])*c;else{c=0;a[5]>a[0]&&(c=1);a[10]>a[4*c+c]&&(c=2);const e= | ||
(c+1)%3,f=(c+2)%3;var d=Math.sqrt(a[4*c+c]-a[4*e+e]-a[4*f+f]+1);b[c]=.5*d;d=.5/d;b[3]=(a[4*e+f]-a[4*f+e])*d;b[e]=(a[4*e+c]+a[4*c+e])*d;b[f]=(a[4*f+c]+a[4*c+f])*d}return b},fromValues:db,identity:function(a){a=a||new B(4);a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a},inverse:function(a,b){b=b||new B(4);const c=a[0],d=a[1],e=a[2];a=a[3];var f=c*c+d*d+e*e+a*a;f=f?1/f:0;b[0]=-c*f;b[1]=-d*f;b[2]=-e*f;b[3]=a*f;return b},len:kb,lenSq:lb,length:kb,lengthSq:lb,lerp:function(a,b,c,d){d=d||new B(4);d[0]=a[0]+c*(b[0]- | ||
a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},mul:fb,mulScalar:ib,multiply:fb,normalize:mb,rotateX:function(a,b,c){c=c||new B(4);var d=.5*b;b=a[0];const e=a[1],f=a[2];a=a[3];const g=Math.sin(d);d=Math.cos(d);c[0]=b*d+a*g;c[1]=e*d+f*g;c[2]=f*d-e*g;c[3]=a*d-b*g;return c},rotateY:function(a,b,c){c=c||new B(4);var d=.5*b;b=a[0];const e=a[1],f=a[2];a=a[3];const g=Math.sin(d);d=Math.cos(d);c[0]=b*d-f*g;c[1]=e*d+a*g;c[2]=f*d+b*g;c[3]=a*d-e*g;return c},rotateZ:function(a, | ||
b,c){c=c||new B(4);var d=.5*b;b=a[0];const e=a[1],f=a[2];a=a[3];const g=Math.sin(d);d=Math.cos(d);c[0]=b*d+e*g;c[1]=e*d-b*g;c[2]=f*d+a*g;c[3]=a*d-f*g;return c},rotationTo:function(a,b,c){c=c||new B(4);N=N||H();ta=ta||H(1,0,0);ua=ua||H(0,1,0);const d=qa(a,b);if(-.999999>d)return P(ta,a,N),1E-6>ra(N)&&P(ua,a,N),O(N,N),eb(N,Math.PI,c),c;if(.999999<d)return c[0]=0,c[1]=0,c[2]=0,c[3]=1,c;P(a,b,N);c[0]=N[0];c[1]=N[1];c[2]=N[2];c[3]=1+d;return mb(c,c)},scale:ib,set:function(a,b,c,d,e){e=e||new B(4);e[0]= | ||
a;e[1]=b;e[2]=c;e[3]=d;return e},setDefaultType:cb,slerp:ma,sqlerp:function(a,b,c,d,e,f){f=f||new B(4);na=na||new B(4);oa=oa||new B(4);ma(a,d,e,na);ma(b,c,e,oa);ma(na,oa,2*e*(1-e),f);return f},sub:hb,subtract:hb,toAxisAngle:function(a,b){b=b||H(4);const c=2*Math.acos(a[3]),d=Math.sin(.5*c);d>t?(b[0]=a[0]/d,b[1]=a[1]/d,b[2]=a[2]/d):(b[0]=1,b[1]=0,b[2]=0);return{angle:c,axis:b}}});let C=Float32Array;var Fb=Object.freeze({__proto__:null,add:function(a,b,c){c=c||new C(4);c[0]=a[0]+b[0];c[1]=a[1]+b[1]; | ||
c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},addScaled:function(a,b,c,d){d=d||new C(4);d[0]=a[0]+b[0]*c;d[1]=a[1]+b[1]*c;d[2]=a[2]+b[2]*c;d[3]=a[3]+b[3]*c;return d},ceil:function(a,b){b=b||new C(4);b[0]=Math.ceil(a[0]);b[1]=Math.ceil(a[1]);b[2]=Math.ceil(a[2]);b[3]=Math.ceil(a[3]);return b},clamp:function(a,b=0,c=1,d){d=d||new C(4);d[0]=Math.min(c,Math.max(b,a[0]));d[1]=Math.min(c,Math.max(b,a[1]));d[2]=Math.min(c,Math.max(b,a[2]));d[3]=Math.min(c,Math.max(b,a[3]));return d},clone:wb,copy:wb,create:ob, | ||
dist:ub,distSq:vb,distance:ub,distanceSq:vb,div:yb,divScalar:function(a,b,c){c=c||new C(4);c[0]=a[0]/b;c[1]=a[1]/b;c[2]=a[2]/b;c[3]=a[3]/b;return c},divide:yb,dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]},equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]},equalsApproximately:function(a,b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t&&Math.abs(a[2]-b[2])<t&&Math.abs(a[3]-b[3])<t},floor:function(a,b){b=b||new C(4);b[0]=Math.floor(a[0]);b[1]=Math.floor(a[1]); | ||
b[2]=Math.floor(a[2]);b[3]=Math.floor(a[3]);return b},fromValues:ob,inverse:rb,invert:rb,len:sb,lenSq:tb,length:sb,lengthSq:tb,lerp:function(a,b,c,d){d=d||new C(4);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},lerpV:function(a,b,c,d){d=d||new C(4);d[0]=a[0]+c[0]*(b[0]-a[0]);d[1]=a[1]+c[1]*(b[1]-a[1]);d[2]=a[2]+c[2]*(b[2]-a[2]);d[3]=a[3]+c[3]*(b[3]-a[3]);return d},max:function(a,b,c){c=c||new C(4);c[0]=Math.max(a[0],b[0]);c[1]=Math.max(a[1], | ||
b[1]);c[2]=Math.max(a[2],b[2]);c[3]=Math.max(a[3],b[3]);return c},min:function(a,b,c){c=c||new C(4);c[0]=Math.min(a[0],b[0]);c[1]=Math.min(a[1],b[1]);c[2]=Math.min(a[2],b[2]);c[3]=Math.min(a[3],b[3]);return c},mul:xb,mulScalar:qb,multiply:xb,negate:function(a,b){b=b||new C(4);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},normalize:function(a,b){b=b||new C(4);const c=a[0],d=a[1],e=a[2];a=a[3];const f=Math.sqrt(c*c+d*d+e*e+a*a);1E-5<f?(b[0]=c/f,b[1]=d/f,b[2]=e/f,b[3]=a/f):(b[0]=0,b[1]=0,b[2]= | ||
0,b[3]=0);return b},round:function(a,b){b=b||new C(4);b[0]=Math.round(a[0]);b[1]=Math.round(a[1]);b[2]=Math.round(a[2]);b[3]=Math.round(a[3]);return b},scale:qb,set:function(a,b,c,d,e){e=e||new C(4);e[0]=a;e[1]=b;e[2]=c;e[3]=d;return e},setDefaultType:nb,sub:pb,subtract:pb,transformMat4:function(a,b,c){c=c||new C(4);const d=a[0],e=a[1],f=a[2];a=a[3];c[0]=b[0]*d+b[4]*e+b[8]*f+b[12]*a;c[1]=b[1]*d+b[5]*e+b[9]*f+b[13]*a;c[2]=b[2]*d+b[6]*e+b[10]*f+b[14]*a;c[3]=b[3]*d+b[7]*e+b[11]*f+b[15]*a;return c},zero:function(a){a= | ||
a||new C(4);a[0]=0;a[1]=0;a[2]=0;a[3]=0;return a}});M.mat3=Bb;M.mat4=Db;M.quat=Eb;M.setDefaultType=function(a){Ha(a);Va(a);cb(a);aa(a);va(a);nb(a)};M.utils=zb;M.vec2=Ab;M.vec3=Cb;M.vec4=Fb}); | ||
/* wgpu-matrix@2.7.0, license MIT */ | ||
(function(M,aa){"object"===typeof exports&&"undefined"!==typeof module?aa(exports):"function"===typeof define&&define.amd?define(["exports"],aa):(M="undefined"!==typeof globalThis?globalThis:M||self,aa(M.wgpuMatrix={}))})(this,function(M){function aa(a){const b=z;z=a;return b}function ba(a=0,b=0){const c=new z(2);void 0!==a&&(c[0]=a,void 0!==b&&(c[1]=b));return c}function ya(a){const b=v;v=a;return b}function H(a,b,c){const d=new v(3);void 0!==a&&(d[0]=a,void 0!==b&&(d[1]=b,void 0!==c&&(d[2]=c))); | ||
return d}function za(a,b,c){c=c||new z(2);c[0]=a[0]-b[0];c[1]=a[1]-b[1];return c}function pa(a,b,c){c=c||new z(2);c[0]=a[0]*b;c[1]=a[1]*b;return c}function Aa(a,b){b=b||new z(2);b[0]=1/a[0];b[1]=1/a[1];return b}function Ba(a,b){return a[0]*b[0]+a[1]*b[1]}function Ca(a){const b=a[0];a=a[1];return Math.sqrt(b*b+a*a)}function Da(a){const b=a[0];a=a[1];return b*b+a*a}function Ea(a,b){const c=a[0]-b[0];a=a[1]-b[1];return Math.sqrt(c*c+a*a)}function Fa(a,b){const c=a[0]-b[0];a=a[1]-b[1];return c*c+a*a} | ||
function Ga(a,b){b=b||new z(2);const c=a[0];a=a[1];const d=Math.sqrt(c*c+a*a);1E-5<d?(b[0]=c/d,b[1]=a/d):(b[0]=0,b[1]=0);return b}function Ha(a,b){b=b||new z(2);b[0]=a[0];b[1]=a[1];return b}function Ia(a,b,c){c=c||new z(2);c[0]=a[0]*b[0];c[1]=a[1]*b[1];return c}function Ja(a,b,c){c=c||new z(2);c[0]=a[0]/b[0];c[1]=a[1]/b[1];return c}function Ka(a){const b=La;La=a;G=Ma.get(a);return b}function qa(a,b){b=b||G();b[0]=a[0];b[1]=a[1];b[2]=a[2];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[8]=a[8];b[9]=a[9];b[10]=a[10]; | ||
return b}function Na(a){a=a||G();a[0]=1;a[1]=0;a[2]=0;a[4]=0;a[5]=1;a[6]=0;a[8]=0;a[9]=0;a[10]=1;return a}function Oa(a,b){b=b||G();const c=a[0],d=a[1],e=a[2],f=a[4],g=a[5],h=a[6],l=a[8],k=a[9];a=a[10];const m=a*g-h*k,n=-a*f+h*l,q=k*f-g*l,r=1/(c*m+d*n+e*q);b[0]=m*r;b[1]=(-a*d+e*k)*r;b[2]=(h*d-e*g)*r;b[4]=n*r;b[5]=(a*c-e*l)*r;b[6]=(-h*c+e*f)*r;b[8]=q*r;b[9]=(-k*c+d*l)*r;b[10]=(g*c-d*f)*r;return b}function Pa(a,b,c){c=c||G();const d=a[0],e=a[1],f=a[2],g=a[4],h=a[5],l=a[6],k=a[8],m=a[9];a=a[10];const n= | ||
b[0],q=b[1],r=b[2],w=b[4],u=b[5],p=b[6],E=b[8],F=b[9];b=b[10];c[0]=d*n+g*q+k*r;c[1]=e*n+h*q+m*r;c[2]=f*n+l*q+a*r;c[4]=d*w+g*u+k*p;c[5]=e*w+h*u+m*p;c[6]=f*w+l*u+a*p;c[8]=d*E+g*F+k*b;c[9]=e*E+h*F+m*b;c[10]=f*E+l*F+a*b;return c}function ca(a,b,c){c=c||new v(3);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];return c}function ra(a,b,c){c=c||new v(3);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;return c}function Qa(a,b){b=b||new v(3);b[0]=1/a[0];b[1]=1/a[1];b[2]=1/a[2];return b}function P(a,b,c){c=c||new v(3);const d= | ||
a[2]*b[0]-a[0]*b[2],e=a[0]*b[1]-a[1]*b[0];c[0]=a[1]*b[2]-a[2]*b[1];c[1]=d;c[2]=e;return c}function sa(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function ta(a){const b=a[0],c=a[1];a=a[2];return Math.sqrt(b*b+c*c+a*a)}function Ra(a){const b=a[0],c=a[1];a=a[2];return b*b+c*c+a*a}function Sa(a,b){const c=a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];return Math.sqrt(c*c+d*d+a*a)}function Ta(a,b){const c=a[0]-b[0],d=a[1]-b[1];a=a[2]-b[2];return c*c+d*d+a*a}function N(a,b){b=b||new v(3);const c=a[0],d=a[1];a=a[2]; | ||
const e=Math.sqrt(c*c+d*d+a*a);1E-5<e?(b[0]=c/e,b[1]=d/e,b[2]=a/e):(b[0]=0,b[1]=0,b[2]=0);return b}function Ua(a,b){b=b||new v(3);b[0]=a[0];b[1]=a[1];b[2]=a[2];return b}function Va(a,b,c){c=c||new v(3);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];return c}function Wa(a,b,c){c=c||new v(3);c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];return c}function Xa(a){const b=x;x=a;return b}function ua(a,b){b=b||new x(16);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8]; | ||
b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return b}function Ya(a){a=a||new x(16);a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return a}function Za(a,b){b=b||new x(16);const c=a[0];var d=a[1];const e=a[2],f=a[3],g=a[4];var h=a[5];const l=a[6],k=a[7],m=a[8],n=a[9],q=a[10],r=a[11],w=a[12];var u=a[13];const p=a[14];a=a[15];const E=q*a,F=p*r,I=l*a,J=p*k,K=l*r,L=q*k,Q=e*a,R=p*f,S=e*r,T=q*f,U= | ||
e*k,V=l*f,W=m*u,X=w*n,Y=g*u,Z=w*h,da=g*n,ea=m*h,fa=c*u,ha=w*d,ia=c*n,ja=m*d,ka=c*h,la=g*d,$a=E*h+J*n+K*u-(F*h+I*n+L*u),ab=F*d+Q*n+T*u-(E*d+R*n+S*u);u=I*d+R*h+U*u-(J*d+Q*h+V*u);d=L*d+S*h+V*n-(K*d+T*h+U*n);h=1/(c*$a+g*ab+m*u+w*d);b[0]=h*$a;b[1]=h*ab;b[2]=h*u;b[3]=h*d;b[4]=h*(F*g+I*m+L*w-(E*g+J*m+K*w));b[5]=h*(E*c+R*m+S*w-(F*c+Q*m+T*w));b[6]=h*(J*c+Q*g+V*w-(I*c+R*g+U*w));b[7]=h*(K*c+T*g+U*m-(L*c+S*g+V*m));b[8]=h*(W*k+Z*r+da*a-(X*k+Y*r+ea*a));b[9]=h*(X*f+fa*r+ja*a-(W*f+ha*r+ia*a));b[10]=h*(Y*f+ha*k+ka* | ||
a-(Z*f+fa*k+la*a));b[11]=h*(ea*f+ia*k+la*r-(da*f+ja*k+ka*r));b[12]=h*(Y*q+ea*p+X*l-(da*p+W*l+Z*q));b[13]=h*(ia*p+W*e+ha*q-(fa*q+ja*p+X*e));b[14]=h*(fa*l+la*p+Z*e-(ka*p+Y*e+ha*l));b[15]=h*(ka*q+da*e+ja*l-(ia*l+la*q+ea*e));return b}function bb(a,b,c){c=c||new x(16);const d=a[0],e=a[1],f=a[2],g=a[3],h=a[4],l=a[5],k=a[6],m=a[7],n=a[8],q=a[9],r=a[10],w=a[11],u=a[12],p=a[13],E=a[14];a=a[15];const F=b[0],I=b[1],J=b[2],K=b[3],L=b[4],Q=b[5],R=b[6],S=b[7],T=b[8],U=b[9],V=b[10],W=b[11],X=b[12],Y=b[13],Z=b[14]; | ||
b=b[15];c[0]=d*F+h*I+n*J+u*K;c[1]=e*F+l*I+q*J+p*K;c[2]=f*F+k*I+r*J+E*K;c[3]=g*F+m*I+w*J+a*K;c[4]=d*L+h*Q+n*R+u*S;c[5]=e*L+l*Q+q*R+p*S;c[6]=f*L+k*Q+r*R+E*S;c[7]=g*L+m*Q+w*R+a*S;c[8]=d*T+h*U+n*V+u*W;c[9]=e*T+l*U+q*V+p*W;c[10]=f*T+k*U+r*V+E*W;c[11]=g*T+m*U+w*V+a*W;c[12]=d*X+h*Y+n*Z+u*b;c[13]=e*X+l*Y+q*Z+p*b;c[14]=f*X+k*Y+r*Z+E*b;c[15]=g*X+m*Y+w*Z+a*b;return c}function cb(a,b,c){c=c||new x(16);let d=a[0],e=a[1];a=a[2];var f=Math.sqrt(d*d+e*e+a*a);d/=f;e/=f;a/=f;f=d*d;const g=e*e,h=a*a,l=Math.cos(b);b= | ||
Math.sin(b);const k=1-l;c[0]=f+(1-f)*l;c[1]=d*e*k+a*b;c[2]=d*a*k-e*b;c[3]=0;c[4]=d*e*k-a*b;c[5]=g+(1-g)*l;c[6]=e*a*k+d*b;c[7]=0;c[8]=d*a*k+e*b;c[9]=e*a*k-d*b;c[10]=h+(1-h)*l;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return c}function db(a,b,c,d){d=d||new x(16);var e=b[0],f=b[1],g=b[2];b=Math.sqrt(e*e+f*f+g*g);e/=b;f/=b;g/=b;b=e*e;var h=f*f,l=g*g,k=Math.cos(c),m=Math.sin(c),n=1-k;c=b+(1-b)*k;b=e*f*n+g*m;const q=e*g*n-f*m,r=e*f*n-g*m;h+=(1-h)*k;const w=f*g*n+e*m,u=e*g*n+f*m;e=f*g*n-e*m;f=l+(1-l)*k;g= | ||
a[0];l=a[1];k=a[2];m=a[3];n=a[4];const p=a[5],E=a[6],F=a[7],I=a[8],J=a[9],K=a[10],L=a[11];d[0]=c*g+b*n+q*I;d[1]=c*l+b*p+q*J;d[2]=c*k+b*E+q*K;d[3]=c*m+b*F+q*L;d[4]=r*g+h*n+w*I;d[5]=r*l+h*p+w*J;d[6]=r*k+h*E+w*K;d[7]=r*m+h*F+w*L;d[8]=u*g+e*n+f*I;d[9]=u*l+e*p+f*J;d[10]=u*k+e*E+f*K;d[11]=u*m+e*F+f*L;a!==d&&(d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]);return d}function eb(a){const b=B;B=a;return b}function fb(a,b,c,d){const e=new B(4);void 0!==a&&(e[0]=a,void 0!==b&&(e[1]=b,void 0!==c&&(e[2]=c,void 0!== | ||
d&&(e[3]=d))));return e}function gb(a,b,c){c=c||new B(4);b*=.5;const d=Math.sin(b);c[0]=d*a[0];c[1]=d*a[1];c[2]=d*a[2];c[3]=Math.cos(b);return c}function hb(a,b,c){c=c||new B(4);const d=a[0],e=a[1],f=a[2];a=a[3];const g=b[0],h=b[1],l=b[2];b=b[3];c[0]=d*b+a*g+e*l-f*h;c[1]=e*b+a*h+f*g-d*l;c[2]=f*b+a*l+d*h-e*g;c[3]=a*b-d*g-e*h-f*l;return c}function ma(a,b,c,d){d=d||new B(4);const e=a[0],f=a[1],g=a[2];a=a[3];let h=b[0],l=b[1],k=b[2];b=b[3];var m=e*h+f*l+g*k+a*b;0>m&&(m=-m,h=-h,l=-l,k=-k,b=-b);if(1-m> | ||
t){const n=Math.acos(m),q=Math.sin(n);m=Math.sin((1-c)*n)/q;c=Math.sin(c*n)/q}else m=1-c;d[0]=m*e+c*h;d[1]=m*f+c*l;d[2]=m*g+c*k;d[3]=m*a+c*b;return d}function ib(a,b){b=b||new B(4);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b}function jb(a,b,c){c=c||new B(4);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c}function kb(a,b,c){c=c||new B(4);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c}function lb(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function mb(a){const b= | ||
a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)}function nb(a){const b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a}function ob(a,b){b=b||new B(4);const c=a[0],d=a[1],e=a[2];a=a[3];const f=Math.sqrt(c*c+d*d+e*e+a*a);1E-5<f?(b[0]=c/f,b[1]=d/f,b[2]=e/f,b[3]=a/f):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b}function pb(a){const b=C;C=a;return b}function qb(a,b,c,d){const e=new C(4);void 0!==a&&(e[0]=a,void 0!==b&&(e[1]=b,void 0!==c&&(e[2]=c,void 0!==d&&(e[3]=d))));return e}function rb(a,b, | ||
c){c=c||new C(4);c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];c[3]=a[3]-b[3];return c}function va(a,b,c){c=c||new C(4);c[0]=a[0]*b;c[1]=a[1]*b;c[2]=a[2]*b;c[3]=a[3]*b;return c}function sb(a,b){b=b||new C(4);b[0]=1/a[0];b[1]=1/a[1];b[2]=1/a[2];b[3]=1/a[3];return b}function tb(a){const b=a[0],c=a[1],d=a[2];a=a[3];return Math.sqrt(b*b+c*c+d*d+a*a)}function ub(a){const b=a[0],c=a[1],d=a[2];a=a[3];return b*b+c*c+d*d+a*a}function vb(a,b){const c=a[0]-b[0],d=a[1]-b[1],e=a[2]-b[2];a=a[3]-b[3];return Math.sqrt(c* | ||
c+d*d+e*e+a*a)}function wb(a,b){const c=a[0]-b[0],d=a[1]-b[1],e=a[2]-b[2];a=a[3]-b[3];return c*c+d*d+e*e+a*a}function xb(a,b){b=b||new C(4);const c=a[0],d=a[1],e=a[2];a=a[3];const f=Math.sqrt(c*c+d*d+e*e+a*a);1E-5<f?(b[0]=c/f,b[1]=d/f,b[2]=e/f,b[3]=a/f):(b[0]=0,b[1]=0,b[2]=0,b[3]=0);return b}function yb(a,b){b=b||new C(4);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b}function zb(a,b,c){c=c||new C(4);c[0]=a[0]*b[0];c[1]=a[1]*b[1];c[2]=a[2]*b[2];c[3]=a[3]*b[3];return c}function Ab(a,b,c){c=c||new C(4); | ||
c[0]=a[0]/b[0];c[1]=a[1]/b[1];c[2]=a[2]/b[2];c[3]=a[3]/b[3];return c}let t=1E-6;var Bb=Object.freeze({__proto__:null,get EPSILON(){return t},degToRad:function(a){return a*Math.PI/180},euclideanModulo:function(a,b){return(a%b+b)%b},inverseLerp:function(a,b,c){return Math.abs(b-a)<t?a:(c-a)/(b-a)},lerp:function(a,b,c){return a+(b-a)*c},radToDeg:function(a){return 180*a/Math.PI},setEpsilon:function(a){const b=t;t=a;return b}});let z=Float32Array,v=Float32Array;var Cb=Object.freeze({__proto__:null,add:function(a, | ||
b,c){c=c||new z(2);c[0]=a[0]+b[0];c[1]=a[1]+b[1];return c},addScaled:function(a,b,c,d){d=d||new z(2);d[0]=a[0]+b[0]*c;d[1]=a[1]+b[1]*c;return d},angle:function(a,b){var c=a[0];const d=a[1],e=a[0],f=a[1];a=(c=Math.sqrt(c*c+d*d)*Math.sqrt(e*e+f*f))&&Ba(a,b)/c;return Math.acos(a)},ceil:function(a,b){b=b||new z(2);b[0]=Math.ceil(a[0]);b[1]=Math.ceil(a[1]);return b},clamp:function(a,b=0,c=1,d){d=d||new z(2);d[0]=Math.min(c,Math.max(b,a[0]));d[1]=Math.min(c,Math.max(b,a[1]));return d},clone:Ha,copy:Ha, | ||
create:ba,cross:function(a,b,c){c=c||new v(3);a=a[0]*b[1]-a[1]*b[0];c[0]=0;c[1]=0;c[2]=a;return c},dist:Ea,distSq:Fa,distance:Ea,distanceSq:Fa,div:Ja,divScalar:function(a,b,c){c=c||new z(2);c[0]=a[0]/b;c[1]=a[1]/b;return c},divide:Ja,dot:Ba,equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]},equalsApproximately:function(a,b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t},floor:function(a,b){b=b||new z(2);b[0]=Math.floor(a[0]);b[1]=Math.floor(a[1]);return b},fromValues:ba,inverse:Aa,invert:Aa, | ||
len:Ca,lenSq:Da,length:Ca,lengthSq:Da,lerp:function(a,b,c,d){d=d||new z(2);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);return d},lerpV:function(a,b,c,d){d=d||new z(2);d[0]=a[0]+c[0]*(b[0]-a[0]);d[1]=a[1]+c[1]*(b[1]-a[1]);return d},max:function(a,b,c){c=c||new z(2);c[0]=Math.max(a[0],b[0]);c[1]=Math.max(a[1],b[1]);return c},min:function(a,b,c){c=c||new z(2);c[0]=Math.min(a[0],b[0]);c[1]=Math.min(a[1],b[1]);return c},mul:Ia,mulScalar:pa,multiply:Ia,negate:function(a,b){b=b||new z(2);b[0]=-a[0]; | ||
b[1]=-a[1];return b},normalize:Ga,random:function(a=1,b){b=b||new z(2);const c=2*Math.random()*Math.PI;b[0]=Math.cos(c)*a;b[1]=Math.sin(c)*a;return b},rotate:function(a,b,c,d){d=d||new z(2);const e=a[0]-b[0];a=a[1]-b[1];const f=Math.sin(c);c=Math.cos(c);d[0]=e*c-a*f+b[0];d[1]=e*f+a*c+b[1];return d},round:function(a,b){b=b||new z(2);b[0]=Math.round(a[0]);b[1]=Math.round(a[1]);return b},scale:pa,set:function(a,b,c){c=c||new z(2);c[0]=a;c[1]=b;return c},setDefaultType:aa,setLength:function(a,b,c){c= | ||
c||new z(2);Ga(a,c);return pa(c,b,c)},sub:za,subtract:za,transformMat3:function(a,b,c){c=c||new z(2);const d=a[0];a=a[1];c[0]=b[0]*d+b[4]*a+b[8];c[1]=b[1]*d+b[5]*a+b[9];return c},transformMat4:function(a,b,c){c=c||new z(2);const d=a[0];a=a[1];c[0]=d*b[0]+a*b[4]+b[12];c[1]=d*b[1]+a*b[5]+b[13];return c},zero:function(a){a=a||new z(2);a[0]=0;a[1]=0;return a}});let La=Float32Array;const Ma=new Map([[Float32Array,()=>new Float32Array(12)],[Float64Array,()=>new Float64Array(12)],[Array,()=>Array(12).fill(0)]]); | ||
let G=Ma.get(Float32Array);var Db=Object.freeze({__proto__:null,clone:qa,copy:qa,create:function(a,b,c,d,e,f,g,h,l){const k=G();k[3]=0;k[7]=0;k[11]=0;void 0!==a&&(k[0]=a,void 0!==b&&(k[1]=b,void 0!==c&&(k[2]=c,void 0!==d&&(k[4]=d,void 0!==e&&(k[5]=e,void 0!==f&&(k[6]=f,void 0!==g&&(k[8]=g,void 0!==h&&(k[9]=h,void 0!==l&&(k[10]=l)))))))));return k},determinant:function(a){const b=a[1],c=a[2],d=a[5],e=a[6],f=a[9],g=a[10];return a[0]*(d*g-f*e)-a[4]*(b*g-f*c)+a[8]*(b*e-d*c)},equals:function(a,b){return a[0]=== | ||
b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[8]===b[8]&&a[9]===b[9]&&a[10]===b[10]},equalsApproximately:function(a,b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t&&Math.abs(a[2]-b[2])<t&&Math.abs(a[4]-b[4])<t&&Math.abs(a[5]-b[5])<t&&Math.abs(a[6]-b[6])<t&&Math.abs(a[8]-b[8])<t&&Math.abs(a[9]-b[9])<t&&Math.abs(a[10]-b[10])<t},fromMat4:function(a,b){b=b||G();b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=0;b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=0;b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]= | ||
0;return b},fromQuat:function(a,b){b=b||G();var c=a[0],d=a[1],e=a[2];a=a[3];var f=c+c,g=d+d;const h=e+e;c*=f;const l=d*f;d*=g;const k=e*f,m=e*g;e*=h;f*=a;g*=a;a*=h;b[0]=1-d-e;b[1]=l+a;b[2]=k-g;b[3]=0;b[4]=l-a;b[5]=1-c-e;b[6]=m+f;b[7]=0;b[8]=k+g;b[9]=m-f;b[10]=1-c-d;b[11]=0;return b},getAxis:function(a,b,c){c=c||ba();b*=4;c[0]=a[b+0];c[1]=a[b+1];return c},getScaling:function(a,b){b=b||ba();const c=a[0],d=a[1],e=a[4];a=a[5];b[0]=Math.sqrt(c*c+d*d);b[1]=Math.sqrt(e*e+a*a);return b},getTranslation:function(a, | ||
b){b=b||ba();b[0]=a[8];b[1]=a[9];return b},identity:Na,inverse:Oa,invert:Oa,mul:Pa,multiply:Pa,negate:function(a,b){b=b||G();b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[4]=-a[4];b[5]=-a[5];b[6]=-a[6];b[8]=-a[8];b[9]=-a[9];b[10]=-a[10];return b},rotate:function(a,b,c){c=c||G();const d=a[0],e=a[1],f=a[2],g=a[4],h=a[5],l=a[6],k=Math.cos(b);b=Math.sin(b);c[0]=k*d+b*g;c[1]=k*e+b*h;c[2]=k*f+b*l;c[4]=k*g-b*d;c[5]=k*h-b*e;c[6]=k*l-b*f;a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10]);return c},rotation:function(a,b){b=b|| | ||
G();const c=Math.cos(a);a=Math.sin(a);b[0]=c;b[1]=a;b[2]=0;b[4]=-a;b[5]=c;b[6]=0;b[8]=0;b[9]=0;b[10]=1;return b},scale:function(a,b,c){c=c||G();const d=b[0];b=b[1];c[0]=d*a[0];c[1]=d*a[1];c[2]=d*a[2];c[4]=b*a[4];c[5]=b*a[5];c[6]=b*a[6];a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10]);return c},scaling:function(a,b){b=b||G();b[0]=a[0];b[1]=0;b[2]=0;b[4]=0;b[5]=a[1];b[6]=0;b[8]=0;b[9]=0;b[10]=1;return b},set:function(a,b,c,d,e,f,g,h,l,k){k=k||G();k[0]=a;k[1]=b;k[2]=c;k[3]=0;k[4]=d;k[5]=e;k[6]=f;k[7]=0;k[8]= | ||
g;k[9]=h;k[10]=l;k[11]=0;return k},setAxis:function(a,b,c,d){d!==a&&(d=qa(a,d));a=4*c;d[a+0]=b[0];d[a+1]=b[1];return d},setDefaultType:Ka,setTranslation:function(a,b,c){c=c||Na();a!==c&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[4]=a[4],c[5]=a[5],c[6]=a[6]);c[8]=b[0];c[9]=b[1];c[10]=1;return c},translate:function(a,b,c){c=c||G();const d=b[0];b=b[1];const e=a[0],f=a[1],g=a[2],h=a[4],l=a[5],k=a[6],m=a[8],n=a[9],q=a[10];a!==c&&(c[0]=e,c[1]=f,c[2]=g,c[4]=h,c[5]=l,c[6]=k);c[8]=e*d+h*b+m;c[9]=f*d+l*b+n;c[10]=g*d+ | ||
k*b+q;return c},translation:function(a,b){b=b||G();b[0]=1;b[1]=0;b[2]=0;b[4]=0;b[5]=1;b[6]=0;b[8]=a[0];b[9]=a[1];b[10]=1;return b},transpose:function(a,b){b=b||G();if(b===a){var c=a[1];a[1]=a[4];a[4]=c;c=a[2];a[2]=a[8];a[8]=c;c=a[6];a[6]=a[9];a[9]=c;return b}c=a[1];const d=a[2],e=a[4],f=a[5],g=a[6],h=a[8],l=a[9],k=a[10];b[0]=a[0];b[1]=e;b[2]=h;b[4]=c;b[5]=f;b[6]=l;b[8]=d;b[9]=g;b[10]=k;return b},uniformScale:function(a,b,c){c=c||G();c[0]=b*a[0];c[1]=b*a[1];c[2]=b*a[2];c[4]=b*a[4];c[5]=b*a[5];c[6]= | ||
b*a[6];a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10]);return c},uniformScaling:function(a,b){b=b||G();b[0]=a;b[1]=0;b[2]=0;b[4]=0;b[5]=a;b[6]=0;b[8]=0;b[9]=0;b[10]=1;return b}}),Eb=Object.freeze({__proto__:null,add:function(a,b,c){c=c||new v(3);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];return c},addScaled:function(a,b,c,d){d=d||new v(3);d[0]=a[0]+b[0]*c;d[1]=a[1]+b[1]*c;d[2]=a[2]+b[2]*c;return d},angle:function(a,b){var c=a[0];const d=a[1],e=a[2],f=a[0],g=a[1],h=a[2];a=(c=Math.sqrt(c*c+d*d+e*e)*Math.sqrt(f* | ||
f+g*g+h*h))&&sa(a,b)/c;return Math.acos(a)},ceil:function(a,b){b=b||new v(3);b[0]=Math.ceil(a[0]);b[1]=Math.ceil(a[1]);b[2]=Math.ceil(a[2]);return b},clamp:function(a,b=0,c=1,d){d=d||new v(3);d[0]=Math.min(c,Math.max(b,a[0]));d[1]=Math.min(c,Math.max(b,a[1]));d[2]=Math.min(c,Math.max(b,a[2]));return d},clone:Ua,copy:Ua,create:H,cross:P,dist:Sa,distSq:Ta,distance:Sa,distanceSq:Ta,div:Wa,divScalar:function(a,b,c){c=c||new v(3);c[0]=a[0]/b;c[1]=a[1]/b;c[2]=a[2]/b;return c},divide:Wa,dot:sa,equals:function(a, | ||
b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]},equalsApproximately:function(a,b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t&&Math.abs(a[2]-b[2])<t},floor:function(a,b){b=b||new v(3);b[0]=Math.floor(a[0]);b[1]=Math.floor(a[1]);b[2]=Math.floor(a[2]);return b},fromValues:H,getAxis:function(a,b,c){c=c||new v(3);b*=4;c[0]=a[b+0];c[1]=a[b+1];c[2]=a[b+2];return c},getScaling:function(a,b){b=b||new v(3);const c=a[0],d=a[1],e=a[2],f=a[4],g=a[5],h=a[6],l=a[8],k=a[9];a=a[10];b[0]=Math.sqrt(c*c+d* | ||
d+e*e);b[1]=Math.sqrt(f*f+g*g+h*h);b[2]=Math.sqrt(l*l+k*k+a*a);return b},getTranslation:function(a,b){b=b||new v(3);b[0]=a[12];b[1]=a[13];b[2]=a[14];return b},inverse:Qa,invert:Qa,len:ta,lenSq:Ra,length:ta,lengthSq:Ra,lerp:function(a,b,c,d){d=d||new v(3);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);return d},lerpV:function(a,b,c,d){d=d||new v(3);d[0]=a[0]+c[0]*(b[0]-a[0]);d[1]=a[1]+c[1]*(b[1]-a[1]);d[2]=a[2]+c[2]*(b[2]-a[2]);return d},max:function(a,b,c){c=c||new v(3);c[0]= | ||
Math.max(a[0],b[0]);c[1]=Math.max(a[1],b[1]);c[2]=Math.max(a[2],b[2]);return c},min:function(a,b,c){c=c||new v(3);c[0]=Math.min(a[0],b[0]);c[1]=Math.min(a[1],b[1]);c[2]=Math.min(a[2],b[2]);return c},mul:Va,mulScalar:ra,multiply:Va,negate:function(a,b){b=b||new v(3);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},normalize:N,random:function(a=1,b){b=b||new v(3);const c=2*Math.random()*Math.PI,d=2*Math.random()-1,e=Math.sqrt(1-d*d)*a;b[0]=Math.cos(c)*e;b[1]=Math.sin(c)*e;b[2]=d*a;return b},rotateX:function(a, | ||
b,c,d){d=d||new v(3);const e=[],f=[];e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];f[0]=e[0];f[1]=e[1]*Math.cos(c)-e[2]*Math.sin(c);f[2]=e[1]*Math.sin(c)+e[2]*Math.cos(c);d[0]=f[0]+b[0];d[1]=f[1]+b[1];d[2]=f[2]+b[2];return d},rotateY:function(a,b,c,d){d=d||new v(3);const e=[],f=[];e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];f[0]=e[2]*Math.sin(c)+e[0]*Math.cos(c);f[1]=e[1];f[2]=e[2]*Math.cos(c)-e[0]*Math.sin(c);d[0]=f[0]+b[0];d[1]=f[1]+b[1];d[2]=f[2]+b[2];return d},rotateZ:function(a,b,c,d){d=d||new v(3); | ||
const e=[],f=[];e[0]=a[0]-b[0];e[1]=a[1]-b[1];e[2]=a[2]-b[2];f[0]=e[0]*Math.cos(c)-e[1]*Math.sin(c);f[1]=e[0]*Math.sin(c)+e[1]*Math.cos(c);f[2]=e[2];d[0]=f[0]+b[0];d[1]=f[1]+b[1];d[2]=f[2]+b[2];return d},round:function(a,b){b=b||new v(3);b[0]=Math.round(a[0]);b[1]=Math.round(a[1]);b[2]=Math.round(a[2]);return b},scale:ra,set:function(a,b,c,d){d=d||new v(3);d[0]=a;d[1]=b;d[2]=c;return d},setDefaultType:ya,setLength:function(a,b,c){c=c||new v(3);N(a,c);return ra(c,b,c)},sub:ca,subtract:ca,transformMat3:function(a, | ||
b,c){c=c||new v(3);const d=a[0],e=a[1];a=a[2];c[0]=d*b[0]+e*b[4]+a*b[8];c[1]=d*b[1]+e*b[5]+a*b[9];c[2]=d*b[2]+e*b[6]+a*b[10];return c},transformMat4:function(a,b,c){c=c||new v(3);const d=a[0],e=a[1];a=a[2];const f=b[3]*d+b[7]*e+b[11]*a+b[15]||1;c[0]=(b[0]*d+b[4]*e+b[8]*a+b[12])/f;c[1]=(b[1]*d+b[5]*e+b[9]*a+b[13])/f;c[2]=(b[2]*d+b[6]*e+b[10]*a+b[14])/f;return c},transformMat4Upper3x3:function(a,b,c){c=c||new v(3);const d=a[0],e=a[1];a=a[2];c[0]=d*b[0]+e*b[4]+a*b[8];c[1]=d*b[1]+e*b[5]+a*b[9];c[2]=d* | ||
b[2]+e*b[6]+a*b[10];return c},transformQuat:function(a,b,c){c=c||new v(3);const d=b[0],e=b[1],f=b[2];b=2*b[3];const g=a[0],h=a[1];a=a[2];const l=e*a-f*h,k=f*g-d*a,m=d*h-e*g;c[0]=g+l*b+2*(e*m-f*k);c[1]=h+k*b+2*(f*l-d*m);c[2]=a+m*b+2*(d*k-e*l);return c},zero:function(a){a=a||new v(3);a[0]=0;a[1]=0;a[2]=0;return a}});let x=Float32Array,A,D,y;var Fb=Object.freeze({__proto__:null,aim:function(a,b,c,d){d=d||new x(16);A=A||H();D=D||H();y=y||H();N(ca(b,a,y),y);N(P(c,y,A),A);N(P(y,A,D),D);d[0]=A[0];d[1]=A[1]; | ||
d[2]=A[2];d[3]=0;d[4]=D[0];d[5]=D[1];d[6]=D[2];d[7]=0;d[8]=y[0];d[9]=y[1];d[10]=y[2];d[11]=0;d[12]=a[0];d[13]=a[1];d[14]=a[2];d[15]=1;return d},axisRotate:db,axisRotation:cb,cameraAim:function(a,b,c,d){d=d||new x(16);A=A||H();D=D||H();y=y||H();N(ca(a,b,y),y);N(P(c,y,A),A);N(P(y,A,D),D);d[0]=A[0];d[1]=A[1];d[2]=A[2];d[3]=0;d[4]=D[0];d[5]=D[1];d[6]=D[2];d[7]=0;d[8]=y[0];d[9]=y[1];d[10]=y[2];d[11]=0;d[12]=a[0];d[13]=a[1];d[14]=a[2];d[15]=1;return d},clone:ua,copy:ua,create:function(a,b,c,d,e,f,g,h,l, | ||
k,m,n,q,r,w,u){const p=new x(16);void 0!==a&&(p[0]=a,void 0!==b&&(p[1]=b,void 0!==c&&(p[2]=c,void 0!==d&&(p[3]=d,void 0!==e&&(p[4]=e,void 0!==f&&(p[5]=f,void 0!==g&&(p[6]=g,void 0!==h&&(p[7]=h,void 0!==l&&(p[8]=l,void 0!==k&&(p[9]=k,void 0!==m&&(p[10]=m,void 0!==n&&(p[11]=n,void 0!==q&&(p[12]=q,void 0!==r&&(p[13]=r,void 0!==w&&(p[14]=w,void 0!==u&&(p[15]=u))))))))))))))));return p},determinant:function(a){const b=a[1];var c=a[2],d=a[3];const e=a[5],f=a[6],g=a[7],h=a[9];var l=a[10],k=a[11];const m= | ||
a[13];var n=a[14],q=a[15];const r=l*q,w=n*k,u=f*q,p=n*g,E=f*k,F=l*g;q*=c;n*=d;k*=c;l*=d;c*=g;d*=f;return a[0]*(r*e+p*h+E*m-(w*e+u*h+F*m))+a[4]*(w*b+q*h+l*m-(r*b+n*h+k*m))+a[8]*(u*b+n*e+c*m-(p*b+q*e+d*m))+a[12]*(F*b+k*e+d*h-(E*b+l*e+c*h))},equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]&&a[8]===b[8]&&a[9]===b[9]&&a[10]===b[10]&&a[11]===b[11]&&a[12]===b[12]&&a[13]===b[13]&&a[14]===b[14]&&a[15]===b[15]},equalsApproximately:function(a, | ||
b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t&&Math.abs(a[2]-b[2])<t&&Math.abs(a[3]-b[3])<t&&Math.abs(a[4]-b[4])<t&&Math.abs(a[5]-b[5])<t&&Math.abs(a[6]-b[6])<t&&Math.abs(a[7]-b[7])<t&&Math.abs(a[8]-b[8])<t&&Math.abs(a[9]-b[9])<t&&Math.abs(a[10]-b[10])<t&&Math.abs(a[11]-b[11])<t&&Math.abs(a[12]-b[12])<t&&Math.abs(a[13]-b[13])<t&&Math.abs(a[14]-b[14])<t&&Math.abs(a[15]-b[15])<t},fromMat3:function(a,b){b=b||new x(16);b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=0;b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=0; | ||
b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},fromQuat:function(a,b){b=b||new x(16);var c=a[0],d=a[1],e=a[2];a=a[3];var f=c+c,g=d+d;const h=e+e;c*=f;const l=d*f;d*=g;const k=e*f,m=e*g;e*=h;f*=a;g*=a;a*=h;b[0]=1-d-e;b[1]=l+a;b[2]=k-g;b[3]=0;b[4]=l-a;b[5]=1-c-e;b[6]=m+f;b[7]=0;b[8]=k+g;b[9]=m-f;b[10]=1-c-d;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},frustum:function(a,b,c,d,e,f,g){g=g||new x(16);const h=b-a,l=d-c,k=e-f;g[0]=2*e/h;g[1]=0;g[2]=0;g[3]=0;g[4]=0; | ||
g[5]=2*e/l;g[6]=0;g[7]=0;g[8]=(a+b)/h;g[9]=(d+c)/l;g[10]=f/k;g[11]=-1;g[12]=0;g[13]=0;g[14]=e*f/k;g[15]=0;return g},getAxis:function(a,b,c){c=c||H();b*=4;c[0]=a[b+0];c[1]=a[b+1];c[2]=a[b+2];return c},getScaling:function(a,b){b=b||H();const c=a[0],d=a[1],e=a[2],f=a[4],g=a[5],h=a[6],l=a[8],k=a[9];a=a[10];b[0]=Math.sqrt(c*c+d*d+e*e);b[1]=Math.sqrt(f*f+g*g+h*h);b[2]=Math.sqrt(l*l+k*k+a*a);return b},getTranslation:function(a,b){b=b||H();b[0]=a[12];b[1]=a[13];b[2]=a[14];return b},identity:Ya,inverse:Za, | ||
invert:Za,lookAt:function(a,b,c,d){d=d||new x(16);A=A||H();D=D||H();y=y||H();N(ca(a,b,y),y);N(P(c,y,A),A);N(P(y,A,D),D);d[0]=A[0];d[1]=D[0];d[2]=y[0];d[3]=0;d[4]=A[1];d[5]=D[1];d[6]=y[1];d[7]=0;d[8]=A[2];d[9]=D[2];d[10]=y[2];d[11]=0;d[12]=-(A[0]*a[0]+A[1]*a[1]+A[2]*a[2]);d[13]=-(D[0]*a[0]+D[1]*a[1]+D[2]*a[2]);d[14]=-(y[0]*a[0]+y[1]*a[1]+y[2]*a[2]);d[15]=1;return d},mul:bb,multiply:bb,negate:function(a,b){b=b||new x(16);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];b[4]=-a[4];b[5]=-a[5];b[6]=-a[6];b[7]= | ||
-a[7];b[8]=-a[8];b[9]=-a[9];b[10]=-a[10];b[11]=-a[11];b[12]=-a[12];b[13]=-a[13];b[14]=-a[14];b[15]=-a[15];return b},ortho:function(a,b,c,d,e,f,g){g=g||new x(16);g[0]=2/(b-a);g[1]=0;g[2]=0;g[3]=0;g[4]=0;g[5]=2/(d-c);g[6]=0;g[7]=0;g[8]=0;g[9]=0;g[10]=1/(e-f);g[11]=0;g[12]=(b+a)/(a-b);g[13]=(d+c)/(c-d);g[14]=e/(e-f);g[15]=1;return g},perspective:function(a,b,c,d,e){e=e||new x(16);a=Math.tan(.5*Math.PI-.5*a);e[0]=a/b;e[1]=0;e[2]=0;e[3]=0;e[4]=0;e[5]=a;e[6]=0;e[7]=0;e[8]=0;e[9]=0;e[11]=-1;e[12]=0;e[13]= | ||
0;e[15]=0;Infinity===d?(e[10]=-1,e[14]=-c):(b=1/(c-d),e[10]=d*b,e[14]=d*c*b);return e},rotate:db,rotateX:function(a,b,c){c=c||new x(16);const d=a[4],e=a[5],f=a[6],g=a[7],h=a[8],l=a[9],k=a[10],m=a[11],n=Math.cos(b);b=Math.sin(b);c[4]=n*d+b*h;c[5]=n*e+b*l;c[6]=n*f+b*k;c[7]=n*g+b*m;c[8]=n*h-b*d;c[9]=n*l-b*e;c[10]=n*k-b*f;c[11]=n*m-b*g;a!==c&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]);return c},rotateY:function(a,b,c){c=c||new x(16);const d=a[0],e=a[1],f= | ||
a[2],g=a[3],h=a[8],l=a[9],k=a[10],m=a[11],n=Math.cos(b);b=Math.sin(b);c[0]=n*d-b*h;c[1]=n*e-b*l;c[2]=n*f-b*k;c[3]=n*g-b*m;c[8]=n*h+b*d;c[9]=n*l+b*e;c[10]=n*k+b*f;c[11]=n*m+b*g;a!==c&&(c[4]=a[4],c[5]=a[5],c[6]=a[6],c[7]=a[7],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]);return c},rotateZ:function(a,b,c){c=c||new x(16);const d=a[0],e=a[1],f=a[2],g=a[3],h=a[4],l=a[5],k=a[6],m=a[7],n=Math.cos(b);b=Math.sin(b);c[0]=n*d+b*h;c[1]=n*e+b*l;c[2]=n*f+b*k;c[3]=n*g+b*m;c[4]=n*h-b*d;c[5]=n*l-b*e;c[6]=n*k-b* | ||
f;c[7]=n*m-b*g;a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10],c[11]=a[11],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]);return c},rotation:cb,rotationX:function(a,b){b=b||new x(16);const c=Math.cos(a);a=Math.sin(a);b[0]=1;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=c;b[6]=a;b[7]=0;b[8]=0;b[9]=-a;b[10]=c;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},rotationY:function(a,b){b=b||new x(16);const c=Math.cos(a);a=Math.sin(a);b[0]=c;b[1]=0;b[2]=-a;b[3]=0;b[4]=0;b[5]=1;b[6]=0;b[7]=0;b[8]=a;b[9]=0;b[10]=c;b[11]=0;b[12]= | ||
0;b[13]=0;b[14]=0;b[15]=1;return b},rotationZ:function(a,b){b=b||new x(16);const c=Math.cos(a);a=Math.sin(a);b[0]=c;b[1]=a;b[2]=0;b[3]=0;b[4]=-a;b[5]=c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=1;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},scale:function(a,b,c){c=c||new x(16);const d=b[0],e=b[1];b=b[2];c[0]=d*a[0];c[1]=d*a[1];c[2]=d*a[2];c[3]=d*a[3];c[4]=e*a[4];c[5]=e*a[5];c[6]=e*a[6];c[7]=e*a[7];c[8]=b*a[8];c[9]=b*a[9];c[10]=b*a[10];c[11]=b*a[11];a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]); | ||
return c},scaling:function(a,b){b=b||new x(16);b[0]=a[0];b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=a[1];b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=a[2];b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b},set:function(a,b,c,d,e,f,g,h,l,k,m,n,q,r,w,u,p){p=p||new x(16);p[0]=a;p[1]=b;p[2]=c;p[3]=d;p[4]=e;p[5]=f;p[6]=g;p[7]=h;p[8]=l;p[9]=k;p[10]=m;p[11]=n;p[12]=q;p[13]=r;p[14]=w;p[15]=u;return p},setAxis:function(a,b,c,d){d!==a&&(d=ua(a,d));a=4*c;d[a+0]=b[0];d[a+1]=b[1];d[a+2]=b[2];return d},setDefaultType:Xa,setTranslation:function(a, | ||
b,c){c=c||Ya();a!==c&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[4]=a[4],c[5]=a[5],c[6]=a[6],c[7]=a[7],c[8]=a[8],c[9]=a[9],c[10]=a[10],c[11]=a[11]);c[12]=b[0];c[13]=b[1];c[14]=b[2];c[15]=1;return c},translate:function(a,b,c){c=c||new x(16);const d=b[0],e=b[1];b=b[2];const f=a[0],g=a[1],h=a[2],l=a[3],k=a[4],m=a[5],n=a[6],q=a[7],r=a[8],w=a[9],u=a[10],p=a[11],E=a[12],F=a[13],I=a[14],J=a[15];a!==c&&(c[0]=f,c[1]=g,c[2]=h,c[3]=l,c[4]=k,c[5]=m,c[6]=n,c[7]=q,c[8]=r,c[9]=w,c[10]=u,c[11]=p);c[12]=f*d+k*e+r* | ||
b+E;c[13]=g*d+m*e+w*b+F;c[14]=h*d+n*e+u*b+I;c[15]=l*d+q*e+p*b+J;return c},translation:function(a,b){b=b||new x(16);b[0]=1;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=1;b[11]=0;b[12]=a[0];b[13]=a[1];b[14]=a[2];b[15]=1;return b},transpose:function(a,b){b=b||new x(16);if(b===a){var c=a[1];a[1]=a[4];a[4]=c;c=a[2];a[2]=a[8];a[8]=c;c=a[3];a[3]=a[12];a[12]=c;c=a[6];a[6]=a[9];a[9]=c;c=a[7];a[7]=a[13];a[13]=c;c=a[11];a[11]=a[14];a[14]=c;return b}c=a[1];const d=a[2],e=a[3],f=a[4],g= | ||
a[5],h=a[6],l=a[7],k=a[8],m=a[9],n=a[10],q=a[11],r=a[12],w=a[13],u=a[14],p=a[15];b[0]=a[0];b[1]=f;b[2]=k;b[3]=r;b[4]=c;b[5]=g;b[6]=m;b[7]=w;b[8]=d;b[9]=h;b[10]=n;b[11]=u;b[12]=e;b[13]=l;b[14]=q;b[15]=p;return b},uniformScale:function(a,b,c){c=c||new x(16);c[0]=b*a[0];c[1]=b*a[1];c[2]=b*a[2];c[3]=b*a[3];c[4]=b*a[4];c[5]=b*a[5];c[6]=b*a[6];c[7]=b*a[7];c[8]=b*a[8];c[9]=b*a[9];c[10]=b*a[10];c[11]=b*a[11];a!==c&&(c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]);return c},uniformScaling:function(a,b){b= | ||
b||new x(16);b[0]=a;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=a;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=a;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b}});let B=Float32Array,O,wa,xa,na,oa;var Gb=Object.freeze({__proto__:null,add:function(a,b,c){c=c||new B(4);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},angle:function(a,b){a=lb(a,b);return Math.acos(2*a*a-1)},clone:ib,conjugate:function(a,b){b=b||new B(4);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=a[3];return b},copy:ib,create:fb,divScalar:function(a, | ||
b,c){c=c||new B(4);c[0]=a[0]/b;c[1]=a[1]/b;c[2]=a[2]/b;c[3]=a[3]/b;return c},dot:lb,equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]},equalsApproximately:function(a,b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t&&Math.abs(a[2]-b[2])<t&&Math.abs(a[3]-b[3])<t},fromAxisAngle:gb,fromEuler:function(a,b,c,d,e){e=e||new B(4);a*=.5;var f=.5*b;b=.5*c;c=Math.sin(a);a=Math.cos(a);const g=Math.sin(f);f=Math.cos(f);const h=Math.sin(b);b=Math.cos(b);switch(d){case "xyz":e[0]= | ||
c*f*b+a*g*h;e[1]=a*g*b-c*f*h;e[2]=a*f*h+c*g*b;e[3]=a*f*b-c*g*h;break;case "xzy":e[0]=c*f*b-a*g*h;e[1]=a*g*b-c*f*h;e[2]=a*f*h+c*g*b;e[3]=a*f*b+c*g*h;break;case "yxz":e[0]=c*f*b+a*g*h;e[1]=a*g*b-c*f*h;e[2]=a*f*h-c*g*b;e[3]=a*f*b+c*g*h;break;case "yzx":e[0]=c*f*b+a*g*h;e[1]=a*g*b+c*f*h;e[2]=a*f*h-c*g*b;e[3]=a*f*b-c*g*h;break;case "zxy":e[0]=c*f*b-a*g*h;e[1]=a*g*b+c*f*h;e[2]=a*f*h+c*g*b;e[3]=a*f*b-c*g*h;break;case "zyx":e[0]=c*f*b-a*g*h;e[1]=a*g*b+c*f*h;e[2]=a*f*h-c*g*b;e[3]=a*f*b+c*g*h;break;default:throw Error(`Unknown rotation order: ${d}`); | ||
}return e},fromMat:function(a,b){b=b||new B(4);var c=a[0]+a[5]+a[10];if(0<c)c=Math.sqrt(c+1),b[3]=.5*c,c=.5/c,b[0]=(a[6]-a[9])*c,b[1]=(a[8]-a[2])*c,b[2]=(a[1]-a[4])*c;else{c=0;a[5]>a[0]&&(c=1);a[10]>a[4*c+c]&&(c=2);const e=(c+1)%3,f=(c+2)%3;var d=Math.sqrt(a[4*c+c]-a[4*e+e]-a[4*f+f]+1);b[c]=.5*d;d=.5/d;b[3]=(a[4*e+f]-a[4*f+e])*d;b[e]=(a[4*e+c]+a[4*c+e])*d;b[f]=(a[4*f+c]+a[4*c+f])*d}return b},fromValues:fb,identity:function(a){a=a||new B(4);a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a},inverse:function(a, | ||
b){b=b||new B(4);const c=a[0],d=a[1],e=a[2];a=a[3];var f=c*c+d*d+e*e+a*a;f=f?1/f:0;b[0]=-c*f;b[1]=-d*f;b[2]=-e*f;b[3]=a*f;return b},len:mb,lenSq:nb,length:mb,lengthSq:nb,lerp:function(a,b,c,d){d=d||new B(4);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d},mul:hb,mulScalar:kb,multiply:hb,normalize:ob,rotateX:function(a,b,c){c=c||new B(4);var d=.5*b;b=a[0];const e=a[1],f=a[2];a=a[3];const g=Math.sin(d);d=Math.cos(d);c[0]=b*d+a*g;c[1]=e*d+f*g; | ||
c[2]=f*d-e*g;c[3]=a*d-b*g;return c},rotateY:function(a,b,c){c=c||new B(4);var d=.5*b;b=a[0];const e=a[1],f=a[2];a=a[3];const g=Math.sin(d);d=Math.cos(d);c[0]=b*d-f*g;c[1]=e*d+a*g;c[2]=f*d+b*g;c[3]=a*d-e*g;return c},rotateZ:function(a,b,c){c=c||new B(4);var d=.5*b;b=a[0];const e=a[1],f=a[2];a=a[3];const g=Math.sin(d);d=Math.cos(d);c[0]=b*d+e*g;c[1]=e*d-b*g;c[2]=f*d+a*g;c[3]=a*d-f*g;return c},rotationTo:function(a,b,c){c=c||new B(4);O=O||H();wa=wa||H(1,0,0);xa=xa||H(0,1,0);const d=sa(a,b);if(-.999999> | ||
d)return P(wa,a,O),1E-6>ta(O)&&P(xa,a,O),N(O,O),gb(O,Math.PI,c),c;if(.999999<d)return c[0]=0,c[1]=0,c[2]=0,c[3]=1,c;P(a,b,O);c[0]=O[0];c[1]=O[1];c[2]=O[2];c[3]=1+d;return ob(c,c)},scale:kb,set:function(a,b,c,d,e){e=e||new B(4);e[0]=a;e[1]=b;e[2]=c;e[3]=d;return e},setDefaultType:eb,slerp:ma,sqlerp:function(a,b,c,d,e,f){f=f||new B(4);na=na||new B(4);oa=oa||new B(4);ma(a,d,e,na);ma(b,c,e,oa);ma(na,oa,2*e*(1-e),f);return f},sub:jb,subtract:jb,toAxisAngle:function(a,b){b=b||H(4);const c=2*Math.acos(a[3]), | ||
d=Math.sin(.5*c);d>t?(b[0]=a[0]/d,b[1]=a[1]/d,b[2]=a[2]/d):(b[0]=1,b[1]=0,b[2]=0);return{angle:c,axis:b}}});let C=Float32Array;var Hb=Object.freeze({__proto__:null,add:function(a,b,c){c=c||new C(4);c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];c[3]=a[3]+b[3];return c},addScaled:function(a,b,c,d){d=d||new C(4);d[0]=a[0]+b[0]*c;d[1]=a[1]+b[1]*c;d[2]=a[2]+b[2]*c;d[3]=a[3]+b[3]*c;return d},ceil:function(a,b){b=b||new C(4);b[0]=Math.ceil(a[0]);b[1]=Math.ceil(a[1]);b[2]=Math.ceil(a[2]);b[3]=Math.ceil(a[3]); | ||
return b},clamp:function(a,b=0,c=1,d){d=d||new C(4);d[0]=Math.min(c,Math.max(b,a[0]));d[1]=Math.min(c,Math.max(b,a[1]));d[2]=Math.min(c,Math.max(b,a[2]));d[3]=Math.min(c,Math.max(b,a[3]));return d},clone:yb,copy:yb,create:qb,dist:vb,distSq:wb,distance:vb,distanceSq:wb,div:Ab,divScalar:function(a,b,c){c=c||new C(4);c[0]=a[0]/b;c[1]=a[1]/b;c[2]=a[2]/b;c[3]=a[3]/b;return c},divide:Ab,dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]},equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]&& | ||
a[2]===b[2]&&a[3]===b[3]},equalsApproximately:function(a,b){return Math.abs(a[0]-b[0])<t&&Math.abs(a[1]-b[1])<t&&Math.abs(a[2]-b[2])<t&&Math.abs(a[3]-b[3])<t},floor:function(a,b){b=b||new C(4);b[0]=Math.floor(a[0]);b[1]=Math.floor(a[1]);b[2]=Math.floor(a[2]);b[3]=Math.floor(a[3]);return b},fromValues:qb,inverse:sb,invert:sb,len:tb,lenSq:ub,length:tb,lengthSq:ub,lerp:function(a,b,c,d){d=d||new C(4);d[0]=a[0]+c*(b[0]-a[0]);d[1]=a[1]+c*(b[1]-a[1]);d[2]=a[2]+c*(b[2]-a[2]);d[3]=a[3]+c*(b[3]-a[3]);return d}, | ||
lerpV:function(a,b,c,d){d=d||new C(4);d[0]=a[0]+c[0]*(b[0]-a[0]);d[1]=a[1]+c[1]*(b[1]-a[1]);d[2]=a[2]+c[2]*(b[2]-a[2]);d[3]=a[3]+c[3]*(b[3]-a[3]);return d},max:function(a,b,c){c=c||new C(4);c[0]=Math.max(a[0],b[0]);c[1]=Math.max(a[1],b[1]);c[2]=Math.max(a[2],b[2]);c[3]=Math.max(a[3],b[3]);return c},min:function(a,b,c){c=c||new C(4);c[0]=Math.min(a[0],b[0]);c[1]=Math.min(a[1],b[1]);c[2]=Math.min(a[2],b[2]);c[3]=Math.min(a[3],b[3]);return c},mul:zb,mulScalar:va,multiply:zb,negate:function(a,b){b=b|| | ||
new C(4);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b},normalize:xb,round:function(a,b){b=b||new C(4);b[0]=Math.round(a[0]);b[1]=Math.round(a[1]);b[2]=Math.round(a[2]);b[3]=Math.round(a[3]);return b},scale:va,set:function(a,b,c,d,e){e=e||new C(4);e[0]=a;e[1]=b;e[2]=c;e[3]=d;return e},setDefaultType:pb,setLength:function(a,b,c){c=c||new C(4);xb(a,c);return va(c,b,c)},sub:rb,subtract:rb,transformMat4:function(a,b,c){c=c||new C(4);const d=a[0],e=a[1],f=a[2];a=a[3];c[0]=b[0]*d+b[4]*e+b[8]*f+b[12]* | ||
a;c[1]=b[1]*d+b[5]*e+b[9]*f+b[13]*a;c[2]=b[2]*d+b[6]*e+b[10]*f+b[14]*a;c[3]=b[3]*d+b[7]*e+b[11]*f+b[15]*a;return c},zero:function(a){a=a||new C(4);a[0]=0;a[1]=0;a[2]=0;a[3]=0;return a}});M.mat3=Db;M.mat4=Fb;M.quat=Gb;M.setDefaultType=function(a){Ka(a);Xa(a);eb(a);aa(a);ya(a);pb(a)};M.utils=Bb;M.vec2=Cb;M.vec3=Eb;M.vec4=Hb}); |
{ | ||
"name": "wgpu-matrix", | ||
"version": "2.6.1", | ||
"version": "2.7.0", | ||
"description": "fast matrix math library for WebGPU", | ||
@@ -5,0 +5,0 @@ "main": "dist/2.x/wgpu-matrix.module.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1155648
13716