Bläddra i källkod

Updated builds.

Mr.doob 10 år sedan
förälder
incheckning
0d0795de3a
2 ändrade filer med 2953 tillägg och 2938 borttagningar
  1. 2641 2626
      build/three.js
  2. 312 312
      build/three.min.js

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2641 - 2626
build/three.js


+ 312 - 312
build/three.min.js

@@ -67,9 +67,9 @@ Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return
 fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];this.z=a.array[b+2];this.w=a.array[b+3];return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};
 THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ";
 THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x=
-a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],l=e[9],n=e[2],p=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-l,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(p,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,
-k)):(this._y=Math.atan2(-n,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(p,-1,1)),.99999>Math.abs(p)?(this._y=Math.atan2(-n,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(n,-1,1)),.99999>Math.abs(n)?(this._x=Math.atan2(p,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-n,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=
-Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(p,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-l,e),this._y=0)):THREE.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeRotationFromQuaternion(b);this.setFromRotationMatrix(a,c,d);return this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,
+a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],l=e[9],p=e[2],n=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-l,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(n,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,
+k)):(this._y=Math.atan2(-p,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(n,-1,1)),.99999>Math.abs(n)?(this._y=Math.atan2(-p,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(p,-1,1)),.99999>Math.abs(p)?(this._x=Math.atan2(n,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-p,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=
+Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(n,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-l,e),this._y=0)):THREE.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeRotationFromQuaternion(b);this.setFromRotationMatrix(a,c,d);return this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,
 b||this._order)},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this);this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?
 a.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}};THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3};
 THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,
@@ -94,21 +94,21 @@ a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:funct
 c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");THREE.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];
 a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}};
 THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);0<arguments.length&&THREE.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,l,n,p,m,r,t,s){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=f;u[9]=g;u[13]=h;u[2]=k;u[6]=l;u[10]=n;u[14]=p;u[3]=m;u[7]=r;u[11]=t;u[15]=s;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){THREE.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,l,p,n,m,s,t,r){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=f;v[9]=g;v[13]=h;v[2]=k;v[6]=l;v[10]=p;v[14]=n;v[3]=m;v[7]=s;v[11]=t;v[15]=r;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){THREE.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
 copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){var d=this.elements;a.set(d[0],d[1],d[2]);b.set(d[4],d[5],d[6]);c.set(d[8],d[9],d[10]);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a=new THREE.Vector3;return function(b){var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),
 f=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){!1===a instanceof THREE.Euler&&THREE.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=f*h;var k=f*e,
-l=c*h,n=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+l*d;b[5]=a-n*d;b[9]=-c*g;b[2]=n-a*d;b[6]=l+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,l=d*h,n=d*e,b[0]=a+n*c,b[4]=l*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=n+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,l=d*h,n=d*e,b[0]=a-n*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=f*h,b[9]=n-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,l=c*h,n=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+n,b[1]=g*e,b[5]=n*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===
-a.order?(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){THREE.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
-makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*h,c=c*k,n=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(n+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,
+l=c*h,p=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+l*d;b[5]=a-p*d;b[9]=-c*g;b[2]=p-a*d;b[6]=l+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,l=d*h,p=d*e,b[0]=a+p*c,b[4]=l*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=p+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,l=d*h,p=d*e,b[0]=a-p*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=f*h,b[9]=p-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,l=c*h,p=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+p,b[1]=g*e,b[5]=p*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===
+a.order?(a=f*g,k=f*d,l=c*g,p=c*d,b[0]=g*h,b[4]=p-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-p*e):"XZY"===a.order&&(a=f*g,k=f*d,l=c*g,p=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+p,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=p*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){THREE.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
+makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*h,c=c*k,p=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(p+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+p);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,
 c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(THREE.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],
-k=c[12],l=c[1],n=c[5],p=c[9],m=c[13],r=c[2],t=c[6],s=c[10],u=c[14],v=c[3],x=c[7],z=c[11],c=c[15],w=d[0],I=d[4],H=d[8],y=d[12],F=d[1],B=d[5],E=d[9],C=d[13],N=d[2],K=d[6],L=d[10],J=d[14],G=d[3],A=d[7],M=d[11],d=d[15];e[0]=f*w+g*F+h*N+k*G;e[4]=f*I+g*B+h*K+k*A;e[8]=f*H+g*E+h*L+k*M;e[12]=f*y+g*C+h*J+k*d;e[1]=l*w+n*F+p*N+m*G;e[5]=l*I+n*B+p*K+m*A;e[9]=l*H+n*E+p*L+m*M;e[13]=l*y+n*C+p*J+m*d;e[2]=r*w+t*F+s*N+u*G;e[6]=r*I+t*B+s*K+u*A;e[10]=r*H+t*E+s*L+u*M;e[14]=r*y+t*C+s*J+u*d;e[3]=v*w+x*F+z*N+c*G;e[7]=v*I+
-x*B+z*K+c*A;e[11]=v*H+x*E+z*L+c*M;e[15]=v*y+x*C+z*J+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=
+k=c[12],l=c[1],p=c[5],n=c[9],m=c[13],s=c[2],t=c[6],r=c[10],v=c[14],u=c[3],x=c[7],z=c[11],c=c[15],w=d[0],F=d[4],G=d[8],y=d[12],I=d[1],B=d[5],C=d[9],E=d[13],L=d[2],N=d[6],H=d[10],O=d[14],M=d[3],A=d[7],J=d[11],d=d[15];e[0]=f*w+g*I+h*L+k*M;e[4]=f*F+g*B+h*N+k*A;e[8]=f*G+g*C+h*H+k*J;e[12]=f*y+g*E+h*O+k*d;e[1]=l*w+p*I+n*L+m*M;e[5]=l*F+p*B+n*N+m*A;e[9]=l*G+p*C+n*H+m*J;e[13]=l*y+p*E+n*O+m*d;e[2]=s*w+t*I+r*L+v*M;e[6]=s*F+t*B+r*N+v*A;e[10]=s*G+t*C+r*H+v*J;e[14]=s*y+t*E+r*O+v*d;e[3]=u*w+x*I+z*L+c*M;e[7]=u*F+
+x*B+z*N+c*A;e[11]=u*G+x*C+z*H+c*J;e[15]=u*y+x*E+z*O+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=
 a;b[15]*=a;return this},multiplyVector3:function(a){THREE.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){THREE.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){THREE.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){THREE.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){THREE.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");
-return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],l=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*k*n-e*g*p+c*k*p+d*g*m-c*h*m)+a[7]*(+b*h*m-b*k*p+e*f*p-d*f*m+d*k*l-e*h*l)+a[11]*(+b*k*n-b*g*m-e*f*n+c*f*m+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*n+b*g*p+d*f*n-c*f*p+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];
+return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],l=a[2],p=a[6],n=a[10],m=a[14];return a[3]*(+e*h*p-d*k*p-e*g*n+c*k*n+d*g*m-c*h*m)+a[7]*(+b*h*m-b*k*n+e*f*n-d*f*m+d*k*l-e*h*l)+a[11]*(+b*k*p-b*g*m-e*f*p+c*f*m+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*p+b*g*n+d*f*p-c*f*n+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];
 a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=new THREE.Vector3;return function(){THREE.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=
-this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],n=d[9],p=d[13],m=d[2],r=d[6],t=d[10],s=d[14],u=d[3],v=d[7],x=d[11],d=d[15];c[0]=n*s*v-p*t*v+p*r*x-l*s*x-n*r*d+l*t*d;c[4]=h*t*v-g*s*v-h*r*x+f*s*x+g*r*d-f*t*d;c[8]=g*p*v-h*n*v+h*l*x-f*p*x-g*l*d+f*n*d;c[12]=h*n*r-g*p*r-h*l*t+f*p*t+g*l*s-f*n*s;c[1]=p*t*u-n*s*u-p*m*x+
-k*s*x+n*m*d-k*t*d;c[5]=g*s*u-h*t*u+h*m*x-e*s*x-g*m*d+e*t*d;c[9]=h*n*u-g*p*u-h*k*x+e*p*x+g*k*d-e*n*d;c[13]=g*p*m-h*n*m+h*k*t-e*p*t-g*k*s+e*n*s;c[2]=l*s*u-p*r*u+p*m*v-k*s*v-l*m*d+k*r*d;c[6]=h*r*u-f*s*u-h*m*v+e*s*v+f*m*d-e*r*d;c[10]=f*p*u-h*l*u+h*k*v-e*p*v-f*k*d+e*l*d;c[14]=h*l*m-f*p*m-h*k*r+e*p*r+f*k*s-e*l*s;c[3]=n*r*u-l*t*u-n*m*v+k*t*v+l*m*x-k*r*x;c[7]=f*t*u-g*r*u+g*m*v-e*t*v-f*m*x+e*r*x;c[11]=g*l*u-f*n*u-g*k*v+e*n*v+f*k*x-e*l*x;c[15]=f*n*m-g*l*m+g*k*r-e*n*r-f*k*t+e*l*t;c=e*c[0]+k*c[4]+m*c[8]+u*c[12];
+this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],p=d[9],n=d[13],m=d[2],s=d[6],t=d[10],r=d[14],v=d[3],u=d[7],x=d[11],d=d[15];c[0]=p*r*u-n*t*u+n*s*x-l*r*x-p*s*d+l*t*d;c[4]=h*t*u-g*r*u-h*s*x+f*r*x+g*s*d-f*t*d;c[8]=g*n*u-h*p*u+h*l*x-f*n*x-g*l*d+f*p*d;c[12]=h*p*s-g*n*s-h*l*t+f*n*t+g*l*r-f*p*r;c[1]=n*t*v-p*r*v-n*m*x+
+k*r*x+p*m*d-k*t*d;c[5]=g*r*v-h*t*v+h*m*x-e*r*x-g*m*d+e*t*d;c[9]=h*p*v-g*n*v-h*k*x+e*n*x+g*k*d-e*p*d;c[13]=g*n*m-h*p*m+h*k*t-e*n*t-g*k*r+e*p*r;c[2]=l*r*v-n*s*v+n*m*u-k*r*u-l*m*d+k*s*d;c[6]=h*s*v-f*r*v-h*m*u+e*r*u+f*m*d-e*s*d;c[10]=f*n*v-h*l*v+h*k*u-e*n*u-f*k*d+e*l*d;c[14]=h*l*m-f*n*m-h*k*s+e*n*s+f*k*r-e*l*r;c[3]=p*s*v-l*t*v-p*m*u+k*t*u+l*m*x-k*s*x;c[7]=f*t*v-g*s*v+g*m*u-e*t*u-f*m*x+e*s*x;c[11]=g*l*v-f*p*v-g*k*u+e*p*u+f*k*x-e*l*x;c[15]=f*p*m-g*l*m+g*k*s-e*p*s-f*k*t+e*l*t;c=e*c[0]+k*c[4]+m*c[8]+v*c[12];
 if(0==c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");THREE.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){THREE.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){THREE.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){THREE.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){THREE.error("THREE.Matrix4: .rotateZ() has been removed.")},
 rotateByAxis:function(a,b){THREE.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,
 c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,k=e*f,l=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*g+
@@ -118,8 +118,8 @@ g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THR
 a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3};
 THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);
 var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);
-b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),l=c.dot(this.direction),n=-c.dot(b),p=c.lengthSq(),m=Math.abs(1-k*k),r;0<m?(d=k*n-l,e=k*l-n,r=h*m,0<=d?e>=-r?e<=r?(h=1/m,d*=h,e*=h,k=d*(d+k*e+2*l)+e*(k*d+e+2*n)+p):(e=h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p):(e=-h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p):e<=-r?(d=Math.max(0,-(-k*h+l)),e=0<d?-h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+p):e<=r?(d=0,e=Math.min(Math.max(-h,-n),h),k=e*(e+
-2*n)+p):(d=Math.max(0,-(k*h+l)),e=0<d?h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+p)):(e=0<k?-h:h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p);f&&f.copy(this.direction).multiplyScalar(d).add(this.origin);g&&g.copy(b).multiplyScalar(e).add(a);return k}}(),isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;
+b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),l=c.dot(this.direction),p=-c.dot(b),n=c.lengthSq(),m=Math.abs(1-k*k),s;0<m?(d=k*p-l,e=k*l-p,s=h*m,0<=d?e>=-s?e<=s?(h=1/m,d*=h,e*=h,k=d*(d+k*e+2*l)+e*(k*d+e+2*p)+n):(e=h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*p)+n):(e=-h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*p)+n):e<=-s?(d=Math.max(0,-(-k*h+l)),e=0<d?-h:Math.min(Math.max(-h,-p),h),k=-d*d+e*(e+2*p)+n):e<=s?(d=0,e=Math.min(Math.max(-h,-p),h),k=e*(e+
+2*p)+n):(d=Math.max(0,-(k*h+l)),e=0<d?h:Math.min(Math.max(-h,-p),h),k=-d*d+e*(e+2*p)+n)):(e=0<k?-h:h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*p)+n);f&&f.copy(this.direction).multiplyScalar(d).add(this.origin);g&&g.copy(b).multiplyScalar(e).add(a);return k}}(),isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;
 if(e>f)return null;f=Math.sqrt(f-e);e=d-f;d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},
 isIntersectionBox:function(){var a=new THREE.Vector3;return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(f<d||d!==d)d=f;0<=g?(e=(a.min.z-h.z)*g,g*=a.max.z-h.z):(e=(a.max.z-h.z)*
 g,g*=a.min.z-h.z);if(c>g||e>d)return null;if(e>c||c!==c)c=e;if(g<d||d!==d)d=g;return 0>d?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0<f){if(h)return null;h=1}else if(0>f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));
@@ -128,8 +128,8 @@ THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.c
 this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);
 return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};
 THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};
-THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],n=c[8],p=c[9],m=c[10],r=c[11],t=c[12],s=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,l-g,r-n,c-t).normalize();b[1].setComponents(f+
-a,l+g,r+n,c+t).normalize();b[2].setComponents(f+d,l+h,r+p,c+s).normalize();b[3].setComponents(f-d,l-h,r-p,c-s).normalize();b[4].setComponents(f-e,l-k,r-m,c-u).normalize();b[5].setComponents(f+e,l+k,r+m,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
+THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],p=c[8],n=c[9],m=c[10],s=c[11],t=c[12],r=c[13],v=c[14],c=c[15];b[0].setComponents(f-a,l-g,s-p,c-t).normalize();b[1].setComponents(f+
+a,l+g,s+p,c+t).normalize();b[2].setComponents(f+d,l+h,s+n,c+r).normalize();b[3].setComponents(f-d,l-h,s-n,c-r).normalize();b[4].setComponents(f-e,l-k,s-m,c-v).normalize();b[5].setComponents(f+e,l+k,s+m,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
 c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var g=f.distanceToPoint(a),f=f.distanceToPoint(b);if(0>g&&0>f)return!1}return!0}}(),
 containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
 THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,
@@ -140,8 +140,8 @@ a.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}}
 THREE.Math={generateUUID:function(){var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),b=Array(36),c=0,d;return function(){for(var e=0;36>e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){if(a<=
 b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return Math.floor(this.randFloat(a,b))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a=
 180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},nextPowerOfTwo:function(a){a--;a|=a>>1;a|=a>>2;a|=a>>4;a|=a>>8;a|=a>>16;a++;return a}};
-THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,l,n,p,m;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+
-2;l=this.points[c[0]];n=this.points[c[1]];p=this.points[c[2]];m=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,n.x,p.x,m.x,g,h,k);d.y=b(l.y,n.y,p.y,m.y,g,h,k);d.z=b(l.z,n.z,p.z,m.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=
+THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,l,p,n,m;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+
+2;l=this.points[c[0]];p=this.points[c[1]];n=this.points[c[2]];m=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,p.x,n.x,m.x,g,h,k);d.y=b(l.y,p.y,n.y,m.y,g,h,k);d.z=b(l.z,p.z,n.z,m.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=
 a/c,d=this.getPoint(b),g.copy(d),k+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],k=new THREE.Vector3,m=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=m.chunks[b]-m.chunks[b-1];g=Math.ceil(a*c/m.total);e=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<g-1;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),h.push(k.copy(d).clone());
 h.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();
 THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g,h){a.subVectors(g,e);b.subVectors(f,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);f=a.dot(c);var k=b.dot(b);g=b.dot(c);var l=d*k-e*e;h=h||new THREE.Vector3;if(0==l)return h.set(-2,-1,-1);l=1/l;k=(k*f-e*g)*l;d=(d*g-e*f)*l;return h.set(1-k-d,d,k)}}();
@@ -191,42 +191,42 @@ THREE.InterleavedBufferAttribute.prototype={constructor:THREE.InterleavedBufferA
 THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=
 this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1};
 THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;e<f;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=
-this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=[],l=[],n=c=0;c<d.length;c+=3,n+=2)b.vertices.push(new THREE.Vector3(d[c],d[c+1],d[c+2])),void 0!==f&&k.push(new THREE.Vector3(f[c],f[c+1],f[c+2])),void 0!==g&&b.colors.push(new THREE.Color(g[c],g[c+1],g[c+2])),void 0!==h&&l.push(new THREE.Vector2(h[n],
-h[n+1]));var p=function(a,c,d){var e=void 0!==f?[k[a].clone(),k[c].clone(),k[d].clone()]:[],m=void 0!==g?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,m));void 0!==h&&b.faceVertexUvs[0].push([l[a].clone(),l[c].clone(),l[d].clone()])};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var n=d[c],m=n.start,r=n.count,t=n.index,n=m,m=m+r;n<m;n+=3)p(t+e[n],t+e[n+1],t+e[n+2]);else for(c=0;c<e.length;c+=3)p(e[c],e[c+1],e[c+2]);else for(c=
-0;c<d.length/3;c+=3)p(c,c+1,c+2);this.computeFaceNormals();null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],
+this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=[],l=[],p=c=0;c<d.length;c+=3,p+=2)b.vertices.push(new THREE.Vector3(d[c],d[c+1],d[c+2])),void 0!==f&&k.push(new THREE.Vector3(f[c],f[c+1],f[c+2])),void 0!==g&&b.colors.push(new THREE.Color(g[c],g[c+1],g[c+2])),void 0!==h&&l.push(new THREE.Vector2(h[p],
+h[p+1]));var n=function(a,c,d){var e=void 0!==f?[k[a].clone(),k[c].clone(),k[d].clone()]:[],m=void 0!==g?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,m));void 0!==h&&b.faceVertexUvs[0].push([l[a].clone(),l[c].clone(),l[d].clone()])};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var p=d[c],m=p.start,s=p.count,t=p.index,p=m,m=m+s;p<m;p+=3)n(t+e[p],t+e[p+1],t+e[p+2]);else for(c=0;c<e.length;c+=3)n(e[c],e[c+1],e[c+2]);else for(c=
+0;c<d.length/3;c+=3)n(c,c+1,c+2);this.computeFaceNormals();null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],
 g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g);b.subVectors(f,g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,f,g,h=new THREE.Vector3,k=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),k.subVectors(e,f),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=
 0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=
 e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=
 this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<
-d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,n,p,m,r,t,s,u,v=[],x=[];c=new THREE.Vector3;var z=new THREE.Vector3,w=new THREE.Vector3,I=new THREE.Vector3,H=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,x[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],
-l=f[0],n=f[1],p=f[2],f=h.x-g.x,m=k.x-g.x,r=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-l.x,s=p.x-l.x,n=n.y-l.y,l=p.y-l.y,p=1/(k*l-s*n),c.set((l*f-n*m)*p,(l*r-n*t)*p,(l*h-n*g)*p),z.set((k*m-s*f)*p,(k*t-s*r)*p,(k*g-s*h)*p),v[d].add(c),v[u].add(c),v[e].add(c),x[d].add(z),x[u].add(z),x[e].add(z);z=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)H.copy(e.vertexNormals[c]),d=e[z[c]],u=v[d],w.copy(u),w.sub(H.multiplyScalar(H.dot(u))).normalize(),
-I.crossVectors(e.vertexNormals[c],u),d=I.dot(x[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(w.x,w.y,w.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);
-this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof THREE.Geometry)THREE.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,k=a.faces,l=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,p=g.length;n<p;n++){var m=g[n].clone();void 0!==b&&m.applyMatrix4(b);f.push(m)}n=0;for(p=k.length;n<
-p;n++){var g=k[n],r,t=g.vertexNormals,s=g.vertexColors,m=new THREE.Face3(g.a+e,g.b+e,g.c+e);m.normal.copy(g.normal);void 0!==d&&m.normal.applyMatrix3(d).normalize();b=0;for(f=t.length;b<f;b++)r=t[b].clone(),void 0!==d&&r.applyMatrix3(d).normalize(),m.vertexNormals.push(r);m.color.copy(g.color);b=0;for(f=s.length;b<f;b++)r=s[b],m.vertexColors.push(r.clone());m.materialIndex=g.materialIndex+c;h.push(m)}n=0;for(p=a.length;n<p;n++)if(c=a[n],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());
+d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,p,n,m,s,t,r,v,u=[],x=[];c=new THREE.Vector3;var z=new THREE.Vector3,w=new THREE.Vector3,F=new THREE.Vector3,G=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)u[a]=new THREE.Vector3,x[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,g=this.vertices[d],h=this.vertices[v],k=this.vertices[e],
+l=f[0],p=f[1],n=f[2],f=h.x-g.x,m=k.x-g.x,s=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=p.x-l.x,r=n.x-l.x,p=p.y-l.y,l=n.y-l.y,n=1/(k*l-r*p),c.set((l*f-p*m)*n,(l*s-p*t)*n,(l*h-p*g)*n),z.set((k*m-r*f)*n,(k*t-r*s)*n,(k*g-r*h)*n),u[d].add(c),u[v].add(c),u[e].add(c),x[d].add(z),x[v].add(z),x[e].add(z);z=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)G.copy(e.vertexNormals[c]),d=e[z[c]],v=u[d],w.copy(v),w.sub(G.multiplyScalar(G.dot(v))).normalize(),
+F.crossVectors(e.vertexNormals[c],v),d=F.dot(x[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(w.x,w.y,w.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);
+this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof THREE.Geometry)THREE.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,k=a.faces,l=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var p=0,n=g.length;p<n;p++){var m=g[p].clone();void 0!==b&&m.applyMatrix4(b);f.push(m)}p=0;for(n=k.length;p<
+n;p++){var g=k[p],s,t=g.vertexNormals,r=g.vertexColors,m=new THREE.Face3(g.a+e,g.b+e,g.c+e);m.normal.copy(g.normal);void 0!==d&&m.normal.applyMatrix3(d).normalize();b=0;for(f=t.length;b<f;b++)s=t[b].clone(),void 0!==d&&s.applyMatrix3(d).normalize(),m.vertexNormals.push(s);m.color.copy(g.color);b=0;for(f=r.length;b<f;b++)s=r[b],m.vertexColors.push(s.clone());m.materialIndex=g.materialIndex+c;h.push(m)}p=0;for(n=a.length;p<n;p++)if(c=a[p],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());
 l.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?THREE.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<
 g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=this.vertices.length-b.length;this.vertices=b;return f},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==l[b])return l[b];l[b]=k.length/3;k.push(a.x,a.y,
-a.z);return l[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=n.length;n.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==r[b])return r[b];r[b]=m.length/2;m.push(a.x,a.y);return r[b]}var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.type=this.type;e.uuid=this.uuid;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&
-(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],l={},n=[],p={},m=[],r={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],s=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),v=0<t.vertexNormals.length,x=1!==t.color.r||1!==t.color.g||1!==t.color.b,z=0<t.vertexColors.length,w=0,w=a(w,0,0),w=a(w,1,!1),w=a(w,2,!1),w=a(w,3,s),w=a(w,4,u),w=a(w,5,v),w=a(w,6,x),w=a(w,7,z);h.push(w);h.push(t.a,t.b,t.c);s&&(s=this.faceVertexUvs[0][g],
-h.push(d(s[0]),d(s[1]),d(s[2])));u&&h.push(b(t.normal));v&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));x&&h.push(c(t.color));z&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<n.length&&(e.data.colors=n);0<m.length&&(e.data.uvs=[m]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());c=0;
+a.z);return l[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==n[b])return n[b];n[b]=p.length;p.push(a.getHex());return n[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==s[b])return s[b];s[b]=m.length/2;m.push(a.x,a.y);return s[b]}var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.type=this.type;e.uuid=this.uuid;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&
+(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],l={},p=[],n={},m=[],s={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],r=void 0!==this.faceVertexUvs[0][g],v=0<t.normal.length(),u=0<t.vertexNormals.length,x=1!==t.color.r||1!==t.color.g||1!==t.color.b,z=0<t.vertexColors.length,w=0,w=a(w,0,0),w=a(w,1,!1),w=a(w,2,!1),w=a(w,3,r),w=a(w,4,v),w=a(w,5,u),w=a(w,6,x),w=a(w,7,z);h.push(w);h.push(t.a,t.b,t.c);r&&(r=this.faceVertexUvs[0][g],
+h.push(d(r[0]),d(r[1]),d(r[2])));v&&h.push(b(t.normal));u&&(v=t.vertexNormals,h.push(b(v[0]),b(v[1]),b(v[2])));x&&h.push(c(t.color));z&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<p.length&&(e.data.colors=p);0<m.length&&(e.data.uvs=[m]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());c=0;
 for(d=this.faceVertexUvs.length;c<d;c++){b=this.faceVertexUvs[c];void 0===a.faceVertexUvs[c]&&(a.faceVertexUvs[c]=[]);for(var e=0,f=b.length;e<f;e++){for(var g=b[e],h=[],k=0,l=g.length;k<l;k++)h.push(g[k].clone());a.faceVertexUvs[c].push(h)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;
 THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.attributesKeys=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(THREE.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):(this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,
 index:void 0!==c?c:0})},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere()},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));
-return a},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=0<e[0].length,h=3==d[0].vertexNormals.length,k=new Float32Array(9*d.length);this.addAttribute("position",new THREE.BufferAttribute(k,3));var l=new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(l,3));if(f!==THREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(n,3))}if(!0===g){var p=new Float32Array(6*
-d.length);this.addAttribute("uv",new THREE.BufferAttribute(p,2))}for(var m=0,r=0,t=0;m<d.length;m++,r+=6,t+=9){var s=d[m],u=c[s.a],v=c[s.b],x=c[s.c];k[t]=u.x;k[t+1]=u.y;k[t+2]=u.z;k[t+3]=v.x;k[t+4]=v.y;k[t+5]=v.z;k[t+6]=x.x;k[t+7]=x.y;k[t+8]=x.z;!0===h?(u=s.vertexNormals[0],v=s.vertexNormals[1],x=s.vertexNormals[2],l[t]=u.x,l[t+1]=u.y,l[t+2]=u.z,l[t+3]=v.x,l[t+4]=v.y,l[t+5]=v.z,l[t+6]=x.x,l[t+7]=x.y,l[t+8]=x.z):(u=s.normal,l[t]=u.x,l[t+1]=u.y,l[t+2]=u.z,l[t+3]=u.x,l[t+4]=u.y,l[t+5]=u.z,l[t+6]=u.x,
-l[t+7]=u.y,l[t+8]=u.z);f===THREE.FaceColors?(s=s.color,n[t]=s.r,n[t+1]=s.g,n[t+2]=s.b,n[t+3]=s.r,n[t+4]=s.g,n[t+5]=s.b,n[t+6]=s.r,n[t+7]=s.g,n[t+8]=s.b):f===THREE.VertexColors&&(u=s.vertexColors[0],v=s.vertexColors[1],s=s.vertexColors[2],n[t]=u.r,n[t+1]=u.g,n[t+2]=u.b,n[t+3]=v.r,n[t+4]=v.g,n[t+5]=v.b,n[t+6]=s.r,n[t+7]=s.g,n[t+8]=s.b);!0===g&&(s=e[0][m][0],u=e[0][m][1],v=e[0][m][2],p[r]=s.x,p[r+1]=s.y,p[r+2]=u.x,p[r+3]=u.y,p[r+4]=v.x,p[r+5]=v.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=
+return a},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=0<e[0].length,h=3==d[0].vertexNormals.length,k=new Float32Array(9*d.length);this.addAttribute("position",new THREE.BufferAttribute(k,3));var l=new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(l,3));if(f!==THREE.NoColors){var p=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(p,3))}if(!0===g){var n=new Float32Array(6*
+d.length);this.addAttribute("uv",new THREE.BufferAttribute(n,2))}for(var m=0,s=0,t=0;m<d.length;m++,s+=6,t+=9){var r=d[m],v=c[r.a],u=c[r.b],x=c[r.c];k[t]=v.x;k[t+1]=v.y;k[t+2]=v.z;k[t+3]=u.x;k[t+4]=u.y;k[t+5]=u.z;k[t+6]=x.x;k[t+7]=x.y;k[t+8]=x.z;!0===h?(v=r.vertexNormals[0],u=r.vertexNormals[1],x=r.vertexNormals[2],l[t]=v.x,l[t+1]=v.y,l[t+2]=v.z,l[t+3]=u.x,l[t+4]=u.y,l[t+5]=u.z,l[t+6]=x.x,l[t+7]=x.y,l[t+8]=x.z):(v=r.normal,l[t]=v.x,l[t+1]=v.y,l[t+2]=v.z,l[t+3]=v.x,l[t+4]=v.y,l[t+5]=v.z,l[t+6]=v.x,
+l[t+7]=v.y,l[t+8]=v.z);f===THREE.FaceColors?(r=r.color,p[t]=r.r,p[t+1]=r.g,p[t+2]=r.b,p[t+3]=r.r,p[t+4]=r.g,p[t+5]=r.b,p[t+6]=r.r,p[t+7]=r.g,p[t+8]=r.b):f===THREE.VertexColors&&(v=r.vertexColors[0],u=r.vertexColors[1],r=r.vertexColors[2],p[t]=v.r,p[t+1]=v.g,p[t+2]=v.b,p[t+3]=u.r,p[t+4]=u.g,p[t+5]=u.b,p[t+6]=r.r,p[t+7]=r.g,p[t+8]=r.b);!0===g&&(r=e[0][m][0],v=e[0][m][1],u=e[0][m][2],n[s]=r.x,n[s+1]=r.y,n[s+2]=v.x,n[s+3]=v.y,n[s+4]=u.x,n[s+5]=u.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=
 new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&THREE.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),
 computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&
 THREE.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,l=new THREE.Vector3,
-n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var r=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,count:r.length,index:0}],s=0,u=t.length;s<u;++s){e=t[s].start;f=t[s].count;for(var v=t[s].index,d=e,e=e+f;d<e;d+=3)f=3*(v+r[d]),g=3*(v+r[d+1]),h=3*(v+r[d+2]),k.fromArray(b,f),l.fromArray(b,g),n.fromArray(b,h),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=
-0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),n.fromArray(b,d+6),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);m.fromArray(d,3*b);r.fromArray(d,3*c);t.fromArray(f,2*a);s.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-p.x;x=r.x-p.x;z=m.y-p.y;w=r.y-p.y;I=m.z-p.z;H=r.z-p.z;y=s.x-t.x;F=
-u.x-t.x;B=s.y-t.y;E=u.y-t.y;C=1/(y*E-F*B);N.set((E*v-B*x)*C,(E*z-B*w)*C,(E*I-B*H)*C);K.set((y*x-F*v)*C,(y*w-F*z)*C,(y*H-F*I)*C);k[a].add(N);k[b].add(N);k[c].add(N);l[a].add(K);l[b].add(K);l[c].add(K)}function b(a){oa.fromArray(e,3*a);P.copy(oa);$=k[a];D.copy($);D.sub(oa.multiplyScalar(oa.dot($))).normalize();aa.crossVectors(P,$);X=aa.dot(l[a]);ea=0>X?-1:1;h[4*a]=D.x;h[4*a+1]=D.y;h[4*a+2]=D.z;h[4*a+3]=ea}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||
-void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,
-l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector2,s=new THREE.Vector2,u=new THREE.Vector2,v,x,z,w,I,H,y,F,B,E,C,N=new THREE.Vector3,K=new THREE.Vector3,L,J,G,A,M;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var R=this.drawcalls,n=0;for(J=R.length;n<J;++n){L=R[n].start;G=R[n].count;var O=R[n].index,g=L;for(L+=G;g<L;g+=3)G=O+c[g],A=O+c[g+1],M=O+c[g+2],a(G,A,M)}var D=new THREE.Vector3,aa=new THREE.Vector3,oa=new THREE.Vector3,P=new THREE.Vector3,
-ea,$,X,n=0;for(J=R.length;n<J;++n)for(L=R[n].start,G=R[n].count,O=R[n].index,g=L,L+=G;g<L;g+=3)G=O+c[g],A=O+c[g+1],M=O+c[g+2],b(G),b(A),b(M)}},computeOffsets:function(a){void 0===a&&(a=65535);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new Uint16Array(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,p=new Int32Array(6),m=new Int32Array(c.length),r=new Int32Array(c.length),t=0;t<c.length;t++)m[t]=-1,r[t]=-1;for(c=0;c<d;c++){for(var s=n=0;3>s;s++)t=
-b[3*c+s],-1==m[t]?(p[2*s]=t,p[2*s+1]=-1,n++):m[t]<k.index?(p[2*s]=t,p[2*s+1]=-1,l++):(p[2*s]=t,p[2*s+1]=m[t]);if(g+n>k.index+a)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)s=p[n+1],-1<s&&s<k.index&&(p[n+1]=-1);for(n=0;6>n;n+=2)t=p[n],s=p[n+1],-1===s&&(s=g++),m[t]=s,r[s]=t,e[f++]=s-k.index,k.count++}this.reorderBuffers(e,r,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
+p=new THREE.Vector3,n=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var s=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,count:s.length,index:0}],r=0,v=t.length;r<v;++r){e=t[r].start;f=t[r].count;for(var u=t[r].index,d=e,e=e+f;d<e;d+=3)f=3*(u+s[d]),g=3*(u+s[d+1]),h=3*(u+s[d+2]),k.fromArray(b,f),l.fromArray(b,g),p.fromArray(b,h),n.subVectors(p,l),m.subVectors(k,l),n.cross(m),c[f]+=n.x,c[f+1]+=n.y,c[f+2]+=n.z,c[g]+=n.x,c[g+1]+=n.y,c[g+2]+=n.z,c[h]+=n.x,c[h+1]+=n.y,c[h+2]+=n.z}else for(d=
+0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),p.fromArray(b,d+6),n.subVectors(p,l),m.subVectors(k,l),n.cross(m),c[d]=n.x,c[d+1]=n.y,c[d+2]=n.z,c[d+3]=n.x,c[d+4]=n.y,c[d+5]=n.z,c[d+6]=n.x,c[d+7]=n.y,c[d+8]=n.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){n.fromArray(d,3*a);m.fromArray(d,3*b);s.fromArray(d,3*c);t.fromArray(f,2*a);r.fromArray(f,2*b);v.fromArray(f,2*c);u=m.x-n.x;x=s.x-n.x;z=m.y-n.y;w=s.y-n.y;F=m.z-n.z;G=s.z-n.z;y=r.x-t.x;I=
+v.x-t.x;B=r.y-t.y;C=v.y-t.y;E=1/(y*C-I*B);L.set((C*u-B*x)*E,(C*z-B*w)*E,(C*F-B*G)*E);N.set((y*x-I*u)*E,(y*w-I*z)*E,(y*G-I*F)*E);k[a].add(L);k[b].add(L);k[c].add(L);l[a].add(N);l[b].add(N);l[c].add(N)}function b(a){ia.fromArray(e,3*a);Q.copy(ia);aa=k[a];D.copy(aa);D.sub(ia.multiplyScalar(ia.dot(aa))).normalize();X.crossVectors(Q,aa);ca=X.dot(l[a]);P=0>ca?-1:1;h[4*a]=D.x;h[4*a+1]=D.y;h[4*a+2]=D.z;h[4*a+3]=P}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||
+void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],l=[],p=0;p<g;p++)k[p]=new THREE.Vector3,
+l[p]=new THREE.Vector3;var n=new THREE.Vector3,m=new THREE.Vector3,s=new THREE.Vector3,t=new THREE.Vector2,r=new THREE.Vector2,v=new THREE.Vector2,u,x,z,w,F,G,y,I,B,C,E,L=new THREE.Vector3,N=new THREE.Vector3,H,O,M,A,J;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var R=this.drawcalls,p=0;for(O=R.length;p<O;++p){H=R[p].start;M=R[p].count;var K=R[p].index,g=H;for(H+=M;g<H;g+=3)M=K+c[g],A=K+c[g+1],J=K+c[g+2],a(M,A,J)}var D=new THREE.Vector3,X=new THREE.Vector3,ia=new THREE.Vector3,Q=new THREE.Vector3,
+P,aa,ca,p=0;for(O=R.length;p<O;++p)for(H=R[p].start,M=R[p].count,K=R[p].index,g=H,H+=M;g<H;g+=3)M=K+c[g],A=K+c[g+1],J=K+c[g+2],b(M),b(A),b(J)}},computeOffsets:function(a){void 0===a&&(a=65535);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new Uint16Array(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,p=0,n=new Int32Array(6),m=new Int32Array(c.length),s=new Int32Array(c.length),t=0;t<c.length;t++)m[t]=-1,s[t]=-1;for(c=0;c<d;c++){for(var r=p=0;3>r;r++)t=
+b[3*c+r],-1==m[t]?(n[2*r]=t,n[2*r+1]=-1,p++):m[t]<k.index?(n[2*r]=t,n[2*r+1]=-1,l++):(n[2*r]=t,n[2*r+1]=m[t]);if(g+p>k.index+a)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)r=n[p+1],-1<r&&r<k.index&&(n[p+1]=-1);for(p=0;6>p;p+=2)t=n[p],r=n[p+1],-1===r&&(r=g++),m[t]=r,s[r]=t,e[f++]=r-k.index,k.count++}this.reorderBuffers(e,s,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
 a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!=e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*
-c));for(var f=0;f<c;f++){var g=b[f];for(e in this.attributes)if("index"!=e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,l=d[e],n=0;n<k;n++)l[f*k+n]=h[g*k+n]}this.attributes.index.array=a;for(e in this.attributes)"index"!=e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.type=this.type;a.uuid=this.uuid;""!==this.name&&(a.name=this.name);
+c));for(var f=0;f<c;f++){var g=b[f];for(e in this.attributes)if("index"!=e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,l=d[e],p=0;p<k;p++)l[f*k+p]=h[g*k+p]}this.attributes.index.array=a;for(e in this.attributes)"index"!=e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.type=this.type;a.uuid=this.uuid;""!==this.name&&(a.name=this.name);
 a.data={};a.data.attributes={};var b=this.attributes,c=this.offsets,d=this.boundingSphere,e;for(e in b){var f=b[e],g=Array.prototype.slice.call(f.array);a.data.attributes[e]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}0<c.length&&(a.data.offsets=JSON.parse(JSON.stringify(c)));null!==d&&(a.data.boundingSphere={center:d.center.toArray(),radius:d.radius});return a},clone:function(){var a=new THREE.BufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());
 b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count})}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0};THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
 THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry;THREE.InstancedBufferGeometry.prototype.addDrawCall=function(a,b,c,d){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0,instances:d})};
@@ -261,8 +261,8 @@ a.shadowDarkness=this.shadowDarkness;a.shadowMapWidth=this.shadowMapWidth;a.shad
 THREE.Cache={files:{},add:function(a,b){this.files[a]=b},get:function(a){return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.imageLoader=new THREE.ImageLoader;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/a.total).toFixed(0)+
 "%"):b+((a.loaded/1024).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split("/");if(1===a.length)return"./";a.pop();return a.join("/")+"/"},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=this.createMaterial(a[d],b);return c},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function d(a,
-d,e,g,h,k,s){var u=b+e,v,x=THREE.Loader.Handlers.get(u);null!==x?v=x.load(u):(v=new THREE.Texture,x=f.imageLoader,x.crossOrigin=f.crossOrigin,x.load(u,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);v.image=e}else v.image=a;v.needsUpdate=!0}));v.sourceFile=e;g&&(v.repeat.set(g[0],g[1]),1!==g[0]&&(v.wrapS=THREE.RepeatWrapping),
-1!==g[1]&&(v.wrapT=THREE.RepeatWrapping));h&&v.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(v.wrapS=e[k[0]]),void 0!==e[k[1]]&&(v.wrapT=e[k[1]]));s&&(v.anisotropy=s);a[d]=v}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":
+d,e,g,h,k,r){var v=b+e,u,x=THREE.Loader.Handlers.get(v);null!==x?u=x.load(v):(u=new THREE.Texture,x=f.imageLoader,x.crossOrigin=f.crossOrigin,x.load(v,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);u.image=e}else u.image=a;u.needsUpdate=!0}));u.sourceFile=e;g&&(u.repeat.set(g[0],g[1]),1!==g[0]&&(u.wrapS=THREE.RepeatWrapping),
+1!==g[1]&&(u.wrapT=THREE.RepeatWrapping));h&&u.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(u.wrapS=e[k[0]]),void 0!==e[k[1]]&&(u.wrapT=e[k[1]]));r&&(u.anisotropy=r);a[d]=u}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":
 "basic"===k&&(g="MeshBasicMaterial")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]);void 0!==a.transparent&&(h.transparent=a.transparent);void 0!==a.opacity&&1>a.opacity&&(h.transparent=!0);void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);
 void 0!==a.vertexColors&&("face"===a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorEmissive&&(h.emissive=e(a.colorEmissive));void 0!==a.transparency&&(THREE.warn("THREE.Loader: transparency has been renamed to opacity"),a.opacity=a.transparency);void 0!==a.opacity&&(h.opacity=a.opacity);a.specularCoef&&(h.shininess=a.specularCoef);
 a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapAO&&b&&d(h,"aoMap",a.mapAO,a.mapAORepeat,a.mapAOOffset,a.mapAOWrap,a.mapAOAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,
@@ -274,13 +274,13 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
 a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText),k=h.metadata;if(void 0!==k){if("object"===k.type){THREE.error("THREE.JSONLoader: "+b+" should be loaded with THREE.ObjectLoader instead.");return}if("scene"===k.type){THREE.error("THREE.JSONLoader: "+b+" seems to be a Scene. Use THREE.SceneLoader instead.");return}}h=a.parse(h,
 d);c(h.geometry,h.materials)}else THREE.error("THREE.JSONLoader: "+b+" seems to be unreachable or the file is empty.");a.onLoadComplete()}else THREE.error("THREE.JSONLoader: Couldn't load "+b+" ("+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)};
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,n,p,m,r,t,s,u,v,x=a.faces;n=a.vertices;var z=a.normals,w=a.colors,I=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&I++;for(d=0;d<I;d++)c.faceVertexUvs[d]=[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=x.length;k<l;)if(b=x[k++],r=b&1,h=b&2,d=b&8,p=b&16,t=b&32,n=b&64,b&=128,r){r=new THREE.Face3;
-r.a=x[k];r.b=x[k+1];r.c=x[k+3];s=new THREE.Face3;s.a=x[k+1];s.b=x[k+2];s.c=x[k+3];k+=4;h&&(h=x[k++],r.materialIndex=h,s.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<I;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=x[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);p&&(p=3*x[k++],r.normal.set(z[p++],z[p++],z[p]),s.normal.copy(r.normal));if(t)for(d=0;4>d;d++)p=3*x[k++],t=new THREE.Vector3(z[p++],
-z[p++],z[p]),2!==d&&r.vertexNormals.push(t),0!==d&&s.vertexNormals.push(t);n&&(n=x[k++],n=w[n],r.color.setHex(n),s.color.setHex(n));if(b)for(d=0;4>d;d++)n=x[k++],n=w[n],2!==d&&r.vertexColors.push(new THREE.Color(n)),0!==d&&s.vertexColors.push(new THREE.Color(n));c.faces.push(r);c.faces.push(s)}else{r=new THREE.Face3;r.a=x[k++];r.b=x[k++];r.c=x[k++];h&&(h=x[k++],r.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<I;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=x[k++],v=u[2*m],m=u[2*m+1],
-v=new THREE.Vector2(v,m),c.faceVertexUvs[d][h].push(v);p&&(p=3*x[k++],r.normal.set(z[p++],z[p++],z[p]));if(t)for(d=0;3>d;d++)p=3*x[k++],t=new THREE.Vector3(z[p++],z[p++],z[p]),r.vertexNormals.push(t);n&&(n=x[k++],r.color.setHex(w[n]));if(b)for(d=0;3>d;d++)n=x[k++],r.vertexColors.push(new THREE.Color(w[n]));c.faces.push(r)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,p,n,m,s,t,r,v,u,x=a.faces;p=a.vertices;var z=a.normals,w=a.colors,F=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&F++;for(d=0;d<F;d++)c.faceVertexUvs[d]=[]}k=0;for(l=p.length;k<l;)d=new THREE.Vector3,d.x=p[k++]*b,d.y=p[k++]*b,d.z=p[k++]*b,c.vertices.push(d);k=0;for(l=x.length;k<l;)if(b=x[k++],s=b&1,h=b&2,d=b&8,n=b&16,t=b&32,p=b&64,b&=128,s){s=new THREE.Face3;
+s.a=x[k];s.b=x[k+1];s.c=x[k+3];r=new THREE.Face3;r.a=x[k+1];r.b=x[k+2];r.c=x[k+3];k+=4;h&&(h=x[k++],s.materialIndex=h,r.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<F;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=x[k++],u=v[2*m],m=v[2*m+1],u=new THREE.Vector2(u,m),2!==g&&c.faceVertexUvs[d][h].push(u),0!==g&&c.faceVertexUvs[d][h+1].push(u);n&&(n=3*x[k++],s.normal.set(z[n++],z[n++],z[n]),r.normal.copy(s.normal));if(t)for(d=0;4>d;d++)n=3*x[k++],t=new THREE.Vector3(z[n++],
+z[n++],z[n]),2!==d&&s.vertexNormals.push(t),0!==d&&r.vertexNormals.push(t);p&&(p=x[k++],p=w[p],s.color.setHex(p),r.color.setHex(p));if(b)for(d=0;4>d;d++)p=x[k++],p=w[p],2!==d&&s.vertexColors.push(new THREE.Color(p)),0!==d&&r.vertexColors.push(new THREE.Color(p));c.faces.push(s);c.faces.push(r)}else{s=new THREE.Face3;s.a=x[k++];s.b=x[k++];s.c=x[k++];h&&(h=x[k++],s.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<F;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=x[k++],u=v[2*m],m=v[2*m+1],
+u=new THREE.Vector2(u,m),c.faceVertexUvs[d][h].push(u);n&&(n=3*x[k++],s.normal.set(z[n++],z[n++],z[n]));if(t)for(d=0;3>d;d++)n=3*x[k++],t=new THREE.Vector3(z[n++],z[n++],z[n]),s.vertexNormals.push(t);p&&(p=x[k++],s.color.setHex(w[p]));if(b)for(d=0;3>d;d++)p=x[k++],s.vertexColors.push(new THREE.Color(w[p]));c.faces.push(s)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
 1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&THREE.warn("THREE.JSONLoader: When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+
-c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,n;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var p=new THREE.Vector3;p.x=n[h]*b;p.y=n[h+1]*b;p.z=n[h+2]*b;l.push(p)}}if(void 0!==
-a.morphColors)for(d=0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,
+c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,p;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,p=a.morphTargets[d].vertices,h=0,k=p.length;h<k;h+=3){var n=new THREE.Vector3;n.x=p[h]*b;n.y=p[h+1]*b;n.z=p[h+2]*b;l.push(n)}}if(void 0!==
+a.morphColors)for(d=0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)p=new THREE.Color(16755200),p.setRGB(l[b],l[b+1],l[b+2]),k.push(p)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,
 materials:d}};THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
 THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE.BufferGeometry,c=a.data.attributes,d;for(d in c){var e=c[d],f=new self[e.type](e.array);b.addAttribute(d,new THREE.BufferAttribute(f,e.itemSize))}c=a.data.offsets;void 0!==c&&(b.offsets=JSON.parse(JSON.stringify(c)));
 a=a.data.boundingSphere;void 0!==a&&(c=new THREE.Vector3,void 0!==a.center&&c.fromArray(a.center),b.boundingSphere=new THREE.Sphere(c,a.radius));return b}};THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
@@ -348,30 +348,30 @@ THREE.Texture=function(a,b,c,d,e,f,g,h,k){Object.defineProperty(this,"id",{value
 this.anisotropy=void 0!==k?k:1;this.format=void 0!==g?g:THREE.RGBAFormat;this.type=void 0!==h?h:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this._needsUpdate=!1;this.onUpdate=null};THREE.Texture.DEFAULT_IMAGE=void 0;THREE.Texture.DEFAULT_MAPPING=THREE.UVMapping;
 THREE.Texture.prototype={constructor:THREE.Texture,get needsUpdate(){return this._needsUpdate},set needsUpdate(a){!0===a&&this.update();this._needsUpdate=a},clone:function(a){void 0===a&&(a=new THREE.Texture);a.image=this.image;a.mipmaps=this.mipmaps.slice(0);a.mapping=this.mapping;a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.format=this.format;a.type=this.type;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.generateMipmaps=
 this.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;a.unpackAlignment=this.unpackAlignment;return a},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype);THREE.TextureIdCount=0;THREE.CubeTexture=function(a,b,c,d,e,f,g,h,k){b=void 0!==b?b:THREE.CubeReflectionMapping;THREE.Texture.call(this,a,b,c,d,e,f,g,h,k);this.images=a};
-THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CubeTexture.prototype.constructor=THREE.CubeTexture;THREE.CubeTexture.clone=function(a){void 0===a&&(a=new THREE.CubeTexture);THREE.Texture.prototype.clone.call(this,a);a.images=this.images;return a};THREE.CompressedTexture=function(a,b,c,d,e,f,g,h,k,l,n){THREE.Texture.call(this,null,f,g,h,k,l,d,e,n);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);
-THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture;THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.DataTexture=function(a,b,c,d,e,f,g,h,k,l,n){THREE.Texture.call(this,null,f,g,h,k,l,d,e,n);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.constructor=THREE.DataTexture;
-THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.VideoTexture=function(a,b,c,d,e,f,g,h,k){THREE.Texture.call(this,a,b,c,d,e,f,g,h,k);this.generateMipmaps=!1;var l=this,n=function(){requestAnimationFrame(n);a.readyState===a.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)};n()};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.VideoTexture.prototype.constructor=THREE.VideoTexture;
+THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CubeTexture.prototype.constructor=THREE.CubeTexture;THREE.CubeTexture.clone=function(a){void 0===a&&(a=new THREE.CubeTexture);THREE.Texture.prototype.clone.call(this,a);a.images=this.images;return a};THREE.CompressedTexture=function(a,b,c,d,e,f,g,h,k,l,p){THREE.Texture.call(this,null,f,g,h,k,l,d,e,p);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);
+THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture;THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.DataTexture=function(a,b,c,d,e,f,g,h,k,l,p){THREE.Texture.call(this,null,f,g,h,k,l,d,e,p);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.constructor=THREE.DataTexture;
+THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.VideoTexture=function(a,b,c,d,e,f,g,h,k){THREE.Texture.call(this,a,b,c,d,e,f,g,h,k);this.generateMipmaps=!1;var l=this,p=function(){requestAnimationFrame(p);a.readyState===a.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)};p()};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.VideoTexture.prototype.constructor=THREE.VideoTexture;
 THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);THREE.Group.prototype.constructor=THREE.Group;THREE.PointCloud=function(a,b){THREE.Object3D.call(this);this.type="PointCloud";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()})};THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);THREE.PointCloud.prototype.constructor=THREE.PointCloud;
 THREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this,f=e.geometry,g=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===f.boundingBox||!1!==b.isIntersectionBox(f.boundingBox)){var h=g/((this.scale.x+this.scale.y+this.scale.z)/3),k=new THREE.Vector3,g=function(a,f){var g=b.distanceToPoint(a);if(g<h){var k=b.closestPointToPoint(a);k.applyMatrix4(e.matrixWorld);var m=c.ray.origin.distanceTo(k);
-d.push({distance:m,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var l=f.attributes,n=l.position.array;if(void 0!==l.index){var l=l.index.array,p=f.offsets;0===p.length&&(p=[{start:0,count:l.length,index:0}]);for(var m=0,r=p.length;m<r;++m)for(var t=p[m].start,s=p[m].index,f=t,t=t+p[m].count;f<t;f++){var u=s+l[f];k.fromArray(n,3*u);g(k,u)}}else for(l=n.length/3,f=0;f<l;f++)k.set(n[3*f],n[3*f+1],n[3*f+2]),g(k,f)}else for(k=this.geometry.vertices,
+d.push({distance:m,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var l=f.attributes,p=l.position.array;if(void 0!==l.index){var l=l.index.array,n=f.offsets;0===n.length&&(n=[{start:0,count:l.length,index:0}]);for(var m=0,s=n.length;m<s;++m)for(var t=n[m].start,r=n[m].index,f=t,t=t+n[m].count;f<t;f++){var v=r+l[f];k.fromArray(p,3*v);g(k,v)}}else for(l=p.length/3,f=0;f<l;f++)k.set(p[3*f],p[3*f+1],p[3*f+2]),g(k,f)}else for(k=this.geometry.vertices,
 f=0;f<k.length;f++)g(k[f],f)}}}();THREE.PointCloud.prototype.clone=function(a){void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a);return a};
 THREE.PointCloud.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};
 THREE.ParticleSystem=function(a,b){THREE.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.type="Line";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()});this.mode=void 0!==c?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Line.prototype.constructor=THREE.Line;
-THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=this.mode===THREE.LineStrip?1:2;if(g instanceof
-THREE.BufferGeometry){var m=g.attributes;if(void 0!==m.index){var r=m.index.array,m=m.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:r.length,index:0}]);for(var s=0;s<t.length;s++)for(var u=t[s].start,v=t[s].count,x=t[s].index,g=u;g<u+v-1;g+=p){var z=x+r[g+1];h.fromArray(m,3*(x+r[g]));k.fromArray(m,3*z);z=b.distanceSqToSegment(h,k,n,l);z>f||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:s,face:null,faceIndex:null,
-object:this}))}}else for(m=m.position.array,g=0;g<m.length/3-1;g+=p)h.fromArray(m,3*g),k.fromArray(m,3*g+3),z=b.distanceSqToSegment(h,k,n,l),z>f||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,k=h.length,g=0;g<k-1;g+=p)z=b.distanceSqToSegment(h[g],h[g+1],n,l),z>f||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),
+THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,p=new THREE.Vector3,n=this.mode===THREE.LineStrip?1:2;if(g instanceof
+THREE.BufferGeometry){var m=g.attributes;if(void 0!==m.index){var s=m.index.array,m=m.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:s.length,index:0}]);for(var r=0;r<t.length;r++)for(var v=t[r].start,u=t[r].count,x=t[r].index,g=v;g<v+u-1;g+=n){var z=x+s[g+1];h.fromArray(m,3*(x+s[g]));k.fromArray(m,3*z);z=b.distanceSqToSegment(h,k,p,l);z>f||(z=b.origin.distanceTo(p),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:r,face:null,faceIndex:null,
+object:this}))}}else for(m=m.position.array,g=0;g<m.length/3-1;g+=n)h.fromArray(m,3*g),k.fromArray(m,3*g+3),z=b.distanceSqToSegment(h,k,p,l),z>f||(z=b.origin.distanceTo(p),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,k=h.length,g=0;g<k-1;g+=n)z=b.distanceSqToSegment(h[g],h[g+1],p,l),z>f||(z=b.origin.distanceTo(p),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),
 index:g,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.mode));THREE.Object3D.prototype.clone.call(this,a);return a};
 THREE.Line.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);b.object.mode=this.mode;void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};
 THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);THREE.Mesh.prototype.constructor=THREE.Mesh;
 THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
 THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];THREE.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var l=
-this.material;if(void 0!==l){var n=k.attributes,p,m,r=g.precision;if(void 0!==n.index){var t=n.index.array,s=n.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:t.length,index:0}]);for(var v=0,x=u.length;v<x;++v)for(var n=u[v].start,z=u[v].index,k=n,w=n+u[v].count;k<w;k+=3){n=z+t[k];p=z+t[k+1];m=z+t[k+2];d.fromArray(s,3*n);e.fromArray(s,3*p);f.fromArray(s,3*m);var I=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide);if(null!==I){I.applyMatrix4(this.matrixWorld);
-var H=g.ray.origin.distanceTo(I);H<r||H<g.near||H>g.far||h.push({distance:H,point:I,face:new THREE.Face3(n,p,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(s=n.position.array,t=k=0,w=s.length;k<w;k+=3,t+=9)n=k,p=k+1,m=k+2,d.fromArray(s,t),e.fromArray(s,t+3),f.fromArray(s,t+6),I=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==I&&(I.applyMatrix4(this.matrixWorld),H=g.ray.origin.distanceTo(I),H<r||H<g.near||H>
-g.far||h.push({distance:H,point:I,face:new THREE.Face3(n,p,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,s=!0===t?this.material.materials:null,r=g.precision,u=k.vertices,v=0,x=k.faces.length;v<x;v++)if(z=k.faces[v],l=!0===t?s[z.materialIndex]:this.material,void 0!==l){n=u[z.a];p=u[z.b];m=u[z.c];if(!0===l.morphTargets){I=k.morphTargets;H=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
-0,0);for(var w=0,y=I.length;w<y;w++){var F=H[w];if(0!==F){var B=I[w].vertices;d.x+=(B[z.a].x-n.x)*F;d.y+=(B[z.a].y-n.y)*F;d.z+=(B[z.a].z-n.z)*F;e.x+=(B[z.b].x-p.x)*F;e.y+=(B[z.b].y-p.y)*F;e.z+=(B[z.b].z-p.z)*F;f.x+=(B[z.c].x-m.x)*F;f.y+=(B[z.c].y-m.y)*F;f.z+=(B[z.c].z-m.z)*F}}d.add(n);e.add(p);f.add(m);n=d;p=e;m=f}I=l.side===THREE.BackSide?b.intersectTriangle(m,p,n,!0):b.intersectTriangle(n,p,m,l.side!==THREE.DoubleSide);null!==I&&(I.applyMatrix4(this.matrixWorld),H=g.ray.origin.distanceTo(I),H<r||
-H<g.near||H>g.far||h.push({distance:H,point:I,face:z,faceIndex:v,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};
+this.material;if(void 0!==l){var p=k.attributes,n,m,s=g.precision;if(void 0!==p.index){var t=p.index.array,r=p.position.array,v=k.offsets;0===v.length&&(v=[{start:0,count:t.length,index:0}]);for(var u=0,x=v.length;u<x;++u)for(var p=v[u].start,z=v[u].index,k=p,w=p+v[u].count;k<w;k+=3){p=z+t[k];n=z+t[k+1];m=z+t[k+2];d.fromArray(r,3*p);e.fromArray(r,3*n);f.fromArray(r,3*m);var F=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide);if(null!==F){F.applyMatrix4(this.matrixWorld);
+var G=g.ray.origin.distanceTo(F);G<s||G<g.near||G>g.far||h.push({distance:G,point:F,face:new THREE.Face3(p,n,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(r=p.position.array,t=k=0,w=r.length;k<w;k+=3,t+=9)p=k,n=k+1,m=k+2,d.fromArray(r,t),e.fromArray(r,t+3),f.fromArray(r,t+6),F=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==F&&(F.applyMatrix4(this.matrixWorld),G=g.ray.origin.distanceTo(F),G<s||G<g.near||G>
+g.far||h.push({distance:G,point:F,face:new THREE.Face3(p,n,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,r=!0===t?this.material.materials:null,s=g.precision,v=k.vertices,u=0,x=k.faces.length;u<x;u++)if(z=k.faces[u],l=!0===t?r[z.materialIndex]:this.material,void 0!==l){p=v[z.a];n=v[z.b];m=v[z.c];if(!0===l.morphTargets){F=k.morphTargets;G=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
+0,0);for(var w=0,y=F.length;w<y;w++){var I=G[w];if(0!==I){var B=F[w].vertices;d.x+=(B[z.a].x-p.x)*I;d.y+=(B[z.a].y-p.y)*I;d.z+=(B[z.a].z-p.z)*I;e.x+=(B[z.b].x-n.x)*I;e.y+=(B[z.b].y-n.y)*I;e.z+=(B[z.b].z-n.z)*I;f.x+=(B[z.c].x-m.x)*I;f.y+=(B[z.c].y-m.y)*I;f.z+=(B[z.c].z-m.z)*I}}d.add(p);e.add(n);f.add(m);p=d;n=e;m=f}F=l.side===THREE.BackSide?b.intersectTriangle(m,n,p,!0):b.intersectTriangle(p,n,m,l.side!==THREE.DoubleSide);null!==F&&(F.applyMatrix4(this.matrixWorld),G=g.ray.origin.distanceTo(F),G<s||
+G<g.near||G>g.far||h.push({distance:G,point:F,face:z,faceIndex:u,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};
 THREE.Mesh.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Bone.prototype.constructor=THREE.Bone;
 THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),
@@ -463,212 +463,212 @@ tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.Sh
 THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,
 "}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",
 THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}};
-THREE.WebGLRenderer=function(a){function b(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function c(a,b,c,d){var e;if(c instanceof THREE.InstancedBufferGeometry&&(e=Y.get("ANGLE_instanced_arrays"),null===e)){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}var f=c.attributes,g=b.attributes;b=b.attributesKeys;for(var h=0,k=b.length;h<
-k;h++){var m=b[h],l=g[m];if(0<=l){var n=f[m];if(void 0!==n)if(m=n.itemSize,U.enableAttribute(l),n instanceof THREE.InterleavedBufferAttribute){var p=n.data,r=p.stride,s=n.offset;q.bindBuffer(q.ARRAY_BUFFER,n.data.buffer);q.vertexAttribPointer(l,m,q.FLOAT,!1,r*p.array.BYTES_PER_ELEMENT,(d*r+s)*p.array.BYTES_PER_ELEMENT);if(p instanceof THREE.InstancedInterleavedBuffer){if(null===e){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");
-return}e.vertexAttribDivisorANGLE(l,p.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=p.array.length/p.stride*p.meshPerAttribute)}}else{if(q.bindBuffer(q.ARRAY_BUFFER,n.buffer),q.vertexAttribPointer(l,m,q.FLOAT,!1,0,d*m*4),n instanceof THREE.InstancedBufferAttribute){if(null===e){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(l,n.meshPerAttribute);
-void 0===c.maxInstancedCount&&(c.maxInstancedCount=n.array.length/n.itemSize*n.meshPerAttribute)}}else void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?q.vertexAttrib2fv(l,a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&q.vertexAttrib3fv(l,a.defaultAttributeValues[m]))}}U.disableUnusedAttributes()}function d(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:
-a.z!==b.z?a.z-b.z:a.id-b.id}function e(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function f(a,b){return b[0]-a[0]}function g(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group)){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",gb));var b=a.geometry;void 0!==b&&void 0===b.__webglInit&&(b.__webglInit=
-!0,b.addEventListener("dispose",hb),b instanceof THREE.BufferGeometry?Q.info.memory.geometries++:a instanceof THREE.Mesh?n(a,b):a instanceof THREE.Line?za.initLineBuffers(b,a):a instanceof THREE.PointCloud&&za.initPointCloudBuffers(b,a));if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh)if(b instanceof THREE.BufferGeometry)p(X,b,a);else{if(b instanceof THREE.Geometry)for(var b=Aa[b.id],c=0,d=b.length;c<d;c++)p(X,b[c],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?
-p(X,b,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&ua.push({id:null,object:a,opaque:null,transparent:null,z:0});if(a instanceof THREE.Light)$.push(a);else if(a instanceof THREE.Sprite)V.push(a);else if(a instanceof THREE.LensFlare)la.push(a);else if((b=X[a.id])&&(!1===a.frustumCulled||!0===Ja.intersectsObject(a)))for(c=0,d=b.length;c<d;c++){var e=b[c],f=e,h=f.object,k=f.buffer,m=h.geometry,h=h.material;h instanceof THREE.MeshFaceMaterial?(h=h.materials[m instanceof THREE.BufferGeometry?
-0:k.materialIndex],f.material=h,h.transparent?ra.push(f):ka.push(f)):h&&(f.material=h,h.transparent?ra.push(f):ka.push(f));e.render=!0;!0===Q.sortObjects&&(qa.setFromMatrixPosition(a.matrixWorld),qa.applyProjection(Ka),e.z=qa.z)}}c=0;for(d=a.children.length;c<d;c++)g(a.children[c])}}function h(a,b,c,d,e){for(var f,g=0,h=a.length;g<h;g++){f=a[g];var k=f.object,m=f.buffer;z(k,b);if(e)f=e;else{f=f.material;if(!f)continue;s(f)}Q.setMaterialFaces(f);m instanceof THREE.BufferGeometry?Q.renderBufferDirect(b,
-c,d,f,m,k):Q.renderBuffer(b,c,d,f,m,k)}}function k(a,b,c,d,e,f){for(var g,h=0,k=a.length;h<k;h++){g=a[h];var m=g.object;if(m.visible){if(f)g=f;else{g=g[b];if(!g)continue;s(g)}Q.renderImmediateObject(c,d,e,g,m)}}}function l(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function n(a,b){var c=a.material,d=!1;if(void 0===Aa[b.id]||!0===b.groupsNeedUpdate){delete X[a.id];for(var d=Aa,e=b.id,c=c instanceof THREE.MeshFaceMaterial,f=Y.get("OES_element_index_uint")?
-4294967296:65535,g,h={},k=b.morphTargets.length,m=b.morphNormals.length,l,n={},q=[],r=0,s=b.faces.length;r<s;r++){g=b.faces[r];var t=c?g.materialIndex:0;t in h||(h[t]={hash:t,counter:0});g=h[t].hash+"_"+h[t].counter;g in n||(l={id:ib++,faces3:[],materialIndex:t,vertices:0,numMorphTargets:k,numMorphNormals:m},n[g]=l,q.push(l));n[g].vertices+3>f&&(h[t].counter+=1,g=h[t].hash+"_"+h[t].counter,g in n||(l={id:ib++,faces3:[],materialIndex:t,vertices:0,numMorphTargets:k,numMorphNormals:m},n[g]=l,q.push(l)));
-n[g].faces3.push(r);n[g].vertices+=3}d[e]=q;b.groupsNeedUpdate=!1}e=Aa[b.id];c=0;for(f=e.length;c<f;c++)h=e[c],void 0===h.__webglVertexBuffer?(za.initMeshBuffers(h,a),b.verticesNeedUpdate=!0,b.morphTargetsNeedUpdate=!0,b.elementsNeedUpdate=!0,b.uvsNeedUpdate=!0,b.normalsNeedUpdate=!0,b.tangentsNeedUpdate=!0,d=b.colorsNeedUpdate=!0):d=!1,(d||void 0===a.__webglActive)&&p(X,h,a);a.__webglActive=!0}function p(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function m(a){var c=
-a.geometry;if(c instanceof THREE.BufferGeometry){a=c.attributes;for(var c=c.attributesKeys,d=0,e=c.length;d<e;d++){var f=c[d],g=a[f],f="index"===f?q.ELEMENT_ARRAY_BUFFER:q.ARRAY_BUFFER,g=g instanceof THREE.InterleavedBufferAttribute?g.data:g;if(void 0===g.buffer){g.buffer=q.createBuffer();q.bindBuffer(f,g.buffer);var h=q.STATIC_DRAW;if(g instanceof THREE.DynamicBufferAttribute||g instanceof THREE.InstancedBufferAttribute&&!0===g.dynamic||g instanceof THREE.InterleavedBuffer&&!0===g.dynamic)h=q.DYNAMIC_DRAW;
-q.bufferData(f,g.array,h);g.needsUpdate=!1}else!0===g.needsUpdate&&(q.bindBuffer(f,g.buffer),void 0===g.updateRange||-1===g.updateRange.count?q.bufferSubData(f,0,g.array):0===g.updateRange.count?THREE.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(q.bufferSubData(f,g.updateRange.offset*g.array.BYTES_PER_ELEMENT,g.array.subarray(g.updateRange.offset,g.updateRange.offset+
-g.updateRange.count)),g.updateRange.count=0),g.needsUpdate=!1)}}else if(a instanceof THREE.Mesh){!0===c.groupsNeedUpdate&&n(a,c);e=Aa[c.id];d=0;for(f=e.length;d<f;d++){var g=e[d],h=b(a,g),k=h.attributes&&r(h);(c.verticesNeedUpdate||c.morphTargetsNeedUpdate||c.elementsNeedUpdate||c.uvsNeedUpdate||c.normalsNeedUpdate||c.colorsNeedUpdate||c.tangentsNeedUpdate||k)&&za.setMeshBuffers(g,a,q.DYNAMIC_DRAW,!c.dynamic,h)}c.verticesNeedUpdate=!1;c.morphTargetsNeedUpdate=!1;c.elementsNeedUpdate=!1;c.uvsNeedUpdate=
-!1;c.normalsNeedUpdate=!1;c.colorsNeedUpdate=!1;c.tangentsNeedUpdate=!1;h.attributes&&t(h)}else a instanceof THREE.Line?(h=b(a,c),k=h.attributes&&r(h),(c.verticesNeedUpdate||c.colorsNeedUpdate||c.lineDistancesNeedUpdate||k)&&za.setLineBuffers(c,q.DYNAMIC_DRAW),c.verticesNeedUpdate=!1,c.colorsNeedUpdate=!1,c.lineDistancesNeedUpdate=!1,h.attributes&&t(h)):a instanceof THREE.PointCloud&&(h=b(a,c),k=h.attributes&&r(h),(c.verticesNeedUpdate||c.colorsNeedUpdate||k)&&za.setPointCloudBuffers(c,q.DYNAMIC_DRAW,
-a),c.verticesNeedUpdate=!1,c.colorsNeedUpdate=!1,h.attributes&&t(h))}function r(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function t(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function s(a){!0===a.transparent?U.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):U.setBlending(THREE.NoBlending);U.setDepthTest(a.depthTest);U.setDepthWrite(a.depthWrite);U.setColorWrite(a.colorWrite);U.setPolygonOffset(a.polygonOffset,
-a.polygonOffsetFactor,a.polygonOffsetUnits)}function u(a,b,c,d,e){var f,g,h,k;jb=0;if(d.needsUpdate){d.program&&Mb(d);d.addEventListener("dispose",Nb);var m=Wb[d.type];if(m){var l=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var n=0,p=0,r=0,t=0,s=0,u=b.length;s<u;s++){var z=b[s];z.onlyShadow||!1===
-z.visible||(z instanceof THREE.DirectionalLight&&n++,z instanceof THREE.PointLight&&p++,z instanceof THREE.SpotLight&&r++,z instanceof THREE.HemisphereLight&&t++)}f=n;g=p;h=r;k=t;for(var y,A=0,B=0,F=b.length;B<F;B++){var D=b[B];D.castShadow&&(D instanceof THREE.SpotLight&&A++,D instanceof THREE.DirectionalLight&&!D.shadowCascade&&A++)}y=A;var M;if(rb&&e&&e.skeleton&&e.skeleton.useVertexTexture)M=1024;else{var J=q.getParameter(q.MAX_VERTEX_UNIFORM_VECTORS),N=Math.floor((J-20)/4);void 0!==e&&e instanceof
-THREE.SkinnedMesh&&(N=Math.min(e.skeleton.bones.length,N),N<e.skeleton.bones.length&&THREE.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+N+" (try OpenGL instead of ANGLE)"));M=N}var O={precision:G,supportsVertexTextures:sb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,
-fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:oa,skinning:d.skinning,maxBones:M,useVertexTexture:rb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:Q.maxMorphTargets,maxMorphNormals:Q.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:y,shadowMapEnabled:pa.enabled&&e.receiveShadow&&0<y,
-shadowMapType:pa.type,shadowMapDebug:pa.debug,shadowMapCascade:pa.cascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},K=[];m?K.push(m):(K.push(d.fragmentShader),K.push(d.vertexShader));if(void 0!==d.defines)for(var L in d.defines)K.push(L),K.push(d.defines[L]);for(L in O)K.push(L),K.push(O[L]);for(var P=K.join(),R,V=0,ua=va.length;V<ua;V++){var U=va[V];if(U.code===P){R=U;R.usedTimes++;break}}void 0===R&&(R=new THREE.WebGLProgram(Q,
-P,d,O),va.push(R),Q.info.memory.programs=va.length);d.program=R;var X=R.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var ra,Y="morphTarget",ka=0;ka<Q.maxMorphTargets;ka++)ra=Y+ka,0<=X[ra]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,Y="morphNormal",ka=0;ka<Q.maxMorphNormals;ka++)ra=Y+ka,0<=X[ra]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var $ in d.__webglShader.uniforms){var la=d.program.uniforms[$];la&&d.uniformsList.push([d.__webglShader.uniforms[$],
-la])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(Q.maxMorphTargets));var aa=!1,ta=!1,ea=!1,na=d.program,fa=na.uniforms,S=d.__webglShader.uniforms;na.id!==La&&(q.useProgram(na.program),La=na.id,ea=ta=aa=!0);d.id!==Ba&&(-1===Ba&&(ea=!0),Ba=d.id,ta=!0);if(aa||a!==Ya)q.uniformMatrix4fv(fa.projectionMatrix,!1,a.projectionMatrix.elements),oa&&q.uniform1f(fa.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Ya&&(Ya=a),(d instanceof THREE.ShaderMaterial||
-d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==fa.cameraPosition&&(qa.setFromMatrixPosition(a.matrixWorld),q.uniform3f(fa.cameraPosition,qa.x,qa.y,qa.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==fa.viewMatrix&&q.uniformMatrix4fv(fa.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==fa.bindMatrix&&q.uniformMatrix4fv(fa.bindMatrix,
-!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==fa.bindMatrixInverse&&q.uniformMatrix4fv(fa.bindMatrixInverse,!1,e.bindMatrixInverse.elements),rb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==fa.boneTexture){var za=x();q.uniform1i(fa.boneTexture,za);Q.setTexture(e.skeleton.boneTexture,za)}null!==fa.boneTextureWidth&&q.uniform1i(fa.boneTextureWidth,e.skeleton.boneTextureWidth);null!==fa.boneTextureHeight&&q.uniform1i(fa.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&
-null!==fa.boneGlobalMatrices&&q.uniformMatrix4fv(fa.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(ta){c&&d.fog&&(S.fogColor.value=c.color,c instanceof THREE.Fog?(S.fogNear.value=c.near,S.fogFar.value=c.far):c instanceof THREE.FogExp2&&(S.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(kb){var ea=!0,da,wa,ca,Aa=0,Ha=0,Ia=0,Ma,Ra,Sa,Ua,Ja,ga=Ob,Ka=ga.directional.colors,Ta=ga.directional.positions,tb=ga.point.colors,ub=ga.point.positions,
-gb=ga.point.distances,hb=ga.point.decays,vb=ga.spot.colors,wb=ga.spot.positions,ib=ga.spot.distances,xb=ga.spot.directions,nb=ga.spot.anglesCos,ob=ga.spot.exponents,pb=ga.spot.decays,yb=ga.hemi.skyColors,zb=ga.hemi.groundColors,Ab=ga.hemi.positions,Za=0,Na=0,Ca=0,Va=0,Bb=0,Cb=0,Db=0,lb=0,$a=0,ab=0,Ea=0,Wa=0;da=0;for(wa=b.length;da<wa;da++)ca=b[da],ca.onlyShadow||(Ma=ca.color,Ua=ca.intensity,Ja=ca.distance,ca instanceof THREE.AmbientLight?ca.visible&&(Aa+=Ma.r,Ha+=Ma.g,Ia+=Ma.b):ca instanceof THREE.DirectionalLight?
-(Bb+=1,ca.visible&&(ia.setFromMatrixPosition(ca.matrixWorld),qa.setFromMatrixPosition(ca.target.matrixWorld),ia.sub(qa),ia.normalize(),$a=3*Za,Ta[$a+0]=ia.x,Ta[$a+1]=ia.y,Ta[$a+2]=ia.z,w(Ka,$a,Ma,Ua),Za+=1)):ca instanceof THREE.PointLight?(Cb+=1,ca.visible&&(ab=3*Na,w(tb,ab,Ma,Ua),qa.setFromMatrixPosition(ca.matrixWorld),ub[ab+0]=qa.x,ub[ab+1]=qa.y,ub[ab+2]=qa.z,gb[Na]=Ja,hb[Na]=0===ca.distance?0:ca.decay,Na+=1)):ca instanceof THREE.SpotLight?(Db+=1,ca.visible&&(Ea=3*Ca,w(vb,Ea,Ma,Ua),ia.setFromMatrixPosition(ca.matrixWorld),
-wb[Ea+0]=ia.x,wb[Ea+1]=ia.y,wb[Ea+2]=ia.z,ib[Ca]=Ja,qa.setFromMatrixPosition(ca.target.matrixWorld),ia.sub(qa),ia.normalize(),xb[Ea+0]=ia.x,xb[Ea+1]=ia.y,xb[Ea+2]=ia.z,nb[Ca]=Math.cos(ca.angle),ob[Ca]=ca.exponent,pb[Ca]=0===ca.distance?0:ca.decay,Ca+=1)):ca instanceof THREE.HemisphereLight&&(lb+=1,ca.visible&&(ia.setFromMatrixPosition(ca.matrixWorld),ia.normalize(),Wa=3*Va,Ab[Wa+0]=ia.x,Ab[Wa+1]=ia.y,Ab[Wa+2]=ia.z,Ra=ca.color,Sa=ca.groundColor,w(yb,Wa,Ra,Ua),w(zb,Wa,Sa,Ua),Va+=1)));da=3*Za;for(wa=
-Math.max(Ka.length,3*Bb);da<wa;da++)Ka[da]=0;da=3*Na;for(wa=Math.max(tb.length,3*Cb);da<wa;da++)tb[da]=0;da=3*Ca;for(wa=Math.max(vb.length,3*Db);da<wa;da++)vb[da]=0;da=3*Va;for(wa=Math.max(yb.length,3*lb);da<wa;da++)yb[da]=0;da=3*Va;for(wa=Math.max(zb.length,3*lb);da<wa;da++)zb[da]=0;ga.directional.length=Za;ga.point.length=Na;ga.spot.length=Ca;ga.hemi.length=Va;ga.ambient[0]=Aa;ga.ambient[1]=Ha;ga.ambient[2]=Ia;kb=!1}if(ea){var ma=Ob;S.ambientLightColor.value=ma.ambient;S.directionalLightColor.value=
-ma.directional.colors;S.directionalLightDirection.value=ma.directional.positions;S.pointLightColor.value=ma.point.colors;S.pointLightPosition.value=ma.point.positions;S.pointLightDistance.value=ma.point.distances;S.pointLightDecay.value=ma.point.decays;S.spotLightColor.value=ma.spot.colors;S.spotLightPosition.value=ma.spot.positions;S.spotLightDistance.value=ma.spot.distances;S.spotLightDirection.value=ma.spot.directions;S.spotLightAngleCos.value=ma.spot.anglesCos;S.spotLightExponent.value=ma.spot.exponents;
-S.spotLightDecay.value=ma.spot.decays;S.hemisphereLightSkyColor.value=ma.hemi.skyColors;S.hemisphereLightGroundColor.value=ma.hemi.groundColors;S.hemisphereLightDirection.value=ma.hemi.positions;v(S,!0)}else v(S,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){S.opacity.value=d.opacity;S.diffuse.value=d.color;S.map.value=d.map;S.lightMap.value=d.lightMap;S.lightMapIntensity.value=d.lightMapIntensity;S.aoMap.value=d.aoMap;S.aoMapIntensity.value=
-d.aoMapIntensity;S.specularMap.value=d.specularMap;S.alphaMap.value=d.alphaMap;d.bumpMap&&(S.bumpMap.value=d.bumpMap,S.bumpScale.value=d.bumpScale);d.normalMap&&(S.normalMap.value=d.normalMap,S.normalScale.value.copy(d.normalScale));var Fa;d.map?Fa=d.map:d.specularMap?Fa=d.specularMap:d.normalMap?Fa=d.normalMap:d.bumpMap?Fa=d.bumpMap:d.alphaMap&&(Fa=d.alphaMap);if(void 0!==Fa){var cb=Fa.offset,db=Fa.repeat;S.offsetRepeat.value.set(cb.x,cb.y,db.x,db.y)}S.envMap.value=d.envMap;S.flipEnvMap.value=d.envMap instanceof
-THREE.WebGLRenderTargetCube?1:-1;S.reflectivity.value=d.reflectivity;S.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)S.diffuse.value=d.color,S.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)S.diffuse.value=d.color,S.opacity.value=d.opacity,S.dashSize.value=d.dashSize,S.totalSize.value=d.dashSize+d.gapSize,S.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(S.psColor.value=d.color,S.opacity.value=d.opacity,S.size.value=d.size,
-S.scale.value=C.height/2,S.map.value=d.map,null!==d.map){var eb=d.map.offset,fb=d.map.repeat;S.offsetRepeat.value.set(eb.x,eb.y,fb.x,fb.y)}}else d instanceof THREE.MeshPhongMaterial?(S.shininess.value=d.shininess,S.emissive.value=d.emissive,S.specular.value=d.specular,d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(S.emissive.value=d.emissive,d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(S.mNear.value=a.near,S.mFar.value=
-a.far,S.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(S.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&S.shadowMatrix)for(var Xa=0,Eb=0,qb=b.length;Eb<qb;Eb++){var Da=b[Eb];Da.castShadow&&(Da instanceof THREE.SpotLight||Da instanceof THREE.DirectionalLight&&!Da.shadowCascade)&&(S.shadowMap.value[Xa]=Da.shadowMap,S.shadowMapSize.value[Xa]=Da.shadowMapSize,S.shadowMatrix.value[Xa]=Da.shadowMatrix,S.shadowDarkness.value[Xa]=Da.shadowDarkness,S.shadowBias.value[Xa]=Da.shadowBias,
-Xa++)}for(var Fb=d.uniformsList,xa,Oa,ya,mb=0,Jb=Fb.length;mb<Jb;mb++){var Z=Fb[mb][0];if(!1!==Z.needsUpdate){var Pb=Z.type,T=Z.value,ba=Fb[mb][1];switch(Pb){case "1i":q.uniform1i(ba,T);break;case "1f":q.uniform1f(ba,T);break;case "2f":q.uniform2f(ba,T[0],T[1]);break;case "3f":q.uniform3f(ba,T[0],T[1],T[2]);break;case "4f":q.uniform4f(ba,T[0],T[1],T[2],T[3]);break;case "1iv":q.uniform1iv(ba,T);break;case "3iv":q.uniform3iv(ba,T);break;case "1fv":q.uniform1fv(ba,T);break;case "2fv":q.uniform2fv(ba,
-T);break;case "3fv":q.uniform3fv(ba,T);break;case "4fv":q.uniform4fv(ba,T);break;case "Matrix3fv":q.uniformMatrix3fv(ba,!1,T);break;case "Matrix4fv":q.uniformMatrix4fv(ba,!1,T);break;case "i":q.uniform1i(ba,T);break;case "f":q.uniform1f(ba,T);break;case "v2":q.uniform2f(ba,T.x,T.y);break;case "v3":q.uniform3f(ba,T.x,T.y,T.z);break;case "v4":q.uniform4f(ba,T.x,T.y,T.z,T.w);break;case "c":q.uniform3f(ba,T.r,T.g,T.b);break;case "iv1":q.uniform1iv(ba,T);break;case "iv":q.uniform3iv(ba,T);break;case "fv1":q.uniform1fv(ba,
-T);break;case "fv":q.uniform3fv(ba,T);break;case "v2v":void 0===Z._array&&(Z._array=new Float32Array(2*T.length));for(var W=0,sa=T.length;W<sa;W++)ya=2*W,Z._array[ya+0]=T[W].x,Z._array[ya+1]=T[W].y;q.uniform2fv(ba,Z._array);break;case "v3v":void 0===Z._array&&(Z._array=new Float32Array(3*T.length));W=0;for(sa=T.length;W<sa;W++)ya=3*W,Z._array[ya+0]=T[W].x,Z._array[ya+1]=T[W].y,Z._array[ya+2]=T[W].z;q.uniform3fv(ba,Z._array);break;case "v4v":void 0===Z._array&&(Z._array=new Float32Array(4*T.length));
-W=0;for(sa=T.length;W<sa;W++)ya=4*W,Z._array[ya+0]=T[W].x,Z._array[ya+1]=T[W].y,Z._array[ya+2]=T[W].z,Z._array[ya+3]=T[W].w;q.uniform4fv(ba,Z._array);break;case "m3":q.uniformMatrix3fv(ba,!1,T.elements);break;case "m3v":void 0===Z._array&&(Z._array=new Float32Array(9*T.length));W=0;for(sa=T.length;W<sa;W++)T[W].flattenToArrayOffset(Z._array,9*W);q.uniformMatrix3fv(ba,!1,Z._array);break;case "m4":q.uniformMatrix4fv(ba,!1,T.elements);break;case "m4v":void 0===Z._array&&(Z._array=new Float32Array(16*
-T.length));W=0;for(sa=T.length;W<sa;W++)T[W].flattenToArrayOffset(Z._array,16*W);q.uniformMatrix4fv(ba,!1,Z._array);break;case "t":xa=T;Oa=x();q.uniform1i(ba,Oa);if(!xa)continue;if(xa instanceof THREE.CubeTexture||xa.image instanceof Array&&6===xa.image.length){var ha=xa,Qb=Oa;if(6===ha.image.length)if(ha.needsUpdate){ha.image.__webglTextureCube||(ha.addEventListener("dispose",Gb),ha.image.__webglTextureCube=q.createTexture(),Q.info.memory.textures++);q.activeTexture(q.TEXTURE0+Qb);q.bindTexture(q.TEXTURE_CUBE_MAP,
-ha.image.__webglTextureCube);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,ha.flipY);for(var Rb=ha instanceof THREE.CompressedTexture,Hb=ha.image[0]instanceof THREE.DataTexture,Pa=[],ja=0;6>ja;ja++)Pa[ja]=!Q.autoScaleCubemaps||Rb||Hb?Hb?ha.image[ja].image:ha.image[ja]:H(ha.image[ja],Xb);var Sb=Pa[0],Tb=THREE.Math.isPowerOfTwo(Sb.width)&&THREE.Math.isPowerOfTwo(Sb.height),Ga=E(ha.format),Ib=E(ha.type);I(q.TEXTURE_CUBE_MAP,ha,Tb);for(ja=0;6>ja;ja++)if(Rb)for(var Qa,Ub=Pa[ja].mipmaps,bb=0,Kb=Ub.length;bb<Kb;bb++)Qa=
-Ub[bb],ha.format!==THREE.RGBAFormat&&ha.format!==THREE.RGBFormat?-1<Vb().indexOf(Ga)?q.compressedTexImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,bb,Ga,Qa.width,Qa.height,0,Qa.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,bb,Ga,Qa.width,Qa.height,0,Ga,Ib,Qa.data);else Hb?q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,0,Ga,Pa[ja].width,Pa[ja].height,0,Ga,Ib,Pa[ja].data):q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+
-ja,0,Ga,Ga,Ib,Pa[ja]);ha.generateMipmaps&&Tb&&q.generateMipmap(q.TEXTURE_CUBE_MAP);ha.needsUpdate=!1;if(ha.onUpdate)ha.onUpdate(ha)}else q.activeTexture(q.TEXTURE0+Qb),q.bindTexture(q.TEXTURE_CUBE_MAP,ha.image.__webglTextureCube)}else if(xa instanceof THREE.WebGLRenderTargetCube){var Lb=xa;q.activeTexture(q.TEXTURE0+Oa);q.bindTexture(q.TEXTURE_CUBE_MAP,Lb.__webglTexture)}else Q.setTexture(xa,Oa);break;case "tv":void 0===Z._array&&(Z._array=[]);W=0;for(sa=Z.value.length;W<sa;W++)Z._array[W]=x();q.uniform1iv(ba,
-Z._array);W=0;for(sa=Z.value.length;W<sa;W++)xa=Z.value[W],Oa=Z._array[W],xa&&Q.setTexture(xa,Oa);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+Pb)}}}}q.uniformMatrix4fv(fa.modelViewMatrix,!1,e._modelViewMatrix.elements);fa.normalMatrix&&q.uniformMatrix3fv(fa.normalMatrix,!1,e._normalMatrix.elements);null!==fa.modelMatrix&&q.uniformMatrix4fv(fa.modelMatrix,!1,e.matrixWorld.elements);return na}function v(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=
-b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=
-b}function x(){var a=jb;a>=nb&&THREE.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+nb);jb+=1;return a}function z(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function w(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function I(a,b,c){c?(q.texParameteri(a,q.TEXTURE_WRAP_S,E(b.wrapS)),q.texParameteri(a,q.TEXTURE_WRAP_T,E(b.wrapT)),q.texParameteri(a,q.TEXTURE_MAG_FILTER,E(b.magFilter)),
-q.texParameteri(a,q.TEXTURE_MIN_FILTER,E(b.minFilter))):(q.texParameteri(a,q.TEXTURE_WRAP_S,q.CLAMP_TO_EDGE),q.texParameteri(a,q.TEXTURE_WRAP_T,q.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),q.texParameteri(a,q.TEXTURE_MAG_FILTER,B(b.magFilter)),q.texParameteri(a,q.TEXTURE_MIN_FILTER,B(b.minFilter)),
-b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=Y.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||b.__currentAnisotropy)&&(q.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Q.getMaxAnisotropy())),b.__currentAnisotropy=b.anisotropy)}
-function H(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);THREE.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function y(a,b){q.bindRenderbuffer(q.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,
-q.DEPTH_COMPONENT16,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_STENCIL,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a)):q.renderbufferStorage(q.RENDERBUFFER,q.RGBA4,b.width,b.height)}function F(a){a instanceof THREE.WebGLRenderTargetCube?(q.bindTexture(q.TEXTURE_CUBE_MAP,a.__webglTexture),q.generateMipmap(q.TEXTURE_CUBE_MAP),
-q.bindTexture(q.TEXTURE_CUBE_MAP,null)):(q.bindTexture(q.TEXTURE_2D,a.__webglTexture),q.generateMipmap(q.TEXTURE_2D),q.bindTexture(q.TEXTURE_2D,null))}function B(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?q.NEAREST:q.LINEAR}function E(a){var b;if(a===THREE.RepeatWrapping)return q.REPEAT;if(a===THREE.ClampToEdgeWrapping)return q.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return q.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return q.NEAREST;
-if(a===THREE.NearestMipMapNearestFilter)return q.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return q.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return q.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return q.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return q.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return q.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return q.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return q.UNSIGNED_SHORT_5_5_5_1;
-if(a===THREE.UnsignedShort565Type)return q.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return q.BYTE;if(a===THREE.ShortType)return q.SHORT;if(a===THREE.UnsignedShortType)return q.UNSIGNED_SHORT;if(a===THREE.IntType)return q.INT;if(a===THREE.UnsignedIntType)return q.UNSIGNED_INT;if(a===THREE.FloatType)return q.FLOAT;b=Y.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return q.ALPHA;if(a===THREE.RGBFormat)return q.RGB;if(a===THREE.RGBAFormat)return q.RGBA;
-if(a===THREE.LuminanceFormat)return q.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return q.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return q.FUNC_ADD;if(a===THREE.SubtractEquation)return q.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return q.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return q.ZERO;if(a===THREE.OneFactor)return q.ONE;if(a===THREE.SrcColorFactor)return q.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return q.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return q.SRC_ALPHA;
-if(a===THREE.OneMinusSrcAlphaFactor)return q.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return q.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return q.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return q.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return q.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return q.SRC_ALPHA_SATURATE;b=Y.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;
-if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=Y.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=
-Y.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var C=void 0!==a.canvas?a.canvas:document.createElement("canvas"),N=void 0!==a.context?a.context:null,K=C.width,L=C.height,J=1,G=void 0!==a.precision?a.precision:"highp",A=void 0!==a.alpha?a.alpha:!1,M=void 0!==a.depth?a.depth:!0,R=void 0!==a.stencil?a.stencil:!0,O=void 0!==a.antialias?a.antialias:!1,D=void 0!==
-a.premultipliedAlpha?a.premultipliedAlpha:!0,aa=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,oa=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,P=new THREE.Color(0),ea=0,$=[],X={},ua=[],ka=[],ra=[],V=[],la=[];this.domElement=C;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info=
-{memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var Q=this,va=[],La=null,ta=null,Ba=-1,na="",Ya=null,jb=0,Ha=0,Ia=0,Ra=C.width,Sa=C.height,ob=0,pb=0,Ja=new THREE.Frustum,Ka=new THREE.Matrix4,qa=new THREE.Vector3,ia=new THREE.Vector3,kb=!0,Ob={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],
-decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},q;try{var cb={alpha:A,depth:M,stencil:R,antialias:O,premultipliedAlpha:D,preserveDrawingBuffer:aa};q=N||C.getContext("webgl",cb)||C.getContext("experimental-webgl",cb);if(null===q){if(null!==C.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}C.addEventListener("webglcontextlost",function(a){a.preventDefault();db();eb();X={}},!1)}catch(Jb){THREE.error("THREE.WebGLRenderer: "+
-Jb)}var U=new THREE.WebGLState(q,E);void 0===q.getShaderPrecisionFormat&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var Y=new THREE.WebGLExtensions(q),za=new THREE.WebGLBuffers(q,this.info,Y,b);Y.get("OES_texture_float");Y.get("OES_texture_float_linear");Y.get("OES_texture_half_float");Y.get("OES_texture_half_float_linear");Y.get("OES_standard_derivatives");Y.get("ANGLE_instanced_arrays");oa&&Y.get("EXT_frag_depth");var Ta=function(a,b,c,d){!0===D&&(a*=d,b*=
-d,c*=d);q.clearColor(a,b,c,d)},eb=function(){q.clearColor(0,0,0,1);q.clearDepth(1);q.clearStencil(0);q.enable(q.DEPTH_TEST);q.depthFunc(q.LEQUAL);q.frontFace(q.CCW);q.cullFace(q.BACK);q.enable(q.CULL_FACE);q.enable(q.BLEND);q.blendEquation(q.FUNC_ADD);q.blendFunc(q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA);q.viewport(Ha,Ia,Ra,Sa);Ta(P.r,P.g,P.b,ea)},db=function(){Ya=La=null;na="";Ba=-1;kb=!0;U.reset()};eb();this.context=q;this.extensions=Y;this.state=U;var pa=new THREE.WebGLShadowMap(this,$,X,ua);this.shadowMap=
-pa;var nb=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS),Kb=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Lb=q.getParameter(q.MAX_TEXTURE_SIZE),Xb=q.getParameter(q.MAX_CUBE_MAP_TEXTURE_SIZE),sb=0<Kb,rb=sb&&Y.get("OES_texture_float"),Yb=Y.get("ANGLE_instanced_arrays"),Zb=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.HIGH_FLOAT),$b=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.MEDIUM_FLOAT),ac=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.HIGH_FLOAT),bc=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.MEDIUM_FLOAT),
-Vb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(Y.get("WEBGL_compressed_texture_pvrtc")||Y.get("WEBGL_compressed_texture_s3tc"))for(var b=q.getParameter(q.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),cc=0<Zb.precision&&0<ac.precision,fb=0<$b.precision&&0<bc.precision;"highp"!==G||cc||(fb?(G="mediump",THREE.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(G="lowp",THREE.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));
-"mediump"!==G||fb||(G="lowp",THREE.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var dc=new THREE.SpritePlugin(this,V),ec=new THREE.LensFlarePlugin(this,la);this.getContext=function(){return q};this.forceContextLoss=function(){Y.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return sb};this.supportsInstancedArrays=function(){return Yb};this.supportsFloatTextures=function(){return Y.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return Y.get("OES_texture_half_float")};
-this.supportsStandardDerivatives=function(){return Y.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return Y.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return Y.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return Y.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=Y.get("EXT_texture_filter_anisotropic");return a=null!==b?q.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):
-0}}();this.getPrecision=function(){return G};this.getPixelRatio=function(){return J};this.setPixelRatio=function(a){J=a};this.getSize=function(){return{width:K,height:L}};this.setSize=function(a,b,c){K=a;L=b;C.width=a*J;C.height=b*J;!1!==c&&(C.style.width=a+"px",C.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ha=a*J;Ia=b*J;Ra=c*J;Sa=d*J;q.viewport(Ha,Ia,Ra,Sa)};this.setScissor=function(a,b,c,d){q.scissor(a*J,b*J,c*J,d*J)};this.enableScissorTest=function(a){a?q.enable(q.SCISSOR_TEST):
-q.disable(q.SCISSOR_TEST)};this.getClearColor=function(){return P};this.setClearColor=function(a,b){P.set(a);ea=void 0!==b?b:1;Ta(P.r,P.g,P.b,ea)};this.getClearAlpha=function(){return ea};this.setClearAlpha=function(a){ea=a;Ta(P.r,P.g,P.b,ea)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=q.COLOR_BUFFER_BIT;if(void 0===b||b)d|=q.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=q.STENCIL_BUFFER_BIT;q.clear(d)};this.clearColor=function(){q.clear(q.COLOR_BUFFER_BIT)};this.clearDepth=function(){q.clear(q.DEPTH_BUFFER_BIT)};
-this.clearStencil=function(){q.clear(q.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=db;var gb=function(a){a.target.traverse(function(a){a.removeEventListener("remove",gb);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete X[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=ua,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;
-delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})},hb=function(a){a=a.target;a.removeEventListener("dispose",hb);delete a.__webglInit;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(q.deleteBuffer(c.buffer),delete c.buffer)}Q.info.memory.geometries--}else if(b=Aa[a.id],void 0!==b){for(var c=0,d=b.length;c<d;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=0,g=e.numMorphTargets;f<g;f++)q.deleteBuffer(e.__webglMorphTargetsBuffers[f]);
-delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)q.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}za.delete(e)}delete Aa[a.id]}else za.delete(a);na=""},Gb=function(a){a=a.target;a.removeEventListener("dispose",Gb);a.image&&a.image.__webglTextureCube?(q.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(q.deleteTexture(a.__webglTexture),delete a.__webglTexture,
-delete a.__webglInit);Q.info.memory.textures--},qb=function(a){a=a.target;a.removeEventListener("dispose",qb);if(a&&void 0!==a.__webglTexture){q.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)q.deleteFramebuffer(a.__webglFramebuffer[b]),q.deleteRenderbuffer(a.__webglRenderbuffer[b]);else q.deleteFramebuffer(a.__webglFramebuffer),q.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}Q.info.memory.textures--},
-Nb=function(a){a=a.target;a.removeEventListener("dispose",Nb);Mb(a)},Mb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=va.length;a<c;a++)if(d=va[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=va.length;a<c;a++)d=va[a],d.program!==b&&e.push(d);va=e;q.deleteProgram(b);Q.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){U.initAttributes();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=
-q.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=q.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=q.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=q.createBuffer());a.hasPositions&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglVertexBuffer),q.bufferData(q.ARRAY_BUFFER,a.positionArray,q.DYNAMIC_DRAW),U.enableAttribute(b.attributes.position),q.vertexAttribPointer(b.attributes.position,3,q.FLOAT,!1,0,0));if(a.hasNormals){q.bindBuffer(q.ARRAY_BUFFER,
-a.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,k,m,l,n,p,r,s=3*a.count;for(r=0;r<s;r+=9)p=a.normalArray,d=p[r],e=p[r+1],f=p[r+2],g=p[r+3],k=p[r+4],l=p[r+5],h=p[r+6],m=p[r+7],n=p[r+8],d=(d+g+h)/3,e=(e+k+m)/3,f=(f+l+n)/3,p[r]=d,p[r+1]=e,p[r+2]=f,p[r+3]=d,p[r+4]=e,p[r+5]=f,p[r+6]=d,p[r+7]=e,p[r+8]=f}q.bufferData(q.ARRAY_BUFFER,a.normalArray,q.DYNAMIC_DRAW);U.enableAttribute(b.attributes.normal);q.vertexAttribPointer(b.attributes.normal,
-3,q.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglUvBuffer),q.bufferData(q.ARRAY_BUFFER,a.uvArray,q.DYNAMIC_DRAW),U.enableAttribute(b.attributes.uv),q.vertexAttribPointer(b.attributes.uv,2,q.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglColorBuffer),q.bufferData(q.ARRAY_BUFFER,a.colorArray,q.DYNAMIC_DRAW),U.enableAttribute(b.attributes.color),q.vertexAttribPointer(b.attributes.color,3,q.FLOAT,!1,0,0));U.disableUnusedAttributes();
-q.drawArrays(q.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,d,e,f,g){if(!1!==e.visible)if(m(g),a=u(a,b,d,e,g),b=!1,d="direct_"+f.id+"_"+a.id+"_"+(e.wireframe?1:0),d!==na&&(na=d,b=!0),b&&U.initAttributes(),g instanceof THREE.Mesh){g=!0===e.wireframe?q.LINES:q.TRIANGLES;var h=f.attributes.index;if(h){var k,l;h.array instanceof Uint32Array&&Y.get("OES_element_index_uint")?(k=q.UNSIGNED_INT,l=4):(k=q.UNSIGNED_SHORT,l=2);d=f.offsets;if(0===d.length){b&&(c(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,
-h.buffer));if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){var n=Y.get("ANGLE_instanced_arrays");if(null===n){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}n.drawElementsInstancedANGLE(g,h.array.length,k,0,f.maxInstancedCount)}else q.drawElements(g,h.array.length,k,0);Q.info.render.calls++;Q.info.render.vertices+=h.array.length;Q.info.render.faces+=h.array.length/
-3}else{b=!0;for(var p=0,r=d.length;p<r;p++){n=d[p].index;b&&(c(e,a,f,n),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer));if(f instanceof THREE.InstancedBufferGeometry&&0<d[p].instances){n=Y.get("ANGLE_instanced_arrays");if(null===n){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break}n.drawElementsInstancedANGLE(g,d[p].count,k,d[p].start*l,d[p].count,k,d[p].instances)}else q.drawElements(g,
-d[p].count,k,d[p].start*l);Q.info.render.calls++;Q.info.render.vertices+=d[p].count;Q.info.render.faces+=d[p].count/3}}}else{b&&c(e,a,f,0);e=f.attributes.position;if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){n=Y.get("ANGLE_instanced_arrays");if(null===n){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}e instanceof THREE.InterleavedBufferAttribute?n.drawArraysInstancedANGLE(g,
-0,e.data.array.length/e.data.stride,f.maxInstancedCount):n.drawArraysInstancedANGLE(g,0,e.array.length/e.itemSize,f.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?q.drawArrays(g,0,e.data.array.length/e.data.stride):q.drawArrays(g,0,e.array.length/e.itemSize);Q.info.render.calls++;Q.info.render.vertices+=e.array.length/e.itemSize;Q.info.render.faces+=e.array.length/(3*e.itemSize)}}else if(g instanceof THREE.PointCloud)if(g=q.POINTS,h=f.attributes.index)if(h.array instanceof Uint32Array&&
-Y.get("OES_element_index_uint")?(k=q.UNSIGNED_INT,l=4):(k=q.UNSIGNED_SHORT,l=2),d=f.offsets,0===d.length)b&&(c(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,h.array.length,k,0),Q.info.render.calls++,Q.info.render.points+=h.array.length;else for(1<d.length&&(b=!0),p=0,r=d.length;p<r;p++)n=d[p].index,b&&(c(e,a,f,n),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,d[p].count,k,d[p].start*l),Q.info.render.calls++,Q.info.render.points+=d[p].count;else if(b&&c(e,
-a,f,0),e=f.attributes.position,d=f.offsets,0===d.length)q.drawArrays(g,0,e.array.length/3),Q.info.render.calls++,Q.info.render.points+=e.array.length/3;else for(p=0,r=d.length;p<r;p++)q.drawArrays(g,d[p].index,d[p].count),Q.info.render.calls++,Q.info.render.points+=d[p].count;else if(g instanceof THREE.Line)if(g=g.mode===THREE.LineStrip?q.LINE_STRIP:q.LINES,U.setLineWidth(e.linewidth*J),h=f.attributes.index)if(h.array instanceof Uint32Array?(k=q.UNSIGNED_INT,l=4):(k=q.UNSIGNED_SHORT,l=2),d=f.offsets,
-0===d.length)b&&(c(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,h.array.length,k,0),Q.info.render.calls++,Q.info.render.vertices+=h.array.length;else for(1<d.length&&(b=!0),p=0,r=d.length;p<r;p++)n=d[p].index,b&&(c(e,a,f,n),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,d[p].count,k,d[p].start*l),Q.info.render.calls++,Q.info.render.vertices+=d[p].count;else if(b&&c(e,a,f,0),e=f.attributes.position,d=f.offsets,0===d.length)q.drawArrays(g,0,e.array.length/
-3),Q.info.render.calls++,Q.info.render.vertices+=e.array.length/3;else for(p=0,r=d.length;p<r;p++)q.drawArrays(g,d[p].index,d[p].count),Q.info.render.calls++,Q.info.render.vertices+=d[p].count};this.renderBuffer=function(a,b,c,d,e,g){if(!1!==d.visible){m(g);c=u(a,b,c,d,g);b=c.attributes;a=!1;c=e.id+"_"+c.id+"_"+(d.wireframe?1:0);c!==na&&(na=c,a=!0);a&&U.initAttributes();if(!d.morphTargets&&0<=b.position)a&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglVertexBuffer),U.enableAttribute(b.position),q.vertexAttribPointer(b.position,
-3,q.FLOAT,!1,0,0));else if(g.morphTargetBase){c=d.program.attributes;-1!==g.morphTargetBase&&0<=c.position?(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[g.morphTargetBase]),U.enableAttribute(c.position),q.vertexAttribPointer(c.position,3,q.FLOAT,!1,0,0)):0<=c.position&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglVertexBuffer),U.enableAttribute(c.position),q.vertexAttribPointer(c.position,3,q.FLOAT,!1,0,0));if(g.morphTargetForcedOrder.length)for(var h=0,k=g.morphTargetForcedOrder,l=g.morphTargetInfluences,
-n;h<d.numSupportedMorphTargets&&h<k.length;)n=c["morphTarget"+h],0<=n&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k[h]]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0)),n=c["morphNormal"+h],0<=n&&d.morphNormals&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[k[h]]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0)),g.__webglMorphTargetInfluences[h]=l[k[h]],h++;else{k=[];l=g.morphTargetInfluences;h=g.geometry.morphTargets;l.length>h.length&&(THREE.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),
-l.length=h.length);h=0;for(n=l.length;h<n;h++)k.push([l[h],h]);k.length>d.numSupportedMorphTargets?(k.sort(f),k.length=d.numSupportedMorphTargets):k.length>d.numSupportedMorphNormals?k.sort(f):0===k.length&&k.push([0,0]);for(var h=0,p=d.numSupportedMorphTargets;h<p;h++)if(k[h]){var r=k[h][1];n=c["morphTarget"+h];0<=n&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[r]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0));n=c["morphNormal"+h];0<=n&&d.morphNormals&&(q.bindBuffer(q.ARRAY_BUFFER,
-e.__webglMorphNormalsBuffers[r]),U.enableAttribute(n),q.vertexAttribPointer(n,3,q.FLOAT,!1,0,0));g.__webglMorphTargetInfluences[h]=l[r]}else g.__webglMorphTargetInfluences[h]=0}null!==d.program.uniforms.morphTargetInfluences&&q.uniform1fv(d.program.uniforms.morphTargetInfluences,g.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(c=0,l=e.__webglCustomAttributesList.length;c<l;c++)k=e.__webglCustomAttributesList[c],0<=b[k.buffer.belongsToAttribute]&&(q.bindBuffer(q.ARRAY_BUFFER,
-k.buffer),U.enableAttribute(b[k.buffer.belongsToAttribute]),q.vertexAttribPointer(b[k.buffer.belongsToAttribute],k.size,q.FLOAT,!1,0,0));0<=b.color&&(0<g.geometry.colors.length||0<g.geometry.faces.length?(q.bindBuffer(q.ARRAY_BUFFER,e.__webglColorBuffer),U.enableAttribute(b.color),q.vertexAttribPointer(b.color,3,q.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&q.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglNormalBuffer),U.enableAttribute(b.normal),
-q.vertexAttribPointer(b.normal,3,q.FLOAT,!1,0,0));0<=b.tangent&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglTangentBuffer),U.enableAttribute(b.tangent),q.vertexAttribPointer(b.tangent,4,q.FLOAT,!1,0,0));0<=b.uv&&(g.geometry.faceVertexUvs[0]?(q.bindBuffer(q.ARRAY_BUFFER,e.__webglUVBuffer),U.enableAttribute(b.uv),q.vertexAttribPointer(b.uv,2,q.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&q.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(g.geometry.faceVertexUvs[1]?(q.bindBuffer(q.ARRAY_BUFFER,
-e.__webglUV2Buffer),U.enableAttribute(b.uv2),q.vertexAttribPointer(b.uv2,2,q.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&q.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),U.enableAttribute(b.skinIndex),q.vertexAttribPointer(b.skinIndex,4,q.FLOAT,!1,0,0),q.bindBuffer(q.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),U.enableAttribute(b.skinWeight),q.vertexAttribPointer(b.skinWeight,4,q.FLOAT,!1,
-0,0));0<=b.lineDistance&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglLineDistanceBuffer),U.enableAttribute(b.lineDistance),q.vertexAttribPointer(b.lineDistance,1,q.FLOAT,!1,0,0))}U.disableUnusedAttributes();g instanceof THREE.Mesh?(g=e.__typeArray===Uint32Array?q.UNSIGNED_INT:q.UNSIGNED_SHORT,d.wireframe?(U.setLineWidth(d.wireframeLinewidth*J),a&&q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),q.drawElements(q.LINES,e.__webglLineCount,g,0)):(a&&q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),
-q.drawElements(q.TRIANGLES,e.__webglFaceCount,g,0)),Q.info.render.calls++,Q.info.render.vertices+=e.__webglFaceCount,Q.info.render.faces+=e.__webglFaceCount/3):g instanceof THREE.Line?(g=g.mode===THREE.LineStrip?q.LINE_STRIP:q.LINES,U.setLineWidth(d.linewidth*J),q.drawArrays(g,0,e.__webglLineCount),Q.info.render.calls++):g instanceof THREE.PointCloud&&(q.drawArrays(q.POINTS,0,e.__webglParticleCount),Q.info.render.calls++,Q.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,f){if(!1===
-b instanceof THREE.Camera)THREE.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var m=a.fog;na="";Ba=-1;Ya=null;kb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);Ka.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ja.setFromMatrix(Ka);$.length=0;ka.length=0;ra.length=0;V.length=0;la.length=0;
-g(a);!0===Q.sortObjects&&(ka.sort(d),ra.sort(e));pa.render(a,b);Q.info.render.calls=0;Q.info.render.vertices=0;Q.info.render.faces=0;Q.info.render.points=0;this.setRenderTarget(c);(this.autoClear||f)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);f=0;for(var n=ua.length;f<n;f++){var p=ua[f],q=p.object;q.visible&&(z(q,b),l(p))}a.overrideMaterial?(f=a.overrideMaterial,s(f),h(ka,b,$,m,f),h(ra,b,$,m,f),k(ua,"",b,$,m,f)):(U.setBlending(THREE.NoBlending),h(ka,b,$,m,null),k(ua,
-"opaque",b,$,m,null),h(ra,b,$,m,null),k(ua,"transparent",b,$,m,null));dc.render(a,b);ec.render(a,b,ob,pb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&F(c);U.setDepthTest(!0);U.setDepthWrite(!0);U.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=u(a,b,c,d,e);na="";Q.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,q,Ja):e.render(function(a){Q.renderBufferImmediate(a,f,d)})};var Aa={},ib=0,Wb={MeshDepthMaterial:"depth",
-MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?q.disable(q.CULL_FACE):(b===THREE.FrontFaceDirectionCW?q.frontFace(q.CW):q.frontFace(q.CCW),a===THREE.CullFaceBack?q.cullFace(q.BACK):a===THREE.CullFaceFront?q.cullFace(q.FRONT):q.cullFace(q.FRONT_AND_BACK),q.enable(q.CULL_FACE))};this.setMaterialFaces=
-function(a){U.setDoubleSided(a.side===THREE.DoubleSide);U.setFlipSided(a.side===THREE.BackSide)};this.uploadTexture=function(a,b){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Gb),a.__webglTexture=q.createTexture(),Q.info.memory.textures++);q.activeTexture(q.TEXTURE0+b);q.bindTexture(q.TEXTURE_2D,a.__webglTexture);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,a.flipY);q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);q.pixelStorei(q.UNPACK_ALIGNMENT,a.unpackAlignment);
-a.image=H(a.image,Lb);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=E(a.format),f=E(a.type);I(q.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat&&
-a.format!==THREE.RGBFormat?-1<Vb().indexOf(e)?q.compressedTexImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,c.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],q.texImage2D(q.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&q.generateMipmap(q.TEXTURE_2D);a.needsUpdate=
-!1;if(a.onUpdate)a.onUpdate(a)};this.setTexture=function(a,b){!0===a.needsUpdate?!1===a.image.complete?THREE.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a):Q.uploadTexture(a,b):(q.activeTexture(q.TEXTURE0+b),q.bindTexture(q.TEXTURE_2D,a.__webglTexture))};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",
-qb);a.__webglTexture=q.createTexture();Q.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=E(a.format),e=E(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];q.bindTexture(q.TEXTURE_CUBE_MAP,a.__webglTexture);I(q.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=q.createFramebuffer();a.__webglRenderbuffer[f]=q.createRenderbuffer();q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=q.TEXTURE_CUBE_MAP_POSITIVE_X+
-f;q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer[f]);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,h,g.__webglTexture,0);y(a.__webglRenderbuffer[f],a)}a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=q.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:q.createRenderbuffer(),q.bindTexture(q.TEXTURE_2D,a.__webglTexture),I(q.TEXTURE_2D,a,c),q.texImage2D(q.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=q.TEXTURE_2D,
-q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer),q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):y(a.__webglRenderbuffer,a),a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_2D);b?q.bindTexture(q.TEXTURE_CUBE_MAP,
-null):q.bindTexture(q.TEXTURE_2D,null);q.bindRenderbuffer(q.RENDERBUFFER,null);q.bindFramebuffer(q.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Ra,a=Sa,d=Ha,e=Ia);b!==ta&&(q.bindFramebuffer(q.FRAMEBUFFER,b),q.viewport(d,e,c,a),ta=b);ob=c;pb=a};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
-else if(a.__webglFramebuffer)if(a.format!==THREE.RGBAFormat)THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;a.__webglFramebuffer!==ta&&(q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer),g=!0);q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?q.readPixels(b,c,d,e,q.RGBA,q.UNSIGNED_BYTE,f):THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");
-g&&q.bindFramebuffer(q.FRAMEBUFFER,ta)}};this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return pa.enabled},
-set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");pa.enabled=a}},shadowMapType:{get:function(){return pa.type},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");pa.type=a}},shadowMapCullFace:{get:function(){return pa.cullFace},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");pa.cullFace=a}},shadowMapDebug:{get:function(){return pa.debug},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");
-pa.debug=a}},shadowMapCascade:{get:function(){return pa.cascade},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapCascade is now .shadowMap.cascade.");pa.cascade=a}}})};
+THREE.WebGLRenderer=function(a){function b(a,b,c,d){var e;if(c instanceof THREE.InstancedBufferGeometry&&(e=Z.get("ANGLE_instanced_arrays"),null===e)){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}var f=c.attributes,g=b.attributes;b=b.attributesKeys;for(var h=0,k=b.length;h<k;h++){var m=b[h],l=g[m];if(0<=l){var p=f[m];if(void 0!==p)if(m=p.itemSize,U.enableAttribute(l),p instanceof
+THREE.InterleavedBufferAttribute){var n=p.data,u=n.stride,s=p.offset;q.bindBuffer(q.ARRAY_BUFFER,p.data.buffer);q.vertexAttribPointer(l,m,q.FLOAT,!1,u*n.array.BYTES_PER_ELEMENT,(d*u+s)*n.array.BYTES_PER_ELEMENT);if(n instanceof THREE.InstancedInterleavedBuffer){if(null===e){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(l,n.meshPerAttribute);void 0===c.maxInstancedCount&&
+(c.maxInstancedCount=n.array.length/n.stride*n.meshPerAttribute)}}else{if(q.bindBuffer(q.ARRAY_BUFFER,p.buffer),q.vertexAttribPointer(l,m,q.FLOAT,!1,0,d*m*4),p instanceof THREE.InstancedBufferAttribute){if(null===e){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(l,p.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=p.array.length/p.itemSize*
+p.meshPerAttribute)}}else void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?q.vertexAttrib2fv(l,a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&q.vertexAttrib3fv(l,a.defaultAttributeValues[m]))}}U.disableUnusedAttributes()}function c(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function d(a,b){return a.object.renderOrder!==
+b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function e(a,b){return b[0]-a[0]}function f(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(na.init(a),a instanceof THREE.Light)K.push(a);else if(a instanceof THREE.Sprite)ia.push(a);else if(a instanceof THREE.LensFlare)Q.push(a);else{var b=na.objects[a.id];if(b&&(!1===a.frustumCulled||!0===Oa.intersectsObject(a)))for(var c=0,d=b.length;c<d;c++){var e=b[c],g=e,h=g.object,k=
+g.buffer,m=h.geometry,h=h.material;h instanceof THREE.MeshFaceMaterial?(h=h.materials[m instanceof THREE.BufferGeometry?0:k.materialIndex],g.material=h,h.transparent?X.push(g):D.push(g)):h&&(g.material=h,h.transparent?X.push(g):D.push(g));e.render=!0;!0===P.sortObjects&&(oa.setFromMatrixPosition(a.matrixWorld),oa.applyProjection(Ha),e.z=oa.z)}}c=0;for(d=a.children.length;c<d;c++)f(a.children[c])}}function g(a,b,c,d,e){for(var f,g=0,h=a.length;g<h;g++){f=a[g];var k=f.object,m=f.buffer;s(k,b);if(e)f=
+e;else{f=f.material;if(!f)continue;l(f)}P.setMaterialFaces(f);m instanceof THREE.BufferGeometry?P.renderBufferDirect(b,c,d,f,m,k):P.renderBuffer(b,c,d,f,m,k)}}function h(a,b,c,d,e,f){for(var g,h=0,k=a.length;h<k;h++){g=a[h];var m=g.object;if(m.visible){if(f)g=f;else{g=g[b];if(!g)continue;l(g)}P.renderImmediateObject(c,d,e,g,m)}}}function k(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function l(a){!0===a.transparent?U.setBlending(a.blending,
+a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):U.setBlending(THREE.NoBlending);U.setDepthTest(a.depthTest);U.setDepthWrite(a.depthWrite);U.setColorWrite(a.colorWrite);U.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function p(a,b,c,d,e){var f,g,h,k;pa=0;if(d.needsUpdate){d.program&&Fb(d);d.addEventListener("dispose",Gb);var l=Tb[d.type];if(l){var p=THREE.ShaderLib[l];d.__webglShader={uniforms:THREE.UniformsUtils.clone(p.uniforms),
+vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var u=0,s=0,x=0,z=0,y=0,G=b.length;y<G;y++){var B=b[y];B.onlyShadow||!1===B.visible||(B instanceof THREE.DirectionalLight&&u++,B instanceof THREE.PointLight&&s++,B instanceof THREE.SpotLight&&x++,B instanceof THREE.HemisphereLight&&z++)}f=u;g=s;h=x;k=z;for(var I,E=0,D=0,J=b.length;D<J;D++){var L=b[D];L.castShadow&&(L instanceof THREE.SpotLight&&
+E++,L instanceof THREE.DirectionalLight&&!L.shadowCascade&&E++)}I=E;var K;if(eb&&e&&e.skeleton&&e.skeleton.useVertexTexture)K=1024;else{var M=q.getParameter(q.MAX_VERTEX_UNIFORM_VECTORS),H=Math.floor((M-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(H=Math.min(e.skeleton.bones.length,H),H<e.skeleton.bones.length&&THREE.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+H+" (try OpenGL instead of ANGLE)"));K=H}var N={precision:C,supportsVertexTextures:fb,
+map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:A,skinning:d.skinning,maxBones:K,useVertexTexture:eb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,
+morphNormals:d.morphNormals,maxMorphTargets:P.maxMorphTargets,maxMorphNormals:P.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:I,shadowMapEnabled:ma.enabled&&e.receiveShadow&&0<I,shadowMapType:ma.type,shadowMapDebug:ma.debug,shadowMapCascade:ma.cascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},O=[];l?O.push(l):(O.push(d.fragmentShader),O.push(d.vertexShader));if(void 0!==
+d.defines)for(var R in d.defines)O.push(R),O.push(d.defines[R]);for(R in N)O.push(R),O.push(N[R]);for(var Q=O.join(),qa,U=0,xa=aa.length;U<xa;U++){var X=aa[U];if(X.code===Q){qa=X;qa.usedTimes++;break}}void 0===qa&&(qa=new THREE.WebGLProgram(P,Q,d,N),aa.push(qa),P.info.memory.programs=aa.length);d.program=qa;var Z=qa.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var va,wa="morphTarget",la=0;la<P.maxMorphTargets;la++)va=wa+la,0<=Z[va]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=
+0,wa="morphNormal",la=0;la<P.maxMorphNormals;la++)va=wa+la,0<=Z[va]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var ya in d.__webglShader.uniforms){var ia=d.program.uniforms[ya];ia&&d.uniformsList.push([d.__webglShader.uniforms[ya],ia])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(P.maxMorphTargets));var za=!1,na=!1,Aa=!1,Ta=d.program,ea=Ta.uniforms,S=d.__webglShader.uniforms;Ta.id!==ca&&(q.useProgram(Ta.program),ca=Ta.id,
+Aa=na=za=!0);d.id!==Da&&(-1===Da&&(Aa=!0),Da=d.id,na=!0);if(za||a!==V)q.uniformMatrix4fv(ea.projectionMatrix,!1,a.projectionMatrix.elements),A&&q.uniform1f(ea.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==V&&(V=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==ea.cameraPosition&&(oa.setFromMatrixPosition(a.matrixWorld),q.uniform3f(ea.cameraPosition,oa.x,oa.y,oa.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof
+THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==ea.viewMatrix&&q.uniformMatrix4fv(ea.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==ea.bindMatrix&&q.uniformMatrix4fv(ea.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==ea.bindMatrixInverse&&q.uniformMatrix4fv(ea.bindMatrixInverse,!1,e.bindMatrixInverse.elements),eb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==ea.boneTexture){var Oa=m();q.uniform1i(ea.boneTexture,
+Oa);P.setTexture(e.skeleton.boneTexture,Oa)}null!==ea.boneTextureWidth&&q.uniform1i(ea.boneTextureWidth,e.skeleton.boneTextureWidth);null!==ea.boneTextureHeight&&q.uniform1i(ea.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==ea.boneGlobalMatrices&&q.uniformMatrix4fv(ea.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(na){c&&d.fog&&(S.fogColor.value=c.color,c instanceof THREE.Fog?(S.fogNear.value=c.near,S.fogFar.value=c.far):c instanceof THREE.FogExp2&&
+(S.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if($a){var Aa=!0,da,sa,ba,Ha=0,Na=0,gb=0,Ia,Ya,Za,Pa,hb,fa=Hb,ib=fa.directional.colors,jb=fa.directional.positions,kb=fa.point.colors,lb=fa.point.positions,cb=fa.point.distances,db=fa.point.decays,mb=fa.spot.colors,nb=fa.spot.positions,Ab=fa.spot.distances,ob=fa.spot.directions,Bb=fa.spot.anglesCos,Cb=fa.spot.exponents,Db=fa.spot.decays,pb=fa.hemi.skyColors,qb=fa.hemi.groundColors,
+rb=fa.hemi.positions,Ua=0,Ja=0,Ba=0,Qa=0,sb=0,tb=0,ub=0,ab=0,Va=0,Wa=0,Ea=0,Ra=0;da=0;for(sa=b.length;da<sa;da++)ba=b[da],ba.onlyShadow||(Ia=ba.color,Pa=ba.intensity,hb=ba.distance,ba instanceof THREE.AmbientLight?ba.visible&&(Ha+=Ia.r,Na+=Ia.g,gb+=Ia.b):ba instanceof THREE.DirectionalLight?(sb+=1,ba.visible&&(ha.setFromMatrixPosition(ba.matrixWorld),oa.setFromMatrixPosition(ba.target.matrixWorld),ha.sub(oa),ha.normalize(),Va=3*Ua,jb[Va+0]=ha.x,jb[Va+1]=ha.y,jb[Va+2]=ha.z,t(ib,Va,Ia,Pa),Ua+=1)):ba instanceof
+THREE.PointLight?(tb+=1,ba.visible&&(Wa=3*Ja,t(kb,Wa,Ia,Pa),oa.setFromMatrixPosition(ba.matrixWorld),lb[Wa+0]=oa.x,lb[Wa+1]=oa.y,lb[Wa+2]=oa.z,cb[Ja]=hb,db[Ja]=0===ba.distance?0:ba.decay,Ja+=1)):ba instanceof THREE.SpotLight?(ub+=1,ba.visible&&(Ea=3*Ba,t(mb,Ea,Ia,Pa),ha.setFromMatrixPosition(ba.matrixWorld),nb[Ea+0]=ha.x,nb[Ea+1]=ha.y,nb[Ea+2]=ha.z,Ab[Ba]=hb,oa.setFromMatrixPosition(ba.target.matrixWorld),ha.sub(oa),ha.normalize(),ob[Ea+0]=ha.x,ob[Ea+1]=ha.y,ob[Ea+2]=ha.z,Bb[Ba]=Math.cos(ba.angle),
+Cb[Ba]=ba.exponent,Db[Ba]=0===ba.distance?0:ba.decay,Ba+=1)):ba instanceof THREE.HemisphereLight&&(ab+=1,ba.visible&&(ha.setFromMatrixPosition(ba.matrixWorld),ha.normalize(),Ra=3*Qa,rb[Ra+0]=ha.x,rb[Ra+1]=ha.y,rb[Ra+2]=ha.z,Ya=ba.color,Za=ba.groundColor,t(pb,Ra,Ya,Pa),t(qb,Ra,Za,Pa),Qa+=1)));da=3*Ua;for(sa=Math.max(ib.length,3*sb);da<sa;da++)ib[da]=0;da=3*Ja;for(sa=Math.max(kb.length,3*tb);da<sa;da++)kb[da]=0;da=3*Ba;for(sa=Math.max(mb.length,3*ub);da<sa;da++)mb[da]=0;da=3*Qa;for(sa=Math.max(pb.length,
+3*ab);da<sa;da++)pb[da]=0;da=3*Qa;for(sa=Math.max(qb.length,3*ab);da<sa;da++)qb[da]=0;fa.directional.length=Ua;fa.point.length=Ja;fa.spot.length=Ba;fa.hemi.length=Qa;fa.ambient[0]=Ha;fa.ambient[1]=Na;fa.ambient[2]=gb;$a=!1}if(Aa){var ka=Hb;S.ambientLightColor.value=ka.ambient;S.directionalLightColor.value=ka.directional.colors;S.directionalLightDirection.value=ka.directional.positions;S.pointLightColor.value=ka.point.colors;S.pointLightPosition.value=ka.point.positions;S.pointLightDistance.value=
+ka.point.distances;S.pointLightDecay.value=ka.point.decays;S.spotLightColor.value=ka.spot.colors;S.spotLightPosition.value=ka.spot.positions;S.spotLightDistance.value=ka.spot.distances;S.spotLightDirection.value=ka.spot.directions;S.spotLightAngleCos.value=ka.spot.anglesCos;S.spotLightExponent.value=ka.spot.exponents;S.spotLightDecay.value=ka.spot.decays;S.hemisphereLightSkyColor.value=ka.hemi.skyColors;S.hemisphereLightGroundColor.value=ka.hemi.groundColors;S.hemisphereLightDirection.value=ka.hemi.positions;
+n(S,!0)}else n(S,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){S.opacity.value=d.opacity;S.diffuse.value=d.color;S.map.value=d.map;S.lightMap.value=d.lightMap;S.lightMapIntensity.value=d.lightMapIntensity;S.aoMap.value=d.aoMap;S.aoMapIntensity.value=d.aoMapIntensity;S.specularMap.value=d.specularMap;S.alphaMap.value=d.alphaMap;d.bumpMap&&(S.bumpMap.value=d.bumpMap,S.bumpScale.value=d.bumpScale);d.normalMap&&(S.normalMap.value=
+d.normalMap,S.normalScale.value.copy(d.normalScale));var Fa;d.map?Fa=d.map:d.specularMap?Fa=d.specularMap:d.normalMap?Fa=d.normalMap:d.bumpMap?Fa=d.bumpMap:d.alphaMap&&(Fa=d.alphaMap);if(void 0!==Fa){var Ib=Fa.offset,Jb=Fa.repeat;S.offsetRepeat.value.set(Ib.x,Ib.y,Jb.x,Jb.y)}S.envMap.value=d.envMap;S.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;S.reflectivity.value=d.reflectivity;S.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)S.diffuse.value=
+d.color,S.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)S.diffuse.value=d.color,S.opacity.value=d.opacity,S.dashSize.value=d.dashSize,S.totalSize.value=d.dashSize+d.gapSize,S.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(S.psColor.value=d.color,S.opacity.value=d.opacity,S.size.value=d.size,S.scale.value=F.height/2,S.map.value=d.map,null!==d.map){var Kb=d.map.offset,Lb=d.map.repeat;S.offsetRepeat.value.set(Kb.x,Kb.y,Lb.x,Lb.y)}}else d instanceof THREE.MeshPhongMaterial?
+(S.shininess.value=d.shininess,S.emissive.value=d.emissive,S.specular.value=d.specular,d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(S.emissive.value=d.emissive,d.wrapAround&&S.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(S.mNear.value=a.near,S.mFar.value=a.far,S.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(S.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&S.shadowMatrix)for(var Sa=0,vb=0,Eb=b.length;vb<
+Eb;vb++){var Ca=b[vb];Ca.castShadow&&(Ca instanceof THREE.SpotLight||Ca instanceof THREE.DirectionalLight&&!Ca.shadowCascade)&&(S.shadowMap.value[Sa]=Ca.shadowMap,S.shadowMapSize.value[Sa]=Ca.shadowMapSize,S.shadowMatrix.value[Sa]=Ca.shadowMatrix,S.shadowDarkness.value[Sa]=Ca.shadowDarkness,S.shadowBias.value[Sa]=Ca.shadowBias,Sa++)}for(var wb=d.uniformsList,ta,Ka,ua,bb=0,Ub=wb.length;bb<Ub;bb++){var Y=wb[bb][0];if(!1!==Y.needsUpdate){var Mb=Y.type,T=Y.value,$=wb[bb][1];switch(Mb){case "1i":q.uniform1i($,
+T);break;case "1f":q.uniform1f($,T);break;case "2f":q.uniform2f($,T[0],T[1]);break;case "3f":q.uniform3f($,T[0],T[1],T[2]);break;case "4f":q.uniform4f($,T[0],T[1],T[2],T[3]);break;case "1iv":q.uniform1iv($,T);break;case "3iv":q.uniform3iv($,T);break;case "1fv":q.uniform1fv($,T);break;case "2fv":q.uniform2fv($,T);break;case "3fv":q.uniform3fv($,T);break;case "4fv":q.uniform4fv($,T);break;case "Matrix3fv":q.uniformMatrix3fv($,!1,T);break;case "Matrix4fv":q.uniformMatrix4fv($,!1,T);break;case "i":q.uniform1i($,
+T);break;case "f":q.uniform1f($,T);break;case "v2":q.uniform2f($,T.x,T.y);break;case "v3":q.uniform3f($,T.x,T.y,T.z);break;case "v4":q.uniform4f($,T.x,T.y,T.z,T.w);break;case "c":q.uniform3f($,T.r,T.g,T.b);break;case "iv1":q.uniform1iv($,T);break;case "iv":q.uniform3iv($,T);break;case "fv1":q.uniform1fv($,T);break;case "fv":q.uniform3fv($,T);break;case "v2v":void 0===Y._array&&(Y._array=new Float32Array(2*T.length));for(var W=0,ra=T.length;W<ra;W++)ua=2*W,Y._array[ua+0]=T[W].x,Y._array[ua+1]=T[W].y;
+q.uniform2fv($,Y._array);break;case "v3v":void 0===Y._array&&(Y._array=new Float32Array(3*T.length));W=0;for(ra=T.length;W<ra;W++)ua=3*W,Y._array[ua+0]=T[W].x,Y._array[ua+1]=T[W].y,Y._array[ua+2]=T[W].z;q.uniform3fv($,Y._array);break;case "v4v":void 0===Y._array&&(Y._array=new Float32Array(4*T.length));W=0;for(ra=T.length;W<ra;W++)ua=4*W,Y._array[ua+0]=T[W].x,Y._array[ua+1]=T[W].y,Y._array[ua+2]=T[W].z,Y._array[ua+3]=T[W].w;q.uniform4fv($,Y._array);break;case "m3":q.uniformMatrix3fv($,!1,T.elements);
+break;case "m3v":void 0===Y._array&&(Y._array=new Float32Array(9*T.length));W=0;for(ra=T.length;W<ra;W++)T[W].flattenToArrayOffset(Y._array,9*W);q.uniformMatrix3fv($,!1,Y._array);break;case "m4":q.uniformMatrix4fv($,!1,T.elements);break;case "m4v":void 0===Y._array&&(Y._array=new Float32Array(16*T.length));W=0;for(ra=T.length;W<ra;W++)T[W].flattenToArrayOffset(Y._array,16*W);q.uniformMatrix4fv($,!1,Y._array);break;case "t":ta=T;Ka=m();q.uniform1i($,Ka);if(!ta)continue;if(ta instanceof THREE.CubeTexture||
+ta.image instanceof Array&&6===ta.image.length){var ga=ta,Nb=Ka;if(6===ga.image.length)if(ga.needsUpdate){ga.image.__webglTextureCube||(ga.addEventListener("dispose",xb),ga.image.__webglTextureCube=q.createTexture(),P.info.memory.textures++);q.activeTexture(q.TEXTURE0+Nb);q.bindTexture(q.TEXTURE_CUBE_MAP,ga.image.__webglTextureCube);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,ga.flipY);for(var Ob=ga instanceof THREE.CompressedTexture,yb=ga.image[0]instanceof THREE.DataTexture,La=[],ja=0;6>ja;ja++)La[ja]=
+!P.autoScaleCubemaps||Ob||yb?yb?ga.image[ja].image:ga.image[ja]:v(ga.image[ja],Vb);var Pb=La[0],Qb=THREE.Math.isPowerOfTwo(Pb.width)&&THREE.Math.isPowerOfTwo(Pb.height),Ga=w(ga.format),zb=w(ga.type);r(q.TEXTURE_CUBE_MAP,ga,Qb);for(ja=0;6>ja;ja++)if(Ob)for(var Ma,Rb=La[ja].mipmaps,Xa=0,Wb=Rb.length;Xa<Wb;Xa++)Ma=Rb[Xa],ga.format!==THREE.RGBAFormat&&ga.format!==THREE.RGBFormat?-1<Sb().indexOf(Ga)?q.compressedTexImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,Xa,Ga,Ma.width,Ma.height,0,Ma.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):
+q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,Xa,Ga,Ma.width,Ma.height,0,Ga,zb,Ma.data);else yb?q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,0,Ga,La[ja].width,La[ja].height,0,Ga,zb,La[ja].data):q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ja,0,Ga,Ga,zb,La[ja]);ga.generateMipmaps&&Qb&&q.generateMipmap(q.TEXTURE_CUBE_MAP);ga.needsUpdate=!1;if(ga.onUpdate)ga.onUpdate(ga)}else q.activeTexture(q.TEXTURE0+Nb),q.bindTexture(q.TEXTURE_CUBE_MAP,ga.image.__webglTextureCube)}else if(ta instanceof THREE.WebGLRenderTargetCube){var Xb=
+ta;q.activeTexture(q.TEXTURE0+Ka);q.bindTexture(q.TEXTURE_CUBE_MAP,Xb.__webglTexture)}else P.setTexture(ta,Ka);break;case "tv":void 0===Y._array&&(Y._array=[]);W=0;for(ra=Y.value.length;W<ra;W++)Y._array[W]=m();q.uniform1iv($,Y._array);W=0;for(ra=Y.value.length;W<ra;W++)ta=Y.value[W],Ka=Y._array[W],ta&&P.setTexture(ta,Ka);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+Mb)}}}}q.uniformMatrix4fv(ea.modelViewMatrix,!1,e._modelViewMatrix.elements);ea.normalMatrix&&q.uniformMatrix3fv(ea.normalMatrix,
+!1,e._normalMatrix.elements);null!==ea.modelMatrix&&q.uniformMatrix4fv(ea.modelMatrix,!1,e.matrixWorld.elements);return Ta}function n(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=
+b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function m(){var a=pa;a>=Ya&&THREE.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Ya);pa+=1;return a}function s(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}
+function t(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function r(a,b,c){c?(q.texParameteri(a,q.TEXTURE_WRAP_S,w(b.wrapS)),q.texParameteri(a,q.TEXTURE_WRAP_T,w(b.wrapT)),q.texParameteri(a,q.TEXTURE_MAG_FILTER,w(b.magFilter)),q.texParameteri(a,q.TEXTURE_MIN_FILTER,w(b.minFilter))):(q.texParameteri(a,q.TEXTURE_WRAP_S,q.CLAMP_TO_EDGE),q.texParameteri(a,q.TEXTURE_WRAP_T,q.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+
+b.sourceFile+" )"),q.texParameteri(a,q.TEXTURE_MAG_FILTER,z(b.magFilter)),q.texParameteri(a,q.TEXTURE_MIN_FILTER,z(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=Z.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||b.__currentAnisotropy)&&
+(q.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,P.getMaxAnisotropy())),b.__currentAnisotropy=b.anisotropy)}function v(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);THREE.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}
+function u(a,b){q.bindRenderbuffer(q.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_COMPONENT16,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_STENCIL,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a)):q.renderbufferStorage(q.RENDERBUFFER,q.RGBA4,b.width,b.height)}function x(a){a instanceof
+THREE.WebGLRenderTargetCube?(q.bindTexture(q.TEXTURE_CUBE_MAP,a.__webglTexture),q.generateMipmap(q.TEXTURE_CUBE_MAP),q.bindTexture(q.TEXTURE_CUBE_MAP,null)):(q.bindTexture(q.TEXTURE_2D,a.__webglTexture),q.generateMipmap(q.TEXTURE_2D),q.bindTexture(q.TEXTURE_2D,null))}function z(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?q.NEAREST:q.LINEAR}function w(a){var b;if(a===THREE.RepeatWrapping)return q.REPEAT;if(a===THREE.ClampToEdgeWrapping)return q.CLAMP_TO_EDGE;
+if(a===THREE.MirroredRepeatWrapping)return q.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return q.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return q.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return q.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return q.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return q.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return q.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return q.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return q.UNSIGNED_SHORT_4_4_4_4;
+if(a===THREE.UnsignedShort5551Type)return q.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return q.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return q.BYTE;if(a===THREE.ShortType)return q.SHORT;if(a===THREE.UnsignedShortType)return q.UNSIGNED_SHORT;if(a===THREE.IntType)return q.INT;if(a===THREE.UnsignedIntType)return q.UNSIGNED_INT;if(a===THREE.FloatType)return q.FLOAT;b=Z.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return q.ALPHA;
+if(a===THREE.RGBFormat)return q.RGB;if(a===THREE.RGBAFormat)return q.RGBA;if(a===THREE.LuminanceFormat)return q.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return q.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return q.FUNC_ADD;if(a===THREE.SubtractEquation)return q.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return q.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return q.ZERO;if(a===THREE.OneFactor)return q.ONE;if(a===THREE.SrcColorFactor)return q.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return q.ONE_MINUS_SRC_COLOR;
+if(a===THREE.SrcAlphaFactor)return q.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return q.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return q.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return q.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return q.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return q.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return q.SRC_ALPHA_SATURATE;b=Z.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;
+if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=Z.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
+if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=Z.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var F=void 0!==a.canvas?a.canvas:document.createElement("canvas"),G=void 0!==a.context?a.context:null,y=F.width,I=F.height,B=1,C=void 0!==a.precision?a.precision:"highp",E=void 0!==a.alpha?a.alpha:!1,L=void 0!==a.depth?a.depth:!0,
+N=void 0!==a.stencil?a.stencil:!0,H=void 0!==a.antialias?a.antialias:!1,O=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,M=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,A=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,J=new THREE.Color(0),R=0,K=[],D=[],X=[],ia=[],Q=[];this.domElement=F;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=
+8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var P=this,aa=[],ca=null,qa=null,Da=-1,xa="",V=null,pa=0,ya=0,va=0,wa=F.width,la=F.height,za=0,Aa=0,Oa=new THREE.Frustum,Ha=new THREE.Matrix4,oa=new THREE.Vector3,ha=new THREE.Vector3,$a=!0,Hb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],
+distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},q;try{a={alpha:E,depth:L,stencil:N,antialias:H,premultipliedAlpha:O,preserveDrawingBuffer:M};q=G||F.getContext("webgl",a)||F.getContext("experimental-webgl",a);if(null===q){if(null!==F.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}F.addEventListener("webglcontextlost",function(a){a.preventDefault();
+Za();cb();na.objects={}},!1)}catch(Ab){THREE.error("THREE.WebGLRenderer: "+Ab)}var U=new THREE.WebGLState(q,w);void 0===q.getShaderPrecisionFormat&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var Z=new THREE.WebGLExtensions(q),na=new THREE.WebGLObjects(q,this.info,Z,function(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material});Z.get("OES_texture_float");Z.get("OES_texture_float_linear");Z.get("OES_texture_half_float");
+Z.get("OES_texture_half_float_linear");Z.get("OES_standard_derivatives");Z.get("ANGLE_instanced_arrays");A&&Z.get("EXT_frag_depth");var Na=function(a,b,c,d){!0===O&&(a*=d,b*=d,c*=d);q.clearColor(a,b,c,d)},cb=function(){q.clearColor(0,0,0,1);q.clearDepth(1);q.clearStencil(0);q.enable(q.DEPTH_TEST);q.depthFunc(q.LEQUAL);q.frontFace(q.CCW);q.cullFace(q.BACK);q.enable(q.CULL_FACE);q.enable(q.BLEND);q.blendEquation(q.FUNC_ADD);q.blendFunc(q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA);q.viewport(ya,va,wa,la);Na(J.r,
+J.g,J.b,R)},Za=function(){V=ca=null;xa="";Da=-1;$a=!0;U.reset()};cb();this.context=q;this.extensions=Z;this.state=U;var ma=new THREE.WebGLShadowMap(this,K,na);this.shadowMap=ma;var Ya=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS),G=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Bb=q.getParameter(q.MAX_TEXTURE_SIZE),Vb=q.getParameter(q.MAX_CUBE_MAP_TEXTURE_SIZE),fb=0<G,eb=fb&&Z.get("OES_texture_float"),Cb=Z.get("ANGLE_instanced_arrays"),E=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.HIGH_FLOAT),G=q.getShaderPrecisionFormat(q.VERTEX_SHADER,
+q.MEDIUM_FLOAT),L=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.HIGH_FLOAT);a=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.MEDIUM_FLOAT);var Sb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(Z.get("WEBGL_compressed_texture_pvrtc")||Z.get("WEBGL_compressed_texture_s3tc"))for(var b=q.getParameter(q.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),E=0<E.precision&&0<L.precision,G=0<G.precision&&0<a.precision;"highp"!==C||E||(G?(C="mediump",THREE.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):
+(C="lowp",THREE.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==C||G||(C="lowp",THREE.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Db=new THREE.SpritePlugin(this,ia),Eb=new THREE.LensFlarePlugin(this,Q);this.getContext=function(){return q};this.forceContextLoss=function(){Z.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return fb};this.supportsInstancedArrays=function(){return Cb};this.supportsFloatTextures=
+function(){return Z.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return Z.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){return Z.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return Z.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return Z.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return Z.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;
+return function(){if(void 0!==a)return a;var b=Z.get("EXT_texture_filter_anisotropic");return a=null!==b?q.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return C};this.getPixelRatio=function(){return B};this.setPixelRatio=function(a){B=a};this.getSize=function(){return{width:y,height:I}};this.setSize=function(a,b,c){y=a;I=b;F.width=a*B;F.height=b*B;!1!==c&&(F.style.width=a+"px",F.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){ya=
+a*B;va=b*B;wa=c*B;la=d*B;q.viewport(ya,va,wa,la)};this.setScissor=function(a,b,c,d){q.scissor(a*B,b*B,c*B,d*B)};this.enableScissorTest=function(a){a?q.enable(q.SCISSOR_TEST):q.disable(q.SCISSOR_TEST)};this.getClearColor=function(){return J};this.setClearColor=function(a,b){J.set(a);R=void 0!==b?b:1;Na(J.r,J.g,J.b,R)};this.getClearAlpha=function(){return R};this.setClearAlpha=function(a){R=a;Na(J.r,J.g,J.b,R)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=q.COLOR_BUFFER_BIT;if(void 0===b||
+b)d|=q.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=q.STENCIL_BUFFER_BIT;q.clear(d)};this.clearColor=function(){q.clear(q.COLOR_BUFFER_BIT)};this.clearDepth=function(){q.clear(q.DEPTH_BUFFER_BIT)};this.clearStencil=function(){q.clear(q.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=Za;var xb=function(a){a=a.target;a.removeEventListener("dispose",xb);a.image&&a.image.__webglTextureCube?(q.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):
+void 0!==a.__webglInit&&(q.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);P.info.memory.textures--},db=function(a){a=a.target;a.removeEventListener("dispose",db);if(a&&void 0!==a.__webglTexture){q.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)q.deleteFramebuffer(a.__webglFramebuffer[b]),q.deleteRenderbuffer(a.__webglRenderbuffer[b]);else q.deleteFramebuffer(a.__webglFramebuffer),q.deleteRenderbuffer(a.__webglRenderbuffer);
+delete a.__webglFramebuffer;delete a.__webglRenderbuffer}P.info.memory.textures--},Gb=function(a){a=a.target;a.removeEventListener("dispose",Gb);Fb(a)},Fb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=aa.length;a<c;a++)if(d=aa[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=aa.length;a<c;a++)d=aa[a],d.program!==b&&e.push(d);aa=e;q.deleteProgram(b);P.info.memory.programs--}}};this.renderBufferImmediate=function(a,
+b,c){U.initAttributes();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=q.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=q.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=q.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=q.createBuffer());a.hasPositions&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglVertexBuffer),q.bufferData(q.ARRAY_BUFFER,a.positionArray,q.DYNAMIC_DRAW),U.enableAttribute(b.attributes.position),q.vertexAttribPointer(b.attributes.position,
+3,q.FLOAT,!1,0,0));if(a.hasNormals){q.bindBuffer(q.ARRAY_BUFFER,a.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,k,m,l,p,n,u,s=3*a.count;for(u=0;u<s;u+=9)n=a.normalArray,d=n[u],e=n[u+1],f=n[u+2],g=n[u+3],k=n[u+4],l=n[u+5],h=n[u+6],m=n[u+7],p=n[u+8],d=(d+g+h)/3,e=(e+k+m)/3,f=(f+l+p)/3,n[u]=d,n[u+1]=e,n[u+2]=f,n[u+3]=d,n[u+4]=e,n[u+5]=f,n[u+6]=d,n[u+7]=e,n[u+8]=f}q.bufferData(q.ARRAY_BUFFER,a.normalArray,q.DYNAMIC_DRAW);U.enableAttribute(b.attributes.normal);
+q.vertexAttribPointer(b.attributes.normal,3,q.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglUvBuffer),q.bufferData(q.ARRAY_BUFFER,a.uvArray,q.DYNAMIC_DRAW),U.enableAttribute(b.attributes.uv),q.vertexAttribPointer(b.attributes.uv,2,q.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglColorBuffer),q.bufferData(q.ARRAY_BUFFER,a.colorArray,q.DYNAMIC_DRAW),U.enableAttribute(b.attributes.color),q.vertexAttribPointer(b.attributes.color,
+3,q.FLOAT,!1,0,0));U.disableUnusedAttributes();q.drawArrays(q.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f,g){if(!1!==e.visible)if(na.update(g),a=p(a,c,d,e,g),c=!1,d="direct_"+f.id+"_"+a.id+"_"+(e.wireframe?1:0),d!==xa&&(xa=d,c=!0),c&&U.initAttributes(),g instanceof THREE.Mesh){g=!0===e.wireframe?q.LINES:q.TRIANGLES;var h=f.attributes.index;if(h){var k,m;h.array instanceof Uint32Array&&Z.get("OES_element_index_uint")?(k=q.UNSIGNED_INT,m=4):(k=q.UNSIGNED_SHORT,m=2);d=
+f.offsets;if(0===d.length){c&&(b(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer));if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){var l=Z.get("ANGLE_instanced_arrays");if(null===l){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}l.drawElementsInstancedANGLE(g,h.array.length,k,0,f.maxInstancedCount)}else q.drawElements(g,h.array.length,k,0);P.info.render.calls++;
+P.info.render.vertices+=h.array.length;P.info.render.faces+=h.array.length/3}else{c=!0;for(var n=0,u=d.length;n<u;n++){l=d[n].index;c&&(b(e,a,f,l),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer));if(f instanceof THREE.InstancedBufferGeometry&&0<d[n].instances){l=Z.get("ANGLE_instanced_arrays");if(null===l){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break}l.drawElementsInstancedANGLE(g,
+d[n].count,k,d[n].start*m,d[n].count,k,d[n].instances)}else q.drawElements(g,d[n].count,k,d[n].start*m);P.info.render.calls++;P.info.render.vertices+=d[n].count;P.info.render.faces+=d[n].count/3}}}else{c&&b(e,a,f,0);e=f.attributes.position;if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){l=Z.get("ANGLE_instanced_arrays");if(null===l){THREE.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
+return}e instanceof THREE.InterleavedBufferAttribute?l.drawArraysInstancedANGLE(g,0,e.data.array.length/e.data.stride,f.maxInstancedCount):l.drawArraysInstancedANGLE(g,0,e.array.length/e.itemSize,f.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?q.drawArrays(g,0,e.data.array.length/e.data.stride):q.drawArrays(g,0,e.array.length/e.itemSize);P.info.render.calls++;P.info.render.vertices+=e.array.length/e.itemSize;P.info.render.faces+=e.array.length/(3*e.itemSize)}}else if(g instanceof
+THREE.PointCloud)if(g=q.POINTS,h=f.attributes.index)if(h.array instanceof Uint32Array&&Z.get("OES_element_index_uint")?(k=q.UNSIGNED_INT,m=4):(k=q.UNSIGNED_SHORT,m=2),d=f.offsets,0===d.length)c&&(b(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,h.array.length,k,0),P.info.render.calls++,P.info.render.points+=h.array.length;else for(1<d.length&&(c=!0),n=0,u=d.length;n<u;n++)l=d[n].index,c&&(b(e,a,f,l),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,d[n].count,
+k,d[n].start*m),P.info.render.calls++,P.info.render.points+=d[n].count;else if(c&&b(e,a,f,0),e=f.attributes.position,d=f.offsets,0===d.length)q.drawArrays(g,0,e.array.length/3),P.info.render.calls++,P.info.render.points+=e.array.length/3;else for(n=0,u=d.length;n<u;n++)q.drawArrays(g,d[n].index,d[n].count),P.info.render.calls++,P.info.render.points+=d[n].count;else if(g instanceof THREE.Line)if(g=g.mode===THREE.LineStrip?q.LINE_STRIP:q.LINES,U.setLineWidth(e.linewidth*B),h=f.attributes.index)if(h.array instanceof
+Uint32Array?(k=q.UNSIGNED_INT,m=4):(k=q.UNSIGNED_SHORT,m=2),d=f.offsets,0===d.length)c&&(b(e,a,f,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,h.array.length,k,0),P.info.render.calls++,P.info.render.vertices+=h.array.length;else for(1<d.length&&(c=!0),n=0,u=d.length;n<u;n++)l=d[n].index,c&&(b(e,a,f,l),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(g,d[n].count,k,d[n].start*m),P.info.render.calls++,P.info.render.vertices+=d[n].count;else if(c&&b(e,a,f,0),e=f.attributes.position,
+d=f.offsets,0===d.length)q.drawArrays(g,0,e.array.length/3),P.info.render.calls++,P.info.render.vertices+=e.array.length/3;else for(n=0,u=d.length;n<u;n++)q.drawArrays(g,d[n].index,d[n].count),P.info.render.calls++,P.info.render.vertices+=d[n].count};this.renderBuffer=function(a,b,c,d,f,g){if(!1!==d.visible){na.update(g);c=p(a,b,c,d,g);b=c.attributes;a=!1;c=f.id+"_"+c.id+"_"+(d.wireframe?1:0);c!==xa&&(xa=c,a=!0);a&&U.initAttributes();if(!d.morphTargets&&0<=b.position)a&&(q.bindBuffer(q.ARRAY_BUFFER,
+f.__webglVertexBuffer),U.enableAttribute(b.position),q.vertexAttribPointer(b.position,3,q.FLOAT,!1,0,0));else if(g.morphTargetBase){c=d.program.attributes;-1!==g.morphTargetBase&&0<=c.position?(q.bindBuffer(q.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[g.morphTargetBase]),U.enableAttribute(c.position),q.vertexAttribPointer(c.position,3,q.FLOAT,!1,0,0)):0<=c.position&&(q.bindBuffer(q.ARRAY_BUFFER,f.__webglVertexBuffer),U.enableAttribute(c.position),q.vertexAttribPointer(c.position,3,q.FLOAT,!1,0,0));
+if(g.morphTargetForcedOrder.length)for(var h=0,k=g.morphTargetForcedOrder,m=g.morphTargetInfluences,l;h<d.numSupportedMorphTargets&&h<k.length;)l=c["morphTarget"+h],0<=l&&(q.bindBuffer(q.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[k[h]]),U.enableAttribute(l),q.vertexAttribPointer(l,3,q.FLOAT,!1,0,0)),l=c["morphNormal"+h],0<=l&&d.morphNormals&&(q.bindBuffer(q.ARRAY_BUFFER,f.__webglMorphNormalsBuffers[k[h]]),U.enableAttribute(l),q.vertexAttribPointer(l,3,q.FLOAT,!1,0,0)),g.__webglMorphTargetInfluences[h]=
+m[k[h]],h++;else{k=[];m=g.morphTargetInfluences;h=g.geometry.morphTargets;m.length>h.length&&(THREE.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),m.length=h.length);h=0;for(l=m.length;h<l;h++)k.push([m[h],h]);k.length>d.numSupportedMorphTargets?(k.sort(e),k.length=d.numSupportedMorphTargets):k.length>d.numSupportedMorphNormals?k.sort(e):0===k.length&&k.push([0,0]);for(var h=0,n=d.numSupportedMorphTargets;h<n;h++)if(k[h]){var u=k[h][1];l=c["morphTarget"+h];0<=l&&
+(q.bindBuffer(q.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[u]),U.enableAttribute(l),q.vertexAttribPointer(l,3,q.FLOAT,!1,0,0));l=c["morphNormal"+h];0<=l&&d.morphNormals&&(q.bindBuffer(q.ARRAY_BUFFER,f.__webglMorphNormalsBuffers[u]),U.enableAttribute(l),q.vertexAttribPointer(l,3,q.FLOAT,!1,0,0));g.__webglMorphTargetInfluences[h]=m[u]}else g.__webglMorphTargetInfluences[h]=0}null!==d.program.uniforms.morphTargetInfluences&&q.uniform1fv(d.program.uniforms.morphTargetInfluences,g.__webglMorphTargetInfluences)}if(a){if(f.__webglCustomAttributesList)for(c=
+0,m=f.__webglCustomAttributesList.length;c<m;c++)k=f.__webglCustomAttributesList[c],0<=b[k.buffer.belongsToAttribute]&&(q.bindBuffer(q.ARRAY_BUFFER,k.buffer),U.enableAttribute(b[k.buffer.belongsToAttribute]),q.vertexAttribPointer(b[k.buffer.belongsToAttribute],k.size,q.FLOAT,!1,0,0));0<=b.color&&(0<g.geometry.colors.length||0<g.geometry.faces.length?(q.bindBuffer(q.ARRAY_BUFFER,f.__webglColorBuffer),U.enableAttribute(b.color),q.vertexAttribPointer(b.color,3,q.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&
+q.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(q.bindBuffer(q.ARRAY_BUFFER,f.__webglNormalBuffer),U.enableAttribute(b.normal),q.vertexAttribPointer(b.normal,3,q.FLOAT,!1,0,0));0<=b.tangent&&(q.bindBuffer(q.ARRAY_BUFFER,f.__webglTangentBuffer),U.enableAttribute(b.tangent),q.vertexAttribPointer(b.tangent,4,q.FLOAT,!1,0,0));0<=b.uv&&(g.geometry.faceVertexUvs[0]?(q.bindBuffer(q.ARRAY_BUFFER,f.__webglUVBuffer),U.enableAttribute(b.uv),q.vertexAttribPointer(b.uv,2,q.FLOAT,!1,0,
+0)):void 0!==d.defaultAttributeValues&&q.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(g.geometry.faceVertexUvs[1]?(q.bindBuffer(q.ARRAY_BUFFER,f.__webglUV2Buffer),U.enableAttribute(b.uv2),q.vertexAttribPointer(b.uv2,2,q.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&q.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(q.bindBuffer(q.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),U.enableAttribute(b.skinIndex),q.vertexAttribPointer(b.skinIndex,
+4,q.FLOAT,!1,0,0),q.bindBuffer(q.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),U.enableAttribute(b.skinWeight),q.vertexAttribPointer(b.skinWeight,4,q.FLOAT,!1,0,0));0<=b.lineDistance&&(q.bindBuffer(q.ARRAY_BUFFER,f.__webglLineDistanceBuffer),U.enableAttribute(b.lineDistance),q.vertexAttribPointer(b.lineDistance,1,q.FLOAT,!1,0,0))}U.disableUnusedAttributes();g instanceof THREE.Mesh?(g=f.__typeArray===Uint32Array?q.UNSIGNED_INT:q.UNSIGNED_SHORT,d.wireframe?(U.setLineWidth(d.wireframeLinewidth*B),a&&q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,
+f.__webglLineBuffer),q.drawElements(q.LINES,f.__webglLineCount,g,0)):(a&&q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),q.drawElements(q.TRIANGLES,f.__webglFaceCount,g,0)),P.info.render.calls++,P.info.render.vertices+=f.__webglFaceCount,P.info.render.faces+=f.__webglFaceCount/3):g instanceof THREE.Line?(g=g.mode===THREE.LineStrip?q.LINE_STRIP:q.LINES,U.setLineWidth(d.linewidth*B),q.drawArrays(g,0,f.__webglLineCount),P.info.render.calls++):g instanceof THREE.PointCloud&&(q.drawArrays(q.POINTS,
+0,f.__webglParticleCount),P.info.render.calls++,P.info.render.points+=f.__webglParticleCount)}};this.render=function(a,b,e,m){if(!1===b instanceof THREE.Camera)THREE.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var p=a.fog;xa="";Da=-1;V=null;$a=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);Ha.multiplyMatrices(b.projectionMatrix,
+b.matrixWorldInverse);Oa.setFromMatrix(Ha);K.length=0;D.length=0;X.length=0;ia.length=0;Q.length=0;f(a);!0===P.sortObjects&&(D.sort(c),X.sort(d));ma.render(a,b);P.info.render.calls=0;P.info.render.vertices=0;P.info.render.faces=0;P.info.render.points=0;this.setRenderTarget(e);(this.autoClear||m)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=0;for(var n=na.objectsImmediate.length;m<n;m++){var q=na.objectsImmediate[m],u=q.object;u.visible&&(s(u,b),k(q))}a.overrideMaterial?
+(m=a.overrideMaterial,l(m),g(D,b,K,p,m),g(X,b,K,p,m),h(na.objectsImmediate,"",b,K,p,m)):(U.setBlending(THREE.NoBlending),g(D,b,K,p,null),h(na.objectsImmediate,"opaque",b,K,p,null),g(X,b,K,p,null),h(na.objectsImmediate,"transparent",b,K,p,null));Db.render(a,b);Eb.render(a,b,za,Aa);e&&e.generateMipmaps&&e.minFilter!==THREE.NearestFilter&&e.minFilter!==THREE.LinearFilter&&x(e);U.setDepthTest(!0);U.setDepthWrite(!0);U.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=p(a,b,c,d,
+e);xa="";P.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,q,Oa):e.render(function(a){P.renderBufferImmediate(a,f,d)})};var Tb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?q.disable(q.CULL_FACE):(b===THREE.FrontFaceDirectionCW?q.frontFace(q.CW):
+q.frontFace(q.CCW),a===THREE.CullFaceBack?q.cullFace(q.BACK):a===THREE.CullFaceFront?q.cullFace(q.FRONT):q.cullFace(q.FRONT_AND_BACK),q.enable(q.CULL_FACE))};this.setMaterialFaces=function(a){U.setDoubleSided(a.side===THREE.DoubleSide);U.setFlipSided(a.side===THREE.BackSide)};this.uploadTexture=function(a,b){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",xb),a.__webglTexture=q.createTexture(),P.info.memory.textures++);q.activeTexture(q.TEXTURE0+b);q.bindTexture(q.TEXTURE_2D,
+a.__webglTexture);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,a.flipY);q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);q.pixelStorei(q.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=v(a.image,Bb);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=w(a.format),f=w(a.type);r(q.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);
+a.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Sb().indexOf(e)?q.compressedTexImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,c.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=
+0;for(k=g.length;h<k;h++)c=g[h],q.texImage2D(q.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&q.generateMipmap(q.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate(a)};this.setTexture=function(a,b){!0===a.needsUpdate?!1===a.image.complete?THREE.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a):P.uploadTexture(a,b):(q.activeTexture(q.TEXTURE0+b),q.bindTexture(q.TEXTURE_2D,a.__webglTexture))};this.setRenderTarget=
+function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",db);a.__webglTexture=q.createTexture();P.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=w(a.format),e=w(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];q.bindTexture(q.TEXTURE_CUBE_MAP,a.__webglTexture);r(q.TEXTURE_CUBE_MAP,
+a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=q.createFramebuffer();a.__webglRenderbuffer[f]=q.createRenderbuffer();q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=q.TEXTURE_CUBE_MAP_POSITIVE_X+f;q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer[f]);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,h,g.__webglTexture,0);u(a.__webglRenderbuffer[f],a)}a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=q.createFramebuffer(),
+a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:q.createRenderbuffer(),q.bindTexture(q.TEXTURE_2D,a.__webglTexture),r(q.TEXTURE_2D,a,c),q.texImage2D(q.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=q.TEXTURE_2D,q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer),q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):
+a.depthBuffer&&a.stencilBuffer&&q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):u(a.__webglRenderbuffer,a),a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_2D);b?q.bindTexture(q.TEXTURE_CUBE_MAP,null):q.bindTexture(q.TEXTURE_2D,null);q.bindRenderbuffer(q.RENDERBUFFER,null);q.bindFramebuffer(q.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=wa,a=la,d=ya,e=va);b!==qa&&
+(q.bindFramebuffer(q.FRAMEBUFFER,b),q.viewport(d,e,c,a),qa=b);za=c;Aa=a};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(a.__webglFramebuffer)if(a.format!==THREE.RGBAFormat)THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;a.__webglFramebuffer!==qa&&
+(q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer),g=!0);q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?q.readPixels(b,c,d,e,q.RGBA,q.UNSIGNED_BYTE,f):THREE.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&q.bindFramebuffer(q.FRAMEBUFFER,qa)}};this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};
+this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return ma.enabled},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");ma.enabled=a}},shadowMapType:{get:function(){return ma.type},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");
+ma.type=a}},shadowMapCullFace:{get:function(){return ma.cullFace},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");ma.cullFace=a}},shadowMapDebug:{get:function(){return ma.debug},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");ma.debug=a}},shadowMapCascade:{get:function(){return ma.cascade},set:function(a){THREE.warn("THREE.WebGLRenderer: .shadowMapCascade is now .shadowMap.cascade.");ma.cascade=a}}})};
 THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:
 THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null};
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;
 a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
-THREE.WebGLBuffers=function(a,b,c,d){function e(b){var c=b.geometry;b=b.material;var d=c.vertices.length;if(b.attributes){void 0===c.__webglCustomAttributesList&&(c.__webglCustomAttributesList=[]);for(var e in b.attributes){var l=b.attributes[e];if(!l.__webglInitialized||l.createUniqueBuffers){l.__webglInitialized=!0;var n=1;"v2"===l.type?n=2:"v3"===l.type?n=3:"v4"===l.type?n=4:"c"===l.type&&(n=3);l.size=n;l.array=new Float32Array(d*n);l.buffer=a.createBuffer();l.buffer.belongsToAttribute=e;l.needsUpdate=
+THREE.WebGLBuffers=function(a,b,c,d){function e(b){var c=b.geometry;b=b.material;var d=c.vertices.length;if(b.attributes){void 0===c.__webglCustomAttributesList&&(c.__webglCustomAttributesList=[]);for(var e in b.attributes){var l=b.attributes[e];if(!l.__webglInitialized||l.createUniqueBuffers){l.__webglInitialized=!0;var p=1;"v2"===l.type?p=2:"v3"===l.type?p=3:"v4"===l.type?p=4:"c"===l.type&&(p=3);l.size=p;l.array=new Float32Array(d*p);l.buffer=a.createBuffer();l.buffer.belongsToAttribute=e;l.needsUpdate=
 !0}c.__webglCustomAttributesList.push(l)}}}this.initPointCloudBuffers=function(c,d){if(void 0===c.__webglVertexBuffer){c.__webglVertexBuffer=a.createBuffer();c.__webglColorBuffer=a.createBuffer();b.memory.geometries++;var h=c.vertices.length;c.__vertexArray=new Float32Array(3*h);c.__colorArray=new Float32Array(3*h);c.__webglParticleCount=h;e(d);c.verticesNeedUpdate=!0;c.colorsNeedUpdate=!0}};this.initLineBuffers=function(c,d){if(void 0===c.__webglVertexBuffer){c.__webglVertexBuffer=a.createBuffer();
 c.__webglColorBuffer=a.createBuffer();c.__webglLineDistanceBuffer=a.createBuffer();b.memory.geometries++;var h=c.vertices.length;c.__vertexArray=new Float32Array(3*h);c.__colorArray=new Float32Array(3*h);c.__lineDistanceArray=new Float32Array(1*h);c.__webglLineCount=h;e(d);c.verticesNeedUpdate=!0;c.colorsNeedUpdate=!0;c.lineDistancesNeedUpdate=!0}};this.initMeshBuffers=function(e,g){e.__webglVertexBuffer=a.createBuffer();e.__webglNormalBuffer=a.createBuffer();e.__webglTangentBuffer=a.createBuffer();
-e.__webglColorBuffer=a.createBuffer();e.__webglUVBuffer=a.createBuffer();e.__webglUV2Buffer=a.createBuffer();e.__webglSkinIndicesBuffer=a.createBuffer();e.__webglSkinWeightsBuffer=a.createBuffer();e.__webglFaceBuffer=a.createBuffer();e.__webglLineBuffer=a.createBuffer();var h=e.numMorphTargets;if(h){e.__webglMorphTargetsBuffers=[];for(var k=0,l=h;k<l;k++)e.__webglMorphTargetsBuffers.push(a.createBuffer())}var n=e.numMorphNormals;if(n)for(e.__webglMorphNormalsBuffers=[],k=0,l=n;k<l;k++)e.__webglMorphNormalsBuffers.push(a.createBuffer());
-b.memory.geometries++;var k=g.geometry,p=e.faces3,m=3*p.length,r=1*p.length,t=3*p.length,p=d(g,e);e.__vertexArray=new Float32Array(3*m);e.__normalArray=new Float32Array(3*m);e.__colorArray=new Float32Array(3*m);e.__uvArray=new Float32Array(2*m);1<k.faceVertexUvs.length&&(e.__uv2Array=new Float32Array(2*m));k.hasTangents&&(e.__tangentArray=new Float32Array(4*m));g.geometry.skinWeights.length&&g.geometry.skinIndices.length&&(e.__skinIndexArray=new Float32Array(4*m),e.__skinWeightArray=new Float32Array(4*
-m));k=null!==c.get("OES_element_index_uint")&&21845<r?Uint32Array:Uint16Array;e.__typeArray=k;e.__faceArray=new k(3*r);e.__lineArray=new k(2*t);if(h)for(e.__morphTargetsArrays=[],k=0,l=h;k<l;k++)e.__morphTargetsArrays.push(new Float32Array(3*m));if(n)for(e.__morphNormalsArrays=[],k=0,l=n;k<l;k++)e.__morphNormalsArrays.push(new Float32Array(3*m));e.__webglFaceCount=3*r;e.__webglLineCount=2*t;if(p.attributes){void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]);for(var s in p.attributes){var h=
-p.attributes[s],n={},u;for(u in h)n[u]=h[u];if(!n.__webglInitialized||n.createUniqueBuffers)n.__webglInitialized=!0,r=1,"v2"===n.type?r=2:"v3"===n.type?r=3:"v4"===n.type?r=4:"c"===n.type&&(r=3),n.size=r,n.array=new Float32Array(m*r),n.buffer=a.createBuffer(),n.buffer.belongsToAttribute=s,h.needsUpdate=!0,n.__original=h;e.__webglCustomAttributesList.push(n)}}e.__inittedArrays=!0};this.setPointCloudBuffers=function(b,c,d){var e,l,n=b.vertices,p=n.length,m=b.colors,r=m.length,t=b.__vertexArray,s=b.__colorArray,
-u=b.colorsNeedUpdate,v=b.__webglCustomAttributesList;if(b.verticesNeedUpdate){for(e=0;e<p;e++)l=n[e],d=3*e,t[d]=l.x,t[d+1]=l.y,t[d+2]=l.z;a.bindBuffer(a.ARRAY_BUFFER,b.__webglVertexBuffer);a.bufferData(a.ARRAY_BUFFER,t,c)}if(u){for(e=0;e<r;e++)l=m[e],d=3*e,s[d]=l.r,s[d+1]=l.g,s[d+2]=l.b;a.bindBuffer(a.ARRAY_BUFFER,b.__webglColorBuffer);a.bufferData(a.ARRAY_BUFFER,s,c)}if(v)for(b=0,m=v.length;b<m;b++){l=v[b];if(l.needsUpdate&&(void 0===l.boundTo||"vertices"===l.boundTo))if(s=l.value.length,d=0,1===
-l.size)for(r=0;r<s;r++)l.array[r]=l.value[r];else if(2===l.size)for(r=0;r<s;r++)e=l.value[r],l.array[d]=e.x,l.array[d+1]=e.y,d+=2;else if(3===l.size)if("c"===l.type)for(r=0;r<s;r++)e=l.value[r],l.array[d]=e.r,l.array[d+1]=e.g,l.array[d+2]=e.b,d+=3;else for(r=0;r<s;r++)e=l.value[r],l.array[d]=e.x,l.array[d+1]=e.y,l.array[d+2]=e.z,d+=3;else if(4===l.size)for(r=0;r<s;r++)e=l.value[r],l.array[d]=e.x,l.array[d+1]=e.y,l.array[d+2]=e.z,l.array[d+3]=e.w,d+=4;a.bindBuffer(a.ARRAY_BUFFER,l.buffer);a.bufferData(a.ARRAY_BUFFER,
-l.array,c);l.needsUpdate=!1}};this.setLineBuffers=function(b,c){var d,e,l,n=b.vertices,p=b.colors,m=b.lineDistances,r=n.length,t=p.length,s=m.length,u=b.__vertexArray,v=b.__colorArray,x=b.__lineDistanceArray,z=b.colorsNeedUpdate,w=b.lineDistancesNeedUpdate,I=b.__webglCustomAttributesList;if(b.verticesNeedUpdate){for(d=0;d<r;d++)l=n[d],e=3*d,u[e]=l.x,u[e+1]=l.y,u[e+2]=l.z;a.bindBuffer(a.ARRAY_BUFFER,b.__webglVertexBuffer);a.bufferData(a.ARRAY_BUFFER,u,c)}if(z){for(d=0;d<t;d++)l=p[d],e=3*d,v[e]=l.r,
-v[e+1]=l.g,v[e+2]=l.b;a.bindBuffer(a.ARRAY_BUFFER,b.__webglColorBuffer);a.bufferData(a.ARRAY_BUFFER,v,c)}if(w){for(e=0;e<s;e++)x[e]=m[e];a.bindBuffer(a.ARRAY_BUFFER,b.__webglLineDistanceBuffer);a.bufferData(a.ARRAY_BUFFER,x,c)}if(I)for(m=0,s=I.length;m<s;m++)if(v=I[m],v.needsUpdate&&(void 0===v.boundTo||"vertices"===v.boundTo)){e=0;p=v.value.length;if(1===v.size)for(x=0;x<p;x++)v.array[x]=v.value[x];else if(2===v.size)for(x=0;x<p;x++)t=v.value[x],v.array[e]=t.x,v.array[e+1]=t.y,e+=2;else if(3===v.size)if("c"===
-v.type)for(x=0;x<p;x++)t=v.value[x],v.array[e]=t.r,v.array[e+1]=t.g,v.array[e+2]=t.b,e+=3;else for(x=0;x<p;x++)t=v.value[x],v.array[e]=t.x,v.array[e+1]=t.y,v.array[e+2]=t.z,e+=3;else if(4===v.size)for(x=0;x<p;x++)t=v.value[x],v.array[e]=t.x,v.array[e+1]=t.y,v.array[e+2]=t.z,v.array[e+3]=t.w,e+=4;a.bindBuffer(a.ARRAY_BUFFER,v.buffer);a.bufferData(a.ARRAY_BUFFER,v.array,c);v.needsUpdate=!1}};this.setMeshBuffers=function(b,c,d,e,l){if(b.__inittedArrays){var n=!1===l instanceof THREE.MeshPhongMaterial&&
-l.shading===THREE.FlatShading,p,m,r,t,s,u,v,x,z,w,I,H,y,F,B,E,C,N,K,L,J,G,A=x=K=E=0,M=0,R=B=C=0,O=s=I=0,D=0,O=b.__vertexArray;N=b.__uvArray;var D=b.__uv2Array,aa=b.__normalArray;r=b.__tangentArray;v=b.__colorArray;H=b.__skinIndexArray;y=b.__skinWeightArray;F=b.__morphTargetsArrays;var oa=b.__morphNormalsArrays,P=b.__webglCustomAttributesList,ea=b.__faceArray,$=b.__lineArray,X=c.geometry,ua=X.elementsNeedUpdate,ka=X.uvsNeedUpdate;t=X.normalsNeedUpdate;var ra=X.tangentsNeedUpdate;u=X.colorsNeedUpdate;
-L=X.morphTargetsNeedUpdate;G=X.vertices;var V=b.faces3,la=X.faces,Q=X.faceVertexUvs[0],va=X.faceVertexUvs[1],La=X.skinIndices,ta=X.skinWeights,Ba=X.morphTargets,na=X.morphNormals;if(X.verticesNeedUpdate){c=0;for(p=V.length;c<p;c++)m=la[V[c]],z=G[m.a],w=G[m.b],m=G[m.c],O[K]=z.x,O[K+1]=z.y,O[K+2]=z.z,O[K+3]=w.x,O[K+4]=w.y,O[K+5]=w.z,O[K+6]=m.x,O[K+7]=m.y,O[K+8]=m.z,K+=9;a.bindBuffer(a.ARRAY_BUFFER,b.__webglVertexBuffer);a.bufferData(a.ARRAY_BUFFER,O,d)}if(L)for(K=0,L=Ba.length;K<L;K++){c=O=0;for(p=
-V.length;c<p;c++)G=V[c],m=la[G],z=Ba[K].vertices[m.a],w=Ba[K].vertices[m.b],m=Ba[K].vertices[m.c],J=F[K],J[O]=z.x,J[O+1]=z.y,J[O+2]=z.z,J[O+3]=w.x,J[O+4]=w.y,J[O+5]=w.z,J[O+6]=m.x,J[O+7]=m.y,J[O+8]=m.z,l.morphNormals&&(n?w=z=m=na[K].faceNormals[G]:(w=na[K].vertexNormals[G],m=w.a,z=w.b,w=w.c),G=oa[K],G[O]=m.x,G[O+1]=m.y,G[O+2]=m.z,G[O+3]=z.x,G[O+4]=z.y,G[O+5]=z.z,G[O+6]=w.x,G[O+7]=w.y,G[O+8]=w.z),O+=9;a.bindBuffer(a.ARRAY_BUFFER,b.__webglMorphTargetsBuffers[K]);a.bufferData(a.ARRAY_BUFFER,F[K],d);
-l.morphNormals&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglMorphNormalsBuffers[K]),a.bufferData(a.ARRAY_BUFFER,oa[K],d))}if(ta.length){c=0;for(p=V.length;c<p;c++)m=la[V[c]],z=ta[m.a],w=ta[m.b],F=ta[m.c],y[s]=z.x,y[s+1]=z.y,y[s+2]=z.z,y[s+3]=z.w,y[s+4]=w.x,y[s+5]=w.y,y[s+6]=w.z,y[s+7]=w.w,y[s+8]=F.x,y[s+9]=F.y,y[s+10]=F.z,y[s+11]=F.w,z=La[m.a],w=La[m.b],m=La[m.c],H[s]=z.x,H[s+1]=z.y,H[s+2]=z.z,H[s+3]=z.w,H[s+4]=w.x,H[s+5]=w.y,H[s+6]=w.z,H[s+7]=w.w,H[s+8]=m.x,H[s+9]=m.y,H[s+10]=m.z,H[s+11]=m.w,s+=12;0<s&&
-(a.bindBuffer(a.ARRAY_BUFFER,b.__webglSkinIndicesBuffer),a.bufferData(a.ARRAY_BUFFER,H,d),a.bindBuffer(a.ARRAY_BUFFER,b.__webglSkinWeightsBuffer),a.bufferData(a.ARRAY_BUFFER,y,d))}if(u){c=0;for(p=V.length;c<p;c++)m=la[V[c]],s=m.vertexColors,u=m.color,3===s.length&&l.vertexColors===THREE.VertexColors?(H=s[0],y=s[1],s=s[2]):s=y=H=u,v[I]=H.r,v[I+1]=H.g,v[I+2]=H.b,v[I+3]=y.r,v[I+4]=y.g,v[I+5]=y.b,v[I+6]=s.r,v[I+7]=s.g,v[I+8]=s.b,I+=9;0<I&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglColorBuffer),a.bufferData(a.ARRAY_BUFFER,
-v,d))}if(ra&&X.hasTangents){c=0;for(p=V.length;c<p;c++)m=la[V[c]],v=m.vertexTangents,l=v[0],I=v[1],v=v[2],r[B]=l.x,r[B+1]=l.y,r[B+2]=l.z,r[B+3]=l.w,r[B+4]=I.x,r[B+5]=I.y,r[B+6]=I.z,r[B+7]=I.w,r[B+8]=v.x,r[B+9]=v.y,r[B+10]=v.z,r[B+11]=v.w,B+=12;a.bindBuffer(a.ARRAY_BUFFER,b.__webglTangentBuffer);a.bufferData(a.ARRAY_BUFFER,r,d)}if(t){c=0;for(p=V.length;c<p;c++)if(m=la[V[c]],r=m.vertexNormals,t=m.normal,3===r.length&&!1===n)for(B=0;3>B;B++)t=r[B],aa[C]=t.x,aa[C+1]=t.y,aa[C+2]=t.z,C+=3;else for(B=0;3>
-B;B++)aa[C]=t.x,aa[C+1]=t.y,aa[C+2]=t.z,C+=3;a.bindBuffer(a.ARRAY_BUFFER,b.__webglNormalBuffer);a.bufferData(a.ARRAY_BUFFER,aa,d)}if(ka&&Q){c=0;for(p=V.length;c<p;c++)if(n=V[c],n=Q[n],void 0!==n)for(B=0;3>B;B++)C=n[B],N[x]=C.x,N[x+1]=C.y,x+=2;0<x&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglUVBuffer),a.bufferData(a.ARRAY_BUFFER,N,d))}if(ka&&va){c=0;for(p=V.length;c<p;c++)if(n=V[c],x=va[n],void 0!==x)for(B=0;3>B;B++)N=x[B],D[A]=N.x,D[A+1]=N.y,A+=2;0<A&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglUV2Buffer),a.bufferData(a.ARRAY_BUFFER,
-D,d))}if(ua){c=0;for(p=V.length;c<p;c++)ea[M]=E,ea[M+1]=E+1,ea[M+2]=E+2,M+=3,$[R]=E,$[R+1]=E+1,$[R+2]=E,$[R+3]=E+2,$[R+4]=E+1,$[R+5]=E+2,R+=6,E+=3;a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,b.__webglFaceBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER,ea,d);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,b.__webglLineBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER,$,d)}if(P)for(B=0,E=P.length;B<E;B++)if(A=P[B],A.__original.needsUpdate){D=0;if(1===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=
-la[V[c]],A.array[D]=A.value[m.a],A.array[D+1]=A.value[m.b],A.array[D+2]=A.value[m.c],D+=3;else{if("faces"===A.boundTo)for(c=0,p=V.length;c<p;c++)R=A.value[V[c]],A.array[D]=R,A.array[D+1]=R,A.array[D+2]=R,D+=3}else if(2===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=la[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=w.x,A.array[D+3]=w.y,A.array[D+4]=m.x,A.array[D+5]=m.y,D+=6;else{if("faces"===A.boundTo)for(c=0,p=V.length;c<
-p;c++)m=w=z=R=A.value[V[c]],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=w.x,A.array[D+3]=w.y,A.array[D+4]=m.x,A.array[D+5]=m.y,D+=6}else if(3===A.size)if(M="c"===A.type?["r","g","b"]:["x","y","z"],void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=la[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z[M[0]],A.array[D+1]=z[M[1]],A.array[D+2]=z[M[2]],A.array[D+3]=w[M[0]],A.array[D+4]=w[M[1]],A.array[D+5]=w[M[2]],A.array[D+6]=m[M[0]],A.array[D+7]=m[M[1]],A.array[D+8]=
-m[M[2]],D+=9;else if("faces"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=w=z=R=A.value[V[c]],A.array[D]=z[M[0]],A.array[D+1]=z[M[1]],A.array[D+2]=z[M[2]],A.array[D+3]=w[M[0]],A.array[D+4]=w[M[1]],A.array[D+5]=w[M[2]],A.array[D+6]=m[M[0]],A.array[D+7]=m[M[1]],A.array[D+8]=m[M[2]],D+=9;else{if("faceVertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)R=A.value[V[c]],z=R[0],w=R[1],m=R[2],A.array[D]=z[M[0]],A.array[D+1]=z[M[1]],A.array[D+2]=z[M[2]],A.array[D+3]=w[M[0]],A.array[D+4]=w[M[1]],A.array[D+5]=w[M[2]],
-A.array[D+6]=m[M[0]],A.array[D+7]=m[M[1]],A.array[D+8]=m[M[2]],D+=9}else if(4===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=la[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=z.z,A.array[D+3]=z.w,A.array[D+4]=w.x,A.array[D+5]=w.y,A.array[D+6]=w.z,A.array[D+7]=w.w,A.array[D+8]=m.x,A.array[D+9]=m.y,A.array[D+10]=m.z,A.array[D+11]=m.w,D+=12;else if("faces"===A.boundTo)for(c=0,p=V.length;c<p;c++)m=w=z=R=A.value[V[c]],
-A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=z.z,A.array[D+3]=z.w,A.array[D+4]=w.x,A.array[D+5]=w.y,A.array[D+6]=w.z,A.array[D+7]=w.w,A.array[D+8]=m.x,A.array[D+9]=m.y,A.array[D+10]=m.z,A.array[D+11]=m.w,D+=12;else if("faceVertices"===A.boundTo)for(c=0,p=V.length;c<p;c++)R=A.value[V[c]],z=R[0],w=R[1],m=R[2],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=z.z,A.array[D+3]=z.w,A.array[D+4]=w.x,A.array[D+5]=w.y,A.array[D+6]=w.z,A.array[D+7]=w.w,A.array[D+8]=m.x,A.array[D+9]=m.y,A.array[D+10]=m.z,A.array[D+
+e.__webglColorBuffer=a.createBuffer();e.__webglUVBuffer=a.createBuffer();e.__webglUV2Buffer=a.createBuffer();e.__webglSkinIndicesBuffer=a.createBuffer();e.__webglSkinWeightsBuffer=a.createBuffer();e.__webglFaceBuffer=a.createBuffer();e.__webglLineBuffer=a.createBuffer();var h=e.numMorphTargets;if(h){e.__webglMorphTargetsBuffers=[];for(var k=0,l=h;k<l;k++)e.__webglMorphTargetsBuffers.push(a.createBuffer())}var p=e.numMorphNormals;if(p)for(e.__webglMorphNormalsBuffers=[],k=0,l=p;k<l;k++)e.__webglMorphNormalsBuffers.push(a.createBuffer());
+b.memory.geometries++;var k=g.geometry,n=e.faces3,m=3*n.length,s=1*n.length,t=3*n.length,n=d(g,e);e.__vertexArray=new Float32Array(3*m);e.__normalArray=new Float32Array(3*m);e.__colorArray=new Float32Array(3*m);e.__uvArray=new Float32Array(2*m);1<k.faceVertexUvs.length&&(e.__uv2Array=new Float32Array(2*m));k.hasTangents&&(e.__tangentArray=new Float32Array(4*m));g.geometry.skinWeights.length&&g.geometry.skinIndices.length&&(e.__skinIndexArray=new Float32Array(4*m),e.__skinWeightArray=new Float32Array(4*
+m));k=null!==c.get("OES_element_index_uint")&&21845<s?Uint32Array:Uint16Array;e.__typeArray=k;e.__faceArray=new k(3*s);e.__lineArray=new k(2*t);if(h)for(e.__morphTargetsArrays=[],k=0,l=h;k<l;k++)e.__morphTargetsArrays.push(new Float32Array(3*m));if(p)for(e.__morphNormalsArrays=[],k=0,l=p;k<l;k++)e.__morphNormalsArrays.push(new Float32Array(3*m));e.__webglFaceCount=3*s;e.__webglLineCount=2*t;if(n.attributes){void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]);for(var r in n.attributes){var h=
+n.attributes[r],p={},v;for(v in h)p[v]=h[v];if(!p.__webglInitialized||p.createUniqueBuffers)p.__webglInitialized=!0,s=1,"v2"===p.type?s=2:"v3"===p.type?s=3:"v4"===p.type?s=4:"c"===p.type&&(s=3),p.size=s,p.array=new Float32Array(m*s),p.buffer=a.createBuffer(),p.buffer.belongsToAttribute=r,h.needsUpdate=!0,p.__original=h;e.__webglCustomAttributesList.push(p)}}e.__inittedArrays=!0};this.setPointCloudBuffers=function(b,c,d){var e,l,p=b.vertices,n=p.length,m=b.colors,s=m.length,t=b.__vertexArray,r=b.__colorArray,
+v=b.colorsNeedUpdate,u=b.__webglCustomAttributesList;if(b.verticesNeedUpdate){for(e=0;e<n;e++)l=p[e],d=3*e,t[d]=l.x,t[d+1]=l.y,t[d+2]=l.z;a.bindBuffer(a.ARRAY_BUFFER,b.__webglVertexBuffer);a.bufferData(a.ARRAY_BUFFER,t,c)}if(v){for(e=0;e<s;e++)l=m[e],d=3*e,r[d]=l.r,r[d+1]=l.g,r[d+2]=l.b;a.bindBuffer(a.ARRAY_BUFFER,b.__webglColorBuffer);a.bufferData(a.ARRAY_BUFFER,r,c)}if(u)for(b=0,m=u.length;b<m;b++){l=u[b];if(l.needsUpdate&&(void 0===l.boundTo||"vertices"===l.boundTo))if(r=l.value.length,d=0,1===
+l.size)for(s=0;s<r;s++)l.array[s]=l.value[s];else if(2===l.size)for(s=0;s<r;s++)e=l.value[s],l.array[d]=e.x,l.array[d+1]=e.y,d+=2;else if(3===l.size)if("c"===l.type)for(s=0;s<r;s++)e=l.value[s],l.array[d]=e.r,l.array[d+1]=e.g,l.array[d+2]=e.b,d+=3;else for(s=0;s<r;s++)e=l.value[s],l.array[d]=e.x,l.array[d+1]=e.y,l.array[d+2]=e.z,d+=3;else if(4===l.size)for(s=0;s<r;s++)e=l.value[s],l.array[d]=e.x,l.array[d+1]=e.y,l.array[d+2]=e.z,l.array[d+3]=e.w,d+=4;a.bindBuffer(a.ARRAY_BUFFER,l.buffer);a.bufferData(a.ARRAY_BUFFER,
+l.array,c);l.needsUpdate=!1}};this.setLineBuffers=function(b,c){var d,e,l,p=b.vertices,n=b.colors,m=b.lineDistances,s=p.length,t=n.length,r=m.length,v=b.__vertexArray,u=b.__colorArray,x=b.__lineDistanceArray,z=b.colorsNeedUpdate,w=b.lineDistancesNeedUpdate,F=b.__webglCustomAttributesList;if(b.verticesNeedUpdate){for(d=0;d<s;d++)l=p[d],e=3*d,v[e]=l.x,v[e+1]=l.y,v[e+2]=l.z;a.bindBuffer(a.ARRAY_BUFFER,b.__webglVertexBuffer);a.bufferData(a.ARRAY_BUFFER,v,c)}if(z){for(d=0;d<t;d++)l=n[d],e=3*d,u[e]=l.r,
+u[e+1]=l.g,u[e+2]=l.b;a.bindBuffer(a.ARRAY_BUFFER,b.__webglColorBuffer);a.bufferData(a.ARRAY_BUFFER,u,c)}if(w){for(e=0;e<r;e++)x[e]=m[e];a.bindBuffer(a.ARRAY_BUFFER,b.__webglLineDistanceBuffer);a.bufferData(a.ARRAY_BUFFER,x,c)}if(F)for(m=0,r=F.length;m<r;m++)if(u=F[m],u.needsUpdate&&(void 0===u.boundTo||"vertices"===u.boundTo)){e=0;n=u.value.length;if(1===u.size)for(x=0;x<n;x++)u.array[x]=u.value[x];else if(2===u.size)for(x=0;x<n;x++)t=u.value[x],u.array[e]=t.x,u.array[e+1]=t.y,e+=2;else if(3===u.size)if("c"===
+u.type)for(x=0;x<n;x++)t=u.value[x],u.array[e]=t.r,u.array[e+1]=t.g,u.array[e+2]=t.b,e+=3;else for(x=0;x<n;x++)t=u.value[x],u.array[e]=t.x,u.array[e+1]=t.y,u.array[e+2]=t.z,e+=3;else if(4===u.size)for(x=0;x<n;x++)t=u.value[x],u.array[e]=t.x,u.array[e+1]=t.y,u.array[e+2]=t.z,u.array[e+3]=t.w,e+=4;a.bindBuffer(a.ARRAY_BUFFER,u.buffer);a.bufferData(a.ARRAY_BUFFER,u.array,c);u.needsUpdate=!1}};this.setMeshBuffers=function(b,c,d,e,l){if(b.__inittedArrays){var p=!1===l instanceof THREE.MeshPhongMaterial&&
+l.shading===THREE.FlatShading,n,m,s,t,r,v,u,x,z,w,F,G,y,I,B,C,E,L,N,H,O,M,A=x=N=C=0,J=0,R=B=E=0,K=r=F=0,D=0,K=b.__vertexArray;L=b.__uvArray;var D=b.__uv2Array,X=b.__normalArray;s=b.__tangentArray;u=b.__colorArray;G=b.__skinIndexArray;y=b.__skinWeightArray;I=b.__morphTargetsArrays;var ia=b.__morphNormalsArrays,Q=b.__webglCustomAttributesList,P=b.__faceArray,aa=b.__lineArray,ca=c.geometry,qa=ca.elementsNeedUpdate,Da=ca.uvsNeedUpdate;t=ca.normalsNeedUpdate;var xa=ca.tangentsNeedUpdate;v=ca.colorsNeedUpdate;
+H=ca.morphTargetsNeedUpdate;M=ca.vertices;var V=b.faces3,pa=ca.faces,ya=ca.faceVertexUvs[0],va=ca.faceVertexUvs[1],wa=ca.skinIndices,la=ca.skinWeights,za=ca.morphTargets,Aa=ca.morphNormals;if(ca.verticesNeedUpdate){c=0;for(n=V.length;c<n;c++)m=pa[V[c]],z=M[m.a],w=M[m.b],m=M[m.c],K[N]=z.x,K[N+1]=z.y,K[N+2]=z.z,K[N+3]=w.x,K[N+4]=w.y,K[N+5]=w.z,K[N+6]=m.x,K[N+7]=m.y,K[N+8]=m.z,N+=9;a.bindBuffer(a.ARRAY_BUFFER,b.__webglVertexBuffer);a.bufferData(a.ARRAY_BUFFER,K,d)}if(H)for(N=0,H=za.length;N<H;N++){c=
+K=0;for(n=V.length;c<n;c++)M=V[c],m=pa[M],z=za[N].vertices[m.a],w=za[N].vertices[m.b],m=za[N].vertices[m.c],O=I[N],O[K]=z.x,O[K+1]=z.y,O[K+2]=z.z,O[K+3]=w.x,O[K+4]=w.y,O[K+5]=w.z,O[K+6]=m.x,O[K+7]=m.y,O[K+8]=m.z,l.morphNormals&&(p?w=z=m=Aa[N].faceNormals[M]:(w=Aa[N].vertexNormals[M],m=w.a,z=w.b,w=w.c),M=ia[N],M[K]=m.x,M[K+1]=m.y,M[K+2]=m.z,M[K+3]=z.x,M[K+4]=z.y,M[K+5]=z.z,M[K+6]=w.x,M[K+7]=w.y,M[K+8]=w.z),K+=9;a.bindBuffer(a.ARRAY_BUFFER,b.__webglMorphTargetsBuffers[N]);a.bufferData(a.ARRAY_BUFFER,
+I[N],d);l.morphNormals&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglMorphNormalsBuffers[N]),a.bufferData(a.ARRAY_BUFFER,ia[N],d))}if(la.length){c=0;for(n=V.length;c<n;c++)m=pa[V[c]],z=la[m.a],w=la[m.b],I=la[m.c],y[r]=z.x,y[r+1]=z.y,y[r+2]=z.z,y[r+3]=z.w,y[r+4]=w.x,y[r+5]=w.y,y[r+6]=w.z,y[r+7]=w.w,y[r+8]=I.x,y[r+9]=I.y,y[r+10]=I.z,y[r+11]=I.w,z=wa[m.a],w=wa[m.b],m=wa[m.c],G[r]=z.x,G[r+1]=z.y,G[r+2]=z.z,G[r+3]=z.w,G[r+4]=w.x,G[r+5]=w.y,G[r+6]=w.z,G[r+7]=w.w,G[r+8]=m.x,G[r+9]=m.y,G[r+10]=m.z,G[r+11]=m.w,r+=
+12;0<r&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglSkinIndicesBuffer),a.bufferData(a.ARRAY_BUFFER,G,d),a.bindBuffer(a.ARRAY_BUFFER,b.__webglSkinWeightsBuffer),a.bufferData(a.ARRAY_BUFFER,y,d))}if(v){c=0;for(n=V.length;c<n;c++)m=pa[V[c]],r=m.vertexColors,v=m.color,3===r.length&&l.vertexColors===THREE.VertexColors?(G=r[0],y=r[1],r=r[2]):r=y=G=v,u[F]=G.r,u[F+1]=G.g,u[F+2]=G.b,u[F+3]=y.r,u[F+4]=y.g,u[F+5]=y.b,u[F+6]=r.r,u[F+7]=r.g,u[F+8]=r.b,F+=9;0<F&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglColorBuffer),a.bufferData(a.ARRAY_BUFFER,
+u,d))}if(xa&&ca.hasTangents){c=0;for(n=V.length;c<n;c++)m=pa[V[c]],u=m.vertexTangents,l=u[0],F=u[1],u=u[2],s[B]=l.x,s[B+1]=l.y,s[B+2]=l.z,s[B+3]=l.w,s[B+4]=F.x,s[B+5]=F.y,s[B+6]=F.z,s[B+7]=F.w,s[B+8]=u.x,s[B+9]=u.y,s[B+10]=u.z,s[B+11]=u.w,B+=12;a.bindBuffer(a.ARRAY_BUFFER,b.__webglTangentBuffer);a.bufferData(a.ARRAY_BUFFER,s,d)}if(t){c=0;for(n=V.length;c<n;c++)if(m=pa[V[c]],s=m.vertexNormals,t=m.normal,3===s.length&&!1===p)for(B=0;3>B;B++)t=s[B],X[E]=t.x,X[E+1]=t.y,X[E+2]=t.z,E+=3;else for(B=0;3>
+B;B++)X[E]=t.x,X[E+1]=t.y,X[E+2]=t.z,E+=3;a.bindBuffer(a.ARRAY_BUFFER,b.__webglNormalBuffer);a.bufferData(a.ARRAY_BUFFER,X,d)}if(Da&&ya){c=0;for(n=V.length;c<n;c++)if(p=V[c],p=ya[p],void 0!==p)for(B=0;3>B;B++)E=p[B],L[x]=E.x,L[x+1]=E.y,x+=2;0<x&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglUVBuffer),a.bufferData(a.ARRAY_BUFFER,L,d))}if(Da&&va){c=0;for(n=V.length;c<n;c++)if(p=V[c],x=va[p],void 0!==x)for(B=0;3>B;B++)L=x[B],D[A]=L.x,D[A+1]=L.y,A+=2;0<A&&(a.bindBuffer(a.ARRAY_BUFFER,b.__webglUV2Buffer),a.bufferData(a.ARRAY_BUFFER,
+D,d))}if(qa){c=0;for(n=V.length;c<n;c++)P[J]=C,P[J+1]=C+1,P[J+2]=C+2,J+=3,aa[R]=C,aa[R+1]=C+1,aa[R+2]=C,aa[R+3]=C+2,aa[R+4]=C+1,aa[R+5]=C+2,R+=6,C+=3;a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,b.__webglFaceBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER,P,d);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,b.__webglLineBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER,aa,d)}if(Q)for(B=0,C=Q.length;B<C;B++)if(A=Q[B],A.__original.needsUpdate){D=0;if(1===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,n=V.length;c<n;c++)m=
+pa[V[c]],A.array[D]=A.value[m.a],A.array[D+1]=A.value[m.b],A.array[D+2]=A.value[m.c],D+=3;else{if("faces"===A.boundTo)for(c=0,n=V.length;c<n;c++)R=A.value[V[c]],A.array[D]=R,A.array[D+1]=R,A.array[D+2]=R,D+=3}else if(2===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,n=V.length;c<n;c++)m=pa[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=w.x,A.array[D+3]=w.y,A.array[D+4]=m.x,A.array[D+5]=m.y,D+=6;else{if("faces"===A.boundTo)for(c=0,n=V.length;c<
+n;c++)m=w=z=R=A.value[V[c]],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=w.x,A.array[D+3]=w.y,A.array[D+4]=m.x,A.array[D+5]=m.y,D+=6}else if(3===A.size)if(J="c"===A.type?["r","g","b"]:["x","y","z"],void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,n=V.length;c<n;c++)m=pa[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z[J[0]],A.array[D+1]=z[J[1]],A.array[D+2]=z[J[2]],A.array[D+3]=w[J[0]],A.array[D+4]=w[J[1]],A.array[D+5]=w[J[2]],A.array[D+6]=m[J[0]],A.array[D+7]=m[J[1]],A.array[D+8]=
+m[J[2]],D+=9;else if("faces"===A.boundTo)for(c=0,n=V.length;c<n;c++)m=w=z=R=A.value[V[c]],A.array[D]=z[J[0]],A.array[D+1]=z[J[1]],A.array[D+2]=z[J[2]],A.array[D+3]=w[J[0]],A.array[D+4]=w[J[1]],A.array[D+5]=w[J[2]],A.array[D+6]=m[J[0]],A.array[D+7]=m[J[1]],A.array[D+8]=m[J[2]],D+=9;else{if("faceVertices"===A.boundTo)for(c=0,n=V.length;c<n;c++)R=A.value[V[c]],z=R[0],w=R[1],m=R[2],A.array[D]=z[J[0]],A.array[D+1]=z[J[1]],A.array[D+2]=z[J[2]],A.array[D+3]=w[J[0]],A.array[D+4]=w[J[1]],A.array[D+5]=w[J[2]],
+A.array[D+6]=m[J[0]],A.array[D+7]=m[J[1]],A.array[D+8]=m[J[2]],D+=9}else if(4===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(c=0,n=V.length;c<n;c++)m=pa[V[c]],z=A.value[m.a],w=A.value[m.b],m=A.value[m.c],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=z.z,A.array[D+3]=z.w,A.array[D+4]=w.x,A.array[D+5]=w.y,A.array[D+6]=w.z,A.array[D+7]=w.w,A.array[D+8]=m.x,A.array[D+9]=m.y,A.array[D+10]=m.z,A.array[D+11]=m.w,D+=12;else if("faces"===A.boundTo)for(c=0,n=V.length;c<n;c++)m=w=z=R=A.value[V[c]],
+A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=z.z,A.array[D+3]=z.w,A.array[D+4]=w.x,A.array[D+5]=w.y,A.array[D+6]=w.z,A.array[D+7]=w.w,A.array[D+8]=m.x,A.array[D+9]=m.y,A.array[D+10]=m.z,A.array[D+11]=m.w,D+=12;else if("faceVertices"===A.boundTo)for(c=0,n=V.length;c<n;c++)R=A.value[V[c]],z=R[0],w=R[1],m=R[2],A.array[D]=z.x,A.array[D+1]=z.y,A.array[D+2]=z.z,A.array[D+3]=z.w,A.array[D+4]=w.x,A.array[D+5]=w.y,A.array[D+6]=w.z,A.array[D+7]=w.w,A.array[D+8]=m.x,A.array[D+9]=m.y,A.array[D+10]=m.z,A.array[D+
 11]=m.w,D+=12;a.bindBuffer(a.ARRAY_BUFFER,A.buffer);a.bufferData(a.ARRAY_BUFFER,A.array,d)}e&&(delete b.__inittedArrays,delete b.__colorArray,delete b.__normalArray,delete b.__tangentArray,delete b.__uvArray,delete b.__uv2Array,delete b.__faceArray,delete b.__vertexArray,delete b.__lineArray,delete b.__skinIndexArray,delete b.__skinWeightArray)}};this.delete=function(c){for(var d="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),
 e=0,k=d.length;e<k;e++){var l=d[e];void 0!==c[l]&&(a.deleteBuffer(c[l]),delete c[l])}if(void 0!==c.__webglCustomAttributesList){for(l in c.__webglCustomAttributesList)a.deleteBuffer(c.__webglCustomAttributesList[l].buffer);delete c.__webglCustomAttributesList}b.memory.geometries--}};
 THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
 break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&THREE.warn("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}};
-THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,l=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,p=d.index0AttributeName;void 0===p&&!0===e.morphTargets&&(p="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var r="ENVMAP_TYPE_CUBE",t="ENVMAP_MODE_REFLECTION",s="ENVMAP_BLENDING_MULTIPLY";
-if(e.envMap){switch(d.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:r="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:r="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:r="ENVMAP_TYPE_SPHERE"}switch(d.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_MODE_REFRACTION"}switch(d.combine){case THREE.MultiplyOperation:s="ENVMAP_BLENDING_MULTIPLY";
-break;case THREE.MixOperation:s="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:s="ENVMAP_BLENDING_ADD"}}var u=0<b.gammaFactor?b.gammaFactor:1,v,x;v=[];for(var z in g)x=g[z],!1!==x&&(x="#define "+z+" "+x,v.push(x));v=v.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",v,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":
-"","#define GAMMA_FACTOR "+u,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+t:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?
+THREE.WebGLObjects=function(a,b,c,d){function e(a,b){var d=a.material,e=!1;if(void 0===t[b.id]||!0===b.groupsNeedUpdate){delete n[a.id];for(var e=b.id,d=d instanceof THREE.MeshFaceMaterial,g=c.get("OES_element_index_uint")?4294967296:65535,h,m={},k=b.morphTargets.length,l=b.morphNormals.length,s,C={},E=[],L=0,N=b.faces.length;L<N;L++){h=b.faces[L];var H=d?h.materialIndex:0;H in m||(m[H]={hash:H,counter:0});h=m[H].hash+"_"+m[H].counter;h in C||(s={id:r++,faces3:[],materialIndex:H,vertices:0,numMorphTargets:k,
+numMorphNormals:l},C[h]=s,E.push(s));C[h].vertices+3>g&&(m[H].counter+=1,h=m[H].hash+"_"+m[H].counter,h in C||(s={id:r++,faces3:[],materialIndex:H,vertices:0,numMorphTargets:k,numMorphNormals:l},C[h]=s,E.push(s)));C[h].faces3.push(L);C[h].vertices+=3}t[e]=E;b.groupsNeedUpdate=!1}d=t[b.id];g=0;for(m=d.length;g<m;g++)k=d[g],void 0===k.__webglVertexBuffer?(p.initMeshBuffers(k,a),b.verticesNeedUpdate=!0,b.morphTargetsNeedUpdate=!0,b.elementsNeedUpdate=!0,b.uvsNeedUpdate=!0,b.normalsNeedUpdate=!0,b.tangentsNeedUpdate=
+!0,e=b.colorsNeedUpdate=!0):e=!1,(e||void 0===a.__webglActive)&&f(n,k,a);a.__webglActive=!0}function f(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function g(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function h(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function k(a){a.target.traverse(function(a){a.removeEventListener("remove",k);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete n[a.id];
+else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=m,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})}function l(c){c=c.target;c.removeEventListener("dispose",l);delete s[c.id];if(c instanceof THREE.BufferGeometry){for(var d in c.attributes){var e=c.attributes[d];void 0!==e.buffer&&(a.deleteBuffer(e.buffer),delete e.buffer)}b.memory.geometries--}else if(d=t[c.id],void 0!==
+d){for(var e=0,f=d.length;e<f;e++){var g=d[e];if(void 0!==g.numMorphTargets){for(var h=0,m=g.numMorphTargets;h<m;h++)a.deleteBuffer(g.__webglMorphTargetsBuffers[h]);delete g.__webglMorphTargetsBuffers}if(void 0!==g.numMorphNormals){h=0;for(m=g.numMorphNormals;h<m;h++)a.deleteBuffer(g.__webglMorphNormalsBuffers[h]);delete g.__webglMorphNormalsBuffers}p.delete(g)}delete t[c.id]}else p.delete(c)}var p=new THREE.WebGLBuffers(a,b,c,d),n={},m=[],s={},t={},r=0;this.objects=n;this.objectsImmediate=m;this.init=
+function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",k));var c=a.geometry;void 0!==c&&void 0===s[c.id]&&(s[c.id]=c,c.addEventListener("dispose",l),c instanceof THREE.BufferGeometry?b.memory.geometries++:a instanceof THREE.Mesh?e(a,c):a instanceof THREE.Line?p.initLineBuffers(c,a):a instanceof THREE.PointCloud&&p.initPointCloudBuffers(c,a));if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof
+THREE.Mesh)if(c instanceof THREE.BufferGeometry)f(n,c,a);else{if(c instanceof THREE.Geometry)for(var c=t[c.id],d=0,g=c.length;d<g;d++)f(n,c[d],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?f(n,c,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&m.push({id:null,object:a,opaque:null,transparent:null,z:0})};this.update=function(b){var c=b.geometry;if(c instanceof THREE.BufferGeometry){b=c.attributes;for(var c=c.attributesKeys,f=0,m=c.length;f<m;f++){var k=c[f],
+l=b[k],k="index"===k?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,l=l instanceof THREE.InterleavedBufferAttribute?l.data:l;if(void 0===l.buffer){l.buffer=a.createBuffer();a.bindBuffer(k,l.buffer);var n=a.STATIC_DRAW;if(l instanceof THREE.DynamicBufferAttribute||l instanceof THREE.InstancedBufferAttribute&&!0===l.dynamic||l instanceof THREE.InterleavedBuffer&&!0===l.dynamic)n=a.DYNAMIC_DRAW;a.bufferData(k,l.array,n);l.needsUpdate=!1}else!0===l.needsUpdate&&(a.bindBuffer(k,l.buffer),void 0===l.updateRange||
+-1===l.updateRange.count?a.bufferSubData(k,0,l.array):0===l.updateRange.count?THREE.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(a.bufferSubData(k,l.updateRange.offset*l.array.BYTES_PER_ELEMENT,l.array.subarray(l.updateRange.offset,l.updateRange.offset+l.updateRange.count)),l.updateRange.count=0),l.needsUpdate=!1)}}else if(b instanceof THREE.Mesh){!0===
+c.groupsNeedUpdate&&e(b,c);m=t[c.id];f=0;for(k=m.length;f<k;f++){var l=m[f],n=d(b,l),s=n.attributes&&g(n);(c.verticesNeedUpdate||c.morphTargetsNeedUpdate||c.elementsNeedUpdate||c.uvsNeedUpdate||c.normalsNeedUpdate||c.colorsNeedUpdate||c.tangentsNeedUpdate||s)&&p.setMeshBuffers(l,b,a.DYNAMIC_DRAW,!c.dynamic,n)}c.verticesNeedUpdate=!1;c.morphTargetsNeedUpdate=!1;c.elementsNeedUpdate=!1;c.uvsNeedUpdate=!1;c.normalsNeedUpdate=!1;c.colorsNeedUpdate=!1;c.tangentsNeedUpdate=!1;n.attributes&&h(n)}else b instanceof
+THREE.Line?(n=d(b,c),s=n.attributes&&g(n),(c.verticesNeedUpdate||c.colorsNeedUpdate||c.lineDistancesNeedUpdate||s)&&p.setLineBuffers(c,a.DYNAMIC_DRAW),c.verticesNeedUpdate=!1,c.colorsNeedUpdate=!1,c.lineDistancesNeedUpdate=!1,n.attributes&&h(n)):b instanceof THREE.PointCloud&&(n=d(b,c),s=n.attributes&&g(n),(c.verticesNeedUpdate||c.colorsNeedUpdate||s)&&p.setPointCloudBuffers(c,a.DYNAMIC_DRAW,b),c.verticesNeedUpdate=!1,c.colorsNeedUpdate=!1,n.attributes&&h(n))}};
+THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,l=d.__webglShader.vertexShader,p=d.__webglShader.fragmentShader,n=d.index0AttributeName;void 0===n&&!0===e.morphTargets&&(n="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var s="ENVMAP_TYPE_CUBE",t="ENVMAP_MODE_REFLECTION",r="ENVMAP_BLENDING_MULTIPLY";
+if(e.envMap){switch(d.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:s="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:s="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:s="ENVMAP_TYPE_SPHERE"}switch(d.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_MODE_REFRACTION"}switch(d.combine){case THREE.MultiplyOperation:r="ENVMAP_BLENDING_MULTIPLY";
+break;case THREE.MixOperation:r="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:r="ENVMAP_BLENDING_ADD"}}var v=0<b.gammaFactor?b.gammaFactor:1,u,x;u=[];for(var z in g)x=g[z],!1!==x&&(x="#define "+z+" "+x,u.push(x));u=u.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",u,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":
+"","#define GAMMA_FACTOR "+v,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+t:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?
 "#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+
 m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"),
-b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",v,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+
-u,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+r:"",e.envMap?"#define "+t:"",e.envMap?"#define "+s:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.flatShading?"#define FLAT_SHADED":
-"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));l=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+l);n=new THREE.WebGLShader(f,
-f.FRAGMENT_SHADER,b+n);f.attachShader(g,l);f.attachShader(g,n);void 0!==p&&f.bindAttribLocation(g,0,p);f.linkProgram(g);p=f.getProgramInfoLog(g);b=f.getShaderInfoLog(l);m=f.getShaderInfoLog(n);!1===f.getProgramParameter(g,f.LINK_STATUS)&&THREE.error("THREE.WebGLProgram: shader error: ",f.getError(),"gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS),"gl.getProgramInfoLog",p,b,m);""!==p&&THREE.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",p);f.deleteShader(l);f.deleteShader(n);p="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");
-e.useVertexTexture?(p.push("boneTexture"),p.push("boneTextureWidth"),p.push("boneTextureHeight")):p.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&p.push("logDepthBufFC");for(var w in h)p.push(w);h=p;w={};p=0;for(b=h.length;p<b;p++)m=h[p],w[m]=f.getUniformLocation(g,m);this.uniforms=w;p="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)p.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)p.push("morphNormal"+h);for(var I in k)p.push(I);
-e=p;k={};I=0;for(h=e.length;I<h;I++)w=e[I],k[w]=f.getAttribLocation(g,w);this.attributes=k;this.attributesKeys=Object.keys(this.attributes);this.id=a++;this.code=c;this.usedTimes=1;this.program=g;this.vertexShader=l;this.fragmentShader=n;return this}}();
+b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",u,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+
+v,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+s:"",e.envMap?"#define "+t:"",e.envMap?"#define "+r:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.flatShading?"#define FLAT_SHADED":
+"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));l=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+l);p=new THREE.WebGLShader(f,
+f.FRAGMENT_SHADER,b+p);f.attachShader(g,l);f.attachShader(g,p);void 0!==n&&f.bindAttribLocation(g,0,n);f.linkProgram(g);n=f.getProgramInfoLog(g);b=f.getShaderInfoLog(l);m=f.getShaderInfoLog(p);!1===f.getProgramParameter(g,f.LINK_STATUS)&&THREE.error("THREE.WebGLProgram: shader error: ",f.getError(),"gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS),"gl.getProgramInfoLog",n,b,m);""!==n&&THREE.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",n);f.deleteShader(l);f.deleteShader(p);n="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");
+e.useVertexTexture?(n.push("boneTexture"),n.push("boneTextureWidth"),n.push("boneTextureHeight")):n.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&n.push("logDepthBufFC");for(var w in h)n.push(w);h=n;w={};n=0;for(b=h.length;n<b;n++)m=h[n],w[m]=f.getUniformLocation(g,m);this.uniforms=w;n="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)n.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)n.push("morphNormal"+h);for(var F in k)n.push(F);
+e=n;k={};F=0;for(h=e.length;F<h;F++)w=e[F],k[w]=f.getAttribLocation(g,w);this.attributes=k;this.attributesKeys=Object.keys(this.attributes);this.id=a++;this.code=c;this.usedTimes=1;this.program=g;this.vertexShader=l;this.fragmentShader=p;return this}}();
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){var e=b.createShader(c);b.shaderSource(e,d);b.compileShader(e);!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&THREE.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(e)&&THREE.warn("THREE.WebGLShader: gl.getShaderInfoLog()",c===b.VERTEX_SHADER?"vertex":"fragment",b.getShaderInfoLog(e),a(d));return e}}();
-THREE.WebGLShadowMap=function(a,b,c,d){function e(a,b,d){if(b.visible){var f=c[b.id];if(f&&b.castShadow&&(!1===b.frustumCulled||!0===g.intersectsObject(b)))for(var h=0,k=f.length;h<k;h++){var m=f[h];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld);p.push(m)}h=0;for(k=b.children.length;h<k;h++)e(a,b.children[h],d)}}var f=a.context,g=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=[],m=THREE.ShaderLib.depthRGBA,r=THREE.UniformsUtils.clone(m.uniforms),
-t=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}),s=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0}),u=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,skinning:!0}),v=new THREE.ShaderMaterial({uniforms:r,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0,skinning:!0});t._shadowPass=!0;s._shadowPass=!0;u._shadowPass=
-!0;v._shadowPass=!0;var x=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=this.debug=!1;this.render=function(c,m){if(!1!==x.enabled){var r,H,y,F,B,E,C,N,K=[];F=0;f.clearColor(1,1,1,1);f.disable(f.BLEND);f.enable(f.CULL_FACE);f.frontFace(f.CCW);x.cullFace===THREE.CullFaceFront?f.cullFace(f.FRONT):f.cullFace(f.BACK);a.state.setDepthTest(!0);r=0;for(H=b.length;r<H;r++)if(y=b[r],y.castShadow)if(y instanceof THREE.DirectionalLight&&y.shadowCascade)for(B=
-0;B<y.shadowCascadeCount;B++){var L;if(y.shadowCascadeArray[B])L=y.shadowCascadeArray[B];else{C=y;var J=B;L=new THREE.DirectionalLight;L.isVirtual=!0;L.onlyShadow=!0;L.castShadow=!0;L.shadowCameraNear=C.shadowCameraNear;L.shadowCameraFar=C.shadowCameraFar;L.shadowCameraLeft=C.shadowCameraLeft;L.shadowCameraRight=C.shadowCameraRight;L.shadowCameraBottom=C.shadowCameraBottom;L.shadowCameraTop=C.shadowCameraTop;L.shadowCameraVisible=C.shadowCameraVisible;L.shadowDarkness=C.shadowDarkness;L.shadowBias=
-C.shadowCascadeBias[J];L.shadowMapWidth=C.shadowCascadeWidth[J];L.shadowMapHeight=C.shadowCascadeHeight[J];L.pointsWorld=[];L.pointsFrustum=[];N=L.pointsWorld;E=L.pointsFrustum;for(var G=0;8>G;G++)N[G]=new THREE.Vector3,E[G]=new THREE.Vector3;N=C.shadowCascadeNearZ[J];C=C.shadowCascadeFarZ[J];E[0].set(-1,-1,N);E[1].set(1,-1,N);E[2].set(-1,1,N);E[3].set(1,1,N);E[4].set(-1,-1,C);E[5].set(1,-1,C);E[6].set(-1,1,C);E[7].set(1,1,C);L.originalCamera=m;E=new THREE.Gyroscope;E.position.copy(y.shadowCascadeOffset);
-E.add(L);E.add(L.target);m.add(E);y.shadowCascadeArray[B]=L}J=y;N=B;C=J.shadowCascadeArray[N];C.position.copy(J.position);C.target.position.copy(J.target.position);C.lookAt(C.target);C.shadowCameraVisible=J.shadowCameraVisible;C.shadowDarkness=J.shadowDarkness;C.shadowBias=J.shadowCascadeBias[N];E=J.shadowCascadeNearZ[N];J=J.shadowCascadeFarZ[N];C=C.pointsFrustum;C[0].z=E;C[1].z=E;C[2].z=E;C[3].z=E;C[4].z=J;C[5].z=J;C[6].z=J;C[7].z=J;K[F]=L;F++}else K[F]=y,F++;r=0;for(H=K.length;r<H;r++){y=K[r];y.shadowMap||
-(B=THREE.LinearFilter,x.type===THREE.PCFSoftShadowMap&&(B=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:B,magFilter:B,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4);if(!y.shadowCamera){if(y instanceof THREE.SpotLight)y.shadowCamera=new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,y.shadowCameraNear,y.shadowCameraFar);else if(y instanceof
-THREE.DirectionalLight)y.shadowCamera=new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar);else{THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",y);continue}c.add(y.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),c.add(y.cameraHelper));if(y.isVirtual&&L.originalCamera==m){B=m;F=y.shadowCamera;
-E=y.pointsFrustum;C=y.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(J=0;8>J;J++)N=C[J],N.copy(E[J]),N.unproject(B),N.applyMatrix4(F.matrixWorldInverse),N.x<k.x&&(k.x=N.x),N.x>l.x&&(l.x=N.x),N.y<k.y&&(k.y=N.y),N.y>l.y&&(l.y=N.y),N.z<k.z&&(k.z=N.z),N.z>l.z&&(l.z=N.z);F.left=k.x;F.right=l.x;F.top=l.y;F.bottom=k.y;F.updateProjectionMatrix()}F=y.shadowMap;E=y.shadowMatrix;B=y.shadowCamera;B.position.setFromMatrixPosition(y.matrixWorld);n.setFromMatrixPosition(y.target.matrixWorld);
-B.lookAt(n);B.updateMatrixWorld();B.matrixWorldInverse.getInverse(B.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();E.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);E.multiply(B.projectionMatrix);E.multiply(B.matrixWorldInverse);h.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse);g.setFromMatrix(h);a.setRenderTarget(F);a.clear();p.length=0;e(c,c,B);y=0;for(F=p.length;y<F;y++)C=p[y],E=C.object,C=C.buffer,J=E.material instanceof
-THREE.MeshFaceMaterial?E.material.materials[0]:E.material,N=void 0!==E.geometry.morphTargets&&0<E.geometry.morphTargets.length&&J.morphTargets,G=E instanceof THREE.SkinnedMesh&&J.skinning,N=E.customDepthMaterial?E.customDepthMaterial:G?N?v:u:N?s:t,a.setMaterialFaces(J),C instanceof THREE.BufferGeometry?a.renderBufferDirect(B,b,null,N,C,E):a.renderBuffer(B,b,null,N,C,E);y=0;for(F=d.length;y<F;y++)C=d[y],E=C.object,E.visible&&E.castShadow&&(E._modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,E.matrixWorld),
-a.renderImmediateObject(B,b,null,t,E))}r=a.getClearColor();H=a.getClearAlpha();f.clearColor(r.r,r.g,r.b,H);f.enable(f.BLEND);x.cullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState()}}};
-THREE.WebGLState=function(a,b){var c=new Uint8Array(16),d=new Uint8Array(16),e=null,f=null,g=null,h=null,k=null,l=null,n=null,p=null,m=null,r=null,t=null,s=null,u=null,v=null,x=null,z=null;this.initAttributes=function(){for(var a=0,b=c.length;a<b;a++)c[a]=0};this.enableAttribute=function(b){c[b]=1;0===d[b]&&(a.enableVertexAttribArray(b),d[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,e=d.length;b<e;b++)d[b]!==c[b]&&(a.disableVertexAttribArray(b),d[b]=0)};this.setBlending=function(c,d,
-m,p,r,s,t){c!==e&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?a.enable(a.BLEND):(a.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),
-a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),e=c);if(c===THREE.CustomBlending){r=r||d;s=s||m;t=t||p;if(d!==f||r!==k)a.blendEquationSeparate(b(d),b(r)),f=d,k=r;if(m!==g||p!==h||s!==l||t!==n)a.blendFuncSeparate(b(m),b(p),b(s),b(t)),g=m,h=p,l=s,n=t}else n=l=k=h=g=f=null};this.setDepthTest=function(b){p!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),p=b)};this.setDepthWrite=function(b){m!==b&&(a.depthMask(b),m=b)};this.setColorWrite=function(b){r!==b&&(a.colorMask(b,
-b,b,b),r=b)};this.setDoubleSided=function(b){t!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),t=b)};this.setFlipSided=function(b){s!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),s=b)};this.setLineWidth=function(b){b!==u&&(a.lineWidth(b),u=b)};this.setPolygonOffset=function(b,c,d){v!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),v=b);!b||x===c&&z===d||(a.polygonOffset(c,d),x=c,z=d)};this.reset=function(){for(var a=0;a<d.length;a++)d[a]=0;s=t=r=m=p=e=null}};
-THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,l,n,p,m=a.context,r,t,s,u,v,x;this.render=function(z,w,I,H){if(0!==b.length){z=new THREE.Vector3;var y=H/I,F=.5*I,B=.5*H,E=16/H,C=new THREE.Vector2(E*y,E),N=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1);if(void 0===s){var E=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),L=new Uint16Array([0,1,2,0,2,3]);r=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,r);m.bufferData(m.ARRAY_BUFFER,E,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
-t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,L,m.STATIC_DRAW);v=m.createTexture();x=m.createTexture();m.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);m.bindTexture(m.TEXTURE_2D,x);m.texImage2D(m.TEXTURE_2D,0,
-m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var E=(u=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
+THREE.WebGLShadowMap=function(a,b,c){function d(a,b,c){if(b.visible){var e=l[b.id];if(e&&b.castShadow&&(!1===b.frustumCulled||!0===f.intersectsObject(b)))for(var g=0,h=e.length;g<h;g++){var k=e[g];b._modelViewMatrix.multiplyMatrices(c.matrixWorldInverse,b.matrixWorld);m.push(k)}g=0;for(h=b.children.length;g<h;g++)d(a,b.children[g],c)}}var e=a.context,f=new THREE.Frustum,g=new THREE.Matrix4,h=new THREE.Vector3,k=new THREE.Vector3,l=c.objects,p=c.objectsImmediate,n=new THREE.Vector3,m=[];c=THREE.ShaderLib.depthRGBA;
+var s=THREE.UniformsUtils.clone(c.uniforms),t=new THREE.ShaderMaterial({uniforms:s,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}),r=new THREE.ShaderMaterial({uniforms:s,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,morphTargets:!0}),v=new THREE.ShaderMaterial({uniforms:s,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,skinning:!0}),u=new THREE.ShaderMaterial({uniforms:s,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,morphTargets:!0,skinning:!0});
+t._shadowPass=!0;r._shadowPass=!0;v._shadowPass=!0;u._shadowPass=!0;var x=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=this.debug=!1;this.render=function(c,l){if(!1!==x.enabled){var s,G,y,I,B,C,E,L,N=[];I=0;e.clearColor(1,1,1,1);e.disable(e.BLEND);e.enable(e.CULL_FACE);e.frontFace(e.CCW);x.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);a.state.setDepthTest(!0);s=0;for(G=b.length;s<G;s++)if(y=b[s],y.castShadow)if(y instanceof
+THREE.DirectionalLight&&y.shadowCascade)for(B=0;B<y.shadowCascadeCount;B++){var H;if(y.shadowCascadeArray[B])H=y.shadowCascadeArray[B];else{E=y;var O=B;H=new THREE.DirectionalLight;H.isVirtual=!0;H.onlyShadow=!0;H.castShadow=!0;H.shadowCameraNear=E.shadowCameraNear;H.shadowCameraFar=E.shadowCameraFar;H.shadowCameraLeft=E.shadowCameraLeft;H.shadowCameraRight=E.shadowCameraRight;H.shadowCameraBottom=E.shadowCameraBottom;H.shadowCameraTop=E.shadowCameraTop;H.shadowCameraVisible=E.shadowCameraVisible;
+H.shadowDarkness=E.shadowDarkness;H.shadowBias=E.shadowCascadeBias[O];H.shadowMapWidth=E.shadowCascadeWidth[O];H.shadowMapHeight=E.shadowCascadeHeight[O];H.pointsWorld=[];H.pointsFrustum=[];L=H.pointsWorld;C=H.pointsFrustum;for(var M=0;8>M;M++)L[M]=new THREE.Vector3,C[M]=new THREE.Vector3;L=E.shadowCascadeNearZ[O];E=E.shadowCascadeFarZ[O];C[0].set(-1,-1,L);C[1].set(1,-1,L);C[2].set(-1,1,L);C[3].set(1,1,L);C[4].set(-1,-1,E);C[5].set(1,-1,E);C[6].set(-1,1,E);C[7].set(1,1,E);H.originalCamera=l;C=new THREE.Gyroscope;
+C.position.copy(y.shadowCascadeOffset);C.add(H);C.add(H.target);l.add(C);y.shadowCascadeArray[B]=H}O=y;L=B;E=O.shadowCascadeArray[L];E.position.copy(O.position);E.target.position.copy(O.target.position);E.lookAt(E.target);E.shadowCameraVisible=O.shadowCameraVisible;E.shadowDarkness=O.shadowDarkness;E.shadowBias=O.shadowCascadeBias[L];C=O.shadowCascadeNearZ[L];O=O.shadowCascadeFarZ[L];E=E.pointsFrustum;E[0].z=C;E[1].z=C;E[2].z=C;E[3].z=C;E[4].z=O;E[5].z=O;E[6].z=O;E[7].z=O;N[I]=H;I++}else N[I]=y,I++;
+s=0;for(G=N.length;s<G;s++){y=N[s];y.shadowMap||(B=THREE.LinearFilter,x.type===THREE.PCFSoftShadowMap&&(B=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:B,magFilter:B,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4);if(!y.shadowCamera){if(y instanceof THREE.SpotLight)y.shadowCamera=new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,
+y.shadowCameraNear,y.shadowCameraFar);else if(y instanceof THREE.DirectionalLight)y.shadowCamera=new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar);else{THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",y);continue}c.add(y.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),c.add(y.cameraHelper));
+if(y.isVirtual&&H.originalCamera==l){B=l;I=y.shadowCamera;C=y.pointsFrustum;E=y.pointsWorld;h.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(O=0;8>O;O++)L=E[O],L.copy(C[O]),L.unproject(B),L.applyMatrix4(I.matrixWorldInverse),L.x<h.x&&(h.x=L.x),L.x>k.x&&(k.x=L.x),L.y<h.y&&(h.y=L.y),L.y>k.y&&(k.y=L.y),L.z<h.z&&(h.z=L.z),L.z>k.z&&(k.z=L.z);I.left=h.x;I.right=k.x;I.top=k.y;I.bottom=h.y;I.updateProjectionMatrix()}I=y.shadowMap;C=y.shadowMatrix;B=y.shadowCamera;B.position.setFromMatrixPosition(y.matrixWorld);
+n.setFromMatrixPosition(y.target.matrixWorld);B.lookAt(n);B.updateMatrixWorld();B.matrixWorldInverse.getInverse(B.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);C.multiply(B.projectionMatrix);C.multiply(B.matrixWorldInverse);g.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse);f.setFromMatrix(g);a.setRenderTarget(I);a.clear();m.length=0;d(c,c,B);y=0;for(I=m.length;y<I;y++)E=
+m[y],C=E.object,E=E.buffer,O=C.material instanceof THREE.MeshFaceMaterial?C.material.materials[0]:C.material,L=void 0!==C.geometry.morphTargets&&0<C.geometry.morphTargets.length&&O.morphTargets,M=C instanceof THREE.SkinnedMesh&&O.skinning,L=C.customDepthMaterial?C.customDepthMaterial:M?L?u:v:L?r:t,a.setMaterialFaces(O),E instanceof THREE.BufferGeometry?a.renderBufferDirect(B,b,null,L,E,C):a.renderBuffer(B,b,null,L,E,C);y=0;for(I=p.length;y<I;y++)E=p[y],C=E.object,C.visible&&C.castShadow&&(C._modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,
+C.matrixWorld),a.renderImmediateObject(B,b,null,t,C))}s=a.getClearColor();G=a.getClearAlpha();e.clearColor(s.r,s.g,s.b,G);e.enable(e.BLEND);x.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState()}}};
+THREE.WebGLState=function(a,b){var c=new Uint8Array(16),d=new Uint8Array(16),e=null,f=null,g=null,h=null,k=null,l=null,p=null,n=null,m=null,s=null,t=null,r=null,v=null,u=null,x=null,z=null;this.initAttributes=function(){for(var a=0,b=c.length;a<b;a++)c[a]=0};this.enableAttribute=function(b){c[b]=1;0===d[b]&&(a.enableVertexAttribArray(b),d[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,e=d.length;b<e;b++)d[b]!==c[b]&&(a.disableVertexAttribArray(b),d[b]=0)};this.setBlending=function(c,d,
+m,n,s,r,t){c!==e&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?a.enable(a.BLEND):(a.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),
+a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),e=c);if(c===THREE.CustomBlending){s=s||d;r=r||m;t=t||n;if(d!==f||s!==k)a.blendEquationSeparate(b(d),b(s)),f=d,k=s;if(m!==g||n!==h||r!==l||t!==p)a.blendFuncSeparate(b(m),b(n),b(r),b(t)),g=m,h=n,l=r,p=t}else p=l=k=h=g=f=null};this.setDepthTest=function(b){n!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),n=b)};this.setDepthWrite=function(b){m!==b&&(a.depthMask(b),m=b)};this.setColorWrite=function(b){s!==b&&(a.colorMask(b,
+b,b,b),s=b)};this.setDoubleSided=function(b){t!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),t=b)};this.setFlipSided=function(b){r!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),r=b)};this.setLineWidth=function(b){b!==v&&(a.lineWidth(b),v=b)};this.setPolygonOffset=function(b,c,d){u!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),u=b);!b||x===c&&z===d||(a.polygonOffset(c,d),x=c,z=d)};this.reset=function(){for(var a=0;a<d.length;a++)d[a]=0;r=t=s=m=n=e=null}};
+THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,l,p,n,m=a.context,s,t,r,v,u,x;this.render=function(z,w,F,G){if(0!==b.length){z=new THREE.Vector3;var y=G/F,I=.5*F,B=.5*G,C=16/G,E=new THREE.Vector2(C*y,C),L=new THREE.Vector3(1,1,0),N=new THREE.Vector2(1,1);if(void 0===r){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),H=new Uint16Array([0,1,2,0,2,3]);s=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,s);m.bufferData(m.ARRAY_BUFFER,C,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
+t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,H,m.STATIC_DRAW);u=m.createTexture();x=m.createTexture();m.bindTexture(m.TEXTURE_2D,u);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);m.bindTexture(m.TEXTURE_2D,x);m.texImage2D(m.TEXTURE_2D,0,
+m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var C=(v=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
-L=m.createProgram(),J=m.createShader(m.FRAGMENT_SHADER),G=m.createShader(m.VERTEX_SHADER),A="precision "+a.getPrecision()+" float;\n";m.shaderSource(J,A+E.fragmentShader);m.shaderSource(G,A+E.vertexShader);m.compileShader(J);m.compileShader(G);m.attachShader(L,J);m.attachShader(L,G);m.linkProgram(L);s=L;n=m.getAttribLocation(s,"position");p=m.getAttribLocation(s,"uv");c=m.getUniformLocation(s,"renderType");d=m.getUniformLocation(s,"map");e=m.getUniformLocation(s,"occlusionMap");f=m.getUniformLocation(s,
-"opacity");g=m.getUniformLocation(s,"color");h=m.getUniformLocation(s,"scale");k=m.getUniformLocation(s,"rotation");l=m.getUniformLocation(s,"screenPosition")}m.useProgram(s);m.enableVertexAttribArray(n);m.enableVertexAttribArray(p);m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,r);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);m.disable(m.CULL_FACE);m.depthMask(!1);L=0;for(J=b.length;L<J;L++)if(E=16/H,C.set(E*
-y,E),G=b[L],z.set(G.matrixWorld.elements[12],G.matrixWorld.elements[13],G.matrixWorld.elements[14]),z.applyMatrix4(w.matrixWorldInverse),z.applyProjection(w.projectionMatrix),N.copy(z),K.x=N.x*F+F,K.y=N.y*B+B,u||0<K.x&&K.x<I&&0<K.y&&K.y<H){m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,K.x-8,K.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,C.x,C.y);m.uniform3f(l,N.x,N.y,N.z);m.disable(m.BLEND);m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,
-0);m.activeTexture(m.TEXTURE0);m.bindTexture(m.TEXTURE_2D,x);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,K.x-8,K.y-8,16,16,0);m.uniform1i(c,1);m.disable(m.DEPTH_TEST);m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);G.positionScreen.copy(N);G.customUpdateCallback?G.customUpdateCallback(G):G.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var A=0,M=G.lensFlares.length;A<M;A++){var R=G.lensFlares[A];.001<R.opacity&&.001<R.scale&&(N.x=R.x,
-N.y=R.y,N.z=R.z,E=R.size*R.scale/H,C.x=E*y,C.y=E,m.uniform3f(l,N.x,N.y,N.z),m.uniform2f(h,C.x,C.y),m.uniform1f(k,R.rotation),m.uniform1f(f,R.opacity),m.uniform3f(g,R.color.r,R.color.g,R.color.b),a.state.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),a.setTexture(R.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,l,n,p,m,r,t,s,u,v,x;function z(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,I,H,y,F,B=new THREE.Vector3,E=new THREE.Quaternion,C=new THREE.Vector3;this.render=function(N,K){if(0!==b.length){if(void 0===y){var L=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),J=new Uint16Array([0,1,2,0,2,3]);I=w.createBuffer();H=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,I);w.bufferData(w.ARRAY_BUFFER,L,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
-H);w.bufferData(w.ELEMENT_ARRAY_BUFFER,J,w.STATIC_DRAW);var L=w.createProgram(),J=w.createShader(w.VERTEX_SHADER),G=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(J,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
-w.shaderSource(G,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
-w.compileShader(J);w.compileShader(G);w.attachShader(L,J);w.attachShader(L,G);w.linkProgram(L);y=L;v=w.getAttribLocation(y,"position");x=w.getAttribLocation(y,"uv");c=w.getUniformLocation(y,"uvOffset");d=w.getUniformLocation(y,"uvScale");e=w.getUniformLocation(y,"rotation");f=w.getUniformLocation(y,"scale");g=w.getUniformLocation(y,"color");h=w.getUniformLocation(y,"map");k=w.getUniformLocation(y,"opacity");l=w.getUniformLocation(y,"modelViewMatrix");n=w.getUniformLocation(y,"projectionMatrix");p=
-w.getUniformLocation(y,"fogType");m=w.getUniformLocation(y,"fogDensity");r=w.getUniformLocation(y,"fogNear");t=w.getUniformLocation(y,"fogFar");s=w.getUniformLocation(y,"fogColor");u=w.getUniformLocation(y,"alphaTest");L=document.createElement("canvas");L.width=8;L.height=8;J=L.getContext("2d");J.fillStyle="white";J.fillRect(0,0,8,8);F=new THREE.Texture(L);F.needsUpdate=!0}w.useProgram(y);w.enableVertexAttribArray(v);w.enableVertexAttribArray(x);w.disable(w.CULL_FACE);w.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,
-I);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,H);w.uniformMatrix4fv(n,!1,K.projectionMatrix.elements);w.activeTexture(w.TEXTURE0);w.uniform1i(h,0);J=L=0;(G=N.fog)?(w.uniform3f(s,G.color.r,G.color.g,G.color.b),G instanceof THREE.Fog?(w.uniform1f(r,G.near),w.uniform1f(t,G.far),w.uniform1i(p,1),J=L=1):G instanceof THREE.FogExp2&&(w.uniform1f(m,G.density),w.uniform1i(p,2),J=L=2)):(w.uniform1i(p,0),J=L=0);for(var G=0,A=b.length;G<
-A;G++){var M=b[G];M._modelViewMatrix.multiplyMatrices(K.matrixWorldInverse,M.matrixWorld);M.z=-M._modelViewMatrix.elements[14]}b.sort(z);for(var R=[],G=0,A=b.length;G<A;G++){var M=b[G],O=M.material;w.uniform1f(u,O.alphaTest);w.uniformMatrix4fv(l,!1,M._modelViewMatrix.elements);M.matrixWorld.decompose(B,E,C);R[0]=C.x;R[1]=C.y;M=0;N.fog&&O.fog&&(M=J);L!==M&&(w.uniform1i(p,M),L=M);null!==O.map?(w.uniform2f(c,O.map.offset.x,O.map.offset.y),w.uniform2f(d,O.map.repeat.x,O.map.repeat.y)):(w.uniform2f(c,
-0,0),w.uniform2f(d,1,1));w.uniform1f(k,O.opacity);w.uniform3f(g,O.color.r,O.color.g,O.color.b);w.uniform1f(e,O.rotation);w.uniform2fv(f,R);a.state.setBlending(O.blending,O.blendEquation,O.blendSrc,O.blendDst);a.state.setDepthTest(O.depthTest);a.state.setDepthWrite(O.depthWrite);O.map&&O.map.image&&O.map.image.width?a.setTexture(O.map,0):a.setTexture(F,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}w.enable(w.CULL_FACE);a.resetGLState()}}};
+H=m.createProgram(),O=m.createShader(m.FRAGMENT_SHADER),M=m.createShader(m.VERTEX_SHADER),A="precision "+a.getPrecision()+" float;\n";m.shaderSource(O,A+C.fragmentShader);m.shaderSource(M,A+C.vertexShader);m.compileShader(O);m.compileShader(M);m.attachShader(H,O);m.attachShader(H,M);m.linkProgram(H);r=H;p=m.getAttribLocation(r,"position");n=m.getAttribLocation(r,"uv");c=m.getUniformLocation(r,"renderType");d=m.getUniformLocation(r,"map");e=m.getUniformLocation(r,"occlusionMap");f=m.getUniformLocation(r,
+"opacity");g=m.getUniformLocation(r,"color");h=m.getUniformLocation(r,"scale");k=m.getUniformLocation(r,"rotation");l=m.getUniformLocation(r,"screenPosition")}m.useProgram(r);m.enableVertexAttribArray(p);m.enableVertexAttribArray(n);m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,s);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);m.disable(m.CULL_FACE);m.depthMask(!1);H=0;for(O=b.length;H<O;H++)if(C=16/G,E.set(C*
+y,C),M=b[H],z.set(M.matrixWorld.elements[12],M.matrixWorld.elements[13],M.matrixWorld.elements[14]),z.applyMatrix4(w.matrixWorldInverse),z.applyProjection(w.projectionMatrix),L.copy(z),N.x=L.x*I+I,N.y=L.y*B+B,v||0<N.x&&N.x<F&&0<N.y&&N.y<G){m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,u);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,N.x-8,N.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,E.x,E.y);m.uniform3f(l,L.x,L.y,L.z);m.disable(m.BLEND);m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,
+0);m.activeTexture(m.TEXTURE0);m.bindTexture(m.TEXTURE_2D,x);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,N.x-8,N.y-8,16,16,0);m.uniform1i(c,1);m.disable(m.DEPTH_TEST);m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,u);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);M.positionScreen.copy(L);M.customUpdateCallback?M.customUpdateCallback(M):M.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var A=0,J=M.lensFlares.length;A<J;A++){var R=M.lensFlares[A];.001<R.opacity&&.001<R.scale&&(L.x=R.x,
+L.y=R.y,L.z=R.z,C=R.size*R.scale/G,E.x=C*y,E.y=C,m.uniform3f(l,L.x,L.y,L.z),m.uniform2f(h,E.x,E.y),m.uniform1f(k,R.rotation),m.uniform1f(f,R.opacity),m.uniform3f(g,R.color.r,R.color.g,R.color.b),a.state.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),a.setTexture(R.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,l,p,n,m,s,t,r,v,u,x;function z(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,F,G,y,I,B=new THREE.Vector3,C=new THREE.Quaternion,E=new THREE.Vector3;this.render=function(L,N){if(0!==b.length){if(void 0===y){var H=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),O=new Uint16Array([0,1,2,0,2,3]);F=w.createBuffer();G=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,F);w.bufferData(w.ARRAY_BUFFER,H,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
+G);w.bufferData(w.ELEMENT_ARRAY_BUFFER,O,w.STATIC_DRAW);var H=w.createProgram(),O=w.createShader(w.VERTEX_SHADER),M=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(O,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
+w.shaderSource(M,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
+w.compileShader(O);w.compileShader(M);w.attachShader(H,O);w.attachShader(H,M);w.linkProgram(H);y=H;u=w.getAttribLocation(y,"position");x=w.getAttribLocation(y,"uv");c=w.getUniformLocation(y,"uvOffset");d=w.getUniformLocation(y,"uvScale");e=w.getUniformLocation(y,"rotation");f=w.getUniformLocation(y,"scale");g=w.getUniformLocation(y,"color");h=w.getUniformLocation(y,"map");k=w.getUniformLocation(y,"opacity");l=w.getUniformLocation(y,"modelViewMatrix");p=w.getUniformLocation(y,"projectionMatrix");n=
+w.getUniformLocation(y,"fogType");m=w.getUniformLocation(y,"fogDensity");s=w.getUniformLocation(y,"fogNear");t=w.getUniformLocation(y,"fogFar");r=w.getUniformLocation(y,"fogColor");v=w.getUniformLocation(y,"alphaTest");H=document.createElement("canvas");H.width=8;H.height=8;O=H.getContext("2d");O.fillStyle="white";O.fillRect(0,0,8,8);I=new THREE.Texture(H);I.needsUpdate=!0}w.useProgram(y);w.enableVertexAttribArray(u);w.enableVertexAttribArray(x);w.disable(w.CULL_FACE);w.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,
+F);w.vertexAttribPointer(u,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,G);w.uniformMatrix4fv(p,!1,N.projectionMatrix.elements);w.activeTexture(w.TEXTURE0);w.uniform1i(h,0);O=H=0;(M=L.fog)?(w.uniform3f(r,M.color.r,M.color.g,M.color.b),M instanceof THREE.Fog?(w.uniform1f(s,M.near),w.uniform1f(t,M.far),w.uniform1i(n,1),O=H=1):M instanceof THREE.FogExp2&&(w.uniform1f(m,M.density),w.uniform1i(n,2),O=H=2)):(w.uniform1i(n,0),O=H=0);for(var M=0,A=b.length;M<
+A;M++){var J=b[M];J._modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,J.matrixWorld);J.z=-J._modelViewMatrix.elements[14]}b.sort(z);for(var R=[],M=0,A=b.length;M<A;M++){var J=b[M],K=J.material;w.uniform1f(v,K.alphaTest);w.uniformMatrix4fv(l,!1,J._modelViewMatrix.elements);J.matrixWorld.decompose(B,C,E);R[0]=E.x;R[1]=E.y;J=0;L.fog&&K.fog&&(J=O);H!==J&&(w.uniform1i(n,J),H=J);null!==K.map?(w.uniform2f(c,K.map.offset.x,K.map.offset.y),w.uniform2f(d,K.map.repeat.x,K.map.repeat.y)):(w.uniform2f(c,
+0,0),w.uniform2f(d,1,1));w.uniform1f(k,K.opacity);w.uniform3f(g,K.color.r,K.color.g,K.color.b);w.uniform1f(e,K.rotation);w.uniform2fv(f,R);a.state.setBlending(K.blending,K.blendEquation,K.blendSrc,K.blendDst);a.state.setDepthTest(K.depthTest);a.state.setDepthWrite(K.depthWrite);K.map&&K.map.image&&K.map.image.width?a.setTexture(K.map,0):a.setTexture(I,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}w.enable(w.CULL_FACE);a.resetGLState()}}};
 THREE.GeometryUtils={merge:function(a,b,c){THREE.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){THREE.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
 THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);e.load(a,function(a){f.image=a;f.needsUpdate=!0;c&&c(f)},void 0,function(a){d&&d(a)});f.sourceFile=a;return f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a;g+=1;6===g&&(f.needsUpdate=!0,c&&
 c(f))},void 0,d)};for(var h=0,k=a.length;h<k;++h)b(h);return f},loadCompressedTexture:function(){THREE.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){THREE.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");
-f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),l=k.data,n=0;n<d;n++)for(var p=0;p<e;p++){var m=0>p-1?0:p-1,r=p+1>e-1?e-1:p+1,t=0>n-1?0:n-1,s=n+1>d-1?d-1:n+1,u=[],v=[0,0,h[4*(p*d+n)]/255*b];u.push([-1,0,h[4*(p*d+t)]/255*b]);u.push([-1,-1,h[4*(m*d+t)]/255*b]);u.push([0,-1,h[4*(m*d+n)]/255*b]);u.push([1,-1,h[4*(m*d+s)]/255*b]);u.push([1,0,h[4*(p*d+s)]/255*b]);u.push([1,1,h[4*(r*d+s)]/255*b]);u.push([0,1,h[4*(r*d+n)]/255*
-b]);u.push([-1,1,h[4*(r*d+t)]/255*b]);m=[];t=u.length;for(r=0;r<t;r++){var s=u[r],x=u[(r+1)%t],s=[s[0]-v[0],s[1]-v[1],s[2]-v[2]],x=[x[0]-v[0],x[1]-v[1],x[2]-v[2]];m.push(c([s[1]*x[2]-s[2]*x[1],s[2]*x[0]-s[0]*x[2],s[0]*x[1]-s[1]*x[0]]))}u=[0,0,0];for(r=0;r<m.length;r++)u[0]+=m[r][0],u[1]+=m[r][1],u[2]+=m[r][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;v=4*(p*d+n);l[v]=(u[0]+1)/2*255|0;l[v+1]=(u[1]+1)/2*255|0;l[v+2]=255*u[2]|0;l[v+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
+f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),l=k.data,p=0;p<d;p++)for(var n=0;n<e;n++){var m=0>n-1?0:n-1,s=n+1>e-1?e-1:n+1,t=0>p-1?0:p-1,r=p+1>d-1?d-1:p+1,v=[],u=[0,0,h[4*(n*d+p)]/255*b];v.push([-1,0,h[4*(n*d+t)]/255*b]);v.push([-1,-1,h[4*(m*d+t)]/255*b]);v.push([0,-1,h[4*(m*d+p)]/255*b]);v.push([1,-1,h[4*(m*d+r)]/255*b]);v.push([1,0,h[4*(n*d+r)]/255*b]);v.push([1,1,h[4*(s*d+r)]/255*b]);v.push([0,1,h[4*(s*d+p)]/255*
+b]);v.push([-1,1,h[4*(s*d+t)]/255*b]);m=[];t=v.length;for(s=0;s<t;s++){var r=v[s],x=v[(s+1)%t],r=[r[0]-u[0],r[1]-u[1],r[2]-u[2]],x=[x[0]-u[0],x[1]-u[1],x[2]-u[2]];m.push(c([r[1]*x[2]-r[2]*x[1],r[2]*x[0]-r[0]*x[2],r[0]*x[1]-r[1]*x[0]]))}v=[0,0,0];for(s=0;s<m.length;s++)v[0]+=m[s][0],v[1]+=m[s][1],v[2]+=m[s][2];v[0]/=m.length;v[1]/=m.length;v[2]/=m.length;u=4*(n*d+p);l[u]=(v[0]+1)/2*255|0;l[u+1]=(v[1]+1)/2*255|0;l[u+2]=255*v[2]|0;l[u+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
 b,c){var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
 THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing.";}},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=
-a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,n,p,m,r,t,s,u,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);
-break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d;n=b[a++]*c;r=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(r,t,k,n);if(g=f[f.length-1])for(p=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++){var x=g/h;THREE.Shape.Utils.b2(x,p,r,k);THREE.Shape.Utils.b2(x,m,t,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,r=b[a++]*c+d,t=b[a++]*c,s=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(r,t,s,u,k,n),g=f[f.length-1])for(p=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++)x=g/h,THREE.Shape.Utils.b3(x,p,r,s,k),THREE.Shape.Utils.b3(x,
-m,t,u,n)}return{offset:v.ha*c,path:e}}}};
+a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,p,n,m,s,t,r,v,u=b.glyphs[a]||b.glyphs["?"];if(u){if(u.o)for(b=u._cachedOutline||(u._cachedOutline=u.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;p=b[a++]*c;e.moveTo(k,p);
+break;case "l":k=b[a++]*c+d;p=b[a++]*c;e.lineTo(k,p);break;case "q":k=b[a++]*c+d;p=b[a++]*c;s=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(s,t,k,p);if(g=f[f.length-1])for(n=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++){var x=g/h;THREE.Shape.Utils.b2(x,n,s,k);THREE.Shape.Utils.b2(x,m,t,p)}break;case "b":if(k=b[a++]*c+d,p=b[a++]*c,s=b[a++]*c+d,t=b[a++]*c,r=b[a++]*c+d,v=b[a++]*c,e.bezierCurveTo(s,t,r,v,k,p),g=f[f.length-1])for(n=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++)x=g/h,THREE.Shape.Utils.b3(x,n,s,r,k),THREE.Shape.Utils.b3(x,
+m,t,v,p)}return{offset:u.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){THREE.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var m;a:{var r=m=void 0,t=void 0,s=void 0,
-u=void 0,v=void 0,x=void 0,z=void 0,w=void 0,r=a[g[k]].x,t=a[g[k]].y,s=a[g[l]].x,u=a[g[l]].y,v=a[g[n]].x,x=a[g[n]].y;if(1E-10>(s-r)*(x-t)-(u-t)*(v-r))m=!1;else{var I=void 0,H=void 0,y=void 0,F=void 0,B=void 0,E=void 0,C=void 0,N=void 0,K=void 0,L=void 0,K=N=C=w=z=void 0,I=v-s,H=x-u,y=r-v,F=t-x,B=s-r,E=u-t;for(m=0;m<e;m++)if(z=a[g[m]].x,w=a[g[m]].y,!(z===r&&w===t||z===s&&w===u||z===v&&w===x)&&(C=z-r,N=w-t,K=z-s,L=w-u,z-=v,w-=x,K=I*L-H*K,C=B*N-E*C,N=y*w-F*z,-1E-10<=K&&-1E-10<=N&&-1E-10<=C)){m=!1;break a}m=
-!0}}if(m){f.push([a[g[k]],a[g[l]],a[g[n]]]);h.push([g[k],g[l],g[n]]);k=l;for(n=l+1;n<e;k++,n++)g[k]=g[n];e--;p=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;
+(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,p;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var n=2*e;for(l=e-1;2<e;){if(0>=n--){THREE.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);p=l+1;e<=p&&(p=0);var m;a:{var s=m=void 0,t=void 0,r=void 0,
+v=void 0,u=void 0,x=void 0,z=void 0,w=void 0,s=a[g[k]].x,t=a[g[k]].y,r=a[g[l]].x,v=a[g[l]].y,u=a[g[p]].x,x=a[g[p]].y;if(1E-10>(r-s)*(x-t)-(v-t)*(u-s))m=!1;else{var F=void 0,G=void 0,y=void 0,I=void 0,B=void 0,C=void 0,E=void 0,L=void 0,N=void 0,H=void 0,N=L=E=w=z=void 0,F=u-r,G=x-v,y=s-u,I=t-x,B=r-s,C=v-t;for(m=0;m<e;m++)if(z=a[g[m]].x,w=a[g[m]].y,!(z===s&&w===t||z===r&&w===v||z===u&&w===x)&&(E=z-s,L=w-t,N=z-r,H=w-v,z-=u,w-=x,N=F*H-G*N,E=B*L-C*E,L=y*w-I*z,-1E-10<=N&&-1E-10<=L&&-1E-10<=E)){m=!1;break a}m=
+!0}}if(m){f.push([a[g[k]],a[g[l]],a[g[p]]]);h.push([g[k],g[l],g[p]]);k=l;for(p=l+1;p<e;k++,p++)g[k]=g[p];e--;n=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);THREE.Audio.prototype.constructor=THREE.Audio;
 THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this};
 THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)THREE.warn("THREE.Audio: Audio is already playing.");else{var a=this.context.createBufferSource();a.buffer=this.source.buffer;a.loop=this.source.loop;a.onended=this.source.onended;a.connect(this.panner);a.start(0,this.startTime);this.isPlaying=!0;this.source=a}};THREE.Audio.prototype.pause=function(){this.source.stop();this.startTime=this.context.currentTime};THREE.Audio.prototype.stop=function(){this.source.stop();this.startTime=0};
@@ -683,7 +683,7 @@ THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)
 THREE.Curve.create=function(a,b){a.prototype=Object.create(THREE.Curve.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};THREE.CurvePath=function(){this.curves=[];this.bends=[];this.autoClose=!1};THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype);THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){};
 THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))};THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a<c.length;){if(c[a]>=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]};
 THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;c<d;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a};
-THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,f,g;b=c=Number.NEGATIVE_INFINITY;e=f=Number.POSITIVE_INFINITY;var h,k,l,n,p=a[0]instanceof THREE.Vector3;n=p?new THREE.Vector3:new THREE.Vector2;k=0;for(l=a.length;k<l;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<f&&(f=h.y),p&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),n.add(h);a={minX:e,minY:f,maxX:b,maxY:c};p&&(a.maxZ=d,a.minZ=g);return a};
+THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,f,g;b=c=Number.NEGATIVE_INFINITY;e=f=Number.POSITIVE_INFINITY;var h,k,l,p,n=a[0]instanceof THREE.Vector3;p=n?new THREE.Vector3:new THREE.Vector2;k=0;for(l=a.length;k<l;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<f&&(f=h.y),n&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),p.add(h);a={minX:e,minY:f,maxX:b,maxY:c};n&&(a.maxZ=d,a.minZ=g);return a};
 THREE.CurvePath.prototype.createPointsGeometry=function(a){a=this.getPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createSpacedPointsGeometry=function(a){a=this.getSpacedPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(new THREE.Vector3(a[c].x,a[c].y,a[c].z||0));return b};THREE.CurvePath.prototype.addWrapPath=function(a){this.bends.push(a)};
 THREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c=this.getPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};
 THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),d,e,f,g,h,k;d=0;for(e=a.length;d<e;d++)f=a[d],g=f.x,h=f.y,k=g/c.maxX,k=b.getUtoTmapping(k,g),g=b.getPoint(k),k=b.getTangent(k),k.set(-k.y,k.x).multiplyScalar(h),f.x=g.x+k.x,f.y=g.y+k.y;return a};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype);THREE.Gyroscope.prototype.constructor=THREE.Gyroscope;
@@ -696,22 +696,22 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.s
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(k);k=k.getPoint(1);h.push(k.x);h.push(k.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})};
 THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};
-THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return THREE.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,l,n,p,m,r,t,s;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];p=f[0];m=f[1];0<c.length?(g=c[c.length-1],r=g.x,
-t=g.y):(g=this.actions[d-1].args,r=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)s=f/a,g=THREE.Shape.Utils.b2(s,r,p,h),s=THREE.Shape.Utils.b2(s,t,m,k),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];p=f[0];m=f[1];l=f[2];n=f[3];0<c.length?(g=c[c.length-1],r=g.x,t=g.y):(g=this.actions[d-1].args,r=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)s=f/a,g=THREE.Shape.Utils.b3(s,r,p,l,h),s=THREE.Shape.Utils.b3(s,t,m,n,k),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.CSPLINE_THRU:g=
-this.actions[d-1].args;s=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;s=s.concat(f[0]);s=new THREE.SplineCurve(s);for(f=1;f<=g;f++)c.push(s.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];m=f[2];l=f[3];g=f[4];p=!!f[5];r=g-l;t=2*a;for(f=1;f<=t;f++)s=f/t,p||(s=1-s),s=l+s*r,g=h+m*Math.cos(s),s=k+m*Math.sin(s),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],m=f[2],n=f[3],l=f[4],g=f[5],p=!!f[6],r=g-l,t=2*a,f=1;f<=t;f++)s=f/t,p||
-(s=1-s),s=l+s*r,g=h+m*Math.cos(s),s=k+n*Math.sin(s),c.push(new THREE.Vector2(g,s))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
-THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,m=h.y-g.y;if(1E-10<Math.abs(m)){if(0>m&&(g=b[f],k=-k,h=b[e],m=-m),!(a.y<g.y||a.y>h.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=m*(a.x-g.x)-k*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=
+THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return THREE.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,l,p,n,m,s,t,r;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];n=f[0];m=f[1];0<c.length?(g=c[c.length-1],s=g.x,
+t=g.y):(g=this.actions[d-1].args,s=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)r=f/a,g=THREE.Shape.Utils.b2(r,s,n,h),r=THREE.Shape.Utils.b2(r,t,m,k),c.push(new THREE.Vector2(g,r));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];n=f[0];m=f[1];l=f[2];p=f[3];0<c.length?(g=c[c.length-1],s=g.x,t=g.y):(g=this.actions[d-1].args,s=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)r=f/a,g=THREE.Shape.Utils.b3(r,s,n,l,h),r=THREE.Shape.Utils.b3(r,t,m,p,k),c.push(new THREE.Vector2(g,r));break;case THREE.PathActions.CSPLINE_THRU:g=
+this.actions[d-1].args;r=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;r=r.concat(f[0]);r=new THREE.SplineCurve(r);for(f=1;f<=g;f++)c.push(r.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];m=f[2];l=f[3];g=f[4];n=!!f[5];s=g-l;t=2*a;for(f=1;f<=t;f++)r=f/t,n||(r=1-r),r=l+r*s,g=h+m*Math.cos(r),r=k+m*Math.sin(r),c.push(new THREE.Vector2(g,r));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],m=f[2],p=f[3],l=f[4],g=f[5],n=!!f[6],s=g-l,t=2*a,f=1;f<=t;f++)r=f/t,n||
+(r=1-r),r=l+r*s,g=h+m*Math.cos(r),r=k+p*Math.sin(r),c.push(new THREE.Vector2(g,r))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
+THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],m=h.x-g.x,k=h.y-g.y;if(1E-10<Math.abs(k)){if(0>k&&(g=b[f],m=-m,h=b[e],k=-k),!(a.y<g.y||a.y>h.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=k*(a.x-g.x)-m*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=
 h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;b<c;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);0!=g.actions.length&&f.push(g);return f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var f,g,h,k=[];if(1==e.length)return g=e[0],h=new THREE.Shape,h.actions=g.actions,h.curves=g.curves,k.push(h),k;var l=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),l=a?!l:l;
-h=[];var n=[],p=[],m=0,r;n[m]=void 0;p[m]=[];var t,s;t=0;for(s=e.length;t<s;t++)g=e[t],r=g.getPoints(),f=THREE.Shape.Utils.isClockWise(r),(f=a?!f:f)?(!l&&n[m]&&m++,n[m]={s:new THREE.Shape,p:r},n[m].s.actions=g.actions,n[m].s.curves=g.curves,l&&m++,p[m]=[]):p[m].push({h:g,p:r[0]});if(!n[0])return c(e);if(1<n.length){t=!1;s=[];g=0;for(e=n.length;g<e;g++)h[g]=[];g=0;for(e=n.length;g<e;g++)for(f=p[g],l=0;l<f.length;l++){m=f[l];r=!0;for(var u=0;u<n.length;u++)d(m.p,n[u].p)&&(g!=u&&s.push({froms:g,tos:u,
-hole:l}),r?(r=!1,h[u].push(m)):t=!0);r&&h[g].push(m)}0<s.length&&(t||(p=h))}t=0;for(s=n.length;t<s;t++)for(h=n[t].s,k.push(h),g=p[t],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
+h=[];var p=[],n=[],m=0,s;p[m]=void 0;n[m]=[];var t,r;t=0;for(r=e.length;t<r;t++)g=e[t],s=g.getPoints(),f=THREE.Shape.Utils.isClockWise(s),(f=a?!f:f)?(!l&&p[m]&&m++,p[m]={s:new THREE.Shape,p:s},p[m].s.actions=g.actions,p[m].s.curves=g.curves,l&&m++,n[m]=[]):n[m].push({h:g,p:s[0]});if(!p[0])return c(e);if(1<p.length){t=!1;r=[];g=0;for(e=p.length;g<e;g++)h[g]=[];g=0;for(e=p.length;g<e;g++)for(f=n[g],l=0;l<f.length;l++){m=f[l];s=!0;for(var v=0;v<p.length;v++)d(m.p,p[v].p)&&(g!=v&&r.push({froms:g,tos:v,
+hole:l}),s?(s=!1,h[v].push(m)):t=!0);s&&h[g].push(m)}0<r.length&&(t||(n=h))}t=0;for(r=p.length;t<r;t++)for(h=p[t].s,k.push(h),g=n[t],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
 THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,y=h*k-g*l,F=h*n-g*p;if(1E-10<Math.abs(y)){if(0<y){if(0>F||F>y)return[];k=l*n-k*p;if(0>k||k>y)return[]}else{if(0<F||F<y)return[];k=l*n-k*p;if(0<k||k<y)return[]}if(0==k)return!f||0!=F&&F!=y?[a]:[];if(k==y)return!f||0!=F&&F!=y?[b]:[];if(0==F)return[d];
-if(F==y)return[e];f=k/y;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=F||l*n!=k*p)return[];h=0==g&&0==h;k=0==k&&0==l;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,y=d.x,l=e,d=e.x):(b=e,y=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,y=d.y,l=e,d=e.y):(b=e,y=e.y,l=d,d=d.y));return k<=y?a<y?[]:a==y?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
-[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,n={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+":"+h[f].y,void 0!==n[l]&&THREE.warn("THREE.Shape: Duplicate point",l),n[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);
-if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,H,y,F,B=[],E,C,N,K=0;for(n=b.length;K<n;K++)l.push(K);E=0;for(var L=2*l.length;0<l.length;){L--;if(0>
-L){THREE.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=E;p<h.length;p++){H=h[p];n=-1;for(K=0;K<l.length;K++)if(y=l[K],F=H.x+":"+H.y+":"+y,void 0===B[F]){k=b[y];for(C=0;C<k.length;C++)if(y=k[C],c(p,C)&&!f(H,y)&&!g(H,y)){n=C;l.splice(K,1);E=h.slice(0,p+1);y=h.slice(p);C=k.slice(n);N=k.slice(0,n+1);h=E.concat(C).concat(N).concat(y);E=p;break}if(0<=n)break;B[F]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=p.length;f<g;f++)for(k=
-p[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=n[l],void 0!==l&&(k[h]=l);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,p=a.x-d.x,n=a.y-d.y,y=h*k-g*l,I=h*p-g*n;if(1E-10<Math.abs(y)){if(0<y){if(0>I||I>y)return[];k=l*p-k*n;if(0>k||k>y)return[]}else{if(0<I||I<y)return[];k=l*p-k*n;if(0<k||k<y)return[]}if(0==k)return!f||0!=I&&I!=y?[a]:[];if(k==y)return!f||0!=I&&I!=y?[b]:[];if(0==I)return[d];
+if(I==y)return[e];f=k/y;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=I||l*p!=k*n)return[];h=0==g&&0==h;k=0==k&&0==l;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,y=d.x,l=e,d=e.x):(b=e,y=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,y=d.y,l=e,d=e.y):(b=e,y=e.y,l=d,d=d.y));return k<=y?a<y?[]:a==y?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
+[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,p={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+":"+h[f].y,void 0!==p[l]&&THREE.warn("THREE.Shape: Duplicate point",l),p[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);
+if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],p,n,G,y,I,B=[],C,E,L,N=0;for(p=b.length;N<p;N++)l.push(N);C=0;for(var H=2*l.length;0<l.length;){H--;if(0>
+H){THREE.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(n=C;n<h.length;n++){G=h[n];p=-1;for(N=0;N<l.length;N++)if(y=l[N],I=G.x+":"+G.y+":"+y,void 0===B[I]){k=b[y];for(E=0;E<k.length;E++)if(y=k[E],c(n,E)&&!f(G,y)&&!g(G,y)){p=E;l.splice(N,1);C=h.slice(0,n+1);y=h.slice(n);E=k.slice(p);L=k.slice(0,p+1);h=C.concat(E).concat(L).concat(y);C=n;break}if(0<=p)break;B[I]=!0}if(0<=p)break}}return h}(a,b);var n=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=n.length;f<g;f++)for(k=
+n[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=p[l],void 0!==l&&(k[h]=l);return n.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*
 a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};
 THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
 THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return b};THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);return b.normalize()};
@@ -731,12 +731,12 @@ THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(
 for(b=0;b<this.animations.length;b++)this.animations[b].update(a)}};THREE.Animation=function(a,b){this.root=a;this.data=THREE.AnimationHandler.init(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=!0;this.weight=0;this.interpolationType=THREE.AnimationHandler.LINEAR};
 THREE.Animation.prototype={constructor:THREE.Animation,keyTypes:["pos","rot","scl"],play:function(a,b){this.currentTime=void 0!==a?a:0;this.weight=void 0!==b?b:1;this.isPlaying=!0;this.reset();THREE.AnimationHandler.play(this)},stop:function(){this.isPlaying=!1;THREE.AnimationHandler.stop(this)},reset:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});
 var d=this.data.name,e=c.animationCache.animations,f=e[d];void 0===f&&(f={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=f);for(c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(d,a,1);g.time<this.currentTime&&g.index>e.index;)e=g,g=this.getNextKeyWith(d,a,g.index+1);f.prevKey[d]=e;f.nextKey[d]=g}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a].animationCache;void 0!==
-c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,p,m,r,t,s;e=(a.length-1)*b;p=Math.floor(e);e-=p;c[0]=0===p?p:p-1;c[1]=p;c[2]=p>a.length-2?p:p+1;c[3]=p>a.length-3?p:p+2;p=a[c[0]];r=a[c[1]];t=a[c[2]];s=a[c[3]];c=e*e;m=e*c;d[0]=f(p[0],r[0],t[0],s[0],e,c,m);d[1]=f(p[1],r[1],t[1],s[1],e,c,m);d[2]=f(p[2],r[2],t[2],s[2],e,c,m);return d},f=function(a,b,c,d,
-e,f,m){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*m+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],l=k.animationCache.animations[this.data.name],n=k.animationCache.blending,p=0;3>p;p++){var m=this.keyTypes[p],
-r=l.prevKey[m],t=l.nextKey[m];if(0<this.timeScale&&t.time<=this.currentTime||0>this.timeScale&&r.time>=this.currentTime){r=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(m,f,1);t.time<this.currentTime&&t.index>r.index;)r=t,t=this.getNextKeyWith(m,f,t.index+1);l.prevKey[m]=r;l.nextKey[m]=t}var s=(this.currentTime-r.time)/(t.time-r.time),u=r[m],v=t[m];0>s&&(s=0);1<s&&(s=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*s,c.y=u[1]+(v[1]-u[1])*s,
-c.z=u[2]+(v[2]-u[2])*s,r=this.weight/(this.weight+n.positionWeight),k.position.lerp(c,r),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,r.index-1).pos,a[1]=u,a[2]=v,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,s=.33*s+.33,t=e(a,s),r=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,m=k.position,m.x+=(t[0]-m.x)*r,m.y+=(t[1]-
-m.y)*r,m.z+=(t[2]-m.z)*r,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(s=e(a,1.01*s),b.set(s[0],s[1],s[2]),b.sub(m),b.y=0,b.normalize(),s=Math.atan2(b.x,b.z),k.rotation.set(0,s,0))}else"rot"===m?(THREE.Quaternion.slerp(u,v,d,s),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(r=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,r),n.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+(v[0]-u[0])*s,c.y=
-u[1]+(v[1]-u[1])*s,c.z=u[2]+(v[2]-u[2])*s,r=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,r),n.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]},getPrevKeyWith:function(a,b,c){var d=
+c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,n,m,s,t,r;e=(a.length-1)*b;n=Math.floor(e);e-=n;c[0]=0===n?n:n-1;c[1]=n;c[2]=n>a.length-2?n:n+1;c[3]=n>a.length-3?n:n+2;n=a[c[0]];s=a[c[1]];t=a[c[2]];r=a[c[3]];c=e*e;m=e*c;d[0]=f(n[0],s[0],t[0],r[0],e,c,m);d[1]=f(n[1],s[1],t[1],r[1],e,c,m);d[2]=f(n[2],s[2],t[2],r[2],e,c,m);return d},f=function(a,b,c,d,
+e,f,m){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*m+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],l=k.animationCache.animations[this.data.name],p=k.animationCache.blending,n=0;3>n;n++){var m=this.keyTypes[n],
+s=l.prevKey[m],t=l.nextKey[m];if(0<this.timeScale&&t.time<=this.currentTime||0>this.timeScale&&s.time>=this.currentTime){s=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(m,f,1);t.time<this.currentTime&&t.index>s.index;)s=t,t=this.getNextKeyWith(m,f,t.index+1);l.prevKey[m]=s;l.nextKey[m]=t}var r=(this.currentTime-s.time)/(t.time-s.time),v=s[m],u=t[m];0>r&&(r=0);1<r&&(r=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=v[0]+(u[0]-v[0])*r,c.y=v[1]+(u[1]-v[1])*r,
+c.z=v[2]+(u[2]-v[2])*r,s=this.weight/(this.weight+p.positionWeight),k.position.lerp(c,s),p.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,s.index-1).pos,a[1]=v,a[2]=u,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,r=.33*r+.33,t=e(a,r),s=this.weight/(this.weight+p.positionWeight),p.positionWeight+=this.weight,m=k.position,m.x+=(t[0]-m.x)*s,m.y+=(t[1]-
+m.y)*s,m.z+=(t[2]-m.z)*s,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(r=e(a,1.01*r),b.set(r[0],r[1],r[2]),b.sub(m),b.y=0,b.normalize(),r=Math.atan2(b.x,b.z),k.rotation.set(0,r,0))}else"rot"===m?(THREE.Quaternion.slerp(v,u,d,r),0===p.quaternionWeight?(k.quaternion.copy(d),p.quaternionWeight=this.weight):(s=this.weight/(this.weight+p.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,s),p.quaternionWeight+=this.weight)):"scl"===m&&(c.x=v[0]+(u[0]-v[0])*r,c.y=
+v[1]+(u[1]-v[1])*r,c.z=v[2]+(u[2]-v[2])*r,s=this.weight/(this.weight+p.scaleWeight),k.scale.lerp(c,s),p.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]},getPrevKeyWith:function(a,b,c){var d=
 this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]}};
 THREE.KeyFrameAnimation=function(a){this.root=a.node;this.data=THREE.AnimationHandler.init(a);this.hierarchy=THREE.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=.001;this.isPlaying=!1;this.loop=this.isPaused=!0;a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 d.matrixWorldNeedsUpdate=!0}}};
@@ -747,70 +747,70 @@ f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorld
 THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
 THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);a=this.duration/this.frames;var b=Math.floor(this.currentTime/a),c=this.mesh.morphTargetInfluences;b!=this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=
 1,c[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);c[b]=this.currentTime%a/a;c[this.lastFrame]=1-c[b]}}};
-THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,s){var u,v=h.widthSegments,x=h.heightSegments,z=e/2,w=f/2,I=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",x=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var H=v+1,y=x+1,F=e/v,B=f/x,E=new THREE.Vector3;E[u]=0<g?1:-1;for(e=0;e<y;e++)for(f=0;f<H;f++){var C=new THREE.Vector3;C[a]=(f*F-z)*c;C[b]=(e*B-w)*d;C[u]=g;h.vertices.push(C)}for(e=
-0;e<x;e++)for(f=0;f<v;f++)w=f+H*e,a=f+H*(e+1),b=f+1+H*(e+1),c=f+1+H*e,d=new THREE.Vector2(f/v,1-e/x),g=new THREE.Vector2(f/v,1-(e+1)/x),u=new THREE.Vector2((f+1)/v,1-(e+1)/x),z=new THREE.Vector2((f+1)/v,1-e/x),w=new THREE.Face3(w+I,a+I,c+I),w.normal.copy(E),w.vertexNormals.push(E.clone(),E.clone(),E.clone()),w.materialIndex=s,h.faces.push(w),h.faceVertexUvs[0].push([d,g,z]),w=new THREE.Face3(a+I,b+I,c+I),w.normal.copy(E),w.vertexNormals.push(E.clone(),E.clone(),E.clone()),w.materialIndex=s,h.faces.push(w),
-h.faceVertexUvs[0].push([g.clone(),u,z.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,r){var v,u=h.widthSegments,x=h.heightSegments,z=e/2,w=f/2,F=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",x=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",u=h.depthSegments;var G=u+1,y=x+1,I=e/u,B=f/x,C=new THREE.Vector3;C[v]=0<g?1:-1;for(e=0;e<y;e++)for(f=0;f<G;f++){var E=new THREE.Vector3;E[a]=(f*I-z)*c;E[b]=(e*B-w)*d;E[v]=g;h.vertices.push(E)}for(e=
+0;e<x;e++)for(f=0;f<u;f++)w=f+G*e,a=f+G*(e+1),b=f+1+G*(e+1),c=f+1+G*e,d=new THREE.Vector2(f/u,1-e/x),g=new THREE.Vector2(f/u,1-(e+1)/x),v=new THREE.Vector2((f+1)/u,1-(e+1)/x),z=new THREE.Vector2((f+1)/u,1-e/x),w=new THREE.Face3(w+F,a+F,c+F),w.normal.copy(C),w.vertexNormals.push(C.clone(),C.clone(),C.clone()),w.materialIndex=r,h.faces.push(w),h.faceVertexUvs[0].push([d,g,z]),w=new THREE.Face3(a+F,b+F,c+F),w.normal.copy(C),w.vertexNormals.push(C.clone(),C.clone(),C.clone()),w.materialIndex=r,h.faces.push(w),
+h.faceVertexUvs[0].push([g.clone(),v,z.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.CubeGeometry=THREE.BoxGeometry;
 THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
-THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,n,p=[],m=[];for(n=0;n<=e;n++){var r=[],t=[],s=n/e,u=s*(b-a)+a;for(l=0;l<=d;l++){var v=l/d,x=new THREE.Vector3;x.x=u*Math.sin(v*h+
-g);x.y=-s*c+k;x.z=u*Math.cos(v*h+g);this.vertices.push(x);r.push(this.vertices.length-1);t.push(new THREE.Vector2(v,1-s))}p.push(r);m.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(g=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(g=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var r=p[n][l],t=p[n+1][l],s=p[n+1][l+1],u=p[n][l+1],v=g.clone(),x=g.clone(),
-z=h.clone(),w=h.clone(),I=m[n][l].clone(),H=m[n+1][l].clone(),y=m[n+1][l+1].clone(),F=m[n][l+1].clone();this.faces.push(new THREE.Face3(r,t,u,[v,x,w]));this.faceVertexUvs[0].push([I,H,F]);this.faces.push(new THREE.Face3(t,s,u,[x.clone(),z,w.clone()]));this.faceVertexUvs[0].push([H.clone(),y,F.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)r=p[0][l],t=p[0][l+1],s=this.vertices.length-1,v=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,
-1,0),I=m[0][l].clone(),H=m[0][l+1].clone(),y=new THREE.Vector2(H.x,0),this.faces.push(new THREE.Face3(r,t,s,[v,x,z])),this.faceVertexUvs[0].push([I,H,y]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)r=p[e][l+1],t=p[e][l],s=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),I=m[e][l+1].clone(),H=m[e][l].clone(),y=new THREE.Vector2(H.x,1),this.faces.push(new THREE.Face3(r,t,s,[v,x,z])),this.faceVertexUvs[0].push([I,
-H,y]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
-THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,n=0,p=h.length;n<p;n++)for(var m=h[n],r=0;3>r;r++){d[0]=m[g[r]];d[1]=m[g[(r+1)%3]];d.sort(f);var t=d.toString();void 0===e[t]?(e[t]={vert1:d[0],vert2:d[1],
-face1:n,face2:void 0},l++):e[t].face2=n}d=new Float32Array(6*l);f=0;for(t in e)if(g=e[t],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=c)l=k[g.vert1],d[f++]=l.x,d[f++]=l.y,d[f++]=l.z,l=k[g.vert2],d[f++]=l.x,d[f++]=l.y,d[f++]=l.z;this.addAttribute("position",new THREE.BufferAttribute(d,3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
+THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,p,n=[],m=[];for(p=0;p<=e;p++){var s=[],t=[],r=p/e,v=r*(b-a)+a;for(l=0;l<=d;l++){var u=l/d,x=new THREE.Vector3;x.x=v*Math.sin(u*h+
+g);x.y=-r*c+k;x.z=v*Math.cos(u*h+g);this.vertices.push(x);s.push(this.vertices.length-1);t.push(new THREE.Vector2(u,1-r))}n.push(s);m.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(g=this.vertices[n[0][l]].clone(),h=this.vertices[n[0][l+1]].clone()):(g=this.vertices[n[1][l]].clone(),h=this.vertices[n[1][l+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),p=0;p<e;p++){var s=n[p][l],t=n[p+1][l],r=n[p+1][l+1],v=n[p][l+1],u=g.clone(),x=g.clone(),
+z=h.clone(),w=h.clone(),F=m[p][l].clone(),G=m[p+1][l].clone(),y=m[p+1][l+1].clone(),I=m[p][l+1].clone();this.faces.push(new THREE.Face3(s,t,v,[u,x,w]));this.faceVertexUvs[0].push([F,G,I]);this.faces.push(new THREE.Face3(t,r,v,[x.clone(),z,w.clone()]));this.faceVertexUvs[0].push([G.clone(),y,I.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)s=n[0][l],t=n[0][l+1],r=this.vertices.length-1,u=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,
+1,0),F=m[0][l].clone(),G=m[0][l+1].clone(),y=new THREE.Vector2(G.x,0),this.faces.push(new THREE.Face3(s,t,r,[u,x,z])),this.faceVertexUvs[0].push([F,G,y]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)s=n[e][l+1],t=n[e][l],r=this.vertices.length-1,u=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),F=m[e][l+1].clone(),G=m[e][l].clone(),y=new THREE.Vector2(G.x,1),this.faces.push(new THREE.Face3(s,t,r,[u,x,z])),this.faceVertexUvs[0].push([F,
+G,y]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
+THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,p=0,n=h.length;p<n;p++)for(var m=h[p],s=0;3>s;s++){d[0]=m[g[s]];d[1]=m[g[(s+1)%3]];d.sort(f);var t=d.toString();void 0===e[t]?(e[t]={vert1:d[0],vert2:d[1],
+face1:p,face2:void 0},l++):e[t].face2=p}d=new Float32Array(6*l);f=0;for(t in e)if(g=e[t],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=c)l=k[g.vert1],d[f++]=l.x,d[f++]=l.y,d[f++]=l.z,l=k[g.vert2],d[f++]=l.x,d[f++]=l.y,d[f++]=l.z;this.addAttribute("position",new THREE.BufferAttribute(d,3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
 THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||THREE.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=!0):
--1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)==Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(P=a.length;0<=--P;){c=P;d=P-1;0>d&&(d=a.length-1);for(var e=0,f=r+2*n,e=0;e<f;e++){var g=D*e,h=D*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+N,g=g+N,l=l+N,h=h+N;C.faces.push(new THREE.Face3(k,g,h,null,null,x));C.faces.push(new THREE.Face3(g,l,h,null,null,x));k=z.generateSideWallUV(C,k,g,l,h);C.faceVertexUvs[0].push([k[0],k[1],
-k[3]]);C.faceVertexUvs[0].push([k[1],k[2],k[3]])}}}function f(a,b,c){C.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=N;b+=N;c+=N;C.faces.push(new THREE.Face3(a,b,c,null,null,v));a=z.generateTopUV(C,a,b,c);C.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:
-12,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,s,u=!1,v=b.material,x=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,I,H,y;t&&(s=t.getSpacedPoints(r),u=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,!1),I=new THREE.Vector3,H=new THREE.Vector3,y=new THREE.Vector3);p||(l=k=n=0);var F,B,E,C=this,N=this.vertices.length,t=a.extractPoints(m),m=t.shape,K=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();B=0;for(E=
-K.length;B<E;B++)F=K[B],THREE.Shape.Utils.isClockWise(F)&&(K[B]=F.reverse());t=!1}var L=THREE.Shape.Utils.triangulateShape(m,K),J=m;B=0;for(E=K.length;B<E;B++)F=K[B],m=m.concat(F);var G,A,M,R,O,D=m.length,aa,oa=L.length,t=[],P=0;M=J.length;G=M-1;for(A=P+1;P<M;P++,G++,A++)G===M&&(G=0),A===M&&(A=0),t[P]=d(J[P],J[G],J[A]);var ea=[],$,X=t.concat();B=0;for(E=K.length;B<E;B++){F=K[B];$=[];P=0;M=F.length;G=M-1;for(A=P+1;P<M;P++,G++,A++)G===M&&(G=0),A===M&&(A=0),$[P]=d(F[P],F[G],F[A]);ea.push($);X=X.concat($)}for(G=
-0;G<n;G++){M=G/n;R=k*(1-M);A=l*Math.sin(M*Math.PI/2);P=0;for(M=J.length;P<M;P++)O=c(J[P],t[P],A),f(O.x,O.y,-R);B=0;for(E=K.length;B<E;B++)for(F=K[B],$=ea[B],P=0,M=F.length;P<M;P++)O=c(F[P],$[P],A),f(O.x,O.y,-R)}A=l;for(P=0;P<D;P++)O=p?c(m[P],X[P],A):m[P],u?(H.copy(w.normals[0]).multiplyScalar(O.x),I.copy(w.binormals[0]).multiplyScalar(O.y),y.copy(s[0]).add(H).add(I),f(y.x,y.y,y.z)):f(O.x,O.y,0);for(M=1;M<=r;M++)for(P=0;P<D;P++)O=p?c(m[P],X[P],A):m[P],u?(H.copy(w.normals[M]).multiplyScalar(O.x),I.copy(w.binormals[M]).multiplyScalar(O.y),
-y.copy(s[M]).add(H).add(I),f(y.x,y.y,y.z)):f(O.x,O.y,h/r*M);for(G=n-1;0<=G;G--){M=G/n;R=k*(1-M);A=l*Math.sin(M*Math.PI/2);P=0;for(M=J.length;P<M;P++)O=c(J[P],t[P],A),f(O.x,O.y,h+R);B=0;for(E=K.length;B<E;B++)for(F=K[B],$=ea[B],P=0,M=F.length;P<M;P++)O=c(F[P],$[P],A),u?f(O.x,O.y+s[r-1].y,s[r-1].x+R):f(O.x,O.y,h+R)}(function(){if(p){var a;a=0*D;for(P=0;P<oa;P++)aa=L[P],g(aa[2]+a,aa[1]+a,aa[0]+a);a=r+2*n;a*=D;for(P=0;P<oa;P++)aa=L[P],g(aa[0]+a,aa[1]+a,aa[2]+a)}else{for(P=0;P<oa;P++)aa=L[P],g(aa[2],aa[1],
-aa[0]);for(P=0;P<oa;P++)aa=L[P],g(aa[0]+D*r,aa[1]+D*r,aa[2]+D*r)}})();(function(){var a=0;e(J,a);a+=J.length;B=0;for(E=K.length;B<E;B++)F=K[B],e(F,a),a+=F.length})()};
+-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)==Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(Q=a.length;0<=--Q;){c=Q;d=Q-1;0>d&&(d=a.length-1);for(var e=0,f=s+2*p,e=0;e<f;e++){var g=D*e,h=D*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+L,g=g+L,l=l+L,h=h+L;E.faces.push(new THREE.Face3(k,g,h,null,null,x));E.faces.push(new THREE.Face3(g,l,h,null,null,x));k=z.generateSideWallUV(E,k,g,l,h);E.faceVertexUvs[0].push([k[0],k[1],
+k[3]]);E.faceVertexUvs[0].push([k[1],k[2],k[3]])}}}function f(a,b,c){E.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=L;b+=L;c+=L;E.faces.push(new THREE.Face3(a,b,c,null,null,u));a=z.generateTopUV(E,a,b,c);E.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,p=void 0!==b.bevelSegments?b.bevelSegments:3,n=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:
+12,s=void 0!==b.steps?b.steps:1,t=b.extrudePath,r,v=!1,u=b.material,x=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,F,G,y;t&&(r=t.getSpacedPoints(s),v=!0,n=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),F=new THREE.Vector3,G=new THREE.Vector3,y=new THREE.Vector3);n||(l=k=p=0);var I,B,C,E=this,L=this.vertices.length,t=a.extractPoints(m),m=t.shape,N=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();B=0;for(C=
+N.length;B<C;B++)I=N[B],THREE.Shape.Utils.isClockWise(I)&&(N[B]=I.reverse());t=!1}var H=THREE.Shape.Utils.triangulateShape(m,N),O=m;B=0;for(C=N.length;B<C;B++)I=N[B],m=m.concat(I);var M,A,J,R,K,D=m.length,X,ia=H.length,t=[],Q=0;J=O.length;M=J-1;for(A=Q+1;Q<J;Q++,M++,A++)M===J&&(M=0),A===J&&(A=0),t[Q]=d(O[Q],O[M],O[A]);var P=[],aa,ca=t.concat();B=0;for(C=N.length;B<C;B++){I=N[B];aa=[];Q=0;J=I.length;M=J-1;for(A=Q+1;Q<J;Q++,M++,A++)M===J&&(M=0),A===J&&(A=0),aa[Q]=d(I[Q],I[M],I[A]);P.push(aa);ca=ca.concat(aa)}for(M=
+0;M<p;M++){J=M/p;R=k*(1-J);A=l*Math.sin(J*Math.PI/2);Q=0;for(J=O.length;Q<J;Q++)K=c(O[Q],t[Q],A),f(K.x,K.y,-R);B=0;for(C=N.length;B<C;B++)for(I=N[B],aa=P[B],Q=0,J=I.length;Q<J;Q++)K=c(I[Q],aa[Q],A),f(K.x,K.y,-R)}A=l;for(Q=0;Q<D;Q++)K=n?c(m[Q],ca[Q],A):m[Q],v?(G.copy(w.normals[0]).multiplyScalar(K.x),F.copy(w.binormals[0]).multiplyScalar(K.y),y.copy(r[0]).add(G).add(F),f(y.x,y.y,y.z)):f(K.x,K.y,0);for(J=1;J<=s;J++)for(Q=0;Q<D;Q++)K=n?c(m[Q],ca[Q],A):m[Q],v?(G.copy(w.normals[J]).multiplyScalar(K.x),
+F.copy(w.binormals[J]).multiplyScalar(K.y),y.copy(r[J]).add(G).add(F),f(y.x,y.y,y.z)):f(K.x,K.y,h/s*J);for(M=p-1;0<=M;M--){J=M/p;R=k*(1-J);A=l*Math.sin(J*Math.PI/2);Q=0;for(J=O.length;Q<J;Q++)K=c(O[Q],t[Q],A),f(K.x,K.y,h+R);B=0;for(C=N.length;B<C;B++)for(I=N[B],aa=P[B],Q=0,J=I.length;Q<J;Q++)K=c(I[Q],aa[Q],A),v?f(K.x,K.y+r[s-1].y,r[s-1].x+R):f(K.x,K.y,h+R)}(function(){if(n){var a;a=0*D;for(Q=0;Q<ia;Q++)X=H[Q],g(X[2]+a,X[1]+a,X[0]+a);a=s+2*p;a*=D;for(Q=0;Q<ia;Q++)X=H[Q],g(X[0]+a,X[1]+a,X[2]+a)}else{for(Q=
+0;Q<ia;Q++)X=H[Q],g(X[2],X[1],X[0]);for(Q=0;Q<ia;Q++)X=H[Q],g(X[0]+D*s,X[1]+D*s,X[2]+D*s)}})();(function(){var a=0;e(O,a);a+=O.length;B=0;for(C=N.length;B<C;B++)I=N[B],e(I,a),a+=I.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
-THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],
-k=k.concat(g);l=k.length;f=n.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=n[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,g,l))};
-THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),n=Math.sin(k),k=0,p=a.length;k<p;k++){var m=a[k],r=new THREE.Vector3;r.x=l*m.x-n*m.y;r.y=n*m.x+l*m.y;r.z=m.z;this.vertices.push(r)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,p=a.length-1;k<p;k++){b=n=k+c*g;d=n+c;var l=n+1+c,n=n+1,m=g*f,r=k*e,t=
-m+f,s=r+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(m,r),new THREE.Vector2(t,r),new THREE.Vector2(m,s)]);this.faces.push(new THREE.Face3(d,l,n));this.faceVertexUvs[0].push([new THREE.Vector2(t,r),new THREE.Vector2(t,s),new THREE.Vector2(m,s)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var p=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],
+k=k.concat(g);l=k.length;f=p.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=p[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,g,l))};
+THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),p=Math.sin(k),k=0,n=a.length;k<n;k++){var m=a[k],s=new THREE.Vector3;s.x=l*m.x-p*m.y;s.y=p*m.x+l*m.y;s.z=m.z;this.vertices.push(s)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,n=a.length-1;k<n;k++){b=p=k+c*g;d=p+c;var l=p+1+c,p=p+1,m=g*f,s=k*e,t=
+m+f,r=s+e;this.faces.push(new THREE.Face3(b,d,p));this.faceVertexUvs[0].push([new THREE.Vector2(m,s),new THREE.Vector2(t,s),new THREE.Vector2(m,r)]);this.faces.push(new THREE.Face3(d,l,p));this.faceVertexUvs[0].push([new THREE.Vector2(t,s),new THREE.Vector2(t,r),new THREE.Vector2(m,r)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
 THREE.PlaneGeometry=function(a,b,c,d){THREE.log("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var n=new Float32Array(g*h*2),p=0,m=0,r=0;r<h;r++)for(var t=r*l-f,s=0;s<g;s++)b[p]=s*k-e,b[p+1]=-t,a[p+2]=1,n[m]=s/c,n[m+1]=1-r/d,p+=3,m+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*d*6);for(r=0;r<d;r++)for(s=
-0;s<c;s++)f=s+g*(r+1),h=s+1+g*(r+1),k=s+1+g*r,e[p]=s+g*r,e[p+1]=f,e[p+2]=k,e[p+3]=f,e[p+4]=h,e[p+5]=k,p+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(n,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
-THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var n=new THREE.Vector3,p=e+g/c*f;n.x=k*Math.cos(p);n.y=k*Math.sin(p);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,
-(n.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=p=g+e,l=p+c+1,n=p+c+2,this.faces.push(new THREE.Face3(f,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]),f=p,l=p+c+2,n=p+1,this.faces.push(new THREE.Face3(f,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
+THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var p=new Float32Array(g*h*2),n=0,m=0,s=0;s<h;s++)for(var t=s*l-f,r=0;r<g;r++)b[n]=r*k-e,b[n+1]=-t,a[n+2]=1,p[m]=r/c,p[m+1]=1-s/d,n+=3,m+=2;n=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*d*6);for(s=0;s<d;s++)for(r=
+0;r<c;r++)f=r+g*(s+1),h=r+1+g*(s+1),k=r+1+g*s,e[n]=r+g*s,e[n+1]=f,e[n+2]=k,e[n+3]=f,e[n+4]=h,e[n+5]=k,n+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(p,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
+THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var p=new THREE.Vector3,n=e+g/c*f;p.x=k*Math.cos(n);p.y=k*Math.sin(n);this.vertices.push(p);h.push(new THREE.Vector2((p.x/b+1)/2,
+(p.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=n=g+e,l=n+c+1,p=n+c+2,this.faces.push(new THREE.Face3(f,l,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[p].clone()]),f=n,l=n+c+2,p=n+1,this.faces.push(new THREE.Face3(f,l,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[p].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
 THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;
-THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],n=[];for(k=0;k<=c;k++){var p=[],m=[];for(h=0;h<=b;h++){var r=h/b,t=k/c,s=new THREE.Vector3;s.x=-a*Math.cos(d+r*e)*Math.sin(f+t*g);
-s.y=a*Math.cos(f+t*g);s.z=a*Math.sin(d+r*e)*Math.sin(f+t*g);this.vertices.push(s);p.push(this.vertices.length-1);m.push(new THREE.Vector2(r,1-t))}l.push(p);n.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),r=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),s=n[k][h+1].clone(),u=n[k][h].clone(),v=n[k+1][h].clone(),x=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===
-a?(s.x=(s.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[p,r,t])),this.faceVertexUvs[0].push([s,v,x])):Math.abs(this.vertices[f].y)===a?(v.x=(v.x+x.x)/2,this.faces.push(new THREE.Face3(d,e,f,[p,m,r])),this.faceVertexUvs[0].push([s,u,v])):(this.faces.push(new THREE.Face3(d,e,g,[p,m,t])),this.faceVertexUvs[0].push([s,u,x]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),r,t.clone()])),this.faceVertexUvs[0].push([u.clone(),v,x.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
+THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],p=[];for(k=0;k<=c;k++){var n=[],m=[];for(h=0;h<=b;h++){var s=h/b,t=k/c,r=new THREE.Vector3;r.x=-a*Math.cos(d+s*e)*Math.sin(f+t*g);
+r.y=a*Math.cos(f+t*g);r.z=a*Math.sin(d+s*e)*Math.sin(f+t*g);this.vertices.push(r);n.push(this.vertices.length-1);m.push(new THREE.Vector2(s,1-t))}l.push(n);p.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var n=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),s=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),r=p[k][h+1].clone(),v=p[k][h].clone(),u=p[k+1][h].clone(),x=p[k+1][h+1].clone();Math.abs(this.vertices[d].y)===
+a?(r.x=(r.x+v.x)/2,this.faces.push(new THREE.Face3(d,f,g,[n,s,t])),this.faceVertexUvs[0].push([r,u,x])):Math.abs(this.vertices[f].y)===a?(u.x=(u.x+x.x)/2,this.faces.push(new THREE.Face3(d,e,f,[n,m,s])),this.faceVertexUvs[0].push([r,v,u])):(this.faces.push(new THREE.Face3(d,e,g,[n,m,t])),this.faceVertexUvs[0].push([r,v,x]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),s,t.clone()])),this.faceVertexUvs[0].push([v.clone(),u,x.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
 a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b);this.type="TextGeometry"};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
-THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var n=l/d*e,p=k/c*Math.PI*2;f.x=a*Math.cos(n);f.y=a*Math.sin(n);var m=new THREE.Vector3;m.x=(a+b*Math.cos(p))*Math.cos(n);m.y=(a+b*Math.cos(p))*Math.sin(n);m.z=b*Math.sin(p);this.vertices.push(m);g.push(new THREE.Vector2(l/
-d,k/c));h.push(m.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,n=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),n=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};
+THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var p=l/d*e,n=k/c*Math.PI*2;f.x=a*Math.cos(p);f.y=a*Math.sin(p);var m=new THREE.Vector3;m.x=(a+b*Math.cos(n))*Math.cos(p);m.y=(a+b*Math.cos(n))*Math.sin(p);m.z=b*Math.sin(n);this.vertices.push(m);g.push(new THREE.Vector2(l/
+d,k/c));h.push(m.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,p=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(p),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),p=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(p),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};
 THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
-THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=0;m<c;++m){k[m]=
-Array(d);var r=m/c*2*e*Math.PI,t=h(r,f,e,a,g),r=h(r+.01,f,e,a,g);l.subVectors(r,t);n.addVectors(r,t);p.crossVectors(l,n);n.crossVectors(p,l);p.normalize();n.normalize();for(r=0;r<d;++r){var s=r/d*2*Math.PI,u=-b*Math.cos(s),s=b*Math.sin(s),v=new THREE.Vector3;v.x=t.x+u*n.x+s*p.x;v.y=t.y+u*n.y+s*p.y;v.z=t.z+u*n.z+s*p.z;k[m][r]=this.vertices.push(v)-1}}for(m=0;m<c;++m)for(r=0;r<d;++r)e=(m+1)%c,f=(r+1)%d,a=k[m][r],b=k[e][r],e=k[e][f],f=k[m][f],g=new THREE.Vector2(m/c,r/d),l=new THREE.Vector2((m+1)/c,
-r/d),n=new THREE.Vector2((m+1)/c,(r+1)/d),p=new THREE.Vector2(m/c,(r+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,p]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),n,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
-THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,k,l=b+1,n,p,m,r,t,s=new THREE.Vector3,u,v,x;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);v=u.normals;x=u.binormals;this.tangents=u.tangents;this.normals=v;this.binormals=x;for(u=0;u<l;u++)for(g[u]=[],n=u/(l-1),t=a.getPointAt(n),h=v[u],k=x[u],m=c*f(n),n=0;n<d;n++)p=
-n/d*2*Math.PI,r=-m*Math.cos(p),p=m*Math.sin(p),s.copy(t),s.x+=r*h.x+p*k.x,s.y+=r*h.y+p*k.y,s.z+=r*h.z+p*k.z,g[u][n]=this.vertices.push(new THREE.Vector3(s.x,s.y,s.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)f=e?(u+1)%b:u+1,l=(n+1)%d,a=g[u][n],c=g[f][n],f=g[f][l],l=g[u][l],s=new THREE.Vector2(u/b,n/d),v=new THREE.Vector2((u+1)/b,n/d),x=new THREE.Vector2((u+1)/b,(n+1)/d),h=new THREE.Vector2(u/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([s,v,h]),this.faces.push(new THREE.Face3(c,
-f,l)),this.faceVertexUvs[0].push([v.clone(),x,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
-THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,p;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();f[0].crossVectors(e[0],
+THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),l=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3,m=0;m<c;++m){k[m]=
+Array(d);var s=m/c*2*e*Math.PI,t=h(s,f,e,a,g),s=h(s+.01,f,e,a,g);l.subVectors(s,t);p.addVectors(s,t);n.crossVectors(l,p);p.crossVectors(n,l);n.normalize();p.normalize();for(s=0;s<d;++s){var r=s/d*2*Math.PI,v=-b*Math.cos(r),r=b*Math.sin(r),u=new THREE.Vector3;u.x=t.x+v*p.x+r*n.x;u.y=t.y+v*p.y+r*n.y;u.z=t.z+v*p.z+r*n.z;k[m][s]=this.vertices.push(u)-1}}for(m=0;m<c;++m)for(s=0;s<d;++s)e=(m+1)%c,f=(s+1)%d,a=k[m][s],b=k[e][s],e=k[e][f],f=k[m][f],g=new THREE.Vector2(m/c,s/d),l=new THREE.Vector2((m+1)/c,
+s/d),p=new THREE.Vector2((m+1)/c,(s+1)/d),n=new THREE.Vector2(m/c,(s+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,n]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),p,n.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
+THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,k,l=b+1,p,n,m,s,t,r=new THREE.Vector3,v,u,x;v=new THREE.TubeGeometry.FrenetFrames(a,b,e);u=v.normals;x=v.binormals;this.tangents=v.tangents;this.normals=u;this.binormals=x;for(v=0;v<l;v++)for(g[v]=[],p=v/(l-1),t=a.getPointAt(p),h=u[v],k=x[v],m=c*f(p),p=0;p<d;p++)n=
+p/d*2*Math.PI,s=-m*Math.cos(n),n=m*Math.sin(n),r.copy(t),r.x+=s*h.x+n*k.x,r.y+=s*h.y+n*k.y,r.z+=s*h.z+n*k.z,g[v][p]=this.vertices.push(new THREE.Vector3(r.x,r.y,r.z))-1;for(v=0;v<b;v++)for(p=0;p<d;p++)f=e?(v+1)%b:v+1,l=(p+1)%d,a=g[v][p],c=g[f][p],f=g[f][l],l=g[v][l],r=new THREE.Vector2(v/b,p/d),u=new THREE.Vector2((v+1)/b,p/d),x=new THREE.Vector2((v+1)/b,(p+1)/d),h=new THREE.Vector2(v/b,(p+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([r,u,h]),this.faces.push(new THREE.Face3(c,
+f,l)),this.faceVertexUvs[0].push([u.clone(),x,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
+THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,p,n;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)p=l/(b-1),e[l]=a.getTangentAt(p),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);p=Math.abs(e[0].y);n=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));p<=a&&(a=p,d.set(0,1,0));n<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();f[0].crossVectors(e[0],
 h);g[0].crossVectors(e[0],f[0]);for(l=1;l<b;l++)f[l]=f[l-1].clone(),g[l]=g[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),f[l].applyMatrix4(k.makeRotationAxis(h,d))),g[l].crossVectors(e[l],f[l]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),l=1;l<b;l++)f[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),g[l].crossVectors(e[l],f[l])};
-THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);u.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(u.z,-u.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,
-b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],m=0;m<=c;m++){l[m]=[];for(var n=e(d.clone().lerp(h,m/c)),p=e(g.clone().lerp(h,m/c)),r=c-m,s=0;s<=r;s++)l[m][s]=0==s&&m==c?n:e(n.clone().lerp(p,s/r))}for(m=0;m<c;m++)for(s=0;s<2*(c-m)-1;s++)d=Math.floor(s/2),0==s%2?f(l[m][d+1],l[m+1][d],l[m][d]):f(l[m][d+1],l[m+1][d+1],l[m+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y));return a.clone()}
-THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,l=0,n=a.length;l<n;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var p=[],m=l=0,n=b.length;l<n;l+=3,m++){var r=a[b[l]],t=a[b[l+1]],s=a[b[l+2]];p[m]=new THREE.Face3(r.index,t.index,s.index,[r.clone(),t.clone(),s.clone()])}for(var u=new THREE.Vector3,l=0,n=p.length;l<n;l++)g(p[l],d);l=0;for(n=this.faceVertexUvs[0].length;l<n;l++)b=this.faceVertexUvs[0][l],
-d=b[0].x,a=b[1].x,p=b[2].x,m=Math.max(d,Math.max(a,p)),r=Math.min(d,Math.min(a,p)),.9<m&&.1>r&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));l=0;for(n=this.vertices.length;l<n;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
+THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);v.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(v.z,-v.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,
+b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],m=0;m<=c;m++){l[m]=[];for(var n=e(d.clone().lerp(h,m/c)),p=e(g.clone().lerp(h,m/c)),s=c-m,r=0;r<=s;r++)l[m][r]=0==r&&m==c?n:e(n.clone().lerp(p,r/s))}for(m=0;m<c;m++)for(r=0;r<2*(c-m)-1;r++)d=Math.floor(r/2),0==r%2?f(l[m][d+1],l[m+1][d],l[m][d]):f(l[m][d+1],l[m+1][d+1],l[m+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y));return a.clone()}
+THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,l=0,p=a.length;l<p;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var n=[],m=l=0,p=b.length;l<p;l+=3,m++){var s=a[b[l]],t=a[b[l+1]],r=a[b[l+2]];n[m]=new THREE.Face3(s.index,t.index,r.index,[s.clone(),t.clone(),r.clone()])}for(var v=new THREE.Vector3,l=0,p=n.length;l<p;l++)g(n[l],d);l=0;for(p=this.faceVertexUvs[0].length;l<p;l++)b=this.faceVertexUvs[0][l],
+d=b[0].x,a=b[1].x,n=b[2].x,m=Math.max(d,Math.max(a,n)),s=Math.min(d,Math.min(a,n)),.9<m&&.1>s&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>n&&(b[2].x+=1));l=0;for(p=this.vertices.length;l<p;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
 THREE.DodecahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,
 11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b)};THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry;
 THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b}};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b}};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
 THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b}};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;
-THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,n=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var p,m,r,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*n+h,d=g*n+h+1,l=(g+1)*n+h+1,k=(g+1)*n+h,p=new THREE.Vector2(h/b,g/c),m=new THREE.Vector2((h+1)/b,g/c),r=new THREE.Vector2((h+1)/b,(g+1)/c),t=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,
-d,k)),f.push([p,m,t]),e.push(new THREE.Face3(d,l,k)),f.push([m.clone(),r,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
-THREE.WireframeGeometry=function(a){THREE.BufferGeometry.call(this);var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c"];if(a instanceof THREE.Geometry){var f=a.vertices,g=a.faces,h=0,k=new Uint32Array(6*g.length);a=0;for(var l=g.length;a<l;a++)for(var n=g[a],p=0;3>p;p++){b[0]=n[e[p]];b[1]=n[e[(p+1)%3]];b.sort(d);var m=b.toString();void 0===c[m]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[m]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)h=f[k[2*a+p]],e=6*a+3*p,b[e+0]=h.x,b[e+1]=h.y,
-b[e+2]=h.z;this.addAttribute("position",new THREE.BufferAttribute(b,3))}else if(a instanceof THREE.BufferGeometry){if(void 0!==a.attributes.index){f=a.attributes.position.array;l=a.attributes.index.array;g=a.drawcalls;h=0;0===g.length&&(g=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),n=0,r=g.length;n<r;++n){p=g[n].start;m=g[n].count;e=g[n].index;a=p;for(var t=p+m;a<t;a+=3)for(p=0;3>p;p++)b[0]=e+l[a+p],b[1]=e+l[a+(p+1)%3],b.sort(d),m=b.toString(),void 0===c[m]&&(k[2*h]=
-b[0],k[2*h+1]=b[1],c[m]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)e=6*a+3*p,h=3*k[2*a+p],b[e+0]=f[h],b[e+1]=f[h+1],b[e+2]=f[h+2]}else for(f=a.attributes.position.array,h=f.length/3,k=h/3,b=new Float32Array(6*h),a=0,l=k;a<l;a++)for(p=0;3>p;p++)e=18*a+6*p,k=9*a+3*p,b[e+0]=f[k],b[e+1]=f[k+1],b[e+2]=f[k+2],h=9*a+(p+1)%3*3,b[e+3]=f[h],b[e+4]=f[h+1],b[e+5]=f[h+2];this.addAttribute("position",new THREE.BufferAttribute(b,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
+THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,p=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var n,m,s,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*p+h,d=g*p+h+1,l=(g+1)*p+h+1,k=(g+1)*p+h,n=new THREE.Vector2(h/b,g/c),m=new THREE.Vector2((h+1)/b,g/c),s=new THREE.Vector2((h+1)/b,(g+1)/c),t=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,
+d,k)),f.push([n,m,t]),e.push(new THREE.Face3(d,l,k)),f.push([m.clone(),s,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
+THREE.WireframeGeometry=function(a){THREE.BufferGeometry.call(this);var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c"];if(a instanceof THREE.Geometry){var f=a.vertices,g=a.faces,h=0,k=new Uint32Array(6*g.length);a=0;for(var l=g.length;a<l;a++)for(var p=g[a],n=0;3>n;n++){b[0]=p[e[n]];b[1]=p[e[(n+1)%3]];b.sort(d);var m=b.toString();void 0===c[m]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[m]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(n=0;2>n;n++)h=f[k[2*a+n]],e=6*a+3*n,b[e+0]=h.x,b[e+1]=h.y,
+b[e+2]=h.z;this.addAttribute("position",new THREE.BufferAttribute(b,3))}else if(a instanceof THREE.BufferGeometry){if(void 0!==a.attributes.index){f=a.attributes.position.array;l=a.attributes.index.array;g=a.drawcalls;h=0;0===g.length&&(g=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),p=0,s=g.length;p<s;++p){n=g[p].start;m=g[p].count;e=g[p].index;a=n;for(var t=n+m;a<t;a+=3)for(n=0;3>n;n++)b[0]=e+l[a+n],b[1]=e+l[a+(n+1)%3],b.sort(d),m=b.toString(),void 0===c[m]&&(k[2*h]=
+b[0],k[2*h+1]=b[1],c[m]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(n=0;2>n;n++)e=6*a+3*n,h=3*k[2*a+n],b[e+0]=f[h],b[e+1]=f[h+1],b[e+2]=f[h+2]}else for(f=a.attributes.position.array,h=f.length/3,k=h/3,b=new Float32Array(6*h),a=0,l=k;a<l;a++)for(n=0;3>n;n++)e=18*a+6*n,k=9*a+3*n,b[e+0]=f[k],b[e+1]=f[k+1],b[e+2]=f[k+2],h=9*a+(n+1)%3*3,b[e+3]=f[h],b[e+4]=f[h+1],b[e+5]=f[h+2];this.addAttribute("position",new THREE.BufferAttribute(b,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
 THREE.WireframeGeometry.prototype.constructor=THREE.WireframeGeometry;THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry;a.addAttribute("position",new THREE.BufferAttribute(b,3));a.addAttribute("color",new THREE.BufferAttribute(c,3));b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,a,b,THREE.LinePieces)};
 THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);THREE.AxisHelper.prototype.constructor=THREE.AxisHelper;
 THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0));return function(c,d,e,f,g,h){THREE.Object3D.call(this);void 0===f&&(f=16776960);void 0===e&&(e=1);void 0===g&&(g=.2*e);void 0===h&&(h=.2*g);this.position.copy(d);this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f}));this.line.matrixAutoUpdate=!1;this.add(this.line);
@@ -848,11 +848,11 @@ THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper;THREE.SpotLigh
 THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1E4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();
 THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:16711680;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexNormals.length;g<h;g++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper;
-THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var n=f[k],p=0,m=n.vertexNormals.length;p<m;p++){var r=n.vertexNormals[p];d[h].copy(e[n[a[p]]]).applyMatrix4(g);b.copy(r).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
+THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var p=f[k],n=0,m=p.vertexNormals.length;n<m;n++){var s=p.vertexNormals[n];d[h].copy(e[p[a[n]]]).applyMatrix4(g);b.copy(s).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
 b.add(d[h]);h+=1;d[h].copy(b);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();
 THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:255;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexTangents.length;g<h;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.update()};THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper;
-THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var n=f[k],p=0,m=n.vertexTangents.length;p<m;p++){var r=n.vertexTangents[p];d[h].copy(e[n[a[p]]]).applyMatrix4(g);b.copy(r).transformDirection(g).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
+THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var p=f[k],n=0,m=p.vertexTangents.length;n<m;n++){var s=p.vertexTangents[n];d[h].copy(e[p[a[n]]]).applyMatrix4(g);b.copy(s).transformDirection(g).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
 h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215;THREE.Line.call(this,new THREE.WireframeGeometry(a.geometry),new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper;
 THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};
 THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh;THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=b;this.animationsList.push(b)};

Vissa filer visades inte eftersom för många filer har ändrats