Browse Source

moved `computeEdgeFaces()` from `Geometry` to `SubdivisionGeometry`

zz85 14 years ago
parent
commit
b5f4b24204
2 changed files with 371 additions and 463 deletions
  1. 371 372
      build/Three.js
  2. 0 91
      src/core/Geometry.js

+ 371 - 372
build/Three.js

@@ -16,37 +16,37 @@ c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this
 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};
 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),
 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,
 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,p,u,w,t,x,v,z=b.geometry,y=z.vertices,A=[],f=0;for(h=z.faces.length;f<h;f++)if(k=z.faces[f],x=this.origin.clone(),v=this.direction.clone(),u=b.matrixWorld,m=u.multiplyVector3(k.centroid.clone()).subSelf(x),t=m.dot(v),!(t<=0)&&(m=u.multiplyVector3(y[k.a].position.clone()),n=u.multiplyVector3(y[k.b].position.clone()),p=u.multiplyVector3(y[k.c].position.clone()),u=k instanceof THREE.Face4?u.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,p)&&(k={distance:this.origin.distanceTo(x),point:x,face:k,object:b},A.push(k));else if(k instanceof THREE.Face4&&(e(x,m,n,u)||e(x,n,p,u)))k={distance:this.origin.distanceTo(x),point:x,face:k,object:b},A.push(k);A.sort(function(b,e){return b.distance-e.distance});return A}else return[]}};
+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=
 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>
 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=[]};
 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=[]};
 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.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,p,u,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,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,h,k,m,n,p,u,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=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,
+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;
 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+
 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,p=b.n23,u=b.n24,w=b.n31,t=b.n32,x=b.n33,v=b.n34,z=b.n41,y=b.n42,A=b.n43,B=b.n44,D=c.n11,F=c.n12,
-G=c.n13,N=c.n14,P=c.n21,H=c.n22,I=c.n23,M=c.n24,$=c.n31,E=c.n32,O=c.n33,Q=c.n34,W=c.n41,X=c.n42,o=c.n43,ea=c.n44;this.n11=e*D+f*P+h*$+k*W;this.n12=e*F+f*H+h*E+k*X;this.n13=e*G+f*I+h*O+k*o;this.n14=e*N+f*M+h*Q+k*ea;this.n21=m*D+n*P+p*$+u*W;this.n22=m*F+n*H+p*E+u*X;this.n23=m*G+n*I+p*O+u*o;this.n24=m*N+n*M+p*Q+u*ea;this.n31=w*D+t*P+x*$+v*W;this.n32=w*F+t*H+x*E+v*X;this.n33=w*G+t*I+x*O+v*o;this.n34=w*N+t*M+x*Q+v*ea;this.n41=z*D+y*P+A*$+B*W;this.n42=z*F+y*H+A*E+B*X;this.n43=z*G+y*I+A*O+B*o;this.n44=z*
-N+y*M+A*Q+B*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,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*m*u*x-e*n*u*x-f*k*w*x+c*n*w*x+e*k*t*x-c*m*t*x-f*m*p*v+e*n*p*v+f*h*w*v-b*n*w*v-e*h*t*v+b*m*t*v+f*k*p*z-c*n*p*z-f*h*u*z+b*n*u*z+c*h*t*z-b*k*t*z-e*k*p*y+c*m*p*y+e*h*u*y-b*m*u*y-c*h*
+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*
+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=
 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=
 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.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.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,
 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,p=h*k,u=h*m;this.set(p*k+e,p*m-f*n,p*n+f*m,0,p*m+f*n,u*m+e,u*n-f*k,0,p*n-f*m,u*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 p=
-m*n,u=m*h,w=f*n,t=f*h;this.n11=p+t*e;this.n12=w*e-u;this.n13=k*f;this.n21=k*h;this.n22=k*n;this.n23=-e;this.n31=u*e-w;this.n32=t+p*e;this.n33=k*m;break;case "ZXY":p=m*n;u=m*h;w=f*n;t=f*h;this.n11=p-t*e;this.n12=-k*h;this.n13=w+u*e;this.n21=u+w*e;this.n22=k*n;this.n23=t-p*e;this.n31=-k*f;this.n32=e;this.n33=k*m;break;case "ZYX":p=k*n;u=k*h;w=e*n;t=e*h;this.n11=m*n;this.n12=w*f-u;this.n13=p*f+t;this.n21=m*h;this.n22=t*f+p;this.n23=u*f-w;this.n31=-f;this.n32=e*m;this.n33=k*m;break;case "YZX":p=k*m;u=
-k*f;w=e*m;t=e*f;this.n11=m*n;this.n12=t-p*h;this.n13=w*h+u;this.n21=h;this.n22=k*n;this.n23=-e*n;this.n31=-f*n;this.n32=u*h+w;this.n33=p-t*h;break;case "XZY":p=k*m;u=k*f;w=e*m;t=e*f;this.n11=m*n;this.n12=-h;this.n13=f*n;this.n21=p*h+t;this.n22=k*n;this.n23=u*h-w;this.n31=w*h-u;this.n32=e*n;this.n33=t*h+p;break;default:p=k*n,u=k*h,w=e*n,t=e*h,this.n11=m*n,this.n12=-m*h,this.n13=f,this.n21=u+w*f,this.n22=p-t*f,this.n23=-e*m,this.n31=t-p*f,this.n32=w+u*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,p=c*m;c*=n;var u=e*m;e*=n;f*=n;k*=h;m*=h;h*=n;this.n11=1-(u+f);this.n12=p-h;this.n13=c+m;this.n21=p+h;this.n22=1-(b+f);this.n23=e-k;this.n31=c-m;this.n32=e+k;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,h=THREE.Matrix4.__m2;
+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();
 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=
 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}};
 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,p=b.n23,u=b.n24,w=b.n31,t=b.n32,x=b.n33,v=b.n34,z=b.n41,y=b.n42,A=b.n43,B=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=p*v*y-u*x*y+u*t*A-n*v*A-p*t*B+n*x*B;c.n12=k*x*y-h*v*y-k*t*A+f*v*A+h*t*B-f*x*B;c.n13=h*u*y-k*p*y+k*n*A-f*u*A-h*n*B+f*p*B;c.n14=k*p*t-h*u*t-k*n*x+f*u*x+h*n*v-f*p*v;c.n21=u*x*z-p*v*z-u*w*A+m*v*A+p*w*B-m*x*B;c.n22=h*v*z-k*x*z+k*w*A-e*v*A-h*w*B+e*x*B;c.n23=k*p*z-h*u*z-k*m*A+e*u*A+h*m*B-e*p*B;c.n24=
-h*u*w-k*p*w+k*m*x-e*u*x-h*m*v+e*p*v;c.n31=n*v*z-u*t*z+u*w*y-m*v*y-n*w*B+m*t*B;c.n32=k*t*z-f*v*z-k*w*y+e*v*y+f*w*B-e*t*B;c.n33=h*u*z-k*n*z+k*m*y-e*u*y-f*m*B+e*n*B;c.n34=k*n*w-f*u*w-k*m*t+e*u*t+f*m*v-e*n*v;c.n41=p*t*z-n*x*z-p*w*y+m*x*y+n*w*A-m*t*A;c.n42=f*x*z-h*t*z+h*w*y-e*x*y-f*w*A+e*t*A;c.n43=h*n*z-f*p*z-h*m*y+e*p*y+f*m*A-e*n*A;c.n44=f*p*w-h*n*w+h*m*t-e*p*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,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*m+b.n31*u;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*p;e[6]=b*u;e[7]=b*w;e[8]=b*t;return c};
+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.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,p,u;m=new THREE.Matrix4;n=c-b;p=e-f;u=k-h;m.n11=2/n;m.n12=0;m.n13=0;m.n14=-((c+b)/n);m.n21=0;m.n22=2/p;m.n23=0;m.n24=-((e+f)/p);m.n31=0;m.n32=0;m.n33=-2/u;m.n34=-((k+h)/u);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;
+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;
 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=
 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};
 !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)===
 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)===
@@ -54,40 +54,39 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){thi
 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&&
 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&&
 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.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;
 this.remove(b)}};THREE.Object3DCount=0;
-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,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,p=[],u,w,t=[],x,v=[],z,y,A=[],B,D,F=[],G=[],N=[],P=new THREE.Vector4,H=new THREE.Vector4,
-I=new THREE.Matrix4,M=new THREE.Matrix4,$=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],E=new THREE.Vector4,O=new THREE.Vector4;this.projectVector=function(b,e){I.multiply(e.projectionMatrix,e.matrixWorldInverse);I.multiplyVector3(b);return b};this.unprojectVector=function(b,e){I.multiply(e.matrixWorld,THREE.Matrix4.makeInvert(e.projectionMatrix));I.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=$[u].x*v.n14+$[u].y*v.n24+$[u].z*v.n34+$[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),I.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,V,P,aa,ia,ca,oa,fa,da,U,Y,ga,ka,ta,L,ma,qa,ra;D=y=x=w=N.length=0;k.matrixAutoUpdate&&k.update(void 0,!0);f.update(void 0,!1,k);I.multiply(k.projectionMatrix,k.matrixWorldInverse);$[0].set(I.n41-I.n11,I.n42-I.n12,I.n43-I.n13,I.n44-I.n14);$[1].set(I.n41+I.n11,I.n42+I.n12,I.n43+I.n13,I.n44+I.n14);$[2].set(I.n41+I.n21,I.n42+I.n22,I.n43+I.n23,I.n44+I.n24);$[3].set(I.n41-I.n21,I.n42-I.n22,I.n43-I.n23,I.n44-I.n24);$[4].set(I.n41-I.n31,I.n42-I.n32,I.n43-I.n33,I.n44-I.n34);
-$[5].set(I.n41+I.n31,I.n42+I.n32,I.n43+I.n33,I.n44+I.n34);for(V=0;V<6;V++)U=$[V],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(V=U.length;f<V;f++)if(Y=U[f].object,Y.visible)if(ga=Y.matrixWorld,ka=Y.matrixRotationWorld,ta=Y.materials,L=Y.overdraw,n=0,Y instanceof THREE.Mesh){ma=Y.geometry;ia=ma.vertices;qa=ma.faces;ma=ma.faceVertexUvs;P=0;for(aa=ia.length;P<aa;P++)m=b(),m.positionWorld.copy(ia[P].position),ga.multiplyVector3(m.positionWorld),m.positionScreen.copy(m.positionWorld),
-I.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;ia=0;for(P=qa.length;ia<P;ia++){aa=qa[ia];if(aa instanceof THREE.Face3)if(ca=p[aa.a],oa=p[aa.b],fa=p[aa.c],ca.visible&&oa.visible&&fa.visible&&(Y.doubleSided||Y.flipSided!=(fa.positionScreen.x-ca.positionScreen.x)*(oa.positionScreen.y-ca.positionScreen.y)-(fa.positionScreen.y-ca.positionScreen.y)*(oa.positionScreen.x-ca.positionScreen.x)<
-0))da=t[w]=t[w]||new THREE.RenderableFace3,w++,u=da,u.v1.copy(ca),u.v2.copy(oa),u.v3.copy(fa);else continue;else if(aa instanceof THREE.Face4)if(ca=p[aa.a],oa=p[aa.b],fa=p[aa.c],da=p[aa.d],ca.visible&&oa.visible&&fa.visible&&da.visible&&(Y.doubleSided||Y.flipSided!=((da.positionScreen.x-ca.positionScreen.x)*(oa.positionScreen.y-ca.positionScreen.y)-(da.positionScreen.y-ca.positionScreen.y)*(oa.positionScreen.x-ca.positionScreen.x)<0||(oa.positionScreen.x-fa.positionScreen.x)*(da.positionScreen.y-
-fa.positionScreen.y)-(oa.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(oa),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);I.multiplyVector3(u.centroidScreen);fa=aa.vertexNormals;ca=0;for(oa=fa.length;ca<oa;ca++)da=u.vertexNormalsWorld[ca],
-da.copy(fa[ca]),ka.multiplyVector3(da);ca=0;for(oa=ma.length;ca<oa;ca++)if(ra=ma[ca][ia]){fa=0;for(da=ra.length;fa<da;fa++)u.uvs[ca][fa]=ra[fa]}u.meshMaterials=ta;u.faceMaterials=aa.materials;u.overdraw=L;u.z=u.centroidScreen.z;N.push(u)}}else if(Y instanceof THREE.Line){M.multiply(I,ga);ia=Y.geometry.vertices;ca=b();ca.positionScreen.copy(ia[0].position);M.multiplyVector4(ca.positionScreen);P=1;for(aa=ia.length;P<aa;P++)if(ca=b(),ca.positionScreen.copy(ia[P].position),M.multiplyVector4(ca.positionScreen),
-oa=p[n-2],E.copy(ca.positionScreen),O.copy(oa.positionScreen),e(E,O))E.multiplyScalar(1/E.w),O.multiplyScalar(1/O.w),ga=A[y]=A[y]||new THREE.RenderableLine,y++,z=ga,z.v1.positionScreen.copy(E),z.v2.positionScreen.copy(O),z.z=Math.max(E.z,O.z),z.materials=Y.materials,N.push(z)}else if(Y instanceof THREE.Particle&&(H.set(Y.matrixWorld.n14,Y.matrixWorld.n24,Y.matrixWorld.n34,1),I.multiplyVector4(H),H.z/=H.w,H.z>0&&H.z<1))ga=F[D]=F[D]||new THREE.RenderableParticle,D++,B=ga,B.x=H.x/H.w,B.y=H.y/H.w,B.z=
-H.z,B.rotation=Y.rotation.z,B.scale.x=Y.scale.x*Math.abs(B.x-(H.x+k.projectionMatrix.n11)/(H.w+k.projectionMatrix.n14)),B.scale.y=Y.scale.y*Math.abs(B.y-(H.y+k.projectionMatrix.n22)/(H.w+k.projectionMatrix.n24)),B.materials=Y.materials,N.push(B);h&&N.sort(c);return N}};THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)};
+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.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);
 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.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.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,p=this.w,u=p*e+m*h-n*f,w=p*f+n*e-k*h,t=p*h+k*f-m*e,e=-k*
-e-m*f-n*h;c.x=u*p+e*-k+w*-n-t*-m;c.y=w*p+e*-m+t*-k-u*-n;c.z=t*p+e*-n+u*-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};
+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.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};
 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};
 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.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 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<
 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,
 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,p=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),p.sub(c.position,e.position),n.crossSelf(p);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,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=
 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
 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]),
 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;p=b.vertices[c].position;u=b.vertices[f].position;w=m[k];t=m[h];x=m[o];v=p.x-n.x;z=u.x-n.x;y=p.y-n.y;A=u.y-n.y;B=p.z-n.z;D=u.z-n.z;F=t.u-w.u;G=x.u-w.u;N=t.v-w.v;P=x.v-w.v;H=1/(F*P-G*N);E.set((P*v-N*z)*H,(P*y-N*A)*H,(P*B-N*D)*H);O.set((F*z-G*v)*H,(F*A-G*y)*H,(F*D-G*B)*H);M[e].addSelf(E);M[c].addSelf(E);M[f].addSelf(E);$[e].addSelf(O);
-$[c].addSelf(O);$[f].addSelf(O)}var c,e,f,h,k,m,n,p,u,w,t,x,v,z,y,A,B,D,F,G,N,P,H,I,M=[],$=[],E=new THREE.Vector3,O=new THREE.Vector3,Q=new THREE.Vector3,W=new THREE.Vector3,X=new THREE.Vector3;c=0;for(e=this.vertices.length;c<e;c++)M[c]=new THREE.Vector3,$[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++)X.copy(k.vertexNormals[f]),h=k[o[f]],I=M[h],Q.copy(I),Q.subSelf(X.multiplyScalar(X.dot(I))).normalize(),W.cross(k.vertexNormals[f],I),h=W.dot($[h]),h=h<0?-1:1,k.vertexTangents[f]=new THREE.Vector4(Q.x,Q.y,Q.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,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,
 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]=
 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}},computeEdgeFaces:function(){function b(b,e){return Math.min(b,e)+"_"+Math.max(b,e)}function c(b,e,c){b[e]===void 0&&(b[e]={set:{},array:[]});b[e].set[c]=1;b[e].array.push(c)}var e,f,h,k,m={};e=0;for(f=this.faces.length;e<f;e++)h=this.faces[e],h instanceof
-THREE.Face3?(k=b(h.a,h.b),c(m,k,e),k=b(h.b,h.c),c(m,k,e),k=b(h.c,h.a),c(m,k,e)):h instanceof THREE.Face4&&(k=b(h.a,h.b),c(m,k,e),k=b(h.b,h.c),c(m,k,e),k=b(h.c,h.d),c(m,k,e),k=b(h.d,h.a),c(m,k,e));this.vfMap=m;this.edges=[];h=0;for(e in m)h++,f=m[e],this.edges.push(f.array);return m},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 p=b[m];if(Math.abs(h.position.x-p.position.x)<1.0E-4&&Math.abs(h.position.y-p.position.y)<
-1.0E-4&&Math.abs(h.position.z-p.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,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){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;u=this.points[e[0]];w=this.points[e[1]];
-t=this.points[e[2]];x=this.points[e[3]];n=m*m;p=m*n;f.x=c(u.x,w.x,t.x,x.x,m,n,p);f.y=c(u.y,w.y,t.y,x.y,m,n,p);f.z=c(u.z,w.z,t.z,x.z,m,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,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),
+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+=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;
 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;
 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.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)};
@@ -120,7 +119,7 @@ void 0?b.fog:!1;this.lights=b.lights!==void 0?b.lights:!1;this.vertexColors=b.ve
 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,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.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.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.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,p){THREE.Texture.call(this,null,h,k,m,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.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.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.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.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.Line.prototype.constructor=THREE.Line;
@@ -147,49 +146,49 @@ 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.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.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.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 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*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(A!=b)v.globalAlpha=A=b}function e(b){if(B!=b){switch(b){case THREE.NormalBlending:v.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:v.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:v.globalCompositeOperation="darker"}B=b}}function f(b){if(D!=b)v.strokeStyle=D=b}function h(b){if(F!=b)v.fillStyle=F=b}var k=this,m=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,A=1,B=0,D=null,F=null,G=null,N=null,P=null,H,I,M,$,E=new THREE.RenderableVertex,O=new THREE.RenderableVertex,Q,W,X,o,ea,V,la,aa,ia,ca,oa,fa,da=new THREE.Color(0),U=new THREE.Color(0),Y=new THREE.Color(0),ga=new THREE.Color(0),ka=new THREE.Color(0),ta=[],L,ma,qa,ra,va,Da,Ea,Aa,Ca,Ga,K=new THREE.Rectangle,S=new THREE.Rectangle,T=new THREE.Rectangle,pa=!1,ha=new THREE.Color,ja=new THREE.Color,ya=new THREE.Color,ua=new THREE.Color,na=new THREE.Vector3,
-wa,xa,Ka,Ba,Ha,Z,b=16;wa=document.createElement("canvas");wa.width=wa.height=2;xa=wa.getContext("2d");xa.fillStyle="rgba(0,0,0,1)";xa.fillRect(0,0,2,2);Ka=xa.getImageData(0,0,2,2);Ba=Ka.data;Ha=document.createElement("canvas");Ha.width=Ha.height=b;Z=Ha.getContext("2d");Z.translate(-b/2,-b/2);Z.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);S.set(-t,-x,t,x);A=1;B=0;P=N=G=F=D=null};this.setClearColor=function(b,e){z.copy(b);y=e;S.set(-t,-x,t,x)};this.setClearColorHex=function(b,e){z.setHex(b);y=e;S.set(-t,-x,t,x)};this.clear=function(){v.setTransform(1,0,0,-1,t,x);S.isEmpty()||(S.minSelf(K),S.inflate(2),y<1&&v.clearRect(Math.floor(S.getX()),Math.floor(S.getY()),Math.floor(S.getWidth()),Math.floor(S.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(S.getX()),Math.floor(S.getY()),Math.floor(S.getWidth()),Math.floor(S.getHeight()))),S.empty())};this.render=function(b,u){function p(b){var e,c,f,k=b.lights;ja.setRGB(0,0,0);ya.setRGB(0,0,0);ua.setRGB(0,0,0);b=0;for(e=k.length;b<e;b++)c=k[b],f=c.color,c instanceof THREE.AmbientLight?(ja.r+=f.r,ja.g+=f.g,ja.b+=f.b):c instanceof THREE.DirectionalLight?(ya.r+=f.r,ya.g+=f.g,ya.b+=f.b):c instanceof THREE.PointLight&&(ua.r+=f.r,ua.g+=f.g,ua.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(na.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,T.set(b.x-o,b.y-n,b.x+o,b.y+n),K.intersects(T)&&(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,T.set(b.x-o,b.y-n,b.x+o,b.y+n),K.intersects(T)&&(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(N!=b)v.lineCap=N=b;b=m.linejoin;if(P!=b)v.lineJoin=P=b;f(m.color.getContextStyle());v.stroke();T.inflate(m.linewidth*2)}}function A(b,f,h,m,n,t,p,v,x){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending);
-Q=b.positionScreen.x;W=b.positionScreen.y;X=f.positionScreen.x;o=f.positionScreen.y;ea=h.positionScreen.x;V=h.positionScreen.y;D(Q,W,X,o,ea,V);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=p.uvs[0],ab(Q,W,X,o,ea,V,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,na.copy(p.vertexNormalsWorld[0]),va=(na.x*b.n11+na.y*b.n12+na.z*b.n13)*0.5+0.5,
-Da=-(na.x*b.n21+na.y*b.n22+na.z*b.n23)*0.5+0.5,na.copy(p.vertexNormalsWorld[1]),Ea=(na.x*b.n11+na.y*b.n12+na.z*b.n13)*0.5+0.5,Aa=-(na.x*b.n21+na.y*b.n22+na.z*b.n23)*0.5+0.5,na.copy(p.vertexNormalsWorld[2]),Ca=(na.x*b.n11+na.y*b.n12+na.z*b.n13)*0.5+0.5,Ga=-(na.x*b.n21+na.y*b.n22+na.z*b.n23)*0.5+0.5,ab(Q,W,X,o,ea,V,va,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(Q,W,X,o,ea,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map)),e(THREE.SubtractiveBlending)),pa?!v.wireframe&&v.shading==THREE.SmoothShading&&p.vertexNormalsWorld.length==3?(U.r=Y.r=ga.r=ja.r,U.g=Y.g=ga.g=ja.g,U.b=Y.b=ga.b=ja.b,w(x,p.v1.positionWorld,p.vertexNormalsWorld[0],U),w(x,p.v2.positionWorld,p.vertexNormalsWorld[1],Y),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)),Y.r=Math.max(0,Math.min(v.color.r*Y.r,1)),Y.g=Math.max(0,Math.min(v.color.g*Y.g,1)),Y.b=Math.max(0,Math.min(v.color.b*Y.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=(Y.r+ga.r)*0.5,ka.g=(Y.g+ga.g)*0.5,ka.b=(Y.b+ga.b)*0.5,qa=Ya(U,Y,ga,ka),Va(Q,W,X,o,ea,V,0,0,1,0,0,1,qa)):(ha.r=ja.r,ha.g=ja.g,ha.b=ja.b,w(x,p.centroidWorld,p.normalWorld,
-ha),da.r=Math.max(0,Math.min(v.color.r*ha.r,1)),da.g=Math.max(0,Math.min(v.color.g*ha.g,1)),da.b=Math.max(0,Math.min(v.color.b*ha.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)L=u.near,ma=u.far,U.r=U.g=U.b=1-Ra(b.positionScreen.z,L,ma),Y.r=Y.g=Y.b=1-Ra(f.positionScreen.z,L,ma),ga.r=ga.g=ga.b=1-Ra(h.positionScreen.z,
-L,ma),ka.r=(Y.r+ga.r)*0.5,ka.g=(Y.g+ga.g)*0.5,ka.b=(Y.b+ga.b)*0.5,qa=Ya(U,Y,ga,ka),Va(Q,W,X,o,ea,V,0,0,1,0,0,1,qa);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 B(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)A(b,f,m,0,1,3,v,p,x),A(n,h,t,1,2,3,v,p,x);else if(Q=b.positionScreen.x,
-W=b.positionScreen.y,X=f.positionScreen.x,o=f.positionScreen.y,ea=h.positionScreen.x,V=h.positionScreen.y,la=m.positionScreen.x,aa=m.positionScreen.y,ia=n.positionScreen.x,ca=n.positionScreen.y,oa=t.positionScreen.x,fa=t.positionScreen.y,p instanceof THREE.MeshBasicMaterial)F(Q,W,X,o,ea,V,la,aa),p.wireframe?Na(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Oa(p.color);else if(p instanceof THREE.MeshLambertMaterial)pa?!p.wireframe&&p.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==
-4?(U.r=Y.r=ga.r=ka.r=ja.r,U.g=Y.g=ga.g=ka.g=ja.g,U.b=Y.b=ga.b=ka.b=ja.b,w(x,v.v1.positionWorld,v.vertexNormalsWorld[0],U),w(x,v.v2.positionWorld,v.vertexNormalsWorld[1],Y),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)),Y.r=Math.max(0,Math.min(p.color.r*Y.r,1)),Y.g=Math.max(0,Math.min(p.color.g*Y.g,1)),Y.b=Math.max(0,Math.min(p.color.b*
-Y.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)),qa=Ya(U,Y,ga,ka),D(Q,W,X,o,la,aa),Va(Q,W,X,o,la,aa,0,0,1,0,0,1,qa),D(ia,ca,ea,V,oa,fa),Va(ia,ca,ea,V,oa,fa,1,0,1,1,0,1,qa)):(ha.r=ja.r,ha.g=ja.g,ha.b=ja.b,w(x,v.centroidWorld,v.normalWorld,ha),da.r=Math.max(0,Math.min(p.color.r*ha.r,
-1)),da.g=Math.max(0,Math.min(p.color.g*ha.g,1)),da.b=Math.max(0,Math.min(p.color.b*ha.b,1)),F(Q,W,X,o,ea,V,la,aa),p.wireframe?Na(da,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Oa(da)):(F(Q,W,X,o,ea,V,la,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(Q,W,X,o,ea,V,la,aa),p.wireframe?Na(da,p.wireframeLinewidth,
-p.wireframeLinecap,p.wireframeLinejoin):Oa(da);else if(p instanceof THREE.MeshDepthMaterial)L=u.near,ma=u.far,U.r=U.g=U.b=1-Ra(b.positionScreen.z,L,ma),Y.r=Y.g=Y.b=1-Ra(f.positionScreen.z,L,ma),ga.r=ga.g=ga.b=1-Ra(m.positionScreen.z,L,ma),ka.r=ka.g=ka.b=1-Ra(h.positionScreen.z,L,ma),qa=Ya(U,Y,ga,ka),D(Q,W,X,o,la,aa),Va(Q,W,X,o,la,aa,0,0,1,0,0,1,qa),D(ia,ca,ea,V,oa,fa),Va(ia,ca,ea,V,oa,fa,1,0,1,1,0,1,qa)}function D(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(N!=c)v.lineCap=N=c;if(P!=k)v.lineJoin=P=k;f(b.getContextStyle());v.stroke();T.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||ta[x.id]==void 0){var w=x.wrapS==THREE.RepeatWrapping,y=x.wrapT==THREE.RepeatWrapping;ta[x.id]=
-v.createPattern(x.image,w&&y?"repeat":w&&!y?"repeat-x":!w&&y?"repeat-y":"no-repeat");x.needsUpdate=!1}h(ta[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,h,m,o,n,p,t,u,Fa){var x,w;x=Fa.width-1;w=Fa.height-1;m*=x;o*=w;n*=x;p*=w;t*=x;u*=w;c-=b;f-=e;k-=b;h-=e;n-=m;p-=o;t-=m;u-=o;w=1/(n*u-t*p);x=(u*c-p*k)*w;p=(u*f-p*h)*w;c=(n*k-t*c)*w;f=(n*h-t*f)*w;b=b-x*m-c*o;e=e-p*m-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;xa.putImageData(Ka,0,0);Z.drawImage(wa,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,sa,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);(pa=b.lights.length>0)&&p(b);Za=0;for(bb=m.length;Za<bb;Za++){sa=m[Za];T.empty();if(sa instanceof THREE.RenderableParticle){H=sa;H.x*=t;H.y*=x;Ia=0;for(Qa=sa.materials.length;Ia<Qa;)za=sa.materials[Ia++],za.opacity!=0&&y(H,sa,za,b)}else if(sa instanceof THREE.RenderableLine){if(H=sa.v1,I=sa.v2,
-H.positionScreen.x*=t,H.positionScreen.y*=x,I.positionScreen.x*=t,I.positionScreen.y*=x,T.addPoint(H.positionScreen.x,H.positionScreen.y),T.addPoint(I.positionScreen.x,I.positionScreen.y),K.intersects(T)){Ia=0;for(Qa=sa.materials.length;Ia<Qa;)za=sa.materials[Ia++],za.opacity!=0&&z(H,I,sa,za,b)}}else if(sa instanceof THREE.RenderableFace3){if(H=sa.v1,I=sa.v2,M=sa.v3,H.positionScreen.x*=t,H.positionScreen.y*=x,I.positionScreen.x*=t,I.positionScreen.y*=x,M.positionScreen.x*=t,M.positionScreen.y*=x,
-sa.overdraw&&(Pa(H.positionScreen,I.positionScreen),Pa(I.positionScreen,M.positionScreen),Pa(M.positionScreen,H.positionScreen)),T.add3Points(H.positionScreen.x,H.positionScreen.y,I.positionScreen.x,I.positionScreen.y,M.positionScreen.x,M.positionScreen.y),K.intersects(T)){Ia=0;for(Qa=sa.meshMaterials.length;Ia<Qa;)if(za=sa.meshMaterials[Ia++],za instanceof THREE.MeshFaceMaterial){Xa=0;for($a=sa.faceMaterials.length;Xa<$a;)(za=sa.faceMaterials[Xa++])&&za.opacity!=0&&A(H,I,M,0,1,2,sa,za,b)}else za.opacity!=
-0&&A(H,I,M,0,1,2,sa,za,b)}}else if(sa instanceof THREE.RenderableFace4&&(H=sa.v1,I=sa.v2,M=sa.v3,$=sa.v4,H.positionScreen.x*=t,H.positionScreen.y*=x,I.positionScreen.x*=t,I.positionScreen.y*=x,M.positionScreen.x*=t,M.positionScreen.y*=x,$.positionScreen.x*=t,$.positionScreen.y*=x,E.positionScreen.copy(I.positionScreen),O.positionScreen.copy($.positionScreen),sa.overdraw&&(Pa(H.positionScreen,I.positionScreen),Pa(I.positionScreen,$.positionScreen),Pa($.positionScreen,H.positionScreen),Pa(M.positionScreen,
-E.positionScreen),Pa(M.positionScreen,O.positionScreen)),T.addPoint(H.positionScreen.x,H.positionScreen.y),T.addPoint(I.positionScreen.x,I.positionScreen.y),T.addPoint(M.positionScreen.x,M.positionScreen.y),T.addPoint($.positionScreen.x,$.positionScreen.y),K.intersects(T))){Ia=0;for(Qa=sa.meshMaterials.length;Ia<Qa;)if(za=sa.meshMaterials[Ia++],za instanceof THREE.MeshFaceMaterial){Xa=0;for($a=sa.faceMaterials.length;Xa<$a;)(za=sa.faceMaterials[Xa++])&&za.opacity!=0&&B(H,I,M,$,E,O,sa,za,b)}else za.opacity!=
-0&&B(H,I,M,$,E,O,sa,za,b)}S.addRectangle(T)}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&&($.sub(h.position,e.centroidWorld),$.normalize(),m=e.normalWorld.dot($)*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,t){k.info.render.vertices+=3;k.info.render.faces++;Q=f(W++);
-Q.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?(N.r=P.r,N.g=P.g,N.b=P.b,b(t,o,N),G.r=Math.max(0,Math.min(n.color.r*N.r,1)),G.g=Math.max(0,Math.min(n.color.g*N.g,1)),G.b=Math.max(0,Math.min(n.color.b*N.b,1))):G.copy(n.color):n instanceof THREE.MeshDepthMaterial?(M=1-n.__2near/(n.__farPlusNear-
-o.z*n.__farMinusNear),G.setRGB(M,M,M)):n instanceof THREE.MeshNormalMaterial&&G.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));n.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+n.wireframeLinewidth+"; stroke-opacity: "+n.opacity+"; stroke-linecap: "+n.wireframeLinecap+"; stroke-linejoin: "+n.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+n.opacity);p.appendChild(Q)}function e(e,c,m,o,n,t,v){k.info.render.vertices+=
-4;k.info.render.faces++;Q=f(W++);Q.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");t instanceof THREE.MeshBasicMaterial?G.copy(t.color):t instanceof THREE.MeshLambertMaterial?F?(N.r=P.r,N.g=P.g,N.b=P.b,b(v,n,N),G.r=Math.max(0,Math.min(t.color.r*N.r,1)),G.g=Math.max(0,Math.min(t.color.g*N.g,1)),G.b=Math.max(0,Math.min(t.color.b*N.b,1))):
-G.copy(t.color):t instanceof THREE.MeshDepthMaterial?(M=1-t.__2near/(t.__farPlusNear-n.z*t.__farMinusNear),G.setRGB(M,M,M)):t instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));t.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+
-"; fill-opacity: "+t.opacity);p.appendChild(Q)}function f(b){E[b]==null&&(E[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),o==0&&E[b].setAttribute("shape-rendering","crispEdges"));return E[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,p=document.createElementNS("http://www.w3.org/2000/svg","svg"),u,w,t,x,v,z,y,A,B=new THREE.Rectangle,D=new THREE.Rectangle,F=!1,G=new THREE.Color(16777215),N=new THREE.Color(16777215),P=new THREE.Color(0),
-H=new THREE.Color(0),I=new THREE.Color(0),M,$=new THREE.Vector3,E=[],O=[],Q,W,X,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);B.set(-t,-x,t,x)};this.clear=function(){for(;p.childNodes.length>0;)p.removeChild(p.childNodes[0])};
-this.render=function(b,f){var h,u,w,G,N,E,M,U;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);X=W=0;if(F=b.lights.length>0){M=b.lights;P.setRGB(0,0,0);H.setRGB(0,0,0);I.setRGB(0,0,0);h=0;for(u=M.length;h<u;h++)w=M[h],G=w.color,w instanceof THREE.AmbientLight?(P.r+=G.r,P.g+=G.g,P.b+=G.b):w instanceof THREE.DirectionalLight?(H.r+=G.r,H.g+=G.g,H.b+=G.b):w instanceof THREE.PointLight&&(I.r+=G.r,I.g+=G.g,I.b+=G.b)}h=0;for(u=m.length;h<
-u;h++)if(M=m[h],D.empty(),M instanceof THREE.RenderableParticle){v=M;v.x*=t;v.y*=-x;w=0;for(G=M.materials.length;w<G;)w++}else if(M instanceof THREE.RenderableLine){if(v=M.v1,z=M.v2,v.positionScreen.x*=t,v.positionScreen.y*=-x,z.positionScreen.x*=t,z.positionScreen.y*=-x,D.addPoint(v.positionScreen.x,v.positionScreen.y),D.addPoint(z.positionScreen.x,z.positionScreen.y),B.intersects(D)){w=0;for(G=M.materials.length;w<G;)if((U=M.materials[w++])&&U.opacity!=0){N=v;E=z;var Y=X++;O[Y]==null&&(O[Y]=document.createElementNS("http://www.w3.org/2000/svg",
-"line"),o==0&&O[Y].setAttribute("shape-rendering","crispEdges"));Q=O[Y];Q.setAttribute("x1",N.positionScreen.x);Q.setAttribute("y1",N.positionScreen.y);Q.setAttribute("x2",E.positionScreen.x);Q.setAttribute("y2",E.positionScreen.y);U instanceof THREE.LineBasicMaterial&&(Q.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(Q))}}}else if(M instanceof
-THREE.RenderableFace3){if(v=M.v1,z=M.v2,y=M.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,D.addPoint(v.positionScreen.x,v.positionScreen.y),D.addPoint(z.positionScreen.x,z.positionScreen.y),D.addPoint(y.positionScreen.x,y.positionScreen.y),B.intersects(D)){w=0;for(G=M.meshMaterials.length;w<G;)if(U=M.meshMaterials[w++],U instanceof THREE.MeshFaceMaterial){N=0;for(E=M.faceMaterials.length;N<E;)(U=M.faceMaterials[N++])&&
-U.opacity!=0&&c(v,z,y,M,U,b)}else U&&U.opacity!=0&&c(v,z,y,M,U,b)}}else if(M instanceof THREE.RenderableFace4&&(v=M.v1,z=M.v2,y=M.v3,A=M.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,A.positionScreen.x*=t,A.positionScreen.y*=-x,D.addPoint(v.positionScreen.x,v.positionScreen.y),D.addPoint(z.positionScreen.x,z.positionScreen.y),D.addPoint(y.positionScreen.x,y.positionScreen.y),D.addPoint(A.positionScreen.x,A.positionScreen.y),
-B.intersects(D))){w=0;for(G=M.meshMaterials.length;w<G;)if(U=M.meshMaterials[w++],U instanceof THREE.MeshFaceMaterial){N=0;for(E=M.faceMaterials.length;N<E;)(U=M.faceMaterials[N++])&&U.opacity!=0&&e(v,z,y,A,M,U,b)}else U&&U.opacity!=0&&e(v,z,y,A,M,U,b)}}};
+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,
+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,
+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==
+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,
+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.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)}}};
 THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform int combine;\n#endif",
 THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform int combine;\n#endif",
 envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[ 0 ].xyz, objectMatrix[ 1 ].xyz, objectMatrix[ 2 ].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",
 envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[ 0 ].xyz, objectMatrix[ 1 ].xyz, objectMatrix[ 2 ].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",
 map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform vec4 offsetRepeat;\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",map_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif",
 map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform vec4 offsetRepeat;\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",map_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif",
@@ -221,120 +220,120 @@ 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.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,
 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}"}};
 "}"].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,T;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")T=f.value[index];f.size===2?(f.array[t]=T.x,f.array[t+1]=T.y):f.size===3?f.type==="c"?(f.array[t]=T.r,f.array[t+1]=T.g,f.array[t+2]=T.b):(f.array[t]=T.x,f.array[t+1]=T.y,f.array[t+2]=T.z):(f.array[t]=
-T.x,f.array[t+1]=T.y,f.array[t+2]=T.z,f.array[t+3]=T.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")T=f.value[h];f.size===2?(f.array[t]=
-T.x,f.array[t+1]=T.y):f.size===3?f.type==="c"?(f.array[t]=T.r,f.array[t+1]=T.g,f.array[t+2]=T.b):(f.array[t]=T.x,f.array[t+1]=T.y,f.array[t+2]=T.z):(f.array[t]=T.x,f.array[t+1]=T.y,f.array[t+2]=T.z,f.array[t+3]=T.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||X.initMaterial(f,e,c,k);if(f.morphTargets&&!k.__webglMorphTargetInfluences){k.__webglMorphTargetInfluences=new Float32Array(X.maxMorphTargets);for(var h=0,m=X.maxMorphTargets;h<m;h++)k.__webglMorphTargetInfluences[h]=0}var n=!1,h=f.program,m=h.uniforms,t=f.uniforms;h!=V&&(o.useProgram(h),V=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(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,T,z,A=Ga,B=A.directional.colors,S=A.directional.positions,D=A.point.colors,F=A.point.positions,G=A.point.distances,L=0,pa=0,c=p=z=0,n=e.length;c<n;c++)if(p=e[c],v=p.color,y=p.position,T=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=L*3,B[z]=v.r*T,B[z+1]=v.g*T,B[z+2]=v.b*T,S[z]=y.x,S[z+1]=y.y,S[z+2]=y.z,L+=1;else if(p instanceof THREE.SpotLight)z=L*3,B[z]=v.r*T,B[z+1]=v.g*T,B[z+2]=v.b*T,v=1/y.length(),S[z]=y.x*v,S[z+1]=y.y*v,S[z+2]=y.z*v,L+=1;else if(p instanceof THREE.PointLight)p=pa*3,D[p]=v.r*T,D[p+1]=v.g*T,D[p+2]=v.b*T,F[p]=y.x,F[p+1]=y.y,F[p+2]=y.z,G[pa]=z,pa+=1;c=L*3;for(n=B.length;c<n;c++)B[c]=0;c=pa*3;for(n=D.length;c<n;c++)D[c]=0;A.point.length=pa;A.directional.length=L;A.ambient[0]=u;A.ambient[1]=
-w;A.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(k.receiveShadow&&!f._shadowPass&&t.shadowMatrix){for(e=0;e<na.length;e++)t.shadowMatrix.value[e]=
-na[e],t.shadowMap.texture[e]=X.shadowMap[e];t.shadowDarkness.value=X.shadowMapDarkness;t.shadowBias.value=X.shadowMapBias}e=f.uniformsList;t=0;for(c=e.length;t<c;t++)if(w=h.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++)A=x*3,u._array[A]=n[x].x,u._array[A+1]=n[x].y,u._array[A+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]);I(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)):M(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])&&M(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.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]=
+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,
+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)&&
 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!=ia&&(ia=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 t=0,p=m.morphTargetForcedOrder,u=m.morphTargetInfluences;t<k.numSupportedMorphTargets&&t<p.length;)o.bindBuffer(o.ARRAY_BUFFER,h.__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<k.numSupportedMorphTargets;){for(w=0;w<y;w++)!p[w]&&u[w]>v&&(x=w,v=u[x]);o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[x]);o.vertexAttribPointer(f["morphTarget"+t],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[t]=v;p[x]=1;v=-1;t++}}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]>=
+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,
 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,
 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.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)),X.info.render.calls++,X.info.render.vertices+=h.__webglFaceCount,X.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),X.info.render.calls++):m instanceof THREE.ParticleSystem?(o.drawArrays(o.POINTS,0,h.__webglParticleCount),X.info.render.calls++):
-m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP,0,h.__webglVertexCount),X.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,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 k(b){if(oa!=b.doubleSided)b.doubleSided?o.disable(o.CULL_FACE):o.enable(o.CULL_FACE),oa=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){Y!=b&&(o.depthMask(b),Y=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||ta!=c))o.polygonOffset(e,c),ka=e,ta=c}function u(b){va[0].set(b.n41-
-b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);va[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);va[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);va[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);va[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);va[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=va[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=va[f].x*e.n14+va[f].y*e.n24+va[f].z*e.n34+va[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,p=0,v,x,y,K,z=b.lights;ua||(ua=new THREE.Camera(X.shadowCameraFov,X.shadowMapWidth/X.shadowMapHeight,X.shadowCameraNear,X.shadowCameraFar));c=0;for(n=z.length;c<n;c++)if(t=z[c],t instanceof THREE.SpotLight&&t.castShadow){aa=-1;X.shadowMap[p]||(X.shadowMap[p]=new THREE.WebGLRenderTarget(X.shadowMapWidth,X.shadowMapHeight,
-{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));na[p]||(na[p]=new THREE.Matrix4);v=X.shadowMap[p];x=na[p];ua.position.copy(t.position);ua.target.position.copy(t.target.position);ua.update(void 0,!0);b.update(void 0,!1,ua);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(ua.projectionMatrix);x.multiplySelf(ua.matrixWorldInverse);ua.matrixWorldInverse.flattenToArray(Aa);ua.projectionMatrix.flattenToArray(Ea);Da.multiply(ua.projectionMatrix,ua.matrixWorldInverse);
-u(Da);X.initWebGLObjects(b);$(v);o.clearColor(1,1,1,1);X.clear();o.clearColor(ha.r,ha.g,ha.b,ja);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),B(K,ua,!1),y.render=!0):y.render=!1:y.render=!1;m(!0);H(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:xa,f(ua,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),B(K,ua,!1),k(K),program=e(ua,z,null,xa,K),K.render(function(b){h(b,program,xa.shading)}));p++}}function A(b,e){var c,f,h;c=Z.attributes;var k=Z.uniforms,m=ra/qa,n,t=[],p=qa*0.5,v=ra*0.5,u=!0;o.useProgram(Z.program);V=Z.program;ia=U=da=-1;Ja||(o.enableVertexAttribArray(Z.attributes.position),
-o.enableVertexAttribArray(Z.attributes.uv),Ja=!0);o.disable(o.CULL_FACE);o.enable(o.BLEND);o.depthMask(!0);o.bindBuffer(o.ARRAY_BUFFER,Z.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,Z.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-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),H(h.blending),M(h.map,0),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0));o.enable(o.CULL_FACE);o.enable(o.DEPTH_TEST);o.depthMask(Y)}function B(b,e,c){b._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);c&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}function D(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 N(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 H(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 I(b,e,c){(c.width&c.width-1)==0&&(c.height&c.height-1)==0?(o.texParameteri(b,o.TEXTURE_WRAP_S,W(e.wrapS)),o.texParameteri(b,o.TEXTURE_WRAP_T,W(e.wrapT)),o.texParameteri(b,o.TEXTURE_MAG_FILTER,W(e.magFilter)),o.texParameteri(b,
-o.TEXTURE_MIN_FILTER,W(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,Q(e.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,Q(e.minFilter)))}function M(b,e){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=o.createTexture(),X.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,W(b.format),b.image.width,b.image.height,0,W(b.format),o.UNSIGNED_BYTE,b.image.data):o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,b.image);I(o.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+e),o.bindTexture(o.TEXTURE_2D,b.__webglTexture)}function $(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=
-o.createRenderbuffer();b.__webglTexture=o.createTexture();if(e){o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture);I(o.TEXTURE_CUBE_MAP,b,b);b.__webglFramebuffer=[];for(var c=0;c<6;c++)b.__webglFramebuffer[c]=o.createFramebuffer(),o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,W(b.format),b.width,b.height,0,W(b.format),W(b.type),null)}else b.__webglFramebuffer=o.createFramebuffer(),o.bindTexture(o.TEXTURE_2D,b.__webglTexture),I(o.TEXTURE_2D,b,b),o.texImage2D(o.TEXTURE_2D,0,W(b.format),b.width,b.height,
-0,W(b.format),W(b.type),null);o.bindRenderbuffer(o.RENDERBUFFER,b.__webglRenderbuffer);if(e)for(c=0;c<6;++c)o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer[c]),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+c,b.__webglTexture,0);else o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,b.__webglTexture,0);b.depthBuffer&&!b.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_COMPONENT16,
+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-
+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),
+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.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,
+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=
+o.createRenderbuffer();b.__webglTexture=o.createTexture();if(e){o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture);A(o.TEXTURE_CUBE_MAP,b,b);b.__webglFramebuffer=[];for(var c=0;c<6;c++)b.__webglFramebuffer[c]=o.createFramebuffer(),o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,V(b.format),b.width,b.height,0,V(b.format),V(b.type),null)}else b.__webglFramebuffer=o.createFramebuffer(),o.bindTexture(o.TEXTURE_2D,b.__webglTexture),A(o.TEXTURE_2D,b,b),o.texImage2D(o.TEXTURE_2D,0,V(b.format),b.width,b.height,
+0,V(b.format),V(b.type),null);o.bindRenderbuffer(o.RENDERBUFFER,b.__webglRenderbuffer);if(e)for(c=0;c<6;++c)o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer[c]),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+c,b.__webglTexture,0);else o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,b.__webglTexture,0);b.depthBuffer&&!b.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_COMPONENT16,
 b.width,b.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.RENDERBUFFER,b.__webglRenderbuffer)):b.depthBuffer&&b.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,b.width,b.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,b.__webglRenderbuffer)):o.renderbufferStorage(o.RENDERBUFFER,o.RGBA4,b.width,b.height);e?o.bindTexture(o.TEXTURE_CUBE_MAP,null):o.bindTexture(o.TEXTURE_2D,null);o.bindRenderbuffer(o.RENDERBUFFER,null);
 b.width,b.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.RENDERBUFFER,b.__webglRenderbuffer)):b.depthBuffer&&b.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,b.width,b.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,b.__webglRenderbuffer)):o.renderbufferStorage(o.RENDERBUFFER,o.RGBA4,b.width,b.height);e?o.bindTexture(o.TEXTURE_CUBE_MAP,null):o.bindTexture(o.TEXTURE_2D,null);o.bindRenderbuffer(o.RENDERBUFFER,null);
-o.bindFramebuffer(o.FRAMEBUFFER,null)}var f,h;b?(e=e?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,c=b.width,b=b.height,h=f=0):(e=null,c=qa,b=ra,f=L,h=ma);e!=la&&(o.bindFramebuffer(o.FRAMEBUFFER,e),o.viewport(f,h,c,b),la=e)}function E(b){b instanceof THREE.WebGLRenderTargetCube?(o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture),o.generateMipmap(o.TEXTURE_CUBE_MAP),o.bindTexture(o.TEXTURE_CUBE_MAP,null)):(o.bindTexture(o.TEXTURE_2D,b.__webglTexture),o.generateMipmap(o.TEXTURE_2D),o.bindTexture(o.TEXTURE_2D,
-null))}function O(b,e){var c;b=="fragment"?c=o.createShader(o.FRAGMENT_SHADER):b=="vertex"&&(c=o.createShader(o.VERTEX_SHADER));o.shaderSource(c,e);o.compileShader(c);if(!o.getShaderParameter(c,o.COMPILE_STATUS))return console.error(o.getShaderInfoLog(c)),console.error(e),null;return c}function Q(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return o.NEAREST;default:return o.LINEAR}}function W(b){switch(b){case THREE.RepeatWrapping:return o.REPEAT;
+o.bindFramebuffer(o.FRAMEBUFFER,null)}var f,h;b?(e=e?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,c=b.width,b=b.height,h=f=0):(e=null,c=ma,b=ra,f=la,h=N);e!=na&&(o.bindFramebuffer(o.FRAMEBUFFER,e),o.viewport(f,h,c,b),na=e)}function I(b){b instanceof THREE.WebGLRenderTargetCube?(o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture),o.generateMipmap(o.TEXTURE_CUBE_MAP),o.bindTexture(o.TEXTURE_CUBE_MAP,null)):(o.bindTexture(o.TEXTURE_2D,b.__webglTexture),o.generateMipmap(o.TEXTURE_2D),o.bindTexture(o.TEXTURE_2D,
+null))}function O(b,e){var c;b=="fragment"?c=o.createShader(o.FRAGMENT_SHADER):b=="vertex"&&(c=o.createShader(o.VERTEX_SHADER));o.shaderSource(c,e);o.compileShader(c);if(!o.getShaderParameter(c,o.COMPILE_STATUS))return console.error(o.getShaderInfoLog(c)),console.error(e),null;return c}function X(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return o.NEAREST;default:return o.LINEAR}}function V(b){switch(b){case THREE.RepeatWrapping:return o.REPEAT;
 case THREE.ClampToEdgeWrapping:return o.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return o.MIRRORED_REPEAT;case THREE.NearestFilter:return o.NEAREST;case THREE.NearestMipMapNearestFilter:return o.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return o.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return o.LINEAR;case THREE.LinearMipMapNearestFilter:return o.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return o.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return o.BYTE;
 case THREE.ClampToEdgeWrapping:return o.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return o.MIRRORED_REPEAT;case THREE.NearestFilter:return o.NEAREST;case THREE.NearestMipMapNearestFilter:return o.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return o.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return o.LINEAR;case THREE.LinearMipMapNearestFilter:return o.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return o.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return o.BYTE;
-case THREE.UnsignedByteType:return o.UNSIGNED_BYTE;case THREE.ShortType:return o.SHORT;case THREE.UnsignedShortType:return o.UNSIGNED_SHORT;case THREE.IntType:return o.INT;case THREE.UnsignedShortType:return o.UNSIGNED_INT;case THREE.FloatType:return o.FLOAT;case THREE.AlphaFormat:return o.ALPHA;case THREE.RGBFormat:return o.RGB;case THREE.RGBAFormat:return o.RGBA;case THREE.LuminanceFormat:return o.LUMINANCE;case THREE.LuminanceAlphaFormat:return o.LUMINANCE_ALPHA}return 0}var X=this,o,ea=[],V=null,
-la=null,aa=-1,ia=null,ca=0,oa=null,fa=null,da=null,U=null,Y=null,ga=null,ka=null,ta=null,L=0,ma=0,qa=0,ra=0,va=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Da=new THREE.Matrix4,Ea=new Float32Array(16),Aa=new Float32Array(16),Ca=new THREE.Vector4,Ga={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},K=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
-S=b.stencil!==void 0?b.stencil:!0,T=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,pa=b.antialias!==void 0?b.antialias:!1,ha=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),ja=b.clearAlpha!==void 0?b.clearAlpha:0,ya=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=K;this.sortObjects=this.autoClear=!0;this.shadowMapBias=0.0039;this.shadowMapDarkness=
-0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=!0;var ua,na=[],b=THREE.ShaderLib.depthRGBA,wa=THREE.UniformsUtils.clone(b.uniforms),xa=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:wa}),Ka=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:wa,morphTargets:!0});xa._shadowPass=
-!0;Ka._shadowPass=!0;try{if(!(o=K.getContext("experimental-webgl",{antialias:pa,stencil:S,preserveDrawingBuffer:T})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+o.getParameter(o.VERSION)+" | "+o.getParameter(o.VENDOR)+" | "+o.getParameter(o.RENDERER)+" | "+o.getParameter(o.SHADING_LANGUAGE_VERSION))}catch(Ba){console.error(Ba)}o.clearColor(0,0,0,1);o.clearDepth(1);o.clearStencil(0);o.enable(o.DEPTH_TEST);o.depthFunc(o.LEQUAL);o.frontFace(o.CCW);o.cullFace(o.BACK);o.enable(o.CULL_FACE);
-o.enable(o.BLEND);o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA);o.clearColor(ha.r,ha.g,ha.b,ja);this.context=o;var Ha=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,Z={};Z.vertices=new Float32Array(16);Z.faces=new Uint16Array(6);S=0;Z.vertices[S++]=-1;Z.vertices[S++]=-1;Z.vertices[S++]=0;Z.vertices[S++]=1;Z.vertices[S++]=1;Z.vertices[S++]=-1;Z.vertices[S++]=1;Z.vertices[S++]=1;Z.vertices[S++]=1;Z.vertices[S++]=1;Z.vertices[S++]=1;Z.vertices[S++]=0;Z.vertices[S++]=
--1;Z.vertices[S++]=1;Z.vertices[S++]=0;S=Z.vertices[S++]=0;Z.faces[S++]=0;Z.faces[S++]=1;Z.faces[S++]=2;Z.faces[S++]=0;Z.faces[S++]=2;Z.faces[S++]=3;Z.vertexBuffer=o.createBuffer();Z.elementBuffer=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,Z.vertexBuffer);o.bufferData(o.ARRAY_BUFFER,Z.vertices,o.STATIC_DRAW);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,Z.elementBuffer);o.bufferData(o.ELEMENT_ARRAY_BUFFER,Z.faces,o.STATIC_DRAW);Z.program=o.createProgram();o.attachShader(Z.program,O("fragment",THREE.ShaderLib.sprite.fragmentShader));
-o.attachShader(Z.program,O("vertex",THREE.ShaderLib.sprite.vertexShader));o.linkProgram(Z.program);Z.attributes={};Z.uniforms={};Z.attributes.position=o.getAttribLocation(Z.program,"position");Z.attributes.uv=o.getAttribLocation(Z.program,"uv");Z.uniforms.uvOffset=o.getUniformLocation(Z.program,"uvOffset");Z.uniforms.uvScale=o.getUniformLocation(Z.program,"uvScale");Z.uniforms.rotation=o.getUniformLocation(Z.program,"rotation");Z.uniforms.scale=o.getUniformLocation(Z.program,"scale");Z.uniforms.alignment=
-o.getUniformLocation(Z.program,"alignment");Z.uniforms.color=o.getUniformLocation(Z.program,"color");Z.uniforms.map=o.getUniformLocation(Z.program,"map");Z.uniforms.opacity=o.getUniformLocation(Z.program,"opacity");Z.uniforms.useScreenCoordinates=o.getUniformLocation(Z.program,"useScreenCoordinates");Z.uniforms.affectedByDistance=o.getUniformLocation(Z.program,"affectedByDistance");Z.uniforms.screenPosition=o.getUniformLocation(Z.program,"screenPosition");Z.uniforms.modelViewMatrix=o.getUniformLocation(Z.program,
-"modelViewMatrix");Z.uniforms.projectionMatrix=o.getUniformLocation(Z.program,"projectionMatrix");var Ja=!1;this.setSize=function(b,e){K.width=b;K.height=e;this.setViewport(0,0,K.width,K.height)};this.setViewport=function(b,e,c,f){L=b;ma=e;qa=c;ra=f;o.viewport(L,ma,qa,ra)};this.setScissor=function(b,e,c,f){o.scissor(b,e,c,f)};this.enableScissorTest=function(b){b?o.enable(o.SCISSOR_TEST):o.disable(o.SCISSOR_TEST)};this.setClearColorHex=function(b,e){ha.setHex(b);ja=e;o.clearColor(ha.r,ha.g,ha.b,ja)};
-this.setClearColor=function(b,e){ha.copy(b);ja=e;o.clearColor(ha.r,ha.g,ha.b,ja)};this.getClearColor=function(){return ha};this.getClearAlpha=function(){return ja};this.clear=function(){o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT|o.STENCIL_BUFFER_BIT)};this.getContext=function(){return o};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var e=
+case THREE.UnsignedByteType:return o.UNSIGNED_BYTE;case THREE.ShortType:return o.SHORT;case THREE.UnsignedShortType:return o.UNSIGNED_SHORT;case THREE.IntType:return o.INT;case THREE.UnsignedShortType:return o.UNSIGNED_INT;case THREE.FloatType:return o.FLOAT;case THREE.AlphaFormat:return o.ALPHA;case THREE.RGBFormat:return o.RGB;case THREE.RGBAFormat:return o.RGBA;case THREE.LuminanceFormat:return o.LUMINANCE;case THREE.LuminanceAlphaFormat:return o.LUMINANCE_ALPHA}return 0}var W=this,o,ea=[],T=null,
+na=null,aa=-1,ha=null,ca=0,qa=null,fa=null,da=null,U=null,$=null,ga=null,ka=null,ua=null,la=0,N=0,ma=0,ra=0,wa=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Da=new THREE.Matrix4,Ea=new Float32Array(16),Aa=new Float32Array(16),Ca=new THREE.Vector4,Ga={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},K=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
+R=b.stencil!==void 0?b.stencil:!0,S=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,ja=b.antialias!==void 0?b.antialias:!1,oa=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),ia=b.clearAlpha!==void 0?b.clearAlpha:0,sa=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=K;this.sortObjects=this.autoClear=!0;this.shadowMapBias=0.0039;this.shadowMapDarkness=
+0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=!0;var va,pa=[],b=THREE.ShaderLib.depthRGBA,xa=THREE.UniformsUtils.clone(b.uniforms),ya=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:xa}),Ka=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:xa,morphTargets:!0});ya._shadowPass=
+!0;Ka._shadowPass=!0;try{if(!(o=K.getContext("experimental-webgl",{antialias:ja,stencil:R,preserveDrawingBuffer:S})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+o.getParameter(o.VERSION)+" | "+o.getParameter(o.VENDOR)+" | "+o.getParameter(o.RENDERER)+" | "+o.getParameter(o.SHADING_LANGUAGE_VERSION))}catch(Ba){console.error(Ba)}o.clearColor(0,0,0,1);o.clearDepth(1);o.clearStencil(0);o.enable(o.DEPTH_TEST);o.depthFunc(o.LEQUAL);o.frontFace(o.CCW);o.cullFace(o.BACK);o.enable(o.CULL_FACE);
+o.enable(o.BLEND);o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA);o.clearColor(oa.r,oa.g,oa.b,ia);this.context=o;var Ha=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,Y={};Y.vertices=new Float32Array(16);Y.faces=new Uint16Array(6);R=0;Y.vertices[R++]=-1;Y.vertices[R++]=-1;Y.vertices[R++]=0;Y.vertices[R++]=1;Y.vertices[R++]=1;Y.vertices[R++]=-1;Y.vertices[R++]=1;Y.vertices[R++]=1;Y.vertices[R++]=1;Y.vertices[R++]=1;Y.vertices[R++]=1;Y.vertices[R++]=0;Y.vertices[R++]=
+-1;Y.vertices[R++]=1;Y.vertices[R++]=0;R=Y.vertices[R++]=0;Y.faces[R++]=0;Y.faces[R++]=1;Y.faces[R++]=2;Y.faces[R++]=0;Y.faces[R++]=2;Y.faces[R++]=3;Y.vertexBuffer=o.createBuffer();Y.elementBuffer=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,Y.vertexBuffer);o.bufferData(o.ARRAY_BUFFER,Y.vertices,o.STATIC_DRAW);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,Y.elementBuffer);o.bufferData(o.ELEMENT_ARRAY_BUFFER,Y.faces,o.STATIC_DRAW);Y.program=o.createProgram();o.attachShader(Y.program,O("fragment",THREE.ShaderLib.sprite.fragmentShader));
+o.attachShader(Y.program,O("vertex",THREE.ShaderLib.sprite.vertexShader));o.linkProgram(Y.program);Y.attributes={};Y.uniforms={};Y.attributes.position=o.getAttribLocation(Y.program,"position");Y.attributes.uv=o.getAttribLocation(Y.program,"uv");Y.uniforms.uvOffset=o.getUniformLocation(Y.program,"uvOffset");Y.uniforms.uvScale=o.getUniformLocation(Y.program,"uvScale");Y.uniforms.rotation=o.getUniformLocation(Y.program,"rotation");Y.uniforms.scale=o.getUniformLocation(Y.program,"scale");Y.uniforms.alignment=
+o.getUniformLocation(Y.program,"alignment");Y.uniforms.color=o.getUniformLocation(Y.program,"color");Y.uniforms.map=o.getUniformLocation(Y.program,"map");Y.uniforms.opacity=o.getUniformLocation(Y.program,"opacity");Y.uniforms.useScreenCoordinates=o.getUniformLocation(Y.program,"useScreenCoordinates");Y.uniforms.affectedByDistance=o.getUniformLocation(Y.program,"affectedByDistance");Y.uniforms.screenPosition=o.getUniformLocation(Y.program,"screenPosition");Y.uniforms.modelViewMatrix=o.getUniformLocation(Y.program,
+"modelViewMatrix");Y.uniforms.projectionMatrix=o.getUniformLocation(Y.program,"projectionMatrix");var Ja=!1;this.setSize=function(b,e){K.width=b;K.height=e;this.setViewport(0,0,K.width,K.height)};this.setViewport=function(b,e,c,f){la=b;N=e;ma=c;ra=f;o.viewport(la,N,ma,ra)};this.setScissor=function(b,e,c,f){o.scissor(b,e,c,f)};this.enableScissorTest=function(b){b?o.enable(o.SCISSOR_TEST):o.disable(o.SCISSOR_TEST)};this.setClearColorHex=function(b,e){oa.setHex(b);ia=e;o.clearColor(oa.r,oa.g,oa.b,ia)};
+this.setClearColor=function(b,e){oa.copy(b);ia=e;o.clearColor(oa.r,oa.g,oa.b,ia)};this.getClearColor=function(){return oa};this.getClearAlpha=function(){return ia};this.clear=function(){o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT|o.STENCIL_BUFFER_BIT)};this.getContext=function(){return o};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var e=
 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=
 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]);X.info.memory.geometries--}else if(b instanceof THREE.Ribbon)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),X.info.memory.geometries--;else if(b instanceof THREE.Line)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),X.info.memory.geometries--;else if(b instanceof THREE.ParticleSystem)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),
-X.info.memory.geometries--};this.deallocateTexture=function(b){if(b.__webglInit)b.__webglInit=!1,o.deleteTexture(b.__webglTexture),X.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 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<=ya?p=u:(p=Math.ceil(ya*u/(t+u)),t=ya-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?
+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?
 "#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");
 "#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":"",
 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+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});X.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){$(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,T,S,D,F,G,L,I,pa=b.lights,M=b.fog;aa=-1;this.shadowMapEnabled&&y(b,c);X.info.render.calls=0;X.info.render.vertices=0;X.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);$(o);
-(this.autoClear||t)&&this.clear();F=b.__webglObjects.length;for(t=0;t<F;t++)if(K=b.__webglObjects[t],L=K.object,L.visible)if(!(L instanceof THREE.Mesh)||!L.frustumCulled||w(L)){if(L.matrixWorld.flattenToArray(L._objectMatrixArray),B(L,c,!0),v(K),K.render=!0,this.sortObjects)K.object.renderDepth?K.z=K.object.renderDepth:(Ca.copy(L.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],L=K.object,L.visible&&(L.matrixAutoUpdate&&L.matrixWorld.flattenToArray(L._objectMatrixArray),B(L,c,!0),x(K));if(b.overrideMaterial){m(b.overrideMaterial.depthTest);H(b.overrideMaterial.blending);for(t=0;t<F;t++)if(K=b.__webglObjects[t],K.render)L=K.object,I=K.buffer,k(L),f(c,pa,M,b.overrideMaterial,I,L);for(t=0;t<G;t++)K=b.__webglObjectsImmediate[t],L=K.object,L.visible&&(k(L),T=e(c,pa,M,b.overrideMaterial,L),L.render(function(e){h(e,T,b.overrideMaterial.shading)}))}else{H(THREE.NormalBlending);
-for(t=F-1;t>=0;t--)if(K=b.__webglObjects[t],K.render){L=K.object;I=K.buffer;S=K.opaque;k(L);for(K=0;K<S.count;K++)D=S.list[K],m(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),f(c,pa,M,D,I,L)}for(t=0;t<G;t++)if(K=b.__webglObjectsImmediate[t],L=K.object,L.visible){S=K.opaque;k(L);for(K=0;K<S.count;K++)D=S.list[K],m(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),T=e(c,pa,M,D,L),L.render(function(b){h(b,T,D.shading)})}for(t=
-0;t<F;t++)if(K=b.__webglObjects[t],K.render){L=K.object;I=K.buffer;S=K.transparent;k(L);for(K=0;K<S.count;K++)D=S.list[K],H(D.blending),m(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),f(c,pa,M,D,I,L)}for(t=0;t<G;t++)if(K=b.__webglObjectsImmediate[t],L=K.object,L.visible){S=K.transparent;k(L);for(K=0;K<S.count;K++)D=S.list[K],H(D.blending),m(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),T=e(c,pa,M,D,L),L.render(function(b){h(b,
-T,D.shading)})}}b.__webglSprites.length&&A(b,c);o&&o.minFilter!==THREE.NearestFilter&&o.minFilter!==THREE.LinearFilter&&E(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&&N(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 t=void 0,p=void 0;n.__webglMorphTargetsBuffers=[];t=0;for(p=n.numMorphTargets;t<p;t++)n.__webglMorphTargetsBuffers.push(o.createBuffer())}X.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=t=0,T=x=v=void 0,x=p=T=v=u=void 0,w=n.geometry,K=w.faces,T=
-m.faces,u=0,v=T.length;u<v;u++)x=T[u],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 u=m,v=n,A=T=K=void 0,S=void 0,A=void 0,x=[],K=0,T=v.materials.length;K<T;K++)if(A=v.materials[K],A instanceof THREE.MeshFaceMaterial){A=0;for(l=u.materials.length;A<l;A++)(S=u.materials[A])&&x.push(S)}else(S=A)&&x.push(S);u=x;m.__materials=u;a:{K=v=void 0;T=u.length;for(v=0;v<T;v++)if(K=u[v],K.map||K.lightMap||K instanceof THREE.ShaderMaterial){v=!0;break a}v=!1}a:{T=
-K=void 0;x=u.length;for(K=0;K<x;K++)if(T=u[K],!(T instanceof THREE.MeshBasicMaterial&&!T.envMap||T instanceof THREE.MeshDepthMaterial)){T=T&&T.shading!=void 0&&T.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}T=!1}a:{x=K=void 0;A=u.length;for(K=0;K<A;K++)if(x=u[K],x.vertexColors){x=x.vertexColors;break a}x=!1}m.__vertexArray=new Float32Array(t*3);if(T)m.__normalArray=new Float32Array(t*3);if(w.hasTangents)m.__tangentArray=new Float32Array(t*4);if(x)m.__colorArray=new Float32Array(t*
-3);if(v){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=T==THREE.SmoothShading;m.__uvType=v;m.__vertexColorType=x;m.__normalType=T;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];
-T={};for(p in x)T[p]=x[p];if(!T.__webglInitialized||T.createUniqueBuffers)T.__webglInitialized=!0,y=1,T.type==="v2"?y=2:T.type==="v3"?y=3:T.type==="v4"?y=4:T.type==="c"&&(y=3),T.size=y,T.array=new Float32Array(t*y),T.buffer=o.createBuffer(),T.buffer.belongsToAttribute=a,x.needsUpdate=!0,T.__original=x;m.__webglCustomAttributes[a]=T}}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(),X.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(),X.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();X.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||
+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);
+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);
+(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,
+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
+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||
 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 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,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=D(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 B=u=w=void 0,L=void 0,I=B=void 0,pa=void 0,M=void 0,ja=void 0,H=S=A=x=T=K=v=void 0,ha=void 0,ma=void 0,J=L=ja=L=M=pa=void 0,C=void 0,E=C=J=pa=void 0,Y=void 0,qa=E=C=J=B=B=I=ja=L=E=C=J=Y=E=C=J=Y=E=C=J=void 0,U=0,O=0,ra=0,V=0,ya=0,Z=0,Q=0,$=0,na=0,R=0,W=0,E=J=0,E=void 0,ga=p.__vertexArray,ua=p.__uvArray,va=p.__uv2Array,ka=p.__normalArray,ia=p.__tangentArray,da=p.__colorArray,
-ca=p.__skinVertexAArray,aa=p.__skinVertexBArray,ea=p.__skinIndexArray,fa=p.__skinWeightArray,oa=p.__morphTargetsArrays,xa=p.__webglCustomAttributes,C=void 0,ta=p.__faceArray,wa=p.__lineArray,Da=p.__needsSmoothNormals,K=p.__vertexColorType,v=p.__uvType,T=p.__normalType,la=k.geometry,Ea=la.__dirtyVertices,Ba=la.__dirtyElements,Aa=la.__dirtyUvs,Ha=la.__dirtyNormals,Ka=la.__dirtyTangents,Ca=la.__dirtyColors,Ga=la.__dirtyMorphTargets,Ja=la.vertices,cb=p.faces,fb=la.faces,db=la.faceVertexUvs[0],eb=la.faceVertexUvs[1],
-Sa=la.skinVerticesA,Ta=la.skinVerticesB,Ua=la.skinIndices,Ma=la.skinWeights,La=la.morphTargets;if(xa)for(qa in xa)xa[qa].offset=0,xa[qa].offsetSrc=0;w=0;for(u=cb.length;w<u;w++)if(B=cb[w],L=fb[B],db&&(x=db[B]),eb&&(A=eb[B]),B=L.vertexNormals,I=L.normal,pa=L.vertexColors,M=L.color,ja=L.vertexTangents,L instanceof THREE.Face3){if(Ea)S=Ja[L.a].position,H=Ja[L.b].position,ha=Ja[L.c].position,ga[O]=S.x,ga[O+1]=S.y,ga[O+2]=S.z,ga[O+3]=H.x,ga[O+4]=H.y,ga[O+5]=H.z,ga[O+6]=ha.x,ga[O+7]=ha.y,ga[O+8]=ha.z,O+=
-9;if(xa)for(qa in xa)if(C=xa[qa],C.__original.needsUpdate)J=C.offset,E=C.offsetSrc,C.size===1?(C.boundTo===void 0||C.boundTo==="vertices"?(C.array[J]=C.value[L.a],C.array[J+1]=C.value[L.b],C.array[J+2]=C.value[L.c]):C.boundTo==="faces"?(E=C.value[E],C.array[J]=E,C.array[J+1]=E,C.array[J+2]=E,C.offsetSrc++):C.boundTo==="faceVertices"&&(C.array[J]=C.value[E],C.array[J+1]=C.value[E+1],C.array[J+2]=C.value[E+2],C.offsetSrc+=3),C.offset+=3):(C.boundTo===void 0||C.boundTo==="vertices"?(S=C.value[L.a],H=
-C.value[L.b],ha=C.value[L.c]):C.boundTo==="faces"?(ha=H=S=E=C.value[E],C.offsetSrc++):C.boundTo==="faceVertices"&&(S=C.value[E],H=C.value[E+1],ha=C.value[E+2],C.offsetSrc+=3),C.size===2?(C.array[J]=S.x,C.array[J+1]=S.y,C.array[J+2]=H.x,C.array[J+3]=H.y,C.array[J+4]=ha.x,C.array[J+5]=ha.y,C.offset+=6):C.size===3?(C.type==="c"?(C.array[J]=S.r,C.array[J+1]=S.g,C.array[J+2]=S.b,C.array[J+3]=H.r,C.array[J+4]=H.g,C.array[J+5]=H.b,C.array[J+6]=ha.r,C.array[J+7]=ha.g,C.array[J+8]=ha.b):(C.array[J]=S.x,C.array[J+
-1]=S.y,C.array[J+2]=S.z,C.array[J+3]=H.x,C.array[J+4]=H.y,C.array[J+5]=H.z,C.array[J+6]=ha.x,C.array[J+7]=ha.y,C.array[J+8]=ha.z),C.offset+=9):(C.array[J]=S.x,C.array[J+1]=S.y,C.array[J+2]=S.z,C.array[J+3]=S.w,C.array[J+4]=H.x,C.array[J+5]=H.y,C.array[J+6]=H.z,C.array[J+7]=H.w,C.array[J+8]=ha.x,C.array[J+9]=ha.y,C.array[J+10]=ha.z,C.array[J+11]=ha.w,C.offset+=12));if(Ga){J=0;for(C=La.length;J<C;J++)S=La[J].vertices[L.a].position,H=La[J].vertices[L.b].position,ha=La[J].vertices[L.c].position,E=oa[J],
-E[W]=S.x,E[W+1]=S.y,E[W+2]=S.z,E[W+3]=H.x,E[W+4]=H.y,E[W+5]=H.z,E[W+6]=ha.x,E[W+7]=ha.y,E[W+8]=ha.z;W+=9}if(Ma.length)J=Ma[L.a],C=Ma[L.b],E=Ma[L.c],fa[R]=J.x,fa[R+1]=J.y,fa[R+2]=J.z,fa[R+3]=J.w,fa[R+4]=C.x,fa[R+5]=C.y,fa[R+6]=C.z,fa[R+7]=C.w,fa[R+8]=E.x,fa[R+9]=E.y,fa[R+10]=E.z,fa[R+11]=E.w,J=Ua[L.a],C=Ua[L.b],E=Ua[L.c],ea[R]=J.x,ea[R+1]=J.y,ea[R+2]=J.z,ea[R+3]=J.w,ea[R+4]=C.x,ea[R+5]=C.y,ea[R+6]=C.z,ea[R+7]=C.w,ea[R+8]=E.x,ea[R+9]=E.y,ea[R+10]=E.z,ea[R+11]=E.w,J=Sa[L.a],C=Sa[L.b],E=Sa[L.c],ca[R]=
-J.x,ca[R+1]=J.y,ca[R+2]=J.z,ca[R+3]=1,ca[R+4]=C.x,ca[R+5]=C.y,ca[R+6]=C.z,ca[R+7]=1,ca[R+8]=E.x,ca[R+9]=E.y,ca[R+10]=E.z,ca[R+11]=1,J=Ta[L.a],C=Ta[L.b],E=Ta[L.c],aa[R]=J.x,aa[R+1]=J.y,aa[R+2]=J.z,aa[R+3]=1,aa[R+4]=C.x,aa[R+5]=C.y,aa[R+6]=C.z,aa[R+7]=1,aa[R+8]=E.x,aa[R+9]=E.y,aa[R+10]=E.z,aa[R+11]=1,R+=12;if(Ca&&K)pa.length==3&&K==THREE.VertexColors?(L=pa[0],J=pa[1],C=pa[2]):C=J=L=M,da[na]=L.r,da[na+1]=L.g,da[na+2]=L.b,da[na+3]=J.r,da[na+4]=J.g,da[na+5]=J.b,da[na+6]=C.r,da[na+7]=C.g,da[na+8]=C.b,na+=
-9;if(Ka&&la.hasTangents)pa=ja[0],M=ja[1],L=ja[2],ia[Q]=pa.x,ia[Q+1]=pa.y,ia[Q+2]=pa.z,ia[Q+3]=pa.w,ia[Q+4]=M.x,ia[Q+5]=M.y,ia[Q+6]=M.z,ia[Q+7]=M.w,ia[Q+8]=L.x,ia[Q+9]=L.y,ia[Q+10]=L.z,ia[Q+11]=L.w,Q+=12;if(Ha&&T)if(B.length==3&&Da)for(ja=0;ja<3;ja++)I=B[ja],ka[Z]=I.x,ka[Z+1]=I.y,ka[Z+2]=I.z,Z+=3;else for(ja=0;ja<3;ja++)ka[Z]=I.x,ka[Z+1]=I.y,ka[Z+2]=I.z,Z+=3;if(Aa&&x!==void 0&&v)for(ja=0;ja<3;ja++)B=x[ja],ua[ra]=B.u,ua[ra+1]=B.v,ra+=2;if(Aa&&A!==void 0&&v)for(ja=0;ja<3;ja++)B=A[ja],va[V]=B.u,va[V+
-1]=B.v,V+=2;Ba&&(ta[ya]=U,ta[ya+1]=U+1,ta[ya+2]=U+2,ya+=3,wa[$]=U,wa[$+1]=U+1,wa[$+2]=U,wa[$+3]=U+2,wa[$+4]=U+1,wa[$+5]=U+2,$+=6,U+=3)}else if(L instanceof THREE.Face4){if(Ea)S=Ja[L.a].position,H=Ja[L.b].position,ha=Ja[L.c].position,ma=Ja[L.d].position,ga[O]=S.x,ga[O+1]=S.y,ga[O+2]=S.z,ga[O+3]=H.x,ga[O+4]=H.y,ga[O+5]=H.z,ga[O+6]=ha.x,ga[O+7]=ha.y,ga[O+8]=ha.z,ga[O+9]=ma.x,ga[O+10]=ma.y,ga[O+11]=ma.z,O+=12;if(xa)for(qa in xa)if(C=xa[qa],C.__original.needsUpdate)J=C.offset,E=C.offsetSrc,C.size===1?
-(C.boundTo===void 0||C.boundTo==="vertices"?(C.array[J]=C.value[L.a],C.array[J+1]=C.value[L.b],C.array[J+2]=C.value[L.c],C.array[J+3]=C.value[L.d]):C.boundTo==="faces"?(E=C.value[E],C.array[J]=E,C.array[J+1]=E,C.array[J+2]=E,C.array[J+3]=E,C.offsetSrc++):C.boundTo==="faceVertices"&&(C.array[J]=C.value[E],C.array[J+1]=C.value[E+1],C.array[J+2]=C.value[E+2],C.array[J+3]=C.value[E+3],C.offsetSrc+=4),C.offset+=4):(C.boundTo===void 0||C.boundTo==="vertices"?(S=C.value[L.a],H=C.value[L.b],ha=C.value[L.c],
-ma=C.value[L.d]):C.boundTo==="faces"?(ma=ha=H=S=E=C.value[E],C.offsetSrc++):C.boundTo==="faceVertices"&&(S=C.value[E],H=C.value[E+1],ha=C.value[E+2],ma=C.value[E+3],C.offsetSrc+=4),C.size===2?(C.array[J]=S.x,C.array[J+1]=S.y,C.array[J+2]=H.x,C.array[J+3]=H.y,C.array[J+4]=ha.x,C.array[J+5]=ha.y,C.array[J+6]=ma.x,C.array[J+7]=ma.y,C.offset+=8):C.size===3?(C.type==="c"?(C.array[J]=S.r,C.array[J+1]=S.g,C.array[J+2]=S.b,C.array[J+3]=H.r,C.array[J+4]=H.g,C.array[J+5]=H.b,C.array[J+6]=ha.r,C.array[J+7]=
-ha.g,C.array[J+8]=ha.b,C.array[J+9]=ma.r,C.array[J+10]=ma.g,C.array[J+11]=ma.b):(C.array[J]=S.x,C.array[J+1]=S.y,C.array[J+2]=S.z,C.array[J+3]=H.x,C.array[J+4]=H.y,C.array[J+5]=H.z,C.array[J+6]=ha.x,C.array[J+7]=ha.y,C.array[J+8]=ha.z,C.array[J+9]=ma.x,C.array[J+10]=ma.y,C.array[J+11]=ma.z),C.offset+=12):(C.array[J]=S.x,C.array[J+1]=S.y,C.array[J+2]=S.z,C.array[J+3]=S.w,C.array[J+4]=H.x,C.array[J+5]=H.y,C.array[J+6]=H.z,C.array[J+7]=H.w,C.array[J+8]=ha.x,C.array[J+9]=ha.y,C.array[J+10]=ha.z,C.array[J+
-11]=ha.w,C.array[J+12]=ma.x,C.array[J+13]=ma.y,C.array[J+14]=ma.z,C.array[J+15]=ma.w,C.offset+=16));if(Ga){J=0;for(C=La.length;J<C;J++)S=La[J].vertices[L.a].position,H=La[J].vertices[L.b].position,ha=La[J].vertices[L.c].position,ma=La[J].vertices[L.d].position,E=oa[J],E[W]=S.x,E[W+1]=S.y,E[W+2]=S.z,E[W+3]=H.x,E[W+4]=H.y,E[W+5]=H.z,E[W+6]=ha.x,E[W+7]=ha.y,E[W+8]=ha.z,E[W+9]=ma.x,E[W+10]=ma.y,E[W+11]=ma.z;W+=12}if(Ma.length)J=Ma[L.a],C=Ma[L.b],E=Ma[L.c],Y=Ma[L.d],fa[R]=J.x,fa[R+1]=J.y,fa[R+2]=J.z,fa[R+
-3]=J.w,fa[R+4]=C.x,fa[R+5]=C.y,fa[R+6]=C.z,fa[R+7]=C.w,fa[R+8]=E.x,fa[R+9]=E.y,fa[R+10]=E.z,fa[R+11]=E.w,fa[R+12]=Y.x,fa[R+13]=Y.y,fa[R+14]=Y.z,fa[R+15]=Y.w,J=Ua[L.a],C=Ua[L.b],E=Ua[L.c],Y=Ua[L.d],ea[R]=J.x,ea[R+1]=J.y,ea[R+2]=J.z,ea[R+3]=J.w,ea[R+4]=C.x,ea[R+5]=C.y,ea[R+6]=C.z,ea[R+7]=C.w,ea[R+8]=E.x,ea[R+9]=E.y,ea[R+10]=E.z,ea[R+11]=E.w,ea[R+12]=Y.x,ea[R+13]=Y.y,ea[R+14]=Y.z,ea[R+15]=Y.w,J=Sa[L.a],C=Sa[L.b],E=Sa[L.c],Y=Sa[L.d],ca[R]=J.x,ca[R+1]=J.y,ca[R+2]=J.z,ca[R+3]=1,ca[R+4]=C.x,ca[R+5]=C.y,
-ca[R+6]=C.z,ca[R+7]=1,ca[R+8]=E.x,ca[R+9]=E.y,ca[R+10]=E.z,ca[R+11]=1,ca[R+12]=Y.x,ca[R+13]=Y.y,ca[R+14]=Y.z,ca[R+15]=1,J=Ta[L.a],C=Ta[L.b],E=Ta[L.c],L=Ta[L.d],aa[R]=J.x,aa[R+1]=J.y,aa[R+2]=J.z,aa[R+3]=1,aa[R+4]=C.x,aa[R+5]=C.y,aa[R+6]=C.z,aa[R+7]=1,aa[R+8]=E.x,aa[R+9]=E.y,aa[R+10]=E.z,aa[R+11]=1,aa[R+12]=L.x,aa[R+13]=L.y,aa[R+14]=L.z,aa[R+15]=1,R+=16;if(Ca&&K)pa.length==4&&K==THREE.VertexColors?(L=pa[0],J=pa[1],C=pa[2],pa=pa[3]):pa=C=J=L=M,da[na]=L.r,da[na+1]=L.g,da[na+2]=L.b,da[na+3]=J.r,da[na+
-4]=J.g,da[na+5]=J.b,da[na+6]=C.r,da[na+7]=C.g,da[na+8]=C.b,da[na+9]=pa.r,da[na+10]=pa.g,da[na+11]=pa.b,na+=12;if(Ka&&la.hasTangents)pa=ja[0],M=ja[1],L=ja[2],ja=ja[3],ia[Q]=pa.x,ia[Q+1]=pa.y,ia[Q+2]=pa.z,ia[Q+3]=pa.w,ia[Q+4]=M.x,ia[Q+5]=M.y,ia[Q+6]=M.z,ia[Q+7]=M.w,ia[Q+8]=L.x,ia[Q+9]=L.y,ia[Q+10]=L.z,ia[Q+11]=L.w,ia[Q+12]=ja.x,ia[Q+13]=ja.y,ia[Q+14]=ja.z,ia[Q+15]=ja.w,Q+=16;if(Ha&&T)if(B.length==4&&Da)for(ja=0;ja<4;ja++)I=B[ja],ka[Z]=I.x,ka[Z+1]=I.y,ka[Z+2]=I.z,Z+=3;else for(ja=0;ja<4;ja++)ka[Z]=I.x,
-ka[Z+1]=I.y,ka[Z+2]=I.z,Z+=3;if(Aa&&x!==void 0&&v)for(ja=0;ja<4;ja++)B=x[ja],ua[ra]=B.u,ua[ra+1]=B.v,ra+=2;if(Aa&&A!==void 0&&v)for(ja=0;ja<4;ja++)B=A[ja],va[V]=B.u,va[V+1]=B.v,V+=2;Ba&&(ta[ya]=U,ta[ya+1]=U+1,ta[ya+2]=U+3,ta[ya+3]=U+1,ta[ya+4]=U+2,ta[ya+5]=U+3,ya+=6,wa[$]=U,wa[$+1]=U+1,wa[$+2]=U,wa[$+3]=U+3,wa[$+4]=U+1,wa[$+5]=U+2,wa[$+6]=U+2,wa[$+7]=U+3,$+=8,U+=4)}Ea&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,ga,y));if(xa)for(qa in xa)C=xa[qa],C.__original.needsUpdate&&
-(o.bindBuffer(o.ARRAY_BUFFER,C.buffer),o.bufferData(o.ARRAY_BUFFER,C.array,y));if(Ga){J=0;for(C=La.length;J<C;J++)o.bindBuffer(o.ARRAY_BUFFER,p.__webglMorphTargetsBuffers[J]),o.bufferData(o.ARRAY_BUFFER,oa[J],y)}Ca&&na>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&&la.hasTangents&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglTangentBuffer),o.bufferData(o.ARRAY_BUFFER,ia,
-y));Aa&&ra>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglUVBuffer),o.bufferData(o.ARRAY_BUFFER,ua,y));Aa&&V>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglUV2Buffer),o.bufferData(o.ARRAY_BUFFER,va,y));Ba&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,ta,y),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,wa,y));R>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;u=k.vertices;t=k.colors;v=u.length;p=t.length;K=k.__vertexArray;y=k.__colorArray;T=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(T){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;u=k.vertices;t=k.colors;v=u.length;p=t.length;K=k.__vertexArray;y=k.__colorArray;
-T=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(T){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=D(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}};
+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;
+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+
+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]=
+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):(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.array[H+9]=oa.x,D.array[H+10]=oa.y,D.array[H+11]=oa.z),D.offset+=12):(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.array[H+12]=oa.x,D.array[H+13]=oa.y,D.array[H+14]=oa.z,D.array[H+15]=oa.w,D.offset+=16));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,oa=La[H].vertices[A.d].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,N[V+9]=oa.x,N[V+10]=oa.y,N[V+11]=oa.z;V+=12}if(Ma.length)H=Ma[A.a],D=Ma[A.b],N=Ma[A.c],O=Ma[A.d],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,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}};
 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.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.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};
 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};
@@ -344,19 +343,19 @@ THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new
 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.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 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},
 clamp:function(b,c,e){return b<c?c:b>e?e:b}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
 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,p=b.faces,u=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=u.length;t<x;t++){var v=u[t],z,y,A=v.vertexNormals,
-B=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=A.length;m<n;m++)y=A[m].clone(),f&&f.multiplyVector3(y),z.vertexNormals.push(y);z.color.copy(v.color);m=0;for(n=B.length;m<n;m++)y=B[m],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=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],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(m=w.length;f<m;f++)u=w[f],p.vertexNormals.push(u.clone());p.color.copy(n.color);f=0;for(m=t.length;f<m;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=k.length;b<e;b++){h=k[b];p=[];f=0;for(m=h.length;f<m;f++)p.push(new THREE.UV(h[f].u,h[f].v));c.faceVertexUvs[0].push(p)}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();
+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,
 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 u[h]>
-b?e(c,h-1):u[h]<b?e(h+1,f):h}return e(0,u.length-1)}var f,h,k=b.faces,m=b.vertices,n=k.length,p=0,u=[],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;p+=f._area;
-u[h]=p}f=[];m={};for(h=0;h<c;h++)n=THREE.GeometryUtils.random()*p,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*
+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*
 (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;
 (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]+
 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,p=m.createImageData(f,h),u=p.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,A=[],B=[0,0,n[(t*f+w)*4]/255*c];A.push([-1,0,n[(t*f+z)*4]/255*c]);A.push([-1,-1,n[(x*f+z)*4]/255*c]);A.push([0,-1,n[(x*f+w)*4]/255*c]);A.push([1,-1,n[(x*f+y)*4]/255*c]);
-A.push([1,0,n[(t*f+y)*4]/255*c]);A.push([1,1,n[(v*f+y)*4]/255*c]);A.push([0,1,n[(v*f+w)*4]/255*c]);A.push([-1,1,n[(v*f+z)*4]/255*c]);x=[];z=A.length;for(v=0;v<z;v++){var y=A[v],D=A[(v+1)%z],y=[y[0]-B[0],y[1]-B[1],y[2]-B[2]],D=[D[0]-B[0],D[1]-B[1],D[2]-B[2]];x.push(e([y[1]*D[2]-y[2]*D[1],y[2]*D[0]-y[0]*D[2],y[0]*D[1]-y[1]*D[0]]))}A=[0,0,0];for(v=0;v<x.length;v++)A[0]+=x[v][0],A[1]+=x[v][1],A[2]+=x[v][2];A[0]/=x.length;A[1]/=x.length;A[2]/=x.length;B=(t*f+w)*4;u[B]=(A[0]+1)/2*255|0;u[B+1]=(A[1]+0.5)*
-255|0;u[B+2]=A[2]*255|0;u[B+3]=255}m.putImageData(p,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)}};
+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)}};
 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}",
 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}"},
 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",
 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",
@@ -366,7 +365,7 @@ THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:"attribute vec4 tang
 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}"}}};
 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=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.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,p;m<=n;)if(f=Math.floor(m+(n-m)/2),p=e[f]-k,p<0)m=f+1;else if(p>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.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.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.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.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=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;
@@ -384,47 +383,47 @@ THREE.SplineCurve3=THREE.Curve.create(function(b){this.points=b},function(b){var
 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=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.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.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,p;p=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;p.addSelf(k.x,k.y)}return{minX:f,minY:h,maxX:c,maxY:e,centroid:p.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,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.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.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.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,p;f=0;for(h=b.length;f<h;f++)k=b[f],m=k.x,n=k.y,p=m/e.maxX,p=c.getUtoTmapping(p,m),m=c.getPoint(p),n=c.getNormalVector(p).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.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.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.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.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.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.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.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.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.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,p,u,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];p=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,
-p),e.push(new THREE.Vector2(k,y));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];p=k[5];t=k[0];x=k[1];u=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,u,n),y=THREE.Shape.Utils.b3(y,z,x,w,p),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];p=k[1];u=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 A=b*2;for(m=1;m<=A;m++)y=m/A,x||(y=1-y),y=t+y*z,k=w+n+u*Math.cos(y),y=v+p+u*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,p,u,w,t;n=0;for(p=m.length;n<p;n++)u=m[n],w=u.x,t=u.y,u.x=b*w+c*t+e,u.y=f*t+h*w+k;return m};
+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=
 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()};
 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=
 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)};
 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.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.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.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,p,u,w,t,x,v,z=[];for(p=0;p<c.length;p++){u=c[p];Array.prototype.push.apply(f,u);k=Number.POSITIVE_INFINITY;for(h=0;h<u.length;h++){x=u[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:u.length-1;var y=[u[m],e[n],e[h]];t=THREE.FontUtils.Triangulate.area(y);var A=[u[m],u[k],e[n]];x=THREE.FontUtils.Triangulate.area(A);v=n;w=m;n+=1;m+=-1;n<
-0&&(n+=e.length);n%=e.length;m<0&&(m+=u.length);m%=u.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:u.length-1;y=[u[m],e[n],e[h]];y=THREE.FontUtils.Triangulate.area(y);A=[u[m],u[k],e[n]];A=THREE.FontUtils.Triangulate.area(A);t+x>y+A&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=u.length),m%=u.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:u.length-1);t=e.slice(0,n);x=e.slice(n);v=u.slice(m);w=u.slice(0,m);k=[u[m],u[k],e[n]];z.push([u[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,p,u={};k=0;for(m=f.length;k<m;k++)p=f[k].x+":"+f[k].y,u[p]!==void 0&&console.log("Duplicate point",p),u[p]=k;k=0;for(m=e.length;k<m;k++){n=e[k];for(f=0;f<3;f++)p=n[f].x+":"+n[f].y,p=u[p],p!==void 0&&(n[f]=p)}k=0;for(m=h.length;k<m;k++){n=h[k];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(h)},
+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)+
 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};
 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.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.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<
 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 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*
+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*
 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=
 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};
 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.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.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.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 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.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,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];m=p.prevKey[e];n=p.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)}p.prevKey[e]=m;p.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]=
+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===
 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][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=[],h,k,m,n,p,u;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]];p=b[e[2]];u=b[e[3]];e=h*h;m=h*e;f[0]=this.interpolate(k[0],n[0],p[0],u[0],h,e,m);f[1]=this.interpolate(k[1],n[1],p[1],u[1],h,e,m);f[2]=this.interpolate(k[2],n[2],p[2],u[2],h,e,m);return f};
+"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.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.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.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=
 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=
@@ -442,7 +441,7 @@ this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this
 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*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()},
 !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;
 !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.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(),p=m.length,D=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++)D=f*n.chunks[k]/n.total,e.keys[k]={time:D,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(),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,
 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,
 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=
 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;
 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;
@@ -450,7 +449,7 @@ if(b.createDebugDummy!==void 0)this.createDebugDummy=b.createDebugDummy;if(b.loo
 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,
 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;
 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;
 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&&
 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),p=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(n,b);b=new THREE.Mesh(p,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}),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=
 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;
 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=
 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)};
 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)};
@@ -462,195 +461,195 @@ b;this.tdiff=(b-this.lastUpdate)/1E3;this.lastUpdate=b;var b=this.tdiff*this.mov
 !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=
 !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.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;
 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,p=!1,u=1,w=0,t=0,x=0,v=0,z=0,y=window.innerWidth/2,A=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();
+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);
 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);
 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.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){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",
-function(b){v=(b.clientX-y)/window.innerWidth;z=(b.clientY-A)/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: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;
+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;
 THREE.RollCamera.prototype.supr=THREE.Camera.prototype;
 THREE.RollCamera.prototype.supr=THREE.Camera.prototype;
-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,h=new THREE.Vector3,k=new THREE.Vector3,m=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);h=this.position.clone().subSelf(this.target.position);f=this.up.clone().setLength(c.y);f.addSelf(this.up.clone().crossSelf(h).setLength(c.x));f.addSelf(h.setLength(c.z));return f};
-this.rotateCamera=function(){var b=Math.acos(k.dot(m)/k.length()/m.length());if(b){var e=(new THREE.Vector3).cross(k,m).normalize(),c=new THREE.Quaternion;b*=this.rotateSpeed;c.setFromAxisAngle(e,-b);c.multiplyVector3(h);c.multiplyVector3(this.up);c.multiplyVector3(m);this.staticMoving?k=m:(c.setFromAxisAngle(e,b*(this.dynamicDampingFactor-1)),c.multiplyVector3(k))}};this.zoomCamera=function(){var b=1+(p.y-n.y)*this.zoomSpeed;b!==1&&b>0&&(h.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(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?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),
+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",
 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=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?m=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?k=m=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=
+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=
 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;
 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.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,p){function u(b,c,e,m,n,p,t,u){var v,x,y=f||1,z=h||1,O=n/2,Q=p/2,W=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 X=y+1,o=z+1;n/=y;var ea=p/z;for(x=0;x<o;x++)for(p=0;p<X;p++){var V=new THREE.Vector3;V[b]=(p*n-O)*e;V[c]=(x*ea-Q)*m;V[v]=t;w.vertices.push(new THREE.Vertex(V))}for(x=0;x<z;x++)for(p=0;p<y;p++)w.faces.push(new THREE.Face4(p+X*
-x+W,p+X*(x+1)+W,p+1+X*(x+1)+W,p+1+X*x+W,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(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]);THREE.Geometry.prototype.mergeVertices.call(this);this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;
+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.prototype.constructor=THREE.CubeGeometry;
 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,p,u=[],w=[];for(p=0;p<=h;p++){var t=[],x=[],v=p/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))}u.push(t);w.push(x)}for(p=0;p<h;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(),A=this.vertices[x].position.clone().setY(0).normalize(),B=this.vertices[v].position.clone().setY(0).normalize(),D=w[p][n].clone(),F=w[p+1][n].clone(),G=w[p+1][n+1].clone(),N=w[p][n+1].clone();this.faces.push(new THREE.Face4(e,t,x,v,[z,y,A,B]));this.faceVertexUvs[0].push([D,F,G,N])}if(!k&&b>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,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),A=new THREE.Vector3(0,1,0),D=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,A])),this.faceVertexUvs[0].push([D,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=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),A=new THREE.Vector3(0,-1,0),D=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,A])),this.faceVertexUvs[0].push([D,F,G])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
+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(),
+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,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.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();
 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(E=b.length;--E>=0;){oa=E;fa=E-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+oa+f,m=da+oa+h,o=k,f=da+fa+f,h=da+fa+h,t=m;o+=$;f+=$;h+=$;t+=$;M.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=(M.vertices[k].position.z+p)/h,m=(M.vertices[m].position.z+p)/h,M.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){M.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}function m(b,c,e){b+=$;c+=$;e+=$;M.faces.push(new THREE.Face3(b,
-c,e,null,null,F));if(F){var f=N.maxY,h=N.maxX,k=M.vertices[c].position.x,c=M.vertices[c].position.y,m=M.vertices[e].position.x,e=M.vertices[e].position.y;M.faceVertexUvs[0].push([new THREE.UV(M.vertices[b].position.x/h,M.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,A,B=!1,D=c.useSpacedPoints!==void 0?c.useSpacedPoints:!1,F=c.material,G=c.extrudeMaterial,N=this.shapebb;if(y)A=y.getPoints(x),v=A.length,B=!0,t=!1;t||(u=p=w=0);var P,H,I,M=this,$=this.vertices.length;z&&b.addWrapPath(z);x=D?b.extractAllSpacedPoints(x):b.extractAllPoints(x);z=x.shape;x=x.holes;if(y=!THREE.Shape.Utils.isClockWise(z)){z=z.reverse();H=0;for(I=x.length;H<I;H++)P=x[H],THREE.Shape.Utils.isClockWise(P)&&
-(x[H]=P.reverse());y=!1}y=THREE.Shape.Utils.triangulateShape(z,x);D=z;H=0;for(I=x.length;H<I;H++)P=x[H],z=z.concat(P);var E,O,Q,W,X,o,ea=z.length,V=y.length,la=[];E=0;O=D.length;oa=O-1;for(fa=E+1;E<O;E++,oa++,fa++)oa==O&&(oa=0),fa==O&&(fa=0),la[E]=f(D[E],D[oa],D[fa]);var aa=[],ia,ca=la.concat();H=0;for(I=x.length;H<I;H++){P=x[H];ia=[];E=0;O=P.length;oa=O-1;for(fa=E+1;E<O;E++,oa++,fa++)oa==O&&(oa=0),fa==O&&(fa=0),ia[E]=f(P[E],P[oa],P[fa]);aa.push(ia);ca=ca.concat(ia)}for(Q=0;Q<w;Q++){W=Q/w;X=p*(1-
-W);W=u*Math.sin(W*Math.PI/2);E=0;for(O=D.length;E<O;E++)o=e(D[E],la[E],W),k(o.x,o.y,-X);H=0;for(I=x.length;H<I;H++){P=x[H];ia=aa[H];E=0;for(O=P.length;E<O;E++)o=e(P[E],ia[E],W),k(o.x,o.y,-X)}}W=u;for(E=0;E<ea;E++)o=t?e(z[E],ca[E],W):z[E],B?k(o.x,o.y+A[0].y,A[0].x):k(o.x,o.y,0);for(Q=1;Q<=v;Q++)for(E=0;E<ea;E++)o=t?e(z[E],ca[E],W):z[E],B?k(o.x,o.y+A[Q-1].y,A[Q-1].x):k(o.x,o.y,n/v*Q);for(Q=w-1;Q>=0;Q--){W=Q/w;X=p*(1-W);W=u*Math.sin(W*Math.PI/2);E=0;for(O=D.length;E<O;E++)o=e(D[E],la[E],W),k(o.x,o.y,
-n+X);H=0;for(I=x.length;H<I;H++){P=x[H];ia=aa[H];E=0;for(O=P.length;E<O;E++)o=e(P[E],ia[E],W),B?k(o.x,o.y+A[v-1].y,A[v-1].x+X):k(o.x,o.y,n+X)}}if(t){t=ea*0;for(E=0;E<V;E++)u=y[E],m(u[2]+t,u[1]+t,u[0]+t);t=ea*(v+w*2);for(E=0;E<V;E++)u=y[E],m(u[0]+t,u[1]+t,u[2]+t)}else{for(E=0;E<V;E++)u=y[E],m(u[2],u[1],u[0]);for(E=0;E<V;E++)u=y[E],m(u[0]+ea*v,u[1]+ea*v,u[2]+ea*v)}var oa,fa,da=0;h(D);da+=D.length;H=0;for(I=x.length;H<I;H++)P=x[H],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 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;
 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.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||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,h=b.vertices,k=b.faces,m=h.concat(),n=[],p={},u=[],w=!1,t,x,v,z,y;y=b.faceVertexUvs[0];var A;t=0;for(x=y.length;t<x;t++){v=0;for(z=y[t].length;v<z;v++)A=k[t]["abcd".charAt(v)],u[A]||(u[A]=y[t][v])}this.materials=b.materials;var B;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&&u.length!=0){B=new THREE.UV;if(y instanceof THREE.Face3)B.u=u[y.a].u+u[y.b].u+u[y.c].u,B.v=u[y.a].v+u[y.b].v+u[y.c].v,B.u/=3,B.v/=3;else if(y instanceof THREE.Face4)B.u=u[y.a].u+u[y.b].u+u[y.c].u+u[y.d].u,B.v=u[y.a].v+u[y.b].v+u[y.c].v+u[y.d].v,B.u/=4,B.v/=4;u.push(B)}b.computeEdgeFaces();var D,b=b.vfMap,F=0;z=h.length;for(t in b)if(y=b[t],y=y.array,B=y[0],y=y[1],D=new THREE.Vector3,D.addSelf(n[B]),D.addSelf(n[y]),
-A=t.split("_"),x=A[0],A=A[1],D.addSelf(h[x].position),D.addSelf(h[A].position),D.multiplyScalar(0.25),p[t]=z+k.length+F,m.push(new THREE.Vertex(D)),F++,w&&u.length!=0)B=new THREE.UV,B.u=u[x].u+u[A].u,B.v=u[x].v+u[A].v,B.u/=2,B.v/=2,u.push(B);var G;t=0;for(x=n.length;t<x;t++)y=k[t],A=z+t,y instanceof THREE.Face3?(F=e(y.a,y.b),B=e(y.b,y.c),D=e(y.c,y.a),c(A,p[F],y.b,p[B]),c(A,p[B],y.c,p[D]),c(A,p[D],y.a,p[F])):y instanceof THREE.Face4?(F=e(y.a,y.b),B=e(y.b,y.c),D=e(y.c,y.d),G=e(y.d,y.a),c(A,p[F],y.b,
-p[B]),c(A,p[B],y.c,p[D]),c(A,p[D],y.d,p[G]),c(A,p[G],y.a,p[F])):console.log("face should be a face!",y);f.vertices=m;var N={},P={},k=function(b,c){N[b]===void 0&&(N[b]=[]);N[b].push(c)},m=function(b,c){P[b]===void 0&&(P[b]={});P[b][c]=null};for(t in b)y=b[t],A=t.split("_"),x=A[0],A=A[1],k(x,[x,A]),k(A,[x,A]),y=y.array,B=y[0],y=y[1],m(x,B),m(x,y),m(A,B),m(A,y);k=new THREE.Vector3;m=new THREE.Vector3;t=0;for(x=h.length;t<x;t++)if(N[t]!==void 0){k.set(0,0,0);m.set(0,0,0);p=new THREE.Vector3(0,0,0);b=
-0;for(v in P[t])k.addSelf(n[v]),b++;k.divideScalar(b);b=N[t].length;for(v=0;v<b;v++)y=N[t][v],z=h[y[0]].position.clone().addSelf(h[y[1]].position).divideScalar(2),m.addSelf(z);m.divideScalar(b);p.addSelf(h[t].position);p.multiplyScalar(b-3);p.addSelf(k);p.addSelf(m.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.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,
 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 p=f(k.faces[n].a,k.faces[n].b),u=f(k.faces[n].b,k.faces[n].c),w=f(k.faces[n].c,k.faces[n].a);e(k.faces[n].a,p,w,b);e(k.faces[n].b,u,
-p,b);e(k.faces[n].c,w,u,b);e(p,u,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 p=0;p<=this.angle+0.0010;p+=c){for(n=0;n<e.length;n++)p<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;p==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-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=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,p=f+1;b/=e;var u=c/f;for(h=0;h<p;h++)for(c=0;c<n;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-k,-(h*u-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()};
+-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.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
 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),p=b*Math.sin(f*h),u=[],w=0;for(f=0;f<k;f++){var t=2*f/k,x=p*Math.sin(t*h),t=p*Math.cos(t*h);(e==0||e==m)&&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,h=c.length,e=0;e<h;e++)if(k=c[e].length,e>0)for(f=0;f<k;f++){u=f==k-1;m=c[e][u?0:f+1];n=c[e][u?k-1:f];p=c[e-1][u?
-k-1:f];u=c[e-1][u?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),A=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[p].position.clone(),v.normalize(),z.normalize(),y.normalize(),this.faces.push(new THREE.Face3(m,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[m].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(m,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,A]))}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,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.prototype.constructor=THREE.SphereGeometry;
 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=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.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=
 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,p,u,w,t,x,v,z,y,A=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(A){if(A.o){c=A._cachedOutline||(A._cachedOutline=A.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;k.push(new THREE.Vector2(n,
-u));h.moveTo(n,u);break;case "l":n=c[b++]*e+f;u=c[b++]*e;k.push(new THREE.Vector2(n,u));h.lineTo(n,u);break;case "q":n=c[b++]*e+f;u=c[b++]*e;x=c[b++]*e+f;v=c[b++]*e;h.quadraticCurveTo(x,v,n,u);if(m=k[k.length-1]){w=m.x;t=m.y;m=1;for(divisions=this.divisions;m<=divisions;m++){var B=m/divisions,D=THREE.Shape.Utils.b2(B,w,x,n),B=THREE.Shape.Utils.b2(B,t,v,u);k.push(new THREE.Vector2(D,B))}}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,h.bezierCurveTo(n,u,
-x,v,z,y),m=k[k.length-1]){w=m.x;t=m.y;m=1;for(divisions=this.divisions;m<=divisions;m++)B=m/divisions,D=THREE.Shape.Utils.b3(B,w,x,z,n),B=THREE.Shape.Utils.b3(B,t,v,y,u),k.push(new THREE.Vector2(D,B))}}}return{offset:A.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=[],p,u,w;if(c(b)>0)for(u=0;u<h;u++)m[u]=u;else for(u=0;u<h;u++)m[u]=h-1-u;var t=2*h;for(u=h-1;h>2;){if(t--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}p=u;h<=p&&(p=0);u=p+1;h<=u&&(u=0);w=u+1;h<=w&&(w=0);var x;a:{x=b;var v=p,z=u,y=w,A=h,B=m,D=void 0,F=void 0,G=void 0,
-N=void 0,P=void 0,H=void 0,I=void 0,M=void 0,$=void 0,F=x[B[v]].x,G=x[B[v]].y,N=x[B[z]].x,P=x[B[z]].y,H=x[B[y]].x,I=x[B[y]].y;if(1.0E-10>(N-F)*(I-G)-(P-G)*(H-F))x=!1;else{for(D=0;D<A;D++)if(!(D==v||D==z||D==y)){var M=x[B[D]].x,$=x[B[D]].y,E=void 0,O=void 0,Q=void 0,W=void 0,X=void 0,o=void 0,ea=void 0,V=void 0,la=void 0,aa=void 0,ia=void 0,ca=void 0,E=Q=X=void 0,E=H-N,O=I-P,Q=F-H,W=G-I,X=N-F,o=P-G,ea=M-F,V=$-G,la=M-N,aa=$-P,ia=M-H,ca=$-I,E=E*aa-O*la,X=X*V-o*ea,Q=Q*ca-W*ia;if(E>=0&&Q>=0&&X>=0){x=!1;
-break a}}x=!0}}if(x){k.push([b[m[p]],b[m[u]],b[m[w]]]);n.push([m[p],m[u],m[w]]);p=u;for(w=u+1;w<h;p++,w++)m[p]=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};
+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,
+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=
 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,p=new THREE.Face4(h,k,m,n,[c[h],c[k],c[m],c[n]]);p.normal.addSelf(c[h]);p.normal.addSelf(c[k]);p.normal.addSelf(c[m]);p.normal.addSelf(c[n]);p.normal.normalize();this.faces.push(p);
+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;
 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,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=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 p=b/this.segmentsR*2*this.p*Math.PI,m=c/this.segmentsT*2*Math.PI,h=n(p,m,this.q,this.p,this.radius,this.heightScale),p=n(p+0.01,m,this.q,this.p,this.radius,this.heightScale);e.x=p.x-h.x;e.y=p.y-h.y;e.z=p.z-h.z;f.x=p.x+h.x;f.y=p.y+h.y;f.z=p.z+h.z;k.cross(e,f);f.cross(k,e);k.normalize();f.normalize();p=-this.tube*Math.cos(m);m=this.tube*Math.sin(m);h.x+=p*f.x+m*k.x;h.y+=p*f.y+m*k.y;h.z+=p*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),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(h,e,f,k));this.faceVertexUvs[0].push([m,p,u,w])}this.computeCentroids();
+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();
 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(){}};
 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";
 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,
 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,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 k(b){return(b[0]*255<<16)+(b[1]*255<<8)+b[2]*255}var m,n,p;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"));
+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);
 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);
 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 u=THREE.ShaderUtils.lib.normal,w=THREE.UniformsUtils.clone(u.uniforms),t=m.color;n=m.specular;p=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(p);w.uShininess.value=x;if(m.opacity)w.uOpacity.value=m.opacity;m=new THREE.ShaderMaterial({fragmentShader:u.fragmentShader,vertexShader:u.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;
+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;
 THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
 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),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()};
 c.postMessage(b)};
 c.postMessage(b)};
-THREE.BinaryLoader.prototype.loadAjaxBuffers=function(b,c,e,f,h,k){var m=new XMLHttpRequest,n=f+"/"+b,p=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&&(p==0&&(p=m.getResponseHeader("Content-Length")),k({total:p,loaded:m.responseText.length})):m.readyState==2&&(p=m.getResponseHeader("Content-Length"))};m.open("GET",n,!0);m.overrideMimeType("text/plain; charset=x-user-defined");
+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)};
 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 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,k;e=h(b,c);f=h(b,c+P);k=h(b,c+H);c=p(b,c+I);B.faces.push(new THREE.Face3(e,f,k,null,null,B.materials[c]))}function x(c){var e,f,k,m,o,t;e=h(b,c);f=h(b,c+P);k=h(b,c+H);m=p(b,c+I);o=h(b,c+M);t=h(b,c+$);c=h(b,c+E);m=B.materials[m];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];B.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(u,v,t),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+Q);m=h(b,
-c+W);c=p(b,c+X);B.faces.push(new THREE.Face4(e,f,k,m,null,null,B.materials[c]))}function z(c){var e,f,k,m,t,u,v,w;e=h(b,c);f=h(b,c+O);k=h(b,c+Q);m=h(b,c+W);t=p(b,c+X);u=h(b,c+o);v=h(b,c+ea);w=h(b,c+V);c=h(b,c+la);t=B.materials[t];var x=G[v*3],K=G[v*3+1];v=G[v*3+2];var y=G[w*3],T=G[w*3+1];w=G[w*3+2];var z=G[c*3],A=G[c*3+1],c=G[c*3+2];B.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,K,v),new THREE.Vector3(y,T,w),new THREE.Vector3(z,A,c)],null,t))}
-function y(c){var e,f,k,m;e=h(b,c);f=h(b,c+aa);k=h(b,c+ia);c=N[e*2];m=N[e*2+1];e=N[f*2];var o=B.faceVertexUvs[0];f=N[f*2+1];var p=N[k*2];k=N[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 A(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+ca);k=h(b,c+oa);m=h(b,c+fa);c=N[e*2];o=N[e*2+1];e=N[f*2];p=N[f*2+1];f=N[k*2];var t=B.faceVertexUvs[0];k=N[k*2+1];var u=N[m*2];m=N[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 B=this,D=0,F,G=[],N=[],P,H,I,M,$,E,O,Q,W,X,o,ea,V,la,aa,ia,ca,oa,fa,da,U,Y,ga,ka,ta;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(B,f,c);F={signature:b.substr(D,8),header_bytes:w(b,D+8),vertex_coordinate_bytes:w(b,D+9),normal_coordinate_bytes:w(b,D+10),uv_coordinate_bytes:w(b,D+11),vertex_index_bytes:w(b,D+12),normal_index_bytes:w(b,D+13),uv_index_bytes:w(b,D+14),material_index_bytes:w(b,D+15),nvertices:h(b,D+16),nnormals:h(b,D+16+4),nuvs:h(b,
-D+16+8),ntri_flat:h(b,D+16+12),ntri_smooth:h(b,D+16+16),ntri_flat_uv:h(b,D+16+20),ntri_smooth_uv:h(b,D+16+24),nquad_flat:h(b,D+16+28),nquad_smooth:h(b,D+16+32),nquad_flat_uv:h(b,D+16+36),nquad_smooth_uv:h(b,D+16+40)};D+=F.header_bytes;P=F.vertex_index_bytes;H=F.vertex_index_bytes*2;I=F.vertex_index_bytes*3;M=F.vertex_index_bytes*3+F.material_index_bytes;$=F.vertex_index_bytes*3+F.material_index_bytes+F.normal_index_bytes;E=F.vertex_index_bytes*3+F.material_index_bytes+F.normal_index_bytes*2;O=F.vertex_index_bytes;
-Q=F.vertex_index_bytes*2;W=F.vertex_index_bytes*3;X=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;V=F.vertex_index_bytes*4+F.material_index_bytes+F.normal_index_bytes*2;la=F.vertex_index_bytes*4+F.material_index_bytes+F.normal_index_bytes*3;aa=F.uv_index_bytes;ia=F.uv_index_bytes*2;ca=F.uv_index_bytes;oa=F.uv_index_bytes*2;fa=F.uv_index_bytes*3;c=F.vertex_index_bytes*3+F.material_index_bytes;ta=F.vertex_index_bytes*
-4+F.material_index_bytes;da=F.ntri_flat*c;U=F.ntri_smooth*(c+F.normal_index_bytes*3);Y=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*ta;c=F.nquad_smooth*(ta+F.normal_index_bytes*4);ta=F.nquad_flat_uv*(ta+F.uv_index_bytes*4);D+=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),B.vertices.push(new THREE.Vertex(new THREE.Vector3(f,
-h,k)));return F.nvertices*n}(D);D+=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}(D);D+=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),N.push(f,h);return F.nuvs*k}(D);da=D+da;U=da+U;Y=U+Y;ga=Y+ga;ka=ga+ka;c=ka+c;ta=c+ta;(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})(Y);(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),A(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),A(c+e);return h-b})(ta);(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})(D);(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,
+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;
+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,
+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()};h.prototype=new THREE.Geometry;h.prototype.constructor=h;c(new h(e))};
-THREE.ColladaLoader=function(){function b(b,c,e){for(var b=da.evaluate(b,da,V,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 L)for(var h=L[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=ma[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=Y.getChildById(f.skeleton[0],!0)||Y.getChildBySid(f.skeleton[0],
+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=[];
 !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 A=o.weights[y][z];A.joint==v&&p.weights.push(A)}}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=ma[b.controllers[m].url];switch(n.type){case "skin":if(qa[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(ma[n.skin.source]&&(k=n=ma[n.skin.source],n.morph&&qa[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(qa[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=qa[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=va[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=ma[e.url],o.skinInstanceController=e,o.name="skin_"+Ca.length,Ca.push(o);else if(k!==void 0){p=n;t=k instanceof x?ma[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=qa[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 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 A(b){this.geometry=b.id;this.primitives=[];this.geometry3js=this.vertices=null}function B(){}function D(){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 N(){this.semantic="";this.offset=0;this.source="";this.set=0}function P(b){this.id=b;this.type=null}function H(){this.name=this.id="";this.instance_effect=null}function I(){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 M(b,c){this.type=b;this.effect=c;this.material=null}function $(b){this.effect=b;this.format=this.init_from=
-null}function E(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 Q(){this.url=""}function W(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function X(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 V(b){if(b=="dae")return"http://www.collada.org/2005/11/COLLADASchema";return null}function la(b){for(var b=ia(b),c=[],e=0;e<b.length;e++)c.push(parseFloat(b[e]));return c}function aa(b){for(var b=ia(b),c=[],e=0;e<b.length;e++)c.push(parseInt(b[e],10));return c}function ia(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 oa(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+=oa(b.x,c)+",";e+=oa(b.y,c)+",";e+=oa(b.z,c);return e}var da=null,U=null,Y,ga=null,ka={},ta={},L={},ma={},qa={},ra={},va={},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 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=
+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=
+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=
 {},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=
 {},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 N).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=la(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 N).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 N).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");
+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");
 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(/\)/,
 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==
 ""))}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;
 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;
-case "instance_controller":this.controllers.push((new x).parse(c));break;case "instance_geometry":this.geometries.push((new z).parse(c));break;case "instance_light":break;case "instance_node":c=c.getAttribute("url").replace(/^#/,"");(c=da.evaluate(".//dae:library_nodes//dae:node[@id='"+c+"']",da,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new w).parse(c));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new t).parse(c));
-break;case "extra":break;default:console.log(c.nodeName)}b=[];e=1E6;c=-1E6;for(var f in L)for(var h=L[f],k=0;k<h.channel.length;k++){var m=h.channel[k],n=h.sampler[k];f=m.target.split("/")[0];if(f==this.id)n.create(),m.sampler=n,e=Math.min(e,n.startTime),c=Math.max(c,n.endTime),b.push(m)}if(b.length)this.startTime=e,this.endTime=c;if((this.channels=b)&&this.channels.length){f=1E7;for(i=0;i<this.channels.length;i++){b=this.channels[i].sampler;for(e=0;e<b.input.length-1;e++)f=Math.min(f,b.input[e+1]-
-b.input[e])}e=[];for(b=this.startTime;b<this.endTime;b+=f){c=b;for(var h={},o=k=void 0,k=0;k<this.channels.length;k++)o=this.channels[k],h[o.sid]=o;m=new THREE.Matrix4;for(k=0;k<this.transforms.length;k++)if(n=this.transforms[k],o=h[n.sid],o!==void 0){for(var p=o.sampler,u,o=0;o<p.input.length-1;o++)if(p.input[o+1]>c){u=p.output[o];break}m=u!==void 0?u instanceof THREE.Matrix4?m.multiply(m,u):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,
-c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};w.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b<this.transforms.length;b++)this.matrix.multiply(this.matrix,this.transforms[b].matrix)};t.prototype.parse=function(b){this.sid=b.getAttribute("sid");this.type=b.nodeName;this.data=la(b.textContent);this.updateMatrix();return this};t.prototype.updateMatrix=function(){var b=0;this.matrix.identity();switch(this.type){case "matrix":this.matrix.set(this.data[0],
+case "instance_controller":this.controllers.push((new x).parse(c));break;case "instance_geometry":this.geometries.push((new z).parse(c));break;case "instance_light":break;case "instance_node":c=c.getAttribute("url").replace(/^#/,"");(c=da.evaluate(".//dae:library_nodes//dae:node[@id='"+c+"']",da,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new w).parse(c));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new t).parse(c));
+break;case "extra":break;default:console.log(c.nodeName)}b=[];e=1E6;c=-1E6;for(var f in la)for(var h=la[f],k=0;k<h.channel.length;k++){var m=h.channel[k],n=h.sampler[k];f=m.target.split("/")[0];if(f==this.id)n.create(),m.sampler=n,e=Math.min(e,n.startTime),c=Math.max(c,n.endTime),b.push(m)}if(b.length)this.startTime=e,this.endTime=c;if((this.channels=b)&&this.channels.length){f=1E7;for(i=0;i<this.channels.length;i++){b=this.channels[i].sampler;for(e=0;e<b.input.length-1;e++)f=Math.min(f,b.input[e+
+1]-b.input[e])}e=[];for(b=this.startTime;b<this.endTime;b+=f){c=b;for(var h={},o=k=void 0,k=0;k<this.channels.length;k++)o=this.channels[k],h[o.sid]=o;m=new THREE.Matrix4;for(k=0;k<this.transforms.length;k++)if(n=this.transforms[k],o=h[n.sid],o!==void 0){for(var p=o.sampler,u,o=0;o<p.input.length-1;o++)if(p.input[o+1]>c){u=p.output[o];break}m=u!==void 0?u instanceof THREE.Matrix4?m.multiply(m,u):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,
+c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};w.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b<this.transforms.length;b++)this.matrix.multiply(this.matrix,this.transforms[b].matrix)};t.prototype.parse=function(b){this.sid=b.getAttribute("sid");this.type=b.nodeName;this.data=na(b.textContent);this.updateMatrix();return this};t.prototype.updateMatrix=function(){var b=0;this.matrix.identity();switch(this.type){case "matrix":this.matrix.set(this.data[0],
 this.data[1],this.data[2],this.data[3],this.data[4],this.data[5],this.data[6],this.data[7],this.data[8],this.data[9],this.data[10],this.data[11],this.data[12],this.data[13],this.data[14],this.data[15]);break;case "translate":this.matrix.setTranslation(this.data[0],this.data[1],this.data[2]);break;case "rotate":b=this.data[3]*(Math.PI/180);this.matrix.setRotationAxis(new THREE.Vector3(this.data[0],this.data[1],this.data[2]),b);break;case "scale":this.matrix.setScale(this.data[0],this.data[1],this.data[2])}return this.matrix};
 this.data[1],this.data[2],this.data[3],this.data[4],this.data[5],this.data[6],this.data[7],this.data[8],this.data[9],this.data[10],this.data[11],this.data[12],this.data[13],this.data[14],this.data[15]);break;case "translate":this.matrix.setTranslation(this.data[0],this.data[1],this.data[2]);break;case "rotate":b=this.data[3]*(Math.PI/180);this.matrix.setRotationAxis(new THREE.Vector3(this.data[0],this.data[1],this.data[2]),b);break;case "scale":this.matrix.setScale(this.data[0],this.data[1],this.data[2])}return this.matrix};
-x.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "skeleton":this.skeleton.push(e.textContent.replace(/^#/,""));break;case "bind_material":if(e=da.evaluate(".//dae:instance_material",e,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(var f=e.iterateNext();f;)this.instance_material.push((new v).parse(f)),f=e.iterateNext()}}return this};
-v.prototype.parse=function(b){this.symbol=b.getAttribute("symbol");this.target=b.getAttribute("target").replace(/^#/,"");return this};z.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1&&e.nodeName=="bind_material"){if(b=da.evaluate(".//dae:instance_material",e,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(c=b.iterateNext();c;)this.instance_material.push((new v).parse(c)),
-c=b.iterateNext();break}}return this};y.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "mesh":this.mesh=(new A(this)).parse(e)}}return this};A.prototype.parse=function(b){function c(b,e){var f=fa(b.position);h[f]===void 0&&(h[f]={v:b,index:e});return h[f]}this.primitives=[];var e;for(e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];switch(f.nodeName){case "source":ea(f);break;case "vertices":this.vertices=
-(new G).parse(f);break;case "triangles":this.primitives.push((new D).parse(f));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new B).parse(f))}}var h={};this.geometry3js=new THREE.Geometry;f=ka[this.vertices.input.POSITION.source].data;for(b=e=0;e<f.length;e+=3,b++){var k=new THREE.Vertex(new THREE.Vector3(f[e],f[e+1],f[e+2]));c(k,b);this.geometry3js.vertices.push(k)}for(e=0;e<this.primitives.length;e++)primitive=this.primitives[e],primitive.setVertices(this.vertices),
-this.handlePrimitive(primitive,this.geometry3js,h);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.computeVertexNormals();this.geometry3js.computeBoundingBox();return this};A.prototype.handlePrimitive=function(b,c,e){var f=0,h,k,m=b.p,n=b.inputs,o,p,t,u=0,v=3,w=[];for(h=0;h<n.length;h++)switch(o=n[h],o.semantic){case "TEXCOORD":w.push(o.set)}for(;f<m.length;){var x=[],y=[],z={},A=[];b.vcount&&(v=b.vcount[u++]);for(h=0;h<v;h++)for(k=0;k<n.length;k++)switch(o=
-n[k],source=ka[o.source],p=m[f+h*n.length+o.offset],numParams=source.accessor.params.length,t=p*numParams,o.semantic){case "VERTEX":o=fa(c.vertices[p].position);x.push(e[o].index);break;case "NORMAL":y.push(new THREE.Vector3(source.data[t],source.data[t+1],source.data[t+2]));break;case "TEXCOORD":z[o.set]===void 0&&(z[o.set]=[]);z[o.set].push(new THREE.UV(source.data[t],source.data[t+1]));break;case "COLOR":A.push((new THREE.Color).setRGB(source.data[t],source.data[t+1],source.data[t+2]))}var B;v==
-3?B=new THREE.Face3(x[0],x[1],x[2],[y[0],y[1],y[2]],A.length?A:new THREE.Color):v==4&&(B=new THREE.Face4(x[0],x[1],x[2],x[3],[y[0],y[1],y[2],y[3]],A.length?A:new THREE.Color));B.daeMaterial=b.material;c.faces.push(B);for(k=0;k<w.length;k++)h=z[w[k]],c.faceVertexUvs[k].push([h[0],h[1],h[2]]);f+=n.length*v}};B.prototype=new D;B.prototype.constructor=B;D.prototype.setVertices=function(b){for(var c=0;c<this.inputs.length;c++)if(this.inputs[c].source==b.id)this.inputs[c].source=b.input.POSITION.source};
-D.prototype.parse=function(b){this.inputs=[];this.material=b.getAttribute("material");this.count=ca(b,"count",0);for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "input":this.inputs.push((new N).parse(b.childNodes[c]));break;case "vcount":this.vcount=aa(e.textContent);break;case "p":this.p=aa(e.textContent)}}return this};F.prototype.parse=function(b){this.params=[];this.source=b.getAttribute("source");this.count=ca(b,"count",0);this.stride=ca(b,"stride",0);for(var c=
-0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="param"){var f={};f.name=e.getAttribute("name");f.type=e.getAttribute("type");this.params.push(f)}}return this};G.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++)b.childNodes[c].nodeName=="input"&&(input=(new N).parse(b.childNodes[c]),this.input[input.semantic]=input);return this};N.prototype.parse=function(b){this.semantic=b.getAttribute("semantic");this.source=b.getAttribute("source").replace(/^#/,
-"");this.set=ca(b,"set",-1);this.offset=ca(b,"offset",0);if(this.semantic=="TEXCOORD"&&this.set<0)this.set=0;return this};P.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "bool_array":for(var f=ia(e.textContent),h=[],k=0;k<f.length;k++)h.push(f[k]=="true"||f[k]=="1"?!0:!1);this.data=h;this.type=e.nodeName;break;case "float_array":this.data=la(e.textContent);this.type=e.nodeName;break;case "int_array":this.data=
-aa(e.textContent);this.type=e.nodeName;break;case "IDREF_array":case "Name_array":this.data=ia(e.textContent);this.type=e.nodeName;break;case "technique_common":for(f=0;f<e.childNodes.length;f++)if(e.childNodes[f].nodeName=="accessor"){this.accessor=(new F).parse(e.childNodes[f]);break}}}return this};P.prototype.read=function(){var b=[],c=this.accessor.params[0];switch(c.type){case "IDREF":case "Name":case "name":case "float":return this.data;case "float4x4":for(c=0;c<this.data.length;c+=16){var e=
-this.data.slice(c,c+16),f=new THREE.Matrix4;f.set(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]);b.push(f)}break;default:console.log("Dae::Source:read dont know how to read "+c.type)}return b};H.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");for(var c=0;c<b.childNodes.length;c++)if(b.childNodes[c].nodeName=="instance_effect"){this.instance_effect=(new Q).parse(b.childNodes[c]);break}return this};I.prototype.isColor=
-function(){return this.texture==null};I.prototype.isTexture=function(){return this.texture!=null};I.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "color":e=la(e.textContent);this.color=new THREE.Color(0);this.color.setRGB(e[0],e[1],e[2]);this.color.a=e[3];break;case "texture":this.texture=e.getAttribute("texture"),this.texcoord=e.getAttribute("texcoord")}}return this};M.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=
-b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[e.nodeName]=(new I).parse(e);break;case "shininess":case "reflectivity":case "transparency":var f;f=da.evaluate(".//dae:float",e,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var h=f.iterateNext(),k=[];h;)k.push(h),h=f.iterateNext();f=k;f.length>0&&(this[e.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};M.prototype.create=function(){var b=
-{},c=this.transparency!==void 0&&this.transparency<1,e;for(e in this)switch(e){case "ambient":case "emission":case "diffuse":case "specular":var f=this[e];if(f instanceof I)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=ta[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ea+f.init_from),b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else e=="diffuse"?b.color=
-f.color.getHex():c||(b[e]=f.color.getHex());break;case "shininess":case "reflectivity":b[e]=this[e];break;case "transparency":if(c)b.transparent=!0,b.opacity=this[e],c=!0}b.shading=Ga;return this.material=new THREE.MeshLambertMaterial(b)};$.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "init_from":this.init_from=e.textContent;break;case "format":this.format=e.textContent;break;default:console.log("unhandled Surface prop: "+
-e.nodeName)}}return this};E.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "source":this.source=e.textContent;break;case "minfilter":this.minfilter=e.textContent;break;case "magfilter":this.magfilter=e.textContent;break;case "mipfilter":this.mipfilter=e.textContent;break;case "wrap_s":this.wrap_s=e.textContent;break;case "wrap_t":this.wrap_t=e.textContent;break;default:console.log("unhandled Sampler2D prop: "+e.nodeName)}}return this};
+x.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "skeleton":this.skeleton.push(e.textContent.replace(/^#/,""));break;case "bind_material":if(e=da.evaluate(".//dae:instance_material",e,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(var f=e.iterateNext();f;)this.instance_material.push((new v).parse(f)),f=e.iterateNext()}}return this};
+v.prototype.parse=function(b){this.symbol=b.getAttribute("symbol");this.target=b.getAttribute("target").replace(/^#/,"");return this};z.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1&&e.nodeName=="bind_material"){if(b=da.evaluate(".//dae:instance_material",e,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(c=b.iterateNext();c;)this.instance_material.push((new v).parse(c)),
+c=b.iterateNext();break}}return this};y.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "mesh":this.mesh=(new B(this)).parse(e)}}return this};B.prototype.parse=function(b){function c(b,e){var f=fa(b.position);h[f]===void 0&&(h[f]={v:b,index:e});return h[f]}this.primitives=[];var e;for(e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];switch(f.nodeName){case "source":ea(f);break;case "vertices":this.vertices=
+(new G).parse(f);break;case "triangles":this.primitives.push((new E).parse(f));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new C).parse(f))}}var h={};this.geometry3js=new THREE.Geometry;f=ka[this.vertices.input.POSITION.source].data;for(b=e=0;e<f.length;e+=3,b++){var k=new THREE.Vertex(new THREE.Vector3(f[e],f[e+1],f[e+2]));c(k,b);this.geometry3js.vertices.push(k)}for(e=0;e<this.primitives.length;e++)primitive=this.primitives[e],primitive.setVertices(this.vertices),
+this.handlePrimitive(primitive,this.geometry3js,h);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.computeVertexNormals();this.geometry3js.computeBoundingBox();return this};B.prototype.handlePrimitive=function(b,c,e){var f=0,h,k,m=b.p,n=b.inputs,o,p,t,u=0,v=3,w=[];for(h=0;h<n.length;h++)switch(o=n[h],o.semantic){case "TEXCOORD":w.push(o.set)}for(;f<m.length;){var x=[],y=[],z={},B=[];b.vcount&&(v=b.vcount[u++]);for(h=0;h<v;h++)for(k=0;k<n.length;k++)switch(o=
+n[k],source=ka[o.source],p=m[f+h*n.length+o.offset],numParams=source.accessor.params.length,t=p*numParams,o.semantic){case "VERTEX":o=fa(c.vertices[p].position);x.push(e[o].index);break;case "NORMAL":y.push(new THREE.Vector3(source.data[t],source.data[t+1],source.data[t+2]));break;case "TEXCOORD":z[o.set]===void 0&&(z[o.set]=[]);z[o.set].push(new THREE.UV(source.data[t],source.data[t+1]));break;case "COLOR":B.push((new THREE.Color).setRGB(source.data[t],source.data[t+1],source.data[t+2]))}var A;v==
+3?A=new THREE.Face3(x[0],x[1],x[2],[y[0],y[1],y[2]],B.length?B:new THREE.Color):v==4&&(A=new THREE.Face4(x[0],x[1],x[2],x[3],[y[0],y[1],y[2],y[3]],B.length?B:new THREE.Color));A.daeMaterial=b.material;c.faces.push(A);for(k=0;k<w.length;k++)h=z[w[k]],c.faceVertexUvs[k].push([h[0],h[1],h[2]]);f+=n.length*v}};C.prototype=new E;C.prototype.constructor=C;E.prototype.setVertices=function(b){for(var c=0;c<this.inputs.length;c++)if(this.inputs[c].source==b.id)this.inputs[c].source=b.input.POSITION.source};
+E.prototype.parse=function(b){this.inputs=[];this.material=b.getAttribute("material");this.count=ca(b,"count",0);for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "input":this.inputs.push((new M).parse(b.childNodes[c]));break;case "vcount":this.vcount=aa(e.textContent);break;case "p":this.p=aa(e.textContent)}}return this};F.prototype.parse=function(b){this.params=[];this.source=b.getAttribute("source");this.count=ca(b,"count",0);this.stride=ca(b,"stride",0);for(var c=
+0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="param"){var f={};f.name=e.getAttribute("name");f.type=e.getAttribute("type");this.params.push(f)}}return this};G.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++)b.childNodes[c].nodeName=="input"&&(input=(new M).parse(b.childNodes[c]),this.input[input.semantic]=input);return this};M.prototype.parse=function(b){this.semantic=b.getAttribute("semantic");this.source=b.getAttribute("source").replace(/^#/,
+"");this.set=ca(b,"set",-1);this.offset=ca(b,"offset",0);if(this.semantic=="TEXCOORD"&&this.set<0)this.set=0;return this};P.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "bool_array":for(var f=ha(e.textContent),h=[],k=0;k<f.length;k++)h.push(f[k]=="true"||f[k]=="1"?!0:!1);this.data=h;this.type=e.nodeName;break;case "float_array":this.data=na(e.textContent);this.type=e.nodeName;break;case "int_array":this.data=
+aa(e.textContent);this.type=e.nodeName;break;case "IDREF_array":case "Name_array":this.data=ha(e.textContent);this.type=e.nodeName;break;case "technique_common":for(f=0;f<e.childNodes.length;f++)if(e.childNodes[f].nodeName=="accessor"){this.accessor=(new F).parse(e.childNodes[f]);break}}}return this};P.prototype.read=function(){var b=[],c=this.accessor.params[0];switch(c.type){case "IDREF":case "Name":case "name":case "float":return this.data;case "float4x4":for(c=0;c<this.data.length;c+=16){var e=
+this.data.slice(c,c+16),f=new THREE.Matrix4;f.set(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]);b.push(f)}break;default:console.log("Dae::Source:read dont know how to read "+c.type)}return b};L.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");for(var c=0;c<b.childNodes.length;c++)if(b.childNodes[c].nodeName=="instance_effect"){this.instance_effect=(new X).parse(b.childNodes[c]);break}return this};A.prototype.isColor=
+function(){return this.texture==null};A.prototype.isTexture=function(){return this.texture!=null};A.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "color":e=na(e.textContent);this.color=new THREE.Color(0);this.color.setRGB(e[0],e[1],e[2]);this.color.a=e[3];break;case "texture":this.texture=e.getAttribute("texture"),this.texcoord=e.getAttribute("texcoord")}}return this};J.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=
+b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[e.nodeName]=(new A).parse(e);break;case "shininess":case "reflectivity":case "transparency":var f;f=da.evaluate(".//dae:float",e,T,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var h=f.iterateNext(),k=[];h;)k.push(h),h=f.iterateNext();f=k;f.length>0&&(this[e.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};J.prototype.create=function(){var b=
+{},c=this.transparency!==void 0&&this.transparency<1,e;for(e in this)switch(e){case "ambient":case "emission":case "diffuse":case "specular":var f=this[e];if(f instanceof A)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=ua[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ea+f.init_from),b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else e=="diffuse"?b.color=
+f.color.getHex():c||(b[e]=f.color.getHex());break;case "shininess":case "reflectivity":b[e]=this[e];break;case "transparency":if(c)b.transparent=!0,b.opacity=this[e],c=!0}b.shading=Ga;return this.material=new THREE.MeshLambertMaterial(b)};Z.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "init_from":this.init_from=e.textContent;break;case "format":this.format=e.textContent;break;default:console.log("unhandled Surface prop: "+
+e.nodeName)}}return this};I.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "source":this.source=e.textContent;break;case "minfilter":this.minfilter=e.textContent;break;case "magfilter":this.magfilter=e.textContent;break;case "mipfilter":this.mipfilter=e.textContent;break;case "wrap_s":this.wrap_s=e.textContent;break;case "wrap_t":this.wrap_t=e.textContent;break;default:console.log("unhandled Sampler2D prop: "+e.nodeName)}}return this};
 O.prototype.create=function(){if(this.shader==null)return null};O.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.shader=null;for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(e))}}return this};O.prototype.parseNewparam=function(b){for(var c=b.getAttribute("sid"),e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "surface":this.surface=
 O.prototype.create=function(){if(this.shader==null)return null};O.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.shader=null;for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(e))}}return this};O.prototype.parseNewparam=function(b){for(var c=b.getAttribute("sid"),e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "surface":this.surface=
-(new $(this)).parse(f);this.surface.sid=c;break;case "sampler2D":this.sampler=(new E(this)).parse(f);this.sampler.sid=c;break;case "extra":break;default:console.log(f.nodeName)}}};O.prototype.parseProfileCOMMON=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 "profile_COMMON":this.parseProfileCOMMON(f);break;case "technique":c=f;break;case "newparam":this.parseNewparam(f);break;case "extra":break;default:console.log(f.nodeName)}}return c};
-O.prototype.parseTechnique=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "lambert":case "blinn":case "phong":this.shader=(new M(e.nodeName,this)).parse(e)}}};Q.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");return this};W.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.source={};for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "source":e=
-(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 X(this)).parse(e))}}return this};X.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 N).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=
+(new Z(this)).parse(f);this.surface.sid=c;break;case "sampler2D":this.sampler=(new I(this)).parse(f);this.sampler.sid=c;break;case "extra":break;default:console.log(f.nodeName)}}};O.prototype.parseProfileCOMMON=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 "profile_COMMON":this.parseProfileCOMMON(f);break;case "technique":c=f;break;case "newparam":this.parseNewparam(f);break;case "extra":break;default:console.log(f.nodeName)}}return c};
+O.prototype.parseTechnique=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "lambert":case "blinn":case "phong":this.shader=(new J(e.nodeName,this)).parse(e)}}};X.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");return this};V.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.source={};for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "source":e=
+(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&&
 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,p=e;da=n.responseXML;o=ga;p!==void 0&&(p=p.split("/"),p.pop(),Ea=p.join("/")+"/");ta=b("//dae:library_images/dae:image",k,"image");ra=b("//dae:library_materials/dae:material",
-H,"material");va=b("//dae:library_effects/dae:effect",O,"effect");qa=b("//dae:library_geometries/dae:geometry",y,"geometry");ma=b("//dae:library_controllers/dae:controller",m,"controller");L=b("//dae:library_animations/dae:animation",W,"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,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(p=p.getAttribute("url").replace(/^#/,""),Y=Da[p]):
-Y=null;U=new THREE.Object3D;for(p=0;p<Y.nodes.length;p++)U.add(h(Y.nodes[p]));c();for(var t in L);t={scene:U,morphs:Aa,skins:Ca,dae:{images:ta,materials:ra,effects:va,geometries:qa,controllers:ma,animations:L,visualScenes:Da,scene:Y}};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:qa}};THREE.JSONLoader=function(b){THREE.Loader.call(this,b)};THREE.JSONLoader.prototype=new THREE.Loader;
+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.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,p,u,w,t,x,v,z,y,A,B,D,F,G=b.faces;t=b.vertices;var N=b.normals,P=b.colors,H=0;for(e=0;e<b.uvs.length;e++)b.uvs[e].length&&H++;for(e=0;e<H;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;h=c&8;v=c&16;x=c&32;y=c&64;c&=128;t?(A=new THREE.Face4,A.a=G[u++],A.b=G[u++],A.c=G[u++],A.d=G[u++],t=4):(A=new THREE.Face3,A.a=G[u++],A.b=G[u++],A.c=G[u++],t=3);if(p)p=G[u++],A.materials=f.materials[p];p=f.faces.length;if(e)for(e=0;e<H;e++)B=b.uvs[e],z=G[u++],F=B[z*2],z=B[z*2+1],f.faceUvs[e][p]=new THREE.UV(F,z);if(h)for(e=0;e<H;e++){B=b.uvs[e];D=[];for(h=0;h<t;h++)z=G[u++],F=B[z*2],z=B[z*2+1],D[h]=
-new THREE.UV(F,z);f.faceVertexUvs[e][p]=D}if(v)v=G[u++]*3,h=new THREE.Vector3,h.x=N[v++],h.y=N[v++],h.z=N[v],A.normal=h;if(x)for(e=0;e<t;e++)v=G[u++]*3,h=new THREE.Vector3,h.x=N[v++],h.y=N[v++],h.z=N[v],A.vertexNormals.push(h);if(y)x=G[u++],x=new THREE.Color(P[x]),A.color=x;if(c)for(e=0;e<t;e++)x=G[u++],x=new THREE.Color(P[x]),A.vertexColors.push(x);f.faces.push(A)}}})(h);(function(){var c,e,h,p;if(b.skinWeights){c=0;for(e=b.skinWeights.length;c<e;c+=2)h=b.skinWeights[c],p=b.skinWeights[c+1],f.skinWeights.push(new THREE.Vector4(h,
-p,0,0))}if(b.skinIndices){c=0;for(e=b.skinIndices.length;c<e;c+=2)h=b.skinIndices[c],p=b.skinIndices[c+1],f.skinIndices.push(new THREE.Vector4(h,p,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var e,h,p,u,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;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(h=b.morphColors.length;e<h;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)}}})(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],
+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(){}};
 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(!V.objects[v])if(D=O.objects[v],D.geometry!==void 0){if(P=V.geometries[D.geometry]){var b=!1;$=[];for(aa=0;aa<D.materials.length;aa++)$[aa]=V.materials[D.materials[aa]],b=$[aa]instanceof THREE.ShaderMaterial;b&&P.computeTangents();F=D.position;r=D.rotation;
-q=D.quaternion;s=D.scale;q=0;$.length==0&&($[0]=new THREE.MeshFaceMaterial);$.length>1&&($=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(P,$);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=D.visible;V.scene.add(object);V.objects[v]=object;D.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),V.scene.collisions.colliders.push(b));
-if(D.castsShadow)b=new THREE.ShadowVolume(P),V.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;D.trigger&&D.trigger.toLowerCase()!="none"&&(b={type:D.trigger,object:D},V.triggers[object.name]=b)}}else F=D.position,r=D.rotation,q=D.quaternion,s=D.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=D.visible!==void 0?D.visible:!1,V.scene.add(object),V.objects[v]=object,V.empties[v]=object,D.trigger&&D.trigger.toLowerCase()!="none"&&(b={type:D.trigger,object:D},V.triggers[object.name]=b)}function p(b){return function(c){V.geometries[b]=c;n();W-=1;e.onLoadComplete();w()}}function u(b){return function(c){V.geometries[b]=c}}function w(){e.callbackProgress({totalModels:o,totalTextures:ea,loadedModels:o-W,loadedTextures:ea-X},V);e.onLoadProgress();W==0&&X==0&&c(V)}var t,
-x,v,z,y,A,B,D,F,G,N,P,H,I,M,$,E,O,Q,W,X,o,ea,V;O=b.data;M=new THREE.BinaryLoader;Q=new THREE.JSONLoader;X=W=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in O.objects)if(D=O.objects[v],D.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(O.transform){b=O.transform.position;G=O.transform.rotation;var la=O.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);G&&V.scene.rotation.set(G[0],
-G[1],G[2]);la&&V.scene.scale.set(la[0],la[1],la[2]);(b||G||la)&&V.scene.updateMatrix()}b=function(){X-=1;w();e.onLoadComplete()};for(y in O.cameras){G=O.cameras[y];if(G.type=="perspective")H=new THREE.Camera(G.fov,G.aspect,G.near,G.far);else if(G.type=="ortho")H=new THREE.Camera,H.projectionMatrix=THREE.Matrix4.makeOrtho(G.left,G.right,G.top,G.bottom,G.near,G.far);F=G.position;G=G.target;H.position.set(F[0],F[1],F[2]);H.target.position.set(G[0],G[1],G[2]);V.cameras[y]=H}for(z in O.lights)y=O.lights[z],
-H=y.color!==void 0?y.color:16777215,G=y.intensity!==void 0?y.intensity:1,y.type=="directional"?(F=y.direction,E=new THREE.DirectionalLight(H,G),E.position.set(F[0],F[1],F[2]),E.position.normalize()):y.type=="point"?(F=y.position,d=y.distance,E=new THREE.PointLight(H,G,d),E.position.set(F[0],F[1],F[2])):y.type=="ambient"&&(E=new THREE.AmbientLight(H)),V.scene.add(E),V.lights[z]=E;for(A in O.fogs)z=O.fogs[A],z.type=="linear"?I=new THREE.Fog(0,z.near,z.far):z.type=="exp2"&&(I=new THREE.FogExp2(0,z.density)),
-G=z.color,I.color.setRGB(G[0],G[1],G[2]),V.fogs[A]=I;if(V.cameras&&O.defaults.camera)V.currentCamera=V.cameras[O.defaults.camera];if(V.fogs&&O.defaults.fog)V.scene.fog=V.fogs[O.defaults.fog];G=O.defaults.bgcolor;V.bgColor=new THREE.Color;V.bgColor.setRGB(G[0],G[1],G[2]);V.bgColorAlpha=O.defaults.bgalpha;for(t in O.geometries)if(A=O.geometries[t],A.type=="bin_mesh"||A.type=="ascii_mesh")W+=1,e.onLoadStart();o=W;for(t in O.geometries)A=O.geometries[t],A.type=="cube"?(P=new THREE.CubeGeometry(A.width,
-A.height,A.depth,A.segmentsWidth,A.segmentsHeight,A.segmentsDepth,null,A.flipped,A.sides),V.geometries[t]=P):A.type=="plane"?(P=new THREE.PlaneGeometry(A.width,A.height,A.segmentsWidth,A.segmentsHeight),V.geometries[t]=P):A.type=="sphere"?(P=new THREE.SphereGeometry(A.radius,A.segmentsWidth,A.segmentsHeight),V.geometries[t]=P):A.type=="cylinder"?(P=new THREE.CylinderGeometry(A.topRad,A.botRad,A.height,A.radSegs,A.heightSegs),V.geometries[t]=P):A.type=="torus"?(P=new THREE.TorusGeometry(A.radius,A.tube,
-A.segmentsR,A.segmentsT),V.geometries[t]=P):A.type=="icosahedron"?(P=new THREE.IcosahedronGeometry(A.subdivisions),V.geometries[t]=P):A.type=="bin_mesh"?M.load({model:f(A.url,O.urlBaseType),callback:p(t)}):A.type=="ascii_mesh"?Q.load({model:f(A.url,O.urlBaseType),callback:p(t)}):A.type=="embedded_mesh"&&(A=O.embeds[A.id])&&Q.createModel(A,u(t),"");for(B in O.textures)if(t=O.textures[B],t.url instanceof Array){X+=t.url.length;for(M=0;M<t.url.length;M++)e.onLoadStart()}else X+=1,e.onLoadStart();ea=
-X;for(B in O.textures){t=O.textures[B];if(t.mapping!=void 0&&THREE[t.mapping]!=void 0)t.mapping=new THREE[t.mapping];if(t.url instanceof Array){M=[];for(var aa=0;aa<t.url.length;aa++)M[aa]=f(t.url[aa],O.urlBaseType);M=THREE.ImageUtils.loadTextureCube(M,t.mapping,b)}else{M=THREE.ImageUtils.loadTexture(f(t.url,O.urlBaseType),t.mapping,b);if(THREE[t.minFilter]!=void 0)M.minFilter=THREE[t.minFilter];if(THREE[t.magFilter]!=void 0)M.magFilter=THREE[t.magFilter];if(t.repeat){M.repeat.set(t.repeat[0],t.repeat[1]);
-if(t.repeat[0]!=1)M.wrapS=THREE.RepeatWrapping;if(t.repeat[1]!=1)M.wrapT=THREE.RepeatWrapping}t.offset&&M.offset.set(t.offset[0],t.offset[1]);if(t.wrap){Q={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(Q[t.wrap[0]]!==void 0)M.wrapS=Q[t.wrap[0]];if(Q[t.wrap[1]]!==void 0)M.wrapT=Q[t.wrap[1]]}}V.textures[B]=M}for(x in O.materials){B=O.materials[x];for(N in B.parameters)if(N=="envMap"||N=="map"||N=="lightMap")B.parameters[N]=V.textures[B.parameters[N]];else if(N=="shading")B.parameters[N]=
-B.parameters[N]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(N=="blending")B.parameters[N]=THREE[B.parameters[N]]?THREE[B.parameters[N]]:THREE.NormalBlending;else if(N=="combine")B.parameters[N]=B.parameters[N]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(N=="vertexColors")if(B.parameters[N]=="face")B.parameters[N]=THREE.FaceColors;else if(B.parameters[N])B.parameters[N]=THREE.VertexColors;if(B.parameters.opacity!==void 0&&B.parameters.opacity<1)B.parameters.transparent=
-!0;if(B.parameters.normalMap){t=THREE.ShaderUtils.lib.normal;b=THREE.UniformsUtils.clone(t.uniforms);M=B.parameters.color;Q=B.parameters.specular;A=B.parameters.ambient;I=B.parameters.shininess;b.tNormal.texture=V.textures[B.parameters.normalMap];if(B.parameters.normalMapFactor)b.uNormalScale.value=B.parameters.normalMapFactor;if(B.parameters.map)b.tDiffuse.texture=B.parameters.map,b.enableDiffuse.value=!0;if(B.parameters.lightMap)b.tAO.texture=B.parameters.lightMap,b.enableAO.value=!0;if(B.parameters.specularMap)b.tSpecular.texture=
-V.textures[B.parameters.specularMap],b.enableSpecular.value=!0;b.uDiffuseColor.value.setHex(M);b.uSpecularColor.value.setHex(Q);b.uAmbientColor.value.setHex(A);b.uShininess.value=I;if(B.parameters.opacity)b.uOpacity.value=B.parameters.opacity;B=new THREE.ShaderMaterial({fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:b,lights:!0,fog:!0})}else B=new THREE[B.type](B.parameters);V.materials[x]=B}n();e.callbackSync(V)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=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;
+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,
+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=
+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=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.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.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),u=[],w=[];(function(b,m,p){for(var u,w,A,B=b.length;p<B;p+=m)u=b[p],w=b[p+1],A=b[p+2],u=u/16383*e,w=w/16383*e,A=A/16383*e,u+=f,w+=h,A+=k,c.vertices.push(new THREE.Vertex(new THREE.Vector3(u,w,A)))})(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,u.push(f,h,k)})(m[0],8,5);(function(b){var e,f,h,k,m,p,D,F,G,N=b.length;for(e=0;e<N;e+=3){f=b[e];h=b[e+1];k=b[e+2];m=c;F=f;G=h;p=k;D=f;var P=h,H=k,I=m.materials[0],M=u[P*3],$=u[P*3+1],P=u[P*3+2],E=u[H*3],O=u[H*3+1],H=u[H*3+2];D=new THREE.Vector3(u[D*3],u[D*3+1],u[D*3+2]);P=new THREE.Vector3(M,$,P);H=new THREE.Vector3(E,O,H);m.faces.push(new THREE.Face3(F,G,p,[D,P,H],null,I));m=w[f*2];f=w[f*2+
-1];p=w[h*2];D=w[h*2+1];F=w[k*2];G=w[k*2+1];k=c.faceVertexUvs[0];h=p;p=D;D=[];D.push(new THREE.UV(m,f));D.push(new THREE.UV(h,p));D.push(new THREE.UV(F,G));k.push(D)}})(m[1]);this.computeCentroids();this.computeFaceNormals()};m.prototype=new THREE.Geometry;m.prototype.constructor=m;c(new m)};
+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.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=
 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,p,u,w,t){m=(m-w)/(t-w);w=this.normal_cache;c[k]=n+m*this.delta;c[k+1]=p;c[k+2]=u;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,p,u,w,t){m=(m-w)/(t-w);w=this.normal_cache;c[k]=n;c[k+1]=p+m*this.delta;c[k+
-2]=u;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,p,u,w,t){m=(m-w)/(t-w);w=this.normal_cache;c[k]=n;c[k+1]=p;c[k+2]=u+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 p=k+1,u=k+this.yd,w=k+this.zd,t=p+this.yd,x=p+this.zd,v=k+this.yd+this.zd,z=p+this.yd+this.zd,y=0,A=this.field[k],B=this.field[p],D=this.field[u],F=this.field[t],G=this.field[w],N=this.field[x],P=this.field[v],H=this.field[z];A<m&&(y|=1);B<m&&(y|=2);D<m&&(y|=8);F<m&&(y|=4);G<m&&(y|=16);N<m&&(y|=32);P<m&&(y|=128);H<m&&(y|=64);var I=THREE.edgeTable[y];if(I==0)return 0;var M=this.delta,
-$=b+M,E=c+M,M=h+M;I&1&&(this.compNorm(k),this.compNorm(p),this.VIntX(k*3,this.vlist,this.nlist,0,m,b,c,h,A,B));I&2&&(this.compNorm(p),this.compNorm(t),this.VIntY(p*3,this.vlist,this.nlist,3,m,$,c,h,B,F));I&4&&(this.compNorm(u),this.compNorm(t),this.VIntX(u*3,this.vlist,this.nlist,6,m,b,E,h,D,F));I&8&&(this.compNorm(k),this.compNorm(u),this.VIntY(k*3,this.vlist,this.nlist,9,m,b,c,h,A,D));I&16&&(this.compNorm(w),this.compNorm(x),this.VIntX(w*3,this.vlist,this.nlist,12,m,b,c,M,G,N));I&32&&(this.compNorm(x),
-this.compNorm(z),this.VIntY(x*3,this.vlist,this.nlist,15,m,$,c,M,N,H));I&64&&(this.compNorm(v),this.compNorm(z),this.VIntX(v*3,this.vlist,this.nlist,18,m,b,E,M,P,H));I&128&&(this.compNorm(w),this.compNorm(v),this.VIntY(w*3,this.vlist,this.nlist,21,m,b,c,M,G,P));I&256&&(this.compNorm(k),this.compNorm(w),this.VIntZ(k*3,this.vlist,this.nlist,24,m,b,c,h,A,G));I&512&&(this.compNorm(p),this.compNorm(x),this.VIntZ(p*3,this.vlist,this.nlist,27,m,$,c,h,B,N));I&1024&&(this.compNorm(t),this.compNorm(z),this.VIntZ(t*
-3,this.vlist,this.nlist,30,m,$,E,h,F,H));I&2048&&(this.compNorm(u),this.compNorm(v),this.VIntZ(u*3,this.vlist,this.nlist,33,m,b,E,h,D,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 p=this.count*3;this.positionArray[p]=b[h];this.positionArray[p+1]=b[h+1];this.positionArray[p+2]=b[h+2];this.positionArray[p+3]=b[k];this.positionArray[p+
-4]=b[k+1];this.positionArray[p+5]=b[k+2];this.positionArray[p+6]=b[m];this.positionArray[p+7]=b[m+1];this.positionArray[p+8]=b[m+2];this.normalArray[p]=c[h];this.normalArray[p+1]=c[h+1];this.normalArray[p+2]=c[h+2];this.normalArray[p+3]=c[k];this.normalArray[p+4]=c[k+1];this.normalArray[p+5]=c[k+2];this.normalArray[p+6]=c[m];this.normalArray[p+7]=c[m+1];this.normalArray[p+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),p=h*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,A,B,D,F;t<p;t++){w=this.size2*t;y=t/this.size-h;D=y*y;for(y=x;y<u;y++){A=w+this.size*y;z=y/this.size-c;F=z*z;for(z=v;z<n;z++)B=z/this.size-b,B=k/(1.0E-6+B*B+F+D)-m,B>0&&(this.field[A+z]+=B)}}};this.addPlaneX=function(b,c){var h,k,m,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(h=0;h<v;h++)if(k=h/u,k*=k,n=b/(1.0E-4+k)-c,n>0)for(k=0;k<u;k++){p=h+k*w;for(m=0;m<u;m++)x[t*m+p]+=n}};this.addPlaneY=function(b,c){var h,k,m,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(k=0;k<z;k++)if(h=k/w,h*=h,n=b/(1.0E-4+h)-c,n>0){p=k*t;for(h=0;h<w;h++){u=p+h;for(m=0;m<w;m++)v[x*m+u]+=n}}};this.addPlaneZ=function(b,c){var h,k,m,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(m=0;m<dist;m++)if(h=m/size,h*=h,n=b/(1.0E-4+h)-c,n>0){p=zd*m;for(k=0;k<size;k++){u=p+k*yd;for(h=0;h<size;h++)field[u+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,p,u,w,t,x=this.size-2;for(m=1;m<x;m++){t=this.size2*m;u=(m-this.halfsize)/this.halfsize;for(k=1;k<x;k++){w=t+this.size*k;p=(k-this.halfsize)/this.halfsize;for(h=1;h<x;h++)n=(h-this.halfsize)/this.halfsize,c=w+h,this.polygonize(n,p,u,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,p,u,w,t,x,v;for(m=0;m<k.count;m++)x=m*3,w=x+1,v=x+2,n=k.positionArray[x],
-p=k.positionArray[w],u=k.positionArray[v],t=new THREE.Vector3(n,p,u),n=k.normalArray[x],p=k.normalArray[w],u=k.normalArray[v],x=new THREE.Vector3(n,p,u),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],p=h[v],x=new THREE.Face3(x,w,v,[t,n,p]),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,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;
 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,
 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,
 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]);
 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]);
@@ -681,20 +680,20 @@ THREE.SphereCollider=function(b,c){this.center=b;this.radius=c;this.radiusSq=c*c
 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,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.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.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.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,p=c.mesh.geometry.vertices[m.b].position,u=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,p,u,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,p,w,f,this.collisionNormal,c.mesh),m<f&&(f=m,h=k,c.normal.copy(this.collisionNormal),c.normal.normalize()),m=this.rayTriangle(e,p,u,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,p=THREE.CollisionSystem.__v2;k.set(0,0,0);n.sub(e,c);p.sub(f,e);k.cross(n,p);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)>
+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};
 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.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.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,p=0,u=!0;e.origin.x<c.min.x?(f=c.min.x-e.origin.x,f/=e.direction.x,u=!1,m=-1):e.origin.x>c.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,u=!1,m=1);e.origin.y<c.min.y?(h=c.min.y-e.origin.y,h/=e.direction.y,u=!1,n=-1):e.origin.y>c.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y,
-u=!1,n=1);e.origin.z<c.min.z?(k=c.min.z-e.origin.z,k/=e.direction.z,u=!1,p=-1):e.origin.z>c.max.z&&(k=c.max.z-e.origin.z,k/=e.direction.z,u=!1,p=1);if(u)return-1;u=0;h>f&&(u=1,f=h);k>f&&(u=2,f=k);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(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,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.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.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.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.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))};
 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,p,u,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,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=
 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}"});
 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(p!==e.aspect||u!==e.near||w!==e.fov){p=e.aspect;u=e.near;w=e.fov;var B=e.projectionMatrix.clone(),D=125/30*0.5,F=D*u/125,G=u*Math.tan(w*Math.PI/360),N;m.n14=D;n.n14=-D;D=-G*p+F;N=G*p+F;B.n11=2*u/(N-D);B.n13=(N+D)/(N-D);h.projectionMatrix=B.clone();D=-G*p-F;N=G*p-F;B.n11=2*u/(N-D);B.n13=
-(N+D)/(N-D);k.projectionMatrix=B.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=u;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=u;k.far=e.far;f.call(c,b,k,x,!0);f.call(c,z,v)}};
+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;
 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)}};
 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)}};

+ 0 - 91
src/core/Geometry.js

@@ -437,97 +437,6 @@ THREE.Geometry.prototype = {
 		this.boundingSphere = { radius: radius };
 		this.boundingSphere = { radius: radius };
 
 
 	},
 	},
-
-	computeEdgeFaces: function () {
-
-		function edge_hash( a, b ) {
-
-			return Math.min( a, b ) + "_" + Math.max( a, b );
-
-		};
-
-		function addToMap( map, hash, i ) {
-
-			if ( map[ hash ] === undefined ) {
-
-				map[ hash ] = { "set": {}, "array": [] };
-				
-			} 
-			
-			map[ hash ].set[ i ] = 1;
-			map[ hash ].array.push( i );
-
-		};
-
-		var i, il, v1, v2, j, k,
-			face, faceIndices, faceIndex,
-			edge,
-			hash,
-			vfMap = {};
-
-		// construct vertex -> face map
-
-		for( i = 0, il = this.faces.length; i < il; i ++ ) {
-
-			face = this.faces[ i ];
-
-			if ( face instanceof THREE.Face3 ) {
-
-				hash = edge_hash( face.a, face.b );
-				addToMap( vfMap, hash, i );
-
-				hash = edge_hash( face.b, face.c );
-				addToMap( vfMap, hash, i );
-
-				hash = edge_hash( face.c, face.a );
-				addToMap( vfMap, hash, i );
-
-			} else if ( face instanceof THREE.Face4 ) {
-
-				// in WebGLRenderer quad is tesselated
-				// to triangles: a,b,d / b,c,d
-				// shared edge is: b,d
-
-				// add edge B-D only if you wish to slice a face4
-				// hash = edge_hash( face.b, face.d ); 
-				// addToMap( vfMap, hash, i );
-
-				hash = edge_hash( face.a, face.b );
-				addToMap( vfMap, hash, i );
-
-				hash = edge_hash( face.b, face.c );
-				addToMap( vfMap, hash, i );
-
-				hash = edge_hash( face.c, face.d );
-				addToMap( vfMap, hash, i );
-				
-				hash = edge_hash( face.d, face.a );
-				addToMap( vfMap, hash, i );
-
-			}
-
-		}
-
-		// extract faces
-		
-	
-		this.vfMap = vfMap;
-		this.edges = [];
-		
-		var numOfEdges = 0;
-		for (i in vfMap) {
-			numOfEdges++;
-			
-			edge = vfMap[i];
-			this.edges.push(edge.array);
-			
-		}
-		
-		//console.log('vfMap', vfMap, 'this.edges',this.edges, 'numOfEdges', numOfEdges);
-
-		return vfMap;
-
-	}, 
 	
 	
 	/* 
 	/* 
 	 * Merge Vertices which distances close enough 
 	 * Merge Vertices which distances close enough