Browse Source

Updated builds.

Mr.doob 14 years ago
parent
commit
bd067242da

+ 127 - 126
build/Three.js

@@ -24,8 +24,8 @@ THREE.Matrix3.prototype={transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[
 THREE.Matrix4.prototype={set:function(b,c,d,e,f,g,j,k,m,o,n,p,t,u,v,z){this.n11=b;this.n12=c;this.n13=d;this.n14=e;this.n21=f;this.n22=g;this.n23=j;this.n24=k;this.n31=m;this.n32=o;this.n33=n;this.n34=p;this.n41=t;this.n42=u;this.n43=v;this.n44=z;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,d){var e=THREE.Matrix4.__v1,
 THREE.Matrix4.prototype={set:function(b,c,d,e,f,g,j,k,m,o,n,p,t,u,v,z){this.n11=b;this.n12=c;this.n13=d;this.n14=e;this.n21=f;this.n22=g;this.n23=j;this.n24=k;this.n31=m;this.n32=o;this.n33=n;this.n34=p;this.n41=t;this.n42=u;this.n43=v;this.n44=z;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,d){var e=THREE.Matrix4.__v1,
 f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(b,c).normalize();if(g.length()===0)g.z=1;e.cross(d,g).normalize();e.length()===0&&(g.x+=1.0E-4,e.cross(d,g).normalize());f.cross(g,e).normalize();this.n11=e.x;this.n12=f.x;this.n13=g.x;this.n21=e.y;this.n22=f.y;this.n23=g.y;this.n31=e.z;this.n32=f.z;this.n33=g.z;return this},multiplyVector3:function(b){var c=b.x,d=b.y,e=b.z,f=1/(this.n41*c+this.n42*d+this.n43*e+this.n44);b.x=(this.n11*c+this.n12*d+this.n13*e+this.n14)*f;b.y=(this.n21*c+this.n22*d+this.n23*
 f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(b,c).normalize();if(g.length()===0)g.z=1;e.cross(d,g).normalize();e.length()===0&&(g.x+=1.0E-4,e.cross(d,g).normalize());f.cross(g,e).normalize();this.n11=e.x;this.n12=f.x;this.n13=g.x;this.n21=e.y;this.n22=f.y;this.n23=g.y;this.n31=e.z;this.n32=f.z;this.n33=g.z;return this},multiplyVector3:function(b){var c=b.x,d=b.y,e=b.z,f=1/(this.n41*c+this.n42*d+this.n43*e+this.n44);b.x=(this.n11*c+this.n12*d+this.n13*e+this.n14)*f;b.y=(this.n21*c+this.n22*d+this.n23*
 e+this.n24)*f;b.z=(this.n31*c+this.n32*d+this.n33*e+this.n34)*f;return b},multiplyVector4:function(b){var c=b.x,d=b.y,e=b.z,f=b.w;b.x=this.n11*c+this.n12*d+this.n13*e+this.n14*f;b.y=this.n21*c+this.n22*d+this.n23*e+this.n24*f;b.z=this.n31*c+this.n32*d+this.n33*e+this.n34*f;b.w=this.n41*c+this.n42*d+this.n43*e+this.n44*f;return b},rotateAxis:function(b){var c=b.x,d=b.y,e=b.z;b.x=c*this.n11+d*this.n12+e*this.n13;b.y=c*this.n21+d*this.n22+e*this.n23;b.z=c*this.n31+d*this.n32+e*this.n33;b.normalize();
 e+this.n24)*f;b.z=(this.n31*c+this.n32*d+this.n33*e+this.n34)*f;return b},multiplyVector4:function(b){var c=b.x,d=b.y,e=b.z,f=b.w;b.x=this.n11*c+this.n12*d+this.n13*e+this.n14*f;b.y=this.n21*c+this.n22*d+this.n23*e+this.n24*f;b.z=this.n31*c+this.n32*d+this.n33*e+this.n34*f;b.w=this.n41*c+this.n42*d+this.n43*e+this.n44*f;return b},rotateAxis:function(b){var c=b.x,d=b.y,e=b.z;b.x=c*this.n11+d*this.n12+e*this.n13;b.y=c*this.n21+d*this.n22+e*this.n23;b.z=c*this.n31+d*this.n32+e*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 d=b.n11,e=b.n12,f=b.n13,g=b.n14,j=b.n21,k=b.n22,m=b.n23,o=b.n24,n=b.n31,p=b.n32,t=b.n33,u=b.n34,v=b.n41,z=b.n42,A=b.n43,y=b.n44,F=c.n11,x=c.n12,D=c.n13,G=c.n14,B=c.n21,Q=c.n22,
-K=c.n23,L=c.n24,E=c.n31,M=c.n32,U=c.n33,h=c.n34;this.n11=d*F+e*B+f*E;this.n12=d*x+e*Q+f*M;this.n13=d*D+e*K+f*U;this.n14=d*G+e*L+f*h+g;this.n21=j*F+k*B+m*E;this.n22=j*x+k*Q+m*M;this.n23=j*D+k*K+m*U;this.n24=j*G+k*L+m*h+o;this.n31=n*F+p*B+t*E;this.n32=n*x+p*Q+t*M;this.n33=n*D+p*K+t*U;this.n34=n*G+p*L+t*h+u;this.n41=v*F+z*B+A*E;this.n42=v*x+z*Q+A*M;this.n43=v*D+z*K+A*U;this.n44=v*G+z*L+A*h+y;return this},multiplyToArray:function(b,c,d){this.multiply(b,c);d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=
+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 d=b.n11,e=b.n12,f=b.n13,g=b.n14,j=b.n21,k=b.n22,m=b.n23,o=b.n24,n=b.n31,p=b.n32,t=b.n33,u=b.n34,v=b.n41,z=b.n42,A=b.n43,x=b.n44,F=c.n11,y=c.n12,D=c.n13,G=c.n14,B=c.n21,Q=c.n22,
+K=c.n23,L=c.n24,E=c.n31,N=c.n32,U=c.n33,h=c.n34;this.n11=d*F+e*B+f*E;this.n12=d*y+e*Q+f*N;this.n13=d*D+e*K+f*U;this.n14=d*G+e*L+f*h+g;this.n21=j*F+k*B+m*E;this.n22=j*y+k*Q+m*N;this.n23=j*D+k*K+m*U;this.n24=j*G+k*L+m*h+o;this.n31=n*F+p*B+t*E;this.n32=n*y+p*Q+t*N;this.n33=n*D+p*K+t*U;this.n34=n*G+p*L+t*h+u;this.n41=v*F+z*B+A*E;this.n42=v*y+z*Q+A*N;this.n43=v*D+z*K+A*U;this.n44=v*G+z*L+A*h+x;return this},multiplyToArray:function(b,c,d){this.multiply(b,c);d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=
 this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34;d[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.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34;d[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,d=this.n13,e=this.n14,f=this.n21,g=this.n22,j=this.n23,k=this.n24,m=this.n31,o=this.n32,n=this.n33,p=this.n34,t=this.n41,u=this.n42,v=this.n43,z=this.n44;return e*j*o*t-d*k*o*t-e*g*n*t+c*k*n*t+d*g*p*t-c*j*p*t-e*j*m*u+d*k*m*u+e*f*n*u-b*k*n*u-d*f*p*u+b*j*p*u+e*g*m*v-c*k*m*v-e*f*o*v+b*k*o*v+c*f*p*v-b*g*p*v-d*g*m*z+c*j*m*z+d*f*o*z-b*j*o*z-c*f*n*z+b*g*n*z},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.n11,c=this.n12,d=this.n13,e=this.n14,f=this.n21,g=this.n22,j=this.n23,k=this.n24,m=this.n31,o=this.n32,n=this.n33,p=this.n34,t=this.n41,u=this.n42,v=this.n43,z=this.n44;return e*j*o*t-d*k*o*t-e*g*n*t+c*k*n*t+d*g*p*t-c*j*p*t-e*j*m*u+d*k*m*u+e*f*n*u-b*k*n*u-d*f*p*u+b*j*p*u+e*g*m*v-c*k*m*v-e*f*o*v+b*k*o*v+c*f*p*v-b*g*p*v-d*g*m*z+c*j*m*z+d*f*o*z-b*j*o*z-c*f*n*z+b*g*n*z},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.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;
@@ -36,8 +36,8 @@ g+d,m*j-e*k,m*k+e*j,0,m*j+e*k,o*j+d,o*k-e*g,0,m*k-e*j,o*k+e*g,f*k*k+d,0,0,0,0,1)
 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){var c=b.x,d=b.y,e=b.z,b=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),g=Math.cos(e),e=Math.sin(e),j=b*d,k=c*d;this.n11=f*g;this.n12=-f*e;this.n13=d;this.n21=k*g+b*e;this.n22=-k*e+b*g;this.n23=-c*f;this.n31=-j*g+c*e;this.n32=j*e+c*g;this.n33=b*f;return this},
 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){var c=b.x,d=b.y,e=b.z,b=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),g=Math.cos(e),e=Math.sin(e),j=b*d,k=c*d;this.n11=f*g;this.n12=-f*e;this.n13=d;this.n21=k*g+b*e;this.n22=-k*e+b*g;this.n23=-c*f;this.n31=-j*g+c*e;this.n32=j*e+c*g;this.n33=b*f;return this},
 setRotationFromQuaternion:function(b){var c=b.x,d=b.y,e=b.z,f=b.w,g=c+c,j=d+d,k=e+e,b=c*g,m=c*j;c*=k;var o=d*j;d*=k;e*=k;g*=f;j*=f;f*=k;this.n11=1-(o+e);this.n12=m-f;this.n13=c+j;this.n21=m+f;this.n22=1-(b+e);this.n23=d-g;this.n31=c-j;this.n32=d+g;this.n33=1-(b+o);return this},scale:function(b){var c=b.x,d=b.y,b=b.z;this.n11*=c;this.n12*=d;this.n13*=b;this.n21*=c;this.n22*=d;this.n23*=b;this.n31*=c;this.n32*=d;this.n33*=b;this.n41*=c;this.n42*=d;this.n43*=b;return this},extractPosition:function(b){this.n14=
 setRotationFromQuaternion:function(b){var c=b.x,d=b.y,e=b.z,f=b.w,g=c+c,j=d+d,k=e+e,b=c*g,m=c*j;c*=k;var o=d*j;d*=k;e*=k;g*=f;j*=f;f*=k;this.n11=1-(o+e);this.n12=m-f;this.n13=c+j;this.n21=m+f;this.n22=1-(b+e);this.n23=d-g;this.n31=c-j;this.n32=d+g;this.n33=1-(b+o);return this},scale:function(b){var c=b.x,d=b.y,b=b.z;this.n11*=c;this.n12*=d;this.n13*=b;this.n21*=c;this.n22*=d;this.n23*=b;this.n31*=c;this.n32*=d;this.n33*=b;this.n41*=c;this.n42*=d;this.n43*=b;return this},extractPosition:function(b){this.n14=
 b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var d=1/c.x,e=1/c.y,f=1/c.z;this.n11=b.n11*d;this.n21=b.n21*d;this.n31=b.n31*d;this.n12=b.n12*e;this.n22=b.n22*e;this.n32=b.n32*e;this.n13=b.n13*f;this.n23=b.n23*f;this.n33=b.n33*f}};
 b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var d=1/c.x,e=1/c.y,f=1/c.z;this.n11=b.n11*d;this.n21=b.n21*d;this.n31=b.n31*d;this.n12=b.n12*e;this.n22=b.n22*e;this.n32=b.n32*e;this.n13=b.n13*f;this.n23=b.n23*f;this.n33=b.n33*f}};
-THREE.Matrix4.makeInvert=function(b,c){var d=b.n11,e=b.n12,f=b.n13,g=b.n14,j=b.n21,k=b.n22,m=b.n23,o=b.n24,n=b.n31,p=b.n32,t=b.n33,u=b.n34,v=b.n41,z=b.n42,A=b.n43,y=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=m*u*z-o*t*z+o*p*A-k*u*A-m*p*y+k*t*y;c.n12=g*t*z-f*u*z-g*p*A+e*u*A+f*p*y-e*t*y;c.n13=f*o*z-g*m*z+g*k*A-e*o*A-f*k*y+e*m*y;c.n14=g*m*p-f*o*p-g*k*t+e*o*t+f*k*u-e*m*u;c.n21=o*t*v-m*u*v-o*n*A+j*u*A+m*n*y-j*t*y;c.n22=f*u*v-g*t*v+g*n*A-d*u*A-f*n*y+d*t*y;c.n23=g*m*v-f*o*v-g*j*A+d*o*A+f*j*y-d*m*y;c.n24=
-f*o*n-g*m*n+g*j*t-d*o*t-f*j*u+d*m*u;c.n31=k*u*v-o*p*v+o*n*z-j*u*z-k*n*y+j*p*y;c.n32=g*p*v-e*u*v-g*n*z+d*u*z+e*n*y-d*p*y;c.n33=f*o*v-g*k*v+g*j*z-d*o*z-e*j*y+d*k*y;c.n34=g*k*n-e*o*n-g*j*p+d*o*p+e*j*u-d*k*u;c.n41=m*p*v-k*t*v-m*n*z+j*t*z+k*n*A-j*p*A;c.n42=e*t*v-f*p*v+f*n*z-d*t*z-e*n*A+d*p*A;c.n43=f*k*v-e*m*v-f*j*z+d*m*z+e*j*A-d*k*A;c.n44=e*m*n-f*k*n+f*j*p-d*m*p-e*j*t+d*k*t;c.multiplyScalar(1/b.determinant());return c};
+THREE.Matrix4.makeInvert=function(b,c){var d=b.n11,e=b.n12,f=b.n13,g=b.n14,j=b.n21,k=b.n22,m=b.n23,o=b.n24,n=b.n31,p=b.n32,t=b.n33,u=b.n34,v=b.n41,z=b.n42,A=b.n43,x=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=m*u*z-o*t*z+o*p*A-k*u*A-m*p*x+k*t*x;c.n12=g*t*z-f*u*z-g*p*A+e*u*A+f*p*x-e*t*x;c.n13=f*o*z-g*m*z+g*k*A-e*o*A-f*k*x+e*m*x;c.n14=g*m*p-f*o*p-g*k*t+e*o*t+f*k*u-e*m*u;c.n21=o*t*v-m*u*v-o*n*A+j*u*A+m*n*x-j*t*x;c.n22=f*u*v-g*t*v+g*n*A-d*u*A-f*n*x+d*t*x;c.n23=g*m*v-f*o*v-g*j*A+d*o*A+f*j*x-d*m*x;c.n24=
+f*o*n-g*m*n+g*j*t-d*o*t-f*j*u+d*m*u;c.n31=k*u*v-o*p*v+o*n*z-j*u*z-k*n*x+j*p*x;c.n32=g*p*v-e*u*v-g*n*z+d*u*z+e*n*x-d*p*x;c.n33=f*o*v-g*k*v+g*j*z-d*o*z-e*j*x+d*k*x;c.n34=g*k*n-e*o*n-g*j*p+d*o*p+e*j*u-d*k*u;c.n41=m*p*v-k*t*v-m*n*z+j*t*z+k*n*A-j*p*A;c.n42=e*t*v-f*p*v+f*n*z-d*t*z-e*n*A+d*p*A;c.n43=f*k*v-e*m*v-f*j*z+d*m*z+e*j*A-d*k*A;c.n44=e*m*n-f*k*n+f*j*p-d*m*p-e*j*t+d*k*t;c.multiplyScalar(1/b.determinant());return c};
 THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,d=c.m,e=b.n33*b.n22-b.n32*b.n23,f=-b.n33*b.n21+b.n31*b.n23,g=b.n32*b.n21-b.n31*b.n22,j=-b.n33*b.n12+b.n32*b.n13,k=b.n33*b.n11-b.n31*b.n13,m=-b.n32*b.n11+b.n31*b.n12,o=b.n23*b.n12-b.n22*b.n13,n=-b.n23*b.n11+b.n21*b.n13,p=b.n22*b.n11-b.n21*b.n12,b=b.n11*e+b.n21*j+b.n31*o;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;d[0]=b*e;d[1]=b*f;d[2]=b*g;d[3]=b*j;d[4]=b*k;d[5]=b*m;d[6]=b*o;d[7]=b*n;d[8]=b*p;return c};
 THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,d=c.m,e=b.n33*b.n22-b.n32*b.n23,f=-b.n33*b.n21+b.n31*b.n23,g=b.n32*b.n21-b.n31*b.n22,j=-b.n33*b.n12+b.n32*b.n13,k=b.n33*b.n11-b.n31*b.n13,m=-b.n32*b.n11+b.n31*b.n12,o=b.n23*b.n12-b.n22*b.n13,n=-b.n23*b.n11+b.n21*b.n13,p=b.n22*b.n11-b.n21*b.n12,b=b.n11*e+b.n21*j+b.n31*o;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;d[0]=b*e;d[1]=b*f;d[2]=b*g;d[3]=b*j;d[4]=b*k;d[5]=b*m;d[6]=b*o;d[7]=b*n;d[8]=b*p;return c};
 THREE.Matrix4.makeFrustum=function(b,c,d,e,f,g){var j;j=new THREE.Matrix4;j.n11=2*f/(c-b);j.n12=0;j.n13=(c+b)/(c-b);j.n14=0;j.n21=0;j.n22=2*f/(e-d);j.n23=(e+d)/(e-d);j.n24=0;j.n31=0;j.n32=0;j.n33=-(g+f)/(g-f);j.n34=-2*g*f/(g-f);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};THREE.Matrix4.makePerspective=function(b,c,d,e){var f,b=d*Math.tan(b*Math.PI/360);f=-b;return THREE.Matrix4.makeFrustum(f*c,b*c,f,b,d,e)};
 THREE.Matrix4.makeFrustum=function(b,c,d,e,f,g){var j;j=new THREE.Matrix4;j.n11=2*f/(c-b);j.n12=0;j.n13=(c+b)/(c-b);j.n14=0;j.n21=0;j.n22=2*f/(e-d);j.n23=(e+d)/(e-d);j.n24=0;j.n31=0;j.n32=0;j.n33=-(g+f)/(g-f);j.n34=-2*g*f/(g-f);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};THREE.Matrix4.makePerspective=function(b,c,d,e){var f,b=d*Math.tan(b*Math.PI/360);f=-b;return THREE.Matrix4.makeFrustum(f*c,b*c,f,b,d,e)};
 THREE.Matrix4.makeOrtho=function(b,c,d,e,f,g){var j,k,m,o;j=new THREE.Matrix4;k=c-b;m=d-e;o=g-f;j.n11=2/k;j.n12=0;j.n13=0;j.n14=-((c+b)/k);j.n21=0;j.n22=2/m;j.n23=0;j.n24=-((d+e)/m);j.n31=0;j.n32=0;j.n33=-2/o;j.n34=-((g+f)/o);j.n41=0;j.n42=0;j.n43=0;j.n44=1;return j};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;
 THREE.Matrix4.makeOrtho=function(b,c,d,e,f,g){var j,k,m,o;j=new THREE.Matrix4;k=c-b;m=d-e;o=g-f;j.n11=2/k;j.n12=0;j.n13=0;j.n14=-((c+b)/k);j.n21=0;j.n22=2/m;j.n23=0;j.n24=-((d+e)/m);j.n31=0;j.n32=0;j.n33=-2/o;j.n34=-((g+f)/o);j.n41=0;j.n42=0;j.n43=0;j.n44=1;return j};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;
@@ -51,7 +51,7 @@ THREE.Quaternion.prototype={set:function(b,c,d,e){this.x=b;this.y=c;this.z=d;thi
 e;this.z=b.z*e;this.w=Math.cos(d);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},
 e;this.z=b.z*e;this.w=Math.cos(d);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,d=this.y,e=this.z,f=this.w,g=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+f*g+d*k-e*j;this.y=d*b+f*j+e*g-c*k;this.z=e*b+f*k+c*j-d*g;this.w=f*b-c*g-d*j-e*k;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 d=b.x,e=b.y,f=b.z,g=this.x,j=this.y,k=this.z,m=this.w,o=m*d+j*f-k*e,n=
 multiplySelf:function(b){var c=this.x,d=this.y,e=this.z,f=this.w,g=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+f*g+d*k-e*j;this.y=d*b+f*j+e*g-c*k;this.z=e*b+f*k+c*j-d*g;this.w=f*b-c*g-d*j-e*k;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 d=b.x,e=b.y,f=b.z,g=this.x,j=this.y,k=this.z,m=this.w,o=m*d+j*f-k*e,n=
 m*e+k*d-g*f,p=m*f+g*e-j*d,d=-g*d-j*e-k*f;c.x=o*m+d*-g+n*-k-p*-j;c.y=n*m+d*-j+p*-g-o*-k;c.z=p*m+d*-k+o*-j-n*-g;return c}};
 m*e+k*d-g*f,p=m*f+g*e-j*d,d=-g*d-j*e-k*f;c.x=o*m+d*-g+n*-k-p*-j;c.y=n*m+d*-j+p*-g-o*-k;c.z=p*m+d*-k+o*-j-n*-g;return c}};
-THREE.Quaternion.slerp=function(b,c,d,e){var f=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(f)>=1)return d.w=b.w,d.x=b.x,d.y=b.y,d.z=b.z,d;var g=Math.acos(f),j=Math.sqrt(1-f*f);if(Math.abs(j)<0.0010)return d.w=0.5*(b.w+c.w),d.x=0.5*(b.x+c.x),d.y=0.5*(b.y+c.y),d.z=0.5*(b.z+c.z),d;f=Math.sin((1-e)*g)/j;e=Math.sin(e*g)/j;d.w=b.w*f+c.w*e;d.x=b.x*f+c.x*e;d.y=b.y*f+c.y*e;d.z=b.z*f+c.z*e;return d};THREE.Vertex=function(b){this.position=b||new THREE.Vector3};
+THREE.Quaternion.slerp=function(b,c,d,e){var f=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(f)>=1)return d.w=b.w,d.x=b.x,d.y=b.y,d.z=b.z,d;var g=Math.acos(f),j=Math.sqrt(1-f*f);if(Math.abs(j)<0.001)return d.w=0.5*(b.w+c.w),d.x=0.5*(b.x+c.x),d.y=0.5*(b.y+c.y),d.z=0.5*(b.z+c.z),d;f=Math.sin((1-e)*g)/j;e=Math.sin(e*g)/j;d.w=b.w*f+c.w*e;d.x=b.x*f+c.x*e;d.y=b.y*f+c.y*e;d.z=b.z*f+c.z*e;return d};THREE.Vertex=function(b){this.position=b||new THREE.Vector3};
 THREE.Face3=function(b,c,d,e,f,g){this.a=b;this.b=c;this.c=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Face3=function(b,c,d,e,f,g){this.a=b;this.b=c;this.c=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Face4=function(b,c,d,e,f,g,j){this.a=b;this.b=c;this.c=d;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.set(b||0,c||0)};
 THREE.Face4=function(b,c,d,e,f,g,j){this.a=b;this.b=c;this.c=d;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.set(b||0,c||0)};
 THREE.UV.prototype={set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.set(b.u,b.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
 THREE.UV.prototype={set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.set(b.u,b.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
@@ -59,8 +59,8 @@ THREE.Geometry.prototype={computeCentroids:function(){var b,c,d;b=0;for(c=this.f
 d.centroid.addSelf(this.vertices[d.d].position),d.centroid.divideScalar(4))},computeFaceNormals:function(b){var c,d,e,f,g,j,k=new THREE.Vector3,m=new THREE.Vector3;e=0;for(f=this.faces.length;e<f;e++){g=this.faces[e];if(b&&g.vertexNormals.length){k.set(0,0,0);c=0;for(d=g.vertexNormals.length;c<d;c++)k.addSelf(g.vertexNormals[c]);k.divideScalar(3)}else c=this.vertices[g.a],d=this.vertices[g.b],j=this.vertices[g.c],k.sub(j.position,d.position),m.sub(c.position,d.position),k.crossSelf(m);k.isZero()||
 d.centroid.addSelf(this.vertices[d.d].position),d.centroid.divideScalar(4))},computeFaceNormals:function(b){var c,d,e,f,g,j,k=new THREE.Vector3,m=new THREE.Vector3;e=0;for(f=this.faces.length;e<f;e++){g=this.faces[e];if(b&&g.vertexNormals.length){k.set(0,0,0);c=0;for(d=g.vertexNormals.length;c<d;c++)k.addSelf(g.vertexNormals[c]);k.divideScalar(3)}else c=this.vertices[g.a],d=this.vertices[g.b],j=this.vertices[g.c],k.sub(j.position,d.position),m.sub(c.position,d.position),k.crossSelf(m);k.isZero()||
 k.normalize();g.normal.copy(k)}},computeVertexNormals:function(){var b,c,d,e;if(this.__tmpVertices==void 0){e=this.__tmpVertices=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)e[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)if(d=this.faces[b],d instanceof THREE.Face3)d.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(d instanceof THREE.Face4)d.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{e=
 k.normalize();g.normal.copy(k)}},computeVertexNormals:function(){var b,c,d,e;if(this.__tmpVertices==void 0){e=this.__tmpVertices=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)e[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)if(d=this.faces[b],d instanceof THREE.Face3)d.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(d instanceof THREE.Face4)d.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{e=
 this.__tmpVertices;b=0;for(c=this.vertices.length;b<c;b++)e[b].set(0,0,0)}b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d instanceof THREE.Face3?(e[d.a].addSelf(d.normal),e[d.b].addSelf(d.normal),e[d.c].addSelf(d.normal)):d instanceof THREE.Face4&&(e[d.a].addSelf(d.normal),e[d.b].addSelf(d.normal),e[d.c].addSelf(d.normal),e[d.d].addSelf(d.normal));b=0;for(c=this.vertices.length;b<c;b++)e[b].normalize();b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d instanceof THREE.Face3?(d.vertexNormals[0].copy(e[d.a]),
 this.__tmpVertices;b=0;for(c=this.vertices.length;b<c;b++)e[b].set(0,0,0)}b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d instanceof THREE.Face3?(e[d.a].addSelf(d.normal),e[d.b].addSelf(d.normal),e[d.c].addSelf(d.normal)):d instanceof THREE.Face4&&(e[d.a].addSelf(d.normal),e[d.b].addSelf(d.normal),e[d.c].addSelf(d.normal),e[d.d].addSelf(d.normal));b=0;for(c=this.vertices.length;b<c;b++)e[b].normalize();b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d instanceof THREE.Face3?(d.vertexNormals[0].copy(e[d.a]),
-d.vertexNormals[1].copy(e[d.b]),d.vertexNormals[2].copy(e[d.c])):d instanceof THREE.Face4&&(d.vertexNormals[0].copy(e[d.a]),d.vertexNormals[1].copy(e[d.b]),d.vertexNormals[2].copy(e[d.c]),d.vertexNormals[3].copy(e[d.d]))},computeTangents:function(){function b(b,d,c,e,h,f,g){k=b.vertices[d].position;m=b.vertices[c].position;o=b.vertices[e].position;n=j[h];p=j[f];t=j[g];u=m.x-k.x;v=o.x-k.x;z=m.y-k.y;A=o.y-k.y;y=m.z-k.z;F=o.z-k.z;x=p.u-n.u;D=t.u-n.u;G=p.v-n.v;B=t.v-n.v;Q=1/(x*B-D*G);M.set((B*u-G*v)*
-Q,(B*z-G*A)*Q,(B*y-G*F)*Q);U.set((x*v-D*u)*Q,(x*A-D*z)*Q,(x*F-D*y)*Q);L[d].addSelf(M);L[c].addSelf(M);L[e].addSelf(M);E[d].addSelf(U);E[c].addSelf(U);E[e].addSelf(U)}var c,d,e,f,g,j,k,m,o,n,p,t,u,v,z,A,y,F,x,D,G,B,Q,K,L=[],E=[],M=new THREE.Vector3,U=new THREE.Vector3,h=new THREE.Vector3,R=new THREE.Vector3,S=new THREE.Vector3;c=0;for(d=this.vertices.length;c<d;c++)L[c]=new THREE.Vector3,E[c]=new THREE.Vector3;c=0;for(d=this.faces.length;c<d;c++)g=this.faces[c],j=this.faceVertexUvs[0][c],g instanceof
+d.vertexNormals[1].copy(e[d.b]),d.vertexNormals[2].copy(e[d.c])):d instanceof THREE.Face4&&(d.vertexNormals[0].copy(e[d.a]),d.vertexNormals[1].copy(e[d.b]),d.vertexNormals[2].copy(e[d.c]),d.vertexNormals[3].copy(e[d.d]))},computeTangents:function(){function b(b,d,c,e,h,f,g){k=b.vertices[d].position;m=b.vertices[c].position;o=b.vertices[e].position;n=j[h];p=j[f];t=j[g];u=m.x-k.x;v=o.x-k.x;z=m.y-k.y;A=o.y-k.y;x=m.z-k.z;F=o.z-k.z;y=p.u-n.u;D=t.u-n.u;G=p.v-n.v;B=t.v-n.v;Q=1/(y*B-D*G);N.set((B*u-G*v)*
+Q,(B*z-G*A)*Q,(B*x-G*F)*Q);U.set((y*v-D*u)*Q,(y*A-D*z)*Q,(y*F-D*x)*Q);L[d].addSelf(N);L[c].addSelf(N);L[e].addSelf(N);E[d].addSelf(U);E[c].addSelf(U);E[e].addSelf(U)}var c,d,e,f,g,j,k,m,o,n,p,t,u,v,z,A,x,F,y,D,G,B,Q,K,L=[],E=[],N=new THREE.Vector3,U=new THREE.Vector3,h=new THREE.Vector3,R=new THREE.Vector3,S=new THREE.Vector3;c=0;for(d=this.vertices.length;c<d;c++)L[c]=new THREE.Vector3,E[c]=new THREE.Vector3;c=0;for(d=this.faces.length;c<d;c++)g=this.faces[c],j=this.faceVertexUvs[0][c],g instanceof
 THREE.Face3?b(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(b(this,g.a,g.b,g.c,0,1,2),b(this,g.a,g.b,g.d,0,1,3));var O=["a","b","c","d"];c=0;for(d=this.faces.length;c<d;c++){g=this.faces[c];for(e=0;e<g.vertexNormals.length;e++)S.copy(g.vertexNormals[e]),f=g[O[e]],K=L[f],h.copy(K),h.subSelf(S.multiplyScalar(S.dot(K))).normalize(),R.cross(g.vertexNormals[e],K),f=R.dot(E[f]),f=f<0?-1:1,g.vertexTangents[e]=new THREE.Vector4(h.x,h.y,h.z,f)}this.hasTangents=!0},computeBoundingBox:function(){var b;
 THREE.Face3?b(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(b(this,g.a,g.b,g.c,0,1,2),b(this,g.a,g.b,g.d,0,1,3));var O=["a","b","c","d"];c=0;for(d=this.faces.length;c<d;c++){g=this.faces[c];for(e=0;e<g.vertexNormals.length;e++)S.copy(g.vertexNormals[e]),f=g[O[e]],K=L[f],h.copy(K),h.subSelf(S.multiplyScalar(S.dot(K))).normalize(),R.cross(g.vertexNormals[e],K),f=R.dot(E[f]),f=f<0?-1:1,g.vertexTangents[e]=new THREE.Vector4(h.x,h.y,h.z,f)}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,d=this.vertices.length;c<d;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;
 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,d=this.vertices.length;c<d;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,d=this.vertices.length;c<d;c++)b=Math.max(b,this.vertices[c].position.length());this.boundingSphere={radius:b}},computeEdgeFaces:function(){function b(b,d){return Math.min(b,d)+"_"+Math.max(b,d)}function c(b,d,c){b[d]===
 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,d=this.vertices.length;c<d;c++)b=Math.max(b,this.vertices[c].position.length());this.boundingSphere={radius:b}},computeEdgeFaces:function(){function b(b,d){return Math.min(b,d)+"_"+Math.max(b,d)}function c(b,d,c){b[d]===
@@ -126,12 +126,12 @@ THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.add=functi
 THREE.LOD.prototype.update=function(b,c,d){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;if(this.LODs.length>1){b=d.matrixWorldInverse;b=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(var e=1;e<this.LODs.length;e++)if(b>=this.LODs[e].visibleAtDistance)this.LODs[e-1].object3D.visible=!1,
 THREE.LOD.prototype.update=function(b,c,d){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;if(this.LODs.length>1){b=d.matrixWorldInverse;b=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(var e=1;e<this.LODs.length;e++)if(b>=this.LODs[e].visibleAtDistance)this.LODs[e-1].object3D.visible=!1,
 this.LODs[e].object3D.visible=!0;else break;for(;e<this.LODs.length;e++)this.LODs[e].object3D.visible=!1}for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,d)};THREE.ShadowVolume=function(b,c){b instanceof THREE.Mesh?(THREE.Mesh.call(this,b.geometry,c?[new THREE.ShadowVolumeDynamicMaterial]:[new THREE.ShadowVolumeDynamicMaterial]),b.addChild(this)):THREE.Mesh.call(this,b,c?[new THREE.ShadowVolumeDynamicMaterial]:[new THREE.ShadowVolumeDynamicMaterial]);this.calculateShadowVolumeGeometry()};
 this.LODs[e].object3D.visible=!0;else break;for(;e<this.LODs.length;e++)this.LODs[e].object3D.visible=!1}for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,d)};THREE.ShadowVolume=function(b,c){b instanceof THREE.Mesh?(THREE.Mesh.call(this,b.geometry,c?[new THREE.ShadowVolumeDynamicMaterial]:[new THREE.ShadowVolumeDynamicMaterial]),b.addChild(this)):THREE.Mesh.call(this,b,c?[new THREE.ShadowVolumeDynamicMaterial]:[new THREE.ShadowVolumeDynamicMaterial]);this.calculateShadowVolumeGeometry()};
 THREE.ShadowVolume.prototype=new THREE.Mesh;THREE.ShadowVolume.prototype.constructor=THREE.ShadowVolume;THREE.ShadowVolume.prototype.supr=THREE.Mesh.prototype;
 THREE.ShadowVolume.prototype=new THREE.Mesh;THREE.ShadowVolume.prototype.constructor=THREE.ShadowVolume;THREE.ShadowVolume.prototype.supr=THREE.Mesh.prototype;
-THREE.ShadowVolume.prototype.calculateShadowVolumeGeometry=function(){if(this.geometry.edges&&this.geometry.edges.length){var b,c,d,e,f,g,j,k,m,o,n,p,t,u,v=new THREE.Geometry;v.vertices=this.geometry.vertices;e=v.faces=this.geometry.faces;var z=v.egdes=this.geometry.edges,A=v.edgeFaces=[];f=0;var y=[];b=0;for(c=e.length;b<c;b++)if(d=e[b],y.push(f),f+=d instanceof THREE.Face3?3:4,d.vertexNormals[0]=d.normal,d.vertexNormals[1]=d.normal,d.vertexNormals[2]=d.normal,d instanceof THREE.Face4)d.vertexNormals[3]=
-d.normal;b=0;for(c=z.length;b<c;b++)k=z[b],d=k.faces[0],e=k.faces[1],f=k.faceIndices[0],g=k.faceIndices[1],j=k.vertexIndices[0],k=k.vertexIndices[1],d.a===j?(m="a",n=y[f]+0):d.b===j?(m="b",n=y[f]+1):d.c===j?(m="c",n=y[f]+2):d.d===j&&(m="d",n=y[f]+3),d.a===k?(m+="a",p=y[f]+0):d.b===k?(m+="b",p=y[f]+1):d.c===k?(m+="c",p=y[f]+2):d.d===k&&(m+="d",p=y[f]+3),e.a===j?(o="a",t=y[g]+0):e.b===j?(o="b",t=y[g]+1):e.c===j?(o="c",t=y[g]+2):e.d===j&&(o="d",t=y[g]+3),e.a===k?(o+="a",u=y[g]+0):e.b===k?(o+="b",u=y[g]+
-1):e.c===k?(o+="c",u=y[g]+2):e.d===k&&(o+="d",u=y[g]+3),m==="ac"||m==="ad"||m==="ca"||m==="da"?n>p&&(d=n,n=p,p=d):n<p&&(d=n,n=p,p=d),o==="ac"||o==="ad"||o==="ca"||o==="da"?t>u&&(d=t,t=u,u=d):t<u&&(d=t,t=u,u=d),d=new THREE.Face4(n,p,t,u),d.normal.set(1,0,0),A.push(d);this.geometry=v}else this.calculateShadowVolumeGeometryWithoutEdgeInfo(this.geometry)};
+THREE.ShadowVolume.prototype.calculateShadowVolumeGeometry=function(){if(this.geometry.edges&&this.geometry.edges.length){var b,c,d,e,f,g,j,k,m,o,n,p,t,u,v=new THREE.Geometry;v.vertices=this.geometry.vertices;e=v.faces=this.geometry.faces;var z=v.egdes=this.geometry.edges,A=v.edgeFaces=[];f=0;var x=[];b=0;for(c=e.length;b<c;b++)if(d=e[b],x.push(f),f+=d instanceof THREE.Face3?3:4,d.vertexNormals[0]=d.normal,d.vertexNormals[1]=d.normal,d.vertexNormals[2]=d.normal,d instanceof THREE.Face4)d.vertexNormals[3]=
+d.normal;b=0;for(c=z.length;b<c;b++)k=z[b],d=k.faces[0],e=k.faces[1],f=k.faceIndices[0],g=k.faceIndices[1],j=k.vertexIndices[0],k=k.vertexIndices[1],d.a===j?(m="a",n=x[f]+0):d.b===j?(m="b",n=x[f]+1):d.c===j?(m="c",n=x[f]+2):d.d===j&&(m="d",n=x[f]+3),d.a===k?(m+="a",p=x[f]+0):d.b===k?(m+="b",p=x[f]+1):d.c===k?(m+="c",p=x[f]+2):d.d===k&&(m+="d",p=x[f]+3),e.a===j?(o="a",t=x[g]+0):e.b===j?(o="b",t=x[g]+1):e.c===j?(o="c",t=x[g]+2):e.d===j&&(o="d",t=x[g]+3),e.a===k?(o+="a",u=x[g]+0):e.b===k?(o+="b",u=x[g]+
+1):e.c===k?(o+="c",u=x[g]+2):e.d===k&&(o+="d",u=x[g]+3),m==="ac"||m==="ad"||m==="ca"||m==="da"?n>p&&(d=n,n=p,p=d):n<p&&(d=n,n=p,p=d),o==="ac"||o==="ad"||o==="ca"||o==="da"?t>u&&(d=t,t=u,u=d):t<u&&(d=t,t=u,u=d),d=new THREE.Face4(n,p,t,u),d.normal.set(1,0,0),A.push(d);this.geometry=v}else this.calculateShadowVolumeGeometryWithoutEdgeInfo(this.geometry)};
 THREE.ShadowVolume.prototype.calculateShadowVolumeGeometryWithoutEdgeInfo=function(b){this.geometry=new THREE.Geometry;this.geometry.boundingSphere=b.boundingSphere;this.geometry.edgeFaces=[];var c=this.geometry.vertices,d=this.geometry.faces,e=this.geometry.edgeFaces,f=b.faces,b=b.vertices,g=f.length,j,k,m,o,n,p=["a","b","c","d"];for(m=0;m<g;m++){k=c.length;j=f[m];j instanceof THREE.Face4?(o=4,k=new THREE.Face4(k,k+1,k+2,k+3)):(o=3,k=new THREE.Face3(k,k+1,k+2));k.normal.copy(j.normal);d.push(k);
 THREE.ShadowVolume.prototype.calculateShadowVolumeGeometryWithoutEdgeInfo=function(b){this.geometry=new THREE.Geometry;this.geometry.boundingSphere=b.boundingSphere;this.geometry.edgeFaces=[];var c=this.geometry.vertices,d=this.geometry.faces,e=this.geometry.edgeFaces,f=b.faces,b=b.vertices,g=f.length,j,k,m,o,n,p=["a","b","c","d"];for(m=0;m<g;m++){k=c.length;j=f[m];j instanceof THREE.Face4?(o=4,k=new THREE.Face4(k,k+1,k+2,k+3)):(o=3,k=new THREE.Face3(k,k+1,k+2));k.normal.copy(j.normal);d.push(k);
 for(k=0;k<o;k++)n=b[j[p[k]]],c.push(new THREE.Vertex(n.position.clone()))}for(g=0;g<f.length-1;g++){b=d[g];for(j=g+1;j<f.length;j++)k=d[j],k=this.facesShareEdge(c,b,k),k!==void 0&&(k=new THREE.Face4(k.indices[0],k.indices[3],k.indices[2],k.indices[1]),k.normal.set(1,0,0),e.push(k))}};
 for(k=0;k<o;k++)n=b[j[p[k]]],c.push(new THREE.Vertex(n.position.clone()))}for(g=0;g<f.length-1;g++){b=d[g];for(j=g+1;j<f.length;j++)k=d[j],k=this.facesShareEdge(c,b,k),k!==void 0&&(k=new THREE.Face4(k.indices[0],k.indices[3],k.indices[2],k.indices[1]),k.normal.set(1,0,0),e.push(k))}};
-THREE.ShadowVolume.prototype.facesShareEdge=function(b,c,d){var e,f,g,j,k,m,o,n,p,t,u,v,z,A=0,y=["a","b","c","d"];e=c instanceof THREE.Face4?4:3;f=d instanceof THREE.Face4?4:3;for(v=0;v<e;v++){g=c[y[v]];k=b[g];for(z=0;z<f;z++)if(j=d[y[z]],m=b[j],Math.abs(k.position.x-m.position.x)<1.0E-4&&Math.abs(k.position.y-m.position.y)<1.0E-4&&Math.abs(k.position.z-m.position.z)<1.0E-4&&(A++,A===1&&(o=k,n=m,p=g,t=j,u=y[v]),A===2))return u+=y[v],u==="ad"||u==="ac"?{faces:[c,d],vertices:[o,n,m,k],indices:[p,t,
+THREE.ShadowVolume.prototype.facesShareEdge=function(b,c,d){var e,f,g,j,k,m,o,n,p,t,u,v,z,A=0,x=["a","b","c","d"];e=c instanceof THREE.Face4?4:3;f=d instanceof THREE.Face4?4:3;for(v=0;v<e;v++){g=c[x[v]];k=b[g];for(z=0;z<f;z++)if(j=d[x[z]],m=b[j],Math.abs(k.position.x-m.position.x)<1.0E-4&&Math.abs(k.position.y-m.position.y)<1.0E-4&&Math.abs(k.position.z-m.position.z)<1.0E-4&&(A++,A===1&&(o=k,n=m,p=g,t=j,u=x[v]),A===2))return u+=x[v],u==="ad"||u==="ac"?{faces:[c,d],vertices:[o,n,m,k],indices:[p,t,
 j,g],vertexTypes:[1,2,2,1],extrudable:!0}:{faces:[c,d],vertices:[o,k,m,n],indices:[p,g,j,t],vertexTypes:[1,1,2,2],extrudable:!0}}};
 j,g],vertexTypes:[1,2,2,1],extrudable:!0}:{faces:[c,d],vertices:[o,k,m,n],indices:[p,g,j,t],vertexTypes:[1,1,2,2],extrudable:!0}}};
 THREE.Sprite=function(b){THREE.Object3D.call(this);if(b.material!==void 0)this.material=b.material,this.map=void 0,this.blending=material.blending;else if(b.map!==void 0)this.map=b.map instanceof THREE.Texture?b.map:THREE.ImageUtils.loadTexture(b.map),this.material=void 0,this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.useScreenCoordinates=b.useScreenCoordinates!==void 0?b.useScreenCoordinates:!0;this.mergeWith3D=b.mergeWith3D!==void 0?b.mergeWith3D:!this.useScreenCoordinates;
 THREE.Sprite=function(b){THREE.Object3D.call(this);if(b.material!==void 0)this.material=b.material,this.map=void 0,this.blending=material.blending;else if(b.map!==void 0)this.map=b.map instanceof THREE.Texture?b.map:THREE.ImageUtils.loadTexture(b.map),this.material=void 0,this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.useScreenCoordinates=b.useScreenCoordinates!==void 0?b.useScreenCoordinates:!0;this.mergeWith3D=b.mergeWith3D!==void 0?b.mergeWith3D:!this.useScreenCoordinates;
 this.affectedByDistance=b.affectedByDistance!==void 0?b.affectedByDistance:!this.useScreenCoordinates;this.alignment=b.alignment instanceof THREE.Vector2?b.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.supr=THREE.Object3D.prototype;
 this.affectedByDistance=b.affectedByDistance!==void 0?b.affectedByDistance:!this.useScreenCoordinates;this.alignment=b.alignment instanceof THREE.Vector2?b.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.supr=THREE.Object3D.prototype;
@@ -141,7 +141,7 @@ THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.c
 THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(b instanceof THREE.Sound)this.sounds.indexOf(b)===-1&&this.sounds.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1)this.objects.push(b),this.__objectsAdded.push(b);for(var c=0;c<b.children.length;c++)this.addChildRecurse(b.children[c])};
 THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(b instanceof THREE.Sound)this.sounds.indexOf(b)===-1&&this.sounds.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1)this.objects.push(b),this.__objectsAdded.push(b);for(var c=0;c<b.children.length;c++)this.addChildRecurse(b.children[c])};
 THREE.Scene.prototype.removeChild=function(b){this.supr.removeChild.call(this,b);this.removeChildRecurse(b)};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.Sound?(c=this.sounds.indexOf(b),c!==-1&&this.sounds.splice(c,1)):b instanceof THREE.Camera||(c=this.objects.indexOf(b),c!==-1&&(this.objects.splice(c,1),this.__objectsRemoved.push(b)));for(c=0;c<b.children.length;c++)this.removeChildRecurse(b.children[c])};
 THREE.Scene.prototype.removeChild=function(b){this.supr.removeChild.call(this,b);this.removeChildRecurse(b)};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.Sound?(c=this.sounds.indexOf(b),c!==-1&&this.sounds.splice(c,1)):b instanceof THREE.Camera||(c=this.objects.indexOf(b),c!==-1&&(this.objects.splice(c,1),this.__objectsRemoved.push(b)));for(c=0;c<b.children.length;c++)this.removeChildRecurse(b.children[c])};
 THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(b,c,d){this.color=new THREE.Color(b);this.near=c||1;this.far=d||1E3};THREE.FogExp2=function(b,c){this.color=new THREE.Color(b);this.density=c!==void 0?c:2.5E-4};
 THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(b,c,d){this.color=new THREE.Color(b);this.near=c||1;this.far=d||1E3};THREE.FogExp2=function(b,c){this.color=new THREE.Color(b);this.density=c!==void 0?c:2.5E-4};
-THREE.Projector=function(){function b(){var b=m[k]=m[k]||new THREE.RenderableVertex;k++;return b}function c(b,d){return d.z-b.z}function d(b,d){var c=0,e=1,f=b.z+b.w,g=d.z+d.w,j=-b.z+b.w,k=-d.z+d.w;return f>=0&&g>=0&&j>=0&&k>=0?!0:f<0&&g<0||j<0&&k<0?!1:(f<0?c=Math.max(c,f/(f-g)):g<0&&(e=Math.min(e,f/(f-g))),j<0?c=Math.max(c,j/(j-k)):k<0&&(e=Math.min(e,j/(j-k))),e<c?!1:(b.lerpSelf(d,c),d.lerpSelf(b,1-e),!0))}var e,f,g=[],j,k,m=[],o,n,p=[],t,u=[],v,z,A=[],y,F,x=[],D=new THREE.Vector4,G=new THREE.Vector4,
+THREE.Projector=function(){function b(){var b=m[k]=m[k]||new THREE.RenderableVertex;k++;return b}function c(b,d){return d.z-b.z}function d(b,d){var c=0,e=1,f=b.z+b.w,g=d.z+d.w,j=-b.z+b.w,k=-d.z+d.w;return f>=0&&g>=0&&j>=0&&k>=0?!0:f<0&&g<0||j<0&&k<0?!1:(f<0?c=Math.max(c,f/(f-g)):g<0&&(e=Math.min(e,f/(f-g))),j<0?c=Math.max(c,j/(j-k)):k<0&&(e=Math.min(e,j/(j-k))),e<c?!1:(b.lerpSelf(d,c),d.lerpSelf(b,1-e),!0))}var e,f,g=[],j,k,m=[],o,n,p=[],t,u=[],v,z,A=[],x,F,y=[],D=new THREE.Vector4,G=new THREE.Vector4,
 B=new THREE.Matrix4,Q=new THREE.Matrix4,K=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],L=new THREE.Vector4,E=new THREE.Vector4;this.projectVector=function(b,d){B.multiply(d.projectionMatrix,d.matrixWorldInverse);B.multiplyVector3(b);return b};this.unprojectVector=function(b,d){B.multiply(d.matrixWorld,THREE.Matrix4.makeInvert(d.projectionMatrix));B.multiplyVector3(b);return b};this.projectObjects=function(b,d,h){var d=[],j,k,m;f=0;k=
 B=new THREE.Matrix4,Q=new THREE.Matrix4,K=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],L=new THREE.Vector4,E=new THREE.Vector4;this.projectVector=function(b,d){B.multiply(d.projectionMatrix,d.matrixWorldInverse);B.multiplyVector3(b);return b};this.unprojectVector=function(b,d){B.multiply(d.matrixWorld,THREE.Matrix4.makeInvert(d.projectionMatrix));B.multiplyVector3(b);return b};this.projectObjects=function(b,d,h){var d=[],j,k,m;f=0;k=
 b.objects;b=0;for(j=k.length;b<j;b++){m=k[b];var o;if(!(o=!m.visible))if(o=m instanceof THREE.Mesh){a:{o=void 0;for(var p=m.matrixWorld,n=-m.geometry.boundingSphere.radius*Math.max(m.scale.x,Math.max(m.scale.y,m.scale.z)),t=0;t<6;t++)if(o=K[t].x*p.n14+K[t].y*p.n24+K[t].z*p.n34+K[t].w,o<=n){o=!1;break a}o=!0}o=!o}if(!o)o=g[f]=g[f]||new THREE.RenderableObject,f++,e=o,D.copy(m.position),B.multiplyVector3(D),e.object=m,e.z=D.z,d.push(e)}h&&d.sort(c);return d};this.projectScene=function(e,f,h){var g=[],
 b.objects;b=0;for(j=k.length;b<j;b++){m=k[b];var o;if(!(o=!m.visible))if(o=m instanceof THREE.Mesh){a:{o=void 0;for(var p=m.matrixWorld,n=-m.geometry.boundingSphere.radius*Math.max(m.scale.x,Math.max(m.scale.y,m.scale.z)),t=0;t<6;t++)if(o=K[t].x*p.n14+K[t].y*p.n24+K[t].z*p.n34+K[t].w,o<=n){o=!1;break a}o=!0}o=!o}if(!o)o=g[f]=g[f]||new THREE.RenderableObject,f++,e=o,D.copy(m.position),B.multiplyVector3(D),e.object=m,e.z=D.z,d.push(e)}h&&d.sort(c);return d};this.projectScene=function(e,f,h){var g=[],
 D=f.near,O=f.far,aa,V,W,ga,Y,da,ea,ka,fa,I,T,Z,$,ia,X,H,ha;F=z=t=n=0;f.matrixAutoUpdate&&f.update(void 0,!0);e.update(void 0,!1,f);B.multiply(f.projectionMatrix,f.matrixWorldInverse);K[0].set(B.n41-B.n11,B.n42-B.n12,B.n43-B.n13,B.n44-B.n14);K[1].set(B.n41+B.n11,B.n42+B.n12,B.n43+B.n13,B.n44+B.n14);K[2].set(B.n41+B.n21,B.n42+B.n22,B.n43+B.n23,B.n44+B.n24);K[3].set(B.n41-B.n21,B.n42-B.n22,B.n43-B.n23,B.n44-B.n24);K[4].set(B.n41-B.n31,B.n42-B.n32,B.n43-B.n33,B.n44-B.n34);K[5].set(B.n41+B.n31,B.n42+B.n32,
 D=f.near,O=f.far,aa,V,W,ga,Y,da,ea,ka,fa,I,T,Z,$,ia,X,H,ha;F=z=t=n=0;f.matrixAutoUpdate&&f.update(void 0,!0);e.update(void 0,!1,f);B.multiply(f.projectionMatrix,f.matrixWorldInverse);K[0].set(B.n41-B.n11,B.n42-B.n12,B.n43-B.n13,B.n44-B.n14);K[1].set(B.n41+B.n11,B.n42+B.n12,B.n43+B.n13,B.n44+B.n14);K[2].set(B.n41+B.n21,B.n42+B.n22,B.n43+B.n23,B.n44+B.n24);K[3].set(B.n41-B.n21,B.n42-B.n22,B.n43-B.n23,B.n44-B.n24);K[4].set(B.n41-B.n31,B.n42-B.n32,B.n43-B.n33,B.n44-B.n34);K[5].set(B.n41+B.n31,B.n42+B.n32,
@@ -150,47 +150,47 @@ j.positionScreen.x/=j.positionScreen.w,j.positionScreen.y/=j.positionScreen.w,j.
 n++,o=ka,o.v1.copy(Y),o.v2.copy(da),o.v3.copy(ea);else continue;else if(W instanceof THREE.Face4)if(Y=m[W.a],da=m[W.b],ea=m[W.c],ka=m[W.d],Y.visible&&da.visible&&ea.visible&&ka.visible&&(I.doubleSided||I.flipSided!=((ka.positionScreen.x-Y.positionScreen.x)*(da.positionScreen.y-Y.positionScreen.y)-(ka.positionScreen.y-Y.positionScreen.y)*(da.positionScreen.x-Y.positionScreen.x)<0||(da.positionScreen.x-ea.positionScreen.x)*(ka.positionScreen.y-ea.positionScreen.y)-(da.positionScreen.y-ea.positionScreen.y)*
 n++,o=ka,o.v1.copy(Y),o.v2.copy(da),o.v3.copy(ea);else continue;else if(W instanceof THREE.Face4)if(Y=m[W.a],da=m[W.b],ea=m[W.c],ka=m[W.d],Y.visible&&da.visible&&ea.visible&&ka.visible&&(I.doubleSided||I.flipSided!=((ka.positionScreen.x-Y.positionScreen.x)*(da.positionScreen.y-Y.positionScreen.y)-(ka.positionScreen.y-Y.positionScreen.y)*(da.positionScreen.x-Y.positionScreen.x)<0||(da.positionScreen.x-ea.positionScreen.x)*(ka.positionScreen.y-ea.positionScreen.y)-(da.positionScreen.y-ea.positionScreen.y)*
 (ka.positionScreen.x-ea.positionScreen.x)<0)))ha=u[t]=u[t]||new THREE.RenderableFace4,t++,o=ha,o.v1.copy(Y),o.v2.copy(da),o.v3.copy(ea),o.v4.copy(ka);else continue;o.normalWorld.copy(W.normal);Z.multiplyVector3(o.normalWorld);o.centroidWorld.copy(W.centroid);T.multiplyVector3(o.centroidWorld);o.centroidScreen.copy(o.centroidWorld);B.multiplyVector3(o.centroidScreen);ea=W.vertexNormals;Y=0;for(da=ea.length;Y<da;Y++)ka=o.vertexNormalsWorld[Y],ka.copy(ea[Y]),Z.multiplyVector3(ka);Y=0;for(da=X.length;Y<
 (ka.positionScreen.x-ea.positionScreen.x)<0)))ha=u[t]=u[t]||new THREE.RenderableFace4,t++,o=ha,o.v1.copy(Y),o.v2.copy(da),o.v3.copy(ea),o.v4.copy(ka);else continue;o.normalWorld.copy(W.normal);Z.multiplyVector3(o.normalWorld);o.centroidWorld.copy(W.centroid);T.multiplyVector3(o.centroidWorld);o.centroidScreen.copy(o.centroidWorld);B.multiplyVector3(o.centroidScreen);ea=W.vertexNormals;Y=0;for(da=ea.length;Y<da;Y++)ka=o.vertexNormalsWorld[Y],ka.copy(ea[Y]),Z.multiplyVector3(ka);Y=0;for(da=X.length;Y<
 da;Y++)if(ha=X[Y][ga]){ea=0;for(ka=ha.length;ea<ka;ea++)o.uvs[Y][ea]=ha[ea]}o.meshMaterials=$;o.faceMaterials=W.materials;o.overdraw=ia;o.z=o.centroidScreen.z;g.push(o)}}else if(I instanceof THREE.Line){Q.multiply(B,T);ga=I.geometry.vertices;Y=b();Y.positionScreen.copy(ga[0].position);Q.multiplyVector4(Y.positionScreen);V=1;for(W=ga.length;V<W;V++)if(Y=b(),Y.positionScreen.copy(ga[V].position),Q.multiplyVector4(Y.positionScreen),da=m[k-2],L.copy(Y.positionScreen),E.copy(da.positionScreen),d(L,E))L.multiplyScalar(1/
 da;Y++)if(ha=X[Y][ga]){ea=0;for(ka=ha.length;ea<ka;ea++)o.uvs[Y][ea]=ha[ea]}o.meshMaterials=$;o.faceMaterials=W.materials;o.overdraw=ia;o.z=o.centroidScreen.z;g.push(o)}}else if(I instanceof THREE.Line){Q.multiply(B,T);ga=I.geometry.vertices;Y=b();Y.positionScreen.copy(ga[0].position);Q.multiplyVector4(Y.positionScreen);V=1;for(W=ga.length;V<W;V++)if(Y=b(),Y.positionScreen.copy(ga[V].position),Q.multiplyVector4(Y.positionScreen),da=m[k-2],L.copy(Y.positionScreen),E.copy(da.positionScreen),d(L,E))L.multiplyScalar(1/
-L.w),E.multiplyScalar(1/E.w),T=A[z]=A[z]||new THREE.RenderableLine,z++,v=T,v.v1.positionScreen.copy(L),v.v2.positionScreen.copy(E),v.z=Math.max(L.z,E.z),v.materials=I.materials,g.push(v)}else if(I instanceof THREE.Particle&&(G.set(I.matrixWorld.n14,I.matrixWorld.n24,I.matrixWorld.n34,1),B.multiplyVector4(G),G.z/=G.w,G.z>0&&G.z<1))T=x[F]=x[F]||new THREE.RenderableParticle,F++,y=T,y.x=G.x/G.w,y.y=G.y/G.w,y.z=G.z,y.rotation=I.rotation.z,y.scale.x=I.scale.x*Math.abs(y.x-(G.x+f.projectionMatrix.n11)/(G.w+
-f.projectionMatrix.n14)),y.scale.y=I.scale.y*Math.abs(y.y-(G.y+f.projectionMatrix.n22)/(G.w+f.projectionMatrix.n24)),y.materials=I.materials,g.push(y);h&&g.sort(c);return g}};
+L.w),E.multiplyScalar(1/E.w),T=A[z]=A[z]||new THREE.RenderableLine,z++,v=T,v.v1.positionScreen.copy(L),v.v2.positionScreen.copy(E),v.z=Math.max(L.z,E.z),v.materials=I.materials,g.push(v)}else if(I instanceof THREE.Particle&&(G.set(I.matrixWorld.n14,I.matrixWorld.n24,I.matrixWorld.n34,1),B.multiplyVector4(G),G.z/=G.w,G.z>0&&G.z<1))T=y[F]=y[F]||new THREE.RenderableParticle,F++,x=T,x.x=G.x/G.w,x.y=G.y/G.w,x.z=G.z,x.rotation=I.rotation.z,x.scale.x=I.scale.x*Math.abs(x.x-(G.x+f.projectionMatrix.n11)/(G.w+
+f.projectionMatrix.n14)),x.scale.y=I.scale.y*Math.abs(x.y-(G.y+f.projectionMatrix.n22)/(G.w+f.projectionMatrix.n24)),x.materials=I.materials,g.push(x);h&&g.sort(c);return g}};
 THREE.DOMRenderer=function(){THREE.Renderer.call(this);var b=null,c=new THREE.Projector,d,e,f,g;this.domElement=document.createElement("div");this.setSize=function(b,c){d=b;e=c;f=d/2;g=e/2};this.render=function(d,e){var m,o,n,p,t,u,v,z;b=c.projectScene(d,e);m=0;for(o=b.length;m<o;m++)if(t=b[m],t instanceof THREE.RenderableParticle){v=t.x*f+f;z=t.y*g+g;n=0;for(p=t.material.length;n<p;n++)if(u=t.material[n],u instanceof THREE.ParticleDOMMaterial)u=u.domElement,u.style.left=v+"px",u.style.top=z+"px"}}};
 THREE.DOMRenderer=function(){THREE.Renderer.call(this);var b=null,c=new THREE.Projector,d,e,f,g;this.domElement=document.createElement("div");this.setSize=function(b,c){d=b;e=c;f=d/2;g=e/2};this.render=function(d,e){var m,o,n,p,t,u,v,z;b=c.projectScene(d,e);m=0;for(o=b.length;m<o;m++)if(t=b[m],t instanceof THREE.RenderableParticle){v=t.x*f+f;z=t.y*g+g;n=0;for(p=t.material.length;n<p;n++)if(u=t.material[n],u instanceof THREE.ParticleDOMMaterial)u=u.domElement,u.style.left=v+"px",u.style.top=z+"px"}}};
-THREE.CanvasRenderer=function(b){function c(b){if(y!=b)v.globalAlpha=y=b}function d(b){if(F!=b){switch(b){case THREE.NormalBlending:v.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:v.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:v.globalCompositeOperation="darker"}F=b}}function e(b){if(x!=b.hex)x=b.hex,v.strokeStyle="#"+g(x.toString(16))}function f(b){if(D!=b.hex)D=b.hex,v.fillStyle="#"+g(D.toString(16))}function g(b){for(;b.length<6;)b="0"+b;return b}
-var j=this,k=null,m=new THREE.Projector,b=b||{},o=b.canvas!==void 0?b.canvas:document.createElement("canvas"),n,p,t,u,v=o.getContext("2d"),z=new THREE.Color(0),A=0,y=1,F=0,x=null,D=null,G=null,B=null,Q=null,K,L,E,M,U=new THREE.RenderableVertex,h=new THREE.RenderableVertex,R,S,O,aa,V,W,ga,Y,da,ea,ka,fa,I=new THREE.Color(0),T=new THREE.Color(0),Z=new THREE.Color(0),$=new THREE.Color(0),ia=new THREE.Color(0),X,H,ha,ma,ja,na,Ba,za,ca,P,ta=new THREE.Rectangle,pa=new THREE.Rectangle,N=new THREE.Rectangle,
+THREE.CanvasRenderer=function(b){function c(b){if(x!=b)v.globalAlpha=x=b}function d(b){if(F!=b){switch(b){case THREE.NormalBlending:v.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:v.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:v.globalCompositeOperation="darker"}F=b}}function e(b){if(y!=b.hex)y=b.hex,v.strokeStyle="#"+g(y.toString(16))}function f(b){if(D!=b.hex)D=b.hex,v.fillStyle="#"+g(D.toString(16))}function g(b){for(;b.length<6;)b="0"+b;return b}
+var j=this,k=null,m=new THREE.Projector,b=b||{},o=b.canvas!==void 0?b.canvas:document.createElement("canvas"),n,p,t,u,v=o.getContext("2d"),z=new THREE.Color(0),A=0,x=1,F=0,y=null,D=null,G=null,B=null,Q=null,K,L,E,N,U=new THREE.RenderableVertex,h=new THREE.RenderableVertex,R,S,O,aa,V,W,ga,Y,da,ea,ka,fa,I=new THREE.Color(0),T=new THREE.Color(0),Z=new THREE.Color(0),$=new THREE.Color(0),ia=new THREE.Color(0),X,H,ha,ma,ja,na,Ba,za,ca,P,ta=new THREE.Rectangle,pa=new THREE.Rectangle,M=new THREE.Rectangle,
 Ua=!1,sa=new THREE.Color,ua=new THREE.Color,Pa=new THREE.Color,Qa=new THREE.Color,oa=new THREE.Vector3,Ma,Na,Va,va,Oa,Ra,b=16;Ma=document.createElement("canvas");Ma.width=Ma.height=2;Na=Ma.getContext("2d");Na.fillStyle="rgba(0,0,0,1)";Na.fillRect(0,0,2,2);Va=Na.getImageData(0,0,2,2);va=Va.data;Oa=document.createElement("canvas");Oa.width=Oa.height=b;Ra=Oa.getContext("2d");Ra.translate(-b/2,-b/2);Ra.scale(b,b);b--;this.domElement=o;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,
 Ua=!1,sa=new THREE.Color,ua=new THREE.Color,Pa=new THREE.Color,Qa=new THREE.Color,oa=new THREE.Vector3,Ma,Na,Va,va,Oa,Ra,b=16;Ma=document.createElement("canvas");Ma.width=Ma.height=2;Na=Ma.getContext("2d");Na.fillStyle="rgba(0,0,0,1)";Na.fillRect(0,0,2,2);Va=Na.getImageData(0,0,2,2);va=Va.data;Oa=document.createElement("canvas");Oa.width=Oa.height=b;Ra=Oa.getContext("2d");Ra.translate(-b/2,-b/2);Ra.scale(b,b);b--;this.domElement=o;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,
-faces:0};this.setSize=function(b,d){n=b;p=d;t=n/2;u=p/2;o.width=n;o.height=p;ta.set(-t,-u,t,u);y=1;F=0;Q=B=G=D=x=null};this.setClearColor=function(b,d){z=b;A=d};this.setClearColorHex=function(b,d){z.setHex(b);A=d};this.clear=function(){v.setTransform(1,0,0,-1,t,u);if(!pa.isEmpty())pa.inflate(1),pa.minSelf(ta),z.hex==0&&A==0?v.clearRect(pa.getX(),pa.getY(),pa.getWidth(),pa.getHeight()):(d(THREE.NormalBlending),c(1),v.fillStyle="rgba("+Math.floor(z.r*255)+","+Math.floor(z.g*255)+","+Math.floor(z.b*
+faces:0};this.setSize=function(b,d){n=b;p=d;t=n/2;u=p/2;o.width=n;o.height=p;ta.set(-t,-u,t,u);x=1;F=0;Q=B=G=D=y=null};this.setClearColor=function(b,d){z=b;A=d};this.setClearColorHex=function(b,d){z.setHex(b);A=d};this.clear=function(){v.setTransform(1,0,0,-1,t,u);if(!pa.isEmpty())pa.inflate(1),pa.minSelf(ta),z.hex==0&&A==0?v.clearRect(pa.getX(),pa.getY(),pa.getWidth(),pa.getHeight()):(d(THREE.NormalBlending),c(1),v.fillStyle="rgba("+Math.floor(z.r*255)+","+Math.floor(z.g*255)+","+Math.floor(z.b*
 255)+","+A+")",v.fillRect(pa.getX(),pa.getY(),pa.getWidth(),pa.getHeight())),pa.empty()};this.render=function(b,g){function o(b){var d,c,e,h=b.lights;ua.setRGB(0,0,0);Pa.setRGB(0,0,0);Qa.setRGB(0,0,0);b=0;for(d=h.length;b<d;b++)c=h[b],e=c.color,c instanceof THREE.AmbientLight?(ua.r+=e.r,ua.g+=e.g,ua.b+=e.b):c instanceof THREE.DirectionalLight?(Pa.r+=e.r,Pa.g+=e.g,Pa.b+=e.b):c instanceof THREE.PointLight&&(Qa.r+=e.r,Qa.g+=e.g,Qa.b+=e.b)}function p(b,d,c,e){var h,f,g,j,k=b.lights,b=0;for(h=k.length;b<
 255)+","+A+")",v.fillRect(pa.getX(),pa.getY(),pa.getWidth(),pa.getHeight())),pa.empty()};this.render=function(b,g){function o(b){var d,c,e,h=b.lights;ua.setRGB(0,0,0);Pa.setRGB(0,0,0);Qa.setRGB(0,0,0);b=0;for(d=h.length;b<d;b++)c=h[b],e=c.color,c instanceof THREE.AmbientLight?(ua.r+=e.r,ua.g+=e.g,ua.b+=e.b):c instanceof THREE.DirectionalLight?(Pa.r+=e.r,Pa.g+=e.g,Pa.b+=e.b):c instanceof THREE.PointLight&&(Qa.r+=e.r,Qa.g+=e.g,Qa.b+=e.b)}function p(b,d,c,e){var h,f,g,j,k=b.lights,b=0;for(h=k.length;b<
 h;b++)f=k[b],g=f.color,f instanceof THREE.DirectionalLight?(j=c.dot(f.position),j<=0||(j*=f.intensity,e.r+=g.r*j,e.g+=g.g*j,e.b+=g.b*j)):f instanceof THREE.PointLight&&(j=c.dot(oa.sub(f.position,d).normalize()),j<=0||(j*=f.distance==0?1:1-Math.min(d.distanceTo(f.position)/f.distance,1),j!=0&&(j*=f.intensity,e.r+=g.r*j,e.g+=g.g*j,e.b+=g.b*j)))}function n(b,h,g){c(g.opacity);d(g.blending);var j,k,m,o,p,sa;if(g instanceof THREE.ParticleBasicMaterial){if(g.map)o=g.map.image,p=o.width>>1,sa=o.height>>
 h;b++)f=k[b],g=f.color,f instanceof THREE.DirectionalLight?(j=c.dot(f.position),j<=0||(j*=f.intensity,e.r+=g.r*j,e.g+=g.g*j,e.b+=g.b*j)):f instanceof THREE.PointLight&&(j=c.dot(oa.sub(f.position,d).normalize()),j<=0||(j*=f.distance==0?1:1-Math.min(d.distanceTo(f.position)/f.distance,1),j!=0&&(j*=f.intensity,e.r+=g.r*j,e.g+=g.g*j,e.b+=g.b*j)))}function n(b,h,g){c(g.opacity);d(g.blending);var j,k,m,o,p,sa;if(g instanceof THREE.ParticleBasicMaterial){if(g.map)o=g.map.image,p=o.width>>1,sa=o.height>>
-1,g=h.scale.x*t,m=h.scale.y*u,j=g*p,k=m*sa,N.set(b.x-j,b.y-k,b.x+j,b.y+k),ta.instersects(N)&&(v.save(),v.translate(b.x,b.y),v.rotate(-h.rotation),v.scale(g,-m),v.translate(-p,-sa),v.drawImage(o,0,0),v.restore())}else g instanceof THREE.ParticleCanvasMaterial&&(j=h.scale.x*t,k=h.scale.y*u,N.set(b.x-j,b.y-k,b.x+j,b.y+k),ta.instersects(N)&&(e(g.color),f(g.color),v.save(),v.translate(b.x,b.y),v.rotate(-h.rotation),v.scale(j,k),g.program(v),v.restore()))}function y(b,h,f,g){c(g.opacity);d(g.blending);
-v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(h.positionScreen.x,h.positionScreen.y);v.closePath();if(g instanceof THREE.LineBasicMaterial){b=g.linewidth;if(G!=b)v.lineWidth=G=b;b=g.linecap;if(B!=b)v.lineCap=B=b;b=g.linejoin;if(Q!=b)v.lineJoin=Q=b;e(g.color);v.stroke();N.inflate(g.linewidth*2)}}function z(b,e,h,f,k,m,o,N,n){j.data.vertices+=3;j.data.faces++;c(N.opacity);d(N.blending);R=b.positionScreen.x;S=b.positionScreen.y;O=e.positionScreen.x;aa=e.positionScreen.y;V=h.positionScreen.x;
-W=h.positionScreen.y;A(R,S,O,aa,V,W);if(N instanceof THREE.MeshBasicMaterial)if(N.map)N.map.mapping instanceof THREE.UVMapping&&(ma=o.uvs[0],wa(R,S,O,aa,V,W,N.map.image,ma[f].u,ma[f].v,ma[k].u,ma[k].v,ma[m].u,ma[m].v));else if(N.envMap){if(N.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=g.matrixWorldInverse,oa.copy(o.vertexNormalsWorld[0]),ja=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,na=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[1]),Ba=(oa.x*b.n11+oa.y*
-b.n12+oa.z*b.n13)*0.5+0.5,za=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[2]),ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,P=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,wa(R,S,O,aa,V,W,N.envMap.image,ja,na,Ba,za,ca,P)}else N.wireframe?D(N.color,N.wireframeLinewidth,N.wireframeLinecap,N.wireframeLinejoin):C(N.color);else if(N instanceof THREE.MeshLambertMaterial)N.map&&!N.wireframe&&(N.map.mapping instanceof THREE.UVMapping&&(ma=o.uvs[0],wa(R,S,O,aa,V,W,N.map.image,ma[f].u,
-ma[f].v,ma[k].u,ma[k].v,ma[m].u,ma[m].v)),d(THREE.SubtractiveBlending)),Ua?!N.wireframe&&N.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==3?(T.r=Z.r=$.r=ua.r,T.g=Z.g=$.g=ua.g,T.b=Z.b=$.b=ua.b,p(n,o.v1.positionWorld,o.vertexNormalsWorld[0],T),p(n,o.v2.positionWorld,o.vertexNormalsWorld[1],Z),p(n,o.v3.positionWorld,o.vertexNormalsWorld[2],$),ia.r=(Z.r+$.r)*0.5,ia.g=(Z.g+$.g)*0.5,ia.b=(Z.b+$.b)*0.5,ha=w(T,Z,$,ia),wa(R,S,O,aa,V,W,ha,0,0,1,0,0,1)):(sa.r=ua.r,sa.g=ua.g,sa.b=ua.b,p(n,o.centroidWorld,
-o.normalWorld,sa),I.r=Math.max(0,Math.min(N.color.r*sa.r,1)),I.g=Math.max(0,Math.min(N.color.g*sa.g,1)),I.b=Math.max(0,Math.min(N.color.b*sa.b,1)),I.updateHex(),N.wireframe?D(I,N.wireframeLinewidth,N.wireframeLinecap,N.wireframeLinejoin):C(I)):N.wireframe?D(N.color,N.wireframeLinewidth,N.wireframeLinecap,N.wireframeLinejoin):C(N.color);else if(N instanceof THREE.MeshDepthMaterial)X=g.near,H=g.far,T.r=T.g=T.b=1-Fa(b.positionScreen.z,X,H),Z.r=Z.g=Z.b=1-Fa(e.positionScreen.z,X,H),$.r=$.g=$.b=1-Fa(h.positionScreen.z,
-X,H),ia.r=(Z.r+$.r)*0.5,ia.g=(Z.g+$.g)*0.5,ia.b=(Z.b+$.b)*0.5,ha=w(T,Z,$,ia),wa(R,S,O,aa,V,W,ha,0,0,1,0,0,1);else if(N instanceof THREE.MeshNormalMaterial)I.r=Ka(o.normalWorld.x),I.g=Ka(o.normalWorld.y),I.b=Ka(o.normalWorld.z),I.updateHex(),N.wireframe?D(I,N.wireframeLinewidth,N.wireframeLinecap,N.wireframeLinejoin):C(I)}function x(b,e,h,f,k,o,N,m,n){j.data.vertices+=4;j.data.faces++;c(m.opacity);d(m.blending);if(m.map||m.envMap)z(b,e,f,0,1,3,N,m,n),z(k,h,o,1,2,3,N,m,n);else if(R=b.positionScreen.x,
-S=b.positionScreen.y,O=e.positionScreen.x,aa=e.positionScreen.y,V=h.positionScreen.x,W=h.positionScreen.y,ga=f.positionScreen.x,Y=f.positionScreen.y,da=k.positionScreen.x,ea=k.positionScreen.y,ka=o.positionScreen.x,fa=o.positionScreen.y,m instanceof THREE.MeshBasicMaterial)F(R,S,O,aa,V,W,ga,Y),m.wireframe?D(m.color,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):C(m.color);else if(m instanceof THREE.MeshLambertMaterial)Ua?!m.wireframe&&m.shading==THREE.SmoothShading&&N.vertexNormalsWorld.length==
-4?(T.r=Z.r=$.r=ia.r=ua.r,T.g=Z.g=$.g=ia.g=ua.g,T.b=Z.b=$.b=ia.b=ua.b,p(n,N.v1.positionWorld,N.vertexNormalsWorld[0],T),p(n,N.v2.positionWorld,N.vertexNormalsWorld[1],Z),p(n,N.v4.positionWorld,N.vertexNormalsWorld[3],$),p(n,N.v3.positionWorld,N.vertexNormalsWorld[2],ia),ha=w(T,Z,$,ia),A(R,S,O,aa,ga,Y),wa(R,S,O,aa,ga,Y,ha,0,0,1,0,0,1),A(da,ea,V,W,ka,fa),wa(da,ea,V,W,ka,fa,ha,1,0,1,1,0,1)):(sa.r=ua.r,sa.g=ua.g,sa.b=ua.b,p(n,N.centroidWorld,N.normalWorld,sa),I.r=Math.max(0,Math.min(m.color.r*sa.r,1)),
-I.g=Math.max(0,Math.min(m.color.g*sa.g,1)),I.b=Math.max(0,Math.min(m.color.b*sa.b,1)),I.updateHex(),F(R,S,O,aa,V,W,ga,Y),m.wireframe?D(I,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):C(I)):(F(R,S,O,aa,V,W,ga,Y),m.wireframe?D(m.color,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):C(m.color));else if(m instanceof THREE.MeshNormalMaterial)I.r=Ka(N.normalWorld.x),I.g=Ka(N.normalWorld.y),I.b=Ka(N.normalWorld.z),I.updateHex(),F(R,S,O,aa,V,W,ga,Y),m.wireframe?D(I,m.wireframeLinewidth,
-m.wireframeLinecap,m.wireframeLinejoin):C(I);else if(m instanceof THREE.MeshDepthMaterial)X=g.near,H=g.far,T.r=T.g=T.b=1-Fa(b.positionScreen.z,X,H),Z.r=Z.g=Z.b=1-Fa(e.positionScreen.z,X,H),$.r=$.g=$.b=1-Fa(f.positionScreen.z,X,H),ia.r=ia.g=ia.b=1-Fa(h.positionScreen.z,X,H),ha=w(T,Z,$,ia),A(R,S,O,aa,ga,Y),wa(R,S,O,aa,ga,Y,ha,0,0,1,0,0,1),A(da,ea,V,W,ka,fa),wa(da,ea,V,W,ka,fa,ha,1,0,1,1,0,1)}function A(b,d,c,e,h,f){v.beginPath();v.moveTo(b,d);v.lineTo(c,e);v.lineTo(h,f);v.lineTo(b,d);v.closePath()}
-function F(b,d,c,e,h,f,g,j){v.beginPath();v.moveTo(b,d);v.lineTo(c,e);v.lineTo(h,f);v.lineTo(g,j);v.lineTo(b,d);v.closePath()}function D(b,d,c,h){if(G!=d)v.lineWidth=G=d;if(B!=c)v.lineCap=B=c;if(Q!=h)v.lineJoin=Q=h;e(b);v.stroke();N.inflate(d*2)}function C(b){f(b);v.fill()}function wa(b,d,c,e,h,f,g,j,k,m,N,o,p){var n,t;n=g.width-1;t=g.height-1;j*=n;k*=t;m*=n;N*=t;o*=n;p*=t;c-=b;e-=d;h-=b;f-=d;m-=j;N-=k;o-=j;p-=k;n=m*p-o*N;n!=0&&(t=1/n,n=(p*c-N*h)*t,N=(p*e-N*f)*t,c=(m*h-o*c)*t,e=(m*f-o*e)*t,b=b-n*
-j-c*k,d=d-N*j-e*k,v.save(),v.transform(n,N,c,e,b,d),v.clip(),v.drawImage(g,0,0),v.restore())}function w(b,d,c,e){var h=~~(b.r*255),f=~~(b.g*255),b=~~(b.b*255),g=~~(d.r*255),j=~~(d.g*255),d=~~(d.b*255),k=~~(c.r*255),m=~~(c.g*255),c=~~(c.b*255),N=~~(e.r*255),o=~~(e.g*255),e=~~(e.b*255);va[0]=h<0?0:h>255?255:h;va[1]=f<0?0:f>255?255:f;va[2]=b<0?0:b>255?255:b;va[4]=g<0?0:g>255?255:g;va[5]=j<0?0:j>255?255:j;va[6]=d<0?0:d>255?255:d;va[8]=k<0?0:k>255?255:k;va[9]=m<0?0:m>255?255:m;va[10]=c<0?0:c>255?255:c;
-va[12]=N<0?0:N>255?255:N;va[13]=o<0?0:o>255?255:o;va[14]=e<0?0:e>255?255:e;Na.putImageData(Va,0,0);Ra.drawImage(Ma,0,0);return Oa}function Fa(b,d,c){b=(b-d)/(c-d);return b*b*(3-2*b)}function Ka(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Ca(b,d){var c=d.x-b.x,e=d.y-b.y,h=1/Math.sqrt(c*c+e*e);c*=h;e*=h;d.x+=c;d.y+=e;b.x-=c;b.y-=e}var Sa,Za,la,xa,Da,La,Ta,qa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,t,u);j.data.vertices=0;j.data.faces=0;k=m.projectScene(b,g,this.sortElements);(Ua=b.lights.length>
-0)&&o(b);Sa=0;for(Za=k.length;Sa<Za;Sa++){la=k[Sa];N.empty();if(la instanceof THREE.RenderableParticle){K=la;K.x*=t;K.y*=u;xa=0;for(Da=la.materials.length;xa<Da;)qa=la.materials[xa++],qa.opacity!=0&&n(K,la,qa,b)}else if(la instanceof THREE.RenderableLine){if(K=la.v1,L=la.v2,K.positionScreen.x*=t,K.positionScreen.y*=u,L.positionScreen.x*=t,L.positionScreen.y*=u,N.addPoint(K.positionScreen.x,K.positionScreen.y),N.addPoint(L.positionScreen.x,L.positionScreen.y),ta.instersects(N)){xa=0;for(Da=la.materials.length;xa<
-Da;)qa=la.materials[xa++],qa.opacity!=0&&y(K,L,la,qa,b)}}else if(la instanceof THREE.RenderableFace3){if(K=la.v1,L=la.v2,E=la.v3,K.positionScreen.x*=t,K.positionScreen.y*=u,L.positionScreen.x*=t,L.positionScreen.y*=u,E.positionScreen.x*=t,E.positionScreen.y*=u,la.overdraw&&(Ca(K.positionScreen,L.positionScreen),Ca(L.positionScreen,E.positionScreen),Ca(E.positionScreen,K.positionScreen)),N.add3Points(K.positionScreen.x,K.positionScreen.y,L.positionScreen.x,L.positionScreen.y,E.positionScreen.x,E.positionScreen.y),
-ta.instersects(N)){xa=0;for(Da=la.meshMaterials.length;xa<Da;)if(qa=la.meshMaterials[xa++],qa instanceof THREE.MeshFaceMaterial){La=0;for(Ta=la.faceMaterials.length;La<Ta;)(qa=la.faceMaterials[La++])&&qa.opacity!=0&&z(K,L,E,0,1,2,la,qa,b)}else qa.opacity!=0&&z(K,L,E,0,1,2,la,qa,b)}}else if(la instanceof THREE.RenderableFace4&&(K=la.v1,L=la.v2,E=la.v3,M=la.v4,K.positionScreen.x*=t,K.positionScreen.y*=u,L.positionScreen.x*=t,L.positionScreen.y*=u,E.positionScreen.x*=t,E.positionScreen.y*=u,M.positionScreen.x*=
-t,M.positionScreen.y*=u,U.positionScreen.copy(L.positionScreen),h.positionScreen.copy(M.positionScreen),la.overdraw&&(Ca(K.positionScreen,L.positionScreen),Ca(L.positionScreen,M.positionScreen),Ca(M.positionScreen,K.positionScreen),Ca(E.positionScreen,U.positionScreen),Ca(E.positionScreen,h.positionScreen)),N.addPoint(K.positionScreen.x,K.positionScreen.y),N.addPoint(L.positionScreen.x,L.positionScreen.y),N.addPoint(E.positionScreen.x,E.positionScreen.y),N.addPoint(M.positionScreen.x,M.positionScreen.y),
-ta.instersects(N))){xa=0;for(Da=la.meshMaterials.length;xa<Da;)if(qa=la.meshMaterials[xa++],qa instanceof THREE.MeshFaceMaterial){La=0;for(Ta=la.faceMaterials.length;La<Ta;)(qa=la.faceMaterials[La++])&&qa.opacity!=0&&x(K,L,E,M,U,h,la,qa,b)}else qa.opacity!=0&&x(K,L,E,M,U,h,la,qa,b)}pa.addRectangle(N)}v.setTransform(1,0,0,1,0,0)}};
-THREE.SVGRenderer=function(){function b(b,d,c){var e,h,f,g;e=0;for(h=b.lights.length;e<h;e++)f=b.lights[e],f instanceof THREE.DirectionalLight?(g=d.normalWorld.dot(f.position)*f.intensity,g>0&&(c.r+=f.color.r*g,c.g+=f.color.g*g,c.b+=f.color.b*g)):f instanceof THREE.PointLight&&(M.sub(f.position,d.centroidWorld),M.normalize(),g=d.normalWorld.dot(M)*f.intensity,g>0&&(c.r+=f.color.r*g,c.g+=f.color.g*g,c.b+=f.color.b*g))}function c(d,c,h,k,m,p){j.data.vertices+=3;j.data.faces++;R=e(S++);R.setAttribute("d",
+1,g=h.scale.x*t,m=h.scale.y*u,j=g*p,k=m*sa,M.set(b.x-j,b.y-k,b.x+j,b.y+k),ta.instersects(M)&&(v.save(),v.translate(b.x,b.y),v.rotate(-h.rotation),v.scale(g,-m),v.translate(-p,-sa),v.drawImage(o,0,0),v.restore())}else g instanceof THREE.ParticleCanvasMaterial&&(j=h.scale.x*t,k=h.scale.y*u,M.set(b.x-j,b.y-k,b.x+j,b.y+k),ta.instersects(M)&&(e(g.color),f(g.color),v.save(),v.translate(b.x,b.y),v.rotate(-h.rotation),v.scale(j,k),g.program(v),v.restore()))}function x(b,h,f,g){c(g.opacity);d(g.blending);
+v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(h.positionScreen.x,h.positionScreen.y);v.closePath();if(g instanceof THREE.LineBasicMaterial){b=g.linewidth;if(G!=b)v.lineWidth=G=b;b=g.linecap;if(B!=b)v.lineCap=B=b;b=g.linejoin;if(Q!=b)v.lineJoin=Q=b;e(g.color);v.stroke();M.inflate(g.linewidth*2)}}function z(b,e,h,f,k,m,o,M,n){j.data.vertices+=3;j.data.faces++;c(M.opacity);d(M.blending);R=b.positionScreen.x;S=b.positionScreen.y;O=e.positionScreen.x;aa=e.positionScreen.y;V=h.positionScreen.x;
+W=h.positionScreen.y;y(R,S,O,aa,V,W);if(M instanceof THREE.MeshBasicMaterial)if(M.map)M.map.mapping instanceof THREE.UVMapping&&(ma=o.uvs[0],wa(R,S,O,aa,V,W,M.map.image,ma[f].u,ma[f].v,ma[k].u,ma[k].v,ma[m].u,ma[m].v));else if(M.envMap){if(M.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=g.matrixWorldInverse,oa.copy(o.vertexNormalsWorld[0]),ja=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,na=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[1]),Ba=(oa.x*b.n11+oa.y*
+b.n12+oa.z*b.n13)*0.5+0.5,za=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[2]),ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,P=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,wa(R,S,O,aa,V,W,M.envMap.image,ja,na,Ba,za,ca,P)}else M.wireframe?D(M.color,M.wireframeLinewidth,M.wireframeLinecap,M.wireframeLinejoin):C(M.color);else if(M instanceof THREE.MeshLambertMaterial)M.map&&!M.wireframe&&(M.map.mapping instanceof THREE.UVMapping&&(ma=o.uvs[0],wa(R,S,O,aa,V,W,M.map.image,ma[f].u,
+ma[f].v,ma[k].u,ma[k].v,ma[m].u,ma[m].v)),d(THREE.SubtractiveBlending)),Ua?!M.wireframe&&M.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==3?(T.r=Z.r=$.r=ua.r,T.g=Z.g=$.g=ua.g,T.b=Z.b=$.b=ua.b,p(n,o.v1.positionWorld,o.vertexNormalsWorld[0],T),p(n,o.v2.positionWorld,o.vertexNormalsWorld[1],Z),p(n,o.v3.positionWorld,o.vertexNormalsWorld[2],$),ia.r=(Z.r+$.r)*0.5,ia.g=(Z.g+$.g)*0.5,ia.b=(Z.b+$.b)*0.5,ha=w(T,Z,$,ia),wa(R,S,O,aa,V,W,ha,0,0,1,0,0,1)):(sa.r=ua.r,sa.g=ua.g,sa.b=ua.b,p(n,o.centroidWorld,
+o.normalWorld,sa),I.r=Math.max(0,Math.min(M.color.r*sa.r,1)),I.g=Math.max(0,Math.min(M.color.g*sa.g,1)),I.b=Math.max(0,Math.min(M.color.b*sa.b,1)),I.updateHex(),M.wireframe?D(I,M.wireframeLinewidth,M.wireframeLinecap,M.wireframeLinejoin):C(I)):M.wireframe?D(M.color,M.wireframeLinewidth,M.wireframeLinecap,M.wireframeLinejoin):C(M.color);else if(M instanceof THREE.MeshDepthMaterial)X=g.near,H=g.far,T.r=T.g=T.b=1-Fa(b.positionScreen.z,X,H),Z.r=Z.g=Z.b=1-Fa(e.positionScreen.z,X,H),$.r=$.g=$.b=1-Fa(h.positionScreen.z,
+X,H),ia.r=(Z.r+$.r)*0.5,ia.g=(Z.g+$.g)*0.5,ia.b=(Z.b+$.b)*0.5,ha=w(T,Z,$,ia),wa(R,S,O,aa,V,W,ha,0,0,1,0,0,1);else if(M instanceof THREE.MeshNormalMaterial)I.r=Ka(o.normalWorld.x),I.g=Ka(o.normalWorld.y),I.b=Ka(o.normalWorld.z),I.updateHex(),M.wireframe?D(I,M.wireframeLinewidth,M.wireframeLinecap,M.wireframeLinejoin):C(I)}function A(b,e,h,f,k,o,m,M,n){j.data.vertices+=4;j.data.faces++;c(M.opacity);d(M.blending);if(M.map||M.envMap)z(b,e,f,0,1,3,m,M,n),z(k,h,o,1,2,3,m,M,n);else if(R=b.positionScreen.x,
+S=b.positionScreen.y,O=e.positionScreen.x,aa=e.positionScreen.y,V=h.positionScreen.x,W=h.positionScreen.y,ga=f.positionScreen.x,Y=f.positionScreen.y,da=k.positionScreen.x,ea=k.positionScreen.y,ka=o.positionScreen.x,fa=o.positionScreen.y,M instanceof THREE.MeshBasicMaterial)F(R,S,O,aa,V,W,ga,Y),M.wireframe?D(M.color,M.wireframeLinewidth,M.wireframeLinecap,M.wireframeLinejoin):C(M.color);else if(M instanceof THREE.MeshLambertMaterial)Ua?!M.wireframe&&M.shading==THREE.SmoothShading&&m.vertexNormalsWorld.length==
+4?(T.r=Z.r=$.r=ia.r=ua.r,T.g=Z.g=$.g=ia.g=ua.g,T.b=Z.b=$.b=ia.b=ua.b,p(n,m.v1.positionWorld,m.vertexNormalsWorld[0],T),p(n,m.v2.positionWorld,m.vertexNormalsWorld[1],Z),p(n,m.v4.positionWorld,m.vertexNormalsWorld[3],$),p(n,m.v3.positionWorld,m.vertexNormalsWorld[2],ia),ha=w(T,Z,$,ia),y(R,S,O,aa,ga,Y),wa(R,S,O,aa,ga,Y,ha,0,0,1,0,0,1),y(da,ea,V,W,ka,fa),wa(da,ea,V,W,ka,fa,ha,1,0,1,1,0,1)):(sa.r=ua.r,sa.g=ua.g,sa.b=ua.b,p(n,m.centroidWorld,m.normalWorld,sa),I.r=Math.max(0,Math.min(M.color.r*sa.r,1)),
+I.g=Math.max(0,Math.min(M.color.g*sa.g,1)),I.b=Math.max(0,Math.min(M.color.b*sa.b,1)),I.updateHex(),F(R,S,O,aa,V,W,ga,Y),M.wireframe?D(I,M.wireframeLinewidth,M.wireframeLinecap,M.wireframeLinejoin):C(I)):(F(R,S,O,aa,V,W,ga,Y),M.wireframe?D(M.color,M.wireframeLinewidth,M.wireframeLinecap,M.wireframeLinejoin):C(M.color));else if(M instanceof THREE.MeshNormalMaterial)I.r=Ka(m.normalWorld.x),I.g=Ka(m.normalWorld.y),I.b=Ka(m.normalWorld.z),I.updateHex(),F(R,S,O,aa,V,W,ga,Y),M.wireframe?D(I,M.wireframeLinewidth,
+M.wireframeLinecap,M.wireframeLinejoin):C(I);else if(M instanceof THREE.MeshDepthMaterial)X=g.near,H=g.far,T.r=T.g=T.b=1-Fa(b.positionScreen.z,X,H),Z.r=Z.g=Z.b=1-Fa(e.positionScreen.z,X,H),$.r=$.g=$.b=1-Fa(f.positionScreen.z,X,H),ia.r=ia.g=ia.b=1-Fa(h.positionScreen.z,X,H),ha=w(T,Z,$,ia),y(R,S,O,aa,ga,Y),wa(R,S,O,aa,ga,Y,ha,0,0,1,0,0,1),y(da,ea,V,W,ka,fa),wa(da,ea,V,W,ka,fa,ha,1,0,1,1,0,1)}function y(b,d,c,e,h,f){v.beginPath();v.moveTo(b,d);v.lineTo(c,e);v.lineTo(h,f);v.lineTo(b,d);v.closePath()}
+function F(b,d,c,e,h,f,g,j){v.beginPath();v.moveTo(b,d);v.lineTo(c,e);v.lineTo(h,f);v.lineTo(g,j);v.lineTo(b,d);v.closePath()}function D(b,d,c,h){if(G!=d)v.lineWidth=G=d;if(B!=c)v.lineCap=B=c;if(Q!=h)v.lineJoin=Q=h;e(b);v.stroke();M.inflate(d*2)}function C(b){f(b);v.fill()}function wa(b,d,c,e,h,f,g,j,k,M,m,o,p){var n,t;n=g.width-1;t=g.height-1;j*=n;k*=t;M*=n;m*=t;o*=n;p*=t;c-=b;e-=d;h-=b;f-=d;M-=j;m-=k;o-=j;p-=k;n=M*p-o*m;n!=0&&(t=1/n,n=(p*c-m*h)*t,m=(p*e-m*f)*t,c=(M*h-o*c)*t,e=(M*f-o*e)*t,b=b-n*
+j-c*k,d=d-m*j-e*k,v.save(),v.transform(n,m,c,e,b,d),v.clip(),v.drawImage(g,0,0),v.restore())}function w(b,d,c,e){var h=~~(b.r*255),f=~~(b.g*255),b=~~(b.b*255),g=~~(d.r*255),j=~~(d.g*255),d=~~(d.b*255),k=~~(c.r*255),M=~~(c.g*255),c=~~(c.b*255),m=~~(e.r*255),o=~~(e.g*255),e=~~(e.b*255);va[0]=h<0?0:h>255?255:h;va[1]=f<0?0:f>255?255:f;va[2]=b<0?0:b>255?255:b;va[4]=g<0?0:g>255?255:g;va[5]=j<0?0:j>255?255:j;va[6]=d<0?0:d>255?255:d;va[8]=k<0?0:k>255?255:k;va[9]=M<0?0:M>255?255:M;va[10]=c<0?0:c>255?255:c;
+va[12]=m<0?0:m>255?255:m;va[13]=o<0?0:o>255?255:o;va[14]=e<0?0:e>255?255:e;Na.putImageData(Va,0,0);Ra.drawImage(Ma,0,0);return Oa}function Fa(b,d,c){b=(b-d)/(c-d);return b*b*(3-2*b)}function Ka(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Ca(b,d){var c=d.x-b.x,e=d.y-b.y,h=1/Math.sqrt(c*c+e*e);c*=h;e*=h;d.x+=c;d.y+=e;b.x-=c;b.y-=e}var Sa,Za,la,xa,Da,La,Ta,qa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,t,u);j.data.vertices=0;j.data.faces=0;k=m.projectScene(b,g,this.sortElements);(Ua=b.lights.length>
+0)&&o(b);Sa=0;for(Za=k.length;Sa<Za;Sa++){la=k[Sa];M.empty();if(la instanceof THREE.RenderableParticle){K=la;K.x*=t;K.y*=u;xa=0;for(Da=la.materials.length;xa<Da;)qa=la.materials[xa++],qa.opacity!=0&&n(K,la,qa,b)}else if(la instanceof THREE.RenderableLine){if(K=la.v1,L=la.v2,K.positionScreen.x*=t,K.positionScreen.y*=u,L.positionScreen.x*=t,L.positionScreen.y*=u,M.addPoint(K.positionScreen.x,K.positionScreen.y),M.addPoint(L.positionScreen.x,L.positionScreen.y),ta.instersects(M)){xa=0;for(Da=la.materials.length;xa<
+Da;)qa=la.materials[xa++],qa.opacity!=0&&x(K,L,la,qa,b)}}else if(la instanceof THREE.RenderableFace3){if(K=la.v1,L=la.v2,E=la.v3,K.positionScreen.x*=t,K.positionScreen.y*=u,L.positionScreen.x*=t,L.positionScreen.y*=u,E.positionScreen.x*=t,E.positionScreen.y*=u,la.overdraw&&(Ca(K.positionScreen,L.positionScreen),Ca(L.positionScreen,E.positionScreen),Ca(E.positionScreen,K.positionScreen)),M.add3Points(K.positionScreen.x,K.positionScreen.y,L.positionScreen.x,L.positionScreen.y,E.positionScreen.x,E.positionScreen.y),
+ta.instersects(M)){xa=0;for(Da=la.meshMaterials.length;xa<Da;)if(qa=la.meshMaterials[xa++],qa instanceof THREE.MeshFaceMaterial){La=0;for(Ta=la.faceMaterials.length;La<Ta;)(qa=la.faceMaterials[La++])&&qa.opacity!=0&&z(K,L,E,0,1,2,la,qa,b)}else qa.opacity!=0&&z(K,L,E,0,1,2,la,qa,b)}}else if(la instanceof THREE.RenderableFace4&&(K=la.v1,L=la.v2,E=la.v3,N=la.v4,K.positionScreen.x*=t,K.positionScreen.y*=u,L.positionScreen.x*=t,L.positionScreen.y*=u,E.positionScreen.x*=t,E.positionScreen.y*=u,N.positionScreen.x*=
+t,N.positionScreen.y*=u,U.positionScreen.copy(L.positionScreen),h.positionScreen.copy(N.positionScreen),la.overdraw&&(Ca(K.positionScreen,L.positionScreen),Ca(L.positionScreen,N.positionScreen),Ca(N.positionScreen,K.positionScreen),Ca(E.positionScreen,U.positionScreen),Ca(E.positionScreen,h.positionScreen)),M.addPoint(K.positionScreen.x,K.positionScreen.y),M.addPoint(L.positionScreen.x,L.positionScreen.y),M.addPoint(E.positionScreen.x,E.positionScreen.y),M.addPoint(N.positionScreen.x,N.positionScreen.y),
+ta.instersects(M))){xa=0;for(Da=la.meshMaterials.length;xa<Da;)if(qa=la.meshMaterials[xa++],qa instanceof THREE.MeshFaceMaterial){La=0;for(Ta=la.faceMaterials.length;La<Ta;)(qa=la.faceMaterials[La++])&&qa.opacity!=0&&A(K,L,E,N,U,h,la,qa,b)}else qa.opacity!=0&&A(K,L,E,N,U,h,la,qa,b)}pa.addRectangle(M)}v.setTransform(1,0,0,1,0,0)}};
+THREE.SVGRenderer=function(){function b(b,d,c){var e,h,f,g;e=0;for(h=b.lights.length;e<h;e++)f=b.lights[e],f instanceof THREE.DirectionalLight?(g=d.normalWorld.dot(f.position)*f.intensity,g>0&&(c.r+=f.color.r*g,c.g+=f.color.g*g,c.b+=f.color.b*g)):f instanceof THREE.PointLight&&(N.sub(f.position,d.centroidWorld),N.normalize(),g=d.normalWorld.dot(N)*f.intensity,g>0&&(c.r+=f.color.r*g,c.g+=f.color.g*g,c.b+=f.color.b*g))}function c(d,c,h,k,m,p){j.data.vertices+=3;j.data.faces++;R=e(S++);R.setAttribute("d",
 "M "+d.positionScreen.x+" "+d.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+"z");m instanceof THREE.MeshBasicMaterial?G.hex=m.color.hex:m instanceof THREE.MeshLambertMaterial?D?(B.r=Q.r,B.g=Q.g,B.b=Q.b,b(p,k,B),G.r=Math.max(0,Math.min(m.color.r*B.r,1)),G.g=Math.max(0,Math.min(m.color.g*B.g,1)),G.b=Math.max(0,Math.min(m.color.b*B.b,1)),G.updateHex()):G.hex=m.color.hex:m instanceof THREE.MeshDepthMaterial?(E=1-m.__2near/(m.__farPlusNear-
 "M "+d.positionScreen.x+" "+d.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+"z");m instanceof THREE.MeshBasicMaterial?G.hex=m.color.hex:m instanceof THREE.MeshLambertMaterial?D?(B.r=Q.r,B.g=Q.g,B.b=Q.b,b(p,k,B),G.r=Math.max(0,Math.min(m.color.r*B.r,1)),G.g=Math.max(0,Math.min(m.color.g*B.g,1)),G.b=Math.max(0,Math.min(m.color.b*B.b,1)),G.updateHex()):G.hex=m.color.hex:m instanceof THREE.MeshDepthMaterial?(E=1-m.__2near/(m.__farPlusNear-
 k.z*m.__farMinusNear),G.setRGB(E,E,E)):m instanceof THREE.MeshNormalMaterial&&G.setRGB(f(k.normalWorld.x),f(k.normalWorld.y),f(k.normalWorld.z));m.wireframe?R.setAttribute("style","fill: none; stroke: #"+g(G.hex.toString(16))+"; stroke-width: "+m.wireframeLinewidth+"; stroke-opacity: "+m.opacity+"; stroke-linecap: "+m.wireframeLinecap+"; stroke-linejoin: "+m.wireframeLinejoin):R.setAttribute("style","fill: #"+g(G.hex.toString(16))+"; fill-opacity: "+m.opacity);o.appendChild(R)}function d(d,c,h,k,
 k.z*m.__farMinusNear),G.setRGB(E,E,E)):m instanceof THREE.MeshNormalMaterial&&G.setRGB(f(k.normalWorld.x),f(k.normalWorld.y),f(k.normalWorld.z));m.wireframe?R.setAttribute("style","fill: none; stroke: #"+g(G.hex.toString(16))+"; stroke-width: "+m.wireframeLinewidth+"; stroke-opacity: "+m.opacity+"; stroke-linecap: "+m.wireframeLinecap+"; stroke-linejoin: "+m.wireframeLinejoin):R.setAttribute("style","fill: #"+g(G.hex.toString(16))+"; fill-opacity: "+m.opacity);o.appendChild(R)}function d(d,c,h,k,
 m,p,n){j.data.vertices+=4;j.data.faces++;R=e(S++);R.setAttribute("d","M "+d.positionScreen.x+" "+d.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");p instanceof THREE.MeshBasicMaterial?G.hex=p.color.hex:p instanceof THREE.MeshLambertMaterial?D?(B.r=Q.r,B.g=Q.g,B.b=Q.b,b(n,m,B),G.r=Math.max(0,Math.min(p.color.r*B.r,1)),G.g=Math.max(0,Math.min(p.color.g*B.g,1)),G.b=Math.max(0,Math.min(p.color.b*
 m,p,n){j.data.vertices+=4;j.data.faces++;R=e(S++);R.setAttribute("d","M "+d.positionScreen.x+" "+d.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");p instanceof THREE.MeshBasicMaterial?G.hex=p.color.hex:p instanceof THREE.MeshLambertMaterial?D?(B.r=Q.r,B.g=Q.g,B.b=Q.b,b(n,m,B),G.r=Math.max(0,Math.min(p.color.r*B.r,1)),G.g=Math.max(0,Math.min(p.color.g*B.g,1)),G.b=Math.max(0,Math.min(p.color.b*
 B.b,1)),G.updateHex()):G.hex=p.color.hex:p instanceof THREE.MeshDepthMaterial?(E=1-p.__2near/(p.__farPlusNear-m.z*p.__farMinusNear),G.setRGB(E,E,E)):p instanceof THREE.MeshNormalMaterial&&G.setRGB(f(m.normalWorld.x),f(m.normalWorld.y),f(m.normalWorld.z));p.wireframe?R.setAttribute("style","fill: none; stroke: #"+g(G.hex.toString(16))+"; stroke-width: "+p.wireframeLinewidth+"; stroke-opacity: "+p.opacity+"; stroke-linecap: "+p.wireframeLinecap+"; stroke-linejoin: "+p.wireframeLinejoin):R.setAttribute("style",
 B.b,1)),G.updateHex()):G.hex=p.color.hex:p instanceof THREE.MeshDepthMaterial?(E=1-p.__2near/(p.__farPlusNear-m.z*p.__farMinusNear),G.setRGB(E,E,E)):p instanceof THREE.MeshNormalMaterial&&G.setRGB(f(m.normalWorld.x),f(m.normalWorld.y),f(m.normalWorld.z));p.wireframe?R.setAttribute("style","fill: none; stroke: #"+g(G.hex.toString(16))+"; stroke-width: "+p.wireframeLinewidth+"; stroke-opacity: "+p.opacity+"; stroke-linecap: "+p.wireframeLinecap+"; stroke-linejoin: "+p.wireframeLinejoin):R.setAttribute("style",
-"fill: #"+g(G.hex.toString(16))+"; fill-opacity: "+p.opacity);o.appendChild(R)}function e(b){U[b]==null&&(U[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),aa==0&&U[b].setAttribute("shape-rendering","crispEdges"));return U[b]}function f(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function g(b){for(;b.length<6;)b="0"+b;return b}var j=this,k=null,m=new THREE.Projector,o=document.createElementNS("http://www.w3.org/2000/svg","svg"),n,p,t,u,v,z,A,y,F=new THREE.Rectangle,x=new THREE.Rectangle,
-D=!1,G=new THREE.Color(16777215),B=new THREE.Color(16777215),Q=new THREE.Color(0),K=new THREE.Color(0),L=new THREE.Color(0),E,M=new THREE.Vector3,U=[],h=[],R,S,O,aa=1;this.domElement=o;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setQuality=function(b){switch(b){case "high":aa=1;break;case "low":aa=0}};this.setSize=function(b,d){n=b;p=d;t=n/2;u=p/2;o.setAttribute("viewBox",-t+" "+-u+" "+n+" "+p);o.setAttribute("width",n);o.setAttribute("height",p);F.set(-t,
+"fill: #"+g(G.hex.toString(16))+"; fill-opacity: "+p.opacity);o.appendChild(R)}function e(b){U[b]==null&&(U[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),aa==0&&U[b].setAttribute("shape-rendering","crispEdges"));return U[b]}function f(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function g(b){for(;b.length<6;)b="0"+b;return b}var j=this,k=null,m=new THREE.Projector,o=document.createElementNS("http://www.w3.org/2000/svg","svg"),n,p,t,u,v,z,A,x,F=new THREE.Rectangle,y=new THREE.Rectangle,
+D=!1,G=new THREE.Color(16777215),B=new THREE.Color(16777215),Q=new THREE.Color(0),K=new THREE.Color(0),L=new THREE.Color(0),E,N=new THREE.Vector3,U=[],h=[],R,S,O,aa=1;this.domElement=o;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setQuality=function(b){switch(b){case "high":aa=1;break;case "low":aa=0}};this.setSize=function(b,d){n=b;p=d;t=n/2;u=p/2;o.setAttribute("viewBox",-t+" "+-u+" "+n+" "+p);o.setAttribute("width",n);o.setAttribute("height",p);F.set(-t,
 -u,t,u)};this.clear=function(){for(;o.childNodes.length>0;)o.removeChild(o.childNodes[0])};this.render=function(b,e){var f,p,n,G,B,E,I,T;this.autoClear&&this.clear();j.data.vertices=0;j.data.faces=0;k=m.projectScene(b,e,this.sortElements);O=S=0;if(D=b.lights.length>0){I=b.lights;Q.setRGB(0,0,0);K.setRGB(0,0,0);L.setRGB(0,0,0);f=0;for(p=I.length;f<p;f++)n=I[f],G=n.color,n instanceof THREE.AmbientLight?(Q.r+=G.r,Q.g+=G.g,Q.b+=G.b):n instanceof THREE.DirectionalLight?(K.r+=G.r,K.g+=G.g,K.b+=G.b):n instanceof
 -u,t,u)};this.clear=function(){for(;o.childNodes.length>0;)o.removeChild(o.childNodes[0])};this.render=function(b,e){var f,p,n,G,B,E,I,T;this.autoClear&&this.clear();j.data.vertices=0;j.data.faces=0;k=m.projectScene(b,e,this.sortElements);O=S=0;if(D=b.lights.length>0){I=b.lights;Q.setRGB(0,0,0);K.setRGB(0,0,0);L.setRGB(0,0,0);f=0;for(p=I.length;f<p;f++)n=I[f],G=n.color,n instanceof THREE.AmbientLight?(Q.r+=G.r,Q.g+=G.g,Q.b+=G.b):n instanceof THREE.DirectionalLight?(K.r+=G.r,K.g+=G.g,K.b+=G.b):n instanceof
-THREE.PointLight&&(L.r+=G.r,L.g+=G.g,L.b+=G.b)}f=0;for(p=k.length;f<p;f++)if(I=k[f],x.empty(),I instanceof THREE.RenderableParticle){v=I;v.x*=t;v.y*=-u;n=0;for(G=I.materials.length;n<G;)n++}else if(I instanceof THREE.RenderableLine){if(v=I.v1,z=I.v2,v.positionScreen.x*=t,v.positionScreen.y*=-u,z.positionScreen.x*=t,z.positionScreen.y*=-u,x.addPoint(v.positionScreen.x,v.positionScreen.y),x.addPoint(z.positionScreen.x,z.positionScreen.y),F.instersects(x)){n=0;for(G=I.materials.length;n<G;)if((T=I.materials[n++])&&
-T.opacity!=0){B=v;E=z;var M=O++;h[M]==null&&(h[M]=document.createElementNS("http://www.w3.org/2000/svg","line"),aa==0&&h[M].setAttribute("shape-rendering","crispEdges"));R=h[M];R.setAttribute("x1",B.positionScreen.x);R.setAttribute("y1",B.positionScreen.y);R.setAttribute("x2",E.positionScreen.x);R.setAttribute("y2",E.positionScreen.y);T instanceof THREE.LineBasicMaterial&&(R.setAttribute("style","fill: none; stroke: ##"+g(T.color.hex.toString(16))+"; stroke-width: "+T.linewidth+"; stroke-opacity: "+
-T.opacity+"; stroke-linecap: "+T.linecap+"; stroke-linejoin: "+T.linejoin),o.appendChild(R))}}}else if(I instanceof THREE.RenderableFace3){if(v=I.v1,z=I.v2,A=I.v3,v.positionScreen.x*=t,v.positionScreen.y*=-u,z.positionScreen.x*=t,z.positionScreen.y*=-u,A.positionScreen.x*=t,A.positionScreen.y*=-u,x.addPoint(v.positionScreen.x,v.positionScreen.y),x.addPoint(z.positionScreen.x,z.positionScreen.y),x.addPoint(A.positionScreen.x,A.positionScreen.y),F.instersects(x)){n=0;for(G=I.meshMaterials.length;n<
-G;)if(T=I.meshMaterials[n++],T instanceof THREE.MeshFaceMaterial){B=0;for(E=I.faceMaterials.length;B<E;)(T=I.faceMaterials[B++])&&T.opacity!=0&&c(v,z,A,I,T,b)}else T&&T.opacity!=0&&c(v,z,A,I,T,b)}}else if(I instanceof THREE.RenderableFace4&&(v=I.v1,z=I.v2,A=I.v3,y=I.v4,v.positionScreen.x*=t,v.positionScreen.y*=-u,z.positionScreen.x*=t,z.positionScreen.y*=-u,A.positionScreen.x*=t,A.positionScreen.y*=-u,y.positionScreen.x*=t,y.positionScreen.y*=-u,x.addPoint(v.positionScreen.x,v.positionScreen.y),x.addPoint(z.positionScreen.x,
-z.positionScreen.y),x.addPoint(A.positionScreen.x,A.positionScreen.y),x.addPoint(y.positionScreen.x,y.positionScreen.y),F.instersects(x))){n=0;for(G=I.meshMaterials.length;n<G;)if(T=I.meshMaterials[n++],T instanceof THREE.MeshFaceMaterial){B=0;for(E=I.faceMaterials.length;B<E;)(T=I.faceMaterials[B++])&&T.opacity!=0&&d(v,z,A,y,I,T,b)}else T&&T.opacity!=0&&d(v,z,A,y,I,T,b)}}};
+THREE.PointLight&&(L.r+=G.r,L.g+=G.g,L.b+=G.b)}f=0;for(p=k.length;f<p;f++)if(I=k[f],y.empty(),I instanceof THREE.RenderableParticle){v=I;v.x*=t;v.y*=-u;n=0;for(G=I.materials.length;n<G;)n++}else if(I instanceof THREE.RenderableLine){if(v=I.v1,z=I.v2,v.positionScreen.x*=t,v.positionScreen.y*=-u,z.positionScreen.x*=t,z.positionScreen.y*=-u,y.addPoint(v.positionScreen.x,v.positionScreen.y),y.addPoint(z.positionScreen.x,z.positionScreen.y),F.instersects(y)){n=0;for(G=I.materials.length;n<G;)if((T=I.materials[n++])&&
+T.opacity!=0){B=v;E=z;var N=O++;h[N]==null&&(h[N]=document.createElementNS("http://www.w3.org/2000/svg","line"),aa==0&&h[N].setAttribute("shape-rendering","crispEdges"));R=h[N];R.setAttribute("x1",B.positionScreen.x);R.setAttribute("y1",B.positionScreen.y);R.setAttribute("x2",E.positionScreen.x);R.setAttribute("y2",E.positionScreen.y);T instanceof THREE.LineBasicMaterial&&(R.setAttribute("style","fill: none; stroke: ##"+g(T.color.hex.toString(16))+"; stroke-width: "+T.linewidth+"; stroke-opacity: "+
+T.opacity+"; stroke-linecap: "+T.linecap+"; stroke-linejoin: "+T.linejoin),o.appendChild(R))}}}else if(I instanceof THREE.RenderableFace3){if(v=I.v1,z=I.v2,A=I.v3,v.positionScreen.x*=t,v.positionScreen.y*=-u,z.positionScreen.x*=t,z.positionScreen.y*=-u,A.positionScreen.x*=t,A.positionScreen.y*=-u,y.addPoint(v.positionScreen.x,v.positionScreen.y),y.addPoint(z.positionScreen.x,z.positionScreen.y),y.addPoint(A.positionScreen.x,A.positionScreen.y),F.instersects(y)){n=0;for(G=I.meshMaterials.length;n<
+G;)if(T=I.meshMaterials[n++],T instanceof THREE.MeshFaceMaterial){B=0;for(E=I.faceMaterials.length;B<E;)(T=I.faceMaterials[B++])&&T.opacity!=0&&c(v,z,A,I,T,b)}else T&&T.opacity!=0&&c(v,z,A,I,T,b)}}else if(I instanceof THREE.RenderableFace4&&(v=I.v1,z=I.v2,A=I.v3,x=I.v4,v.positionScreen.x*=t,v.positionScreen.y*=-u,z.positionScreen.x*=t,z.positionScreen.y*=-u,A.positionScreen.x*=t,A.positionScreen.y*=-u,x.positionScreen.x*=t,x.positionScreen.y*=-u,y.addPoint(v.positionScreen.x,v.positionScreen.y),y.addPoint(z.positionScreen.x,
+z.positionScreen.y),y.addPoint(A.positionScreen.x,A.positionScreen.y),y.addPoint(x.positionScreen.x,x.positionScreen.y),F.instersects(y))){n=0;for(G=I.meshMaterials.length;n<G;)if(T=I.meshMaterials[n++],T instanceof THREE.MeshFaceMaterial){B=0;for(E=I.faceMaterials.length;B<E;)(T=I.faceMaterials[B++])&&T.opacity!=0&&d(v,z,A,x,I,T,b)}else T&&T.opacity!=0&&d(v,z,A,x,I,T,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",
 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_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",map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\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",
@@ -225,8 +225,8 @@ THREE.ShaderChunk.color_pars_vertex,"void main() {",THREE.ShaderChunk.color_vert
 THREE.WebGLRenderer=function(b){function c(b,d,c){var e,f,g,j=b.vertices,k=j.length,m=b.colors,o=m.length,p=b.__vertexArray,n=b.__colorArray,t=b.__sortArray,u=b.__dirtyVertices,v=b.__dirtyColors;if(c.sortParticles){T.multiplySelf(c.matrixWorld);for(e=0;e<k;e++)f=j[e].position,ia.copy(f),T.multiplyVector3(ia),t[e]=[ia.z,e];t.sort(function(b,d){return d[0]-b[0]});for(e=0;e<k;e++)f=j[t[e][1]].position,g=e*3,p[g]=f.x,p[g+1]=f.y,p[g+2]=f.z;for(e=0;e<o;e++)g=e*3,color=m[t[e][1]],n[g]=color.r,n[g+1]=color.g,
 THREE.WebGLRenderer=function(b){function c(b,d,c){var e,f,g,j=b.vertices,k=j.length,m=b.colors,o=m.length,p=b.__vertexArray,n=b.__colorArray,t=b.__sortArray,u=b.__dirtyVertices,v=b.__dirtyColors;if(c.sortParticles){T.multiplySelf(c.matrixWorld);for(e=0;e<k;e++)f=j[e].position,ia.copy(f),T.multiplyVector3(ia),t[e]=[ia.z,e];t.sort(function(b,d){return d[0]-b[0]});for(e=0;e<k;e++)f=j[t[e][1]].position,g=e*3,p[g]=f.x,p[g+1]=f.y,p[g+2]=f.z;for(e=0;e<o;e++)g=e*3,color=m[t[e][1]],n[g]=color.r,n[g+1]=color.g,
 n[g+2]=color.b}else{if(u)for(e=0;e<k;e++)f=j[e].position,g=e*3,p[g]=f.x,p[g+1]=f.y,p[g+2]=f.z;if(v)for(e=0;e<o;e++)color=m[e],g=e*3,n[g]=color.r,n[g+1]=color.g,n[g+2]=color.b}if(u||c.sortParticles)h.bindBuffer(h.ARRAY_BUFFER,b.__webglVertexBuffer),h.bufferData(h.ARRAY_BUFFER,p,d);if(v||c.sortParticles)h.bindBuffer(h.ARRAY_BUFFER,b.__webglColorBuffer),h.bufferData(h.ARRAY_BUFFER,n,d)}function d(b,d,c,e,f){e.program||U.initMaterial(e,d,c,f);var g=e.program,j=g.uniforms,k=e.uniforms;g!=S&&(h.useProgram(g),
 n[g+2]=color.b}else{if(u)for(e=0;e<k;e++)f=j[e].position,g=e*3,p[g]=f.x,p[g+1]=f.y,p[g+2]=f.z;if(v)for(e=0;e<o;e++)color=m[e],g=e*3,n[g]=color.r,n[g+1]=color.g,n[g+2]=color.b}if(u||c.sortParticles)h.bindBuffer(h.ARRAY_BUFFER,b.__webglVertexBuffer),h.bufferData(h.ARRAY_BUFFER,p,d);if(v||c.sortParticles)h.bindBuffer(h.ARRAY_BUFFER,b.__webglColorBuffer),h.bufferData(h.ARRAY_BUFFER,n,d)}function d(b,d,c,e,f){e.program||U.initMaterial(e,d,c,f);var g=e.program,j=g.uniforms,k=e.uniforms;g!=S&&(h.useProgram(g),
 S=g);h.uniformMatrix4fv(j.projectionMatrix,!1,Z);if(c&&(e instanceof THREE.MeshBasicMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.MeshPhongMaterial||e instanceof THREE.LineBasicMaterial||e instanceof THREE.ParticleBasicMaterial||e.fog))if(k.fogColor.value=c.color,c instanceof THREE.Fog)k.fogNear.value=c.near,k.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)k.fogDensity.value=c.density;if(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e.lights){var m,
 S=g);h.uniformMatrix4fv(j.projectionMatrix,!1,Z);if(c&&(e instanceof THREE.MeshBasicMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.MeshPhongMaterial||e instanceof THREE.LineBasicMaterial||e instanceof THREE.ParticleBasicMaterial||e.fog))if(k.fogColor.value=c.color,c instanceof THREE.Fog)k.fogNear.value=c.near,k.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)k.fogDensity.value=c.density;if(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e.lights){var m,
-o,p=0,n=0,t=0,u,v,y,z,x=X,A=x.directional.colors,G=x.directional.positions,F=x.point.colors,D=x.point.positions,E=x.point.distances,L=0,C=0,c=o=z=0;for(m=d.length;c<m;c++)if(o=d[c],u=o.color,v=o.position,y=o.intensity,z=o.distance,o instanceof THREE.AmbientLight)p+=u.r,n+=u.g,t+=u.b;else if(o instanceof THREE.DirectionalLight)z=L*3,A[z]=u.r*y,A[z+1]=u.g*y,A[z+2]=u.b*y,G[z]=v.x,G[z+1]=v.y,G[z+2]=v.z,L+=1;else if(o instanceof THREE.PointLight)o=C*3,F[o]=u.r*y,F[o+1]=u.g*y,F[o+2]=u.b*y,D[o]=v.x,D[o+
-1]=v.y,D[o+2]=v.z,E[C]=z,C+=1;for(c=L*3;c<A.length;c++)A[c]=0;for(c=C*3;c<F.length;c++)F[c]=0;x.point.length=C;x.directional.length=L;x.ambient[0]=p;x.ambient[1]=n;x.ambient[2]=t;c=X;k.enableLighting.value=c.directional.length+c.point.length;k.ambientLightColor.value=c.ambient;k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;k.pointLightColor.value=c.point.colors;k.pointLightPosition.value=c.point.positions;k.pointLightDistance.value=c.point.distances}if(e instanceof
+o,p=0,n=0,t=0,u,v,x,z,A=X,y=A.directional.colors,G=A.directional.positions,F=A.point.colors,D=A.point.positions,E=A.point.distances,L=0,C=0,c=o=z=0;for(m=d.length;c<m;c++)if(o=d[c],u=o.color,v=o.position,x=o.intensity,z=o.distance,o instanceof THREE.AmbientLight)p+=u.r,n+=u.g,t+=u.b;else if(o instanceof THREE.DirectionalLight)z=L*3,y[z]=u.r*x,y[z+1]=u.g*x,y[z+2]=u.b*x,G[z]=v.x,G[z+1]=v.y,G[z+2]=v.z,L+=1;else if(o instanceof THREE.PointLight)o=C*3,F[o]=u.r*x,F[o+1]=u.g*x,F[o+2]=u.b*x,D[o]=v.x,D[o+
+1]=v.y,D[o+2]=v.z,E[C]=z,C+=1;for(c=L*3;c<y.length;c++)y[c]=0;for(c=C*3;c<F.length;c++)F[c]=0;A.point.length=C;A.directional.length=L;A.ambient[0]=p;A.ambient[1]=n;A.ambient[2]=t;c=X;k.enableLighting.value=c.directional.length+c.point.length;k.ambientLightColor.value=c.ambient;k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;k.pointLightColor.value=c.point.colors;k.pointLightPosition.value=c.point.positions;k.pointLightDistance.value=c.point.distances}if(e instanceof
 THREE.MeshBasicMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.MeshPhongMaterial)k.diffuse.value=e.color,k.opacity.value=e.opacity,(k.map.texture=e.map)&&k.offsetRepeat.value.set(e.map.offset.x,e.map.offset.y,e.map.repeat.x,e.map.repeat.y),k.lightMap.texture=e.lightMap,k.envMap.texture=e.envMap,k.reflectivity.value=e.reflectivity,k.refractionRatio.value=e.refractionRatio,k.combine.value=e.combine,k.useRefract.value=e.envMap&&e.envMap.mapping instanceof THREE.CubeRefractionMapping;
 THREE.MeshBasicMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.MeshPhongMaterial)k.diffuse.value=e.color,k.opacity.value=e.opacity,(k.map.texture=e.map)&&k.offsetRepeat.value.set(e.map.offset.x,e.map.offset.y,e.map.repeat.x,e.map.repeat.y),k.lightMap.texture=e.lightMap,k.envMap.texture=e.envMap,k.reflectivity.value=e.reflectivity,k.refractionRatio.value=e.refractionRatio,k.combine.value=e.combine,k.useRefract.value=e.envMap&&e.envMap.mapping instanceof THREE.CubeRefractionMapping;
 if(e instanceof THREE.LineBasicMaterial)k.diffuse.value=e.color,k.opacity.value=e.opacity;else if(e instanceof THREE.ParticleBasicMaterial)k.psColor.value=e.color,k.opacity.value=e.opacity,k.size.value=e.size,k.scale.value=H.height/2,k.map.texture=e.map;else if(e instanceof THREE.MeshPhongMaterial)k.ambient.value=e.ambient,k.specular.value=e.specular,k.shininess.value=e.shininess;else if(e instanceof THREE.MeshDepthMaterial)k.mNear.value=b.near,k.mFar.value=b.far,k.opacity.value=e.opacity;else if(e instanceof
 if(e instanceof THREE.LineBasicMaterial)k.diffuse.value=e.color,k.opacity.value=e.opacity;else if(e instanceof THREE.ParticleBasicMaterial)k.psColor.value=e.color,k.opacity.value=e.opacity,k.size.value=e.size,k.scale.value=H.height/2,k.map.texture=e.map;else if(e instanceof THREE.MeshPhongMaterial)k.ambient.value=e.ambient,k.specular.value=e.specular,k.shininess.value=e.shininess;else if(e instanceof THREE.MeshDepthMaterial)k.mNear.value=b.near,k.mFar.value=b.far,k.opacity.value=e.opacity;else if(e instanceof
 THREE.MeshNormalMaterial)k.opacity.value=e.opacity;for(var wa in k)if(n=g.uniforms[wa])if(m=k[wa],p=m.type,c=m.value,p=="i")h.uniform1i(n,c);else if(p=="f")h.uniform1f(n,c);else if(p=="fv1")h.uniform1fv(n,c);else if(p=="fv")h.uniform3fv(n,c);else if(p=="v2")h.uniform2f(n,c.x,c.y);else if(p=="v3")h.uniform3f(n,c.x,c.y,c.z);else if(p=="v4")h.uniform4f(n,c.x,c.y,c.z,c.w);else if(p=="c")h.uniform3f(n,c.r,c.g,c.b);else if(p=="t"&&(h.uniform1i(n,c),m=m.texture))if(m.image instanceof Array&&m.image.length==
 THREE.MeshNormalMaterial)k.opacity.value=e.opacity;for(var wa in k)if(n=g.uniforms[wa])if(m=k[wa],p=m.type,c=m.value,p=="i")h.uniform1i(n,c);else if(p=="f")h.uniform1f(n,c);else if(p=="fv1")h.uniform1fv(n,c);else if(p=="fv")h.uniform3fv(n,c);else if(p=="v2")h.uniform2f(n,c.x,c.y);else if(p=="v3")h.uniform3f(n,c.x,c.y,c.z);else if(p=="v4")h.uniform4f(n,c.x,c.y,c.z,c.w);else if(p=="c")h.uniform3f(n,c.r,c.g,c.b);else if(p=="t"&&(h.uniform1i(n,c),m=m.texture))if(m.image instanceof Array&&m.image.length==
@@ -252,45 +252,45 @@ j.__webglNormalBuffer),h.vertexAttribPointer(o.normal,3,h.FLOAT,!1,0,0),h.bindBu
 j=fa/ka,k,m=[],o=ka*0.5,p=fa*0.5,n=!0;h.useProgram(_sprite.program);S=_sprite.program;ga=-1;pa||(h.enableVertexAttribArray(_sprite.attributes.position),h.enableVertexAttribArray(_sprite.attributes.uv),pa=!0);h.disable(h.CULL_FACE);h.enable(h.BLEND);h.depthMask(!0);h.bindBuffer(h.ARRAY_BUFFER,_sprite.vertexBuffer);h.vertexAttribPointer(c.position,2,h.FLOAT,!1,16,0);h.vertexAttribPointer(c.uv,2,h.FLOAT,!1,16,8);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,_sprite.elementBuffer);h.uniformMatrix4fv(g.projectionMatrix,
 j=fa/ka,k,m=[],o=ka*0.5,p=fa*0.5,n=!0;h.useProgram(_sprite.program);S=_sprite.program;ga=-1;pa||(h.enableVertexAttribArray(_sprite.attributes.position),h.enableVertexAttribArray(_sprite.attributes.uv),pa=!0);h.disable(h.CULL_FACE);h.enable(h.BLEND);h.depthMask(!0);h.bindBuffer(h.ARRAY_BUFFER,_sprite.vertexBuffer);h.vertexAttribPointer(c.position,2,h.FLOAT,!1,16,0);h.vertexAttribPointer(c.uv,2,h.FLOAT,!1,16,8);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,_sprite.elementBuffer);h.uniformMatrix4fv(g.projectionMatrix,
 !1,Z);h.activeTexture(h.TEXTURE0);h.uniform1i(g.map,0);c=0;for(e=b.__webglSprites.length;c<e;c++)f=b.__webglSprites[c],f.useScreenCoordinates?f.z=-f.position.z:(f._modelViewMatrix.multiplyToArray(d.matrixWorldInverse,f.matrixWorld,f._modelViewMatrixArray),f.z=-f._modelViewMatrix.n34);b.__webglSprites.sort(t);c=0;for(e=b.__webglSprites.length;c<e;c++)f=b.__webglSprites[c],f.material===void 0&&f.map&&f.map.image&&f.map.image.width&&(f.useScreenCoordinates?(h.uniform1i(g.useScreenCoordinates,1),h.uniform3f(g.screenPosition,
 !1,Z);h.activeTexture(h.TEXTURE0);h.uniform1i(g.map,0);c=0;for(e=b.__webglSprites.length;c<e;c++)f=b.__webglSprites[c],f.useScreenCoordinates?f.z=-f.position.z:(f._modelViewMatrix.multiplyToArray(d.matrixWorldInverse,f.matrixWorld,f._modelViewMatrixArray),f.z=-f._modelViewMatrix.n34);b.__webglSprites.sort(t);c=0;for(e=b.__webglSprites.length;c<e;c++)f=b.__webglSprites[c],f.material===void 0&&f.map&&f.map.image&&f.map.image.width&&(f.useScreenCoordinates?(h.uniform1i(g.useScreenCoordinates,1),h.uniform3f(g.screenPosition,
 (f.position.x-o)/o,(p-f.position.y)/p,Math.max(0,Math.min(1,f.position.z)))):(h.uniform1i(g.useScreenCoordinates,0),h.uniform1i(g.affectedByDistance,f.affectedByDistance?1:0),h.uniformMatrix4fv(g.modelViewMatrix,!1,f._modelViewMatrixArray)),k=f.map.image.width/(f.affectedByDistance?1:fa),m[0]=k*j*f.scale.x,m[1]=k*f.scale.y,h.uniform2f(g.uvScale,f.uvScale.x,f.uvScale.y),h.uniform2f(g.uvOffset,f.uvOffset.x,f.uvOffset.y),h.uniform2f(g.alignment,f.alignment.x,f.alignment.y),h.uniform1f(g.opacity,f.opacity),
 (f.position.x-o)/o,(p-f.position.y)/p,Math.max(0,Math.min(1,f.position.z)))):(h.uniform1i(g.useScreenCoordinates,0),h.uniform1i(g.affectedByDistance,f.affectedByDistance?1:0),h.uniformMatrix4fv(g.modelViewMatrix,!1,f._modelViewMatrixArray)),k=f.map.image.width/(f.affectedByDistance?1:fa),m[0]=k*j*f.scale.x,m[1]=k*f.scale.y,h.uniform2f(g.uvScale,f.uvScale.x,f.uvScale.y),h.uniform2f(g.uvOffset,f.uvOffset.x,f.uvOffset.y),h.uniform2f(g.alignment,f.alignment.x,f.alignment.y),h.uniform1f(g.opacity,f.opacity),
-h.uniform1f(g.rotation,f.rotation),h.uniform2fv(g.scale,m),f.mergeWith3D&&!n?(h.enable(h.DEPTH_TEST),n=!0):!f.mergeWith3D&&n&&(h.disable(h.DEPTH_TEST),n=!1),G(f.blending),Q(f.map,0),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0));h.enable(h.CULL_FACE);h.enable(h.DEPTH_TEST);h.depthMask(aa)}function z(b,d){var c,e,f=b.__webglLensFlares.length,g,j,k,m=new THREE.Vector3,o=fa/ka,p=ka*0.5,n=fa*0.5,t=16/fa,u=[t*o,t],v=[1,1,0],y=[1,1],z=P.uniforms;c=P.attributes;h.useProgram(P.program);S=P.program;ga=
+h.uniform1f(g.rotation,f.rotation),h.uniform2fv(g.scale,m),f.mergeWith3D&&!n?(h.enable(h.DEPTH_TEST),n=!0):!f.mergeWith3D&&n&&(h.disable(h.DEPTH_TEST),n=!1),G(f.blending),Q(f.map,0),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0));h.enable(h.CULL_FACE);h.enable(h.DEPTH_TEST);h.depthMask(aa)}function z(b,d){var c,e,f=b.__webglLensFlares.length,g,j,k,m=new THREE.Vector3,o=fa/ka,p=ka*0.5,n=fa*0.5,t=16/fa,u=[t*o,t],v=[1,1,0],x=[1,1],z=P.uniforms;c=P.attributes;h.useProgram(P.program);S=P.program;ga=
 -1;ta||(h.enableVertexAttribArray(P.attributes.vertex),h.enableVertexAttribArray(P.attributes.uv),ta=!0);h.uniform1i(z.occlusionMap,0);h.uniform1i(z.map,1);h.bindBuffer(h.ARRAY_BUFFER,P.vertexBuffer);h.vertexAttribPointer(c.vertex,2,h.FLOAT,!1,16,0);h.vertexAttribPointer(c.uv,2,h.FLOAT,!1,16,8);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,P.elementBuffer);h.disable(h.CULL_FACE);h.depthMask(!1);h.activeTexture(h.TEXTURE0);h.bindTexture(h.TEXTURE_2D,P.occlusionTexture);h.activeTexture(h.TEXTURE1);for(e=0;e<
 -1;ta||(h.enableVertexAttribArray(P.attributes.vertex),h.enableVertexAttribArray(P.attributes.uv),ta=!0);h.uniform1i(z.occlusionMap,0);h.uniform1i(z.map,1);h.bindBuffer(h.ARRAY_BUFFER,P.vertexBuffer);h.vertexAttribPointer(c.vertex,2,h.FLOAT,!1,16,0);h.vertexAttribPointer(c.uv,2,h.FLOAT,!1,16,8);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,P.elementBuffer);h.disable(h.CULL_FACE);h.depthMask(!1);h.activeTexture(h.TEXTURE0);h.bindTexture(h.TEXTURE_2D,P.occlusionTexture);h.activeTexture(h.TEXTURE1);for(e=0;e<
-f;e++)if(c=b.__webglLensFlares[e].object,m.set(c.matrixWorld.n14,c.matrixWorld.n24,c.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(m),d.projectionMatrix.multiplyVector3(m),v[0]=m.x,v[1]=m.y,v[2]=m.z,y[0]=v[0]*p+p,y[1]=v[1]*n+n,P.hasVertexTexture||y[0]>0&&y[0]<ka&&y[1]>0&&y[1]<fa){h.bindTexture(h.TEXTURE_2D,P.tempTexture);h.copyTexImage2D(h.TEXTURE_2D,0,h.RGB,y[0]-8,y[1]-8,16,16,0);h.uniform1i(z.renderType,0);h.uniform2fv(z.scale,u);h.uniform3fv(z.screenPosition,v);h.disable(h.BLEND);h.enable(h.DEPTH_TEST);
-h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0);h.bindTexture(h.TEXTURE_2D,P.occlusionTexture);h.copyTexImage2D(h.TEXTURE_2D,0,h.RGBA,y[0]-8,y[1]-8,16,16,0);h.uniform1i(z.renderType,1);h.disable(h.DEPTH_TEST);h.bindTexture(h.TEXTURE_2D,P.tempTexture);h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0);c.positionScreen.x=v[0];c.positionScreen.y=v[1];c.positionScreen.z=v[2];c.customUpdateCallback?c.customUpdateCallback(c):c.updateLensFlares();h.uniform1i(z.renderType,2);h.enable(h.BLEND);g=0;for(j=c.lensFlares.length;g<
-j;g++)if(k=c.lensFlares[g],k.opacity>0.0010&&k.scale>0.0010)v[0]=k.x,v[1]=k.y,v[2]=k.z,t=k.size*k.scale/fa,u[0]=t*o,u[1]=t,h.uniform3fv(z.screenPosition,v),h.uniform2fv(z.scale,u),h.uniform1f(z.rotation,k.rotation),h.uniform1f(z.opacity,k.opacity),G(k.blending),Q(k.texture,1),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0)}h.enable(h.CULL_FACE);h.enable(h.DEPTH_TEST);h.depthMask(aa)}function A(b,d){b._modelViewMatrix.multiplyToArray(d.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}
-function y(b){var d,e,f,g;if(b instanceof THREE.Mesh){e=b.geometry;for(d in e.geometryGroups){f=e.geometryGroups[d];a:{for(var j=g=void 0,k=void 0,m=void 0,o=void 0,o=f.__materials,j=0,k=o.length;j<k;j++)if(m=o[j],m.attributes)for(g in m.attributes)if(m.attributes[g].needsUpdate){g=!0;break a}g=!1}if(e.__dirtyVertices||e.__dirtyMorphTargets||e.__dirtyElements||e.__dirtyUvs||e.__dirtyNormals||e.__dirtyColors||e.__dirtyTangents||g)if(g=f,j=b,k=h.DYNAMIC_DRAW,g.__inittedArrays){var p=o=m=void 0,n=void 0,
-t=p=void 0,u=void 0,v=void 0,y=void 0,z=void 0,x=void 0,A=void 0,G=void 0,F=void 0,B=void 0,D=void 0,X=void 0,E=void 0,C=n=y=n=v=u=void 0,H=void 0,w=H=C=u=void 0,L=void 0,I=w=H=C=p=p=t=y=n=w=H=C=L=w=H=C=L=w=H=C=void 0,K=0,ha=0,O=0,P=0,Q=0,ma=0,M=0,T=0,R=0,J=0,Y=0,H=C=0,W=g.__vertexArray,aa=g.__uvArray,ca=g.__uv2Array,ga=g.__normalArray,S=g.__tangentArray,ja=g.__colorArray,U=g.__skinVertexAArray,V=g.__skinVertexBArray,Z=g.__skinIndexArray,$=g.__skinWeightArray,ia=g.__morphTargetsArrays,fa=g.__webglCustomAttributes,
-w=void 0,da=g.__faceArray,ea=g.__lineArray,ka=g.__needsSmoothNormals,x=g.__vertexColorType,z=g.__uvType,A=g.__normalType,na=j.geometry,pa=na.__dirtyVertices,Ba=na.__dirtyElements,ta=na.__dirtyUvs,za=na.__dirtyNormals,Wa=na.__dirtyTangents,Xa=na.__dirtyColors,Ya=na.__dirtyMorphTargets,Ga=na.vertices,$a=g.faces,cb=na.faces,ab=na.faceVertexUvs[0],bb=na.faceVertexUvs[1],Ha=na.skinVerticesA,Ia=na.skinVerticesB,Ja=na.skinIndices,Aa=na.skinWeights,Ea=j instanceof THREE.ShadowVolume?na.edgeFaces:void 0,ya=
-na.morphTargets;if(fa)for(I in fa)fa[I].offset=0,fa[I].offsetSrc=0;m=0;for(o=$a.length;m<o;m++)if(p=$a[m],n=cb[p],ab&&(G=ab[p]),bb&&(F=bb[p]),p=n.vertexNormals,t=n.normal,u=n.vertexColors,v=n.color,y=n.vertexTangents,n instanceof THREE.Face3){if(pa)B=Ga[n.a].position,D=Ga[n.b].position,X=Ga[n.c].position,W[ha]=B.x,W[ha+1]=B.y,W[ha+2]=B.z,W[ha+3]=D.x,W[ha+4]=D.y,W[ha+5]=D.z,W[ha+6]=X.x,W[ha+7]=X.y,W[ha+8]=X.z,ha+=9;if(fa)for(I in fa)if(w=fa[I],w.__original.needsUpdate)C=w.offset,H=w.offsetSrc,w.size===
-1?(w.boundTo===void 0||w.boundTo==="vertices"?(w.array[C+0]=w.value[n.a],w.array[C+1]=w.value[n.b],w.array[C+2]=w.value[n.c]):w.boundTo==="faces"?(w.array[C+0]=w.value[H],w.array[C+1]=w.value[H],w.array[C+2]=w.value[H],w.offsetSrc++):w.boundTo==="faceVertices"&&(w.array[C+0]=w.value[H+0],w.array[C+1]=w.value[H+1],w.array[C+2]=w.value[H+2],w.offsetSrc+=3),w.offset+=3):(w.boundTo===void 0||w.boundTo==="vertices"?(B=w.value[n.a],D=w.value[n.b],X=w.value[n.c]):w.boundTo==="faces"?(B=w.value[H],D=w.value[H],
-X=w.value[H],w.offsetSrc++):w.boundTo==="faceVertices"&&(B=w.value[H+0],D=w.value[H+1],X=w.value[H+2],w.offsetSrc+=3),w.size===2?(w.array[C+0]=B.x,w.array[C+1]=B.y,w.array[C+2]=D.x,w.array[C+3]=D.y,w.array[C+4]=X.x,w.array[C+5]=X.y,w.offset+=6):w.size===3?(w.type==="c"?(w.array[C+0]=B.r,w.array[C+1]=B.g,w.array[C+2]=B.b,w.array[C+3]=D.r,w.array[C+4]=D.g,w.array[C+5]=D.b,w.array[C+6]=X.r,w.array[C+7]=X.g,w.array[C+8]=X.b):(w.array[C+0]=B.x,w.array[C+1]=B.y,w.array[C+2]=B.z,w.array[C+3]=D.x,w.array[C+
-4]=D.y,w.array[C+5]=D.z,w.array[C+6]=X.x,w.array[C+7]=X.y,w.array[C+8]=X.z),w.offset+=9):(w.array[C+0]=B.x,w.array[C+1]=B.y,w.array[C+2]=B.z,w.array[C+3]=B.w,w.array[C+4]=D.x,w.array[C+5]=D.y,w.array[C+6]=D.z,w.array[C+7]=D.w,w.array[C+8]=X.x,w.array[C+9]=X.y,w.array[C+10]=X.z,w.array[C+11]=X.w,w.offset+=12));if(Ya){C=0;for(H=ya.length;C<H;C++)B=ya[C].vertices[n.a].position,D=ya[C].vertices[n.b].position,X=ya[C].vertices[n.c].position,w=ia[C],w[Y+0]=B.x,w[Y+1]=B.y,w[Y+2]=B.z,w[Y+3]=D.x,w[Y+4]=D.y,
-w[Y+5]=D.z,w[Y+6]=X.x,w[Y+7]=X.y,w[Y+8]=X.z;Y+=9}if(Aa.length)C=Aa[n.a],H=Aa[n.b],w=Aa[n.c],$[J]=C.x,$[J+1]=C.y,$[J+2]=C.z,$[J+3]=C.w,$[J+4]=H.x,$[J+5]=H.y,$[J+6]=H.z,$[J+7]=H.w,$[J+8]=w.x,$[J+9]=w.y,$[J+10]=w.z,$[J+11]=w.w,C=Ja[n.a],H=Ja[n.b],w=Ja[n.c],Z[J]=C.x,Z[J+1]=C.y,Z[J+2]=C.z,Z[J+3]=C.w,Z[J+4]=H.x,Z[J+5]=H.y,Z[J+6]=H.z,Z[J+7]=H.w,Z[J+8]=w.x,Z[J+9]=w.y,Z[J+10]=w.z,Z[J+11]=w.w,C=Ha[n.a],H=Ha[n.b],w=Ha[n.c],U[J]=C.x,U[J+1]=C.y,U[J+2]=C.z,U[J+3]=1,U[J+4]=H.x,U[J+5]=H.y,U[J+6]=H.z,U[J+7]=1,U[J+
-8]=w.x,U[J+9]=w.y,U[J+10]=w.z,U[J+11]=1,C=Ia[n.a],H=Ia[n.b],w=Ia[n.c],V[J]=C.x,V[J+1]=C.y,V[J+2]=C.z,V[J+3]=1,V[J+4]=H.x,V[J+5]=H.y,V[J+6]=H.z,V[J+7]=1,V[J+8]=w.x,V[J+9]=w.y,V[J+10]=w.z,V[J+11]=1,J+=12;if(Xa&&x)u.length==3&&x==THREE.VertexColors?(n=u[0],C=u[1],H=u[2]):H=C=n=v,ja[R]=n.r,ja[R+1]=n.g,ja[R+2]=n.b,ja[R+3]=C.r,ja[R+4]=C.g,ja[R+5]=C.b,ja[R+6]=H.r,ja[R+7]=H.g,ja[R+8]=H.b,R+=9;if(Wa&&na.hasTangents)u=y[0],v=y[1],n=y[2],S[M]=u.x,S[M+1]=u.y,S[M+2]=u.z,S[M+3]=u.w,S[M+4]=v.x,S[M+5]=v.y,S[M+6]=
-v.z,S[M+7]=v.w,S[M+8]=n.x,S[M+9]=n.y,S[M+10]=n.z,S[M+11]=n.w,M+=12;if(za&&A)if(p.length==3&&ka)for(y=0;y<3;y++)t=p[y],ga[ma]=t.x,ga[ma+1]=t.y,ga[ma+2]=t.z,ma+=3;else for(y=0;y<3;y++)ga[ma]=t.x,ga[ma+1]=t.y,ga[ma+2]=t.z,ma+=3;if(ta&&G!==void 0&&z)for(y=0;y<3;y++)p=G[y],aa[O]=p.u,aa[O+1]=p.v,O+=2;if(ta&&F!==void 0&&z)for(y=0;y<3;y++)p=F[y],ca[P]=p.u,ca[P+1]=p.v,P+=2;Ba&&(da[Q]=K,da[Q+1]=K+1,da[Q+2]=K+2,Q+=3,ea[T]=K,ea[T+1]=K+1,ea[T+2]=K,ea[T+3]=K+2,ea[T+4]=K+1,ea[T+5]=K+2,T+=6,K+=3)}else if(n instanceof
-THREE.Face4){if(pa)B=Ga[n.a].position,D=Ga[n.b].position,X=Ga[n.c].position,E=Ga[n.d].position,W[ha]=B.x,W[ha+1]=B.y,W[ha+2]=B.z,W[ha+3]=D.x,W[ha+4]=D.y,W[ha+5]=D.z,W[ha+6]=X.x,W[ha+7]=X.y,W[ha+8]=X.z,W[ha+9]=E.x,W[ha+10]=E.y,W[ha+11]=E.z,ha+=12;if(fa)for(I in fa)if(w=fa[I],w.__original.needsUpdate)C=w.offset,H=w.offsetSrc,w.size===1?(w.boundTo===void 0||w.boundTo==="vertices"?(w.array[C+0]=w.value[n.a],w.array[C+1]=w.value[n.b],w.array[C+2]=w.value[n.c],w.array[C+3]=w.value[n.d]):w.boundTo==="faces"?
-(w.array[C+0]=w.value[H],w.array[C+1]=w.value[H],w.array[C+2]=w.value[H],w.array[C+3]=w.value[H],w.offsetSrc++):w.boundTo==="faceVertices"&&(w.array[C+0]=w.value[H+0],w.array[C+1]=w.value[H+1],w.array[C+2]=w.value[H+2],w.array[C+3]=w.value[H+3],w.offsetSrc+=4),w.offset+=4):(w.boundTo===void 0||w.boundTo==="vertices"?(B=w.value[n.a],D=w.value[n.b],X=w.value[n.c],E=w.value[n.d]):w.boundTo==="faces"?(B=w.value[H],D=w.value[H],X=w.value[H],E=w.value[H],w.offsetSrc++):w.boundTo==="faceVertices"&&(B=w.value[H+
-0],D=w.value[H+1],X=w.value[H+2],E=w.value[H+3],w.offsetSrc+=4),w.size===2?(w.array[C+0]=B.x,w.array[C+1]=B.y,w.array[C+2]=D.x,w.array[C+3]=D.y,w.array[C+4]=X.x,w.array[C+5]=X.y,w.array[C+6]=E.x,w.array[C+7]=E.y,w.offset+=8):w.size===3?(w.type==="c"?(w.array[C+0]=B.r,w.array[C+1]=B.g,w.array[C+2]=B.b,w.array[C+3]=D.r,w.array[C+4]=D.g,w.array[C+5]=D.b,w.array[C+6]=X.r,w.array[C+7]=X.g,w.array[C+8]=X.b,w.array[C+9]=E.r,w.array[C+10]=E.g,w.array[C+11]=E.b):(w.array[C+0]=B.x,w.array[C+1]=B.y,w.array[C+
-2]=B.z,w.array[C+3]=D.x,w.array[C+4]=D.y,w.array[C+5]=D.z,w.array[C+6]=X.x,w.array[C+7]=X.y,w.array[C+8]=X.z,w.array[C+9]=E.x,w.array[C+10]=E.y,w.array[C+11]=E.z),w.offset+=12):(w.array[C+0]=B.x,w.array[C+1]=B.y,w.array[C+2]=B.z,w.array[C+3]=B.w,w.array[C+4]=D.x,w.array[C+5]=D.y,w.array[C+6]=D.z,w.array[C+7]=D.w,w.array[C+8]=X.x,w.array[C+9]=X.y,w.array[C+10]=X.z,w.array[C+11]=X.w,w.array[C+12]=E.x,w.array[C+13]=E.y,w.array[C+14]=E.z,w.array[C+15]=E.w,w.offset+=16));if(Ya){C=0;for(H=ya.length;C<H;C++)B=
-ya[C].vertices[n.a].position,D=ya[C].vertices[n.b].position,X=ya[C].vertices[n.c].position,E=ya[C].vertices[n.d].position,w=ia[C],w[Y+0]=B.x,w[Y+1]=B.y,w[Y+2]=B.z,w[Y+3]=D.x,w[Y+4]=D.y,w[Y+5]=D.z,w[Y+6]=X.x,w[Y+7]=X.y,w[Y+8]=X.z,w[Y+9]=E.x,w[Y+10]=E.y,w[Y+11]=E.z;Y+=12}if(Aa.length)C=Aa[n.a],H=Aa[n.b],w=Aa[n.c],L=Aa[n.d],$[J]=C.x,$[J+1]=C.y,$[J+2]=C.z,$[J+3]=C.w,$[J+4]=H.x,$[J+5]=H.y,$[J+6]=H.z,$[J+7]=H.w,$[J+8]=w.x,$[J+9]=w.y,$[J+10]=w.z,$[J+11]=w.w,$[J+12]=L.x,$[J+13]=L.y,$[J+14]=L.z,$[J+15]=L.w,
+f;e++)if(c=b.__webglLensFlares[e].object,m.set(c.matrixWorld.n14,c.matrixWorld.n24,c.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(m),d.projectionMatrix.multiplyVector3(m),v[0]=m.x,v[1]=m.y,v[2]=m.z,x[0]=v[0]*p+p,x[1]=v[1]*n+n,P.hasVertexTexture||x[0]>0&&x[0]<ka&&x[1]>0&&x[1]<fa){h.bindTexture(h.TEXTURE_2D,P.tempTexture);h.copyTexImage2D(h.TEXTURE_2D,0,h.RGB,x[0]-8,x[1]-8,16,16,0);h.uniform1i(z.renderType,0);h.uniform2fv(z.scale,u);h.uniform3fv(z.screenPosition,v);h.disable(h.BLEND);h.enable(h.DEPTH_TEST);
+h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0);h.bindTexture(h.TEXTURE_2D,P.occlusionTexture);h.copyTexImage2D(h.TEXTURE_2D,0,h.RGBA,x[0]-8,x[1]-8,16,16,0);h.uniform1i(z.renderType,1);h.disable(h.DEPTH_TEST);h.bindTexture(h.TEXTURE_2D,P.tempTexture);h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0);c.positionScreen.x=v[0];c.positionScreen.y=v[1];c.positionScreen.z=v[2];c.customUpdateCallback?c.customUpdateCallback(c):c.updateLensFlares();h.uniform1i(z.renderType,2);h.enable(h.BLEND);g=0;for(j=c.lensFlares.length;g<
+j;g++)if(k=c.lensFlares[g],k.opacity>0.001&&k.scale>0.001)v[0]=k.x,v[1]=k.y,v[2]=k.z,t=k.size*k.scale/fa,u[0]=t*o,u[1]=t,h.uniform3fv(z.screenPosition,v),h.uniform2fv(z.scale,u),h.uniform1f(z.rotation,k.rotation),h.uniform1f(z.opacity,k.opacity),G(k.blending),Q(k.texture,1),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0)}h.enable(h.CULL_FACE);h.enable(h.DEPTH_TEST);h.depthMask(aa)}function A(b,d){b._modelViewMatrix.multiplyToArray(d.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}
+function x(b){var d,e,f,g;if(b instanceof THREE.Mesh){e=b.geometry;for(d in e.geometryGroups){f=e.geometryGroups[d];a:{for(var j=g=void 0,k=void 0,m=void 0,o=void 0,o=f.__materials,j=0,k=o.length;j<k;j++)if(m=o[j],m.attributes)for(g in m.attributes)if(m.attributes[g].needsUpdate){g=!0;break a}g=!1}if(e.__dirtyVertices||e.__dirtyMorphTargets||e.__dirtyElements||e.__dirtyUvs||e.__dirtyNormals||e.__dirtyColors||e.__dirtyTangents||g)if(g=f,j=b,k=h.DYNAMIC_DRAW,g.__inittedArrays){var p=o=m=void 0,n=void 0,
+t=p=void 0,u=void 0,v=void 0,x=void 0,z=void 0,A=void 0,y=void 0,G=void 0,F=void 0,D=void 0,B=void 0,X=void 0,E=void 0,C=n=x=n=v=u=void 0,H=void 0,w=H=C=u=void 0,L=void 0,I=w=H=C=p=p=t=x=n=w=H=C=L=w=H=C=L=w=H=C=void 0,K=0,ha=0,O=0,P=0,Q=0,ma=0,N=0,T=0,R=0,J=0,Y=0,H=C=0,W=g.__vertexArray,aa=g.__uvArray,ca=g.__uv2Array,ga=g.__normalArray,S=g.__tangentArray,ja=g.__colorArray,U=g.__skinVertexAArray,V=g.__skinVertexBArray,Z=g.__skinIndexArray,$=g.__skinWeightArray,ia=g.__morphTargetsArrays,fa=g.__webglCustomAttributes,
+w=void 0,da=g.__faceArray,ea=g.__lineArray,ka=g.__needsSmoothNormals,A=g.__vertexColorType,z=g.__uvType,y=g.__normalType,na=j.geometry,pa=na.__dirtyVertices,Ba=na.__dirtyElements,ta=na.__dirtyUvs,za=na.__dirtyNormals,Wa=na.__dirtyTangents,Xa=na.__dirtyColors,Ya=na.__dirtyMorphTargets,Ga=na.vertices,$a=g.faces,cb=na.faces,ab=na.faceVertexUvs[0],bb=na.faceVertexUvs[1],Ha=na.skinVerticesA,Ia=na.skinVerticesB,Ja=na.skinIndices,Aa=na.skinWeights,Ea=j instanceof THREE.ShadowVolume?na.edgeFaces:void 0,ya=
+na.morphTargets;if(fa)for(I in fa)fa[I].offset=0,fa[I].offsetSrc=0;m=0;for(o=$a.length;m<o;m++)if(p=$a[m],n=cb[p],ab&&(G=ab[p]),bb&&(F=bb[p]),p=n.vertexNormals,t=n.normal,u=n.vertexColors,v=n.color,x=n.vertexTangents,n instanceof THREE.Face3){if(pa)D=Ga[n.a].position,B=Ga[n.b].position,X=Ga[n.c].position,W[ha]=D.x,W[ha+1]=D.y,W[ha+2]=D.z,W[ha+3]=B.x,W[ha+4]=B.y,W[ha+5]=B.z,W[ha+6]=X.x,W[ha+7]=X.y,W[ha+8]=X.z,ha+=9;if(fa)for(I in fa)if(w=fa[I],w.__original.needsUpdate)C=w.offset,H=w.offsetSrc,w.size===
+1?(w.boundTo===void 0||w.boundTo==="vertices"?(w.array[C+0]=w.value[n.a],w.array[C+1]=w.value[n.b],w.array[C+2]=w.value[n.c]):w.boundTo==="faces"?(w.array[C+0]=w.value[H],w.array[C+1]=w.value[H],w.array[C+2]=w.value[H],w.offsetSrc++):w.boundTo==="faceVertices"&&(w.array[C+0]=w.value[H+0],w.array[C+1]=w.value[H+1],w.array[C+2]=w.value[H+2],w.offsetSrc+=3),w.offset+=3):(w.boundTo===void 0||w.boundTo==="vertices"?(D=w.value[n.a],B=w.value[n.b],X=w.value[n.c]):w.boundTo==="faces"?(D=w.value[H],B=w.value[H],
+X=w.value[H],w.offsetSrc++):w.boundTo==="faceVertices"&&(D=w.value[H+0],B=w.value[H+1],X=w.value[H+2],w.offsetSrc+=3),w.size===2?(w.array[C+0]=D.x,w.array[C+1]=D.y,w.array[C+2]=B.x,w.array[C+3]=B.y,w.array[C+4]=X.x,w.array[C+5]=X.y,w.offset+=6):w.size===3?(w.type==="c"?(w.array[C+0]=D.r,w.array[C+1]=D.g,w.array[C+2]=D.b,w.array[C+3]=B.r,w.array[C+4]=B.g,w.array[C+5]=B.b,w.array[C+6]=X.r,w.array[C+7]=X.g,w.array[C+8]=X.b):(w.array[C+0]=D.x,w.array[C+1]=D.y,w.array[C+2]=D.z,w.array[C+3]=B.x,w.array[C+
+4]=B.y,w.array[C+5]=B.z,w.array[C+6]=X.x,w.array[C+7]=X.y,w.array[C+8]=X.z),w.offset+=9):(w.array[C+0]=D.x,w.array[C+1]=D.y,w.array[C+2]=D.z,w.array[C+3]=D.w,w.array[C+4]=B.x,w.array[C+5]=B.y,w.array[C+6]=B.z,w.array[C+7]=B.w,w.array[C+8]=X.x,w.array[C+9]=X.y,w.array[C+10]=X.z,w.array[C+11]=X.w,w.offset+=12));if(Ya){C=0;for(H=ya.length;C<H;C++)D=ya[C].vertices[n.a].position,B=ya[C].vertices[n.b].position,X=ya[C].vertices[n.c].position,w=ia[C],w[Y+0]=D.x,w[Y+1]=D.y,w[Y+2]=D.z,w[Y+3]=B.x,w[Y+4]=B.y,
+w[Y+5]=B.z,w[Y+6]=X.x,w[Y+7]=X.y,w[Y+8]=X.z;Y+=9}if(Aa.length)C=Aa[n.a],H=Aa[n.b],w=Aa[n.c],$[J]=C.x,$[J+1]=C.y,$[J+2]=C.z,$[J+3]=C.w,$[J+4]=H.x,$[J+5]=H.y,$[J+6]=H.z,$[J+7]=H.w,$[J+8]=w.x,$[J+9]=w.y,$[J+10]=w.z,$[J+11]=w.w,C=Ja[n.a],H=Ja[n.b],w=Ja[n.c],Z[J]=C.x,Z[J+1]=C.y,Z[J+2]=C.z,Z[J+3]=C.w,Z[J+4]=H.x,Z[J+5]=H.y,Z[J+6]=H.z,Z[J+7]=H.w,Z[J+8]=w.x,Z[J+9]=w.y,Z[J+10]=w.z,Z[J+11]=w.w,C=Ha[n.a],H=Ha[n.b],w=Ha[n.c],U[J]=C.x,U[J+1]=C.y,U[J+2]=C.z,U[J+3]=1,U[J+4]=H.x,U[J+5]=H.y,U[J+6]=H.z,U[J+7]=1,U[J+
+8]=w.x,U[J+9]=w.y,U[J+10]=w.z,U[J+11]=1,C=Ia[n.a],H=Ia[n.b],w=Ia[n.c],V[J]=C.x,V[J+1]=C.y,V[J+2]=C.z,V[J+3]=1,V[J+4]=H.x,V[J+5]=H.y,V[J+6]=H.z,V[J+7]=1,V[J+8]=w.x,V[J+9]=w.y,V[J+10]=w.z,V[J+11]=1,J+=12;if(Xa&&A)u.length==3&&A==THREE.VertexColors?(n=u[0],C=u[1],H=u[2]):H=C=n=v,ja[R]=n.r,ja[R+1]=n.g,ja[R+2]=n.b,ja[R+3]=C.r,ja[R+4]=C.g,ja[R+5]=C.b,ja[R+6]=H.r,ja[R+7]=H.g,ja[R+8]=H.b,R+=9;if(Wa&&na.hasTangents)u=x[0],v=x[1],n=x[2],S[N]=u.x,S[N+1]=u.y,S[N+2]=u.z,S[N+3]=u.w,S[N+4]=v.x,S[N+5]=v.y,S[N+6]=
+v.z,S[N+7]=v.w,S[N+8]=n.x,S[N+9]=n.y,S[N+10]=n.z,S[N+11]=n.w,N+=12;if(za&&y)if(p.length==3&&ka)for(x=0;x<3;x++)t=p[x],ga[ma]=t.x,ga[ma+1]=t.y,ga[ma+2]=t.z,ma+=3;else for(x=0;x<3;x++)ga[ma]=t.x,ga[ma+1]=t.y,ga[ma+2]=t.z,ma+=3;if(ta&&G!==void 0&&z)for(x=0;x<3;x++)p=G[x],aa[O]=p.u,aa[O+1]=p.v,O+=2;if(ta&&F!==void 0&&z)for(x=0;x<3;x++)p=F[x],ca[P]=p.u,ca[P+1]=p.v,P+=2;Ba&&(da[Q]=K,da[Q+1]=K+1,da[Q+2]=K+2,Q+=3,ea[T]=K,ea[T+1]=K+1,ea[T+2]=K,ea[T+3]=K+2,ea[T+4]=K+1,ea[T+5]=K+2,T+=6,K+=3)}else if(n instanceof
+THREE.Face4){if(pa)D=Ga[n.a].position,B=Ga[n.b].position,X=Ga[n.c].position,E=Ga[n.d].position,W[ha]=D.x,W[ha+1]=D.y,W[ha+2]=D.z,W[ha+3]=B.x,W[ha+4]=B.y,W[ha+5]=B.z,W[ha+6]=X.x,W[ha+7]=X.y,W[ha+8]=X.z,W[ha+9]=E.x,W[ha+10]=E.y,W[ha+11]=E.z,ha+=12;if(fa)for(I in fa)if(w=fa[I],w.__original.needsUpdate)C=w.offset,H=w.offsetSrc,w.size===1?(w.boundTo===void 0||w.boundTo==="vertices"?(w.array[C+0]=w.value[n.a],w.array[C+1]=w.value[n.b],w.array[C+2]=w.value[n.c],w.array[C+3]=w.value[n.d]):w.boundTo==="faces"?
+(w.array[C+0]=w.value[H],w.array[C+1]=w.value[H],w.array[C+2]=w.value[H],w.array[C+3]=w.value[H],w.offsetSrc++):w.boundTo==="faceVertices"&&(w.array[C+0]=w.value[H+0],w.array[C+1]=w.value[H+1],w.array[C+2]=w.value[H+2],w.array[C+3]=w.value[H+3],w.offsetSrc+=4),w.offset+=4):(w.boundTo===void 0||w.boundTo==="vertices"?(D=w.value[n.a],B=w.value[n.b],X=w.value[n.c],E=w.value[n.d]):w.boundTo==="faces"?(D=w.value[H],B=w.value[H],X=w.value[H],E=w.value[H],w.offsetSrc++):w.boundTo==="faceVertices"&&(D=w.value[H+
+0],B=w.value[H+1],X=w.value[H+2],E=w.value[H+3],w.offsetSrc+=4),w.size===2?(w.array[C+0]=D.x,w.array[C+1]=D.y,w.array[C+2]=B.x,w.array[C+3]=B.y,w.array[C+4]=X.x,w.array[C+5]=X.y,w.array[C+6]=E.x,w.array[C+7]=E.y,w.offset+=8):w.size===3?(w.type==="c"?(w.array[C+0]=D.r,w.array[C+1]=D.g,w.array[C+2]=D.b,w.array[C+3]=B.r,w.array[C+4]=B.g,w.array[C+5]=B.b,w.array[C+6]=X.r,w.array[C+7]=X.g,w.array[C+8]=X.b,w.array[C+9]=E.r,w.array[C+10]=E.g,w.array[C+11]=E.b):(w.array[C+0]=D.x,w.array[C+1]=D.y,w.array[C+
+2]=D.z,w.array[C+3]=B.x,w.array[C+4]=B.y,w.array[C+5]=B.z,w.array[C+6]=X.x,w.array[C+7]=X.y,w.array[C+8]=X.z,w.array[C+9]=E.x,w.array[C+10]=E.y,w.array[C+11]=E.z),w.offset+=12):(w.array[C+0]=D.x,w.array[C+1]=D.y,w.array[C+2]=D.z,w.array[C+3]=D.w,w.array[C+4]=B.x,w.array[C+5]=B.y,w.array[C+6]=B.z,w.array[C+7]=B.w,w.array[C+8]=X.x,w.array[C+9]=X.y,w.array[C+10]=X.z,w.array[C+11]=X.w,w.array[C+12]=E.x,w.array[C+13]=E.y,w.array[C+14]=E.z,w.array[C+15]=E.w,w.offset+=16));if(Ya){C=0;for(H=ya.length;C<H;C++)D=
+ya[C].vertices[n.a].position,B=ya[C].vertices[n.b].position,X=ya[C].vertices[n.c].position,E=ya[C].vertices[n.d].position,w=ia[C],w[Y+0]=D.x,w[Y+1]=D.y,w[Y+2]=D.z,w[Y+3]=B.x,w[Y+4]=B.y,w[Y+5]=B.z,w[Y+6]=X.x,w[Y+7]=X.y,w[Y+8]=X.z,w[Y+9]=E.x,w[Y+10]=E.y,w[Y+11]=E.z;Y+=12}if(Aa.length)C=Aa[n.a],H=Aa[n.b],w=Aa[n.c],L=Aa[n.d],$[J]=C.x,$[J+1]=C.y,$[J+2]=C.z,$[J+3]=C.w,$[J+4]=H.x,$[J+5]=H.y,$[J+6]=H.z,$[J+7]=H.w,$[J+8]=w.x,$[J+9]=w.y,$[J+10]=w.z,$[J+11]=w.w,$[J+12]=L.x,$[J+13]=L.y,$[J+14]=L.z,$[J+15]=L.w,
 C=Ja[n.a],H=Ja[n.b],w=Ja[n.c],L=Ja[n.d],Z[J]=C.x,Z[J+1]=C.y,Z[J+2]=C.z,Z[J+3]=C.w,Z[J+4]=H.x,Z[J+5]=H.y,Z[J+6]=H.z,Z[J+7]=H.w,Z[J+8]=w.x,Z[J+9]=w.y,Z[J+10]=w.z,Z[J+11]=w.w,Z[J+12]=L.x,Z[J+13]=L.y,Z[J+14]=L.z,Z[J+15]=L.w,C=Ha[n.a],H=Ha[n.b],w=Ha[n.c],L=Ha[n.d],U[J]=C.x,U[J+1]=C.y,U[J+2]=C.z,U[J+3]=1,U[J+4]=H.x,U[J+5]=H.y,U[J+6]=H.z,U[J+7]=1,U[J+8]=w.x,U[J+9]=w.y,U[J+10]=w.z,U[J+11]=1,U[J+12]=L.x,U[J+13]=L.y,U[J+14]=L.z,U[J+15]=1,C=Ia[n.a],H=Ia[n.b],w=Ia[n.c],n=Ia[n.d],V[J]=C.x,V[J+1]=C.y,V[J+2]=C.z,
 C=Ja[n.a],H=Ja[n.b],w=Ja[n.c],L=Ja[n.d],Z[J]=C.x,Z[J+1]=C.y,Z[J+2]=C.z,Z[J+3]=C.w,Z[J+4]=H.x,Z[J+5]=H.y,Z[J+6]=H.z,Z[J+7]=H.w,Z[J+8]=w.x,Z[J+9]=w.y,Z[J+10]=w.z,Z[J+11]=w.w,Z[J+12]=L.x,Z[J+13]=L.y,Z[J+14]=L.z,Z[J+15]=L.w,C=Ha[n.a],H=Ha[n.b],w=Ha[n.c],L=Ha[n.d],U[J]=C.x,U[J+1]=C.y,U[J+2]=C.z,U[J+3]=1,U[J+4]=H.x,U[J+5]=H.y,U[J+6]=H.z,U[J+7]=1,U[J+8]=w.x,U[J+9]=w.y,U[J+10]=w.z,U[J+11]=1,U[J+12]=L.x,U[J+13]=L.y,U[J+14]=L.z,U[J+15]=1,C=Ia[n.a],H=Ia[n.b],w=Ia[n.c],n=Ia[n.d],V[J]=C.x,V[J+1]=C.y,V[J+2]=C.z,
-V[J+3]=1,V[J+4]=H.x,V[J+5]=H.y,V[J+6]=H.z,V[J+7]=1,V[J+8]=w.x,V[J+9]=w.y,V[J+10]=w.z,V[J+11]=1,V[J+12]=n.x,V[J+13]=n.y,V[J+14]=n.z,V[J+15]=1,J+=16;if(Xa&&x)u.length==4&&x==THREE.VertexColors?(n=u[0],C=u[1],H=u[2],u=u[3]):u=H=C=n=v,ja[R]=n.r,ja[R+1]=n.g,ja[R+2]=n.b,ja[R+3]=C.r,ja[R+4]=C.g,ja[R+5]=C.b,ja[R+6]=H.r,ja[R+7]=H.g,ja[R+8]=H.b,ja[R+9]=u.r,ja[R+10]=u.g,ja[R+11]=u.b,R+=12;if(Wa&&na.hasTangents)u=y[0],v=y[1],n=y[2],y=y[3],S[M]=u.x,S[M+1]=u.y,S[M+2]=u.z,S[M+3]=u.w,S[M+4]=v.x,S[M+5]=v.y,S[M+6]=
-v.z,S[M+7]=v.w,S[M+8]=n.x,S[M+9]=n.y,S[M+10]=n.z,S[M+11]=n.w,S[M+12]=y.x,S[M+13]=y.y,S[M+14]=y.z,S[M+15]=y.w,M+=16;if(za&&A)if(p.length==4&&ka)for(y=0;y<4;y++)t=p[y],ga[ma]=t.x,ga[ma+1]=t.y,ga[ma+2]=t.z,ma+=3;else for(y=0;y<4;y++)ga[ma]=t.x,ga[ma+1]=t.y,ga[ma+2]=t.z,ma+=3;if(ta&&G!==void 0&&z)for(y=0;y<4;y++)p=G[y],aa[O]=p.u,aa[O+1]=p.v,O+=2;if(ta&&F!==void 0&&z)for(y=0;y<4;y++)p=F[y],ca[P]=p.u,ca[P+1]=p.v,P+=2;Ba&&(da[Q]=K,da[Q+1]=K+1,da[Q+2]=K+3,da[Q+3]=K+1,da[Q+4]=K+2,da[Q+5]=K+3,Q+=6,ea[T]=K,
+V[J+3]=1,V[J+4]=H.x,V[J+5]=H.y,V[J+6]=H.z,V[J+7]=1,V[J+8]=w.x,V[J+9]=w.y,V[J+10]=w.z,V[J+11]=1,V[J+12]=n.x,V[J+13]=n.y,V[J+14]=n.z,V[J+15]=1,J+=16;if(Xa&&A)u.length==4&&A==THREE.VertexColors?(n=u[0],C=u[1],H=u[2],u=u[3]):u=H=C=n=v,ja[R]=n.r,ja[R+1]=n.g,ja[R+2]=n.b,ja[R+3]=C.r,ja[R+4]=C.g,ja[R+5]=C.b,ja[R+6]=H.r,ja[R+7]=H.g,ja[R+8]=H.b,ja[R+9]=u.r,ja[R+10]=u.g,ja[R+11]=u.b,R+=12;if(Wa&&na.hasTangents)u=x[0],v=x[1],n=x[2],x=x[3],S[N]=u.x,S[N+1]=u.y,S[N+2]=u.z,S[N+3]=u.w,S[N+4]=v.x,S[N+5]=v.y,S[N+6]=
+v.z,S[N+7]=v.w,S[N+8]=n.x,S[N+9]=n.y,S[N+10]=n.z,S[N+11]=n.w,S[N+12]=x.x,S[N+13]=x.y,S[N+14]=x.z,S[N+15]=x.w,N+=16;if(za&&y)if(p.length==4&&ka)for(x=0;x<4;x++)t=p[x],ga[ma]=t.x,ga[ma+1]=t.y,ga[ma+2]=t.z,ma+=3;else for(x=0;x<4;x++)ga[ma]=t.x,ga[ma+1]=t.y,ga[ma+2]=t.z,ma+=3;if(ta&&G!==void 0&&z)for(x=0;x<4;x++)p=G[x],aa[O]=p.u,aa[O+1]=p.v,O+=2;if(ta&&F!==void 0&&z)for(x=0;x<4;x++)p=F[x],ca[P]=p.u,ca[P+1]=p.v,P+=2;Ba&&(da[Q]=K,da[Q+1]=K+1,da[Q+2]=K+3,da[Q+3]=K+1,da[Q+4]=K+2,da[Q+5]=K+3,Q+=6,ea[T]=K,
 ea[T+1]=K+1,ea[T+2]=K,ea[T+3]=K+3,ea[T+4]=K+1,ea[T+5]=K+2,ea[T+6]=K+2,ea[T+7]=K+3,T+=8,K+=4)}if(Ea){m=0;for(o=Ea.length;m<o;m++)da[Q]=Ea[m].a,da[Q+1]=Ea[m].b,da[Q+2]=Ea[m].c,da[Q+3]=Ea[m].a,da[Q+4]=Ea[m].c,da[Q+5]=Ea[m].d,Q+=6}pa&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglVertexBuffer),h.bufferData(h.ARRAY_BUFFER,W,k));if(fa)for(I in fa)w=fa[I],w.__original.needsUpdate&&(h.bindBuffer(h.ARRAY_BUFFER,w.buffer),h.bufferData(h.ARRAY_BUFFER,w.array,k));if(Ya){C=0;for(H=ya.length;C<H;C++)h.bindBuffer(h.ARRAY_BUFFER,
 ea[T+1]=K+1,ea[T+2]=K,ea[T+3]=K+3,ea[T+4]=K+1,ea[T+5]=K+2,ea[T+6]=K+2,ea[T+7]=K+3,T+=8,K+=4)}if(Ea){m=0;for(o=Ea.length;m<o;m++)da[Q]=Ea[m].a,da[Q+1]=Ea[m].b,da[Q+2]=Ea[m].c,da[Q+3]=Ea[m].a,da[Q+4]=Ea[m].c,da[Q+5]=Ea[m].d,Q+=6}pa&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglVertexBuffer),h.bufferData(h.ARRAY_BUFFER,W,k));if(fa)for(I in fa)w=fa[I],w.__original.needsUpdate&&(h.bindBuffer(h.ARRAY_BUFFER,w.buffer),h.bufferData(h.ARRAY_BUFFER,w.array,k));if(Ya){C=0;for(H=ya.length;C<H;C++)h.bindBuffer(h.ARRAY_BUFFER,
 g.__webglMorphTargetsBuffers[C]),h.bufferData(h.ARRAY_BUFFER,ia[C],k)}Xa&&R>0&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglColorBuffer),h.bufferData(h.ARRAY_BUFFER,ja,k));za&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglNormalBuffer),h.bufferData(h.ARRAY_BUFFER,ga,k));Wa&&na.hasTangents&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglTangentBuffer),h.bufferData(h.ARRAY_BUFFER,S,k));ta&&O>0&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglUVBuffer),h.bufferData(h.ARRAY_BUFFER,aa,k));ta&&P>0&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglUV2Buffer),
 g.__webglMorphTargetsBuffers[C]),h.bufferData(h.ARRAY_BUFFER,ia[C],k)}Xa&&R>0&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglColorBuffer),h.bufferData(h.ARRAY_BUFFER,ja,k));za&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglNormalBuffer),h.bufferData(h.ARRAY_BUFFER,ga,k));Wa&&na.hasTangents&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglTangentBuffer),h.bufferData(h.ARRAY_BUFFER,S,k));ta&&O>0&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglUVBuffer),h.bufferData(h.ARRAY_BUFFER,aa,k));ta&&P>0&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglUV2Buffer),
 h.bufferData(h.ARRAY_BUFFER,ca,k));Ba&&(h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,g.__webglFaceBuffer),h.bufferData(h.ELEMENT_ARRAY_BUFFER,da,k),h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,g.__webglLineBuffer),h.bufferData(h.ELEMENT_ARRAY_BUFFER,ea,k));J>0&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglSkinVertexABuffer),h.bufferData(h.ARRAY_BUFFER,U,k),h.bindBuffer(h.ARRAY_BUFFER,g.__webglSkinVertexBBuffer),h.bufferData(h.ARRAY_BUFFER,V,k),h.bindBuffer(h.ARRAY_BUFFER,g.__webglSkinIndicesBuffer),h.bufferData(h.ARRAY_BUFFER,
 h.bufferData(h.ARRAY_BUFFER,ca,k));Ba&&(h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,g.__webglFaceBuffer),h.bufferData(h.ELEMENT_ARRAY_BUFFER,da,k),h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,g.__webglLineBuffer),h.bufferData(h.ELEMENT_ARRAY_BUFFER,ea,k));J>0&&(h.bindBuffer(h.ARRAY_BUFFER,g.__webglSkinVertexABuffer),h.bufferData(h.ARRAY_BUFFER,U,k),h.bindBuffer(h.ARRAY_BUFFER,g.__webglSkinVertexBBuffer),h.bufferData(h.ARRAY_BUFFER,V,k),h.bindBuffer(h.ARRAY_BUFFER,g.__webglSkinIndicesBuffer),h.bufferData(h.ARRAY_BUFFER,
 Z,k),h.bindBuffer(h.ARRAY_BUFFER,g.__webglSkinWeightsBuffer),h.bufferData(h.ARRAY_BUFFER,$,k));j.dynamic||(delete g.__inittedArrays,delete g.__colorArray,delete g.__normalArray,delete g.__tangentArray,delete g.__uvArray,delete g.__uv2Array,delete g.__faceArray,delete g.__vertexArray,delete g.__lineArray,delete g.__skinVertexAArray,delete g.__skinVertexBArray,delete g.__skinIndexArray,delete g.__skinWeightArray)}}e.__dirtyVertices=!1;e.__dirtyMorphTargets=!1;e.__dirtyElements=!1;e.__dirtyUvs=!1;e.__dirtyNormals=
 Z,k),h.bindBuffer(h.ARRAY_BUFFER,g.__webglSkinWeightsBuffer),h.bufferData(h.ARRAY_BUFFER,$,k));j.dynamic||(delete g.__inittedArrays,delete g.__colorArray,delete g.__normalArray,delete g.__tangentArray,delete g.__uvArray,delete g.__uv2Array,delete g.__faceArray,delete g.__vertexArray,delete g.__lineArray,delete g.__skinVertexAArray,delete g.__skinVertexBArray,delete g.__skinIndexArray,delete g.__skinWeightArray)}}e.__dirtyVertices=!1;e.__dirtyMorphTargets=!1;e.__dirtyElements=!1;e.__dirtyUvs=!1;e.__dirtyNormals=
-!1;e.__dirtyTangents=!1;e.__dirtyColors=!1;var ra;f=f.__materials;e=0;for(b=f.length;e<b;e++)if(d=f[e],d.attributes)for(ra in d.attributes)d.attributes[ra].needsUpdate=!1}else if(b instanceof THREE.Ribbon){e=b.geometry;if(e.__dirtyVertices||e.__dirtyColors){ra=e;b=h.DYNAMIC_DRAW;o=ra.vertices;f=ra.colors;z=o.length;g=f.length;x=ra.__vertexArray;j=ra.__colorArray;A=ra.__dirtyColors;if(ra.__dirtyVertices){for(k=0;k<z;k++)m=o[k].position,d=k*3,x[d]=m.x,x[d+1]=m.y,x[d+2]=m.z;h.bindBuffer(h.ARRAY_BUFFER,
-ra.__webglVertexBuffer);h.bufferData(h.ARRAY_BUFFER,x,b)}if(A){for(k=0;k<g;k++)color=f[k],d=k*3,j[d]=color.r,j[d+1]=color.g,j[d+2]=color.b;h.bindBuffer(h.ARRAY_BUFFER,ra.__webglColorBuffer);h.bufferData(h.ARRAY_BUFFER,j,b)}}e.__dirtyVertices=!1;e.__dirtyColors=!1}else if(b instanceof THREE.Line){e=b.geometry;if(e.__dirtyVertices||e.__dirtyColors){ra=e;b=h.DYNAMIC_DRAW;o=ra.vertices;f=ra.colors;z=o.length;g=f.length;x=ra.__vertexArray;j=ra.__colorArray;A=ra.__dirtyColors;if(ra.__dirtyVertices){for(k=
-0;k<z;k++)m=o[k].position,d=k*3,x[d]=m.x,x[d+1]=m.y,x[d+2]=m.z;h.bindBuffer(h.ARRAY_BUFFER,ra.__webglVertexBuffer);h.bufferData(h.ARRAY_BUFFER,x,b)}if(A){for(k=0;k<g;k++)color=f[k],d=k*3,j[d]=color.r,j[d+1]=color.g,j[d+2]=color.b;h.bindBuffer(h.ARRAY_BUFFER,ra.__webglColorBuffer);h.bufferData(h.ARRAY_BUFFER,j,b)}}e.__dirtyVertices=!1;e.__dirtyColors=!1}else if(b instanceof THREE.ParticleSystem)e=b.geometry,(e.__dirtyVertices||e.__dirtyColors||b.sortParticles)&&c(e,h.DYNAMIC_DRAW,b),e.__dirtyVertices=
-!1,e.__dirtyColors=!1}function F(b,d){var c;for(c=b.length-1;c>=0;c--)b[c].object==d&&b.splice(c,1)}function x(b){function d(b){var g=[];c=0;for(e=b.length;c<e;c++)b[c]==void 0?g.push("undefined"):g.push(b[c].id);return g.join("_")}var c,e,g,f,h,j,k,m,n={},o=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};g=0;for(f=b.faces.length;g<f;g++)h=b.faces[g],j=h.materials,k=d(j),n[k]==void 0&&(n[k]={hash:k,counter:0}),m=n[k].hash+"_"+n[k].counter,b.geometryGroups[m]==void 0&&(b.geometryGroups[m]=
+!1;e.__dirtyTangents=!1;e.__dirtyColors=!1;var ra;f=f.__materials;e=0;for(b=f.length;e<b;e++)if(d=f[e],d.attributes)for(ra in d.attributes)d.attributes[ra].needsUpdate=!1}else if(b instanceof THREE.Ribbon){e=b.geometry;if(e.__dirtyVertices||e.__dirtyColors){ra=e;b=h.DYNAMIC_DRAW;o=ra.vertices;f=ra.colors;z=o.length;g=f.length;A=ra.__vertexArray;j=ra.__colorArray;y=ra.__dirtyColors;if(ra.__dirtyVertices){for(k=0;k<z;k++)m=o[k].position,d=k*3,A[d]=m.x,A[d+1]=m.y,A[d+2]=m.z;h.bindBuffer(h.ARRAY_BUFFER,
+ra.__webglVertexBuffer);h.bufferData(h.ARRAY_BUFFER,A,b)}if(y){for(k=0;k<g;k++)color=f[k],d=k*3,j[d]=color.r,j[d+1]=color.g,j[d+2]=color.b;h.bindBuffer(h.ARRAY_BUFFER,ra.__webglColorBuffer);h.bufferData(h.ARRAY_BUFFER,j,b)}}e.__dirtyVertices=!1;e.__dirtyColors=!1}else if(b instanceof THREE.Line){e=b.geometry;if(e.__dirtyVertices||e.__dirtyColors){ra=e;b=h.DYNAMIC_DRAW;o=ra.vertices;f=ra.colors;z=o.length;g=f.length;A=ra.__vertexArray;j=ra.__colorArray;y=ra.__dirtyColors;if(ra.__dirtyVertices){for(k=
+0;k<z;k++)m=o[k].position,d=k*3,A[d]=m.x,A[d+1]=m.y,A[d+2]=m.z;h.bindBuffer(h.ARRAY_BUFFER,ra.__webglVertexBuffer);h.bufferData(h.ARRAY_BUFFER,A,b)}if(y){for(k=0;k<g;k++)color=f[k],d=k*3,j[d]=color.r,j[d+1]=color.g,j[d+2]=color.b;h.bindBuffer(h.ARRAY_BUFFER,ra.__webglColorBuffer);h.bufferData(h.ARRAY_BUFFER,j,b)}}e.__dirtyVertices=!1;e.__dirtyColors=!1}else if(b instanceof THREE.ParticleSystem)e=b.geometry,(e.__dirtyVertices||e.__dirtyColors||b.sortParticles)&&c(e,h.DYNAMIC_DRAW,b),e.__dirtyVertices=
+!1,e.__dirtyColors=!1}function F(b,d){var c;for(c=b.length-1;c>=0;c--)b[c].object==d&&b.splice(c,1)}function y(b){function d(b){var g=[];c=0;for(e=b.length;c<e;c++)b[c]==void 0?g.push("undefined"):g.push(b[c].id);return g.join("_")}var c,e,g,f,h,j,k,m,n={},o=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};g=0;for(f=b.faces.length;g<f;g++)h=b.faces[g],j=h.materials,k=d(j),n[k]==void 0&&(n[k]={hash:k,counter:0}),m=n[k].hash+"_"+n[k].counter,b.geometryGroups[m]==void 0&&(b.geometryGroups[m]=
 {faces:[],materials:j,vertices:0,numMorphTargets:o}),h=h instanceof THREE.Face3?3:4,b.geometryGroups[m].vertices+h>65535&&(n[k].counter+=1,m=n[k].hash+"_"+n[k].counter,b.geometryGroups[m]==void 0&&(b.geometryGroups[m]={faces:[],materials:j,vertices:0,numMorphTargets:o})),b.geometryGroups[m].faces.push(g),b.geometryGroups[m].vertices+=h}function D(b,d,c){b.push({buffer:d,object:c,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function G(b){if(b!=ga){switch(b){case THREE.AdditiveBlending:h.blendEquation(h.FUNC_ADD);
 {faces:[],materials:j,vertices:0,numMorphTargets:o}),h=h instanceof THREE.Face3?3:4,b.geometryGroups[m].vertices+h>65535&&(n[k].counter+=1,m=n[k].hash+"_"+n[k].counter,b.geometryGroups[m]==void 0&&(b.geometryGroups[m]={faces:[],materials:j,vertices:0,numMorphTargets:o})),b.geometryGroups[m].faces.push(g),b.geometryGroups[m].vertices+=h}function D(b,d,c){b.push({buffer:d,object:c,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function G(b){if(b!=ga){switch(b){case THREE.AdditiveBlending:h.blendEquation(h.FUNC_ADD);
-h.blendFunc(h.SRC_ALPHA,h.ONE);break;case THREE.SubtractiveBlending:h.blendEquation(h.FUNC_ADD);h.blendFunc(h.ZERO,h.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:h.blendEquation(h.FUNC_ADD);h.blendFunc(h.ZERO,h.SRC_COLOR);break;default:h.blendEquationSeparate(h.FUNC_ADD,h.FUNC_ADD),h.blendFuncSeparate(h.SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA)}ga=b}}function B(b,d,c){(c.width&c.width-1)==0&&(c.height&c.height-1)==0?(h.texParameteri(b,h.TEXTURE_WRAP_S,M(d.wrapS)),h.texParameteri(b,
-h.TEXTURE_WRAP_T,M(d.wrapT)),h.texParameteri(b,h.TEXTURE_MAG_FILTER,M(d.magFilter)),h.texParameteri(b,h.TEXTURE_MIN_FILTER,M(d.minFilter)),h.generateMipmap(b)):(h.texParameteri(b,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(b,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.texParameteri(b,h.TEXTURE_MAG_FILTER,E(d.magFilter)),h.texParameteri(b,h.TEXTURE_MIN_FILTER,E(d.minFilter)))}function Q(b,d){if(b.needsUpdate)b.__webglInit?(h.bindTexture(h.TEXTURE_2D,b.__webglTexture),h.texSubImage2D(h.TEXTURE_2D,0,0,
+h.blendFunc(h.SRC_ALPHA,h.ONE);break;case THREE.SubtractiveBlending:h.blendEquation(h.FUNC_ADD);h.blendFunc(h.ZERO,h.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:h.blendEquation(h.FUNC_ADD);h.blendFunc(h.ZERO,h.SRC_COLOR);break;default:h.blendEquationSeparate(h.FUNC_ADD,h.FUNC_ADD),h.blendFuncSeparate(h.SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA)}ga=b}}function B(b,d,c){(c.width&c.width-1)==0&&(c.height&c.height-1)==0?(h.texParameteri(b,h.TEXTURE_WRAP_S,N(d.wrapS)),h.texParameteri(b,
+h.TEXTURE_WRAP_T,N(d.wrapT)),h.texParameteri(b,h.TEXTURE_MAG_FILTER,N(d.magFilter)),h.texParameteri(b,h.TEXTURE_MIN_FILTER,N(d.minFilter)),h.generateMipmap(b)):(h.texParameteri(b,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(b,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.texParameteri(b,h.TEXTURE_MAG_FILTER,E(d.magFilter)),h.texParameteri(b,h.TEXTURE_MIN_FILTER,E(d.minFilter)))}function Q(b,d){if(b.needsUpdate)b.__webglInit?(h.bindTexture(h.TEXTURE_2D,b.__webglTexture),h.texSubImage2D(h.TEXTURE_2D,0,0,
 0,h.RGBA,h.UNSIGNED_BYTE,b.image)):(b.__webglTexture=h.createTexture(),h.bindTexture(h.TEXTURE_2D,b.__webglTexture),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,b.image),b.__webglInit=!0),B(h.TEXTURE_2D,b,b.image),h.bindTexture(h.TEXTURE_2D,null),b.needsUpdate=!1;h.activeTexture(h.TEXTURE0+d);h.bindTexture(h.TEXTURE_2D,b.__webglTexture)}function K(b){if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglFramebuffer=
 0,h.RGBA,h.UNSIGNED_BYTE,b.image)):(b.__webglTexture=h.createTexture(),h.bindTexture(h.TEXTURE_2D,b.__webglTexture),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,b.image),b.__webglInit=!0),B(h.TEXTURE_2D,b,b.image),h.bindTexture(h.TEXTURE_2D,null),b.needsUpdate=!1;h.activeTexture(h.TEXTURE0+d);h.bindTexture(h.TEXTURE_2D,b.__webglTexture)}function K(b){if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglFramebuffer=
-h.createFramebuffer();b.__webglRenderbuffer=h.createRenderbuffer();b.__webglTexture=h.createTexture();h.bindTexture(h.TEXTURE_2D,b.__webglTexture);h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,M(b.wrapS));h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,M(b.wrapT));h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,M(b.magFilter));h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,M(b.minFilter));h.texImage2D(h.TEXTURE_2D,0,M(b.format),b.width,b.height,0,M(b.format),M(b.type),null);h.bindRenderbuffer(h.RENDERBUFFER,
+h.createFramebuffer();b.__webglRenderbuffer=h.createRenderbuffer();b.__webglTexture=h.createTexture();h.bindTexture(h.TEXTURE_2D,b.__webglTexture);h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,N(b.wrapS));h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,N(b.wrapT));h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,N(b.magFilter));h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,N(b.minFilter));h.texImage2D(h.TEXTURE_2D,0,N(b.format),b.width,b.height,0,N(b.format),N(b.type),null);h.bindRenderbuffer(h.RENDERBUFFER,
 b.__webglRenderbuffer);h.bindFramebuffer(h.FRAMEBUFFER,b.__webglFramebuffer);h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,b.__webglTexture,0);b.depthBuffer&&!b.stencilBuffer?(h.renderbufferStorage(h.RENDERBUFFER,h.DEPTH_COMPONENT16,b.width,b.height),h.framebufferRenderbuffer(h.FRAMEBUFFER,h.DEPTH_ATTACHMENT,h.RENDERBUFFER,b.__webglRenderbuffer)):b.depthBuffer&&b.stencilBuffer?(h.renderbufferStorage(h.RENDERBUFFER,h.DEPTH_STENCIL,b.width,b.height),h.framebufferRenderbuffer(h.FRAMEBUFFER,
 b.__webglRenderbuffer);h.bindFramebuffer(h.FRAMEBUFFER,b.__webglFramebuffer);h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,b.__webglTexture,0);b.depthBuffer&&!b.stencilBuffer?(h.renderbufferStorage(h.RENDERBUFFER,h.DEPTH_COMPONENT16,b.width,b.height),h.framebufferRenderbuffer(h.FRAMEBUFFER,h.DEPTH_ATTACHMENT,h.RENDERBUFFER,b.__webglRenderbuffer)):b.depthBuffer&&b.stencilBuffer?(h.renderbufferStorage(h.RENDERBUFFER,h.DEPTH_STENCIL,b.width,b.height),h.framebufferRenderbuffer(h.FRAMEBUFFER,
 h.DEPTH_STENCIL_ATTACHMENT,h.RENDERBUFFER,b.__webglRenderbuffer)):h.renderbufferStorage(h.RENDERBUFFER,h.RGBA4,b.width,b.height);h.bindTexture(h.TEXTURE_2D,null);h.bindRenderbuffer(h.RENDERBUFFER,null);h.bindFramebuffer(h.FRAMEBUFFER,null)}var d,c;b?(d=b.__webglFramebuffer,c=b.width,b=b.height):(d=null,c=ka,b=fa);d!=O&&(h.bindFramebuffer(h.FRAMEBUFFER,d),h.viewport(da,ea,c,b),O=d)}function L(b,d){var c;b=="fragment"?c=h.createShader(h.FRAGMENT_SHADER):b=="vertex"&&(c=h.createShader(h.VERTEX_SHADER));
 h.DEPTH_STENCIL_ATTACHMENT,h.RENDERBUFFER,b.__webglRenderbuffer)):h.renderbufferStorage(h.RENDERBUFFER,h.RGBA4,b.width,b.height);h.bindTexture(h.TEXTURE_2D,null);h.bindRenderbuffer(h.RENDERBUFFER,null);h.bindFramebuffer(h.FRAMEBUFFER,null)}var d,c;b?(d=b.__webglFramebuffer,c=b.width,b=b.height):(d=null,c=ka,b=fa);d!=O&&(h.bindFramebuffer(h.FRAMEBUFFER,d),h.viewport(da,ea,c,b),O=d)}function L(b,d){var c;b=="fragment"?c=h.createShader(h.FRAGMENT_SHADER):b=="vertex"&&(c=h.createShader(h.VERTEX_SHADER));
-h.shaderSource(c,d);h.compileShader(c);if(!h.getShaderParameter(c,h.COMPILE_STATUS))return console.error(h.getShaderInfoLog(c)),console.error(d),null;return c}function E(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return h.NEAREST;default:return h.LINEAR}}function M(b){switch(b){case THREE.RepeatWrapping:return h.REPEAT;case THREE.ClampToEdgeWrapping:return h.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return h.MIRRORED_REPEAT;
+h.shaderSource(c,d);h.compileShader(c);if(!h.getShaderParameter(c,h.COMPILE_STATUS))return console.error(h.getShaderInfoLog(c)),console.error(d),null;return c}function E(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return h.NEAREST;default:return h.LINEAR}}function N(b){switch(b){case THREE.RepeatWrapping:return h.REPEAT;case THREE.ClampToEdgeWrapping:return h.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return h.MIRRORED_REPEAT;
 case THREE.NearestFilter:return h.NEAREST;case THREE.NearestMipMapNearestFilter:return h.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return h.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return h.LINEAR;case THREE.LinearMipMapNearestFilter:return h.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return h.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return h.BYTE;case THREE.UnsignedByteType:return h.UNSIGNED_BYTE;case THREE.ShortType:return h.SHORT;case THREE.UnsignedShortType:return h.UNSIGNED_SHORT;
 case THREE.NearestFilter:return h.NEAREST;case THREE.NearestMipMapNearestFilter:return h.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return h.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return h.LINEAR;case THREE.LinearMipMapNearestFilter:return h.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return h.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return h.BYTE;case THREE.UnsignedByteType:return h.UNSIGNED_BYTE;case THREE.ShortType:return h.SHORT;case THREE.UnsignedShortType:return h.UNSIGNED_SHORT;
 case THREE.IntType:return h.INT;case THREE.UnsignedShortType:return h.UNSIGNED_INT;case THREE.FloatType:return h.FLOAT;case THREE.AlphaFormat:return h.ALPHA;case THREE.RGBFormat:return h.RGB;case THREE.RGBAFormat:return h.RGBA;case THREE.LuminanceFormat:return h.LUMINANCE;case THREE.LuminanceAlphaFormat:return h.LUMINANCE_ALPHA}return 0}var U=this,h,R=[],S=null,O=null,aa=!0,V=null,W=null,ga=null,Y=null,da=0,ea=0,ka=0,fa=0,I=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,
 case THREE.IntType:return h.INT;case THREE.UnsignedShortType:return h.UNSIGNED_INT;case THREE.FloatType:return h.FLOAT;case THREE.AlphaFormat:return h.ALPHA;case THREE.RGBFormat:return h.RGB;case THREE.RGBAFormat:return h.RGBA;case THREE.LuminanceFormat:return h.LUMINANCE;case THREE.LuminanceAlphaFormat:return h.LUMINANCE_ALPHA}return 0}var U=this,h,R=[],S=null,O=null,aa=!0,V=null,W=null,ga=null,Y=null,da=0,ea=0,ka=0,fa=0,I=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,
 new THREE.Vector4,new THREE.Vector4],T=new THREE.Matrix4,Z=new Float32Array(16),$=new Float32Array(16),ia=new THREE.Vector4,X={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},H=b.canvas!==void 0?b.canvas:document.createElement("canvas"),ha=b.stencil!==void 0?b.stencil:!0,ma=b.antialias!==void 0?b.antialias:!1,ja=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),na=b.clearAlpha!==void 0?b.clearAlpha:0;
 new THREE.Vector4,new THREE.Vector4],T=new THREE.Matrix4,Z=new Float32Array(16),$=new Float32Array(16),ia=new THREE.Vector4,X={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},H=b.canvas!==void 0?b.canvas:document.createElement("canvas"),ha=b.stencil!==void 0?b.stencil:!0,ma=b.antialias!==void 0?b.antialias:!1,ja=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),na=b.clearAlpha!==void 0?b.clearAlpha:0;
@@ -318,23 +318,23 @@ h.attachShader(t,L("fragment",f+m));h.attachShader(t,L("vertex",o+n));h.linkProg
 u.length;k<m;k++)n=u[k],t.uniforms[n]=h.getUniformLocation(t,n);m=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(u=0;u<c.maxMorphTargets;u++)m.push("morphTarget"+u);for(p in d)m.push(p);p=m;u=0;for(d=p.length;u<d;u++)c=p[u],t.attributes[c]=h.getAttribLocation(t,c);R.push({program:t,code:j});p=t}b.program=p;p=b.program.attributes;p.position>=0&&h.enableVertexAttribArray(p.position);p.color>=0&&h.enableVertexAttribArray(p.color);p.normal>=
 u.length;k<m;k++)n=u[k],t.uniforms[n]=h.getUniformLocation(t,n);m=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(u=0;u<c.maxMorphTargets;u++)m.push("morphTarget"+u);for(p in d)m.push(p);p=m;u=0;for(d=p.length;u<d;u++)c=p[u],t.attributes[c]=h.getAttribLocation(t,c);R.push({program:t,code:j});p=t}b.program=p;p=b.program.attributes;p.position>=0&&h.enableVertexAttribArray(p.position);p.color>=0&&h.enableVertexAttribArray(p.color);p.normal>=
 0&&h.enableVertexAttribArray(p.normal);p.tangent>=0&&h.enableVertexAttribArray(p.tangent);b.skinning&&p.skinVertexA>=0&&p.skinVertexB>=0&&p.skinIndex>=0&&p.skinWeight>=0&&(h.enableVertexAttribArray(p.skinVertexA),h.enableVertexAttribArray(p.skinVertexB),h.enableVertexAttribArray(p.skinIndex),h.enableVertexAttribArray(p.skinWeight));if(b.attributes)for(g in b.attributes)p[g]!==void 0&&p[g]>=0&&h.enableVertexAttribArray(p[g]);if(b.morphTargets){b.numSupportedMorphTargets=0;p.morphTarget0>=0&&(h.enableVertexAttribArray(p.morphTarget0),
 0&&h.enableVertexAttribArray(p.normal);p.tangent>=0&&h.enableVertexAttribArray(p.tangent);b.skinning&&p.skinVertexA>=0&&p.skinVertexB>=0&&p.skinIndex>=0&&p.skinWeight>=0&&(h.enableVertexAttribArray(p.skinVertexA),h.enableVertexAttribArray(p.skinVertexB),h.enableVertexAttribArray(p.skinIndex),h.enableVertexAttribArray(p.skinWeight));if(b.attributes)for(g in b.attributes)p[g]!==void 0&&p[g]>=0&&h.enableVertexAttribArray(p[g]);if(b.morphTargets){b.numSupportedMorphTargets=0;p.morphTarget0>=0&&(h.enableVertexAttribArray(p.morphTarget0),
 b.numSupportedMorphTargets++);p.morphTarget1>=0&&(h.enableVertexAttribArray(p.morphTarget1),b.numSupportedMorphTargets++);p.morphTarget2>=0&&(h.enableVertexAttribArray(p.morphTarget2),b.numSupportedMorphTargets++);p.morphTarget3>=0&&(h.enableVertexAttribArray(p.morphTarget3),b.numSupportedMorphTargets++);p.morphTarget4>=0&&(h.enableVertexAttribArray(p.morphTarget4),b.numSupportedMorphTargets++);p.morphTarget5>=0&&(h.enableVertexAttribArray(p.morphTarget5),b.numSupportedMorphTargets++);p.morphTarget6>=
 b.numSupportedMorphTargets++);p.morphTarget1>=0&&(h.enableVertexAttribArray(p.morphTarget1),b.numSupportedMorphTargets++);p.morphTarget2>=0&&(h.enableVertexAttribArray(p.morphTarget2),b.numSupportedMorphTargets++);p.morphTarget3>=0&&(h.enableVertexAttribArray(p.morphTarget3),b.numSupportedMorphTargets++);p.morphTarget4>=0&&(h.enableVertexAttribArray(p.morphTarget4),b.numSupportedMorphTargets++);p.morphTarget5>=0&&(h.enableVertexAttribArray(p.morphTarget5),b.numSupportedMorphTargets++);p.morphTarget6>=
-0&&(h.enableVertexAttribArray(p.morphTarget6),b.numSupportedMorphTargets++);p.morphTarget7>=0&&(h.enableVertexAttribArray(p.morphTarget7),b.numSupportedMorphTargets++);e.__webglMorphTargetInfluences=new Float32Array(this.maxMorphTargets);b=0;for(g=this.maxMorphTargets;b<g;b++)e.__webglMorphTargetInfluences[b]=0}};this.render=function(b,c,o,y){var x,H,B,D,X,F,E,L,I=b.lights,M=b.fog;U.data.vertices=0;U.data.faces=0;U.data.drawCalls=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray($);
-c.projectionMatrix.flattenToArray(Z);T.multiply(c.projectionMatrix,c.matrixWorldInverse);k(T);this.initWebGLObjects(b);K(o);(this.autoClear||y)&&this.clear();X=b.__webglObjects.length;for(y=0;y<X;y++)if(x=b.__webglObjects[y],E=x.object,E.visible)if(!(E instanceof THREE.Mesh)||m(E)){if(E.matrixWorld.flattenToArray(E._objectMatrixArray),A(E,c),p(x),x.render=!0,this.sortObjects)ia.copy(E.position),T.multiplyVector3(ia),x.z=ia.z}else x.render=!1;else x.render=!1;this.sortObjects&&b.__webglObjects.sort(t);
-F=b.__webglObjectsImmediate.length;for(y=0;y<F;y++)x=b.__webglObjectsImmediate[y],E=x.object,E.visible&&(E.matrixAutoUpdate&&E.matrixWorld.flattenToArray(E._objectMatrixArray),A(E,c),n(x));G(THREE.NormalBlending);for(y=0;y<X;y++)if(x=b.__webglObjects[y],x.render){E=x.object;L=x.buffer;B=x.opaque;g(E);for(x=0;x<B.count;x++)D=B.list[x],j(D.depthTest),e(c,I,M,D,L,E)}for(y=0;y<F;y++)if(x=b.__webglObjectsImmediate[y],E=x.object,E.visible){B=x.opaque;g(E);for(x=0;x<B.count;x++)D=B.list[x],j(D.depthTest),
-H=d(c,I,M,D,E),E.render(function(b){f(b,H,D.shading)})}for(y=0;y<X;y++)if(x=b.__webglObjects[y],x.render){E=x.object;L=x.buffer;B=x.transparent;g(E);for(x=0;x<B.count;x++)D=B.list[x],G(D.blending),j(D.depthTest),e(c,I,M,D,L,E)}for(y=0;y<F;y++)if(x=b.__webglObjectsImmediate[y],E=x.object,E.visible){B=x.transparent;g(E);for(x=0;x<B.count;x++)D=B.list[x],G(D.blending),j(D.depthTest),H=d(c,I,M,D,E),E.render(function(b){f(b,H,D.shading)})}b.__webglSprites.length&&v(b,c);ha&&b.__webglShadowVolumes.length&&
+0&&(h.enableVertexAttribArray(p.morphTarget6),b.numSupportedMorphTargets++);p.morphTarget7>=0&&(h.enableVertexAttribArray(p.morphTarget7),b.numSupportedMorphTargets++);e.__webglMorphTargetInfluences=new Float32Array(this.maxMorphTargets);b=0;for(g=this.maxMorphTargets;b<g;b++)e.__webglMorphTargetInfluences[b]=0}};this.render=function(b,c,o,x){var y,H,D,B,X,F,E,L,I=b.lights,N=b.fog;U.data.vertices=0;U.data.faces=0;U.data.drawCalls=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray($);
+c.projectionMatrix.flattenToArray(Z);T.multiply(c.projectionMatrix,c.matrixWorldInverse);k(T);this.initWebGLObjects(b);K(o);(this.autoClear||x)&&this.clear();X=b.__webglObjects.length;for(x=0;x<X;x++)if(y=b.__webglObjects[x],E=y.object,E.visible)if(!(E instanceof THREE.Mesh)||m(E)){if(E.matrixWorld.flattenToArray(E._objectMatrixArray),A(E,c),p(y),y.render=!0,this.sortObjects)ia.copy(E.position),T.multiplyVector3(ia),y.z=ia.z}else y.render=!1;else y.render=!1;this.sortObjects&&b.__webglObjects.sort(t);
+F=b.__webglObjectsImmediate.length;for(x=0;x<F;x++)y=b.__webglObjectsImmediate[x],E=y.object,E.visible&&(E.matrixAutoUpdate&&E.matrixWorld.flattenToArray(E._objectMatrixArray),A(E,c),n(y));G(THREE.NormalBlending);for(x=0;x<X;x++)if(y=b.__webglObjects[x],y.render){E=y.object;L=y.buffer;D=y.opaque;g(E);for(y=0;y<D.count;y++)B=D.list[y],j(B.depthTest),e(c,I,N,B,L,E)}for(x=0;x<F;x++)if(y=b.__webglObjectsImmediate[x],E=y.object,E.visible){D=y.opaque;g(E);for(y=0;y<D.count;y++)B=D.list[y],j(B.depthTest),
+H=d(c,I,N,B,E),E.render(function(b){f(b,H,B.shading)})}for(x=0;x<X;x++)if(y=b.__webglObjects[x],y.render){E=y.object;L=y.buffer;D=y.transparent;g(E);for(y=0;y<D.count;y++)B=D.list[y],G(B.blending),j(B.depthTest),e(c,I,N,B,L,E)}for(x=0;x<F;x++)if(y=b.__webglObjectsImmediate[x],E=y.object,E.visible){D=y.transparent;g(E);for(y=0;y<D.count;y++)B=D.list[y],G(B.blending),j(B.depthTest),H=d(c,I,N,B,E),E.render(function(b){f(b,H,B.shading)})}b.__webglSprites.length&&v(b,c);ha&&b.__webglShadowVolumes.length&&
 b.lights.length&&u(b);b.__webglLensFlares.length&&z(b,c);o&&o.minFilter!==THREE.NearestFilter&&o.minFilter!==THREE.LinearFilter&&(h.bindTexture(h.TEXTURE_2D,o.__webglTexture),h.generateMipmap(h.TEXTURE_2D),h.bindTexture(h.TEXTURE_2D,null))};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglShadowVolumes=[],b.__webglLensFlares=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var c=b.__objectsAdded[0],d=b,e=void 0,g=void 0,f=void 0;
 b.lights.length&&u(b);b.__webglLensFlares.length&&z(b,c);o&&o.minFilter!==THREE.NearestFilter&&o.minFilter!==THREE.LinearFilter&&(h.bindTexture(h.TEXTURE_2D,o.__webglTexture),h.generateMipmap(h.TEXTURE_2D),h.bindTexture(h.TEXTURE_2D,null))};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglShadowVolumes=[],b.__webglLensFlares=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var c=b.__objectsAdded[0],d=b,e=void 0,g=void 0,f=void 0;
-if(c._modelViewMatrix==void 0)c._modelViewMatrix=new THREE.Matrix4,c._normalMatrixArray=new Float32Array(9),c._modelViewMatrixArray=new Float32Array(16),c._objectMatrixArray=new Float32Array(16),c.matrixWorld.flattenToArray(c._objectMatrixArray);if(c instanceof THREE.Mesh)for(e in g=c.geometry,g.geometryGroups==void 0&&x(g),g.geometryGroups){f=g.geometryGroups[e];if(!f.__webglVertexBuffer){var j=f;j.__webglVertexBuffer=h.createBuffer();j.__webglNormalBuffer=h.createBuffer();j.__webglTangentBuffer=
+if(c._modelViewMatrix==void 0)c._modelViewMatrix=new THREE.Matrix4,c._normalMatrixArray=new Float32Array(9),c._modelViewMatrixArray=new Float32Array(16),c._objectMatrixArray=new Float32Array(16),c.matrixWorld.flattenToArray(c._objectMatrixArray);if(c instanceof THREE.Mesh)for(e in g=c.geometry,g.geometryGroups==void 0&&y(g),g.geometryGroups){f=g.geometryGroups[e];if(!f.__webglVertexBuffer){var j=f;j.__webglVertexBuffer=h.createBuffer();j.__webglNormalBuffer=h.createBuffer();j.__webglTangentBuffer=
 h.createBuffer();j.__webglColorBuffer=h.createBuffer();j.__webglUVBuffer=h.createBuffer();j.__webglUV2Buffer=h.createBuffer();j.__webglSkinVertexABuffer=h.createBuffer();j.__webglSkinVertexBBuffer=h.createBuffer();j.__webglSkinIndicesBuffer=h.createBuffer();j.__webglSkinWeightsBuffer=h.createBuffer();j.__webglFaceBuffer=h.createBuffer();j.__webglLineBuffer=h.createBuffer();if(j.numMorphTargets){var k=void 0,m=void 0;j.__webglMorphTargetsBuffers=[];k=0;for(m=j.numMorphTargets;k<m;k++)j.__webglMorphTargetsBuffers.push(h.createBuffer())}for(var j=
 h.createBuffer();j.__webglColorBuffer=h.createBuffer();j.__webglUVBuffer=h.createBuffer();j.__webglUV2Buffer=h.createBuffer();j.__webglSkinVertexABuffer=h.createBuffer();j.__webglSkinVertexBBuffer=h.createBuffer();j.__webglSkinIndicesBuffer=h.createBuffer();j.__webglSkinWeightsBuffer=h.createBuffer();j.__webglFaceBuffer=h.createBuffer();j.__webglLineBuffer=h.createBuffer();if(j.numMorphTargets){var k=void 0,m=void 0;j.__webglMorphTargetsBuffers=[];k=0;for(m=j.numMorphTargets;k<m;k++)j.__webglMorphTargetsBuffers.push(h.createBuffer())}for(var j=
-f,k=c,n=void 0,o=void 0,p=void 0,t=p=void 0,u=void 0,v=void 0,z=v=m=0,A=p=o=void 0,H=A=o=n=void 0,p=void 0,t=k.geometry,u=t.faces,A=j.faces,n=0,o=A.length;n<o;n++)p=A[n],p=u[p],p instanceof THREE.Face3?(m+=3,v+=1,z+=3):p instanceof THREE.Face4&&(m+=4,v+=2,z+=4);for(var n=j,o=k,B=A=u=void 0,X=void 0,B=void 0,p=[],u=0,A=o.materials.length;u<A;u++)if(B=o.materials[u],B instanceof THREE.MeshFaceMaterial){B=0;for(l=n.materials.length;B<l;B++)(X=n.materials[B])&&p.push(X)}else(X=B)&&p.push(X);n=p;j.__materials=
-n;a:{u=o=void 0;A=n.length;for(o=0;o<A;o++)if(u=n[o],u.map||u.lightMap||u instanceof THREE.MeshShaderMaterial){o=!0;break a}o=!1}a:{A=u=void 0;p=n.length;for(u=0;u<p;u++)if(A=n[u],!(A instanceof THREE.MeshBasicMaterial&&!A.envMap||A instanceof THREE.MeshDepthMaterial)){A=A&&A.shading!=void 0&&A.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}A=!1}a:{p=u=void 0;B=n.length;for(u=0;u<B;u++)if(p=n[u],p.vertexColors){p=p.vertexColors;break a}p=!1}j.__vertexArray=new Float32Array(m*
+f,k=c,n=void 0,o=void 0,p=void 0,t=p=void 0,u=void 0,v=void 0,z=v=m=0,A=p=o=void 0,B=A=o=n=void 0,p=void 0,t=k.geometry,u=t.faces,A=j.faces,n=0,o=A.length;n<o;n++)p=A[n],p=u[p],p instanceof THREE.Face3?(m+=3,v+=1,z+=3):p instanceof THREE.Face4&&(m+=4,v+=2,z+=4);for(var n=j,o=k,H=A=u=void 0,X=void 0,H=void 0,p=[],u=0,A=o.materials.length;u<A;u++)if(H=o.materials[u],H instanceof THREE.MeshFaceMaterial){H=0;for(l=n.materials.length;H<l;H++)(X=n.materials[H])&&p.push(X)}else(X=H)&&p.push(X);n=p;j.__materials=
+n;a:{u=o=void 0;A=n.length;for(o=0;o<A;o++)if(u=n[o],u.map||u.lightMap||u instanceof THREE.MeshShaderMaterial){o=!0;break a}o=!1}a:{A=u=void 0;p=n.length;for(u=0;u<p;u++)if(A=n[u],!(A instanceof THREE.MeshBasicMaterial&&!A.envMap||A instanceof THREE.MeshDepthMaterial)){A=A&&A.shading!=void 0&&A.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}A=!1}a:{p=u=void 0;H=n.length;for(u=0;u<H;u++)if(p=n[u],p.vertexColors){p=p.vertexColors;break a}p=!1}j.__vertexArray=new Float32Array(m*
 3);if(A)j.__normalArray=new Float32Array(m*3);if(t.hasTangents)j.__tangentArray=new Float32Array(m*4);if(p)j.__colorArray=new Float32Array(m*3);if(o){if(t.faceUvs.length>0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(m*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(m*2)}if(k.geometry.skinWeights.length&&k.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(m*4),j.__skinVertexBArray=new Float32Array(m*4),j.__skinIndexArray=new Float32Array(m*
 3);if(A)j.__normalArray=new Float32Array(m*3);if(t.hasTangents)j.__tangentArray=new Float32Array(m*4);if(p)j.__colorArray=new Float32Array(m*3);if(o){if(t.faceUvs.length>0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(m*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(m*2)}if(k.geometry.skinWeights.length&&k.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(m*4),j.__skinVertexBArray=new Float32Array(m*4),j.__skinIndexArray=new Float32Array(m*
 4),j.__skinWeightArray=new Float32Array(m*4);j.__faceArray=new Uint16Array(v*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0));j.__lineArray=new Uint16Array(z*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(u=j.numMorphTargets;t<u;t++)j.__morphTargetsArrays.push(new Float32Array(m*3))}j.__needsSmoothNormals=A==THREE.SmoothShading;j.__uvType=o;j.__vertexColorType=p;j.__normalType=A;j.__webglFaceCount=v*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0);j.__webglLineCount=z*
 4),j.__skinWeightArray=new Float32Array(m*4);j.__faceArray=new Uint16Array(v*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0));j.__lineArray=new Uint16Array(z*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(u=j.numMorphTargets;t<u;t++)j.__morphTargetsArrays.push(new Float32Array(m*3))}j.__needsSmoothNormals=A==THREE.SmoothShading;j.__uvType=o;j.__vertexColorType=p;j.__normalType=A;j.__webglFaceCount=v*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0);j.__webglLineCount=z*
-2;t=0;for(u=n.length;t<u;t++)if(o=n[t],o.attributes)for(a in j.__webglCustomAttributes={},o.attributes){p=o.attributes[a];A={};for(H in p)A[H]=p[H];if(!A.__webglInitialized||A.createUniqueBuffers)A.__webglInitialized=!0,v=1,A.type==="v2"?v=2:A.type==="v3"?v=3:A.type==="v4"?v=4:A.type==="c"&&(v=3),A.size=v,A.array=new Float32Array(m*v),A.buffer=h.createBuffer(),A.buffer.belongsToAttribute=a,p.needsUpdate=!0,A.__original=p;j.__webglCustomAttributes[a]=A}j.__inittedArrays=!0;g.__dirtyVertices=!0;g.__dirtyMorphTargets=
+2;t=0;for(u=n.length;t<u;t++)if(o=n[t],o.attributes)for(a in j.__webglCustomAttributes={},o.attributes){p=o.attributes[a];A={};for(B in p)A[B]=p[B];if(!A.__webglInitialized||A.createUniqueBuffers)A.__webglInitialized=!0,v=1,A.type==="v2"?v=2:A.type==="v3"?v=3:A.type==="v4"?v=4:A.type==="c"&&(v=3),A.size=v,A.array=new Float32Array(m*v),A.buffer=h.createBuffer(),A.buffer.belongsToAttribute=a,p.needsUpdate=!0,A.__original=p;j.__webglCustomAttributes[a]=A}j.__inittedArrays=!0;g.__dirtyVertices=!0;g.__dirtyMorphTargets=
 !0;g.__dirtyElements=!0;g.__dirtyUvs=!0;g.__dirtyNormals=!0;g.__dirtyTangents=!0;g.__dirtyColors=!0}c instanceof THREE.ShadowVolume?D(d.__webglShadowVolumes,f,c):D(d.__webglObjects,f,c)}else if(c instanceof THREE.LensFlare)D(d.__webglLensFlares,void 0,c);else if(c instanceof THREE.Ribbon){g=c.geometry;if(!g.__webglVertexBuffer)e=g,e.__webglVertexBuffer=h.createBuffer(),e.__webglColorBuffer=h.createBuffer(),e=g,f=e.vertices.length,e.__vertexArray=new Float32Array(f*3),e.__colorArray=new Float32Array(f*
 !0;g.__dirtyElements=!0;g.__dirtyUvs=!0;g.__dirtyNormals=!0;g.__dirtyTangents=!0;g.__dirtyColors=!0}c instanceof THREE.ShadowVolume?D(d.__webglShadowVolumes,f,c):D(d.__webglObjects,f,c)}else if(c instanceof THREE.LensFlare)D(d.__webglLensFlares,void 0,c);else if(c instanceof THREE.Ribbon){g=c.geometry;if(!g.__webglVertexBuffer)e=g,e.__webglVertexBuffer=h.createBuffer(),e.__webglColorBuffer=h.createBuffer(),e=g,f=e.vertices.length,e.__vertexArray=new Float32Array(f*3),e.__colorArray=new Float32Array(f*
 3),e.__webglVertexCount=f,g.__dirtyVertices=!0,g.__dirtyColors=!0;D(d.__webglObjects,g,c)}else if(c instanceof THREE.Line){g=c.geometry;if(!g.__webglVertexBuffer)e=g,e.__webglVertexBuffer=h.createBuffer(),e.__webglColorBuffer=h.createBuffer(),e=g,f=e.vertices.length,e.__vertexArray=new Float32Array(f*3),e.__colorArray=new Float32Array(f*3),e.__webglLineCount=f,g.__dirtyVertices=!0,g.__dirtyColors=!0;D(d.__webglObjects,g,c)}else if(c instanceof THREE.ParticleSystem){g=c.geometry;if(!g.__webglVertexBuffer)e=
 3),e.__webglVertexCount=f,g.__dirtyVertices=!0,g.__dirtyColors=!0;D(d.__webglObjects,g,c)}else if(c instanceof THREE.Line){g=c.geometry;if(!g.__webglVertexBuffer)e=g,e.__webglVertexBuffer=h.createBuffer(),e.__webglColorBuffer=h.createBuffer(),e=g,f=e.vertices.length,e.__vertexArray=new Float32Array(f*3),e.__colorArray=new Float32Array(f*3),e.__webglLineCount=f,g.__dirtyVertices=!0,g.__dirtyColors=!0;D(d.__webglObjects,g,c)}else if(c instanceof THREE.ParticleSystem){g=c.geometry;if(!g.__webglVertexBuffer)e=
 g,e.__webglVertexBuffer=h.createBuffer(),e.__webglColorBuffer=h.createBuffer(),e=g,f=e.vertices.length,e.__vertexArray=new Float32Array(f*3),e.__colorArray=new Float32Array(f*3),e.__sortArray=[],e.__webglParticleCount=f,g.__dirtyVertices=!0,g.__dirtyColors=!0;D(d.__webglObjects,g,c)}else THREE.MarchingCubes!==void 0&&c instanceof THREE.MarchingCubes?d.__webglObjectsImmediate.push({object:c,opaque:{list:[],count:0},transparent:{list:[],count:0}}):c instanceof THREE.Sprite&&d.__webglSprites.push(c);
 g,e.__webglVertexBuffer=h.createBuffer(),e.__webglColorBuffer=h.createBuffer(),e=g,f=e.vertices.length,e.__vertexArray=new Float32Array(f*3),e.__colorArray=new Float32Array(f*3),e.__sortArray=[],e.__webglParticleCount=f,g.__dirtyVertices=!0,g.__dirtyColors=!0;D(d.__webglObjects,g,c)}else THREE.MarchingCubes!==void 0&&c instanceof THREE.MarchingCubes?d.__webglObjectsImmediate.push({object:c,opaque:{list:[],count:0},transparent:{list:[],count:0}}):c instanceof THREE.Sprite&&d.__webglSprites.push(c);
 b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;)c=b.__objectsRemoved[0],d=b,c instanceof THREE.ShadowVolume?F(d.__webglShadowVolumes,c):c instanceof THREE.Mesh||c instanceof THREE.ParticleSystem||c instanceof THREE.Ribbon||c instanceof THREE.Line?F(d.__webglObjects,c):c instanceof THREE.Sprite?F(d.__webglSprites,c):c instanceof THREE.LensFlare?F(d.__webglLensFlares,c):c instanceof THREE.MarchingCubes&&F(d.__webglObjectsImmediate,c),b.__objectsRemoved.splice(0,1);c=0;for(d=b.__webglObjects.length;c<
 b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;)c=b.__objectsRemoved[0],d=b,c instanceof THREE.ShadowVolume?F(d.__webglShadowVolumes,c):c instanceof THREE.Mesh||c instanceof THREE.ParticleSystem||c instanceof THREE.Ribbon||c instanceof THREE.Line?F(d.__webglObjects,c):c instanceof THREE.Sprite?F(d.__webglSprites,c):c instanceof THREE.LensFlare?F(d.__webglLensFlares,c):c instanceof THREE.MarchingCubes&&F(d.__webglObjectsImmediate,c),b.__objectsRemoved.splice(0,1);c=0;for(d=b.__webglObjects.length;c<
-d;c++)y(b.__webglObjects[c].object,b);c=0;for(d=b.__webglShadowVolumes.length;c<d;c++)y(b.__webglShadowVolumes[c].object,b);c=0;for(d=b.__webglLensFlares.length;c<d;c++)y(b.__webglLensFlares[c].object,b)};this.setFaceCulling=function(b,c){b?(!c||c=="ccw"?h.frontFace(h.CCW):h.frontFace(h.CW),b=="back"?h.cullFace(h.BACK):b=="front"?h.cullFace(h.FRONT):h.cullFace(h.FRONT_AND_BACK),h.enable(h.CULL_FACE)):h.disable(h.CULL_FACE)};this.supportsVertexTextures=function(){return za}};
+d;c++)x(b.__webglObjects[c].object,b);c=0;for(d=b.__webglShadowVolumes.length;c<d;c++)x(b.__webglShadowVolumes[c].object,b);c=0;for(d=b.__webglLensFlares.length;c<d;c++)x(b.__webglLensFlares[c].object,b)};this.setFaceCulling=function(b,c){b?(!c||c=="ccw"?h.frontFace(h.CCW):h.frontFace(h.CW),b=="back"?h.cullFace(h.BACK):b=="front"?h.cullFace(h.FRONT):h.cullFace(h.FRONT_AND_BACK),h.enable(h.CULL_FACE)):h.disable(h.CULL_FACE)};this.supportsVertexTextures=function(){return za}};
 THREE.WebGLRenderTarget=function(b,c,d){this.width=b;this.height=c;d=d||{};this.wrapS=d.wrapS!==void 0?d.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=d.wrapT!==void 0?d.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=d.magFilter!==void 0?d.magFilter:THREE.LinearFilter;this.minFilter=d.minFilter!==void 0?d.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=d.format!==void 0?d.format:THREE.RGBAFormat;this.type=d.type!==void 0?d.type:
 THREE.WebGLRenderTarget=function(b,c,d){this.width=b;this.height=c;d=d||{};this.wrapS=d.wrapS!==void 0?d.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=d.wrapT!==void 0?d.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=d.magFilter!==void 0?d.magFilter:THREE.LinearFilter;this.minFilter=d.minFilter!==void 0?d.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=d.format!==void 0?d.format:THREE.RGBAFormat;this.type=d.type!==void 0?d.type:
 THREE.UnsignedByteType;this.depthBuffer=d.depthBuffer!==void 0?d.depthBuffer:!0;this.stencilBuffer=d.stencilBuffer!==void 0?d.stencilBuffer:!0};
 THREE.UnsignedByteType;this.depthBuffer=d.depthBuffer!==void 0?d.depthBuffer:!0;this.stencilBuffer=d.stencilBuffer!==void 0?d.stencilBuffer:!0};
 THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(b,c,d){d&&b.update(void 0,!1,c);var d=b.sounds,e,f=d.length;for(e=0;e<f;e++)b=d[e],this.soundPosition.set(b.matrixWorld.n14,b.matrixWorld.n24,b.matrixWorld.n34),this.soundPosition.subSelf(c.position),b.isPlaying&&b.isLoaded&&(b.isAddedToDOM||b.addToDOM(this.domElement),b.calculateVolumeAndPan(this.soundPosition))}};
 THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(b,c,d){d&&b.update(void 0,!1,c);var d=b.sounds,e,f=d.length;for(e=0;e<f;e++)b=d[e],this.soundPosition.set(b.matrixWorld.n14,b.matrixWorld.n24,b.matrixWorld.n34),this.soundPosition.subSelf(c.position),b.isPlaying&&b.isLoaded&&(b.isAddedToDOM||b.addToDOM(this.domElement),b.calculateVolumeAndPan(this.soundPosition))}};
@@ -378,7 +378,7 @@ this.getPrevKeyWith("pos",u,j.index-1).pos,this.points[1]=f,this.points[2]=g,thi
 THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var d=[],e=[],f,g,j,k,m,o;f=(b.length-1)*c;g=Math.floor(f);f-=g;d[0]=g==0?g:g-1;d[1]=g;d[2]=g>b.length-2?g:g+1;d[3]=g>b.length-3?g:g+2;g=b[d[0]];k=b[d[1]];m=b[d[2]];o=b[d[3]];d=f*f;j=f*d;e[0]=this.interpolate(g[0],k[0],m[0],o[0],f,d,j);e[1]=this.interpolate(g[1],k[1],m[1],o[1],f,d,j);e[2]=this.interpolate(g[2],k[2],m[2],o[2],f,d,j);return e};
 THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var d=[],e=[],f,g,j,k,m,o;f=(b.length-1)*c;g=Math.floor(f);f-=g;d[0]=g==0?g:g-1;d[1]=g;d[2]=g>b.length-2?g:g+1;d[3]=g>b.length-3?g:g+2;g=b[d[0]];k=b[d[1]];m=b[d[2]];o=b[d[3]];d=f*f;j=f*d;e[0]=this.interpolate(g[0],k[0],m[0],o[0],f,d,j);e[1]=this.interpolate(g[1],k[1],m[1],o[1],f,d,j);e[2]=this.interpolate(g[2],k[2],m[2],o[2],f,d,j);return e};
 THREE.Animation.prototype.interpolate=function(b,c,d,e,f,g,j){b=(d-b)*0.5;e=(e-c)*0.5;return(2*(c-d)+b+e)*j+(-3*(c-d)-2*b-e)*g+b*f+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,d){var e=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?d=d<e.length-1?d:e.length-1:d%=e.length;d<e.length;d++)if(e[d][b]!==void 0)return e[d];return this.data.hierarchy[c].keys[0]};
 THREE.Animation.prototype.interpolate=function(b,c,d,e,f,g,j){b=(d-b)*0.5;e=(e-c)*0.5;return(2*(c-d)+b+e)*j+(-3*(c-d)-2*b-e)*g+b*f+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,d){var e=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?d=d<e.length-1?d:e.length-1:d%=e.length;d<e.length;d++)if(e[d][b]!==void 0)return e[d];return this.data.hierarchy[c].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(b,c,d){for(var e=this.data.hierarchy[c].keys,d=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?d>0?d:0:d>=0?d:d+e.length;d>=0;d--)if(e[d][b]!==void 0)return e[d];return this.data.hierarchy[c].keys[e.length-1]};
 THREE.Animation.prototype.getPrevKeyWith=function(b,c,d){for(var e=this.data.hierarchy[c].keys,d=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?d>0?d:0:d>=0?d:d+e.length;d>=0;d--)if(e[d][b]!==void 0)return e[d];return this.data.hierarchy[c].keys[e.length-1]};
-THREE.QuakeCamera=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.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=
+THREE.QuakeCamera=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.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=
 b.movementSpeed;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.noFly!==void 0)this.noFly=b.noFly;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.autoForward!==void 0)this.autoForward=b.autoForward;if(b.activeLook!==void 0)this.activeLook=b.activeLook;if(b.heightSpeed!==void 0)this.heightSpeed=b.heightSpeed;if(b.heightCoef!==void 0)this.heightCoef=b.heightCoef;if(b.heightMin!==void 0)this.heightMin=b.heightMin;if(b.heightMax!==void 0)this.heightMax=b.heightMax;if(b.constrainVertical!==
 b.movementSpeed;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.noFly!==void 0)this.noFly=b.noFly;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.autoForward!==void 0)this.autoForward=b.autoForward;if(b.activeLook!==void 0)this.activeLook=b.activeLook;if(b.heightSpeed!==void 0)this.heightSpeed=b.heightSpeed;if(b.heightCoef!==void 0)this.heightCoef=b.heightCoef;if(b.heightMin!==void 0)this.heightMin=b.heightMin;if(b.heightMax!==void 0)this.heightMax=b.heightMax;if(b.constrainVertical!==
 void 0)this.constrainVertical=b.constrainVertical;if(b.verticalMin!==void 0)this.verticalMin=b.verticalMin;if(b.verticalMax!==void 0)this.verticalMax=b.verticalMax;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(b){b.preventDefault();
 void 0)this.constrainVertical=b.constrainVertical;if(b.verticalMin!==void 0)this.verticalMin=b.verticalMin;if(b.verticalMax!==void 0)this.verticalMax=b.verticalMax;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(b){b.preventDefault();
 b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(b){b.preventDefault();b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(b){this.mouseX=b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.onKeyDown=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=
 b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(b){b.preventDefault();b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(b){this.mouseX=b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.onKeyDown=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=
@@ -390,7 +390,7 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
 THREE.QuakeCamera.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.QuakeCamera.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,c,d,e){var g={name:d,fps:0.6,length:e,hierarchy:[]},f,j=c.getControlPointsArray(),k=c.getLength(),m=j.length,F=0;f=m-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:j[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[f]={time:e,pos:j[f],rot:[0,0,0,1],scl:[1,1,1]};for(f=1;f<m-1;f++)F=e*k.chunks[f]/k.total,c.keys[f]={time:F,pos:j[f]};g.hierarchy[0]=c;THREE.AnimationHandler.add(g);return new THREE.Animation(b,d,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function d(b,c){var d,
 THREE.PathCamera=function(b){function c(b,c,d,e){var g={name:d,fps:0.6,length:e,hierarchy:[]},f,j=c.getControlPointsArray(),k=c.getLength(),m=j.length,F=0;f=m-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:j[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[f]={time:e,pos:j[f],rot:[0,0,0,1],scl:[1,1,1]};for(f=1;f<m-1;f++)F=e*k.chunks[f]/k.total,c.keys[f]={time:F,pos:j[f]};g.hierarchy[0]=c;THREE.AnimationHandler.add(g);return new THREE.Animation(b,d,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function d(b,c){var d,
 e,g=new THREE.Geometry;for(d=0;d<b.points.length*c;d++)e=d/(b.points.length*c),e=b.getPoint(e),g.vertices[d]=new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z));return g}function e(b,c){var e=d(c,10),g=d(c,10),f=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,f);particleObj=new THREE.ParticleSystem(g,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);g=new THREE.SphereGeometry(1,
 e,g=new THREE.Geometry;for(d=0;d<b.points.length*c;d++)e=d/(b.points.length*c),e=b.getPoint(e),g.vertices[d]=new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z));return g}function e(b,c){var e=d(c,10),g=d(c,10),f=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,f);particleObj=new THREE.ParticleSystem(g,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);g=new THREE.SphereGeometry(1,
-16,8);f=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)e=new THREE.Mesh(g,f),e.position.copy(c.points[i]),e.updateMatrix(),b.addChild(e)}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);f=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)e=new THREE.Mesh(g,f),e.position.copy(c.points[i]),e.updateMatrix(),b.addChild(e)}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.005;this.lookHorizontal=
 this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(b){if(b.duration!==void 0)this.duration=b.duration*1E3;if(b.waypoints!==void 0)this.waypoints=b.waypoints;if(b.useConstantSpeed!==void 0)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==void 0)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==void 0)this.createDebugPath=b.createDebugPath;if(b.createDebugDummy!==
 this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(b){if(b.duration!==void 0)this.duration=b.duration*1E3;if(b.waypoints!==void 0)this.waypoints=b.waypoints;if(b.useConstantSpeed!==void 0)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==void 0)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==void 0)this.createDebugPath=b.createDebugPath;if(b.createDebugDummy!==
 void 0)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==void 0)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==void 0)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==void 0)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
 void 0)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==void 0)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==void 0)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==void 0)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
 window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var f=Math.PI*2,g=Math.PI/180;this.update=function(b,c,d){var e,j;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)*g;this.theta=this.lon*g;e=this.phi%f;this.phi=e>=0?e:e+f;e=this.verticalAngleMap.srcRange;j=this.verticalAngleMap.dstRange;var k=j[1]-j[0];this.phi=
 window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var f=Math.PI*2,g=Math.PI/180;this.update=function(b,c,d){var e,j;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)*g;this.theta=this.lon*g;e=this.phi%f;this.phi=e>=0?e:e+f;e=this.verticalAngleMap.srcRange;j=this.verticalAngleMap.dstRange;var k=j[1]-j[0];this.phi=
@@ -398,7 +398,7 @@ TWEEN.Easing.Quadratic.EaseInOut(((this.phi-e[0])*(j[1]-j[0])/(e[1]-e[0])+j[0]-j
 b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};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}),j=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(k,b);b=new THREE.Mesh(m,j);b.position.set(0,10,0);this.animation=
 b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};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}),j=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(k,b);b=new THREE.Mesh(m,j);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&&e(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(b,c){return function(){c.apply(b,arguments)}}(this,this.onMouseMove),
 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&&e(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(b,c){return function(){c.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;
 !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.005;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.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.keydown=function(b){if(!b.altKey){switch(b.keyCode){case 16:this.movementSpeedMultiplier=
 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.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.keydown=function(b){if(!b.altKey){switch(b.keyCode){case 16:this.movementSpeedMultiplier=
 0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
 0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
 this.keyup=function(b){switch(b.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;
 this.keyup=function(b){switch(b.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;
@@ -436,7 +436,7 @@ e));d instanceof THREE.Face4&&c.push(new THREE.UV(0.5+Math.atan2(p.position.x,p.
 THREE.IcosahedronGeometry=function(b){function c(b,c,d){var e=Math.sqrt(b*b+c*c+d*d);return f.vertices.push(new THREE.Vertex(new THREE.Vector3(b/e,c/e,d/e)))-1}function d(b,c,d,e){e.faces.push(new THREE.Face3(b,c,d))}function e(b,d){var e=f.vertices[b].position,g=f.vertices[d].position;return c((e.x+g.x)/2,(e.y+g.y)/2,(e.z+g.z)/2)}var f=this,g=new THREE.Geometry,j;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,d){var e=Math.sqrt(b*b+c*c+d*d);return f.vertices.push(new THREE.Vertex(new THREE.Vector3(b/e,c/e,d/e)))-1}function d(b,c,d,e){e.faces.push(new THREE.Face3(b,c,d))}function e(b,d){var e=f.vertices[b].position,g=f.vertices[d].position;return c((e.x+g.x)/2,(e.y+g.y)/2,(e.z+g.z)/2)}var f=this,g=new THREE.Geometry,j;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);d(0,11,5,g);d(0,5,1,g);d(0,1,7,g);d(0,7,10,g);d(0,10,11,g);d(1,5,9,g);d(5,11,4,g);d(11,10,2,g);d(10,7,6,g);d(7,1,8,g);d(3,9,4,g);d(3,4,2,g);d(3,2,6,g);d(3,6,8,g);d(3,8,9,g);d(4,9,5,g);d(2,4,11,g);d(6,2,10,g);d(8,6,7,g);d(9,8,1,g);for(b=0;b<this.subdivisions;b++){j=new THREE.Geometry;for(var k in g.faces){var m=e(g.faces[k].a,g.faces[k].b),o=e(g.faces[k].b,g.faces[k].c),n=e(g.faces[k].c,g.faces[k].a);d(g.faces[k].a,m,n,j);d(g.faces[k].b,o,m,j);
 -b);c(0,1,-b);c(b,0,-1);c(b,0,1);c(-b,0,-1);c(-b,0,1);d(0,11,5,g);d(0,5,1,g);d(0,1,7,g);d(0,7,10,g);d(0,10,11,g);d(1,5,9,g);d(5,11,4,g);d(11,10,2,g);d(10,7,6,g);d(7,1,8,g);d(3,9,4,g);d(3,4,2,g);d(3,2,6,g);d(3,6,8,g);d(3,8,9,g);d(4,9,5,g);d(2,4,11,g);d(6,2,10,g);d(8,6,7,g);d(9,8,1,g);for(b=0;b<this.subdivisions;b++){j=new THREE.Geometry;for(var k in g.faces){var m=e(g.faces[k].a,g.faces[k].b),o=e(g.faces[k].b,g.faces[k].c),n=e(g.faces[k].c,g.faces[k].a);d(g.faces[k].a,m,n,j);d(g.faces[k].b,o,m,j);
 d(g.faces[k].c,n,o,j);d(m,o,n,j)}g.faces=j.faces}f.faces=g.faces;delete g;delete j;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
 d(g.faces[k].c,n,o,j);d(m,o,n,j)}g.faces=j.faces}f.faces=g.faces;delete g;delete j;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
-THREE.LatheGeometry=function(b,c,d){THREE.Geometry.call(this);this.steps=c||12;this.angle=d||2*Math.PI;for(var c=this.angle/this.steps,d=[],e=[],f=[],g=[],j=(new THREE.Matrix4).setRotationZ(c),k=0;k<b.length;k++)this.vertices.push(new THREE.Vertex(b[k])),d[k]=b[k].clone(),e[k]=this.vertices.length-1;for(var m=0;m<=this.angle+0.0010;m+=c){for(k=0;k<d.length;k++)m<this.angle?(d[k]=j.multiplyVector3(d[k].clone()),this.vertices.push(new THREE.Vertex(d[k])),f[k]=this.vertices.length-1):f=g;m==0&&(g=e);
+THREE.LatheGeometry=function(b,c,d){THREE.Geometry.call(this);this.steps=c||12;this.angle=d||2*Math.PI;for(var c=this.angle/this.steps,d=[],e=[],f=[],g=[],j=(new THREE.Matrix4).setRotationZ(c),k=0;k<b.length;k++)this.vertices.push(new THREE.Vertex(b[k])),d[k]=b[k].clone(),e[k]=this.vertices.length-1;for(var m=0;m<=this.angle+0.001;m+=c){for(k=0;k<d.length;k++)m<this.angle?(d[k]=j.multiplyVector3(d[k].clone()),this.vertices.push(new THREE.Vertex(d[k])),f[k]=this.vertices.length-1):f=g;m==0&&(g=e);
 for(k=0;k<e.length-1;k++)this.faces.push(new THREE.Face4(f[k],f[k+1],e[k+1],e[k])),this.faceVertexUvs[0].push([new THREE.UV(1-m/this.angle,k/b.length),new THREE.UV(1-m/this.angle,(k+1)/b.length),new THREE.UV(1-(m-c)/this.angle,(k+1)/b.length),new THREE.UV(1-(m-c)/this.angle,k/b.length)]);e=f;f=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
 for(k=0;k<e.length-1;k++)this.faces.push(new THREE.Face4(f[k],f[k+1],e[k+1],e[k])),this.faceVertexUvs[0].push([new THREE.UV(1-m/this.angle,k/b.length),new THREE.UV(1-m/this.angle,(k+1)/b.length),new THREE.UV(1-(m-c)/this.angle,(k+1)/b.length),new THREE.UV(1-(m-c)/this.angle,k/b.length)]);e=f;f=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
 THREE.PlaneGeometry=function(b,c,d,e){THREE.Geometry.call(this);var f,g=b/2,j=c/2,d=d||1,e=e||1,k=d+1,m=e+1;b/=d;var o=c/e;for(f=0;f<m;f++)for(c=0;c<k;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-g,-(f*o-j),0)));for(f=0;f<e;f++)for(c=0;c<d;c++)this.faces.push(new THREE.Face4(c+k*f,c+k*(f+1),c+1+k*(f+1),c+1+k*f)),this.faceVertexUvs[0].push([new THREE.UV(c/d,f/e),new THREE.UV(c/d,(f+1)/e),new THREE.UV((c+1)/d,(f+1)/e),new THREE.UV((c+1)/d,f/e)]);this.computeCentroids();this.computeFaceNormals()};
 THREE.PlaneGeometry=function(b,c,d,e){THREE.Geometry.call(this);var f,g=b/2,j=c/2,d=d||1,e=e||1,k=d+1,m=e+1;b/=d;var o=c/e;for(f=0;f<m;f++)for(c=0;c<k;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-g,-(f*o-j),0)));for(f=0;f<e;f++)for(c=0;c<d;c++)this.faces.push(new THREE.Face4(c+k*f,c+k*(f+1),c+1+k*(f+1),c+1+k*f)),this.faceVertexUvs[0].push([new THREE.UV(c/d,f/e),new THREE.UV(c/d,(f+1)/e),new THREE.UV((c+1)/d,(f+1)/e),new THREE.UV((c+1)/d,f/e)]);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;
@@ -446,19 +446,19 @@ this.vertices[j].position.clone(),v=this.vertices[m].position.clone(),z=this.ver
 THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(b,c){THREE.Geometry.call(this);this.parameters=c||{};this.set(b)};THREE.TextGeometry.prototype=new THREE.Geometry;THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(b,c){THREE.Geometry.call(this);this.parameters=c||{};this.set(b)};THREE.TextGeometry.prototype=new THREE.Geometry;THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.TextGeometry.prototype.set=function(b,c){function d(b,c,d){v.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,d)))}function e(b,c,d,e){v.faces.push(new THREE.Face4(b,c,d,e))}this.text=b;var c=c||this.parameters,f=c.height!==void 0?c.height:50,g=c.curveSegments!==void 0?c.curveSegments:4,j=c.font!==void 0?c.font:"helvetiker",k=c.weight!==void 0?c.weight:"normal",m=c.style!==void 0?c.style:"normal",o=c.bezelThickness!==void 0?c.bezelThickness:10,n=c.bezelSize!==void 0?c.bezelSize:8,p=c.bezelEnabled!==
 THREE.TextGeometry.prototype.set=function(b,c){function d(b,c,d){v.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,d)))}function e(b,c,d,e){v.faces.push(new THREE.Face4(b,c,d,e))}this.text=b;var c=c||this.parameters,f=c.height!==void 0?c.height:50,g=c.curveSegments!==void 0?c.curveSegments:4,j=c.font!==void 0?c.font:"helvetiker",k=c.weight!==void 0?c.weight:"normal",m=c.style!==void 0?c.style:"normal",o=c.bezelThickness!==void 0?c.bezelThickness:10,n=c.bezelSize!==void 0?c.bezelSize:8,p=c.bezelEnabled!==
 void 0?c.bezelEnabled:!1;THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=g;THREE.FontUtils.face=j;THREE.FontUtils.weight=k;THREE.FontUtils.style=m;THREE.FontUtils.bezelSize=n;var k=THREE.FontUtils.drawText(b),g=k.points,t=k.faces,j=k.contour,u=k.bezel,v=this;v.vertices=[];v.faces=[];for(var z,m=g.length,A=t.length,n=u.length,k=0;k<m;k++)z=g[k],d(z.x,z.y,0);for(k=0;k<m;k++)z=g[k],d(z.x,z.y,f);if(p){for(k=0;k<n;k++)z=u[k],d(z.x,z.y,o);for(k=0;k<n;k++)z=u[k],d(z.x,z.y,f-o)}for(k=
 void 0?c.bezelEnabled:!1;THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=g;THREE.FontUtils.face=j;THREE.FontUtils.weight=k;THREE.FontUtils.style=m;THREE.FontUtils.bezelSize=n;var k=THREE.FontUtils.drawText(b),g=k.points,t=k.faces,j=k.contour,u=k.bezel,v=this;v.vertices=[];v.faces=[];for(var z,m=g.length,A=t.length,n=u.length,k=0;k<m;k++)z=g[k],d(z.x,z.y,0);for(k=0;k<m;k++)z=g[k],d(z.x,z.y,f);if(p){for(k=0;k<n;k++)z=u[k],d(z.x,z.y,o);for(k=0;k<n;k++)z=u[k],d(z.x,z.y,f-o)}for(k=
-0;k<A;k++)f=t[k],v.faces.push(new THREE.Face3(f[2],f[1],f[0]));for(k=0;k<A;k++)f=t[k],v.faces.push(new THREE.Face3(f[0]+m,f[1]+m,f[2]+m));var y;if(p)for(k=u.length;--k>0;){if(y){if(y.equals(j[k])){y=null;continue}}else y=j[k];o=m*2+k;t=o-1;e(o,t,t+n,o+n);for(p=0;p<m;p++)if(g[p].equals(j[k]))break;for(f=0;f<m;f++)if(g[f].equals(j[k-1]))break;e(p,f,t,o);e(o+n,t+n,f+m,p+m)}else for(k=j.length;--k>0;){if(y){if(y.equals(j[k])){y=null;continue}}else y=j[k];for(p=0;p<m;p++)if(g[p].equals(j[k]))break;for(f=
+0;k<A;k++)f=t[k],v.faces.push(new THREE.Face3(f[2],f[1],f[0]));for(k=0;k<A;k++)f=t[k],v.faces.push(new THREE.Face3(f[0]+m,f[1]+m,f[2]+m));var x;if(p)for(k=u.length;--k>0;){if(x){if(x.equals(j[k])){x=null;continue}}else x=j[k];o=m*2+k;t=o-1;e(o,t,t+n,o+n);for(p=0;p<m;p++)if(g[p].equals(j[k]))break;for(f=0;f<m;f++)if(g[f].equals(j[k-1]))break;e(p,f,t,o);e(o+n,t+n,f+m,p+m)}else for(k=j.length;--k>0;){if(x){if(x.equals(j[k])){x=null;continue}}else x=j[k];for(p=0;p<m;p++)if(g[p].equals(j[k]))break;for(f=
 0;f<m;f++)if(g[f].equals(j[k-1]))break;e(p,f,f+m,p+m)}this.computeCentroids();this.computeFaceNormals()};
 0;f<m;f++)if(g[f].equals(j[k-1]))break;e(p,f,f+m,p+m)}this.computeCentroids();this.computeFaceNormals()};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},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},extractPoints:function(b,c){if(b.length<3)return console.log("not valid polygon"),
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},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},extractPoints:function(b,c){if(b.length<3)return console.log("not valid polygon"),
-{points:b,faces:[]};var d,e,f,g,j=[],k;for(k in c){b=c[k];g=[];for(d in b)e=b[d],g.push(e.x+","+e.y);var m,o;o=g.slice(1).indexOf(g[0]);var n=this.Triangulate.area(b.slice(0,o+1))<0;e=[];for(o=-1;o<g.length;){m=o+1;o=g[m];o=g.slice(m+1).indexOf(o)+m;if(o<=m)break;var p=b.slice(m,o+1);n?this.Triangulate.area(p)<0?(m>0&&j.push({shape:f,holes:e}),f=p,e=[]):e.push(p):this.Triangulate.area(p)<0?(j.push({shape:p,holes:e}),e=[]):e.push(p);o++}n&&j.push({shape:f,holes:e})}var t,u,v,z,A,y;g=[];for(k=0;k<j.length;k++){m=
-j[k];f=m.shape;e=m.holes;for(n=0;n<e.length;n++){o=e[n];v=Number.POSITIVE_INFINITY;for(p=0;p<o.length;p++){A=o[p];for(d=0;d<f.length;d++)z=f[d],z=A.distanceTo(z),z<v&&(v=z,t=p,u=d)}d=u-1>=0?u-1:f.length-1;var p=t-1>=0?t-1:o.length-1,F=[];F.push(o[t]);F.push(f[u]);F.push(f[d]);v=this.Triangulate.area(F);var x=[];x.push(o[t]);x.push(o[p]);x.push(f[u]);A=this.Triangulate.area(x);z=u;y=t;u+=1;t+=-1;u<0&&(u+=f.length);u%=f.length;t<0&&(t+=o.length);t%=f.length;d=u-1>=0?u-1:f.length-1;p=t-1>=0?t-1:o.length-
-1;F=[];F.push(o[t]);F.push(f[u]);F.push(f[d]);F=this.Triangulate.area(F);x=[];x.push(o[t]);x.push(o[p]);x.push(f[u]);x=this.Triangulate.area(x);v+A>F+x&&(u=z,t=y,u<0&&(u+=f.length),u%=f.length,t<0&&(t+=o.length),t%=f.length,d=u-1>=0?u-1:f.length-1,p=t-1>=0?t-1:o.length-1);v=f.slice(0,u);A=f.slice(u);z=o.slice(t);y=o.slice(0,t);g.push(o[t]);g.push(f[u]);g.push(f[d]);g.push(o[t]);g.push(o[p]);g.push(f[u]);f=v.concat(z).concat(y).concat(A)}m.shape=f}b=[];t=[];for(k=n=0;k<j.length;k++){m=j[k];f=m.shape;
+{points:b,faces:[]};var d,e,f,g,j=[],k;for(k in c){b=c[k];g=[];for(d in b)e=b[d],g.push(e.x+","+e.y);var m,o;o=g.slice(1).indexOf(g[0]);var n=this.Triangulate.area(b.slice(0,o+1))<0;e=[];for(o=-1;o<g.length;){m=o+1;o=g[m];o=g.slice(m+1).indexOf(o)+m;if(o<=m)break;var p=b.slice(m,o+1);n?this.Triangulate.area(p)<0?(m>0&&j.push({shape:f,holes:e}),f=p,e=[]):e.push(p):this.Triangulate.area(p)<0?(j.push({shape:p,holes:e}),e=[]):e.push(p);o++}n&&j.push({shape:f,holes:e})}var t,u,v,z,A,x;g=[];for(k=0;k<j.length;k++){m=
+j[k];f=m.shape;e=m.holes;for(n=0;n<e.length;n++){o=e[n];v=Number.POSITIVE_INFINITY;for(p=0;p<o.length;p++){A=o[p];for(d=0;d<f.length;d++)z=f[d],z=A.distanceTo(z),z<v&&(v=z,t=p,u=d)}d=u-1>=0?u-1:f.length-1;var p=t-1>=0?t-1:o.length-1,F=[];F.push(o[t]);F.push(f[u]);F.push(f[d]);v=this.Triangulate.area(F);var y=[];y.push(o[t]);y.push(o[p]);y.push(f[u]);A=this.Triangulate.area(y);z=u;x=t;u+=1;t+=-1;u<0&&(u+=f.length);u%=f.length;t<0&&(t+=o.length);t%=f.length;d=u-1>=0?u-1:f.length-1;p=t-1>=0?t-1:o.length-
+1;F=[];F.push(o[t]);F.push(f[u]);F.push(f[d]);F=this.Triangulate.area(F);y=[];y.push(o[t]);y.push(o[p]);y.push(f[u]);y=this.Triangulate.area(y);v+A>F+y&&(u=z,t=x,u<0&&(u+=f.length),u%=f.length,t<0&&(t+=o.length),t%=f.length,d=u-1>=0?u-1:f.length-1,p=t-1>=0?t-1:o.length-1);v=f.slice(0,u);A=f.slice(u);z=o.slice(t);x=o.slice(0,t);g.push(o[t]);g.push(f[u]);g.push(f[d]);g.push(o[t]);g.push(o[p]);g.push(f[u]);f=v.concat(z).concat(x).concat(A)}m.shape=f}b=[];t=[];for(k=n=0;k<j.length;k++){m=j[k];f=m.shape;
 b=b.concat(f);m=THREE.FontUtils.Triangulate(f,!0);for(u=0;u<m.length;u++)e=m[u],e[0]+=n,e[1]+=n,e[2]+=n;t=t.concat(m);n+=f.length}var D;for(u=0;u<g.length/3;u++){e=[];for(j=0;j<3;j++){k=!1;for(f=0;f<b.length&&!k;f++)D=u*3+j,b[f].equals(g[D])&&(e.push(f),k=!0);k||(b.push(g[D]),e.push(b.length-1),console.log("not found"))}t.push(e)}return{points:b,faces:t}},drawText:function(b){var c=[],d=[],e,f=this.getFace(),g=this.size/f.resolution,j=0;e=String(b).split("");for(var k=e.length,b=0;b<k;b++){var m=
 b=b.concat(f);m=THREE.FontUtils.Triangulate(f,!0);for(u=0;u<m.length;u++)e=m[u],e[0]+=n,e[1]+=n,e[2]+=n;t=t.concat(m);n+=f.length}var D;for(u=0;u<g.length/3;u++){e=[];for(j=0;j<3;j++){k=!1;for(f=0;f<b.length&&!k;f++)D=u*3+j,b[f].equals(g[D])&&(e.push(f),k=!0);k||(b.push(g[D]),e.push(b.length-1),console.log("not found"))}t.push(e)}return{points:b,faces:t}},drawText:function(b){var c=[],d=[],e,f=this.getFace(),g=this.size/f.resolution,j=0;e=String(b).split("");for(var k=e.length,b=0;b<k;b++){var m=
 this.extractGlyphPoints(e[b],f,g,j);j+=m.offset;c.push(m.points);d=d.concat(m.points)}b=j/2;for(e=0;e<d.length;e++)d[e].x-=b;c=this.extractPoints(d,c);c.contour=d;f=[];g=[];e=[];for(var j=[],k=new THREE.Vector2,o,b=d.length;--b>=0;){if(o){if(o.equals(d[b])){o=null;m=this.Triangulate.area(e)>0;j.push(m);g.push(k.divideScalar(e.length));e=[];k=new THREE.Vector2;continue}}else o=d[b];k.addSelf(d[b]);e.push(d[b])}b=d.length;e=0;for(var n;--b>=0;)m=d[b],k=g[e],m=m.clone().subSelf(k),n=this.bezelSize/m.length(),
 this.extractGlyphPoints(e[b],f,g,j);j+=m.offset;c.push(m.points);d=d.concat(m.points)}b=j/2;for(e=0;e<d.length;e++)d[e].x-=b;c=this.extractPoints(d,c);c.contour=d;f=[];g=[];e=[];for(var j=[],k=new THREE.Vector2,o,b=d.length;--b>=0;){if(o){if(o.equals(d[b])){o=null;m=this.Triangulate.area(e)>0;j.push(m);g.push(k.divideScalar(e.length));e=[];k=new THREE.Vector2;continue}}else o=d[b];k.addSelf(d[b]);e.push(d[b])}b=d.length;e=0;for(var n;--b>=0;)m=d[b],k=g[e],m=m.clone().subSelf(k),n=this.bezelSize/m.length(),
 j[e]?n+=1:n=1-n,n=m.multiplyScalar(n).addSelf(k),f.unshift(n),o?o.equals(d[b])&&(o=null,e++):o=d[b];c.bezel=f;return c},b2p0:function(b,c){var d=1-b;return d*d*c},b2p1:function(b,c){return 2*(1-b)*b*c},b2p2:function(b,c){return b*b*c},b2:function(b,c,d,e){return this.b2p0(b,c)+this.b2p1(b,d)+this.b2p2(b,e)},b3p0:function(b,c){var d=1-b;return d*d*d*c},b3p1:function(b,c){var d=1-b;return 3*d*d*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,d,e,f){return this.b3p0(b,
 j[e]?n+=1:n=1-n,n=m.multiplyScalar(n).addSelf(k),f.unshift(n),o?o.equals(d[b])&&(o=null,e++):o=d[b];c.bezel=f;return c},b2p0:function(b,c){var d=1-b;return d*d*c},b2p1:function(b,c){return 2*(1-b)*b*c},b2p2:function(b,c){return b*b*c},b2:function(b,c,d,e){return this.b2p0(b,c)+this.b2p1(b,d)+this.b2p2(b,e)},b3p0:function(b,c){var d=1-b;return d*d*d*c},b3p1:function(b,c){var d=1-b;return 3*d*d*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,d,e,f){return this.b3p0(b,
 c)+this.b3p1(b,d)+this.b3p2(b,e)+this.b3p3(b,f)},extractGlyphPoints:function(b,c,d,e){var f=[],g,j,k,m,o,n,p,t,u,v,z=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(z){if(z.o){c=z._cachedOutline||(z._cachedOutline=z.o.split(" "));k=c.length;for(b=0;b<k;)switch(j=c[b++],j){case "m":j=c[b++]*d+e;m=c[b++]*d;f.push(new THREE.Vector2(j,m));break;case "l":j=c[b++]*d+e;m=c[b++]*d;f.push(new THREE.Vector2(j,m));break;case "q":j=c[b++]*d+e;m=c[b++]*d;p=c[b++]*d+e;t=c[b++]*d;if(g=f[f.length-1]){o=
 c)+this.b3p1(b,d)+this.b3p2(b,e)+this.b3p3(b,f)},extractGlyphPoints:function(b,c,d,e){var f=[],g,j,k,m,o,n,p,t,u,v,z=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(z){if(z.o){c=z._cachedOutline||(z._cachedOutline=z.o.split(" "));k=c.length;for(b=0;b<k;)switch(j=c[b++],j){case "m":j=c[b++]*d+e;m=c[b++]*d;f.push(new THREE.Vector2(j,m));break;case "l":j=c[b++]*d+e;m=c[b++]*d;f.push(new THREE.Vector2(j,m));break;case "q":j=c[b++]*d+e;m=c[b++]*d;p=c[b++]*d+e;t=c[b++]*d;if(g=f[f.length-1]){o=
-g.x;n=g.y;g=1;for(divisions=this.divisions;g<=divisions;g++){var A=g/divisions,y=THREE.FontUtils.b2(A,o,p,j),A=THREE.FontUtils.b2(A,n,t,m);f.push(new THREE.Vector2(y,A))}}break;case "b":if(j=c[b++]*d+e,m=c[b++]*d,p=c[b++]*d+e,t=c[b++]*-d,u=c[b++]*d+e,v=c[b++]*-d,g=f[f.length-1]){o=g.x;n=g.y;g=1;for(divisions=this.divisions;g<=divisions;g++)A=g/divisions,y=THREE.FontUtils.b3(A,o,p,u,j),A=THREE.FontUtils.b3(A,n,t,v,m),f.push(new THREE.Vector2(y,A))}}}return{offset:z.ha*d,points:f}}}};
-(function(b){var c=function(b){for(var c=b.length,f=0,g=c-1,j=0;j<c;g=j++)f+=b[g].x*b[j].y-b[j].x*b[g].y;return f*0.5};b.Triangulate=function(b,e){var f=b.length;if(f<3)return null;var g=[],j=[],k=[],m,o,n;if(c(b)>0)for(o=0;o<f;o++)j[o]=o;else for(o=0;o<f;o++)j[o]=f-1-o;var p=2*f;for(o=f-1;f>2;){if(p--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return k;return g}m=o;f<=m&&(m=0);o=m+1;f<=o&&(o=0);n=o+1;f<=n&&(n=0);var t;a:{t=b;var u=m,v=o,z=n,A=f,y=j,F=void 0,x=void 0,D=void 0,
-G=void 0,B=void 0,Q=void 0,K=void 0,L=void 0,E=void 0,x=t[y[u]].x,D=t[y[u]].y,G=t[y[v]].x,B=t[y[v]].y,Q=t[y[z]].x,K=t[y[z]].y;if(1.0E-10>(G-x)*(K-D)-(B-D)*(Q-x))t=!1;else{for(F=0;F<A;F++)if(!(F==u||F==v||F==z)){var L=t[y[F]].x,E=t[y[F]].y,M=void 0,U=void 0,h=void 0,R=void 0,S=void 0,O=void 0,aa=void 0,V=void 0,W=void 0,ga=void 0,Y=void 0,da=void 0,M=h=S=void 0,M=Q-G,U=K-B,h=x-Q,R=D-K,S=G-x,O=B-D,aa=L-x,V=E-D,W=L-G,ga=E-B,Y=L-Q,da=E-K,M=M*ga-U*W,S=S*V-O*aa,h=h*da-R*Y;if(M>=0&&h>=0&&S>=0){t=!1;break a}}t=
+g.x;n=g.y;g=1;for(divisions=this.divisions;g<=divisions;g++){var A=g/divisions,x=THREE.FontUtils.b2(A,o,p,j),A=THREE.FontUtils.b2(A,n,t,m);f.push(new THREE.Vector2(x,A))}}break;case "b":if(j=c[b++]*d+e,m=c[b++]*d,p=c[b++]*d+e,t=c[b++]*-d,u=c[b++]*d+e,v=c[b++]*-d,g=f[f.length-1]){o=g.x;n=g.y;g=1;for(divisions=this.divisions;g<=divisions;g++)A=g/divisions,x=THREE.FontUtils.b3(A,o,p,u,j),A=THREE.FontUtils.b3(A,n,t,v,m),f.push(new THREE.Vector2(x,A))}}}return{offset:z.ha*d,points:f}}}};
+(function(b){var c=function(b){for(var c=b.length,f=0,g=c-1,j=0;j<c;g=j++)f+=b[g].x*b[j].y-b[j].x*b[g].y;return f*0.5};b.Triangulate=function(b,e){var f=b.length;if(f<3)return null;var g=[],j=[],k=[],m,o,n;if(c(b)>0)for(o=0;o<f;o++)j[o]=o;else for(o=0;o<f;o++)j[o]=f-1-o;var p=2*f;for(o=f-1;f>2;){if(p--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return k;return g}m=o;f<=m&&(m=0);o=m+1;f<=o&&(o=0);n=o+1;f<=n&&(n=0);var t;a:{t=b;var u=m,v=o,z=n,A=f,x=j,F=void 0,y=void 0,D=void 0,
+G=void 0,B=void 0,Q=void 0,K=void 0,L=void 0,E=void 0,y=t[x[u]].x,D=t[x[u]].y,G=t[x[v]].x,B=t[x[v]].y,Q=t[x[z]].x,K=t[x[z]].y;if(1.0E-10>(G-y)*(K-D)-(B-D)*(Q-y))t=!1;else{for(F=0;F<A;F++)if(!(F==u||F==v||F==z)){var L=t[x[F]].x,E=t[x[F]].y,N=void 0,U=void 0,h=void 0,R=void 0,S=void 0,O=void 0,aa=void 0,V=void 0,W=void 0,ga=void 0,Y=void 0,da=void 0,N=h=S=void 0,N=Q-G,U=K-B,h=y-Q,R=D-K,S=G-y,O=B-D,aa=L-y,V=E-D,W=L-G,ga=E-B,Y=L-Q,da=E-K,N=N*ga-U*W,S=S*V-O*aa,h=h*da-R*Y;if(N>=0&&h>=0&&S>=0){t=!1;break a}}t=
 !0}}if(t){p=j[m];t=j[o];u=j[n];g.push(b[p]);g.push(b[t]);g.push(b[u]);k.push([j[m],j[o],j[n]]);m=o;for(n=o+1;n<f;m++,n++)j[m]=j[n];f--;p=2*f}}if(e)return k;return g};b.Triangulate.area=c;return b})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 !0}}if(t){p=j[m];t=j[o];u=j[n];g.push(b[p]);g.push(b[t]);g.push(b[u]);k.push([j[m],j[o],j[n]]);m=o;for(n=o+1;n<f;m++,n++)j[m]=j[n];f--;p=2*f}}if(e)return k;return g};b.Triangulate.area=c;return b})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 THREE.TorusGeometry=function(b,c,d,e){THREE.Geometry.call(this);this.radius=b||100;this.tube=c||40;this.segmentsR=d||8;this.segmentsT=e||6;b=[];for(c=0;c<=this.segmentsR;++c)for(d=0;d<=this.segmentsT;++d){var e=d/this.segmentsT*2*Math.PI,f=c/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(f))*Math.cos(e),(this.radius+this.tube*Math.cos(f))*Math.sin(e),this.tube*Math.sin(f))));b.push([d/this.segmentsT,1-c/this.segmentsR])}for(c=1;c<=this.segmentsR;++c)for(d=
 THREE.TorusGeometry=function(b,c,d,e){THREE.Geometry.call(this);this.radius=b||100;this.tube=c||40;this.segmentsR=d||8;this.segmentsT=e||6;b=[];for(c=0;c<=this.segmentsR;++c)for(d=0;d<=this.segmentsT;++d){var e=d/this.segmentsT*2*Math.PI,f=c/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(f))*Math.cos(e),(this.radius+this.tube*Math.cos(f))*Math.sin(e),this.tube*Math.sin(f))));b.push([d/this.segmentsT,1-c/this.segmentsR])}for(c=1;c<=this.segmentsR;++c)for(d=
 1;d<=this.segmentsT;++d){var e=(this.segmentsT+1)*c+d,f=(this.segmentsT+1)*c+d-1,g=(this.segmentsT+1)*(c-1)+d-1,j=(this.segmentsT+1)*(c-1)+d;this.faces.push(new THREE.Face4(e,f,g,j));this.faceVertexUvs[0].push([new THREE.UV(b[e][0],b[e][1]),new THREE.UV(b[f][0],b[f][1]),new THREE.UV(b[g][0],b[g][1]),new THREE.UV(b[j][0],b[j][1])])}delete b;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusGeometry.prototype=new THREE.Geometry;
 1;d<=this.segmentsT;++d){var e=(this.segmentsT+1)*c+d,f=(this.segmentsT+1)*c+d-1,g=(this.segmentsT+1)*(c-1)+d-1,j=(this.segmentsT+1)*(c-1)+d;this.faces.push(new THREE.Face4(e,f,g,j));this.faceVertexUvs[0].push([new THREE.UV(b[e][0],b[e][1]),new THREE.UV(b[f][0],b[f][1]),new THREE.UV(b[g][0],b[g][1]),new THREE.UV(b[j][0],b[j][1])])}delete b;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusGeometry.prototype=new THREE.Geometry;
@@ -474,50 +474,50 @@ Math.LN2));b.image.width=c;b.image.height=e;b.image.getContext("2d").drawImage(t
 g.map.wrapT=THREE.RepeatWrapping;b.mapDiffuseOffset&&g.map.offset.set(b.mapDiffuseOffset[0],b.mapDiffuseOffset[1]);e(g.map,c+"/"+b.mapDiffuse)}else if(b.colorDiffuse)j=(b.colorDiffuse[0]*255<<16)+(b.colorDiffuse[1]*255<<8)+b.colorDiffuse[2]*255,g.color=j,g.opacity=b.transparency;else if(b.DbgColor)g.color=b.DbgColor;if(b.mapLight&&c){j=document.createElement("canvas");g.lightMap=new THREE.Texture(j);g.lightMap.sourceFile=b.mapLight;if(b.mapLightmapRepeat)g.lightMap.repeat.set(b.mapLightRepeat[0],
 g.map.wrapT=THREE.RepeatWrapping;b.mapDiffuseOffset&&g.map.offset.set(b.mapDiffuseOffset[0],b.mapDiffuseOffset[1]);e(g.map,c+"/"+b.mapDiffuse)}else if(b.colorDiffuse)j=(b.colorDiffuse[0]*255<<16)+(b.colorDiffuse[1]*255<<8)+b.colorDiffuse[2]*255,g.color=j,g.opacity=b.transparency;else if(b.DbgColor)g.color=b.DbgColor;if(b.mapLight&&c){j=document.createElement("canvas");g.lightMap=new THREE.Texture(j);g.lightMap.sourceFile=b.mapLight;if(b.mapLightmapRepeat)g.lightMap.repeat.set(b.mapLightRepeat[0],
 b.mapLightRepeat[1]),g.lightMap.wrapS=g.lightMap.wrapT=THREE.RepeatWrapping;b.mapLightmapOffset&&g.lightMap.offset.set(b.mapLightmapOffset[0],b.mapLightmapOffset[1]);e(g.lightMap,c+"/"+b.mapLightmap)}return new THREE[f](g)}};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;
 b.mapLightRepeat[1]),g.lightMap.wrapS=g.lightMap.wrapT=THREE.RepeatWrapping;b.mapLightmapOffset&&g.lightMap.offset.set(b.mapLightmapOffset[0],b.mapLightmapOffset[1]);e(g.lightMap,c+"/"+b.mapLightmap)}return new THREE[f](g)}};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,d=b.model,e=b.callback,f=b.texture_path?b.texture_path:this.extractUrlbase(d),b=new Worker(d);b.onmessage=function(b){c.createModel(b.data,e,f);c.onLoadComplete()};this.onLoadStart();b.postMessage((new Date).getTime())};
 THREE.JSONLoader.prototype.load=function(b){var c=this,d=b.model,e=b.callback,f=b.texture_path?b.texture_path:this.extractUrlbase(d),b=new Worker(d);b.onmessage=function(b){c.createModel(b.data,e,f);c.onLoadComplete()};this.onLoadStart();b.postMessage((new Date).getTime())};
-THREE.JSONLoader.prototype.createModel=function(b,c,d){var e=new THREE.Geometry,f=b.scale!==void 0?1/b.scale:1;this.init_materials(e,b.materials,d);(function(c){if(b.version===void 0||b.version!=2)console.error("Deprecated file format.");else{var d,f,m,o,n,p,t,u,v,z,A,y,F,x,D=b.faces;p=b.vertices;var G=b.normals,B=b.colors,Q=0;for(d=0;d<b.uvs.length;d++)b.uvs[d].length&&Q++;for(d=0;d<Q;d++)e.faceUvs[d]=[],e.faceVertexUvs[d]=[];o=0;for(n=p.length;o<n;)t=new THREE.Vertex,t.position.x=p[o++]*c,t.position.y=
-p[o++]*c,t.position.z=p[o++]*c,e.vertices.push(t);o=0;for(n=D.length;o<n;){c=D[o++];p=c&1;m=c&2;d=c&4;f=c&8;u=c&16;t=c&32;z=c&64;c&=128;p?(A=new THREE.Face4,A.a=D[o++],A.b=D[o++],A.c=D[o++],A.d=D[o++],p=4):(A=new THREE.Face3,A.a=D[o++],A.b=D[o++],A.c=D[o++],p=3);if(m)m=D[o++],A.materials=e.materials[m];m=e.faces.length;if(d)for(d=0;d<Q;d++)y=b.uvs[d],v=D[o++],x=y[v*2],v=y[v*2+1],e.faceUvs[d][m]=new THREE.UV(x,v);if(f)for(d=0;d<Q;d++){y=b.uvs[d];F=[];for(f=0;f<p;f++)v=D[o++],x=y[v*2],v=y[v*2+1],F[f]=
-new THREE.UV(x,v);e.faceVertexUvs[d][m]=F}if(u)u=D[o++]*3,f=new THREE.Vector3,f.x=G[u++],f.y=G[u++],f.z=G[u],A.normal=f;if(t)for(d=0;d<p;d++)u=D[o++]*3,f=new THREE.Vector3,f.x=G[u++],f.y=G[u++],f.z=G[u],A.vertexNormals.push(f);if(z)t=D[o++],t=new THREE.Color(B[t]),A.color=t;if(c)for(d=0;d<p;d++)t=D[o++],t=new THREE.Color(B[t]),A.vertexColors.push(t);e.faces.push(A)}}})(f);(function(){var c,d,f,m;if(b.skinWeights){c=0;for(d=b.skinWeights.length;c<d;c+=2)f=b.skinWeights[c],m=b.skinWeights[c+1],e.skinWeights.push(new THREE.Vector4(f,
+THREE.JSONLoader.prototype.createModel=function(b,c,d){var e=new THREE.Geometry,f=b.scale!==void 0?1/b.scale:1;this.init_materials(e,b.materials,d);(function(c){if(b.version===void 0||b.version!=2)console.error("Deprecated file format.");else{var d,f,m,o,n,p,t,u,v,z,A,x,F,y,D=b.faces;p=b.vertices;var G=b.normals,B=b.colors,Q=0;for(d=0;d<b.uvs.length;d++)b.uvs[d].length&&Q++;for(d=0;d<Q;d++)e.faceUvs[d]=[],e.faceVertexUvs[d]=[];o=0;for(n=p.length;o<n;)t=new THREE.Vertex,t.position.x=p[o++]*c,t.position.y=
+p[o++]*c,t.position.z=p[o++]*c,e.vertices.push(t);o=0;for(n=D.length;o<n;){c=D[o++];p=c&1;m=c&2;d=c&4;f=c&8;u=c&16;t=c&32;z=c&64;c&=128;p?(A=new THREE.Face4,A.a=D[o++],A.b=D[o++],A.c=D[o++],A.d=D[o++],p=4):(A=new THREE.Face3,A.a=D[o++],A.b=D[o++],A.c=D[o++],p=3);if(m)m=D[o++],A.materials=e.materials[m];m=e.faces.length;if(d)for(d=0;d<Q;d++)x=b.uvs[d],v=D[o++],y=x[v*2],v=x[v*2+1],e.faceUvs[d][m]=new THREE.UV(y,v);if(f)for(d=0;d<Q;d++){x=b.uvs[d];F=[];for(f=0;f<p;f++)v=D[o++],y=x[v*2],v=x[v*2+1],F[f]=
+new THREE.UV(y,v);e.faceVertexUvs[d][m]=F}if(u)u=D[o++]*3,f=new THREE.Vector3,f.x=G[u++],f.y=G[u++],f.z=G[u],A.normal=f;if(t)for(d=0;d<p;d++)u=D[o++]*3,f=new THREE.Vector3,f.x=G[u++],f.y=G[u++],f.z=G[u],A.vertexNormals.push(f);if(z)t=D[o++],t=new THREE.Color(B[t]),A.color=t;if(c)for(d=0;d<p;d++)t=D[o++],t=new THREE.Color(B[t]),A.vertexColors.push(t);e.faces.push(A)}}})(f);(function(){var c,d,f,m;if(b.skinWeights){c=0;for(d=b.skinWeights.length;c<d;c+=2)f=b.skinWeights[c],m=b.skinWeights[c+1],e.skinWeights.push(new THREE.Vector4(f,
 m,0,0))}if(b.skinIndices){c=0;for(d=b.skinIndices.length;c<d;c+=2)f=b.skinIndices[c],m=b.skinIndices[c+1],e.skinIndices.push(new THREE.Vector4(f,m,0,0))}e.bones=b.bones;e.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var d,f,m,o,n,p,t,u,v;d=0;for(f=b.morphTargets.length;d<f;d++){e.morphTargets[d]={};e.morphTargets[d].name=b.morphTargets[d].name;e.morphTargets[d].vertices=[];u=e.morphTargets[d].vertices;v=b.morphTargets[d].vertices;m=0;for(o=v.length;m<o;m+=3)n=v[m]*c,p=v[m+1]*
 m,0,0))}if(b.skinIndices){c=0;for(d=b.skinIndices.length;c<d;c+=2)f=b.skinIndices[c],m=b.skinIndices[c+1],e.skinIndices.push(new THREE.Vector4(f,m,0,0))}e.bones=b.bones;e.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var d,f,m,o,n,p,t,u,v;d=0;for(f=b.morphTargets.length;d<f;d++){e.morphTargets[d]={};e.morphTargets[d].name=b.morphTargets[d].name;e.morphTargets[d].vertices=[];u=e.morphTargets[d].vertices;v=b.morphTargets[d].vertices;m=0;for(o=v.length;m<o;m+=3)n=v[m]*c,p=v[m+1]*
 c,t=v[m+2]*c,u.push(new THREE.Vertex(new THREE.Vector3(n,p,t)))}}if(b.morphColors!==void 0){d=0;for(f=b.morphColors.length;d<f;d++){e.morphColors[d]={};e.morphColors[d].name=b.morphColors[d].name;e.morphColors[d].colors=[];o=e.morphColors[d].colors;n=b.morphColors[d].colors;c=0;for(m=n.length;c<m;c+=3)p=new THREE.Color(16755200),p.setRGB(n[c],n[c+1],n[c+2]),o.push(p)}}})(f);(function(){if(b.edges!==void 0){var c,d,f;for(c=0;c<b.edges.length;c+=2)d=b.edges[c],f=b.edges[c+1],e.edges.push(new THREE.Edge(e.vertices[d],
 c,t=v[m+2]*c,u.push(new THREE.Vertex(new THREE.Vector3(n,p,t)))}}if(b.morphColors!==void 0){d=0;for(f=b.morphColors.length;d<f;d++){e.morphColors[d]={};e.morphColors[d].name=b.morphColors[d].name;e.morphColors[d].colors=[];o=e.morphColors[d].colors;n=b.morphColors[d].colors;c=0;for(m=n.length;c<m;c+=3)p=new THREE.Color(16755200),p.setRGB(n[c],n[c+1],n[c+2]),o.push(p)}}})(f);(function(){if(b.edges!==void 0){var c,d,f;for(c=0;c<b.edges.length;c+=2)d=b.edges[c],f=b.edges[c+1],e.edges.push(new THREE.Edge(e.vertices[d],
 e.vertices[f],d,f))}})();e.computeCentroids();e.computeFaceNormals();c(e)};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;
 e.vertices[f],d,f))}})();e.computeCentroids();e.computeFaceNormals();c(e)};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
 THREE.BinaryLoader.prototype={load:function(b){var c=b.model,d=b.callback,e=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(c),f=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(c),b=(new Date).getTime(),c=new Worker(c),g=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,d,f,e,g)};c.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};
 THREE.BinaryLoader.prototype={load:function(b){var c=b.model,d=b.callback,e=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(c),f=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(c),b=(new Date).getTime(),c=new Worker(c),g=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,d,f,e,g)};c.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};
 c.postMessage(b)},loadAjaxBuffers:function(b,c,d,e,f,g){var j=new XMLHttpRequest,k=e+"/"+b,m=0;j.onreadystatechange=function(){j.readyState==4?j.status==200||j.status==0?THREE.BinaryLoader.prototype.createBinModel(j.responseText,d,f,c):alert("Couldn't load ["+k+"] ["+j.status+"]"):j.readyState==3?g&&(m==0&&(m=j.getResponseHeader("Content-Length")),g({total:m,loaded:j.responseText.length})):j.readyState==2&&(m=j.getResponseHeader("Content-Length"))};j.open("GET",k,!0);j.overrideMimeType("text/plain; charset=x-user-defined");
 c.postMessage(b)},loadAjaxBuffers:function(b,c,d,e,f,g){var j=new XMLHttpRequest,k=e+"/"+b,m=0;j.onreadystatechange=function(){j.readyState==4?j.status==200||j.status==0?THREE.BinaryLoader.prototype.createBinModel(j.responseText,d,f,c):alert("Couldn't load ["+k+"] ["+j.status+"]"):j.readyState==3?g&&(m==0&&(m=j.getResponseHeader("Content-Length")),g({total:m,loaded:j.responseText.length})):j.readyState==2&&(m=j.getResponseHeader("Content-Length"))};j.open("GET",k,!0);j.overrideMimeType("text/plain; charset=x-user-defined");
 j.setRequestHeader("Content-Type","text/plain");j.send(null)},createBinModel:function(b,c,d,e){var f=function(c){function d(b,c){var e=n(b,c),f=n(b,c+1),g=n(b,c+2),h=n(b,c+3),j=(h<<1&255|g>>7)-127;e|=(g&127)<<16|f<<8;if(e==0&&j==-127)return 0;return(1-2*(h>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,j)}function f(b,c){var d=n(b,c),e=n(b,c+1),g=n(b,c+2);return(n(b,c+3)<<24)+(g<<16)+(e<<8)+d}function m(b,c){var d=n(b,c);return(n(b,c+1)<<8)+d}function o(b,c){var d=n(b,c);return d>127?d-256:d}function n(b,
 j.setRequestHeader("Content-Type","text/plain");j.send(null)},createBinModel:function(b,c,d,e){var f=function(c){function d(b,c){var e=n(b,c),f=n(b,c+1),g=n(b,c+2),h=n(b,c+3),j=(h<<1&255|g>>7)-127;e|=(g&127)<<16|f<<8;if(e==0&&j==-127)return 0;return(1-2*(h>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,j)}function f(b,c){var d=n(b,c),e=n(b,c+1),g=n(b,c+2);return(n(b,c+3)<<24)+(g<<16)+(e<<8)+d}function m(b,c){var d=n(b,c);return(n(b,c+1)<<8)+d}function o(b,c){var d=n(b,c);return d>127?d-256:d}function n(b,
-c){return b.charCodeAt(c)&255}function p(c){var d,e,g;d=f(b,c);e=f(b,c+B);g=f(b,c+Q);c=m(b,c+K);THREE.BinaryLoader.prototype.f3(y,d,e,g,c)}function t(c){var d,e,g,h,j,n;d=f(b,c);e=f(b,c+B);g=f(b,c+Q);h=m(b,c+K);j=f(b,c+L);n=f(b,c+E);c=f(b,c+M);THREE.BinaryLoader.prototype.f3n(y,D,d,e,g,h,j,n,c)}function u(c){var d,e,g,j;d=f(b,c);e=f(b,c+U);g=f(b,c+h);j=f(b,c+R);c=m(b,c+S);THREE.BinaryLoader.prototype.f4(y,d,e,g,j,c)}function v(c){var d,e,g,j,n,o,p,t;d=f(b,c);e=f(b,c+U);g=f(b,c+h);j=f(b,c+R);n=m(b,
-c+S);o=f(b,c+O);p=f(b,c+aa);t=f(b,c+V);c=f(b,c+W);THREE.BinaryLoader.prototype.f4n(y,D,d,e,g,j,n,o,p,t,c)}function z(c){var d,e;d=f(b,c);e=f(b,c+ga);c=f(b,c+Y);THREE.BinaryLoader.prototype.uv3(y.faceVertexUvs[0],G[d*2],G[d*2+1],G[e*2],G[e*2+1],G[c*2],G[c*2+1])}function A(c){var d,e,g;d=f(b,c);e=f(b,c+da);g=f(b,c+ea);c=f(b,c+ka);THREE.BinaryLoader.prototype.uv4(y.faceVertexUvs[0],G[d*2],G[d*2+1],G[e*2],G[e*2+1],G[g*2],G[g*2+1],G[c*2],G[c*2+1])}var y=this,F=0,x,D=[],G=[],B,Q,K,L,E,M,U,h,R,S,O,aa,V,
-W,ga,Y,da,ea,ka,fa,I,T,Z,$,ia;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(y,e,c);x={signature:b.substr(F,8),header_bytes:n(b,F+8),vertex_coordinate_bytes:n(b,F+9),normal_coordinate_bytes:n(b,F+10),uv_coordinate_bytes:n(b,F+11),vertex_index_bytes:n(b,F+12),normal_index_bytes:n(b,F+13),uv_index_bytes:n(b,F+14),material_index_bytes:n(b,F+15),nvertices:f(b,F+16),nnormals:f(b,F+16+4),nuvs:f(b,F+16+8),ntri_flat:f(b,F+16+12),ntri_smooth:f(b,F+16+16),ntri_flat_uv:f(b,F+16+20),ntri_smooth_uv:f(b,
-F+16+24),nquad_flat:f(b,F+16+28),nquad_smooth:f(b,F+16+32),nquad_flat_uv:f(b,F+16+36),nquad_smooth_uv:f(b,F+16+40)};F+=x.header_bytes;B=x.vertex_index_bytes;Q=x.vertex_index_bytes*2;K=x.vertex_index_bytes*3;L=x.vertex_index_bytes*3+x.material_index_bytes;E=x.vertex_index_bytes*3+x.material_index_bytes+x.normal_index_bytes;M=x.vertex_index_bytes*3+x.material_index_bytes+x.normal_index_bytes*2;U=x.vertex_index_bytes;h=x.vertex_index_bytes*2;R=x.vertex_index_bytes*3;S=x.vertex_index_bytes*4;O=x.vertex_index_bytes*
-4+x.material_index_bytes;aa=x.vertex_index_bytes*4+x.material_index_bytes+x.normal_index_bytes;V=x.vertex_index_bytes*4+x.material_index_bytes+x.normal_index_bytes*2;W=x.vertex_index_bytes*4+x.material_index_bytes+x.normal_index_bytes*3;ga=x.uv_index_bytes;Y=x.uv_index_bytes*2;da=x.uv_index_bytes;ea=x.uv_index_bytes*2;ka=x.uv_index_bytes*3;c=x.vertex_index_bytes*3+x.material_index_bytes;ia=x.vertex_index_bytes*4+x.material_index_bytes;fa=x.ntri_flat*c;I=x.ntri_smooth*(c+x.normal_index_bytes*3);T=
-x.ntri_flat_uv*(c+x.uv_index_bytes*3);Z=x.ntri_smooth_uv*(c+x.normal_index_bytes*3+x.uv_index_bytes*3);$=x.nquad_flat*ia;c=x.nquad_smooth*(ia+x.normal_index_bytes*4);ia=x.nquad_flat_uv*(ia+x.uv_index_bytes*4);F+=function(c){for(var e,f,g,h=x.vertex_coordinate_bytes*3,k=c+x.nvertices*h;c<k;c+=h)e=d(b,c),f=d(b,c+x.vertex_coordinate_bytes),g=d(b,c+x.vertex_coordinate_bytes*2),THREE.BinaryLoader.prototype.v(y,e,f,g);return x.nvertices*h}(F);F+=function(c){for(var d,e,f,g=x.normal_coordinate_bytes*3,h=
-c+x.nnormals*g;c<h;c+=g)d=o(b,c),e=o(b,c+x.normal_coordinate_bytes),f=o(b,c+x.normal_coordinate_bytes*2),D.push(d/127,e/127,f/127);return x.nnormals*g}(F);F+=function(c){for(var e,f,g=x.uv_coordinate_bytes*2,h=c+x.nuvs*g;c<h;c+=g)e=d(b,c),f=d(b,c+x.uv_coordinate_bytes),G.push(e,f);return x.nuvs*g}(F);fa=F+fa;I=fa+I;T=I+T;Z=T+Z;$=Z+$;c=$+c;ia=c+ia;(function(b){var c,d=x.vertex_index_bytes*3+x.material_index_bytes,e=d+x.uv_index_bytes*3,f=b+x.ntri_flat_uv*e;for(c=b;c<f;c+=e)p(c),z(c+d);return f-b})(I);
-(function(b){var c,d=x.vertex_index_bytes*3+x.material_index_bytes+x.normal_index_bytes*3,e=d+x.uv_index_bytes*3,f=b+x.ntri_smooth_uv*e;for(c=b;c<f;c+=e)t(c),z(c+d);return f-b})(T);(function(b){var c,d=x.vertex_index_bytes*4+x.material_index_bytes,e=d+x.uv_index_bytes*4,f=b+x.nquad_flat_uv*e;for(c=b;c<f;c+=e)u(c),A(c+d);return f-b})(c);(function(b){var c,d=x.vertex_index_bytes*4+x.material_index_bytes+x.normal_index_bytes*4,e=d+x.uv_index_bytes*4,f=b+x.nquad_smooth_uv*e;for(c=b;c<f;c+=e)v(c),A(c+
-d);return f-b})(ia);(function(b){var c,d=x.vertex_index_bytes*3+x.material_index_bytes,e=b+x.ntri_flat*d;for(c=b;c<e;c+=d)p(c);return e-b})(F);(function(b){var c,d=x.vertex_index_bytes*3+x.material_index_bytes+x.normal_index_bytes*3,e=b+x.ntri_smooth*d;for(c=b;c<e;c+=d)t(c);return e-b})(fa);(function(b){var c,d=x.vertex_index_bytes*4+x.material_index_bytes,e=b+x.nquad_flat*d;for(c=b;c<e;c+=d)u(c);return e-b})(Z);(function(b){var c,d=x.vertex_index_bytes*4+x.material_index_bytes+x.normal_index_bytes*
-4,e=b+x.nquad_smooth*d;for(c=b;c<e;c+=d)v(c);return e-b})($);this.computeCentroids();this.computeFaceNormals()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;c(new f(d))},v:function(b,c,d,e){b.vertices.push(new THREE.Vertex(new THREE.Vector3(c,d,e)))},f3:function(b,c,d,e,f){b.faces.push(new THREE.Face3(c,d,e,null,null,b.materials[f]))},f4:function(b,c,d,e,f,g){b.faces.push(new THREE.Face4(c,d,e,f,null,null,b.materials[g]))},f3n:function(b,c,d,e,f,g,j,k,m){var g=b.materials[g],o=c[k*3],
+c){return b.charCodeAt(c)&255}function p(c){var d,e,g;d=f(b,c);e=f(b,c+B);g=f(b,c+Q);c=m(b,c+K);THREE.BinaryLoader.prototype.f3(x,d,e,g,c)}function t(c){var d,e,g,h,j,o;d=f(b,c);e=f(b,c+B);g=f(b,c+Q);h=m(b,c+K);j=f(b,c+L);o=f(b,c+E);c=f(b,c+N);THREE.BinaryLoader.prototype.f3n(x,D,d,e,g,h,j,o,c)}function u(c){var d,e,g,j;d=f(b,c);e=f(b,c+U);g=f(b,c+h);j=f(b,c+R);c=m(b,c+S);THREE.BinaryLoader.prototype.f4(x,d,e,g,j,c)}function v(c){var d,e,g,j,o,n,p,t;d=f(b,c);e=f(b,c+U);g=f(b,c+h);j=f(b,c+R);o=m(b,
+c+S);n=f(b,c+O);p=f(b,c+aa);t=f(b,c+V);c=f(b,c+W);THREE.BinaryLoader.prototype.f4n(x,D,d,e,g,j,o,n,p,t,c)}function z(c){var d,e;d=f(b,c);e=f(b,c+ga);c=f(b,c+Y);THREE.BinaryLoader.prototype.uv3(x.faceVertexUvs[0],G[d*2],G[d*2+1],G[e*2],G[e*2+1],G[c*2],G[c*2+1])}function A(c){var d,e,g;d=f(b,c);e=f(b,c+da);g=f(b,c+ea);c=f(b,c+ka);THREE.BinaryLoader.prototype.uv4(x.faceVertexUvs[0],G[d*2],G[d*2+1],G[e*2],G[e*2+1],G[g*2],G[g*2+1],G[c*2],G[c*2+1])}var x=this,F=0,y,D=[],G=[],B,Q,K,L,E,N,U,h,R,S,O,aa,V,
+W,ga,Y,da,ea,ka,fa,I,T,Z,$,ia;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(x,e,c);y={signature:b.substr(F,8),header_bytes:n(b,F+8),vertex_coordinate_bytes:n(b,F+9),normal_coordinate_bytes:n(b,F+10),uv_coordinate_bytes:n(b,F+11),vertex_index_bytes:n(b,F+12),normal_index_bytes:n(b,F+13),uv_index_bytes:n(b,F+14),material_index_bytes:n(b,F+15),nvertices:f(b,F+16),nnormals:f(b,F+16+4),nuvs:f(b,F+16+8),ntri_flat:f(b,F+16+12),ntri_smooth:f(b,F+16+16),ntri_flat_uv:f(b,F+16+20),ntri_smooth_uv:f(b,
+F+16+24),nquad_flat:f(b,F+16+28),nquad_smooth:f(b,F+16+32),nquad_flat_uv:f(b,F+16+36),nquad_smooth_uv:f(b,F+16+40)};F+=y.header_bytes;B=y.vertex_index_bytes;Q=y.vertex_index_bytes*2;K=y.vertex_index_bytes*3;L=y.vertex_index_bytes*3+y.material_index_bytes;E=y.vertex_index_bytes*3+y.material_index_bytes+y.normal_index_bytes;N=y.vertex_index_bytes*3+y.material_index_bytes+y.normal_index_bytes*2;U=y.vertex_index_bytes;h=y.vertex_index_bytes*2;R=y.vertex_index_bytes*3;S=y.vertex_index_bytes*4;O=y.vertex_index_bytes*
+4+y.material_index_bytes;aa=y.vertex_index_bytes*4+y.material_index_bytes+y.normal_index_bytes;V=y.vertex_index_bytes*4+y.material_index_bytes+y.normal_index_bytes*2;W=y.vertex_index_bytes*4+y.material_index_bytes+y.normal_index_bytes*3;ga=y.uv_index_bytes;Y=y.uv_index_bytes*2;da=y.uv_index_bytes;ea=y.uv_index_bytes*2;ka=y.uv_index_bytes*3;c=y.vertex_index_bytes*3+y.material_index_bytes;ia=y.vertex_index_bytes*4+y.material_index_bytes;fa=y.ntri_flat*c;I=y.ntri_smooth*(c+y.normal_index_bytes*3);T=
+y.ntri_flat_uv*(c+y.uv_index_bytes*3);Z=y.ntri_smooth_uv*(c+y.normal_index_bytes*3+y.uv_index_bytes*3);$=y.nquad_flat*ia;c=y.nquad_smooth*(ia+y.normal_index_bytes*4);ia=y.nquad_flat_uv*(ia+y.uv_index_bytes*4);F+=function(c){for(var e,f,g,h=y.vertex_coordinate_bytes*3,k=c+y.nvertices*h;c<k;c+=h)e=d(b,c),f=d(b,c+y.vertex_coordinate_bytes),g=d(b,c+y.vertex_coordinate_bytes*2),THREE.BinaryLoader.prototype.v(x,e,f,g);return y.nvertices*h}(F);F+=function(c){for(var d,e,f,g=y.normal_coordinate_bytes*3,h=
+c+y.nnormals*g;c<h;c+=g)d=o(b,c),e=o(b,c+y.normal_coordinate_bytes),f=o(b,c+y.normal_coordinate_bytes*2),D.push(d/127,e/127,f/127);return y.nnormals*g}(F);F+=function(c){for(var e,f,g=y.uv_coordinate_bytes*2,h=c+y.nuvs*g;c<h;c+=g)e=d(b,c),f=d(b,c+y.uv_coordinate_bytes),G.push(e,f);return y.nuvs*g}(F);fa=F+fa;I=fa+I;T=I+T;Z=T+Z;$=Z+$;c=$+c;ia=c+ia;(function(b){var c,d=y.vertex_index_bytes*3+y.material_index_bytes,e=d+y.uv_index_bytes*3,f=b+y.ntri_flat_uv*e;for(c=b;c<f;c+=e)p(c),z(c+d);return f-b})(I);
+(function(b){var c,d=y.vertex_index_bytes*3+y.material_index_bytes+y.normal_index_bytes*3,e=d+y.uv_index_bytes*3,f=b+y.ntri_smooth_uv*e;for(c=b;c<f;c+=e)t(c),z(c+d);return f-b})(T);(function(b){var c,d=y.vertex_index_bytes*4+y.material_index_bytes,e=d+y.uv_index_bytes*4,f=b+y.nquad_flat_uv*e;for(c=b;c<f;c+=e)u(c),A(c+d);return f-b})(c);(function(b){var c,d=y.vertex_index_bytes*4+y.material_index_bytes+y.normal_index_bytes*4,e=d+y.uv_index_bytes*4,f=b+y.nquad_smooth_uv*e;for(c=b;c<f;c+=e)v(c),A(c+
+d);return f-b})(ia);(function(b){var c,d=y.vertex_index_bytes*3+y.material_index_bytes,e=b+y.ntri_flat*d;for(c=b;c<e;c+=d)p(c);return e-b})(F);(function(b){var c,d=y.vertex_index_bytes*3+y.material_index_bytes+y.normal_index_bytes*3,e=b+y.ntri_smooth*d;for(c=b;c<e;c+=d)t(c);return e-b})(fa);(function(b){var c,d=y.vertex_index_bytes*4+y.material_index_bytes,e=b+y.nquad_flat*d;for(c=b;c<e;c+=d)u(c);return e-b})(Z);(function(b){var c,d=y.vertex_index_bytes*4+y.material_index_bytes+y.normal_index_bytes*
+4,e=b+y.nquad_smooth*d;for(c=b;c<e;c+=d)v(c);return e-b})($);this.computeCentroids();this.computeFaceNormals()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;c(new f(d))},v:function(b,c,d,e){b.vertices.push(new THREE.Vertex(new THREE.Vector3(c,d,e)))},f3:function(b,c,d,e,f){b.faces.push(new THREE.Face3(c,d,e,null,null,b.materials[f]))},f4:function(b,c,d,e,f,g){b.faces.push(new THREE.Face4(c,d,e,f,null,null,b.materials[g]))},f3n:function(b,c,d,e,f,g,j,k,m){var g=b.materials[g],o=c[k*3],
 n=c[k*3+1],k=c[k*3+2],p=c[m*3],t=c[m*3+1],m=c[m*3+2];b.faces.push(new THREE.Face3(d,e,f,[new THREE.Vector3(c[j*3],c[j*3+1],c[j*3+2]),new THREE.Vector3(o,n,k),new THREE.Vector3(p,t,m)],null,g))},f4n:function(b,c,d,e,f,g,j,k,m,o,n){var j=b.materials[j],p=c[m*3],t=c[m*3+1],m=c[m*3+2],u=c[o*3],v=c[o*3+1],o=c[o*3+2],z=c[n*3],A=c[n*3+1],n=c[n*3+2];b.faces.push(new THREE.Face4(d,e,f,g,[new THREE.Vector3(c[k*3],c[k*3+1],c[k*3+2]),new THREE.Vector3(p,t,m),new THREE.Vector3(u,v,o),new THREE.Vector3(z,A,n)],
 n=c[k*3+1],k=c[k*3+2],p=c[m*3],t=c[m*3+1],m=c[m*3+2];b.faces.push(new THREE.Face3(d,e,f,[new THREE.Vector3(c[j*3],c[j*3+1],c[j*3+2]),new THREE.Vector3(o,n,k),new THREE.Vector3(p,t,m)],null,g))},f4n:function(b,c,d,e,f,g,j,k,m,o,n){var j=b.materials[j],p=c[m*3],t=c[m*3+1],m=c[m*3+2],u=c[o*3],v=c[o*3+1],o=c[o*3+2],z=c[n*3],A=c[n*3+1],n=c[n*3+2];b.faces.push(new THREE.Face4(d,e,f,g,[new THREE.Vector3(c[k*3],c[k*3+1],c[k*3+2]),new THREE.Vector3(p,t,m),new THREE.Vector3(u,v,o),new THREE.Vector3(z,A,n)],
 null,j))},uv3:function(b,c,d,e,f,g,j){var k=[];k.push(new THREE.UV(c,d));k.push(new THREE.UV(e,f));k.push(new THREE.UV(g,j));b.push(k)},uv4:function(b,c,d,e,f,g,j,k,m){var o=[];o.push(new THREE.UV(c,d));o.push(new THREE.UV(e,f));o.push(new THREE.UV(g,j));o.push(new THREE.UV(k,m));b.push(o)}};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
 null,j))},uv3:function(b,c,d,e,f,g,j){var k=[];k.push(new THREE.UV(c,d));k.push(new THREE.UV(e,f));k.push(new THREE.UV(g,j));b.push(k)},uv4:function(b,c,d,e,f,g,j,k,m){var o=[];o.push(new THREE.UV(c,d));o.push(new THREE.UV(e,f));o.push(new THREE.UV(g,j));o.push(new THREE.UV(k,m));b.push(o)}};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 d=this,e=new Worker(b);e.postMessage(0);var f=THREE.Loader.prototype.extractUrlbase(b);e.onmessage=function(b){function e(b,c){return c=="relativeToHTML"?b:f+"/"+b}function k(){for(u in E.objects)if(!O.objects[u])if(F=E.objects[u],F.geometry!==void 0){if(B=O.geometries[F.geometry]){L=[];for(W=0;W<F.materials.length;W++)L[W]=O.materials[F.materials[W]];x=F.position;r=F.rotation;q=F.quaternion;s=F.scale;q=0;L.length==0&&(L[0]=new THREE.MeshFaceMaterial);
-L.length>1&&(L=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(B,L);object.name=u;object.position.set(x[0],x[1],x[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=F.visible;O.scene.addObject(object);O.objects[u]=object;if(F.meshCollider){var b=THREE.CollisionUtils.MeshColliderWBox(object);O.scene.collisions.colliders.push(b)}if(F.castsShadow)b=new THREE.ShadowVolume(B),O.scene.addChild(b),
-b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},O.triggers[object.name]=b)}}else x=F.position,r=F.rotation,q=F.quaternion,s=F.scale,q=0,object=new THREE.Object3D,object.name=u,object.position.set(x[0],x[1],x[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=F.visible!==void 0?F.visible:!1,O.scene.addObject(object),
-O.objects[u]=object,O.empties[u]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},O.triggers[object.name]=b)}function m(b){return function(c){O.geometries[b]=c;k();U-=1;d.onLoadComplete();n()}}function o(b){return function(c){O.geometries[b]=c}}function n(){d.callbackProgress({totalModels:R,totalTextures:S,loadedModels:R-U,loadedTextures:S-h},O);d.onLoadProgress();U==0&&h==0&&c(O)}var p,t,u,v,z,A,y,F,x,D,G,B,Q,K,L,E,M,U,h,R,S,O;E=b.data;b=new THREE.BinaryLoader;M=new THREE.JSONLoader;
+THREE.SceneLoader.prototype={load:function(b,c){var d=this,e=new Worker(b);e.postMessage(0);var f=THREE.Loader.prototype.extractUrlbase(b);e.onmessage=function(b){function e(b,c){return c=="relativeToHTML"?b:f+"/"+b}function k(){for(u in E.objects)if(!O.objects[u])if(F=E.objects[u],F.geometry!==void 0){if(B=O.geometries[F.geometry]){L=[];for(W=0;W<F.materials.length;W++)L[W]=O.materials[F.materials[W]];y=F.position;r=F.rotation;q=F.quaternion;s=F.scale;q=0;L.length==0&&(L[0]=new THREE.MeshFaceMaterial);
+L.length>1&&(L=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(B,L);object.name=u;object.position.set(y[0],y[1],y[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=F.visible;O.scene.addObject(object);O.objects[u]=object;if(F.meshCollider){var b=THREE.CollisionUtils.MeshColliderWBox(object);O.scene.collisions.colliders.push(b)}if(F.castsShadow)b=new THREE.ShadowVolume(B),O.scene.addChild(b),
+b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},O.triggers[object.name]=b)}}else y=F.position,r=F.rotation,q=F.quaternion,s=F.scale,q=0,object=new THREE.Object3D,object.name=u,object.position.set(y[0],y[1],y[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=F.visible!==void 0?F.visible:!1,O.scene.addObject(object),
+O.objects[u]=object,O.empties[u]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},O.triggers[object.name]=b)}function m(b){return function(c){O.geometries[b]=c;k();U-=1;d.onLoadComplete();n()}}function o(b){return function(c){O.geometries[b]=c}}function n(){d.callbackProgress({totalModels:R,totalTextures:S,loadedModels:R-U,loadedTextures:S-h},O);d.onLoadProgress();U==0&&h==0&&c(O)}var p,t,u,v,z,A,x,F,y,D,G,B,Q,K,L,E,N,U,h,R,S,O;E=b.data;b=new THREE.BinaryLoader;N=new THREE.JSONLoader;
 h=U=0;O={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};var aa=!1;for(u in E.objects)if(F=E.objects[u],F.meshCollider){aa=!0;break}if(aa)O.scene.collisions=new THREE.CollisionSystem;if(E.transform){aa=E.transform.position;D=E.transform.rotation;var V=E.transform.scale;aa&&O.scene.position.set(aa[0],aa[1],aa[2]);D&&O.scene.rotation.set(D[0],D[1],D[2]);V&&O.scene.scale.set(V[0],V[1],V[2]);(aa||D||V)&&O.scene.updateMatrix()}aa=
 h=U=0;O={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};var aa=!1;for(u in E.objects)if(F=E.objects[u],F.meshCollider){aa=!0;break}if(aa)O.scene.collisions=new THREE.CollisionSystem;if(E.transform){aa=E.transform.position;D=E.transform.rotation;var V=E.transform.scale;aa&&O.scene.position.set(aa[0],aa[1],aa[2]);D&&O.scene.rotation.set(D[0],D[1],D[2]);V&&O.scene.scale.set(V[0],V[1],V[2]);(aa||D||V)&&O.scene.updateMatrix()}aa=
-function(){h-=1;n();d.onLoadComplete()};for(z in E.cameras){D=E.cameras[z];if(D.type=="perspective")Q=new THREE.Camera(D.fov,D.aspect,D.near,D.far);else if(D.type=="ortho")Q=new THREE.Camera,Q.projectionMatrix=THREE.Matrix4.makeOrtho(D.left,D.right,D.top,D.bottom,D.near,D.far);x=D.position;D=D.target;Q.position.set(x[0],x[1],x[2]);Q.target.position.set(D[0],D[1],D[2]);O.cameras[z]=Q}for(v in E.lights){z=E.lights[v];Q=z.color!==void 0?z.color:16777215;D=z.intensity!==void 0?z.intensity:1;if(z.type==
-"directional")x=z.direction,light=new THREE.DirectionalLight(Q,D),light.position.set(x[0],x[1],x[2]),light.position.normalize();else if(z.type=="point")x=z.position,light=new THREE.PointLight(Q,D),light.position.set(x[0],x[1],x[2]);O.scene.addLight(light);O.lights[v]=light}for(A in E.fogs)v=E.fogs[A],v.type=="linear"?K=new THREE.Fog(0,v.near,v.far):v.type=="exp2"&&(K=new THREE.FogExp2(0,v.density)),D=v.color,K.color.setRGB(D[0],D[1],D[2]),O.fogs[A]=K;if(O.cameras&&E.defaults.camera)O.currentCamera=
+function(){h-=1;n();d.onLoadComplete()};for(z in E.cameras){D=E.cameras[z];if(D.type=="perspective")Q=new THREE.Camera(D.fov,D.aspect,D.near,D.far);else if(D.type=="ortho")Q=new THREE.Camera,Q.projectionMatrix=THREE.Matrix4.makeOrtho(D.left,D.right,D.top,D.bottom,D.near,D.far);y=D.position;D=D.target;Q.position.set(y[0],y[1],y[2]);Q.target.position.set(D[0],D[1],D[2]);O.cameras[z]=Q}for(v in E.lights){z=E.lights[v];Q=z.color!==void 0?z.color:16777215;D=z.intensity!==void 0?z.intensity:1;if(z.type==
+"directional")y=z.direction,light=new THREE.DirectionalLight(Q,D),light.position.set(y[0],y[1],y[2]),light.position.normalize();else if(z.type=="point")y=z.position,light=new THREE.PointLight(Q,D),light.position.set(y[0],y[1],y[2]);O.scene.addLight(light);O.lights[v]=light}for(A in E.fogs)v=E.fogs[A],v.type=="linear"?K=new THREE.Fog(0,v.near,v.far):v.type=="exp2"&&(K=new THREE.FogExp2(0,v.density)),D=v.color,K.color.setRGB(D[0],D[1],D[2]),O.fogs[A]=K;if(O.cameras&&E.defaults.camera)O.currentCamera=
 O.cameras[E.defaults.camera];if(O.fogs&&E.defaults.fog)O.scene.fog=O.fogs[E.defaults.fog];D=E.defaults.bgcolor;O.bgColor=new THREE.Color;O.bgColor.setRGB(D[0],D[1],D[2]);O.bgColorAlpha=E.defaults.bgalpha;for(p in E.geometries)if(A=E.geometries[p],A.type=="bin_mesh"||A.type=="ascii_mesh")U+=1,d.onLoadStart();R=U;for(p in E.geometries)A=E.geometries[p],A.type=="cube"?(B=new THREE.CubeGeometry(A.width,A.height,A.depth,A.segmentsWidth,A.segmentsHeight,A.segmentsDepth,null,A.flipped,A.sides),O.geometries[p]=
 O.cameras[E.defaults.camera];if(O.fogs&&E.defaults.fog)O.scene.fog=O.fogs[E.defaults.fog];D=E.defaults.bgcolor;O.bgColor=new THREE.Color;O.bgColor.setRGB(D[0],D[1],D[2]);O.bgColorAlpha=E.defaults.bgalpha;for(p in E.geometries)if(A=E.geometries[p],A.type=="bin_mesh"||A.type=="ascii_mesh")U+=1,d.onLoadStart();R=U;for(p in E.geometries)A=E.geometries[p],A.type=="cube"?(B=new THREE.CubeGeometry(A.width,A.height,A.depth,A.segmentsWidth,A.segmentsHeight,A.segmentsDepth,null,A.flipped,A.sides),O.geometries[p]=
 B):A.type=="plane"?(B=new THREE.PlaneGeometry(A.width,A.height,A.segmentsWidth,A.segmentsHeight),O.geometries[p]=B):A.type=="sphere"?(B=new THREE.SphereGeometry(A.radius,A.segmentsWidth,A.segmentsHeight),O.geometries[p]=B):A.type=="cylinder"?(B=new THREE.CylinderGeometry(A.numSegs,A.topRad,A.botRad,A.height,A.topOffset,A.botOffset),O.geometries[p]=B):A.type=="torus"?(B=new THREE.TorusGeometry(A.radius,A.tube,A.segmentsR,A.segmentsT),O.geometries[p]=B):A.type=="icosahedron"?(B=new THREE.IcosahedronGeometry(A.subdivisions),
 B):A.type=="plane"?(B=new THREE.PlaneGeometry(A.width,A.height,A.segmentsWidth,A.segmentsHeight),O.geometries[p]=B):A.type=="sphere"?(B=new THREE.SphereGeometry(A.radius,A.segmentsWidth,A.segmentsHeight),O.geometries[p]=B):A.type=="cylinder"?(B=new THREE.CylinderGeometry(A.numSegs,A.topRad,A.botRad,A.height,A.topOffset,A.botOffset),O.geometries[p]=B):A.type=="torus"?(B=new THREE.TorusGeometry(A.radius,A.tube,A.segmentsR,A.segmentsT),O.geometries[p]=B):A.type=="icosahedron"?(B=new THREE.IcosahedronGeometry(A.subdivisions),
-O.geometries[p]=B):A.type=="bin_mesh"?b.load({model:e(A.url,E.urlBaseType),callback:m(p)}):A.type=="ascii_mesh"?M.load({model:e(A.url,E.urlBaseType),callback:m(p)}):A.type=="embedded_mesh"&&(A=E.embeds[A.id])&&M.createModel(A,o(p),"");for(y in E.textures)if(p=E.textures[y],p.url instanceof Array){h+=p.url.length;for(b=0;b<p.url.length;b++)d.onLoadStart()}else h+=1,d.onLoadStart();S=h;for(y in E.textures){p=E.textures[y];if(p.mapping!=void 0&&THREE[p.mapping]!=void 0)p.mapping=new THREE[p.mapping];
-if(p.url instanceof Array){for(var b=[],W=0;W<p.url.length;W++)b[W]=e(p.url[W],E.urlBaseType);b=THREE.ImageUtils.loadTextureCube(b,p.mapping,aa)}else{b=THREE.ImageUtils.loadTexture(e(p.url,E.urlBaseType),p.mapping,aa);if(THREE[p.minFilter]!=void 0)b.minFilter=THREE[p.minFilter];if(THREE[p.magFilter]!=void 0)b.magFilter=THREE[p.magFilter];if(p.repeat)b.repeat.set(p.repeat[0],p.repeat[1]),b.wrapS=b.wrapT=THREE.RepeatWrapping}O.textures[y]=b}for(t in E.materials){y=E.materials[t];for(G in y.parameters)if(G==
-"envMap"||G=="map"||G=="lightMap")y.parameters[G]=O.textures[y.parameters[G]];else if(G=="shading")y.parameters[G]=y.parameters[G]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(G=="blending")y.parameters[G]=THREE[y.parameters[G]]?THREE[y.parameters[G]]:THREE.NormalBlending;else if(G=="combine")y.parameters[G]=y.parameters[G]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(G=="vertexColors")if(y.parameters[G]=="face")y.parameters[G]=THREE.FaceColors;else if(y.parameters[G])y.parameters[G]=
-THREE.VertexColors;if(y.parameters.opacity!==void 0&&y.parameters.opacity<1)y.parameters.transparent=!0;y=new THREE[y.type](y.parameters);O.materials[t]=y}k();d.callbackSync(O)}}};
+O.geometries[p]=B):A.type=="bin_mesh"?b.load({model:e(A.url,E.urlBaseType),callback:m(p)}):A.type=="ascii_mesh"?N.load({model:e(A.url,E.urlBaseType),callback:m(p)}):A.type=="embedded_mesh"&&(A=E.embeds[A.id])&&N.createModel(A,o(p),"");for(x in E.textures)if(p=E.textures[x],p.url instanceof Array){h+=p.url.length;for(b=0;b<p.url.length;b++)d.onLoadStart()}else h+=1,d.onLoadStart();S=h;for(x in E.textures){p=E.textures[x];if(p.mapping!=void 0&&THREE[p.mapping]!=void 0)p.mapping=new THREE[p.mapping];
+if(p.url instanceof Array){for(var b=[],W=0;W<p.url.length;W++)b[W]=e(p.url[W],E.urlBaseType);b=THREE.ImageUtils.loadTextureCube(b,p.mapping,aa)}else{b=THREE.ImageUtils.loadTexture(e(p.url,E.urlBaseType),p.mapping,aa);if(THREE[p.minFilter]!=void 0)b.minFilter=THREE[p.minFilter];if(THREE[p.magFilter]!=void 0)b.magFilter=THREE[p.magFilter];if(p.repeat)b.repeat.set(p.repeat[0],p.repeat[1]),b.wrapS=b.wrapT=THREE.RepeatWrapping}O.textures[x]=b}for(t in E.materials){x=E.materials[t];for(G in x.parameters)if(G==
+"envMap"||G=="map"||G=="lightMap")x.parameters[G]=O.textures[x.parameters[G]];else if(G=="shading")x.parameters[G]=x.parameters[G]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(G=="blending")x.parameters[G]=THREE[x.parameters[G]]?THREE[x.parameters[G]]:THREE.NormalBlending;else if(G=="combine")x.parameters[G]=x.parameters[G]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(G=="vertexColors")if(x.parameters[G]=="face")x.parameters[G]=THREE.FaceColors;else if(x.parameters[G])x.parameters[G]=
+THREE.VertexColors;if(x.parameters.opacity!==void 0&&x.parameters.opacity<1)x.parameters.transparent=!0;x=new THREE[x.type](x.parameters);O.materials[t]=x}k();d.callbackSync(O)}}};
 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,f){return b+(c-b)*f};this.VIntX=function(b,c,f,g,j,k,m,o,n,p){j=(j-n)/(p-n);n=this.normal_cache;c[g]=k+j*this.delta;c[g+1]=m;c[g+2]=o;f[g]=this.lerp(n[b],n[b+3],j);f[g+1]=this.lerp(n[b+1],n[b+4],j);f[g+2]=this.lerp(n[b+2],n[b+5],j)};this.VIntY=function(b,c,f,g,j,k,m,o,n,p){j=(j-n)/(p-n);n=this.normal_cache;c[g]=k;c[g+1]=m+j*this.delta;c[g+
 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,f){return b+(c-b)*f};this.VIntX=function(b,c,f,g,j,k,m,o,n,p){j=(j-n)/(p-n);n=this.normal_cache;c[g]=k+j*this.delta;c[g+1]=m;c[g+2]=o;f[g]=this.lerp(n[b],n[b+3],j);f[g+1]=this.lerp(n[b+1],n[b+4],j);f[g+2]=this.lerp(n[b+2],n[b+5],j)};this.VIntY=function(b,c,f,g,j,k,m,o,n,p){j=(j-n)/(p-n);n=this.normal_cache;c[g]=k;c[g+1]=m+j*this.delta;c[g+
 2]=o;c=b+this.yd*3;f[g]=this.lerp(n[b],n[c],j);f[g+1]=this.lerp(n[b+1],n[c+1],j);f[g+2]=this.lerp(n[b+2],n[c+2],j)};this.VIntZ=function(b,c,f,g,j,k,m,o,n,p){j=(j-n)/(p-n);n=this.normal_cache;c[g]=k;c[g+1]=m;c[g+2]=o+j*this.delta;c=b+this.zd*3;f[g]=this.lerp(n[b],n[c],j);f[g+1]=this.lerp(n[b+1],n[c+1],j);f[g+2]=this.lerp(n[b+2],n[c+2],j)};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+
 2]=o;c=b+this.yd*3;f[g]=this.lerp(n[b],n[c],j);f[g+1]=this.lerp(n[b+1],n[c+1],j);f[g+2]=this.lerp(n[b+2],n[c+2],j)};this.VIntZ=function(b,c,f,g,j,k,m,o,n,p){j=(j-n)/(p-n);n=this.normal_cache;c[g]=k;c[g+1]=m;c[g+2]=o+j*this.delta;c=b+this.zd*3;f[g]=this.lerp(n[b],n[c],j);f[g+1]=this.lerp(n[b+1],n[c+1],j);f[g+2]=this.lerp(n[b+2],n[c+2],j)};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,f,g,j,k){var m=g+1,o=g+this.yd,n=g+this.zd,p=m+this.yd,t=m+this.zd,u=g+this.yd+this.zd,v=m+this.yd+this.zd,z=0,A=this.field[g],y=this.field[m],F=this.field[o],x=this.field[p],D=this.field[n],G=this.field[t],B=this.field[u],Q=this.field[v];A<j&&(z|=1);y<j&&(z|=2);F<j&&(z|=8);x<j&&(z|=4);D<j&&(z|=16);G<j&&(z|=32);B<j&&(z|=128);Q<j&&(z|=64);var K=THREE.edgeTable[z];if(K==0)return 0;var L=this.delta,
-E=b+L,M=c+L,L=f+L;K&1&&(this.compNorm(g),this.compNorm(m),this.VIntX(g*3,this.vlist,this.nlist,0,j,b,c,f,A,y));K&2&&(this.compNorm(m),this.compNorm(p),this.VIntY(m*3,this.vlist,this.nlist,3,j,E,c,f,y,x));K&4&&(this.compNorm(o),this.compNorm(p),this.VIntX(o*3,this.vlist,this.nlist,6,j,b,M,f,F,x));K&8&&(this.compNorm(g),this.compNorm(o),this.VIntY(g*3,this.vlist,this.nlist,9,j,b,c,f,A,F));K&16&&(this.compNorm(n),this.compNorm(t),this.VIntX(n*3,this.vlist,this.nlist,12,j,b,c,L,D,G));K&32&&(this.compNorm(t),
-this.compNorm(v),this.VIntY(t*3,this.vlist,this.nlist,15,j,E,c,L,G,Q));K&64&&(this.compNorm(u),this.compNorm(v),this.VIntX(u*3,this.vlist,this.nlist,18,j,b,M,L,B,Q));K&128&&(this.compNorm(n),this.compNorm(u),this.VIntY(n*3,this.vlist,this.nlist,21,j,b,c,L,D,B));K&256&&(this.compNorm(g),this.compNorm(n),this.VIntZ(g*3,this.vlist,this.nlist,24,j,b,c,f,A,D));K&512&&(this.compNorm(m),this.compNorm(t),this.VIntZ(m*3,this.vlist,this.nlist,27,j,E,c,f,y,G));K&1024&&(this.compNorm(p),this.compNorm(v),this.VIntZ(p*
-3,this.vlist,this.nlist,30,j,E,M,f,x,Q));K&2048&&(this.compNorm(o),this.compNorm(u),this.VIntZ(o*3,this.vlist,this.nlist,33,j,b,M,f,F,B));z<<=4;for(j=g=0;THREE.triTable[z+j]!=-1;)b=z+j,c=b+1,f=b+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[c],3*THREE.triTable[f],k),j+=3,g++;return g};this.posnormtriv=function(b,c,f,g,j,k){var m=this.count*3;this.positionArray[m]=b[f];this.positionArray[m+1]=b[f+1];this.positionArray[m+2]=b[f+2];this.positionArray[m+3]=b[g];this.positionArray[m+
+this.yd],this.normal_cache[c+2]=this.field[b-this.zd]-this.field[b+this.zd])};this.polygonize=function(b,c,f,g,j,k){var m=g+1,o=g+this.yd,n=g+this.zd,p=m+this.yd,t=m+this.zd,u=g+this.yd+this.zd,v=m+this.yd+this.zd,z=0,A=this.field[g],x=this.field[m],F=this.field[o],y=this.field[p],D=this.field[n],G=this.field[t],B=this.field[u],Q=this.field[v];A<j&&(z|=1);x<j&&(z|=2);F<j&&(z|=8);y<j&&(z|=4);D<j&&(z|=16);G<j&&(z|=32);B<j&&(z|=128);Q<j&&(z|=64);var K=THREE.edgeTable[z];if(K==0)return 0;var L=this.delta,
+E=b+L,N=c+L,L=f+L;K&1&&(this.compNorm(g),this.compNorm(m),this.VIntX(g*3,this.vlist,this.nlist,0,j,b,c,f,A,x));K&2&&(this.compNorm(m),this.compNorm(p),this.VIntY(m*3,this.vlist,this.nlist,3,j,E,c,f,x,y));K&4&&(this.compNorm(o),this.compNorm(p),this.VIntX(o*3,this.vlist,this.nlist,6,j,b,N,f,F,y));K&8&&(this.compNorm(g),this.compNorm(o),this.VIntY(g*3,this.vlist,this.nlist,9,j,b,c,f,A,F));K&16&&(this.compNorm(n),this.compNorm(t),this.VIntX(n*3,this.vlist,this.nlist,12,j,b,c,L,D,G));K&32&&(this.compNorm(t),
+this.compNorm(v),this.VIntY(t*3,this.vlist,this.nlist,15,j,E,c,L,G,Q));K&64&&(this.compNorm(u),this.compNorm(v),this.VIntX(u*3,this.vlist,this.nlist,18,j,b,N,L,B,Q));K&128&&(this.compNorm(n),this.compNorm(u),this.VIntY(n*3,this.vlist,this.nlist,21,j,b,c,L,D,B));K&256&&(this.compNorm(g),this.compNorm(n),this.VIntZ(g*3,this.vlist,this.nlist,24,j,b,c,f,A,D));K&512&&(this.compNorm(m),this.compNorm(t),this.VIntZ(m*3,this.vlist,this.nlist,27,j,E,c,f,x,G));K&1024&&(this.compNorm(p),this.compNorm(v),this.VIntZ(p*
+3,this.vlist,this.nlist,30,j,E,N,f,y,Q));K&2048&&(this.compNorm(o),this.compNorm(u),this.VIntZ(o*3,this.vlist,this.nlist,33,j,b,N,f,F,B));z<<=4;for(j=g=0;THREE.triTable[z+j]!=-1;)b=z+j,c=b+1,f=b+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[c],3*THREE.triTable[f],k),j+=3,g++;return g};this.posnormtriv=function(b,c,f,g,j,k){var m=this.count*3;this.positionArray[m]=b[f];this.positionArray[m+1]=b[f+1];this.positionArray[m+2]=b[f+2];this.positionArray[m+3]=b[g];this.positionArray[m+
 4]=b[g+1];this.positionArray[m+5]=b[g+2];this.positionArray[m+6]=b[j];this.positionArray[m+7]=b[j+1];this.positionArray[m+8]=b[j+2];this.normalArray[m]=c[f];this.normalArray[m+1]=c[f+1];this.normalArray[m+2]=c[f+2];this.normalArray[m+3]=c[g];this.normalArray[m+4]=c[g+1];this.normalArray[m+5]=c[g+2];this.normalArray[m+6]=c[j];this.normalArray[m+7]=c[j+1];this.normalArray[m+8]=c[j+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&k(this)};this.begin=function(){this.count=0;
 4]=b[g+1];this.positionArray[m+5]=b[g+2];this.positionArray[m+6]=b[j];this.positionArray[m+7]=b[j+1];this.positionArray[m+8]=b[j+2];this.normalArray[m]=c[f];this.normalArray[m+1]=c[f+1];this.normalArray[m+2]=c[f+2];this.normalArray[m+3]=c[g];this.normalArray[m+4]=c[g+1];this.normalArray[m+5]=c[g+2];this.normalArray[m+6]=c[j];this.normalArray[m+7]=c[j+1];this.normalArray[m+8]=c[j+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&k(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,f,g,j){var k=this.size*Math.sqrt(g/j),m=f*this.size,o=c*this.size,n=b*this.size,p=Math.floor(m-k);p<1&&(p=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var t=Math.floor(o-k);t<1&&(t=1);o=Math.floor(o+k);o>this.size-1&&(o=this.size-1);var u=Math.floor(n-k);u<1&&(u=1);k=Math.floor(n+k);k>this.size-1&&(k=this.size-
 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,f,g,j){var k=this.size*Math.sqrt(g/j),m=f*this.size,o=c*this.size,n=b*this.size,p=Math.floor(m-k);p<1&&(p=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var t=Math.floor(o-k);t<1&&(t=1);o=Math.floor(o+k);o>this.size-1&&(o=this.size-1);var u=Math.floor(n-k);u<1&&(u=1);k=Math.floor(n+k);k>this.size-1&&(k=this.size-
-1);for(var v,z,A,y,F,x;p<m;p++){n=this.size2*p;z=p/this.size-f;F=z*z;for(z=t;z<o;z++){A=n+this.size*z;v=z/this.size-c;x=v*v;for(v=u;v<k;v++)y=v/this.size-b,y=g/(1.0E-6+y*y+x+F)-j,y>0&&(this.field[A+v]+=y)}}};this.addPlaneX=function(b,c){var f,g,j,k,m,o=this.size,n=this.yd,p=this.zd,t=this.field,u=o*Math.sqrt(b/c);u>o&&(u=o);for(f=0;f<u;f++)if(g=f/o,g*=g,k=b/(1.0E-4+g)-c,k>0)for(g=0;g<o;g++){m=f+g*n;for(j=0;j<o;j++)t[p*j+m]+=k}};this.addPlaneY=function(b,c){var f,g,j,k,m,o,n=this.size,p=this.yd,t=
+1);for(var v,z,A,x,F,y;p<m;p++){n=this.size2*p;z=p/this.size-f;F=z*z;for(z=t;z<o;z++){A=n+this.size*z;v=z/this.size-c;y=v*v;for(v=u;v<k;v++)x=v/this.size-b,x=g/(1.0E-6+x*x+y+F)-j,x>0&&(this.field[A+v]+=x)}}};this.addPlaneX=function(b,c){var f,g,j,k,m,o=this.size,n=this.yd,p=this.zd,t=this.field,u=o*Math.sqrt(b/c);u>o&&(u=o);for(f=0;f<u;f++)if(g=f/o,g*=g,k=b/(1.0E-4+g)-c,k>0)for(g=0;g<o;g++){m=f+g*n;for(j=0;j<o;j++)t[p*j+m]+=k}};this.addPlaneY=function(b,c){var f,g,j,k,m,o,n=this.size,p=this.yd,t=
 this.zd,u=this.field,v=n*Math.sqrt(b/c);v>n&&(v=n);for(g=0;g<v;g++)if(f=g/n,f*=f,k=b/(1.0E-4+f)-c,k>0){m=g*p;for(f=0;f<n;f++){o=m+f;for(j=0;j<n;j++)u[t*j+o]+=k}}};this.addPlaneZ=function(b,c){var f,g,j,k,m,o;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/c);dist>size&&(dist=size);for(j=0;j<dist;j++)if(f=j/size,f*=f,k=b/(1.0E-4+f)-c,k>0){m=zd*j;for(g=0;g<size;g++){o=m+g*yd;for(f=0;f<size;f++)field[o+f]+=k}}};this.reset=function(){var b;for(b=0;b<this.size3;b++)this.normal_cache[b*
 this.zd,u=this.field,v=n*Math.sqrt(b/c);v>n&&(v=n);for(g=0;g<v;g++)if(f=g/n,f*=f,k=b/(1.0E-4+f)-c,k>0){m=g*p;for(f=0;f<n;f++){o=m+f;for(j=0;j<n;j++)u[t*j+o]+=k}}};this.addPlaneZ=function(b,c){var f,g,j,k,m,o;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/c);dist>size&&(dist=size);for(j=0;j<dist;j++)if(f=j/size,f*=f,k=b/(1.0E-4+f)-c,k>0){m=zd*j;for(g=0;g<size;g++){o=m+g*yd;for(f=0;f<size;f++)field[o+f]+=k}}};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,f,g,j,k,m,o,n,p,t=this.size-2;for(j=1;j<t;j++){p=this.size2*j;o=(j-this.halfsize)/this.halfsize;for(g=1;g<t;g++){n=p+this.size*g;m=(g-this.halfsize)/this.halfsize;for(f=1;f<t;f++)k=(f-this.halfsize)/this.halfsize,c=n+f,this.polygonize(k,m,o,c,this.isolation,b)}}this.end(b)};this.generateGeometry=function(){var b=0,c=new THREE.Geometry,f=[];this.render(function(g){var j,k,m,o,n,p,t,u;for(j=0;j<g.count;j++)t=j*3,n=t+1,u=t+2,k=g.positionArray[t],
 3]=0,this.field[b]=0};this.render=function(b){this.begin();var c,f,g,j,k,m,o,n,p,t=this.size-2;for(j=1;j<t;j++){p=this.size2*j;o=(j-this.halfsize)/this.halfsize;for(g=1;g<t;g++){n=p+this.size*g;m=(g-this.halfsize)/this.halfsize;for(f=1;f<t;f++)k=(f-this.halfsize)/this.halfsize,c=n+f,this.polygonize(k,m,o,c,this.isolation,b)}}this.end(b)};this.generateGeometry=function(){var b=0,c=new THREE.Geometry,f=[];this.render(function(g){var j,k,m,o,n,p,t,u;for(j=0;j<g.count;j++)t=j*3,n=t+1,u=t+2,k=g.positionArray[t],
 m=g.positionArray[n],o=g.positionArray[u],p=new THREE.Vector3(k,m,o),k=g.normalArray[t],m=g.normalArray[n],o=g.normalArray[u],t=new THREE.Vector3(k,m,o),t.normalize(),n=new THREE.Vertex(p),c.vertices.push(n),f.push(t);nfaces=g.count/3;for(j=0;j<nfaces;j++)t=(b+j)*3,n=t+1,u=t+2,p=f[t],k=f[n],m=f[u],t=new THREE.Face3(t,n,u,[p,k,m]),c.faces.push(t);b+=nfaces;g.count=0});return c};this.init(b)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
 m=g.positionArray[n],o=g.positionArray[u],p=new THREE.Vector3(k,m,o),k=g.normalArray[t],m=g.normalArray[n],o=g.normalArray[u],t=new THREE.Vector3(k,m,o),t.normalize(),n=new THREE.Vertex(p),c.vertices.push(n),f.push(t);nfaces=g.count/3;for(j=0;j<nfaces;j++)t=(b+j)*3,n=t+1,u=t+2,p=f[t],k=f[n],m=f[u],t=new THREE.Face3(t,n,u,[p,k,m]),c.faces.push(t);b+=nfaces;g.count=0});return c};this.init(b)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
@@ -563,8 +563,9 @@ e;if(d<c.min.z||d>c.max.z)return Number.MAX_VALUE;c.normal.set(0,k,0);break;case
 THREE.CollisionSystem.prototype.raySphere=function(b,c){var d=c.center.clone().subSelf(b.origin);if(d.lengthSq<c.radiusSq)return-1;var e=d.dot(b.direction.clone());if(e<=0)return Number.MAX_VALUE;d=c.radiusSq-(d.lengthSq()-e*e);if(d>=0)return Math.abs(e)-Math.sqrt(d);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 d=c.center.clone().subSelf(b.origin);if(d.lengthSq<c.radiusSq)return-1;var e=d.dot(b.direction.clone());if(e<=0)return Number.MAX_VALUE;d=c.radiusSq-(d.lengthSq()-e*e);if(d>=0)return Math.abs(e)-Math.sqrt(d);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,d=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]),d=new THREE.BoxCollider(d,c);d.mesh=b;return d};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,d=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]),d=new THREE.BoxCollider(d,c);d.mesh=b;return d};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,d=this.setSize,e=this.render,f=new THREE.Camera,g=new THREE.Camera,b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},j=new THREE.WebGLRenderTarget(512,512,b),k=new THREE.WebGLRenderTarget(512,512,b),m=new THREE.Camera(53,1,1,1E4);m.position.z=2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:j},mapRight:{type:"t",value:1,
-texture:k}},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 o=
-new THREE.Scene;o.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,e){d.call(c,b,e);j.width=b;j.height=e;k.width=b;k.height=e};this.render=function(b,d){f.projectionMatrix=d.projectionMatrix;f.position.copy(d.position);f.target.position.copy(d.target.position);f.translateX(-10);g.projectionMatrix=d.projectionMatrix;g.position.copy(d.position);g.target.position.copy(d.target.position);g.translateX(10);e.call(c,b,f,j,!0);e.call(c,b,g,k,!0);e.call(c,o,m)}};
+if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,d=this.setSize,e=this.render,f=new THREE.Camera,g=new THREE.Camera,j=new THREE.Matrix4,k=new THREE.Matrix4,m,o,n;f.useTarget=g.useTarget=!1;f.matrixAutoUpdate=g.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},p=new THREE.WebGLRenderTarget(512,512,b),t=new THREE.WebGLRenderTarget(512,512,b),u=new THREE.Camera(53,1,1,1E4);u.position.z=
+2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:p},mapRight:{type:"t",value:1,texture:t}},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 v=new THREE.Scene;v.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,e){d.call(c,b,e);p.width=b;p.height=e;t.width=b;t.height=e};this.render=function(b,d){d.update(null,!0);if(m!==d.aspect||o!==d.near||n!==d.fov){m=d.aspect;o=d.near;n=d.fov;var x=d.projectionMatrix.clone(),F=125/30*0.5,y=F*o/125,D=o*Math.tan(n*Math.PI/360),G;j.n14=F;k.n14=-F;F=-D*m+y;G=D*m+y;x.n11=2*o/(G-F);x.n13=(G+F)/(G-F);f.projectionMatrix=x.clone();F=-D*m-y;G=D*m-y;x.n11=2*o/(G-F);
+x.n13=(G+F)/(G-F);g.projectionMatrix=x.clone()}f.matrix=d.matrixWorld.clone().multiplySelf(k);f.update(null,!0);f.position.copy(d.position);f.near=o;f.far=d.far;e.call(c,b,f,p,!0);g.matrix=d.matrixWorld.clone().multiplySelf(j);g.update(null,!0);g.position.copy(d.position);g.near=o;g.far=d.far;e.call(c,b,g,t,!0);e.call(c,v,u)}};
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,d=this.setSize,e=this.render,f,g,j=new THREE.Camera,k=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,e){d.call(c,b,e);f=b/2;g=e};this.render=function(b,d){this.clear();j.fov=d.fov;j.aspect=0.5*d.aspect;j.near=d.near;j.far=d.far;
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,d=this.setSize,e=this.render,f,g,j=new THREE.Camera,k=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,e){d.call(c,b,e);f=b/2;g=e};this.render=function(b,d){this.clear();j.fov=d.fov;j.aspect=0.5*d.aspect;j.near=d.near;j.far=d.far;
 j.updateProjectionMatrix();j.position.copy(d.position);j.target.position.copy(d.target.position);j.translateX(c.separation);k.projectionMatrix=j.projectionMatrix;k.position.copy(d.position);k.target.position.copy(d.target.position);k.translateX(-c.separation);this.setViewport(0,0,f,g);e.call(c,b,j);this.setViewport(f,0,f,g);e.call(c,b,k,!1)}};
 j.updateProjectionMatrix();j.position.copy(d.position);j.target.position.copy(d.target.position);j.translateX(c.separation);k.projectionMatrix=j.projectionMatrix;k.position.copy(d.position);k.target.position.copy(d.target.position);k.translateX(-c.separation);this.setViewport(0,0,f,g);e.call(c,b,j);this.setViewport(f,0,f,g);e.call(c,b,k,!1)}};

+ 1 - 1
build/custom/ThreeCanvas.js

@@ -51,7 +51,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
 d;this.z=a.z*d;this.w=Math.cos(c);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 a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
 d;this.z=a.z*d;this.w=Math.cos(c);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 a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
 multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,j=this.w,k=j*c+f*e-h*d,m=
 multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,j=this.w,k=j*c+f*e-h*d,m=
 j*d+h*c-g*e,p=j*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=k*j+c*-g+m*-h-p*-f;b.y=m*j+c*-f+p*-g-k*-h;b.z=p*j+c*-h+k*-f-m*-g;return b}};
 j*d+h*c-g*e,p=j*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=k*j+c*-g+m*-h-p*-f;b.y=m*j+c*-f+p*-g-k*-h;b.z=p*j+c*-h+k*-f-m*-g;return b}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.001)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
 THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};

+ 1 - 1
build/custom/ThreeDOM.js

@@ -51,7 +51,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
 d;this.z=a.z*d;this.w=Math.cos(c);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 a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
 d;this.z=a.z*d;this.w=Math.cos(c);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 a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
 multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,i=this.w,k=i*c+f*e-h*d,l=
 multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,i=this.w,k=i*c+f*e-h*d,l=
 i*d+h*c-g*e,n=i*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=k*i+c*-g+l*-h-n*-f;b.y=l*i+c*-f+n*-g-k*-h;b.z=n*i+c*-h+k*-f-l*-g;return b}};
 i*d+h*c-g*e,n=i*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=k*i+c*-g+l*-h-n*-f;b.y=l*i+c*-f+n*-g-k*-h;b.z=n*i+c*-h+k*-f-l*-g;return b}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.001)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
 THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=d||2E3;this.target=e||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.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=d||2E3;this.target=e||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;

+ 62 - 61
build/custom/ThreeExtras.js

@@ -1,8 +1,8 @@
 // ThreeExtras.js r41/ROME - http://github.com/mrdoob/three.js
 // ThreeExtras.js r41/ROME - http://github.com/mrdoob/three.js
 THREE.ColorUtils={adjustHSV:function(a,b,c,d){var e=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,e);e.h=THREE.ColorUtils.clamp(e.h+b,0,1);e.s=THREE.ColorUtils.clamp(e.s+c,0,1);e.v=THREE.ColorUtils.clamp(e.v+d,0,1);a.setHSV(e.h,e.s,e.v)},rgbToHsv:function(a,b){var c=a.r,d=a.g,e=a.b,f=Math.max(Math.max(c,d),e),g=Math.min(Math.min(c,d),e);if(g==f)g=c=0;else{var j=f-g,g=j/f,c=c==f?(d-e)/j:d==f?2+(e-c)/j:4+(c-d)/j;c/=6;c<0&&(c+=1);c>1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=g;b.v=f;return b},
 THREE.ColorUtils={adjustHSV:function(a,b,c,d){var e=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,e);e.h=THREE.ColorUtils.clamp(e.h+b,0,1);e.s=THREE.ColorUtils.clamp(e.s+c,0,1);e.v=THREE.ColorUtils.clamp(e.v+d,0,1);a.setHSV(e.h,e.s,e.v)},rgbToHsv:function(a,b){var c=a.r,d=a.g,e=a.b,f=Math.max(Math.max(c,d),e),g=Math.min(Math.min(c,d),e);if(g==f)g=c=0;else{var j=f-g,g=j/f,c=c==f?(d-e)/j:d==f?2+(e-c)/j:4+(c-d)/j;c/=6;c<0&&(c+=1);c>1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=g;b.v=f;return b},
 clamp:function(a,b,c){return a<b?b:a>c?c:a}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
 clamp:function(a,b,c){return a<b?b:a>c?c:a}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
-var GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,d=a.vertices.length,e=c?b.geometry:b,f=a.vertices,g=e.vertices,j=a.faces,h=e.faces,k=a.faceVertexUvs[0],e=e.faceVertexUvs[0];c&&b.matrixAutoUpdate&&b.updateMatrix();for(var l=0,m=g.length;l<m;l++){var n=new THREE.Vertex(g[l].position.clone());c&&b.matrix.multiplyVector3(n.position);f.push(n)}l=0;for(m=h.length;l<m;l++){var g=h[l],o,u,t=g.vertexNormals,n=g.vertexColors;g instanceof THREE.Face3?o=new THREE.Face3(g.a+d,g.b+d,g.c+d):
-g instanceof THREE.Face4&&(o=new THREE.Face4(g.a+d,g.b+d,g.c+d,g.d+d));o.normal.copy(g.normal);c=0;for(f=t.length;c<f;c++)u=t[c],o.vertexNormals.push(u.clone());o.color.copy(g.color);c=0;for(f=n.length;c<f;c++)u=n[c],o.vertexColors.push(u.clone());o.materials=g.materials.slice();o.centroid.copy(g.centroid);j.push(o)}l=0;for(m=e.length;l<m;l++){d=e[l];j=[];c=0;for(f=d.length;c<f;c++)j.push(new THREE.UV(d[c].u,d[c].v));k.push(j)}}};
+var GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,d=a.vertices.length,e=c?b.geometry:b,f=a.vertices,g=e.vertices,j=a.faces,h=e.faces,k=a.faceVertexUvs[0],e=e.faceVertexUvs[0];c&&b.matrixAutoUpdate&&b.updateMatrix();for(var l=0,m=g.length;l<m;l++){var n=new THREE.Vertex(g[l].position.clone());c&&b.matrix.multiplyVector3(n.position);f.push(n)}l=0;for(m=h.length;l<m;l++){var g=h[l],o,t,u=g.vertexNormals,n=g.vertexColors;g instanceof THREE.Face3?o=new THREE.Face3(g.a+d,g.b+d,g.c+d):
+g instanceof THREE.Face4&&(o=new THREE.Face4(g.a+d,g.b+d,g.c+d,g.d+d));o.normal.copy(g.normal);c=0;for(f=u.length;c<f;c++)t=u[c],o.vertexNormals.push(t.clone());o.color.copy(g.color);c=0;for(f=n.length;c<f;c++)t=n[c],o.vertexColors.push(t.clone());o.materials=g.materials.slice();o.centroid.copy(g.centroid);j.push(o)}l=0;for(m=e.length;l<m;l++){d=e[l];j=[];c=0;for(f=d.length;c<f;c++)j.push(new THREE.UV(d[c].u,d[c].v));k.push(j)}}};
 THREE.ImageUtils={loadTexture:function(a,b,c){var d=new Image,e=new THREE.Texture(d,b);d.onload=function(){e.needsUpdate=!0;c&&c(this)};d.src=a;return e},loadTextureCube:function(a,b,c){var d,e=[],f=new THREE.Texture(e,b),b=e.loadCount=0;for(d=a.length;b<d;++b)e[b]=new Image,e[b].onload=function(){e.loadCount+=1;if(e.loadCount==6)f.needsUpdate=!0;c&&c(this)},e[b].src=a[b];return f}};
 THREE.ImageUtils={loadTexture:function(a,b,c){var d=new Image,e=new THREE.Texture(d,b);d.onload=function(){e.needsUpdate=!0;c&&c(this)};d.src=a;return e},loadTextureCube:function(a,b,c){var d,e=[],f=new THREE.Texture(e,b),b=e.loadCount=0;for(d=a.length;b<d;++b)e[b]=new Image,e[b].onload=function(){e.loadCount+=1;if(e.loadCount==6)f.needsUpdate=!0;c&&c(this)},e[b].src=a[b];return f}};
 THREE.SceneUtils={addMesh:function(a,b,c,d,e,f,g,j,h,k){b=new THREE.Mesh(b,k);b.scale.x=b.scale.y=b.scale.z=c;b.position.x=d;b.position.y=e;b.position.z=f;b.rotation.x=g;b.rotation.y=j;b.rotation.z=h;a.addObject(b);return b},addPanoramaCubeWebGL:function(a,b,c){var d=THREE.ShaderUtils.lib.cube;d.uniforms.tCube.texture=c;c=new THREE.MeshShaderMaterial({fragmentShader:d.fragmentShader,vertexShader:d.vertexShader,uniforms:d.uniforms});b=new THREE.Mesh(new THREE.CubeGeometry(b,b,b,1,1,1,null,!0),c);a.addObject(b);
 THREE.SceneUtils={addMesh:function(a,b,c,d,e,f,g,j,h,k){b=new THREE.Mesh(b,k);b.scale.x=b.scale.y=b.scale.z=c;b.position.x=d;b.position.y=e;b.position.z=f;b.rotation.x=g;b.rotation.y=j;b.rotation.z=h;a.addObject(b);return b},addPanoramaCubeWebGL:function(a,b,c){var d=THREE.ShaderUtils.lib.cube;d.uniforms.tCube.texture=c;c=new THREE.MeshShaderMaterial({fragmentShader:d.fragmentShader,vertexShader:d.vertexShader,uniforms:d.uniforms});b=new THREE.Mesh(new THREE.CubeGeometry(b,b,b,1,1,1,null,!0),c);a.addObject(b);
 return b},addPanoramaCube:function(a,b,c){var d=[];d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[0])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[1])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[2])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[3])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[4])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[5])}));b=new THREE.Mesh(new THREE.Cube(b,b,b,1,1,d,!0),
 return b},addPanoramaCube:function(a,b,c){var d=[];d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[0])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[1])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[2])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[3])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[4])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[5])}));b=new THREE.Mesh(new THREE.Cube(b,b,b,1,1,d,!0),
@@ -27,15 +27,15 @@ THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=
 THREE.Bone?e.skinMatrix:e.matrix;var f=e.animationCache.prevKey;e=e.animationCache.nextKey;f.pos=this.data.hierarchy[c].keys[0];f.rot=this.data.hierarchy[c].keys[0];f.scl=this.data.hierarchy[c].keys[0];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Bone?e.skinMatrix:e.matrix;var f=e.animationCache.prevKey;e=e.animationCache.nextKey;f.pos=this.data.hierarchy[c].keys[0];f.rot=this.data.hierarchy[c].keys[0];f.scl=this.data.hierarchy[c].keys[0];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,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 a=0;a<this.hierarchy.length;a++)if(this.hierarchy[a].animationCache!==void 0)this.hierarchy[a]instanceof THREE.Bone?this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix:this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix,delete this.hierarchy[a].animationCache};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(this.hierarchy[a].animationCache!==void 0)this.hierarchy[a]instanceof THREE.Bone?this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix:this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix,delete this.hierarchy[a].animationCache};
-THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,d,e,f,g,j,h,k,l=this.data.JIT.hierarchy,m,n;this.currentTime+=a*this.timeScale;n=this.currentTime;m=this.currentTime%=this.data.length;k=parseInt(Math.min(m*this.data.fps,this.data.length*this.data.fps),10);for(var o=0,u=this.hierarchy.length;o<u;o++)if(a=this.hierarchy[o],h=a.animationCache,this.JITCompile&&l[o][k]!==void 0)a instanceof THREE.Bone?(a.skinMatrix=l[o][k],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=
-!1):(a.matrix=l[o][k],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)a instanceof THREE.Bone?a.skinMatrix=a.animationCache.originalMatrix:a.matrix=a.animationCache.originalMatrix;for(var t=0;t<3;t++){c=b[t];g=h.prevKey[c];j=h.nextKey[c];if(j.time<=n){if(m<n)if(this.loop){g=this.data.hierarchy[o].keys[0];for(j=this.getNextKeyWith(c,o,1);j.time<m;)g=j,j=this.getNextKeyWith(c,o,j.index+1)}else{this.stop();return}else{do g=j,j=this.getNextKeyWith(c,o,j.index+1);while(j.time<
+THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,d,e,f,g,j,h,k,l=this.data.JIT.hierarchy,m,n;this.currentTime+=a*this.timeScale;n=this.currentTime;m=this.currentTime%=this.data.length;k=parseInt(Math.min(m*this.data.fps,this.data.length*this.data.fps),10);for(var o=0,t=this.hierarchy.length;o<t;o++)if(a=this.hierarchy[o],h=a.animationCache,this.JITCompile&&l[o][k]!==void 0)a instanceof THREE.Bone?(a.skinMatrix=l[o][k],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=
+!1):(a.matrix=l[o][k],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)a instanceof THREE.Bone?a.skinMatrix=a.animationCache.originalMatrix:a.matrix=a.animationCache.originalMatrix;for(var u=0;u<3;u++){c=b[u];g=h.prevKey[c];j=h.nextKey[c];if(j.time<=n){if(m<n)if(this.loop){g=this.data.hierarchy[o].keys[0];for(j=this.getNextKeyWith(c,o,1);j.time<m;)g=j,j=this.getNextKeyWith(c,o,j.index+1)}else{this.stop();return}else{do g=j,j=this.getNextKeyWith(c,o,j.index+1);while(j.time<
 m)}h.prevKey[c]=g;h.nextKey[c]=j}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;d=(m-g.time)/(j.time-g.time);e=g[c];f=j[c];if(d<0||d>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+o),d=d<0?0:1;if(c==="pos")if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+(f[2]-e[2])*d;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
 m)}h.prevKey[c]=g;h.nextKey[c]=j}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;d=(m-g.time)/(j.time-g.time);e=g[c];f=j[c];if(d<0||d>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+o),d=d<0?0:1;if(c==="pos")if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+(f[2]-e[2])*d;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
 this.getPrevKeyWith("pos",o,g.index-1).pos,this.points[1]=e,this.points[2]=f,this.points[3]=this.getNextKeyWith("pos",o,j.index+1).pos,d=d*0.33+0.33,e=this.interpolateCatmullRom(this.points,d),c.x=e[0],c.y=e[1],c.z=e[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)d=this.interpolateCatmullRom(this.points,d*1.01),this.target.set(d[0],d[1],d[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),d=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,d,0)}else if(c===
 this.getPrevKeyWith("pos",o,g.index-1).pos,this.points[1]=e,this.points[2]=f,this.points[3]=this.getNextKeyWith("pos",o,j.index+1).pos,d=d*0.33+0.33,e=this.interpolateCatmullRom(this.points,d),c.x=e[0],c.y=e[1],c.z=e[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)d=this.interpolateCatmullRom(this.points,d*1.01),this.target.set(d[0],d[1],d[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),d=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,d,0)}else if(c===
 "rot")THREE.Quaternion.slerp(e,f,a.quaternion,d);else if(c==="scl")c=a.scale,c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+(f[2]-e[2])*d}}if(this.JITCompile&&l[0][k]===void 0){this.hierarchy[0].update(void 0,!0);for(o=0;o<this.hierarchy.length;o++)l[o][k]=this.hierarchy[o]instanceof THREE.Bone?this.hierarchy[o].skinMatrix.clone():this.hierarchy[o].matrix.clone()}}};
 "rot")THREE.Quaternion.slerp(e,f,a.quaternion,d);else if(c==="scl")c=a.scale,c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+(f[2]-e[2])*d}}if(this.JITCompile&&l[0][k]===void 0){this.hierarchy[0].update(void 0,!0);for(o=0;o<this.hierarchy.length;o++)l[o][k]=this.hierarchy[o]instanceof THREE.Bone?this.hierarchy[o].skinMatrix.clone():this.hierarchy[o].matrix.clone()}}};
 THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],e,f,g,j,h,k;e=(a.length-1)*b;f=Math.floor(e);e-=f;c[0]=f==0?f:f-1;c[1]=f;c[2]=f>a.length-2?f:f+1;c[3]=f>a.length-3?f:f+2;f=a[c[0]];j=a[c[1]];h=a[c[2]];k=a[c[3]];c=e*e;g=e*c;d[0]=this.interpolate(f[0],j[0],h[0],k[0],e,c,g);d[1]=this.interpolate(f[1],j[1],h[1],k[1],e,c,g);d[2]=this.interpolate(f[2],j[2],h[2],k[2],e,c,g);return d};
 THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],e,f,g,j,h,k;e=(a.length-1)*b;f=Math.floor(e);e-=f;c[0]=f==0?f:f-1;c[1]=f;c[2]=f>a.length-2?f:f+1;c[3]=f>a.length-3?f:f+2;f=a[c[0]];j=a[c[1]];h=a[c[2]];k=a[c[3]];c=e*e;g=e*c;d[0]=this.interpolate(f[0],j[0],h[0],k[0],e,c,g);d[1]=this.interpolate(f[1],j[1],h[1],k[1],e,c,g);d[2]=this.interpolate(f[2],j[2],h[2],k[2],e,c,g);return d};
 THREE.Animation.prototype.interpolate=function(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c<d.length-1?c:d.length-1:c%=d.length;c<d.length;c++)if(d[c][a]!==void 0)return d[c];return this.data.hierarchy[b].keys[0]};
 THREE.Animation.prototype.interpolate=function(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c<d.length-1?c:d.length-1:c%=d.length;c<d.length;c++)if(d[c][a]!==void 0)return d[c];return this.data.hierarchy[b].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+d.length;c>=0;c--)if(d[c][a]!==void 0)return d[c];return this.data.hierarchy[b].keys[d.length-1]};
 THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+d.length;c>=0;c--)if(d[c][a]!==void 0)return d[c];return this.data.hierarchy[b].keys[d.length-1]};
-THREE.QuakeCamera=function(a){function b(a,b){return function(){b.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=
+THREE.QuakeCamera=function(a){function b(a,b){return function(){b.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=
 a.movementSpeed;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.noFly!==void 0)this.noFly=a.noFly;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.autoForward!==void 0)this.autoForward=a.autoForward;if(a.activeLook!==void 0)this.activeLook=a.activeLook;if(a.heightSpeed!==void 0)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==void 0)this.heightCoef=a.heightCoef;if(a.heightMin!==void 0)this.heightMin=a.heightMin;if(a.heightMax!==void 0)this.heightMax=a.heightMax;if(a.constrainVertical!==
 a.movementSpeed;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.noFly!==void 0)this.noFly=a.noFly;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.autoForward!==void 0)this.autoForward=a.autoForward;if(a.activeLook!==void 0)this.activeLook=a.activeLook;if(a.heightSpeed!==void 0)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==void 0)this.heightCoef=a.heightCoef;if(a.heightMin!==void 0)this.heightMin=a.heightMin;if(a.heightMax!==void 0)this.heightMax=a.heightMax;if(a.constrainVertical!==
 void 0)this.constrainVertical=a.constrainVertical;if(a.verticalMin!==void 0)this.verticalMin=a.verticalMin;if(a.verticalMax!==void 0)this.verticalMax=a.verticalMax;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(a){a.preventDefault();
 void 0)this.constrainVertical=a.constrainVertical;if(a.verticalMin!==void 0)this.verticalMin=a.verticalMin;if(a.verticalMax!==void 0)this.verticalMax=a.verticalMax;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(a){a.preventDefault();
 a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.mouseX=a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.onKeyDown=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=
 a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.mouseX=a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.onKeyDown=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=
@@ -45,9 +45,9 @@ this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this
 (this.phi-0)*(this.verticalMax-this.verticalMin)/3.14+this.verticalMin;a=this.target.position;e=this.position;a.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=e.y+100*Math.cos(this.phi);a.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",b(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",b(this,this.onMouseDown),
 (this.phi-0)*(this.verticalMax-this.verticalMin)/3.14+this.verticalMin;a=this.target.position;e=this.position;a.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=e.y+100*Math.cos(this.phi);a.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",b(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",b(this,this.onMouseDown),
 !1);this.domElement.addEventListener("mouseup",b(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",b(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",b(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
 !1);this.domElement.addEventListener("mouseup",b(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",b(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",b(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
 THREE.QuakeCamera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);if(this.noFly)b.y=0;this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};
 THREE.QuakeCamera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);if(this.noFly)b.y=0;this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};
-THREE.PathCamera=function(a){function b(a,c,b,d){var f={name:b,fps:0.6,length:d,hierarchy:[]},e,g=c.getControlPointsArray(),j=c.getLength(),h=g.length,w=0;e=h-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[e]={time:d,pos:g[e],rot:[0,0,0,1],scl:[1,1,1]};for(e=1;e<h-1;e++)w=d*j.chunks[e]/j.total,c.keys[e]={time:w,pos:g[e]};f.hierarchy[0]=c;THREE.AnimationHandler.add(f);return new THREE.Animation(a,b,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function c(a,c){var b,
+THREE.PathCamera=function(a){function b(a,c,b,d){var f={name:b,fps:0.6,length:d,hierarchy:[]},e,g=c.getControlPointsArray(),j=c.getLength(),h=g.length,v=0;e=h-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[e]={time:d,pos:g[e],rot:[0,0,0,1],scl:[1,1,1]};for(e=1;e<h-1;e++)v=d*j.chunks[e]/j.total,c.keys[e]={time:v,pos:g[e]};f.hierarchy[0]=c;THREE.AnimationHandler.add(f);return new THREE.Animation(a,b,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function c(a,c){var b,
 d,f=new THREE.Geometry;for(b=0;b<a.points.length*c;b++)d=b/(a.points.length*c),d=a.getPoint(d),f.vertices[b]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return f}function d(a,b){var d=c(b,10),f=c(b,10),e=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(d,e);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.addChild(lineObj);particleObj.scale.set(1,1,1);a.addChild(particleObj);f=new THREE.SphereGeometry(1,
 d,f=new THREE.Geometry;for(b=0;b<a.points.length*c;b++)d=b/(a.points.length*c),d=a.getPoint(d),f.vertices[b]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return f}function d(a,b){var d=c(b,10),f=c(b,10),e=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(d,e);particleObj=new THREE.ParticleSystem(f,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.addChild(lineObj);particleObj.scale.set(1,1,1);a.addChild(particleObj);f=new THREE.SphereGeometry(1,
-16,8);e=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<b.points.length;i++)d=new THREE.Mesh(f,e),d.position.copy(b.points[i]),d.updateMatrix(),a.addChild(d)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.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);e=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<b.points.length;i++)d=new THREE.Mesh(f,e),d.position.copy(b.points[i]),d.updateMatrix(),a.addChild(d)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.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.005;this.lookHorizontal=
 this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(a){if(a.duration!==void 0)this.duration=a.duration*1E3;if(a.waypoints!==void 0)this.waypoints=a.waypoints;if(a.useConstantSpeed!==void 0)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==void 0)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==void 0)this.createDebugPath=a.createDebugPath;if(a.createDebugDummy!==
 this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(a){if(a.duration!==void 0)this.duration=a.duration*1E3;if(a.waypoints!==void 0)this.waypoints=a.waypoints;if(a.useConstantSpeed!==void 0)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==void 0)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==void 0)this.createDebugPath=a.createDebugPath;if(a.createDebugDummy!==
 void 0)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==void 0)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==void 0)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==void 0)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
 void 0)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==void 0)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==void 0)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==void 0)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
 window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var e=Math.PI*2,f=Math.PI/180;this.update=function(a,c,b){var d,g;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)*f;this.theta=this.lon*f;d=this.phi%e;this.phi=d>=0?d:d+e;d=this.verticalAngleMap.srcRange;g=this.verticalAngleMap.dstRange;var j=g[1]-g[0];this.phi=
 window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var e=Math.PI*2,f=Math.PI/180;this.update=function(a,c,b){var d,g;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)*f;this.theta=this.lon*f;d=this.phi%e;this.phi=d>=0?d:d+e;d=this.verticalAngleMap.srcRange;g=this.verticalAngleMap.dstRange;var j=g[1]-g[0];this.phi=
@@ -55,7 +55,7 @@ TWEEN.Easing.Quadratic.EaseInOut(((this.phi-d[0])*(g[1]-g[0])/(d[1]-d[0])+g[0]-g
 a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),g=new THREE.MeshLambertMaterial({color:65280}),j=new THREE.CubeGeometry(10,10,20),h=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(j,a);a=new THREE.Mesh(h,g);a.position.set(0,10,0);this.animation=
 a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),g=new THREE.MeshLambertMaterial({color:65280}),j=new THREE.CubeGeometry(10,10,20),h=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(j,a);a=new THREE.Mesh(h,g);a.position.set(0,10,0);this.animation=
 b(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else this.animation=b(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&d(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(a,c){return function(){c.apply(a,arguments)}}(this,this.onMouseMove),
 b(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else this.animation=b(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&d(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(a,c){return function(){c.apply(a,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;
 !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(a){function b(a,b){return function(){b.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.domElement=document;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=a.movementSpeed;if(a.rollSpeed!==void 0)this.rollSpeed=a.rollSpeed;if(a.dragToLook!==void 0)this.dragToLook=a.dragToLook;if(a.autoForward!==void 0)this.autoForward=
+THREE.FlyCamera=function(a){function b(a,b){return function(){b.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.domElement=document;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=a.movementSpeed;if(a.rollSpeed!==void 0)this.rollSpeed=a.rollSpeed;if(a.dragToLook!==void 0)this.dragToLook=a.dragToLook;if(a.autoForward!==void 0)this.autoForward=
 a.autoForward;if(a.domElement!==void 0)this.domElement=a.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.handleEvent=function(a){if(typeof this[a.type]=="function")this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=
 a.autoForward;if(a.domElement!==void 0)this.domElement=a.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.handleEvent=function(a){if(typeof this[a.type]=="function")this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=
 0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
 0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};
 this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;
 this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;
@@ -65,12 +65,12 @@ this.rollSpeed;this.translateX(this.moveVector.x*a);this.translateY(this.moveVec
 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=-a+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!=
 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=-a+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",b(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",b(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",b(this,this.mouseup),!1);window.addEventListener("keydown",b(this,this.keydown),!1);window.addEventListener("keyup",b(this,
 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",b(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",b(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",b(this,this.mouseup),!1);window.addEventListener("keydown",b(this,this.keydown),!1);window.addEventListener("keyup",b(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.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(a,b,c,d){THREE.Camera.call(this,a,b,c,d);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 e=new THREE.Vector3,f=new THREE.Vector3,g=new THREE.Vector3,j=new THREE.Matrix4,h=!1,k=1,l=0,m=0,n=0,o=0,u=0,t=window.innerWidth/2,v=window.innerHeight/2;this.update=
-function(){var a=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.delta=(a-this.lastUpdate)/1E3;this.lastUpdate=a;this.mouseLook&&(a=this.delta*this.lookSpeed,this.rotateHorizontally(a*o),this.rotateVertically(a*u));a=this.delta*this.movementSpeed;this.translateZ(a*(l>0||this.autoForward&&!(l<0)?1:l));this.translateX(a*m);this.translateY(a*n);h&&(this.roll+=this.rollSpeed*this.delta*k);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();
+THREE.RollCamera=function(a,b,c,d){THREE.Camera.call(this,a,b,c,d);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 e=new THREE.Vector3,f=new THREE.Vector3,g=new THREE.Vector3,j=new THREE.Matrix4,h=!1,k=1,l=0,m=0,n=0,o=0,t=0,u=window.innerWidth/2,w=window.innerHeight/2;this.update=
+function(){var a=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.delta=(a-this.lastUpdate)/1E3;this.lastUpdate=a;this.mouseLook&&(a=this.delta*this.lookSpeed,this.rotateHorizontally(a*o),this.rotateVertically(a*t));a=this.delta*this.movementSpeed;this.translateZ(a*(l>0||this.autoForward&&!(l<0)?1:l));this.translateX(a*m);this.translateY(a*n);h&&(this.roll+=this.rollSpeed*this.delta*k);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();g.copy(this.forward);f.set(0,1,0);e.cross(f,g).normalize();f.cross(g,e).normalize();this.matrix.n11=e.x;this.matrix.n12=f.x;this.matrix.n13=g.x;this.matrix.n21=e.y;this.matrix.n22=f.y;this.matrix.n23=g.y;this.matrix.n31=e.z;this.matrix.n32=f.z;this.matrix.n33=g.z;j.identity();j.n11=Math.cos(this.roll);j.n12=-Math.sin(this.roll);j.n21=Math.sin(this.roll);j.n22=Math.cos(this.roll);this.matrix.multiplySelf(j);
 else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();g.copy(this.forward);f.set(0,1,0);e.cross(f,g).normalize();f.cross(g,e).normalize();this.matrix.n11=e.x;this.matrix.n12=f.x;this.matrix.n13=g.x;this.matrix.n21=e.y;this.matrix.n22=f.y;this.matrix.n23=g.y;this.matrix.n31=e.z;this.matrix.n32=f.z;this.matrix.n33=g.z;j.identity();j.n11=Math.cos(this.roll);j.n12=-Math.sin(this.roll);j.n21=Math.sin(this.roll);j.n22=Math.cos(this.roll);this.matrix.multiplySelf(j);
 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(a){this.position.x+=this.matrix.n11*a;this.position.y+=this.matrix.n21*a;this.position.z+=this.matrix.n31*a};this.translateY=function(a){this.position.x+=this.matrix.n12*a;this.position.y+=this.matrix.n22*a;this.position.z+=this.matrix.n32*a};this.translateZ=function(a){this.position.x-=this.matrix.n13*a;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(a){this.position.x+=this.matrix.n11*a;this.position.y+=this.matrix.n21*a;this.position.z+=this.matrix.n31*a};this.translateY=function(a){this.position.x+=this.matrix.n12*a;this.position.y+=this.matrix.n22*a;this.position.z+=this.matrix.n32*a};this.translateZ=function(a){this.position.x-=this.matrix.n13*a;this.position.y-=
 this.matrix.n23*a;this.position.z-=this.matrix.n33*a};this.rotateHorizontally=function(a){e.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);e.multiplyScalar(a);this.forward.subSelf(e);this.forward.normalize()};this.rotateVertically=function(a){f.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);f.multiplyScalar(a);this.forward.addSelf(f);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",
 this.matrix.n23*a;this.position.z-=this.matrix.n33*a};this.rotateHorizontally=function(a){e.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);e.multiplyScalar(a);this.forward.subSelf(e);this.forward.normalize()};this.rotateVertically=function(a){f.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);f.multiplyScalar(a);this.forward.addSelf(f);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",
-function(a){o=(a.clientX-t)/window.innerWidth;u=(a.clientY-v)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:l=1;break;case 2:l=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:l=0;break;case 2:l=0}},!1);this.domElement.addEventListener("keydown",function(a){switch(a.keyCode){case 38:case 87:l=1;break;case 37:case 65:m=-1;break;
+function(a){o=(a.clientX-u)/window.innerWidth;t=(a.clientY-w)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:l=1;break;case 2:l=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:l=0;break;case 2:l=0}},!1);this.domElement.addEventListener("keydown",function(a){switch(a.keyCode){case 38:case 87:l=1;break;case 37:case 65:m=-1;break;
 case 40:case 83:l=-1;break;case 39:case 68:m=1;break;case 81:h=!0;k=1;break;case 69:h=!0;k=-1;break;case 82:n=1;break;case 70:n=-1}},!1);this.domElement.addEventListener("keyup",function(a){switch(a.keyCode){case 38:case 87:l=0;break;case 37:case 65:m=0;break;case 40:case 83:l=0;break;case 39:case 68:m=0;break;case 81:h=!1;break;case 69:h=!1;break;case 82:n=0;break;case 70:n=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
 case 40:case 83:l=-1;break;case 39:case 68:m=1;break;case 81:h=!0;k=1;break;case 69:h=!0;k=-1;break;case 82:n=1;break;case 70:n=-1}},!1);this.domElement.addEventListener("keyup",function(a){switch(a.keyCode){case 38:case 87:l=0;break;case 37:case 65:m=0;break;case 40:case 83:l=0;break;case 39:case 68:m=0;break;case 81:h=!1;break;case 69:h=!1;break;case 82:n=0;break;case 70:n=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(a){function b(a,c){return function(){c.apply(a,arguments)}}a=a||{};THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.domElement=a.domElement||document;this.screen=a.screen||{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=a.radius||(this.screen.width+this.screen.height)/4;this.rotateSpeed=a.rotateSpeed||1;this.zoomSpeed=a.zoomSpeed||1.2;this.panSpeed=a.panSpeed||0.3;this.noZoom=a.noZoom||!1;this.noPan=a.noPan||
 THREE.TrackballCamera=function(a){function b(a,c){return function(){c.apply(a,arguments)}}a=a||{};THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.domElement=a.domElement||document;this.screen=a.screen||{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=a.radius||(this.screen.width+this.screen.height)/4;this.rotateSpeed=a.rotateSpeed||1;this.zoomSpeed=a.zoomSpeed||1.2;this.panSpeed=a.panSpeed||0.3;this.noZoom=a.noZoom||!1;this.noPan=a.noPan||
@@ -83,9 +83,9 @@ b(this,function(a){c&&(f=g=this.getMouseProjectionOnBall(a.clientX,a.clientY),j=
 a.stopPropagation();if(d===this.STATE.NONE)d=a.button,d===this.STATE.ROTATE?f=g=this.getMouseProjectionOnBall(a.clientX,a.clientY):d===this.STATE.ZOOM&&!this.noZoom?j=h=this.getMouseOnScreen(a.clientX,a.clientY):this.noPan||(k=l=this.getMouseOnScreen(a.clientX,a.clientY))}),!1);this.domElement.addEventListener("mouseup",b(this,function(a){a.preventDefault();a.stopPropagation();d=this.STATE.NONE}),!1);window.addEventListener("keydown",b(this,function(a){if(d===this.STATE.NONE){if(a.keyCode===this.keys[this.STATE.ROTATE])d=
 a.stopPropagation();if(d===this.STATE.NONE)d=a.button,d===this.STATE.ROTATE?f=g=this.getMouseProjectionOnBall(a.clientX,a.clientY):d===this.STATE.ZOOM&&!this.noZoom?j=h=this.getMouseOnScreen(a.clientX,a.clientY):this.noPan||(k=l=this.getMouseOnScreen(a.clientX,a.clientY))}),!1);this.domElement.addEventListener("mouseup",b(this,function(a){a.preventDefault();a.stopPropagation();d=this.STATE.NONE}),!1);window.addEventListener("keydown",b(this,function(a){if(d===this.STATE.NONE){if(a.keyCode===this.keys[this.STATE.ROTATE])d=
 this.STATE.ROTATE;else if(a.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)d=this.STATE.ZOOM;else if(a.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)d=this.STATE.PAN;d!==this.STATE.NONE&&(c=!0)}}),!1);window.addEventListener("keyup",b(this,function(){if(d!==this.STATE.NONE)d=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(a.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)d=this.STATE.ZOOM;else if(a.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)d=this.STATE.PAN;d!==this.STATE.NONE&&(c=!0)}}),!1);window.addEventListener("keyup",b(this,function(){if(d!==this.STATE.NONE)d=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.TrackballCamera.prototype.STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2};
-THREE.CubeGeometry=function(a,b,c,d,e,f,g,j,h){function k(a,c,b,g,j,h,k,m){var o,n,u=d||1,t=e||1,L=j/2,G=h/2,M=l.vertices.length;if(a=="x"&&c=="y"||a=="y"&&c=="x")o="z";else if(a=="x"&&c=="z"||a=="z"&&c=="x")o="y",t=f||1;else if(a=="z"&&c=="y"||a=="y"&&c=="z")o="x",u=f||1;var H=u+1,A=t+1;j/=u;var I=h/t;for(n=0;n<A;n++)for(h=0;h<H;h++){var K=new THREE.Vector3;K[a]=(h*j-L)*b;K[c]=(n*I-G)*g;K[o]=k;l.vertices.push(new THREE.Vertex(K))}for(n=0;n<t;n++)for(h=0;h<u;h++)l.faces.push(new THREE.Face4(h+H*n+
-M,h+H*(n+1)+M,h+1+H*(n+1)+M,h+1+H*n+M,null,null,m)),l.faceVertexUvs[0].push([new THREE.UV(h/u,n/t),new THREE.UV(h/u,(n+1)/t),new THREE.UV((h+1)/u,(n+1)/t),new THREE.UV((h+1)/u,n/t)])}THREE.Geometry.call(this);var l=this,m=a/2,n=b/2,o=c/2,j=j?-1:1;if(g!==void 0)if(g instanceof Array)this.materials=g;else{this.materials=[];for(var u=0;u<6;u++)this.materials.push([g])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(h!=void 0)for(var t in h)this.sides[t]!=void 0&&(this.sides[t]=
-h[t]);this.sides.px&&k("z","y",1*j,-1,c,b,-m,this.materials[0]);this.sides.nx&&k("z","y",-1*j,-1,c,b,m,this.materials[1]);this.sides.py&&k("x","z",1*j,1,a,c,n,this.materials[2]);this.sides.ny&&k("x","z",1*j,-1,a,c,-n,this.materials[3]);this.sides.pz&&k("x","y",1*j,-1,a,b,o,this.materials[4]);this.sides.nz&&k("x","y",-1*j,-1,a,b,-o,this.materials[5]);(function(){for(var a=[],c=[],b=0,d=l.vertices.length;b<d;b++){for(var f=l.vertices[b],e=!1,g=0,j=a.length;g<j;g++){var h=a[g];if(f.position.x==h.position.x&&
+THREE.CubeGeometry=function(a,b,c,d,e,f,g,j,h){function k(a,c,b,g,j,h,k,m){var o,n,t=d||1,u=e||1,L=j/2,G=h/2,M=l.vertices.length;if(a=="x"&&c=="y"||a=="y"&&c=="x")o="z";else if(a=="x"&&c=="z"||a=="z"&&c=="x")o="y",u=f||1;else if(a=="z"&&c=="y"||a=="y"&&c=="z")o="x",t=f||1;var H=t+1,A=u+1;j/=t;var I=h/u;for(n=0;n<A;n++)for(h=0;h<H;h++){var K=new THREE.Vector3;K[a]=(h*j-L)*b;K[c]=(n*I-G)*g;K[o]=k;l.vertices.push(new THREE.Vertex(K))}for(n=0;n<u;n++)for(h=0;h<t;h++)l.faces.push(new THREE.Face4(h+H*n+
+M,h+H*(n+1)+M,h+1+H*(n+1)+M,h+1+H*n+M,null,null,m)),l.faceVertexUvs[0].push([new THREE.UV(h/t,n/u),new THREE.UV(h/t,(n+1)/u),new THREE.UV((h+1)/t,(n+1)/u),new THREE.UV((h+1)/t,n/u)])}THREE.Geometry.call(this);var l=this,m=a/2,n=b/2,o=c/2,j=j?-1:1;if(g!==void 0)if(g instanceof Array)this.materials=g;else{this.materials=[];for(var t=0;t<6;t++)this.materials.push([g])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(h!=void 0)for(var u in h)this.sides[u]!=void 0&&(this.sides[u]=
+h[u]);this.sides.px&&k("z","y",1*j,-1,c,b,-m,this.materials[0]);this.sides.nx&&k("z","y",-1*j,-1,c,b,m,this.materials[1]);this.sides.py&&k("x","z",1*j,1,a,c,n,this.materials[2]);this.sides.ny&&k("x","z",1*j,-1,a,c,-n,this.materials[3]);this.sides.pz&&k("x","y",1*j,-1,a,b,o,this.materials[4]);this.sides.nz&&k("x","y",-1*j,-1,a,b,-o,this.materials[5]);(function(){for(var a=[],c=[],b=0,d=l.vertices.length;b<d;b++){for(var f=l.vertices[b],e=!1,g=0,j=a.length;g<j;g++){var h=a[g];if(f.position.x==h.position.x&&
 f.position.y==h.position.y&&f.position.z==h.position.z){c[b]=g;e=!0;break}}if(!e)c[b]=a.length,a.push(new THREE.Vertex(f.position.clone()))}b=0;for(d=l.faces.length;b<d;b++)f=l.faces[b],f.a=c[f.a],f.b=c[f.b],f.c=c[f.c],f.d=c[f.d];l.vertices=a})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
 f.position.y==h.position.y&&f.position.z==h.position.z){c[b]=g;e=!0;break}}if(!e)c[b]=a.length,a.push(new THREE.Vertex(f.position.clone()))}b=0;for(d=l.faces.length;b<d;b++)f=l.faces[b],f.a=c[f.a],f.b=c[f.b],f.c=c[f.c],f.d=c[f.d];l.vertices=a})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
 THREE.CylinderGeometry=function(a,b,c,d,e,f){function g(a,c,b){j.vertices.push(new THREE.Vertex(new THREE.Vector3(a,c,b)))}THREE.Geometry.call(this);var j=this,h,k=Math.PI*2,l=d/2;for(h=0;h<a;h++)g(Math.sin(k*h/a)*b,Math.cos(k*h/a)*b,-l);for(h=0;h<a;h++)g(Math.sin(k*h/a)*c,Math.cos(k*h/a)*c,l);for(h=0;h<a;h++)j.faces.push(new THREE.Face4(h,h+a,a+(h+1)%a,(h+1)%a));if(c>0){g(0,0,-l-(f||0));for(h=a;h<a+a/2;h++)j.faces.push(new THREE.Face4(2*a,(2*h-2*a)%a,(2*h-2*a+1)%a,(2*h-2*a+2)%a))}if(b>0){g(0,0,l+
 THREE.CylinderGeometry=function(a,b,c,d,e,f){function g(a,c,b){j.vertices.push(new THREE.Vertex(new THREE.Vector3(a,c,b)))}THREE.Geometry.call(this);var j=this,h,k=Math.PI*2,l=d/2;for(h=0;h<a;h++)g(Math.sin(k*h/a)*b,Math.cos(k*h/a)*b,-l);for(h=0;h<a;h++)g(Math.sin(k*h/a)*c,Math.cos(k*h/a)*c,l);for(h=0;h<a;h++)j.faces.push(new THREE.Face4(h,h+a,a+(h+1)%a,(h+1)%a));if(c>0){g(0,0,-l-(f||0));for(h=a;h<a+a/2;h++)j.faces.push(new THREE.Face4(2*a,(2*h-2*a)%a,(2*h-2*a+1)%a,(2*h-2*a+2)%a))}if(b>0){g(0,0,l+
 (e||0));for(h=a+a/2;h<2*a;h++)j.faces.push(new THREE.Face4(2*a+1,(2*h-2*a+2)%a+a,(2*h-2*a+1)%a+a,(2*h-2*a)%a+a))}h=0;for(a=this.faces.length;h<a;h++){var b=[],c=this.faces[h],e=this.vertices[c.a],f=this.vertices[c.b],l=this.vertices[c.c],m=this.vertices[c.d];b.push(new THREE.UV(0.5+Math.atan2(e.position.x,e.position.y)/k,0.5+e.position.z/d));b.push(new THREE.UV(0.5+Math.atan2(f.position.x,f.position.y)/k,0.5+f.position.z/d));b.push(new THREE.UV(0.5+Math.atan2(l.position.x,l.position.y)/k,0.5+l.position.z/
 (e||0));for(h=a+a/2;h<2*a;h++)j.faces.push(new THREE.Face4(2*a+1,(2*h-2*a+2)%a+a,(2*h-2*a+1)%a+a,(2*h-2*a)%a+a))}h=0;for(a=this.faces.length;h<a;h++){var b=[],c=this.faces[h],e=this.vertices[c.a],f=this.vertices[c.b],l=this.vertices[c.c],m=this.vertices[c.d];b.push(new THREE.UV(0.5+Math.atan2(e.position.x,e.position.y)/k,0.5+e.position.z/d));b.push(new THREE.UV(0.5+Math.atan2(f.position.x,f.position.y)/k,0.5+f.position.z/d));b.push(new THREE.UV(0.5+Math.atan2(l.position.x,l.position.y)/k,0.5+l.position.z/
@@ -93,29 +93,29 @@ d));c instanceof THREE.Face4&&b.push(new THREE.UV(0.5+Math.atan2(m.position.x,m.
 THREE.IcosahedronGeometry=function(a){function b(a,c,b){var d=Math.sqrt(a*a+c*c+b*b);return e.vertices.push(new THREE.Vertex(new THREE.Vector3(a/d,c/d,b/d)))-1}function c(a,c,b,d){d.faces.push(new THREE.Face3(a,c,b))}function d(a,c){var d=e.vertices[a].position,f=e.vertices[c].position;return b((d.x+f.x)/2,(d.y+f.y)/2,(d.z+f.z)/2)}var e=this,f=new THREE.Geometry,g;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;b(-1,a,0);b(1,a,0);b(-1,-a,0);b(1,-a,0);b(0,-1,a);b(0,1,a);b(0,-1,
 THREE.IcosahedronGeometry=function(a){function b(a,c,b){var d=Math.sqrt(a*a+c*c+b*b);return e.vertices.push(new THREE.Vertex(new THREE.Vector3(a/d,c/d,b/d)))-1}function c(a,c,b,d){d.faces.push(new THREE.Face3(a,c,b))}function d(a,c){var d=e.vertices[a].position,f=e.vertices[c].position;return b((d.x+f.x)/2,(d.y+f.y)/2,(d.z+f.z)/2)}var e=this,f=new THREE.Geometry,g;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;b(-1,a,0);b(1,a,0);b(-1,-a,0);b(1,-a,0);b(0,-1,a);b(0,1,a);b(0,-1,
 -a);b(0,1,-a);b(a,0,-1);b(a,0,1);b(-a,0,-1);b(-a,0,1);c(0,11,5,f);c(0,5,1,f);c(0,1,7,f);c(0,7,10,f);c(0,10,11,f);c(1,5,9,f);c(5,11,4,f);c(11,10,2,f);c(10,7,6,f);c(7,1,8,f);c(3,9,4,f);c(3,4,2,f);c(3,2,6,f);c(3,6,8,f);c(3,8,9,f);c(4,9,5,f);c(2,4,11,f);c(6,2,10,f);c(8,6,7,f);c(9,8,1,f);for(a=0;a<this.subdivisions;a++){g=new THREE.Geometry;for(var j in f.faces){var h=d(f.faces[j].a,f.faces[j].b),k=d(f.faces[j].b,f.faces[j].c),l=d(f.faces[j].c,f.faces[j].a);c(f.faces[j].a,h,l,g);c(f.faces[j].b,k,h,g);
 -a);b(0,1,-a);b(a,0,-1);b(a,0,1);b(-a,0,-1);b(-a,0,1);c(0,11,5,f);c(0,5,1,f);c(0,1,7,f);c(0,7,10,f);c(0,10,11,f);c(1,5,9,f);c(5,11,4,f);c(11,10,2,f);c(10,7,6,f);c(7,1,8,f);c(3,9,4,f);c(3,4,2,f);c(3,2,6,f);c(3,6,8,f);c(3,8,9,f);c(4,9,5,f);c(2,4,11,f);c(6,2,10,f);c(8,6,7,f);c(9,8,1,f);for(a=0;a<this.subdivisions;a++){g=new THREE.Geometry;for(var j in f.faces){var h=d(f.faces[j].a,f.faces[j].b),k=d(f.faces[j].b,f.faces[j].c),l=d(f.faces[j].c,f.faces[j].a);c(f.faces[j].a,h,l,g);c(f.faces[j].b,k,h,g);
 c(f.faces[j].c,l,k,g);c(h,k,l,g)}f.faces=g.faces}e.faces=f.faces;delete f;delete g;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
 c(f.faces[j].c,l,k,g);c(h,k,l,g)}f.faces=g.faces}e.faces=f.faces;delete f;delete g;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
-THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],e=[],f=[],g=(new THREE.Matrix4).setRotationZ(b),j=0;j<a.length;j++)this.vertices.push(new THREE.Vertex(a[j])),c[j]=a[j].clone(),d[j]=this.vertices.length-1;for(var h=0;h<=this.angle+0.0010;h+=b){for(j=0;j<c.length;j++)h<this.angle?(c[j]=g.multiplyVector3(c[j].clone()),this.vertices.push(new THREE.Vertex(c[j])),e[j]=this.vertices.length-1):e=f;h==0&&(f=d);
+THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],e=[],f=[],g=(new THREE.Matrix4).setRotationZ(b),j=0;j<a.length;j++)this.vertices.push(new THREE.Vertex(a[j])),c[j]=a[j].clone(),d[j]=this.vertices.length-1;for(var h=0;h<=this.angle+0.001;h+=b){for(j=0;j<c.length;j++)h<this.angle?(c[j]=g.multiplyVector3(c[j].clone()),this.vertices.push(new THREE.Vertex(c[j])),e[j]=this.vertices.length-1):e=f;h==0&&(f=d);
 for(j=0;j<d.length-1;j++)this.faces.push(new THREE.Face4(e[j],e[j+1],d[j+1],d[j])),this.faceVertexUvs[0].push([new THREE.UV(1-h/this.angle,j/a.length),new THREE.UV(1-h/this.angle,(j+1)/a.length),new THREE.UV(1-(h-b)/this.angle,(j+1)/a.length),new THREE.UV(1-(h-b)/this.angle,j/a.length)]);d=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
 for(j=0;j<d.length-1;j++)this.faces.push(new THREE.Face4(e[j],e[j+1],d[j+1],d[j])),this.faceVertexUvs[0].push([new THREE.UV(1-h/this.angle,j/a.length),new THREE.UV(1-h/this.angle,(j+1)/a.length),new THREE.UV(1-(h-b)/this.angle,(j+1)/a.length),new THREE.UV(1-(h-b)/this.angle,j/a.length)]);d=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
 THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);var e,f=a/2,g=b/2,c=c||1,d=d||1,j=c+1,h=d+1;a/=c;var k=b/d;for(e=0;e<h;e++)for(b=0;b<j;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*a-f,-(e*k-g),0)));for(e=0;e<d;e++)for(b=0;b<c;b++)this.faces.push(new THREE.Face4(b+j*e,b+j*(e+1),b+1+j*(e+1),b+1+j*e)),this.faceVertexUvs[0].push([new THREE.UV(b/c,e/d),new THREE.UV(b/c,(e+1)/d),new THREE.UV((b+1)/c,(e+1)/d),new THREE.UV((b+1)/c,e/d)]);this.computeCentroids();this.computeFaceNormals()};
 THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);var e,f=a/2,g=b/2,c=c||1,d=d||1,j=c+1,h=d+1;a/=c;var k=b/d;for(e=0;e<h;e++)for(b=0;b<j;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*a-f,-(e*k-g),0)));for(e=0;e<d;e++)for(b=0;b<c;b++)this.faces.push(new THREE.Face4(b+j*e,b+j*(e+1),b+1+j*(e+1),b+1+j*e)),this.faceVertexUvs[0].push([new THREE.UV(b/c,e/d),new THREE.UV(b/c,(e+1)/d),new THREE.UV((b+1)/c,(e+1)/d),new THREE.UV((b+1)/c,e/d)]);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(a,b,c){THREE.Geometry.call(this);for(var a=a||50,d,e=Math.PI,f=Math.max(3,b||8),g=Math.max(2,c||6),b=[],c=0;c<g+1;c++){d=c/g;var j=a*Math.cos(d*e),h=a*Math.sin(d*e),k=[],l=0;for(d=0;d<f;d++){var m=2*d/f,n=h*Math.sin(m*e),m=h*Math.cos(m*e);(c==0||c==g)&&d>0||(l=this.vertices.push(new THREE.Vertex(new THREE.Vector3(m,j,n)))-1);k.push(l)}b.push(k)}for(var o,u,t,e=b.length,c=0;c<e;c++)if(f=b[c].length,c>0)for(d=0;d<f;d++){k=d==f-1;g=b[c][k?0:d+1];j=b[c][k?f-1:d];h=b[c-1][k?
-f-1:d];k=b[c-1][k?0:d+1];n=c/(e-1);o=(c-1)/(e-1);u=(d+1)/f;var m=d/f,l=new THREE.UV(1-u,n),n=new THREE.UV(1-m,n),m=new THREE.UV(1-m,o),v=new THREE.UV(1-u,o);c<b.length-1&&(o=this.vertices[g].position.clone(),u=this.vertices[j].position.clone(),t=this.vertices[h].position.clone(),o.normalize(),u.normalize(),t.normalize(),this.faces.push(new THREE.Face3(g,j,h,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(u.x,u.y,u.z),new THREE.Vector3(t.x,t.y,t.z)])),this.faceVertexUvs[0].push([l,n,m]));c>1&&(o=
-this.vertices[g].position.clone(),u=this.vertices[h].position.clone(),t=this.vertices[k].position.clone(),o.normalize(),u.normalize(),t.normalize(),this.faces.push(new THREE.Face3(g,h,k,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(u.x,u.y,u.z),new THREE.Vector3(t.x,t.y,t.z)])),this.faceVertexUvs[0].push([l,m,v]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;
+THREE.SphereGeometry=function(a,b,c){THREE.Geometry.call(this);for(var a=a||50,d,e=Math.PI,f=Math.max(3,b||8),g=Math.max(2,c||6),b=[],c=0;c<g+1;c++){d=c/g;var j=a*Math.cos(d*e),h=a*Math.sin(d*e),k=[],l=0;for(d=0;d<f;d++){var m=2*d/f,n=h*Math.sin(m*e),m=h*Math.cos(m*e);(c==0||c==g)&&d>0||(l=this.vertices.push(new THREE.Vertex(new THREE.Vector3(m,j,n)))-1);k.push(l)}b.push(k)}for(var o,t,u,e=b.length,c=0;c<e;c++)if(f=b[c].length,c>0)for(d=0;d<f;d++){k=d==f-1;g=b[c][k?0:d+1];j=b[c][k?f-1:d];h=b[c-1][k?
+f-1:d];k=b[c-1][k?0:d+1];n=c/(e-1);o=(c-1)/(e-1);t=(d+1)/f;var m=d/f,l=new THREE.UV(1-t,n),n=new THREE.UV(1-m,n),m=new THREE.UV(1-m,o),w=new THREE.UV(1-t,o);c<b.length-1&&(o=this.vertices[g].position.clone(),t=this.vertices[j].position.clone(),u=this.vertices[h].position.clone(),o.normalize(),t.normalize(),u.normalize(),this.faces.push(new THREE.Face3(g,j,h,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(u.x,u.y,u.z)])),this.faceVertexUvs[0].push([l,n,m]));c>1&&(o=
+this.vertices[g].position.clone(),t=this.vertices[h].position.clone(),u=this.vertices[k].position.clone(),o.normalize(),t.normalize(),u.normalize(),this.faces.push(new THREE.Face3(g,h,k,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(u.x,u.y,u.z)])),this.faceVertexUvs[0].push([l,m,w]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;
 THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(a,b){THREE.Geometry.call(this);this.parameters=b||{};this.set(a)};THREE.TextGeometry.prototype=new THREE.Geometry;THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.TextGeometry=function(a,b){THREE.Geometry.call(this);this.parameters=b||{};this.set(a)};THREE.TextGeometry.prototype=new THREE.Geometry;THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
-THREE.TextGeometry.prototype.set=function(a,b){function c(a,c,b){u.vertices.push(new THREE.Vertex(new THREE.Vector3(a,c,b)))}function d(a,c,b,d){u.faces.push(new THREE.Face4(a,c,b,d))}this.text=a;var b=b||this.parameters,e=b.height!==void 0?b.height:50,f=b.curveSegments!==void 0?b.curveSegments:4,g=b.font!==void 0?b.font:"helvetiker",j=b.weight!==void 0?b.weight:"normal",h=b.style!==void 0?b.style:"normal",k=b.bezelThickness!==void 0?b.bezelThickness:10,l=b.bezelSize!==void 0?b.bezelSize:8,m=b.bezelEnabled!==
-void 0?b.bezelEnabled:!1;THREE.FontUtils.size=b.size!==void 0?b.size:100;THREE.FontUtils.divisions=f;THREE.FontUtils.face=g;THREE.FontUtils.weight=j;THREE.FontUtils.style=h;THREE.FontUtils.bezelSize=l;var j=THREE.FontUtils.drawText(a),f=j.points,n=j.faces,g=j.contour,o=j.bezel,u=this;u.vertices=[];u.faces=[];for(var t,h=f.length,v=n.length,l=o.length,j=0;j<h;j++)t=f[j],c(t.x,t.y,0);for(j=0;j<h;j++)t=f[j],c(t.x,t.y,e);if(m){for(j=0;j<l;j++)t=o[j],c(t.x,t.y,k);for(j=0;j<l;j++)t=o[j],c(t.x,t.y,e-k)}for(j=
-0;j<v;j++)e=n[j],u.faces.push(new THREE.Face3(e[2],e[1],e[0]));for(j=0;j<v;j++)e=n[j],u.faces.push(new THREE.Face3(e[0]+h,e[1]+h,e[2]+h));var x;if(m)for(j=o.length;--j>0;){if(x){if(x.equals(g[j])){x=null;continue}}else x=g[j];k=h*2+j;n=k-1;d(k,n,n+l,k+l);for(m=0;m<h;m++)if(f[m].equals(g[j]))break;for(e=0;e<h;e++)if(f[e].equals(g[j-1]))break;d(m,e,n,k);d(k+l,n+l,e+h,m+h)}else for(j=g.length;--j>0;){if(x){if(x.equals(g[j])){x=null;continue}}else x=g[j];for(m=0;m<h;m++)if(f[m].equals(g[j]))break;for(e=
+THREE.TextGeometry.prototype.set=function(a,b){function c(a,c,b){t.vertices.push(new THREE.Vertex(new THREE.Vector3(a,c,b)))}function d(a,c,b,d){t.faces.push(new THREE.Face4(a,c,b,d))}this.text=a;var b=b||this.parameters,e=b.height!==void 0?b.height:50,f=b.curveSegments!==void 0?b.curveSegments:4,g=b.font!==void 0?b.font:"helvetiker",j=b.weight!==void 0?b.weight:"normal",h=b.style!==void 0?b.style:"normal",k=b.bezelThickness!==void 0?b.bezelThickness:10,l=b.bezelSize!==void 0?b.bezelSize:8,m=b.bezelEnabled!==
+void 0?b.bezelEnabled:!1;THREE.FontUtils.size=b.size!==void 0?b.size:100;THREE.FontUtils.divisions=f;THREE.FontUtils.face=g;THREE.FontUtils.weight=j;THREE.FontUtils.style=h;THREE.FontUtils.bezelSize=l;var j=THREE.FontUtils.drawText(a),f=j.points,n=j.faces,g=j.contour,o=j.bezel,t=this;t.vertices=[];t.faces=[];for(var u,h=f.length,w=n.length,l=o.length,j=0;j<h;j++)u=f[j],c(u.x,u.y,0);for(j=0;j<h;j++)u=f[j],c(u.x,u.y,e);if(m){for(j=0;j<l;j++)u=o[j],c(u.x,u.y,k);for(j=0;j<l;j++)u=o[j],c(u.x,u.y,e-k)}for(j=
+0;j<w;j++)e=n[j],t.faces.push(new THREE.Face3(e[2],e[1],e[0]));for(j=0;j<w;j++)e=n[j],t.faces.push(new THREE.Face3(e[0]+h,e[1]+h,e[2]+h));var x;if(m)for(j=o.length;--j>0;){if(x){if(x.equals(g[j])){x=null;continue}}else x=g[j];k=h*2+j;n=k-1;d(k,n,n+l,k+l);for(m=0;m<h;m++)if(f[m].equals(g[j]))break;for(e=0;e<h;e++)if(f[e].equals(g[j-1]))break;d(m,e,n,k);d(k+l,n+l,e+h,m+h)}else for(j=g.length;--j>0;){if(x){if(x.equals(g[j])){x=null;continue}}else x=g[j];for(m=0;m<h;m++)if(f[m].equals(g[j]))break;for(e=
 0;e<h;e++)if(f[e].equals(g[j-1]))break;d(m,e,e+h,m+h)}this.computeCentroids();this.computeFaceNormals()};
 0;e<h;e++)if(f[e].equals(g[j-1]))break;d(m,e,e+h,m+h)}this.computeCentroids();this.computeFaceNormals()};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},extractPoints:function(a,b){if(a.length<3)return console.log("not valid polygon"),
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},extractPoints:function(a,b){if(a.length<3)return console.log("not valid polygon"),
-{points:a,faces:[]};var c,d,e,f,g=[],j;for(j in b){a=b[j];f=[];for(c in a)d=a[c],f.push(d.x+","+d.y);var h,k;k=f.slice(1).indexOf(f[0]);var l=this.Triangulate.area(a.slice(0,k+1))<0;d=[];for(k=-1;k<f.length;){h=k+1;k=f[h];k=f.slice(h+1).indexOf(k)+h;if(k<=h)break;var m=a.slice(h,k+1);l?this.Triangulate.area(m)<0?(h>0&&g.push({shape:e,holes:d}),e=m,d=[]):d.push(m):this.Triangulate.area(m)<0?(g.push({shape:m,holes:d}),d=[]):d.push(m);k++}l&&g.push({shape:e,holes:d})}var n,o,u,t,v,x;f=[];for(j=0;j<g.length;j++){h=
-g[j];e=h.shape;d=h.holes;for(l=0;l<d.length;l++){k=d[l];u=Number.POSITIVE_INFINITY;for(m=0;m<k.length;m++){v=k[m];for(c=0;c<e.length;c++)t=e[c],t=v.distanceTo(t),t<u&&(u=t,n=m,o=c)}c=o-1>=0?o-1:e.length-1;var m=n-1>=0?n-1:k.length-1,w=[];w.push(k[n]);w.push(e[o]);w.push(e[c]);u=this.Triangulate.area(w);var p=[];p.push(k[n]);p.push(k[m]);p.push(e[o]);v=this.Triangulate.area(p);t=o;x=n;o+=1;n+=-1;o<0&&(o+=e.length);o%=e.length;n<0&&(n+=k.length);n%=e.length;c=o-1>=0?o-1:e.length-1;m=n-1>=0?n-1:k.length-
-1;w=[];w.push(k[n]);w.push(e[o]);w.push(e[c]);w=this.Triangulate.area(w);p=[];p.push(k[n]);p.push(k[m]);p.push(e[o]);p=this.Triangulate.area(p);u+v>w+p&&(o=t,n=x,o<0&&(o+=e.length),o%=e.length,n<0&&(n+=k.length),n%=e.length,c=o-1>=0?o-1:e.length-1,m=n-1>=0?n-1:k.length-1);u=e.slice(0,o);v=e.slice(o);t=k.slice(n);x=k.slice(0,n);f.push(k[n]);f.push(e[o]);f.push(e[c]);f.push(k[n]);f.push(k[m]);f.push(e[o]);e=u.concat(t).concat(x).concat(v)}h.shape=e}a=[];n=[];for(j=l=0;j<g.length;j++){h=g[j];e=h.shape;
+{points:a,faces:[]};var c,d,e,f,g=[],j;for(j in b){a=b[j];f=[];for(c in a)d=a[c],f.push(d.x+","+d.y);var h,k;k=f.slice(1).indexOf(f[0]);var l=this.Triangulate.area(a.slice(0,k+1))<0;d=[];for(k=-1;k<f.length;){h=k+1;k=f[h];k=f.slice(h+1).indexOf(k)+h;if(k<=h)break;var m=a.slice(h,k+1);l?this.Triangulate.area(m)<0?(h>0&&g.push({shape:e,holes:d}),e=m,d=[]):d.push(m):this.Triangulate.area(m)<0?(g.push({shape:m,holes:d}),d=[]):d.push(m);k++}l&&g.push({shape:e,holes:d})}var n,o,t,u,w,x;f=[];for(j=0;j<g.length;j++){h=
+g[j];e=h.shape;d=h.holes;for(l=0;l<d.length;l++){k=d[l];t=Number.POSITIVE_INFINITY;for(m=0;m<k.length;m++){w=k[m];for(c=0;c<e.length;c++)u=e[c],u=w.distanceTo(u),u<t&&(t=u,n=m,o=c)}c=o-1>=0?o-1:e.length-1;var m=n-1>=0?n-1:k.length-1,v=[];v.push(k[n]);v.push(e[o]);v.push(e[c]);t=this.Triangulate.area(v);var p=[];p.push(k[n]);p.push(k[m]);p.push(e[o]);w=this.Triangulate.area(p);u=o;x=n;o+=1;n+=-1;o<0&&(o+=e.length);o%=e.length;n<0&&(n+=k.length);n%=e.length;c=o-1>=0?o-1:e.length-1;m=n-1>=0?n-1:k.length-
+1;v=[];v.push(k[n]);v.push(e[o]);v.push(e[c]);v=this.Triangulate.area(v);p=[];p.push(k[n]);p.push(k[m]);p.push(e[o]);p=this.Triangulate.area(p);t+w>v+p&&(o=u,n=x,o<0&&(o+=e.length),o%=e.length,n<0&&(n+=k.length),n%=e.length,c=o-1>=0?o-1:e.length-1,m=n-1>=0?n-1:k.length-1);t=e.slice(0,o);w=e.slice(o);u=k.slice(n);x=k.slice(0,n);f.push(k[n]);f.push(e[o]);f.push(e[c]);f.push(k[n]);f.push(k[m]);f.push(e[o]);e=t.concat(u).concat(x).concat(w)}h.shape=e}a=[];n=[];for(j=l=0;j<g.length;j++){h=g[j];e=h.shape;
 a=a.concat(e);h=THREE.FontUtils.Triangulate(e,!0);for(o=0;o<h.length;o++)d=h[o],d[0]+=l,d[1]+=l,d[2]+=l;n=n.concat(h);l+=e.length}var y;for(o=0;o<f.length/3;o++){d=[];for(g=0;g<3;g++){j=!1;for(e=0;e<a.length&&!j;e++)y=o*3+g,a[e].equals(f[y])&&(d.push(e),j=!0);j||(a.push(f[y]),d.push(a.length-1),console.log("not found"))}n.push(d)}return{points:a,faces:n}},drawText:function(a){var b=[],c=[],d,e=this.getFace(),f=this.size/e.resolution,g=0;d=String(a).split("");for(var j=d.length,a=0;a<j;a++){var h=
 a=a.concat(e);h=THREE.FontUtils.Triangulate(e,!0);for(o=0;o<h.length;o++)d=h[o],d[0]+=l,d[1]+=l,d[2]+=l;n=n.concat(h);l+=e.length}var y;for(o=0;o<f.length/3;o++){d=[];for(g=0;g<3;g++){j=!1;for(e=0;e<a.length&&!j;e++)y=o*3+g,a[e].equals(f[y])&&(d.push(e),j=!0);j||(a.push(f[y]),d.push(a.length-1),console.log("not found"))}n.push(d)}return{points:a,faces:n}},drawText:function(a){var b=[],c=[],d,e=this.getFace(),f=this.size/e.resolution,g=0;d=String(a).split("");for(var j=d.length,a=0;a<j;a++){var h=
 this.extractGlyphPoints(d[a],e,f,g);g+=h.offset;b.push(h.points);c=c.concat(h.points)}a=g/2;for(d=0;d<c.length;d++)c[d].x-=a;b=this.extractPoints(c,b);b.contour=c;e=[];f=[];d=[];for(var g=[],j=new THREE.Vector2,k,a=c.length;--a>=0;){if(k){if(k.equals(c[a])){k=null;h=this.Triangulate.area(d)>0;g.push(h);f.push(j.divideScalar(d.length));d=[];j=new THREE.Vector2;continue}}else k=c[a];j.addSelf(c[a]);d.push(c[a])}a=c.length;d=0;for(var l;--a>=0;)h=c[a],j=f[d],h=h.clone().subSelf(j),l=this.bezelSize/h.length(),
 this.extractGlyphPoints(d[a],e,f,g);g+=h.offset;b.push(h.points);c=c.concat(h.points)}a=g/2;for(d=0;d<c.length;d++)c[d].x-=a;b=this.extractPoints(c,b);b.contour=c;e=[];f=[];d=[];for(var g=[],j=new THREE.Vector2,k,a=c.length;--a>=0;){if(k){if(k.equals(c[a])){k=null;h=this.Triangulate.area(d)>0;g.push(h);f.push(j.divideScalar(d.length));d=[];j=new THREE.Vector2;continue}}else k=c[a];j.addSelf(c[a]);d.push(c[a])}a=c.length;d=0;for(var l;--a>=0;)h=c[a],j=f[d],h=h.clone().subSelf(j),l=this.bezelSize/h.length(),
 g[d]?l+=1:l=1-l,l=h.multiplyScalar(l).addSelf(j),e.unshift(l),k?k.equals(c[a])&&(k=null,d++):k=c[a];b.bezel=e;return b},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
 g[d]?l+=1:l=1-l,l=h.multiplyScalar(l).addSelf(j),e.unshift(l),k?k.equals(c[a])&&(k=null,d++):k=c[a];b.bezel=e;return b},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
-b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)},extractGlyphPoints:function(a,b,c,d){var e=[],f,g,j,h,k,l,m,n,o,u,t=b.glyphs[a]||b.glyphs[ctxt.options.fallbackCharacter];if(t){if(t.o){b=t._cachedOutline||(t._cachedOutline=t.o.split(" "));j=b.length;for(a=0;a<j;)switch(g=b[a++],g){case "m":g=b[a++]*c+d;h=b[a++]*c;e.push(new THREE.Vector2(g,h));break;case "l":g=b[a++]*c+d;h=b[a++]*c;e.push(new THREE.Vector2(g,h));break;case "q":g=b[a++]*c+d;h=b[a++]*c;m=b[a++]*c+d;n=b[a++]*c;if(f=e[e.length-1]){k=
-f.x;l=f.y;f=1;for(divisions=this.divisions;f<=divisions;f++){var v=f/divisions,x=THREE.FontUtils.b2(v,k,m,g),v=THREE.FontUtils.b2(v,l,n,h);e.push(new THREE.Vector2(x,v))}}break;case "b":if(g=b[a++]*c+d,h=b[a++]*c,m=b[a++]*c+d,n=b[a++]*-c,o=b[a++]*c+d,u=b[a++]*-c,f=e[e.length-1]){k=f.x;l=f.y;f=1;for(divisions=this.divisions;f<=divisions;f++)v=f/divisions,x=THREE.FontUtils.b3(v,k,m,o,g),v=THREE.FontUtils.b3(v,l,n,u,h),e.push(new THREE.Vector2(x,v))}}}return{offset:t.ha*c,points:e}}}};
-(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return e*0.5};a.Triangulate=function(a,d){var e=a.length;if(e<3)return null;var f=[],g=[],j=[],h,k,l;if(b(a)>0)for(k=0;k<e;k++)g[k]=k;else for(k=0;k<e;k++)g[k]=e-1-k;var m=2*e;for(k=e-1;e>2;){if(m--<=0){console.log("Warning, unable to triangulate polygon!");if(d)return j;return f}h=k;e<=h&&(h=0);k=h+1;e<=k&&(k=0);l=k+1;e<=l&&(l=0);var n;a:{n=a;var o=h,u=k,t=l,v=e,x=g,w=void 0,p=void 0,y=void 0,
-z=void 0,C=void 0,D=void 0,E=void 0,F=void 0,B=void 0,p=n[x[o]].x,y=n[x[o]].y,z=n[x[u]].x,C=n[x[u]].y,D=n[x[t]].x,E=n[x[t]].y;if(1.0E-10>(z-p)*(E-y)-(C-y)*(D-p))n=!1;else{for(w=0;w<v;w++)if(!(w==o||w==u||w==t)){var F=n[x[w]].x,B=n[x[w]].y,J=void 0,L=void 0,G=void 0,M=void 0,H=void 0,A=void 0,I=void 0,K=void 0,N=void 0,P=void 0,Q=void 0,R=void 0,J=G=H=void 0,J=D-z,L=E-C,G=p-D,M=y-E,H=z-p,A=C-y,I=F-p,K=B-y,N=F-z,P=B-C,Q=F-D,R=B-E,J=J*P-L*N,H=H*K-A*I,G=G*R-M*Q;if(J>=0&&G>=0&&H>=0){n=!1;break a}}n=!0}}if(n){m=
+b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)},extractGlyphPoints:function(a,b,c,d){var e=[],f,g,j,h,k,l,m,n,o,t,u=b.glyphs[a]||b.glyphs[ctxt.options.fallbackCharacter];if(u){if(u.o){b=u._cachedOutline||(u._cachedOutline=u.o.split(" "));j=b.length;for(a=0;a<j;)switch(g=b[a++],g){case "m":g=b[a++]*c+d;h=b[a++]*c;e.push(new THREE.Vector2(g,h));break;case "l":g=b[a++]*c+d;h=b[a++]*c;e.push(new THREE.Vector2(g,h));break;case "q":g=b[a++]*c+d;h=b[a++]*c;m=b[a++]*c+d;n=b[a++]*c;if(f=e[e.length-1]){k=
+f.x;l=f.y;f=1;for(divisions=this.divisions;f<=divisions;f++){var w=f/divisions,x=THREE.FontUtils.b2(w,k,m,g),w=THREE.FontUtils.b2(w,l,n,h);e.push(new THREE.Vector2(x,w))}}break;case "b":if(g=b[a++]*c+d,h=b[a++]*c,m=b[a++]*c+d,n=b[a++]*-c,o=b[a++]*c+d,t=b[a++]*-c,f=e[e.length-1]){k=f.x;l=f.y;f=1;for(divisions=this.divisions;f<=divisions;f++)w=f/divisions,x=THREE.FontUtils.b3(w,k,m,o,g),w=THREE.FontUtils.b3(w,l,n,t,h),e.push(new THREE.Vector2(x,w))}}}return{offset:u.ha*c,points:e}}}};
+(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return e*0.5};a.Triangulate=function(a,d){var e=a.length;if(e<3)return null;var f=[],g=[],j=[],h,k,l;if(b(a)>0)for(k=0;k<e;k++)g[k]=k;else for(k=0;k<e;k++)g[k]=e-1-k;var m=2*e;for(k=e-1;e>2;){if(m--<=0){console.log("Warning, unable to triangulate polygon!");if(d)return j;return f}h=k;e<=h&&(h=0);k=h+1;e<=k&&(k=0);l=k+1;e<=l&&(l=0);var n;a:{n=a;var o=h,t=k,u=l,w=e,x=g,v=void 0,p=void 0,y=void 0,
+z=void 0,C=void 0,D=void 0,E=void 0,F=void 0,B=void 0,p=n[x[o]].x,y=n[x[o]].y,z=n[x[t]].x,C=n[x[t]].y,D=n[x[u]].x,E=n[x[u]].y;if(1.0E-10>(z-p)*(E-y)-(C-y)*(D-p))n=!1;else{for(v=0;v<w;v++)if(!(v==o||v==t||v==u)){var F=n[x[v]].x,B=n[x[v]].y,J=void 0,L=void 0,G=void 0,M=void 0,H=void 0,A=void 0,I=void 0,K=void 0,N=void 0,P=void 0,Q=void 0,R=void 0,J=G=H=void 0,J=D-z,L=E-C,G=p-D,M=y-E,H=z-p,A=C-y,I=F-p,K=B-y,N=F-z,P=B-C,Q=F-D,R=B-E,J=J*P-L*N,H=H*K-A*I,G=G*R-M*Q;if(J>=0&&G>=0&&H>=0){n=!1;break a}}n=!0}}if(n){m=
 g[h];n=g[k];o=g[l];f.push(a[m]);f.push(a[n]);f.push(a[o]);j.push([g[h],g[k],g[l]]);h=k;for(l=k+1;l<e;h++,l++)g[h]=g[l];e--;m=2*e}}if(d)return j;return f};a.Triangulate.area=b;return a})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 g[h];n=g[k];o=g[l];f.push(a[m]);f.push(a[n]);f.push(a[o]);j.push([g[h],g[k],g[l]]);h=k;for(l=k+1;l<e;h++,l++)g[h]=g[l];e--;m=2*e}}if(d)return j;return f};a.Triangulate.area=b;return a})(THREE.FontUtils);window._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 THREE.TorusGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=d||6;a=[];for(b=0;b<=this.segmentsR;++b)for(c=0;c<=this.segmentsT;++c){var d=c/this.segmentsT*2*Math.PI,e=b/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(e))*Math.cos(d),(this.radius+this.tube*Math.cos(e))*Math.sin(d),this.tube*Math.sin(e))));a.push([c/this.segmentsT,1-b/this.segmentsR])}for(b=1;b<=this.segmentsR;++b)for(c=
 THREE.TorusGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=d||6;a=[];for(b=0;b<=this.segmentsR;++b)for(c=0;c<=this.segmentsT;++c){var d=c/this.segmentsT*2*Math.PI,e=b/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(e))*Math.cos(d),(this.radius+this.tube*Math.cos(e))*Math.sin(d),this.tube*Math.sin(e))));a.push([c/this.segmentsT,1-b/this.segmentsR])}for(b=1;b<=this.segmentsR;++b)for(c=
 1;c<=this.segmentsT;++c){var d=(this.segmentsT+1)*b+c,e=(this.segmentsT+1)*b+c-1,f=(this.segmentsT+1)*(b-1)+c-1,g=(this.segmentsT+1)*(b-1)+c;this.faces.push(new THREE.Face4(d,e,f,g));this.faceVertexUvs[0].push([new THREE.UV(a[d][0],a[d][1]),new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[g][0],a[g][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusGeometry.prototype=new THREE.Geometry;
 1;c<=this.segmentsT;++c){var d=(this.segmentsT+1)*b+c,e=(this.segmentsT+1)*b+c-1,f=(this.segmentsT+1)*(b-1)+c-1,g=(this.segmentsT+1)*(b-1)+c;this.faces.push(new THREE.Face4(d,e,f,g));this.faceVertexUvs[0].push([new THREE.UV(a[d][0],a[d][1]),new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[g][0],a[g][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusGeometry.prototype=new THREE.Geometry;
@@ -131,51 +131,51 @@ Math.LN2));a.image.width=b;a.image.height=d;a.image.getContext("2d").drawImage(t
 f.map.wrapT=THREE.RepeatWrapping;a.mapDiffuseOffset&&f.map.offset.set(a.mapDiffuseOffset[0],a.mapDiffuseOffset[1]);d(f.map,b+"/"+a.mapDiffuse)}else if(a.colorDiffuse)g=(a.colorDiffuse[0]*255<<16)+(a.colorDiffuse[1]*255<<8)+a.colorDiffuse[2]*255,f.color=g,f.opacity=a.transparency;else if(a.DbgColor)f.color=a.DbgColor;if(a.mapLight&&b){g=document.createElement("canvas");f.lightMap=new THREE.Texture(g);f.lightMap.sourceFile=a.mapLight;if(a.mapLightmapRepeat)f.lightMap.repeat.set(a.mapLightRepeat[0],
 f.map.wrapT=THREE.RepeatWrapping;a.mapDiffuseOffset&&f.map.offset.set(a.mapDiffuseOffset[0],a.mapDiffuseOffset[1]);d(f.map,b+"/"+a.mapDiffuse)}else if(a.colorDiffuse)g=(a.colorDiffuse[0]*255<<16)+(a.colorDiffuse[1]*255<<8)+a.colorDiffuse[2]*255,f.color=g,f.opacity=a.transparency;else if(a.DbgColor)f.color=a.DbgColor;if(a.mapLight&&b){g=document.createElement("canvas");f.lightMap=new THREE.Texture(g);f.lightMap.sourceFile=a.mapLight;if(a.mapLightmapRepeat)f.lightMap.repeat.set(a.mapLightRepeat[0],
 a.mapLightRepeat[1]),f.lightMap.wrapS=f.lightMap.wrapT=THREE.RepeatWrapping;a.mapLightmapOffset&&f.lightMap.offset.set(a.mapLightmapOffset[0],a.mapLightmapOffset[1]);d(f.lightMap,b+"/"+a.mapLightmap)}return new THREE[e](f)}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;
 a.mapLightRepeat[1]),f.lightMap.wrapS=f.lightMap.wrapT=THREE.RepeatWrapping;a.mapLightmapOffset&&f.lightMap.offset.set(a.mapLightmapOffset[0],a.mapLightmapOffset[1]);d(f.lightMap,b+"/"+a.mapLightmap)}return new THREE[e](f)}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;
 THREE.JSONLoader.prototype.load=function(a){var b=this,c=a.model,d=a.callback,e=a.texture_path?a.texture_path:this.extractUrlbase(c),a=new Worker(c);a.onmessage=function(a){b.createModel(a.data,d,e);b.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
 THREE.JSONLoader.prototype.load=function(a){var b=this,c=a.model,d=a.callback,e=a.texture_path?a.texture_path:this.extractUrlbase(c),a=new Worker(c);a.onmessage=function(a){b.createModel(a.data,d,e);b.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
-THREE.JSONLoader.prototype.createModel=function(a,b,c){var d=new THREE.Geometry,e=a.scale!==void 0?1/a.scale:1;this.init_materials(d,a.materials,c);(function(c){if(a.version===void 0||a.version!=2)console.error("Deprecated file format.");else{var b,e,h,k,l,m,n,o,u,t,v,x,w,p,y=a.faces;m=a.vertices;var z=a.normals,C=a.colors,D=0;for(b=0;b<a.uvs.length;b++)a.uvs[b].length&&D++;for(b=0;b<D;b++)d.faceUvs[b]=[],d.faceVertexUvs[b]=[];k=0;for(l=m.length;k<l;)n=new THREE.Vertex,n.position.x=m[k++]*c,n.position.y=
-m[k++]*c,n.position.z=m[k++]*c,d.vertices.push(n);k=0;for(l=y.length;k<l;){c=y[k++];m=c&1;h=c&2;b=c&4;e=c&8;o=c&16;n=c&32;t=c&64;c&=128;m?(v=new THREE.Face4,v.a=y[k++],v.b=y[k++],v.c=y[k++],v.d=y[k++],m=4):(v=new THREE.Face3,v.a=y[k++],v.b=y[k++],v.c=y[k++],m=3);if(h)h=y[k++],v.materials=d.materials[h];h=d.faces.length;if(b)for(b=0;b<D;b++)x=a.uvs[b],u=y[k++],p=x[u*2],u=x[u*2+1],d.faceUvs[b][h]=new THREE.UV(p,u);if(e)for(b=0;b<D;b++){x=a.uvs[b];w=[];for(e=0;e<m;e++)u=y[k++],p=x[u*2],u=x[u*2+1],w[e]=
-new THREE.UV(p,u);d.faceVertexUvs[b][h]=w}if(o)o=y[k++]*3,e=new THREE.Vector3,e.x=z[o++],e.y=z[o++],e.z=z[o],v.normal=e;if(n)for(b=0;b<m;b++)o=y[k++]*3,e=new THREE.Vector3,e.x=z[o++],e.y=z[o++],e.z=z[o],v.vertexNormals.push(e);if(t)n=y[k++],n=new THREE.Color(C[n]),v.color=n;if(c)for(b=0;b<m;b++)n=y[k++],n=new THREE.Color(C[n]),v.vertexColors.push(n);d.faces.push(v)}}})(e);(function(){var c,b,e,h;if(a.skinWeights){c=0;for(b=a.skinWeights.length;c<b;c+=2)e=a.skinWeights[c],h=a.skinWeights[c+1],d.skinWeights.push(new THREE.Vector4(e,
-h,0,0))}if(a.skinIndices){c=0;for(b=a.skinIndices.length;c<b;c+=2)e=a.skinIndices[c],h=a.skinIndices[c+1],d.skinIndices.push(new THREE.Vector4(e,h,0,0))}d.bones=a.bones;d.animation=a.animation})();(function(c){if(a.morphTargets!==void 0){var b,e,h,k,l,m,n,o,u;b=0;for(e=a.morphTargets.length;b<e;b++){d.morphTargets[b]={};d.morphTargets[b].name=a.morphTargets[b].name;d.morphTargets[b].vertices=[];o=d.morphTargets[b].vertices;u=a.morphTargets[b].vertices;h=0;for(k=u.length;h<k;h+=3)l=u[h]*c,m=u[h+1]*
-c,n=u[h+2]*c,o.push(new THREE.Vertex(new THREE.Vector3(l,m,n)))}}if(a.morphColors!==void 0){b=0;for(e=a.morphColors.length;b<e;b++){d.morphColors[b]={};d.morphColors[b].name=a.morphColors[b].name;d.morphColors[b].colors=[];k=d.morphColors[b].colors;l=a.morphColors[b].colors;c=0;for(h=l.length;c<h;c+=3)m=new THREE.Color(16755200),m.setRGB(l[c],l[c+1],l[c+2]),k.push(m)}}})(e);(function(){if(a.edges!==void 0){var c,b,e;for(c=0;c<a.edges.length;c+=2)b=a.edges[c],e=a.edges[c+1],d.edges.push(new THREE.Edge(d.vertices[b],
+THREE.JSONLoader.prototype.createModel=function(a,b,c){var d=new THREE.Geometry,e=a.scale!==void 0?1/a.scale:1;this.init_materials(d,a.materials,c);(function(c){if(a.version===void 0||a.version!=2)console.error("Deprecated file format.");else{var b,e,h,k,l,m,n,o,t,u,w,x,v,p,y=a.faces;m=a.vertices;var z=a.normals,C=a.colors,D=0;for(b=0;b<a.uvs.length;b++)a.uvs[b].length&&D++;for(b=0;b<D;b++)d.faceUvs[b]=[],d.faceVertexUvs[b]=[];k=0;for(l=m.length;k<l;)n=new THREE.Vertex,n.position.x=m[k++]*c,n.position.y=
+m[k++]*c,n.position.z=m[k++]*c,d.vertices.push(n);k=0;for(l=y.length;k<l;){c=y[k++];m=c&1;h=c&2;b=c&4;e=c&8;o=c&16;n=c&32;u=c&64;c&=128;m?(w=new THREE.Face4,w.a=y[k++],w.b=y[k++],w.c=y[k++],w.d=y[k++],m=4):(w=new THREE.Face3,w.a=y[k++],w.b=y[k++],w.c=y[k++],m=3);if(h)h=y[k++],w.materials=d.materials[h];h=d.faces.length;if(b)for(b=0;b<D;b++)x=a.uvs[b],t=y[k++],p=x[t*2],t=x[t*2+1],d.faceUvs[b][h]=new THREE.UV(p,t);if(e)for(b=0;b<D;b++){x=a.uvs[b];v=[];for(e=0;e<m;e++)t=y[k++],p=x[t*2],t=x[t*2+1],v[e]=
+new THREE.UV(p,t);d.faceVertexUvs[b][h]=v}if(o)o=y[k++]*3,e=new THREE.Vector3,e.x=z[o++],e.y=z[o++],e.z=z[o],w.normal=e;if(n)for(b=0;b<m;b++)o=y[k++]*3,e=new THREE.Vector3,e.x=z[o++],e.y=z[o++],e.z=z[o],w.vertexNormals.push(e);if(u)n=y[k++],n=new THREE.Color(C[n]),w.color=n;if(c)for(b=0;b<m;b++)n=y[k++],n=new THREE.Color(C[n]),w.vertexColors.push(n);d.faces.push(w)}}})(e);(function(){var c,b,e,h;if(a.skinWeights){c=0;for(b=a.skinWeights.length;c<b;c+=2)e=a.skinWeights[c],h=a.skinWeights[c+1],d.skinWeights.push(new THREE.Vector4(e,
+h,0,0))}if(a.skinIndices){c=0;for(b=a.skinIndices.length;c<b;c+=2)e=a.skinIndices[c],h=a.skinIndices[c+1],d.skinIndices.push(new THREE.Vector4(e,h,0,0))}d.bones=a.bones;d.animation=a.animation})();(function(c){if(a.morphTargets!==void 0){var b,e,h,k,l,m,n,o,t;b=0;for(e=a.morphTargets.length;b<e;b++){d.morphTargets[b]={};d.morphTargets[b].name=a.morphTargets[b].name;d.morphTargets[b].vertices=[];o=d.morphTargets[b].vertices;t=a.morphTargets[b].vertices;h=0;for(k=t.length;h<k;h+=3)l=t[h]*c,m=t[h+1]*
+c,n=t[h+2]*c,o.push(new THREE.Vertex(new THREE.Vector3(l,m,n)))}}if(a.morphColors!==void 0){b=0;for(e=a.morphColors.length;b<e;b++){d.morphColors[b]={};d.morphColors[b].name=a.morphColors[b].name;d.morphColors[b].colors=[];k=d.morphColors[b].colors;l=a.morphColors[b].colors;c=0;for(h=l.length;c<h;c+=3)m=new THREE.Color(16755200),m.setRGB(l[c],l[c+1],l[c+2]),k.push(m)}}})(e);(function(){if(a.edges!==void 0){var c,b,e;for(c=0;c<a.edges.length;c+=2)b=a.edges[c],e=a.edges[c+1],d.edges.push(new THREE.Edge(d.vertices[b],
 d.vertices[e],b,e))}})();d.computeCentroids();d.computeFaceNormals();b(d)};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
 d.vertices[e],b,e))}})();d.computeCentroids();d.computeFaceNormals();b(d)};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
 THREE.BinaryLoader.prototype={load:function(a){var b=a.model,c=a.callback,d=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(b),e=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(b),a=(new Date).getTime(),b=new Worker(b),f=this.showProgress?THREE.Loader.prototype.updateProgress:null;b.onmessage=function(a){THREE.BinaryLoader.prototype.loadAjaxBuffers(a.data.buffers,a.data.materials,c,e,d,f)};b.onerror=function(a){alert("worker.onerror: "+a.message+"\n"+a.data);a.preventDefault()};
 THREE.BinaryLoader.prototype={load:function(a){var b=a.model,c=a.callback,d=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(b),e=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(b),a=(new Date).getTime(),b=new Worker(b),f=this.showProgress?THREE.Loader.prototype.updateProgress:null;b.onmessage=function(a){THREE.BinaryLoader.prototype.loadAjaxBuffers(a.data.buffers,a.data.materials,c,e,d,f)};b.onerror=function(a){alert("worker.onerror: "+a.message+"\n"+a.data);a.preventDefault()};
 b.postMessage(a)},loadAjaxBuffers:function(a,b,c,d,e,f){var g=new XMLHttpRequest,j=d+"/"+a,h=0;g.onreadystatechange=function(){g.readyState==4?g.status==200||g.status==0?THREE.BinaryLoader.prototype.createBinModel(g.responseText,c,e,b):alert("Couldn't load ["+j+"] ["+g.status+"]"):g.readyState==3?f&&(h==0&&(h=g.getResponseHeader("Content-Length")),f({total:h,loaded:g.responseText.length})):g.readyState==2&&(h=g.getResponseHeader("Content-Length"))};g.open("GET",j,!0);g.overrideMimeType("text/plain; charset=x-user-defined");
 b.postMessage(a)},loadAjaxBuffers:function(a,b,c,d,e,f){var g=new XMLHttpRequest,j=d+"/"+a,h=0;g.onreadystatechange=function(){g.readyState==4?g.status==200||g.status==0?THREE.BinaryLoader.prototype.createBinModel(g.responseText,c,e,b):alert("Couldn't load ["+j+"] ["+g.status+"]"):g.readyState==3?f&&(h==0&&(h=g.getResponseHeader("Content-Length")),f({total:h,loaded:g.responseText.length})):g.readyState==2&&(h=g.getResponseHeader("Content-Length"))};g.open("GET",j,!0);g.overrideMimeType("text/plain; charset=x-user-defined");
 g.setRequestHeader("Content-Type","text/plain");g.send(null)},createBinModel:function(a,b,c,d){var e=function(c){function b(a,c){var d=l(a,c),e=l(a,c+1),f=l(a,c+2),g=l(a,c+3),h=(g<<1&255|f>>7)-127;d|=(f&127)<<16|e<<8;if(d==0&&h==-127)return 0;return(1-2*(g>>7))*(1+d*Math.pow(2,-23))*Math.pow(2,h)}function e(a,c){var b=l(a,c),d=l(a,c+1),f=l(a,c+2);return(l(a,c+3)<<24)+(f<<16)+(d<<8)+b}function h(a,c){var b=l(a,c);return(l(a,c+1)<<8)+b}function k(a,c){var b=l(a,c);return b>127?b-256:b}function l(a,
 g.setRequestHeader("Content-Type","text/plain");g.send(null)},createBinModel:function(a,b,c,d){var e=function(c){function b(a,c){var d=l(a,c),e=l(a,c+1),f=l(a,c+2),g=l(a,c+3),h=(g<<1&255|f>>7)-127;d|=(f&127)<<16|e<<8;if(d==0&&h==-127)return 0;return(1-2*(g>>7))*(1+d*Math.pow(2,-23))*Math.pow(2,h)}function e(a,c){var b=l(a,c),d=l(a,c+1),f=l(a,c+2);return(l(a,c+3)<<24)+(f<<16)+(d<<8)+b}function h(a,c){var b=l(a,c);return(l(a,c+1)<<8)+b}function k(a,c){var b=l(a,c);return b>127?b-256:b}function l(a,
-c){return a.charCodeAt(c)&255}function m(c){var b,d,f;b=e(a,c);d=e(a,c+C);f=e(a,c+D);c=h(a,c+E);THREE.BinaryLoader.prototype.f3(x,b,d,f,c)}function n(c){var b,d,f,g,k,l;b=e(a,c);d=e(a,c+C);f=e(a,c+D);g=h(a,c+E);k=e(a,c+F);l=e(a,c+B);c=e(a,c+J);THREE.BinaryLoader.prototype.f3n(x,y,b,d,f,g,k,l,c)}function o(c){var b,d,f,g;b=e(a,c);d=e(a,c+L);f=e(a,c+G);g=e(a,c+M);c=h(a,c+H);THREE.BinaryLoader.prototype.f4(x,b,d,f,g,c)}function u(c){var b,d,f,g,k,l,m,n;b=e(a,c);d=e(a,c+L);f=e(a,c+G);g=e(a,c+M);k=h(a,
-c+H);l=e(a,c+A);m=e(a,c+I);n=e(a,c+K);c=e(a,c+N);THREE.BinaryLoader.prototype.f4n(x,y,b,d,f,g,k,l,m,n,c)}function t(c){var b,d;b=e(a,c);d=e(a,c+P);c=e(a,c+Q);THREE.BinaryLoader.prototype.uv3(x.faceVertexUvs[0],z[b*2],z[b*2+1],z[d*2],z[d*2+1],z[c*2],z[c*2+1])}function v(c){var b,d,f;b=e(a,c);d=e(a,c+R);f=e(a,c+X);c=e(a,c+Y);THREE.BinaryLoader.prototype.uv4(x.faceVertexUvs[0],z[b*2],z[b*2+1],z[d*2],z[d*2+1],z[f*2],z[f*2+1],z[c*2],z[c*2+1])}var x=this,w=0,p,y=[],z=[],C,D,E,F,B,J,L,G,M,H,A,I,K,N,P,Q,
-R,X,Y,S,T,U,V,W,O;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(x,d,c);p={signature:a.substr(w,8),header_bytes:l(a,w+8),vertex_coordinate_bytes:l(a,w+9),normal_coordinate_bytes:l(a,w+10),uv_coordinate_bytes:l(a,w+11),vertex_index_bytes:l(a,w+12),normal_index_bytes:l(a,w+13),uv_index_bytes:l(a,w+14),material_index_bytes:l(a,w+15),nvertices:e(a,w+16),nnormals:e(a,w+16+4),nuvs:e(a,w+16+8),ntri_flat:e(a,w+16+12),ntri_smooth:e(a,w+16+16),ntri_flat_uv:e(a,w+16+20),ntri_smooth_uv:e(a,w+
-16+24),nquad_flat:e(a,w+16+28),nquad_smooth:e(a,w+16+32),nquad_flat_uv:e(a,w+16+36),nquad_smooth_uv:e(a,w+16+40)};w+=p.header_bytes;C=p.vertex_index_bytes;D=p.vertex_index_bytes*2;E=p.vertex_index_bytes*3;F=p.vertex_index_bytes*3+p.material_index_bytes;B=p.vertex_index_bytes*3+p.material_index_bytes+p.normal_index_bytes;J=p.vertex_index_bytes*3+p.material_index_bytes+p.normal_index_bytes*2;L=p.vertex_index_bytes;G=p.vertex_index_bytes*2;M=p.vertex_index_bytes*3;H=p.vertex_index_bytes*4;A=p.vertex_index_bytes*
+c){return a.charCodeAt(c)&255}function m(c){var b,d,f;b=e(a,c);d=e(a,c+C);f=e(a,c+D);c=h(a,c+E);THREE.BinaryLoader.prototype.f3(x,b,d,f,c)}function n(c){var b,d,f,g,k,l;b=e(a,c);d=e(a,c+C);f=e(a,c+D);g=h(a,c+E);k=e(a,c+F);l=e(a,c+B);c=e(a,c+J);THREE.BinaryLoader.prototype.f3n(x,y,b,d,f,g,k,l,c)}function o(c){var b,d,f,g;b=e(a,c);d=e(a,c+L);f=e(a,c+G);g=e(a,c+M);c=h(a,c+H);THREE.BinaryLoader.prototype.f4(x,b,d,f,g,c)}function t(c){var b,d,f,g,k,l,m,n;b=e(a,c);d=e(a,c+L);f=e(a,c+G);g=e(a,c+M);k=h(a,
+c+H);l=e(a,c+A);m=e(a,c+I);n=e(a,c+K);c=e(a,c+N);THREE.BinaryLoader.prototype.f4n(x,y,b,d,f,g,k,l,m,n,c)}function u(c){var b,d;b=e(a,c);d=e(a,c+P);c=e(a,c+Q);THREE.BinaryLoader.prototype.uv3(x.faceVertexUvs[0],z[b*2],z[b*2+1],z[d*2],z[d*2+1],z[c*2],z[c*2+1])}function w(c){var b,d,f;b=e(a,c);d=e(a,c+R);f=e(a,c+X);c=e(a,c+Y);THREE.BinaryLoader.prototype.uv4(x.faceVertexUvs[0],z[b*2],z[b*2+1],z[d*2],z[d*2+1],z[f*2],z[f*2+1],z[c*2],z[c*2+1])}var x=this,v=0,p,y=[],z=[],C,D,E,F,B,J,L,G,M,H,A,I,K,N,P,Q,
+R,X,Y,S,T,U,V,W,O;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(x,d,c);p={signature:a.substr(v,8),header_bytes:l(a,v+8),vertex_coordinate_bytes:l(a,v+9),normal_coordinate_bytes:l(a,v+10),uv_coordinate_bytes:l(a,v+11),vertex_index_bytes:l(a,v+12),normal_index_bytes:l(a,v+13),uv_index_bytes:l(a,v+14),material_index_bytes:l(a,v+15),nvertices:e(a,v+16),nnormals:e(a,v+16+4),nuvs:e(a,v+16+8),ntri_flat:e(a,v+16+12),ntri_smooth:e(a,v+16+16),ntri_flat_uv:e(a,v+16+20),ntri_smooth_uv:e(a,v+
+16+24),nquad_flat:e(a,v+16+28),nquad_smooth:e(a,v+16+32),nquad_flat_uv:e(a,v+16+36),nquad_smooth_uv:e(a,v+16+40)};v+=p.header_bytes;C=p.vertex_index_bytes;D=p.vertex_index_bytes*2;E=p.vertex_index_bytes*3;F=p.vertex_index_bytes*3+p.material_index_bytes;B=p.vertex_index_bytes*3+p.material_index_bytes+p.normal_index_bytes;J=p.vertex_index_bytes*3+p.material_index_bytes+p.normal_index_bytes*2;L=p.vertex_index_bytes;G=p.vertex_index_bytes*2;M=p.vertex_index_bytes*3;H=p.vertex_index_bytes*4;A=p.vertex_index_bytes*
 4+p.material_index_bytes;I=p.vertex_index_bytes*4+p.material_index_bytes+p.normal_index_bytes;K=p.vertex_index_bytes*4+p.material_index_bytes+p.normal_index_bytes*2;N=p.vertex_index_bytes*4+p.material_index_bytes+p.normal_index_bytes*3;P=p.uv_index_bytes;Q=p.uv_index_bytes*2;R=p.uv_index_bytes;X=p.uv_index_bytes*2;Y=p.uv_index_bytes*3;c=p.vertex_index_bytes*3+p.material_index_bytes;O=p.vertex_index_bytes*4+p.material_index_bytes;S=p.ntri_flat*c;T=p.ntri_smooth*(c+p.normal_index_bytes*3);U=p.ntri_flat_uv*
 4+p.material_index_bytes;I=p.vertex_index_bytes*4+p.material_index_bytes+p.normal_index_bytes;K=p.vertex_index_bytes*4+p.material_index_bytes+p.normal_index_bytes*2;N=p.vertex_index_bytes*4+p.material_index_bytes+p.normal_index_bytes*3;P=p.uv_index_bytes;Q=p.uv_index_bytes*2;R=p.uv_index_bytes;X=p.uv_index_bytes*2;Y=p.uv_index_bytes*3;c=p.vertex_index_bytes*3+p.material_index_bytes;O=p.vertex_index_bytes*4+p.material_index_bytes;S=p.ntri_flat*c;T=p.ntri_smooth*(c+p.normal_index_bytes*3);U=p.ntri_flat_uv*
-(c+p.uv_index_bytes*3);V=p.ntri_smooth_uv*(c+p.normal_index_bytes*3+p.uv_index_bytes*3);W=p.nquad_flat*O;c=p.nquad_smooth*(O+p.normal_index_bytes*4);O=p.nquad_flat_uv*(O+p.uv_index_bytes*4);w+=function(c){for(var d,e,f,h=p.vertex_coordinate_bytes*3,j=c+p.nvertices*h;c<j;c+=h)d=b(a,c),e=b(a,c+p.vertex_coordinate_bytes),f=b(a,c+p.vertex_coordinate_bytes*2),THREE.BinaryLoader.prototype.v(x,d,e,f);return p.nvertices*h}(w);w+=function(c){for(var b,d,e,f=p.normal_coordinate_bytes*3,g=c+p.nnormals*f;c<g;c+=
-f)b=k(a,c),d=k(a,c+p.normal_coordinate_bytes),e=k(a,c+p.normal_coordinate_bytes*2),y.push(b/127,d/127,e/127);return p.nnormals*f}(w);w+=function(c){for(var d,e,f=p.uv_coordinate_bytes*2,h=c+p.nuvs*f;c<h;c+=f)d=b(a,c),e=b(a,c+p.uv_coordinate_bytes),z.push(d,e);return p.nuvs*f}(w);S=w+S;T=S+T;U=T+U;V=U+V;W=V+W;c=W+c;O=c+O;(function(a){var c,b=p.vertex_index_bytes*3+p.material_index_bytes,d=b+p.uv_index_bytes*3,e=a+p.ntri_flat_uv*d;for(c=a;c<e;c+=d)m(c),t(c+b);return e-a})(T);(function(a){var c,b=p.vertex_index_bytes*
-3+p.material_index_bytes+p.normal_index_bytes*3,d=b+p.uv_index_bytes*3,e=a+p.ntri_smooth_uv*d;for(c=a;c<e;c+=d)n(c),t(c+b);return e-a})(U);(function(a){var c,b=p.vertex_index_bytes*4+p.material_index_bytes,d=b+p.uv_index_bytes*4,e=a+p.nquad_flat_uv*d;for(c=a;c<e;c+=d)o(c),v(c+b);return e-a})(c);(function(a){var c,b=p.vertex_index_bytes*4+p.material_index_bytes+p.normal_index_bytes*4,d=b+p.uv_index_bytes*4,e=a+p.nquad_smooth_uv*d;for(c=a;c<e;c+=d)u(c),v(c+b);return e-a})(O);(function(a){var c,b=p.vertex_index_bytes*
-3+p.material_index_bytes,d=a+p.ntri_flat*b;for(c=a;c<d;c+=b)m(c);return d-a})(w);(function(a){var c,b=p.vertex_index_bytes*3+p.material_index_bytes+p.normal_index_bytes*3,d=a+p.ntri_smooth*b;for(c=a;c<d;c+=b)n(c);return d-a})(S);(function(a){var c,b=p.vertex_index_bytes*4+p.material_index_bytes,d=a+p.nquad_flat*b;for(c=a;c<d;c+=b)o(c);return d-a})(V);(function(a){var c,b=p.vertex_index_bytes*4+p.material_index_bytes+p.normal_index_bytes*4,d=a+p.nquad_smooth*b;for(c=a;c<d;c+=b)u(c);return d-a})(W);
+(c+p.uv_index_bytes*3);V=p.ntri_smooth_uv*(c+p.normal_index_bytes*3+p.uv_index_bytes*3);W=p.nquad_flat*O;c=p.nquad_smooth*(O+p.normal_index_bytes*4);O=p.nquad_flat_uv*(O+p.uv_index_bytes*4);v+=function(c){for(var d,e,f,h=p.vertex_coordinate_bytes*3,j=c+p.nvertices*h;c<j;c+=h)d=b(a,c),e=b(a,c+p.vertex_coordinate_bytes),f=b(a,c+p.vertex_coordinate_bytes*2),THREE.BinaryLoader.prototype.v(x,d,e,f);return p.nvertices*h}(v);v+=function(c){for(var b,d,e,f=p.normal_coordinate_bytes*3,g=c+p.nnormals*f;c<g;c+=
+f)b=k(a,c),d=k(a,c+p.normal_coordinate_bytes),e=k(a,c+p.normal_coordinate_bytes*2),y.push(b/127,d/127,e/127);return p.nnormals*f}(v);v+=function(c){for(var d,e,f=p.uv_coordinate_bytes*2,h=c+p.nuvs*f;c<h;c+=f)d=b(a,c),e=b(a,c+p.uv_coordinate_bytes),z.push(d,e);return p.nuvs*f}(v);S=v+S;T=S+T;U=T+U;V=U+V;W=V+W;c=W+c;O=c+O;(function(a){var c,b=p.vertex_index_bytes*3+p.material_index_bytes,d=b+p.uv_index_bytes*3,e=a+p.ntri_flat_uv*d;for(c=a;c<e;c+=d)m(c),u(c+b);return e-a})(T);(function(a){var c,b=p.vertex_index_bytes*
+3+p.material_index_bytes+p.normal_index_bytes*3,d=b+p.uv_index_bytes*3,e=a+p.ntri_smooth_uv*d;for(c=a;c<e;c+=d)n(c),u(c+b);return e-a})(U);(function(a){var c,b=p.vertex_index_bytes*4+p.material_index_bytes,d=b+p.uv_index_bytes*4,e=a+p.nquad_flat_uv*d;for(c=a;c<e;c+=d)o(c),w(c+b);return e-a})(c);(function(a){var c,b=p.vertex_index_bytes*4+p.material_index_bytes+p.normal_index_bytes*4,d=b+p.uv_index_bytes*4,e=a+p.nquad_smooth_uv*d;for(c=a;c<e;c+=d)t(c),w(c+b);return e-a})(O);(function(a){var c,b=p.vertex_index_bytes*
+3+p.material_index_bytes,d=a+p.ntri_flat*b;for(c=a;c<d;c+=b)m(c);return d-a})(v);(function(a){var c,b=p.vertex_index_bytes*3+p.material_index_bytes+p.normal_index_bytes*3,d=a+p.ntri_smooth*b;for(c=a;c<d;c+=b)n(c);return d-a})(S);(function(a){var c,b=p.vertex_index_bytes*4+p.material_index_bytes,d=a+p.nquad_flat*b;for(c=a;c<d;c+=b)o(c);return d-a})(V);(function(a){var c,b=p.vertex_index_bytes*4+p.material_index_bytes+p.normal_index_bytes*4,d=a+p.nquad_smooth*b;for(c=a;c<d;c+=b)t(c);return d-a})(W);
 this.computeCentroids();this.computeFaceNormals()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;b(new e(c))},v:function(a,b,c,d){a.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,d)))},f3:function(a,b,c,d,e){a.faces.push(new THREE.Face3(b,c,d,null,null,a.materials[e]))},f4:function(a,b,c,d,e,f){a.faces.push(new THREE.Face4(b,c,d,e,null,null,a.materials[f]))},f3n:function(a,b,c,d,e,f,g,j,h){var f=a.materials[f],k=b[j*3],l=b[j*3+1],j=b[j*3+2],m=b[h*3],n=b[h*3+1],h=b[h*3+2];a.faces.push(new THREE.Face3(c,
 this.computeCentroids();this.computeFaceNormals()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;b(new e(c))},v:function(a,b,c,d){a.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,d)))},f3:function(a,b,c,d,e){a.faces.push(new THREE.Face3(b,c,d,null,null,a.materials[e]))},f4:function(a,b,c,d,e,f){a.faces.push(new THREE.Face4(b,c,d,e,null,null,a.materials[f]))},f3n:function(a,b,c,d,e,f,g,j,h){var f=a.materials[f],k=b[j*3],l=b[j*3+1],j=b[j*3+2],m=b[h*3],n=b[h*3+1],h=b[h*3+2];a.faces.push(new THREE.Face3(c,
-d,e,[new THREE.Vector3(b[g*3],b[g*3+1],b[g*3+2]),new THREE.Vector3(k,l,j),new THREE.Vector3(m,n,h)],null,f))},f4n:function(a,b,c,d,e,f,g,j,h,k,l){var g=a.materials[g],m=b[h*3],n=b[h*3+1],h=b[h*3+2],o=b[k*3],u=b[k*3+1],k=b[k*3+2],t=b[l*3],v=b[l*3+1],l=b[l*3+2];a.faces.push(new THREE.Face4(c,d,e,f,[new THREE.Vector3(b[j*3],b[j*3+1],b[j*3+2]),new THREE.Vector3(m,n,h),new THREE.Vector3(o,u,k),new THREE.Vector3(t,v,l)],null,g))},uv3:function(a,b,c,d,e,f,g){var j=[];j.push(new THREE.UV(b,c));j.push(new THREE.UV(d,
+d,e,[new THREE.Vector3(b[g*3],b[g*3+1],b[g*3+2]),new THREE.Vector3(k,l,j),new THREE.Vector3(m,n,h)],null,f))},f4n:function(a,b,c,d,e,f,g,j,h,k,l){var g=a.materials[g],m=b[h*3],n=b[h*3+1],h=b[h*3+2],o=b[k*3],t=b[k*3+1],k=b[k*3+2],u=b[l*3],w=b[l*3+1],l=b[l*3+2];a.faces.push(new THREE.Face4(c,d,e,f,[new THREE.Vector3(b[j*3],b[j*3+1],b[j*3+2]),new THREE.Vector3(m,n,h),new THREE.Vector3(o,t,k),new THREE.Vector3(u,w,l)],null,g))},uv3:function(a,b,c,d,e,f,g){var j=[];j.push(new THREE.UV(b,c));j.push(new THREE.UV(d,
 e));j.push(new THREE.UV(f,g));a.push(j)},uv4:function(a,b,c,d,e,f,g,j,h){var k=[];k.push(new THREE.UV(b,c));k.push(new THREE.UV(d,e));k.push(new THREE.UV(f,g));k.push(new THREE.UV(j,h));a.push(k)}};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
 e));j.push(new THREE.UV(f,g));a.push(j)},uv4:function(a,b,c,d,e,f,g,j,h){var k=[];k.push(new THREE.UV(b,c));k.push(new THREE.UV(d,e));k.push(new THREE.UV(f,g));k.push(new THREE.UV(j,h));a.push(k)}};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
-THREE.SceneLoader.prototype={load:function(a,b){var c=this,d=new Worker(a);d.postMessage(0);var e=THREE.Loader.prototype.extractUrlbase(a);d.onmessage=function(a){function d(a,c){return c=="relativeToHTML"?a:e+"/"+a}function j(){for(o in B.objects)if(!A.objects[o])if(w=B.objects[o],w.geometry!==void 0){if(C=A.geometries[w.geometry]){F=[];for(N=0;N<w.materials.length;N++)F[N]=A.materials[w.materials[N]];p=w.position;r=w.rotation;q=w.quaternion;s=w.scale;q=0;F.length==0&&(F[0]=new THREE.MeshFaceMaterial);
-F.length>1&&(F=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(C,F);object.name=o;object.position.set(p[0],p[1],p[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=w.visible;A.scene.addObject(object);A.objects[o]=object;if(w.meshCollider){var a=THREE.CollisionUtils.MeshColliderWBox(object);A.scene.collisions.colliders.push(a)}if(w.castsShadow)a=new THREE.ShadowVolume(C),A.scene.addChild(a),
-a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;w.trigger&&w.trigger.toLowerCase()!="none"&&(a={type:w.trigger,object:w},A.triggers[object.name]=a)}}else p=w.position,r=w.rotation,q=w.quaternion,s=w.scale,q=0,object=new THREE.Object3D,object.name=o,object.position.set(p[0],p[1],p[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=w.visible!==void 0?w.visible:!1,A.scene.addObject(object),
-A.objects[o]=object,A.empties[o]=object,w.trigger&&w.trigger.toLowerCase()!="none"&&(a={type:w.trigger,object:w},A.triggers[object.name]=a)}function h(a){return function(b){A.geometries[a]=b;j();L-=1;c.onLoadComplete();l()}}function k(a){return function(c){A.geometries[a]=c}}function l(){c.callbackProgress({totalModels:M,totalTextures:H,loadedModels:M-L,loadedTextures:H-G},A);c.onLoadProgress();L==0&&G==0&&b(A)}var m,n,o,u,t,v,x,w,p,y,z,C,D,E,F,B,J,L,G,M,H,A;B=a.data;a=new THREE.BinaryLoader;J=new THREE.JSONLoader;
-G=L=0;A={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};var I=!1;for(o in B.objects)if(w=B.objects[o],w.meshCollider){I=!0;break}if(I)A.scene.collisions=new THREE.CollisionSystem;if(B.transform){I=B.transform.position;y=B.transform.rotation;var K=B.transform.scale;I&&A.scene.position.set(I[0],I[1],I[2]);y&&A.scene.rotation.set(y[0],y[1],y[2]);K&&A.scene.scale.set(K[0],K[1],K[2]);(I||y||K)&&A.scene.updateMatrix()}I=function(){G-=
-1;l();c.onLoadComplete()};for(t in B.cameras){y=B.cameras[t];if(y.type=="perspective")D=new THREE.Camera(y.fov,y.aspect,y.near,y.far);else if(y.type=="ortho")D=new THREE.Camera,D.projectionMatrix=THREE.Matrix4.makeOrtho(y.left,y.right,y.top,y.bottom,y.near,y.far);p=y.position;y=y.target;D.position.set(p[0],p[1],p[2]);D.target.position.set(y[0],y[1],y[2]);A.cameras[t]=D}for(u in B.lights){t=B.lights[u];D=t.color!==void 0?t.color:16777215;y=t.intensity!==void 0?t.intensity:1;if(t.type=="directional")p=
-t.direction,light=new THREE.DirectionalLight(D,y),light.position.set(p[0],p[1],p[2]),light.position.normalize();else if(t.type=="point")p=t.position,light=new THREE.PointLight(D,y),light.position.set(p[0],p[1],p[2]);A.scene.addLight(light);A.lights[u]=light}for(v in B.fogs)u=B.fogs[v],u.type=="linear"?E=new THREE.Fog(0,u.near,u.far):u.type=="exp2"&&(E=new THREE.FogExp2(0,u.density)),y=u.color,E.color.setRGB(y[0],y[1],y[2]),A.fogs[v]=E;if(A.cameras&&B.defaults.camera)A.currentCamera=A.cameras[B.defaults.camera];
-if(A.fogs&&B.defaults.fog)A.scene.fog=A.fogs[B.defaults.fog];y=B.defaults.bgcolor;A.bgColor=new THREE.Color;A.bgColor.setRGB(y[0],y[1],y[2]);A.bgColorAlpha=B.defaults.bgalpha;for(m in B.geometries)if(v=B.geometries[m],v.type=="bin_mesh"||v.type=="ascii_mesh")L+=1,c.onLoadStart();M=L;for(m in B.geometries)v=B.geometries[m],v.type=="cube"?(C=new THREE.CubeGeometry(v.width,v.height,v.depth,v.segmentsWidth,v.segmentsHeight,v.segmentsDepth,null,v.flipped,v.sides),A.geometries[m]=C):v.type=="plane"?(C=
-new THREE.PlaneGeometry(v.width,v.height,v.segmentsWidth,v.segmentsHeight),A.geometries[m]=C):v.type=="sphere"?(C=new THREE.SphereGeometry(v.radius,v.segmentsWidth,v.segmentsHeight),A.geometries[m]=C):v.type=="cylinder"?(C=new THREE.CylinderGeometry(v.numSegs,v.topRad,v.botRad,v.height,v.topOffset,v.botOffset),A.geometries[m]=C):v.type=="torus"?(C=new THREE.TorusGeometry(v.radius,v.tube,v.segmentsR,v.segmentsT),A.geometries[m]=C):v.type=="icosahedron"?(C=new THREE.IcosahedronGeometry(v.subdivisions),
-A.geometries[m]=C):v.type=="bin_mesh"?a.load({model:d(v.url,B.urlBaseType),callback:h(m)}):v.type=="ascii_mesh"?J.load({model:d(v.url,B.urlBaseType),callback:h(m)}):v.type=="embedded_mesh"&&(v=B.embeds[v.id])&&J.createModel(v,k(m),"");for(x in B.textures)if(m=B.textures[x],m.url instanceof Array){G+=m.url.length;for(a=0;a<m.url.length;a++)c.onLoadStart()}else G+=1,c.onLoadStart();H=G;for(x in B.textures){m=B.textures[x];if(m.mapping!=void 0&&THREE[m.mapping]!=void 0)m.mapping=new THREE[m.mapping];
+THREE.SceneLoader.prototype={load:function(a,b){var c=this,d=new Worker(a);d.postMessage(0);var e=THREE.Loader.prototype.extractUrlbase(a);d.onmessage=function(a){function d(a,c){return c=="relativeToHTML"?a:e+"/"+a}function j(){for(o in B.objects)if(!A.objects[o])if(v=B.objects[o],v.geometry!==void 0){if(C=A.geometries[v.geometry]){F=[];for(N=0;N<v.materials.length;N++)F[N]=A.materials[v.materials[N]];p=v.position;r=v.rotation;q=v.quaternion;s=v.scale;q=0;F.length==0&&(F[0]=new THREE.MeshFaceMaterial);
+F.length>1&&(F=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(C,F);object.name=o;object.position.set(p[0],p[1],p[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=v.visible;A.scene.addObject(object);A.objects[o]=object;if(v.meshCollider){var a=THREE.CollisionUtils.MeshColliderWBox(object);A.scene.collisions.colliders.push(a)}if(v.castsShadow)a=new THREE.ShadowVolume(C),A.scene.addChild(a),
+a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;v.trigger&&v.trigger.toLowerCase()!="none"&&(a={type:v.trigger,object:v},A.triggers[object.name]=a)}}else p=v.position,r=v.rotation,q=v.quaternion,s=v.scale,q=0,object=new THREE.Object3D,object.name=o,object.position.set(p[0],p[1],p[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=v.visible!==void 0?v.visible:!1,A.scene.addObject(object),
+A.objects[o]=object,A.empties[o]=object,v.trigger&&v.trigger.toLowerCase()!="none"&&(a={type:v.trigger,object:v},A.triggers[object.name]=a)}function h(a){return function(b){A.geometries[a]=b;j();L-=1;c.onLoadComplete();l()}}function k(a){return function(c){A.geometries[a]=c}}function l(){c.callbackProgress({totalModels:M,totalTextures:H,loadedModels:M-L,loadedTextures:H-G},A);c.onLoadProgress();L==0&&G==0&&b(A)}var m,n,o,t,u,w,x,v,p,y,z,C,D,E,F,B,J,L,G,M,H,A;B=a.data;a=new THREE.BinaryLoader;J=new THREE.JSONLoader;
+G=L=0;A={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};var I=!1;for(o in B.objects)if(v=B.objects[o],v.meshCollider){I=!0;break}if(I)A.scene.collisions=new THREE.CollisionSystem;if(B.transform){I=B.transform.position;y=B.transform.rotation;var K=B.transform.scale;I&&A.scene.position.set(I[0],I[1],I[2]);y&&A.scene.rotation.set(y[0],y[1],y[2]);K&&A.scene.scale.set(K[0],K[1],K[2]);(I||y||K)&&A.scene.updateMatrix()}I=function(){G-=
+1;l();c.onLoadComplete()};for(u in B.cameras){y=B.cameras[u];if(y.type=="perspective")D=new THREE.Camera(y.fov,y.aspect,y.near,y.far);else if(y.type=="ortho")D=new THREE.Camera,D.projectionMatrix=THREE.Matrix4.makeOrtho(y.left,y.right,y.top,y.bottom,y.near,y.far);p=y.position;y=y.target;D.position.set(p[0],p[1],p[2]);D.target.position.set(y[0],y[1],y[2]);A.cameras[u]=D}for(t in B.lights){u=B.lights[t];D=u.color!==void 0?u.color:16777215;y=u.intensity!==void 0?u.intensity:1;if(u.type=="directional")p=
+u.direction,light=new THREE.DirectionalLight(D,y),light.position.set(p[0],p[1],p[2]),light.position.normalize();else if(u.type=="point")p=u.position,light=new THREE.PointLight(D,y),light.position.set(p[0],p[1],p[2]);A.scene.addLight(light);A.lights[t]=light}for(w in B.fogs)t=B.fogs[w],t.type=="linear"?E=new THREE.Fog(0,t.near,t.far):t.type=="exp2"&&(E=new THREE.FogExp2(0,t.density)),y=t.color,E.color.setRGB(y[0],y[1],y[2]),A.fogs[w]=E;if(A.cameras&&B.defaults.camera)A.currentCamera=A.cameras[B.defaults.camera];
+if(A.fogs&&B.defaults.fog)A.scene.fog=A.fogs[B.defaults.fog];y=B.defaults.bgcolor;A.bgColor=new THREE.Color;A.bgColor.setRGB(y[0],y[1],y[2]);A.bgColorAlpha=B.defaults.bgalpha;for(m in B.geometries)if(w=B.geometries[m],w.type=="bin_mesh"||w.type=="ascii_mesh")L+=1,c.onLoadStart();M=L;for(m in B.geometries)w=B.geometries[m],w.type=="cube"?(C=new THREE.CubeGeometry(w.width,w.height,w.depth,w.segmentsWidth,w.segmentsHeight,w.segmentsDepth,null,w.flipped,w.sides),A.geometries[m]=C):w.type=="plane"?(C=
+new THREE.PlaneGeometry(w.width,w.height,w.segmentsWidth,w.segmentsHeight),A.geometries[m]=C):w.type=="sphere"?(C=new THREE.SphereGeometry(w.radius,w.segmentsWidth,w.segmentsHeight),A.geometries[m]=C):w.type=="cylinder"?(C=new THREE.CylinderGeometry(w.numSegs,w.topRad,w.botRad,w.height,w.topOffset,w.botOffset),A.geometries[m]=C):w.type=="torus"?(C=new THREE.TorusGeometry(w.radius,w.tube,w.segmentsR,w.segmentsT),A.geometries[m]=C):w.type=="icosahedron"?(C=new THREE.IcosahedronGeometry(w.subdivisions),
+A.geometries[m]=C):w.type=="bin_mesh"?a.load({model:d(w.url,B.urlBaseType),callback:h(m)}):w.type=="ascii_mesh"?J.load({model:d(w.url,B.urlBaseType),callback:h(m)}):w.type=="embedded_mesh"&&(w=B.embeds[w.id])&&J.createModel(w,k(m),"");for(x in B.textures)if(m=B.textures[x],m.url instanceof Array){G+=m.url.length;for(a=0;a<m.url.length;a++)c.onLoadStart()}else G+=1,c.onLoadStart();H=G;for(x in B.textures){m=B.textures[x];if(m.mapping!=void 0&&THREE[m.mapping]!=void 0)m.mapping=new THREE[m.mapping];
 if(m.url instanceof Array){for(var a=[],N=0;N<m.url.length;N++)a[N]=d(m.url[N],B.urlBaseType);a=THREE.ImageUtils.loadTextureCube(a,m.mapping,I)}else{a=THREE.ImageUtils.loadTexture(d(m.url,B.urlBaseType),m.mapping,I);if(THREE[m.minFilter]!=void 0)a.minFilter=THREE[m.minFilter];if(THREE[m.magFilter]!=void 0)a.magFilter=THREE[m.magFilter];if(m.repeat)a.repeat.set(m.repeat[0],m.repeat[1]),a.wrapS=a.wrapT=THREE.RepeatWrapping}A.textures[x]=a}for(n in B.materials){x=B.materials[n];for(z in x.parameters)if(z==
 if(m.url instanceof Array){for(var a=[],N=0;N<m.url.length;N++)a[N]=d(m.url[N],B.urlBaseType);a=THREE.ImageUtils.loadTextureCube(a,m.mapping,I)}else{a=THREE.ImageUtils.loadTexture(d(m.url,B.urlBaseType),m.mapping,I);if(THREE[m.minFilter]!=void 0)a.minFilter=THREE[m.minFilter];if(THREE[m.magFilter]!=void 0)a.magFilter=THREE[m.magFilter];if(m.repeat)a.repeat.set(m.repeat[0],m.repeat[1]),a.wrapS=a.wrapT=THREE.RepeatWrapping}A.textures[x]=a}for(n in B.materials){x=B.materials[n];for(z in x.parameters)if(z==
 "envMap"||z=="map"||z=="lightMap")x.parameters[z]=A.textures[x.parameters[z]];else if(z=="shading")x.parameters[z]=x.parameters[z]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(z=="blending")x.parameters[z]=THREE[x.parameters[z]]?THREE[x.parameters[z]]:THREE.NormalBlending;else if(z=="combine")x.parameters[z]=x.parameters[z]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(z=="vertexColors")if(x.parameters[z]=="face")x.parameters[z]=THREE.FaceColors;else if(x.parameters[z])x.parameters[z]=
 "envMap"||z=="map"||z=="lightMap")x.parameters[z]=A.textures[x.parameters[z]];else if(z=="shading")x.parameters[z]=x.parameters[z]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(z=="blending")x.parameters[z]=THREE[x.parameters[z]]?THREE[x.parameters[z]]:THREE.NormalBlending;else if(z=="combine")x.parameters[z]=x.parameters[z]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(z=="vertexColors")if(x.parameters[z]=="face")x.parameters[z]=THREE.FaceColors;else if(x.parameters[z])x.parameters[z]=
 THREE.VertexColors;if(x.parameters.opacity!==void 0&&x.parameters.opacity<1)x.parameters.transparent=!0;x=new THREE[x.type](x.parameters);A.materials[n]=x}j();c.callbackSync(A)}}};
 THREE.VertexColors;if(x.parameters.opacity!==void 0&&x.parameters.opacity<1)x.parameters.transparent=!0;x=new THREE[x.type](x.parameters);A.materials[n]=x}j();c.callbackSync(A)}}};
 THREE.MarchingCubes=function(a,b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b];this.init=function(a){this.isolation=80;this.size=a;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(a,b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b];this.init=function(a){this.isolation=80;this.size=a;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(a,b,e){return a+(b-a)*e};this.VIntX=function(a,b,e,f,g,j,h,k,l,m){g=(g-l)/(m-l);l=this.normal_cache;b[f]=j+g*this.delta;b[f+1]=h;b[f+2]=k;e[f]=this.lerp(l[a],l[a+3],g);e[f+1]=this.lerp(l[a+1],l[a+4],g);e[f+2]=this.lerp(l[a+2],l[a+5],g)};this.VIntY=function(a,b,e,f,g,j,h,k,l,m){g=(g-l)/(m-l);l=this.normal_cache;b[f]=j;b[f+1]=h+g*this.delta;b[f+
 0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(a,b,e){return a+(b-a)*e};this.VIntX=function(a,b,e,f,g,j,h,k,l,m){g=(g-l)/(m-l);l=this.normal_cache;b[f]=j+g*this.delta;b[f+1]=h;b[f+2]=k;e[f]=this.lerp(l[a],l[a+3],g);e[f+1]=this.lerp(l[a+1],l[a+4],g);e[f+2]=this.lerp(l[a+2],l[a+5],g)};this.VIntY=function(a,b,e,f,g,j,h,k,l,m){g=(g-l)/(m-l);l=this.normal_cache;b[f]=j;b[f+1]=h+g*this.delta;b[f+
 2]=k;b=a+this.yd*3;e[f]=this.lerp(l[a],l[b],g);e[f+1]=this.lerp(l[a+1],l[b+1],g);e[f+2]=this.lerp(l[a+2],l[b+2],g)};this.VIntZ=function(a,b,e,f,g,j,h,k,l,m){g=(g-l)/(m-l);l=this.normal_cache;b[f]=j;b[f+1]=h;b[f+2]=k+g*this.delta;b=a+this.zd*3;e[f]=this.lerp(l[a],l[b],g);e[f+1]=this.lerp(l[a+1],l[b+1],g);e[f+2]=this.lerp(l[a+2],l[b+2],g)};this.compNorm=function(a){var b=a*3;this.normal_cache[b]==0&&(this.normal_cache[b]=this.field[a-1]-this.field[a+1],this.normal_cache[b+1]=this.field[a-this.yd]-this.field[a+
 2]=k;b=a+this.yd*3;e[f]=this.lerp(l[a],l[b],g);e[f+1]=this.lerp(l[a+1],l[b+1],g);e[f+2]=this.lerp(l[a+2],l[b+2],g)};this.VIntZ=function(a,b,e,f,g,j,h,k,l,m){g=(g-l)/(m-l);l=this.normal_cache;b[f]=j;b[f+1]=h;b[f+2]=k+g*this.delta;b=a+this.zd*3;e[f]=this.lerp(l[a],l[b],g);e[f+1]=this.lerp(l[a+1],l[b+1],g);e[f+2]=this.lerp(l[a+2],l[b+2],g)};this.compNorm=function(a){var b=a*3;this.normal_cache[b]==0&&(this.normal_cache[b]=this.field[a-1]-this.field[a+1],this.normal_cache[b+1]=this.field[a-this.yd]-this.field[a+
-this.yd],this.normal_cache[b+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,b,e,f,g,j){var h=f+1,k=f+this.yd,l=f+this.zd,m=h+this.yd,n=h+this.zd,o=f+this.yd+this.zd,u=h+this.yd+this.zd,t=0,v=this.field[f],x=this.field[h],w=this.field[k],p=this.field[m],y=this.field[l],z=this.field[n],C=this.field[o],D=this.field[u];v<g&&(t|=1);x<g&&(t|=2);w<g&&(t|=8);p<g&&(t|=4);y<g&&(t|=16);z<g&&(t|=32);C<g&&(t|=128);D<g&&(t|=64);var E=THREE.edgeTable[t];if(E==0)return 0;var F=this.delta,
-B=a+F,J=b+F,F=e+F;E&1&&(this.compNorm(f),this.compNorm(h),this.VIntX(f*3,this.vlist,this.nlist,0,g,a,b,e,v,x));E&2&&(this.compNorm(h),this.compNorm(m),this.VIntY(h*3,this.vlist,this.nlist,3,g,B,b,e,x,p));E&4&&(this.compNorm(k),this.compNorm(m),this.VIntX(k*3,this.vlist,this.nlist,6,g,a,J,e,w,p));E&8&&(this.compNorm(f),this.compNorm(k),this.VIntY(f*3,this.vlist,this.nlist,9,g,a,b,e,v,w));E&16&&(this.compNorm(l),this.compNorm(n),this.VIntX(l*3,this.vlist,this.nlist,12,g,a,b,F,y,z));E&32&&(this.compNorm(n),
-this.compNorm(u),this.VIntY(n*3,this.vlist,this.nlist,15,g,B,b,F,z,D));E&64&&(this.compNorm(o),this.compNorm(u),this.VIntX(o*3,this.vlist,this.nlist,18,g,a,J,F,C,D));E&128&&(this.compNorm(l),this.compNorm(o),this.VIntY(l*3,this.vlist,this.nlist,21,g,a,b,F,y,C));E&256&&(this.compNorm(f),this.compNorm(l),this.VIntZ(f*3,this.vlist,this.nlist,24,g,a,b,e,v,y));E&512&&(this.compNorm(h),this.compNorm(n),this.VIntZ(h*3,this.vlist,this.nlist,27,g,B,b,e,x,z));E&1024&&(this.compNorm(m),this.compNorm(u),this.VIntZ(m*
-3,this.vlist,this.nlist,30,g,B,J,e,p,D));E&2048&&(this.compNorm(k),this.compNorm(o),this.VIntZ(k*3,this.vlist,this.nlist,33,g,a,J,e,w,C));t<<=4;for(g=f=0;THREE.triTable[t+g]!=-1;)a=t+g,b=a+1,e=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[b],3*THREE.triTable[e],j),g+=3,f++;return f};this.posnormtriv=function(a,b,e,f,g,j){var h=this.count*3;this.positionArray[h]=a[e];this.positionArray[h+1]=a[e+1];this.positionArray[h+2]=a[e+2];this.positionArray[h+3]=a[f];this.positionArray[h+
+this.yd],this.normal_cache[b+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,b,e,f,g,j){var h=f+1,k=f+this.yd,l=f+this.zd,m=h+this.yd,n=h+this.zd,o=f+this.yd+this.zd,t=h+this.yd+this.zd,u=0,w=this.field[f],x=this.field[h],v=this.field[k],p=this.field[m],y=this.field[l],z=this.field[n],C=this.field[o],D=this.field[t];w<g&&(u|=1);x<g&&(u|=2);v<g&&(u|=8);p<g&&(u|=4);y<g&&(u|=16);z<g&&(u|=32);C<g&&(u|=128);D<g&&(u|=64);var E=THREE.edgeTable[u];if(E==0)return 0;var F=this.delta,
+B=a+F,J=b+F,F=e+F;E&1&&(this.compNorm(f),this.compNorm(h),this.VIntX(f*3,this.vlist,this.nlist,0,g,a,b,e,w,x));E&2&&(this.compNorm(h),this.compNorm(m),this.VIntY(h*3,this.vlist,this.nlist,3,g,B,b,e,x,p));E&4&&(this.compNorm(k),this.compNorm(m),this.VIntX(k*3,this.vlist,this.nlist,6,g,a,J,e,v,p));E&8&&(this.compNorm(f),this.compNorm(k),this.VIntY(f*3,this.vlist,this.nlist,9,g,a,b,e,w,v));E&16&&(this.compNorm(l),this.compNorm(n),this.VIntX(l*3,this.vlist,this.nlist,12,g,a,b,F,y,z));E&32&&(this.compNorm(n),
+this.compNorm(t),this.VIntY(n*3,this.vlist,this.nlist,15,g,B,b,F,z,D));E&64&&(this.compNorm(o),this.compNorm(t),this.VIntX(o*3,this.vlist,this.nlist,18,g,a,J,F,C,D));E&128&&(this.compNorm(l),this.compNorm(o),this.VIntY(l*3,this.vlist,this.nlist,21,g,a,b,F,y,C));E&256&&(this.compNorm(f),this.compNorm(l),this.VIntZ(f*3,this.vlist,this.nlist,24,g,a,b,e,w,y));E&512&&(this.compNorm(h),this.compNorm(n),this.VIntZ(h*3,this.vlist,this.nlist,27,g,B,b,e,x,z));E&1024&&(this.compNorm(m),this.compNorm(t),this.VIntZ(m*
+3,this.vlist,this.nlist,30,g,B,J,e,p,D));E&2048&&(this.compNorm(k),this.compNorm(o),this.VIntZ(k*3,this.vlist,this.nlist,33,g,a,J,e,v,C));u<<=4;for(g=f=0;THREE.triTable[u+g]!=-1;)a=u+g,b=a+1,e=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[b],3*THREE.triTable[e],j),g+=3,f++;return f};this.posnormtriv=function(a,b,e,f,g,j){var h=this.count*3;this.positionArray[h]=a[e];this.positionArray[h+1]=a[e+1];this.positionArray[h+2]=a[e+2];this.positionArray[h+3]=a[f];this.positionArray[h+
 4]=a[f+1];this.positionArray[h+5]=a[f+2];this.positionArray[h+6]=a[g];this.positionArray[h+7]=a[g+1];this.positionArray[h+8]=a[g+2];this.normalArray[h]=b[e];this.normalArray[h+1]=b[e+1];this.normalArray[h+2]=b[e+2];this.normalArray[h+3]=b[f];this.normalArray[h+4]=b[f+1];this.normalArray[h+5]=b[f+2];this.normalArray[h+6]=b[g];this.normalArray[h+7]=b[g+1];this.normalArray[h+8]=b[g+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&j(this)};this.begin=function(){this.count=0;
 4]=a[f+1];this.positionArray[h+5]=a[f+2];this.positionArray[h+6]=a[g];this.positionArray[h+7]=a[g+1];this.positionArray[h+8]=a[g+2];this.normalArray[h]=b[e];this.normalArray[h+1]=b[e+1];this.normalArray[h+2]=b[e+2];this.normalArray[h+3]=b[f];this.normalArray[h+4]=b[f+1];this.normalArray[h+5]=b[f+2];this.normalArray[h+6]=b[g];this.normalArray[h+7]=b[g+1];this.normalArray[h+8]=b[g+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&j(this)};this.begin=function(){this.count=0;
 this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var b=this.count*3;b<this.positionArray.length;b++)this.positionArray[b]=0;a(this)}};this.addBall=function(a,b,e,f,g){var j=this.size*Math.sqrt(f/g),h=e*this.size,k=b*this.size,l=a*this.size,m=Math.floor(h-j);m<1&&(m=1);h=Math.floor(h+j);h>this.size-1&&(h=this.size-1);var n=Math.floor(k-j);n<1&&(n=1);k=Math.floor(k+j);k>this.size-1&&(k=this.size-1);var o=Math.floor(l-j);o<1&&(o=1);j=Math.floor(l+j);j>this.size-1&&(j=this.size-
 this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var b=this.count*3;b<this.positionArray.length;b++)this.positionArray[b]=0;a(this)}};this.addBall=function(a,b,e,f,g){var j=this.size*Math.sqrt(f/g),h=e*this.size,k=b*this.size,l=a*this.size,m=Math.floor(h-j);m<1&&(m=1);h=Math.floor(h+j);h>this.size-1&&(h=this.size-1);var n=Math.floor(k-j);n<1&&(n=1);k=Math.floor(k+j);k>this.size-1&&(k=this.size-1);var o=Math.floor(l-j);o<1&&(o=1);j=Math.floor(l+j);j>this.size-1&&(j=this.size-
-1);for(var u,t,v,x,w,p;m<h;m++){l=this.size2*m;t=m/this.size-e;w=t*t;for(t=n;t<k;t++){v=l+this.size*t;u=t/this.size-b;p=u*u;for(u=o;u<j;u++)x=u/this.size-a,x=f/(1.0E-6+x*x+p+w)-g,x>0&&(this.field[v+u]+=x)}}};this.addPlaneX=function(a,b){var e,f,g,j,h,k=this.size,l=this.yd,m=this.zd,n=this.field,o=k*Math.sqrt(a/b);o>k&&(o=k);for(e=0;e<o;e++)if(f=e/k,f*=f,j=a/(1.0E-4+f)-b,j>0)for(f=0;f<k;f++){h=e+f*l;for(g=0;g<k;g++)n[m*g+h]+=j}};this.addPlaneY=function(a,b){var e,f,g,j,h,k,l=this.size,m=this.yd,n=
-this.zd,o=this.field,u=l*Math.sqrt(a/b);u>l&&(u=l);for(f=0;f<u;f++)if(e=f/l,e*=e,j=a/(1.0E-4+e)-b,j>0){h=f*m;for(e=0;e<l;e++){k=h+e;for(g=0;g<l;g++)o[n*g+k]+=j}}};this.addPlaneZ=function(a,b){var e,f,g,j,h,k;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(a/b);dist>size&&(dist=size);for(g=0;g<dist;g++)if(e=g/size,e*=e,j=a/(1.0E-4+e)-b,j>0){h=zd*g;for(f=0;f<size;f++){k=h+f*yd;for(e=0;e<size;e++)field[k+e]+=j}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[a*
+1);for(var t,u,w,x,v,p;m<h;m++){l=this.size2*m;u=m/this.size-e;v=u*u;for(u=n;u<k;u++){w=l+this.size*u;t=u/this.size-b;p=t*t;for(t=o;t<j;t++)x=t/this.size-a,x=f/(1.0E-6+x*x+p+v)-g,x>0&&(this.field[w+t]+=x)}}};this.addPlaneX=function(a,b){var e,f,g,j,h,k=this.size,l=this.yd,m=this.zd,n=this.field,o=k*Math.sqrt(a/b);o>k&&(o=k);for(e=0;e<o;e++)if(f=e/k,f*=f,j=a/(1.0E-4+f)-b,j>0)for(f=0;f<k;f++){h=e+f*l;for(g=0;g<k;g++)n[m*g+h]+=j}};this.addPlaneY=function(a,b){var e,f,g,j,h,k,l=this.size,m=this.yd,n=
+this.zd,o=this.field,t=l*Math.sqrt(a/b);t>l&&(t=l);for(f=0;f<t;f++)if(e=f/l,e*=e,j=a/(1.0E-4+e)-b,j>0){h=f*m;for(e=0;e<l;e++){k=h+e;for(g=0;g<l;g++)o[n*g+k]+=j}}};this.addPlaneZ=function(a,b){var e,f,g,j,h,k;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(a/b);dist>size&&(dist=size);for(g=0;g<dist;g++)if(e=g/size,e*=e,j=a/(1.0E-4+e)-b,j>0){h=zd*g;for(f=0;f<size;f++){k=h+f*yd;for(e=0;e<size;e++)field[k+e]+=j}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[a*
 3]=0,this.field[a]=0};this.render=function(a){this.begin();var b,e,f,g,j,h,k,l,m,n=this.size-2;for(g=1;g<n;g++){m=this.size2*g;k=(g-this.halfsize)/this.halfsize;for(f=1;f<n;f++){l=m+this.size*f;h=(f-this.halfsize)/this.halfsize;for(e=1;e<n;e++)j=(e-this.halfsize)/this.halfsize,b=l+e,this.polygonize(j,h,k,b,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,b=new THREE.Geometry,e=[];this.render(function(f){var g,j,h,k,l,m,n,o;for(g=0;g<f.count;g++)n=g*3,l=n+1,o=n+2,j=f.positionArray[n],
 3]=0,this.field[a]=0};this.render=function(a){this.begin();var b,e,f,g,j,h,k,l,m,n=this.size-2;for(g=1;g<n;g++){m=this.size2*g;k=(g-this.halfsize)/this.halfsize;for(f=1;f<n;f++){l=m+this.size*f;h=(f-this.halfsize)/this.halfsize;for(e=1;e<n;e++)j=(e-this.halfsize)/this.halfsize,b=l+e,this.polygonize(j,h,k,b,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,b=new THREE.Geometry,e=[];this.render(function(f){var g,j,h,k,l,m,n,o;for(g=0;g<f.count;g++)n=g*3,l=n+1,o=n+2,j=f.positionArray[n],
 h=f.positionArray[l],k=f.positionArray[o],m=new THREE.Vector3(j,h,k),j=f.normalArray[n],h=f.normalArray[l],k=f.normalArray[o],n=new THREE.Vector3(j,h,k),n.normalize(),l=new THREE.Vertex(m),b.vertices.push(l),e.push(n);nfaces=f.count/3;for(g=0;g<nfaces;g++)n=(a+g)*3,l=n+1,o=n+2,m=e[n],j=e[l],h=e[o],n=new THREE.Face3(n,l,o,[m,j,h]),b.faces.push(n);a+=nfaces;f.count=0});return b};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
 h=f.positionArray[l],k=f.positionArray[o],m=new THREE.Vector3(j,h,k),j=f.normalArray[n],h=f.normalArray[l],k=f.normalArray[o],n=new THREE.Vector3(j,h,k),n.normalize(),l=new THREE.Vertex(m),b.vertices.push(l),e.push(n);nfaces=f.count/3;for(g=0;g<nfaces;g++)n=(a+g)*3,l=n+1,o=n+2,m=e[n],j=e[l],h=e[o],n=new THREE.Face3(n,l,o,[m,j,h]),b.faces.push(n);a+=nfaces;f.count=0});return b};this.init(a)};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,
@@ -220,8 +220,9 @@ d;if(c<b.min.z||c>b.max.z)return Number.MAX_VALUE;b.normal.set(0,j,0);break;case
 THREE.CollisionSystem.prototype.raySphere=function(a,b){var c=b.center.clone().subSelf(a.origin);if(c.lengthSq<b.radiusSq)return-1;var d=c.dot(a.direction.clone());if(d<=0)return Number.MAX_VALUE;c=b.radiusSq-(c.lengthSq()-d*d);if(c>=0)return Math.abs(d)-Math.sqrt(c);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(a,b){var c=b.center.clone().subSelf(a.origin);if(c.lengthSq<b.radiusSq)return-1;var d=c.dot(a.direction.clone());if(d<=0)return Number.MAX_VALUE;c=b.radiusSq-(c.lengthSq()-d*d);if(c>=0)return Math.abs(d)-Math.sqrt(c);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(a){a.geometry.computeBoundingBox();var b=a.geometry.boundingBox,c=new THREE.Vector3(b.x[0],b.y[0],b.z[0]),b=new THREE.Vector3(b.x[1],b.y[1],b.z[1]),c=new THREE.BoxCollider(c,b);c.mesh=a;return c};THREE.CollisionUtils.MeshAABB=function(a){var b=THREE.CollisionUtils.MeshOBB(a);b.min.addSelf(a.position);b.max.addSelf(a.position);b.dynamic=!1;return b};
 THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(a){a.geometry.computeBoundingBox();var b=a.geometry.boundingBox,c=new THREE.Vector3(b.x[0],b.y[0],b.z[0]),b=new THREE.Vector3(b.x[1],b.y[1],b.z[1]),c=new THREE.BoxCollider(c,b);c.mesh=a;return c};THREE.CollisionUtils.MeshAABB=function(a){var b=THREE.CollisionUtils.MeshOBB(a);b.min.addSelf(a.position);b.max.addSelf(a.position);b.dynamic=!1;return b};
 THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))};
 THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))};
-if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,d=this.render,e=new THREE.Camera,f=new THREE.Camera,a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},g=new THREE.WebGLRenderTarget(512,512,a),j=new THREE.WebGLRenderTarget(512,512,a),h=new THREE.Camera(53,1,1,1E4);h.position.z=2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:g},mapRight:{type:"t",value:1,
-texture:j}},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 k=
-new THREE.Scene;k.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,d){c.call(b,a,d);g.width=a;g.height=d;j.width=a;j.height=d};this.render=function(a,c){e.projectionMatrix=c.projectionMatrix;e.position.copy(c.position);e.target.position.copy(c.target.position);e.translateX(-10);f.projectionMatrix=c.projectionMatrix;f.position.copy(c.position);f.target.position.copy(c.target.position);f.translateX(10);d.call(b,a,e,g,!0);d.call(b,a,f,j,!0);d.call(b,k,h)}};
+if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,d=this.render,e=new THREE.Camera,f=new THREE.Camera,g=new THREE.Matrix4,j=new THREE.Matrix4,h,k,l;e.useTarget=f.useTarget=!1;e.matrixAutoUpdate=f.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},m=new THREE.WebGLRenderTarget(512,512,a),n=new THREE.WebGLRenderTarget(512,512,a),o=new THREE.Camera(53,1,1,1E4);o.position.z=
+2;_material=new THREE.MeshShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:m},mapRight:{type:"t",value:1,texture:n}},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 t=new THREE.Scene;t.addObject(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,d){c.call(b,a,d);m.width=a;m.height=d;n.width=a;n.height=d};this.render=function(a,c){c.update(null,!0);if(h!==c.aspect||k!==c.near||l!==c.fov){h=c.aspect;k=c.near;l=c.fov;var x=c.projectionMatrix.clone(),v=125/30*0.5,p=v*k/125,y=k*Math.tan(l*Math.PI/360),z;g.n14=v;j.n14=-v;v=-y*h+p;z=y*h+p;x.n11=2*k/(z-v);x.n13=(z+v)/(z-v);e.projectionMatrix=x.clone();v=-y*h-p;z=y*h-p;x.n11=2*k/(z-v);
+x.n13=(z+v)/(z-v);f.projectionMatrix=x.clone()}e.matrix=c.matrixWorld.clone().multiplySelf(j);e.update(null,!0);e.position.copy(c.position);e.near=k;e.far=c.far;d.call(b,a,e,m,!0);f.matrix=c.matrixWorld.clone().multiplySelf(g);f.update(null,!0);f.position.copy(c.position);f.near=k;f.far=c.far;d.call(b,a,f,n,!0);d.call(b,t,o)}};
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,d=this.render,e,f,g=new THREE.Camera,j=new THREE.Camera;b.separation=10;if(a&&a.separation!==void 0)b.separation=a.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(a,d){c.call(b,a,d);e=a/2;f=d};this.render=function(a,c){this.clear();g.fov=c.fov;g.aspect=0.5*c.aspect;g.near=c.near;g.far=c.far;
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,d=this.render,e,f,g=new THREE.Camera,j=new THREE.Camera;b.separation=10;if(a&&a.separation!==void 0)b.separation=a.separation;(new THREE.Camera(53,window.innerWidth/2/window.innerHeight,1,1E4)).position.z=-10;this.setSize=function(a,d){c.call(b,a,d);e=a/2;f=d};this.render=function(a,c){this.clear();g.fov=c.fov;g.aspect=0.5*c.aspect;g.near=c.near;g.far=c.far;
 g.updateProjectionMatrix();g.position.copy(c.position);g.target.position.copy(c.target.position);g.translateX(b.separation);j.projectionMatrix=g.projectionMatrix;j.position.copy(c.position);j.target.position.copy(c.target.position);j.translateX(-b.separation);this.setViewport(0,0,e,f);d.call(b,a,g);this.setViewport(e,0,e,f);d.call(b,a,j,!1)}};
 g.updateProjectionMatrix();g.position.copy(c.position);g.target.position.copy(c.target.position);g.translateX(b.separation);j.projectionMatrix=g.projectionMatrix;j.position.copy(c.position);j.target.position.copy(c.target.position);j.translateX(-b.separation);this.setViewport(0,0,e,f);d.call(b,a,g);this.setViewport(e,0,e,f);d.call(b,a,j,!1)}};

+ 1 - 1
build/custom/ThreeSVG.js

@@ -51,7 +51,7 @@ THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;thi
 d;this.z=a.z*d;this.w=Math.cos(c);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 a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
 d;this.z=a.z*d;this.w=Math.cos(c);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 a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
 multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,i=this.w,l=i*c+f*e-h*d,k=
 multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,i=this.w,l=i*c+f*e-h*d,k=
 i*d+h*c-g*e,n=i*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=l*i+c*-g+k*-h-n*-f;b.y=k*i+c*-f+n*-g-l*-h;b.z=n*i+c*-h+l*-f-k*-g;return b}};
 i*d+h*c-g*e,n=i*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=l*i+c*-g+k*-h-n*-f;b.y=k*i+c*-f+n*-g-l*-h;b.z=n*i+c*-h+l*-f-k*-g;return b}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.001)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
 THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
 THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};

+ 2 - 2
build/custom/ThreeWebGL.js

@@ -51,7 +51,7 @@ THREE.Quaternion.prototype={set:function(b,d,e,f){this.x=b;this.y=d;this.z=e;thi
 f;this.z=b.z*f;this.w=Math.cos(e);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},
 f;this.z=b.z*f;this.w=Math.cos(e);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 d=this.x,e=this.y,f=this.z,g=this.w,i=b.x,h=b.y,j=b.z,b=b.w;this.x=d*b+g*i+e*j-f*h;this.y=e*b+g*h+f*i-d*j;this.z=f*b+g*j+d*h-e*i;this.w=g*b-d*i-e*h-f*j;return this},multiply:function(b,d){this.x=b.x*d.w+b.y*d.z-b.z*d.y+b.w*d.x;this.y=-b.x*d.z+b.y*d.w+b.z*d.x+b.w*d.y;this.z=b.x*d.y-b.y*d.x+b.z*d.w+b.w*d.z;this.w=-b.x*d.x-b.y*d.y-b.z*d.z+b.w*d.w;return this},multiplyVector3:function(b,d){d||(d=b);var e=b.x,f=b.y,g=b.z,i=this.x,h=this.y,j=this.z,o=this.w,k=o*e+h*g-j*f,n=
 multiplySelf:function(b){var d=this.x,e=this.y,f=this.z,g=this.w,i=b.x,h=b.y,j=b.z,b=b.w;this.x=d*b+g*i+e*j-f*h;this.y=e*b+g*h+f*i-d*j;this.z=f*b+g*j+d*h-e*i;this.w=g*b-d*i-e*h-f*j;return this},multiply:function(b,d){this.x=b.x*d.w+b.y*d.z-b.z*d.y+b.w*d.x;this.y=-b.x*d.z+b.y*d.w+b.z*d.x+b.w*d.y;this.z=b.x*d.y-b.y*d.x+b.z*d.w+b.w*d.z;this.w=-b.x*d.x-b.y*d.y-b.z*d.z+b.w*d.w;return this},multiplyVector3:function(b,d){d||(d=b);var e=b.x,f=b.y,g=b.z,i=this.x,h=this.y,j=this.z,o=this.w,k=o*e+h*g-j*f,n=
 o*f+j*e-i*g,v=o*g+i*f-h*e,e=-i*e-h*f-j*g;d.x=k*o+e*-i+n*-j-v*-h;d.y=n*o+e*-h+v*-i-k*-j;d.z=v*o+e*-j+k*-h-n*-i;return d}};
 o*f+j*e-i*g,v=o*g+i*f-h*e,e=-i*e-h*f-j*g;d.x=k*o+e*-i+n*-j-v*-h;d.y=n*o+e*-h+v*-i-k*-j;d.z=v*o+e*-j+k*-h-n*-i;return d}};
-THREE.Quaternion.slerp=function(b,d,e,f){var g=b.w*d.w+b.x*d.x+b.y*d.y+b.z*d.z;if(Math.abs(g)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var i=Math.acos(g),h=Math.sqrt(1-g*g);if(Math.abs(h)<0.0010)return e.w=0.5*(b.w+d.w),e.x=0.5*(b.x+d.x),e.y=0.5*(b.y+d.y),e.z=0.5*(b.z+d.z),e;g=Math.sin((1-f)*i)/h;f=Math.sin(f*i)/h;e.w=b.w*g+d.w*f;e.x=b.x*g+d.x*f;e.y=b.y*g+d.y*f;e.z=b.z*g+d.z*f;return e};THREE.Vertex=function(b){this.position=b||new THREE.Vector3};
+THREE.Quaternion.slerp=function(b,d,e,f){var g=b.w*d.w+b.x*d.x+b.y*d.y+b.z*d.z;if(Math.abs(g)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var i=Math.acos(g),h=Math.sqrt(1-g*g);if(Math.abs(h)<0.001)return e.w=0.5*(b.w+d.w),e.x=0.5*(b.x+d.x),e.y=0.5*(b.y+d.y),e.z=0.5*(b.z+d.z),e;g=Math.sin((1-f)*i)/h;f=Math.sin(f*i)/h;e.w=b.w*g+d.w*f;e.x=b.x*g+d.x*f;e.y=b.y*g+d.y*f;e.z=b.z*g+d.z*f;return e};THREE.Vertex=function(b){this.position=b||new THREE.Vector3};
 THREE.Face3=function(b,d,e,f,g,i){this.a=b;this.b=d;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=i instanceof Array?i:[i];this.centroid=new THREE.Vector3};
 THREE.Face3=function(b,d,e,f,g,i){this.a=b;this.b=d;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=i instanceof Array?i:[i];this.centroid=new THREE.Vector3};
 THREE.Face4=function(b,d,e,f,g,i,h){this.a=b;this.b=d;this.c=e;this.d=f;this.normal=g instanceof THREE.Vector3?g:new THREE.Vector3;this.vertexNormals=g instanceof Array?g:[];this.color=i instanceof THREE.Color?i:new THREE.Color;this.vertexColors=i instanceof Array?i:[];this.vertexTangents=[];this.materials=h instanceof Array?h:[h];this.centroid=new THREE.Vector3};THREE.UV=function(b,d){this.set(b||0,d||0)};
 THREE.Face4=function(b,d,e,f,g,i,h){this.a=b;this.b=d;this.c=e;this.d=f;this.normal=g instanceof THREE.Vector3?g:new THREE.Vector3;this.vertexNormals=g instanceof Array?g:[];this.color=i instanceof THREE.Color?i:new THREE.Color;this.vertexColors=i instanceof Array?i:[];this.vertexTangents=[];this.materials=h instanceof Array?h:[h];this.centroid=new THREE.Vector3};THREE.UV=function(b,d){this.set(b||0,d||0)};
 THREE.UV.prototype={set:function(b,d){this.u=b;this.v=d;return this},copy:function(b){this.set(b.u,b.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
 THREE.UV.prototype={set:function(b,d){this.u=b;this.v=d;return this},copy:function(b){this.set(b.u,b.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
@@ -217,7 +217,7 @@ c.uniform1f(g.rotation,h.rotation),c.uniform2fv(g.scale,k),h.mergeWith3D&&!n?(c.
 (c.enableVertexAttribArray(x.attributes.vertex),c.enableVertexAttribArray(x.attributes.uv),Fa=!0);c.uniform1i(y.occlusionMap,0);c.uniform1i(y.map,1);c.bindBuffer(c.ARRAY_BUFFER,x.vertexBuffer);c.vertexAttribPointer(e.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(e.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,x.elementBuffer);c.disable(c.CULL_FACE);c.depthMask(!1);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,x.occlusionTexture);c.activeTexture(c.TEXTURE1);for(f=0;f<h;f++)if(e=
 (c.enableVertexAttribArray(x.attributes.vertex),c.enableVertexAttribArray(x.attributes.uv),Fa=!0);c.uniform1i(y.occlusionMap,0);c.uniform1i(y.map,1);c.bindBuffer(c.ARRAY_BUFFER,x.vertexBuffer);c.vertexAttribPointer(e.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(e.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,x.elementBuffer);c.disable(c.CULL_FACE);c.depthMask(!1);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,x.occlusionTexture);c.activeTexture(c.TEXTURE1);for(f=0;f<h;f++)if(e=
 b.__webglLensFlares[f].object,k.set(e.matrixWorld.n14,e.matrixWorld.n24,e.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(k),d.projectionMatrix.multiplyVector3(k),r[0]=k.x,r[1]=k.y,r[2]=k.z,t[0]=r[0]*p+p,t[1]=r[1]*n+n,x.hasVertexTexture||t[0]>0&&t[0]<L&&t[1]>0&&t[1]<N){c.bindTexture(c.TEXTURE_2D,x.tempTexture);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGB,t[0]-8,t[1]-8,16,16,0);c.uniform1i(y.renderType,0);c.uniform2fv(y.scale,v);c.uniform3fv(y.screenPosition,r);c.disable(c.BLEND);c.enable(c.DEPTH_TEST);
 b.__webglLensFlares[f].object,k.set(e.matrixWorld.n14,e.matrixWorld.n24,e.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(k),d.projectionMatrix.multiplyVector3(k),r[0]=k.x,r[1]=k.y,r[2]=k.z,t[0]=r[0]*p+p,t[1]=r[1]*n+n,x.hasVertexTexture||t[0]>0&&t[0]<L&&t[1]>0&&t[1]<N){c.bindTexture(c.TEXTURE_2D,x.tempTexture);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGB,t[0]-8,t[1]-8,16,16,0);c.uniform1i(y.renderType,0);c.uniform2fv(y.scale,v);c.uniform3fv(y.screenPosition,r);c.disable(c.BLEND);c.enable(c.DEPTH_TEST);
 c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);c.bindTexture(c.TEXTURE_2D,x.occlusionTexture);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGBA,t[0]-8,t[1]-8,16,16,0);c.uniform1i(y.renderType,1);c.disable(c.DEPTH_TEST);c.bindTexture(c.TEXTURE_2D,x.tempTexture);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);e.positionScreen.x=r[0];e.positionScreen.y=r[1];e.positionScreen.z=r[2];e.customUpdateCallback?e.customUpdateCallback(e):e.updateLensFlares();c.uniform1i(y.renderType,2);c.enable(c.BLEND);g=0;for(i=e.lensFlares.length;g<
 c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);c.bindTexture(c.TEXTURE_2D,x.occlusionTexture);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGBA,t[0]-8,t[1]-8,16,16,0);c.uniform1i(y.renderType,1);c.disable(c.DEPTH_TEST);c.bindTexture(c.TEXTURE_2D,x.tempTexture);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);e.positionScreen.x=r[0];e.positionScreen.y=r[1];e.positionScreen.z=r[2];e.customUpdateCallback?e.customUpdateCallback(e):e.updateLensFlares();c.uniform1i(y.renderType,2);c.enable(c.BLEND);g=0;for(i=e.lensFlares.length;g<
-i;g++)if(j=e.lensFlares[g],j.opacity>0.0010&&j.scale>0.0010)r[0]=j.x,r[1]=j.y,r[2]=j.z,q=j.size*j.scale/N,v[0]=q*o,v[1]=q,c.uniform3fv(y.screenPosition,r),c.uniform2fv(y.scale,v),c.uniform1f(y.rotation,j.rotation),c.uniform1f(y.opacity,j.opacity),E(j.blending),ca(j.texture,1),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0)}c.enable(c.CULL_FACE);c.enable(c.DEPTH_TEST);c.depthMask(ja)}function D(b,c){b._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}
+i;g++)if(j=e.lensFlares[g],j.opacity>0.001&&j.scale>0.001)r[0]=j.x,r[1]=j.y,r[2]=j.z,q=j.size*j.scale/N,v[0]=q*o,v[1]=q,c.uniform3fv(y.screenPosition,r),c.uniform2fv(y.scale,v),c.uniform1f(y.rotation,j.rotation),c.uniform1f(y.opacity,j.opacity),E(j.blending),ca(j.texture,1),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0)}c.enable(c.CULL_FACE);c.enable(c.DEPTH_TEST);c.depthMask(ja)}function D(b,c){b._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}
 function A(b){var e,f,h,g;if(b instanceof THREE.Mesh){f=b.geometry;for(e in f.geometryGroups){h=f.geometryGroups[e];a:{for(var i=g=void 0,j=void 0,k=void 0,o=void 0,o=h.__materials,i=0,j=o.length;i<j;i++)if(k=o[i],k.attributes)for(g in k.attributes)if(k.attributes[g].needsUpdate){g=!0;break a}g=!1}if(f.__dirtyVertices||f.__dirtyMorphTargets||f.__dirtyElements||f.__dirtyUvs||f.__dirtyNormals||f.__dirtyColors||f.__dirtyTangents||g)if(g=h,i=b,j=c.DYNAMIC_DRAW,g.__inittedArrays){var n=o=k=void 0,p=void 0,
 function A(b){var e,f,h,g;if(b instanceof THREE.Mesh){f=b.geometry;for(e in f.geometryGroups){h=f.geometryGroups[e];a:{for(var i=g=void 0,j=void 0,k=void 0,o=void 0,o=h.__materials,i=0,j=o.length;i<j;i++)if(k=o[i],k.attributes)for(g in k.attributes)if(k.attributes[g].needsUpdate){g=!0;break a}g=!1}if(f.__dirtyVertices||f.__dirtyMorphTargets||f.__dirtyElements||f.__dirtyUvs||f.__dirtyNormals||f.__dirtyColors||f.__dirtyTangents||g)if(g=h,i=b,j=c.DYNAMIC_DRAW,g.__inittedArrays){var n=o=k=void 0,p=void 0,
 G=n=void 0,q=void 0,v=void 0,r=void 0,x=void 0,t=void 0,y=void 0,A=void 0,B=void 0,u=void 0,I=void 0,K=void 0,D=void 0,s=p=r=p=v=q=void 0,z=void 0,m=z=s=q=void 0,F=void 0,J=m=z=s=n=n=G=r=p=m=z=s=F=m=z=s=F=m=z=s=void 0,E=0,C=0,S=0,T=0,M=0,L=0,U=0,N=0,da=0,w=0,ea=0,z=s=0,H=g.__vertexArray,$=g.__uvArray,aa=g.__uv2Array,P=g.__normalArray,V=g.__tangentArray,fa=g.__colorArray,W=g.__skinVertexAArray,X=g.__skinVertexBArray,Y=g.__skinIndexArray,Z=g.__skinWeightArray,ca=g.__morphTargetsArrays,Q=g.__webglCustomAttributes,
 G=n=void 0,q=void 0,v=void 0,r=void 0,x=void 0,t=void 0,y=void 0,A=void 0,B=void 0,u=void 0,I=void 0,K=void 0,D=void 0,s=p=r=p=v=q=void 0,z=void 0,m=z=s=q=void 0,F=void 0,J=m=z=s=n=n=G=r=p=m=z=s=F=m=z=s=F=m=z=s=void 0,E=0,C=0,S=0,T=0,M=0,L=0,U=0,N=0,da=0,w=0,ea=0,z=s=0,H=g.__vertexArray,$=g.__uvArray,aa=g.__uv2Array,P=g.__normalArray,V=g.__tangentArray,fa=g.__colorArray,W=g.__skinVertexAArray,X=g.__skinVertexBArray,Y=g.__skinIndexArray,Z=g.__skinWeightArray,ca=g.__morphTargetsArrays,Q=g.__webglCustomAttributes,
 m=void 0,O=g.__faceArray,R=g.__lineArray,ia=g.__needsSmoothNormals,t=g.__vertexColorType,x=g.__uvType,y=g.__normalType,ga=i.geometry,ka=ga.__dirtyVertices,la=ga.__dirtyElements,ja=ga.__dirtyUvs,na=ga.__dirtyNormals,oa=ga.__dirtyTangents,pa=ga.__dirtyColors,qa=ga.__dirtyMorphTargets,ma=ga.vertices,ra=g.faces,ta=ga.faces,sa=ga.faceVertexUvs[0],ua=ga.faceVertexUvs[1],za=ga.skinVerticesA,Aa=ga.skinVerticesB,Ba=ga.skinIndices,wa=ga.skinWeights,xa=i instanceof THREE.ShadowVolume?ga.edgeFaces:void 0,va=
 m=void 0,O=g.__faceArray,R=g.__lineArray,ia=g.__needsSmoothNormals,t=g.__vertexColorType,x=g.__uvType,y=g.__normalType,ga=i.geometry,ka=ga.__dirtyVertices,la=ga.__dirtyElements,ja=ga.__dirtyUvs,na=ga.__dirtyNormals,oa=ga.__dirtyTangents,pa=ga.__dirtyColors,qa=ga.__dirtyMorphTargets,ma=ga.vertices,ra=g.faces,ta=ga.faces,sa=ga.faceVertexUvs[0],ua=ga.faceVertexUvs[1],za=ga.skinVerticesA,Aa=ga.skinVerticesB,Ba=ga.skinIndices,wa=ga.skinWeights,xa=i instanceof THREE.ShadowVolume?ga.edgeFaces:void 0,va=

+ 104 - 105
src/extras/renderers/AnaglyphWebGLRenderer.js

@@ -1,152 +1,151 @@
 /**
 /**
  * @author mrdoob / http://mrdoob.com/
  * @author mrdoob / http://mrdoob.com/
+ * @author marklundin / http://mark-lundin.com/
  */
  */
 
 
-THREE.AnaglyphWebGLRenderer = function ( parameters ) {	
+if ( THREE.WebGLRenderer ) {
 
 
-	THREE.WebGLRenderer.call( this, parameters );
+	THREE.AnaglyphWebGLRenderer = function ( parameters ) {	
 
 
-	var _this = this, _setSize = this.setSize, _render = this.render;
-	var _cameraL = new THREE.Camera(), _cameraR = new THREE.Camera();
-	var eyeRight = new THREE.Matrix4(),
-		eyeLeft = new THREE.Matrix4(),
-		focalLength = 125,
-		aspect, near, fov;
+		THREE.WebGLRenderer.call( this, parameters );
+
+		var _this = this, _setSize = this.setSize, _render = this.render;
+		var _cameraL = new THREE.Camera(), _cameraR = new THREE.Camera();
+		var eyeRight = new THREE.Matrix4(),
+			eyeLeft = new THREE.Matrix4(),
+			focalLength = 125,
+			aspect, near, fov;
 	
 	
-	_cameraL.useTarget = _cameraR.useTarget = false;
-	_cameraL.matrixAutoUpdate = _cameraR.matrixAutoUpdate = false;
+		_cameraL.useTarget = _cameraR.useTarget = false;
+		_cameraL.matrixAutoUpdate = _cameraR.matrixAutoUpdate = false;
 
 
-	var _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };
-	var _renderTargetL = new THREE.WebGLRenderTarget( 512, 512, _params ), _renderTargetR = new THREE.WebGLRenderTarget( 512, 512, _params );
+		var _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };
+		var _renderTargetL = new THREE.WebGLRenderTarget( 512, 512, _params ), _renderTargetR = new THREE.WebGLRenderTarget( 512, 512, _params );
 
 
-	var _camera = new THREE.Camera( 53, 1, 1, 10000 );
-	_camera.position.z = 2;
+		var _camera = new THREE.Camera( 53, 1, 1, 10000 );
+		_camera.position.z = 2;
 
 
-	_material = new THREE.MeshShaderMaterial( {
+		_material = new THREE.MeshShaderMaterial( {
 
 
-		uniforms: {
+			uniforms: {
 
 
-			"mapLeft": { type: "t", value: 0, texture: _renderTargetL },
-			"mapRight": { type: "t", value: 1, texture: _renderTargetR }
+				"mapLeft": { type: "t", value: 0, texture: _renderTargetL },
+				"mapRight": { type: "t", value: 1, texture: _renderTargetR }
 
 
-		},
-		vertexShader: [
+			},
+			vertexShader: [
 
 
-			"varying vec2 vUv;",
+				"varying vec2 vUv;",
 
 
-			"void main() {",
+				"void main() {",
 
 
-				"vUv = vec2( uv.x, 1.0 - uv.y );",
-				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+					"vUv = vec2( uv.x, 1.0 - uv.y );",
+					"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
 
-			"}"
+				"}"
 
 
-		].join("\n"),
-		fragmentShader: [
+			].join("\n"),
+			fragmentShader: [
 
 
-			"uniform sampler2D mapLeft;",
-			"uniform sampler2D mapRight;",
-			"varying vec2 vUv;",
+				"uniform sampler2D mapLeft;",
+				"uniform sampler2D mapRight;",
+				"varying vec2 vUv;",
 
 
-			"void main() {",
+				"void main() {",
 
 
-				"vec4 colorL, colorR;",
-				"vec2 uv = vUv;",
+					"vec4 colorL, colorR;",
+					"vec2 uv = vUv;",
 
 
-				"colorL = texture2D( mapLeft, uv );",
-				"colorR = texture2D( mapRight, uv );",
+					"colorL = texture2D( mapLeft, uv );",
+					"colorR = texture2D( mapRight, uv );",
 
 
-				// http://3dtv.at/Knowhow/AnaglyphComparison_en.aspx
+					// http://3dtv.at/Knowhow/AnaglyphComparison_en.aspx
 
 
-				"gl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;",
+					"gl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;",
 
 
-			"}"
+				"}"
 
 
-			].join("\n")
+				].join("\n")
 
 
-	} );
+		} );
 
 
-	var _scene = new THREE.Scene();
-	_scene.addObject( new THREE.Mesh( new THREE.Plane( 2, 2 ), _material ) );
+		var _scene = new THREE.Scene();
+		_scene.addObject( new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), _material ) );
 
 
-	this.setSize = function ( width, height ) {
+		this.setSize = function ( width, height ) {
 
 
-		_setSize.call( _this, width, height );
+			_setSize.call( _this, width, height );
 
 
-		_renderTargetL.width = width;
-		_renderTargetL.height = height;
+			_renderTargetL.width = width;
+			_renderTargetL.height = height;
 
 
-		_renderTargetR.width = width;
-		_renderTargetR.height = height;
+			_renderTargetR.width = width;
+			_renderTargetR.height = height;
 
 
-	};
+		};
 
 
-	/*
-	 * Renderer now uses an asymmetric perspective projection (http://paulbourke.net/miscellaneous/stereographics/stereorender/). 
-	 * Each camera is offset by the eye seperation and its projection matrix is also skewed asymetrically back to converge on the same
-	 * projection plane. Added a focal length parameter to, this is where the parallax is equal to 0. 
-	 */
-	this.render = function ( scene, camera, renderTarget, forceClear ) {	
+		/*
+		 * Renderer now uses an asymmetric perspective projection (http://paulbourke.net/miscellaneous/stereographics/stereorender/). 
+		 * Each camera is offset by the eye seperation and its projection matrix is also skewed asymetrically back to converge on the same
+		 * projection plane. Added a focal length parameter to, this is where the parallax is equal to 0. 
+		 */
+		this.render = function ( scene, camera, renderTarget, forceClear ) {	
 		
 		
 		
 		
-		camera.update( null, true );
+			camera.update( null, true );
 		
 		
-		var hasCameraChanged = 	aspect !== camera.aspect || 
-								near !== camera.near ||
-								fov !== camera.fov;
+			var hasCameraChanged = 	aspect !== camera.aspect || near !== camera.near || fov !== camera.fov;
 								
 								
-		if( hasCameraChanged )
-		{
+			if( hasCameraChanged ) {
 		
 		
-			aspect = camera.aspect;
-			near = camera.near;
-			fov = camera.fov;	
+				aspect = camera.aspect;
+				near = camera.near;
+				fov = camera.fov;	
 		
 		
-			var projectionMatrix = camera.projectionMatrix.clone(),
-				eyeSep = focalLength / 30 * 0.5,
-				eyeSepOnProjection = eyeSep * near / focalLength,
-				ymax = near * Math.tan( fov * Math.PI / 360 ),
-				xmin, xmax;
-
-			//translate xOffset
-			eyeRight.n14 = eyeSep;
-			eyeLeft.n14 = -eyeSep;
+				var projectionMatrix = camera.projectionMatrix.clone(),
+					eyeSep = focalLength / 30 * 0.5,
+					eyeSepOnProjection = eyeSep * near / focalLength,
+					ymax = near * Math.tan( fov * Math.PI / 360 ),
+					xmin, xmax;
+
+				//translate xOffset
+				eyeRight.n14 = eyeSep;
+				eyeLeft.n14 = -eyeSep;
 	
 	
-			//For left eye
-			xmin = -ymax * aspect + eyeSepOnProjection;
-			xmax = ymax * aspect + eyeSepOnProjection;
-			projectionMatrix.n11 = 2 * near / ( xmax - xmin );
-			projectionMatrix.n13 = ( xmax + xmin ) / ( xmax - xmin );
-			_cameraL.projectionMatrix = projectionMatrix.clone();
+				//For left eye
+				xmin = -ymax * aspect + eyeSepOnProjection;
+				xmax = ymax * aspect + eyeSepOnProjection;
+				projectionMatrix.n11 = 2 * near / ( xmax - xmin );
+				projectionMatrix.n13 = ( xmax + xmin ) / ( xmax - xmin );
+				_cameraL.projectionMatrix = projectionMatrix.clone();
 			
 			
-			//for right eye		
-			xmin = -ymax * aspect - eyeSepOnProjection;
-			xmax = ymax * aspect - eyeSepOnProjection;
-			projectionMatrix.n11 = 2 * near / ( xmax - xmin );
-			projectionMatrix.n13 = ( xmax + xmin ) / ( xmax - xmin );
-			_cameraR.projectionMatrix = projectionMatrix.clone();
+				//for right eye		
+				xmin = -ymax * aspect - eyeSepOnProjection;
+				xmax = ymax * aspect - eyeSepOnProjection;
+				projectionMatrix.n11 = 2 * near / ( xmax - xmin );
+				projectionMatrix.n13 = ( xmax + xmin ) / ( xmax - xmin );
+				_cameraR.projectionMatrix = projectionMatrix.clone();
 				
 				
-		}	
+			}	
 		
 		
-		_cameraL.matrix = camera.matrixWorld.clone().multiplySelf( eyeLeft );
-		_cameraL.update(null, true);
-		_cameraL.position.copy( camera.position );
-		_cameraL.near = near;
-		_cameraL.far = camera.far;
-		_render.call( _this, scene, _cameraL, _renderTargetL, true );
-
-		_cameraR.matrix = camera.matrixWorld.clone().multiplySelf( eyeRight );
-		_cameraR.update(null, true);
-		_cameraR.position.copy( camera.position );
-		_cameraR.near = near;
-		_cameraR.far = camera.far;
-		_render.call( _this, scene, _cameraR, _renderTargetR, true );
+			_cameraL.matrix = camera.matrixWorld.clone().multiplySelf( eyeLeft );
+			_cameraL.update(null, true);
+			_cameraL.position.copy( camera.position );
+			_cameraL.near = near;
+			_cameraL.far = camera.far;
+			_render.call( _this, scene, _cameraL, _renderTargetL, true );
+
+			_cameraR.matrix = camera.matrixWorld.clone().multiplySelf( eyeRight );
+			_cameraR.update(null, true);
+			_cameraR.position.copy( camera.position );
+			_cameraR.near = near;
+			_cameraR.far = camera.far;
+			_render.call( _this, scene, _cameraR, _renderTargetR, true );
 		
 		
-		_render.call( _this, _scene, _camera );
-
-	};
+			_render.call( _this, _scene, _camera );
 
 
-};
+		};
 
 
-THREE.AnaglyphWebGLRenderer.prototype = new THREE.WebGLRenderer();
-THREE.AnaglyphWebGLRenderer.prototype.constructor = THREE.AnaglyphWebGLRenderer;
+	};
+	
+}