text: /* Phaser v2.19.2 Creature Build - http://phaser.io - @photonstorm - (c) 2016 Photon Storm Ltd. */
  
  !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var a=e();for(var r in a)("object"==typeof exports?exports:t)[r]=a[r]}}(this,function(){return function(a){var r={};function n(t){if(r[t])return r[t].exports;var e=r[t]={exports:{},id:t,loaded:!1};return a[t].call(e.exports,e,e.exports,n),e.loaded=!0,e.exports}return n.m=a,n.c=r,n.p="",n(0)}([function(t,e,a){e.glMatrix=a(1),e.mat2=a(2),e.mat2d=a(3),e.mat3=a(4),e.mat4=a(5),e.quat=a(6),e.vec2=a(9),e.vec3=a(7),e.vec4=a(8)},function(t,e){var a={EPSILON:1e-6};a.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,a.RANDOM=Math.random,a.ENABLE_SIMD=!1,a.SIMD_AVAILABLE=a.ARRAY_TYPE===this.Float32Array&&"SIMD"in this,a.USE_SIMD=a.ENABLE_SIMD&&a.SIMD_AVAILABLE,a.setMatrixArrayType=function(t){a.ARRAY_TYPE=t};var r=Math.PI/180;a.toRadian=function(t){return t*r},a.equals=function(t,e){return Math.abs(t-e)<=a.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))},t.exports=a},function(t,e,a){var c=a(1),r={create:function(){var t=new c.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},clone:function(t){var e=new c.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},fromValues:function(t,e,a,r){var n=new c.ARRAY_TYPE(4);return n[0]=t,n[1]=e,n[2]=a,n[3]=r,n},set:function(t,e,a,r,n){return t[0]=e,t[1]=a,t[2]=r,t[3]=n,t},transpose:function(t,e){if(t===e){var a=e[1];t[1]=e[2],t[2]=a}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},invert:function(t,e){var a=e[0],r=e[1],n=e[2],i=e[3],s=a*i-n*r;return s?(s=1/s,t[0]=i*s,t[1]=-r*s,t[2]=-n*s,t[3]=a*s,t):null},adjoint:function(t,e){var a=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=a,t},determinant:function(t){return t[0]*t[3]-t[2]*t[1]},multiply:function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=a[0],l=a[1],u=a[2],c=a[3];return t[0]=r*o+i*l,t[1]=n*o+s*l,t[2]=r*u+i*c,t[3]=n*u+s*c,t}};r.mul=r.multiply,r.rotate=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sin(a),l=Math.cos(a);return t[0]=r*l+i*o,t[1]=n*l+s*o,t[2]=r*-o+i*l,t[3]=n*-o+s*l,t},r.scale=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=a[0],l=a[1];return t[0]=r*o,t[1]=n*o,t[2]=i*l,t[3]=s*l,t},r.fromRotation=function(t,e){var a=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=a,t[2]=-a,t[3]=r,t},r.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},r.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},r.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},r.LDU=function(t,e,a,r){return t[2]=r[2]/r[0],a[0]=r[0],a[1]=r[1],a[3]=r[3]-t[2]*a[1],[t,e,a]},r.add=function(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t[3]=e[3]+a[3],t},r.subtract=function(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t[3]=e[3]-a[3],t},r.sub=r.subtract,r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},r.equals=function(t,e){var a=t[0],r=t[1],n=t[2],i=t[3],s=e[0],o=e[1],l=e[2],u=e[3];return Math.abs(a-s)<=c.EPSILON*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(r-o)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-l)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-u)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))},r.multiplyScalar=function(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a,t},r.multiplyScalarAndAdd=function(t,e,a,r){return t[0]=e[0]+a[0]*r,t[1]=e[1]+a[1]*r,t[2]=e[2]+a[2]*r,t[3]=e[3]+a[3]*r,t},t.exports=r},function(t,e,a){var p=a(1),r={create:function(){var t=new p.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},clone:function(t){var e=new p.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},fromValues:function(t,e,a,r,n,i){var s=new p.ARRAY_TYPE(6);return s[0]=t,s[1]=e,s[2]=a,s[3]=r,s[4]=n,s[5]=i,s},set:function(t,e,a,r,n,i,s){return t[0]=e,t[1]=a,t[2]=r,t[3]=n,t[4]=i,t[5]=s,t},invert:function(t,e){var a=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],l=a*i-r*n;return l?(l=1/l,t[0]=i*l,t[1]=-r*l,t[2]=-n*l,t[3]=a*l,t[4]=(n*o-i*s)*l,t[5]=(r*s-a*o)*l,t):null},determinant:function(t){return t[0]*t[3]-t[1]*t[2]},multiply:function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=a[0],c=a[1],h=a[2],_=a[3],d=a[4],p=a[5];return t[0]=r*u+i*c,t[1]=n*u+s*c,t[2]=r*h+i*_,t[3]=n*h+s*_,t[4]=r*d+i*p+o,t[5]=n*d+s*p+l,t}};r.mul=r.multiply,r.rotate=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=Math.sin(a),c=Math.cos(a);return t[0]=r*c+i*u,t[1]=n*c+s*u,t[2]=r*-u+i*c,t[3]=n*-u+s*c,t[4]=o,t[5]=l,t},r.scale=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=a[0],c=a[1];return t[0]=r*u,t[1]=n*u,t[2]=i*c,t[3]=s*c,t[4]=o,t[5]=l,t},r.translate=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=a[0],c=a[1];return t[0]=r,t[1]=n,t[2]=i,t[3]=s,t[4]=r*u+i*c+o,t[5]=n*u+s*c+l,t},r.fromRotation=function(t,e){var a=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=a,t[2]=-a,t[3]=r,t[4]=0,t[5]=0,t},r.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},r.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},r.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},r.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},r.add=function(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t[3]=e[3]+a[3],t[4]=e[4]+a[4],t[5]=e[5]+a[5],t},r.subtract=function(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t[3]=e[3]-a[3],t[4]=e[4]-a[4],t[5]=e[5]-a[5],t},r.sub=r.subtract,r.multiplyScalar=function(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a,t[4]=e[4]*a,t[5]=e[5]*a,t},r.multiplyScalarAndAdd=function(t,e,a,r){return t[0]=e[0]+a[0]*r,t[1]=e[1]+a[1]*r,t[2]=e[2]+a[2]*r,t[3]=e[3]+a[3]*r,t[4]=e[4]+a[4]*r,t[5]=e[5]+a[5]*r,t},r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},r.equals=function(t,e){var a=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],l=e[0],u=e[1],c=e[2],h=e[3],_=e[4],d=e[5];return Math.abs(a-l)<=p.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(r-u)<=p.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-c)<=p.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-h)<=p.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-_)<=p.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-d)<=p.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))},t.exports=r},function(t,e,a){var y=a(1),r={create:function(){var t=new y.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromMat4:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},clone:function(t){var e=new y.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},fromValues:function(t,e,a,r,n,i,s,o,l){var u=new y.ARRAY_TYPE(9);return u[0]=t,u[1]=e,u[2]=a,u[3]=r,u[4]=n,u[5]=i,u[6]=s,u[7]=o,u[8]=l,u},set:function(t,e,a,r,n,i,s,o,l,u){return t[0]=e,t[1]=a,t[2]=r,t[3]=n,t[4]=i,t[5]=s,t[6]=o,t[7]=l,t[8]=u,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},transpose:function(t,e){if(t===e){var a=e[1],r=e[2],n=e[5];t[1]=e[3],t[2]=e[6],t[3]=a,t[5]=e[7],t[6]=r,t[7]=n}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},invert:function(t,e){var a=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=c*s-o*u,_=-c*i+o*l,d=u*i-s*l,p=a*h+r*_+n*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*r+n*u)*p,t[2]=(o*r-n*s)*p,t[3]=_*p,t[4]=(c*a-n*l)*p,t[5]=(-o*a+n*i)*p,t[6]=d*p,t[7]=(-u*a+r*l)*p,t[8]=(s*a-r*i)*p,t):null},adjoint:function(t,e){var a=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8];return t[0]=s*c-o*u,t[1]=n*u-r*c,t[2]=r*o-n*s,t[3]=o*l-i*c,t[4]=a*c-n*l,t[5]=n*i-a*o,t[6]=i*u-s*l,t[7]=r*l-a*u,t[8]=a*s-r*i,t},determinant:function(t){var e=t[0],a=t[1],r=t[2],n=t[3],i=t[4],s=t[5],o=t[6],l=t[7],u=t[8];return e*(u*i-s*l)+a*(-u*n+s*o)+r*(l*n-i*o)},multiply:function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],_=a[0],d=a[1],p=a[2],m=a[3],M=a[4],f=a[5],v=a[6],g=a[7],y=a[8];return t[0]=_*r+d*s+p*u,t[1]=_*n+d*o+p*c,t[2]=_*i+d*l+p*h,t[3]=m*r+M*s+f*u,t[4]=m*n+M*o+f*c,t[5]=m*i+M*l+f*h,t[6]=v*r+g*s+y*u,t[7]=v*n+g*o+y*c,t[8]=v*i+g*l+y*h,t}};r.mul=r.multiply,r.translate=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],_=a[0],d=a[1];return t[0]=r,t[1]=n,t[2]=i,t[3]=s,t[4]=o,t[5]=l,t[6]=_*r+d*s+u,t[7]=_*n+d*o+c,t[8]=_*i+d*l+h,t},r.rotate=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],_=Math.sin(a),d=Math.cos(a);return t[0]=d*r+_*s,t[1]=d*n+_*o,t[2]=d*i+_*l,t[3]=d*s-_*r,t[4]=d*o-_*n,t[5]=d*l-_*i,t[6]=u,t[7]=c,t[8]=h,t},r.scale=function(t,e,a){var r=a[0],n=a[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},r.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},r.fromRotation=function(t,e){var a=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},r.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},r.fromQuat=function(t,e){var a=e[0],r=e[1],n=e[2],i=e[3],s=a+a,o=r+r,l=n+n,u=a*s,c=r*s,h=r*o,_=n*s,d=n*o,p=n*l,m=i*s,M=i*o,f=i*l;return t[0]=1-h-p,t[3]=c-f,t[6]=_+M,t[1]=c+f,t[4]=1-u-p,t[7]=d-m,t[2]=_-M,t[5]=d+m,t[8]=1-u-h,t},r.normalFromMat4=function(t,e){var a=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],_=e[10],d=e[11],p=e[12],m=e[13],M=e[14],f=e[15],v=a*o-r*s,g=a*l-n*s,y=a*u-i*s,S=r*l-n*o,I=r*u-i*o,D=n*u-i*l,x=c*m-h*p,b=c*M-_*p,F=c*f-d*p,C=h*M-_*m,R=h*f-d*m,w=_*f-d*M,U=v*w-g*R+y*C+S*F-I*b+D*x;return U?(U=1/U,t[0]=(o*w-l*R+u*C)*U,t[1]=(l*F-s*w-u*b)*U,t[2]=(s*R-o*F+u*x)*U,t[3]=(n*R-r*w-i*C)*U,t[4]=(a*w-n*F+i*b)*U,t[5]=(r*F-a*R-i*x)*U,t[6]=(m*D-M*I+f*S)*U,t[7]=(M*y-p*D-f*g)*U,t[8]=(p*I-m*y+f*v)*U,t):null},r.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},r.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},r.add=function(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t[3]=e[3]+a[3],t[4]=e[4]+a[4],t[5]=e[5]+a[5],t[6]=e[6]+a[6],t[7]=e[7]+a[7],t[8]=e[8]+a[8],t},r.subtract=function(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t[3]=e[3]-a[3],t[4]=e[4]-a[4],t[5]=e[5]-a[5],t[6]=e[6]-a[6],t[7]=e[7]-a[7],t[8]=e[8]-a[8],t},r.sub=r.subtract,r.multiplyScalar=function(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*a,t},r.multiplyScalarAndAdd=function(t,e,a,r){return t[0]=e[0]+a[0]*r,t[1]=e[1]+a[1]*r,t[2]=e[2]+a[2]*r,t[3]=e[3]+a[3]*r,t[4]=e[4]+a[4]*r,t[5]=e[5]+a[5]*r,t[6]=e[6]+a[6]*r,t[7]=e[7]+a[7]*r,t[8]=e[8]+a[8]*r,t},r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},r.equals=function(t,e){var a=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=e[0],_=e[1],d=e[2],p=e[3],m=e[4],M=e[5],f=t[6],v=e[7],g=e[8];return Math.abs(a-h)<=y.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(r-_)<=y.EPSILON*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(n-d)<=y.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-p)<=y.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-m)<=y.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(o-M)<=y.EPSILON*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(l-f)<=y.EPSILON*Math.max(1,Math.abs(l),Math.abs(f))&&Math.abs(u-v)<=y.EPSILON*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-g)<=y.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))},t.exports=r},function(t,e,a){var E=a(1),D={scalar:{},SIMD:{},create:function(){var t=new E.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},clone:function(t){var e=new E.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},fromValues:function(t,e,a,r,n,i,s,o,l,u,c,h,_,d,p,m){var M=new E.ARRAY_TYPE(16);return M[0]=t,M[1]=e,M[2]=a,M[3]=r,M[4]=n,M[5]=i,M[6]=s,M[7]=o,M[8]=l,M[9]=u,M[10]=c,M[11]=h,M[12]=_,M[13]=d,M[14]=p,M[15]=m,M},set:function(t,e,a,r,n,i,s,o,l,u,c,h,_,d,p,m,M){return t[0]=e,t[1]=a,t[2]=r,t[3]=n,t[4]=i,t[5]=s,t[6]=o,t[7]=l,t[8]=u,t[9]=c,t[10]=h,t[11]=_,t[12]=d,t[13]=p,t[14]=m,t[15]=M,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}};D.scalar.transpose=function(t,e){if(t===e){var a=e[1],r=e[2],n=e[3],i=e[6],s=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=a,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[11]=e[14],t[12]=n,t[13]=s,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},D.SIMD.transpose=function(t,e){var a,r,n,i,s,o,l,u,c,h;return a=SIMD.Float32x4.load(e,0),r=SIMD.Float32x4.load(e,4),n=SIMD.Float32x4.load(e,8),i=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4.shuffle(a,r,0,1,4,5),o=SIMD.Float32x4.shuffle(n,i,0,1,4,5),l=SIMD.Float32x4.shuffle(s,o,0,2,4,6),u=SIMD.Float32x4.shuffle(s,o,1,3,5,7),SIMD.Float32x4.store(t,0,l),SIMD.Float32x4.store(t,4,u),s=SIMD.Float32x4.shuffle(a,r,2,3,6,7),o=SIMD.Float32x4.shuffle(n,i,2,3,6,7),c=SIMD.Float32x4.shuffle(s,o,0,2,4,6),h=SIMD.Float32x4.shuffle(s,o,1,3,5,7),SIMD.Float32x4.store(t,8,c),SIMD.Float32x4.store(t,12,h),t},D.transpose=E.USE_SIMD?D.SIMD.transpose:D.scalar.transpose,D.scalar.invert=function(t,e){var a=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],_=e[10],d=e[11],p=e[12],m=e[13],M=e[14],f=e[15],v=a*o-r*s,g=a*l-n*s,y=a*u-i*s,S=r*l-n*o,I=r*u-i*o,D=n*u-i*l,x=c*m-h*p,b=c*M-_*p,F=c*f-d*p,C=h*M-_*m,R=h*f-d*m,w=_*f-d*M,U=v*w-g*R+y*C+S*F-I*b+D*x;return U?(U=1/U,t[0]=(o*w-l*R+u*C)*U,t[1]=(n*R-r*w-i*C)*U,t[2]=(m*D-M*I+f*S)*U,t[3]=(_*I-h*D-d*S)*U,t[4]=(l*F-s*w-u*b)*U,t[5]=(a*w-n*F+i*b)*U,t[6]=(M*y-p*D-f*g)*U,t[7]=(c*D-_*y+d*g)*U,t[8]=(s*R-o*F+u*x)*U,t[9]=(r*F-a*R-i*x)*U,t[10]=(p*I-m*y+f*v)*U,t[11]=(h*y-c*I-d*v)*U,t[12]=(o*b-s*C-l*x)*U,t[13]=(a*C-r*b+n*x)*U,t[14]=(m*g-p*S-M*v)*U,t[15]=(c*S-h*g+_*v)*U,t):null},D.SIMD.invert=function(t,e){var a,r,n,i,s,o,l,u,c,h,_=SIMD.Float32x4.load(e,0),d=SIMD.Float32x4.load(e,4),p=SIMD.Float32x4.load(e,8),m=SIMD.Float32x4.load(e,12);return s=SIMD.Float32x4.shuffle(_,d,0,1,4,5),r=SIMD.Float32x4.shuffle(p,m,0,1,4,5),a=SIMD.Float32x4.shuffle(s,r,0,2,4,6),r=SIMD.Float32x4.shuffle(r,s,1,3,5,7),s=SIMD.Float32x4.shuffle(_,d,2,3,6,7),i=SIMD.Float32x4.shuffle(p,m,2,3,6,7),n=SIMD.Float32x4.shuffle(s,i,0,2,4,6),i=SIMD.Float32x4.shuffle(i,s,1,3,5,7),s=SIMD.Float32x4.mul(n,i),s=SIMD.Float32x4.swizzle(s,1,0,3,2),o=SIMD.Float32x4.mul(r,s),l=SIMD.Float32x4.mul(a,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),o=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,s),o),l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,s),l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),s=SIMD.Float32x4.mul(r,n),s=SIMD.Float32x4.swizzle(s,1,0,3,2),o=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),o),c=SIMD.Float32x4.mul(a,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),o=SIMD.Float32x4.sub(o,SIMD.Float32x4.mul(i,s)),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,s),c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),s=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(r,2,3,0,1),i),s=SIMD.Float32x4.swizzle(s,1,0,3,2),n=SIMD.Float32x4.swizzle(n,2,3,0,1),o=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,s),o),u=SIMD.Float32x4.mul(a,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),o=SIMD.Float32x4.sub(o,SIMD.Float32x4.mul(n,s)),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,s),u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),s=SIMD.Float32x4.mul(a,r),s=SIMD.Float32x4.swizzle(s,1,0,3,2),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),u),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,s),c),s=SIMD.Float32x4.swizzle(s,2,3,0,1),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,s),u),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(n,s)),s=SIMD.Float32x4.mul(a,i),s=SIMD.Float32x4.swizzle(s,1,0,3,2),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(n,s)),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(r,s),u),s=SIMD.Float32x4.swizzle(s,2,3,0,1),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,s),l),u=SIMD.Float32x4.sub(u,SIMD.Float32x4.mul(r,s)),s=SIMD.Float32x4.mul(a,n),s=SIMD.Float32x4.swizzle(s,1,0,3,2),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),l),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(r,s)),s=SIMD.Float32x4.swizzle(s,2,3,0,1),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(i,s)),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(r,s),c),h=SIMD.Float32x4.mul(a,o),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,2,3,0,1),h),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,1,0,3,2),h),s=SIMD.Float32x4.reciprocalApproximation(h),h=SIMD.Float32x4.sub(SIMD.Float32x4.add(s,s),SIMD.Float32x4.mul(h,SIMD.Float32x4.mul(s,s))),(h=SIMD.Float32x4.swizzle(h,0,0,0,0))?(SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(h,o)),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(h,l)),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(h,u)),SIMD.Float32x4.store(t,12,SIMD.Float32x4.mul(h,c)),t):null},D.invert=E.USE_SIMD?D.SIMD.invert:D.scalar.invert,D.scalar.adjoint=function(t,e){var a=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],_=e[10],d=e[11],p=e[12],m=e[13],M=e[14],f=e[15];return t[0]=o*(_*f-d*M)-h*(l*f-u*M)+m*(l*d-u*_),t[1]=-(r*(_*f-d*M)-h*(n*f-i*M)+m*(n*d-i*_)),t[2]=r*(l*f-u*M)-o*(n*f-i*M)+m*(n*u-i*l),t[3]=-(r*(l*d-u*_)-o*(n*d-i*_)+h*(n*u-i*l)),t[4]=-(s*(_*f-d*M)-c*(l*f-u*M)+p*(l*d-u*_)),t[5]=a*(_*f-d*M)-c*(n*f-i*M)+p*(n*d-i*_),t[6]=-(a*(l*f-u*M)-s*(n*f-i*M)+p*(n*u-i*l)),t[7]=a*(l*d-u*_)-s*(n*d-i*_)+c*(n*u-i*l),t[8]=s*(h*f-d*m)-c*(o*f-u*m)+p*(o*d-u*h),t[9]=-(a*(h*f-d*m)-c*(r*f-i*m)+p*(r*d-i*h)),t[10]=a*(o*f-u*m)-s*(r*f-i*m)+p*(r*u-i*o),t[11]=-(a*(o*d-u*h)-s*(r*d-i*h)+c*(r*u-i*o)),t[12]=-(s*(h*M-_*m)-c*(o*M-l*m)+p*(o*_-l*h)),t[13]=a*(h*M-_*m)-c*(r*M-n*m)+p*(r*_-n*h),t[14]=-(a*(o*M-l*m)-s*(r*M-n*m)+p*(r*l-n*o)),t[15]=a*(o*_-l*h)-s*(r*_-n*h)+c*(r*l-n*o),t},D.SIMD.adjoint=function(t,e){var a,r,n,i,s,o,l,u,c,h,_,d,p;return a=SIMD.Float32x4.load(e,0),r=SIMD.Float32x4.load(e,4),n=SIMD.Float32x4.load(e,8),i=SIMD.Float32x4.load(e,12),c=SIMD.Float32x4.shuffle(a,r,0,1,4,5),o=SIMD.Float32x4.shuffle(n,i,0,1,4,5),s=SIMD.Float32x4.shuffle(c,o,0,2,4,6),o=SIMD.Float32x4.shuffle(o,c,1,3,5,7),c=SIMD.Float32x4.shuffle(a,r,2,3,6,7),u=SIMD.Float32x4.shuffle(n,i,2,3,6,7),l=SIMD.Float32x4.shuffle(c,u,0,2,4,6),u=SIMD.Float32x4.shuffle(u,c,1,3,5,7),c=SIMD.Float32x4.mul(l,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.mul(o,c),_=SIMD.Float32x4.mul(s,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),h),_=SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,c),_),_=SIMD.Float32x4.swizzle(_,2,3,0,1),c=SIMD.Float32x4.mul(o,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),h),p=SIMD.Float32x4.mul(s,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,c),p),p=SIMD.Float32x4.swizzle(p,2,3,0,1),c=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(o,2,3,0,1),u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),l=SIMD.Float32x4.swizzle(l,2,3,0,1),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),h),d=SIMD.Float32x4.mul(s,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,c),d),d=SIMD.Float32x4.swizzle(d,2,3,0,1),c=SIMD.Float32x4.mul(s,o),c=SIMD.Float32x4.swizzle(c,1,0,3,2),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(l,c),p),c=SIMD.Float32x4.swizzle(c,2,3,0,1),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(l,c)),c=SIMD.Float32x4.mul(s,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),_=SIMD.Float32x4.sub(_,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,c),d),c=SIMD.Float32x4.swizzle(c,2,3,0,1),_=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),_),d=SIMD.Float32x4.sub(d,SIMD.Float32x4.mul(o,c)),c=SIMD.Float32x4.mul(s,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),_=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),_),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(o,c)),c=SIMD.Float32x4.swizzle(c,2,3,0,1),_=SIMD.Float32x4.sub(_,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,c),p),SIMD.Float32x4.store(t,0,h),SIMD.Float32x4.store(t,4,_),SIMD.Float32x4.store(t,8,d),SIMD.Float32x4.store(t,12,p),t},D.adjoint=E.USE_SIMD?D.SIMD.adjoint:D.scalar.adjoint,D.determinant=function(t){var e=t[0],a=t[1],r=t[2],n=t[3],i=t[4],s=t[5],o=t[6],l=t[7],u=t[8],c=t[9],h=t[10],_=t[11],d=t[12],p=t[13],m=t[14],M=t[15];return(e*s-a*i)*(h*M-_*m)-(e*o-r*i)*(c*M-_*p)+(e*l-n*i)*(c*m-h*p)+(a*o-r*s)*(u*M-_*d)-(a*l-n*s)*(u*m-h*d)+(r*l-n*o)*(u*p-c*d)},D.SIMD.multiply=function(t,e,a){var r=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),i=SIMD.Float32x4.load(e,8),s=SIMD.Float32x4.load(e,12),o=SIMD.Float32x4.load(a,0),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(o,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(o,1,1,1,1),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(o,2,2,2,2),i),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(o,3,3,3,3),s))));SIMD.Float32x4.store(t,0,l);var u=SIMD.Float32x4.load(a,4),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,1,1,1,1),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,2,2,2,2),i),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,3,3,3,3),s))));SIMD.Float32x4.store(t,4,c);var h=SIMD.Float32x4.load(a,8),_=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,1,1,1,1),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,2,2,2,2),i),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,3,3,3,3),s))));SIMD.Float32x4.store(t,8,_);var d=SIMD.Float32x4.load(a,12),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,1,1,1,1),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,2,2,2,2),i),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,3,3,3,3),s))));return SIMD.Float32x4.store(t,12,p),t},D.scalar.multiply=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],_=e[9],d=e[10],p=e[11],m=e[12],M=e[13],f=e[14],v=e[15],g=a[0],y=a[1],S=a[2],I=a[3];return t[0]=g*r+y*o+S*h+I*m,t[1]=g*n+y*l+S*_+I*M,t[2]=g*i+y*u+S*d+I*f,t[3]=g*s+y*c+S*p+I*v,g=a[4],y=a[5],S=a[6],I=a[7],t[4]=g*r+y*o+S*h+I*m,t[5]=g*n+y*l+S*_+I*M,t[6]=g*i+y*u+S*d+I*f,t[7]=g*s+y*c+S*p+I*v,g=a[8],y=a[9],S=a[10],I=a[11],t[8]=g*r+y*o+S*h+I*m,t[9]=g*n+y*l+S*_+I*M,t[10]=g*i+y*u+S*d+I*f,t[11]=g*s+y*c+S*p+I*v,g=a[12],y=a[13],S=a[14],I=a[15],t[12]=g*r+y*o+S*h+I*m,t[13]=g*n+y*l+S*_+I*M,t[14]=g*i+y*u+S*d+I*f,t[15]=g*s+y*c+S*p+I*v,t},D.multiply=E.USE_SIMD?D.SIMD.multiply:D.scalar.multiply,D.mul=D.multiply,D.scalar.translate=function(t,e,a){var r,n,i,s,o,l,u,c,h,_,d,p,m=a[0],M=a[1],f=a[2];return e===t?(t[12]=e[0]*m+e[4]*M+e[8]*f+e[12],t[13]=e[1]*m+e[5]*M+e[9]*f+e[13],t[14]=e[2]*m+e[6]*M+e[10]*f+e[14],t[15]=e[3]*m+e[7]*M+e[11]*f+e[15]):(r=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],_=e[9],d=e[10],p=e[11],t[0]=r,t[1]=n,t[2]=i,t[3]=s,t[4]=o,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=_,t[10]=d,t[11]=p,t[12]=r*m+o*M+h*f+e[12],t[13]=n*m+l*M+_*f+e[13],t[14]=i*m+u*M+d*f+e[14],t[15]=s*m+c*M+p*f+e[15]),t},D.SIMD.translate=function(t,e,a){var r=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),i=SIMD.Float32x4.load(e,8),s=SIMD.Float32x4.load(e,12),o=SIMD.Float32x4(a[0],a[1],a[2],0);e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11]),r=SIMD.Float32x4.mul(r,SIMD.Float32x4.swizzle(o,0,0,0,0)),n=SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(o,1,1,1,1)),i=SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(o,2,2,2,2));var l=SIMD.Float32x4.add(r,SIMD.Float32x4.add(n,SIMD.Float32x4.add(i,s)));return SIMD.Float32x4.store(t,12,l),t},D.translate=E.USE_SIMD?D.SIMD.translate:D.scalar.translate,D.scalar.scale=function(t,e,a){var r=a[0],n=a[1],i=a[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},D.SIMD.scale=function(t,e,a){var r,n,i,s=SIMD.Float32x4(a[0],a[1],a[2],0);return r=SIMD.Float32x4.load(e,0),SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(r,SIMD.Float32x4.swizzle(s,0,0,0,0))),n=SIMD.Float32x4.load(e,4),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(s,1,1,1,1))),i=SIMD.Float32x4.load(e,8),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(s,2,2,2,2))),t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},D.scale=E.USE_SIMD?D.SIMD.scale:D.scalar.scale,D.rotate=function(t,e,a,r){var n,i,s,o,l,u,c,h,_,d,p,m,M,f,v,g,y,S,I,D,x,b,F,C,R=r[0],w=r[1],U=r[2],P=Math.sqrt(R*R+w*w+U*U);return Math.abs(P)<E.EPSILON?null:(R*=P=1/P,w*=P,U*=P,n=Math.sin(a),s=1-(i=Math.cos(a)),o=e[0],l=e[1],u=e[2],c=e[3],h=e[4],_=e[5],d=e[6],p=e[7],m=e[8],M=e[9],f=e[10],v=e[11],g=R*R*s+i,y=w*R*s+U*n,S=U*R*s-w*n,I=R*w*s-U*n,D=w*w*s+i,x=U*w*s+R*n,b=R*U*s+w*n,F=w*U*s-R*n,C=U*U*s+i,t[0]=o*g+h*y+m*S,t[1]=l*g+_*y+M*S,t[2]=u*g+d*y+f*S,t[3]=c*g+p*y+v*S,t[4]=o*I+h*D+m*x,t[5]=l*I+_*D+M*x,t[6]=u*I+d*D+f*x,t[7]=c*I+p*D+v*x,t[8]=o*b+h*F+m*C,t[9]=l*b+_*F+M*C,t[10]=u*b+d*F+f*C,t[11]=c*b+p*F+v*C,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},D.scalar.rotateX=function(t,e,a){var r=Math.sin(a),n=Math.cos(a),i=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],_=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*n+u*r,t[5]=s*n+c*r,t[6]=o*n+h*r,t[7]=l*n+_*r,t[8]=u*n-i*r,t[9]=c*n-s*r,t[10]=h*n-o*r,t[11]=_*n-l*r,t},D.SIMD.rotateX=function(t,e,a){var r=SIMD.Float32x4.splat(Math.sin(a)),n=SIMD.Float32x4.splat(Math.cos(a));e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var i=SIMD.Float32x4.load(e,4),s=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,4,SIMD.Float32x4.add(SIMD.Float32x4.mul(i,n),SIMD.Float32x4.mul(s,r))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,n),SIMD.Float32x4.mul(i,r))),t},D.rotateX=E.USE_SIMD?D.SIMD.rotateX:D.scalar.rotateX,D.scalar.rotateY=function(t,e,a){var r=Math.sin(a),n=Math.cos(a),i=e[0],s=e[1],o=e[2],l=e[3],u=e[8],c=e[9],h=e[10],_=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n-u*r,t[1]=s*n-c*r,t[2]=o*n-h*r,t[3]=l*n-_*r,t[8]=i*r+u*n,t[9]=s*r+c*n,t[10]=o*r+h*n,t[11]=l*r+_*n,t},D.SIMD.rotateY=function(t,e,a){var r=SIMD.Float32x4.splat(Math.sin(a)),n=SIMD.Float32x4.splat(Math.cos(a));e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var i=SIMD.Float32x4.load(e,0),s=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,n),SIMD.Float32x4.mul(s,r))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.add(SIMD.Float32x4.mul(i,r),SIMD.Float32x4.mul(s,n))),t},D.rotateY=E.USE_SIMD?D.SIMD.rotateY:D.scalar.rotateY,D.scalar.rotateZ=function(t,e,a){var r=Math.sin(a),n=Math.cos(a),i=e[0],s=e[1],o=e[2],l=e[3],u=e[4],c=e[5],h=e[6],_=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n+u*r,t[1]=s*n+c*r,t[2]=o*n+h*r,t[3]=l*n+_*r,t[4]=u*n-i*r,t[5]=c*n-s*r,t[6]=h*n-o*r,t[7]=_*n-l*r,t},D.SIMD.rotateZ=function(t,e,a){var r=SIMD.Float32x4.splat(Math.sin(a)),n=SIMD.Float32x4.splat(Math.cos(a));e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var i=SIMD.Float32x4.load(e,0),s=SIMD.Float32x4.load(e,4);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.add(SIMD.Float32x4.mul(i,n),SIMD.Float32x4.mul(s,r))),SIMD.Float32x4.store(t,4,SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,n),SIMD.Float32x4.mul(i,r))),t},D.rotateZ=E.USE_SIMD?D.SIMD.rotateZ:D.scalar.rotateZ,D.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},D.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},D.fromRotation=function(t,e,a){var r,n,i,s=a[0],o=a[1],l=a[2],u=Math.sqrt(s*s+o*o+l*l);return Math.abs(u)<E.EPSILON?null:(s*=u=1/u,o*=u,l*=u,r=Math.sin(e),i=1-(n=Math.cos(e)),t[0]=s*s*i+n,t[1]=o*s*i+l*r,t[2]=l*s*i-o*r,t[3]=0,t[4]=s*o*i-l*r,t[5]=o*o*i+n,t[6]=l*o*i+s*r,t[7]=0,t[8]=s*l*i+o*r,t[9]=o*l*i-s*r,t[10]=l*l*i+n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},D.fromXRotation=function(t,e){var a=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=a,t[7]=0,t[8]=0,t[9]=-a,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},D.fromYRotation=function(t,e){var a=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=a,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},D.fromZRotation=function(t,e){var a=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=a,t[2]=0,t[3]=0,t[4]=-a,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},D.fromRotationTranslation=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=r+r,l=n+n,u=i+i,c=r*o,h=r*l,_=r*u,d=n*l,p=n*u,m=i*u,M=s*o,f=s*l,v=s*u;return t[0]=1-(d+m),t[1]=h+v,t[2]=_-f,t[3]=0,t[4]=h-v,t[5]=1-(c+m),t[6]=p+M,t[7]=0,t[8]=_+f,t[9]=p-M,t[10]=1-(c+d),t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t},D.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},D.getRotation=function(t,e){var a=e[0]+e[5]+e[10],r=0;return 0<a?(r=2*Math.sqrt(a+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},D.fromRotationTranslationScale=function(t,e,a,r){var n=e[0],i=e[1],s=e[2],o=e[3],l=n+n,u=i+i,c=s+s,h=n*l,_=n*u,d=n*c,p=i*u,m=i*c,M=s*c,f=o*l,v=o*u,g=o*c,y=r[0],S=r[1],I=r[2];return t[0]=(1-(p+M))*y,t[1]=(_+g)*y,t[2]=(d-v)*y,t[3]=0,t[4]=(_-g)*S,t[5]=(1-(h+M))*S,t[6]=(m+f)*S,t[7]=0,t[8]=(d+v)*I,t[9]=(m-f)*I,t[10]=(1-(h+p))*I,t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t},D.fromRotationTranslationScaleOrigin=function(t,e,a,r,n){var i=e[0],s=e[1],o=e[2],l=e[3],u=i+i,c=s+s,h=o+o,_=i*u,d=i*c,p=i*h,m=s*c,M=s*h,f=o*h,v=l*u,g=l*c,y=l*h,S=r[0],I=r[1],D=r[2],x=n[0],b=n[1],F=n[2];return t[0]=(1-(m+f))*S,t[1]=(d+y)*S,t[2]=(p-g)*S,t[3]=0,t[4]=(d-y)*I,t[5]=(1-(_+f))*I,t[6]=(M+v)*I,t[7]=0,t[8]=(p+g)*D,t[9]=(M-v)*D,t[10]=(1-(_+m))*D,t[11]=0,t[12]=a[0]+x-(t[0]*x+t[4]*b+t[8]*F),t[13]=a[1]+b-(t[1]*x+t[5]*b+t[9]*F),t[14]=a[2]+F-(t[2]*x+t[6]*b+t[10]*F),t[15]=1,t},D.fromQuat=function(t,e){var a=e[0],r=e[1],n=e[2],i=e[3],s=a+a,o=r+r,l=n+n,u=a*s,c=r*s,h=r*o,_=n*s,d=n*o,p=n*l,m=i*s,M=i*o,f=i*l;return t[0]=1-h-p,t[1]=c+f,t[2]=_-M,t[3]=0,t[4]=c-f,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=_+M,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},D.frustum=function(t,e,a,r,n,i,s){var o=1/(a-e),l=1/(n-r),u=1/(i-s);return t[0]=2*i*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*l,t[6]=0,t[7]=0,t[8]=(a+e)*o,t[9]=(n+r)*l,t[10]=(s+i)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*i*2*u,t[15]=0,t},D.perspective=function(t,e,a,r,n){var i=1/Math.tan(e/2),s=1/(r-n);return t[0]=i/a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(n+r)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*n*r*s,t[15]=0,t},D.perspectiveFromFieldOfView=function(t,e,a,r){var n=Math.tan(e.upDegrees*Math.PI/180),i=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),l=2/(s+o),u=2/(n+i);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(s-o)*l*.5,t[9]=(n-i)*u*.5,t[10]=r/(a-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*a/(a-r),t[15]=0,t},D.ortho=function(t,e,a,r,n,i,s){var o=1/(e-a),l=1/(r-n),u=1/(i-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+a)*o,t[13]=(n+r)*l,t[14]=(s+i)*u,t[15]=1,t},D.lookAt=function(t,e,a,r){var n,i,s,o,l,u,c,h,_,d,p=e[0],m=e[1],M=e[2],f=r[0],v=r[1],g=r[2],y=a[0],S=a[1],I=a[2];return Math.abs(p-y)<E.EPSILON&&Math.abs(m-S)<E.EPSILON&&Math.abs(M-I)<E.EPSILON?D.identity(t):(c=p-y,h=m-S,_=M-I,n=v*(_*=d=1/Math.sqrt(c*c+h*h+_*_))-g*(h*=d),i=g*(c*=d)-f*_,s=f*h-v*c,(d=Math.sqrt(n*n+i*i+s*s))?(n*=d=1/d,i*=d,s*=d):s=i=n=0,o=h*s-_*i,l=_*n-c*s,u=c*i-h*n,(d=Math.sqrt(o*o+l*l+u*u))?(o*=d=1/d,l*=d,u*=d):u=l=o=0,t[0]=n,t[1]=o,t[2]=c,t[3]=0,t[4]=i,t[5]=l,t[6]=h,t[7]=0,t[8]=s,t[9]=u,t[10]=_,t[11]=0,t[12]=-(n*p+i*m+s*M),t[13]=-(o*p+l*m+u*M),t[14]=-(c*p+h*m+_*M),t[15]=1,t)},D.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},D.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},D.add=function(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t[3]=e[3]+a[3],t[4]=e[4]+a[4],t[5]=e[5]+a[5],t[6]=e[6]+a[6],t[7]=e[7]+a[7],t[8]=e[8]+a[8],t[9]=e[9]+a[9],t[10]=e[10]+a[10],t[11]=e[11]+a[11],t[12]=e[12]+a[12],t[13]=e[13]+a[13],t[14]=e[14]+a[14],t[15]=e[15]+a[15],t},D.subtract=function(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t[3]=e[3]-a[3],t[4]=e[4]-a[4],t[5]=e[5]-a[5],t[6]=e[6]-a[6],t[7]=e[7]-a[7],t[8]=e[8]-a[8],t[9]=e[9]-a[9],t[10]=e[10]-a[10],t[11]=e[11]-a[11],t[12]=e[12]-a[12],t[13]=e[13]-a[13],t[14]=e[14]-a[14],t[15]=e[15]-a[15],t},D.sub=D.subtract,D.multiplyScalar=function(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12]*a,t[13]=e[13]*a,t[14]=e[14]*a,t[15]=e[15]*a,t},D.multiplyScalarAndAdd=function(t,e,a,r){return t[0]=e[0]+a[0]*r,t[1]=e[1]+a[1]*r,t[2]=e[2]+a[2]*r,t[3]=e[3]+a[3]*r,t[4]=e[4]+a[4]*r,t[5]=e[5]+a[5]*r,t[6]=e[6]+a[6]*r,t[7]=e[7]+a[7]*r,t[8]=e[8]+a[8]*r,t[9]=e[9]+a[9]*r,t[10]=e[10]+a[10]*r,t[11]=e[11]+a[11]*r,t[12]=e[12]+a[12]*r,t[13]=e[13]+a[13]*r,t[14]=e[14]+a[14]*r,t[15]=e[15]+a[15]*r,t},D.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},D.equals=function(t,e){var a=t[0],r=t[1],n=t[2],i=t[3],s=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=t[9],_=t[10],d=t[11],p=t[12],m=t[13],M=t[14],f=t[15],v=e[0],g=e[1],y=e[2],S=e[3],I=e[4],D=e[5],x=e[6],b=e[7],F=e[8],C=e[9],R=e[10],w=e[11],U=e[12],P=e[13],A=e[14],B=e[15];return Math.abs(a-v)<=E.EPSILON*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(r-g)<=E.EPSILON*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(n-y)<=E.EPSILON*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-S)<=E.EPSILON*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(s-I)<=E.EPSILON*Math.max(1,Math.abs(s),Math.abs(I))&&Math.abs(o-D)<=E.EPSILON*Math.max(1,Math.abs(o),Math.abs(D))&&Math.abs(l-x)<=E.EPSILON*Math.max(1,Math.abs(l),Math.abs(x))&&Math.abs(u-b)<=E.EPSILON*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(c-F)<=E.EPSILON*Math.max(1,Math.abs(c),Math.abs(F))&&Math.abs(h-C)<=E.EPSILON*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(_-R)<=E.EPSILON*Math.max(1,Math.abs(_),Math.abs(R))&&Math.abs(d-w)<=E.EPSILON*Math.max(1,Math.abs(d),Math.abs(w))&&Math.abs(p-U)<=E.EPSILON*Math.max(1,Math.abs(p),Math.abs(U))&&Math.abs(m-P)<=E.EPSILON*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(M-A)<=E.EPSILON*Math.max(1,Math.abs(M),Math.abs(A))&&Math.abs(f-B)<=E.EPSILON*Math.max(1,Math.abs(f),Math.abs(B))},t.exports=D},function(t,e,a){var n,i,s,o,l,u,r=a(1),c=a(4),h=a(7),_=a(8),d={};d.create=function(){var t=new r.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},d.rotationTo=(n=h.create(),i=h.fromValues(1,0,0),s=h.fromValues(0,1,0),function(t,e,a){var r=h.dot(e,a);return r<-.999999?(h.cross(n,i,e),h.length(n)<1e-6&&h.cross(n,s,e),h.normalize(n,n),d.setAxisAngle(t,n,Math.PI),t):.999999<r?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(h.cross(n,e,a),t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=1+r,d.normalize(t,t))}),d.setAxes=(o=c.create(),function(t,e,a,r){return o[0]=a[0],o[3]=a[1],o[6]=a[2],o[1]=r[0],o[4]=r[1],o[7]=r[2],o[2]=-e[0],o[5]=-e[1],o[8]=-e[2],d.normalize(t,d.fromMat3(t,o))}),d.clone=_.clone,d.fromValues=_.fromValues,d.copy=_.copy,d.set=_.set,d.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},d.setAxisAngle=function(t,e,a){a*=.5;var r=Math.sin(a);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(a),t},d.getAxisAngle=function(t,e){var a=2*Math.acos(e[3]),r=Math.sin(a/2);return 0!=r?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),a},d.add=_.add,d.multiply=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3],o=a[0],l=a[1],u=a[2],c=a[3];return t[0]=r*c+s*o+n*u-i*l,t[1]=n*c+s*l+i*o-r*u,t[2]=i*c+s*u+r*l-n*o,t[3]=s*c-r*o-n*l-i*u,t},d.mul=d.multiply,d.scale=_.scale,d.rotateX=function(t,e,a){a*=.5;var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sin(a),l=Math.cos(a);return t[0]=r*l+s*o,t[1]=n*l+i*o,t[2]=i*l-n*o,t[3]=s*l-r*o,t},d.rotateY=function(t,e,a){a*=.5;var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sin(a),l=Math.cos(a);return t[0]=r*l-i*o,t[1]=n*l+s*o,t[2]=i*l+r*o,t[3]=s*l-n*o,t},d.rotateZ=function(t,e,a){a*=.5;var r=e[0],n=e[1],i=e[2],s=e[3],o=Math.sin(a),l=Math.cos(a);return t[0]=r*l+n*o,t[1]=n*l-r*o,t[2]=i*l+s*o,t[3]=s*l-i*o,t},d.calculateW=function(t,e){var a=e[0],r=e[1],n=e[2];return t[0]=a,t[1]=r,t[2]=n,t[3]=Math.sqrt(Math.abs(1-a*a-r*r-n*n)),t},d.dot=_.dot,d.lerp=_.lerp,d.slerp=function(t,e,a,r){var n,i,s,o,l,u=e[0],c=e[1],h=e[2],_=e[3],d=a[0],p=a[1],m=a[2],M=a[3];return(i=u*d+c*p+h*m+_*M)<0&&(i=-i,d=-d,p=-p,m=-m,M=-M),l=1e-6<1-i?(n=Math.acos(i),s=Math.sin(n),o=Math.sin((1-r)*n)/s,Math.sin(r*n)/s):(o=1-r,r),t[0]=o*u+l*d,t[1]=o*c+l*p,t[2]=o*h+l*m,t[3]=o*_+l*M,t},d.sqlerp=(l=d.create(),u=d.create(),function(t,e,a,r,n,i){return d.slerp(l,e,n,i),d.slerp(u,a,r,i),d.slerp(t,l,u,2*i*(1-i)),t}),d.invert=function(t,e){var a=e[0],r=e[1],n=e[2],i=e[3],s=a*a+r*r+n*n+i*i,o=s?1/s:0;return t[0]=-a*o,t[1]=-r*o,t[2]=-n*o,t[3]=i*o,t},d.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},d.length=_.length,d.len=d.length,d.squaredLength=_.squaredLength,d.sqrLen=d.squaredLength,d.normalize=_.normalize,d.fromMat3=function(t,e){var a,r=e[0]+e[4]+e[8];if(0<r)a=Math.sqrt(r+1),t[3]=.5*a,a=.5/a,t[0]=(e[5]-e[7])*a,t[1]=(e[6]-e[2])*a,t[2]=(e[1]-e[3])*a;else{var n=0;e[4]>e[0]&&(n=1),e[8]>e[3*n+n]&&(n=2);var i=(n+1)%3,s=(n+2)%3;a=Math.sqrt(e[3*n+n]-e[3*i+i]-e[3*s+s]+1),t[n]=.5*a,a=.5/a,t[3]=(e[3*i+s]-e[3*s+i])*a,t[i]=(e[3*i+n]+e[3*n+i])*a,t[s]=(e[3*s+n]+e[3*n+s])*a}return t},d.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},d.exactEquals=_.exactEquals,d.equals=_.equals,t.exports=d},function(t,e,a){var l,u=a(1),i={};i.create=function(){var t=new u.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t},i.clone=function(t){var e=new u.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},i.fromValues=function(t,e,a){var r=new u.ARRAY_TYPE(3);return r[0]=t,r[1]=e,r[2]=a,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},i.set=function(t,e,a,r){return t[0]=e,t[1]=a,t[2]=r,t},i.add=function(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t},i.subtract=function(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t},i.sub=i.subtract,i.multiply=function(t,e,a){return t[0]=e[0]*a[0],t[1]=e[1]*a[1],t[2]=e[2]*a[2],t},i.mul=i.multiply,i.divide=function(t,e,a){return t[0]=e[0]/a[0],t[1]=e[1]/a[1],t[2]=e[2]/a[2],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},i.min=function(t,e,a){return t[0]=Math.min(e[0],a[0]),t[1]=Math.min(e[1],a[1]),t[2]=Math.min(e[2],a[2]),t},i.max=function(t,e,a){return t[0]=Math.max(e[0],a[0]),t[1]=Math.max(e[1],a[1]),t[2]=Math.max(e[2],a[2]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},i.scale=function(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},i.scaleAndAdd=function(t,e,a,r){return t[0]=e[0]+a[0]*r,t[1]=e[1]+a[1]*r,t[2]=e[2]+a[2]*r,t},i.distance=function(t,e){var a=e[0]-t[0],r=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(a*a+r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var a=e[0]-t[0],r=e[1]-t[1],n=e[2]-t[2];return a*a+r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],a=t[1],r=t[2];return Math.sqrt(e*e+a*a+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],a=t[1],r=t[2];return e*e+a*a+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},i.normalize=function(t,e){var a=e[0],r=e[1],n=e[2],i=a*a+r*r+n*n;return 0<i&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=a[0],o=a[1],l=a[2];return t[0]=n*l-i*o,t[1]=i*s-r*l,t[2]=r*o-n*s,t},i.lerp=function(t,e,a,r){var n=e[0],i=e[1],s=e[2];return t[0]=n+r*(a[0]-n),t[1]=i+r*(a[1]-i),t[2]=s+r*(a[2]-s),t},i.hermite=function(t,e,a,r,n,i){var s=i*i,o=s*(2*i-3)+1,l=s*(i-2)+i,u=s*(i-1),c=s*(3-2*i);return t[0]=e[0]*o+a[0]*l+r[0]*u+n[0]*c,t[1]=e[1]*o+a[1]*l+r[1]*u+n[1]*c,t[2]=e[2]*o+a[2]*l+r[2]*u+n[2]*c,t},i.bezier=function(t,e,a,r,n,i){var s=1-i,o=s*s,l=i*i,u=o*s,c=3*i*o,h=3*l*s,_=l*i;return t[0]=e[0]*u+a[0]*c+r[0]*h+n[0]*_,t[1]=e[1]*u+a[1]*c+r[1]*h+n[1]*_,t[2]=e[2]*u+a[2]*c+r[2]*h+n[2]*_,t},i.random=function(t,e){e=e||1;var a=2*u.RANDOM()*Math.PI,r=2*u.RANDOM()-1,n=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(a)*n,t[1]=Math.sin(a)*n,t[2]=r*e,t},i.transformMat4=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=a[3]*r+a[7]*n+a[11]*i+a[15];return s=s||1,t[0]=(a[0]*r+a[4]*n+a[8]*i+a[12])/s,t[1]=(a[1]*r+a[5]*n+a[9]*i+a[13])/s,t[2]=(a[2]*r+a[6]*n+a[10]*i+a[14])/s,t},i.transformMat3=function(t,e,a){var r=e[0],n=e[1],i=e[2];return t[0]=r*a[0]+n*a[3]+i*a[6],t[1]=r*a[1]+n*a[4]+i*a[7],t[2]=r*a[2]+n*a[5]+i*a[8],t},i.transformQuat=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=a[0],o=a[1],l=a[2],u=a[3],c=u*r+o*i-l*n,h=u*n+l*r-s*i,_=u*i+s*n-o*r,d=-s*r-o*n-l*i;return t[0]=c*u+d*-s+h*-l-_*-o,t[1]=h*u+d*-o+_*-s-c*-l,t[2]=_*u+d*-l+c*-o-h*-s,t},i.rotateX=function(t,e,a,r){var n=[],i=[];return n[0]=e[0]-a[0],n[1]=e[1]-a[1],n[2]=e[2]-a[2],i[0]=n[0],i[1]=n[1]*Math.cos(r)-n[2]*Math.sin(r),i[2]=n[1]*Math.sin(r)+n[2]*Math.cos(r),t[0]=i[0]+a[0],t[1]=i[1]+a[1],t[2]=i[2]+a[2],t},i.rotateY=function(t,e,a,r){var n=[],i=[];return n[0]=e[0]-a[0],n[1]=e[1]-a[1],n[2]=e[2]-a[2],i[0]=n[2]*Math.sin(r)+n[0]*Math.cos(r),i[1]=n[1],i[2]=n[2]*Math.cos(r)-n[0]*Math.sin(r),t[0]=i[0]+a[0],t[1]=i[1]+a[1],t[2]=i[2]+a[2],t},i.rotateZ=function(t,e,a,r){var n=[],i=[];return n[0]=e[0]-a[0],n[1]=e[1]-a[1],n[2]=e[2]-a[2],i[0]=n[0]*Math.cos(r)-n[1]*Math.sin(r),i[1]=n[0]*Math.sin(r)+n[1]*Math.cos(r),i[2]=n[2],t[0]=i[0]+a[0],t[1]=i[1]+a[1],t[2]=i[2]+a[2],t},i.forEach=(l=i.create(),function(t,e,a,r,n,i){var s,o;for(e||(e=3),a||(a=0),o=r?Math.min(r*e+a,t.length):t.length,s=a;s<o;s+=e)l[0]=t[s],l[1]=t[s+1],l[2]=t[s+2],n(l,l,i),t[s]=l[0],t[s+1]=l[1],t[s+2]=l[2];return t}),i.angle=function(t,e){var a=i.fromValues(t[0],t[1],t[2]),r=i.fromValues(e[0],e[1],e[2]);i.normalize(a,a),i.normalize(r,r);var n=i.dot(a,r);return 1<n?0:Math.acos(n)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=function(t,e){var a=t[0],r=t[1],n=t[2],i=e[0],s=e[1],o=e[2];return Math.abs(a-i)<=u.EPSILON*Math.max(1,Math.abs(a),Math.abs(i))&&Math.abs(r-s)<=u.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-o)<=u.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))},t.exports=i},function(t,e,a){var l,c=a(1),r={};r.create=function(){var t=new c.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},r.clone=function(t){var e=new c.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},r.fromValues=function(t,e,a,r){var n=new c.ARRAY_TYPE(4);return n[0]=t,n[1]=e,n[2]=a,n[3]=r,n},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},r.set=function(t,e,a,r,n){return t[0]=e,t[1]=a,t[2]=r,t[3]=n,t},r.add=function(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t[3]=e[3]+a[3],t},r.subtract=function(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t[2]=e[2]-a[2],t[3]=e[3]-a[3],t},r.sub=r.subtract,r.multiply=function(t,e,a){return t[0]=e[0]*a[0],t[1]=e[1]*a[1],t[2]=e[2]*a[2],t[3]=e[3]*a[3],t},r.mul=r.multiply,r.divide=function(t,e,a){return t[0]=e[0]/a[0],t[1]=e[1]/a[1],t[2]=e[2]/a[2],t[3]=e[3]/a[3],t},r.div=r.divide,r.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},r.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},r.min=function(t,e,a){return t[0]=Math.min(e[0],a[0]),t[1]=Math.min(e[1],a[1]),t[2]=Math.min(e[2],a[2]),t[3]=Math.min(e[3],a[3]),t},r.max=function(t,e,a){return t[0]=Math.max(e[0],a[0]),t[1]=Math.max(e[1],a[1]),t[2]=Math.max(e[2],a[2]),t[3]=Math.max(e[3],a[3]),t},r.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},r.scale=function(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a,t},r.scaleAndAdd=function(t,e,a,r){return t[0]=e[0]+a[0]*r,t[1]=e[1]+a[1]*r,t[2]=e[2]+a[2]*r,t[3]=e[3]+a[3]*r,t},r.distance=function(t,e){var a=e[0]-t[0],r=e[1]-t[1],n=e[2]-t[2],i=e[3]-t[3];return Math.sqrt(a*a+r*r+n*n+i*i)},r.dist=r.distance,r.squaredDistance=function(t,e){var a=e[0]-t[0],r=e[1]-t[1],n=e[2]-t[2],i=e[3]-t[3];return a*a+r*r+n*n+i*i},r.sqrDist=r.squaredDistance,r.length=function(t){var e=t[0],a=t[1],r=t[2],n=t[3];return Math.sqrt(e*e+a*a+r*r+n*n)},r.len=r.length,r.squaredLength=function(t){var e=t[0],a=t[1],r=t[2],n=t[3];return e*e+a*a+r*r+n*n},r.sqrLen=r.squaredLength,r.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},r.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},r.normalize=function(t,e){var a=e[0],r=e[1],n=e[2],i=e[3],s=a*a+r*r+n*n+i*i;return 0<s&&(s=1/Math.sqrt(s),t[0]=a*s,t[1]=r*s,t[2]=n*s,t[3]=i*s),t},r.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},r.lerp=function(t,e,a,r){var n=e[0],i=e[1],s=e[2],o=e[3];return t[0]=n+r*(a[0]-n),t[1]=i+r*(a[1]-i),t[2]=s+r*(a[2]-s),t[3]=o+r*(a[3]-o),t},r.random=function(t,e){return e=e||1,t[0]=c.RANDOM(),t[1]=c.RANDOM(),t[2]=c.RANDOM(),t[3]=c.RANDOM(),r.normalize(t,t),r.scale(t,t,e),t},r.transformMat4=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=e[3];return t[0]=a[0]*r+a[4]*n+a[8]*i+a[12]*s,t[1]=a[1]*r+a[5]*n+a[9]*i+a[13]*s,t[2]=a[2]*r+a[6]*n+a[10]*i+a[14]*s,t[3]=a[3]*r+a[7]*n+a[11]*i+a[15]*s,t},r.transformQuat=function(t,e,a){var r=e[0],n=e[1],i=e[2],s=a[0],o=a[1],l=a[2],u=a[3],c=u*r+o*i-l*n,h=u*n+l*r-s*i,_=u*i+s*n-o*r,d=-s*r-o*n-l*i;return t[0]=c*u+d*-s+h*-l-_*-o,t[1]=h*u+d*-o+_*-s-c*-l,t[2]=_*u+d*-l+c*-o-h*-s,t[3]=e[3],t},r.forEach=(l=r.create(),function(t,e,a,r,n,i){var s,o;for(e||(e=4),a||(a=0),o=r?Math.min(r*e+a,t.length):t.length,s=a;s<o;s+=e)l[0]=t[s],l[1]=t[s+1],l[2]=t[s+2],l[3]=t[s+3],n(l,l,i),t[s]=l[0],t[s+1]=l[1],t[s+2]=l[2],t[s+3]=l[3];return t}),r.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},r.equals=function(t,e){var a=t[0],r=t[1],n=t[2],i=t[3],s=e[0],o=e[1],l=e[2],u=e[3];return Math.abs(a-s)<=c.EPSILON*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(r-o)<=c.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-l)<=c.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-u)<=c.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))},t.exports=r},function(t,e,a){var l,s=a(1),r={};r.create=function(){var t=new s.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},r.clone=function(t){var e=new s.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},r.fromValues=function(t,e){var a=new s.ARRAY_TYPE(2);return a[0]=t,a[1]=e,a},r.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},r.set=function(t,e,a){return t[0]=e,t[1]=a,t},r.add=function(t,e,a){return t[0]=e[0]+a[0],t[1]=e[1]+a[1],t},r.subtract=function(t,e,a){return t[0]=e[0]-a[0],t[1]=e[1]-a[1],t},r.sub=r.subtract,r.multiply=function(t,e,a){return t[0]=e[0]*a[0],t[1]=e[1]*a[1],t},r.mul=r.multiply,r.divide=function(t,e,a){return t[0]=e[0]/a[0],t[1]=e[1]/a[1],t},r.div=r.divide,r.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},r.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},r.min=function(t,e,a){return t[0]=Math.min(e[0],a[0]),t[1]=Math.min(e[1],a[1]),t},r.max=function(t,e,a){return t[0]=Math.max(e[0],a[0]),t[1]=Math.max(e[1],a[1]),t},r.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},r.scale=function(t,e,a){return t[0]=e[0]*a,t[1]=e[1]*a,t},r.scaleAndAdd=function(t,e,a,r){return t[0]=e[0]+a[0]*r,t[1]=e[1]+a[1]*r,t},r.distance=function(t,e){var a=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(a*a+r*r)},r.dist=r.distance,r.squaredDistance=function(t,e){var a=e[0]-t[0],r=e[1]-t[1];return a*a+r*r},r.sqrDist=r.squaredDistance,r.length=function(t){var e=t[0],a=t[1];return Math.sqrt(e*e+a*a)},r.len=r.length,r.squaredLength=function(t){var e=t[0],a=t[1];return e*e+a*a},r.sqrLen=r.squaredLength,r.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},r.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},r.normalize=function(t,e){var a=e[0],r=e[1],n=a*a+r*r;return 0<n&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n),t},r.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},r.cross=function(t,e,a){var r=e[0]*a[1]-e[1]*a[0];return t[0]=t[1]=0,t[2]=r,t},r.lerp=function(t,e,a,r){var n=e[0],i=e[1];return t[0]=n+r*(a[0]-n),t[1]=i+r*(a[1]-i),t},r.random=function(t,e){e=e||1;var a=2*s.RANDOM()*Math.PI;return t[0]=Math.cos(a)*e,t[1]=Math.sin(a)*e,t},r.transformMat2=function(t,e,a){var r=e[0],n=e[1];return t[0]=a[0]*r+a[2]*n,t[1]=a[1]*r+a[3]*n,t},r.transformMat2d=function(t,e,a){var r=e[0],n=e[1];return t[0]=a[0]*r+a[2]*n+a[4],t[1]=a[1]*r+a[3]*n+a[5],t},r.transformMat3=function(t,e,a){var r=e[0],n=e[1];return t[0]=a[0]*r+a[3]*n+a[6],t[1]=a[1]*r+a[4]*n+a[7],t},r.transformMat4=function(t,e,a){var r=e[0],n=e[1];return t[0]=a[0]*r+a[4]*n+a[12],t[1]=a[1]*r+a[5]*n+a[13],t},r.forEach=(l=r.create(),function(t,e,a,r,n,i){var s,o;for(e||(e=2),a||(a=0),o=r?Math.min(r*e+a,t.length):t.length,s=a;s<o;s+=e)l[0]=t[s],l[1]=t[s+1],n(l,l,i),t[s]=l[0],t[s+1]=l[1];return t}),r.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},r.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},r.equals=function(t,e){var a=t[0],r=t[1],n=e[0],i=e[1];return Math.abs(a-n)<=s.EPSILON*Math.max(1,Math.abs(a),Math.abs(n))&&Math.abs(r-i)<=s.EPSILON*Math.max(1,Math.abs(r),Math.abs(i))},t.exports=r}])});var Q_X=0,Q_Y=1,Q_Z=2,Q_W=3;function dualQuat(){this.real=quat.create(),this.real[Q_W]=0,this.imaginary=quat.create(),this.imaginary[Q_W]=0,this.tmpQ1=quat.create()}dualQuat.prototype.reset=function(){quat.identity(this.real),this.real[Q_W]=0,quat.identity(this.imaginary),this.imaginary[Q_W]=0,quat.identity(this.tmpQ1)},dualQuat.prototype.createFromData=function(t,e){this.real=t,this.imaginary=quat.create(),this.imaginary[Q_W]=-.5*(e[Q_X]*t[Q_X]+e[Q_Y]*t[Q_Y]+e[Q_Z]*t[Q_Z]),this.imaginary[Q_X]=.5*(e[Q_X]*t[Q_W]+e[Q_Y]*t[Q_Z]-e[Q_Z]*t[Q_Y]),this.imaginary[Q_Y]=.5*(-e[Q_X]*t[Q_Z]+e[Q_Y]*t[Q_W]+e[Q_Z]*t[Q_X]),this.imaginary[Q_Z]=.5*(e[Q_X]*t[Q_Y]-e[Q_Y]*t[Q_X]+e[Q_Z]*t[Q_W])},dualQuat.prototype.add=function(t,e,a){quat.copy(this.tmpQ1,t.real),quat.scale(this.tmpQ1,this.tmpQ1,e),quat.add(this.real,this.tmpQ1,this.real),quat.copy(this.tmpQ1,t.imaginary),quat.scale(this.tmpQ1,this.tmpQ1,a),quat.add(this.imaginary,this.tmpQ1,this.imaginary)},dualQuat.prototype.normalize=function(){var t=quat.length(this.real);this.real=quat.scale(this.real,this.real,1/t),this.imaginary=quat.scale(this.imaginary,this.imaginary,1/t)};var v0=vec3.create(),ve=vec3.create(),trans=vec3.create(),tmpVec1=vec3.create(),tmpVec2=vec3.create(),tmpVec0=vec3.create(),aVec=vec3.create(),rot=vec3.create();dualQuat.prototype.transform=function(t){return v0[Q_X]=this.real[Q_X],v0[Q_Y]=this.real[Q_Y],v0[Q_Z]=this.real[Q_Z],ve[Q_X]=this.imaginary[Q_X],ve[Q_Y]=this.imaginary[Q_Y],ve[Q_Z]=this.imaginary[Q_Z],tmpVec1=vec3.scale(tmpVec1,v0,this.imaginary[Q_W]),tmpVec2=vec3.cross(tmpVec2,v0,ve),tmpVec0=vec3.scale(tmpVec0,ve,this.real[Q_W]),aVec=vec3.subtract(aVec,tmpVec0,tmpVec1),trans=vec3.add(trans,aVec,tmpVec2),trans=vec3.scale(trans,trans,2),rot=vec3.transformQuat(rot,t,this.real),rot=vec3.add(rot,rot,trans)};var Utils={setAxisMatrix:function(t,e,a){var r=mat4.create();return r[0]=t[Q_X],r[4]=t[Q_Y],r[8]=t[Q_Z],r[1]=e[Q_X],r[5]=e[Q_Y],r[9]=e[Q_Z],r[2]=a[Q_X],r[6]=a[Q_Y],r[10]=a[Q_Z],r[12]=0,r[13]=0,r[14]=0,r[3]=0,r[7]=0,r[11]=0,r[15]=1,r=mat4.transpose(r,r)},matrixToQuat:function(t){var e,a=quat.create(),r=t,n=r[0],i=r[4],s=r[8],o=r[1],l=r[5],u=r[9],c=r[2],h=r[6],_=r[10],d=n+l+_;return 0<d?(e=.5/Math.sqrt(d+1),a[Q_W]=.25/e,a[Q_X]=(h-u)*e,a[Q_Y]=(s-c)*e,a[Q_Z]=(o-i)*e):l<n&&_<n?(e=2*Math.sqrt(1+n-l-_),a[Q_W]=(h-u)/e,a[Q_X]=.25*e,a[Q_Y]=(i+o)/e,a[Q_Z]=(s+c)/e):_<l?(e=2*Math.sqrt(1+l-n-_),a[Q_W]=(s-c)/e,a[Q_X]=(i+o)/e,a[Q_Y]=.25*e,a[Q_Z]=(u+h)/e):(e=2*Math.sqrt(1+_-n-l),a[Q_W]=(o-i)/e,a[Q_X]=(s+c)/e,a[Q_Y]=(u+h)/e,a[Q_Z]=.25*e),a},rotateVec_90:function(t){return vec3.fromValues(-t[Q_Y],t[Q_X],t[Q_Z])},calcRotateMat:function(t){var e=vec3.clone(t);e=vec3.normalize(e,e);var a=Utils.rotateVec_90(e),r=vec3.fromValues(e[Q_X],e[Q_Y],0),n=vec3.fromValues(a[Q_X],a[Q_Y],0),i=vec3.fromValues(0,0,1);mat4.create();return Utils.setAxisMatrix(r,n,i)},getMatTranslate:function(t){var e=vec3.create();return e[Q_X]=t[12],e[Q_Y]=t[13],e[Q_Z]=t[14],e},addMat:function(t,e){for(var a=mat4.create(),r=0;r<16;r++)a[r]=t[r]+e[r];return a},mulMat:function(t,e){for(var a=mat4.create(),r=0;r<16;r++)a[r]=t[r]*e;return a},clamp:function(t,e,a){return t<e?e:a<t?a:t}},newVec1=vec3.create(),newVec2=vec3.create();function MeshBone(t,e,a,r){this.key=t,this.world_rest_angle=0,this.rest_parent_mat=mat4.create(),this.rest_parent_inv_mat=mat4.create(),this.rest_world_mat=mat4.create(),this.rest_world_inv_mat=mat4.create(),this.bind_world_mat=mat4.create(),this.bind_world_inv_mat=mat4.create(),this.parent_world_mat=mat4.create(),this.parent_world_inv_mat=mat4.create(),this.local_rest_start_pt=null,this.local_rest_end_pt=null,this.setRestParentMat(r,null),this.setLocalRestStartPt(e),this.setLocalRestEndPt(a),this.setParentWorldInvMat(mat4.create()),this.setParentWorldMat(mat4.create()),this.local_binormal_dir=vec3.fromValues(0,0,1),this.tag_id=0,this.children=[]}function MeshRenderRegion(t,e,a,r,n,i,s){this.store_indices=t,this.store_rest_pts=e,this.store_uvs=a,this.use_local_displacements=!1,this.use_post_displacements=!1,this.use_uv_warp=!1,this.uv_warp_local_offset=vec2.fromValues(0,0),this.uv_warp_global_offset=vec2.fromValues(0,0),this.uv_warp_scale=vec2.fromValues(1,1),this.opacity=100,this.start_pt_index=r,this.end_pt_index=n,this.start_index=i,this.end_index=s,this.main_bone=null,this.local_displacements=[],this.post_displacements=[],this.uv_warp_ref_uvs=[],this.normal_weight_map={},this.fast_normal_weight_map=[],this.fast_bones_map=[],this.relevant_bones_indices=[],this.use_dq=!0,this.tag_id=-1,this.initUvWarp()}Utils.vecInterp=function(t,e,a){newVec1=vec3.scale(newVec1,t,1-a),newVec2=vec3.scale(newVec2,e,a);var r=vec3.create();return r=vec3.add(r,newVec1,newVec2)},Utils.vec2Interp=function(t,e,a){var r=vec2.create(),n=vec2.create();r=vec2.scale(r,t,1-a),n=vec2.scale(n,e,a);var i=vec2.create();return i=vec2.add(i,r,n)},Utils.ptsInterp=function(t,e,a){for(var r=[],n=0;n<t.length;n++)r.push(Utils.vec2Interp(t[n],e[n],a));return r},Utils.scalarInterp=function(t,e,a){return(1-a)*t+a*e},MeshBone.prototype.setRestParentMat=function(t,e){this.rest_parent_mat=t,null==e?(this.rest_parent_inv_mat=mat4.clone(this.rest_parent_mat),mat4.invert(this.rest_parent_inv_mat,this.rest_parent_inv_mat)):this.rest_parent_inv_mat=mat4.clone(e)},MeshBone.prototype.setParentWorldMat=function(t){this.parent_world_mat=t},MeshBone.prototype.setParentWorldInvMat=function(t){this.parent_world_inv_mat=t},MeshBone.prototype.getLocalRestStartPt=function(){return this.local_rest_start_pt},MeshBone.prototype.getLocalRestEndPt=function(){return this.local_rest_end_pt},MeshBone.prototype.setLocalRestStartPt=function(t){this.local_rest_start_pt=vec3.create(),this.local_rest_start_pt=vec3.transformMat4(this.local_rest_start_pt,t,this.rest_parent_inv_mat),this.calcRestData()},MeshBone.prototype.setLocalRestEndPt=function(t){this.local_rest_end_pt=vec3.create(),this.local_rest_end_pt=vec3.transformMat4(this.local_rest_end_pt,t,this.rest_parent_inv_mat),this.calcRestData()},MeshBone.prototype.calcRestData=function(){if(null!=this.local_rest_start_pt&&null!=this.local_rest_end_pt){var t=this.computeDirs(this.local_rest_start_pt,this.local_rest_end_pt);this.local_rest_dir=t.first,this.local_rest_normal_dir=t.second,this.computeRestLength()}},MeshBone.prototype.setWorldStartPt=function(t){this.world_start_pt=t},MeshBone.prototype.setWorldEndPt=function(t){this.world_end_pt=t},MeshBone.prototype.fixDQs=function(t){quat.dot(this.world_dq.real,t.real)<0&&(this.world_dq.real=quat.scale(this.world_dq.real,this.world_dq.real,-1),this.world_dq.imaginary=quat.scale(this.world_dq.imaginary,this.world_dq.imaginary,-1));for(var e=0;e<this.children.length;e++){this.children[e].fixDQs(this.world_dq)}},MeshBone.prototype.initWorldPts=function(){this.setWorldStartPt(this.getWorldRestStartPt()),this.setWorldEndPt(this.getWorldRestEndPt());for(var t=0;t<this.children.length;t++)this.children[t].initWorldPts()},MeshBone.prototype.getWorldRestStartPt=function(){var t=this.rest_parent_mat,e=vec3.create();return e=vec3.transformMat4(e,this.local_rest_start_pt,t)},MeshBone.prototype.getWorldRestEndPt=function(){var t=this.rest_parent_mat,e=vec3.create();return e=vec3.transformMat4(e,this.local_rest_end_pt,t)},MeshBone.prototype.getWorldRestAngle=function(){return this.world_rest_angle},MeshBone.prototype.getWorldRestPos=function(){return this.world_rest_pos},MeshBone.prototype.getWorldStartPt=function(){return this.world_start_pt},MeshBone.prototype.getWorldEndPt=function(){return this.world_end_pt},MeshBone.prototype.getRestParentMat=function(){return this.rest_parent_mat},MeshBone.prototype.getRestWorldMat=function(){return this.rest_world_mat},MeshBone.prototype.getWorldDeltaMat=function(){return this.world_delta_mat},MeshBone.prototype.getParentWorldMat=function(){return this.parent_world_mat},MeshBone.prototype.getParentWorldInvMat=function(){return this.parent_world_inv_mat},MeshBone.prototype.getWorldDq=function(){return this.world_dq},MeshBone.prototype.computeRestParentTransforms=function(){var t=vec3.fromValues(this.local_rest_dir[Q_X],this.local_rest_dir[Q_Y],0),e=vec3.fromValues(this.local_binormal_dir[Q_X],this.local_binormal_dir[Q_Y],this.local_binormal_dir[Q_Z]),a=vec3.fromValues(this.local_rest_normal_dir[Q_X],this.local_rest_normal_dir[Q_Y],0),r=mat4.create();mat4.translate(r,r,this.local_rest_end_pt);var n=mat4.create();n=Utils.setAxisMatrix(t,a,e);var i=mat4.create();i=mat4.multiply(i,r,n),this.rest_world_mat=mat4.create(),this.rest_world_mat=mat4.multiply(this.rest_world_mat,this.rest_parent_mat,i),this.rest_world_inv_mat=mat4.clone(this.rest_world_mat),this.rest_world_inv_mat=mat4.invert(this.rest_world_inv_mat,this.rest_world_inv_mat);var s=vec3.clone(this.getWorldRestEndPt());s=vec3.subtract(s,s,this.getWorldRestStartPt()),s=vec3.normalize(s,s),this.world_rest_pos=this.getWorldRestStartPt();var o=mat4.create();o=mat4.translate(o,o,this.getWorldRestStartPt());var l=vec3.create();l=vec3.sub(l,this.getWorldRestEndPt(),this.getWorldRestStartPt());var u=Utils.calcRotateMat(l),c=mat4.create();c=mat4.multiply(c,o,u),this.bind_world_mat=mat4.clone(c),this.bind_world_inv_mat=mat4.clone(this.bind_world_mat),this.bind_world_inv_mat=mat4.invert(this.bind_world_inv_mat,this.bind_world_inv_mat);for(var h=0;h<this.children.length;h++){var _=this.children[h];_.setRestParentMat(this.rest_world_mat,this.rest_world_inv_mat),_.computeRestParentTransforms()}},MeshBone.prototype.computeParentTransforms=function(){var t=mat4.create();t=mat4.translate(t,t,this.getWorldEndPt());var e=vec3.create();e=vec3.subtract(e,this.getWorldEndpt(),this.getWorldStartPt());var a=Utils.calcRotateMat(e),r=mat4.create();r=mat4.multiply(r,t,a);var n=mat4.clone(r);n=mat4.invert(n,n);for(var i=0;i<children.length;i++){var s=children[i];s.setParentWorldMat(r),s.setParentWorldInvMat(n),s.computeParentTransforms()}},MeshBone.prototype.computeWorldDeltaTransforms=function(){var t=this.computeDirs(this.world_start_pt,this.world_end_pt),e=vec3.fromValues(t.first[Q_X],t.first[Q_Y],0),a=vec3.fromValues(t.second[Q_X],t.second[Q_Y],0),r=vec3.fromValues(this.local_binormal_dir[Q_X],this.local_binormal_dir[Q_Y],this.local_binormal_dir[Q_Z]),n=mat4.create();n=Utils.setAxisMatrix(e,a,r);var i=mat4.create();i=mat4.translate(i,i,this.world_start_pt),this.world_delta_mat=mat4.create(),this.world_delta_mat=mat4.multiply(this.world_delta_mat,i,n),this.world_delta_mat=mat4.multiply(this.world_delta_mat,this.world_delta_mat,this.bind_world_inv_mat);var s=Utils.matrixToQuat(this.world_delta_mat),o=Utils.getMatTranslate(this.world_delta_mat);this.world_dq=new dualQuat,this.world_dq.createFromData(s,o);for(var l=0;l<this.children.length;l++){this.children[l].computeWorldDeltaTransforms()}},MeshBone.prototype.addChild=function(t){t.setRestParentMat(this.rest_world_mat,this.rest_world_inv_mat),this.children.push(t)},MeshBone.prototype.getChildren=function(){return this.children},MeshBone.prototype.hasBone=function(t){for(var e=0;e<this.children.length;e++){if(this.children[e]==t)return!0}return!1},MeshBone.prototype.getChildByKey=function(t){if(this.key===t)return this;for(var e=null,a=0;a<this.children.length;a++){var r=this.children[a].getChildByKey(t);if(null!=r){e=r;break}}return e},MeshBone.prototype.getKey=function(){return this.key},MeshBone.prototype.getAllBoneKeys=function(){var t=[];t.push(this.getKey());for(var e=0;e<this.children.length;e++){var a=this.children[e].getAllBoneKeys();t=t.concat(a)}return t},MeshBone.prototype.getAllChildren=function(){var t=[];t.push(this);for(var e=0;e<this.children.length;e++){var a=this.children[e].getAllChildren();t=t.concat(a)}return t},MeshBone.prototype.getBoneDepth=function(t,e){if(t==this)return e;for(var a=0;a<this.children.length;a++){var r=this.children[a].getBoneDepth(t,e+1);if(-1!=r)return r}return-1},MeshBone.prototype.isLeaf=function(){return 0==this.children.length},MeshBone.prototype.deleteChildren=function(){for(var t=0;t<this.children.length;t++){this.children[t].deleteChildren()}this.children=[]},MeshBone.prototype.setTagId=function(t){this.tag_id=t},MeshBone.prototype.getTagId=function(){return this.tag_id},MeshBone.prototype.computeDirs=function(t,e){var a=vec3.create();a=vec3.subtract(a,e,t),a=vec3.normalize(a,a);var r=Utils.rotateVec_90(a),n={};return n.first=a,n.second=r,n},MeshBone.prototype.computeRestLength=function(){var t=vec3.create();t=vec3.subtract(t,this.local_rest_end_pt,this.local_rest_start_pt),this.rest_length=vec3.length(t)},MeshRenderRegion.prototype.getIndicesIndex=function(){return this.start_index},MeshRenderRegion.prototype.getRestPtsIndex=function(){return 3*this.start_pt_index},MeshRenderRegion.prototype.getUVsIndex=function(){return 2*this.start_pt_index},MeshRenderRegion.prototype.getNumPts=function(){return this.end_pt_index-this.start_pt_index+1},MeshRenderRegion.prototype.getStartPtIndex=function(){return this.start_pt_index},MeshRenderRegion.prototype.getEndPtIndex=function(){return this.end_pt_index},MeshRenderRegion.prototype.getNumIndices=function(){return this.end_index-this.start_index+1},MeshRenderRegion.prototype.getStartIndex=function(){return this.start_index},MeshRenderRegion.prototype.getEndIndex=function(){return this.end_index};var accum_dq=new dualQuat,accum_mat=mat4.create(),final_pt=vec3.create(),tmp1=vec3.create(),tmp2=vec3.create();function MeshRenderBoneComposition(){this.root_bone=null,this.bones_map={},this.regions=[],this.regions_map={}}function MeshBoneCache(t){this.key=t}function MeshDisplacementCache(t){this.key=t,this.local_displacements=[],this.post_displacements=[]}function MeshUVWarpCache(t){this.uv_warp_global_offset=vec2.create(),this.uv_warp_local_offset=vec2.create(),this.uv_warp_scale=vec2.fromValues(-1,-1),this.key=t,this.enabled=!1}function MeshOpacityCache(t){this.opacity=100,this.key=t}function MeshBoneCacheManager(){this.is_ready=!1,this.bone_cache_table=null,this.bone_cache_data_ready=null,this.bone_cache_table=[],this.bone_cache_data_ready=[]}function MeshDisplacementCacheManager(){this.is_ready=!1,this.displacement_cache_table=null,this.displacement_cache_data_ready=null,this.displacement_cache_table=[],this.displacement_cache_data_ready=[]}function MeshUVWarpCacheManager(){this.is_ready=!1,this.uv_cache_table=null,this.uv_cache_data_ready=null,this.uv_cache_table=[],this.uv_cache_data_ready=[]}function MeshOpacityCacheManager(){this.is_ready=!1,this.opacity_cache_table=null,this.opacity_cache_data_ready=null,this.opacity_cache_table=[],this.opacity_cache_data_ready=[]}MeshRenderRegion.prototype.poseFinalPts=function(t,e,a){for(var r=this.getRestPtsIndex(),n=e,i=0;i<16;i++)accum_mat[i]=0;Object.keys(a).length,i=0;for(var s=this.getNumPts();i<s;i++){var o=vec3.set(tmp1,this.store_rest_pts[0+r],this.store_rest_pts[1+r],this.store_rest_pts[2+r]);1==this.use_local_displacements&&(o[Q_X]+=this.local_displacements[i][Q_X],o[Q_Y]+=this.local_displacements[i][Q_Y]);for(var l=0;l<16;l++)accum_mat[l]=0;accum_dq.reset();var u=this.relevant_bones_indices[i],c=u.length;for(l=0;l<c;l++){var h=u[l],_=this.fast_bones_map[h],d=this.fast_normal_weight_map[h][i],p=d,m=_.getWorldDq();accum_dq.add(m,d,p)}accum_dq.normalize();var M=vec3.set(tmp2,o[Q_X],o[Q_Y],o[Q_Z]);final_pt=accum_dq.transform(M),1==this.use_post_displacements&&(final_pt[Q_X]+=this.post_displacements[i][Q_X],final_pt[Q_Y]+=this.post_displacements[i][Q_Y]),t[0+n]=final_pt[Q_X],t[1+n]=final_pt[Q_Y],t[2+n]=final_pt[Q_Z],r+=3,n+=3}1==this.use_uv_warp&&this.runUvWarp()},MeshRenderRegion.prototype.setMainBoneKey=function(t){this.main_bone_key=t},MeshRenderRegion.prototype.determineMainBone=function(t){this.main_bone=t.getChildByKey(this.main_bone_key)},MeshRenderRegion.prototype.setUseDq=function(t){this.use_dq=t},MeshRenderRegion.prototype.setName=function(t){this.name=t},MeshRenderRegion.prototype.getName=function(){return this.name},MeshRenderRegion.prototype.setUseLocalDisplacements=function(t){if(this.use_local_displacements=t,this.local_displacements.length!=this.getNumPts()&&this.use_local_displacements){this.local_displacements=[];for(var e=0;e<this.getNumPts();e++)this.local_displacements.push(vec2.create())}},MeshRenderRegion.prototype.getUseLocalDisplacements=function(){return this.use_local_displacements},MeshRenderRegion.prototype.setUsePostDisplacements=function(t){if(this.use_post_displacements=t,this.post_displacements.length!=this.getNumPts()&&this.use_post_displacements){this.post_displacements=[];for(var e=0;e<this.getNumPts();e++)this.post_displacements.push(vec2.create())}},MeshRenderRegion.prototype.getUsePostDisplacements=function(){return this.use_post_displacements},MeshRenderRegion.prototype.getRestLocalPt=function(t){var e=this.getRestPtsIndex()+3*t;return vec2.fromValues(this.store_rest_pts[0+e],this.store_rest_pts[1+e])},MeshRenderRegion.prototype.getLocalIndex=function(t){var e=this.getIndicesIndex()+t;return this.store_indices[e]},MeshRenderRegion.prototype.clearLocalDisplacements=function(){for(var t=0;t<this.local_displacements.length;t++)this.local_displacements[t]=vec2.create()},MeshRenderRegion.prototype.clearPostDisplacements=function(){for(var t=0;t<this.post_displacements.length;t++)this.post_displacements[t]=vec2.create()},MeshRenderRegion.prototype.setUseUvWarp=function(t){this.use_uv_warp=t,0==this.use_uv_warp&&this.restoreRefUv()},MeshRenderRegion.prototype.getUseUvWarp=function(){return this.use_uv_warp},MeshRenderRegion.prototype.setUvWarpLocalOffset=function(t){this.uv_warp_local_offset=t},MeshRenderRegion.prototype.setUvWarpGlobalOffset=function(t){this.uv_warp_global_offset=t},MeshRenderRegion.prototype.setUvWarpScale=function(t){this.uv_warp_scale=t},MeshRenderRegion.prototype.getUvWarpLocalOffset=function(){return this.uv_warp_local_offset},MeshRenderRegion.prototype.getUvWarpGlobalOffset=function(){return this.uv_warp_global_offset},MeshRenderRegion.prototype.getUvWarpScale=function(){return this.uv_warp_scale},MeshRenderRegion.prototype.runUvWarp=function(){for(var t=this.getUVsIndex(),e=0;e<this.uv_warp_ref_uvs.length;e++){var a=vec2.clone(this.uv_warp_ref_uvs[e]);(a=vec2.subtract(a,a,this.uv_warp_local_offset))[Q_X]*=this.uv_warp_scale[Q_X],a[Q_Y]*=this.uv_warp_scale[Q_Y],a=vec2.add(a,a,this.uv_warp_global_offset),this.store_uvs[0+t]=a[Q_X],this.store_uvs[1+t]=a[Q_Y],t+=2}},MeshRenderRegion.prototype.restoreRefUv=function(){for(var t=this.getUVsIndex(),e=0;e<this.uv_warp_ref_uvs.length;e++){var a=this.uv_warp_ref_uvs[e];this.store_uvs[0+t]=a[Q_X],this.store_uvs[1+t]=a[Q_Y],t+=2}},MeshRenderRegion.prototype.getTagId=function(){return this.tag_id},MeshRenderRegion.prototype.setTagId=function(t){this.tag_id=t},MeshRenderRegion.prototype.initFastNormalWeightMap=function(t){for(var e in this.relevant_bones_indices=[],t){var a=this.normal_weight_map[e];this.fast_normal_weight_map.push(a)}for(var r=0;r<this.getNumPts();r++){for(var n=[],i=0;i<this.fast_normal_weight_map.length;i++){.05<this.fast_normal_weight_map[i][r]&&n.push(i)}this.relevant_bones_indices.push(n)}for(var e in t){var s=t[e];this.fast_bones_map.push(s)}},MeshRenderRegion.prototype.initUvWarp=function(){var t=this.getUVsIndex();this.uv_warp_ref_uvs=[];for(var e=0;e<this.getNumPts();e++)this.uv_warp_ref_uvs.push(vec2.create()),this.uv_warp_ref_uvs[e]=vec2.fromValues(this.store_uvs[t],this.store_uvs[t+1]),t+=2},MeshRenderBoneComposition.prototype.addRegion=function(t){this.regions.push(t)},MeshRenderBoneComposition.prototype.setRootBone=function(t){this.root_bone=t},MeshRenderBoneComposition.prototype.getRootBone=function(){return this.root_bone},MeshRenderBoneComposition.prototype.initBoneMap=function(){this.bones_map=MeshRenderBoneComposition.genBoneMap(this.root_bone)},MeshRenderBoneComposition.prototype.initRegionsMap=function(){this.regions_map={};for(var t=0;t<this.regions.length;t++)cur_key=this.regions[t].getName(),this.regions_map[cur_key]=this.regions[t]},MeshRenderBoneComposition.genBoneMap=function(t){for(var e={},a=t.getAllBoneKeys(),r=0;r<a.length;r++){var n=a[r];e[n]=t.getChildByKey(n)}return e},MeshRenderBoneComposition.prototype.getBonesMap=function(){return this.bones_map},MeshRenderBoneComposition.prototype.getRegionsMap=function(){return this.regions_map},MeshRenderBoneComposition.prototype.getRegions=function(){return this.regions},MeshRenderBoneComposition.prototype.getRegionWithId=function(t){for(var e=0;e<this.regions.length;e++){var a=this.regions[e];if(a.getTagId()==t)return a}return null},MeshRenderBoneComposition.prototype.resetToWorldRestPts=function(){this.getRootBone().initWorldPts()},MeshRenderBoneComposition.prototype.updateAllTransforms=function(t){t&&this.getRootBone().computeParentTransforms(),this.getRootBone().computeWorldDeltaTransforms(),this.getRootBone().fixDQs(this.getRootBone().getWorldDq())},MeshBoneCache.prototype.setWorldStartPt=function(t){this.world_start_pt=t},MeshBoneCache.prototype.setWorldEndPt=function(t){this.world_end_pt=t},MeshBoneCache.prototype.getWorldStartPt=function(){return this.world_start_pt},MeshBoneCache.prototype.getWorldEndPt=function(){return this.world_end_pt},MeshBoneCache.prototype.getKey=function(){return this.key},MeshDisplacementCache.prototype.setLocalDisplacements=function(t){this.local_displacements=t},MeshDisplacementCache.prototype.setPostDisplacements=function(t){this.post_displacements=t},MeshDisplacementCache.prototype.getKey=function(){return this.key},MeshDisplacementCache.prototype.getLocalDisplacements=function(){return this.local_displacements},MeshDisplacementCache.prototype.getPostDisplacements=function(){return this.post_displacements},MeshUVWarpCache.prototype.setUvWarpLocalOffset=function(t){this.uv_warp_local_offset=t},MeshUVWarpCache.prototype.setUvWarpGlobalOffset=function(t){this.uv_warp_global_offset=t},MeshUVWarpCache.prototype.setUvWarpScale=function(t){this.uv_warp_scale=t},MeshUVWarpCache.prototype.getUvWarpLocalOffset=function(){return this.uv_warp_local_offset},MeshUVWarpCache.prototype.getUvWarpGlobalOffset=function(){return this.uv_warp_global_offset},MeshUVWarpCache.prototype.getUvWarpScale=function(){return this.uv_warp_scale},MeshUVWarpCache.prototype.getKey=function(){return this.key},MeshUVWarpCache.prototype.setEnabled=function(t){this.enabled=t},MeshUVWarpCache.prototype.getEnabled=function(){return this.enabled},MeshOpacityCache.prototype.setOpacity=function(t){this.opacity=t},MeshOpacityCache.prototype.getOpacity=function(){return this.opacity},MeshOpacityCache.prototype.getKey=function(){return this.key},MeshBoneCacheManager.prototype.init=function(t,e){this.start_time=t,this.end_time=e;var a=this.end_time-this.start_time+1;this.bone_cache_table=[],this.bone_cache_data_ready=[];for(var r=0;r<a;r++)this.bone_cache_table.push([]),this.bone_cache_data_ready.push(!1);this.is_ready=!1},MeshBoneCacheManager.prototype.getStartTime=function(){return this.start_time},MeshBoneCacheManager.prototype.getEndime=function(){return this.end_time},MeshBoneCacheManager.prototype.getIndexByTime=function(t){var e=t-this.start_time;return e=Utils.clamp(e,0,this.bone_cache_table.length-1)},MeshBoneCacheManager.prototype.retrieveValuesAtTime=function(t,e){var a=this.getIndexByTime(Math.floor(t)),r=this.getIndexByTime(Math.ceil(t)),n=t-Math.floor(t);if(0!=this.bone_cache_data_ready.length&&0!=this.bone_cache_data_ready[a]&&0!=this.bone_cache_data_ready[r])for(var i=this.bone_cache_table[a],s=this.bone_cache_table[r],o=0,l=i.length;o<l;o++){var u=i[o],c=s[o],h=u.getKey(),_=Utils.vecInterp(u.getWorldStartPt(),c.getWorldStartPt(),n),d=Utils.vecInterp(u.getWorldEndPt(),c.getWorldEndPt(),n);e[h].setWorldStartPt(_),e[h].setWorldEndPt(d)}},MeshBoneCacheManager.prototype.allReady=function(){if(this.is_ready)return!0;for(var t=this.end_time-this.start_time+1,e=0,a=0;a<this.bone_cache_data_ready.size();a++)this.bone_cache_data_ready[a]&&e++;return e==t&&(this.is_ready=!0),this.is_ready},MeshBoneCacheManager.prototype.makeAllReady=function(){for(var t=0;t<this.bone_cache_data_ready.length;t++)this.bone_cache_data_ready[t]=!0},MeshDisplacementCacheManager.prototype.init=function(t,e){this.start_time=t,this.end_time=e;var a=this.end_time-this.start_time+1;this.displacement_cache_table=[],this.displacement_cache_data_ready=[];for(var r=0;r<a;r++)this.displacement_cache_table.push([]),this.displacement_cache_data_ready.push(!1);this.is_ready=!1},MeshDisplacementCacheManager.prototype.getStartTime=function(){return this.start_time},MeshDisplacementCacheManager.prototype.getEndime=function(){return this.end_time},MeshDisplacementCacheManager.prototype.getIndexByTime=function(t){var e=t-this.start_time;return e=Utils.clamp(e,0,this.displacement_cache_table.length-1)},MeshDisplacementCacheManager.prototype.retrieveValuesAtTime=function(t,e){var a=this.getIndexByTime(Math.floor(t)),r=this.getIndexByTime(Math.ceil(t)),n=t-Math.floor(t);if(0!=this.displacement_cache_data_ready.length&&0!=this.displacement_cache_data_ready[a]&&0!=this.displacement_cache_data_ready[r])for(var i=this.displacement_cache_table[a],s=this.displacement_cache_table[r],o=0;o<i.length;o++){var l=i[o],u=s[o],c=e[l.getKey()];if(c.getUseLocalDisplacements()){var h=c.local_displacements;if(l.getLocalDisplacements().length==h.length&&u.getLocalDisplacements().length==h.length)for(var _=0;_<h.length;_++){var d=Utils.vec2Interp(l.getLocalDisplacements()[_],u.getLocalDisplacements()[_],n);h[_]=d}else for(_=0;_<h.length;_++)h[_]=vec2.create()}if(c.getUsePostDisplacements()){h=c.post_displacements;if(l.getPostDisplacements().length==h.length&&u.getPostDisplacements().length==h.length)for(_=0;_<h.length;_++){d=Utils.vec2Interp(l.getPostDisplacements()[_],u.getPostDisplacements()[_],n);h[_]=d}else for(_=0;_<h.length;_++)h[_]=vec2.create()}}},MeshDisplacementCacheManager.prototype.allReady=function(){if(this.is_ready)return!0;for(var t=this.end_time-this.start_time+1,e=0,a=0;a<this.displacement_cache_data_ready.length;a++)this.displacement_cache_data_ready[a]&&e++;return e==t&&(this.is_ready=!0),this.is_ready},MeshDisplacementCacheManager.prototype.makeAllReady=function(){for(var t=0;t<this.displacement_cache_data_ready.length;t++)this.displacement_cache_data_ready[t]=!0},MeshUVWarpCacheManager.prototype.init=function(t,e){this.start_time=t,this.end_time=e;var a=this.end_time-this.start_time+1;this.uv_cache_table=[],this.uv_cache_data_ready=[];for(var r=0;r<a;r++)this.uv_cache_table.push([]),this.uv_cache_data_ready.push(!1);this.is_ready=!1},MeshUVWarpCacheManager.prototype.getStartTime=function(){return this.start_time},MeshUVWarpCacheManager.prototype.getEndime=function(){return this.end_time},MeshUVWarpCacheManager.prototype.getIndexByTime=function(t){var e=t-this.start_time;return e=Utils.clamp(e,0,this.uv_cache_table.length-1)},MeshUVWarpCacheManager.prototype.retrieveValuesAtTime=function(t,e){var a=this.getIndexByTime(Math.floor(t)),r=this.getIndexByTime(Math.ceil(t));Math.floor(t);if(0!=this.uv_cache_data_ready.length&&0!=this.uv_cache_data_ready[a]&&0!=this.uv_cache_data_ready[r])for(var n=this.uv_cache_table[a],i=this.uv_cache_table[r],s=0;s<n.length;s++){var o=n[s],l=(i[s],e[o.getKey()]);if(l.getUseUvWarp()){var u=o.getUvWarpLocalOffset(),c=o.getUvWarpGlobalOffset(),h=o.getUvWarpScale();l.setUvWarpLocalOffset(u),l.setUvWarpGlobalOffset(c),l.setUvWarpScale(h)}}},MeshUVWarpCacheManager.prototype.allReady=function(){if(this.is_ready)return!0;for(var t=this.end_time-this.start_time+1,e=0,a=0;a<this.uv_cache_data_ready.length;a++)uv_cache_data_ready[a]&&e++;return e==t&&(this.is_ready=!0),this.is_ready},MeshUVWarpCacheManager.prototype.makeAllReady=function(){for(var t=0;t<this.uv_cache_data_ready.length;t++)this.uv_cache_data_ready[t]=!0},MeshOpacityCacheManager.prototype.init=function(t,e){this.start_time=t,this.end_time=e;var a=this.end_time-this.start_time+1;this.opacity_cache_table=[],this.opacity_cache_data_ready=[];for(var r=0;r<a;r++)this.opacity_cache_table.push([]),this.opacity_cache_data_ready.push(!1);this.is_ready=!1},MeshOpacityCacheManager.prototype.getStartTime=function(){return this.start_time},MeshOpacityCacheManager.prototype.getEndime=function(){return this.end_time},MeshOpacityCacheManager.prototype.getIndexByTime=function(t){var e=t-this.start_time;return e=Utils.clamp(e,0,this.opacity_cache_table.length-1)},MeshOpacityCacheManager.prototype.retrieveValuesAtTime=function(t,e){var a=this.getIndexByTime(Math.floor(t)),r=this.getIndexByTime(Math.ceil(t));Math.floor(t);if(0!=this.opacity_cache_data_ready.length&&0!=this.opacity_cache_data_ready[a]&&0!=this.opacity_cache_data_ready[r])for(var n=this.opacity_cache_table[a],i=0;i<n.length;i++){var s=n[i];e[s.getKey()].opacity=s.getOpacity()}},MeshOpacityCacheManager.prototype.allReady=function(){if(this.is_ready)return!0;for(var t=this.end_time-this.start_time+1,e=0,a=0;a<this.opacity_cache_data_ready.length;a++)opacity_cache_data_ready[a]&&e++;return e==t&&(this.is_ready=!0),this.is_ready},MeshOpacityCacheManager.prototype.makeAllReady=function(){for(var t=0;t<this.opacity_cache_data_ready.length;t++)this.opacity_cache_data_ready[t]=!0};var CreatureModuleUtils={};function CreatureUVSwapPacket(t,e,a,r){this.local_offset=t,this.global_offset=e,this.scale=a,this.tag=r}function Creature(t,e){this.InitDefaultData(),e?this.LoadFromDataFlat(t):this.LoadFromData(t)}function CreatureAnimation(t,e,a){this.initDefaultData(e),a?this.LoadFromDataFlat(e,t.dataAnimation()):this.LoadFromData(e,t)}function CreatureFrameCallback(){this.callback=null,this.name="",this.animClipName="",this.frame=0,this.triggered=!1}function CreatureGameController(t){this.meta_asset=t,this.event_callbacks=[],this.run_time=0}function CreatureMetaData(){this.skin_swaps={},this.anim_events_map={}}function CreatureManager(t){this.target_creature=t,this.is_playing=!1,this.run_time=0,this.time_scale=30,this.blending_factor=0,this.should_loop=!0,this.use_custom_time_range=!1,this.custom_start_time=0,this.custom_end_time=0,this.animations={},this.bones_override_callback=null,this.blend_render_pts=[],this.blend_render_pts.push([]),this.blend_render_pts.push([]),this.do_blending=!1,this.active_blend_animation_names=[],this.active_blend_animation_names.push(""),this.active_blend_animation_names.push(""),this.do_auto_blending=!1,this.auto_blend_delta=0,this.auto_blend_names=[],this.auto_blend_names.push(""),this.auto_blend_names.push(""),this.active_blend_run_times={}}function isDictEmpty(t){for(var e in t)return!1;return!0}CreatureModuleUtils.LoadCreatureFlatData=function(t){var e=new flatbuffers.ByteBuffer(t);return CreatureFlatData.rootData.getRootAsrootData(e)},CreatureModuleUtils.BuildCreatureMetaData=function(t){var e=new CreatureMetaData;if("skinSwapList"in t){var a=t.skinSwapList;for(var r in a){for(var n=a[r].swap.swap_items,i={},s=0;s<n.length;s++){var o=n[s];i[o]=o}e.skin_swaps[r]=i}}if("eventTriggers"in t){var l=t.eventTriggers;for(var u in l){var c={},h=l[u];for(var _ in h){var d=_.event_name;c[Number(_.switch_time)]=d}e.anim_events_map[u]=c}}return e},CreatureModuleUtils.GetAllAnimationNames=function(t){var e=t.animation,a=[];for(var r in e)a.push(r);return a},CreatureModuleUtils.getFloatArray=function(t){return t},CreatureModuleUtils.getIntArray=function(t){return t},CreatureModuleUtils.ReadPointsArray2DJSON=function(t,e){for(var a=CreatureModuleUtils.getFloatArray(t[e]),r=[],n=a.length/2,i=0;i<n;i++){var s=2*i;r.push(vec2.fromValues(a[0+s],a[1+s]))}return r},CreatureModuleUtils.ReadPointsArray2DFlat=function(t){for(var e=t,a=[],r=e.length/2,n=0;n<r;n++){var i=2*n;a.push(vec2.fromValues(e[0+i],e[1+i]))}return a},CreatureModuleUtils.ReadFloatArray3DJSON=function(t,e){for(var a=CreatureModuleUtils.getFloatArray(t[e]),r=[],n=a.length/2,i=0;i<n;i++){var s=2*i;r.push(a[0+s]),r.push(a[1+s]),r.push(0)}return r},CreatureModuleUtils.ReadFloatArray3DFlat=function(t){for(var e=t,a=[],r=e.length/2,n=0;n<r;n++){var i=2*n;a.push(e[0+i]),a.push(e[1+i]),a.push(0)}return a},CreatureModuleUtils.ReadBoolJSON=function(t,e){return t[e]},CreatureModuleUtils.ReadFloatArrayJSON=function(t,e){return t[e]},CreatureModuleUtils.ReadIntArrayJSON=function(t,e){return t[e]},CreatureModuleUtils.ReadMatrixJSON=function(t,e){for(var a=CreatureModuleUtils.getFloatArray(t[e]),r=mat4.create(),n=0;n<16;n++)r[n]=a[n];return r},CreatureModuleUtils.ReadMatrixFlat=function(t){for(var e=t,a=mat4.create(),r=0;r<16;r++)a[r]=e[r];return a},CreatureModuleUtils.ReadVector2JSON=function(t,e){var a=CreatureModuleUtils.getFloatArray(t[e]);return vec2.fromValues(a[0],a[1])},CreatureModuleUtils.ReadVector2Flat=function(t){var e=t;return vec2.fromValues(e[0],e[1])},CreatureModuleUtils.ReadVector3JSON=function(t,e){var a=CreatureModuleUtils.getFloatArray(t[e]);return vec3.fromValues(a[0],a[1],0)},CreatureModuleUtils.ReadVectorFlat=function(t){var e=t;return vec3.fromValues(e[0],e[1],0)},CreatureModuleUtils.FormBoneHierarchy=function(t,e){var a=null;for(var r in e)if(r in t==0){a=(n=e[r]).first;break}for(var r in e)for(var n,i=(n=e[r]).first,s=n.second,o=0;o<s.length;o++){var l=e[s[o]].first;i.addChild(l)}return a},CreatureModuleUtils.CreateBones=function(t,e){var a=t[e],r={},n={};for(var i in a){var s=a[i],o=s.id,l=CreatureModuleUtils.ReadMatrixJSON(s,"restParentMat"),u=CreatureModuleUtils.ReadVector3JSON(s,"localRestStartPt"),c=CreatureModuleUtils.ReadVector3JSON(s,"localRestEndPt"),h=CreatureModuleUtils.ReadIntArrayJSON(s,"children"),_=new MeshBone(i,vec3.create(),vec3.create(),l);_.local_rest_start_pt=u,_.local_rest_end_pt=c,_.calcRestData(),_.setTagId(o),r[o]={first:_,second:h};for(var d=0;d<h.length;d++){var p=h[d];n[p]=p}}return this.FormBoneHierarchy(n,r)},CreatureModuleUtils.CreateBonesFlat=function(t){for(var e={},a={},r=0;r<t.bonesLength();r++){var n=t.bones(r),i=n.name(),s=n.id(),o=CreatureModuleUtils.ReadMatrixFlat(n.restParentMatArray()),l=CreatureModuleUtils.ReadFloatArray3DFlat(n.localRestStartPtArray()),u=CreatureModuleUtils.ReadFloatArray3DFlat(n.localRestEndPtArray()),c=CreatureModuleUtils.getIntArray(n.childrenArray()),h=new MeshBone(i,vec3.create(),vec3.create(),o);h.local_rest_start_pt=l,h.local_rest_end_pt=u,h.calcRestData(),h.setTagId(s),e[s]={first:h,second:c};for(var _=0;_<c.length;_++){var d=c[_];a[d]=d}}return this.FormBoneHierarchy(a,e)},CreatureModuleUtils.CreateRegions=function(t,e,a,r,n){var i=[],s=t[e];for(var o in s){var l=s[o],u=l.id,c=new MeshRenderRegion(a,r,n,l.start_pt_index,l.end_pt_index,l.start_index,l.end_index);c.setName(o),c.setTagId(u);var h=c.normal_weight_map,_=l.weights;for(var d in _){_[d];var p=CreatureModuleUtils.ReadFloatArrayJSON(_,d);h[d]=p}i.push(c)}return i},CreatureModuleUtils.CreateRegionsFlat=function(t,e,a,r){for(var n=[],i=0;i<t.regionsLength();i++){var s=t.regions(i),o=s.name(),l=s.id(),u=new MeshRenderRegion(e,a,r,s.startPtIndex(),s.endPtIndex(),s.startIndex(),s.endIndex());u.setName(o),u.setTagId(l);for(var c=u.normal_weight_map,h=(s.weights,0);h<s.weightsLength();h++){var _=s.weights(h),d=_.name(),p=CreatureModuleUtils.getFloatArray(_.weightsArray());c[d]=p}n.push(u)}return n},CreatureModuleUtils.GetStartEndTimes=function(t,e){var a=0,r=0,n=!0,i=t[e];for(var s in i){i[s];var o=parseInt(s);n?(r=a=o,n=!1):(r<o&&(r=o),o<a&&(a=o))}return{first:a,second:r}},CreatureModuleUtils.GetStartEndTimesFlat=function(t){for(var e=0,a=0,r=!0,n=0;n<t.timeSamplesLength();n++){var i=t.timeSamples(n).time();r?(a=e=i,r=!1):(a<i&&(a=i),i<e&&(e=i))}return{first:e,second:a}},CreatureModuleUtils.FillBoneGapCache=function(t,e,a,r,n){var i=e-t;if(1<i)for(var s=r.getIndexByTime(t),o=1;o<i;o++){for(var l=o/i,u=[],c=0;c<n.length;c++){var h=r.bone_cache_table[a][c],_=r.bone_cache_table[s][c],d=new MeshBoneCache(h.getKey());d.setWorldStartPt(Utils.vecInterp(_.getWorldStartPt(),h.getWorldStartPt(),l)),d.setWorldEndPt(Utils.vecInterp(_.getWorldEndPt(),h.getWorldEndPt(),l)),u.push(d)}r.bone_cache_table[s+o]=u}},CreatureModuleUtils.FillBoneCache=function(t,e,a,r,n){var i=t[e];n.init(a,r);var s=a;for(var o in i){var l=i[o];for(var u in cache_list=[],l){var c=l[u],h=CreatureModuleUtils.ReadVector3JSON(c,"start_pt"),_=CreatureModuleUtils.ReadVector3JSON(c,"end_pt"),d=new MeshBoneCache(u);d.setWorldStartPt(h),d.setWorldEndPt(_),cache_list.push(d)}var p=n.getIndexByTime(o);n.bone_cache_table[p]=cache_list,CreatureModuleUtils.FillBoneGapCache(s,o,p,n,cache_list),s=o}n.makeAllReady()},CreatureModuleUtils.FillBoneCacheFlat=function(t,e,a,r){r.init(e,a);for(var n=e,i=0;i<t.timeSamplesLength();i++){var s=t.timeSamples(i),o=s.time();cache_list=[];for(var l=0;l<s.bonesLength();l++){var u=s.bones(l),c=u.name(),h=CreatureModuleUtils.ReadFloatArray3DFlat(u.startPtArray()),_=CreatureModuleUtils.ReadFloatArray3DFlat(u.endPtArray()),d=new MeshBoneCache(c);d.setWorldStartPt(h),d.setWorldEndPt(_),cache_list.push(d)}var p=r.getIndexByTime(o);r.bone_cache_table[p]=cache_list,CreatureModuleUtils.FillBoneGapCache(n,o,p,r,cache_list),n=o}r.makeAllReady()},CreatureModuleUtils.FillDeformationGapCache=function(t,e,a,r,n){var i=e-t;if(1<i)for(var s=r.getIndexByTime(t),o=1;o<i;o++){for(var l=o/i,u=[],c=0;c<n.length;c++){var h=r.displacement_cache_table[a][c],_=r.displacement_cache_table[s][c],d=new MeshDisplacementCache(h.getKey());0<h.getLocalDisplacements().length?d.setLocalDisplacements(Utils.ptsInterp(_.getLocalDisplacements(),h.getLocalDisplacements(),l)):d.setPostDisplacements(Utils.ptsInterp(_.getPostDisplacements(),h.getPostDisplacements(),l)),u.push(d)}r.displacement_cache_table[s+o]=u}},CreatureModuleUtils.FillDeformationCache=function(t,e,a,r,n){var i=t[e];n.init(a,r);var s=a;for(var o in i){var l=i[o],u=[];for(var c in l){var h=l[c],_=new MeshDisplacementCache(c),d=CreatureModuleUtils.ReadBoolJSON(h,"use_local_displacements"),p=CreatureModuleUtils.ReadBoolJSON(h,"use_post_displacements");if(1==d){var m=CreatureModuleUtils.ReadPointsArray2DJSON(h,"local_displacements");_.setLocalDisplacements(m)}if(1==p){m=CreatureModuleUtils.ReadPointsArray2DJSON(h,"post_displacements");_.setPostDisplacements(m)}u.push(_)}var M=n.getIndexByTime(o);n.displacement_cache_table[M]=u,CreatureModuleUtils.FillDeformationGapCache(s,o,M,n,u),s=o}n.makeAllReady()},CreatureModuleUtils.FillDeformationCacheFlat=function(t,e,a,r){r.init(e,a);for(var n=e,i=0;i<t.timeSamplesLength();i++){for(var s=t.timeSamples(i),o=s.time(),l=[],u=0;u<s.meshesLength();u++){var c=s.meshes(u),h=new MeshDisplacementCache(c.name()),_=c.useLocalDisplacements(),d=c.usePostDisplacements();if(1==_){var p=CreatureModuleUtils.ReadPointsArray2DFlat(c.localDisplacementsArray());h.setLocalDisplacements(p)}if(1==d){c.postDisplacementsLength(),p=CreatureModuleUtils.ReadPointsArray2DFlat(c.postDisplacementsArray());h.setPostDisplacements(p)}l.push(h)}var m=r.getIndexByTime(o);r.displacement_cache_table[m]=l,CreatureModuleUtils.FillDeformationGapCache(n,o,m,r,l),n=o}r.makeAllReady()},CreatureModuleUtils.FillUVSwapCache=function(t,e,a,r,n){var i=t[e];for(var s in n.init(a,r),i){var o=i[s],l=[];for(var u in o){var c=o[u],h=new MeshUVWarpCache(u),_=CreatureModuleUtils.ReadBoolJSON(c,"enabled");if(h.setEnabled(_),1==_){var d=CreatureModuleUtils.ReadVector2JSON(c,"local_offset"),p=CreatureModuleUtils.ReadVector2JSON(c,"global_offset"),m=CreatureModuleUtils.ReadVector2JSON(c,"scale");h.setUvWarpLocalOffset(d),h.setUvWarpGlobalOffset(p),h.setUvWarpScale(m)}l.push(h)}var M=n.getIndexByTime(s);n.uv_cache_table[M]=l}n.makeAllReady()},CreatureModuleUtils.FillUVSwapCacheFlat=function(t,e,a,r){r.init(e,a);for(var n=0;n<t.timeSamplesLength();n++){for(var i=t.timeSamples(n),s=i.time(),o=[],l=0;l<i.uvSwapsLength();l++){var u=i.uvSwaps(l),c=new MeshUVWarpCache(u.name()),h=u.enabled();if(c.setEnabled(h),1==h){var _=CreatureModuleUtils.ReadVector2Flat(u.localOffsetArray()),d=CreatureModuleUtils.ReadVector2Flat(u.globalOffsetArray()),p=CreatureModuleUtils.ReadVector2Flat(u.scaleArray());c.setUvWarpLocalOffset(_),c.setUvWarpGlobalOffset(d),c.setUvWarpScale(p)}o.push(c)}var m=r.getIndexByTime(s);r.uv_cache_table[m]=o}r.makeAllReady()},CreatureModuleUtils.FillOpacityGapCache=function(t,e,a,r,n){var i=e-t;if(1<i)for(var s=r.getIndexByTime(t),o=1;o<i;o++){for(var l=o/i,u=[],c=0;c<n.length;c++){var h=r.opacity_cache_table[a][c],_=r.opacity_cache_table[s][c],d=new MeshOpacityCache(h.getKey());d.setOpacity(Utils.scalarInterp(_.getOpacity(),h.getOpacity(),l)),u.push(d)}r.opacity_cache_table[s+o]=u}},CreatureModuleUtils.FillOpacityCache=function(t,e,a,r,n){var i=t[e];n.init(a,r);var s=a;for(var o in i){var l=i[o],u=[];for(var c in l){var h=l[c],_=new MeshOpacityCache(c);_.setOpacity(h.opacity),u.push(_)}var d=n.getIndexByTime(o);n.opacity_cache_table[d]=u,CreatureModuleUtils.FillOpacityGapCache(s,o,d,n,u),s=o}n.makeAllReady()},CreatureModuleUtils.FillOpacityCacheFlat=function(t,e,a,r){r.init(e,a);for(var n=e,i=0;i<t.timeSamplesLength();i++){for(var s=t.timeSamples(i),o=s.time(),l=[],u=0;u<s.meshOpacitiesLength();u++){var c=s.meshOpacities(u),h=new MeshOpacityCache(c.name());h.setOpacity(c.opacity()),l.push(h)}var _=r.getIndexByTime(o);r.opacity_cache_table[_]=l,CreatureModuleUtils.FillOpacityGapCache(n,o,_,r,l),n=o}r.makeAllReady()},CreatureModuleUtils.FillSwapUVPacketMap=function(t){for(var e in ret_map={},t){for(var a=t[e],r=e,n=[],i=0;i<a.length;i++){var s=a[i],o=new CreatureUVSwapPacket(CreatureModuleUtils.ReadVector2JSON(s,"local_offset"),CreatureModuleUtils.ReadVector2JSON(s,"global_offset"),CreatureModuleUtils.ReadVector2JSON(s,"scale"),s.tag);n.push(o)}ret_map[r]=n}return ret_map},CreatureModuleUtils.FillSwapUVPacketMapFlat=function(t){ret_map={};for(var e=0;e<t.meshesLength();e++){for(var a=t.meshes(e),r=a.name(),n=[],i=0;i<a.itemsLength();i++){var s=a.items(i),o=new CreatureUVSwapPacket(CreatureModuleUtils.ReadVector2Flat(s.localOffsetArray()),CreatureModuleUtils.ReadVector2Flat(s.globalOffsetArray()),CreatureModuleUtils.ReadVector2Flat(s.scaleArray()),s.tag());n.push(o)}ret_map[r]=n}return ret_map},CreatureModuleUtils.FillAnchorPointMap=function(t){var e=t.AnchorPoints;ret_map={};for(var a=0;a<e.length;a++){var r=e[a],n=CreatureModuleUtils.ReadVector2JSON(r,"point"),i=r.anim_clip_name;ret_map[i]=n}return ret_map},CreatureModuleUtils.FillAnchorPointMapFlat=function(t){ret_map={};for(var e=0;e<t.anchorPointsLength();e++){var a=t.anchorPoints(e),r=CreatureModuleUtils.ReadVector2Flat(a.pointArray()),n=a.animClipName();ret_map[n]=r}return ret_map},Creature.prototype.InitDefaultData=function(){this.total_num_pts=0,this.total_num_indices=0,this.global_indices=null,this.global_pts=null,this.global_uvs=null,this.render_pts=null,this.render_colours=null,this.render_composition=null,this.boundary_indices=[],this.boundary_min=vec2.create(),this.boundary_max=vec2.create(),this.uv_swap_packets={},this.active_uv_swap_actions={},this.anchor_point_map={},this.anchor_points_active=!1,this.skin_swap_active=!1,this.skin_swap_name="",this.final_skin_swap_indices=null,this.creature_meta_data=null},Creature.prototype.SetMetaData=function(t){this.creature_meta_data=t},Creature.prototype.EnableSkinSwap=function(t,e){this.skin_swap_active=e,this.skin_swap_active?(this.skin_swap_name=t,this.final_skin_swap_indices=this.creature_meta_data.buildSkinSwapIndices(this.skin_swap_name,this.render_composition)):(this.skin_swap_name="",this.final_skin_swap_indices=null)},Creature.prototype.DisableSkinSwap=function(){this.EnableSkinSwap("",!1)},Creature.prototype.ShouldSkinSwap=function(){return this.creature_meta_data&&this.skin_swap_active&&this.final_skin_swap_indices},Creature.prototype.SetActiveItemSwap=function(t,e){this.active_uv_swap_actions[t]=e},Creature.prototype.RemoveActiveItemSwap=function(t){delete this.active_uv_swap_actions[t]},Creature.prototype.GetAnchorPoint=function(t){return t in this.anchor_point_map?this.anchor_point_map[t]:vec2.fromValues(0,0)},Creature.prototype.FillRenderColours=function(t,e,a,r){for(var n=0;n<this.total_num_pts;n++){var i=4*n;this.render_colours[0+i]=t,this.render_colours[1+i]=e,this.render_colours[2+i]=a,this.render_colours[3+i]=r}},Creature.prototype.ComputeBoundaryIndices=function(){for(var t={},e=0;e<this.total_num_pts;e++)t[e]=0;var a=this.render_composition.getRegions();for(e=0;e<this.global_indices.length;e++){for(var r=this.global_indices[e],n=!1,i=0;i<a.length;i++){var s=a[i],o=s.getStartPtIndex(),l=s.getEndPtIndex();if(o<=r&&r<=l){n=!0;break}}n&&t[r]++}this.boundary_indices=[];for(e=0;e<this.total_num_pts;e++)t[e]<=5&&this.boundary_indices.push(e)},Creature.prototype.ComputeBoundaryMinMax=function(){this.boundary_indices.length<=0&&this.ComputeBoundaryIndices();for(var t=3*this.boundary_indices[0],e=vec2.fromValues(this.render_pts[t+0],this.render_pts[t+1]),a=vec2.fromValues(e[0],e[1]),r=0;r<this.boundary_indices.length;r++){var n=3*this.boundary_indices[r],i=this.render_pts[n],s=this.render_pts[n+1];e[0]>i&&(e[0]=i),e[1]>s&&(e[1]=s),a[0]<i&&(a[0]=i),a[1]<s&&(a[1]=s)}this.boundary_min=e,this.boundary_max=a},Creature.prototype.LoadFromData=function(t){var e=t.mesh;this.global_pts=CreatureModuleUtils.ReadFloatArray3DJSON(e,"points"),this.total_num_pts=this.global_pts.length/3,this.global_indices=CreatureModuleUtils.ReadIntArrayJSON(e,"indices"),this.total_num_indices=this.global_indices.length,this.global_uvs=CreatureModuleUtils.ReadFloatArrayJSON(e,"uvs"),this.render_colours=[];for(var a=0;a<4*this.total_num_pts;a++)this.render_colours.push(0);this.FillRenderColours(1,1,1,1),this.render_pts=[];var r=CreatureModuleUtils.CreateBones(t,"skeleton"),n=CreatureModuleUtils.CreateRegions(e,"regions",this.global_indices,this.global_pts,this.global_uvs);this.render_composition=new MeshRenderBoneComposition,this.render_composition.setRootBone(r),this.render_composition.getRootBone().computeRestParentTransforms();for(a=0;a<n.length;a++){(i=n[a]).setMainBoneKey(r.getKey()),i.determineMainBone(r),this.render_composition.addRegion(i)}this.render_composition.initBoneMap(),this.render_composition.initRegionsMap();for(a=0;a<n.length;a++){var i;(i=n[a]).initFastNormalWeightMap(this.render_composition.bones_map)}if(this.render_composition.resetToWorldRestPts(),"uv_swap_items"in t){var s=t.uv_swap_items;this.uv_swap_packets=CreatureModuleUtils.FillSwapUVPacketMap(s)}if("anchor_points_items"in t){var o=t.anchor_points_items;this.anchor_point_map=CreatureModuleUtils.FillAnchorPointMap(o)}},Creature.prototype.LoadFromDataFlat=function(t){var e=t.dataMesh(),a=t.dataSkeleton();this.global_pts=CreatureModuleUtils.ReadFloatArray3DFlat(e.pointsArray()),this.total_num_pts=this.global_pts.length/3,this.global_indices=CreatureModuleUtils.getIntArray(e.indicesArray()),this.total_num_indices=this.global_indices.length,this.global_uvs=CreatureModuleUtils.getFloatArray(e.uvsArray()),this.render_colours=[];for(var r=0;r<4*this.total_num_pts;r++)this.render_colours.push(0);this.FillRenderColours(1,1,1,1),this.render_pts=[];var n=CreatureModuleUtils.CreateBonesFlat(a),i=CreatureModuleUtils.CreateRegionsFlat(e,this.global_indices,this.global_pts,this.global_uvs);this.render_composition=new MeshRenderBoneComposition,this.render_composition.setRootBone(n),this.render_composition.getRootBone().computeRestParentTransforms();for(r=0;r<i.length;r++){(s=i[r]).setMainBoneKey(n.getKey()),s.determineMainBone(n),this.render_composition.addRegion(s)}this.render_composition.initBoneMap(),this.render_composition.initRegionsMap();for(r=0;r<i.length;r++){var s;(s=i[r]).initFastNormalWeightMap(this.render_composition.bones_map)}this.render_composition.resetToWorldRestPts();var o=t.dataUvSwapItem();this.uv_swap_packets=CreatureModuleUtils.FillSwapUVPacketMapFlat(o);var l=t.dataAnchorPoints();this.anchor_point_map=CreatureModuleUtils.FillAnchorPointMapFlat(l)},CreatureAnimation.prototype.initDefaultData=function(t){this.name=t,this.bones_cache=new MeshBoneCacheManager,this.displacement_cache=new MeshDisplacementCacheManager,this.uv_warp_cache=new MeshUVWarpCacheManager,this.opacity_cache=new MeshOpacityCacheManager,this.cache_pts=[],this.fill_cache_pts=[]},CreatureAnimation.prototype.LoadFromData=function(t,e){var a=e.animation[t],r=CreatureModuleUtils.GetStartEndTimes(a,"bones");this.start_time=r.first,this.end_time=r.second,CreatureModuleUtils.FillBoneCache(a,"bones",this.start_time,this.end_time,this.bones_cache),CreatureModuleUtils.FillDeformationCache(a,"meshes",this.start_time,this.end_time,this.displacement_cache),CreatureModuleUtils.FillUVSwapCache(a,"uv_swaps",this.start_time,this.end_time,this.uv_warp_cache),CreatureModuleUtils.FillOpacityCache(a,"mesh_opacities",this.start_time,this.end_time,this.opacity_cache)},CreatureAnimation.prototype.LoadFromDataFlat=function(t,e){for(var a=null,r=0;r<e.clipsLength();r++)if(e.clips(r).name()==t){a=e.clips(r);break}var n=CreatureModuleUtils.GetStartEndTimesFlat(a.bones());this.start_time=n.first,this.end_time=n.second,CreatureModuleUtils.FillBoneCacheFlat(a.bones(),this.start_time,this.end_time,this.bones_cache),CreatureModuleUtils.FillDeformationCacheFlat(a.meshes(),this.start_time,this.end_time,this.displacement_cache),CreatureModuleUtils.FillUVSwapCacheFlat(a.uvSwaps(),this.start_time,this.end_time,this.uv_warp_cache),CreatureModuleUtils.FillOpacityCacheFlat(a.meshOpacities(),this.start_time,this.end_time,this.opacity_cache)},CreatureAnimation.prototype.getIndexByTime=function(t){var e=t-this.start_time;return e=Utils.clamp(e,0,this.cache_pts.length-1)},CreatureAnimation.prototype.verifyFillCache=function(){this.fill_cache_pts.length==this.end_time-this.start_time+1&&(this.cache_pts=this.fill_cache_pts)},CreatureAnimation.prototype.poseFromCachePts=function(t,e,a){for(var r=this.getIndexByTime(Math.floor(t)),n=this.getIndexByTime(Math.ceil(t)),i=t-Math.floor(t),s=e,o=this.cache_pts[r],l=this.cache_pts[n],u=0,c=0,h=0,_=0;_<a;_++)s[u+0]=(1-i)*o[c+0]+i*l[h+0],s[u+1]=(1-i)*o[c+1]+i*l[h+1],s[u+2]=(1-i)*o[c+2]+i*l[h+2],u+=3,c+=3,h+=3},CreatureFrameCallback.prototype.resetCallback=function(){this.triggered=!1},CreatureFrameCallback.prototype.tryTrigger=function(t){return!this.triggered&&(Math.round(t)>=this.frame&&(this.triggered=!0))},CreatureGameController.prototype.BuildFrameCallbacks=function(t){if(null!=this.meta_asset)for(var e in this.meta_asset.anim_events_map){var a=this.meta_asset.anim_events_map[e];for(var r in a){var n=a[r],i=new CreatureFrameCallback;i.animClipName=e,i.name=n,i.frame=Number(r),i.callback=t(animClipName,name),this.event_callbacks.push(i)}}},CreatureGameController.prototype.AddFrameCallback=function(t,e,a,r){var n=new CreatureFrameCallback;n.animClipName=t,n.name=e,n.frame=a,n.callback=r,this.event_callbacks.push(n)},CreatureGameController.prototype.ResetFrameCallbacks=function(){for(var t in this.event_callbacks){this.event_callbacks[t].resetCallback()}},CreatureGameController.prototype.ProcessCallbacks=function(t){var e=t.getActualRuntime();e<this.run_time&&this.ResetFrameCallbacks(),this.run_time=e;for(var a=0;a<this.event_callbacks.length;a++){var r=this.event_callbacks[a];if(r.animClipName==t.active_animation_name)r.tryTrigger(e)&&null!=r.callback&&r.callback(r.name,e)}},CreatureMetaData.prototype.clear=function(){this.skin_swaps={},this.anim_events_map={}},CreatureMetaData.prototype.buildSkinSwapIndices=function(t,e){var a=null;if(!(t in this.skin_swaps))return a=[];var r=this.skin_swaps[t],n=e.getRegionsMap();for(var i in n){if(i in r)(s=n[i]).getNumIndices()}a=[];for(var i in n)if(i in r){for(var s=n[i],o=0;o<s.getNumIndices();o++)a.push(s.getLocalIndex(o));s.getNumIndices()}return a},CreatureManager.prototype.CreateAnimation=function(t,e){var a=new CreatureAnimation(t,e);this.AddAnimation(a)},CreatureManager.prototype.CreateAllAnimations=function(t){for(var e=CreatureModuleUtils.GetAllAnimationNames(t),a=0;a<e.length;a++){var r=e[a];this.CreateAnimation(t,r)}this.SetActiveAnimationName(e[0])},CreatureManager.prototype.AddAnimation=function(t){this.animations[t.name]=t},CreatureManager.prototype.GetAnimation=function(t){return this.animations[t]},CreatureManager.prototype.GetCreature=function(){return this.target_creature},CreatureManager.prototype.GetAnimationNames=function(){var t=[];for(var e in animations)t.push(e);return t},CreatureManager.prototype.SetActiveAnimationName=function(t,e){if(null==t||t in this.animations==0)return!1;if(1==e&&this.active_animation_name==t)return!1;this.active_animation_name=t;var a=this.animations[this.active_animation_name];return this.run_time=a.start_time,this.UpdateRegionsSwitches(t),!0},CreatureManager.prototype.GetActiveAnimationName=function(){return this.active_animation_name},CreatureManager.prototype.GetAllAnimations=function(){return this.animations},CreatureManager.prototype.MakePointCache=function(t){var e=this.getRunTime(),a=this.animations[t];if(!(0<a.length)){var r=a.cache_pts;this.UpdateRegionsSwitches(t);for(var n=a.start_time;n<=a.end_time;n++){this.setRunTime(n);for(var i=[],s=0;s<3*this.target_creature.total_num_pts;s++)i[s]=0;this.PoseCreature(t,i,this.getRunTime()),r.push(i)}this.setRunTime(e)}},CreatureManager.prototype.FillSinglePointCacheFrame=function(t,e){var a=this.getRunTime(),r=this.animations[t];this.setRunTime(e);for(var n=[],i=0;i<3*this.target_creature.total_num_pts;i++)n[i]=0;this.PoseCreature(t,n,e),r.fill_cache_pts.push(n),r.verifyFillCache(),this.setRunTime(a)},CreatureManager.prototype.GetIsPlaying=function(){return this.is_playing},CreatureManager.prototype.SetShouldLoop=function(t){this.should_loop=t},CreatureManager.prototype.SetUseCustomTimeRange=function(t){this.use_custom_time_range=t},CreatureManager.prototype.SetCustomTimeRange=function(t,e){this.custom_start_time=t,this.custom_end_time=e},CreatureManager.prototype.SetIsPlaying=function(t){this.is_playing=t},CreatureManager.prototype.ProcessAutoBlending=function(){this.blending_factor+=this.auto_blend_delta,1<this.blending_factor&&(this.blending_factor=1)},CreatureManager.prototype.IncreAutoBlendRunTimes=function(t){set_animation_name="";for(var e=0;e<this.auto_blend_names.length;e++){var a=this.auto_blend_names[e];a in this.animations&&set_animation_name!=a&&(cur_run_time=this.active_blend_run_times[a],cur_run_time+=t,cur_run_time=this.correctRunTime(cur_run_time,a),this.active_blend_run_times[a]=cur_run_time,set_animation_name=a)}},CreatureManager.prototype.correctRunTime=function(t,e){return ret_time=t,cur_animation=this.animations[e],anim_start_time=cur_animation.start_time,anim_end_time=cur_animation.end_time,ret_time>anim_end_time?this.should_loop?ret_time=anim_start_time:ret_time=anim_end_time:ret_time<anim_start_time&&(this.should_loop?ret_time=anim_end_time:ret_time=anim_start_time),ret_time},CreatureManager.prototype.ResetToStartTimes=function(){var t=this.animations[active_animation_name];this.run_time=t.start_time},CreatureManager.prototype.setRunTime=function(t){this.run_time=t,this.correctTime()},CreatureManager.prototype.increRunTime=function(t){this.run_time+=t,this.correctTime()},CreatureManager.prototype.correctTime=function(){var t=this.animations[this.active_animation_name],e=t.start_time,a=t.end_time;this.use_custom_time_range&&(e=this.custom_start_time,a=this.custom_end_time),this.run_time>a?this.should_loop?this.run_time=e:this.run_time=a:this.run_time<e&&(this.should_loop?this.run_time=a:this.run_time=e)},CreatureManager.prototype.getRunTime=function(){return this.run_time},CreatureManager.prototype.getActualRuntime=function(){return this.do_auto_blending&&this.active_animation_name in this.active_blend_run_times?this.active_blend_run_times[this.active_animation_name]:this.run_time},CreatureManager.prototype.checkAnimationBlendValid=function(){for(var t=0;t<2;t++)if(cur_animation_name=this.active_blend_animation_names[t],!(cur_animation_name in this.animations&&cur_animation_name in this.active_blend_run_times))return!1;return!0},CreatureManager.prototype.UpdateRegionsSwitches=function(t){for(var e=this.animations[t],a=e.displacement_cache.displacement_cache_table[0],r=e.uv_warp_cache.uv_cache_table[0],n=this.target_creature.render_composition.getRegions(),i=0,s=0;s<n.length;s++){var o=n[s],l=!(0==a[i].getLocalDisplacements().length),u=!(0==a[i].getPostDisplacements().length);o.setUseLocalDisplacements(l),o.setUsePostDisplacements(u),o.setUseUvWarp(r[i].getEnabled()),i++}},CreatureManager.prototype.Update=function(t){this.is_playing&&(this.increRunTime(t*this.time_scale),this.do_auto_blending&&(this.ProcessAutoBlending(),this.IncreAutoBlendRunTimes(t*this.time_scale)),this.RunCreature())},CreatureManager.prototype.RunAtTime=function(t){this.is_playing&&(this.setRunTime(t),this.RunCreature())},CreatureManager.prototype.RunCreature=function(){if(this.do_blending){for(var t=0;t<2;t++){cur_animation_name=this.active_blend_animation_names[t];var e=this.animations[this.active_blend_animation_names[t]];cur_animation_run_time=this.active_blend_run_times[cur_animation_name],0<e.cache_pts.length?(this.UpdateRegionsSwitches(cur_animation_name),e.poseFromCachePts(cur_animation_run_time,this.blend_render_pts[t],this.target_creature.total_num_pts)):(this.UpdateRegionsSwitches(cur_animation_name),this.PoseCreature(this.active_blend_animation_names[t],this.blend_render_pts[t],cur_animation_run_time))}for(var a=0;a<3*this.target_creature.total_num_pts;a++){var r=a,n=this.blend_render_pts[0][a],i=this.blend_render_pts[1][a];this.target_creature.render_pts[r]=(1-this.blending_factor)*n+this.blending_factor*i}}else{0<(e=this.animations[this.active_animation_name]).cache_pts.length?e.poseFromCachePts(this.getRunTime(),this.target_creature.render_pts,this.target_creature.total_num_pts):this.PoseCreature(this.active_animation_name,this.target_creature.render_pts,this.getRunTime())}this.RunUVItemSwap()},CreatureManager.prototype.RunUVItemSwap=function(){var t=this.target_creature.render_composition.getRegionsMap(),e=this.target_creature.uv_swap_packets,a=this.target_creature.active_uv_swap_actions;if(!isDictEmpty(e)&&!isDictEmpty(a))for(var r in a)if(r in t)for(var n=a[r],i=e[r],s=0;s<i.length;s++){var o=i[s];if(o.tag==n){var l=t[r];l.setUvWarpLocalOffset(o.local_offset),l.setUvWarpGlobalOffset(o.global_offset),l.setUvWarpScale(o.scale),l.runUvWarp();break}}},CreatureManager.prototype.AlterBonesByAnchor=function(t,e){if(0!=this.target_creature.anchor_points_active){var a=this.target_creature.GetAnchorPoint(e);for(var r in t){var n=t[r],i=n.getWorldStartPt(),s=n.getWorldEndPt();i=vec3.subtract(i,i,vec3.fromValues(a[0],a[1],0)),s=vec3.subtract(s,s,vec3.fromValues(a[0],a[1],0)),n.setWorldStartPt(i),n.setWorldEndPt(s)}}},CreatureManager.prototype.SetTimeScale=function(t){this.time_scale=t},CreatureManager.prototype.SetBlending=function(t){if(this.do_blending=t,this.do_blending){if(0==this.blend_render_pts[0].length){for(var e=[],a=0;a<3*this.target_creature.total_num_pts;a++)e.push(0);this.blend_render_pts.push(e)}if(0==this.blend_render_pts[1].length){for(e=[],a=0;a<3*this.target_creature.total_num_pts;a++)e.push(0);this.blend_render_pts[1]=e}}},CreatureManager.prototype.SetAutoBlending=function(t){this.do_auto_blending=t,this.SetBlending(t),this.do_auto_blending&&this.AutoBlendTo(this.active_animation_name,.1)},CreatureManager.prototype.AutoBlendTo=function(t,e){t!=this.auto_blend_names[1]&&(this.ResetBlendTime(t),this.auto_blend_delta=e,this.auto_blend_names[0]=this.active_animation_name,this.auto_blend_names[1]=t,this.blending_factor=0,this.active_animation_name=t,this.SetBlendingAnimations(this.auto_blend_names[0],this.auto_blend_names[1]))},CreatureManager.prototype.ResetBlendTime=function(t){cur_animation=this.animations[t],this.active_blend_run_times[t]=cur_animation.start_time},CreatureManager.prototype.SetBlendingAnimations=function(t,e){this.active_blend_animation_names[0]=t,this.active_blend_animation_names[1]=e},CreatureManager.prototype.SetBlendingFactor=function(t){this.blending_factor=t},CreatureManager.prototype.IsContactBone=function(t,e){var a=this.target_creature.render_composition.getRootBone();return this.ProcessContactBone(t,e,a)},CreatureManager.prototype.PoseCreature=function(t,e,a){var r=this.animations[t],n=r.bones_cache,i=r.displacement_cache,s=r.uv_warp_cache,o=r.opacity_cache,l=this.target_creature.render_composition,u=l.getBonesMap(),c=l.getRegionsMap();n.retrieveValuesAtTime(a,u),this.AlterBonesByAnchor(u,t),null!=this.bones_override_callback&&this.bones_override_callback(u),i.retrieveValuesAtTime(a,c),s.retrieveValuesAtTime(a,c),o.retrieveValuesAtTime(a,c);var h=l.getRegions(),_=l.getBonesMap();l.updateAllTransforms(!1);for(var d=0,p=h.length;d<p;d++){var m=h[d],M=m.getStartPtIndex();m.poseFinalPts(e,3*M,_);for(var f=3*m.getStartPtIndex(),v=3*m.getEndPtIndex(),g=f;g<=v;g+=3)e[g+2]=.001*-d}};
  //# sourceMappingURL=creature.map