wgpu-matrix
Advanced tools
Comparing version 2.4.2 to 2.5.0
@@ -6,3 +6,3 @@ import { Quat } from './quat'; | ||
export default Mat3; | ||
export type Mat3LikeCtor = new (n: number) => Mat3; | ||
export declare type Mat3LikeCtor = new (n: number) => Mat3; | ||
/** | ||
@@ -257,1 +257,17 @@ * Sets the type this library creates for a Mat3 | ||
export declare function scale(m: Mat3, v: Vec2, dst?: Mat3): Mat3; | ||
/** | ||
* Creates a 3-by-3 matrix which scales uniformly in each dimension | ||
* @param s - Amount to scale | ||
* @param dst - matrix to hold result. If not passed a new one is created. | ||
* @returns The scaling matrix. | ||
*/ | ||
export declare function uniformScaling(s: number, dst?: Mat3): Mat3; | ||
/** | ||
* Scales the given 3-by-3 matrix in each dimension by an amount | ||
* given. | ||
* @param m - The matrix to be modified. | ||
* @param s - Amount to scale. | ||
* @param dst - matrix to hold result. If not passed a new one is created. | ||
* @returns The scaled matrix. | ||
*/ | ||
export declare function uniformScale(m: Mat3, s: number, dst?: Mat3): Mat3; |
@@ -6,2 +6,2 @@ /** | ||
*/ | ||
export type Mat3 = number[] | Float32Array | Float64Array; | ||
export declare type Mat3 = number[] | Float32Array | Float64Array; |
@@ -6,3 +6,3 @@ import { Mat3 } from './mat3'; | ||
export default Mat4; | ||
export type Mat4LikeCtor = new (n: number) => Mat4; | ||
export declare type Mat4LikeCtor = new (n: number) => Mat4; | ||
/** | ||
@@ -454,1 +454,16 @@ * Sets the type this library creates for a Mat4 | ||
export declare function scale(m: Mat4, v: Vec3, dst?: Mat4): Mat4; | ||
/** | ||
* Creates a 4-by-4 matrix which scales a uniform amount in each dimension. | ||
* @param s - the amount to scale | ||
* @param dst - matrix to hold result. If not passed a new one is created. | ||
* @returns The scaling matrix. | ||
*/ | ||
export declare function uniformScaling(s: number, dst?: Mat4): Mat4; | ||
/** | ||
* Scales the given 4-by-4 matrix in each dimension by a uniform scale. | ||
* @param m - The matrix to be modified. | ||
* @param s - The amount to scale. | ||
* @param dst - matrix to hold result. If not passed a new one is created. | ||
* @returns The scaled matrix. | ||
*/ | ||
export declare function uniformScale(m: Mat4, s: number, dst?: Mat4): Mat4; |
@@ -6,2 +6,2 @@ /** | ||
*/ | ||
export type Mat4 = number[] | Float32Array | Float64Array; | ||
export declare type Mat4 = number[] | Float32Array | Float64Array; |
@@ -5,3 +5,3 @@ import { Quat, create, setDefaultType } from './quat'; | ||
import { Vec3 } from './vec3.js'; | ||
export type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx'; | ||
export declare type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx'; | ||
export default Quat; | ||
@@ -8,0 +8,0 @@ export { create, setDefaultType }; |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
export type Quat = number[] | Float32Array | Float64Array; | ||
export declare type Quat = number[] | Float32Array | Float64Array; | ||
/** | ||
@@ -9,0 +9,0 @@ * |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
export type Vec2 = number[] | Float32Array | Float64Array; | ||
export declare type Vec2 = number[] | Float32Array | Float64Array; | ||
/** | ||
@@ -9,0 +9,0 @@ * |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
export type Vec3 = number[] | Float32Array | Float64Array; | ||
export declare type Vec3 = number[] | Float32Array | Float64Array; | ||
/** | ||
@@ -9,0 +9,0 @@ * |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
export type Vec4 = number[] | Float32Array | Float64Array; | ||
export declare type Vec4 = number[] | Float32Array | Float64Array; | ||
/** | ||
@@ -9,0 +9,0 @@ * |
@@ -1,6 +0,6 @@ | ||
/* wgpu-matrix@2.4.2, license MIT */ | ||
/* wgpu-matrix@2.5.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 va(a,b,c){c=c||new z(2);c[0]=a[0]-b[0];c[1]=a[1]-b[1];return c}function wa(a,b,c){c=c||new z(2);c[0]=a[0]*b;c[1]=a[1]*b;return c} | ||
function xa(a,b){b=b||new z(2);b[0]=1/a[0];b[1]=1/a[1];return b}function ya(a,b){return a[0]*b[0]+a[1]*b[1]}function za(a){const b=a[0];a=a[1];return Math.sqrt(b*b+a*a)}function Aa(a){const b=a[0];a=a[1];return b*b+a*a}function Ba(a,b){const c=a[0]-b[0];a=a[1]-b[1];return Math.sqrt(c*c+a*a)}function Ca(a,b){const c=a[0]-b[0];a=a[1]-b[1];return c*c+a*a}function Da(a,b){b=b||new z(2);b[0]=a[0];b[1]=a[1];return b}function Ea(a,b,c){c=c||new z(2);c[0]=a[0]*b[0];c[1]=a[1]*b[1];return c}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){const b=Ha;Ha=a;H=Ia.get(a);return b}function pa(a,b){b=b||H();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 Ja(a){a=a||H();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 Ka(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];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 La(a,b,c){c=c||H();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],v=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*v+g*u+k*p;c[5]=e*v+h*u+m*p;c[6]=f*v+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 Ma(a){const b=w;w=a;return b}function G(a, | ||
c){c=c||new z(2);c[0]=a[0]/b[0];c[1]=a[1]/b[1];return c}function Ga(a){const b=Ha;Ha=a;G=Ia.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 Ja(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 Ka(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 La(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],v=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*v+g*u+k*p;c[5]=e*v+h*u+m*p;c[6]=f*v+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 Ma(a){const b=w;w=a;return b}function H(a, | ||
b,c){const d=new w(3);void 0!==a&&(d[0]=a,void 0!==b&&(d[1]=b,void 0!==c&&(d[2]=c)));return d}function ca(a,b,c){c=c||new w(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 w(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 w(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 w(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]* | ||
@@ -19,50 +19,51 @@ 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 w(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 w(3); | ||
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;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))&&ya(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:Da,copy:Da,create:ba,cross:function(a,b,c){c=c||new z(3);a=a[0]*b[1]-a[1]*b[0];c[0]=0;c[1]=0;c[2]=a;return c},dist:Ba,distSq:Ca,distance:Ba,distanceSq:Ca,div:Fa,divScalar:function(a,b,c){c=c||new z(2);c[0]=a[0]/b;c[1]=a[1]/b;return c},divide:Fa,dot:ya,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:xa,invert:xa,len:za,lenSq:Aa,length:za,lengthSq:Aa,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:Ea,mulScalar:wa,multiply:Ea,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},round:function(a,b){b=b||new z(2);b[0]=Math.round(a[0]); | ||
b[1]=Math.round(a[1]);return b},scale:wa,set:function(a,b,c){c=c||new z(2);c[0]=a;c[1]=b;return c},setDefaultType:aa,sub:va,subtract:va,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 Ha=Float32Array;const Ia=new Map([[Float32Array,()=>new Float32Array(12)], | ||
[Float64Array,()=>new Float64Array(12)],[Array,()=>Array(12).fill(0)]]);let H=Ia.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=H();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||H();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||H();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:Ja,inverse:Ka,invert:Ka,mul:La,multiply:La,negate:function(a,b){b=b||H();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||H();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||H();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||H();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||H();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||H();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:Ga,setTranslation:function(a,b,c){c=c||Ja();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||H();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||H();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||H();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}});let w=Float32Array; | ||
var Cb=Object.freeze({__proto__:null,add:function(a,b,c){c=c||new w(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 w(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 w(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 w(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:G,cross:P,dist:Qa,distSq:Ra,distance:Qa,distanceSq:Ra,div:Ua,divScalar:function(a,b,c){c=c||new w(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 w(3);b[0]=Math.floor(a[0]);b[1]=Math.floor(a[1]);b[2]=Math.floor(a[2]);return b},fromValues:G,getAxis:function(a,b,c){c=c||new w(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 w(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 w(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 w(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 w(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 w(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 w(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 w(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 w(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},round:function(a,b){b=b||new w(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 w(3);d[0]=a;d[1]=b;d[2]= | ||
c;return d},setDefaultType:Ma,sub:ca,subtract:ca,transformMat3:function(a,b,c){c=c||new w(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 w(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 w(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 w(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 w(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||G();D=D|| | ||
G();y=y||G();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||G();D=D||G();y=y||G();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,v,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!==v&&(p[14]=v,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,v=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-(v*e+u*h+F*m))+a[4]*(v*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||G();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||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];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||G();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||G();D=D||G();y=y||G();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,v,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]=v;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],v=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]=v,c[10]=u,c[11]=p);c[12]=f*d+k*e+r*b+E;c[13]=g*d+m*e+v*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],v=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]=v;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}});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||G();ta=ta||G(1,0,0);ua=ua||G(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||G(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){Ga(a);Va(a);cb(a);aa(a);Ma(a);nb(a)};M.utils=zb;M.vec2=Ab;M.vec3=Cb;M.vec4=Fb}); | ||
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},setEpsilon:function(a){const b=t;t=a;return b},degToRad:function(a){return a*Math.PI/180},radToDeg:function(a){return 180*a/Math.PI},lerp:function(a,b,c){return a+ | ||
(b-a)*c},inverseLerp:function(a,b,c){return Math.abs(b-a)<t?a:(c-a)/(b-a)},euclideanModulo:function(a,b){return(a%b+b)%b}});let z=Float32Array;var Ab=Object.freeze({__proto__:null,create:ba,setDefaultType:aa,fromValues:ba,set:function(a,b,c){c=c||new z(2);c[0]=a;c[1]=b;return c},ceil:function(a,b){b=b||new z(2);b[0]=Math.ceil(a[0]);b[1]=Math.ceil(a[1]);return b},floor:function(a,b){b=b||new z(2);b[0]=Math.floor(a[0]);b[1]=Math.floor(a[1]);return b},round:function(a,b){b=b||new z(2);b[0]=Math.round(a[0]); | ||
b[1]=Math.round(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},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))&&ya(a,b)/c;return Math.acos(a)},subtract:va,sub:va,equalsApproximately:function(a,b){return Math.abs(a[0]- | ||
b[0])<t&&Math.abs(a[1]-b[1])<t},equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]},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},mulScalar:wa,scale:wa,divScalar:function(a, | ||
b,c){c=c||new z(2);c[0]=a[0]/b;c[1]=a[1]/b;return c},inverse:xa,invert:xa,cross:function(a,b,c){c=c||new z(3);a=a[0]*b[1]-a[1]*b[0];c[0]=0;c[1]=0;c[2]=a;return c},dot:ya,length:za,len:za,lengthSq:Aa,lenSq:Aa,distance:Ba,dist:Ba,distanceSq:Ca,distSq:Ca,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},negate:function(a,b){b=b||new z(2);b[0]=-a[0];b[1]=-a[1];return b},copy:Da,clone:Da,multiply:Ea,mul:Ea,divide:Fa, | ||
div:Fa,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},zero:function(a){a=a||new z(2);a[0]=0;a[1]=0;return a},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},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}});let Ha=Float32Array;const Ia=new Map([[Float32Array,()=>new Float32Array(12)], | ||
[Float64Array,()=>new Float64Array(12)],[Array,()=>Array(12).fill(0)]]);let G=Ia.get(Float32Array);var Bb=Object.freeze({__proto__:null,setDefaultType:Ga,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},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},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},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},copy:pa,clone:pa,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},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]},identity:Ja,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},inverse:Ka,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)},invert:Ka,multiply:La,mul:La,setTranslation:function(a, | ||
b,c){c=c||Ja();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},getTranslation:function(a,b){b=b||ba();b[0]=a[8];b[1]=a[9];return b},getAxis:function(a,b,c){c=c||ba();b*=4;c[0]=a[b+0];c[1]=a[b+1];return c},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},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},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},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},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},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},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},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},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},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}});let w=Float32Array;var Cb=Object.freeze({__proto__:null,create:H,setDefaultType:Ma,fromValues:H,set:function(a,b,c,d){d=d||new w(3);d[0]=a;d[1]=b;d[2]=c;return d},ceil:function(a,b){b=b||new w(3);b[0]=Math.ceil(a[0]);b[1]=Math.ceil(a[1]);b[2]=Math.ceil(a[2]); | ||
return b},floor:function(a,b){b=b||new w(3);b[0]=Math.floor(a[0]);b[1]=Math.floor(a[1]);b[2]=Math.floor(a[2]);return b},round:function(a,b){b=b||new w(3);b[0]=Math.round(a[0]);b[1]=Math.round(a[1]);b[2]=Math.round(a[2]);return b},clamp:function(a,b=0,c=1,d){d=d||new w(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},add:function(a,b,c){c=c||new w(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 w(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)},subtract:ca,sub:ca,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},equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]},lerp:function(a,b,c,d){d=d||new w(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 w(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 w(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 w(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},mulScalar:Na,scale:Na,divScalar:function(a,b,c){c=c||new w(3);c[0]=a[0]/b;c[1]=a[1]/b;c[2]=a[2]/ | ||
b;return c},inverse:Oa,invert:Oa,cross:P,dot:qa,length:ra,len:ra,lengthSq:Pa,lenSq:Pa,distance:Qa,dist:Qa,distanceSq:Ra,distSq:Ra,normalize:O,negate:function(a,b){b=b||new w(3);b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];return b},copy:Sa,clone:Sa,multiply:Ta,mul:Ta,divide:Ua,div:Ua,random:function(a=1,b){b=b||new w(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},zero:function(a){a=a||new w(3);a[0]=0;a[1]=0;a[2]=0;return a}, | ||
transformMat4:function(a,b,c){c=c||new w(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 w(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},transformMat3:function(a,b,c){c=c||new w(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 w(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},getTranslation:function(a,b){b=b||new w(3);b[0]=a[12];b[1]=a[13];b[2]=a[14];return b},getAxis:function(a,b,c){c=c||new w(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 w(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}});let x=Float32Array,A,D,y;var Db=Object.freeze({__proto__:null,setDefaultType:Va,create:function(a,b,c,d,e,f,g,h,l,k,m,n,q,r,v,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!==v&&(p[14]=v,void 0!==u&&(p[15]=u))))))))))))))));return p},set:function(a,b,c,d,e,f,g,h,l,k,m,n,q,r,v,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]=v;p[15]=u;return p},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},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},copy:sa,clone:sa,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},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]},identity:Wa,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],v=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]=v;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},inverse:Xa,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,v=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-(v*e+u*h+F*m))+a[4]*(v*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))},invert:Xa,multiply:$a,mul:$a,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},getTranslation:function(a,b){b=b||H();b[0]=a[12];b[1]=a[13];b[2]=a[14];return b},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}, | ||
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},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},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},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},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},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},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},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},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},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],v=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]=v,c[10]=u,c[11]=p);c[12]=f*d+k*e+r*b+E;c[13]=g*d+m*e+v*b+F;c[14]=h*d+n*e+u*b+I;c[15]=l*d+q*e+p*b+J;return c},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},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},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},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},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},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},axisRotation:ab,rotation:ab,axisRotate:bb,rotate:bb,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},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},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},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}});let B=Float32Array, | ||
N,ta,ua,na,oa;var Eb=Object.freeze({__proto__:null,create:db,setDefaultType:cb,fromValues:db,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},fromAxisAngle:eb,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}},angle:function(a,b){a=jb(a,b);return Math.acos(2*a*a-1)},multiply:fb,mul:fb,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},slerp:ma,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},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},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},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},copy:gb,clone:gb,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},subtract:hb,sub:hb,mulScalar:ib,scale:ib, | ||
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,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},length:kb,len:kb,lengthSq:lb,lenSq:lb,normalize:mb,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},equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]=== | ||
b[3]},identity:function(a){a=a||new B(4);a[0]=0;a[1]=0;a[2]=0;a[3]=1;return a},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)},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}}); | ||
let C=Float32Array;var Fb=Object.freeze({__proto__:null,create:ob,setDefaultType:nb,fromValues:ob,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},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},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},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},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},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},subtract:pb,sub:pb,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},equals:function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]},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},mulScalar:qb,scale:qb,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},inverse:rb,invert:rb,dot:function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]},length:sb,len:sb,lengthSq:tb, | ||
lenSq:tb,distance:ub,dist:ub,distanceSq:vb,distSq:vb,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},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},copy:wb,clone:wb,multiply:xb,mul:xb,divide:yb,div:yb,zero:function(a){a=a||new C(4);a[0]=0;a[1]=0;a[2]=0;a[3]=0;return a},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}});M.mat3=Bb;M.mat4=Db;M.quat=Eb;M.setDefaultType=function(a){Ga(a);Va(a);cb(a);aa(a);Ma(a);nb(a)};M.utils=zb;M.vec2=Ab;M.vec3=Cb;M.vec4=Fb}); |
{ | ||
"name": "wgpu-matrix", | ||
"version": "2.4.2", | ||
"version": "2.5.0", | ||
"description": "fast matrix math library for WebGPU", | ||
@@ -14,4 +14,5 @@ "main": "dist/2.x/wgpu-matrix.module.js", | ||
"scripts": { | ||
"build": "rollup -c && tsc --emitDeclarationOnly --declaration", | ||
"build-min": "npm run build && google-closure-compiler --warning_level=VERBOSE --jscomp_off=globalThis --jscomp_off=checkTypes --externs build/externs.js --language_in=ECMASCRIPT_2019 --language_out=ECMASCRIPT_2019 --js dist/2.x/wgpu-matrix.js --js_output_file dist/2.x/wgpu-matrix.min.js && node ./build/append-banner.js dist/2.x/wgpu-matrix.min.js", | ||
"build": "npm run build-min", | ||
"build-normal": "rollup -c && tsc --emitDeclarationOnly --declaration", | ||
"build-min": "npm run build-normal && google-closure-compiler --warning_level=VERBOSE --jscomp_off=globalThis --jscomp_off=checkTypes --externs build/externs.js --language_in=ECMASCRIPT_2019 --language_out=ECMASCRIPT_2019 --js dist/2.x/wgpu-matrix.js --js_output_file dist/2.x/wgpu-matrix.min.js && node ./build/append-banner.js dist/2.x/wgpu-matrix.min.js", | ||
"check": "npm run lint", | ||
@@ -21,3 +22,3 @@ "check-ci": "npm run pre-push", | ||
"lint": "eslint \"src/**/*.{js,ts,tsx}\"", | ||
"pre-push": "npm run lint && npm run test && npm run build-min && npm run docs", | ||
"pre-push": "npm run lint && npm run build && npm run test && npm run docs", | ||
"rollup-watch": "rollup -c -w", | ||
@@ -24,0 +25,0 @@ "start": "rollup -c rollup.config.js -w", |
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
1138010
13689