Mr.doob 10 rokov pred
rodič
commit
c90e7a7e99
2 zmenil súbory, kde vykonal 321 pridanie a 327 odobranie
  1. 0 6
      build/three.js
  2. 321 321
      build/three.min.js

+ 0 - 6
build/three.js

@@ -21515,12 +21515,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 				var geometryGroup = geometryGroupsList[ i ];
 				var material = getBufferMaterial( object, geometryGroup );
 
-				if ( geometry.groupsNeedUpdate === true ) {
-
-					initMeshBuffers( geometryGroup, object );
-
-				}
-
 				var customAttributesDirty = material.attributes && areCustomAttributesDirty( material );
 
 				if ( geometry.verticesNeedUpdate || geometry.morphTargetsNeedUpdate || geometry.elementsNeedUpdate ||

+ 321 - 321
build/three.min.js

@@ -22,10 +22,10 @@ tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,_x:0,_y:0,_z:0,_w:0,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 w(){return this._w},set w(a){this._w=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onChangeCallback();return this},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;
 this._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,b){if(!1===a instanceof THREE.Euler)throw Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var c=Math.cos(a._x/2),d=Math.cos(a._y/2),e=Math.cos(a._z/2),f=Math.sin(a._x/2),g=Math.sin(a._y/2),h=Math.sin(a._z/2);"XYZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"YXZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=
 c*d*h-f*g*e,this._w=c*d*e+f*g*h):"ZXY"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"ZYX"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"YZX"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e-f*g*h):"XZY"===a.order&&(this._x=f*d*e-c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e+f*g*h);if(!1!==b)this.onChangeCallback();return this},setFromAxisAngle:function(a,
-b){var c=b/2,d=Math.sin(c);this._x=a.x*d;this._y=a.y*d;this._z=a.z*d;this._w=Math.cos(c);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],k=b[6],b=b[10],n=c+f+b;0<n?(c=.5/Math.sqrt(n+1),this._w=.25/c,this._x=(k-g)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=
+b){var c=b/2,d=Math.sin(c);this._x=a.x*d;this._y=a.y*d;this._z=a.z*d;this._w=Math.cos(c);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],k=b[6],b=b[10],p=c+f+b;0<p?(c=.5/Math.sqrt(p+1),this._w=.25/c,this._x=(k-g)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=
 .25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*=
 -1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this},
-multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,n=b._w;this._x=c*n+f*g+d*k-e*h;this._y=d*n+f*h+e*g-c*k;this._z=e*n+f*k+c*h-d*g;this._w=f*n-c*g-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");
+multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,p=b._w;this._x=c*p+f*g+d*k-e*h;this._y=d*p+f*h+e*g-c*k;this._z=e*p+f*k+c*h-d*g;this._w=f*p-c*g-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");
 return a.applyQuaternion(this)},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(.001>Math.abs(k))return this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h=
 Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x=c*g+this._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},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];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._w;return a},onChange:function(a){this.onChangeCallback=
 a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
@@ -41,7 +41,7 @@ a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:functio
 this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=
 a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===b instanceof THREE.Euler&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.");void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromEuler(b));return this}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromAxisAngle(b,c));return this}}(),applyMatrix3:function(a){var b=this.x,
 c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14];return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=
-(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,n=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-n*-f;this.y=k*a+b*-f+n*-e-h*-g;this.z=n*a+b*-g+h*-f-k*-e;return this},project:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyProjection(a)}}(),unproject:function(){var a;return function(b){void 0===
+(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,p=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-p*-f;this.y=k*a+b*-f+p*-e-h*-g;this.z=p*a+b*-g+h*-f-k*-e;return this},project:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyProjection(a)}}(),unproject:function(){var a;return function(b){void 0===
 a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix));return this.applyProjection(a)}}(),transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x>
 a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);this.z<a.z&&(this.z=a.z);return this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=b.z);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a,
 b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);
@@ -57,8 +57,8 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=
 case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},
 addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b=
 this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1);return this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this},
-setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var n=a[10];if(.01>Math.abs(d-g)&&.01>Math.abs(f-c)&&.01>Math.abs(k-b)){if(.1>Math.abs(d+g)&&.1>Math.abs(f+c)&&.1>Math.abs(k+b)&&.1>Math.abs(e+h+n-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;n=(n+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>n?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>n?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h),
-b=d/c,d=k/c):.01>n?(c=b=.707106781,d=0):(d=Math.sqrt(n),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+n-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);this.z<a.z&&(this.z=a.z);this.w<a.w&&(this.w=a.w);
+setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var p=a[10];if(.01>Math.abs(d-g)&&.01>Math.abs(f-c)&&.01>Math.abs(k-b)){if(.1>Math.abs(d+g)&&.1>Math.abs(f+c)&&.1>Math.abs(k+b)&&.1>Math.abs(e+h+p-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;p=(p+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>p?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>p?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h),
+b=d/c,d=k/c):.01>p?(c=b=.707106781,d=0):(d=Math.sqrt(p),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+p-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);this.z<a.z&&(this.z=a.z);this.w<a.w&&(this.w=a.w);
 return this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=b.z);this.w<a.w?this.w=a.w:this.w>b.w&&(this.w=b.w);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);
 return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);
 return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},
@@ -66,9 +66,9 @@ setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b)
 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],n=e[9],p=e[2],q=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(-n,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(n,-1,1)),.99999>Math.abs(n)?(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(q,-1,1)),.99999>Math.abs(q)?(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(q,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(-n,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(q,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-n,e),this._y=0)):console.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],p=e[9],n=e[2],q=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(-p,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(p,-1,1)),.99999>Math.abs(p)?(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(q,-1,1)),.99999>Math.abs(q)?(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(q,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(-p,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(q,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-p,e),this._y=0)):console.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,
@@ -87,38 +87,38 @@ this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.
 new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y,
 this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b);a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);
 this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}};THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]);0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")};
-THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,g,h,k){var n=this.elements;n[0]=a;n[3]=b;n[6]=c;n[1]=d;n[4]=e;n[7]=f;n[2]=g;n[5]=h;n[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)},
+THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,g,h,k){var p=this.elements;p[0]=a;p[3]=b;p[6]=c;p[1]=d;p[4]=e;p[7]=f;p[2]=g;p[5]=h;p[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)},
 multiplyVector3Array:function(a){console.warn("THREE.Matrix3: .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.applyMatrix3(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[3]*=a;b[6]*=
 a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],k=a[7],a=a[8];return b*f*a-b*g*k-c*e*a+c*g*h+d*e*k-d*f*h},getInverse:function(a,b){var c=a.elements,d=this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-c[1]*c[4];
 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");console.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&&console.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,n,p,q,m,t,s,r){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]=n;u[10]=p;u[14]=q;u[3]=m;u[7]=t;u[11]=s;u[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){console.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,p,n,q,m,s,t,r){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]=p;u[10]=n;u[14]=q;u[3]=m;u[7]=s;u[11]=t;u[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){console.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&&console.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,n=c*h,p=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+n*d;b[5]=a-p*d;b[9]=-c*g;b[2]=p-a*d;b[6]=n+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,n=d*h,p=d*e,b[0]=a+p*c,b[4]=n*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-n,b[6]=p+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,n=d*h,p=d*e,b[0]=a-p*c,b[4]=-f*e,b[8]=n+k*c,b[1]=k+n*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,n=c*h,p=c*e,b[0]=g*h,b[4]=n*d-k,b[8]=a*d+p,b[1]=g*e,b[5]=p*d+a,b[9]=k*d-n,b[2]=-d,b[6]=c*g,b[10]=f*g):
-"YZX"===a.order?(a=f*g,k=f*d,n=c*g,p=c*d,b[0]=g*h,b[4]=p-a*e,b[8]=n*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+n,b[10]=a-p*e):"XZY"===a.order&&(a=f*g,k=f*d,n=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-n,b[2]=n*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){console.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 n=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]=n-f;b[8]=c+h;b[1]=n+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,
+e,p=c*h,n=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+p*d;b[5]=a-n*d;b[9]=-c*g;b[2]=n-a*d;b[6]=p+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,p=d*h,n=d*e,b[0]=a+n*c,b[4]=p*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-p,b[6]=n+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,p=d*h,n=d*e,b[0]=a-n*c,b[4]=-f*e,b[8]=p+k*c,b[1]=k+p*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,p=c*h,n=c*e,b[0]=g*h,b[4]=p*d-k,b[8]=a*d+n,b[1]=g*e,b[5]=n*d+a,b[9]=k*d-p,b[2]=-d,b[6]=c*g,b[10]=f*g):
+"YZX"===a.order?(a=f*g,k=f*d,p=c*g,n=c*d,b[0]=g*h,b[4]=n-a*e,b[8]=p*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+p,b[10]=a-n*e):"XZY"===a.order&&(a=f*g,k=f*d,p=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-p,b[2]=p*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){console.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 p=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]=p-f;b[8]=c+h;b[1]=p+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,
 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?(console.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],n=c[1],p=c[5],q=c[9],m=c[13],t=c[2],s=c[6],r=c[10],u=c[14],v=c[3],y=c[7],E=c[11],c=c[15],x=d[0],O=d[4],z=d[8],F=d[12],D=d[1],A=d[5],w=d[9],B=d[13],K=d[2],L=d[6],H=d[10],T=d[14],N=d[3],V=d[7],R=d[11],d=d[15];e[0]=f*x+g*D+h*K+k*N;e[4]=f*O+g*A+h*L+k*V;e[8]=f*z+g*w+h*H+k*R;e[12]=f*F+g*B+h*T+k*d;e[1]=n*x+p*D+q*K+m*N;e[5]=n*O+p*A+q*L+m*V;e[9]=n*z+p*w+q*H+m*R;e[13]=n*F+p*B+q*T+m*d;e[2]=t*x+s*D+r*K+u*N;e[6]=t*O+s*A+r*L+u*V;e[10]=t*z+s*w+r*H+u*R;e[14]=t*F+s*B+r*T+u*d;e[3]=v*x+y*D+E*K+c*N;e[7]=v*O+
-y*A+E*L+c*V;e[11]=v*z+y*w+E*H+c*R;e[15]=v*F+y*B+E*T+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],p=c[1],n=c[5],q=c[9],m=c[13],s=c[2],t=c[6],r=c[10],u=c[14],v=c[3],x=c[7],C=c[11],c=c[15],w=d[0],y=d[4],A=d[8],F=d[12],G=d[1],E=d[5],z=d[9],M=d[13],J=d[2],K=d[6],L=d[10],T=d[14],P=d[3],N=d[7],Q=d[11],d=d[15];e[0]=f*w+g*G+h*J+k*P;e[4]=f*y+g*E+h*K+k*N;e[8]=f*A+g*z+h*L+k*Q;e[12]=f*F+g*M+h*T+k*d;e[1]=p*w+n*G+q*J+m*P;e[5]=p*y+n*E+q*K+m*N;e[9]=p*A+n*z+q*L+m*Q;e[13]=p*F+n*M+q*T+m*d;e[2]=s*w+t*G+r*J+u*P;e[6]=s*y+t*E+r*K+u*N;e[10]=s*A+t*z+r*L+u*Q;e[14]=s*F+t*M+r*T+u*d;e[3]=v*w+x*G+C*J+c*P;e[7]=v*y+
+x*E+C*K+c*N;e[11]=v*A+x*z+C*L+c*Q;e[15]=v*F+x*M+C*T+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){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.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){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.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],n=a[2],p=a[6],q=a[10],m=a[14];return a[3]*(+e*h*p-d*k*p-e*g*q+c*k*q+d*g*m-c*h*m)+a[7]*(+b*h*m-b*k*q+e*f*q-d*f*m+d*k*n-e*h*n)+a[11]*(+b*k*p-b*g*m-e*f*p+c*f*m+e*g*n-c*k*n)+a[15]*(-d*g*n-b*h*p+b*g*q+d*f*p-c*f*q+c*h*n)},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],p=a[2],n=a[6],q=a[10],m=a[14];return a[3]*(+e*h*n-d*k*n-e*g*q+c*k*q+d*g*m-c*h*m)+a[7]*(+b*h*m-b*k*q+e*f*q-d*f*m+d*k*p-e*h*p)+a[11]*(+b*k*n-b*g*m-e*f*n+c*f*m+e*g*p-c*k*p)+a[15]*(-d*g*p-b*h*n+b*g*q+d*f*n-c*f*q+c*h*p)},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(){console.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],n=d[5],p=d[9],q=d[13],m=d[2],t=d[6],s=d[10],r=d[14],u=d[3],v=d[7],y=d[11],d=d[15];c[0]=p*r*v-q*s*v+q*t*y-n*r*y-p*t*d+n*s*d;c[4]=h*s*v-g*r*v-h*t*y+f*r*y+g*t*d-f*s*d;c[8]=g*q*v-h*p*v+h*n*y-f*q*y-g*n*d+f*p*d;c[12]=h*p*t-g*q*t-h*n*s+f*q*s+g*n*r-f*p*r;c[1]=q*s*u-p*r*u-q*m*y+
-k*r*y+p*m*d-k*s*d;c[5]=g*r*u-h*s*u+h*m*y-e*r*y-g*m*d+e*s*d;c[9]=h*p*u-g*q*u-h*k*y+e*q*y+g*k*d-e*p*d;c[13]=g*q*m-h*p*m+h*k*s-e*q*s-g*k*r+e*p*r;c[2]=n*r*u-q*t*u+q*m*v-k*r*v-n*m*d+k*t*d;c[6]=h*t*u-f*r*u-h*m*v+e*r*v+f*m*d-e*t*d;c[10]=f*q*u-h*n*u+h*k*v-e*q*v-f*k*d+e*n*d;c[14]=h*n*m-f*q*m-h*k*t+e*q*t+f*k*r-e*n*r;c[3]=p*t*u-n*s*u-p*m*v+k*s*v+n*m*y-k*t*y;c[7]=f*s*u-g*t*u+g*m*v-e*s*v-f*m*y+e*t*y;c[11]=g*n*u-f*p*u-g*k*v+e*p*v+f*k*y-e*n*y;c[15]=f*p*m-g*n*m+g*k*t-e*p*t-f*k*s+e*n*s;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],p=d[5],n=d[9],q=d[13],m=d[2],s=d[6],t=d[10],r=d[14],u=d[3],v=d[7],x=d[11],d=d[15];c[0]=n*r*v-q*t*v+q*s*x-p*r*x-n*s*d+p*t*d;c[4]=h*t*v-g*r*v-h*s*x+f*r*x+g*s*d-f*t*d;c[8]=g*q*v-h*n*v+h*p*x-f*q*x-g*p*d+f*n*d;c[12]=h*n*s-g*q*s-h*p*t+f*q*t+g*p*r-f*n*r;c[1]=q*t*u-n*r*u-q*m*x+
+k*r*x+n*m*d-k*t*d;c[5]=g*r*u-h*t*u+h*m*x-e*r*x-g*m*d+e*t*d;c[9]=h*n*u-g*q*u-h*k*x+e*q*x+g*k*d-e*n*d;c[13]=g*q*m-h*n*m+h*k*t-e*q*t-g*k*r+e*n*r;c[2]=p*r*u-q*s*u+q*m*v-k*r*v-p*m*d+k*s*d;c[6]=h*s*u-f*r*u-h*m*v+e*r*v+f*m*d-e*s*d;c[10]=f*q*u-h*p*u+h*k*v-e*q*v-f*k*d+e*p*d;c[14]=h*p*m-f*q*m-h*k*s+e*q*s+f*k*r-e*p*r;c[3]=n*s*u-p*t*u-n*m*v+k*t*v+p*m*x-k*s*x;c[7]=f*t*u-g*s*u+g*m*v-e*t*v-f*m*x+e*s*x;c[11]=g*p*u-f*n*u-g*k*v+e*n*v+f*k*x-e*p*x;c[15]=f*n*m-g*p*m+g*k*s-e*n*s-f*k*t+e*p*t;c=e*c[0]+k*c[4]+m*c[8]+u*c[12];
 if(0==c){if(b)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("Matrix4.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.warn("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){console.warn("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){console.warn("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){console.warn("THREE.Matrix4: .rotateZ() has been removed.")},
 rotateByAxis:function(a,b){console.warn("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,n=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*
-g+d*h,n*g+c,n*h-d*f,0,k*h-d*g,n*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},compose:function(a,b,c){this.makeRotationFromQuaternion(b);this.scale(c);this.setPosition(a);return this},decompose:function(){var a=new THREE.Vector3,b=new THREE.Matrix4;return function(c,d,e){var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),k=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g);c.x=f[12];
-c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,n=1/k;b.elements[0]*=c;b.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=n;b.elements[9]*=n;b.elements[10]*=n;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;
-g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a));var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,k=c-d,n=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/k;g[9]=0;g[13]=-((c+d)/k);g[2]=0;g[6]=0;g[10]=-2/n;g[14]=-((f+e)/n);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[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,p=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*
+g+d*h,p*g+c,p*h-d*f,0,k*h-d*g,p*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},compose:function(a,b,c){this.makeRotationFromQuaternion(b);this.scale(c);this.setPosition(a);return this},decompose:function(){var a=new THREE.Vector3,b=new THREE.Matrix4;return function(c,d,e){var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),k=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g);c.x=f[12];
+c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,p=1/k;b.elements[0]*=c;b.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=p;b.elements[9]*=p;b.elements[10]*=p;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;
+g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a));var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,k=c-d,p=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/k;g[9]=0;g[13]=-((c+d)/k);g[2]=0;g[6]=0;g[10]=-2/p;g[14]=-((f+e)/p);g[3]=0;g[7]=0;g[11]=0;g[15]=1;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],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),n=c.dot(this.direction),p=-c.dot(b),q=c.lengthSq(),m=Math.abs(1-k*k),t;0<m?(d=k*p-n,e=k*n-p,t=h*m,0<=d?e>=-t?e<=t?(h=1/m,d*=h,e*=h,k=d*(d+k*e+2*n)+e*(k*d+e+2*p)+q):(e=h,d=Math.max(0,-(k*e+n)),k=-d*d+e*(e+2*p)+q):(e=-h,d=Math.max(0,-(k*e+n)),k=-d*d+e*(e+2*p)+q):e<=-t?(d=Math.max(0,-(-k*h+n)),e=0<d?-h:Math.min(Math.max(-h,-p),h),k=-d*d+e*(e+2*p)+q):e<=t?(d=0,e=Math.min(Math.max(-h,-p),h),k=e*(e+
-2*p)+q):(d=Math.max(0,-(k*h+n)),e=0<d?h:Math.min(Math.max(-h,-p),h),k=-d*d+e*(e+2*p)+q)):(e=0<k?-h:h,d=Math.max(0,-(k*e+n)),k=-d*d+e*(e+2*p)+q);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),p=c.dot(this.direction),n=-c.dot(b),q=c.lengthSq(),m=Math.abs(1-k*k),s;0<m?(d=k*n-p,e=k*p-n,s=h*m,0<=d?e>=-s?e<=s?(h=1/m,d*=h,e*=h,k=d*(d+k*e+2*p)+e*(k*d+e+2*n)+q):(e=h,d=Math.max(0,-(k*e+p)),k=-d*d+e*(e+2*n)+q):(e=-h,d=Math.max(0,-(k*e+p)),k=-d*d+e*(e+2*n)+q):e<=-s?(d=Math.max(0,-(-k*h+p)),e=0<d?-h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+q):e<=s?(d=0,e=Math.min(Math.max(-h,-n),h),k=e*(e+
+2*n)+q):(d=Math.max(0,-(k*h+p)),e=0<d?h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+q)):(e=0<k?-h:h,d=Math.max(0,-(k*e+p)),k=-d*d+e*(e+2*n)+q);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));
@@ -127,8 +127,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],n=c[7],p=c[8],q=c[9],m=c[10],t=c[11],s=c[12],r=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,n-g,t-p,c-s).normalize();b[1].setComponents(f+
-a,n+g,t+p,c+s).normalize();b[2].setComponents(f+d,n+h,t+q,c+r).normalize();b[3].setComponents(f-d,n-h,t-q,c-r).normalize();b[4].setComponents(f-e,n-k,t-m,c-u).normalize();b[5].setComponents(f+e,n+k,t+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],p=c[7],n=c[8],q=c[9],m=c[10],s=c[11],t=c[12],r=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,p-g,s-n,c-t).normalize();b[1].setComponents(f+
+a,p+g,s+n,c+t).normalize();b[2].setComponents(f+d,p+h,s+q,c+r).normalize();b[3].setComponents(f-d,p-h,s-q,c-r).normalize();b[4].setComponents(f-e,p-k,s-m,c-u).normalize();b[5].setComponents(f+e,p+k,s+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,
 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,
@@ -139,11 +139,11 @@ 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}};
-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,n,p,q,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;n=this.points[c[0]];p=this.points[c[1]];q=this.points[c[2]];m=this.points[c[3]];h=g*g;k=g*h;d.x=b(n.x,p.x,q.x,m.x,g,h,k);d.y=b(n.y,p.y,q.y,m.y,g,h,k);d.z=b(n.z,p.z,q.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,p,n,q,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;p=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];m=this.points[c[3]];h=g*g;k=g*h;d.x=b(p.x,n.x,q.x,m.x,g,h,k);d.y=b(p.y,n.y,q.y,m.y,g,h,k);d.z=b(p.z,n.z,q.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 n=d*k-e*e;h=h||new THREE.Vector3;if(0==n)return h.set(-2,-1,-1);n=1/n;k=(k*f-e*g)*n;d=(d*g-e*f)*n;return h.set(1-k-d,d,k)}}();
+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 p=d*k-e*e;h=h||new THREE.Vector3;if(0==p)return h.set(-2,-1,-1);p=1/p;k=(k*f-e*g)*p;d=(d*g-e*f)*p;return h.set(1-k-d,d,k)}}();
 THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}();
 THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),midpoint:function(a){return(a||
 new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)},
@@ -184,44 +184,44 @@ THREE.Uint32Attribute=function(a,b){console.warn("THREE.Uint32Attribute has been
 THREE.Float64Attribute=function(a,b){console.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.DynamicBufferAttribute=function(a,b){THREE.BufferAttribute.call(this,a,b);this.updateRange={offset:0,count:-1}};THREE.DynamicBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.DynamicBufferAttribute.prototype.constructor=THREE.DynamicBufferAttribute;
 THREE.DynamicBufferAttribute.prototype.clone=function(){return new THREE.DynamicBufferAttribute(new this.array.constructor(this.array),this.itemSize)};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?(console.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)},center:function(){},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 n=
-new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(n,3));if(f!==THREE.NoColors){var p=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(p,3))}if(!0===g){var q=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(q,2))}for(var m=0,t=0,s=0;m<d.length;m++,t+=6,s+=9){var r=d[m],u=c[r.a],v=c[r.b],y=c[r.c];k[s]=u.x;k[s+1]=u.y;k[s+2]=u.z;k[s+3]=v.x;k[s+4]=v.y;k[s+5]=v.z;k[s+6]=y.x;k[s+7]=y.y;k[s+8]=y.z;!0===h?(u=r.vertexNormals[0],
-v=r.vertexNormals[1],y=r.vertexNormals[2],n[s]=u.x,n[s+1]=u.y,n[s+2]=u.z,n[s+3]=v.x,n[s+4]=v.y,n[s+5]=v.z,n[s+6]=y.x,n[s+7]=y.y,n[s+8]=y.z):(u=r.normal,n[s]=u.x,n[s+1]=u.y,n[s+2]=u.z,n[s+3]=u.x,n[s+4]=u.y,n[s+5]=u.z,n[s+6]=u.x,n[s+7]=u.y,n[s+8]=u.z);f===THREE.FaceColors?(r=r.color,p[s]=r.r,p[s+1]=r.g,p[s+2]=r.b,p[s+3]=r.r,p[s+4]=r.g,p[s+5]=r.b,p[s+6]=r.r,p[s+7]=r.g,p[s+8]=r.b):f===THREE.VertexColors&&(u=r.vertexColors[0],v=r.vertexColors[1],r=r.vertexColors[2],p[s]=u.r,p[s+1]=u.g,p[s+2]=u.b,p[s+3]=
-v.r,p[s+4]=v.g,p[s+5]=v.b,p[s+6]=r.r,p[s+7]=r.g,p[s+8]=r.b);!0===g&&(r=e[0][m][0],u=e[0][m][1],v=e[0][m][2],q[t]=r.x,q[t+1]=r.y,q[t+2]=u.x,q[t+3]=u.y,q[t+4]=v.x,q[t+5]=v.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===
+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)},center:function(){},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 p=
+new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(p,3));if(f!==THREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(n,3))}if(!0===g){var q=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(q,2))}for(var m=0,s=0,t=0;m<d.length;m++,s+=6,t+=9){var r=d[m],u=c[r.a],v=c[r.b],x=c[r.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=r.vertexNormals[0],
+v=r.vertexNormals[1],x=r.vertexNormals[2],p[t]=u.x,p[t+1]=u.y,p[t+2]=u.z,p[t+3]=v.x,p[t+4]=v.y,p[t+5]=v.z,p[t+6]=x.x,p[t+7]=x.y,p[t+8]=x.z):(u=r.normal,p[t]=u.x,p[t+1]=u.y,p[t+2]=u.z,p[t+3]=u.x,p[t+4]=u.y,p[t+5]=u.z,p[t+6]=u.x,p[t+7]=u.y,p[t+8]=u.z);f===THREE.FaceColors?(r=r.color,n[t]=r.r,n[t+1]=r.g,n[t+2]=r.b,n[t+3]=r.r,n[t+4]=r.g,n[t+5]=r.b,n[t+6]=r.r,n[t+7]=r.g,n[t+8]=r.b):f===THREE.VertexColors&&(u=r.vertexColors[0],v=r.vertexColors[1],r=r.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]=r.r,n[t+7]=r.g,n[t+8]=r.b);!0===g&&(r=e[0][m][0],u=e[0][m][1],v=e[0][m][2],q[s]=r.x,q[s+1]=r.y,q[s+2]=u.x,q[s+3]=u.y,q[s+4]=v.x,q[s+5]=v.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))&&console.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)&&console.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,n=new THREE.Vector3,p=new THREE.Vector3,q=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var t=a.index.array,s=0<this.offsets.length?this.offsets:[{start:0,count:t.length,index:0}],r=0,u=s.length;r<u;++r){e=s[r].start;f=s[r].count;
-for(var v=s[r].index,d=e,e=e+f;d<e;d+=3)f=3*(v+t[d]),g=3*(v+t[d+1]),h=3*(v+t[d+2]),k.fromArray(b,f),n.fromArray(b,g),p.fromArray(b,h),q.subVectors(p,n),m.subVectors(k,n),q.cross(m),c[f]+=q.x,c[f+1]+=q.y,c[f+2]+=q.z,c[g]+=q.x,c[g+1]+=q.y,c[g+2]+=q.z,c[h]+=q.x,c[h+1]+=q.y,c[h+2]+=q.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),n.fromArray(b,d+3),p.fromArray(b,d+6),q.subVectors(p,n),m.subVectors(k,n),q.cross(m),c[d]=q.x,c[d+1]=q.y,c[d+2]=q.z,c[d+3]=q.x,c[d+4]=q.y,c[d+5]=q.z,c[d+6]=q.x,c[d+7]=q.y,
-c[d+8]=q.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q.fromArray(d,3*a);m.fromArray(d,3*b);t.fromArray(d,3*c);s.fromArray(f,2*a);r.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-q.x;y=t.x-q.x;E=m.y-q.y;x=t.y-q.y;O=m.z-q.z;z=t.z-q.z;F=r.x-s.x;D=u.x-s.x;A=r.y-s.y;w=u.y-s.y;B=1/(F*w-D*A);K.set((w*v-A*y)*B,(w*E-A*x)*B,(w*O-A*z)*B);L.set((F*y-D*v)*B,(F*x-D*E)*B,(F*z-D*O)*B);k[a].add(K);k[b].add(K);k[c].add(K);n[a].add(L);n[b].add(L);n[c].add(L)}function b(a){ta.fromArray(e,
-3*a);P.copy(ta);pa=k[a];oa.copy(pa);oa.sub(ta.multiplyScalar(ta.dot(pa))).normalize();aa.crossVectors(P,pa);Xa=aa.dot(n[a]);Ca=0>Xa?-1:1;h[4*a]=oa.x;h[4*a+1]=oa.y;h[4*a+2]=oa.z;h[4*a+3]=Ca}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("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=[],n=[],p=0;p<g;p++)k[p]=new THREE.Vector3,n[p]=new THREE.Vector3;var q=new THREE.Vector3,m=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,v,y,E,x,O,z,F,D,A,w,B,K=new THREE.Vector3,L=new THREE.Vector3,H,T,N,V,R;0===this.drawcalls.length&&
-this.addDrawCall(0,c.length,0);var J=this.drawcalls,p=0;for(T=J.length;p<T;++p){H=J[p].start;N=J[p].count;var S=J[p].index,g=H;for(H+=N;g<H;g+=3)N=S+c[g],V=S+c[g+1],R=S+c[g+2],a(N,V,R)}var oa=new THREE.Vector3,aa=new THREE.Vector3,ta=new THREE.Vector3,P=new THREE.Vector3,Ca,pa,Xa,p=0;for(T=J.length;p<T;++p)for(H=J[p].start,N=J[p].count,S=J[p].index,g=H,H+=N;g<H;g+=3)N=S+c[g],V=S+c[g+1],R=S+c[g+2],b(N),b(V),b(R)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;
-for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],n=0,p=0,q=new Int32Array(6),m=new Int32Array(c.length),t=new Int32Array(c.length),s=0;s<c.length;s++)m[s]=-1,t[s]=-1;for(c=0;c<d;c++){for(var r=p=0;3>r;r++)s=a[3*c+r],-1==m[s]?(q[2*r]=s,q[2*r+1]=-1,p++):m[s]<k.index?(q[2*r]=s,q[2*r+1]=-1,n++):(q[2*r]=s,q[2*r+1]=m[s]);if(g+p>k.index+b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)r=q[p+1],-1<r&&r<k.index&&(q[p+1]=
--1);for(p=0;6>p;p+=2)s=q[p],r=q[p+1],-1===r&&(r=g++),m[s]=r,t[r]=s,e[f++]=r-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.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,n=d[e],p=0;p<k;p++)n[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,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},b=this.attributes,c=this.offsets,d=this.boundingSphere,e;for(e in b){for(var f=b[e],g=[],h=f.array,k=0,n=h.length;k<n;k++)g[k]=h[k];a.data.attributes[e]={itemSize:f.itemSize,type:f.array.constructor.name,
+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,p=new THREE.Vector3,n=new THREE.Vector3,q=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,u=t.length;r<u;++r){e=t[r].start;f=t[r].count;
+for(var v=t[r].index,d=e,e=e+f;d<e;d+=3)f=3*(v+s[d]),g=3*(v+s[d+1]),h=3*(v+s[d+2]),k.fromArray(b,f),p.fromArray(b,g),n.fromArray(b,h),q.subVectors(n,p),m.subVectors(k,p),q.cross(m),c[f]+=q.x,c[f+1]+=q.y,c[f+2]+=q.z,c[g]+=q.x,c[g+1]+=q.y,c[g+2]+=q.z,c[h]+=q.x,c[h+1]+=q.y,c[h+2]+=q.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),p.fromArray(b,d+3),n.fromArray(b,d+6),q.subVectors(n,p),m.subVectors(k,p),q.cross(m),c[d]=q.x,c[d+1]=q.y,c[d+2]=q.z,c[d+3]=q.x,c[d+4]=q.y,c[d+5]=q.z,c[d+6]=q.x,c[d+7]=q.y,
+c[d+8]=q.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q.fromArray(d,3*a);m.fromArray(d,3*b);s.fromArray(d,3*c);t.fromArray(f,2*a);r.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-q.x;x=s.x-q.x;C=m.y-q.y;w=s.y-q.y;y=m.z-q.z;A=s.z-q.z;F=r.x-t.x;G=u.x-t.x;E=r.y-t.y;z=u.y-t.y;M=1/(F*z-G*E);J.set((z*v-E*x)*M,(z*C-E*w)*M,(z*y-E*A)*M);K.set((F*x-G*v)*M,(F*w-G*C)*M,(F*A-G*y)*M);k[a].add(J);k[b].add(J);k[c].add(J);p[a].add(K);p[b].add(K);p[c].add(K)}function b(a){sa.fromArray(e,
+3*a);R.copy(sa);ra=k[a];na.copy(ra);na.sub(sa.multiplyScalar(sa.dot(ra))).normalize();ca.crossVectors(R,ra);ja=ca.dot(p[a]);xa=0>ja?-1:1;h[4*a]=na.x;h[4*a+1]=na.y;h[4*a+2]=na.z;h[4*a+3]=xa}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("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=[],p=[],n=0;n<g;n++)k[n]=new THREE.Vector3,p[n]=new THREE.Vector3;var q=new THREE.Vector3,m=new THREE.Vector3,s=new THREE.Vector3,t=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,v,x,C,w,y,A,F,G,E,z,M,J=new THREE.Vector3,K=new THREE.Vector3,L,T,P,N,Q;0===this.drawcalls.length&&
+this.addDrawCall(0,c.length,0);var U=this.drawcalls,n=0;for(T=U.length;n<T;++n){L=U[n].start;P=U[n].count;var I=U[n].index,g=L;for(L+=P;g<L;g+=3)P=I+c[g],N=I+c[g+1],Q=I+c[g+2],a(P,N,Q)}var na=new THREE.Vector3,ca=new THREE.Vector3,sa=new THREE.Vector3,R=new THREE.Vector3,xa,ra,ja,n=0;for(T=U.length;n<T;++n)for(L=U[n].start,P=U[n].count,I=U[n].index,g=L,L+=P;g<L;g+=3)P=I+c[g],N=I+c[g+1],Q=I+c[g+2],b(P),b(N),b(Q)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;
+for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],p=0,n=0,q=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=n=0;3>r;r++)t=a[3*c+r],-1==m[t]?(q[2*r]=t,q[2*r+1]=-1,n++):m[t]<k.index?(q[2*r]=t,q[2*r+1]=-1,p++):(q[2*r]=t,q[2*r+1]=m[t]);if(g+n>k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)r=q[n+1],-1<r&&r<k.index&&(q[n+1]=
+-1);for(n=0;6>n;n+=2)t=q[n],r=q[n+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.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.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,p=d[e],n=0;n<k;n++)p[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,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},b=this.attributes,c=this.offsets,d=this.boundingSphere,e;for(e in b){for(var f=b[e],g=[],h=f.array,k=0,p=h.length;k<p;k++)g[k]=h[k];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.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()}this.boundingBox instanceof THREE.Box3&&this.computeBoundingBox();this.boundingSphere instanceof THREE.Sphere&&this.computeBoundingSphere()},
-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=[],n=[],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&&n.push(new THREE.Vector2(h[p],h[p+1]));p=
-function(a,c,d){var e=void 0!==f?[k[a].clone(),k[c].clone(),k[d].clone()]:[],p=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,p));void 0!==h&&b.faceVertexUvs[0].push([n[a].clone(),n[c].clone(),n[d].clone()])};if(void 0!==e)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=
+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=[],p=[],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&&p.push(new THREE.Vector2(h[n],h[n+1]));n=
+function(a,c,d){var e=void 0!==f?[k[a].clone(),k[c].clone(),k[d].clone()]:[],n=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,n));void 0!==h&&b.faceVertexUvs[0].push([p[a].clone(),p[c].clone(),p[d].clone()])};if(void 0!==e)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=new THREE.Vector3;a.addVectors(this.boundingBox.min,this.boundingBox.max);a.multiplyScalar(-.5);this.applyMatrix((new THREE.Matrix4).makeTranslation(a.x,a.y,a.z));this.computeBoundingBox();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;new THREE.Vector3;new THREE.Vector3;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,n,p,q,m,t,s,r,u,v=[],y=[];c=new THREE.Vector3;var E=new THREE.Vector3,x=new THREE.Vector3,O=new THREE.Vector3,z=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,y[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],
-n=f[0],p=f[1],q=f[2],f=h.x-g.x,m=k.x-g.x,t=h.y-g.y,s=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=p.x-n.x,r=q.x-n.x,p=p.y-n.y,n=q.y-n.y,q=1/(k*n-r*p),c.set((n*f-p*m)*q,(n*t-p*s)*q,(n*h-p*g)*q),E.set((k*m-r*f)*q,(k*s-r*t)*q,(k*g-r*h)*q),v[d].add(c),v[u].add(c),v[e].add(c),y[d].add(E),y[u].add(E),y[e].add(E);E=["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++)z.copy(e.vertexNormals[c]),d=e[E[c]],u=v[d],x.copy(u),x.sub(z.multiplyScalar(z.dot(u))).normalize(),
-O.crossVectors(e.vertexNormals[c],u),d=O.dot(y[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,x.y,x.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)console.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,n=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,q=g.length;p<q;p++){var m=g[p].clone();void 0!==b&&m.applyMatrix4(b);f.push(m)}p=0;for(q=k.length;p<
-q;p++){var g=k[p],t,s=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=s.length;b<f;b++)t=s[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),m.vertexNormals.push(t);m.color.copy(g.color);b=0;for(f=r.length;b<f;b++)t=r[b],m.vertexColors.push(t.clone());m.materialIndex=g.materialIndex+c;h.push(m)}p=0;for(q=a.length;p<q;p++)if(c=a[p],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());
-n.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.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!==n[b])return n[b];n[b]=k.length/3;k.push(a.x,a.y,
-a.z);return n[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==q[b])return q[b];q[b]=p.length;p.push(a.getHex());return q[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==t[b])return t[b];t[b]=m.length/2;m.push(a.x,a.y);return t[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==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=[],n={},p=[],q={},m=[],t={};for(g=0;g<this.faces.length;g++){var s=this.faces[g],r=void 0!==this.faceVertexUvs[0][g],u=0<s.normal.length(),v=0<s.vertexNormals.length,y=1!==s.color.r||1!==s.color.g||1!==s.color.b,E=0<s.vertexColors.length,x=0,x=a(x,0,0),x=a(x,1,!1),x=a(x,2,!1),x=a(x,3,r),x=a(x,4,u),x=a(x,5,v),x=a(x,6,y),x=a(x,7,E);h.push(x);h.push(s.a,s.b,s.c);r&&(r=this.faceVertexUvs[0][g],
-h.push(d(r[0]),d(r[1]),d(r[2])));u&&h.push(b(s.normal));v&&(u=s.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));y&&h.push(c(s.color));E&&(s=s.vertexColors,h.push(c(s[0]),c(s[1]),c(s[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,n=g.length;k<n;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;
+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,p,n,q,m,s,t,r,u,v=[],x=[];c=new THREE.Vector3;var C=new THREE.Vector3,w=new THREE.Vector3,y=new THREE.Vector3,A=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],
+p=f[0],n=f[1],q=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=n.x-p.x,r=q.x-p.x,n=n.y-p.y,p=q.y-p.y,q=1/(k*p-r*n),c.set((p*f-n*m)*q,(p*s-n*t)*q,(p*h-n*g)*q),C.set((k*m-r*f)*q,(k*t-r*s)*q,(k*g-r*h)*q),v[d].add(c),v[u].add(c),v[e].add(c),x[d].add(C),x[u].add(C),x[e].add(C);C=["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++)A.copy(e.vertexNormals[c]),d=e[C[c]],u=v[d],w.copy(u),w.sub(A.multiplyScalar(A.dot(u))).normalize(),
+y.crossVectors(e.vertexNormals[c],u),d=y.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)console.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,p=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,q=g.length;n<q;n++){var m=g[n].clone();void 0!==b&&m.applyMatrix4(b);f.push(m)}n=0;for(q=k.length;n<
+q;n++){var g=k[n],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)}n=0;for(q=a.length;n<q;n++)if(c=a[n],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());
+p.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.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!==p[b])return p[b];p[b]=k.length/3;k.push(a.x,a.y,
+a.z);return p[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==q[b])return q[b];q[b]=n.length;n.push(a.getHex());return q[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,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==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=[],p={},n=[],q={},m=[],s={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],r=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,C=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,u),w=a(w,5,v),w=a(w,6,x),w=a(w,7,C);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])));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));C&&(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;
+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,p=g.length;k<p;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.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,-1).applyQuaternion(a)}}();
 THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};
 THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1);f.lookAt(new THREE.Vector3(0,1,0));this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new THREE.Vector3(0,-1,0));
@@ -250,7 +250,7 @@ a.shadowDarkness=this.shadowDarkness;a.shadowMapWidth=this.shadowMapWidth;a.shad
 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,r){var u=b+e,v,y=THREE.Loader.Handlers.get(u);null!==y?v=y.load(u):(v=new THREE.Texture,y=f.imageLoader,y.crossOrigin=f.crossOrigin,y.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),
+d,e,g,h,k,r){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]]));r&&(v.anisotropy=r);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":
 "basic"===k&&(g="MeshBasicMaterial")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]);if(void 0!==a.transparent||1>a.opacity)h.transparent=a.transparent;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));a.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),h.opacity=a.transparency);a.opacity&&(h.opacity=a.opacity);a.specularCoef&&(h.shininess=a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,
@@ -264,13 +264,13 @@ a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=
 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);if(void 0!==h.metadata&&4<=h.metadata.version){console.error('THREE.JSONLoader: "'+b+'" should be loaded with THREE.ObjectLoader instead.');return}if(void 0!==h.metadata&&"scene"===h.metadata.type){console.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 console.error('THREE.JSONLoader: "'+b+'" seems to be unreachable or the file is empty.');a.onLoadComplete()}else console.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,n,p,q,m,t,s,r,u,v,y=a.faces;p=a.vertices;var E=a.normals,x=a.colors,O=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&O++;for(d=0;d<O;d++)c.faceVertexUvs[d]=[]}k=0;for(n=p.length;k<n;)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(n=y.length;k<n;)if(b=y[k++],t=b&1,h=b&2,d=b&8,q=b&16,s=b&32,p=b&64,b&=128,t){t=new THREE.Face3;
-t.a=y[k];t.b=y[k+1];t.c=y[k+3];r=new THREE.Face3;r.a=y[k+1];r.b=y[k+2];r.c=y[k+3];k+=4;h&&(h=y[k++],t.materialIndex=h,r.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<O;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=y[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);q&&(q=3*y[k++],t.normal.set(E[q++],E[q++],E[q]),r.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*y[k++],s=new THREE.Vector3(E[q++],
-E[q++],E[q]),2!==d&&t.vertexNormals.push(s),0!==d&&r.vertexNormals.push(s);p&&(p=y[k++],p=x[p],t.color.setHex(p),r.color.setHex(p));if(b)for(d=0;4>d;d++)p=y[k++],p=x[p],2!==d&&t.vertexColors.push(new THREE.Color(p)),0!==d&&r.vertexColors.push(new THREE.Color(p));c.faces.push(t);c.faces.push(r)}else{t=new THREE.Face3;t.a=y[k++];t.b=y[k++];t.c=y[k++];h&&(h=y[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<O;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=y[k++],v=u[2*m],m=u[2*m+1],
-v=new THREE.Vector2(v,m),c.faceVertexUvs[d][h].push(v);q&&(q=3*y[k++],t.normal.set(E[q++],E[q++],E[q]));if(s)for(d=0;3>d;d++)q=3*y[k++],s=new THREE.Vector3(E[q++],E[q++],E[q]),t.vertexNormals.push(s);p&&(p=y[k++],t.color.setHex(x[p]));if(b)for(d=0;3>d;d++)p=y[k++],t.vertexColors.push(new THREE.Color(x[p]));c.faces.push(t)}})(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,p,n,q,m,s,t,r,u,v,x=a.faces;n=a.vertices;var C=a.normals,w=a.colors,y=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&y++;for(d=0;d<y;d++)c.faceVertexUvs[d]=[]}k=0;for(p=n.length;k<p;)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(p=x.length;k<p;)if(b=x[k++],s=b&1,h=b&2,d=b&8,q=b&16,t=b&32,n=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<y;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);q&&(q=3*x[k++],s.normal.set(C[q++],C[q++],C[q]),r.normal.copy(s.normal));if(t)for(d=0;4>d;d++)q=3*x[k++],t=new THREE.Vector3(C[q++],
+C[q++],C[q]),2!==d&&s.vertexNormals.push(t),0!==d&&r.vertexNormals.push(t);n&&(n=x[k++],n=w[n],s.color.setHex(n),r.color.setHex(n));if(b)for(d=0;4>d;d++)n=x[k++],n=w[n],2!==d&&s.vertexColors.push(new THREE.Color(n)),0!==d&&r.vertexColors.push(new THREE.Color(n));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<y;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);q&&(q=3*x[k++],s.normal.set(C[q++],C[q++],C[q]));if(t)for(d=0;3>d;d++)q=3*x[k++],t=new THREE.Vector3(C[q++],C[q++],C[q]),s.vertexNormals.push(t);n&&(n=x[k++],s.color.setHex(w[n]));if(b)for(d=0;3>d;d++)n=x[k++],s.vertexColors.push(new THREE.Color(w[n]));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)&&console.warn("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,n,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=[],n=c.morphTargets[d].vertices,p=a.morphTargets[d].vertices,h=0,k=p.length;h<k;h+=3){var q=new THREE.Vector3;q.x=p[h]*b;q.y=p[h+1]*b;q.z=p[h+2]*b;n.push(q)}}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,n=a.morphColors[d].colors,b=0,h=n.length;b<h;b+=3)p=new THREE.Color(16755200),p.setRGB(n[b],n[b+1],n[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}};
+"), 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,p,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=[],p=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var q=new THREE.Vector3;q.x=n[h]*b;q.y=n[h+1]*b;q.z=n[h+2]*b;p.push(q)}}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,p=a.morphColors[d].colors,b=0,h=p.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(p[b],p[b+1],p[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,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.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.offsets;void 0!==c&&(b.offsets=JSON.parse(JSON.stringify(c)));
 a=a.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};
@@ -288,8 +288,8 @@ b.visible);void 0!==b.userData&&(e.userData=b.userData);if(void 0!==b.children)f
 THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=new THREE.ImageLoader(this.manager);e.setCrossOrigin(this.crossOrigin);e.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.DataTextureLoader=THREE.BinaryTextureLoader=function(){this._parser=null};
 THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(a,b,c,d){var e=this,f=new THREE.DataTexture,g=new THREE.XHRLoader;g.setResponseType("arraybuffer");g.load(a,function(a){if(a=e._parser(a))void 0!==a.image?f.image=a.image:void 0!==a.data&&(f.image.width=a.width,f.image.height=a.height,f.image.data=a.data),f.wrapS=void 0!==a.wrapS?a.wrapS:THREE.ClampToEdgeWrapping,f.wrapT=void 0!==a.wrapT?a.wrapT:THREE.ClampToEdgeWrapping,f.magFilter=void 0!==a.magFilter?a.magFilter:
 THREE.LinearFilter,f.minFilter=void 0!==a.minFilter?a.minFilter:THREE.LinearMipMapLinearFilter,f.anisotropy=void 0!==a.anisotropy?a.anisotropy:1,void 0!==a.format&&(f.format=a.format),void 0!==a.type&&(f.type=a.type),void 0!==a.mipmaps&&(f.mipmaps=a.mipmaps),1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.needsUpdate=!0,b&&b(f,a)},c,d);return f}};THREE.CompressedTextureLoader=function(){this._parser=null};
-THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c){var d=this,e=[],f=new THREE.CompressedTexture;f.image=e;var g=new THREE.XHRLoader;g.setResponseType("arraybuffer");if(a instanceof Array){var h=0;c=function(c){g.load(a[c],function(a){a=d._parser(a,!0);e[c]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};h+=1;6===h&&(1==a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.format=a.format,f.needsUpdate=!0,b&&b(f))})};for(var k=0,n=
-a.length;k<n;++k)c(k)}else g.load(a,function(a){a=d._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,g=0;g<c;g++){e[g]={mipmaps:[]};for(var h=0;h<a.mipmapCount;h++)e[g].mipmaps.push(a.mipmaps[g*a.mipmapCount+h]),e[g].format=a.format,e[g].width=a.width,e[g].height=a.height}else f.image.width=a.width,f.image.height=a.height,f.mipmaps=a.mipmaps;1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter);f.format=a.format;f.needsUpdate=!0;b&&b(f)});return f}};
+THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c){var d=this,e=[],f=new THREE.CompressedTexture;f.image=e;var g=new THREE.XHRLoader;g.setResponseType("arraybuffer");if(a instanceof Array){var h=0;c=function(c){g.load(a[c],function(a){a=d._parser(a,!0);e[c]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};h+=1;6===h&&(1==a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.format=a.format,f.needsUpdate=!0,b&&b(f))})};for(var k=0,p=
+a.length;k<p;++k)c(k)}else g.load(a,function(a){a=d._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,g=0;g<c;g++){e[g]={mipmaps:[]};for(var h=0;h<a.mipmapCount;h++)e[g].mipmaps.push(a.mipmaps[g*a.mipmapCount+h]),e[g].format=a.format,e[g].width=a.width,e[g].height=a.height}else f.image.width=a.width,f.image.height=a.height,f.mipmaps=a.mipmaps;1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter);f.format=a.format;f.needsUpdate=!0;b&&b(f)});return f}};
 THREE.Material=function(){Object.defineProperty(this,"id",{value:THREE.MaterialIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Material";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=
 this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};
 THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},toJSON:function(){var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type};""!==this.name&&
@@ -331,26 +331,26 @@ THREE.Texture=function(a,b,c,d,e,f,g,h,k){Object.defineProperty(this,"id",{value
 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,n,p){THREE.Texture.call(this,null,f,g,h,k,n,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,n,p){THREE.Texture.call(this,null,f,g,h,k,n,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 n=this,p=function(){requestAnimationFrame(p);a.readyState===a.HAVE_ENOUGH_DATA&&(n.needsUpdate=!0)};p()};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,p,n){THREE.Texture.call(this,null,f,g,h,k,p,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,p,n){THREE.Texture.call(this,null,f,g,h,k,p,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 p=this,n=function(){requestAnimationFrame(n);a.readyState===a.HAVE_ENOUGH_DATA&&(p.needsUpdate=!0)};n()};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 n=f.attributes,p=n.position.array;if(void 0!==n.index){var n=n.index.array,q=f.offsets;0===q.length&&(q=[{start:0,count:n.length,index:0}]);for(var m=0,t=q.length;m<t;++m)for(var s=q[m].start,r=q[m].index,f=s,s=s+q[m].count;f<s;f++){var u=r+n[f];k.fromArray(p,3*u);g(k,u)}}else for(n=p.length/3,f=0;f<n;f++)k.set(p[3*f],p[3*f+1],p[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 p=f.attributes,n=p.position.array;if(void 0!==p.index){var p=p.index.array,q=f.offsets;0===q.length&&(q=[{start:0,count:p.length,index:0}]);for(var m=0,s=q.length;m<s;++m)for(var t=q[m].start,r=q[m].index,f=t,t=t+q[m].count;f<t;f++){var u=r+p[f];k.fromArray(n,3*u);g(k,u)}}else for(p=n.length/3,f=0;f<p;f++)k.set(n[3*f],n[3*f+1],n[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.ParticleSystem=function(a,b){console.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,n=new THREE.Vector3,p=new THREE.Vector3,q=this.mode===THREE.LineStrip?1:2;if(g instanceof
-THREE.BufferGeometry){var m=g.attributes;if(void 0!==m.index){var t=m.index.array,m=m.position.array,s=g.offsets;0===s.length&&(s=[{start:0,count:t.length,index:0}]);for(var r=0;r<s.length;r++)for(var u=s[r].start,v=s[r].count,y=s[r].index,g=u;g<u+v-1;g+=q){var E=y+t[g+1];h.fromArray(m,3*(y+t[g]));k.fromArray(m,3*E);E=b.distanceSqToSegment(h,k,p,n);E>f||(E=b.origin.distanceTo(p),E<d.near||E>d.far||e.push({distance:E,point:n.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+=q)h.fromArray(m,3*g),k.fromArray(m,3*g+3),E=b.distanceSqToSegment(h,k,p,n),E>f||(E=b.origin.distanceTo(p),E<d.near||E>d.far||e.push({distance:E,point:n.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+=q)E=b.distanceSqToSegment(h[g],h[g+1],p,n),E>f||(E=b.origin.distanceTo(p),E<d.near||E>d.far||e.push({distance:E,point:n.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,p=new THREE.Vector3,n=new THREE.Vector3,q=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 u=t[r].start,v=t[r].count,x=t[r].index,g=u;g<u+v-1;g+=q){var C=x+s[g+1];h.fromArray(m,3*(x+s[g]));k.fromArray(m,3*C);C=b.distanceSqToSegment(h,k,n,p);C>f||(C=b.origin.distanceTo(n),C<d.near||C>d.far||e.push({distance:C,point:p.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+=q)h.fromArray(m,3*g),k.fromArray(m,3*g+3),C=b.distanceSqToSegment(h,k,n,p),C>f||(C=b.origin.distanceTo(n),C<d.near||C>d.far||e.push({distance:C,point:p.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+=q)C=b.distanceSqToSegment(h[g],h[g+1],n,p),C>f||(C=b.origin.distanceTo(n),C<d.near||C>d.far||e.push({distance:C,point:p.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.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];console.log("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 n=
-this.material;if(void 0!==n){var p=k.attributes,q,m,t=g.precision;if(void 0!==p.index){var s=p.index.array,r=p.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:s.length,index:0}]);for(var v=0,y=u.length;v<y;++v)for(var p=u[v].start,E=u[v].index,k=p,x=p+u[v].count;k<x;k+=3){p=E+s[k];q=E+s[k+1];m=E+s[k+2];d.fromArray(r,3*p);e.fromArray(r,3*q);f.fromArray(r,3*m);var O=n.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,n.side!==THREE.DoubleSide);if(null!==O){O.applyMatrix4(this.matrixWorld);
-var z=g.ray.origin.distanceTo(O);z<t||z<g.near||z>g.far||h.push({distance:z,point:O,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(r=p.position.array,s=k=0,x=r.length;k<x;k+=3,s+=9)p=k,q=k+1,m=k+2,d.fromArray(r,s),e.fromArray(r,s+3),f.fromArray(r,s+6),O=n.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,n.side!==THREE.DoubleSide),null!==O&&(O.applyMatrix4(this.matrixWorld),z=g.ray.origin.distanceTo(O),z<t||z<g.near||z>
-g.far||h.push({distance:z,point:O,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,r=!0===s?this.material.materials:null,t=g.precision,u=k.vertices,v=0,y=k.faces.length;v<y;v++)if(E=k.faces[v],n=!0===s?r[E.materialIndex]:this.material,void 0!==n){p=u[E.a];q=u[E.b];m=u[E.c];if(!0===n.morphTargets){O=k.morphTargets;z=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
-0,0);for(var x=0,F=O.length;x<F;x++){var D=z[x];if(0!==D){var A=O[x].vertices;d.x+=(A[E.a].x-p.x)*D;d.y+=(A[E.a].y-p.y)*D;d.z+=(A[E.a].z-p.z)*D;e.x+=(A[E.b].x-q.x)*D;e.y+=(A[E.b].y-q.y)*D;e.z+=(A[E.b].z-q.z)*D;f.x+=(A[E.c].x-m.x)*D;f.y+=(A[E.c].y-m.y)*D;f.z+=(A[E.c].z-m.z)*D}}d.add(p);e.add(q);f.add(m);p=d;q=e;m=f}O=n.side===THREE.BackSide?b.intersectTriangle(m,q,p,!0):b.intersectTriangle(p,q,m,n.side!==THREE.DoubleSide);null!==O&&(O.applyMatrix4(this.matrixWorld),z=g.ray.origin.distanceTo(O),z<t||
-z<g.near||z>g.far||h.push({distance:z,point:O,face:E,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};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;
+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 p=
+this.material;if(void 0!==p){var n=k.attributes,q,m,s=g.precision;if(void 0!==n.index){var t=n.index.array,r=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,C=u[v].index,k=n,w=n+u[v].count;k<w;k+=3){n=C+t[k];q=C+t[k+1];m=C+t[k+2];d.fromArray(r,3*n);e.fromArray(r,3*q);f.fromArray(r,3*m);var y=p.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,p.side!==THREE.DoubleSide);if(null!==y){y.applyMatrix4(this.matrixWorld);
+var A=g.ray.origin.distanceTo(y);A<s||A<g.near||A>g.far||h.push({distance:A,point:y,face:new THREE.Face3(n,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(r=n.position.array,t=k=0,w=r.length;k<w;k+=3,t+=9)n=k,q=k+1,m=k+2,d.fromArray(r,t),e.fromArray(r,t+3),f.fromArray(r,t+6),y=p.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,p.side!==THREE.DoubleSide),null!==y&&(y.applyMatrix4(this.matrixWorld),A=g.ray.origin.distanceTo(y),A<s||A<g.near||A>
+g.far||h.push({distance:A,point:y,face:new THREE.Face3(n,q,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,u=k.vertices,v=0,x=k.faces.length;v<x;v++)if(C=k.faces[v],p=!0===t?r[C.materialIndex]:this.material,void 0!==p){n=u[C.a];q=u[C.b];m=u[C.c];if(!0===p.morphTargets){y=k.morphTargets;A=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
+0,0);for(var w=0,F=y.length;w<F;w++){var G=A[w];if(0!==G){var E=y[w].vertices;d.x+=(E[C.a].x-n.x)*G;d.y+=(E[C.a].y-n.y)*G;d.z+=(E[C.a].z-n.z)*G;e.x+=(E[C.b].x-q.x)*G;e.y+=(E[C.b].y-q.y)*G;e.z+=(E[C.b].z-q.z)*G;f.x+=(E[C.c].x-m.x)*G;f.y+=(E[C.c].y-m.y)*G;f.z+=(E[C.c].z-m.z)*G}}d.add(n);e.add(q);f.add(m);n=d;q=e;m=f}y=p.side===THREE.BackSide?b.intersectTriangle(m,q,n,!0):b.intersectTriangle(n,q,m,p.side!==THREE.DoubleSide);null!==y&&(y.applyMatrix4(this.matrixWorld),A=g.ray.origin.distanceTo(y),A<s||
+A<g.near||A>g.far||h.push({distance:A,point:y,face:C,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};THREE.Bone=function(a){THREE.Object3D.call(this);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),
 this.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};
 THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}};
@@ -434,138 +434,138 @@ THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sa
 "}"].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){var b=a.geometry;a=a.material;var c=b.vertices.length;if(a.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var d in a.attributes){var e=a.attributes[d];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var f=1;"v2"===e.type?f=2:"v3"===e.type?f=3:"v4"===e.type?f=4:"c"===e.type&&(f=3);e.size=f;e.array=new Float32Array(c*f);e.buffer=l.createBuffer();e.buffer.belongsToAttribute=d;e.needsUpdate=
-!0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){var c=b.geometry,e=a.faces3,f=3*e.length,g=1*e.length,h=3*e.length,e=d(b,a);a.__vertexArray=new Float32Array(3*f);a.__normalArray=new Float32Array(3*f);a.__colorArray=new Float32Array(3*f);a.__uvArray=new Float32Array(2*f);1<c.faceVertexUvs.length&&(a.__uv2Array=new Float32Array(2*f));c.hasTangents&&(a.__tangentArray=new Float32Array(4*f));b.geometry.skinWeights.length&&b.geometry.skinIndices.length&&(a.__skinIndexArray=new Float32Array(4*
-f),a.__skinWeightArray=new Float32Array(4*f));c=null!==ca.get("OES_element_index_uint")&&21845<g?Uint32Array:Uint16Array;a.__typeArray=c;a.__faceArray=new c(3*g);a.__lineArray=new c(2*h);var k=a.numMorphTargets;if(k)for(a.__morphTargetsArrays=[],c=0;c<k;c++)a.__morphTargetsArrays.push(new Float32Array(3*f));if(k=a.numMorphNormals)for(a.__morphNormalsArrays=[],c=0;c<k;c++)a.__morphNormalsArrays.push(new Float32Array(3*f));a.__webglFaceCount=3*g;a.__webglLineCount=2*h;if(e.attributes){void 0===a.__webglCustomAttributesList&&
-(a.__webglCustomAttributesList=[]);for(var m in e.attributes){var g=e.attributes[m],h={},n;for(n in g)h[n]=g[n];if(!h.__webglInitialized||h.createUniqueBuffers)h.__webglInitialized=!0,c=1,"v2"===h.type?c=2:"v3"===h.type?c=3:"v4"===h.type?c=4:"c"===h.type&&(c=3),h.size=c,h.array=new Float32Array(f*c),h.buffer=l.createBuffer(),h.buffer.belongsToAttribute=m,g.needsUpdate=!0,h.__original=g;a.__webglCustomAttributesList.push(h)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?
-a.material.materials[b.materialIndex]:a.material}function e(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var f=0,k=b.length;f<k;f++){var m=b[f],n=e[m];if(0<=n){var p=c[m];void 0!==p?(m=p.itemSize,l.bindBuffer(l.ARRAY_BUFFER,p.buffer),g(n),l.vertexAttribPointer(n,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(n,a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(n,a.defaultAttributeValues[m]))}}h()}
-function f(){for(var a=0,b=jb.length;a<b;a++)jb[a]=0}function g(a){jb[a]=1;0===Da[a]&&(l.enableVertexAttribArray(a),Da[a]=1)}function h(){for(var a=0,b=Da.length;a<b;a++)Da[a]!==jb[a]&&(l.disableVertexAttribArray(a),Da[a]=0)}function k(a,b){return 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 n(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function p(a,b){return b[0]-a[0]}function q(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",kc));var c=a.geometry;if(void 0!==c&&void 0===c.__webglInit)if(c.__webglInit=!0,c.addEventListener("dispose",lc),c instanceof THREE.BufferGeometry)I.info.memory.geometries++;else if(a instanceof THREE.Mesh)r(a,c);else if(a instanceof THREE.Line){if(void 0===c.__webglVertexBuffer){c.__webglVertexBuffer=l.createBuffer();c.__webglColorBuffer=l.createBuffer();c.__webglLineDistanceBuffer=
-l.createBuffer();I.info.memory.geometries++;var d=c.vertices.length;c.__vertexArray=new Float32Array(3*d);c.__colorArray=new Float32Array(3*d);c.__lineDistanceArray=new Float32Array(1*d);c.__webglLineCount=d;b(a);c.verticesNeedUpdate=!0;c.colorsNeedUpdate=!0;c.lineDistancesNeedUpdate=!0}}else a instanceof THREE.PointCloud&&void 0===c.__webglVertexBuffer&&(c.__webglVertexBuffer=l.createBuffer(),c.__webglColorBuffer=l.createBuffer(),I.info.memory.geometries++,d=c.vertices.length,c.__vertexArray=new Float32Array(3*
-d),c.__colorArray=new Float32Array(3*d),c.__sortArray=[],c.__webglParticleCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0);if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh)if(c instanceof THREE.BufferGeometry)u(Ea,c,a);else{if(c instanceof THREE.Geometry)for(var c=kb[c.id],d=0,e=c.length;d<e;d++)u(Ea,c[d],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?u(Ea,c,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&Fa.push({id:null,
-object:a,opaque:null,transparent:null,z:0});if(a instanceof THREE.Light)xa.push(a);else if(a instanceof THREE.Sprite)eb.push(a);else if(a instanceof THREE.LensFlare)fb.push(a);else if((c=Ea[a.id])&&(!1===a.frustumCulled||!0===tb.intersectsObject(a)))for(d=0,e=c.length;d<e;d++){var f=c[d],g=f,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?Ga.push(g):Ra.push(g)):h&&(g.material=
-h,h.transparent?Ga.push(g):Ra.push(g));f.render=!0;!0===I.sortObjects&&(ya.setFromMatrixPosition(a.matrixWorld),ya.applyProjection(ub),f.z=ya.z)}}d=0;for(e=a.children.length;d<e;d++)q(a.children[d])}}function m(a,b,c,d,e,f){for(var g,h=0,l=a.length;h<l;h++){g=a[h];var k=g.object,m=g.buffer;F(k,b);if(f)g=f;else{g=g.material;if(!g)continue;e&&I.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst,g.blendEquationAlpha,g.blendSrcAlpha,g.blendDstAlpha);I.setDepthTest(g.depthTest);I.setDepthWrite(g.depthWrite);
-w(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}I.setMaterialFaces(g);m instanceof THREE.BufferGeometry?I.renderBufferDirect(b,c,d,g,m,k):I.renderBuffer(b,c,d,g,m,k)}}function t(a,b,c,d,e,f,g){for(var h,l=0,k=a.length;l<k;l++){h=a[l];var m=h.object;if(m.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&I.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst,h.blendEquationAlpha,h.blendSrcAlpha,h.blendDstAlpha);I.setDepthTest(h.depthTest);I.setDepthWrite(h.depthWrite);w(h.polygonOffset,
-h.polygonOffsetFactor,h.polygonOffsetUnits)}I.renderImmediateObject(c,d,e,h,m)}}}function s(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function r(a,b){var d=a.material,e=!1;if(void 0===kb[b.id]||!0===b.groupsNeedUpdate){delete Ea[a.id];for(var f=kb,g=b.id,d=d instanceof THREE.MeshFaceMaterial,h=ca.get("OES_element_index_uint")?4294967296:65535,k,e={},m=b.morphTargets.length,n=b.morphNormals.length,p,q={},r=[],t=0,s=b.faces.length;t<s;t++){k=
-b.faces[t];var v=d?k.materialIndex:0;v in e||(e[v]={hash:v,counter:0});k=e[v].hash+"_"+e[v].counter;k in q||(p={id:mc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:n},q[k]=p,r.push(p));q[k].vertices+3>h&&(e[v].counter+=1,k=e[v].hash+"_"+e[v].counter,k in q||(p={id:mc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:n},q[k]=p,r.push(p)));q[k].faces3.push(t);q[k].vertices+=3}f[g]=r;b.groupsNeedUpdate=!1}f=kb[b.id];g=0;for(d=f.length;g<d;g++){h=f[g];
-if(void 0===h.__webglVertexBuffer){e=h;e.__webglVertexBuffer=l.createBuffer();e.__webglNormalBuffer=l.createBuffer();e.__webglTangentBuffer=l.createBuffer();e.__webglColorBuffer=l.createBuffer();e.__webglUVBuffer=l.createBuffer();e.__webglUV2Buffer=l.createBuffer();e.__webglSkinIndicesBuffer=l.createBuffer();e.__webglSkinWeightsBuffer=l.createBuffer();e.__webglFaceBuffer=l.createBuffer();e.__webglLineBuffer=l.createBuffer();if(n=e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],m=0;m<n;m++)e.__webglMorphTargetsBuffers.push(l.createBuffer());
-if(n=e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],m=0;m<n;m++)e.__webglMorphNormalsBuffers.push(l.createBuffer());I.info.memory.geometries++;c(h,a);b.verticesNeedUpdate=!0;b.morphTargetsNeedUpdate=!0;b.elementsNeedUpdate=!0;b.uvsNeedUpdate=!0;b.normalsNeedUpdate=!0;b.tangentsNeedUpdate=!0;e=b.colorsNeedUpdate=!0}else e=!1;(e||void 0===a.__webglActive)&&u(Ea,h,a)}a.__webglActive=!0}function u(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 v(a){var b=
-a.geometry;if(b instanceof THREE.BufferGeometry)for(var e=b.attributes,f=b.attributesKeys,g=0,h=f.length;g<h;g++){var k=f[g],m=e[k],n="index"===k?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;void 0===m.buffer?(m.buffer=l.createBuffer(),l.bindBuffer(n,m.buffer),l.bufferData(n,m.array,m instanceof THREE.DynamicBufferAttribute?l.DYNAMIC_DRAW:l.STATIC_DRAW),m.needsUpdate=!1):!0===m.needsUpdate&&(l.bindBuffer(n,m.buffer),void 0===m.updateRange||-1===m.updateRange.count?l.bufferSubData(n,0,m.array):0===m.updateRange.count?
-console.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."):(l.bufferSubData(n,m.updateRange.offset*m.array.BYTES_PER_ELEMENT,m.array.subarray(m.updateRange.offset,m.updateRange.offset+m.updateRange.count)),m.updateRange.count=0),m.needsUpdate=!1)}else if(a instanceof THREE.Mesh){!0===b.groupsNeedUpdate&&r(a,b);for(var p=kb[b.id],g=0,q=p.length;g<q;g++){var t=
-p[g],s=d(a,t);!0===b.groupsNeedUpdate&&c(t,a);var u=s.attributes&&y(s);if(b.verticesNeedUpdate||b.morphTargetsNeedUpdate||b.elementsNeedUpdate||b.uvsNeedUpdate||b.normalsNeedUpdate||b.colorsNeedUpdate||b.tangentsNeedUpdate||u){var v=t,x=a,z=l.DYNAMIC_DRAW,F=!b.dynamic,D=s;if(v.__inittedArrays){var O=D&&void 0!==D.shading&&D.shading===THREE.SmoothShading,w=void 0,A=void 0,I=void 0,B=void 0,N=void 0,L=void 0,H=void 0,R=void 0,V=void 0,S=void 0,P=void 0,K=void 0,J=void 0,U=void 0,T=void 0,xa=void 0,
-Ea=void 0,Qa=void 0,Fa=void 0,Ga=void 0,ca=void 0,aa=void 0,Ra=void 0,na=void 0,ha=void 0,Q=void 0,eb=void 0,ga=void 0,fb=void 0,W=void 0,oa=void 0,pa=void 0,ya=void 0,ta=void 0,Ha=void 0,Xa=void 0,Ia=void 0,Ya=void 0,ka=void 0,Ca=void 0,Sa=0,Ta=0,Wa=0,ma=0,Da=0,Za=0,Ba=0,lb=0,Ma=0,ia=0,qa=0,G=0,za=void 0,$a=v.__vertexArray,Bb=v.__uvArray,rb=v.__uv2Array,Ua=v.__normalArray,ra=v.__tangentArray,Ja=v.__colorArray,Ka=v.__skinIndexArray,La=v.__skinWeightArray,nc=v.__morphTargetsArrays,Cb=v.__morphNormalsArrays,
-sb=v.__webglCustomAttributesList,C=void 0,bb=v.__faceArray,ab=v.__lineArray,ba=x.geometry,mb=ba.elementsNeedUpdate,zb=ba.uvsNeedUpdate,Fb=ba.normalsNeedUpdate,vb=ba.tangentsNeedUpdate,Pb=ba.colorsNeedUpdate,jb=ba.morphTargetsNeedUpdate,cb=ba.vertices,Z=v.faces3,sa=ba.faces,nb=ba.faceVertexUvs[0],Va=ba.faceVertexUvs[1],wb=ba.skinIndices,Hb=ba.skinWeights,Y=ba.morphTargets,Qb=ba.morphNormals;if(ba.verticesNeedUpdate){w=0;for(A=Z.length;w<A;w++)B=sa[Z[w]],K=cb[B.a],J=cb[B.b],U=cb[B.c],$a[Ta]=K.x,$a[Ta+
-1]=K.y,$a[Ta+2]=K.z,$a[Ta+3]=J.x,$a[Ta+4]=J.y,$a[Ta+5]=J.z,$a[Ta+6]=U.x,$a[Ta+7]=U.y,$a[Ta+8]=U.z,Ta+=9;l.bindBuffer(l.ARRAY_BUFFER,v.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,$a,z)}if(jb)for(Ha=0,Xa=Y.length;Ha<Xa;Ha++){w=qa=0;for(A=Z.length;w<A;w++)ka=Z[w],B=sa[ka],K=Y[Ha].vertices[B.a],J=Y[Ha].vertices[B.b],U=Y[Ha].vertices[B.c],Ia=nc[Ha],Ia[qa]=K.x,Ia[qa+1]=K.y,Ia[qa+2]=K.z,Ia[qa+3]=J.x,Ia[qa+4]=J.y,Ia[qa+5]=J.z,Ia[qa+6]=U.x,Ia[qa+7]=U.y,Ia[qa+8]=U.z,D.morphNormals&&(O?(Ca=Qb[Ha].vertexNormals[ka],
-Qa=Ca.a,Fa=Ca.b,Ga=Ca.c):Ga=Fa=Qa=Qb[Ha].faceNormals[ka],Ya=Cb[Ha],Ya[qa]=Qa.x,Ya[qa+1]=Qa.y,Ya[qa+2]=Qa.z,Ya[qa+3]=Fa.x,Ya[qa+4]=Fa.y,Ya[qa+5]=Fa.z,Ya[qa+6]=Ga.x,Ya[qa+7]=Ga.y,Ya[qa+8]=Ga.z),qa+=9;l.bindBuffer(l.ARRAY_BUFFER,v.__webglMorphTargetsBuffers[Ha]);l.bufferData(l.ARRAY_BUFFER,nc[Ha],z);D.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglMorphNormalsBuffers[Ha]),l.bufferData(l.ARRAY_BUFFER,Cb[Ha],z))}if(Hb.length){w=0;for(A=Z.length;w<A;w++)B=sa[Z[w]],na=Hb[B.a],ha=Hb[B.b],Q=Hb[B.c],La[ia]=
-na.x,La[ia+1]=na.y,La[ia+2]=na.z,La[ia+3]=na.w,La[ia+4]=ha.x,La[ia+5]=ha.y,La[ia+6]=ha.z,La[ia+7]=ha.w,La[ia+8]=Q.x,La[ia+9]=Q.y,La[ia+10]=Q.z,La[ia+11]=Q.w,eb=wb[B.a],ga=wb[B.b],fb=wb[B.c],Ka[ia]=eb.x,Ka[ia+1]=eb.y,Ka[ia+2]=eb.z,Ka[ia+3]=eb.w,Ka[ia+4]=ga.x,Ka[ia+5]=ga.y,Ka[ia+6]=ga.z,Ka[ia+7]=ga.w,Ka[ia+8]=fb.x,Ka[ia+9]=fb.y,Ka[ia+10]=fb.z,Ka[ia+11]=fb.w,ia+=12;0<ia&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglSkinIndicesBuffer),l.bufferData(l.ARRAY_BUFFER,Ka,z),l.bindBuffer(l.ARRAY_BUFFER,v.__webglSkinWeightsBuffer),
-l.bufferData(l.ARRAY_BUFFER,La,z))}if(Pb){w=0;for(A=Z.length;w<A;w++)B=sa[Z[w]],H=B.vertexColors,R=B.color,3===H.length&&D.vertexColors===THREE.VertexColors?(ca=H[0],aa=H[1],Ra=H[2]):Ra=aa=ca=R,Ja[Ma]=ca.r,Ja[Ma+1]=ca.g,Ja[Ma+2]=ca.b,Ja[Ma+3]=aa.r,Ja[Ma+4]=aa.g,Ja[Ma+5]=aa.b,Ja[Ma+6]=Ra.r,Ja[Ma+7]=Ra.g,Ja[Ma+8]=Ra.b,Ma+=9;0<Ma&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,Ja,z))}if(vb&&ba.hasTangents){w=0;for(A=Z.length;w<A;w++)B=sa[Z[w]],V=B.vertexTangents,T=V[0],
-xa=V[1],Ea=V[2],ra[Ba]=T.x,ra[Ba+1]=T.y,ra[Ba+2]=T.z,ra[Ba+3]=T.w,ra[Ba+4]=xa.x,ra[Ba+5]=xa.y,ra[Ba+6]=xa.z,ra[Ba+7]=xa.w,ra[Ba+8]=Ea.x,ra[Ba+9]=Ea.y,ra[Ba+10]=Ea.z,ra[Ba+11]=Ea.w,Ba+=12;l.bindBuffer(l.ARRAY_BUFFER,v.__webglTangentBuffer);l.bufferData(l.ARRAY_BUFFER,ra,z)}if(Fb){w=0;for(A=Z.length;w<A;w++)if(B=sa[Z[w]],N=B.vertexNormals,L=B.normal,3===N.length&&O)for(W=0;3>W;W++)pa=N[W],Ua[Za]=pa.x,Ua[Za+1]=pa.y,Ua[Za+2]=pa.z,Za+=3;else for(W=0;3>W;W++)Ua[Za]=L.x,Ua[Za+1]=L.y,Ua[Za+2]=L.z,Za+=3;l.bindBuffer(l.ARRAY_BUFFER,
-v.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,Ua,z)}if(zb&&nb){w=0;for(A=Z.length;w<A;w++)if(I=Z[w],S=nb[I],void 0!==S)for(W=0;3>W;W++)ya=S[W],Bb[Wa]=ya.x,Bb[Wa+1]=ya.y,Wa+=2;0<Wa&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglUVBuffer),l.bufferData(l.ARRAY_BUFFER,Bb,z))}if(zb&&Va){w=0;for(A=Z.length;w<A;w++)if(I=Z[w],P=Va[I],void 0!==P)for(W=0;3>W;W++)ta=P[W],rb[ma]=ta.x,rb[ma+1]=ta.y,ma+=2;0<ma&&(l.bindBuffer(l.ARRAY_BUFFER,v.__webglUV2Buffer),l.bufferData(l.ARRAY_BUFFER,rb,z))}if(mb){w=0;for(A=Z.length;w<
-A;w++)bb[Da]=Sa,bb[Da+1]=Sa+1,bb[Da+2]=Sa+2,Da+=3,ab[lb]=Sa,ab[lb+1]=Sa+1,ab[lb+2]=Sa,ab[lb+3]=Sa+2,ab[lb+4]=Sa+1,ab[lb+5]=Sa+2,lb+=6,Sa+=3;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,v.__webglFaceBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,bb,z);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,v.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,ab,z)}if(sb)for(W=0,oa=sb.length;W<oa;W++)if(C=sb[W],C.__original.needsUpdate){G=0;if(1===C.size)if(void 0===C.boundTo||"vertices"===C.boundTo)for(w=0,A=Z.length;w<A;w++)B=
-sa[Z[w]],C.array[G]=C.value[B.a],C.array[G+1]=C.value[B.b],C.array[G+2]=C.value[B.c],G+=3;else{if("faces"===C.boundTo)for(w=0,A=Z.length;w<A;w++)za=C.value[Z[w]],C.array[G]=za,C.array[G+1]=za,C.array[G+2]=za,G+=3}else if(2===C.size)if(void 0===C.boundTo||"vertices"===C.boundTo)for(w=0,A=Z.length;w<A;w++)B=sa[Z[w]],K=C.value[B.a],J=C.value[B.b],U=C.value[B.c],C.array[G]=K.x,C.array[G+1]=K.y,C.array[G+2]=J.x,C.array[G+3]=J.y,C.array[G+4]=U.x,C.array[G+5]=U.y,G+=6;else{if("faces"===C.boundTo)for(w=0,
-A=Z.length;w<A;w++)U=J=K=za=C.value[Z[w]],C.array[G]=K.x,C.array[G+1]=K.y,C.array[G+2]=J.x,C.array[G+3]=J.y,C.array[G+4]=U.x,C.array[G+5]=U.y,G+=6}else if(3===C.size){var M;M="c"===C.type?["r","g","b"]:["x","y","z"];if(void 0===C.boundTo||"vertices"===C.boundTo)for(w=0,A=Z.length;w<A;w++)B=sa[Z[w]],K=C.value[B.a],J=C.value[B.b],U=C.value[B.c],C.array[G]=K[M[0]],C.array[G+1]=K[M[1]],C.array[G+2]=K[M[2]],C.array[G+3]=J[M[0]],C.array[G+4]=J[M[1]],C.array[G+5]=J[M[2]],C.array[G+6]=U[M[0]],C.array[G+7]=
-U[M[1]],C.array[G+8]=U[M[2]],G+=9;else if("faces"===C.boundTo)for(w=0,A=Z.length;w<A;w++)U=J=K=za=C.value[Z[w]],C.array[G]=K[M[0]],C.array[G+1]=K[M[1]],C.array[G+2]=K[M[2]],C.array[G+3]=J[M[0]],C.array[G+4]=J[M[1]],C.array[G+5]=J[M[2]],C.array[G+6]=U[M[0]],C.array[G+7]=U[M[1]],C.array[G+8]=U[M[2]],G+=9;else if("faceVertices"===C.boundTo)for(w=0,A=Z.length;w<A;w++)za=C.value[Z[w]],K=za[0],J=za[1],U=za[2],C.array[G]=K[M[0]],C.array[G+1]=K[M[1]],C.array[G+2]=K[M[2]],C.array[G+3]=J[M[0]],C.array[G+4]=
-J[M[1]],C.array[G+5]=J[M[2]],C.array[G+6]=U[M[0]],C.array[G+7]=U[M[1]],C.array[G+8]=U[M[2]],G+=9}else if(4===C.size)if(void 0===C.boundTo||"vertices"===C.boundTo)for(w=0,A=Z.length;w<A;w++)B=sa[Z[w]],K=C.value[B.a],J=C.value[B.b],U=C.value[B.c],C.array[G]=K.x,C.array[G+1]=K.y,C.array[G+2]=K.z,C.array[G+3]=K.w,C.array[G+4]=J.x,C.array[G+5]=J.y,C.array[G+6]=J.z,C.array[G+7]=J.w,C.array[G+8]=U.x,C.array[G+9]=U.y,C.array[G+10]=U.z,C.array[G+11]=U.w,G+=12;else if("faces"===C.boundTo)for(w=0,A=Z.length;w<
-A;w++)U=J=K=za=C.value[Z[w]],C.array[G]=K.x,C.array[G+1]=K.y,C.array[G+2]=K.z,C.array[G+3]=K.w,C.array[G+4]=J.x,C.array[G+5]=J.y,C.array[G+6]=J.z,C.array[G+7]=J.w,C.array[G+8]=U.x,C.array[G+9]=U.y,C.array[G+10]=U.z,C.array[G+11]=U.w,G+=12;else if("faceVertices"===C.boundTo)for(w=0,A=Z.length;w<A;w++)za=C.value[Z[w]],K=za[0],J=za[1],U=za[2],C.array[G]=K.x,C.array[G+1]=K.y,C.array[G+2]=K.z,C.array[G+3]=K.w,C.array[G+4]=J.x,C.array[G+5]=J.y,C.array[G+6]=J.z,C.array[G+7]=J.w,C.array[G+8]=U.x,C.array[G+
-9]=U.y,C.array[G+10]=U.z,C.array[G+11]=U.w,G+=12;l.bindBuffer(l.ARRAY_BUFFER,C.buffer);l.bufferData(l.ARRAY_BUFFER,C.array,z)}F&&(delete v.__inittedArrays,delete v.__colorArray,delete v.__normalArray,delete v.__tangentArray,delete v.__uvArray,delete v.__uv2Array,delete v.__faceArray,delete v.__vertexArray,delete v.__lineArray,delete v.__skinIndexArray,delete v.__skinWeightArray)}}}b.verticesNeedUpdate=!1;b.morphTargetsNeedUpdate=!1;b.elementsNeedUpdate=!1;b.uvsNeedUpdate=!1;b.normalsNeedUpdate=!1;
-b.colorsNeedUpdate=!1;b.tangentsNeedUpdate=!1;s.attributes&&E(s)}else if(a instanceof THREE.Line){s=d(a,b);u=s.attributes&&y(s);if(b.verticesNeedUpdate||b.colorsNeedUpdate||b.lineDistancesNeedUpdate||u){var $=l.DYNAMIC_DRAW,X,Aa,la,Db,da,xb,ob=b.vertices,ua=b.colors,Rb=b.lineDistances,Kb=ob.length,pb=ua.length,Sb=Rb.length,gb=b.__vertexArray,Eb=b.__colorArray,yb=b.__lineDistanceArray,Mb=b.colorsNeedUpdate,Ab=b.lineDistancesNeedUpdate,hb=b.__webglCustomAttributesList,db,ib,va,Ib,Na,ea;if(b.verticesNeedUpdate){for(X=
-0;X<Kb;X++)Db=ob[X],da=3*X,gb[da]=Db.x,gb[da+1]=Db.y,gb[da+2]=Db.z;l.bindBuffer(l.ARRAY_BUFFER,b.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,gb,$)}if(Mb){for(Aa=0;Aa<pb;Aa++)xb=ua[Aa],da=3*Aa,Eb[da]=xb.r,Eb[da+1]=xb.g,Eb[da+2]=xb.b;l.bindBuffer(l.ARRAY_BUFFER,b.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,Eb,$)}if(Ab){for(la=0;la<Sb;la++)yb[la]=Rb[la];l.bindBuffer(l.ARRAY_BUFFER,b.__webglLineDistanceBuffer);l.bufferData(l.ARRAY_BUFFER,yb,$)}if(hb)for(db=0,ib=hb.length;db<ib;db++)if(ea=hb[db],
-ea.needsUpdate&&(void 0===ea.boundTo||"vertices"===ea.boundTo)){da=0;Ib=ea.value.length;if(1===ea.size)for(va=0;va<Ib;va++)ea.array[va]=ea.value[va];else if(2===ea.size)for(va=0;va<Ib;va++)Na=ea.value[va],ea.array[da]=Na.x,ea.array[da+1]=Na.y,da+=2;else if(3===ea.size)if("c"===ea.type)for(va=0;va<Ib;va++)Na=ea.value[va],ea.array[da]=Na.r,ea.array[da+1]=Na.g,ea.array[da+2]=Na.b,da+=3;else for(va=0;va<Ib;va++)Na=ea.value[va],ea.array[da]=Na.x,ea.array[da+1]=Na.y,ea.array[da+2]=Na.z,da+=3;else if(4===
-ea.size)for(va=0;va<Ib;va++)Na=ea.value[va],ea.array[da]=Na.x,ea.array[da+1]=Na.y,ea.array[da+2]=Na.z,ea.array[da+3]=Na.w,da+=4;l.bindBuffer(l.ARRAY_BUFFER,ea.buffer);l.bufferData(l.ARRAY_BUFFER,ea.array,$);ea.needsUpdate=!1}}b.verticesNeedUpdate=!1;b.colorsNeedUpdate=!1;b.lineDistancesNeedUpdate=!1;s.attributes&&E(s)}else if(a instanceof THREE.PointCloud){s=d(a,b);u=s.attributes&&y(s);if(b.verticesNeedUpdate||b.colorsNeedUpdate||u){var Pa=l.DYNAMIC_DRAW,Tb,Ub,$b,ja,ac,tb=b.vertices,ub=tb.length,
-Lb=b.colors,Vb=Lb.length,bc=b.__vertexArray,cc=b.__colorArray,Wb=b.colorsNeedUpdate,Gb=b.__webglCustomAttributesList,dc,qb,wa,Jb,Oa,fa;if(b.verticesNeedUpdate){for(Tb=0;Tb<ub;Tb++)$b=tb[Tb],ja=3*Tb,bc[ja]=$b.x,bc[ja+1]=$b.y,bc[ja+2]=$b.z;l.bindBuffer(l.ARRAY_BUFFER,b.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,bc,Pa)}if(Wb){for(Ub=0;Ub<Vb;Ub++)ac=Lb[Ub],ja=3*Ub,cc[ja]=ac.r,cc[ja+1]=ac.g,cc[ja+2]=ac.b;l.bindBuffer(l.ARRAY_BUFFER,b.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,cc,Pa)}if(Gb)for(dc=
-0,qb=Gb.length;dc<qb;dc++){fa=Gb[dc];if(fa.needsUpdate&&(void 0===fa.boundTo||"vertices"===fa.boundTo))if(Jb=fa.value.length,ja=0,1===fa.size)for(wa=0;wa<Jb;wa++)fa.array[wa]=fa.value[wa];else if(2===fa.size)for(wa=0;wa<Jb;wa++)Oa=fa.value[wa],fa.array[ja]=Oa.x,fa.array[ja+1]=Oa.y,ja+=2;else if(3===fa.size)if("c"===fa.type)for(wa=0;wa<Jb;wa++)Oa=fa.value[wa],fa.array[ja]=Oa.r,fa.array[ja+1]=Oa.g,fa.array[ja+2]=Oa.b,ja+=3;else for(wa=0;wa<Jb;wa++)Oa=fa.value[wa],fa.array[ja]=Oa.x,fa.array[ja+1]=Oa.y,
-fa.array[ja+2]=Oa.z,ja+=3;else if(4===fa.size)for(wa=0;wa<Jb;wa++)Oa=fa.value[wa],fa.array[ja]=Oa.x,fa.array[ja+1]=Oa.y,fa.array[ja+2]=Oa.z,fa.array[ja+3]=Oa.w,ja+=4;l.bindBuffer(l.ARRAY_BUFFER,fa.buffer);l.bufferData(l.ARRAY_BUFFER,fa.array,Pa);fa.needsUpdate=!1}}b.verticesNeedUpdate=!1;b.colorsNeedUpdate=!1;s.attributes&&E(s)}}function y(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function E(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function x(a,
-b,c,d,e){var f,g,h,k;Kb=0;if(d.needsUpdate){d.program&&oc(d);d.addEventListener("dispose",pc);var m=Fc[d.type];if(m){var n=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var p=0,q=0,r=0,t=0,s=0,v=b.length;s<v;s++){var u=b[s];u.onlyShadow||!1===u.visible||(u instanceof THREE.DirectionalLight&&p++,
-u instanceof THREE.PointLight&&q++,u instanceof THREE.SpotLight&&r++,u instanceof THREE.HemisphereLight&&t++)}f=p;g=q;h=r;k=t;for(var x,y=0,E=0,w=b.length;E<w;E++){var A=b[E];A.castShadow&&(A instanceof THREE.SpotLight&&y++,A instanceof THREE.DirectionalLight&&!A.shadowCascade&&y++)}x=y;var F;if(Lb&&e&&e.skeleton&&e.skeleton.useVertexTexture)F=1024;else{var J=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),U=Math.floor((J-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(U=Math.min(e.skeleton.bones.length,
-U),U<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+U+" (try OpenGL instead of ANGLE)"));F=U}var L={precision:S,supportsVertexTextures:Vb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,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,sizeAttenuation:d.sizeAttenuation,
-logarithmicDepthBuffer:Xa,skinning:d.skinning,maxBones:F,useVertexTexture:Lb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:I.maxMorphTargets,maxMorphNormals:I.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:x,shadowMapEnabled:I.shadowMapEnabled&&e.receiveShadow&&0<x,shadowMapType:I.shadowMapType,shadowMapDebug:I.shadowMapDebug,shadowMapCascade:I.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,
-wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},H=[];m?H.push(m):(H.push(d.fragmentShader),H.push(d.vertexShader));if(void 0!==d.defines)for(var R in d.defines)H.push(R),H.push(d.defines[R]);for(R in L)H.push(R),H.push(L[R]);for(var P=H.join(),T,xa=0,Ea=Wa.length;xa<Ea;xa++){var Qa=Wa[xa];if(Qa.code===P){T=Qa;T.usedTimes++;break}}void 0===T&&(T=new THREE.WebGLProgram(I,P,d,L),Wa.push(T),I.info.memory.programs=Wa.length);d.program=T;var Fa=T.attributes;
-if(d.morphTargets){d.numSupportedMorphTargets=0;for(var Ga,ca="morphTarget",aa=0;aa<I.maxMorphTargets;aa++)Ga=ca+aa,0<=Fa[Ga]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,ca="morphNormal",aa=0;aa<I.maxMorphNormals;aa++)Ga=ca+aa,0<=Fa[Ga]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var Ra in d.__webglShader.uniforms){var eb=d.program.uniforms[Ra];eb&&d.uniformsList.push([d.__webglShader.uniforms[Ra],eb])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&
-(e.__webglMorphTargetInfluences=new Float32Array(I.maxMorphTargets));var fb=!1,pa=!1,oa=!1,ta=d.program,ha=ta.uniforms,Q=d.__webglShader.uniforms;ta.id!==Wb&&(l.useProgram(ta.program),Wb=ta.id,oa=pa=fb=!0);d.id!==zb&&(-1===zb&&(oa=!0),zb=d.id,pa=!0);if(fb||a!==Fb)l.uniformMatrix4fv(ha.projectionMatrix,!1,a.projectionMatrix.elements),Xa&&l.uniform1f(ha.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Fb&&(Fb=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==
-ha.cameraPosition&&(ya.setFromMatrixPosition(a.matrixWorld),l.uniform3f(ha.cameraPosition,ya.x,ya.y,ya.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==ha.viewMatrix&&l.uniformMatrix4fv(ha.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==ha.bindMatrix&&l.uniformMatrix4fv(ha.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==
-ha.bindMatrixInverse&&l.uniformMatrix4fv(ha.bindMatrixInverse,!1,e.bindMatrixInverse.elements),Lb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==ha.boneTexture){var Ca=z();l.uniform1i(ha.boneTexture,Ca);I.setTexture(e.skeleton.boneTexture,Ca)}null!==ha.boneTextureWidth&&l.uniform1i(ha.boneTextureWidth,e.skeleton.boneTextureWidth);null!==ha.boneTextureHeight&&l.uniform1i(ha.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==ha.boneGlobalMatrices&&
-l.uniformMatrix4fv(ha.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(pa){c&&d.fog&&(Q.fogColor.value=c.color,c instanceof THREE.Fog?(Q.fogNear.value=c.near,Q.fogFar.value=c.far):c instanceof THREE.FogExp2&&(Q.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Mb){var oa=!0,ga,ma,W,Da=0,db=0,hb=0,Pa,Ha,kb,Ia,Ya,ka=qc,ib=ka.directional.colors,Sa=ka.directional.positions,Ta=ka.point.colors,jb=ka.point.positions,tb=ka.point.distances,
-Ab=ka.point.decays,Za=ka.spot.colors,Ba=ka.spot.positions,lb=ka.spot.distances,Ma=ka.spot.directions,ia=ka.spot.anglesCos,qa=ka.spot.exponents,G=ka.spot.decays,za=ka.hemi.skyColors,$a=ka.hemi.groundColors,Bb=ka.hemi.positions,rb=0,Ua=0,ra=0,Ja=0,Ka=0,La=0,qb=0,Cb=0,sb=0,C=0,bb=0,ab=0;ga=0;for(ma=b.length;ga<ma;ga++)W=b[ga],W.onlyShadow||(Pa=W.color,Ia=W.intensity,Ya=W.distance,W instanceof THREE.AmbientLight?W.visible&&(Da+=Pa.r,db+=Pa.g,hb+=Pa.b):W instanceof THREE.DirectionalLight?(Ka+=1,W.visible&&
-(na.setFromMatrixPosition(W.matrixWorld),ya.setFromMatrixPosition(W.target.matrixWorld),na.sub(ya),na.normalize(),sb=3*rb,Sa[sb]=na.x,Sa[sb+1]=na.y,Sa[sb+2]=na.z,D(ib,sb,Pa,Ia),rb+=1)):W instanceof THREE.PointLight?(La+=1,W.visible&&(C=3*Ua,D(Ta,C,Pa,Ia),ya.setFromMatrixPosition(W.matrixWorld),jb[C]=ya.x,jb[C+1]=ya.y,jb[C+2]=ya.z,tb[Ua]=Ya,Ab[Ua]=0===W.distance?0:W.decay,Ua+=1)):W instanceof THREE.SpotLight?(qb+=1,W.visible&&(bb=3*ra,D(Za,bb,Pa,Ia),na.setFromMatrixPosition(W.matrixWorld),Ba[bb]=na.x,
-Ba[bb+1]=na.y,Ba[bb+2]=na.z,lb[ra]=Ya,ya.setFromMatrixPosition(W.target.matrixWorld),na.sub(ya),na.normalize(),Ma[bb]=na.x,Ma[bb+1]=na.y,Ma[bb+2]=na.z,ia[ra]=Math.cos(W.angle),qa[ra]=W.exponent,G[ra]=0===W.distance?0:W.decay,ra+=1)):W instanceof THREE.HemisphereLight&&(Cb+=1,W.visible&&(na.setFromMatrixPosition(W.matrixWorld),na.normalize(),ab=3*Ja,Bb[ab]=na.x,Bb[ab+1]=na.y,Bb[ab+2]=na.z,Ha=W.color,kb=W.groundColor,D(za,ab,Ha,Ia),D($a,ab,kb,Ia),Ja+=1)));ga=3*rb;for(ma=Math.max(ib.length,3*Ka);ga<
-ma;ga++)ib[ga]=0;ga=3*Ua;for(ma=Math.max(Ta.length,3*La);ga<ma;ga++)Ta[ga]=0;ga=3*ra;for(ma=Math.max(Za.length,3*qb);ga<ma;ga++)Za[ga]=0;ga=3*Ja;for(ma=Math.max(za.length,3*Cb);ga<ma;ga++)za[ga]=0;ga=3*Ja;for(ma=Math.max($a.length,3*Cb);ga<ma;ga++)$a[ga]=0;ka.directional.length=rb;ka.point.length=Ua;ka.spot.length=ra;ka.hemi.length=Ja;ka.ambient[0]=Da;ka.ambient[1]=db;ka.ambient[2]=hb;Mb=!1}if(oa){var ba=qc;Q.ambientLightColor.value=ba.ambient;Q.directionalLightColor.value=ba.directional.colors;Q.directionalLightDirection.value=
-ba.directional.positions;Q.pointLightColor.value=ba.point.colors;Q.pointLightPosition.value=ba.point.positions;Q.pointLightDistance.value=ba.point.distances;Q.pointLightDecay.value=ba.point.decays;Q.spotLightColor.value=ba.spot.colors;Q.spotLightPosition.value=ba.spot.positions;Q.spotLightDistance.value=ba.spot.distances;Q.spotLightDirection.value=ba.spot.directions;Q.spotLightAngleCos.value=ba.spot.anglesCos;Q.spotLightExponent.value=ba.spot.exponents;Q.spotLightDecay.value=ba.spot.decays;Q.hemisphereLightSkyColor.value=
-ba.hemi.skyColors;Q.hemisphereLightGroundColor.value=ba.hemi.groundColors;Q.hemisphereLightDirection.value=ba.hemi.positions;O(Q,!0)}else O(Q,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){Q.opacity.value=d.opacity;Q.diffuse.value=d.color;Q.map.value=d.map;Q.lightMap.value=d.lightMap;Q.specularMap.value=d.specularMap;Q.alphaMap.value=d.alphaMap;d.bumpMap&&(Q.bumpMap.value=d.bumpMap,Q.bumpScale.value=d.bumpScale);d.normalMap&&
-(Q.normalMap.value=d.normalMap,Q.normalScale.value.copy(d.normalScale));var mb;d.map?mb=d.map:d.specularMap?mb=d.specularMap:d.normalMap?mb=d.normalMap:d.bumpMap?mb=d.bumpMap:d.alphaMap&&(mb=d.alphaMap);if(void 0!==mb){var ub=mb.offset,Nb=mb.repeat;Q.offsetRepeat.value.set(ub.x,ub.y,Nb.x,Nb.y)}Q.envMap.value=d.envMap;Q.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;Q.reflectivity.value=d.reflectivity;Q.refractionRatio.value=d.refractionRatio}d instanceof THREE.LineBasicMaterial?
-(Q.diffuse.value=d.color,Q.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(Q.diffuse.value=d.color,Q.opacity.value=d.opacity,Q.dashSize.value=d.dashSize,Q.totalSize.value=d.dashSize+d.gapSize,Q.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(Q.psColor.value=d.color,Q.opacity.value=d.opacity,Q.size.value=d.size,Q.scale.value=V.height/2,Q.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(Q.shininess.value=d.shininess,Q.emissive.value=d.emissive,Q.specular.value=d.specular,
-d.wrapAround&&Q.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(Q.emissive.value=d.emissive,d.wrapAround&&Q.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(Q.mNear.value=a.near,Q.mFar.value=a.far,Q.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(Q.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&Q.shadowMatrix)for(var vb=0,Pb=0,Xb=b.length;Pb<Xb;Pb++){var cb=b[Pb];cb.castShadow&&(cb instanceof THREE.SpotLight||cb instanceof THREE.DirectionalLight&&
-!cb.shadowCascade)&&(Q.shadowMap.value[vb]=cb.shadowMap,Q.shadowMapSize.value[vb]=cb.shadowMapSize,Q.shadowMatrix.value[vb]=cb.shadowMatrix,Q.shadowDarkness.value[vb]=cb.shadowDarkness,Q.shadowBias.value[vb]=cb.shadowBias,vb++)}for(var Z=d.uniformsList,sa,nb,Va,wb=0,Hb=Z.length;wb<Hb;wb++){var Y=Z[wb][0];if(!1!==Y.needsUpdate){var Qb=Y.type,M=Y.value,$=Z[wb][1];switch(Qb){case "1i":l.uniform1i($,M);break;case "1f":l.uniform1f($,M);break;case "2f":l.uniform2f($,M[0],M[1]);break;case "3f":l.uniform3f($,
-M[0],M[1],M[2]);break;case "4f":l.uniform4f($,M[0],M[1],M[2],M[3]);break;case "1iv":l.uniform1iv($,M);break;case "3iv":l.uniform3iv($,M);break;case "1fv":l.uniform1fv($,M);break;case "2fv":l.uniform2fv($,M);break;case "3fv":l.uniform3fv($,M);break;case "4fv":l.uniform4fv($,M);break;case "Matrix3fv":l.uniformMatrix3fv($,!1,M);break;case "Matrix4fv":l.uniformMatrix4fv($,!1,M);break;case "i":l.uniform1i($,M);break;case "f":l.uniform1f($,M);break;case "v2":l.uniform2f($,M.x,M.y);break;case "v3":l.uniform3f($,
-M.x,M.y,M.z);break;case "v4":l.uniform4f($,M.x,M.y,M.z,M.w);break;case "c":l.uniform3f($,M.r,M.g,M.b);break;case "iv1":l.uniform1iv($,M);break;case "iv":l.uniform3iv($,M);break;case "fv1":l.uniform1fv($,M);break;case "fv":l.uniform3fv($,M);break;case "v2v":void 0===Y._array&&(Y._array=new Float32Array(2*M.length));for(var X=0,Aa=M.length;X<Aa;X++)Va=2*X,Y._array[Va]=M[X].x,Y._array[Va+1]=M[X].y;l.uniform2fv($,Y._array);break;case "v3v":void 0===Y._array&&(Y._array=new Float32Array(3*M.length));X=
-0;for(Aa=M.length;X<Aa;X++)Va=3*X,Y._array[Va]=M[X].x,Y._array[Va+1]=M[X].y,Y._array[Va+2]=M[X].z;l.uniform3fv($,Y._array);break;case "v4v":void 0===Y._array&&(Y._array=new Float32Array(4*M.length));X=0;for(Aa=M.length;X<Aa;X++)Va=4*X,Y._array[Va]=M[X].x,Y._array[Va+1]=M[X].y,Y._array[Va+2]=M[X].z,Y._array[Va+3]=M[X].w;l.uniform4fv($,Y._array);break;case "m3":l.uniformMatrix3fv($,!1,M.elements);break;case "m3v":void 0===Y._array&&(Y._array=new Float32Array(9*M.length));X=0;for(Aa=M.length;X<Aa;X++)M[X].flattenToArrayOffset(Y._array,
-9*X);l.uniformMatrix3fv($,!1,Y._array);break;case "m4":l.uniformMatrix4fv($,!1,M.elements);break;case "m4v":void 0===Y._array&&(Y._array=new Float32Array(16*M.length));X=0;for(Aa=M.length;X<Aa;X++)M[X].flattenToArrayOffset(Y._array,16*X);l.uniformMatrix4fv($,!1,Y._array);break;case "t":sa=M;nb=z();l.uniform1i($,nb);if(!sa)continue;if(sa instanceof THREE.CubeTexture||sa.image instanceof Array&&6===sa.image.length){var la=sa,Db=nb;if(6===la.image.length)if(la.needsUpdate){la.image.__webglTextureCube||
-(la.addEventListener("dispose",Gb),la.image.__webglTextureCube=l.createTexture(),I.info.memory.textures++);l.activeTexture(l.TEXTURE0+Db);l.bindTexture(l.TEXTURE_CUBE_MAP,la.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,la.flipY);for(var da=la instanceof THREE.CompressedTexture,xb=la.image[0]instanceof THREE.DataTexture,ob=[],ua=0;6>ua;ua++)ob[ua]=!I.autoScaleCubemaps||da||xb?xb?la.image[ua].image:la.image[ua]:K(la.image[ua],Gc);var Rb=ob[0],Ob=THREE.Math.isPowerOfTwo(Rb.width)&&THREE.Math.isPowerOfTwo(Rb.height),
-pb=N(la.format),Sb=N(la.type);B(l.TEXTURE_CUBE_MAP,la,Ob);for(ua=0;6>ua;ua++)if(da)for(var gb,Eb=ob[ua].mipmaps,yb=0,Yb=Eb.length;yb<Yb;yb++)gb=Eb[yb],la.format!==THREE.RGBAFormat&&la.format!==THREE.RGBFormat?-1<rc().indexOf(pb)?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ua,yb,pb,gb.width,gb.height,0,gb.data):console.warn("Attempt to load unsupported compressed texture format"):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ua,yb,pb,gb.width,gb.height,0,pb,Sb,gb.data);else xb?l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+
-ua,0,pb,ob[ua].width,ob[ua].height,0,pb,Sb,ob[ua].data):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ua,0,pb,pb,Sb,ob[ua]);la.generateMipmaps&&Ob&&l.generateMipmap(l.TEXTURE_CUBE_MAP);la.needsUpdate=!1;if(la.onUpdate)la.onUpdate()}else l.activeTexture(l.TEXTURE0+Db),l.bindTexture(l.TEXTURE_CUBE_MAP,la.image.__webglTextureCube)}else if(sa instanceof THREE.WebGLRenderTargetCube){var Zb=sa;l.activeTexture(l.TEXTURE0+nb);l.bindTexture(l.TEXTURE_CUBE_MAP,Zb.__webglTexture)}else I.setTexture(sa,nb);break;
-case "tv":void 0===Y._array&&(Y._array=[]);X=0;for(Aa=Y.value.length;X<Aa;X++)Y._array[X]=z();l.uniform1iv($,Y._array);X=0;for(Aa=Y.value.length;X<Aa;X++)sa=Y.value[X],nb=Y._array[X],sa&&I.setTexture(sa,nb);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Qb)}}}}l.uniformMatrix4fv(ha.modelViewMatrix,!1,e._modelViewMatrix.elements);ha.normalMatrix&&l.uniformMatrix3fv(ha.normalMatrix,!1,e._normalMatrix.elements);null!==ha.modelMatrix&&l.uniformMatrix4fv(ha.modelMatrix,!1,e.matrixWorld.elements);
-return ta}function O(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 z(){var a=Kb;a>=sc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+sc);Kb+=1;return a}function F(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function D(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function A(a){a*=J;a!==tc&&(l.lineWidth(a),
-tc=a)}function w(a,b,c){uc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),uc=a);!a||vc===b&&wc===c||(l.polygonOffset(b,c),vc=b,wc=c)}function B(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,N(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,N(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,N(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,N(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&
-b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT is set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),l.texParameteri(a,l.TEXTURE_MAG_FILTER,T(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,T(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( "+
-b.sourceFile+" )"));(c=ca.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(l.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,I.getMaxAnisotropy())),b.__oldAnisotropy=b.anisotropy)}function K(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);
-console.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+".");return d}return a}function L(a,b){l.bindRenderbuffer(l.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,
-l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function H(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function T(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?
-l.NEAREST:l.LINEAR}function N(a){var b;if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;if(a===
+!0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function d(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var h=0,k=b.length;h<k;h++){var m=b[h],p=e[m];if(0<=p){var n=c[m];void 0!==n?(m=n.itemSize,l.bindBuffer(l.ARRAY_BUFFER,n.buffer),f(p),l.vertexAttribPointer(p,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(p,
+a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(p,a.defaultAttributeValues[m]))}}g()}function e(){for(var a=0,b=ub.length;a<b;a++)ub[a]=0}function f(a){ub[a]=1;0===Qa[a]&&(l.enableVertexAttribArray(a),Qa[a]=1)}function g(){for(var a=0,b=Qa.length;a<b;a++)Qa[a]!==ub[a]&&(l.disableVertexAttribArray(a),Qa[a]=0)}function h(a,b){return 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 k(a,b){return a.z!==b.z?b.z-a.z:a.id-
+b.id}function p(a,b){return b[0]-a[0]}function n(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",kc));var c=a.geometry;if(void 0!==c&&void 0===c.__webglInit)if(c.__webglInit=!0,c.addEventListener("dispose",lc),c instanceof THREE.BufferGeometry)B.info.memory.geometries++;else if(a instanceof THREE.Mesh)t(a,c);else if(a instanceof
+THREE.Line){if(void 0===c.__webglVertexBuffer){c.__webglVertexBuffer=l.createBuffer();c.__webglColorBuffer=l.createBuffer();c.__webglLineDistanceBuffer=l.createBuffer();B.info.memory.geometries++;var d=c.vertices.length;c.__vertexArray=new Float32Array(3*d);c.__colorArray=new Float32Array(3*d);c.__lineDistanceArray=new Float32Array(1*d);c.__webglLineCount=d;b(a);c.verticesNeedUpdate=!0;c.colorsNeedUpdate=!0;c.lineDistancesNeedUpdate=!0}}else a instanceof THREE.PointCloud&&void 0===c.__webglVertexBuffer&&
+(c.__webglVertexBuffer=l.createBuffer(),c.__webglColorBuffer=l.createBuffer(),B.info.memory.geometries++,d=c.vertices.length,c.__vertexArray=new Float32Array(3*d),c.__colorArray=new Float32Array(3*d),c.__sortArray=[],c.__webglParticleCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0);if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh)if(c instanceof THREE.BufferGeometry)r(za,c,a);else{if(c instanceof THREE.Geometry)for(var c=ib[c.id],d=0,e=c.length;d<e;d++)r(za,c[d],
+a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?r(za,c,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&La.push({id:null,object:a,opaque:null,transparent:null,z:0});if(a instanceof THREE.Light)ya.push(a);else if(a instanceof THREE.Sprite)Ea.push(a);else if(a instanceof THREE.LensFlare)qb.push(a);else if((c=za[a.id])&&(!1===a.frustumCulled||!0===vb.intersectsObject(a)))for(d=0,e=c.length;d<e;d++){var f=c[d],g=f,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?Ra.push(g):Sa.push(g)):h&&(g.material=h,h.transparent?Ra.push(g):Sa.push(g));f.render=!0;!0===B.sortObjects&&(Ca.setFromMatrixPosition(a.matrixWorld),Ca.applyProjection(wb),f.z=Ca.z)}}d=0;for(e=a.children.length;d<e;d++)n(a.children[d])}}function q(a,b,c,d,e,f){for(var g,h=0,l=a.length;h<l;h++){g=a[h];var k=g.object,m=g.buffer;A(k,b);if(f)g=f;else{g=g.material;if(!g)continue;
+e&&B.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst,g.blendEquationAlpha,g.blendSrcAlpha,g.blendDstAlpha);B.setDepthTest(g.depthTest);B.setDepthWrite(g.depthWrite);E(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}B.setMaterialFaces(g);m instanceof THREE.BufferGeometry?B.renderBufferDirect(b,c,d,g,m,k):B.renderBuffer(b,c,d,g,m,k)}}function m(a,b,c,d,e,f,g){for(var h,l=0,k=a.length;l<k;l++){h=a[l];var m=h.object;if(m.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&B.setBlending(h.blending,
+h.blendEquation,h.blendSrc,h.blendDst,h.blendEquationAlpha,h.blendSrcAlpha,h.blendDstAlpha);B.setDepthTest(h.depthTest);B.setDepthWrite(h.depthWrite);E(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}B.renderImmediateObject(c,d,e,h,m)}}}function s(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function t(a,b){var d=a.material,e=!1;if(void 0===ib[b.id]||!0===b.groupsNeedUpdate){delete za[a.id];for(var f=ib,g=b.id,d=d instanceof THREE.MeshFaceMaterial,
+h=aa.get("OES_element_index_uint")?4294967296:65535,k,e={},m=b.morphTargets.length,p=b.morphNormals.length,n,q={},s=[],t=0,u=b.faces.length;t<u;t++){k=b.faces[t];var v=d?k.materialIndex:0;v in e||(e[v]={hash:v,counter:0});k=e[v].hash+"_"+e[v].counter;k in q||(n={id:mc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:p},q[k]=n,s.push(n));q[k].vertices+3>h&&(e[v].counter+=1,k=e[v].hash+"_"+e[v].counter,k in q||(n={id:mc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,
+numMorphNormals:p},q[k]=n,s.push(n)));q[k].faces3.push(t);q[k].vertices+=3}f[g]=s;b.groupsNeedUpdate=!1}f=ib[b.id];g=0;for(d=f.length;g<d;g++){h=f[g];if(void 0===h.__webglVertexBuffer){e=h;e.__webglVertexBuffer=l.createBuffer();e.__webglNormalBuffer=l.createBuffer();e.__webglTangentBuffer=l.createBuffer();e.__webglColorBuffer=l.createBuffer();e.__webglUVBuffer=l.createBuffer();e.__webglUV2Buffer=l.createBuffer();e.__webglSkinIndicesBuffer=l.createBuffer();e.__webglSkinWeightsBuffer=l.createBuffer();
+e.__webglFaceBuffer=l.createBuffer();e.__webglLineBuffer=l.createBuffer();if(p=e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],m=0;m<p;m++)e.__webglMorphTargetsBuffers.push(l.createBuffer());if(p=e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],m=0;m<p;m++)e.__webglMorphNormalsBuffers.push(l.createBuffer());B.info.memory.geometries++;e=h;t=a;u=t.geometry;p=e.faces3;m=3*p.length;q=1*p.length;s=3*p.length;p=c(t,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<u.faceVertexUvs.length&&(e.__uv2Array=new Float32Array(2*m));u.hasTangents&&(e.__tangentArray=new Float32Array(4*m));t.geometry.skinWeights.length&&t.geometry.skinIndices.length&&(e.__skinIndexArray=new Float32Array(4*m),e.__skinWeightArray=new Float32Array(4*m));t=null!==aa.get("OES_element_index_uint")&&21845<q?Uint32Array:Uint16Array;e.__typeArray=t;e.__faceArray=new t(3*q);e.__lineArray=new t(2*s);if(u=e.numMorphTargets)for(e.__morphTargetsArrays=
+[],t=0;t<u;t++)e.__morphTargetsArrays.push(new Float32Array(3*m));if(u=e.numMorphNormals)for(e.__morphNormalsArrays=[],t=0;t<u;t++)e.__morphNormalsArrays.push(new Float32Array(3*m));e.__webglFaceCount=3*q;e.__webglLineCount=2*s;if(p.attributes)for(q in void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]),q=void 0,p.attributes){var s=p.attributes[q],t={},w;for(w in s)t[w]=s[w];if(!t.__webglInitialized||t.createUniqueBuffers)t.__webglInitialized=!0,u=1,"v2"===t.type?u=2:"v3"===
+t.type?u=3:"v4"===t.type?u=4:"c"===t.type&&(u=3),t.size=u,t.array=new Float32Array(m*u),t.buffer=l.createBuffer(),t.buffer.belongsToAttribute=q,s.needsUpdate=!0,t.__original=s;e.__webglCustomAttributesList.push(t)}e.__inittedArrays=!0;b.verticesNeedUpdate=!0;b.morphTargetsNeedUpdate=!0;b.elementsNeedUpdate=!0;b.uvsNeedUpdate=!0;b.normalsNeedUpdate=!0;b.tangentsNeedUpdate=!0;e=b.colorsNeedUpdate=!0}else e=!1;(e||void 0===a.__webglActive)&&r(za,h,a)}a.__webglActive=!0}function r(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 u(a){var b=a.geometry;if(b instanceof THREE.BufferGeometry)for(var d=b.attributes,e=b.attributesKeys,f=0,g=e.length;f<g;f++){var h=e[f],k=d[h],m="index"===h?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;void 0===k.buffer?(k.buffer=l.createBuffer(),l.bindBuffer(m,k.buffer),l.bufferData(m,k.array,k instanceof THREE.DynamicBufferAttribute?l.DYNAMIC_DRAW:l.STATIC_DRAW),k.needsUpdate=!1):!0===k.needsUpdate&&(l.bindBuffer(m,k.buffer),void 0===
+k.updateRange||-1===k.updateRange.count?l.bufferSubData(m,0,k.array):0===k.updateRange.count?console.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."):(l.bufferSubData(m,k.updateRange.offset*k.array.BYTES_PER_ELEMENT,k.array.subarray(k.updateRange.offset,k.updateRange.offset+k.updateRange.count)),k.updateRange.count=0),k.needsUpdate=!1)}else if(a instanceof THREE.Mesh){!0===
+b.groupsNeedUpdate&&t(a,b);for(var p=ib[b.id],f=0,n=p.length;f<n;f++){var q=p[f],r=c(a,q),s=r.attributes&&v(r);if(b.verticesNeedUpdate||b.morphTargetsNeedUpdate||b.elementsNeedUpdate||b.uvsNeedUpdate||b.normalsNeedUpdate||b.colorsNeedUpdate||b.tangentsNeedUpdate||s){var u=q,w=a,C=l.DYNAMIC_DRAW,A=!b.dynamic,F=r;if(u.__inittedArrays){var G=F&&void 0!==F.shading&&F.shading===THREE.SmoothShading,y=void 0,z=void 0,E=void 0,B=void 0,M=void 0,Q=void 0,P=void 0,L=void 0,K=void 0,T=void 0,R=void 0,J=void 0,
+I=void 0,N=void 0,U=void 0,wa=void 0,za=void 0,La=void 0,ya=void 0,Sa=void 0,aa=void 0,ca=void 0,Ea=void 0,Ra=void 0,ga=void 0,S=void 0,ma=void 0,fa=void 0,ja=void 0,V=void 0,qb=void 0,ra=void 0,na=void 0,cb=void 0,Fa=void 0,Ca=void 0,Ga=void 0,Xa=void 0,ka=void 0,sa=void 0,Ta=0,Ua=0,rb=0,xa=0,Ka=0,Ya=0,Da=0,jb=0,Ma=0,ha=0,oa=0,H=0,Aa=void 0,Za=u.__vertexArray,Qa=u.__uvArray,sb=u.__uv2Array,Va=u.__normalArray,pa=u.__tangentArray,Ha=u.__colorArray,Ia=u.__skinIndexArray,Ja=u.__skinWeightArray,nc=u.__morphTargetsArrays,
+Cb=u.__morphNormalsArrays,tb=u.__webglCustomAttributesList,D=void 0,ab=u.__faceArray,$a=u.__lineArray,$=w.geometry,kb=$.elementsNeedUpdate,Bb=$.uvsNeedUpdate,Fb=$.normalsNeedUpdate,xb=$.tangentsNeedUpdate,Pb=$.colorsNeedUpdate,ub=$.morphTargetsNeedUpdate,bb=$.vertices,Y=u.faces3,qa=$.faces,lb=$.faceVertexUvs[0],Wa=$.faceVertexUvs[1],yb=$.skinIndices,Hb=$.skinWeights,X=$.morphTargets,Qb=$.morphNormals;if($.verticesNeedUpdate){y=0;for(z=Y.length;y<z;y++)B=qa[Y[y]],J=bb[B.a],I=bb[B.b],N=bb[B.c],Za[Ua]=
+J.x,Za[Ua+1]=J.y,Za[Ua+2]=J.z,Za[Ua+3]=I.x,Za[Ua+4]=I.y,Za[Ua+5]=I.z,Za[Ua+6]=N.x,Za[Ua+7]=N.y,Za[Ua+8]=N.z,Ua+=9;l.bindBuffer(l.ARRAY_BUFFER,u.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,Za,C)}if(ub)for(Fa=0,Ca=X.length;Fa<Ca;Fa++){y=oa=0;for(z=Y.length;y<z;y++)ka=Y[y],B=qa[ka],J=X[Fa].vertices[B.a],I=X[Fa].vertices[B.b],N=X[Fa].vertices[B.c],Ga=nc[Fa],Ga[oa]=J.x,Ga[oa+1]=J.y,Ga[oa+2]=J.z,Ga[oa+3]=I.x,Ga[oa+4]=I.y,Ga[oa+5]=I.z,Ga[oa+6]=N.x,Ga[oa+7]=N.y,Ga[oa+8]=N.z,F.morphNormals&&(G?(sa=Qb[Fa].vertexNormals[ka],
+La=sa.a,ya=sa.b,Sa=sa.c):Sa=ya=La=Qb[Fa].faceNormals[ka],Xa=Cb[Fa],Xa[oa]=La.x,Xa[oa+1]=La.y,Xa[oa+2]=La.z,Xa[oa+3]=ya.x,Xa[oa+4]=ya.y,Xa[oa+5]=ya.z,Xa[oa+6]=Sa.x,Xa[oa+7]=Sa.y,Xa[oa+8]=Sa.z),oa+=9;l.bindBuffer(l.ARRAY_BUFFER,u.__webglMorphTargetsBuffers[Fa]);l.bufferData(l.ARRAY_BUFFER,nc[Fa],C);F.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,u.__webglMorphNormalsBuffers[Fa]),l.bufferData(l.ARRAY_BUFFER,Cb[Fa],C))}if(Hb.length){y=0;for(z=Y.length;y<z;y++)B=qa[Y[y]],Ra=Hb[B.a],ga=Hb[B.b],S=Hb[B.c],Ja[ha]=
+Ra.x,Ja[ha+1]=Ra.y,Ja[ha+2]=Ra.z,Ja[ha+3]=Ra.w,Ja[ha+4]=ga.x,Ja[ha+5]=ga.y,Ja[ha+6]=ga.z,Ja[ha+7]=ga.w,Ja[ha+8]=S.x,Ja[ha+9]=S.y,Ja[ha+10]=S.z,Ja[ha+11]=S.w,ma=yb[B.a],fa=yb[B.b],ja=yb[B.c],Ia[ha]=ma.x,Ia[ha+1]=ma.y,Ia[ha+2]=ma.z,Ia[ha+3]=ma.w,Ia[ha+4]=fa.x,Ia[ha+5]=fa.y,Ia[ha+6]=fa.z,Ia[ha+7]=fa.w,Ia[ha+8]=ja.x,Ia[ha+9]=ja.y,Ia[ha+10]=ja.z,Ia[ha+11]=ja.w,ha+=12;0<ha&&(l.bindBuffer(l.ARRAY_BUFFER,u.__webglSkinIndicesBuffer),l.bufferData(l.ARRAY_BUFFER,Ia,C),l.bindBuffer(l.ARRAY_BUFFER,u.__webglSkinWeightsBuffer),
+l.bufferData(l.ARRAY_BUFFER,Ja,C))}if(Pb){y=0;for(z=Y.length;y<z;y++)B=qa[Y[y]],P=B.vertexColors,L=B.color,3===P.length&&F.vertexColors===THREE.VertexColors?(aa=P[0],ca=P[1],Ea=P[2]):Ea=ca=aa=L,Ha[Ma]=aa.r,Ha[Ma+1]=aa.g,Ha[Ma+2]=aa.b,Ha[Ma+3]=ca.r,Ha[Ma+4]=ca.g,Ha[Ma+5]=ca.b,Ha[Ma+6]=Ea.r,Ha[Ma+7]=Ea.g,Ha[Ma+8]=Ea.b,Ma+=9;0<Ma&&(l.bindBuffer(l.ARRAY_BUFFER,u.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,Ha,C))}if(xb&&$.hasTangents){y=0;for(z=Y.length;y<z;y++)B=qa[Y[y]],K=B.vertexTangents,U=K[0],
+wa=K[1],za=K[2],pa[Da]=U.x,pa[Da+1]=U.y,pa[Da+2]=U.z,pa[Da+3]=U.w,pa[Da+4]=wa.x,pa[Da+5]=wa.y,pa[Da+6]=wa.z,pa[Da+7]=wa.w,pa[Da+8]=za.x,pa[Da+9]=za.y,pa[Da+10]=za.z,pa[Da+11]=za.w,Da+=12;l.bindBuffer(l.ARRAY_BUFFER,u.__webglTangentBuffer);l.bufferData(l.ARRAY_BUFFER,pa,C)}if(Fb){y=0;for(z=Y.length;y<z;y++)if(B=qa[Y[y]],M=B.vertexNormals,Q=B.normal,3===M.length&&G)for(V=0;3>V;V++)ra=M[V],Va[Ya]=ra.x,Va[Ya+1]=ra.y,Va[Ya+2]=ra.z,Ya+=3;else for(V=0;3>V;V++)Va[Ya]=Q.x,Va[Ya+1]=Q.y,Va[Ya+2]=Q.z,Ya+=3;l.bindBuffer(l.ARRAY_BUFFER,
+u.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,Va,C)}if(Bb&&lb){y=0;for(z=Y.length;y<z;y++)if(E=Y[y],T=lb[E],void 0!==T)for(V=0;3>V;V++)na=T[V],Qa[rb]=na.x,Qa[rb+1]=na.y,rb+=2;0<rb&&(l.bindBuffer(l.ARRAY_BUFFER,u.__webglUVBuffer),l.bufferData(l.ARRAY_BUFFER,Qa,C))}if(Bb&&Wa){y=0;for(z=Y.length;y<z;y++)if(E=Y[y],R=Wa[E],void 0!==R)for(V=0;3>V;V++)cb=R[V],sb[xa]=cb.x,sb[xa+1]=cb.y,xa+=2;0<xa&&(l.bindBuffer(l.ARRAY_BUFFER,u.__webglUV2Buffer),l.bufferData(l.ARRAY_BUFFER,sb,C))}if(kb){y=0;for(z=Y.length;y<
+z;y++)ab[Ka]=Ta,ab[Ka+1]=Ta+1,ab[Ka+2]=Ta+2,Ka+=3,$a[jb]=Ta,$a[jb+1]=Ta+1,$a[jb+2]=Ta,$a[jb+3]=Ta+2,$a[jb+4]=Ta+1,$a[jb+5]=Ta+2,jb+=6,Ta+=3;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u.__webglFaceBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,ab,C);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,$a,C)}if(tb)for(V=0,qb=tb.length;V<qb;V++)if(D=tb[V],D.__original.needsUpdate){H=0;if(1===D.size)if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=0,z=Y.length;y<z;y++)B=
+qa[Y[y]],D.array[H]=D.value[B.a],D.array[H+1]=D.value[B.b],D.array[H+2]=D.value[B.c],H+=3;else{if("faces"===D.boundTo)for(y=0,z=Y.length;y<z;y++)Aa=D.value[Y[y]],D.array[H]=Aa,D.array[H+1]=Aa,D.array[H+2]=Aa,H+=3}else if(2===D.size)if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=0,z=Y.length;y<z;y++)B=qa[Y[y]],J=D.value[B.a],I=D.value[B.b],N=D.value[B.c],D.array[H]=J.x,D.array[H+1]=J.y,D.array[H+2]=I.x,D.array[H+3]=I.y,D.array[H+4]=N.x,D.array[H+5]=N.y,H+=6;else{if("faces"===D.boundTo)for(y=0,
+z=Y.length;y<z;y++)N=I=J=Aa=D.value[Y[y]],D.array[H]=J.x,D.array[H+1]=J.y,D.array[H+2]=I.x,D.array[H+3]=I.y,D.array[H+4]=N.x,D.array[H+5]=N.y,H+=6}else if(3===D.size){var O;O="c"===D.type?["r","g","b"]:["x","y","z"];if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=0,z=Y.length;y<z;y++)B=qa[Y[y]],J=D.value[B.a],I=D.value[B.b],N=D.value[B.c],D.array[H]=J[O[0]],D.array[H+1]=J[O[1]],D.array[H+2]=J[O[2]],D.array[H+3]=I[O[0]],D.array[H+4]=I[O[1]],D.array[H+5]=I[O[2]],D.array[H+6]=N[O[0]],D.array[H+7]=
+N[O[1]],D.array[H+8]=N[O[2]],H+=9;else if("faces"===D.boundTo)for(y=0,z=Y.length;y<z;y++)N=I=J=Aa=D.value[Y[y]],D.array[H]=J[O[0]],D.array[H+1]=J[O[1]],D.array[H+2]=J[O[2]],D.array[H+3]=I[O[0]],D.array[H+4]=I[O[1]],D.array[H+5]=I[O[2]],D.array[H+6]=N[O[0]],D.array[H+7]=N[O[1]],D.array[H+8]=N[O[2]],H+=9;else if("faceVertices"===D.boundTo)for(y=0,z=Y.length;y<z;y++)Aa=D.value[Y[y]],J=Aa[0],I=Aa[1],N=Aa[2],D.array[H]=J[O[0]],D.array[H+1]=J[O[1]],D.array[H+2]=J[O[2]],D.array[H+3]=I[O[0]],D.array[H+4]=
+I[O[1]],D.array[H+5]=I[O[2]],D.array[H+6]=N[O[0]],D.array[H+7]=N[O[1]],D.array[H+8]=N[O[2]],H+=9}else if(4===D.size)if(void 0===D.boundTo||"vertices"===D.boundTo)for(y=0,z=Y.length;y<z;y++)B=qa[Y[y]],J=D.value[B.a],I=D.value[B.b],N=D.value[B.c],D.array[H]=J.x,D.array[H+1]=J.y,D.array[H+2]=J.z,D.array[H+3]=J.w,D.array[H+4]=I.x,D.array[H+5]=I.y,D.array[H+6]=I.z,D.array[H+7]=I.w,D.array[H+8]=N.x,D.array[H+9]=N.y,D.array[H+10]=N.z,D.array[H+11]=N.w,H+=12;else if("faces"===D.boundTo)for(y=0,z=Y.length;y<
+z;y++)N=I=J=Aa=D.value[Y[y]],D.array[H]=J.x,D.array[H+1]=J.y,D.array[H+2]=J.z,D.array[H+3]=J.w,D.array[H+4]=I.x,D.array[H+5]=I.y,D.array[H+6]=I.z,D.array[H+7]=I.w,D.array[H+8]=N.x,D.array[H+9]=N.y,D.array[H+10]=N.z,D.array[H+11]=N.w,H+=12;else if("faceVertices"===D.boundTo)for(y=0,z=Y.length;y<z;y++)Aa=D.value[Y[y]],J=Aa[0],I=Aa[1],N=Aa[2],D.array[H]=J.x,D.array[H+1]=J.y,D.array[H+2]=J.z,D.array[H+3]=J.w,D.array[H+4]=I.x,D.array[H+5]=I.y,D.array[H+6]=I.z,D.array[H+7]=I.w,D.array[H+8]=N.x,D.array[H+
+9]=N.y,D.array[H+10]=N.z,D.array[H+11]=N.w,H+=12;l.bindBuffer(l.ARRAY_BUFFER,D.buffer);l.bufferData(l.ARRAY_BUFFER,D.array,C)}A&&(delete u.__inittedArrays,delete u.__colorArray,delete u.__normalArray,delete u.__tangentArray,delete u.__uvArray,delete u.__uv2Array,delete u.__faceArray,delete u.__vertexArray,delete u.__lineArray,delete u.__skinIndexArray,delete u.__skinWeightArray)}}}b.verticesNeedUpdate=!1;b.morphTargetsNeedUpdate=!1;b.elementsNeedUpdate=!1;b.uvsNeedUpdate=!1;b.normalsNeedUpdate=!1;
+b.colorsNeedUpdate=!1;b.tangentsNeedUpdate=!1;r.attributes&&x(r)}else if(a instanceof THREE.Line){r=c(a,b);s=r.attributes&&v(r);if(b.verticesNeedUpdate||b.colorsNeedUpdate||b.lineDistancesNeedUpdate||s){var Z=l.DYNAMIC_DRAW,W,Ba,la,Db,ba,zb,mb=b.vertices,ta=b.colors,Rb=b.lineDistances,Kb=mb.length,nb=ta.length,Sb=Rb.length,fb=b.__vertexArray,Eb=b.__colorArray,Ab=b.__lineDistanceArray,Mb=b.colorsNeedUpdate,ob=b.lineDistancesNeedUpdate,gb=b.__webglCustomAttributesList,db,hb,ua,Ib,Na,da;if(b.verticesNeedUpdate){for(W=
+0;W<Kb;W++)Db=mb[W],ba=3*W,fb[ba]=Db.x,fb[ba+1]=Db.y,fb[ba+2]=Db.z;l.bindBuffer(l.ARRAY_BUFFER,b.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,fb,Z)}if(Mb){for(Ba=0;Ba<nb;Ba++)zb=ta[Ba],ba=3*Ba,Eb[ba]=zb.r,Eb[ba+1]=zb.g,Eb[ba+2]=zb.b;l.bindBuffer(l.ARRAY_BUFFER,b.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,Eb,Z)}if(ob){for(la=0;la<Sb;la++)Ab[la]=Rb[la];l.bindBuffer(l.ARRAY_BUFFER,b.__webglLineDistanceBuffer);l.bufferData(l.ARRAY_BUFFER,Ab,Z)}if(gb)for(db=0,hb=gb.length;db<hb;db++)if(da=gb[db],
+da.needsUpdate&&(void 0===da.boundTo||"vertices"===da.boundTo)){ba=0;Ib=da.value.length;if(1===da.size)for(ua=0;ua<Ib;ua++)da.array[ua]=da.value[ua];else if(2===da.size)for(ua=0;ua<Ib;ua++)Na=da.value[ua],da.array[ba]=Na.x,da.array[ba+1]=Na.y,ba+=2;else if(3===da.size)if("c"===da.type)for(ua=0;ua<Ib;ua++)Na=da.value[ua],da.array[ba]=Na.r,da.array[ba+1]=Na.g,da.array[ba+2]=Na.b,ba+=3;else for(ua=0;ua<Ib;ua++)Na=da.value[ua],da.array[ba]=Na.x,da.array[ba+1]=Na.y,da.array[ba+2]=Na.z,ba+=3;else if(4===
+da.size)for(ua=0;ua<Ib;ua++)Na=da.value[ua],da.array[ba]=Na.x,da.array[ba+1]=Na.y,da.array[ba+2]=Na.z,da.array[ba+3]=Na.w,ba+=4;l.bindBuffer(l.ARRAY_BUFFER,da.buffer);l.bufferData(l.ARRAY_BUFFER,da.array,Z);da.needsUpdate=!1}}b.verticesNeedUpdate=!1;b.colorsNeedUpdate=!1;b.lineDistancesNeedUpdate=!1;r.attributes&&x(r)}else if(a instanceof THREE.PointCloud){r=c(a,b);s=r.attributes&&v(r);if(b.verticesNeedUpdate||b.colorsNeedUpdate||s){var Pa=l.DYNAMIC_DRAW,Tb,Ub,$b,ia,ac,vb=b.vertices,wb=vb.length,
+Lb=b.colors,Vb=Lb.length,bc=b.__vertexArray,cc=b.__colorArray,Wb=b.colorsNeedUpdate,Gb=b.__webglCustomAttributesList,dc,pb,va,Jb,Oa,ea;if(b.verticesNeedUpdate){for(Tb=0;Tb<wb;Tb++)$b=vb[Tb],ia=3*Tb,bc[ia]=$b.x,bc[ia+1]=$b.y,bc[ia+2]=$b.z;l.bindBuffer(l.ARRAY_BUFFER,b.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,bc,Pa)}if(Wb){for(Ub=0;Ub<Vb;Ub++)ac=Lb[Ub],ia=3*Ub,cc[ia]=ac.r,cc[ia+1]=ac.g,cc[ia+2]=ac.b;l.bindBuffer(l.ARRAY_BUFFER,b.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,cc,Pa)}if(Gb)for(dc=
+0,pb=Gb.length;dc<pb;dc++){ea=Gb[dc];if(ea.needsUpdate&&(void 0===ea.boundTo||"vertices"===ea.boundTo))if(Jb=ea.value.length,ia=0,1===ea.size)for(va=0;va<Jb;va++)ea.array[va]=ea.value[va];else if(2===ea.size)for(va=0;va<Jb;va++)Oa=ea.value[va],ea.array[ia]=Oa.x,ea.array[ia+1]=Oa.y,ia+=2;else if(3===ea.size)if("c"===ea.type)for(va=0;va<Jb;va++)Oa=ea.value[va],ea.array[ia]=Oa.r,ea.array[ia+1]=Oa.g,ea.array[ia+2]=Oa.b,ia+=3;else for(va=0;va<Jb;va++)Oa=ea.value[va],ea.array[ia]=Oa.x,ea.array[ia+1]=Oa.y,
+ea.array[ia+2]=Oa.z,ia+=3;else if(4===ea.size)for(va=0;va<Jb;va++)Oa=ea.value[va],ea.array[ia]=Oa.x,ea.array[ia+1]=Oa.y,ea.array[ia+2]=Oa.z,ea.array[ia+3]=Oa.w,ia+=4;l.bindBuffer(l.ARRAY_BUFFER,ea.buffer);l.bufferData(l.ARRAY_BUFFER,ea.array,Pa);ea.needsUpdate=!1}}b.verticesNeedUpdate=!1;b.colorsNeedUpdate=!1;r.attributes&&x(r)}}function v(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function x(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function C(a,
+b,c,d,e){var f,g,h,k;Kb=0;if(d.needsUpdate){d.program&&oc(d);d.addEventListener("dispose",pc);var m=Fc[d.type];if(m){var p=THREE.ShaderLib[m];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 n=0,q=0,r=0,t=0,s=0,u=b.length;s<u;s++){var v=b[s];v.onlyShadow||!1===v.visible||(v instanceof THREE.DirectionalLight&&n++,
+v instanceof THREE.PointLight&&q++,v instanceof THREE.SpotLight&&r++,v instanceof THREE.HemisphereLight&&t++)}f=n;g=q;h=r;k=t;for(var x,C=0,A=0,G=b.length;A<G;A++){var E=b[A];E.castShadow&&(E instanceof THREE.SpotLight&&C++,E instanceof THREE.DirectionalLight&&!E.shadowCascade&&C++)}x=C;var J;if(Lb&&e&&e.skeleton&&e.skeleton.useVertexTexture)J=1024;else{var I=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),N=Math.floor((I-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(N=Math.min(e.skeleton.bones.length,
+N),N<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+N+" (try OpenGL instead of ANGLE)"));J=N}var Q={precision:U,supportsVertexTextures:Vb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,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,sizeAttenuation:d.sizeAttenuation,
+logarithmicDepthBuffer:ra,skinning:d.skinning,maxBones:J,useVertexTexture:Lb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:B.maxMorphTargets,maxMorphNormals:B.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:x,shadowMapEnabled:B.shadowMapEnabled&&e.receiveShadow&&0<x,shadowMapType:B.shadowMapType,shadowMapDebug:B.shadowMapDebug,shadowMapCascade:B.shadowMapCascade,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 Q)K.push(L),K.push(Q[L]);for(var R=K.join(),wa,za=0,La=cb.length;za<La;za++){var ya=cb[za];if(ya.code===R){wa=ya;wa.usedTimes++;break}}void 0===wa&&(wa=new THREE.WebGLProgram(B,R,d,Q),cb.push(wa),B.info.memory.programs=cb.length);d.program=wa;var Sa=wa.attributes;
+if(d.morphTargets){d.numSupportedMorphTargets=0;for(var aa,ca="morphTarget",Ea=0;Ea<B.maxMorphTargets;Ea++)aa=ca+Ea,0<=Sa[aa]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,ca="morphNormal",Ea=0;Ea<B.maxMorphNormals;Ea++)aa=ca+Ea,0<=Sa[aa]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var Ra in d.__webglShader.uniforms){var ja=d.program.uniforms[Ra];ja&&d.uniformsList.push([d.__webglShader.uniforms[Ra],ja])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&
+(e.__webglMorphTargetInfluences=new Float32Array(B.maxMorphTargets));var qb=!1,na=!1,sa=!1,xa=d.program,ga=xa.uniforms,S=d.__webglShader.uniforms;xa.id!==Wb&&(l.useProgram(xa.program),Wb=xa.id,sa=na=qb=!0);d.id!==Bb&&(-1===Bb&&(sa=!0),Bb=d.id,na=!0);if(qb||a!==Fb)l.uniformMatrix4fv(ga.projectionMatrix,!1,a.projectionMatrix.elements),ra&&l.uniform1f(ga.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Fb&&(Fb=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==
+ga.cameraPosition&&(Ca.setFromMatrixPosition(a.matrixWorld),l.uniform3f(ga.cameraPosition,Ca.x,Ca.y,Ca.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==ga.viewMatrix&&l.uniformMatrix4fv(ga.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==ga.bindMatrix&&l.uniformMatrix4fv(ga.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==
+ga.bindMatrixInverse&&l.uniformMatrix4fv(ga.bindMatrixInverse,!1,e.bindMatrixInverse.elements),Lb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==ga.boneTexture){var Ka=y();l.uniform1i(ga.boneTexture,Ka);B.setTexture(e.skeleton.boneTexture,Ka)}null!==ga.boneTextureWidth&&l.uniform1i(ga.boneTextureWidth,e.skeleton.boneTextureWidth);null!==ga.boneTextureHeight&&l.uniform1i(ga.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==ga.boneGlobalMatrices&&
+l.uniformMatrix4fv(ga.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(Mb){var sa=!0,fa,eb,V,Qa=0,db=0,gb=0,Pa,Fa,ib,Ga,Xa,ka=qc,hb=ka.directional.colors,Ta=ka.directional.positions,Ua=ka.point.colors,rb=ka.point.positions,ub=ka.point.distances,
+vb=ka.point.decays,Ya=ka.spot.colors,Da=ka.spot.positions,jb=ka.spot.distances,Ma=ka.spot.directions,ha=ka.spot.anglesCos,oa=ka.spot.exponents,H=ka.spot.decays,Aa=ka.hemi.skyColors,Za=ka.hemi.groundColors,ob=ka.hemi.positions,sb=0,Va=0,pa=0,Ha=0,Ia=0,Ja=0,pb=0,Cb=0,tb=0,D=0,ab=0,$a=0;fa=0;for(eb=b.length;fa<eb;fa++)V=b[fa],V.onlyShadow||(Pa=V.color,Ga=V.intensity,Xa=V.distance,V instanceof THREE.AmbientLight?V.visible&&(Qa+=Pa.r,db+=Pa.g,gb+=Pa.b):V instanceof THREE.DirectionalLight?(Ia+=1,V.visible&&
+(ma.setFromMatrixPosition(V.matrixWorld),Ca.setFromMatrixPosition(V.target.matrixWorld),ma.sub(Ca),ma.normalize(),tb=3*sb,Ta[tb]=ma.x,Ta[tb+1]=ma.y,Ta[tb+2]=ma.z,F(hb,tb,Pa,Ga),sb+=1)):V instanceof THREE.PointLight?(Ja+=1,V.visible&&(D=3*Va,F(Ua,D,Pa,Ga),Ca.setFromMatrixPosition(V.matrixWorld),rb[D]=Ca.x,rb[D+1]=Ca.y,rb[D+2]=Ca.z,ub[Va]=Xa,vb[Va]=0===V.distance?0:V.decay,Va+=1)):V instanceof THREE.SpotLight?(pb+=1,V.visible&&(ab=3*pa,F(Ya,ab,Pa,Ga),ma.setFromMatrixPosition(V.matrixWorld),Da[ab]=ma.x,
+Da[ab+1]=ma.y,Da[ab+2]=ma.z,jb[pa]=Xa,Ca.setFromMatrixPosition(V.target.matrixWorld),ma.sub(Ca),ma.normalize(),Ma[ab]=ma.x,Ma[ab+1]=ma.y,Ma[ab+2]=ma.z,ha[pa]=Math.cos(V.angle),oa[pa]=V.exponent,H[pa]=0===V.distance?0:V.decay,pa+=1)):V instanceof THREE.HemisphereLight&&(Cb+=1,V.visible&&(ma.setFromMatrixPosition(V.matrixWorld),ma.normalize(),$a=3*Ha,ob[$a]=ma.x,ob[$a+1]=ma.y,ob[$a+2]=ma.z,Fa=V.color,ib=V.groundColor,F(Aa,$a,Fa,Ga),F(Za,$a,ib,Ga),Ha+=1)));fa=3*sb;for(eb=Math.max(hb.length,3*Ia);fa<
+eb;fa++)hb[fa]=0;fa=3*Va;for(eb=Math.max(Ua.length,3*Ja);fa<eb;fa++)Ua[fa]=0;fa=3*pa;for(eb=Math.max(Ya.length,3*pb);fa<eb;fa++)Ya[fa]=0;fa=3*Ha;for(eb=Math.max(Aa.length,3*Cb);fa<eb;fa++)Aa[fa]=0;fa=3*Ha;for(eb=Math.max(Za.length,3*Cb);fa<eb;fa++)Za[fa]=0;ka.directional.length=sb;ka.point.length=Va;ka.spot.length=pa;ka.hemi.length=Ha;ka.ambient[0]=Qa;ka.ambient[1]=db;ka.ambient[2]=gb;Mb=!1}if(sa){var $=qc;S.ambientLightColor.value=$.ambient;S.directionalLightColor.value=$.directional.colors;S.directionalLightDirection.value=
+$.directional.positions;S.pointLightColor.value=$.point.colors;S.pointLightPosition.value=$.point.positions;S.pointLightDistance.value=$.point.distances;S.pointLightDecay.value=$.point.decays;S.spotLightColor.value=$.spot.colors;S.spotLightPosition.value=$.spot.positions;S.spotLightDistance.value=$.spot.distances;S.spotLightDirection.value=$.spot.directions;S.spotLightAngleCos.value=$.spot.anglesCos;S.spotLightExponent.value=$.spot.exponents;S.spotLightDecay.value=$.spot.decays;S.hemisphereLightSkyColor.value=
+$.hemi.skyColors;S.hemisphereLightGroundColor.value=$.hemi.groundColors;S.hemisphereLightDirection.value=$.hemi.positions;w(S,!0)}else w(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.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 kb;d.map?kb=d.map:d.specularMap?kb=d.specularMap:d.normalMap?kb=d.normalMap:d.bumpMap?kb=d.bumpMap:d.alphaMap&&(kb=d.alphaMap);if(void 0!==kb){var wb=kb.offset,Nb=kb.repeat;S.offsetRepeat.value.set(wb.x,wb.y,Nb.x,Nb.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}d instanceof THREE.LineBasicMaterial?
+(S.diffuse.value=d.color,S.opacity.value=d.opacity):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):d instanceof THREE.PointCloudMaterial?(S.psColor.value=d.color,S.opacity.value=d.opacity,S.size.value=d.size,S.scale.value=P.height/2,S.map.value=d.map):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 xb=0,Pb=0,Xb=b.length;Pb<Xb;Pb++){var bb=b[Pb];bb.castShadow&&(bb instanceof THREE.SpotLight||bb instanceof THREE.DirectionalLight&&
+!bb.shadowCascade)&&(S.shadowMap.value[xb]=bb.shadowMap,S.shadowMapSize.value[xb]=bb.shadowMapSize,S.shadowMatrix.value[xb]=bb.shadowMatrix,S.shadowDarkness.value[xb]=bb.shadowDarkness,S.shadowBias.value[xb]=bb.shadowBias,xb++)}for(var Y=d.uniformsList,qa,lb,Wa,yb=0,Hb=Y.length;yb<Hb;yb++){var X=Y[yb][0];if(!1!==X.needsUpdate){var Qb=X.type,O=X.value,Z=Y[yb][1];switch(Qb){case "1i":l.uniform1i(Z,O);break;case "1f":l.uniform1f(Z,O);break;case "2f":l.uniform2f(Z,O[0],O[1]);break;case "3f":l.uniform3f(Z,
+O[0],O[1],O[2]);break;case "4f":l.uniform4f(Z,O[0],O[1],O[2],O[3]);break;case "1iv":l.uniform1iv(Z,O);break;case "3iv":l.uniform3iv(Z,O);break;case "1fv":l.uniform1fv(Z,O);break;case "2fv":l.uniform2fv(Z,O);break;case "3fv":l.uniform3fv(Z,O);break;case "4fv":l.uniform4fv(Z,O);break;case "Matrix3fv":l.uniformMatrix3fv(Z,!1,O);break;case "Matrix4fv":l.uniformMatrix4fv(Z,!1,O);break;case "i":l.uniform1i(Z,O);break;case "f":l.uniform1f(Z,O);break;case "v2":l.uniform2f(Z,O.x,O.y);break;case "v3":l.uniform3f(Z,
+O.x,O.y,O.z);break;case "v4":l.uniform4f(Z,O.x,O.y,O.z,O.w);break;case "c":l.uniform3f(Z,O.r,O.g,O.b);break;case "iv1":l.uniform1iv(Z,O);break;case "iv":l.uniform3iv(Z,O);break;case "fv1":l.uniform1fv(Z,O);break;case "fv":l.uniform3fv(Z,O);break;case "v2v":void 0===X._array&&(X._array=new Float32Array(2*O.length));for(var W=0,Ba=O.length;W<Ba;W++)Wa=2*W,X._array[Wa]=O[W].x,X._array[Wa+1]=O[W].y;l.uniform2fv(Z,X._array);break;case "v3v":void 0===X._array&&(X._array=new Float32Array(3*O.length));W=
+0;for(Ba=O.length;W<Ba;W++)Wa=3*W,X._array[Wa]=O[W].x,X._array[Wa+1]=O[W].y,X._array[Wa+2]=O[W].z;l.uniform3fv(Z,X._array);break;case "v4v":void 0===X._array&&(X._array=new Float32Array(4*O.length));W=0;for(Ba=O.length;W<Ba;W++)Wa=4*W,X._array[Wa]=O[W].x,X._array[Wa+1]=O[W].y,X._array[Wa+2]=O[W].z,X._array[Wa+3]=O[W].w;l.uniform4fv(Z,X._array);break;case "m3":l.uniformMatrix3fv(Z,!1,O.elements);break;case "m3v":void 0===X._array&&(X._array=new Float32Array(9*O.length));W=0;for(Ba=O.length;W<Ba;W++)O[W].flattenToArrayOffset(X._array,
+9*W);l.uniformMatrix3fv(Z,!1,X._array);break;case "m4":l.uniformMatrix4fv(Z,!1,O.elements);break;case "m4v":void 0===X._array&&(X._array=new Float32Array(16*O.length));W=0;for(Ba=O.length;W<Ba;W++)O[W].flattenToArrayOffset(X._array,16*W);l.uniformMatrix4fv(Z,!1,X._array);break;case "t":qa=O;lb=y();l.uniform1i(Z,lb);if(!qa)continue;if(qa instanceof THREE.CubeTexture||qa.image instanceof Array&&6===qa.image.length){var la=qa,Db=lb;if(6===la.image.length)if(la.needsUpdate){la.image.__webglTextureCube||
+(la.addEventListener("dispose",Gb),la.image.__webglTextureCube=l.createTexture(),B.info.memory.textures++);l.activeTexture(l.TEXTURE0+Db);l.bindTexture(l.TEXTURE_CUBE_MAP,la.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,la.flipY);for(var ba=la instanceof THREE.CompressedTexture,zb=la.image[0]instanceof THREE.DataTexture,mb=[],ta=0;6>ta;ta++)mb[ta]=!B.autoScaleCubemaps||ba||zb?zb?la.image[ta].image:la.image[ta]:M(la.image[ta],Gc);var Rb=mb[0],Ob=THREE.Math.isPowerOfTwo(Rb.width)&&THREE.Math.isPowerOfTwo(Rb.height),
+nb=T(la.format),Sb=T(la.type);z(l.TEXTURE_CUBE_MAP,la,Ob);for(ta=0;6>ta;ta++)if(ba)for(var fb,Eb=mb[ta].mipmaps,Ab=0,Yb=Eb.length;Ab<Yb;Ab++)fb=Eb[Ab],la.format!==THREE.RGBAFormat&&la.format!==THREE.RGBFormat?-1<rc().indexOf(nb)?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ta,Ab,nb,fb.width,fb.height,0,fb.data):console.warn("Attempt to load unsupported compressed texture format"):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ta,Ab,nb,fb.width,fb.height,0,nb,Sb,fb.data);else zb?l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+
+ta,0,nb,mb[ta].width,mb[ta].height,0,nb,Sb,mb[ta].data):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ta,0,nb,nb,Sb,mb[ta]);la.generateMipmaps&&Ob&&l.generateMipmap(l.TEXTURE_CUBE_MAP);la.needsUpdate=!1;if(la.onUpdate)la.onUpdate()}else l.activeTexture(l.TEXTURE0+Db),l.bindTexture(l.TEXTURE_CUBE_MAP,la.image.__webglTextureCube)}else if(qa instanceof THREE.WebGLRenderTargetCube){var Zb=qa;l.activeTexture(l.TEXTURE0+lb);l.bindTexture(l.TEXTURE_CUBE_MAP,Zb.__webglTexture)}else B.setTexture(qa,lb);break;
+case "tv":void 0===X._array&&(X._array=[]);W=0;for(Ba=X.value.length;W<Ba;W++)X._array[W]=y();l.uniform1iv(Z,X._array);W=0;for(Ba=X.value.length;W<Ba;W++)qa=X.value[W],lb=X._array[W],qa&&B.setTexture(qa,lb);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Qb)}}}}l.uniformMatrix4fv(ga.modelViewMatrix,!1,e._modelViewMatrix.elements);ga.normalMatrix&&l.uniformMatrix3fv(ga.normalMatrix,!1,e._normalMatrix.elements);null!==ga.modelMatrix&&l.uniformMatrix4fv(ga.modelMatrix,!1,e.matrixWorld.elements);
+return xa}function w(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 y(){var a=Kb;a>=sc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+sc);Kb+=1;return a}function A(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function F(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function G(a){a*=Q;a!==tc&&(l.lineWidth(a),
+tc=a)}function E(a,b,c){uc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),uc=a);!a||vc===b&&wc===c||(l.polygonOffset(b,c),vc=b,wc=c)}function z(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,T(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,T(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,T(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,T(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&
+b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT is set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),l.texParameteri(a,l.TEXTURE_MAG_FILTER,L(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,L(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( "+
+b.sourceFile+" )"));(c=aa.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(l.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,B.getMaxAnisotropy())),b.__oldAnisotropy=b.anisotropy)}function M(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);
+console.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+".");return d}return a}function J(a,b){l.bindRenderbuffer(l.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,
+l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function K(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function L(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?
+l.NEAREST:l.LINEAR}function T(a){var b;if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;if(a===
 THREE.LinearMipMapLinearFilter)return l.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return l.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return l.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return l.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return l.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return l.BYTE;if(a===THREE.ShortType)return l.SHORT;if(a===THREE.UnsignedShortType)return l.UNSIGNED_SHORT;if(a===THREE.IntType)return l.INT;if(a===THREE.UnsignedIntType)return l.UNSIGNED_INT;
 if(a===THREE.FloatType)return l.FLOAT;if(a===THREE.AlphaFormat)return l.ALPHA;if(a===THREE.RGBFormat)return l.RGB;if(a===THREE.RGBAFormat)return l.RGBA;if(a===THREE.LuminanceFormat)return l.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return l.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return l.FUNC_ADD;if(a===THREE.SubtractEquation)return l.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return l.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return l.ZERO;if(a===THREE.OneFactor)return l.ONE;if(a===
 THREE.SrcColorFactor)return l.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return l.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return l.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return l.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return l.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return l.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return l.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return l.SRC_ALPHA_SATURATE;
-b=ca.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=ca.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=ca.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 V=void 0!==a.canvas?a.canvas:document.createElement("canvas"),R=void 0!==a.context?a.context:null,J=1,S=void 0!==a.precision?a.precision:"highp",
-oa=void 0!==a.alpha?a.alpha:!1,aa=void 0!==a.depth?a.depth:!0,ta=void 0!==a.stencil?a.stencil:!0,P=void 0!==a.antialias?a.antialias:!1,Ca=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,pa=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Xa=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,U=new THREE.Color(0),Qa=0,xa=[],Ea={},Fa=[],Ra=[],Ga=[],eb=[],fb=[];this.domElement=V;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=
-this.autoClear=!0;this.gammaFactor=2;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!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 I=this,Wa=[],Wb=null,Ab=null,zb=-1,ma="",Fb=null,Kb=0,qb=-1,Nb=-1,Xb=-1,Ob=-1,Yb=-1,Zb=-1,ec=-1,fc=-1,gc=
--1,hc=-1,ic=-1,uc=null,vc=null,wc=null,tc=null,hb=0,db=0,ib=V.width,Pa=V.height,xc=0,yc=0,jb=new Uint8Array(16),Da=new Uint8Array(16),tb=new THREE.Frustum,ub=new THREE.Matrix4;new THREE.Matrix4;var ya=new THREE.Vector3,na=new THREE.Vector3,Mb=!0,qc={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:[]}},l;try{var zc={alpha:oa,depth:aa,stencil:ta,antialias:P,premultipliedAlpha:Ca,preserveDrawingBuffer:pa};l=R||V.getContext("webgl",zc)||V.getContext("experimental-webgl",zc);if(null===l){if(null!==V.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}V.addEventListener("webglcontextlost",function(a){a.preventDefault();Ac();Bc();Ea={}},!1)}catch(Hc){console.error(Hc)}void 0===l.getShaderPrecisionFormat&&
-(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var ca=new THREE.WebGLExtensions(l);ca.get("OES_texture_float");ca.get("OES_texture_float_linear");ca.get("OES_standard_derivatives");Xa&&ca.get("EXT_frag_depth");var jc=function(a,b,c,d){!0===Ca&&(a*=d,b*=d,c*=d);l.clearColor(a,b,c,d)},Bc=function(){l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);
-l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(hb,db,ib,Pa);jc(U.r,U.g,U.b,Qa)},Ac=function(){Fb=Wb=null;Nb=qb=ic=hc=Xb=-1;ma="";zb=-1;Mb=!0;for(var a=0;a<Da.length;a++)Da[a]=0};Bc();this.context=l;var sc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Ic=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Jc=l.getParameter(l.MAX_TEXTURE_SIZE),Gc=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),Vb=0<Ic,Lb=Vb&&ca.get("OES_texture_float"),Kc=l.getShaderPrecisionFormat(l.VERTEX_SHADER,
-l.HIGH_FLOAT),Lc=l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_FLOAT);var Mc=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT),Nc=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT);var rc=function(){var a;return function(){if(void 0!==a)return a;a=[];if(ca.get("WEBGL_compressed_texture_pvrtc")||ca.get("WEBGL_compressed_texture_s3tc"))for(var b=l.getParameter(l.COMPRESSED_TEXTURE_FORMATS),
-c=0;c<b.length;c++)a.push(b[c]);return a}}(),Oc=0<Kc.precision&&0<Mc.precision,Cc=0<Lc.precision&&0<Nc.precision;"highp"!==S||Oc||(Cc?(S="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(S="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==S||Cc||(S="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Pc=new THREE.ShadowMapPlugin(this,xa,Ea,Fa),Qc=new THREE.SpritePlugin(this,eb),Rc=
-new THREE.LensFlarePlugin(this,fb);this.getContext=function(){return l};this.forceContextLoss=function(){ca.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return Vb};this.supportsFloatTextures=function(){return ca.get("OES_texture_float")};this.supportsStandardDerivatives=function(){return ca.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return ca.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return ca.get("WEBGL_compressed_texture_pvrtc")};
-this.supportsBlendMinMax=function(){return ca.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=ca.get("EXT_texture_filter_anisotropic");return a=null!==b?l.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return S};this.getPixelRatio=function(){return J};this.setPixelRatio=function(a){J=a};this.setSize=function(a,b,c){V.width=a*J;V.height=b*J;!1!==c&&(V.style.width=a+"px",V.style.height=b+"px");this.setViewport(0,
-0,a,b)};this.setViewport=function(a,b,c,d){hb=a*J;db=b*J;ib=c*J;Pa=d*J;l.viewport(hb,db,ib,Pa)};this.setScissor=function(a,b,c,d){l.scissor(a*J,b*J,c*J,d*J)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.getClearColor=function(){return U};this.setClearColor=function(a,b){U.set(a);Qa=void 0!==b?b:1;jc(U.r,U.g,U.b,Qa)};this.getClearAlpha=function(){return Qa};this.setClearAlpha=function(a){Qa=a;jc(U.r,U.g,U.b,Qa)};this.clear=function(a,b,c){var d=0;if(void 0===
-a||a)d|=l.COLOR_BUFFER_BIT;if(void 0===b||b)d|=l.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};this.clearColor=function(){l.clear(l.COLOR_BUFFER_BIT)};this.clearDepth=function(){l.clear(l.DEPTH_BUFFER_BIT)};this.clearStencil=function(){l.clear(l.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=Ac;var kc=function(a){a.target.traverse(function(a){a.removeEventListener("remove",kc);if(a instanceof THREE.Mesh||
-a instanceof THREE.PointCloud||a instanceof THREE.Line)delete Ea[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=Fa,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})},lc=function(a){a=a.target;a.removeEventListener("dispose",lc);delete a.__webglInit;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(l.deleteBuffer(c.buffer),
-delete c.buffer)}I.info.memory.geometries--}else if(b=kb[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++)l.deleteBuffer(e.__webglMorphTargetsBuffers[f]);delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)l.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}Dc(e)}delete kb[a.id]}else Dc(a);ma=""},Gb=function(a){a=a.target;a.removeEventListener("dispose",
-Gb);a.image&&a.image.__webglTextureCube?(l.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(l.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);I.info.memory.textures--},Ec=function(a){a=a.target;a.removeEventListener("dispose",Ec);if(a&&void 0!==a.__webglTexture){l.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),
-l.deleteRenderbuffer(a.__webglRenderbuffer[b]);else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}I.info.memory.textures--},pc=function(a){a=a.target;a.removeEventListener("dispose",pc);oc(a)},Dc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),
-c=0,d=b.length;c<d;c++){var e=b[c];void 0!==a[e]&&(l.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)l.deleteBuffer(a.__webglCustomAttributesList[e].buffer);delete a.__webglCustomAttributesList}I.info.memory.geometries--},oc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Wa.length;a<c;a++)if(d=Wa[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=Wa.length;a<
-c;a++)d=Wa[a],d.program!==b&&e.push(d);Wa=e;l.deleteProgram(b);I.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){f();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=l.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=l.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=l.createBuffer());a.hasPositions&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),
-l.bufferData(l.ARRAY_BUFFER,a.positionArray,l.DYNAMIC_DRAW),g(b.attributes.position),l.vertexAttribPointer(b.attributes.position,3,l.FLOAT,!1,0,0));if(a.hasNormals){l.bindBuffer(l.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,k,m,n,p,q,r,t,s,v,u=3*a.count;for(v=0;v<u;v+=9)s=a.normalArray,d=s[v],e=s[v+1],k=s[v+2],m=s[v+3],p=s[v+4],r=s[v+5],n=s[v+6],q=s[v+7],t=s[v+8],d=(d+m+n)/3,e=(e+p+q)/3,k=(k+r+t)/3,s[v]=d,s[v+1]=e,s[v+2]=k,s[v+3]=d,s[v+4]=e,s[v+5]=k,s[v+6]=d,s[v+
-7]=e,s[v+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);g(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),l.bufferData(l.ARRAY_BUFFER,a.uvArray,l.DYNAMIC_DRAW),g(b.attributes.uv),l.vertexAttribPointer(b.attributes.uv,2,l.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,a.colorArray,l.DYNAMIC_DRAW),
-g(b.attributes.color),l.vertexAttribPointer(b.attributes.color,3,l.FLOAT,!1,0,0));h();l.drawArrays(l.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,g,h){if(!1!==d.visible)if(v(h),a=x(a,b,c,d,h),b=!1,c="direct_"+g.id+"_"+a.id+"_"+(d.wireframe?1:0),c!==ma&&(ma=c,b=!0),b&&f(),h instanceof THREE.Mesh){h=!0===d.wireframe?l.LINES:l.TRIANGLES;var k=g.attributes.index;if(k){var m,n;k.array instanceof Uint32Array&&ca.get("OES_element_index_uint")?(m=l.UNSIGNED_INT,n=4):(m=l.UNSIGNED_SHORT,
-n=2);c=g.offsets;if(0===c.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,k.array.length,m,0),I.info.render.calls++,I.info.render.vertices+=k.array.length,I.info.render.faces+=k.array.length/3;else{b=!0;for(var p=0,q=c.length;p<q;p++){var s=c[p].index;b&&(e(d,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer));l.drawElements(h,c[p].count,m,c[p].start*n);I.info.render.calls++;I.info.render.vertices+=c[p].count;I.info.render.faces+=c[p].count/3}}}else b&&e(d,
-a,g,0),d=g.attributes.position,l.drawArrays(h,0,d.array.length/d.itemSize),I.info.render.calls++,I.info.render.vertices+=d.array.length/d.itemSize,I.info.render.faces+=d.array.length/(3*d.itemsize)}else if(h instanceof THREE.PointCloud)if(h=l.POINTS,k=g.attributes.index)if(k.array instanceof Uint32Array&&ca.get("OES_element_index_uint")?(m=l.UNSIGNED_INT,n=4):(m=l.UNSIGNED_SHORT,n=2),c=g.offsets,0===c.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,k.array.length,
-m,0),I.info.render.calls++,I.info.render.points+=k.array.length;else for(1<c.length&&(b=!0),p=0,q=c.length;p<q;p++)s=c[p].index,b&&(e(d,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,c[p].count,m,c[p].start*n),I.info.render.calls++,I.info.render.points+=c[p].count;else if(b&&e(d,a,g,0),d=g.attributes.position,c=g.offsets,0===c.length)l.drawArrays(h,0,d.array.length/3),I.info.render.calls++,I.info.render.points+=d.array.length/3;else for(p=0,q=c.length;p<q;p++)l.drawArrays(h,
-c[p].index,c[p].count),I.info.render.calls++,I.info.render.points+=c[p].count;else if(h instanceof THREE.Line)if(h=h.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,A(d.linewidth),k=g.attributes.index)if(k.array instanceof Uint32Array?(m=l.UNSIGNED_INT,n=4):(m=l.UNSIGNED_SHORT,n=2),c=g.offsets,0===c.length)b&&(e(d,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,k.array.length,m,0),I.info.render.calls++,I.info.render.vertices+=k.array.length;else for(1<c.length&&(b=!0),p=0,q=c.length;p<
-q;p++)s=c[p].index,b&&(e(d,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,c[p].count,m,c[p].start*n),I.info.render.calls++,I.info.render.vertices+=c[p].count;else if(b&&e(d,a,g,0),d=g.attributes.position,c=g.offsets,0===c.length)l.drawArrays(h,0,d.array.length/3),I.info.render.calls++,I.info.render.vertices+=d.array.length/3;else for(p=0,q=c.length;p<q;p++)l.drawArrays(h,c[p].index,c[p].count),I.info.render.calls++,I.info.render.vertices+=c[p].count};this.renderBuffer=function(a,
-b,c,d,e,k){if(!1!==d.visible){v(k);c=x(a,b,c,d,k);b=c.attributes;a=!1;c=e.id+"_"+c.id+"_"+(d.wireframe?1:0);c!==ma&&(ma=c,a=!0);a&&f();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),g(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k.morphTargetBase]),g(c.position),l.vertexAttribPointer(c.position,
-3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),g(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length)for(var m=0,n=k.morphTargetForcedOrder,q=k.morphTargetInfluences,s;m<d.numSupportedMorphTargets&&m<n.length;)s=c["morphTarget"+m],0<=s&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[n[m]]),g(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0)),s=c["morphNormal"+m],0<=s&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,
-e.__webglMorphNormalsBuffers[n[m]]),g(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[m]=q[n[m]],m++;else{n=[];q=k.morphTargetInfluences;m=k.geometry.morphTargets;q.length>m.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),q.length=m.length);m=0;for(s=q.length;m<s;m++)n.push([q[m],m]);n.length>d.numSupportedMorphTargets?(n.sort(p),n.length=d.numSupportedMorphTargets):n.length>d.numSupportedMorphNormals?n.sort(p):0===n.length&&
-n.push([0,0]);for(var m=0,r=d.numSupportedMorphTargets;m<r;m++)if(n[m]){var t=n[m][1];s=c["morphTarget"+m];0<=s&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[t]),g(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0));s=c["morphNormal"+m];0<=s&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[t]),g(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0));k.__webglMorphTargetInfluences[m]=q[t]}else k.__webglMorphTargetInfluences[m]=0}null!==d.program.uniforms.morphTargetInfluences&&
-l.uniform1fv(d.program.uniforms.morphTargetInfluences,k.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(c=0,q=e.__webglCustomAttributesList.length;c<q;c++)n=e.__webglCustomAttributesList[c],0<=b[n.buffer.belongsToAttribute]&&(l.bindBuffer(l.ARRAY_BUFFER,n.buffer),g(b[n.buffer.belongsToAttribute]),l.vertexAttribPointer(b[n.buffer.belongsToAttribute],n.size,l.FLOAT,!1,0,0));0<=b.color&&(0<k.geometry.colors.length||0<k.geometry.faces.length?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglColorBuffer),
-g(b.color),l.vertexAttribPointer(b.color,3,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglNormalBuffer),g(b.normal),l.vertexAttribPointer(b.normal,3,l.FLOAT,!1,0,0));0<=b.tangent&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglTangentBuffer),g(b.tangent),l.vertexAttribPointer(b.tangent,4,l.FLOAT,!1,0,0));0<=b.uv&&(k.geometry.faceVertexUvs[0]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUVBuffer),g(b.uv),
-l.vertexAttribPointer(b.uv,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(k.geometry.faceVertexUvs[1]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUV2Buffer),g(b.uv2),l.vertexAttribPointer(b.uv2,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),g(b.skinIndex),l.vertexAttribPointer(b.skinIndex,
-4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),g(b.skinWeight),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0));0<=b.lineDistance&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglLineDistanceBuffer),g(b.lineDistance),l.vertexAttribPointer(b.lineDistance,1,l.FLOAT,!1,0,0))}h();k instanceof THREE.Mesh?(k=e.__typeArray===Uint32Array?l.UNSIGNED_INT:l.UNSIGNED_SHORT,d.wireframe?(A(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),l.drawElements(l.LINES,
-e.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),l.drawElements(l.TRIANGLES,e.__webglFaceCount,k,0)),I.info.render.calls++,I.info.render.vertices+=e.__webglFaceCount,I.info.render.faces+=e.__webglFaceCount/3):k instanceof THREE.Line?(k=k.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,A(d.linewidth),l.drawArrays(k,0,e.__webglLineCount),I.info.render.calls++):k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,e.__webglParticleCount),I.info.render.calls++,I.info.render.points+=
-e.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;ma="";zb=-1;Fb=null;Mb=!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);ub.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);tb.setFromMatrix(ub);
-xa.length=0;Ra.length=0;Ga.length=0;eb.length=0;fb.length=0;q(a);!0===I.sortObjects&&(Ra.sort(k),Ga.sort(n));Pc.render(a,b);I.info.render.calls=0;I.info.render.vertices=0;I.info.render.faces=0;I.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);d=0;for(var g=Fa.length;d<g;d++){var f=Fa[d],h=f.object;h.visible&&(F(h,b),s(f))}a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,
-d.blendSrc,d.blendDst,d.blendEquationAlpha,d.blendSrcAlpha,d.blendDstAlpha),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),w(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),m(Ra,b,xa,e,!0,d),m(Ga,b,xa,e,!0,d),t(Fa,"",b,xa,e,!1,d)):(d=null,this.setBlending(THREE.NoBlending),m(Ra,b,xa,e,!1,d),t(Fa,"opaque",b,xa,e,!1,d),m(Ga,b,xa,e,!0,d),t(Fa,"transparent",b,xa,e,!0,d));Qc.render(a,b);Rc.render(a,b,xc,yc);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==
-THREE.LinearFilter&&H(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var g=x(a,b,c,d,e);ma="";I.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(g,l,tb):e.render(function(a){I.renderBufferImmediate(a,g,d)})};var kb={},mc=0,Fc={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?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):l.frontFace(l.CCW),a===THREE.CullFaceBack?l.cullFace(l.BACK):a===THREE.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK),l.enable(l.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;qb!==b&&(b?l.disable(l.CULL_FACE):l.enable(l.CULL_FACE),qb=b);Nb!==a&&(a?l.frontFace(l.CW):l.frontFace(l.CCW),Nb=a)};this.setDepthTest=
-function(a){hc!==a&&(a?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),hc=a)};this.setDepthWrite=function(a){ic!==a&&(l.depthMask(a),ic=a)};this.setBlending=function(a,b,c,d,e,g,f){a!==Xb&&(a===THREE.NoBlending?l.disable(l.BLEND):a===THREE.AdditiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,l.ONE)):a===THREE.SubtractiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(l.enable(l.BLEND),
-l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.SRC_COLOR)):a===THREE.CustomBlending?l.enable(l.BLEND):(l.enable(l.BLEND),l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),Xb=a);if(a===THREE.CustomBlending){e=e||b;g=g||c;f=f||d;if(b!==Ob||e!==ec)l.blendEquationSeparate(N(b),N(e)),Ob=b,ec=e;if(c!==Yb||d!==Zb||g!==fc||f!==gc)l.blendFuncSeparate(N(c),N(d),N(g),N(f)),Yb=c,Zb=d,fc=g,gc=f}else gc=fc=ec=Zb=Yb=Ob=null};this.uploadTexture=
-function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Gb),a.__webglTexture=l.createTexture(),I.info.memory.textures++);l.bindTexture(l.TEXTURE_2D,a.__webglTexture);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,a.flipY);l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);l.pixelStorei(l.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=K(a.image,Jc);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=N(a.format),e=N(a.type);B(l.TEXTURE_2D,
-a,c);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&c){for(var f=0,h=g.length;f<h;f++)b=g[f],l.texImage2D(l.TEXTURE_2D,f,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(f=0,h=g.length;f<h;f++)b=g[f],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<rc().indexOf(d)?l.compressedTexImage2D(l.TEXTURE_2D,f,d,b.width,b.height,0,b.data):console.warn("Attempt to load unsupported compressed texture format"):
-l.texImage2D(l.TEXTURE_2D,f,d,b.width,b.height,0,d,e,b.data);else if(0<g.length&&c){f=0;for(h=g.length;f<h;f++)b=g[f],l.texImage2D(l.TEXTURE_2D,f,d,d,e,b);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&l.generateMipmap(l.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()};this.setTexture=function(a,b){l.activeTexture(l.TEXTURE0+b);a.needsUpdate?I.uploadTexture(a):l.bindTexture(l.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",Ec);a.__webglTexture=l.createTexture();I.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=N(a.format),e=N(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture);B(l.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=
-l.createFramebuffer();a.__webglRenderbuffer[f]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+f;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[f]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,h,g.__webglTexture,0);L(a.__webglRenderbuffer[f],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:
-l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),B(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,
-l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):L(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=ib,a=Pa,d=hb,e=db);b!==Ab&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),Ab=b);xc=c;yc=a};this.readRenderTargetPixels=
-function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(a.__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;a.__webglFramebuffer!==Ab&&(l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),g=!0);l.checkFramebufferStatus(l.FRAMEBUFFER)===
-l.FRAMEBUFFER_COMPLETE?l.readPixels(b,c,d,e,l.RGBA,l.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&l.bindFramebuffer(l.FRAMEBUFFER,Ab)}};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};
+b=aa.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=aa.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=aa.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 P=void 0!==a.canvas?a.canvas:document.createElement("canvas"),N=void 0!==a.context?a.context:null,Q=1,U=void 0!==a.precision?a.precision:"highp",
+I=void 0!==a.alpha?a.alpha:!1,na=void 0!==a.depth?a.depth:!0,ca=void 0!==a.stencil?a.stencil:!0,sa=void 0!==a.antialias?a.antialias:!1,R=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,xa=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,ra=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,ja=new THREE.Color(0),wa=0,ya=[],za={},La=[],Sa=[],Ra=[],Ea=[],qb=[];this.domElement=P;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=
+this.autoClear=!0;this.gammaFactor=2;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!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 B=this,cb=[],Wb=null,ob=null,Bb=-1,Ka="",Fb=null,Kb=0,pb=-1,Nb=-1,Xb=-1,Ob=-1,Yb=-1,Zb=-1,ec=-1,fc=-1,gc=
+-1,hc=-1,ic=-1,uc=null,vc=null,wc=null,tc=null,gb=0,db=0,hb=P.width,Pa=P.height,xc=0,yc=0,ub=new Uint8Array(16),Qa=new Uint8Array(16),vb=new THREE.Frustum,wb=new THREE.Matrix4;new THREE.Matrix4;var Ca=new THREE.Vector3,ma=new THREE.Vector3,Mb=!0,qc={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:[]}},l;try{var zc={alpha:I,depth:na,stencil:ca,antialias:sa,premultipliedAlpha:R,preserveDrawingBuffer:xa};l=N||P.getContext("webgl",zc)||P.getContext("experimental-webgl",zc);if(null===l){if(null!==P.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}P.addEventListener("webglcontextlost",function(a){a.preventDefault();Ac();Bc();za={}},!1)}catch(Hc){console.error(Hc)}void 0===l.getShaderPrecisionFormat&&
+(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var aa=new THREE.WebGLExtensions(l);aa.get("OES_texture_float");aa.get("OES_texture_float_linear");aa.get("OES_standard_derivatives");ra&&aa.get("EXT_frag_depth");var jc=function(a,b,c,d){!0===R&&(a*=d,b*=d,c*=d);l.clearColor(a,b,c,d)},Bc=function(){l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);
+l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(gb,db,hb,Pa);jc(ja.r,ja.g,ja.b,wa)},Ac=function(){Fb=Wb=null;Nb=pb=ic=hc=Xb=-1;Ka="";Bb=-1;Mb=!0;for(var a=0;a<Qa.length;a++)Qa[a]=0};Bc();this.context=l;var sc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Ic=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Jc=l.getParameter(l.MAX_TEXTURE_SIZE),Gc=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),Vb=0<Ic,Lb=Vb&&aa.get("OES_texture_float"),Kc=l.getShaderPrecisionFormat(l.VERTEX_SHADER,
+l.HIGH_FLOAT),Lc=l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_FLOAT);var Mc=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT),Nc=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT);var rc=function(){var a;return function(){if(void 0!==a)return a;a=[];if(aa.get("WEBGL_compressed_texture_pvrtc")||aa.get("WEBGL_compressed_texture_s3tc"))for(var b=l.getParameter(l.COMPRESSED_TEXTURE_FORMATS),
+c=0;c<b.length;c++)a.push(b[c]);return a}}(),Oc=0<Kc.precision&&0<Mc.precision,Cc=0<Lc.precision&&0<Nc.precision;"highp"!==U||Oc||(Cc?(U="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(U="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==U||Cc||(U="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Pc=new THREE.ShadowMapPlugin(this,ya,za,La),Qc=new THREE.SpritePlugin(this,Ea),Rc=
+new THREE.LensFlarePlugin(this,qb);this.getContext=function(){return l};this.forceContextLoss=function(){aa.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return Vb};this.supportsFloatTextures=function(){return aa.get("OES_texture_float")};this.supportsStandardDerivatives=function(){return aa.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return aa.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return aa.get("WEBGL_compressed_texture_pvrtc")};
+this.supportsBlendMinMax=function(){return aa.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=aa.get("EXT_texture_filter_anisotropic");return a=null!==b?l.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return U};this.getPixelRatio=function(){return Q};this.setPixelRatio=function(a){Q=a};this.setSize=function(a,b,c){P.width=a*Q;P.height=b*Q;!1!==c&&(P.style.width=a+"px",P.style.height=b+"px");this.setViewport(0,
+0,a,b)};this.setViewport=function(a,b,c,d){gb=a*Q;db=b*Q;hb=c*Q;Pa=d*Q;l.viewport(gb,db,hb,Pa)};this.setScissor=function(a,b,c,d){l.scissor(a*Q,b*Q,c*Q,d*Q)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.getClearColor=function(){return ja};this.setClearColor=function(a,b){ja.set(a);wa=void 0!==b?b:1;jc(ja.r,ja.g,ja.b,wa)};this.getClearAlpha=function(){return wa};this.setClearAlpha=function(a){wa=a;jc(ja.r,ja.g,ja.b,wa)};this.clear=function(a,b,c){var d=
+0;if(void 0===a||a)d|=l.COLOR_BUFFER_BIT;if(void 0===b||b)d|=l.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};this.clearColor=function(){l.clear(l.COLOR_BUFFER_BIT)};this.clearDepth=function(){l.clear(l.DEPTH_BUFFER_BIT)};this.clearStencil=function(){l.clear(l.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=Ac;var kc=function(a){a.target.traverse(function(a){a.removeEventListener("remove",kc);if(a instanceof
+THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete za[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=La,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})},lc=function(a){a=a.target;a.removeEventListener("dispose",lc);delete a.__webglInit;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&
+(l.deleteBuffer(c.buffer),delete c.buffer)}B.info.memory.geometries--}else if(b=ib[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++)l.deleteBuffer(e.__webglMorphTargetsBuffers[f]);delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)l.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}Dc(e)}delete ib[a.id]}else Dc(a);Ka=""},Gb=function(a){a=
+a.target;a.removeEventListener("dispose",Gb);a.image&&a.image.__webglTextureCube?(l.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(l.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);B.info.memory.textures--},Ec=function(a){a=a.target;a.removeEventListener("dispose",Ec);if(a&&void 0!==a.__webglTexture){l.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>
+b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}B.info.memory.textures--},pc=function(a){a=a.target;a.removeEventListener("dispose",pc);oc(a)},Dc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),
+c=0,d=b.length;c<d;c++){var e=b[c];void 0!==a[e]&&(l.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)l.deleteBuffer(a.__webglCustomAttributesList[e].buffer);delete a.__webglCustomAttributesList}B.info.memory.geometries--},oc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=cb.length;a<c;a++)if(d=cb[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=cb.length;a<
+c;a++)d=cb[a],d.program!==b&&e.push(d);cb=e;l.deleteProgram(b);B.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){e();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=l.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=l.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=l.createBuffer());a.hasPositions&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),
+l.bufferData(l.ARRAY_BUFFER,a.positionArray,l.DYNAMIC_DRAW),f(b.attributes.position),l.vertexAttribPointer(b.attributes.position,3,l.FLOAT,!1,0,0));if(a.hasNormals){l.bindBuffer(l.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,h,k,m,p,n,q,r,t,s,u,v=3*a.count;for(u=0;u<v;u+=9)s=a.normalArray,d=s[u],h=s[u+1],k=s[u+2],m=s[u+3],n=s[u+4],r=s[u+5],p=s[u+6],q=s[u+7],t=s[u+8],d=(d+m+p)/3,h=(h+n+q)/3,k=(k+r+t)/3,s[u]=d,s[u+1]=h,s[u+2]=k,s[u+3]=d,s[u+4]=h,s[u+5]=k,s[u+6]=d,s[u+
+7]=h,s[u+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);f(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),l.bufferData(l.ARRAY_BUFFER,a.uvArray,l.DYNAMIC_DRAW),f(b.attributes.uv),l.vertexAttribPointer(b.attributes.uv,2,l.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,a.colorArray,l.DYNAMIC_DRAW),
+f(b.attributes.color),l.vertexAttribPointer(b.attributes.color,3,l.FLOAT,!1,0,0));g();l.drawArrays(l.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,f,g,h){if(!1!==f.visible)if(u(h),a=C(a,b,c,f,h),b=!1,c="direct_"+g.id+"_"+a.id+"_"+(f.wireframe?1:0),c!==Ka&&(Ka=c,b=!0),b&&e(),h instanceof THREE.Mesh){h=!0===f.wireframe?l.LINES:l.TRIANGLES;var k=g.attributes.index;if(k){var m,p;k.array instanceof Uint32Array&&aa.get("OES_element_index_uint")?(m=l.UNSIGNED_INT,p=4):(m=l.UNSIGNED_SHORT,
+p=2);c=g.offsets;if(0===c.length)b&&(d(f,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,k.array.length,m,0),B.info.render.calls++,B.info.render.vertices+=k.array.length,B.info.render.faces+=k.array.length/3;else{b=!0;for(var n=0,q=c.length;n<q;n++){var s=c[n].index;b&&(d(f,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer));l.drawElements(h,c[n].count,m,c[n].start*p);B.info.render.calls++;B.info.render.vertices+=c[n].count;B.info.render.faces+=c[n].count/3}}}else b&&d(f,
+a,g,0),f=g.attributes.position,l.drawArrays(h,0,f.array.length/f.itemSize),B.info.render.calls++,B.info.render.vertices+=f.array.length/f.itemSize,B.info.render.faces+=f.array.length/(3*f.itemsize)}else if(h instanceof THREE.PointCloud)if(h=l.POINTS,k=g.attributes.index)if(k.array instanceof Uint32Array&&aa.get("OES_element_index_uint")?(m=l.UNSIGNED_INT,p=4):(m=l.UNSIGNED_SHORT,p=2),c=g.offsets,0===c.length)b&&(d(f,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,k.array.length,
+m,0),B.info.render.calls++,B.info.render.points+=k.array.length;else for(1<c.length&&(b=!0),n=0,q=c.length;n<q;n++)s=c[n].index,b&&(d(f,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,c[n].count,m,c[n].start*p),B.info.render.calls++,B.info.render.points+=c[n].count;else if(b&&d(f,a,g,0),f=g.attributes.position,c=g.offsets,0===c.length)l.drawArrays(h,0,f.array.length/3),B.info.render.calls++,B.info.render.points+=f.array.length/3;else for(n=0,q=c.length;n<q;n++)l.drawArrays(h,
+c[n].index,c[n].count),B.info.render.calls++,B.info.render.points+=c[n].count;else if(h instanceof THREE.Line)if(h=h.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,G(f.linewidth),k=g.attributes.index)if(k.array instanceof Uint32Array?(m=l.UNSIGNED_INT,p=4):(m=l.UNSIGNED_SHORT,p=2),c=g.offsets,0===c.length)b&&(d(f,a,g,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,k.array.length,m,0),B.info.render.calls++,B.info.render.vertices+=k.array.length;else for(1<c.length&&(b=!0),n=0,q=c.length;n<
+q;n++)s=c[n].index,b&&(d(f,a,g,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,k.buffer)),l.drawElements(h,c[n].count,m,c[n].start*p),B.info.render.calls++,B.info.render.vertices+=c[n].count;else if(b&&d(f,a,g,0),f=g.attributes.position,c=g.offsets,0===c.length)l.drawArrays(h,0,f.array.length/3),B.info.render.calls++,B.info.render.vertices+=f.array.length/3;else for(n=0,q=c.length;n<q;n++)l.drawArrays(h,c[n].index,c[n].count),B.info.render.calls++,B.info.render.vertices+=c[n].count};this.renderBuffer=function(a,
+b,c,d,h,k){if(!1!==d.visible){u(k);c=C(a,b,c,d,k);b=c.attributes;a=!1;c=h.id+"_"+c.id+"_"+(d.wireframe?1:0);c!==Ka&&(Ka=c,a=!0);a&&e();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglVertexBuffer),f(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(l.bindBuffer(l.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[k.morphTargetBase]),f(c.position),l.vertexAttribPointer(c.position,
+3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglVertexBuffer),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length)for(var m=0,n=k.morphTargetForcedOrder,q=k.morphTargetInfluences,s;m<d.numSupportedMorphTargets&&m<n.length;)s=c["morphTarget"+m],0<=s&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[n[m]]),f(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0)),s=c["morphNormal"+m],0<=s&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,
+h.__webglMorphNormalsBuffers[n[m]]),f(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[m]=q[n[m]],m++;else{n=[];q=k.morphTargetInfluences;m=k.geometry.morphTargets;q.length>m.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),q.length=m.length);m=0;for(s=q.length;m<s;m++)n.push([q[m],m]);n.length>d.numSupportedMorphTargets?(n.sort(p),n.length=d.numSupportedMorphTargets):n.length>d.numSupportedMorphNormals?n.sort(p):0===n.length&&
+n.push([0,0]);for(var m=0,r=d.numSupportedMorphTargets;m<r;m++)if(n[m]){var t=n[m][1];s=c["morphTarget"+m];0<=s&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[t]),f(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0));s=c["morphNormal"+m];0<=s&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglMorphNormalsBuffers[t]),f(s),l.vertexAttribPointer(s,3,l.FLOAT,!1,0,0));k.__webglMorphTargetInfluences[m]=q[t]}else k.__webglMorphTargetInfluences[m]=0}null!==d.program.uniforms.morphTargetInfluences&&
+l.uniform1fv(d.program.uniforms.morphTargetInfluences,k.__webglMorphTargetInfluences)}if(a){if(h.__webglCustomAttributesList)for(c=0,q=h.__webglCustomAttributesList.length;c<q;c++)n=h.__webglCustomAttributesList[c],0<=b[n.buffer.belongsToAttribute]&&(l.bindBuffer(l.ARRAY_BUFFER,n.buffer),f(b[n.buffer.belongsToAttribute]),l.vertexAttribPointer(b[n.buffer.belongsToAttribute],n.size,l.FLOAT,!1,0,0));0<=b.color&&(0<k.geometry.colors.length||0<k.geometry.faces.length?(l.bindBuffer(l.ARRAY_BUFFER,h.__webglColorBuffer),
+f(b.color),l.vertexAttribPointer(b.color,3,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglNormalBuffer),f(b.normal),l.vertexAttribPointer(b.normal,3,l.FLOAT,!1,0,0));0<=b.tangent&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglTangentBuffer),f(b.tangent),l.vertexAttribPointer(b.tangent,4,l.FLOAT,!1,0,0));0<=b.uv&&(k.geometry.faceVertexUvs[0]?(l.bindBuffer(l.ARRAY_BUFFER,h.__webglUVBuffer),f(b.uv),
+l.vertexAttribPointer(b.uv,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(k.geometry.faceVertexUvs[1]?(l.bindBuffer(l.ARRAY_BUFFER,h.__webglUV2Buffer),f(b.uv2),l.vertexAttribPointer(b.uv2,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),f(b.skinIndex),l.vertexAttribPointer(b.skinIndex,
+4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),f(b.skinWeight),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0));0<=b.lineDistance&&(l.bindBuffer(l.ARRAY_BUFFER,h.__webglLineDistanceBuffer),f(b.lineDistance),l.vertexAttribPointer(b.lineDistance,1,l.FLOAT,!1,0,0))}g();k instanceof THREE.Mesh?(k=h.__typeArray===Uint32Array?l.UNSIGNED_INT:l.UNSIGNED_SHORT,d.wireframe?(G(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),l.drawElements(l.LINES,
+h.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),l.drawElements(l.TRIANGLES,h.__webglFaceCount,k,0)),B.info.render.calls++,B.info.render.vertices+=h.__webglFaceCount,B.info.render.faces+=h.__webglFaceCount/3):k instanceof THREE.Line?(k=k.mode===THREE.LineStrip?l.LINE_STRIP:l.LINES,G(d.linewidth),l.drawArrays(k,0,h.__webglLineCount),B.info.render.calls++):k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,h.__webglParticleCount),B.info.render.calls++,B.info.render.points+=
+h.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;Ka="";Bb=-1;Fb=null;Mb=!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);wb.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);vb.setFromMatrix(wb);
+ya.length=0;Sa.length=0;Ra.length=0;Ea.length=0;qb.length=0;n(a);!0===B.sortObjects&&(Sa.sort(h),Ra.sort(k));Pc.render(a,b);B.info.render.calls=0;B.info.render.vertices=0;B.info.render.faces=0;B.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);d=0;for(var f=La.length;d<f;d++){var g=La[d],l=g.object;l.visible&&(A(l,b),s(g))}a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,
+d.blendSrc,d.blendDst,d.blendEquationAlpha,d.blendSrcAlpha,d.blendDstAlpha),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),E(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),q(Sa,b,ya,e,!0,d),q(Ra,b,ya,e,!0,d),m(La,"",b,ya,e,!1,d)):(d=null,this.setBlending(THREE.NoBlending),q(Sa,b,ya,e,!1,d),m(La,"opaque",b,ya,e,!1,d),q(Ra,b,ya,e,!0,d),m(La,"transparent",b,ya,e,!0,d));Qc.render(a,b);Rc.render(a,b,xc,yc);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==
+THREE.LinearFilter&&K(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=C(a,b,c,d,e);Ka="";B.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,vb):e.render(function(a){B.renderBufferImmediate(a,f,d)})};var ib={},mc=0,Fc={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?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):l.frontFace(l.CCW),a===THREE.CullFaceBack?l.cullFace(l.BACK):a===THREE.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK),l.enable(l.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;pb!==b&&(b?l.disable(l.CULL_FACE):l.enable(l.CULL_FACE),pb=b);Nb!==a&&(a?l.frontFace(l.CW):l.frontFace(l.CCW),Nb=a)};this.setDepthTest=
+function(a){hc!==a&&(a?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),hc=a)};this.setDepthWrite=function(a){ic!==a&&(l.depthMask(a),ic=a)};this.setBlending=function(a,b,c,d,e,f,g){a!==Xb&&(a===THREE.NoBlending?l.disable(l.BLEND):a===THREE.AdditiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,l.ONE)):a===THREE.SubtractiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(l.enable(l.BLEND),
+l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.SRC_COLOR)):a===THREE.CustomBlending?l.enable(l.BLEND):(l.enable(l.BLEND),l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),Xb=a);if(a===THREE.CustomBlending){e=e||b;f=f||c;g=g||d;if(b!==Ob||e!==ec)l.blendEquationSeparate(T(b),T(e)),Ob=b,ec=e;if(c!==Yb||d!==Zb||f!==fc||g!==gc)l.blendFuncSeparate(T(c),T(d),T(f),T(g)),Yb=c,Zb=d,fc=f,gc=g}else gc=fc=ec=Zb=Yb=Ob=null};this.uploadTexture=
+function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Gb),a.__webglTexture=l.createTexture(),B.info.memory.textures++);l.bindTexture(l.TEXTURE_2D,a.__webglTexture);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,a.flipY);l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);l.pixelStorei(l.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=M(a.image,Jc);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=T(a.format),e=T(a.type);z(l.TEXTURE_2D,
+a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<f.length&&c){for(var g=0,h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(g=0,h=f.length;g<h;g++)b=f[g],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<rc().indexOf(d)?l.compressedTexImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,b.data):console.warn("Attempt to load unsupported compressed texture format"):
+l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);else if(0<f.length&&c){g=0;for(h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&l.generateMipmap(l.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()};this.setTexture=function(a,b){l.activeTexture(l.TEXTURE0+b);a.needsUpdate?B.uploadTexture(a):l.bindTexture(l.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",Ec);a.__webglTexture=l.createTexture();B.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=T(a.format),e=T(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture);z(l.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=
+l.createFramebuffer();a.__webglRenderbuffer[f]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+f;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[f]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,h,g.__webglTexture,0);J(a.__webglRenderbuffer[f],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:
+l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),z(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,
+l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):J(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=hb,a=Pa,d=gb,e=db);b!==ob&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),ob=b);xc=c;yc=a};this.readRenderTargetPixels=
+function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(a.__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;a.__webglFramebuffer!==ob&&(l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),g=!0);l.checkFramebufferStatus(l.FRAMEBUFFER)===
+l.FRAMEBUFFER_COMPLETE?l.readPixels(b,c,d,e,l.RGBA,l.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&l.bindFramebuffer(l.FRAMEBUFFER,ob)}};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};
 this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}};
 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};
@@ -573,64 +573,64 @@ THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:f
 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.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&&console.log("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,n=d.__webglShader.vertexShader,p=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var t="ENVMAP_TYPE_CUBE",s="ENVMAP_MODE_REFLECTION",r="ENVMAP_BLENDING_MULTIPLY";
-if(e.envMap){switch(d.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:t="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:t="ENVMAP_TYPE_SPHERE"}switch(d.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:s="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 u=0<b.gammaFactor?b.gammaFactor:1,v,y;v=[];for(var E in g)y=g[E],!1!==y&&(y="#define "+E+" "+y,v.push(y));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 "+s:"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":
+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,p=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="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 u=0<b.gammaFactor?b.gammaFactor:1,v,x;v=[];for(var C in g)x=g[C],!1!==x&&(x="#define "+C+" "+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.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.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;\nattribute vec2 uv2;\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?"#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 "+t:"",e.envMap?"#define "+s:"",e.envMap?"#define "+r:"",e.lightMap?"#define USE_LIGHTMAP":"",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.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"));n=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+n);p=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+p);f.attachShader(g,n);f.attachShader(g,
-p);void 0!==q&&f.bindAttribLocation(g,0,q);f.linkProgram(g);!1===f.getProgramParameter(g,f.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."),console.error("gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS)),console.error("gl.getError()",f.getError()));""!==f.getProgramInfoLog(g)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f.getProgramInfoLog(g));f.deleteShader(n);f.deleteShader(p);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");
-e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var x in h)q.push(x);h=q;x={};q=0;for(b=h.length;q<b;q++)m=h[q],x[m]=f.getUniformLocation(g,m);this.uniforms=x;q="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)q.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)q.push("morphNormal"+h);for(var O in k)q.push(O);
-e=q;k={};O=0;for(h=e.length;O<h;O++)x=e[O],k[x]=f.getAttribLocation(g,x);this.attributes=k;this.attributesKeys=Object.keys(this.attributes);this.id=a++;this.code=c;this.usedTimes=1;this.program=g;this.vertexShader=n;this.fragmentShader=p;return this}}();
+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 "+s:"",e.envMap?"#define "+t:"",e.envMap?"#define "+r:"",e.lightMap?"#define USE_LIGHTMAP":"",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.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"));p=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+p);n=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+n);f.attachShader(g,p);f.attachShader(g,
+n);void 0!==q&&f.bindAttribLocation(g,0,q);f.linkProgram(g);!1===f.getProgramParameter(g,f.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."),console.error("gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS)),console.error("gl.getError()",f.getError()));""!==f.getProgramInfoLog(g)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f.getProgramInfoLog(g));f.deleteShader(p);f.deleteShader(n);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");
+e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var w in h)q.push(w);h=q;w={};q=0;for(b=h.length;q<b;q++)m=h[q],w[m]=f.getUniformLocation(g,m);this.uniforms=w;q="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)q.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)q.push("morphNormal"+h);for(var y in k)q.push(y);
+e=q;k={};y=0;for(h=e.length;y<h;y++)w=e[y],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=p;this.fragmentShader=n;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){c=b.createShader(c);b.shaderSource(c,d);b.compileShader(c);!1===b.getShaderParameter(c,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(c)&&(console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",b.getShaderInfoLog(c)),console.warn(a(d)));return c}}();
-THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,n,p,q,m=a.context,t,s,r,u,v,y;this.render=function(E,x,O,z){if(0!==b.length){E=new THREE.Vector3;var F=z/O,D=.5*O,A=.5*z,w=16/z,B=new THREE.Vector2(w*F,w),K=new THREE.Vector3(1,1,0),L=new THREE.Vector2(1,1);if(void 0===r){var w=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]);t=m.createBuffer();s=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,t);m.bufferData(m.ARRAY_BUFFER,w,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
-s);m.bufferData(m.ELEMENT_ARRAY_BUFFER,H,m.STATIC_DRAW);v=m.createTexture();y=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,y);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 w=(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.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,p,n,q,m=a.context,s,t,r,u,v,x;this.render=function(C,w,y,A){if(0!==b.length){C=new THREE.Vector3;var F=A/y,G=.5*y,E=.5*A,z=16/A,M=new THREE.Vector2(z*F,z),J=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1);if(void 0===r){var z=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]);s=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,s);m.bufferData(m.ARRAY_BUFFER,z,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 z=(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}",
 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}"},
-H=m.createProgram(),T=m.createShader(m.FRAGMENT_SHADER),N=m.createShader(m.VERTEX_SHADER),V="precision "+a.getPrecision()+" float;\n";m.shaderSource(T,V+w.fragmentShader);m.shaderSource(N,V+w.vertexShader);m.compileShader(T);m.compileShader(N);m.attachShader(H,T);m.attachShader(H,N);m.linkProgram(H);r=H;p=m.getAttribLocation(r,"position");q=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");n=m.getUniformLocation(r,"screenPosition")}m.useProgram(r);m.enableVertexAttribArray(p);m.enableVertexAttribArray(q);m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,t);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(q,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,s);m.disable(m.CULL_FACE);m.depthMask(!1);H=0;for(T=b.length;H<T;H++)if(w=16/z,B.set(w*
-F,w),N=b[H],E.set(N.matrixWorld.elements[12],N.matrixWorld.elements[13],N.matrixWorld.elements[14]),E.applyMatrix4(x.matrixWorldInverse),E.applyProjection(x.projectionMatrix),K.copy(E),L.x=K.x*D+D,L.y=K.y*A+A,u||0<L.x&&L.x<O&&0<L.y&&L.y<z){m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,L.x-8,L.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,B.x,B.y);m.uniform3f(n,K.x,K.y,K.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,y);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,L.x-8,L.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);N.positionScreen.copy(K);N.customUpdateCallback?N.customUpdateCallback(N):N.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var V=0,R=N.lensFlares.length;V<R;V++){var J=N.lensFlares[V];.001<J.opacity&&.001<J.scale&&(K.x=J.x,
-K.y=J.y,K.z=J.z,w=J.size*J.scale/z,B.x=w*F,B.y=w,m.uniform3f(n,K.x,K.y,K.z),m.uniform2f(h,B.x,B.y),m.uniform1f(k,J.rotation),m.uniform1f(f,J.opacity),m.uniform3f(g,J.color.r,J.color.g,J.color.b),a.setBlending(J.blending,J.blendEquation,J.blendSrc,J.blendDst),a.setTexture(J.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.ShadowMapPlugin=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===p.intersectsObject(b)))for(var g=0,h=f.length;g<h;g++){var k=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld);r.push(k)}g=0;for(h=b.children.length;g<h;g++)e(a,b.children[g],d)}}var f=a.context,g,h,k,n,p=new THREE.Frustum,q=new THREE.Matrix4,m=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,r=[],u=THREE.ShaderLib.depthRGBA,v=THREE.UniformsUtils.clone(u.uniforms);
-g=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader});h=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0});k=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,skinning:!0});n=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0,skinning:!0});g._shadowPass=!0;h._shadowPass=!0;k._shadowPass=
-!0;n._shadowPass=!0;this.render=function(c,v){if(!1!==a.shadowMapEnabled){var u,O,z,F,D,A,w,B,K=[];F=0;f.clearColor(1,1,1,1);f.disable(f.BLEND);f.enable(f.CULL_FACE);f.frontFace(f.CCW);a.shadowMapCullFace===THREE.CullFaceFront?f.cullFace(f.FRONT):f.cullFace(f.BACK);a.setDepthTest(!0);u=0;for(O=b.length;u<O;u++)if(z=b[u],z.castShadow)if(z instanceof THREE.DirectionalLight&&z.shadowCascade)for(D=0;D<z.shadowCascadeCount;D++){var L;if(z.shadowCascadeArray[D])L=z.shadowCascadeArray[D];else{w=z;var H=
-D;L=new THREE.DirectionalLight;L.isVirtual=!0;L.onlyShadow=!0;L.castShadow=!0;L.shadowCameraNear=w.shadowCameraNear;L.shadowCameraFar=w.shadowCameraFar;L.shadowCameraLeft=w.shadowCameraLeft;L.shadowCameraRight=w.shadowCameraRight;L.shadowCameraBottom=w.shadowCameraBottom;L.shadowCameraTop=w.shadowCameraTop;L.shadowCameraVisible=w.shadowCameraVisible;L.shadowDarkness=w.shadowDarkness;L.shadowBias=w.shadowCascadeBias[H];L.shadowMapWidth=w.shadowCascadeWidth[H];L.shadowMapHeight=w.shadowCascadeHeight[H];
-L.pointsWorld=[];L.pointsFrustum=[];B=L.pointsWorld;A=L.pointsFrustum;for(var T=0;8>T;T++)B[T]=new THREE.Vector3,A[T]=new THREE.Vector3;B=w.shadowCascadeNearZ[H];w=w.shadowCascadeFarZ[H];A[0].set(-1,-1,B);A[1].set(1,-1,B);A[2].set(-1,1,B);A[3].set(1,1,B);A[4].set(-1,-1,w);A[5].set(1,-1,w);A[6].set(-1,1,w);A[7].set(1,1,w);L.originalCamera=v;A=new THREE.Gyroscope;A.position.copy(z.shadowCascadeOffset);A.add(L);A.add(L.target);v.add(A);z.shadowCascadeArray[D]=L;console.log("Created virtualLight",L)}H=
-z;B=D;w=H.shadowCascadeArray[B];w.position.copy(H.position);w.target.position.copy(H.target.position);w.lookAt(w.target);w.shadowCameraVisible=H.shadowCameraVisible;w.shadowDarkness=H.shadowDarkness;w.shadowBias=H.shadowCascadeBias[B];A=H.shadowCascadeNearZ[B];H=H.shadowCascadeFarZ[B];w=w.pointsFrustum;w[0].z=A;w[1].z=A;w[2].z=A;w[3].z=A;w[4].z=H;w[5].z=H;w[6].z=H;w[7].z=H;K[F]=L;F++}else K[F]=z,F++;u=0;for(O=K.length;u<O;u++){z=K[u];z.shadowMap||(D=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&
-(D=THREE.NearestFilter),z.shadowMap=new THREE.WebGLRenderTarget(z.shadowMapWidth,z.shadowMapHeight,{minFilter:D,magFilter:D,format:THREE.RGBAFormat}),z.shadowMapSize=new THREE.Vector2(z.shadowMapWidth,z.shadowMapHeight),z.shadowMatrix=new THREE.Matrix4);if(!z.shadowCamera){if(z instanceof THREE.SpotLight)z.shadowCamera=new THREE.PerspectiveCamera(z.shadowCameraFov,z.shadowMapWidth/z.shadowMapHeight,z.shadowCameraNear,z.shadowCameraFar);else if(z instanceof THREE.DirectionalLight)z.shadowCamera=new THREE.OrthographicCamera(z.shadowCameraLeft,
-z.shadowCameraRight,z.shadowCameraTop,z.shadowCameraBottom,z.shadowCameraNear,z.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}c.add(z.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}z.shadowCameraVisible&&!z.cameraHelper&&(z.cameraHelper=new THREE.CameraHelper(z.shadowCamera),c.add(z.cameraHelper));if(z.isVirtual&&L.originalCamera==v){D=v;F=z.shadowCamera;A=z.pointsFrustum;w=z.pointsWorld;m.set(Infinity,Infinity,Infinity);t.set(-Infinity,-Infinity,-Infinity);
-for(H=0;8>H;H++)B=w[H],B.copy(A[H]),B.unproject(D),B.applyMatrix4(F.matrixWorldInverse),B.x<m.x&&(m.x=B.x),B.x>t.x&&(t.x=B.x),B.y<m.y&&(m.y=B.y),B.y>t.y&&(t.y=B.y),B.z<m.z&&(m.z=B.z),B.z>t.z&&(t.z=B.z);F.left=m.x;F.right=t.x;F.top=t.y;F.bottom=m.y;F.updateProjectionMatrix()}F=z.shadowMap;A=z.shadowMatrix;D=z.shadowCamera;D.position.setFromMatrixPosition(z.matrixWorld);s.setFromMatrixPosition(z.target.matrixWorld);D.lookAt(s);D.updateMatrixWorld();D.matrixWorldInverse.getInverse(D.matrixWorld);z.cameraHelper&&
-(z.cameraHelper.visible=z.shadowCameraVisible);z.shadowCameraVisible&&z.cameraHelper.update();A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);A.multiply(D.projectionMatrix);A.multiply(D.matrixWorldInverse);q.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse);p.setFromMatrix(q);a.setRenderTarget(F);a.clear();r.length=0;e(c,c,D);z=0;for(F=r.length;z<F;z++)w=r[z],A=w.object,w=w.buffer,H=A.material instanceof THREE.MeshFaceMaterial?A.material.materials[0]:A.material,B=void 0!==A.geometry.morphTargets&&
-0<A.geometry.morphTargets.length&&H.morphTargets,T=A instanceof THREE.SkinnedMesh&&H.skinning,B=A.customDepthMaterial?A.customDepthMaterial:T?B?n:k:B?h:g,a.setMaterialFaces(H),w instanceof THREE.BufferGeometry?a.renderBufferDirect(D,b,null,B,w,A):a.renderBuffer(D,b,null,B,w,A);z=0;for(F=d.length;z<F;z++)w=d[z],A=w.object,A.visible&&A.castShadow&&(A._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,A.matrixWorld),a.renderImmediateObject(D,b,null,g,A))}u=a.getClearColor();O=a.getClearAlpha();f.clearColor(u.r,
-u.g,u.b,O);f.enable(f.BLEND);a.shadowMapCullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,n,p,q,m,t,s,r,u,v,y;function E(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,O,z,F,D,A=new THREE.Vector3,w=new THREE.Quaternion,B=new THREE.Vector3;this.render=function(K,L){if(0!==b.length){if(void 0===F){var H=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),T=new Uint16Array([0,1,2,0,2,3]);O=x.createBuffer();z=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,O);x.bufferData(x.ARRAY_BUFFER,H,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,
-z);x.bufferData(x.ELEMENT_ARRAY_BUFFER,T,x.STATIC_DRAW);var H=x.createProgram(),T=x.createShader(x.VERTEX_SHADER),N=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(T,["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"));
-x.shaderSource(N,["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"));
-x.compileShader(T);x.compileShader(N);x.attachShader(H,T);x.attachShader(H,N);x.linkProgram(H);F=H;v=x.getAttribLocation(F,"position");y=x.getAttribLocation(F,"uv");c=x.getUniformLocation(F,"uvOffset");d=x.getUniformLocation(F,"uvScale");e=x.getUniformLocation(F,"rotation");f=x.getUniformLocation(F,"scale");g=x.getUniformLocation(F,"color");h=x.getUniformLocation(F,"map");k=x.getUniformLocation(F,"opacity");n=x.getUniformLocation(F,"modelViewMatrix");p=x.getUniformLocation(F,"projectionMatrix");q=
-x.getUniformLocation(F,"fogType");m=x.getUniformLocation(F,"fogDensity");t=x.getUniformLocation(F,"fogNear");s=x.getUniformLocation(F,"fogFar");r=x.getUniformLocation(F,"fogColor");u=x.getUniformLocation(F,"alphaTest");H=document.createElement("canvas");H.width=8;H.height=8;T=H.getContext("2d");T.fillStyle="white";T.fillRect(0,0,8,8);D=new THREE.Texture(H);D.needsUpdate=!0}x.useProgram(F);x.enableVertexAttribArray(v);x.enableVertexAttribArray(y);x.disable(x.CULL_FACE);x.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,
-O);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(y,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,z);x.uniformMatrix4fv(p,!1,L.projectionMatrix.elements);x.activeTexture(x.TEXTURE0);x.uniform1i(h,0);T=H=0;(N=K.fog)?(x.uniform3f(r,N.color.r,N.color.g,N.color.b),N instanceof THREE.Fog?(x.uniform1f(t,N.near),x.uniform1f(s,N.far),x.uniform1i(q,1),T=H=1):N instanceof THREE.FogExp2&&(x.uniform1f(m,N.density),x.uniform1i(q,2),T=H=2)):(x.uniform1i(q,0),T=H=0);for(var N=0,V=b.length;N<
-V;N++){var R=b[N];R._modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,R.matrixWorld);R.z=-R._modelViewMatrix.elements[14]}b.sort(E);for(var J=[],N=0,V=b.length;N<V;N++){var R=b[N],S=R.material;x.uniform1f(u,S.alphaTest);x.uniformMatrix4fv(n,!1,R._modelViewMatrix.elements);R.matrixWorld.decompose(A,w,B);J[0]=B.x;J[1]=B.y;R=0;K.fog&&S.fog&&(R=T);H!==R&&(x.uniform1i(q,R),H=R);null!==S.map?(x.uniform2f(c,S.map.offset.x,S.map.offset.y),x.uniform2f(d,S.map.repeat.x,S.map.repeat.y)):(x.uniform2f(c,
-0,0),x.uniform2f(d,1,1));x.uniform1f(k,S.opacity);x.uniform3f(g,S.color.r,S.color.g,S.color.b);x.uniform1f(e,S.rotation);x.uniform2fv(f,J);a.setBlending(S.blending,S.blendEquation,S.blendSrc,S.blendDst);a.setDepthTest(S.depthTest);a.setDepthWrite(S.depthWrite);S.map&&S.map.image&&S.map.image.width?a.setTexture(S.map,0):a.setTexture(D,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}x.enable(x.CULL_FACE);a.resetGLState()}}};
+L=m.createProgram(),T=m.createShader(m.FRAGMENT_SHADER),P=m.createShader(m.VERTEX_SHADER),N="precision "+a.getPrecision()+" float;\n";m.shaderSource(T,N+z.fragmentShader);m.shaderSource(P,N+z.vertexShader);m.compileShader(T);m.compileShader(P);m.attachShader(L,T);m.attachShader(L,P);m.linkProgram(L);r=L;n=m.getAttribLocation(r,"position");q=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");p=m.getUniformLocation(r,"screenPosition")}m.useProgram(r);m.enableVertexAttribArray(n);m.enableVertexAttribArray(q);m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,s);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(q,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);m.disable(m.CULL_FACE);m.depthMask(!1);L=0;for(T=b.length;L<T;L++)if(z=16/A,M.set(z*
+F,z),P=b[L],C.set(P.matrixWorld.elements[12],P.matrixWorld.elements[13],P.matrixWorld.elements[14]),C.applyMatrix4(w.matrixWorldInverse),C.applyProjection(w.projectionMatrix),J.copy(C),K.x=J.x*G+G,K.y=J.y*E+E,u||0<K.x&&K.x<y&&0<K.y&&K.y<A){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,M.x,M.y);m.uniform3f(p,J.x,J.y,J.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);P.positionScreen.copy(J);P.customUpdateCallback?P.customUpdateCallback(P):P.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var N=0,Q=P.lensFlares.length;N<Q;N++){var U=P.lensFlares[N];.001<U.opacity&&.001<U.scale&&(J.x=U.x,
+J.y=U.y,J.z=U.z,z=U.size*U.scale/A,M.x=z*F,M.y=z,m.uniform3f(p,J.x,J.y,J.z),m.uniform2f(h,M.x,M.y),m.uniform1f(k,U.rotation),m.uniform1f(f,U.opacity),m.uniform3f(g,U.color.r,U.color.g,U.color.b),a.setBlending(U.blending,U.blendEquation,U.blendSrc,U.blendDst),a.setTexture(U.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.ShadowMapPlugin=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===n.intersectsObject(b)))for(var g=0,h=f.length;g<h;g++){var k=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld);r.push(k)}g=0;for(h=b.children.length;g<h;g++)e(a,b.children[g],d)}}var f=a.context,g,h,k,p,n=new THREE.Frustum,q=new THREE.Matrix4,m=new THREE.Vector3,s=new THREE.Vector3,t=new THREE.Vector3,r=[],u=THREE.ShaderLib.depthRGBA,v=THREE.UniformsUtils.clone(u.uniforms);
+g=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader});h=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0});k=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,skinning:!0});p=new THREE.ShaderMaterial({uniforms:v,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,morphTargets:!0,skinning:!0});g._shadowPass=!0;h._shadowPass=!0;k._shadowPass=
+!0;p._shadowPass=!0;this.render=function(c,u){if(!1!==a.shadowMapEnabled){var v,y,A,F,G,E,z,M,J=[];F=0;f.clearColor(1,1,1,1);f.disable(f.BLEND);f.enable(f.CULL_FACE);f.frontFace(f.CCW);a.shadowMapCullFace===THREE.CullFaceFront?f.cullFace(f.FRONT):f.cullFace(f.BACK);a.setDepthTest(!0);v=0;for(y=b.length;v<y;v++)if(A=b[v],A.castShadow)if(A instanceof THREE.DirectionalLight&&A.shadowCascade)for(G=0;G<A.shadowCascadeCount;G++){var K;if(A.shadowCascadeArray[G])K=A.shadowCascadeArray[G];else{z=A;var L=
+G;K=new THREE.DirectionalLight;K.isVirtual=!0;K.onlyShadow=!0;K.castShadow=!0;K.shadowCameraNear=z.shadowCameraNear;K.shadowCameraFar=z.shadowCameraFar;K.shadowCameraLeft=z.shadowCameraLeft;K.shadowCameraRight=z.shadowCameraRight;K.shadowCameraBottom=z.shadowCameraBottom;K.shadowCameraTop=z.shadowCameraTop;K.shadowCameraVisible=z.shadowCameraVisible;K.shadowDarkness=z.shadowDarkness;K.shadowBias=z.shadowCascadeBias[L];K.shadowMapWidth=z.shadowCascadeWidth[L];K.shadowMapHeight=z.shadowCascadeHeight[L];
+K.pointsWorld=[];K.pointsFrustum=[];M=K.pointsWorld;E=K.pointsFrustum;for(var T=0;8>T;T++)M[T]=new THREE.Vector3,E[T]=new THREE.Vector3;M=z.shadowCascadeNearZ[L];z=z.shadowCascadeFarZ[L];E[0].set(-1,-1,M);E[1].set(1,-1,M);E[2].set(-1,1,M);E[3].set(1,1,M);E[4].set(-1,-1,z);E[5].set(1,-1,z);E[6].set(-1,1,z);E[7].set(1,1,z);K.originalCamera=u;E=new THREE.Gyroscope;E.position.copy(A.shadowCascadeOffset);E.add(K);E.add(K.target);u.add(E);A.shadowCascadeArray[G]=K;console.log("Created virtualLight",K)}L=
+A;M=G;z=L.shadowCascadeArray[M];z.position.copy(L.position);z.target.position.copy(L.target.position);z.lookAt(z.target);z.shadowCameraVisible=L.shadowCameraVisible;z.shadowDarkness=L.shadowDarkness;z.shadowBias=L.shadowCascadeBias[M];E=L.shadowCascadeNearZ[M];L=L.shadowCascadeFarZ[M];z=z.pointsFrustum;z[0].z=E;z[1].z=E;z[2].z=E;z[3].z=E;z[4].z=L;z[5].z=L;z[6].z=L;z[7].z=L;J[F]=K;F++}else J[F]=A,F++;v=0;for(y=J.length;v<y;v++){A=J[v];A.shadowMap||(G=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&
+(G=THREE.NearestFilter),A.shadowMap=new THREE.WebGLRenderTarget(A.shadowMapWidth,A.shadowMapHeight,{minFilter:G,magFilter:G,format:THREE.RGBAFormat}),A.shadowMapSize=new THREE.Vector2(A.shadowMapWidth,A.shadowMapHeight),A.shadowMatrix=new THREE.Matrix4);if(!A.shadowCamera){if(A instanceof THREE.SpotLight)A.shadowCamera=new THREE.PerspectiveCamera(A.shadowCameraFov,A.shadowMapWidth/A.shadowMapHeight,A.shadowCameraNear,A.shadowCameraFar);else if(A instanceof THREE.DirectionalLight)A.shadowCamera=new THREE.OrthographicCamera(A.shadowCameraLeft,
+A.shadowCameraRight,A.shadowCameraTop,A.shadowCameraBottom,A.shadowCameraNear,A.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}c.add(A.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}A.shadowCameraVisible&&!A.cameraHelper&&(A.cameraHelper=new THREE.CameraHelper(A.shadowCamera),c.add(A.cameraHelper));if(A.isVirtual&&K.originalCamera==u){G=u;F=A.shadowCamera;E=A.pointsFrustum;z=A.pointsWorld;m.set(Infinity,Infinity,Infinity);s.set(-Infinity,-Infinity,-Infinity);
+for(L=0;8>L;L++)M=z[L],M.copy(E[L]),M.unproject(G),M.applyMatrix4(F.matrixWorldInverse),M.x<m.x&&(m.x=M.x),M.x>s.x&&(s.x=M.x),M.y<m.y&&(m.y=M.y),M.y>s.y&&(s.y=M.y),M.z<m.z&&(m.z=M.z),M.z>s.z&&(s.z=M.z);F.left=m.x;F.right=s.x;F.top=s.y;F.bottom=m.y;F.updateProjectionMatrix()}F=A.shadowMap;E=A.shadowMatrix;G=A.shadowCamera;G.position.setFromMatrixPosition(A.matrixWorld);t.setFromMatrixPosition(A.target.matrixWorld);G.lookAt(t);G.updateMatrixWorld();G.matrixWorldInverse.getInverse(G.matrixWorld);A.cameraHelper&&
+(A.cameraHelper.visible=A.shadowCameraVisible);A.shadowCameraVisible&&A.cameraHelper.update();E.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);E.multiply(G.projectionMatrix);E.multiply(G.matrixWorldInverse);q.multiplyMatrices(G.projectionMatrix,G.matrixWorldInverse);n.setFromMatrix(q);a.setRenderTarget(F);a.clear();r.length=0;e(c,c,G);A=0;for(F=r.length;A<F;A++)z=r[A],E=z.object,z=z.buffer,L=E.material instanceof THREE.MeshFaceMaterial?E.material.materials[0]:E.material,M=void 0!==E.geometry.morphTargets&&
+0<E.geometry.morphTargets.length&&L.morphTargets,T=E instanceof THREE.SkinnedMesh&&L.skinning,M=E.customDepthMaterial?E.customDepthMaterial:T?M?p:k:M?h:g,a.setMaterialFaces(L),z instanceof THREE.BufferGeometry?a.renderBufferDirect(G,b,null,M,z,E):a.renderBuffer(G,b,null,M,z,E);A=0;for(F=d.length;A<F;A++)z=d[A],E=z.object,E.visible&&E.castShadow&&(E._modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,E.matrixWorld),a.renderImmediateObject(G,b,null,g,E))}v=a.getClearColor();y=a.getClearAlpha();f.clearColor(v.r,
+v.g,v.b,y);f.enable(f.BLEND);a.shadowMapCullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,p,n,q,m,s,t,r,u,v,x;function C(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,y,A,F,G,E=new THREE.Vector3,z=new THREE.Quaternion,M=new THREE.Vector3;this.render=function(J,K){if(0!==b.length){if(void 0===F){var L=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),T=new Uint16Array([0,1,2,0,2,3]);y=w.createBuffer();A=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,y);w.bufferData(w.ARRAY_BUFFER,L,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
+A);w.bufferData(w.ELEMENT_ARRAY_BUFFER,T,w.STATIC_DRAW);var L=w.createProgram(),T=w.createShader(w.VERTEX_SHADER),P=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(T,["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(P,["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(T);w.compileShader(P);w.attachShader(L,T);w.attachShader(L,P);w.linkProgram(L);F=L;v=w.getAttribLocation(F,"position");x=w.getAttribLocation(F,"uv");c=w.getUniformLocation(F,"uvOffset");d=w.getUniformLocation(F,"uvScale");e=w.getUniformLocation(F,"rotation");f=w.getUniformLocation(F,"scale");g=w.getUniformLocation(F,"color");h=w.getUniformLocation(F,"map");k=w.getUniformLocation(F,"opacity");p=w.getUniformLocation(F,"modelViewMatrix");n=w.getUniformLocation(F,"projectionMatrix");q=
+w.getUniformLocation(F,"fogType");m=w.getUniformLocation(F,"fogDensity");s=w.getUniformLocation(F,"fogNear");t=w.getUniformLocation(F,"fogFar");r=w.getUniformLocation(F,"fogColor");u=w.getUniformLocation(F,"alphaTest");L=document.createElement("canvas");L.width=8;L.height=8;T=L.getContext("2d");T.fillStyle="white";T.fillRect(0,0,8,8);G=new THREE.Texture(L);G.needsUpdate=!0}w.useProgram(F);w.enableVertexAttribArray(v);w.enableVertexAttribArray(x);w.disable(w.CULL_FACE);w.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,
+y);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,A);w.uniformMatrix4fv(n,!1,K.projectionMatrix.elements);w.activeTexture(w.TEXTURE0);w.uniform1i(h,0);T=L=0;(P=J.fog)?(w.uniform3f(r,P.color.r,P.color.g,P.color.b),P instanceof THREE.Fog?(w.uniform1f(s,P.near),w.uniform1f(t,P.far),w.uniform1i(q,1),T=L=1):P instanceof THREE.FogExp2&&(w.uniform1f(m,P.density),w.uniform1i(q,2),T=L=2)):(w.uniform1i(q,0),T=L=0);for(var P=0,N=b.length;P<
+N;P++){var Q=b[P];Q._modelViewMatrix.multiplyMatrices(K.matrixWorldInverse,Q.matrixWorld);Q.z=-Q._modelViewMatrix.elements[14]}b.sort(C);for(var U=[],P=0,N=b.length;P<N;P++){var Q=b[P],I=Q.material;w.uniform1f(u,I.alphaTest);w.uniformMatrix4fv(p,!1,Q._modelViewMatrix.elements);Q.matrixWorld.decompose(E,z,M);U[0]=M.x;U[1]=M.y;Q=0;J.fog&&I.fog&&(Q=T);L!==Q&&(w.uniform1i(q,Q),L=Q);null!==I.map?(w.uniform2f(c,I.map.offset.x,I.map.offset.y),w.uniform2f(d,I.map.repeat.x,I.map.repeat.y)):(w.uniform2f(c,
+0,0),w.uniform2f(d,1,1));w.uniform1f(k,I.opacity);w.uniform3f(g,I.color.r,I.color.g,I.color.b);w.uniform1f(e,I.rotation);w.uniform2fv(f,U);a.setBlending(I.blending,I.blendEquation,I.blendSrc,I.blendDst);a.setDepthTest(I.depthTest);a.setDepthWrite(I.depthWrite);I.map&&I.map.image&&I.map.image.width?a.setTexture(I.map,0):a.setTexture(G,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}w.enable(w.CULL_FACE);a.resetGLState()}}};
 THREE.GeometryUtils={merge:function(a,b,c){console.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){console.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(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.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),n=k.data,p=0;p<d;p++)for(var q=0;q<e;q++){var m=0>q-1?0:q-1,t=q+1>e-1?e-1:q+1,s=0>p-1?0:p-1,r=p+1>d-1?d-1:p+1,u=[],v=[0,0,h[4*(q*d+p)]/255*b];u.push([-1,0,h[4*(q*d+s)]/255*b]);u.push([-1,-1,h[4*(m*d+s)]/255*b]);u.push([0,-1,h[4*(m*d+p)]/255*b]);u.push([1,-1,h[4*(m*d+r)]/255*b]);u.push([1,0,h[4*(q*d+r)]/255*b]);u.push([1,1,h[4*(t*d+r)]/255*b]);u.push([0,1,h[4*(t*d+p)]/255*
-b]);u.push([-1,1,h[4*(t*d+s)]/255*b]);m=[];s=u.length;for(t=0;t<s;t++){var r=u[t],y=u[(t+1)%s],r=[r[0]-v[0],r[1]-v[1],r[2]-v[2]],y=[y[0]-v[0],y[1]-v[1],y[2]-v[2]];m.push(c([r[1]*y[2]-r[2]*y[1],r[2]*y[0]-r[0]*y[2],r[0]*y[1]-r[1]*y[0]]))}u=[0,0,0];for(t=0;t<m.length;t++)u[0]+=m[t][0],u[1]+=m[t][1],u[2]+=m[t][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;v=4*(q*d+p);n[v]=(u[0]+1)/2*255|0;n[v+1]=(u[1]+1)/2*255|0;n[v+2]=255*u[2]|0;n[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),p=k.data,n=0;n<d;n++)for(var q=0;q<e;q++){var m=0>q-1?0:q-1,s=q+1>e-1?e-1:q+1,t=0>n-1?0:n-1,r=n+1>d-1?d-1:n+1,u=[],v=[0,0,h[4*(q*d+n)]/255*b];u.push([-1,0,h[4*(q*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+r)]/255*b]);u.push([1,0,h[4*(q*d+r)]/255*b]);u.push([1,1,h[4*(s*d+r)]/255*b]);u.push([0,1,h[4*(s*d+n)]/255*
+b]);u.push([-1,1,h[4*(s*d+t)]/255*b]);m=[];t=u.length;for(s=0;s<t;s++){var r=u[s],x=u[(s+1)%t],r=[r[0]-v[0],r[1]-v[1],r[2]-v[2]],x=[x[0]-v[0],x[1]-v[1],x[2]-v[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]]))}u=[0,0,0];for(s=0;s<m.length;s++)u[0]+=m[s][0],u[1]+=m[s][1],u[2]+=m[s][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;v=4*(q*d+n);p[v]=(u[0]+1)/2*255|0;p[v+1]=(u[1]+1)/2*255|0;p[v+2]=255*u[2]|0;p[v+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,n,p,q,m,t,s,r,u,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),n=b.length,a=0;a<n;)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;t=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(t,s,k,p);if(g=f[f.length-1])for(q=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++){var y=g/h;THREE.Shape.Utils.b2(y,q,t,k);THREE.Shape.Utils.b2(y,m,s,p)}break;case "b":if(k=b[a++]*c+d,p=b[a++]*c,t=b[a++]*c+d,s=b[a++]*c,r=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(t,s,r,u,k,p),g=f[f.length-1])for(q=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++)y=g/h,THREE.Shape.Utils.b3(y,q,t,r,k),THREE.Shape.Utils.b3(y,
-m,s,u,p)}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,p,n,q,m,s,t,r,u,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),p=b.length,a=0;a<p;)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;s=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(s,t,k,n);if(g=f[f.length-1])for(q=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++){var x=g/h;THREE.Shape.Utils.b2(x,q,s,k);THREE.Shape.Utils.b2(x,m,t,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,s=b[a++]*c+d,t=b[a++]*c,r=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(s,t,r,u,k,n),g=f[f.length-1])for(q=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++)x=g/h,THREE.Shape.Utils.b3(x,q,s,r,k),THREE.Shape.Utils.b3(x,
+m,t,u,n)}return{offset:v.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,n,p;if(0<b(a))for(n=0;n<e;n++)g[n]=n;else for(n=0;n<e;n++)g[n]=e-1-n;var q=2*e;for(n=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=n;e<=k&&(k=0);n=k+1;e<=n&&(n=0);p=n+1;e<=p&&(p=0);var m;a:{var t=m=void 0,s=void 0,r=void 0,u=void 0,v=void 0,y=void 0,E=void 0,x=void 0,
-t=a[g[k]].x,s=a[g[k]].y,r=a[g[n]].x,u=a[g[n]].y,v=a[g[p]].x,y=a[g[p]].y;if(1E-10>(r-t)*(y-s)-(u-s)*(v-t))m=!1;else{var O=void 0,z=void 0,F=void 0,D=void 0,A=void 0,w=void 0,B=void 0,K=void 0,L=void 0,H=void 0,L=K=B=x=E=void 0,O=v-r,z=y-u,F=t-v,D=s-y,A=r-t,w=u-s;for(m=0;m<e;m++)if(E=a[g[m]].x,x=a[g[m]].y,!(E===t&&x===s||E===r&&x===u||E===v&&x===y)&&(B=E-t,K=x-s,L=E-r,H=x-u,E-=v,x-=y,L=O*H-z*L,B=A*K-w*B,K=F*x-D*E,-1E-10<=L&&-1E-10<=K&&-1E-10<=B)){m=!1;break a}m=!0}}if(m){f.push([a[g[k]],a[g[n]],a[g[p]]]);
-h.push([g[k],g[n],g[p]]);k=n;for(p=n+1;p<e;k++,p++)g[k]=g[p];e--;q=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,p,n;if(0<b(a))for(p=0;p<e;p++)g[p]=p;else for(p=0;p<e;p++)g[p]=e-1-p;var q=2*e;for(p=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=p;e<=k&&(k=0);p=k+1;e<=p&&(p=0);n=p+1;e<=n&&(n=0);var m;a:{var s=m=void 0,t=void 0,r=void 0,u=void 0,v=void 0,x=void 0,C=void 0,w=void 0,
+s=a[g[k]].x,t=a[g[k]].y,r=a[g[p]].x,u=a[g[p]].y,v=a[g[n]].x,x=a[g[n]].y;if(1E-10>(r-s)*(x-t)-(u-t)*(v-s))m=!1;else{var y=void 0,A=void 0,F=void 0,G=void 0,E=void 0,z=void 0,M=void 0,J=void 0,K=void 0,L=void 0,K=J=M=w=C=void 0,y=v-r,A=x-u,F=s-v,G=t-x,E=r-s,z=u-t;for(m=0;m<e;m++)if(C=a[g[m]].x,w=a[g[m]].y,!(C===s&&w===t||C===r&&w===u||C===v&&w===x)&&(M=C-s,J=w-t,K=C-r,L=w-u,C-=v,w-=x,K=y*L-A*K,M=E*J-z*M,J=F*w-G*C,-1E-10<=K&&-1E-10<=J&&-1E-10<=M)){m=!1;break a}m=!0}}if(m){f.push([a[g[k]],a[g[p]],a[g[n]]]);
+h.push([g[k],g[p],g[n]]);k=p;for(n=p+1;n<e;k++,n++)g[k]=g[n];e--;q=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.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain)};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.source.connect(b.panner);b.source.start(0)})};c.send();return this};THREE.Audio.prototype.setLoop=function(a){this.source.loop=a};THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a};THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a};
 THREE.Audio.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3;return function(b){THREE.Object3D.prototype.updateMatrixWorld.call(this,b);a.setFromMatrixPosition(this.matrixWorld);this.panner.setPosition(a.x,a.y,a.z)}}();THREE.AudioListener=function(){THREE.Object3D.call(this);this.type="AudioListener";this.context=new (window.AudioContext||window.webkitAudioContext)};THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype);THREE.AudioListener.prototype.constructor=THREE.AudioListener;
@@ -643,7 +643,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,n,p,q=a[0]instanceof THREE.Vector3;p=q?new THREE.Vector3:new THREE.Vector2;k=0;for(n=a.length;k<n;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),q&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),p.add(h);a={minX:e,minY:f,maxX:b,maxY:c};q&&(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,p,n,q=a[0]instanceof THREE.Vector3;n=q?new THREE.Vector3:new THREE.Vector2;k=0;for(p=a.length;k<p;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),q&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),n.add(h);a={minX:e,minY:f,maxX:b,maxY:c};q&&(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;
@@ -656,22 +656,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 console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,n,p,q,m,t,s,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];q=f[0];m=f[1];0<c.length?(g=c[c.length-1],t=g.x,
-s=g.y):(g=this.actions[d-1].args,t=g[g.length-2],s=g[g.length-1]);for(f=1;f<=a;f++)r=f/a,g=THREE.Shape.Utils.b2(r,t,q,h),r=THREE.Shape.Utils.b2(r,s,m,k),c.push(new THREE.Vector2(g,r));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];q=f[0];m=f[1];n=f[2];p=f[3];0<c.length?(g=c[c.length-1],t=g.x,s=g.y):(g=this.actions[d-1].args,t=g[g.length-2],s=g[g.length-1]);for(f=1;f<=a;f++)r=f/a,g=THREE.Shape.Utils.b3(r,t,q,n,h),r=THREE.Shape.Utils.b3(r,s,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];n=f[3];g=f[4];q=!!f[5];t=g-n;s=2*a;for(f=1;f<=s;f++)r=f/s,q||(r=1-r),r=n+r*t,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],n=f[4],g=f[5],q=!!f[6],t=g-n,s=2*a,f=1;f<=s;f++)r=f/s,q||
-(r=1-r),r=n+r*t,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.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,p,n,q,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];q=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,q,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];q=f[0];m=f[1];p=f[2];n=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,q,p,h),r=THREE.Shape.Utils.b3(r,t,m,n,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];p=f[3];g=f[4];q=!!f[5];s=g-p;t=2*a;for(f=1;f<=t;f++)r=f/t,q||(r=1-r),r=p+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],n=f[3],p=f[4],g=f[5],q=!!f[6],s=g-p,t=2*a,f=1;f<=t;f++)r=f/t,q||
+(r=1-r),r=p+r*s,g=h+m*Math.cos(r),r=k+n*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],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<=
-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 n=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),n=a?!n:n;
-h=[];var p=[],q=[],m=0,t;p[m]=void 0;q[m]=[];var s,r;s=0;for(r=e.length;s<r;s++)g=e[s],t=g.getPoints(),f=THREE.Shape.Utils.isClockWise(t),(f=a?!f:f)?(!n&&p[m]&&m++,p[m]={s:new THREE.Shape,p:t},p[m].s.actions=g.actions,p[m].s.curves=g.curves,n&&m++,q[m]=[]):q[m].push({h:g,p:t[0]});if(!p[0])return c(e);if(1<p.length){s=!1;r=[];g=0;for(e=p.length;g<e;g++)h[g]=[];g=0;for(e=p.length;g<e;g++)for(f=q[g],n=0;n<f.length;n++){m=f[n];t=!0;for(var u=0;u<p.length;u++)d(m.p,p[u].p)&&(g!=u&&r.push({froms:g,tos:u,
-hole:n}),t?(t=!1,h[u].push(m)):s=!0);t&&h[g].push(m)}0<r.length&&(s||(q=h))}s=0;for(r=p.length;s<r;s++)for(h=p[s].s,k.push(h),g=q[s],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.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 p=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),p=a?!p:p;
+h=[];var n=[],q=[],m=0,s;n[m]=void 0;q[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)?(!p&&n[m]&&m++,n[m]={s:new THREE.Shape,p:s},n[m].s.actions=g.actions,n[m].s.curves=g.curves,p&&m++,q[m]=[]):q[m].push({h:g,p:s[0]});if(!n[0])return c(e);if(1<n.length){t=!1;r=[];g=0;for(e=n.length;g<e;g++)h[g]=[];g=0;for(e=n.length;g<e;g++)for(f=q[g],p=0;p<f.length;p++){m=f[p];s=!0;for(var u=0;u<n.length;u++)d(m.p,n[u].p)&&(g!=u&&r.push({froms:g,tos:u,
+hole:p}),s?(s=!1,h[u].push(m)):t=!0);s&&h[g].push(m)}0<r.length&&(t||(q=h))}t=0;for(r=n.length;t<r;t++)for(h=n[t].s,k.push(h),g=q[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,g){var f=b.x-a.x,h=b.y-a.y,k=e.x-d.x,n=e.y-d.y,p=a.x-d.x,q=a.y-d.y,F=h*k-f*n,D=h*p-f*q;if(1E-10<Math.abs(F)){if(0<F){if(0>D||D>F)return[];k=n*p-k*q;if(0>k||k>F)return[]}else{if(0<D||D<F)return[];k=n*p-k*q;if(0<k||k<F)return[]}if(0==k)return!g||0!=D&&D!=F?[a]:[];if(k==F)return!g||0!=D&&D!=F?[b]:[];if(0==D)return[d];
-if(D==F)return[e];g=k/F;return[{x:a.x+g*f,y:a.y+g*h}]}if(0!=D||n*p!=k*q)return[];h=0==f&&0==h;k=0==k&&0==n;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!=f?(a.x<b.x?(f=a,k=a.x,h=b,a=b.x):(f=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,F=d.x,n=e,d=e.x):(b=e,F=e.x,n=d,d=d.x)):(a.y<b.y?(f=a,k=a.y,h=b,a=b.y):(f=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,F=d.y,n=e,d=e.y):(b=e,F=e.y,n=d,d=d.y));return k<=F?a<F?[]:a==F?g?[]:[b]:a<=d?[b,h]:[b,n]:k>d?[]:k==d?g?[]:[f]:a<=d?[f,h]:
-[f,n]}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,n,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++)n=h[f].x+":"+h[f].y,void 0!==p[n]&&console.log("Duplicate point",n),p[n]=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<n.length;e++)for(f=b[n[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,n=[],p,q,z,F,D,A=[],w,B,K,L=0;for(p=b.length;L<p;L++)n.push(L);w=0;for(var H=2*n.length;0<n.length;){H--;if(0>H){console.log("Infinite Loop! Holes left:"+
-n.length+", Probably Hole outside Shape!");break}for(q=w;q<h.length;q++){z=h[q];p=-1;for(L=0;L<n.length;L++)if(F=n[L],D=z.x+":"+z.y+":"+F,void 0===A[D]){k=b[F];for(B=0;B<k.length;B++)if(F=k[B],c(q,B)&&!f(z,F)&&!g(z,F)){p=B;n.splice(L,1);w=h.slice(0,q+1);F=h.slice(q);B=k.slice(p);K=k.slice(0,p+1);h=w.concat(B).concat(K).concat(F);w=q;break}if(0<=p)break;A[D]=!0}if(0<=p)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)n=k[h].x+":"+k[h].y,
-n=p[n],void 0!==n&&(k[h]=n);return q.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,
+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,n=e.y-d.y,p=a.x-d.x,q=a.y-d.y,F=h*k-g*n,G=h*p-g*q;if(1E-10<Math.abs(F)){if(0<F){if(0>G||G>F)return[];k=n*p-k*q;if(0>k||k>F)return[]}else{if(0<G||G<F)return[];k=n*p-k*q;if(0<k||k<F)return[]}if(0==k)return!f||0!=G&&G!=F?[a]:[];if(k==F)return!f||0!=G&&G!=F?[b]:[];if(0==G)return[d];
+if(G==F)return[e];f=k/F;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=G||n*p!=k*q)return[];h=0==g&&0==h;k=0==k&&0==n;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,F=d.x,n=e,d=e.x):(b=e,F=e.x,n=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,F=d.y,n=e,d=e.y):(b=e,F=e.y,n=d,d=d.y));return k<=F?a<F?[]:a==F?f?[]:[b]:a<=d?[b,h]:[b,n]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
+[g,n]}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,p,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++)p=h[f].x+":"+h[f].y,void 0!==n[p]&&console.log("Duplicate point",p),n[p]=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<n.length;e++)for(f=b[n[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,n=[],p,q,A,F,G,E=[],z,M,J,K=0;for(p=b.length;K<p;K++)n.push(K);z=0;for(var L=2*n.length;0<n.length;){L--;if(0>L){console.log("Infinite Loop! Holes left:"+
+n.length+", Probably Hole outside Shape!");break}for(q=z;q<h.length;q++){A=h[q];p=-1;for(K=0;K<n.length;K++)if(F=n[K],G=A.x+":"+A.y+":"+F,void 0===E[G]){k=b[F];for(M=0;M<k.length;M++)if(F=k[M],c(q,M)&&!f(A,F)&&!g(A,F)){p=M;n.splice(K,1);z=h.slice(0,q+1);F=h.slice(q);M=k.slice(p);J=k.slice(0,p+1);h=z.concat(M).concat(J).concat(F);z=q;break}if(0<=p)break;E[G]=!0}if(0<=p)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)p=k[h].x+":"+k[h].y,
+p=n[p],void 0!==p&&(k[h]=p);return q.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()};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve;
@@ -693,12 +693,12 @@ THREE.Animation.prototype.play=function(a,b){this.currentTime=void 0!==a?a:0;thi
 THREE.Animation.prototype.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}});void 0===c.animationCache.animations[this.data.name]&&(c.animationCache.animations[this.data.name]={},c.animationCache.animations[this.data.name].prevKey={pos:0,rot:0,scl:0},c.animationCache.animations[this.data.name].nextKey={pos:0,rot:0,scl:0},c.animationCache.animations[this.data.name].originalMatrix=
 c.matrix);for(var c=c.animationCache.animations[this.data.name],d=0;3>d;d++){for(var e=this.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.time<this.currentTime&&g.index>f.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}};
 THREE.Animation.prototype.resetBlendWeights=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];void 0!==c.animationCache&&(c.animationCache.blending.positionWeight=0,c.animationCache.blending.quaternionWeight=0,c.animationCache.blending.scaleWeight=0)}};
-THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,m,t,s,r;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];s=a[c[2]];r=a[c[3]];c=e*e;m=e*c;d[0]=f(q[0],t[0],s[0],r[0],e,c,m);d[1]=f(q[1],t[1],s[1],r[1],e,c,m);d[2]=f(q[2],t[2],s[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],n=k.animationCache.animations[this.data.name],p=k.animationCache.blending,q=0;3>q;q++){var m=this.keyTypes[q],t=n.prevKey[m],s=n.nextKey[m];if(0<this.timeScale&&
-s.time<=this.currentTime||0>this.timeScale&&t.time>=this.currentTime){t=this.data.hierarchy[f].keys[0];for(s=this.getNextKeyWith(m,f,1);s.time<this.currentTime&&s.index>t.index;)t=s,s=this.getNextKeyWith(m,f,s.index+1);n.prevKey[m]=t;n.nextKey[m]=s}var r=(this.currentTime-t.time)/(s.time-t.time),u=t[m],v=s[m];0>r&&(r=0);1<r&&(r=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*r,c.y=u[1]+(v[1]-u[1])*r,c.z=u[2]+(v[2]-u[2])*r,t=this.weight/(this.weight+p.positionWeight),
-k.position.lerp(c,t),p.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,t.index-1).pos,a[1]=u,a[2]=v,a[3]=this.getNextKeyWith("pos",f,s.index+1).pos,r=.33*r+.33,s=e(a,r),t=this.weight/(this.weight+p.positionWeight),p.positionWeight+=this.weight,m=k.position,m.x+=(s[0]-m.x)*t,m.y+=(s[1]-m.y)*t,m.z+=(s[2]-m.z)*t,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(u,v,d,r),0===p.quaternionWeight?(k.quaternion.copy(d),p.quaternionWeight=this.weight):(t=this.weight/(this.weight+p.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,t),p.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+(v[0]-u[0])*r,c.y=u[1]+(v[1]-u[1])*r,c.z=u[2]+(v[2]-u[2])*r,t=this.weight/(this.weight+p.scaleWeight),k.scale.lerp(c,
-t),p.scaleWeight+=this.weight)}return!0}}}();THREE.Animation.prototype.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]};
+THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,m,s,t,r;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];s=a[c[1]];t=a[c[2]];r=a[c[3]];c=e*e;m=e*c;d[0]=f(q[0],s[0],t[0],r[0],e,c,m);d[1]=f(q[1],s[1],t[1],r[1],e,c,m);d[2]=f(q[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],p=k.animationCache.animations[this.data.name],n=k.animationCache.blending,q=0;3>q;q++){var m=this.keyTypes[q],s=p.prevKey[m],t=p.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);p.prevKey[m]=s;p.nextKey[m]=t}var r=(this.currentTime-s.time)/(t.time-s.time),u=s[m],v=t[m];0>r&&(r=0);1<r&&(r=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*r,c.y=u[1]+(v[1]-u[1])*r,c.z=u[2]+(v[2]-u[2])*r,s=this.weight/(this.weight+n.positionWeight),
+k.position.lerp(c,s),n.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]=u,a[2]=v,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,r=.33*r+.33,t=e(a,r),s=this.weight/(this.weight+n.positionWeight),n.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(u,v,d,r),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(s=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,s),n.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+(v[0]-u[0])*r,c.y=u[1]+(v[1]-u[1])*r,c.z=u[2]+(v[2]-u[2])*r,s=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,
+s),n.scaleWeight+=this.weight)}return!0}}}();THREE.Animation.prototype.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]};
 THREE.Animation.prototype.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}}};
@@ -709,67 +709,67 @@ f;d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.inter
 THREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};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);b!=this.currentFrame&&(this.mesh.morphTargetInfluences[this.lastFrame]=0,this.mesh.morphTargetInfluences[this.currentFrame]=
 1,this.mesh.morphTargetInfluences[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);this.mesh.morphTargetInfluences[b]=this.currentTime%a/a;this.mesh.morphTargetInfluences[this.lastFrame]=1-this.mesh.morphTargetInfluences[b]}}};
-THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,r){var u,v=h.widthSegments,y=h.heightSegments,E=e/2,x=f/2,O=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",y=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var z=v+1,F=y+1,D=e/v,A=f/y,w=new THREE.Vector3;w[u]=0<g?1:-1;for(e=0;e<F;e++)for(f=0;f<z;f++){var B=new THREE.Vector3;B[a]=(f*D-E)*c;B[b]=(e*A-x)*d;B[u]=g;h.vertices.push(B)}for(e=
-0;e<y;e++)for(f=0;f<v;f++)x=f+z*e,a=f+z*(e+1),b=f+1+z*(e+1),c=f+1+z*e,d=new THREE.Vector2(f/v,1-e/y),g=new THREE.Vector2(f/v,1-(e+1)/y),u=new THREE.Vector2((f+1)/v,1-(e+1)/y),E=new THREE.Vector2((f+1)/v,1-e/y),x=new THREE.Face3(x+O,a+O,c+O),x.normal.copy(w),x.vertexNormals.push(w.clone(),w.clone(),w.clone()),x.materialIndex=r,h.faces.push(x),h.faceVertexUvs[0].push([d,g,E]),x=new THREE.Face3(a+O,b+O,c+O),x.normal.copy(w),x.vertexNormals.push(w.clone(),w.clone(),w.clone()),x.materialIndex=r,h.faces.push(x),
-h.faceVertexUvs[0].push([g.clone(),u,E.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 u,v=h.widthSegments,x=h.heightSegments,C=e/2,w=f/2,y=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 A=v+1,F=x+1,G=e/v,E=f/x,z=new THREE.Vector3;z[u]=0<g?1:-1;for(e=0;e<F;e++)for(f=0;f<A;f++){var M=new THREE.Vector3;M[a]=(f*G-C)*c;M[b]=(e*E-w)*d;M[u]=g;h.vertices.push(M)}for(e=
+0;e<x;e++)for(f=0;f<v;f++)w=f+A*e,a=f+A*(e+1),b=f+1+A*(e+1),c=f+1+A*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),C=new THREE.Vector2((f+1)/v,1-e/x),w=new THREE.Face3(w+y,a+y,c+y),w.normal.copy(z),w.vertexNormals.push(z.clone(),z.clone(),z.clone()),w.materialIndex=r,h.faces.push(w),h.faceVertexUvs[0].push([d,g,C]),w=new THREE.Face3(a+y,b+y,c+y),w.normal.copy(z),w.vertexNormals.push(z.clone(),z.clone(),z.clone()),w.materialIndex=r,h.faces.push(w),
+h.faceVertexUvs[0].push([g.clone(),u,C.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.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.CubeGeometry=function(a,b,c,d,e,f){console.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry.");return new THREE.BoxGeometry(a,b,c,d,e,f)};
-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,n,p,q=[],m=[];for(p=0;p<=e;p++){var t=[],s=[],r=p/e,u=r*(b-a)+a;for(n=0;n<=d;n++){var v=n/d,y=new THREE.Vector3;y.x=u*Math.sin(v*h+
-g);y.y=-r*c+k;y.z=u*Math.cos(v*h+g);this.vertices.push(y);t.push(this.vertices.length-1);s.push(new THREE.Vector2(v,1-r))}q.push(t);m.push(s)}c=(b-a)/c;for(n=0;n<d;n++)for(0!==a?(g=this.vertices[q[0][n]].clone(),h=this.vertices[q[0][n+1]].clone()):(g=this.vertices[q[1][n]].clone(),h=this.vertices[q[1][n+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 t=q[p][n],s=q[p+1][n],r=q[p+1][n+1],u=q[p][n+1],v=g.clone(),y=g.clone(),
-E=h.clone(),x=h.clone(),O=m[p][n].clone(),z=m[p+1][n].clone(),F=m[p+1][n+1].clone(),D=m[p][n+1].clone();this.faces.push(new THREE.Face3(t,s,u,[v,y,x]));this.faceVertexUvs[0].push([O,z,D]);this.faces.push(new THREE.Face3(s,r,u,[y.clone(),E,x.clone()]));this.faceVertexUvs[0].push([z.clone(),F,D.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),n=0;n<d;n++)t=q[0][n],s=q[0][n+1],r=this.vertices.length-1,v=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),E=new THREE.Vector3(0,
-1,0),O=m[0][n].clone(),z=m[0][n+1].clone(),F=new THREE.Vector2(z.x,0),this.faces.push(new THREE.Face3(t,s,r,[v,y,E])),this.faceVertexUvs[0].push([O,z,F]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),n=0;n<d;n++)t=q[e][n+1],s=q[e][n],r=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),E=new THREE.Vector3(0,-1,0),O=m[e][n+1].clone(),z=m[e][n].clone(),F=new THREE.Vector2(z.x,1),this.faces.push(new THREE.Face3(t,s,r,[v,y,E])),this.faceVertexUvs[0].push([O,
-z,F]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;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.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,p,n,q=[],m=[];for(n=0;n<=e;n++){var s=[],t=[],r=n/e,u=r*(b-a)+a;for(p=0;p<=d;p++){var v=p/d,x=new THREE.Vector3;x.x=u*Math.sin(v*h+
+g);x.y=-r*c+k;x.z=u*Math.cos(v*h+g);this.vertices.push(x);s.push(this.vertices.length-1);t.push(new THREE.Vector2(v,1-r))}q.push(s);m.push(t)}c=(b-a)/c;for(p=0;p<d;p++)for(0!==a?(g=this.vertices[q[0][p]].clone(),h=this.vertices[q[0][p+1]].clone()):(g=this.vertices[q[1][p]].clone(),h=this.vertices[q[1][p+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 s=q[n][p],t=q[n+1][p],r=q[n+1][p+1],u=q[n][p+1],v=g.clone(),x=g.clone(),
+C=h.clone(),w=h.clone(),y=m[n][p].clone(),A=m[n+1][p].clone(),F=m[n+1][p+1].clone(),G=m[n][p+1].clone();this.faces.push(new THREE.Face3(s,t,u,[v,x,w]));this.faceVertexUvs[0].push([y,A,G]);this.faces.push(new THREE.Face3(t,r,u,[x.clone(),C,w.clone()]));this.faceVertexUvs[0].push([A.clone(),F,G.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),p=0;p<d;p++)s=q[0][p],t=q[0][p+1],r=this.vertices.length-1,v=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),C=new THREE.Vector3(0,
+1,0),y=m[0][p].clone(),A=m[0][p+1].clone(),F=new THREE.Vector2(A.x,0),this.faces.push(new THREE.Face3(s,t,r,[v,x,C])),this.faceVertexUvs[0].push([y,A,F]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),p=0;p<d;p++)s=q[e][p+1],t=q[e][p],r=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),C=new THREE.Vector3(0,-1,0),y=m[e][p+1].clone(),A=m[e][p].clone(),F=new THREE.Vector2(A.x,1),this.faces.push(new THREE.Face3(s,t,r,[v,x,C])),this.faceVertexUvs[0].push([y,
+A,F]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;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||console.log("die");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),m=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/m-h)*g-(c.y+f/m-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=t+2*p,e=0;e<f;e++){var g=oa*e,h=oa*(e+1),k=b+c+g,g=b+d+g,m=b+d+h,h=b+c+h,k=k+K,g=g+K,m=m+K,h=h+K;B.faces.push(new THREE.Face3(k,g,h,null,null,y));B.faces.push(new THREE.Face3(g,m,h,null,null,y));k=E.generateSideWallUV(B,k,g,m,h);B.faceVertexUvs[0].push([k[0],k[1],k[3]]);B.faceVertexUvs[0].push([k[1],
-k[2],k[3]])}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=K;b+=K;c+=K;B.faces.push(new THREE.Face3(a,b,c,null,null,v));a=E.generateTopUV(B,a,b,c);B.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,n=void 0!==b.bevelSize?b.bevelSize:k-2,p=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,
-r,u=!1,v=b.material,y=b.extrudeMaterial,E=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,x,O,z,F;s&&(r=s.getSpacedPoints(t),u=!0,q=!1,x=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),O=new THREE.Vector3,z=new THREE.Vector3,F=new THREE.Vector3);q||(n=k=p=0);var D,A,w,B=this,K=this.vertices.length,s=a.extractPoints(m),m=s.shape,L=s.holes;if(s=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();A=0;for(w=L.length;A<w;A++)D=L[A],THREE.Shape.Utils.isClockWise(D)&&
-(L[A]=D.reverse());s=!1}var H=THREE.Shape.Utils.triangulateShape(m,L),T=m;A=0;for(w=L.length;A<w;A++)D=L[A],m=m.concat(D);var N,V,R,J,S,oa=m.length,aa,ta=H.length,s=[],P=0;R=T.length;N=R-1;for(V=P+1;P<R;P++,N++,V++)N===R&&(N=0),V===R&&(V=0),s[P]=d(T[P],T[N],T[V]);var Ca=[],pa,Xa=s.concat();A=0;for(w=L.length;A<w;A++){D=L[A];pa=[];P=0;R=D.length;N=R-1;for(V=P+1;P<R;P++,N++,V++)N===R&&(N=0),V===R&&(V=0),pa[P]=d(D[P],D[N],D[V]);Ca.push(pa);Xa=Xa.concat(pa)}for(N=0;N<p;N++){R=N/p;J=k*(1-R);V=n*Math.sin(R*
-Math.PI/2);P=0;for(R=T.length;P<R;P++)S=c(T[P],s[P],V),f(S.x,S.y,-J);A=0;for(w=L.length;A<w;A++)for(D=L[A],pa=Ca[A],P=0,R=D.length;P<R;P++)S=c(D[P],pa[P],V),f(S.x,S.y,-J)}V=n;for(P=0;P<oa;P++)S=q?c(m[P],Xa[P],V):m[P],u?(z.copy(x.normals[0]).multiplyScalar(S.x),O.copy(x.binormals[0]).multiplyScalar(S.y),F.copy(r[0]).add(z).add(O),f(F.x,F.y,F.z)):f(S.x,S.y,0);for(R=1;R<=t;R++)for(P=0;P<oa;P++)S=q?c(m[P],Xa[P],V):m[P],u?(z.copy(x.normals[R]).multiplyScalar(S.x),O.copy(x.binormals[R]).multiplyScalar(S.y),
-F.copy(r[R]).add(z).add(O),f(F.x,F.y,F.z)):f(S.x,S.y,h/t*R);for(N=p-1;0<=N;N--){R=N/p;J=k*(1-R);V=n*Math.sin(R*Math.PI/2);P=0;for(R=T.length;P<R;P++)S=c(T[P],s[P],V),f(S.x,S.y,h+J);A=0;for(w=L.length;A<w;A++)for(D=L[A],pa=Ca[A],P=0,R=D.length;P<R;P++)S=c(D[P],pa[P],V),u?f(S.x,S.y+r[t-1].y,r[t-1].x+J):f(S.x,S.y,h+J)}(function(){if(q){var a;a=0*oa;for(P=0;P<ta;P++)aa=H[P],g(aa[2]+a,aa[1]+a,aa[0]+a);a=t+2*p;a*=oa;for(P=0;P<ta;P++)aa=H[P],g(aa[0]+a,aa[1]+a,aa[2]+a)}else{for(P=0;P<ta;P++)aa=H[P],g(aa[2],
-aa[1],aa[0]);for(P=0;P<ta;P++)aa=H[P],g(aa[0]+oa*t,aa[1]+oa*t,aa[2]+oa*t)}})();(function(){var a=0;e(T,a);a+=T.length;A=0;for(w=L.length;A<w;A++)D=L[A],e(D,a),a+=D.length})()};
+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(R=a.length;0<=--R;){c=R;d=R-1;0>d&&(d=a.length-1);for(var e=0,f=s+2*n,e=0;e<f;e++){var g=na*e,h=na*(e+1),k=b+c+g,g=b+d+g,m=b+d+h,h=b+c+h,k=k+J,g=g+J,m=m+J,h=h+J;M.faces.push(new THREE.Face3(k,g,h,null,null,x));M.faces.push(new THREE.Face3(g,m,h,null,null,x));k=C.generateSideWallUV(M,k,g,m,h);M.faceVertexUvs[0].push([k[0],k[1],k[3]]);M.faceVertexUvs[0].push([k[1],
+k[2],k[3]])}}}function f(a,b,c){M.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=J;b+=J;c+=J;M.faces.push(new THREE.Face3(a,b,c,null,null,v));a=C.generateTopUV(M,a,b,c);M.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,p=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=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,u=!1,v=b.material,x=b.extrudeMaterial,C=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,y,A,F;t&&(r=t.getSpacedPoints(s),u=!0,q=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),y=new THREE.Vector3,A=new THREE.Vector3,F=new THREE.Vector3);q||(p=k=n=0);var G,E,z,M=this,J=this.vertices.length,t=a.extractPoints(m),m=t.shape,K=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();E=0;for(z=K.length;E<z;E++)G=K[E],THREE.Shape.Utils.isClockWise(G)&&
+(K[E]=G.reverse());t=!1}var L=THREE.Shape.Utils.triangulateShape(m,K),T=m;E=0;for(z=K.length;E<z;E++)G=K[E],m=m.concat(G);var P,N,Q,U,I,na=m.length,ca,sa=L.length,t=[],R=0;Q=T.length;P=Q-1;for(N=R+1;R<Q;R++,P++,N++)P===Q&&(P=0),N===Q&&(N=0),t[R]=d(T[R],T[P],T[N]);var xa=[],ra,ja=t.concat();E=0;for(z=K.length;E<z;E++){G=K[E];ra=[];R=0;Q=G.length;P=Q-1;for(N=R+1;R<Q;R++,P++,N++)P===Q&&(P=0),N===Q&&(N=0),ra[R]=d(G[R],G[P],G[N]);xa.push(ra);ja=ja.concat(ra)}for(P=0;P<n;P++){Q=P/n;U=k*(1-Q);N=p*Math.sin(Q*
+Math.PI/2);R=0;for(Q=T.length;R<Q;R++)I=c(T[R],t[R],N),f(I.x,I.y,-U);E=0;for(z=K.length;E<z;E++)for(G=K[E],ra=xa[E],R=0,Q=G.length;R<Q;R++)I=c(G[R],ra[R],N),f(I.x,I.y,-U)}N=p;for(R=0;R<na;R++)I=q?c(m[R],ja[R],N):m[R],u?(A.copy(w.normals[0]).multiplyScalar(I.x),y.copy(w.binormals[0]).multiplyScalar(I.y),F.copy(r[0]).add(A).add(y),f(F.x,F.y,F.z)):f(I.x,I.y,0);for(Q=1;Q<=s;Q++)for(R=0;R<na;R++)I=q?c(m[R],ja[R],N):m[R],u?(A.copy(w.normals[Q]).multiplyScalar(I.x),y.copy(w.binormals[Q]).multiplyScalar(I.y),
+F.copy(r[Q]).add(A).add(y),f(F.x,F.y,F.z)):f(I.x,I.y,h/s*Q);for(P=n-1;0<=P;P--){Q=P/n;U=k*(1-Q);N=p*Math.sin(Q*Math.PI/2);R=0;for(Q=T.length;R<Q;R++)I=c(T[R],t[R],N),f(I.x,I.y,h+U);E=0;for(z=K.length;E<z;E++)for(G=K[E],ra=xa[E],R=0,Q=G.length;R<Q;R++)I=c(G[R],ra[R],N),u?f(I.x,I.y+r[s-1].y,r[s-1].x+U):f(I.x,I.y,h+U)}(function(){if(q){var a;a=0*na;for(R=0;R<sa;R++)ca=L[R],g(ca[2]+a,ca[1]+a,ca[0]+a);a=s+2*n;a*=na;for(R=0;R<sa;R++)ca=L[R],g(ca[0]+a,ca[1]+a,ca[2]+a)}else{for(R=0;R<sa;R++)ca=L[R],g(ca[2],
+ca[1],ca[0]);for(R=0;R<sa;R++)ca=L[R],g(ca[0]+na*s,ca[1]+na*s,ca[2]+na*s)}})();(function(){var a=0;e(T,a);a+=T.length;E=0;for(z=K.length;E<z;E++)G=K[E],e(G,a),a+=G.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,n=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=n.length;e<f;e++)g=n[e],THREE.Shape.Utils.isClockWise(g)&&(n[e]=g.reverse());var p=THREE.Shape.Utils.triangulateShape(k,n);e=0;for(f=n.length;e<f;e++)g=n[e],
-k=k.concat(g);n=k.length;f=p.length;for(e=0;e<n;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)n=p[e],k=n[0]+h,g=n[1]+h,n=n[2]+h,this.faces.push(new THREE.Face3(k,g,n,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,g,n))};
-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,n=Math.cos(k),p=Math.sin(k),k=0,q=a.length;k<q;k++){var m=a[k],t=new THREE.Vector3;t.x=n*m.x-p*m.y;t.y=p*m.x+n*m.y;t.z=m.z;this.vertices.push(t)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,q=a.length-1;k<q;k++){b=p=k+c*g;d=p+c;var n=p+1+c,p=p+1,m=g*f,t=k*e,s=
-m+f,r=t+e;this.faces.push(new THREE.Face3(b,d,p));this.faceVertexUvs[0].push([new THREE.Vector2(m,t),new THREE.Vector2(s,t),new THREE.Vector2(m,r)]);this.faces.push(new THREE.Face3(d,n,p));this.faceVertexUvs[0].push([new THREE.Vector2(s,t),new THREE.Vector2(s,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.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,p=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=p.length;e<f;e++)g=p[e],THREE.Shape.Utils.isClockWise(g)&&(p[e]=g.reverse());var n=THREE.Shape.Utils.triangulateShape(k,p);e=0;for(f=p.length;e<f;e++)g=p[e],
+k=k.concat(g);p=k.length;f=n.length;for(e=0;e<p;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)p=n[e],k=p[0]+h,g=p[1]+h,p=p[2]+h,this.faces.push(new THREE.Face3(k,g,p,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,g,p))};
+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,p=Math.cos(k),n=Math.sin(k),k=0,q=a.length;k<q;k++){var m=a[k],s=new THREE.Vector3;s.x=p*m.x-n*m.y;s.y=n*m.x+p*m.y;s.z=m.z;this.vertices.push(s)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,q=a.length-1;k<q;k++){b=n=k+c*g;d=n+c;var p=n+1+c,n=n+1,m=g*f,s=k*e,t=
+m+f,r=s+e;this.faces.push(new THREE.Face3(b,d,n));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,p,n));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){console.info("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,n=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var p=new Float32Array(g*h*2),q=0,m=0,t=0;t<h;t++)for(var s=t*n-f,r=0;r<g;r++)b[q]=r*k-e,b[q+1]=-s,a[q+2]=1,p[m]=r/c,p[m+1]=1-t/d,q+=3,m+=2;q=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*d*6);for(t=0;t<d;t++)for(r=
-0;r<c;r++)f=r+g*(t+1),h=r+1+g*(t+1),k=r+1+g*t,e[q]=r+g*t,e[q+1]=f,e[q+2]=k,e[q+3]=f,e[q+4]=h,e[q+5]=k,q+=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,n=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var p=new THREE.Vector3,q=e+g/c*f;p.x=k*Math.cos(q);p.y=k*Math.sin(q);this.vertices.push(p);h.push(new THREE.Vector2((p.x/b+1)/2,
-(p.y/b+1)/2))}k+=n}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=q=g+e,n=q+c+1,p=q+c+2,this.faces.push(new THREE.Face3(f,n,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[n].clone(),h[p].clone()]),f=q,n=q+c+2,p=q+1,this.faces.push(new THREE.Face3(f,n,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[n].clone(),h[p].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,p=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var n=new Float32Array(g*h*2),q=0,m=0,s=0;s<h;s++)for(var t=s*p-f,r=0;r<g;r++)b[q]=r*k-e,b[q+1]=-t,a[q+2]=1,n[m]=r/c,n[m+1]=1-s/d,q+=3,m+=2;q=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[q]=r+g*s,e[q+1]=f,e[q+2]=k,e[q+3]=f,e[q+4]=h,e[q+5]=k,q+=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,p=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var n=new THREE.Vector3,q=e+g/c*f;n.x=k*Math.cos(q);n.y=k*Math.sin(q);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,
+(n.y/b+1)/2))}k+=p}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=q=g+e,p=q+c+1,n=q+c+2,this.faces.push(new THREE.Face3(f,p,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[p].clone(),h[n].clone()]),f=q,p=q+c+2,n=q+1,this.faces.push(new THREE.Face3(f,p,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[p].clone(),h[n].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,n=[],p=[];for(k=0;k<=c;k++){var q=[],m=[];for(h=0;h<=b;h++){var t=h/b,s=k/c,r=new THREE.Vector3;r.x=-a*Math.cos(d+t*e)*Math.sin(f+s*g);
-r.y=a*Math.cos(f+s*g);r.z=a*Math.sin(d+t*e)*Math.sin(f+s*g);this.vertices.push(r);q.push(this.vertices.length-1);m.push(new THREE.Vector2(t,1-s))}n.push(q);p.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=n[k][h+1];e=n[k][h];f=n[k+1][h];g=n[k+1][h+1];var q=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),t=this.vertices[f].clone().normalize(),s=this.vertices[g].clone().normalize(),r=p[k][h+1].clone(),u=p[k][h].clone(),v=p[k+1][h].clone(),y=p[k+1][h+1].clone();Math.abs(this.vertices[d].y)===
-a?(r.x=(r.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[q,t,s])),this.faceVertexUvs[0].push([r,v,y])):Math.abs(this.vertices[f].y)===a?(v.x=(v.x+y.x)/2,this.faces.push(new THREE.Face3(d,e,f,[q,m,t])),this.faceVertexUvs[0].push([r,u,v])):(this.faces.push(new THREE.Face3(d,e,g,[q,m,s])),this.faceVertexUvs[0].push([r,u,y]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),t,s.clone()])),this.faceVertexUvs[0].push([u.clone(),v,y.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,p=[],n=[];for(k=0;k<=c;k++){var q=[],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);q.push(this.vertices.length-1);m.push(new THREE.Vector2(s,1-t))}p.push(q);n.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=p[k][h+1];e=p[k][h];f=p[k+1][h];g=p[k+1][h+1];var q=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),s=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),r=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?(r.x=(r.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[q,s,t])),this.faceVertexUvs[0].push([r,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,[q,m,s])),this.faceVertexUvs[0].push([r,u,v])):(this.faces.push(new THREE.Face3(d,e,g,[q,m,t])),this.faceVertexUvs[0].push([r,u,x]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),s,t.clone()])),this.faceVertexUvs[0].push([u.clone(),v,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 n=0;n<=d;n++){var p=n/d*e,q=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(q))*Math.cos(p);m.y=(a+b*Math.cos(q))*Math.sin(p);m.z=b*Math.sin(q);this.vertices.push(m);g.push(new THREE.Vector2(n/
-d,k/c));h.push(m.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(n=1;n<=d;n++)a=(d+1)*k+n-1,b=(d+1)*(k-1)+n-1,e=(d+1)*(k-1)+n,f=(d+1)*k+n,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=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 p=0;p<=d;p++){var n=p/d*e,q=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(q))*Math.cos(n);m.y=(a+b*Math.cos(q))*Math.sin(n);m.z=b*Math.sin(q);this.vertices.push(m);g.push(new THREE.Vector2(p/
+d,k/c));h.push(m.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(p=1;p<=d;p++)a=(d+1)*k+p-1,b=(d+1)*(k-1)+p-1,e=(d+1)*(k-1)+p,f=(d+1)*k+p,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.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),n=new THREE.Vector3,p=new THREE.Vector3,q=new THREE.Vector3,m=0;m<c;++m){k[m]=
-Array(d);var t=m/c*2*e*Math.PI,s=h(t,f,e,a,g),t=h(t+.01,f,e,a,g);n.subVectors(t,s);p.addVectors(t,s);q.crossVectors(n,p);p.crossVectors(q,n);q.normalize();p.normalize();for(t=0;t<d;++t){var r=t/d*2*Math.PI,u=-b*Math.cos(r),r=b*Math.sin(r),v=new THREE.Vector3;v.x=s.x+u*p.x+r*q.x;v.y=s.y+u*p.y+r*q.y;v.z=s.z+u*p.z+r*q.z;k[m][t]=this.vertices.push(v)-1}}for(m=0;m<c;++m)for(t=0;t<d;++t)e=(m+1)%c,f=(t+1)%d,a=k[m][t],b=k[e][t],e=k[e][f],f=k[m][f],g=new THREE.Vector2(m/c,t/d),n=new THREE.Vector2((m+1)/c,
-t/d),p=new THREE.Vector2((m+1)/c,(t+1)/d),q=new THREE.Vector2(m/c,(t+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,n,q]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([n.clone(),p,q.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,n=b+1,p,q,m,t,s,r=new THREE.Vector3,u,v,y;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);v=u.normals;y=u.binormals;this.tangents=u.tangents;this.normals=v;this.binormals=y;for(u=0;u<n;u++)for(g[u]=[],p=u/(n-1),s=a.getPointAt(p),h=v[u],k=y[u],m=c*f(p),p=0;p<d;p++)q=
-p/d*2*Math.PI,t=-m*Math.cos(q),q=m*Math.sin(q),r.copy(s),r.x+=t*h.x+q*k.x,r.y+=t*h.y+q*k.y,r.z+=t*h.z+q*k.z,g[u][p]=this.vertices.push(new THREE.Vector3(r.x,r.y,r.z))-1;for(u=0;u<b;u++)for(p=0;p<d;p++)f=e?(u+1)%b:u+1,n=(p+1)%d,a=g[u][p],c=g[f][p],f=g[f][n],n=g[u][n],r=new THREE.Vector2(u/b,p/d),v=new THREE.Vector2((u+1)/b,p/d),y=new THREE.Vector2((u+1)/b,(p+1)/d),h=new THREE.Vector2(u/b,(p+1)/d),this.faces.push(new THREE.Face3(a,c,n)),this.faceVertexUvs[0].push([r,v,h]),this.faces.push(new THREE.Face3(c,
-f,n)),this.faceVertexUvs[0].push([v.clone(),y,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){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var n,p,q;this.tangents=e;this.normals=f;this.binormals=g;for(n=0;n<b;n++)p=n/(b-1),e[n]=a.getTangentAt(p),e[n].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;n=Math.abs(e[0].x);p=Math.abs(e[0].y);q=Math.abs(e[0].z);n<=a&&(a=n,d.set(1,0,0));p<=a&&(a=p,d.set(0,1,0));q<=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(n=1;n<b;n++)f[n]=f[n-1].clone(),g[n]=g[n-1].clone(),h.crossVectors(e[n-1],e[n]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[n-1].dot(e[n]),-1,1)),f[n].applyMatrix4(k.makeRotationAxis(h,d))),g[n].crossVectors(e[n],f[n]);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),n=1;n<b;n++)f[n].applyMatrix4(k.makeRotationAxis(e[n],d*n)),g[n].crossVectors(e[n],
-f[n])};
+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),p=new THREE.Vector3,n=new THREE.Vector3,q=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);p.subVectors(s,t);n.addVectors(s,t);q.crossVectors(p,n);n.crossVectors(q,p);q.normalize();n.normalize();for(s=0;s<d;++s){var r=s/d*2*Math.PI,u=-b*Math.cos(r),r=b*Math.sin(r),v=new THREE.Vector3;v.x=t.x+u*n.x+r*q.x;v.y=t.y+u*n.y+r*q.y;v.z=t.z+u*n.z+r*q.z;k[m][s]=this.vertices.push(v)-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),p=new THREE.Vector2((m+1)/c,
+s/d),n=new THREE.Vector2((m+1)/c,(s+1)/d),q=new THREE.Vector2(m/c,(s+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,p,q]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([p.clone(),n,q.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,p=b+1,n,q,m,s,t,r=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<p;u++)for(g[u]=[],n=u/(p-1),t=a.getPointAt(n),h=v[u],k=x[u],m=c*f(n),n=0;n<d;n++)q=
+n/d*2*Math.PI,s=-m*Math.cos(q),q=m*Math.sin(q),r.copy(t),r.x+=s*h.x+q*k.x,r.y+=s*h.y+q*k.y,r.z+=s*h.z+q*k.z,g[u][n]=this.vertices.push(new THREE.Vector3(r.x,r.y,r.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)f=e?(u+1)%b:u+1,p=(n+1)%d,a=g[u][n],c=g[f][n],f=g[f][p],p=g[u][p],r=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,p)),this.faceVertexUvs[0].push([r,v,h]),this.faces.push(new THREE.Face3(c,
+f,p)),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){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var p,n,q;this.tangents=e;this.normals=f;this.binormals=g;for(p=0;p<b;p++)n=p/(b-1),e[p]=a.getTangentAt(n),e[p].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;p=Math.abs(e[0].x);n=Math.abs(e[0].y);q=Math.abs(e[0].z);p<=a&&(a=p,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));q<=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(p=1;p<b;p++)f[p]=f[p-1].clone(),g[p]=g[p-1].clone(),h.crossVectors(e[p-1],e[p]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[p-1].dot(e[p]),-1,1)),f[p].applyMatrix4(k.makeRotationAxis(h,d))),g[p].crossVectors(e[p],f[p]);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),p=1;p<b;p++)f[p].applyMatrix4(k.makeRotationAxis(e[p],d*p)),g[p].crossVectors(e[p],
+f[p])};
 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){var c=
-Math.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),m=[],n=0;n<=c;n++){m[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(g.clone().lerp(h,n/c)),s=c-n,r=0;r<=s;r++)m[n][r]=0==r&&n==c?p:e(p.clone().lerp(q,r/s))}for(n=0;n<c;n++)for(r=0;r<2*(c-n)-1;r++)d=Math.floor(r/2),0==r%2?f(m[n][d+1],m[n+1][d],m[n][d]):f(m[n][d+1],m[n+1][d+1],m[n+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,n=0,p=a.length;n<p;n+=3)e(new THREE.Vector3(a[n],a[n+1],a[n+2]));a=this.vertices;for(var q=[],m=n=0,p=b.length;n<p;n+=3,m++){var t=a[b[n]],s=a[b[n+1]],r=a[b[n+2]];q[m]=new THREE.Face3(t.index,s.index,r.index,[t.clone(),s.clone(),r.clone()])}for(var u=new THREE.Vector3,n=0,p=q.length;n<p;n++)g(q[n],d);n=0;for(p=this.faceVertexUvs[0].length;n<
-p;n++)b=this.faceVertexUvs[0][n],d=b[0].x,a=b[1].x,q=b[2].x,m=Math.max(d,Math.max(a,q)),t=Math.min(d,Math.min(a,q)),.9<m&&.1>t&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));n=0;for(p=this.vertices.length;n<p;n++)this.vertices[n].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;
+Math.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),m=[],n=0;n<=c;n++){m[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(g.clone().lerp(h,n/c)),r=c-n,s=0;s<=r;s++)m[n][s]=0==s&&n==c?p:e(p.clone().lerp(q,s/r))}for(n=0;n<c;n++)for(s=0;s<2*(c-n)-1;s++)d=Math.floor(s/2),0==s%2?f(m[n][d+1],m[n+1][d],m[n][d]):f(m[n][d+1],m[n+1][d+1],m[n+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,p=0,n=a.length;p<n;p+=3)e(new THREE.Vector3(a[p],a[p+1],a[p+2]));a=this.vertices;for(var q=[],m=p=0,n=b.length;p<n;p+=3,m++){var s=a[b[p]],t=a[b[p+1]],r=a[b[p+2]];q[m]=new THREE.Face3(s.index,t.index,r.index,[s.clone(),t.clone(),r.clone()])}for(var u=new THREE.Vector3,p=0,n=q.length;p<n;p++)g(q[p],d);p=0;for(n=this.faceVertexUvs[0].length;p<
+n;p++)b=this.faceVertexUvs[0][p],d=b[0].x,a=b[1].x,q=b[2].x,m=Math.max(d,Math.max(a,q)),s=Math.min(d,Math.min(a,q)),.9<m&&.1>s&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));p=0;for(n=this.vertices.length;p<n;p++)this.vertices[p].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,n,p=b+1;for(g=0;g<=c;g++)for(n=g/c,h=0;h<=b;h++)k=h/b,k=a(k,n),d.push(k);var q,m,t,s;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*p+h,d=g*p+h+1,n=(g+1)*p+h+1,k=(g+1)*p+h,q=new THREE.Vector2(h/b,g/c),m=new THREE.Vector2((h+1)/b,g/c),t=new THREE.Vector2((h+1)/b,(g+1)/c),s=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,
-d,k)),f.push([q,m,s]),e.push(new THREE.Face3(d,n,k)),f.push([m.clone(),t,s.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
+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,p,n=b+1;for(g=0;g<=c;g++)for(p=g/c,h=0;h<=b;h++)k=h/b,k=a(k,p),d.push(k);var q,m,s,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*n+h,d=g*n+h+1,p=(g+1)*n+h+1,k=(g+1)*n+h,q=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([q,m,t]),e.push(new THREE.Face3(d,p,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.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);
@@ -788,8 +788,8 @@ THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=
 c=new THREE.Geometry;c.vertices.push(new THREE.Vector3,new THREE.Vector3);d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(c,d);this.add(this.targetLine);this.update()};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper;
 THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};
 THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(c);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();
-THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var n=k.vertices,k=k.faces,p=0,q=0,m=k.length;q<m;q++)for(var t=k[q],s=0;3>s;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var r=d.toString();void 0===e[r]?(e[r]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},p++):e[r].face2=q}d=new Float32Array(6*p);f=0;for(r in e)if(g=e[r],void 0===g.face2||
-.9999>k[g.face1].normal.dot(k[g.face2].normal))p=n[g.vert1],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z,p=n[g.vert2],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3));THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper;
+THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var p=k.vertices,k=k.faces,n=0,q=0,m=k.length;q<m;q++)for(var s=k[q],t=0;3>t;t++){d[0]=s[g[t]];d[1]=s[g[(t+1)%3]];d.sort(f);var r=d.toString();void 0===e[r]?(e[r]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},n++):e[r].face2=q}d=new Float32Array(6*n);f=0;for(r in e)if(g=e[r],void 0===g.face2||
+.9999>k[g.face1].normal.dot(k[g.face2].normal))n=p[g.vert1],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z,n=p[g.vert2],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3));THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper;
 THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper;
 THREE.FaceNormalsHelper.prototype.update=function(){var a=this.geometry.vertices,b=this.object,c=b.geometry.vertices,d=b.geometry.faces,e=b.matrixWorld;b.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(e);for(var f=b=0,g=d.length;b<g;b++,f+=2){var h=d[b];a[f].copy(c[h.a]).add(c[h.b]).add(c[h.c]).divideScalar(3).applyMatrix4(e);a[f+1].copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a[f])}this.geometry.verticesNeedUpdate=!0;return this};
@@ -808,15 +808,15 @@ 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,n=f.length;k<n;k++)for(var p=f[k],q=0,m=p.vertexNormals.length;q<m;q++){var t=p.vertexNormals[q];d[h].copy(e[p[a[q]]]).applyMatrix4(g);b.copy(t).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,p=f.length;k<p;k++)for(var n=f[k],q=0,m=n.vertexNormals.length;q<m;q++){var s=n.vertexNormals[q];d[h].copy(e[n[a[q]]]).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,n=f.length;k<n;k++)for(var p=f[k],q=0,m=p.vertexTangents.length;q<m;q++){var t=p.vertexTangents[q];d[h].copy(e[p[a[q]]]).applyMatrix4(g);b.copy(t).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,p=f.length;k<p;k++)for(var n=f[k],q=0,m=n.vertexTangents.length;q<m;q++){var s=n.vertexTangents[q];d[h].copy(e[n[a[q]]]).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,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,n=a.geometry.faces,p=0,q=new Uint32Array(6*n.length),m=0,t=n.length;m<t;m++)for(var s=n[m],r=0;3>r;r++){d[0]=s[g[r]];d[1]=s[g[(r+1)%3]];d.sort(f);var u=d.toString();void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++)}d=new Float32Array(6*p);m=0;for(t=p;m<t;m++)for(r=0;2>r;r++)p=
-k[q[2*m+r]],g=6*m+3*r,d[g+0]=p.x,d[g+1]=p.y,d[g+2]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){k=a.geometry.attributes.position.array;t=a.geometry.attributes.index.array;n=a.geometry.drawcalls;p=0;0===n.length&&(n=[{count:t.length,index:0,start:0}]);for(var q=new Uint32Array(2*t.length),s=0,v=n.length;s<v;++s)for(var r=n[s].start,u=n[s].count,g=n[s].index,m=r,y=r+u;m<y;m+=3)for(r=0;3>r;r++)d[0]=
-g+t[m+r],d[1]=g+t[m+(r+1)%3],d.sort(f),u=d.toString(),void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++);d=new Float32Array(6*p);m=0;for(t=p;m<t;m++)for(r=0;2>r;r++)g=6*m+3*r,p=3*q[2*m+r],d[g+0]=k[p],d[g+1]=k[p+1],d[g+2]=k[p+2]}else for(k=a.geometry.attributes.position.array,p=k.length/3,q=p/3,d=new Float32Array(6*p),m=0,t=q;m<t;m++)for(r=0;3>r;r++)g=18*m+6*r,q=9*m+3*r,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],p=9*m+(r+1)%3*3,d[g+3]=k[p],d[g+4]=k[p+1],d[g+5]=k[p+2];h.addAttribute("position",new THREE.BufferAttribute(d,
+THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,p=a.geometry.faces,n=0,q=new Uint32Array(6*p.length),m=0,s=p.length;m<s;m++)for(var t=p[m],r=0;3>r;r++){d[0]=t[g[r]];d[1]=t[g[(r+1)%3]];d.sort(f);var u=d.toString();void 0===e[u]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[u]=!0,n++)}d=new Float32Array(6*n);m=0;for(s=n;m<s;m++)for(r=0;2>r;r++)n=
+k[q[2*m+r]],g=6*m+3*r,d[g+0]=n.x,d[g+1]=n.y,d[g+2]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){k=a.geometry.attributes.position.array;s=a.geometry.attributes.index.array;p=a.geometry.drawcalls;n=0;0===p.length&&(p=[{count:s.length,index:0,start:0}]);for(var q=new Uint32Array(2*s.length),t=0,v=p.length;t<v;++t)for(var r=p[t].start,u=p[t].count,g=p[t].index,m=r,x=r+u;m<x;m+=3)for(r=0;3>r;r++)d[0]=
+g+s[m+r],d[1]=g+s[m+(r+1)%3],d.sort(f),u=d.toString(),void 0===e[u]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[u]=!0,n++);d=new Float32Array(6*n);m=0;for(s=n;m<s;m++)for(r=0;2>r;r++)g=6*m+3*r,n=3*q[2*m+r],d[g+0]=k[n],d[g+1]=k[n+1],d[g+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,q=n/3,d=new Float32Array(6*n),m=0,s=q;m<s;m++)for(r=0;3>r;r++)g=18*m+6*r,q=9*m+3*r,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],n=9*m+(r+1)%3*3,d[g+3]=k[n],d[g+4]=k[n+1],d[g+5]=k[n+2];h.addAttribute("position",new THREE.BufferAttribute(d,
 3))}THREE.Line.call(this,h,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)};