!function(t,e){for(var r in e)t[r]=e[r]}(window,function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=function(){function t(t,e,r,n){this._values=new Float32Array([t,e,r,n])}return t.identity=function(){return new t(1,0,0,1)},Object.defineProperty(t.prototype,"values",{get:function(){return this._values},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this._values.toString()},t}();e.Matrix2x2=o;var i=function(){function t(t,e,r,n,o,i,u,s,a){this._values=new Float32Array([t,e,r,n,o,i,u,s,a])}return t.identity=function(){return new t(1,0,0,0,1,0,0,0,1)},Object.defineProperty(t.prototype,"values",{get:function(){return this._values},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this._values.toString()},t}();e.Matrix3x3=i;var u=function(){function t(t,e,r,n,o,i,u,s,a,c,l,f,h,p,y,v){this._values=new Float32Array([t,e,r,n,o,i,u,s,a,c,l,f,h,p,y,v])}return t.identity=function(){return new t(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},t.translation=function(e,r,n){return new t(1,0,0,0,0,1,0,0,0,0,1,0,e,r,n,1)},t.scaling=function(e,r,n){return new t(e,0,0,0,0,r,0,0,0,0,n,0,0,0,0,1)},t.rotationX=function(e){var r=Math.sin(e),n=Math.cos(e);return new t(1,0,0,0,0,n,r,0,0,-r,n,0,0,0,0,1)},t.rotationY=function(e){var r=Math.sin(e),n=Math.cos(e);return new t(n,0,-r,0,0,1,0,0,r,0,n,0,0,0,0,1)},t.rotationZ=function(e){var r=Math.sin(e),n=Math.cos(e);return new t(n,r,0,0,-r,n,0,0,0,0,1,0,0,0,0,1)},t.rotationAround=function(t,e){return n.Quaternion.rotationAround(t,e).toRotationMatrix4()},t.lookAt=function(e,r,n){var o=e.sub(r).normalize(),i=n.cross(o).normalize(),u=o.cross(i).normalize();return new t(i.x,u.x,o.x,0,i.y,u.y,o.y,0,i.z,u.z,o.z,0,-e.dot(i),-e.dot(u),-e.dot(o),1)},t.orthographic=function(e){var r=e.top,n=e.bottom,o=e.left,i=e.right,u=e.near,s=e.far;return new t(2/(i-o),0,0,0,0,2/(r-n),0,0,0,0,-2/(s-u),0,-(i+o)/(i-o),-(r+n)/(r-n),-(s+u)/(s-u),1)},t.frustum=function(e){var r=e.top,n=e.bottom,o=e.left,i=e.right,u=e.near,s=e.far;return new t(2*u/(i-o),0,0,0,0,2*u/(r-n),0,0,(i+o)/(i-o),(r+n)/(r-n),-(s+u)/(s-u),-1,0,0,-2*s*u/(s-u),0)},t.perspective=function(e){var r=e.near*Math.tan(.5*e.fovYRadian),n=2*r,o=e.aspectRatio*n,i=-.5*o,u=i+o,s=r-n;return t.frustum({top:r,bottom:s,left:i,right:u,near:e.near,far:e.far})},t.prototype.mulByMatrix4x4=function(e){var r=this._values[0],n=this._values[4],o=this._values[8],i=this._values[12],u=this._values[1],s=this._values[5],a=this._values[9],c=this._values[13],l=this._values[2],f=this._values[6],h=this._values[10],p=this._values[14],y=this._values[3],v=this._values[7],_=this._values[11],b=this._values[15],x=e.values[0],d=e.values[4],g=e.values[8],w=e.values[12],m=e.values[1],z=e.values[5],M=e.values[9],O=e.values[13],j=e.values[2],P=e.values[6],B=e.values[10],A=e.values[14],S=e.values[3],V=e.values[7],F=e.values[11],R=e.values[15];return new t(r*x+n*m+o*j+i*S,u*x+s*m+a*j+c*S,l*x+f*m+h*j+p*S,y*x+v*m+_*j+b*S,r*d+n*z+o*P+i*V,u*d+s*z+a*P+c*V,l*d+f*z+h*P+p*V,y*d+v*z+_*P+b*V,r*g+n*M+o*B+i*F,u*g+s*M+a*B+c*F,l*g+f*M+h*B+p*F,y*g+v*M+_*B+b*F,r*w+n*O+o*A+i*R,u*w+s*O+a*A+c*R,l*w+f*O+h*A+p*R,y*w+v*O+_*A+b*R)},t.prototype.mulByMatrix4=function(t){return this.mulByMatrix4x4(t)},t.prototype.translate=function(e,r,n){var o=t.translation(e,r,n);return this.mulByMatrix4x4(o)},t.prototype.scale=function(e,r,n){var o=t.scaling(e,r,n);return this.mulByMatrix4x4(o)},t.prototype.rotateX=function(e){var r=t.rotationX(e);return this.mulByMatrix4x4(r)},t.prototype.rotateY=function(e){var r=t.rotationY(e);return this.mulByMatrix4x4(r)},t.prototype.rotateZ=function(e){var r=t.rotationZ(e);return this.mulByMatrix4x4(r)},t.prototype.rotateAround=function(e,r){var n=t.rotationAround(e,r);return this.mulByMatrix4x4(n)},Object.defineProperty(t.prototype,"values",{get:function(){return this._values},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this._values.toString()},t}();e.Matrix4x4=u,e.Matrix2=o,e.Matrix3=i,e.Matrix4=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),o=function(){function t(t,e,r,n){this._values=new Float32Array([t,e,r,n])}return t.rotationAround=function(e,r){var n=Math.sin(r/2),o=Math.cos(r/2);return new t(e.x*n,e.y*n,e.z*n,o)},t.prototype.normalize=function(){var e=this.magnitude;if(0===e)return this;var r=1/e;return new t(this.x*r,this.y*r,this.z*r,this.w*r)},t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y,this.z+e.z,this.w+e.w)},t.prototype.mulByScalar=function(e){return new t(this.x*e,this.y*e,this.z*e,this.w*e)},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},t.prototype.slerp=function(t,e,r){void 0===r&&(r={chooseShorterAngle:!0});var n=this.dot(t),o=t;n<0&&(n=-n,o=t.mulByScalar(-1));var i=Math.acos(n),u=Math.sin(i),s=this.mulByScalar(Math.sin((1-e)*i)/u),a=o.mulByScalar(Math.sin(e*i)/u);return s.add(a)},Object.defineProperty(t.prototype,"magnitude",{get:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"norm",{get:function(){return this.magnitude},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._values[0]},set:function(t){this._values[0]=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._values[1]},set:function(t){this._values[1]=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"z",{get:function(){return this._values[2]},set:function(t){this._values[2]=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"w",{get:function(){return this._values[3]},set:function(t){this._values[3]=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this._values},enumerable:!0,configurable:!0}),t.prototype.toRotationMatrix4=function(){var t=this.x,e=this.y,r=this.z,o=this.w,i=1-2*e*e-2*r*r,u=2*t*e-2*o*r,s=2*t*r+2*o*e,a=2*t*e+2*o*r,c=1-2*t*t-2*r*r,l=2*e*r-2*o*t,f=2*t*r-2*o*e,h=2*e*r+2*o*t,p=1-2*t*t-2*e*e;return new n.Matrix4x4(i,a,f,0,u,c,h,0,s,l,p,0,0,0,0,1)},t.prototype.toString=function(){return"Quaternion("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},t}();e.Quaternion=o},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(3)),n(r(0)),n(r(1))},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=r(4),i=function(t){function e(e,r){var n=t.call(this)||this;return n._values=new Float32Array([e,r]),n}return n(e,t),e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y)},e.prototype.sub=function(t){return new e(this.x-t.x,this.y-t.y)},e.prototype.mulByScalar=function(t){return new e(this.x*t,this.y*t)},e}(o.Vector2Base);e.Float32Vector2=i;var u=function(t){function e(e,r,n){var o=t.call(this)||this;return o._values=new Float32Array([e,r,n]),o}return n(e,t),e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y,this.z+t.z)},e.prototype.sub=function(t){return new e(this.x-t.x,this.y-t.y,this.z-t.z)},e.prototype.mulByScalar=function(t){return new e(this.x*t,this.y*t,this.z*t)},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},e.prototype.cross=function(t){return new e(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},e.prototype.normalize=function(){var t=this.magnitude;return 0===t?this:new e(this.x/t,this.y/t,this.z/t)},Object.defineProperty(e.prototype,"xy",{get:function(){return new i(this.x,this.y)},enumerable:!0,configurable:!0}),e}(o.Vector3Base);e.Float32Vector3=u;var s=function(t){function e(e,r,n,o){var i=t.call(this)||this;return i._values=new Float32Array([e,r,n,o]),i}return n(e,t),e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y,this.z+t.z,this.w+t.w)},e.prototype.sub=function(t){return new e(this.x-t.x,this.y-t.y,this.z-t.z,this.w-t.w)},e.prototype.mulByScalar=function(t){return new e(this.x*t,this.y*t,this.z*t,this.w*t)},Object.defineProperty(e.prototype,"xyz",{get:function(){return new u(this.x,this.y,this.z)},enumerable:!0,configurable:!0}),e}(o.Vector4Base);e.Float32Vector4=s,e.Vector2=i,e.Vector3=u,e.Vector4=s},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){}return Object.defineProperty(t.prototype,"values",{get:function(){return this._values},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"magnitude",{get:function(){var t=this._values.reduce(function(t,e){return t+Math.pow(e,2)},0);return Math.sqrt(t)},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"Vector"+this._values.length+"("+this._values.join(", ")+")"},t}();e.VectorBase=o;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this._values[0]},set:function(t){this._values[0]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._values[1]},set:function(t){this._values[1]=t},enumerable:!0,configurable:!0}),e}(o);e.Vector2Base=i;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this._values[0]},set:function(t){this._values[0]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._values[1]},set:function(t){this._values[1]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._values[2]},set:function(t){this._values[2]=t},enumerable:!0,configurable:!0}),e}(o);e.Vector3Base=u;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this._values[0]},set:function(t){this._values[0]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._values[1]},set:function(t){this._values[1]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._values[2]},set:function(t){this._values[2]=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"w",{get:function(){return this._values[3]},set:function(t){this._values[3]=t},enumerable:!0,configurable:!0}),e}(o);e.Vector4Base=s}]));