瀏覽代碼

Started doing Camera changes.
* Camera is now a base object. PerspectiveCamera should be used instead. Figured out a way to show a warning when misused.
* OrthoCamera is now OrthographicCamera.
* Removed `target` from Camera.

Misc
* Renamed Trident to Axes.

Mr.doob 14 年之前
父節點
當前提交
5d96f15b39

+ 1 - 1
README.md

@@ -95,7 +95,7 @@ This code creates a camera, then creates a scene, adds a cube on it, creates a &
 
 		function init() {
 
-			camera = new THREE.Camera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
+			camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
 			camera.position.z = 1000;
 
 			scene = new THREE.Scene();

+ 402 - 398
build/Three.js

@@ -1,6 +1,6 @@
 // Three.js r45dev - http://github.com/mrdoob/three.js
 var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this};
-THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var f,h,m;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),h=b*6-f,b=e*(1-c),m=e*(1-c*h),c=e*(1-c*(1-h)),f){case 1:this.r=m;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=m;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=
+THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var f,k,m;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),k=b*6-f,b=e*(1-c),m=e*(1-c*k),c=e*(1-c*(1-k)),f){case 1:this.r=m;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=m;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=
 e;this.g=b;this.b=m;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
 THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0};
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this},
@@ -15,87 +15,87 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,c,e,f){this.x=
 c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;this.w-=b.w;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;this.w*=b;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b,this.w/=b):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z+this.w*b.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
 normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3};
 THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,f=[];c=0;for(e=b.length;c<e;c++)Array.prototype.push.apply(f,this.intersectObject(b[c]));f.sort(function(b,e){return b.distance-e.distance});return f},intersectObject:function(b){function c(b,e,c){var f;f=c.clone().subSelf(b).dot(e);if(f<=0)return null;b=b.clone().addSelf(e.clone().multiplyScalar(f));return c.distanceTo(b)}function e(b,e,c,f){var f=f.clone().subSelf(e),
-c=c.clone().subSelf(e),h=b.clone().subSelf(e),b=f.dot(f),e=f.dot(c),f=f.dot(h),k=c.dot(c),c=c.dot(h),h=1/(b*k-e*e),k=(k*f-e*c)*h,b=(b*c-e*f)*h;return k>0&&b>0&&k+b<1}if(b instanceof THREE.Particle){var f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.scale.x)return[];return[{distance:f,point:b.position,face:null,object:b}]}else if(b instanceof THREE.Mesh){f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.geometry.boundingSphere.radius*Math.max(b.scale.x,
-Math.max(b.scale.y,b.scale.z)))return[];var h,m,k,n,u,p,v,t,x,w,y=b.geometry,z=y.vertices,C=[],f=0;for(h=y.faces.length;f<h;f++)if(m=y.faces[f],x=this.origin.clone(),w=this.direction.clone(),p=b.matrixWorld,k=p.multiplyVector3(m.centroid.clone()).subSelf(x),t=k.dot(w),!(t<=0)&&(k=p.multiplyVector3(z[m.a].position.clone()),n=p.multiplyVector3(z[m.b].position.clone()),u=p.multiplyVector3(z[m.c].position.clone()),p=m instanceof THREE.Face4?p.multiplyVector3(z[m.d].position.clone()):null,v=b.matrixRotationWorld.multiplyVector3(m.normal.clone()),
-t=w.dot(v),b.doubleSided||(b.flipSided?t>0:t<0)))if(t=v.dot((new THREE.Vector3).sub(k,x))/t,x=x.addSelf(w.multiplyScalar(t)),m instanceof THREE.Face3)e(x,k,n,u)&&(m={distance:this.origin.distanceTo(x),point:x,face:m,object:b},C.push(m));else if(m instanceof THREE.Face4&&(e(x,k,n,p)||e(x,n,u,p)))m={distance:this.origin.distanceTo(x),point:x,face:m,object:b},C.push(m);C.sort(function(b,e){return b.distance-e.distance});return C}else return[]}};
-THREE.Rectangle=function(){function b(){m=f-c;k=h-e}var c,e,f,h,m,k,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return m};this.getHeight=function(){return k};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,v,t){n=!1;c=k;e=m;f=v;h=t;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=c<k?c:k,e=e<m?e:m,f=f>k?f:k,h=h>m?h:m);b()};this.add3Points=
-function(k,m,v,t,x,w){n?(n=!1,c=k<v?k<x?k:x:v<x?v:x,e=m<t?m<w?m:w:t<w?t:w,f=k>v?k>x?k:x:v>x?v:x,h=m>t?m>w?m:w:t>w?t:w):(c=k<v?k<x?k<c?k:c:x<c?x:c:v<x?v<c?v:c:x<c?x:c,e=m<t?m<w?m<e?m:e:w<e?w:e:t<w?t<e?t:e:w<e?w:e,f=k>v?k>x?k>f?k:f:x>f?x:f:v>x?v>f?v:f:x>f?x:f,h=m>t?m>w?m>h?m:h:w>h?w:h:t>w?t>h?t:h:w>h?w:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=c<k.getLeft()?c:k.getLeft(),e=e<k.getTop()?e:k.getTop(),f=f>k.getRight()?f:k.getRight(),h=h>
-k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f<k.getRight()?f:k.getRight();h=h<k.getBottom()?h:k.getBottom();b()};this.intersects=function(b){return Math.min(f,b.getRight())-Math.max(c,b.getLeft())>=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}};THREE.Matrix3=function(){this.m=[]};
+c=c.clone().subSelf(e),k=b.clone().subSelf(e),b=f.dot(f),e=f.dot(c),f=f.dot(k),h=c.dot(c),c=c.dot(k),k=1/(b*h-e*e),h=(h*f-e*c)*k,b=(b*c-e*f)*k;return h>0&&b>0&&h+b<1}if(b instanceof THREE.Particle){var f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.scale.x)return[];return[{distance:f,point:b.position,face:null,object:b}]}else if(b instanceof THREE.Mesh){f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.geometry.boundingSphere.radius*Math.max(b.scale.x,
+Math.max(b.scale.y,b.scale.z)))return[];var k,m,h,n,p,t,u,w,x,v,y=b.geometry,z=y.vertices,C=[],f=0;for(k=y.faces.length;f<k;f++)if(m=y.faces[f],x=this.origin.clone(),v=this.direction.clone(),t=b.matrixWorld,h=t.multiplyVector3(m.centroid.clone()).subSelf(x),w=h.dot(v),!(w<=0)&&(h=t.multiplyVector3(z[m.a].position.clone()),n=t.multiplyVector3(z[m.b].position.clone()),p=t.multiplyVector3(z[m.c].position.clone()),t=m instanceof THREE.Face4?t.multiplyVector3(z[m.d].position.clone()):null,u=b.matrixRotationWorld.multiplyVector3(m.normal.clone()),
+w=v.dot(u),b.doubleSided||(b.flipSided?w>0:w<0)))if(w=u.dot((new THREE.Vector3).sub(h,x))/w,x=x.addSelf(v.multiplyScalar(w)),m instanceof THREE.Face3)e(x,h,n,p)&&(m={distance:this.origin.distanceTo(x),point:x,face:m,object:b},C.push(m));else if(m instanceof THREE.Face4&&(e(x,h,n,t)||e(x,n,p,t)))m={distance:this.origin.distanceTo(x),point:x,face:m,object:b},C.push(m);C.sort(function(b,e){return b.distance-e.distance});return C}else return[]}};
+THREE.Rectangle=function(){function b(){m=f-c;h=k-e}var c,e,f,k,m,h,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return m};this.getHeight=function(){return h};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return k};this.set=function(h,m,u,w){n=!1;c=h;e=m;f=u;k=w;b()};this.addPoint=function(h,m){n?(n=!1,c=h,e=m,f=h,k=m):(c=c<h?c:h,e=e<m?e:m,f=f>h?f:h,k=k>m?k:m);b()};this.add3Points=
+function(h,m,u,w,x,v){n?(n=!1,c=h<u?h<x?h:x:u<x?u:x,e=m<w?m<v?m:v:w<v?w:v,f=h>u?h>x?h:x:u>x?u:x,k=m>w?m>v?m:v:w>v?w:v):(c=h<u?h<x?h<c?h:c:x<c?x:c:u<x?u<c?u:c:x<c?x:c,e=m<w?m<v?m<e?m:e:v<e?v:e:w<v?w<e?w:e:v<e?v:e,f=h>u?h>x?h>f?h:f:x>f?x:f:u>x?u>f?u:f:x>f?x:f,k=m>w?m>v?m>k?m:k:v>k?v:k:w>v?w>k?w:k:v>k?v:k);b()};this.addRectangle=function(h){n?(n=!1,c=h.getLeft(),e=h.getTop(),f=h.getRight(),k=h.getBottom()):(c=c<h.getLeft()?c:h.getLeft(),e=e<h.getTop()?e:h.getTop(),f=f>h.getRight()?f:h.getRight(),k=k>
+h.getBottom()?k:h.getBottom());b()};this.inflate=function(h){c-=h;e-=h;f+=h;k+=h;b()};this.minSelf=function(h){c=c>h.getLeft()?c:h.getLeft();e=e>h.getTop()?e:h.getTop();f=f<h.getRight()?f:h.getRight();k=k<h.getBottom()?k:h.getBottom();b()};this.intersects=function(b){return Math.min(f,b.getRight())-Math.max(c,b.getLeft())>=0&&Math.min(k,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;k=f=e=c=0;b()};this.isEmpty=function(){return n}};THREE.Matrix3=function(){this.m=[]};
 THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}};
-THREE.Matrix4=function(b,c,e,f,h,m,k,n,u,p,v,t,x,w,y,z){this.set(b!==void 0?b:1,c||0,e||0,f||0,h||0,m!==void 0?m:1,k||0,n||0,u||0,p||0,v!==void 0?v:1,t||0,x||0,w||0,y||0,z!==void 0?z:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,h,m,k,n,u,p,v,t,x,w,y,z){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=h;this.n22=m;this.n23=k;this.n24=n;this.n31=u;this.n32=p;this.n33=v;this.n34=t;this.n41=x;this.n42=w;this.n43=y;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,e){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,m=THREE.Matrix4.__v3;m.sub(b,c).normalize();if(m.length()===0)m.z=1;f.cross(e,m).normalize();f.length()===0&&(m.x+=1.0E-4,f.cross(e,m).normalize());h.cross(m,f).normalize();this.n11=f.x;this.n12=h.x;this.n13=m.x;this.n21=f.y;this.n22=h.y;this.n23=m.y;this.n31=f.z;this.n32=h.z;this.n33=m.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,f=b.z,h=1/(this.n41*c+this.n42*e+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*e+this.n13*f+this.n14)*h;
-b.y=(this.n21*c+this.n22*e+this.n23*f+this.n24)*h;b.z=(this.n31*c+this.n32*e+this.n33*f+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,e=b.y,f=b.z,h=b.w;b.x=this.n11*c+this.n12*e+this.n13*f+this.n14*h;b.y=this.n21*c+this.n22*e+this.n23*f+this.n24*h;b.z=this.n31*c+this.n32*e+this.n33*f+this.n34*h;b.w=this.n41*c+this.n42*e+this.n43*f+this.n44*h;return b},rotateAxis:function(b){var c=b.x,e=b.y,f=b.z;b.x=c*this.n11+e*this.n12+f*this.n13;b.y=c*this.n21+e*this.n22+f*this.n23;b.z=c*this.n31+
-e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,h=b.n13,m=b.n14,k=b.n21,n=b.n22,u=b.n23,p=b.n24,v=b.n31,t=b.n32,x=b.n33,w=b.n34,y=b.n41,z=b.n42,C=b.n43,A=b.n44,F=c.n11,D=c.n12,
-J=c.n13,P=c.n14,S=c.n21,I=c.n22,H=c.n23,G=c.n24,Y=c.n31,E=c.n32,Q=c.n33,R=c.n34,W=c.n41,X=c.n42,o=c.n43,ea=c.n44;this.n11=e*F+f*S+h*Y+m*W;this.n12=e*D+f*I+h*E+m*X;this.n13=e*J+f*H+h*Q+m*o;this.n14=e*P+f*G+h*R+m*ea;this.n21=k*F+n*S+u*Y+p*W;this.n22=k*D+n*I+u*E+p*X;this.n23=k*J+n*H+u*Q+p*o;this.n24=k*P+n*G+u*R+p*ea;this.n31=v*F+t*S+x*Y+w*W;this.n32=v*D+t*I+x*E+w*X;this.n33=v*J+t*H+x*Q+w*o;this.n34=v*P+t*G+x*R+w*ea;this.n41=y*F+z*S+C*Y+A*W;this.n42=y*D+z*I+C*E+A*X;this.n43=y*J+z*H+C*Q+A*o;this.n44=y*
+THREE.Matrix4=function(b,c,e,f,k,m,h,n,p,t,u,w,x,v,y,z){this.set(b!==void 0?b:1,c||0,e||0,f||0,k||0,m!==void 0?m:1,h||0,n||0,p||0,t||0,u!==void 0?u:1,w||0,x||0,v||0,y||0,z!==void 0?z:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,k,m,h,n,p,t,u,w,x,v,y,z){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=k;this.n22=m;this.n23=h;this.n24=n;this.n31=p;this.n32=t;this.n33=u;this.n34=w;this.n41=x;this.n42=v;this.n43=y;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,e){var f=THREE.Matrix4.__v1,k=THREE.Matrix4.__v2,m=THREE.Matrix4.__v3;m.sub(b,c).normalize();if(m.length()===0)m.z=1;f.cross(e,m).normalize();f.length()===0&&(m.x+=1.0E-4,f.cross(e,m).normalize());k.cross(m,f).normalize();this.n11=f.x;this.n12=k.x;this.n13=m.x;this.n21=f.y;this.n22=k.y;this.n23=m.y;this.n31=f.z;this.n32=k.z;this.n33=m.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,f=b.z,k=1/(this.n41*c+this.n42*e+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*e+this.n13*f+this.n14)*k;
+b.y=(this.n21*c+this.n22*e+this.n23*f+this.n24)*k;b.z=(this.n31*c+this.n32*e+this.n33*f+this.n34)*k;return b},multiplyVector4:function(b){var c=b.x,e=b.y,f=b.z,k=b.w;b.x=this.n11*c+this.n12*e+this.n13*f+this.n14*k;b.y=this.n21*c+this.n22*e+this.n23*f+this.n24*k;b.z=this.n31*c+this.n32*e+this.n33*f+this.n34*k;b.w=this.n41*c+this.n42*e+this.n43*f+this.n44*k;return b},rotateAxis:function(b){var c=b.x,e=b.y,f=b.z;b.x=c*this.n11+e*this.n12+f*this.n13;b.y=c*this.n21+e*this.n22+f*this.n23;b.z=c*this.n31+
+e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,k=b.n13,m=b.n14,h=b.n21,n=b.n22,p=b.n23,t=b.n24,u=b.n31,w=b.n32,x=b.n33,v=b.n34,y=b.n41,z=b.n42,C=b.n43,A=b.n44,F=c.n11,D=c.n12,
+J=c.n13,P=c.n14,S=c.n21,I=c.n22,H=c.n23,G=c.n24,Y=c.n31,E=c.n32,Q=c.n33,R=c.n34,W=c.n41,X=c.n42,o=c.n43,ea=c.n44;this.n11=e*F+f*S+k*Y+m*W;this.n12=e*D+f*I+k*E+m*X;this.n13=e*J+f*H+k*Q+m*o;this.n14=e*P+f*G+k*R+m*ea;this.n21=h*F+n*S+p*Y+t*W;this.n22=h*D+n*I+p*E+t*X;this.n23=h*J+n*H+p*Q+t*o;this.n24=h*P+n*G+p*R+t*ea;this.n31=u*F+w*S+x*Y+v*W;this.n32=u*D+w*I+x*E+v*X;this.n33=u*J+w*H+x*Q+v*o;this.n34=u*P+w*G+x*R+v*ea;this.n41=y*F+z*S+C*Y+A*W;this.n42=y*D+z*I+C*E+A*X;this.n43=y*J+z*H+C*Q+A*o;this.n44=y*
 P+z*G+C*R+A*ea;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=
-b;this.n31*=b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,h=this.n21,m=this.n22,k=this.n23,n=this.n24,u=this.n31,p=this.n32,v=this.n33,t=this.n34,x=this.n41,w=this.n42,y=this.n43,z=this.n44;return f*k*p*x-e*n*p*x-f*m*v*x+c*n*v*x+e*m*t*x-c*k*t*x-f*k*u*w+e*n*u*w+f*h*v*w-b*n*v*w-e*h*t*w+b*k*t*w+f*m*u*y-c*n*u*y-f*h*p*y+b*n*p*y+c*h*t*y-b*m*t*y-e*m*u*z+c*k*u*z+e*h*p*z-b*k*p*z-c*h*
-v*z+b*m*v*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=
+b;this.n31*=b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,k=this.n21,m=this.n22,h=this.n23,n=this.n24,p=this.n31,t=this.n32,u=this.n33,w=this.n34,x=this.n41,v=this.n42,y=this.n43,z=this.n44;return f*h*t*x-e*n*t*x-f*m*u*x+c*n*u*x+e*m*w*x-c*h*w*x-f*h*p*v+e*n*p*v+f*k*u*v-b*n*u*v-e*k*w*v+b*h*w*v+f*m*p*y-c*n*p*y-f*k*t*y+b*n*t*y+c*k*w*y-b*m*w*y-e*m*p*z+c*h*p*z+e*k*t*z-b*h*t*z-c*k*
+u*z+b*m*u*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.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]=
 this.n11;b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=
 this.n34;b[c+15]=this.n44;return b},setTranslation:function(b,c,e){this.set(1,0,0,b,0,1,0,c,0,0,1,e,0,0,0,1);return this},setScale:function(b,c,e){this.set(b,0,0,0,0,c,0,0,0,0,e,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,-b,0,
-0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),f=Math.sin(c),h=1-e,m=b.x,k=b.y,n=b.z,u=h*m,p=h*k;this.set(u*m+e,u*k-f*n,u*n+f*k,0,u*k+f*n,p*k+e,p*n-f*m,0,u*n-f*k,p*n+f*m,h*n*n+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
-new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,f=b.y,h=b.z,m=Math.cos(e),e=Math.sin(e),k=Math.cos(f),f=Math.sin(f),n=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var u=
-k*n,p=k*h,v=f*n,t=f*h;this.n11=u+t*e;this.n12=v*e-p;this.n13=m*f;this.n21=m*h;this.n22=m*n;this.n23=-e;this.n31=p*e-v;this.n32=t+u*e;this.n33=m*k;break;case "ZXY":u=k*n;p=k*h;v=f*n;t=f*h;this.n11=u-t*e;this.n12=-m*h;this.n13=v+p*e;this.n21=p+v*e;this.n22=m*n;this.n23=t-u*e;this.n31=-m*f;this.n32=e;this.n33=m*k;break;case "ZYX":u=m*n;p=m*h;v=e*n;t=e*h;this.n11=k*n;this.n12=v*f-p;this.n13=u*f+t;this.n21=k*h;this.n22=t*f+u;this.n23=p*f-v;this.n31=-f;this.n32=e*k;this.n33=m*k;break;case "YZX":u=m*k;p=
-m*f;v=e*k;t=e*f;this.n11=k*n;this.n12=t-u*h;this.n13=v*h+p;this.n21=h;this.n22=m*n;this.n23=-e*n;this.n31=-f*n;this.n32=p*h+v;this.n33=u-t*h;break;case "XZY":u=m*k;p=m*f;v=e*k;t=e*f;this.n11=k*n;this.n12=-h;this.n13=f*n;this.n21=u*h+t;this.n22=m*n;this.n23=p*h-v;this.n31=v*h-p;this.n32=e*n;this.n33=t*h+u;break;default:u=m*n,p=m*h,v=e*n,t=e*h,this.n11=k*n,this.n12=-k*h,this.n13=f,this.n21=p+v*f,this.n22=u-t*f,this.n23=-e*k,this.n31=t-u*f,this.n32=v+p*f,this.n33=m*k}return this},setRotationFromQuaternion:function(b){var c=
-b.x,e=b.y,f=b.z,h=b.w,m=c+c,k=e+e,n=f+f,b=c*m,u=c*k;c*=n;var p=e*k;e*=n;f*=n;m*=h;k*=h;h*=n;this.n11=1-(p+f);this.n12=u-h;this.n13=c+k;this.n21=u+h;this.n22=1-(b+f);this.n23=e-m;this.n31=c-k;this.n32=e+m;this.n33=1-(b+p);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var f=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2;
-f.identity();f.setRotationFromQuaternion(c);h.setScale(e.x,e.y,e.z);this.multiply(f,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,m=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);m.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;e=e instanceof THREE.Vector3?e:new THREE.Vector3;e.x=f.length();
-e.y=h.length();e.z=m.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=e.x;f.n21/=e.x;f.n31/=e.x;f.n12/=e.y;f.n22/=e.y;f.n32/=e.y;f.n13/=e.z;f.n23/=e.z;f.n33/=e.z;c.setFromRotationMatrix(f);return[b,c,e]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var e=1/c.x,f=1/c.y,h=1/c.z;this.n11=b.n11*e;this.n21=b.n21*e;this.n31=b.n31*e;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*h;this.n23=
-b.n23*h;this.n33=b.n33*h}};
-THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,h=b.n13,m=b.n14,k=b.n21,n=b.n22,u=b.n23,p=b.n24,v=b.n31,t=b.n32,x=b.n33,w=b.n34,y=b.n41,z=b.n42,C=b.n43,A=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=u*w*z-p*x*z+p*t*C-n*w*C-u*t*A+n*x*A;c.n12=m*x*z-h*w*z-m*t*C+f*w*C+h*t*A-f*x*A;c.n13=h*p*z-m*u*z+m*n*C-f*p*C-h*n*A+f*u*A;c.n14=m*u*t-h*p*t-m*n*x+f*p*x+h*n*w-f*u*w;c.n21=p*x*y-u*w*y-p*v*C+k*w*C+u*v*A-k*x*A;c.n22=h*w*y-m*x*y+m*v*C-e*w*C-h*v*A+e*x*A;c.n23=m*u*y-h*p*y-m*k*C+e*p*C+h*k*A-e*u*A;c.n24=
-h*p*v-m*u*v+m*k*x-e*p*x-h*k*w+e*u*w;c.n31=n*w*y-p*t*y+p*v*z-k*w*z-n*v*A+k*t*A;c.n32=m*t*y-f*w*y-m*v*z+e*w*z+f*v*A-e*t*A;c.n33=h*p*y-m*n*y+m*k*z-e*p*z-f*k*A+e*n*A;c.n34=m*n*v-f*p*v-m*k*t+e*p*t+f*k*w-e*n*w;c.n41=u*t*y-n*x*y-u*v*z+k*x*z+n*v*C-k*t*C;c.n42=f*x*y-h*t*y+h*v*z-e*x*z-f*v*C+e*t*C;c.n43=h*n*y-f*u*y-h*k*z+e*u*z+f*k*C-e*n*C;c.n44=f*u*v-h*n*v+h*k*t-e*u*t-f*k*x+e*n*x;c.multiplyScalar(1/b.determinant());return c};
-THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,f=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,m=b.n32*b.n21-b.n31*b.n22,k=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,u=-b.n32*b.n11+b.n31*b.n12,p=b.n23*b.n12-b.n22*b.n13,v=-b.n23*b.n11+b.n21*b.n13,t=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*k+b.n31*p;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*h;e[2]=b*m;e[3]=b*k;e[4]=b*n;e[5]=b*u;e[6]=b*p;e[7]=b*v;e[8]=b*t;return c};
-THREE.Matrix4.makeFrustum=function(b,c,e,f,h,m){var k;k=new THREE.Matrix4;k.n11=2*h/(c-b);k.n12=0;k.n13=(c+b)/(c-b);k.n14=0;k.n21=0;k.n22=2*h/(f-e);k.n23=(f+e)/(f-e);k.n24=0;k.n31=0;k.n32=0;k.n33=-(m+h)/(m-h);k.n34=-2*m*h/(m-h);k.n41=0;k.n42=0;k.n43=-1;k.n44=0;return k};THREE.Matrix4.makePerspective=function(b,c,e,f){var h,b=e*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,e,f)};
-THREE.Matrix4.makeOrtho=function(b,c,e,f,h,m){var k,n,u,p;k=new THREE.Matrix4;n=c-b;u=e-f;p=m-h;k.n11=2/n;k.n12=0;k.n13=0;k.n14=-((c+b)/n);k.n21=0;k.n22=2/u;k.n23=0;k.n24=-((e+f)/u);k.n31=0;k.n32=0;k.n33=-2/p;k.n34=-((m+h)/p);k.n41=0;k.n42=0;k.n43=0;k.n44=1;return k};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
+0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),f=Math.sin(c),k=1-e,m=b.x,h=b.y,n=b.z,p=k*m,t=k*h;this.set(p*m+e,p*h-f*n,p*n+f*h,0,p*h+f*n,t*h+e,t*n-f*m,0,p*n-f*h,t*n+f*m,k*n*n+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
+new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,f=b.y,k=b.z,m=Math.cos(e),e=Math.sin(e),h=Math.cos(f),f=Math.sin(f),n=Math.cos(k),k=Math.sin(k);switch(c){case "YXZ":var p=
+h*n,t=h*k,u=f*n,w=f*k;this.n11=p+w*e;this.n12=u*e-t;this.n13=m*f;this.n21=m*k;this.n22=m*n;this.n23=-e;this.n31=t*e-u;this.n32=w+p*e;this.n33=m*h;break;case "ZXY":p=h*n;t=h*k;u=f*n;w=f*k;this.n11=p-w*e;this.n12=-m*k;this.n13=u+t*e;this.n21=t+u*e;this.n22=m*n;this.n23=w-p*e;this.n31=-m*f;this.n32=e;this.n33=m*h;break;case "ZYX":p=m*n;t=m*k;u=e*n;w=e*k;this.n11=h*n;this.n12=u*f-t;this.n13=p*f+w;this.n21=h*k;this.n22=w*f+p;this.n23=t*f-u;this.n31=-f;this.n32=e*h;this.n33=m*h;break;case "YZX":p=m*h;t=
+m*f;u=e*h;w=e*f;this.n11=h*n;this.n12=w-p*k;this.n13=u*k+t;this.n21=k;this.n22=m*n;this.n23=-e*n;this.n31=-f*n;this.n32=t*k+u;this.n33=p-w*k;break;case "XZY":p=m*h;t=m*f;u=e*h;w=e*f;this.n11=h*n;this.n12=-k;this.n13=f*n;this.n21=p*k+w;this.n22=m*n;this.n23=t*k-u;this.n31=u*k-t;this.n32=e*n;this.n33=w*k+p;break;default:p=m*n,t=m*k,u=e*n,w=e*k,this.n11=h*n,this.n12=-h*k,this.n13=f,this.n21=t+u*f,this.n22=p-w*f,this.n23=-e*h,this.n31=w-p*f,this.n32=u+t*f,this.n33=m*h}return this},setRotationFromQuaternion:function(b){var c=
+b.x,e=b.y,f=b.z,k=b.w,m=c+c,h=e+e,n=f+f,b=c*m,p=c*h;c*=n;var t=e*h;e*=n;f*=n;m*=k;h*=k;k*=n;this.n11=1-(t+f);this.n12=p-k;this.n13=c+h;this.n21=p+k;this.n22=1-(b+f);this.n23=e-m;this.n31=c-h;this.n32=e+m;this.n33=1-(b+t);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var f=THREE.Matrix4.__m1,k=THREE.Matrix4.__m2;
+f.identity();f.setRotationFromQuaternion(c);k.setScale(e.x,e.y,e.z);this.multiply(f,k);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var f=THREE.Matrix4.__v1,k=THREE.Matrix4.__v2,m=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);k.set(this.n12,this.n22,this.n32);m.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;e=e instanceof THREE.Vector3?e:new THREE.Vector3;e.x=f.length();
+e.y=k.length();e.z=m.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=e.x;f.n21/=e.x;f.n31/=e.x;f.n12/=e.y;f.n22/=e.y;f.n32/=e.y;f.n13/=e.z;f.n23/=e.z;f.n33/=e.z;c.setFromRotationMatrix(f);return[b,c,e]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var e=1/c.x,f=1/c.y,k=1/c.z;this.n11=b.n11*e;this.n21=b.n21*e;this.n31=b.n31*e;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*k;this.n23=
+b.n23*k;this.n33=b.n33*k}};
+THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,k=b.n13,m=b.n14,h=b.n21,n=b.n22,p=b.n23,t=b.n24,u=b.n31,w=b.n32,x=b.n33,v=b.n34,y=b.n41,z=b.n42,C=b.n43,A=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=p*v*z-t*x*z+t*w*C-n*v*C-p*w*A+n*x*A;c.n12=m*x*z-k*v*z-m*w*C+f*v*C+k*w*A-f*x*A;c.n13=k*t*z-m*p*z+m*n*C-f*t*C-k*n*A+f*p*A;c.n14=m*p*w-k*t*w-m*n*x+f*t*x+k*n*v-f*p*v;c.n21=t*x*y-p*v*y-t*u*C+h*v*C+p*u*A-h*x*A;c.n22=k*v*y-m*x*y+m*u*C-e*v*C-k*u*A+e*x*A;c.n23=m*p*y-k*t*y-m*h*C+e*t*C+k*h*A-e*p*A;c.n24=
+k*t*u-m*p*u+m*h*x-e*t*x-k*h*v+e*p*v;c.n31=n*v*y-t*w*y+t*u*z-h*v*z-n*u*A+h*w*A;c.n32=m*w*y-f*v*y-m*u*z+e*v*z+f*u*A-e*w*A;c.n33=k*t*y-m*n*y+m*h*z-e*t*z-f*h*A+e*n*A;c.n34=m*n*u-f*t*u-m*h*w+e*t*w+f*h*v-e*n*v;c.n41=p*w*y-n*x*y-p*u*z+h*x*z+n*u*C-h*w*C;c.n42=f*x*y-k*w*y+k*u*z-e*x*z-f*u*C+e*w*C;c.n43=k*n*y-f*p*y-k*h*z+e*p*z+f*h*C-e*n*C;c.n44=f*p*u-k*n*u+k*h*w-e*p*w-f*h*x+e*n*x;c.multiplyScalar(1/b.determinant());return c};
+THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,f=b.n33*b.n22-b.n32*b.n23,k=-b.n33*b.n21+b.n31*b.n23,m=b.n32*b.n21-b.n31*b.n22,h=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,p=-b.n32*b.n11+b.n31*b.n12,t=b.n23*b.n12-b.n22*b.n13,u=-b.n23*b.n11+b.n21*b.n13,w=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*h+b.n31*t;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*k;e[2]=b*m;e[3]=b*h;e[4]=b*n;e[5]=b*p;e[6]=b*t;e[7]=b*u;e[8]=b*w;return c};
+THREE.Matrix4.makeFrustum=function(b,c,e,f,k,m){var h;h=new THREE.Matrix4;h.n11=2*k/(c-b);h.n12=0;h.n13=(c+b)/(c-b);h.n14=0;h.n21=0;h.n22=2*k/(f-e);h.n23=(f+e)/(f-e);h.n24=0;h.n31=0;h.n32=0;h.n33=-(m+k)/(m-k);h.n34=-2*m*k/(m-k);h.n41=0;h.n42=0;h.n43=-1;h.n44=0;return h};THREE.Matrix4.makePerspective=function(b,c,e,f){var k,b=e*Math.tan(b*Math.PI/360);k=-b;return THREE.Matrix4.makeFrustum(k*c,b*c,k,b,e,f)};
+THREE.Matrix4.makeOrtho=function(b,c,e,f,k,m){var h,n,p,t;h=new THREE.Matrix4;n=c-b;p=e-f;t=m-k;h.n11=2/n;h.n12=0;h.n13=0;h.n14=-((c+b)/n);h.n21=0;h.n22=2/p;h.n23=0;h.n24=-((e+f)/p);h.n31=0;h.n32=0;h.n33=-2/t;h.n34=-((m+k)/t);h.n41=0;h.n42=0;h.n43=0;h.n44=1;return h};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
 !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
-THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this instanceof THREE.Camera?this.matrix.lookAt(this.position,b,this.up):this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&
-this.rotation.setRotationFromMatrix(this.matrix)},add:function(b){if(this.children.indexOf(b)===-1){b.parent!==void 0&&b.parent.removeChild(b);b.parent=this;this.children.push(b);for(var c=this;c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.addChildRecurse(b)}},remove:function(b){var c=this,e=this.children.indexOf(b);if(e!==-1){b.parent=void 0;for(this.children.splice(e,1);c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.removeChildRecurse(b)}},getChildByName:function(b,
-c){var e,f,h;e=0;for(f=this.children.length;e<f;e++){h=this.children[e];if(h.name===b)return h;if(c&&(h=h.getChildByName(b,c),h!==void 0))return h}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,
-this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,e){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||c)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,c=!0;for(var b=0,f=this.children.length;b<f;b++)this.children[b].update(this.matrixWorld,c,e)},addChild:function(b){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");
-this.add(b)},removeChild:function(b){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");this.remove(b)}};THREE.Object3DCount=0;
-THREE.Projector=function(){function b(){var b=u[n]=u[n]||new THREE.RenderableVertex;n++;return b}function c(b,e){return e.z-b.z}function e(b,e){var c=0,f=1,k=b.z+b.w,h=e.z+e.w,m=-b.z+b.w,n=-e.z+e.w;return k>=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?c=Math.max(c,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?c=Math.max(c,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),f<c?!1:(b.lerpSelf(e,c),e.lerpSelf(b,1-f),!0))}var f,h,m=[],k,n,u=[],p,v,t=[],x,w=[],y,z,C=[],A,F,D=[],J=[],P=[],S=new THREE.Vector4,I=new THREE.Vector4,
-H=new THREE.Matrix4,G=new THREE.Matrix4,Y=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],E=new THREE.Vector4,Q=new THREE.Vector4;this.projectVector=function(b,e){H.multiply(e.projectionMatrix,e.matrixWorldInverse);H.multiplyVector3(b);return b};this.unprojectVector=function(b,e){H.multiply(e.matrixWorld,THREE.Matrix4.makeInvert(e.projectionMatrix));H.multiplyVector3(b);return b};this.projectObjects=function(b,e,k){var o,n;h=J.length=0;
-o=b.objects;b=0;for(e=o.length;b<e;b++){n=o[b];var w;if(!(w=!n.visible))if(w=n instanceof THREE.Mesh)if(w=n.frustumCulled){a:{w=void 0;for(var t=n.matrixWorld,p=-n.geometry.boundingSphere.radius*Math.max(n.scale.x,Math.max(n.scale.y,n.scale.z)),u=0;u<6;u++)if(w=Y[u].x*t.n14+Y[u].y*t.n24+Y[u].z*t.n34+Y[u].w,w<=p){w=!1;break a}w=!0}w=!w}if(!w)w=m[h]=m[h]||new THREE.RenderableObject,h++,f=w,S.copy(n.position),H.multiplyVector3(S),f.object=n,f.z=S.z,J.push(f)}k&&J.sort(c);return J};this.projectScene=
-function(f,h,m){var o=h.near,J=h.far,V,S,aa,ia,ca,ja,fa,da,U,Z,ga,ka,ta,ma,na,qa,ra;F=z=x=v=P.length=0;h.matrixAutoUpdate&&h.update(void 0,!0);f.update(void 0,!1,h);H.multiply(h.projectionMatrix,h.matrixWorldInverse);Y[0].set(H.n41-H.n11,H.n42-H.n12,H.n43-H.n13,H.n44-H.n14);Y[1].set(H.n41+H.n11,H.n42+H.n12,H.n43+H.n13,H.n44+H.n14);Y[2].set(H.n41+H.n21,H.n42+H.n22,H.n43+H.n23,H.n44+H.n24);Y[3].set(H.n41-H.n21,H.n42-H.n22,H.n43-H.n23,H.n44-H.n24);Y[4].set(H.n41-H.n31,H.n42-H.n32,H.n43-H.n33,H.n44-H.n34);
-Y[5].set(H.n41+H.n31,H.n42+H.n32,H.n43+H.n33,H.n44+H.n34);for(V=0;V<6;V++)U=Y[V],U.divideScalar(Math.sqrt(U.x*U.x+U.y*U.y+U.z*U.z));U=this.projectObjects(f,h,!0);f=0;for(V=U.length;f<V;f++)if(Z=U[f].object,Z.visible)if(ga=Z.matrixWorld,ka=Z.matrixRotationWorld,ta=Z.materials,ma=Z.overdraw,n=0,Z instanceof THREE.Mesh){na=Z.geometry;ia=na.vertices;qa=na.faces;na=na.faceVertexUvs;S=0;for(aa=ia.length;S<aa;S++)k=b(),k.positionWorld.copy(ia[S].position),ga.multiplyVector3(k.positionWorld),k.positionScreen.copy(k.positionWorld),
-H.multiplyVector4(k.positionScreen),k.positionScreen.x/=k.positionScreen.w,k.positionScreen.y/=k.positionScreen.w,k.visible=k.positionScreen.z>o&&k.positionScreen.z<J;ia=0;for(S=qa.length;ia<S;ia++){aa=qa[ia];if(aa instanceof THREE.Face3)if(ca=u[aa.a],ja=u[aa.b],fa=u[aa.c],ca.visible&&ja.visible&&fa.visible&&(Z.doubleSided||Z.flipSided!=(fa.positionScreen.x-ca.positionScreen.x)*(ja.positionScreen.y-ca.positionScreen.y)-(fa.positionScreen.y-ca.positionScreen.y)*(ja.positionScreen.x-ca.positionScreen.x)<
-0))da=t[v]=t[v]||new THREE.RenderableFace3,v++,p=da,p.v1.copy(ca),p.v2.copy(ja),p.v3.copy(fa);else continue;else if(aa instanceof THREE.Face4)if(ca=u[aa.a],ja=u[aa.b],fa=u[aa.c],da=u[aa.d],ca.visible&&ja.visible&&fa.visible&&da.visible&&(Z.doubleSided||Z.flipSided!=((da.positionScreen.x-ca.positionScreen.x)*(ja.positionScreen.y-ca.positionScreen.y)-(da.positionScreen.y-ca.positionScreen.y)*(ja.positionScreen.x-ca.positionScreen.x)<0||(ja.positionScreen.x-fa.positionScreen.x)*(da.positionScreen.y-
-fa.positionScreen.y)-(ja.positionScreen.y-fa.positionScreen.y)*(da.positionScreen.x-fa.positionScreen.x)<0)))ra=w[x]=w[x]||new THREE.RenderableFace4,x++,p=ra,p.v1.copy(ca),p.v2.copy(ja),p.v3.copy(fa),p.v4.copy(da);else continue;p.normalWorld.copy(aa.normal);ka.multiplyVector3(p.normalWorld);p.centroidWorld.copy(aa.centroid);ga.multiplyVector3(p.centroidWorld);p.centroidScreen.copy(p.centroidWorld);H.multiplyVector3(p.centroidScreen);fa=aa.vertexNormals;ca=0;for(ja=fa.length;ca<ja;ca++)da=p.vertexNormalsWorld[ca],
-da.copy(fa[ca]),ka.multiplyVector3(da);ca=0;for(ja=na.length;ca<ja;ca++)if(ra=na[ca][ia]){fa=0;for(da=ra.length;fa<da;fa++)p.uvs[ca][fa]=ra[fa]}p.meshMaterials=ta;p.faceMaterials=aa.materials;p.overdraw=ma;p.z=p.centroidScreen.z;P.push(p)}}else if(Z instanceof THREE.Line){G.multiply(H,ga);ia=Z.geometry.vertices;ca=b();ca.positionScreen.copy(ia[0].position);G.multiplyVector4(ca.positionScreen);S=1;for(aa=ia.length;S<aa;S++)if(ca=b(),ca.positionScreen.copy(ia[S].position),G.multiplyVector4(ca.positionScreen),
-ja=u[n-2],E.copy(ca.positionScreen),Q.copy(ja.positionScreen),e(E,Q))E.multiplyScalar(1/E.w),Q.multiplyScalar(1/Q.w),ga=C[z]=C[z]||new THREE.RenderableLine,z++,y=ga,y.v1.positionScreen.copy(E),y.v2.positionScreen.copy(Q),y.z=Math.max(E.z,Q.z),y.materials=Z.materials,P.push(y)}else if(Z instanceof THREE.Particle&&(I.set(Z.matrixWorld.n14,Z.matrixWorld.n24,Z.matrixWorld.n34,1),H.multiplyVector4(I),I.z/=I.w,I.z>0&&I.z<1))ga=D[F]=D[F]||new THREE.RenderableParticle,F++,A=ga,A.x=I.x/I.w,A.y=I.y/I.w,A.z=
-I.z,A.rotation=Z.rotation.z,A.scale.x=Z.scale.x*Math.abs(A.x-(I.x+h.projectionMatrix.n11)/(I.w+h.projectionMatrix.n14)),A.scale.y=Z.scale.y*Math.abs(A.y-(I.y+h.projectionMatrix.n22)/(I.w+h.projectionMatrix.n24)),A.materials=Z.materials,P.push(A);m&&P.sort(c);return P}};THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)};
-THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,e=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),m=Math.cos(e),e=Math.sin(e),k=b*c,n=f*h;this.w=k*m-n*e;this.x=k*e+n*m;this.y=f*c*m+b*h*e;this.z=b*h*m-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e);
+THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(b){if(this.children.indexOf(b)===
+-1){b.parent!==void 0&&b.parent.removeChild(b);b.parent=this;this.children.push(b);for(var c=this;c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.addChildRecurse(b)}},remove:function(b){var c=this,e=this.children.indexOf(b);if(e!==-1){b.parent=void 0;for(this.children.splice(e,1);c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.removeChildRecurse(b)}},getChildByName:function(b,c){var e,f,k;e=0;for(f=this.children.length;e<f;e++){k=this.children[e];if(k.name===
+b)return k;if(c&&(k=k.getChildByName(b,c),k!==void 0))return k}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,e){this.matrixAutoUpdate&&
+this.updateMatrix();if(this.matrixWorldNeedsUpdate||c)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,c=!0;for(var b=0,f=this.children.length;b<f;b++)this.children[b].update(this.matrixWorld,c,e)},addChild:function(b){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");this.add(b)},removeChild:function(b){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");
+this.remove(b)}};THREE.Object3DCount=0;
+THREE.Projector=function(){function b(){var b=p[n]=p[n]||new THREE.RenderableVertex;n++;return b}function c(b,e){return e.z-b.z}function e(b,e){var c=0,f=1,h=b.z+b.w,k=e.z+e.w,m=-b.z+b.w,n=-e.z+e.w;return h>=0&&k>=0&&m>=0&&n>=0?!0:h<0&&k<0||m<0&&n<0?!1:(h<0?c=Math.max(c,h/(h-k)):k<0&&(f=Math.min(f,h/(h-k))),m<0?c=Math.max(c,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),f<c?!1:(b.lerpSelf(e,c),e.lerpSelf(b,1-f),!0))}var f,k,m=[],h,n,p=[],t,u,w=[],x,v=[],y,z,C=[],A,F,D=[],J=[],P=[],S=new THREE.Vector4,I=new THREE.Vector4,
+H=new THREE.Matrix4,G=new THREE.Matrix4,Y=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],E=new THREE.Vector4,Q=new THREE.Vector4;this.projectVector=function(b,e){H.multiply(e.projectionMatrix,e.matrixWorldInverse);H.multiplyVector3(b);return b};this.unprojectVector=function(b,e){H.multiply(e.matrixWorld,THREE.Matrix4.makeInvert(e.projectionMatrix));H.multiplyVector3(b);return b};this.projectObjects=function(b,e,h){var o,n;k=J.length=0;
+o=b.objects;b=0;for(e=o.length;b<e;b++){n=o[b];var t;if(!(t=!n.visible))if(t=n instanceof THREE.Mesh)if(t=n.frustumCulled){a:{t=void 0;for(var w=n.matrixWorld,p=-n.geometry.boundingSphere.radius*Math.max(n.scale.x,Math.max(n.scale.y,n.scale.z)),v=0;v<6;v++)if(t=Y[v].x*w.n14+Y[v].y*w.n24+Y[v].z*w.n34+Y[v].w,t<=p){t=!1;break a}t=!0}t=!t}if(!t)t=m[k]=m[k]||new THREE.RenderableObject,k++,f=t,S.copy(n.position),H.multiplyVector3(S),f.object=n,f.z=S.z,J.push(f)}h&&J.sort(c);return J};this.projectScene=
+function(f,k,m){var o=k.near,J=k.far,V,S,aa,ia,ca,ja,fa,da,U,Z,ga,ka,ta,ma,na,qa,ra;F=z=x=u=P.length=0;k.matrixAutoUpdate&&k.update(void 0,!0);f.update(void 0,!1,k);H.multiply(k.projectionMatrix,k.matrixWorldInverse);Y[0].set(H.n41-H.n11,H.n42-H.n12,H.n43-H.n13,H.n44-H.n14);Y[1].set(H.n41+H.n11,H.n42+H.n12,H.n43+H.n13,H.n44+H.n14);Y[2].set(H.n41+H.n21,H.n42+H.n22,H.n43+H.n23,H.n44+H.n24);Y[3].set(H.n41-H.n21,H.n42-H.n22,H.n43-H.n23,H.n44-H.n24);Y[4].set(H.n41-H.n31,H.n42-H.n32,H.n43-H.n33,H.n44-H.n34);
+Y[5].set(H.n41+H.n31,H.n42+H.n32,H.n43+H.n33,H.n44+H.n34);for(V=0;V<6;V++)U=Y[V],U.divideScalar(Math.sqrt(U.x*U.x+U.y*U.y+U.z*U.z));U=this.projectObjects(f,k,!0);f=0;for(V=U.length;f<V;f++)if(Z=U[f].object,Z.visible)if(ga=Z.matrixWorld,ka=Z.matrixRotationWorld,ta=Z.materials,ma=Z.overdraw,n=0,Z instanceof THREE.Mesh){na=Z.geometry;ia=na.vertices;qa=na.faces;na=na.faceVertexUvs;S=0;for(aa=ia.length;S<aa;S++)h=b(),h.positionWorld.copy(ia[S].position),ga.multiplyVector3(h.positionWorld),h.positionScreen.copy(h.positionWorld),
+H.multiplyVector4(h.positionScreen),h.positionScreen.x/=h.positionScreen.w,h.positionScreen.y/=h.positionScreen.w,h.visible=h.positionScreen.z>o&&h.positionScreen.z<J;ia=0;for(S=qa.length;ia<S;ia++){aa=qa[ia];if(aa instanceof THREE.Face3)if(ca=p[aa.a],ja=p[aa.b],fa=p[aa.c],ca.visible&&ja.visible&&fa.visible&&(Z.doubleSided||Z.flipSided!=(fa.positionScreen.x-ca.positionScreen.x)*(ja.positionScreen.y-ca.positionScreen.y)-(fa.positionScreen.y-ca.positionScreen.y)*(ja.positionScreen.x-ca.positionScreen.x)<
+0))da=w[u]=w[u]||new THREE.RenderableFace3,u++,t=da,t.v1.copy(ca),t.v2.copy(ja),t.v3.copy(fa);else continue;else if(aa instanceof THREE.Face4)if(ca=p[aa.a],ja=p[aa.b],fa=p[aa.c],da=p[aa.d],ca.visible&&ja.visible&&fa.visible&&da.visible&&(Z.doubleSided||Z.flipSided!=((da.positionScreen.x-ca.positionScreen.x)*(ja.positionScreen.y-ca.positionScreen.y)-(da.positionScreen.y-ca.positionScreen.y)*(ja.positionScreen.x-ca.positionScreen.x)<0||(ja.positionScreen.x-fa.positionScreen.x)*(da.positionScreen.y-
+fa.positionScreen.y)-(ja.positionScreen.y-fa.positionScreen.y)*(da.positionScreen.x-fa.positionScreen.x)<0)))ra=v[x]=v[x]||new THREE.RenderableFace4,x++,t=ra,t.v1.copy(ca),t.v2.copy(ja),t.v3.copy(fa),t.v4.copy(da);else continue;t.normalWorld.copy(aa.normal);ka.multiplyVector3(t.normalWorld);t.centroidWorld.copy(aa.centroid);ga.multiplyVector3(t.centroidWorld);t.centroidScreen.copy(t.centroidWorld);H.multiplyVector3(t.centroidScreen);fa=aa.vertexNormals;ca=0;for(ja=fa.length;ca<ja;ca++)da=t.vertexNormalsWorld[ca],
+da.copy(fa[ca]),ka.multiplyVector3(da);ca=0;for(ja=na.length;ca<ja;ca++)if(ra=na[ca][ia]){fa=0;for(da=ra.length;fa<da;fa++)t.uvs[ca][fa]=ra[fa]}t.meshMaterials=ta;t.faceMaterials=aa.materials;t.overdraw=ma;t.z=t.centroidScreen.z;P.push(t)}}else if(Z instanceof THREE.Line){G.multiply(H,ga);ia=Z.geometry.vertices;ca=b();ca.positionScreen.copy(ia[0].position);G.multiplyVector4(ca.positionScreen);S=1;for(aa=ia.length;S<aa;S++)if(ca=b(),ca.positionScreen.copy(ia[S].position),G.multiplyVector4(ca.positionScreen),
+ja=p[n-2],E.copy(ca.positionScreen),Q.copy(ja.positionScreen),e(E,Q))E.multiplyScalar(1/E.w),Q.multiplyScalar(1/Q.w),ga=C[z]=C[z]||new THREE.RenderableLine,z++,y=ga,y.v1.positionScreen.copy(E),y.v2.positionScreen.copy(Q),y.z=Math.max(E.z,Q.z),y.materials=Z.materials,P.push(y)}else if(Z instanceof THREE.Particle&&(I.set(Z.matrixWorld.n14,Z.matrixWorld.n24,Z.matrixWorld.n34,1),H.multiplyVector4(I),I.z/=I.w,I.z>0&&I.z<1))ga=D[F]=D[F]||new THREE.RenderableParticle,F++,A=ga,A.x=I.x/I.w,A.y=I.y/I.w,A.z=
+I.z,A.rotation=Z.rotation.z,A.scale.x=Z.scale.x*Math.abs(A.x-(I.x+k.projectionMatrix.n11)/(I.w+k.projectionMatrix.n14)),A.scale.y=Z.scale.y*Math.abs(A.y-(I.y+k.projectionMatrix.n22)/(I.w+k.projectionMatrix.n24)),A.materials=Z.materials,P.push(A);m&&P.sort(c);return P}};THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)};
+THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,e=b.x*c,f=b.y*c,k=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-k),k=Math.sin(-k),m=Math.cos(e),e=Math.sin(e),h=b*c,n=f*k;this.w=h*m-n*e;this.x=h*e+n*m;this.y=f*c*m+b*k*e;this.z=b*k*m-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e);
 this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c=
-this.x,e=this.y,f=this.z,h=this.w,m=b.x,k=b.y,n=b.z,b=b.w;this.x=c*b+h*m+e*n-f*k;this.y=e*b+h*k+f*m-c*n;this.z=f*b+h*n+c*k-e*m;this.w=h*b-c*m-e*k-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,h=b.z,m=this.x,k=this.y,n=this.z,u=this.w,p=u*e+k*h-n*f,v=u*f+n*e-m*h,t=u*h+m*f-k*e,e=-m*
-e-k*f-n*h;c.x=p*u+e*-m+v*-n-t*-k;c.y=v*u+e*-k+t*-m-p*-n;c.z=t*u+e*-n+p*-k-v*-m;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var m=Math.acos(h),k=Math.sqrt(1-h*h);if(Math.abs(k)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-f)*m)/k;f=Math.sin(f*m)/k;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e};
-THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,h,m){this.a=b;this.b=c;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=m instanceof Array?m:[m];this.centroid=new THREE.Vector3};
-THREE.Face4=function(b,c,e,f,h,m,k){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=m instanceof THREE.Color?m:new THREE.Color;this.vertexColors=m instanceof Array?m:[];this.vertexTangents=[];this.materials=k instanceof Array?k:[k];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0};
+this.x,e=this.y,f=this.z,k=this.w,m=b.x,h=b.y,n=b.z,b=b.w;this.x=c*b+k*m+e*n-f*h;this.y=e*b+k*h+f*m-c*n;this.z=f*b+k*n+c*h-e*m;this.w=k*b-c*m-e*h-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,k=b.z,m=this.x,h=this.y,n=this.z,p=this.w,t=p*e+h*k-n*f,u=p*f+n*e-m*k,w=p*k+m*f-h*e,e=-m*
+e-h*f-n*k;c.x=t*p+e*-m+u*-n-w*-h;c.y=u*p+e*-h+w*-m-t*-n;c.z=w*p+e*-n+t*-h-u*-m;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var k=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(k)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var m=Math.acos(k),h=Math.sqrt(1-k*k);if(Math.abs(h)<0.001)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;k=Math.sin((1-f)*m)/h;f=Math.sin(f*m)/h;e.w=b.w*k+c.w*f;e.x=b.x*k+c.x*f;e.y=b.y*k+c.y*f;e.z=b.z*k+c.z*f;return e};
+THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,k,m){this.a=b;this.b=c;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=k instanceof THREE.Color?k:new THREE.Color;this.vertexColors=k instanceof Array?k:[];this.vertexTangents=[];this.materials=m instanceof Array?m:[m];this.centroid=new THREE.Vector3};
+THREE.Face4=function(b,c,e,f,k,m,h){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=k instanceof THREE.Vector3?k:new THREE.Vector3;this.vertexNormals=k instanceof Array?k:[];this.color=m instanceof THREE.Color?m:new THREE.Color;this.vertexColors=m instanceof Array?m:[];this.vertexTangents=[];this.materials=h instanceof Array?h:[h];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0};
 THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
 THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
-THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var e=0,f=this.vertices.length;e<f;e++)b.multiplyVector3(this.vertices[e].position);e=0;for(f=this.faces.length;e<f;e++){var h=this.faces[e];c.multiplyVector3(h.normal);for(var m=0,k=h.vertexNormals.length;m<k;m++)c.multiplyVector3(h.vertexNormals[m]);b.multiplyVector3(h.centroid)}},computeCentroids:function(){var b,c,e;b=0;for(c=this.faces.length;b<
+THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var e=0,f=this.vertices.length;e<f;e++)b.multiplyVector3(this.vertices[e].position);e=0;for(f=this.faces.length;e<f;e++){var k=this.faces[e];c.multiplyVector3(k.normal);for(var m=0,h=k.vertexNormals.length;m<h;m++)c.multiplyVector3(k.vertexNormals[m]);b.multiplyVector3(k.centroid)}},computeCentroids:function(){var b,c,e;b=0;for(c=this.faces.length;b<
 c;b++)e=this.faces[b],e.centroid.set(0,0,0),e instanceof THREE.Face3?(e.centroid.addSelf(this.vertices[e.a].position),e.centroid.addSelf(this.vertices[e.b].position),e.centroid.addSelf(this.vertices[e.c].position),e.centroid.divideScalar(3)):e instanceof THREE.Face4&&(e.centroid.addSelf(this.vertices[e.a].position),e.centroid.addSelf(this.vertices[e.b].position),e.centroid.addSelf(this.vertices[e.c].position),e.centroid.addSelf(this.vertices[e.d].position),e.centroid.divideScalar(4))},computeFaceNormals:function(b){var c,
-e,f,h,m,k,n=new THREE.Vector3,u=new THREE.Vector3;f=0;for(h=this.faces.length;f<h;f++){m=this.faces[f];if(b&&m.vertexNormals.length){n.set(0,0,0);c=0;for(e=m.vertexNormals.length;c<e;c++)n.addSelf(m.vertexNormals[c]);n.divideScalar(3)}else c=this.vertices[m.a],e=this.vertices[m.b],k=this.vertices[m.c],n.sub(k.position,e.position),u.sub(c.position,e.position),n.crossSelf(u);n.isZero()||n.normalize();m.normal.copy(n)}},computeVertexNormals:function(){var b,c,e,f;if(this.__tmpVertices==void 0){f=this.__tmpVertices=
+e,f,k,m,h,n=new THREE.Vector3,p=new THREE.Vector3;f=0;for(k=this.faces.length;f<k;f++){m=this.faces[f];if(b&&m.vertexNormals.length){n.set(0,0,0);c=0;for(e=m.vertexNormals.length;c<e;c++)n.addSelf(m.vertexNormals[c]);n.divideScalar(3)}else c=this.vertices[m.a],e=this.vertices[m.b],h=this.vertices[m.c],n.sub(h.position,e.position),p.sub(c.position,e.position),n.crossSelf(p);n.isZero()||n.normalize();m.normal.copy(n)}},computeVertexNormals:function(){var b,c,e,f;if(this.__tmpVertices==void 0){f=this.__tmpVertices=
 Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)f[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)if(e=this.faces[b],e instanceof THREE.Face3)e.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(e instanceof THREE.Face4)e.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{f=this.__tmpVertices;b=0;for(c=this.vertices.length;b<c;b++)f[b].set(0,0,0)}b=0;for(c=this.faces.length;b<c;b++)e=this.faces[b],e instanceof
 THREE.Face3?(f[e.a].addSelf(e.normal),f[e.b].addSelf(e.normal),f[e.c].addSelf(e.normal)):e instanceof THREE.Face4&&(f[e.a].addSelf(e.normal),f[e.b].addSelf(e.normal),f[e.c].addSelf(e.normal),f[e.d].addSelf(e.normal));b=0;for(c=this.vertices.length;b<c;b++)f[b].normalize();b=0;for(c=this.faces.length;b<c;b++)e=this.faces[b],e instanceof THREE.Face3?(e.vertexNormals[0].copy(f[e.a]),e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c])):e instanceof THREE.Face4&&(e.vertexNormals[0].copy(f[e.a]),
-e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c]),e.vertexNormals[3].copy(f[e.d]))},computeTangents:function(){function b(b,e,c,f,h,m,o){n=b.vertices[e].position;u=b.vertices[c].position;p=b.vertices[f].position;v=k[h];t=k[m];x=k[o];w=u.x-n.x;y=p.x-n.x;z=u.y-n.y;C=p.y-n.y;A=u.z-n.z;F=p.z-n.z;D=t.u-v.u;J=x.u-v.u;P=t.v-v.v;S=x.v-v.v;I=1/(D*S-J*P);E.set((S*w-P*y)*I,(S*z-P*C)*I,(S*A-P*F)*I);Q.set((D*y-J*w)*I,(D*C-J*z)*I,(D*F-J*A)*I);G[e].addSelf(E);G[c].addSelf(E);G[f].addSelf(E);Y[e].addSelf(Q);
-Y[c].addSelf(Q);Y[f].addSelf(Q)}var c,e,f,h,m,k,n,u,p,v,t,x,w,y,z,C,A,F,D,J,P,S,I,H,G=[],Y=[],E=new THREE.Vector3,Q=new THREE.Vector3,R=new THREE.Vector3,W=new THREE.Vector3,X=new THREE.Vector3;c=0;for(e=this.vertices.length;c<e;c++)G[c]=new THREE.Vector3,Y[c]=new THREE.Vector3;c=0;for(e=this.faces.length;c<e;c++)m=this.faces[c],k=this.faceVertexUvs[0][c],m instanceof THREE.Face3?b(this,m.a,m.b,m.c,0,1,2):m instanceof THREE.Face4&&(b(this,m.a,m.b,m.c,0,1,2),b(this,m.a,m.b,m.d,0,1,3));var o=["a","b",
-"c","d"];c=0;for(e=this.faces.length;c<e;c++){m=this.faces[c];for(f=0;f<m.vertexNormals.length;f++)X.copy(m.vertexNormals[f]),h=m[o[f]],H=G[h],R.copy(H),R.subSelf(X.multiplyScalar(X.dot(H))).normalize(),W.cross(m.vertexNormals[f],H),h=W.dot(Y[h]),h=h<0?-1:1,m.vertexTangents[f]=new THREE.Vector4(R.x,R.y,R.z,h)}this.hasTangents=!0},computeBoundingBox:function(){var b;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,
+e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c]),e.vertexNormals[3].copy(f[e.d]))},computeTangents:function(){function b(b,e,c,f,k,m,o){n=b.vertices[e].position;p=b.vertices[c].position;t=b.vertices[f].position;u=h[k];w=h[m];x=h[o];v=p.x-n.x;y=t.x-n.x;z=p.y-n.y;C=t.y-n.y;A=p.z-n.z;F=t.z-n.z;D=w.u-u.u;J=x.u-u.u;P=w.v-u.v;S=x.v-u.v;I=1/(D*S-J*P);E.set((S*v-P*y)*I,(S*z-P*C)*I,(S*A-P*F)*I);Q.set((D*y-J*v)*I,(D*C-J*z)*I,(D*F-J*A)*I);G[e].addSelf(E);G[c].addSelf(E);G[f].addSelf(E);Y[e].addSelf(Q);
+Y[c].addSelf(Q);Y[f].addSelf(Q)}var c,e,f,k,m,h,n,p,t,u,w,x,v,y,z,C,A,F,D,J,P,S,I,H,G=[],Y=[],E=new THREE.Vector3,Q=new THREE.Vector3,R=new THREE.Vector3,W=new THREE.Vector3,X=new THREE.Vector3;c=0;for(e=this.vertices.length;c<e;c++)G[c]=new THREE.Vector3,Y[c]=new THREE.Vector3;c=0;for(e=this.faces.length;c<e;c++)m=this.faces[c],h=this.faceVertexUvs[0][c],m instanceof THREE.Face3?b(this,m.a,m.b,m.c,0,1,2):m instanceof THREE.Face4&&(b(this,m.a,m.b,m.c,0,1,2),b(this,m.a,m.b,m.d,0,1,3));var o=["a","b",
+"c","d"];c=0;for(e=this.faces.length;c<e;c++){m=this.faces[c];for(f=0;f<m.vertexNormals.length;f++)X.copy(m.vertexNormals[f]),k=m[o[f]],H=G[k],R.copy(H),R.subSelf(X.multiplyScalar(X.dot(H))).normalize(),W.cross(m.vertexNormals[f],H),k=W.dot(Y[k]),k=k<0?-1:1,m.vertexTangents[f]=new THREE.Vector4(R.x,R.y,R.z,k)}this.hasTangents=!0},computeBoundingBox:function(){var b;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,
 this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;c<e;c++){b=this.vertices[c];if(b.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=b.position.x;else if(b.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=b.position.y;else if(b.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=
-b.position.z;else if(b.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;c<e;c++)b=Math.max(b,this.vertices[c].position.length());this.boundingSphere={radius:b}},computeEdgeFaces:function(){function b(b,e){return Math.min(b,e)+"_"+Math.max(b,e)}function c(b,e,c){b[e]===void 0?(b[e]={set:{},array:[]},b[e].set[c]=1,b[e].array.push(c)):b[e].set[c]===void 0&&(b[e].set[c]=1,b[e].array.push(c))}var e,f,h,m,k,n=
-{};e=0;for(f=this.faces.length;e<f;e++)k=this.faces[e],k instanceof THREE.Face3?(h=b(k.a,k.b),c(n,h,e),h=b(k.b,k.c),c(n,h,e),h=b(k.a,k.c),c(n,h,e)):k instanceof THREE.Face4&&(h=b(k.b,k.d),c(n,h,e),h=b(k.a,k.b),c(n,h,e),h=b(k.a,k.d),c(n,h,e),h=b(k.b,k.c),c(n,h,e),h=b(k.c,k.d),c(n,h,e));e=0;for(f=this.edges.length;e<f;e++){k=this.edges[e];h=k.vertexIndices[0];m=k.vertexIndices[1];k.faceIndices=n[b(h,m)].array;for(h=0;h<k.faceIndices.length;h++)m=k.faceIndices[h],k.faces.push(this.faces[m])}}};
+b.position.z;else if(b.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;c<e;c++)b=Math.max(b,this.vertices[c].position.length());this.boundingSphere={radius:b}},computeEdgeFaces:function(){function b(b,e){return Math.min(b,e)+"_"+Math.max(b,e)}function c(b,e,c){b[e]===void 0?(b[e]={set:{},array:[]},b[e].set[c]=1,b[e].array.push(c)):b[e].set[c]===void 0&&(b[e].set[c]=1,b[e].array.push(c))}var e,f,k,m,h,n=
+{};e=0;for(f=this.faces.length;e<f;e++)h=this.faces[e],h instanceof THREE.Face3?(k=b(h.a,h.b),c(n,k,e),k=b(h.b,h.c),c(n,k,e),k=b(h.a,h.c),c(n,k,e)):h instanceof THREE.Face4&&(k=b(h.b,h.d),c(n,k,e),k=b(h.a,h.b),c(n,k,e),k=b(h.a,h.d),c(n,k,e),k=b(h.b,h.c),c(n,k,e),k=b(h.c,h.d),c(n,k,e));e=0;for(f=this.edges.length;e<f;e++){h=this.edges[e];k=h.vertexIndices[0];m=h.vertexIndices[1];h.faceIndices=n[b(k,m)].array;for(k=0;k<h.faceIndices.length;k++)m=h.faceIndices[k],h.faces.push(this.faces[m])}}};
 THREE.GeometryCount=0;
-THREE.Spline=function(b){function c(b,e,c,f,k,h,m){b=(c-b)*0.5;f=(f-e)*0.5;return(2*(e-c)+b+f)*m+(-3*(e-c)-2*b-f)*h+b*k+e}this.points=b;var e=[],f={x:0,y:0,z:0},h,m,k,n,u,p,v,t,x;this.initFromArray=function(b){this.points=[];for(var e=0;e<b.length;e++)this.points[e]={x:b[e][0],y:b[e][1],z:b[e][2]}};this.getPoint=function(b){h=(this.points.length-1)*b;m=Math.floor(h);k=h-m;e[0]=m==0?m:m-1;e[1]=m;e[2]=m>this.points.length-2?m:m+1;e[3]=m>this.points.length-3?m:m+2;p=this.points[e[0]];v=this.points[e[1]];
-t=this.points[e[2]];x=this.points[e[3]];n=k*k;u=k*n;f.x=c(p.x,v.x,t.x,x.x,k,n,u);f.y=c(p.y,v.y,t.y,x.y,k,n,u);f.z=c(p.z,v.z,t.z,x.z,k,n,u);return f};this.getControlPointsArray=function(){var b,e,c=this.points.length,f=[];for(b=0;b<c;b++)e=this.points[b],f[b]=[e.x,e.y,e.z];return f};this.getLength=function(b){var e,c,f=e=e=0,k=new THREE.Vector3,h=new THREE.Vector3,m=[],n=0;m[0]=0;b||(b=100);c=this.points.length*b;k.copy(this.points[0]);for(b=1;b<c;b++)e=b/c,position=this.getPoint(e),h.copy(position),
-n+=h.distanceTo(k),k.copy(position),e*=this.points.length-1,e=Math.floor(e),e!=f&&(m[e]=n,f=e);m[m.length]=n;return{chunks:m,total:n}};this.reparametrizeByArcLength=function(b){var e,c,f,k,h,m,n=[],t=new THREE.Vector3,u=this.getLength();n.push(t.copy(this.points[0]).clone());for(e=1;e<this.points.length;e++){c=u.chunks[e]-u.chunks[e-1];m=Math.ceil(b*c/u.total);k=(e-1)/(this.points.length-1);h=e/(this.points.length-1);for(c=1;c<m-1;c++)f=k+c*(1/m)*(h-k),position=this.getPoint(f),n.push(t.copy(position).clone());
-n.push(t.copy(this.points[e]).clone())}this.points=n}};THREE.Edge=function(b,c,e,f){this.vertices=[b,c];this.vertexIndices=[e,f];this.faces=[];this.faceIndices=[]};THREE.Camera=function(b,c,e,f,h){THREE.Object3D.call(this);this.fov=b||50;this.aspect=c||1;this.near=e!==void 0?e:0.1;this.far=f!==void 0?f:2E3;this.target=h||new THREE.Object3D;this.useTarget=!1;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;
-THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);c.multiplyScalar(b);this.position.addSelf(c);this.target.position.addSelf(c)};
-THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var b=this.fullWidth/this.fullHeight,c=Math.tan(this.fov*Math.PI/360)*this.near,e=-c,f=b*e,b=Math.abs(b*c-f),e=Math.abs(c-e);this.projectionMatrix=THREE.Matrix4.makeFrustum(f+this.x*b/this.fullWidth,f+(this.x+this.width)*b/this.fullWidth,c-(this.y+this.height)*e/this.fullHeight,c-this.y*e/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
-THREE.Camera.prototype.setViewOffset=function(b,c,e,f,h,m){this.fullWidth=b;this.fullHeight=c;this.x=e;this.y=f;this.width=h;this.height=m;this.updateProjectionMatrix()};
-THREE.Camera.prototype.update=function(b,c,e){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),c=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
-!1,c=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,e)};THREE.OrthoCamera=function(b,c,e,f,h,m,k){THREE.Camera.call(this,45,1,h,m,k);this.left=b;this.right=c;this.top=e;this.bottom=f;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
-THREE.OrthoCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;
+THREE.Spline=function(b){function c(b,e,c,f,h,k,m){b=(c-b)*0.5;f=(f-e)*0.5;return(2*(e-c)+b+f)*m+(-3*(e-c)-2*b-f)*k+b*h+e}this.points=b;var e=[],f={x:0,y:0,z:0},k,m,h,n,p,t,u,w,x;this.initFromArray=function(b){this.points=[];for(var e=0;e<b.length;e++)this.points[e]={x:b[e][0],y:b[e][1],z:b[e][2]}};this.getPoint=function(b){k=(this.points.length-1)*b;m=Math.floor(k);h=k-m;e[0]=m==0?m:m-1;e[1]=m;e[2]=m>this.points.length-2?m:m+1;e[3]=m>this.points.length-3?m:m+2;t=this.points[e[0]];u=this.points[e[1]];
+w=this.points[e[2]];x=this.points[e[3]];n=h*h;p=h*n;f.x=c(t.x,u.x,w.x,x.x,h,n,p);f.y=c(t.y,u.y,w.y,x.y,h,n,p);f.z=c(t.z,u.z,w.z,x.z,h,n,p);return f};this.getControlPointsArray=function(){var b,e,c=this.points.length,f=[];for(b=0;b<c;b++)e=this.points[b],f[b]=[e.x,e.y,e.z];return f};this.getLength=function(b){var e,c,f=e=e=0,h=new THREE.Vector3,k=new THREE.Vector3,m=[],n=0;m[0]=0;b||(b=100);c=this.points.length*b;h.copy(this.points[0]);for(b=1;b<c;b++)e=b/c,position=this.getPoint(e),k.copy(position),
+n+=k.distanceTo(h),h.copy(position),e*=this.points.length-1,e=Math.floor(e),e!=f&&(m[e]=n,f=e);m[m.length]=n;return{chunks:m,total:n}};this.reparametrizeByArcLength=function(b){var e,c,f,h,k,m,n=[],t=new THREE.Vector3,w=this.getLength();n.push(t.copy(this.points[0]).clone());for(e=1;e<this.points.length;e++){c=w.chunks[e]-w.chunks[e-1];m=Math.ceil(b*c/w.total);h=(e-1)/(this.points.length-1);k=e/(this.points.length-1);for(c=1;c<m-1;c++)f=h+c*(1/m)*(k-h),position=this.getPoint(f),n.push(t.copy(position).clone());
+n.push(t.copy(this.points[e]).clone())}this.points=n}};THREE.Edge=function(b,c,e,f){this.vertices=[b,c];this.vertexIndices=[e,f];this.faces=[];this.faceIndices=[]};THREE.Camera=function(){THREE.Object3D.call(this);arguments.length&&console.warn("DEPRECATED: Camera() is now PerspectiveCamera().");this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;
+THREE.Camera.prototype.lookAt=function(b){this.matrix.lookAt(this.position,b,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};
+THREE.Camera.prototype.update=function(b,c,e){this.matrixAutoUpdate&&this.updateMatrix();if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,e)};
+THREE.OrthographicCamera=function(b,c,e,f,k,m){THREE.Camera.call(this);this.left=b;this.right=c;this.top=e;this.bottom=f;this.near=k!==void 0?k:0.1;this.far=m!==void 0?m:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};
+THREE.PerspectiveCamera=function(b,c,e,f){THREE.Camera.call(this);this.fov=b||50;this.aspect=c||1;this.near=e!==void 0?e:0.1;this.far=f!==void 0?f:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;
+THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var b=this.fullWidth/this.fullHeight,c=Math.tan(this.fov*Math.PI/360)*this.near,e=-c,f=b*e,b=Math.abs(b*c-f),e=Math.abs(c-e);this.projectionMatrix=THREE.Matrix4.makeFrustum(f+this.x*b/this.fullWidth,f+(this.x+this.width)*b/this.fullWidth,c-(this.y+this.height)*e/this.fullHeight,c-this.y*e/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,
+this.far)};THREE.PerspectiveCamera.prototype.setViewOffset=function(b,c,e,f,k,m){this.fullWidth=b;this.fullHeight=c;this.x=e;this.y=f;this.width=k;this.height=m;this.updateProjectionMatrix()};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(b,c,e){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.intensity=c!==void 0?c:1;this.distance=e!==void 0?e:0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(b,c,e){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,0,0);this.intensity=c!==void 0?c:1;this.distance=e!==void 0?e:0};
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.SpotLight=function(b,c,e,f){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=c!==void 0?c:1;this.distance=e!==void 0?e:0;this.castShadow=f!==void 0?f:!1};THREE.SpotLight.prototype=new THREE.Light;THREE.SpotLight.prototype.constructor=THREE.SpotLight;
 THREE.Material=function(b){this.name="";this.id=THREE.MaterialCount++;b=b||{};this.opacity=b.opacity!==void 0?b.opacity:1;this.transparent=b.transparent!==void 0?b.transparent:!1;this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.depthTest=b.depthTest!==void 0?b.depthTest:!0;this.depthWrite=b.depthWrite!==void 0?b.depthWrite:!0;this.polygonOffset=b.polygonOffset!==void 0?b.polygonOffset:!1;this.polygonOffsetFactor=b.polygonOffsetFactor!==void 0?b.polygonOffsetFactor:0;this.polygonOffsetUnits=
@@ -117,24 +117,24 @@ THREE.ParticleBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this
 THREE.ParticleCanvasMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.program=b.program!==void 0?b.program:function(){}};THREE.ParticleCanvasMaterial.prototype=new THREE.Material;THREE.ParticleCanvasMaterial.prototype.constructor=THREE.ParticleCanvasMaterial;THREE.ParticleDOMMaterial=function(b){THREE.Material.call(this);this.domElement=b};
 THREE.ShaderMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.fragmentShader=b.fragmentShader!==void 0?b.fragmentShader:"void main() {}";this.vertexShader=b.vertexShader!==void 0?b.vertexShader:"void main() {}";this.uniforms=b.uniforms!==void 0?b.uniforms:{};this.attributes=b.attributes;this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.fog=b.fog!==
 void 0?b.fog:!1;this.lights=b.lights!==void 0?b.lights:!1;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};THREE.ShaderMaterial.prototype=new THREE.Material;THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial;
-THREE.Texture=function(b,c,e,f,h,m){this.id=THREE.TextureCount++;this.image=b;this.mapping=c!==void 0?c:new THREE.UVMapping;this.wrapS=e!==void 0?e:THREE.ClampToEdgeWrapping;this.wrapT=f!==void 0?f:THREE.ClampToEdgeWrapping;this.magFilter=h!==void 0?h:THREE.LinearFilter;this.minFilter=m!==void 0?m:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
+THREE.Texture=function(b,c,e,f,k,m){this.id=THREE.TextureCount++;this.image=b;this.mapping=c!==void 0?c:new THREE.UVMapping;this.wrapS=e!==void 0?e:THREE.ClampToEdgeWrapping;this.wrapT=f!==void 0?f:THREE.ClampToEdgeWrapping;this.magFilter=k!==void 0?k:THREE.LinearFilter;this.minFilter=m!==void 0?m:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
 THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var b=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
 THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;
-THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(b,c,e,f,h,m,k,n,u){THREE.Texture.call(this,null,h,m,k,n,u);this.image={data:b,width:c,height:e};this.format=f!==void 0?f:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
+THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(b,c,e,f,k,m,h,n,p){THREE.Texture.call(this,null,k,m,h,n,p);this.image={data:b,width:c,height:e};this.format=f!==void 0?f:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
 THREE.DataTexture.prototype.clone=function(){var b=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b};THREE.Particle=function(b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
 THREE.ParticleSystem=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(b,c,e){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.type=e!=void 0?e:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;
 THREE.Line.prototype.constructor=THREE.Line;
 THREE.Mesh=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c&&c.length?c:[c];this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=b.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var e=0;e<this.geometry.morphTargets.length;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[e].name]=
 e}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(b){if(this.morphTargetDictionary[b]!==void 0)return this.morphTargetDictionary[b];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+b+" does not exist. Returning 0.");return 0};
 THREE.Bone=function(b){THREE.Object3D.call(this);this.skin=b;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
-THREE.Bone.prototype.update=function(b,c,e){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.skinMatrix.multiply(b,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,h=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(f=0;f<h;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.skinMatrix,c,e):b.update(this.matrixWorld,!0,e)}else for(f=0;f<h;f++)this.children[f].update(this.skinMatrix,
+THREE.Bone.prototype.update=function(b,c,e){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.skinMatrix.multiply(b,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,k=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(f=0;f<k;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.skinMatrix,c,e):b.update(this.matrixWorld,!0,e)}else for(f=0;f<k;f++)this.children[f].update(this.skinMatrix,
 c,e)};THREE.Bone.prototype.addChild=function(b){if(this.children.indexOf(b)===-1&&(b.parent!==void 0&&b.parent.removeChild(b),b.parent=this,this.children.push(b),!(b instanceof THREE.Bone)))this.hasNoneBoneChildren=!0};
-THREE.SkinnedMesh=function(b,c){THREE.Mesh.call(this,b,c);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var e,f,h,m,k,n;if(this.geometry.bones!==void 0){for(e=0;e<this.geometry.bones.length;e++)h=this.geometry.bones[e],m=h.pos,k=h.rotq,n=h.scl,f=this.addBone(),f.name=h.name,f.position.set(m[0],m[1],m[2]),f.quaternion.set(k[0],k[1],k[2],k[3]),f.useQuaternion=!0,n!==void 0?f.scale.set(n[0],n[1],n[2]):f.scale.set(1,1,1);for(e=0;e<this.bones.length;e++)h=this.geometry.bones[e],
-f=this.bones[e],h.parent===-1?this.addChild(f):this.bones[h.parent].addChild(f);this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;
-THREE.SkinnedMesh.prototype.update=function(b,c,e){if(this.visible){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,h=this.children.length;for(f=0;f<h;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.identityMatrix,!1,e):b.update(this.matrixWorld,c,e);e=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(c=0;c<e;c++)ba[c].skinMatrix.flattenToArrayOffset(bm,
+THREE.SkinnedMesh=function(b,c){THREE.Mesh.call(this,b,c);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var e,f,k,m,h,n;if(this.geometry.bones!==void 0){for(e=0;e<this.geometry.bones.length;e++)k=this.geometry.bones[e],m=k.pos,h=k.rotq,n=k.scl,f=this.addBone(),f.name=k.name,f.position.set(m[0],m[1],m[2]),f.quaternion.set(h[0],h[1],h[2],h[3]),f.useQuaternion=!0,n!==void 0?f.scale.set(n[0],n[1],n[2]):f.scale.set(1,1,1);for(e=0;e<this.bones.length;e++)k=this.geometry.bones[e],
+f=this.bones[e],k.parent===-1?this.addChild(f):this.bones[k.parent].addChild(f);this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;
+THREE.SkinnedMesh.prototype.update=function(b,c,e){if(this.visible){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,k=this.children.length;for(f=0;f<k;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.identityMatrix,!1,e):b.update(this.matrixWorld,c,e);e=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(c=0;c<e;c++)ba[c].skinMatrix.flattenToArrayOffset(bm,
 c*16)}};THREE.SkinnedMesh.prototype.addBone=function(b){b===void 0&&(b=new THREE.Bone(this));this.bones.push(b);return b};
-THREE.SkinnedMesh.prototype.pose=function(){this.update(void 0,!0);for(var b,c=[],e=0;e<this.bones.length;e++)b=this.bones[e],c.push(THREE.Matrix4.makeInvert(b.skinMatrix)),b.skinMatrix.flattenToArrayOffset(this.boneMatrices,e*16);if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var f;for(b=0;b<this.geometry.skinIndices.length;b++){var e=this.geometry.vertices[b].position,h=this.geometry.skinIndices[b].x,m=this.geometry.skinIndices[b].y;f=new THREE.Vector3(e.x,
-e.y,e.z);this.geometry.skinVerticesA.push(c[h].multiplyVector3(f));f=new THREE.Vector3(e.x,e.y,e.z);this.geometry.skinVerticesB.push(c[m].multiplyVector3(f));this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y!==1&&(e=(1-(this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y))*0.5,this.geometry.skinWeights[b].x+=e,this.geometry.skinWeights[b].y+=e)}}};THREE.Ribbon=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c]};
+THREE.SkinnedMesh.prototype.pose=function(){this.update(void 0,!0);for(var b,c=[],e=0;e<this.bones.length;e++)b=this.bones[e],c.push(THREE.Matrix4.makeInvert(b.skinMatrix)),b.skinMatrix.flattenToArrayOffset(this.boneMatrices,e*16);if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var f;for(b=0;b<this.geometry.skinIndices.length;b++){var e=this.geometry.vertices[b].position,k=this.geometry.skinIndices[b].x,m=this.geometry.skinIndices[b].y;f=new THREE.Vector3(e.x,
+e.y,e.z);this.geometry.skinVerticesA.push(c[k].multiplyVector3(f));f=new THREE.Vector3(e.x,e.y,e.z);this.geometry.skinVerticesB.push(c[m].multiplyVector3(f));this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y!==1&&(e=(1-(this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y))*0.5,this.geometry.skinWeights[b].x+=e,this.geometry.skinWeights[b].y+=e)}}};THREE.Ribbon=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c]};
 THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(b,c){c===void 0&&(c=0);for(var c=Math.abs(c),e=0;e<this.LODs.length;e++)if(c<this.LODs[e].visibleAtDistance)break;this.LODs.splice(e,0,{visibleAtDistance:c,object3D:b});this.add(b)};
 THREE.LOD.prototype.update=function(b,c,e){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;if(this.LODs.length>1){b=e.matrixWorldInverse;b=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(var f=1;f<this.LODs.length;f++)if(b>=this.LODs[f].visibleAtDistance)this.LODs[f-1].object3D.visible=!1,
 this.LODs[f].object3D.visible=!0;else break;for(;f<this.LODs.length;f++)this.LODs[f].object3D.visible=!1}for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,e)};
@@ -147,49 +147,49 @@ THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)th
 THREE.Scene.prototype.removeChildRecurse=function(b){if(b instanceof THREE.Light){var c=this.lights.indexOf(b);c!==-1&&this.lights.splice(c,1)}else b instanceof THREE.Camera||(c=this.objects.indexOf(b),c!==-1&&(this.objects.splice(c,1),this.__objectsRemoved.push(b),c=this.__objectsAdded.indexOf(b),c!==-1&&this.__objectsAdded.splice(c,1)));for(c=0;c<b.children.length;c++)this.removeChildRecurse(b.children[c])};
 THREE.Scene.prototype.addChild=function(b){console.warn("DEPRECATED: Scene.addChild() is now Scene.add().");this.add(b)};THREE.Scene.prototype.addObject=function(b){console.warn("DEPRECATED: Scene.addObject() is now Scene.add().");this.add(b)};THREE.Scene.prototype.addLight=function(b){console.warn("DEPRECATED: Scene.addLight() is now Scene.add().");this.add(b)};THREE.Scene.prototype.removeChild=function(b){console.warn("DEPRECATED: Scene.removeChild() is now Scene.remove().");this.remove(b)};
 THREE.Scene.prototype.removeObject=function(b){console.warn("DEPRECATED: Scene.removeObject() is now Scene.remove().");this.remove(b)};THREE.Scene.prototype.removeLight=function(b){console.warn("DEPRECATED: Scene.removeLight() is now Scene.remove().");this.remove(b)};THREE.Fog=function(b,c,e){this.color=new THREE.Color(b);this.near=c!==void 0?c:1;this.far=e!==void 0?e:1E3};THREE.FogExp2=function(b,c){this.color=new THREE.Color(b);this.density=c!==void 0?c:2.5E-4};
-THREE.DOMRenderer=function(){THREE.Renderer.call(this);var b=null,c=new THREE.Projector,e,f,h,m;this.domElement=document.createElement("div");this.setSize=function(b,c){e=b;f=c;h=e/2;m=f/2};this.render=function(e,f){var u,p,v,t,x,w,y,z;b=c.projectScene(e,f);u=0;for(p=b.length;u<p;u++)if(x=b[u],x instanceof THREE.RenderableParticle){y=x.x*h+h;z=x.y*m+m;v=0;for(t=x.material.length;v<t;v++)if(w=x.material[v],w instanceof THREE.ParticleDOMMaterial)w=w.domElement,w.style.left=y+"px",w.style.top=z+"px"}}};
-THREE.CanvasRenderer=function(b){function c(b){if(C!=b)w.globalAlpha=C=b}function e(b){if(A!=b){switch(b){case THREE.NormalBlending:w.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:w.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:w.globalCompositeOperation="darker"}A=b}}function f(b){if(F!=b)w.strokeStyle=F=b}function h(b){if(D!=b)w.fillStyle=D=b}var m=this,k=null,n=new THREE.Projector,b=b||{},u=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
-p,v,t,x,w=u.getContext("2d"),y=new THREE.Color(0),z=0,C=1,A=0,F=null,D=null,J=null,P=null,S=null,I,H,G,Y,E=new THREE.RenderableVertex,Q=new THREE.RenderableVertex,R,W,X,o,ea,V,la,aa,ia,ca,ja,fa,da=new THREE.Color(0),U=new THREE.Color(0),Z=new THREE.Color(0),ga=new THREE.Color(0),ka=new THREE.Color(0),ta=[],ma,na,qa,ra,ua,Ca,Ea,za,Ba,Ga,N=new THREE.Rectangle,O=new THREE.Rectangle,M=new THREE.Rectangle,L=!1,ha=new THREE.Color,oa=new THREE.Color,xa=new THREE.Color,va=new THREE.Color,pa=new THREE.Vector3,
-wa,Da,Ka,Aa,Ha,$,b=16;wa=document.createElement("canvas");wa.width=wa.height=2;Da=wa.getContext("2d");Da.fillStyle="rgba(0,0,0,1)";Da.fillRect(0,0,2,2);Ka=Da.getImageData(0,0,2,2);Aa=Ka.data;Ha=document.createElement("canvas");Ha.width=Ha.height=b;$=Ha.getContext("2d");$.translate(-b/2,-b/2);$.scale(b,b);b--;this.domElement=u;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setSize=function(b,e){p=b;v=e;t=Math.floor(p/2);x=Math.floor(v/2);u.width=p;
-u.height=v;N.set(-t,-x,t,x);O.set(-t,-x,t,x);C=1;A=0;S=P=J=D=F=null};this.setClearColor=function(b,e){y.copy(b);z=e;O.set(-t,-x,t,x)};this.setClearColorHex=function(b,e){y.setHex(b);z=e;O.set(-t,-x,t,x)};this.clear=function(){w.setTransform(1,0,0,-1,t,x);O.isEmpty()||(O.minSelf(N),O.inflate(2),z<1&&w.clearRect(Math.floor(O.getX()),Math.floor(O.getY()),Math.floor(O.getWidth()),Math.floor(O.getHeight())),z>0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(y.r*255)+","+Math.floor(y.g*255)+","+Math.floor(y.b*
-255)+","+z+")"),w.fillRect(Math.floor(O.getX()),Math.floor(O.getY()),Math.floor(O.getWidth()),Math.floor(O.getHeight()))),O.empty())};this.render=function(b,u){function p(b){var e,c,f,k=b.lights;oa.setRGB(0,0,0);xa.setRGB(0,0,0);va.setRGB(0,0,0);b=0;for(e=k.length;b<e;b++)c=k[b],f=c.color,c instanceof THREE.AmbientLight?(oa.r+=f.r,oa.g+=f.g,oa.b+=f.b):c instanceof THREE.DirectionalLight?(xa.r+=f.r,xa.g+=f.g,xa.b+=f.b):c instanceof THREE.PointLight&&(va.r+=f.r,va.g+=f.g,va.b+=f.b)}function v(b,e,c,
-f){var k,h,m,o,n=b.lights,b=0;for(k=n.length;b<k;b++)h=n[b],m=h.color,h instanceof THREE.DirectionalLight?(o=c.dot(h.position),o<=0||(o*=h.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)):h instanceof THREE.PointLight&&(o=c.dot(pa.sub(h.position,e).normalize()),o<=0||(o*=h.distance==0?1:1-Math.min(e.distanceTo(h.position)/h.distance,1),o!=0&&(o*=h.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)))}function Wa(b,k,m){c(m.opacity);e(m.blending);var o,n,u,p,Fa,v;if(m instanceof THREE.ParticleBasicMaterial){if(m.map)p=
-m.map.image,Fa=p.width>>1,v=p.height>>1,m=k.scale.x*t,u=k.scale.y*x,o=m*Fa,n=u*v,M.set(b.x-o,b.y-n,b.x+o,b.y+n),N.intersects(M)&&(w.save(),w.translate(b.x,b.y),w.rotate(-k.rotation),w.scale(m,-u),w.translate(-Fa,-v),w.drawImage(p,0,0),w.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(o=k.scale.x*t,n=k.scale.y*x,M.set(b.x-o,b.y-n,b.x+o,b.y+n),N.intersects(M)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),w.save(),w.translate(b.x,b.y),w.rotate(-k.rotation),w.scale(o,n),m.program(w),
-w.restore()))}function y(b,k,h,m){c(m.opacity);e(m.blending);w.beginPath();w.moveTo(b.positionScreen.x,b.positionScreen.y);w.lineTo(k.positionScreen.x,k.positionScreen.y);w.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(J!=b)w.lineWidth=J=b;b=m.linecap;if(P!=b)w.lineCap=P=b;b=m.linejoin;if(S!=b)w.lineJoin=S=b;f(m.color.getContextStyle());w.stroke();M.inflate(m.linewidth*2)}}function z(b,f,k,h,n,t,p,w,x){m.info.render.vertices+=3;m.info.render.faces++;c(w.opacity);e(w.blending);
-R=b.positionScreen.x;W=b.positionScreen.y;X=f.positionScreen.x;o=f.positionScreen.y;ea=k.positionScreen.x;V=k.positionScreen.y;A(R,W,X,o,ea,V);if(w instanceof THREE.MeshBasicMaterial)if(w.map)w.map.mapping instanceof THREE.UVMapping&&(ra=p.uvs[0],ab(R,W,X,o,ea,V,ra[h].u,ra[h].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,w.map));else if(w.envMap){if(w.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=u.matrixWorldInverse,pa.copy(p.vertexNormalsWorld[0]),ua=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,
-Ca=-(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,pa.copy(p.vertexNormalsWorld[1]),Ea=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,za=-(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,pa.copy(p.vertexNormalsWorld[2]),Ba=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,Ga=-(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,ab(R,W,X,o,ea,V,ua,Ca,Ea,za,Ba,Ga,w.envMap)}else w.wireframe?F(w.color,w.wireframeLinewidth,w.wireframeLinecap,w.wireframeLinejoin):D(w.color);else if(w instanceof THREE.MeshLambertMaterial)w.map&&!w.wireframe&&
-(w.map.mapping instanceof THREE.UVMapping&&(ra=p.uvs[0],ab(R,W,X,o,ea,V,ra[h].u,ra[h].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,w.map)),e(THREE.SubtractiveBlending)),L?!w.wireframe&&w.shading==THREE.SmoothShading&&p.vertexNormalsWorld.length==3?(U.r=Z.r=ga.r=oa.r,U.g=Z.g=ga.g=oa.g,U.b=Z.b=ga.b=oa.b,v(x,p.v1.positionWorld,p.vertexNormalsWorld[0],U),v(x,p.v2.positionWorld,p.vertexNormalsWorld[1],Z),v(x,p.v3.positionWorld,p.vertexNormalsWorld[2],ga),U.r=Math.max(0,Math.min(w.color.r*U.r,1)),U.g=Math.max(0,Math.min(w.color.g*
-U.g,1)),U.b=Math.max(0,Math.min(w.color.b*U.b,1)),Z.r=Math.max(0,Math.min(w.color.r*Z.r,1)),Z.g=Math.max(0,Math.min(w.color.g*Z.g,1)),Z.b=Math.max(0,Math.min(w.color.b*Z.b,1)),ga.r=Math.max(0,Math.min(w.color.r*ga.r,1)),ga.g=Math.max(0,Math.min(w.color.g*ga.g,1)),ga.b=Math.max(0,Math.min(w.color.b*ga.b,1)),ka.r=(Z.r+ga.r)*0.5,ka.g=(Z.g+ga.g)*0.5,ka.b=(Z.b+ga.b)*0.5,qa=Xa(U,Z,ga,ka),Ta(R,W,X,o,ea,V,0,0,1,0,0,1,qa)):(ha.r=oa.r,ha.g=oa.g,ha.b=oa.b,v(x,p.centroidWorld,p.normalWorld,ha),da.r=Math.max(0,
-Math.min(w.color.r*ha.r,1)),da.g=Math.max(0,Math.min(w.color.g*ha.g,1)),da.b=Math.max(0,Math.min(w.color.b*ha.b,1)),w.wireframe?F(da,w.wireframeLinewidth,w.wireframeLinecap,w.wireframeLinejoin):D(da)):w.wireframe?F(w.color,w.wireframeLinewidth,w.wireframeLinecap,w.wireframeLinejoin):D(w.color);else if(w instanceof THREE.MeshDepthMaterial)ma=u.near,na=u.far,U.r=U.g=U.b=1-Pa(b.positionScreen.z,ma,na),Z.r=Z.g=Z.b=1-Pa(f.positionScreen.z,ma,na),ga.r=ga.g=ga.b=1-Pa(k.positionScreen.z,ma,na),ka.r=(Z.r+
-ga.r)*0.5,ka.g=(Z.g+ga.g)*0.5,ka.b=(Z.b+ga.b)*0.5,qa=Xa(U,Z,ga,ka),Ta(R,W,X,o,ea,V,0,0,1,0,0,1,qa);else if(w instanceof THREE.MeshNormalMaterial)da.r=Ua(p.normalWorld.x),da.g=Ua(p.normalWorld.y),da.b=Ua(p.normalWorld.z),w.wireframe?F(da,w.wireframeLinewidth,w.wireframeLinecap,w.wireframeLinejoin):D(da)}function C(b,f,k,h,n,w,t,p,x){m.info.render.vertices+=4;m.info.render.faces++;c(p.opacity);e(p.blending);if(p.map||p.envMap)z(b,f,h,0,1,3,t,p,x),z(n,k,w,1,2,3,t,p,x);else if(R=b.positionScreen.x,W=
-b.positionScreen.y,X=f.positionScreen.x,o=f.positionScreen.y,ea=k.positionScreen.x,V=k.positionScreen.y,la=h.positionScreen.x,aa=h.positionScreen.y,ia=n.positionScreen.x,ca=n.positionScreen.y,ja=w.positionScreen.x,fa=w.positionScreen.y,p instanceof THREE.MeshBasicMaterial)Ya(R,W,X,o,ea,V,la,aa),p.wireframe?F(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):D(p.color);else if(p instanceof THREE.MeshLambertMaterial)L?!p.wireframe&&p.shading==THREE.SmoothShading&&t.vertexNormalsWorld.length==
-4?(U.r=Z.r=ga.r=ka.r=oa.r,U.g=Z.g=ga.g=ka.g=oa.g,U.b=Z.b=ga.b=ka.b=oa.b,v(x,t.v1.positionWorld,t.vertexNormalsWorld[0],U),v(x,t.v2.positionWorld,t.vertexNormalsWorld[1],Z),v(x,t.v4.positionWorld,t.vertexNormalsWorld[3],ga),v(x,t.v3.positionWorld,t.vertexNormalsWorld[2],ka),U.r=Math.max(0,Math.min(p.color.r*U.r,1)),U.g=Math.max(0,Math.min(p.color.g*U.g,1)),U.b=Math.max(0,Math.min(p.color.b*U.b,1)),Z.r=Math.max(0,Math.min(p.color.r*Z.r,1)),Z.g=Math.max(0,Math.min(p.color.g*Z.g,1)),Z.b=Math.max(0,Math.min(p.color.b*
-Z.b,1)),ga.r=Math.max(0,Math.min(p.color.r*ga.r,1)),ga.g=Math.max(0,Math.min(p.color.g*ga.g,1)),ga.b=Math.max(0,Math.min(p.color.b*ga.b,1)),ka.r=Math.max(0,Math.min(p.color.r*ka.r,1)),ka.g=Math.max(0,Math.min(p.color.g*ka.g,1)),ka.b=Math.max(0,Math.min(p.color.b*ka.b,1)),qa=Xa(U,Z,ga,ka),A(R,W,X,o,la,aa),Ta(R,W,X,o,la,aa,0,0,1,0,0,1,qa),A(ia,ca,ea,V,ja,fa),Ta(ia,ca,ea,V,ja,fa,1,0,1,1,0,1,qa)):(ha.r=oa.r,ha.g=oa.g,ha.b=oa.b,v(x,t.centroidWorld,t.normalWorld,ha),da.r=Math.max(0,Math.min(p.color.r*ha.r,
-1)),da.g=Math.max(0,Math.min(p.color.g*ha.g,1)),da.b=Math.max(0,Math.min(p.color.b*ha.b,1)),Ya(R,W,X,o,ea,V,la,aa),p.wireframe?F(da,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):D(da)):(Ya(R,W,X,o,ea,V,la,aa),p.wireframe?F(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):D(p.color));else if(p instanceof THREE.MeshNormalMaterial)da.r=Ua(t.normalWorld.x),da.g=Ua(t.normalWorld.y),da.b=Ua(t.normalWorld.z),Ya(R,W,X,o,ea,V,la,aa),p.wireframe?F(da,p.wireframeLinewidth,
-p.wireframeLinecap,p.wireframeLinejoin):D(da);else if(p instanceof THREE.MeshDepthMaterial)ma=u.near,na=u.far,U.r=U.g=U.b=1-Pa(b.positionScreen.z,ma,na),Z.r=Z.g=Z.b=1-Pa(f.positionScreen.z,ma,na),ga.r=ga.g=ga.b=1-Pa(h.positionScreen.z,ma,na),ka.r=ka.g=ka.b=1-Pa(k.positionScreen.z,ma,na),qa=Xa(U,Z,ga,ka),A(R,W,X,o,la,aa),Ta(R,W,X,o,la,aa,0,0,1,0,0,1,qa),A(ia,ca,ea,V,ja,fa),Ta(ia,ca,ea,V,ja,fa,1,0,1,1,0,1,qa)}function A(b,e,c,f,k,h){w.beginPath();w.moveTo(b,e);w.lineTo(c,f);w.lineTo(k,h);w.lineTo(b,
-e);w.closePath()}function Ya(b,e,c,f,k,h,m,o){w.beginPath();w.moveTo(b,e);w.lineTo(c,f);w.lineTo(k,h);w.lineTo(m,o);w.lineTo(b,e);w.closePath()}function F(b,e,c,k){if(J!=e)w.lineWidth=J=e;if(P!=c)w.lineCap=P=c;if(S!=k)w.lineJoin=S=k;f(b.getContextStyle());w.stroke();M.inflate(e*2)}function D(b){h(b.getContextStyle());w.fill()}function ab(b,e,c,f,k,m,o,n,p,t,u,Fa,v){if(v.image.width!=0){if(v.needsUpdate==!0||ta[v.id]==void 0){var x=v.wrapS==THREE.RepeatWrapping,N=v.wrapT==THREE.RepeatWrapping;ta[v.id]=
-w.createPattern(v.image,x&&N?"repeat":x&&!N?"repeat-x":!x&&N?"repeat-y":"no-repeat");v.needsUpdate=!1}h(ta[v.id]);var x=v.offset.x/v.repeat.x,N=v.offset.y/v.repeat.y,Wa=(v.image.width-1)*v.repeat.x,v=(v.image.height-1)*v.repeat.y,o=(o+x)*Wa,n=(n+N)*v,p=(p+x)*Wa,t=(t+N)*v,u=(u+x)*Wa,Fa=(Fa+N)*v;c-=b;f-=e;k-=b;m-=e;p-=o;t-=n;u-=o;Fa-=n;x=1/(p*Fa-u*t);v=(Fa*c-t*k)*x;t=(Fa*f-t*m)*x;c=(p*k-u*c)*x;f=(p*m-u*f)*x;b=b-v*o-c*n;e=e-t*o-f*n;w.save();w.transform(v,t,c,f,b,e);w.fill();w.restore()}}function Ta(b,
-e,c,f,k,h,m,o,n,p,t,u,Fa){var v,x;v=Fa.width-1;x=Fa.height-1;m*=v;o*=x;n*=v;p*=x;t*=v;u*=x;c-=b;f-=e;k-=b;h-=e;n-=m;p-=o;t-=m;u-=o;x=1/(n*u-t*p);v=(u*c-p*k)*x;p=(u*f-p*h)*x;c=(n*k-t*c)*x;f=(n*h-t*f)*x;b=b-v*m-c*o;e=e-p*m-f*o;w.save();w.transform(v,p,c,f,b,e);w.clip();w.drawImage(Fa,0,0);w.restore()}function Xa(b,e,c,f){var k=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),m=~~(e.r*255),o=~~(e.g*255),e=~~(e.b*255),n=~~(c.r*255),p=~~(c.g*255),c=~~(c.b*255),t=~~(f.r*255),w=~~(f.g*255),f=~~(f.b*255);Aa[0]=k<
-0?0:k>255?255:k;Aa[1]=h<0?0:h>255?255:h;Aa[2]=b<0?0:b>255?255:b;Aa[4]=m<0?0:m>255?255:m;Aa[5]=o<0?0:o>255?255:o;Aa[6]=e<0?0:e>255?255:e;Aa[8]=n<0?0:n>255?255:n;Aa[9]=p<0?0:p>255?255:p;Aa[10]=c<0?0:c>255?255:c;Aa[12]=t<0?0:t>255?255:t;Aa[13]=w<0?0:w>255?255:w;Aa[14]=f<0?0:f>255?255:f;Da.putImageData(Ka,0,0);$.drawImage(wa,0,0);return Ha}function Pa(b,e,c){b=(b-e)/(c-e);return b*b*(3-2*b)}function Ua(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Na(b,e){var c=e.x-b.x,f=e.y-b.y,k=c*c+f*f;k!=0&&(k=1/Math.sqrt(k),
-c*=k,f*=k,e.x+=c,e.y+=f,b.x-=c,b.y-=f)}var Za,bb,sa,Ia,Oa,Va,$a,ya;this.autoClear?this.clear():w.setTransform(1,0,0,-1,t,x);m.info.render.vertices=0;m.info.render.faces=0;k=n.projectScene(b,u,this.sortElements);(L=b.lights.length>0)&&p(b);Za=0;for(bb=k.length;Za<bb;Za++){sa=k[Za];M.empty();if(sa instanceof THREE.RenderableParticle){I=sa;I.x*=t;I.y*=x;Ia=0;for(Oa=sa.materials.length;Ia<Oa;)ya=sa.materials[Ia++],ya.opacity!=0&&Wa(I,sa,ya,b)}else if(sa instanceof THREE.RenderableLine){if(I=sa.v1,H=sa.v2,
-I.positionScreen.x*=t,I.positionScreen.y*=x,H.positionScreen.x*=t,H.positionScreen.y*=x,M.addPoint(I.positionScreen.x,I.positionScreen.y),M.addPoint(H.positionScreen.x,H.positionScreen.y),N.intersects(M)){Ia=0;for(Oa=sa.materials.length;Ia<Oa;)ya=sa.materials[Ia++],ya.opacity!=0&&y(I,H,sa,ya,b)}}else if(sa instanceof THREE.RenderableFace3){if(I=sa.v1,H=sa.v2,G=sa.v3,I.positionScreen.x*=t,I.positionScreen.y*=x,H.positionScreen.x*=t,H.positionScreen.y*=x,G.positionScreen.x*=t,G.positionScreen.y*=x,
-sa.overdraw&&(Na(I.positionScreen,H.positionScreen),Na(H.positionScreen,G.positionScreen),Na(G.positionScreen,I.positionScreen)),M.add3Points(I.positionScreen.x,I.positionScreen.y,H.positionScreen.x,H.positionScreen.y,G.positionScreen.x,G.positionScreen.y),N.intersects(M)){Ia=0;for(Oa=sa.meshMaterials.length;Ia<Oa;)if(ya=sa.meshMaterials[Ia++],ya instanceof THREE.MeshFaceMaterial){Va=0;for($a=sa.faceMaterials.length;Va<$a;)(ya=sa.faceMaterials[Va++])&&ya.opacity!=0&&z(I,H,G,0,1,2,sa,ya,b)}else ya.opacity!=
-0&&z(I,H,G,0,1,2,sa,ya,b)}}else if(sa instanceof THREE.RenderableFace4&&(I=sa.v1,H=sa.v2,G=sa.v3,Y=sa.v4,I.positionScreen.x*=t,I.positionScreen.y*=x,H.positionScreen.x*=t,H.positionScreen.y*=x,G.positionScreen.x*=t,G.positionScreen.y*=x,Y.positionScreen.x*=t,Y.positionScreen.y*=x,E.positionScreen.copy(H.positionScreen),Q.positionScreen.copy(Y.positionScreen),sa.overdraw&&(Na(I.positionScreen,H.positionScreen),Na(H.positionScreen,Y.positionScreen),Na(Y.positionScreen,I.positionScreen),Na(G.positionScreen,
+THREE.DOMRenderer=function(){THREE.Renderer.call(this);var b=null,c=new THREE.Projector,e,f,k,m;this.domElement=document.createElement("div");this.setSize=function(b,c){e=b;f=c;k=e/2;m=f/2};this.render=function(e,f){var p,t,u,w,x,v,y,z;b=c.projectScene(e,f);p=0;for(t=b.length;p<t;p++)if(x=b[p],x instanceof THREE.RenderableParticle){y=x.x*k+k;z=x.y*m+m;u=0;for(w=x.material.length;u<w;u++)if(v=x.material[u],v instanceof THREE.ParticleDOMMaterial)v=v.domElement,v.style.left=y+"px",v.style.top=z+"px"}}};
+THREE.CanvasRenderer=function(b){function c(b){if(C!=b)v.globalAlpha=C=b}function e(b){if(A!=b){switch(b){case THREE.NormalBlending:v.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:v.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:v.globalCompositeOperation="darker"}A=b}}function f(b){if(F!=b)v.strokeStyle=F=b}function k(b){if(D!=b)v.fillStyle=D=b}var m=this,h=null,n=new THREE.Projector,b=b||{},p=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
+t,u,w,x,v=p.getContext("2d"),y=new THREE.Color(0),z=0,C=1,A=0,F=null,D=null,J=null,P=null,S=null,I,H,G,Y,E=new THREE.RenderableVertex,Q=new THREE.RenderableVertex,R,W,X,o,ea,V,la,aa,ia,ca,ja,fa,da=new THREE.Color(0),U=new THREE.Color(0),Z=new THREE.Color(0),ga=new THREE.Color(0),ka=new THREE.Color(0),ta=[],ma,na,qa,ra,ua,Da,Fa,za,Ba,Ga,N=new THREE.Rectangle,O=new THREE.Rectangle,M=new THREE.Rectangle,L=!1,ha=new THREE.Color,oa=new THREE.Color,xa=new THREE.Color,va=new THREE.Color,pa=new THREE.Vector3,
+wa,Ea,Ka,Aa,Ha,$,b=16;wa=document.createElement("canvas");wa.width=wa.height=2;Ea=wa.getContext("2d");Ea.fillStyle="rgba(0,0,0,1)";Ea.fillRect(0,0,2,2);Ka=Ea.getImageData(0,0,2,2);Aa=Ka.data;Ha=document.createElement("canvas");Ha.width=Ha.height=b;$=Ha.getContext("2d");$.translate(-b/2,-b/2);$.scale(b,b);b--;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setSize=function(b,e){t=b;u=e;w=Math.floor(t/2);x=Math.floor(u/2);p.width=t;
+p.height=u;N.set(-w,-x,w,x);O.set(-w,-x,w,x);C=1;A=0;S=P=J=D=F=null};this.setClearColor=function(b,e){y.copy(b);z=e;O.set(-w,-x,w,x)};this.setClearColorHex=function(b,e){y.setHex(b);z=e;O.set(-w,-x,w,x)};this.clear=function(){v.setTransform(1,0,0,-1,w,x);O.isEmpty()||(O.minSelf(N),O.inflate(2),z<1&&v.clearRect(Math.floor(O.getX()),Math.floor(O.getY()),Math.floor(O.getWidth()),Math.floor(O.getHeight())),z>0&&(e(THREE.NormalBlending),c(1),k("rgba("+Math.floor(y.r*255)+","+Math.floor(y.g*255)+","+Math.floor(y.b*
+255)+","+z+")"),v.fillRect(Math.floor(O.getX()),Math.floor(O.getY()),Math.floor(O.getWidth()),Math.floor(O.getHeight()))),O.empty())};this.render=function(b,t){function p(b){var e,c,f,h=b.lights;oa.setRGB(0,0,0);xa.setRGB(0,0,0);va.setRGB(0,0,0);b=0;for(e=h.length;b<e;b++)c=h[b],f=c.color,c instanceof THREE.AmbientLight?(oa.r+=f.r,oa.g+=f.g,oa.b+=f.b):c instanceof THREE.DirectionalLight?(xa.r+=f.r,xa.g+=f.g,xa.b+=f.b):c instanceof THREE.PointLight&&(va.r+=f.r,va.g+=f.g,va.b+=f.b)}function u(b,e,c,
+f){var h,k,m,o,n=b.lights,b=0;for(h=n.length;b<h;b++)k=n[b],m=k.color,k instanceof THREE.DirectionalLight?(o=c.dot(k.position),o<=0||(o*=k.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)):k instanceof THREE.PointLight&&(o=c.dot(pa.sub(k.position,e).normalize()),o<=0||(o*=k.distance==0?1:1-Math.min(e.distanceTo(k.position)/k.distance,1),o!=0&&(o*=k.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)))}function Wa(b,h,m){c(m.opacity);e(m.blending);var o,n,t,p,Ca,u;if(m instanceof THREE.ParticleBasicMaterial){if(m.map)p=
+m.map.image,Ca=p.width>>1,u=p.height>>1,m=h.scale.x*w,t=h.scale.y*x,o=m*Ca,n=t*u,M.set(b.x-o,b.y-n,b.x+o,b.y+n),N.intersects(M)&&(v.save(),v.translate(b.x,b.y),v.rotate(-h.rotation),v.scale(m,-t),v.translate(-Ca,-u),v.drawImage(p,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(o=h.scale.x*w,n=h.scale.y*x,M.set(b.x-o,b.y-n,b.x+o,b.y+n),N.intersects(M)&&(f(m.color.getContextStyle()),k(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-h.rotation),v.scale(o,n),m.program(v),
+v.restore()))}function y(b,h,k,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(h.positionScreen.x,h.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(J!=b)v.lineWidth=J=b;b=m.linecap;if(P!=b)v.lineCap=P=b;b=m.linejoin;if(S!=b)v.lineJoin=S=b;f(m.color.getContextStyle());v.stroke();M.inflate(m.linewidth*2)}}function z(b,f,h,k,n,w,p,v,x){m.info.render.vertices+=3;m.info.render.faces++;c(v.opacity);e(v.blending);
+R=b.positionScreen.x;W=b.positionScreen.y;X=f.positionScreen.x;o=f.positionScreen.y;ea=h.positionScreen.x;V=h.positionScreen.y;A(R,W,X,o,ea,V);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=p.uvs[0],ab(R,W,X,o,ea,V,ra[k].u,ra[k].v,ra[n].u,ra[n].v,ra[w].u,ra[w].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=t.matrixWorldInverse,pa.copy(p.vertexNormalsWorld[0]),ua=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,
+Da=-(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,pa.copy(p.vertexNormalsWorld[1]),Fa=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,za=-(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,pa.copy(p.vertexNormalsWorld[2]),Ba=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,Ga=-(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,ab(R,W,X,o,ea,V,ua,Da,Fa,za,Ba,Ga,v.envMap)}else v.wireframe?F(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):D(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&&
+(v.map.mapping instanceof THREE.UVMapping&&(ra=p.uvs[0],ab(R,W,X,o,ea,V,ra[k].u,ra[k].v,ra[n].u,ra[n].v,ra[w].u,ra[w].v,v.map)),e(THREE.SubtractiveBlending)),L?!v.wireframe&&v.shading==THREE.SmoothShading&&p.vertexNormalsWorld.length==3?(U.r=Z.r=ga.r=oa.r,U.g=Z.g=ga.g=oa.g,U.b=Z.b=ga.b=oa.b,u(x,p.v1.positionWorld,p.vertexNormalsWorld[0],U),u(x,p.v2.positionWorld,p.vertexNormalsWorld[1],Z),u(x,p.v3.positionWorld,p.vertexNormalsWorld[2],ga),U.r=Math.max(0,Math.min(v.color.r*U.r,1)),U.g=Math.max(0,Math.min(v.color.g*
+U.g,1)),U.b=Math.max(0,Math.min(v.color.b*U.b,1)),Z.r=Math.max(0,Math.min(v.color.r*Z.r,1)),Z.g=Math.max(0,Math.min(v.color.g*Z.g,1)),Z.b=Math.max(0,Math.min(v.color.b*Z.b,1)),ga.r=Math.max(0,Math.min(v.color.r*ga.r,1)),ga.g=Math.max(0,Math.min(v.color.g*ga.g,1)),ga.b=Math.max(0,Math.min(v.color.b*ga.b,1)),ka.r=(Z.r+ga.r)*0.5,ka.g=(Z.g+ga.g)*0.5,ka.b=(Z.b+ga.b)*0.5,qa=Xa(U,Z,ga,ka),Ta(R,W,X,o,ea,V,0,0,1,0,0,1,qa)):(ha.r=oa.r,ha.g=oa.g,ha.b=oa.b,u(x,p.centroidWorld,p.normalWorld,ha),da.r=Math.max(0,
+Math.min(v.color.r*ha.r,1)),da.g=Math.max(0,Math.min(v.color.g*ha.g,1)),da.b=Math.max(0,Math.min(v.color.b*ha.b,1)),v.wireframe?F(da,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):D(da)):v.wireframe?F(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):D(v.color);else if(v instanceof THREE.MeshDepthMaterial)ma=t.near,na=t.far,U.r=U.g=U.b=1-Pa(b.positionScreen.z,ma,na),Z.r=Z.g=Z.b=1-Pa(f.positionScreen.z,ma,na),ga.r=ga.g=ga.b=1-Pa(h.positionScreen.z,ma,na),ka.r=(Z.r+
+ga.r)*0.5,ka.g=(Z.g+ga.g)*0.5,ka.b=(Z.b+ga.b)*0.5,qa=Xa(U,Z,ga,ka),Ta(R,W,X,o,ea,V,0,0,1,0,0,1,qa);else if(v instanceof THREE.MeshNormalMaterial)da.r=Ua(p.normalWorld.x),da.g=Ua(p.normalWorld.y),da.b=Ua(p.normalWorld.z),v.wireframe?F(da,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):D(da)}function C(b,f,h,k,n,w,v,p,x){m.info.render.vertices+=4;m.info.render.faces++;c(p.opacity);e(p.blending);if(p.map||p.envMap)z(b,f,k,0,1,3,v,p,x),z(n,h,w,1,2,3,v,p,x);else if(R=b.positionScreen.x,W=
+b.positionScreen.y,X=f.positionScreen.x,o=f.positionScreen.y,ea=h.positionScreen.x,V=h.positionScreen.y,la=k.positionScreen.x,aa=k.positionScreen.y,ia=n.positionScreen.x,ca=n.positionScreen.y,ja=w.positionScreen.x,fa=w.positionScreen.y,p instanceof THREE.MeshBasicMaterial)Ya(R,W,X,o,ea,V,la,aa),p.wireframe?F(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):D(p.color);else if(p instanceof THREE.MeshLambertMaterial)L?!p.wireframe&&p.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==
+4?(U.r=Z.r=ga.r=ka.r=oa.r,U.g=Z.g=ga.g=ka.g=oa.g,U.b=Z.b=ga.b=ka.b=oa.b,u(x,v.v1.positionWorld,v.vertexNormalsWorld[0],U),u(x,v.v2.positionWorld,v.vertexNormalsWorld[1],Z),u(x,v.v4.positionWorld,v.vertexNormalsWorld[3],ga),u(x,v.v3.positionWorld,v.vertexNormalsWorld[2],ka),U.r=Math.max(0,Math.min(p.color.r*U.r,1)),U.g=Math.max(0,Math.min(p.color.g*U.g,1)),U.b=Math.max(0,Math.min(p.color.b*U.b,1)),Z.r=Math.max(0,Math.min(p.color.r*Z.r,1)),Z.g=Math.max(0,Math.min(p.color.g*Z.g,1)),Z.b=Math.max(0,Math.min(p.color.b*
+Z.b,1)),ga.r=Math.max(0,Math.min(p.color.r*ga.r,1)),ga.g=Math.max(0,Math.min(p.color.g*ga.g,1)),ga.b=Math.max(0,Math.min(p.color.b*ga.b,1)),ka.r=Math.max(0,Math.min(p.color.r*ka.r,1)),ka.g=Math.max(0,Math.min(p.color.g*ka.g,1)),ka.b=Math.max(0,Math.min(p.color.b*ka.b,1)),qa=Xa(U,Z,ga,ka),A(R,W,X,o,la,aa),Ta(R,W,X,o,la,aa,0,0,1,0,0,1,qa),A(ia,ca,ea,V,ja,fa),Ta(ia,ca,ea,V,ja,fa,1,0,1,1,0,1,qa)):(ha.r=oa.r,ha.g=oa.g,ha.b=oa.b,u(x,v.centroidWorld,v.normalWorld,ha),da.r=Math.max(0,Math.min(p.color.r*ha.r,
+1)),da.g=Math.max(0,Math.min(p.color.g*ha.g,1)),da.b=Math.max(0,Math.min(p.color.b*ha.b,1)),Ya(R,W,X,o,ea,V,la,aa),p.wireframe?F(da,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):D(da)):(Ya(R,W,X,o,ea,V,la,aa),p.wireframe?F(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):D(p.color));else if(p instanceof THREE.MeshNormalMaterial)da.r=Ua(v.normalWorld.x),da.g=Ua(v.normalWorld.y),da.b=Ua(v.normalWorld.z),Ya(R,W,X,o,ea,V,la,aa),p.wireframe?F(da,p.wireframeLinewidth,
+p.wireframeLinecap,p.wireframeLinejoin):D(da);else if(p instanceof THREE.MeshDepthMaterial)ma=t.near,na=t.far,U.r=U.g=U.b=1-Pa(b.positionScreen.z,ma,na),Z.r=Z.g=Z.b=1-Pa(f.positionScreen.z,ma,na),ga.r=ga.g=ga.b=1-Pa(k.positionScreen.z,ma,na),ka.r=ka.g=ka.b=1-Pa(h.positionScreen.z,ma,na),qa=Xa(U,Z,ga,ka),A(R,W,X,o,la,aa),Ta(R,W,X,o,la,aa,0,0,1,0,0,1,qa),A(ia,ca,ea,V,ja,fa),Ta(ia,ca,ea,V,ja,fa,1,0,1,1,0,1,qa)}function A(b,e,c,f,h,k){v.beginPath();v.moveTo(b,e);v.lineTo(c,f);v.lineTo(h,k);v.lineTo(b,
+e);v.closePath()}function Ya(b,e,c,f,h,k,m,o){v.beginPath();v.moveTo(b,e);v.lineTo(c,f);v.lineTo(h,k);v.lineTo(m,o);v.lineTo(b,e);v.closePath()}function F(b,e,c,h){if(J!=e)v.lineWidth=J=e;if(P!=c)v.lineCap=P=c;if(S!=h)v.lineJoin=S=h;f(b.getContextStyle());v.stroke();M.inflate(e*2)}function D(b){k(b.getContextStyle());v.fill()}function ab(b,e,c,f,h,m,o,n,p,t,w,Ca,u){if(u.image.width!=0){if(u.needsUpdate==!0||ta[u.id]==void 0){var x=u.wrapS==THREE.RepeatWrapping,N=u.wrapT==THREE.RepeatWrapping;ta[u.id]=
+v.createPattern(u.image,x&&N?"repeat":x&&!N?"repeat-x":!x&&N?"repeat-y":"no-repeat");u.needsUpdate=!1}k(ta[u.id]);var x=u.offset.x/u.repeat.x,N=u.offset.y/u.repeat.y,Wa=(u.image.width-1)*u.repeat.x,u=(u.image.height-1)*u.repeat.y,o=(o+x)*Wa,n=(n+N)*u,p=(p+x)*Wa,t=(t+N)*u,w=(w+x)*Wa,Ca=(Ca+N)*u;c-=b;f-=e;h-=b;m-=e;p-=o;t-=n;w-=o;Ca-=n;x=1/(p*Ca-w*t);u=(Ca*c-t*h)*x;t=(Ca*f-t*m)*x;c=(p*h-w*c)*x;f=(p*m-w*f)*x;b=b-u*o-c*n;e=e-t*o-f*n;v.save();v.transform(u,t,c,f,b,e);v.fill();v.restore()}}function Ta(b,
+e,c,f,h,k,m,o,n,p,t,w,u){var Ca,x;Ca=u.width-1;x=u.height-1;m*=Ca;o*=x;n*=Ca;p*=x;t*=Ca;w*=x;c-=b;f-=e;h-=b;k-=e;n-=m;p-=o;t-=m;w-=o;x=1/(n*w-t*p);Ca=(w*c-p*h)*x;p=(w*f-p*k)*x;c=(n*h-t*c)*x;f=(n*k-t*f)*x;b=b-Ca*m-c*o;e=e-p*m-f*o;v.save();v.transform(Ca,p,c,f,b,e);v.clip();v.drawImage(u,0,0);v.restore()}function Xa(b,e,c,f){var h=~~(b.r*255),k=~~(b.g*255),b=~~(b.b*255),m=~~(e.r*255),o=~~(e.g*255),e=~~(e.b*255),n=~~(c.r*255),p=~~(c.g*255),c=~~(c.b*255),t=~~(f.r*255),w=~~(f.g*255),f=~~(f.b*255);Aa[0]=
+h<0?0:h>255?255:h;Aa[1]=k<0?0:k>255?255:k;Aa[2]=b<0?0:b>255?255:b;Aa[4]=m<0?0:m>255?255:m;Aa[5]=o<0?0:o>255?255:o;Aa[6]=e<0?0:e>255?255:e;Aa[8]=n<0?0:n>255?255:n;Aa[9]=p<0?0:p>255?255:p;Aa[10]=c<0?0:c>255?255:c;Aa[12]=t<0?0:t>255?255:t;Aa[13]=w<0?0:w>255?255:w;Aa[14]=f<0?0:f>255?255:f;Ea.putImageData(Ka,0,0);$.drawImage(wa,0,0);return Ha}function Pa(b,e,c){b=(b-e)/(c-e);return b*b*(3-2*b)}function Ua(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Na(b,e){var c=e.x-b.x,f=e.y-b.y,h=c*c+f*f;h!=0&&(h=1/
+Math.sqrt(h),c*=h,f*=h,e.x+=c,e.y+=f,b.x-=c,b.y-=f)}var Za,bb,sa,Ia,Oa,Va,$a,ya;this.autoClear?this.clear():v.setTransform(1,0,0,-1,w,x);m.info.render.vertices=0;m.info.render.faces=0;h=n.projectScene(b,t,this.sortElements);(L=b.lights.length>0)&&p(b);Za=0;for(bb=h.length;Za<bb;Za++){sa=h[Za];M.empty();if(sa instanceof THREE.RenderableParticle){I=sa;I.x*=w;I.y*=x;Ia=0;for(Oa=sa.materials.length;Ia<Oa;)ya=sa.materials[Ia++],ya.opacity!=0&&Wa(I,sa,ya,b)}else if(sa instanceof THREE.RenderableLine){if(I=
+sa.v1,H=sa.v2,I.positionScreen.x*=w,I.positionScreen.y*=x,H.positionScreen.x*=w,H.positionScreen.y*=x,M.addPoint(I.positionScreen.x,I.positionScreen.y),M.addPoint(H.positionScreen.x,H.positionScreen.y),N.intersects(M)){Ia=0;for(Oa=sa.materials.length;Ia<Oa;)ya=sa.materials[Ia++],ya.opacity!=0&&y(I,H,sa,ya,b)}}else if(sa instanceof THREE.RenderableFace3){if(I=sa.v1,H=sa.v2,G=sa.v3,I.positionScreen.x*=w,I.positionScreen.y*=x,H.positionScreen.x*=w,H.positionScreen.y*=x,G.positionScreen.x*=w,G.positionScreen.y*=
+x,sa.overdraw&&(Na(I.positionScreen,H.positionScreen),Na(H.positionScreen,G.positionScreen),Na(G.positionScreen,I.positionScreen)),M.add3Points(I.positionScreen.x,I.positionScreen.y,H.positionScreen.x,H.positionScreen.y,G.positionScreen.x,G.positionScreen.y),N.intersects(M)){Ia=0;for(Oa=sa.meshMaterials.length;Ia<Oa;)if(ya=sa.meshMaterials[Ia++],ya instanceof THREE.MeshFaceMaterial){Va=0;for($a=sa.faceMaterials.length;Va<$a;)(ya=sa.faceMaterials[Va++])&&ya.opacity!=0&&z(I,H,G,0,1,2,sa,ya,b)}else ya.opacity!=
+0&&z(I,H,G,0,1,2,sa,ya,b)}}else if(sa instanceof THREE.RenderableFace4&&(I=sa.v1,H=sa.v2,G=sa.v3,Y=sa.v4,I.positionScreen.x*=w,I.positionScreen.y*=x,H.positionScreen.x*=w,H.positionScreen.y*=x,G.positionScreen.x*=w,G.positionScreen.y*=x,Y.positionScreen.x*=w,Y.positionScreen.y*=x,E.positionScreen.copy(H.positionScreen),Q.positionScreen.copy(Y.positionScreen),sa.overdraw&&(Na(I.positionScreen,H.positionScreen),Na(H.positionScreen,Y.positionScreen),Na(Y.positionScreen,I.positionScreen),Na(G.positionScreen,
 E.positionScreen),Na(G.positionScreen,Q.positionScreen)),M.addPoint(I.positionScreen.x,I.positionScreen.y),M.addPoint(H.positionScreen.x,H.positionScreen.y),M.addPoint(G.positionScreen.x,G.positionScreen.y),M.addPoint(Y.positionScreen.x,Y.positionScreen.y),N.intersects(M))){Ia=0;for(Oa=sa.meshMaterials.length;Ia<Oa;)if(ya=sa.meshMaterials[Ia++],ya instanceof THREE.MeshFaceMaterial){Va=0;for($a=sa.faceMaterials.length;Va<$a;)(ya=sa.faceMaterials[Va++])&&ya.opacity!=0&&C(I,H,G,Y,E,Q,sa,ya,b)}else ya.opacity!=
-0&&C(I,H,G,Y,E,Q,sa,ya,b)}O.addRectangle(M)}w.setTransform(1,0,0,1,0,0)}};
-THREE.SVGRenderer=function(){function b(b,e,c){var f,k,h,m;f=0;for(k=b.lights.length;f<k;f++)h=b.lights[f],h instanceof THREE.DirectionalLight?(m=e.normalWorld.dot(h.position)*h.intensity,m>0&&(c.r+=h.color.r*m,c.g+=h.color.g*m,c.b+=h.color.b*m)):h instanceof THREE.PointLight&&(Y.sub(h.position,e.centroidWorld),Y.normalize(),m=e.normalWorld.dot(Y)*h.intensity,m>0&&(c.r+=h.color.r*m,c.g+=h.color.g*m,c.b+=h.color.b*m))}function c(e,c,k,o,n,p){m.info.render.vertices+=3;m.info.render.faces++;R=f(W++);
-R.setAttribute("d","M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");n instanceof THREE.MeshBasicMaterial?J.copy(n.color):n instanceof THREE.MeshLambertMaterial?D?(P.r=S.r,P.g=S.g,P.b=S.b,b(p,o,P),J.r=Math.max(0,Math.min(n.color.r*P.r,1)),J.g=Math.max(0,Math.min(n.color.g*P.g,1)),J.b=Math.max(0,Math.min(n.color.b*P.b,1))):J.copy(n.color):n instanceof THREE.MeshDepthMaterial?(G=1-n.__2near/(n.__farPlusNear-
-o.z*n.__farMinusNear),J.setRGB(G,G,G)):n instanceof THREE.MeshNormalMaterial&&J.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));n.wireframe?R.setAttribute("style","fill: none; stroke: "+J.getContextStyle()+"; stroke-width: "+n.wireframeLinewidth+"; stroke-opacity: "+n.opacity+"; stroke-linecap: "+n.wireframeLinecap+"; stroke-linejoin: "+n.wireframeLinejoin):R.setAttribute("style","fill: "+J.getContextStyle()+"; fill-opacity: "+n.opacity);u.appendChild(R)}function e(e,c,k,o,n,p,t){m.info.render.vertices+=
-4;m.info.render.faces++;R=f(W++);R.setAttribute("d","M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+" L "+o.positionScreen.x+","+o.positionScreen.y+"z");p instanceof THREE.MeshBasicMaterial?J.copy(p.color):p instanceof THREE.MeshLambertMaterial?D?(P.r=S.r,P.g=S.g,P.b=S.b,b(t,n,P),J.r=Math.max(0,Math.min(p.color.r*P.r,1)),J.g=Math.max(0,Math.min(p.color.g*P.g,1)),J.b=Math.max(0,Math.min(p.color.b*P.b,1))):
-J.copy(p.color):p instanceof THREE.MeshDepthMaterial?(G=1-p.__2near/(p.__farPlusNear-n.z*p.__farMinusNear),J.setRGB(G,G,G)):p instanceof THREE.MeshNormalMaterial&&J.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));p.wireframe?R.setAttribute("style","fill: none; stroke: "+J.getContextStyle()+"; stroke-width: "+p.wireframeLinewidth+"; stroke-opacity: "+p.opacity+"; stroke-linecap: "+p.wireframeLinecap+"; stroke-linejoin: "+p.wireframeLinejoin):R.setAttribute("style","fill: "+J.getContextStyle()+
-"; fill-opacity: "+p.opacity);u.appendChild(R)}function f(b){E[b]==null&&(E[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),o==0&&E[b].setAttribute("shape-rendering","crispEdges"));return E[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var m=this,k=null,n=new THREE.Projector,u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p,v,t,x,w,y,z,C,A=new THREE.Rectangle,F=new THREE.Rectangle,D=!1,J=new THREE.Color(16777215),P=new THREE.Color(16777215),S=new THREE.Color(0),
-I=new THREE.Color(0),H=new THREE.Color(0),G,Y=new THREE.Vector3,E=[],Q=[],R,W,X,o=1;this.domElement=u;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":o=1;break;case "low":o=0}};this.setSize=function(b,e){p=b;v=e;t=p/2;x=v/2;u.setAttribute("viewBox",-t+" "+-x+" "+p+" "+v);u.setAttribute("width",p);u.setAttribute("height",v);A.set(-t,-x,t,x)};this.clear=function(){for(;u.childNodes.length>0;)u.removeChild(u.childNodes[0])};
-this.render=function(b,f){var h,p,v,J,P,E,G,U;this.autoClear&&this.clear();m.info.render.vertices=0;m.info.render.faces=0;k=n.projectScene(b,f,this.sortElements);X=W=0;if(D=b.lights.length>0){G=b.lights;S.setRGB(0,0,0);I.setRGB(0,0,0);H.setRGB(0,0,0);h=0;for(p=G.length;h<p;h++)v=G[h],J=v.color,v instanceof THREE.AmbientLight?(S.r+=J.r,S.g+=J.g,S.b+=J.b):v instanceof THREE.DirectionalLight?(I.r+=J.r,I.g+=J.g,I.b+=J.b):v instanceof THREE.PointLight&&(H.r+=J.r,H.g+=J.g,H.b+=J.b)}h=0;for(p=k.length;h<
-p;h++)if(G=k[h],F.empty(),G instanceof THREE.RenderableParticle){w=G;w.x*=t;w.y*=-x;v=0;for(J=G.materials.length;v<J;)v++}else if(G instanceof THREE.RenderableLine){if(w=G.v1,y=G.v2,w.positionScreen.x*=t,w.positionScreen.y*=-x,y.positionScreen.x*=t,y.positionScreen.y*=-x,F.addPoint(w.positionScreen.x,w.positionScreen.y),F.addPoint(y.positionScreen.x,y.positionScreen.y),A.intersects(F)){v=0;for(J=G.materials.length;v<J;)if((U=G.materials[v++])&&U.opacity!=0){P=w;E=y;var Z=X++;Q[Z]==null&&(Q[Z]=document.createElementNS("http://www.w3.org/2000/svg",
-"line"),o==0&&Q[Z].setAttribute("shape-rendering","crispEdges"));R=Q[Z];R.setAttribute("x1",P.positionScreen.x);R.setAttribute("y1",P.positionScreen.y);R.setAttribute("x2",E.positionScreen.x);R.setAttribute("y2",E.positionScreen.y);U instanceof THREE.LineBasicMaterial&&(R.setAttribute("style","fill: none; stroke: "+U.color.getContextStyle()+"; stroke-width: "+U.linewidth+"; stroke-opacity: "+U.opacity+"; stroke-linecap: "+U.linecap+"; stroke-linejoin: "+U.linejoin),u.appendChild(R))}}}else if(G instanceof
-THREE.RenderableFace3){if(w=G.v1,y=G.v2,z=G.v3,w.positionScreen.x*=t,w.positionScreen.y*=-x,y.positionScreen.x*=t,y.positionScreen.y*=-x,z.positionScreen.x*=t,z.positionScreen.y*=-x,F.addPoint(w.positionScreen.x,w.positionScreen.y),F.addPoint(y.positionScreen.x,y.positionScreen.y),F.addPoint(z.positionScreen.x,z.positionScreen.y),A.intersects(F)){v=0;for(J=G.meshMaterials.length;v<J;)if(U=G.meshMaterials[v++],U instanceof THREE.MeshFaceMaterial){P=0;for(E=G.faceMaterials.length;P<E;)(U=G.faceMaterials[P++])&&
-U.opacity!=0&&c(w,y,z,G,U,b)}else U&&U.opacity!=0&&c(w,y,z,G,U,b)}}else if(G instanceof THREE.RenderableFace4&&(w=G.v1,y=G.v2,z=G.v3,C=G.v4,w.positionScreen.x*=t,w.positionScreen.y*=-x,y.positionScreen.x*=t,y.positionScreen.y*=-x,z.positionScreen.x*=t,z.positionScreen.y*=-x,C.positionScreen.x*=t,C.positionScreen.y*=-x,F.addPoint(w.positionScreen.x,w.positionScreen.y),F.addPoint(y.positionScreen.x,y.positionScreen.y),F.addPoint(z.positionScreen.x,z.positionScreen.y),F.addPoint(C.positionScreen.x,C.positionScreen.y),
-A.intersects(F))){v=0;for(J=G.meshMaterials.length;v<J;)if(U=G.meshMaterials[v++],U instanceof THREE.MeshFaceMaterial){P=0;for(E=G.faceMaterials.length;P<E;)(U=G.faceMaterials[P++])&&U.opacity!=0&&e(w,y,z,C,G,U,b)}else U&&U.opacity!=0&&e(w,y,z,C,G,U,b)}}};
+0&&C(I,H,G,Y,E,Q,sa,ya,b)}O.addRectangle(M)}v.setTransform(1,0,0,1,0,0)}};
+THREE.SVGRenderer=function(){function b(b,e,c){var f,h,k,m;f=0;for(h=b.lights.length;f<h;f++)k=b.lights[f],k instanceof THREE.DirectionalLight?(m=e.normalWorld.dot(k.position)*k.intensity,m>0&&(c.r+=k.color.r*m,c.g+=k.color.g*m,c.b+=k.color.b*m)):k instanceof THREE.PointLight&&(Y.sub(k.position,e.centroidWorld),Y.normalize(),m=e.normalWorld.dot(Y)*k.intensity,m>0&&(c.r+=k.color.r*m,c.g+=k.color.g*m,c.b+=k.color.b*m))}function c(e,c,h,o,n,t){m.info.render.vertices+=3;m.info.render.faces++;R=f(W++);
+R.setAttribute("d","M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+"z");n instanceof THREE.MeshBasicMaterial?J.copy(n.color):n instanceof THREE.MeshLambertMaterial?D?(P.r=S.r,P.g=S.g,P.b=S.b,b(t,o,P),J.r=Math.max(0,Math.min(n.color.r*P.r,1)),J.g=Math.max(0,Math.min(n.color.g*P.g,1)),J.b=Math.max(0,Math.min(n.color.b*P.b,1))):J.copy(n.color):n instanceof THREE.MeshDepthMaterial?(G=1-n.__2near/(n.__farPlusNear-
+o.z*n.__farMinusNear),J.setRGB(G,G,G)):n instanceof THREE.MeshNormalMaterial&&J.setRGB(k(o.normalWorld.x),k(o.normalWorld.y),k(o.normalWorld.z));n.wireframe?R.setAttribute("style","fill: none; stroke: "+J.getContextStyle()+"; stroke-width: "+n.wireframeLinewidth+"; stroke-opacity: "+n.opacity+"; stroke-linecap: "+n.wireframeLinecap+"; stroke-linejoin: "+n.wireframeLinejoin):R.setAttribute("style","fill: "+J.getContextStyle()+"; fill-opacity: "+n.opacity);p.appendChild(R)}function e(e,c,h,n,o,t,w){m.info.render.vertices+=
+4;m.info.render.faces++;R=f(W++);R.setAttribute("d","M "+e.positionScreen.x+" "+e.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?J.copy(t.color):t instanceof THREE.MeshLambertMaterial?D?(P.r=S.r,P.g=S.g,P.b=S.b,b(w,o,P),J.r=Math.max(0,Math.min(t.color.r*P.r,1)),J.g=Math.max(0,Math.min(t.color.g*P.g,1)),J.b=Math.max(0,Math.min(t.color.b*P.b,1))):
+J.copy(t.color):t instanceof THREE.MeshDepthMaterial?(G=1-t.__2near/(t.__farPlusNear-o.z*t.__farMinusNear),J.setRGB(G,G,G)):t instanceof THREE.MeshNormalMaterial&&J.setRGB(k(o.normalWorld.x),k(o.normalWorld.y),k(o.normalWorld.z));t.wireframe?R.setAttribute("style","fill: none; stroke: "+J.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):R.setAttribute("style","fill: "+J.getContextStyle()+
+"; fill-opacity: "+t.opacity);p.appendChild(R)}function f(b){E[b]==null&&(E[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),o==0&&E[b].setAttribute("shape-rendering","crispEdges"));return E[b]}function k(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var m=this,h=null,n=new THREE.Projector,p=document.createElementNS("http://www.w3.org/2000/svg","svg"),t,u,w,x,v,y,z,C,A=new THREE.Rectangle,F=new THREE.Rectangle,D=!1,J=new THREE.Color(16777215),P=new THREE.Color(16777215),S=new THREE.Color(0),
+I=new THREE.Color(0),H=new THREE.Color(0),G,Y=new THREE.Vector3,E=[],Q=[],R,W,X,o=1;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":o=1;break;case "low":o=0}};this.setSize=function(b,e){t=b;u=e;w=t/2;x=u/2;p.setAttribute("viewBox",-w+" "+-x+" "+t+" "+u);p.setAttribute("width",t);p.setAttribute("height",u);A.set(-w,-x,w,x)};this.clear=function(){for(;p.childNodes.length>0;)p.removeChild(p.childNodes[0])};
+this.render=function(b,f){var k,t,u,J,P,E,G,U;this.autoClear&&this.clear();m.info.render.vertices=0;m.info.render.faces=0;h=n.projectScene(b,f,this.sortElements);X=W=0;if(D=b.lights.length>0){G=b.lights;S.setRGB(0,0,0);I.setRGB(0,0,0);H.setRGB(0,0,0);k=0;for(t=G.length;k<t;k++)u=G[k],J=u.color,u instanceof THREE.AmbientLight?(S.r+=J.r,S.g+=J.g,S.b+=J.b):u instanceof THREE.DirectionalLight?(I.r+=J.r,I.g+=J.g,I.b+=J.b):u instanceof THREE.PointLight&&(H.r+=J.r,H.g+=J.g,H.b+=J.b)}k=0;for(t=h.length;k<
+t;k++)if(G=h[k],F.empty(),G instanceof THREE.RenderableParticle){v=G;v.x*=w;v.y*=-x;u=0;for(J=G.materials.length;u<J;)u++}else if(G instanceof THREE.RenderableLine){if(v=G.v1,y=G.v2,v.positionScreen.x*=w,v.positionScreen.y*=-x,y.positionScreen.x*=w,y.positionScreen.y*=-x,F.addPoint(v.positionScreen.x,v.positionScreen.y),F.addPoint(y.positionScreen.x,y.positionScreen.y),A.intersects(F)){u=0;for(J=G.materials.length;u<J;)if((U=G.materials[u++])&&U.opacity!=0){P=v;E=y;var Z=X++;Q[Z]==null&&(Q[Z]=document.createElementNS("http://www.w3.org/2000/svg",
+"line"),o==0&&Q[Z].setAttribute("shape-rendering","crispEdges"));R=Q[Z];R.setAttribute("x1",P.positionScreen.x);R.setAttribute("y1",P.positionScreen.y);R.setAttribute("x2",E.positionScreen.x);R.setAttribute("y2",E.positionScreen.y);U instanceof THREE.LineBasicMaterial&&(R.setAttribute("style","fill: none; stroke: "+U.color.getContextStyle()+"; stroke-width: "+U.linewidth+"; stroke-opacity: "+U.opacity+"; stroke-linecap: "+U.linecap+"; stroke-linejoin: "+U.linejoin),p.appendChild(R))}}}else if(G instanceof
+THREE.RenderableFace3){if(v=G.v1,y=G.v2,z=G.v3,v.positionScreen.x*=w,v.positionScreen.y*=-x,y.positionScreen.x*=w,y.positionScreen.y*=-x,z.positionScreen.x*=w,z.positionScreen.y*=-x,F.addPoint(v.positionScreen.x,v.positionScreen.y),F.addPoint(y.positionScreen.x,y.positionScreen.y),F.addPoint(z.positionScreen.x,z.positionScreen.y),A.intersects(F)){u=0;for(J=G.meshMaterials.length;u<J;)if(U=G.meshMaterials[u++],U instanceof THREE.MeshFaceMaterial){P=0;for(E=G.faceMaterials.length;P<E;)(U=G.faceMaterials[P++])&&
+U.opacity!=0&&c(v,y,z,G,U,b)}else U&&U.opacity!=0&&c(v,y,z,G,U,b)}}else if(G instanceof THREE.RenderableFace4&&(v=G.v1,y=G.v2,z=G.v3,C=G.v4,v.positionScreen.x*=w,v.positionScreen.y*=-x,y.positionScreen.x*=w,y.positionScreen.y*=-x,z.positionScreen.x*=w,z.positionScreen.y*=-x,C.positionScreen.x*=w,C.positionScreen.y*=-x,F.addPoint(v.positionScreen.x,v.positionScreen.y),F.addPoint(y.positionScreen.x,y.positionScreen.y),F.addPoint(z.positionScreen.x,z.positionScreen.y),F.addPoint(C.positionScreen.x,C.positionScreen.y),
+A.intersects(F))){u=0;for(J=G.meshMaterials.length;u<J;)if(U=G.meshMaterials[u++],U instanceof THREE.MeshFaceMaterial){P=0;for(E=G.faceMaterials.length;P<E;)(U=G.faceMaterials[P++])&&U.opacity!=0&&e(v,y,z,C,G,U,b)}else U&&U.opacity!=0&&e(v,y,z,C,G,U,b)}}};
 THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform int combine;\n#endif",
 envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[ 0 ].xyz, objectMatrix[ 1 ].xyz, objectMatrix[ 2 ].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",
 map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform vec4 offsetRepeat;\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",map_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif",
@@ -202,7 +202,7 @@ morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\nuniform float morphTargetInflu
 default_vertex:"#ifndef USE_MORPHTARGETS\n#ifndef USE_SKINNING\ngl_Position = projectionMatrix * mvPosition;\n#endif\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform float shadowDarkness;\nuniform float shadowBias;\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif",
 shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_SOFT\nconst float xPixelOffset = 1.0 / SHADOWMAP_WIDTH;\nconst float yPixelOffset = 1.0 / SHADOWMAP_HEIGHT;\n#endif\nvec4 shadowColor = vec4( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nshadowCoord.z += shadowBias;\nif ( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec4( vec3( ( 1.0 - shadowDarkness * shadow ) ), 1.0 );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec4( vec3( shadowDarkness ), 1.0 );\n#endif\n}\n}\ngl_FragColor = gl_FragColor * shadowColor;\n#endif",
 shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif"};
-THREE.UniformsUtils={merge:function(b){var c,e,f,h={};for(c=0;c<b.length;c++)for(e in f=this.clone(b[c]),f)h[e]=f[e];return h},clone:function(b){var c,e,f,h={};for(c in b)for(e in h[c]={},b[c])f=b[c][e],h[c][e]=f instanceof THREE.Color||f instanceof THREE.Vector2||f instanceof THREE.Vector3||f instanceof THREE.Vector4||f instanceof THREE.Matrix4||f instanceof THREE.Texture?f.clone():f instanceof Array?f.slice():f;return h}};
+THREE.UniformsUtils={merge:function(b){var c,e,f,k={};for(c=0;c<b.length;c++)for(e in f=this.clone(b[c]),f)k[e]=f[e];return k},clone:function(b){var c,e,f,k={};for(c in b)for(e in k[c]={},b[c])f=b[c][e],k[c][e]=f instanceof THREE.Color||f instanceof THREE.Vector2||f instanceof THREE.Vector3||f instanceof THREE.Vector4||f instanceof THREE.Matrix4||f instanceof THREE.Texture?f.clone():f instanceof Array?f.slice():f;return k}};
 THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:0,texture:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:2,texture:null},envMap:{type:"t",value:1,texture:null},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:0.98},combine:{type:"i",value:0},morphTargetInfluences:{type:"f",value:0}},fog:{fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",
 value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{enableLighting:{type:"i",value:1},ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",
 value:1},map:{type:"t",value:0,texture:null},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:3,texture:[]},shadowMatrix:{type:"m4v",value:[]},shadowBias:{type:"f",value:0.0039},shadowDarkness:{type:"f",value:0.2}}};
@@ -221,44 +221,44 @@ THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.
 THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",
 THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,
 "}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask  = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};
-THREE.WebGLRenderer=function(b){function c(b,e,c){var f,k,h,m=b.vertices,n=m.length,p=b.colors,t=p.length,w=b.__vertexArray,u=b.__colorArray,v=b.__sortArray,x=b.__dirtyVertices,N=b.__dirtyColors,y=b.__webglCustomAttributes,M,O;if(y)for(M in y)y[M].offset=0;if(c.sortParticles){Ca.multiplySelf(c.matrixWorld);for(f=0;f<n;f++)k=m[f].position,Ba.copy(k),Ca.multiplyVector3(Ba),v[f]=[Ba.z,f];v.sort(function(b,e){return e[0]-b[0]});for(f=0;f<n;f++)k=m[v[f][1]].position,h=f*3,w[h]=k.x,w[h+1]=k.y,w[h+2]=k.z;
-for(f=0;f<t;f++)h=f*3,color=p[v[f][1]],u[h]=color.r,u[h+1]=color.g,u[h+2]=color.b;if(y)for(M in y){f=y[M];p=f.value.length;for(h=0;h<p;h++){index=v[h][1];t=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[t]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")O=f.value[index];f.size===2?(f.array[t]=O.x,f.array[t+1]=O.y):f.size===3?f.type==="c"?(f.array[t]=O.r,f.array[t+1]=O.g,f.array[t+2]=O.b):(f.array[t]=O.x,f.array[t+1]=O.y,f.array[t+2]=O.z):(f.array[t]=
-O.x,f.array[t+1]=O.y,f.array[t+2]=O.z,f.array[t+3]=O.w)}f.offset+=f.size}}}else{if(x)for(f=0;f<n;f++)k=m[f].position,h=f*3,w[h]=k.x,w[h+1]=k.y,w[h+2]=k.z;if(N)for(f=0;f<t;f++)color=p[f],h=f*3,u[h]=color.r,u[h+1]=color.g,u[h+2]=color.b;if(y)for(M in y)if(f=y[M],f.__original.needsUpdate){p=f.value.length;for(h=0;h<p;h++){t=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[t]=f.value[h]}else{if(f.boundTo===void 0||f.boundTo==="vertices")O=f.value[h];f.size===2?(f.array[t]=
-O.x,f.array[t+1]=O.y):f.size===3?f.type==="c"?(f.array[t]=O.r,f.array[t+1]=O.g,f.array[t+2]=O.b):(f.array[t]=O.x,f.array[t+1]=O.y,f.array[t+2]=O.z):(f.array[t]=O.x,f.array[t+1]=O.y,f.array[t+2]=O.z,f.array[t+3]=O.w)}f.offset+=f.size}}}if(x||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,w,e);if(N||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,u,e);if(y)for(M in y)if(f=y[M],f.__original.needsUpdate||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,
-f.buffer),o.bufferData(o.ARRAY_BUFFER,f.array,e)}function e(b,e,c,f,k){f.program||X.initMaterial(f,e,c,k);if(f.morphTargets&&!k.__webglMorphTargetInfluences){k.__webglMorphTargetInfluences=new Float32Array(X.maxMorphTargets);for(var h=0,m=X.maxMorphTargets;h<m;h++)k.__webglMorphTargetInfluences[h]=0}var n=!1,h=f.program,m=h.uniforms,p=f.uniforms;h!=V&&(o.useProgram(h),V=h,n=!0);if(f.id!=aa)aa=f.id,n=!0;if(n){o.uniformMatrix4fv(m.projectionMatrix,!1,Ea);if(c&&f.fog)if(p.fogColor.value=c.color,c instanceof
-THREE.Fog)p.fogNear.value=c.near,p.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)p.fogDensity.value=c.density;if(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f.lights){for(var t,w,u=0,v=0,x=0,y,O,M,z=Ga,A=z.directional.colors,C=z.directional.positions,F=z.point.colors,D=z.point.positions,J=z.point.distances,ma=0,L=0,c=t=M=0,n=e.length;c<n;c++)if(t=e[c],w=t.color,y=t.position,O=t.intensity,M=t.distance,t instanceof THREE.AmbientLight)u+=w.r,v+=w.g,x+=w.b;else if(t instanceof
-THREE.DirectionalLight)M=ma*3,A[M]=w.r*O,A[M+1]=w.g*O,A[M+2]=w.b*O,C[M]=y.x,C[M+1]=y.y,C[M+2]=y.z,ma+=1;else if(t instanceof THREE.SpotLight)M=ma*3,A[M]=w.r*O,A[M+1]=w.g*O,A[M+2]=w.b*O,w=1/y.length(),C[M]=y.x*w,C[M+1]=y.y*w,C[M+2]=y.z*w,ma+=1;else if(t instanceof THREE.PointLight)t=L*3,F[t]=w.r*O,F[t+1]=w.g*O,F[t+2]=w.b*O,D[t]=y.x,D[t+1]=y.y,D[t+2]=y.z,J[L]=M,L+=1;c=ma*3;for(n=A.length;c<n;c++)A[c]=0;c=L*3;for(n=F.length;c<n;c++)F[c]=0;z.point.length=L;z.directional.length=ma;z.ambient[0]=u;z.ambient[1]=
-v;z.ambient[2]=x;e=Ga;p.enableLighting.value=e.directional.length+e.point.length;p.ambientLightColor.value=e.ambient;p.directionalLightColor.value=e.directional.colors;p.directionalLightDirection.value=e.directional.positions;p.pointLightColor.value=e.point.colors;p.pointLightPosition.value=e.point.positions;p.pointLightDistance.value=e.point.distances}if(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial)p.diffuse.value=f.color,p.opacity.value=
-f.opacity,(p.map.texture=f.map)&&p.offsetRepeat.value.set(f.map.offset.x,f.map.offset.y,f.map.repeat.x,f.map.repeat.y),p.lightMap.texture=f.lightMap,p.envMap.texture=f.envMap,p.reflectivity.value=f.reflectivity,p.refractionRatio.value=f.refractionRatio,p.combine.value=f.combine,p.useRefract.value=f.envMap&&f.envMap.mapping instanceof THREE.CubeRefractionMapping;if(f instanceof THREE.LineBasicMaterial)p.diffuse.value=f.color,p.opacity.value=f.opacity;else if(f instanceof THREE.ParticleBasicMaterial)p.psColor.value=
-f.color,p.opacity.value=f.opacity,p.size.value=f.size,p.scale.value=N.height/2,p.map.texture=f.map;else if(f instanceof THREE.MeshPhongMaterial)p.ambient.value=f.ambient,p.specular.value=f.specular,p.shininess.value=f.shininess;else if(f instanceof THREE.MeshDepthMaterial)p.mNear.value=b.near,p.mFar.value=b.far,p.opacity.value=f.opacity;else if(f instanceof THREE.MeshNormalMaterial)p.opacity.value=f.opacity;if(k.receiveShadow&&!f._shadowPass&&p.shadowMatrix){for(e=0;e<pa.length;e++)p.shadowMatrix.value[e]=
-pa[e],p.shadowMap.texture[e]=X.shadowMap[e];p.shadowDarkness.value=X.shadowMapDarkness;p.shadowBias.value=X.shadowMapBias}e=f.uniformsList;p=0;for(c=e.length;p<c;p++)if(v=h.uniforms[e[p][1]])if(u=e[p][0],x=u.type,n=u.value,x=="i")o.uniform1i(v,n);else if(x=="f")o.uniform1f(v,n);else if(x=="v2")o.uniform2f(v,n.x,n.y);else if(x=="v3")o.uniform3f(v,n.x,n.y,n.z);else if(x=="v4")o.uniform4f(v,n.x,n.y,n.z,n.w);else if(x=="c")o.uniform3f(v,n.r,n.g,n.b);else if(x=="fv1")o.uniform1fv(v,n);else if(x=="fv")o.uniform3fv(v,
-n);else if(x=="v3v"){if(!u._array)u._array=new Float32Array(3*n.length);x=0;for(y=n.length;x<y;x++)z=x*3,u._array[z]=n[x].x,u._array[z+1]=n[x].y,u._array[z+2]=n[x].z;o.uniform3fv(v,u._array)}else if(x=="m4"){if(!u._array)u._array=new Float32Array(16);n.flattenToArray(u._array);o.uniformMatrix4fv(v,!1,u._array)}else if(x=="m4v"){if(!u._array)u._array=new Float32Array(16*n.length);x=0;for(y=n.length;x<y;x++)n[x].flattenToArrayOffset(u._array,x*16);o.uniformMatrix4fv(v,!1,u._array)}else if(x=="t"){if(o.uniform1i(v,
-n),v=u.texture)if(v.image instanceof Array&&v.image.length==6){if(u=v,u.image.length==6)if(u.needsUpdate){if(!u.image.__webglTextureCube)u.image.__webglTextureCube=o.createTexture();o.activeTexture(o.TEXTURE0+n);o.bindTexture(o.TEXTURE_CUBE_MAP,u.image.__webglTextureCube);for(n=0;n<6;n++)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,u.image[n]);H(o.TEXTURE_CUBE_MAP,u,u.image[0]);u.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+n),o.bindTexture(o.TEXTURE_CUBE_MAP,u.image.__webglTextureCube)}else v instanceof
-THREE.WebGLRenderTargetCube?(u=v,o.activeTexture(o.TEXTURE0+n),o.bindTexture(o.TEXTURE_CUBE_MAP,u.__webglTexture)):G(v,n)}else if(x=="tv"){if(!u._array){u._array=[];x=0;for(y=u.texture.length;x<y;x++)u._array[x]=n+x}o.uniform1iv(v,u._array);x=0;for(y=u.texture.length;x<y;x++)(v=u.texture[x])&&G(v,u._array[x])}(f instanceof THREE.ShaderMaterial||f instanceof THREE.MeshPhongMaterial||f.envMap)&&m.cameraPosition!==null&&o.uniform3f(m.cameraPosition,b.position.x,b.position.y,b.position.z);(f instanceof
+THREE.WebGLRenderer=function(b){function c(b,e,c){var f,h,k,m=b.vertices,n=m.length,p=b.colors,t=p.length,w=b.__vertexArray,v=b.__colorArray,u=b.__sortArray,x=b.__dirtyVertices,N=b.__dirtyColors,y=b.__webglCustomAttributes,M,O;if(y)for(M in y)y[M].offset=0;if(c.sortParticles){Da.multiplySelf(c.matrixWorld);for(f=0;f<n;f++)h=m[f].position,Ba.copy(h),Da.multiplyVector3(Ba),u[f]=[Ba.z,f];u.sort(function(b,e){return e[0]-b[0]});for(f=0;f<n;f++)h=m[u[f][1]].position,k=f*3,w[k]=h.x,w[k+1]=h.y,w[k+2]=h.z;
+for(f=0;f<t;f++)k=f*3,color=p[u[f][1]],v[k]=color.r,v[k+1]=color.g,v[k+2]=color.b;if(y)for(M in y){f=y[M];p=f.value.length;for(k=0;k<p;k++){index=u[k][1];t=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[t]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")O=f.value[index];f.size===2?(f.array[t]=O.x,f.array[t+1]=O.y):f.size===3?f.type==="c"?(f.array[t]=O.r,f.array[t+1]=O.g,f.array[t+2]=O.b):(f.array[t]=O.x,f.array[t+1]=O.y,f.array[t+2]=O.z):(f.array[t]=
+O.x,f.array[t+1]=O.y,f.array[t+2]=O.z,f.array[t+3]=O.w)}f.offset+=f.size}}}else{if(x)for(f=0;f<n;f++)h=m[f].position,k=f*3,w[k]=h.x,w[k+1]=h.y,w[k+2]=h.z;if(N)for(f=0;f<t;f++)color=p[f],k=f*3,v[k]=color.r,v[k+1]=color.g,v[k+2]=color.b;if(y)for(M in y)if(f=y[M],f.__original.needsUpdate){p=f.value.length;for(k=0;k<p;k++){t=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[t]=f.value[k]}else{if(f.boundTo===void 0||f.boundTo==="vertices")O=f.value[k];f.size===2?(f.array[t]=
+O.x,f.array[t+1]=O.y):f.size===3?f.type==="c"?(f.array[t]=O.r,f.array[t+1]=O.g,f.array[t+2]=O.b):(f.array[t]=O.x,f.array[t+1]=O.y,f.array[t+2]=O.z):(f.array[t]=O.x,f.array[t+1]=O.y,f.array[t+2]=O.z,f.array[t+3]=O.w)}f.offset+=f.size}}}if(x||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,w,e);if(N||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,v,e);if(y)for(M in y)if(f=y[M],f.__original.needsUpdate||c.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,
+f.buffer),o.bufferData(o.ARRAY_BUFFER,f.array,e)}function e(b,e,c,f,k){f.program||X.initMaterial(f,e,c,k);if(f.morphTargets&&!k.__webglMorphTargetInfluences){k.__webglMorphTargetInfluences=new Float32Array(X.maxMorphTargets);for(var h=0,m=X.maxMorphTargets;h<m;h++)k.__webglMorphTargetInfluences[h]=0}var n=!1,h=f.program,m=h.uniforms,t=f.uniforms;h!=V&&(o.useProgram(h),V=h,n=!0);if(f.id!=aa)aa=f.id,n=!0;if(n){o.uniformMatrix4fv(m.projectionMatrix,!1,Fa);if(c&&f.fog)if(t.fogColor.value=c.color,c instanceof
+THREE.Fog)t.fogNear.value=c.near,t.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)t.fogDensity.value=c.density;if(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f.lights){for(var p,w,v=0,u=0,x=0,y,O,M,z=Ga,A=z.directional.colors,C=z.directional.positions,F=z.point.colors,D=z.point.positions,J=z.point.distances,ma=0,L=0,c=p=M=0,n=e.length;c<n;c++)if(p=e[c],w=p.color,y=p.position,O=p.intensity,M=p.distance,p instanceof THREE.AmbientLight)v+=w.r,u+=w.g,x+=w.b;else if(p instanceof
+THREE.DirectionalLight)M=ma*3,A[M]=w.r*O,A[M+1]=w.g*O,A[M+2]=w.b*O,C[M]=y.x,C[M+1]=y.y,C[M+2]=y.z,ma+=1;else if(p instanceof THREE.SpotLight)M=ma*3,A[M]=w.r*O,A[M+1]=w.g*O,A[M+2]=w.b*O,w=1/y.length(),C[M]=y.x*w,C[M+1]=y.y*w,C[M+2]=y.z*w,ma+=1;else if(p instanceof THREE.PointLight)p=L*3,F[p]=w.r*O,F[p+1]=w.g*O,F[p+2]=w.b*O,D[p]=y.x,D[p+1]=y.y,D[p+2]=y.z,J[L]=M,L+=1;c=ma*3;for(n=A.length;c<n;c++)A[c]=0;c=L*3;for(n=F.length;c<n;c++)F[c]=0;z.point.length=L;z.directional.length=ma;z.ambient[0]=v;z.ambient[1]=
+u;z.ambient[2]=x;e=Ga;t.enableLighting.value=e.directional.length+e.point.length;t.ambientLightColor.value=e.ambient;t.directionalLightColor.value=e.directional.colors;t.directionalLightDirection.value=e.directional.positions;t.pointLightColor.value=e.point.colors;t.pointLightPosition.value=e.point.positions;t.pointLightDistance.value=e.point.distances}if(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial)t.diffuse.value=f.color,t.opacity.value=
+f.opacity,(t.map.texture=f.map)&&t.offsetRepeat.value.set(f.map.offset.x,f.map.offset.y,f.map.repeat.x,f.map.repeat.y),t.lightMap.texture=f.lightMap,t.envMap.texture=f.envMap,t.reflectivity.value=f.reflectivity,t.refractionRatio.value=f.refractionRatio,t.combine.value=f.combine,t.useRefract.value=f.envMap&&f.envMap.mapping instanceof THREE.CubeRefractionMapping;if(f instanceof THREE.LineBasicMaterial)t.diffuse.value=f.color,t.opacity.value=f.opacity;else if(f instanceof THREE.ParticleBasicMaterial)t.psColor.value=
+f.color,t.opacity.value=f.opacity,t.size.value=f.size,t.scale.value=N.height/2,t.map.texture=f.map;else if(f instanceof THREE.MeshPhongMaterial)t.ambient.value=f.ambient,t.specular.value=f.specular,t.shininess.value=f.shininess;else if(f instanceof THREE.MeshDepthMaterial)t.mNear.value=b.near,t.mFar.value=b.far,t.opacity.value=f.opacity;else if(f instanceof THREE.MeshNormalMaterial)t.opacity.value=f.opacity;if(k.receiveShadow&&!f._shadowPass&&t.shadowMatrix){for(e=0;e<pa.length;e++)t.shadowMatrix.value[e]=
+pa[e],t.shadowMap.texture[e]=X.shadowMap[e];t.shadowDarkness.value=X.shadowMapDarkness;t.shadowBias.value=X.shadowMapBias}e=f.uniformsList;t=0;for(c=e.length;t<c;t++)if(u=h.uniforms[e[t][1]])if(v=e[t][0],x=v.type,n=v.value,x=="i")o.uniform1i(u,n);else if(x=="f")o.uniform1f(u,n);else if(x=="v2")o.uniform2f(u,n.x,n.y);else if(x=="v3")o.uniform3f(u,n.x,n.y,n.z);else if(x=="v4")o.uniform4f(u,n.x,n.y,n.z,n.w);else if(x=="c")o.uniform3f(u,n.r,n.g,n.b);else if(x=="fv1")o.uniform1fv(u,n);else if(x=="fv")o.uniform3fv(u,
+n);else if(x=="v3v"){if(!v._array)v._array=new Float32Array(3*n.length);x=0;for(y=n.length;x<y;x++)z=x*3,v._array[z]=n[x].x,v._array[z+1]=n[x].y,v._array[z+2]=n[x].z;o.uniform3fv(u,v._array)}else if(x=="m4"){if(!v._array)v._array=new Float32Array(16);n.flattenToArray(v._array);o.uniformMatrix4fv(u,!1,v._array)}else if(x=="m4v"){if(!v._array)v._array=new Float32Array(16*n.length);x=0;for(y=n.length;x<y;x++)n[x].flattenToArrayOffset(v._array,x*16);o.uniformMatrix4fv(u,!1,v._array)}else if(x=="t"){if(o.uniform1i(u,
+n),u=v.texture)if(u.image instanceof Array&&u.image.length==6){if(v=u,v.image.length==6)if(v.needsUpdate){if(!v.image.__webglTextureCube)v.image.__webglTextureCube=o.createTexture();o.activeTexture(o.TEXTURE0+n);o.bindTexture(o.TEXTURE_CUBE_MAP,v.image.__webglTextureCube);for(n=0;n<6;n++)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,v.image[n]);H(o.TEXTURE_CUBE_MAP,v,v.image[0]);v.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+n),o.bindTexture(o.TEXTURE_CUBE_MAP,v.image.__webglTextureCube)}else u instanceof
+THREE.WebGLRenderTargetCube?(v=u,o.activeTexture(o.TEXTURE0+n),o.bindTexture(o.TEXTURE_CUBE_MAP,v.__webglTexture)):G(u,n)}else if(x=="tv"){if(!v._array){v._array=[];x=0;for(y=v.texture.length;x<y;x++)v._array[x]=n+x}o.uniform1iv(u,v._array);x=0;for(y=v.texture.length;x<y;x++)(u=v.texture[x])&&G(u,v._array[x])}(f instanceof THREE.ShaderMaterial||f instanceof THREE.MeshPhongMaterial||f.envMap)&&m.cameraPosition!==null&&o.uniform3f(m.cameraPosition,b.position.x,b.position.y,b.position.z);(f instanceof
 THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.ShaderMaterial||f.skinning)&&m.viewMatrix!==null&&o.uniformMatrix4fv(m.viewMatrix,!1,za);f.skinning&&(o.uniformMatrix4fv(m.cameraInverseMatrix,!1,za),o.uniformMatrix4fv(m.boneGlobalMatrices,!1,k.boneMatrices))}o.uniformMatrix4fv(m.modelViewMatrix,!1,k._modelViewMatrixArray);m.normalMatrix&&o.uniformMatrix3fv(m.normalMatrix,!1,k._normalMatrixArray);(f instanceof THREE.ShaderMaterial||f.envMap||f.skinning||k.receiveShadow)&&
 m.objectMatrix!==null&&o.uniformMatrix4fv(m.objectMatrix,!1,k._objectMatrixArray);return h}function f(b,c,f,k,h,m){if(k.opacity!=0){var n,f=e(b,c,f,k,m),b=f.attributes,c=!1,f=h.id*16777215+f.id;f!=ia&&(ia=f,c=!0);if(!k.morphTargets&&b.position>=0)c&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(b.position,3,o.FLOAT,!1,0,0));else if(m.morphTargetBase){f=k.program.attributes;m.morphTargetBase!==-1?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[m.morphTargetBase]),
-o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0)):f.position>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var p=0,t=m.morphTargetForcedOrder,w=m.morphTargetInfluences;p<k.numSupportedMorphTargets&&p<t.length;)o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[t[p]]),o.vertexAttribPointer(f["morphTarget"+p],3,o.FLOAT,!1,0,0),m.__webglMorphTargetInfluences[p]=w[t[p]],p++;else{var t=[],u=-1,
-v=0,w=m.morphTargetInfluences,x,N=w.length,p=0;for(m.morphTargetBase!==-1&&(t[m.morphTargetBase]=!0);p<k.numSupportedMorphTargets;){for(x=0;x<N;x++)!t[x]&&w[x]>u&&(v=x,u=w[v]);o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[v]);o.vertexAttribPointer(f["morphTarget"+p],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[p]=u;t[v]=1;u=-1;p++}}k.program.uniforms.morphTargetInfluences!==null&&o.uniform1fv(k.program.uniforms.morphTargetInfluences,m.__webglMorphTargetInfluences)}if(c){if(h.__webglCustomAttributes)for(n in h.__webglCustomAttributes)b[n]>=
+o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0)):f.position>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var t=0,p=m.morphTargetForcedOrder,v=m.morphTargetInfluences;t<k.numSupportedMorphTargets&&t<p.length;)o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[p[t]]),o.vertexAttribPointer(f["morphTarget"+t],3,o.FLOAT,!1,0,0),m.__webglMorphTargetInfluences[t]=v[p[t]],t++;else{var p=[],w=-1,
+u=0,v=m.morphTargetInfluences,x,N=v.length,t=0;for(m.morphTargetBase!==-1&&(p[m.morphTargetBase]=!0);t<k.numSupportedMorphTargets;){for(x=0;x<N;x++)!p[x]&&v[x]>w&&(u=x,w=v[u]);o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[u]);o.vertexAttribPointer(f["morphTarget"+t],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[t]=w;p[u]=1;w=-1;t++}}k.program.uniforms.morphTargetInfluences!==null&&o.uniform1fv(k.program.uniforms.morphTargetInfluences,m.__webglMorphTargetInfluences)}if(c){if(h.__webglCustomAttributes)for(n in h.__webglCustomAttributes)b[n]>=
 0&&(f=h.__webglCustomAttributes[n],o.bindBuffer(o.ARRAY_BUFFER,f.buffer),o.vertexAttribPointer(b[n],f.size,o.FLOAT,!1,0,0));b.color>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglColorBuffer),o.vertexAttribPointer(b.color,3,o.FLOAT,!1,0,0));b.normal>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglNormalBuffer),o.vertexAttribPointer(b.normal,3,o.FLOAT,!1,0,0));b.tangent>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglTangentBuffer),o.vertexAttribPointer(b.tangent,4,o.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(o.bindBuffer(o.ARRAY_BUFFER,
 h.__webglUVBuffer),o.vertexAttribPointer(b.uv,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv)):o.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglUV2Buffer),o.vertexAttribPointer(b.uv2,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv2)):o.disableVertexAttribArray(b.uv2));k.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinVertexABuffer),o.vertexAttribPointer(b.skinVertexA,4,
 o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),o.vertexAttribPointer(b.skinVertexB,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),o.vertexAttribPointer(b.skinIndex,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),o.vertexAttribPointer(b.skinWeight,4,o.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(k.wireframe?(o.lineWidth(k.wireframeLinewidth),c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),o.drawElements(o.LINES,h.__webglLineCount,
 o.UNSIGNED_SHORT,0)):(c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),o.drawElements(o.TRIANGLES,h.__webglFaceCount,o.UNSIGNED_SHORT,0)),X.info.render.calls++,X.info.render.vertices+=h.__webglFaceCount,X.info.render.faces+=h.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?o.LINE_STRIP:o.LINES,o.lineWidth(k.linewidth),o.drawArrays(m,0,h.__webglLineCount),X.info.render.calls++):m instanceof THREE.ParticleSystem?(o.drawArrays(o.POINTS,0,h.__webglParticleCount),X.info.render.calls++):
-m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP,0,h.__webglVertexCount),X.info.render.calls++)}}function h(b,e,c){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=o.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=o.createBuffer();b.hasPos&&(o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,b.positionArray,o.DYNAMIC_DRAW),o.enableVertexAttribArray(e.attributes.position),o.vertexAttribPointer(e.attributes.position,3,o.FLOAT,!1,0,0));if(b.hasNormal){o.bindBuffer(o.ARRAY_BUFFER,
-b.__webglNormalBuffer);if(c==THREE.FlatShading){var f,h,k,m,n,p,t,w,u,v,x=b.count*3;for(v=0;v<x;v+=9)c=b.normalArray,f=c[v],h=c[v+1],k=c[v+2],m=c[v+3],p=c[v+4],w=c[v+5],n=c[v+6],t=c[v+7],u=c[v+8],f=(f+m+n)/3,h=(h+p+t)/3,k=(k+w+u)/3,c[v]=f,c[v+1]=h,c[v+2]=k,c[v+3]=f,c[v+4]=h,c[v+5]=k,c[v+6]=f,c[v+7]=h,c[v+8]=k}o.bufferData(o.ARRAY_BUFFER,b.normalArray,o.DYNAMIC_DRAW);o.enableVertexAttribArray(e.attributes.normal);o.vertexAttribPointer(e.attributes.normal,3,o.FLOAT,!1,0,0)}o.drawArrays(o.TRIANGLES,
-0,b.count);b.count=0}function m(b){if(ja!=b.doubleSided)b.doubleSided?o.disable(o.CULL_FACE):o.enable(o.CULL_FACE),ja=b.doubleSided;if(fa!=b.flipSided)b.flipSided?o.frontFace(o.CW):o.frontFace(o.CCW),fa=b.flipSided}function k(b){U!=b&&(b?o.enable(o.DEPTH_TEST):o.disable(o.DEPTH_TEST),U=b)}function n(b){Z!=b&&(o.depthMask(b),Z=b)}function u(b,e,c){ga!=b&&(b?o.enable(o.POLYGON_OFFSET_FILL):o.disable(o.POLYGON_OFFSET_FILL),ga=b);if(b&&(ka!=e||ta!=c))o.polygonOffset(e,c),ka=e,ta=c}function p(b){ua[0].set(b.n41-
-b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);ua[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);ua[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);ua[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);ua[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);ua[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34);for(var e,b=0;b<6;b++)e=ua[b],e.divideScalar(Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z))}function v(b){for(var e=b.matrixWorld,c=-b.geometry.boundingSphere.radius*Math.max(b.scale.x,
-Math.max(b.scale.y,b.scale.z)),f=0;f<6;f++)if(b=ua[f].x*e.n14+ua[f].y*e.n24+ua[f].z*e.n34+ua[f].w,b<=c)return!1;return!0}function t(b,e){b.list[b.count]=e;b.count+=1}function x(b){var e,c,f=b.object,h=b.opaque,k=b.transparent;k.count=0;b=h.count=0;for(e=f.materials.length;b<e;b++)c=f.materials[b],c.transparent?t(k,c):t(h,c)}function w(b){var e,c,f,h,k=b.object,m=b.buffer,n=b.opaque,o=b.transparent;o.count=0;b=n.count=0;for(f=k.materials.length;b<f;b++)if(e=k.materials[b],e instanceof THREE.MeshFaceMaterial){e=
-0;for(c=m.materials.length;e<c;e++)(h=m.materials[e])&&(h.transparent?t(o,h):t(n,h))}else(h=e)&&(h.transparent?t(o,h):t(n,h))}function y(b,e){return e.z-b.z}function z(b){var c,n,t,w=0,u,x,N,y,M=b.lights;if(!va)va=new THREE.Camera(X.shadowCameraFov,X.shadowMapWidth/X.shadowMapHeight,X.shadowCameraNear,X.shadowCameraFar),va.useTarget=!0;c=0;for(n=M.length;c<n;c++)if(t=M[c],t instanceof THREE.SpotLight&&t.castShadow){aa=-1;X.shadowMap[w]||(X.shadowMap[w]=new THREE.WebGLRenderTarget(X.shadowMapWidth,
-X.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));pa[w]||(pa[w]=new THREE.Matrix4);u=X.shadowMap[w];x=pa[w];va.position.copy(t.position);va.target.position.copy(t.target.position);va.update(void 0,!0);b.update(void 0,!1,va);x.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);x.multiplySelf(va.projectionMatrix);x.multiplySelf(va.matrixWorldInverse);va.matrixWorldInverse.flattenToArray(za);va.projectionMatrix.flattenToArray(Ea);Ca.multiply(va.projectionMatrix,
-va.matrixWorldInverse);p(Ca);X.initWebGLObjects(b);Y(u);o.clearColor(1,1,1,1);X.clear();o.clearColor(ha.r,ha.g,ha.b,oa);x=b.__webglObjects.length;t=b.__webglObjectsImmediate.length;for(u=0;u<x;u++)N=b.__webglObjects[u],y=N.object,y.visible&&y.castShadow?!(y instanceof THREE.Mesh)||!y.frustumCulled||v(y)?(y.matrixWorld.flattenToArray(y._objectMatrixArray),A(y,va,!1),N.render=!0):N.render=!1:N.render=!1;k(!0);I(THREE.NormalBlending);for(u=0;u<x;u++)if(N=b.__webglObjects[u],N.render)y=N.object,buffer=
-N.buffer,m(y),N=y.customDepthMaterial?y.customDepthMaterial:y.geometry.morphTargets.length?Ka:Da,f(va,M,null,N,buffer,y);for(u=0;u<t;u++)N=b.__webglObjectsImmediate[u],y=N.object,y.visible&&y.castShadow&&(y.matrixAutoUpdate&&y.matrixWorld.flattenToArray(y._objectMatrixArray),A(y,va,!1),m(y),program=e(va,M,null,Da,y),y.immediateRenderCallback?y.immediateRenderCallback(program,o,ua):y.render(function(b){h(b,program,Da.shading)}));w++}}function C(b,e){var c,f,h;c=$.attributes;var k=$.uniforms,m=ra/qa,
-n,p=[],t=qa*0.5,w=ra*0.5,u=!0;o.useProgram($.program);V=$.program;ia=U=da=-1;Ja||(o.enableVertexAttribArray($.attributes.position),o.enableVertexAttribArray($.attributes.uv),Ja=!0);o.disable(o.CULL_FACE);o.enable(o.BLEND);o.depthMask(!0);o.bindBuffer(o.ARRAY_BUFFER,$.vertexBuffer);o.vertexAttribPointer(c.position,2,o.FLOAT,!1,16,0);o.vertexAttribPointer(c.uv,2,o.FLOAT,!1,16,8);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,$.elementBuffer);o.uniformMatrix4fv(k.projectionMatrix,!1,Ea);o.activeTexture(o.TEXTURE0);
+m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP,0,h.__webglVertexCount),X.info.render.calls++)}}function k(b,e,c){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=o.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=o.createBuffer();b.hasPos&&(o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,b.positionArray,o.DYNAMIC_DRAW),o.enableVertexAttribArray(e.attributes.position),o.vertexAttribPointer(e.attributes.position,3,o.FLOAT,!1,0,0));if(b.hasNormal){o.bindBuffer(o.ARRAY_BUFFER,
+b.__webglNormalBuffer);if(c==THREE.FlatShading){var f,h,k,m,n,t,p,v,w,u,x=b.count*3;for(u=0;u<x;u+=9)c=b.normalArray,f=c[u],h=c[u+1],k=c[u+2],m=c[u+3],t=c[u+4],v=c[u+5],n=c[u+6],p=c[u+7],w=c[u+8],f=(f+m+n)/3,h=(h+t+p)/3,k=(k+v+w)/3,c[u]=f,c[u+1]=h,c[u+2]=k,c[u+3]=f,c[u+4]=h,c[u+5]=k,c[u+6]=f,c[u+7]=h,c[u+8]=k}o.bufferData(o.ARRAY_BUFFER,b.normalArray,o.DYNAMIC_DRAW);o.enableVertexAttribArray(e.attributes.normal);o.vertexAttribPointer(e.attributes.normal,3,o.FLOAT,!1,0,0)}o.drawArrays(o.TRIANGLES,
+0,b.count);b.count=0}function m(b){if(ja!=b.doubleSided)b.doubleSided?o.disable(o.CULL_FACE):o.enable(o.CULL_FACE),ja=b.doubleSided;if(fa!=b.flipSided)b.flipSided?o.frontFace(o.CW):o.frontFace(o.CCW),fa=b.flipSided}function h(b){U!=b&&(b?o.enable(o.DEPTH_TEST):o.disable(o.DEPTH_TEST),U=b)}function n(b){Z!=b&&(o.depthMask(b),Z=b)}function p(b,e,c){ga!=b&&(b?o.enable(o.POLYGON_OFFSET_FILL):o.disable(o.POLYGON_OFFSET_FILL),ga=b);if(b&&(ka!=e||ta!=c))o.polygonOffset(e,c),ka=e,ta=c}function t(b){ua[0].set(b.n41-
+b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);ua[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);ua[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);ua[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);ua[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);ua[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34);for(var e,b=0;b<6;b++)e=ua[b],e.divideScalar(Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z))}function u(b){for(var e=b.matrixWorld,c=-b.geometry.boundingSphere.radius*Math.max(b.scale.x,
+Math.max(b.scale.y,b.scale.z)),f=0;f<6;f++)if(b=ua[f].x*e.n14+ua[f].y*e.n24+ua[f].z*e.n34+ua[f].w,b<=c)return!1;return!0}function w(b,e){b.list[b.count]=e;b.count+=1}function x(b){var e,c,f=b.object,h=b.opaque,k=b.transparent;k.count=0;b=h.count=0;for(e=f.materials.length;b<e;b++)c=f.materials[b],c.transparent?w(k,c):w(h,c)}function v(b){var e,c,f,h,k=b.object,m=b.buffer,n=b.opaque,o=b.transparent;o.count=0;b=n.count=0;for(f=k.materials.length;b<f;b++)if(e=k.materials[b],e instanceof THREE.MeshFaceMaterial){e=
+0;for(c=m.materials.length;e<c;e++)(h=m.materials[e])&&(h.transparent?w(o,h):w(n,h))}else(h=e)&&(h.transparent?w(o,h):w(n,h))}function y(b,e){return e.z-b.z}function z(b){var c,n,p,v=0,w,x,N,y,M=b.lights;if(!va)va=new THREE.Camera(X.shadowCameraFov,X.shadowMapWidth/X.shadowMapHeight,X.shadowCameraNear,X.shadowCameraFar),va.useTarget=!0;c=0;for(n=M.length;c<n;c++)if(p=M[c],p instanceof THREE.SpotLight&&p.castShadow){aa=-1;X.shadowMap[v]||(X.shadowMap[v]=new THREE.WebGLRenderTarget(X.shadowMapWidth,
+X.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));pa[v]||(pa[v]=new THREE.Matrix4);w=X.shadowMap[v];x=pa[v];va.position.copy(p.position);va.target.position.copy(p.target.position);va.update(void 0,!0);b.update(void 0,!1,va);x.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);x.multiplySelf(va.projectionMatrix);x.multiplySelf(va.matrixWorldInverse);va.matrixWorldInverse.flattenToArray(za);va.projectionMatrix.flattenToArray(Fa);Da.multiply(va.projectionMatrix,
+va.matrixWorldInverse);t(Da);X.initWebGLObjects(b);Y(w);o.clearColor(1,1,1,1);X.clear();o.clearColor(ha.r,ha.g,ha.b,oa);x=b.__webglObjects.length;p=b.__webglObjectsImmediate.length;for(w=0;w<x;w++)N=b.__webglObjects[w],y=N.object,y.visible&&y.castShadow?!(y instanceof THREE.Mesh)||!y.frustumCulled||u(y)?(y.matrixWorld.flattenToArray(y._objectMatrixArray),A(y,va,!1),N.render=!0):N.render=!1:N.render=!1;h(!0);I(THREE.NormalBlending);for(w=0;w<x;w++)if(N=b.__webglObjects[w],N.render)y=N.object,buffer=
+N.buffer,m(y),N=y.customDepthMaterial?y.customDepthMaterial:y.geometry.morphTargets.length?Ka:Ea,f(va,M,null,N,buffer,y);for(w=0;w<p;w++)N=b.__webglObjectsImmediate[w],y=N.object,y.visible&&y.castShadow&&(y.matrixAutoUpdate&&y.matrixWorld.flattenToArray(y._objectMatrixArray),A(y,va,!1),m(y),program=e(va,M,null,Ea,y),y.immediateRenderCallback?y.immediateRenderCallback(program,o,ua):y.render(function(b){k(b,program,Ea.shading)}));v++}}function C(b,e){var c,f,h;c=$.attributes;var k=$.uniforms,m=ra/qa,
+n,t=[],p=qa*0.5,v=ra*0.5,w=!0;o.useProgram($.program);V=$.program;ia=U=da=-1;Ja||(o.enableVertexAttribArray($.attributes.position),o.enableVertexAttribArray($.attributes.uv),Ja=!0);o.disable(o.CULL_FACE);o.enable(o.BLEND);o.depthMask(!0);o.bindBuffer(o.ARRAY_BUFFER,$.vertexBuffer);o.vertexAttribPointer(c.position,2,o.FLOAT,!1,16,0);o.vertexAttribPointer(c.uv,2,o.FLOAT,!1,16,8);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,$.elementBuffer);o.uniformMatrix4fv(k.projectionMatrix,!1,Fa);o.activeTexture(o.TEXTURE0);
 o.uniform1i(k.map,0);c=0;for(f=b.__webglSprites.length;c<f;c++)if(h=b.__webglSprites[c],h.visible&&h.opacity!=0)h.useScreenCoordinates?h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(y);c=0;for(f=b.__webglSprites.length;c<f;c++)h=b.__webglSprites[c],h.visible&&h.opacity!=0&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(o.uniform1i(k.useScreenCoordinates,1),o.uniform3f(k.screenPosition,
-(h.position.x-t)/t,(w-h.position.y)/w,Math.max(0,Math.min(1,h.position.z)))):(o.uniform1i(k.useScreenCoordinates,0),o.uniform1i(k.affectedByDistance,h.affectedByDistance?1:0),o.uniformMatrix4fv(k.modelViewMatrix,!1,h._modelViewMatrixArray)),n=h.map.image.width/(h.scaleByViewport?ra:1),p[0]=n*m*h.scale.x,p[1]=n*h.scale.y,o.uniform2f(k.uvScale,h.uvScale.x,h.uvScale.y),o.uniform2f(k.uvOffset,h.uvOffset.x,h.uvOffset.y),o.uniform2f(k.alignment,h.alignment.x,h.alignment.y),o.uniform1f(k.opacity,h.opacity),
-o.uniform3f(k.color,h.color.r,h.color.g,h.color.b),o.uniform1f(k.rotation,h.rotation),o.uniform2fv(k.scale,p),h.mergeWith3D&&!u?(o.enable(o.DEPTH_TEST),u=!0):!h.mergeWith3D&&u&&(o.disable(o.DEPTH_TEST),u=!1),I(h.blending),G(h.map,0),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0));o.enable(o.CULL_FACE);o.enable(o.DEPTH_TEST);o.depthMask(Z)}function A(b,e,c){b._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);c&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}
+(h.position.x-p)/p,(v-h.position.y)/v,Math.max(0,Math.min(1,h.position.z)))):(o.uniform1i(k.useScreenCoordinates,0),o.uniform1i(k.affectedByDistance,h.affectedByDistance?1:0),o.uniformMatrix4fv(k.modelViewMatrix,!1,h._modelViewMatrixArray)),n=h.map.image.width/(h.scaleByViewport?ra:1),t[0]=n*m*h.scale.x,t[1]=n*h.scale.y,o.uniform2f(k.uvScale,h.uvScale.x,h.uvScale.y),o.uniform2f(k.uvOffset,h.uvOffset.x,h.uvOffset.y),o.uniform2f(k.alignment,h.alignment.x,h.alignment.y),o.uniform1f(k.opacity,h.opacity),
+o.uniform3f(k.color,h.color.r,h.color.g,h.color.b),o.uniform1f(k.rotation,h.rotation),o.uniform2fv(k.scale,t),h.mergeWith3D&&!w?(o.enable(o.DEPTH_TEST),w=!0):!h.mergeWith3D&&w&&(o.disable(o.DEPTH_TEST),w=!1),I(h.blending),G(h.map,0),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0));o.enable(o.CULL_FACE);o.enable(o.DEPTH_TEST);o.depthMask(Z)}function A(b,e,c){b._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);c&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}
 function F(b){var e,c,f,h;h=b.__materials;b=0;for(c=h.length;b<c;b++)if(f=h[b],f.attributes)for(e in f.attributes)if(f.attributes[e].needsUpdate)return!0;return!1}function D(b){var e,c,f,h;h=b.__materials;b=0;for(c=h.length;b<c;b++)if(f=h[b],f.attributes)for(e in f.attributes)f.attributes[e].needsUpdate=!1}function J(b,e){var c;for(c=b.length-1;c>=0;c--)b[c].object==e&&b.splice(c,1)}function P(b){function e(b){var h=[];c=0;for(f=b.length;c<f;c++)b[c]==void 0?h.push("undefined"):h.push(b[c].id);return h.join("_")}
-var c,f,h,k,m,n,o,p,t={},w=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};h=0;for(k=b.faces.length;h<k;h++)m=b.faces[h],n=m.materials,o=e(n),t[o]==void 0&&(t[o]={hash:o,counter:0}),p=t[o].hash+"_"+t[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[],materials:n,vertices:0,numMorphTargets:w}),m=m instanceof THREE.Face3?3:4,b.geometryGroups[p].vertices+m>65535&&(t[o].counter+=1,p=t[o].hash+"_"+t[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[],
-materials:n,vertices:0,numMorphTargets:w})),b.geometryGroups[p].faces.push(h),b.geometryGroups[p].vertices+=m;b.geometryGroupsList=[];for(var u in b.geometryGroups)b.geometryGroups[u].id=ca++,b.geometryGroupsList.push(b.geometryGroups[u])}function S(b,e,c){b.push({buffer:e,object:c,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function I(b){if(b!=da){switch(b){case THREE.AdditiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE);break;case THREE.SubtractiveBlending:o.blendEquation(o.FUNC_ADD);
+var c,f,h,k,m,n,o,t,p={},v=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};h=0;for(k=b.faces.length;h<k;h++)m=b.faces[h],n=m.materials,o=e(n),p[o]==void 0&&(p[o]={hash:o,counter:0}),t=p[o].hash+"_"+p[o].counter,b.geometryGroups[t]==void 0&&(b.geometryGroups[t]={faces:[],materials:n,vertices:0,numMorphTargets:v}),m=m instanceof THREE.Face3?3:4,b.geometryGroups[t].vertices+m>65535&&(p[o].counter+=1,t=p[o].hash+"_"+p[o].counter,b.geometryGroups[t]==void 0&&(b.geometryGroups[t]={faces:[],
+materials:n,vertices:0,numMorphTargets:v})),b.geometryGroups[t].faces.push(h),b.geometryGroups[t].vertices+=m;b.geometryGroupsList=[];for(var w in b.geometryGroups)b.geometryGroups[w].id=ca++,b.geometryGroupsList.push(b.geometryGroups[w])}function S(b,e,c){b.push({buffer:e,object:c,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function I(b){if(b!=da){switch(b){case THREE.AdditiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE);break;case THREE.SubtractiveBlending:o.blendEquation(o.FUNC_ADD);
 o.blendFunc(o.ZERO,o.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,o.SRC_COLOR);break;default:o.blendEquationSeparate(o.FUNC_ADD,o.FUNC_ADD),o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA)}da=b}}function H(b,e,c){(c.width&c.width-1)==0&&(c.height&c.height-1)==0?(o.texParameteri(b,o.TEXTURE_WRAP_S,W(e.wrapS)),o.texParameteri(b,o.TEXTURE_WRAP_T,W(e.wrapT)),o.texParameteri(b,o.TEXTURE_MAG_FILTER,W(e.magFilter)),
 o.texParameteri(b,o.TEXTURE_MIN_FILTER,W(e.minFilter)),o.generateMipmap(b)):(o.texParameteri(b,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_MAG_FILTER,R(e.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,R(e.minFilter)))}function G(b,e){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=o.createTexture(),X.info.memory.textures++;o.activeTexture(o.TEXTURE0+e);o.bindTexture(o.TEXTURE_2D,b.__webglTexture);b instanceof
 THREE.DataTexture?o.texImage2D(o.TEXTURE_2D,0,W(b.format),b.image.width,b.image.height,0,W(b.format),o.UNSIGNED_BYTE,b.image.data):o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,b.image);H(o.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+e),o.bindTexture(o.TEXTURE_2D,b.__webglTexture)}function Y(b){var e=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;
@@ -269,10 +269,10 @@ null);o.bindFramebuffer(o.FRAMEBUFFER,null)}var f,h;b?(e=e?b.__webglFramebuffer[
 o.bindTexture(o.TEXTURE_2D,null))}function Q(b,e){var c;b=="fragment"?c=o.createShader(o.FRAGMENT_SHADER):b=="vertex"&&(c=o.createShader(o.VERTEX_SHADER));o.shaderSource(c,e);o.compileShader(c);if(!o.getShaderParameter(c,o.COMPILE_STATUS))return console.error(o.getShaderInfoLog(c)),console.error(e),null;return c}function R(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return o.NEAREST;default:return o.LINEAR}}function W(b){switch(b){case THREE.RepeatWrapping:return o.REPEAT;
 case THREE.ClampToEdgeWrapping:return o.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return o.MIRRORED_REPEAT;case THREE.NearestFilter:return o.NEAREST;case THREE.NearestMipMapNearestFilter:return o.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return o.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return o.LINEAR;case THREE.LinearMipMapNearestFilter:return o.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return o.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return o.BYTE;
 case THREE.UnsignedByteType:return o.UNSIGNED_BYTE;case THREE.ShortType:return o.SHORT;case THREE.UnsignedShortType:return o.UNSIGNED_SHORT;case THREE.IntType:return o.INT;case THREE.UnsignedShortType:return o.UNSIGNED_INT;case THREE.FloatType:return o.FLOAT;case THREE.AlphaFormat:return o.ALPHA;case THREE.RGBFormat:return o.RGB;case THREE.RGBAFormat:return o.RGBA;case THREE.LuminanceFormat:return o.LUMINANCE;case THREE.LuminanceAlphaFormat:return o.LUMINANCE_ALPHA}return 0}var X=this,o,ea=[],V=null,
-la=null,aa=-1,ia=null,ca=0,ja=null,fa=null,da=null,U=null,Z=null,ga=null,ka=null,ta=null,ma=0,na=0,qa=0,ra=0,ua=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Ea=new Float32Array(16),za=new Float32Array(16),Ba=new THREE.Vector4,Ga={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},N=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
+la=null,aa=-1,ia=null,ca=0,ja=null,fa=null,da=null,U=null,Z=null,ga=null,ka=null,ta=null,ma=0,na=0,qa=0,ra=0,ua=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Da=new THREE.Matrix4,Fa=new Float32Array(16),za=new Float32Array(16),Ba=new THREE.Vector4,Ga={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},N=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
 O=b.stencil!==void 0?b.stencil:!0,M=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,L=b.antialias!==void 0?b.antialias:!1,ha=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),oa=b.clearAlpha!==void 0?b.clearAlpha:0,xa=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=N;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=
-!0;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=!0;var va,pa=[],b=THREE.ShaderLib.depthRGBA,wa=THREE.UniformsUtils.clone(b.uniforms),Da=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:wa}),Ka=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,
-uniforms:wa,morphTargets:!0});Da._shadowPass=!0;Ka._shadowPass=!0;try{if(!(o=N.getContext("experimental-webgl",{antialias:L,stencil:O,preserveDrawingBuffer:M})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+o.getParameter(o.VERSION)+" | "+o.getParameter(o.VENDOR)+" | "+o.getParameter(o.RENDERER)+" | "+o.getParameter(o.SHADING_LANGUAGE_VERSION))}catch(Aa){console.error(Aa)}o.clearColor(0,0,0,1);o.clearDepth(1);o.clearStencil(0);o.enable(o.DEPTH_TEST);o.depthFunc(o.LEQUAL);
+!0;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=!0;var va,pa=[],b=THREE.ShaderLib.depthRGBA,wa=THREE.UniformsUtils.clone(b.uniforms),Ea=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:wa}),Ka=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,
+uniforms:wa,morphTargets:!0});Ea._shadowPass=!0;Ka._shadowPass=!0;try{if(!(o=N.getContext("experimental-webgl",{antialias:L,stencil:O,preserveDrawingBuffer:M})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+o.getParameter(o.VERSION)+" | "+o.getParameter(o.VENDOR)+" | "+o.getParameter(o.RENDERER)+" | "+o.getParameter(o.SHADING_LANGUAGE_VERSION))}catch(Aa){console.error(Aa)}o.clearColor(0,0,0,1);o.clearDepth(1);o.clearStencil(0);o.enable(o.DEPTH_TEST);o.depthFunc(o.LEQUAL);
 o.frontFace(o.CCW);o.cullFace(o.BACK);o.enable(o.CULL_FACE);o.enable(o.BLEND);o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA);o.clearColor(ha.r,ha.g,ha.b,oa);this.context=o;var Ha=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,$={};$.vertices=new Float32Array(16);$.faces=new Uint16Array(6);O=0;$.vertices[O++]=-1;$.vertices[O++]=-1;$.vertices[O++]=0;$.vertices[O++]=1;$.vertices[O++]=1;$.vertices[O++]=-1;$.vertices[O++]=1;$.vertices[O++]=1;$.vertices[O++]=1;$.vertices[O++]=
 1;$.vertices[O++]=1;$.vertices[O++]=0;$.vertices[O++]=-1;$.vertices[O++]=1;$.vertices[O++]=0;O=$.vertices[O++]=0;$.faces[O++]=0;$.faces[O++]=1;$.faces[O++]=2;$.faces[O++]=0;$.faces[O++]=2;$.faces[O++]=3;$.vertexBuffer=o.createBuffer();$.elementBuffer=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,$.vertexBuffer);o.bufferData(o.ARRAY_BUFFER,$.vertices,o.STATIC_DRAW);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,$.elementBuffer);o.bufferData(o.ELEMENT_ARRAY_BUFFER,$.faces,o.STATIC_DRAW);$.program=o.createProgram();
 o.attachShader($.program,Q("fragment",THREE.ShaderLib.sprite.fragmentShader));o.attachShader($.program,Q("vertex",THREE.ShaderLib.sprite.vertexShader));o.linkProgram($.program);$.attributes={};$.uniforms={};$.attributes.position=o.getAttribLocation($.program,"position");$.attributes.uv=o.getAttribLocation($.program,"uv");$.uniforms.uvOffset=o.getUniformLocation($.program,"uvOffset");$.uniforms.uvScale=o.getUniformLocation($.program,"uvScale");$.uniforms.rotation=o.getUniformLocation($.program,"rotation");
@@ -282,59 +282,59 @@ function(b,e){ha.setHex(b);oa=e;o.clearColor(ha.r,ha.g,ha.b,oa)};this.setClearCo
 delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var e=b.geometry.geometryGroups[g];o.deleteBuffer(e.__webglVertexBuffer);o.deleteBuffer(e.__webglNormalBuffer);o.deleteBuffer(e.__webglTangentBuffer);o.deleteBuffer(e.__webglColorBuffer);o.deleteBuffer(e.__webglUVBuffer);o.deleteBuffer(e.__webglUV2Buffer);o.deleteBuffer(e.__webglSkinVertexABuffer);o.deleteBuffer(e.__webglSkinVertexBBuffer);o.deleteBuffer(e.__webglSkinIndicesBuffer);
 o.deleteBuffer(e.__webglSkinWeightsBuffer);o.deleteBuffer(e.__webglFaceBuffer);o.deleteBuffer(e.__webglLineBuffer);if(e.numMorphTargets)for(var c=0,f=e.numMorphTargets;c<f;c++)o.deleteBuffer(e.__webglMorphTargetsBuffers[c]);X.info.memory.geometries--}else if(b instanceof THREE.Ribbon)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),X.info.memory.geometries--;else if(b instanceof THREE.Line)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),
 X.info.memory.geometries--;else if(b instanceof THREE.ParticleSystem)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),X.info.memory.geometries--};this.deallocateTexture=function(b){if(b.__webglInit)b.__webglInit=!1,o.deleteTexture(b.__webglTexture),X.info.memory.textures--};this.initMaterial=function(b,e,c,f){var h,k,m,n;b instanceof THREE.MeshDepthMaterial?n="depth":b instanceof THREE.MeshNormalMaterial?n="normal":b instanceof THREE.MeshBasicMaterial?n="basic":
-b instanceof THREE.MeshLambertMaterial?n="lambert":b instanceof THREE.MeshPhongMaterial?n="phong":b instanceof THREE.LineBasicMaterial?n="basic":b instanceof THREE.ParticleBasicMaterial&&(n="particle_basic");if(n){var p=THREE.ShaderLib[n];b.uniforms=THREE.UniformsUtils.clone(p.uniforms);b.vertexShader=p.vertexShader;b.fragmentShader=p.fragmentShader}var t,w,u;t=u=p=0;for(w=e.length;t<w;t++)m=e[t],m instanceof THREE.SpotLight&&u++,m instanceof THREE.DirectionalLight&&u++,m instanceof THREE.PointLight&&
-p++;p+u<=xa?t=u:(t=Math.ceil(xa*u/(p+u)),p=xa-t);m={directional:t,point:p};p=u=0;for(t=e.length;p<t;p++)w=e[p],w instanceof THREE.SpotLight&&w.castShadow&&u++;var v=50;if(f!==void 0&&f instanceof THREE.SkinnedMesh)v=f.bones.length;var x;a:{t=b.fragmentShader;w=b.vertexShader;var p=b.uniforms,e=b.attributes,c={map:!!b.map,envMap:!!b.envMap,lightMap:!!b.lightMap,vertexColors:b.vertexColors,fog:c,useFog:b.fog,sizeAttenuation:b.sizeAttenuation,skinning:b.skinning,morphTargets:b.morphTargets,maxMorphTargets:this.maxMorphTargets,
-maxDirLights:m.directional,maxPointLights:m.point,maxBones:v,shadowMapEnabled:this.shadowMapEnabled&&f.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:u,alphaTest:b.alphaTest},y,f=[];n?f.push(n):(f.push(t),f.push(w));for(y in c)f.push(y),f.push(c[y]);n=f.join();y=0;for(f=ea.length;y<f;y++)if(ea[y].code==n){x=ea[y].program;break a}y=o.createProgram();f=[Ha?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,
+b instanceof THREE.MeshLambertMaterial?n="lambert":b instanceof THREE.MeshPhongMaterial?n="phong":b instanceof THREE.LineBasicMaterial?n="basic":b instanceof THREE.ParticleBasicMaterial&&(n="particle_basic");if(n){var t=THREE.ShaderLib[n];b.uniforms=THREE.UniformsUtils.clone(t.uniforms);b.vertexShader=t.vertexShader;b.fragmentShader=t.fragmentShader}var p,v,w;p=w=t=0;for(v=e.length;p<v;p++)m=e[p],m instanceof THREE.SpotLight&&w++,m instanceof THREE.DirectionalLight&&w++,m instanceof THREE.PointLight&&
+t++;t+w<=xa?p=w:(p=Math.ceil(xa*w/(t+w)),t=xa-p);m={directional:p,point:t};t=w=0;for(p=e.length;t<p;t++)v=e[t],v instanceof THREE.SpotLight&&v.castShadow&&w++;var u=50;if(f!==void 0&&f instanceof THREE.SkinnedMesh)u=f.bones.length;var x;a:{p=b.fragmentShader;v=b.vertexShader;var t=b.uniforms,e=b.attributes,c={map:!!b.map,envMap:!!b.envMap,lightMap:!!b.lightMap,vertexColors:b.vertexColors,fog:c,useFog:b.fog,sizeAttenuation:b.sizeAttenuation,skinning:b.skinning,morphTargets:b.morphTargets,maxMorphTargets:this.maxMorphTargets,
+maxDirLights:m.directional,maxPointLights:m.point,maxBones:u,shadowMapEnabled:this.shadowMapEnabled&&f.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:w,alphaTest:b.alphaTest},y,f=[];n?f.push(n):(f.push(p),f.push(v));for(y in c)f.push(y),f.push(c[y]);n=f.join();y=0;for(f=ea.length;y<f;y++)if(ea[y].code==n){x=ea[y].program;break a}y=o.createProgram();f=[Ha?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,
 "#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
 m=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",
-c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapSoft?"#define SHADOWMAP_WIDTH "+c.shadowMapWidth.toFixed(1):"",c.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+c.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");o.attachShader(y,Q("fragment",m+t));o.attachShader(y,Q("vertex",f+w));o.linkProgram(y);o.getProgramParameter(y,o.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+o.getProgramParameter(y,o.VALIDATE_STATUS)+", gl error ["+
-o.getError()+"]");y.uniforms={};y.attributes={};var N,f=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(N in p)f.push(N);N=f;f=0;for(p=N.length;f<p;f++)t=N[f],y.uniforms[t]=o.getUniformLocation(y,t);f=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(N=0;N<c.maxMorphTargets;N++)f.push("morphTarget"+N);for(x in e)f.push(x);
+c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapSoft?"#define SHADOWMAP_WIDTH "+c.shadowMapWidth.toFixed(1):"",c.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+c.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");o.attachShader(y,Q("fragment",m+p));o.attachShader(y,Q("vertex",f+v));o.linkProgram(y);o.getProgramParameter(y,o.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+o.getProgramParameter(y,o.VALIDATE_STATUS)+", gl error ["+
+o.getError()+"]");y.uniforms={};y.attributes={};var N,f=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(N in t)f.push(N);N=f;f=0;for(t=N.length;f<t;f++)p=N[f],y.uniforms[p]=o.getUniformLocation(y,p);f=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(N=0;N<c.maxMorphTargets;N++)f.push("morphTarget"+N);for(x in e)f.push(x);
 x=f;N=0;for(e=x.length;N<e;N++)c=x[N],y.attributes[c]=o.getAttribLocation(y,c);y.id=ea.length;ea.push({program:y,code:n});X.info.memory.programs=ea.length;x=y}b.program=x;x=b.program.attributes;x.position>=0&&o.enableVertexAttribArray(x.position);x.color>=0&&o.enableVertexAttribArray(x.color);x.normal>=0&&o.enableVertexAttribArray(x.normal);x.tangent>=0&&o.enableVertexAttribArray(x.tangent);b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(o.enableVertexAttribArray(x.skinVertexA),
 o.enableVertexAttribArray(x.skinVertexB),o.enableVertexAttribArray(x.skinIndex),o.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(k in b.attributes)x[k]!==void 0&&x[k]>=0&&o.enableVertexAttribArray(x[k]);if(b.morphTargets)for(k=b.numSupportedMorphTargets=0;k<this.maxMorphTargets;k++)N="morphTarget"+k,x[N]>=0&&(o.enableVertexAttribArray(x[N]),b.numSupportedMorphTargets++);b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,e,c,f){Y(b);
-this.clear(e,c,f)};this.render=function(b,c,t,N){var M,O,F,D,J,ma,L,H,oa=b.lights,G=b.fog;aa=-1;this.shadowMapEnabled&&z(b,c);X.info.render.calls=0;X.info.render.vertices=0;X.info.render.faces=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(za);c.projectionMatrix.flattenToArray(Ea);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);p(Ca);this.initWebGLObjects(b);Y(t);(this.autoClear||N)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);
-J=b.__webglObjects.length;for(N=0;N<J;N++)if(M=b.__webglObjects[N],L=M.object,L.visible)if(!(L instanceof THREE.Mesh)||!L.frustumCulled||v(L)){if(L.matrixWorld.flattenToArray(L._objectMatrixArray),A(L,c,!0),w(M),M.render=!0,this.sortObjects)M.object.renderDepth?M.z=M.object.renderDepth:(Ba.copy(L.position),Ca.multiplyVector3(Ba),M.z=Ba.z)}else M.render=!1;else M.render=!1;this.sortObjects&&b.__webglObjects.sort(y);ma=b.__webglObjectsImmediate.length;for(N=0;N<ma;N++)M=b.__webglObjectsImmediate[N],
-L=M.object,L.visible&&(L.matrixAutoUpdate&&L.matrixWorld.flattenToArray(L._objectMatrixArray),A(L,c,!0),x(M));if(b.overrideMaterial){k(b.overrideMaterial.depthTest);I(b.overrideMaterial.blending);for(N=0;N<J;N++)if(M=b.__webglObjects[N],M.render)L=M.object,H=M.buffer,m(L),f(c,oa,G,b.overrideMaterial,H,L);for(N=0;N<ma;N++)M=b.__webglObjectsImmediate[N],L=M.object,L.visible&&(m(L),O=e(c,oa,G,b.overrideMaterial,L),L.immediateRenderCallback?L.immediateRenderCallback(O,o,ua):L.render(function(b){h(b,O,
-Da.shading)}))}else{I(THREE.NormalBlending);for(N=J-1;N>=0;N--)if(M=b.__webglObjects[N],M.render){L=M.object;H=M.buffer;F=M.opaque;m(L);for(M=0;M<F.count;M++)D=F.list[M],k(D.depthTest),n(D.depthWrite),u(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),f(c,oa,G,D,H,L)}for(N=0;N<ma;N++)if(M=b.__webglObjectsImmediate[N],L=M.object,L.visible){F=M.opaque;m(L);for(M=0;M<F.count;M++)D=F.list[M],k(D.depthTest),n(D.depthWrite),u(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),O=e(c,
-oa,G,D,L),L.immediateRenderCallback?L.immediateRenderCallback(O,o,ua):L.render(function(b){h(b,O,Da.shading)})}for(N=0;N<J;N++)if(M=b.__webglObjects[N],M.render){L=M.object;H=M.buffer;F=M.transparent;m(L);for(M=0;M<F.count;M++)D=F.list[M],I(D.blending),k(D.depthTest),n(D.depthWrite),u(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),f(c,oa,G,D,H,L)}for(N=0;N<ma;N++)if(M=b.__webglObjectsImmediate[N],L=M.object,L.visible){F=M.transparent;m(L);for(M=0;M<F.count;M++)D=F.list[M],I(D.blending),
-k(D.depthTest),n(D.depthWrite),u(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),O=e(c,oa,G,D,L),L.immediateRenderCallback?L.immediateRenderCallback(O,o,ua):L.render(function(b){h(b,O,Da.shading)})}}b.__webglSprites.length&&C(b,c);t&&t.minFilter!==THREE.NearestFilter&&t.minFilter!==THREE.LinearFilter&&E(t)};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var e=b.__objectsAdded[0],
+this.clear(e,c,f)};this.render=function(b,c,w,N){var M,O,F,D,J,ma,L,H,oa=b.lights,G=b.fog;aa=-1;this.shadowMapEnabled&&z(b,c);X.info.render.calls=0;X.info.render.vertices=0;X.info.render.faces=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(za);c.projectionMatrix.flattenToArray(Fa);Da.multiply(c.projectionMatrix,c.matrixWorldInverse);t(Da);this.initWebGLObjects(b);Y(w);(this.autoClear||N)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);
+J=b.__webglObjects.length;for(N=0;N<J;N++)if(M=b.__webglObjects[N],L=M.object,L.visible)if(!(L instanceof THREE.Mesh)||!L.frustumCulled||u(L)){if(L.matrixWorld.flattenToArray(L._objectMatrixArray),A(L,c,!0),v(M),M.render=!0,this.sortObjects)M.object.renderDepth?M.z=M.object.renderDepth:(Ba.copy(L.position),Da.multiplyVector3(Ba),M.z=Ba.z)}else M.render=!1;else M.render=!1;this.sortObjects&&b.__webglObjects.sort(y);ma=b.__webglObjectsImmediate.length;for(N=0;N<ma;N++)M=b.__webglObjectsImmediate[N],
+L=M.object,L.visible&&(L.matrixAutoUpdate&&L.matrixWorld.flattenToArray(L._objectMatrixArray),A(L,c,!0),x(M));if(b.overrideMaterial){h(b.overrideMaterial.depthTest);I(b.overrideMaterial.blending);for(N=0;N<J;N++)if(M=b.__webglObjects[N],M.render)L=M.object,H=M.buffer,m(L),f(c,oa,G,b.overrideMaterial,H,L);for(N=0;N<ma;N++)M=b.__webglObjectsImmediate[N],L=M.object,L.visible&&(m(L),O=e(c,oa,G,b.overrideMaterial,L),L.immediateRenderCallback?L.immediateRenderCallback(O,o,ua):L.render(function(b){k(b,O,
+Ea.shading)}))}else{I(THREE.NormalBlending);for(N=J-1;N>=0;N--)if(M=b.__webglObjects[N],M.render){L=M.object;H=M.buffer;F=M.opaque;m(L);for(M=0;M<F.count;M++)D=F.list[M],h(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),f(c,oa,G,D,H,L)}for(N=0;N<ma;N++)if(M=b.__webglObjectsImmediate[N],L=M.object,L.visible){F=M.opaque;m(L);for(M=0;M<F.count;M++)D=F.list[M],h(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),O=e(c,
+oa,G,D,L),L.immediateRenderCallback?L.immediateRenderCallback(O,o,ua):L.render(function(b){k(b,O,Ea.shading)})}for(N=0;N<J;N++)if(M=b.__webglObjects[N],M.render){L=M.object;H=M.buffer;F=M.transparent;m(L);for(M=0;M<F.count;M++)D=F.list[M],I(D.blending),h(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),f(c,oa,G,D,H,L)}for(N=0;N<ma;N++)if(M=b.__webglObjectsImmediate[N],L=M.object,L.visible){F=M.transparent;m(L);for(M=0;M<F.count;M++)D=F.list[M],I(D.blending),
+h(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),O=e(c,oa,G,D,L),L.immediateRenderCallback?L.immediateRenderCallback(O,o,ua):L.render(function(b){k(b,O,Ea.shading)})}}b.__webglSprites.length&&C(b,c);w&&w.minFilter!==THREE.NearestFilter&&w.minFilter!==THREE.LinearFilter&&E(w)};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var e=b.__objectsAdded[0],
 f=b,h=void 0,k=void 0,m=void 0;if(!e.__webglInit)if(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrixArray=new Float32Array(9),e._modelViewMatrixArray=new Float32Array(16),e._objectMatrixArray=new Float32Array(16),e.matrixWorld.flattenToArray(e._objectMatrixArray),e instanceof THREE.Mesh)for(h in k=e.geometry,k.geometryGroups==void 0&&P(k),k.geometryGroups){if(m=k.geometryGroups[h],!m.__webglVertexBuffer){var n=m;n.__webglVertexBuffer=o.createBuffer();n.__webglNormalBuffer=o.createBuffer();
-n.__webglTangentBuffer=o.createBuffer();n.__webglColorBuffer=o.createBuffer();n.__webglUVBuffer=o.createBuffer();n.__webglUV2Buffer=o.createBuffer();n.__webglSkinVertexABuffer=o.createBuffer();n.__webglSkinVertexBBuffer=o.createBuffer();n.__webglSkinIndicesBuffer=o.createBuffer();n.__webglSkinWeightsBuffer=o.createBuffer();n.__webglFaceBuffer=o.createBuffer();n.__webglLineBuffer=o.createBuffer();if(n.numMorphTargets){var p=void 0,t=void 0;n.__webglMorphTargetsBuffers=[];p=0;for(t=n.numMorphTargets;p<
-t;p++)n.__webglMorphTargetsBuffers.push(o.createBuffer())}X.info.memory.geometries++;for(var n=e,u=void 0,w=void 0,v=void 0,x=v=void 0,N=void 0,y=void 0,M=y=p=0,O=v=w=void 0,v=t=O=w=u=void 0,x=n.geometry,N=x.faces,O=m.faces,u=0,w=O.length;u<w;u++)v=O[u],v=N[v],v instanceof THREE.Face3?(p+=3,y+=1,M+=3):v instanceof THREE.Face4&&(p+=4,y+=2,M+=4);for(var u=m,w=n,z=O=N=void 0,A=void 0,z=void 0,v=[],N=0,O=w.materials.length;N<O;N++)if(z=w.materials[N],z instanceof THREE.MeshFaceMaterial){z=0;for(l=u.materials.length;z<
-l;z++)(A=u.materials[z])&&v.push(A)}else(A=z)&&v.push(A);u=v;m.__materials=u;a:{N=w=void 0;O=u.length;for(w=0;w<O;w++)if(N=u[w],N.map||N.lightMap||N instanceof THREE.ShaderMaterial){w=!0;break a}w=!1}a:{O=N=void 0;v=u.length;for(N=0;N<v;N++)if(O=u[N],!(O instanceof THREE.MeshBasicMaterial&&!O.envMap||O instanceof THREE.MeshDepthMaterial)){O=O&&O.shading!=void 0&&O.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}O=!1}a:{v=N=void 0;z=u.length;for(N=0;N<z;N++)if(v=u[N],v.vertexColors){v=
-v.vertexColors;break a}v=!1}m.__vertexArray=new Float32Array(p*3);if(O)m.__normalArray=new Float32Array(p*3);if(x.hasTangents)m.__tangentArray=new Float32Array(p*4);if(v)m.__colorArray=new Float32Array(p*3);if(w){if(x.faceUvs.length>0||x.faceVertexUvs.length>0)m.__uvArray=new Float32Array(p*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(p*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(p*4),m.__skinVertexBArray=
-new Float32Array(p*4),m.__skinIndexArray=new Float32Array(p*4),m.__skinWeightArray=new Float32Array(p*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(M*2);if(m.numMorphTargets){m.__morphTargetsArrays=[];x=0;for(N=m.numMorphTargets;x<N;x++)m.__morphTargetsArrays.push(new Float32Array(p*3))}m.__needsSmoothNormals=O==THREE.SmoothShading;m.__uvType=w;m.__vertexColorType=v;m.__normalType=O;m.__webglFaceCount=y*3+(n.geometry.edgeFaces?
-n.geometry.edgeFaces.length*6:0);m.__webglLineCount=M*2;x=0;for(N=u.length;x<N;x++)if(w=u[x],w.attributes){if(m.__webglCustomAttributes===void 0)m.__webglCustomAttributes={};for(a in w.attributes){v=w.attributes[a];O={};for(t in v)O[t]=v[t];if(!O.__webglInitialized||O.createUniqueBuffers)O.__webglInitialized=!0,y=1,O.type==="v2"?y=2:O.type==="v3"?y=3:O.type==="v4"?y=4:O.type==="c"&&(y=3),O.size=y,O.array=new Float32Array(p*y),O.buffer=o.createBuffer(),O.buffer.belongsToAttribute=a,v.needsUpdate=!0,
-O.__original=v;m.__webglCustomAttributes[a]=O}}m.__inittedArrays=!0;k.__dirtyVertices=!0;k.__dirtyMorphTargets=!0;k.__dirtyElements=!0;k.__dirtyUvs=!0;k.__dirtyNormals=!0;k.__dirtyTangents=!0;k.__dirtyColors=!0}}else if(e instanceof THREE.Ribbon){if(k=e.geometry,!k.__webglVertexBuffer)m=k,m.__webglVertexBuffer=o.createBuffer(),m.__webglColorBuffer=o.createBuffer(),X.info.memory.geometries++,m=k,n=m.vertices.length,m.__vertexArray=new Float32Array(n*3),m.__colorArray=new Float32Array(n*3),m.__webglVertexCount=
+n.__webglTangentBuffer=o.createBuffer();n.__webglColorBuffer=o.createBuffer();n.__webglUVBuffer=o.createBuffer();n.__webglUV2Buffer=o.createBuffer();n.__webglSkinVertexABuffer=o.createBuffer();n.__webglSkinVertexBBuffer=o.createBuffer();n.__webglSkinIndicesBuffer=o.createBuffer();n.__webglSkinWeightsBuffer=o.createBuffer();n.__webglFaceBuffer=o.createBuffer();n.__webglLineBuffer=o.createBuffer();if(n.numMorphTargets){var t=void 0,p=void 0;n.__webglMorphTargetsBuffers=[];t=0;for(p=n.numMorphTargets;t<
+p;t++)n.__webglMorphTargetsBuffers.push(o.createBuffer())}X.info.memory.geometries++;for(var n=e,v=void 0,w=void 0,u=void 0,x=u=void 0,N=void 0,y=void 0,M=y=t=0,O=u=w=void 0,u=p=O=w=v=void 0,x=n.geometry,N=x.faces,O=m.faces,v=0,w=O.length;v<w;v++)u=O[v],u=N[u],u instanceof THREE.Face3?(t+=3,y+=1,M+=3):u instanceof THREE.Face4&&(t+=4,y+=2,M+=4);for(var v=m,w=n,z=O=N=void 0,A=void 0,z=void 0,u=[],N=0,O=w.materials.length;N<O;N++)if(z=w.materials[N],z instanceof THREE.MeshFaceMaterial){z=0;for(l=v.materials.length;z<
+l;z++)(A=v.materials[z])&&u.push(A)}else(A=z)&&u.push(A);v=u;m.__materials=v;a:{N=w=void 0;O=v.length;for(w=0;w<O;w++)if(N=v[w],N.map||N.lightMap||N instanceof THREE.ShaderMaterial){w=!0;break a}w=!1}a:{O=N=void 0;u=v.length;for(N=0;N<u;N++)if(O=v[N],!(O instanceof THREE.MeshBasicMaterial&&!O.envMap||O instanceof THREE.MeshDepthMaterial)){O=O&&O.shading!=void 0&&O.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}O=!1}a:{u=N=void 0;z=v.length;for(N=0;N<z;N++)if(u=v[N],u.vertexColors){u=
+u.vertexColors;break a}u=!1}m.__vertexArray=new Float32Array(t*3);if(O)m.__normalArray=new Float32Array(t*3);if(x.hasTangents)m.__tangentArray=new Float32Array(t*4);if(u)m.__colorArray=new Float32Array(t*3);if(w){if(x.faceUvs.length>0||x.faceVertexUvs.length>0)m.__uvArray=new Float32Array(t*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(t*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(t*4),m.__skinVertexBArray=
+new Float32Array(t*4),m.__skinIndexArray=new Float32Array(t*4),m.__skinWeightArray=new Float32Array(t*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(M*2);if(m.numMorphTargets){m.__morphTargetsArrays=[];x=0;for(N=m.numMorphTargets;x<N;x++)m.__morphTargetsArrays.push(new Float32Array(t*3))}m.__needsSmoothNormals=O==THREE.SmoothShading;m.__uvType=w;m.__vertexColorType=u;m.__normalType=O;m.__webglFaceCount=y*3+(n.geometry.edgeFaces?
+n.geometry.edgeFaces.length*6:0);m.__webglLineCount=M*2;x=0;for(N=v.length;x<N;x++)if(w=v[x],w.attributes){if(m.__webglCustomAttributes===void 0)m.__webglCustomAttributes={};for(a in w.attributes){u=w.attributes[a];O={};for(p in u)O[p]=u[p];if(!O.__webglInitialized||O.createUniqueBuffers)O.__webglInitialized=!0,y=1,O.type==="v2"?y=2:O.type==="v3"?y=3:O.type==="v4"?y=4:O.type==="c"&&(y=3),O.size=y,O.array=new Float32Array(t*y),O.buffer=o.createBuffer(),O.buffer.belongsToAttribute=a,u.needsUpdate=!0,
+O.__original=u;m.__webglCustomAttributes[a]=O}}m.__inittedArrays=!0;k.__dirtyVertices=!0;k.__dirtyMorphTargets=!0;k.__dirtyElements=!0;k.__dirtyUvs=!0;k.__dirtyNormals=!0;k.__dirtyTangents=!0;k.__dirtyColors=!0}}else if(e instanceof THREE.Ribbon){if(k=e.geometry,!k.__webglVertexBuffer)m=k,m.__webglVertexBuffer=o.createBuffer(),m.__webglColorBuffer=o.createBuffer(),X.info.memory.geometries++,m=k,n=m.vertices.length,m.__vertexArray=new Float32Array(n*3),m.__colorArray=new Float32Array(n*3),m.__webglVertexCount=
 n,k.__dirtyVertices=!0,k.__dirtyColors=!0}else if(e instanceof THREE.Line){if(k=e.geometry,!k.__webglVertexBuffer)m=k,m.__webglVertexBuffer=o.createBuffer(),m.__webglColorBuffer=o.createBuffer(),X.info.memory.geometries++,m=k,n=m.vertices.length,m.__vertexArray=new Float32Array(n*3),m.__colorArray=new Float32Array(n*3),m.__webglLineCount=n,k.__dirtyVertices=!0,k.__dirtyColors=!0}else if(e instanceof THREE.ParticleSystem&&(k=e.geometry,!k.__webglVertexBuffer)){m=k;m.__webglVertexBuffer=o.createBuffer();
-m.__webglColorBuffer=o.createBuffer();X.info.geometries++;m=k;n=e;p=m.vertices.length;m.__vertexArray=new Float32Array(p*3);m.__colorArray=new Float32Array(p*3);m.__sortArray=[];m.__webglParticleCount=p;m.__materials=n.materials;M=y=t=void 0;t=0;for(y=n.materials.length;t<y;t++)if(M=n.materials[t],M.attributes){if(m.__webglCustomAttributes===void 0)m.__webglCustomAttributes={};for(a in M.attributes){originalAttribute=M.attributes[a];attribute={};for(property in originalAttribute)attribute[property]=
-originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=!0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=4:attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(p*size),attribute.buffer=o.createBuffer(),attribute.buffer.belongsToAttribute=a,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;m.__webglCustomAttributes[a]=attribute}}k.__dirtyVertices=
+m.__webglColorBuffer=o.createBuffer();X.info.geometries++;m=k;n=e;t=m.vertices.length;m.__vertexArray=new Float32Array(t*3);m.__colorArray=new Float32Array(t*3);m.__sortArray=[];m.__webglParticleCount=t;m.__materials=n.materials;M=y=p=void 0;p=0;for(y=n.materials.length;p<y;p++)if(M=n.materials[p],M.attributes){if(m.__webglCustomAttributes===void 0)m.__webglCustomAttributes={};for(a in M.attributes){originalAttribute=M.attributes[a];attribute={};for(property in originalAttribute)attribute[property]=
+originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=!0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=4:attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(t*size),attribute.buffer=o.createBuffer(),attribute.buffer.belongsToAttribute=a,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;m.__webglCustomAttributes[a]=attribute}}k.__dirtyVertices=
 !0;k.__dirtyColors=!0}if(!e.__webglActive){if(e instanceof THREE.Mesh)for(h in k=e.geometry,k.geometryGroups)m=k.geometryGroups[h],S(f.__webglObjects,m,e);else e instanceof THREE.Ribbon||e instanceof THREE.Line||e instanceof THREE.ParticleSystem?(k=e.geometry,S(f.__webglObjects,k,e)):THREE.MarchingCubes!==void 0&&e instanceof THREE.MarchingCubes||e.immediateRenderCallback?f.__webglObjectsImmediate.push({object:e,opaque:{list:[],count:0},transparent:{list:[],count:0}}):e instanceof THREE.Sprite&&f.__webglSprites.push(e);
 e.__webglActive=!0}b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;){e=b.__objectsRemoved[0];f=b;if(e instanceof THREE.Mesh||e instanceof THREE.ParticleSystem||e instanceof THREE.Ribbon||e instanceof THREE.Line)J(f.__webglObjects,e);else if(e instanceof THREE.Sprite){f=f.__webglSprites;h=e;k=void 0;for(k=f.length-1;k>=0;k--)f[k]==h&&f.splice(k,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&J(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,
-1)}e=0;for(f=b.__webglObjects.length;e<f;e++)if(k=b.__webglObjects[e].object,t=m=h=void 0,k instanceof THREE.Mesh){h=k.geometry;n=0;for(p=h.geometryGroupsList.length;n<p;n++)if(m=h.geometryGroupsList[n],t=F(m),h.__dirtyVertices||h.__dirtyMorphTargets||h.__dirtyElements||h.__dirtyUvs||h.__dirtyNormals||h.__dirtyColors||h.__dirtyTangents||t)if(t=m,y=o.DYNAMIC_DRAW,M=!h.dynamic,t.__inittedArrays){var C=u=x=void 0,L=void 0,ma=C=void 0,H=void 0,oa=void 0,G=void 0,ha=A=z=v=O=N=w=void 0,I=void 0,na=void 0,
-K=L=G=L=oa=H=void 0,B=void 0,E=B=K=H=void 0,Z=void 0,qa=E=B=K=C=C=ma=G=L=E=B=K=Z=E=B=K=Z=E=B=K=void 0,U=0,Q=0,ra=0,V=0,xa=0,$=0,R=0,pa=0,Y=0,T=0,W=0,E=K=0,E=void 0,ga=t.__vertexArray,va=t.__uvArray,ua=t.__uv2Array,ka=t.__normalArray,ia=t.__tangentArray,da=t.__colorArray,ca=t.__skinVertexAArray,aa=t.__skinVertexBArray,ea=t.__skinIndexArray,fa=t.__skinWeightArray,Da=t.__morphTargetsArrays,ja=t.__webglCustomAttributes,B=void 0,ta=t.__faceArray,wa=t.__lineArray,Ca=t.__needsSmoothNormals,N=t.__vertexColorType,
-w=t.__uvType,O=t.__normalType,la=k.geometry,Ea=la.__dirtyVertices,Aa=la.__dirtyElements,za=la.__dirtyUvs,Ha=la.__dirtyNormals,Ka=la.__dirtyTangents,Ba=la.__dirtyColors,Ga=la.__dirtyMorphTargets,Ja=la.vertices,cb=t.faces,fb=la.faces,db=la.faceVertexUvs[0],eb=la.faceVertexUvs[1],Qa=la.skinVerticesA,Ra=la.skinVerticesB,Sa=la.skinIndices,Ma=la.skinWeights,La=la.morphTargets;if(ja)for(qa in ja)ja[qa].offset=0,ja[qa].offsetSrc=0;x=0;for(u=cb.length;x<u;x++)if(C=cb[x],L=fb[C],db&&(v=db[C]),eb&&(z=eb[C]),
-C=L.vertexNormals,ma=L.normal,H=L.vertexColors,oa=L.color,G=L.vertexTangents,L instanceof THREE.Face3){if(Ea)A=Ja[L.a].position,ha=Ja[L.b].position,I=Ja[L.c].position,ga[Q]=A.x,ga[Q+1]=A.y,ga[Q+2]=A.z,ga[Q+3]=ha.x,ga[Q+4]=ha.y,ga[Q+5]=ha.z,ga[Q+6]=I.x,ga[Q+7]=I.y,ga[Q+8]=I.z,Q+=9;if(ja)for(qa in ja)if(B=ja[qa],B.__original.needsUpdate)K=B.offset,E=B.offsetSrc,B.size===1?(B.boundTo===void 0||B.boundTo==="vertices"?(B.array[K]=B.value[L.a],B.array[K+1]=B.value[L.b],B.array[K+2]=B.value[L.c]):B.boundTo===
+1)}e=0;for(f=b.__webglObjects.length;e<f;e++)if(k=b.__webglObjects[e].object,p=m=h=void 0,k instanceof THREE.Mesh){h=k.geometry;n=0;for(t=h.geometryGroupsList.length;n<t;n++)if(m=h.geometryGroupsList[n],p=F(m),h.__dirtyVertices||h.__dirtyMorphTargets||h.__dirtyElements||h.__dirtyUvs||h.__dirtyNormals||h.__dirtyColors||h.__dirtyTangents||p)if(p=m,y=o.DYNAMIC_DRAW,M=!h.dynamic,p.__inittedArrays){var C=v=x=void 0,L=void 0,ma=C=void 0,H=void 0,oa=void 0,G=void 0,ha=A=z=u=O=N=w=void 0,I=void 0,na=void 0,
+K=L=G=L=oa=H=void 0,B=void 0,E=B=K=H=void 0,Z=void 0,qa=E=B=K=C=C=ma=G=L=E=B=K=Z=E=B=K=Z=E=B=K=void 0,U=0,Q=0,ra=0,V=0,xa=0,$=0,R=0,pa=0,Y=0,T=0,W=0,E=K=0,E=void 0,ga=p.__vertexArray,va=p.__uvArray,ua=p.__uv2Array,ka=p.__normalArray,ia=p.__tangentArray,da=p.__colorArray,ca=p.__skinVertexAArray,aa=p.__skinVertexBArray,ea=p.__skinIndexArray,fa=p.__skinWeightArray,Ea=p.__morphTargetsArrays,ja=p.__webglCustomAttributes,B=void 0,ta=p.__faceArray,wa=p.__lineArray,Da=p.__needsSmoothNormals,N=p.__vertexColorType,
+w=p.__uvType,O=p.__normalType,la=k.geometry,Fa=la.__dirtyVertices,Aa=la.__dirtyElements,za=la.__dirtyUvs,Ha=la.__dirtyNormals,Ka=la.__dirtyTangents,Ba=la.__dirtyColors,Ga=la.__dirtyMorphTargets,Ja=la.vertices,cb=p.faces,fb=la.faces,db=la.faceVertexUvs[0],eb=la.faceVertexUvs[1],Qa=la.skinVerticesA,Ra=la.skinVerticesB,Sa=la.skinIndices,Ma=la.skinWeights,La=la.morphTargets;if(ja)for(qa in ja)ja[qa].offset=0,ja[qa].offsetSrc=0;x=0;for(v=cb.length;x<v;x++)if(C=cb[x],L=fb[C],db&&(u=db[C]),eb&&(z=eb[C]),
+C=L.vertexNormals,ma=L.normal,H=L.vertexColors,oa=L.color,G=L.vertexTangents,L instanceof THREE.Face3){if(Fa)A=Ja[L.a].position,ha=Ja[L.b].position,I=Ja[L.c].position,ga[Q]=A.x,ga[Q+1]=A.y,ga[Q+2]=A.z,ga[Q+3]=ha.x,ga[Q+4]=ha.y,ga[Q+5]=ha.z,ga[Q+6]=I.x,ga[Q+7]=I.y,ga[Q+8]=I.z,Q+=9;if(ja)for(qa in ja)if(B=ja[qa],B.__original.needsUpdate)K=B.offset,E=B.offsetSrc,B.size===1?(B.boundTo===void 0||B.boundTo==="vertices"?(B.array[K]=B.value[L.a],B.array[K+1]=B.value[L.b],B.array[K+2]=B.value[L.c]):B.boundTo===
 "faces"?(E=B.value[E],B.array[K]=E,B.array[K+1]=E,B.array[K+2]=E,B.offsetSrc++):B.boundTo==="faceVertices"&&(B.array[K]=B.value[E],B.array[K+1]=B.value[E+1],B.array[K+2]=B.value[E+2],B.offsetSrc+=3),B.offset+=3):(B.boundTo===void 0||B.boundTo==="vertices"?(A=B.value[L.a],ha=B.value[L.b],I=B.value[L.c]):B.boundTo==="faces"?(I=ha=A=E=B.value[E],B.offsetSrc++):B.boundTo==="faceVertices"&&(A=B.value[E],ha=B.value[E+1],I=B.value[E+2],B.offsetSrc+=3),B.size===2?(B.array[K]=A.x,B.array[K+1]=A.y,B.array[K+
 2]=ha.x,B.array[K+3]=ha.y,B.array[K+4]=I.x,B.array[K+5]=I.y,B.offset+=6):B.size===3?(B.type==="c"?(B.array[K]=A.r,B.array[K+1]=A.g,B.array[K+2]=A.b,B.array[K+3]=ha.r,B.array[K+4]=ha.g,B.array[K+5]=ha.b,B.array[K+6]=I.r,B.array[K+7]=I.g,B.array[K+8]=I.b):(B.array[K]=A.x,B.array[K+1]=A.y,B.array[K+2]=A.z,B.array[K+3]=ha.x,B.array[K+4]=ha.y,B.array[K+5]=ha.z,B.array[K+6]=I.x,B.array[K+7]=I.y,B.array[K+8]=I.z),B.offset+=9):(B.array[K]=A.x,B.array[K+1]=A.y,B.array[K+2]=A.z,B.array[K+3]=A.w,B.array[K+4]=
-ha.x,B.array[K+5]=ha.y,B.array[K+6]=ha.z,B.array[K+7]=ha.w,B.array[K+8]=I.x,B.array[K+9]=I.y,B.array[K+10]=I.z,B.array[K+11]=I.w,B.offset+=12));if(Ga){K=0;for(B=La.length;K<B;K++)A=La[K].vertices[L.a].position,ha=La[K].vertices[L.b].position,I=La[K].vertices[L.c].position,E=Da[K],E[W]=A.x,E[W+1]=A.y,E[W+2]=A.z,E[W+3]=ha.x,E[W+4]=ha.y,E[W+5]=ha.z,E[W+6]=I.x,E[W+7]=I.y,E[W+8]=I.z;W+=9}if(Ma.length)K=Ma[L.a],B=Ma[L.b],E=Ma[L.c],fa[T]=K.x,fa[T+1]=K.y,fa[T+2]=K.z,fa[T+3]=K.w,fa[T+4]=B.x,fa[T+5]=B.y,fa[T+
+ha.x,B.array[K+5]=ha.y,B.array[K+6]=ha.z,B.array[K+7]=ha.w,B.array[K+8]=I.x,B.array[K+9]=I.y,B.array[K+10]=I.z,B.array[K+11]=I.w,B.offset+=12));if(Ga){K=0;for(B=La.length;K<B;K++)A=La[K].vertices[L.a].position,ha=La[K].vertices[L.b].position,I=La[K].vertices[L.c].position,E=Ea[K],E[W]=A.x,E[W+1]=A.y,E[W+2]=A.z,E[W+3]=ha.x,E[W+4]=ha.y,E[W+5]=ha.z,E[W+6]=I.x,E[W+7]=I.y,E[W+8]=I.z;W+=9}if(Ma.length)K=Ma[L.a],B=Ma[L.b],E=Ma[L.c],fa[T]=K.x,fa[T+1]=K.y,fa[T+2]=K.z,fa[T+3]=K.w,fa[T+4]=B.x,fa[T+5]=B.y,fa[T+
 6]=B.z,fa[T+7]=B.w,fa[T+8]=E.x,fa[T+9]=E.y,fa[T+10]=E.z,fa[T+11]=E.w,K=Sa[L.a],B=Sa[L.b],E=Sa[L.c],ea[T]=K.x,ea[T+1]=K.y,ea[T+2]=K.z,ea[T+3]=K.w,ea[T+4]=B.x,ea[T+5]=B.y,ea[T+6]=B.z,ea[T+7]=B.w,ea[T+8]=E.x,ea[T+9]=E.y,ea[T+10]=E.z,ea[T+11]=E.w,K=Qa[L.a],B=Qa[L.b],E=Qa[L.c],ca[T]=K.x,ca[T+1]=K.y,ca[T+2]=K.z,ca[T+3]=1,ca[T+4]=B.x,ca[T+5]=B.y,ca[T+6]=B.z,ca[T+7]=1,ca[T+8]=E.x,ca[T+9]=E.y,ca[T+10]=E.z,ca[T+11]=1,K=Ra[L.a],B=Ra[L.b],E=Ra[L.c],aa[T]=K.x,aa[T+1]=K.y,aa[T+2]=K.z,aa[T+3]=1,aa[T+4]=B.x,aa[T+
-5]=B.y,aa[T+6]=B.z,aa[T+7]=1,aa[T+8]=E.x,aa[T+9]=E.y,aa[T+10]=E.z,aa[T+11]=1,T+=12;if(Ba&&N)H.length==3&&N==THREE.VertexColors?(L=H[0],K=H[1],B=H[2]):B=K=L=oa,da[Y]=L.r,da[Y+1]=L.g,da[Y+2]=L.b,da[Y+3]=K.r,da[Y+4]=K.g,da[Y+5]=K.b,da[Y+6]=B.r,da[Y+7]=B.g,da[Y+8]=B.b,Y+=9;if(Ka&&la.hasTangents)H=G[0],oa=G[1],L=G[2],ia[R]=H.x,ia[R+1]=H.y,ia[R+2]=H.z,ia[R+3]=H.w,ia[R+4]=oa.x,ia[R+5]=oa.y,ia[R+6]=oa.z,ia[R+7]=oa.w,ia[R+8]=L.x,ia[R+9]=L.y,ia[R+10]=L.z,ia[R+11]=L.w,R+=12;if(Ha&&O)if(C.length==3&&Ca)for(G=
-0;G<3;G++)ma=C[G],ka[$]=ma.x,ka[$+1]=ma.y,ka[$+2]=ma.z,$+=3;else for(G=0;G<3;G++)ka[$]=ma.x,ka[$+1]=ma.y,ka[$+2]=ma.z,$+=3;if(za&&v!==void 0&&w)for(G=0;G<3;G++)C=v[G],va[ra]=C.u,va[ra+1]=C.v,ra+=2;if(za&&z!==void 0&&w)for(G=0;G<3;G++)C=z[G],ua[V]=C.u,ua[V+1]=C.v,V+=2;Aa&&(ta[xa]=U,ta[xa+1]=U+1,ta[xa+2]=U+2,xa+=3,wa[pa]=U,wa[pa+1]=U+1,wa[pa+2]=U,wa[pa+3]=U+2,wa[pa+4]=U+1,wa[pa+5]=U+2,pa+=6,U+=3)}else if(L instanceof THREE.Face4){if(Ea)A=Ja[L.a].position,ha=Ja[L.b].position,I=Ja[L.c].position,na=Ja[L.d].position,
+5]=B.y,aa[T+6]=B.z,aa[T+7]=1,aa[T+8]=E.x,aa[T+9]=E.y,aa[T+10]=E.z,aa[T+11]=1,T+=12;if(Ba&&N)H.length==3&&N==THREE.VertexColors?(L=H[0],K=H[1],B=H[2]):B=K=L=oa,da[Y]=L.r,da[Y+1]=L.g,da[Y+2]=L.b,da[Y+3]=K.r,da[Y+4]=K.g,da[Y+5]=K.b,da[Y+6]=B.r,da[Y+7]=B.g,da[Y+8]=B.b,Y+=9;if(Ka&&la.hasTangents)H=G[0],oa=G[1],L=G[2],ia[R]=H.x,ia[R+1]=H.y,ia[R+2]=H.z,ia[R+3]=H.w,ia[R+4]=oa.x,ia[R+5]=oa.y,ia[R+6]=oa.z,ia[R+7]=oa.w,ia[R+8]=L.x,ia[R+9]=L.y,ia[R+10]=L.z,ia[R+11]=L.w,R+=12;if(Ha&&O)if(C.length==3&&Da)for(G=
+0;G<3;G++)ma=C[G],ka[$]=ma.x,ka[$+1]=ma.y,ka[$+2]=ma.z,$+=3;else for(G=0;G<3;G++)ka[$]=ma.x,ka[$+1]=ma.y,ka[$+2]=ma.z,$+=3;if(za&&u!==void 0&&w)for(G=0;G<3;G++)C=u[G],va[ra]=C.u,va[ra+1]=C.v,ra+=2;if(za&&z!==void 0&&w)for(G=0;G<3;G++)C=z[G],ua[V]=C.u,ua[V+1]=C.v,V+=2;Aa&&(ta[xa]=U,ta[xa+1]=U+1,ta[xa+2]=U+2,xa+=3,wa[pa]=U,wa[pa+1]=U+1,wa[pa+2]=U,wa[pa+3]=U+2,wa[pa+4]=U+1,wa[pa+5]=U+2,pa+=6,U+=3)}else if(L instanceof THREE.Face4){if(Fa)A=Ja[L.a].position,ha=Ja[L.b].position,I=Ja[L.c].position,na=Ja[L.d].position,
 ga[Q]=A.x,ga[Q+1]=A.y,ga[Q+2]=A.z,ga[Q+3]=ha.x,ga[Q+4]=ha.y,ga[Q+5]=ha.z,ga[Q+6]=I.x,ga[Q+7]=I.y,ga[Q+8]=I.z,ga[Q+9]=na.x,ga[Q+10]=na.y,ga[Q+11]=na.z,Q+=12;if(ja)for(qa in ja)if(B=ja[qa],B.__original.needsUpdate)K=B.offset,E=B.offsetSrc,B.size===1?(B.boundTo===void 0||B.boundTo==="vertices"?(B.array[K]=B.value[L.a],B.array[K+1]=B.value[L.b],B.array[K+2]=B.value[L.c],B.array[K+3]=B.value[L.d]):B.boundTo==="faces"?(E=B.value[E],B.array[K]=E,B.array[K+1]=E,B.array[K+2]=E,B.array[K+3]=E,B.offsetSrc++):
 B.boundTo==="faceVertices"&&(B.array[K]=B.value[E],B.array[K+1]=B.value[E+1],B.array[K+2]=B.value[E+2],B.array[K+3]=B.value[E+3],B.offsetSrc+=4),B.offset+=4):(B.boundTo===void 0||B.boundTo==="vertices"?(A=B.value[L.a],ha=B.value[L.b],I=B.value[L.c],na=B.value[L.d]):B.boundTo==="faces"?(na=I=ha=A=E=B.value[E],B.offsetSrc++):B.boundTo==="faceVertices"&&(A=B.value[E],ha=B.value[E+1],I=B.value[E+2],na=B.value[E+3],B.offsetSrc+=4),B.size===2?(B.array[K]=A.x,B.array[K+1]=A.y,B.array[K+2]=ha.x,B.array[K+
 3]=ha.y,B.array[K+4]=I.x,B.array[K+5]=I.y,B.array[K+6]=na.x,B.array[K+7]=na.y,B.offset+=8):B.size===3?(B.type==="c"?(B.array[K]=A.r,B.array[K+1]=A.g,B.array[K+2]=A.b,B.array[K+3]=ha.r,B.array[K+4]=ha.g,B.array[K+5]=ha.b,B.array[K+6]=I.r,B.array[K+7]=I.g,B.array[K+8]=I.b,B.array[K+9]=na.r,B.array[K+10]=na.g,B.array[K+11]=na.b):(B.array[K]=A.x,B.array[K+1]=A.y,B.array[K+2]=A.z,B.array[K+3]=ha.x,B.array[K+4]=ha.y,B.array[K+5]=ha.z,B.array[K+6]=I.x,B.array[K+7]=I.y,B.array[K+8]=I.z,B.array[K+9]=na.x,
 B.array[K+10]=na.y,B.array[K+11]=na.z),B.offset+=12):(B.array[K]=A.x,B.array[K+1]=A.y,B.array[K+2]=A.z,B.array[K+3]=A.w,B.array[K+4]=ha.x,B.array[K+5]=ha.y,B.array[K+6]=ha.z,B.array[K+7]=ha.w,B.array[K+8]=I.x,B.array[K+9]=I.y,B.array[K+10]=I.z,B.array[K+11]=I.w,B.array[K+12]=na.x,B.array[K+13]=na.y,B.array[K+14]=na.z,B.array[K+15]=na.w,B.offset+=16));if(Ga){K=0;for(B=La.length;K<B;K++)A=La[K].vertices[L.a].position,ha=La[K].vertices[L.b].position,I=La[K].vertices[L.c].position,na=La[K].vertices[L.d].position,
-E=Da[K],E[W]=A.x,E[W+1]=A.y,E[W+2]=A.z,E[W+3]=ha.x,E[W+4]=ha.y,E[W+5]=ha.z,E[W+6]=I.x,E[W+7]=I.y,E[W+8]=I.z,E[W+9]=na.x,E[W+10]=na.y,E[W+11]=na.z;W+=12}if(Ma.length)K=Ma[L.a],B=Ma[L.b],E=Ma[L.c],Z=Ma[L.d],fa[T]=K.x,fa[T+1]=K.y,fa[T+2]=K.z,fa[T+3]=K.w,fa[T+4]=B.x,fa[T+5]=B.y,fa[T+6]=B.z,fa[T+7]=B.w,fa[T+8]=E.x,fa[T+9]=E.y,fa[T+10]=E.z,fa[T+11]=E.w,fa[T+12]=Z.x,fa[T+13]=Z.y,fa[T+14]=Z.z,fa[T+15]=Z.w,K=Sa[L.a],B=Sa[L.b],E=Sa[L.c],Z=Sa[L.d],ea[T]=K.x,ea[T+1]=K.y,ea[T+2]=K.z,ea[T+3]=K.w,ea[T+4]=B.x,ea[T+
+E=Ea[K],E[W]=A.x,E[W+1]=A.y,E[W+2]=A.z,E[W+3]=ha.x,E[W+4]=ha.y,E[W+5]=ha.z,E[W+6]=I.x,E[W+7]=I.y,E[W+8]=I.z,E[W+9]=na.x,E[W+10]=na.y,E[W+11]=na.z;W+=12}if(Ma.length)K=Ma[L.a],B=Ma[L.b],E=Ma[L.c],Z=Ma[L.d],fa[T]=K.x,fa[T+1]=K.y,fa[T+2]=K.z,fa[T+3]=K.w,fa[T+4]=B.x,fa[T+5]=B.y,fa[T+6]=B.z,fa[T+7]=B.w,fa[T+8]=E.x,fa[T+9]=E.y,fa[T+10]=E.z,fa[T+11]=E.w,fa[T+12]=Z.x,fa[T+13]=Z.y,fa[T+14]=Z.z,fa[T+15]=Z.w,K=Sa[L.a],B=Sa[L.b],E=Sa[L.c],Z=Sa[L.d],ea[T]=K.x,ea[T+1]=K.y,ea[T+2]=K.z,ea[T+3]=K.w,ea[T+4]=B.x,ea[T+
 5]=B.y,ea[T+6]=B.z,ea[T+7]=B.w,ea[T+8]=E.x,ea[T+9]=E.y,ea[T+10]=E.z,ea[T+11]=E.w,ea[T+12]=Z.x,ea[T+13]=Z.y,ea[T+14]=Z.z,ea[T+15]=Z.w,K=Qa[L.a],B=Qa[L.b],E=Qa[L.c],Z=Qa[L.d],ca[T]=K.x,ca[T+1]=K.y,ca[T+2]=K.z,ca[T+3]=1,ca[T+4]=B.x,ca[T+5]=B.y,ca[T+6]=B.z,ca[T+7]=1,ca[T+8]=E.x,ca[T+9]=E.y,ca[T+10]=E.z,ca[T+11]=1,ca[T+12]=Z.x,ca[T+13]=Z.y,ca[T+14]=Z.z,ca[T+15]=1,K=Ra[L.a],B=Ra[L.b],E=Ra[L.c],L=Ra[L.d],aa[T]=K.x,aa[T+1]=K.y,aa[T+2]=K.z,aa[T+3]=1,aa[T+4]=B.x,aa[T+5]=B.y,aa[T+6]=B.z,aa[T+7]=1,aa[T+8]=E.x,
 aa[T+9]=E.y,aa[T+10]=E.z,aa[T+11]=1,aa[T+12]=L.x,aa[T+13]=L.y,aa[T+14]=L.z,aa[T+15]=1,T+=16;if(Ba&&N)H.length==4&&N==THREE.VertexColors?(L=H[0],K=H[1],B=H[2],H=H[3]):H=B=K=L=oa,da[Y]=L.r,da[Y+1]=L.g,da[Y+2]=L.b,da[Y+3]=K.r,da[Y+4]=K.g,da[Y+5]=K.b,da[Y+6]=B.r,da[Y+7]=B.g,da[Y+8]=B.b,da[Y+9]=H.r,da[Y+10]=H.g,da[Y+11]=H.b,Y+=12;if(Ka&&la.hasTangents)H=G[0],oa=G[1],L=G[2],G=G[3],ia[R]=H.x,ia[R+1]=H.y,ia[R+2]=H.z,ia[R+3]=H.w,ia[R+4]=oa.x,ia[R+5]=oa.y,ia[R+6]=oa.z,ia[R+7]=oa.w,ia[R+8]=L.x,ia[R+9]=L.y,ia[R+
-10]=L.z,ia[R+11]=L.w,ia[R+12]=G.x,ia[R+13]=G.y,ia[R+14]=G.z,ia[R+15]=G.w,R+=16;if(Ha&&O)if(C.length==4&&Ca)for(G=0;G<4;G++)ma=C[G],ka[$]=ma.x,ka[$+1]=ma.y,ka[$+2]=ma.z,$+=3;else for(G=0;G<4;G++)ka[$]=ma.x,ka[$+1]=ma.y,ka[$+2]=ma.z,$+=3;if(za&&v!==void 0&&w)for(G=0;G<4;G++)C=v[G],va[ra]=C.u,va[ra+1]=C.v,ra+=2;if(za&&z!==void 0&&w)for(G=0;G<4;G++)C=z[G],ua[V]=C.u,ua[V+1]=C.v,V+=2;Aa&&(ta[xa]=U,ta[xa+1]=U+1,ta[xa+2]=U+3,ta[xa+3]=U+1,ta[xa+4]=U+2,ta[xa+5]=U+3,xa+=6,wa[pa]=U,wa[pa+1]=U+1,wa[pa+2]=U,wa[pa+
-3]=U+3,wa[pa+4]=U+1,wa[pa+5]=U+2,wa[pa+6]=U+2,wa[pa+7]=U+3,pa+=8,U+=4)}Ea&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,ga,y));if(ja)for(qa in ja)B=ja[qa],B.__original.needsUpdate&&(o.bindBuffer(o.ARRAY_BUFFER,B.buffer),o.bufferData(o.ARRAY_BUFFER,B.array,y));if(Ga){K=0;for(B=La.length;K<B;K++)o.bindBuffer(o.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[K]),o.bufferData(o.ARRAY_BUFFER,Da[K],y)}Ba&&Y>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,
-da,y));Ha&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglNormalBuffer),o.bufferData(o.ARRAY_BUFFER,ka,y));Ka&&la.hasTangents&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglTangentBuffer),o.bufferData(o.ARRAY_BUFFER,ia,y));za&&ra>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglUVBuffer),o.bufferData(o.ARRAY_BUFFER,va,y));za&&V>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglUV2Buffer),o.bufferData(o.ARRAY_BUFFER,ua,y));Aa&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,ta,y),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,
-t.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,wa,y));T>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinVertexABuffer),o.bufferData(o.ARRAY_BUFFER,ca,y),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinVertexBBuffer),o.bufferData(o.ARRAY_BUFFER,aa,y),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),o.bufferData(o.ARRAY_BUFFER,ea,y),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),o.bufferData(o.ARRAY_BUFFER,fa,y));M&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,
-delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray,delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;D(m)}else if(k instanceof THREE.Ribbon){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=x=M=M=
-void 0;u=k.vertices;p=k.colors;w=u.length;t=p.length;N=k.__vertexArray;y=k.__colorArray;O=k.__dirtyColors;if(k.__dirtyVertices){for(M=0;M<w;M++)x=u[M].position,n=M*3,N[n]=x.x,N[n+1]=x.y,N[n+2]=x.z;o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,N,m)}if(O){for(M=0;M<t;M++)color=p[M],n=M*3,y[n]=color.r,y[n+1]=color.g,y[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,y,m)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(k instanceof
-THREE.Line){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=x=M=M=void 0;u=k.vertices;p=k.colors;w=u.length;t=p.length;N=k.__vertexArray;y=k.__colorArray;O=k.__dirtyColors;if(k.__dirtyVertices){for(M=0;M<w;M++)x=u[M].position,n=M*3,N[n]=x.x,N[n+1]=x.y,N[n+2]=x.z;o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,N,m)}if(O){for(M=0;M<t;M++)color=p[M],n=M*3,y[n]=color.r,y[n+1]=color.g,y[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer);
-o.bufferData(o.ARRAY_BUFFER,y,m)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(k instanceof THREE.ParticleSystem)h=k.geometry,t=F(h),(h.__dirtyVertices||h.__dirtyColors||k.sortParticles||t)&&c(h,o.DYNAMIC_DRAW,k),h.__dirtyVertices=!1,h.__dirtyColors=!1,D(h)};this.setFaceCulling=function(b,e){b?(!e||e=="ccw"?o.frontFace(o.CCW):o.frontFace(o.CW),b=="back"?o.cullFace(o.BACK):b=="front"?o.cullFace(o.FRONT):o.cullFace(o.FRONT_AND_BACK),o.enable(o.CULL_FACE)):o.disable(o.CULL_FACE)};this.supportsVertexTextures=
+10]=L.z,ia[R+11]=L.w,ia[R+12]=G.x,ia[R+13]=G.y,ia[R+14]=G.z,ia[R+15]=G.w,R+=16;if(Ha&&O)if(C.length==4&&Da)for(G=0;G<4;G++)ma=C[G],ka[$]=ma.x,ka[$+1]=ma.y,ka[$+2]=ma.z,$+=3;else for(G=0;G<4;G++)ka[$]=ma.x,ka[$+1]=ma.y,ka[$+2]=ma.z,$+=3;if(za&&u!==void 0&&w)for(G=0;G<4;G++)C=u[G],va[ra]=C.u,va[ra+1]=C.v,ra+=2;if(za&&z!==void 0&&w)for(G=0;G<4;G++)C=z[G],ua[V]=C.u,ua[V+1]=C.v,V+=2;Aa&&(ta[xa]=U,ta[xa+1]=U+1,ta[xa+2]=U+3,ta[xa+3]=U+1,ta[xa+4]=U+2,ta[xa+5]=U+3,xa+=6,wa[pa]=U,wa[pa+1]=U+1,wa[pa+2]=U,wa[pa+
+3]=U+3,wa[pa+4]=U+1,wa[pa+5]=U+2,wa[pa+6]=U+2,wa[pa+7]=U+3,pa+=8,U+=4)}Fa&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,ga,y));if(ja)for(qa in ja)B=ja[qa],B.__original.needsUpdate&&(o.bindBuffer(o.ARRAY_BUFFER,B.buffer),o.bufferData(o.ARRAY_BUFFER,B.array,y));if(Ga){K=0;for(B=La.length;K<B;K++)o.bindBuffer(o.ARRAY_BUFFER,p.__webglMorphTargetsBuffers[K]),o.bufferData(o.ARRAY_BUFFER,Ea[K],y)}Ba&&Y>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,
+da,y));Ha&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglNormalBuffer),o.bufferData(o.ARRAY_BUFFER,ka,y));Ka&&la.hasTangents&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglTangentBuffer),o.bufferData(o.ARRAY_BUFFER,ia,y));za&&ra>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglUVBuffer),o.bufferData(o.ARRAY_BUFFER,va,y));za&&V>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglUV2Buffer),o.bufferData(o.ARRAY_BUFFER,ua,y));Aa&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,ta,y),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,
+p.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,wa,y));T>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinVertexABuffer),o.bufferData(o.ARRAY_BUFFER,ca,y),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinVertexBBuffer),o.bufferData(o.ARRAY_BUFFER,aa,y),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinIndicesBuffer),o.bufferData(o.ARRAY_BUFFER,ea,y),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinWeightsBuffer),o.bufferData(o.ARRAY_BUFFER,fa,y));M&&(delete p.__inittedArrays,delete p.__colorArray,delete p.__normalArray,
+delete p.__tangentArray,delete p.__uvArray,delete p.__uv2Array,delete p.__faceArray,delete p.__vertexArray,delete p.__lineArray,delete p.__skinVertexAArray,delete p.__skinVertexBArray,delete p.__skinIndexArray,delete p.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;D(m)}else if(k instanceof THREE.Ribbon){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=x=M=M=
+void 0;v=k.vertices;t=k.colors;w=v.length;p=t.length;N=k.__vertexArray;y=k.__colorArray;O=k.__dirtyColors;if(k.__dirtyVertices){for(M=0;M<w;M++)x=v[M].position,n=M*3,N[n]=x.x,N[n+1]=x.y,N[n+2]=x.z;o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,N,m)}if(O){for(M=0;M<p;M++)color=t[M],n=M*3,y[n]=color.r,y[n+1]=color.g,y[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,y,m)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(k instanceof
+THREE.Line){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=x=M=M=void 0;v=k.vertices;t=k.colors;w=v.length;p=t.length;N=k.__vertexArray;y=k.__colorArray;O=k.__dirtyColors;if(k.__dirtyVertices){for(M=0;M<w;M++)x=v[M].position,n=M*3,N[n]=x.x,N[n+1]=x.y,N[n+2]=x.z;o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,N,m)}if(O){for(M=0;M<p;M++)color=t[M],n=M*3,y[n]=color.r,y[n+1]=color.g,y[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer);
+o.bufferData(o.ARRAY_BUFFER,y,m)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(k instanceof THREE.ParticleSystem)h=k.geometry,p=F(h),(h.__dirtyVertices||h.__dirtyColors||k.sortParticles||p)&&c(h,o.DYNAMIC_DRAW,k),h.__dirtyVertices=!1,h.__dirtyColors=!1,D(h)};this.setFaceCulling=function(b,e){b?(!e||e=="ccw"?o.frontFace(o.CCW):o.frontFace(o.CW),b=="back"?o.cullFace(o.BACK):b=="front"?o.cullFace(o.FRONT):o.cullFace(o.FRONT_AND_BACK),o.enable(o.CULL_FACE)):o.disable(o.CULL_FACE)};this.supportsVertexTextures=
 function(){return Ha}};
 THREE.WebGLRenderTarget=function(b,c,e){this.width=b;this.height=c;e=e||{};this.wrapS=e.wrapS!==void 0?e.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=e.wrapT!==void 0?e.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=e.magFilter!==void 0?e.magFilter:THREE.LinearFilter;this.minFilter=e.minFilter!==void 0?e.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=e.format!==void 0?e.format:THREE.RGBAFormat;this.type=e.type!==void 0?e.type:
 THREE.UnsignedByteType;this.depthBuffer=e.depthBuffer!==void 0?e.depthBuffer:!0;this.stencilBuffer=e.stencilBuffer!==void 0?e.stencilBuffer:!0};
@@ -343,21 +343,21 @@ THREE.WebGLRenderTargetCube.prototype=new THREE.WebGLRenderTarget;THREE.WebGLRen
 THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableObject=function(){this.z=this.object=null};THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.materials=null};
-THREE.ColorUtils={adjustHSV:function(b,c,e,f){var h=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,h);h.h=THREE.ColorUtils.clamp(h.h+c,0,1);h.s=THREE.ColorUtils.clamp(h.s+e,0,1);h.v=THREE.ColorUtils.clamp(h.v+f,0,1);b.setHSV(h.h,h.s,h.v)},rgbToHsv:function(b,c){var e=b.r,f=b.g,h=b.b,m=Math.max(Math.max(e,f),h),k=Math.min(Math.min(e,f),h);if(k==m)k=e=0;else{var n=m-k,k=n/m,e=e==m?(f-h)/n:f==m?2+(h-e)/n:4+(e-f)/n;e/=6;e<0&&(e+=1);e>1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=k;c.v=m;return c},
+THREE.ColorUtils={adjustHSV:function(b,c,e,f){var k=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,k);k.h=THREE.ColorUtils.clamp(k.h+c,0,1);k.s=THREE.ColorUtils.clamp(k.s+e,0,1);k.v=THREE.ColorUtils.clamp(k.v+f,0,1);b.setHSV(k.h,k.s,k.v)},rgbToHsv:function(b,c){var e=b.r,f=b.g,k=b.b,m=Math.max(Math.max(e,f),k),h=Math.min(Math.min(e,f),k);if(h==m)h=e=0;else{var n=m-h,h=n/m,e=e==m?(f-k)/n:f==m?2+(k-e)/n:4+(e-f)/n;e/=6;e<0&&(e+=1);e>1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=h;c.v=m;return c},
 clamp:function(b,c,e){return b<c?c:b>e?e:b}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
-THREE.GeometryUtils={merge:function(b,c){var e,f,h=b.vertices.length,m=c instanceof THREE.Mesh?c.geometry:c,k=b.vertices,n=m.vertices,u=b.faces,p=m.faces,v=b.faceVertexUvs[0],m=m.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var t=0,x=n.length;t<x;t++){var w=new THREE.Vertex(n[t].position.clone());e&&e.multiplyVector3(w.position);k.push(w)}t=0;for(x=p.length;t<x;t++){var w=p[t],y,z,C=w.vertexNormals,
-A=w.vertexColors;w instanceof THREE.Face3?y=new THREE.Face3(w.a+h,w.b+h,w.c+h):w instanceof THREE.Face4&&(y=new THREE.Face4(w.a+h,w.b+h,w.c+h,w.d+h));y.normal.copy(w.normal);f&&f.multiplyVector3(y.normal);k=0;for(n=C.length;k<n;k++)z=C[k].clone(),f&&f.multiplyVector3(z),y.vertexNormals.push(z);y.color.copy(w.color);k=0;for(n=A.length;k<n;k++)z=A[k],y.vertexColors.push(z.clone());y.materials=w.materials.slice();y.centroid.copy(w.centroid);e&&e.multiplyVector3(y.centroid);u.push(y)}t=0;for(x=m.length;t<
-x;t++){e=m[t];f=[];k=0;for(n=e.length;k<n;k++)f.push(new THREE.UV(e[k].u,e[k].v));v.push(f)}},clone:function(b){var c=new THREE.Geometry,e,f=b.vertices,h=b.faces,m=b.faceVertexUvs[0],b=0;for(e=f.length;b<e;b++){var k=new THREE.Vertex(f[b].position.clone());c.vertices.push(k)}b=0;for(e=h.length;b<e;b++){var n=h[b],u,p,v=n.vertexNormals,t=n.vertexColors;n instanceof THREE.Face3?u=new THREE.Face3(n.a,n.b,n.c):n instanceof THREE.Face4&&(u=new THREE.Face4(n.a,n.b,n.c,n.d));u.normal.copy(n.normal);f=0;
-for(k=v.length;f<k;f++)p=v[f],u.vertexNormals.push(p.clone());u.color.copy(n.color);f=0;for(k=t.length;f<k;f++)p=t[f],u.vertexColors.push(p.clone());u.materials=n.materials.slice();u.centroid.copy(n.centroid);c.faces.push(u)}b=0;for(e=m.length;b<e;b++){h=m[b];u=[];f=0;for(k=h.length;f<k;f++)u.push(new THREE.UV(h[f].u,h[f].v));c.faceVertexUvs[0].push(u)}return c},randomPointInTriangle:function(b,c,e){var f,h,m,k=new THREE.Vector3,n=THREE.GeometryUtils.__v1;f=THREE.GeometryUtils.random();h=THREE.GeometryUtils.random();
-f+h>1&&(f=1-f,h=1-h);m=1-f-h;k.copy(b);k.multiplyScalar(f);n.copy(c);n.multiplyScalar(h);k.addSelf(n);n.copy(e);n.multiplyScalar(m);k.addSelf(n);return k},randomPointInFace:function(b,c,e){var f,h,m;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,h=c.vertices[b.b].position,m=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,h,m);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;h=c.vertices[b.b].position;m=c.vertices[b.c].position;var c=c.vertices[b.d].position,
-k;e?b._area1&&b._area2?(e=b._area1,k=b._area2):(e=THREE.GeometryUtils.triangleArea(f,h,c),k=THREE.GeometryUtils.triangleArea(h,m,c),b._area1=e,b._area2=k):(e=THREE.GeometryUtils.triangleArea(f,h,c),k=THREE.GeometryUtils.triangleArea(h,m,c));return THREE.GeometryUtils.random()*(e+k)<e?THREE.GeometryUtils.randomPointInTriangle(f,h,c):THREE.GeometryUtils.randomPointInTriangle(h,m,c)}},randomPointsInGeometry:function(b,c){function e(b){function e(c,f){if(f<c)return c;var h=c+Math.floor((f-c)/2);return p[h]>
-b?e(c,h-1):p[h]<b?e(h+1,f):h}return e(0,p.length-1)}var f,h,m=b.faces,k=b.vertices,n=m.length,u=0,p=[],v,t,x,w;for(h=0;h<n;h++){f=m[h];if(f instanceof THREE.Face3)v=k[f.a].position,t=k[f.b].position,x=k[f.c].position,f._area=THREE.GeometryUtils.triangleArea(v,t,x);else if(f instanceof THREE.Face4)v=k[f.a].position,t=k[f.b].position,x=k[f.c].position,w=k[f.d].position,f._area1=THREE.GeometryUtils.triangleArea(v,t,w),f._area2=THREE.GeometryUtils.triangleArea(t,x,w),f._area=f._area1+f._area2;u+=f._area;
-p[h]=u}f=[];k={};for(h=0;h<c;h++)n=THREE.GeometryUtils.random()*u,n=e(n),f[h]=THREE.GeometryUtils.randomPointInFace(m[n],b,!0),k[n]?k[n]+=1:k[n]=1;return f},triangleArea:function(b,c,e){var f,h=THREE.GeometryUtils.__v1;h.sub(b,c);f=h.length();h.sub(b,e);b=h.length();h.sub(c,e);e=h.length();c=0.5*(f+b+e);return Math.sqrt(c*(c-f)*(c-b)*(c-e))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},center:function(b){b.computeBoundingBox();var c=new THREE.Matrix4;c.setTranslation(-0.5*
+THREE.GeometryUtils={merge:function(b,c){var e,f,k=b.vertices.length,m=c instanceof THREE.Mesh?c.geometry:c,h=b.vertices,n=m.vertices,p=b.faces,t=m.faces,u=b.faceVertexUvs[0],m=m.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var w=0,x=n.length;w<x;w++){var v=new THREE.Vertex(n[w].position.clone());e&&e.multiplyVector3(v.position);h.push(v)}w=0;for(x=t.length;w<x;w++){var v=t[w],y,z,C=v.vertexNormals,
+A=v.vertexColors;v instanceof THREE.Face3?y=new THREE.Face3(v.a+k,v.b+k,v.c+k):v instanceof THREE.Face4&&(y=new THREE.Face4(v.a+k,v.b+k,v.c+k,v.d+k));y.normal.copy(v.normal);f&&f.multiplyVector3(y.normal);h=0;for(n=C.length;h<n;h++)z=C[h].clone(),f&&f.multiplyVector3(z),y.vertexNormals.push(z);y.color.copy(v.color);h=0;for(n=A.length;h<n;h++)z=A[h],y.vertexColors.push(z.clone());y.materials=v.materials.slice();y.centroid.copy(v.centroid);e&&e.multiplyVector3(y.centroid);p.push(y)}w=0;for(x=m.length;w<
+x;w++){e=m[w];f=[];h=0;for(n=e.length;h<n;h++)f.push(new THREE.UV(e[h].u,e[h].v));u.push(f)}},clone:function(b){var c=new THREE.Geometry,e,f=b.vertices,k=b.faces,m=b.faceVertexUvs[0],b=0;for(e=f.length;b<e;b++){var h=new THREE.Vertex(f[b].position.clone());c.vertices.push(h)}b=0;for(e=k.length;b<e;b++){var n=k[b],p,t,u=n.vertexNormals,w=n.vertexColors;n instanceof THREE.Face3?p=new THREE.Face3(n.a,n.b,n.c):n instanceof THREE.Face4&&(p=new THREE.Face4(n.a,n.b,n.c,n.d));p.normal.copy(n.normal);f=0;
+for(h=u.length;f<h;f++)t=u[f],p.vertexNormals.push(t.clone());p.color.copy(n.color);f=0;for(h=w.length;f<h;f++)t=w[f],p.vertexColors.push(t.clone());p.materials=n.materials.slice();p.centroid.copy(n.centroid);c.faces.push(p)}b=0;for(e=m.length;b<e;b++){k=m[b];p=[];f=0;for(h=k.length;f<h;f++)p.push(new THREE.UV(k[f].u,k[f].v));c.faceVertexUvs[0].push(p)}return c},randomPointInTriangle:function(b,c,e){var f,k,m,h=new THREE.Vector3,n=THREE.GeometryUtils.__v1;f=THREE.GeometryUtils.random();k=THREE.GeometryUtils.random();
+f+k>1&&(f=1-f,k=1-k);m=1-f-k;h.copy(b);h.multiplyScalar(f);n.copy(c);n.multiplyScalar(k);h.addSelf(n);n.copy(e);n.multiplyScalar(m);h.addSelf(n);return h},randomPointInFace:function(b,c,e){var f,k,m;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,k=c.vertices[b.b].position,m=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,k,m);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;k=c.vertices[b.b].position;m=c.vertices[b.c].position;var c=c.vertices[b.d].position,
+h;e?b._area1&&b._area2?(e=b._area1,h=b._area2):(e=THREE.GeometryUtils.triangleArea(f,k,c),h=THREE.GeometryUtils.triangleArea(k,m,c),b._area1=e,b._area2=h):(e=THREE.GeometryUtils.triangleArea(f,k,c),h=THREE.GeometryUtils.triangleArea(k,m,c));return THREE.GeometryUtils.random()*(e+h)<e?THREE.GeometryUtils.randomPointInTriangle(f,k,c):THREE.GeometryUtils.randomPointInTriangle(k,m,c)}},randomPointsInGeometry:function(b,c){function e(b){function e(c,f){if(f<c)return c;var h=c+Math.floor((f-c)/2);return t[h]>
+b?e(c,h-1):t[h]<b?e(h+1,f):h}return e(0,t.length-1)}var f,k,m=b.faces,h=b.vertices,n=m.length,p=0,t=[],u,w,x,v;for(k=0;k<n;k++){f=m[k];if(f instanceof THREE.Face3)u=h[f.a].position,w=h[f.b].position,x=h[f.c].position,f._area=THREE.GeometryUtils.triangleArea(u,w,x);else if(f instanceof THREE.Face4)u=h[f.a].position,w=h[f.b].position,x=h[f.c].position,v=h[f.d].position,f._area1=THREE.GeometryUtils.triangleArea(u,w,v),f._area2=THREE.GeometryUtils.triangleArea(w,x,v),f._area=f._area1+f._area2;p+=f._area;
+t[k]=p}f=[];h={};for(k=0;k<c;k++)n=THREE.GeometryUtils.random()*p,n=e(n),f[k]=THREE.GeometryUtils.randomPointInFace(m[n],b,!0),h[n]?h[n]+=1:h[n]=1;return f},triangleArea:function(b,c,e){var f,k=THREE.GeometryUtils.__v1;k.sub(b,c);f=k.length();k.sub(b,e);b=k.length();k.sub(c,e);e=k.length();c=0.5*(f+b+e);return Math.sqrt(c*(c-f)*(c-b)*(c-e))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},center:function(b){b.computeBoundingBox();var c=new THREE.Matrix4;c.setTranslation(-0.5*
 (b.boundingBox.x[1]+b.boundingBox.x[0]),-0.5*(b.boundingBox.y[1]+b.boundingBox.y[0]),-0.5*(b.boundingBox.z[1]+b.boundingBox.z[0]));b.applyMatrix(c);b.computeBoundingBox()}};THREE.GeometryUtils.random=THREE.GeometryUtils.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;
-THREE.ImageUtils={loadTexture:function(b,c,e){var f=new Image,h=new THREE.Texture(f,c);f.onload=function(){h.needsUpdate=!0;e&&e(this)};f.crossOrigin="";f.src=b;return h},loadTextureCube:function(b,c,e){var f,h=[],m=new THREE.Texture(h,c),c=h.loadCount=0;for(f=b.length;c<f;++c)h[c]=new Image,h[c].onload=function(){h.loadCount+=1;if(h.loadCount==6)m.needsUpdate=!0;e&&e(this)},h[c].crossOrigin="",h[c].src=b[c];return m},getNormalMap:function(b,c){var e=function(b){var e=Math.sqrt(b[0]*b[0]+b[1]*b[1]+
-b[2]*b[2]);return[b[0]/e,b[1]/e,b[2]/e]};c|=1;var f=b.width,h=b.height,m=document.createElement("canvas");m.width=f;m.height=h;var k=m.getContext("2d");k.drawImage(b,0,0);for(var n=k.getImageData(0,0,f,h).data,u=k.createImageData(f,h),p=u.data,v=0;v<f;v++)for(var t=1;t<h;t++){var x=t-1<0?h-1:t-1,w=(t+1)%h,y=v-1<0?f-1:v-1,z=(v+1)%f,C=[],A=[0,0,n[(t*f+v)*4]/255*c];C.push([-1,0,n[(t*f+y)*4]/255*c]);C.push([-1,-1,n[(x*f+y)*4]/255*c]);C.push([0,-1,n[(x*f+v)*4]/255*c]);C.push([1,-1,n[(x*f+z)*4]/255*c]);
-C.push([1,0,n[(t*f+z)*4]/255*c]);C.push([1,1,n[(w*f+z)*4]/255*c]);C.push([0,1,n[(w*f+v)*4]/255*c]);C.push([-1,1,n[(w*f+y)*4]/255*c]);x=[];y=C.length;for(w=0;w<y;w++){var z=C[w],F=C[(w+1)%y],z=[z[0]-A[0],z[1]-A[1],z[2]-A[2]],F=[F[0]-A[0],F[1]-A[1],F[2]-A[2]];x.push(e([z[1]*F[2]-z[2]*F[1],z[2]*F[0]-z[0]*F[2],z[0]*F[1]-z[1]*F[0]]))}C=[0,0,0];for(w=0;w<x.length;w++)C[0]+=x[w][0],C[1]+=x[w][1],C[2]+=x[w][2];C[0]/=x.length;C[1]/=x.length;C[2]/=x.length;A=(t*f+v)*4;p[A]=(C[0]+1)/2*255|0;p[A+1]=(C[1]+0.5)*
-255|0;p[A+2]=C[2]*255|0;p[A+3]=255}k.putImageData(u,0,0);return m}};THREE.SceneUtils={showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var e,f,h=b.children.length;for(f=0;f<h;f++)e=b.children[f],c(e),THREE.SceneUtils.traverseHierarchy(e,c)}};
+THREE.ImageUtils={loadTexture:function(b,c,e){var f=new Image,k=new THREE.Texture(f,c);f.onload=function(){k.needsUpdate=!0;e&&e(this)};f.crossOrigin="";f.src=b;return k},loadTextureCube:function(b,c,e){var f,k=[],m=new THREE.Texture(k,c),c=k.loadCount=0;for(f=b.length;c<f;++c)k[c]=new Image,k[c].onload=function(){k.loadCount+=1;if(k.loadCount==6)m.needsUpdate=!0;e&&e(this)},k[c].crossOrigin="",k[c].src=b[c];return m},getNormalMap:function(b,c){var e=function(b){var e=Math.sqrt(b[0]*b[0]+b[1]*b[1]+
+b[2]*b[2]);return[b[0]/e,b[1]/e,b[2]/e]};c|=1;var f=b.width,k=b.height,m=document.createElement("canvas");m.width=f;m.height=k;var h=m.getContext("2d");h.drawImage(b,0,0);for(var n=h.getImageData(0,0,f,k).data,p=h.createImageData(f,k),t=p.data,u=0;u<f;u++)for(var w=1;w<k;w++){var x=w-1<0?k-1:w-1,v=(w+1)%k,y=u-1<0?f-1:u-1,z=(u+1)%f,C=[],A=[0,0,n[(w*f+u)*4]/255*c];C.push([-1,0,n[(w*f+y)*4]/255*c]);C.push([-1,-1,n[(x*f+y)*4]/255*c]);C.push([0,-1,n[(x*f+u)*4]/255*c]);C.push([1,-1,n[(x*f+z)*4]/255*c]);
+C.push([1,0,n[(w*f+z)*4]/255*c]);C.push([1,1,n[(v*f+z)*4]/255*c]);C.push([0,1,n[(v*f+u)*4]/255*c]);C.push([-1,1,n[(v*f+y)*4]/255*c]);x=[];y=C.length;for(v=0;v<y;v++){var z=C[v],F=C[(v+1)%y],z=[z[0]-A[0],z[1]-A[1],z[2]-A[2]],F=[F[0]-A[0],F[1]-A[1],F[2]-A[2]];x.push(e([z[1]*F[2]-z[2]*F[1],z[2]*F[0]-z[0]*F[2],z[0]*F[1]-z[1]*F[0]]))}C=[0,0,0];for(v=0;v<x.length;v++)C[0]+=x[v][0],C[1]+=x[v][1],C[2]+=x[v][2];C[0]/=x.length;C[1]/=x.length;C[2]/=x.length;A=(w*f+u)*4;t[A]=(C[0]+1)/2*255|0;t[A+1]=(C[1]+0.5)*
+255|0;t[A+2]=C[2]*255|0;t[A+3]=255}h.putImageData(p,0,0);return m}};THREE.SceneUtils={showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var e,f,k=b.children.length;for(f=0;f<k;f++)e=b.children[f],c(e),THREE.SceneUtils.traverseHierarchy(e,c)}};
 if(THREE.WebGLRenderer)THREE.ShaderUtils={lib:{fresnel:{uniforms:{mRefractionRatio:{type:"f",value:1.02},mFresnelBias:{type:"f",value:0.1},mFresnelPower:{type:"f",value:2},mFresnelScale:{type:"f",value:1},tCube:{type:"t",value:1,texture:null}},fragmentShader:"uniform samplerCube tCube;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\nvec4 refractedColor = vec4( 1.0, 1.0, 1.0, 1.0 );\nrefractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;\nrefractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;\nrefractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;\nrefractedColor.a = 1.0;\ngl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );\n}",
 vertexShader:"uniform float mRefractionRatio;\nuniform float mFresnelBias;\nuniform float mFresnelScale;\nuniform float mFresnelPower;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = normalize ( mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal );\nvec3 I = mPosition.xyz - cameraPosition;\nvReflect = reflect( I, nWorld );\nvRefract[0] = refract( normalize( I ), nWorld, mRefractionRatio );\nvRefract[1] = refract( normalize( I ), nWorld, mRefractionRatio * 0.99 );\nvRefract[2] = refract( normalize( I ), nWorld, mRefractionRatio * 0.98 );\nvReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), nWorld ), mFresnelPower );\ngl_Position = projectionMatrix * mvPosition;\n}"},
 normal:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.fog,THREE.UniformsLib.lights,{enableAO:{type:"i",value:0},enableDiffuse:{type:"i",value:0},enableSpecular:{type:"i",value:0},tDiffuse:{type:"t",value:0,texture:null},tNormal:{type:"t",value:2,texture:null},tSpecular:{type:"t",value:3,texture:null},tAO:{type:"t",value:4,texture:null},uNormalScale:{type:"f",value:1},tDisplacement:{type:"t",value:5,texture:null},uDisplacementBias:{type:"f",value:0},uDisplacementScale:{type:"f",value:1},uDiffuseColor:{type:"c",
@@ -366,224 +366,228 @@ THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( vec3( 1
 THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:"attribute vec4 tangent;\n#ifdef VERTEX_TEXTURES\nuniform sampler2D tDisplacement;\nuniform float uDisplacementScale;\nuniform float uDisplacementBias;\n#endif\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvViewPosition = -mvPosition.xyz;\nvNormal = normalize( normalMatrix * normal );\nvTangent = normalize( normalMatrix * tangent.xyz );\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvBinormal = normalize( vBinormal );\nvUv = uv;\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#ifdef VERTEX_TEXTURES\nvec3 dv = texture2D( tDisplacement, uv ).xyz;\nfloat df = uDisplacementScale * dv.x + uDisplacementBias;\nvec4 displacedPosition = vec4( vNormal.xyz * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif\n}"},
 cube:{uniforms:{tCube:{type:"t",value:1,texture:null}},vertexShader:"varying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvViewPosition = cameraPosition - mPosition.xyz;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform samplerCube tCube;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( - wPos.x, wPos.yz ) );\n}"}}};
 THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(b){return this.getPoint(this.getUtoTmapping(b))};THREE.Curve.prototype.getPoints=function(b){b||(b=5);var c,e=[];for(c=0;c<=b;c++)e.push(this.getPoint(c/b));return e};THREE.Curve.prototype.getSpacedPoints=function(b){b||(b=5);var c,e=[];for(c=0;c<=b;c++)e.push(this.getPointAt(c/b));return e};
-THREE.Curve.prototype.getLength=function(){var b=this.getLengths();return b[b.length-1]};THREE.Curve.prototype.getLengths=function(b){b||(b=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==b+1)return this.cacheArcLengths;var c=[],e,f=this.getPoint(0),h,m=0;c.push(0);for(h=1;h<=b;h++)e=this.getPoint(h/b),m+=e.distanceTo(f),c.push(m),f=e;return this.cacheArcLengths=c};
-THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,h=e.length,m;m=c?c:b*e[h-1];time=Date.now();for(var k=0,n=h-1,u;k<=n;)if(f=Math.floor(k+(n-k)/2),u=e[f]-m,u<0)k=f+1;else if(u>0)n=f-1;else{n=f;break}f=n;if(e[f]==m)return f/(h-1);k=e[f];return e=(f+(m-k)/(e[f+1]-k))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)};
+THREE.Curve.prototype.getLength=function(){var b=this.getLengths();return b[b.length-1]};THREE.Curve.prototype.getLengths=function(b){b||(b=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==b+1)return this.cacheArcLengths;var c=[],e,f=this.getPoint(0),k,m=0;c.push(0);for(k=1;k<=b;k++)e=this.getPoint(k/b),m+=e.distanceTo(f),c.push(m),f=e;return this.cacheArcLengths=c};
+THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,k=e.length,m;m=c?c:b*e[k-1];time=Date.now();for(var h=0,n=k-1,p;h<=n;)if(f=Math.floor(h+(n-h)/2),p=e[f]-m,p<0)h=f+1;else if(p>0)n=f-1;else{n=f;break}f=n;if(e[f]==m)return f/(k-1);h=e[f];return e=(f+(m-h)/(e[f+1]-h))/(k-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)};
 THREE.Curve.prototype.getTangent=function(b){var c=b-1.0E-4;b+=1.0E-4;c<0&&(c=0);b>1&&(b=1);var c=this.getPoint(c),b=this.getPoint(b),e=new THREE.Vector2;e.sub(b,c);return e.unit()};THREE.LineCurve=function(b,c){b instanceof THREE.Vector2?(this.v1=b,this.v2=c):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(b,c,e,f){this.constructor(new THREE.Vector2(b,c),new THREE.Vector2(e,f))};THREE.LineCurve.prototype=new THREE.Curve;
 THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2;c.sub(this.v2,this.v1);c.multiplyScalar(b).addSelf(this.v1);return c};THREE.LineCurve.prototype.getPointAt=function(b){return this.getPoint(b)};THREE.LineCurve.prototype.getTangent=function(){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.normalize();return b};
 THREE.QuadraticBezierCurve=function(b,c,e){if(!(c instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),b=new THREE.Vector2(f[0],f[1]),c=new THREE.Vector2(f[2],f[3]),e=new THREE.Vector2(f[4],f[5]);this.v0=b;this.v1=c;this.v2=e};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
 THREE.QuadraticBezierCurve.prototype.getPoint=function(b){var c;c=THREE.Shape.Utils.b2(b,this.v0.x,this.v1.x,this.v2.x);b=THREE.Shape.Utils.b2(b,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(c,b)};THREE.QuadraticBezierCurve.prototype.getTangent=function(b){var c;c=THREE.Curve.Utils.tangentQuadraticBezier(b,this.v0.x,this.v1.x,this.v2.x);b=THREE.Curve.Utils.tangentQuadraticBezier(b,this.v0.y,this.v1.y,this.v2.y);c=new THREE.Vector2(c,b);c.normalize();return c};
-THREE.CubicBezierCurve=function(b,c,e,f){if(!(c instanceof THREE.Vector2))var h=Array.prototype.slice.call(arguments),b=new THREE.Vector2(h[0],h[1]),c=new THREE.Vector2(h[2],h[3]),e=new THREE.Vector2(h[4],h[5]),f=new THREE.Vector2(h[6],h[7]);this.v0=b;this.v1=c;this.v2=e;this.v3=f};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve;
+THREE.CubicBezierCurve=function(b,c,e,f){if(!(c instanceof THREE.Vector2))var k=Array.prototype.slice.call(arguments),b=new THREE.Vector2(k[0],k[1]),c=new THREE.Vector2(k[2],k[3]),e=new THREE.Vector2(k[4],k[5]),f=new THREE.Vector2(k[6],k[7]);this.v0=b;this.v1=c;this.v2=e;this.v3=f};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve;
 THREE.CubicBezierCurve.prototype.getPoint=function(b){var c;c=THREE.Shape.Utils.b3(b,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b=THREE.Shape.Utils.b3(b,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(c,b)};THREE.CubicBezierCurve.prototype.getTangent=function(b){var c;c=THREE.Curve.Utils.tangentCubicBezier(b,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b=THREE.Curve.Utils.tangentCubicBezier(b,this.v0.y,this.v1.y,this.v2.y,this.v3.y);c=new THREE.Vector2(c,b);c.normalize();return c};
 THREE.SplineCurve=function(b){this.points=b};THREE.SplineCurve.prototype=new THREE.Curve;THREE.SplineCurve.prototype.constructor=THREE.SplineCurve;
-THREE.SplineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2,e=[],f=this.points,h;h=(f.length-1)*b;b=Math.floor(h);h-=b;e[0]=b==0?b:b-1;e[1]=b;e[2]=b>f.length-2?b:b+1;e[3]=b>f.length-3?b:b+2;c.x=THREE.Curve.Utils.interpolate(f[e[0]].x,f[e[1]].x,f[e[2]].x,f[e[3]].x,h);c.y=THREE.Curve.Utils.interpolate(f[e[0]].y,f[e[1]].y,f[e[2]].y,f[e[3]].y,h);return c};THREE.ArcCurve=function(b,c,e,f,h,m){this.aX=b;this.aY=c;this.aRadius=e;this.aStartAngle=f;this.aEndAngle=h;this.aClockwise=m};
+THREE.SplineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2,e=[],f=this.points,k;k=(f.length-1)*b;b=Math.floor(k);k-=b;e[0]=b==0?b:b-1;e[1]=b;e[2]=b>f.length-2?b:b+1;e[3]=b>f.length-3?b:b+2;c.x=THREE.Curve.Utils.interpolate(f[e[0]].x,f[e[1]].x,f[e[2]].x,f[e[3]].x,k);c.y=THREE.Curve.Utils.interpolate(f[e[0]].y,f[e[1]].y,f[e[2]].y,f[e[3]].y,k);return c};THREE.ArcCurve=function(b,c,e,f,k,m){this.aX=b;this.aY=c;this.aRadius=e;this.aStartAngle=f;this.aEndAngle=k;this.aClockwise=m};
 THREE.ArcCurve.prototype=new THREE.Curve;THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.ArcCurve.prototype.getPoint=function(b){var c=this.aEndAngle-this.aStartAngle;this.aClockwise||(b=1-b);b=this.aStartAngle+b*c;return new THREE.Vector2(this.aX+this.aRadius*Math.cos(b),this.aY+this.aRadius*Math.sin(b))};
-THREE.Curve.Utils={tangentQuadraticBezier:function(b,c,e,f){return 2*(1-b)*(e-c)+2*b*(f-e)},tangentCubicBezier:function(b,c,e,f,h){return-3*c*(1-b)*(1-b)+3*e*(1-b)*(1-b)-6*b*e*(1-b)+6*b*f*(1-b)-3*b*b*f+3*b*b*h},tangentSpline:function(b){return 6*b*b-6*b+(3*b*b-4*b+1)+(-6*b*b+6*b)+(3*b*b-2*b)},interpolate:function(b,c,e,f,h){var b=(e-b)*0.5,f=(f-c)*0.5,m=h*h;return(2*c-2*e+b+f)*h*m+(-3*c+3*e-2*b-f)*m+b*h+c}};
+THREE.Curve.Utils={tangentQuadraticBezier:function(b,c,e,f){return 2*(1-b)*(e-c)+2*b*(f-e)},tangentCubicBezier:function(b,c,e,f,k){return-3*c*(1-b)*(1-b)+3*e*(1-b)*(1-b)-6*b*e*(1-b)+6*b*f*(1-b)-3*b*b*f+3*b*b*k},tangentSpline:function(b){return 6*b*b-6*b+(3*b*b-4*b+1)+(-6*b*b+6*b)+(3*b*b-2*b)},interpolate:function(b,c,e,f,k){var b=(e-b)*0.5,f=(f-c)*0.5,m=k*k;return(2*c-2*e+b+f)*k*m+(-3*c+3*e-2*b-f)*m+b*k+c}};
 THREE.Curve.create=function(b,c){b.prototype=new THREE.Curve;b.prototype.constructor=b;b.prototype.getPoint=c;return b};THREE.LineCurve3=THREE.Curve.create(function(b,c){this.v1=b;this.v2=c},function(b){var c=new THREE.Vector3;c.sub(v2,v1);c.multiplyScalar(b);c.addSelf(this.v1);return c});
 THREE.QuadraticBezierCurve3=THREE.Curve.create(function(b,c,e){this.v0=b;this.v1=c;this.v2=e},function(b){var c,e;c=THREE.Shape.Utils.b2(b,this.v0.x,this.v1.x,this.v2.x);e=THREE.Shape.Utils.b2(b,this.v0.y,this.v1.y,this.v2.y);b=THREE.Shape.Utils.b2(b,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(c,e,b)});THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(b){this.curves.push(b)};
 THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){};THREE.CurvePath.prototype.getPoint=function(b){for(var c=b*this.getLength(),e=this.getCurveLengths(),b=0;b<e.length;){if(e[b]>=c)return c=e[b]-c,b=this.curves[b],c=1-c/b.getLength(),b.getPointAt(c);b++}return null};THREE.CurvePath.prototype.getLength=function(){var b=this.getCurveLengths();return b[b.length-1]};
 THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var b=[],c=0,e,f=this.curves.length;for(e=0;e<f;e++)c+=this.curves[e].getLength(),b.push(c);return this.cacheLengths=b};
-THREE.CurvePath.prototype.getBoundingBox=function(){var b=this.getPoints(),c,e,f,h;c=e=Number.NEGATIVE_INFINITY;f=h=Number.POSITIVE_INFINITY;var m,k,n,u;u=new THREE.Vector2;k=0;for(n=b.length;k<n;k++){m=b[k];if(m.x>c)c=m.x;else if(m.x<f)f=m.x;if(m.y>e)e=m.y;else if(m.y<e)h=m.y;u.addSelf(m.x,m.y)}return{minX:f,minY:h,maxX:c,maxY:e,centroid:u.divideScalar(n)}};THREE.CurvePath.prototype.createPointsGeometry=function(b){return this.createGeometry(this.getPoints(b,!0))};
+THREE.CurvePath.prototype.getBoundingBox=function(){var b=this.getPoints(),c,e,f,k;c=e=Number.NEGATIVE_INFINITY;f=k=Number.POSITIVE_INFINITY;var m,h,n,p;p=new THREE.Vector2;h=0;for(n=b.length;h<n;h++){m=b[h];if(m.x>c)c=m.x;else if(m.x<f)f=m.x;if(m.y>e)e=m.y;else if(m.y<e)k=m.y;p.addSelf(m.x,m.y)}return{minX:f,minY:k,maxX:c,maxY:e,centroid:p.divideScalar(n)}};THREE.CurvePath.prototype.createPointsGeometry=function(b){return this.createGeometry(this.getPoints(b,!0))};
 THREE.CurvePath.prototype.createSpacedPointsGeometry=function(b){return this.createGeometry(this.getSpacedPoints(b,!0))};THREE.CurvePath.prototype.createGeometry=function(b){for(var c=new THREE.Geometry,e=0;e<b.length;e++)c.vertices.push(new THREE.Vertex(new THREE.Vector3(b[e].x,b[e].y,0)));return c};THREE.CurvePath.prototype.addWrapPath=function(b){this.bends.push(b)};
-THREE.CurvePath.prototype.getTransformedPoints=function(b,c){var e=this.getPoints(b),f,h;if(!c)c=this.bends;f=0;for(h=c.length;f<h;f++)e=this.getWrapPoints(e,c[f]);return e};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(b,c){var e=this.getSpacedPoints(b),f,h;if(!c)c=this.bends;f=0;for(h=c.length;f<h;f++)e=this.getWrapPoints(e,c[f]);return e};
-THREE.CurvePath.prototype.getWrapPoints=function(b,c){var e=this.getBoundingBox(),f,h,m,k,n,u;f=0;for(h=b.length;f<h;f++)m=b[f],k=m.x,n=m.y,u=k/e.maxX,u=c.getUtoTmapping(u,k),k=c.getPoint(u),n=c.getNormalVector(u).multiplyScalar(n),m.x=k.x+n.x,m.y=k.y+n.y;return b};THREE.Path=function(b){THREE.CurvePath.call(this);this.actions=[];b&&this.fromPoints(b)};THREE.Path.prototype=new THREE.CurvePath;THREE.Path.prototype.constructor=THREE.Path;
+THREE.CurvePath.prototype.getTransformedPoints=function(b,c){var e=this.getPoints(b),f,k;if(!c)c=this.bends;f=0;for(k=c.length;f<k;f++)e=this.getWrapPoints(e,c[f]);return e};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(b,c){var e=this.getSpacedPoints(b),f,k;if(!c)c=this.bends;f=0;for(k=c.length;f<k;f++)e=this.getWrapPoints(e,c[f]);return e};
+THREE.CurvePath.prototype.getWrapPoints=function(b,c){var e=this.getBoundingBox(),f,k,m,h,n,p;f=0;for(k=b.length;f<k;f++)m=b[f],h=m.x,n=m.y,p=h/e.maxX,p=c.getUtoTmapping(p,h),h=c.getPoint(p),n=c.getNormalVector(p).multiplyScalar(n),m.x=h.x+n.x,m.y=h.y+n.y;return b};THREE.Path=function(b){THREE.CurvePath.call(this);this.actions=[];b&&this.fromPoints(b)};THREE.Path.prototype=new THREE.CurvePath;THREE.Path.prototype.constructor=THREE.Path;
 THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc"};THREE.Path.prototype.fromPoints=function(b){this.moveTo(b[0].x,b[0].y);var c,e=b.length;for(c=1;c<e;c++)this.lineTo(b[c].x,b[c].y)};THREE.Path.prototype.moveTo=function(){var b=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:b})};
 THREE.Path.prototype.lineTo=function(b,c){var e=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args;this.curves.push(new THREE.LineCurve(new THREE.Vector2(f[f.length-2],f[f.length-1]),new THREE.Vector2(b,c)));this.actions.push({action:THREE.PathActions.LINE_TO,args:e})};
-THREE.Path.prototype.quadraticCurveTo=function(b,c,e,f){var h=Array.prototype.slice.call(arguments),m=this.actions[this.actions.length-1].args;this.curves.push(new THREE.QuadraticBezierCurve(new THREE.Vector2(m[m.length-2],m[m.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f)));this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:h})};
-THREE.Path.prototype.bezierCurveTo=function(b,c,e,f,h,m){var k=Array.prototype.slice.call(arguments),n=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(n[n.length-2],n[n.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f),new THREE.Vector2(h,m)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:k})};
+THREE.Path.prototype.quadraticCurveTo=function(b,c,e,f){var k=Array.prototype.slice.call(arguments),m=this.actions[this.actions.length-1].args;this.curves.push(new THREE.QuadraticBezierCurve(new THREE.Vector2(m[m.length-2],m[m.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f)));this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:k})};
+THREE.Path.prototype.bezierCurveTo=function(b,c,e,f,k,m){var h=Array.prototype.slice.call(arguments),n=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(n[n.length-2],n[n.length-1]),new THREE.Vector2(b,c),new THREE.Vector2(e,f),new THREE.Vector2(k,m)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:h})};
 THREE.Path.prototype.splineThru=function(b){var c=Array.prototype.slice.call(arguments),e=this.actions[this.actions.length-1].args,e=[new THREE.Vector2(e[e.length-2],e[e.length-1])];Array.prototype.push.apply(e,b);this.curves.push(new THREE.SplineCurve(e));this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:c})};
-THREE.Path.prototype.arc=function(b,c,e,f,h,m){var k=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(b,c,e,f,h,m));this.actions.push({action:THREE.PathActions.ARC,args:k})};THREE.Path.prototype.getSpacedPoints=function(b){b||(b=40);for(var c=[],e=0;e<b;e++)c.push(this.getPoint(e/b));return c};
-THREE.Path.prototype.getPoints=function(b,c){var b=b||12,e=[],f,h,m,k,n,u,p,v,t,x,w,y,z;f=0;for(h=this.actions.length;f<h;f++)switch(m=this.actions[f],k=m.action,m=m.args,k){case THREE.PathActions.LINE_TO:e.push(new THREE.Vector2(m[0],m[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:n=m[2];u=m[3];t=m[0];x=m[1];e.length>0?(k=e[e.length-1],w=k.x,y=k.y):(k=this.actions[f-1].args,w=k[k.length-2],y=k[k.length-1]);for(k=1;k<=b;k++)z=k/b,m=THREE.Shape.Utils.b2(z,w,t,n),z=THREE.Shape.Utils.b2(z,y,x,
-u),e.push(new THREE.Vector2(m,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=m[4];u=m[5];t=m[0];x=m[1];p=m[2];v=m[3];e.length>0?(k=e[e.length-1],w=k.x,y=k.y):(k=this.actions[f-1].args,w=k[k.length-2],y=k[k.length-1]);for(k=1;k<=b;k++)z=k/b,m=THREE.Shape.Utils.b3(z,w,t,p,n),z=THREE.Shape.Utils.b3(z,y,x,v,u),e.push(new THREE.Vector2(m,z));break;case THREE.PathActions.CSPLINE_THRU:k=this.actions[f-1].args;k=[new THREE.Vector2(k[k.length-2],k[k.length-1])];z=b*m[0].length;k=k.concat(m[0]);m=new THREE.SplineCurve(k);
-for(k=1;k<=z;k++)e.push(m.getPointAt(k/z));break;case THREE.PathActions.ARC:k=this.actions[f-1].args;n=m[0];u=m[1];p=m[2];t=m[3];z=m[4];x=!!m[5];v=k[k.length-2];w=k[k.length-1];k.length==0&&(v=w=0);y=z-t;var C=b*2;for(k=1;k<=C;k++)z=k/C,x||(z=1-z),z=t+z*y,m=v+n+p*Math.cos(z),z=w+u+p*Math.sin(z),e.push(new THREE.Vector2(m,z))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)};
-THREE.Path.prototype.nltransform=function(b,c,e,f,h,m){var k=this.getPoints(),n,u,p,v,t;n=0;for(u=k.length;n<u;n++)p=k[n],v=p.x,t=p.y,p.x=b*v+c*t+e,p.y=f*t+h*v+m;return k};
-THREE.Path.prototype.debug=function(b){var c=this.getBoundingBox();b||(b=document.createElement("canvas"),b.setAttribute("width",c.maxX+100),b.setAttribute("height",c.maxY+100),document.body.appendChild(b));c=b.getContext("2d");c.fillStyle="white";c.fillRect(0,0,b.width,b.height);c.strokeStyle="black";c.beginPath();var e,f,h,b=0;for(e=this.actions.length;b<e;b++)f=this.actions[b],h=f.args,f=f.action,f!=THREE.PathActions.CSPLINE_THRU&&c[f].apply(c,h);c.stroke();c.closePath();c.strokeStyle="red";f=
-this.getPoints();b=0;for(e=f.length;b<e;b++)h=f[b],c.beginPath(),c.arc(h.x,h.y,1.5,0,Math.PI*2,!1),c.stroke(),c.closePath()};
-THREE.Path.prototype.toShapes=function(){var b,c,e,f,h=[],m=new THREE.Path;b=0;for(c=this.actions.length;b<c;b++)e=this.actions[b],f=e.args,e=e.action,e==THREE.PathActions.MOVE_TO&&m.actions.length!=0&&(h.push(m),m=new THREE.Path),m[e].apply(m,f);m.actions.length!=0&&h.push(m);if(h.length==0)return[];var k,m=[];if(THREE.Shape.Utils.isClockWise(h[0].getPoints())){b=0;for(c=h.length;b<c;b++)f=h[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(k&&m.push(k),k=new THREE.Shape,k.actions=f.actions,k.curves=
-f.curves):k.holes.push(f);m.push(k)}else{k=new THREE.Shape;b=0;for(c=h.length;b<c;b++)f=h[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(k.actions=f.actions,k.curves=f.curves,m.push(k),k=new THREE.Shape):k.holes.push(f)}return m};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;THREE.Shape.prototype.extrude=function(b){return new THREE.ExtrudeGeometry(this,b)};
+THREE.Path.prototype.arc=function(b,c,e,f,k,m){var h=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(b,c,e,f,k,m));this.actions.push({action:THREE.PathActions.ARC,args:h})};THREE.Path.prototype.getSpacedPoints=function(b){b||(b=40);for(var c=[],e=0;e<b;e++)c.push(this.getPoint(e/b));return c};
+THREE.Path.prototype.getPoints=function(b,c){var b=b||12,e=[],f,k,m,h,n,p,t,u,w,x,v,y,z;f=0;for(k=this.actions.length;f<k;f++)switch(m=this.actions[f],h=m.action,m=m.args,h){case THREE.PathActions.LINE_TO:e.push(new THREE.Vector2(m[0],m[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:n=m[2];p=m[3];w=m[0];x=m[1];e.length>0?(h=e[e.length-1],v=h.x,y=h.y):(h=this.actions[f-1].args,v=h[h.length-2],y=h[h.length-1]);for(h=1;h<=b;h++)z=h/b,m=THREE.Shape.Utils.b2(z,v,w,n),z=THREE.Shape.Utils.b2(z,y,x,
+p),e.push(new THREE.Vector2(m,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=m[4];p=m[5];w=m[0];x=m[1];t=m[2];u=m[3];e.length>0?(h=e[e.length-1],v=h.x,y=h.y):(h=this.actions[f-1].args,v=h[h.length-2],y=h[h.length-1]);for(h=1;h<=b;h++)z=h/b,m=THREE.Shape.Utils.b3(z,v,w,t,n),z=THREE.Shape.Utils.b3(z,y,x,u,p),e.push(new THREE.Vector2(m,z));break;case THREE.PathActions.CSPLINE_THRU:h=this.actions[f-1].args;h=[new THREE.Vector2(h[h.length-2],h[h.length-1])];z=b*m[0].length;h=h.concat(m[0]);m=new THREE.SplineCurve(h);
+for(h=1;h<=z;h++)e.push(m.getPointAt(h/z));break;case THREE.PathActions.ARC:h=this.actions[f-1].args;n=m[0];p=m[1];t=m[2];w=m[3];z=m[4];x=!!m[5];u=h[h.length-2];v=h[h.length-1];h.length==0&&(u=v=0);y=z-w;var C=b*2;for(h=1;h<=C;h++)z=h/C,x||(z=1-z),z=w+z*y,m=u+n+t*Math.cos(z),z=v+p+t*Math.sin(z),e.push(new THREE.Vector2(m,z))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)};
+THREE.Path.prototype.nltransform=function(b,c,e,f,k,m){var h=this.getPoints(),n,p,t,u,w;n=0;for(p=h.length;n<p;n++)t=h[n],u=t.x,w=t.y,t.x=b*u+c*w+e,t.y=f*w+k*u+m;return h};
+THREE.Path.prototype.debug=function(b){var c=this.getBoundingBox();b||(b=document.createElement("canvas"),b.setAttribute("width",c.maxX+100),b.setAttribute("height",c.maxY+100),document.body.appendChild(b));c=b.getContext("2d");c.fillStyle="white";c.fillRect(0,0,b.width,b.height);c.strokeStyle="black";c.beginPath();var e,f,k,b=0;for(e=this.actions.length;b<e;b++)f=this.actions[b],k=f.args,f=f.action,f!=THREE.PathActions.CSPLINE_THRU&&c[f].apply(c,k);c.stroke();c.closePath();c.strokeStyle="red";f=
+this.getPoints();b=0;for(e=f.length;b<e;b++)k=f[b],c.beginPath(),c.arc(k.x,k.y,1.5,0,Math.PI*2,!1),c.stroke(),c.closePath()};
+THREE.Path.prototype.toShapes=function(){var b,c,e,f,k=[],m=new THREE.Path;b=0;for(c=this.actions.length;b<c;b++)e=this.actions[b],f=e.args,e=e.action,e==THREE.PathActions.MOVE_TO&&m.actions.length!=0&&(k.push(m),m=new THREE.Path),m[e].apply(m,f);m.actions.length!=0&&k.push(m);if(k.length==0)return[];var h,m=[];if(THREE.Shape.Utils.isClockWise(k[0].getPoints())){b=0;for(c=k.length;b<c;b++)f=k[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(h&&m.push(h),h=new THREE.Shape,h.actions=f.actions,h.curves=
+f.curves):h.holes.push(f);m.push(h)}else{h=new THREE.Shape;b=0;for(c=k.length;b<c;b++)f=k[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(h.actions=f.actions,h.curves=f.curves,m.push(h),h=new THREE.Shape):h.holes.push(f)}return m};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;THREE.Shape.prototype.extrude=function(b){return new THREE.ExtrudeGeometry(this,b)};
 THREE.Shape.prototype.getPointsHoles=function(b){var c,e=this.holes.length,f=[];for(c=0;c<e;c++)f[c]=this.holes[c].getTransformedPoints(b,this.bends);return f};THREE.Shape.prototype.getSpacedPointsHoles=function(b){var c,e=this.holes.length,f=[];for(c=0;c<e;c++)f[c]=this.holes[c].getTransformedSpacedPoints(b,this.bends);return f};THREE.Shape.prototype.extractAllPoints=function(b){return{shape:this.getTransformedPoints(b),holes:this.getPointsHoles(b)}};
 THREE.Shape.prototype.extractAllSpacedPoints=function(b){return{shape:this.getTransformedSpacedPoints(b),holes:this.getSpacedPointsHoles(b)}};
-THREE.Shape.Utils={removeHoles:function(b,c){var e=b.concat(),f=e.concat(),h,m,k,n,u,p,v,t,x,w,y=[];for(u=0;u<c.length;u++){p=c[u];Array.prototype.push.apply(f,p);m=Number.POSITIVE_INFINITY;for(h=0;h<p.length;h++){x=p[h];w=[];for(t=0;t<e.length;t++)v=e[t],v=x.distanceToSquared(v),w.push(v),v<m&&(m=v,k=h,n=t)}h=n-1>=0?n-1:e.length-1;m=k-1>=0?k-1:p.length-1;var z=[p[k],e[n],e[h]];t=THREE.FontUtils.Triangulate.area(z);var C=[p[k],p[m],e[n]];x=THREE.FontUtils.Triangulate.area(C);w=n;v=k;n+=1;k+=-1;n<
-0&&(n+=e.length);n%=e.length;k<0&&(k+=p.length);k%=p.length;h=n-1>=0?n-1:e.length-1;m=k-1>=0?k-1:p.length-1;z=[p[k],e[n],e[h]];z=THREE.FontUtils.Triangulate.area(z);C=[p[k],p[m],e[n]];C=THREE.FontUtils.Triangulate.area(C);t+x>z+C&&(n=w,k=v,n<0&&(n+=e.length),n%=e.length,k<0&&(k+=p.length),k%=p.length,h=n-1>=0?n-1:e.length-1,m=k-1>=0?k-1:p.length-1);t=e.slice(0,n);x=e.slice(n);w=p.slice(k);v=p.slice(0,k);m=[p[k],p[m],e[n]];y.push([p[k],e[n],e[h]]);y.push(m);e=t.concat(w).concat(v).concat(x)}return{shape:e,
-isolatedPts:y,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),m,k,n,u,p={};m=0;for(k=f.length;m<k;m++)u=f[m].x+":"+f[m].y,p[u]!==void 0&&console.log("Duplicate point",u),p[u]=m;m=0;for(k=e.length;m<k;m++){n=e[m];for(f=0;f<3;f++)u=n[f].x+":"+n[f].y,u=p[u],u!==void 0&&(n[f]=u)}m=0;for(k=h.length;m<k;m++){n=h[m];for(f=0;f<3;f++)u=n[f].x+":"+n[f].y,u=p[u],u!==void 0&&(n[f]=u)}return e.concat(h)},
-isClockWise:function(b){return THREE.FontUtils.Triangulate.area(b)<0},b2p0:function(b,c){var e=1-b;return e*e*c},b2p1:function(b,c){return 2*(1-b)*b*c},b2p2:function(b,c){return b*b*c},b2:function(b,c,e,f){return this.b2p0(b,c)+this.b2p1(b,e)+this.b2p2(b,f)},b3p0:function(b,c){var e=1-b;return e*e*e*c},b3p1:function(b,c){var e=1-b;return 3*e*e*b*c},b3p2:function(b,c){return 3*(1-b)*b*b*c},b3p3:function(b,c){return b*b*b*c},b3:function(b,c,e,f,h){return this.b3p0(b,c)+this.b3p1(b,e)+this.b3p2(b,f)+
-this.b3p3(b,h)}};THREE.TextPath=function(b,c){THREE.Path.call(this);this.parameters=c||{};this.set(b)};THREE.TextPath.prototype.set=function(b,c){this.text=b;var c=c||this.parameters,e=c.curveSegments!==void 0?c.curveSegments:4,f=c.font!==void 0?c.font:"helvetiker",h=c.weight!==void 0?c.weight:"normal",m=c.style!==void 0?c.style:"normal";THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=e;THREE.FontUtils.face=f;THREE.FontUtils.weight=h;THREE.FontUtils.style=m};
+THREE.Shape.Utils={removeHoles:function(b,c){var e=b.concat(),f=e.concat(),k,m,h,n,p,t,u,w,x,v,y=[];for(p=0;p<c.length;p++){t=c[p];Array.prototype.push.apply(f,t);m=Number.POSITIVE_INFINITY;for(k=0;k<t.length;k++){x=t[k];v=[];for(w=0;w<e.length;w++)u=e[w],u=x.distanceToSquared(u),v.push(u),u<m&&(m=u,h=k,n=w)}k=n-1>=0?n-1:e.length-1;m=h-1>=0?h-1:t.length-1;var z=[t[h],e[n],e[k]];w=THREE.FontUtils.Triangulate.area(z);var C=[t[h],t[m],e[n]];x=THREE.FontUtils.Triangulate.area(C);v=n;u=h;n+=1;h+=-1;n<
+0&&(n+=e.length);n%=e.length;h<0&&(h+=t.length);h%=t.length;k=n-1>=0?n-1:e.length-1;m=h-1>=0?h-1:t.length-1;z=[t[h],e[n],e[k]];z=THREE.FontUtils.Triangulate.area(z);C=[t[h],t[m],e[n]];C=THREE.FontUtils.Triangulate.area(C);w+x>z+C&&(n=v,h=u,n<0&&(n+=e.length),n%=e.length,h<0&&(h+=t.length),h%=t.length,k=n-1>=0?n-1:e.length-1,m=h-1>=0?h-1:t.length-1);w=e.slice(0,n);x=e.slice(n);v=t.slice(h);u=t.slice(0,h);m=[t[h],t[m],e[n]];y.push([t[h],e[n],e[k]]);y.push(m);e=w.concat(v).concat(u).concat(x)}return{shape:e,
+isolatedPts:y,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,k=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),m,h,n,p,t={};m=0;for(h=f.length;m<h;m++)p=f[m].x+":"+f[m].y,t[p]!==void 0&&console.log("Duplicate point",p),t[p]=m;m=0;for(h=e.length;m<h;m++){n=e[m];for(f=0;f<3;f++)p=n[f].x+":"+n[f].y,p=t[p],p!==void 0&&(n[f]=p)}m=0;for(h=k.length;m<h;m++){n=k[m];for(f=0;f<3;f++)p=n[f].x+":"+n[f].y,p=t[p],p!==void 0&&(n[f]=p)}return e.concat(k)},
+isClockWise:function(b){return THREE.FontUtils.Triangulate.area(b)<0},b2p0:function(b,c){var e=1-b;return e*e*c},b2p1:function(b,c){return 2*(1-b)*b*c},b2p2:function(b,c){return b*b*c},b2:function(b,c,e,f){return this.b2p0(b,c)+this.b2p1(b,e)+this.b2p2(b,f)},b3p0:function(b,c){var e=1-b;return e*e*e*c},b3p1:function(b,c){var e=1-b;return 3*e*e*b*c},b3p2:function(b,c){return 3*(1-b)*b*b*c},b3p3:function(b,c){return b*b*b*c},b3:function(b,c,e,f,k){return this.b3p0(b,c)+this.b3p1(b,e)+this.b3p2(b,f)+
+this.b3p3(b,k)}};THREE.TextPath=function(b,c){THREE.Path.call(this);this.parameters=c||{};this.set(b)};THREE.TextPath.prototype.set=function(b,c){this.text=b;var c=c||this.parameters,e=c.curveSegments!==void 0?c.curveSegments:4,f=c.font!==void 0?c.font:"helvetiker",k=c.weight!==void 0?c.weight:"normal",m=c.style!==void 0?c.style:"normal";THREE.FontUtils.size=c.size!==void 0?c.size:100;THREE.FontUtils.divisions=e;THREE.FontUtils.face=f;THREE.FontUtils.weight=k;THREE.FontUtils.style=m};
 THREE.TextPath.prototype.toShapes=function(){for(var b=THREE.FontUtils.drawText(this.text).paths,c=[],e=0,f=b.length;e<f;e++)Array.prototype.push.apply(c,b[e].toShapes());return c};
 THREE.AnimationHandler=function(){var b=[],c={},e={update:function(e){for(var c=0;c<b.length;c++)b[c].update(e)},addToUpdate:function(e){b.indexOf(e)===-1&&b.push(e)},removeFromUpdate:function(e){e=b.indexOf(e);e!==-1&&b.splice(e,1)},add:function(b){c[b.name]!==void 0&&console.log("THREE.AnimationHandler.add: Warning! "+b.name+" already exists in library. Overwriting.");c[b.name]=b;if(b.initialized!==!0){for(var e=0;e<b.hierarchy.length;e++){for(var f=0;f<b.hierarchy[e].keys.length;f++){if(b.hierarchy[e].keys[f].time<
-0)b.hierarchy[e].keys[f].time=0;if(b.hierarchy[e].keys[f].rot!==void 0&&!(b.hierarchy[e].keys[f].rot instanceof THREE.Quaternion)){var n=b.hierarchy[e].keys[f].rot;b.hierarchy[e].keys[f].rot=new THREE.Quaternion(n[0],n[1],n[2],n[3])}}if(b.hierarchy[e].keys[0].morphTargets!==void 0){n={};for(f=0;f<b.hierarchy[e].keys.length;f++)for(var u=0;u<b.hierarchy[e].keys[f].morphTargets.length;u++){var p=b.hierarchy[e].keys[f].morphTargets[u];n[p]=-1}b.hierarchy[e].usedMorphTargets=n;for(f=0;f<b.hierarchy[e].keys.length;f++){var v=
-{};for(p in n){for(u=0;u<b.hierarchy[e].keys[f].morphTargets.length;u++)if(b.hierarchy[e].keys[f].morphTargets[u]===p){v[p]=b.hierarchy[e].keys[f].morphTargetsInfluences[u];break}u===b.hierarchy[e].keys[f].morphTargets.length&&(v[p]=0)}b.hierarchy[e].keys[f].morphTargetsInfluences=v}}for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].time===b.hierarchy[e].keys[f-1].time&&(b.hierarchy[e].keys.splice(f,1),f--);for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].index=f}f=parseInt(b.length*
+0)b.hierarchy[e].keys[f].time=0;if(b.hierarchy[e].keys[f].rot!==void 0&&!(b.hierarchy[e].keys[f].rot instanceof THREE.Quaternion)){var n=b.hierarchy[e].keys[f].rot;b.hierarchy[e].keys[f].rot=new THREE.Quaternion(n[0],n[1],n[2],n[3])}}if(b.hierarchy[e].keys[0].morphTargets!==void 0){n={};for(f=0;f<b.hierarchy[e].keys.length;f++)for(var p=0;p<b.hierarchy[e].keys[f].morphTargets.length;p++){var t=b.hierarchy[e].keys[f].morphTargets[p];n[t]=-1}b.hierarchy[e].usedMorphTargets=n;for(f=0;f<b.hierarchy[e].keys.length;f++){var u=
+{};for(t in n){for(p=0;p<b.hierarchy[e].keys[f].morphTargets.length;p++)if(b.hierarchy[e].keys[f].morphTargets[p]===t){u[t]=b.hierarchy[e].keys[f].morphTargetsInfluences[p];break}p===b.hierarchy[e].keys[f].morphTargets.length&&(u[t]=0)}b.hierarchy[e].keys[f].morphTargetsInfluences=u}}for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].time===b.hierarchy[e].keys[f-1].time&&(b.hierarchy[e].keys.splice(f,1),f--);for(f=1;f<b.hierarchy[e].keys.length;f++)b.hierarchy[e].keys[f].index=f}f=parseInt(b.length*
 b.fps,10);b.JIT={};b.JIT.hierarchy=[];for(e=0;e<b.hierarchy.length;e++)b.JIT.hierarchy.push(Array(f));b.initialized=!0}},get:function(b){if(typeof b==="string")return c[b]?c[b]:(console.log("THREE.AnimationHandler.get: Couldn't find animation "+b),null)},parse:function(b){var e=[];if(b instanceof THREE.SkinnedMesh)for(var c=0;c<b.bones.length;c++)e.push(b.bones[c]);else f(b,e);return e}},f=function(b,e){e.push(b);for(var c=0;c<b.children.length;c++)f(b.children[c],e)};e.LINEAR=0;e.CATMULLROM=1;e.CATMULLROM_FORWARD=
 2;return e}();THREE.Animation=function(b,c,e,f){this.root=b;this.data=THREE.AnimationHandler.get(c);this.hierarchy=THREE.AnimationHandler.parse(b);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=e!==void 0?e:THREE.AnimationHandler.LINEAR;this.JITCompile=f!==void 0?f:!0;this.points=[];this.target=new THREE.Vector3};
-THREE.Animation.prototype.play=function(b,c){if(!this.isPlaying){this.isPlaying=!0;this.loop=b!==void 0?b:!0;this.currentTime=c!==void 0?c:0;var e,f=this.hierarchy.length,h;for(e=0;e<f;e++){h=this.hierarchy[e];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)h.useQuaternion=!0;h.matrixAutoUpdate=!0;if(h.animationCache===void 0)h.animationCache={},h.animationCache.prevKey={pos:0,rot:0,scl:0},h.animationCache.nextKey={pos:0,rot:0,scl:0},h.animationCache.originalMatrix=h instanceof
-THREE.Bone?h.skinMatrix:h.matrix;var m=h.animationCache.prevKey;h=h.animationCache.nextKey;m.pos=this.data.hierarchy[e].keys[0];m.rot=this.data.hierarchy[e].keys[0];m.scl=this.data.hierarchy[e].keys[0];h.pos=this.getNextKeyWith("pos",e,1);h.rot=this.getNextKeyWith("rot",e,1);h.scl=this.getNextKeyWith("scl",e,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
+THREE.Animation.prototype.play=function(b,c){if(!this.isPlaying){this.isPlaying=!0;this.loop=b!==void 0?b:!0;this.currentTime=c!==void 0?c:0;var e,f=this.hierarchy.length,k;for(e=0;e<f;e++){k=this.hierarchy[e];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)k.useQuaternion=!0;k.matrixAutoUpdate=!0;if(k.animationCache===void 0)k.animationCache={},k.animationCache.prevKey={pos:0,rot:0,scl:0},k.animationCache.nextKey={pos:0,rot:0,scl:0},k.animationCache.originalMatrix=k instanceof
+THREE.Bone?k.skinMatrix:k.matrix;var m=k.animationCache.prevKey;k=k.animationCache.nextKey;m.pos=this.data.hierarchy[e].keys[0];m.rot=this.data.hierarchy[e].keys[0];m.scl=this.data.hierarchy[e].keys[0];k.pos=this.getNextKeyWith("pos",e,1);k.rot=this.getNextKeyWith("rot",e,1);k.scl=this.getNextKeyWith("scl",e,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var b=0;b<this.hierarchy.length;b++)if(this.hierarchy[b].animationCache!==void 0)this.hierarchy[b]instanceof THREE.Bone?this.hierarchy[b].skinMatrix=this.hierarchy[b].animationCache.originalMatrix:this.hierarchy[b].matrix=this.hierarchy[b].animationCache.originalMatrix,delete this.hierarchy[b].animationCache};
-THREE.Animation.prototype.update=function(b){if(this.isPlaying){var c=["pos","rot","scl"],e,f,h,m,k,n,u,p,v=this.data.JIT.hierarchy,t,x;this.currentTime+=b*this.timeScale;x=this.currentTime;t=this.currentTime%=this.data.length;p=parseInt(Math.min(t*this.data.fps,this.data.length*this.data.fps),10);for(var w=0,y=this.hierarchy.length;w<y;w++)if(b=this.hierarchy[w],u=b.animationCache,this.JITCompile&&v[w][p]!==void 0)b instanceof THREE.Bone?(b.skinMatrix=v[w][p],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=
-!1):(b.matrix=v[w][p],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)b instanceof THREE.Bone?b.skinMatrix=b.animationCache.originalMatrix:b.matrix=b.animationCache.originalMatrix;for(var z=0;z<3;z++){e=c[z];k=u.prevKey[e];n=u.nextKey[e];if(n.time<=x){if(t<x)if(this.loop){k=this.data.hierarchy[w].keys[0];for(n=this.getNextKeyWith(e,w,1);n.time<t;)k=n,n=this.getNextKeyWith(e,w,n.index+1)}else{this.stop();return}else{do k=n,n=this.getNextKeyWith(e,w,n.index+1);while(n.time<
-t)}u.prevKey[e]=k;u.nextKey[e]=n}b.matrixAutoUpdate=!0;b.matrixWorldNeedsUpdate=!0;f=(t-k.time)/(n.time-k.time);h=k[e];m=n[e];if(f<0||f>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+w),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(m[0]-h[0])*f,e.y=h[1]+(m[1]-h[1])*f,e.z=h[2]+(m[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
-this.getPrevKeyWith("pos",w,k.index-1).pos,this.points[1]=h,this.points[2]=m,this.points[3]=this.getNextKeyWith("pos",w,n.index+1).pos,f=f*0.33+0.33,h=this.interpolateCatmullRom(this.points,f),e.x=h[0],e.y=h[1],e.z=h[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e===
-"rot")THREE.Quaternion.slerp(h,m,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(m[0]-h[0])*f,e.y=h[1]+(m[1]-h[1])*f,e.z=h[2]+(m[2]-h[2])*f}}if(this.JITCompile&&v[0][p]===void 0){this.hierarchy[0].update(void 0,!0);for(w=0;w<this.hierarchy.length;w++)v[w][p]=this.hierarchy[w]instanceof THREE.Bone?this.hierarchy[w].skinMatrix.clone():this.hierarchy[w].matrix.clone()}}};
-THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var e=[],f=[],h,m,k,n,u,p;h=(b.length-1)*c;m=Math.floor(h);h-=m;e[0]=m==0?m:m-1;e[1]=m;e[2]=m>b.length-2?m:m+1;e[3]=m>b.length-3?m:m+2;m=b[e[0]];n=b[e[1]];u=b[e[2]];p=b[e[3]];e=h*h;k=h*e;f[0]=this.interpolate(m[0],n[0],u[0],p[0],h,e,k);f[1]=this.interpolate(m[1],n[1],u[1],p[1],h,e,k);f[2]=this.interpolate(m[2],n[2],u[2],p[2],h,e,k);return f};
-THREE.Animation.prototype.interpolate=function(b,c,e,f,h,m,k){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*k+(-3*(c-e)-2*b-f)*m+b*h+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,e){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e=e<f.length-1?e:f.length-1:e%=f.length;e<f.length;e++)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[0]};
+THREE.Animation.prototype.update=function(b){if(this.isPlaying){var c=["pos","rot","scl"],e,f,k,m,h,n,p,t,u=this.data.JIT.hierarchy,w,x;this.currentTime+=b*this.timeScale;x=this.currentTime;w=this.currentTime%=this.data.length;t=parseInt(Math.min(w*this.data.fps,this.data.length*this.data.fps),10);for(var v=0,y=this.hierarchy.length;v<y;v++)if(b=this.hierarchy[v],p=b.animationCache,this.JITCompile&&u[v][t]!==void 0)b instanceof THREE.Bone?(b.skinMatrix=u[v][t],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=
+!1):(b.matrix=u[v][t],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)b instanceof THREE.Bone?b.skinMatrix=b.animationCache.originalMatrix:b.matrix=b.animationCache.originalMatrix;for(var z=0;z<3;z++){e=c[z];h=p.prevKey[e];n=p.nextKey[e];if(n.time<=x){if(w<x)if(this.loop){h=this.data.hierarchy[v].keys[0];for(n=this.getNextKeyWith(e,v,1);n.time<w;)h=n,n=this.getNextKeyWith(e,v,n.index+1)}else{this.stop();return}else{do h=n,n=this.getNextKeyWith(e,v,n.index+1);while(n.time<
+w)}p.prevKey[e]=h;p.nextKey[e]=n}b.matrixAutoUpdate=!0;b.matrixWorldNeedsUpdate=!0;f=(w-h.time)/(n.time-h.time);k=h[e];m=n[e];if(f<0||f>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=k[0]+(m[0]-k[0])*f,e.y=k[1]+(m[1]-k[1])*f,e.z=k[2]+(m[2]-k[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
+this.getPrevKeyWith("pos",v,h.index-1).pos,this.points[1]=k,this.points[2]=m,this.points[3]=this.getNextKeyWith("pos",v,n.index+1).pos,f=f*0.33+0.33,k=this.interpolateCatmullRom(this.points,f),e.x=k[0],e.y=k[1],e.z=k[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e===
+"rot")THREE.Quaternion.slerp(k,m,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=k[0]+(m[0]-k[0])*f,e.y=k[1]+(m[1]-k[1])*f,e.z=k[2]+(m[2]-k[2])*f}}if(this.JITCompile&&u[0][t]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;v<this.hierarchy.length;v++)u[v][t]=this.hierarchy[v]instanceof THREE.Bone?this.hierarchy[v].skinMatrix.clone():this.hierarchy[v].matrix.clone()}}};
+THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var e=[],f=[],k,m,h,n,p,t;k=(b.length-1)*c;m=Math.floor(k);k-=m;e[0]=m==0?m:m-1;e[1]=m;e[2]=m>b.length-2?m:m+1;e[3]=m>b.length-3?m:m+2;m=b[e[0]];n=b[e[1]];p=b[e[2]];t=b[e[3]];e=k*k;h=k*e;f[0]=this.interpolate(m[0],n[0],p[0],t[0],k,e,h);f[1]=this.interpolate(m[1],n[1],p[1],t[1],k,e,h);f[2]=this.interpolate(m[2],n[2],p[2],t[2],k,e,h);return f};
+THREE.Animation.prototype.interpolate=function(b,c,e,f,k,m,h){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*h+(-3*(c-e)-2*b-f)*m+b*k+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,e){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e=e<f.length-1?e:f.length-1:e%=f.length;e<f.length;e++)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(b,c,e){for(var f=this.data.hierarchy[c].keys,e=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e>0?e:0:e>=0?e:e+f.length;e>=0;e--)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[f.length-1]};
 THREE.CubeCamera=function(b,c,e,f){this.cameraPX=new THREE.Camera(90,1,b,c);this.cameraNX=new THREE.Camera(90,1,b,c);this.cameraPY=new THREE.Camera(90,1,b,c);this.cameraNY=new THREE.Camera(90,1,b,c);this.cameraPZ=new THREE.Camera(90,1,b,c);this.cameraNZ=new THREE.Camera(90,1,b,c);this.cameraPX.useTarget=!0;this.cameraNX.useTarget=!0;this.cameraPY.useTarget=!0;this.cameraNY.useTarget=!0;this.cameraPZ.useTarget=!0;this.cameraNZ.useTarget=!0;this.height=e;this.position=new THREE.Vector3(0,e,0);this.cameraPX.position=
 this.position;this.cameraNX.position=this.position;this.cameraPY.position=this.position;this.cameraNY.position=this.position;this.cameraPZ.position=this.position;this.cameraNZ.position=this.position;this.cameraPY.up.set(0,0,1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.renderTarget=new THREE.WebGLRenderTargetCube(f,f,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updatePosition=function(b){this.position.x=b.x;this.position.z=b.z;this.cameraPX.target.position.add(this.position,
 new THREE.Vector3(-1,0,0));this.cameraNX.target.position.add(this.position,new THREE.Vector3(1,0,0));this.cameraPY.target.position.add(this.position,new THREE.Vector3(0,1,0));this.cameraNY.target.position.add(this.position,new THREE.Vector3(0,-1,0));this.cameraPZ.target.position.add(this.position,new THREE.Vector3(0,0,1));this.cameraNZ.target.position.add(this.position,new THREE.Vector3(0,0,-1))};this.updateCubeMap=function(b,e){var c=this.renderTarget;b.setFaceCulling("back","cw");e.scale.y=-1;e.position.y=
 2*this.height;e.updateMatrix();c.activeCubeFace=0;b.render(e,this.cameraPX,c);c.activeCubeFace=1;b.render(e,this.cameraNX,c);e.scale.y=1;e.position.y=0;e.updateMatrix();e.scale.x=-1;e.updateMatrix();c.activeCubeFace=2;b.render(e,this.cameraPY,c);e.scale.x=1;e.updateMatrix();b.setFaceCulling("back","ccw");c.activeCubeFace=3;b.render(e,this.cameraNY,c);e.scale.x=-1;e.updateMatrix();b.setFaceCulling("back","cw");c.activeCubeFace=4;b.render(e,this.cameraPZ,c);c.activeCubeFace=5;b.render(e,this.cameraNZ,
 c);e.scale.x=1;e.updateMatrix();b.setFaceCulling("back","ccw")}};
-THREE.FirstPersonCamera=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.useTarget=!0;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=Math.PI;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(b){if(b.movementSpeed!==
+THREE.FirstPersonCamera=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.useTarget=!0;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=Math.PI;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!==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.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=
 window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(b){this.domElement!==document&&this.domElement.focus();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.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=
 !0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}};this.update=function(){var b=(new Date).getTime();this.tdiff=(b-this.lastUpdate)/1E3;this.lastUpdate=b;if(!this.freeze){this.autoSpeedFactor=
 this.heightSpeed?this.tdiff*((this.position.y<this.heightMin?this.heightMin:this.position.y>this.heightMax?this.heightMax:this.position.y)-this.heightMin)*this.heightCoef:0;var c=this.tdiff*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.translateZ(-(c+this.autoSpeedFactor));this.moveBackward&&this.translateZ(c);this.moveLeft&&this.translateX(-c);this.moveRight&&this.translateX(c);this.moveUp&&this.translateY(c);this.moveDown&&this.translateY(-c);c=this.tdiff*this.lookSpeed;
-this.activeLook||(c=0);this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target.position,h=this.position;b.x=h.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=h.y+100*Math.cos(this.phi);b.z=h.z+100*Math.sin(this.phi)*Math.sin(this.theta)}b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&
-(this.lat-=this.mouseY*c*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax-this.verticalMin)/(Math.PI-0)+this.verticalMin;b=this.target.position;h=this.position;b.x=h.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=h.y+100*Math.cos(this.phi);b.z=h.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",
+this.activeLook||(c=0);this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target.position,k=this.position;b.x=k.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=k.y+100*Math.cos(this.phi);b.z=k.z+100*Math.sin(this.phi)*Math.sin(this.theta)}b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&
+(this.lat-=this.mouseY*c*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax-this.verticalMin)/(Math.PI-0)+this.verticalMin;b=this.target.position;k=this.position;b.x=k.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=k.y+100*Math.cos(this.phi);b.z=k.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",
 function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};THREE.FirstPersonCamera.prototype=new THREE.Camera;THREE.FirstPersonCamera.prototype.constructor=THREE.FirstPersonCamera;
 THREE.FirstPersonCamera.prototype.supr=THREE.Camera.prototype;THREE.FirstPersonCamera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(b));this.target.position.addSelf(c.multiplyScalar(b))};
-THREE.PathCamera=function(b){function c(b,e,c,f){var h={name:c,fps:0.6,length:f,hierarchy:[]},k,m=e.getControlPointsArray(),n=e.getLength(),u=m.length,F=0;k=u-1;e={parent:-1,keys:[]};e.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};e.keys[k]={time:f,pos:m[k],rot:[0,0,0,1],scl:[1,1,1]};for(k=1;k<u-1;k++)F=f*n.chunks[k]/n.total,e.keys[k]={time:F,pos:m[k]};h.hierarchy[0]=e;THREE.AnimationHandler.add(h);return new THREE.Animation(b,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function e(b,e){var c,
+THREE.PathCamera=function(b){function c(b,e,c,f){var h={name:c,fps:0.6,length:f,hierarchy:[]},k,m=e.getControlPointsArray(),n=e.getLength(),p=m.length,F=0;k=p-1;e={parent:-1,keys:[]};e.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};e.keys[k]={time:f,pos:m[k],rot:[0,0,0,1],scl:[1,1,1]};for(k=1;k<p-1;k++)F=f*n.chunks[k]/n.total,e.keys[k]={time:F,pos:m[k]};h.hierarchy[0]=e;THREE.AnimationHandler.add(h);return new THREE.Animation(b,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function e(b,e){var c,
 f,h=new THREE.Geometry;for(c=0;c<b.points.length*e;c++)f=c/(b.points.length*e),f=b.getPoint(f),h.vertices[c]=new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z));return h}function f(b,c){var f=e(c,10),h=e(c,10),k=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(f,k);particleObj=new THREE.ParticleSystem(h,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.addChild(lineObj);particleObj.scale.set(1,1,1);b.addChild(particleObj);h=new THREE.SphereGeometry(1,
-16,8);k=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)f=new THREE.Mesh(h,k),f.position.copy(c.points[i]),f.updateMatrix(),b.addChild(f)}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.useTarget=!0;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;
+16,8);k=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)f=new THREE.Mesh(h,k),f.position.copy(c.points[i]),f.updateMatrix(),b.addChild(f)}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.useTarget=!0;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,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.domElement=document;if(b){if(b.duration!==void 0)this.duration=b.duration*1E3;if(b.waypoints!==void 0)this.waypoints=b.waypoints;if(b.useConstantSpeed!==void 0)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==void 0)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==void 0)this.createDebugPath=
 b.createDebugPath;if(b.createDebugDummy!==void 0)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==void 0)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==void 0)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==void 0)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==void 0)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==void 0)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==void 0)this.domElement=b.domElement}this.theta=this.phi=this.lon=this.lat=
-this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var h=Math.PI*2,m=Math.PI/180;this.update=function(b,e,c){var f,k;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,
-Math.min(85,this.lat));this.phi=(90-this.lat)*m;this.theta=this.lon*m;f=this.phi%h;this.phi=f>=0?f:f+h;f=this.verticalAngleMap.srcRange;k=this.verticalAngleMap.dstRange;var n=k[1]-k[0];this.phi=TWEEN.Easing.Quadratic.EaseInOut(((this.phi-f[0])*(k[1]-k[0])/(f[1]-f[0])+k[0]-k[0])/n)*n+k[0];f=this.horizontalAngleMap.srcRange;k=this.horizontalAngleMap.dstRange;n=k[1]-k[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-f[0])*(k[1]-k[0])/(f[1]-f[0])+k[0]-k[0])/n)*n+k[0];f=this.target.position;
+this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var k=Math.PI*2,m=Math.PI/180;this.update=function(b,e,c){var f,h;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)*m;this.theta=this.lon*m;f=this.phi%k;this.phi=f>=0?f:f+k;f=this.verticalAngleMap.srcRange;h=this.verticalAngleMap.dstRange;var n=h[1]-h[0];this.phi=TWEEN.Easing.Quadratic.EaseInOut(((this.phi-f[0])*(h[1]-h[0])/(f[1]-f[0])+h[0]-h[0])/n)*n+h[0];f=this.horizontalAngleMap.srcRange;h=this.horizontalAngleMap.dstRange;n=h[1]-h[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-f[0])*(h[1]-h[0])/(f[1]-f[0])+h[0]-h[0])/n)*n+h[0];f=this.target.position;
 f.x=100*Math.sin(this.phi)*Math.cos(this.theta);f.y=100*Math.cos(this.phi);f.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,b,e,c)};this.onMouseMove=function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&
-this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),k=new THREE.MeshLambertMaterial({color:65280}),n=new THREE.CubeGeometry(10,10,20),u=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(n,b);b=new THREE.Mesh(u,k);b.position.set(0,10,0);this.animation=c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(b)}else this.animation=
+this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),h=new THREE.MeshLambertMaterial({color:65280}),n=new THREE.CubeGeometry(10,10,20),p=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(n,b);b=new THREE.Mesh(p,h);b.position.set(0,10,0);this.animation=c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(b)}else this.animation=
 c(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&f(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(b,e){return function(){e.apply(b,arguments)}}(this,this.onMouseMove),!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
-THREE.FlyCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.domElement=document;if(b){if(b.movementSpeed!==void 0)this.movementSpeed=b.movementSpeed;if(b.rollSpeed!==void 0)this.rollSpeed=b.rollSpeed;if(b.dragToLook!==void 0)this.dragToLook=b.dragToLook;if(b.autoForward!==void 0)this.autoForward=
+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.domElement!==document&&this.domElement.setAttribute("tabindex",-1);this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};
 this.keydown=function(b){if(!b.altKey){switch(b.keyCode){case 16:this.movementSpeedMultiplier=0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=
 1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(b){switch(b.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=
 0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(b){this.domElement!==document&&this.domElement.focus();b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(b.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}};this.mousemove=function(b){if(!this.dragToLook||this.mouseStatus>0){var c=this.getContainerDimensions(),
-h=c.size[0]/2,m=c.size[1]/2;this.moveState.yawLeft=-(b.pageX-c.offset[0]-h)/h;this.moveState.pitchDown=(b.pageY-c.offset[1]-m)/m;this.updateRotationVector()}};this.mouseup=function(b){b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(b.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=
+k=c.size[0]/2,m=c.size[1]/2;this.moveState.yawLeft=-(b.pageX-c.offset[0]-k)/k;this.moveState.pitchDown=(b.pageY-c.offset[1]-m)/m;this.updateRotationVector()}};this.mouseup=function(b){b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(b.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=
 b;this.tdiff=(b-this.lastUpdate)/1E3;this.lastUpdate=b;var b=this.tdiff*this.movementSpeed,c=this.tdiff*this.rollSpeed;this.translateX(this.moveVector.x*b);this.translateY(this.moveVector.y*b);this.translateZ(this.moveVector.z*b);this.tmpQuaternion.set(this.rotationVector.x*c,this.rotationVector.y*c,this.rotationVector.z*c,1).normalize();this.quaternion.multiplySelf(this.tmpQuaternion);this.matrix.setPosition(this.position);this.matrix.setRotationFromQuaternion(this.quaternion);this.matrixWorldNeedsUpdate=
 !0;this.supr.update.call(this)};this.updateMovementVector=function(){var b=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=
 -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,
 this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};THREE.FlyCamera.prototype=new THREE.Camera;THREE.FlyCamera.prototype.constructor=THREE.FlyCamera;THREE.FlyCamera.prototype.supr=THREE.Camera.prototype;
-THREE.RollCamera=function(b,c,e,f){THREE.Camera.call(this,b,c,e,f);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.matrixAutoUpdate=this.useTarget=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var h=new THREE.Vector3,m=new THREE.Vector3,k=new THREE.Vector3,n=new THREE.Matrix4,u=!1,p=1,v=0,t=0,x=0,w=0,y=0,z=window.innerWidth/2,C=window.innerHeight/2;this.update=
-function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.delta=(b-this.lastUpdate)/1E3;this.lastUpdate=b;this.mouseLook&&(b=this.delta*this.lookSpeed,this.rotateHorizontally(b*w),this.rotateVertically(b*y));b=this.delta*this.movementSpeed;this.translateZ(b*(v>0||this.autoForward&&!(v<0)?1:v));this.translateX(b*t);this.translateY(b*x);u&&(this.roll+=this.rollSpeed*this.delta*p);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();
-else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();k.copy(this.forward);m.set(0,1,0);h.cross(m,k).normalize();m.cross(k,h).normalize();this.matrix.n11=h.x;this.matrix.n12=m.x;this.matrix.n13=k.x;this.matrix.n21=h.y;this.matrix.n22=m.y;this.matrix.n23=k.y;this.matrix.n31=h.z;this.matrix.n32=m.z;this.matrix.n33=k.z;n.identity();n.n11=Math.cos(this.roll);n.n12=-Math.sin(this.roll);n.n21=Math.sin(this.roll);n.n22=Math.cos(this.roll);this.matrix.multiplySelf(n);
+THREE.RollCamera=function(b,c,e,f){THREE.Camera.call(this,b,c,e,f);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.matrixAutoUpdate=this.useTarget=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var k=new THREE.Vector3,m=new THREE.Vector3,h=new THREE.Vector3,n=new THREE.Matrix4,p=!1,t=1,u=0,w=0,x=0,v=0,y=0,z=window.innerWidth/2,C=window.innerHeight/2;this.update=
+function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.delta=(b-this.lastUpdate)/1E3;this.lastUpdate=b;this.mouseLook&&(b=this.delta*this.lookSpeed,this.rotateHorizontally(b*v),this.rotateVertically(b*y));b=this.delta*this.movementSpeed;this.translateZ(b*(u>0||this.autoForward&&!(u<0)?1:u));this.translateX(b*w);this.translateY(b*x);p&&(this.roll+=this.rollSpeed*this.delta*t);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();h.copy(this.forward);m.set(0,1,0);k.cross(m,h).normalize();m.cross(h,k).normalize();this.matrix.n11=k.x;this.matrix.n12=m.x;this.matrix.n13=h.x;this.matrix.n21=k.y;this.matrix.n22=m.y;this.matrix.n23=h.y;this.matrix.n31=k.z;this.matrix.n32=m.z;this.matrix.n33=h.z;n.identity();n.n11=Math.cos(this.roll);n.n12=-Math.sin(this.roll);n.n21=Math.sin(this.roll);n.n22=Math.cos(this.roll);this.matrix.multiplySelf(n);
 this.matrixWorldNeedsUpdate=!0;this.matrix.n14=this.position.x;this.matrix.n24=this.position.y;this.matrix.n34=this.position.z;this.supr.update.call(this)};this.translateX=function(b){this.position.x+=this.matrix.n11*b;this.position.y+=this.matrix.n21*b;this.position.z+=this.matrix.n31*b};this.translateY=function(b){this.position.x+=this.matrix.n12*b;this.position.y+=this.matrix.n22*b;this.position.z+=this.matrix.n32*b};this.translateZ=function(b){this.position.x-=this.matrix.n13*b;this.position.y-=
-this.matrix.n23*b;this.position.z-=this.matrix.n33*b};this.rotateHorizontally=function(b){h.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);h.multiplyScalar(b);this.forward.subSelf(h);this.forward.normalize()};this.rotateVertically=function(b){m.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);m.multiplyScalar(b);this.forward.addSelf(m);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
-function(b){w=(b.clientX-z)/window.innerWidth;y=(b.clientY-C)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:v=1;break;case 2:v=-1}},!1);this.domElement.addEventListener("mouseup",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:v=0;break;case 2:v=0}},!1);this.domElement.addEventListener("keydown",function(b){switch(b.keyCode){case 38:case 87:v=1;break;case 37:case 65:t=-1;break;
-case 40:case 83:v=-1;break;case 39:case 68:t=1;break;case 81:u=!0;p=1;break;case 69:u=!0;p=-1;break;case 82:x=1;break;case 70:x=-1}},!1);this.domElement.addEventListener("keyup",function(b){switch(b.keyCode){case 38:case 87:v=0;break;case 37:case 65:t=0;break;case 40:case 83:v=0;break;case 39:case 68:t=0;break;case 81:u=!1;break;case 69:u=!1;break;case 82:x=0;break;case 70:x=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
+this.matrix.n23*b;this.position.z-=this.matrix.n33*b};this.rotateHorizontally=function(b){k.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);k.multiplyScalar(b);this.forward.subSelf(k);this.forward.normalize()};this.rotateVertically=function(b){m.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);m.multiplyScalar(b);this.forward.addSelf(m);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
+function(b){v=(b.clientX-z)/window.innerWidth;y=(b.clientY-C)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:u=1;break;case 2:u=-1}},!1);this.domElement.addEventListener("mouseup",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:u=0;break;case 2:u=0}},!1);this.domElement.addEventListener("keydown",function(b){switch(b.keyCode){case 38:case 87:u=1;break;case 37:case 65:w=-1;break;
+case 40:case 83:u=-1;break;case 39:case 68:w=1;break;case 81:p=!0;t=1;break;case 69:p=!0;t=-1;break;case 82:x=1;break;case 70:x=-1}},!1);this.domElement.addEventListener("keyup",function(b){switch(b.keyCode){case 38:case 87:u=0;break;case 37:case 65:w=0;break;case 40:case 83:u=0;break;case 39:case 68:w=0;break;case 81:p=!1;break;case 69:p=!1;break;case 82:x=0;break;case 70:x=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
 THREE.RollCamera.prototype.supr=THREE.Camera.prototype;
 THREE.TrackballCamera=function(b){function c(b,c){return function(){c.apply(b,arguments)}}b=b||{};THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.domElement=b.domElement||document;this.screen=b.screen||{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=b.radius||(this.screen.width+this.screen.height)/4;this.rotateSpeed=b.rotateSpeed||1;this.zoomSpeed=b.zoomSpeed||1.2;this.panSpeed=b.panSpeed||0.3;this.noZoom=b.noZoom||!1;this.noPan=b.noPan||
-!1;this.staticMoving=b.staticMoving||!1;this.dynamicDampingFactor=b.dynamicDampingFactor||0.2;this.minDistance=b.minDistance||0;this.maxDistance=b.maxDistance||Infinity;this.keys=b.keys||[65,83,68];this.useTarget=!0;var e=!1,f=this.STATE.NONE,h=new THREE.Vector3,m=new THREE.Vector3,k=new THREE.Vector3,n=new THREE.Vector2,u=new THREE.Vector2,p=new THREE.Vector2,v=new THREE.Vector2;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.getMouseOnScreen=function(b,c){return new THREE.Vector2((b-
-this.screen.offsetLeft)/this.radius*0.5,(c-this.screen.offsetTop)/this.radius*0.5)};this.getMouseProjectionOnBall=function(b,c){var e=new THREE.Vector3((b-this.screen.width*0.5-this.screen.offsetLeft)/this.radius,(this.screen.height*0.5+this.screen.offsetTop-c)/this.radius,0),f=e.length();f>1?e.normalize():e.z=Math.sqrt(1-f*f);h=this.position.clone().subSelf(this.target.position);f=this.up.clone().setLength(e.y);f.addSelf(this.up.clone().crossSelf(h).setLength(e.x));f.addSelf(h.setLength(e.z));return f};
-this.rotateCamera=function(){var b=Math.acos(m.dot(k)/m.length()/k.length());if(b){var c=(new THREE.Vector3).cross(m,k).normalize(),e=new THREE.Quaternion;b*=this.rotateSpeed;e.setFromAxisAngle(c,-b);e.multiplyVector3(h);e.multiplyVector3(this.up);e.multiplyVector3(k);this.staticMoving?m=k:(e.setFromAxisAngle(c,b*(this.dynamicDampingFactor-1)),e.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(u.y-n.y)*this.zoomSpeed;b!==1&&b>0&&(h.multiplyScalar(b),this.staticMoving?n=u:n.y+=(u.y-n.y)*this.dynamicDampingFactor)};
-this.panCamera=function(){var b=v.clone().subSelf(p);if(b.lengthSq()){b.multiplyScalar(h.length()*this.panSpeed);var c=h.clone().crossSelf(this.up).setLength(b.x);c.addSelf(this.up.clone().setLength(b.y));this.position.addSelf(c);this.target.position.addSelf(c);this.staticMoving?p=v:p.addSelf(b.sub(v,p).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.position.lengthSq()>this.maxDistance*this.maxDistance&&this.position.setLength(this.maxDistance),
-h.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.position,h.setLength(this.minDistance))};this.update=function(b,c,e){h=this.position.clone().subSelf(this.target.position);this.rotateCamera();this.noZoom||this.zoomCamera();this.noPan||this.panCamera();this.position.add(this.target.position,h);this.checkDistances();this.supr.update.call(this,b,c,e)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
-c(this,function(b){e&&(m=k=this.getMouseProjectionOnBall(b.clientX,b.clientY),n=u=this.getMouseOnScreen(b.clientX,b.clientY),p=v=this.getMouseOnScreen(b.clientX,b.clientY),e=!1);f!==this.STATE.NONE&&(f===this.STATE.ROTATE?k=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?u=this.getMouseOnScreen(b.clientX,b.clientY):f===this.STATE.PAN&&!this.noPan&&(v=this.getMouseOnScreen(b.clientX,b.clientY)))}),!1);this.domElement.addEventListener("mousedown",c(this,function(b){b.preventDefault();
-b.stopPropagation();if(f===this.STATE.NONE)f=b.button,f===this.STATE.ROTATE?m=k=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?n=u=this.getMouseOnScreen(b.clientX,b.clientY):this.noPan||(p=v=this.getMouseOnScreen(b.clientX,b.clientY))}),!1);this.domElement.addEventListener("mouseup",c(this,function(b){b.preventDefault();b.stopPropagation();f=this.STATE.NONE}),!1);window.addEventListener("keydown",c(this,function(b){if(f===this.STATE.NONE){if(b.keyCode===this.keys[this.STATE.ROTATE])f=
+!1;this.staticMoving=b.staticMoving||!1;this.dynamicDampingFactor=b.dynamicDampingFactor||0.2;this.minDistance=b.minDistance||0;this.maxDistance=b.maxDistance||Infinity;this.keys=b.keys||[65,83,68];this.useTarget=!0;var e=!1,f=this.STATE.NONE,k=new THREE.Vector3,m=new THREE.Vector3,h=new THREE.Vector3,n=new THREE.Vector2,p=new THREE.Vector2,t=new THREE.Vector2,u=new THREE.Vector2;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.getMouseOnScreen=function(b,c){return new THREE.Vector2((b-
+this.screen.offsetLeft)/this.radius*0.5,(c-this.screen.offsetTop)/this.radius*0.5)};this.getMouseProjectionOnBall=function(b,c){var e=new THREE.Vector3((b-this.screen.width*0.5-this.screen.offsetLeft)/this.radius,(this.screen.height*0.5+this.screen.offsetTop-c)/this.radius,0),f=e.length();f>1?e.normalize():e.z=Math.sqrt(1-f*f);k=this.position.clone().subSelf(this.target.position);f=this.up.clone().setLength(e.y);f.addSelf(this.up.clone().crossSelf(k).setLength(e.x));f.addSelf(k.setLength(e.z));return f};
+this.rotateCamera=function(){var b=Math.acos(m.dot(h)/m.length()/h.length());if(b){var c=(new THREE.Vector3).cross(m,h).normalize(),e=new THREE.Quaternion;b*=this.rotateSpeed;e.setFromAxisAngle(c,-b);e.multiplyVector3(k);e.multiplyVector3(this.up);e.multiplyVector3(h);this.staticMoving?m=h:(e.setFromAxisAngle(c,b*(this.dynamicDampingFactor-1)),e.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(p.y-n.y)*this.zoomSpeed;b!==1&&b>0&&(k.multiplyScalar(b),this.staticMoving?n=p:n.y+=(p.y-n.y)*this.dynamicDampingFactor)};
+this.panCamera=function(){var b=u.clone().subSelf(t);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var c=k.clone().crossSelf(this.up).setLength(b.x);c.addSelf(this.up.clone().setLength(b.y));this.position.addSelf(c);this.target.position.addSelf(c);this.staticMoving?t=u:t.addSelf(b.sub(u,t).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.position.lengthSq()>this.maxDistance*this.maxDistance&&this.position.setLength(this.maxDistance),
+k.lengthSq()<this.minDistance*this.minDistance&&this.position.add(this.target.position,k.setLength(this.minDistance))};this.update=function(b,c,e){k=this.position.clone().subSelf(this.target.position);this.rotateCamera();this.noZoom||this.zoomCamera();this.noPan||this.panCamera();this.position.add(this.target.position,k);this.checkDistances();this.supr.update.call(this,b,c,e)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",
+c(this,function(b){e&&(m=h=this.getMouseProjectionOnBall(b.clientX,b.clientY),n=p=this.getMouseOnScreen(b.clientX,b.clientY),t=u=this.getMouseOnScreen(b.clientX,b.clientY),e=!1);f!==this.STATE.NONE&&(f===this.STATE.ROTATE?h=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?p=this.getMouseOnScreen(b.clientX,b.clientY):f===this.STATE.PAN&&!this.noPan&&(u=this.getMouseOnScreen(b.clientX,b.clientY)))}),!1);this.domElement.addEventListener("mousedown",c(this,function(b){b.preventDefault();
+b.stopPropagation();if(f===this.STATE.NONE)f=b.button,f===this.STATE.ROTATE?m=h=this.getMouseProjectionOnBall(b.clientX,b.clientY):f===this.STATE.ZOOM&&!this.noZoom?n=p=this.getMouseOnScreen(b.clientX,b.clientY):this.noPan||(t=u=this.getMouseOnScreen(b.clientX,b.clientY))}),!1);this.domElement.addEventListener("mouseup",c(this,function(b){b.preventDefault();b.stopPropagation();f=this.STATE.NONE}),!1);window.addEventListener("keydown",c(this,function(b){if(f===this.STATE.NONE){if(b.keyCode===this.keys[this.STATE.ROTATE])f=
 this.STATE.ROTATE;else if(b.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)f=this.STATE.ZOOM;else if(b.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)f=this.STATE.PAN;f!==this.STATE.NONE&&(e=!0)}}),!1);window.addEventListener("keyup",c(this,function(){if(f!==this.STATE.NONE)f=this.STATE.NONE}),!1)};THREE.TrackballCamera.prototype=new THREE.Camera;THREE.TrackballCamera.prototype.constructor=THREE.TrackballCamera;THREE.TrackballCamera.prototype.supr=THREE.Camera.prototype;
 THREE.TrackballCamera.prototype.STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2};
-THREE.CubeGeometry=function(b,c,e,f,h,m,k,n,u){function p(b,c,e,k,n,p,t,u){var w,x,y=f||1,z=h||1,Q=n/2,R=p/2,W=v.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")w="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")w="y",z=m||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")w="x",y=m||1;var X=y+1,o=z+1;n/=y;var ea=p/z;for(x=0;x<o;x++)for(p=0;p<X;p++){var V=new THREE.Vector3;V[b]=(p*n-Q)*e;V[c]=(x*ea-R)*k;V[w]=t;v.vertices.push(new THREE.Vertex(V))}for(x=0;x<z;x++)for(p=0;p<y;p++)v.faces.push(new THREE.Face4(p+X*
-x+W,p+X*(x+1)+W,p+1+X*(x+1)+W,p+1+X*x+W,null,null,u)),v.faceVertexUvs[0].push([new THREE.UV(p/y,x/z),new THREE.UV(p/y,(x+1)/z),new THREE.UV((p+1)/y,(x+1)/z),new THREE.UV((p+1)/y,x/z)])}THREE.Geometry.call(this);var v=this,t=b/2,x=c/2,w=e/2,n=n?-1:1;if(k!==void 0)if(k instanceof Array)this.materials=k;else{this.materials=[];for(var y=0;y<6;y++)this.materials.push([k])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(u!=void 0)for(var z in u)this.sides[z]!=void 0&&(this.sides[z]=
-u[z]);this.sides.px&&p("z","y",1*n,-1,e,c,-t,this.materials[0]);this.sides.nx&&p("z","y",-1*n,-1,e,c,t,this.materials[1]);this.sides.py&&p("x","z",1*n,1,b,e,x,this.materials[2]);this.sides.ny&&p("x","z",1*n,-1,b,e,-x,this.materials[3]);this.sides.pz&&p("x","y",1*n,-1,b,c,w,this.materials[4]);this.sides.nz&&p("x","y",-1*n,-1,b,c,-w,this.materials[5]);(function(){for(var b=[],c=[],e=0,f=v.vertices.length;e<f;e++){for(var k=v.vertices[e],h=!1,m=0,n=b.length;m<n;m++){var p=b[m];if(k.position.x==p.position.x&&
-k.position.y==p.position.y&&k.position.z==p.position.z){c[e]=m;h=!0;break}}if(!h)c[e]=b.length,b.push(new THREE.Vertex(k.position.clone()))}e=0;for(f=v.faces.length;e<f;e++)k=v.faces[e],k.a=c[k.a],k.b=c[k.b],k.c=c[k.c],k.d=c[k.d];v.vertices=b})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
-THREE.CylinderGeometry=function(b,c,e,f,h,m){THREE.Geometry.call(this);var b=b!=null?b:20,c=c!=null?c:20,e=e||100,k=e/2,f=f||8,h=h||1,n,u,p=[],v=[];for(u=0;u<=h;u++){var t=[],x=[],w=u/h,y=w*(c-b)+b;for(n=0;n<=f;n++){var z=n/f;this.vertices.push(new THREE.Vertex(new THREE.Vector3(y*Math.sin(z*Math.PI*2),-w*e+k,y*Math.cos(z*Math.PI*2))));t.push(this.vertices.length-1);x.push(new THREE.UV(z,w))}p.push(t);v.push(x)}for(u=0;u<h;u++)for(n=0;n<f;n++){var e=p[u][n],t=p[u+1][n],x=p[u+1][n+1],w=p[u][n+1],y=
-this.vertices[e].position.clone().setY(0).normalize(),z=this.vertices[t].position.clone().setY(0).normalize(),C=this.vertices[x].position.clone().setY(0).normalize(),A=this.vertices[w].position.clone().setY(0).normalize(),F=v[u][n].clone(),D=v[u+1][n].clone(),J=v[u+1][n+1].clone(),P=v[u][n+1].clone();this.faces.push(new THREE.Face4(e,t,x,w,[y,z,C,A]));this.faceVertexUvs[0].push([F,D,J,P])}if(!m&&b>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,k,0)));for(n=0;n<f;n++)e=p[0][n],t=p[0][n+
-1],x=this.vertices.length-1,y=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,1,0),C=new THREE.Vector3(0,1,0),F=v[0][n].clone(),D=v[0][n+1].clone(),J=new THREE.UV(D.u,0),this.faces.push(new THREE.Face3(e,t,x,[y,z,C])),this.faceVertexUvs[0].push([F,D,J])}if(!m&&c>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-k,0)));for(n=0;n<f;n++)e=p[u][n+1],t=p[u][n],x=this.vertices.length-1,y=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),C=new THREE.Vector3(0,-1,0),F=v[u][n+1].clone(),D=v[u][n].clone(),
-J=new THREE.UV(D.u,1),this.faces.push(new THREE.Face3(e,t,x,[y,z,C])),this.faceVertexUvs[0].push([F,D,J])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
-THREE.ExtrudeGeometry=function(b,c){if(typeof b!="undefined"){THREE.Geometry.call(this);var b=b instanceof Array?b:[b],e,f=b.length,h;this.shapebb=b[f-1].getBoundingBox();for(e=0;e<f;e++)h=b[e],this.addShape(h,c);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
-THREE.ExtrudeGeometry.prototype.addShape=function(b,c){function e(b,c,e){c||console.log("die");return c.clone().multiplyScalar(e).addSelf(b)}function f(b,c,e){var f=THREE.ExtrudeGeometry.__v1,k=THREE.ExtrudeGeometry.__v2,h=THREE.ExtrudeGeometry.__v3,m=THREE.ExtrudeGeometry.__v4,n=THREE.ExtrudeGeometry.__v5,o=THREE.ExtrudeGeometry.__v6;f.set(b.x-c.x,b.y-c.y);k.set(b.x-e.x,b.y-e.y);f=f.normalize();k=k.normalize();h.set(-f.y,f.x);m.set(k.y,-k.x);n.copy(b).addSelf(h);o.copy(b).addSelf(m);if(n.equals(o))return m.clone();
-n.copy(c).addSelf(h);o.copy(e).addSelf(m);h=f.dot(m);m=o.subSelf(n).dot(m);h==0&&(console.log("Either infinite or no solutions!"),m==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));m/=h;if(m<0)return c=Math.atan2(c.y-b.y,c.x-b.x),b=Math.atan2(e.y-b.y,e.x-b.x),c>b&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function h(b){for(E=b.length;--E>=0;){ja=E;fa=E-1;fa<0&&(fa=b.length-
-1);for(var c=0,e=w+v*2,c=0;c<e;c++){var f=ea*c,k=ea*(c+1),h=da+ja+f,m=da+ja+k,o=h,f=da+fa+f,k=da+fa+k,p=m;o+=Y;f+=Y;k+=Y;p+=Y;G.faces.push(new THREE.Face4(o,f,k,p,null,null,J));J&&(o=c/e,f=(c+1)/e,k=n+u*2,h=(G.vertices[h].position.z+u)/k,m=(G.vertices[m].position.z+u)/k,G.faceVertexUvs[0].push([new THREE.UV(h,o),new THREE.UV(m,o),new THREE.UV(m,f),new THREE.UV(h,f)]))}}}function m(b,c,e){G.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}function k(b,c,e){b+=Y;c+=Y;e+=Y;G.faces.push(new THREE.Face3(b,
-c,e,null,null,D));if(D){var f=P.maxY,k=P.maxX,h=G.vertices[c].position.x,c=G.vertices[c].position.y,m=G.vertices[e].position.x,e=G.vertices[e].position.y;G.faceVertexUvs[0].push([new THREE.UV(G.vertices[b].position.x/k,G.vertices[b].position.y/f),new THREE.UV(h/k,c/f),new THREE.UV(m/k,e/f)])}}var n=c.amount!==void 0?c.amount:100,u=c.bevelThickness!==void 0?c.bevelThickness:6,p=c.bevelSize!==void 0?c.bevelSize:u-2,v=c.bevelSegments!==void 0?c.bevelSegments:3,t=c.bevelEnabled!==void 0?c.bevelEnabled:
-!0,x=c.curveSegments!==void 0?c.curveSegments:12,w=c.steps!==void 0?c.steps:1,y=c.bendPath,z=c.extrudePath,C,A=!1,F=c.useSpacedPoints!==void 0?c.useSpacedPoints:!1,D=c.material,J=c.extrudeMaterial,P=this.shapebb;if(z)C=z.getPoints(x),w=C.length,A=!0,t=!1;t||(p=u=v=0);var S,I,H,G=this,Y=this.vertices.length;y&&b.addWrapPath(y);x=F?b.extractAllSpacedPoints(x):b.extractAllPoints(x);y=x.shape;x=x.holes;if(z=!THREE.Shape.Utils.isClockWise(y)){y=y.reverse();I=0;for(H=x.length;I<H;I++)S=x[I],THREE.Shape.Utils.isClockWise(S)&&
-(x[I]=S.reverse());z=!1}z=THREE.Shape.Utils.triangulateShape(y,x);F=y;I=0;for(H=x.length;I<H;I++)S=x[I],y=y.concat(S);var E,Q,R,W,X,o,ea=y.length,V=z.length,la=[];E=0;Q=F.length;ja=Q-1;for(fa=E+1;E<Q;E++,ja++,fa++)ja==Q&&(ja=0),fa==Q&&(fa=0),la[E]=f(F[E],F[ja],F[fa]);var aa=[],ia,ca=la.concat();I=0;for(H=x.length;I<H;I++){S=x[I];ia=[];E=0;Q=S.length;ja=Q-1;for(fa=E+1;E<Q;E++,ja++,fa++)ja==Q&&(ja=0),fa==Q&&(fa=0),ia[E]=f(S[E],S[ja],S[fa]);aa.push(ia);ca=ca.concat(ia)}for(R=0;R<v;R++){W=R/v;X=u*(1-
-W);W=p*Math.sin(W*Math.PI/2);E=0;for(Q=F.length;E<Q;E++)o=e(F[E],la[E],W),m(o.x,o.y,-X);I=0;for(H=x.length;I<H;I++){S=x[I];ia=aa[I];E=0;for(Q=S.length;E<Q;E++)o=e(S[E],ia[E],W),m(o.x,o.y,-X)}}W=p;for(E=0;E<ea;E++)o=t?e(y[E],ca[E],W):y[E],A?m(o.x,o.y+C[0].y,C[0].x):m(o.x,o.y,0);for(R=1;R<=w;R++)for(E=0;E<ea;E++)o=t?e(y[E],ca[E],W):y[E],A?m(o.x,o.y+C[R-1].y,C[R-1].x):m(o.x,o.y,n/w*R);for(R=v-1;R>=0;R--){W=R/v;X=u*(1-W);W=p*Math.sin(W*Math.PI/2);E=0;for(Q=F.length;E<Q;E++)o=e(F[E],la[E],W),m(o.x,o.y,
-n+X);I=0;for(H=x.length;I<H;I++){S=x[I];ia=aa[I];E=0;for(Q=S.length;E<Q;E++)o=e(S[E],ia[E],W),A?m(o.x,o.y+C[w-1].y,C[w-1].x+X):m(o.x,o.y,n+X)}}if(t){t=ea*0;for(E=0;E<V;E++)p=z[E],k(p[2]+t,p[1]+t,p[0]+t);t=ea*(w+v*2);for(E=0;E<V;E++)p=z[E],k(p[0]+t,p[1]+t,p[2]+t)}else{for(E=0;E<V;E++)p=z[E],k(p[2],p[1],p[0]);for(E=0;E<V;E++)p=z[E],k(p[0]+ea*w,p[1]+ea*w,p[2]+ea*w)}var ja,fa,da=0;h(F);da+=F.length;I=0;for(H=x.length;I<H;I++)S=x[I],h(S),da+=S.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;
+THREE.CubeGeometry=function(b,c,e,f,k,m,h,n,p){function t(b,c,e,h,n,p,t,v){var w,x,y=f||1,z=k||1,Q=n/2,R=p/2,W=u.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")w="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")w="y",z=m||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")w="x",y=m||1;var X=y+1,o=z+1;n/=y;var ea=p/z;for(x=0;x<o;x++)for(p=0;p<X;p++){var V=new THREE.Vector3;V[b]=(p*n-Q)*e;V[c]=(x*ea-R)*h;V[w]=t;u.vertices.push(new THREE.Vertex(V))}for(x=0;x<z;x++)for(p=0;p<y;p++)u.faces.push(new THREE.Face4(p+X*
+x+W,p+X*(x+1)+W,p+1+X*(x+1)+W,p+1+X*x+W,null,null,v)),u.faceVertexUvs[0].push([new THREE.UV(p/y,x/z),new THREE.UV(p/y,(x+1)/z),new THREE.UV((p+1)/y,(x+1)/z),new THREE.UV((p+1)/y,x/z)])}THREE.Geometry.call(this);var u=this,w=b/2,x=c/2,v=e/2,n=n?-1:1;if(h!==void 0)if(h instanceof Array)this.materials=h;else{this.materials=[];for(var y=0;y<6;y++)this.materials.push([h])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(p!=void 0)for(var z in p)this.sides[z]!=void 0&&(this.sides[z]=
+p[z]);this.sides.px&&t("z","y",1*n,-1,e,c,-w,this.materials[0]);this.sides.nx&&t("z","y",-1*n,-1,e,c,w,this.materials[1]);this.sides.py&&t("x","z",1*n,1,b,e,x,this.materials[2]);this.sides.ny&&t("x","z",1*n,-1,b,e,-x,this.materials[3]);this.sides.pz&&t("x","y",1*n,-1,b,c,v,this.materials[4]);this.sides.nz&&t("x","y",-1*n,-1,b,c,-v,this.materials[5]);(function(){for(var b=[],c=[],e=0,f=u.vertices.length;e<f;e++){for(var h=u.vertices[e],k=!1,m=0,n=b.length;m<n;m++){var p=b[m];if(h.position.x==p.position.x&&
+h.position.y==p.position.y&&h.position.z==p.position.z){c[e]=m;k=!0;break}}if(!k)c[e]=b.length,b.push(new THREE.Vertex(h.position.clone()))}e=0;for(f=u.faces.length;e<f;e++)h=u.faces[e],h.a=c[h.a],h.b=c[h.b],h.c=c[h.c],h.d=c[h.d];u.vertices=b})();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
+THREE.CylinderGeometry=function(b,c,e,f,k,m){THREE.Geometry.call(this);var b=b!=null?b:20,c=c!=null?c:20,e=e||100,h=e/2,f=f||8,k=k||1,n,p,t=[],u=[];for(p=0;p<=k;p++){var w=[],x=[],v=p/k,y=v*(c-b)+b;for(n=0;n<=f;n++){var z=n/f;this.vertices.push(new THREE.Vertex(new THREE.Vector3(y*Math.sin(z*Math.PI*2),-v*e+h,y*Math.cos(z*Math.PI*2))));w.push(this.vertices.length-1);x.push(new THREE.UV(z,v))}t.push(w);u.push(x)}for(p=0;p<k;p++)for(n=0;n<f;n++){var e=t[p][n],w=t[p+1][n],x=t[p+1][n+1],v=t[p][n+1],y=
+this.vertices[e].position.clone().setY(0).normalize(),z=this.vertices[w].position.clone().setY(0).normalize(),C=this.vertices[x].position.clone().setY(0).normalize(),A=this.vertices[v].position.clone().setY(0).normalize(),F=u[p][n].clone(),D=u[p+1][n].clone(),J=u[p+1][n+1].clone(),P=u[p][n+1].clone();this.faces.push(new THREE.Face4(e,w,x,v,[y,z,C,A]));this.faceVertexUvs[0].push([F,D,J,P])}if(!m&&b>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,h,0)));for(n=0;n<f;n++)e=t[0][n],w=t[0][n+
+1],x=this.vertices.length-1,y=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,1,0),C=new THREE.Vector3(0,1,0),F=u[0][n].clone(),D=u[0][n+1].clone(),J=new THREE.UV(D.u,0),this.faces.push(new THREE.Face3(e,w,x,[y,z,C])),this.faceVertexUvs[0].push([F,D,J])}if(!m&&c>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-h,0)));for(n=0;n<f;n++)e=t[p][n+1],w=t[p][n],x=this.vertices.length-1,y=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),C=new THREE.Vector3(0,-1,0),F=u[p][n+1].clone(),D=u[p][n].clone(),
+J=new THREE.UV(D.u,1),this.faces.push(new THREE.Face3(e,w,x,[y,z,C])),this.faceVertexUvs[0].push([F,D,J])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
+THREE.ExtrudeGeometry=function(b,c){if(typeof b!="undefined"){THREE.Geometry.call(this);var b=b instanceof Array?b:[b],e,f=b.length,k;this.shapebb=b[f-1].getBoundingBox();for(e=0;e<f;e++)k=b[e],this.addShape(k,c);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
+THREE.ExtrudeGeometry.prototype.addShape=function(b,c){function e(b,c,e){c||console.log("die");return c.clone().multiplyScalar(e).addSelf(b)}function f(b,c,e){var f=THREE.ExtrudeGeometry.__v1,h=THREE.ExtrudeGeometry.__v2,k=THREE.ExtrudeGeometry.__v3,m=THREE.ExtrudeGeometry.__v4,n=THREE.ExtrudeGeometry.__v5,o=THREE.ExtrudeGeometry.__v6;f.set(b.x-c.x,b.y-c.y);h.set(b.x-e.x,b.y-e.y);f=f.normalize();h=h.normalize();k.set(-f.y,f.x);m.set(h.y,-h.x);n.copy(b).addSelf(k);o.copy(b).addSelf(m);if(n.equals(o))return m.clone();
+n.copy(c).addSelf(k);o.copy(e).addSelf(m);k=f.dot(m);m=o.subSelf(n).dot(m);k==0&&(console.log("Either infinite or no solutions!"),m==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));m/=k;if(m<0)return c=Math.atan2(c.y-b.y,c.x-b.x),b=Math.atan2(e.y-b.y,e.x-b.x),c>b&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function k(b){for(E=b.length;--E>=0;){ja=E;fa=E-1;fa<0&&(fa=b.length-
+1);for(var c=0,e=v+u*2,c=0;c<e;c++){var f=ea*c,h=ea*(c+1),k=da+ja+f,m=da+ja+h,o=k,f=da+fa+f,h=da+fa+h,t=m;o+=Y;f+=Y;h+=Y;t+=Y;G.faces.push(new THREE.Face4(o,f,h,t,null,null,J));J&&(o=c/e,f=(c+1)/e,h=n+p*2,k=(G.vertices[k].position.z+p)/h,m=(G.vertices[m].position.z+p)/h,G.faceVertexUvs[0].push([new THREE.UV(k,o),new THREE.UV(m,o),new THREE.UV(m,f),new THREE.UV(k,f)]))}}}function m(b,c,e){G.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}function h(b,c,e){b+=Y;c+=Y;e+=Y;G.faces.push(new THREE.Face3(b,
+c,e,null,null,D));if(D){var f=P.maxY,h=P.maxX,k=G.vertices[c].position.x,c=G.vertices[c].position.y,m=G.vertices[e].position.x,e=G.vertices[e].position.y;G.faceVertexUvs[0].push([new THREE.UV(G.vertices[b].position.x/h,G.vertices[b].position.y/f),new THREE.UV(k/h,c/f),new THREE.UV(m/h,e/f)])}}var n=c.amount!==void 0?c.amount:100,p=c.bevelThickness!==void 0?c.bevelThickness:6,t=c.bevelSize!==void 0?c.bevelSize:p-2,u=c.bevelSegments!==void 0?c.bevelSegments:3,w=c.bevelEnabled!==void 0?c.bevelEnabled:
+!0,x=c.curveSegments!==void 0?c.curveSegments:12,v=c.steps!==void 0?c.steps:1,y=c.bendPath,z=c.extrudePath,C,A=!1,F=c.useSpacedPoints!==void 0?c.useSpacedPoints:!1,D=c.material,J=c.extrudeMaterial,P=this.shapebb;if(z)C=z.getPoints(x),v=C.length,A=!0,w=!1;w||(t=p=u=0);var S,I,H,G=this,Y=this.vertices.length;y&&b.addWrapPath(y);x=F?b.extractAllSpacedPoints(x):b.extractAllPoints(x);y=x.shape;x=x.holes;if(z=!THREE.Shape.Utils.isClockWise(y)){y=y.reverse();I=0;for(H=x.length;I<H;I++)S=x[I],THREE.Shape.Utils.isClockWise(S)&&
+(x[I]=S.reverse());z=!1}z=THREE.Shape.Utils.triangulateShape(y,x);F=y;I=0;for(H=x.length;I<H;I++)S=x[I],y=y.concat(S);var E,Q,R,W,X,o,ea=y.length,V=z.length,la=[];E=0;Q=F.length;ja=Q-1;for(fa=E+1;E<Q;E++,ja++,fa++)ja==Q&&(ja=0),fa==Q&&(fa=0),la[E]=f(F[E],F[ja],F[fa]);var aa=[],ia,ca=la.concat();I=0;for(H=x.length;I<H;I++){S=x[I];ia=[];E=0;Q=S.length;ja=Q-1;for(fa=E+1;E<Q;E++,ja++,fa++)ja==Q&&(ja=0),fa==Q&&(fa=0),ia[E]=f(S[E],S[ja],S[fa]);aa.push(ia);ca=ca.concat(ia)}for(R=0;R<u;R++){W=R/u;X=p*(1-
+W);W=t*Math.sin(W*Math.PI/2);E=0;for(Q=F.length;E<Q;E++)o=e(F[E],la[E],W),m(o.x,o.y,-X);I=0;for(H=x.length;I<H;I++){S=x[I];ia=aa[I];E=0;for(Q=S.length;E<Q;E++)o=e(S[E],ia[E],W),m(o.x,o.y,-X)}}W=t;for(E=0;E<ea;E++)o=w?e(y[E],ca[E],W):y[E],A?m(o.x,o.y+C[0].y,C[0].x):m(o.x,o.y,0);for(R=1;R<=v;R++)for(E=0;E<ea;E++)o=w?e(y[E],ca[E],W):y[E],A?m(o.x,o.y+C[R-1].y,C[R-1].x):m(o.x,o.y,n/v*R);for(R=u-1;R>=0;R--){W=R/u;X=p*(1-W);W=t*Math.sin(W*Math.PI/2);E=0;for(Q=F.length;E<Q;E++)o=e(F[E],la[E],W),m(o.x,o.y,
+n+X);I=0;for(H=x.length;I<H;I++){S=x[I];ia=aa[I];E=0;for(Q=S.length;E<Q;E++)o=e(S[E],ia[E],W),A?m(o.x,o.y+C[v-1].y,C[v-1].x+X):m(o.x,o.y,n+X)}}if(w){w=ea*0;for(E=0;E<V;E++)t=z[E],h(t[2]+w,t[1]+w,t[0]+w);w=ea*(v+u*2);for(E=0;E<V;E++)t=z[E],h(t[0]+w,t[1]+w,t[2]+w)}else{for(E=0;E<V;E++)t=z[E],h(t[2],t[1],t[0]);for(E=0;E<V;E++)t=z[E],h(t[0]+ea*v,t[1]+ea*v,t[2]+ea*v)}var ja,fa,da=0;k(F);da+=F.length;I=0;for(H=x.length;I<H;I++)S=x[I],k(S),da+=S.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
-THREE.IcosahedronGeometry=function(b){function c(b,c,e){var f=Math.sqrt(b*b+c*c+e*e);return h.vertices.push(new THREE.Vertex(new THREE.Vector3(b/f,c/f,e/f)))-1}function e(b,c,e,f){f.faces.push(new THREE.Face3(b,c,e))}function f(b,e){var f=h.vertices[b].position,k=h.vertices[e].position;return c((f.x+k.x)/2,(f.y+k.y)/2,(f.z+k.z)/2)}var h=this,m=new THREE.Geometry;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;c(-1,b,0);c(1,b,0);c(-1,-b,0);c(1,-b,0);c(0,-1,b);c(0,1,b);c(0,-1,
--b);c(0,1,-b);c(b,0,-1);c(b,0,1);c(-b,0,-1);c(-b,0,1);e(0,11,5,m);e(0,5,1,m);e(0,1,7,m);e(0,7,10,m);e(0,10,11,m);e(1,5,9,m);e(5,11,4,m);e(11,10,2,m);e(10,7,6,m);e(7,1,8,m);e(3,9,4,m);e(3,4,2,m);e(3,2,6,m);e(3,6,8,m);e(3,8,9,m);e(4,9,5,m);e(2,4,11,m);e(6,2,10,m);e(8,6,7,m);e(9,8,1,m);for(var k=0;k<this.subdivisions;k++){var b=new THREE.Geometry,n;for(n in m.faces){var u=f(m.faces[n].a,m.faces[n].b),p=f(m.faces[n].b,m.faces[n].c),v=f(m.faces[n].c,m.faces[n].a);e(m.faces[n].a,u,v,b);e(m.faces[n].b,p,
-u,b);e(m.faces[n].c,v,p,b);e(u,p,v,b)}m.faces=b.faces}h.faces=m.faces;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
-THREE.LatheGeometry=function(b,c,e){THREE.Geometry.call(this);this.steps=c||12;this.angle=e||2*Math.PI;for(var c=this.angle/this.steps,e=[],f=[],h=[],m=[],k=(new THREE.Matrix4).setRotationZ(c),n=0;n<b.length;n++)this.vertices.push(new THREE.Vertex(b[n])),e[n]=b[n].clone(),f[n]=this.vertices.length-1;for(var u=0;u<=this.angle+0.0010;u+=c){for(n=0;n<e.length;n++)u<this.angle?(e[n]=k.multiplyVector3(e[n].clone()),this.vertices.push(new THREE.Vertex(e[n])),h[n]=this.vertices.length-1):h=m;u==0&&(m=f);
-for(n=0;n<f.length-1;n++)this.faces.push(new THREE.Face4(h[n],h[n+1],f[n+1],f[n])),this.faceVertexUvs[0].push([new THREE.UV(1-u/this.angle,n/b.length),new THREE.UV(1-u/this.angle,(n+1)/b.length),new THREE.UV(1-(u-c)/this.angle,(n+1)/b.length),new THREE.UV(1-(u-c)/this.angle,n/b.length)]);f=h;h=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
-THREE.PlaneGeometry=function(b,c,e,f){THREE.Geometry.call(this);var h,m=b/2,k=c/2,e=e||1,f=f||1,n=e+1,u=f+1;b/=e;var p=c/f;for(h=0;h<u;h++)for(c=0;c<n;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-m,-(h*p-k),0)));for(h=0;h<f;h++)for(c=0;c<e;c++)this.faces.push(new THREE.Face4(c+n*h,c+n*(h+1),c+1+n*(h+1),c+1+n*h)),this.faceVertexUvs[0].push([new THREE.UV(c/e,h/f),new THREE.UV(c/e,(h+1)/f),new THREE.UV((c+1)/e,(h+1)/f),new THREE.UV((c+1)/e,h/f)]);this.computeCentroids();this.computeFaceNormals()};
+THREE.IcosahedronGeometry=function(b){function c(b,c,e){var f=Math.sqrt(b*b+c*c+e*e);return k.vertices.push(new THREE.Vertex(new THREE.Vector3(b/f,c/f,e/f)))-1}function e(b,c,e,f){f.faces.push(new THREE.Face3(b,c,e))}function f(b,e){var f=k.vertices[b].position,h=k.vertices[e].position;return c((f.x+h.x)/2,(f.y+h.y)/2,(f.z+h.z)/2)}var k=this,m=new THREE.Geometry;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;c(-1,b,0);c(1,b,0);c(-1,-b,0);c(1,-b,0);c(0,-1,b);c(0,1,b);c(0,-1,
+-b);c(0,1,-b);c(b,0,-1);c(b,0,1);c(-b,0,-1);c(-b,0,1);e(0,11,5,m);e(0,5,1,m);e(0,1,7,m);e(0,7,10,m);e(0,10,11,m);e(1,5,9,m);e(5,11,4,m);e(11,10,2,m);e(10,7,6,m);e(7,1,8,m);e(3,9,4,m);e(3,4,2,m);e(3,2,6,m);e(3,6,8,m);e(3,8,9,m);e(4,9,5,m);e(2,4,11,m);e(6,2,10,m);e(8,6,7,m);e(9,8,1,m);for(var h=0;h<this.subdivisions;h++){var b=new THREE.Geometry,n;for(n in m.faces){var p=f(m.faces[n].a,m.faces[n].b),t=f(m.faces[n].b,m.faces[n].c),u=f(m.faces[n].c,m.faces[n].a);e(m.faces[n].a,p,u,b);e(m.faces[n].b,t,
+p,b);e(m.faces[n].c,u,t,b);e(p,t,u,b)}m.faces=b.faces}k.faces=m.faces;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
+THREE.LatheGeometry=function(b,c,e){THREE.Geometry.call(this);this.steps=c||12;this.angle=e||2*Math.PI;for(var c=this.angle/this.steps,e=[],f=[],k=[],m=[],h=(new THREE.Matrix4).setRotationZ(c),n=0;n<b.length;n++)this.vertices.push(new THREE.Vertex(b[n])),e[n]=b[n].clone(),f[n]=this.vertices.length-1;for(var p=0;p<=this.angle+0.001;p+=c){for(n=0;n<e.length;n++)p<this.angle?(e[n]=h.multiplyVector3(e[n].clone()),this.vertices.push(new THREE.Vertex(e[n])),k[n]=this.vertices.length-1):k=m;p==0&&(m=f);
+for(n=0;n<f.length-1;n++)this.faces.push(new THREE.Face4(k[n],k[n+1],f[n+1],f[n])),this.faceVertexUvs[0].push([new THREE.UV(1-p/this.angle,n/b.length),new THREE.UV(1-p/this.angle,(n+1)/b.length),new THREE.UV(1-(p-c)/this.angle,(n+1)/b.length),new THREE.UV(1-(p-c)/this.angle,n/b.length)]);f=k;k=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.OctahedronGeometry=function(b,c){function e(c){var e=c.clone().normalize(),e=new THREE.Vertex(e.clone().multiplyScalar(b));e.index=h.vertices.push(e)-1;e.uv=new THREE.UV(Math.atan2(c.z,-c.x)/2/Math.PI+0.5,Math.atan2(-c.y,Math.sqrt(c.x*c.x+c.z*c.z))/Math.PI+0.5);return e}function f(b,c,e,n){n<1?(n=new THREE.Face3(b.index,c.index,e.index,[b.position,c.position,e.position]),n.centroid.addSelf(b.position).addSelf(c.position).addSelf(e.position).divideScalar(3),n.normal=n.centroid.clone().normalize(),
+h.faces.push(n),n=Math.atan2(n.centroid.z,-n.centroid.x),h.faceVertexUvs[0].push([m(b.uv,b.position,n),m(c.uv,c.position,n),m(e.uv,e.position,n)])):(n-=1,f(b,k(b,c),k(b,e),n),f(k(b,c),c,k(c,e),n),f(k(b,e),k(c,e),e,n),f(k(b,c),k(c,e),k(b,e),n))}function k(b,c){n[b.index]||(n[b.index]=[]);n[c.index]||(n[c.index]=[]);var f=n[b.index][c.index];f===void 0&&(n[b.index][c.index]=n[c.index][b.index]=f=e((new THREE.Vector3).add(b.position,c.position).divideScalar(2)));return f}function m(b,c,e){e<0&&b.u===
+1&&(b=new THREE.UV(b.u-1,b.v));c.x===0&&c.z===0&&(b=new THREE.UV(e/2/Math.PI+0.5,b.v));return b}THREE.Geometry.call(this);var c=isFinite(c)?c:3,h=this;e(new THREE.Vector3(1,0,0));e(new THREE.Vector3(-1,0,0));e(new THREE.Vector3(0,1,0));e(new THREE.Vector3(0,-1,0));e(new THREE.Vector3(0,0,1));e(new THREE.Vector3(0,0,-1));var n=[],p=this.vertices;f(p[0],p[2],p[4],c);f(p[0],p[4],p[3],c);f(p[0],p[3],p[5],c);f(p[0],p[5],p[2],c);f(p[1],p[2],p[5],c);f(p[1],p[5],p[3],c);f(p[1],p[3],p[4],c);f(p[1],p[4],p[2],
+c);this.boundingSphere={radius:b}};THREE.OctahedronGeometry.prototype=new THREE.Geometry;THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
+THREE.PlaneGeometry=function(b,c,e,f){THREE.Geometry.call(this);var k,m=b/2,h=c/2,e=e||1,f=f||1,n=e+1,p=f+1;b/=e;var t=c/f;for(k=0;k<p;k++)for(c=0;c<n;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*b-m,-(k*t-h),0)));for(k=0;k<f;k++)for(c=0;c<e;c++)this.faces.push(new THREE.Face4(c+n*k,c+n*(k+1),c+1+n*(k+1),c+1+n*k)),this.faceVertexUvs[0].push([new THREE.UV(c/e,k/f),new THREE.UV(c/e,(k+1)/f),new THREE.UV((c+1)/e,(k+1)/f),new THREE.UV((c+1)/e,k/f)]);this.computeCentroids();this.computeFaceNormals()};
 THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f,h=Math.PI,m=Math.max(3,c||8),k=Math.max(2,e||6),c=[],e=0;e<k+1;e++){f=e/k;var n=b*Math.cos(f*h),u=b*Math.sin(f*h),p=[],v=0;for(f=0;f<m;f++){var t=2*f/m,x=u*Math.sin(t*h),t=u*Math.cos(t*h);(e==0||e==k)&&f>0||(v=this.vertices.push(new THREE.Vertex(new THREE.Vector3(t,n,x)))-1);p.push(v)}c.push(p)}for(var w,y,z,h=c.length,e=0;e<h;e++)if(m=c[e].length,e>0)for(f=0;f<m;f++){p=f==m-1;k=c[e][p?0:f+1];n=c[e][p?m-1:f];u=c[e-1][p?
-m-1:f];p=c[e-1][p?0:f+1];x=e/(h-1);w=(e-1)/(h-1);y=(f+1)/m;var t=f/m,v=new THREE.UV(1-y,x),x=new THREE.UV(1-t,x),t=new THREE.UV(1-t,w),C=new THREE.UV(1-y,w);e<c.length-1&&(w=this.vertices[k].position.clone(),y=this.vertices[n].position.clone(),z=this.vertices[u].position.clone(),w.normalize(),y.normalize(),z.normalize(),this.faces.push(new THREE.Face3(k,n,u,[new THREE.Vector3(w.x,w.y,w.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([v,x,t]));e>1&&(w=
-this.vertices[k].position.clone(),y=this.vertices[u].position.clone(),z=this.vertices[p].position.clone(),w.normalize(),y.normalize(),z.normalize(),this.faces.push(new THREE.Face3(k,u,p,[new THREE.Vector3(w.x,w.y,w.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([v,t,C]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;
+THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f,k=Math.PI,m=Math.max(3,c||8),h=Math.max(2,e||6),c=[],e=0;e<h+1;e++){f=e/h;var n=b*Math.cos(f*k),p=b*Math.sin(f*k),t=[],u=0;for(f=0;f<m;f++){var w=2*f/m,x=p*Math.sin(w*k),w=p*Math.cos(w*k);(e==0||e==h)&&f>0||(u=this.vertices.push(new THREE.Vertex(new THREE.Vector3(w,n,x)))-1);t.push(u)}c.push(t)}for(var v,y,z,k=c.length,e=0;e<k;e++)if(m=c[e].length,e>0)for(f=0;f<m;f++){t=f==m-1;h=c[e][t?0:f+1];n=c[e][t?m-1:f];p=c[e-1][t?
+m-1:f];t=c[e-1][t?0:f+1];x=e/(k-1);v=(e-1)/(k-1);y=(f+1)/m;var w=f/m,u=new THREE.UV(1-y,x),x=new THREE.UV(1-w,x),w=new THREE.UV(1-w,v),C=new THREE.UV(1-y,v);e<c.length-1&&(v=this.vertices[h].position.clone(),y=this.vertices[n].position.clone(),z=this.vertices[p].position.clone(),v.normalize(),y.normalize(),z.normalize(),this.faces.push(new THREE.Face3(h,n,p,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([u,x,w]));e>1&&(v=
+this.vertices[h].position.clone(),y=this.vertices[p].position.clone(),z=this.vertices[t].position.clone(),v.normalize(),y.normalize(),z.normalize(),this.faces.push(new THREE.Face3(h,p,t,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([u,w,C]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;
 THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 THREE.TextGeometry=function(b,c){var e=(new THREE.TextPath(b,c)).toShapes();c.amount=c.height!==void 0?c.height:50;if(c.bevelThickness===void 0)c.bevelThickness=10;if(c.bevelSize===void 0)c.bevelSize=8;if(c.bevelEnabled===void 0)c.bevelEnabled=!1;if(c.bend){var f=e[e.length-1].getBoundingBox().maxX;c.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(f/2,120),new THREE.Vector2(f,0))}THREE.ExtrudeGeometry.call(this,e,c)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(b,c){return(new TextPath(b,c)).toShapes()},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var c=
-this.getFace(),e=this.size/c.resolution,f=0,h=String(b).split(""),m=h.length,k=[],b=0;b<m;b++){var n=new THREE.Path,n=this.extractGlyphPoints(h[b],c,e,f,n);f+=n.offset;k.push(n.path)}return{paths:k,offset:f/2}},extractGlyphPoints:function(b,c,e,f,h){var m=[],k,n,u,p,v,t,x,w,y,z,C=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(C){if(C.o){c=C._cachedOutline||(C._cachedOutline=C.o.split(" "));u=c.length;for(b=0;b<u;)switch(n=c[b++],n){case "m":n=c[b++]*e+f;p=c[b++]*e;m.push(new THREE.Vector2(n,
-p));h.moveTo(n,p);break;case "l":n=c[b++]*e+f;p=c[b++]*e;m.push(new THREE.Vector2(n,p));h.lineTo(n,p);break;case "q":n=c[b++]*e+f;p=c[b++]*e;x=c[b++]*e+f;w=c[b++]*e;h.quadraticCurveTo(x,w,n,p);if(k=m[m.length-1]){v=k.x;t=k.y;k=1;for(divisions=this.divisions;k<=divisions;k++){var A=k/divisions,F=THREE.Shape.Utils.b2(A,v,x,n),A=THREE.Shape.Utils.b2(A,t,w,p);m.push(new THREE.Vector2(F,A))}}break;case "b":if(n=c[b++]*e+f,p=c[b++]*e,x=c[b++]*e+f,w=c[b++]*-e,y=c[b++]*e+f,z=c[b++]*-e,h.bezierCurveTo(n,p,
-x,w,y,z),k=m[m.length-1]){v=k.x;t=k.y;k=1;for(divisions=this.divisions;k<=divisions;k++)A=k/divisions,F=THREE.Shape.Utils.b3(A,v,x,y,n),A=THREE.Shape.Utils.b3(A,t,w,z,p),m.push(new THREE.Vector2(F,A))}}}return{offset:C.ha*e,points:m,path:h}}}};
-(function(b){var c=function(b){for(var c=b.length,h=0,m=c-1,k=0;k<c;m=k++)h+=b[m].x*b[k].y-b[k].x*b[m].y;return h*0.5};b.Triangulate=function(b,f){var h=b.length;if(h<3)return null;var m=[],k=[],n=[],u,p,v;if(c(b)>0)for(p=0;p<h;p++)k[p]=p;else for(p=0;p<h;p++)k[p]=h-1-p;var t=2*h;for(p=h-1;h>2;){if(t--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return m}u=p;h<=u&&(u=0);p=u+1;h<=p&&(p=0);v=p+1;h<=v&&(v=0);var x;a:{x=b;var w=u,y=p,z=v,C=h,A=k,F=void 0,D=void 0,J=void 0,
-P=void 0,S=void 0,I=void 0,H=void 0,G=void 0,Y=void 0,D=x[A[w]].x,J=x[A[w]].y,P=x[A[y]].x,S=x[A[y]].y,I=x[A[z]].x,H=x[A[z]].y;if(1.0E-10>(P-D)*(H-J)-(S-J)*(I-D))x=!1;else{for(F=0;F<C;F++)if(!(F==w||F==y||F==z)){var G=x[A[F]].x,Y=x[A[F]].y,E=void 0,Q=void 0,R=void 0,W=void 0,X=void 0,o=void 0,ea=void 0,V=void 0,la=void 0,aa=void 0,ia=void 0,ca=void 0,E=R=X=void 0,E=I-P,Q=H-S,R=D-I,W=J-H,X=P-D,o=S-J,ea=G-D,V=Y-J,la=G-P,aa=Y-S,ia=G-I,ca=Y-H,E=E*aa-Q*la,X=X*V-o*ea,R=R*ca-W*ia;if(E>=0&&R>=0&&X>=0){x=!1;
-break a}}x=!0}}if(x){m.push([b[k[u]],b[k[p]],b[k[v]]]);n.push([k[u],k[p],k[v]]);u=p;for(v=p+1;v<h;u++,v++)k[u]=k[v];h--;t=2*h}}if(f)return n;return m};b.Triangulate.area=c;return b})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
-THREE.TorusGeometry=function(b,c,e,f,h){THREE.Geometry.call(this);this.radius=b||100;this.tube=c||40;this.segmentsR=e||8;this.segmentsT=f||6;this.arc=h||Math.PI*2;h=new THREE.Vector3;b=[];c=[];for(e=0;e<=this.segmentsR;e++)for(f=0;f<=this.segmentsT;f++){var m=f/this.segmentsT*this.arc,k=e/this.segmentsR*Math.PI*2;h.x=this.radius*Math.cos(m);h.y=this.radius*Math.sin(m);var n=new THREE.Vector3;n.x=(this.radius+this.tube*Math.cos(k))*Math.cos(m);n.y=(this.radius+this.tube*Math.cos(k))*Math.sin(m);n.z=
-this.tube*Math.sin(k);this.vertices.push(new THREE.Vertex(n));b.push(new THREE.UV(f/this.segmentsT,1-e/this.segmentsR));c.push(n.clone().subSelf(h).normalize())}for(e=1;e<=this.segmentsR;e++)for(f=1;f<=this.segmentsT;f++){var h=(this.segmentsT+1)*e+f-1,m=(this.segmentsT+1)*(e-1)+f-1,k=(this.segmentsT+1)*(e-1)+f,n=(this.segmentsT+1)*e+f,u=new THREE.Face4(h,m,k,n,[c[h],c[m],c[k],c[n]]);u.normal.addSelf(c[h]);u.normal.addSelf(c[m]);u.normal.addSelf(c[k]);u.normal.addSelf(c[n]);u.normal.normalize();this.faces.push(u);
-this.faceVertexUvs[0].push([b[h].clone(),b[m].clone(),b[k].clone(),b[n].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
-THREE.TorusKnotGeometry=function(b,c,e,f,h,m,k){function n(b,c,e,f,k,h){c=e/f*b;e=Math.cos(c);return new THREE.Vector3(k*(2+e)*0.5*Math.cos(b),k*(2+e)*Math.sin(b)*0.5,h*k*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=b||200;this.tube=c||40;this.segmentsR=e||64;this.segmentsT=f||8;this.p=h||2;this.q=m||3;this.heightScale=k||1;this.grid=Array(this.segmentsR);e=new THREE.Vector3;f=new THREE.Vector3;m=new THREE.Vector3;for(b=0;b<this.segmentsR;++b){this.grid[b]=Array(this.segmentsT);for(c=0;c<
-this.segmentsT;++c){var u=b/this.segmentsR*2*this.p*Math.PI,k=c/this.segmentsT*2*Math.PI,h=n(u,k,this.q,this.p,this.radius,this.heightScale),u=n(u+0.01,k,this.q,this.p,this.radius,this.heightScale);e.x=u.x-h.x;e.y=u.y-h.y;e.z=u.z-h.z;f.x=u.x+h.x;f.y=u.y+h.y;f.z=u.z+h.z;m.cross(e,f);f.cross(m,e);m.normalize();f.normalize();u=-this.tube*Math.cos(k);k=this.tube*Math.sin(k);h.x+=u*f.x+k*m.x;h.y+=u*f.y+k*m.y;h.z+=u*f.z+k*m.z;this.grid[b][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(h.x,h.y,
-h.z)))-1}}for(b=0;b<this.segmentsR;++b)for(c=0;c<this.segmentsT;++c){var f=(b+1)%this.segmentsR,m=(c+1)%this.segmentsT,h=this.grid[b][c],e=this.grid[f][c],f=this.grid[f][m],m=this.grid[b][m],k=new THREE.UV(b/this.segmentsR,c/this.segmentsT),u=new THREE.UV((b+1)/this.segmentsR,c/this.segmentsT),p=new THREE.UV((b+1)/this.segmentsR,(c+1)/this.segmentsT),v=new THREE.UV(b/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(h,e,f,m));this.faceVertexUvs[0].push([k,u,p,v])}this.computeCentroids();
+this.getFace(),e=this.size/c.resolution,f=0,k=String(b).split(""),m=k.length,h=[],b=0;b<m;b++){var n=new THREE.Path,n=this.extractGlyphPoints(k[b],c,e,f,n);f+=n.offset;h.push(n.path)}return{paths:h,offset:f/2}},extractGlyphPoints:function(b,c,e,f,k){var m=[],h,n,p,t,u,w,x,v,y,z,C=c.glyphs[b]||c.glyphs[ctxt.options.fallbackCharacter];if(C){if(C.o){c=C._cachedOutline||(C._cachedOutline=C.o.split(" "));p=c.length;for(b=0;b<p;)switch(n=c[b++],n){case "m":n=c[b++]*e+f;t=c[b++]*e;m.push(new THREE.Vector2(n,
+t));k.moveTo(n,t);break;case "l":n=c[b++]*e+f;t=c[b++]*e;m.push(new THREE.Vector2(n,t));k.lineTo(n,t);break;case "q":n=c[b++]*e+f;t=c[b++]*e;x=c[b++]*e+f;v=c[b++]*e;k.quadraticCurveTo(x,v,n,t);if(h=m[m.length-1]){u=h.x;w=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++){var A=h/divisions,F=THREE.Shape.Utils.b2(A,u,x,n),A=THREE.Shape.Utils.b2(A,w,v,t);m.push(new THREE.Vector2(F,A))}}break;case "b":if(n=c[b++]*e+f,t=c[b++]*e,x=c[b++]*e+f,v=c[b++]*-e,y=c[b++]*e+f,z=c[b++]*-e,k.bezierCurveTo(n,t,
+x,v,y,z),h=m[m.length-1]){u=h.x;w=h.y;h=1;for(divisions=this.divisions;h<=divisions;h++)A=h/divisions,F=THREE.Shape.Utils.b3(A,u,x,y,n),A=THREE.Shape.Utils.b3(A,w,v,z,t),m.push(new THREE.Vector2(F,A))}}}return{offset:C.ha*e,points:m,path:k}}}};
+(function(b){var c=function(b){for(var c=b.length,k=0,m=c-1,h=0;h<c;m=h++)k+=b[m].x*b[h].y-b[h].x*b[m].y;return k*0.5};b.Triangulate=function(b,f){var k=b.length;if(k<3)return null;var m=[],h=[],n=[],p,t,u;if(c(b)>0)for(t=0;t<k;t++)h[t]=t;else for(t=0;t<k;t++)h[t]=k-1-t;var w=2*k;for(t=k-1;k>2;){if(w--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return m}p=t;k<=p&&(p=0);t=p+1;k<=t&&(t=0);u=t+1;k<=u&&(u=0);var x;a:{x=b;var v=p,y=t,z=u,C=k,A=h,F=void 0,D=void 0,J=void 0,
+P=void 0,S=void 0,I=void 0,H=void 0,G=void 0,Y=void 0,D=x[A[v]].x,J=x[A[v]].y,P=x[A[y]].x,S=x[A[y]].y,I=x[A[z]].x,H=x[A[z]].y;if(1.0E-10>(P-D)*(H-J)-(S-J)*(I-D))x=!1;else{for(F=0;F<C;F++)if(!(F==v||F==y||F==z)){var G=x[A[F]].x,Y=x[A[F]].y,E=void 0,Q=void 0,R=void 0,W=void 0,X=void 0,o=void 0,ea=void 0,V=void 0,la=void 0,aa=void 0,ia=void 0,ca=void 0,E=R=X=void 0,E=I-P,Q=H-S,R=D-I,W=J-H,X=P-D,o=S-J,ea=G-D,V=Y-J,la=G-P,aa=Y-S,ia=G-I,ca=Y-H,E=E*aa-Q*la,X=X*V-o*ea,R=R*ca-W*ia;if(E>=0&&R>=0&&X>=0){x=!1;
+break a}}x=!0}}if(x){m.push([b[h[p]],b[h[t]],b[h[u]]]);n.push([h[p],h[t],h[u]]);p=t;for(u=t+1;u<k;p++,u++)h[p]=h[u];k--;w=2*k}}if(f)return n;return m};b.Triangulate.area=c;return b})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
+THREE.TorusGeometry=function(b,c,e,f,k){THREE.Geometry.call(this);this.radius=b||100;this.tube=c||40;this.segmentsR=e||8;this.segmentsT=f||6;this.arc=k||Math.PI*2;k=new THREE.Vector3;b=[];c=[];for(e=0;e<=this.segmentsR;e++)for(f=0;f<=this.segmentsT;f++){var m=f/this.segmentsT*this.arc,h=e/this.segmentsR*Math.PI*2;k.x=this.radius*Math.cos(m);k.y=this.radius*Math.sin(m);var n=new THREE.Vector3;n.x=(this.radius+this.tube*Math.cos(h))*Math.cos(m);n.y=(this.radius+this.tube*Math.cos(h))*Math.sin(m);n.z=
+this.tube*Math.sin(h);this.vertices.push(new THREE.Vertex(n));b.push(new THREE.UV(f/this.segmentsT,1-e/this.segmentsR));c.push(n.clone().subSelf(k).normalize())}for(e=1;e<=this.segmentsR;e++)for(f=1;f<=this.segmentsT;f++){var k=(this.segmentsT+1)*e+f-1,m=(this.segmentsT+1)*(e-1)+f-1,h=(this.segmentsT+1)*(e-1)+f,n=(this.segmentsT+1)*e+f,p=new THREE.Face4(k,m,h,n,[c[k],c[m],c[h],c[n]]);p.normal.addSelf(c[k]);p.normal.addSelf(c[m]);p.normal.addSelf(c[h]);p.normal.addSelf(c[n]);p.normal.normalize();this.faces.push(p);
+this.faceVertexUvs[0].push([b[k].clone(),b[m].clone(),b[h].clone(),b[n].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
+THREE.TorusKnotGeometry=function(b,c,e,f,k,m,h){function n(b,c,e,f,h,k){c=e/f*b;e=Math.cos(c);return new THREE.Vector3(h*(2+e)*0.5*Math.cos(b),h*(2+e)*Math.sin(b)*0.5,k*h*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=b||200;this.tube=c||40;this.segmentsR=e||64;this.segmentsT=f||8;this.p=k||2;this.q=m||3;this.heightScale=h||1;this.grid=Array(this.segmentsR);e=new THREE.Vector3;f=new THREE.Vector3;m=new THREE.Vector3;for(b=0;b<this.segmentsR;++b){this.grid[b]=Array(this.segmentsT);for(c=0;c<
+this.segmentsT;++c){var p=b/this.segmentsR*2*this.p*Math.PI,h=c/this.segmentsT*2*Math.PI,k=n(p,h,this.q,this.p,this.radius,this.heightScale),p=n(p+0.01,h,this.q,this.p,this.radius,this.heightScale);e.x=p.x-k.x;e.y=p.y-k.y;e.z=p.z-k.z;f.x=p.x+k.x;f.y=p.y+k.y;f.z=p.z+k.z;m.cross(e,f);f.cross(m,e);m.normalize();f.normalize();p=-this.tube*Math.cos(h);h=this.tube*Math.sin(h);k.x+=p*f.x+h*m.x;k.y+=p*f.y+h*m.y;k.z+=p*f.z+h*m.z;this.grid[b][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(k.x,k.y,
+k.z)))-1}}for(b=0;b<this.segmentsR;++b)for(c=0;c<this.segmentsT;++c){var f=(b+1)%this.segmentsR,m=(c+1)%this.segmentsT,k=this.grid[b][c],e=this.grid[f][c],f=this.grid[f][m],m=this.grid[b][m],h=new THREE.UV(b/this.segmentsR,c/this.segmentsT),p=new THREE.UV((b+1)/this.segmentsR,c/this.segmentsT),t=new THREE.UV((b+1)/this.segmentsR,(c+1)/this.segmentsT),u=new THREE.UV(b/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(k,e,f,m));this.faceVertexUvs[0].push([h,p,t,u])}this.computeCentroids();
 this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;THREE.Loader=function(b){this.statusDomElement=(this.showStatus=b)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,addStatusElement:function(){var b=document.createElement("div");b.style.position="absolute";b.style.right="0px";b.style.top="0px";b.style.fontSize="0.8em";b.style.textAlign="left";b.style.background="rgba(0,0,0,0.25)";b.style.color="#fff";b.style.width="120px";b.style.padding="0.5em 0.5em 0.5em 0.5em";b.style.zIndex=1E3;b.innerHTML="Loading ...";return b},updateProgress:function(b){var c="Loaded ";c+=b.total?(100*b.loaded/b.total).toFixed(0)+"%":(b.loaded/
 1E3).toFixed(2)+" KB";this.statusDomElement.innerHTML=c},extractUrlbase:function(b){b=b.split("/");b.pop();return b.length<1?".":b.join("/")},init_materials:function(b,c,e){b.materials=[];for(var f=0;f<c.length;++f)b.materials[f]=[THREE.Loader.prototype.createMaterial(c[f],e)]},hasNormals:function(b){var c,e,f=b.materials.length;for(e=0;e<f;e++)if(c=b.materials[e][0],c instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(b,c){function e(b){b=Math.log(b)/Math.LN2;return Math.floor(b)==
-b}function f(b,c){var f=new Image;f.onload=function(){if(!e(this.width)||!e(this.height)){var c=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),f=Math.pow(2,Math.round(Math.log(this.height)/Math.LN2));b.image.width=c;b.image.height=f;b.image.getContext("2d").drawImage(this,0,0,c,f)}else b.image=this;b.needsUpdate=!0};f.src=c}function h(b,e,k,h,m,n){var p=document.createElement("canvas");b[e]=new THREE.Texture(p);b[e].sourceFile=k;if(h){b[e].repeat.set(h[0],h[1]);if(h[0]!=1)b[e].wrapS=THREE.RepeatWrapping;
-if(h[1]!=1)b[e].wrapT=THREE.RepeatWrapping}m&&b[e].offset.set(m[0],m[1]);if(n){h={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(h[n[0]]!==void 0)b[e].wrapS=h[n[0]];if(h[n[1]]!==void 0)b[e].wrapT=h[n[1]]}f(b[e],c+"/"+k)}function m(b){return(b[0]*255<<16)+(b[1]*255<<8)+b[2]*255}var k,n,u;n="MeshLambertMaterial";k={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:b.wireframe};b.shading&&(b.shading=="Phong"?n="MeshPhongMaterial":b.shading=="Basic"&&(n="MeshBasicMaterial"));
-if(b.blending)if(b.blending=="Additive")k.blending=THREE.AdditiveBlending;else if(b.blending=="Subtractive")k.blending=THREE.SubtractiveBlending;else if(b.blending=="Multiply")k.blending=THREE.MultiplyBlending;if(b.transparent!==void 0||b.opacity<1)k.transparent=b.transparent;if(b.depthTest!==void 0)k.depthTest=b.depthTest;if(b.vertexColors!==void 0)if(b.vertexColors=="face")k.vertexColors=THREE.FaceColors;else if(b.vertexColors)k.vertexColors=THREE.VertexColors;if(b.colorDiffuse)k.color=m(b.colorDiffuse);
-else if(b.DbgColor)k.color=b.DbgColor;if(b.colorSpecular)k.specular=m(b.colorSpecular);if(b.colorAmbient)k.ambient=m(b.colorAmbient);if(b.transparency)k.opacity=b.transparency;if(b.specularCoef)k.shininess=b.specularCoef;b.mapDiffuse&&c&&h(k,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap);b.mapLight&&c&&h(k,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap);b.mapNormal&&c&&h(k,"normalMap",b.mapNormal,b.mapNormalRepeat,b.mapNormalOffset,b.mapNormalWrap);
-b.mapSpecular&&c&&h(k,"specularMap",b.mapSpecular,b.mapSpecularRepeat,b.mapSpecularOffset,b.mapSpecularWrap);if(b.mapNormal){var p=THREE.ShaderUtils.lib.normal,v=THREE.UniformsUtils.clone(p.uniforms),t=k.color;n=k.specular;u=k.ambient;var x=k.shininess;v.tNormal.texture=k.normalMap;if(b.mapNormalFactor)v.uNormalScale.value=b.mapNormalFactor;if(k.map)v.tDiffuse.texture=k.map,v.enableDiffuse.value=!0;if(k.specularMap)v.tSpecular.texture=k.specularMap,v.enableSpecular.value=!0;if(k.lightMap)v.tAO.texture=
-k.lightMap,v.enableAO.value=!0;v.uDiffuseColor.value.setHex(t);v.uSpecularColor.value.setHex(n);v.uAmbientColor.value.setHex(u);v.uShininess.value=x;if(k.opacity)v.uOpacity.value=k.opacity;k=new THREE.ShaderMaterial({fragmentShader:p.fragmentShader,vertexShader:p.vertexShader,uniforms:v,lights:!0,fog:!0})}else k=new THREE[n](k);return k}};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;
+b}function f(b,c){var f=new Image;f.onload=function(){if(!e(this.width)||!e(this.height)){var c=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),f=Math.pow(2,Math.round(Math.log(this.height)/Math.LN2));b.image.width=c;b.image.height=f;b.image.getContext("2d").drawImage(this,0,0,c,f)}else b.image=this;b.needsUpdate=!0};f.src=c}function k(b,e,h,k,m,n){var p=document.createElement("canvas");b[e]=new THREE.Texture(p);b[e].sourceFile=h;if(k){b[e].repeat.set(k[0],k[1]);if(k[0]!=1)b[e].wrapS=THREE.RepeatWrapping;
+if(k[1]!=1)b[e].wrapT=THREE.RepeatWrapping}m&&b[e].offset.set(m[0],m[1]);if(n){k={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(k[n[0]]!==void 0)b[e].wrapS=k[n[0]];if(k[n[1]]!==void 0)b[e].wrapT=k[n[1]]}f(b[e],c+"/"+h)}function m(b){return(b[0]*255<<16)+(b[1]*255<<8)+b[2]*255}var h,n,p;n="MeshLambertMaterial";h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:b.wireframe};b.shading&&(b.shading=="Phong"?n="MeshPhongMaterial":b.shading=="Basic"&&(n="MeshBasicMaterial"));
+if(b.blending)if(b.blending=="Additive")h.blending=THREE.AdditiveBlending;else if(b.blending=="Subtractive")h.blending=THREE.SubtractiveBlending;else if(b.blending=="Multiply")h.blending=THREE.MultiplyBlending;if(b.transparent!==void 0||b.opacity<1)h.transparent=b.transparent;if(b.depthTest!==void 0)h.depthTest=b.depthTest;if(b.vertexColors!==void 0)if(b.vertexColors=="face")h.vertexColors=THREE.FaceColors;else if(b.vertexColors)h.vertexColors=THREE.VertexColors;if(b.colorDiffuse)h.color=m(b.colorDiffuse);
+else if(b.DbgColor)h.color=b.DbgColor;if(b.colorSpecular)h.specular=m(b.colorSpecular);if(b.colorAmbient)h.ambient=m(b.colorAmbient);if(b.transparency)h.opacity=b.transparency;if(b.specularCoef)h.shininess=b.specularCoef;b.mapDiffuse&&c&&k(h,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap);b.mapLight&&c&&k(h,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap);b.mapNormal&&c&&k(h,"normalMap",b.mapNormal,b.mapNormalRepeat,b.mapNormalOffset,b.mapNormalWrap);
+b.mapSpecular&&c&&k(h,"specularMap",b.mapSpecular,b.mapSpecularRepeat,b.mapSpecularOffset,b.mapSpecularWrap);if(b.mapNormal){var t=THREE.ShaderUtils.lib.normal,u=THREE.UniformsUtils.clone(t.uniforms),w=h.color;n=h.specular;p=h.ambient;var x=h.shininess;u.tNormal.texture=h.normalMap;if(b.mapNormalFactor)u.uNormalScale.value=b.mapNormalFactor;if(h.map)u.tDiffuse.texture=h.map,u.enableDiffuse.value=!0;if(h.specularMap)u.tSpecular.texture=h.specularMap,u.enableSpecular.value=!0;if(h.lightMap)u.tAO.texture=
+h.lightMap,u.enableAO.value=!0;u.uDiffuseColor.value.setHex(w);u.uSpecularColor.value.setHex(n);u.uAmbientColor.value.setHex(p);u.uShininess.value=x;if(h.opacity)u.uOpacity.value=h.opacity;h=new THREE.ShaderMaterial({fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:u,lights:!0,fog:!0})}else h=new THREE[n](h);return h}};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;
 THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
-THREE.BinaryLoader.prototype.load=function(b){var c=b.model,e=b.callback,f=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(c),h=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(c),b=(new Date).getTime(),c=new Worker(c),m=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,e,h,f,m)};c.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};
+THREE.BinaryLoader.prototype.load=function(b){var c=b.model,e=b.callback,f=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(c),k=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(c),b=(new Date).getTime(),c=new Worker(c),m=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,e,k,f,m)};c.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};
 c.postMessage(b)};
-THREE.BinaryLoader.prototype.loadAjaxBuffers=function(b,c,e,f,h,m){var k=new XMLHttpRequest,n=f+"/"+b,u=0;k.onreadystatechange=function(){k.readyState==4?k.status==200||k.status==0?THREE.BinaryLoader.prototype.createBinModel(k.responseText,e,h,c):alert("Couldn't load ["+n+"] ["+k.status+"]"):k.readyState==3?m&&(u==0&&(u=k.getResponseHeader("Content-Length")),m({total:u,loaded:k.responseText.length})):k.readyState==2&&(u=k.getResponseHeader("Content-Length"))};k.open("GET",n,!0);k.overrideMimeType("text/plain; charset=x-user-defined");
-k.setRequestHeader("Content-Type","text/plain");k.send(null)};
-THREE.BinaryLoader.prototype.createBinModel=function(b,c,e,f){var h=function(c){function e(b,c){var f=v(b,c),h=v(b,c+1),k=v(b,c+2),m=v(b,c+3),n=(m<<1&255|k>>7)-127;f|=(k&127)<<16|h<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,c){var e=v(b,c),f=v(b,c+1),k=v(b,c+2);return(v(b,c+3)<<24)+(k<<16)+(f<<8)+e}function u(b,c){var e=v(b,c);return(v(b,c+1)<<8)+e}function p(b,c){var e=v(b,c);return e>127?e-256:e}function v(b,c){return b.charCodeAt(c)&255}function t(c){var e,
-f,k;e=h(b,c);f=h(b,c+S);k=h(b,c+I);c=u(b,c+H);A.faces.push(new THREE.Face3(e,f,k,null,null,A.materials[c]))}function x(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+S);k=h(b,c+I);m=u(b,c+H);o=h(b,c+G);p=h(b,c+Y);c=h(b,c+E);m=A.materials[m];var t=J[p*3],v=J[p*3+1];p=J[p*3+2];var w=J[c*3],x=J[c*3+1],c=J[c*3+2];A.faces.push(new THREE.Face3(e,f,k,[new THREE.Vector3(J[o*3],J[o*3+1],J[o*3+2]),new THREE.Vector3(t,v,p),new THREE.Vector3(w,x,c)],null,m))}function w(c){var e,f,k,m;e=h(b,c);f=h(b,c+Q);k=h(b,c+R);m=h(b,
-c+W);c=u(b,c+X);A.faces.push(new THREE.Face4(e,f,k,m,null,null,A.materials[c]))}function y(c){var e,f,k,m,p,t,v,w;e=h(b,c);f=h(b,c+Q);k=h(b,c+R);m=h(b,c+W);p=u(b,c+X);t=h(b,c+o);v=h(b,c+ea);w=h(b,c+V);c=h(b,c+la);p=A.materials[p];var x=J[v*3],N=J[v*3+1];v=J[v*3+2];var y=J[w*3],M=J[w*3+1];w=J[w*3+2];var L=J[c*3],z=J[c*3+1],c=J[c*3+2];A.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(J[t*3],J[t*3+1],J[t*3+2]),new THREE.Vector3(x,N,v),new THREE.Vector3(y,M,w),new THREE.Vector3(L,z,c)],null,p))}
-function z(c){var e,f,k,m;e=h(b,c);f=h(b,c+aa);k=h(b,c+ia);c=P[e*2];m=P[e*2+1];e=P[f*2];var o=A.faceVertexUvs[0];f=P[f*2+1];var p=P[k*2];k=P[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,k));o.push(t)}function C(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+ca);k=h(b,c+ja);m=h(b,c+fa);c=P[e*2];o=P[e*2+1];e=P[f*2];p=P[f*2+1];f=P[k*2];var t=A.faceVertexUvs[0];k=P[k*2+1];var u=P[m*2];m=P[m*2+1];var v=[];v.push(new THREE.UV(c,o));v.push(new THREE.UV(e,p));v.push(new THREE.UV(f,
-k));v.push(new THREE.UV(u,m));t.push(v)}var A=this,F=0,D,J=[],P=[],S,I,H,G,Y,E,Q,R,W,X,o,ea,V,la,aa,ia,ca,ja,fa,da,U,Z,ga,ka,ta;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(A,f,c);D={signature:b.substr(F,8),header_bytes:v(b,F+8),vertex_coordinate_bytes:v(b,F+9),normal_coordinate_bytes:v(b,F+10),uv_coordinate_bytes:v(b,F+11),vertex_index_bytes:v(b,F+12),normal_index_bytes:v(b,F+13),uv_index_bytes:v(b,F+14),material_index_bytes:v(b,F+15),nvertices:h(b,F+16),nnormals:h(b,F+16+4),nuvs:h(b,
-F+16+8),ntri_flat:h(b,F+16+12),ntri_smooth:h(b,F+16+16),ntri_flat_uv:h(b,F+16+20),ntri_smooth_uv:h(b,F+16+24),nquad_flat:h(b,F+16+28),nquad_smooth:h(b,F+16+32),nquad_flat_uv:h(b,F+16+36),nquad_smooth_uv:h(b,F+16+40)};F+=D.header_bytes;S=D.vertex_index_bytes;I=D.vertex_index_bytes*2;H=D.vertex_index_bytes*3;G=D.vertex_index_bytes*3+D.material_index_bytes;Y=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes;E=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*2;Q=D.vertex_index_bytes;
+THREE.BinaryLoader.prototype.loadAjaxBuffers=function(b,c,e,f,k,m){var h=new XMLHttpRequest,n=f+"/"+b,p=0;h.onreadystatechange=function(){h.readyState==4?h.status==200||h.status==0?THREE.BinaryLoader.prototype.createBinModel(h.responseText,e,k,c):alert("Couldn't load ["+n+"] ["+h.status+"]"):h.readyState==3?m&&(p==0&&(p=h.getResponseHeader("Content-Length")),m({total:p,loaded:h.responseText.length})):h.readyState==2&&(p=h.getResponseHeader("Content-Length"))};h.open("GET",n,!0);h.overrideMimeType("text/plain; charset=x-user-defined");
+h.setRequestHeader("Content-Type","text/plain");h.send(null)};
+THREE.BinaryLoader.prototype.createBinModel=function(b,c,e,f){var k=function(c){function e(b,c){var f=u(b,c),h=u(b,c+1),k=u(b,c+2),m=u(b,c+3),n=(m<<1&255|k>>7)-127;f|=(k&127)<<16|h<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function k(b,c){var e=u(b,c),f=u(b,c+1),h=u(b,c+2);return(u(b,c+3)<<24)+(h<<16)+(f<<8)+e}function p(b,c){var e=u(b,c);return(u(b,c+1)<<8)+e}function t(b,c){var e=u(b,c);return e>127?e-256:e}function u(b,c){return b.charCodeAt(c)&255}function w(c){var e,
+f,h;e=k(b,c);f=k(b,c+S);h=k(b,c+I);c=p(b,c+H);A.faces.push(new THREE.Face3(e,f,h,null,null,A.materials[c]))}function x(c){var e,f,h,m,o,t;e=k(b,c);f=k(b,c+S);h=k(b,c+I);m=p(b,c+H);o=k(b,c+G);t=k(b,c+Y);c=k(b,c+E);m=A.materials[m];var v=J[t*3],w=J[t*3+1];t=J[t*3+2];var u=J[c*3],x=J[c*3+1],c=J[c*3+2];A.faces.push(new THREE.Face3(e,f,h,[new THREE.Vector3(J[o*3],J[o*3+1],J[o*3+2]),new THREE.Vector3(v,w,t),new THREE.Vector3(u,x,c)],null,m))}function v(c){var e,f,h,m;e=k(b,c);f=k(b,c+Q);h=k(b,c+R);m=k(b,
+c+W);c=p(b,c+X);A.faces.push(new THREE.Face4(e,f,h,m,null,null,A.materials[c]))}function y(c){var e,f,h,m,t,v,w,u;e=k(b,c);f=k(b,c+Q);h=k(b,c+R);m=k(b,c+W);t=p(b,c+X);v=k(b,c+o);w=k(b,c+ea);u=k(b,c+V);c=k(b,c+la);t=A.materials[t];var x=J[w*3],N=J[w*3+1];w=J[w*3+2];var y=J[u*3],M=J[u*3+1];u=J[u*3+2];var L=J[c*3],z=J[c*3+1],c=J[c*3+2];A.faces.push(new THREE.Face4(e,f,h,m,[new THREE.Vector3(J[v*3],J[v*3+1],J[v*3+2]),new THREE.Vector3(x,N,w),new THREE.Vector3(y,M,u),new THREE.Vector3(L,z,c)],null,t))}
+function z(c){var e,f,h,m;e=k(b,c);f=k(b,c+aa);h=k(b,c+ia);c=P[e*2];m=P[e*2+1];e=P[f*2];var o=A.faceVertexUvs[0];f=P[f*2+1];var p=P[h*2];h=P[h*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,h));o.push(t)}function C(c){var e,f,h,m,o,p;e=k(b,c);f=k(b,c+ca);h=k(b,c+ja);m=k(b,c+fa);c=P[e*2];o=P[e*2+1];e=P[f*2];p=P[f*2+1];f=P[h*2];var t=A.faceVertexUvs[0];h=P[h*2+1];var v=P[m*2];m=P[m*2+1];var w=[];w.push(new THREE.UV(c,o));w.push(new THREE.UV(e,p));w.push(new THREE.UV(f,
+h));w.push(new THREE.UV(v,m));t.push(w)}var A=this,F=0,D,J=[],P=[],S,I,H,G,Y,E,Q,R,W,X,o,ea,V,la,aa,ia,ca,ja,fa,da,U,Z,ga,ka,ta;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(A,f,c);D={signature:b.substr(F,8),header_bytes:u(b,F+8),vertex_coordinate_bytes:u(b,F+9),normal_coordinate_bytes:u(b,F+10),uv_coordinate_bytes:u(b,F+11),vertex_index_bytes:u(b,F+12),normal_index_bytes:u(b,F+13),uv_index_bytes:u(b,F+14),material_index_bytes:u(b,F+15),nvertices:k(b,F+16),nnormals:k(b,F+16+4),nuvs:k(b,
+F+16+8),ntri_flat:k(b,F+16+12),ntri_smooth:k(b,F+16+16),ntri_flat_uv:k(b,F+16+20),ntri_smooth_uv:k(b,F+16+24),nquad_flat:k(b,F+16+28),nquad_smooth:k(b,F+16+32),nquad_flat_uv:k(b,F+16+36),nquad_smooth_uv:k(b,F+16+40)};F+=D.header_bytes;S=D.vertex_index_bytes;I=D.vertex_index_bytes*2;H=D.vertex_index_bytes*3;G=D.vertex_index_bytes*3+D.material_index_bytes;Y=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes;E=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*2;Q=D.vertex_index_bytes;
 R=D.vertex_index_bytes*2;W=D.vertex_index_bytes*3;X=D.vertex_index_bytes*4;o=D.vertex_index_bytes*4+D.material_index_bytes;ea=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes;V=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*2;la=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*3;aa=D.uv_index_bytes;ia=D.uv_index_bytes*2;ca=D.uv_index_bytes;ja=D.uv_index_bytes*2;fa=D.uv_index_bytes*3;c=D.vertex_index_bytes*3+D.material_index_bytes;ta=D.vertex_index_bytes*
-4+D.material_index_bytes;da=D.ntri_flat*c;U=D.ntri_smooth*(c+D.normal_index_bytes*3);Z=D.ntri_flat_uv*(c+D.uv_index_bytes*3);ga=D.ntri_smooth_uv*(c+D.normal_index_bytes*3+D.uv_index_bytes*3);ka=D.nquad_flat*ta;c=D.nquad_smooth*(ta+D.normal_index_bytes*4);ta=D.nquad_flat_uv*(ta+D.uv_index_bytes*4);F+=function(c){for(var f,h,m,n=D.vertex_coordinate_bytes*3,o=c+D.nvertices*n;c<o;c+=n)f=e(b,c),h=e(b,c+D.vertex_coordinate_bytes),m=e(b,c+D.vertex_coordinate_bytes*2),A.vertices.push(new THREE.Vertex(new THREE.Vector3(f,
-h,m)));return D.nvertices*n}(F);F+=function(c){for(var e,f,h,k=D.normal_coordinate_bytes*3,m=c+D.nnormals*k;c<m;c+=k)e=p(b,c),f=p(b,c+D.normal_coordinate_bytes),h=p(b,c+D.normal_coordinate_bytes*2),J.push(e/127,f/127,h/127);return D.nnormals*k}(F);F+=function(c){for(var f,h,m=D.uv_coordinate_bytes*2,n=c+D.nuvs*m;c<n;c+=m)f=e(b,c),h=e(b,c+D.uv_coordinate_bytes),P.push(f,h);return D.nuvs*m}(F);da=F+da;U=da+U;Z=U+Z;ga=Z+ga;ka=ga+ka;c=ka+c;ta=c+ta;(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes,
-f=e+D.uv_index_bytes*3,h=b+D.ntri_flat_uv*f;for(c=b;c<h;c+=f)t(c),z(c+e);return h-b})(U);(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,f=e+D.uv_index_bytes*3,h=b+D.ntri_smooth_uv*f;for(c=b;c<h;c+=f)x(c),z(c+e);return h-b})(Z);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes,f=e+D.uv_index_bytes*4,h=b+D.nquad_flat_uv*f;for(c=b;c<h;c+=f)w(c),C(c+e);return h-b})(c);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*
-4,f=e+D.uv_index_bytes*4,h=b+D.nquad_smooth_uv*f;for(c=b;c<h;c+=f)y(c),C(c+e);return h-b})(ta);(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes,f=b+D.ntri_flat*e;for(c=b;c<f;c+=e)t(c);return f-b})(F);(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,f=b+D.ntri_smooth*e;for(c=b;c<f;c+=e)x(c);return f-b})(da);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes,f=b+D.nquad_flat*e;for(c=b;c<f;c+=e)w(c);return f-b})(ga);(function(b){var c,
-e=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*4,f=b+D.nquad_smooth*e;for(c=b;c<f;c+=e)y(c);return f-b})(ka);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};h.prototype=new THREE.Geometry;h.prototype.constructor=h;c(new h(e))};
+4+D.material_index_bytes;da=D.ntri_flat*c;U=D.ntri_smooth*(c+D.normal_index_bytes*3);Z=D.ntri_flat_uv*(c+D.uv_index_bytes*3);ga=D.ntri_smooth_uv*(c+D.normal_index_bytes*3+D.uv_index_bytes*3);ka=D.nquad_flat*ta;c=D.nquad_smooth*(ta+D.normal_index_bytes*4);ta=D.nquad_flat_uv*(ta+D.uv_index_bytes*4);F+=function(c){for(var f,k,m,n=D.vertex_coordinate_bytes*3,o=c+D.nvertices*n;c<o;c+=n)f=e(b,c),k=e(b,c+D.vertex_coordinate_bytes),m=e(b,c+D.vertex_coordinate_bytes*2),A.vertices.push(new THREE.Vertex(new THREE.Vector3(f,
+k,m)));return D.nvertices*n}(F);F+=function(c){for(var e,f,h,k=D.normal_coordinate_bytes*3,m=c+D.nnormals*k;c<m;c+=k)e=t(b,c),f=t(b,c+D.normal_coordinate_bytes),h=t(b,c+D.normal_coordinate_bytes*2),J.push(e/127,f/127,h/127);return D.nnormals*k}(F);F+=function(c){for(var f,k,m=D.uv_coordinate_bytes*2,n=c+D.nuvs*m;c<n;c+=m)f=e(b,c),k=e(b,c+D.uv_coordinate_bytes),P.push(f,k);return D.nuvs*m}(F);da=F+da;U=da+U;Z=U+Z;ga=Z+ga;ka=ga+ka;c=ka+c;ta=c+ta;(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes,
+f=e+D.uv_index_bytes*3,h=b+D.ntri_flat_uv*f;for(c=b;c<h;c+=f)w(c),z(c+e);return h-b})(U);(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,f=e+D.uv_index_bytes*3,h=b+D.ntri_smooth_uv*f;for(c=b;c<h;c+=f)x(c),z(c+e);return h-b})(Z);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes,f=e+D.uv_index_bytes*4,h=b+D.nquad_flat_uv*f;for(c=b;c<h;c+=f)v(c),C(c+e);return h-b})(c);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*
+4,f=e+D.uv_index_bytes*4,h=b+D.nquad_smooth_uv*f;for(c=b;c<h;c+=f)y(c),C(c+e);return h-b})(ta);(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes,f=b+D.ntri_flat*e;for(c=b;c<f;c+=e)w(c);return f-b})(F);(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,f=b+D.ntri_smooth*e;for(c=b;c<f;c+=e)x(c);return f-b})(da);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes,f=b+D.nquad_flat*e;for(c=b;c<f;c+=e)v(c);return f-b})(ga);(function(b){var c,
+e=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*4,f=b+D.nquad_smooth*e;for(c=b;c<f;c+=e)y(c);return f-b})(ka);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};k.prototype=new THREE.Geometry;k.prototype.constructor=k;c(new k(e))};
 THREE.ColladaLoader=function(){function b(b,c,e){for(var b=da.evaluate(b,da,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),f={},h=b.iterateNext(),k=0;h;){h=(new c).parse(h);if(h.id.length==0)h.id=e+k++;f[h.id]=h;h=b.iterateNext()}return f}function c(){var b=1E6,c=-b,e=0,f;for(f in ma)for(var h=ma[f],k=0;k<h.sampler.length;k++){var m=h.sampler[k];m.create();b=Math.min(b,m.startTime);c=Math.max(c,m.endTime);e=Math.max(e,m.input.length)}return{start:b,end:c,frames:e}}function e(b,c,f,h){b.world=b.world||
 new THREE.Matrix4;b.world.copy(b.matrix);if(b.channels&&b.channels.length){var k=b.channels[0].sampler.output[f];k instanceof THREE.Matrix4&&b.world.copy(k)}h&&b.world.multiply(h,b.world);c.push(b);for(h=0;h<b.nodes.length;h++)e(b.nodes[h],c,f,b.world)}function f(b,f,h){var k=na[f.url];if(!k||!k.skin)console.log("could not find skin controller!");else if(!f.skeleton||!f.skeleton.length)console.log("could not find the skeleton for the skin!");else{var m=c(),f=Z.getChildById(f.skeleton[0],!0)||Z.getChildBySid(f.skeleton[0],
-!0),n,o,p,t,u=new THREE.Vector3,v;for(n=0;n<b.vertices.length;n++)k.skin.bindShapeMatrix.multiplyVector3(b.vertices[n].position);for(h=0;h<m.frames;h++){var w=[],x=[];for(n=0;n<b.vertices.length;n++)x.push(new THREE.Vertex(new THREE.Vector3));e(f,w,h);n=w;o=k.skin;for(t=0;t<n.length;t++){p=n[t];v=-1;for(var y=0;y<o.joints.length;y++)if(p.sid==o.joints[y]){v=y;break}if(v>=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];
-for(y=0;y<o.weights.length;y++)for(var z=0;z<o.weights[y].length;z++){var C=o.weights[y][z];C.joint==v&&p.weights.push(C)}}else throw"could not find joint!";}for(n=0;n<w.length;n++)for(o=0;o<w[n].weights.length;o++)p=w[n].weights[o],t=p.index,p=p.weight,v=b.vertices[t],t=x[t],u.x=v.position.x,u.y=v.position.y,u.z=v.position.z,w[n].skinningMatrix.multiplyVector3(u),t.position.x+=u.x*p,t.position.y+=u.y*p,t.position.z+=u.z*p;b.morphTargets.push({name:"target_"+h,vertices:x})}}}function h(b){var c=new THREE.Object3D,
-e,k,m;c.name=b.id||"";c.matrixAutoUpdate=!1;c.matrix=b.matrix;for(m=0;m<b.controllers.length;m++){var n=na[b.controllers[m].url];switch(n.type){case "skin":if(qa[n.skin.source]){var o=new y;o.url=n.skin.source;o.instance_material=b.controllers[m].instance_material;b.geometries.push(o);e=b.controllers[m]}else if(na[n.skin.source]&&(k=n=na[n.skin.source],n.morph&&qa[n.morph.source]))o=new y,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o);break;case "morph":if(qa[n.morph.source])o=
-new y,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o),k=b.controllers[m];console.log("DAE: morph-controller partially supported.")}}for(m=0;m<b.geometries.length;m++){var n=b.geometries[m],o=n.instance_material,n=qa[n.url],p={},t=0,u;if(n&&n.mesh&&n.mesh.primitives){if(c.name.length==0)c.name=n.id;if(o)for(j=0;j<o.length;j++){u=o[j];var v=ua[ra[u.target].instance_effect.url].shader;v.material.opacity=!v.material.opacity?1:v.material.opacity;u=p[u.symbol]=
-v.material;t++}o=u||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});n=n.mesh.geometry3js;if(t>1){o=new THREE.MeshFaceMaterial;for(j=0;j<n.faces.length;j++)t=n.faces[j],t.materials=[p[t.daeMaterial]]}if(e!==void 0)f(n,e),o.morphTargets=!0,o=new THREE.SkinnedMesh(n,o),o.skeleton=e.skeleton,o.skinController=na[e.url],o.skinInstanceController=e,o.name="skin_"+Ba.length,Ba.push(o);else if(k!==void 0){p=n;t=k instanceof x?na[k.url]:k;if(!t||!t.morph)console.log("could not find morph controller!");
-else{t=t.morph;for(v=0;v<t.targets.length;v++){var w=qa[t.targets[v]];if(w.mesh&&w.mesh.primitives&&w.mesh.primitives.length)w=w.mesh.primitives[0].geometry,w.vertices.length===p.vertices.length&&p.morphTargets.push({name:"target_1",vertices:w.vertices})}p.morphTargets.push({name:"target_Z",vertices:p.vertices})}o.morphTargets=!0;o=new THREE.Mesh(n,o);o.name="morph_"+za.length;za.push(o)}else o=new THREE.Mesh(n,o);c.add(o)}}for(m=0;m<b.nodes.length;m++)c.add(h(b.nodes[m],b));return c}function m(){this.init_from=
-this.id=""}function k(){this.type=this.name=this.id="";this.morph=this.skin=null}function n(){this.weights=this.targets=this.source=this.method=null}function u(){this.source="";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function p(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function v(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=[];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function t(){this.type=
-this.sid="";this.data=[];this.matrix=new THREE.Matrix4}function x(){this.url="";this.skeleton=[];this.instance_material=[]}function w(){this.target=this.symbol=""}function y(){this.url="";this.instance_material=[]}function z(){this.id="";this.mesh=null}function C(b){this.geometry=b.id;this.primitives=[];this.geometry3js=this.vertices=null}function A(){}function F(){this.material="";this.count=0;this.inputs=[];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function D(){this.source="";
+!0),n,o,p,t,v=new THREE.Vector3,w;for(n=0;n<b.vertices.length;n++)k.skin.bindShapeMatrix.multiplyVector3(b.vertices[n].position);for(h=0;h<m.frames;h++){var u=[],x=[];for(n=0;n<b.vertices.length;n++)x.push(new THREE.Vertex(new THREE.Vector3));e(f,u,h);n=u;o=k.skin;for(t=0;t<n.length;t++){p=n[t];w=-1;for(var y=0;y<o.joints.length;y++)if(p.sid==o.joints[y]){w=y;break}if(w>=0){y=o.invBindMatrices[w];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];
+for(y=0;y<o.weights.length;y++)for(var z=0;z<o.weights[y].length;z++){var C=o.weights[y][z];C.joint==w&&p.weights.push(C)}}else throw"could not find joint!";}for(n=0;n<u.length;n++)for(o=0;o<u[n].weights.length;o++)p=u[n].weights[o],t=p.index,p=p.weight,w=b.vertices[t],t=x[t],v.x=w.position.x,v.y=w.position.y,v.z=w.position.z,u[n].skinningMatrix.multiplyVector3(v),t.position.x+=v.x*p,t.position.y+=v.y*p,t.position.z+=v.z*p;b.morphTargets.push({name:"target_"+h,vertices:x})}}}function k(b){var c=new THREE.Object3D,
+e,h,m;c.name=b.id||"";c.matrixAutoUpdate=!1;c.matrix=b.matrix;for(m=0;m<b.controllers.length;m++){var n=na[b.controllers[m].url];switch(n.type){case "skin":if(qa[n.skin.source]){var o=new y;o.url=n.skin.source;o.instance_material=b.controllers[m].instance_material;b.geometries.push(o);e=b.controllers[m]}else if(na[n.skin.source]&&(h=n=na[n.skin.source],n.morph&&qa[n.morph.source]))o=new y,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o);break;case "morph":if(qa[n.morph.source])o=
+new y,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o),h=b.controllers[m];console.log("DAE: morph-controller partially supported.")}}for(m=0;m<b.geometries.length;m++){var n=b.geometries[m],o=n.instance_material,n=qa[n.url],p={},t=0,v;if(n&&n.mesh&&n.mesh.primitives){if(c.name.length==0)c.name=n.id;if(o)for(j=0;j<o.length;j++){v=o[j];var w=ua[ra[v.target].instance_effect.url].shader;w.material.opacity=!w.material.opacity?1:w.material.opacity;v=p[v.symbol]=
+w.material;t++}o=v||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});n=n.mesh.geometry3js;if(t>1){o=new THREE.MeshFaceMaterial;for(j=0;j<n.faces.length;j++)t=n.faces[j],t.materials=[p[t.daeMaterial]]}if(e!==void 0)f(n,e),o.morphTargets=!0,o=new THREE.SkinnedMesh(n,o),o.skeleton=e.skeleton,o.skinController=na[e.url],o.skinInstanceController=e,o.name="skin_"+Ba.length,Ba.push(o);else if(h!==void 0){p=n;t=h instanceof x?na[h.url]:h;if(!t||!t.morph)console.log("could not find morph controller!");
+else{t=t.morph;for(w=0;w<t.targets.length;w++){var u=qa[t.targets[w]];if(u.mesh&&u.mesh.primitives&&u.mesh.primitives.length)u=u.mesh.primitives[0].geometry,u.vertices.length===p.vertices.length&&p.morphTargets.push({name:"target_1",vertices:u.vertices})}p.morphTargets.push({name:"target_Z",vertices:p.vertices})}o.morphTargets=!0;o=new THREE.Mesh(n,o);o.name="morph_"+za.length;za.push(o)}else o=new THREE.Mesh(n,o);c.add(o)}}for(m=0;m<b.nodes.length;m++)c.add(k(b.nodes[m],b));return c}function m(){this.init_from=
+this.id=""}function h(){this.type=this.name=this.id="";this.morph=this.skin=null}function n(){this.weights=this.targets=this.source=this.method=null}function p(){this.source="";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function t(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function u(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=[];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function w(){this.type=
+this.sid="";this.data=[];this.matrix=new THREE.Matrix4}function x(){this.url="";this.skeleton=[];this.instance_material=[]}function v(){this.target=this.symbol=""}function y(){this.url="";this.instance_material=[]}function z(){this.id="";this.mesh=null}function C(b){this.geometry=b.id;this.primitives=[];this.geometry3js=this.vertices=null}function A(){}function F(){this.material="";this.count=0;this.inputs=[];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function D(){this.source="";
 this.stride=this.count=0;this.params=[]}function J(){this.input={}}function P(){this.semantic="";this.offset=0;this.source="";this.set=0}function S(b){this.id=b;this.type=null}function I(){this.name=this.id="";this.instance_effect=null}function H(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texcoord=this.texture=null}function G(b,c){this.type=b;this.effect=c;this.material=null}function Y(b){this.effect=b;this.format=this.init_from=
 null}function E(b){this.effect=b;this.mipfilter=this.magfilter=this.minfilter=this.wrap_t=this.wrap_s=this.source=null}function Q(){this.name=this.id="";this.sampler=this.surface=this.shader=null}function R(){this.url=""}function W(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function X(b){this.animation=b;this.target=this.source="";this.member=this.arrIndices=this.arrSyntax=this.dotSyntax=this.sid=null}function o(b){this.id="";this.animation=b;this.inputs=[];this.endTime=
 this.startTime=this.interpolation=this.output=this.input=null;this.duration=0}function ea(b){var c=b.getAttribute("id");if(ka[c]!=void 0)return ka[c];ka[c]=(new S(c)).parse(b);return ka[c]}function V(b){if(b=="dae")return"http://www.collada.org/2005/11/COLLADASchema";return null}function la(b){for(var b=ia(b),c=[],e=0;e<b.length;e++)c.push(parseFloat(b[e]));return c}function aa(b){for(var b=ia(b),c=[],e=0;e<b.length;e++)c.push(parseInt(b[e],10));return c}function ia(b){return b.replace(/^\s+/,"").replace(/\s+$/,
-"").split(/\s+/)}function ca(b,c,e){return b.hasAttribute(c)?parseInt(b.getAttribute(c),10):e}function ja(b,c){if(b===void 0){for(var e="0.";e.length<c+2;)e+="0";return e}c=c||2;e=b.toString().split(".");for(e[1]=e.length>1?e[1].substr(0,c):"0";e[1].length<c;)e[1]+="0";return e.join(".")}function fa(b,c){var e="";e+=ja(b.x,c)+",";e+=ja(b.y,c)+",";e+=ja(b.z,c);return e}var da=null,U=null,Z,ga=null,ka={},ta={},ma={},na={},qa={},ra={},ua={},Ca,Ea,za,Ba,Ga=THREE.SmoothShading;m.prototype.parse=function(b){this.id=
-b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="init_from")this.init_from=e.textContent}return this};k.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.type="none";for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "skin":this.skin=(new u).parse(e);this.type=e.nodeName;break;case "morph":this.morph=(new n).parse(e),this.type=e.nodeName}}return this};n.prototype.parse=function(b){var c=
+"").split(/\s+/)}function ca(b,c,e){return b.hasAttribute(c)?parseInt(b.getAttribute(c),10):e}function ja(b,c){if(b===void 0){for(var e="0.";e.length<c+2;)e+="0";return e}c=c||2;e=b.toString().split(".");for(e[1]=e.length>1?e[1].substr(0,c):"0";e[1].length<c;)e[1]+="0";return e.join(".")}function fa(b,c){var e="";e+=ja(b.x,c)+",";e+=ja(b.y,c)+",";e+=ja(b.z,c);return e}var da=null,U=null,Z,ga=null,ka={},ta={},ma={},na={},qa={},ra={},ua={},Da,Fa,za,Ba,Ga=THREE.SmoothShading;m.prototype.parse=function(b){this.id=
+b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="init_from")this.init_from=e.textContent}return this};h.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.type="none";for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "skin":this.skin=(new p).parse(e);this.type=e.nodeName;break;case "morph":this.morph=(new n).parse(e),this.type=e.nodeName}}return this};n.prototype.parse=function(b){var c=
 {},e=[],f;this.method=b.getAttribute("method");this.source=b.getAttribute("source").replace(/^#/,"");for(f=0;f<b.childNodes.length;f++){var h=b.childNodes[f];if(h.nodeType==1)switch(h.nodeName){case "source":h=(new S).parse(h);c[h.id]=h;break;case "targets":e=this.parseInputs(h);break;default:console.log(h.nodeName)}}for(f=0;f<e.length;f++)switch(b=e[f],h=c[b.source],b.semantic){case "MORPH_TARGET":this.targets=h.read();break;case "MORPH_WEIGHT":this.weights=h.read()}return this};n.prototype.parseInputs=
-function(b){for(var c=[],e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":c.push((new P).parse(f))}}return c};u.prototype.parse=function(b){var c={},e,f;this.source=b.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var h=0;h<b.childNodes.length;h++){var k=b.childNodes[h];if(k.nodeType==1)switch(k.nodeName){case "bind_shape_matrix":k=la(k.textContent);this.bindShapeMatrix=new THREE.Matrix4;this.bindShapeMatrix.set(k[0],
-k[1],k[2],k[3],k[4],k[5],k[6],k[7],k[8],k[9],k[10],k[11],k[12],k[13],k[14],k[15]);break;case "source":k=(new S).parse(k);c[k.id]=k;break;case "joints":e=k;break;case "vertex_weights":f=k;break;default:console.log(k.nodeName)}}this.parseJoints(e,c);this.parseWeights(f,c);return this};u.prototype.parseJoints=function(b,c){for(var e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":var f=(new P).parse(f),h=c[f.source];if(f.semantic=="JOINT")this.joints=
-h.read();else if(f.semantic=="INV_BIND_MATRIX")this.invBindMatrices=h.read()}}};u.prototype.parseWeights=function(b,c){for(var e,f,h=[],k=0;k<b.childNodes.length;k++){var m=b.childNodes[k];if(m.nodeType==1)switch(m.nodeName){case "input":h.push((new P).parse(m));break;case "v":e=aa(m.textContent);break;case "vcount":f=aa(m.textContent)}}for(k=m=0;k<f.length;k++){for(var n=f[k],o=[],p=0;p<n;p++){for(var t={},u=0;u<h.length;u++){var v=h[u],w=e[m+v.offset];switch(v.semantic){case "JOINT":t.joint=w;break;
-case "WEIGHT":t.weight=c[v.source].data[w]}}o.push(t);m+=h.length}for(p=0;p<o.length;p++)o[p].index=k;this.weights.push(o)}};p.prototype.getChildById=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};p.prototype.getChildBySid=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};p.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");
-this.nodes=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "node":this.nodes.push((new v).parse(e))}}return this};v.prototype.getChannelForTransform=function(b){for(var c=0;c<this.channels.length;c++){var e=this.channels[c],f=e.target.split("/");f.shift();var h=f.shift(),k=h.indexOf(".")>=0,m=h.indexOf("(")>=0,n;if(k)f=h.split("."),h=f.shift(),f.shift();else if(m){n=h.split("(");h=n.shift();for(f=0;f<n.length;f++)n[f]=parseInt(n[f].replace(/\)/,
-""))}if(h==b)return e.info={sid:h,dotSyntax:k,arrSyntax:m,arrIndices:n},e}return null};v.prototype.getChildById=function(b,c){if(this.id==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};v.prototype.getChildBySid=function(b,c){if(this.sid==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};v.prototype.getTransformBySid=function(b){for(var c=0;c<this.transforms.length;c++)if(this.transforms[c].sid==
-b)return this.transforms[c];return null};v.prototype.parse=function(b){var c;this.id=b.getAttribute("id");this.sid=b.getAttribute("sid");this.name=b.getAttribute("name");this.type=b.getAttribute("type");this.type=this.type=="JOINT"?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var e=0;e<b.childNodes.length;e++)if(c=b.childNodes[e],c.nodeType==1)switch(c.nodeName){case "node":this.nodes.push((new v).parse(c));break;case "instance_camera":break;
-case "instance_controller":this.controllers.push((new x).parse(c));break;case "instance_geometry":this.geometries.push((new y).parse(c));break;case "instance_light":break;case "instance_node":c=c.getAttribute("url").replace(/^#/,"");(c=da.evaluate(".//dae:library_nodes//dae:node[@id='"+c+"']",da,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new v).parse(c));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new t).parse(c));
+function(b){for(var c=[],e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":c.push((new P).parse(f))}}return c};p.prototype.parse=function(b){var c={},e,f;this.source=b.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var h=0;h<b.childNodes.length;h++){var k=b.childNodes[h];if(k.nodeType==1)switch(k.nodeName){case "bind_shape_matrix":k=la(k.textContent);this.bindShapeMatrix=new THREE.Matrix4;this.bindShapeMatrix.set(k[0],
+k[1],k[2],k[3],k[4],k[5],k[6],k[7],k[8],k[9],k[10],k[11],k[12],k[13],k[14],k[15]);break;case "source":k=(new S).parse(k);c[k.id]=k;break;case "joints":e=k;break;case "vertex_weights":f=k;break;default:console.log(k.nodeName)}}this.parseJoints(e,c);this.parseWeights(f,c);return this};p.prototype.parseJoints=function(b,c){for(var e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":var f=(new P).parse(f),h=c[f.source];if(f.semantic=="JOINT")this.joints=
+h.read();else if(f.semantic=="INV_BIND_MATRIX")this.invBindMatrices=h.read()}}};p.prototype.parseWeights=function(b,c){for(var e,f,h=[],k=0;k<b.childNodes.length;k++){var m=b.childNodes[k];if(m.nodeType==1)switch(m.nodeName){case "input":h.push((new P).parse(m));break;case "v":e=aa(m.textContent);break;case "vcount":f=aa(m.textContent)}}for(k=m=0;k<f.length;k++){for(var n=f[k],o=[],p=0;p<n;p++){for(var t={},v=0;v<h.length;v++){var w=h[v],u=e[m+w.offset];switch(w.semantic){case "JOINT":t.joint=u;break;
+case "WEIGHT":t.weight=c[w.source].data[u]}}o.push(t);m+=h.length}for(p=0;p<o.length;p++)o[p].index=k;this.weights.push(o)}};t.prototype.getChildById=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};t.prototype.getChildBySid=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};t.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");
+this.nodes=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "node":this.nodes.push((new u).parse(e))}}return this};u.prototype.getChannelForTransform=function(b){for(var c=0;c<this.channels.length;c++){var e=this.channels[c],f=e.target.split("/");f.shift();var h=f.shift(),k=h.indexOf(".")>=0,m=h.indexOf("(")>=0,n;if(k)f=h.split("."),h=f.shift(),f.shift();else if(m){n=h.split("(");h=n.shift();for(f=0;f<n.length;f++)n[f]=parseInt(n[f].replace(/\)/,
+""))}if(h==b)return e.info={sid:h,dotSyntax:k,arrSyntax:m,arrIndices:n},e}return null};u.prototype.getChildById=function(b,c){if(this.id==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};u.prototype.getChildBySid=function(b,c){if(this.sid==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};u.prototype.getTransformBySid=function(b){for(var c=0;c<this.transforms.length;c++)if(this.transforms[c].sid==
+b)return this.transforms[c];return null};u.prototype.parse=function(b){var c;this.id=b.getAttribute("id");this.sid=b.getAttribute("sid");this.name=b.getAttribute("name");this.type=b.getAttribute("type");this.type=this.type=="JOINT"?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var e=0;e<b.childNodes.length;e++)if(c=b.childNodes[e],c.nodeType==1)switch(c.nodeName){case "node":this.nodes.push((new u).parse(c));break;case "instance_camera":break;
+case "instance_controller":this.controllers.push((new x).parse(c));break;case "instance_geometry":this.geometries.push((new y).parse(c));break;case "instance_light":break;case "instance_node":c=c.getAttribute("url").replace(/^#/,"");(c=da.evaluate(".//dae:library_nodes//dae:node[@id='"+c+"']",da,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new u).parse(c));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new w).parse(c));
 break;case "extra":break;default:console.log(c.nodeName)}b=[];e=1E6;c=-1E6;for(var f in ma)for(var h=ma[f],k=0;k<h.channel.length;k++){var m=h.channel[k],n=h.sampler[k];f=m.target.split("/")[0];if(f==this.id)n.create(),m.sampler=n,e=Math.min(e,n.startTime),c=Math.max(c,n.endTime),b.push(m)}if(b.length)this.startTime=e,this.endTime=c;if((this.channels=b)&&this.channels.length){f=1E7;for(i=0;i<this.channels.length;i++){b=this.channels[i].sampler;for(e=0;e<b.input.length-1;e++)f=Math.min(f,b.input[e+
-1]-b.input[e])}e=[];for(b=this.startTime;b<this.endTime;b+=f){c=b;for(var h={},o=k=void 0,k=0;k<this.channels.length;k++)o=this.channels[k],h[o.sid]=o;m=new THREE.Matrix4;for(k=0;k<this.transforms.length;k++)if(n=this.transforms[k],o=h[n.sid],o!==void 0){for(var p=o.sampler,u,o=0;o<p.input.length-1;o++)if(p.input[o+1]>c){u=p.output[o];break}m=u!==void 0?u instanceof THREE.Matrix4?m.multiply(m,u):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,
-c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};v.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b<this.transforms.length;b++)this.matrix.multiply(this.matrix,this.transforms[b].matrix)};t.prototype.parse=function(b){this.sid=b.getAttribute("sid");this.type=b.nodeName;this.data=la(b.textContent);this.updateMatrix();return this};t.prototype.updateMatrix=function(){var b=0;this.matrix.identity();switch(this.type){case "matrix":this.matrix.set(this.data[0],
+1]-b.input[e])}e=[];for(b=this.startTime;b<this.endTime;b+=f){c=b;for(var h={},o=k=void 0,k=0;k<this.channels.length;k++)o=this.channels[k],h[o.sid]=o;m=new THREE.Matrix4;for(k=0;k<this.transforms.length;k++)if(n=this.transforms[k],o=h[n.sid],o!==void 0){for(var p=o.sampler,t,o=0;o<p.input.length-1;o++)if(p.input[o+1]>c){t=p.output[o];break}m=t!==void 0?t instanceof THREE.Matrix4?m.multiply(m,t):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,
+c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};u.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b<this.transforms.length;b++)this.matrix.multiply(this.matrix,this.transforms[b].matrix)};w.prototype.parse=function(b){this.sid=b.getAttribute("sid");this.type=b.nodeName;this.data=la(b.textContent);this.updateMatrix();return this};w.prototype.updateMatrix=function(){var b=0;this.matrix.identity();switch(this.type){case "matrix":this.matrix.set(this.data[0],
 this.data[1],this.data[2],this.data[3],this.data[4],this.data[5],this.data[6],this.data[7],this.data[8],this.data[9],this.data[10],this.data[11],this.data[12],this.data[13],this.data[14],this.data[15]);break;case "translate":this.matrix.setTranslation(this.data[0],this.data[1],this.data[2]);break;case "rotate":b=this.data[3]*(Math.PI/180);this.matrix.setRotationAxis(new THREE.Vector3(this.data[0],this.data[1],this.data[2]),b);break;case "scale":this.matrix.setScale(this.data[0],this.data[1],this.data[2])}return this.matrix};
-x.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "skeleton":this.skeleton.push(e.textContent.replace(/^#/,""));break;case "bind_material":if(e=da.evaluate(".//dae:instance_material",e,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(var f=e.iterateNext();f;)this.instance_material.push((new w).parse(f)),f=e.iterateNext()}}return this};
-w.prototype.parse=function(b){this.symbol=b.getAttribute("symbol");this.target=b.getAttribute("target").replace(/^#/,"");return this};y.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1&&e.nodeName=="bind_material"){if(b=da.evaluate(".//dae:instance_material",e,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(c=b.iterateNext();c;)this.instance_material.push((new w).parse(c)),
+x.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "skeleton":this.skeleton.push(e.textContent.replace(/^#/,""));break;case "bind_material":if(e=da.evaluate(".//dae:instance_material",e,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(var f=e.iterateNext();f;)this.instance_material.push((new v).parse(f)),f=e.iterateNext()}}return this};
+v.prototype.parse=function(b){this.symbol=b.getAttribute("symbol");this.target=b.getAttribute("target").replace(/^#/,"");return this};y.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1&&e.nodeName=="bind_material"){if(b=da.evaluate(".//dae:instance_material",e,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(c=b.iterateNext();c;)this.instance_material.push((new v).parse(c)),
 c=b.iterateNext();break}}return this};z.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "mesh":this.mesh=(new C(this)).parse(e)}}return this};C.prototype.parse=function(b){function c(b,e){var f=fa(b.position);h[f]===void 0&&(h[f]={v:b,index:e});return h[f]}this.primitives=[];var e;for(e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];switch(f.nodeName){case "source":ea(f);break;case "vertices":this.vertices=
 (new J).parse(f);break;case "triangles":this.primitives.push((new F).parse(f));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new A).parse(f))}}var h={};this.geometry3js=new THREE.Geometry;f=ka[this.vertices.input.POSITION.source].data;for(b=e=0;e<f.length;e+=3,b++){var k=new THREE.Vertex(new THREE.Vector3(f[e],f[e+1],f[e+2]));c(k,b);this.geometry3js.vertices.push(k)}for(e=0;e<this.primitives.length;e++)primitive=this.primitives[e],primitive.setVertices(this.vertices),
-this.handlePrimitive(primitive,this.geometry3js,h);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.computeVertexNormals();this.geometry3js.computeBoundingBox();return this};C.prototype.handlePrimitive=function(b,c,e){var f=0,h,k,m=b.p,n=b.inputs,o,p,t,u=0,v=3,w=[];for(h=0;h<n.length;h++)switch(o=n[h],o.semantic){case "TEXCOORD":w.push(o.set)}for(;f<m.length;){var x=[],y=[],z={},C=[];b.vcount&&(v=b.vcount[u++]);for(h=0;h<v;h++)for(k=0;k<n.length;k++)switch(o=
-n[k],source=ka[o.source],p=m[f+h*n.length+o.offset],numParams=source.accessor.params.length,t=p*numParams,o.semantic){case "VERTEX":o=fa(c.vertices[p].position);x.push(e[o].index);break;case "NORMAL":y.push(new THREE.Vector3(source.data[t],source.data[t+1],source.data[t+2]));break;case "TEXCOORD":z[o.set]===void 0&&(z[o.set]=[]);z[o.set].push(new THREE.UV(source.data[t],source.data[t+1]));break;case "COLOR":C.push((new THREE.Color).setRGB(source.data[t],source.data[t+1],source.data[t+2]))}var A;v==
-3?A=new THREE.Face3(x[0],x[1],x[2],[y[0],y[1],y[2]],C.length?C:new THREE.Color):v==4&&(A=new THREE.Face4(x[0],x[1],x[2],x[3],[y[0],y[1],y[2],y[3]],C.length?C:new THREE.Color));A.daeMaterial=b.material;c.faces.push(A);for(k=0;k<w.length;k++)h=z[w[k]],c.faceVertexUvs[k].push([h[0],h[1],h[2]]);f+=n.length*v}};A.prototype=new F;A.prototype.constructor=A;F.prototype.setVertices=function(b){for(var c=0;c<this.inputs.length;c++)if(this.inputs[c].source==b.id)this.inputs[c].source=b.input.POSITION.source};
+this.handlePrimitive(primitive,this.geometry3js,h);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.computeVertexNormals();this.geometry3js.computeBoundingBox();return this};C.prototype.handlePrimitive=function(b,c,e){var f=0,h,k,m=b.p,n=b.inputs,o,p,t,v=0,w=3,u=[];for(h=0;h<n.length;h++)switch(o=n[h],o.semantic){case "TEXCOORD":u.push(o.set)}for(;f<m.length;){var x=[],y=[],z={},C=[];b.vcount&&(w=b.vcount[v++]);for(h=0;h<w;h++)for(k=0;k<n.length;k++)switch(o=
+n[k],source=ka[o.source],p=m[f+h*n.length+o.offset],numParams=source.accessor.params.length,t=p*numParams,o.semantic){case "VERTEX":o=fa(c.vertices[p].position);x.push(e[o].index);break;case "NORMAL":y.push(new THREE.Vector3(source.data[t],source.data[t+1],source.data[t+2]));break;case "TEXCOORD":z[o.set]===void 0&&(z[o.set]=[]);z[o.set].push(new THREE.UV(source.data[t],source.data[t+1]));break;case "COLOR":C.push((new THREE.Color).setRGB(source.data[t],source.data[t+1],source.data[t+2]))}var A;w==
+3?A=new THREE.Face3(x[0],x[1],x[2],[y[0],y[1],y[2]],C.length?C:new THREE.Color):w==4&&(A=new THREE.Face4(x[0],x[1],x[2],x[3],[y[0],y[1],y[2],y[3]],C.length?C:new THREE.Color));A.daeMaterial=b.material;c.faces.push(A);for(k=0;k<u.length;k++)h=z[u[k]],c.faceVertexUvs[k].push([h[0],h[1],h[2]]);f+=n.length*w}};A.prototype=new F;A.prototype.constructor=A;F.prototype.setVertices=function(b){for(var c=0;c<this.inputs.length;c++)if(this.inputs[c].source==b.id)this.inputs[c].source=b.input.POSITION.source};
 F.prototype.parse=function(b){this.inputs=[];this.material=b.getAttribute("material");this.count=ca(b,"count",0);for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "input":this.inputs.push((new P).parse(b.childNodes[c]));break;case "vcount":this.vcount=aa(e.textContent);break;case "p":this.p=aa(e.textContent)}}return this};D.prototype.parse=function(b){this.params=[];this.source=b.getAttribute("source");this.count=ca(b,"count",0);this.stride=ca(b,"stride",0);for(var c=
 0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="param"){var f={};f.name=e.getAttribute("name");f.type=e.getAttribute("type");this.params.push(f)}}return this};J.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++)b.childNodes[c].nodeName=="input"&&(input=(new P).parse(b.childNodes[c]),this.input[input.semantic]=input);return this};P.prototype.parse=function(b){this.semantic=b.getAttribute("semantic");this.source=b.getAttribute("source").replace(/^#/,
 "");this.set=ca(b,"set",-1);this.offset=ca(b,"offset",0);if(this.semantic=="TEXCOORD"&&this.set<0)this.set=0;return this};S.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "bool_array":for(var f=ia(e.textContent),h=[],k=0;k<f.length;k++)h.push(f[k]=="true"||f[k]=="1"?!0:!1);this.data=h;this.type=e.nodeName;break;case "float_array":this.data=la(e.textContent);this.type=e.nodeName;break;case "int_array":this.data=
@@ -591,7 +595,7 @@ aa(e.textContent);this.type=e.nodeName;break;case "IDREF_array":case "Name_array
 this.data.slice(c,c+16),f=new THREE.Matrix4;f.set(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]);b.push(f)}break;default:console.log("Dae::Source:read dont know how to read "+c.type)}return b};I.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");for(var c=0;c<b.childNodes.length;c++)if(b.childNodes[c].nodeName=="instance_effect"){this.instance_effect=(new R).parse(b.childNodes[c]);break}return this};H.prototype.isColor=
 function(){return this.texture==null};H.prototype.isTexture=function(){return this.texture!=null};H.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "color":e=la(e.textContent);this.color=new THREE.Color(0);this.color.setRGB(e[0],e[1],e[2]);this.color.a=e[3];break;case "texture":this.texture=e.getAttribute("texture"),this.texcoord=e.getAttribute("texcoord")}}return this};G.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=
 b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[e.nodeName]=(new H).parse(e);break;case "shininess":case "reflectivity":case "transparency":var f;f=da.evaluate(".//dae:float",e,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var h=f.iterateNext(),k=[];h;)k.push(h),h=f.iterateNext();f=k;f.length>0&&(this[e.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};G.prototype.create=function(){var b=
-{},c=this.transparency!==void 0&&this.transparency<1,e;for(e in this)switch(e){case "ambient":case "emission":case "diffuse":case "specular":var f=this[e];if(f instanceof H)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=ta[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ea+f.init_from),b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else e=="diffuse"?b.color=
+{},c=this.transparency!==void 0&&this.transparency<1,e;for(e in this)switch(e){case "ambient":case "emission":case "diffuse":case "specular":var f=this[e];if(f instanceof H)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=ta[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Fa+f.init_from),b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else e=="diffuse"?b.color=
 f.color.getHex():c||(b[e]=f.color.getHex());break;case "shininess":case "reflectivity":b[e]=this[e];break;case "transparency":if(c)b.transparent=!0,b.opacity=this[e],c=!0}b.shading=Ga;return this.material=new THREE.MeshLambertMaterial(b)};Y.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "init_from":this.init_from=e.textContent;break;case "format":this.format=e.textContent;break;default:console.log("unhandled Surface prop: "+
 e.nodeName)}}return this};E.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "source":this.source=e.textContent;break;case "minfilter":this.minfilter=e.textContent;break;case "magfilter":this.magfilter=e.textContent;break;case "mipfilter":this.mipfilter=e.textContent;break;case "wrap_s":this.wrap_s=e.textContent;break;case "wrap_t":this.wrap_t=e.textContent;break;default:console.log("unhandled Sampler2D prop: "+e.nodeName)}}return this};
 Q.prototype.create=function(){if(this.shader==null)return null};Q.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.shader=null;for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(e))}}return this};Q.prototype.parseNewparam=function(b){for(var c=b.getAttribute("sid"),e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "surface":this.surface=
@@ -600,50 +604,52 @@ Q.prototype.parseTechnique=function(b){for(var c=0;c<b.childNodes.length;c++){va
 (new S).parse(e);this.source[e.id]=e;break;case "sampler":this.sampler.push((new o(this)).parse(e));break;case "channel":this.channel.push((new X(this)).parse(e))}}return this};X.prototype.parse=function(b){this.source=b.getAttribute("source").replace(/^#/,"");this.target=b.getAttribute("target");var c=this.target.split("/");c.shift();var b=c.shift(),e=b.indexOf(".")>=0,f=b.indexOf("(")>=0,h,k;if(e)c=b.split("."),b=c.shift(),k=c.shift();else if(f){h=b.split("(");b=h.shift();for(c=0;c<h.length;c++)h[c]=
 parseInt(h[c].replace(/\)/,""))}this.sid=b;this.dotSyntax=e;this.arrSyntax=f;this.arrIndices=h;this.member=k;return this};o.prototype.parse=function(b){this.id=b.getAttribute("id");this.inputs=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "input":this.inputs.push((new P).parse(e))}}return this};o.prototype.create=function(){for(var b=0;b<this.inputs.length;b++){var c=this.inputs[b],e=this.animation.source[c.source];switch(c.semantic){case "INPUT":this.input=
 e.read();break;case "OUTPUT":this.output=e.read();break;case "INTERPOLATION":this.interpolation=e.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(c.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(b=0;b<this.input.length;b++)this.startTime=Math.min(this.startTime,this.input[b]),this.endTime=Math.max(this.endTime,this.input[b]);this.duration=this.endTime-this.startTime}};return{load:function(e,f){if(document.implementation&&
-document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);e+="?rnd="+Math.random();var n=new XMLHttpRequest;n.overrideMimeType&&n.overrideMimeType("text/xml");n.onreadystatechange=function(){if(n.readyState==4&&(n.status==0||n.status==200)){ga=f;var o,t=e;da=n.responseXML;o=ga;t!==void 0&&(t=t.split("/"),t.pop(),Ea=t.join("/")+"/");ta=b("//dae:library_images/dae:image",m,"image");ra=b("//dae:library_materials/dae:material",
-I,"material");ua=b("//dae:library_effects/dae:effect",Q,"effect");qa=b("//dae:library_geometries/dae:geometry",z,"geometry");na=b("//dae:library_controllers/dae:controller",k,"controller");ma=b("//dae:library_animations/dae:animation",W,"animation");Ca=b(".//dae:library_visual_scenes/dae:visual_scene",p,"visual_scene");za=[];Ba=[];(t=da.evaluate(".//dae:scene/dae:instance_visual_scene",da,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(t=t.getAttribute("url").replace(/^#/,""),Z=Ca[t]):
-Z=null;U=new THREE.Object3D;for(t=0;t<Z.nodes.length;t++)U.add(h(Z.nodes[t]));c();for(var u in ma);u={scene:U,morphs:za,skins:Ba,dae:{images:ta,materials:ra,effects:ua,geometries:qa,controllers:na,animations:ma,visualScenes:Ca,scene:Z}};o&&o(u)}};n.open("GET",e,!0);n.send(null)}else alert("Don't know how to parse XML!")},setPreferredShading:function(b){Ga=b},applySkin:f,geometries:qa}};THREE.JSONLoader=function(b){THREE.Loader.call(this,b)};THREE.JSONLoader.prototype=new THREE.Loader;
-THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(b){var c=this,e=b.model,f=b.callback,h=b.texture_path?b.texture_path:this.extractUrlbase(e),b=new Worker(e);b.onmessage=function(b){c.createModel(b.data,f,h);c.onLoadComplete()};this.onLoadStart();b.postMessage((new Date).getTime())};
-THREE.JSONLoader.prototype.createModel=function(b,c,e){var f=new THREE.Geometry,h=b.scale!==void 0?1/b.scale:1;this.init_materials(f,b.materials,e);(function(c){if(b.version===void 0||b.version!=2)console.error("Deprecated file format.");else{var e,h,u,p,v,t,x,w,y,z,C,A,F,D,J=b.faces;t=b.vertices;var P=b.normals,S=b.colors,I=0;for(e=0;e<b.uvs.length;e++)b.uvs[e].length&&I++;for(e=0;e<I;e++)f.faceUvs[e]=[],f.faceVertexUvs[e]=[];p=0;for(v=t.length;p<v;)x=new THREE.Vertex,x.position.x=t[p++]*c,x.position.y=
-t[p++]*c,x.position.z=t[p++]*c,f.vertices.push(x);p=0;for(v=J.length;p<v;){c=J[p++];t=c&1;u=c&2;e=c&4;h=c&8;w=c&16;x=c&32;z=c&64;c&=128;t?(C=new THREE.Face4,C.a=J[p++],C.b=J[p++],C.c=J[p++],C.d=J[p++],t=4):(C=new THREE.Face3,C.a=J[p++],C.b=J[p++],C.c=J[p++],t=3);if(u)u=J[p++],C.materials=f.materials[u];u=f.faces.length;if(e)for(e=0;e<I;e++)A=b.uvs[e],y=J[p++],D=A[y*2],y=A[y*2+1],f.faceUvs[e][u]=new THREE.UV(D,y);if(h)for(e=0;e<I;e++){A=b.uvs[e];F=[];for(h=0;h<t;h++)y=J[p++],D=A[y*2],y=A[y*2+1],F[h]=
-new THREE.UV(D,y);f.faceVertexUvs[e][u]=F}if(w)w=J[p++]*3,h=new THREE.Vector3,h.x=P[w++],h.y=P[w++],h.z=P[w],C.normal=h;if(x)for(e=0;e<t;e++)w=J[p++]*3,h=new THREE.Vector3,h.x=P[w++],h.y=P[w++],h.z=P[w],C.vertexNormals.push(h);if(z)x=J[p++],x=new THREE.Color(S[x]),C.color=x;if(c)for(e=0;e<t;e++)x=J[p++],x=new THREE.Color(S[x]),C.vertexColors.push(x);f.faces.push(C)}}})(h);(function(){var c,e,h,u;if(b.skinWeights){c=0;for(e=b.skinWeights.length;c<e;c+=2)h=b.skinWeights[c],u=b.skinWeights[c+1],f.skinWeights.push(new THREE.Vector4(h,
-u,0,0))}if(b.skinIndices){c=0;for(e=b.skinIndices.length;c<e;c+=2)h=b.skinIndices[c],u=b.skinIndices[c+1],f.skinIndices.push(new THREE.Vector4(h,u,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var e,h,u,p,v,t,x,w,y;e=0;for(h=b.morphTargets.length;e<h;e++){f.morphTargets[e]={};f.morphTargets[e].name=b.morphTargets[e].name;f.morphTargets[e].vertices=[];w=f.morphTargets[e].vertices;y=b.morphTargets[e].vertices;u=0;for(p=y.length;u<p;u+=3)v=y[u]*c,t=y[u+1]*
-c,x=y[u+2]*c,w.push(new THREE.Vertex(new THREE.Vector3(v,t,x)))}}if(b.morphColors!==void 0){e=0;for(h=b.morphColors.length;e<h;e++){f.morphColors[e]={};f.morphColors[e].name=b.morphColors[e].name;f.morphColors[e].colors=[];p=f.morphColors[e].colors;v=b.morphColors[e].colors;c=0;for(u=v.length;c<u;c+=3)t=new THREE.Color(16755200),t.setRGB(v[c],v[c+1],v[c+2]),p.push(t)}}})(h);f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};
+document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);e+="?rnd="+Math.random();var n=new XMLHttpRequest;n.overrideMimeType&&n.overrideMimeType("text/xml");n.onreadystatechange=function(){if(n.readyState==4&&(n.status==0||n.status==200)){ga=f;var o,p=e;da=n.responseXML;o=ga;p!==void 0&&(p=p.split("/"),p.pop(),Fa=p.join("/")+"/");ta=b("//dae:library_images/dae:image",m,"image");ra=b("//dae:library_materials/dae:material",
+I,"material");ua=b("//dae:library_effects/dae:effect",Q,"effect");qa=b("//dae:library_geometries/dae:geometry",z,"geometry");na=b("//dae:library_controllers/dae:controller",h,"controller");ma=b("//dae:library_animations/dae:animation",W,"animation");Da=b(".//dae:library_visual_scenes/dae:visual_scene",t,"visual_scene");za=[];Ba=[];(p=da.evaluate(".//dae:scene/dae:instance_visual_scene",da,V,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(p=p.getAttribute("url").replace(/^#/,""),Z=Da[p]):
+Z=null;U=new THREE.Object3D;for(p=0;p<Z.nodes.length;p++)U.add(k(Z.nodes[p]));c();for(var v in ma);v={scene:U,morphs:za,skins:Ba,dae:{images:ta,materials:ra,effects:ua,geometries:qa,controllers:na,animations:ma,visualScenes:Da,scene:Z}};o&&o(v)}};n.open("GET",e,!0);n.send(null)}else alert("Don't know how to parse XML!")},setPreferredShading:function(b){Ga=b},applySkin:f,geometries:qa}};THREE.JSONLoader=function(b){THREE.Loader.call(this,b)};THREE.JSONLoader.prototype=new THREE.Loader;
+THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(b){var c=this,e=b.model,f=b.callback,k=b.texture_path?b.texture_path:this.extractUrlbase(e),b=new Worker(e);b.onmessage=function(b){c.createModel(b.data,f,k);c.onLoadComplete()};this.onLoadStart();b.postMessage((new Date).getTime())};
+THREE.JSONLoader.prototype.createModel=function(b,c,e){var f=new THREE.Geometry,k=b.scale!==void 0?1/b.scale:1;this.init_materials(f,b.materials,e);(function(c){if(b.version===void 0||b.version!=2)console.error("Deprecated file format.");else{var e,k,p,t,u,w,x,v,y,z,C,A,F,D,J=b.faces;w=b.vertices;var P=b.normals,S=b.colors,I=0;for(e=0;e<b.uvs.length;e++)b.uvs[e].length&&I++;for(e=0;e<I;e++)f.faceUvs[e]=[],f.faceVertexUvs[e]=[];t=0;for(u=w.length;t<u;)x=new THREE.Vertex,x.position.x=w[t++]*c,x.position.y=
+w[t++]*c,x.position.z=w[t++]*c,f.vertices.push(x);t=0;for(u=J.length;t<u;){c=J[t++];w=c&1;p=c&2;e=c&4;k=c&8;v=c&16;x=c&32;z=c&64;c&=128;w?(C=new THREE.Face4,C.a=J[t++],C.b=J[t++],C.c=J[t++],C.d=J[t++],w=4):(C=new THREE.Face3,C.a=J[t++],C.b=J[t++],C.c=J[t++],w=3);if(p)p=J[t++],C.materials=f.materials[p];p=f.faces.length;if(e)for(e=0;e<I;e++)A=b.uvs[e],y=J[t++],D=A[y*2],y=A[y*2+1],f.faceUvs[e][p]=new THREE.UV(D,y);if(k)for(e=0;e<I;e++){A=b.uvs[e];F=[];for(k=0;k<w;k++)y=J[t++],D=A[y*2],y=A[y*2+1],F[k]=
+new THREE.UV(D,y);f.faceVertexUvs[e][p]=F}if(v)v=J[t++]*3,k=new THREE.Vector3,k.x=P[v++],k.y=P[v++],k.z=P[v],C.normal=k;if(x)for(e=0;e<w;e++)v=J[t++]*3,k=new THREE.Vector3,k.x=P[v++],k.y=P[v++],k.z=P[v],C.vertexNormals.push(k);if(z)x=J[t++],x=new THREE.Color(S[x]),C.color=x;if(c)for(e=0;e<w;e++)x=J[t++],x=new THREE.Color(S[x]),C.vertexColors.push(x);f.faces.push(C)}}})(k);(function(){var c,e,k,p;if(b.skinWeights){c=0;for(e=b.skinWeights.length;c<e;c+=2)k=b.skinWeights[c],p=b.skinWeights[c+1],f.skinWeights.push(new THREE.Vector4(k,
+p,0,0))}if(b.skinIndices){c=0;for(e=b.skinIndices.length;c<e;c+=2)k=b.skinIndices[c],p=b.skinIndices[c+1],f.skinIndices.push(new THREE.Vector4(k,p,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var e,k,p,t,u,w,x,v,y;e=0;for(k=b.morphTargets.length;e<k;e++){f.morphTargets[e]={};f.morphTargets[e].name=b.morphTargets[e].name;f.morphTargets[e].vertices=[];v=f.morphTargets[e].vertices;y=b.morphTargets[e].vertices;p=0;for(t=y.length;p<t;p+=3)u=y[p]*c,w=y[p+1]*
+c,x=y[p+2]*c,v.push(new THREE.Vertex(new THREE.Vector3(u,w,x)))}}if(b.morphColors!==void 0){e=0;for(k=b.morphColors.length;e<k;e++){f.morphColors[e]={};f.morphColors[e].name=b.morphColors[e].name;f.morphColors[e].colors=[];t=f.morphColors[e].colors;u=b.morphColors[e].colors;c=0;for(p=u.length;c<p;c+=3)w=new THREE.Color(16755200),w.setRGB(u[c],u[c+1],u[c+2]),t.push(w)}}})(k);f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();c(f)};
 THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
-THREE.SceneLoader.prototype={load:function(b,c){var e=this,f=new Worker(b);f.postMessage(0);var h=THREE.Loader.prototype.extractUrlbase(b);f.onmessage=function(b){function f(b,c){return c=="relativeToHTML"?b:h+"/"+b}function n(){for(w in Q.objects)if(!V.objects[w])if(F=Q.objects[w],F.geometry!==void 0){if(S=V.geometries[F.geometry]){var b=!1;Y=[];for(aa=0;aa<F.materials.length;aa++)Y[aa]=V.materials[F.materials[aa]],b=Y[aa]instanceof THREE.ShaderMaterial;b&&S.computeTangents();D=F.position;r=F.rotation;
-q=F.quaternion;s=F.scale;q=0;Y.length==0&&(Y[0]=new THREE.MeshFaceMaterial);Y.length>1&&(Y=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(S,Y);object.name=w;object.position.set(D[0],D[1],D[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;V.scene.add(object);V.objects[w]=object;F.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),V.scene.collisions.colliders.push(b));
-if(F.castsShadow)b=new THREE.ShadowVolume(S),V.scene.add(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},V.triggers[object.name]=b)}}else D=F.position,r=F.rotation,q=F.quaternion,s=F.scale,q=0,object=new THREE.Object3D,object.name=w,object.position.set(D[0],D[1],D[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,V.scene.add(object),V.objects[w]=object,V.empties[w]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}function u(b){return function(c){V.geometries[b]=c;n();W-=1;e.onLoadComplete();v()}}function p(b){return function(c){V.geometries[b]=c}}function v(){e.callbackProgress({totalModels:o,totalTextures:ea,loadedModels:o-W,loadedTextures:ea-X},V);e.onLoadProgress();W==0&&X==0&&c(V)}var t,
-x,w,y,z,C,A,F,D,J,P,S,I,H,G,Y,E,Q,R,W,X,o,ea,V;Q=b.data;G=new THREE.BinaryLoader;R=new THREE.JSONLoader;X=W=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(w in Q.objects)if(F=Q.objects[w],F.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(Q.transform){b=Q.transform.position;J=Q.transform.rotation;var la=Q.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);J&&V.scene.rotation.set(J[0],
-J[1],J[2]);la&&V.scene.scale.set(la[0],la[1],la[2]);(b||J||la)&&V.scene.updateMatrix()}b=function(){X-=1;v();e.onLoadComplete()};for(z in Q.cameras){J=Q.cameras[z];if(J.type=="perspective")I=new THREE.Camera(J.fov,J.aspect,J.near,J.far),I.useTarget=!0;else if(J.type=="ortho")I=new THREE.Camera,I.useTarget=!0,I.projectionMatrix=THREE.Matrix4.makeOrtho(J.left,J.right,J.top,J.bottom,J.near,J.far);D=J.position;J=J.target;I.position.set(D[0],D[1],D[2]);I.target.position.set(J[0],J[1],J[2]);V.cameras[z]=
+THREE.SceneLoader.prototype={load:function(b,c){var e=this,f=new Worker(b);f.postMessage(0);var k=THREE.Loader.prototype.extractUrlbase(b);f.onmessage=function(b){function f(b,c){return c=="relativeToHTML"?b:k+"/"+b}function n(){for(v in Q.objects)if(!V.objects[v])if(F=Q.objects[v],F.geometry!==void 0){if(S=V.geometries[F.geometry]){var b=!1;Y=[];for(aa=0;aa<F.materials.length;aa++)Y[aa]=V.materials[F.materials[aa]],b=Y[aa]instanceof THREE.ShaderMaterial;b&&S.computeTangents();D=F.position;r=F.rotation;
+q=F.quaternion;s=F.scale;q=0;Y.length==0&&(Y[0]=new THREE.MeshFaceMaterial);Y.length>1&&(Y=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(S,Y);object.name=v;object.position.set(D[0],D[1],D[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;V.scene.add(object);V.objects[v]=object;F.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),V.scene.collisions.colliders.push(b));
+if(F.castsShadow)b=new THREE.ShadowVolume(S),V.scene.add(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},V.triggers[object.name]=b)}}else D=F.position,r=F.rotation,q=F.quaternion,s=F.scale,q=0,object=new THREE.Object3D,object.name=v,object.position.set(D[0],D[1],D[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,V.scene.add(object),V.objects[v]=object,V.empties[v]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}function p(b){return function(c){V.geometries[b]=c;n();W-=1;e.onLoadComplete();u()}}function t(b){return function(c){V.geometries[b]=c}}function u(){e.callbackProgress({totalModels:o,totalTextures:ea,loadedModels:o-W,loadedTextures:ea-X},V);e.onLoadProgress();W==0&&X==0&&c(V)}var w,
+x,v,y,z,C,A,F,D,J,P,S,I,H,G,Y,E,Q,R,W,X,o,ea,V;Q=b.data;G=new THREE.BinaryLoader;R=new THREE.JSONLoader;X=W=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in Q.objects)if(F=Q.objects[v],F.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(Q.transform){b=Q.transform.position;J=Q.transform.rotation;var la=Q.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);J&&V.scene.rotation.set(J[0],
+J[1],J[2]);la&&V.scene.scale.set(la[0],la[1],la[2]);(b||J||la)&&V.scene.updateMatrix()}b=function(){X-=1;u();e.onLoadComplete()};for(z in Q.cameras){J=Q.cameras[z];if(J.type=="perspective")I=new THREE.Camera(J.fov,J.aspect,J.near,J.far),I.useTarget=!0;else if(J.type=="ortho")I=new THREE.Camera,I.useTarget=!0,I.projectionMatrix=THREE.Matrix4.makeOrtho(J.left,J.right,J.top,J.bottom,J.near,J.far);D=J.position;J=J.target;I.position.set(D[0],D[1],D[2]);I.target.position.set(J[0],J[1],J[2]);V.cameras[z]=
 I}for(y in Q.lights)z=Q.lights[y],I=z.color!==void 0?z.color:16777215,J=z.intensity!==void 0?z.intensity:1,z.type=="directional"?(D=z.direction,E=new THREE.DirectionalLight(I,J),E.position.set(D[0],D[1],D[2]),E.position.normalize()):z.type=="point"?(D=z.position,d=z.distance,E=new THREE.PointLight(I,J,d),E.position.set(D[0],D[1],D[2])):z.type=="ambient"&&(E=new THREE.AmbientLight(I)),V.scene.add(E),V.lights[y]=E;for(C in Q.fogs)y=Q.fogs[C],y.type=="linear"?H=new THREE.Fog(0,y.near,y.far):y.type==
-"exp2"&&(H=new THREE.FogExp2(0,y.density)),J=y.color,H.color.setRGB(J[0],J[1],J[2]),V.fogs[C]=H;if(V.cameras&&Q.defaults.camera)V.currentCamera=V.cameras[Q.defaults.camera];if(V.fogs&&Q.defaults.fog)V.scene.fog=V.fogs[Q.defaults.fog];J=Q.defaults.bgcolor;V.bgColor=new THREE.Color;V.bgColor.setRGB(J[0],J[1],J[2]);V.bgColorAlpha=Q.defaults.bgalpha;for(t in Q.geometries)if(C=Q.geometries[t],C.type=="bin_mesh"||C.type=="ascii_mesh")W+=1,e.onLoadStart();o=W;for(t in Q.geometries)C=Q.geometries[t],C.type==
-"cube"?(S=new THREE.CubeGeometry(C.width,C.height,C.depth,C.segmentsWidth,C.segmentsHeight,C.segmentsDepth,null,C.flipped,C.sides),V.geometries[t]=S):C.type=="plane"?(S=new THREE.PlaneGeometry(C.width,C.height,C.segmentsWidth,C.segmentsHeight),V.geometries[t]=S):C.type=="sphere"?(S=new THREE.SphereGeometry(C.radius,C.segmentsWidth,C.segmentsHeight),V.geometries[t]=S):C.type=="cylinder"?(S=new THREE.CylinderGeometry(C.topRad,C.botRad,C.height,C.radSegs,C.heightSegs),V.geometries[t]=S):C.type=="torus"?
-(S=new THREE.TorusGeometry(C.radius,C.tube,C.segmentsR,C.segmentsT),V.geometries[t]=S):C.type=="icosahedron"?(S=new THREE.IcosahedronGeometry(C.subdivisions),V.geometries[t]=S):C.type=="bin_mesh"?G.load({model:f(C.url,Q.urlBaseType),callback:u(t)}):C.type=="ascii_mesh"?R.load({model:f(C.url,Q.urlBaseType),callback:u(t)}):C.type=="embedded_mesh"&&(C=Q.embeds[C.id])&&R.createModel(C,p(t),"");for(A in Q.textures)if(t=Q.textures[A],t.url instanceof Array){X+=t.url.length;for(G=0;G<t.url.length;G++)e.onLoadStart()}else X+=
-1,e.onLoadStart();ea=X;for(A in Q.textures){t=Q.textures[A];if(t.mapping!=void 0&&THREE[t.mapping]!=void 0)t.mapping=new THREE[t.mapping];if(t.url instanceof Array){G=[];for(var aa=0;aa<t.url.length;aa++)G[aa]=f(t.url[aa],Q.urlBaseType);G=THREE.ImageUtils.loadTextureCube(G,t.mapping,b)}else{G=THREE.ImageUtils.loadTexture(f(t.url,Q.urlBaseType),t.mapping,b);if(THREE[t.minFilter]!=void 0)G.minFilter=THREE[t.minFilter];if(THREE[t.magFilter]!=void 0)G.magFilter=THREE[t.magFilter];if(t.repeat){G.repeat.set(t.repeat[0],
-t.repeat[1]);if(t.repeat[0]!=1)G.wrapS=THREE.RepeatWrapping;if(t.repeat[1]!=1)G.wrapT=THREE.RepeatWrapping}t.offset&&G.offset.set(t.offset[0],t.offset[1]);if(t.wrap){R={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(R[t.wrap[0]]!==void 0)G.wrapS=R[t.wrap[0]];if(R[t.wrap[1]]!==void 0)G.wrapT=R[t.wrap[1]]}}V.textures[A]=G}for(x in Q.materials){A=Q.materials[x];for(P in A.parameters)if(P=="envMap"||P=="map"||P=="lightMap")A.parameters[P]=V.textures[A.parameters[P]];else if(P=="shading")A.parameters[P]=
+"exp2"&&(H=new THREE.FogExp2(0,y.density)),J=y.color,H.color.setRGB(J[0],J[1],J[2]),V.fogs[C]=H;if(V.cameras&&Q.defaults.camera)V.currentCamera=V.cameras[Q.defaults.camera];if(V.fogs&&Q.defaults.fog)V.scene.fog=V.fogs[Q.defaults.fog];J=Q.defaults.bgcolor;V.bgColor=new THREE.Color;V.bgColor.setRGB(J[0],J[1],J[2]);V.bgColorAlpha=Q.defaults.bgalpha;for(w in Q.geometries)if(C=Q.geometries[w],C.type=="bin_mesh"||C.type=="ascii_mesh")W+=1,e.onLoadStart();o=W;for(w in Q.geometries)C=Q.geometries[w],C.type==
+"cube"?(S=new THREE.CubeGeometry(C.width,C.height,C.depth,C.segmentsWidth,C.segmentsHeight,C.segmentsDepth,null,C.flipped,C.sides),V.geometries[w]=S):C.type=="plane"?(S=new THREE.PlaneGeometry(C.width,C.height,C.segmentsWidth,C.segmentsHeight),V.geometries[w]=S):C.type=="sphere"?(S=new THREE.SphereGeometry(C.radius,C.segmentsWidth,C.segmentsHeight),V.geometries[w]=S):C.type=="cylinder"?(S=new THREE.CylinderGeometry(C.topRad,C.botRad,C.height,C.radSegs,C.heightSegs),V.geometries[w]=S):C.type=="torus"?
+(S=new THREE.TorusGeometry(C.radius,C.tube,C.segmentsR,C.segmentsT),V.geometries[w]=S):C.type=="icosahedron"?(S=new THREE.IcosahedronGeometry(C.subdivisions),V.geometries[w]=S):C.type=="bin_mesh"?G.load({model:f(C.url,Q.urlBaseType),callback:p(w)}):C.type=="ascii_mesh"?R.load({model:f(C.url,Q.urlBaseType),callback:p(w)}):C.type=="embedded_mesh"&&(C=Q.embeds[C.id])&&R.createModel(C,t(w),"");for(A in Q.textures)if(w=Q.textures[A],w.url instanceof Array){X+=w.url.length;for(G=0;G<w.url.length;G++)e.onLoadStart()}else X+=
+1,e.onLoadStart();ea=X;for(A in Q.textures){w=Q.textures[A];if(w.mapping!=void 0&&THREE[w.mapping]!=void 0)w.mapping=new THREE[w.mapping];if(w.url instanceof Array){G=[];for(var aa=0;aa<w.url.length;aa++)G[aa]=f(w.url[aa],Q.urlBaseType);G=THREE.ImageUtils.loadTextureCube(G,w.mapping,b)}else{G=THREE.ImageUtils.loadTexture(f(w.url,Q.urlBaseType),w.mapping,b);if(THREE[w.minFilter]!=void 0)G.minFilter=THREE[w.minFilter];if(THREE[w.magFilter]!=void 0)G.magFilter=THREE[w.magFilter];if(w.repeat){G.repeat.set(w.repeat[0],
+w.repeat[1]);if(w.repeat[0]!=1)G.wrapS=THREE.RepeatWrapping;if(w.repeat[1]!=1)G.wrapT=THREE.RepeatWrapping}w.offset&&G.offset.set(w.offset[0],w.offset[1]);if(w.wrap){R={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(R[w.wrap[0]]!==void 0)G.wrapS=R[w.wrap[0]];if(R[w.wrap[1]]!==void 0)G.wrapT=R[w.wrap[1]]}}V.textures[A]=G}for(x in Q.materials){A=Q.materials[x];for(P in A.parameters)if(P=="envMap"||P=="map"||P=="lightMap")A.parameters[P]=V.textures[A.parameters[P]];else if(P=="shading")A.parameters[P]=
 A.parameters[P]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(P=="blending")A.parameters[P]=THREE[A.parameters[P]]?THREE[A.parameters[P]]:THREE.NormalBlending;else if(P=="combine")A.parameters[P]=A.parameters[P]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(P=="vertexColors")if(A.parameters[P]=="face")A.parameters[P]=THREE.FaceColors;else if(A.parameters[P])A.parameters[P]=THREE.VertexColors;if(A.parameters.opacity!==void 0&&A.parameters.opacity<1)A.parameters.transparent=
-!0;if(A.parameters.normalMap){t=THREE.ShaderUtils.lib.normal;b=THREE.UniformsUtils.clone(t.uniforms);G=A.parameters.color;R=A.parameters.specular;C=A.parameters.ambient;H=A.parameters.shininess;b.tNormal.texture=V.textures[A.parameters.normalMap];if(A.parameters.normalMapFactor)b.uNormalScale.value=A.parameters.normalMapFactor;if(A.parameters.map)b.tDiffuse.texture=A.parameters.map,b.enableDiffuse.value=!0;if(A.parameters.lightMap)b.tAO.texture=A.parameters.lightMap,b.enableAO.value=!0;if(A.parameters.specularMap)b.tSpecular.texture=
-V.textures[A.parameters.specularMap],b.enableSpecular.value=!0;b.uDiffuseColor.value.setHex(G);b.uSpecularColor.value.setHex(R);b.uAmbientColor.value.setHex(C);b.uShininess.value=H;if(A.parameters.opacity)b.uOpacity.value=A.parameters.opacity;A=new THREE.ShaderMaterial({fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:b,lights:!0,fog:!0})}else A=new THREE[A.type](A.parameters);V.materials[x]=A}n();e.callbackSync(V)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};
+!0;if(A.parameters.normalMap){w=THREE.ShaderUtils.lib.normal;b=THREE.UniformsUtils.clone(w.uniforms);G=A.parameters.color;R=A.parameters.specular;C=A.parameters.ambient;H=A.parameters.shininess;b.tNormal.texture=V.textures[A.parameters.normalMap];if(A.parameters.normalMapFactor)b.uNormalScale.value=A.parameters.normalMapFactor;if(A.parameters.map)b.tDiffuse.texture=A.parameters.map,b.enableDiffuse.value=!0;if(A.parameters.lightMap)b.tAO.texture=A.parameters.lightMap,b.enableAO.value=!0;if(A.parameters.specularMap)b.tSpecular.texture=
+V.textures[A.parameters.specularMap],b.enableSpecular.value=!0;b.uDiffuseColor.value.setHex(G);b.uSpecularColor.value.setHex(R);b.uAmbientColor.value.setHex(C);b.uShininess.value=H;if(A.parameters.opacity)b.uOpacity.value=A.parameters.opacity;A=new THREE.ShaderMaterial({fragmentShader:w.fragmentShader,vertexShader:w.vertexShader,uniforms:b,lights:!0,fog:!0})}else A=new THREE[A.type](A.parameters);V.materials[x]=A}n();e.callbackSync(V)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};
 THREE.UTF8Loader.prototype=new THREE.UTF8Loader;THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
-THREE.UTF8Loader.prototype.load=function(b){var c=new XMLHttpRequest,e=b.model,f=b.callback,h=b.scale!==void 0?b.scale:1,m=b.offsetX!==void 0?b.offsetX:0,k=b.offsetY!==void 0?b.offsetY:0,n=b.offsetZ!==void 0?b.offsetZ:0;c.onreadystatechange=function(){c.readyState==4?c.status==200||c.status==0?THREE.UTF8Loader.prototype.createModel(c.responseText,f,h,m,k,n):alert("Couldn't load ["+e+"] ["+c.status+"]"):c.readyState!=3&&c.readyState==2&&c.getResponseHeader("Content-Length")};c.open("GET",e,!0);c.send(null)};
-THREE.UTF8Loader.prototype.decompressMesh=function(b){var c=b.charCodeAt(0);c>=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,h=0;h<8;h++){for(var m=0,k=0;k<c;++k){var n=b.charCodeAt(k+f);m+=n>>1^-(n&1);e[8*k+h]=m}f+=c}c=b.length-f;m=new Uint16Array(c);for(h=k=0;h<c;h++)n=b.charCodeAt(h+f),m[h]=k-n,n==0&&k++;return[e,m]};
-THREE.UTF8Loader.prototype.createModel=function(b,c,e,f,h,m){var k=function(){var c=this;c.materials=[];THREE.Geometry.call(this);var k=THREE.UTF8Loader.prototype.decompressMesh(b),p=[],v=[];(function(b,k,p){for(var u,v,C,A=b.length;p<A;p+=k)u=b[p],v=b[p+1],C=b[p+2],u=u/16383*e,v=v/16383*e,C=C/16383*e,u+=f,v+=h,C+=m,c.vertices.push(new THREE.Vertex(new THREE.Vector3(u,v,C)))})(k[0],8,0);(function(b,c,e){for(var f,h,k=b.length;e<k;e+=c)f=b[e],h=b[e+1],f/=1023,h/=1023,v.push(f,1-h)})(k[0],8,3);(function(b,
-c,e){for(var f,h,k,m=b.length;e<m;e+=c)f=b[e],h=b[e+1],k=b[e+2],f=(f-512)/511,h=(h-512)/511,k=(k-512)/511,p.push(f,h,k)})(k[0],8,5);(function(b){var e,f,h,k,m,u,F,D,J,P=b.length;for(e=0;e<P;e+=3){f=b[e];h=b[e+1];k=b[e+2];m=c;D=f;J=h;u=k;F=f;var S=h,I=k,H=m.materials[0],G=p[S*3],Y=p[S*3+1],S=p[S*3+2],E=p[I*3],Q=p[I*3+1],I=p[I*3+2];F=new THREE.Vector3(p[F*3],p[F*3+1],p[F*3+2]);S=new THREE.Vector3(G,Y,S);I=new THREE.Vector3(E,Q,I);m.faces.push(new THREE.Face3(D,J,u,[F,S,I],null,H));m=v[f*2];f=v[f*2+
-1];u=v[h*2];F=v[h*2+1];D=v[k*2];J=v[k*2+1];k=c.faceVertexUvs[0];h=u;u=F;F=[];F.push(new THREE.UV(m,f));F.push(new THREE.UV(h,u));F.push(new THREE.UV(D,J));k.push(F)}})(k[1]);this.computeCentroids();this.computeFaceNormals()};k.prototype=new THREE.Geometry;k.prototype.constructor=k;c(new k)};
+THREE.UTF8Loader.prototype.load=function(b){var c=new XMLHttpRequest,e=b.model,f=b.callback,k=b.scale!==void 0?b.scale:1,m=b.offsetX!==void 0?b.offsetX:0,h=b.offsetY!==void 0?b.offsetY:0,n=b.offsetZ!==void 0?b.offsetZ:0;c.onreadystatechange=function(){c.readyState==4?c.status==200||c.status==0?THREE.UTF8Loader.prototype.createModel(c.responseText,f,k,m,h,n):alert("Couldn't load ["+e+"] ["+c.status+"]"):c.readyState!=3&&c.readyState==2&&c.getResponseHeader("Content-Length")};c.open("GET",e,!0);c.send(null)};
+THREE.UTF8Loader.prototype.decompressMesh=function(b){var c=b.charCodeAt(0);c>=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,k=0;k<8;k++){for(var m=0,h=0;h<c;++h){var n=b.charCodeAt(h+f);m+=n>>1^-(n&1);e[8*h+k]=m}f+=c}c=b.length-f;m=new Uint16Array(c);for(k=h=0;k<c;k++)n=b.charCodeAt(k+f),m[k]=h-n,n==0&&h++;return[e,m]};
+THREE.UTF8Loader.prototype.createModel=function(b,c,e,f,k,m){var h=function(){var c=this;c.materials=[];THREE.Geometry.call(this);var h=THREE.UTF8Loader.prototype.decompressMesh(b),t=[],u=[];(function(b,h,p){for(var t,u,C,A=b.length;p<A;p+=h)t=b[p],u=b[p+1],C=b[p+2],t=t/16383*e,u=u/16383*e,C=C/16383*e,t+=f,u+=k,C+=m,c.vertices.push(new THREE.Vertex(new THREE.Vector3(t,u,C)))})(h[0],8,0);(function(b,c,e){for(var f,h,k=b.length;e<k;e+=c)f=b[e],h=b[e+1],f/=1023,h/=1023,u.push(f,1-h)})(h[0],8,3);(function(b,
+c,e){for(var f,h,k,m=b.length;e<m;e+=c)f=b[e],h=b[e+1],k=b[e+2],f=(f-512)/511,h=(h-512)/511,k=(k-512)/511,t.push(f,h,k)})(h[0],8,5);(function(b){var e,f,h,k,m,p,F,D,J,P=b.length;for(e=0;e<P;e+=3){f=b[e];h=b[e+1];k=b[e+2];m=c;D=f;J=h;p=k;F=f;var S=h,I=k,H=m.materials[0],G=t[S*3],Y=t[S*3+1],S=t[S*3+2],E=t[I*3],Q=t[I*3+1],I=t[I*3+2];F=new THREE.Vector3(t[F*3],t[F*3+1],t[F*3+2]);S=new THREE.Vector3(G,Y,S);I=new THREE.Vector3(E,Q,I);m.faces.push(new THREE.Face3(D,J,p,[F,S,I],null,H));m=u[f*2];f=u[f*2+
+1];p=u[h*2];F=u[h*2+1];D=u[k*2];J=u[k*2+1];k=c.faceVertexUvs[0];h=p;p=F;F=[];F.push(new THREE.UV(m,f));F.push(new THREE.UV(h,p));F.push(new THREE.UV(D,J));k.push(F)}})(h[1]);this.computeCentroids();this.computeFaceNormals()};h.prototype=new THREE.Geometry;h.prototype.constructor=h;c(new h)};
+THREE.Axes=function(){THREE.Object3D.call(this);var b=new THREE.Geometry;b.vertices.push(new THREE.Vertex);b.vertices.push(new THREE.Vertex(new THREE.Vector3(0,100,0)));var c=new THREE.CylinderGeometry(0,5,25,5,1),e=new THREE.Line(b,new THREE.LineBasicMaterial({color:16711680}));e.rotation.z=-Math.PI/2;this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:16711680}));e.position.x=100;e.rotation.z=-Math.PI/2;this.add(e);e=new THREE.Line(b,new THREE.LineBasicMaterial({color:65280}));this.add(e);
+e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:65280}));e.position.y=100;this.add(e);e=new THREE.Line(b,new THREE.LineBasicMaterial({color:255}));e.rotation.x=Math.PI/2;this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:255}));e.position.z=100;e.rotation.x=Math.PI/2;this.add(e)};THREE.Axes.prototype=new THREE.Object3D;THREE.Axes.prototype.constructor=THREE.Axes;
 THREE.MarchingCubes=function(b,c){THREE.Object3D.call(this);this.materials=c instanceof Array?c:[c];this.init=function(b){this.isolation=80;this.size=b;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(this.size3*3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=
-0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,c,h){return b+(c-b)*h};this.VIntX=function(b,c,h,m,k,n,u,p,v,t){k=(k-v)/(t-v);v=this.normal_cache;c[m]=n+k*this.delta;c[m+1]=u;c[m+2]=p;h[m]=this.lerp(v[b],v[b+3],k);h[m+1]=this.lerp(v[b+1],v[b+4],k);h[m+2]=this.lerp(v[b+2],v[b+5],k)};this.VIntY=function(b,c,h,m,k,n,u,p,v,t){k=(k-v)/(t-v);v=this.normal_cache;c[m]=n;c[m+1]=u+k*this.delta;c[m+
-2]=p;c=b+this.yd*3;h[m]=this.lerp(v[b],v[c],k);h[m+1]=this.lerp(v[b+1],v[c+1],k);h[m+2]=this.lerp(v[b+2],v[c+2],k)};this.VIntZ=function(b,c,h,m,k,n,u,p,v,t){k=(k-v)/(t-v);v=this.normal_cache;c[m]=n;c[m+1]=u;c[m+2]=p+k*this.delta;c=b+this.zd*3;h[m]=this.lerp(v[b],v[c],k);h[m+1]=this.lerp(v[b+1],v[c+1],k);h[m+2]=this.lerp(v[b+2],v[c+2],k)};this.compNorm=function(b){var c=b*3;this.normal_cache[c]==0&&(this.normal_cache[c]=this.field[b-1]-this.field[b+1],this.normal_cache[c+1]=this.field[b-this.yd]-this.field[b+
-this.yd],this.normal_cache[c+2]=this.field[b-this.zd]-this.field[b+this.zd])};this.polygonize=function(b,c,h,m,k,n){var u=m+1,p=m+this.yd,v=m+this.zd,t=u+this.yd,x=u+this.zd,w=m+this.yd+this.zd,y=u+this.yd+this.zd,z=0,C=this.field[m],A=this.field[u],F=this.field[p],D=this.field[t],J=this.field[v],P=this.field[x],S=this.field[w],I=this.field[y];C<k&&(z|=1);A<k&&(z|=2);F<k&&(z|=8);D<k&&(z|=4);J<k&&(z|=16);P<k&&(z|=32);S<k&&(z|=128);I<k&&(z|=64);var H=THREE.edgeTable[z];if(H==0)return 0;var G=this.delta,
-Y=b+G,E=c+G,G=h+G;H&1&&(this.compNorm(m),this.compNorm(u),this.VIntX(m*3,this.vlist,this.nlist,0,k,b,c,h,C,A));H&2&&(this.compNorm(u),this.compNorm(t),this.VIntY(u*3,this.vlist,this.nlist,3,k,Y,c,h,A,D));H&4&&(this.compNorm(p),this.compNorm(t),this.VIntX(p*3,this.vlist,this.nlist,6,k,b,E,h,F,D));H&8&&(this.compNorm(m),this.compNorm(p),this.VIntY(m*3,this.vlist,this.nlist,9,k,b,c,h,C,F));H&16&&(this.compNorm(v),this.compNorm(x),this.VIntX(v*3,this.vlist,this.nlist,12,k,b,c,G,J,P));H&32&&(this.compNorm(x),
-this.compNorm(y),this.VIntY(x*3,this.vlist,this.nlist,15,k,Y,c,G,P,I));H&64&&(this.compNorm(w),this.compNorm(y),this.VIntX(w*3,this.vlist,this.nlist,18,k,b,E,G,S,I));H&128&&(this.compNorm(v),this.compNorm(w),this.VIntY(v*3,this.vlist,this.nlist,21,k,b,c,G,J,S));H&256&&(this.compNorm(m),this.compNorm(v),this.VIntZ(m*3,this.vlist,this.nlist,24,k,b,c,h,C,J));H&512&&(this.compNorm(u),this.compNorm(x),this.VIntZ(u*3,this.vlist,this.nlist,27,k,Y,c,h,A,P));H&1024&&(this.compNorm(t),this.compNorm(y),this.VIntZ(t*
-3,this.vlist,this.nlist,30,k,Y,E,h,D,I));H&2048&&(this.compNorm(p),this.compNorm(w),this.VIntZ(p*3,this.vlist,this.nlist,33,k,b,E,h,F,S));z<<=4;for(k=m=0;THREE.triTable[z+k]!=-1;)b=z+k,c=b+1,h=b+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[c],3*THREE.triTable[h],n),k+=3,m++;return m};this.posnormtriv=function(b,c,h,m,k,n){var u=this.count*3;this.positionArray[u]=b[h];this.positionArray[u+1]=b[h+1];this.positionArray[u+2]=b[h+2];this.positionArray[u+3]=b[m];this.positionArray[u+
-4]=b[m+1];this.positionArray[u+5]=b[m+2];this.positionArray[u+6]=b[k];this.positionArray[u+7]=b[k+1];this.positionArray[u+8]=b[k+2];this.normalArray[u]=c[h];this.normalArray[u+1]=c[h+1];this.normalArray[u+2]=c[h+2];this.normalArray[u+3]=c[m];this.normalArray[u+4]=c[m+1];this.normalArray[u+5]=c[m+2];this.normalArray[u+6]=c[k];this.normalArray[u+7]=c[k+1];this.normalArray[u+8]=c[k+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&n(this)};this.begin=function(){this.count=0;
-this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;c<this.positionArray.length;c++)this.positionArray[c]=0;b(this)}};this.addBall=function(b,c,h,m,k){var n=this.size*Math.sqrt(m/k),u=h*this.size,p=c*this.size,v=b*this.size,t=Math.floor(u-n);t<1&&(t=1);u=Math.floor(u+n);u>this.size-1&&(u=this.size-1);var x=Math.floor(p-n);x<1&&(x=1);p=Math.floor(p+n);p>this.size-1&&(p=this.size-1);var w=Math.floor(v-n);w<1&&(w=1);n=Math.floor(v+n);n>this.size-1&&(n=this.size-
-1);for(var y,z,C,A,F,D;t<u;t++){v=this.size2*t;z=t/this.size-h;F=z*z;for(z=x;z<p;z++){C=v+this.size*z;y=z/this.size-c;D=y*y;for(y=w;y<n;y++)A=y/this.size-b,A=m/(1.0E-6+A*A+D+F)-k,A>0&&(this.field[C+y]+=A)}}};this.addPlaneX=function(b,c){var h,m,k,n,u,p=this.size,v=this.yd,t=this.zd,x=this.field,w=p*Math.sqrt(b/c);w>p&&(w=p);for(h=0;h<w;h++)if(m=h/p,m*=m,n=b/(1.0E-4+m)-c,n>0)for(m=0;m<p;m++){u=h+m*v;for(k=0;k<p;k++)x[t*k+u]+=n}};this.addPlaneY=function(b,c){var h,m,k,n,u,p,v=this.size,t=this.yd,x=
-this.zd,w=this.field,y=v*Math.sqrt(b/c);y>v&&(y=v);for(m=0;m<y;m++)if(h=m/v,h*=h,n=b/(1.0E-4+h)-c,n>0){u=m*t;for(h=0;h<v;h++){p=u+h;for(k=0;k<v;k++)w[x*k+p]+=n}}};this.addPlaneZ=function(b,c){var h,m,k,n,u,p;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/c);dist>size&&(dist=size);for(k=0;k<dist;k++)if(h=k/size,h*=h,n=b/(1.0E-4+h)-c,n>0){u=zd*k;for(m=0;m<size;m++){p=u+m*yd;for(h=0;h<size;h++)field[p+h]+=n}}};this.reset=function(){var b;for(b=0;b<this.size3;b++)this.normal_cache[b*
-3]=0,this.field[b]=0};this.render=function(b){this.begin();var c,h,m,k,n,u,p,v,t,x=this.size-2;for(k=1;k<x;k++){t=this.size2*k;p=(k-this.halfsize)/this.halfsize;for(m=1;m<x;m++){v=t+this.size*m;u=(m-this.halfsize)/this.halfsize;for(h=1;h<x;h++)n=(h-this.halfsize)/this.halfsize,c=v+h,this.polygonize(n,u,p,c,this.isolation,b)}}this.end(b)};this.generateGeometry=function(){var b=0,c=new THREE.Geometry,h=[];this.render(function(m){var k,n,u,p,v,t,x,w;for(k=0;k<m.count;k++)x=k*3,v=x+1,w=x+2,n=m.positionArray[x],
-u=m.positionArray[v],p=m.positionArray[w],t=new THREE.Vector3(n,u,p),n=m.normalArray[x],u=m.normalArray[v],p=m.normalArray[w],x=new THREE.Vector3(n,u,p),x.normalize(),v=new THREE.Vertex(t),c.vertices.push(v),h.push(x);nfaces=m.count/3;for(k=0;k<nfaces;k++)x=(b+k)*3,v=x+1,w=x+2,t=h[x],n=h[v],u=h[w],x=new THREE.Face3(x,v,w,[t,n,u]),c.faces.push(x);b+=nfaces;m.count=0});return c};this.init(b)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
+0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,c,k){return b+(c-b)*k};this.VIntX=function(b,c,k,m,h,n,p,t,u,w){h=(h-u)/(w-u);u=this.normal_cache;c[m]=n+h*this.delta;c[m+1]=p;c[m+2]=t;k[m]=this.lerp(u[b],u[b+3],h);k[m+1]=this.lerp(u[b+1],u[b+4],h);k[m+2]=this.lerp(u[b+2],u[b+5],h)};this.VIntY=function(b,c,k,m,h,n,p,t,u,w){h=(h-u)/(w-u);u=this.normal_cache;c[m]=n;c[m+1]=p+h*this.delta;c[m+
+2]=t;c=b+this.yd*3;k[m]=this.lerp(u[b],u[c],h);k[m+1]=this.lerp(u[b+1],u[c+1],h);k[m+2]=this.lerp(u[b+2],u[c+2],h)};this.VIntZ=function(b,c,k,m,h,n,p,t,u,w){h=(h-u)/(w-u);u=this.normal_cache;c[m]=n;c[m+1]=p;c[m+2]=t+h*this.delta;c=b+this.zd*3;k[m]=this.lerp(u[b],u[c],h);k[m+1]=this.lerp(u[b+1],u[c+1],h);k[m+2]=this.lerp(u[b+2],u[c+2],h)};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,k,m,h,n){var p=m+1,t=m+this.yd,u=m+this.zd,w=p+this.yd,x=p+this.zd,v=m+this.yd+this.zd,y=p+this.yd+this.zd,z=0,C=this.field[m],A=this.field[p],F=this.field[t],D=this.field[w],J=this.field[u],P=this.field[x],S=this.field[v],I=this.field[y];C<h&&(z|=1);A<h&&(z|=2);F<h&&(z|=8);D<h&&(z|=4);J<h&&(z|=16);P<h&&(z|=32);S<h&&(z|=128);I<h&&(z|=64);var H=THREE.edgeTable[z];if(H==0)return 0;var G=this.delta,
+Y=b+G,E=c+G,G=k+G;H&1&&(this.compNorm(m),this.compNorm(p),this.VIntX(m*3,this.vlist,this.nlist,0,h,b,c,k,C,A));H&2&&(this.compNorm(p),this.compNorm(w),this.VIntY(p*3,this.vlist,this.nlist,3,h,Y,c,k,A,D));H&4&&(this.compNorm(t),this.compNorm(w),this.VIntX(t*3,this.vlist,this.nlist,6,h,b,E,k,F,D));H&8&&(this.compNorm(m),this.compNorm(t),this.VIntY(m*3,this.vlist,this.nlist,9,h,b,c,k,C,F));H&16&&(this.compNorm(u),this.compNorm(x),this.VIntX(u*3,this.vlist,this.nlist,12,h,b,c,G,J,P));H&32&&(this.compNorm(x),
+this.compNorm(y),this.VIntY(x*3,this.vlist,this.nlist,15,h,Y,c,G,P,I));H&64&&(this.compNorm(v),this.compNorm(y),this.VIntX(v*3,this.vlist,this.nlist,18,h,b,E,G,S,I));H&128&&(this.compNorm(u),this.compNorm(v),this.VIntY(u*3,this.vlist,this.nlist,21,h,b,c,G,J,S));H&256&&(this.compNorm(m),this.compNorm(u),this.VIntZ(m*3,this.vlist,this.nlist,24,h,b,c,k,C,J));H&512&&(this.compNorm(p),this.compNorm(x),this.VIntZ(p*3,this.vlist,this.nlist,27,h,Y,c,k,A,P));H&1024&&(this.compNorm(w),this.compNorm(y),this.VIntZ(w*
+3,this.vlist,this.nlist,30,h,Y,E,k,D,I));H&2048&&(this.compNorm(t),this.compNorm(v),this.VIntZ(t*3,this.vlist,this.nlist,33,h,b,E,k,F,S));z<<=4;for(h=m=0;THREE.triTable[z+h]!=-1;)b=z+h,c=b+1,k=b+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[c],3*THREE.triTable[k],n),h+=3,m++;return m};this.posnormtriv=function(b,c,k,m,h,n){var p=this.count*3;this.positionArray[p]=b[k];this.positionArray[p+1]=b[k+1];this.positionArray[p+2]=b[k+2];this.positionArray[p+3]=b[m];this.positionArray[p+
+4]=b[m+1];this.positionArray[p+5]=b[m+2];this.positionArray[p+6]=b[h];this.positionArray[p+7]=b[h+1];this.positionArray[p+8]=b[h+2];this.normalArray[p]=c[k];this.normalArray[p+1]=c[k+1];this.normalArray[p+2]=c[k+2];this.normalArray[p+3]=c[m];this.normalArray[p+4]=c[m+1];this.normalArray[p+5]=c[m+2];this.normalArray[p+6]=c[h];this.normalArray[p+7]=c[h+1];this.normalArray[p+8]=c[h+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&n(this)};this.begin=function(){this.count=0;
+this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;c<this.positionArray.length;c++)this.positionArray[c]=0;b(this)}};this.addBall=function(b,c,k,m,h){var n=this.size*Math.sqrt(m/h),p=k*this.size,t=c*this.size,u=b*this.size,w=Math.floor(p-n);w<1&&(w=1);p=Math.floor(p+n);p>this.size-1&&(p=this.size-1);var x=Math.floor(t-n);x<1&&(x=1);t=Math.floor(t+n);t>this.size-1&&(t=this.size-1);var v=Math.floor(u-n);v<1&&(v=1);n=Math.floor(u+n);n>this.size-1&&(n=this.size-
+1);for(var y,z,C,A,F,D;w<p;w++){u=this.size2*w;z=w/this.size-k;F=z*z;for(z=x;z<t;z++){C=u+this.size*z;y=z/this.size-c;D=y*y;for(y=v;y<n;y++)A=y/this.size-b,A=m/(1.0E-6+A*A+D+F)-h,A>0&&(this.field[C+y]+=A)}}};this.addPlaneX=function(b,c){var k,m,h,n,p,t=this.size,u=this.yd,w=this.zd,x=this.field,v=t*Math.sqrt(b/c);v>t&&(v=t);for(k=0;k<v;k++)if(m=k/t,m*=m,n=b/(1.0E-4+m)-c,n>0)for(m=0;m<t;m++){p=k+m*u;for(h=0;h<t;h++)x[w*h+p]+=n}};this.addPlaneY=function(b,c){var k,m,h,n,p,t,u=this.size,w=this.yd,x=
+this.zd,v=this.field,y=u*Math.sqrt(b/c);y>u&&(y=u);for(m=0;m<y;m++)if(k=m/u,k*=k,n=b/(1.0E-4+k)-c,n>0){p=m*w;for(k=0;k<u;k++){t=p+k;for(h=0;h<u;h++)v[x*h+t]+=n}}};this.addPlaneZ=function(b,c){var k,m,h,n,p,t;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/c);dist>size&&(dist=size);for(h=0;h<dist;h++)if(k=h/size,k*=k,n=b/(1.0E-4+k)-c,n>0){p=zd*h;for(m=0;m<size;m++){t=p+m*yd;for(k=0;k<size;k++)field[t+k]+=n}}};this.reset=function(){var b;for(b=0;b<this.size3;b++)this.normal_cache[b*
+3]=0,this.field[b]=0};this.render=function(b){this.begin();var c,k,m,h,n,p,t,u,w,x=this.size-2;for(h=1;h<x;h++){w=this.size2*h;t=(h-this.halfsize)/this.halfsize;for(m=1;m<x;m++){u=w+this.size*m;p=(m-this.halfsize)/this.halfsize;for(k=1;k<x;k++)n=(k-this.halfsize)/this.halfsize,c=u+k,this.polygonize(n,p,t,c,this.isolation,b)}}this.end(b)};this.generateGeometry=function(){var b=0,c=new THREE.Geometry,k=[];this.render(function(m){var h,n,p,t,u,w,x,v;for(h=0;h<m.count;h++)x=h*3,u=x+1,v=x+2,n=m.positionArray[x],
+p=m.positionArray[u],t=m.positionArray[v],w=new THREE.Vector3(n,p,t),n=m.normalArray[x],p=m.normalArray[u],t=m.normalArray[v],x=new THREE.Vector3(n,p,t),x.normalize(),u=new THREE.Vertex(w),c.vertices.push(u),k.push(x);nfaces=m.count/3;for(h=0;h<nfaces;h++)x=(b+h)*3,u=x+1,v=x+2,w=k[x],n=k[u],p=k[v],x=new THREE.Face3(x,u,v,[w,n,p]),c.faces.push(x);b+=nfaces;m.count=0});return c};this.init(b)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
 THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
 1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,
 419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]);
@@ -667,27 +673,25 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 2,11,1,5,1,11,-1,0,2,5,0,5,9,2,11,5,4,5,8,11,8,5,-1,9,4,5,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,5,10,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1,5,10,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1,3,10,2,3,5,10,3,8,5,4,5,8,0,1,9,-1,5,10,2,5,2,4,1,9,2,9,4,2,-1,-1,-1,-1,8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1,0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,4,5,8,5,3,9,0,5,0,3,5,-1,-1,-1,-1,9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,11,7,4,9,11,9,10,11,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,7,9,11,7,9,10,11,-1,-1,-1,-1,1,10,11,1,11,
 4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
 -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,
-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);
-THREE.Trident=function(){THREE.Object3D.call(this);var b=new THREE.Geometry;b.vertices.push(new THREE.Vertex);b.vertices.push(new THREE.Vertex(new THREE.Vector3(0,100,0)));var c=new THREE.CylinderGeometry(0,5,25,5,1),e=new THREE.Line(b,new THREE.LineBasicMaterial({color:16711680}));e.rotation.z=-Math.PI/2;this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:16711680}));e.position.x=100;e.rotation.z=-Math.PI/2;this.add(e);e=new THREE.Line(b,new THREE.LineBasicMaterial({color:65280}));
-this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:65280}));e.position.y=100;this.add(e);e=new THREE.Line(b,new THREE.LineBasicMaterial({color:255}));e.rotation.x=Math.PI/2;this.add(e);e=new THREE.Mesh(c,new THREE.MeshBasicMaterial({color:255}));e.position.z=100;e.rotation.x=Math.PI/2;this.add(e)};THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.PlaneCollider=function(b,c){this.point=b;this.normal=c};
-THREE.SphereCollider=function(b,c){this.center=b;this.radius=c;this.radiusSq=c*c};THREE.BoxCollider=function(b,c){this.min=b;this.max=c;this.dynamic=!0;this.normal=new THREE.Vector3};THREE.MeshCollider=function(b,c){this.mesh=b;this.box=c;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;
-THREE.CollisionSystem.prototype.merge=function(b){Array.prototype.push.apply(this.colliders,b.colliders);Array.prototype.push.apply(this.hits,b.hits)};THREE.CollisionSystem.prototype.rayCastAll=function(b){b.direction.normalize();this.hits.length=0;var c,e,f,h,m=0;c=0;for(e=this.colliders.length;c<e;c++)if(h=this.colliders[c],f=this.rayCast(b,h),f<Number.MAX_VALUE)h.distance=f,f>m?this.hits.push(h):this.hits.unshift(h),m=f;return this.hits};
+2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);THREE.PlaneCollider=function(b,c){this.point=b;this.normal=c};THREE.SphereCollider=function(b,c){this.center=b;this.radius=c;this.radiusSq=c*c};THREE.BoxCollider=function(b,c){this.min=b;this.max=c;this.dynamic=!0;this.normal=new THREE.Vector3};
+THREE.MeshCollider=function(b,c){this.mesh=b;this.box=c;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;THREE.CollisionSystem.prototype.merge=function(b){Array.prototype.push.apply(this.colliders,b.colliders);Array.prototype.push.apply(this.hits,b.hits)};
+THREE.CollisionSystem.prototype.rayCastAll=function(b){b.direction.normalize();this.hits.length=0;var c,e,f,k,m=0;c=0;for(e=this.colliders.length;c<e;c++)if(k=this.colliders[c],f=this.rayCast(b,k),f<Number.MAX_VALUE)k.distance=f,f>m?this.hits.push(k):this.hits.unshift(k),m=f;return this.hits};
 THREE.CollisionSystem.prototype.rayCastNearest=function(b){var c=this.rayCastAll(b);if(c.length==0)return null;for(var e=0;c[e]instanceof THREE.MeshCollider;){var f=this.rayMesh(b,c[e]);if(f.dist<Number.MAX_VALUE){c[e].distance=f.dist;c[e].faceIndex=f.faceIndex;break}e++}if(e>c.length)return null;return c[e]};
 THREE.CollisionSystem.prototype.rayCast=function(b,c){if(c instanceof THREE.PlaneCollider)return this.rayPlane(b,c);else if(c instanceof THREE.SphereCollider)return this.raySphere(b,c);else if(c instanceof THREE.BoxCollider)return this.rayBox(b,c);else if(c instanceof THREE.MeshCollider&&c.box)return this.rayBox(b,c.box)};
-THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,m=0;m<c.numFaces;m++){var k=c.mesh.geometry.faces[m],n=c.mesh.geometry.vertices[k.a].position,u=c.mesh.geometry.vertices[k.b].position,p=c.mesh.geometry.vertices[k.c].position,v=k instanceof THREE.Face4?c.mesh.geometry.vertices[k.d].position:null;k instanceof THREE.Face3?(k=this.rayTriangle(e,n,u,p,f,this.collisionNormal,c.mesh),k<f&&(f=k,h=m,c.normal.copy(this.collisionNormal),c.normal.normalize())):
-k instanceof THREE.Face4&&(k=this.rayTriangle(e,n,u,v,f,this.collisionNormal,c.mesh),k<f&&(f=k,h=m,c.normal.copy(this.collisionNormal),c.normal.normalize()),k=this.rayTriangle(e,u,p,v,f,this.collisionNormal,c.mesh),k<f&&(f=k,h=m,c.normal.copy(this.collisionNormal),c.normal.normalize()))}return{dist:f,faceIndex:h}};
-THREE.CollisionSystem.prototype.rayTriangle=function(b,c,e,f,h,m,k){var n=THREE.CollisionSystem.__v1,u=THREE.CollisionSystem.__v2;m.set(0,0,0);n.sub(e,c);u.sub(f,e);m.cross(n,u);n=m.dot(b.direction);if(!(n<0))if(k.doubleSided||k.flipSided)m.multiplyScalar(-1),n*=-1;else return Number.MAX_VALUE;k=m.dot(c)-m.dot(b.origin);if(!(k<=0))return Number.MAX_VALUE;if(!(k>=n*h))return Number.MAX_VALUE;k/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(k);n.addSelf(b.origin);Math.abs(m.x)>
-Math.abs(m.y)?Math.abs(m.x)>Math.abs(m.z)?(b=n.y-c.y,m=e.y-c.y,h=f.y-c.y,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,m=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(m.y)>Math.abs(m.z)?(b=n.x-c.x,m=e.x-c.x,h=f.x-c.x,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,m=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y);c=m*f-e*h;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-n*h)*c;if(!(f>=0))return Number.MAX_VALUE;c*=m*n-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return k};
+THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,k,m=0;m<c.numFaces;m++){var h=c.mesh.geometry.faces[m],n=c.mesh.geometry.vertices[h.a].position,p=c.mesh.geometry.vertices[h.b].position,t=c.mesh.geometry.vertices[h.c].position,u=h instanceof THREE.Face4?c.mesh.geometry.vertices[h.d].position:null;h instanceof THREE.Face3?(h=this.rayTriangle(e,n,p,t,f,this.collisionNormal,c.mesh),h<f&&(f=h,k=m,c.normal.copy(this.collisionNormal),c.normal.normalize())):
+h instanceof THREE.Face4&&(h=this.rayTriangle(e,n,p,u,f,this.collisionNormal,c.mesh),h<f&&(f=h,k=m,c.normal.copy(this.collisionNormal),c.normal.normalize()),h=this.rayTriangle(e,p,t,u,f,this.collisionNormal,c.mesh),h<f&&(f=h,k=m,c.normal.copy(this.collisionNormal),c.normal.normalize()))}return{dist:f,faceIndex:k}};
+THREE.CollisionSystem.prototype.rayTriangle=function(b,c,e,f,k,m,h){var n=THREE.CollisionSystem.__v1,p=THREE.CollisionSystem.__v2;m.set(0,0,0);n.sub(e,c);p.sub(f,e);m.cross(n,p);n=m.dot(b.direction);if(!(n<0))if(h.doubleSided||h.flipSided)m.multiplyScalar(-1),n*=-1;else return Number.MAX_VALUE;h=m.dot(c)-m.dot(b.origin);if(!(h<=0))return Number.MAX_VALUE;if(!(h>=n*k))return Number.MAX_VALUE;h/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(h);n.addSelf(b.origin);Math.abs(m.x)>
+Math.abs(m.y)?Math.abs(m.x)>Math.abs(m.z)?(b=n.y-c.y,m=e.y-c.y,k=f.y-c.y,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,m=e.x-c.x,k=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(m.y)>Math.abs(m.z)?(b=n.x-c.x,m=e.x-c.x,k=f.x-c.x,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,m=e.x-c.x,k=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y);c=m*f-e*k;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-n*k)*c;if(!(f>=0))return Number.MAX_VALUE;c*=m*n-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return h};
 THREE.CollisionSystem.prototype.makeRayLocal=function(b,c){var e=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(c.matrixWorld,e);var f=THREE.CollisionSystem.__r;f.origin.copy(b.origin);f.direction.copy(b.direction);e.multiplyVector3(f.origin);e.rotateAxis(f.direction);f.direction.normalize();return f};
-THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,h=0,m=0,k=0,n=0,u=0,p=!0;e.origin.x<c.min.x?(f=c.min.x-e.origin.x,f/=e.direction.x,p=!1,k=-1):e.origin.x>c.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,p=!1,k=1);e.origin.y<c.min.y?(h=c.min.y-e.origin.y,h/=e.direction.y,p=!1,n=-1):e.origin.y>c.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y,
-p=!1,n=1);e.origin.z<c.min.z?(m=c.min.z-e.origin.z,m/=e.direction.z,p=!1,u=-1):e.origin.z>c.max.z&&(m=c.max.z-e.origin.z,m/=e.direction.z,p=!1,u=1);if(p)return-1;p=0;h>f&&(p=1,f=h);m>f&&(p=2,f=m);switch(p){case 0:n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>c.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(k,0,0);break;case 1:k=e.origin.x+e.direction.x*f;if(k<c.min.x||k>c.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*
-f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:k=e.origin.x+e.direction.x*f;if(k<c.min.x||k>c.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>c.max.y)return Number.MAX_VALUE;c.normal.set(0,0,u)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE};
+THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,k=0,m=0,h=0,n=0,p=0,t=!0;e.origin.x<c.min.x?(f=c.min.x-e.origin.x,f/=e.direction.x,t=!1,h=-1):e.origin.x>c.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,t=!1,h=1);e.origin.y<c.min.y?(k=c.min.y-e.origin.y,k/=e.direction.y,t=!1,n=-1):e.origin.y>c.max.y&&(k=c.max.y-e.origin.y,k/=e.direction.y,
+t=!1,n=1);e.origin.z<c.min.z?(m=c.min.z-e.origin.z,m/=e.direction.z,t=!1,p=-1):e.origin.z>c.max.z&&(m=c.max.z-e.origin.z,m/=e.direction.z,t=!1,p=1);if(t)return-1;t=0;k>f&&(t=1,f=k);m>f&&(t=2,f=m);switch(t){case 0:n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>c.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(h,0,0);break;case 1:h=e.origin.x+e.direction.x*f;if(h<c.min.x||h>c.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*
+f;if(e<c.min.z||e>c.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:h=e.origin.x+e.direction.x*f;if(h<c.min.x||h>c.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(n<c.min.y||n>c.max.y)return Number.MAX_VALUE;c.normal.set(0,0,p)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE};
 THREE.CollisionSystem.prototype.raySphere=function(b,c){var e=c.center.clone().subSelf(b.origin);if(e.lengthSq<c.radiusSq)return-1;var f=e.dot(b.direction.clone());if(f<=0)return Number.MAX_VALUE;e=c.radiusSq-(e.lengthSq()-f*f);if(e>=0)return Math.abs(f)-Math.sqrt(e);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4;
 THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(b){b.geometry.computeBoundingBox();var c=b.geometry.boundingBox,e=new THREE.Vector3(c.x[0],c.y[0],c.z[0]),c=new THREE.Vector3(c.x[1],c.y[1],c.z[1]),e=new THREE.BoxCollider(e,c);e.mesh=b;return e};THREE.CollisionUtils.MeshAABB=function(b){var c=THREE.CollisionUtils.MeshOBB(b);c.min.addSelf(b.position);c.max.addSelf(b.position);c.dynamic=!1;return c};
 THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))};
-if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.Camera,m=new THREE.Camera,k=new THREE.Matrix4,n=new THREE.Matrix4,u,p,v;h.useTarget=m.useTarget=!1;h.matrixAutoUpdate=m.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},t=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),w=new THREE.Camera(53,1,1,1E4);w.position.z=
-2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:t},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});
-var y=new THREE.Scene;y.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);t.width=b;t.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(u!==e.aspect||p!==e.near||v!==e.fov){u=e.aspect;p=e.near;v=e.fov;var A=e.projectionMatrix.clone(),F=125/30*0.5,D=F*p/125,J=p*Math.tan(v*Math.PI/360),P;k.n14=F;n.n14=-F;F=-J*u+D;P=J*u+D;A.n11=2*p/(P-F);A.n13=(P+F)/(P-F);h.projectionMatrix=A.clone();F=-J*u-D;P=J*u-D;A.n11=2*p/(P-F);A.n13=
-(P+F)/(P-F);m.projectionMatrix=A.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=p;h.far=e.far;f.call(c,b,h,t,!0);m.matrix=e.matrixWorld.clone().multiplySelf(k);m.update(null,!0);m.position.copy(e.position);m.near=p;m.far=e.far;f.call(c,b,m,x,!0);f.call(c,y,w)}};
-if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,h,m,k=new THREE.Camera;k.useTarget=!0;var n=new THREE.Camera;n.useTarget=!0;c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;this.setSize=function(b,f){e.call(c,b,f);h=b/2;m=f};this.render=function(b,e){this.clear();k.fov=e.fov;k.aspect=0.5*e.aspect;k.near=e.near;k.far=e.far;k.updateProjectionMatrix();k.position.copy(e.position);
-k.target.position.copy(e.target.position);k.translateX(c.separation);n.projectionMatrix=k.projectionMatrix;n.position.copy(e.position);n.target.position.copy(e.target.position);n.translateX(-c.separation);this.setViewport(0,0,h,m);f.call(c,b,k);this.setViewport(h,0,h,m);f.call(c,b,n,!1)}};
+if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,k=new THREE.Camera,m=new THREE.Camera,h=new THREE.Matrix4,n=new THREE.Matrix4,p,t,u;k.useTarget=m.useTarget=!1;k.matrixAutoUpdate=m.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},w=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.Camera(53,1,1,1E4);v.position.z=
+2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:w},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});
+var y=new THREE.Scene;y.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);w.width=b;w.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(p!==e.aspect||t!==e.near||u!==e.fov){p=e.aspect;t=e.near;u=e.fov;var A=e.projectionMatrix.clone(),F=125/30*0.5,D=F*t/125,J=t*Math.tan(u*Math.PI/360),P;h.n14=F;n.n14=-F;F=-J*p+D;P=J*p+D;A.n11=2*t/(P-F);A.n13=(P+F)/(P-F);k.projectionMatrix=A.clone();F=-J*p-D;P=J*p-D;A.n11=2*t/(P-F);A.n13=
+(P+F)/(P-F);m.projectionMatrix=A.clone()}k.matrix=e.matrixWorld.clone().multiplySelf(n);k.update(null,!0);k.position.copy(e.position);k.near=t;k.far=e.far;f.call(c,b,k,w,!0);m.matrix=e.matrixWorld.clone().multiplySelf(h);m.update(null,!0);m.position.copy(e.position);m.near=t;m.far=e.far;f.call(c,b,m,x,!0);f.call(c,y,v)}};
+if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,k,m,h=new THREE.Camera;h.useTarget=!0;var n=new THREE.Camera;n.useTarget=!0;c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;this.setSize=function(b,f){e.call(c,b,f);k=b/2;m=f};this.render=function(b,e){this.clear();h.fov=e.fov;h.aspect=0.5*e.aspect;h.near=e.near;h.far=e.far;h.updateProjectionMatrix();h.position.copy(e.position);
+h.target.position.copy(e.target.position);h.translateX(c.separation);n.projectionMatrix=h.projectionMatrix;n.position.copy(e.position);n.target.position.copy(e.target.position);n.translateX(-c.separation);this.setViewport(0,0,k,m);f.call(c,b,h);this.setViewport(k,0,k,m);f.call(c,b,n,!1)}};

+ 63 - 64
build/custom/ThreeCanvas.js

@@ -1,7 +1,7 @@
 // ThreeCanvas.js r45dev - http://github.com/mrdoob/three.js
 var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this};
-THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,g;if(c==0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),e=a*6-d,a=c*(1-b),g=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=
-c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
+THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,f;if(c==0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),e=a*6-d,a=c*(1-b),f=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=f;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=f;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=
+c;this.g=a;this.b=f;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
 THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},
 divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)},
@@ -16,82 +16,81 @@ b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this
 normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
 THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d=[];b=0;for(c=a.length;b<c;b++)Array.prototype.push.apply(d,this.intersectObject(a[b]));d.sort(function(a,b){return a.distance-b.distance});return d},intersectObject:function(a){function b(a,b,c){var d;d=c.clone().subSelf(a).dot(b);if(d<=0)return null;a=a.clone().addSelf(b.clone().multiplyScalar(d));return c.distanceTo(a)}function c(a,b,c,d){var d=d.clone().subSelf(b),
 c=c.clone().subSelf(b),e=a.clone().subSelf(b),a=d.dot(d),b=d.dot(c),d=d.dot(e),f=c.dot(c),c=c.dot(e),e=1/(a*f-b*b),f=(f*d-b*c)*e,a=(a*c-b*d)*e;return f>0&&a>0&&f+a<1}if(a instanceof THREE.Particle){var d=b(this.origin,this.direction,a.matrixWorld.getPosition());if(d==null||d>a.scale.x)return[];return[{distance:d,point:a.position,face:null,object:a}]}else if(a instanceof THREE.Mesh){d=b(this.origin,this.direction,a.matrixWorld.getPosition());if(d==null||d>a.geometry.boundingSphere.radius*Math.max(a.scale.x,
-Math.max(a.scale.y,a.scale.z)))return[];var e,g,f,h,l,j,n,i,o,k,r=a.geometry,s=r.vertices,w=[],d=0;for(e=r.faces.length;d<e;d++)if(g=r.faces[d],o=this.origin.clone(),k=this.direction.clone(),j=a.matrixWorld,f=j.multiplyVector3(g.centroid.clone()).subSelf(o),i=f.dot(k),!(i<=0)&&(f=j.multiplyVector3(s[g.a].position.clone()),h=j.multiplyVector3(s[g.b].position.clone()),l=j.multiplyVector3(s[g.c].position.clone()),j=g instanceof THREE.Face4?j.multiplyVector3(s[g.d].position.clone()):null,n=a.matrixRotationWorld.multiplyVector3(g.normal.clone()),
-i=k.dot(n),a.doubleSided||(a.flipSided?i>0:i<0)))if(i=n.dot((new THREE.Vector3).sub(f,o))/i,o=o.addSelf(k.multiplyScalar(i)),g instanceof THREE.Face3)c(o,f,h,l)&&(g={distance:this.origin.distanceTo(o),point:o,face:g,object:a},w.push(g));else if(g instanceof THREE.Face4&&(c(o,f,h,j)||c(o,h,l,j)))g={distance:this.origin.distanceTo(o),point:o,face:g,object:a},w.push(g);w.sort(function(a,b){return a.distance-b.distance});return w}else return[]}};
-THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return f};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(f,g,n,i){h=!1;b=f;c=g;d=n;e=i;a()};this.addPoint=function(f,g){h?(h=!1,b=f,c=g,d=f,e=g):(b=b<f?b:f,c=c<g?c:g,d=d>f?d:f,e=e>g?e:g);a()};this.add3Points=
+Math.max(a.scale.y,a.scale.z)))return[];var e,f,g,h,l,j,n,i,o,k,r=a.geometry,s=r.vertices,w=[],d=0;for(e=r.faces.length;d<e;d++)if(f=r.faces[d],o=this.origin.clone(),k=this.direction.clone(),j=a.matrixWorld,g=j.multiplyVector3(f.centroid.clone()).subSelf(o),i=g.dot(k),!(i<=0)&&(g=j.multiplyVector3(s[f.a].position.clone()),h=j.multiplyVector3(s[f.b].position.clone()),l=j.multiplyVector3(s[f.c].position.clone()),j=f instanceof THREE.Face4?j.multiplyVector3(s[f.d].position.clone()):null,n=a.matrixRotationWorld.multiplyVector3(f.normal.clone()),
+i=k.dot(n),a.doubleSided||(a.flipSided?i>0:i<0)))if(i=n.dot((new THREE.Vector3).sub(g,o))/i,o=o.addSelf(k.multiplyScalar(i)),f instanceof THREE.Face3)c(o,g,h,l)&&(f={distance:this.origin.distanceTo(o),point:o,face:f,object:a},w.push(f));else if(f instanceof THREE.Face4&&(c(o,g,h,j)||c(o,h,l,j)))f={distance:this.origin.distanceTo(o),point:o,face:f,object:a},w.push(f);w.sort(function(a,b){return a.distance-b.distance});return w}else return[]}};
+THREE.Rectangle=function(){function a(){f=d-b;g=e-c}var b,c,d,e,f,g,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return f};this.getHeight=function(){return g};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(f,g,n,i){h=!1;b=f;c=g;d=n;e=i;a()};this.addPoint=function(f,g){h?(h=!1,b=f,c=g,d=f,e=g):(b=b<f?b:f,c=c<g?c:g,d=d>f?d:f,e=e>g?e:g);a()};this.add3Points=
 function(f,g,n,i,o,k){h?(h=!1,b=f<n?f<o?f:o:n<o?n:o,c=g<i?g<k?g:k:i<k?i:k,d=f>n?f>o?f:o:n>o?n:o,e=g>i?g>k?g:k:i>k?i:k):(b=f<n?f<o?f<b?f:b:o<b?o:b:n<o?n<b?n:b:o<b?o:b,c=g<i?g<k?g<c?g:c:k<c?k:c:i<k?i<c?i:c:k<c?k:c,d=f>n?f>o?f>d?f:d:o>d?o:d:n>o?n>d?n:d:o>d?o:d,e=g>i?g>k?g>e?g:e:k>e?k:e:i>k?i>e?i:e:k>e?k:e);a()};this.addRectangle=function(f){h?(h=!1,b=f.getLeft(),c=f.getTop(),d=f.getRight(),e=f.getBottom()):(b=b<f.getLeft()?b:f.getLeft(),c=c<f.getTop()?c:f.getTop(),d=d>f.getRight()?d:f.getRight(),e=e>
 f.getBottom()?e:f.getBottom());a()};this.inflate=function(f){b-=f;c-=f;d+=f;e+=f;a()};this.minSelf=function(f){b=b>f.getLeft()?b:f.getLeft();c=c>f.getTop()?c:f.getTop();d=d<f.getRight()?d:f.getRight();e=e<f.getBottom()?e:f.getBottom();a()};this.intersects=function(a){return Math.min(d,a.getRight())-Math.max(b,a.getLeft())>=0&&Math.min(e,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){h=!0;e=d=c=b=0;a()};this.isEmpty=function(){return h}};THREE.Matrix3=function(){this.m=[]};
 THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};
-THREE.Matrix4=function(a,b,c,d,e,g,f,h,l,j,n,i,o,k,r,s){this.set(a!==void 0?a:1,b||0,c||0,d||0,e||0,g!==void 0?g:1,f||0,h||0,l||0,j||0,n!==void 0?n:1,i||0,o||0,k||0,r||0,s!==void 0?s:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,l,j,n,i,o,k,r,s){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=g;this.n23=f;this.n24=h;this.n31=l;this.n32=j;this.n33=n;this.n34=i;this.n41=o;this.n42=k;this.n43=r;this.n44=s;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
-b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;d.cross(c,g).normalize();d.length()===0&&(g.x+=1.0E-4,d.cross(c,g).normalize());e.cross(g,d).normalize();this.n11=d.x;this.n12=e.x;this.n13=g.x;this.n21=d.y;this.n22=e.y;this.n23=g.y;this.n31=d.z;this.n32=e.z;this.n33=g.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,d=a.z,e=1/(this.n41*b+this.n42*c+this.n43*d+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*d+this.n14)*e;
+THREE.Matrix4=function(a,b,c,d,e,f,g,h,l,j,n,i,o,k,r,s){this.set(a!==void 0?a:1,b||0,c||0,d||0,e||0,f!==void 0?f:1,g||0,h||0,l||0,j||0,n!==void 0?n:1,i||0,o||0,k||0,r||0,s!==void 0?s:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,l,j,n,i,o,k,r,s){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=f;this.n23=g;this.n24=h;this.n31=l;this.n32=j;this.n33=n;this.n34=i;this.n41=o;this.n42=k;this.n43=r;this.n44=s;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
+b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,f=THREE.Matrix4.__v3;f.sub(a,b).normalize();if(f.length()===0)f.z=1;d.cross(c,f).normalize();d.length()===0&&(f.x+=1.0E-4,d.cross(c,f).normalize());e.cross(f,d).normalize();this.n11=d.x;this.n12=e.x;this.n13=f.x;this.n21=d.y;this.n22=e.y;this.n23=f.y;this.n31=d.z;this.n32=e.z;this.n33=f.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,d=a.z,e=1/(this.n41*b+this.n42*c+this.n43*d+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*d+this.n14)*e;
 a.y=(this.n21*b+this.n22*c+this.n23*d+this.n24)*e;a.z=(this.n31*b+this.n32*c+this.n33*d+this.n34)*e;return a},multiplyVector4:function(a){var b=a.x,c=a.y,d=a.z,e=a.w;a.x=this.n11*b+this.n12*c+this.n13*d+this.n14*e;a.y=this.n21*b+this.n22*c+this.n23*d+this.n24*e;a.z=this.n31*b+this.n32*c+this.n33*d+this.n34*e;a.w=this.n41*b+this.n42*c+this.n43*d+this.n44*e;return a},rotateAxis:function(a){var b=a.x,c=a.y,d=a.z;a.x=b*this.n11+c*this.n12+d*this.n13;a.y=b*this.n21+c*this.n22+d*this.n23;a.z=b*this.n31+
-c*this.n32+d*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,l=a.n23,j=a.n24,n=a.n31,i=a.n32,o=a.n33,k=a.n34,r=a.n41,s=a.n42,w=a.n43,u=a.n44,M=b.n11,R=b.n12,
-B=b.n13,N=b.n14,O=b.n21,t=b.n22,m=b.n23,C=b.n24,D=b.n31,T=b.n32,U=b.n33,F=b.n34,K=b.n41,I=b.n42,J=b.n43,P=b.n44;this.n11=c*M+d*O+e*D+g*K;this.n12=c*R+d*t+e*T+g*I;this.n13=c*B+d*m+e*U+g*J;this.n14=c*N+d*C+e*F+g*P;this.n21=f*M+h*O+l*D+j*K;this.n22=f*R+h*t+l*T+j*I;this.n23=f*B+h*m+l*U+j*J;this.n24=f*N+h*C+l*F+j*P;this.n31=n*M+i*O+o*D+k*K;this.n32=n*R+i*t+o*T+k*I;this.n33=n*B+i*m+o*U+k*J;this.n34=n*N+i*C+o*F+k*P;this.n41=r*M+s*O+w*D+u*K;this.n42=r*R+s*t+w*T+u*I;this.n43=r*B+s*m+w*U+u*J;this.n44=r*N+s*
+c*this.n32+d*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,d=a.n12,e=a.n13,f=a.n14,g=a.n21,h=a.n22,l=a.n23,j=a.n24,n=a.n31,i=a.n32,o=a.n33,k=a.n34,r=a.n41,s=a.n42,w=a.n43,u=a.n44,M=b.n11,R=b.n12,
+B=b.n13,N=b.n14,O=b.n21,t=b.n22,m=b.n23,C=b.n24,D=b.n31,T=b.n32,U=b.n33,F=b.n34,K=b.n41,I=b.n42,J=b.n43,P=b.n44;this.n11=c*M+d*O+e*D+f*K;this.n12=c*R+d*t+e*T+f*I;this.n13=c*B+d*m+e*U+f*J;this.n14=c*N+d*C+e*F+f*P;this.n21=g*M+h*O+l*D+j*K;this.n22=g*R+h*t+l*T+j*I;this.n23=g*B+h*m+l*U+j*J;this.n24=g*N+h*C+l*F+j*P;this.n31=n*M+i*O+o*D+k*K;this.n32=n*R+i*t+o*T+k*I;this.n33=n*B+i*m+o*U+k*J;this.n34=n*N+i*C+o*F+k*P;this.n41=r*M+s*O+w*D+u*K;this.n42=r*R+s*t+w*T+u*I;this.n43=r*B+s*m+w*U+u*J;this.n44=r*N+s*
 C+w*F+u*P;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=
-a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,l=this.n31,j=this.n32,n=this.n33,i=this.n34,o=this.n41,k=this.n42,r=this.n43,s=this.n44;return d*f*j*o-c*h*j*o-d*g*n*o+b*h*n*o+c*g*i*o-b*f*i*o-d*f*l*k+c*h*l*k+d*e*n*k-a*h*n*k-c*e*i*k+a*f*i*k+d*g*l*r-b*h*l*r-d*e*j*r+a*h*j*r+b*e*i*r-a*g*i*r-c*g*l*s+b*f*l*s+c*e*j*s-a*f*j*s-b*e*n*s+a*g*n*s},
+a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,f=this.n22,g=this.n23,h=this.n24,l=this.n31,j=this.n32,n=this.n33,i=this.n34,o=this.n41,k=this.n42,r=this.n43,s=this.n44;return d*g*j*o-c*h*j*o-d*f*n*o+b*h*n*o+c*f*i*o-b*g*i*o-d*g*l*k+c*h*l*k+d*e*n*k-a*h*n*k-c*e*i*k+a*g*i*k+d*f*l*r-b*h*l*r-d*e*j*r+a*h*j*r+b*e*i*r-a*f*i*r-c*f*l*s+b*g*l*s+c*e*j*s-a*g*j*s-b*e*n*s+a*f*n*s},
 transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;
 a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=this.n11;
 a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;
 a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,
-0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,l=e*g,j=e*f;this.set(l*g+c,l*f-d*h,l*h+d*f,0,l*f+d*h,j*f+c,j*h-d*g,0,l*h-d*f,j*h+d*g,e*h*h+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
-new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);switch(b){case "YXZ":var l=
-f*h,j=f*e,n=d*h,i=d*e;this.n11=l+i*c;this.n12=n*c-j;this.n13=g*d;this.n21=g*e;this.n22=g*h;this.n23=-c;this.n31=j*c-n;this.n32=i+l*c;this.n33=g*f;break;case "ZXY":l=f*h;j=f*e;n=d*h;i=d*e;this.n11=l-i*c;this.n12=-g*e;this.n13=n+j*c;this.n21=j+n*c;this.n22=g*h;this.n23=i-l*c;this.n31=-g*d;this.n32=c;this.n33=g*f;break;case "ZYX":l=g*h;j=g*e;n=c*h;i=c*e;this.n11=f*h;this.n12=n*d-j;this.n13=l*d+i;this.n21=f*e;this.n22=i*d+l;this.n23=j*d-n;this.n31=-d;this.n32=c*f;this.n33=g*f;break;case "YZX":l=g*f;j=
-g*d;n=c*f;i=c*d;this.n11=f*h;this.n12=i-l*e;this.n13=n*e+j;this.n21=e;this.n22=g*h;this.n23=-c*h;this.n31=-d*h;this.n32=j*e+n;this.n33=l-i*e;break;case "XZY":l=g*f;j=g*d;n=c*f;i=c*d;this.n11=f*h;this.n12=-e;this.n13=d*h;this.n21=l*e+i;this.n22=g*h;this.n23=j*e-n;this.n31=n*e-j;this.n32=c*h;this.n33=i*e+l;break;default:l=g*h,j=g*e,n=c*h,i=c*e,this.n11=f*h,this.n12=-f*e,this.n13=d,this.n21=j+n*d,this.n22=l-i*d,this.n23=-c*f,this.n31=i-l*d,this.n32=n+j*d,this.n33=g*f}return this},setRotationFromQuaternion:function(a){var b=
-a.x,c=a.y,d=a.z,e=a.w,g=b+b,f=c+c,h=d+d,a=b*g,l=b*f;b*=h;var j=c*f;c*=h;d*=h;g*=e;f*=e;e*=h;this.n11=1-(j+d);this.n12=l-e;this.n13=b+f;this.n21=l+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+j);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,e=THREE.Matrix4.__m2;
-d.identity();d.setRotationFromQuaternion(b);e.setScale(c.x,c.y,c.z);this.multiply(d,e);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);e.set(this.n12,this.n22,this.n32);g.set(this.n13,this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=d.length();
-c.y=e.length();c.z=g.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=c.x;d.n21/=c.x;d.n31/=c.x;d.n12/=c.y;d.n22/=c.y;d.n32/=c.y;d.n13/=c.z;d.n23/=c.z;d.n33/=c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,d=1/b.y,e=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*d;this.n22=a.n22*d;this.n32=a.n32*d;this.n13=a.n13*e;this.n23=
+0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,l=e*f,j=e*g;this.set(l*f+c,l*g-d*h,l*h+d*g,0,l*g+d*h,j*g+c,j*h-d*f,0,l*h-d*g,j*h+d*f,e*h*h+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
+new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);switch(b){case "YXZ":var l=
+g*h,j=g*e,n=d*h,i=d*e;this.n11=l+i*c;this.n12=n*c-j;this.n13=f*d;this.n21=f*e;this.n22=f*h;this.n23=-c;this.n31=j*c-n;this.n32=i+l*c;this.n33=f*g;break;case "ZXY":l=g*h;j=g*e;n=d*h;i=d*e;this.n11=l-i*c;this.n12=-f*e;this.n13=n+j*c;this.n21=j+n*c;this.n22=f*h;this.n23=i-l*c;this.n31=-f*d;this.n32=c;this.n33=f*g;break;case "ZYX":l=f*h;j=f*e;n=c*h;i=c*e;this.n11=g*h;this.n12=n*d-j;this.n13=l*d+i;this.n21=g*e;this.n22=i*d+l;this.n23=j*d-n;this.n31=-d;this.n32=c*g;this.n33=f*g;break;case "YZX":l=f*g;j=
+f*d;n=c*g;i=c*d;this.n11=g*h;this.n12=i-l*e;this.n13=n*e+j;this.n21=e;this.n22=f*h;this.n23=-c*h;this.n31=-d*h;this.n32=j*e+n;this.n33=l-i*e;break;case "XZY":l=f*g;j=f*d;n=c*g;i=c*d;this.n11=g*h;this.n12=-e;this.n13=d*h;this.n21=l*e+i;this.n22=f*h;this.n23=j*e-n;this.n31=n*e-j;this.n32=c*h;this.n33=i*e+l;break;default:l=f*h,j=f*e,n=c*h,i=c*e,this.n11=g*h,this.n12=-g*e,this.n13=d,this.n21=j+n*d,this.n22=l-i*d,this.n23=-c*g,this.n31=i-l*d,this.n32=n+j*d,this.n33=f*g}return this},setRotationFromQuaternion:function(a){var b=
+a.x,c=a.y,d=a.z,e=a.w,f=b+b,g=c+c,h=d+d,a=b*f,l=b*g;b*=h;var j=c*g;c*=h;d*=h;f*=e;g*=e;e*=h;this.n11=1-(j+d);this.n12=l-e;this.n13=b+g;this.n21=l+e;this.n22=1-(a+d);this.n23=c-f;this.n31=b-g;this.n32=c+f;this.n33=1-(a+j);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,e=THREE.Matrix4.__m2;
+d.identity();d.setRotationFromQuaternion(b);e.setScale(c.x,c.y,c.z);this.multiply(d,e);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,f=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);e.set(this.n12,this.n22,this.n32);f.set(this.n13,this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=d.length();
+c.y=e.length();c.z=f.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=c.x;d.n21/=c.x;d.n31/=c.x;d.n12/=c.y;d.n22/=c.y;d.n32/=c.y;d.n13/=c.z;d.n23/=c.z;d.n33/=c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,d=1/b.y,e=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*d;this.n22=a.n22*d;this.n32=a.n32*d;this.n13=a.n13*e;this.n23=
 a.n23*e;this.n33=a.n33*e}};
-THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,l=a.n23,j=a.n24,n=a.n31,i=a.n32,o=a.n33,k=a.n34,r=a.n41,s=a.n42,w=a.n43,u=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=l*k*s-j*o*s+j*i*w-h*k*w-l*i*u+h*o*u;b.n12=g*o*s-e*k*s-g*i*w+d*k*w+e*i*u-d*o*u;b.n13=e*j*s-g*l*s+g*h*w-d*j*w-e*h*u+d*l*u;b.n14=g*l*i-e*j*i-g*h*o+d*j*o+e*h*k-d*l*k;b.n21=j*o*r-l*k*r-j*n*w+f*k*w+l*n*u-f*o*u;b.n22=e*k*r-g*o*r+g*n*w-c*k*w-e*n*u+c*o*u;b.n23=g*l*r-e*j*r-g*f*w+c*j*w+e*f*u-c*l*u;b.n24=
-e*j*n-g*l*n+g*f*o-c*j*o-e*f*k+c*l*k;b.n31=h*k*r-j*i*r+j*n*s-f*k*s-h*n*u+f*i*u;b.n32=g*i*r-d*k*r-g*n*s+c*k*s+d*n*u-c*i*u;b.n33=e*j*r-g*h*r+g*f*s-c*j*s-d*f*u+c*h*u;b.n34=g*h*n-d*j*n-g*f*i+c*j*i+d*f*k-c*h*k;b.n41=l*i*r-h*o*r-l*n*s+f*o*s+h*n*w-f*i*w;b.n42=d*o*r-e*i*r+e*n*s-c*o*s-d*n*w+c*i*w;b.n43=e*h*r-d*l*r-e*f*s+c*l*s+d*f*w-c*h*w;b.n44=d*l*n-e*h*n+e*f*i-c*l*i-d*f*o+c*h*o;b.multiplyScalar(1/a.determinant());return b};
-THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,l=-a.n32*a.n11+a.n31*a.n12,j=a.n23*a.n12-a.n22*a.n13,n=-a.n23*a.n11+a.n21*a.n13,i=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*j;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*g;c[3]=a*f;c[4]=a*h;c[5]=a*l;c[6]=a*j;c[7]=a*n;c[8]=a*i;return b};
-THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=2*e/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*e/(d-c);f.n23=(d+c)/(d-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+e)/(g-e);f.n34=-2*g*e/(g-e);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,d){var e,a=c*Math.tan(a*Math.PI/360);e=-a;return THREE.Matrix4.makeFrustum(e*b,a*b,e,a,c,d)};
-THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,l,j;f=new THREE.Matrix4;h=b-a;l=c-d;j=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/l;f.n23=0;f.n24=-((c+d)/l);f.n31=0;f.n32=0;f.n33=-2/j;f.n34=-((g+e)/j);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
+THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,d=a.n12,e=a.n13,f=a.n14,g=a.n21,h=a.n22,l=a.n23,j=a.n24,n=a.n31,i=a.n32,o=a.n33,k=a.n34,r=a.n41,s=a.n42,w=a.n43,u=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=l*k*s-j*o*s+j*i*w-h*k*w-l*i*u+h*o*u;b.n12=f*o*s-e*k*s-f*i*w+d*k*w+e*i*u-d*o*u;b.n13=e*j*s-f*l*s+f*h*w-d*j*w-e*h*u+d*l*u;b.n14=f*l*i-e*j*i-f*h*o+d*j*o+e*h*k-d*l*k;b.n21=j*o*r-l*k*r-j*n*w+g*k*w+l*n*u-g*o*u;b.n22=e*k*r-f*o*r+f*n*w-c*k*w-e*n*u+c*o*u;b.n23=f*l*r-e*j*r-f*g*w+c*j*w+e*g*u-c*l*u;b.n24=
+e*j*n-f*l*n+f*g*o-c*j*o-e*g*k+c*l*k;b.n31=h*k*r-j*i*r+j*n*s-g*k*s-h*n*u+g*i*u;b.n32=f*i*r-d*k*r-f*n*s+c*k*s+d*n*u-c*i*u;b.n33=e*j*r-f*h*r+f*g*s-c*j*s-d*g*u+c*h*u;b.n34=f*h*n-d*j*n-f*g*i+c*j*i+d*g*k-c*h*k;b.n41=l*i*r-h*o*r-l*n*s+g*o*s+h*n*w-g*i*w;b.n42=d*o*r-e*i*r+e*n*s-c*o*s-d*n*w+c*i*w;b.n43=e*h*r-d*l*r-e*g*s+c*l*s+d*g*w-c*h*w;b.n44=d*l*n-e*h*n+e*g*i-c*l*i-d*g*o+c*h*o;b.multiplyScalar(1/a.determinant());return b};
+THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,f=a.n32*a.n21-a.n31*a.n22,g=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,l=-a.n32*a.n11+a.n31*a.n12,j=a.n23*a.n12-a.n22*a.n13,n=-a.n23*a.n11+a.n21*a.n13,i=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*g+a.n31*j;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*f;c[3]=a*g;c[4]=a*h;c[5]=a*l;c[6]=a*j;c[7]=a*n;c[8]=a*i;return b};
+THREE.Matrix4.makeFrustum=function(a,b,c,d,e,f){var g;g=new THREE.Matrix4;g.n11=2*e/(b-a);g.n12=0;g.n13=(b+a)/(b-a);g.n14=0;g.n21=0;g.n22=2*e/(d-c);g.n23=(d+c)/(d-c);g.n24=0;g.n31=0;g.n32=0;g.n33=-(f+e)/(f-e);g.n34=-2*f*e/(f-e);g.n41=0;g.n42=0;g.n43=-1;g.n44=0;return g};THREE.Matrix4.makePerspective=function(a,b,c,d){var e,a=c*Math.tan(a*Math.PI/360);e=-a;return THREE.Matrix4.makeFrustum(e*b,a*b,e,a,c,d)};
+THREE.Matrix4.makeOrtho=function(a,b,c,d,e,f){var g,h,l,j;g=new THREE.Matrix4;h=b-a;l=c-d;j=f-e;g.n11=2/h;g.n12=0;g.n13=0;g.n14=-((b+a)/h);g.n21=0;g.n22=2/l;g.n23=0;g.n24=-((c+d)/l);g.n31=0;g.n32=0;g.n33=-2/j;g.n34=-((f+e)/j);g.n41=0;g.n42=0;g.n43=0;g.n44=1;return g};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
 !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
-THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this instanceof THREE.Camera?this.matrix.lookAt(this.position,a,this.up):this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&
-this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)===-1){a.parent!==void 0&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.addChildRecurse(a)}},remove:function(a){var b=this,c=this.children.indexOf(a);if(c!==-1){a.parent=void 0;for(this.children.splice(c,1);b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.removeChildRecurse(a)}},getChildByName:function(a,
-b){var c,d,e;c=0;for(d=this.children.length;c<d;c++){e=this.children[c];if(e.name===a)return e;if(b&&(e=e.getChildByName(a,b),e!==void 0))return e}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,
-this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(a,b,c){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||b)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,b=!0;for(var a=0,d=this.children.length;a<d;a++)this.children[a].update(this.matrixWorld,b,c)},addChild:function(a){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");
-this.add(a)},removeChild:function(a){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");this.remove(a)}};THREE.Object3DCount=0;
-THREE.Projector=function(){function a(){var a=l[h]=l[h]||new THREE.RenderableVertex;h++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;return e>=0&&f>=0&&g>=0&&h>=0?!0:e<0&&f<0||g<0&&h<0?!1:(e<0?c=Math.max(c,e/(e-f)):f<0&&(d=Math.min(d,e/(e-f))),g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var d,e,g=[],f,h,l=[],j,n,i=[],o,k=[],r,s,w=[],u,M,R=[],B=[],N=[],O=new THREE.Vector4,t=new THREE.Vector4,
-m=new THREE.Matrix4,C=new THREE.Matrix4,D=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],T=new THREE.Vector4,U=new THREE.Vector4;this.projectVector=function(a,b){m.multiply(b.projectionMatrix,b.matrixWorldInverse);m.multiplyVector3(a);return a};this.unprojectVector=function(a,b){m.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));m.multiplyVector3(a);return a};this.projectObjects=function(a,c,f){var h,k;e=B.length=0;
-h=a.objects;a=0;for(c=h.length;a<c;a++){k=h[a];var j;if(!(j=!k.visible))if(j=k instanceof THREE.Mesh)if(j=k.frustumCulled){a:{j=void 0;for(var i=k.matrixWorld,l=-k.geometry.boundingSphere.radius*Math.max(k.scale.x,Math.max(k.scale.y,k.scale.z)),n=0;n<6;n++)if(j=D[n].x*i.n14+D[n].y*i.n24+D[n].z*i.n34+D[n].w,j<=l){j=!1;break a}j=!0}j=!j}if(!j)j=g[e]=g[e]||new THREE.RenderableObject,e++,d=j,O.copy(k.position),m.multiplyVector3(O),d.object=k,d.z=O.z,B.push(d)}f&&B.sort(b);return B};this.projectScene=
-function(d,e,g){var J=e.near,P=e.far,Q,V,E,B,y,L,H,z,x,q,v,G,O,ea,Z,ba,W;M=s=o=n=N.length=0;e.matrixAutoUpdate&&e.update(void 0,!0);d.update(void 0,!1,e);m.multiply(e.projectionMatrix,e.matrixWorldInverse);D[0].set(m.n41-m.n11,m.n42-m.n12,m.n43-m.n13,m.n44-m.n14);D[1].set(m.n41+m.n11,m.n42+m.n12,m.n43+m.n13,m.n44+m.n14);D[2].set(m.n41+m.n21,m.n42+m.n22,m.n43+m.n23,m.n44+m.n24);D[3].set(m.n41-m.n21,m.n42-m.n22,m.n43-m.n23,m.n44-m.n24);D[4].set(m.n41-m.n31,m.n42-m.n32,m.n43-m.n33,m.n44-m.n34);D[5].set(m.n41+
-m.n31,m.n42+m.n32,m.n43+m.n33,m.n44+m.n34);for(Q=0;Q<6;Q++)x=D[Q],x.divideScalar(Math.sqrt(x.x*x.x+x.y*x.y+x.z*x.z));x=this.projectObjects(d,e,!0);d=0;for(Q=x.length;d<Q;d++)if(q=x[d].object,q.visible)if(v=q.matrixWorld,G=q.matrixRotationWorld,O=q.materials,ea=q.overdraw,h=0,q instanceof THREE.Mesh){Z=q.geometry;B=Z.vertices;ba=Z.faces;Z=Z.faceVertexUvs;V=0;for(E=B.length;V<E;V++)f=a(),f.positionWorld.copy(B[V].position),v.multiplyVector3(f.positionWorld),f.positionScreen.copy(f.positionWorld),m.multiplyVector4(f.positionScreen),
-f.positionScreen.x/=f.positionScreen.w,f.positionScreen.y/=f.positionScreen.w,f.visible=f.positionScreen.z>J&&f.positionScreen.z<P;B=0;for(V=ba.length;B<V;B++){E=ba[B];if(E instanceof THREE.Face3)if(y=l[E.a],L=l[E.b],H=l[E.c],y.visible&&L.visible&&H.visible&&(q.doubleSided||q.flipSided!=(H.positionScreen.x-y.positionScreen.x)*(L.positionScreen.y-y.positionScreen.y)-(H.positionScreen.y-y.positionScreen.y)*(L.positionScreen.x-y.positionScreen.x)<0))z=i[n]=i[n]||new THREE.RenderableFace3,n++,j=z,j.v1.copy(y),
+THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)===
+-1){a.parent!==void 0&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.addChildRecurse(a)}},remove:function(a){var b=this,c=this.children.indexOf(a);if(c!==-1){a.parent=void 0;for(this.children.splice(c,1);b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.removeChildRecurse(a)}},getChildByName:function(a,b){var c,d,e;c=0;for(d=this.children.length;c<d;c++){e=this.children[c];if(e.name===
+a)return e;if(b&&(e=e.getChildByName(a,b),e!==void 0))return e}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(a,b,c){this.matrixAutoUpdate&&
+this.updateMatrix();if(this.matrixWorldNeedsUpdate||b)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,b=!0;for(var a=0,d=this.children.length;a<d;a++)this.children[a].update(this.matrixWorld,b,c)},addChild:function(a){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");this.add(a)},removeChild:function(a){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");
+this.remove(a)}};THREE.Object3DCount=0;
+THREE.Projector=function(){function a(){var a=l[h]=l[h]||new THREE.RenderableVertex;h++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;return e>=0&&f>=0&&g>=0&&h>=0?!0:e<0&&f<0||g<0&&h<0?!1:(e<0?c=Math.max(c,e/(e-f)):f<0&&(d=Math.min(d,e/(e-f))),g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var d,e,f=[],g,h,l=[],j,n,i=[],o,k=[],r,s,w=[],u,M,R=[],B=[],N=[],O=new THREE.Vector4,t=new THREE.Vector4,
+m=new THREE.Matrix4,C=new THREE.Matrix4,D=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],T=new THREE.Vector4,U=new THREE.Vector4;this.projectVector=function(a,b){m.multiply(b.projectionMatrix,b.matrixWorldInverse);m.multiplyVector3(a);return a};this.unprojectVector=function(a,b){m.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));m.multiplyVector3(a);return a};this.projectObjects=function(a,c,g){var h,k;e=B.length=0;
+h=a.objects;a=0;for(c=h.length;a<c;a++){k=h[a];var j;if(!(j=!k.visible))if(j=k instanceof THREE.Mesh)if(j=k.frustumCulled){a:{j=void 0;for(var i=k.matrixWorld,l=-k.geometry.boundingSphere.radius*Math.max(k.scale.x,Math.max(k.scale.y,k.scale.z)),n=0;n<6;n++)if(j=D[n].x*i.n14+D[n].y*i.n24+D[n].z*i.n34+D[n].w,j<=l){j=!1;break a}j=!0}j=!j}if(!j)j=f[e]=f[e]||new THREE.RenderableObject,e++,d=j,O.copy(k.position),m.multiplyVector3(O),d.object=k,d.z=O.z,B.push(d)}g&&B.sort(b);return B};this.projectScene=
+function(d,e,f){var J=e.near,P=e.far,Q,V,E,B,y,L,H,z,x,q,v,G,O,ea,Z,ba,W;M=s=o=n=N.length=0;e.matrixAutoUpdate&&e.update(void 0,!0);d.update(void 0,!1,e);m.multiply(e.projectionMatrix,e.matrixWorldInverse);D[0].set(m.n41-m.n11,m.n42-m.n12,m.n43-m.n13,m.n44-m.n14);D[1].set(m.n41+m.n11,m.n42+m.n12,m.n43+m.n13,m.n44+m.n14);D[2].set(m.n41+m.n21,m.n42+m.n22,m.n43+m.n23,m.n44+m.n24);D[3].set(m.n41-m.n21,m.n42-m.n22,m.n43-m.n23,m.n44-m.n24);D[4].set(m.n41-m.n31,m.n42-m.n32,m.n43-m.n33,m.n44-m.n34);D[5].set(m.n41+
+m.n31,m.n42+m.n32,m.n43+m.n33,m.n44+m.n34);for(Q=0;Q<6;Q++)x=D[Q],x.divideScalar(Math.sqrt(x.x*x.x+x.y*x.y+x.z*x.z));x=this.projectObjects(d,e,!0);d=0;for(Q=x.length;d<Q;d++)if(q=x[d].object,q.visible)if(v=q.matrixWorld,G=q.matrixRotationWorld,O=q.materials,ea=q.overdraw,h=0,q instanceof THREE.Mesh){Z=q.geometry;B=Z.vertices;ba=Z.faces;Z=Z.faceVertexUvs;V=0;for(E=B.length;V<E;V++)g=a(),g.positionWorld.copy(B[V].position),v.multiplyVector3(g.positionWorld),g.positionScreen.copy(g.positionWorld),m.multiplyVector4(g.positionScreen),
+g.positionScreen.x/=g.positionScreen.w,g.positionScreen.y/=g.positionScreen.w,g.visible=g.positionScreen.z>J&&g.positionScreen.z<P;B=0;for(V=ba.length;B<V;B++){E=ba[B];if(E instanceof THREE.Face3)if(y=l[E.a],L=l[E.b],H=l[E.c],y.visible&&L.visible&&H.visible&&(q.doubleSided||q.flipSided!=(H.positionScreen.x-y.positionScreen.x)*(L.positionScreen.y-y.positionScreen.y)-(H.positionScreen.y-y.positionScreen.y)*(L.positionScreen.x-y.positionScreen.x)<0))z=i[n]=i[n]||new THREE.RenderableFace3,n++,j=z,j.v1.copy(y),
 j.v2.copy(L),j.v3.copy(H);else continue;else if(E instanceof THREE.Face4)if(y=l[E.a],L=l[E.b],H=l[E.c],z=l[E.d],y.visible&&L.visible&&H.visible&&z.visible&&(q.doubleSided||q.flipSided!=((z.positionScreen.x-y.positionScreen.x)*(L.positionScreen.y-y.positionScreen.y)-(z.positionScreen.y-y.positionScreen.y)*(L.positionScreen.x-y.positionScreen.x)<0||(L.positionScreen.x-H.positionScreen.x)*(z.positionScreen.y-H.positionScreen.y)-(L.positionScreen.y-H.positionScreen.y)*(z.positionScreen.x-H.positionScreen.x)<
 0)))W=k[o]=k[o]||new THREE.RenderableFace4,o++,j=W,j.v1.copy(y),j.v2.copy(L),j.v3.copy(H),j.v4.copy(z);else continue;j.normalWorld.copy(E.normal);G.multiplyVector3(j.normalWorld);j.centroidWorld.copy(E.centroid);v.multiplyVector3(j.centroidWorld);j.centroidScreen.copy(j.centroidWorld);m.multiplyVector3(j.centroidScreen);H=E.vertexNormals;y=0;for(L=H.length;y<L;y++)z=j.vertexNormalsWorld[y],z.copy(H[y]),G.multiplyVector3(z);y=0;for(L=Z.length;y<L;y++)if(W=Z[y][B]){H=0;for(z=W.length;H<z;H++)j.uvs[y][H]=
 W[H]}j.meshMaterials=O;j.faceMaterials=E.materials;j.overdraw=ea;j.z=j.centroidScreen.z;N.push(j)}}else if(q instanceof THREE.Line){C.multiply(m,v);B=q.geometry.vertices;y=a();y.positionScreen.copy(B[0].position);C.multiplyVector4(y.positionScreen);V=1;for(E=B.length;V<E;V++)if(y=a(),y.positionScreen.copy(B[V].position),C.multiplyVector4(y.positionScreen),L=l[h-2],T.copy(y.positionScreen),U.copy(L.positionScreen),c(T,U))T.multiplyScalar(1/T.w),U.multiplyScalar(1/U.w),v=w[s]=w[s]||new THREE.RenderableLine,
 s++,r=v,r.v1.positionScreen.copy(T),r.v2.positionScreen.copy(U),r.z=Math.max(T.z,U.z),r.materials=q.materials,N.push(r)}else if(q instanceof THREE.Particle&&(t.set(q.matrixWorld.n14,q.matrixWorld.n24,q.matrixWorld.n34,1),m.multiplyVector4(t),t.z/=t.w,t.z>0&&t.z<1))v=R[M]=R[M]||new THREE.RenderableParticle,M++,u=v,u.x=t.x/t.w,u.y=t.y/t.w,u.z=t.z,u.rotation=q.rotation.z,u.scale.x=q.scale.x*Math.abs(u.x-(t.x+e.projectionMatrix.n11)/(t.w+e.projectionMatrix.n14)),u.scale.y=q.scale.y*Math.abs(u.y-(t.y+
-e.projectionMatrix.n22)/(t.w+e.projectionMatrix.n24)),u.materials=q.materials,N.push(u);g&&N.sort(b);return N}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==void 0?d:1)};
-THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),g=Math.cos(c),c=Math.sin(c),f=a*b,h=d*e;this.w=f*g-h*c;this.x=f*c+h*g;this.y=d*b*g+a*e*c;this.z=a*e*g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);
+e.projectionMatrix.n22)/(t.w+e.projectionMatrix.n24)),u.materials=q.materials,N.push(u);f&&N.sort(b);return N}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==void 0?d:1)};
+THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),f=Math.cos(c),c=Math.sin(c),g=a*b,h=d*e;this.w=g*f-h*c;this.x=g*c+h*f;this.y=d*b*f+a*e*c;this.z=a*e*f-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);
 this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var 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,l=this.w,j=l*c+f*e-h*d,n=l*d+h*c-g*e,i=l*e+g*d-f*c,c=-g*
-c-f*d-h*e;b.x=j*l+c*-g+n*-h-i*-f;b.y=n*l+c*-f+i*-g-j*-h;b.z=i*l+c*-h+j*-f-n*-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.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.u=a||0;this.v=b||0};
+this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y=c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-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,f=this.x,g=this.y,h=this.z,l=this.w,j=l*c+g*e-h*d,n=l*d+h*c-f*e,i=l*e+f*d-g*c,c=-f*
+c-g*d-h*e;b.x=j*l+c*-f+n*-h-i*-g;b.y=n*l+c*-g+i*-f-j*-h;b.z=i*l+c*-h+j*-g-n*-f;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 f=Math.acos(e),g=Math.sqrt(1-e*e);if(Math.abs(g)<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)*f)/g;d=Math.sin(d*f)/g;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,f){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=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};
+THREE.Face4=function(a,b,c,d,e,f,g){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=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.UV=function(a,b){this.u=a||0;this.v=b||0};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
 THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
-THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,d=this.vertices.length;c<d;c++)a.multiplyVector3(this.vertices[c].position);c=0;for(d=this.faces.length;c<d;c++){var e=this.faces[c];b.multiplyVector3(e.normal);for(var g=0,f=e.vertexNormals.length;g<f;g++)b.multiplyVector3(e.vertexNormals[g]);a.multiplyVector3(e.centroid)}},computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;a<
+THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,d=this.vertices.length;c<d;c++)a.multiplyVector3(this.vertices[c].position);c=0;for(d=this.faces.length;c<d;c++){var e=this.faces[c];b.multiplyVector3(e.normal);for(var f=0,g=e.vertexNormals.length;f<g;f++)b.multiplyVector3(e.vertexNormals[f]);a.multiplyVector3(e.centroid)}},computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;a<
 b;a++)c=this.faces[a],c.centroid.set(0,0,0),c instanceof THREE.Face3?(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.divideScalar(3)):c instanceof THREE.Face4&&(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.addSelf(this.vertices[c.d].position),c.centroid.divideScalar(4))},computeFaceNormals:function(a){var b,
-c,d,e,g,f,h=new THREE.Vector3,l=new THREE.Vector3;d=0;for(e=this.faces.length;d<e;d++){g=this.faces[d];if(a&&g.vertexNormals.length){h.set(0,0,0);b=0;for(c=g.vertexNormals.length;b<c;b++)h.addSelf(g.vertexNormals[b]);h.divideScalar(3)}else b=this.vertices[g.a],c=this.vertices[g.b],f=this.vertices[g.c],h.sub(f.position,c.position),l.sub(b.position,c.position),h.crossSelf(l);h.isZero()||h.normalize();g.normal.copy(h)}},computeVertexNormals:function(){var a,b,c,d;if(this.__tmpVertices==void 0){d=this.__tmpVertices=
+c,d,e,f,g,h=new THREE.Vector3,l=new THREE.Vector3;d=0;for(e=this.faces.length;d<e;d++){f=this.faces[d];if(a&&f.vertexNormals.length){h.set(0,0,0);b=0;for(c=f.vertexNormals.length;b<c;b++)h.addSelf(f.vertexNormals[b]);h.divideScalar(3)}else b=this.vertices[f.a],c=this.vertices[f.b],g=this.vertices[f.c],h.sub(g.position,c.position),l.sub(b.position,c.position),h.crossSelf(l);h.isZero()||h.normalize();f.normal.copy(h)}},computeVertexNormals:function(){var a,b,c,d;if(this.__tmpVertices==void 0){d=this.__tmpVertices=
 Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)d[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)if(c=this.faces[a],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{d=this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)d[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof
 THREE.Face3?(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal)):c instanceof THREE.Face4&&(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal),d[c.d].addSelf(c.normal));a=0;for(b=this.vertices.length;a<b;a++)d[a].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(c.vertexNormals[0].copy(d[c.a]),c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c])):c instanceof THREE.Face4&&(c.vertexNormals[0].copy(d[c.a]),
-c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c]),c.vertexNormals[3].copy(d[c.d]))},computeTangents:function(){function a(a,b,c,d,e,g,m){h=a.vertices[b].position;l=a.vertices[c].position;j=a.vertices[d].position;n=f[e];i=f[g];o=f[m];k=l.x-h.x;r=j.x-h.x;s=l.y-h.y;w=j.y-h.y;u=l.z-h.z;M=j.z-h.z;R=i.u-n.u;B=o.u-n.u;N=i.v-n.v;O=o.v-n.v;t=1/(R*O-B*N);T.set((O*k-N*r)*t,(O*s-N*w)*t,(O*u-N*M)*t);U.set((R*r-B*k)*t,(R*w-B*s)*t,(R*M-B*u)*t);C[b].addSelf(T);C[c].addSelf(T);C[d].addSelf(T);D[b].addSelf(U);
-D[c].addSelf(U);D[d].addSelf(U)}var b,c,d,e,g,f,h,l,j,n,i,o,k,r,s,w,u,M,R,B,N,O,t,m,C=[],D=[],T=new THREE.Vector3,U=new THREE.Vector3,F=new THREE.Vector3,K=new THREE.Vector3,I=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)C[b]=new THREE.Vector3,D[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)g=this.faces[b],f=this.faceVertexUvs[0][b],g instanceof THREE.Face3?a(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(a(this,g.a,g.b,g.c,0,1,2),a(this,g.a,g.b,g.d,0,1,3));var J=["a","b",
-"c","d"];b=0;for(c=this.faces.length;b<c;b++){g=this.faces[b];for(d=0;d<g.vertexNormals.length;d++)I.copy(g.vertexNormals[d]),e=g[J[d]],m=C[e],F.copy(m),F.subSelf(I.multiplyScalar(I.dot(m))).normalize(),K.cross(g.vertexNormals[d],m),e=K.dot(D[e]),e=e<0?-1:1,g.vertexTangents[d]=new THREE.Vector4(F.x,F.y,F.z,e)}this.hasTangents=!0},computeBoundingBox:function(){var a;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,
+c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c]),c.vertexNormals[3].copy(d[c.d]))},computeTangents:function(){function a(a,b,c,d,e,f,m){h=a.vertices[b].position;l=a.vertices[c].position;j=a.vertices[d].position;n=g[e];i=g[f];o=g[m];k=l.x-h.x;r=j.x-h.x;s=l.y-h.y;w=j.y-h.y;u=l.z-h.z;M=j.z-h.z;R=i.u-n.u;B=o.u-n.u;N=i.v-n.v;O=o.v-n.v;t=1/(R*O-B*N);T.set((O*k-N*r)*t,(O*s-N*w)*t,(O*u-N*M)*t);U.set((R*r-B*k)*t,(R*w-B*s)*t,(R*M-B*u)*t);C[b].addSelf(T);C[c].addSelf(T);C[d].addSelf(T);D[b].addSelf(U);
+D[c].addSelf(U);D[d].addSelf(U)}var b,c,d,e,f,g,h,l,j,n,i,o,k,r,s,w,u,M,R,B,N,O,t,m,C=[],D=[],T=new THREE.Vector3,U=new THREE.Vector3,F=new THREE.Vector3,K=new THREE.Vector3,I=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)C[b]=new THREE.Vector3,D[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)f=this.faces[b],g=this.faceVertexUvs[0][b],f instanceof THREE.Face3?a(this,f.a,f.b,f.c,0,1,2):f instanceof THREE.Face4&&(a(this,f.a,f.b,f.c,0,1,2),a(this,f.a,f.b,f.d,0,1,3));var J=["a","b",
+"c","d"];b=0;for(c=this.faces.length;b<c;b++){f=this.faces[b];for(d=0;d<f.vertexNormals.length;d++)I.copy(f.vertexNormals[d]),e=f[J[d]],m=C[e],F.copy(m),F.subSelf(I.multiplyScalar(I.dot(m))).normalize(),K.cross(f.vertexNormals[d],m),e=K.dot(D[e]),e=e<0?-1:1,f.vertexTangents[d]=new THREE.Vector4(F.x,F.y,F.z,e)}this.hasTangents=!0},computeBoundingBox:function(){var a;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 b=1,c=this.vertices.length;b<c;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=
-a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},computeEdgeFaces:function(){function a(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}function b(a,b,c){a[b]===void 0?(a[b]={set:{},array:[]},a[b].set[c]=1,a[b].array.push(c)):a[b].set[c]===void 0&&(a[b].set[c]=1,a[b].array.push(c))}var c,d,e,g,f,h=
-{};c=0;for(d=this.faces.length;c<d;c++)f=this.faces[c],f instanceof THREE.Face3?(e=a(f.a,f.b),b(h,e,c),e=a(f.b,f.c),b(h,e,c),e=a(f.a,f.c),b(h,e,c)):f instanceof THREE.Face4&&(e=a(f.b,f.d),b(h,e,c),e=a(f.a,f.b),b(h,e,c),e=a(f.a,f.d),b(h,e,c),e=a(f.b,f.c),b(h,e,c),e=a(f.c,f.d),b(h,e,c));c=0;for(d=this.edges.length;c<d;c++){f=this.edges[c];e=f.vertexIndices[0];g=f.vertexIndices[1];f.faceIndices=h[a(e,g)].array;for(e=0;e<f.faceIndices.length;e++)g=f.faceIndices[e],f.faces.push(this.faces[g])}}};
-THREE.GeometryCount=0;THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.target=e||new THREE.Object3D;this.useTarget=!1;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;
-THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);b.multiplyScalar(a);this.position.addSelf(b);this.target.position.addSelf(b)};
-THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
-THREE.Camera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};
-THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),b=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
-!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};THREE.OrthoCamera=function(a,b,c,d,e,g,f){THREE.Camera.call(this,45,1,e,g,f);this.left=a;this.right=b;this.top=c;this.bottom=d;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
-THREE.OrthoCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;
+a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},computeEdgeFaces:function(){function a(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}function b(a,b,c){a[b]===void 0?(a[b]={set:{},array:[]},a[b].set[c]=1,a[b].array.push(c)):a[b].set[c]===void 0&&(a[b].set[c]=1,a[b].array.push(c))}var c,d,e,f,g,h=
+{};c=0;for(d=this.faces.length;c<d;c++)g=this.faces[c],g instanceof THREE.Face3?(e=a(g.a,g.b),b(h,e,c),e=a(g.b,g.c),b(h,e,c),e=a(g.a,g.c),b(h,e,c)):g instanceof THREE.Face4&&(e=a(g.b,g.d),b(h,e,c),e=a(g.a,g.b),b(h,e,c),e=a(g.a,g.d),b(h,e,c),e=a(g.b,g.c),b(h,e,c),e=a(g.c,g.d),b(h,e,c));c=0;for(d=this.edges.length;c<d;c++){g=this.edges[c];e=g.vertexIndices[0];f=g.vertexIndices[1];g.faceIndices=h[a(e,f)].array;for(e=0;e<g.faceIndices.length;e++)f=g.faceIndices[e],g.faces.push(this.faces[f])}}};
+THREE.GeometryCount=0;THREE.Camera=function(){THREE.Object3D.call(this);arguments.length&&console.warn("DEPRECATED: Camera() is now PerspectiveCamera().");this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};
+THREE.Camera.prototype.update=function(a,b,c){this.matrixAutoUpdate&&this.updateMatrix();if(b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};
+THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=e!==void 0?e:0.1;this.far=f!==void 0?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};
+THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a||50;this.aspect=b||1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;
+THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,
+this.far)};THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
 THREE.Material=function(a){this.name="";this.id=THREE.MaterialCount++;a=a||{};this.opacity=a.opacity!==void 0?a.opacity:1;this.transparent=a.transparent!==void 0?a.transparent:!1;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.depthTest=a.depthTest!==void 0?a.depthTest:!0;this.depthWrite=a.depthWrite!==void 0?a.depthWrite:!0;this.polygonOffset=a.polygonOffset!==void 0?a.polygonOffset:!1;this.polygonOffsetFactor=a.polygonOffsetFactor!==void 0?a.polygonOffsetFactor:0;this.polygonOffsetUnits=
@@ -110,7 +109,7 @@ THREE.MeshDepthMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.sha
 THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading?a.shading:THREE.FlatShading;this.wireframe=a.wireframe?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth?a.wireframeLinewidth:1};THREE.MeshNormalMaterial.prototype=new THREE.Material;THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial;THREE.MeshFaceMaterial=function(){};
 THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:null;this.size=a.size!==void 0?a.size:1;this.sizeAttenuation=a.sizeAttenuation!==void 0?a.sizeAttenuation:!0;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.fog=a.fog!==void 0?a.fog:!0};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
 THREE.ParticleCanvasMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.program=a.program!==void 0?a.program:function(){}};THREE.ParticleCanvasMaterial.prototype=new THREE.Material;THREE.ParticleCanvasMaterial.prototype.constructor=THREE.ParticleCanvasMaterial;
-THREE.Texture=function(a,b,c,d,e,g){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=d!==void 0?d:THREE.ClampToEdgeWrapping;this.magFilter=e!==void 0?e:THREE.LinearFilter;this.minFilter=g!==void 0?g:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
+THREE.Texture=function(a,b,c,d,e,f){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=d!==void 0?d:THREE.ClampToEdgeWrapping;this.magFilter=e!==void 0?e:THREE.LinearFilter;this.minFilter=f!==void 0?f:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
 THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
 THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;
 THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.type=c!=void 0?c:THREE.LineStrip};
@@ -125,30 +124,30 @@ THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)th
 THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),b!==-1&&this.__objectsAdded.splice(b,1)));for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};
 THREE.Scene.prototype.addChild=function(a){console.warn("DEPRECATED: Scene.addChild() is now Scene.add().");this.add(a)};THREE.Scene.prototype.addObject=function(a){console.warn("DEPRECATED: Scene.addObject() is now Scene.add().");this.add(a)};THREE.Scene.prototype.addLight=function(a){console.warn("DEPRECATED: Scene.addLight() is now Scene.add().");this.add(a)};THREE.Scene.prototype.removeChild=function(a){console.warn("DEPRECATED: Scene.removeChild() is now Scene.remove().");this.remove(a)};
 THREE.Scene.prototype.removeObject=function(a){console.warn("DEPRECATED: Scene.removeObject() is now Scene.remove().");this.remove(a)};THREE.Scene.prototype.removeLight=function(a){console.warn("DEPRECATED: Scene.removeLight() is now Scene.remove().");this.remove(a)};
-THREE.CanvasRenderer=function(a){function b(a){if(w!=a)k.globalAlpha=w=a}function c(a){if(u!=a){switch(a){case THREE.NormalBlending:k.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:k.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:k.globalCompositeOperation="darker"}u=a}}function d(a){if(M!=a)k.strokeStyle=M=a}function e(a){if(R!=a)k.fillStyle=R=a}var g=this,f=null,h=new THREE.Projector,a=a||{},l=a.canvas!==void 0?a.canvas:document.createElement("canvas"),
+THREE.CanvasRenderer=function(a){function b(a){if(w!=a)k.globalAlpha=w=a}function c(a){if(u!=a){switch(a){case THREE.NormalBlending:k.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:k.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:k.globalCompositeOperation="darker"}u=a}}function d(a){if(M!=a)k.strokeStyle=M=a}function e(a){if(R!=a)k.fillStyle=R=a}var f=this,g=null,h=new THREE.Projector,a=a||{},l=a.canvas!==void 0?a.canvas:document.createElement("canvas"),
 j,n,i,o,k=l.getContext("2d"),r=new THREE.Color(0),s=0,w=1,u=0,M=null,R=null,B=null,N=null,O=null,t,m,C,D,T=new THREE.RenderableVertex,U=new THREE.RenderableVertex,F,K,I,J,P,Q,V,E,pa,y,L,H,z=new THREE.Color(0),x=new THREE.Color(0),q=new THREE.Color(0),v=new THREE.Color(0),G=new THREE.Color(0),za=[],ea,Z,ba,W,Da,Ea,Fa,Ga,Ha,Ia,ka=new THREE.Rectangle,$=new THREE.Rectangle,Y=new THREE.Rectangle,Aa=!1,ca=new THREE.Color,aa=new THREE.Color,ta=new THREE.Color,ua=new THREE.Color,S=new THREE.Vector3,qa,ra,
 Ba,da,sa,va,a=16;qa=document.createElement("canvas");qa.width=qa.height=2;ra=qa.getContext("2d");ra.fillStyle="rgba(0,0,0,1)";ra.fillRect(0,0,2,2);Ba=ra.getImageData(0,0,2,2);da=Ba.data;sa=document.createElement("canvas");sa.width=sa.height=a;va=sa.getContext("2d");va.translate(-a/2,-a/2);va.scale(a,a);a--;this.domElement=l;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setSize=function(a,b){j=a;n=b;i=Math.floor(j/2);o=Math.floor(n/2);l.width=j;l.height=
 n;ka.set(-i,-o,i,o);$.set(-i,-o,i,o);w=1;u=0;O=N=B=R=M=null};this.setClearColor=function(a,b){r.copy(a);s=b;$.set(-i,-o,i,o)};this.setClearColorHex=function(a,b){r.setHex(a);s=b;$.set(-i,-o,i,o)};this.clear=function(){k.setTransform(1,0,0,-1,i,o);$.isEmpty()||($.minSelf(ka),$.inflate(2),s<1&&k.clearRect(Math.floor($.getX()),Math.floor($.getY()),Math.floor($.getWidth()),Math.floor($.getHeight())),s>0&&(c(THREE.NormalBlending),b(1),e("rgba("+Math.floor(r.r*255)+","+Math.floor(r.g*255)+","+Math.floor(r.b*
 255)+","+s+")"),k.fillRect(Math.floor($.getX()),Math.floor($.getY()),Math.floor($.getWidth()),Math.floor($.getHeight()))),$.empty())};this.render=function(a,j){function l(a){var b,c,d,e=a.lights;aa.setRGB(0,0,0);ta.setRGB(0,0,0);ua.setRGB(0,0,0);a=0;for(b=e.length;a<b;a++)c=e[a],d=c.color,c instanceof THREE.AmbientLight?(aa.r+=d.r,aa.g+=d.g,aa.b+=d.b):c instanceof THREE.DirectionalLight?(ta.r+=d.r,ta.g+=d.g,ta.b+=d.b):c instanceof THREE.PointLight&&(ua.r+=d.r,ua.g+=d.g,ua.b+=d.b)}function n(a,b,c,
 d){var e,f,g,h,k=a.lights,a=0;for(e=k.length;a<e;a++)f=k[a],g=f.color,f instanceof THREE.DirectionalLight?(h=c.dot(f.position),h<=0||(h*=f.intensity,d.r+=g.r*h,d.g+=g.g*h,d.b+=g.b*h)):f instanceof THREE.PointLight&&(h=c.dot(S.sub(f.position,b).normalize()),h<=0||(h*=f.distance==0?1:1-Math.min(b.distanceTo(f.position)/f.distance,1),h!=0&&(h*=f.intensity,d.r+=g.r*h,d.g+=g.g*h,d.b+=g.b*h)))}function r(a,f,g){b(g.opacity);c(g.blending);var h,j,n,l,p,m;if(g instanceof THREE.ParticleBasicMaterial){if(g.map)l=
 g.map.image,p=l.width>>1,m=l.height>>1,g=f.scale.x*i,n=f.scale.y*o,h=g*p,j=n*m,Y.set(a.x-h,a.y-j,a.x+h,a.y+j),ka.intersects(Y)&&(k.save(),k.translate(a.x,a.y),k.rotate(-f.rotation),k.scale(g,-n),k.translate(-p,-m),k.drawImage(l,0,0),k.restore())}else g instanceof THREE.ParticleCanvasMaterial&&(h=f.scale.x*i,j=f.scale.y*o,Y.set(a.x-h,a.y-j,a.x+h,a.y+j),ka.intersects(Y)&&(d(g.color.getContextStyle()),e(g.color.getContextStyle()),k.save(),k.translate(a.x,a.y),k.rotate(-f.rotation),k.scale(h,j),g.program(k),
-k.restore()))}function s(a,e,f,g){b(g.opacity);c(g.blending);k.beginPath();k.moveTo(a.positionScreen.x,a.positionScreen.y);k.lineTo(e.positionScreen.x,e.positionScreen.y);k.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(B!=a)k.lineWidth=B=a;a=g.linecap;if(N!=a)k.lineCap=N=a;a=g.linejoin;if(O!=a)k.lineJoin=O=a;d(g.color.getContextStyle());k.stroke();Y.inflate(g.linewidth*2)}}function u(a,d,e,f,h,k,i,p,l){g.info.render.vertices+=3;g.info.render.faces++;b(p.opacity);c(p.blending);
-F=a.positionScreen.x;K=a.positionScreen.y;I=d.positionScreen.x;J=d.positionScreen.y;P=e.positionScreen.x;Q=e.positionScreen.y;M(F,K,I,J,P,Q);if(p instanceof THREE.MeshBasicMaterial)if(p.map)p.map.mapping instanceof THREE.UVMapping&&(W=i.uvs[0],Ca(F,K,I,J,P,Q,W[f].u,W[f].v,W[h].u,W[h].v,W[k].u,W[k].v,p.map));else if(p.envMap){if(p.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=j.matrixWorldInverse,S.copy(i.vertexNormalsWorld[0]),Da=(S.x*a.n11+S.y*a.n12+S.z*a.n13)*0.5+0.5,Ea=-(S.x*a.n21+
+k.restore()))}function s(a,e,f,g){b(g.opacity);c(g.blending);k.beginPath();k.moveTo(a.positionScreen.x,a.positionScreen.y);k.lineTo(e.positionScreen.x,e.positionScreen.y);k.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(B!=a)k.lineWidth=B=a;a=g.linecap;if(N!=a)k.lineCap=N=a;a=g.linejoin;if(O!=a)k.lineJoin=O=a;d(g.color.getContextStyle());k.stroke();Y.inflate(g.linewidth*2)}}function u(a,d,e,g,h,k,i,p,l){f.info.render.vertices+=3;f.info.render.faces++;b(p.opacity);c(p.blending);
+F=a.positionScreen.x;K=a.positionScreen.y;I=d.positionScreen.x;J=d.positionScreen.y;P=e.positionScreen.x;Q=e.positionScreen.y;M(F,K,I,J,P,Q);if(p instanceof THREE.MeshBasicMaterial)if(p.map)p.map.mapping instanceof THREE.UVMapping&&(W=i.uvs[0],Ca(F,K,I,J,P,Q,W[g].u,W[g].v,W[h].u,W[h].v,W[k].u,W[k].v,p.map));else if(p.envMap){if(p.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=j.matrixWorldInverse,S.copy(i.vertexNormalsWorld[0]),Da=(S.x*a.n11+S.y*a.n12+S.z*a.n13)*0.5+0.5,Ea=-(S.x*a.n21+
 S.y*a.n22+S.z*a.n23)*0.5+0.5,S.copy(i.vertexNormalsWorld[1]),Fa=(S.x*a.n11+S.y*a.n12+S.z*a.n13)*0.5+0.5,Ga=-(S.x*a.n21+S.y*a.n22+S.z*a.n23)*0.5+0.5,S.copy(i.vertexNormalsWorld[2]),Ha=(S.x*a.n11+S.y*a.n12+S.z*a.n13)*0.5+0.5,Ia=-(S.x*a.n21+S.y*a.n22+S.z*a.n23)*0.5+0.5,Ca(F,K,I,J,P,Q,Da,Ea,Fa,Ga,Ha,Ia,p.envMap)}else p.wireframe?ga(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):ha(p.color);else if(p instanceof THREE.MeshLambertMaterial)p.map&&!p.wireframe&&(p.map.mapping instanceof
-THREE.UVMapping&&(W=i.uvs[0],Ca(F,K,I,J,P,Q,W[f].u,W[f].v,W[h].u,W[h].v,W[k].u,W[k].v,p.map)),c(THREE.SubtractiveBlending)),Aa?!p.wireframe&&p.shading==THREE.SmoothShading&&i.vertexNormalsWorld.length==3?(x.r=q.r=v.r=aa.r,x.g=q.g=v.g=aa.g,x.b=q.b=v.b=aa.b,n(l,i.v1.positionWorld,i.vertexNormalsWorld[0],x),n(l,i.v2.positionWorld,i.vertexNormalsWorld[1],q),n(l,i.v3.positionWorld,i.vertexNormalsWorld[2],v),x.r=Math.max(0,Math.min(p.color.r*x.r,1)),x.g=Math.max(0,Math.min(p.color.g*x.g,1)),x.b=Math.max(0,
+THREE.UVMapping&&(W=i.uvs[0],Ca(F,K,I,J,P,Q,W[g].u,W[g].v,W[h].u,W[h].v,W[k].u,W[k].v,p.map)),c(THREE.SubtractiveBlending)),Aa?!p.wireframe&&p.shading==THREE.SmoothShading&&i.vertexNormalsWorld.length==3?(x.r=q.r=v.r=aa.r,x.g=q.g=v.g=aa.g,x.b=q.b=v.b=aa.b,n(l,i.v1.positionWorld,i.vertexNormalsWorld[0],x),n(l,i.v2.positionWorld,i.vertexNormalsWorld[1],q),n(l,i.v3.positionWorld,i.vertexNormalsWorld[2],v),x.r=Math.max(0,Math.min(p.color.r*x.r,1)),x.g=Math.max(0,Math.min(p.color.g*x.g,1)),x.b=Math.max(0,
 Math.min(p.color.b*x.b,1)),q.r=Math.max(0,Math.min(p.color.r*q.r,1)),q.g=Math.max(0,Math.min(p.color.g*q.g,1)),q.b=Math.max(0,Math.min(p.color.b*q.b,1)),v.r=Math.max(0,Math.min(p.color.r*v.r,1)),v.g=Math.max(0,Math.min(p.color.g*v.g,1)),v.b=Math.max(0,Math.min(p.color.b*v.b,1)),G.r=(q.r+v.r)*0.5,G.g=(q.g+v.g)*0.5,G.b=(q.b+v.b)*0.5,ba=wa(x,q,v,G),ma(F,K,I,J,P,Q,0,0,1,0,0,1,ba)):(ca.r=aa.r,ca.g=aa.g,ca.b=aa.b,n(l,i.centroidWorld,i.normalWorld,ca),z.r=Math.max(0,Math.min(p.color.r*ca.r,1)),z.g=Math.max(0,
 Math.min(p.color.g*ca.g,1)),z.b=Math.max(0,Math.min(p.color.b*ca.b,1)),p.wireframe?ga(z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):ha(z)):p.wireframe?ga(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):ha(p.color);else if(p instanceof THREE.MeshDepthMaterial)ea=j.near,Z=j.far,x.r=x.g=x.b=1-la(a.positionScreen.z,ea,Z),q.r=q.g=q.b=1-la(d.positionScreen.z,ea,Z),v.r=v.g=v.b=1-la(e.positionScreen.z,ea,Z),G.r=(q.r+v.r)*0.5,G.g=(q.g+v.g)*0.5,G.b=(q.b+v.b)*0.5,ba=wa(x,
-q,v,G),ma(F,K,I,J,P,Q,0,0,1,0,0,1,ba);else if(p instanceof THREE.MeshNormalMaterial)z.r=na(i.normalWorld.x),z.g=na(i.normalWorld.y),z.b=na(i.normalWorld.z),p.wireframe?ga(z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):ha(z)}function w(a,d,e,f,h,k,i,p,l){g.info.render.vertices+=4;g.info.render.faces++;b(p.opacity);c(p.blending);if(p.map||p.envMap)u(a,d,f,0,1,3,i,p,l),u(h,e,k,1,2,3,i,p,l);else if(F=a.positionScreen.x,K=a.positionScreen.y,I=d.positionScreen.x,J=d.positionScreen.y,P=e.positionScreen.x,
-Q=e.positionScreen.y,V=f.positionScreen.x,E=f.positionScreen.y,pa=h.positionScreen.x,y=h.positionScreen.y,L=k.positionScreen.x,H=k.positionScreen.y,p instanceof THREE.MeshBasicMaterial)R(F,K,I,J,P,Q,V,E),p.wireframe?ga(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):ha(p.color);else if(p instanceof THREE.MeshLambertMaterial)Aa?!p.wireframe&&p.shading==THREE.SmoothShading&&i.vertexNormalsWorld.length==4?(x.r=q.r=v.r=G.r=aa.r,x.g=q.g=v.g=G.g=aa.g,x.b=q.b=v.b=G.b=aa.b,n(l,i.v1.positionWorld,
+q,v,G),ma(F,K,I,J,P,Q,0,0,1,0,0,1,ba);else if(p instanceof THREE.MeshNormalMaterial)z.r=na(i.normalWorld.x),z.g=na(i.normalWorld.y),z.b=na(i.normalWorld.z),p.wireframe?ga(z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):ha(z)}function w(a,d,e,g,h,k,i,p,l){f.info.render.vertices+=4;f.info.render.faces++;b(p.opacity);c(p.blending);if(p.map||p.envMap)u(a,d,g,0,1,3,i,p,l),u(h,e,k,1,2,3,i,p,l);else if(F=a.positionScreen.x,K=a.positionScreen.y,I=d.positionScreen.x,J=d.positionScreen.y,P=e.positionScreen.x,
+Q=e.positionScreen.y,V=g.positionScreen.x,E=g.positionScreen.y,pa=h.positionScreen.x,y=h.positionScreen.y,L=k.positionScreen.x,H=k.positionScreen.y,p instanceof THREE.MeshBasicMaterial)R(F,K,I,J,P,Q,V,E),p.wireframe?ga(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):ha(p.color);else if(p instanceof THREE.MeshLambertMaterial)Aa?!p.wireframe&&p.shading==THREE.SmoothShading&&i.vertexNormalsWorld.length==4?(x.r=q.r=v.r=G.r=aa.r,x.g=q.g=v.g=G.g=aa.g,x.b=q.b=v.b=G.b=aa.b,n(l,i.v1.positionWorld,
 i.vertexNormalsWorld[0],x),n(l,i.v2.positionWorld,i.vertexNormalsWorld[1],q),n(l,i.v4.positionWorld,i.vertexNormalsWorld[3],v),n(l,i.v3.positionWorld,i.vertexNormalsWorld[2],G),x.r=Math.max(0,Math.min(p.color.r*x.r,1)),x.g=Math.max(0,Math.min(p.color.g*x.g,1)),x.b=Math.max(0,Math.min(p.color.b*x.b,1)),q.r=Math.max(0,Math.min(p.color.r*q.r,1)),q.g=Math.max(0,Math.min(p.color.g*q.g,1)),q.b=Math.max(0,Math.min(p.color.b*q.b,1)),v.r=Math.max(0,Math.min(p.color.r*v.r,1)),v.g=Math.max(0,Math.min(p.color.g*
 v.g,1)),v.b=Math.max(0,Math.min(p.color.b*v.b,1)),G.r=Math.max(0,Math.min(p.color.r*G.r,1)),G.g=Math.max(0,Math.min(p.color.g*G.g,1)),G.b=Math.max(0,Math.min(p.color.b*G.b,1)),ba=wa(x,q,v,G),M(F,K,I,J,V,E),ma(F,K,I,J,V,E,0,0,1,0,0,1,ba),M(pa,y,P,Q,L,H),ma(pa,y,P,Q,L,H,1,0,1,1,0,1,ba)):(ca.r=aa.r,ca.g=aa.g,ca.b=aa.b,n(l,i.centroidWorld,i.normalWorld,ca),z.r=Math.max(0,Math.min(p.color.r*ca.r,1)),z.g=Math.max(0,Math.min(p.color.g*ca.g,1)),z.b=Math.max(0,Math.min(p.color.b*ca.b,1)),R(F,K,I,J,P,Q,V,E),
 p.wireframe?ga(z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):ha(z)):(R(F,K,I,J,P,Q,V,E),p.wireframe?ga(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):ha(p.color));else if(p instanceof THREE.MeshNormalMaterial)z.r=na(i.normalWorld.x),z.g=na(i.normalWorld.y),z.b=na(i.normalWorld.z),R(F,K,I,J,P,Q,V,E),p.wireframe?ga(z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):ha(z);else if(p instanceof THREE.MeshDepthMaterial)ea=j.near,Z=j.far,x.r=x.g=x.b=1-la(a.positionScreen.z,
-ea,Z),q.r=q.g=q.b=1-la(d.positionScreen.z,ea,Z),v.r=v.g=v.b=1-la(f.positionScreen.z,ea,Z),G.r=G.g=G.b=1-la(e.positionScreen.z,ea,Z),ba=wa(x,q,v,G),M(F,K,I,J,V,E),ma(F,K,I,J,V,E,0,0,1,0,0,1,ba),M(pa,y,P,Q,L,H),ma(pa,y,P,Q,L,H,1,0,1,1,0,1,ba)}function M(a,b,c,d,e,f){k.beginPath();k.moveTo(a,b);k.lineTo(c,d);k.lineTo(e,f);k.lineTo(a,b);k.closePath()}function R(a,b,c,d,e,f,g,h){k.beginPath();k.moveTo(a,b);k.lineTo(c,d);k.lineTo(e,f);k.lineTo(g,h);k.lineTo(a,b);k.closePath()}function ga(a,b,c,e){if(B!=
+ea,Z),q.r=q.g=q.b=1-la(d.positionScreen.z,ea,Z),v.r=v.g=v.b=1-la(g.positionScreen.z,ea,Z),G.r=G.g=G.b=1-la(e.positionScreen.z,ea,Z),ba=wa(x,q,v,G),M(F,K,I,J,V,E),ma(F,K,I,J,V,E,0,0,1,0,0,1,ba),M(pa,y,P,Q,L,H),ma(pa,y,P,Q,L,H,1,0,1,1,0,1,ba)}function M(a,b,c,d,e,f){k.beginPath();k.moveTo(a,b);k.lineTo(c,d);k.lineTo(e,f);k.lineTo(a,b);k.closePath()}function R(a,b,c,d,e,f,g,h){k.beginPath();k.moveTo(a,b);k.lineTo(c,d);k.lineTo(e,f);k.lineTo(g,h);k.lineTo(a,b);k.closePath()}function ga(a,b,c,e){if(B!=
 b)k.lineWidth=B=b;if(N!=c)k.lineCap=N=c;if(O!=e)k.lineJoin=O=e;d(a.getContextStyle());k.stroke();Y.inflate(b*2)}function ha(a){e(a.getContextStyle());k.fill()}function Ca(a,b,c,d,f,g,h,i,j,l,n,o,m){if(m.image.width!=0){if(m.needsUpdate==!0||za[m.id]==void 0){var q=m.wrapS==THREE.RepeatWrapping,r=m.wrapT==THREE.RepeatWrapping;za[m.id]=k.createPattern(m.image,q&&r?"repeat":q&&!r?"repeat-x":!q&&r?"repeat-y":"no-repeat");m.needsUpdate=!1}e(za[m.id]);var q=m.offset.x/m.repeat.x,r=m.offset.y/m.repeat.y,
 s=(m.image.width-1)*m.repeat.x,m=(m.image.height-1)*m.repeat.y,h=(h+q)*s,i=(i+r)*m,j=(j+q)*s,l=(l+r)*m,n=(n+q)*s,o=(o+r)*m;c-=a;d-=b;f-=a;g-=b;j-=h;l-=i;n-=h;o-=i;q=1/(j*o-n*l);m=(o*c-l*f)*q;l=(o*d-l*g)*q;c=(j*f-n*c)*q;d=(j*g-n*d)*q;a=a-m*h-c*i;b=b-l*h-d*i;k.save();k.transform(m,l,c,d,a,b);k.fill();k.restore()}}function ma(a,b,c,d,e,f,g,h,i,j,l,m,n){var o,q;o=n.width-1;q=n.height-1;g*=o;h*=q;i*=o;j*=q;l*=o;m*=q;c-=a;d-=b;e-=a;f-=b;i-=g;j-=h;l-=g;m-=h;q=1/(i*m-l*j);o=(m*c-j*e)*q;j=(m*d-j*f)*q;c=(i*
 e-l*c)*q;d=(i*f-l*d)*q;a=a-o*g-c*h;b=b-j*g-d*h;k.save();k.transform(o,j,c,d,a,b);k.clip();k.drawImage(n,0,0);k.restore()}function wa(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),i=~~(c.r*255),j=~~(c.g*255),c=~~(c.b*255),k=~~(d.r*255),l=~~(d.g*255),d=~~(d.b*255);da[0]=e<0?0:e>255?255:e;da[1]=f<0?0:f>255?255:f;da[2]=a<0?0:a>255?255:a;da[4]=g<0?0:g>255?255:g;da[5]=h<0?0:h>255?255:h;da[6]=b<0?0:b>255?255:b;da[8]=i<0?0:i>255?255:i;da[9]=j<0?0:j>255?255:
-j;da[10]=c<0?0:c>255?255:c;da[12]=k<0?0:k>255?255:k;da[13]=l<0?0:l>255?255:l;da[14]=d<0?0:d>255?255:d;ra.putImageData(Ba,0,0);va.drawImage(qa,0,0);return sa}function la(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function na(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function ia(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;e!=0&&(e=1/Math.sqrt(e),c*=e,d*=e,b.x+=c,b.y+=d,a.x-=c,a.y-=d)}var xa,Ja,A,fa,ja,oa,ya,X;this.autoClear?this.clear():k.setTransform(1,0,0,-1,i,o);g.info.render.vertices=0;g.info.render.faces=0;
-f=h.projectScene(a,j,this.sortElements);(Aa=a.lights.length>0)&&l(a);xa=0;for(Ja=f.length;xa<Ja;xa++){A=f[xa];Y.empty();if(A instanceof THREE.RenderableParticle){t=A;t.x*=i;t.y*=o;fa=0;for(ja=A.materials.length;fa<ja;)X=A.materials[fa++],X.opacity!=0&&r(t,A,X,a)}else if(A instanceof THREE.RenderableLine){if(t=A.v1,m=A.v2,t.positionScreen.x*=i,t.positionScreen.y*=o,m.positionScreen.x*=i,m.positionScreen.y*=o,Y.addPoint(t.positionScreen.x,t.positionScreen.y),Y.addPoint(m.positionScreen.x,m.positionScreen.y),
+j;da[10]=c<0?0:c>255?255:c;da[12]=k<0?0:k>255?255:k;da[13]=l<0?0:l>255?255:l;da[14]=d<0?0:d>255?255:d;ra.putImageData(Ba,0,0);va.drawImage(qa,0,0);return sa}function la(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function na(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function ia(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;e!=0&&(e=1/Math.sqrt(e),c*=e,d*=e,b.x+=c,b.y+=d,a.x-=c,a.y-=d)}var xa,Ja,A,fa,ja,oa,ya,X;this.autoClear?this.clear():k.setTransform(1,0,0,-1,i,o);f.info.render.vertices=0;f.info.render.faces=0;
+g=h.projectScene(a,j,this.sortElements);(Aa=a.lights.length>0)&&l(a);xa=0;for(Ja=g.length;xa<Ja;xa++){A=g[xa];Y.empty();if(A instanceof THREE.RenderableParticle){t=A;t.x*=i;t.y*=o;fa=0;for(ja=A.materials.length;fa<ja;)X=A.materials[fa++],X.opacity!=0&&r(t,A,X,a)}else if(A instanceof THREE.RenderableLine){if(t=A.v1,m=A.v2,t.positionScreen.x*=i,t.positionScreen.y*=o,m.positionScreen.x*=i,m.positionScreen.y*=o,Y.addPoint(t.positionScreen.x,t.positionScreen.y),Y.addPoint(m.positionScreen.x,m.positionScreen.y),
 ka.intersects(Y)){fa=0;for(ja=A.materials.length;fa<ja;)X=A.materials[fa++],X.opacity!=0&&s(t,m,A,X,a)}}else if(A instanceof THREE.RenderableFace3){if(t=A.v1,m=A.v2,C=A.v3,t.positionScreen.x*=i,t.positionScreen.y*=o,m.positionScreen.x*=i,m.positionScreen.y*=o,C.positionScreen.x*=i,C.positionScreen.y*=o,A.overdraw&&(ia(t.positionScreen,m.positionScreen),ia(m.positionScreen,C.positionScreen),ia(C.positionScreen,t.positionScreen)),Y.add3Points(t.positionScreen.x,t.positionScreen.y,m.positionScreen.x,
 m.positionScreen.y,C.positionScreen.x,C.positionScreen.y),ka.intersects(Y)){fa=0;for(ja=A.meshMaterials.length;fa<ja;)if(X=A.meshMaterials[fa++],X instanceof THREE.MeshFaceMaterial){oa=0;for(ya=A.faceMaterials.length;oa<ya;)(X=A.faceMaterials[oa++])&&X.opacity!=0&&u(t,m,C,0,1,2,A,X,a)}else X.opacity!=0&&u(t,m,C,0,1,2,A,X,a)}}else if(A instanceof THREE.RenderableFace4&&(t=A.v1,m=A.v2,C=A.v3,D=A.v4,t.positionScreen.x*=i,t.positionScreen.y*=o,m.positionScreen.x*=i,m.positionScreen.y*=o,C.positionScreen.x*=
 i,C.positionScreen.y*=o,D.positionScreen.x*=i,D.positionScreen.y*=o,T.positionScreen.copy(m.positionScreen),U.positionScreen.copy(D.positionScreen),A.overdraw&&(ia(t.positionScreen,m.positionScreen),ia(m.positionScreen,D.positionScreen),ia(D.positionScreen,t.positionScreen),ia(C.positionScreen,T.positionScreen),ia(C.positionScreen,U.positionScreen)),Y.addPoint(t.positionScreen.x,t.positionScreen.y),Y.addPoint(m.positionScreen.x,m.positionScreen.y),Y.addPoint(C.positionScreen.x,C.positionScreen.y),

+ 13 - 13
build/custom/ThreeDOM.js

@@ -49,11 +49,11 @@ THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=
 THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,j,i;f=new THREE.Matrix4;h=b-a;j=c-d;i=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/j;f.n23=0;f.n24=-((c+d)/j);f.n31=0;f.n32=0;f.n33=-2/i;f.n34=-((g+e)/i);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
 !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
-THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this instanceof THREE.Camera?this.matrix.lookAt(this.position,a,this.up):this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&
-this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)===-1){a.parent!==void 0&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.addChildRecurse(a)}},remove:function(a){var b=this,c=this.children.indexOf(a);if(c!==-1){a.parent=void 0;for(this.children.splice(c,1);b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.removeChildRecurse(a)}},getChildByName:function(a,
-b){var c,d,e;c=0;for(d=this.children.length;c<d;c++){e=this.children[c];if(e.name===a)return e;if(b&&(e=e.getChildByName(a,b),e!==void 0))return e}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,
-this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(a,b,c){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||b)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,b=!0;for(var a=0,d=this.children.length;a<d;a++)this.children[a].update(this.matrixWorld,b,c)},addChild:function(a){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");
-this.add(a)},removeChild:function(a){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");this.remove(a)}};THREE.Object3DCount=0;
+THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)===
+-1){a.parent!==void 0&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.addChildRecurse(a)}},remove:function(a){var b=this,c=this.children.indexOf(a);if(c!==-1){a.parent=void 0;for(this.children.splice(c,1);b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.removeChildRecurse(a)}},getChildByName:function(a,b){var c,d,e;c=0;for(d=this.children.length;c<d;c++){e=this.children[c];if(e.name===
+a)return e;if(b&&(e=e.getChildByName(a,b),e!==void 0))return e}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(a,b,c){this.matrixAutoUpdate&&
+this.updateMatrix();if(this.matrixWorldNeedsUpdate||b)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,b=!0;for(var a=0,d=this.children.length;a<d;a++)this.children[a].update(this.matrixWorld,b,c)},addChild:function(a){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");this.add(a)},removeChild:function(a){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");
+this.remove(a)}};THREE.Object3DCount=0;
 THREE.Projector=function(){function a(){var a=j[h]=j[h]||new THREE.RenderableVertex;h++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,f=a.z+a.w,e=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;return f>=0&&e>=0&&g>=0&&h>=0?!0:f<0&&e<0||g<0&&h<0?!1:(f<0?c=Math.max(c,f/(f-e)):e<0&&(d=Math.min(d,f/(f-e))),g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var d,e,g=[],f,h,j=[],i,k,l=[],m,n=[],p,q,s=[],r,J,M=[],C=[],D=[],H=new THREE.Vector4,v=new THREE.Vector4,
 o=new THREE.Matrix4,K=new THREE.Matrix4,z=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],E=new THREE.Vector4,F=new THREE.Vector4;this.projectVector=function(a,b){o.multiply(b.projectionMatrix,b.matrixWorldInverse);o.multiplyVector3(a);return a};this.unprojectVector=function(a,b){o.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));o.multiplyVector3(a);return a};this.projectObjects=function(a,c,f){var h,i;e=C.length=0;
 h=a.objects;a=0;for(c=h.length;a<c;a++){i=h[a];var j;if(!(j=!i.visible))if(j=i instanceof THREE.Mesh)if(j=i.frustumCulled){a:{j=void 0;for(var k=i.matrixWorld,l=-i.geometry.boundingSphere.radius*Math.max(i.scale.x,Math.max(i.scale.y,i.scale.z)),m=0;m<6;m++)if(j=z[m].x*k.n14+z[m].y*k.n24+z[m].z*k.n34+z[m].w,j<=l){j=!1;break a}j=!0}j=!j}if(!j)j=g[e]=g[e]||new THREE.RenderableObject,e++,d=j,H.copy(i.position),o.multiplyVector3(H),d.object=i,d.z=H.z,C.push(d)}f&&C.sort(b);return C};this.projectScene=
@@ -69,16 +69,16 @@ THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){t
 this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var 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,i=j*c+f*e-h*d,k=j*d+h*c-g*e,l=j*e+g*d-f*c,c=-g*
-c-f*d-h*e;b.x=i*j+c*-g+k*-h-l*-f;b.y=k*j+c*-f+l*-g-i*-h;b.z=l*j+c*-h+i*-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};
+c-f*d-h*e;b.x=i*j+c*-g+k*-h-l*-f;b.y=k*j+c*-f+l*-g-i*-h;b.z=l*j+c*-h+i*-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.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.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.u=a||0;this.v=b||0};
-THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.target=e||new THREE.Object3D;this.useTarget=!1;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};
-THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);b.multiplyScalar(a);this.position.addSelf(b);this.target.position.addSelf(b)};
-THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
-THREE.Camera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};
-THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),b=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
-!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};THREE.OrthoCamera=function(a,b,c,d,e,g,f){THREE.Camera.call(this,45,1,e,g,f);this.left=a;this.right=b;this.top=c;this.bottom=d;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
-THREE.OrthoCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.ParticleDOMMaterial=function(a){THREE.Material.call(this);this.domElement=a};THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
+THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Camera=function(){THREE.Object3D.call(this);arguments.length&&console.warn("DEPRECATED: Camera() is now PerspectiveCamera().");this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;
+THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};
+THREE.Camera.prototype.update=function(a,b,c){this.matrixAutoUpdate&&this.updateMatrix();if(b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};
+THREE.OrthographicCamera=function(a,b,c,d,e,g){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=e!==void 0?e:0.1;this.far=g!==void 0?g:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};
+THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a||50;this.aspect=b||1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;
+THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,
+this.far)};THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};THREE.ParticleDOMMaterial=function(a){THREE.Material.call(this);this.domElement=a};THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
 THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
 THREE.Bone.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;var d,e=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(d=0;d<e;d++)a=this.children[d],a instanceof THREE.Bone?a.update(this.skinMatrix,b,c):a.update(this.matrixWorld,!0,c)}else for(d=0;d<e;d++)this.children[d].update(this.skinMatrix,
 b,c)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1&&(a.parent!==void 0&&a.parent.removeChild(a),a.parent=this,this.children.push(a),!(a instanceof THREE.Bone)))this.hasNoneBoneChildren=!0};THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.collisions=this.overrideMaterial=this.fog=null;this.objects=[];this.lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;

+ 13 - 9
build/custom/ThreeExtras.js

@@ -86,7 +86,7 @@ this.position;this.cameraNX.position=this.position;this.cameraPY.position=this.p
 new THREE.Vector3(-1,0,0));this.cameraNX.target.position.add(this.position,new THREE.Vector3(1,0,0));this.cameraPY.target.position.add(this.position,new THREE.Vector3(0,1,0));this.cameraNY.target.position.add(this.position,new THREE.Vector3(0,-1,0));this.cameraPZ.target.position.add(this.position,new THREE.Vector3(0,0,1));this.cameraNZ.target.position.add(this.position,new THREE.Vector3(0,0,-1))};this.updateCubeMap=function(a,c){var b=this.renderTarget;a.setFaceCulling("back","cw");c.scale.y=-1;c.position.y=
 2*this.height;c.updateMatrix();b.activeCubeFace=0;a.render(c,this.cameraPX,b);b.activeCubeFace=1;a.render(c,this.cameraNX,b);c.scale.y=1;c.position.y=0;c.updateMatrix();c.scale.x=-1;c.updateMatrix();b.activeCubeFace=2;a.render(c,this.cameraPY,b);c.scale.x=1;c.updateMatrix();a.setFaceCulling("back","ccw");b.activeCubeFace=3;a.render(c,this.cameraNY,b);c.scale.x=-1;c.updateMatrix();a.setFaceCulling("back","cw");b.activeCubeFace=4;a.render(c,this.cameraPZ,b);b.activeCubeFace=5;a.render(c,this.cameraNZ,
 b);c.scale.x=1;c.updateMatrix();a.setFaceCulling("back","ccw")}};
-THREE.FirstPersonCamera=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.useTarget=!0;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=Math.PI;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(a){if(a.movementSpeed!==
+THREE.FirstPersonCamera=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.useTarget=!0;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=Math.PI;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!==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.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=
 window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(a){this.domElement!==document&&this.domElement.focus();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=
@@ -99,7 +99,7 @@ function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove"
 THREE.FirstPersonCamera.prototype.supr=THREE.Camera.prototype;THREE.FirstPersonCamera.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,e){var f={name:b,fps:0.6,length:e,hierarchy:[]},h,g=c.getControlPointsArray(),k=c.getLength(),l=g.length,y=0;h=l-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[h]={time:e,pos:g[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h<l-1;h++)y=e*k.chunks[h]/k.total,c.keys[h]={time:y,pos:g[h]};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,
 e,f=new THREE.Geometry;for(b=0;b<a.points.length*c;b++)e=b/(a.points.length*c),e=a.getPoint(e),f.vertices[b]=new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z));return f}function e(a,b){var e=c(b,10),f=c(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,h);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);h=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<b.points.length;i++)e=new THREE.Mesh(f,h),e.position.copy(b.points[i]),e.updateMatrix(),a.addChild(e)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.useTarget=!0;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;
+16,8);h=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<b.points.length;i++)e=new THREE.Mesh(f,h),e.position.copy(b.points[i]),e.updateMatrix(),a.addChild(e)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.useTarget=!0;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,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};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.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var g=Math.PI*2,h=Math.PI/180;this.update=function(a,c,b){var e,f;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,
@@ -107,7 +107,7 @@ Math.min(85,this.lat));this.phi=(90-this.lat)*h;this.theta=this.lon*h;e=this.phi
 e.x=100*Math.sin(this.phi)*Math.cos(this.theta);e.y=100*Math.cos(this.phi);e.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,a,c,b)};this.onMouseMove=function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&
 this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),f=new THREE.MeshLambertMaterial({color:65280}),k=new THREE.CubeGeometry(10,10,20),l=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(k,a);a=new THREE.Mesh(l,f);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&&e(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;
-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.domElement!==document&&this.domElement.setAttribute("tabindex",-1);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()}};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=
@@ -156,8 +156,12 @@ THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THRE
 THREE.IcosahedronGeometry=function(a){function b(a,c,b){var e=Math.sqrt(a*a+c*c+b*b);return g.vertices.push(new THREE.Vertex(new THREE.Vector3(a/e,c/e,b/e)))-1}function c(a,c,b,e){e.faces.push(new THREE.Face3(a,c,b))}function e(a,c){var e=g.vertices[a].position,f=g.vertices[c].position;return b((e.x+f.x)/2,(e.y+f.y)/2,(e.z+f.z)/2)}var g=this,h=new THREE.Geometry;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,h);c(0,5,1,h);c(0,1,7,h);c(0,7,10,h);c(0,10,11,h);c(1,5,9,h);c(5,11,4,h);c(11,10,2,h);c(10,7,6,h);c(7,1,8,h);c(3,9,4,h);c(3,4,2,h);c(3,2,6,h);c(3,6,8,h);c(3,8,9,h);c(4,9,5,h);c(2,4,11,h);c(6,2,10,h);c(8,6,7,h);c(9,8,1,h);for(var f=0;f<this.subdivisions;f++){var a=new THREE.Geometry,k;for(k in h.faces){var l=e(h.faces[k].a,h.faces[k].b),m=e(h.faces[k].b,h.faces[k].c),n=e(h.faces[k].c,h.faces[k].a);c(h.faces[k].a,l,n,a);c(h.faces[k].b,m,
 l,a);c(h.faces[k].c,n,m,a);c(l,m,n,a)}h.faces=a.faces}g.faces=h.faces;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=[],e=[],g=[],h=[],f=(new THREE.Matrix4).setRotationZ(b),k=0;k<a.length;k++)this.vertices.push(new THREE.Vertex(a[k])),c[k]=a[k].clone(),e[k]=this.vertices.length-1;for(var l=0;l<=this.angle+0.0010;l+=b){for(k=0;k<c.length;k++)l<this.angle?(c[k]=f.multiplyVector3(c[k].clone()),this.vertices.push(new THREE.Vertex(c[k])),g[k]=this.vertices.length-1):g=h;l==0&&(h=e);
+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=[],e=[],g=[],h=[],f=(new THREE.Matrix4).setRotationZ(b),k=0;k<a.length;k++)this.vertices.push(new THREE.Vertex(a[k])),c[k]=a[k].clone(),e[k]=this.vertices.length-1;for(var l=0;l<=this.angle+0.001;l+=b){for(k=0;k<c.length;k++)l<this.angle?(c[k]=f.multiplyVector3(c[k].clone()),this.vertices.push(new THREE.Vertex(c[k])),g[k]=this.vertices.length-1):g=h;l==0&&(h=e);
 for(k=0;k<e.length-1;k++)this.faces.push(new THREE.Face4(g[k],g[k+1],e[k+1],e[k])),this.faceVertexUvs[0].push([new THREE.UV(1-l/this.angle,k/a.length),new THREE.UV(1-l/this.angle,(k+1)/a.length),new THREE.UV(1-(l-b)/this.angle,(k+1)/a.length),new THREE.UV(1-(l-b)/this.angle,k/a.length)]);e=g;g=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.OctahedronGeometry=function(a,b){function c(c){var b=c.clone().normalize(),b=new THREE.Vertex(b.clone().multiplyScalar(a));b.index=f.vertices.push(b)-1;b.uv=new THREE.UV(Math.atan2(c.z,-c.x)/2/Math.PI+0.5,Math.atan2(-c.y,Math.sqrt(c.x*c.x+c.z*c.z))/Math.PI+0.5);return b}function e(a,c,b,k){k<1?(k=new THREE.Face3(a.index,c.index,b.index,[a.position,c.position,b.position]),k.centroid.addSelf(a.position).addSelf(c.position).addSelf(b.position).divideScalar(3),k.normal=k.centroid.clone().normalize(),
+f.faces.push(k),k=Math.atan2(k.centroid.z,-k.centroid.x),f.faceVertexUvs[0].push([h(a.uv,a.position,k),h(c.uv,c.position,k),h(b.uv,b.position,k)])):(k-=1,e(a,g(a,c),g(a,b),k),e(g(a,c),c,g(c,b),k),e(g(a,b),g(c,b),b,k),e(g(a,c),g(c,b),g(a,b),k))}function g(a,b){k[a.index]||(k[a.index]=[]);k[b.index]||(k[b.index]=[]);var e=k[a.index][b.index];e===void 0&&(k[a.index][b.index]=k[b.index][a.index]=e=c((new THREE.Vector3).add(a.position,b.position).divideScalar(2)));return e}function h(a,c,b){b<0&&a.u===
+1&&(a=new THREE.UV(a.u-1,a.v));c.x===0&&c.z===0&&(a=new THREE.UV(b/2/Math.PI+0.5,a.v));return a}THREE.Geometry.call(this);var b=isFinite(b)?b:3,f=this;c(new THREE.Vector3(1,0,0));c(new THREE.Vector3(-1,0,0));c(new THREE.Vector3(0,1,0));c(new THREE.Vector3(0,-1,0));c(new THREE.Vector3(0,0,1));c(new THREE.Vector3(0,0,-1));var k=[],l=this.vertices;e(l[0],l[2],l[4],b);e(l[0],l[4],l[3],b);e(l[0],l[3],l[5],b);e(l[0],l[5],l[2],b);e(l[1],l[2],l[5],b);e(l[1],l[5],l[3],b);e(l[1],l[3],l[4],b);e(l[1],l[4],l[2],
+b);this.boundingSphere={radius:a}};THREE.OctahedronGeometry.prototype=new THREE.Geometry;THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
 THREE.PlaneGeometry=function(a,b,c,e){THREE.Geometry.call(this);var g,h=a/2,f=b/2,c=c||1,e=e||1,k=c+1,l=e+1;a/=c;var m=b/e;for(g=0;g<l;g++)for(b=0;b<k;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*a-h,-(g*m-f),0)));for(g=0;g<e;g++)for(b=0;b<c;b++)this.faces.push(new THREE.Face4(b+k*g,b+k*(g+1),b+1+k*(g+1),b+1+k*g)),this.faceVertexUvs[0].push([new THREE.UV(b/c,g/e),new THREE.UV(b/c,(g+1)/e),new THREE.UV((b+1)/c,(g+1)/e),new THREE.UV((b+1)/c,g/e)]);this.computeCentroids();this.computeFaceNormals()};
 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,e,g=Math.PI,h=Math.max(3,b||8),f=Math.max(2,c||6),b=[],c=0;c<f+1;c++){e=c/f;var k=a*Math.cos(e*g),l=a*Math.sin(e*g),m=[],n=0;for(e=0;e<h;e++){var o=2*e/h,t=l*Math.sin(o*g),o=l*Math.cos(o*g);(c==0||c==f)&&e>0||(n=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,k,t)))-1);m.push(n)}b.push(m)}for(var p,x,v,g=b.length,c=0;c<g;c++)if(h=b[c].length,c>0)for(e=0;e<h;e++){m=e==h-1;f=b[c][m?0:e+1];k=b[c][m?h-1:e];l=b[c-1][m?
@@ -287,6 +291,8 @@ THREE.UTF8Loader.prototype.decompressMesh=function(a){var b=a.charCodeAt(0);b>=5
 THREE.UTF8Loader.prototype.createModel=function(a,b,c,e,g,h){var f=function(){var b=this;b.materials=[];THREE.Geometry.call(this);var f=THREE.UTF8Loader.prototype.decompressMesh(a),m=[],n=[];(function(a,f,l){for(var m,n,u,z=a.length;l<z;l+=f)m=a[l],n=a[l+1],u=a[l+2],m=m/16383*c,n=n/16383*c,u=u/16383*c,m+=e,n+=g,u+=h,b.vertices.push(new THREE.Vertex(new THREE.Vector3(m,n,u)))})(f[0],8,0);(function(a,c,b){for(var e,f,g=a.length;b<g;b+=c)e=a[b],f=a[b+1],e/=1023,f/=1023,n.push(e,1-f)})(f[0],8,3);(function(a,
 c,b){for(var e,f,g,h=a.length;b<h;b+=c)e=a[b],f=a[b+1],g=a[b+2],e=(e-512)/511,f=(f-512)/511,g=(g-512)/511,m.push(e,f,g)})(f[0],8,5);(function(a){var c,e,f,g,h,l,y,w,A,C=a.length;for(c=0;c<C;c+=3){e=a[c];f=a[c+1];g=a[c+2];h=b;w=e;A=f;l=g;y=e;var G=f,E=g,I=h.materials[0],H=m[G*3],M=m[G*3+1],G=m[G*3+2],B=m[E*3],D=m[E*3+1],E=m[E*3+2];y=new THREE.Vector3(m[y*3],m[y*3+1],m[y*3+2]);G=new THREE.Vector3(H,M,G);E=new THREE.Vector3(B,D,E);h.faces.push(new THREE.Face3(w,A,l,[y,G,E],null,I));h=n[e*2];e=n[e*2+
 1];l=n[f*2];y=n[f*2+1];w=n[g*2];A=n[g*2+1];g=b.faceVertexUvs[0];f=l;l=y;y=[];y.push(new THREE.UV(h,e));y.push(new THREE.UV(f,l));y.push(new THREE.UV(w,A));g.push(y)}})(f[1]);this.computeCentroids();this.computeFaceNormals()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;b(new f)};
+THREE.Axes=function(){THREE.Object3D.call(this);var a=new THREE.Geometry;a.vertices.push(new THREE.Vertex);a.vertices.push(new THREE.Vertex(new THREE.Vector3(0,100,0)));var b=new THREE.CylinderGeometry(0,5,25,5,1),c=new THREE.Line(a,new THREE.LineBasicMaterial({color:16711680}));c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:16711680}));c.position.x=100;c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Line(a,new THREE.LineBasicMaterial({color:65280}));this.add(c);
+c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:65280}));c.position.y=100;this.add(c);c=new THREE.Line(a,new THREE.LineBasicMaterial({color:255}));c.rotation.x=Math.PI/2;this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:255}));c.position.z=100;c.rotation.x=Math.PI/2;this.add(c)};THREE.Axes.prototype=new THREE.Object3D;THREE.Axes.prototype.constructor=THREE.Axes;
 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,g){return a+(b-a)*g};this.VIntX=function(a,b,g,h,f,k,l,m,n,o){f=(f-n)/(o-n);n=this.normal_cache;b[h]=k+f*this.delta;b[h+1]=l;b[h+2]=m;g[h]=this.lerp(n[a],n[a+3],f);g[h+1]=this.lerp(n[a+1],n[a+4],f);g[h+2]=this.lerp(n[a+2],n[a+5],f)};this.VIntY=function(a,b,g,h,f,k,l,m,n,o){f=(f-n)/(o-n);n=this.normal_cache;b[h]=k;b[h+1]=l+f*this.delta;b[h+
 2]=m;b=a+this.yd*3;g[h]=this.lerp(n[a],n[b],f);g[h+1]=this.lerp(n[a+1],n[b+1],f);g[h+2]=this.lerp(n[a+2],n[b+2],f)};this.VIntZ=function(a,b,g,h,f,k,l,m,n,o){f=(f-n)/(o-n);n=this.normal_cache;b[h]=k;b[h+1]=l;b[h+2]=m+f*this.delta;b=a+this.zd*3;g[h]=this.lerp(n[a],n[b],f);g[h+1]=this.lerp(n[a+1],n[b+1],f);g[h+2]=this.lerp(n[a+2],n[b+2],f)};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+
@@ -323,11 +329,9 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 2,11,1,5,1,11,-1,0,2,5,0,5,9,2,11,5,4,5,8,11,8,5,-1,9,4,5,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,5,10,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1,5,10,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1,3,10,2,3,5,10,3,8,5,4,5,8,0,1,9,-1,5,10,2,5,2,4,1,9,2,9,4,2,-1,-1,-1,-1,8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1,0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,4,5,8,5,3,9,0,5,0,3,5,-1,-1,-1,-1,9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,11,7,4,9,11,9,10,11,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,7,9,11,7,9,10,11,-1,-1,-1,-1,1,10,11,1,11,
 4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
 -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,
-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);
-THREE.Trident=function(){THREE.Object3D.call(this);var a=new THREE.Geometry;a.vertices.push(new THREE.Vertex);a.vertices.push(new THREE.Vertex(new THREE.Vector3(0,100,0)));var b=new THREE.CylinderGeometry(0,5,25,5,1),c=new THREE.Line(a,new THREE.LineBasicMaterial({color:16711680}));c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:16711680}));c.position.x=100;c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Line(a,new THREE.LineBasicMaterial({color:65280}));
-this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:65280}));c.position.y=100;this.add(c);c=new THREE.Line(a,new THREE.LineBasicMaterial({color:255}));c.rotation.x=Math.PI/2;this.add(c);c=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:255}));c.position.z=100;c.rotation.x=Math.PI/2;this.add(c)};THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.PlaneCollider=function(a,b){this.point=a;this.normal=b};
-THREE.SphereCollider=function(a,b){this.center=a;this.radius=b;this.radiusSq=b*b};THREE.BoxCollider=function(a,b){this.min=a;this.max=b;this.dynamic=!0;this.normal=new THREE.Vector3};THREE.MeshCollider=function(a,b){this.mesh=a;this.box=b;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;
-THREE.CollisionSystem.prototype.merge=function(a){Array.prototype.push.apply(this.colliders,a.colliders);Array.prototype.push.apply(this.hits,a.hits)};THREE.CollisionSystem.prototype.rayCastAll=function(a){a.direction.normalize();this.hits.length=0;var b,c,e,g,h=0;b=0;for(c=this.colliders.length;b<c;b++)if(g=this.colliders[b],e=this.rayCast(a,g),e<Number.MAX_VALUE)g.distance=e,e>h?this.hits.push(g):this.hits.unshift(g),h=e;return this.hits};
+2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);THREE.PlaneCollider=function(a,b){this.point=a;this.normal=b};THREE.SphereCollider=function(a,b){this.center=a;this.radius=b;this.radiusSq=b*b};THREE.BoxCollider=function(a,b){this.min=a;this.max=b;this.dynamic=!0;this.normal=new THREE.Vector3};
+THREE.MeshCollider=function(a,b){this.mesh=a;this.box=b;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;THREE.CollisionSystem.prototype.merge=function(a){Array.prototype.push.apply(this.colliders,a.colliders);Array.prototype.push.apply(this.hits,a.hits)};
+THREE.CollisionSystem.prototype.rayCastAll=function(a){a.direction.normalize();this.hits.length=0;var b,c,e,g,h=0;b=0;for(c=this.colliders.length;b<c;b++)if(g=this.colliders[b],e=this.rayCast(a,g),e<Number.MAX_VALUE)g.distance=e,e>h?this.hits.push(g):this.hits.unshift(g),h=e;return this.hits};
 THREE.CollisionSystem.prototype.rayCastNearest=function(a){var b=this.rayCastAll(a);if(b.length==0)return null;for(var c=0;b[c]instanceof THREE.MeshCollider;){var e=this.rayMesh(a,b[c]);if(e.dist<Number.MAX_VALUE){b[c].distance=e.dist;b[c].faceIndex=e.faceIndex;break}c++}if(c>b.length)return null;return b[c]};
 THREE.CollisionSystem.prototype.rayCast=function(a,b){if(b instanceof THREE.PlaneCollider)return this.rayPlane(a,b);else if(b instanceof THREE.SphereCollider)return this.raySphere(a,b);else if(b instanceof THREE.BoxCollider)return this.rayBox(a,b);else if(b instanceof THREE.MeshCollider&&b.box)return this.rayBox(a,b.box)};
 THREE.CollisionSystem.prototype.rayMesh=function(a,b){for(var c=this.makeRayLocal(a,b.mesh),e=Number.MAX_VALUE,g,h=0;h<b.numFaces;h++){var f=b.mesh.geometry.faces[h],k=b.mesh.geometry.vertices[f.a].position,l=b.mesh.geometry.vertices[f.b].position,m=b.mesh.geometry.vertices[f.c].position,n=f instanceof THREE.Face4?b.mesh.geometry.vertices[f.d].position:null;f instanceof THREE.Face3?(f=this.rayTriangle(c,k,l,m,e,this.collisionNormal,b.mesh),f<e&&(e=f,g=h,b.normal.copy(this.collisionNormal),b.normal.normalize())):

+ 12 - 13
build/custom/ThreeSVG.js

@@ -49,11 +49,11 @@ THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=
 THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,k,i;f=new THREE.Matrix4;h=b-a;k=c-d;i=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/k;f.n23=0;f.n24=-((c+d)/k);f.n31=0;f.n32=0;f.n33=-2/i;f.n34=-((g+e)/i);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
 !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
-THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this instanceof THREE.Camera?this.matrix.lookAt(this.position,a,this.up):this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&
-this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)===-1){a.parent!==void 0&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.addChildRecurse(a)}},remove:function(a){var b=this,c=this.children.indexOf(a);if(c!==-1){a.parent=void 0;for(this.children.splice(c,1);b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.removeChildRecurse(a)}},getChildByName:function(a,
-b){var c,d,e;c=0;for(d=this.children.length;c<d;c++){e=this.children[c];if(e.name===a)return e;if(b&&(e=e.getChildByName(a,b),e!==void 0))return e}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,
-this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(a,b,c){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||b)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,b=!0;for(var a=0,d=this.children.length;a<d;a++)this.children[a].update(this.matrixWorld,b,c)},addChild:function(a){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");
-this.add(a)},removeChild:function(a){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");this.remove(a)}};THREE.Object3DCount=0;
+THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)===
+-1){a.parent!==void 0&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.addChildRecurse(a)}},remove:function(a){var b=this,c=this.children.indexOf(a);if(c!==-1){a.parent=void 0;for(this.children.splice(c,1);b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.removeChildRecurse(a)}},getChildByName:function(a,b){var c,d,e;c=0;for(d=this.children.length;c<d;c++){e=this.children[c];if(e.name===
+a)return e;if(b&&(e=e.getChildByName(a,b),e!==void 0))return e}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(a,b,c){this.matrixAutoUpdate&&
+this.updateMatrix();if(this.matrixWorldNeedsUpdate||b)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,b=!0;for(var a=0,d=this.children.length;a<d;a++)this.children[a].update(this.matrixWorld,b,c)},addChild:function(a){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");this.add(a)},removeChild:function(a){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");
+this.remove(a)}};THREE.Object3DCount=0;
 THREE.Projector=function(){function a(){var a=k[h]=k[h]||new THREE.RenderableVertex;h++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;return e>=0&&f>=0&&g>=0&&h>=0?!0:e<0&&f<0||g<0&&h<0?!1:(e<0?c=Math.max(c,e/(e-f)):f<0&&(d=Math.min(d,e/(e-f))),g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var d,e,g=[],f,h,k=[],i,l,j=[],m,n=[],p,q,v=[],u,C,K=[],t=[],w=[],z=new THREE.Vector4,y=new THREE.Vector4,
 o=new THREE.Matrix4,E=new THREE.Matrix4,D=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],F=new THREE.Vector4,G=new THREE.Vector4;this.projectVector=function(a,b){o.multiply(b.projectionMatrix,b.matrixWorldInverse);o.multiplyVector3(a);return a};this.unprojectVector=function(a,b){o.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));o.multiplyVector3(a);return a};this.projectObjects=function(a,c,f){var h,i;e=t.length=0;
 h=a.objects;a=0;for(c=h.length;a<c;a++){i=h[a];var k;if(!(k=!i.visible))if(k=i instanceof THREE.Mesh)if(k=i.frustumCulled){a:{k=void 0;for(var j=i.matrixWorld,l=-i.geometry.boundingSphere.radius*Math.max(i.scale.x,Math.max(i.scale.y,i.scale.z)),m=0;m<6;m++)if(k=D[m].x*j.n14+D[m].y*j.n24+D[m].z*j.n34+D[m].w,k<=l){k=!1;break a}k=!0}k=!k}if(!k)k=g[e]=g[e]||new THREE.RenderableObject,e++,d=k,z.copy(i.position),o.multiplyVector3(z),d.object=i,d.z=z.z,t.push(d)}f&&t.sort(b);return t};this.projectScene=
@@ -69,7 +69,7 @@ THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){t
 this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var 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,k=this.w,i=k*c+f*e-h*d,l=k*d+h*c-g*e,j=k*e+g*d-f*c,c=-g*
-c-f*d-h*e;b.x=i*k+c*-g+l*-h-j*-f;b.y=l*k+c*-f+j*-g-i*-h;b.z=j*k+c*-h+i*-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};
+c-f*d-h*e;b.x=i*k+c*-g+l*-h-j*-f;b.y=l*k+c*-f+j*-g-i*-h;b.z=j*k+c*-h+i*-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.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.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.u=a||0;this.v=b||0};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
@@ -85,13 +85,12 @@ D[c].addSelf(G);D[d].addSelf(G)}var b,c,d,e,g,f,h,k,i,l,j,m,n,p,q,v,u,C,K,t,w,z,
 this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;b<c;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=
 a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},computeEdgeFaces:function(){function a(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}function b(a,b,c){a[b]===void 0?(a[b]={set:{},array:[]},a[b].set[c]=1,a[b].array.push(c)):a[b].set[c]===void 0&&(a[b].set[c]=1,a[b].array.push(c))}var c,d,e,g,f,h=
 {};c=0;for(d=this.faces.length;c<d;c++)f=this.faces[c],f instanceof THREE.Face3?(e=a(f.a,f.b),b(h,e,c),e=a(f.b,f.c),b(h,e,c),e=a(f.a,f.c),b(h,e,c)):f instanceof THREE.Face4&&(e=a(f.b,f.d),b(h,e,c),e=a(f.a,f.b),b(h,e,c),e=a(f.a,f.d),b(h,e,c),e=a(f.b,f.c),b(h,e,c),e=a(f.c,f.d),b(h,e,c));c=0;for(d=this.edges.length;c<d;c++){f=this.edges[c];e=f.vertexIndices[0];g=f.vertexIndices[1];f.faceIndices=h[a(e,g)].array;for(e=0;e<f.faceIndices.length;e++)g=f.faceIndices[e],f.faces.push(this.faces[g])}}};
-THREE.GeometryCount=0;THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.target=e||new THREE.Object3D;this.useTarget=!1;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;
-THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);b.multiplyScalar(a);this.position.addSelf(b);this.target.position.addSelf(b)};
-THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
-THREE.Camera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};
-THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),b=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
-!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};THREE.OrthoCamera=function(a,b,c,d,e,g,f){THREE.Camera.call(this,45,1,e,g,f);this.left=a;this.right=b;this.top=c;this.bottom=d;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
-THREE.OrthoCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;
+THREE.GeometryCount=0;THREE.Camera=function(){THREE.Object3D.call(this);arguments.length&&console.warn("DEPRECATED: Camera() is now PerspectiveCamera().");this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};
+THREE.Camera.prototype.update=function(a,b,c){this.matrixAutoUpdate&&this.updateMatrix();if(b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};
+THREE.OrthographicCamera=function(a,b,c,d,e,g){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=e!==void 0?e:0.1;this.far=g!==void 0?g:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};
+THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a||50;this.aspect=b||1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;
+THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,
+this.far)};THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
 THREE.Material=function(a){this.name="";this.id=THREE.MaterialCount++;a=a||{};this.opacity=a.opacity!==void 0?a.opacity:1;this.transparent=a.transparent!==void 0?a.transparent:!1;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.depthTest=a.depthTest!==void 0?a.depthTest:!0;this.depthWrite=a.depthWrite!==void 0?a.depthWrite:!0;this.polygonOffset=a.polygonOffset!==void 0?a.polygonOffset:!1;this.polygonOffsetFactor=a.polygonOffsetFactor!==void 0?a.polygonOffsetFactor:0;this.polygonOffsetUnits=

+ 80 - 80
build/custom/ThreeWebGL.js

@@ -1,7 +1,7 @@
 // ThreeWebGL.js r45dev - http://github.com/mrdoob/three.js
 var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this};
-THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,d){this.r=b;this.g=c;this.b=d;return this},setHSV:function(b,c,d){var f,i,h;if(d==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),i=b*6-f,b=d*(1-c),h=d*(1-c*i),c=d*(1-c*(1-i)),f){case 1:this.r=h;this.g=d;this.b=b;break;case 2:this.r=b;this.g=d;this.b=c;break;case 3:this.r=b;this.g=h;this.b=d;break;case 4:this.r=c;this.g=b;this.b=d;break;case 5:this.r=
-d;this.g=b;this.b=h;break;case 6:case 0:this.r=d,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
+THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,d){this.r=b;this.g=c;this.b=d;return this},setHSV:function(b,c,d){var f,h,i;if(d==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),h=b*6-f,b=d*(1-c),i=d*(1-c*h),c=d*(1-c*(1-h)),f){case 1:this.r=i;this.g=d;this.b=b;break;case 2:this.r=b;this.g=d;this.b=c;break;case 3:this.r=b;this.g=i;this.b=d;break;case 4:this.r=c;this.g=b;this.b=d;break;case 5:this.r=
+d;this.g=b;this.b=i;break;case 6:case 0:this.r=d,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
 THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0};
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this},
 divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var c=this.x-b.x,b=this.y-b.y;return c*c+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)},
@@ -15,87 +15,87 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,c,d,f){this.x=
 c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;this.w-=b.w;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;this.w*=b;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b,this.w/=b):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z+this.w*b.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
 normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3};
 THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,d,f=[];c=0;for(d=b.length;c<d;c++)Array.prototype.push.apply(f,this.intersectObject(b[c]));f.sort(function(b,c){return b.distance-c.distance});return f},intersectObject:function(b){function c(b,c,d){var f;f=d.clone().subSelf(b).dot(c);if(f<=0)return null;b=b.clone().addSelf(c.clone().multiplyScalar(f));return d.distanceTo(b)}function d(b,c,d,f){var f=f.clone().subSelf(c),
-d=d.clone().subSelf(c),i=b.clone().subSelf(c),b=f.dot(f),c=f.dot(d),f=f.dot(i),h=d.dot(d),d=d.dot(i),i=1/(b*h-c*c),h=(h*f-c*d)*i,b=(b*d-c*f)*i;return h>0&&b>0&&h+b<1}if(b instanceof THREE.Particle){var f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.scale.x)return[];return[{distance:f,point:b.position,face:null,object:b}]}else if(b instanceof THREE.Mesh){f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.geometry.boundingSphere.radius*Math.max(b.scale.x,
-Math.max(b.scale.y,b.scale.z)))return[];var i,h,j,k,m,n,q,p,t,v,B=b.geometry,x=B.vertices,E=[],f=0;for(i=B.faces.length;f<i;f++)if(h=B.faces[f],t=this.origin.clone(),v=this.direction.clone(),n=b.matrixWorld,j=n.multiplyVector3(h.centroid.clone()).subSelf(t),p=j.dot(v),!(p<=0)&&(j=n.multiplyVector3(x[h.a].position.clone()),k=n.multiplyVector3(x[h.b].position.clone()),m=n.multiplyVector3(x[h.c].position.clone()),n=h instanceof THREE.Face4?n.multiplyVector3(x[h.d].position.clone()):null,q=b.matrixRotationWorld.multiplyVector3(h.normal.clone()),
-p=v.dot(q),b.doubleSided||(b.flipSided?p>0:p<0)))if(p=q.dot((new THREE.Vector3).sub(j,t))/p,t=t.addSelf(v.multiplyScalar(p)),h instanceof THREE.Face3)d(t,j,k,m)&&(h={distance:this.origin.distanceTo(t),point:t,face:h,object:b},E.push(h));else if(h instanceof THREE.Face4&&(d(t,j,k,n)||d(t,k,m,n)))h={distance:this.origin.distanceTo(t),point:t,face:h,object:b},E.push(h);E.sort(function(b,c){return b.distance-c.distance});return E}else return[]}};
-THREE.Rectangle=function(){function b(){h=f-c;j=i-d}var c,d,f,i,h,j,k=!0;this.getX=function(){return c};this.getY=function(){return d};this.getWidth=function(){return h};this.getHeight=function(){return j};this.getLeft=function(){return c};this.getTop=function(){return d};this.getRight=function(){return f};this.getBottom=function(){return i};this.set=function(h,j,q,p){k=!1;c=h;d=j;f=q;i=p;b()};this.addPoint=function(h,j){k?(k=!1,c=h,d=j,f=h,i=j):(c=c<h?c:h,d=d<j?d:j,f=f>h?f:h,i=i>j?i:j);b()};this.add3Points=
-function(h,j,q,p,t,v){k?(k=!1,c=h<q?h<t?h:t:q<t?q:t,d=j<p?j<v?j:v:p<v?p:v,f=h>q?h>t?h:t:q>t?q:t,i=j>p?j>v?j:v:p>v?p:v):(c=h<q?h<t?h<c?h:c:t<c?t:c:q<t?q<c?q:c:t<c?t:c,d=j<p?j<v?j<d?j:d:v<d?v:d:p<v?p<d?p:d:v<d?v:d,f=h>q?h>t?h>f?h:f:t>f?t:f:q>t?q>f?q:f:t>f?t:f,i=j>p?j>v?j>i?j:i:v>i?v:i:p>v?p>i?p:i:v>i?v:i);b()};this.addRectangle=function(h){k?(k=!1,c=h.getLeft(),d=h.getTop(),f=h.getRight(),i=h.getBottom()):(c=c<h.getLeft()?c:h.getLeft(),d=d<h.getTop()?d:h.getTop(),f=f>h.getRight()?f:h.getRight(),i=i>
-h.getBottom()?i:h.getBottom());b()};this.inflate=function(h){c-=h;d-=h;f+=h;i+=h;b()};this.minSelf=function(h){c=c>h.getLeft()?c:h.getLeft();d=d>h.getTop()?d:h.getTop();f=f<h.getRight()?f:h.getRight();i=i<h.getBottom()?i:h.getBottom();b()};this.intersects=function(b){return Math.min(f,b.getRight())-Math.max(c,b.getLeft())>=0&&Math.min(i,b.getBottom())-Math.max(d,b.getTop())>=0};this.empty=function(){k=!0;i=f=d=c=0;b()};this.isEmpty=function(){return k}};THREE.Matrix3=function(){this.m=[]};
+d=d.clone().subSelf(c),h=b.clone().subSelf(c),b=f.dot(f),c=f.dot(d),f=f.dot(h),i=d.dot(d),d=d.dot(h),h=1/(b*i-c*c),i=(i*f-c*d)*h,b=(b*d-c*f)*h;return i>0&&b>0&&i+b<1}if(b instanceof THREE.Particle){var f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.scale.x)return[];return[{distance:f,point:b.position,face:null,object:b}]}else if(b instanceof THREE.Mesh){f=c(this.origin,this.direction,b.matrixWorld.getPosition());if(f==null||f>b.geometry.boundingSphere.radius*Math.max(b.scale.x,
+Math.max(b.scale.y,b.scale.z)))return[];var h,i,j,k,m,n,q,p,t,v,B=b.geometry,x=B.vertices,E=[],f=0;for(h=B.faces.length;f<h;f++)if(i=B.faces[f],t=this.origin.clone(),v=this.direction.clone(),n=b.matrixWorld,j=n.multiplyVector3(i.centroid.clone()).subSelf(t),p=j.dot(v),!(p<=0)&&(j=n.multiplyVector3(x[i.a].position.clone()),k=n.multiplyVector3(x[i.b].position.clone()),m=n.multiplyVector3(x[i.c].position.clone()),n=i instanceof THREE.Face4?n.multiplyVector3(x[i.d].position.clone()):null,q=b.matrixRotationWorld.multiplyVector3(i.normal.clone()),
+p=v.dot(q),b.doubleSided||(b.flipSided?p>0:p<0)))if(p=q.dot((new THREE.Vector3).sub(j,t))/p,t=t.addSelf(v.multiplyScalar(p)),i instanceof THREE.Face3)d(t,j,k,m)&&(i={distance:this.origin.distanceTo(t),point:t,face:i,object:b},E.push(i));else if(i instanceof THREE.Face4&&(d(t,j,k,n)||d(t,k,m,n)))i={distance:this.origin.distanceTo(t),point:t,face:i,object:b},E.push(i);E.sort(function(b,c){return b.distance-c.distance});return E}else return[]}};
+THREE.Rectangle=function(){function b(){i=f-c;j=h-d}var c,d,f,h,i,j,k=!0;this.getX=function(){return c};this.getY=function(){return d};this.getWidth=function(){return i};this.getHeight=function(){return j};this.getLeft=function(){return c};this.getTop=function(){return d};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(i,j,q,p){k=!1;c=i;d=j;f=q;h=p;b()};this.addPoint=function(i,j){k?(k=!1,c=i,d=j,f=i,h=j):(c=c<i?c:i,d=d<j?d:j,f=f>i?f:i,h=h>j?h:j);b()};this.add3Points=
+function(i,j,q,p,t,v){k?(k=!1,c=i<q?i<t?i:t:q<t?q:t,d=j<p?j<v?j:v:p<v?p:v,f=i>q?i>t?i:t:q>t?q:t,h=j>p?j>v?j:v:p>v?p:v):(c=i<q?i<t?i<c?i:c:t<c?t:c:q<t?q<c?q:c:t<c?t:c,d=j<p?j<v?j<d?j:d:v<d?v:d:p<v?p<d?p:d:v<d?v:d,f=i>q?i>t?i>f?i:f:t>f?t:f:q>t?q>f?q:f:t>f?t:f,h=j>p?j>v?j>h?j:h:v>h?v:h:p>v?p>h?p:h:v>h?v:h);b()};this.addRectangle=function(i){k?(k=!1,c=i.getLeft(),d=i.getTop(),f=i.getRight(),h=i.getBottom()):(c=c<i.getLeft()?c:i.getLeft(),d=d<i.getTop()?d:i.getTop(),f=f>i.getRight()?f:i.getRight(),h=h>
+i.getBottom()?h:i.getBottom());b()};this.inflate=function(i){c-=i;d-=i;f+=i;h+=i;b()};this.minSelf=function(i){c=c>i.getLeft()?c:i.getLeft();d=d>i.getTop()?d:i.getTop();f=f<i.getRight()?f:i.getRight();h=h<i.getBottom()?h:i.getBottom();b()};this.intersects=function(b){return Math.min(f,b.getRight())-Math.max(c,b.getLeft())>=0&&Math.min(h,b.getBottom())-Math.max(d,b.getTop())>=0};this.empty=function(){k=!0;h=f=d=c=0;b()};this.isEmpty=function(){return k}};THREE.Matrix3=function(){this.m=[]};
 THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}};
-THREE.Matrix4=function(b,c,d,f,i,h,j,k,m,n,q,p,t,v,B,x){this.set(b!==void 0?b:1,c||0,d||0,f||0,i||0,h!==void 0?h:1,j||0,k||0,m||0,n||0,q!==void 0?q:1,p||0,t||0,v||0,B||0,x!==void 0?x:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,d,f,i,h,j,k,m,n,q,p,t,v,B,x){this.n11=b;this.n12=c;this.n13=d;this.n14=f;this.n21=i;this.n22=h;this.n23=j;this.n24=k;this.n31=m;this.n32=n;this.n33=q;this.n34=p;this.n41=t;this.n42=v;this.n43=B;this.n44=x;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 f=THREE.Matrix4.__v1,i=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;h.sub(b,c).normalize();if(h.length()===0)h.z=1;f.cross(d,h).normalize();f.length()===0&&(h.x+=1.0E-4,f.cross(d,h).normalize());i.cross(h,f).normalize();this.n11=f.x;this.n12=i.x;this.n13=h.x;this.n21=f.y;this.n22=i.y;this.n23=h.y;this.n31=f.z;this.n32=i.z;this.n33=h.z;return this},multiplyVector3:function(b){var c=b.x,d=b.y,f=b.z,i=1/(this.n41*c+this.n42*d+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*d+this.n13*f+this.n14)*i;
-b.y=(this.n21*c+this.n22*d+this.n23*f+this.n24)*i;b.z=(this.n31*c+this.n32*d+this.n33*f+this.n34)*i;return b},multiplyVector4:function(b){var c=b.x,d=b.y,f=b.z,i=b.w;b.x=this.n11*c+this.n12*d+this.n13*f+this.n14*i;b.y=this.n21*c+this.n22*d+this.n23*f+this.n24*i;b.z=this.n31*c+this.n32*d+this.n33*f+this.n34*i;b.w=this.n41*c+this.n42*d+this.n43*f+this.n44*i;return b},rotateAxis:function(b){var c=b.x,d=b.y,f=b.z;b.x=c*this.n11+d*this.n12+f*this.n13;b.y=c*this.n21+d*this.n22+f*this.n23;b.z=c*this.n31+
-d*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var d=b.n11,f=b.n12,i=b.n13,h=b.n14,j=b.n21,k=b.n22,m=b.n23,n=b.n24,q=b.n31,p=b.n32,t=b.n33,v=b.n34,B=b.n41,x=b.n42,E=b.n43,F=b.n44,wa=c.n11,xa=
-c.n12,qa=c.n13,ra=c.n14,ja=c.n21,G=c.n22,u=c.n23,S=c.n24,L=c.n31,T=c.n32,Z=c.n33,ya=c.n34,V=c.n41,M=c.n42,e=c.n43,ua=c.n44;this.n11=d*wa+f*ja+i*L+h*V;this.n12=d*xa+f*G+i*T+h*M;this.n13=d*qa+f*u+i*Z+h*e;this.n14=d*ra+f*S+i*ya+h*ua;this.n21=j*wa+k*ja+m*L+n*V;this.n22=j*xa+k*G+m*T+n*M;this.n23=j*qa+k*u+m*Z+n*e;this.n24=j*ra+k*S+m*ya+n*ua;this.n31=q*wa+p*ja+t*L+v*V;this.n32=q*xa+p*G+t*T+v*M;this.n33=q*qa+p*u+t*Z+v*e;this.n34=q*ra+p*S+t*ya+v*ua;this.n41=B*wa+x*ja+E*L+F*V;this.n42=B*xa+x*G+E*T+F*M;this.n43=
+THREE.Matrix4=function(b,c,d,f,h,i,j,k,m,n,q,p,t,v,B,x){this.set(b!==void 0?b:1,c||0,d||0,f||0,h||0,i!==void 0?i:1,j||0,k||0,m||0,n||0,q!==void 0?q:1,p||0,t||0,v||0,B||0,x!==void 0?x:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,d,f,h,i,j,k,m,n,q,p,t,v,B,x){this.n11=b;this.n12=c;this.n13=d;this.n14=f;this.n21=h;this.n22=i;this.n23=j;this.n24=k;this.n31=m;this.n32=n;this.n33=q;this.n34=p;this.n41=t;this.n42=v;this.n43=B;this.n44=x;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 f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,i=THREE.Matrix4.__v3;i.sub(b,c).normalize();if(i.length()===0)i.z=1;f.cross(d,i).normalize();f.length()===0&&(i.x+=1.0E-4,f.cross(d,i).normalize());h.cross(i,f).normalize();this.n11=f.x;this.n12=h.x;this.n13=i.x;this.n21=f.y;this.n22=h.y;this.n23=i.y;this.n31=f.z;this.n32=h.z;this.n33=i.z;return this},multiplyVector3:function(b){var c=b.x,d=b.y,f=b.z,h=1/(this.n41*c+this.n42*d+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*d+this.n13*f+this.n14)*h;
+b.y=(this.n21*c+this.n22*d+this.n23*f+this.n24)*h;b.z=(this.n31*c+this.n32*d+this.n33*f+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,d=b.y,f=b.z,h=b.w;b.x=this.n11*c+this.n12*d+this.n13*f+this.n14*h;b.y=this.n21*c+this.n22*d+this.n23*f+this.n24*h;b.z=this.n31*c+this.n32*d+this.n33*f+this.n34*h;b.w=this.n41*c+this.n42*d+this.n43*f+this.n44*h;return b},rotateAxis:function(b){var c=b.x,d=b.y,f=b.z;b.x=c*this.n11+d*this.n12+f*this.n13;b.y=c*this.n21+d*this.n22+f*this.n23;b.z=c*this.n31+
+d*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var d=b.n11,f=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,m=b.n23,n=b.n24,q=b.n31,p=b.n32,t=b.n33,v=b.n34,B=b.n41,x=b.n42,E=b.n43,F=b.n44,wa=c.n11,xa=
+c.n12,qa=c.n13,ra=c.n14,ja=c.n21,G=c.n22,u=c.n23,S=c.n24,L=c.n31,T=c.n32,Z=c.n33,ya=c.n34,V=c.n41,M=c.n42,e=c.n43,ua=c.n44;this.n11=d*wa+f*ja+h*L+i*V;this.n12=d*xa+f*G+h*T+i*M;this.n13=d*qa+f*u+h*Z+i*e;this.n14=d*ra+f*S+h*ya+i*ua;this.n21=j*wa+k*ja+m*L+n*V;this.n22=j*xa+k*G+m*T+n*M;this.n23=j*qa+k*u+m*Z+n*e;this.n24=j*ra+k*S+m*ya+n*ua;this.n31=q*wa+p*ja+t*L+v*V;this.n32=q*xa+p*G+t*T+v*M;this.n33=q*qa+p*u+t*Z+v*e;this.n34=q*ra+p*S+t*ya+v*ua;this.n41=B*wa+x*ja+E*L+F*V;this.n42=B*xa+x*G+E*T+F*M;this.n43=
 B*qa+x*u+E*Z+F*e;this.n44=B*ra+x*S+E*ya+F*ua;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.n11,c=this.n12,d=this.n13,f=this.n14,i=this.n21,h=this.n22,j=this.n23,k=this.n24,m=this.n31,n=this.n32,q=this.n33,p=this.n34,t=this.n41,v=this.n42,B=this.n43,x=this.n44;return f*j*n*t-d*k*n*t-f*h*q*t+c*k*q*t+d*h*p*t-c*j*p*t-f*j*m*v+d*k*m*v+f*i*q*v-b*k*q*v-d*i*p*v+b*j*p*v+f*h*m*B-c*k*m*B-f*i*n*B+b*k*n*B+c*i*p*B-b*h*p*B-d*h*m*x+c*j*
-m*x+d*i*n*x-b*j*n*x-c*i*q*x+b*h*q*x},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;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,f=this.n14,h=this.n21,i=this.n22,j=this.n23,k=this.n24,m=this.n31,n=this.n32,q=this.n33,p=this.n34,t=this.n41,v=this.n42,B=this.n43,x=this.n44;return f*j*n*t-d*k*n*t-f*i*q*t+c*k*q*t+d*i*p*t-c*j*p*t-f*j*m*v+d*k*m*v+f*h*q*v-b*k*q*v-d*h*p*v+b*j*p*v+f*i*m*B-c*k*m*B-f*h*n*B+b*k*n*B+c*h*p*B-b*i*p*B-d*i*m*x+c*j*
+m*x+d*h*n*x-b*j*n*x-c*h*q*x+b*i*q*x},transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32;
 b.n33=this.n33;b.n34=this.n34;b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]=
 this.n11;b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=
 this.n34;b[c+15]=this.n44;return b},setTranslation:function(b,c,d){this.set(1,0,0,b,0,1,0,c,0,0,1,d,0,0,0,1);return this},setScale:function(b,c,d){this.set(b,0,0,0,0,c,0,0,0,0,d,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,-b,0,
-0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var d=Math.cos(c),f=Math.sin(c),i=1-d,h=b.x,j=b.y,k=b.z,m=i*h,n=i*j;this.set(m*h+d,m*j-f*k,m*k+f*j,0,m*j+f*k,n*j+d,n*k-f*h,0,m*k-f*j,n*k+f*h,i*k*k+d,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
-new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var d=b.x,f=b.y,i=b.z,h=Math.cos(d),d=Math.sin(d),j=Math.cos(f),f=Math.sin(f),k=Math.cos(i),i=Math.sin(i);switch(c){case "YXZ":var m=
-j*k,n=j*i,q=f*k,p=f*i;this.n11=m+p*d;this.n12=q*d-n;this.n13=h*f;this.n21=h*i;this.n22=h*k;this.n23=-d;this.n31=n*d-q;this.n32=p+m*d;this.n33=h*j;break;case "ZXY":m=j*k;n=j*i;q=f*k;p=f*i;this.n11=m-p*d;this.n12=-h*i;this.n13=q+n*d;this.n21=n+q*d;this.n22=h*k;this.n23=p-m*d;this.n31=-h*f;this.n32=d;this.n33=h*j;break;case "ZYX":m=h*k;n=h*i;q=d*k;p=d*i;this.n11=j*k;this.n12=q*f-n;this.n13=m*f+p;this.n21=j*i;this.n22=p*f+m;this.n23=n*f-q;this.n31=-f;this.n32=d*j;this.n33=h*j;break;case "YZX":m=h*j;n=
-h*f;q=d*j;p=d*f;this.n11=j*k;this.n12=p-m*i;this.n13=q*i+n;this.n21=i;this.n22=h*k;this.n23=-d*k;this.n31=-f*k;this.n32=n*i+q;this.n33=m-p*i;break;case "XZY":m=h*j;n=h*f;q=d*j;p=d*f;this.n11=j*k;this.n12=-i;this.n13=f*k;this.n21=m*i+p;this.n22=h*k;this.n23=n*i-q;this.n31=q*i-n;this.n32=d*k;this.n33=p*i+m;break;default:m=h*k,n=h*i,q=d*k,p=d*i,this.n11=j*k,this.n12=-j*i,this.n13=f,this.n21=n+q*f,this.n22=m-p*f,this.n23=-d*j,this.n31=p-m*f,this.n32=q+n*f,this.n33=h*j}return this},setRotationFromQuaternion:function(b){var c=
-b.x,d=b.y,f=b.z,i=b.w,h=c+c,j=d+d,k=f+f,b=c*h,m=c*j;c*=k;var n=d*j;d*=k;f*=k;h*=i;j*=i;i*=k;this.n11=1-(n+f);this.n12=m-i;this.n13=c+j;this.n21=m+i;this.n22=1-(b+f);this.n23=d-h;this.n31=c-j;this.n32=d+h;this.n33=1-(b+n);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},compose:function(b,c,d){var f=THREE.Matrix4.__m1,i=THREE.Matrix4.__m2;
-f.identity();f.setRotationFromQuaternion(c);i.setScale(d.x,d.y,d.z);this.multiply(f,i);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,d){var f=THREE.Matrix4.__v1,i=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);i.set(this.n12,this.n22,this.n32);h.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;d=d instanceof THREE.Vector3?d:new THREE.Vector3;d.x=f.length();
-d.y=i.length();d.z=h.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=d.x;f.n21/=d.x;f.n31/=d.x;f.n12/=d.y;f.n22/=d.y;f.n32/=d.y;f.n13/=d.z;f.n23/=d.z;f.n33/=d.z;c.setFromRotationMatrix(f);return[b,c,d]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var d=1/c.x,f=1/c.y,i=1/c.z;this.n11=b.n11*d;this.n21=b.n21*d;this.n31=b.n31*d;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*i;this.n23=
-b.n23*i;this.n33=b.n33*i}};
-THREE.Matrix4.makeInvert=function(b,c){var d=b.n11,f=b.n12,i=b.n13,h=b.n14,j=b.n21,k=b.n22,m=b.n23,n=b.n24,q=b.n31,p=b.n32,t=b.n33,v=b.n34,B=b.n41,x=b.n42,E=b.n43,F=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=m*v*x-n*t*x+n*p*E-k*v*E-m*p*F+k*t*F;c.n12=h*t*x-i*v*x-h*p*E+f*v*E+i*p*F-f*t*F;c.n13=i*n*x-h*m*x+h*k*E-f*n*E-i*k*F+f*m*F;c.n14=h*m*p-i*n*p-h*k*t+f*n*t+i*k*v-f*m*v;c.n21=n*t*B-m*v*B-n*q*E+j*v*E+m*q*F-j*t*F;c.n22=i*v*B-h*t*B+h*q*E-d*v*E-i*q*F+d*t*F;c.n23=h*m*B-i*n*B-h*j*E+d*n*E+i*j*F-d*m*F;c.n24=
-i*n*q-h*m*q+h*j*t-d*n*t-i*j*v+d*m*v;c.n31=k*v*B-n*p*B+n*q*x-j*v*x-k*q*F+j*p*F;c.n32=h*p*B-f*v*B-h*q*x+d*v*x+f*q*F-d*p*F;c.n33=i*n*B-h*k*B+h*j*x-d*n*x-f*j*F+d*k*F;c.n34=h*k*q-f*n*q-h*j*p+d*n*p+f*j*v-d*k*v;c.n41=m*p*B-k*t*B-m*q*x+j*t*x+k*q*E-j*p*E;c.n42=f*t*B-i*p*B+i*q*x-d*t*x-f*q*E+d*p*E;c.n43=i*k*B-f*m*B-i*j*x+d*m*x+f*j*E-d*k*E;c.n44=f*m*q-i*k*q+i*j*p-d*m*p-f*j*t+d*k*t;c.multiplyScalar(1/b.determinant());return c};
-THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,d=c.m,f=b.n33*b.n22-b.n32*b.n23,i=-b.n33*b.n21+b.n31*b.n23,h=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,n=b.n23*b.n12-b.n22*b.n13,q=-b.n23*b.n11+b.n21*b.n13,p=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*j+b.n31*n;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;d[0]=b*f;d[1]=b*i;d[2]=b*h;d[3]=b*j;d[4]=b*k;d[5]=b*m;d[6]=b*n;d[7]=b*q;d[8]=b*p;return c};
-THREE.Matrix4.makeFrustum=function(b,c,d,f,i,h){var j;j=new THREE.Matrix4;j.n11=2*i/(c-b);j.n12=0;j.n13=(c+b)/(c-b);j.n14=0;j.n21=0;j.n22=2*i/(f-d);j.n23=(f+d)/(f-d);j.n24=0;j.n31=0;j.n32=0;j.n33=-(h+i)/(h-i);j.n34=-2*h*i/(h-i);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};THREE.Matrix4.makePerspective=function(b,c,d,f){var i,b=d*Math.tan(b*Math.PI/360);i=-b;return THREE.Matrix4.makeFrustum(i*c,b*c,i,b,d,f)};
-THREE.Matrix4.makeOrtho=function(b,c,d,f,i,h){var j,k,m,n;j=new THREE.Matrix4;k=c-b;m=d-f;n=h-i;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+f)/m);j.n31=0;j.n32=0;j.n33=-2/n;j.n34=-((h+i)/n);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.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
+0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var d=Math.cos(c),f=Math.sin(c),h=1-d,i=b.x,j=b.y,k=b.z,m=h*i,n=h*j;this.set(m*i+d,m*j-f*k,m*k+f*j,0,m*j+f*k,n*j+d,n*k-f*i,0,m*k-f*j,n*k+f*i,h*k*k+d,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
+new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var d=b.x,f=b.y,h=b.z,i=Math.cos(d),d=Math.sin(d),j=Math.cos(f),f=Math.sin(f),k=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var m=
+j*k,n=j*h,q=f*k,p=f*h;this.n11=m+p*d;this.n12=q*d-n;this.n13=i*f;this.n21=i*h;this.n22=i*k;this.n23=-d;this.n31=n*d-q;this.n32=p+m*d;this.n33=i*j;break;case "ZXY":m=j*k;n=j*h;q=f*k;p=f*h;this.n11=m-p*d;this.n12=-i*h;this.n13=q+n*d;this.n21=n+q*d;this.n22=i*k;this.n23=p-m*d;this.n31=-i*f;this.n32=d;this.n33=i*j;break;case "ZYX":m=i*k;n=i*h;q=d*k;p=d*h;this.n11=j*k;this.n12=q*f-n;this.n13=m*f+p;this.n21=j*h;this.n22=p*f+m;this.n23=n*f-q;this.n31=-f;this.n32=d*j;this.n33=i*j;break;case "YZX":m=i*j;n=
+i*f;q=d*j;p=d*f;this.n11=j*k;this.n12=p-m*h;this.n13=q*h+n;this.n21=h;this.n22=i*k;this.n23=-d*k;this.n31=-f*k;this.n32=n*h+q;this.n33=m-p*h;break;case "XZY":m=i*j;n=i*f;q=d*j;p=d*f;this.n11=j*k;this.n12=-h;this.n13=f*k;this.n21=m*h+p;this.n22=i*k;this.n23=n*h-q;this.n31=q*h-n;this.n32=d*k;this.n33=p*h+m;break;default:m=i*k,n=i*h,q=d*k,p=d*h,this.n11=j*k,this.n12=-j*h,this.n13=f,this.n21=n+q*f,this.n22=m-p*f,this.n23=-d*j,this.n31=p-m*f,this.n32=q+n*f,this.n33=i*j}return this},setRotationFromQuaternion:function(b){var c=
+b.x,d=b.y,f=b.z,h=b.w,i=c+c,j=d+d,k=f+f,b=c*i,m=c*j;c*=k;var n=d*j;d*=k;f*=k;i*=h;j*=h;h*=k;this.n11=1-(n+f);this.n12=m-h;this.n13=c+j;this.n21=m+h;this.n22=1-(b+f);this.n23=d-i;this.n31=c-j;this.n32=d+i;this.n33=1-(b+n);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},compose:function(b,c,d){var f=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2;
+f.identity();f.setRotationFromQuaternion(c);h.setScale(d.x,d.y,d.z);this.multiply(f,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,d){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,i=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);i.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;d=d instanceof THREE.Vector3?d:new THREE.Vector3;d.x=f.length();
+d.y=h.length();d.z=i.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=d.x;f.n21/=d.x;f.n31/=d.x;f.n12/=d.y;f.n22/=d.y;f.n32/=d.y;f.n13/=d.z;f.n23/=d.z;f.n33/=d.z;c.setFromRotationMatrix(f);return[b,c,d]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var d=1/c.x,f=1/c.y,h=1/c.z;this.n11=b.n11*d;this.n21=b.n21*d;this.n31=b.n31*d;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*h;this.n23=
+b.n23*h;this.n33=b.n33*h}};
+THREE.Matrix4.makeInvert=function(b,c){var d=b.n11,f=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,m=b.n23,n=b.n24,q=b.n31,p=b.n32,t=b.n33,v=b.n34,B=b.n41,x=b.n42,E=b.n43,F=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=m*v*x-n*t*x+n*p*E-k*v*E-m*p*F+k*t*F;c.n12=i*t*x-h*v*x-i*p*E+f*v*E+h*p*F-f*t*F;c.n13=h*n*x-i*m*x+i*k*E-f*n*E-h*k*F+f*m*F;c.n14=i*m*p-h*n*p-i*k*t+f*n*t+h*k*v-f*m*v;c.n21=n*t*B-m*v*B-n*q*E+j*v*E+m*q*F-j*t*F;c.n22=h*v*B-i*t*B+i*q*E-d*v*E-h*q*F+d*t*F;c.n23=i*m*B-h*n*B-i*j*E+d*n*E+h*j*F-d*m*F;c.n24=
+h*n*q-i*m*q+i*j*t-d*n*t-h*j*v+d*m*v;c.n31=k*v*B-n*p*B+n*q*x-j*v*x-k*q*F+j*p*F;c.n32=i*p*B-f*v*B-i*q*x+d*v*x+f*q*F-d*p*F;c.n33=h*n*B-i*k*B+i*j*x-d*n*x-f*j*F+d*k*F;c.n34=i*k*q-f*n*q-i*j*p+d*n*p+f*j*v-d*k*v;c.n41=m*p*B-k*t*B-m*q*x+j*t*x+k*q*E-j*p*E;c.n42=f*t*B-h*p*B+h*q*x-d*t*x-f*q*E+d*p*E;c.n43=h*k*B-f*m*B-h*j*x+d*m*x+f*j*E-d*k*E;c.n44=f*m*q-h*k*q+h*j*p-d*m*p-f*j*t+d*k*t;c.multiplyScalar(1/b.determinant());return c};
+THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,d=c.m,f=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,i=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,n=b.n23*b.n12-b.n22*b.n13,q=-b.n23*b.n11+b.n21*b.n13,p=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*j+b.n31*n;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;d[0]=b*f;d[1]=b*h;d[2]=b*i;d[3]=b*j;d[4]=b*k;d[5]=b*m;d[6]=b*n;d[7]=b*q;d[8]=b*p;return c};
+THREE.Matrix4.makeFrustum=function(b,c,d,f,h,i){var j;j=new THREE.Matrix4;j.n11=2*h/(c-b);j.n12=0;j.n13=(c+b)/(c-b);j.n14=0;j.n21=0;j.n22=2*h/(f-d);j.n23=(f+d)/(f-d);j.n24=0;j.n31=0;j.n32=0;j.n33=-(i+h)/(i-h);j.n34=-2*i*h/(i-h);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};THREE.Matrix4.makePerspective=function(b,c,d,f){var h,b=d*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,d,f)};
+THREE.Matrix4.makeOrtho=function(b,c,d,f,h,i){var j,k,m,n;j=new THREE.Matrix4;k=c-b;m=d-f;n=i-h;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+f)/m);j.n31=0;j.n32=0;j.n33=-2/n;j.n34=-((i+h)/n);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.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
 !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
-THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this instanceof THREE.Camera?this.matrix.lookAt(this.position,b,this.up):this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&
-this.rotation.setRotationFromMatrix(this.matrix)},add:function(b){if(this.children.indexOf(b)===-1){b.parent!==void 0&&b.parent.removeChild(b);b.parent=this;this.children.push(b);for(var c=this;c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.addChildRecurse(b)}},remove:function(b){var c=this,d=this.children.indexOf(b);if(d!==-1){b.parent=void 0;for(this.children.splice(d,1);c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.removeChildRecurse(b)}},getChildByName:function(b,
-c){var d,f,i;d=0;for(f=this.children.length;d<f;d++){i=this.children[d];if(i.name===b)return i;if(c&&(i=i.getChildByName(b,c),i!==void 0))return i}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,
-this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,d){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||c)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,c=!0;for(var b=0,f=this.children.length;b<f;b++)this.children[b].update(this.matrixWorld,c,d)},addChild:function(b){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");
-this.add(b)},removeChild:function(b){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");this.remove(b)}};THREE.Object3DCount=0;
-THREE.Projector=function(){function b(){var b=m[k]=m[k]||new THREE.RenderableVertex;k++;return b}function c(b,c){return c.z-b.z}function d(b,c){var d=0,e=1,f=b.z+b.w,i=c.z+c.w,h=-b.z+b.w,j=-c.z+c.w;return f>=0&&i>=0&&h>=0&&j>=0?!0:f<0&&i<0||h<0&&j<0?!1:(f<0?d=Math.max(d,f/(f-i)):i<0&&(e=Math.min(e,f/(f-i))),h<0?d=Math.max(d,h/(h-j)):j<0&&(e=Math.min(e,h/(h-j))),e<d?!1:(b.lerpSelf(c,d),c.lerpSelf(b,1-e),!0))}var f,i,h=[],j,k,m=[],n,q,p=[],t,v=[],B,x,E=[],F,wa,xa=[],qa=[],ra=[],ja=new THREE.Vector4,
+THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(b){if(this.children.indexOf(b)===
+-1){b.parent!==void 0&&b.parent.removeChild(b);b.parent=this;this.children.push(b);for(var c=this;c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.addChildRecurse(b)}},remove:function(b){var c=this,d=this.children.indexOf(b);if(d!==-1){b.parent=void 0;for(this.children.splice(d,1);c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.removeChildRecurse(b)}},getChildByName:function(b,c){var d,f,h;d=0;for(f=this.children.length;d<f;d++){h=this.children[d];if(h.name===
+b)return h;if(c&&(h=h.getChildByName(b,c),h!==void 0))return h}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,d){this.matrixAutoUpdate&&
+this.updateMatrix();if(this.matrixWorldNeedsUpdate||c)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,c=!0;for(var b=0,f=this.children.length;b<f;b++)this.children[b].update(this.matrixWorld,c,d)},addChild:function(b){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");this.add(b)},removeChild:function(b){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");
+this.remove(b)}};THREE.Object3DCount=0;
+THREE.Projector=function(){function b(){var b=m[k]=m[k]||new THREE.RenderableVertex;k++;return b}function c(b,c){return c.z-b.z}function d(b,c){var d=0,e=1,f=b.z+b.w,h=c.z+c.w,i=-b.z+b.w,j=-c.z+c.w;return f>=0&&h>=0&&i>=0&&j>=0?!0:f<0&&h<0||i<0&&j<0?!1:(f<0?d=Math.max(d,f/(f-h)):h<0&&(e=Math.min(e,f/(f-h))),i<0?d=Math.max(d,i/(i-j)):j<0&&(e=Math.min(e,i/(i-j))),e<d?!1:(b.lerpSelf(c,d),c.lerpSelf(b,1-e),!0))}var f,h,i=[],j,k,m=[],n,q,p=[],t,v=[],B,x,E=[],F,wa,xa=[],qa=[],ra=[],ja=new THREE.Vector4,
 G=new THREE.Vector4,u=new THREE.Matrix4,S=new THREE.Matrix4,L=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],T=new THREE.Vector4,Z=new THREE.Vector4;this.projectVector=function(b,c){u.multiply(c.projectionMatrix,c.matrixWorldInverse);u.multiplyVector3(b);return b};this.unprojectVector=function(b,c){u.multiply(c.matrixWorld,THREE.Matrix4.makeInvert(c.projectionMatrix));u.multiplyVector3(b);return b};this.projectObjects=function(b,d,j){var e,
-k;i=qa.length=0;e=b.objects;b=0;for(d=e.length;b<d;b++){k=e[b];var n;if(!(n=!k.visible))if(n=k instanceof THREE.Mesh)if(n=k.frustumCulled){a:{n=void 0;for(var m=k.matrixWorld,q=-k.geometry.boundingSphere.radius*Math.max(k.scale.x,Math.max(k.scale.y,k.scale.z)),p=0;p<6;p++)if(n=L[p].x*m.n14+L[p].y*m.n24+L[p].z*m.n34+L[p].w,n<=q){n=!1;break a}n=!0}n=!n}if(!n)n=h[i]=h[i]||new THREE.RenderableObject,i++,f=n,ja.copy(k.position),u.multiplyVector3(ja),f.object=k,f.z=ja.z,qa.push(f)}j&&qa.sort(c);return qa};
-this.projectScene=function(f,i,h){var e=i.near,qa=i.far,ja,va,U,W,J,$,N,ka,sa,Q,Aa,Ja,Ta,Ka,Ba,Ea,za;wa=x=t=q=ra.length=0;i.matrixAutoUpdate&&i.update(void 0,!0);f.update(void 0,!1,i);u.multiply(i.projectionMatrix,i.matrixWorldInverse);L[0].set(u.n41-u.n11,u.n42-u.n12,u.n43-u.n13,u.n44-u.n14);L[1].set(u.n41+u.n11,u.n42+u.n12,u.n43+u.n13,u.n44+u.n14);L[2].set(u.n41+u.n21,u.n42+u.n22,u.n43+u.n23,u.n44+u.n24);L[3].set(u.n41-u.n21,u.n42-u.n22,u.n43-u.n23,u.n44-u.n24);L[4].set(u.n41-u.n31,u.n42-u.n32,
-u.n43-u.n33,u.n44-u.n34);L[5].set(u.n41+u.n31,u.n42+u.n32,u.n43+u.n33,u.n44+u.n34);for(ja=0;ja<6;ja++)sa=L[ja],sa.divideScalar(Math.sqrt(sa.x*sa.x+sa.y*sa.y+sa.z*sa.z));sa=this.projectObjects(f,i,!0);f=0;for(ja=sa.length;f<ja;f++)if(Q=sa[f].object,Q.visible)if(Aa=Q.matrixWorld,Ja=Q.matrixRotationWorld,Ta=Q.materials,Ka=Q.overdraw,k=0,Q instanceof THREE.Mesh){Ba=Q.geometry;W=Ba.vertices;Ea=Ba.faces;Ba=Ba.faceVertexUvs;va=0;for(U=W.length;va<U;va++)j=b(),j.positionWorld.copy(W[va].position),Aa.multiplyVector3(j.positionWorld),
+k;h=qa.length=0;e=b.objects;b=0;for(d=e.length;b<d;b++){k=e[b];var n;if(!(n=!k.visible))if(n=k instanceof THREE.Mesh)if(n=k.frustumCulled){a:{n=void 0;for(var m=k.matrixWorld,q=-k.geometry.boundingSphere.radius*Math.max(k.scale.x,Math.max(k.scale.y,k.scale.z)),p=0;p<6;p++)if(n=L[p].x*m.n14+L[p].y*m.n24+L[p].z*m.n34+L[p].w,n<=q){n=!1;break a}n=!0}n=!n}if(!n)n=i[h]=i[h]||new THREE.RenderableObject,h++,f=n,ja.copy(k.position),u.multiplyVector3(ja),f.object=k,f.z=ja.z,qa.push(f)}j&&qa.sort(c);return qa};
+this.projectScene=function(f,h,i){var e=h.near,qa=h.far,ja,va,U,W,J,$,N,ka,sa,Q,Aa,Ja,Ta,Ka,Ba,Ea,za;wa=x=t=q=ra.length=0;h.matrixAutoUpdate&&h.update(void 0,!0);f.update(void 0,!1,h);u.multiply(h.projectionMatrix,h.matrixWorldInverse);L[0].set(u.n41-u.n11,u.n42-u.n12,u.n43-u.n13,u.n44-u.n14);L[1].set(u.n41+u.n11,u.n42+u.n12,u.n43+u.n13,u.n44+u.n14);L[2].set(u.n41+u.n21,u.n42+u.n22,u.n43+u.n23,u.n44+u.n24);L[3].set(u.n41-u.n21,u.n42-u.n22,u.n43-u.n23,u.n44-u.n24);L[4].set(u.n41-u.n31,u.n42-u.n32,
+u.n43-u.n33,u.n44-u.n34);L[5].set(u.n41+u.n31,u.n42+u.n32,u.n43+u.n33,u.n44+u.n34);for(ja=0;ja<6;ja++)sa=L[ja],sa.divideScalar(Math.sqrt(sa.x*sa.x+sa.y*sa.y+sa.z*sa.z));sa=this.projectObjects(f,h,!0);f=0;for(ja=sa.length;f<ja;f++)if(Q=sa[f].object,Q.visible)if(Aa=Q.matrixWorld,Ja=Q.matrixRotationWorld,Ta=Q.materials,Ka=Q.overdraw,k=0,Q instanceof THREE.Mesh){Ba=Q.geometry;W=Ba.vertices;Ea=Ba.faces;Ba=Ba.faceVertexUvs;va=0;for(U=W.length;va<U;va++)j=b(),j.positionWorld.copy(W[va].position),Aa.multiplyVector3(j.positionWorld),
 j.positionScreen.copy(j.positionWorld),u.multiplyVector4(j.positionScreen),j.positionScreen.x/=j.positionScreen.w,j.positionScreen.y/=j.positionScreen.w,j.visible=j.positionScreen.z>e&&j.positionScreen.z<qa;W=0;for(va=Ea.length;W<va;W++){U=Ea[W];if(U instanceof THREE.Face3)if(J=m[U.a],$=m[U.b],N=m[U.c],J.visible&&$.visible&&N.visible&&(Q.doubleSided||Q.flipSided!=(N.positionScreen.x-J.positionScreen.x)*($.positionScreen.y-J.positionScreen.y)-(N.positionScreen.y-J.positionScreen.y)*($.positionScreen.x-
 J.positionScreen.x)<0))ka=p[q]=p[q]||new THREE.RenderableFace3,q++,n=ka,n.v1.copy(J),n.v2.copy($),n.v3.copy(N);else continue;else if(U instanceof THREE.Face4)if(J=m[U.a],$=m[U.b],N=m[U.c],ka=m[U.d],J.visible&&$.visible&&N.visible&&ka.visible&&(Q.doubleSided||Q.flipSided!=((ka.positionScreen.x-J.positionScreen.x)*($.positionScreen.y-J.positionScreen.y)-(ka.positionScreen.y-J.positionScreen.y)*($.positionScreen.x-J.positionScreen.x)<0||($.positionScreen.x-N.positionScreen.x)*(ka.positionScreen.y-N.positionScreen.y)-
 ($.positionScreen.y-N.positionScreen.y)*(ka.positionScreen.x-N.positionScreen.x)<0)))za=v[t]=v[t]||new THREE.RenderableFace4,t++,n=za,n.v1.copy(J),n.v2.copy($),n.v3.copy(N),n.v4.copy(ka);else continue;n.normalWorld.copy(U.normal);Ja.multiplyVector3(n.normalWorld);n.centroidWorld.copy(U.centroid);Aa.multiplyVector3(n.centroidWorld);n.centroidScreen.copy(n.centroidWorld);u.multiplyVector3(n.centroidScreen);N=U.vertexNormals;J=0;for($=N.length;J<$;J++)ka=n.vertexNormalsWorld[J],ka.copy(N[J]),Ja.multiplyVector3(ka);
 J=0;for($=Ba.length;J<$;J++)if(za=Ba[J][W]){N=0;for(ka=za.length;N<ka;N++)n.uvs[J][N]=za[N]}n.meshMaterials=Ta;n.faceMaterials=U.materials;n.overdraw=Ka;n.z=n.centroidScreen.z;ra.push(n)}}else if(Q instanceof THREE.Line){S.multiply(u,Aa);W=Q.geometry.vertices;J=b();J.positionScreen.copy(W[0].position);S.multiplyVector4(J.positionScreen);va=1;for(U=W.length;va<U;va++)if(J=b(),J.positionScreen.copy(W[va].position),S.multiplyVector4(J.positionScreen),$=m[k-2],T.copy(J.positionScreen),Z.copy($.positionScreen),
 d(T,Z))T.multiplyScalar(1/T.w),Z.multiplyScalar(1/Z.w),Aa=E[x]=E[x]||new THREE.RenderableLine,x++,B=Aa,B.v1.positionScreen.copy(T),B.v2.positionScreen.copy(Z),B.z=Math.max(T.z,Z.z),B.materials=Q.materials,ra.push(B)}else if(Q instanceof THREE.Particle&&(G.set(Q.matrixWorld.n14,Q.matrixWorld.n24,Q.matrixWorld.n34,1),u.multiplyVector4(G),G.z/=G.w,G.z>0&&G.z<1))Aa=xa[wa]=xa[wa]||new THREE.RenderableParticle,wa++,F=Aa,F.x=G.x/G.w,F.y=G.y/G.w,F.z=G.z,F.rotation=Q.rotation.z,F.scale.x=Q.scale.x*Math.abs(F.x-
-(G.x+i.projectionMatrix.n11)/(G.w+i.projectionMatrix.n14)),F.scale.y=Q.scale.y*Math.abs(F.y-(G.y+i.projectionMatrix.n22)/(G.w+i.projectionMatrix.n24)),F.materials=Q.materials,ra.push(F);h&&ra.sort(c);return ra}};THREE.Quaternion=function(b,c,d,f){this.set(b||0,c||0,d||0,f!==void 0?f:1)};
-THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,d,f){this.x=b;this.y=c;this.z=d;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,d=b.x*c,f=b.y*c,i=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-i),i=Math.sin(-i),h=Math.cos(d),d=Math.sin(d),j=b*c,k=f*i;this.w=j*h-k*d;this.x=j*d+k*h;this.y=f*c*h+b*i*d;this.z=b*i*h-f*c*d;return this},setFromAxisAngle:function(b,c){var d=c/2,f=Math.sin(d);
+(G.x+h.projectionMatrix.n11)/(G.w+h.projectionMatrix.n14)),F.scale.y=Q.scale.y*Math.abs(F.y-(G.y+h.projectionMatrix.n22)/(G.w+h.projectionMatrix.n24)),F.materials=Q.materials,ra.push(F);i&&ra.sort(c);return ra}};THREE.Quaternion=function(b,c,d,f){this.set(b||0,c||0,d||0,f!==void 0?f:1)};
+THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,d,f){this.x=b;this.y=c;this.z=d;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,d=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),i=Math.cos(d),d=Math.sin(d),j=b*c,k=f*h;this.w=j*i-k*d;this.x=j*d+k*i;this.y=f*c*i+b*h*d;this.z=b*h*i-f*c*d;return this},setFromAxisAngle:function(b,c){var d=c/2,f=Math.sin(d);
 this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(d);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z);
 this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c=
-this.x,d=this.y,f=this.z,i=this.w,h=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+i*h+d*k-f*j;this.y=d*b+i*j+f*h-c*k;this.z=f*b+i*k+c*j-d*h;this.w=i*b-c*h-d*j-f*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,f=b.y,i=b.z,h=this.x,j=this.y,k=this.z,m=this.w,n=m*d+j*i-k*f,q=m*f+k*d-h*i,p=m*i+h*f-j*d,d=-h*
-d-j*f-k*i;c.x=n*m+d*-h+q*-k-p*-j;c.y=q*m+d*-j+p*-h-n*-k;c.z=p*m+d*-k+n*-j-q*-h;return c}};THREE.Quaternion.slerp=function(b,c,d,f){var i=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(i)>=1)return d.w=b.w,d.x=b.x,d.y=b.y,d.z=b.z,d;var h=Math.acos(i),j=Math.sqrt(1-i*i);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;i=Math.sin((1-f)*h)/j;f=Math.sin(f*h)/j;d.w=b.w*i+c.w*f;d.x=b.x*i+c.x*f;d.y=b.y*i+c.y*f;d.z=b.z*i+c.z*f;return d};
-THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,d,f,i,h){this.a=b;this.b=c;this.c=d;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];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.Face4=function(b,c,d,f,i,h,j){this.a=b;this.b=c;this.c=d;this.d=f;this.normal=i instanceof THREE.Vector3?i:new THREE.Vector3;this.vertexNormals=i instanceof Array?i:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0};
+this.x,d=this.y,f=this.z,h=this.w,i=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+h*i+d*k-f*j;this.y=d*b+h*j+f*i-c*k;this.z=f*b+h*k+c*j-d*i;this.w=h*b-c*i-d*j-f*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,f=b.y,h=b.z,i=this.x,j=this.y,k=this.z,m=this.w,n=m*d+j*h-k*f,q=m*f+k*d-i*h,p=m*h+i*f-j*d,d=-i*
+d-j*f-k*h;c.x=n*m+d*-i+q*-k-p*-j;c.y=q*m+d*-j+p*-i-n*-k;c.z=p*m+d*-k+n*-j-q*-i;return c}};THREE.Quaternion.slerp=function(b,c,d,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return d.w=b.w,d.x=b.x,d.y=b.y,d.z=b.z,d;var i=Math.acos(h),j=Math.sqrt(1-h*h);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;h=Math.sin((1-f)*i)/j;f=Math.sin(f*i)/j;d.w=b.w*h+c.w*f;d.x=b.x*h+c.x*f;d.y=b.y*h+c.y*f;d.z=b.z*h+c.z*f;return d};
+THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,d,f,h,i){this.a=b;this.b=c;this.c=d;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=i instanceof Array?i:[i];this.centroid=new THREE.Vector3};
+THREE.Face4=function(b,c,d,f,h,i,j){this.a=b;this.b=c;this.c=d;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=i instanceof THREE.Color?i:new THREE.Color;this.vertexColors=i instanceof Array?i:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0};
 THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
 THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
-THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var d=0,f=this.vertices.length;d<f;d++)b.multiplyVector3(this.vertices[d].position);d=0;for(f=this.faces.length;d<f;d++){var i=this.faces[d];c.multiplyVector3(i.normal);for(var h=0,j=i.vertexNormals.length;h<j;h++)c.multiplyVector3(i.vertexNormals[h]);b.multiplyVector3(i.centroid)}},computeCentroids:function(){var b,c,d;b=0;for(c=this.faces.length;b<
+THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var d=0,f=this.vertices.length;d<f;d++)b.multiplyVector3(this.vertices[d].position);d=0;for(f=this.faces.length;d<f;d++){var h=this.faces[d];c.multiplyVector3(h.normal);for(var i=0,j=h.vertexNormals.length;i<j;i++)c.multiplyVector3(h.vertexNormals[i]);b.multiplyVector3(h.centroid)}},computeCentroids:function(){var b,c,d;b=0;for(c=this.faces.length;b<
 c;b++)d=this.faces[b],d.centroid.set(0,0,0),d instanceof THREE.Face3?(d.centroid.addSelf(this.vertices[d.a].position),d.centroid.addSelf(this.vertices[d.b].position),d.centroid.addSelf(this.vertices[d.c].position),d.centroid.divideScalar(3)):d instanceof THREE.Face4&&(d.centroid.addSelf(this.vertices[d.a].position),d.centroid.addSelf(this.vertices[d.b].position),d.centroid.addSelf(this.vertices[d.c].position),d.centroid.addSelf(this.vertices[d.d].position),d.centroid.divideScalar(4))},computeFaceNormals:function(b){var c,
-d,f,i,h,j,k=new THREE.Vector3,m=new THREE.Vector3;f=0;for(i=this.faces.length;f<i;f++){h=this.faces[f];if(b&&h.vertexNormals.length){k.set(0,0,0);c=0;for(d=h.vertexNormals.length;c<d;c++)k.addSelf(h.vertexNormals[c]);k.divideScalar(3)}else c=this.vertices[h.a],d=this.vertices[h.b],j=this.vertices[h.c],k.sub(j.position,d.position),m.sub(c.position,d.position),k.crossSelf(m);k.isZero()||k.normalize();h.normal.copy(k)}},computeVertexNormals:function(){var b,c,d,f;if(this.__tmpVertices==void 0){f=this.__tmpVertices=
+d,f,h,i,j,k=new THREE.Vector3,m=new THREE.Vector3;f=0;for(h=this.faces.length;f<h;f++){i=this.faces[f];if(b&&i.vertexNormals.length){k.set(0,0,0);c=0;for(d=i.vertexNormals.length;c<d;c++)k.addSelf(i.vertexNormals[c]);k.divideScalar(3)}else c=this.vertices[i.a],d=this.vertices[i.b],j=this.vertices[i.c],k.sub(j.position,d.position),m.sub(c.position,d.position),k.crossSelf(m);k.isZero()||k.normalize();i.normal.copy(k)}},computeVertexNormals:function(){var b,c,d,f;if(this.__tmpVertices==void 0){f=this.__tmpVertices=
 Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)f[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)if(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{f=this.__tmpVertices;b=0;for(c=this.vertices.length;b<c;b++)f[b].set(0,0,0)}b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d instanceof
 THREE.Face3?(f[d.a].addSelf(d.normal),f[d.b].addSelf(d.normal),f[d.c].addSelf(d.normal)):d instanceof THREE.Face4&&(f[d.a].addSelf(d.normal),f[d.b].addSelf(d.normal),f[d.c].addSelf(d.normal),f[d.d].addSelf(d.normal));b=0;for(c=this.vertices.length;b<c;b++)f[b].normalize();b=0;for(c=this.faces.length;b<c;b++)d=this.faces[b],d instanceof THREE.Face3?(d.vertexNormals[0].copy(f[d.a]),d.vertexNormals[1].copy(f[d.b]),d.vertexNormals[2].copy(f[d.c])):d instanceof THREE.Face4&&(d.vertexNormals[0].copy(f[d.a]),
-d.vertexNormals[1].copy(f[d.b]),d.vertexNormals[2].copy(f[d.c]),d.vertexNormals[3].copy(f[d.d]))},computeTangents:function(){function b(b,e,c,d,f,i,h){k=b.vertices[e].position;m=b.vertices[c].position;n=b.vertices[d].position;q=j[f];p=j[i];t=j[h];v=m.x-k.x;B=n.x-k.x;x=m.y-k.y;E=n.y-k.y;F=m.z-k.z;wa=n.z-k.z;xa=p.u-q.u;qa=t.u-q.u;ra=p.v-q.v;ja=t.v-q.v;G=1/(xa*ja-qa*ra);T.set((ja*v-ra*B)*G,(ja*x-ra*E)*G,(ja*F-ra*wa)*G);Z.set((xa*B-qa*v)*G,(xa*E-qa*x)*G,(xa*wa-qa*F)*G);S[e].addSelf(T);S[c].addSelf(T);
-S[d].addSelf(T);L[e].addSelf(Z);L[c].addSelf(Z);L[d].addSelf(Z)}var c,d,f,i,h,j,k,m,n,q,p,t,v,B,x,E,F,wa,xa,qa,ra,ja,G,u,S=[],L=[],T=new THREE.Vector3,Z=new THREE.Vector3,ya=new THREE.Vector3,V=new THREE.Vector3,M=new THREE.Vector3;c=0;for(d=this.vertices.length;c<d;c++)S[c]=new THREE.Vector3,L[c]=new THREE.Vector3;c=0;for(d=this.faces.length;c<d;c++)h=this.faces[c],j=this.faceVertexUvs[0][c],h instanceof THREE.Face3?b(this,h.a,h.b,h.c,0,1,2):h instanceof THREE.Face4&&(b(this,h.a,h.b,h.c,0,1,2),b(this,
-h.a,h.b,h.d,0,1,3));var e=["a","b","c","d"];c=0;for(d=this.faces.length;c<d;c++){h=this.faces[c];for(f=0;f<h.vertexNormals.length;f++)M.copy(h.vertexNormals[f]),i=h[e[f]],u=S[i],ya.copy(u),ya.subSelf(M.multiplyScalar(M.dot(u))).normalize(),V.cross(h.vertexNormals[f],u),i=V.dot(L[i]),i=i<0?-1:1,h.vertexTangents[f]=new THREE.Vector4(ya.x,ya.y,ya.z,i)}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],
+d.vertexNormals[1].copy(f[d.b]),d.vertexNormals[2].copy(f[d.c]),d.vertexNormals[3].copy(f[d.d]))},computeTangents:function(){function b(b,e,c,d,f,h,i){k=b.vertices[e].position;m=b.vertices[c].position;n=b.vertices[d].position;q=j[f];p=j[h];t=j[i];v=m.x-k.x;B=n.x-k.x;x=m.y-k.y;E=n.y-k.y;F=m.z-k.z;wa=n.z-k.z;xa=p.u-q.u;qa=t.u-q.u;ra=p.v-q.v;ja=t.v-q.v;G=1/(xa*ja-qa*ra);T.set((ja*v-ra*B)*G,(ja*x-ra*E)*G,(ja*F-ra*wa)*G);Z.set((xa*B-qa*v)*G,(xa*E-qa*x)*G,(xa*wa-qa*F)*G);S[e].addSelf(T);S[c].addSelf(T);
+S[d].addSelf(T);L[e].addSelf(Z);L[c].addSelf(Z);L[d].addSelf(Z)}var c,d,f,h,i,j,k,m,n,q,p,t,v,B,x,E,F,wa,xa,qa,ra,ja,G,u,S=[],L=[],T=new THREE.Vector3,Z=new THREE.Vector3,ya=new THREE.Vector3,V=new THREE.Vector3,M=new THREE.Vector3;c=0;for(d=this.vertices.length;c<d;c++)S[c]=new THREE.Vector3,L[c]=new THREE.Vector3;c=0;for(d=this.faces.length;c<d;c++)i=this.faces[c],j=this.faceVertexUvs[0][c],i instanceof THREE.Face3?b(this,i.a,i.b,i.c,0,1,2):i instanceof THREE.Face4&&(b(this,i.a,i.b,i.c,0,1,2),b(this,
+i.a,i.b,i.d,0,1,3));var e=["a","b","c","d"];c=0;for(d=this.faces.length;c<d;c++){i=this.faces[c];for(f=0;f<i.vertexNormals.length;f++)M.copy(i.vertexNormals[f]),h=i[e[f]],u=S[h],ya.copy(u),ya.subSelf(M.multiplyScalar(M.dot(u))).normalize(),V.cross(i.vertexNormals[f],u),h=V.dot(L[h]),h=h<0?-1:1,i.vertexTangents[f]=new THREE.Vector4(ya.x,ya.y,ya.z,h)}this.hasTangents=!0},computeBoundingBox:function(){var b;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],
 y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,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,c){return Math.min(b,c)+"_"+Math.max(b,c)}function c(b,c,d){b[c]===void 0?(b[c]={set:{},array:[]},b[c].set[d]=1,b[c].array.push(d)):b[c].set[d]===void 0&&(b[c].set[d]=
-1,b[c].array.push(d))}var d,f,i,h,j,k={};d=0;for(f=this.faces.length;d<f;d++)j=this.faces[d],j instanceof THREE.Face3?(i=b(j.a,j.b),c(k,i,d),i=b(j.b,j.c),c(k,i,d),i=b(j.a,j.c),c(k,i,d)):j instanceof THREE.Face4&&(i=b(j.b,j.d),c(k,i,d),i=b(j.a,j.b),c(k,i,d),i=b(j.a,j.d),c(k,i,d),i=b(j.b,j.c),c(k,i,d),i=b(j.c,j.d),c(k,i,d));d=0;for(f=this.edges.length;d<f;d++){j=this.edges[d];i=j.vertexIndices[0];h=j.vertexIndices[1];j.faceIndices=k[b(i,h)].array;for(i=0;i<j.faceIndices.length;i++)h=j.faceIndices[i],
-j.faces.push(this.faces[h])}}};THREE.GeometryCount=0;
-THREE.Spline=function(b){function c(b,c,d,f,i,h,j){b=(d-b)*0.5;f=(f-c)*0.5;return(2*(c-d)+b+f)*j+(-3*(c-d)-2*b-f)*h+b*i+c}this.points=b;var d=[],f={x:0,y:0,z:0},i,h,j,k,m,n,q,p,t;this.initFromArray=function(b){this.points=[];for(var c=0;c<b.length;c++)this.points[c]={x:b[c][0],y:b[c][1],z:b[c][2]}};this.getPoint=function(b){i=(this.points.length-1)*b;h=Math.floor(i);j=i-h;d[0]=h==0?h:h-1;d[1]=h;d[2]=h>this.points.length-2?h:h+1;d[3]=h>this.points.length-3?h:h+2;n=this.points[d[0]];q=this.points[d[1]];
-p=this.points[d[2]];t=this.points[d[3]];k=j*j;m=j*k;f.x=c(n.x,q.x,p.x,t.x,j,k,m);f.y=c(n.y,q.y,p.y,t.y,j,k,m);f.z=c(n.z,q.z,p.z,t.z,j,k,m);return f};this.getControlPointsArray=function(){var b,c,d=this.points.length,f=[];for(b=0;b<d;b++)c=this.points[b],f[b]=[c.x,c.y,c.z];return f};this.getLength=function(b){var c,d,f=c=c=0,i=new THREE.Vector3,h=new THREE.Vector3,j=[],k=0;j[0]=0;b||(b=100);d=this.points.length*b;i.copy(this.points[0]);for(b=1;b<d;b++)c=b/d,position=this.getPoint(c),h.copy(position),
-k+=h.distanceTo(i),i.copy(position),c*=this.points.length-1,c=Math.floor(c),c!=f&&(j[c]=k,f=c);j[j.length]=k;return{chunks:j,total:k}};this.reparametrizeByArcLength=function(b){var c,d,f,i,h,j,k=[],n=new THREE.Vector3,m=this.getLength();k.push(n.copy(this.points[0]).clone());for(c=1;c<this.points.length;c++){d=m.chunks[c]-m.chunks[c-1];j=Math.ceil(b*d/m.total);i=(c-1)/(this.points.length-1);h=c/(this.points.length-1);for(d=1;d<j-1;d++)f=i+d*(1/j)*(h-i),position=this.getPoint(f),k.push(n.copy(position).clone());
-k.push(n.copy(this.points[c]).clone())}this.points=k}};THREE.Edge=function(b,c,d,f){this.vertices=[b,c];this.vertexIndices=[d,f];this.faces=[];this.faceIndices=[]};THREE.Camera=function(b,c,d,f,i){THREE.Object3D.call(this);this.fov=b||50;this.aspect=c||1;this.near=d!==void 0?d:0.1;this.far=f!==void 0?f:2E3;this.target=i||new THREE.Object3D;this.useTarget=!1;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;
-THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(b,c){this.matrix.rotateAxis(c);c.multiplyScalar(b);this.position.addSelf(c);this.target.position.addSelf(c)};
-THREE.Camera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var b=this.fullWidth/this.fullHeight,c=Math.tan(this.fov*Math.PI/360)*this.near,d=-c,f=b*d,b=Math.abs(b*c-f),d=Math.abs(c-d);this.projectionMatrix=THREE.Matrix4.makeFrustum(f+this.x*b/this.fullWidth,f+(this.x+this.width)*b/this.fullWidth,c-(this.y+this.height)*d/this.fullHeight,c-this.y*d/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
-THREE.Camera.prototype.setViewOffset=function(b,c,d,f,i,h){this.fullWidth=b;this.fullHeight=c;this.x=d;this.y=f;this.width=i;this.height=h;this.updateProjectionMatrix()};
-THREE.Camera.prototype.update=function(b,c,d){if(this.useTarget)this.matrix.lookAt(this.position,this.target.position,this.up),this.matrix.setPosition(this.position),b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse),c=!0;else if(this.matrixAutoUpdate&&this.updateMatrix(),c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=
-!1,c=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,d)};THREE.OrthoCamera=function(b,c,d,f,i,h,j){THREE.Camera.call(this,45,1,i,h,j);this.left=b;this.right=c;this.top=d;this.bottom=f;this.updateProjectionMatrix()};THREE.OrthoCamera.prototype=new THREE.Camera;THREE.OrthoCamera.prototype.constructor=THREE.OrthoCamera;
-THREE.OrthoCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;
+1,b[c].array.push(d))}var d,f,h,i,j,k={};d=0;for(f=this.faces.length;d<f;d++)j=this.faces[d],j instanceof THREE.Face3?(h=b(j.a,j.b),c(k,h,d),h=b(j.b,j.c),c(k,h,d),h=b(j.a,j.c),c(k,h,d)):j instanceof THREE.Face4&&(h=b(j.b,j.d),c(k,h,d),h=b(j.a,j.b),c(k,h,d),h=b(j.a,j.d),c(k,h,d),h=b(j.b,j.c),c(k,h,d),h=b(j.c,j.d),c(k,h,d));d=0;for(f=this.edges.length;d<f;d++){j=this.edges[d];h=j.vertexIndices[0];i=j.vertexIndices[1];j.faceIndices=k[b(h,i)].array;for(h=0;h<j.faceIndices.length;h++)i=j.faceIndices[h],
+j.faces.push(this.faces[i])}}};THREE.GeometryCount=0;
+THREE.Spline=function(b){function c(b,c,d,f,h,i,j){b=(d-b)*0.5;f=(f-c)*0.5;return(2*(c-d)+b+f)*j+(-3*(c-d)-2*b-f)*i+b*h+c}this.points=b;var d=[],f={x:0,y:0,z:0},h,i,j,k,m,n,q,p,t;this.initFromArray=function(b){this.points=[];for(var c=0;c<b.length;c++)this.points[c]={x:b[c][0],y:b[c][1],z:b[c][2]}};this.getPoint=function(b){h=(this.points.length-1)*b;i=Math.floor(h);j=h-i;d[0]=i==0?i:i-1;d[1]=i;d[2]=i>this.points.length-2?i:i+1;d[3]=i>this.points.length-3?i:i+2;n=this.points[d[0]];q=this.points[d[1]];
+p=this.points[d[2]];t=this.points[d[3]];k=j*j;m=j*k;f.x=c(n.x,q.x,p.x,t.x,j,k,m);f.y=c(n.y,q.y,p.y,t.y,j,k,m);f.z=c(n.z,q.z,p.z,t.z,j,k,m);return f};this.getControlPointsArray=function(){var b,c,d=this.points.length,f=[];for(b=0;b<d;b++)c=this.points[b],f[b]=[c.x,c.y,c.z];return f};this.getLength=function(b){var c,d,f=c=c=0,h=new THREE.Vector3,i=new THREE.Vector3,j=[],k=0;j[0]=0;b||(b=100);d=this.points.length*b;h.copy(this.points[0]);for(b=1;b<d;b++)c=b/d,position=this.getPoint(c),i.copy(position),
+k+=i.distanceTo(h),h.copy(position),c*=this.points.length-1,c=Math.floor(c),c!=f&&(j[c]=k,f=c);j[j.length]=k;return{chunks:j,total:k}};this.reparametrizeByArcLength=function(b){var c,d,f,h,i,j,k=[],n=new THREE.Vector3,m=this.getLength();k.push(n.copy(this.points[0]).clone());for(c=1;c<this.points.length;c++){d=m.chunks[c]-m.chunks[c-1];j=Math.ceil(b*d/m.total);h=(c-1)/(this.points.length-1);i=c/(this.points.length-1);for(d=1;d<j-1;d++)f=h+d*(1/j)*(i-h),position=this.getPoint(f),k.push(n.copy(position).clone());
+k.push(n.copy(this.points[c]).clone())}this.points=k}};THREE.Edge=function(b,c,d,f){this.vertices=[b,c];this.vertexIndices=[d,f];this.faces=[];this.faceIndices=[]};THREE.Camera=function(){THREE.Object3D.call(this);arguments.length&&console.warn("DEPRECATED: Camera() is now PerspectiveCamera().");this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;
+THREE.Camera.prototype.lookAt=function(b){this.matrix.lookAt(this.position,b,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};
+THREE.Camera.prototype.update=function(b,c,d){this.matrixAutoUpdate&&this.updateMatrix();if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,d)};
+THREE.OrthographicCamera=function(b,c,d,f,h,i){THREE.Camera.call(this);this.left=b;this.right=c;this.top=d;this.bottom=f;this.near=h!==void 0?h:0.1;this.far=i!==void 0?i:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};
+THREE.PerspectiveCamera=function(b,c,d,f){THREE.Camera.call(this);this.fov=b||50;this.aspect=c||1;this.near=d!==void 0?d:0.1;this.far=f!==void 0?f:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;
+THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var b=this.fullWidth/this.fullHeight,c=Math.tan(this.fov*Math.PI/360)*this.near,d=-c,f=b*d,b=Math.abs(b*c-f),d=Math.abs(c-d);this.projectionMatrix=THREE.Matrix4.makeFrustum(f+this.x*b/this.fullWidth,f+(this.x+this.width)*b/this.fullWidth,c-(this.y+this.height)*d/this.fullHeight,c-this.y*d/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,
+this.far)};THREE.PerspectiveCamera.prototype.setViewOffset=function(b,c,d,f,h,i){this.fullWidth=b;this.fullHeight=c;this.x=d;this.y=f;this.width=h;this.height=i;this.updateProjectionMatrix()};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(b,c,d){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.intensity=c!==void 0?c:1;this.distance=d!==void 0?d:0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(b,c,d){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,0,0);this.intensity=c!==void 0?c:1;this.distance=d!==void 0?d:0};
 THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.SpotLight=function(b,c,d,f){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=c!==void 0?c:1;this.distance=d!==void 0?d:0;this.castShadow=f!==void 0?f:!1};THREE.SpotLight.prototype=new THREE.Light;THREE.SpotLight.prototype.constructor=THREE.SpotLight;
 THREE.Material=function(b){this.name="";this.id=THREE.MaterialCount++;b=b||{};this.opacity=b.opacity!==void 0?b.opacity:1;this.transparent=b.transparent!==void 0?b.transparent:!1;this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.depthTest=b.depthTest!==void 0?b.depthTest:!0;this.depthWrite=b.depthWrite!==void 0?b.depthWrite:!0;this.polygonOffset=b.polygonOffset!==void 0?b.polygonOffset:!1;this.polygonOffsetFactor=b.polygonOffsetFactor!==void 0?b.polygonOffsetFactor:0;this.polygonOffsetUnits=
@@ -116,24 +116,24 @@ THREE.MeshShaderMaterial=function(b){console.warn("DEPRECATED: MeshShaderMateria
 THREE.ParticleBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.size=b.size!==void 0?b.size:1;this.sizeAttenuation=b.sizeAttenuation!==void 0?b.sizeAttenuation:!0;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.fog=b.fog!==void 0?b.fog:!0};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
 THREE.ShaderMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.fragmentShader=b.fragmentShader!==void 0?b.fragmentShader:"void main() {}";this.vertexShader=b.vertexShader!==void 0?b.vertexShader:"void main() {}";this.uniforms=b.uniforms!==void 0?b.uniforms:{};this.attributes=b.attributes;this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.fog=b.fog!==
 void 0?b.fog:!1;this.lights=b.lights!==void 0?b.lights:!1;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};THREE.ShaderMaterial.prototype=new THREE.Material;THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial;
-THREE.Texture=function(b,c,d,f,i,h){this.id=THREE.TextureCount++;this.image=b;this.mapping=c!==void 0?c:new THREE.UVMapping;this.wrapS=d!==void 0?d:THREE.ClampToEdgeWrapping;this.wrapT=f!==void 0?f:THREE.ClampToEdgeWrapping;this.magFilter=i!==void 0?i:THREE.LinearFilter;this.minFilter=h!==void 0?h:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
+THREE.Texture=function(b,c,d,f,h,i){this.id=THREE.TextureCount++;this.image=b;this.mapping=c!==void 0?c:new THREE.UVMapping;this.wrapS=d!==void 0?d:THREE.ClampToEdgeWrapping;this.wrapT=f!==void 0?f:THREE.ClampToEdgeWrapping;this.magFilter=h!==void 0?h:THREE.LinearFilter;this.minFilter=i!==void 0?i:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
 THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var b=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
 THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;
-THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(b,c,d,f,i,h,j,k,m){THREE.Texture.call(this,null,i,h,j,k,m);this.image={data:b,width:c,height:d};this.format=f!==void 0?f:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
+THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(b,c,d,f,h,i,j,k,m){THREE.Texture.call(this,null,h,i,j,k,m);this.image={data:b,width:c,height:d};this.format=f!==void 0?f:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
 THREE.DataTexture.prototype.clone=function(){var b=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b};THREE.Particle=function(b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
 THREE.ParticleSystem=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(b,c,d){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.type=d!=void 0?d:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;
 THREE.Line.prototype.constructor=THREE.Line;
 THREE.Mesh=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c&&c.length?c:[c];this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=b.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var d=0;d<this.geometry.morphTargets.length;d++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[d].name]=
 d}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(b){if(this.morphTargetDictionary[b]!==void 0)return this.morphTargetDictionary[b];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+b+" does not exist. Returning 0.");return 0};
 THREE.Bone=function(b){THREE.Object3D.call(this);this.skin=b;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
-THREE.Bone.prototype.update=function(b,c,d){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.skinMatrix.multiply(b,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,i=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(f=0;f<i;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.skinMatrix,c,d):b.update(this.matrixWorld,!0,d)}else for(f=0;f<i;f++)this.children[f].update(this.skinMatrix,
+THREE.Bone.prototype.update=function(b,c,d){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.skinMatrix.multiply(b,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,h=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(f=0;f<h;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.skinMatrix,c,d):b.update(this.matrixWorld,!0,d)}else for(f=0;f<h;f++)this.children[f].update(this.skinMatrix,
 c,d)};THREE.Bone.prototype.addChild=function(b){if(this.children.indexOf(b)===-1&&(b.parent!==void 0&&b.parent.removeChild(b),b.parent=this,this.children.push(b),!(b instanceof THREE.Bone)))this.hasNoneBoneChildren=!0};
-THREE.SkinnedMesh=function(b,c){THREE.Mesh.call(this,b,c);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var d,f,i,h,j,k;if(this.geometry.bones!==void 0){for(d=0;d<this.geometry.bones.length;d++)i=this.geometry.bones[d],h=i.pos,j=i.rotq,k=i.scl,f=this.addBone(),f.name=i.name,f.position.set(h[0],h[1],h[2]),f.quaternion.set(j[0],j[1],j[2],j[3]),f.useQuaternion=!0,k!==void 0?f.scale.set(k[0],k[1],k[2]):f.scale.set(1,1,1);for(d=0;d<this.bones.length;d++)i=this.geometry.bones[d],
-f=this.bones[d],i.parent===-1?this.addChild(f):this.bones[i.parent].addChild(f);this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;
-THREE.SkinnedMesh.prototype.update=function(b,c,d){if(this.visible){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,i=this.children.length;for(f=0;f<i;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.identityMatrix,!1,d):b.update(this.matrixWorld,c,d);d=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(c=0;c<d;c++)ba[c].skinMatrix.flattenToArrayOffset(bm,
+THREE.SkinnedMesh=function(b,c){THREE.Mesh.call(this,b,c);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var d,f,h,i,j,k;if(this.geometry.bones!==void 0){for(d=0;d<this.geometry.bones.length;d++)h=this.geometry.bones[d],i=h.pos,j=h.rotq,k=h.scl,f=this.addBone(),f.name=h.name,f.position.set(i[0],i[1],i[2]),f.quaternion.set(j[0],j[1],j[2],j[3]),f.useQuaternion=!0,k!==void 0?f.scale.set(k[0],k[1],k[2]):f.scale.set(1,1,1);for(d=0;d<this.bones.length;d++)h=this.geometry.bones[d],
+f=this.bones[d],h.parent===-1?this.addChild(f):this.bones[h.parent].addChild(f);this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;
+THREE.SkinnedMesh.prototype.update=function(b,c,d){if(this.visible){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,h=this.children.length;for(f=0;f<h;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.identityMatrix,!1,d):b.update(this.matrixWorld,c,d);d=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(c=0;c<d;c++)ba[c].skinMatrix.flattenToArrayOffset(bm,
 c*16)}};THREE.SkinnedMesh.prototype.addBone=function(b){b===void 0&&(b=new THREE.Bone(this));this.bones.push(b);return b};
-THREE.SkinnedMesh.prototype.pose=function(){this.update(void 0,!0);for(var b,c=[],d=0;d<this.bones.length;d++)b=this.bones[d],c.push(THREE.Matrix4.makeInvert(b.skinMatrix)),b.skinMatrix.flattenToArrayOffset(this.boneMatrices,d*16);if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var f;for(b=0;b<this.geometry.skinIndices.length;b++){var d=this.geometry.vertices[b].position,i=this.geometry.skinIndices[b].x,h=this.geometry.skinIndices[b].y;f=new THREE.Vector3(d.x,
-d.y,d.z);this.geometry.skinVerticesA.push(c[i].multiplyVector3(f));f=new THREE.Vector3(d.x,d.y,d.z);this.geometry.skinVerticesB.push(c[h].multiplyVector3(f));this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y!==1&&(d=(1-(this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y))*0.5,this.geometry.skinWeights[b].x+=d,this.geometry.skinWeights[b].y+=d)}}};THREE.Ribbon=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c]};
+THREE.SkinnedMesh.prototype.pose=function(){this.update(void 0,!0);for(var b,c=[],d=0;d<this.bones.length;d++)b=this.bones[d],c.push(THREE.Matrix4.makeInvert(b.skinMatrix)),b.skinMatrix.flattenToArrayOffset(this.boneMatrices,d*16);if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var f;for(b=0;b<this.geometry.skinIndices.length;b++){var d=this.geometry.vertices[b].position,h=this.geometry.skinIndices[b].x,i=this.geometry.skinIndices[b].y;f=new THREE.Vector3(d.x,
+d.y,d.z);this.geometry.skinVerticesA.push(c[h].multiplyVector3(f));f=new THREE.Vector3(d.x,d.y,d.z);this.geometry.skinVerticesB.push(c[i].multiplyVector3(f));this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y!==1&&(d=(1-(this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y))*0.5,this.geometry.skinWeights[b].x+=d,this.geometry.skinWeights[b].y+=d)}}};THREE.Ribbon=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c]};
 THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(b,c){c===void 0&&(c=0);for(var c=Math.abs(c),d=0;d<this.LODs.length;d++)if(c<this.LODs[d].visibleAtDistance)break;this.LODs.splice(d,0,{visibleAtDistance:c,object3D:b});this.add(b)};
 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 f=1;f<this.LODs.length;f++)if(b>=this.LODs[f].visibleAtDistance)this.LODs[f-1].object3D.visible=!1,
 this.LODs[f].object3D.visible=!0;else break;for(;f<this.LODs.length;f++)this.LODs[f].object3D.visible=!1}for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,c,d)};
@@ -159,7 +159,7 @@ morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\nuniform float morphTargetInflu
 default_vertex:"#ifndef USE_MORPHTARGETS\n#ifndef USE_SKINNING\ngl_Position = projectionMatrix * mvPosition;\n#endif\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform float shadowDarkness;\nuniform float shadowBias;\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif",
 shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_SOFT\nconst float xPixelOffset = 1.0 / SHADOWMAP_WIDTH;\nconst float yPixelOffset = 1.0 / SHADOWMAP_HEIGHT;\n#endif\nvec4 shadowColor = vec4( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nshadowCoord.z += shadowBias;\nif ( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec4( vec3( ( 1.0 - shadowDarkness * shadow ) ), 1.0 );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec4( vec3( shadowDarkness ), 1.0 );\n#endif\n}\n}\ngl_FragColor = gl_FragColor * shadowColor;\n#endif",
 shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif"};
-THREE.UniformsUtils={merge:function(b){var c,d,f,i={};for(c=0;c<b.length;c++)for(d in f=this.clone(b[c]),f)i[d]=f[d];return i},clone:function(b){var c,d,f,i={};for(c in b)for(d in i[c]={},b[c])f=b[c][d],i[c][d]=f instanceof THREE.Color||f instanceof THREE.Vector2||f instanceof THREE.Vector3||f instanceof THREE.Vector4||f instanceof THREE.Matrix4||f instanceof THREE.Texture?f.clone():f instanceof Array?f.slice():f;return i}};
+THREE.UniformsUtils={merge:function(b){var c,d,f,h={};for(c=0;c<b.length;c++)for(d in f=this.clone(b[c]),f)h[d]=f[d];return h},clone:function(b){var c,d,f,h={};for(c in b)for(d in h[c]={},b[c])f=b[c][d],h[c][d]=f instanceof THREE.Color||f instanceof THREE.Vector2||f instanceof THREE.Vector3||f instanceof THREE.Vector4||f instanceof THREE.Matrix4||f instanceof THREE.Texture?f.clone():f instanceof Array?f.slice():f;return h}};
 THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:0,texture:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:2,texture:null},envMap:{type:"t",value:1,texture:null},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:0.98},combine:{type:"i",value:0},morphTargetInfluences:{type:"f",value:0}},fog:{fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",
 value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{enableLighting:{type:"i",value:1},ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",
 value:1},map:{type:"t",value:0,texture:null},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:3,texture:[]},shadowMatrix:{type:"m4v",value:[]},shadowBias:{type:"f",value:0.0039},shadowDarkness:{type:"f",value:0.2}}};
@@ -178,9 +178,9 @@ THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.
 THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",
 THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,
 "}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask  = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};
-THREE.WebGLRenderer=function(b){function c(b,c,d){var f,i,h,j=b.vertices,k=j.length,y=b.colors,n=y.length,D=b.__vertexArray,m=b.__colorArray,p=b.__sortArray,C=b.__dirtyVertices,q=b.__dirtyColors,t=b.__webglCustomAttributes,r,u;if(t)for(r in t)t[r].offset=0;if(d.sortParticles){Ga.multiplySelf(d.matrixWorld);for(f=0;f<k;f++)i=j[f].position,Sa.copy(i),Ga.multiplyVector3(Sa),p[f]=[Sa.z,f];p.sort(function(b,c){return c[0]-b[0]});for(f=0;f<k;f++)i=j[p[f][1]].position,h=f*3,D[h]=i.x,D[h+1]=i.y,D[h+2]=i.z;
-for(f=0;f<n;f++)h=f*3,color=y[p[f][1]],m[h]=color.r,m[h+1]=color.g,m[h+2]=color.b;if(t)for(r in t){f=t[r];y=f.value.length;for(h=0;h<y;h++){index=p[h][1];n=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[n]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")u=f.value[index];f.size===2?(f.array[n]=u.x,f.array[n+1]=u.y):f.size===3?f.type==="c"?(f.array[n]=u.r,f.array[n+1]=u.g,f.array[n+2]=u.b):(f.array[n]=u.x,f.array[n+1]=u.y,f.array[n+2]=u.z):(f.array[n]=
-u.x,f.array[n+1]=u.y,f.array[n+2]=u.z,f.array[n+3]=u.w)}f.offset+=f.size}}}else{if(C)for(f=0;f<k;f++)i=j[f].position,h=f*3,D[h]=i.x,D[h+1]=i.y,D[h+2]=i.z;if(q)for(f=0;f<n;f++)color=y[f],h=f*3,m[h]=color.r,m[h+1]=color.g,m[h+2]=color.b;if(t)for(r in t)if(f=t[r],f.__original.needsUpdate){y=f.value.length;for(h=0;h<y;h++){n=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[n]=f.value[h]}else{if(f.boundTo===void 0||f.boundTo==="vertices")u=f.value[h];f.size===2?(f.array[n]=
+THREE.WebGLRenderer=function(b){function c(b,c,d){var f,h,i,j=b.vertices,k=j.length,y=b.colors,n=y.length,D=b.__vertexArray,m=b.__colorArray,p=b.__sortArray,C=b.__dirtyVertices,q=b.__dirtyColors,t=b.__webglCustomAttributes,r,u;if(t)for(r in t)t[r].offset=0;if(d.sortParticles){Ga.multiplySelf(d.matrixWorld);for(f=0;f<k;f++)h=j[f].position,Sa.copy(h),Ga.multiplyVector3(Sa),p[f]=[Sa.z,f];p.sort(function(b,c){return c[0]-b[0]});for(f=0;f<k;f++)h=j[p[f][1]].position,i=f*3,D[i]=h.x,D[i+1]=h.y,D[i+2]=h.z;
+for(f=0;f<n;f++)i=f*3,color=y[p[f][1]],m[i]=color.r,m[i+1]=color.g,m[i+2]=color.b;if(t)for(r in t){f=t[r];y=f.value.length;for(i=0;i<y;i++){index=p[i][1];n=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[n]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")u=f.value[index];f.size===2?(f.array[n]=u.x,f.array[n+1]=u.y):f.size===3?f.type==="c"?(f.array[n]=u.r,f.array[n+1]=u.g,f.array[n+2]=u.b):(f.array[n]=u.x,f.array[n+1]=u.y,f.array[n+2]=u.z):(f.array[n]=
+u.x,f.array[n+1]=u.y,f.array[n+2]=u.z,f.array[n+3]=u.w)}f.offset+=f.size}}}else{if(C)for(f=0;f<k;f++)h=j[f].position,i=f*3,D[i]=h.x,D[i+1]=h.y,D[i+2]=h.z;if(q)for(f=0;f<n;f++)color=y[f],i=f*3,m[i]=color.r,m[i+1]=color.g,m[i+2]=color.b;if(t)for(r in t)if(f=t[r],f.__original.needsUpdate){y=f.value.length;for(i=0;i<y;i++){n=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[n]=f.value[i]}else{if(f.boundTo===void 0||f.boundTo==="vertices")u=f.value[i];f.size===2?(f.array[n]=
 u.x,f.array[n+1]=u.y):f.size===3?f.type==="c"?(f.array[n]=u.r,f.array[n+1]=u.g,f.array[n+2]=u.b):(f.array[n]=u.x,f.array[n+1]=u.y,f.array[n+2]=u.z):(f.array[n]=u.x,f.array[n+1]=u.y,f.array[n+2]=u.z,f.array[n+3]=u.w)}f.offset+=f.size}}}if(C||d.sortParticles)e.bindBuffer(e.ARRAY_BUFFER,b.__webglVertexBuffer),e.bufferData(e.ARRAY_BUFFER,D,c);if(q||d.sortParticles)e.bindBuffer(e.ARRAY_BUFFER,b.__webglColorBuffer),e.bufferData(e.ARRAY_BUFFER,m,c);if(t)for(r in t)if(f=t[r],f.__original.needsUpdate||d.sortParticles)e.bindBuffer(e.ARRAY_BUFFER,
 f.buffer),e.bufferData(e.ARRAY_BUFFER,f.array,c)}function d(b,c,d,f,i){f.program||M.initMaterial(f,c,d,i);if(f.morphTargets&&!i.__webglMorphTargetInfluences){i.__webglMorphTargetInfluences=new Float32Array(M.maxMorphTargets);for(var h=0,j=M.maxMorphTargets;h<j;h++)i.__webglMorphTargetInfluences[h]=0}var k=!1,h=f.program,j=h.uniforms,y=f.uniforms;h!=Xa&&(e.useProgram(h),Xa=h,k=!0);if(f.id!=U)U=f.id,k=!0;if(k){e.uniformMatrix4fv(j.projectionMatrix,!1,Va);if(d&&f.fog)if(y.fogColor.value=d.color,d instanceof
 THREE.Fog)y.fogNear.value=d.near,y.fogFar.value=d.far;else if(d instanceof THREE.FogExp2)y.fogDensity.value=d.density;if(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f.lights){for(var n,D,m=0,p=0,C=0,q,t,r,v=Za,H=v.directional.colors,B=v.directional.positions,z=v.point.colors,x=v.point.positions,F=v.point.distances,E=0,K=0,d=n=r=0,k=c.length;d<k;d++)if(n=c[d],D=n.color,q=n.position,t=n.intensity,r=n.distance,n instanceof THREE.AmbientLight)m+=D.r,p+=D.g,C+=D.b;else if(n instanceof
@@ -200,15 +200,15 @@ q=0,m=j.morphTargetInfluences,t,C=m.length,n=0;for(j.morphTargetBase!==-1&&(y[j.
 h.__webglUVBuffer),e.vertexAttribPointer(b.uv,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(b.uv)):e.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(e.bindBuffer(e.ARRAY_BUFFER,h.__webglUV2Buffer),e.vertexAttribPointer(b.uv2,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(b.uv2)):e.disableVertexAttribArray(b.uv2));i.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinVertexABuffer),e.vertexAttribPointer(b.skinVertexA,4,
 e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),e.vertexAttribPointer(b.skinVertexB,4,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),e.vertexAttribPointer(b.skinIndex,4,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),e.vertexAttribPointer(b.skinWeight,4,e.FLOAT,!1,0,0))}j instanceof THREE.Mesh?(i.wireframe?(e.lineWidth(i.wireframeLinewidth),c&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),e.drawElements(e.LINES,h.__webglLineCount,
 e.UNSIGNED_SHORT,0)):(c&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),e.drawElements(e.TRIANGLES,h.__webglFaceCount,e.UNSIGNED_SHORT,0)),M.info.render.calls++,M.info.render.vertices+=h.__webglFaceCount,M.info.render.faces+=h.__webglFaceCount/3):j instanceof THREE.Line?(j=j.type==THREE.LineStrip?e.LINE_STRIP:e.LINES,e.lineWidth(i.linewidth),e.drawArrays(j,0,h.__webglLineCount),M.info.render.calls++):j instanceof THREE.ParticleSystem?(e.drawArrays(e.POINTS,0,h.__webglParticleCount),M.info.render.calls++):
-j instanceof THREE.Ribbon&&(e.drawArrays(e.TRIANGLE_STRIP,0,h.__webglVertexCount),M.info.render.calls++)}}function i(b,c,d){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=e.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=e.createBuffer();b.hasPos&&(e.bindBuffer(e.ARRAY_BUFFER,b.__webglVertexBuffer),e.bufferData(e.ARRAY_BUFFER,b.positionArray,e.DYNAMIC_DRAW),e.enableVertexAttribArray(c.attributes.position),e.vertexAttribPointer(c.attributes.position,3,e.FLOAT,!1,0,0));if(b.hasNormal){e.bindBuffer(e.ARRAY_BUFFER,
+j instanceof THREE.Ribbon&&(e.drawArrays(e.TRIANGLE_STRIP,0,h.__webglVertexCount),M.info.render.calls++)}}function h(b,c,d){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=e.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=e.createBuffer();b.hasPos&&(e.bindBuffer(e.ARRAY_BUFFER,b.__webglVertexBuffer),e.bufferData(e.ARRAY_BUFFER,b.positionArray,e.DYNAMIC_DRAW),e.enableVertexAttribArray(c.attributes.position),e.vertexAttribPointer(c.attributes.position,3,e.FLOAT,!1,0,0));if(b.hasNormal){e.bindBuffer(e.ARRAY_BUFFER,
 b.__webglNormalBuffer);if(d==THREE.FlatShading){var f,h,i,j,k,y,n,m,p,q,C=b.count*3;for(q=0;q<C;q+=9)d=b.normalArray,f=d[q],h=d[q+1],i=d[q+2],j=d[q+3],y=d[q+4],m=d[q+5],k=d[q+6],n=d[q+7],p=d[q+8],f=(f+j+k)/3,h=(h+y+n)/3,i=(i+m+p)/3,d[q]=f,d[q+1]=h,d[q+2]=i,d[q+3]=f,d[q+4]=h,d[q+5]=i,d[q+6]=f,d[q+7]=h,d[q+8]=i}e.bufferData(e.ARRAY_BUFFER,b.normalArray,e.DYNAMIC_DRAW);e.enableVertexAttribArray(c.attributes.normal);e.vertexAttribPointer(c.attributes.normal,3,e.FLOAT,!1,0,0)}e.drawArrays(e.TRIANGLES,
-0,b.count);b.count=0}function h(b){if($!=b.doubleSided)b.doubleSided?e.disable(e.CULL_FACE):e.enable(e.CULL_FACE),$=b.doubleSided;if(N!=b.flipSided)b.flipSided?e.frontFace(e.CW):e.frontFace(e.CCW),N=b.flipSided}function j(b){sa!=b&&(b?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),sa=b)}function k(b){Q!=b&&(e.depthMask(b),Q=b)}function m(b,c,d){Aa!=b&&(b?e.enable(e.POLYGON_OFFSET_FILL):e.disable(e.POLYGON_OFFSET_FILL),Aa=b);if(b&&(Ja!=c||Ta!=d))e.polygonOffset(c,d),Ja=c,Ta=d}function n(b){aa[0].set(b.n41-
+0,b.count);b.count=0}function i(b){if($!=b.doubleSided)b.doubleSided?e.disable(e.CULL_FACE):e.enable(e.CULL_FACE),$=b.doubleSided;if(N!=b.flipSided)b.flipSided?e.frontFace(e.CW):e.frontFace(e.CCW),N=b.flipSided}function j(b){sa!=b&&(b?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),sa=b)}function k(b){Q!=b&&(e.depthMask(b),Q=b)}function m(b,c,d){Aa!=b&&(b?e.enable(e.POLYGON_OFFSET_FILL):e.disable(e.POLYGON_OFFSET_FILL),Aa=b);if(b&&(Ja!=c||Ta!=d))e.polygonOffset(c,d),Ja=c,Ta=d}function n(b){aa[0].set(b.n41-
 b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);aa[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);aa[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);aa[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);aa[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);aa[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34);for(var c,b=0;b<6;b++)c=aa[b],c.divideScalar(Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z))}function q(b){for(var c=b.matrixWorld,e=-b.geometry.boundingSphere.radius*Math.max(b.scale.x,
 Math.max(b.scale.y,b.scale.z)),d=0;d<6;d++)if(b=aa[d].x*c.n14+aa[d].y*c.n24+aa[d].z*c.n34+aa[d].w,b<=e)return!1;return!0}function p(b,c){b.list[b.count]=c;b.count+=1}function t(b){var c,e,d=b.object,f=b.opaque,h=b.transparent;h.count=0;b=f.count=0;for(c=d.materials.length;b<c;b++)e=d.materials[b],e.transparent?p(h,e):p(f,e)}function v(b){var c,e,d,f,h=b.object,i=b.buffer,j=b.opaque,k=b.transparent;k.count=0;b=j.count=0;for(d=h.materials.length;b<d;b++)if(c=h.materials[b],c instanceof THREE.MeshFaceMaterial){c=
 0;for(e=i.materials.length;c<e;c++)(f=i.materials[c])&&(f.transparent?p(k,f):p(j,f))}else(f=c)&&(f.transparent?p(k,f):p(j,f))}function B(b,c){return c.z-b.z}function x(b){var c,k,m,I=0,p,t,r,y,u=b.lights;if(!ma)ma=new THREE.Camera(M.shadowCameraFov,M.shadowMapWidth/M.shadowMapHeight,M.shadowCameraNear,M.shadowCameraFar),ma.useTarget=!0;c=0;for(k=u.length;c<k;c++)if(m=u[c],m instanceof THREE.SpotLight&&m.castShadow){U=-1;M.shadowMap[I]||(M.shadowMap[I]=new THREE.WebGLRenderTarget(M.shadowMapWidth,
 M.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));Ua[I]||(Ua[I]=new THREE.Matrix4);p=M.shadowMap[I];t=Ua[I];ma.position.copy(m.position);ma.target.position.copy(m.target.position);ma.update(void 0,!0);b.update(void 0,!1,ma);t.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);t.multiplySelf(ma.projectionMatrix);t.multiplySelf(ma.matrixWorldInverse);ma.matrixWorldInverse.flattenToArray(Wa);ma.projectionMatrix.flattenToArray(Va);Ga.multiply(ma.projectionMatrix,
 ma.matrixWorldInverse);n(Ga);M.initWebGLObjects(b);L(p);e.clearColor(1,1,1,1);M.clear();e.clearColor(ha.r,ha.g,ha.b,Ha);t=b.__webglObjects.length;m=b.__webglObjectsImmediate.length;for(p=0;p<t;p++)r=b.__webglObjects[p],y=r.object,y.visible&&y.castShadow?!(y instanceof THREE.Mesh)||!y.frustumCulled||q(y)?(y.matrixWorld.flattenToArray(y._objectMatrixArray),F(y,ma,!1),r.render=!0):r.render=!1:r.render=!1;j(!0);G(THREE.NormalBlending);for(p=0;p<t;p++)if(r=b.__webglObjects[p],r.render)y=r.object,buffer=
-r.buffer,h(y),r=y.customDepthMaterial?y.customDepthMaterial:y.geometry.morphTargets.length?$a:La,f(ma,u,null,r,buffer,y);for(p=0;p<m;p++)r=b.__webglObjectsImmediate[p],y=r.object,y.visible&&y.castShadow&&(y.matrixAutoUpdate&&y.matrixWorld.flattenToArray(y._objectMatrixArray),F(y,ma,!1),h(y),program=d(ma,u,null,La,y),y.immediateRenderCallback?y.immediateRenderCallback(program,e,aa):y.render(function(b){i(b,program,La.shading)}));I++}}function E(b,c){var d,f,h;d=r.attributes;var i=r.uniforms,j=za/Ea,
+r.buffer,i(y),r=y.customDepthMaterial?y.customDepthMaterial:y.geometry.morphTargets.length?$a:La,f(ma,u,null,r,buffer,y);for(p=0;p<m;p++)r=b.__webglObjectsImmediate[p],y=r.object,y.visible&&y.castShadow&&(y.matrixAutoUpdate&&y.matrixWorld.flattenToArray(y._objectMatrixArray),F(y,ma,!1),i(y),program=d(ma,u,null,La,y),y.immediateRenderCallback?y.immediateRenderCallback(program,e,aa):y.render(function(b){h(b,program,La.shading)}));I++}}function E(b,c){var d,f,h;d=r.attributes;var i=r.uniforms,j=za/Ea,
 k,n=[],m=Ea*0.5,p=za*0.5,q=!0;e.useProgram(r.program);Xa=r.program;W=sa=ka=-1;ab||(e.enableVertexAttribArray(r.attributes.position),e.enableVertexAttribArray(r.attributes.uv),ab=!0);e.disable(e.CULL_FACE);e.enable(e.BLEND);e.depthMask(!0);e.bindBuffer(e.ARRAY_BUFFER,r.vertexBuffer);e.vertexAttribPointer(d.position,2,e.FLOAT,!1,16,0);e.vertexAttribPointer(d.uv,2,e.FLOAT,!1,16,8);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r.elementBuffer);e.uniformMatrix4fv(i.projectionMatrix,!1,Va);e.activeTexture(e.TEXTURE0);
 e.uniform1i(i.map,0);d=0;for(f=b.__webglSprites.length;d<f;d++)if(h=b.__webglSprites[d],h.visible&&h.opacity!=0)h.useScreenCoordinates?h.z=-h.position.z:(h._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,h.matrixWorld,h._modelViewMatrixArray),h.z=-h._modelViewMatrix.n34);b.__webglSprites.sort(B);d=0;for(f=b.__webglSprites.length;d<f;d++)h=b.__webglSprites[d],h.visible&&h.opacity!=0&&h.map&&h.map.image&&h.map.image.width&&(h.useScreenCoordinates?(e.uniform1i(i.useScreenCoordinates,1),e.uniform3f(i.screenPosition,
 (h.position.x-m)/m,(p-h.position.y)/p,Math.max(0,Math.min(1,h.position.z)))):(e.uniform1i(i.useScreenCoordinates,0),e.uniform1i(i.affectedByDistance,h.affectedByDistance?1:0),e.uniformMatrix4fv(i.modelViewMatrix,!1,h._modelViewMatrixArray)),k=h.map.image.width/(h.scaleByViewport?za:1),n[0]=k*j*h.scale.x,n[1]=k*h.scale.y,e.uniform2f(i.uvScale,h.uvScale.x,h.uvScale.y),e.uniform2f(i.uvOffset,h.uvOffset.x,h.uvOffset.y),e.uniform2f(i.alignment,h.alignment.x,h.alignment.y),e.uniform1f(i.opacity,h.opacity),
@@ -250,10 +250,10 @@ C=f;u=0;for(c=C.length;u<c;u++)d=C[u],r.attributes[d]=e.getAttribLocation(r,d);r
 e.enableVertexAttribArray(C.skinVertexB),e.enableVertexAttribArray(C.skinIndex),e.enableVertexAttribArray(C.skinWeight));if(b.attributes)for(i in b.attributes)C[i]!==void 0&&C[i]>=0&&e.enableVertexAttribArray(C[i]);if(b.morphTargets)for(i=b.numSupportedMorphTargets=0;i<this.maxMorphTargets;i++)u="morphTarget"+i,C[u]>=0&&(e.enableVertexAttribArray(C[u]),b.numSupportedMorphTargets++);b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,d,e){L(b);
 this.clear(c,d,e)};this.render=function(b,c,p,r){var I,u,Fa,X,y,J,D,Qa,Ra=b.lights,C=b.fog;U=-1;this.shadowMapEnabled&&x(b,c);M.info.render.calls=0;M.info.render.vertices=0;M.info.render.faces=0;c.matrixAutoUpdate&&c.update(void 0,!0);b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Wa);c.projectionMatrix.flattenToArray(Va);Ga.multiply(c.projectionMatrix,c.matrixWorldInverse);n(Ga);this.initWebGLObjects(b);L(p);(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);
 y=b.__webglObjects.length;for(r=0;r<y;r++)if(I=b.__webglObjects[r],D=I.object,D.visible)if(!(D instanceof THREE.Mesh)||!D.frustumCulled||q(D)){if(D.matrixWorld.flattenToArray(D._objectMatrixArray),F(D,c,!0),v(I),I.render=!0,this.sortObjects)I.object.renderDepth?I.z=I.object.renderDepth:(Sa.copy(D.position),Ga.multiplyVector3(Sa),I.z=Sa.z)}else I.render=!1;else I.render=!1;this.sortObjects&&b.__webglObjects.sort(B);J=b.__webglObjectsImmediate.length;for(r=0;r<J;r++)I=b.__webglObjectsImmediate[r],D=
-I.object,D.visible&&(D.matrixAutoUpdate&&D.matrixWorld.flattenToArray(D._objectMatrixArray),F(D,c,!0),t(I));if(b.overrideMaterial){j(b.overrideMaterial.depthTest);G(b.overrideMaterial.blending);for(r=0;r<y;r++)if(I=b.__webglObjects[r],I.render)D=I.object,Qa=I.buffer,h(D),f(c,Ra,C,b.overrideMaterial,Qa,D);for(r=0;r<J;r++)I=b.__webglObjectsImmediate[r],D=I.object,D.visible&&(h(D),u=d(c,Ra,C,b.overrideMaterial,D),D.immediateRenderCallback?D.immediateRenderCallback(u,e,aa):D.render(function(b){i(b,u,
-La.shading)}))}else{G(THREE.NormalBlending);for(r=y-1;r>=0;r--)if(I=b.__webglObjects[r],I.render){D=I.object;Qa=I.buffer;Fa=I.opaque;h(D);for(I=0;I<Fa.count;I++)X=Fa.list[I],j(X.depthTest),k(X.depthWrite),m(X.polygonOffset,X.polygonOffsetFactor,X.polygonOffsetUnits),f(c,Ra,C,X,Qa,D)}for(r=0;r<J;r++)if(I=b.__webglObjectsImmediate[r],D=I.object,D.visible){Fa=I.opaque;h(D);for(I=0;I<Fa.count;I++)X=Fa.list[I],j(X.depthTest),k(X.depthWrite),m(X.polygonOffset,X.polygonOffsetFactor,X.polygonOffsetUnits),
-u=d(c,Ra,C,X,D),D.immediateRenderCallback?D.immediateRenderCallback(u,e,aa):D.render(function(b){i(b,u,La.shading)})}for(r=0;r<y;r++)if(I=b.__webglObjects[r],I.render){D=I.object;Qa=I.buffer;Fa=I.transparent;h(D);for(I=0;I<Fa.count;I++)X=Fa.list[I],G(X.blending),j(X.depthTest),k(X.depthWrite),m(X.polygonOffset,X.polygonOffsetFactor,X.polygonOffsetUnits),f(c,Ra,C,X,Qa,D)}for(r=0;r<J;r++)if(I=b.__webglObjectsImmediate[r],D=I.object,D.visible){Fa=I.transparent;h(D);for(I=0;I<Fa.count;I++)X=Fa.list[I],
-G(X.blending),j(X.depthTest),k(X.depthWrite),m(X.polygonOffset,X.polygonOffsetFactor,X.polygonOffsetUnits),u=d(c,Ra,C,X,D),D.immediateRenderCallback?D.immediateRenderCallback(u,e,aa):D.render(function(b){i(b,u,La.shading)})}}b.__webglSprites.length&&E(b,c);p&&p.minFilter!==THREE.NearestFilter&&p.minFilter!==THREE.LinearFilter&&T(p)};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var d=b.__objectsAdded[0],
+I.object,D.visible&&(D.matrixAutoUpdate&&D.matrixWorld.flattenToArray(D._objectMatrixArray),F(D,c,!0),t(I));if(b.overrideMaterial){j(b.overrideMaterial.depthTest);G(b.overrideMaterial.blending);for(r=0;r<y;r++)if(I=b.__webglObjects[r],I.render)D=I.object,Qa=I.buffer,i(D),f(c,Ra,C,b.overrideMaterial,Qa,D);for(r=0;r<J;r++)I=b.__webglObjectsImmediate[r],D=I.object,D.visible&&(i(D),u=d(c,Ra,C,b.overrideMaterial,D),D.immediateRenderCallback?D.immediateRenderCallback(u,e,aa):D.render(function(b){h(b,u,
+La.shading)}))}else{G(THREE.NormalBlending);for(r=y-1;r>=0;r--)if(I=b.__webglObjects[r],I.render){D=I.object;Qa=I.buffer;Fa=I.opaque;i(D);for(I=0;I<Fa.count;I++)X=Fa.list[I],j(X.depthTest),k(X.depthWrite),m(X.polygonOffset,X.polygonOffsetFactor,X.polygonOffsetUnits),f(c,Ra,C,X,Qa,D)}for(r=0;r<J;r++)if(I=b.__webglObjectsImmediate[r],D=I.object,D.visible){Fa=I.opaque;i(D);for(I=0;I<Fa.count;I++)X=Fa.list[I],j(X.depthTest),k(X.depthWrite),m(X.polygonOffset,X.polygonOffsetFactor,X.polygonOffsetUnits),
+u=d(c,Ra,C,X,D),D.immediateRenderCallback?D.immediateRenderCallback(u,e,aa):D.render(function(b){h(b,u,La.shading)})}for(r=0;r<y;r++)if(I=b.__webglObjects[r],I.render){D=I.object;Qa=I.buffer;Fa=I.transparent;i(D);for(I=0;I<Fa.count;I++)X=Fa.list[I],G(X.blending),j(X.depthTest),k(X.depthWrite),m(X.polygonOffset,X.polygonOffsetFactor,X.polygonOffsetUnits),f(c,Ra,C,X,Qa,D)}for(r=0;r<J;r++)if(I=b.__webglObjectsImmediate[r],D=I.object,D.visible){Fa=I.transparent;i(D);for(I=0;I<Fa.count;I++)X=Fa.list[I],
+G(X.blending),j(X.depthTest),k(X.depthWrite),m(X.polygonOffset,X.polygonOffsetFactor,X.polygonOffsetUnits),u=d(c,Ra,C,X,D),D.immediateRenderCallback?D.immediateRenderCallback(u,e,aa):D.render(function(b){h(b,u,La.shading)})}}b.__webglSprites.length&&E(b,c);p&&p.minFilter!==THREE.NearestFilter&&p.minFilter!==THREE.LinearFilter&&T(p)};this.initWebGLObjects=function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var d=b.__objectsAdded[0],
 f=b,h=void 0,i=void 0,j=void 0;if(!d.__webglInit)if(d.__webglInit=!0,d._modelViewMatrix=new THREE.Matrix4,d._normalMatrixArray=new Float32Array(9),d._modelViewMatrixArray=new Float32Array(16),d._objectMatrixArray=new Float32Array(16),d.matrixWorld.flattenToArray(d._objectMatrixArray),d instanceof THREE.Mesh)for(h in i=d.geometry,i.geometryGroups==void 0&&ra(i),i.geometryGroups){if(j=i.geometryGroups[h],!j.__webglVertexBuffer){var k=j;k.__webglVertexBuffer=e.createBuffer();k.__webglNormalBuffer=e.createBuffer();
 k.__webglTangentBuffer=e.createBuffer();k.__webglColorBuffer=e.createBuffer();k.__webglUVBuffer=e.createBuffer();k.__webglUV2Buffer=e.createBuffer();k.__webglSkinVertexABuffer=e.createBuffer();k.__webglSkinVertexBBuffer=e.createBuffer();k.__webglSkinIndicesBuffer=e.createBuffer();k.__webglSkinWeightsBuffer=e.createBuffer();k.__webglFaceBuffer=e.createBuffer();k.__webglLineBuffer=e.createBuffer();if(k.numMorphTargets){var n=void 0,m=void 0;k.__webglMorphTargetsBuffers=[];n=0;for(m=k.numMorphTargets;n<
 m;n++)k.__webglMorphTargetsBuffers.push(e.createBuffer())}M.info.memory.geometries++;for(var k=d,p=void 0,r=void 0,q=void 0,u=q=void 0,t=void 0,v=void 0,B=v=n=0,x=q=r=void 0,q=m=x=r=p=void 0,u=k.geometry,t=u.faces,x=j.faces,p=0,r=x.length;p<r;p++)q=x[p],q=t[q],q instanceof THREE.Face3?(n+=3,v+=1,B+=3):q instanceof THREE.Face4&&(n+=4,v+=2,B+=4);for(var p=j,r=k,F=x=t=void 0,H=void 0,F=void 0,q=[],t=0,x=r.materials.length;t<x;t++)if(F=r.materials[t],F instanceof THREE.MeshFaceMaterial){F=0;for(l=p.materials.length;F<

+ 1 - 1
examples/canvas_geometry_birds.html

@@ -338,7 +338,7 @@
 
 			function init() {
 
-				camera = new THREE.Camera( 75, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000 );
+				camera = new THREE.PerspectiveCamera( 75, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000 );
 				camera.position.z = 450;
 
 				scene = new THREE.Scene();

+ 1 - 1
examples/canvas_geometry_cube.html

@@ -53,7 +53,7 @@
 				info.innerHTML = 'Drag to spin the cube';
 				container.appendChild( info );
 
-				camera = new THREE.Camera( 70, window.innerWidth / window.innerHeight, 1, 1000 );
+				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 1000 );
 				camera.position.y = 150;
 				camera.position.z = 500;
 

+ 2 - 2
examples/canvas_geometry_earth.html

@@ -59,9 +59,8 @@
 
 				container = document.getElementById( 'container' );
 
-				camera = new THREE.Camera( 60, window.innerWidth / window.innerHeight, 1, 10000 );
+				camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 10000 );
 				camera.position.z = 500;
-				camera.useTarget = true;
 
 				scene = new THREE.Scene();
 
@@ -111,6 +110,7 @@
 
 				camera.position.x += ( mouseX - camera.position.x ) * 0.05;
 				camera.position.y += ( - mouseY - camera.position.y ) * 0.05;
+				camera.lookAt( mesh.position );
 
 				mesh.rotation.y -= 0.005;
 

+ 5 - 9
examples/canvas_geometry_hierarchy.html

@@ -44,9 +44,8 @@
 				container = document.createElement( 'div' );
 				document.body.appendChild( container );
 
-				camera = new THREE.Camera( 60, window.innerWidth / window.innerHeight, 1, 10000 );
+				camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 10000 );
 				camera.position.z = 500;
-				camera.useTarget = true;
 
 				scene = new THREE.Scene();
 
@@ -106,16 +105,13 @@
 
 			function render() {
 
-				var rx = Math.sin( new Date().getTime() * 0.0007 ) * 0.5,
-				ry = Math.sin( new Date().getTime() * 0.0003 ) * 0.5,
-				rz = Math.sin( new Date().getTime() * 0.0002 ) * 0.5;
-
 				camera.position.x += ( mouseX - camera.position.x ) * .05;
 				camera.position.y += ( - mouseY - camera.position.y ) * .05;
+				camera.lookAt( group.position );
 
-				group.rotation.x = rx;
-				group.rotation.y = ry;
-				group.rotation.z = rz;
+				group.rotation.x = Math.sin( new Date().getTime() * 0.0007 ) * 0.5;
+				group.rotation.y = Math.sin( new Date().getTime() * 0.0003 ) * 0.5;
+				group.rotation.z = Math.sin( new Date().getTime() * 0.0002 ) * 0.5;
 
 				renderer.render( scene, camera );
 

+ 26 - 26
examples/webgl_geometries.html

@@ -27,9 +27,7 @@
 
 			var container, stats;
 
-			var camera, scene, renderer;
-
-			var objects = [];
+			var camera, scene, group, renderer;
 
 			init();
 			animate();
@@ -39,10 +37,8 @@
 				container = document.createElement('div');
 				document.body.appendChild(container);
 
-				camera = new THREE.Camera( 45, window.innerWidth / window.innerHeight, 1, 2000 );
+				camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 2000 );
 				camera.position.y = 200;
-				camera.position.z = 800;
-				camera.useTarget = true;
 
 				scene = new THREE.Scene();
 
@@ -59,28 +55,31 @@
 					new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true, transparent: true, opacity: 0.1 } )
 				];
 
-				objects[ 0 ] = object = new THREE.Mesh( new THREE.CubeGeometry( 100, 100, 100, 4, 4, 4 ), material );
+				group = new THREE.Object3D();
+				scene.add( group );
+
+				object = new THREE.Mesh( new THREE.CubeGeometry( 100, 100, 100, 4, 4, 4 ), material );
 				object.position.x = - 200;
 				object.position.z = 200;
-				scene.add( object );
+				group.add( object );
 
 
-				objects[ 1 ] = object = new THREE.Mesh( new THREE.CylinderGeometry( 25, 75, 100, 40, 5 ), material );
+				object = new THREE.Mesh( new THREE.CylinderGeometry( 25, 75, 100, 40, 5 ), material );
 				object.position.z = 200;
-				scene.add( object );
+				group.add( object );
 
-				objects[ 2 ] = object = new THREE.Mesh( new THREE.IcosahedronGeometry( 2 ), material );
+				object = new THREE.Mesh( new THREE.IcosahedronGeometry( 2 ), material );
 				object.position.x = 200;
 				object.position.z = 200;
 				object.scale.x = object.scale.y = object.scale.z = 75;
-				scene.add( object );
+				group.add( object );
 
-				objects[ 3 ] = object = new THREE.Mesh( new THREE.PlaneGeometry( 100, 100, 4, 4 ), material );
+				object = new THREE.Mesh( new THREE.PlaneGeometry( 100, 100, 4, 4 ), material );
 				object.position.x = - 200;
-				scene.add( object );
+				group.add( object );
 
-				objects[ 4 ] = object = new THREE.Mesh( new THREE.SphereGeometry( 75, 20, 10 ), material );
-				scene.add( object );
+				object = new THREE.Mesh( new THREE.SphereGeometry( 75, 20, 10 ), material );
+				group.add( object );
 
 				var points = [];
 
@@ -90,24 +89,24 @@
 
 				}
 
-				objects[ 5 ] = object = new THREE.Mesh( new THREE.LatheGeometry( points, 20 ), material );
+				object = new THREE.Mesh( new THREE.LatheGeometry( points, 20 ), material );
 				object.position.x = 200;
-				scene.add( object );
+				group.add( object );
 
-				objects[ 6 ] = object = new THREE.Mesh( new THREE.TorusGeometry( 50, 20, 20, 20 ), material );
+				object = new THREE.Mesh( new THREE.TorusGeometry( 50, 20, 20, 20 ), material );
 				object.position.x = - 200;
 				object.position.z = - 200;
-				scene.add( object );
+				group.add( object );
 
-				objects[ 7 ] = object = new THREE.Mesh( new THREE.TorusKnotGeometry( 50, 10, 50, 20 ), material );
+				object = new THREE.Mesh( new THREE.TorusKnotGeometry( 50, 10, 50, 20 ), material );
 				object.position.z = - 200;
-				scene.add( object );
+				group.add( object );
 
-				objects[ 8 ] = object = new THREE.Trident();
+				object = new THREE.Axes();
 				object.position.x = 200;
 				object.position.z = - 200;
 				object.scale.x = object.scale.y = object.scale.z = 0.5;
-				scene.add( object );
+				group.add( object );
 
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );
@@ -138,10 +137,11 @@
 
 				camera.position.x = Math.cos( timer ) * 800;
 				camera.position.z = Math.sin( timer ) * 800;
+				camera.lookAt( group.position );
 
-				for ( var i = 0, l = objects.length; i < l; i++ ) {
+				for ( var i = 0, l = group.children.length; i < l; i++ ) {
 
-					var object = objects[ i ];
+					var object = group.children[ i ];
 
 					object.rotation.x += 0.01;
 					object.rotation.y += 0.005;

+ 35 - 93
src/cameras/Camera.js

@@ -1,125 +1,44 @@
 /**
  * @author mr.doob / http://mrdoob.com/
  * @author mikael emtinger / http://gomo.se/
- * @author greggman / http://games.greggman.com/
  */
 
-THREE.Camera = function ( fov, aspect, near, far, target ) {
+THREE.Camera = function () {
 
 	THREE.Object3D.call( this );
 
-	this.fov = fov || 50;
-	this.aspect = aspect || 1;
-
-	this.near = ( near !== undefined ) ? near : 0.1;
-	this.far = ( far !== undefined ) ? far : 2000;
+	if ( arguments.length ) console.warn( 'DEPRECATED: Camera() is now PerspectiveCamera().' );
 
+	/*
 	this.target = target || new THREE.Object3D();
 	this.useTarget = false;
+	*/
 
 	this.matrixWorldInverse = new THREE.Matrix4();
-	this.projectionMatrix = null;
-
-	this.updateProjectionMatrix();
+	this.projectionMatrix = new THREE.Matrix4();
 
 };
 
 THREE.Camera.prototype = new THREE.Object3D();
 THREE.Camera.prototype.constructor = THREE.Camera;
-THREE.Camera.prototype.supr = THREE.Object3D.prototype;
-
-
-THREE.Camera.prototype.translate = function ( distance, axis ) {
-
-	this.matrix.rotateAxis( axis );
-
-	axis.multiplyScalar( distance )
-
-	this.position.addSelf( axis );
-	this.target.position.addSelf( axis );
-
-};
-
 
-THREE.Camera.prototype.updateProjectionMatrix = function () {
+THREE.Camera.prototype.lookAt = function ( vector ) {
 
-	if ( this.fullWidth ) {
+	// TODO: Add hierarchy support.
 
-		var aspect = this.fullWidth / this.fullHeight;
-		var top = Math.tan( this.fov * Math.PI / 360 ) * this.near;
-		var bottom = -top;
-		var left = aspect * bottom;
-		var right = aspect * top;
-		var width = Math.abs( right - left );
-		var height = Math.abs( top - bottom );
+	this.matrix.lookAt( this.position, vector, this.up );
 
-		this.projectionMatrix = THREE.Matrix4.makeFrustum(
-			left + this.x * width / this.fullWidth,
-			left + ( this.x + this.width ) * width / this.fullWidth,
-			top - ( this.y + this.height ) * height / this.fullHeight,
-			top - this.y * height / this.fullHeight,
-			this.near,
-			this.far );
+	if ( this.rotationAutoUpdate ) {
 
-	} else {
-
-		this.projectionMatrix = THREE.Matrix4.makePerspective( this.fov, this.aspect, this.near, this.far );
+		this.rotation.setRotationFromMatrix( this.matrix );
 
 	}
 
-};
-
-/**
- * Sets an offset in a larger frustum. This is useful for multi-window or
- * multi-monitor/multi-machine setups.
- *
- * For example, if you have 3x2 monitors and each monitor is 1920x1080 and
- * the monitors are in grid like this
- *
- *   +---+---+---+
- *   | A | B | C |
- *   +---+---+---+
- *   | D | E | F |
- *   +---+---+---+
- *
- * then for monitor each monitor you would call it like this
- *
- *   var w = 1920;
- *   var h = 1080;
- *   var fullWidth = w * 3;
- *   var fullHeight = h * 2;
- *
- *   --A--
- *   camera.setOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );
- *   --B--
- *   camera.setOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );
- *   --C--
- *   camera.setOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );
- *   --D--
- *   camera.setOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );
- *   --E--
- *   camera.setOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
- *   --F--
- *   camera.setOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
- *
- *   Note there is no reason monitors have to be the same size or in a grid.
- */
-
-THREE.Camera.prototype.setViewOffset = function( fullWidth, fullHeight, x, y, width, height ) {
-
-	this.fullWidth = fullWidth;
-	this.fullHeight = fullHeight;
-	this.x = x;
-	this.y = y;
-	this.width = width;
-	this.height = height;
-
-	this.updateProjectionMatrix();
-
-};
+}
 
 THREE.Camera.prototype.update = function ( parentMatrixWorld, forceUpdate, camera ) {
 
+	/*
 	if ( this.useTarget ) {
 
 		// local
@@ -168,6 +87,29 @@ THREE.Camera.prototype.update = function ( parentMatrixWorld, forceUpdate, camer
 		}
 
 	}
+	*/
+
+	this.matrixAutoUpdate && this.updateMatrix();
+
+	if ( forceUpdate || this.matrixWorldNeedsUpdate ) {
+
+		if ( parentMatrixWorld ) {
+
+			this.matrixWorld.multiply( parentMatrixWorld, this.matrix );
+
+		} else {
+
+			this.matrixWorld.copy( this.matrix );
+
+		}
+
+		this.matrixWorldNeedsUpdate = false;
+		forceUpdate = true;
+
+		THREE.Matrix4.makeInvert( this.matrixWorld, this.matrixWorldInverse );
+
+	}
+
 
 	// update children
 

+ 0 - 26
src/cameras/OrthoCamera.js

@@ -1,26 +0,0 @@
-/**
- * @author alteredq / http://alteredqualia.com/
- */
-
-THREE.OrthoCamera = function ( left, right, top, bottom, near, far, target ) {
-
-	THREE.Camera.call( this, 45, 1, near, far, target );
-
-	this.left = left;
-	this.right = right;
-	this.top = top;
-	this.bottom = bottom;
-
-	this.updateProjectionMatrix();
-
-};
-
-THREE.OrthoCamera.prototype = new THREE.Camera();
-THREE.OrthoCamera.prototype.constructor = THREE.OrthoCamera;
-
-THREE.OrthoCamera.prototype.updateProjectionMatrix = function () {
-
-	this.projectionMatrix = THREE.Matrix4.makeOrtho( this.left, this.right, this.top, this.bottom, this.near, this.far );
-
-};
-

+ 29 - 0
src/cameras/OrthographicCamera.js

@@ -0,0 +1,29 @@
+/**
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.OrthographicCamera = function ( left, right, top, bottom, near, far ) {
+
+	THREE.Camera.call( this );
+
+	this.left = left;
+	this.right = right;
+	this.top = top;
+	this.bottom = bottom;
+
+	this.near = ( near !== undefined ) ? near : 0.1;
+	this.far = ( far !== undefined ) ? far : 2000;
+
+	this.updateProjectionMatrix();
+
+};
+
+THREE.OrthographicCamera.prototype = new THREE.Camera();
+THREE.OrthographicCamera.prototype.constructor = THREE.OrthographicCamera;
+
+THREE.OrthographicCamera.prototype.updateProjectionMatrix = function () {
+
+	this.projectionMatrix = THREE.Matrix4.makeOrtho( this.left, this.right, this.top, this.bottom, this.near, this.far );
+
+};
+

+ 98 - 0
src/cameras/PerspectiveCamera.js

@@ -0,0 +1,98 @@
+/**
+ * @author mr.doob / http://mrdoob.com/
+ * @author greggman / http://games.greggman.com/
+ */
+
+THREE.PerspectiveCamera = function ( fov, aspect, near, far ) {
+
+	THREE.Camera.call( this );
+
+	this.fov = fov || 50;
+	this.aspect = aspect || 1;
+
+	this.near = ( near !== undefined ) ? near : 0.1;
+	this.far = ( far !== undefined ) ? far : 2000;
+
+	this.updateProjectionMatrix();
+
+};
+
+THREE.PerspectiveCamera.prototype = new THREE.Camera();
+THREE.PerspectiveCamera.prototype.constructor = THREE.PerspectiveCamera;
+
+THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
+
+	if ( this.fullWidth ) {
+
+		var aspect = this.fullWidth / this.fullHeight;
+		var top = Math.tan( this.fov * Math.PI / 360 ) * this.near;
+		var bottom = -top;
+		var left = aspect * bottom;
+		var right = aspect * top;
+		var width = Math.abs( right - left );
+		var height = Math.abs( top - bottom );
+
+		this.projectionMatrix = THREE.Matrix4.makeFrustum(
+			left + this.x * width / this.fullWidth,
+			left + ( this.x + this.width ) * width / this.fullWidth,
+			top - ( this.y + this.height ) * height / this.fullHeight,
+			top - this.y * height / this.fullHeight,
+			this.near,
+			this.far );
+
+	} else {
+
+		this.projectionMatrix = THREE.Matrix4.makePerspective( this.fov, this.aspect, this.near, this.far );
+
+	}
+
+};
+
+/**
+ * Sets an offset in a larger frustum. This is useful for multi-window or
+ * multi-monitor/multi-machine setups.
+ *
+ * For example, if you have 3x2 monitors and each monitor is 1920x1080 and
+ * the monitors are in grid like this
+ *
+ *   +---+---+---+
+ *   | A | B | C |
+ *   +---+---+---+
+ *   | D | E | F |
+ *   +---+---+---+
+ *
+ * then for monitor each monitor you would call it like this
+ *
+ *   var w = 1920;
+ *   var h = 1080;
+ *   var fullWidth = w * 3;
+ *   var fullHeight = h * 2;
+ *
+ *   --A--
+ *   camera.setOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );
+ *   --B--
+ *   camera.setOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );
+ *   --C--
+ *   camera.setOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );
+ *   --D--
+ *   camera.setOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );
+ *   --E--
+ *   camera.setOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
+ *   --F--
+ *   camera.setOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
+ *
+ *   Note there is no reason monitors have to be the same size or in a grid.
+ */
+
+THREE.PerspectiveCamera.prototype.setViewOffset = function ( fullWidth, fullHeight, x, y, width, height ) {
+
+	this.fullWidth = fullWidth;
+	this.fullHeight = fullHeight;
+	this.x = x;
+	this.y = y;
+	this.width = width;
+	this.height = height;
+
+	this.updateProjectionMatrix();
+
+};

+ 1 - 9
src/core/Object3D.js

@@ -87,15 +87,7 @@ THREE.Object3D.prototype = {
 
 		// TODO: Add hierarchy support.
 
-		if ( this instanceof THREE.Camera ) {
-
-			this.matrix.lookAt( this.position, vector, this.up );
-
-		} else {
-
-			this.matrix.lookAt( vector, this.position, this.up );
-
-		}
+		this.matrix.lookAt( vector, this.position, this.up );
 
 		if ( this.rotationAutoUpdate ) {
 

+ 3 - 3
src/extras/objects/Trident.js → src/extras/objects/Axes.js

@@ -3,7 +3,7 @@
  * @author mr.doob / http://mrdoob.com/
  */
 
-THREE.Trident = function () {
+THREE.Axes = function () {
 
 	THREE.Object3D.call( this );
 
@@ -46,5 +46,5 @@ THREE.Trident = function () {
 
 };
 
-THREE.Trident.prototype = new THREE.Object3D();
-THREE.Trident.prototype.constructor = THREE.Trident;
+THREE.Axes.prototype = new THREE.Object3D();
+THREE.Axes.prototype.constructor = THREE.Axes;

+ 11 - 6
utils/build.py

@@ -32,7 +32,8 @@ COMMON_FILES = [
 'core/Spline.js',
 'core/Edge.js',
 'cameras/Camera.js',
-'cameras/OrthoCamera.js',
+'cameras/OrthographicCamera.js',
+'cameras/PerspectiveCamera.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/DirectionalLight.js',
@@ -116,8 +117,8 @@ EXTRAS_FILES = [
 'extras/loaders/JSONLoader.js',
 'extras/loaders/SceneLoader.js',
 'extras/loaders/UTF8Loader.js',
+'extras/objects/Axes.js',
 'extras/objects/MarchingCubes.js',
-'extras/objects/Trident.js',
 'extras/physics/Collisions.js',
 'extras/physics/CollisionUtils.js',
 'extras/renderers/AnaglyphWebGLRenderer.js',
@@ -143,7 +144,8 @@ CANVAS_FILES = [
 'core/UV.js',
 'core/Geometry.js',
 'cameras/Camera.js',
-'cameras/OrthoCamera.js',
+'cameras/OrthographicCamera.js',
+'cameras/PerspectiveCamera.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/DirectionalLight.js',
@@ -191,7 +193,8 @@ DOM_FILES = [
 'core/Face4.js',
 'core/UV.js',
 'cameras/Camera.js',
-'cameras/OrthoCamera.js',
+'cameras/OrthographicCamera.js',
+'cameras/PerspectiveCamera.js',
 'materials/ParticleDOMMaterial.js',
 'objects/Particle.js',
 'objects/Bone.js',
@@ -219,7 +222,8 @@ SVG_FILES = [
 'core/UV.js',
 'core/Geometry.js',
 'cameras/Camera.js',
-'cameras/OrthoCamera.js',
+'cameras/OrthographicCamera.js',
+'cameras/PerspectiveCamera.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/DirectionalLight.js',
@@ -268,7 +272,8 @@ WEBGL_FILES = [
 'core/Spline.js',
 'core/Edge.js',
 'cameras/Camera.js',
-'cameras/OrthoCamera.js',
+'cameras/OrthographicCamera.js',
+'cameras/PerspectiveCamera.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/DirectionalLight.js',