Pārlūkot izejas kodu

Switched to hashmap implementation for mergeVertices()

zz85 14 gadi atpakaļ
vecāks
revīzija
cdd5a20de2
3 mainītis faili ar 368 papildinājumiem un 440 dzēšanām
  1. 342 343
      build/Three.js
  2. 9 5
      examples/canvas_geometry_subdivison.html
  3. 17 92
      src/core/Geometry.js

+ 342 - 343
build/Three.js

@@ -1,7 +1,7 @@
 // Three.js r45dev - http://github.com/mrdoob/three.js
 var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this};
-THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var f,h,k;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),h=b*6-f,b=e*(1-c),k=e*(1-c*h),c=e*(1-c*(1-h)),f){case 1:this.r=k;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=k;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=
-e;this.g=b;this.b=k;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
+THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var f,m,h;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),m=b*6-f,b=e*(1-c),h=e*(1-c*m),c=e*(1-c*(1-m)),f){case 1:this.r=h;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=h;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=
+e;this.g=b;this.b=h;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
 THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0};
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this},
 divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var c=this.x-b.x,b=this.y-b.y;return c*c+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)},
@@ -15,85 +15,84 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,c,e,f){this.x=
 c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;this.w-=b.w;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;this.w*=b;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b,this.w/=b):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z+this.w*b.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
 normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3};
 THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,f=[];c=0;for(e=b.length;c<e;c++)Array.prototype.push.apply(f,this.intersectObject(b[c]));f.sort(function(b,e){return b.distance-e.distance});return f},intersectObject:function(b){function c(b,e,c){var f;f=c.clone().subSelf(b).dot(e);if(f<=0)return null;b=b.clone().addSelf(e.clone().multiplyScalar(f));return c.distanceTo(b)}function e(b,e,c,f){var f=f.clone().subSelf(e),
-c=c.clone().subSelf(e),h=b.clone().subSelf(e),b=f.dot(f),e=f.dot(c),f=f.dot(h),k=c.dot(c),c=c.dot(h),h=1/(b*k-e*e),k=(k*f-e*c)*h,b=(b*c-e*f)*h;return k>0&&b>0&&k+b<1}if(b instanceof THREE.Particle){var f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.scale.x)return[];return[{distance:f,point:b.position,face:null,object:b}]}else if(b instanceof THREE.Mesh){f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.geometry.boundingSphere.radius*Math.max(b.scale.x,
-Math.max(b.scale.y,b.scale.z)))return[];var h,k,m,n,u,p,w,t,x,v,z=b.geometry,y=z.vertices,B=[],f=0;for(h=z.faces.length;f<h;f++)if(k=z.faces[f],x=this.origin.clone(),v=this.direction.clone(),p=b.matrixWorld,m=p.multiplyVector3(k.centroid.clone()).subSelf(x),t=m.dot(v),!(t<=0)&&(m=p.multiplyVector3(y[k.a].position.clone()),n=p.multiplyVector3(y[k.b].position.clone()),u=p.multiplyVector3(y[k.c].position.clone()),p=k instanceof THREE.Face4?p.multiplyVector3(y[k.d].position.clone()):null,w=b.matrixRotationWorld.multiplyVector3(k.normal.clone()),
-t=v.dot(w),b.doubleSided||(b.flipSided?t>0:t<0)))if(t=w.dot((new THREE.Vector3).sub(m,x))/t,x=x.addSelf(v.multiplyScalar(t)),k instanceof THREE.Face3)e(x,m,n,u)&&(k={distance:this.origin.distanceTo(x),point:x,face:k,object:b},B.push(k));else if(k instanceof THREE.Face4&&(e(x,m,n,p)||e(x,n,u,p)))k={distance:this.origin.distanceTo(x),point:x,face:k,object:b},B.push(k);B.sort(function(b,e){return b.distance-e.distance});return B}else return[]}};
-THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,t){n=!1;c=k;e=m;f=w;h=t;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=c<k?c:k,e=e<m?e:m,f=f>k?f:k,h=h>m?h:m);b()};this.add3Points=
-function(k,m,w,t,x,v){n?(n=!1,c=k<w?k<x?k:x:w<x?w:x,e=m<t?m<v?m:v:t<v?t:v,f=k>w?k>x?k:x:w>x?w:x,h=m>t?m>v?m:v:t>v?t:v):(c=k<w?k<x?k<c?k:c:x<c?x:c:w<x?w<c?w:c:x<c?x:c,e=m<t?m<v?m<e?m:e:v<e?v:e:t<v?t<e?t:e:v<e?v:e,f=k>w?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>t?m>v?m>h?m:h:v>h?v:h:t>v?t>h?t:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=c<k.getLeft()?c:k.getLeft(),e=e<k.getTop()?e:k.getTop(),f=f>k.getRight()?f:k.getRight(),h=h>
-k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f<k.getRight()?f:k.getRight();h=h<k.getBottom()?h:k.getBottom();b()};this.intersects=function(b){return Math.min(f,b.getRight())-Math.max(c,b.getLeft())>=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}};THREE.Matrix3=function(){this.m=[]};
+c=c.clone().subSelf(e),m=b.clone().subSelf(e),b=f.dot(f),e=f.dot(c),f=f.dot(m),h=c.dot(c),c=c.dot(m),m=1/(b*h-e*e),h=(h*f-e*c)*m,b=(b*c-e*f)*m;return h>0&&b>0&&h+b<1}if(b instanceof THREE.Particle){var f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.scale.x)return[];return[{distance:f,point:b.position,face:null,object:b}]}else if(b instanceof THREE.Mesh){f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.geometry.boundingSphere.radius*Math.max(b.scale.x,
+Math.max(b.scale.y,b.scale.z)))return[];var m,h,k,n,p,u,w,t,x,v,z=b.geometry,y=z.vertices,B=[],f=0;for(m=z.faces.length;f<m;f++)if(h=z.faces[f],x=this.origin.clone(),v=this.direction.clone(),u=b.matrixWorld,k=u.multiplyVector3(h.centroid.clone()).subSelf(x),t=k.dot(v),!(t<=0)&&(k=u.multiplyVector3(y[h.a].position.clone()),n=u.multiplyVector3(y[h.b].position.clone()),p=u.multiplyVector3(y[h.c].position.clone()),u=h instanceof THREE.Face4?u.multiplyVector3(y[h.d].position.clone()):null,w=b.matrixRotationWorld.multiplyVector3(h.normal.clone()),
+t=v.dot(w),b.doubleSided||(b.flipSided?t>0:t<0)))if(t=w.dot((new THREE.Vector3).sub(k,x))/t,x=x.addSelf(v.multiplyScalar(t)),h instanceof THREE.Face3)e(x,k,n,p)&&(h={distance:this.origin.distanceTo(x),point:x,face:h,object:b},B.push(h));else if(h instanceof THREE.Face4&&(e(x,k,n,u)||e(x,n,p,u)))h={distance:this.origin.distanceTo(x),point:x,face:h,object:b},B.push(h);B.sort(function(b,e){return b.distance-e.distance});return B}else return[]}};
+THREE.Rectangle=function(){function b(){h=f-c;k=m-e}var c,e,f,m,h,k,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return h};this.getHeight=function(){return k};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return m};this.set=function(h,k,w,t){n=!1;c=h;e=k;f=w;m=t;b()};this.addPoint=function(h,k){n?(n=!1,c=h,e=k,f=h,m=k):(c=c<h?c:h,e=e<k?e:k,f=f>h?f:h,m=m>k?m:k);b()};this.add3Points=
+function(h,k,w,t,x,v){n?(n=!1,c=h<w?h<x?h:x:w<x?w:x,e=k<t?k<v?k:v:t<v?t:v,f=h>w?h>x?h:x:w>x?w:x,m=k>t?k>v?k:v:t>v?t:v):(c=h<w?h<x?h<c?h:c:x<c?x:c:w<x?w<c?w:c:x<c?x:c,e=k<t?k<v?k<e?k:e:v<e?v:e:t<v?t<e?t:e:v<e?v:e,f=h>w?h>x?h>f?h:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,m=k>t?k>v?k>m?k:m:v>m?v:m:t>v?t>m?t:m:v>m?v:m);b()};this.addRectangle=function(h){n?(n=!1,c=h.getLeft(),e=h.getTop(),f=h.getRight(),m=h.getBottom()):(c=c<h.getLeft()?c:h.getLeft(),e=e<h.getTop()?e:h.getTop(),f=f>h.getRight()?f:h.getRight(),m=m>
+h.getBottom()?m:h.getBottom());b()};this.inflate=function(h){c-=h;e-=h;f+=h;m+=h;b()};this.minSelf=function(h){c=c>h.getLeft()?c:h.getLeft();e=e>h.getTop()?e:h.getTop();f=f<h.getRight()?f:h.getRight();m=m<h.getBottom()?m:h.getBottom();b()};this.intersects=function(b){return Math.min(f,b.getRight())-Math.max(c,b.getLeft())>=0&&Math.min(m,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;m=f=e=c=0;b()};this.isEmpty=function(){return n}};THREE.Matrix3=function(){this.m=[]};
 THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}};
-THREE.Matrix4=function(b,c,e,f,h,k,m,n,u,p,w,t,x,v,z,y){this.set(b!==void 0?b:1,c||0,e||0,f||0,h||0,k!==void 0?k:1,m||0,n||0,u||0,p||0,w!==void 0?w:1,t||0,x||0,v||0,z||0,y!==void 0?y:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,h,k,m,n,u,p,w,t,x,v,z,y){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=h;this.n22=k;this.n23=m;this.n24=n;this.n31=u;this.n32=p;this.n33=w;this.n34=t;this.n41=x;this.n42=v;this.n43=z;this.n44=y;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(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b,
-c,e){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,k=THREE.Matrix4.__v3;k.sub(b,c).normalize();if(k.length()===0)k.z=1;f.cross(e,k).normalize();f.length()===0&&(k.x+=1.0E-4,f.cross(e,k).normalize());h.cross(k,f).normalize();this.n11=f.x;this.n12=h.x;this.n13=k.x;this.n21=f.y;this.n22=h.y;this.n23=k.y;this.n31=f.z;this.n32=h.z;this.n33=k.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,f=b.z,h=1/(this.n41*c+this.n42*e+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*e+this.n13*f+this.n14)*h;
-b.y=(this.n21*c+this.n22*e+this.n23*f+this.n24)*h;b.z=(this.n31*c+this.n32*e+this.n33*f+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,e=b.y,f=b.z,h=b.w;b.x=this.n11*c+this.n12*e+this.n13*f+this.n14*h;b.y=this.n21*c+this.n22*e+this.n23*f+this.n24*h;b.z=this.n31*c+this.n32*e+this.n33*f+this.n34*h;b.w=this.n41*c+this.n42*e+this.n43*f+this.n44*h;return b},rotateAxis:function(b){var c=b.x,e=b.y,f=b.z;b.x=c*this.n11+e*this.n12+f*this.n13;b.y=c*this.n21+e*this.n22+f*this.n23;b.z=c*this.n31+
-e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,u=b.n23,p=b.n24,w=b.n31,t=b.n32,x=b.n33,v=b.n34,z=b.n41,y=b.n42,B=b.n43,C=b.n44,E=c.n11,F=c.n12,
-G=c.n13,M=c.n14,P=c.n21,L=c.n22,A=c.n23,J=c.n24,Z=c.n31,I=c.n32,O=c.n33,X=c.n34,V=c.n41,W=c.n42,o=c.n43,ea=c.n44;this.n11=e*E+f*P+h*Z+k*V;this.n12=e*F+f*L+h*I+k*W;this.n13=e*G+f*A+h*O+k*o;this.n14=e*M+f*J+h*X+k*ea;this.n21=m*E+n*P+u*Z+p*V;this.n22=m*F+n*L+u*I+p*W;this.n23=m*G+n*A+u*O+p*o;this.n24=m*M+n*J+u*X+p*ea;this.n31=w*E+t*P+x*Z+v*V;this.n32=w*F+t*L+x*I+v*W;this.n33=w*G+t*A+x*O+v*o;this.n34=w*M+t*J+x*X+v*ea;this.n41=z*E+y*P+B*Z+C*V;this.n42=z*F+y*L+B*I+C*W;this.n43=z*G+y*A+B*O+C*o;this.n44=z*
+THREE.Matrix4=function(b,c,e,f,m,h,k,n,p,u,w,t,x,v,z,y){this.set(b!==void 0?b:1,c||0,e||0,f||0,m||0,h!==void 0?h:1,k||0,n||0,p||0,u||0,w!==void 0?w:1,t||0,x||0,v||0,z||0,y!==void 0?y:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,m,h,k,n,p,u,w,t,x,v,z,y){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=m;this.n22=h;this.n23=k;this.n24=n;this.n31=p;this.n32=u;this.n33=w;this.n34=t;this.n41=x;this.n42=v;this.n43=z;this.n44=y;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(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b,
+c,e){var f=THREE.Matrix4.__v1,m=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;h.sub(b,c).normalize();if(h.length()===0)h.z=1;f.cross(e,h).normalize();f.length()===0&&(h.x+=1.0E-4,f.cross(e,h).normalize());m.cross(h,f).normalize();this.n11=f.x;this.n12=m.x;this.n13=h.x;this.n21=f.y;this.n22=m.y;this.n23=h.y;this.n31=f.z;this.n32=m.z;this.n33=h.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,f=b.z,m=1/(this.n41*c+this.n42*e+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*e+this.n13*f+this.n14)*m;
+b.y=(this.n21*c+this.n22*e+this.n23*f+this.n24)*m;b.z=(this.n31*c+this.n32*e+this.n33*f+this.n34)*m;return b},multiplyVector4:function(b){var c=b.x,e=b.y,f=b.z,m=b.w;b.x=this.n11*c+this.n12*e+this.n13*f+this.n14*m;b.y=this.n21*c+this.n22*e+this.n23*f+this.n24*m;b.z=this.n31*c+this.n32*e+this.n33*f+this.n34*m;b.w=this.n41*c+this.n42*e+this.n43*f+this.n44*m;return b},rotateAxis:function(b){var c=b.x,e=b.y,f=b.z;b.x=c*this.n11+e*this.n12+f*this.n13;b.y=c*this.n21+e*this.n22+f*this.n23;b.z=c*this.n31+
+e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,m=b.n13,h=b.n14,k=b.n21,n=b.n22,p=b.n23,u=b.n24,w=b.n31,t=b.n32,x=b.n33,v=b.n34,z=b.n41,y=b.n42,B=b.n43,C=b.n44,E=c.n11,F=c.n12,
+G=c.n13,M=c.n14,P=c.n21,L=c.n22,A=c.n23,J=c.n24,Z=c.n31,I=c.n32,O=c.n33,X=c.n34,V=c.n41,W=c.n42,o=c.n43,ea=c.n44;this.n11=e*E+f*P+m*Z+h*V;this.n12=e*F+f*L+m*I+h*W;this.n13=e*G+f*A+m*O+h*o;this.n14=e*M+f*J+m*X+h*ea;this.n21=k*E+n*P+p*Z+u*V;this.n22=k*F+n*L+p*I+u*W;this.n23=k*G+n*A+p*O+u*o;this.n24=k*M+n*J+p*X+u*ea;this.n31=w*E+t*P+x*Z+v*V;this.n32=w*F+t*L+x*I+v*W;this.n33=w*G+t*A+x*O+v*o;this.n34=w*M+t*J+x*X+v*ea;this.n41=z*E+y*P+B*Z+C*V;this.n42=z*F+y*L+B*I+C*W;this.n43=z*G+y*A+B*O+C*o;this.n44=z*
 M+y*J+B*X+C*ea;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=
-b;this.n31*=b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,h=this.n21,k=this.n22,m=this.n23,n=this.n24,u=this.n31,p=this.n32,w=this.n33,t=this.n34,x=this.n41,v=this.n42,z=this.n43,y=this.n44;return f*m*p*x-e*n*p*x-f*k*w*x+c*n*w*x+e*k*t*x-c*m*t*x-f*m*u*v+e*n*u*v+f*h*w*v-b*n*w*v-e*h*t*v+b*m*t*v+f*k*u*z-c*n*u*z-f*h*p*z+b*n*p*z+c*h*t*z-b*k*t*z-e*k*u*y+c*m*u*y+e*h*p*y-b*m*p*y-c*h*
-w*y+b*k*w*y},transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32;b.n33=this.n33;b.n34=
+b;this.n31*=b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,m=this.n21,h=this.n22,k=this.n23,n=this.n24,p=this.n31,u=this.n32,w=this.n33,t=this.n34,x=this.n41,v=this.n42,z=this.n43,y=this.n44;return f*k*u*x-e*n*u*x-f*h*w*x+c*n*w*x+e*h*t*x-c*k*t*x-f*k*p*v+e*n*p*v+f*m*w*v-b*n*w*v-e*m*t*v+b*k*t*v+f*h*p*z-c*n*p*z-f*m*u*z+b*n*u*z+c*m*t*z-b*h*t*z-e*h*p*y+c*k*p*y+e*m*u*y-b*k*u*y-c*m*
+w*y+b*h*w*y},transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32;b.n33=this.n33;b.n34=
 this.n34;b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]=
 this.n11;b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=
 this.n34;b[c+15]=this.n44;return b},setTranslation:function(b,c,e){this.set(1,0,0,b,0,1,0,c,0,0,1,e,0,0,0,1);return this},setScale:function(b,c,e){this.set(b,0,0,0,0,c,0,0,0,0,e,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,-b,0,
-0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),f=Math.sin(c),h=1-e,k=b.x,m=b.y,n=b.z,u=h*k,p=h*m;this.set(u*k+e,u*m-f*n,u*n+f*m,0,u*m+f*n,p*m+e,p*n-f*k,0,u*n-f*m,p*n+f*k,h*n*n+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
-new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,f=b.y,h=b.z,k=Math.cos(e),e=Math.sin(e),m=Math.cos(f),f=Math.sin(f),n=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var u=
-m*n,p=m*h,w=f*n,t=f*h;this.n11=u+t*e;this.n12=w*e-p;this.n13=k*f;this.n21=k*h;this.n22=k*n;this.n23=-e;this.n31=p*e-w;this.n32=t+u*e;this.n33=k*m;break;case "ZXY":u=m*n;p=m*h;w=f*n;t=f*h;this.n11=u-t*e;this.n12=-k*h;this.n13=w+p*e;this.n21=p+w*e;this.n22=k*n;this.n23=t-u*e;this.n31=-k*f;this.n32=e;this.n33=k*m;break;case "ZYX":u=k*n;p=k*h;w=e*n;t=e*h;this.n11=m*n;this.n12=w*f-p;this.n13=u*f+t;this.n21=m*h;this.n22=t*f+u;this.n23=p*f-w;this.n31=-f;this.n32=e*m;this.n33=k*m;break;case "YZX":u=k*m;p=
-k*f;w=e*m;t=e*f;this.n11=m*n;this.n12=t-u*h;this.n13=w*h+p;this.n21=h;this.n22=k*n;this.n23=-e*n;this.n31=-f*n;this.n32=p*h+w;this.n33=u-t*h;break;case "XZY":u=k*m;p=k*f;w=e*m;t=e*f;this.n11=m*n;this.n12=-h;this.n13=f*n;this.n21=u*h+t;this.n22=k*n;this.n23=p*h-w;this.n31=w*h-p;this.n32=e*n;this.n33=t*h+u;break;default:u=k*n,p=k*h,w=e*n,t=e*h,this.n11=m*n,this.n12=-m*h,this.n13=f,this.n21=p+w*f,this.n22=u-t*f,this.n23=-e*m,this.n31=t-u*f,this.n32=w+p*f,this.n33=k*m}return this},setRotationFromQuaternion:function(b){var c=
-b.x,e=b.y,f=b.z,h=b.w,k=c+c,m=e+e,n=f+f,b=c*k,u=c*m;c*=n;var p=e*m;e*=n;f*=n;k*=h;m*=h;h*=n;this.n11=1-(p+f);this.n12=u-h;this.n13=c+m;this.n21=u+h;this.n22=1-(b+f);this.n23=e-k;this.n31=c-m;this.n32=e+k;this.n33=1-(b+p);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var f=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2;
-f.identity();f.setRotationFromQuaternion(c);h.setScale(e.x,e.y,e.z);this.multiply(f,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,k=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);k.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;e=e instanceof THREE.Vector3?e:new THREE.Vector3;e.x=f.length();
-e.y=h.length();e.z=k.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=e.x;f.n21/=e.x;f.n31/=e.x;f.n12/=e.y;f.n22/=e.y;f.n32/=e.y;f.n13/=e.z;f.n23/=e.z;f.n33/=e.z;c.setFromRotationMatrix(f);return[b,c,e]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var e=1/c.x,f=1/c.y,h=1/c.z;this.n11=b.n11*e;this.n21=b.n21*e;this.n31=b.n31*e;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*h;this.n23=
-b.n23*h;this.n33=b.n33*h}};
-THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,u=b.n23,p=b.n24,w=b.n31,t=b.n32,x=b.n33,v=b.n34,z=b.n41,y=b.n42,B=b.n43,C=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=u*v*y-p*x*y+p*t*B-n*v*B-u*t*C+n*x*C;c.n12=k*x*y-h*v*y-k*t*B+f*v*B+h*t*C-f*x*C;c.n13=h*p*y-k*u*y+k*n*B-f*p*B-h*n*C+f*u*C;c.n14=k*u*t-h*p*t-k*n*x+f*p*x+h*n*v-f*u*v;c.n21=p*x*z-u*v*z-p*w*B+m*v*B+u*w*C-m*x*C;c.n22=h*v*z-k*x*z+k*w*B-e*v*B-h*w*C+e*x*C;c.n23=k*u*z-h*p*z-k*m*B+e*p*B+h*m*C-e*u*C;c.n24=
-h*p*w-k*u*w+k*m*x-e*p*x-h*m*v+e*u*v;c.n31=n*v*z-p*t*z+p*w*y-m*v*y-n*w*C+m*t*C;c.n32=k*t*z-f*v*z-k*w*y+e*v*y+f*w*C-e*t*C;c.n33=h*p*z-k*n*z+k*m*y-e*p*y-f*m*C+e*n*C;c.n34=k*n*w-f*p*w-k*m*t+e*p*t+f*m*v-e*n*v;c.n41=u*t*z-n*x*z-u*w*y+m*x*y+n*w*B-m*t*B;c.n42=f*x*z-h*t*z+h*w*y-e*x*y-f*w*B+e*t*B;c.n43=h*n*z-f*u*z-h*m*y+e*u*y+f*m*B-e*n*B;c.n44=f*u*w-h*n*w+h*m*t-e*u*t-f*m*x+e*n*x;c.multiplyScalar(1/b.determinant());return c};
-THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,f=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,k=b.n32*b.n21-b.n31*b.n22,m=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,u=-b.n32*b.n11+b.n31*b.n12,p=b.n23*b.n12-b.n22*b.n13,w=-b.n23*b.n11+b.n21*b.n13,t=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*m+b.n31*p;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*h;e[2]=b*k;e[3]=b*m;e[4]=b*n;e[5]=b*u;e[6]=b*p;e[7]=b*w;e[8]=b*t;return c};
-THREE.Matrix4.makeFrustum=function(b,c,e,f,h,k){var m;m=new THREE.Matrix4;m.n11=2*h/(c-b);m.n12=0;m.n13=(c+b)/(c-b);m.n14=0;m.n21=0;m.n22=2*h/(f-e);m.n23=(f+e)/(f-e);m.n24=0;m.n31=0;m.n32=0;m.n33=-(k+h)/(k-h);m.n34=-2*k*h/(k-h);m.n41=0;m.n42=0;m.n43=-1;m.n44=0;return m};THREE.Matrix4.makePerspective=function(b,c,e,f){var h,b=e*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,e,f)};
-THREE.Matrix4.makeOrtho=function(b,c,e,f,h,k){var m,n,u,p;m=new THREE.Matrix4;n=c-b;u=e-f;p=k-h;m.n11=2/n;m.n12=0;m.n13=0;m.n14=-((c+b)/n);m.n21=0;m.n22=2/u;m.n23=0;m.n24=-((e+f)/u);m.n31=0;m.n32=0;m.n33=-2/p;m.n34=-((k+h)/p);m.n41=0;m.n42=0;m.n43=0;m.n44=1;return m};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
+0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),f=Math.sin(c),m=1-e,h=b.x,k=b.y,n=b.z,p=m*h,u=m*k;this.set(p*h+e,p*k-f*n,p*n+f*k,0,p*k+f*n,u*k+e,u*n-f*h,0,p*n-f*k,u*n+f*h,m*n*n+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
+new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,f=b.y,m=b.z,h=Math.cos(e),e=Math.sin(e),k=Math.cos(f),f=Math.sin(f),n=Math.cos(m),m=Math.sin(m);switch(c){case "YXZ":var p=
+k*n,u=k*m,w=f*n,t=f*m;this.n11=p+t*e;this.n12=w*e-u;this.n13=h*f;this.n21=h*m;this.n22=h*n;this.n23=-e;this.n31=u*e-w;this.n32=t+p*e;this.n33=h*k;break;case "ZXY":p=k*n;u=k*m;w=f*n;t=f*m;this.n11=p-t*e;this.n12=-h*m;this.n13=w+u*e;this.n21=u+w*e;this.n22=h*n;this.n23=t-p*e;this.n31=-h*f;this.n32=e;this.n33=h*k;break;case "ZYX":p=h*n;u=h*m;w=e*n;t=e*m;this.n11=k*n;this.n12=w*f-u;this.n13=p*f+t;this.n21=k*m;this.n22=t*f+p;this.n23=u*f-w;this.n31=-f;this.n32=e*k;this.n33=h*k;break;case "YZX":p=h*k;u=
+h*f;w=e*k;t=e*f;this.n11=k*n;this.n12=t-p*m;this.n13=w*m+u;this.n21=m;this.n22=h*n;this.n23=-e*n;this.n31=-f*n;this.n32=u*m+w;this.n33=p-t*m;break;case "XZY":p=h*k;u=h*f;w=e*k;t=e*f;this.n11=k*n;this.n12=-m;this.n13=f*n;this.n21=p*m+t;this.n22=h*n;this.n23=u*m-w;this.n31=w*m-u;this.n32=e*n;this.n33=t*m+p;break;default:p=h*n,u=h*m,w=e*n,t=e*m,this.n11=k*n,this.n12=-k*m,this.n13=f,this.n21=u+w*f,this.n22=p-t*f,this.n23=-e*k,this.n31=t-p*f,this.n32=w+u*f,this.n33=h*k}return this},setRotationFromQuaternion:function(b){var c=
+b.x,e=b.y,f=b.z,m=b.w,h=c+c,k=e+e,n=f+f,b=c*h,p=c*k;c*=n;var u=e*k;e*=n;f*=n;h*=m;k*=m;m*=n;this.n11=1-(u+f);this.n12=p-m;this.n13=c+k;this.n21=p+m;this.n22=1-(b+f);this.n23=e-h;this.n31=c-k;this.n32=e+h;this.n33=1-(b+u);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var f=THREE.Matrix4.__m1,m=THREE.Matrix4.__m2;
+f.identity();f.setRotationFromQuaternion(c);m.setScale(e.x,e.y,e.z);this.multiply(f,m);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var f=THREE.Matrix4.__v1,m=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);m.set(this.n12,this.n22,this.n32);h.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;e=e instanceof THREE.Vector3?e:new THREE.Vector3;e.x=f.length();
+e.y=m.length();e.z=h.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=e.x;f.n21/=e.x;f.n31/=e.x;f.n12/=e.y;f.n22/=e.y;f.n32/=e.y;f.n13/=e.z;f.n23/=e.z;f.n33/=e.z;c.setFromRotationMatrix(f);return[b,c,e]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var e=1/c.x,f=1/c.y,m=1/c.z;this.n11=b.n11*e;this.n21=b.n21*e;this.n31=b.n31*e;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*m;this.n23=
+b.n23*m;this.n33=b.n33*m}};
+THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,m=b.n13,h=b.n14,k=b.n21,n=b.n22,p=b.n23,u=b.n24,w=b.n31,t=b.n32,x=b.n33,v=b.n34,z=b.n41,y=b.n42,B=b.n43,C=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=p*v*y-u*x*y+u*t*B-n*v*B-p*t*C+n*x*C;c.n12=h*x*y-m*v*y-h*t*B+f*v*B+m*t*C-f*x*C;c.n13=m*u*y-h*p*y+h*n*B-f*u*B-m*n*C+f*p*C;c.n14=h*p*t-m*u*t-h*n*x+f*u*x+m*n*v-f*p*v;c.n21=u*x*z-p*v*z-u*w*B+k*v*B+p*w*C-k*x*C;c.n22=m*v*z-h*x*z+h*w*B-e*v*B-m*w*C+e*x*C;c.n23=h*p*z-m*u*z-h*k*B+e*u*B+m*k*C-e*p*C;c.n24=
+m*u*w-h*p*w+h*k*x-e*u*x-m*k*v+e*p*v;c.n31=n*v*z-u*t*z+u*w*y-k*v*y-n*w*C+k*t*C;c.n32=h*t*z-f*v*z-h*w*y+e*v*y+f*w*C-e*t*C;c.n33=m*u*z-h*n*z+h*k*y-e*u*y-f*k*C+e*n*C;c.n34=h*n*w-f*u*w-h*k*t+e*u*t+f*k*v-e*n*v;c.n41=p*t*z-n*x*z-p*w*y+k*x*y+n*w*B-k*t*B;c.n42=f*x*z-m*t*z+m*w*y-e*x*y-f*w*B+e*t*B;c.n43=m*n*z-f*p*z-m*k*y+e*p*y+f*k*B-e*n*B;c.n44=f*p*w-m*n*w+m*k*t-e*p*t-f*k*x+e*n*x;c.multiplyScalar(1/b.determinant());return c};
+THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,f=b.n33*b.n22-b.n32*b.n23,m=-b.n33*b.n21+b.n31*b.n23,h=b.n32*b.n21-b.n31*b.n22,k=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,p=-b.n32*b.n11+b.n31*b.n12,u=b.n23*b.n12-b.n22*b.n13,w=-b.n23*b.n11+b.n21*b.n13,t=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*k+b.n31*u;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*m;e[2]=b*h;e[3]=b*k;e[4]=b*n;e[5]=b*p;e[6]=b*u;e[7]=b*w;e[8]=b*t;return c};
+THREE.Matrix4.makeFrustum=function(b,c,e,f,m,h){var k;k=new THREE.Matrix4;k.n11=2*m/(c-b);k.n12=0;k.n13=(c+b)/(c-b);k.n14=0;k.n21=0;k.n22=2*m/(f-e);k.n23=(f+e)/(f-e);k.n24=0;k.n31=0;k.n32=0;k.n33=-(h+m)/(h-m);k.n34=-2*h*m/(h-m);k.n41=0;k.n42=0;k.n43=-1;k.n44=0;return k};THREE.Matrix4.makePerspective=function(b,c,e,f){var m,b=e*Math.tan(b*Math.PI/360);m=-b;return THREE.Matrix4.makeFrustum(m*c,b*c,m,b,e,f)};
+THREE.Matrix4.makeOrtho=function(b,c,e,f,m,h){var k,n,p,u;k=new THREE.Matrix4;n=c-b;p=e-f;u=h-m;k.n11=2/n;k.n12=0;k.n13=0;k.n14=-((c+b)/n);k.n21=0;k.n22=2/p;k.n23=0;k.n24=-((e+f)/p);k.n31=0;k.n32=0;k.n33=-2/u;k.n34=-((h+m)/u);k.n41=0;k.n42=0;k.n43=0;k.n44=1;return k};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.id=THREE.Object3DCount++;this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
 !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
 THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(b){if(this.children.indexOf(b)===
--1){b.parent!==void 0&&b.parent.removeChild(b);b.parent=this;this.children.push(b);for(var c=this;c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.addChildRecurse(b)}},remove:function(b){var c=this,e=this.children.indexOf(b);if(e!==-1){b.parent=void 0;for(this.children.splice(e,1);c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.removeChildRecurse(b)}},getChildByName:function(b,c){var e,f,h;e=0;for(f=this.children.length;e<f;e++){h=this.children[e];if(h.name===
-b)return h;if(c&&(h=h.getChildByName(b,c),h!==void 0))return h}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,e){this.matrixAutoUpdate&&
+-1){b.parent!==void 0&&b.parent.removeChild(b);b.parent=this;this.children.push(b);for(var c=this;c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.addChildRecurse(b)}},remove:function(b){var c=this,e=this.children.indexOf(b);if(e!==-1){b.parent=void 0;for(this.children.splice(e,1);c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.removeChildRecurse(b)}},getChildByName:function(b,c){var e,f,m;e=0;for(f=this.children.length;e<f;e++){m=this.children[e];if(m.name===
+b)return m;if(c&&(m=m.getChildByName(b,c),m!==void 0))return m}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,e){this.matrixAutoUpdate&&
 this.updateMatrix();if(this.matrixWorldNeedsUpdate||c)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,c=!0;for(var b=0,f=this.children.length;b<f;b++)this.children[b].update(this.matrixWorld,c,e)},addChild:function(b){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");this.add(b)},removeChild:function(b){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");
 this.remove(b)}};THREE.Object3DCount=0;
-THREE.Projector=function(){function b(){var b=u[n]=u[n]||new THREE.RenderableVertex;n++;return b}function c(b,e){return e.z-b.z}function e(b,e){var c=0,f=1,k=b.z+b.w,h=e.z+e.w,m=-b.z+b.w,n=-e.z+e.w;return k>=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?c=Math.max(c,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?c=Math.max(c,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),f<c?!1:(b.lerpSelf(e,c),e.lerpSelf(b,1-f),!0))}var f,h,k=[],m,n,u=[],p,w,t=[],x,v=[],z,y,B=[],C,E,F=[],G=[],M=[],P=new THREE.Vector4,L=new THREE.Vector4,
-A=new THREE.Matrix4,J=new THREE.Matrix4,Z=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],I=new THREE.Vector4,O=new THREE.Vector4;this.projectVector=function(b,e){A.multiply(e.projectionMatrix,e.matrixWorldInverse);A.multiplyVector3(b);return b};this.unprojectVector=function(b,e){A.multiply(e.matrixWorld,THREE.Matrix4.makeInvert(e.projectionMatrix));A.multiplyVector3(b);return b};this.projectObjects=function(b,e,m){var o,n;h=G.length=0;
-o=b.objects;b=0;for(e=o.length;b<e;b++){n=o[b];var t;if(!(t=!n.visible))if(t=n instanceof THREE.Mesh)if(t=n.frustumCulled){a:{t=void 0;for(var v=n.matrixWorld,p=-n.geometry.boundingSphere.radius*Math.max(n.scale.x,Math.max(n.scale.y,n.scale.z)),u=0;u<6;u++)if(t=Z[u].x*v.n14+Z[u].y*v.n24+Z[u].z*v.n34+Z[u].w,t<=p){t=!1;break a}t=!0}t=!t}if(!t)t=k[h]=k[h]||new THREE.RenderableObject,h++,f=t,P.copy(n.position),A.multiplyVector3(P),f.object=n,f.z=P.z,G.push(f)}m&&G.sort(c);return G};this.projectScene=
-function(f,k,h){var o=k.near,G=k.far,T,P,aa,ha,ca,qa,fa,da,U,$,ga,ka,ua,la,N,ma,ra;E=y=x=w=M.length=0;k.matrixAutoUpdate&&k.update(void 0,!0);f.update(void 0,!1,k);A.multiply(k.projectionMatrix,k.matrixWorldInverse);Z[0].set(A.n41-A.n11,A.n42-A.n12,A.n43-A.n13,A.n44-A.n14);Z[1].set(A.n41+A.n11,A.n42+A.n12,A.n43+A.n13,A.n44+A.n14);Z[2].set(A.n41+A.n21,A.n42+A.n22,A.n43+A.n23,A.n44+A.n24);Z[3].set(A.n41-A.n21,A.n42-A.n22,A.n43-A.n23,A.n44-A.n24);Z[4].set(A.n41-A.n31,A.n42-A.n32,A.n43-A.n33,A.n44-A.n34);
-Z[5].set(A.n41+A.n31,A.n42+A.n32,A.n43+A.n33,A.n44+A.n34);for(T=0;T<6;T++)U=Z[T],U.divideScalar(Math.sqrt(U.x*U.x+U.y*U.y+U.z*U.z));U=this.projectObjects(f,k,!0);f=0;for(T=U.length;f<T;f++)if($=U[f].object,$.visible)if(ga=$.matrixWorld,ka=$.matrixRotationWorld,ua=$.materials,la=$.overdraw,n=0,$ instanceof THREE.Mesh){N=$.geometry;ha=N.vertices;ma=N.faces;N=N.faceVertexUvs;P=0;for(aa=ha.length;P<aa;P++)m=b(),m.positionWorld.copy(ha[P].position),ga.multiplyVector3(m.positionWorld),m.positionScreen.copy(m.positionWorld),
-A.multiplyVector4(m.positionScreen),m.positionScreen.x/=m.positionScreen.w,m.positionScreen.y/=m.positionScreen.w,m.visible=m.positionScreen.z>o&&m.positionScreen.z<G;ha=0;for(P=ma.length;ha<P;ha++){aa=ma[ha];if(aa instanceof THREE.Face3)if(ca=u[aa.a],qa=u[aa.b],fa=u[aa.c],ca.visible&&qa.visible&&fa.visible&&($.doubleSided||$.flipSided!=(fa.positionScreen.x-ca.positionScreen.x)*(qa.positionScreen.y-ca.positionScreen.y)-(fa.positionScreen.y-ca.positionScreen.y)*(qa.positionScreen.x-ca.positionScreen.x)<
-0))da=t[w]=t[w]||new THREE.RenderableFace3,w++,p=da,p.v1.copy(ca),p.v2.copy(qa),p.v3.copy(fa);else continue;else if(aa instanceof THREE.Face4)if(ca=u[aa.a],qa=u[aa.b],fa=u[aa.c],da=u[aa.d],ca.visible&&qa.visible&&fa.visible&&da.visible&&($.doubleSided||$.flipSided!=((da.positionScreen.x-ca.positionScreen.x)*(qa.positionScreen.y-ca.positionScreen.y)-(da.positionScreen.y-ca.positionScreen.y)*(qa.positionScreen.x-ca.positionScreen.x)<0||(qa.positionScreen.x-fa.positionScreen.x)*(da.positionScreen.y-
-fa.positionScreen.y)-(qa.positionScreen.y-fa.positionScreen.y)*(da.positionScreen.x-fa.positionScreen.x)<0)))ra=v[x]=v[x]||new THREE.RenderableFace4,x++,p=ra,p.v1.copy(ca),p.v2.copy(qa),p.v3.copy(fa),p.v4.copy(da);else continue;p.normalWorld.copy(aa.normal);ka.multiplyVector3(p.normalWorld);p.centroidWorld.copy(aa.centroid);ga.multiplyVector3(p.centroidWorld);p.centroidScreen.copy(p.centroidWorld);A.multiplyVector3(p.centroidScreen);fa=aa.vertexNormals;ca=0;for(qa=fa.length;ca<qa;ca++)da=p.vertexNormalsWorld[ca],
-da.copy(fa[ca]),ka.multiplyVector3(da);ca=0;for(qa=N.length;ca<qa;ca++)if(ra=N[ca][ha]){fa=0;for(da=ra.length;fa<da;fa++)p.uvs[ca][fa]=ra[fa]}p.meshMaterials=ua;p.faceMaterials=aa.materials;p.overdraw=la;p.z=p.centroidScreen.z;M.push(p)}}else if($ instanceof THREE.Line){J.multiply(A,ga);ha=$.geometry.vertices;ca=b();ca.positionScreen.copy(ha[0].position);J.multiplyVector4(ca.positionScreen);P=1;for(aa=ha.length;P<aa;P++)if(ca=b(),ca.positionScreen.copy(ha[P].position),J.multiplyVector4(ca.positionScreen),
-qa=u[n-2],I.copy(ca.positionScreen),O.copy(qa.positionScreen),e(I,O))I.multiplyScalar(1/I.w),O.multiplyScalar(1/O.w),ga=B[y]=B[y]||new THREE.RenderableLine,y++,z=ga,z.v1.positionScreen.copy(I),z.v2.positionScreen.copy(O),z.z=Math.max(I.z,O.z),z.materials=$.materials,M.push(z)}else if($ instanceof THREE.Particle&&(L.set($.matrixWorld.n14,$.matrixWorld.n24,$.matrixWorld.n34,1),A.multiplyVector4(L),L.z/=L.w,L.z>0&&L.z<1))ga=F[E]=F[E]||new THREE.RenderableParticle,E++,C=ga,C.x=L.x/L.w,C.y=L.y/L.w,C.z=
-L.z,C.rotation=$.rotation.z,C.scale.x=$.scale.x*Math.abs(C.x-(L.x+k.projectionMatrix.n11)/(L.w+k.projectionMatrix.n14)),C.scale.y=$.scale.y*Math.abs(C.y-(L.y+k.projectionMatrix.n22)/(L.w+k.projectionMatrix.n24)),C.materials=$.materials,M.push(C);h&&M.sort(c);return M}};THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)};
-THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=0.5*Math.PI/360,e=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),k=Math.cos(e),e=Math.sin(e),m=b*c,n=f*h;this.w=m*k-n*e;this.x=m*e+n*k;this.y=f*c*k+b*h*e;this.z=b*h*k-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e);
+THREE.Projector=function(){function b(){var b=p[n]=p[n]||new THREE.RenderableVertex;n++;return b}function c(b,e){return e.z-b.z}function e(b,e){var c=0,f=1,h=b.z+b.w,m=e.z+e.w,k=-b.z+b.w,n=-e.z+e.w;return h>=0&&m>=0&&k>=0&&n>=0?!0:h<0&&m<0||k<0&&n<0?!1:(h<0?c=Math.max(c,h/(h-m)):m<0&&(f=Math.min(f,h/(h-m))),k<0?c=Math.max(c,k/(k-n)):n<0&&(f=Math.min(f,k/(k-n))),f<c?!1:(b.lerpSelf(e,c),e.lerpSelf(b,1-f),!0))}var f,m,h=[],k,n,p=[],u,w,t=[],x,v=[],z,y,B=[],C,E,F=[],G=[],M=[],P=new THREE.Vector4,L=new THREE.Vector4,
+A=new THREE.Matrix4,J=new THREE.Matrix4,Z=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],I=new THREE.Vector4,O=new THREE.Vector4;this.projectVector=function(b,e){A.multiply(e.projectionMatrix,e.matrixWorldInverse);A.multiplyVector3(b);return b};this.unprojectVector=function(b,e){A.multiply(e.matrixWorld,THREE.Matrix4.makeInvert(e.projectionMatrix));A.multiplyVector3(b);return b};this.projectObjects=function(b,e,k){var o,n;m=G.length=0;
+o=b.objects;b=0;for(e=o.length;b<e;b++){n=o[b];var t;if(!(t=!n.visible))if(t=n instanceof THREE.Mesh)if(t=n.frustumCulled){a:{t=void 0;for(var v=n.matrixWorld,u=-n.geometry.boundingSphere.radius*Math.max(n.scale.x,Math.max(n.scale.y,n.scale.z)),p=0;p<6;p++)if(t=Z[p].x*v.n14+Z[p].y*v.n24+Z[p].z*v.n34+Z[p].w,t<=u){t=!1;break a}t=!0}t=!t}if(!t)t=h[m]=h[m]||new THREE.RenderableObject,m++,f=t,P.copy(n.position),A.multiplyVector3(P),f.object=n,f.z=P.z,G.push(f)}k&&G.sort(c);return G};this.projectScene=
+function(f,h,m){var o=h.near,G=h.far,T,P,aa,ha,ca,qa,fa,da,U,$,ga,ka,ua,la,N,ma,ra;E=y=x=w=M.length=0;h.matrixAutoUpdate&&h.update(void 0,!0);f.update(void 0,!1,h);A.multiply(h.projectionMatrix,h.matrixWorldInverse);Z[0].set(A.n41-A.n11,A.n42-A.n12,A.n43-A.n13,A.n44-A.n14);Z[1].set(A.n41+A.n11,A.n42+A.n12,A.n43+A.n13,A.n44+A.n14);Z[2].set(A.n41+A.n21,A.n42+A.n22,A.n43+A.n23,A.n44+A.n24);Z[3].set(A.n41-A.n21,A.n42-A.n22,A.n43-A.n23,A.n44-A.n24);Z[4].set(A.n41-A.n31,A.n42-A.n32,A.n43-A.n33,A.n44-A.n34);
+Z[5].set(A.n41+A.n31,A.n42+A.n32,A.n43+A.n33,A.n44+A.n34);for(T=0;T<6;T++)U=Z[T],U.divideScalar(Math.sqrt(U.x*U.x+U.y*U.y+U.z*U.z));U=this.projectObjects(f,h,!0);f=0;for(T=U.length;f<T;f++)if($=U[f].object,$.visible)if(ga=$.matrixWorld,ka=$.matrixRotationWorld,ua=$.materials,la=$.overdraw,n=0,$ instanceof THREE.Mesh){N=$.geometry;ha=N.vertices;ma=N.faces;N=N.faceVertexUvs;P=0;for(aa=ha.length;P<aa;P++)k=b(),k.positionWorld.copy(ha[P].position),ga.multiplyVector3(k.positionWorld),k.positionScreen.copy(k.positionWorld),
+A.multiplyVector4(k.positionScreen),k.positionScreen.x/=k.positionScreen.w,k.positionScreen.y/=k.positionScreen.w,k.visible=k.positionScreen.z>o&&k.positionScreen.z<G;ha=0;for(P=ma.length;ha<P;ha++){aa=ma[ha];if(aa instanceof THREE.Face3)if(ca=p[aa.a],qa=p[aa.b],fa=p[aa.c],ca.visible&&qa.visible&&fa.visible&&($.doubleSided||$.flipSided!=(fa.positionScreen.x-ca.positionScreen.x)*(qa.positionScreen.y-ca.positionScreen.y)-(fa.positionScreen.y-ca.positionScreen.y)*(qa.positionScreen.x-ca.positionScreen.x)<
+0))da=t[w]=t[w]||new THREE.RenderableFace3,w++,u=da,u.v1.copy(ca),u.v2.copy(qa),u.v3.copy(fa);else continue;else if(aa instanceof THREE.Face4)if(ca=p[aa.a],qa=p[aa.b],fa=p[aa.c],da=p[aa.d],ca.visible&&qa.visible&&fa.visible&&da.visible&&($.doubleSided||$.flipSided!=((da.positionScreen.x-ca.positionScreen.x)*(qa.positionScreen.y-ca.positionScreen.y)-(da.positionScreen.y-ca.positionScreen.y)*(qa.positionScreen.x-ca.positionScreen.x)<0||(qa.positionScreen.x-fa.positionScreen.x)*(da.positionScreen.y-
+fa.positionScreen.y)-(qa.positionScreen.y-fa.positionScreen.y)*(da.positionScreen.x-fa.positionScreen.x)<0)))ra=v[x]=v[x]||new THREE.RenderableFace4,x++,u=ra,u.v1.copy(ca),u.v2.copy(qa),u.v3.copy(fa),u.v4.copy(da);else continue;u.normalWorld.copy(aa.normal);ka.multiplyVector3(u.normalWorld);u.centroidWorld.copy(aa.centroid);ga.multiplyVector3(u.centroidWorld);u.centroidScreen.copy(u.centroidWorld);A.multiplyVector3(u.centroidScreen);fa=aa.vertexNormals;ca=0;for(qa=fa.length;ca<qa;ca++)da=u.vertexNormalsWorld[ca],
+da.copy(fa[ca]),ka.multiplyVector3(da);ca=0;for(qa=N.length;ca<qa;ca++)if(ra=N[ca][ha]){fa=0;for(da=ra.length;fa<da;fa++)u.uvs[ca][fa]=ra[fa]}u.meshMaterials=ua;u.faceMaterials=aa.materials;u.overdraw=la;u.z=u.centroidScreen.z;M.push(u)}}else if($ instanceof THREE.Line){J.multiply(A,ga);ha=$.geometry.vertices;ca=b();ca.positionScreen.copy(ha[0].position);J.multiplyVector4(ca.positionScreen);P=1;for(aa=ha.length;P<aa;P++)if(ca=b(),ca.positionScreen.copy(ha[P].position),J.multiplyVector4(ca.positionScreen),
+qa=p[n-2],I.copy(ca.positionScreen),O.copy(qa.positionScreen),e(I,O))I.multiplyScalar(1/I.w),O.multiplyScalar(1/O.w),ga=B[y]=B[y]||new THREE.RenderableLine,y++,z=ga,z.v1.positionScreen.copy(I),z.v2.positionScreen.copy(O),z.z=Math.max(I.z,O.z),z.materials=$.materials,M.push(z)}else if($ instanceof THREE.Particle&&(L.set($.matrixWorld.n14,$.matrixWorld.n24,$.matrixWorld.n34,1),A.multiplyVector4(L),L.z/=L.w,L.z>0&&L.z<1))ga=F[E]=F[E]||new THREE.RenderableParticle,E++,C=ga,C.x=L.x/L.w,C.y=L.y/L.w,C.z=
+L.z,C.rotation=$.rotation.z,C.scale.x=$.scale.x*Math.abs(C.x-(L.x+h.projectionMatrix.n11)/(L.w+h.projectionMatrix.n14)),C.scale.y=$.scale.y*Math.abs(C.y-(L.y+h.projectionMatrix.n22)/(L.w+h.projectionMatrix.n24)),C.materials=$.materials,M.push(C);m&&M.sort(c);return M}};THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)};
+THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=0.5*Math.PI/360,e=b.x*c,f=b.y*c,m=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-m),m=Math.sin(-m),h=Math.cos(e),e=Math.sin(e),k=b*c,n=f*m;this.w=k*h-n*e;this.x=k*e+n*h;this.y=f*c*h+b*m*e;this.z=b*m*h-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e);
 this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c=
-this.x,e=this.y,f=this.z,h=this.w,k=b.x,m=b.y,n=b.z,b=b.w;this.x=c*b+h*k+e*n-f*m;this.y=e*b+h*m+f*k-c*n;this.z=f*b+h*n+c*m-e*k;this.w=h*b-c*k-e*m-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,h=b.z,k=this.x,m=this.y,n=this.z,u=this.w,p=u*e+m*h-n*f,w=u*f+n*e-k*h,t=u*h+k*f-m*e,e=-k*
-e-m*f-n*h;c.x=p*u+e*-k+w*-n-t*-m;c.y=w*u+e*-m+t*-k-p*-n;c.z=t*u+e*-n+p*-m-w*-k;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var k=Math.acos(h),m=Math.sqrt(1-h*h);if(Math.abs(m)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-f)*k)/m;f=Math.sin(f*k)/m;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e};
-THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,h,k){this.a=b;this.b=c;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=k instanceof Array?k:[k];this.centroid=new THREE.Vector3};
-THREE.Face4=function(b,c,e,f,h,k,m){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=k instanceof THREE.Color?k:new THREE.Color;this.vertexColors=k instanceof Array?k:[];this.vertexTangents=[];this.materials=m instanceof Array?m:[m];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0};
+this.x,e=this.y,f=this.z,m=this.w,h=b.x,k=b.y,n=b.z,b=b.w;this.x=c*b+m*h+e*n-f*k;this.y=e*b+m*k+f*h-c*n;this.z=f*b+m*n+c*k-e*h;this.w=m*b-c*h-e*k-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,m=b.z,h=this.x,k=this.y,n=this.z,p=this.w,u=p*e+k*m-n*f,w=p*f+n*e-h*m,t=p*m+h*f-k*e,e=-h*
+e-k*f-n*m;c.x=u*p+e*-h+w*-n-t*-k;c.y=w*p+e*-k+t*-h-u*-n;c.z=t*p+e*-n+u*-k-w*-h;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var m=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(m)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var h=Math.acos(m),k=Math.sqrt(1-m*m);if(Math.abs(k)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;m=Math.sin((1-f)*h)/k;f=Math.sin(f*h)/k;e.w=b.w*m+c.w*f;e.x=b.x*m+c.x*f;e.y=b.y*m+c.y*f;e.z=b.z*m+c.z*f;return e};
+THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,m,h){this.a=b;this.b=c;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=m instanceof THREE.Color?m:new THREE.Color;this.vertexColors=m instanceof Array?m:[];this.vertexTangents=[];this.materials=h instanceof Array?h:[h];this.centroid=new THREE.Vector3};
+THREE.Face4=function(b,c,e,f,m,h,k){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=m instanceof THREE.Vector3?m:new THREE.Vector3;this.vertexNormals=m instanceof Array?m:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=k instanceof Array?k:[k];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0};
 THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
-THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var e=0,f=this.vertices.length;e<f;e++)b.multiplyVector3(this.vertices[e].position);e=0;for(f=this.faces.length;e<f;e++){var h=this.faces[e];c.multiplyVector3(h.normal);for(var k=0,m=h.vertexNormals.length;k<m;k++)c.multiplyVector3(h.vertexNormals[k]);b.multiplyVector3(h.centroid)}},computeCentroids:function(){var b,c,e;b=0;for(c=this.faces.length;b<
+THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var e=0,f=this.vertices.length;e<f;e++)b.multiplyVector3(this.vertices[e].position);e=0;for(f=this.faces.length;e<f;e++){var m=this.faces[e];c.multiplyVector3(m.normal);for(var h=0,k=m.vertexNormals.length;h<k;h++)c.multiplyVector3(m.vertexNormals[h]);b.multiplyVector3(m.centroid)}},computeCentroids:function(){var b,c,e;b=0;for(c=this.faces.length;b<
 c;b++)e=this.faces[b],e.centroid.set(0,0,0),e instanceof THREE.Face3?(e.centroid.addSelf(this.vertices[e.a].position),e.centroid.addSelf(this.vertices[e.b].position),e.centroid.addSelf(this.vertices[e.c].position),e.centroid.divideScalar(3)):e instanceof THREE.Face4&&(e.centroid.addSelf(this.vertices[e.a].position),e.centroid.addSelf(this.vertices[e.b].position),e.centroid.addSelf(this.vertices[e.c].position),e.centroid.addSelf(this.vertices[e.d].position),e.centroid.divideScalar(4))},computeFaceNormals:function(b){var c,
-e,f,h,k,m,n=new THREE.Vector3,u=new THREE.Vector3;f=0;for(h=this.faces.length;f<h;f++){k=this.faces[f];if(b&&k.vertexNormals.length){n.set(0,0,0);c=0;for(e=k.vertexNormals.length;c<e;c++)n.addSelf(k.vertexNormals[c]);n.divideScalar(3)}else c=this.vertices[k.a],e=this.vertices[k.b],m=this.vertices[k.c],n.sub(m.position,e.position),u.sub(c.position,e.position),n.crossSelf(u);n.isZero()||n.normalize();k.normal.copy(n)}},computeVertexNormals:function(){var b,c,e,f;if(this.__tmpVertices==void 0){f=this.__tmpVertices=
+e,f,m,h,k,n=new THREE.Vector3,p=new THREE.Vector3;f=0;for(m=this.faces.length;f<m;f++){h=this.faces[f];if(b&&h.vertexNormals.length){n.set(0,0,0);c=0;for(e=h.vertexNormals.length;c<e;c++)n.addSelf(h.vertexNormals[c]);n.divideScalar(3)}else c=this.vertices[h.a],e=this.vertices[h.b],k=this.vertices[h.c],n.sub(k.position,e.position),p.sub(c.position,e.position),n.crossSelf(p);n.isZero()||n.normalize();h.normal.copy(n)}},computeVertexNormals:function(){var b,c,e,f;if(this.__tmpVertices==void 0){f=this.__tmpVertices=
 Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)f[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)if(e=this.faces[b],e instanceof THREE.Face3)e.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(e instanceof THREE.Face4)e.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{f=this.__tmpVertices;b=0;for(c=this.vertices.length;b<c;b++)f[b].set(0,0,0)}b=0;for(c=this.faces.length;b<c;b++)e=this.faces[b],e instanceof
 THREE.Face3?(f[e.a].addSelf(e.normal),f[e.b].addSelf(e.normal),f[e.c].addSelf(e.normal)):e instanceof THREE.Face4&&(f[e.a].addSelf(e.normal),f[e.b].addSelf(e.normal),f[e.c].addSelf(e.normal),f[e.d].addSelf(e.normal));b=0;for(c=this.vertices.length;b<c;b++)f[b].normalize();b=0;for(c=this.faces.length;b<c;b++)e=this.faces[b],e instanceof THREE.Face3?(e.vertexNormals[0].copy(f[e.a]),e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c])):e instanceof THREE.Face4&&(e.vertexNormals[0].copy(f[e.a]),
-e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c]),e.vertexNormals[3].copy(f[e.d]))},computeTangents:function(){function b(b,e,c,f,k,h,o){n=b.vertices[e].position;u=b.vertices[c].position;p=b.vertices[f].position;w=m[k];t=m[h];x=m[o];v=u.x-n.x;z=p.x-n.x;y=u.y-n.y;B=p.y-n.y;C=u.z-n.z;E=p.z-n.z;F=t.u-w.u;G=x.u-w.u;M=t.v-w.v;P=x.v-w.v;L=1/(F*P-G*M);I.set((P*v-M*z)*L,(P*y-M*B)*L,(P*C-M*E)*L);O.set((F*z-G*v)*L,(F*B-G*y)*L,(F*E-G*C)*L);J[e].addSelf(I);J[c].addSelf(I);J[f].addSelf(I);Z[e].addSelf(O);
-Z[c].addSelf(O);Z[f].addSelf(O)}var c,e,f,h,k,m,n,u,p,w,t,x,v,z,y,B,C,E,F,G,M,P,L,A,J=[],Z=[],I=new THREE.Vector3,O=new THREE.Vector3,X=new THREE.Vector3,V=new THREE.Vector3,W=new THREE.Vector3;c=0;for(e=this.vertices.length;c<e;c++)J[c]=new THREE.Vector3,Z[c]=new THREE.Vector3;c=0;for(e=this.faces.length;c<e;c++)k=this.faces[c],m=this.faceVertexUvs[0][c],k instanceof THREE.Face3?b(this,k.a,k.b,k.c,0,1,2):k instanceof THREE.Face4&&(b(this,k.a,k.b,k.c,0,1,2),b(this,k.a,k.b,k.d,0,1,3));var o=["a","b",
-"c","d"];c=0;for(e=this.faces.length;c<e;c++){k=this.faces[c];for(f=0;f<k.vertexNormals.length;f++)W.copy(k.vertexNormals[f]),h=k[o[f]],A=J[h],X.copy(A),X.subSelf(W.multiplyScalar(W.dot(A))).normalize(),V.cross(k.vertexNormals[f],A),h=V.dot(Z[h]),h=h<0?-1:1,k.vertexTangents[f]=new THREE.Vector4(X.x,X.y,X.z,h)}this.hasTangents=!0},computeBoundingBox:function(){var b;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,
+e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c]),e.vertexNormals[3].copy(f[e.d]))},computeTangents:function(){function b(b,e,c,f,h,m,o){n=b.vertices[e].position;p=b.vertices[c].position;u=b.vertices[f].position;w=k[h];t=k[m];x=k[o];v=p.x-n.x;z=u.x-n.x;y=p.y-n.y;B=u.y-n.y;C=p.z-n.z;E=u.z-n.z;F=t.u-w.u;G=x.u-w.u;M=t.v-w.v;P=x.v-w.v;L=1/(F*P-G*M);I.set((P*v-M*z)*L,(P*y-M*B)*L,(P*C-M*E)*L);O.set((F*z-G*v)*L,(F*B-G*y)*L,(F*E-G*C)*L);J[e].addSelf(I);J[c].addSelf(I);J[f].addSelf(I);Z[e].addSelf(O);
+Z[c].addSelf(O);Z[f].addSelf(O)}var c,e,f,m,h,k,n,p,u,w,t,x,v,z,y,B,C,E,F,G,M,P,L,A,J=[],Z=[],I=new THREE.Vector3,O=new THREE.Vector3,X=new THREE.Vector3,V=new THREE.Vector3,W=new THREE.Vector3;c=0;for(e=this.vertices.length;c<e;c++)J[c]=new THREE.Vector3,Z[c]=new THREE.Vector3;c=0;for(e=this.faces.length;c<e;c++)h=this.faces[c],k=this.faceVertexUvs[0][c],h instanceof THREE.Face3?b(this,h.a,h.b,h.c,0,1,2):h instanceof THREE.Face4&&(b(this,h.a,h.b,h.c,0,1,2),b(this,h.a,h.b,h.d,0,1,3));var o=["a","b",
+"c","d"];c=0;for(e=this.faces.length;c<e;c++){h=this.faces[c];for(f=0;f<h.vertexNormals.length;f++)W.copy(h.vertexNormals[f]),m=h[o[f]],A=J[m],X.copy(A),X.subSelf(W.multiplyScalar(W.dot(A))).normalize(),V.cross(h.vertexNormals[f],A),m=V.dot(Z[m]),m=m<0?-1:1,h.vertexTangents[f]=new THREE.Vector4(X.x,X.y,X.z,m)}this.hasTangents=!0},computeBoundingBox:function(){var b;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,
 this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;c<e;c++){b=this.vertices[c];if(b.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=b.position.x;else if(b.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=b.position.y;else if(b.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=
-b.position.z;else if(b.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;c<e;c++)b=Math.max(b,this.vertices[c].position.length());this.boundingSphere={radius:b}},mergeVertices:function(){for(var b=[],c=[],e=0,f=this.vertices.length;e<f;e++){for(var h=this.vertices[e],k=!1,m=0,n=b.length;m<n;m++){var u=b[m];if(Math.abs(h.position.x-u.position.x)<1.0E-4&&Math.abs(h.position.y-u.position.y)<1.0E-4&&Math.abs(h.position.z-
-u.position.z)<1.0E-4){c[e]=m;k=!0;break}}if(!k)c[e]=b.length,b.push(new THREE.Vertex(h.position.clone()))}e=0;for(f=this.faces.length;e<f;e++)h=this.faces[e],h.a=c[h.a],h.b=c[h.b],h.c=c[h.c],h.d=c[h.d];this.vertices=b},checkDupVertices:function(b){var c={},e=[],f=[],h,k,m;k=0;for(m=this.vertices.length;k<m;k++)h=this.vertices[k].position,h=[Math.round(h.x*1E3),Math.round(h.y*1E3),Math.round(h.z*1E3)].join("_"),c[h]===void 0?(c[h]=k,e.push(this.vertices[k]),f[k]=e.length-1):(console.log("Duplicate vertex found. ",
-k," could be using ",c[h]),f[k]=f[c[h]]);if(b){k=0;for(m=this.faces.length;k<m;k++){b=this.faces[k];if(b instanceof THREE.Face3)b.a=f[b.a],b.b=f[b.b],b.c=f[b.c];if(b instanceof THREE.Face4)b.a=f[b.a],b.b=f[b.b],b.c=f[b.c],b.d=f[b.d]}this.vertices=e}}};THREE.GeometryCount=0;
-THREE.Spline=function(b){function c(b,e,c,f,k,h,m){b=(c-b)*0.5;f=(f-e)*0.5;return(2*(e-c)+b+f)*m+(-3*(e-c)-2*b-f)*h+b*k+e}this.points=b;var e=[],f={x:0,y:0,z:0},h,k,m,n,u,p,w,t,x;this.initFromArray=function(b){this.points=[];for(var e=0;e<b.length;e++)this.points[e]={x:b[e][0],y:b[e][1],z:b[e][2]}};this.getPoint=function(b){h=(this.points.length-1)*b;k=Math.floor(h);m=h-k;e[0]=k==0?k:k-1;e[1]=k;e[2]=k>this.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;p=this.points[e[0]];w=this.points[e[1]];
-t=this.points[e[2]];x=this.points[e[3]];n=m*m;u=m*n;f.x=c(p.x,w.x,t.x,x.x,m,n,u);f.y=c(p.y,w.y,t.y,x.y,m,n,u);f.z=c(p.z,w.z,t.z,x.z,m,n,u);return f};this.getControlPointsArray=function(){var b,e,c=this.points.length,f=[];for(b=0;b<c;b++)e=this.points[b],f[b]=[e.x,e.y,e.z];return f};this.getLength=function(b){var e,c,f=e=e=0,k=new THREE.Vector3,h=new THREE.Vector3,m=[],n=0;m[0]=0;b||(b=100);c=this.points.length*b;k.copy(this.points[0]);for(b=1;b<c;b++)e=b/c,position=this.getPoint(e),h.copy(position),
-n+=h.distanceTo(k),k.copy(position),e*=this.points.length-1,e=Math.floor(e),e!=f&&(m[e]=n,f=e);m[m.length]=n;return{chunks:m,total:n}};this.reparametrizeByArcLength=function(b){var e,c,f,k,h,m,n=[],t=new THREE.Vector3,u=this.getLength();n.push(t.copy(this.points[0]).clone());for(e=1;e<this.points.length;e++){c=u.chunks[e]-u.chunks[e-1];m=Math.ceil(b*c/u.total);k=(e-1)/(this.points.length-1);h=e/(this.points.length-1);for(c=1;c<m-1;c++)f=k+c*(1/m)*(h-k),position=this.getPoint(f),n.push(t.copy(position).clone());
-n.push(t.copy(this.points[e]).clone())}this.points=n}};THREE.Edge=function(b,c,e,f){this.vertices=[b,c];this.vertexIndices=[e,f];this.faces=[];this.faceIndices=[]};THREE.Camera=function(b,c,e,f,h){THREE.Object3D.call(this);this.fov=b||50;this.aspect=c||1;this.near=e!==void 0?e:0.1;this.far=f!==void 0?f:2E3;this.target=h||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;
+b.position.z;else if(b.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;c<e;c++)b=Math.max(b,this.vertices[c].position.length());this.boundingSphere={radius:b}},mergeVertices:function(){var b={},c=[],e=[],f,m=Math.pow(10,4),h,k;h=0;for(k=this.vertices.length;h<k;h++)f=this.vertices[h].position,f=[Math.round(f.x*m),Math.round(f.y*m),Math.round(f.z*m)].join("_"),b[f]===void 0?(b[f]=h,c.push(this.vertices[h]),
+e[h]=c.length-1):e[h]=e[b[f]];h=0;for(k=this.faces.length;h<k;h++){b=this.faces[h];if(b instanceof THREE.Face3)b.a=e[b.a],b.b=e[b.b],b.c=e[b.c];if(b instanceof THREE.Face4)b.a=e[b.a],b.b=e[b.b],b.c=e[b.c],b.d=e[b.d]}this.vertices=c}};THREE.GeometryCount=0;
+THREE.Spline=function(b){function c(b,e,c,f,h,m,k){b=(c-b)*0.5;f=(f-e)*0.5;return(2*(e-c)+b+f)*k+(-3*(e-c)-2*b-f)*m+b*h+e}this.points=b;var e=[],f={x:0,y:0,z:0},m,h,k,n,p,u,w,t,x;this.initFromArray=function(b){this.points=[];for(var e=0;e<b.length;e++)this.points[e]={x:b[e][0],y:b[e][1],z:b[e][2]}};this.getPoint=function(b){m=(this.points.length-1)*b;h=Math.floor(m);k=m-h;e[0]=h==0?h:h-1;e[1]=h;e[2]=h>this.points.length-2?h:h+1;e[3]=h>this.points.length-3?h:h+2;u=this.points[e[0]];w=this.points[e[1]];
+t=this.points[e[2]];x=this.points[e[3]];n=k*k;p=k*n;f.x=c(u.x,w.x,t.x,x.x,k,n,p);f.y=c(u.y,w.y,t.y,x.y,k,n,p);f.z=c(u.z,w.z,t.z,x.z,k,n,p);return f};this.getControlPointsArray=function(){var b,e,c=this.points.length,f=[];for(b=0;b<c;b++)e=this.points[b],f[b]=[e.x,e.y,e.z];return f};this.getLength=function(b){var e,c,f=e=e=0,h=new THREE.Vector3,m=new THREE.Vector3,k=[],n=0;k[0]=0;b||(b=100);c=this.points.length*b;h.copy(this.points[0]);for(b=1;b<c;b++)e=b/c,position=this.getPoint(e),m.copy(position),
+n+=m.distanceTo(h),h.copy(position),e*=this.points.length-1,e=Math.floor(e),e!=f&&(k[e]=n,f=e);k[k.length]=n;return{chunks:k,total:n}};this.reparametrizeByArcLength=function(b){var e,c,f,h,m,k,n=[],t=new THREE.Vector3,u=this.getLength();n.push(t.copy(this.points[0]).clone());for(e=1;e<this.points.length;e++){c=u.chunks[e]-u.chunks[e-1];k=Math.ceil(b*c/u.total);h=(e-1)/(this.points.length-1);m=e/(this.points.length-1);for(c=1;c<k-1;c++)f=h+c*(1/k)*(m-h),position=this.getPoint(f),n.push(t.copy(position).clone());
+n.push(t.copy(this.points[e]).clone())}this.points=n}};THREE.Edge=function(b,c,e,f){this.vertices=[b,c];this.vertexIndices=[e,f];this.faces=[];this.faceIndices=[]};THREE.Camera=function(b,c,e,f,m){THREE.Object3D.call(this);this.fov=b||50;this.aspect=c||1;this.near=e!==void 0?e:0.1;this.far=f!==void 0?f:2E3;this.target=m||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;
 THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);c.multiplyScalar(b);this.position.addSelf(c);this.target.position.addSelf(c)};
 THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var b=this.fullWidth/this.fullHeight,c=Math.tan(this.fov*Math.PI/360)*this.near,e=-c,f=b*e,b=Math.abs(b*c-f),e=Math.abs(c-e);this.projectionMatrix=THREE.Matrix4.makeFrustum(f+this.x*b/this.fullWidth,f+(this.x+this.width)*b/this.fullWidth,c-(this.y+this.height)*e/this.fullHeight,c-this.y*e/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
-THREE.Camera.prototype.setViewOffset=function(b,c,e,f,h,k){this.fullWidth=b;this.fullHeight=c;this.x=e;this.y=f;this.width=h;this.height=k;this.updateProjectionMatrix()};
+THREE.Camera.prototype.setViewOffset=function(b,c,e,f,m,h){this.fullWidth=b;this.fullHeight=c;this.x=e;this.y=f;this.width=m;this.height=h;this.updateProjectionMatrix()};
 THREE.Camera.prototype.update=function(b,c,e){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),c=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
-!1,c=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,e)};THREE.OrthoCamera=function(b,c,e,f,h,k,m){THREE.Camera.call(this,45,1,h,k,m);this.left=b;this.right=c;this.top=e;this.bottom=f;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
+!1,c=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,e)};THREE.OrthoCamera=function(b,c,e,f,m,h,k){THREE.Camera.call(this,45,1,m,h,k);this.left=b;this.right=c;this.top=e;this.bottom=f;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
 THREE.OrthoCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(b,c,e){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.intensity=c!==void 0?c:1;this.distance=e!==void 0?e:0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(b,c,e){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,0,0);this.intensity=c!==void 0?c:1;this.distance=e!==void 0?e:0};
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.SpotLight=function(b,c,e,f){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=c!==void 0?c:1;this.distance=e!==void 0?e:0;this.castShadow=f!==void 0?f:!1};THREE.SpotLight.prototype=new THREE.Light;THREE.SpotLight.prototype.constructor=THREE.SpotLight;
@@ -116,24 +115,24 @@ THREE.ParticleBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this
 THREE.ParticleCanvasMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.program=b.program!==void 0?b.program:function(){}};THREE.ParticleCanvasMaterial.prototype=new THREE.Material;THREE.ParticleCanvasMaterial.prototype.constructor=THREE.ParticleCanvasMaterial;THREE.ParticleDOMMaterial=function(b){THREE.Material.call(this);this.domElement=b};
 THREE.ShaderMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.fragmentShader=b.fragmentShader!==void 0?b.fragmentShader:"void main() {}";this.vertexShader=b.vertexShader!==void 0?b.vertexShader:"void main() {}";this.uniforms=b.uniforms!==void 0?b.uniforms:{};this.attributes=b.attributes;this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.fog=b.fog!==
 void 0?b.fog:!1;this.lights=b.lights!==void 0?b.lights:!1;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};THREE.ShaderMaterial.prototype=new THREE.Material;THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial;
-THREE.Texture=function(b,c,e,f,h,k){this.id=THREE.TextureCount++;this.image=b;this.mapping=c!==void 0?c:new THREE.UVMapping;this.wrapS=e!==void 0?e:THREE.ClampToEdgeWrapping;this.wrapT=f!==void 0?f:THREE.ClampToEdgeWrapping;this.magFilter=h!==void 0?h:THREE.LinearFilter;this.minFilter=k!==void 0?k:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
+THREE.Texture=function(b,c,e,f,m,h){this.id=THREE.TextureCount++;this.image=b;this.mapping=c!==void 0?c:new THREE.UVMapping;this.wrapS=e!==void 0?e:THREE.ClampToEdgeWrapping;this.wrapT=f!==void 0?f:THREE.ClampToEdgeWrapping;this.magFilter=m!==void 0?m:THREE.LinearFilter;this.minFilter=h!==void 0?h:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
 THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var b=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
 THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;
-THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(b,c,e,f,h,k,m,n,u){THREE.Texture.call(this,null,h,k,m,n,u);this.image={data:b,width:c,height:e};this.format=f!==void 0?f:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
+THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(b,c,e,f,m,h,k,n,p){THREE.Texture.call(this,null,m,h,k,n,p);this.image={data:b,width:c,height:e};this.format=f!==void 0?f:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
 THREE.DataTexture.prototype.clone=function(){var b=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b};THREE.Particle=function(b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
 THREE.ParticleSystem=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(b,c,e){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.type=e!=void 0?e:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;
 THREE.Line.prototype.constructor=THREE.Line;
 THREE.Mesh=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c&&c.length?c:[c];this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=b.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var e=0;e<this.geometry.morphTargets.length;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[e].name]=
 e}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(b){if(this.morphTargetDictionary[b]!==void 0)return this.morphTargetDictionary[b];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+b+" does not exist. Returning 0.");return 0};
 THREE.Bone=function(b){THREE.Object3D.call(this);this.skin=b;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
-THREE.Bone.prototype.update=function(b,c,e){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.skinMatrix.multiply(b,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,h=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(f=0;f<h;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.skinMatrix,c,e):b.update(this.matrixWorld,!0,e)}else for(f=0;f<h;f++)this.children[f].update(this.skinMatrix,
+THREE.Bone.prototype.update=function(b,c,e){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.skinMatrix.multiply(b,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,m=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(f=0;f<m;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.skinMatrix,c,e):b.update(this.matrixWorld,!0,e)}else for(f=0;f<m;f++)this.children[f].update(this.skinMatrix,
 c,e)};THREE.Bone.prototype.addChild=function(b){if(this.children.indexOf(b)===-1&&(b.parent!==void 0&&b.parent.removeChild(b),b.parent=this,this.children.push(b),!(b instanceof THREE.Bone)))this.hasNoneBoneChildren=!0};
-THREE.SkinnedMesh=function(b,c){THREE.Mesh.call(this,b,c);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var e,f,h,k,m,n;if(this.geometry.bones!==void 0){for(e=0;e<this.geometry.bones.length;e++)h=this.geometry.bones[e],k=h.pos,m=h.rotq,n=h.scl,f=this.addBone(),f.name=h.name,f.position.set(k[0],k[1],k[2]),f.quaternion.set(m[0],m[1],m[2],m[3]),f.useQuaternion=!0,n!==void 0?f.scale.set(n[0],n[1],n[2]):f.scale.set(1,1,1);for(e=0;e<this.bones.length;e++)h=this.geometry.bones[e],
-f=this.bones[e],h.parent===-1?this.addChild(f):this.bones[h.parent].addChild(f);this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;
-THREE.SkinnedMesh.prototype.update=function(b,c,e){if(this.visible){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,h=this.children.length;for(f=0;f<h;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.identityMatrix,!1,e):b.update(this.matrixWorld,c,e);e=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(c=0;c<e;c++)ba[c].skinMatrix.flattenToArrayOffset(bm,
+THREE.SkinnedMesh=function(b,c){THREE.Mesh.call(this,b,c);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var e,f,m,h,k,n;if(this.geometry.bones!==void 0){for(e=0;e<this.geometry.bones.length;e++)m=this.geometry.bones[e],h=m.pos,k=m.rotq,n=m.scl,f=this.addBone(),f.name=m.name,f.position.set(h[0],h[1],h[2]),f.quaternion.set(k[0],k[1],k[2],k[3]),f.useQuaternion=!0,n!==void 0?f.scale.set(n[0],n[1],n[2]):f.scale.set(1,1,1);for(e=0;e<this.bones.length;e++)m=this.geometry.bones[e],
+f=this.bones[e],m.parent===-1?this.addChild(f):this.bones[m.parent].addChild(f);this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;
+THREE.SkinnedMesh.prototype.update=function(b,c,e){if(this.visible){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,m=this.children.length;for(f=0;f<m;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.identityMatrix,!1,e):b.update(this.matrixWorld,c,e);e=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(c=0;c<e;c++)ba[c].skinMatrix.flattenToArrayOffset(bm,
 c*16)}};THREE.SkinnedMesh.prototype.addBone=function(b){b===void 0&&(b=new THREE.Bone(this));this.bones.push(b);return b};
-THREE.SkinnedMesh.prototype.pose=function(){this.update(void 0,!0);for(var b,c=[],e=0;e<this.bones.length;e++)b=this.bones[e],c.push(THREE.Matrix4.makeInvert(b.skinMatrix)),b.skinMatrix.flattenToArrayOffset(this.boneMatrices,e*16);if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var f;for(b=0;b<this.geometry.skinIndices.length;b++){var e=this.geometry.vertices[b].position,h=this.geometry.skinIndices[b].x,k=this.geometry.skinIndices[b].y;f=new THREE.Vector3(e.x,
-e.y,e.z);this.geometry.skinVerticesA.push(c[h].multiplyVector3(f));f=new THREE.Vector3(e.x,e.y,e.z);this.geometry.skinVerticesB.push(c[k].multiplyVector3(f));this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y!==1&&(e=(1-(this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y))*0.5,this.geometry.skinWeights[b].x+=e,this.geometry.skinWeights[b].y+=e)}}};THREE.Ribbon=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c]};
+THREE.SkinnedMesh.prototype.pose=function(){this.update(void 0,!0);for(var b,c=[],e=0;e<this.bones.length;e++)b=this.bones[e],c.push(THREE.Matrix4.makeInvert(b.skinMatrix)),b.skinMatrix.flattenToArrayOffset(this.boneMatrices,e*16);if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var f;for(b=0;b<this.geometry.skinIndices.length;b++){var e=this.geometry.vertices[b].position,m=this.geometry.skinIndices[b].x,h=this.geometry.skinIndices[b].y;f=new THREE.Vector3(e.x,
+e.y,e.z);this.geometry.skinVerticesA.push(c[m].multiplyVector3(f));f=new THREE.Vector3(e.x,e.y,e.z);this.geometry.skinVerticesB.push(c[h].multiplyVector3(f));this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y!==1&&(e=(1-(this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y))*0.5,this.geometry.skinWeights[b].x+=e,this.geometry.skinWeights[b].y+=e)}}};THREE.Ribbon=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c]};
 THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(b,c){c===void 0&&(c=0);for(var c=Math.abs(c),e=0;e<this.LODs.length;e++)if(c<this.LODs[e].visibleAtDistance)break;this.LODs.splice(e,0,{visibleAtDistance:c,object3D:b});this.add(b)};
 THREE.LOD.prototype.update=function(b,c,e){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;if(this.LODs.length>1){b=e.matrixWorldInverse;b=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(var f=1;f<this.LODs.length;f++)if(b>=this.LODs[f].visibleAtDistance)this.LODs[f-1].object3D.visible=!1,
 this.LODs[f].object3D.visible=!0;else break;for(;f<this.LODs.length;f++)this.LODs[f].object3D.visible=!1}for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,e)};
@@ -146,46 +145,46 @@ THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)th
 THREE.Scene.prototype.removeChildRecurse=function(b){if(b instanceof THREE.Light){var c=this.lights.indexOf(b);c!==-1&&this.lights.splice(c,1)}else b instanceof THREE.Camera||(c=this.objects.indexOf(b),c!==-1&&(this.objects.splice(c,1),this.__objectsRemoved.push(b),c=this.__objectsAdded.indexOf(b),c!==-1&&this.__objectsAdded.splice(c,1)));for(c=0;c<b.children.length;c++)this.removeChildRecurse(b.children[c])};
 THREE.Scene.prototype.addChild=function(b){console.warn("DEPRECATED: Scene.addChild() is now Scene.add().");this.add(b)};THREE.Scene.prototype.addObject=function(b){console.warn("DEPRECATED: Scene.addObject() is now Scene.add().");this.add(b)};THREE.Scene.prototype.addLight=function(b){console.warn("DEPRECATED: Scene.addLight() is now Scene.add().");this.add(b)};THREE.Scene.prototype.removeChild=function(b){console.warn("DEPRECATED: Scene.removeChild() is now Scene.remove().");this.remove(b)};
 THREE.Scene.prototype.removeObject=function(b){console.warn("DEPRECATED: Scene.removeObject() is now Scene.remove().");this.remove(b)};THREE.Scene.prototype.removeLight=function(b){console.warn("DEPRECATED: Scene.removeLight() is now Scene.remove().");this.remove(b)};THREE.Fog=function(b,c,e){this.color=new THREE.Color(b);this.near=c!==void 0?c:1;this.far=e!==void 0?e:1E3};THREE.FogExp2=function(b,c){this.color=new THREE.Color(b);this.density=c!==void 0?c:2.5E-4};
-THREE.DOMRenderer=function(){THREE.Renderer.call(this);var b=null,c=new THREE.Projector,e,f,h,k;this.domElement=document.createElement("div");this.setSize=function(b,c){e=b;f=c;h=e/2;k=f/2};this.render=function(e,f){var u,p,w,t,x,v,z,y;b=c.projectScene(e,f);u=0;for(p=b.length;u<p;u++)if(x=b[u],x instanceof THREE.RenderableParticle){z=x.x*h+h;y=x.y*k+k;w=0;for(t=x.material.length;w<t;w++)if(v=x.material[w],v instanceof THREE.ParticleDOMMaterial)v=v.domElement,v.style.left=z+"px",v.style.top=y+"px"}}};
-THREE.CanvasRenderer=function(b){function c(b){if(B!=b)v.globalAlpha=B=b}function e(b){if(C!=b){switch(b){case THREE.NormalBlending:v.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:v.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:v.globalCompositeOperation="darker"}C=b}}function f(b){if(E!=b)v.strokeStyle=E=b}function h(b){if(F!=b)v.fillStyle=F=b}var k=this,m=null,n=new THREE.Projector,b=b||{},u=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
-p,w,t,x,v=u.getContext("2d"),z=new THREE.Color(0),y=0,B=1,C=0,E=null,F=null,G=null,M=null,P=null,L,A,J,Z,I=new THREE.RenderableVertex,O=new THREE.RenderableVertex,X,V,W,o,ea,T,na,aa,ha,ca,qa,fa,da=new THREE.Color(0),U=new THREE.Color(0),$=new THREE.Color(0),ga=new THREE.Color(0),ka=new THREE.Color(0),ua=[],la,N,ma,ra,wa,Da,Ea,Aa,Ca,Ga,K=new THREE.Rectangle,R=new THREE.Rectangle,S=new THREE.Rectangle,ja=!1,oa=new THREE.Color,ia=new THREE.Color,sa=new THREE.Color,va=new THREE.Color,pa=new THREE.Vector3,
-xa,ya,Ka,Ba,Ha,Y,b=16;xa=document.createElement("canvas");xa.width=xa.height=2;ya=xa.getContext("2d");ya.fillStyle="rgba(0,0,0,1)";ya.fillRect(0,0,2,2);Ka=ya.getImageData(0,0,2,2);Ba=Ka.data;Ha=document.createElement("canvas");Ha.width=Ha.height=b;Y=Ha.getContext("2d");Y.translate(-b/2,-b/2);Y.scale(b,b);b--;this.domElement=u;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setSize=function(b,e){p=b;w=e;t=Math.floor(p/2);x=Math.floor(w/2);u.width=p;
-u.height=w;K.set(-t,-x,t,x);R.set(-t,-x,t,x);B=1;C=0;P=M=G=F=E=null};this.setClearColor=function(b,e){z.copy(b);y=e;R.set(-t,-x,t,x)};this.setClearColorHex=function(b,e){z.setHex(b);y=e;R.set(-t,-x,t,x)};this.clear=function(){v.setTransform(1,0,0,-1,t,x);R.isEmpty()||(R.minSelf(K),R.inflate(2),y<1&&v.clearRect(Math.floor(R.getX()),Math.floor(R.getY()),Math.floor(R.getWidth()),Math.floor(R.getHeight())),y>0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(z.r*255)+","+Math.floor(z.g*255)+","+Math.floor(z.b*
-255)+","+y+")"),v.fillRect(Math.floor(R.getX()),Math.floor(R.getY()),Math.floor(R.getWidth()),Math.floor(R.getHeight()))),R.empty())};this.render=function(b,u){function p(b){var e,c,f,k=b.lights;ia.setRGB(0,0,0);sa.setRGB(0,0,0);va.setRGB(0,0,0);b=0;for(e=k.length;b<e;b++)c=k[b],f=c.color,c instanceof THREE.AmbientLight?(ia.r+=f.r,ia.g+=f.g,ia.b+=f.b):c instanceof THREE.DirectionalLight?(sa.r+=f.r,sa.g+=f.g,sa.b+=f.b):c instanceof THREE.PointLight&&(va.r+=f.r,va.g+=f.g,va.b+=f.b)}function w(b,e,c,
-f){var k,h,m,o,n=b.lights,b=0;for(k=n.length;b<k;b++)h=n[b],m=h.color,h instanceof THREE.DirectionalLight?(o=c.dot(h.position),o<=0||(o*=h.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)):h instanceof THREE.PointLight&&(o=c.dot(pa.sub(h.position,e).normalize()),o<=0||(o*=h.distance==0?1:1-Math.min(e.distanceTo(h.position)/h.distance,1),o!=0&&(o*=h.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)))}function y(b,k,m){c(m.opacity);e(m.blending);var o,n,u,p,Fa,w;if(m instanceof THREE.ParticleBasicMaterial){if(m.map)p=
-m.map.image,Fa=p.width>>1,w=p.height>>1,m=k.scale.x*t,u=k.scale.y*x,o=m*Fa,n=u*w,S.set(b.x-o,b.y-n,b.x+o,b.y+n),K.intersects(S)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-u),v.translate(-Fa,-w),v.drawImage(p,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(o=k.scale.x*t,n=k.scale.y*x,S.set(b.x-o,b.y-n,b.x+o,b.y+n),K.intersects(S)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(o,n),m.program(v),
-v.restore()))}function z(b,k,h,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(k.positionScreen.x,k.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(M!=b)v.lineCap=M=b;b=m.linejoin;if(P!=b)v.lineJoin=P=b;f(m.color.getContextStyle());v.stroke();S.inflate(m.linewidth*2)}}function B(b,f,h,m,n,t,p,v,x){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending);
-X=b.positionScreen.x;V=b.positionScreen.y;W=f.positionScreen.x;o=f.positionScreen.y;ea=h.positionScreen.x;T=h.positionScreen.y;E(X,V,W,o,ea,T);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=p.uvs[0],ab(X,V,W,o,ea,T,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=u.matrixWorldInverse,pa.copy(p.vertexNormalsWorld[0]),wa=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,
+THREE.DOMRenderer=function(){THREE.Renderer.call(this);var b=null,c=new THREE.Projector,e,f,m,h;this.domElement=document.createElement("div");this.setSize=function(b,c){e=b;f=c;m=e/2;h=f/2};this.render=function(e,f){var p,u,w,t,x,v,z,y;b=c.projectScene(e,f);p=0;for(u=b.length;p<u;p++)if(x=b[p],x instanceof THREE.RenderableParticle){z=x.x*m+m;y=x.y*h+h;w=0;for(t=x.material.length;w<t;w++)if(v=x.material[w],v instanceof THREE.ParticleDOMMaterial)v=v.domElement,v.style.left=z+"px",v.style.top=y+"px"}}};
+THREE.CanvasRenderer=function(b){function c(b){if(B!=b)v.globalAlpha=B=b}function e(b){if(C!=b){switch(b){case THREE.NormalBlending:v.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:v.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:v.globalCompositeOperation="darker"}C=b}}function f(b){if(E!=b)v.strokeStyle=E=b}function m(b){if(F!=b)v.fillStyle=F=b}var h=this,k=null,n=new THREE.Projector,b=b||{},p=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
+u,w,t,x,v=p.getContext("2d"),z=new THREE.Color(0),y=0,B=1,C=0,E=null,F=null,G=null,M=null,P=null,L,A,J,Z,I=new THREE.RenderableVertex,O=new THREE.RenderableVertex,X,V,W,o,ea,T,na,aa,ha,ca,qa,fa,da=new THREE.Color(0),U=new THREE.Color(0),$=new THREE.Color(0),ga=new THREE.Color(0),ka=new THREE.Color(0),ua=[],la,N,ma,ra,wa,Da,Ea,Aa,Ca,Ga,K=new THREE.Rectangle,R=new THREE.Rectangle,S=new THREE.Rectangle,ja=!1,oa=new THREE.Color,ia=new THREE.Color,sa=new THREE.Color,va=new THREE.Color,pa=new THREE.Vector3,
+xa,ya,Ka,Ba,Ha,Y,b=16;xa=document.createElement("canvas");xa.width=xa.height=2;ya=xa.getContext("2d");ya.fillStyle="rgba(0,0,0,1)";ya.fillRect(0,0,2,2);Ka=ya.getImageData(0,0,2,2);Ba=Ka.data;Ha=document.createElement("canvas");Ha.width=Ha.height=b;Y=Ha.getContext("2d");Y.translate(-b/2,-b/2);Y.scale(b,b);b--;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setSize=function(b,e){u=b;w=e;t=Math.floor(u/2);x=Math.floor(w/2);p.width=u;
+p.height=w;K.set(-t,-x,t,x);R.set(-t,-x,t,x);B=1;C=0;P=M=G=F=E=null};this.setClearColor=function(b,e){z.copy(b);y=e;R.set(-t,-x,t,x)};this.setClearColorHex=function(b,e){z.setHex(b);y=e;R.set(-t,-x,t,x)};this.clear=function(){v.setTransform(1,0,0,-1,t,x);R.isEmpty()||(R.minSelf(K),R.inflate(2),y<1&&v.clearRect(Math.floor(R.getX()),Math.floor(R.getY()),Math.floor(R.getWidth()),Math.floor(R.getHeight())),y>0&&(e(THREE.NormalBlending),c(1),m("rgba("+Math.floor(z.r*255)+","+Math.floor(z.g*255)+","+Math.floor(z.b*
+255)+","+y+")"),v.fillRect(Math.floor(R.getX()),Math.floor(R.getY()),Math.floor(R.getWidth()),Math.floor(R.getHeight()))),R.empty())};this.render=function(b,u){function p(b){var e,c,f,h=b.lights;ia.setRGB(0,0,0);sa.setRGB(0,0,0);va.setRGB(0,0,0);b=0;for(e=h.length;b<e;b++)c=h[b],f=c.color,c instanceof THREE.AmbientLight?(ia.r+=f.r,ia.g+=f.g,ia.b+=f.b):c instanceof THREE.DirectionalLight?(sa.r+=f.r,sa.g+=f.g,sa.b+=f.b):c instanceof THREE.PointLight&&(va.r+=f.r,va.g+=f.g,va.b+=f.b)}function w(b,e,c,
+f){var h,m,k,o,n=b.lights,b=0;for(h=n.length;b<h;b++)m=n[b],k=m.color,m instanceof THREE.DirectionalLight?(o=c.dot(m.position),o<=0||(o*=m.intensity,f.r+=k.r*o,f.g+=k.g*o,f.b+=k.b*o)):m instanceof THREE.PointLight&&(o=c.dot(pa.sub(m.position,e).normalize()),o<=0||(o*=m.distance==0?1:1-Math.min(e.distanceTo(m.position)/m.distance,1),o!=0&&(o*=m.intensity,f.r+=k.r*o,f.g+=k.g*o,f.b+=k.b*o)))}function y(b,h,k){c(k.opacity);e(k.blending);var o,n,u,p,Fa,w;if(k instanceof THREE.ParticleBasicMaterial){if(k.map)p=
+k.map.image,Fa=p.width>>1,w=p.height>>1,k=h.scale.x*t,u=h.scale.y*x,o=k*Fa,n=u*w,S.set(b.x-o,b.y-n,b.x+o,b.y+n),K.intersects(S)&&(v.save(),v.translate(b.x,b.y),v.rotate(-h.rotation),v.scale(k,-u),v.translate(-Fa,-w),v.drawImage(p,0,0),v.restore())}else k instanceof THREE.ParticleCanvasMaterial&&(o=h.scale.x*t,n=h.scale.y*x,S.set(b.x-o,b.y-n,b.x+o,b.y+n),K.intersects(S)&&(f(k.color.getContextStyle()),m(k.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-h.rotation),v.scale(o,n),k.program(v),
+v.restore()))}function z(b,h,k,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(h.positionScreen.x,h.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(M!=b)v.lineCap=M=b;b=m.linejoin;if(P!=b)v.lineJoin=P=b;f(m.color.getContextStyle());v.stroke();S.inflate(m.linewidth*2)}}function B(b,f,m,k,n,t,p,v,x){h.info.render.vertices+=3;h.info.render.faces++;c(v.opacity);e(v.blending);
+X=b.positionScreen.x;V=b.positionScreen.y;W=f.positionScreen.x;o=f.positionScreen.y;ea=m.positionScreen.x;T=m.positionScreen.y;E(X,V,W,o,ea,T);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=p.uvs[0],ab(X,V,W,o,ea,T,ra[k].u,ra[k].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=u.matrixWorldInverse,pa.copy(p.vertexNormalsWorld[0]),wa=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,
 Da=-(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,pa.copy(p.vertexNormalsWorld[1]),Ea=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,Aa=-(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,pa.copy(p.vertexNormalsWorld[2]),Ca=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,Ga=-(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,ab(X,V,W,o,ea,T,wa,Da,Ea,Aa,Ca,Ga,v.envMap)}else v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):Oa(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&&
-(v.map.mapping instanceof THREE.UVMapping&&(ra=p.uvs[0],ab(X,V,W,o,ea,T,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map)),e(THREE.SubtractiveBlending)),ja?!v.wireframe&&v.shading==THREE.SmoothShading&&p.vertexNormalsWorld.length==3?(U.r=$.r=ga.r=ia.r,U.g=$.g=ga.g=ia.g,U.b=$.b=ga.b=ia.b,w(x,p.v1.positionWorld,p.vertexNormalsWorld[0],U),w(x,p.v2.positionWorld,p.vertexNormalsWorld[1],$),w(x,p.v3.positionWorld,p.vertexNormalsWorld[2],ga),U.r=Math.max(0,Math.min(v.color.r*U.r,1)),U.g=Math.max(0,
+(v.map.mapping instanceof THREE.UVMapping&&(ra=p.uvs[0],ab(X,V,W,o,ea,T,ra[k].u,ra[k].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map)),e(THREE.SubtractiveBlending)),ja?!v.wireframe&&v.shading==THREE.SmoothShading&&p.vertexNormalsWorld.length==3?(U.r=$.r=ga.r=ia.r,U.g=$.g=ga.g=ia.g,U.b=$.b=ga.b=ia.b,w(x,p.v1.positionWorld,p.vertexNormalsWorld[0],U),w(x,p.v2.positionWorld,p.vertexNormalsWorld[1],$),w(x,p.v3.positionWorld,p.vertexNormalsWorld[2],ga),U.r=Math.max(0,Math.min(v.color.r*U.r,1)),U.g=Math.max(0,
 Math.min(v.color.g*U.g,1)),U.b=Math.max(0,Math.min(v.color.b*U.b,1)),$.r=Math.max(0,Math.min(v.color.r*$.r,1)),$.g=Math.max(0,Math.min(v.color.g*$.g,1)),$.b=Math.max(0,Math.min(v.color.b*$.b,1)),ga.r=Math.max(0,Math.min(v.color.r*ga.r,1)),ga.g=Math.max(0,Math.min(v.color.g*ga.g,1)),ga.b=Math.max(0,Math.min(v.color.b*ga.b,1)),ka.r=($.r+ga.r)*0.5,ka.g=($.g+ga.g)*0.5,ka.b=($.b+ga.b)*0.5,ma=Ya(U,$,ga,ka),Va(X,V,W,o,ea,T,0,0,1,0,0,1,ma)):(oa.r=ia.r,oa.g=ia.g,oa.b=ia.b,w(x,p.centroidWorld,p.normalWorld,
-oa),da.r=Math.max(0,Math.min(v.color.r*oa.r,1)),da.g=Math.max(0,Math.min(v.color.g*oa.g,1)),da.b=Math.max(0,Math.min(v.color.b*oa.b,1)),v.wireframe?Na(da,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):Oa(da)):v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):Oa(v.color);else if(v instanceof THREE.MeshDepthMaterial)la=u.near,N=u.far,U.r=U.g=U.b=1-Ra(b.positionScreen.z,la,N),$.r=$.g=$.b=1-Ra(f.positionScreen.z,la,N),ga.r=ga.g=ga.b=1-Ra(h.positionScreen.z,
-la,N),ka.r=($.r+ga.r)*0.5,ka.g=($.g+ga.g)*0.5,ka.b=($.b+ga.b)*0.5,ma=Ya(U,$,ga,ka),Va(X,V,W,o,ea,T,0,0,1,0,0,1,ma);else if(v instanceof THREE.MeshNormalMaterial)da.r=Wa(p.normalWorld.x),da.g=Wa(p.normalWorld.y),da.b=Wa(p.normalWorld.z),v.wireframe?Na(da,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):Oa(da)}function C(b,f,h,m,n,t,v,p,x){k.info.render.vertices+=4;k.info.render.faces++;c(p.opacity);e(p.blending);if(p.map||p.envMap)B(b,f,m,0,1,3,v,p,x),B(n,h,t,1,2,3,v,p,x);else if(X=b.positionScreen.x,
-V=b.positionScreen.y,W=f.positionScreen.x,o=f.positionScreen.y,ea=h.positionScreen.x,T=h.positionScreen.y,na=m.positionScreen.x,aa=m.positionScreen.y,ha=n.positionScreen.x,ca=n.positionScreen.y,qa=t.positionScreen.x,fa=t.positionScreen.y,p instanceof THREE.MeshBasicMaterial)F(X,V,W,o,ea,T,na,aa),p.wireframe?Na(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Oa(p.color);else if(p instanceof THREE.MeshLambertMaterial)ja?!p.wireframe&&p.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==
+oa),da.r=Math.max(0,Math.min(v.color.r*oa.r,1)),da.g=Math.max(0,Math.min(v.color.g*oa.g,1)),da.b=Math.max(0,Math.min(v.color.b*oa.b,1)),v.wireframe?Na(da,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):Oa(da)):v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):Oa(v.color);else if(v instanceof THREE.MeshDepthMaterial)la=u.near,N=u.far,U.r=U.g=U.b=1-Ra(b.positionScreen.z,la,N),$.r=$.g=$.b=1-Ra(f.positionScreen.z,la,N),ga.r=ga.g=ga.b=1-Ra(m.positionScreen.z,
+la,N),ka.r=($.r+ga.r)*0.5,ka.g=($.g+ga.g)*0.5,ka.b=($.b+ga.b)*0.5,ma=Ya(U,$,ga,ka),Va(X,V,W,o,ea,T,0,0,1,0,0,1,ma);else if(v instanceof THREE.MeshNormalMaterial)da.r=Wa(p.normalWorld.x),da.g=Wa(p.normalWorld.y),da.b=Wa(p.normalWorld.z),v.wireframe?Na(da,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):Oa(da)}function C(b,f,m,k,n,t,v,p,x){h.info.render.vertices+=4;h.info.render.faces++;c(p.opacity);e(p.blending);if(p.map||p.envMap)B(b,f,k,0,1,3,v,p,x),B(n,m,t,1,2,3,v,p,x);else if(X=b.positionScreen.x,
+V=b.positionScreen.y,W=f.positionScreen.x,o=f.positionScreen.y,ea=m.positionScreen.x,T=m.positionScreen.y,na=k.positionScreen.x,aa=k.positionScreen.y,ha=n.positionScreen.x,ca=n.positionScreen.y,qa=t.positionScreen.x,fa=t.positionScreen.y,p instanceof THREE.MeshBasicMaterial)F(X,V,W,o,ea,T,na,aa),p.wireframe?Na(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Oa(p.color);else if(p instanceof THREE.MeshLambertMaterial)ja?!p.wireframe&&p.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==
 4?(U.r=$.r=ga.r=ka.r=ia.r,U.g=$.g=ga.g=ka.g=ia.g,U.b=$.b=ga.b=ka.b=ia.b,w(x,v.v1.positionWorld,v.vertexNormalsWorld[0],U),w(x,v.v2.positionWorld,v.vertexNormalsWorld[1],$),w(x,v.v4.positionWorld,v.vertexNormalsWorld[3],ga),w(x,v.v3.positionWorld,v.vertexNormalsWorld[2],ka),U.r=Math.max(0,Math.min(p.color.r*U.r,1)),U.g=Math.max(0,Math.min(p.color.g*U.g,1)),U.b=Math.max(0,Math.min(p.color.b*U.b,1)),$.r=Math.max(0,Math.min(p.color.r*$.r,1)),$.g=Math.max(0,Math.min(p.color.g*$.g,1)),$.b=Math.max(0,Math.min(p.color.b*
 $.b,1)),ga.r=Math.max(0,Math.min(p.color.r*ga.r,1)),ga.g=Math.max(0,Math.min(p.color.g*ga.g,1)),ga.b=Math.max(0,Math.min(p.color.b*ga.b,1)),ka.r=Math.max(0,Math.min(p.color.r*ka.r,1)),ka.g=Math.max(0,Math.min(p.color.g*ka.g,1)),ka.b=Math.max(0,Math.min(p.color.b*ka.b,1)),ma=Ya(U,$,ga,ka),E(X,V,W,o,na,aa),Va(X,V,W,o,na,aa,0,0,1,0,0,1,ma),E(ha,ca,ea,T,qa,fa),Va(ha,ca,ea,T,qa,fa,1,0,1,1,0,1,ma)):(oa.r=ia.r,oa.g=ia.g,oa.b=ia.b,w(x,v.centroidWorld,v.normalWorld,oa),da.r=Math.max(0,Math.min(p.color.r*oa.r,
 1)),da.g=Math.max(0,Math.min(p.color.g*oa.g,1)),da.b=Math.max(0,Math.min(p.color.b*oa.b,1)),F(X,V,W,o,ea,T,na,aa),p.wireframe?Na(da,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Oa(da)):(F(X,V,W,o,ea,T,na,aa),p.wireframe?Na(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Oa(p.color));else if(p instanceof THREE.MeshNormalMaterial)da.r=Wa(v.normalWorld.x),da.g=Wa(v.normalWorld.y),da.b=Wa(v.normalWorld.z),F(X,V,W,o,ea,T,na,aa),p.wireframe?Na(da,p.wireframeLinewidth,
-p.wireframeLinecap,p.wireframeLinejoin):Oa(da);else if(p instanceof THREE.MeshDepthMaterial)la=u.near,N=u.far,U.r=U.g=U.b=1-Ra(b.positionScreen.z,la,N),$.r=$.g=$.b=1-Ra(f.positionScreen.z,la,N),ga.r=ga.g=ga.b=1-Ra(m.positionScreen.z,la,N),ka.r=ka.g=ka.b=1-Ra(h.positionScreen.z,la,N),ma=Ya(U,$,ga,ka),E(X,V,W,o,na,aa),Va(X,V,W,o,na,aa,0,0,1,0,0,1,ma),E(ha,ca,ea,T,qa,fa),Va(ha,ca,ea,T,qa,fa,1,0,1,1,0,1,ma)}function E(b,e,c,f,k,h){v.beginPath();v.moveTo(b,e);v.lineTo(c,f);v.lineTo(k,h);v.lineTo(b,e);
-v.closePath()}function F(b,e,c,f,k,h,m,o){v.beginPath();v.moveTo(b,e);v.lineTo(c,f);v.lineTo(k,h);v.lineTo(m,o);v.lineTo(b,e);v.closePath()}function Na(b,e,c,k){if(G!=e)v.lineWidth=G=e;if(M!=c)v.lineCap=M=c;if(P!=k)v.lineJoin=P=k;f(b.getContextStyle());v.stroke();S.inflate(e*2)}function Oa(b){h(b.getContextStyle());v.fill()}function ab(b,e,c,f,k,m,o,n,p,t,u,Fa,x){if(x.image.width!=0){if(x.needsUpdate==!0||ua[x.id]==void 0){var w=x.wrapS==THREE.RepeatWrapping,y=x.wrapT==THREE.RepeatWrapping;ua[x.id]=
-v.createPattern(x.image,w&&y?"repeat":w&&!y?"repeat-x":!w&&y?"repeat-y":"no-repeat");x.needsUpdate=!1}h(ua[x.id]);var w=x.offset.x/x.repeat.x,y=x.offset.y/x.repeat.y,K=(x.image.width-1)*x.repeat.x,x=(x.image.height-1)*x.repeat.y,o=(o+w)*K,n=(n+y)*x,p=(p+w)*K,t=(t+y)*x,u=(u+w)*K,Fa=(Fa+y)*x;c-=b;f-=e;k-=b;m-=e;p-=o;t-=n;u-=o;Fa-=n;w=1/(p*Fa-u*t);x=(Fa*c-t*k)*w;t=(Fa*f-t*m)*w;c=(p*k-u*c)*w;f=(p*m-u*f)*w;b=b-x*o-c*n;e=e-t*o-f*n;v.save();v.transform(x,t,c,f,b,e);v.fill();v.restore()}}function Va(b,e,
-c,f,k,m,h,o,n,p,t,u,Fa){var x,w;x=Fa.width-1;w=Fa.height-1;h*=x;o*=w;n*=x;p*=w;t*=x;u*=w;c-=b;f-=e;k-=b;m-=e;n-=h;p-=o;t-=h;u-=o;w=1/(n*u-t*p);x=(u*c-p*k)*w;p=(u*f-p*m)*w;c=(n*k-t*c)*w;f=(n*m-t*f)*w;b=b-x*h-c*o;e=e-p*h-f*o;v.save();v.transform(x,p,c,f,b,e);v.clip();v.drawImage(Fa,0,0);v.restore()}function Ya(b,e,c,f){var k=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),m=~~(e.r*255),o=~~(e.g*255),e=~~(e.b*255),n=~~(c.r*255),p=~~(c.g*255),c=~~(c.b*255),t=~~(f.r*255),v=~~(f.g*255),f=~~(f.b*255);Ba[0]=k<0?
-0:k>255?255:k;Ba[1]=h<0?0:h>255?255:h;Ba[2]=b<0?0:b>255?255:b;Ba[4]=m<0?0:m>255?255:m;Ba[5]=o<0?0:o>255?255:o;Ba[6]=e<0?0:e>255?255:e;Ba[8]=n<0?0:n>255?255:n;Ba[9]=p<0?0:p>255?255:p;Ba[10]=c<0?0:c>255?255:c;Ba[12]=t<0?0:t>255?255:t;Ba[13]=v<0?0:v>255?255:v;Ba[14]=f<0?0:f>255?255:f;ya.putImageData(Ka,0,0);Y.drawImage(xa,0,0);return Ha}function Ra(b,e,c){b=(b-e)/(c-e);return b*b*(3-2*b)}function Wa(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Pa(b,e){var c=e.x-b.x,f=e.y-b.y,k=c*c+f*f;k!=0&&(k=1/Math.sqrt(k),
-c*=k,f*=k,e.x+=c,e.y+=f,b.x-=c,b.y-=f)}var Za,bb,ta,Ia,Qa,Xa,$a,za;this.autoClear?this.clear():v.setTransform(1,0,0,-1,t,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,u,this.sortElements);(ja=b.lights.length>0)&&p(b);Za=0;for(bb=m.length;Za<bb;Za++){ta=m[Za];S.empty();if(ta instanceof THREE.RenderableParticle){L=ta;L.x*=t;L.y*=x;Ia=0;for(Qa=ta.materials.length;Ia<Qa;)za=ta.materials[Ia++],za.opacity!=0&&y(L,ta,za,b)}else if(ta instanceof THREE.RenderableLine){if(L=ta.v1,A=ta.v2,
+p.wireframeLinecap,p.wireframeLinejoin):Oa(da);else if(p instanceof THREE.MeshDepthMaterial)la=u.near,N=u.far,U.r=U.g=U.b=1-Ra(b.positionScreen.z,la,N),$.r=$.g=$.b=1-Ra(f.positionScreen.z,la,N),ga.r=ga.g=ga.b=1-Ra(k.positionScreen.z,la,N),ka.r=ka.g=ka.b=1-Ra(m.positionScreen.z,la,N),ma=Ya(U,$,ga,ka),E(X,V,W,o,na,aa),Va(X,V,W,o,na,aa,0,0,1,0,0,1,ma),E(ha,ca,ea,T,qa,fa),Va(ha,ca,ea,T,qa,fa,1,0,1,1,0,1,ma)}function E(b,e,c,f,h,m){v.beginPath();v.moveTo(b,e);v.lineTo(c,f);v.lineTo(h,m);v.lineTo(b,e);
+v.closePath()}function F(b,e,c,f,h,m,k,o){v.beginPath();v.moveTo(b,e);v.lineTo(c,f);v.lineTo(h,m);v.lineTo(k,o);v.lineTo(b,e);v.closePath()}function Na(b,e,c,h){if(G!=e)v.lineWidth=G=e;if(M!=c)v.lineCap=M=c;if(P!=h)v.lineJoin=P=h;f(b.getContextStyle());v.stroke();S.inflate(e*2)}function Oa(b){m(b.getContextStyle());v.fill()}function ab(b,e,c,f,h,k,o,n,p,t,u,Fa,x){if(x.image.width!=0){if(x.needsUpdate==!0||ua[x.id]==void 0){var w=x.wrapS==THREE.RepeatWrapping,y=x.wrapT==THREE.RepeatWrapping;ua[x.id]=
+v.createPattern(x.image,w&&y?"repeat":w&&!y?"repeat-x":!w&&y?"repeat-y":"no-repeat");x.needsUpdate=!1}m(ua[x.id]);var w=x.offset.x/x.repeat.x,y=x.offset.y/x.repeat.y,K=(x.image.width-1)*x.repeat.x,x=(x.image.height-1)*x.repeat.y,o=(o+w)*K,n=(n+y)*x,p=(p+w)*K,t=(t+y)*x,u=(u+w)*K,Fa=(Fa+y)*x;c-=b;f-=e;h-=b;k-=e;p-=o;t-=n;u-=o;Fa-=n;w=1/(p*Fa-u*t);x=(Fa*c-t*h)*w;t=(Fa*f-t*k)*w;c=(p*h-u*c)*w;f=(p*k-u*f)*w;b=b-x*o-c*n;e=e-t*o-f*n;v.save();v.transform(x,t,c,f,b,e);v.fill();v.restore()}}function Va(b,e,
+c,f,h,m,k,o,n,p,t,u,Fa){var x,w;x=Fa.width-1;w=Fa.height-1;k*=x;o*=w;n*=x;p*=w;t*=x;u*=w;c-=b;f-=e;h-=b;m-=e;n-=k;p-=o;t-=k;u-=o;w=1/(n*u-t*p);x=(u*c-p*h)*w;p=(u*f-p*m)*w;c=(n*h-t*c)*w;f=(n*m-t*f)*w;b=b-x*k-c*o;e=e-p*k-f*o;v.save();v.transform(x,p,c,f,b,e);v.clip();v.drawImage(Fa,0,0);v.restore()}function Ya(b,e,c,f){var h=~~(b.r*255),k=~~(b.g*255),b=~~(b.b*255),m=~~(e.r*255),o=~~(e.g*255),e=~~(e.b*255),n=~~(c.r*255),p=~~(c.g*255),c=~~(c.b*255),t=~~(f.r*255),v=~~(f.g*255),f=~~(f.b*255);Ba[0]=h<0?
+0:h>255?255:h;Ba[1]=k<0?0:k>255?255:k;Ba[2]=b<0?0:b>255?255:b;Ba[4]=m<0?0:m>255?255:m;Ba[5]=o<0?0:o>255?255:o;Ba[6]=e<0?0:e>255?255:e;Ba[8]=n<0?0:n>255?255:n;Ba[9]=p<0?0:p>255?255:p;Ba[10]=c<0?0:c>255?255:c;Ba[12]=t<0?0:t>255?255:t;Ba[13]=v<0?0:v>255?255:v;Ba[14]=f<0?0:f>255?255:f;ya.putImageData(Ka,0,0);Y.drawImage(xa,0,0);return Ha}function Ra(b,e,c){b=(b-e)/(c-e);return b*b*(3-2*b)}function Wa(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Pa(b,e){var c=e.x-b.x,f=e.y-b.y,h=c*c+f*f;h!=0&&(h=1/Math.sqrt(h),
+c*=h,f*=h,e.x+=c,e.y+=f,b.x-=c,b.y-=f)}var Za,bb,ta,Ia,Qa,Xa,$a,za;this.autoClear?this.clear():v.setTransform(1,0,0,-1,t,x);h.info.render.vertices=0;h.info.render.faces=0;k=n.projectScene(b,u,this.sortElements);(ja=b.lights.length>0)&&p(b);Za=0;for(bb=k.length;Za<bb;Za++){ta=k[Za];S.empty();if(ta instanceof THREE.RenderableParticle){L=ta;L.x*=t;L.y*=x;Ia=0;for(Qa=ta.materials.length;Ia<Qa;)za=ta.materials[Ia++],za.opacity!=0&&y(L,ta,za,b)}else if(ta instanceof THREE.RenderableLine){if(L=ta.v1,A=ta.v2,
 L.positionScreen.x*=t,L.positionScreen.y*=x,A.positionScreen.x*=t,A.positionScreen.y*=x,S.addPoint(L.positionScreen.x,L.positionScreen.y),S.addPoint(A.positionScreen.x,A.positionScreen.y),K.intersects(S)){Ia=0;for(Qa=ta.materials.length;Ia<Qa;)za=ta.materials[Ia++],za.opacity!=0&&z(L,A,ta,za,b)}}else if(ta instanceof THREE.RenderableFace3){if(L=ta.v1,A=ta.v2,J=ta.v3,L.positionScreen.x*=t,L.positionScreen.y*=x,A.positionScreen.x*=t,A.positionScreen.y*=x,J.positionScreen.x*=t,J.positionScreen.y*=x,
 ta.overdraw&&(Pa(L.positionScreen,A.positionScreen),Pa(A.positionScreen,J.positionScreen),Pa(J.positionScreen,L.positionScreen)),S.add3Points(L.positionScreen.x,L.positionScreen.y,A.positionScreen.x,A.positionScreen.y,J.positionScreen.x,J.positionScreen.y),K.intersects(S)){Ia=0;for(Qa=ta.meshMaterials.length;Ia<Qa;)if(za=ta.meshMaterials[Ia++],za instanceof THREE.MeshFaceMaterial){Xa=0;for($a=ta.faceMaterials.length;Xa<$a;)(za=ta.faceMaterials[Xa++])&&za.opacity!=0&&B(L,A,J,0,1,2,ta,za,b)}else za.opacity!=
 0&&B(L,A,J,0,1,2,ta,za,b)}}else if(ta instanceof THREE.RenderableFace4&&(L=ta.v1,A=ta.v2,J=ta.v3,Z=ta.v4,L.positionScreen.x*=t,L.positionScreen.y*=x,A.positionScreen.x*=t,A.positionScreen.y*=x,J.positionScreen.x*=t,J.positionScreen.y*=x,Z.positionScreen.x*=t,Z.positionScreen.y*=x,I.positionScreen.copy(A.positionScreen),O.positionScreen.copy(Z.positionScreen),ta.overdraw&&(Pa(L.positionScreen,A.positionScreen),Pa(A.positionScreen,Z.positionScreen),Pa(Z.positionScreen,L.positionScreen),Pa(J.positionScreen,
 I.positionScreen),Pa(J.positionScreen,O.positionScreen)),S.addPoint(L.positionScreen.x,L.positionScreen.y),S.addPoint(A.positionScreen.x,A.positionScreen.y),S.addPoint(J.positionScreen.x,J.positionScreen.y),S.addPoint(Z.positionScreen.x,Z.positionScreen.y),K.intersects(S))){Ia=0;for(Qa=ta.meshMaterials.length;Ia<Qa;)if(za=ta.meshMaterials[Ia++],za instanceof THREE.MeshFaceMaterial){Xa=0;for($a=ta.faceMaterials.length;Xa<$a;)(za=ta.faceMaterials[Xa++])&&za.opacity!=0&&C(L,A,J,Z,I,O,ta,za,b)}else za.opacity!=
 0&&C(L,A,J,Z,I,O,ta,za,b)}R.addRectangle(S)}v.setTransform(1,0,0,1,0,0)}};
-THREE.SVGRenderer=function(){function b(b,e,c){var f,k,h,m;f=0;for(k=b.lights.length;f<k;f++)h=b.lights[f],h instanceof THREE.DirectionalLight?(m=e.normalWorld.dot(h.position)*h.intensity,m>0&&(c.r+=h.color.r*m,c.g+=h.color.g*m,c.b+=h.color.b*m)):h instanceof THREE.PointLight&&(Z.sub(h.position,e.centroidWorld),Z.normalize(),m=e.normalWorld.dot(Z)*h.intensity,m>0&&(c.r+=h.color.r*m,c.g+=h.color.g*m,c.b+=h.color.b*m))}function c(e,c,m,o,n,p){k.info.render.vertices+=3;k.info.render.faces++;X=f(V++);
-X.setAttribute("d","M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");n instanceof THREE.MeshBasicMaterial?G.copy(n.color):n instanceof THREE.MeshLambertMaterial?F?(M.r=P.r,M.g=P.g,M.b=P.b,b(p,o,M),G.r=Math.max(0,Math.min(n.color.r*M.r,1)),G.g=Math.max(0,Math.min(n.color.g*M.g,1)),G.b=Math.max(0,Math.min(n.color.b*M.b,1))):G.copy(n.color):n instanceof THREE.MeshDepthMaterial?(J=1-n.__2near/(n.__farPlusNear-
-o.z*n.__farMinusNear),G.setRGB(J,J,J)):n instanceof THREE.MeshNormalMaterial&&G.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));n.wireframe?X.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+n.wireframeLinewidth+"; stroke-opacity: "+n.opacity+"; stroke-linecap: "+n.wireframeLinecap+"; stroke-linejoin: "+n.wireframeLinejoin):X.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+n.opacity);u.appendChild(X)}function e(e,c,m,o,n,p,t){k.info.render.vertices+=
-4;k.info.render.faces++;X=f(V++);X.setAttribute("d","M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+o.positionScreen.x+","+o.positionScreen.y+"z");p instanceof THREE.MeshBasicMaterial?G.copy(p.color):p instanceof THREE.MeshLambertMaterial?F?(M.r=P.r,M.g=P.g,M.b=P.b,b(t,n,M),G.r=Math.max(0,Math.min(p.color.r*M.r,1)),G.g=Math.max(0,Math.min(p.color.g*M.g,1)),G.b=Math.max(0,Math.min(p.color.b*M.b,1))):
-G.copy(p.color):p instanceof THREE.MeshDepthMaterial?(J=1-p.__2near/(p.__farPlusNear-n.z*p.__farMinusNear),G.setRGB(J,J,J)):p instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));p.wireframe?X.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+p.wireframeLinewidth+"; stroke-opacity: "+p.opacity+"; stroke-linecap: "+p.wireframeLinecap+"; stroke-linejoin: "+p.wireframeLinejoin):X.setAttribute("style","fill: "+G.getContextStyle()+
-"; fill-opacity: "+p.opacity);u.appendChild(X)}function f(b){I[b]==null&&(I[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),o==0&&I[b].setAttribute("shape-rendering","crispEdges"));return I[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p,w,t,x,v,z,y,B,C=new THREE.Rectangle,E=new THREE.Rectangle,F=!1,G=new THREE.Color(16777215),M=new THREE.Color(16777215),P=new THREE.Color(0),
-L=new THREE.Color(0),A=new THREE.Color(0),J,Z=new THREE.Vector3,I=[],O=[],X,V,W,o=1;this.domElement=u;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":o=1;break;case "low":o=0}};this.setSize=function(b,e){p=b;w=e;t=p/2;x=w/2;u.setAttribute("viewBox",-t+" "+-x+" "+p+" "+w);u.setAttribute("width",p);u.setAttribute("height",w);C.set(-t,-x,t,x)};this.clear=function(){for(;u.childNodes.length>0;)u.removeChild(u.childNodes[0])};
-this.render=function(b,f){var h,p,w,G,I,M,J,U;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);W=V=0;if(F=b.lights.length>0){J=b.lights;P.setRGB(0,0,0);L.setRGB(0,0,0);A.setRGB(0,0,0);h=0;for(p=J.length;h<p;h++)w=J[h],G=w.color,w instanceof THREE.AmbientLight?(P.r+=G.r,P.g+=G.g,P.b+=G.b):w instanceof THREE.DirectionalLight?(L.r+=G.r,L.g+=G.g,L.b+=G.b):w instanceof THREE.PointLight&&(A.r+=G.r,A.g+=G.g,A.b+=G.b)}h=0;for(p=m.length;h<
-p;h++)if(J=m[h],E.empty(),J instanceof THREE.RenderableParticle){v=J;v.x*=t;v.y*=-x;w=0;for(G=J.materials.length;w<G;)w++}else if(J instanceof THREE.RenderableLine){if(v=J.v1,z=J.v2,v.positionScreen.x*=t,v.positionScreen.y*=-x,z.positionScreen.x*=t,z.positionScreen.y*=-x,E.addPoint(v.positionScreen.x,v.positionScreen.y),E.addPoint(z.positionScreen.x,z.positionScreen.y),C.intersects(E)){w=0;for(G=J.materials.length;w<G;)if((U=J.materials[w++])&&U.opacity!=0){I=v;M=z;var $=W++;O[$]==null&&(O[$]=document.createElementNS("http://www.w3.org/2000/svg",
-"line"),o==0&&O[$].setAttribute("shape-rendering","crispEdges"));X=O[$];X.setAttribute("x1",I.positionScreen.x);X.setAttribute("y1",I.positionScreen.y);X.setAttribute("x2",M.positionScreen.x);X.setAttribute("y2",M.positionScreen.y);U instanceof THREE.LineBasicMaterial&&(X.setAttribute("style","fill: none; stroke: "+U.color.getContextStyle()+"; stroke-width: "+U.linewidth+"; stroke-opacity: "+U.opacity+"; stroke-linecap: "+U.linecap+"; stroke-linejoin: "+U.linejoin),u.appendChild(X))}}}else if(J instanceof
+THREE.SVGRenderer=function(){function b(b,e,c){var f,h,k,m;f=0;for(h=b.lights.length;f<h;f++)k=b.lights[f],k instanceof THREE.DirectionalLight?(m=e.normalWorld.dot(k.position)*k.intensity,m>0&&(c.r+=k.color.r*m,c.g+=k.color.g*m,c.b+=k.color.b*m)):k instanceof THREE.PointLight&&(Z.sub(k.position,e.centroidWorld),Z.normalize(),m=e.normalWorld.dot(Z)*k.intensity,m>0&&(c.r+=k.color.r*m,c.g+=k.color.g*m,c.b+=k.color.b*m))}function c(e,c,k,o,n,t){h.info.render.vertices+=3;h.info.render.faces++;X=f(V++);
+X.setAttribute("d","M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");n instanceof THREE.MeshBasicMaterial?G.copy(n.color):n instanceof THREE.MeshLambertMaterial?F?(M.r=P.r,M.g=P.g,M.b=P.b,b(t,o,M),G.r=Math.max(0,Math.min(n.color.r*M.r,1)),G.g=Math.max(0,Math.min(n.color.g*M.g,1)),G.b=Math.max(0,Math.min(n.color.b*M.b,1))):G.copy(n.color):n instanceof THREE.MeshDepthMaterial?(J=1-n.__2near/(n.__farPlusNear-
+o.z*n.__farMinusNear),G.setRGB(J,J,J)):n instanceof THREE.MeshNormalMaterial&&G.setRGB(m(o.normalWorld.x),m(o.normalWorld.y),m(o.normalWorld.z));n.wireframe?X.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+n.wireframeLinewidth+"; stroke-opacity: "+n.opacity+"; stroke-linecap: "+n.wireframeLinecap+"; stroke-linejoin: "+n.wireframeLinejoin):X.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+n.opacity);p.appendChild(X)}function e(e,c,k,o,n,t,v){h.info.render.vertices+=
+4;h.info.render.faces++;X=f(V++);X.setAttribute("d","M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+" L "+o.positionScreen.x+","+o.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?G.copy(t.color):t instanceof THREE.MeshLambertMaterial?F?(M.r=P.r,M.g=P.g,M.b=P.b,b(v,n,M),G.r=Math.max(0,Math.min(t.color.r*M.r,1)),G.g=Math.max(0,Math.min(t.color.g*M.g,1)),G.b=Math.max(0,Math.min(t.color.b*M.b,1))):
+G.copy(t.color):t instanceof THREE.MeshDepthMaterial?(J=1-t.__2near/(t.__farPlusNear-n.z*t.__farMinusNear),G.setRGB(J,J,J)):t instanceof THREE.MeshNormalMaterial&&G.setRGB(m(n.normalWorld.x),m(n.normalWorld.y),m(n.normalWorld.z));t.wireframe?X.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):X.setAttribute("style","fill: "+G.getContextStyle()+
+"; fill-opacity: "+t.opacity);p.appendChild(X)}function f(b){I[b]==null&&(I[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),o==0&&I[b].setAttribute("shape-rendering","crispEdges"));return I[b]}function m(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var h=this,k=null,n=new THREE.Projector,p=document.createElementNS("http://www.w3.org/2000/svg","svg"),u,w,t,x,v,z,y,B,C=new THREE.Rectangle,E=new THREE.Rectangle,F=!1,G=new THREE.Color(16777215),M=new THREE.Color(16777215),P=new THREE.Color(0),
+L=new THREE.Color(0),A=new THREE.Color(0),J,Z=new THREE.Vector3,I=[],O=[],X,V,W,o=1;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":o=1;break;case "low":o=0}};this.setSize=function(b,e){u=b;w=e;t=u/2;x=w/2;p.setAttribute("viewBox",-t+" "+-x+" "+u+" "+w);p.setAttribute("width",u);p.setAttribute("height",w);C.set(-t,-x,t,x)};this.clear=function(){for(;p.childNodes.length>0;)p.removeChild(p.childNodes[0])};
+this.render=function(b,f){var m,u,w,G,I,M,J,U;this.autoClear&&this.clear();h.info.render.vertices=0;h.info.render.faces=0;k=n.projectScene(b,f,this.sortElements);W=V=0;if(F=b.lights.length>0){J=b.lights;P.setRGB(0,0,0);L.setRGB(0,0,0);A.setRGB(0,0,0);m=0;for(u=J.length;m<u;m++)w=J[m],G=w.color,w instanceof THREE.AmbientLight?(P.r+=G.r,P.g+=G.g,P.b+=G.b):w instanceof THREE.DirectionalLight?(L.r+=G.r,L.g+=G.g,L.b+=G.b):w instanceof THREE.PointLight&&(A.r+=G.r,A.g+=G.g,A.b+=G.b)}m=0;for(u=k.length;m<
+u;m++)if(J=k[m],E.empty(),J instanceof THREE.RenderableParticle){v=J;v.x*=t;v.y*=-x;w=0;for(G=J.materials.length;w<G;)w++}else if(J instanceof THREE.RenderableLine){if(v=J.v1,z=J.v2,v.positionScreen.x*=t,v.positionScreen.y*=-x,z.positionScreen.x*=t,z.positionScreen.y*=-x,E.addPoint(v.positionScreen.x,v.positionScreen.y),E.addPoint(z.positionScreen.x,z.positionScreen.y),C.intersects(E)){w=0;for(G=J.materials.length;w<G;)if((U=J.materials[w++])&&U.opacity!=0){I=v;M=z;var $=W++;O[$]==null&&(O[$]=document.createElementNS("http://www.w3.org/2000/svg",
+"line"),o==0&&O[$].setAttribute("shape-rendering","crispEdges"));X=O[$];X.setAttribute("x1",I.positionScreen.x);X.setAttribute("y1",I.positionScreen.y);X.setAttribute("x2",M.positionScreen.x);X.setAttribute("y2",M.positionScreen.y);U instanceof THREE.LineBasicMaterial&&(X.setAttribute("style","fill: none; stroke: "+U.color.getContextStyle()+"; stroke-width: "+U.linewidth+"; stroke-opacity: "+U.opacity+"; stroke-linecap: "+U.linecap+"; stroke-linejoin: "+U.linejoin),p.appendChild(X))}}}else if(J instanceof
 THREE.RenderableFace3){if(v=J.v1,z=J.v2,y=J.v3,v.positionScreen.x*=t,v.positionScreen.y*=-x,z.positionScreen.x*=t,z.positionScreen.y*=-x,y.positionScreen.x*=t,y.positionScreen.y*=-x,E.addPoint(v.positionScreen.x,v.positionScreen.y),E.addPoint(z.positionScreen.x,z.positionScreen.y),E.addPoint(y.positionScreen.x,y.positionScreen.y),C.intersects(E)){w=0;for(G=J.meshMaterials.length;w<G;)if(U=J.meshMaterials[w++],U instanceof THREE.MeshFaceMaterial){I=0;for(M=J.faceMaterials.length;I<M;)(U=J.faceMaterials[I++])&&
 U.opacity!=0&&c(v,z,y,J,U,b)}else U&&U.opacity!=0&&c(v,z,y,J,U,b)}}else if(J instanceof THREE.RenderableFace4&&(v=J.v1,z=J.v2,y=J.v3,B=J.v4,v.positionScreen.x*=t,v.positionScreen.y*=-x,z.positionScreen.x*=t,z.positionScreen.y*=-x,y.positionScreen.x*=t,y.positionScreen.y*=-x,B.positionScreen.x*=t,B.positionScreen.y*=-x,E.addPoint(v.positionScreen.x,v.positionScreen.y),E.addPoint(z.positionScreen.x,z.positionScreen.y),E.addPoint(y.positionScreen.x,y.positionScreen.y),E.addPoint(B.positionScreen.x,B.positionScreen.y),
 C.intersects(E))){w=0;for(G=J.meshMaterials.length;w<G;)if(U=J.meshMaterials[w++],U instanceof THREE.MeshFaceMaterial){I=0;for(M=J.faceMaterials.length;I<M;)(U=J.faceMaterials[I++])&&U.opacity!=0&&e(v,z,y,B,J,U,b)}else U&&U.opacity!=0&&e(v,z,y,B,J,U,b)}}};
@@ -201,7 +200,7 @@ morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\nuniform float morphTargetInflu
 default_vertex:"#ifndef USE_MORPHTARGETS\n#ifndef USE_SKINNING\ngl_Position = projectionMatrix * mvPosition;\n#endif\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform float shadowDarkness;\nuniform float shadowBias;\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif",
 shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_SOFT\nconst float xPixelOffset = 1.0 / SHADOWMAP_WIDTH;\nconst float yPixelOffset = 1.0 / SHADOWMAP_HEIGHT;\n#endif\nvec4 shadowColor = vec4( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nshadowCoord.z += shadowBias;\nif ( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec4( vec3( ( 1.0 - shadowDarkness * shadow ) ), 1.0 );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec4( vec3( shadowDarkness ), 1.0 );\n#endif\n}\n}\ngl_FragColor = gl_FragColor * shadowColor;\n#endif",
 shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif"};
-THREE.UniformsUtils={merge:function(b){var c,e,f,h={};for(c=0;c<b.length;c++)for(e in f=this.clone(b[c]),f)h[e]=f[e];return h},clone:function(b){var c,e,f,h={};for(c in b)for(e in h[c]={},b[c])f=b[c][e],h[c][e]=f instanceof THREE.Color||f instanceof THREE.Vector2||f instanceof THREE.Vector3||f instanceof THREE.Vector4||f instanceof THREE.Matrix4||f instanceof THREE.Texture?f.clone():f instanceof Array?f.slice():f;return h}};
+THREE.UniformsUtils={merge:function(b){var c,e,f,m={};for(c=0;c<b.length;c++)for(e in f=this.clone(b[c]),f)m[e]=f[e];return m},clone:function(b){var c,e,f,m={};for(c in b)for(e in m[c]={},b[c])f=b[c][e],m[c][e]=f instanceof THREE.Color||f instanceof THREE.Vector2||f instanceof THREE.Vector3||f instanceof THREE.Vector4||f instanceof THREE.Matrix4||f instanceof THREE.Texture?f.clone():f instanceof Array?f.slice():f;return m}};
 THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:0,texture:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:2,texture:null},envMap:{type:"t",value:1,texture:null},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:0.98},combine:{type:"i",value:0},morphTargetInfluences:{type:"f",value:0}},fog:{fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",
 value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{enableLighting:{type:"i",value:1},ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",
 value:1},map:{type:"t",value:0,texture:null},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:3,texture:[]},shadowMatrix:{type:"m4v",value:[]},shadowBias:{type:"f",value:0.0039},shadowDarkness:{type:"f",value:0.2}}};
@@ -220,44 +219,44 @@ THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.
 THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",
 THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,
 "}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask  = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};
-THREE.WebGLRenderer=function(b){function c(b,e,c){var f,k,h,m=b.vertices,n=m.length,p=b.colors,t=p.length,v=b.__vertexArray,u=b.__colorArray,w=b.__sortArray,x=b.__dirtyVertices,y=b.__dirtyColors,K=b.__webglCustomAttributes,z,S;if(K)for(z in K)K[z].offset=0;if(c.sortParticles){Da.multiplySelf(c.matrixWorld);for(f=0;f<n;f++)k=m[f].position,Ca.copy(k),Da.multiplyVector3(Ca),w[f]=[Ca.z,f];w.sort(function(b,e){return e[0]-b[0]});for(f=0;f<n;f++)k=m[w[f][1]].position,h=f*3,v[h]=k.x,v[h+1]=k.y,v[h+2]=k.z;
-for(f=0;f<t;f++)h=f*3,color=p[w[f][1]],u[h]=color.r,u[h+1]=color.g,u[h+2]=color.b;if(K)for(z in K){f=K[z];p=f.value.length;for(h=0;h<p;h++){index=w[h][1];t=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[t]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")S=f.value[index];f.size===2?(f.array[t]=S.x,f.array[t+1]=S.y):f.size===3?f.type==="c"?(f.array[t]=S.r,f.array[t+1]=S.g,f.array[t+2]=S.b):(f.array[t]=S.x,f.array[t+1]=S.y,f.array[t+2]=S.z):(f.array[t]=
-S.x,f.array[t+1]=S.y,f.array[t+2]=S.z,f.array[t+3]=S.w)}f.offset+=f.size}}}else{if(x)for(f=0;f<n;f++)k=m[f].position,h=f*3,v[h]=k.x,v[h+1]=k.y,v[h+2]=k.z;if(y)for(f=0;f<t;f++)color=p[f],h=f*3,u[h]=color.r,u[h+1]=color.g,u[h+2]=color.b;if(K)for(z in K)if(f=K[z],f.__original.needsUpdate){p=f.value.length;for(h=0;h<p;h++){t=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[t]=f.value[h]}else{if(f.boundTo===void 0||f.boundTo==="vertices")S=f.value[h];f.size===2?(f.array[t]=
+THREE.WebGLRenderer=function(b){function c(b,e,c){var f,h,k,m=b.vertices,n=m.length,p=b.colors,t=p.length,v=b.__vertexArray,u=b.__colorArray,w=b.__sortArray,x=b.__dirtyVertices,y=b.__dirtyColors,K=b.__webglCustomAttributes,z,S;if(K)for(z in K)K[z].offset=0;if(c.sortParticles){Da.multiplySelf(c.matrixWorld);for(f=0;f<n;f++)h=m[f].position,Ca.copy(h),Da.multiplyVector3(Ca),w[f]=[Ca.z,f];w.sort(function(b,e){return e[0]-b[0]});for(f=0;f<n;f++)h=m[w[f][1]].position,k=f*3,v[k]=h.x,v[k+1]=h.y,v[k+2]=h.z;
+for(f=0;f<t;f++)k=f*3,color=p[w[f][1]],u[k]=color.r,u[k+1]=color.g,u[k+2]=color.b;if(K)for(z in K){f=K[z];p=f.value.length;for(k=0;k<p;k++){index=w[k][1];t=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[t]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")S=f.value[index];f.size===2?(f.array[t]=S.x,f.array[t+1]=S.y):f.size===3?f.type==="c"?(f.array[t]=S.r,f.array[t+1]=S.g,f.array[t+2]=S.b):(f.array[t]=S.x,f.array[t+1]=S.y,f.array[t+2]=S.z):(f.array[t]=
+S.x,f.array[t+1]=S.y,f.array[t+2]=S.z,f.array[t+3]=S.w)}f.offset+=f.size}}}else{if(x)for(f=0;f<n;f++)h=m[f].position,k=f*3,v[k]=h.x,v[k+1]=h.y,v[k+2]=h.z;if(y)for(f=0;f<t;f++)color=p[f],k=f*3,u[k]=color.r,u[k+1]=color.g,u[k+2]=color.b;if(K)for(z in K)if(f=K[z],f.__original.needsUpdate){p=f.value.length;for(k=0;k<p;k++){t=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[t]=f.value[k]}else{if(f.boundTo===void 0||f.boundTo==="vertices")S=f.value[k];f.size===2?(f.array[t]=
 S.x,f.array[t+1]=S.y):f.size===3?f.type==="c"?(f.array[t]=S.r,f.array[t+1]=S.g,f.array[t+2]=S.b):(f.array[t]=S.x,f.array[t+1]=S.y,f.array[t+2]=S.z):(f.array[t]=S.x,f.array[t+1]=S.y,f.array[t+2]=S.z,f.array[t+3]=S.w)}f.offset+=f.size}}}if(x||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,v,e);if(y||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,u,e);if(K)for(z in K)if(f=K[z],f.__original.needsUpdate||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,
-f.buffer),o.bufferData(o.ARRAY_BUFFER,f.array,e)}function e(b,e,c,f,k){f.program||W.initMaterial(f,e,c,k);if(f.morphTargets&&!k.__webglMorphTargetInfluences){k.__webglMorphTargetInfluences=new Float32Array(W.maxMorphTargets);for(var h=0,m=W.maxMorphTargets;h<m;h++)k.__webglMorphTargetInfluences[h]=0}var n=!1,h=f.program,m=h.uniforms,p=f.uniforms;h!=T&&(o.useProgram(h),T=h,n=!0);if(f.id!=aa)aa=f.id,n=!0;if(n){o.uniformMatrix4fv(m.projectionMatrix,!1,Ea);if(c&&f.fog)if(p.fogColor.value=c.color,c instanceof
-THREE.Fog)p.fogNear.value=c.near,p.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)p.fogDensity.value=c.density;if(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f.lights){for(var t,v,u=0,w=0,x=0,y,S,z,B=Ga,C=B.directional.colors,R=B.directional.positions,E=B.point.colors,F=B.point.positions,G=B.point.distances,la=0,L=0,c=t=z=0,n=e.length;c<n;c++)if(t=e[c],v=t.color,y=t.position,S=t.intensity,z=t.distance,t instanceof THREE.AmbientLight)u+=v.r,w+=v.g,x+=v.b;else if(t instanceof
-THREE.DirectionalLight)z=la*3,C[z]=v.r*S,C[z+1]=v.g*S,C[z+2]=v.b*S,R[z]=y.x,R[z+1]=y.y,R[z+2]=y.z,la+=1;else if(t instanceof THREE.SpotLight)z=la*3,C[z]=v.r*S,C[z+1]=v.g*S,C[z+2]=v.b*S,v=1/y.length(),R[z]=y.x*v,R[z+1]=y.y*v,R[z+2]=y.z*v,la+=1;else if(t instanceof THREE.PointLight)t=L*3,E[t]=v.r*S,E[t+1]=v.g*S,E[t+2]=v.b*S,F[t]=y.x,F[t+1]=y.y,F[t+2]=y.z,G[L]=z,L+=1;c=la*3;for(n=C.length;c<n;c++)C[c]=0;c=L*3;for(n=E.length;c<n;c++)E[c]=0;B.point.length=L;B.directional.length=la;B.ambient[0]=u;B.ambient[1]=
-w;B.ambient[2]=x;e=Ga;p.enableLighting.value=e.directional.length+e.point.length;p.ambientLightColor.value=e.ambient;p.directionalLightColor.value=e.directional.colors;p.directionalLightDirection.value=e.directional.positions;p.pointLightColor.value=e.point.colors;p.pointLightPosition.value=e.point.positions;p.pointLightDistance.value=e.point.distances}if(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial)p.diffuse.value=f.color,p.opacity.value=
-f.opacity,(p.map.texture=f.map)&&p.offsetRepeat.value.set(f.map.offset.x,f.map.offset.y,f.map.repeat.x,f.map.repeat.y),p.lightMap.texture=f.lightMap,p.envMap.texture=f.envMap,p.reflectivity.value=f.reflectivity,p.refractionRatio.value=f.refractionRatio,p.combine.value=f.combine,p.useRefract.value=f.envMap&&f.envMap.mapping instanceof THREE.CubeRefractionMapping;if(f instanceof THREE.LineBasicMaterial)p.diffuse.value=f.color,p.opacity.value=f.opacity;else if(f instanceof THREE.ParticleBasicMaterial)p.psColor.value=
-f.color,p.opacity.value=f.opacity,p.size.value=f.size,p.scale.value=K.height/2,p.map.texture=f.map;else if(f instanceof THREE.MeshPhongMaterial)p.ambient.value=f.ambient,p.specular.value=f.specular,p.shininess.value=f.shininess;else if(f instanceof THREE.MeshDepthMaterial)p.mNear.value=b.near,p.mFar.value=b.far,p.opacity.value=f.opacity;else if(f instanceof THREE.MeshNormalMaterial)p.opacity.value=f.opacity;if(k.receiveShadow&&!f._shadowPass&&p.shadowMatrix){for(e=0;e<pa.length;e++)p.shadowMatrix.value[e]=
-pa[e],p.shadowMap.texture[e]=W.shadowMap[e];p.shadowDarkness.value=W.shadowMapDarkness;p.shadowBias.value=W.shadowMapBias}e=f.uniformsList;p=0;for(c=e.length;p<c;p++)if(w=h.uniforms[e[p][1]])if(u=e[p][0],x=u.type,n=u.value,x=="i")o.uniform1i(w,n);else if(x=="f")o.uniform1f(w,n);else if(x=="v2")o.uniform2f(w,n.x,n.y);else if(x=="v3")o.uniform3f(w,n.x,n.y,n.z);else if(x=="v4")o.uniform4f(w,n.x,n.y,n.z,n.w);else if(x=="c")o.uniform3f(w,n.r,n.g,n.b);else if(x=="fv1")o.uniform1fv(w,n);else if(x=="fv")o.uniform3fv(w,
+f.buffer),o.bufferData(o.ARRAY_BUFFER,f.array,e)}function e(b,e,c,f,h){f.program||W.initMaterial(f,e,c,h);if(f.morphTargets&&!h.__webglMorphTargetInfluences){h.__webglMorphTargetInfluences=new Float32Array(W.maxMorphTargets);for(var k=0,m=W.maxMorphTargets;k<m;k++)h.__webglMorphTargetInfluences[k]=0}var n=!1,k=f.program,m=k.uniforms,t=f.uniforms;k!=T&&(o.useProgram(k),T=k,n=!0);if(f.id!=aa)aa=f.id,n=!0;if(n){o.uniformMatrix4fv(m.projectionMatrix,!1,Ea);if(c&&f.fog)if(t.fogColor.value=c.color,c instanceof
+THREE.Fog)t.fogNear.value=c.near,t.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)t.fogDensity.value=c.density;if(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f.lights){for(var p,v,u=0,w=0,x=0,y,S,z,B=Ga,C=B.directional.colors,R=B.directional.positions,E=B.point.colors,F=B.point.positions,G=B.point.distances,la=0,L=0,c=p=z=0,n=e.length;c<n;c++)if(p=e[c],v=p.color,y=p.position,S=p.intensity,z=p.distance,p instanceof THREE.AmbientLight)u+=v.r,w+=v.g,x+=v.b;else if(p instanceof
+THREE.DirectionalLight)z=la*3,C[z]=v.r*S,C[z+1]=v.g*S,C[z+2]=v.b*S,R[z]=y.x,R[z+1]=y.y,R[z+2]=y.z,la+=1;else if(p instanceof THREE.SpotLight)z=la*3,C[z]=v.r*S,C[z+1]=v.g*S,C[z+2]=v.b*S,v=1/y.length(),R[z]=y.x*v,R[z+1]=y.y*v,R[z+2]=y.z*v,la+=1;else if(p instanceof THREE.PointLight)p=L*3,E[p]=v.r*S,E[p+1]=v.g*S,E[p+2]=v.b*S,F[p]=y.x,F[p+1]=y.y,F[p+2]=y.z,G[L]=z,L+=1;c=la*3;for(n=C.length;c<n;c++)C[c]=0;c=L*3;for(n=E.length;c<n;c++)E[c]=0;B.point.length=L;B.directional.length=la;B.ambient[0]=u;B.ambient[1]=
+w;B.ambient[2]=x;e=Ga;t.enableLighting.value=e.directional.length+e.point.length;t.ambientLightColor.value=e.ambient;t.directionalLightColor.value=e.directional.colors;t.directionalLightDirection.value=e.directional.positions;t.pointLightColor.value=e.point.colors;t.pointLightPosition.value=e.point.positions;t.pointLightDistance.value=e.point.distances}if(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial)t.diffuse.value=f.color,t.opacity.value=
+f.opacity,(t.map.texture=f.map)&&t.offsetRepeat.value.set(f.map.offset.x,f.map.offset.y,f.map.repeat.x,f.map.repeat.y),t.lightMap.texture=f.lightMap,t.envMap.texture=f.envMap,t.reflectivity.value=f.reflectivity,t.refractionRatio.value=f.refractionRatio,t.combine.value=f.combine,t.useRefract.value=f.envMap&&f.envMap.mapping instanceof THREE.CubeRefractionMapping;if(f instanceof THREE.LineBasicMaterial)t.diffuse.value=f.color,t.opacity.value=f.opacity;else if(f instanceof THREE.ParticleBasicMaterial)t.psColor.value=
+f.color,t.opacity.value=f.opacity,t.size.value=f.size,t.scale.value=K.height/2,t.map.texture=f.map;else if(f instanceof THREE.MeshPhongMaterial)t.ambient.value=f.ambient,t.specular.value=f.specular,t.shininess.value=f.shininess;else if(f instanceof THREE.MeshDepthMaterial)t.mNear.value=b.near,t.mFar.value=b.far,t.opacity.value=f.opacity;else if(f instanceof THREE.MeshNormalMaterial)t.opacity.value=f.opacity;if(h.receiveShadow&&!f._shadowPass&&t.shadowMatrix){for(e=0;e<pa.length;e++)t.shadowMatrix.value[e]=
+pa[e],t.shadowMap.texture[e]=W.shadowMap[e];t.shadowDarkness.value=W.shadowMapDarkness;t.shadowBias.value=W.shadowMapBias}e=f.uniformsList;t=0;for(c=e.length;t<c;t++)if(w=k.uniforms[e[t][1]])if(u=e[t][0],x=u.type,n=u.value,x=="i")o.uniform1i(w,n);else if(x=="f")o.uniform1f(w,n);else if(x=="v2")o.uniform2f(w,n.x,n.y);else if(x=="v3")o.uniform3f(w,n.x,n.y,n.z);else if(x=="v4")o.uniform4f(w,n.x,n.y,n.z,n.w);else if(x=="c")o.uniform3f(w,n.r,n.g,n.b);else if(x=="fv1")o.uniform1fv(w,n);else if(x=="fv")o.uniform3fv(w,
 n);else if(x=="v3v"){if(!u._array)u._array=new Float32Array(3*n.length);x=0;for(y=n.length;x<y;x++)B=x*3,u._array[B]=n[x].x,u._array[B+1]=n[x].y,u._array[B+2]=n[x].z;o.uniform3fv(w,u._array)}else if(x=="m4"){if(!u._array)u._array=new Float32Array(16);n.flattenToArray(u._array);o.uniformMatrix4fv(w,!1,u._array)}else if(x=="m4v"){if(!u._array)u._array=new Float32Array(16*n.length);x=0;for(y=n.length;x<y;x++)n[x].flattenToArrayOffset(u._array,x*16);o.uniformMatrix4fv(w,!1,u._array)}else if(x=="t"){if(o.uniform1i(w,
 n),w=u.texture)if(w.image instanceof Array&&w.image.length==6){if(u=w,u.image.length==6)if(u.needsUpdate){if(!u.image.__webglTextureCube)u.image.__webglTextureCube=o.createTexture();o.activeTexture(o.TEXTURE0+n);o.bindTexture(o.TEXTURE_CUBE_MAP,u.image.__webglTextureCube);for(n=0;n<6;n++)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,u.image[n]);A(o.TEXTURE_CUBE_MAP,u,u.image[0]);u.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+n),o.bindTexture(o.TEXTURE_CUBE_MAP,u.image.__webglTextureCube)}else w instanceof
 THREE.WebGLRenderTargetCube?(u=w,o.activeTexture(o.TEXTURE0+n),o.bindTexture(o.TEXTURE_CUBE_MAP,u.__webglTexture)):J(w,n)}else if(x=="tv"){if(!u._array){u._array=[];x=0;for(y=u.texture.length;x<y;x++)u._array[x]=n+x}o.uniform1iv(w,u._array);x=0;for(y=u.texture.length;x<y;x++)(w=u.texture[x])&&J(w,u._array[x])}(f instanceof THREE.ShaderMaterial||f instanceof THREE.MeshPhongMaterial||f.envMap)&&m.cameraPosition!==null&&o.uniform3f(m.cameraPosition,b.position.x,b.position.y,b.position.z);(f instanceof
-THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.ShaderMaterial||f.skinning)&&m.viewMatrix!==null&&o.uniformMatrix4fv(m.viewMatrix,!1,Aa);f.skinning&&(o.uniformMatrix4fv(m.cameraInverseMatrix,!1,Aa),o.uniformMatrix4fv(m.boneGlobalMatrices,!1,k.boneMatrices))}o.uniformMatrix4fv(m.modelViewMatrix,!1,k._modelViewMatrixArray);m.normalMatrix&&o.uniformMatrix3fv(m.normalMatrix,!1,k._normalMatrixArray);(f instanceof THREE.ShaderMaterial||f.envMap||f.skinning||k.receiveShadow)&&
-m.objectMatrix!==null&&o.uniformMatrix4fv(m.objectMatrix,!1,k._objectMatrixArray);return h}function f(b,c,f,k,h,m){if(k.opacity!=0){var n,f=e(b,c,f,k,m),b=f.attributes,c=!1,f=h.id*16777215+f.id;f!=ha&&(ha=f,c=!0);if(!k.morphTargets&&b.position>=0)c&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(b.position,3,o.FLOAT,!1,0,0));else if(m.morphTargetBase){f=k.program.attributes;m.morphTargetBase!==-1?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[m.morphTargetBase]),
-o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0)):f.position>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var p=0,t=m.morphTargetForcedOrder,u=m.morphTargetInfluences;p<k.numSupportedMorphTargets&&p<t.length;)o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[t[p]]),o.vertexAttribPointer(f["morphTarget"+p],3,o.FLOAT,!1,0,0),m.__webglMorphTargetInfluences[p]=u[t[p]],p++;else{var t=[],v=-1,
-x=0,u=m.morphTargetInfluences,w,y=u.length,p=0;for(m.morphTargetBase!==-1&&(t[m.morphTargetBase]=!0);p<k.numSupportedMorphTargets;){for(w=0;w<y;w++)!t[w]&&u[w]>v&&(x=w,v=u[x]);o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[x]);o.vertexAttribPointer(f["morphTarget"+p],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[p]=v;t[x]=1;v=-1;p++}}k.program.uniforms.morphTargetInfluences!==null&&o.uniform1fv(k.program.uniforms.morphTargetInfluences,m.__webglMorphTargetInfluences)}if(c){if(h.__webglCustomAttributes)for(n in h.__webglCustomAttributes)b[n]>=
-0&&(f=h.__webglCustomAttributes[n],o.bindBuffer(o.ARRAY_BUFFER,f.buffer),o.vertexAttribPointer(b[n],f.size,o.FLOAT,!1,0,0));b.color>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglColorBuffer),o.vertexAttribPointer(b.color,3,o.FLOAT,!1,0,0));b.normal>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglNormalBuffer),o.vertexAttribPointer(b.normal,3,o.FLOAT,!1,0,0));b.tangent>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglTangentBuffer),o.vertexAttribPointer(b.tangent,4,o.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(o.bindBuffer(o.ARRAY_BUFFER,
-h.__webglUVBuffer),o.vertexAttribPointer(b.uv,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv)):o.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglUV2Buffer),o.vertexAttribPointer(b.uv2,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv2)):o.disableVertexAttribArray(b.uv2));k.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinVertexABuffer),o.vertexAttribPointer(b.skinVertexA,4,
-o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),o.vertexAttribPointer(b.skinVertexB,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),o.vertexAttribPointer(b.skinIndex,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),o.vertexAttribPointer(b.skinWeight,4,o.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(k.wireframe?(o.lineWidth(k.wireframeLinewidth),c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),o.drawElements(o.LINES,h.__webglLineCount,
-o.UNSIGNED_SHORT,0)):(c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),o.drawElements(o.TRIANGLES,h.__webglFaceCount,o.UNSIGNED_SHORT,0)),W.info.render.calls++,W.info.render.vertices+=h.__webglFaceCount,W.info.render.faces+=h.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?o.LINE_STRIP:o.LINES,o.lineWidth(k.linewidth),o.drawArrays(m,0,h.__webglLineCount),W.info.render.calls++):m instanceof THREE.ParticleSystem?(o.drawArrays(o.POINTS,0,h.__webglParticleCount),W.info.render.calls++):
-m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP,0,h.__webglVertexCount),W.info.render.calls++)}}function h(b,e,c){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=o.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=o.createBuffer();b.hasPos&&(o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,b.positionArray,o.DYNAMIC_DRAW),o.enableVertexAttribArray(e.attributes.position),o.vertexAttribPointer(e.attributes.position,3,o.FLOAT,!1,0,0));if(b.hasNormal){o.bindBuffer(o.ARRAY_BUFFER,
-b.__webglNormalBuffer);if(c==THREE.FlatShading){var f,h,k,m,n,p,t,u,v,x,w=b.count*3;for(x=0;x<w;x+=9)c=b.normalArray,f=c[x],h=c[x+1],k=c[x+2],m=c[x+3],p=c[x+4],u=c[x+5],n=c[x+6],t=c[x+7],v=c[x+8],f=(f+m+n)/3,h=(h+p+t)/3,k=(k+u+v)/3,c[x]=f,c[x+1]=h,c[x+2]=k,c[x+3]=f,c[x+4]=h,c[x+5]=k,c[x+6]=f,c[x+7]=h,c[x+8]=k}o.bufferData(o.ARRAY_BUFFER,b.normalArray,o.DYNAMIC_DRAW);o.enableVertexAttribArray(e.attributes.normal);o.vertexAttribPointer(e.attributes.normal,3,o.FLOAT,!1,0,0)}o.drawArrays(o.TRIANGLES,
-0,b.count);b.count=0}function k(b){if(qa!=b.doubleSided)b.doubleSided?o.disable(o.CULL_FACE):o.enable(o.CULL_FACE),qa=b.doubleSided;if(fa!=b.flipSided)b.flipSided?o.frontFace(o.CW):o.frontFace(o.CCW),fa=b.flipSided}function m(b){U!=b&&(b?o.enable(o.DEPTH_TEST):o.disable(o.DEPTH_TEST),U=b)}function n(b){$!=b&&(o.depthMask(b),$=b)}function u(b,e,c){ga!=b&&(b?o.enable(o.POLYGON_OFFSET_FILL):o.disable(o.POLYGON_OFFSET_FILL),ga=b);if(b&&(ka!=e||ua!=c))o.polygonOffset(e,c),ka=e,ua=c}function p(b){wa[0].set(b.n41-
+THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.ShaderMaterial||f.skinning)&&m.viewMatrix!==null&&o.uniformMatrix4fv(m.viewMatrix,!1,Aa);f.skinning&&(o.uniformMatrix4fv(m.cameraInverseMatrix,!1,Aa),o.uniformMatrix4fv(m.boneGlobalMatrices,!1,h.boneMatrices))}o.uniformMatrix4fv(m.modelViewMatrix,!1,h._modelViewMatrixArray);m.normalMatrix&&o.uniformMatrix3fv(m.normalMatrix,!1,h._normalMatrixArray);(f instanceof THREE.ShaderMaterial||f.envMap||f.skinning||h.receiveShadow)&&
+m.objectMatrix!==null&&o.uniformMatrix4fv(m.objectMatrix,!1,h._objectMatrixArray);return k}function f(b,c,f,h,k,m){if(h.opacity!=0){var n,f=e(b,c,f,h,m),b=f.attributes,c=!1,f=k.id*16777215+f.id;f!=ha&&(ha=f,c=!0);if(!h.morphTargets&&b.position>=0)c&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer),o.vertexAttribPointer(b.position,3,o.FLOAT,!1,0,0));else if(m.morphTargetBase){f=h.program.attributes;m.morphTargetBase!==-1?(o.bindBuffer(o.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[m.morphTargetBase]),
+o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0)):f.position>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var t=0,p=m.morphTargetForcedOrder,u=m.morphTargetInfluences;t<h.numSupportedMorphTargets&&t<p.length;)o.bindBuffer(o.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[p[t]]),o.vertexAttribPointer(f["morphTarget"+t],3,o.FLOAT,!1,0,0),m.__webglMorphTargetInfluences[t]=u[p[t]],t++;else{var p=[],v=-1,
+x=0,u=m.morphTargetInfluences,w,y=u.length,t=0;for(m.morphTargetBase!==-1&&(p[m.morphTargetBase]=!0);t<h.numSupportedMorphTargets;){for(w=0;w<y;w++)!p[w]&&u[w]>v&&(x=w,v=u[x]);o.bindBuffer(o.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[x]);o.vertexAttribPointer(f["morphTarget"+t],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[t]=v;p[x]=1;v=-1;t++}}h.program.uniforms.morphTargetInfluences!==null&&o.uniform1fv(h.program.uniforms.morphTargetInfluences,m.__webglMorphTargetInfluences)}if(c){if(k.__webglCustomAttributes)for(n in k.__webglCustomAttributes)b[n]>=
+0&&(f=k.__webglCustomAttributes[n],o.bindBuffer(o.ARRAY_BUFFER,f.buffer),o.vertexAttribPointer(b[n],f.size,o.FLOAT,!1,0,0));b.color>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer),o.vertexAttribPointer(b.color,3,o.FLOAT,!1,0,0));b.normal>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglNormalBuffer),o.vertexAttribPointer(b.normal,3,o.FLOAT,!1,0,0));b.tangent>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglTangentBuffer),o.vertexAttribPointer(b.tangent,4,o.FLOAT,!1,0,0));b.uv>=0&&(k.__webglUVBuffer?(o.bindBuffer(o.ARRAY_BUFFER,
+k.__webglUVBuffer),o.vertexAttribPointer(b.uv,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv)):o.disableVertexAttribArray(b.uv));b.uv2>=0&&(k.__webglUV2Buffer?(o.bindBuffer(o.ARRAY_BUFFER,k.__webglUV2Buffer),o.vertexAttribPointer(b.uv2,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv2)):o.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinVertexABuffer),o.vertexAttribPointer(b.skinVertexA,4,
+o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinVertexBBuffer),o.vertexAttribPointer(b.skinVertexB,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinIndicesBuffer),o.vertexAttribPointer(b.skinIndex,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinWeightsBuffer),o.vertexAttribPointer(b.skinWeight,4,o.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(h.wireframe?(o.lineWidth(h.wireframeLinewidth),c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,k.__webglLineBuffer),o.drawElements(o.LINES,k.__webglLineCount,
+o.UNSIGNED_SHORT,0)):(c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,k.__webglFaceBuffer),o.drawElements(o.TRIANGLES,k.__webglFaceCount,o.UNSIGNED_SHORT,0)),W.info.render.calls++,W.info.render.vertices+=k.__webglFaceCount,W.info.render.faces+=k.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?o.LINE_STRIP:o.LINES,o.lineWidth(h.linewidth),o.drawArrays(m,0,k.__webglLineCount),W.info.render.calls++):m instanceof THREE.ParticleSystem?(o.drawArrays(o.POINTS,0,k.__webglParticleCount),W.info.render.calls++):
+m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP,0,k.__webglVertexCount),W.info.render.calls++)}}function m(b,e,c){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=o.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=o.createBuffer();b.hasPos&&(o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,b.positionArray,o.DYNAMIC_DRAW),o.enableVertexAttribArray(e.attributes.position),o.vertexAttribPointer(e.attributes.position,3,o.FLOAT,!1,0,0));if(b.hasNormal){o.bindBuffer(o.ARRAY_BUFFER,
+b.__webglNormalBuffer);if(c==THREE.FlatShading){var f,h,k,m,n,t,p,u,v,x,w=b.count*3;for(x=0;x<w;x+=9)c=b.normalArray,f=c[x],h=c[x+1],k=c[x+2],m=c[x+3],t=c[x+4],u=c[x+5],n=c[x+6],p=c[x+7],v=c[x+8],f=(f+m+n)/3,h=(h+t+p)/3,k=(k+u+v)/3,c[x]=f,c[x+1]=h,c[x+2]=k,c[x+3]=f,c[x+4]=h,c[x+5]=k,c[x+6]=f,c[x+7]=h,c[x+8]=k}o.bufferData(o.ARRAY_BUFFER,b.normalArray,o.DYNAMIC_DRAW);o.enableVertexAttribArray(e.attributes.normal);o.vertexAttribPointer(e.attributes.normal,3,o.FLOAT,!1,0,0)}o.drawArrays(o.TRIANGLES,
+0,b.count);b.count=0}function h(b){if(qa!=b.doubleSided)b.doubleSided?o.disable(o.CULL_FACE):o.enable(o.CULL_FACE),qa=b.doubleSided;if(fa!=b.flipSided)b.flipSided?o.frontFace(o.CW):o.frontFace(o.CCW),fa=b.flipSided}function k(b){U!=b&&(b?o.enable(o.DEPTH_TEST):o.disable(o.DEPTH_TEST),U=b)}function n(b){$!=b&&(o.depthMask(b),$=b)}function p(b,e,c){ga!=b&&(b?o.enable(o.POLYGON_OFFSET_FILL):o.disable(o.POLYGON_OFFSET_FILL),ga=b);if(b&&(ka!=e||ua!=c))o.polygonOffset(e,c),ka=e,ua=c}function u(b){wa[0].set(b.n41-
 b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);wa[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);wa[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);wa[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);wa[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);wa[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34);for(var e,b=0;b<6;b++)e=wa[b],e.divideScalar(Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z))}function w(b){for(var e=b.matrixWorld,c=-b.geometry.boundingSphere.radius*Math.max(b.scale.x,
 Math.max(b.scale.y,b.scale.z)),f=0;f<6;f++)if(b=wa[f].x*e.n14+wa[f].y*e.n24+wa[f].z*e.n34+wa[f].w,b<=c)return!1;return!0}function t(b,e){b.list[b.count]=e;b.count+=1}function x(b){var e,c,f=b.object,h=b.opaque,k=b.transparent;k.count=0;b=h.count=0;for(e=f.materials.length;b<e;b++)c=f.materials[b],c.transparent?t(k,c):t(h,c)}function v(b){var e,c,f,h,k=b.object,m=b.buffer,n=b.opaque,o=b.transparent;o.count=0;b=n.count=0;for(f=k.materials.length;b<f;b++)if(e=k.materials[b],e instanceof THREE.MeshFaceMaterial){e=
-0;for(c=m.materials.length;e<c;e++)(h=m.materials[e])&&(h.transparent?t(o,h):t(n,h))}else(h=e)&&(h.transparent?t(o,h):t(n,h))}function z(b,e){return e.z-b.z}function y(b){var c,n,t,u=0,v,x,y,K,z=b.lights;va||(va=new THREE.Camera(W.shadowCameraFov,W.shadowMapWidth/W.shadowMapHeight,W.shadowCameraNear,W.shadowCameraFar));c=0;for(n=z.length;c<n;c++)if(t=z[c],t instanceof THREE.SpotLight&&t.castShadow){aa=-1;W.shadowMap[u]||(W.shadowMap[u]=new THREE.WebGLRenderTarget(W.shadowMapWidth,W.shadowMapHeight,
-{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));pa[u]||(pa[u]=new THREE.Matrix4);v=W.shadowMap[u];x=pa[u];va.position.copy(t.position);va.target.position.copy(t.target.position);va.update(void 0,!0);b.update(void 0,!1,va);x.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);x.multiplySelf(va.projectionMatrix);x.multiplySelf(va.matrixWorldInverse);va.matrixWorldInverse.flattenToArray(Aa);va.projectionMatrix.flattenToArray(Ea);Da.multiply(va.projectionMatrix,va.matrixWorldInverse);
-p(Da);W.initWebGLObjects(b);Z(v);o.clearColor(1,1,1,1);W.clear();o.clearColor(oa.r,oa.g,oa.b,ia);x=b.__webglObjects.length;t=b.__webglObjectsImmediate.length;for(v=0;v<x;v++)y=b.__webglObjects[v],K=y.object,K.visible&&K.castShadow?!(K instanceof THREE.Mesh)||!K.frustumCulled||w(K)?(K.matrixWorld.flattenToArray(K._objectMatrixArray),C(K,va,!1),y.render=!0):y.render=!1:y.render=!1;m(!0);L(THREE.NormalBlending);for(v=0;v<x;v++)if(y=b.__webglObjects[v],y.render)K=y.object,buffer=y.buffer,k(K),y=K.customDepthMaterial?
-K.customDepthMaterial:K.geometry.morphTargets.length?Ka:ya,f(va,z,null,y,buffer,K);for(v=0;v<t;v++)y=b.__webglObjectsImmediate[v],K=y.object,K.visible&&K.castShadow&&(K.matrixAutoUpdate&&K.matrixWorld.flattenToArray(K._objectMatrixArray),C(K,va,!1),k(K),program=e(va,z,null,ya,K),K.render(function(b){h(b,program,ya.shading)}));u++}}function B(b,e){var c,f,h;c=Y.attributes;var k=Y.uniforms,m=ra/ma,n,p=[],t=ma*0.5,v=ra*0.5,u=!0;o.useProgram(Y.program);T=Y.program;ha=U=da=-1;Ja||(o.enableVertexAttribArray(Y.attributes.position),
+0;for(c=m.materials.length;e<c;e++)(h=m.materials[e])&&(h.transparent?t(o,h):t(n,h))}else(h=e)&&(h.transparent?t(o,h):t(n,h))}function z(b,e){return e.z-b.z}function y(b){var c,n,t,p=0,v,x,y,K,z=b.lights;va||(va=new THREE.Camera(W.shadowCameraFov,W.shadowMapWidth/W.shadowMapHeight,W.shadowCameraNear,W.shadowCameraFar));c=0;for(n=z.length;c<n;c++)if(t=z[c],t instanceof THREE.SpotLight&&t.castShadow){aa=-1;W.shadowMap[p]||(W.shadowMap[p]=new THREE.WebGLRenderTarget(W.shadowMapWidth,W.shadowMapHeight,
+{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));pa[p]||(pa[p]=new THREE.Matrix4);v=W.shadowMap[p];x=pa[p];va.position.copy(t.position);va.target.position.copy(t.target.position);va.update(void 0,!0);b.update(void 0,!1,va);x.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);x.multiplySelf(va.projectionMatrix);x.multiplySelf(va.matrixWorldInverse);va.matrixWorldInverse.flattenToArray(Aa);va.projectionMatrix.flattenToArray(Ea);Da.multiply(va.projectionMatrix,va.matrixWorldInverse);
+u(Da);W.initWebGLObjects(b);Z(v);o.clearColor(1,1,1,1);W.clear();o.clearColor(oa.r,oa.g,oa.b,ia);x=b.__webglObjects.length;t=b.__webglObjectsImmediate.length;for(v=0;v<x;v++)y=b.__webglObjects[v],K=y.object,K.visible&&K.castShadow?!(K instanceof THREE.Mesh)||!K.frustumCulled||w(K)?(K.matrixWorld.flattenToArray(K._objectMatrixArray),C(K,va,!1),y.render=!0):y.render=!1:y.render=!1;k(!0);L(THREE.NormalBlending);for(v=0;v<x;v++)if(y=b.__webglObjects[v],y.render)K=y.object,buffer=y.buffer,h(K),y=K.customDepthMaterial?
+K.customDepthMaterial:K.geometry.morphTargets.length?Ka:ya,f(va,z,null,y,buffer,K);for(v=0;v<t;v++)y=b.__webglObjectsImmediate[v],K=y.object,K.visible&&K.castShadow&&(K.matrixAutoUpdate&&K.matrixWorld.flattenToArray(K._objectMatrixArray),C(K,va,!1),h(K),program=e(va,z,null,ya,K),K.render(function(b){m(b,program,ya.shading)}));p++}}function B(b,e){var c,f,h;c=Y.attributes;var k=Y.uniforms,m=ra/ma,n,t=[],p=ma*0.5,v=ra*0.5,u=!0;o.useProgram(Y.program);T=Y.program;ha=U=da=-1;Ja||(o.enableVertexAttribArray(Y.attributes.position),
 o.enableVertexAttribArray(Y.attributes.uv),Ja=!0);o.disable(o.CULL_FACE);o.enable(o.BLEND);o.depthMask(!0);o.bindBuffer(o.ARRAY_BUFFER,Y.vertexBuffer);o.vertexAttribPointer(c.position,2,o.FLOAT,!1,16,0);o.vertexAttribPointer(c.uv,2,o.FLOAT,!1,16,8);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,Y.elementBuffer);o.uniformMatrix4fv(k.projectionMatrix,!1,Ea);o.activeTexture(o.TEXTURE0);o.uniform1i(k.map,0);c=0;for(f=b.__webglSprites.length;c<f;c++)if(h=b.__webglSprites[c],h.visible&&h.opacity!=0)h.useScreenCoordinates?
-h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(z);c=0;for(f=b.__webglSprites.length;c<f;c++)h=b.__webglSprites[c],h.visible&&h.opacity!=0&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(o.uniform1i(k.useScreenCoordinates,1),o.uniform3f(k.screenPosition,(h.position.x-t)/t,(v-h.position.y)/v,Math.max(0,Math.min(1,h.position.z)))):(o.uniform1i(k.useScreenCoordinates,
-0),o.uniform1i(k.affectedByDistance,h.affectedByDistance?1:0),o.uniformMatrix4fv(k.modelViewMatrix,!1,h._modelViewMatrixArray)),n=h.map.image.width/(h.scaleByViewport?ra:1),p[0]=n*m*h.scale.x,p[1]=n*h.scale.y,o.uniform2f(k.uvScale,h.uvScale.x,h.uvScale.y),o.uniform2f(k.uvOffset,h.uvOffset.x,h.uvOffset.y),o.uniform2f(k.alignment,h.alignment.x,h.alignment.y),o.uniform1f(k.opacity,h.opacity),o.uniform3f(k.color,h.color.r,h.color.g,h.color.b),o.uniform1f(k.rotation,h.rotation),o.uniform2fv(k.scale,p),
+h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(z);c=0;for(f=b.__webglSprites.length;c<f;c++)h=b.__webglSprites[c],h.visible&&h.opacity!=0&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(o.uniform1i(k.useScreenCoordinates,1),o.uniform3f(k.screenPosition,(h.position.x-p)/p,(v-h.position.y)/v,Math.max(0,Math.min(1,h.position.z)))):(o.uniform1i(k.useScreenCoordinates,
+0),o.uniform1i(k.affectedByDistance,h.affectedByDistance?1:0),o.uniformMatrix4fv(k.modelViewMatrix,!1,h._modelViewMatrixArray)),n=h.map.image.width/(h.scaleByViewport?ra:1),t[0]=n*m*h.scale.x,t[1]=n*h.scale.y,o.uniform2f(k.uvScale,h.uvScale.x,h.uvScale.y),o.uniform2f(k.uvOffset,h.uvOffset.x,h.uvOffset.y),o.uniform2f(k.alignment,h.alignment.x,h.alignment.y),o.uniform1f(k.opacity,h.opacity),o.uniform3f(k.color,h.color.r,h.color.g,h.color.b),o.uniform1f(k.rotation,h.rotation),o.uniform2fv(k.scale,t),
 h.mergeWith3D&&!u?(o.enable(o.DEPTH_TEST),u=!0):!h.mergeWith3D&&u&&(o.disable(o.DEPTH_TEST),u=!1),L(h.blending),J(h.map,0),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0));o.enable(o.CULL_FACE);o.enable(o.DEPTH_TEST);o.depthMask($)}function C(b,e,c){b._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);c&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}function E(b){var e,c,f,h;h=b.__materials;b=0;for(c=h.length;b<
-c;b++)if(f=h[b],f.attributes)for(e in f.attributes)if(f.attributes[e].needsUpdate)return!0;return!1}function F(b){var e,c,f,h;h=b.__materials;b=0;for(c=h.length;b<c;b++)if(f=h[b],f.attributes)for(e in f.attributes)f.attributes[e].needsUpdate=!1}function G(b,e){var c;for(c=b.length-1;c>=0;c--)b[c].object==e&&b.splice(c,1)}function M(b){function e(b){var h=[];c=0;for(f=b.length;c<f;c++)b[c]==void 0?h.push("undefined"):h.push(b[c].id);return h.join("_")}var c,f,h,k,m,n,o,p,t={},v=b.morphTargets!==void 0?
-b.morphTargets.length:0;b.geometryGroups={};h=0;for(k=b.faces.length;h<k;h++)m=b.faces[h],n=m.materials,o=e(n),t[o]==void 0&&(t[o]={hash:o,counter:0}),p=t[o].hash+"_"+t[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[],materials:n,vertices:0,numMorphTargets:v}),m=m instanceof THREE.Face3?3:4,b.geometryGroups[p].vertices+m>65535&&(t[o].counter+=1,p=t[o].hash+"_"+t[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[],materials:n,vertices:0,numMorphTargets:v})),
-b.geometryGroups[p].faces.push(h),b.geometryGroups[p].vertices+=m;b.geometryGroupsList=[];for(var u in b.geometryGroups)b.geometryGroups[u].id=ca++,b.geometryGroupsList.push(b.geometryGroups[u])}function P(b,e,c){b.push({buffer:e,object:c,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function L(b){if(b!=da){switch(b){case THREE.AdditiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE);break;case THREE.SubtractiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,
+c;b++)if(f=h[b],f.attributes)for(e in f.attributes)if(f.attributes[e].needsUpdate)return!0;return!1}function F(b){var e,c,f,h;h=b.__materials;b=0;for(c=h.length;b<c;b++)if(f=h[b],f.attributes)for(e in f.attributes)f.attributes[e].needsUpdate=!1}function G(b,e){var c;for(c=b.length-1;c>=0;c--)b[c].object==e&&b.splice(c,1)}function M(b){function e(b){var h=[];c=0;for(f=b.length;c<f;c++)b[c]==void 0?h.push("undefined"):h.push(b[c].id);return h.join("_")}var c,f,h,k,m,n,o,t,p={},v=b.morphTargets!==void 0?
+b.morphTargets.length:0;b.geometryGroups={};h=0;for(k=b.faces.length;h<k;h++)m=b.faces[h],n=m.materials,o=e(n),p[o]==void 0&&(p[o]={hash:o,counter:0}),t=p[o].hash+"_"+p[o].counter,b.geometryGroups[t]==void 0&&(b.geometryGroups[t]={faces:[],materials:n,vertices:0,numMorphTargets:v}),m=m instanceof THREE.Face3?3:4,b.geometryGroups[t].vertices+m>65535&&(p[o].counter+=1,t=p[o].hash+"_"+p[o].counter,b.geometryGroups[t]==void 0&&(b.geometryGroups[t]={faces:[],materials:n,vertices:0,numMorphTargets:v})),
+b.geometryGroups[t].faces.push(h),b.geometryGroups[t].vertices+=m;b.geometryGroupsList=[];for(var u in b.geometryGroups)b.geometryGroups[u].id=ca++,b.geometryGroupsList.push(b.geometryGroups[u])}function P(b,e,c){b.push({buffer:e,object:c,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function L(b){if(b!=da){switch(b){case THREE.AdditiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE);break;case THREE.SubtractiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,
 o.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,o.SRC_COLOR);break;default:o.blendEquationSeparate(o.FUNC_ADD,o.FUNC_ADD),o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA)}da=b}}function A(b,e,c){(c.width&c.width-1)==0&&(c.height&c.height-1)==0?(o.texParameteri(b,o.TEXTURE_WRAP_S,V(e.wrapS)),o.texParameteri(b,o.TEXTURE_WRAP_T,V(e.wrapT)),o.texParameteri(b,o.TEXTURE_MAG_FILTER,V(e.magFilter)),o.texParameteri(b,
 o.TEXTURE_MIN_FILTER,V(e.minFilter)),o.generateMipmap(b)):(o.texParameteri(b,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_MAG_FILTER,X(e.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,X(e.minFilter)))}function J(b,e){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=o.createTexture(),W.info.memory.textures++;o.activeTexture(o.TEXTURE0+e);o.bindTexture(o.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?
 o.texImage2D(o.TEXTURE_2D,0,V(b.format),b.image.width,b.image.height,0,V(b.format),o.UNSIGNED_BYTE,b.image.data):o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,b.image);A(o.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+e),o.bindTexture(o.TEXTURE_2D,b.__webglTexture)}function Z(b){var e=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglRenderbuffer=
@@ -281,43 +280,43 @@ this.setClearColor=function(b,e){oa.copy(b);ia=e;o.clearColor(oa.r,oa.g,oa.b,ia)
 b.geometry.geometryGroups[g];o.deleteBuffer(e.__webglVertexBuffer);o.deleteBuffer(e.__webglNormalBuffer);o.deleteBuffer(e.__webglTangentBuffer);o.deleteBuffer(e.__webglColorBuffer);o.deleteBuffer(e.__webglUVBuffer);o.deleteBuffer(e.__webglUV2Buffer);o.deleteBuffer(e.__webglSkinVertexABuffer);o.deleteBuffer(e.__webglSkinVertexBBuffer);o.deleteBuffer(e.__webglSkinIndicesBuffer);o.deleteBuffer(e.__webglSkinWeightsBuffer);o.deleteBuffer(e.__webglFaceBuffer);o.deleteBuffer(e.__webglLineBuffer);if(e.numMorphTargets)for(var c=
 0,f=e.numMorphTargets;c<f;c++)o.deleteBuffer(e.__webglMorphTargetsBuffers[c]);W.info.memory.geometries--}else if(b instanceof THREE.Ribbon)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),W.info.memory.geometries--;else if(b instanceof THREE.Line)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),W.info.memory.geometries--;else if(b instanceof THREE.ParticleSystem)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),
 W.info.memory.geometries--};this.deallocateTexture=function(b){if(b.__webglInit)b.__webglInit=!1,o.deleteTexture(b.__webglTexture),W.info.memory.textures--};this.initMaterial=function(b,e,c,f){var h,k,m,n;b instanceof THREE.MeshDepthMaterial?n="depth":b instanceof THREE.MeshNormalMaterial?n="normal":b instanceof THREE.MeshBasicMaterial?n="basic":b instanceof THREE.MeshLambertMaterial?n="lambert":b instanceof THREE.MeshPhongMaterial?n="phong":b instanceof THREE.LineBasicMaterial?n="basic":b instanceof
-THREE.ParticleBasicMaterial&&(n="particle_basic");if(n){var p=THREE.ShaderLib[n];b.uniforms=THREE.UniformsUtils.clone(p.uniforms);b.vertexShader=p.vertexShader;b.fragmentShader=p.fragmentShader}var t,v,u;t=u=p=0;for(v=e.length;t<v;t++)m=e[t],m instanceof THREE.SpotLight&&u++,m instanceof THREE.DirectionalLight&&u++,m instanceof THREE.PointLight&&p++;p+u<=sa?t=u:(t=Math.ceil(sa*u/(p+u)),p=sa-t);m={directional:t,point:p};p=u=0;for(t=e.length;p<t;p++)v=e[p],v instanceof THREE.SpotLight&&v.castShadow&&
-u++;var x=50;if(f!==void 0&&f instanceof THREE.SkinnedMesh)x=f.bones.length;var w;a:{t=b.fragmentShader;v=b.vertexShader;var p=b.uniforms,e=b.attributes,c={map:!!b.map,envMap:!!b.envMap,lightMap:!!b.lightMap,vertexColors:b.vertexColors,fog:c,useFog:b.fog,sizeAttenuation:b.sizeAttenuation,skinning:b.skinning,morphTargets:b.morphTargets,maxMorphTargets:this.maxMorphTargets,maxDirLights:m.directional,maxPointLights:m.point,maxBones:x,shadowMapEnabled:this.shadowMapEnabled&&f.receiveShadow,shadowMapSoft:this.shadowMapSoft,
-shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:u,alphaTest:b.alphaTest},y,f=[];n?f.push(n):(f.push(t),f.push(v));for(y in c)f.push(y),f.push(c[y]);n=f.join();y=0;for(f=ea.length;y<f;y++)if(ea[y].code==n){w=ea[y].program;break a}y=o.createProgram();f=[Ha?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?
+THREE.ParticleBasicMaterial&&(n="particle_basic");if(n){var t=THREE.ShaderLib[n];b.uniforms=THREE.UniformsUtils.clone(t.uniforms);b.vertexShader=t.vertexShader;b.fragmentShader=t.fragmentShader}var p,v,u;p=u=t=0;for(v=e.length;p<v;p++)m=e[p],m instanceof THREE.SpotLight&&u++,m instanceof THREE.DirectionalLight&&u++,m instanceof THREE.PointLight&&t++;t+u<=sa?p=u:(p=Math.ceil(sa*u/(t+u)),t=sa-p);m={directional:p,point:t};t=u=0;for(p=e.length;t<p;t++)v=e[t],v instanceof THREE.SpotLight&&v.castShadow&&
+u++;var x=50;if(f!==void 0&&f instanceof THREE.SkinnedMesh)x=f.bones.length;var w;a:{p=b.fragmentShader;v=b.vertexShader;var t=b.uniforms,e=b.attributes,c={map:!!b.map,envMap:!!b.envMap,lightMap:!!b.lightMap,vertexColors:b.vertexColors,fog:c,useFog:b.fog,sizeAttenuation:b.sizeAttenuation,skinning:b.skinning,morphTargets:b.morphTargets,maxMorphTargets:this.maxMorphTargets,maxDirLights:m.directional,maxPointLights:m.point,maxBones:x,shadowMapEnabled:this.shadowMapEnabled&&f.receiveShadow,shadowMapSoft:this.shadowMapSoft,
+shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:u,alphaTest:b.alphaTest},y,f=[];n?f.push(n):(f.push(p),f.push(v));for(y in c)f.push(y),f.push(c[y]);n=f.join();y=0;for(f=ea.length;y<f;y++)if(ea[y].code==n){w=ea[y].program;break a}y=o.createProgram();f=[Ha?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?
 "#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
 m=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",
-c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapSoft?"#define SHADOWMAP_WIDTH "+c.shadowMapWidth.toFixed(1):"",c.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+c.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");o.attachShader(y,O("fragment",m+t));o.attachShader(y,O("vertex",f+v));o.linkProgram(y);o.getProgramParameter(y,o.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+o.getProgramParameter(y,o.VALIDATE_STATUS)+", gl error ["+
-o.getError()+"]");y.uniforms={};y.attributes={};var K,f=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(K in p)f.push(K);K=f;f=0;for(p=K.length;f<p;f++)t=K[f],y.uniforms[t]=o.getUniformLocation(y,t);f=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(K=0;K<c.maxMorphTargets;K++)f.push("morphTarget"+K);for(w in e)f.push(w);
+c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapSoft?"#define SHADOWMAP_WIDTH "+c.shadowMapWidth.toFixed(1):"",c.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+c.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");o.attachShader(y,O("fragment",m+p));o.attachShader(y,O("vertex",f+v));o.linkProgram(y);o.getProgramParameter(y,o.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+o.getProgramParameter(y,o.VALIDATE_STATUS)+", gl error ["+
+o.getError()+"]");y.uniforms={};y.attributes={};var K,f=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(K in t)f.push(K);K=f;f=0;for(t=K.length;f<t;f++)p=K[f],y.uniforms[p]=o.getUniformLocation(y,p);f=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(K=0;K<c.maxMorphTargets;K++)f.push("morphTarget"+K);for(w in e)f.push(w);
 w=f;K=0;for(e=w.length;K<e;K++)c=w[K],y.attributes[c]=o.getAttribLocation(y,c);y.id=ea.length;ea.push({program:y,code:n});W.info.memory.programs=ea.length;w=y}b.program=w;w=b.program.attributes;w.position>=0&&o.enableVertexAttribArray(w.position);w.color>=0&&o.enableVertexAttribArray(w.color);w.normal>=0&&o.enableVertexAttribArray(w.normal);w.tangent>=0&&o.enableVertexAttribArray(w.tangent);b.skinning&&w.skinVertexA>=0&&w.skinVertexB>=0&&w.skinIndex>=0&&w.skinWeight>=0&&(o.enableVertexAttribArray(w.skinVertexA),
 o.enableVertexAttribArray(w.skinVertexB),o.enableVertexAttribArray(w.skinIndex),o.enableVertexAttribArray(w.skinWeight));if(b.attributes)for(k in b.attributes)w[k]!==void 0&&w[k]>=0&&o.enableVertexAttribArray(w[k]);if(b.morphTargets)for(k=b.numSupportedMorphTargets=0;k<this.maxMorphTargets;k++)K="morphTarget"+k,w[K]>=0&&(o.enableVertexAttribArray(w[K]),b.numSupportedMorphTargets++);b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,e,c,f){Z(b);
-b=0;e&&(b|=o.COLOR_BUFFER_BIT);c&&(b|=o.DEPTH_BUFFER_BIT);f&&(b|=o.STENCIL_BUFFER_BIT);o.clear(b)};this.render=function(b,c,o,t){var K,S,R,E,F,G,A,la,J=b.lights,ja=b.fog;aa=-1;this.shadowMapEnabled&&y(b,c);W.info.render.calls=0;W.info.render.vertices=0;W.info.render.faces=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Aa);c.projectionMatrix.flattenToArray(Ea);Da.multiply(c.projectionMatrix,c.matrixWorldInverse);p(Da);this.initWebGLObjects(b);Z(o);
+b=0;e&&(b|=o.COLOR_BUFFER_BIT);c&&(b|=o.DEPTH_BUFFER_BIT);f&&(b|=o.STENCIL_BUFFER_BIT);o.clear(b)};this.render=function(b,c,o,t){var K,S,R,E,F,G,A,la,J=b.lights,ja=b.fog;aa=-1;this.shadowMapEnabled&&y(b,c);W.info.render.calls=0;W.info.render.vertices=0;W.info.render.faces=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Aa);c.projectionMatrix.flattenToArray(Ea);Da.multiply(c.projectionMatrix,c.matrixWorldInverse);u(Da);this.initWebGLObjects(b);Z(o);
 (this.autoClear||t)&&this.clear();F=b.__webglObjects.length;for(t=0;t<F;t++)if(K=b.__webglObjects[t],A=K.object,A.visible)if(!(A instanceof THREE.Mesh)||!A.frustumCulled||w(A)){if(A.matrixWorld.flattenToArray(A._objectMatrixArray),C(A,c,!0),v(K),K.render=!0,this.sortObjects)K.object.renderDepth?K.z=K.object.renderDepth:(Ca.copy(A.position),Da.multiplyVector3(Ca),K.z=Ca.z)}else K.render=!1;else K.render=!1;this.sortObjects&&b.__webglObjects.sort(z);G=b.__webglObjectsImmediate.length;for(t=0;t<G;t++)K=
-b.__webglObjectsImmediate[t],A=K.object,A.visible&&(A.matrixAutoUpdate&&A.matrixWorld.flattenToArray(A._objectMatrixArray),C(A,c,!0),x(K));if(b.overrideMaterial){m(b.overrideMaterial.depthTest);L(b.overrideMaterial.blending);for(t=0;t<F;t++)if(K=b.__webglObjects[t],K.render)A=K.object,la=K.buffer,k(A),f(c,J,ja,b.overrideMaterial,la,A);for(t=0;t<G;t++)K=b.__webglObjectsImmediate[t],A=K.object,A.visible&&(k(A),S=e(c,J,ja,b.overrideMaterial,A),A.render(function(c){h(c,S,b.overrideMaterial.shading)}))}else{L(THREE.NormalBlending);
-for(t=F-1;t>=0;t--)if(K=b.__webglObjects[t],K.render){A=K.object;la=K.buffer;R=K.opaque;k(A);for(K=0;K<R.count;K++)E=R.list[K],m(E.depthTest),n(E.depthWrite),u(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),f(c,J,ja,E,la,A)}for(t=0;t<G;t++)if(K=b.__webglObjectsImmediate[t],A=K.object,A.visible){R=K.opaque;k(A);for(K=0;K<R.count;K++)E=R.list[K],m(E.depthTest),n(E.depthWrite),u(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),S=e(c,J,ja,E,A),A.render(function(b){h(b,S,E.shading)})}for(t=
-0;t<F;t++)if(K=b.__webglObjects[t],K.render){A=K.object;la=K.buffer;R=K.transparent;k(A);for(K=0;K<R.count;K++)E=R.list[K],L(E.blending),m(E.depthTest),n(E.depthWrite),u(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),f(c,J,ja,E,la,A)}for(t=0;t<G;t++)if(K=b.__webglObjectsImmediate[t],A=K.object,A.visible){R=K.transparent;k(A);for(K=0;K<R.count;K++)E=R.list[K],L(E.blending),m(E.depthTest),n(E.depthWrite),u(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),S=e(c,J,ja,E,A),A.render(function(b){h(b,
+b.__webglObjectsImmediate[t],A=K.object,A.visible&&(A.matrixAutoUpdate&&A.matrixWorld.flattenToArray(A._objectMatrixArray),C(A,c,!0),x(K));if(b.overrideMaterial){k(b.overrideMaterial.depthTest);L(b.overrideMaterial.blending);for(t=0;t<F;t++)if(K=b.__webglObjects[t],K.render)A=K.object,la=K.buffer,h(A),f(c,J,ja,b.overrideMaterial,la,A);for(t=0;t<G;t++)K=b.__webglObjectsImmediate[t],A=K.object,A.visible&&(h(A),S=e(c,J,ja,b.overrideMaterial,A),A.render(function(e){m(e,S,b.overrideMaterial.shading)}))}else{L(THREE.NormalBlending);
+for(t=F-1;t>=0;t--)if(K=b.__webglObjects[t],K.render){A=K.object;la=K.buffer;R=K.opaque;h(A);for(K=0;K<R.count;K++)E=R.list[K],k(E.depthTest),n(E.depthWrite),p(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),f(c,J,ja,E,la,A)}for(t=0;t<G;t++)if(K=b.__webglObjectsImmediate[t],A=K.object,A.visible){R=K.opaque;h(A);for(K=0;K<R.count;K++)E=R.list[K],k(E.depthTest),n(E.depthWrite),p(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),S=e(c,J,ja,E,A),A.render(function(b){m(b,S,E.shading)})}for(t=
+0;t<F;t++)if(K=b.__webglObjects[t],K.render){A=K.object;la=K.buffer;R=K.transparent;h(A);for(K=0;K<R.count;K++)E=R.list[K],L(E.blending),k(E.depthTest),n(E.depthWrite),p(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),f(c,J,ja,E,la,A)}for(t=0;t<G;t++)if(K=b.__webglObjectsImmediate[t],A=K.object,A.visible){R=K.transparent;h(A);for(K=0;K<R.count;K++)E=R.list[K],L(E.blending),k(E.depthTest),n(E.depthWrite),p(E.polygonOffset,E.polygonOffsetFactor,E.polygonOffsetUnits),S=e(c,J,ja,E,A),A.render(function(b){m(b,
 S,E.shading)})}}b.__webglSprites.length&&B(b,c);o&&o.minFilter!==THREE.NearestFilter&&o.minFilter!==THREE.LinearFilter&&I(o)};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var e=b.__objectsAdded[0],f=b,h=void 0,k=void 0,m=void 0;if(!e.__webglInit)if(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrixArray=new Float32Array(9),e._modelViewMatrixArray=new Float32Array(16),e._objectMatrixArray=
 new Float32Array(16),e.matrixWorld.flattenToArray(e._objectMatrixArray),e instanceof THREE.Mesh)for(h in k=e.geometry,k.geometryGroups==void 0&&M(k),k.geometryGroups){if(m=k.geometryGroups[h],!m.__webglVertexBuffer){var n=m;n.__webglVertexBuffer=o.createBuffer();n.__webglNormalBuffer=o.createBuffer();n.__webglTangentBuffer=o.createBuffer();n.__webglColorBuffer=o.createBuffer();n.__webglUVBuffer=o.createBuffer();n.__webglUV2Buffer=o.createBuffer();n.__webglSkinVertexABuffer=o.createBuffer();n.__webglSkinVertexBBuffer=
-o.createBuffer();n.__webglSkinIndicesBuffer=o.createBuffer();n.__webglSkinWeightsBuffer=o.createBuffer();n.__webglFaceBuffer=o.createBuffer();n.__webglLineBuffer=o.createBuffer();if(n.numMorphTargets){var p=void 0,t=void 0;n.__webglMorphTargetsBuffers=[];p=0;for(t=n.numMorphTargets;p<t;p++)n.__webglMorphTargetsBuffers.push(o.createBuffer())}W.info.memory.geometries++;for(var n=e,u=void 0,v=void 0,x=void 0,w=x=void 0,K=void 0,y=void 0,z=y=p=0,S=x=v=void 0,x=t=S=v=u=void 0,w=n.geometry,K=w.faces,S=
-m.faces,u=0,v=S.length;u<v;u++)x=S[u],x=K[x],x instanceof THREE.Face3?(p+=3,y+=1,z+=3):x instanceof THREE.Face4&&(p+=4,y+=2,z+=4);for(var u=m,v=n,B=S=K=void 0,R=void 0,B=void 0,x=[],K=0,S=v.materials.length;K<S;K++)if(B=v.materials[K],B instanceof THREE.MeshFaceMaterial){B=0;for(l=u.materials.length;B<l;B++)(R=u.materials[B])&&x.push(R)}else(R=B)&&x.push(R);u=x;m.__materials=u;a:{K=v=void 0;S=u.length;for(v=0;v<S;v++)if(K=u[v],K.map||K.lightMap||K instanceof THREE.ShaderMaterial){v=!0;break a}v=!1}a:{S=
-K=void 0;x=u.length;for(K=0;K<x;K++)if(S=u[K],!(S instanceof THREE.MeshBasicMaterial&&!S.envMap||S instanceof THREE.MeshDepthMaterial)){S=S&&S.shading!=void 0&&S.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}S=!1}a:{x=K=void 0;B=u.length;for(K=0;K<B;K++)if(x=u[K],x.vertexColors){x=x.vertexColors;break a}x=!1}m.__vertexArray=new Float32Array(p*3);if(S)m.__normalArray=new Float32Array(p*3);if(w.hasTangents)m.__tangentArray=new Float32Array(p*4);if(x)m.__colorArray=new Float32Array(p*
-3);if(v){if(w.faceUvs.length>0||w.faceVertexUvs.length>0)m.__uvArray=new Float32Array(p*2);if(w.faceUvs.length>1||w.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(p*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(p*4),m.__skinVertexBArray=new Float32Array(p*4),m.__skinIndexArray=new Float32Array(p*4),m.__skinWeightArray=new Float32Array(p*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=
-new Uint16Array(z*2);if(m.numMorphTargets){m.__morphTargetsArrays=[];w=0;for(K=m.numMorphTargets;w<K;w++)m.__morphTargetsArrays.push(new Float32Array(p*3))}m.__needsSmoothNormals=S==THREE.SmoothShading;m.__uvType=v;m.__vertexColorType=x;m.__normalType=S;m.__webglFaceCount=y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0);m.__webglLineCount=z*2;w=0;for(K=u.length;w<K;w++)if(v=u[w],v.attributes){if(m.__webglCustomAttributes===void 0)m.__webglCustomAttributes={};for(a in v.attributes){x=v.attributes[a];
-S={};for(t in x)S[t]=x[t];if(!S.__webglInitialized||S.createUniqueBuffers)S.__webglInitialized=!0,y=1,S.type==="v2"?y=2:S.type==="v3"?y=3:S.type==="v4"?y=4:S.type==="c"&&(y=3),S.size=y,S.array=new Float32Array(p*y),S.buffer=o.createBuffer(),S.buffer.belongsToAttribute=a,x.needsUpdate=!0,S.__original=x;m.__webglCustomAttributes[a]=S}}m.__inittedArrays=!0;k.__dirtyVertices=!0;k.__dirtyMorphTargets=!0;k.__dirtyElements=!0;k.__dirtyUvs=!0;k.__dirtyNormals=!0;k.__dirtyTangents=!0;k.__dirtyColors=!0}}else if(e instanceof
+o.createBuffer();n.__webglSkinIndicesBuffer=o.createBuffer();n.__webglSkinWeightsBuffer=o.createBuffer();n.__webglFaceBuffer=o.createBuffer();n.__webglLineBuffer=o.createBuffer();if(n.numMorphTargets){var t=void 0,p=void 0;n.__webglMorphTargetsBuffers=[];t=0;for(p=n.numMorphTargets;t<p;t++)n.__webglMorphTargetsBuffers.push(o.createBuffer())}W.info.memory.geometries++;for(var n=e,v=void 0,u=void 0,x=void 0,w=x=void 0,K=void 0,y=void 0,z=y=t=0,S=x=u=void 0,x=p=S=u=v=void 0,w=n.geometry,K=w.faces,S=
+m.faces,v=0,u=S.length;v<u;v++)x=S[v],x=K[x],x instanceof THREE.Face3?(t+=3,y+=1,z+=3):x instanceof THREE.Face4&&(t+=4,y+=2,z+=4);for(var v=m,u=n,B=S=K=void 0,R=void 0,B=void 0,x=[],K=0,S=u.materials.length;K<S;K++)if(B=u.materials[K],B instanceof THREE.MeshFaceMaterial){B=0;for(l=v.materials.length;B<l;B++)(R=v.materials[B])&&x.push(R)}else(R=B)&&x.push(R);v=x;m.__materials=v;a:{K=u=void 0;S=v.length;for(u=0;u<S;u++)if(K=v[u],K.map||K.lightMap||K instanceof THREE.ShaderMaterial){u=!0;break a}u=!1}a:{S=
+K=void 0;x=v.length;for(K=0;K<x;K++)if(S=v[K],!(S instanceof THREE.MeshBasicMaterial&&!S.envMap||S instanceof THREE.MeshDepthMaterial)){S=S&&S.shading!=void 0&&S.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}S=!1}a:{x=K=void 0;B=v.length;for(K=0;K<B;K++)if(x=v[K],x.vertexColors){x=x.vertexColors;break a}x=!1}m.__vertexArray=new Float32Array(t*3);if(S)m.__normalArray=new Float32Array(t*3);if(w.hasTangents)m.__tangentArray=new Float32Array(t*4);if(x)m.__colorArray=new Float32Array(t*
+3);if(u){if(w.faceUvs.length>0||w.faceVertexUvs.length>0)m.__uvArray=new Float32Array(t*2);if(w.faceUvs.length>1||w.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(t*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(t*4),m.__skinVertexBArray=new Float32Array(t*4),m.__skinIndexArray=new Float32Array(t*4),m.__skinWeightArray=new Float32Array(t*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=
+new Uint16Array(z*2);if(m.numMorphTargets){m.__morphTargetsArrays=[];w=0;for(K=m.numMorphTargets;w<K;w++)m.__morphTargetsArrays.push(new Float32Array(t*3))}m.__needsSmoothNormals=S==THREE.SmoothShading;m.__uvType=u;m.__vertexColorType=x;m.__normalType=S;m.__webglFaceCount=y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0);m.__webglLineCount=z*2;w=0;for(K=v.length;w<K;w++)if(u=v[w],u.attributes){if(m.__webglCustomAttributes===void 0)m.__webglCustomAttributes={};for(a in u.attributes){x=u.attributes[a];
+S={};for(p in x)S[p]=x[p];if(!S.__webglInitialized||S.createUniqueBuffers)S.__webglInitialized=!0,y=1,S.type==="v2"?y=2:S.type==="v3"?y=3:S.type==="v4"?y=4:S.type==="c"&&(y=3),S.size=y,S.array=new Float32Array(t*y),S.buffer=o.createBuffer(),S.buffer.belongsToAttribute=a,x.needsUpdate=!0,S.__original=x;m.__webglCustomAttributes[a]=S}}m.__inittedArrays=!0;k.__dirtyVertices=!0;k.__dirtyMorphTargets=!0;k.__dirtyElements=!0;k.__dirtyUvs=!0;k.__dirtyNormals=!0;k.__dirtyTangents=!0;k.__dirtyColors=!0}}else if(e instanceof
 THREE.Ribbon){if(k=e.geometry,!k.__webglVertexBuffer)m=k,m.__webglVertexBuffer=o.createBuffer(),m.__webglColorBuffer=o.createBuffer(),W.info.memory.geometries++,m=k,n=m.vertices.length,m.__vertexArray=new Float32Array(n*3),m.__colorArray=new Float32Array(n*3),m.__webglVertexCount=n,k.__dirtyVertices=!0,k.__dirtyColors=!0}else if(e instanceof THREE.Line){if(k=e.geometry,!k.__webglVertexBuffer)m=k,m.__webglVertexBuffer=o.createBuffer(),m.__webglColorBuffer=o.createBuffer(),W.info.memory.geometries++,
-m=k,n=m.vertices.length,m.__vertexArray=new Float32Array(n*3),m.__colorArray=new Float32Array(n*3),m.__webglLineCount=n,k.__dirtyVertices=!0,k.__dirtyColors=!0}else if(e instanceof THREE.ParticleSystem&&(k=e.geometry,!k.__webglVertexBuffer)){m=k;m.__webglVertexBuffer=o.createBuffer();m.__webglColorBuffer=o.createBuffer();W.info.geometries++;m=k;n=e;p=m.vertices.length;m.__vertexArray=new Float32Array(p*3);m.__colorArray=new Float32Array(p*3);m.__sortArray=[];m.__webglParticleCount=p;m.__materials=
-n.materials;z=y=t=void 0;t=0;for(y=n.materials.length;t<y;t++)if(z=n.materials[t],z.attributes){if(m.__webglCustomAttributes===void 0)m.__webglCustomAttributes={};for(a in z.attributes){originalAttribute=z.attributes[a];attribute={};for(property in originalAttribute)attribute[property]=originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=!0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=
-4:attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(p*size),attribute.buffer=o.createBuffer(),attribute.buffer.belongsToAttribute=a,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;m.__webglCustomAttributes[a]=attribute}}k.__dirtyVertices=!0;k.__dirtyColors=!0}if(!e.__webglActive){if(e instanceof THREE.Mesh)for(h in k=e.geometry,k.geometryGroups)m=k.geometryGroups[h],P(f.__webglObjects,m,e);else e instanceof THREE.Ribbon||e instanceof THREE.Line||
+m=k,n=m.vertices.length,m.__vertexArray=new Float32Array(n*3),m.__colorArray=new Float32Array(n*3),m.__webglLineCount=n,k.__dirtyVertices=!0,k.__dirtyColors=!0}else if(e instanceof THREE.ParticleSystem&&(k=e.geometry,!k.__webglVertexBuffer)){m=k;m.__webglVertexBuffer=o.createBuffer();m.__webglColorBuffer=o.createBuffer();W.info.geometries++;m=k;n=e;t=m.vertices.length;m.__vertexArray=new Float32Array(t*3);m.__colorArray=new Float32Array(t*3);m.__sortArray=[];m.__webglParticleCount=t;m.__materials=
+n.materials;z=y=p=void 0;p=0;for(y=n.materials.length;p<y;p++)if(z=n.materials[p],z.attributes){if(m.__webglCustomAttributes===void 0)m.__webglCustomAttributes={};for(a in z.attributes){originalAttribute=z.attributes[a];attribute={};for(property in originalAttribute)attribute[property]=originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=!0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=
+4:attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(t*size),attribute.buffer=o.createBuffer(),attribute.buffer.belongsToAttribute=a,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;m.__webglCustomAttributes[a]=attribute}}k.__dirtyVertices=!0;k.__dirtyColors=!0}if(!e.__webglActive){if(e instanceof THREE.Mesh)for(h in k=e.geometry,k.geometryGroups)m=k.geometryGroups[h],P(f.__webglObjects,m,e);else e instanceof THREE.Ribbon||e instanceof THREE.Line||
 e instanceof THREE.ParticleSystem?(k=e.geometry,P(f.__webglObjects,k,e)):THREE.MarchingCubes!==void 0&&e instanceof THREE.MarchingCubes?f.__webglObjectsImmediate.push({object:e,opaque:{list:[],count:0},transparent:{list:[],count:0}}):e instanceof THREE.Sprite&&f.__webglSprites.push(e);e.__webglActive=!0}b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;){e=b.__objectsRemoved[0];f=b;if(e instanceof THREE.Mesh||e instanceof THREE.ParticleSystem||e instanceof THREE.Ribbon||e instanceof THREE.Line)G(f.__webglObjects,
-e);else if(e instanceof THREE.Sprite){f=f.__webglSprites;h=e;k=void 0;for(k=f.length-1;k>=0;k--)f[k]==h&&f.splice(k,1)}else e instanceof THREE.MarchingCubes&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e<f;e++)if(k=b.__webglObjects[e].object,t=m=h=void 0,k instanceof THREE.Mesh){h=k.geometry;n=0;for(p=h.geometryGroupsList.length;n<p;n++)if(m=h.geometryGroupsList[n],t=E(m),h.__dirtyVertices||h.__dirtyMorphTargets||h.__dirtyElements||
-h.__dirtyUvs||h.__dirtyNormals||h.__dirtyColors||h.__dirtyTangents||t)if(t=m,y=o.DYNAMIC_DRAW,z=!h.dynamic,t.__inittedArrays){var C=u=w=void 0,A=void 0,la=C=void 0,J=void 0,L=void 0,ja=void 0,I=R=B=x=S=K=v=void 0,ia=void 0,oa=void 0,H=A=ja=A=L=J=void 0,D=void 0,N=D=H=J=void 0,O=void 0,$=N=D=H=C=C=la=ja=A=N=D=H=O=N=D=H=O=N=D=H=void 0,ma=0,U=0,X=0,ra=0,T=0,Z=0,sa=0,Y=0,pa=0,Q=0,V=0,N=H=0,N=void 0,ga=t.__vertexArray,va=t.__uvArray,wa=t.__uv2Array,ka=t.__normalArray,ha=t.__tangentArray,da=t.__colorArray,
-ca=t.__skinVertexAArray,aa=t.__skinVertexBArray,ea=t.__skinIndexArray,fa=t.__skinWeightArray,qa=t.__morphTargetsArrays,ya=t.__webglCustomAttributes,D=void 0,ua=t.__faceArray,xa=t.__lineArray,Da=t.__needsSmoothNormals,K=t.__vertexColorType,v=t.__uvType,S=t.__normalType,na=k.geometry,Ea=na.__dirtyVertices,Ba=na.__dirtyElements,Aa=na.__dirtyUvs,Ha=na.__dirtyNormals,Ka=na.__dirtyTangents,Ca=na.__dirtyColors,Ga=na.__dirtyMorphTargets,Ja=na.vertices,cb=t.faces,fb=na.faces,db=na.faceVertexUvs[0],eb=na.faceVertexUvs[1],
-Sa=na.skinVerticesA,Ta=na.skinVerticesB,Ua=na.skinIndices,Ma=na.skinWeights,La=na.morphTargets;if(ya)for($ in ya)ya[$].offset=0,ya[$].offsetSrc=0;w=0;for(u=cb.length;w<u;w++)if(C=cb[w],A=fb[C],db&&(x=db[C]),eb&&(B=eb[C]),C=A.vertexNormals,la=A.normal,J=A.vertexColors,L=A.color,ja=A.vertexTangents,A instanceof THREE.Face3){if(Ea)R=Ja[A.a].position,I=Ja[A.b].position,ia=Ja[A.c].position,ga[U]=R.x,ga[U+1]=R.y,ga[U+2]=R.z,ga[U+3]=I.x,ga[U+4]=I.y,ga[U+5]=I.z,ga[U+6]=ia.x,ga[U+7]=ia.y,ga[U+8]=ia.z,U+=9;
+e);else if(e instanceof THREE.Sprite){f=f.__webglSprites;h=e;k=void 0;for(k=f.length-1;k>=0;k--)f[k]==h&&f.splice(k,1)}else e instanceof THREE.MarchingCubes&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e<f;e++)if(k=b.__webglObjects[e].object,p=m=h=void 0,k instanceof THREE.Mesh){h=k.geometry;n=0;for(t=h.geometryGroupsList.length;n<t;n++)if(m=h.geometryGroupsList[n],p=E(m),h.__dirtyVertices||h.__dirtyMorphTargets||h.__dirtyElements||
+h.__dirtyUvs||h.__dirtyNormals||h.__dirtyColors||h.__dirtyTangents||p)if(p=m,y=o.DYNAMIC_DRAW,z=!h.dynamic,p.__inittedArrays){var C=v=w=void 0,A=void 0,la=C=void 0,J=void 0,L=void 0,ja=void 0,I=R=B=x=S=K=u=void 0,ia=void 0,oa=void 0,H=A=ja=A=L=J=void 0,D=void 0,N=D=H=J=void 0,O=void 0,$=N=D=H=C=C=la=ja=A=N=D=H=O=N=D=H=O=N=D=H=void 0,ma=0,U=0,X=0,ra=0,T=0,Z=0,sa=0,Y=0,pa=0,Q=0,V=0,N=H=0,N=void 0,ga=p.__vertexArray,va=p.__uvArray,wa=p.__uv2Array,ka=p.__normalArray,ha=p.__tangentArray,da=p.__colorArray,
+ca=p.__skinVertexAArray,aa=p.__skinVertexBArray,ea=p.__skinIndexArray,fa=p.__skinWeightArray,qa=p.__morphTargetsArrays,ya=p.__webglCustomAttributes,D=void 0,ua=p.__faceArray,xa=p.__lineArray,Da=p.__needsSmoothNormals,K=p.__vertexColorType,u=p.__uvType,S=p.__normalType,na=k.geometry,Ea=na.__dirtyVertices,Ba=na.__dirtyElements,Aa=na.__dirtyUvs,Ha=na.__dirtyNormals,Ka=na.__dirtyTangents,Ca=na.__dirtyColors,Ga=na.__dirtyMorphTargets,Ja=na.vertices,cb=p.faces,fb=na.faces,db=na.faceVertexUvs[0],eb=na.faceVertexUvs[1],
+Sa=na.skinVerticesA,Ta=na.skinVerticesB,Ua=na.skinIndices,Ma=na.skinWeights,La=na.morphTargets;if(ya)for($ in ya)ya[$].offset=0,ya[$].offsetSrc=0;w=0;for(v=cb.length;w<v;w++)if(C=cb[w],A=fb[C],db&&(x=db[C]),eb&&(B=eb[C]),C=A.vertexNormals,la=A.normal,J=A.vertexColors,L=A.color,ja=A.vertexTangents,A instanceof THREE.Face3){if(Ea)R=Ja[A.a].position,I=Ja[A.b].position,ia=Ja[A.c].position,ga[U]=R.x,ga[U+1]=R.y,ga[U+2]=R.z,ga[U+3]=I.x,ga[U+4]=I.y,ga[U+5]=I.z,ga[U+6]=ia.x,ga[U+7]=ia.y,ga[U+8]=ia.z,U+=9;
 if(ya)for($ in ya)if(D=ya[$],D.__original.needsUpdate)H=D.offset,N=D.offsetSrc,D.size===1?(D.boundTo===void 0||D.boundTo==="vertices"?(D.array[H]=D.value[A.a],D.array[H+1]=D.value[A.b],D.array[H+2]=D.value[A.c]):D.boundTo==="faces"?(N=D.value[N],D.array[H]=N,D.array[H+1]=N,D.array[H+2]=N,D.offsetSrc++):D.boundTo==="faceVertices"&&(D.array[H]=D.value[N],D.array[H+1]=D.value[N+1],D.array[H+2]=D.value[N+2],D.offsetSrc+=3),D.offset+=3):(D.boundTo===void 0||D.boundTo==="vertices"?(R=D.value[A.a],I=D.value[A.b],
 ia=D.value[A.c]):D.boundTo==="faces"?(ia=I=R=N=D.value[N],D.offsetSrc++):D.boundTo==="faceVertices"&&(R=D.value[N],I=D.value[N+1],ia=D.value[N+2],D.offsetSrc+=3),D.size===2?(D.array[H]=R.x,D.array[H+1]=R.y,D.array[H+2]=I.x,D.array[H+3]=I.y,D.array[H+4]=ia.x,D.array[H+5]=ia.y,D.offset+=6):D.size===3?(D.type==="c"?(D.array[H]=R.r,D.array[H+1]=R.g,D.array[H+2]=R.b,D.array[H+3]=I.r,D.array[H+4]=I.g,D.array[H+5]=I.b,D.array[H+6]=ia.r,D.array[H+7]=ia.g,D.array[H+8]=ia.b):(D.array[H]=R.x,D.array[H+1]=R.y,
 D.array[H+2]=R.z,D.array[H+3]=I.x,D.array[H+4]=I.y,D.array[H+5]=I.z,D.array[H+6]=ia.x,D.array[H+7]=ia.y,D.array[H+8]=ia.z),D.offset+=9):(D.array[H]=R.x,D.array[H+1]=R.y,D.array[H+2]=R.z,D.array[H+3]=R.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]=ia.x,D.array[H+9]=ia.y,D.array[H+10]=ia.z,D.array[H+11]=ia.w,D.offset+=12));if(Ga){H=0;for(D=La.length;H<D;H++)R=La[H].vertices[A.a].position,I=La[H].vertices[A.b].position,ia=La[H].vertices[A.c].position,N=qa[H],N[V]=
 R.x,N[V+1]=R.y,N[V+2]=R.z,N[V+3]=I.x,N[V+4]=I.y,N[V+5]=I.z,N[V+6]=ia.x,N[V+7]=ia.y,N[V+8]=ia.z;V+=9}if(Ma.length)H=Ma[A.a],D=Ma[A.b],N=Ma[A.c],fa[Q]=H.x,fa[Q+1]=H.y,fa[Q+2]=H.z,fa[Q+3]=H.w,fa[Q+4]=D.x,fa[Q+5]=D.y,fa[Q+6]=D.z,fa[Q+7]=D.w,fa[Q+8]=N.x,fa[Q+9]=N.y,fa[Q+10]=N.z,fa[Q+11]=N.w,H=Ua[A.a],D=Ua[A.b],N=Ua[A.c],ea[Q]=H.x,ea[Q+1]=H.y,ea[Q+2]=H.z,ea[Q+3]=H.w,ea[Q+4]=D.x,ea[Q+5]=D.y,ea[Q+6]=D.z,ea[Q+7]=D.w,ea[Q+8]=N.x,ea[Q+9]=N.y,ea[Q+10]=N.z,ea[Q+11]=N.w,H=Sa[A.a],D=Sa[A.b],N=Sa[A.c],ca[Q]=H.x,
 ca[Q+1]=H.y,ca[Q+2]=H.z,ca[Q+3]=1,ca[Q+4]=D.x,ca[Q+5]=D.y,ca[Q+6]=D.z,ca[Q+7]=1,ca[Q+8]=N.x,ca[Q+9]=N.y,ca[Q+10]=N.z,ca[Q+11]=1,H=Ta[A.a],D=Ta[A.b],N=Ta[A.c],aa[Q]=H.x,aa[Q+1]=H.y,aa[Q+2]=H.z,aa[Q+3]=1,aa[Q+4]=D.x,aa[Q+5]=D.y,aa[Q+6]=D.z,aa[Q+7]=1,aa[Q+8]=N.x,aa[Q+9]=N.y,aa[Q+10]=N.z,aa[Q+11]=1,Q+=12;if(Ca&&K)J.length==3&&K==THREE.VertexColors?(A=J[0],H=J[1],D=J[2]):D=H=A=L,da[pa]=A.r,da[pa+1]=A.g,da[pa+2]=A.b,da[pa+3]=H.r,da[pa+4]=H.g,da[pa+5]=H.b,da[pa+6]=D.r,da[pa+7]=D.g,da[pa+8]=D.b,pa+=9;if(Ka&&
-na.hasTangents)J=ja[0],L=ja[1],A=ja[2],ha[sa]=J.x,ha[sa+1]=J.y,ha[sa+2]=J.z,ha[sa+3]=J.w,ha[sa+4]=L.x,ha[sa+5]=L.y,ha[sa+6]=L.z,ha[sa+7]=L.w,ha[sa+8]=A.x,ha[sa+9]=A.y,ha[sa+10]=A.z,ha[sa+11]=A.w,sa+=12;if(Ha&&S)if(C.length==3&&Da)for(ja=0;ja<3;ja++)la=C[ja],ka[Z]=la.x,ka[Z+1]=la.y,ka[Z+2]=la.z,Z+=3;else for(ja=0;ja<3;ja++)ka[Z]=la.x,ka[Z+1]=la.y,ka[Z+2]=la.z,Z+=3;if(Aa&&x!==void 0&&v)for(ja=0;ja<3;ja++)C=x[ja],va[X]=C.u,va[X+1]=C.v,X+=2;if(Aa&&B!==void 0&&v)for(ja=0;ja<3;ja++)C=B[ja],wa[ra]=C.u,wa[ra+
+na.hasTangents)J=ja[0],L=ja[1],A=ja[2],ha[sa]=J.x,ha[sa+1]=J.y,ha[sa+2]=J.z,ha[sa+3]=J.w,ha[sa+4]=L.x,ha[sa+5]=L.y,ha[sa+6]=L.z,ha[sa+7]=L.w,ha[sa+8]=A.x,ha[sa+9]=A.y,ha[sa+10]=A.z,ha[sa+11]=A.w,sa+=12;if(Ha&&S)if(C.length==3&&Da)for(ja=0;ja<3;ja++)la=C[ja],ka[Z]=la.x,ka[Z+1]=la.y,ka[Z+2]=la.z,Z+=3;else for(ja=0;ja<3;ja++)ka[Z]=la.x,ka[Z+1]=la.y,ka[Z+2]=la.z,Z+=3;if(Aa&&x!==void 0&&u)for(ja=0;ja<3;ja++)C=x[ja],va[X]=C.u,va[X+1]=C.v,X+=2;if(Aa&&B!==void 0&&u)for(ja=0;ja<3;ja++)C=B[ja],wa[ra]=C.u,wa[ra+
 1]=C.v,ra+=2;Ba&&(ua[T]=ma,ua[T+1]=ma+1,ua[T+2]=ma+2,T+=3,xa[Y]=ma,xa[Y+1]=ma+1,xa[Y+2]=ma,xa[Y+3]=ma+2,xa[Y+4]=ma+1,xa[Y+5]=ma+2,Y+=6,ma+=3)}else if(A instanceof THREE.Face4){if(Ea)R=Ja[A.a].position,I=Ja[A.b].position,ia=Ja[A.c].position,oa=Ja[A.d].position,ga[U]=R.x,ga[U+1]=R.y,ga[U+2]=R.z,ga[U+3]=I.x,ga[U+4]=I.y,ga[U+5]=I.z,ga[U+6]=ia.x,ga[U+7]=ia.y,ga[U+8]=ia.z,ga[U+9]=oa.x,ga[U+10]=oa.y,ga[U+11]=oa.z,U+=12;if(ya)for($ in ya)if(D=ya[$],D.__original.needsUpdate)H=D.offset,N=D.offsetSrc,D.size===
 1?(D.boundTo===void 0||D.boundTo==="vertices"?(D.array[H]=D.value[A.a],D.array[H+1]=D.value[A.b],D.array[H+2]=D.value[A.c],D.array[H+3]=D.value[A.d]):D.boundTo==="faces"?(N=D.value[N],D.array[H]=N,D.array[H+1]=N,D.array[H+2]=N,D.array[H+3]=N,D.offsetSrc++):D.boundTo==="faceVertices"&&(D.array[H]=D.value[N],D.array[H+1]=D.value[N+1],D.array[H+2]=D.value[N+2],D.array[H+3]=D.value[N+3],D.offsetSrc+=4),D.offset+=4):(D.boundTo===void 0||D.boundTo==="vertices"?(R=D.value[A.a],I=D.value[A.b],ia=D.value[A.c],
 oa=D.value[A.d]):D.boundTo==="faces"?(oa=ia=I=R=N=D.value[N],D.offsetSrc++):D.boundTo==="faceVertices"&&(R=D.value[N],I=D.value[N+1],ia=D.value[N+2],oa=D.value[N+3],D.offsetSrc+=4),D.size===2?(D.array[H]=R.x,D.array[H+1]=R.y,D.array[H+2]=I.x,D.array[H+3]=I.y,D.array[H+4]=ia.x,D.array[H+5]=ia.y,D.array[H+6]=oa.x,D.array[H+7]=oa.y,D.offset+=8):D.size===3?(D.type==="c"?(D.array[H]=R.r,D.array[H+1]=R.g,D.array[H+2]=R.b,D.array[H+3]=I.r,D.array[H+4]=I.g,D.array[H+5]=I.b,D.array[H+6]=ia.r,D.array[H+7]=
@@ -326,14 +325,14 @@ ia.g,D.array[H+8]=ia.b,D.array[H+9]=oa.r,D.array[H+10]=oa.g,D.array[H+11]=oa.b):
 3]=H.w,fa[Q+4]=D.x,fa[Q+5]=D.y,fa[Q+6]=D.z,fa[Q+7]=D.w,fa[Q+8]=N.x,fa[Q+9]=N.y,fa[Q+10]=N.z,fa[Q+11]=N.w,fa[Q+12]=O.x,fa[Q+13]=O.y,fa[Q+14]=O.z,fa[Q+15]=O.w,H=Ua[A.a],D=Ua[A.b],N=Ua[A.c],O=Ua[A.d],ea[Q]=H.x,ea[Q+1]=H.y,ea[Q+2]=H.z,ea[Q+3]=H.w,ea[Q+4]=D.x,ea[Q+5]=D.y,ea[Q+6]=D.z,ea[Q+7]=D.w,ea[Q+8]=N.x,ea[Q+9]=N.y,ea[Q+10]=N.z,ea[Q+11]=N.w,ea[Q+12]=O.x,ea[Q+13]=O.y,ea[Q+14]=O.z,ea[Q+15]=O.w,H=Sa[A.a],D=Sa[A.b],N=Sa[A.c],O=Sa[A.d],ca[Q]=H.x,ca[Q+1]=H.y,ca[Q+2]=H.z,ca[Q+3]=1,ca[Q+4]=D.x,ca[Q+5]=D.y,
 ca[Q+6]=D.z,ca[Q+7]=1,ca[Q+8]=N.x,ca[Q+9]=N.y,ca[Q+10]=N.z,ca[Q+11]=1,ca[Q+12]=O.x,ca[Q+13]=O.y,ca[Q+14]=O.z,ca[Q+15]=1,H=Ta[A.a],D=Ta[A.b],N=Ta[A.c],A=Ta[A.d],aa[Q]=H.x,aa[Q+1]=H.y,aa[Q+2]=H.z,aa[Q+3]=1,aa[Q+4]=D.x,aa[Q+5]=D.y,aa[Q+6]=D.z,aa[Q+7]=1,aa[Q+8]=N.x,aa[Q+9]=N.y,aa[Q+10]=N.z,aa[Q+11]=1,aa[Q+12]=A.x,aa[Q+13]=A.y,aa[Q+14]=A.z,aa[Q+15]=1,Q+=16;if(Ca&&K)J.length==4&&K==THREE.VertexColors?(A=J[0],H=J[1],D=J[2],J=J[3]):J=D=H=A=L,da[pa]=A.r,da[pa+1]=A.g,da[pa+2]=A.b,da[pa+3]=H.r,da[pa+4]=H.g,
 da[pa+5]=H.b,da[pa+6]=D.r,da[pa+7]=D.g,da[pa+8]=D.b,da[pa+9]=J.r,da[pa+10]=J.g,da[pa+11]=J.b,pa+=12;if(Ka&&na.hasTangents)J=ja[0],L=ja[1],A=ja[2],ja=ja[3],ha[sa]=J.x,ha[sa+1]=J.y,ha[sa+2]=J.z,ha[sa+3]=J.w,ha[sa+4]=L.x,ha[sa+5]=L.y,ha[sa+6]=L.z,ha[sa+7]=L.w,ha[sa+8]=A.x,ha[sa+9]=A.y,ha[sa+10]=A.z,ha[sa+11]=A.w,ha[sa+12]=ja.x,ha[sa+13]=ja.y,ha[sa+14]=ja.z,ha[sa+15]=ja.w,sa+=16;if(Ha&&S)if(C.length==4&&Da)for(ja=0;ja<4;ja++)la=C[ja],ka[Z]=la.x,ka[Z+1]=la.y,ka[Z+2]=la.z,Z+=3;else for(ja=0;ja<4;ja++)ka[Z]=
-la.x,ka[Z+1]=la.y,ka[Z+2]=la.z,Z+=3;if(Aa&&x!==void 0&&v)for(ja=0;ja<4;ja++)C=x[ja],va[X]=C.u,va[X+1]=C.v,X+=2;if(Aa&&B!==void 0&&v)for(ja=0;ja<4;ja++)C=B[ja],wa[ra]=C.u,wa[ra+1]=C.v,ra+=2;Ba&&(ua[T]=ma,ua[T+1]=ma+1,ua[T+2]=ma+3,ua[T+3]=ma+1,ua[T+4]=ma+2,ua[T+5]=ma+3,T+=6,xa[Y]=ma,xa[Y+1]=ma+1,xa[Y+2]=ma,xa[Y+3]=ma+3,xa[Y+4]=ma+1,xa[Y+5]=ma+2,xa[Y+6]=ma+2,xa[Y+7]=ma+3,Y+=8,ma+=4)}Ea&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,ga,y));if(ya)for($ in ya)D=ya[$],D.__original.needsUpdate&&
-(o.bindBuffer(o.ARRAY_BUFFER,D.buffer),o.bufferData(o.ARRAY_BUFFER,D.array,y));if(Ga){H=0;for(D=La.length;H<D;H++)o.bindBuffer(o.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[H]),o.bufferData(o.ARRAY_BUFFER,qa[H],y)}Ca&&pa>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,da,y));Ha&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglNormalBuffer),o.bufferData(o.ARRAY_BUFFER,ka,y));Ka&&na.hasTangents&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglTangentBuffer),o.bufferData(o.ARRAY_BUFFER,ha,
-y));Aa&&X>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglUVBuffer),o.bufferData(o.ARRAY_BUFFER,va,y));Aa&&ra>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglUV2Buffer),o.bufferData(o.ARRAY_BUFFER,wa,y));Ba&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,ua,y),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,xa,y));Q>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinVertexABuffer),o.bufferData(o.ARRAY_BUFFER,ca,y),o.bindBuffer(o.ARRAY_BUFFER,
-t.__webglSkinVertexBBuffer),o.bufferData(o.ARRAY_BUFFER,aa,y),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),o.bufferData(o.ARRAY_BUFFER,ea,y),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),o.bufferData(o.ARRAY_BUFFER,fa,y));z&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray,delete t.__skinVertexAArray,delete t.__skinVertexBArray,
-delete t.__skinIndexArray,delete t.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;F(m)}else if(k instanceof THREE.Ribbon){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=w=z=z=void 0;u=k.vertices;p=k.colors;v=u.length;t=p.length;K=k.__vertexArray;y=k.__colorArray;S=k.__dirtyColors;if(k.__dirtyVertices){for(z=0;z<v;z++)w=u[z].position,n=z*3,K[n]=w.x,K[n+1]=w.y,
-K[n+2]=w.z;o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,K,m)}if(S){for(z=0;z<t;z++)color=p[z],n=z*3,y[n]=color.r,y[n+1]=color.g,y[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,y,m)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(k instanceof THREE.Line){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=w=z=z=void 0;u=k.vertices;p=k.colors;v=u.length;t=p.length;K=k.__vertexArray;y=k.__colorArray;
-S=k.__dirtyColors;if(k.__dirtyVertices){for(z=0;z<v;z++)w=u[z].position,n=z*3,K[n]=w.x,K[n+1]=w.y,K[n+2]=w.z;o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,K,m)}if(S){for(z=0;z<t;z++)color=p[z],n=z*3,y[n]=color.r,y[n+1]=color.g,y[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,y,m)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(k instanceof THREE.ParticleSystem)h=k.geometry,t=E(h),(h.__dirtyVertices||h.__dirtyColors||k.sortParticles||
-t)&&c(h,o.DYNAMIC_DRAW,k),h.__dirtyVertices=!1,h.__dirtyColors=!1,F(h)};this.setFaceCulling=function(b,e){b?(!e||e=="ccw"?o.frontFace(o.CCW):o.frontFace(o.CW),b=="back"?o.cullFace(o.BACK):b=="front"?o.cullFace(o.FRONT):o.cullFace(o.FRONT_AND_BACK),o.enable(o.CULL_FACE)):o.disable(o.CULL_FACE)};this.supportsVertexTextures=function(){return Ha}};
+la.x,ka[Z+1]=la.y,ka[Z+2]=la.z,Z+=3;if(Aa&&x!==void 0&&u)for(ja=0;ja<4;ja++)C=x[ja],va[X]=C.u,va[X+1]=C.v,X+=2;if(Aa&&B!==void 0&&u)for(ja=0;ja<4;ja++)C=B[ja],wa[ra]=C.u,wa[ra+1]=C.v,ra+=2;Ba&&(ua[T]=ma,ua[T+1]=ma+1,ua[T+2]=ma+3,ua[T+3]=ma+1,ua[T+4]=ma+2,ua[T+5]=ma+3,T+=6,xa[Y]=ma,xa[Y+1]=ma+1,xa[Y+2]=ma,xa[Y+3]=ma+3,xa[Y+4]=ma+1,xa[Y+5]=ma+2,xa[Y+6]=ma+2,xa[Y+7]=ma+3,Y+=8,ma+=4)}Ea&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,ga,y));if(ya)for($ in ya)D=ya[$],D.__original.needsUpdate&&
+(o.bindBuffer(o.ARRAY_BUFFER,D.buffer),o.bufferData(o.ARRAY_BUFFER,D.array,y));if(Ga){H=0;for(D=La.length;H<D;H++)o.bindBuffer(o.ARRAY_BUFFER,p.__webglMorphTargetsBuffers[H]),o.bufferData(o.ARRAY_BUFFER,qa[H],y)}Ca&&pa>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,da,y));Ha&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglNormalBuffer),o.bufferData(o.ARRAY_BUFFER,ka,y));Ka&&na.hasTangents&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglTangentBuffer),o.bufferData(o.ARRAY_BUFFER,ha,
+y));Aa&&X>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglUVBuffer),o.bufferData(o.ARRAY_BUFFER,va,y));Aa&&ra>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglUV2Buffer),o.bufferData(o.ARRAY_BUFFER,wa,y));Ba&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,ua,y),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,xa,y));Q>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinVertexABuffer),o.bufferData(o.ARRAY_BUFFER,ca,y),o.bindBuffer(o.ARRAY_BUFFER,
+p.__webglSkinVertexBBuffer),o.bufferData(o.ARRAY_BUFFER,aa,y),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinIndicesBuffer),o.bufferData(o.ARRAY_BUFFER,ea,y),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinWeightsBuffer),o.bufferData(o.ARRAY_BUFFER,fa,y));z&&(delete p.__inittedArrays,delete p.__colorArray,delete p.__normalArray,delete p.__tangentArray,delete p.__uvArray,delete p.__uv2Array,delete p.__faceArray,delete p.__vertexArray,delete p.__lineArray,delete p.__skinVertexAArray,delete p.__skinVertexBArray,
+delete p.__skinIndexArray,delete p.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;F(m)}else if(k instanceof THREE.Ribbon){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=w=z=z=void 0;v=k.vertices;t=k.colors;u=v.length;p=t.length;K=k.__vertexArray;y=k.__colorArray;S=k.__dirtyColors;if(k.__dirtyVertices){for(z=0;z<u;z++)w=v[z].position,n=z*3,K[n]=w.x,K[n+1]=w.y,
+K[n+2]=w.z;o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,K,m)}if(S){for(z=0;z<p;z++)color=t[z],n=z*3,y[n]=color.r,y[n+1]=color.g,y[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,y,m)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(k instanceof THREE.Line){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=w=z=z=void 0;v=k.vertices;t=k.colors;u=v.length;p=t.length;K=k.__vertexArray;y=k.__colorArray;
+S=k.__dirtyColors;if(k.__dirtyVertices){for(z=0;z<u;z++)w=v[z].position,n=z*3,K[n]=w.x,K[n+1]=w.y,K[n+2]=w.z;o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,K,m)}if(S){for(z=0;z<p;z++)color=t[z],n=z*3,y[n]=color.r,y[n+1]=color.g,y[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,y,m)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(k instanceof THREE.ParticleSystem)h=k.geometry,p=E(h),(h.__dirtyVertices||h.__dirtyColors||k.sortParticles||
+p)&&c(h,o.DYNAMIC_DRAW,k),h.__dirtyVertices=!1,h.__dirtyColors=!1,F(h)};this.setFaceCulling=function(b,e){b?(!e||e=="ccw"?o.frontFace(o.CCW):o.frontFace(o.CW),b=="back"?o.cullFace(o.BACK):b=="front"?o.cullFace(o.FRONT):o.cullFace(o.FRONT_AND_BACK),o.enable(o.CULL_FACE)):o.disable(o.CULL_FACE)};this.supportsVertexTextures=function(){return Ha}};
 THREE.WebGLRenderTarget=function(b,c,e){this.width=b;this.height=c;e=e||{};this.wrapS=e.wrapS!==void 0?e.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=e.wrapT!==void 0?e.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=e.magFilter!==void 0?e.magFilter:THREE.LinearFilter;this.minFilter=e.minFilter!==void 0?e.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=e.format!==void 0?e.format:THREE.RGBAFormat;this.type=e.type!==void 0?e.type:
 THREE.UnsignedByteType;this.depthBuffer=e.depthBuffer!==void 0?e.depthBuffer:!0;this.stencilBuffer=e.stencilBuffer!==void 0?e.stencilBuffer:!0};
 THREE.WebGLRenderTarget.prototype.clone=function(){var b=new THREE.WebGLRenderTarget(this.width,this.height);b.wrapS=this.wrapS;b.wrapT=this.wrapT;b.magFilter=this.magFilter;b.minFilter=this.minFilter;b.offset.copy(this.offset);b.repeat.copy(this.repeat);b.format=this.format;b.type=this.type;b.depthBuffer=this.depthBuffer;b.stencilBuffer=this.stencilBuffer;return b};THREE.WebGLRenderTargetCube=function(b,c,e){THREE.WebGLRenderTarget.call(this,b,c,e);this.activeCubeFace=0};
@@ -341,21 +340,21 @@ THREE.WebGLRenderTargetCube.prototype=new THREE.WebGLRenderTarget;THREE.WebGLRen
 THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableObject=function(){this.z=this.object=null};THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.materials=null};
-THREE.ColorUtils={adjustHSV:function(b,c,e,f){var h=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,h);h.h=THREE.ColorUtils.clamp(h.h+c,0,1);h.s=THREE.ColorUtils.clamp(h.s+e,0,1);h.v=THREE.ColorUtils.clamp(h.v+f,0,1);b.setHSV(h.h,h.s,h.v)},rgbToHsv:function(b,c){var e=b.r,f=b.g,h=b.b,k=Math.max(Math.max(e,f),h),m=Math.min(Math.min(e,f),h);if(m==k)m=e=0;else{var n=k-m,m=n/k,e=e==k?(f-h)/n:f==k?2+(h-e)/n:4+(e-f)/n;e/=6;e<0&&(e+=1);e>1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=m;c.v=k;return c},
+THREE.ColorUtils={adjustHSV:function(b,c,e,f){var m=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,m);m.h=THREE.ColorUtils.clamp(m.h+c,0,1);m.s=THREE.ColorUtils.clamp(m.s+e,0,1);m.v=THREE.ColorUtils.clamp(m.v+f,0,1);b.setHSV(m.h,m.s,m.v)},rgbToHsv:function(b,c){var e=b.r,f=b.g,m=b.b,h=Math.max(Math.max(e,f),m),k=Math.min(Math.min(e,f),m);if(k==h)k=e=0;else{var n=h-k,k=n/h,e=e==h?(f-m)/n:f==h?2+(m-e)/n:4+(e-f)/n;e/=6;e<0&&(e+=1);e>1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=k;c.v=h;return c},
 clamp:function(b,c,e){return b<c?c:b>e?e:b}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
-THREE.GeometryUtils={merge:function(b,c){var e,f,h=b.vertices.length,k=c instanceof THREE.Mesh?c.geometry:c,m=b.vertices,n=k.vertices,u=b.faces,p=k.faces,w=b.faceVertexUvs[0],k=k.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var t=0,x=n.length;t<x;t++){var v=new THREE.Vertex(n[t].position.clone());e&&e.multiplyVector3(v.position);m.push(v)}t=0;for(x=p.length;t<x;t++){var v=p[t],z,y,B=v.vertexNormals,
-C=v.vertexColors;v instanceof THREE.Face3?z=new THREE.Face3(v.a+h,v.b+h,v.c+h):v instanceof THREE.Face4&&(z=new THREE.Face4(v.a+h,v.b+h,v.c+h,v.d+h));z.normal.copy(v.normal);f&&f.multiplyVector3(z.normal);m=0;for(n=B.length;m<n;m++)y=B[m].clone(),f&&f.multiplyVector3(y),z.vertexNormals.push(y);z.color.copy(v.color);m=0;for(n=C.length;m<n;m++)y=C[m],z.vertexColors.push(y.clone());z.materials=v.materials.slice();z.centroid.copy(v.centroid);e&&e.multiplyVector3(z.centroid);u.push(z)}t=0;for(x=k.length;t<
-x;t++){e=k[t];f=[];m=0;for(n=e.length;m<n;m++)f.push(new THREE.UV(e[m].u,e[m].v));w.push(f)}},clone:function(b){var c=new THREE.Geometry,e,f=b.vertices,h=b.faces,k=b.faceVertexUvs[0],b=0;for(e=f.length;b<e;b++){var m=new THREE.Vertex(f[b].position.clone());c.vertices.push(m)}b=0;for(e=h.length;b<e;b++){var n=h[b],u,p,w=n.vertexNormals,t=n.vertexColors;n instanceof THREE.Face3?u=new THREE.Face3(n.a,n.b,n.c):n instanceof THREE.Face4&&(u=new THREE.Face4(n.a,n.b,n.c,n.d));u.normal.copy(n.normal);f=0;
-for(m=w.length;f<m;f++)p=w[f],u.vertexNormals.push(p.clone());u.color.copy(n.color);f=0;for(m=t.length;f<m;f++)p=t[f],u.vertexColors.push(p.clone());u.materials=n.materials.slice();u.centroid.copy(n.centroid);c.faces.push(u)}b=0;for(e=k.length;b<e;b++){h=k[b];u=[];f=0;for(m=h.length;f<m;f++)u.push(new THREE.UV(h[f].u,h[f].v));c.faceVertexUvs[0].push(u)}return c},randomPointInTriangle:function(b,c,e){var f,h,k,m=new THREE.Vector3,n=THREE.GeometryUtils.__v1;f=THREE.GeometryUtils.random();h=THREE.GeometryUtils.random();
-f+h>1&&(f=1-f,h=1-h);k=1-f-h;m.copy(b);m.multiplyScalar(f);n.copy(c);n.multiplyScalar(h);m.addSelf(n);n.copy(e);n.multiplyScalar(k);m.addSelf(n);return m},randomPointInFace:function(b,c,e){var f,h,k;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,h=c.vertices[b.b].position,k=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,h,k);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;h=c.vertices[b.b].position;k=c.vertices[b.c].position;var c=c.vertices[b.d].position,
-m;e?b._area1&&b._area2?(e=b._area1,m=b._area2):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c),b._area1=e,b._area2=m):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c));return THREE.GeometryUtils.random()*(e+m)<e?THREE.GeometryUtils.randomPointInTriangle(f,h,c):THREE.GeometryUtils.randomPointInTriangle(h,k,c)}},randomPointsInGeometry:function(b,c){function e(b){function e(c,f){if(f<c)return c;var h=c+Math.floor((f-c)/2);return p[h]>
-b?e(c,h-1):p[h]<b?e(h+1,f):h}return e(0,p.length-1)}var f,h,k=b.faces,m=b.vertices,n=k.length,u=0,p=[],w,t,x,v;for(h=0;h<n;h++){f=k[h];if(f instanceof THREE.Face3)w=m[f.a].position,t=m[f.b].position,x=m[f.c].position,f._area=THREE.GeometryUtils.triangleArea(w,t,x);else if(f instanceof THREE.Face4)w=m[f.a].position,t=m[f.b].position,x=m[f.c].position,v=m[f.d].position,f._area1=THREE.GeometryUtils.triangleArea(w,t,v),f._area2=THREE.GeometryUtils.triangleArea(t,x,v),f._area=f._area1+f._area2;u+=f._area;
-p[h]=u}f=[];m={};for(h=0;h<c;h++)n=THREE.GeometryUtils.random()*u,n=e(n),f[h]=THREE.GeometryUtils.randomPointInFace(k[n],b,!0),m[n]?m[n]+=1:m[n]=1;return f},triangleArea:function(b,c,e){var f,h=THREE.GeometryUtils.__v1;h.sub(b,c);f=h.length();h.sub(b,e);b=h.length();h.sub(c,e);e=h.length();c=0.5*(f+b+e);return Math.sqrt(c*(c-f)*(c-b)*(c-e))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},center:function(b){b.computeBoundingBox();var c=new THREE.Matrix4;c.setTranslation(-0.5*
+THREE.GeometryUtils={merge:function(b,c){var e,f,m=b.vertices.length,h=c instanceof THREE.Mesh?c.geometry:c,k=b.vertices,n=h.vertices,p=b.faces,u=h.faces,w=b.faceVertexUvs[0],h=h.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var t=0,x=n.length;t<x;t++){var v=new THREE.Vertex(n[t].position.clone());e&&e.multiplyVector3(v.position);k.push(v)}t=0;for(x=u.length;t<x;t++){var v=u[t],z,y,B=v.vertexNormals,
+C=v.vertexColors;v instanceof THREE.Face3?z=new THREE.Face3(v.a+m,v.b+m,v.c+m):v instanceof THREE.Face4&&(z=new THREE.Face4(v.a+m,v.b+m,v.c+m,v.d+m));z.normal.copy(v.normal);f&&f.multiplyVector3(z.normal);k=0;for(n=B.length;k<n;k++)y=B[k].clone(),f&&f.multiplyVector3(y),z.vertexNormals.push(y);z.color.copy(v.color);k=0;for(n=C.length;k<n;k++)y=C[k],z.vertexColors.push(y.clone());z.materials=v.materials.slice();z.centroid.copy(v.centroid);e&&e.multiplyVector3(z.centroid);p.push(z)}t=0;for(x=h.length;t<
+x;t++){e=h[t];f=[];k=0;for(n=e.length;k<n;k++)f.push(new THREE.UV(e[k].u,e[k].v));w.push(f)}},clone:function(b){var c=new THREE.Geometry,e,f=b.vertices,m=b.faces,h=b.faceVertexUvs[0],b=0;for(e=f.length;b<e;b++){var k=new THREE.Vertex(f[b].position.clone());c.vertices.push(k)}b=0;for(e=m.length;b<e;b++){var n=m[b],p,u,w=n.vertexNormals,t=n.vertexColors;n instanceof THREE.Face3?p=new THREE.Face3(n.a,n.b,n.c):n instanceof THREE.Face4&&(p=new THREE.Face4(n.a,n.b,n.c,n.d));p.normal.copy(n.normal);f=0;
+for(k=w.length;f<k;f++)u=w[f],p.vertexNormals.push(u.clone());p.color.copy(n.color);f=0;for(k=t.length;f<k;f++)u=t[f],p.vertexColors.push(u.clone());p.materials=n.materials.slice();p.centroid.copy(n.centroid);c.faces.push(p)}b=0;for(e=h.length;b<e;b++){m=h[b];p=[];f=0;for(k=m.length;f<k;f++)p.push(new THREE.UV(m[f].u,m[f].v));c.faceVertexUvs[0].push(p)}return c},randomPointInTriangle:function(b,c,e){var f,m,h,k=new THREE.Vector3,n=THREE.GeometryUtils.__v1;f=THREE.GeometryUtils.random();m=THREE.GeometryUtils.random();
+f+m>1&&(f=1-f,m=1-m);h=1-f-m;k.copy(b);k.multiplyScalar(f);n.copy(c);n.multiplyScalar(m);k.addSelf(n);n.copy(e);n.multiplyScalar(h);k.addSelf(n);return k},randomPointInFace:function(b,c,e){var f,m,h;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,m=c.vertices[b.b].position,h=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,m,h);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;m=c.vertices[b.b].position;h=c.vertices[b.c].position;var c=c.vertices[b.d].position,
+k;e?b._area1&&b._area2?(e=b._area1,k=b._area2):(e=THREE.GeometryUtils.triangleArea(f,m,c),k=THREE.GeometryUtils.triangleArea(m,h,c),b._area1=e,b._area2=k):(e=THREE.GeometryUtils.triangleArea(f,m,c),k=THREE.GeometryUtils.triangleArea(m,h,c));return THREE.GeometryUtils.random()*(e+k)<e?THREE.GeometryUtils.randomPointInTriangle(f,m,c):THREE.GeometryUtils.randomPointInTriangle(m,h,c)}},randomPointsInGeometry:function(b,c){function e(b){function e(c,f){if(f<c)return c;var h=c+Math.floor((f-c)/2);return u[h]>
+b?e(c,h-1):u[h]<b?e(h+1,f):h}return e(0,u.length-1)}var f,m,h=b.faces,k=b.vertices,n=h.length,p=0,u=[],w,t,x,v;for(m=0;m<n;m++){f=h[m];if(f instanceof THREE.Face3)w=k[f.a].position,t=k[f.b].position,x=k[f.c].position,f._area=THREE.GeometryUtils.triangleArea(w,t,x);else if(f instanceof THREE.Face4)w=k[f.a].position,t=k[f.b].position,x=k[f.c].position,v=k[f.d].position,f._area1=THREE.GeometryUtils.triangleArea(w,t,v),f._area2=THREE.GeometryUtils.triangleArea(t,x,v),f._area=f._area1+f._area2;p+=f._area;
+u[m]=p}f=[];k={};for(m=0;m<c;m++)n=THREE.GeometryUtils.random()*p,n=e(n),f[m]=THREE.GeometryUtils.randomPointInFace(h[n],b,!0),k[n]?k[n]+=1:k[n]=1;return f},triangleArea:function(b,c,e){var f,m=THREE.GeometryUtils.__v1;m.sub(b,c);f=m.length();m.sub(b,e);b=m.length();m.sub(c,e);e=m.length();c=0.5*(f+b+e);return Math.sqrt(c*(c-f)*(c-b)*(c-e))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},center:function(b){b.computeBoundingBox();var c=new THREE.Matrix4;c.setTranslation(-0.5*
 (b.boundingBox.x[1]+b.boundingBox.x[0]),-0.5*(b.boundingBox.y[1]+b.boundingBox.y[0]),-0.5*(b.boundingBox.z[1]+b.boundingBox.z[0]));b.applyMatrix(c);b.computeBoundingBox()}};THREE.GeometryUtils.random=THREE.GeometryUtils.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;
-THREE.ImageUtils={loadTexture:function(b,c,e){var f=new Image,h=new THREE.Texture(f,c);f.onload=function(){h.needsUpdate=!0;e&&e(this)};f.crossOrigin="";f.src=b;return h},loadTextureCube:function(b,c,e){var f,h=[],k=new THREE.Texture(h,c),c=h.loadCount=0;for(f=b.length;c<f;++c)h[c]=new Image,h[c].onload=function(){h.loadCount+=1;if(h.loadCount==6)k.needsUpdate=!0;e&&e(this)},h[c].crossOrigin="",h[c].src=b[c];return k},getNormalMap:function(b,c){var e=function(b){var e=Math.sqrt(b[0]*b[0]+b[1]*b[1]+
-b[2]*b[2]);return[b[0]/e,b[1]/e,b[2]/e]};c|=1;var f=b.width,h=b.height,k=document.createElement("canvas");k.width=f;k.height=h;var m=k.getContext("2d");m.drawImage(b,0,0);for(var n=m.getImageData(0,0,f,h).data,u=m.createImageData(f,h),p=u.data,w=0;w<f;w++)for(var t=1;t<h;t++){var x=t-1<0?h-1:t-1,v=(t+1)%h,z=w-1<0?f-1:w-1,y=(w+1)%f,B=[],C=[0,0,n[(t*f+w)*4]/255*c];B.push([-1,0,n[(t*f+z)*4]/255*c]);B.push([-1,-1,n[(x*f+z)*4]/255*c]);B.push([0,-1,n[(x*f+w)*4]/255*c]);B.push([1,-1,n[(x*f+y)*4]/255*c]);
-B.push([1,0,n[(t*f+y)*4]/255*c]);B.push([1,1,n[(v*f+y)*4]/255*c]);B.push([0,1,n[(v*f+w)*4]/255*c]);B.push([-1,1,n[(v*f+z)*4]/255*c]);x=[];z=B.length;for(v=0;v<z;v++){var y=B[v],E=B[(v+1)%z],y=[y[0]-C[0],y[1]-C[1],y[2]-C[2]],E=[E[0]-C[0],E[1]-C[1],E[2]-C[2]];x.push(e([y[1]*E[2]-y[2]*E[1],y[2]*E[0]-y[0]*E[2],y[0]*E[1]-y[1]*E[0]]))}B=[0,0,0];for(v=0;v<x.length;v++)B[0]+=x[v][0],B[1]+=x[v][1],B[2]+=x[v][2];B[0]/=x.length;B[1]/=x.length;B[2]/=x.length;C=(t*f+w)*4;p[C]=(B[0]+1)/2*255|0;p[C+1]=(B[1]+0.5)*
-255|0;p[C+2]=B[2]*255|0;p[C+3]=255}m.putImageData(u,0,0);return k}};THREE.SceneUtils={showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var e,f,h=b.children.length;for(f=0;f<h;f++)e=b.children[f],c(e),THREE.SceneUtils.traverseHierarchy(e,c)}};
+THREE.ImageUtils={loadTexture:function(b,c,e){var f=new Image,m=new THREE.Texture(f,c);f.onload=function(){m.needsUpdate=!0;e&&e(this)};f.crossOrigin="";f.src=b;return m},loadTextureCube:function(b,c,e){var f,m=[],h=new THREE.Texture(m,c),c=m.loadCount=0;for(f=b.length;c<f;++c)m[c]=new Image,m[c].onload=function(){m.loadCount+=1;if(m.loadCount==6)h.needsUpdate=!0;e&&e(this)},m[c].crossOrigin="",m[c].src=b[c];return h},getNormalMap:function(b,c){var e=function(b){var e=Math.sqrt(b[0]*b[0]+b[1]*b[1]+
+b[2]*b[2]);return[b[0]/e,b[1]/e,b[2]/e]};c|=1;var f=b.width,m=b.height,h=document.createElement("canvas");h.width=f;h.height=m;var k=h.getContext("2d");k.drawImage(b,0,0);for(var n=k.getImageData(0,0,f,m).data,p=k.createImageData(f,m),u=p.data,w=0;w<f;w++)for(var t=1;t<m;t++){var x=t-1<0?m-1:t-1,v=(t+1)%m,z=w-1<0?f-1:w-1,y=(w+1)%f,B=[],C=[0,0,n[(t*f+w)*4]/255*c];B.push([-1,0,n[(t*f+z)*4]/255*c]);B.push([-1,-1,n[(x*f+z)*4]/255*c]);B.push([0,-1,n[(x*f+w)*4]/255*c]);B.push([1,-1,n[(x*f+y)*4]/255*c]);
+B.push([1,0,n[(t*f+y)*4]/255*c]);B.push([1,1,n[(v*f+y)*4]/255*c]);B.push([0,1,n[(v*f+w)*4]/255*c]);B.push([-1,1,n[(v*f+z)*4]/255*c]);x=[];z=B.length;for(v=0;v<z;v++){var y=B[v],E=B[(v+1)%z],y=[y[0]-C[0],y[1]-C[1],y[2]-C[2]],E=[E[0]-C[0],E[1]-C[1],E[2]-C[2]];x.push(e([y[1]*E[2]-y[2]*E[1],y[2]*E[0]-y[0]*E[2],y[0]*E[1]-y[1]*E[0]]))}B=[0,0,0];for(v=0;v<x.length;v++)B[0]+=x[v][0],B[1]+=x[v][1],B[2]+=x[v][2];B[0]/=x.length;B[1]/=x.length;B[2]/=x.length;C=(t*f+w)*4;u[C]=(B[0]+1)/2*255|0;u[C+1]=(B[1]+0.5)*
+255|0;u[C+2]=B[2]*255|0;u[C+3]=255}k.putImageData(p,0,0);return h}};THREE.SceneUtils={showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var e,f,m=b.children.length;for(f=0;f<m;f++)e=b.children[f],c(e),THREE.SceneUtils.traverseHierarchy(e,c)}};
 if(THREE.WebGLRenderer)THREE.ShaderUtils={lib:{fresnel:{uniforms:{mRefractionRatio:{type:"f",value:1.02},mFresnelBias:{type:"f",value:0.1},mFresnelPower:{type:"f",value:2},mFresnelScale:{type:"f",value:1},tCube:{type:"t",value:1,texture:null}},fragmentShader:"uniform samplerCube tCube;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\nvec4 refractedColor = vec4( 1.0, 1.0, 1.0, 1.0 );\nrefractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;\nrefractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;\nrefractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;\nrefractedColor.a = 1.0;\ngl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );\n}",
 vertexShader:"uniform float mRefractionRatio;\nuniform float mFresnelBias;\nuniform float mFresnelScale;\nuniform float mFresnelPower;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = normalize ( mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal );\nvec3 I = mPosition.xyz - cameraPosition;\nvReflect = reflect( I, nWorld );\nvRefract[0] = refract( normalize( I ), nWorld, mRefractionRatio );\nvRefract[1] = refract( normalize( I ), nWorld, mRefractionRatio * 0.99 );\nvRefract[2] = refract( normalize( I ), nWorld, mRefractionRatio * 0.98 );\nvReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), nWorld ), mFresnelPower );\ngl_Position = projectionMatrix * mvPosition;\n}"},
 normal:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.fog,THREE.UniformsLib.lights,{enableAO:{type:"i",value:0},enableDiffuse:{type:"i",value:0},enableSpecular:{type:"i",value:0},tDiffuse:{type:"t",value:0,texture:null},tNormal:{type:"t",value:2,texture:null},tSpecular:{type:"t",value:3,texture:null},tAO:{type:"t",value:4,texture:null},uNormalScale:{type:"f",value:1},tDisplacement:{type:"t",value:5,texture:null},uDisplacementBias:{type:"f",value:0},uDisplacementScale:{type:"f",value:1},uDiffuseColor:{type:"c",
@@ -364,67 +363,67 @@ THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( vec3( 1
 THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:"attribute vec4 tangent;\n#ifdef VERTEX_TEXTURES\nuniform sampler2D tDisplacement;\nuniform float uDisplacementScale;\nuniform float uDisplacementBias;\n#endif\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvViewPosition = -mvPosition.xyz;\nvNormal = normalize( normalMatrix * normal );\nvTangent = normalize( normalMatrix * tangent.xyz );\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvBinormal = normalize( vBinormal );\nvUv = uv;\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#ifdef VERTEX_TEXTURES\nvec3 dv = texture2D( tDisplacement, uv ).xyz;\nfloat df = uDisplacementScale * dv.x + uDisplacementBias;\nvec4 displacedPosition = vec4( vNormal.xyz * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif\n}"},
 cube:{uniforms:{tCube:{type:"t",value:1,texture:null}},vertexShader:"varying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvViewPosition = cameraPosition - mPosition.xyz;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform samplerCube tCube;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( - wPos.x, wPos.yz ) );\n}"}}};
 THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(b){return this.getPoint(this.getUtoTmapping(b))};THREE.Curve.prototype.getPoints=function(b){b||(b=5);var c,e=[];for(c=0;c<=b;c++)e.push(this.getPoint(c/b));return e};THREE.Curve.prototype.getSpacedPoints=function(b){b||(b=5);var c,e=[];for(c=0;c<=b;c++)e.push(this.getPointAt(c/b));return e};
-THREE.Curve.prototype.getLength=function(){var b=this.getLengths();return b[b.length-1]};THREE.Curve.prototype.getLengths=function(b){b||(b=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==b+1)return this.cacheArcLengths;var c=[],e,f=this.getPoint(0),h,k=0;c.push(0);for(h=1;h<=b;h++)e=this.getPoint(h/b),k+=e.distanceTo(f),c.push(k),f=e;return this.cacheArcLengths=c};
-THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,h=e.length,k;k=c?c:b*e[h-1];time=Date.now();for(var m=0,n=h-1,u;m<=n;)if(f=Math.floor(m+(n-m)/2),u=e[f]-k,u<0)m=f+1;else if(u>0)n=f-1;else{n=f;break}f=n;if(e[f]==k)return f/(h-1);m=e[f];return e=(f+(k-m)/(e[f+1]-m))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)};
+THREE.Curve.prototype.getLength=function(){var b=this.getLengths();return b[b.length-1]};THREE.Curve.prototype.getLengths=function(b){b||(b=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==b+1)return this.cacheArcLengths;var c=[],e,f=this.getPoint(0),m,h=0;c.push(0);for(m=1;m<=b;m++)e=this.getPoint(m/b),h+=e.distanceTo(f),c.push(h),f=e;return this.cacheArcLengths=c};
+THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,m=e.length,h;h=c?c:b*e[m-1];time=Date.now();for(var k=0,n=m-1,p;k<=n;)if(f=Math.floor(k+(n-k)/2),p=e[f]-h,p<0)k=f+1;else if(p>0)n=f-1;else{n=f;break}f=n;if(e[f]==h)return f/(m-1);k=e[f];return e=(f+(h-k)/(e[f+1]-k))/(m-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)};
 THREE.Curve.prototype.getTangent=function(b){var c=b-1.0E-4;b+=1.0E-4;c<0&&(c=0);b>1&&(b=1);var c=this.getPoint(c),b=this.getPoint(b),e=new THREE.Vector2;e.sub(b,c);return e.unit()};THREE.LineCurve=function(b,c){b instanceof THREE.Vector2?(this.v1=b,this.v2=c):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(b,c,e,f){this.constructor(new THREE.Vector2(b,c),new THREE.Vector2(e,f))};THREE.LineCurve.prototype=new THREE.Curve;
 THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2;c.sub(this.v2,this.v1);c.multiplyScalar(b).addSelf(this.v1);return c};THREE.LineCurve.prototype.getPointAt=function(b){return this.getPoint(b)};THREE.LineCurve.prototype.getTangent=function(){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.normalize();return b};
 THREE.QuadraticBezierCurve=function(b,c,e){if(!(c instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),b=new THREE.Vector2(f[0],f[1]),c=new THREE.Vector2(f[2],f[3]),e=new THREE.Vector2(f[4],f[5]);this.v0=b;this.v1=c;this.v2=e};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
 THREE.QuadraticBezierCurve.prototype.getPoint=function(b){var c;c=THREE.Shape.Utils.b2(b,this.v0.x,this.v1.x,this.v2.x);b=THREE.Shape.Utils.b2(b,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(c,b)};THREE.QuadraticBezierCurve.prototype.getTangent=function(b){var c;c=THREE.Curve.Utils.tangentQuadraticBezier(b,this.v0.x,this.v1.x,this.v2.x);b=THREE.Curve.Utils.tangentQuadraticBezier(b,this.v0.y,this.v1.y,this.v2.y);c=new THREE.Vector2(c,b);c.normalize();return c};
-THREE.CubicBezierCurve=function(b,c,e,f){if(!(c instanceof THREE.Vector2))var h=Array.prototype.slice.call(arguments),b=new THREE.Vector2(h[0],h[1]),c=new THREE.Vector2(h[2],h[3]),e=new THREE.Vector2(h[4],h[5]),f=new THREE.Vector2(h[6],h[7]);this.v0=b;this.v1=c;this.v2=e;this.v3=f};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve;
+THREE.CubicBezierCurve=function(b,c,e,f){if(!(c instanceof THREE.Vector2))var m=Array.prototype.slice.call(arguments),b=new THREE.Vector2(m[0],m[1]),c=new THREE.Vector2(m[2],m[3]),e=new THREE.Vector2(m[4],m[5]),f=new THREE.Vector2(m[6],m[7]);this.v0=b;this.v1=c;this.v2=e;this.v3=f};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve;
 THREE.CubicBezierCurve.prototype.getPoint=function(b){var c;c=THREE.Shape.Utils.b3(b,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b=THREE.Shape.Utils.b3(b,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(c,b)};THREE.CubicBezierCurve.prototype.getTangent=function(b){var c;c=THREE.Curve.Utils.tangentCubicBezier(b,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b=THREE.Curve.Utils.tangentCubicBezier(b,this.v0.y,this.v1.y,this.v2.y,this.v3.y);c=new THREE.Vector2(c,b);c.normalize();return c};
 THREE.SplineCurve=function(b){this.points=b};THREE.SplineCurve.prototype=new THREE.Curve;THREE.SplineCurve.prototype.constructor=THREE.SplineCurve;
-THREE.SplineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2,e=[],f=this.points,h;h=(f.length-1)*b;b=Math.floor(h);h-=b;e[0]=b==0?b:b-1;e[1]=b;e[2]=b>f.length-2?b:b+1;e[3]=b>f.length-3?b:b+2;c.x=THREE.Curve.Utils.interpolate(f[e[0]].x,f[e[1]].x,f[e[2]].x,f[e[3]].x,h);c.y=THREE.Curve.Utils.interpolate(f[e[0]].y,f[e[1]].y,f[e[2]].y,f[e[3]].y,h);return c};THREE.ArcCurve=function(b,c,e,f,h,k){this.aX=b;this.aY=c;this.aRadius=e;this.aStartAngle=f;this.aEndAngle=h;this.aClockwise=k};
+THREE.SplineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2,e=[],f=this.points,m;m=(f.length-1)*b;b=Math.floor(m);m-=b;e[0]=b==0?b:b-1;e[1]=b;e[2]=b>f.length-2?b:b+1;e[3]=b>f.length-3?b:b+2;c.x=THREE.Curve.Utils.interpolate(f[e[0]].x,f[e[1]].x,f[e[2]].x,f[e[3]].x,m);c.y=THREE.Curve.Utils.interpolate(f[e[0]].y,f[e[1]].y,f[e[2]].y,f[e[3]].y,m);return c};THREE.ArcCurve=function(b,c,e,f,m,h){this.aX=b;this.aY=c;this.aRadius=e;this.aStartAngle=f;this.aEndAngle=m;this.aClockwise=h};
 THREE.ArcCurve.prototype=new THREE.Curve;THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.ArcCurve.prototype.getPoint=function(b){var c=this.aEndAngle-this.aStartAngle;this.aClockwise||(b=1-b);b=this.aStartAngle+b*c;return new THREE.Vector2(this.aX+this.aRadius*Math.cos(b),this.aY+this.aRadius*Math.sin(b))};
-THREE.Curve.Utils={tangentQuadraticBezier:function(b,c,e,f){return 2*(1-b)*(e-c)+2*b*(f-e)},tangentCubicBezier:function(b,c,e,f,h){return-3*c*(1-b)*(1-b)+3*e*(1-b)*(1-b)-6*b*e*(1-b)+6*b*f*(1-b)-3*b*b*f+3*b*b*h},tangentSpline:function(b){return 6*b*b-6*b+(3*b*b-4*b+1)+(-6*b*b+6*b)+(3*b*b-2*b)},interpolate:function(b,c,e,f,h){var b=(e-b)*0.5,f=(f-c)*0.5,k=h*h;return(2*c-2*e+b+f)*h*k+(-3*c+3*e-2*b-f)*k+b*h+c}};
+THREE.Curve.Utils={tangentQuadraticBezier:function(b,c,e,f){return 2*(1-b)*(e-c)+2*b*(f-e)},tangentCubicBezier:function(b,c,e,f,m){return-3*c*(1-b)*(1-b)+3*e*(1-b)*(1-b)-6*b*e*(1-b)+6*b*f*(1-b)-3*b*b*f+3*b*b*m},tangentSpline:function(b){return 6*b*b-6*b+(3*b*b-4*b+1)+(-6*b*b+6*b)+(3*b*b-2*b)},interpolate:function(b,c,e,f,m){var b=(e-b)*0.5,f=(f-c)*0.5,h=m*m;return(2*c-2*e+b+f)*m*h+(-3*c+3*e-2*b-f)*h+b*m+c}};
 THREE.Curve.create=function(b,c){b.prototype=new THREE.Curve;b.prototype.constructor=b;b.prototype.getPoint=c;return b};THREE.LineCurve3=THREE.Curve.create(function(b,c){this.v1=b;this.v2=c},function(b){var c=new THREE.Vector3;c.sub(v2,v1);c.multiplyScalar(b);c.addSelf(this.v1);return c});
 THREE.QuadraticBezierCurve3=THREE.Curve.create(function(b,c,e){this.v0=b;this.v1=c;this.v2=e},function(b){var c,e;c=THREE.Shape.Utils.b2(b,this.v0.x,this.v1.x,this.v2.x);e=THREE.Shape.Utils.b2(b,this.v0.y,this.v1.y,this.v2.y);b=THREE.Shape.Utils.b2(b,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(c,e,b)});
 THREE.CubicBezierCurve3=THREE.Curve.create(function(b,c,e,f){this.v0=b;this.v1=c;this.v2=e;this.v3=f},function(b){var c,e;c=THREE.Shape.Utils.b3(b,this.v0.x,this.v1.x,this.v2.x,this.v3.x);e=THREE.Shape.Utils.b3(b,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=THREE.Shape.Utils.b3(b,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(c,e,b)});
-THREE.SplineCurve3=THREE.Curve.create(function(b){this.points=b},function(b){var c=new THREE.Vector3,e=[],f=this.points,h;h=(f.length-1)*b;b=Math.floor(h);h-=b;e[0]=b==0?b:b-1;e[1]=b;e[2]=b>f.length-2?b:b+1;e[3]=b>f.length-3?b:b+2;c.x=THREE.Curve.Utils.interpolate(f[e[0]].x,f[e[1]].x,f[e[2]].x,f[e[3]].x,h);c.y=THREE.Curve.Utils.interpolate(f[e[0]].y,f[e[1]].y,f[e[2]].y,f[e[3]].y,h);c.z=THREE.Curve.Utils.interpolate(f[e[0]].z,f[e[1]].z,f[e[2]].z,f[e[3]].z,h);return c});
+THREE.SplineCurve3=THREE.Curve.create(function(b){this.points=b},function(b){var c=new THREE.Vector3,e=[],f=this.points,m;m=(f.length-1)*b;b=Math.floor(m);m-=b;e[0]=b==0?b:b-1;e[1]=b;e[2]=b>f.length-2?b:b+1;e[3]=b>f.length-3?b:b+2;c.x=THREE.Curve.Utils.interpolate(f[e[0]].x,f[e[1]].x,f[e[2]].x,f[e[3]].x,m);c.y=THREE.Curve.Utils.interpolate(f[e[0]].y,f[e[1]].y,f[e[2]].y,f[e[3]].y,m);c.z=THREE.Curve.Utils.interpolate(f[e[0]].z,f[e[1]].z,f[e[2]].z,f[e[3]].z,m);return c});
 THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(b){this.curves.push(b)};THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){};
 THREE.CurvePath.prototype.getPoint=function(b){for(var c=b*this.getLength(),e=this.getCurveLengths(),b=0;b<e.length;){if(e[b]>=c)return c=e[b]-c,b=this.curves[b],c=1-c/b.getLength(),b.getPointAt(c);b++}return null};THREE.CurvePath.prototype.getLength=function(){var b=this.getCurveLengths();return b[b.length-1]};
 THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var b=[],c=0,e,f=this.curves.length;for(e=0;e<f;e++)c+=this.curves[e].getLength(),b.push(c);return this.cacheLengths=b};
-THREE.CurvePath.prototype.getBoundingBox=function(){var b=this.getPoints(),c,e,f,h;c=e=Number.NEGATIVE_INFINITY;f=h=Number.POSITIVE_INFINITY;var k,m,n,u;u=new THREE.Vector2;m=0;for(n=b.length;m<n;m++){k=b[m];if(k.x>c)c=k.x;else if(k.x<f)f=k.x;if(k.y>e)e=k.y;else if(k.y<e)h=k.y;u.addSelf(k.x,k.y)}return{minX:f,minY:h,maxX:c,maxY:e,centroid:u.divideScalar(n)}};THREE.CurvePath.prototype.createPointsGeometry=function(b){return this.createGeometry(this.getPoints(b,!0))};
+THREE.CurvePath.prototype.getBoundingBox=function(){var b=this.getPoints(),c,e,f,m;c=e=Number.NEGATIVE_INFINITY;f=m=Number.POSITIVE_INFINITY;var h,k,n,p;p=new THREE.Vector2;k=0;for(n=b.length;k<n;k++){h=b[k];if(h.x>c)c=h.x;else if(h.x<f)f=h.x;if(h.y>e)e=h.y;else if(h.y<e)m=h.y;p.addSelf(h.x,h.y)}return{minX:f,minY:m,maxX:c,maxY:e,centroid:p.divideScalar(n)}};THREE.CurvePath.prototype.createPointsGeometry=function(b){return this.createGeometry(this.getPoints(b,!0))};
 THREE.CurvePath.prototype.createSpacedPointsGeometry=function(b){return this.createGeometry(this.getSpacedPoints(b,!0))};THREE.CurvePath.prototype.createGeometry=function(b){for(var c=new THREE.Geometry,e=0;e<b.length;e++)c.vertices.push(new THREE.Vertex(new THREE.Vector3(b[e].x,b[e].y,0)));return c};THREE.CurvePath.prototype.addWrapPath=function(b){this.bends.push(b)};
-THREE.CurvePath.prototype.getTransformedPoints=function(b,c){var e=this.getPoints(b),f,h;if(!c)c=this.bends;f=0;for(h=c.length;f<h;f++)e=this.getWrapPoints(e,c[f]);return e};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(b,c){var e=this.getSpacedPoints(b),f,h;if(!c)c=this.bends;f=0;for(h=c.length;f<h;f++)e=this.getWrapPoints(e,c[f]);return e};
-THREE.CurvePath.prototype.getWrapPoints=function(b,c){var e=this.getBoundingBox(),f,h,k,m,n,u;f=0;for(h=b.length;f<h;f++)k=b[f],m=k.x,n=k.y,u=m/e.maxX,u=c.getUtoTmapping(u,m),m=c.getPoint(u),n=c.getNormalVector(u).multiplyScalar(n),k.x=m.x+n.x,k.y=m.y+n.y;return b};THREE.Path=function(b){THREE.CurvePath.call(this);this.actions=[];b&&this.fromPoints(b)};THREE.Path.prototype=new THREE.CurvePath;THREE.Path.prototype.constructor=THREE.Path;
+THREE.CurvePath.prototype.getTransformedPoints=function(b,c){var e=this.getPoints(b),f,m;if(!c)c=this.bends;f=0;for(m=c.length;f<m;f++)e=this.getWrapPoints(e,c[f]);return e};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(b,c){var e=this.getSpacedPoints(b),f,m;if(!c)c=this.bends;f=0;for(m=c.length;f<m;f++)e=this.getWrapPoints(e,c[f]);return e};
+THREE.CurvePath.prototype.getWrapPoints=function(b,c){var e=this.getBoundingBox(),f,m,h,k,n,p;f=0;for(m=b.length;f<m;f++)h=b[f],k=h.x,n=h.y,p=k/e.maxX,p=c.getUtoTmapping(p,k),k=c.getPoint(p),n=c.getNormalVector(p).multiplyScalar(n),h.x=k.x+n.x,h.y=k.y+n.y;return b};THREE.Path=function(b){THREE.CurvePath.call(this);this.actions=[];b&&this.fromPoints(b)};THREE.Path.prototype=new THREE.CurvePath;THREE.Path.prototype.constructor=THREE.Path;
 THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc"};THREE.Path.prototype.fromPoints=function(b){this.moveTo(b[0].x,b[0].y);var c,e=b.length;for(c=1;c<e;c++)this.lineTo(b[c].x,b[c].y)};THREE.Path.prototype.moveTo=function(){var b=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:b})};
 THREE.Path.prototype.lineTo=function(b,c){var e=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args;this.curves.push(new THREE.LineCurve(new THREE.Vector2(f[f.length-2],f[f.length-1]),new THREE.Vector2(b,c)));this.actions.push({action:THREE.PathActions.LINE_TO,args:e})};
-THREE.Path.prototype.quadraticCurveTo=function(b,c,e,f){var h=Array.prototype.slice.call(arguments),k=this.actions[this.actions.length-1].args;this.curves.push(new THREE.QuadraticBezierCurve(new THREE.Vector2(k[k.length-2],k[k.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f)));this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:h})};
-THREE.Path.prototype.bezierCurveTo=function(b,c,e,f,h,k){var m=Array.prototype.slice.call(arguments),n=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(n[n.length-2],n[n.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f),new THREE.Vector2(h,k)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:m})};
+THREE.Path.prototype.quadraticCurveTo=function(b,c,e,f){var m=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args;this.curves.push(new THREE.QuadraticBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f)));this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:m})};
+THREE.Path.prototype.bezierCurveTo=function(b,c,e,f,m,h){var k=Array.prototype.slice.call(arguments),n=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(n[n.length-2],n[n.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f),new THREE.Vector2(m,h)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:k})};
 THREE.Path.prototype.splineThru=function(b){var c=Array.prototype.slice.call(arguments),e=this.actions[this.actions.length-1].args,e=[new THREE.Vector2(e[e.length-2],e[e.length-1])];Array.prototype.push.apply(e,b);this.curves.push(new THREE.SplineCurve(e));this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:c})};
-THREE.Path.prototype.arc=function(b,c,e,f,h,k){var m=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(b,c,e,f,h,k));this.actions.push({action:THREE.PathActions.ARC,args:m})};THREE.Path.prototype.getSpacedPoints=function(b){b||(b=40);for(var c=[],e=0;e<b;e++)c.push(this.getPoint(e/b));return c};
-THREE.Path.prototype.getPoints=function(b,c){var b=b||12,e=[],f,h,k,m,n,u,p,w,t,x,v,z,y;f=0;for(h=this.actions.length;f<h;f++)switch(k=this.actions[f],m=k.action,k=k.args,m){case THREE.PathActions.LINE_TO:e.push(new THREE.Vector2(k[0],k[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:n=k[2];u=k[3];t=k[0];x=k[1];e.length>0?(m=e[e.length-1],v=m.x,z=m.y):(m=this.actions[f-1].args,v=m[m.length-2],z=m[m.length-1]);for(m=1;m<=b;m++)y=m/b,k=THREE.Shape.Utils.b2(y,v,t,n),y=THREE.Shape.Utils.b2(y,z,x,
-u),e.push(new THREE.Vector2(k,y));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];u=k[5];t=k[0];x=k[1];p=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,z=m.y):(m=this.actions[f-1].args,v=m[m.length-2],z=m[m.length-1]);for(m=1;m<=b;m++)y=m/b,k=THREE.Shape.Utils.b3(y,v,t,p,n),y=THREE.Shape.Utils.b3(y,z,x,w,u),e.push(new THREE.Vector2(k,y));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];y=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m);
-for(m=1;m<=y;m++)e.push(k.getPointAt(m/y));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];u=k[1];p=k[2];t=k[3];y=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);z=y-t;var B=b*2;for(m=1;m<=B;m++)y=m/B,x||(y=1-y),y=t+y*z,k=w+n+p*Math.cos(y),y=v+u+p*Math.sin(y),e.push(new THREE.Vector2(k,y))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)};
-THREE.Path.prototype.nltransform=function(b,c,e,f,h,k){var m=this.getPoints(),n,u,p,w,t;n=0;for(u=m.length;n<u;n++)p=m[n],w=p.x,t=p.y,p.x=b*w+c*t+e,p.y=f*t+h*w+k;return m};
-THREE.Path.prototype.debug=function(b){var c=this.getBoundingBox();b||(b=document.createElement("canvas"),b.setAttribute("width",c.maxX+100),b.setAttribute("height",c.maxY+100),document.body.appendChild(b));c=b.getContext("2d");c.fillStyle="white";c.fillRect(0,0,b.width,b.height);c.strokeStyle="black";c.beginPath();var e,f,h,b=0;for(e=this.actions.length;b<e;b++)f=this.actions[b],h=f.args,f=f.action,f!=THREE.PathActions.CSPLINE_THRU&&c[f].apply(c,h);c.stroke();c.closePath();c.strokeStyle="red";f=
-this.getPoints();b=0;for(e=f.length;b<e;b++)h=f[b],c.beginPath(),c.arc(h.x,h.y,1.5,0,Math.PI*2,!1),c.stroke(),c.closePath()};
-THREE.Path.prototype.toShapes=function(){var b,c,e,f,h=[],k=new THREE.Path;b=0;for(c=this.actions.length;b<c;b++)e=this.actions[b],f=e.args,e=e.action,e==THREE.PathActions.MOVE_TO&&k.actions.length!=0&&(h.push(k),k=new THREE.Path),k[e].apply(k,f);k.actions.length!=0&&h.push(k);if(h.length==0)return[];var m,k=[];if(THREE.Shape.Utils.isClockWise(h[0].getPoints())){b=0;for(c=h.length;b<c;b++)f=h[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(m&&k.push(m),m=new THREE.Shape,m.actions=f.actions,m.curves=
-f.curves):m.holes.push(f);k.push(m)}else{m=new THREE.Shape;b=0;for(c=h.length;b<c;b++)f=h[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(m.actions=f.actions,m.curves=f.curves,k.push(m),m=new THREE.Shape):m.holes.push(f)}return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;THREE.Shape.prototype.extrude=function(b){return new THREE.ExtrudeGeometry(this,b)};
+THREE.Path.prototype.arc=function(b,c,e,f,m,h){var k=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(b,c,e,f,m,h));this.actions.push({action:THREE.PathActions.ARC,args:k})};THREE.Path.prototype.getSpacedPoints=function(b){b||(b=40);for(var c=[],e=0;e<b;e++)c.push(this.getPoint(e/b));return c};
+THREE.Path.prototype.getPoints=function(b,c){var b=b||12,e=[],f,m,h,k,n,p,u,w,t,x,v,z,y;f=0;for(m=this.actions.length;f<m;f++)switch(h=this.actions[f],k=h.action,h=h.args,k){case THREE.PathActions.LINE_TO:e.push(new THREE.Vector2(h[0],h[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:n=h[2];p=h[3];t=h[0];x=h[1];e.length>0?(k=e[e.length-1],v=k.x,z=k.y):(k=this.actions[f-1].args,v=k[k.length-2],z=k[k.length-1]);for(k=1;k<=b;k++)y=k/b,h=THREE.Shape.Utils.b2(y,v,t,n),y=THREE.Shape.Utils.b2(y,z,x,
+p),e.push(new THREE.Vector2(h,y));break;case THREE.PathActions.BEZIER_CURVE_TO:n=h[4];p=h[5];t=h[0];x=h[1];u=h[2];w=h[3];e.length>0?(k=e[e.length-1],v=k.x,z=k.y):(k=this.actions[f-1].args,v=k[k.length-2],z=k[k.length-1]);for(k=1;k<=b;k++)y=k/b,h=THREE.Shape.Utils.b3(y,v,t,u,n),y=THREE.Shape.Utils.b3(y,z,x,w,p),e.push(new THREE.Vector2(h,y));break;case THREE.PathActions.CSPLINE_THRU:k=this.actions[f-1].args;k=[new THREE.Vector2(k[k.length-2],k[k.length-1])];y=b*h[0].length;k=k.concat(h[0]);h=new THREE.SplineCurve(k);
+for(k=1;k<=y;k++)e.push(h.getPointAt(k/y));break;case THREE.PathActions.ARC:k=this.actions[f-1].args;n=h[0];p=h[1];u=h[2];t=h[3];y=h[4];x=!!h[5];w=k[k.length-2];v=k[k.length-1];k.length==0&&(w=v=0);z=y-t;var B=b*2;for(k=1;k<=B;k++)y=k/B,x||(y=1-y),y=t+y*z,h=w+n+u*Math.cos(y),y=v+p+u*Math.sin(y),e.push(new THREE.Vector2(h,y))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)};
+THREE.Path.prototype.nltransform=function(b,c,e,f,m,h){var k=this.getPoints(),n,p,u,w,t;n=0;for(p=k.length;n<p;n++)u=k[n],w=u.x,t=u.y,u.x=b*w+c*t+e,u.y=f*t+m*w+h;return k};
+THREE.Path.prototype.debug=function(b){var c=this.getBoundingBox();b||(b=document.createElement("canvas"),b.setAttribute("width",c.maxX+100),b.setAttribute("height",c.maxY+100),document.body.appendChild(b));c=b.getContext("2d");c.fillStyle="white";c.fillRect(0,0,b.width,b.height);c.strokeStyle="black";c.beginPath();var e,f,m,b=0;for(e=this.actions.length;b<e;b++)f=this.actions[b],m=f.args,f=f.action,f!=THREE.PathActions.CSPLINE_THRU&&c[f].apply(c,m);c.stroke();c.closePath();c.strokeStyle="red";f=
+this.getPoints();b=0;for(e=f.length;b<e;b++)m=f[b],c.beginPath(),c.arc(m.x,m.y,1.5,0,Math.PI*2,!1),c.stroke(),c.closePath()};
+THREE.Path.prototype.toShapes=function(){var b,c,e,f,m=[],h=new THREE.Path;b=0;for(c=this.actions.length;b<c;b++)e=this.actions[b],f=e.args,e=e.action,e==THREE.PathActions.MOVE_TO&&h.actions.length!=0&&(m.push(h),h=new THREE.Path),h[e].apply(h,f);h.actions.length!=0&&m.push(h);if(m.length==0)return[];var k,h=[];if(THREE.Shape.Utils.isClockWise(m[0].getPoints())){b=0;for(c=m.length;b<c;b++)f=m[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(k&&h.push(k),k=new THREE.Shape,k.actions=f.actions,k.curves=
+f.curves):k.holes.push(f);h.push(k)}else{k=new THREE.Shape;b=0;for(c=m.length;b<c;b++)f=m[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(k.actions=f.actions,k.curves=f.curves,h.push(k),k=new THREE.Shape):k.holes.push(f)}return h};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;THREE.Shape.prototype.extrude=function(b){return new THREE.ExtrudeGeometry(this,b)};
 THREE.Shape.prototype.getPointsHoles=function(b){var c,e=this.holes.length,f=[];for(c=0;c<e;c++)f[c]=this.holes[c].getTransformedPoints(b,this.bends);return f};THREE.Shape.prototype.getSpacedPointsHoles=function(b){var c,e=this.holes.length,f=[];for(c=0;c<e;c++)f[c]=this.holes[c].getTransformedSpacedPoints(b,this.bends);return f};THREE.Shape.prototype.extractAllPoints=function(b){return{shape:this.getTransformedPoints(b),holes:this.getPointsHoles(b)}};
 THREE.Shape.prototype.extractAllSpacedPoints=function(b){return{shape:this.getTransformedSpacedPoints(b),holes:this.getSpacedPointsHoles(b)}};
-THREE.Shape.Utils={removeHoles:function(b,c){var e=b.concat(),f=e.concat(),h,k,m,n,u,p,w,t,x,v,z=[];for(u=0;u<c.length;u++){p=c[u];Array.prototype.push.apply(f,p);k=Number.POSITIVE_INFINITY;for(h=0;h<p.length;h++){x=p[h];v=[];for(t=0;t<e.length;t++)w=e[t],w=x.distanceToSquared(w),v.push(w),w<k&&(k=w,m=h,n=t)}h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:p.length-1;var y=[p[m],e[n],e[h]];t=THREE.FontUtils.Triangulate.area(y);var B=[p[m],p[k],e[n]];x=THREE.FontUtils.Triangulate.area(B);v=n;w=m;n+=1;m+=-1;n<
-0&&(n+=e.length);n%=e.length;m<0&&(m+=p.length);m%=p.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:p.length-1;y=[p[m],e[n],e[h]];y=THREE.FontUtils.Triangulate.area(y);B=[p[m],p[k],e[n]];B=THREE.FontUtils.Triangulate.area(B);t+x>y+B&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=p.length),m%=p.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:p.length-1);t=e.slice(0,n);x=e.slice(n);v=p.slice(m);w=p.slice(0,m);k=[p[m],p[k],e[n]];z.push([p[m],e[n],e[h]]);z.push(k);e=t.concat(v).concat(w).concat(x)}return{shape:e,
-isolatedPts:z,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,u,p={};k=0;for(m=f.length;k<m;k++)u=f[k].x+":"+f[k].y,p[u]!==void 0&&console.log("Duplicate point",u),p[u]=k;k=0;for(m=e.length;k<m;k++){n=e[k];for(f=0;f<3;f++)u=n[f].x+":"+n[f].y,u=p[u],u!==void 0&&(n[f]=u)}k=0;for(m=h.length;k<m;k++){n=h[k];for(f=0;f<3;f++)u=n[f].x+":"+n[f].y,u=p[u],u!==void 0&&(n[f]=u)}return e.concat(h)},
-isClockWise:function(b){return THREE.FontUtils.Triangulate.area(b)<0},b2p0:function(b,c){var e=1-b;return e*e*c},b2p1:function(b,c){return 2*(1-b)*b*c},b2p2:function(b,c){return b*b*c},b2:function(b,c,e,f){return this.b2p0(b,c)+this.b2p1(b,e)+this.b2p2(b,f)},b3p0:function(b,c){var e=1-b;return e*e*e*c},b3p1:function(b,c){var e=1-b;return 3*e*e*b*c},b3p2:function(b,c){return 3*(1-b)*b*b*c},b3p3:function(b,c){return b*b*b*c},b3:function(b,c,e,f,h){return this.b3p0(b,c)+this.b3p1(b,e)+this.b3p2(b,f)+
-this.b3p3(b,h)}};THREE.TextPath=function(b,c){THREE.Path.call(this);this.parameters=c||{};this.set(b)};THREE.TextPath.prototype.set=function(b,c){this.text=b;var c=c||this.parameters,e=c.curveSegments!==void 0?c.curveSegments:4,f=c.font!==void 0?c.font:"helvetiker",h=c.weight!==void 0?c.weight:"normal",k=c.style!==void 0?c.style:"normal";THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=e;THREE.FontUtils.face=f;THREE.FontUtils.weight=h;THREE.FontUtils.style=k};
+THREE.Shape.Utils={removeHoles:function(b,c){var e=b.concat(),f=e.concat(),m,h,k,n,p,u,w,t,x,v,z=[];for(p=0;p<c.length;p++){u=c[p];Array.prototype.push.apply(f,u);h=Number.POSITIVE_INFINITY;for(m=0;m<u.length;m++){x=u[m];v=[];for(t=0;t<e.length;t++)w=e[t],w=x.distanceToSquared(w),v.push(w),w<h&&(h=w,k=m,n=t)}m=n-1>=0?n-1:e.length-1;h=k-1>=0?k-1:u.length-1;var y=[u[k],e[n],e[m]];t=THREE.FontUtils.Triangulate.area(y);var B=[u[k],u[h],e[n]];x=THREE.FontUtils.Triangulate.area(B);v=n;w=k;n+=1;k+=-1;n<
+0&&(n+=e.length);n%=e.length;k<0&&(k+=u.length);k%=u.length;m=n-1>=0?n-1:e.length-1;h=k-1>=0?k-1:u.length-1;y=[u[k],e[n],e[m]];y=THREE.FontUtils.Triangulate.area(y);B=[u[k],u[h],e[n]];B=THREE.FontUtils.Triangulate.area(B);t+x>y+B&&(n=v,k=w,n<0&&(n+=e.length),n%=e.length,k<0&&(k+=u.length),k%=u.length,m=n-1>=0?n-1:e.length-1,h=k-1>=0?k-1:u.length-1);t=e.slice(0,n);x=e.slice(n);v=u.slice(k);w=u.slice(0,k);h=[u[k],u[h],e[n]];z.push([u[k],e[n],e[m]]);z.push(h);e=t.concat(v).concat(w).concat(x)}return{shape:e,
+isolatedPts:z,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,m=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),h,k,n,p,u={};h=0;for(k=f.length;h<k;h++)p=f[h].x+":"+f[h].y,u[p]!==void 0&&console.log("Duplicate point",p),u[p]=h;h=0;for(k=e.length;h<k;h++){n=e[h];for(f=0;f<3;f++)p=n[f].x+":"+n[f].y,p=u[p],p!==void 0&&(n[f]=p)}h=0;for(k=m.length;h<k;h++){n=m[h];for(f=0;f<3;f++)p=n[f].x+":"+n[f].y,p=u[p],p!==void 0&&(n[f]=p)}return e.concat(m)},
+isClockWise:function(b){return THREE.FontUtils.Triangulate.area(b)<0},b2p0:function(b,c){var e=1-b;return e*e*c},b2p1:function(b,c){return 2*(1-b)*b*c},b2p2:function(b,c){return b*b*c},b2:function(b,c,e,f){return this.b2p0(b,c)+this.b2p1(b,e)+this.b2p2(b,f)},b3p0:function(b,c){var e=1-b;return e*e*e*c},b3p1:function(b,c){var e=1-b;return 3*e*e*b*c},b3p2:function(b,c){return 3*(1-b)*b*b*c},b3p3:function(b,c){return b*b*b*c},b3:function(b,c,e,f,m){return this.b3p0(b,c)+this.b3p1(b,e)+this.b3p2(b,f)+
+this.b3p3(b,m)}};THREE.TextPath=function(b,c){THREE.Path.call(this);this.parameters=c||{};this.set(b)};THREE.TextPath.prototype.set=function(b,c){this.text=b;var c=c||this.parameters,e=c.curveSegments!==void 0?c.curveSegments:4,f=c.font!==void 0?c.font:"helvetiker",m=c.weight!==void 0?c.weight:"normal",h=c.style!==void 0?c.style:"normal";THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=e;THREE.FontUtils.face=f;THREE.FontUtils.weight=m;THREE.FontUtils.style=h};
 THREE.TextPath.prototype.toShapes=function(){for(var b=THREE.FontUtils.drawText(this.text).paths,c=[],e=0,f=b.length;e<f;e++)Array.prototype.push.apply(c,b[e].toShapes());return c};
 THREE.AnimationHandler=function(){var b=[],c={},e={update:function(e){for(var c=0;c<b.length;c++)b[c].update(e)},addToUpdate:function(e){b.indexOf(e)===-1&&b.push(e)},removeFromUpdate:function(e){e=b.indexOf(e);e!==-1&&b.splice(e,1)},add:function(b){c[b.name]!==void 0&&console.log("THREE.AnimationHandler.add: Warning! "+b.name+" already exists in library. Overwriting.");c[b.name]=b;if(b.initialized!==!0){for(var e=0;e<b.hierarchy.length;e++){for(var f=0;f<b.hierarchy[e].keys.length;f++){if(b.hierarchy[e].keys[f].time<
-0)b.hierarchy[e].keys[f].time=0;if(b.hierarchy[e].keys[f].rot!==void 0&&!(b.hierarchy[e].keys[f].rot instanceof THREE.Quaternion)){var n=b.hierarchy[e].keys[f].rot;b.hierarchy[e].keys[f].rot=new THREE.Quaternion(n[0],n[1],n[2],n[3])}}if(b.hierarchy[e].keys[0].morphTargets!==void 0){n={};for(f=0;f<b.hierarchy[e].keys.length;f++)for(var u=0;u<b.hierarchy[e].keys[f].morphTargets.length;u++){var p=b.hierarchy[e].keys[f].morphTargets[u];n[p]=-1}b.hierarchy[e].usedMorphTargets=n;for(f=0;f<b.hierarchy[e].keys.length;f++){var w=
-{};for(p in n){for(u=0;u<b.hierarchy[e].keys[f].morphTargets.length;u++)if(b.hierarchy[e].keys[f].morphTargets[u]===p){w[p]=b.hierarchy[e].keys[f].morphTargetsInfluences[u];break}u===b.hierarchy[e].keys[f].morphTargets.length&&(w[p]=0)}b.hierarchy[e].keys[f].morphTargetsInfluences=w}}for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].time===b.hierarchy[e].keys[f-1].time&&(b.hierarchy[e].keys.splice(f,1),f--);for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].index=f}f=parseInt(b.length*
+0)b.hierarchy[e].keys[f].time=0;if(b.hierarchy[e].keys[f].rot!==void 0&&!(b.hierarchy[e].keys[f].rot instanceof THREE.Quaternion)){var n=b.hierarchy[e].keys[f].rot;b.hierarchy[e].keys[f].rot=new THREE.Quaternion(n[0],n[1],n[2],n[3])}}if(b.hierarchy[e].keys[0].morphTargets!==void 0){n={};for(f=0;f<b.hierarchy[e].keys.length;f++)for(var p=0;p<b.hierarchy[e].keys[f].morphTargets.length;p++){var u=b.hierarchy[e].keys[f].morphTargets[p];n[u]=-1}b.hierarchy[e].usedMorphTargets=n;for(f=0;f<b.hierarchy[e].keys.length;f++){var w=
+{};for(u in n){for(p=0;p<b.hierarchy[e].keys[f].morphTargets.length;p++)if(b.hierarchy[e].keys[f].morphTargets[p]===u){w[u]=b.hierarchy[e].keys[f].morphTargetsInfluences[p];break}p===b.hierarchy[e].keys[f].morphTargets.length&&(w[u]=0)}b.hierarchy[e].keys[f].morphTargetsInfluences=w}}for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].time===b.hierarchy[e].keys[f-1].time&&(b.hierarchy[e].keys.splice(f,1),f--);for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].index=f}f=parseInt(b.length*
 b.fps,10);b.JIT={};b.JIT.hierarchy=[];for(e=0;e<b.hierarchy.length;e++)b.JIT.hierarchy.push(Array(f));b.initialized=!0}},get:function(b){if(typeof b==="string")return c[b]?c[b]:(console.log("THREE.AnimationHandler.get: Couldn't find animation "+b),null)},parse:function(b){var e=[];if(b instanceof THREE.SkinnedMesh)for(var c=0;c<b.bones.length;c++)e.push(b.bones[c]);else f(b,e);return e}},f=function(b,e){e.push(b);for(var c=0;c<b.children.length;c++)f(b.children[c],e)};e.LINEAR=0;e.CATMULLROM=1;e.CATMULLROM_FORWARD=
 2;return e}();THREE.Animation=function(b,c,e,f){this.root=b;this.data=THREE.AnimationHandler.get(c);this.hierarchy=THREE.AnimationHandler.parse(b);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=e!==void 0?e:THREE.AnimationHandler.LINEAR;this.JITCompile=f!==void 0?f:!0;this.points=[];this.target=new THREE.Vector3};
-THREE.Animation.prototype.play=function(b,c){if(!this.isPlaying){this.isPlaying=!0;this.loop=b!==void 0?b:!0;this.currentTime=c!==void 0?c:0;var e,f=this.hierarchy.length,h;for(e=0;e<f;e++){h=this.hierarchy[e];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)h.useQuaternion=!0;h.matrixAutoUpdate=!0;if(h.animationCache===void 0)h.animationCache={},h.animationCache.prevKey={pos:0,rot:0,scl:0},h.animationCache.nextKey={pos:0,rot:0,scl:0},h.animationCache.originalMatrix=h instanceof
-THREE.Bone?h.skinMatrix:h.matrix;var k=h.animationCache.prevKey;h=h.animationCache.nextKey;k.pos=this.data.hierarchy[e].keys[0];k.rot=this.data.hierarchy[e].keys[0];k.scl=this.data.hierarchy[e].keys[0];h.pos=this.getNextKeyWith("pos",e,1);h.rot=this.getNextKeyWith("rot",e,1);h.scl=this.getNextKeyWith("scl",e,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
+THREE.Animation.prototype.play=function(b,c){if(!this.isPlaying){this.isPlaying=!0;this.loop=b!==void 0?b:!0;this.currentTime=c!==void 0?c:0;var e,f=this.hierarchy.length,m;for(e=0;e<f;e++){m=this.hierarchy[e];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)m.useQuaternion=!0;m.matrixAutoUpdate=!0;if(m.animationCache===void 0)m.animationCache={},m.animationCache.prevKey={pos:0,rot:0,scl:0},m.animationCache.nextKey={pos:0,rot:0,scl:0},m.animationCache.originalMatrix=m instanceof
+THREE.Bone?m.skinMatrix:m.matrix;var h=m.animationCache.prevKey;m=m.animationCache.nextKey;h.pos=this.data.hierarchy[e].keys[0];h.rot=this.data.hierarchy[e].keys[0];h.scl=this.data.hierarchy[e].keys[0];m.pos=this.getNextKeyWith("pos",e,1);m.rot=this.getNextKeyWith("rot",e,1);m.scl=this.getNextKeyWith("scl",e,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var b=0;b<this.hierarchy.length;b++)if(this.hierarchy[b].animationCache!==void 0)this.hierarchy[b]instanceof THREE.Bone?this.hierarchy[b].skinMatrix=this.hierarchy[b].animationCache.originalMatrix:this.hierarchy[b].matrix=this.hierarchy[b].animationCache.originalMatrix,delete this.hierarchy[b].animationCache};
-THREE.Animation.prototype.update=function(b){if(this.isPlaying){var c=["pos","rot","scl"],e,f,h,k,m,n,u,p,w=this.data.JIT.hierarchy,t,x;this.currentTime+=b*this.timeScale;x=this.currentTime;t=this.currentTime%=this.data.length;p=parseInt(Math.min(t*this.data.fps,this.data.length*this.data.fps),10);for(var v=0,z=this.hierarchy.length;v<z;v++)if(b=this.hierarchy[v],u=b.animationCache,this.JITCompile&&w[v][p]!==void 0)b instanceof THREE.Bone?(b.skinMatrix=w[v][p],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=
-!1):(b.matrix=w[v][p],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)b instanceof THREE.Bone?b.skinMatrix=b.animationCache.originalMatrix:b.matrix=b.animationCache.originalMatrix;for(var y=0;y<3;y++){e=c[y];m=u.prevKey[e];n=u.nextKey[e];if(n.time<=x){if(t<x)if(this.loop){m=this.data.hierarchy[v].keys[0];for(n=this.getNextKeyWith(e,v,1);n.time<t;)m=n,n=this.getNextKeyWith(e,v,n.index+1)}else{this.stop();return}else{do m=n,n=this.getNextKeyWith(e,v,n.index+1);while(n.time<
-t)}u.prevKey[e]=m;u.nextKey[e]=n}b.matrixAutoUpdate=!0;b.matrixWorldNeedsUpdate=!0;f=(t-m.time)/(n.time-m.time);h=m[e];k=n[e];if(f<0||f>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
-this.getPrevKeyWith("pos",v,m.index-1).pos,this.points[1]=h,this.points[2]=k,this.points[3]=this.getNextKeyWith("pos",v,n.index+1).pos,f=f*0.33+0.33,h=this.interpolateCatmullRom(this.points,f),e.x=h[0],e.y=h[1],e.z=h[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e===
-"rot")THREE.Quaternion.slerp(h,k,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f}}if(this.JITCompile&&w[0][p]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;v<this.hierarchy.length;v++)w[v][p]=this.hierarchy[v]instanceof THREE.Bone?this.hierarchy[v].skinMatrix.clone():this.hierarchy[v].matrix.clone()}}};
-THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var e=[],f=[],h,k,m,n,u,p;h=(b.length-1)*c;k=Math.floor(h);h-=k;e[0]=k==0?k:k-1;e[1]=k;e[2]=k>b.length-2?k:k+1;e[3]=k>b.length-3?k:k+2;k=b[e[0]];n=b[e[1]];u=b[e[2]];p=b[e[3]];e=h*h;m=h*e;f[0]=this.interpolate(k[0],n[0],u[0],p[0],h,e,m);f[1]=this.interpolate(k[1],n[1],u[1],p[1],h,e,m);f[2]=this.interpolate(k[2],n[2],u[2],p[2],h,e,m);return f};
-THREE.Animation.prototype.interpolate=function(b,c,e,f,h,k,m){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*m+(-3*(c-e)-2*b-f)*k+b*h+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,e){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e=e<f.length-1?e:f.length-1:e%=f.length;e<f.length;e++)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[0]};
+THREE.Animation.prototype.update=function(b){if(this.isPlaying){var c=["pos","rot","scl"],e,f,m,h,k,n,p,u,w=this.data.JIT.hierarchy,t,x;this.currentTime+=b*this.timeScale;x=this.currentTime;t=this.currentTime%=this.data.length;u=parseInt(Math.min(t*this.data.fps,this.data.length*this.data.fps),10);for(var v=0,z=this.hierarchy.length;v<z;v++)if(b=this.hierarchy[v],p=b.animationCache,this.JITCompile&&w[v][u]!==void 0)b instanceof THREE.Bone?(b.skinMatrix=w[v][u],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=
+!1):(b.matrix=w[v][u],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)b instanceof THREE.Bone?b.skinMatrix=b.animationCache.originalMatrix:b.matrix=b.animationCache.originalMatrix;for(var y=0;y<3;y++){e=c[y];k=p.prevKey[e];n=p.nextKey[e];if(n.time<=x){if(t<x)if(this.loop){k=this.data.hierarchy[v].keys[0];for(n=this.getNextKeyWith(e,v,1);n.time<t;)k=n,n=this.getNextKeyWith(e,v,n.index+1)}else{this.stop();return}else{do k=n,n=this.getNextKeyWith(e,v,n.index+1);while(n.time<
+t)}p.prevKey[e]=k;p.nextKey[e]=n}b.matrixAutoUpdate=!0;b.matrixWorldNeedsUpdate=!0;f=(t-k.time)/(n.time-k.time);m=k[e];h=n[e];if(f<0||f>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=m[0]+(h[0]-m[0])*f,e.y=m[1]+(h[1]-m[1])*f,e.z=m[2]+(h[2]-m[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
+this.getPrevKeyWith("pos",v,k.index-1).pos,this.points[1]=m,this.points[2]=h,this.points[3]=this.getNextKeyWith("pos",v,n.index+1).pos,f=f*0.33+0.33,m=this.interpolateCatmullRom(this.points,f),e.x=m[0],e.y=m[1],e.z=m[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e===
+"rot")THREE.Quaternion.slerp(m,h,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=m[0]+(h[0]-m[0])*f,e.y=m[1]+(h[1]-m[1])*f,e.z=m[2]+(h[2]-m[2])*f}}if(this.JITCompile&&w[0][u]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;v<this.hierarchy.length;v++)w[v][u]=this.hierarchy[v]instanceof THREE.Bone?this.hierarchy[v].skinMatrix.clone():this.hierarchy[v].matrix.clone()}}};
+THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var e=[],f=[],m,h,k,n,p,u;m=(b.length-1)*c;h=Math.floor(m);m-=h;e[0]=h==0?h:h-1;e[1]=h;e[2]=h>b.length-2?h:h+1;e[3]=h>b.length-3?h:h+2;h=b[e[0]];n=b[e[1]];p=b[e[2]];u=b[e[3]];e=m*m;k=m*e;f[0]=this.interpolate(h[0],n[0],p[0],u[0],m,e,k);f[1]=this.interpolate(h[1],n[1],p[1],u[1],m,e,k);f[2]=this.interpolate(h[2],n[2],p[2],u[2],m,e,k);return f};
+THREE.Animation.prototype.interpolate=function(b,c,e,f,m,h,k){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*k+(-3*(c-e)-2*b-f)*h+b*m+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,e){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e=e<f.length-1?e:f.length-1:e%=f.length;e<f.length;e++)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(b,c,e){for(var f=this.data.hierarchy[c].keys,e=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e>0?e:0:e>=0?e:e+f.length;e>=0;e--)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[f.length-1]};
 THREE.CubeCamera=function(b,c,e,f){this.cameraPX=new THREE.Camera(90,1,b,c);this.cameraNX=new THREE.Camera(90,1,b,c);this.cameraPY=new THREE.Camera(90,1,b,c);this.cameraNY=new THREE.Camera(90,1,b,c);this.cameraPZ=new THREE.Camera(90,1,b,c);this.cameraNZ=new THREE.Camera(90,1,b,c);this.height=e;this.position=new THREE.Vector3(0,e,0);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position=this.position;this.cameraNY.position=this.position;this.cameraPZ.position=
 this.position;this.cameraNZ.position=this.position;this.cameraPY.up.set(0,0,1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.renderTarget=new THREE.WebGLRenderTargetCube(f,f,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updatePosition=function(b){this.position.x=b.x;this.position.z=b.z;this.cameraPX.target.position.add(this.position,new THREE.Vector3(-1,0,0));this.cameraNX.target.position.add(this.position,new THREE.Vector3(1,0,0));this.cameraPY.target.position.add(this.position,
@@ -437,144 +436,144 @@ this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this
 !1}this.mouseDragOn=!1};this.onMouseMove=function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=
 !0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}};this.update=function(){var b=(new Date).getTime();this.tdiff=(b-this.lastUpdate)/1E3;this.lastUpdate=b;if(!this.freeze){this.autoSpeedFactor=this.heightSpeed?this.tdiff*
 ((this.position.y<this.heightMin?this.heightMin:this.position.y>this.heightMax?this.heightMax:this.position.y)-this.heightMin)*this.heightCoef:0;var c=this.tdiff*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.translateZ(-(c+this.autoSpeedFactor));this.moveBackward&&this.translateZ(c);this.moveLeft&&this.translateX(-c);this.moveRight&&this.translateX(c);this.moveUp&&this.translateY(c);this.moveDown&&this.translateY(-c);c=this.tdiff*this.lookSpeed;this.activeLook||
-(c=0);this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target.position,h=this.position;b.x=h.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=h.y+100*Math.cos(this.phi);b.z=h.z+100*Math.sin(this.phi)*Math.sin(this.theta)}b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*
-c*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax-this.verticalMin)/(Math.PI-0)+this.verticalMin;b=this.target.position;h=this.position;b.x=h.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=h.y+100*Math.cos(this.phi);b.z=h.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},
+(c=0);this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target.position,m=this.position;b.x=m.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=m.y+100*Math.cos(this.phi);b.z=m.z+100*Math.sin(this.phi)*Math.sin(this.theta)}b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*
+c*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax-this.verticalMin)/(Math.PI-0)+this.verticalMin;b=this.target.position;m=this.position;b.x=m.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=m.y+100*Math.cos(this.phi);b.z=m.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},
 !1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};THREE.FirstPersonCamera.prototype=new THREE.Camera;THREE.FirstPersonCamera.prototype.constructor=THREE.FirstPersonCamera;
 THREE.FirstPersonCamera.prototype.supr=THREE.Camera.prototype;THREE.FirstPersonCamera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(b));this.target.position.addSelf(c.multiplyScalar(b))};
-THREE.PathCamera=function(b){function c(b,e,c,f){var h={name:c,fps:0.6,length:f,hierarchy:[]},k,m=e.getControlPointsArray(),n=e.getLength(),u=m.length,E=0;k=u-1;e={parent:-1,keys:[]};e.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};e.keys[k]={time:f,pos:m[k],rot:[0,0,0,1],scl:[1,1,1]};for(k=1;k<u-1;k++)E=f*n.chunks[k]/n.total,e.keys[k]={time:E,pos:m[k]};h.hierarchy[0]=e;THREE.AnimationHandler.add(h);return new THREE.Animation(b,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function e(b,e){var c,
+THREE.PathCamera=function(b){function c(b,e,c,f){var h={name:c,fps:0.6,length:f,hierarchy:[]},k,m=e.getControlPointsArray(),n=e.getLength(),p=m.length,E=0;k=p-1;e={parent:-1,keys:[]};e.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};e.keys[k]={time:f,pos:m[k],rot:[0,0,0,1],scl:[1,1,1]};for(k=1;k<p-1;k++)E=f*n.chunks[k]/n.total,e.keys[k]={time:E,pos:m[k]};h.hierarchy[0]=e;THREE.AnimationHandler.add(h);return new THREE.Animation(b,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function e(b,e){var c,
 f,h=new THREE.Geometry;for(c=0;c<b.points.length*e;c++)f=c/(b.points.length*e),f=b.getPoint(f),h.vertices[c]=new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z));return h}function f(b,c){var f=e(c,10),h=e(c,10),k=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(f,k);particleObj=new THREE.ParticleSystem(h,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.addChild(lineObj);particleObj.scale.set(1,1,1);b.addChild(particleObj);h=new THREE.SphereGeometry(1,
 16,8);k=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)f=new THREE.Mesh(h,k),f.position.copy(c.points[i]),f.updateMatrix(),b.addChild(f)}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookHorizontal=
 this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.domElement=document;if(b){if(b.duration!==void 0)this.duration=b.duration*1E3;if(b.waypoints!==void 0)this.waypoints=b.waypoints;if(b.useConstantSpeed!==void 0)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==void 0)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==void 0)this.createDebugPath=b.createDebugPath;
 if(b.createDebugDummy!==void 0)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==void 0)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==void 0)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==void 0)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=
-this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var h=Math.PI*2,k=Math.PI/180;this.update=function(b,e,c){var f,m;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,
-Math.min(85,this.lat));this.phi=(90-this.lat)*k;this.theta=this.lon*k;f=this.phi%h;this.phi=f>=0?f:f+h;f=this.verticalAngleMap.srcRange;m=this.verticalAngleMap.dstRange;var n=m[1]-m[0];this.phi=TWEEN.Easing.Quadratic.EaseInOut(((this.phi-f[0])*(m[1]-m[0])/(f[1]-f[0])+m[0]-m[0])/n)*n+m[0];f=this.horizontalAngleMap.srcRange;m=this.horizontalAngleMap.dstRange;n=m[1]-m[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-f[0])*(m[1]-m[0])/(f[1]-f[0])+m[0]-m[0])/n)*n+m[0];f=this.target.position;
+this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var m=Math.PI*2,h=Math.PI/180;this.update=function(b,e,c){var f,k;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,
+Math.min(85,this.lat));this.phi=(90-this.lat)*h;this.theta=this.lon*h;f=this.phi%m;this.phi=f>=0?f:f+m;f=this.verticalAngleMap.srcRange;k=this.verticalAngleMap.dstRange;var n=k[1]-k[0];this.phi=TWEEN.Easing.Quadratic.EaseInOut(((this.phi-f[0])*(k[1]-k[0])/(f[1]-f[0])+k[0]-k[0])/n)*n+k[0];f=this.horizontalAngleMap.srcRange;k=this.horizontalAngleMap.dstRange;n=k[1]-k[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-f[0])*(k[1]-k[0])/(f[1]-f[0])+k[0]-k[0])/n)*n+k[0];f=this.target.position;
 f.x=100*Math.sin(this.phi)*Math.cos(this.theta);f.y=100*Math.cos(this.phi);f.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,b,e,c)};this.onMouseMove=function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&
-this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),m=new THREE.MeshLambertMaterial({color:65280}),n=new THREE.CubeGeometry(10,10,20),u=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(n,b);b=new THREE.Mesh(u,m);b.position.set(0,10,0);this.animation=c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(b)}else this.animation=
+this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),k=new THREE.MeshLambertMaterial({color:65280}),n=new THREE.CubeGeometry(10,10,20),p=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(n,b);b=new THREE.Mesh(p,k);b.position.set(0,10,0);this.animation=c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(b)}else this.animation=
 c(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&f(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(b,e){return function(){e.apply(b,arguments)}}(this,this.onMouseMove),!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
 THREE.FlyCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.domElement=document;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=b.movementSpeed;if(b.rollSpeed!==void 0)this.rollSpeed=b.rollSpeed;if(b.dragToLook!==void 0)this.dragToLook=b.dragToLook;if(b.autoForward!==void 0)this.autoForward=
 b.autoForward;if(b.domElement!==void 0)this.domElement=b.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.domElement!==document&&this.domElement.setAttribute("tabindex",-1);this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};
 this.keydown=function(b){if(!b.altKey){switch(b.keyCode){case 16:this.movementSpeedMultiplier=0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=
 1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(b){switch(b.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=
 0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(b){this.domElement!==document&&this.domElement.focus();b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(b.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}};this.mousemove=function(b){if(!this.dragToLook||this.mouseStatus>0){var c=this.getContainerDimensions(),
-h=c.size[0]/2,k=c.size[1]/2;this.moveState.yawLeft=-(b.pageX-c.offset[0]-h)/h;this.moveState.pitchDown=(b.pageY-c.offset[1]-k)/k;this.updateRotationVector()}};this.mouseup=function(b){b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(b.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=
+m=c.size[0]/2,h=c.size[1]/2;this.moveState.yawLeft=-(b.pageX-c.offset[0]-m)/m;this.moveState.pitchDown=(b.pageY-c.offset[1]-h)/h;this.updateRotationVector()}};this.mouseup=function(b){b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(b.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=
 b;this.tdiff=(b-this.lastUpdate)/1E3;this.lastUpdate=b;var b=this.tdiff*this.movementSpeed,c=this.tdiff*this.rollSpeed;this.translateX(this.moveVector.x*b);this.translateY(this.moveVector.y*b);this.translateZ(this.moveVector.z*b);this.tmpQuaternion.set(this.rotationVector.x*c,this.rotationVector.y*c,this.rotationVector.z*c,1).normalize();this.quaternion.multiplySelf(this.tmpQuaternion);this.matrix.setPosition(this.position);this.matrix.setRotationFromQuaternion(this.quaternion);this.matrixWorldNeedsUpdate=
 !0;this.supr.update.call(this)};this.updateMovementVector=function(){var b=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=
 -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,
 this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};THREE.FlyCamera.prototype=new THREE.Camera;THREE.FlyCamera.prototype.constructor=THREE.FlyCamera;THREE.FlyCamera.prototype.supr=THREE.Camera.prototype;
-THREE.RollCamera=function(b,c,e,f){THREE.Camera.call(this,b,c,e,f);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.matrixAutoUpdate=this.useTarget=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var h=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3,n=new THREE.Matrix4,u=!1,p=1,w=0,t=0,x=0,v=0,z=0,y=window.innerWidth/2,B=window.innerHeight/2;this.update=
-function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.delta=(b-this.lastUpdate)/1E3;this.lastUpdate=b;this.mouseLook&&(b=this.delta*this.lookSpeed,this.rotateHorizontally(b*v),this.rotateVertically(b*z));b=this.delta*this.movementSpeed;this.translateZ(b*(w>0||this.autoForward&&!(w<0)?1:w));this.translateX(b*t);this.translateY(b*x);u&&(this.roll+=this.rollSpeed*this.delta*p);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();
-else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();m.copy(this.forward);k.set(0,1,0);h.cross(k,m).normalize();k.cross(m,h).normalize();this.matrix.n11=h.x;this.matrix.n12=k.x;this.matrix.n13=m.x;this.matrix.n21=h.y;this.matrix.n22=k.y;this.matrix.n23=m.y;this.matrix.n31=h.z;this.matrix.n32=k.z;this.matrix.n33=m.z;n.identity();n.n11=Math.cos(this.roll);n.n12=-Math.sin(this.roll);n.n21=Math.sin(this.roll);n.n22=Math.cos(this.roll);this.matrix.multiplySelf(n);
+THREE.RollCamera=function(b,c,e,f){THREE.Camera.call(this,b,c,e,f);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.matrixAutoUpdate=this.useTarget=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var m=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector3,n=new THREE.Matrix4,p=!1,u=1,w=0,t=0,x=0,v=0,z=0,y=window.innerWidth/2,B=window.innerHeight/2;this.update=
+function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.delta=(b-this.lastUpdate)/1E3;this.lastUpdate=b;this.mouseLook&&(b=this.delta*this.lookSpeed,this.rotateHorizontally(b*v),this.rotateVertically(b*z));b=this.delta*this.movementSpeed;this.translateZ(b*(w>0||this.autoForward&&!(w<0)?1:w));this.translateX(b*t);this.translateY(b*x);p&&(this.roll+=this.rollSpeed*this.delta*u);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();
+else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();k.copy(this.forward);h.set(0,1,0);m.cross(h,k).normalize();h.cross(k,m).normalize();this.matrix.n11=m.x;this.matrix.n12=h.x;this.matrix.n13=k.x;this.matrix.n21=m.y;this.matrix.n22=h.y;this.matrix.n23=k.y;this.matrix.n31=m.z;this.matrix.n32=h.z;this.matrix.n33=k.z;n.identity();n.n11=Math.cos(this.roll);n.n12=-Math.sin(this.roll);n.n21=Math.sin(this.roll);n.n22=Math.cos(this.roll);this.matrix.multiplySelf(n);
 this.matrixWorldNeedsUpdate=!0;this.matrix.n14=this.position.x;this.matrix.n24=this.position.y;this.matrix.n34=this.position.z;this.supr.update.call(this)};this.translateX=function(b){this.position.x+=this.matrix.n11*b;this.position.y+=this.matrix.n21*b;this.position.z+=this.matrix.n31*b};this.translateY=function(b){this.position.x+=this.matrix.n12*b;this.position.y+=this.matrix.n22*b;this.position.z+=this.matrix.n32*b};this.translateZ=function(b){this.position.x-=this.matrix.n13*b;this.position.y-=
-this.matrix.n23*b;this.position.z-=this.matrix.n33*b};this.rotateHorizontally=function(b){h.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);h.multiplyScalar(b);this.forward.subSelf(h);this.forward.normalize()};this.rotateVertically=function(b){k.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);k.multiplyScalar(b);this.forward.addSelf(k);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
+this.matrix.n23*b;this.position.z-=this.matrix.n33*b};this.rotateHorizontally=function(b){m.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);m.multiplyScalar(b);this.forward.subSelf(m);this.forward.normalize()};this.rotateVertically=function(b){h.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);h.multiplyScalar(b);this.forward.addSelf(h);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
 function(b){v=(b.clientX-y)/window.innerWidth;z=(b.clientY-B)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:w=1;break;case 2:w=-1}},!1);this.domElement.addEventListener("mouseup",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:w=0;break;case 2:w=0}},!1);this.domElement.addEventListener("keydown",function(b){switch(b.keyCode){case 38:case 87:w=1;break;case 37:case 65:t=-1;break;
-case 40:case 83:w=-1;break;case 39:case 68:t=1;break;case 81:u=!0;p=1;break;case 69:u=!0;p=-1;break;case 82:x=1;break;case 70:x=-1}},!1);this.domElement.addEventListener("keyup",function(b){switch(b.keyCode){case 38:case 87:w=0;break;case 37:case 65:t=0;break;case 40:case 83:w=0;break;case 39:case 68:t=0;break;case 81:u=!1;break;case 69:u=!1;break;case 82:x=0;break;case 70:x=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
+case 40:case 83:w=-1;break;case 39:case 68:t=1;break;case 81:p=!0;u=1;break;case 69:p=!0;u=-1;break;case 82:x=1;break;case 70:x=-1}},!1);this.domElement.addEventListener("keyup",function(b){switch(b.keyCode){case 38:case 87:w=0;break;case 37:case 65:t=0;break;case 40:case 83:w=0;break;case 39:case 68:t=0;break;case 81:p=!1;break;case 69:p=!1;break;case 82:x=0;break;case 70:x=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
 THREE.RollCamera.prototype.supr=THREE.Camera.prototype;
-THREE.TrackballCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}b=b||{};THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.domElement=b.domElement||document;this.screen=b.screen||{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=b.radius||(this.screen.width+this.screen.height)/4;this.rotateSpeed=b.rotateSpeed||1;this.zoomSpeed=b.zoomSpeed||1.2;this.panSpeed=b.panSpeed||0.3;this.noZoom=b.noZoom||!1;this.noPan=b.noPan||
-!1;this.staticMoving=b.staticMoving||!1;this.dynamicDampingFactor=b.dynamicDampingFactor||0.2;this.minDistance=b.minDistance||0;this.maxDistance=b.maxDistance||Infinity;this.keys=b.keys||[65,83,68];this.useTarget=!0;var e=!1,f=this.STATE.NONE,h=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3,n=new THREE.Vector2,u=new THREE.Vector2,p=new THREE.Vector2,w=new THREE.Vector2;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.getMouseOnScreen=function(b,c){return new THREE.Vector2((b-
-this.screen.offsetLeft)/this.radius*0.5,(c-this.screen.offsetTop)/this.radius*0.5)};this.getMouseProjectionOnBall=function(b,c){var e=new THREE.Vector3((b-this.screen.width*0.5-this.screen.offsetLeft)/this.radius,(this.screen.height*0.5+this.screen.offsetTop-c)/this.radius,0),f=e.length();f>1?e.normalize():e.z=Math.sqrt(1-f*f);h=this.position.clone().subSelf(this.target.position);f=this.up.clone().setLength(e.y);f.addSelf(this.up.clone().crossSelf(h).setLength(e.x));f.addSelf(h.setLength(e.z));return f};
-this.rotateCamera=function(){var b=Math.acos(k.dot(m)/k.length()/m.length());if(b){var c=(new THREE.Vector3).cross(k,m).normalize(),e=new THREE.Quaternion;b*=this.rotateSpeed;e.setFromAxisAngle(c,-b);e.multiplyVector3(h);e.multiplyVector3(this.up);e.multiplyVector3(m);this.staticMoving?k=m:(e.setFromAxisAngle(c,b*(this.dynamicDampingFactor-1)),e.multiplyVector3(k))}};this.zoomCamera=function(){var b=1+(u.y-n.y)*this.zoomSpeed;b!==1&&b>0&&(h.multiplyScalar(b),this.staticMoving?n=u:n.y+=(u.y-n.y)*this.dynamicDampingFactor)};
-this.panCamera=function(){var b=w.clone().subSelf(p);if(b.lengthSq()){b.multiplyScalar(h.length()*this.panSpeed);var c=h.clone().crossSelf(this.up).setLength(b.x);c.addSelf(this.up.clone().setLength(b.y));this.position.addSelf(c);this.target.position.addSelf(c);this.staticMoving?p=w:p.addSelf(b.sub(w,p).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.position.lengthSq()>this.maxDistance*this.maxDistance&&this.position.setLength(this.maxDistance),
-h.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.position,h.setLength(this.minDistance))};this.update=function(b,c,e){h=this.position.clone().subSelf(this.target.position);this.rotateCamera();this.noZoom||this.zoomCamera();this.noPan||this.panCamera();this.position.add(this.target.position,h);this.checkDistances();this.supr.update.call(this,b,c,e)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
-c(this,function(b){e&&(k=m=this.getMouseProjectionOnBall(b.clientX,b.clientY),n=u=this.getMouseOnScreen(b.clientX,b.clientY),p=w=this.getMouseOnScreen(b.clientX,b.clientY),e=!1);f!==this.STATE.NONE&&(f===this.STATE.ROTATE?m=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?u=this.getMouseOnScreen(b.clientX,b.clientY):f===this.STATE.PAN&&!this.noPan&&(w=this.getMouseOnScreen(b.clientX,b.clientY)))}),!1);this.domElement.addEventListener("mousedown",c(this,function(b){b.preventDefault();
-b.stopPropagation();if(f===this.STATE.NONE)f=b.button,f===this.STATE.ROTATE?k=m=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?n=u=this.getMouseOnScreen(b.clientX,b.clientY):this.noPan||(p=w=this.getMouseOnScreen(b.clientX,b.clientY))}),!1);this.domElement.addEventListener("mouseup",c(this,function(b){b.preventDefault();b.stopPropagation();f=this.STATE.NONE}),!1);window.addEventListener("keydown",c(this,function(b){if(f===this.STATE.NONE){if(b.keyCode===this.keys[this.STATE.ROTATE])f=
+THREE.TrackballCamera=function(b){function c(b,e){return function(){e.apply(b,arguments)}}b=b||{};THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.domElement=b.domElement||document;this.screen=b.screen||{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=b.radius||(this.screen.width+this.screen.height)/4;this.rotateSpeed=b.rotateSpeed||1;this.zoomSpeed=b.zoomSpeed||1.2;this.panSpeed=b.panSpeed||0.3;this.noZoom=b.noZoom||!1;this.noPan=b.noPan||
+!1;this.staticMoving=b.staticMoving||!1;this.dynamicDampingFactor=b.dynamicDampingFactor||0.2;this.minDistance=b.minDistance||0;this.maxDistance=b.maxDistance||Infinity;this.keys=b.keys||[65,83,68];this.useTarget=!0;var e=!1,f=this.STATE.NONE,m=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector3,n=new THREE.Vector2,p=new THREE.Vector2,u=new THREE.Vector2,w=new THREE.Vector2;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.getMouseOnScreen=function(b,e){return new THREE.Vector2((b-
+this.screen.offsetLeft)/this.radius*0.5,(e-this.screen.offsetTop)/this.radius*0.5)};this.getMouseProjectionOnBall=function(b,e){var c=new THREE.Vector3((b-this.screen.width*0.5-this.screen.offsetLeft)/this.radius,(this.screen.height*0.5+this.screen.offsetTop-e)/this.radius,0),f=c.length();f>1?c.normalize():c.z=Math.sqrt(1-f*f);m=this.position.clone().subSelf(this.target.position);f=this.up.clone().setLength(c.y);f.addSelf(this.up.clone().crossSelf(m).setLength(c.x));f.addSelf(m.setLength(c.z));return f};
+this.rotateCamera=function(){var b=Math.acos(h.dot(k)/h.length()/k.length());if(b){var e=(new THREE.Vector3).cross(h,k).normalize(),c=new THREE.Quaternion;b*=this.rotateSpeed;c.setFromAxisAngle(e,-b);c.multiplyVector3(m);c.multiplyVector3(this.up);c.multiplyVector3(k);this.staticMoving?h=k:(c.setFromAxisAngle(e,b*(this.dynamicDampingFactor-1)),c.multiplyVector3(h))}};this.zoomCamera=function(){var b=1+(p.y-n.y)*this.zoomSpeed;b!==1&&b>0&&(m.multiplyScalar(b),this.staticMoving?n=p:n.y+=(p.y-n.y)*this.dynamicDampingFactor)};
+this.panCamera=function(){var b=w.clone().subSelf(u);if(b.lengthSq()){b.multiplyScalar(m.length()*this.panSpeed);var c=m.clone().crossSelf(this.up).setLength(b.x);c.addSelf(this.up.clone().setLength(b.y));this.position.addSelf(c);this.target.position.addSelf(c);this.staticMoving?u=w:u.addSelf(b.sub(w,u).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.position.lengthSq()>this.maxDistance*this.maxDistance&&this.position.setLength(this.maxDistance),
+m.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.position,m.setLength(this.minDistance))};this.update=function(b,c,e){m=this.position.clone().subSelf(this.target.position);this.rotateCamera();this.noZoom||this.zoomCamera();this.noPan||this.panCamera();this.position.add(this.target.position,m);this.checkDistances();this.supr.update.call(this,b,c,e)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
+c(this,function(b){e&&(h=k=this.getMouseProjectionOnBall(b.clientX,b.clientY),n=p=this.getMouseOnScreen(b.clientX,b.clientY),u=w=this.getMouseOnScreen(b.clientX,b.clientY),e=!1);f!==this.STATE.NONE&&(f===this.STATE.ROTATE?k=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?p=this.getMouseOnScreen(b.clientX,b.clientY):f===this.STATE.PAN&&!this.noPan&&(w=this.getMouseOnScreen(b.clientX,b.clientY)))}),!1);this.domElement.addEventListener("mousedown",c(this,function(b){b.preventDefault();
+b.stopPropagation();if(f===this.STATE.NONE)f=b.button,f===this.STATE.ROTATE?h=k=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?n=p=this.getMouseOnScreen(b.clientX,b.clientY):this.noPan||(u=w=this.getMouseOnScreen(b.clientX,b.clientY))}),!1);this.domElement.addEventListener("mouseup",c(this,function(b){b.preventDefault();b.stopPropagation();f=this.STATE.NONE}),!1);window.addEventListener("keydown",c(this,function(b){if(f===this.STATE.NONE){if(b.keyCode===this.keys[this.STATE.ROTATE])f=
 this.STATE.ROTATE;else if(b.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)f=this.STATE.ZOOM;else if(b.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)f=this.STATE.PAN;f!==this.STATE.NONE&&(e=!0)}}),!1);window.addEventListener("keyup",c(this,function(){if(f!==this.STATE.NONE)f=this.STATE.NONE}),!1)};THREE.TrackballCamera.prototype=new THREE.Camera;THREE.TrackballCamera.prototype.constructor=THREE.TrackballCamera;THREE.TrackballCamera.prototype.supr=THREE.Camera.prototype;
 THREE.TrackballCamera.prototype.STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2};THREE.QuakeCamera=THREE.FirstPersonCamera;
-THREE.CubeGeometry=function(b,c,e,f,h,k,m,n,u){function p(b,c,e,m,n,p,t,u){var v,x,y=f||1,z=h||1,O=n/2,X=p/2,V=w.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")v="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")v="y",z=k||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")v="x",y=k||1;var W=y+1,o=z+1;n/=y;var ea=p/z;for(x=0;x<o;x++)for(p=0;p<W;p++){var T=new THREE.Vector3;T[b]=(p*n-O)*e;T[c]=(x*ea-X)*m;T[v]=t;w.vertices.push(new THREE.Vertex(T))}for(x=0;x<z;x++)for(p=0;p<y;p++)w.faces.push(new THREE.Face4(p+W*
-x+V,p+W*(x+1)+V,p+1+W*(x+1)+V,p+1+W*x+V,null,null,u)),w.faceVertexUvs[0].push([new THREE.UV(p/y,x/z),new THREE.UV(p/y,(x+1)/z),new THREE.UV((p+1)/y,(x+1)/z),new THREE.UV((p+1)/y,x/z)])}THREE.Geometry.call(this);var w=this,t=b/2,x=c/2,v=e/2,n=n?-1:1;if(m!==void 0)if(m instanceof Array)this.materials=m;else{this.materials=[];for(var z=0;z<6;z++)this.materials.push([m])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(u!=void 0)for(var y in u)this.sides[y]!=void 0&&(this.sides[y]=
-u[y]);this.sides.px&&p("z","y",1*n,-1,e,c,-t,this.materials[0]);this.sides.nx&&p("z","y",-1*n,-1,e,c,t,this.materials[1]);this.sides.py&&p("x","z",1*n,1,b,e,x,this.materials[2]);this.sides.ny&&p("x","z",1*n,-1,b,e,-x,this.materials[3]);this.sides.pz&&p("x","y",1*n,-1,b,c,v,this.materials[4]);this.sides.nz&&p("x","y",-1*n,-1,b,c,-v,this.materials[5]);THREE.Geometry.prototype.mergeVertices.call(this);this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;
+THREE.CubeGeometry=function(b,c,e,f,m,h,k,n,p){function u(b,c,e,k,n,p,t,u){var v,x,y=f||1,z=m||1,O=n/2,X=p/2,V=w.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")v="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")v="y",z=h||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")v="x",y=h||1;var W=y+1,o=z+1;n/=y;var ea=p/z;for(x=0;x<o;x++)for(p=0;p<W;p++){var T=new THREE.Vector3;T[b]=(p*n-O)*e;T[c]=(x*ea-X)*k;T[v]=t;w.vertices.push(new THREE.Vertex(T))}for(x=0;x<z;x++)for(p=0;p<y;p++)w.faces.push(new THREE.Face4(p+W*
+x+V,p+W*(x+1)+V,p+1+W*(x+1)+V,p+1+W*x+V,null,null,u)),w.faceVertexUvs[0].push([new THREE.UV(p/y,x/z),new THREE.UV(p/y,(x+1)/z),new THREE.UV((p+1)/y,(x+1)/z),new THREE.UV((p+1)/y,x/z)])}THREE.Geometry.call(this);var w=this,t=b/2,x=c/2,v=e/2,n=n?-1:1;if(k!==void 0)if(k instanceof Array)this.materials=k;else{this.materials=[];for(var z=0;z<6;z++)this.materials.push([k])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(p!=void 0)for(var y in p)this.sides[y]!=void 0&&(this.sides[y]=
+p[y]);this.sides.px&&u("z","y",1*n,-1,e,c,-t,this.materials[0]);this.sides.nx&&u("z","y",-1*n,-1,e,c,t,this.materials[1]);this.sides.py&&u("x","z",1*n,1,b,e,x,this.materials[2]);this.sides.ny&&u("x","z",1*n,-1,b,e,-x,this.materials[3]);this.sides.pz&&u("x","y",1*n,-1,b,c,v,this.materials[4]);this.sides.nz&&u("x","y",-1*n,-1,b,c,-v,this.materials[5]);this.mergeVertices();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;
 THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
-THREE.CylinderGeometry=function(b,c,e,f,h,k){THREE.Geometry.call(this);var b=b!=null?b:20,c=c!=null?c:20,e=e||100,m=e/2,f=f||8,h=h||1,n,u,p=[],w=[];for(u=0;u<=h;u++){var t=[],x=[],v=u/h,z=v*(c-b)+b;for(n=0;n<=f;n++){var y=n/f;this.vertices.push(new THREE.Vertex(new THREE.Vector3(z*Math.sin(y*Math.PI*2),-v*e+m,z*Math.cos(y*Math.PI*2))));t.push(this.vertices.length-1);x.push(new THREE.UV(y,v))}p.push(t);w.push(x)}for(u=0;u<h;u++)for(n=0;n<f;n++){var e=p[u][n],t=p[u+1][n],x=p[u+1][n+1],v=p[u][n+1],z=
-this.vertices[e].position.clone().setY(0).normalize(),y=this.vertices[t].position.clone().setY(0).normalize(),B=this.vertices[x].position.clone().setY(0).normalize(),C=this.vertices[v].position.clone().setY(0).normalize(),E=w[u][n].clone(),F=w[u+1][n].clone(),G=w[u+1][n+1].clone(),M=w[u][n+1].clone();this.faces.push(new THREE.Face4(e,t,x,v,[z,y,B,C]));this.faceVertexUvs[0].push([E,F,G,M])}if(!k&&b>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n<f;n++)e=p[0][n],t=p[0][n+
-1],x=this.vertices.length-1,z=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),B=new THREE.Vector3(0,1,0),E=w[0][n].clone(),F=w[0][n+1].clone(),G=new THREE.UV(F.u,0),this.faces.push(new THREE.Face3(e,t,x,[z,y,B])),this.faceVertexUvs[0].push([E,F,G])}if(!k&&c>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;n<f;n++)e=p[u][n+1],t=p[u][n],x=this.vertices.length-1,z=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),B=new THREE.Vector3(0,-1,0),E=w[u][n+1].clone(),F=w[u][n].clone(),
+THREE.CylinderGeometry=function(b,c,e,f,m,h){THREE.Geometry.call(this);var b=b!=null?b:20,c=c!=null?c:20,e=e||100,k=e/2,f=f||8,m=m||1,n,p,u=[],w=[];for(p=0;p<=m;p++){var t=[],x=[],v=p/m,z=v*(c-b)+b;for(n=0;n<=f;n++){var y=n/f;this.vertices.push(new THREE.Vertex(new THREE.Vector3(z*Math.sin(y*Math.PI*2),-v*e+k,z*Math.cos(y*Math.PI*2))));t.push(this.vertices.length-1);x.push(new THREE.UV(y,v))}u.push(t);w.push(x)}for(p=0;p<m;p++)for(n=0;n<f;n++){var e=u[p][n],t=u[p+1][n],x=u[p+1][n+1],v=u[p][n+1],z=
+this.vertices[e].position.clone().setY(0).normalize(),y=this.vertices[t].position.clone().setY(0).normalize(),B=this.vertices[x].position.clone().setY(0).normalize(),C=this.vertices[v].position.clone().setY(0).normalize(),E=w[p][n].clone(),F=w[p+1][n].clone(),G=w[p+1][n+1].clone(),M=w[p][n+1].clone();this.faces.push(new THREE.Face4(e,t,x,v,[z,y,B,C]));this.faceVertexUvs[0].push([E,F,G,M])}if(!h&&b>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,k,0)));for(n=0;n<f;n++)e=u[0][n],t=u[0][n+
+1],x=this.vertices.length-1,z=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),B=new THREE.Vector3(0,1,0),E=w[0][n].clone(),F=w[0][n+1].clone(),G=new THREE.UV(F.u,0),this.faces.push(new THREE.Face3(e,t,x,[z,y,B])),this.faceVertexUvs[0].push([E,F,G])}if(!h&&c>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-k,0)));for(n=0;n<f;n++)e=u[p][n+1],t=u[p][n],x=this.vertices.length-1,z=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),B=new THREE.Vector3(0,-1,0),E=w[p][n+1].clone(),F=w[p][n].clone(),
 G=new THREE.UV(F.u,1),this.faces.push(new THREE.Face3(e,t,x,[z,y,B])),this.faceVertexUvs[0].push([E,F,G])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
-THREE.ExtrudeGeometry=function(b,c){if(typeof b!="undefined"){THREE.Geometry.call(this);var b=b instanceof Array?b:[b],e,f=b.length,h;this.shapebb=b[f-1].getBoundingBox();for(e=0;e<f;e++)h=b[e],this.addShape(h,c);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
+THREE.ExtrudeGeometry=function(b,c){if(typeof b!="undefined"){THREE.Geometry.call(this);var b=b instanceof Array?b:[b],e,f=b.length,m;this.shapebb=b[f-1].getBoundingBox();for(e=0;e<f;e++)m=b[e],this.addShape(m,c);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
 THREE.ExtrudeGeometry.prototype.addShape=function(b,c){function e(b,c,e){c||console.log("die");return c.clone().multiplyScalar(e).addSelf(b)}function f(b,c,e){var f=THREE.ExtrudeGeometry.__v1,h=THREE.ExtrudeGeometry.__v2,k=THREE.ExtrudeGeometry.__v3,m=THREE.ExtrudeGeometry.__v4,n=THREE.ExtrudeGeometry.__v5,o=THREE.ExtrudeGeometry.__v6;f.set(b.x-c.x,b.y-c.y);h.set(b.x-e.x,b.y-e.y);f=f.normalize();h=h.normalize();k.set(-f.y,f.x);m.set(h.y,-h.x);n.copy(b).addSelf(k);o.copy(b).addSelf(m);if(n.equals(o))return m.clone();
-n.copy(c).addSelf(k);o.copy(e).addSelf(m);k=f.dot(m);m=o.subSelf(n).dot(m);k==0&&(console.log("Either infinite or no solutions!"),m==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));m/=k;if(m<0)return c=Math.atan2(c.y-b.y,c.x-b.x),b=Math.atan2(e.y-b.y,e.x-b.x),c>b&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function h(b){for(I=b.length;--I>=0;){qa=I;fa=I-1;fa<0&&(fa=b.length-
-1);for(var c=0,e=v+w*2,c=0;c<e;c++){var f=ea*c,h=ea*(c+1),k=da+qa+f,m=da+qa+h,o=k,f=da+fa+f,h=da+fa+h,p=m;o+=Z;f+=Z;h+=Z;p+=Z;J.faces.push(new THREE.Face4(o,f,h,p,null,null,G));G&&(o=c/e,f=(c+1)/e,h=n+u*2,k=(J.vertices[k].position.z+u)/h,m=(J.vertices[m].position.z+u)/h,J.faceVertexUvs[0].push([new THREE.UV(k,o),new THREE.UV(m,o),new THREE.UV(m,f),new THREE.UV(k,f)]))}}}function k(b,c,e){J.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}function m(b,c,e){b+=Z;c+=Z;e+=Z;J.faces.push(new THREE.Face3(b,
-c,e,null,null,F));if(F){var f=M.maxY,h=M.maxX,k=J.vertices[c].position.x,c=J.vertices[c].position.y,m=J.vertices[e].position.x,e=J.vertices[e].position.y;J.faceVertexUvs[0].push([new THREE.UV(J.vertices[b].position.x/h,J.vertices[b].position.y/f),new THREE.UV(k/h,c/f),new THREE.UV(m/h,e/f)])}}var n=c.amount!==void 0?c.amount:100,u=c.bevelThickness!==void 0?c.bevelThickness:6,p=c.bevelSize!==void 0?c.bevelSize:u-2,w=c.bevelSegments!==void 0?c.bevelSegments:3,t=c.bevelEnabled!==void 0?c.bevelEnabled:
-!0,x=c.curveSegments!==void 0?c.curveSegments:12,v=c.steps!==void 0?c.steps:1,z=c.bendPath,y=c.extrudePath,B,C=!1,E=c.useSpacedPoints!==void 0?c.useSpacedPoints:!1,F=c.material,G=c.extrudeMaterial,M=this.shapebb;if(y)B=y.getPoints(x),v=B.length,C=!0,t=!1;t||(p=u=w=0);var P,L,A,J=this,Z=this.vertices.length;z&&b.addWrapPath(z);x=E?b.extractAllSpacedPoints(x):b.extractAllPoints(x);z=x.shape;x=x.holes;if(y=!THREE.Shape.Utils.isClockWise(z)){z=z.reverse();L=0;for(A=x.length;L<A;L++)P=x[L],THREE.Shape.Utils.isClockWise(P)&&
-(x[L]=P.reverse());y=!1}y=THREE.Shape.Utils.triangulateShape(z,x);E=z;L=0;for(A=x.length;L<A;L++)P=x[L],z=z.concat(P);var I,O,X,V,W,o,ea=z.length,T=y.length,na=[];I=0;O=E.length;qa=O-1;for(fa=I+1;I<O;I++,qa++,fa++)qa==O&&(qa=0),fa==O&&(fa=0),na[I]=f(E[I],E[qa],E[fa]);var aa=[],ha,ca=na.concat();L=0;for(A=x.length;L<A;L++){P=x[L];ha=[];I=0;O=P.length;qa=O-1;for(fa=I+1;I<O;I++,qa++,fa++)qa==O&&(qa=0),fa==O&&(fa=0),ha[I]=f(P[I],P[qa],P[fa]);aa.push(ha);ca=ca.concat(ha)}for(X=0;X<w;X++){V=X/w;W=u*(1-
-V);V=p*Math.sin(V*Math.PI/2);I=0;for(O=E.length;I<O;I++)o=e(E[I],na[I],V),k(o.x,o.y,-W);L=0;for(A=x.length;L<A;L++){P=x[L];ha=aa[L];I=0;for(O=P.length;I<O;I++)o=e(P[I],ha[I],V),k(o.x,o.y,-W)}}V=p;for(I=0;I<ea;I++)o=t?e(z[I],ca[I],V):z[I],C?k(o.x,o.y+B[0].y,B[0].x):k(o.x,o.y,0);for(X=1;X<=v;X++)for(I=0;I<ea;I++)o=t?e(z[I],ca[I],V):z[I],C?k(o.x,o.y+B[X-1].y,B[X-1].x):k(o.x,o.y,n/v*X);for(X=w-1;X>=0;X--){V=X/w;W=u*(1-V);V=p*Math.sin(V*Math.PI/2);I=0;for(O=E.length;I<O;I++)o=e(E[I],na[I],V),k(o.x,o.y,
-n+W);L=0;for(A=x.length;L<A;L++){P=x[L];ha=aa[L];I=0;for(O=P.length;I<O;I++)o=e(P[I],ha[I],V),C?k(o.x,o.y+B[v-1].y,B[v-1].x+W):k(o.x,o.y,n+W)}}if(t){t=ea*0;for(I=0;I<T;I++)p=y[I],m(p[2]+t,p[1]+t,p[0]+t);t=ea*(v+w*2);for(I=0;I<T;I++)p=y[I],m(p[0]+t,p[1]+t,p[2]+t)}else{for(I=0;I<T;I++)p=y[I],m(p[2],p[1],p[0]);for(I=0;I<T;I++)p=y[I],m(p[0]+ea*v,p[1]+ea*v,p[2]+ea*v)}var qa,fa,da=0;h(E);da+=E.length;L=0;for(A=x.length;L<A;L++)P=x[L],h(P),da+=P.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;
+n.copy(c).addSelf(k);o.copy(e).addSelf(m);k=f.dot(m);m=o.subSelf(n).dot(m);k==0&&(console.log("Either infinite or no solutions!"),m==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));m/=k;if(m<0)return c=Math.atan2(c.y-b.y,c.x-b.x),b=Math.atan2(e.y-b.y,e.x-b.x),c>b&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function m(b){for(I=b.length;--I>=0;){qa=I;fa=I-1;fa<0&&(fa=b.length-
+1);for(var c=0,e=v+w*2,c=0;c<e;c++){var f=ea*c,h=ea*(c+1),k=da+qa+f,m=da+qa+h,o=k,f=da+fa+f,h=da+fa+h,t=m;o+=Z;f+=Z;h+=Z;t+=Z;J.faces.push(new THREE.Face4(o,f,h,t,null,null,G));G&&(o=c/e,f=(c+1)/e,h=n+p*2,k=(J.vertices[k].position.z+p)/h,m=(J.vertices[m].position.z+p)/h,J.faceVertexUvs[0].push([new THREE.UV(k,o),new THREE.UV(m,o),new THREE.UV(m,f),new THREE.UV(k,f)]))}}}function h(b,c,e){J.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}function k(b,c,e){b+=Z;c+=Z;e+=Z;J.faces.push(new THREE.Face3(b,
+c,e,null,null,F));if(F){var f=M.maxY,h=M.maxX,k=J.vertices[c].position.x,c=J.vertices[c].position.y,m=J.vertices[e].position.x,e=J.vertices[e].position.y;J.faceVertexUvs[0].push([new THREE.UV(J.vertices[b].position.x/h,J.vertices[b].position.y/f),new THREE.UV(k/h,c/f),new THREE.UV(m/h,e/f)])}}var n=c.amount!==void 0?c.amount:100,p=c.bevelThickness!==void 0?c.bevelThickness:6,u=c.bevelSize!==void 0?c.bevelSize:p-2,w=c.bevelSegments!==void 0?c.bevelSegments:3,t=c.bevelEnabled!==void 0?c.bevelEnabled:
+!0,x=c.curveSegments!==void 0?c.curveSegments:12,v=c.steps!==void 0?c.steps:1,z=c.bendPath,y=c.extrudePath,B,C=!1,E=c.useSpacedPoints!==void 0?c.useSpacedPoints:!1,F=c.material,G=c.extrudeMaterial,M=this.shapebb;if(y)B=y.getPoints(x),v=B.length,C=!0,t=!1;t||(u=p=w=0);var P,L,A,J=this,Z=this.vertices.length;z&&b.addWrapPath(z);x=E?b.extractAllSpacedPoints(x):b.extractAllPoints(x);z=x.shape;x=x.holes;if(y=!THREE.Shape.Utils.isClockWise(z)){z=z.reverse();L=0;for(A=x.length;L<A;L++)P=x[L],THREE.Shape.Utils.isClockWise(P)&&
+(x[L]=P.reverse());y=!1}y=THREE.Shape.Utils.triangulateShape(z,x);E=z;L=0;for(A=x.length;L<A;L++)P=x[L],z=z.concat(P);var I,O,X,V,W,o,ea=z.length,T=y.length,na=[];I=0;O=E.length;qa=O-1;for(fa=I+1;I<O;I++,qa++,fa++)qa==O&&(qa=0),fa==O&&(fa=0),na[I]=f(E[I],E[qa],E[fa]);var aa=[],ha,ca=na.concat();L=0;for(A=x.length;L<A;L++){P=x[L];ha=[];I=0;O=P.length;qa=O-1;for(fa=I+1;I<O;I++,qa++,fa++)qa==O&&(qa=0),fa==O&&(fa=0),ha[I]=f(P[I],P[qa],P[fa]);aa.push(ha);ca=ca.concat(ha)}for(X=0;X<w;X++){V=X/w;W=p*(1-
+V);V=u*Math.sin(V*Math.PI/2);I=0;for(O=E.length;I<O;I++)o=e(E[I],na[I],V),h(o.x,o.y,-W);L=0;for(A=x.length;L<A;L++){P=x[L];ha=aa[L];I=0;for(O=P.length;I<O;I++)o=e(P[I],ha[I],V),h(o.x,o.y,-W)}}V=u;for(I=0;I<ea;I++)o=t?e(z[I],ca[I],V):z[I],C?h(o.x,o.y+B[0].y,B[0].x):h(o.x,o.y,0);for(X=1;X<=v;X++)for(I=0;I<ea;I++)o=t?e(z[I],ca[I],V):z[I],C?h(o.x,o.y+B[X-1].y,B[X-1].x):h(o.x,o.y,n/v*X);for(X=w-1;X>=0;X--){V=X/w;W=p*(1-V);V=u*Math.sin(V*Math.PI/2);I=0;for(O=E.length;I<O;I++)o=e(E[I],na[I],V),h(o.x,o.y,
+n+W);L=0;for(A=x.length;L<A;L++){P=x[L];ha=aa[L];I=0;for(O=P.length;I<O;I++)o=e(P[I],ha[I],V),C?h(o.x,o.y+B[v-1].y,B[v-1].x+W):h(o.x,o.y,n+W)}}if(t){t=ea*0;for(I=0;I<T;I++)u=y[I],k(u[2]+t,u[1]+t,u[0]+t);t=ea*(v+w*2);for(I=0;I<T;I++)u=y[I],k(u[0]+t,u[1]+t,u[2]+t)}else{for(I=0;I<T;I++)u=y[I],k(u[2],u[1],u[0]);for(I=0;I<T;I++)u=y[I],k(u[0]+ea*v,u[1]+ea*v,u[2]+ea*v)}var qa,fa,da=0;m(E);da+=E.length;L=0;for(A=x.length;L<A;L++)P=x[L],m(P),da+=P.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
-THREE.SubdivisionGeometry=function(b){function c(b,c,e,h){f.faces.push(new THREE.Face4(b,c,e,h,null,null,null));(!w||p.length!=0)&&f.faceVertexUvs[0].push([p[b],p[c],p[e],p[h]])}function e(b,c){return Math.min(b,c)+"_"+Math.max(b,c)}THREE.Geometry.call(this);var f=this,h=b.vertices,k=b.faces,m=h.concat(),n=[],u={},p=[],w=!1,t,x,v,z,y;y=b.faceVertexUvs[0];var B;t=0;for(x=y.length;t<x;t++){v=0;for(z=y[t].length;v<z;v++)B=k[t]["abcd".charAt(v)],p[B]||(p[B]=y[t][v])}this.materials=b.materials;var C;t=
-0;for(x=k.length;t<x;t++)if(y=k[t],n.push(y.centroid),m.push(new THREE.Vertex(y.centroid)),w&&p.length!=0){C=new THREE.UV;if(y instanceof THREE.Face3)C.u=p[y.a].u+p[y.b].u+p[y.c].u,C.v=p[y.a].v+p[y.b].v+p[y.c].v,C.u/=3,C.v/=3;else if(y instanceof THREE.Face4)C.u=p[y.a].u+p[y.b].u+p[y.c].u+p[y.d].u,C.v=p[y.a].v+p[y.b].v+p[y.c].v+p[y.d].v,C.u/=4,C.v/=4;p.push(C)}var b=function(b){function c(b,e,f){b[e]===void 0&&(b[e]={set:{},array:[]});b[e].set[f]=1;b[e].array.push(f)}var f,h,k,m,n={};f=0;for(h=b.faces.length;f<
-h;f++)k=b.faces[f],k instanceof THREE.Face3?(m=e(k.a,k.b),c(n,m,f),m=e(k.b,k.c),c(n,m,f),m=e(k.c,k.a),c(n,m,f)):k instanceof THREE.Face4&&(m=e(k.a,k.b),c(n,m,f),m=e(k.b,k.c),c(n,m,f),m=e(k.c,k.d),c(n,m,f),m=e(k.d,k.a),c(n,m,f));b.vfMap=n;b.edges=[];k=0;for(f in n)k++,h=n[f],b.edges.push(h.array);return n}(b),E,F=0;z=h.length;for(t in b)if(y=b[t],y=y.array,C=y[0],y=y[1],E=new THREE.Vector3,E.addSelf(n[C]),E.addSelf(n[y]),B=t.split("_"),x=B[0],B=B[1],E.addSelf(h[x].position),E.addSelf(h[B].position),
-E.multiplyScalar(0.25),u[t]=z+k.length+F,m.push(new THREE.Vertex(E)),F++,w&&p.length!=0)C=new THREE.UV,C.u=p[x].u+p[B].u,C.v=p[x].v+p[B].v,C.u/=2,C.v/=2,p.push(C);var G;t=0;for(x=n.length;t<x;t++)y=k[t],B=z+t,y instanceof THREE.Face3?(F=e(y.a,y.b),C=e(y.b,y.c),E=e(y.c,y.a),c(B,u[F],y.b,u[C]),c(B,u[C],y.c,u[E]),c(B,u[E],y.a,u[F])):y instanceof THREE.Face4?(F=e(y.a,y.b),C=e(y.b,y.c),E=e(y.c,y.d),G=e(y.d,y.a),c(B,u[F],y.b,u[C]),c(B,u[C],y.c,u[E]),c(B,u[E],y.d,u[G]),c(B,u[G],y.a,u[F])):console.log("face should be a face!",
-y);f.vertices=m;var M={},P={},k=function(b,c){M[b]===void 0&&(M[b]=[]);M[b].push(c)},m=function(b,c){P[b]===void 0&&(P[b]={});P[b][c]=null};for(t in b)y=b[t],B=t.split("_"),x=B[0],B=B[1],k(x,[x,B]),k(B,[x,B]),y=y.array,C=y[0],y=y[1],m(x,C),m(x,y),m(B,C),m(B,y);k=new THREE.Vector3;m=new THREE.Vector3;t=0;for(x=h.length;t<x;t++)if(M[t]!==void 0){k.set(0,0,0);m.set(0,0,0);u=new THREE.Vector3(0,0,0);b=0;for(v in P[t])k.addSelf(n[v]),b++;k.divideScalar(b);b=M[t].length;for(v=0;v<b;v++)y=M[t][v],z=h[y[0]].position.clone().addSelf(h[y[1]].position).divideScalar(2),
-m.addSelf(z);m.divideScalar(b);u.addSelf(h[t].position);u.multiplyScalar(b-3);u.addSelf(k);u.addSelf(m.multiplyScalar(2));u.divideScalar(b);this.vertices[t].position=u}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.SubdivisionGeometry.prototype=new THREE.Geometry;THREE.SubdivisionGeometry.prototype.constructor=THREE.SubdivisionGeometry;
-THREE.IcosahedronGeometry=function(b){function c(b,c,e){var f=Math.sqrt(b*b+c*c+e*e);return h.vertices.push(new THREE.Vertex(new THREE.Vector3(b/f,c/f,e/f)))-1}function e(b,c,e,f){f.faces.push(new THREE.Face3(b,c,e))}function f(b,e){var f=h.vertices[b].position,k=h.vertices[e].position;return c((f.x+k.x)/2,(f.y+k.y)/2,(f.z+k.z)/2)}var h=this,k=new THREE.Geometry;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;c(-1,b,0);c(1,b,0);c(-1,-b,0);c(1,-b,0);c(0,-1,b);c(0,1,b);c(0,-1,
--b);c(0,1,-b);c(b,0,-1);c(b,0,1);c(-b,0,-1);c(-b,0,1);e(0,11,5,k);e(0,5,1,k);e(0,1,7,k);e(0,7,10,k);e(0,10,11,k);e(1,5,9,k);e(5,11,4,k);e(11,10,2,k);e(10,7,6,k);e(7,1,8,k);e(3,9,4,k);e(3,4,2,k);e(3,2,6,k);e(3,6,8,k);e(3,8,9,k);e(4,9,5,k);e(2,4,11,k);e(6,2,10,k);e(8,6,7,k);e(9,8,1,k);for(var m=0;m<this.subdivisions;m++){var b=new THREE.Geometry,n;for(n in k.faces){var u=f(k.faces[n].a,k.faces[n].b),p=f(k.faces[n].b,k.faces[n].c),w=f(k.faces[n].c,k.faces[n].a);e(k.faces[n].a,u,w,b);e(k.faces[n].b,p,
-u,b);e(k.faces[n].c,w,p,b);e(u,p,w,b)}k.faces=b.faces}h.faces=k.faces;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
-THREE.LatheGeometry=function(b,c,e){THREE.Geometry.call(this);this.steps=c||12;this.angle=e||2*Math.PI;for(var c=this.angle/this.steps,e=[],f=[],h=[],k=[],m=(new THREE.Matrix4).setRotationZ(c),n=0;n<b.length;n++)this.vertices.push(new THREE.Vertex(b[n])),e[n]=b[n].clone(),f[n]=this.vertices.length-1;for(var u=0;u<=this.angle+0.0010;u+=c){for(n=0;n<e.length;n++)u<this.angle?(e[n]=m.multiplyVector3(e[n].clone()),this.vertices.push(new THREE.Vertex(e[n])),h[n]=this.vertices.length-1):h=k;u==0&&(k=f);
-for(n=0;n<f.length-1;n++)this.faces.push(new THREE.Face4(h[n],h[n+1],f[n+1],f[n])),this.faceVertexUvs[0].push([new THREE.UV(1-u/this.angle,n/b.length),new THREE.UV(1-u/this.angle,(n+1)/b.length),new THREE.UV(1-(u-c)/this.angle,(n+1)/b.length),new THREE.UV(1-(u-c)/this.angle,n/b.length)]);f=h;h=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
-THREE.PlaneGeometry=function(b,c,e,f){THREE.Geometry.call(this);var h,k=b/2,m=c/2,e=e||1,f=f||1,n=e+1,u=f+1;b/=e;var p=c/f;for(h=0;h<u;h++)for(c=0;c<n;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-k,-(h*p-m),0)));for(h=0;h<f;h++)for(c=0;c<e;c++)this.faces.push(new THREE.Face4(c+n*h,c+n*(h+1),c+1+n*(h+1),c+1+n*h)),this.faceVertexUvs[0].push([new THREE.UV(c/e,h/f),new THREE.UV(c/e,(h+1)/f),new THREE.UV((c+1)/e,(h+1)/f),new THREE.UV((c+1)/e,h/f)]);this.computeCentroids();this.computeFaceNormals()};
+THREE.SubdivisionGeometry=function(b){function c(b,c,e,h){f.faces.push(new THREE.Face4(b,c,e,h,null,null,null));(!w||u.length!=0)&&f.faceVertexUvs[0].push([u[b],u[c],u[e],u[h]])}function e(b,c){return Math.min(b,c)+"_"+Math.max(b,c)}THREE.Geometry.call(this);var f=this,m=b.vertices,h=b.faces,k=m.concat(),n=[],p={},u=[],w=!1,t,x,v,z,y;y=b.faceVertexUvs[0];var B;t=0;for(x=y.length;t<x;t++){v=0;for(z=y[t].length;v<z;v++)B=h[t]["abcd".charAt(v)],u[B]||(u[B]=y[t][v])}this.materials=b.materials;var C;t=
+0;for(x=h.length;t<x;t++)if(y=h[t],n.push(y.centroid),k.push(new THREE.Vertex(y.centroid)),w&&u.length!=0){C=new THREE.UV;if(y instanceof THREE.Face3)C.u=u[y.a].u+u[y.b].u+u[y.c].u,C.v=u[y.a].v+u[y.b].v+u[y.c].v,C.u/=3,C.v/=3;else if(y instanceof THREE.Face4)C.u=u[y.a].u+u[y.b].u+u[y.c].u+u[y.d].u,C.v=u[y.a].v+u[y.b].v+u[y.c].v+u[y.d].v,C.u/=4,C.v/=4;u.push(C)}var b=function(b){function c(b,e,f){b[e]===void 0&&(b[e]={set:{},array:[]});b[e].set[f]=1;b[e].array.push(f)}var f,h,k,m,n={};f=0;for(h=b.faces.length;f<
+h;f++)k=b.faces[f],k instanceof THREE.Face3?(m=e(k.a,k.b),c(n,m,f),m=e(k.b,k.c),c(n,m,f),m=e(k.c,k.a),c(n,m,f)):k instanceof THREE.Face4&&(m=e(k.a,k.b),c(n,m,f),m=e(k.b,k.c),c(n,m,f),m=e(k.c,k.d),c(n,m,f),m=e(k.d,k.a),c(n,m,f));b.vfMap=n;b.edges=[];k=0;for(f in n)k++,h=n[f],b.edges.push(h.array);return n}(b),E,F=0;z=m.length;for(t in b)if(y=b[t],y=y.array,C=y[0],y=y[1],E=new THREE.Vector3,E.addSelf(n[C]),E.addSelf(n[y]),B=t.split("_"),x=B[0],B=B[1],E.addSelf(m[x].position),E.addSelf(m[B].position),
+E.multiplyScalar(0.25),p[t]=z+h.length+F,k.push(new THREE.Vertex(E)),F++,w&&u.length!=0)C=new THREE.UV,C.u=u[x].u+u[B].u,C.v=u[x].v+u[B].v,C.u/=2,C.v/=2,u.push(C);var G;t=0;for(x=n.length;t<x;t++)y=h[t],B=z+t,y instanceof THREE.Face3?(F=e(y.a,y.b),C=e(y.b,y.c),E=e(y.c,y.a),c(B,p[F],y.b,p[C]),c(B,p[C],y.c,p[E]),c(B,p[E],y.a,p[F])):y instanceof THREE.Face4?(F=e(y.a,y.b),C=e(y.b,y.c),E=e(y.c,y.d),G=e(y.d,y.a),c(B,p[F],y.b,p[C]),c(B,p[C],y.c,p[E]),c(B,p[E],y.d,p[G]),c(B,p[G],y.a,p[F])):console.log("face should be a face!",
+y);f.vertices=k;var M={},P={},h=function(b,c){M[b]===void 0&&(M[b]=[]);M[b].push(c)},k=function(b,c){P[b]===void 0&&(P[b]={});P[b][c]=null};for(t in b)y=b[t],B=t.split("_"),x=B[0],B=B[1],h(x,[x,B]),h(B,[x,B]),y=y.array,C=y[0],y=y[1],k(x,C),k(x,y),k(B,C),k(B,y);h=new THREE.Vector3;k=new THREE.Vector3;t=0;for(x=m.length;t<x;t++)if(M[t]!==void 0){h.set(0,0,0);k.set(0,0,0);p=new THREE.Vector3(0,0,0);b=0;for(v in P[t])h.addSelf(n[v]),b++;h.divideScalar(b);b=M[t].length;for(v=0;v<b;v++)y=M[t][v],z=m[y[0]].position.clone().addSelf(m[y[1]].position).divideScalar(2),
+k.addSelf(z);k.divideScalar(b);p.addSelf(m[t].position);p.multiplyScalar(b-3);p.addSelf(h);p.addSelf(k.multiplyScalar(2));p.divideScalar(b);this.vertices[t].position=p}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.SubdivisionGeometry.prototype=new THREE.Geometry;THREE.SubdivisionGeometry.prototype.constructor=THREE.SubdivisionGeometry;
+THREE.IcosahedronGeometry=function(b){function c(b,c,e){var f=Math.sqrt(b*b+c*c+e*e);return m.vertices.push(new THREE.Vertex(new THREE.Vector3(b/f,c/f,e/f)))-1}function e(b,c,e,f){f.faces.push(new THREE.Face3(b,c,e))}function f(b,e){var f=m.vertices[b].position,h=m.vertices[e].position;return c((f.x+h.x)/2,(f.y+h.y)/2,(f.z+h.z)/2)}var m=this,h=new THREE.Geometry;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;c(-1,b,0);c(1,b,0);c(-1,-b,0);c(1,-b,0);c(0,-1,b);c(0,1,b);c(0,-1,
+-b);c(0,1,-b);c(b,0,-1);c(b,0,1);c(-b,0,-1);c(-b,0,1);e(0,11,5,h);e(0,5,1,h);e(0,1,7,h);e(0,7,10,h);e(0,10,11,h);e(1,5,9,h);e(5,11,4,h);e(11,10,2,h);e(10,7,6,h);e(7,1,8,h);e(3,9,4,h);e(3,4,2,h);e(3,2,6,h);e(3,6,8,h);e(3,8,9,h);e(4,9,5,h);e(2,4,11,h);e(6,2,10,h);e(8,6,7,h);e(9,8,1,h);for(var k=0;k<this.subdivisions;k++){var b=new THREE.Geometry,n;for(n in h.faces){var p=f(h.faces[n].a,h.faces[n].b),u=f(h.faces[n].b,h.faces[n].c),w=f(h.faces[n].c,h.faces[n].a);e(h.faces[n].a,p,w,b);e(h.faces[n].b,u,
+p,b);e(h.faces[n].c,w,u,b);e(p,u,w,b)}h.faces=b.faces}m.faces=h.faces;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
+THREE.LatheGeometry=function(b,c,e){THREE.Geometry.call(this);this.steps=c||12;this.angle=e||2*Math.PI;for(var c=this.angle/this.steps,e=[],f=[],m=[],h=[],k=(new THREE.Matrix4).setRotationZ(c),n=0;n<b.length;n++)this.vertices.push(new THREE.Vertex(b[n])),e[n]=b[n].clone(),f[n]=this.vertices.length-1;for(var p=0;p<=this.angle+0.0010;p+=c){for(n=0;n<e.length;n++)p<this.angle?(e[n]=k.multiplyVector3(e[n].clone()),this.vertices.push(new THREE.Vertex(e[n])),m[n]=this.vertices.length-1):m=h;p==0&&(h=f);
+for(n=0;n<f.length-1;n++)this.faces.push(new THREE.Face4(m[n],m[n+1],f[n+1],f[n])),this.faceVertexUvs[0].push([new THREE.UV(1-p/this.angle,n/b.length),new THREE.UV(1-p/this.angle,(n+1)/b.length),new THREE.UV(1-(p-c)/this.angle,(n+1)/b.length),new THREE.UV(1-(p-c)/this.angle,n/b.length)]);f=m;m=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.PlaneGeometry=function(b,c,e,f){THREE.Geometry.call(this);var m,h=b/2,k=c/2,e=e||1,f=f||1,n=e+1,p=f+1;b/=e;var u=c/f;for(m=0;m<p;m++)for(c=0;c<n;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-h,-(m*u-k),0)));for(m=0;m<f;m++)for(c=0;c<e;c++)this.faces.push(new THREE.Face4(c+n*m,c+n*(m+1),c+1+n*(m+1),c+1+n*m)),this.faceVertexUvs[0].push([new THREE.UV(c/e,m/f),new THREE.UV(c/e,(m+1)/f),new THREE.UV((c+1)/e,(m+1)/f),new THREE.UV((c+1)/e,m/f)]);this.computeCentroids();this.computeFaceNormals()};
 THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f,h=Math.PI,k=Math.max(3,c||8),m=Math.max(2,e||6),c=[],e=0;e<m+1;e++){f=e/m;var n=b*Math.cos(f*h),u=b*Math.sin(f*h),p=[],w=0;for(f=0;f<k;f++){var t=2*f/k,x=u*Math.sin(t*h),t=u*Math.cos(t*h);(e==0||e==m)&&f>0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(t,n,x)))-1);p.push(w)}c.push(p)}for(var v,z,y,h=c.length,e=0;e<h;e++)if(k=c[e].length,e>0)for(f=0;f<k;f++){p=f==k-1;m=c[e][p?0:f+1];n=c[e][p?k-1:f];u=c[e-1][p?
-k-1:f];p=c[e-1][p?0:f+1];x=e/(h-1);v=(e-1)/(h-1);z=(f+1)/k;var t=f/k,w=new THREE.UV(1-z,x),x=new THREE.UV(1-t,x),t=new THREE.UV(1-t,v),B=new THREE.UV(1-z,v);e<c.length-1&&(v=this.vertices[m].position.clone(),z=this.vertices[n].position.clone(),y=this.vertices[u].position.clone(),v.normalize(),z.normalize(),y.normalize(),this.faces.push(new THREE.Face3(m,n,u,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(y.x,y.y,y.z)])),this.faceVertexUvs[0].push([w,x,t]));e>1&&(v=
-this.vertices[m].position.clone(),z=this.vertices[u].position.clone(),y=this.vertices[p].position.clone(),v.normalize(),z.normalize(),y.normalize(),this.faces.push(new THREE.Face3(m,u,p,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(y.x,y.y,y.z)])),this.faceVertexUvs[0].push([w,t,B]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;
+THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f,m=Math.PI,h=Math.max(3,c||8),k=Math.max(2,e||6),c=[],e=0;e<k+1;e++){f=e/k;var n=b*Math.cos(f*m),p=b*Math.sin(f*m),u=[],w=0;for(f=0;f<h;f++){var t=2*f/h,x=p*Math.sin(t*m),t=p*Math.cos(t*m);(e==0||e==k)&&f>0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(t,n,x)))-1);u.push(w)}c.push(u)}for(var v,z,y,m=c.length,e=0;e<m;e++)if(h=c[e].length,e>0)for(f=0;f<h;f++){u=f==h-1;k=c[e][u?0:f+1];n=c[e][u?h-1:f];p=c[e-1][u?
+h-1:f];u=c[e-1][u?0:f+1];x=e/(m-1);v=(e-1)/(m-1);z=(f+1)/h;var t=f/h,w=new THREE.UV(1-z,x),x=new THREE.UV(1-t,x),t=new THREE.UV(1-t,v),B=new THREE.UV(1-z,v);e<c.length-1&&(v=this.vertices[k].position.clone(),z=this.vertices[n].position.clone(),y=this.vertices[p].position.clone(),v.normalize(),z.normalize(),y.normalize(),this.faces.push(new THREE.Face3(k,n,p,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(y.x,y.y,y.z)])),this.faceVertexUvs[0].push([w,x,t]));e>1&&(v=
+this.vertices[k].position.clone(),z=this.vertices[p].position.clone(),y=this.vertices[u].position.clone(),v.normalize(),z.normalize(),y.normalize(),this.faces.push(new THREE.Face3(k,p,u,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(y.x,y.y,y.z)])),this.faceVertexUvs[0].push([w,t,B]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;
 THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 THREE.TextGeometry=function(b,c){var e=(new THREE.TextPath(b,c)).toShapes();c.amount=c.height!==void 0?c.height:50;if(c.bevelThickness===void 0)c.bevelThickness=10;if(c.bevelSize===void 0)c.bevelSize=8;if(c.bevelEnabled===void 0)c.bevelEnabled=!1;if(c.bend){var f=e[e.length-1].getBoundingBox().maxX;c.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(f/2,120),new THREE.Vector2(f,0))}THREE.ExtrudeGeometry.call(this,e,c)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(b,c){return(new TextPath(b,c)).toShapes()},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var c=
-this.getFace(),e=this.size/c.resolution,f=0,h=String(b).split(""),k=h.length,m=[],b=0;b<k;b++){var n=new THREE.Path,n=this.extractGlyphPoints(h[b],c,e,f,n);f+=n.offset;m.push(n.path)}return{paths:m,offset:f/2}},extractGlyphPoints:function(b,c,e,f,h){var k=[],m,n,u,p,w,t,x,v,z,y,B=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(B){if(B.o){c=B._cachedOutline||(B._cachedOutline=B.o.split(" "));u=c.length;for(b=0;b<u;)switch(n=c[b++],n){case "m":n=c[b++]*e+f;p=c[b++]*e;k.push(new THREE.Vector2(n,
-p));h.moveTo(n,p);break;case "l":n=c[b++]*e+f;p=c[b++]*e;k.push(new THREE.Vector2(n,p));h.lineTo(n,p);break;case "q":n=c[b++]*e+f;p=c[b++]*e;x=c[b++]*e+f;v=c[b++]*e;h.quadraticCurveTo(x,v,n,p);if(m=k[k.length-1]){w=m.x;t=m.y;m=1;for(divisions=this.divisions;m<=divisions;m++){var C=m/divisions,E=THREE.Shape.Utils.b2(C,w,x,n),C=THREE.Shape.Utils.b2(C,t,v,p);k.push(new THREE.Vector2(E,C))}}break;case "b":if(n=c[b++]*e+f,p=c[b++]*e,x=c[b++]*e+f,v=c[b++]*-e,z=c[b++]*e+f,y=c[b++]*-e,h.bezierCurveTo(n,p,
-x,v,z,y),m=k[k.length-1]){w=m.x;t=m.y;m=1;for(divisions=this.divisions;m<=divisions;m++)C=m/divisions,E=THREE.Shape.Utils.b3(C,w,x,z,n),C=THREE.Shape.Utils.b3(C,t,v,y,p),k.push(new THREE.Vector2(E,C))}}}return{offset:B.ha*e,points:k,path:h}}}};
-(function(b){var c=function(b){for(var c=b.length,h=0,k=c-1,m=0;m<c;k=m++)h+=b[k].x*b[m].y-b[m].x*b[k].y;return h*0.5};b.Triangulate=function(b,f){var h=b.length;if(h<3)return null;var k=[],m=[],n=[],u,p,w;if(c(b)>0)for(p=0;p<h;p++)m[p]=p;else for(p=0;p<h;p++)m[p]=h-1-p;var t=2*h;for(p=h-1;h>2;){if(t--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}u=p;h<=u&&(u=0);p=u+1;h<=p&&(p=0);w=p+1;h<=w&&(w=0);var x;a:{x=b;var v=u,z=p,y=w,B=h,C=m,E=void 0,F=void 0,G=void 0,
+this.getFace(),e=this.size/c.resolution,f=0,m=String(b).split(""),h=m.length,k=[],b=0;b<h;b++){var n=new THREE.Path,n=this.extractGlyphPoints(m[b],c,e,f,n);f+=n.offset;k.push(n.path)}return{paths:k,offset:f/2}},extractGlyphPoints:function(b,c,e,f,m){var h=[],k,n,p,u,w,t,x,v,z,y,B=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(B){if(B.o){c=B._cachedOutline||(B._cachedOutline=B.o.split(" "));p=c.length;for(b=0;b<p;)switch(n=c[b++],n){case "m":n=c[b++]*e+f;u=c[b++]*e;h.push(new THREE.Vector2(n,
+u));m.moveTo(n,u);break;case "l":n=c[b++]*e+f;u=c[b++]*e;h.push(new THREE.Vector2(n,u));m.lineTo(n,u);break;case "q":n=c[b++]*e+f;u=c[b++]*e;x=c[b++]*e+f;v=c[b++]*e;m.quadraticCurveTo(x,v,n,u);if(k=h[h.length-1]){w=k.x;t=k.y;k=1;for(divisions=this.divisions;k<=divisions;k++){var C=k/divisions,E=THREE.Shape.Utils.b2(C,w,x,n),C=THREE.Shape.Utils.b2(C,t,v,u);h.push(new THREE.Vector2(E,C))}}break;case "b":if(n=c[b++]*e+f,u=c[b++]*e,x=c[b++]*e+f,v=c[b++]*-e,z=c[b++]*e+f,y=c[b++]*-e,m.bezierCurveTo(n,u,
+x,v,z,y),k=h[h.length-1]){w=k.x;t=k.y;k=1;for(divisions=this.divisions;k<=divisions;k++)C=k/divisions,E=THREE.Shape.Utils.b3(C,w,x,z,n),C=THREE.Shape.Utils.b3(C,t,v,y,u),h.push(new THREE.Vector2(E,C))}}}return{offset:B.ha*e,points:h,path:m}}}};
+(function(b){var c=function(b){for(var c=b.length,m=0,h=c-1,k=0;k<c;h=k++)m+=b[h].x*b[k].y-b[k].x*b[h].y;return m*0.5};b.Triangulate=function(b,f){var m=b.length;if(m<3)return null;var h=[],k=[],n=[],p,u,w;if(c(b)>0)for(u=0;u<m;u++)k[u]=u;else for(u=0;u<m;u++)k[u]=m-1-u;var t=2*m;for(u=m-1;m>2;){if(t--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return h}p=u;m<=p&&(p=0);u=p+1;m<=u&&(u=0);w=u+1;m<=w&&(w=0);var x;a:{x=b;var v=p,z=u,y=w,B=m,C=k,E=void 0,F=void 0,G=void 0,
 M=void 0,P=void 0,L=void 0,A=void 0,J=void 0,Z=void 0,F=x[C[v]].x,G=x[C[v]].y,M=x[C[z]].x,P=x[C[z]].y,L=x[C[y]].x,A=x[C[y]].y;if(1.0E-10>(M-F)*(A-G)-(P-G)*(L-F))x=!1;else{for(E=0;E<B;E++)if(!(E==v||E==z||E==y)){var J=x[C[E]].x,Z=x[C[E]].y,I=void 0,O=void 0,X=void 0,V=void 0,W=void 0,o=void 0,ea=void 0,T=void 0,na=void 0,aa=void 0,ha=void 0,ca=void 0,I=X=W=void 0,I=L-M,O=A-P,X=F-L,V=G-A,W=M-F,o=P-G,ea=J-F,T=Z-G,na=J-M,aa=Z-P,ha=J-L,ca=Z-A,I=I*aa-O*na,W=W*T-o*ea,X=X*ca-V*ha;if(I>=0&&X>=0&&W>=0){x=!1;
-break a}}x=!0}}if(x){k.push([b[m[u]],b[m[p]],b[m[w]]]);n.push([m[u],m[p],m[w]]);u=p;for(w=p+1;w<h;u++,w++)m[u]=m[w];h--;t=2*h}}if(f)return n;return k};b.Triangulate.area=c;return b})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
-THREE.TorusGeometry=function(b,c,e,f,h){THREE.Geometry.call(this);this.radius=b||100;this.tube=c||40;this.segmentsR=e||8;this.segmentsT=f||6;this.arc=h||Math.PI*2;h=new THREE.Vector3;b=[];c=[];for(e=0;e<=this.segmentsR;e++)for(f=0;f<=this.segmentsT;f++){var k=f/this.segmentsT*this.arc,m=e/this.segmentsR*Math.PI*2;h.x=this.radius*Math.cos(k);h.y=this.radius*Math.sin(k);var n=new THREE.Vector3;n.x=(this.radius+this.tube*Math.cos(m))*Math.cos(k);n.y=(this.radius+this.tube*Math.cos(m))*Math.sin(k);n.z=
-this.tube*Math.sin(m);this.vertices.push(new THREE.Vertex(n));b.push(new THREE.UV(f/this.segmentsT,1-e/this.segmentsR));c.push(n.clone().subSelf(h).normalize())}for(e=1;e<=this.segmentsR;e++)for(f=1;f<=this.segmentsT;f++){var h=(this.segmentsT+1)*e+f-1,k=(this.segmentsT+1)*(e-1)+f-1,m=(this.segmentsT+1)*(e-1)+f,n=(this.segmentsT+1)*e+f,u=new THREE.Face4(h,k,m,n,[c[h],c[k],c[m],c[n]]);u.normal.addSelf(c[h]);u.normal.addSelf(c[k]);u.normal.addSelf(c[m]);u.normal.addSelf(c[n]);u.normal.normalize();this.faces.push(u);
-this.faceVertexUvs[0].push([b[h].clone(),b[k].clone(),b[m].clone(),b[n].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
-THREE.TorusKnotGeometry=function(b,c,e,f,h,k,m){function n(b,c,e,f,k,h){c=e/f*b;e=Math.cos(c);return new THREE.Vector3(k*(2+e)*0.5*Math.cos(b),k*(2+e)*Math.sin(b)*0.5,h*k*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=b||200;this.tube=c||40;this.segmentsR=e||64;this.segmentsT=f||8;this.p=h||2;this.q=k||3;this.heightScale=m||1;this.grid=Array(this.segmentsR);e=new THREE.Vector3;f=new THREE.Vector3;k=new THREE.Vector3;for(b=0;b<this.segmentsR;++b){this.grid[b]=Array(this.segmentsT);for(c=0;c<
-this.segmentsT;++c){var u=b/this.segmentsR*2*this.p*Math.PI,m=c/this.segmentsT*2*Math.PI,h=n(u,m,this.q,this.p,this.radius,this.heightScale),u=n(u+0.01,m,this.q,this.p,this.radius,this.heightScale);e.x=u.x-h.x;e.y=u.y-h.y;e.z=u.z-h.z;f.x=u.x+h.x;f.y=u.y+h.y;f.z=u.z+h.z;k.cross(e,f);f.cross(k,e);k.normalize();f.normalize();u=-this.tube*Math.cos(m);m=this.tube*Math.sin(m);h.x+=u*f.x+m*k.x;h.y+=u*f.y+m*k.y;h.z+=u*f.z+m*k.z;this.grid[b][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(h.x,h.y,
-h.z)))-1}}for(b=0;b<this.segmentsR;++b)for(c=0;c<this.segmentsT;++c){var f=(b+1)%this.segmentsR,k=(c+1)%this.segmentsT,h=this.grid[b][c],e=this.grid[f][c],f=this.grid[f][k],k=this.grid[b][k],m=new THREE.UV(b/this.segmentsR,c/this.segmentsT),u=new THREE.UV((b+1)/this.segmentsR,c/this.segmentsT),p=new THREE.UV((b+1)/this.segmentsR,(c+1)/this.segmentsT),w=new THREE.UV(b/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(h,e,f,k));this.faceVertexUvs[0].push([m,u,p,w])}this.computeCentroids();
+break a}}x=!0}}if(x){h.push([b[k[p]],b[k[u]],b[k[w]]]);n.push([k[p],k[u],k[w]]);p=u;for(w=u+1;w<m;p++,w++)k[p]=k[w];m--;t=2*m}}if(f)return n;return h};b.Triangulate.area=c;return b})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
+THREE.TorusGeometry=function(b,c,e,f,m){THREE.Geometry.call(this);this.radius=b||100;this.tube=c||40;this.segmentsR=e||8;this.segmentsT=f||6;this.arc=m||Math.PI*2;m=new THREE.Vector3;b=[];c=[];for(e=0;e<=this.segmentsR;e++)for(f=0;f<=this.segmentsT;f++){var h=f/this.segmentsT*this.arc,k=e/this.segmentsR*Math.PI*2;m.x=this.radius*Math.cos(h);m.y=this.radius*Math.sin(h);var n=new THREE.Vector3;n.x=(this.radius+this.tube*Math.cos(k))*Math.cos(h);n.y=(this.radius+this.tube*Math.cos(k))*Math.sin(h);n.z=
+this.tube*Math.sin(k);this.vertices.push(new THREE.Vertex(n));b.push(new THREE.UV(f/this.segmentsT,1-e/this.segmentsR));c.push(n.clone().subSelf(m).normalize())}for(e=1;e<=this.segmentsR;e++)for(f=1;f<=this.segmentsT;f++){var m=(this.segmentsT+1)*e+f-1,h=(this.segmentsT+1)*(e-1)+f-1,k=(this.segmentsT+1)*(e-1)+f,n=(this.segmentsT+1)*e+f,p=new THREE.Face4(m,h,k,n,[c[m],c[h],c[k],c[n]]);p.normal.addSelf(c[m]);p.normal.addSelf(c[h]);p.normal.addSelf(c[k]);p.normal.addSelf(c[n]);p.normal.normalize();this.faces.push(p);
+this.faceVertexUvs[0].push([b[m].clone(),b[h].clone(),b[k].clone(),b[n].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
+THREE.TorusKnotGeometry=function(b,c,e,f,m,h,k){function n(b,c,e,f,h,k){c=e/f*b;e=Math.cos(c);return new THREE.Vector3(h*(2+e)*0.5*Math.cos(b),h*(2+e)*Math.sin(b)*0.5,k*h*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=b||200;this.tube=c||40;this.segmentsR=e||64;this.segmentsT=f||8;this.p=m||2;this.q=h||3;this.heightScale=k||1;this.grid=Array(this.segmentsR);e=new THREE.Vector3;f=new THREE.Vector3;h=new THREE.Vector3;for(b=0;b<this.segmentsR;++b){this.grid[b]=Array(this.segmentsT);for(c=0;c<
+this.segmentsT;++c){var p=b/this.segmentsR*2*this.p*Math.PI,k=c/this.segmentsT*2*Math.PI,m=n(p,k,this.q,this.p,this.radius,this.heightScale),p=n(p+0.01,k,this.q,this.p,this.radius,this.heightScale);e.x=p.x-m.x;e.y=p.y-m.y;e.z=p.z-m.z;f.x=p.x+m.x;f.y=p.y+m.y;f.z=p.z+m.z;h.cross(e,f);f.cross(h,e);h.normalize();f.normalize();p=-this.tube*Math.cos(k);k=this.tube*Math.sin(k);m.x+=p*f.x+k*h.x;m.y+=p*f.y+k*h.y;m.z+=p*f.z+k*h.z;this.grid[b][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(m.x,m.y,
+m.z)))-1}}for(b=0;b<this.segmentsR;++b)for(c=0;c<this.segmentsT;++c){var f=(b+1)%this.segmentsR,h=(c+1)%this.segmentsT,m=this.grid[b][c],e=this.grid[f][c],f=this.grid[f][h],h=this.grid[b][h],k=new THREE.UV(b/this.segmentsR,c/this.segmentsT),p=new THREE.UV((b+1)/this.segmentsR,c/this.segmentsT),u=new THREE.UV((b+1)/this.segmentsR,(c+1)/this.segmentsT),w=new THREE.UV(b/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(m,e,f,h));this.faceVertexUvs[0].push([k,p,u,w])}this.computeCentroids();
 this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;THREE.Loader=function(b){this.statusDomElement=(this.showStatus=b)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={addStatusElement:function(){var b=document.createElement("div");b.style.position="absolute";b.style.right="0px";b.style.top="0px";b.style.fontSize="0.8em";b.style.textAlign="left";b.style.background="rgba(0,0,0,0.25)";b.style.color="#fff";b.style.width="120px";b.style.padding="0.5em 0.5em 0.5em 0.5em";b.style.zIndex=1E3;b.innerHTML="Loading ...";return b},updateProgress:function(b){var c="Loaded ";c+=b.total?(100*b.loaded/b.total).toFixed(0)+"%":(b.loaded/1E3).toFixed(2)+" KB";
 this.statusDomElement.innerHTML=c},extractUrlbase:function(b){b=b.split("/");b.pop();return b.length<1?".":b.join("/")},init_materials:function(b,c,e){b.materials=[];for(var f=0;f<c.length;++f)b.materials[f]=[THREE.Loader.prototype.createMaterial(c[f],e)]},hasNormals:function(b){var c,e,f=b.materials.length;for(e=0;e<f;e++)if(c=b.materials[e][0],c instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(b,c){function e(b){b=Math.log(b)/Math.LN2;return Math.floor(b)==b}function f(b,
-c){var f=new Image;f.onload=function(){if(!e(this.width)||!e(this.height)){var c=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),f=Math.pow(2,Math.round(Math.log(this.height)/Math.LN2));b.image.width=c;b.image.height=f;b.image.getContext("2d").drawImage(this,0,0,c,f)}else b.image=this;b.needsUpdate=!0};f.src=c}function h(b,e,k,h,m,n){var p=document.createElement("canvas");b[e]=new THREE.Texture(p);b[e].sourceFile=k;if(h){b[e].repeat.set(h[0],h[1]);if(h[0]!=1)b[e].wrapS=THREE.RepeatWrapping;
-if(h[1]!=1)b[e].wrapT=THREE.RepeatWrapping}m&&b[e].offset.set(m[0],m[1]);if(n){h={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(h[n[0]]!==void 0)b[e].wrapS=h[n[0]];if(h[n[1]]!==void 0)b[e].wrapT=h[n[1]]}f(b[e],c+"/"+k)}function k(b){return(b[0]*255<<16)+(b[1]*255<<8)+b[2]*255}var m,n,u;n="MeshLambertMaterial";m={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:b.wireframe};b.shading&&(b.shading=="Phong"?n="MeshPhongMaterial":b.shading=="Basic"&&(n="MeshBasicMaterial"));
-if(b.blending)if(b.blending=="Additive")m.blending=THREE.AdditiveBlending;else if(b.blending=="Subtractive")m.blending=THREE.SubtractiveBlending;else if(b.blending=="Multiply")m.blending=THREE.MultiplyBlending;if(b.transparent!==void 0||b.opacity<1)m.transparent=b.transparent;if(b.depthTest!==void 0)m.depthTest=b.depthTest;if(b.vertexColors!==void 0)if(b.vertexColors=="face")m.vertexColors=THREE.FaceColors;else if(b.vertexColors)m.vertexColors=THREE.VertexColors;if(b.colorDiffuse)m.color=k(b.colorDiffuse);
-else if(b.DbgColor)m.color=b.DbgColor;if(b.colorSpecular)m.specular=k(b.colorSpecular);if(b.colorAmbient)m.ambient=k(b.colorAmbient);if(b.transparency)m.opacity=b.transparency;if(b.specularCoef)m.shininess=b.specularCoef;b.mapDiffuse&&c&&h(m,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap);b.mapLight&&c&&h(m,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap);b.mapNormal&&c&&h(m,"normalMap",b.mapNormal,b.mapNormalRepeat,b.mapNormalOffset,b.mapNormalWrap);
-b.mapSpecular&&c&&h(m,"specularMap",b.mapSpecular,b.mapSpecularRepeat,b.mapSpecularOffset,b.mapSpecularWrap);if(b.mapNormal){var p=THREE.ShaderUtils.lib.normal,w=THREE.UniformsUtils.clone(p.uniforms),t=m.color;n=m.specular;u=m.ambient;var x=m.shininess;w.tNormal.texture=m.normalMap;if(b.mapNormalFactor)w.uNormalScale.value=b.mapNormalFactor;if(m.map)w.tDiffuse.texture=m.map,w.enableDiffuse.value=!0;if(m.specularMap)w.tSpecular.texture=m.specularMap,w.enableSpecular.value=!0;if(m.lightMap)w.tAO.texture=
-m.lightMap,w.enableAO.value=!0;w.uDiffuseColor.value.setHex(t);w.uSpecularColor.value.setHex(n);w.uAmbientColor.value.setHex(u);w.uShininess.value=x;if(m.opacity)w.uOpacity.value=m.opacity;m=new THREE.ShaderMaterial({fragmentShader:p.fragmentShader,vertexShader:p.vertexShader,uniforms:w,lights:!0,fog:!0})}else m=new THREE[n](m);return m},constructor:THREE.Loader};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;
+c){var f=new Image;f.onload=function(){if(!e(this.width)||!e(this.height)){var c=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),f=Math.pow(2,Math.round(Math.log(this.height)/Math.LN2));b.image.width=c;b.image.height=f;b.image.getContext("2d").drawImage(this,0,0,c,f)}else b.image=this;b.needsUpdate=!0};f.src=c}function m(b,e,h,k,m,n){var p=document.createElement("canvas");b[e]=new THREE.Texture(p);b[e].sourceFile=h;if(k){b[e].repeat.set(k[0],k[1]);if(k[0]!=1)b[e].wrapS=THREE.RepeatWrapping;
+if(k[1]!=1)b[e].wrapT=THREE.RepeatWrapping}m&&b[e].offset.set(m[0],m[1]);if(n){k={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(k[n[0]]!==void 0)b[e].wrapS=k[n[0]];if(k[n[1]]!==void 0)b[e].wrapT=k[n[1]]}f(b[e],c+"/"+h)}function h(b){return(b[0]*255<<16)+(b[1]*255<<8)+b[2]*255}var k,n,p;n="MeshLambertMaterial";k={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:b.wireframe};b.shading&&(b.shading=="Phong"?n="MeshPhongMaterial":b.shading=="Basic"&&(n="MeshBasicMaterial"));
+if(b.blending)if(b.blending=="Additive")k.blending=THREE.AdditiveBlending;else if(b.blending=="Subtractive")k.blending=THREE.SubtractiveBlending;else if(b.blending=="Multiply")k.blending=THREE.MultiplyBlending;if(b.transparent!==void 0||b.opacity<1)k.transparent=b.transparent;if(b.depthTest!==void 0)k.depthTest=b.depthTest;if(b.vertexColors!==void 0)if(b.vertexColors=="face")k.vertexColors=THREE.FaceColors;else if(b.vertexColors)k.vertexColors=THREE.VertexColors;if(b.colorDiffuse)k.color=h(b.colorDiffuse);
+else if(b.DbgColor)k.color=b.DbgColor;if(b.colorSpecular)k.specular=h(b.colorSpecular);if(b.colorAmbient)k.ambient=h(b.colorAmbient);if(b.transparency)k.opacity=b.transparency;if(b.specularCoef)k.shininess=b.specularCoef;b.mapDiffuse&&c&&m(k,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap);b.mapLight&&c&&m(k,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap);b.mapNormal&&c&&m(k,"normalMap",b.mapNormal,b.mapNormalRepeat,b.mapNormalOffset,b.mapNormalWrap);
+b.mapSpecular&&c&&m(k,"specularMap",b.mapSpecular,b.mapSpecularRepeat,b.mapSpecularOffset,b.mapSpecularWrap);if(b.mapNormal){var u=THREE.ShaderUtils.lib.normal,w=THREE.UniformsUtils.clone(u.uniforms),t=k.color;n=k.specular;p=k.ambient;var x=k.shininess;w.tNormal.texture=k.normalMap;if(b.mapNormalFactor)w.uNormalScale.value=b.mapNormalFactor;if(k.map)w.tDiffuse.texture=k.map,w.enableDiffuse.value=!0;if(k.specularMap)w.tSpecular.texture=k.specularMap,w.enableSpecular.value=!0;if(k.lightMap)w.tAO.texture=
+k.lightMap,w.enableAO.value=!0;w.uDiffuseColor.value.setHex(t);w.uSpecularColor.value.setHex(n);w.uAmbientColor.value.setHex(p);w.uShininess.value=x;if(k.opacity)w.uOpacity.value=k.opacity;k=new THREE.ShaderMaterial({fragmentShader:u.fragmentShader,vertexShader:u.vertexShader,uniforms:w,lights:!0,fog:!0})}else k=new THREE[n](k);return k},constructor:THREE.Loader};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;
 THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
-THREE.BinaryLoader.prototype.load=function(b){var c=b.model,e=b.callback,f=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(c),h=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(c),b=(new Date).getTime(),c=new Worker(c),k=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,e,h,f,k)};c.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};
+THREE.BinaryLoader.prototype.load=function(b){var c=b.model,e=b.callback,f=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(c),m=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(c),b=(new Date).getTime(),c=new Worker(c),h=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,e,m,f,h)};c.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};
 c.postMessage(b)};
-THREE.BinaryLoader.prototype.loadAjaxBuffers=function(b,c,e,f,h,k){var m=new XMLHttpRequest,n=f+"/"+b,u=0;m.onreadystatechange=function(){m.readyState==4?m.status==200||m.status==0?THREE.BinaryLoader.prototype.createBinModel(m.responseText,e,h,c):alert("Couldn't load ["+n+"] ["+m.status+"]"):m.readyState==3?k&&(u==0&&(u=m.getResponseHeader("Content-Length")),k({total:u,loaded:m.responseText.length})):m.readyState==2&&(u=m.getResponseHeader("Content-Length"))};m.open("GET",n,!0);m.overrideMimeType("text/plain; charset=x-user-defined");
-m.setRequestHeader("Content-Type","text/plain");m.send(null)};
-THREE.BinaryLoader.prototype.createBinModel=function(b,c,e,f){var h=function(c){function e(b,c){var f=w(b,c),h=w(b,c+1),k=w(b,c+2),m=w(b,c+3),n=(m<<1&255|k>>7)-127;f|=(k&127)<<16|h<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,c){var e=w(b,c),f=w(b,c+1),k=w(b,c+2);return(w(b,c+3)<<24)+(k<<16)+(f<<8)+e}function u(b,c){var e=w(b,c);return(w(b,c+1)<<8)+e}function p(b,c){var e=w(b,c);return e>127?e-256:e}function w(b,c){return b.charCodeAt(c)&255}function t(c){var e,
-f,k;e=h(b,c);f=h(b,c+P);k=h(b,c+L);c=u(b,c+A);C.faces.push(new THREE.Face3(e,f,k,null,null,C.materials[c]))}function x(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+P);k=h(b,c+L);m=u(b,c+A);o=h(b,c+J);p=h(b,c+Z);c=h(b,c+I);m=C.materials[m];var t=G[p*3],v=G[p*3+1];p=G[p*3+2];var w=G[c*3],x=G[c*3+1],c=G[c*3+2];C.faces.push(new THREE.Face3(e,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(t,v,p),new THREE.Vector3(w,x,c)],null,m))}function v(c){var e,f,k,m;e=h(b,c);f=h(b,c+O);k=h(b,c+X);m=h(b,
-c+V);c=u(b,c+W);C.faces.push(new THREE.Face4(e,f,k,m,null,null,C.materials[c]))}function z(c){var e,f,k,m,p,t,v,w;e=h(b,c);f=h(b,c+O);k=h(b,c+X);m=h(b,c+V);p=u(b,c+W);t=h(b,c+o);v=h(b,c+ea);w=h(b,c+T);c=h(b,c+na);p=C.materials[p];var x=G[v*3],K=G[v*3+1];v=G[v*3+2];var y=G[w*3],S=G[w*3+1];w=G[w*3+2];var z=G[c*3],B=G[c*3+1],c=G[c*3+2];C.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(G[t*3],G[t*3+1],G[t*3+2]),new THREE.Vector3(x,K,v),new THREE.Vector3(y,S,w),new THREE.Vector3(z,B,c)],null,p))}
-function y(c){var e,f,k,m;e=h(b,c);f=h(b,c+aa);k=h(b,c+ha);c=M[e*2];m=M[e*2+1];e=M[f*2];var o=C.faceVertexUvs[0];f=M[f*2+1];var p=M[k*2];k=M[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,k));o.push(t)}function B(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+ca);k=h(b,c+qa);m=h(b,c+fa);c=M[e*2];o=M[e*2+1];e=M[f*2];p=M[f*2+1];f=M[k*2];var t=C.faceVertexUvs[0];k=M[k*2+1];var u=M[m*2];m=M[m*2+1];var v=[];v.push(new THREE.UV(c,o));v.push(new THREE.UV(e,p));v.push(new THREE.UV(f,
-k));v.push(new THREE.UV(u,m));t.push(v)}var C=this,E=0,F,G=[],M=[],P,L,A,J,Z,I,O,X,V,W,o,ea,T,na,aa,ha,ca,qa,fa,da,U,$,ga,ka,ua;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(C,f,c);F={signature:b.substr(E,8),header_bytes:w(b,E+8),vertex_coordinate_bytes:w(b,E+9),normal_coordinate_bytes:w(b,E+10),uv_coordinate_bytes:w(b,E+11),vertex_index_bytes:w(b,E+12),normal_index_bytes:w(b,E+13),uv_index_bytes:w(b,E+14),material_index_bytes:w(b,E+15),nvertices:h(b,E+16),nnormals:h(b,E+16+4),nuvs:h(b,
-E+16+8),ntri_flat:h(b,E+16+12),ntri_smooth:h(b,E+16+16),ntri_flat_uv:h(b,E+16+20),ntri_smooth_uv:h(b,E+16+24),nquad_flat:h(b,E+16+28),nquad_smooth:h(b,E+16+32),nquad_flat_uv:h(b,E+16+36),nquad_smooth_uv:h(b,E+16+40)};E+=F.header_bytes;P=F.vertex_index_bytes;L=F.vertex_index_bytes*2;A=F.vertex_index_bytes*3;J=F.vertex_index_bytes*3+F.material_index_bytes;Z=F.vertex_index_bytes*3+F.material_index_bytes+F.normal_index_bytes;I=F.vertex_index_bytes*3+F.material_index_bytes+F.normal_index_bytes*2;O=F.vertex_index_bytes;
+THREE.BinaryLoader.prototype.loadAjaxBuffers=function(b,c,e,f,m,h){var k=new XMLHttpRequest,n=f+"/"+b,p=0;k.onreadystatechange=function(){k.readyState==4?k.status==200||k.status==0?THREE.BinaryLoader.prototype.createBinModel(k.responseText,e,m,c):alert("Couldn't load ["+n+"] ["+k.status+"]"):k.readyState==3?h&&(p==0&&(p=k.getResponseHeader("Content-Length")),h({total:p,loaded:k.responseText.length})):k.readyState==2&&(p=k.getResponseHeader("Content-Length"))};k.open("GET",n,!0);k.overrideMimeType("text/plain; charset=x-user-defined");
+k.setRequestHeader("Content-Type","text/plain");k.send(null)};
+THREE.BinaryLoader.prototype.createBinModel=function(b,c,e,f){var m=function(c){function e(b,c){var f=w(b,c),h=w(b,c+1),k=w(b,c+2),m=w(b,c+3),n=(m<<1&255|k>>7)-127;f|=(k&127)<<16|h<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function m(b,c){var e=w(b,c),f=w(b,c+1),h=w(b,c+2);return(w(b,c+3)<<24)+(h<<16)+(f<<8)+e}function p(b,c){var e=w(b,c);return(w(b,c+1)<<8)+e}function u(b,c){var e=w(b,c);return e>127?e-256:e}function w(b,c){return b.charCodeAt(c)&255}function t(c){var e,
+f,h;e=m(b,c);f=m(b,c+P);h=m(b,c+L);c=p(b,c+A);C.faces.push(new THREE.Face3(e,f,h,null,null,C.materials[c]))}function x(c){var e,f,h,k,o,t;e=m(b,c);f=m(b,c+P);h=m(b,c+L);k=p(b,c+A);o=m(b,c+J);t=m(b,c+Z);c=m(b,c+I);k=C.materials[k];var u=G[t*3],v=G[t*3+1];t=G[t*3+2];var w=G[c*3],x=G[c*3+1],c=G[c*3+2];C.faces.push(new THREE.Face3(e,f,h,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(u,v,t),new THREE.Vector3(w,x,c)],null,k))}function v(c){var e,f,h,k;e=m(b,c);f=m(b,c+O);h=m(b,c+X);k=m(b,
+c+V);c=p(b,c+W);C.faces.push(new THREE.Face4(e,f,h,k,null,null,C.materials[c]))}function z(c){var e,f,h,k,t,u,v,w;e=m(b,c);f=m(b,c+O);h=m(b,c+X);k=m(b,c+V);t=p(b,c+W);u=m(b,c+o);v=m(b,c+ea);w=m(b,c+T);c=m(b,c+na);t=C.materials[t];var x=G[v*3],K=G[v*3+1];v=G[v*3+2];var y=G[w*3],S=G[w*3+1];w=G[w*3+2];var z=G[c*3],B=G[c*3+1],c=G[c*3+2];C.faces.push(new THREE.Face4(e,f,h,k,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,K,v),new THREE.Vector3(y,S,w),new THREE.Vector3(z,B,c)],null,t))}
+function y(c){var e,f,h,k;e=m(b,c);f=m(b,c+aa);h=m(b,c+ha);c=M[e*2];k=M[e*2+1];e=M[f*2];var o=C.faceVertexUvs[0];f=M[f*2+1];var p=M[h*2];h=M[h*2+1];var t=[];t.push(new THREE.UV(c,k));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,h));o.push(t)}function B(c){var e,f,h,k,o,p;e=m(b,c);f=m(b,c+ca);h=m(b,c+qa);k=m(b,c+fa);c=M[e*2];o=M[e*2+1];e=M[f*2];p=M[f*2+1];f=M[h*2];var t=C.faceVertexUvs[0];h=M[h*2+1];var u=M[k*2];k=M[k*2+1];var v=[];v.push(new THREE.UV(c,o));v.push(new THREE.UV(e,p));v.push(new THREE.UV(f,
+h));v.push(new THREE.UV(u,k));t.push(v)}var C=this,E=0,F,G=[],M=[],P,L,A,J,Z,I,O,X,V,W,o,ea,T,na,aa,ha,ca,qa,fa,da,U,$,ga,ka,ua;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(C,f,c);F={signature:b.substr(E,8),header_bytes:w(b,E+8),vertex_coordinate_bytes:w(b,E+9),normal_coordinate_bytes:w(b,E+10),uv_coordinate_bytes:w(b,E+11),vertex_index_bytes:w(b,E+12),normal_index_bytes:w(b,E+13),uv_index_bytes:w(b,E+14),material_index_bytes:w(b,E+15),nvertices:m(b,E+16),nnormals:m(b,E+16+4),nuvs:m(b,
+E+16+8),ntri_flat:m(b,E+16+12),ntri_smooth:m(b,E+16+16),ntri_flat_uv:m(b,E+16+20),ntri_smooth_uv:m(b,E+16+24),nquad_flat:m(b,E+16+28),nquad_smooth:m(b,E+16+32),nquad_flat_uv:m(b,E+16+36),nquad_smooth_uv:m(b,E+16+40)};E+=F.header_bytes;P=F.vertex_index_bytes;L=F.vertex_index_bytes*2;A=F.vertex_index_bytes*3;J=F.vertex_index_bytes*3+F.material_index_bytes;Z=F.vertex_index_bytes*3+F.material_index_bytes+F.normal_index_bytes;I=F.vertex_index_bytes*3+F.material_index_bytes+F.normal_index_bytes*2;O=F.vertex_index_bytes;
 X=F.vertex_index_bytes*2;V=F.vertex_index_bytes*3;W=F.vertex_index_bytes*4;o=F.vertex_index_bytes*4+F.material_index_bytes;ea=F.vertex_index_bytes*4+F.material_index_bytes+F.normal_index_bytes;T=F.vertex_index_bytes*4+F.material_index_bytes+F.normal_index_bytes*2;na=F.vertex_index_bytes*4+F.material_index_bytes+F.normal_index_bytes*3;aa=F.uv_index_bytes;ha=F.uv_index_bytes*2;ca=F.uv_index_bytes;qa=F.uv_index_bytes*2;fa=F.uv_index_bytes*3;c=F.vertex_index_bytes*3+F.material_index_bytes;ua=F.vertex_index_bytes*
-4+F.material_index_bytes;da=F.ntri_flat*c;U=F.ntri_smooth*(c+F.normal_index_bytes*3);$=F.ntri_flat_uv*(c+F.uv_index_bytes*3);ga=F.ntri_smooth_uv*(c+F.normal_index_bytes*3+F.uv_index_bytes*3);ka=F.nquad_flat*ua;c=F.nquad_smooth*(ua+F.normal_index_bytes*4);ua=F.nquad_flat_uv*(ua+F.uv_index_bytes*4);E+=function(c){for(var f,h,k,n=F.vertex_coordinate_bytes*3,o=c+F.nvertices*n;c<o;c+=n)f=e(b,c),h=e(b,c+F.vertex_coordinate_bytes),k=e(b,c+F.vertex_coordinate_bytes*2),C.vertices.push(new THREE.Vertex(new THREE.Vector3(f,
-h,k)));return F.nvertices*n}(E);E+=function(c){for(var e,f,h,k=F.normal_coordinate_bytes*3,m=c+F.nnormals*k;c<m;c+=k)e=p(b,c),f=p(b,c+F.normal_coordinate_bytes),h=p(b,c+F.normal_coordinate_bytes*2),G.push(e/127,f/127,h/127);return F.nnormals*k}(E);E+=function(c){for(var f,h,k=F.uv_coordinate_bytes*2,n=c+F.nuvs*k;c<n;c+=k)f=e(b,c),h=e(b,c+F.uv_coordinate_bytes),M.push(f,h);return F.nuvs*k}(E);da=E+da;U=da+U;$=U+$;ga=$+ga;ka=ga+ka;c=ka+c;ua=c+ua;(function(b){var c,e=F.vertex_index_bytes*3+F.material_index_bytes,
+4+F.material_index_bytes;da=F.ntri_flat*c;U=F.ntri_smooth*(c+F.normal_index_bytes*3);$=F.ntri_flat_uv*(c+F.uv_index_bytes*3);ga=F.ntri_smooth_uv*(c+F.normal_index_bytes*3+F.uv_index_bytes*3);ka=F.nquad_flat*ua;c=F.nquad_smooth*(ua+F.normal_index_bytes*4);ua=F.nquad_flat_uv*(ua+F.uv_index_bytes*4);E+=function(c){for(var f,h,m,n=F.vertex_coordinate_bytes*3,o=c+F.nvertices*n;c<o;c+=n)f=e(b,c),h=e(b,c+F.vertex_coordinate_bytes),m=e(b,c+F.vertex_coordinate_bytes*2),C.vertices.push(new THREE.Vertex(new THREE.Vector3(f,
+h,m)));return F.nvertices*n}(E);E+=function(c){for(var e,f,h,k=F.normal_coordinate_bytes*3,m=c+F.nnormals*k;c<m;c+=k)e=u(b,c),f=u(b,c+F.normal_coordinate_bytes),h=u(b,c+F.normal_coordinate_bytes*2),G.push(e/127,f/127,h/127);return F.nnormals*k}(E);E+=function(c){for(var f,h,m=F.uv_coordinate_bytes*2,n=c+F.nuvs*m;c<n;c+=m)f=e(b,c),h=e(b,c+F.uv_coordinate_bytes),M.push(f,h);return F.nuvs*m}(E);da=E+da;U=da+U;$=U+$;ga=$+ga;ka=ga+ka;c=ka+c;ua=c+ua;(function(b){var c,e=F.vertex_index_bytes*3+F.material_index_bytes,
 f=e+F.uv_index_bytes*3,h=b+F.ntri_flat_uv*f;for(c=b;c<h;c+=f)t(c),y(c+e);return h-b})(U);(function(b){var c,e=F.vertex_index_bytes*3+F.material_index_bytes+F.normal_index_bytes*3,f=e+F.uv_index_bytes*3,h=b+F.ntri_smooth_uv*f;for(c=b;c<h;c+=f)x(c),y(c+e);return h-b})($);(function(b){var c,e=F.vertex_index_bytes*4+F.material_index_bytes,f=e+F.uv_index_bytes*4,h=b+F.nquad_flat_uv*f;for(c=b;c<h;c+=f)v(c),B(c+e);return h-b})(c);(function(b){var c,e=F.vertex_index_bytes*4+F.material_index_bytes+F.normal_index_bytes*
 4,f=e+F.uv_index_bytes*4,h=b+F.nquad_smooth_uv*f;for(c=b;c<h;c+=f)z(c),B(c+e);return h-b})(ua);(function(b){var c,e=F.vertex_index_bytes*3+F.material_index_bytes,f=b+F.ntri_flat*e;for(c=b;c<f;c+=e)t(c);return f-b})(E);(function(b){var c,e=F.vertex_index_bytes*3+F.material_index_bytes+F.normal_index_bytes*3,f=b+F.ntri_smooth*e;for(c=b;c<f;c+=e)x(c);return f-b})(da);(function(b){var c,e=F.vertex_index_bytes*4+F.material_index_bytes,f=b+F.nquad_flat*e;for(c=b;c<f;c+=e)v(c);return f-b})(ga);(function(b){var c,
-e=F.vertex_index_bytes*4+F.material_index_bytes+F.normal_index_bytes*4,f=b+F.nquad_smooth*e;for(c=b;c<f;c+=e)z(c);return f-b})(ka);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};h.prototype=new THREE.Geometry;h.prototype.constructor=h;c(new h(e))};
+e=F.vertex_index_bytes*4+F.material_index_bytes+F.normal_index_bytes*4,f=b+F.nquad_smooth*e;for(c=b;c<f;c+=e)z(c);return f-b})(ka);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};m.prototype=new THREE.Geometry;m.prototype.constructor=m;c(new m(e))};
 THREE.ColladaLoader=function(){function b(b,c,e){for(var b=da.evaluate(b,da,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),f={},h=b.iterateNext(),k=0;h;){h=(new c).parse(h);if(h.id.length==0)h.id=e+k++;f[h.id]=h;h=b.iterateNext()}return f}function c(){var b=1E6,c=-b,e=0,f;for(f in la)for(var h=la[f],k=0;k<h.sampler.length;k++){var m=h.sampler[k];m.create();b=Math.min(b,m.startTime);c=Math.max(c,m.endTime);e=Math.max(e,m.input.length)}return{start:b,end:c,frames:e}}function e(b,c,f,h){b.world=b.world||
 new THREE.Matrix4;b.world.copy(b.matrix);if(b.channels&&b.channels.length){var k=b.channels[0].sampler.output[f];k instanceof THREE.Matrix4&&b.world.copy(k)}h&&b.world.multiply(h,b.world);c.push(b);for(h=0;h<b.nodes.length;h++)e(b.nodes[h],c,f,b.world)}function f(b,f,h){var k=N[f.url];if(!k||!k.skin)console.log("could not find skin controller!");else if(!f.skeleton||!f.skeleton.length)console.log("could not find the skeleton for the skin!");else{var m=c(),f=$.getChildById(f.skeleton[0],!0)||$.getChildBySid(f.skeleton[0],
 !0),n,o,p,t,u=new THREE.Vector3,v;for(n=0;n<b.vertices.length;n++)k.skin.bindShapeMatrix.multiplyVector3(b.vertices[n].position);for(h=0;h<m.frames;h++){var w=[],x=[];for(n=0;n<b.vertices.length;n++)x.push(new THREE.Vertex(new THREE.Vector3));e(f,w,h);n=w;o=k.skin;for(t=0;t<n.length;t++){p=n[t];v=-1;for(var y=0;y<o.joints.length;y++)if(p.sid==o.joints[y]){v=y;break}if(v>=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];
-for(y=0;y<o.weights.length;y++)for(var z=0;z<o.weights[y].length;z++){var B=o.weights[y][z];B.joint==v&&p.weights.push(B)}}else throw"could not find joint!";}for(n=0;n<w.length;n++)for(o=0;o<w[n].weights.length;o++)p=w[n].weights[o],t=p.index,p=p.weight,v=b.vertices[t],t=x[t],u.x=v.position.x,u.y=v.position.y,u.z=v.position.z,w[n].skinningMatrix.multiplyVector3(u),t.position.x+=u.x*p,t.position.y+=u.y*p,t.position.z+=u.z*p;b.morphTargets.push({name:"target_"+h,vertices:x})}}}function h(b){var c=new THREE.Object3D,
-e,k,m;c.name=b.id||"";c.matrixAutoUpdate=!1;c.matrix=b.matrix;for(m=0;m<b.controllers.length;m++){var n=N[b.controllers[m].url];switch(n.type){case "skin":if(ma[n.skin.source]){var o=new z;o.url=n.skin.source;o.instance_material=b.controllers[m].instance_material;b.geometries.push(o);e=b.controllers[m]}else if(N[n.skin.source]&&(k=n=N[n.skin.source],n.morph&&ma[n.morph.source]))o=new z,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o);break;case "morph":if(ma[n.morph.source])o=
-new z,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o),k=b.controllers[m];console.log("DAE: morph-controller partially supported.")}}for(m=0;m<b.geometries.length;m++){var n=b.geometries[m],o=n.instance_material,n=ma[n.url],p={},t=0,u;if(n&&n.mesh&&n.mesh.primitives){if(c.name.length==0)c.name=n.id;if(o)for(j=0;j<o.length;j++){u=o[j];var v=wa[ra[u.target].instance_effect.url].shader;v.material.opacity=!v.material.opacity?1:v.material.opacity;u=p[u.symbol]=
-v.material;t++}o=u||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});n=n.mesh.geometry3js;if(t>1){o=new THREE.MeshFaceMaterial;for(j=0;j<n.faces.length;j++)t=n.faces[j],t.materials=[p[t.daeMaterial]]}if(e!==void 0)f(n,e),o.morphTargets=!0,o=new THREE.SkinnedMesh(n,o),o.skeleton=e.skeleton,o.skinController=N[e.url],o.skinInstanceController=e,o.name="skin_"+Ca.length,Ca.push(o);else if(k!==void 0){p=n;t=k instanceof x?N[k.url]:k;if(!t||!t.morph)console.log("could not find morph controller!");
-else{t=t.morph;for(v=0;v<t.targets.length;v++){var w=ma[t.targets[v]];if(w.mesh&&w.mesh.primitives&&w.mesh.primitives.length)w=w.mesh.primitives[0].geometry,w.vertices.length===p.vertices.length&&p.morphTargets.push({name:"target_1",vertices:w.vertices})}p.morphTargets.push({name:"target_Z",vertices:p.vertices})}o.morphTargets=!0;o=new THREE.Mesh(n,o);o.name="morph_"+Aa.length;Aa.push(o)}else o=new THREE.Mesh(n,o);c.add(o)}}for(m=0;m<b.nodes.length;m++)c.add(h(b.nodes[m],b));return c}function k(){this.init_from=
-this.id=""}function m(){this.type=this.name=this.id="";this.morph=this.skin=null}function n(){this.weights=this.targets=this.source=this.method=null}function u(){this.source="";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function p(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function w(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=[];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function t(){this.type=
+for(y=0;y<o.weights.length;y++)for(var z=0;z<o.weights[y].length;z++){var B=o.weights[y][z];B.joint==v&&p.weights.push(B)}}else throw"could not find joint!";}for(n=0;n<w.length;n++)for(o=0;o<w[n].weights.length;o++)p=w[n].weights[o],t=p.index,p=p.weight,v=b.vertices[t],t=x[t],u.x=v.position.x,u.y=v.position.y,u.z=v.position.z,w[n].skinningMatrix.multiplyVector3(u),t.position.x+=u.x*p,t.position.y+=u.y*p,t.position.z+=u.z*p;b.morphTargets.push({name:"target_"+h,vertices:x})}}}function m(b){var c=new THREE.Object3D,
+e,h,k;c.name=b.id||"";c.matrixAutoUpdate=!1;c.matrix=b.matrix;for(k=0;k<b.controllers.length;k++){var n=N[b.controllers[k].url];switch(n.type){case "skin":if(ma[n.skin.source]){var o=new z;o.url=n.skin.source;o.instance_material=b.controllers[k].instance_material;b.geometries.push(o);e=b.controllers[k]}else if(N[n.skin.source]&&(h=n=N[n.skin.source],n.morph&&ma[n.morph.source]))o=new z,o.url=n.morph.source,o.instance_material=b.controllers[k].instance_material,b.geometries.push(o);break;case "morph":if(ma[n.morph.source])o=
+new z,o.url=n.morph.source,o.instance_material=b.controllers[k].instance_material,b.geometries.push(o),h=b.controllers[k];console.log("DAE: morph-controller partially supported.")}}for(k=0;k<b.geometries.length;k++){var n=b.geometries[k],o=n.instance_material,n=ma[n.url],p={},t=0,u;if(n&&n.mesh&&n.mesh.primitives){if(c.name.length==0)c.name=n.id;if(o)for(j=0;j<o.length;j++){u=o[j];var v=wa[ra[u.target].instance_effect.url].shader;v.material.opacity=!v.material.opacity?1:v.material.opacity;u=p[u.symbol]=
+v.material;t++}o=u||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});n=n.mesh.geometry3js;if(t>1){o=new THREE.MeshFaceMaterial;for(j=0;j<n.faces.length;j++)t=n.faces[j],t.materials=[p[t.daeMaterial]]}if(e!==void 0)f(n,e),o.morphTargets=!0,o=new THREE.SkinnedMesh(n,o),o.skeleton=e.skeleton,o.skinController=N[e.url],o.skinInstanceController=e,o.name="skin_"+Ca.length,Ca.push(o);else if(h!==void 0){p=n;t=h instanceof x?N[h.url]:h;if(!t||!t.morph)console.log("could not find morph controller!");
+else{t=t.morph;for(v=0;v<t.targets.length;v++){var w=ma[t.targets[v]];if(w.mesh&&w.mesh.primitives&&w.mesh.primitives.length)w=w.mesh.primitives[0].geometry,w.vertices.length===p.vertices.length&&p.morphTargets.push({name:"target_1",vertices:w.vertices})}p.morphTargets.push({name:"target_Z",vertices:p.vertices})}o.morphTargets=!0;o=new THREE.Mesh(n,o);o.name="morph_"+Aa.length;Aa.push(o)}else o=new THREE.Mesh(n,o);c.add(o)}}for(k=0;k<b.nodes.length;k++)c.add(m(b.nodes[k],b));return c}function h(){this.init_from=
+this.id=""}function k(){this.type=this.name=this.id="";this.morph=this.skin=null}function n(){this.weights=this.targets=this.source=this.method=null}function p(){this.source="";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function u(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function w(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=[];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function t(){this.type=
 this.sid="";this.data=[];this.matrix=new THREE.Matrix4}function x(){this.url="";this.skeleton=[];this.instance_material=[]}function v(){this.target=this.symbol=""}function z(){this.url="";this.instance_material=[]}function y(){this.id="";this.mesh=null}function B(b){this.geometry=b.id;this.primitives=[];this.geometry3js=this.vertices=null}function C(){}function E(){this.material="";this.count=0;this.inputs=[];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function F(){this.source="";
 this.stride=this.count=0;this.params=[]}function G(){this.input={}}function M(){this.semantic="";this.offset=0;this.source="";this.set=0}function P(b){this.id=b;this.type=null}function L(){this.name=this.id="";this.instance_effect=null}function A(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texcoord=this.texture=null}function J(b,c){this.type=b;this.effect=c;this.material=null}function Z(b){this.effect=b;this.format=this.init_from=
 null}function I(b){this.effect=b;this.mipfilter=this.magfilter=this.minfilter=this.wrap_t=this.wrap_s=this.source=null}function O(){this.name=this.id="";this.sampler=this.surface=this.shader=null}function X(){this.url=""}function V(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function W(b){this.animation=b;this.target=this.source="";this.member=this.arrIndices=this.arrSyntax=this.dotSyntax=this.sid=null}function o(b){this.id="";this.animation=b;this.inputs=[];this.endTime=
 this.startTime=this.interpolation=this.output=this.input=null;this.duration=0}function ea(b){var c=b.getAttribute("id");if(ka[c]!=void 0)return ka[c];ka[c]=(new P(c)).parse(b);return ka[c]}function T(b){if(b=="dae")return"http://www.collada.org/2005/11/COLLADASchema";return null}function na(b){for(var b=ha(b),c=[],e=0;e<b.length;e++)c.push(parseFloat(b[e]));return c}function aa(b){for(var b=ha(b),c=[],e=0;e<b.length;e++)c.push(parseInt(b[e],10));return c}function ha(b){return b.replace(/^\s+/,"").replace(/\s+$/,
-"").split(/\s+/)}function ca(b,c,e){return b.hasAttribute(c)?parseInt(b.getAttribute(c),10):e}function qa(b,c){if(b===void 0){for(var e="0.";e.length<c+2;)e+="0";return e}c=c||2;e=b.toString().split(".");for(e[1]=e.length>1?e[1].substr(0,c):"0";e[1].length<c;)e[1]+="0";return e.join(".")}function fa(b,c){var e="";e+=qa(b.x,c)+",";e+=qa(b.y,c)+",";e+=qa(b.z,c);return e}var da=null,U=null,$,ga=null,ka={},ua={},la={},N={},ma={},ra={},wa={},Da,Ea,Aa,Ca,Ga=THREE.SmoothShading;k.prototype.parse=function(b){this.id=
-b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="init_from")this.init_from=e.textContent}return this};m.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.type="none";for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "skin":this.skin=(new u).parse(e);this.type=e.nodeName;break;case "morph":this.morph=(new n).parse(e),this.type=e.nodeName}}return this};n.prototype.parse=function(b){var c=
+"").split(/\s+/)}function ca(b,c,e){return b.hasAttribute(c)?parseInt(b.getAttribute(c),10):e}function qa(b,c){if(b===void 0){for(var e="0.";e.length<c+2;)e+="0";return e}c=c||2;e=b.toString().split(".");for(e[1]=e.length>1?e[1].substr(0,c):"0";e[1].length<c;)e[1]+="0";return e.join(".")}function fa(b,c){var e="";e+=qa(b.x,c)+",";e+=qa(b.y,c)+",";e+=qa(b.z,c);return e}var da=null,U=null,$,ga=null,ka={},ua={},la={},N={},ma={},ra={},wa={},Da,Ea,Aa,Ca,Ga=THREE.SmoothShading;h.prototype.parse=function(b){this.id=
+b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="init_from")this.init_from=e.textContent}return this};k.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.type="none";for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "skin":this.skin=(new p).parse(e);this.type=e.nodeName;break;case "morph":this.morph=(new n).parse(e),this.type=e.nodeName}}return this};n.prototype.parse=function(b){var c=
 {},e=[],f;this.method=b.getAttribute("method");this.source=b.getAttribute("source").replace(/^#/,"");for(f=0;f<b.childNodes.length;f++){var h=b.childNodes[f];if(h.nodeType==1)switch(h.nodeName){case "source":h=(new P).parse(h);c[h.id]=h;break;case "targets":e=this.parseInputs(h);break;default:console.log(h.nodeName)}}for(f=0;f<e.length;f++)switch(b=e[f],h=c[b.source],b.semantic){case "MORPH_TARGET":this.targets=h.read();break;case "MORPH_WEIGHT":this.weights=h.read()}return this};n.prototype.parseInputs=
-function(b){for(var c=[],e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":c.push((new M).parse(f))}}return c};u.prototype.parse=function(b){var c={},e,f;this.source=b.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var h=0;h<b.childNodes.length;h++){var k=b.childNodes[h];if(k.nodeType==1)switch(k.nodeName){case "bind_shape_matrix":k=na(k.textContent);this.bindShapeMatrix=new THREE.Matrix4;this.bindShapeMatrix.set(k[0],
-k[1],k[2],k[3],k[4],k[5],k[6],k[7],k[8],k[9],k[10],k[11],k[12],k[13],k[14],k[15]);break;case "source":k=(new P).parse(k);c[k.id]=k;break;case "joints":e=k;break;case "vertex_weights":f=k;break;default:console.log(k.nodeName)}}this.parseJoints(e,c);this.parseWeights(f,c);return this};u.prototype.parseJoints=function(b,c){for(var e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":var f=(new M).parse(f),h=c[f.source];if(f.semantic=="JOINT")this.joints=
-h.read();else if(f.semantic=="INV_BIND_MATRIX")this.invBindMatrices=h.read()}}};u.prototype.parseWeights=function(b,c){for(var e,f,h=[],k=0;k<b.childNodes.length;k++){var m=b.childNodes[k];if(m.nodeType==1)switch(m.nodeName){case "input":h.push((new M).parse(m));break;case "v":e=aa(m.textContent);break;case "vcount":f=aa(m.textContent)}}for(k=m=0;k<f.length;k++){for(var n=f[k],o=[],p=0;p<n;p++){for(var t={},u=0;u<h.length;u++){var v=h[u],w=e[m+v.offset];switch(v.semantic){case "JOINT":t.joint=w;break;
-case "WEIGHT":t.weight=c[v.source].data[w]}}o.push(t);m+=h.length}for(p=0;p<o.length;p++)o[p].index=k;this.weights.push(o)}};p.prototype.getChildById=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};p.prototype.getChildBySid=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};p.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");
+function(b){for(var c=[],e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":c.push((new M).parse(f))}}return c};p.prototype.parse=function(b){var c={},e,f;this.source=b.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var h=0;h<b.childNodes.length;h++){var k=b.childNodes[h];if(k.nodeType==1)switch(k.nodeName){case "bind_shape_matrix":k=na(k.textContent);this.bindShapeMatrix=new THREE.Matrix4;this.bindShapeMatrix.set(k[0],
+k[1],k[2],k[3],k[4],k[5],k[6],k[7],k[8],k[9],k[10],k[11],k[12],k[13],k[14],k[15]);break;case "source":k=(new P).parse(k);c[k.id]=k;break;case "joints":e=k;break;case "vertex_weights":f=k;break;default:console.log(k.nodeName)}}this.parseJoints(e,c);this.parseWeights(f,c);return this};p.prototype.parseJoints=function(b,c){for(var e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":var f=(new M).parse(f),h=c[f.source];if(f.semantic=="JOINT")this.joints=
+h.read();else if(f.semantic=="INV_BIND_MATRIX")this.invBindMatrices=h.read()}}};p.prototype.parseWeights=function(b,c){for(var e,f,h=[],k=0;k<b.childNodes.length;k++){var m=b.childNodes[k];if(m.nodeType==1)switch(m.nodeName){case "input":h.push((new M).parse(m));break;case "v":e=aa(m.textContent);break;case "vcount":f=aa(m.textContent)}}for(k=m=0;k<f.length;k++){for(var n=f[k],o=[],p=0;p<n;p++){for(var t={},u=0;u<h.length;u++){var v=h[u],w=e[m+v.offset];switch(v.semantic){case "JOINT":t.joint=w;break;
+case "WEIGHT":t.weight=c[v.source].data[w]}}o.push(t);m+=h.length}for(p=0;p<o.length;p++)o[p].index=k;this.weights.push(o)}};u.prototype.getChildById=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};u.prototype.getChildBySid=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};u.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");
 this.nodes=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "node":this.nodes.push((new w).parse(e))}}return this};w.prototype.getChannelForTransform=function(b){for(var c=0;c<this.channels.length;c++){var e=this.channels[c],f=e.target.split("/");f.shift();var h=f.shift(),k=h.indexOf(".")>=0,m=h.indexOf("(")>=0,n;if(k)f=h.split("."),h=f.shift(),f.shift();else if(m){n=h.split("(");h=n.shift();for(f=0;f<n.length;f++)n[f]=parseInt(n[f].replace(/\)/,
 ""))}if(h==b)return e.info={sid:h,dotSyntax:k,arrSyntax:m,arrIndices:n},e}return null};w.prototype.getChildById=function(b,c){if(this.id==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};w.prototype.getChildBySid=function(b,c){if(this.sid==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};w.prototype.getTransformBySid=function(b){for(var c=0;c<this.transforms.length;c++)if(this.transforms[c].sid==
 b)return this.transforms[c];return null};w.prototype.parse=function(b){var c;this.id=b.getAttribute("id");this.sid=b.getAttribute("sid");this.name=b.getAttribute("name");this.type=b.getAttribute("type");this.type=this.type=="JOINT"?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var e=0;e<b.childNodes.length;e++)if(c=b.childNodes[e],c.nodeType==1)switch(c.nodeName){case "node":this.nodes.push((new w).parse(c));break;case "instance_camera":break;
@@ -606,50 +605,50 @@ O.prototype.parseTechnique=function(b){for(var c=0;c<b.childNodes.length;c++){va
 (new P).parse(e);this.source[e.id]=e;break;case "sampler":this.sampler.push((new o(this)).parse(e));break;case "channel":this.channel.push((new W(this)).parse(e))}}return this};W.prototype.parse=function(b){this.source=b.getAttribute("source").replace(/^#/,"");this.target=b.getAttribute("target");var c=this.target.split("/");c.shift();var b=c.shift(),e=b.indexOf(".")>=0,f=b.indexOf("(")>=0,h,k;if(e)c=b.split("."),b=c.shift(),k=c.shift();else if(f){h=b.split("(");b=h.shift();for(c=0;c<h.length;c++)h[c]=
 parseInt(h[c].replace(/\)/,""))}this.sid=b;this.dotSyntax=e;this.arrSyntax=f;this.arrIndices=h;this.member=k;return this};o.prototype.parse=function(b){this.id=b.getAttribute("id");this.inputs=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "input":this.inputs.push((new M).parse(e))}}return this};o.prototype.create=function(){for(var b=0;b<this.inputs.length;b++){var c=this.inputs[b],e=this.animation.source[c.source];switch(c.semantic){case "INPUT":this.input=
 e.read();break;case "OUTPUT":this.output=e.read();break;case "INTERPOLATION":this.interpolation=e.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(c.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(b=0;b<this.input.length;b++)this.startTime=Math.min(this.startTime,this.input[b]),this.endTime=Math.max(this.endTime,this.input[b]);this.duration=this.endTime-this.startTime}};return{load:function(e,f){if(document.implementation&&
-document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);e+="?rnd="+Math.random();var n=new XMLHttpRequest;n.overrideMimeType&&n.overrideMimeType("text/xml");n.onreadystatechange=function(){if(n.readyState==4&&(n.status==0||n.status==200)){ga=f;var o,t=e;da=n.responseXML;o=ga;t!==void 0&&(t=t.split("/"),t.pop(),Ea=t.join("/")+"/");ua=b("//dae:library_images/dae:image",k,"image");ra=b("//dae:library_materials/dae:material",
-L,"material");wa=b("//dae:library_effects/dae:effect",O,"effect");ma=b("//dae:library_geometries/dae:geometry",y,"geometry");N=b("//dae:library_controllers/dae:controller",m,"controller");la=b("//dae:library_animations/dae:animation",V,"animation");Da=b(".//dae:library_visual_scenes/dae:visual_scene",p,"visual_scene");Aa=[];Ca=[];(t=da.evaluate(".//dae:scene/dae:instance_visual_scene",da,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(t=t.getAttribute("url").replace(/^#/,""),$=Da[t]):
-$=null;U=new THREE.Object3D;for(t=0;t<$.nodes.length;t++)U.add(h($.nodes[t]));c();for(var u in la);u={scene:U,morphs:Aa,skins:Ca,dae:{images:ua,materials:ra,effects:wa,geometries:ma,controllers:N,animations:la,visualScenes:Da,scene:$}};o&&o(u)}};n.open("GET",e,!0);n.send(null)}else alert("Don't know how to parse XML!")},setPreferredShading:function(b){Ga=b},applySkin:f,geometries:ma}};THREE.JSONLoader=function(b){THREE.Loader.call(this,b)};THREE.JSONLoader.prototype=new THREE.Loader;
-THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(b){var c=this,e=b.model,f=b.callback,h=b.texture_path?b.texture_path:this.extractUrlbase(e),b=new Worker(e);b.onmessage=function(b){c.createModel(b.data,f,h);c.onLoadComplete()};this.onLoadStart();b.postMessage((new Date).getTime())};
-THREE.JSONLoader.prototype.createModel=function(b,c,e){var f=new THREE.Geometry,h=b.scale!==void 0?1/b.scale:1;this.init_materials(f,b.materials,e);(function(c){if(b.version===void 0||b.version!=2)console.error("Deprecated file format.");else{var e,h,u,p,w,t,x,v,z,y,B,C,E,F,G=b.faces;t=b.vertices;var M=b.normals,P=b.colors,L=0;for(e=0;e<b.uvs.length;e++)b.uvs[e].length&&L++;for(e=0;e<L;e++)f.faceUvs[e]=[],f.faceVertexUvs[e]=[];p=0;for(w=t.length;p<w;)x=new THREE.Vertex,x.position.x=t[p++]*c,x.position.y=
-t[p++]*c,x.position.z=t[p++]*c,f.vertices.push(x);p=0;for(w=G.length;p<w;){c=G[p++];t=c&1;u=c&2;e=c&4;h=c&8;v=c&16;x=c&32;y=c&64;c&=128;t?(B=new THREE.Face4,B.a=G[p++],B.b=G[p++],B.c=G[p++],B.d=G[p++],t=4):(B=new THREE.Face3,B.a=G[p++],B.b=G[p++],B.c=G[p++],t=3);if(u)u=G[p++],B.materials=f.materials[u];u=f.faces.length;if(e)for(e=0;e<L;e++)C=b.uvs[e],z=G[p++],F=C[z*2],z=C[z*2+1],f.faceUvs[e][u]=new THREE.UV(F,z);if(h)for(e=0;e<L;e++){C=b.uvs[e];E=[];for(h=0;h<t;h++)z=G[p++],F=C[z*2],z=C[z*2+1],E[h]=
-new THREE.UV(F,z);f.faceVertexUvs[e][u]=E}if(v)v=G[p++]*3,h=new THREE.Vector3,h.x=M[v++],h.y=M[v++],h.z=M[v],B.normal=h;if(x)for(e=0;e<t;e++)v=G[p++]*3,h=new THREE.Vector3,h.x=M[v++],h.y=M[v++],h.z=M[v],B.vertexNormals.push(h);if(y)x=G[p++],x=new THREE.Color(P[x]),B.color=x;if(c)for(e=0;e<t;e++)x=G[p++],x=new THREE.Color(P[x]),B.vertexColors.push(x);f.faces.push(B)}}})(h);(function(){var c,e,h,u;if(b.skinWeights){c=0;for(e=b.skinWeights.length;c<e;c+=2)h=b.skinWeights[c],u=b.skinWeights[c+1],f.skinWeights.push(new THREE.Vector4(h,
-u,0,0))}if(b.skinIndices){c=0;for(e=b.skinIndices.length;c<e;c+=2)h=b.skinIndices[c],u=b.skinIndices[c+1],f.skinIndices.push(new THREE.Vector4(h,u,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var e,h,u,p,w,t,x,v,z;e=0;for(h=b.morphTargets.length;e<h;e++){f.morphTargets[e]={};f.morphTargets[e].name=b.morphTargets[e].name;f.morphTargets[e].vertices=[];v=f.morphTargets[e].vertices;z=b.morphTargets[e].vertices;u=0;for(p=z.length;u<p;u+=3)w=z[u]*c,t=z[u+1]*
-c,x=z[u+2]*c,v.push(new THREE.Vertex(new THREE.Vector3(w,t,x)))}}if(b.morphColors!==void 0){e=0;for(h=b.morphColors.length;e<h;e++){f.morphColors[e]={};f.morphColors[e].name=b.morphColors[e].name;f.morphColors[e].colors=[];p=f.morphColors[e].colors;w=b.morphColors[e].colors;c=0;for(u=w.length;c<u;c+=3)t=new THREE.Color(16755200),t.setRGB(w[c],w[c+1],w[c+2]),p.push(t)}}})(h);(function(){if(b.edges!==void 0){var c,e,h;for(c=0;c<b.edges.length;c+=2)e=b.edges[c],h=b.edges[c+1],f.edges.push(new THREE.Edge(f.vertices[e],
-f.vertices[h],e,h))}})();f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
-THREE.SceneLoader.prototype={load:function(b,c){var e=this,f=new Worker(b);f.postMessage(0);var h=THREE.Loader.prototype.extractUrlbase(b);f.onmessage=function(b){function f(b,c){return c=="relativeToHTML"?b:h+"/"+b}function n(){for(v in O.objects)if(!T.objects[v])if(E=O.objects[v],E.geometry!==void 0){if(P=T.geometries[E.geometry]){var b=!1;Z=[];for(aa=0;aa<E.materials.length;aa++)Z[aa]=T.materials[E.materials[aa]],b=Z[aa]instanceof THREE.ShaderMaterial;b&&P.computeTangents();F=E.position;r=E.rotation;
+document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);e+="?rnd="+Math.random();var n=new XMLHttpRequest;n.overrideMimeType&&n.overrideMimeType("text/xml");n.onreadystatechange=function(){if(n.readyState==4&&(n.status==0||n.status==200)){ga=f;var o,p=e;da=n.responseXML;o=ga;p!==void 0&&(p=p.split("/"),p.pop(),Ea=p.join("/")+"/");ua=b("//dae:library_images/dae:image",h,"image");ra=b("//dae:library_materials/dae:material",
+L,"material");wa=b("//dae:library_effects/dae:effect",O,"effect");ma=b("//dae:library_geometries/dae:geometry",y,"geometry");N=b("//dae:library_controllers/dae:controller",k,"controller");la=b("//dae:library_animations/dae:animation",V,"animation");Da=b(".//dae:library_visual_scenes/dae:visual_scene",u,"visual_scene");Aa=[];Ca=[];(p=da.evaluate(".//dae:scene/dae:instance_visual_scene",da,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(p=p.getAttribute("url").replace(/^#/,""),$=Da[p]):
+$=null;U=new THREE.Object3D;for(p=0;p<$.nodes.length;p++)U.add(m($.nodes[p]));c();for(var t in la);t={scene:U,morphs:Aa,skins:Ca,dae:{images:ua,materials:ra,effects:wa,geometries:ma,controllers:N,animations:la,visualScenes:Da,scene:$}};o&&o(t)}};n.open("GET",e,!0);n.send(null)}else alert("Don't know how to parse XML!")},setPreferredShading:function(b){Ga=b},applySkin:f,geometries:ma}};THREE.JSONLoader=function(b){THREE.Loader.call(this,b)};THREE.JSONLoader.prototype=new THREE.Loader;
+THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(b){var c=this,e=b.model,f=b.callback,m=b.texture_path?b.texture_path:this.extractUrlbase(e),b=new Worker(e);b.onmessage=function(b){c.createModel(b.data,f,m);c.onLoadComplete()};this.onLoadStart();b.postMessage((new Date).getTime())};
+THREE.JSONLoader.prototype.createModel=function(b,c,e){var f=new THREE.Geometry,m=b.scale!==void 0?1/b.scale:1;this.init_materials(f,b.materials,e);(function(c){if(b.version===void 0||b.version!=2)console.error("Deprecated file format.");else{var e,m,p,u,w,t,x,v,z,y,B,C,E,F,G=b.faces;t=b.vertices;var M=b.normals,P=b.colors,L=0;for(e=0;e<b.uvs.length;e++)b.uvs[e].length&&L++;for(e=0;e<L;e++)f.faceUvs[e]=[],f.faceVertexUvs[e]=[];u=0;for(w=t.length;u<w;)x=new THREE.Vertex,x.position.x=t[u++]*c,x.position.y=
+t[u++]*c,x.position.z=t[u++]*c,f.vertices.push(x);u=0;for(w=G.length;u<w;){c=G[u++];t=c&1;p=c&2;e=c&4;m=c&8;v=c&16;x=c&32;y=c&64;c&=128;t?(B=new THREE.Face4,B.a=G[u++],B.b=G[u++],B.c=G[u++],B.d=G[u++],t=4):(B=new THREE.Face3,B.a=G[u++],B.b=G[u++],B.c=G[u++],t=3);if(p)p=G[u++],B.materials=f.materials[p];p=f.faces.length;if(e)for(e=0;e<L;e++)C=b.uvs[e],z=G[u++],F=C[z*2],z=C[z*2+1],f.faceUvs[e][p]=new THREE.UV(F,z);if(m)for(e=0;e<L;e++){C=b.uvs[e];E=[];for(m=0;m<t;m++)z=G[u++],F=C[z*2],z=C[z*2+1],E[m]=
+new THREE.UV(F,z);f.faceVertexUvs[e][p]=E}if(v)v=G[u++]*3,m=new THREE.Vector3,m.x=M[v++],m.y=M[v++],m.z=M[v],B.normal=m;if(x)for(e=0;e<t;e++)v=G[u++]*3,m=new THREE.Vector3,m.x=M[v++],m.y=M[v++],m.z=M[v],B.vertexNormals.push(m);if(y)x=G[u++],x=new THREE.Color(P[x]),B.color=x;if(c)for(e=0;e<t;e++)x=G[u++],x=new THREE.Color(P[x]),B.vertexColors.push(x);f.faces.push(B)}}})(m);(function(){var c,e,m,p;if(b.skinWeights){c=0;for(e=b.skinWeights.length;c<e;c+=2)m=b.skinWeights[c],p=b.skinWeights[c+1],f.skinWeights.push(new THREE.Vector4(m,
+p,0,0))}if(b.skinIndices){c=0;for(e=b.skinIndices.length;c<e;c+=2)m=b.skinIndices[c],p=b.skinIndices[c+1],f.skinIndices.push(new THREE.Vector4(m,p,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var e,m,p,u,w,t,x,v,z;e=0;for(m=b.morphTargets.length;e<m;e++){f.morphTargets[e]={};f.morphTargets[e].name=b.morphTargets[e].name;f.morphTargets[e].vertices=[];v=f.morphTargets[e].vertices;z=b.morphTargets[e].vertices;p=0;for(u=z.length;p<u;p+=3)w=z[p]*c,t=z[p+1]*
+c,x=z[p+2]*c,v.push(new THREE.Vertex(new THREE.Vector3(w,t,x)))}}if(b.morphColors!==void 0){e=0;for(m=b.morphColors.length;e<m;e++){f.morphColors[e]={};f.morphColors[e].name=b.morphColors[e].name;f.morphColors[e].colors=[];u=f.morphColors[e].colors;w=b.morphColors[e].colors;c=0;for(p=w.length;c<p;c+=3)t=new THREE.Color(16755200),t.setRGB(w[c],w[c+1],w[c+2]),u.push(t)}}})(m);(function(){if(b.edges!==void 0){var c,e,m;for(c=0;c<b.edges.length;c+=2)e=b.edges[c],m=b.edges[c+1],f.edges.push(new THREE.Edge(f.vertices[e],
+f.vertices[m],e,m))}})();f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
+THREE.SceneLoader.prototype={load:function(b,c){var e=this,f=new Worker(b);f.postMessage(0);var m=THREE.Loader.prototype.extractUrlbase(b);f.onmessage=function(b){function f(b,c){return c=="relativeToHTML"?b:m+"/"+b}function n(){for(v in O.objects)if(!T.objects[v])if(E=O.objects[v],E.geometry!==void 0){if(P=T.geometries[E.geometry]){var b=!1;Z=[];for(aa=0;aa<E.materials.length;aa++)Z[aa]=T.materials[E.materials[aa]],b=Z[aa]instanceof THREE.ShaderMaterial;b&&P.computeTangents();F=E.position;r=E.rotation;
 q=E.quaternion;s=E.scale;q=0;Z.length==0&&(Z[0]=new THREE.MeshFaceMaterial);Z.length>1&&(Z=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(P,Z);object.name=v;object.position.set(F[0],F[1],F[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=E.visible;T.scene.add(object);T.objects[v]=object;E.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),T.scene.collisions.colliders.push(b));
 if(E.castsShadow)b=new THREE.ShadowVolume(P),T.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},T.triggers[object.name]=b)}}else F=E.position,r=E.rotation,q=E.quaternion,s=E.scale,q=0,object=new THREE.Object3D,object.name=v,object.position.set(F[0],F[1],F[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],
-s[1],s[2]),object.visible=E.visible!==void 0?E.visible:!1,T.scene.add(object),T.objects[v]=object,T.empties[v]=object,E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},T.triggers[object.name]=b)}function u(b){return function(c){T.geometries[b]=c;n();V-=1;e.onLoadComplete();w()}}function p(b){return function(c){T.geometries[b]=c}}function w(){e.callbackProgress({totalModels:o,totalTextures:ea,loadedModels:o-V,loadedTextures:ea-W},T);e.onLoadProgress();V==0&&W==0&&c(T)}var t,
+s[1],s[2]),object.visible=E.visible!==void 0?E.visible:!1,T.scene.add(object),T.objects[v]=object,T.empties[v]=object,E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},T.triggers[object.name]=b)}function p(b){return function(c){T.geometries[b]=c;n();V-=1;e.onLoadComplete();w()}}function u(b){return function(c){T.geometries[b]=c}}function w(){e.callbackProgress({totalModels:o,totalTextures:ea,loadedModels:o-V,loadedTextures:ea-W},T);e.onLoadProgress();V==0&&W==0&&c(T)}var t,
 x,v,z,y,B,C,E,F,G,M,P,L,A,J,Z,I,O,X,V,W,o,ea,T;O=b.data;J=new THREE.BinaryLoader;X=new THREE.JSONLoader;W=V=0;T={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in O.objects)if(E=O.objects[v],E.meshCollider){b=!0;break}if(b)T.scene.collisions=new THREE.CollisionSystem;if(O.transform){b=O.transform.position;G=O.transform.rotation;var na=O.transform.scale;b&&T.scene.position.set(b[0],b[1],b[2]);G&&T.scene.rotation.set(G[0],
 G[1],G[2]);na&&T.scene.scale.set(na[0],na[1],na[2]);(b||G||na)&&T.scene.updateMatrix()}b=function(){W-=1;w();e.onLoadComplete()};for(y in O.cameras){G=O.cameras[y];if(G.type=="perspective")L=new THREE.Camera(G.fov,G.aspect,G.near,G.far);else if(G.type=="ortho")L=new THREE.Camera,L.projectionMatrix=THREE.Matrix4.makeOrtho(G.left,G.right,G.top,G.bottom,G.near,G.far);F=G.position;G=G.target;L.position.set(F[0],F[1],F[2]);L.target.position.set(G[0],G[1],G[2]);T.cameras[y]=L}for(z in O.lights)y=O.lights[z],
 L=y.color!==void 0?y.color:16777215,G=y.intensity!==void 0?y.intensity:1,y.type=="directional"?(F=y.direction,I=new THREE.DirectionalLight(L,G),I.position.set(F[0],F[1],F[2]),I.position.normalize()):y.type=="point"?(F=y.position,d=y.distance,I=new THREE.PointLight(L,G,d),I.position.set(F[0],F[1],F[2])):y.type=="ambient"&&(I=new THREE.AmbientLight(L)),T.scene.add(I),T.lights[z]=I;for(B in O.fogs)z=O.fogs[B],z.type=="linear"?A=new THREE.Fog(0,z.near,z.far):z.type=="exp2"&&(A=new THREE.FogExp2(0,z.density)),
 G=z.color,A.color.setRGB(G[0],G[1],G[2]),T.fogs[B]=A;if(T.cameras&&O.defaults.camera)T.currentCamera=T.cameras[O.defaults.camera];if(T.fogs&&O.defaults.fog)T.scene.fog=T.fogs[O.defaults.fog];G=O.defaults.bgcolor;T.bgColor=new THREE.Color;T.bgColor.setRGB(G[0],G[1],G[2]);T.bgColorAlpha=O.defaults.bgalpha;for(t in O.geometries)if(B=O.geometries[t],B.type=="bin_mesh"||B.type=="ascii_mesh")V+=1,e.onLoadStart();o=V;for(t in O.geometries)B=O.geometries[t],B.type=="cube"?(P=new THREE.CubeGeometry(B.width,
 B.height,B.depth,B.segmentsWidth,B.segmentsHeight,B.segmentsDepth,null,B.flipped,B.sides),T.geometries[t]=P):B.type=="plane"?(P=new THREE.PlaneGeometry(B.width,B.height,B.segmentsWidth,B.segmentsHeight),T.geometries[t]=P):B.type=="sphere"?(P=new THREE.SphereGeometry(B.radius,B.segmentsWidth,B.segmentsHeight),T.geometries[t]=P):B.type=="cylinder"?(P=new THREE.CylinderGeometry(B.topRad,B.botRad,B.height,B.radSegs,B.heightSegs),T.geometries[t]=P):B.type=="torus"?(P=new THREE.TorusGeometry(B.radius,B.tube,
-B.segmentsR,B.segmentsT),T.geometries[t]=P):B.type=="icosahedron"?(P=new THREE.IcosahedronGeometry(B.subdivisions),T.geometries[t]=P):B.type=="bin_mesh"?J.load({model:f(B.url,O.urlBaseType),callback:u(t)}):B.type=="ascii_mesh"?X.load({model:f(B.url,O.urlBaseType),callback:u(t)}):B.type=="embedded_mesh"&&(B=O.embeds[B.id])&&X.createModel(B,p(t),"");for(C in O.textures)if(t=O.textures[C],t.url instanceof Array){W+=t.url.length;for(J=0;J<t.url.length;J++)e.onLoadStart()}else W+=1,e.onLoadStart();ea=
+B.segmentsR,B.segmentsT),T.geometries[t]=P):B.type=="icosahedron"?(P=new THREE.IcosahedronGeometry(B.subdivisions),T.geometries[t]=P):B.type=="bin_mesh"?J.load({model:f(B.url,O.urlBaseType),callback:p(t)}):B.type=="ascii_mesh"?X.load({model:f(B.url,O.urlBaseType),callback:p(t)}):B.type=="embedded_mesh"&&(B=O.embeds[B.id])&&X.createModel(B,u(t),"");for(C in O.textures)if(t=O.textures[C],t.url instanceof Array){W+=t.url.length;for(J=0;J<t.url.length;J++)e.onLoadStart()}else W+=1,e.onLoadStart();ea=
 W;for(C in O.textures){t=O.textures[C];if(t.mapping!=void 0&&THREE[t.mapping]!=void 0)t.mapping=new THREE[t.mapping];if(t.url instanceof Array){J=[];for(var aa=0;aa<t.url.length;aa++)J[aa]=f(t.url[aa],O.urlBaseType);J=THREE.ImageUtils.loadTextureCube(J,t.mapping,b)}else{J=THREE.ImageUtils.loadTexture(f(t.url,O.urlBaseType),t.mapping,b);if(THREE[t.minFilter]!=void 0)J.minFilter=THREE[t.minFilter];if(THREE[t.magFilter]!=void 0)J.magFilter=THREE[t.magFilter];if(t.repeat){J.repeat.set(t.repeat[0],t.repeat[1]);
 if(t.repeat[0]!=1)J.wrapS=THREE.RepeatWrapping;if(t.repeat[1]!=1)J.wrapT=THREE.RepeatWrapping}t.offset&&J.offset.set(t.offset[0],t.offset[1]);if(t.wrap){X={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(X[t.wrap[0]]!==void 0)J.wrapS=X[t.wrap[0]];if(X[t.wrap[1]]!==void 0)J.wrapT=X[t.wrap[1]]}}T.textures[C]=J}for(x in O.materials){C=O.materials[x];for(M in C.parameters)if(M=="envMap"||M=="map"||M=="lightMap")C.parameters[M]=T.textures[C.parameters[M]];else if(M=="shading")C.parameters[M]=
 C.parameters[M]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(M=="blending")C.parameters[M]=THREE[C.parameters[M]]?THREE[C.parameters[M]]:THREE.NormalBlending;else if(M=="combine")C.parameters[M]=C.parameters[M]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(M=="vertexColors")if(C.parameters[M]=="face")C.parameters[M]=THREE.FaceColors;else if(C.parameters[M])C.parameters[M]=THREE.VertexColors;if(C.parameters.opacity!==void 0&&C.parameters.opacity<1)C.parameters.transparent=
 !0;if(C.parameters.normalMap){t=THREE.ShaderUtils.lib.normal;b=THREE.UniformsUtils.clone(t.uniforms);J=C.parameters.color;X=C.parameters.specular;B=C.parameters.ambient;A=C.parameters.shininess;b.tNormal.texture=T.textures[C.parameters.normalMap];if(C.parameters.normalMapFactor)b.uNormalScale.value=C.parameters.normalMapFactor;if(C.parameters.map)b.tDiffuse.texture=C.parameters.map,b.enableDiffuse.value=!0;if(C.parameters.lightMap)b.tAO.texture=C.parameters.lightMap,b.enableAO.value=!0;if(C.parameters.specularMap)b.tSpecular.texture=
 T.textures[C.parameters.specularMap],b.enableSpecular.value=!0;b.uDiffuseColor.value.setHex(J);b.uSpecularColor.value.setHex(X);b.uAmbientColor.value.setHex(B);b.uShininess.value=A;if(C.parameters.opacity)b.uOpacity.value=C.parameters.opacity;C=new THREE.ShaderMaterial({fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:b,lights:!0,fog:!0})}else C=new THREE[C.type](C.parameters);T.materials[x]=C}n();e.callbackSync(T)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};
 THREE.UTF8Loader.prototype=new THREE.UTF8Loader;THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
-THREE.UTF8Loader.prototype.load=function(b){var c=new XMLHttpRequest,e=b.model,f=b.callback,h=b.scale!==void 0?b.scale:1,k=b.offsetX!==void 0?b.offsetX:0,m=b.offsetY!==void 0?b.offsetY:0,n=b.offsetZ!==void 0?b.offsetZ:0;c.onreadystatechange=function(){c.readyState==4?c.status==200||c.status==0?THREE.UTF8Loader.prototype.createModel(c.responseText,f,h,k,m,n):alert("Couldn't load ["+e+"] ["+c.status+"]"):c.readyState!=3&&c.readyState==2&&c.getResponseHeader("Content-Length")};c.open("GET",e,!0);c.send(null)};
-THREE.UTF8Loader.prototype.decompressMesh=function(b){var c=b.charCodeAt(0);c>=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,h=0;h<8;h++){for(var k=0,m=0;m<c;++m){var n=b.charCodeAt(m+f);k+=n>>1^-(n&1);e[8*m+h]=k}f+=c}c=b.length-f;k=new Uint16Array(c);for(h=m=0;h<c;h++)n=b.charCodeAt(h+f),k[h]=m-n,n==0&&m++;return[e,k]};
-THREE.UTF8Loader.prototype.createModel=function(b,c,e,f,h,k){var m=function(){var c=this;c.materials=[];THREE.Geometry.call(this);var m=THREE.UTF8Loader.prototype.decompressMesh(b),p=[],w=[];(function(b,m,p){for(var u,w,B,C=b.length;p<C;p+=m)u=b[p],w=b[p+1],B=b[p+2],u=u/16383*e,w=w/16383*e,B=B/16383*e,u+=f,w+=h,B+=k,c.vertices.push(new THREE.Vertex(new THREE.Vector3(u,w,B)))})(m[0],8,0);(function(b,c,e){for(var f,h,k=b.length;e<k;e+=c)f=b[e],h=b[e+1],f/=1023,h/=1023,w.push(f,1-h)})(m[0],8,3);(function(b,
-c,e){for(var f,h,k,m=b.length;e<m;e+=c)f=b[e],h=b[e+1],k=b[e+2],f=(f-512)/511,h=(h-512)/511,k=(k-512)/511,p.push(f,h,k)})(m[0],8,5);(function(b){var e,f,h,k,m,u,E,F,G,M=b.length;for(e=0;e<M;e+=3){f=b[e];h=b[e+1];k=b[e+2];m=c;F=f;G=h;u=k;E=f;var P=h,L=k,A=m.materials[0],J=p[P*3],Z=p[P*3+1],P=p[P*3+2],I=p[L*3],O=p[L*3+1],L=p[L*3+2];E=new THREE.Vector3(p[E*3],p[E*3+1],p[E*3+2]);P=new THREE.Vector3(J,Z,P);L=new THREE.Vector3(I,O,L);m.faces.push(new THREE.Face3(F,G,u,[E,P,L],null,A));m=w[f*2];f=w[f*2+
-1];u=w[h*2];E=w[h*2+1];F=w[k*2];G=w[k*2+1];k=c.faceVertexUvs[0];h=u;u=E;E=[];E.push(new THREE.UV(m,f));E.push(new THREE.UV(h,u));E.push(new THREE.UV(F,G));k.push(E)}})(m[1]);this.computeCentroids();this.computeFaceNormals()};m.prototype=new THREE.Geometry;m.prototype.constructor=m;c(new m)};
+THREE.UTF8Loader.prototype.load=function(b){var c=new XMLHttpRequest,e=b.model,f=b.callback,m=b.scale!==void 0?b.scale:1,h=b.offsetX!==void 0?b.offsetX:0,k=b.offsetY!==void 0?b.offsetY:0,n=b.offsetZ!==void 0?b.offsetZ:0;c.onreadystatechange=function(){c.readyState==4?c.status==200||c.status==0?THREE.UTF8Loader.prototype.createModel(c.responseText,f,m,h,k,n):alert("Couldn't load ["+e+"] ["+c.status+"]"):c.readyState!=3&&c.readyState==2&&c.getResponseHeader("Content-Length")};c.open("GET",e,!0);c.send(null)};
+THREE.UTF8Loader.prototype.decompressMesh=function(b){var c=b.charCodeAt(0);c>=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,m=0;m<8;m++){for(var h=0,k=0;k<c;++k){var n=b.charCodeAt(k+f);h+=n>>1^-(n&1);e[8*k+m]=h}f+=c}c=b.length-f;h=new Uint16Array(c);for(m=k=0;m<c;m++)n=b.charCodeAt(m+f),h[m]=k-n,n==0&&k++;return[e,h]};
+THREE.UTF8Loader.prototype.createModel=function(b,c,e,f,m,h){var k=function(){var c=this;c.materials=[];THREE.Geometry.call(this);var k=THREE.UTF8Loader.prototype.decompressMesh(b),u=[],w=[];(function(b,k,p){for(var u,w,B,C=b.length;p<C;p+=k)u=b[p],w=b[p+1],B=b[p+2],u=u/16383*e,w=w/16383*e,B=B/16383*e,u+=f,w+=m,B+=h,c.vertices.push(new THREE.Vertex(new THREE.Vector3(u,w,B)))})(k[0],8,0);(function(b,c,e){for(var f,h,k=b.length;e<k;e+=c)f=b[e],h=b[e+1],f/=1023,h/=1023,w.push(f,1-h)})(k[0],8,3);(function(b,
+c,e){for(var f,h,k,m=b.length;e<m;e+=c)f=b[e],h=b[e+1],k=b[e+2],f=(f-512)/511,h=(h-512)/511,k=(k-512)/511,u.push(f,h,k)})(k[0],8,5);(function(b){var e,f,h,k,m,p,E,F,G,M=b.length;for(e=0;e<M;e+=3){f=b[e];h=b[e+1];k=b[e+2];m=c;F=f;G=h;p=k;E=f;var P=h,L=k,A=m.materials[0],J=u[P*3],Z=u[P*3+1],P=u[P*3+2],I=u[L*3],O=u[L*3+1],L=u[L*3+2];E=new THREE.Vector3(u[E*3],u[E*3+1],u[E*3+2]);P=new THREE.Vector3(J,Z,P);L=new THREE.Vector3(I,O,L);m.faces.push(new THREE.Face3(F,G,p,[E,P,L],null,A));m=w[f*2];f=w[f*2+
+1];p=w[h*2];E=w[h*2+1];F=w[k*2];G=w[k*2+1];k=c.faceVertexUvs[0];h=p;p=E;E=[];E.push(new THREE.UV(m,f));E.push(new THREE.UV(h,p));E.push(new THREE.UV(F,G));k.push(E)}})(k[1]);this.computeCentroids();this.computeFaceNormals()};k.prototype=new THREE.Geometry;k.prototype.constructor=k;c(new k)};
 THREE.MarchingCubes=function(b,c){THREE.Object3D.call(this);this.materials=c instanceof Array?c:[c];this.init=function(b){this.isolation=80;this.size=b;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(this.size3*3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=
-0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,c,h){return b+(c-b)*h};this.VIntX=function(b,c,h,k,m,n,u,p,w,t){m=(m-w)/(t-w);w=this.normal_cache;c[k]=n+m*this.delta;c[k+1]=u;c[k+2]=p;h[k]=this.lerp(w[b],w[b+3],m);h[k+1]=this.lerp(w[b+1],w[b+4],m);h[k+2]=this.lerp(w[b+2],w[b+5],m)};this.VIntY=function(b,c,h,k,m,n,u,p,w,t){m=(m-w)/(t-w);w=this.normal_cache;c[k]=n;c[k+1]=u+m*this.delta;c[k+
-2]=p;c=b+this.yd*3;h[k]=this.lerp(w[b],w[c],m);h[k+1]=this.lerp(w[b+1],w[c+1],m);h[k+2]=this.lerp(w[b+2],w[c+2],m)};this.VIntZ=function(b,c,h,k,m,n,u,p,w,t){m=(m-w)/(t-w);w=this.normal_cache;c[k]=n;c[k+1]=u;c[k+2]=p+m*this.delta;c=b+this.zd*3;h[k]=this.lerp(w[b],w[c],m);h[k+1]=this.lerp(w[b+1],w[c+1],m);h[k+2]=this.lerp(w[b+2],w[c+2],m)};this.compNorm=function(b){var c=b*3;this.normal_cache[c]==0&&(this.normal_cache[c]=this.field[b-1]-this.field[b+1],this.normal_cache[c+1]=this.field[b-this.yd]-this.field[b+
-this.yd],this.normal_cache[c+2]=this.field[b-this.zd]-this.field[b+this.zd])};this.polygonize=function(b,c,h,k,m,n){var u=k+1,p=k+this.yd,w=k+this.zd,t=u+this.yd,x=u+this.zd,v=k+this.yd+this.zd,z=u+this.yd+this.zd,y=0,B=this.field[k],C=this.field[u],E=this.field[p],F=this.field[t],G=this.field[w],M=this.field[x],P=this.field[v],L=this.field[z];B<m&&(y|=1);C<m&&(y|=2);E<m&&(y|=8);F<m&&(y|=4);G<m&&(y|=16);M<m&&(y|=32);P<m&&(y|=128);L<m&&(y|=64);var A=THREE.edgeTable[y];if(A==0)return 0;var J=this.delta,
-Z=b+J,I=c+J,J=h+J;A&1&&(this.compNorm(k),this.compNorm(u),this.VIntX(k*3,this.vlist,this.nlist,0,m,b,c,h,B,C));A&2&&(this.compNorm(u),this.compNorm(t),this.VIntY(u*3,this.vlist,this.nlist,3,m,Z,c,h,C,F));A&4&&(this.compNorm(p),this.compNorm(t),this.VIntX(p*3,this.vlist,this.nlist,6,m,b,I,h,E,F));A&8&&(this.compNorm(k),this.compNorm(p),this.VIntY(k*3,this.vlist,this.nlist,9,m,b,c,h,B,E));A&16&&(this.compNorm(w),this.compNorm(x),this.VIntX(w*3,this.vlist,this.nlist,12,m,b,c,J,G,M));A&32&&(this.compNorm(x),
-this.compNorm(z),this.VIntY(x*3,this.vlist,this.nlist,15,m,Z,c,J,M,L));A&64&&(this.compNorm(v),this.compNorm(z),this.VIntX(v*3,this.vlist,this.nlist,18,m,b,I,J,P,L));A&128&&(this.compNorm(w),this.compNorm(v),this.VIntY(w*3,this.vlist,this.nlist,21,m,b,c,J,G,P));A&256&&(this.compNorm(k),this.compNorm(w),this.VIntZ(k*3,this.vlist,this.nlist,24,m,b,c,h,B,G));A&512&&(this.compNorm(u),this.compNorm(x),this.VIntZ(u*3,this.vlist,this.nlist,27,m,Z,c,h,C,M));A&1024&&(this.compNorm(t),this.compNorm(z),this.VIntZ(t*
-3,this.vlist,this.nlist,30,m,Z,I,h,F,L));A&2048&&(this.compNorm(p),this.compNorm(v),this.VIntZ(p*3,this.vlist,this.nlist,33,m,b,I,h,E,P));y<<=4;for(m=k=0;THREE.triTable[y+m]!=-1;)b=y+m,c=b+1,h=b+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[c],3*THREE.triTable[h],n),m+=3,k++;return k};this.posnormtriv=function(b,c,h,k,m,n){var u=this.count*3;this.positionArray[u]=b[h];this.positionArray[u+1]=b[h+1];this.positionArray[u+2]=b[h+2];this.positionArray[u+3]=b[k];this.positionArray[u+
-4]=b[k+1];this.positionArray[u+5]=b[k+2];this.positionArray[u+6]=b[m];this.positionArray[u+7]=b[m+1];this.positionArray[u+8]=b[m+2];this.normalArray[u]=c[h];this.normalArray[u+1]=c[h+1];this.normalArray[u+2]=c[h+2];this.normalArray[u+3]=c[k];this.normalArray[u+4]=c[k+1];this.normalArray[u+5]=c[k+2];this.normalArray[u+6]=c[m];this.normalArray[u+7]=c[m+1];this.normalArray[u+8]=c[m+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&n(this)};this.begin=function(){this.count=0;
-this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;c<this.positionArray.length;c++)this.positionArray[c]=0;b(this)}};this.addBall=function(b,c,h,k,m){var n=this.size*Math.sqrt(k/m),u=h*this.size,p=c*this.size,w=b*this.size,t=Math.floor(u-n);t<1&&(t=1);u=Math.floor(u+n);u>this.size-1&&(u=this.size-1);var x=Math.floor(p-n);x<1&&(x=1);p=Math.floor(p+n);p>this.size-1&&(p=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size-
-1);for(var z,y,B,C,E,F;t<u;t++){w=this.size2*t;y=t/this.size-h;E=y*y;for(y=x;y<p;y++){B=w+this.size*y;z=y/this.size-c;F=z*z;for(z=v;z<n;z++)C=z/this.size-b,C=k/(1.0E-6+C*C+F+E)-m,C>0&&(this.field[B+z]+=C)}}};this.addPlaneX=function(b,c){var h,k,m,n,u,p=this.size,w=this.yd,t=this.zd,x=this.field,v=p*Math.sqrt(b/c);v>p&&(v=p);for(h=0;h<v;h++)if(k=h/p,k*=k,n=b/(1.0E-4+k)-c,n>0)for(k=0;k<p;k++){u=h+k*w;for(m=0;m<p;m++)x[t*m+u]+=n}};this.addPlaneY=function(b,c){var h,k,m,n,u,p,w=this.size,t=this.yd,x=
-this.zd,v=this.field,z=w*Math.sqrt(b/c);z>w&&(z=w);for(k=0;k<z;k++)if(h=k/w,h*=h,n=b/(1.0E-4+h)-c,n>0){u=k*t;for(h=0;h<w;h++){p=u+h;for(m=0;m<w;m++)v[x*m+p]+=n}}};this.addPlaneZ=function(b,c){var h,k,m,n,u,p;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/c);dist>size&&(dist=size);for(m=0;m<dist;m++)if(h=m/size,h*=h,n=b/(1.0E-4+h)-c,n>0){u=zd*m;for(k=0;k<size;k++){p=u+k*yd;for(h=0;h<size;h++)field[p+h]+=n}}};this.reset=function(){var b;for(b=0;b<this.size3;b++)this.normal_cache[b*
-3]=0,this.field[b]=0};this.render=function(b){this.begin();var c,h,k,m,n,u,p,w,t,x=this.size-2;for(m=1;m<x;m++){t=this.size2*m;p=(m-this.halfsize)/this.halfsize;for(k=1;k<x;k++){w=t+this.size*k;u=(k-this.halfsize)/this.halfsize;for(h=1;h<x;h++)n=(h-this.halfsize)/this.halfsize,c=w+h,this.polygonize(n,u,p,c,this.isolation,b)}}this.end(b)};this.generateGeometry=function(){var b=0,c=new THREE.Geometry,h=[];this.render(function(k){var m,n,u,p,w,t,x,v;for(m=0;m<k.count;m++)x=m*3,w=x+1,v=x+2,n=k.positionArray[x],
-u=k.positionArray[w],p=k.positionArray[v],t=new THREE.Vector3(n,u,p),n=k.normalArray[x],u=k.normalArray[w],p=k.normalArray[v],x=new THREE.Vector3(n,u,p),x.normalize(),w=new THREE.Vertex(t),c.vertices.push(w),h.push(x);nfaces=k.count/3;for(m=0;m<nfaces;m++)x=(b+m)*3,w=x+1,v=x+2,t=h[x],n=h[w],u=h[v],x=new THREE.Face3(x,w,v,[t,n,u]),c.faces.push(x);b+=nfaces;k.count=0});return c};this.init(b)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
+0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,c,m){return b+(c-b)*m};this.VIntX=function(b,c,m,h,k,n,p,u,w,t){k=(k-w)/(t-w);w=this.normal_cache;c[h]=n+k*this.delta;c[h+1]=p;c[h+2]=u;m[h]=this.lerp(w[b],w[b+3],k);m[h+1]=this.lerp(w[b+1],w[b+4],k);m[h+2]=this.lerp(w[b+2],w[b+5],k)};this.VIntY=function(b,c,m,h,k,n,p,u,w,t){k=(k-w)/(t-w);w=this.normal_cache;c[h]=n;c[h+1]=p+k*this.delta;c[h+
+2]=u;c=b+this.yd*3;m[h]=this.lerp(w[b],w[c],k);m[h+1]=this.lerp(w[b+1],w[c+1],k);m[h+2]=this.lerp(w[b+2],w[c+2],k)};this.VIntZ=function(b,c,m,h,k,n,p,u,w,t){k=(k-w)/(t-w);w=this.normal_cache;c[h]=n;c[h+1]=p;c[h+2]=u+k*this.delta;c=b+this.zd*3;m[h]=this.lerp(w[b],w[c],k);m[h+1]=this.lerp(w[b+1],w[c+1],k);m[h+2]=this.lerp(w[b+2],w[c+2],k)};this.compNorm=function(b){var c=b*3;this.normal_cache[c]==0&&(this.normal_cache[c]=this.field[b-1]-this.field[b+1],this.normal_cache[c+1]=this.field[b-this.yd]-this.field[b+
+this.yd],this.normal_cache[c+2]=this.field[b-this.zd]-this.field[b+this.zd])};this.polygonize=function(b,c,m,h,k,n){var p=h+1,u=h+this.yd,w=h+this.zd,t=p+this.yd,x=p+this.zd,v=h+this.yd+this.zd,z=p+this.yd+this.zd,y=0,B=this.field[h],C=this.field[p],E=this.field[u],F=this.field[t],G=this.field[w],M=this.field[x],P=this.field[v],L=this.field[z];B<k&&(y|=1);C<k&&(y|=2);E<k&&(y|=8);F<k&&(y|=4);G<k&&(y|=16);M<k&&(y|=32);P<k&&(y|=128);L<k&&(y|=64);var A=THREE.edgeTable[y];if(A==0)return 0;var J=this.delta,
+Z=b+J,I=c+J,J=m+J;A&1&&(this.compNorm(h),this.compNorm(p),this.VIntX(h*3,this.vlist,this.nlist,0,k,b,c,m,B,C));A&2&&(this.compNorm(p),this.compNorm(t),this.VIntY(p*3,this.vlist,this.nlist,3,k,Z,c,m,C,F));A&4&&(this.compNorm(u),this.compNorm(t),this.VIntX(u*3,this.vlist,this.nlist,6,k,b,I,m,E,F));A&8&&(this.compNorm(h),this.compNorm(u),this.VIntY(h*3,this.vlist,this.nlist,9,k,b,c,m,B,E));A&16&&(this.compNorm(w),this.compNorm(x),this.VIntX(w*3,this.vlist,this.nlist,12,k,b,c,J,G,M));A&32&&(this.compNorm(x),
+this.compNorm(z),this.VIntY(x*3,this.vlist,this.nlist,15,k,Z,c,J,M,L));A&64&&(this.compNorm(v),this.compNorm(z),this.VIntX(v*3,this.vlist,this.nlist,18,k,b,I,J,P,L));A&128&&(this.compNorm(w),this.compNorm(v),this.VIntY(w*3,this.vlist,this.nlist,21,k,b,c,J,G,P));A&256&&(this.compNorm(h),this.compNorm(w),this.VIntZ(h*3,this.vlist,this.nlist,24,k,b,c,m,B,G));A&512&&(this.compNorm(p),this.compNorm(x),this.VIntZ(p*3,this.vlist,this.nlist,27,k,Z,c,m,C,M));A&1024&&(this.compNorm(t),this.compNorm(z),this.VIntZ(t*
+3,this.vlist,this.nlist,30,k,Z,I,m,F,L));A&2048&&(this.compNorm(u),this.compNorm(v),this.VIntZ(u*3,this.vlist,this.nlist,33,k,b,I,m,E,P));y<<=4;for(k=h=0;THREE.triTable[y+k]!=-1;)b=y+k,c=b+1,m=b+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[c],3*THREE.triTable[m],n),k+=3,h++;return h};this.posnormtriv=function(b,c,m,h,k,n){var p=this.count*3;this.positionArray[p]=b[m];this.positionArray[p+1]=b[m+1];this.positionArray[p+2]=b[m+2];this.positionArray[p+3]=b[h];this.positionArray[p+
+4]=b[h+1];this.positionArray[p+5]=b[h+2];this.positionArray[p+6]=b[k];this.positionArray[p+7]=b[k+1];this.positionArray[p+8]=b[k+2];this.normalArray[p]=c[m];this.normalArray[p+1]=c[m+1];this.normalArray[p+2]=c[m+2];this.normalArray[p+3]=c[h];this.normalArray[p+4]=c[h+1];this.normalArray[p+5]=c[h+2];this.normalArray[p+6]=c[k];this.normalArray[p+7]=c[k+1];this.normalArray[p+8]=c[k+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&n(this)};this.begin=function(){this.count=0;
+this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;c<this.positionArray.length;c++)this.positionArray[c]=0;b(this)}};this.addBall=function(b,c,m,h,k){var n=this.size*Math.sqrt(h/k),p=m*this.size,u=c*this.size,w=b*this.size,t=Math.floor(p-n);t<1&&(t=1);p=Math.floor(p+n);p>this.size-1&&(p=this.size-1);var x=Math.floor(u-n);x<1&&(x=1);u=Math.floor(u+n);u>this.size-1&&(u=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size-
+1);for(var z,y,B,C,E,F;t<p;t++){w=this.size2*t;y=t/this.size-m;E=y*y;for(y=x;y<u;y++){B=w+this.size*y;z=y/this.size-c;F=z*z;for(z=v;z<n;z++)C=z/this.size-b,C=h/(1.0E-6+C*C+F+E)-k,C>0&&(this.field[B+z]+=C)}}};this.addPlaneX=function(b,c){var m,h,k,n,p,u=this.size,w=this.yd,t=this.zd,x=this.field,v=u*Math.sqrt(b/c);v>u&&(v=u);for(m=0;m<v;m++)if(h=m/u,h*=h,n=b/(1.0E-4+h)-c,n>0)for(h=0;h<u;h++){p=m+h*w;for(k=0;k<u;k++)x[t*k+p]+=n}};this.addPlaneY=function(b,c){var m,h,k,n,p,u,w=this.size,t=this.yd,x=
+this.zd,v=this.field,z=w*Math.sqrt(b/c);z>w&&(z=w);for(h=0;h<z;h++)if(m=h/w,m*=m,n=b/(1.0E-4+m)-c,n>0){p=h*t;for(m=0;m<w;m++){u=p+m;for(k=0;k<w;k++)v[x*k+u]+=n}}};this.addPlaneZ=function(b,c){var m,h,k,n,p,u;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/c);dist>size&&(dist=size);for(k=0;k<dist;k++)if(m=k/size,m*=m,n=b/(1.0E-4+m)-c,n>0){p=zd*k;for(h=0;h<size;h++){u=p+h*yd;for(m=0;m<size;m++)field[u+m]+=n}}};this.reset=function(){var b;for(b=0;b<this.size3;b++)this.normal_cache[b*
+3]=0,this.field[b]=0};this.render=function(b){this.begin();var c,m,h,k,n,p,u,w,t,x=this.size-2;for(k=1;k<x;k++){t=this.size2*k;u=(k-this.halfsize)/this.halfsize;for(h=1;h<x;h++){w=t+this.size*h;p=(h-this.halfsize)/this.halfsize;for(m=1;m<x;m++)n=(m-this.halfsize)/this.halfsize,c=w+m,this.polygonize(n,p,u,c,this.isolation,b)}}this.end(b)};this.generateGeometry=function(){var b=0,c=new THREE.Geometry,m=[];this.render(function(h){var k,n,p,u,w,t,x,v;for(k=0;k<h.count;k++)x=k*3,w=x+1,v=x+2,n=h.positionArray[x],
+p=h.positionArray[w],u=h.positionArray[v],t=new THREE.Vector3(n,p,u),n=h.normalArray[x],p=h.normalArray[w],u=h.normalArray[v],x=new THREE.Vector3(n,p,u),x.normalize(),w=new THREE.Vertex(t),c.vertices.push(w),m.push(x);nfaces=h.count/3;for(k=0;k<nfaces;k++)x=(b+k)*3,w=x+1,v=x+2,t=m[x],n=m[w],p=m[v],x=new THREE.Face3(x,w,v,[t,n,p]),c.faces.push(x);b+=nfaces;h.count=0});return c};this.init(b)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
 THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
 1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,
 419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]);
@@ -677,23 +676,23 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 THREE.Trident=function(){THREE.Object3D.call(this);var b=new THREE.Geometry;b.vertices.push(new THREE.Vertex);b.vertices.push(new THREE.Vertex(new THREE.Vector3(0,100,0)));var c=new THREE.CylinderGeometry(0,5,25,5,1),e=new THREE.Line(b,new THREE.LineBasicMaterial({color:16711680}));e.rotation.z=-Math.PI/2;this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:16711680}));e.position.x=100;e.rotation.z=-Math.PI/2;this.add(e);e=new THREE.Line(b,new THREE.LineBasicMaterial({color:65280}));
 this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:65280}));e.position.y=100;this.add(e);e=new THREE.Line(b,new THREE.LineBasicMaterial({color:255}));e.rotation.x=Math.PI/2;this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:255}));e.position.z=100;e.rotation.x=Math.PI/2;this.add(e)};THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.PlaneCollider=function(b,c){this.point=b;this.normal=c};
 THREE.SphereCollider=function(b,c){this.center=b;this.radius=c;this.radiusSq=c*c};THREE.BoxCollider=function(b,c){this.min=b;this.max=c;this.dynamic=!0;this.normal=new THREE.Vector3};THREE.MeshCollider=function(b,c){this.mesh=b;this.box=c;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;
-THREE.CollisionSystem.prototype.merge=function(b){Array.prototype.push.apply(this.colliders,b.colliders);Array.prototype.push.apply(this.hits,b.hits)};THREE.CollisionSystem.prototype.rayCastAll=function(b){b.direction.normalize();this.hits.length=0;var c,e,f,h,k=0;c=0;for(e=this.colliders.length;c<e;c++)if(h=this.colliders[c],f=this.rayCast(b,h),f<Number.MAX_VALUE)h.distance=f,f>k?this.hits.push(h):this.hits.unshift(h),k=f;return this.hits};
+THREE.CollisionSystem.prototype.merge=function(b){Array.prototype.push.apply(this.colliders,b.colliders);Array.prototype.push.apply(this.hits,b.hits)};THREE.CollisionSystem.prototype.rayCastAll=function(b){b.direction.normalize();this.hits.length=0;var c,e,f,m,h=0;c=0;for(e=this.colliders.length;c<e;c++)if(m=this.colliders[c],f=this.rayCast(b,m),f<Number.MAX_VALUE)m.distance=f,f>h?this.hits.push(m):this.hits.unshift(m),h=f;return this.hits};
 THREE.CollisionSystem.prototype.rayCastNearest=function(b){var c=this.rayCastAll(b);if(c.length==0)return null;for(var e=0;c[e]instanceof THREE.MeshCollider;){var f=this.rayMesh(b,c[e]);if(f.dist<Number.MAX_VALUE){c[e].distance=f.dist;c[e].faceIndex=f.faceIndex;break}e++}if(e>c.length)return null;return c[e]};
 THREE.CollisionSystem.prototype.rayCast=function(b,c){if(c instanceof THREE.PlaneCollider)return this.rayPlane(b,c);else if(c instanceof THREE.SphereCollider)return this.raySphere(b,c);else if(c instanceof THREE.BoxCollider)return this.rayBox(b,c);else if(c instanceof THREE.MeshCollider&&c.box)return this.rayBox(b,c.box)};
-THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,k=0;k<c.numFaces;k++){var m=c.mesh.geometry.faces[k],n=c.mesh.geometry.vertices[m.a].position,u=c.mesh.geometry.vertices[m.b].position,p=c.mesh.geometry.vertices[m.c].position,w=m instanceof THREE.Face4?c.mesh.geometry.vertices[m.d].position:null;m instanceof THREE.Face3?(m=this.rayTriangle(e,n,u,p,f,this.collisionNormal,c.mesh),m<f&&(f=m,h=k,c.normal.copy(this.collisionNormal),c.normal.normalize())):
-m instanceof THREE.Face4&&(m=this.rayTriangle(e,n,u,w,f,this.collisionNormal,c.mesh),m<f&&(f=m,h=k,c.normal.copy(this.collisionNormal),c.normal.normalize()),m=this.rayTriangle(e,u,p,w,f,this.collisionNormal,c.mesh),m<f&&(f=m,h=k,c.normal.copy(this.collisionNormal),c.normal.normalize()))}return{dist:f,faceIndex:h}};
-THREE.CollisionSystem.prototype.rayTriangle=function(b,c,e,f,h,k,m){var n=THREE.CollisionSystem.__v1,u=THREE.CollisionSystem.__v2;k.set(0,0,0);n.sub(e,c);u.sub(f,e);k.cross(n,u);n=k.dot(b.direction);if(!(n<0))if(m.doubleSided||m.flipSided)k.multiplyScalar(-1),n*=-1;else return Number.MAX_VALUE;m=k.dot(c)-k.dot(b.origin);if(!(m<=0))return Number.MAX_VALUE;if(!(m>=n*h))return Number.MAX_VALUE;m/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(m);n.addSelf(b.origin);Math.abs(k.x)>
-Math.abs(k.y)?Math.abs(k.x)>Math.abs(k.z)?(b=n.y-c.y,k=e.y-c.y,h=f.y-c.y,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(k.y)>Math.abs(k.z)?(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y);c=k*f-e*h;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-n*h)*c;if(!(f>=0))return Number.MAX_VALUE;c*=k*n-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return m};
+THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,m,h=0;h<c.numFaces;h++){var k=c.mesh.geometry.faces[h],n=c.mesh.geometry.vertices[k.a].position,p=c.mesh.geometry.vertices[k.b].position,u=c.mesh.geometry.vertices[k.c].position,w=k instanceof THREE.Face4?c.mesh.geometry.vertices[k.d].position:null;k instanceof THREE.Face3?(k=this.rayTriangle(e,n,p,u,f,this.collisionNormal,c.mesh),k<f&&(f=k,m=h,c.normal.copy(this.collisionNormal),c.normal.normalize())):
+k instanceof THREE.Face4&&(k=this.rayTriangle(e,n,p,w,f,this.collisionNormal,c.mesh),k<f&&(f=k,m=h,c.normal.copy(this.collisionNormal),c.normal.normalize()),k=this.rayTriangle(e,p,u,w,f,this.collisionNormal,c.mesh),k<f&&(f=k,m=h,c.normal.copy(this.collisionNormal),c.normal.normalize()))}return{dist:f,faceIndex:m}};
+THREE.CollisionSystem.prototype.rayTriangle=function(b,c,e,f,m,h,k){var n=THREE.CollisionSystem.__v1,p=THREE.CollisionSystem.__v2;h.set(0,0,0);n.sub(e,c);p.sub(f,e);h.cross(n,p);n=h.dot(b.direction);if(!(n<0))if(k.doubleSided||k.flipSided)h.multiplyScalar(-1),n*=-1;else return Number.MAX_VALUE;k=h.dot(c)-h.dot(b.origin);if(!(k<=0))return Number.MAX_VALUE;if(!(k>=n*m))return Number.MAX_VALUE;k/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(k);n.addSelf(b.origin);Math.abs(h.x)>
+Math.abs(h.y)?Math.abs(h.x)>Math.abs(h.z)?(b=n.y-c.y,h=e.y-c.y,m=f.y-c.y,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,h=e.x-c.x,m=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(h.y)>Math.abs(h.z)?(b=n.x-c.x,h=e.x-c.x,m=f.x-c.x,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,h=e.x-c.x,m=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y);c=h*f-e*m;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-n*m)*c;if(!(f>=0))return Number.MAX_VALUE;c*=h*n-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return k};
 THREE.CollisionSystem.prototype.makeRayLocal=function(b,c){var e=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(c.matrixWorld,e);var f=THREE.CollisionSystem.__r;f.origin.copy(b.origin);f.direction.copy(b.direction);e.multiplyVector3(f.origin);e.rotateAxis(f.direction);f.direction.normalize();return f};
-THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,h=0,k=0,m=0,n=0,u=0,p=!0;e.origin.x<c.min.x?(f=c.min.x-e.origin.x,f/=e.direction.x,p=!1,m=-1):e.origin.x>c.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,p=!1,m=1);e.origin.y<c.min.y?(h=c.min.y-e.origin.y,h/=e.direction.y,p=!1,n=-1):e.origin.y>c.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y,
-p=!1,n=1);e.origin.z<c.min.z?(k=c.min.z-e.origin.z,k/=e.direction.z,p=!1,u=-1):e.origin.z>c.max.z&&(k=c.max.z-e.origin.z,k/=e.direction.z,p=!1,u=1);if(p)return-1;p=0;h>f&&(p=1,f=h);k>f&&(p=2,f=k);switch(p){case 0:n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>c.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(m,0,0);break;case 1:m=e.origin.x+e.direction.x*f;if(m<c.min.x||m>c.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*
-f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:m=e.origin.x+e.direction.x*f;if(m<c.min.x||m>c.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>c.max.y)return Number.MAX_VALUE;c.normal.set(0,0,u)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE};
+THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,m=0,h=0,k=0,n=0,p=0,u=!0;e.origin.x<c.min.x?(f=c.min.x-e.origin.x,f/=e.direction.x,u=!1,k=-1):e.origin.x>c.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,u=!1,k=1);e.origin.y<c.min.y?(m=c.min.y-e.origin.y,m/=e.direction.y,u=!1,n=-1):e.origin.y>c.max.y&&(m=c.max.y-e.origin.y,m/=e.direction.y,
+u=!1,n=1);e.origin.z<c.min.z?(h=c.min.z-e.origin.z,h/=e.direction.z,u=!1,p=-1):e.origin.z>c.max.z&&(h=c.max.z-e.origin.z,h/=e.direction.z,u=!1,p=1);if(u)return-1;u=0;m>f&&(u=1,f=m);h>f&&(u=2,f=h);switch(u){case 0:n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>c.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(k,0,0);break;case 1:k=e.origin.x+e.direction.x*f;if(k<c.min.x||k>c.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*
+f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:k=e.origin.x+e.direction.x*f;if(k<c.min.x||k>c.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>c.max.y)return Number.MAX_VALUE;c.normal.set(0,0,p)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE};
 THREE.CollisionSystem.prototype.raySphere=function(b,c){var e=c.center.clone().subSelf(b.origin);if(e.lengthSq<c.radiusSq)return-1;var f=e.dot(b.direction.clone());if(f<=0)return Number.MAX_VALUE;e=c.radiusSq-(e.lengthSq()-f*f);if(e>=0)return Math.abs(f)-Math.sqrt(e);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4;
 THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(b){b.geometry.computeBoundingBox();var c=b.geometry.boundingBox,e=new THREE.Vector3(c.x[0],c.y[0],c.z[0]),c=new THREE.Vector3(c.x[1],c.y[1],c.z[1]),e=new THREE.BoxCollider(e,c);e.mesh=b;return e};THREE.CollisionUtils.MeshAABB=function(b){var c=THREE.CollisionUtils.MeshOBB(b);c.min.addSelf(b.position);c.max.addSelf(b.position);c.dynamic=!1;return c};
 THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))};
-if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.Camera,k=new THREE.Camera,m=new THREE.Matrix4,n=new THREE.Matrix4,u,p,w;h.useTarget=k.useTarget=!1;h.matrixAutoUpdate=k.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},t=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.Camera(53,1,1,1E4);v.position.z=
+if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,m=new THREE.Camera,h=new THREE.Camera,k=new THREE.Matrix4,n=new THREE.Matrix4,p,u,w;m.useTarget=h.useTarget=!1;m.matrixAutoUpdate=h.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},t=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.Camera(53,1,1,1E4);v.position.z=
 2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:t},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});
-var z=new THREE.Scene;z.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);t.width=b;t.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(u!==e.aspect||p!==e.near||w!==e.fov){u=e.aspect;p=e.near;w=e.fov;var C=e.projectionMatrix.clone(),E=125/30*0.5,F=E*p/125,G=p*Math.tan(w*Math.PI/360),M;m.n14=E;n.n14=-E;E=-G*u+F;M=G*u+F;C.n11=2*p/(M-E);C.n13=(M+E)/(M-E);h.projectionMatrix=C.clone();E=-G*u-F;M=G*u-F;C.n11=2*p/(M-E);C.n13=
-(M+E)/(M-E);k.projectionMatrix=C.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=p;h.far=e.far;f.call(c,b,h,t,!0);k.matrix=e.matrixWorld.clone().multiplySelf(m);k.update(null,!0);k.position.copy(e.position);k.near=p;k.far=e.far;f.call(c,b,k,x,!0);f.call(c,z,v)}};
-if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,h,k,m=new THREE.Camera,n=new THREE.Camera;c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(b,f){e.call(c,b,f);h=b/2;k=f};this.render=function(b,e){this.clear();m.fov=e.fov;m.aspect=0.5*e.aspect;m.near=e.near;m.far=e.far;
-m.updateProjectionMatrix();m.position.copy(e.position);m.target.position.copy(e.target.position);m.translateX(c.separation);n.projectionMatrix=m.projectionMatrix;n.position.copy(e.position);n.target.position.copy(e.target.position);n.translateX(-c.separation);this.setViewport(0,0,h,k);f.call(c,b,m);this.setViewport(h,0,h,k);f.call(c,b,n,!1)}};
+var z=new THREE.Scene;z.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);t.width=b;t.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(p!==e.aspect||u!==e.near||w!==e.fov){p=e.aspect;u=e.near;w=e.fov;var C=e.projectionMatrix.clone(),E=125/30*0.5,F=E*u/125,G=u*Math.tan(w*Math.PI/360),M;k.n14=E;n.n14=-E;E=-G*p+F;M=G*p+F;C.n11=2*u/(M-E);C.n13=(M+E)/(M-E);m.projectionMatrix=C.clone();E=-G*p-F;M=G*p-F;C.n11=2*u/(M-E);C.n13=
+(M+E)/(M-E);h.projectionMatrix=C.clone()}m.matrix=e.matrixWorld.clone().multiplySelf(n);m.update(null,!0);m.position.copy(e.position);m.near=u;m.far=e.far;f.call(c,b,m,t,!0);h.matrix=e.matrixWorld.clone().multiplySelf(k);h.update(null,!0);h.position.copy(e.position);h.near=u;h.far=e.far;f.call(c,b,h,x,!0);f.call(c,z,v)}};
+if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,m,h,k=new THREE.Camera,n=new THREE.Camera;c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(b,f){e.call(c,b,f);m=b/2;h=f};this.render=function(b,e){this.clear();k.fov=e.fov;k.aspect=0.5*e.aspect;k.near=e.near;k.far=e.far;
+k.updateProjectionMatrix();k.position.copy(e.position);k.target.position.copy(e.target.position);k.translateX(c.separation);n.projectionMatrix=k.projectionMatrix;n.position.copy(e.position);n.target.position.copy(e.target.position);n.translateX(-c.separation);this.setViewport(0,0,m,h);f.call(c,b,k);this.setViewport(m,0,m,h);f.call(c,b,n,!1)}};

+ 9 - 5
examples/canvas_geometry_subdivison.html

@@ -96,6 +96,8 @@
 				//geometry = new THREE.CubeGeometry( 200, 200, 200, 2, 2, 2, materials );
 				geometry = new THREE.CubeGeometry( 200, 200, 200, 1, 1, 3, materials );
 				
+				//geometry = new THREE.IcosahedronGeometry( 1 );
+				
 				//geometry = new THREE.TorusGeometry( 100, 60, 4, 8, Math.PI*2 );
 				//geometry = new THREE.SphereGeometry( 200, 1, 1);
 				//geometry = new THREE.CylinderGeometry( 50, 50, 200 );
@@ -107,14 +109,12 @@
 				// 
 				// 					});
 					
-				//PlaneGeometry not supported
+				//PlaneGeometry not supported 
 				
 				
-				// quick fix for duplicated vertices
-				// either mergeVertices or checkDupVertices(true) works
+				// make sure mergeVertices(); is run to fix quick duplicated vertices
 				geometry.mergeVertices();
-				geometry.checkDupVertices( true );
-				
+
 				
 				//console.log(geometry);
 				
@@ -175,6 +175,10 @@
 				//cube = new THREE.Mesh( smooth, new THREE.MeshFaceMaterial() ); 
 				// material =  new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading } );
 				// 	 new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.SmoothShading } );
+				// cube.scale.x = 200;
+				// cube.scale.y = 200;
+				// cube.scale.z = 200;
+				
 				
 				//
 				cube.doubleSided = true;

+ 17 - 92
src/core/Geometry.js

@@ -15,8 +15,6 @@ THREE.Geometry = function () {
 
 	this.faces = [];
 
-	//this.edges = [];
-
 	this.faceUvs = [[]];
 	this.faceVertexUvs = [[]];
 
@@ -438,74 +436,19 @@ THREE.Geometry.prototype = {
 
 	},
 	
-	/* 
-	 * Merge Vertices which distances close enough 
-     *
-	 */
-	mergeVertices: function() {
-
-		var unique = [], changes = [], scope = this;
-		
-		var isEqual = function(a, b) {
-			var epsilon = 0.0001;
-			return (Math.abs(a - b) < epsilon);
-		}
-		
-		for ( var i = 0, il = scope.vertices.length; i < il; i ++ ) {
-
-			var v = scope.vertices[ i ],
-			duplicate = false;
-
-			for ( var j = 0, jl = unique.length; j < jl; j ++ ) {
-
-				var vu = unique[ j ];
-
-				if( isEqual(v.position.x, vu.position.x) && isEqual(v.position.y, vu.position.y) && isEqual(v.position.z, vu.position.z) ) {
-
-					changes[ i ] = j;
-					duplicate = true;
-					break;
-
-				}
-
-			}
-
-			if ( ! duplicate ) {
-
-				changes[ i ] = unique.length;
-				unique.push( new THREE.Vertex( v.position.clone() ) );
-
-			}
-
-		}
-
-		for ( i = 0, il = scope.faces.length; i < il; i ++ ) {
-
-			var face = scope.faces[ i ];
-
-			face.a = changes[ face.a ];
-			face.b = changes[ face.b ];
-			face.c = changes[ face.c ];
-			face.d = changes[ face.d ];
-
-		}
-
-		scope.vertices = unique;
-
-	},
-	
 	/* 
 	 * Checks for duplicate vertices with hashmap. 
-	 * If toPatch is true, duplicated vertices are removed
+	 * Duplicated vertices are removed
 	 * and faces' vertices are updated. 
 	 */
-	checkDupVertices: function(toPatch) {
+	mergeVertices: function() {
 		
-		var uniqueVertices = {}, patch = {};
+		var verticesMap = {}; // Hashmap for looking up vertice by position coordinates (and making sure they are unique)
 		var unique = [], changes = [];
 		
 		var v, key;
-		var precision = 1000;
+		var precisionPoints = 4; // number of decimal points, eg. 4 for epsilon of 0.0001 
+		var precision = Math.pow(10, precisionPoints)
 		var i,il, face;
 		
 		for (i=0,il=this.vertices.length;i<il;i++) {
@@ -513,51 +456,34 @@ THREE.Geometry.prototype = {
 			v = this.vertices[i].position;
 			key = [Math.round(v.x * precision), Math.round(v.y* precision), Math.round(v.z* precision)].join('_');
 			
-			if (uniqueVertices[key]===undefined) {
-				uniqueVertices[key] = i;
+			if (verticesMap[key]===undefined) {
+				verticesMap[key] = i;
 				unique.push(this.vertices[i]);
 				changes[i] = unique.length - 1;
 			} else {
-				console.log('Duplicate vertex found. ', i, ' could be using ', uniqueVertices[key]);
-				patch[i] = uniqueVertices[key];
-				changes[i] = changes[uniqueVertices[key]];
+				//console.log('Duplicate vertex found. ', i, ' could be using ', verticesMap[key]);
+				changes[i] = changes[verticesMap[key]];
 			}
 			
 		};
 		
 		
-		
-		if (!toPatch) return;
-		
-		// Start to patch.
-		//console.log('Start Patching' , patch, toPatch, changes);
-		
-		var runPatch = function(i) {
-			
-			return changes[i];
-			
-			// if (patch[i] !== undefined) {
-			// 	//console.log('fixing',i, 'to', patch[i]);
-			// 	return patch[i];
-			// }
-			// return i;
-		};
-		
+		// Start to patch face indices.
 		for( i = 0, il = this.faces.length; i < il; i ++ ) {
 
 			face = this.faces[ i ];
 
 			if ( face instanceof THREE.Face3 ) {
-				face.a = runPatch(face.a);
-				face.b = runPatch(face.b);
-				face.c = runPatch(face.c);
+				face.a = changes[face.a];
+				face.b = changes[face.b];
+				face.c = changes[face.c];
 			
 			} if ( face instanceof THREE.Face4 ) {
 
-				face.a = runPatch(face.a);
-				face.b = runPatch(face.b);
-				face.c = runPatch(face.c);
-				face.d = runPatch(face.d);
+				face.a = changes[face.a];
+				face.b = changes[face.b];
+				face.c = changes[face.c];
+				face.d = changes[face.d];
 			
 			}
 		}
@@ -565,7 +491,6 @@ THREE.Geometry.prototype = {
 		// Use unique set of vertices
 		this.vertices = unique;
 		
-		//console.log(this);
 	}
 
 };