Przeglądaj źródła

Updated closure compiler.

Mr.doob 14 lat temu
rodzic
commit
4f0199fc13

Plik diff jest za duży
+ 184 - 187
build/Three.js


+ 114 - 116
build/custom/ThreeCanvas.js

@@ -1,145 +1,143 @@
 // ThreeCanvas.js r41/ROME - http://github.com/mrdoob/three.js
-var THREE=THREE||{};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}THREE.Color=function(a){this.setHex(a)};
-THREE.Color.prototype={copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex},setHex:function(a){this.hex=~~a&16777215;this.updateRGB()},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;this.updateHex()},setHSV:function(a,b,c){var d,e,g,f,i,h;if(c==0)d=e=g=0;else{f=Math.floor(a*6);i=a*6-f;a=c*(1-b);h=c*(1-b*i);b=c*(1-b*(1-i));switch(f){case 1:d=h;e=c;g=a;break;case 2:d=a;e=c;g=b;break;case 3:d=a;e=h;g=c;break;case 4:d=b;e=a;g=c;break;case 5:d=c;e=a;g=h;break;case 6:case 0:d=c;e=b;g=a}}this.setRGB(d,
+var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(a){this.setHex(a)};
+THREE.Color.prototype={copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex},setHex:function(a){this.hex=~~a&16777215;this.updateRGB()},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;this.updateHex()},setHSV:function(a,b,c){var d,e,g,f,h,j;if(c==0)d=e=g=0;else switch(f=Math.floor(a*6),h=a*6-f,a=c*(1-b),j=c*(1-b*h),b=c*(1-b*(1-h)),f){case 1:d=j;e=c;g=a;break;case 2:d=a;e=c;g=b;break;case 3:d=a;e=j;g=c;break;case 4:d=b;e=a;g=c;break;case 5:d=c;e=a;g=j;break;case 6:case 0:d=c,e=b,g=a}this.setRGB(d,
 e,g)},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},clone:function(){return new THREE.Color(this.hex)}};THREE.Vector2=function(a,b){this.set(a||0,b||0)};
 THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.set(a.x,a.y);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a);return this},negate:function(){this.set(-this.x,-this.y);return this},unit:function(){this.multiplyScalar(1/
 this.length());return this},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)};
 THREE.Vector3.prototype={set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.set(a.x,a.y,a.z);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z);return this},addScalar:function(a){this.set(this.x+a,this.y+a,this.z+a);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z);return this},cross:function(a,
 b){this.set(a.y*b.z-a.z*b.y,a.z*b.x-a.x*b.z,a.x*b.y-a.y*b.x);return this},crossSelf:function(a){var b=this.x,c=this.y,d=this.z;this.set(c*a.z-d*a.y,d*a.x-b*a.z,b*a.y-c*a.x);return this},multiply:function(a,b){this.set(a.x*b.x,a.y*b.y,a.z*b.z);return this},multiplySelf:function(a){this.set(this.x*a.x,this.y*a.y,this.z*a.z);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a,this.z*a);return this},divideSelf:function(a){this.set(this.x/a.x,this.y/a.y,this.z/a.z);return this},divideScalar:function(a){this.set(this.x/
-a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a=
-this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);if(Math.abs(b)>1.0E-5){this.x=Math.atan2(-a.n23/b,a.n33/b);this.z=Math.atan2(-a.n12/b,a.n11/b)}else{this.x=0;this.z=Math.atan2(a.n21,a.n22)}},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<
-1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)};
+a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y,a=this.z-a.z;return b*b+c*c+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a=
+this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&
+Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)};
 THREE.Vector4.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z,a.w+b.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z,a.w-b.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x*
 a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,b){this.set(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)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
-THREE.Ray.prototype={intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d,e=[];b=0;for(c=a.length;b<c;b++){d=a[b];d instanceof THREE.Mesh&&(e=e.concat(this.intersectObject(d)))}e.sort(function(g,f){return g.distance-f.distance});return e},intersectObject:function(a){function b(D,z,W,T){T=T.clone().subSelf(z);W=W.clone().subSelf(z);var aa=D.clone().subSelf(z);D=T.dot(T);z=T.dot(W);T=T.dot(aa);var I=W.dot(W);W=W.dot(aa);aa=1/(D*I-z*z);I=(I*T-z*W)*
-aa;D=(D*W-z*T)*aa;return I>0&&D>0&&I+D<1}var c,d,e,g,f,i,h,j,o,q,n,p=a.geometry,l=p.vertices,w=[];c=0;for(d=p.faces.length;c<d;c++){e=p.faces[c];q=this.origin.clone();n=this.direction.clone();h=a.matrixWorld;g=h.multiplyVector3(l[e.a].position.clone());f=h.multiplyVector3(l[e.b].position.clone());i=h.multiplyVector3(l[e.c].position.clone());h=e instanceof THREE.Face4?h.multiplyVector3(l[e.d].position.clone()):null;j=a.matrixRotationWorld.multiplyVector3(e.normal.clone());o=n.dot(j);if(a.doubleSided||
-(a.flipSided?o>0:o<0)){j=j.dot((new THREE.Vector3).sub(g,q))/o;q=q.addSelf(n.multiplyScalar(j));if(e instanceof THREE.Face3){if(b(q,g,f,i)){e={distance:this.origin.distanceTo(q),point:q,face:e,object:a};w.push(e)}}else if(e instanceof THREE.Face4&&(b(q,g,f,h)||b(q,f,i,h))){e={distance:this.origin.distanceTo(q),point:q,face:e,object:a};w.push(e)}}}return w}};
-THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,i=!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(h,j,o,q){i=!1;b=h;c=j;d=o;e=q;a()};this.addPoint=function(h,j){if(i){i=!1;b=h;c=j;d=h;e=j}else{b=b<h?b:h;c=c<j?c:j;d=d>h?d:h;e=e>j?e:j}a()};
-this.add3Points=function(h,j,o,q,n,p){if(i){i=!1;b=h<o?h<n?h:n:o<n?o:n;c=j<q?j<p?j:p:q<p?q:p;d=h>o?h>n?h:n:o>n?o:n;e=j>q?j>p?j:p:q>p?q:p}else{b=h<o?h<n?h<b?h:b:n<b?n:b:o<n?o<b?o:b:n<b?n:b;c=j<q?j<p?j<c?j:c:p<c?p:c:q<p?q<c?q:c:p<c?p:c;d=h>o?h>n?h>d?h:d:n>d?n:d:o>n?o>d?o:d:n>d?n:d;e=j>q?j>p?j>e?j:e:p>e?p:e:q>p?q>e?q:e:p>e?p:e}a()};this.addRectangle=function(h){if(i){i=!1;b=h.getLeft();c=h.getTop();d=h.getRight();e=h.getBottom()}else{b=b<h.getLeft()?b:h.getLeft();c=c<h.getTop()?c:h.getTop();d=d>h.getRight()?
-d:h.getRight();e=e>h.getBottom()?e:h.getBottom()}a()};this.inflate=function(h){b-=h;c-=h;d+=h;e+=h;a()};this.minSelf=function(h){b=b>h.getLeft()?b:h.getLeft();c=c>h.getTop()?c:h.getTop();d=d<h.getRight()?d:h.getRight();e=e<h.getBottom()?e:h.getBottom();a()};this.instersects=function(h){return Math.min(d,h.getRight())-Math.max(b,h.getLeft())>=0&&Math.min(e,h.getBottom())-Math.max(c,h.getTop())>=0};this.empty=function(){i=!0;e=d=c=b=0;a()};this.isEmpty=function(){return i}};
-THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={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,i,h,j,o,q,n,p,l,w){this.set(a||1,b||0,c||0,d||0,e||0,g||1,f||0,i||0,h||0,j||0,o||1,q||0,n||0,p||0,l||0,w||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={set:function(a,b,c,d,e,g,f,i,h,j,o,q,n,p,l,w){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=g;this.n23=f;this.n24=i;this.n31=h;this.n32=j;this.n33=o;this.n34=q;this.n41=n;this.n42=p;this.n43=l;this.n44=w;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();if(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;a.y=(this.n21*b+this.n22*c+this.n23*
+THREE.Ray.prototype={intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d,e=[];b=0;for(c=a.length;b<c;b++)d=a[b],d instanceof THREE.Mesh&&(e=e.concat(this.intersectObject(d)));e.sort(function(a,b){return a.distance-b.distance});return e},intersectObject:function(a){function b(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}var c,d,e,g,f,h,j,i,o,m,k,n=a.geometry,l=n.vertices,q=[];c=0;for(d=n.faces.length;c<d;c++)if(e=n.faces[c],m=this.origin.clone(),k=this.direction.clone(),j=a.matrixWorld,g=j.multiplyVector3(l[e.a].position.clone()),f=j.multiplyVector3(l[e.b].position.clone()),h=j.multiplyVector3(l[e.c].position.clone()),j=e instanceof THREE.Face4?j.multiplyVector3(l[e.d].position.clone()):null,i=a.matrixRotationWorld.multiplyVector3(e.normal.clone()),o=k.dot(i),a.doubleSided||(a.flipSided?
+o>0:o<0))if(i=i.dot((new THREE.Vector3).sub(g,m))/o,m=m.addSelf(k.multiplyScalar(i)),e instanceof THREE.Face3)b(m,g,f,h)&&(e={distance:this.origin.distanceTo(m),point:m,face:e,object:a},q.push(e));else if(e instanceof THREE.Face4&&(b(m,g,f,j)||b(m,f,h,j)))e={distance:this.origin.distanceTo(m),point:m,face:e,object:a},q.push(e);return q}};
+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,o,m){h=!1;b=f;c=g;d=o;e=m;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,o,m,k,n){h?(h=!1,b=f<o?f<k?f:k:o<k?o:k,c=g<m?g<n?g:n:m<n?m:n,d=f>o?f>k?f:k:o>k?o:k,e=g>m?g>n?g:n:m>n?m:n):(b=f<o?f<k?f<b?f:b:k<b?k:b:o<k?o<b?o:b:k<b?k:b,c=g<m?g<n?g<c?g:c:n<c?n:c:m<n?m<c?m:c:n<c?n:c,d=f>o?f>k?f>d?f:d:k>d?k:d:o>k?o>d?o:d:k>d?k:d,e=g>m?g>n?g>e?g:e:n>e?n:e:m>n?m>e?m:e:n>e?n: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.instersects=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={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,j,i,o,m,k,n,l,q){this.set(a||1,b||0,c||0,d||0,e||0,g||1,f||0,h||0,j||0,i||0,o||1,m||0,k||0,n||0,l||0,q||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={set:function(a,b,c,d,e,g,f,h,j,i,o,m,k,n,l,q){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=j;this.n32=i;this.n33=o;this.n34=m;this.n41=k;this.n42=n;this.n43=l;this.n44=q;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;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,i=a.n22,h=a.n23,j=a.n24,o=a.n31,q=a.n32,n=a.n33,p=a.n34,l=a.n41,w=a.n42,D=a.n43,z=a.n44,W=b.n11,T=b.n12,aa=b.n13,I=b.n14,r=b.n21,ba=b.n22,
-x=b.n23,E=b.n24,L=b.n31,y=b.n32,C=b.n33,Z=b.n34;this.n11=c*W+d*r+e*L;this.n12=c*T+d*ba+e*y;this.n13=c*aa+d*x+e*C;this.n14=c*I+d*E+e*Z+g;this.n21=f*W+i*r+h*L;this.n22=f*T+i*ba+h*y;this.n23=f*aa+i*x+h*C;this.n24=f*I+i*E+h*Z+j;this.n31=o*W+q*r+n*L;this.n32=o*T+q*ba+n*y;this.n33=o*aa+q*x+n*C;this.n34=o*I+q*E+n*Z+p;this.n41=l*W+w*r+D*L;this.n42=l*T+w*ba+D*y;this.n43=l*aa+w*x+D*C;this.n44=l*I+w*E+D*Z+z;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;
+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,j=a.n23,i=a.n24,o=a.n31,m=a.n32,k=a.n33,n=a.n34,l=a.n41,q=a.n42,x=a.n43,t=a.n44,H=b.n11,L=b.n12,y=b.n13,C=b.n14,p=b.n21,N=b.n22,
+r=b.n23,v=b.n24,z=b.n31,R=b.n32,aa=b.n33,$=b.n34;this.n11=c*H+d*p+e*z;this.n12=c*L+d*N+e*R;this.n13=c*y+d*r+e*aa;this.n14=c*C+d*v+e*$+g;this.n21=f*H+h*p+j*z;this.n22=f*L+h*N+j*R;this.n23=f*y+h*r+j*aa;this.n24=f*C+h*v+j*$+i;this.n31=o*H+m*p+k*z;this.n32=o*L+m*N+k*R;this.n33=o*y+m*r+k*aa;this.n34=o*C+m*v+k*$+n;this.n41=l*H+q*p+x*z;this.n42=l*L+q*N+x*R;this.n43=l*y+q*r+x*aa;this.n44=l*C+q*v+x*$+t;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,i=this.n24,h=this.n31,j=this.n32,o=this.n33,q=this.n34,n=this.n41,p=this.n42,l=this.n43,w=this.n44;return d*f*j*n-c*i*j*n-d*g*o*n+b*i*o*n+c*g*q*n-b*f*q*n-d*f*h*p+c*i*h*p+d*e*o*p-a*i*o*p-c*e*q*p+a*f*q*p+d*g*h*l-b*i*h*l-d*e*j*l+a*i*j*l+b*e*q*l-a*g*q*l-c*g*h*w+b*f*h*w+c*e*j*w-a*f*j*w-b*e*o*w+a*g*o*w},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.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,j=this.n31,i=this.n32,o=this.n33,m=this.n34,k=this.n41,n=this.n42,l=this.n43,q=this.n44;return d*f*i*k-c*h*i*k-d*g*o*k+b*h*o*k+c*g*m*k-b*f*m*k-d*f*j*n+c*h*j*n+d*e*o*n-a*h*o*n-c*e*m*n+a*f*m*n+d*g*j*l-b*h*j*l-d*e*i*l+a*h*i*l+b*e*m*l-a*g*m*l-c*g*j*q+b*f*j*q+c*e*i*q-a*f*i*q-b*e*o*q+a*g*o*q},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,i=a.z,h=e*g,j=e*f;this.set(h*
-g+c,h*f-d*i,h*i+d*f,0,h*f+d*i,j*f+c,j*i-d*g,0,h*i-d*f,j*i+d*g,e*i*i+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){var b=a.x,c=a.y,d=a.z;a=Math.cos(b);b=Math.sin(b);var e=Math.cos(c);c=Math.sin(c);var g=Math.cos(d);d=Math.sin(d);var f=a*c,i=b*c;this.n11=e*g;this.n12=-e*d;this.n13=c;this.n21=i*g+a*d;this.n22=-i*d+a*g;this.n23=-b*e;this.n31=-f*g+b*d;this.n32=f*d+b*g;this.n33=a*e;return this},
-setRotationFromQuaternion:function(a){var b=a.x,c=a.y,d=a.z,e=a.w,g=b+b,f=c+c,i=d+d;a=b*g;var h=b*f;b*=i;var j=c*f;c*=i;d*=i;g*=e;f*=e;e*=i;this.n11=1-(j+d);this.n12=h-e;this.n13=b+f;this.n21=h+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},extractPosition:function(a){this.n14=
+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,j=e*g,i=e*f;this.set(j*
+g+c,j*f-d*h,j*h+d*f,0,j*f+d*h,i*f+c,i*h-d*g,0,j*h-d*f,i*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){var b=a.x,c=a.y,d=a.z,a=Math.cos(b),b=Math.sin(b),e=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),f=a*c,h=b*c;this.n11=e*g;this.n12=-e*d;this.n13=c;this.n21=h*g+a*d;this.n22=-h*d+a*g;this.n23=-b*e;this.n31=-f*g+b*d;this.n32=f*d+b*g;this.n33=a*e;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,j=b*f;b*=h;var i=c*f;c*=h;d*=h;g*=e;f*=e;e*=h;this.n11=1-(i+d);this.n12=j-e;this.n13=b+f;this.n21=j+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+i);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},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,i=a.n22,h=a.n23,j=a.n24,o=a.n31,q=a.n32,n=a.n33,p=a.n34,l=a.n41,w=a.n42,D=a.n43,z=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=h*p*w-j*n*w+j*q*D-i*p*D-h*q*z+i*n*z;b.n12=g*n*w-e*p*w-g*q*D+d*p*D+e*q*z-d*n*z;b.n13=e*j*w-g*h*w+g*i*D-d*j*D-e*i*z+d*h*z;b.n14=g*h*q-e*j*q-g*i*n+d*j*n+e*i*p-d*h*p;b.n21=j*n*l-h*p*l-j*o*D+f*p*D+h*o*z-f*n*z;b.n22=e*p*l-g*n*l+g*o*D-c*p*D-e*o*z+c*n*z;b.n23=g*h*l-e*j*l-g*f*D+c*j*D+e*f*z-c*h*z;
-b.n24=e*j*o-g*h*o+g*f*n-c*j*n-e*f*p+c*h*p;b.n31=i*p*l-j*q*l+j*o*w-f*p*w-i*o*z+f*q*z;b.n32=g*q*l-d*p*l-g*o*w+c*p*w+d*o*z-c*q*z;b.n33=e*j*l-g*i*l+g*f*w-c*j*w-d*f*z+c*i*z;b.n34=g*i*o-d*j*o-g*f*q+c*j*q+d*f*p-c*i*p;b.n41=h*q*l-i*n*l-h*o*w+f*n*w+i*o*D-f*q*D;b.n42=d*n*l-e*q*l+e*o*w-c*n*w-d*o*D+c*q*D;b.n43=e*i*l-d*h*l-e*f*w+c*h*w+d*f*D-c*i*D;b.n44=d*h*o-e*i*o+e*f*q-c*h*q-d*f*n+c*i*n;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,i=a.n33*a.n11-a.n31*a.n13,h=-a.n32*a.n11+a.n31*a.n12,j=a.n23*a.n12-a.n22*a.n13,o=-a.n23*a.n11+a.n21*a.n13,q=a.n22*a.n11-a.n21*a.n12;a=a.n11*d+a.n21*f+a.n31*j;if(a==0)throw"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*i;c[5]=a*h;c[6]=a*j;c[7]=a*o;c[8]=a*q;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,i,h,j;f=new THREE.Matrix4;i=b-a;h=c-d;j=g-e;f.n11=2/i;f.n12=0;f.n13=0;f.n14=-((b+a)/i);f.n21=0;f.n22=2/h;f.n23=0;f.n24=-((c+d)/h);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.Object3D=function(){this.parent=undefined;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.dynamic=!1;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=
-1;this.visible=!0;this._vector=new THREE.Vector3;this.name=""};
+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,j=a.n23,i=a.n24,o=a.n31,m=a.n32,k=a.n33,n=a.n34,l=a.n41,q=a.n42,x=a.n43,t=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=j*n*q-i*k*q+i*m*x-h*n*x-j*m*t+h*k*t;b.n12=g*k*q-e*n*q-g*m*x+d*n*x+e*m*t-d*k*t;b.n13=e*i*q-g*j*q+g*h*x-d*i*x-e*h*t+d*j*t;b.n14=g*j*m-e*i*m-g*h*k+d*i*k+e*h*n-d*j*n;b.n21=i*k*l-j*n*l-i*o*x+f*n*x+j*o*t-f*k*t;b.n22=e*n*l-g*k*l+g*o*x-c*n*x-e*o*t+c*k*t;b.n23=g*j*l-e*i*l-g*f*x+c*i*x+e*f*t-c*j*t;b.n24=
+e*i*o-g*j*o+g*f*k-c*i*k-e*f*n+c*j*n;b.n31=h*n*l-i*m*l+i*o*q-f*n*q-h*o*t+f*m*t;b.n32=g*m*l-d*n*l-g*o*q+c*n*q+d*o*t-c*m*t;b.n33=e*i*l-g*h*l+g*f*q-c*i*q-d*f*t+c*h*t;b.n34=g*h*o-d*i*o-g*f*m+c*i*m+d*f*n-c*h*n;b.n41=j*m*l-h*k*l-j*o*q+f*k*q+h*o*x-f*m*x;b.n42=d*k*l-e*m*l+e*o*q-c*k*q-d*o*x+c*m*x;b.n43=e*h*l-d*j*l-e*f*q+c*j*q+d*f*x-c*h*x;b.n44=d*j*o-e*h*o+e*f*m-c*j*m-d*f*k+c*h*k;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,j=-a.n32*a.n11+a.n31*a.n12,i=a.n23*a.n12-a.n22*a.n13,o=-a.n23*a.n11+a.n21*a.n13,m=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*i;if(a==0)throw"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*j;c[6]=a*i;c[7]=a*o;c[8]=a*m;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,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.Object3D=function(){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.scale=new THREE.Vector3(1,1,1);this.dynamic=!1;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._vector=new THREE.Vector3;this.name=""};
 THREE.Object3D.prototype={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)},addChild:function(a){if(this.children.indexOf(a)===
--1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==undefined;)b=b.parent;b!==undefined&&b instanceof THREE.Scene&&b.addChildRecurse(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=undefined;this.children.splice(b,1)}},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);if(e!==undefined)return e}}},updateMatrix:function(){this.matrix.setPosition(this.position);
-this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation);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}a=0;for(var d=this.children.length;a<d;a++)this.children[a].update(this.matrixWorld,b,c)}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==undefined?d:1)};
-THREE.Quaternion.prototype={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=0.5*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);var g=Math.cos(c);c=Math.sin(c);var f=a*b,i=d*e;this.w=f*g-i*c;this.x=f*c+i*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);this.x=a.x*d;this.y=
-a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a==0)this.w=this.z=this.y=this.x=0;else{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,i=a.z;a=a.w;this.x=b*a+e*g+c*i-d*f;this.y=c*a+e*f+d*g-b*i;this.z=d*a+e*i+b*f-c*g;this.w=e*a-b*g-c*f-d*i;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,i=this.z,h=this.w,j=h*c+f*e-i*d,o=
-h*d+i*c-g*e,q=h*e+g*d-f*c;c=-g*c-f*d-i*e;b.x=j*h+c*-g+o*-i-q*-f;b.y=o*h+c*-f+q*-g-j*-i;b.z=q*h+c*-i+j*-f-o*-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){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.001){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);return 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};
+-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)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1)a.parent=void 0,this.children.splice(b,1)},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);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)}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==void 0?d:1)};
+THREE.Quaternion.prototype={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=0.5*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);this.x=a.x*d;this.y=a.y*
+d;this.z=a.z*d;this.w=Math.cos(c);return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
+multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,j=this.w,i=j*c+f*e-h*d,o=
+j*d+h*c-g*e,m=j*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=i*j+c*-g+o*-h-m*-f;b.y=o*j+c*-f+m*-g-i*-h;b.z=m*j+c*-h+i*-f-o*-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.set(a||0,b||0)};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
-THREE.Geometry.prototype={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);if(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)}else if(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,i=new THREE.Vector3,h=new THREE.Vector3;d=0;for(e=this.faces.length;d<e;d++){g=this.faces[d];if(a&&g.vertexNormals.length){i.set(0,0,0);b=0;for(c=g.vertexNormals.length;b<c;b++)i.addSelf(g.vertexNormals[b]);i.divideScalar(3)}else{b=this.vertices[g.a];c=this.vertices[g.b];f=this.vertices[g.c];i.sub(f.position,c.position);h.sub(b.position,c.position);i.crossSelf(h)}i.isZero()||
-i.normalize();g.normal.copy(i)}},computeVertexNormals:function(){var a,b,c,d;if(this.__tmpVertices==undefined){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++){c=this.faces[a];if(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];if(c instanceof THREE.Face3){d[c.a].addSelf(c.normal);d[c.b].addSelf(c.normal);d[c.c].addSelf(c.normal)}else if(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];if(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])}else if(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,G,H,Q,F,$,U){i=A.vertices[G].position;h=A.vertices[H].position;j=A.vertices[Q].position;o=f[F];q=f[$];n=f[U];p=h.x-i.x;l=j.x-i.x;w=h.y-i.y;D=j.y-i.y;z=h.z-i.z;W=j.z-i.z;T=q.u-o.u;aa=n.u-o.u;I=q.v-o.v;r=n.v-o.v;ba=1/(T*r-aa*I);y.set((r*
-p-I*l)*ba,(r*w-I*D)*ba,(r*z-I*W)*ba);C.set((T*l-aa*p)*ba,(T*D-aa*w)*ba,(T*W-aa*z)*ba);E[G].addSelf(y);E[H].addSelf(y);E[Q].addSelf(y);L[G].addSelf(C);L[H].addSelf(C);L[Q].addSelf(C)}var b,c,d,e,g,f,i,h,j,o,q,n,p,l,w,D,z,W,T,aa,I,r,ba,x,E=[],L=[],y=new THREE.Vector3,C=new THREE.Vector3,Z=new THREE.Vector3,N=new THREE.Vector3,P=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++){E[b]=new THREE.Vector3;L[b]=new THREE.Vector3}b=0;for(c=this.faces.length;b<c;b++){g=this.faces[b];f=this.faceVertexUvs[0][b];
-if(g instanceof THREE.Face3)a(this,g.a,g.b,g.c,0,1,2);else if(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++){P.copy(g.vertexNormals[d]);e=g[J[d]];x=E[e];Z.copy(x);Z.subSelf(P.multiplyScalar(P.dot(x))).normalize();N.cross(g.vertexNormals[d],x);e=N.dot(L[e]);e=e<0?-1:1;g.vertexTangents[d]=new THREE.Vector4(Z.x,Z.y,Z.z,e)}}this.hasTangents=!0},computeBoundingBox:function(){var a;
+THREE.Geometry.prototype={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,j=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),j.sub(b.position,c.position),h.crossSelf(j);h.isZero()||
+h.normalize();g.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,r){h=a.vertices[b].position;j=a.vertices[c].position;i=a.vertices[d].position;o=f[e];m=f[g];k=f[r];n=j.x-h.x;l=i.x-h.x;q=j.y-h.y;x=i.y-h.y;t=j.z-h.z;H=i.z-h.z;L=m.u-o.u;y=k.u-o.u;C=m.v-o.v;p=k.v-o.v;N=1/(L*p-y*C);R.set((p*n-C*l)*
+N,(p*q-C*x)*N,(p*t-C*H)*N);aa.set((L*l-y*n)*N,(L*x-y*q)*N,(L*H-y*t)*N);v[b].addSelf(R);v[c].addSelf(R);v[d].addSelf(R);z[b].addSelf(aa);z[c].addSelf(aa);z[d].addSelf(aa)}var b,c,d,e,g,f,h,j,i,o,m,k,n,l,q,x,t,H,L,y,C,p,N,r,v=[],z=[],R=new THREE.Vector3,aa=new THREE.Vector3,$=new THREE.Vector3,J=new THREE.Vector3,P=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)v[b]=new THREE.Vector3,z[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 S=["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++)P.copy(g.vertexNormals[d]),e=g[S[d]],r=v[e],$.copy(r),$.subSelf(P.multiplyScalar(P.dot(r))).normalize(),J.cross(g.vertexNormals[d],r),e=J.dot(z[e]),e=e<0?-1:1,g.vertexTangents[d]=new THREE.Vector4($.x,$.y,$.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=this.boundingSphere===null?0:this.boundingSphere.radius,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(h,j){return Math.min(h,
-j)+"_"+Math.max(h,j)}function b(h,j,o){if(h[j]===undefined){h[j]={set:{},array:[]};h[j].set[o]=1;h[j].array.push(o)}else if(h[j].set[o]===undefined){h[j].set[o]=1;h[j].array.push(o)}}var c,d,e,g,f,i={};c=0;for(d=this.faces.length;c<d;c++){f=this.faces[c];if(f instanceof THREE.Face3){e=a(f.a,f.b);b(i,e,c);e=a(f.b,f.c);b(i,e,c);e=a(f.a,f.c);b(i,e,c)}else if(f instanceof THREE.Face4){e=a(f.b,f.d);b(i,e,c);e=a(f.a,f.b);b(i,e,c);e=a(f.a,f.d);b(i,e,c);e=a(f.b,f.c);b(i,e,c);e=a(f.c,f.d);b(i,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=i[a(e,g)].array;for(e=0;e<f.faceIndices.length;e++){g=f.faceIndices[e];f.faces.push(this.faces[g])}}}};THREE.GeometryIdCounter=0;THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=d||2E3;this.target=e||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};
-THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
-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{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.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,d){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0;this.castShadow=d!==undefined?d:!1};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;this.intensity=b||1;this.distance=c||0};
-THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.Material=function(a){this.id=THREE.MaterialCounter.value++;a=a||{};this.opacity=a.opacity!==undefined?a.opacity:1;this.transparent=a.transparent!==undefined?a.transparent:!1;this.blending=a.blending!==undefined?a.blending:THREE.NormalBlending;this.depthTest=a.depthTest!==undefined?a.depthTest:!0};THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;
+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=this.boundingSphere===null?0:this.boundingSphere.radius,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.GeometryIdCounter=0;THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=d||2E3;this.target=e||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;
+THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
+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.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,d){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0;this.castShadow=d!==void 0?d:!1};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;this.intensity=b||1;this.distance=c||0};
+THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.Material=function(a){this.id=THREE.MaterialCounter.value++;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};THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;
 THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.AdditiveAlphaBlending=4;THREE.MaterialCounter={value:0};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};
-THREE.LineBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==undefined?new THREE.Color(a.color):new THREE.Color(16777215);this.linewidth=a.linewidth!==undefined?a.linewidth:1;this.linecap=a.linecap!==undefined?a.linecap:"round";this.linejoin=a.linejoin!==undefined?a.linejoin:"round";this.vertexColors=a.vertexColors?a.vertexColors:!1};THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
-THREE.MeshBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==undefined?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==undefined?a.map:null;this.lightMap=a.lightMap!==undefined?a.lightMap:null;this.envMap=a.envMap!==undefined?a.envMap:null;this.combine=a.combine!==undefined?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==undefined?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==undefined?a.refractionRatio:0.98;this.shading=
-a.shading!==undefined?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==undefined?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==undefined?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==undefined?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==undefined?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==undefined?a.vertexColors:!1;this.skinning=a.skinning!==undefined?a.skinning:!1;this.morphTargets=a.morphTargets!==undefined?
-a.morphTargets:!1};THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
-THREE.MeshLambertMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==undefined?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==undefined?a.map:null;this.lightMap=a.lightMap!==undefined?a.lightMap:null;this.envMap=a.envMap!==undefined?a.envMap:null;this.combine=a.combine!==undefined?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==undefined?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==undefined?a.refractionRatio:0.98;this.shading=
-a.shading!==undefined?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==undefined?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==undefined?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==undefined?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==undefined?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==undefined?a.vertexColors:!1;this.skinning=a.skinning!==undefined?a.skinning:!1;this.morphTargets=a.morphTargets!==undefined?
-a.morphTargets:!1};THREE.MeshLambertMaterial.prototype=new THREE.Material;THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial;
-THREE.MeshPhongMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==undefined?new THREE.Color(a.color):new THREE.Color(16777215);this.ambient=a.ambient!==undefined?new THREE.Color(a.ambient):new THREE.Color(328965);this.specular=a.specular!==undefined?new THREE.Color(a.specular):new THREE.Color(1118481);this.shininess=a.shininess!==undefined?a.shininess:30;this.map=a.map!==undefined?a.map:null;this.lightMap=a.lightMap!==undefined?a.lightMap:null;this.envMap=a.envMap!==undefined?
-a.envMap:null;this.combine=a.combine!==undefined?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==undefined?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==undefined?a.refractionRatio:0.98;this.shading=a.shading!==undefined?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==undefined?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==undefined?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==undefined?a.wireframeLinecap:"round";this.wireframeLinejoin=
-a.wireframeLinejoin!==undefined?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==undefined?a.vertexColors:!1;this.skinning=a.skinning!==undefined?a.skinning:!1;this.morphTargets=a.morphTargets!==undefined?a.morphTargets:!1};THREE.MeshPhongMaterial.prototype=new THREE.Material;THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial;
-THREE.MeshDepthMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading!==undefined?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==undefined?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==undefined?a.wireframeLinewidth:1};THREE.MeshDepthMaterial.prototype=new THREE.Material;THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial;
+THREE.LineBasicMaterial=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.linewidth=a.linewidth!==void 0?a.linewidth:1;this.linecap=a.linecap!==void 0?a.linecap:"round";this.linejoin=a.linejoin!==void 0?a.linejoin:"round";this.vertexColors=a.vertexColors?a.vertexColors:!1};THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
+THREE.MeshBasicMaterial=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.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.shading=a.shading!==
+void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};
+THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
+THREE.MeshLambertMaterial=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.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.shading=a.shading!==
+void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};
+THREE.MeshLambertMaterial.prototype=new THREE.Material;THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial;
+THREE.MeshPhongMaterial=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.ambient=a.ambient!==void 0?new THREE.Color(a.ambient):new THREE.Color(328965);this.specular=a.specular!==void 0?new THREE.Color(a.specular):new THREE.Color(1118481);this.shininess=a.shininess!==void 0?a.shininess:30;this.map=a.map!==void 0?a.map:null;this.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;
+this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==
+void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};THREE.MeshPhongMaterial.prototype=new THREE.Material;THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial;
+THREE.MeshDepthMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1};THREE.MeshDepthMaterial.prototype=new THREE.Material;THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial;
 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!==undefined?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==undefined?a.map:null;this.size=a.size!==undefined?a.size:1;this.sizeAttenuation=a.sizeAttenuation!==undefined?a.sizeAttenuation:!0;this.vertexColors=a.vertexColors!==undefined?a.vertexColors:!1};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!==undefined?new THREE.Color(a.color):new THREE.Color(16777215);this.program=a.program!==undefined?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.image=a;this.mapping=b!==undefined?b:new THREE.UVMapping;this.wrapS=c!==undefined?c:THREE.ClampToEdgeWrapping;this.wrapT=d!==undefined?d:THREE.ClampToEdgeWrapping;this.magFilter=e!==undefined?e:THREE.LinearFilter;this.minFilter=g!==undefined?g:THREE.LinearMipMapLinearFilter;this.needsUpdate=!1};THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter)}};
-THREE.MultiplyOperation=0;THREE.MixOperation=1;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!=undefined?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;
+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};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.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.needsUpdate=!1};THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter)}};THREE.MultiplyOperation=0;
+THREE.MixOperation=1;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};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;
 THREE.Line.prototype.constructor=THREE.Line;
-THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b&&b.length?b:[b];this.flipSided=!1;this.doubleSided=!1;this.overdraw=!1;if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius;if(this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++){this.morphTargetInfluences.push(0);this.morphTargetDictionary[this.geometry.morphTargets[c].name]=
-c}}}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==undefined)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
+THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b&&b.length?b:[b];this.overdraw=this.doubleSided=this.flipSided=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=a.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[c].name]=
+c}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 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!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);if(!(a instanceof THREE.Bone))this.hasNoneBoneChildren=!0}};
-THREE.Sound=function(a,b,c,d){THREE.Object3D.call(this);this.isLoaded=!1;this.isAddedToDOM=!1;this.isPlaying=!1;this.duration=-1;this.radius=b!==undefined?Math.abs(b):100;this.volume=Math.min(1,Math.max(0,c!==undefined?c:1));this.domElement=document.createElement("audio");this.domElement.volume=0;this.domElement.pan=0;this.domElement.loop=d!==undefined?d:!0;this.sources=a instanceof Array?a:[a];var e;c=this.sources.length;for(a=0;a<c;a++){b=this.sources[a];b.toLowerCase();if(b.indexOf(".mp3")!==-1)e=
-"audio/mpeg";else if(b.indexOf(".ogg")!==-1)e="audio/ogg";else b.indexOf(".wav")!==-1&&(e="audio/wav");if(this.domElement.canPlayType(e)){e=document.createElement("source");e.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(e);this.domElement.addEventListener("canplay",this.onLoad,!0);this.domElement.load();break}}};THREE.Sound.prototype=new THREE.Object3D;THREE.Sound.prototype.constructor=THREE.Sound;THREE.Sound.prototype.supr=THREE.Object3D.prototype;
-THREE.Sound.prototype.onLoad=function(){var a=this.THREESound;if(!a.isLoaded){this.removeEventListener("canplay",this.onLoad,!0);a.isLoaded=!0;a.duration=this.duration;a.isPlaying&&a.play()}};THREE.Sound.prototype.addToDOM=function(a){this.isAddedToDOM=!0;a.appendChild(this.domElement)};THREE.Sound.prototype.play=function(a){this.isPlaying=!0;if(this.isLoaded){this.domElement.play();if(a)this.domElement.currentTime=a%this.duration}};THREE.Sound.prototype.pause=function(){this.isPlaying=!1;this.domElement.pause()};
+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.Sound=function(a,b,c,d){THREE.Object3D.call(this);this.isPlaying=this.isAddedToDOM=this.isLoaded=!1;this.duration=-1;this.radius=b!==void 0?Math.abs(b):100;this.volume=Math.min(1,Math.max(0,c!==void 0?c:1));this.domElement=document.createElement("audio");this.domElement.volume=0;this.domElement.pan=0;this.domElement.loop=d!==void 0?d:!0;this.sources=a instanceof Array?a:[a];for(var e,c=this.sources.length,a=0;a<c;a++)if(b=this.sources[a],b.toLowerCase(),b.indexOf(".mp3")!==-1?e="audio/mpeg":
+b.indexOf(".ogg")!==-1?e="audio/ogg":b.indexOf(".wav")!==-1&&(e="audio/wav"),this.domElement.canPlayType(e)){e=document.createElement("source");e.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(e);this.domElement.addEventListener("canplay",this.onLoad,!0);this.domElement.load();break}};THREE.Sound.prototype=new THREE.Object3D;THREE.Sound.prototype.constructor=THREE.Sound;THREE.Sound.prototype.supr=THREE.Object3D.prototype;
+THREE.Sound.prototype.onLoad=function(){var a=this.THREESound;if(!a.isLoaded)this.removeEventListener("canplay",this.onLoad,!0),a.isLoaded=!0,a.duration=this.duration,a.isPlaying&&a.play()};THREE.Sound.prototype.addToDOM=function(a){this.isAddedToDOM=!0;a.appendChild(this.domElement)};THREE.Sound.prototype.play=function(a){this.isPlaying=!0;if(this.isLoaded&&(this.domElement.play(),a))this.domElement.currentTime=a%this.duration};THREE.Sound.prototype.pause=function(){this.isPlaying=!1;this.domElement.pause()};
 THREE.Sound.prototype.stop=function(){this.isPlaying=!1;this.domElement.pause();this.domElement.currentTime=0};THREE.Sound.prototype.calculateVolumeAndPan=function(a){a=a.length();this.domElement.volume=a<=this.radius?this.volume*(1-a/this.radius):0};
-THREE.Sound.prototype.update=function(a,b,c){if(this.matrixAutoUpdate){this.matrix.setPosition(this.position);b=!0}if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;b=!0}var d=this.children.length;for(a=0;a<d;a++)this.children[a].update(this.matrixWorld,b,c)};
+THREE.Sound.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(this.matrix.setPosition(this.position),b=!0);if(b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;for(var d=this.children.length,a=0;a<d;a++)this.children[a].update(this.matrixWorld,b,c)};
 THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.collisions=this.fog=null;this.objects=[];this.lights=[];this.sounds=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};
-THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1){this.objects.push(a);this.__objectsAdded.push(a)}for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
-THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};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 if(a instanceof THREE.Sound){b=this.sounds.indexOf(a);b!==-1&&this.sounds.splice(b,1)}else if(!(a instanceof THREE.Camera)){b=this.objects.indexOf(a);if(b!==-1){this.objects.splice(b,1);this.__objectsRemoved.push(a)}}for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};
+THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1)this.objects.push(a),this.__objectsAdded.push(a);for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
+THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};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.Sound?(b=this.sounds.indexOf(a),b!==-1&&this.sounds.splice(b,1)):a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a)));for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};
 THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;
-THREE.Projector=function(){function a(){var y=h[i]=h[i]||new THREE.RenderableVertex;i++;return y}function b(y,C){return C.z-y.z}function c(y,C){var Z=0,N=1,P=y.z+y.w,J=C.z+C.w,A=-y.z+y.w,G=-C.z+C.w;if(P>=0&&J>=0&&A>=0&&G>=0)return!0;else if(P<0&&J<0||A<0&&G<0)return!1;else{if(P<0)Z=Math.max(Z,P/(P-J));else J<0&&(N=Math.min(N,P/(P-J)));if(A<0)Z=Math.max(Z,A/(A-G));else G<0&&(N=Math.min(N,A/(A-G)));if(N<Z)return!1;else{y.lerpSelf(C,Z);C.lerpSelf(y,1-N);return!0}}}var d,e,g=[],f,i,h=[],j,o,q=[],n,p=
-[],l,w,D=[],z,W,T=[],aa=new THREE.Vector4,I=new THREE.Vector4,r=new THREE.Matrix4,ba=new THREE.Matrix4,x=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],E=new THREE.Vector4,L=new THREE.Vector4;this.projectVector=function(y,C){r.multiply(C.projectionMatrix,C.matrixWorldInverse);r.multiplyVector3(y);return y};this.unprojectVector=function(y,C){r.multiply(C.matrixWorld,THREE.Matrix4.makeInvert(C.projectionMatrix));r.multiplyVector3(y);return y};
-this.projectObjects=function(y,C,Z){C=[];var N,P,J;e=0;P=y.objects;y=0;for(N=P.length;y<N;y++){J=P[y];var A;if(!(A=!J.visible))if(A=J instanceof THREE.Mesh){a:{A=void 0;for(var G=J.matrixWorld,H=-J.geometry.boundingSphere.radius*Math.max(J.scale.x,Math.max(J.scale.y,J.scale.z)),Q=0;Q<6;Q++){A=x[Q].x*G.n14+x[Q].y*G.n24+x[Q].z*G.n34+x[Q].w;if(A<=H){A=!1;break a}}A=!0}A=!A}if(!A){A=g[e]=g[e]||new THREE.RenderableObject;e++;d=A;aa.copy(J.position);r.multiplyVector3(aa);d.object=J;d.z=aa.z;C.push(d)}}Z&&
-C.sort(b);return C};this.projectScene=function(y,C,Z){var N=[],P=C.near,J=C.far,A,G,H,Q,F,$,U,da,ha,B,X,V,Y,ea,ia,na,ja;W=w=n=o=0;C.matrixAutoUpdate&&C.update(undefined,!0);y.update(undefined,!1,C);r.multiply(C.projectionMatrix,C.matrixWorldInverse);x[0].set(r.n41-r.n11,r.n42-r.n12,r.n43-r.n13,r.n44-r.n14);x[1].set(r.n41+r.n11,r.n42+r.n12,r.n43+r.n13,r.n44+r.n14);x[2].set(r.n41+r.n21,r.n42+r.n22,r.n43+r.n23,r.n44+r.n24);x[3].set(r.n41-r.n21,r.n42-r.n22,r.n43-r.n23,r.n44-r.n24);x[4].set(r.n41-r.n31,
-r.n42-r.n32,r.n43-r.n33,r.n44-r.n34);x[5].set(r.n41+r.n31,r.n42+r.n32,r.n43+r.n33,r.n44+r.n34);for(A=0;A<6;A++){ha=x[A];ha.divideScalar(Math.sqrt(ha.x*ha.x+ha.y*ha.y+ha.z*ha.z))}ha=this.projectObjects(y,C,!0);y=0;for(A=ha.length;y<A;y++){B=ha[y].object;if(B.visible){X=B.matrixWorld;V=B.matrixRotationWorld;Y=B.materials;ea=B.overdraw;i=0;if(B instanceof THREE.Mesh){ia=B.geometry;Q=ia.vertices;na=ia.faces;ia=ia.faceVertexUvs;G=0;for(H=Q.length;G<H;G++){f=a();f.positionWorld.copy(Q[G].position);X.multiplyVector3(f.positionWorld);
-f.positionScreen.copy(f.positionWorld);r.multiplyVector4(f.positionScreen);f.positionScreen.x/=f.positionScreen.w;f.positionScreen.y/=f.positionScreen.w;f.visible=f.positionScreen.z>P&&f.positionScreen.z<J}Q=0;for(G=na.length;Q<G;Q++){H=na[Q];if(H instanceof THREE.Face3){F=h[H.a];$=h[H.b];U=h[H.c];if(F.visible&&$.visible&&U.visible&&(B.doubleSided||B.flipSided!=(U.positionScreen.x-F.positionScreen.x)*($.positionScreen.y-F.positionScreen.y)-(U.positionScreen.y-F.positionScreen.y)*($.positionScreen.x-
-F.positionScreen.x)<0)){da=q[o]=q[o]||new THREE.RenderableFace3;o++;j=da;j.v1.copy(F);j.v2.copy($);j.v3.copy(U)}else continue}else if(H instanceof THREE.Face4){F=h[H.a];$=h[H.b];U=h[H.c];da=h[H.d];if(F.visible&&$.visible&&U.visible&&da.visible&&(B.doubleSided||B.flipSided!=((da.positionScreen.x-F.positionScreen.x)*($.positionScreen.y-F.positionScreen.y)-(da.positionScreen.y-F.positionScreen.y)*($.positionScreen.x-F.positionScreen.x)<0||($.positionScreen.x-U.positionScreen.x)*(da.positionScreen.y-
-U.positionScreen.y)-($.positionScreen.y-U.positionScreen.y)*(da.positionScreen.x-U.positionScreen.x)<0))){ja=p[n]=p[n]||new THREE.RenderableFace4;n++;j=ja;j.v1.copy(F);j.v2.copy($);j.v3.copy(U);j.v4.copy(da)}else continue}j.normalWorld.copy(H.normal);V.multiplyVector3(j.normalWorld);j.centroidWorld.copy(H.centroid);X.multiplyVector3(j.centroidWorld);j.centroidScreen.copy(j.centroidWorld);r.multiplyVector3(j.centroidScreen);U=H.vertexNormals;F=0;for($=U.length;F<$;F++){da=j.vertexNormalsWorld[F];da.copy(U[F]);
-V.multiplyVector3(da)}F=0;for($=ia.length;F<$;F++)if(ja=ia[F][Q]){U=0;for(da=ja.length;U<da;U++)j.uvs[F][U]=ja[U]}j.meshMaterials=Y;j.faceMaterials=H.materials;j.overdraw=ea;j.z=j.centroidScreen.z;N.push(j)}}else if(B instanceof THREE.Line){ba.multiply(r,X);Q=B.geometry.vertices;F=a();F.positionScreen.copy(Q[0].position);ba.multiplyVector4(F.positionScreen);G=1;for(H=Q.length;G<H;G++){F=a();F.positionScreen.copy(Q[G].position);ba.multiplyVector4(F.positionScreen);$=h[i-2];E.copy(F.positionScreen);
-L.copy($.positionScreen);if(c(E,L)){E.multiplyScalar(1/E.w);L.multiplyScalar(1/L.w);X=D[w]=D[w]||new THREE.RenderableLine;w++;l=X;l.v1.positionScreen.copy(E);l.v2.positionScreen.copy(L);l.z=Math.max(E.z,L.z);l.materials=B.materials;N.push(l)}}}else if(B instanceof THREE.Particle){I.set(B.matrixWorld.n14,B.matrixWorld.n24,B.matrixWorld.n34,1);r.multiplyVector4(I);I.z/=I.w;if(I.z>0&&I.z<1){X=T[W]=T[W]||new THREE.RenderableParticle;W++;z=X;z.x=I.x/I.w;z.y=I.y/I.w;z.z=I.z;z.rotation=B.rotation.z;z.scale.x=
-B.scale.x*Math.abs(z.x-(I.x+C.projectionMatrix.n11)/(I.w+C.projectionMatrix.n14));z.scale.y=B.scale.y*Math.abs(z.y-(I.y+C.projectionMatrix.n22)/(I.w+C.projectionMatrix.n24));z.materials=B.materials;N.push(z)}}}}Z&&N.sort(b);return N}};
-THREE.CanvasRenderer=function(a){function b(R){if(z!=R)l.globalAlpha=z=R}function c(R){if(W!=R){switch(R){case THREE.NormalBlending:l.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:l.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:l.globalCompositeOperation="darker"}W=R}}function d(R){if(T!=R.hex){T=R.hex;l.strokeStyle="#"+g(T.toString(16))}}function e(R){if(aa!=R.hex){aa=R.hex;l.fillStyle="#"+g(aa.toString(16))}}function g(R){for(;R.length<6;)R="0"+
-R;return R}var f=this,i=null,h=new THREE.Projector;a=a||{};var j=a.canvas!==undefined?a.canvas:document.createElement("canvas"),o,q,n,p,l=j.getContext("2d"),w=new THREE.Color(0),D=0,z=1,W=0,T=null,aa=null,I=null,r=null,ba=null,x,E,L,y,C=new THREE.RenderableVertex,Z=new THREE.RenderableVertex,N,P,J,A,G,H,Q,F,$,U,da,ha,B=new THREE.Color(0),X=new THREE.Color(0),V=new THREE.Color(0),Y=new THREE.Color(0),ea=new THREE.Color(0),ia,na,ja,la,Wa,Xa,Ya,Za,$a,ab,Da=new THREE.Rectangle,oa=new THREE.Rectangle,
-ga=new THREE.Rectangle,Ua=!1,ma=new THREE.Color,ka=new THREE.Color,Ma=new THREE.Color,Na=new THREE.Color,ca=new THREE.Vector3,Ha,Ia,Va,pa,Ja,Oa;a=16;Ha=document.createElement("canvas");Ha.width=Ha.height=2;Ia=Ha.getContext("2d");Ia.fillStyle="rgba(0,0,0,1)";Ia.fillRect(0,0,2,2);Va=Ia.getImageData(0,0,2,2);pa=Va.data;Ja=document.createElement("canvas");Ja.width=Ja.height=a;Oa=Ja.getContext("2d");Oa.translate(-a/2,-a/2);Oa.scale(a,a);a--;this.domElement=j;this.autoClear=!0;this.sortObjects=!0;this.sortElements=
-!0;this.data={vertices:0,faces:0};this.setSize=function(R,qa){o=R;q=qa;n=o/2;p=q/2;j.width=o;j.height=q;Da.set(-n,-p,n,p);z=1;W=0;ba=r=I=aa=T=null};this.setClearColor=function(R,qa){w=R;D=qa};this.setClearColorHex=function(R,qa){w.setHex(R);D=qa};this.clear=function(){l.setTransform(1,0,0,-1,n,p);if(!oa.isEmpty()){oa.inflate(1);oa.minSelf(Da);if(w.hex==0&&D==0)l.clearRect(oa.getX(),oa.getY(),oa.getWidth(),oa.getHeight());else{c(THREE.NormalBlending);b(1);l.fillStyle="rgba("+Math.floor(w.r*255)+","+
-Math.floor(w.g*255)+","+Math.floor(w.b*255)+","+D+")";l.fillRect(oa.getX(),oa.getY(),oa.getWidth(),oa.getHeight())}oa.empty()}};this.render=function(R,qa){function db(m){var v,t,s,K=m.lights;ka.setRGB(0,0,0);Ma.setRGB(0,0,0);Na.setRGB(0,0,0);m=0;for(v=K.length;m<v;m++){t=K[m];s=t.color;if(t instanceof THREE.AmbientLight){ka.r+=s.r;ka.g+=s.g;ka.b+=s.b}else if(t instanceof THREE.DirectionalLight){Ma.r+=s.r;Ma.g+=s.g;Ma.b+=s.b}else if(t instanceof THREE.PointLight){Na.r+=s.r;Na.g+=s.g;Na.b+=s.b}}}function ua(m,
-v,t,s){var K,M,u,k,S=m.lights;m=0;for(K=S.length;m<K;m++){M=S[m];u=M.color;if(M instanceof THREE.DirectionalLight){k=t.dot(M.position);if(!(k<=0)){k*=M.intensity;s.r+=u.r*k;s.g+=u.g*k;s.b+=u.b*k}}else if(M instanceof THREE.PointLight){k=t.dot(ca.sub(M.position,v).normalize());if(!(k<=0)){k*=M.distance==0?1:1-Math.min(v.distanceTo(M.position)/M.distance,1);if(k!=0){k*=M.intensity;s.r+=u.r*k;s.g+=u.g*k;s.b+=u.b*k}}}}}function eb(m,v,t){b(t.opacity);c(t.blending);var s,K,M,u,k,S;if(t instanceof THREE.ParticleBasicMaterial){if(t.map){u=
-t.map.image;k=u.width>>1;S=u.height>>1;t=v.scale.x*n;M=v.scale.y*p;s=t*k;K=M*S;ga.set(m.x-s,m.y-K,m.x+s,m.y+K);if(Da.instersects(ga)){l.save();l.translate(m.x,m.y);l.rotate(-v.rotation);l.scale(t,-M);l.translate(-k,-S);l.drawImage(u,0,0);l.restore()}}}else if(t instanceof THREE.ParticleCanvasMaterial){s=v.scale.x*n;K=v.scale.y*p;ga.set(m.x-s,m.y-K,m.x+s,m.y+K);if(Da.instersects(ga)){d(t.color);e(t.color);l.save();l.translate(m.x,m.y);l.rotate(-v.rotation);l.scale(s,K);t.program(l);l.restore()}}}function fb(m,
-v,t,s){b(s.opacity);c(s.blending);l.beginPath();l.moveTo(m.positionScreen.x,m.positionScreen.y);l.lineTo(v.positionScreen.x,v.positionScreen.y);l.closePath();if(s instanceof THREE.LineBasicMaterial){m=s.linewidth;if(I!=m)l.lineWidth=I=m;m=s.linecap;if(r!=m)l.lineCap=r=m;m=s.linejoin;if(ba!=m)l.lineJoin=ba=m;d(s.color);l.stroke();ga.inflate(s.linewidth*2)}}function Pa(m,v,t,s,K,M,u,k,S){f.data.vertices+=3;f.data.faces++;b(k.opacity);c(k.blending);N=m.positionScreen.x;P=m.positionScreen.y;J=v.positionScreen.x;
-A=v.positionScreen.y;G=t.positionScreen.x;H=t.positionScreen.y;Ka(N,P,J,A,G,H);if(k instanceof THREE.MeshBasicMaterial)if(k.map){if(k.map.mapping instanceof THREE.UVMapping){la=u.uvs[0];va(N,P,J,A,G,H,k.map.image,la[s].u,la[s].v,la[K].u,la[K].v,la[M].u,la[M].v)}}else if(k.envMap){if(k.envMap.mapping instanceof THREE.SphericalReflectionMapping){m=qa.matrixWorldInverse;ca.copy(u.vertexNormalsWorld[0]);Wa=(ca.x*m.n11+ca.y*m.n12+ca.z*m.n13)*0.5+0.5;Xa=-(ca.x*m.n21+ca.y*m.n22+ca.z*m.n23)*0.5+0.5;ca.copy(u.vertexNormalsWorld[1]);
-Ya=(ca.x*m.n11+ca.y*m.n12+ca.z*m.n13)*0.5+0.5;Za=-(ca.x*m.n21+ca.y*m.n22+ca.z*m.n23)*0.5+0.5;ca.copy(u.vertexNormalsWorld[2]);$a=(ca.x*m.n11+ca.y*m.n12+ca.z*m.n13)*0.5+0.5;ab=-(ca.x*m.n21+ca.y*m.n22+ca.z*m.n23)*0.5+0.5;va(N,P,J,A,G,H,k.envMap.image,Wa,Xa,Ya,Za,$a,ab)}}else k.wireframe?za(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Aa(k.color);else if(k instanceof THREE.MeshLambertMaterial){if(k.map&&!k.wireframe){if(k.map.mapping instanceof THREE.UVMapping){la=u.uvs[0];va(N,
-P,J,A,G,H,k.map.image,la[s].u,la[s].v,la[K].u,la[K].v,la[M].u,la[M].v)}c(THREE.SubtractiveBlending)}if(Ua)if(!k.wireframe&&k.shading==THREE.SmoothShading&&u.vertexNormalsWorld.length==3){X.r=V.r=Y.r=ka.r;X.g=V.g=Y.g=ka.g;X.b=V.b=Y.b=ka.b;ua(S,u.v1.positionWorld,u.vertexNormalsWorld[0],X);ua(S,u.v2.positionWorld,u.vertexNormalsWorld[1],V);ua(S,u.v3.positionWorld,u.vertexNormalsWorld[2],Y);ea.r=(V.r+Y.r)*0.5;ea.g=(V.g+Y.g)*0.5;ea.b=(V.b+Y.b)*0.5;ja=Qa(X,V,Y,ea);va(N,P,J,A,G,H,ja,0,0,1,0,0,1)}else{ma.r=
-ka.r;ma.g=ka.g;ma.b=ka.b;ua(S,u.centroidWorld,u.normalWorld,ma);B.r=Math.max(0,Math.min(k.color.r*ma.r,1));B.g=Math.max(0,Math.min(k.color.g*ma.g,1));B.b=Math.max(0,Math.min(k.color.b*ma.b,1));B.updateHex();k.wireframe?za(B,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Aa(B)}else k.wireframe?za(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Aa(k.color)}else if(k instanceof THREE.MeshDepthMaterial){ia=qa.near;na=qa.far;X.r=X.g=X.b=1-Ea(m.positionScreen.z,ia,na);
-V.r=V.g=V.b=1-Ea(v.positionScreen.z,ia,na);Y.r=Y.g=Y.b=1-Ea(t.positionScreen.z,ia,na);ea.r=(V.r+Y.r)*0.5;ea.g=(V.g+Y.g)*0.5;ea.b=(V.b+Y.b)*0.5;ja=Qa(X,V,Y,ea);va(N,P,J,A,G,H,ja,0,0,1,0,0,1)}else if(k instanceof THREE.MeshNormalMaterial){B.r=Fa(u.normalWorld.x);B.g=Fa(u.normalWorld.y);B.b=Fa(u.normalWorld.z);B.updateHex();k.wireframe?za(B,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Aa(B)}}function bb(m,v,t,s,K,M,u,k,S){f.data.vertices+=4;f.data.faces++;b(k.opacity);c(k.blending);if(k.map||
-k.envMap){Pa(m,v,s,0,1,3,u,k,S);Pa(K,t,M,1,2,3,u,k,S)}else{N=m.positionScreen.x;P=m.positionScreen.y;J=v.positionScreen.x;A=v.positionScreen.y;G=t.positionScreen.x;H=t.positionScreen.y;Q=s.positionScreen.x;F=s.positionScreen.y;$=K.positionScreen.x;U=K.positionScreen.y;da=M.positionScreen.x;ha=M.positionScreen.y;if(k instanceof THREE.MeshBasicMaterial){Ra(N,P,J,A,G,H,Q,F);k.wireframe?za(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Aa(k.color)}else if(k instanceof THREE.MeshLambertMaterial)if(Ua)if(!k.wireframe&&
-k.shading==THREE.SmoothShading&&u.vertexNormalsWorld.length==4){X.r=V.r=Y.r=ea.r=ka.r;X.g=V.g=Y.g=ea.g=ka.g;X.b=V.b=Y.b=ea.b=ka.b;ua(S,u.v1.positionWorld,u.vertexNormalsWorld[0],X);ua(S,u.v2.positionWorld,u.vertexNormalsWorld[1],V);ua(S,u.v4.positionWorld,u.vertexNormalsWorld[3],Y);ua(S,u.v3.positionWorld,u.vertexNormalsWorld[2],ea);ja=Qa(X,V,Y,ea);Ka(N,P,J,A,Q,F);va(N,P,J,A,Q,F,ja,0,0,1,0,0,1);Ka($,U,G,H,da,ha);va($,U,G,H,da,ha,ja,1,0,1,1,0,1)}else{ma.r=ka.r;ma.g=ka.g;ma.b=ka.b;ua(S,u.centroidWorld,
-u.normalWorld,ma);B.r=Math.max(0,Math.min(k.color.r*ma.r,1));B.g=Math.max(0,Math.min(k.color.g*ma.g,1));B.b=Math.max(0,Math.min(k.color.b*ma.b,1));B.updateHex();Ra(N,P,J,A,G,H,Q,F);k.wireframe?za(B,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Aa(B)}else{Ra(N,P,J,A,G,H,Q,F);k.wireframe?za(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Aa(k.color)}else if(k instanceof THREE.MeshNormalMaterial){B.r=Fa(u.normalWorld.x);B.g=Fa(u.normalWorld.y);B.b=Fa(u.normalWorld.z);
-B.updateHex();Ra(N,P,J,A,G,H,Q,F);k.wireframe?za(B,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Aa(B)}else if(k instanceof THREE.MeshDepthMaterial){ia=qa.near;na=qa.far;X.r=X.g=X.b=1-Ea(m.positionScreen.z,ia,na);V.r=V.g=V.b=1-Ea(v.positionScreen.z,ia,na);Y.r=Y.g=Y.b=1-Ea(s.positionScreen.z,ia,na);ea.r=ea.g=ea.b=1-Ea(t.positionScreen.z,ia,na);ja=Qa(X,V,Y,ea);Ka(N,P,J,A,Q,F);va(N,P,J,A,Q,F,ja,0,0,1,0,0,1);Ka($,U,G,H,da,ha);va($,U,G,H,da,ha,ja,1,0,1,1,0,1)}}}function Ka(m,v,t,s,K,M){l.beginPath();
-l.moveTo(m,v);l.lineTo(t,s);l.lineTo(K,M);l.lineTo(m,v);l.closePath()}function Ra(m,v,t,s,K,M,u,k){l.beginPath();l.moveTo(m,v);l.lineTo(t,s);l.lineTo(K,M);l.lineTo(u,k);l.lineTo(m,v);l.closePath()}function za(m,v,t,s){if(I!=v)l.lineWidth=I=v;if(r!=t)l.lineCap=r=t;if(ba!=s)l.lineJoin=ba=s;d(m);l.stroke();ga.inflate(v*2)}function Aa(m){e(m);l.fill()}function va(m,v,t,s,K,M,u,k,S,wa,ra,xa,La){var ta,ya;ta=u.width-1;ya=u.height-1;k*=ta;S*=ya;wa*=ta;ra*=ya;xa*=ta;La*=ya;t-=m;s-=v;K-=m;M-=v;wa-=k;ra-=S;
-xa-=k;La-=S;ta=wa*La-xa*ra;if(ta!=0){ya=1/ta;ta=(La*t-ra*K)*ya;ra=(La*s-ra*M)*ya;t=(wa*K-xa*t)*ya;s=(wa*M-xa*s)*ya;m=m-ta*k-t*S;v=v-ra*k-s*S;l.save();l.transform(ta,ra,t,s,m,v);l.clip();l.drawImage(u,0,0);l.restore()}}function Qa(m,v,t,s){var K=~~(m.r*255),M=~~(m.g*255);m=~~(m.b*255);var u=~~(v.r*255),k=~~(v.g*255);v=~~(v.b*255);var S=~~(t.r*255),wa=~~(t.g*255);t=~~(t.b*255);var ra=~~(s.r*255),xa=~~(s.g*255);s=~~(s.b*255);pa[0]=K<0?0:K>255?255:K;pa[1]=M<0?0:M>255?255:M;pa[2]=m<0?0:m>255?255:m;pa[4]=
-u<0?0:u>255?255:u;pa[5]=k<0?0:k>255?255:k;pa[6]=v<0?0:v>255?255:v;pa[8]=S<0?0:S>255?255:S;pa[9]=wa<0?0:wa>255?255:wa;pa[10]=t<0?0:t>255?255:t;pa[12]=ra<0?0:ra>255?255:ra;pa[13]=xa<0?0:xa>255?255:xa;pa[14]=s<0?0:s>255?255:s;Ia.putImageData(Va,0,0);Oa.drawImage(Ha,0,0);return Ja}function Ea(m,v,t){m=(m-v)/(t-v);return m*m*(3-2*m)}function Fa(m){m=(m+1)*0.5;return m<0?0:m>1?1:m}function Ba(m,v){var t=v.x-m.x,s=v.y-m.y,K=1/Math.sqrt(t*t+s*s);t*=K;s*=K;v.x+=t;v.y+=s;m.x-=t;m.y-=s}var Sa,cb,O,sa,Ca,Ga,
-Ta,fa;this.autoClear?this.clear():l.setTransform(1,0,0,-1,n,p);f.data.vertices=0;f.data.faces=0;i=h.projectScene(R,qa,this.sortElements);(Ua=R.lights.length>0)&&db(R);Sa=0;for(cb=i.length;Sa<cb;Sa++){O=i[Sa];ga.empty();if(O instanceof THREE.RenderableParticle){x=O;x.x*=n;x.y*=p;sa=0;for(Ca=O.materials.length;sa<Ca;){fa=O.materials[sa++];fa.opacity!=0&&eb(x,O,fa,R)}}else if(O instanceof THREE.RenderableLine){x=O.v1;E=O.v2;x.positionScreen.x*=n;x.positionScreen.y*=p;E.positionScreen.x*=n;E.positionScreen.y*=
-p;ga.addPoint(x.positionScreen.x,x.positionScreen.y);ga.addPoint(E.positionScreen.x,E.positionScreen.y);if(Da.instersects(ga)){sa=0;for(Ca=O.materials.length;sa<Ca;){fa=O.materials[sa++];fa.opacity!=0&&fb(x,E,O,fa,R)}}}else if(O instanceof THREE.RenderableFace3){x=O.v1;E=O.v2;L=O.v3;x.positionScreen.x*=n;x.positionScreen.y*=p;E.positionScreen.x*=n;E.positionScreen.y*=p;L.positionScreen.x*=n;L.positionScreen.y*=p;if(O.overdraw){Ba(x.positionScreen,E.positionScreen);Ba(E.positionScreen,L.positionScreen);
-Ba(L.positionScreen,x.positionScreen)}ga.add3Points(x.positionScreen.x,x.positionScreen.y,E.positionScreen.x,E.positionScreen.y,L.positionScreen.x,L.positionScreen.y);if(Da.instersects(ga)){sa=0;for(Ca=O.meshMaterials.length;sa<Ca;){fa=O.meshMaterials[sa++];if(fa instanceof THREE.MeshFaceMaterial){Ga=0;for(Ta=O.faceMaterials.length;Ga<Ta;)(fa=O.faceMaterials[Ga++])&&fa.opacity!=0&&Pa(x,E,L,0,1,2,O,fa,R)}else fa.opacity!=0&&Pa(x,E,L,0,1,2,O,fa,R)}}}else if(O instanceof THREE.RenderableFace4){x=O.v1;
-E=O.v2;L=O.v3;y=O.v4;x.positionScreen.x*=n;x.positionScreen.y*=p;E.positionScreen.x*=n;E.positionScreen.y*=p;L.positionScreen.x*=n;L.positionScreen.y*=p;y.positionScreen.x*=n;y.positionScreen.y*=p;C.positionScreen.copy(E.positionScreen);Z.positionScreen.copy(y.positionScreen);if(O.overdraw){Ba(x.positionScreen,E.positionScreen);Ba(E.positionScreen,y.positionScreen);Ba(y.positionScreen,x.positionScreen);Ba(L.positionScreen,C.positionScreen);Ba(L.positionScreen,Z.positionScreen)}ga.addPoint(x.positionScreen.x,
-x.positionScreen.y);ga.addPoint(E.positionScreen.x,E.positionScreen.y);ga.addPoint(L.positionScreen.x,L.positionScreen.y);ga.addPoint(y.positionScreen.x,y.positionScreen.y);if(Da.instersects(ga)){sa=0;for(Ca=O.meshMaterials.length;sa<Ca;){fa=O.meshMaterials[sa++];if(fa instanceof THREE.MeshFaceMaterial){Ga=0;for(Ta=O.faceMaterials.length;Ga<Ta;)(fa=O.faceMaterials[Ga++])&&fa.opacity!=0&&bb(x,E,L,y,C,Z,O,fa,R)}else fa.opacity!=0&&bb(x,E,L,y,C,Z,O,fa,R)}}}oa.addRectangle(ga)}l.setTransform(1,0,0,1,
-0,0)}};
-THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(a,b,c){c&&a.update(undefined,!1,b);c=a.sounds;var d,e=c.length;for(d=0;d<e;d++){a=c[d];this.soundPosition.set(a.matrixWorld.n14,a.matrixWorld.n24,a.matrixWorld.n34);this.soundPosition.subSelf(b.position);if(a.isPlaying&&a.isLoaded){a.isAddedToDOM||a.addToDOM(this.domElement);a.calculateVolumeAndPan(this.soundPosition)}}}};
+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,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,j=[],i,o,m=[],k,n=[],l,q,x=[],t,H,L=[],y=new THREE.Vector4,C=new THREE.Vector4,
+p=new THREE.Matrix4,N=new THREE.Matrix4,r=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],v=new THREE.Vector4,z=new THREE.Vector4;this.projectVector=function(a,b){p.multiply(b.projectionMatrix,b.matrixWorldInverse);p.multiplyVector3(a);return a};this.unprojectVector=function(a,b){p.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));p.multiplyVector3(a);return a};this.projectObjects=function(a,c,f){var c=[],h,l,j;e=0;l=
+a.objects;a=0;for(h=l.length;a<h;a++){j=l[a];var i;if(!(i=!j.visible))if(i=j instanceof THREE.Mesh){a:{i=void 0;for(var k=j.matrixWorld,n=-j.geometry.boundingSphere.radius*Math.max(j.scale.x,Math.max(j.scale.y,j.scale.z)),m=0;m<6;m++)if(i=r[m].x*k.n14+r[m].y*k.n24+r[m].z*k.n34+r[m].w,i<=n){i=!1;break a}i=!0}i=!i}if(!i)i=g[e]=g[e]||new THREE.RenderableObject,e++,d=i,y.copy(j.position),p.multiplyVector3(y),d.object=j,d.z=y.z,c.push(d)}f&&c.sort(b);return c};this.projectScene=function(d,e,g){var J=[],
+P=e.near,S=e.far,M,E,A,O,w,K,I,T,y,s,F,D,G,U,X,da,Y;H=q=k=o=0;e.matrixAutoUpdate&&e.update(void 0,!0);d.update(void 0,!1,e);p.multiply(e.projectionMatrix,e.matrixWorldInverse);r[0].set(p.n41-p.n11,p.n42-p.n12,p.n43-p.n13,p.n44-p.n14);r[1].set(p.n41+p.n11,p.n42+p.n12,p.n43+p.n13,p.n44+p.n14);r[2].set(p.n41+p.n21,p.n42+p.n22,p.n43+p.n23,p.n44+p.n24);r[3].set(p.n41-p.n21,p.n42-p.n22,p.n43-p.n23,p.n44-p.n24);r[4].set(p.n41-p.n31,p.n42-p.n32,p.n43-p.n33,p.n44-p.n34);r[5].set(p.n41+p.n31,p.n42+p.n32,p.n43+
+p.n33,p.n44+p.n34);for(M=0;M<6;M++)y=r[M],y.divideScalar(Math.sqrt(y.x*y.x+y.y*y.y+y.z*y.z));y=this.projectObjects(d,e,!0);d=0;for(M=y.length;d<M;d++)if(s=y[d].object,s.visible)if(F=s.matrixWorld,D=s.matrixRotationWorld,G=s.materials,U=s.overdraw,h=0,s instanceof THREE.Mesh){X=s.geometry;O=X.vertices;da=X.faces;X=X.faceVertexUvs;E=0;for(A=O.length;E<A;E++)f=a(),f.positionWorld.copy(O[E].position),F.multiplyVector3(f.positionWorld),f.positionScreen.copy(f.positionWorld),p.multiplyVector4(f.positionScreen),
+f.positionScreen.x/=f.positionScreen.w,f.positionScreen.y/=f.positionScreen.w,f.visible=f.positionScreen.z>P&&f.positionScreen.z<S;O=0;for(E=da.length;O<E;O++){A=da[O];if(A instanceof THREE.Face3)if(w=j[A.a],K=j[A.b],I=j[A.c],w.visible&&K.visible&&I.visible&&(s.doubleSided||s.flipSided!=(I.positionScreen.x-w.positionScreen.x)*(K.positionScreen.y-w.positionScreen.y)-(I.positionScreen.y-w.positionScreen.y)*(K.positionScreen.x-w.positionScreen.x)<0))T=m[o]=m[o]||new THREE.RenderableFace3,o++,i=T,i.v1.copy(w),
+i.v2.copy(K),i.v3.copy(I);else continue;else if(A instanceof THREE.Face4)if(w=j[A.a],K=j[A.b],I=j[A.c],T=j[A.d],w.visible&&K.visible&&I.visible&&T.visible&&(s.doubleSided||s.flipSided!=((T.positionScreen.x-w.positionScreen.x)*(K.positionScreen.y-w.positionScreen.y)-(T.positionScreen.y-w.positionScreen.y)*(K.positionScreen.x-w.positionScreen.x)<0||(K.positionScreen.x-I.positionScreen.x)*(T.positionScreen.y-I.positionScreen.y)-(K.positionScreen.y-I.positionScreen.y)*(T.positionScreen.x-I.positionScreen.x)<
+0)))Y=n[k]=n[k]||new THREE.RenderableFace4,k++,i=Y,i.v1.copy(w),i.v2.copy(K),i.v3.copy(I),i.v4.copy(T);else continue;i.normalWorld.copy(A.normal);D.multiplyVector3(i.normalWorld);i.centroidWorld.copy(A.centroid);F.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);p.multiplyVector3(i.centroidScreen);I=A.vertexNormals;w=0;for(K=I.length;w<K;w++)T=i.vertexNormalsWorld[w],T.copy(I[w]),D.multiplyVector3(T);w=0;for(K=X.length;w<K;w++)if(Y=X[w][O]){I=0;for(T=Y.length;I<T;I++)i.uvs[w][I]=
+Y[I]}i.meshMaterials=G;i.faceMaterials=A.materials;i.overdraw=U;i.z=i.centroidScreen.z;J.push(i)}}else if(s instanceof THREE.Line){N.multiply(p,F);O=s.geometry.vertices;w=a();w.positionScreen.copy(O[0].position);N.multiplyVector4(w.positionScreen);E=1;for(A=O.length;E<A;E++)if(w=a(),w.positionScreen.copy(O[E].position),N.multiplyVector4(w.positionScreen),K=j[h-2],v.copy(w.positionScreen),z.copy(K.positionScreen),c(v,z))v.multiplyScalar(1/v.w),z.multiplyScalar(1/z.w),F=x[q]=x[q]||new THREE.RenderableLine,
+q++,l=F,l.v1.positionScreen.copy(v),l.v2.positionScreen.copy(z),l.z=Math.max(v.z,z.z),l.materials=s.materials,J.push(l)}else if(s instanceof THREE.Particle&&(C.set(s.matrixWorld.n14,s.matrixWorld.n24,s.matrixWorld.n34,1),p.multiplyVector4(C),C.z/=C.w,C.z>0&&C.z<1))F=L[H]=L[H]||new THREE.RenderableParticle,H++,t=F,t.x=C.x/C.w,t.y=C.y/C.w,t.z=C.z,t.rotation=s.rotation.z,t.scale.x=s.scale.x*Math.abs(t.x-(C.x+e.projectionMatrix.n11)/(C.w+e.projectionMatrix.n14)),t.scale.y=s.scale.y*Math.abs(t.y-(C.y+
+e.projectionMatrix.n22)/(C.w+e.projectionMatrix.n24)),t.materials=s.materials,J.push(t);g&&J.sort(b);return J}};
+THREE.CanvasRenderer=function(a){function b(a){if(t!=a)l.globalAlpha=t=a}function c(a){if(H!=a){switch(a){case THREE.NormalBlending:l.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:l.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:l.globalCompositeOperation="darker"}H=a}}function d(a){if(L!=a.hex)L=a.hex,l.strokeStyle="#"+g(L.toString(16))}function e(a){if(y!=a.hex)y=a.hex,l.fillStyle="#"+g(y.toString(16))}function g(a){for(;a.length<6;)a="0"+a;return a}
+var f=this,h=null,j=new THREE.Projector,a=a||{},i=a.canvas!==void 0?a.canvas:document.createElement("canvas"),o,m,k,n,l=i.getContext("2d"),q=new THREE.Color(0),x=0,t=1,H=0,L=null,y=null,C=null,p=null,N=null,r,v,z,R,aa=new THREE.RenderableVertex,$=new THREE.RenderableVertex,J,P,S,M,E,A,O,w,K,I,T,pa,s=new THREE.Color(0),F=new THREE.Color(0),D=new THREE.Color(0),G=new THREE.Color(0),U=new THREE.Color(0),X,da,Y,ba,Ba,Ca,Da,Ea,Fa,Ga,la=new THREE.Rectangle,ea=new THREE.Rectangle,W=new THREE.Rectangle,za=
+!1,ca=new THREE.Color,Z=new THREE.Color,ta=new THREE.Color,ua=new THREE.Color,Q=new THREE.Vector3,qa,ra,Aa,fa,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);Aa=ra.getImageData(0,0,2,2);fa=Aa.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=i;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,
+faces:0};this.setSize=function(a,b){o=a;m=b;k=o/2;n=m/2;i.width=o;i.height=m;la.set(-k,-n,k,n);t=1;H=0;N=p=C=y=L=null};this.setClearColor=function(a,b){q=a;x=b};this.setClearColorHex=function(a,b){q.setHex(a);x=b};this.clear=function(){l.setTransform(1,0,0,-1,k,n);if(!ea.isEmpty())ea.inflate(1),ea.minSelf(la),q.hex==0&&x==0?l.clearRect(ea.getX(),ea.getY(),ea.getWidth(),ea.getHeight()):(c(THREE.NormalBlending),b(1),l.fillStyle="rgba("+Math.floor(q.r*255)+","+Math.floor(q.g*255)+","+Math.floor(q.b*
+255)+","+x+")",l.fillRect(ea.getX(),ea.getY(),ea.getWidth(),ea.getHeight())),ea.empty()};this.render=function(a,g){function i(a){var b,c,d,e=a.lights;Z.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?(Z.r+=d.r,Z.g+=d.g,Z.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 m(a,b,c,d){var e,f,g,h,l=a.lights,a=0;for(e=l.length;a<e;a++)f=
+l[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(Q.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 o(a,f,g){b(g.opacity);c(g.blending);var h,i,j,m,u,p;if(g instanceof THREE.ParticleBasicMaterial){if(g.map)m=g.map.image,u=m.width>>1,p=m.height>>1,g=f.scale.x*
+k,j=f.scale.y*n,h=g*u,i=j*p,W.set(a.x-h,a.y-i,a.x+h,a.y+i),la.instersects(W)&&(l.save(),l.translate(a.x,a.y),l.rotate(-f.rotation),l.scale(g,-j),l.translate(-u,-p),l.drawImage(m,0,0),l.restore())}else g instanceof THREE.ParticleCanvasMaterial&&(h=f.scale.x*k,i=f.scale.y*n,W.set(a.x-h,a.y-i,a.x+h,a.y+i),la.instersects(W)&&(d(g.color),e(g.color),l.save(),l.translate(a.x,a.y),l.rotate(-f.rotation),l.scale(h,i),g.program(l),l.restore()))}function q(a,e,f,g){b(g.opacity);c(g.blending);l.beginPath();l.moveTo(a.positionScreen.x,
+a.positionScreen.y);l.lineTo(e.positionScreen.x,e.positionScreen.y);l.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(C!=a)l.lineWidth=C=a;a=g.linecap;if(p!=a)l.lineCap=p=a;a=g.linejoin;if(N!=a)l.lineJoin=N=a;d(g.color);l.stroke();W.inflate(g.linewidth*2)}}function t(a,d,e,h,l,i,j,u,k){f.data.vertices+=3;f.data.faces++;b(u.opacity);c(u.blending);J=a.positionScreen.x;P=a.positionScreen.y;S=d.positionScreen.x;M=d.positionScreen.y;E=e.positionScreen.x;A=e.positionScreen.y;y(J,P,
+S,M,E,A);if(u instanceof THREE.MeshBasicMaterial)if(u.map)u.map.mapping instanceof THREE.UVMapping&&(ba=j.uvs[0],ha(J,P,S,M,E,A,u.map.image,ba[h].u,ba[h].v,ba[l].u,ba[l].v,ba[i].u,ba[i].v));else if(u.envMap){if(u.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=g.matrixWorldInverse,Q.copy(j.vertexNormalsWorld[0]),Ba=(Q.x*a.n11+Q.y*a.n12+Q.z*a.n13)*0.5+0.5,Ca=-(Q.x*a.n21+Q.y*a.n22+Q.z*a.n23)*0.5+0.5,Q.copy(j.vertexNormalsWorld[1]),Da=(Q.x*a.n11+Q.y*a.n12+Q.z*a.n13)*0.5+0.5,Ea=-(Q.x*a.n21+
+Q.y*a.n22+Q.z*a.n23)*0.5+0.5,Q.copy(j.vertexNormalsWorld[2]),Fa=(Q.x*a.n11+Q.y*a.n12+Q.z*a.n13)*0.5+0.5,Ga=-(Q.x*a.n21+Q.y*a.n22+Q.z*a.n23)*0.5+0.5,ha(J,P,S,M,E,A,u.envMap.image,Ba,Ca,Da,Ea,Fa,Ga)}else u.wireframe?H(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):ia(u.color);else if(u instanceof THREE.MeshLambertMaterial)u.map&&!u.wireframe&&(u.map.mapping instanceof THREE.UVMapping&&(ba=j.uvs[0],ha(J,P,S,M,E,A,u.map.image,ba[h].u,ba[h].v,ba[l].u,ba[l].v,ba[i].u,ba[i].v)),c(THREE.SubtractiveBlending)),
+za?!u.wireframe&&u.shading==THREE.SmoothShading&&j.vertexNormalsWorld.length==3?(F.r=D.r=G.r=Z.r,F.g=D.g=G.g=Z.g,F.b=D.b=G.b=Z.b,m(k,j.v1.positionWorld,j.vertexNormalsWorld[0],F),m(k,j.v2.positionWorld,j.vertexNormalsWorld[1],D),m(k,j.v3.positionWorld,j.vertexNormalsWorld[2],G),U.r=(D.r+G.r)*0.5,U.g=(D.g+G.g)*0.5,U.b=(D.b+G.b)*0.5,Y=wa(F,D,G,U),ha(J,P,S,M,E,A,Y,0,0,1,0,0,1)):(ca.r=Z.r,ca.g=Z.g,ca.b=Z.b,m(k,j.centroidWorld,j.normalWorld,ca),s.r=Math.max(0,Math.min(u.color.r*ca.r,1)),s.g=Math.max(0,
+Math.min(u.color.g*ca.g,1)),s.b=Math.max(0,Math.min(u.color.b*ca.b,1)),s.updateHex(),u.wireframe?H(s,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):ia(s)):u.wireframe?H(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):ia(u.color);else if(u instanceof THREE.MeshDepthMaterial)X=g.near,da=g.far,F.r=F.g=F.b=1-ma(a.positionScreen.z,X,da),D.r=D.g=D.b=1-ma(d.positionScreen.z,X,da),G.r=G.g=G.b=1-ma(e.positionScreen.z,X,da),U.r=(D.r+G.r)*0.5,U.g=(D.g+G.g)*0.5,U.b=(D.b+G.b)*
+0.5,Y=wa(F,D,G,U),ha(J,P,S,M,E,A,Y,0,0,1,0,0,1);else if(u instanceof THREE.MeshNormalMaterial)s.r=na(j.normalWorld.x),s.g=na(j.normalWorld.y),s.b=na(j.normalWorld.z),s.updateHex(),u.wireframe?H(s,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):ia(s)}function x(a,d,e,h,j,l,i,k,n){f.data.vertices+=4;f.data.faces++;b(k.opacity);c(k.blending);if(k.map||k.envMap)t(a,d,h,0,1,3,i,k,n),t(j,e,l,1,2,3,i,k,n);else if(J=a.positionScreen.x,P=a.positionScreen.y,S=d.positionScreen.x,M=d.positionScreen.y,
+E=e.positionScreen.x,A=e.positionScreen.y,O=h.positionScreen.x,w=h.positionScreen.y,K=j.positionScreen.x,I=j.positionScreen.y,T=l.positionScreen.x,pa=l.positionScreen.y,k instanceof THREE.MeshBasicMaterial)L(J,P,S,M,E,A,O,w),k.wireframe?H(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ia(k.color);else if(k instanceof THREE.MeshLambertMaterial)za?!k.wireframe&&k.shading==THREE.SmoothShading&&i.vertexNormalsWorld.length==4?(F.r=D.r=G.r=U.r=Z.r,F.g=D.g=G.g=U.g=Z.g,F.b=D.b=G.b=U.b=
+Z.b,m(n,i.v1.positionWorld,i.vertexNormalsWorld[0],F),m(n,i.v2.positionWorld,i.vertexNormalsWorld[1],D),m(n,i.v4.positionWorld,i.vertexNormalsWorld[3],G),m(n,i.v3.positionWorld,i.vertexNormalsWorld[2],U),Y=wa(F,D,G,U),y(J,P,S,M,O,w),ha(J,P,S,M,O,w,Y,0,0,1,0,0,1),y(K,I,E,A,T,pa),ha(K,I,E,A,T,pa,Y,1,0,1,1,0,1)):(ca.r=Z.r,ca.g=Z.g,ca.b=Z.b,m(n,i.centroidWorld,i.normalWorld,ca),s.r=Math.max(0,Math.min(k.color.r*ca.r,1)),s.g=Math.max(0,Math.min(k.color.g*ca.g,1)),s.b=Math.max(0,Math.min(k.color.b*ca.b,
+1)),s.updateHex(),L(J,P,S,M,E,A,O,w),k.wireframe?H(s,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ia(s)):(L(J,P,S,M,E,A,O,w),k.wireframe?H(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ia(k.color));else if(k instanceof THREE.MeshNormalMaterial)s.r=na(i.normalWorld.x),s.g=na(i.normalWorld.y),s.b=na(i.normalWorld.z),s.updateHex(),L(J,P,S,M,E,A,O,w),k.wireframe?H(s,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):ia(s);else if(k instanceof THREE.MeshDepthMaterial)X=
+g.near,da=g.far,F.r=F.g=F.b=1-ma(a.positionScreen.z,X,da),D.r=D.g=D.b=1-ma(d.positionScreen.z,X,da),G.r=G.g=G.b=1-ma(h.positionScreen.z,X,da),U.r=U.g=U.b=1-ma(e.positionScreen.z,X,da),Y=wa(F,D,G,U),y(J,P,S,M,O,w),ha(J,P,S,M,O,w,Y,0,0,1,0,0,1),y(K,I,E,A,T,pa),ha(K,I,E,A,T,pa,Y,1,0,1,1,0,1)}function y(a,b,c,d,e,f){l.beginPath();l.moveTo(a,b);l.lineTo(c,d);l.lineTo(e,f);l.lineTo(a,b);l.closePath()}function L(a,b,c,d,e,f,g,h){l.beginPath();l.moveTo(a,b);l.lineTo(c,d);l.lineTo(e,f);l.lineTo(g,h);l.lineTo(a,
+b);l.closePath()}function H(a,b,c,e){if(C!=b)l.lineWidth=C=b;if(p!=c)l.lineCap=p=c;if(N!=e)l.lineJoin=N=e;d(a);l.stroke();W.inflate(b*2)}function ia(a){e(a);l.fill()}function ha(a,b,c,d,e,f,g,h,i,k,j,m,n){var o,p;o=g.width-1;p=g.height-1;h*=o;i*=p;k*=o;j*=p;m*=o;n*=p;c-=a;d-=b;e-=a;f-=b;k-=h;j-=i;m-=h;n-=i;o=k*n-m*j;o!=0&&(p=1/o,o=(n*c-j*e)*p,j=(n*d-j*f)*p,c=(k*e-m*c)*p,d=(k*f-m*d)*p,a=a-o*h-c*i,b=b-j*h-d*i,l.save(),l.transform(o,j,c,d,a,b),l.clip(),l.drawImage(g,0,0),l.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);fa[0]=e<0?0:e>255?255:e;fa[1]=f<0?0:f>255?255:f;fa[2]=a<0?0:a>255?255:a;fa[4]=g<0?0:g>255?255:g;fa[5]=h<0?0:h>255?255:h;fa[6]=b<0?0:b>255?255:b;fa[8]=i<0?0:i>255?255:i;fa[9]=j<0?0:j>255?255:j;fa[10]=c<0?0:c>255?255:c;fa[12]=k<0?0:k>255?255:k;fa[13]=l<0?0:l>255?255:l;fa[14]=d<0?0:d>255?255:d;ra.putImageData(Aa,0,0);va.drawImage(qa,
+0,0);return sa}function ma(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 ja(a,b){var c=b.x-a.x,d=b.y-a.y,e=1/Math.sqrt(c*c+d*d);c*=e;d*=e;b.x+=c;b.y+=d;a.x-=c;a.y-=d}var xa,Ha,B,ga,ka,oa,ya,V;this.autoClear?this.clear():l.setTransform(1,0,0,-1,k,n);f.data.vertices=0;f.data.faces=0;h=j.projectScene(a,g,this.sortElements);(za=a.lights.length>0)&&i(a);xa=0;for(Ha=h.length;xa<Ha;xa++){B=h[xa];W.empty();if(B instanceof THREE.RenderableParticle){r=B;r.x*=
+k;r.y*=n;ga=0;for(ka=B.materials.length;ga<ka;)V=B.materials[ga++],V.opacity!=0&&o(r,B,V,a)}else if(B instanceof THREE.RenderableLine){if(r=B.v1,v=B.v2,r.positionScreen.x*=k,r.positionScreen.y*=n,v.positionScreen.x*=k,v.positionScreen.y*=n,W.addPoint(r.positionScreen.x,r.positionScreen.y),W.addPoint(v.positionScreen.x,v.positionScreen.y),la.instersects(W)){ga=0;for(ka=B.materials.length;ga<ka;)V=B.materials[ga++],V.opacity!=0&&q(r,v,B,V,a)}}else if(B instanceof THREE.RenderableFace3){if(r=B.v1,v=
+B.v2,z=B.v3,r.positionScreen.x*=k,r.positionScreen.y*=n,v.positionScreen.x*=k,v.positionScreen.y*=n,z.positionScreen.x*=k,z.positionScreen.y*=n,B.overdraw&&(ja(r.positionScreen,v.positionScreen),ja(v.positionScreen,z.positionScreen),ja(z.positionScreen,r.positionScreen)),W.add3Points(r.positionScreen.x,r.positionScreen.y,v.positionScreen.x,v.positionScreen.y,z.positionScreen.x,z.positionScreen.y),la.instersects(W)){ga=0;for(ka=B.meshMaterials.length;ga<ka;)if(V=B.meshMaterials[ga++],V instanceof THREE.MeshFaceMaterial){oa=
+0;for(ya=B.faceMaterials.length;oa<ya;)(V=B.faceMaterials[oa++])&&V.opacity!=0&&t(r,v,z,0,1,2,B,V,a)}else V.opacity!=0&&t(r,v,z,0,1,2,B,V,a)}}else if(B instanceof THREE.RenderableFace4&&(r=B.v1,v=B.v2,z=B.v3,R=B.v4,r.positionScreen.x*=k,r.positionScreen.y*=n,v.positionScreen.x*=k,v.positionScreen.y*=n,z.positionScreen.x*=k,z.positionScreen.y*=n,R.positionScreen.x*=k,R.positionScreen.y*=n,aa.positionScreen.copy(v.positionScreen),$.positionScreen.copy(R.positionScreen),B.overdraw&&(ja(r.positionScreen,
+v.positionScreen),ja(v.positionScreen,R.positionScreen),ja(R.positionScreen,r.positionScreen),ja(z.positionScreen,aa.positionScreen),ja(z.positionScreen,$.positionScreen)),W.addPoint(r.positionScreen.x,r.positionScreen.y),W.addPoint(v.positionScreen.x,v.positionScreen.y),W.addPoint(z.positionScreen.x,z.positionScreen.y),W.addPoint(R.positionScreen.x,R.positionScreen.y),la.instersects(W))){ga=0;for(ka=B.meshMaterials.length;ga<ka;)if(V=B.meshMaterials[ga++],V instanceof THREE.MeshFaceMaterial){oa=
+0;for(ya=B.faceMaterials.length;oa<ya;)(V=B.faceMaterials[oa++])&&V.opacity!=0&&x(r,v,z,R,aa,$,B,V,a)}else V.opacity!=0&&x(r,v,z,R,aa,$,B,V,a)}ea.addRectangle(W)}l.setTransform(1,0,0,1,0,0)}};
+THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(a,b,c){c&&a.update(void 0,!1,b);var c=a.sounds,d,e=c.length;for(d=0;d<e;d++)a=c[d],this.soundPosition.set(a.matrixWorld.n14,a.matrixWorld.n24,a.matrixWorld.n34),this.soundPosition.subSelf(b.position),a.isPlaying&&a.isLoaded&&(a.isAddedToDOM||a.addToDOM(this.domElement),a.calculateVolumeAndPan(this.soundPosition))}};
 THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
 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};

+ 62 - 63
build/custom/ThreeDOM.js

@@ -1,84 +1,83 @@
 // ThreeDOM.js r41/ROME - http://github.com/mrdoob/three.js
-var THREE=THREE||{};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}THREE.Color=function(a){this.setHex(a)};
-THREE.Color.prototype={copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex},setHex:function(a){this.hex=~~a&16777215;this.updateRGB()},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;this.updateHex()},setHSV:function(a,b,c){var d,e,h,f,j,g;if(c==0)d=e=h=0;else{f=Math.floor(a*6);j=a*6-f;a=c*(1-b);g=c*(1-b*j);b=c*(1-b*(1-j));switch(f){case 1:d=g;e=c;h=a;break;case 2:d=a;e=c;h=b;break;case 3:d=a;e=g;h=c;break;case 4:d=b;e=a;h=c;break;case 5:d=c;e=a;h=g;break;case 6:case 0:d=c;e=b;h=a}}this.setRGB(d,
-e,h)},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},clone:function(){return new THREE.Color(this.hex)}};THREE.Vector2=function(a,b){this.set(a||0,b||0)};
+var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(a){this.setHex(a)};
+THREE.Color.prototype={copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex},setHex:function(a){this.hex=~~a&16777215;this.updateRGB()},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;this.updateHex()},setHSV:function(a,b,c){var d,e,g,f,h,j;if(c==0)d=e=g=0;else switch(f=Math.floor(a*6),h=a*6-f,a=c*(1-b),j=c*(1-b*h),b=c*(1-b*(1-h)),f){case 1:d=j;e=c;g=a;break;case 2:d=a;e=c;g=b;break;case 3:d=a;e=j;g=c;break;case 4:d=b;e=a;g=c;break;case 5:d=c;e=a;g=j;break;case 6:case 0:d=c,e=b,g=a}this.setRGB(d,
+e,g)},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},clone:function(){return new THREE.Color(this.hex)}};THREE.Vector2=function(a,b){this.set(a||0,b||0)};
 THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.set(a.x,a.y);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a);return this},negate:function(){this.set(-this.x,-this.y);return this},unit:function(){this.multiplyScalar(1/
 this.length());return this},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)};
 THREE.Vector3.prototype={set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.set(a.x,a.y,a.z);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z);return this},addScalar:function(a){this.set(this.x+a,this.y+a,this.z+a);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z);return this},cross:function(a,
 b){this.set(a.y*b.z-a.z*b.y,a.z*b.x-a.x*b.z,a.x*b.y-a.y*b.x);return this},crossSelf:function(a){var b=this.x,c=this.y,d=this.z;this.set(c*a.z-d*a.y,d*a.x-b*a.z,b*a.y-c*a.x);return this},multiply:function(a,b){this.set(a.x*b.x,a.y*b.y,a.z*b.z);return this},multiplySelf:function(a){this.set(this.x*a.x,this.y*a.y,this.z*a.z);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a,this.z*a);return this},divideSelf:function(a){this.set(this.x/a.x,this.y/a.y,this.z/a.z);return this},divideScalar:function(a){this.set(this.x/
-a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a=
-this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);if(Math.abs(b)>1.0E-5){this.x=Math.atan2(-a.n23/b,a.n33/b);this.z=Math.atan2(-a.n12/b,a.n11/b)}else{this.x=0;this.z=Math.atan2(a.n21,a.n22)}},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<
-1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)};
+a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y,a=this.z-a.z;return b*b+c*c+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a=
+this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&
+Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)};
 THREE.Vector4.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z,a.w+b.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z,a.w-b.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x*
 a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,b){this.set(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)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
-THREE.Ray.prototype={intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d,e=[];b=0;for(c=a.length;b<c;b++){d=a[b];d instanceof THREE.Mesh&&(e=e.concat(this.intersectObject(d)))}e.sort(function(h,f){return h.distance-f.distance});return e},intersectObject:function(a){function b(t,r,C,G){G=G.clone().subSelf(r);C=C.clone().subSelf(r);var K=t.clone().subSelf(r);t=G.dot(G);r=G.dot(C);G=G.dot(K);var x=C.dot(C);C=C.dot(K);K=1/(t*x-r*r);x=(x*G-r*C)*K;
-t=(t*C-r*G)*K;return x>0&&t>0&&x+t<1}var c,d,e,h,f,j,g,i,l,k,m,n=a.geometry,p=n.vertices,q=[];c=0;for(d=n.faces.length;c<d;c++){e=n.faces[c];k=this.origin.clone();m=this.direction.clone();g=a.matrixWorld;h=g.multiplyVector3(p[e.a].position.clone());f=g.multiplyVector3(p[e.b].position.clone());j=g.multiplyVector3(p[e.c].position.clone());g=e instanceof THREE.Face4?g.multiplyVector3(p[e.d].position.clone()):null;i=a.matrixRotationWorld.multiplyVector3(e.normal.clone());l=m.dot(i);if(a.doubleSided||
-(a.flipSided?l>0:l<0)){i=i.dot((new THREE.Vector3).sub(h,k))/l;k=k.addSelf(m.multiplyScalar(i));if(e instanceof THREE.Face3){if(b(k,h,f,j)){e={distance:this.origin.distanceTo(k),point:k,face:e,object:a};q.push(e)}}else if(e instanceof THREE.Face4&&(b(k,h,f,g)||b(k,f,j,g))){e={distance:this.origin.distanceTo(k),point:k,face:e,object:a};q.push(e)}}}return q}};
-THREE.Rectangle=function(){function a(){h=d-b;f=e-c}var b,c,d,e,h,f,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};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(g,i,l,k){j=!1;b=g;c=i;d=l;e=k;a()};this.addPoint=function(g,i){if(j){j=!1;b=g;c=i;d=g;e=i}else{b=b<g?b:g;c=c<i?c:i;d=d>g?d:g;e=e>i?e:i}a()};
-this.add3Points=function(g,i,l,k,m,n){if(j){j=!1;b=g<l?g<m?g:m:l<m?l:m;c=i<k?i<n?i:n:k<n?k:n;d=g>l?g>m?g:m:l>m?l:m;e=i>k?i>n?i:n:k>n?k:n}else{b=g<l?g<m?g<b?g:b:m<b?m:b:l<m?l<b?l:b:m<b?m:b;c=i<k?i<n?i<c?i:c:n<c?n:c:k<n?k<c?k:c:n<c?n:c;d=g>l?g>m?g>d?g:d:m>d?m:d:l>m?l>d?l:d:m>d?m:d;e=i>k?i>n?i>e?i:e:n>e?n:e:k>n?k>e?k:e:n>e?n:e}a()};this.addRectangle=function(g){if(j){j=!1;b=g.getLeft();c=g.getTop();d=g.getRight();e=g.getBottom()}else{b=b<g.getLeft()?b:g.getLeft();c=c<g.getTop()?c:g.getTop();d=d>g.getRight()?
-d:g.getRight();e=e>g.getBottom()?e:g.getBottom()}a()};this.inflate=function(g){b-=g;c-=g;d+=g;e+=g;a()};this.minSelf=function(g){b=b>g.getLeft()?b:g.getLeft();c=c>g.getTop()?c:g.getTop();d=d<g.getRight()?d:g.getRight();e=e<g.getBottom()?e:g.getBottom();a()};this.instersects=function(g){return Math.min(d,g.getRight())-Math.max(b,g.getLeft())>=0&&Math.min(e,g.getBottom())-Math.max(c,g.getTop())>=0};this.empty=function(){j=!0;e=d=c=b=0;a()};this.isEmpty=function(){return j}};
-THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={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,h,f,j,g,i,l,k,m,n,p,q){this.set(a||1,b||0,c||0,d||0,e||0,h||1,f||0,j||0,g||0,i||0,l||1,k||0,m||0,n||0,p||0,q||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={set:function(a,b,c,d,e,h,f,j,g,i,l,k,m,n,p,q){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=h;this.n23=f;this.n24=j;this.n31=g;this.n32=i;this.n33=l;this.n34=k;this.n41=m;this.n42=n;this.n43=p;this.n44=q;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,h=THREE.Matrix4.__v3;h.sub(a,b).normalize();if(h.length()===0)h.z=1;d.cross(c,h).normalize();if(d.length()===0){h.x+=1.0E-4;d.cross(c,h).normalize()}e.cross(h,d).normalize();this.n11=d.x;this.n12=e.x;this.n13=h.x;this.n21=d.y;this.n22=e.y;this.n23=h.y;this.n31=d.z;this.n32=e.z;this.n33=h.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*
+THREE.Ray.prototype={intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d,e=[];b=0;for(c=a.length;b<c;b++)d=a[b],d instanceof THREE.Mesh&&(e=e.concat(this.intersectObject(d)));e.sort(function(a,b){return a.distance-b.distance});return e},intersectObject:function(a){function b(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}var c,d,e,g,f,h,j,i,l,k,m,n=a.geometry,p=n.vertices,q=[];c=0;for(d=n.faces.length;c<d;c++)if(e=n.faces[c],k=this.origin.clone(),m=this.direction.clone(),j=a.matrixWorld,g=j.multiplyVector3(p[e.a].position.clone()),f=j.multiplyVector3(p[e.b].position.clone()),h=j.multiplyVector3(p[e.c].position.clone()),j=e instanceof THREE.Face4?j.multiplyVector3(p[e.d].position.clone()):null,i=a.matrixRotationWorld.multiplyVector3(e.normal.clone()),l=m.dot(i),a.doubleSided||(a.flipSided?
+l>0:l<0))if(i=i.dot((new THREE.Vector3).sub(g,k))/l,k=k.addSelf(m.multiplyScalar(i)),e instanceof THREE.Face3)b(k,g,f,h)&&(e={distance:this.origin.distanceTo(k),point:k,face:e,object:a},q.push(e));else if(e instanceof THREE.Face4&&(b(k,g,f,j)||b(k,f,h,j)))e={distance:this.origin.distanceTo(k),point:k,face:e,object:a},q.push(e);return q}};
+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,l,k){h=!1;b=f;c=g;d=l;e=k;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,l,k,m,n){h?(h=!1,b=f<l?f<m?f:m:l<m?l:m,c=g<k?g<n?g:n:k<n?k:n,d=f>l?f>m?f:m:l>m?l:m,e=g>k?g>n?g:n:k>n?k:n):(b=f<l?f<m?f<b?f:b:m<b?m:b:l<m?l<b?l:b:m<b?m:b,c=g<k?g<n?g<c?g:c:n<c?n:c:k<n?k<c?k:c:n<c?n:c,d=f>l?f>m?f>d?f:d:m>d?m:d:l>m?l>d?l:d:m>d?m:d,e=g>k?g>n?g>e?g:e:n>e?n:e:k>n?k>e?k:e:n>e?n: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.instersects=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={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,j,i,l,k,m,n,p,q){this.set(a||1,b||0,c||0,d||0,e||0,g||1,f||0,h||0,j||0,i||0,l||1,k||0,m||0,n||0,p||0,q||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={set:function(a,b,c,d,e,g,f,h,j,i,l,k,m,n,p,q){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=j;this.n32=i;this.n33=l;this.n34=k;this.n41=m;this.n42=n;this.n43=p;this.n44=q;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;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,h=a.n14,f=a.n21,j=a.n22,g=a.n23,i=a.n24,l=a.n31,k=a.n32,m=a.n33,n=a.n34,p=a.n41,q=a.n42,t=a.n43,r=a.n44,C=b.n11,G=b.n12,K=b.n13,x=b.n14,o=b.n21,Q=b.n22,
-H=b.n23,N=b.n24,O=b.n31,u=b.n32,s=b.n33,I=b.n34;this.n11=c*C+d*o+e*O;this.n12=c*G+d*Q+e*u;this.n13=c*K+d*H+e*s;this.n14=c*x+d*N+e*I+h;this.n21=f*C+j*o+g*O;this.n22=f*G+j*Q+g*u;this.n23=f*K+j*H+g*s;this.n24=f*x+j*N+g*I+i;this.n31=l*C+k*o+m*O;this.n32=l*G+k*Q+m*u;this.n33=l*K+k*H+m*s;this.n34=l*x+k*N+m*I+n;this.n41=p*C+q*o+t*O;this.n42=p*G+q*Q+t*u;this.n43=p*K+q*H+t*s;this.n44=p*x+q*N+t*I+r;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]=
+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,j=a.n23,i=a.n24,l=a.n31,k=a.n32,m=a.n33,n=a.n34,p=a.n41,q=a.n42,t=a.n43,r=a.n44,H=b.n11,K=b.n12,A=b.n13,v=b.n14,o=b.n21,I=b.n22,
+z=b.n23,D=b.n24,E=b.n31,O=b.n32,P=b.n33,Q=b.n34;this.n11=c*H+d*o+e*E;this.n12=c*K+d*I+e*O;this.n13=c*A+d*z+e*P;this.n14=c*v+d*D+e*Q+g;this.n21=f*H+h*o+j*E;this.n22=f*K+h*I+j*O;this.n23=f*A+h*z+j*P;this.n24=f*v+h*D+j*Q+i;this.n31=l*H+k*o+m*E;this.n32=l*K+k*I+m*O;this.n33=l*A+k*z+m*P;this.n34=l*v+k*D+m*Q+n;this.n41=p*H+q*o+t*E;this.n42=p*K+q*I+t*O;this.n43=p*A+q*z+t*P;this.n44=p*v+q*D+t*Q+r;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,h=this.n22,f=this.n23,j=this.n24,g=this.n31,i=this.n32,l=this.n33,k=this.n34,m=this.n41,n=this.n42,p=this.n43,q=this.n44;return d*f*i*m-c*j*i*m-d*h*l*m+b*j*l*m+c*h*k*m-b*f*k*m-d*f*g*n+c*j*g*n+d*e*l*n-a*j*l*n-c*e*k*n+a*f*k*n+d*h*g*p-b*j*g*p-d*e*i*p+a*j*i*p+b*e*k*p-a*h*k*p-c*h*g*q+b*f*g*q+c*e*i*q-a*f*i*q-b*e*l*q+a*h*l*q},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.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,j=this.n31,i=this.n32,l=this.n33,k=this.n34,m=this.n41,n=this.n42,p=this.n43,q=this.n44;return d*f*i*m-c*h*i*m-d*g*l*m+b*h*l*m+c*g*k*m-b*f*k*m-d*f*j*n+c*h*j*n+d*e*l*n-a*h*l*n-c*e*k*n+a*f*k*n+d*g*j*p-b*h*j*p-d*e*i*p+a*h*i*p+b*e*k*p-a*g*k*p-c*g*j*q+b*f*j*q+c*e*i*q-a*f*i*q-b*e*l*q+a*g*l*q},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,h=a.x,f=a.y,j=a.z,g=e*h,i=e*f;this.set(g*
-h+c,g*f-d*j,g*j+d*f,0,g*f+d*j,i*f+c,i*j-d*h,0,g*j-d*f,i*j+d*h,e*j*j+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){var b=a.x,c=a.y,d=a.z;a=Math.cos(b);b=Math.sin(b);var e=Math.cos(c);c=Math.sin(c);var h=Math.cos(d);d=Math.sin(d);var f=a*c,j=b*c;this.n11=e*h;this.n12=-e*d;this.n13=c;this.n21=j*h+a*d;this.n22=-j*d+a*h;this.n23=-b*e;this.n31=-f*h+b*d;this.n32=f*d+b*h;this.n33=a*e;return this},
-setRotationFromQuaternion:function(a){var b=a.x,c=a.y,d=a.z,e=a.w,h=b+b,f=c+c,j=d+d;a=b*h;var g=b*f;b*=j;var i=c*f;c*=j;d*=j;h*=e;f*=e;e*=j;this.n11=1-(i+d);this.n12=g-e;this.n13=b+f;this.n21=g+e;this.n22=1-(a+d);this.n23=c-h;this.n31=b-f;this.n32=c+h;this.n33=1-(a+i);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},extractPosition:function(a){this.n14=
+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,j=e*g,i=e*f;this.set(j*
+g+c,j*f-d*h,j*h+d*f,0,j*f+d*h,i*f+c,i*h-d*g,0,j*h-d*f,i*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){var b=a.x,c=a.y,d=a.z,a=Math.cos(b),b=Math.sin(b),e=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),f=a*c,h=b*c;this.n11=e*g;this.n12=-e*d;this.n13=c;this.n21=h*g+a*d;this.n22=-h*d+a*g;this.n23=-b*e;this.n31=-f*g+b*d;this.n32=f*d+b*g;this.n33=a*e;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,j=b*f;b*=h;var i=c*f;c*=h;d*=h;g*=e;f*=e;e*=h;this.n11=1-(i+d);this.n12=j-e;this.n13=b+f;this.n21=j+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+i);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},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,h=a.n14,f=a.n21,j=a.n22,g=a.n23,i=a.n24,l=a.n31,k=a.n32,m=a.n33,n=a.n34,p=a.n41,q=a.n42,t=a.n43,r=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=g*n*q-i*m*q+i*k*t-j*n*t-g*k*r+j*m*r;b.n12=h*m*q-e*n*q-h*k*t+d*n*t+e*k*r-d*m*r;b.n13=e*i*q-h*g*q+h*j*t-d*i*t-e*j*r+d*g*r;b.n14=h*g*k-e*i*k-h*j*m+d*i*m+e*j*n-d*g*n;b.n21=i*m*p-g*n*p-i*l*t+f*n*t+g*l*r-f*m*r;b.n22=e*n*p-h*m*p+h*l*t-c*n*t-e*l*r+c*m*r;b.n23=h*g*p-e*i*p-h*f*t+c*i*t+e*f*r-c*g*r;
-b.n24=e*i*l-h*g*l+h*f*m-c*i*m-e*f*n+c*g*n;b.n31=j*n*p-i*k*p+i*l*q-f*n*q-j*l*r+f*k*r;b.n32=h*k*p-d*n*p-h*l*q+c*n*q+d*l*r-c*k*r;b.n33=e*i*p-h*j*p+h*f*q-c*i*q-d*f*r+c*j*r;b.n34=h*j*l-d*i*l-h*f*k+c*i*k+d*f*n-c*j*n;b.n41=g*k*p-j*m*p-g*l*q+f*m*q+j*l*t-f*k*t;b.n42=d*m*p-e*k*p+e*l*q-c*m*q-d*l*t+c*k*t;b.n43=e*j*p-d*g*p-e*f*q+c*g*q+d*f*t-c*j*t;b.n44=d*g*l-e*j*l+e*f*k-c*g*k-d*f*m+c*j*m;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,h=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,g=-a.n32*a.n11+a.n31*a.n12,i=a.n23*a.n12-a.n22*a.n13,l=-a.n23*a.n11+a.n21*a.n13,k=a.n22*a.n11-a.n21*a.n12;a=a.n11*d+a.n21*f+a.n31*i;if(a==0)throw"matrix not invertible";a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*h;c[3]=a*f;c[4]=a*j;c[5]=a*g;c[6]=a*i;c[7]=a*l;c[8]=a*k;return b};
-THREE.Matrix4.makeFrustum=function(a,b,c,d,e,h){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=-(h+e)/(h-e);f.n34=-2*h*e/(h-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,h){var f,j,g,i;f=new THREE.Matrix4;j=b-a;g=c-d;i=h-e;f.n11=2/j;f.n12=0;f.n13=0;f.n14=-((b+a)/j);f.n21=0;f.n22=2/g;f.n23=0;f.n24=-((c+d)/g);f.n31=0;f.n32=0;f.n33=-2/i;f.n34=-((h+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.Object3D=function(){this.parent=undefined;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.dynamic=!1;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=
-1;this.visible=!0;this._vector=new THREE.Vector3;this.name=""};
+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,j=a.n23,i=a.n24,l=a.n31,k=a.n32,m=a.n33,n=a.n34,p=a.n41,q=a.n42,t=a.n43,r=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=j*n*q-i*m*q+i*k*t-h*n*t-j*k*r+h*m*r;b.n12=g*m*q-e*n*q-g*k*t+d*n*t+e*k*r-d*m*r;b.n13=e*i*q-g*j*q+g*h*t-d*i*t-e*h*r+d*j*r;b.n14=g*j*k-e*i*k-g*h*m+d*i*m+e*h*n-d*j*n;b.n21=i*m*p-j*n*p-i*l*t+f*n*t+j*l*r-f*m*r;b.n22=e*n*p-g*m*p+g*l*t-c*n*t-e*l*r+c*m*r;b.n23=g*j*p-e*i*p-g*f*t+c*i*t+e*f*r-c*j*r;b.n24=
+e*i*l-g*j*l+g*f*m-c*i*m-e*f*n+c*j*n;b.n31=h*n*p-i*k*p+i*l*q-f*n*q-h*l*r+f*k*r;b.n32=g*k*p-d*n*p-g*l*q+c*n*q+d*l*r-c*k*r;b.n33=e*i*p-g*h*p+g*f*q-c*i*q-d*f*r+c*h*r;b.n34=g*h*l-d*i*l-g*f*k+c*i*k+d*f*n-c*h*n;b.n41=j*k*p-h*m*p-j*l*q+f*m*q+h*l*t-f*k*t;b.n42=d*m*p-e*k*p+e*l*q-c*m*q-d*l*t+c*k*t;b.n43=e*h*p-d*j*p-e*f*q+c*j*q+d*f*t-c*h*t;b.n44=d*j*l-e*h*l+e*f*k-c*j*k-d*f*m+c*h*m;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,j=-a.n32*a.n11+a.n31*a.n12,i=a.n23*a.n12-a.n22*a.n13,l=-a.n23*a.n11+a.n21*a.n13,k=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*i;if(a==0)throw"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*j;c[6]=a*i;c[7]=a*l;c[8]=a*k;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,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.Object3D=function(){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.scale=new THREE.Vector3(1,1,1);this.dynamic=!1;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._vector=new THREE.Vector3;this.name=""};
 THREE.Object3D.prototype={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)},addChild:function(a){if(this.children.indexOf(a)===
--1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==undefined;)b=b.parent;b!==undefined&&b instanceof THREE.Scene&&b.addChildRecurse(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=undefined;this.children.splice(b,1)}},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);if(e!==undefined)return e}}},updateMatrix:function(){this.matrix.setPosition(this.position);
-this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation);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}a=0;for(var d=this.children.length;a<d;a++)this.children[a].update(this.matrixWorld,b,c)}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==undefined?d:1)};
-THREE.Quaternion.prototype={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=0.5*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);var h=Math.cos(c);c=Math.sin(c);var f=a*b,j=d*e;this.w=f*h-j*c;this.x=f*c+j*h;this.y=d*b*h+a*e*c;this.z=a*e*h-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},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);if(a==0)this.w=this.z=this.y=this.x=0;else{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,h=a.x,f=a.y,j=a.z;a=a.w;this.x=b*a+e*h+c*j-d*f;this.y=c*a+e*f+d*h-b*j;this.z=d*a+e*j+b*f-c*h;this.w=e*a-b*h-c*f-d*j;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,h=this.x,f=this.y,j=this.z,g=this.w,i=g*c+f*e-j*d,l=
-g*d+j*c-h*e,k=g*e+h*d-f*c;c=-h*c-f*d-j*e;b.x=i*g+c*-h+l*-j-k*-f;b.y=l*g+c*-f+k*-h-i*-j;b.z=k*g+c*-j+i*-f-l*-h;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){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var h=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.001){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);return c}e=Math.sin((1-d)*h)/f;d=Math.sin(d*h)/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,h){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=h instanceof Array?h:[h];this.centroid=new THREE.Vector3};
-THREE.Face4=function(a,b,c,d,e,h,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=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};
+-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)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1)a.parent=void 0,this.children.splice(b,1)},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);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)}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==void 0?d:1)};
+THREE.Quaternion.prototype={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=0.5*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);this.x=a.x*d;this.y=a.y*
+d;this.z=a.z*d;this.w=Math.cos(c);return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
+multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,j=this.w,i=j*c+f*e-h*d,l=
+j*d+h*c-g*e,k=j*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=i*j+c*-g+l*-h-k*-f;b.y=l*j+c*-f+k*-g-i*-h;b.z=k*j+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.set(a||0,b||0)};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=d||2E3;this.target=e||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;
 THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
-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{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.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.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.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!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);if(!(a instanceof THREE.Bone))this.hasNoneBoneChildren=!0}};
-THREE.Sound=function(a,b,c,d){THREE.Object3D.call(this);this.isLoaded=!1;this.isAddedToDOM=!1;this.isPlaying=!1;this.duration=-1;this.radius=b!==undefined?Math.abs(b):100;this.volume=Math.min(1,Math.max(0,c!==undefined?c:1));this.domElement=document.createElement("audio");this.domElement.volume=0;this.domElement.pan=0;this.domElement.loop=d!==undefined?d:!0;this.sources=a instanceof Array?a:[a];var e;c=this.sources.length;for(a=0;a<c;a++){b=this.sources[a];b.toLowerCase();if(b.indexOf(".mp3")!==-1)e=
-"audio/mpeg";else if(b.indexOf(".ogg")!==-1)e="audio/ogg";else b.indexOf(".wav")!==-1&&(e="audio/wav");if(this.domElement.canPlayType(e)){e=document.createElement("source");e.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(e);this.domElement.addEventListener("canplay",this.onLoad,!0);this.domElement.load();break}}};THREE.Sound.prototype=new THREE.Object3D;THREE.Sound.prototype.constructor=THREE.Sound;THREE.Sound.prototype.supr=THREE.Object3D.prototype;
-THREE.Sound.prototype.onLoad=function(){var a=this.THREESound;if(!a.isLoaded){this.removeEventListener("canplay",this.onLoad,!0);a.isLoaded=!0;a.duration=this.duration;a.isPlaying&&a.play()}};THREE.Sound.prototype.addToDOM=function(a){this.isAddedToDOM=!0;a.appendChild(this.domElement)};THREE.Sound.prototype.play=function(a){this.isPlaying=!0;if(this.isLoaded){this.domElement.play();if(a)this.domElement.currentTime=a%this.duration}};THREE.Sound.prototype.pause=function(){this.isPlaying=!1;this.domElement.pause()};
+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.Sound=function(a,b,c,d){THREE.Object3D.call(this);this.isPlaying=this.isAddedToDOM=this.isLoaded=!1;this.duration=-1;this.radius=b!==void 0?Math.abs(b):100;this.volume=Math.min(1,Math.max(0,c!==void 0?c:1));this.domElement=document.createElement("audio");this.domElement.volume=0;this.domElement.pan=0;this.domElement.loop=d!==void 0?d:!0;this.sources=a instanceof Array?a:[a];for(var e,c=this.sources.length,a=0;a<c;a++)if(b=this.sources[a],b.toLowerCase(),b.indexOf(".mp3")!==-1?e="audio/mpeg":
+b.indexOf(".ogg")!==-1?e="audio/ogg":b.indexOf(".wav")!==-1&&(e="audio/wav"),this.domElement.canPlayType(e)){e=document.createElement("source");e.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(e);this.domElement.addEventListener("canplay",this.onLoad,!0);this.domElement.load();break}};THREE.Sound.prototype=new THREE.Object3D;THREE.Sound.prototype.constructor=THREE.Sound;THREE.Sound.prototype.supr=THREE.Object3D.prototype;
+THREE.Sound.prototype.onLoad=function(){var a=this.THREESound;if(!a.isLoaded)this.removeEventListener("canplay",this.onLoad,!0),a.isLoaded=!0,a.duration=this.duration,a.isPlaying&&a.play()};THREE.Sound.prototype.addToDOM=function(a){this.isAddedToDOM=!0;a.appendChild(this.domElement)};THREE.Sound.prototype.play=function(a){this.isPlaying=!0;if(this.isLoaded&&(this.domElement.play(),a))this.domElement.currentTime=a%this.duration};THREE.Sound.prototype.pause=function(){this.isPlaying=!1;this.domElement.pause()};
 THREE.Sound.prototype.stop=function(){this.isPlaying=!1;this.domElement.pause();this.domElement.currentTime=0};THREE.Sound.prototype.calculateVolumeAndPan=function(a){a=a.length();this.domElement.volume=a<=this.radius?this.volume*(1-a/this.radius):0};
-THREE.Sound.prototype.update=function(a,b,c){if(this.matrixAutoUpdate){this.matrix.setPosition(this.position);b=!0}if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;b=!0}var d=this.children.length;for(a=0;a<d;a++)this.children[a].update(this.matrixWorld,b,c)};
+THREE.Sound.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(this.matrix.setPosition(this.position),b=!0);if(b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;for(var d=this.children.length,a=0;a<d;a++)this.children[a].update(this.matrixWorld,b,c)};
 THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.collisions=this.fog=null;this.objects=[];this.lights=[];this.sounds=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};
-THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1){this.objects.push(a);this.__objectsAdded.push(a)}for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
-THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};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 if(a instanceof THREE.Sound){b=this.sounds.indexOf(a);b!==-1&&this.sounds.splice(b,1)}else if(!(a instanceof THREE.Camera)){b=this.objects.indexOf(a);if(b!==-1){this.objects.splice(b,1);this.__objectsRemoved.push(a)}}for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};
+THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1)this.objects.push(a),this.__objectsAdded.push(a);for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
+THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};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.Sound?(b=this.sounds.indexOf(a),b!==-1&&this.sounds.splice(b,1)):a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a)));for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};
 THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;
-THREE.Projector=function(){function a(){var u=g[j]=g[j]||new THREE.RenderableVertex;j++;return u}function b(u,s){return s.z-u.z}function c(u,s){var I=0,J=1,M=u.z+u.w,E=s.z+s.w,w=-u.z+u.w,z=-s.z+s.w;if(M>=0&&E>=0&&w>=0&&z>=0)return!0;else if(M<0&&E<0||w<0&&z<0)return!1;else{if(M<0)I=Math.max(I,M/(M-E));else E<0&&(J=Math.min(J,M/(M-E)));if(w<0)I=Math.max(I,w/(w-z));else z<0&&(J=Math.min(J,w/(w-z)));if(J<I)return!1;else{u.lerpSelf(s,I);s.lerpSelf(u,1-J);return!0}}}var d,e,h=[],f,j,g=[],i,l,k=[],m,n=
-[],p,q,t=[],r,C,G=[],K=new THREE.Vector4,x=new THREE.Vector4,o=new THREE.Matrix4,Q=new THREE.Matrix4,H=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],N=new THREE.Vector4,O=new THREE.Vector4;this.projectVector=function(u,s){o.multiply(s.projectionMatrix,s.matrixWorldInverse);o.multiplyVector3(u);return u};this.unprojectVector=function(u,s){o.multiply(s.matrixWorld,THREE.Matrix4.makeInvert(s.projectionMatrix));o.multiplyVector3(u);return u};
-this.projectObjects=function(u,s,I){s=[];var J,M,E;e=0;M=u.objects;u=0;for(J=M.length;u<J;u++){E=M[u];var w;if(!(w=!E.visible))if(w=E instanceof THREE.Mesh){a:{w=void 0;for(var z=E.matrixWorld,A=-E.geometry.boundingSphere.radius*Math.max(E.scale.x,Math.max(E.scale.y,E.scale.z)),D=0;D<6;D++){w=H[D].x*z.n14+H[D].y*z.n24+H[D].z*z.n34+H[D].w;if(w<=A){w=!1;break a}}w=!0}w=!w}if(!w){w=h[e]=h[e]||new THREE.RenderableObject;e++;d=w;K.copy(E.position);o.multiplyVector3(K);d.object=E;d.z=K.z;s.push(d)}}I&&
-s.sort(b);return s};this.projectScene=function(u,s,I){var J=[],M=s.near,E=s.far,w,z,A,D,v,F,B,L,P,y,R,U,W,X,S,V,T;C=q=m=l=0;s.matrixAutoUpdate&&s.update(undefined,!0);u.update(undefined,!1,s);o.multiply(s.projectionMatrix,s.matrixWorldInverse);H[0].set(o.n41-o.n11,o.n42-o.n12,o.n43-o.n13,o.n44-o.n14);H[1].set(o.n41+o.n11,o.n42+o.n12,o.n43+o.n13,o.n44+o.n14);H[2].set(o.n41+o.n21,o.n42+o.n22,o.n43+o.n23,o.n44+o.n24);H[3].set(o.n41-o.n21,o.n42-o.n22,o.n43-o.n23,o.n44-o.n24);H[4].set(o.n41-o.n31,o.n42-
-o.n32,o.n43-o.n33,o.n44-o.n34);H[5].set(o.n41+o.n31,o.n42+o.n32,o.n43+o.n33,o.n44+o.n34);for(w=0;w<6;w++){P=H[w];P.divideScalar(Math.sqrt(P.x*P.x+P.y*P.y+P.z*P.z))}P=this.projectObjects(u,s,!0);u=0;for(w=P.length;u<w;u++){y=P[u].object;if(y.visible){R=y.matrixWorld;U=y.matrixRotationWorld;W=y.materials;X=y.overdraw;j=0;if(y instanceof THREE.Mesh){S=y.geometry;D=S.vertices;V=S.faces;S=S.faceVertexUvs;z=0;for(A=D.length;z<A;z++){f=a();f.positionWorld.copy(D[z].position);R.multiplyVector3(f.positionWorld);
-f.positionScreen.copy(f.positionWorld);o.multiplyVector4(f.positionScreen);f.positionScreen.x/=f.positionScreen.w;f.positionScreen.y/=f.positionScreen.w;f.visible=f.positionScreen.z>M&&f.positionScreen.z<E}D=0;for(z=V.length;D<z;D++){A=V[D];if(A instanceof THREE.Face3){v=g[A.a];F=g[A.b];B=g[A.c];if(v.visible&&F.visible&&B.visible&&(y.doubleSided||y.flipSided!=(B.positionScreen.x-v.positionScreen.x)*(F.positionScreen.y-v.positionScreen.y)-(B.positionScreen.y-v.positionScreen.y)*(F.positionScreen.x-
-v.positionScreen.x)<0)){L=k[l]=k[l]||new THREE.RenderableFace3;l++;i=L;i.v1.copy(v);i.v2.copy(F);i.v3.copy(B)}else continue}else if(A instanceof THREE.Face4){v=g[A.a];F=g[A.b];B=g[A.c];L=g[A.d];if(v.visible&&F.visible&&B.visible&&L.visible&&(y.doubleSided||y.flipSided!=((L.positionScreen.x-v.positionScreen.x)*(F.positionScreen.y-v.positionScreen.y)-(L.positionScreen.y-v.positionScreen.y)*(F.positionScreen.x-v.positionScreen.x)<0||(F.positionScreen.x-B.positionScreen.x)*(L.positionScreen.y-B.positionScreen.y)-
-(F.positionScreen.y-B.positionScreen.y)*(L.positionScreen.x-B.positionScreen.x)<0))){T=n[m]=n[m]||new THREE.RenderableFace4;m++;i=T;i.v1.copy(v);i.v2.copy(F);i.v3.copy(B);i.v4.copy(L)}else continue}i.normalWorld.copy(A.normal);U.multiplyVector3(i.normalWorld);i.centroidWorld.copy(A.centroid);R.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);o.multiplyVector3(i.centroidScreen);B=A.vertexNormals;v=0;for(F=B.length;v<F;v++){L=i.vertexNormalsWorld[v];L.copy(B[v]);U.multiplyVector3(L)}v=
-0;for(F=S.length;v<F;v++)if(T=S[v][D]){B=0;for(L=T.length;B<L;B++)i.uvs[v][B]=T[B]}i.meshMaterials=W;i.faceMaterials=A.materials;i.overdraw=X;i.z=i.centroidScreen.z;J.push(i)}}else if(y instanceof THREE.Line){Q.multiply(o,R);D=y.geometry.vertices;v=a();v.positionScreen.copy(D[0].position);Q.multiplyVector4(v.positionScreen);z=1;for(A=D.length;z<A;z++){v=a();v.positionScreen.copy(D[z].position);Q.multiplyVector4(v.positionScreen);F=g[j-2];N.copy(v.positionScreen);O.copy(F.positionScreen);if(c(N,O)){N.multiplyScalar(1/
-N.w);O.multiplyScalar(1/O.w);R=t[q]=t[q]||new THREE.RenderableLine;q++;p=R;p.v1.positionScreen.copy(N);p.v2.positionScreen.copy(O);p.z=Math.max(N.z,O.z);p.materials=y.materials;J.push(p)}}}else if(y instanceof THREE.Particle){x.set(y.matrixWorld.n14,y.matrixWorld.n24,y.matrixWorld.n34,1);o.multiplyVector4(x);x.z/=x.w;if(x.z>0&&x.z<1){R=G[C]=G[C]||new THREE.RenderableParticle;C++;r=R;r.x=x.x/x.w;r.y=x.y/x.w;r.z=x.z;r.rotation=y.rotation.z;r.scale.x=y.scale.x*Math.abs(r.x-(x.x+s.projectionMatrix.n11)/
-(x.w+s.projectionMatrix.n14));r.scale.y=y.scale.y*Math.abs(r.y-(x.y+s.projectionMatrix.n22)/(x.w+s.projectionMatrix.n24));r.materials=y.materials;J.push(r)}}}}I&&J.sort(b);return J}};
-THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,b=new THREE.Projector,c,d,e,h;this.domElement=document.createElement("div");this.setSize=function(f,j){c=f;d=j;e=c/2;h=d/2};this.render=function(f,j){var g,i,l,k,m,n,p,q;a=b.projectScene(f,j);g=0;for(i=a.length;g<i;g++){m=a[g];if(m instanceof THREE.RenderableParticle){p=m.x*e+e;q=m.y*h+h;l=0;for(k=m.material.length;l<k;l++){n=m.material[l];if(n instanceof THREE.ParticleDOMMaterial){n=n.domElement;n.style.left=p+"px";n.style.top=q+"px"}}}}}};
-THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(a,b,c){c&&a.update(undefined,!1,b);c=a.sounds;var d,e=c.length;for(d=0;d<e;d++){a=c[d];this.soundPosition.set(a.matrixWorld.n14,a.matrixWorld.n24,a.matrixWorld.n34);this.soundPosition.subSelf(b.position);if(a.isPlaying&&a.isLoaded){a.isAddedToDOM||a.addToDOM(this.domElement);a.calculateVolumeAndPan(this.soundPosition)}}}};
+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,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,j=[],i,l,k=[],m,n=[],p,q,t=[],r,H,K=[],A=new THREE.Vector4,v=new THREE.Vector4,
+o=new THREE.Matrix4,I=new THREE.Matrix4,z=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],D=new THREE.Vector4,E=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 c=[],h,j,i;e=0;j=
+a.objects;a=0;for(h=j.length;a<h;a++){i=j[a];var k;if(!(k=!i.visible))if(k=i instanceof THREE.Mesh){a:{k=void 0;for(var l=i.matrixWorld,m=-i.geometry.boundingSphere.radius*Math.max(i.scale.x,Math.max(i.scale.y,i.scale.z)),n=0;n<6;n++)if(k=z[n].x*l.n14+z[n].y*l.n24+z[n].z*l.n34+z[n].w,k<=m){k=!1;break a}k=!0}k=!k}if(!k)k=g[e]=g[e]||new THREE.RenderableObject,e++,d=k,A.copy(i.position),o.multiplyVector3(A),d.object=i,d.z=A.z,c.push(d)}f&&c.sort(b);return c};this.projectScene=function(d,e,g){var A=[],
+V=e.near,W=e.far,M,G,x,C,s,y,w,B,F,u,J,R,T,U,L,S,N;H=q=m=l=0;e.matrixAutoUpdate&&e.update(void 0,!0);d.update(void 0,!1,e);o.multiply(e.projectionMatrix,e.matrixWorldInverse);z[0].set(o.n41-o.n11,o.n42-o.n12,o.n43-o.n13,o.n44-o.n14);z[1].set(o.n41+o.n11,o.n42+o.n12,o.n43+o.n13,o.n44+o.n14);z[2].set(o.n41+o.n21,o.n42+o.n22,o.n43+o.n23,o.n44+o.n24);z[3].set(o.n41-o.n21,o.n42-o.n22,o.n43-o.n23,o.n44-o.n24);z[4].set(o.n41-o.n31,o.n42-o.n32,o.n43-o.n33,o.n44-o.n34);z[5].set(o.n41+o.n31,o.n42+o.n32,o.n43+
+o.n33,o.n44+o.n34);for(M=0;M<6;M++)F=z[M],F.divideScalar(Math.sqrt(F.x*F.x+F.y*F.y+F.z*F.z));F=this.projectObjects(d,e,!0);d=0;for(M=F.length;d<M;d++)if(u=F[d].object,u.visible)if(J=u.matrixWorld,R=u.matrixRotationWorld,T=u.materials,U=u.overdraw,h=0,u instanceof THREE.Mesh){L=u.geometry;C=L.vertices;S=L.faces;L=L.faceVertexUvs;G=0;for(x=C.length;G<x;G++)f=a(),f.positionWorld.copy(C[G].position),J.multiplyVector3(f.positionWorld),f.positionScreen.copy(f.positionWorld),o.multiplyVector4(f.positionScreen),
+f.positionScreen.x/=f.positionScreen.w,f.positionScreen.y/=f.positionScreen.w,f.visible=f.positionScreen.z>V&&f.positionScreen.z<W;C=0;for(G=S.length;C<G;C++){x=S[C];if(x instanceof THREE.Face3)if(s=j[x.a],y=j[x.b],w=j[x.c],s.visible&&y.visible&&w.visible&&(u.doubleSided||u.flipSided!=(w.positionScreen.x-s.positionScreen.x)*(y.positionScreen.y-s.positionScreen.y)-(w.positionScreen.y-s.positionScreen.y)*(y.positionScreen.x-s.positionScreen.x)<0))B=k[l]=k[l]||new THREE.RenderableFace3,l++,i=B,i.v1.copy(s),
+i.v2.copy(y),i.v3.copy(w);else continue;else if(x instanceof THREE.Face4)if(s=j[x.a],y=j[x.b],w=j[x.c],B=j[x.d],s.visible&&y.visible&&w.visible&&B.visible&&(u.doubleSided||u.flipSided!=((B.positionScreen.x-s.positionScreen.x)*(y.positionScreen.y-s.positionScreen.y)-(B.positionScreen.y-s.positionScreen.y)*(y.positionScreen.x-s.positionScreen.x)<0||(y.positionScreen.x-w.positionScreen.x)*(B.positionScreen.y-w.positionScreen.y)-(y.positionScreen.y-w.positionScreen.y)*(B.positionScreen.x-w.positionScreen.x)<
+0)))N=n[m]=n[m]||new THREE.RenderableFace4,m++,i=N,i.v1.copy(s),i.v2.copy(y),i.v3.copy(w),i.v4.copy(B);else continue;i.normalWorld.copy(x.normal);R.multiplyVector3(i.normalWorld);i.centroidWorld.copy(x.centroid);J.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);o.multiplyVector3(i.centroidScreen);w=x.vertexNormals;s=0;for(y=w.length;s<y;s++)B=i.vertexNormalsWorld[s],B.copy(w[s]),R.multiplyVector3(B);s=0;for(y=L.length;s<y;s++)if(N=L[s][C]){w=0;for(B=N.length;w<B;w++)i.uvs[s][w]=
+N[w]}i.meshMaterials=T;i.faceMaterials=x.materials;i.overdraw=U;i.z=i.centroidScreen.z;A.push(i)}}else if(u instanceof THREE.Line){I.multiply(o,J);C=u.geometry.vertices;s=a();s.positionScreen.copy(C[0].position);I.multiplyVector4(s.positionScreen);G=1;for(x=C.length;G<x;G++)if(s=a(),s.positionScreen.copy(C[G].position),I.multiplyVector4(s.positionScreen),y=j[h-2],D.copy(s.positionScreen),E.copy(y.positionScreen),c(D,E))D.multiplyScalar(1/D.w),E.multiplyScalar(1/E.w),J=t[q]=t[q]||new THREE.RenderableLine,
+q++,p=J,p.v1.positionScreen.copy(D),p.v2.positionScreen.copy(E),p.z=Math.max(D.z,E.z),p.materials=u.materials,A.push(p)}else if(u instanceof THREE.Particle&&(v.set(u.matrixWorld.n14,u.matrixWorld.n24,u.matrixWorld.n34,1),o.multiplyVector4(v),v.z/=v.w,v.z>0&&v.z<1))J=K[H]=K[H]||new THREE.RenderableParticle,H++,r=J,r.x=v.x/v.w,r.y=v.y/v.w,r.z=v.z,r.rotation=u.rotation.z,r.scale.x=u.scale.x*Math.abs(r.x-(v.x+e.projectionMatrix.n11)/(v.w+e.projectionMatrix.n14)),r.scale.y=u.scale.y*Math.abs(r.y-(v.y+
+e.projectionMatrix.n22)/(v.w+e.projectionMatrix.n24)),r.materials=u.materials,A.push(r);g&&A.sort(b);return A}};
+THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,b=new THREE.Projector,c,d,e,g;this.domElement=document.createElement("div");this.setSize=function(a,b){c=a;d=b;e=c/2;g=d/2};this.render=function(c,d){var j,i,l,k,m,n,p,q;a=b.projectScene(c,d);j=0;for(i=a.length;j<i;j++)if(m=a[j],m instanceof THREE.RenderableParticle){p=m.x*e+e;q=m.y*g+g;l=0;for(k=m.material.length;l<k;l++)if(n=m.material[l],n instanceof THREE.ParticleDOMMaterial)n=n.domElement,n.style.left=p+"px",n.style.top=q+"px"}}};
+THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(a,b,c){c&&a.update(void 0,!1,b);var c=a.sounds,d,e=c.length;for(d=0;d<e;d++)a=c[d],this.soundPosition.set(a.matrixWorld.n14,a.matrixWorld.n24,a.matrixWorld.n34),this.soundPosition.subSelf(b.position),a.isPlaying&&a.isLoaded&&(a.isAddedToDOM||a.addToDOM(this.domElement),a.calculateVolumeAndPan(this.soundPosition))}};
 THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};

+ 152 - 153
build/custom/ThreeExtras.js

@@ -1,13 +1,13 @@
 // ThreeExtras.js r41/ROME - http://github.com/mrdoob/three.js
-THREE.ColorUtils={adjustHSV:function(a,c,b,e){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.ColorUtils.clamp(f.h+c,0,1);f.s=THREE.ColorUtils.clamp(f.s+b,0,1);f.v=THREE.ColorUtils.clamp(f.v+e,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,c){var b=a.r,e=a.g,f=a.b,d=Math.max(Math.max(b,e),f),g=Math.min(Math.min(b,e),f);if(g==d)g=b=0;else{var h=d-g;g=h/d;b=b==d?(e-f)/h:e==d?2+(f-b)/h:4+(b-e)/h;b/=6;b<0&&(b+=1);b>1&&(b-=1)}c===undefined&&(c={h:0,s:0,v:0});c.h=b;c.s=g;c.v=d;return c},
-clamp:function(a,c,b){return a<c?c:a>b?b:a}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
-var GeometryUtils={merge:function(a,c){var b=c instanceof THREE.Mesh,e=a.vertices.length,f=b?c.geometry:c,d=a.vertices,g=f.vertices,h=a.faces,j=f.faces,l=a.faceVertexUvs[0];f=f.faceVertexUvs[0];b&&c.matrixAutoUpdate&&c.updateMatrix();for(var k=0,m=g.length;k<m;k++){var p=new THREE.Vertex(g[k].position.clone());b&&c.matrix.multiplyVector3(p.position);d.push(p)}k=0;for(m=j.length;k<m;k++){g=j[k];var n,v,A=g.vertexNormals;p=g.vertexColors;if(g instanceof THREE.Face3)n=new THREE.Face3(g.a+e,g.b+e,g.c+
-e);else g instanceof THREE.Face4&&(n=new THREE.Face4(g.a+e,g.b+e,g.c+e,g.d+e));n.normal.copy(g.normal);b=0;for(d=A.length;b<d;b++){v=A[b];n.vertexNormals.push(v.clone())}n.color.copy(g.color);b=0;for(d=p.length;b<d;b++){v=p[b];n.vertexColors.push(v.clone())}n.materials=g.materials.slice();n.centroid.copy(g.centroid);h.push(n)}k=0;for(m=f.length;k<m;k++){e=f[k];h=[];b=0;for(d=e.length;b<d;b++)h.push(new THREE.UV(e[b].u,e[b].v));l.push(h)}}};
-THREE.ImageUtils={loadTexture:function(a,c,b){var e=new Image,f=new THREE.Texture(e,c);e.onload=function(){f.needsUpdate=!0;b&&b(this)};e.src=a;return f},loadTextureCube:function(a,c,b){var e,f=[],d=new THREE.Texture(f,c);c=f.loadCount=0;for(e=a.length;c<e;++c){f[c]=new Image;f[c].onload=function(){f.loadCount+=1;if(f.loadCount==6)d.needsUpdate=!0;b&&b(this)};f[c].src=a[c]}return d}};
-THREE.SceneUtils={addMesh:function(a,c,b,e,f,d,g,h,j,l){c=new THREE.Mesh(c,l);c.scale.x=c.scale.y=c.scale.z=b;c.position.x=e;c.position.y=f;c.position.z=d;c.rotation.x=g;c.rotation.y=h;c.rotation.z=j;a.addObject(c);return c},addPanoramaCubeWebGL:function(a,c,b){var e=THREE.ShaderUtils.lib.cube;e.uniforms.tCube.texture=b;b=new THREE.MeshShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms});c=new THREE.Mesh(new THREE.Cube(c,c,c,1,1,1,null,!0),b);a.addObject(c);
-return c},addPanoramaCube:function(a,c,b){var e=[];e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[0])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[1])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[2])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[3])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[4])}));e.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[5])}));c=new THREE.Mesh(new THREE.Cube(c,c,c,1,1,e,!0),
-new THREE.MeshFaceMaterial);a.addObject(c);return c},addPanoramaCubePlanes:function(a,c,b){var e=c/2;c=new THREE.Plane(c,c);var f=Math.PI,d=Math.PI/2;THREE.SceneUtils.addMesh(a,c,1,0,0,-e,0,0,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[5])}));THREE.SceneUtils.addMesh(a,c,1,-e,0,0,0,d,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[0])}));THREE.SceneUtils.addMesh(a,c,1,e,0,0,0,-d,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[1])}));THREE.SceneUtils.addMesh(a,c,1,0,e,0,d,
-0,f,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[2])}));THREE.SceneUtils.addMesh(a,c,1,0,-e,0,-d,0,f,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[3])}))},showHierarchy:function(a,c){THREE.SceneUtils.traverseHierarchy(a,function(b){b.visible=c})},traverseHierarchy:function(a,c){var b,e,f=a.children.length;for(e=0;e<f;e++){b=a.children[e];c(b);THREE.SceneUtils.traverseHierarchy(b,c)}}};
+THREE.ColorUtils={adjustHSV:function(a,b,c,d){var e=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,e);e.h=THREE.ColorUtils.clamp(e.h+b,0,1);e.s=THREE.ColorUtils.clamp(e.s+c,0,1);e.v=THREE.ColorUtils.clamp(e.v+d,0,1);a.setHSV(e.h,e.s,e.v)},rgbToHsv:function(a,b){var c=a.r,d=a.g,e=a.b,f=Math.max(Math.max(c,d),e),g=Math.min(Math.min(c,d),e);if(g==f)g=c=0;else{var j=f-g,g=j/f,c=c==f?(d-e)/j:d==f?2+(e-c)/j:4+(c-d)/j;c/=6;c<0&&(c+=1);c>1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=g;b.v=f;return b},
+clamp:function(a,b,c){return a<b?b:a>c?c:a}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
+var GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,d=a.vertices.length,e=c?b.geometry:b,f=a.vertices,g=e.vertices,j=a.faces,h=e.faces,l=a.faceVertexUvs[0],e=e.faceVertexUvs[0];c&&b.matrixAutoUpdate&&b.updateMatrix();for(var k=0,n=g.length;k<n;k++){var p=new THREE.Vertex(g[k].position.clone());c&&b.matrix.multiplyVector3(p.position);f.push(p)}k=0;for(n=h.length;k<n;k++){var g=h[k],o,t,v=g.vertexNormals,p=g.vertexColors;g instanceof THREE.Face3?o=new THREE.Face3(g.a+d,g.b+d,g.c+d):
+g instanceof THREE.Face4&&(o=new THREE.Face4(g.a+d,g.b+d,g.c+d,g.d+d));o.normal.copy(g.normal);c=0;for(f=v.length;c<f;c++)t=v[c],o.vertexNormals.push(t.clone());o.color.copy(g.color);c=0;for(f=p.length;c<f;c++)t=p[c],o.vertexColors.push(t.clone());o.materials=g.materials.slice();o.centroid.copy(g.centroid);j.push(o)}k=0;for(n=e.length;k<n;k++){d=e[k];j=[];c=0;for(f=d.length;c<f;c++)j.push(new THREE.UV(d[c].u,d[c].v));l.push(j)}}};
+THREE.ImageUtils={loadTexture:function(a,b,c){var d=new Image,e=new THREE.Texture(d,b);d.onload=function(){e.needsUpdate=!0;c&&c(this)};d.src=a;return e},loadTextureCube:function(a,b,c){var d,e=[],f=new THREE.Texture(e,b),b=e.loadCount=0;for(d=a.length;b<d;++b)e[b]=new Image,e[b].onload=function(){e.loadCount+=1;if(e.loadCount==6)f.needsUpdate=!0;c&&c(this)},e[b].src=a[b];return f}};
+THREE.SceneUtils={addMesh:function(a,b,c,d,e,f,g,j,h,l){b=new THREE.Mesh(b,l);b.scale.x=b.scale.y=b.scale.z=c;b.position.x=d;b.position.y=e;b.position.z=f;b.rotation.x=g;b.rotation.y=j;b.rotation.z=h;a.addObject(b);return b},addPanoramaCubeWebGL:function(a,b,c){var d=THREE.ShaderUtils.lib.cube;d.uniforms.tCube.texture=c;c=new THREE.MeshShaderMaterial({fragmentShader:d.fragmentShader,vertexShader:d.vertexShader,uniforms:d.uniforms});b=new THREE.Mesh(new THREE.Cube(b,b,b,1,1,1,null,!0),c);a.addObject(b);
+return b},addPanoramaCube:function(a,b,c){var d=[];d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[0])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[1])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[2])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[3])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[4])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(c[5])}));b=new THREE.Mesh(new THREE.Cube(b,b,b,1,1,d,!0),
+new THREE.MeshFaceMaterial);a.addObject(b);return b},addPanoramaCubePlanes:function(a,b,c){var d=b/2,b=new THREE.Plane(b,b),e=Math.PI,f=Math.PI/2;THREE.SceneUtils.addMesh(a,b,1,0,0,-d,0,0,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(c[5])}));THREE.SceneUtils.addMesh(a,b,1,-d,0,0,0,f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(c[0])}));THREE.SceneUtils.addMesh(a,b,1,d,0,0,0,-f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(c[1])}));THREE.SceneUtils.addMesh(a,b,1,0,d,0,f,0,e,
+new THREE.MeshBasicMaterial({map:new THREE.Texture(c[2])}));THREE.SceneUtils.addMesh(a,b,1,0,-d,0,-f,0,e,new THREE.MeshBasicMaterial({map:new THREE.Texture(c[3])}))},showHierarchy:function(a,b){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=b})},traverseHierarchy:function(a,b){var c,d,e=a.children.length;for(d=0;d<e;d++)c=a.children[d],b(c),THREE.SceneUtils.traverseHierarchy(c,b)}};
 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:{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.5},uDisplacementScale:{type:"f",value:2.5},uPointLightPos:{type:"v3",value:new THREE.Vector3},uPointLightColor:{type:"c",
@@ -17,139 +17,138 @@ cube:{uniforms:{tCube:{type:"t",value:1,texture:null}},vertexShader:"varying vec
 value:0,texture:null},uImageIncrement:{type:"v2",value:new THREE.Vector2(0.001953125,0)},cKernel:{type:"fv1",value:[]}},vertexShader:"varying vec2 vUv;\nuniform vec2 uImageIncrement;\nvoid main(void) {\nvUv = uv - ((KERNEL_SIZE - 1.0) / 2.0) * uImageIncrement;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"varying vec2 vUv;\nuniform sampler2D tDiffuse;\nuniform vec2 uImageIncrement;\nuniform float cKernel[KERNEL_SIZE];\nvoid main(void) {\nvec2 imageCoord = vUv;\nvec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );\nfor( int i=0; i<KERNEL_SIZE; ++i ) {\nsum += texture2D( tDiffuse, imageCoord ) * cKernel[i];\nimageCoord += uImageIncrement;\n}\ngl_FragColor = sum;\n}"},
 film:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},time:{type:"f",value:0},nIntensity:{type:"f",value:0.5},sIntensity:{type:"f",value:0.05},sCount:{type:"f",value:4096},grayscale:{type:"i",value:1}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"varying vec2 vUv;\nuniform sampler2D tDiffuse;\nuniform float time;\nuniform bool grayscale;\nuniform float nIntensity;\nuniform float sIntensity;\nuniform float sCount;\nvoid main() {\nvec4 cTextureScreen = texture2D( tDiffuse, vUv );\nfloat x = vUv.x * vUv.y * time *  1000.0;\nx = mod( x, 13.0 ) * mod( x, 123.0 );\nfloat dx = mod( x, 0.01 );\nvec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 );\nvec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );\ncResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;\ncResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );\nif( grayscale ) {\ncResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );\n}\ngl_FragColor =  vec4( cResult, cTextureScreen.a );\n}"},
 screen:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},opacity:{type:"f",value:1}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"varying vec2 vUv;\nuniform sampler2D tDiffuse;\nuniform float opacity;\nvoid main() {\nvec4 texel = texture2D( tDiffuse, vUv );\ngl_FragColor = opacity * texel;\n}"},basic:{uniforms:{},vertexShader:"void main() {\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
-fragmentShader:"void main() {\ngl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );\n}"}},buildKernel:function(a){var c,b,e,f,d=2*Math.ceil(a*3)+1;d>25&&(d=25);f=(d-1)*0.5;b=Array(d);for(c=e=0;c<d;++c){b[c]=Math.exp(-((c-f)*(c-f))/(2*a*a));e+=b[c]}for(c=0;c<d;++c)b[c]/=e;return b}};
-THREE.AnimationHandler=function(){var a=[],c={},b={};b.update=function(f){for(var d=0;d<a.length;d++)a[d].update(f)};b.addToUpdate=function(f){a.indexOf(f)===-1&&a.push(f)};b.removeFromUpdate=function(f){f=a.indexOf(f);f!==-1&&a.splice(f,1)};b.add=function(f){c[f.name]!==undefined&&console.log("THREE.AnimationHandler.add: Warning! "+f.name+" already exists in library. Overwriting.");c[f.name]=f;if(f.initialized!==!0){for(var d=0;d<f.hierarchy.length;d++){for(var g=0;g<f.hierarchy[d].keys.length;g++){if(f.hierarchy[d].keys[g].time<
-0)f.hierarchy[d].keys[g].time=0;if(f.hierarchy[d].keys[g].rot!==undefined&&!(f.hierarchy[d].keys[g].rot instanceof THREE.Quaternion)){var h=f.hierarchy[d].keys[g].rot;f.hierarchy[d].keys[g].rot=new THREE.Quaternion(h[0],h[1],h[2],h[3])}}if(f.hierarchy[d].keys[0].morphTargets!==undefined){h={};for(g=0;g<f.hierarchy[d].keys.length;g++)for(var j=0;j<f.hierarchy[d].keys[g].morphTargets.length;j++){var l=f.hierarchy[d].keys[g].morphTargets[j];h[l]=-1}f.hierarchy[d].usedMorphTargets=h;for(g=0;g<f.hierarchy[d].keys.length;g++){var k=
-{};for(l in h){for(j=0;j<f.hierarchy[d].keys[g].morphTargets.length;j++)if(f.hierarchy[d].keys[g].morphTargets[j]===l){k[l]=f.hierarchy[d].keys[g].morphTargetsInfluences[j];break}j===f.hierarchy[d].keys[g].morphTargets.length&&(k[l]=0)}f.hierarchy[d].keys[g].morphTargetsInfluences=k}}for(g=1;g<f.hierarchy[d].keys.length;g++)if(f.hierarchy[d].keys[g].time===f.hierarchy[d].keys[g-1].time){f.hierarchy[d].keys.splice(g,1);g--}for(g=1;g<f.hierarchy[d].keys.length;g++)f.hierarchy[d].keys[g].index=g}g=parseInt(f.length*
-f.fps,10);f.JIT={};f.JIT.hierarchy=[];for(d=0;d<f.hierarchy.length;d++)f.JIT.hierarchy.push(Array(g));f.initialized=!0}};b.get=function(f){if(typeof f==="string")if(c[f])return c[f];else{console.log("THREE.AnimationHandler.get: Couldn't find animation "+f);return null}};b.parse=function(f){var d=[];if(f instanceof THREE.SkinnedMesh)for(var g=0;g<f.bones.length;g++)d.push(f.bones[g]);else e(f,d);return d};var e=function(f,d){d.push(f);for(var g=0;g<f.children.length;g++)e(f.children[g],d)};b.LINEAR=
-0;b.CATMULLROM=1;b.CATMULLROM_FORWARD=2;return b}();THREE.Animation=function(a,c,b,e){this.root=a;this.data=THREE.AnimationHandler.get(c);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.isPaused=!0;this.loop=!0;this.interpolationType=b!==undefined?b:THREE.AnimationHandler.LINEAR;this.JITCompile=e!==undefined?e:!0;this.points=[];this.target=new THREE.Vector3};
-THREE.Animation.prototype.play=function(a,c){if(!this.isPlaying){this.isPlaying=!0;this.loop=a!==undefined?a:!0;this.currentTime=c!==undefined?c:0;var b,e=this.hierarchy.length,f;for(b=0;b<e;b++){f=this.hierarchy[b];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)f.useQuaternion=!0;f.matrixAutoUpdate=!0;if(f.animationCache===undefined){f.animationCache={};f.animationCache.prevKey={pos:0,rot:0,scl:0};f.animationCache.nextKey={pos:0,rot:0,scl:0};f.animationCache.originalMatrix=
-f instanceof THREE.Bone?f.skinMatrix:f.matrix}var d=f.animationCache.prevKey;f=f.animationCache.nextKey;d.pos=this.data.hierarchy[b].keys[0];d.rot=this.data.hierarchy[b].keys[0];d.scl=this.data.hierarchy[b].keys[0];f.pos=this.getNextKeyWith("pos",b,1);f.rot=this.getNextKeyWith("rot",b,1);f.scl=this.getNextKeyWith("scl",b,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
+fragmentShader:"void main() {\ngl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );\n}"}},buildKernel:function(a){var b,c,d,e,f=2*Math.ceil(a*3)+1;f>25&&(f=25);e=(f-1)*0.5;c=Array(f);for(b=d=0;b<f;++b)c[b]=Math.exp(-((b-e)*(b-e))/(2*a*a)),d+=c[b];for(b=0;b<f;++b)c[b]/=d;return c}};
+THREE.AnimationHandler=function(){var a=[],b={},c={update:function(c){for(var b=0;b<a.length;b++)a[b].update(c)},addToUpdate:function(c){a.indexOf(c)===-1&&a.push(c)},removeFromUpdate:function(c){c=a.indexOf(c);c!==-1&&a.splice(c,1)},add:function(a){b[a.name]!==void 0&&console.log("THREE.AnimationHandler.add: Warning! "+a.name+" already exists in library. Overwriting.");b[a.name]=a;if(a.initialized!==!0){for(var c=0;c<a.hierarchy.length;c++){for(var d=0;d<a.hierarchy[c].keys.length;d++){if(a.hierarchy[c].keys[d].time<
+0)a.hierarchy[c].keys[d].time=0;if(a.hierarchy[c].keys[d].rot!==void 0&&!(a.hierarchy[c].keys[d].rot instanceof THREE.Quaternion)){var j=a.hierarchy[c].keys[d].rot;a.hierarchy[c].keys[d].rot=new THREE.Quaternion(j[0],j[1],j[2],j[3])}}if(a.hierarchy[c].keys[0].morphTargets!==void 0){j={};for(d=0;d<a.hierarchy[c].keys.length;d++)for(var h=0;h<a.hierarchy[c].keys[d].morphTargets.length;h++){var l=a.hierarchy[c].keys[d].morphTargets[h];j[l]=-1}a.hierarchy[c].usedMorphTargets=j;for(d=0;d<a.hierarchy[c].keys.length;d++){var k=
+{};for(l in j){for(h=0;h<a.hierarchy[c].keys[d].morphTargets.length;h++)if(a.hierarchy[c].keys[d].morphTargets[h]===l){k[l]=a.hierarchy[c].keys[d].morphTargetsInfluences[h];break}h===a.hierarchy[c].keys[d].morphTargets.length&&(k[l]=0)}a.hierarchy[c].keys[d].morphTargetsInfluences=k}}for(d=1;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].time===a.hierarchy[c].keys[d-1].time&&(a.hierarchy[c].keys.splice(d,1),d--);for(d=1;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].index=d}d=parseInt(a.length*
+a.fps,10);a.JIT={};a.JIT.hierarchy=[];for(c=0;c<a.hierarchy.length;c++)a.JIT.hierarchy.push(Array(d));a.initialized=!0}},get:function(a){if(typeof a==="string")return b[a]?b[a]:(console.log("THREE.AnimationHandler.get: Couldn't find animation "+a),null)},parse:function(a){var c=[];if(a instanceof THREE.SkinnedMesh)for(var b=0;b<a.bones.length;b++)c.push(a.bones[b]);else d(a,c);return c}},d=function(a,c){c.push(a);for(var b=0;b<a.children.length;b++)d(a.children[b],c)};c.LINEAR=0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=
+2;return c}();THREE.Animation=function(a,b,c,d){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=c!==void 0?c:THREE.AnimationHandler.LINEAR;this.JITCompile=d!==void 0?d:!0;this.points=[];this.target=new THREE.Vector3};
+THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=a!==void 0?a:!0;this.currentTime=b!==void 0?b:0;var c,d=this.hierarchy.length,e;for(c=0;c<d;c++){e=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)e.useQuaternion=!0;e.matrixAutoUpdate=!0;if(e.animationCache===void 0)e.animationCache={},e.animationCache.prevKey={pos:0,rot:0,scl:0},e.animationCache.nextKey={pos:0,rot:0,scl:0},e.animationCache.originalMatrix=e instanceof
+THREE.Bone?e.skinMatrix:e.matrix;var f=e.animationCache.prevKey;e=e.animationCache.nextKey;f.pos=this.data.hierarchy[c].keys[0];f.rot=this.data.hierarchy[c].keys[0];f.scl=this.data.hierarchy[c].keys[0];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
-THREE.Animation.prototype.stop=function(){this.isPlaying=!1;this.isPaused=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(this.hierarchy[a].animationCache!==undefined){if(this.hierarchy[a]instanceof THREE.Bone)this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix;else this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix;delete this.hierarchy[a].animationCache}};
-THREE.Animation.prototype.update=function(a){if(this.isPlaying){var c=["pos","rot","scl"],b,e,f,d,g,h,j,l,k=this.data.JIT.hierarchy,m,p;this.currentTime+=a*this.timeScale;p=this.currentTime;m=this.currentTime%=this.data.length;l=parseInt(Math.min(m*this.data.fps,this.data.length*this.data.fps),10);for(var n=0,v=this.hierarchy.length;n<v;n++){a=this.hierarchy[n];j=a.animationCache;if(this.JITCompile&&k[n][l]!==undefined)if(a instanceof THREE.Bone){a.skinMatrix=k[n][l];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=
-!1}else{a.matrix=k[n][l];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=!0}else{if(this.JITCompile)if(a instanceof THREE.Bone)a.skinMatrix=a.animationCache.originalMatrix;else a.matrix=a.animationCache.originalMatrix;for(var A=0;A<3;A++){b=c[A];g=j.prevKey[b];h=j.nextKey[b];if(h.time<=p){if(m<p)if(this.loop){g=this.data.hierarchy[n].keys[0];for(h=this.getNextKeyWith(b,n,1);h.time<m;){g=h;h=this.getNextKeyWith(b,n,h.index+1)}}else{this.stop();return}else{do{g=h;h=this.getNextKeyWith(b,n,h.index+1)}while(h.time<
-m)}j.prevKey[b]=g;j.nextKey[b]=h}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;e=(m-g.time)/(h.time-g.time);f=g[b];d=h[b];if(e<0||e>1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+n);e=e<0?0:1}if(b==="pos"){b=a.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){b.x=f[0]+(d[0]-f[0])*e;b.y=f[1]+(d[1]-f[1])*e;b.z=f[2]+(d[2]-f[2])*e}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=
-this.getPrevKeyWith("pos",n,g.index-1).pos;this.points[1]=f;this.points[2]=d;this.points[3]=this.getNextKeyWith("pos",n,h.index+1).pos;e=e*0.33+0.33;f=this.interpolateCatmullRom(this.points,e);b.x=f[0];b.y=f[1];b.z=f[2];if(this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){e=this.interpolateCatmullRom(this.points,e*1.01);this.target.set(e[0],e[1],e[2]);this.target.subSelf(b);this.target.y=0;this.target.normalize();e=Math.atan2(this.target.x,this.target.z);a.rotation.set(0,e,0)}}}else if(b===
-"rot")THREE.Quaternion.slerp(f,d,a.quaternion,e);else if(b==="scl"){b=a.scale;b.x=f[0]+(d[0]-f[0])*e;b.y=f[1]+(d[1]-f[1])*e;b.z=f[2]+(d[2]-f[2])*e}}}}if(this.JITCompile&&k[0][l]===undefined){this.hierarchy[0].update(undefined,!0);for(n=0;n<this.hierarchy.length;n++)k[n][l]=this.hierarchy[n]instanceof THREE.Bone?this.hierarchy[n].skinMatrix.clone():this.hierarchy[n].matrix.clone()}}};
-THREE.Animation.prototype.interpolateCatmullRom=function(a,c){var b=[],e=[],f,d,g,h,j,l;f=(a.length-1)*c;d=Math.floor(f);f-=d;b[0]=d==0?d:d-1;b[1]=d;b[2]=d>a.length-2?d:d+1;b[3]=d>a.length-3?d:d+2;d=a[b[0]];h=a[b[1]];j=a[b[2]];l=a[b[3]];b=f*f;g=f*b;e[0]=this.interpolate(d[0],h[0],j[0],l[0],f,b,g);e[1]=this.interpolate(d[1],h[1],j[1],l[1],f,b,g);e[2]=this.interpolate(d[2],h[2],j[2],l[2],f,b,g);return e};
-THREE.Animation.prototype.interpolate=function(a,c,b,e,f,d,g){a=(b-a)*0.5;e=(e-c)*0.5;return(2*(c-b)+a+e)*g+(-3*(c-b)-2*a-e)*d+a*f+c};THREE.Animation.prototype.getNextKeyWith=function(a,c,b){var e=this.data.hierarchy[c].keys;if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)b=b<e.length-1?b:e.length-1;else b%=e.length;for(;b<e.length;b++)if(e[b][a]!==undefined)return e[b];return this.data.hierarchy[c].keys[0]};
-THREE.Animation.prototype.getPrevKeyWith=function(a,c,b){var e=this.data.hierarchy[c].keys;for(b=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?b>0?b:0:b>=0?b:b+e.length;b>=0;b--)if(e[b][a]!==undefined)return e[b];return this.data.hierarchy[c].keys[e.length-1]};
-THREE.QuakeCamera=function(a){function c(b,e){return function(){e.apply(b,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(a){if(a.movementSpeed!==undefined)this.movementSpeed=
-a.movementSpeed;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.noFly!==undefined)this.noFly=a.noFly;if(a.lookVertical!==undefined)this.lookVertical=a.lookVertical;if(a.autoForward!==undefined)this.autoForward=a.autoForward;if(a.activeLook!==undefined)this.activeLook=a.activeLook;if(a.heightSpeed!==undefined)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==undefined)this.heightCoef=a.heightCoef;if(a.heightMin!==undefined)this.heightMin=a.heightMin;if(a.heightMax!==undefined)this.heightMax=
-a.heightMax;if(a.constrainVertical!==undefined)this.constrainVertical=a.constrainVertical;if(a.verticalMin!==undefined)this.verticalMin=a.verticalMin;if(a.verticalMax!==undefined)this.verticalMax=a.verticalMax;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.moveForward=!1;this.moveBackward=!1;this.moveLeft=!1;this.moveRight=!1;this.freeze=!1;this.mouseDragOn=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=
-window.innerHeight/2;this.onMouseDown=function(b){b.preventDefault();b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(b){b.preventDefault();b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(b){this.mouseX=b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.onKeyDown=
-function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!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 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}};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 e=this.tdiff*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.translateZ(-(e+this.autoSpeedFactor));this.moveBackward&&this.translateZ(e);this.moveLeft&&this.translateX(-e);this.moveRight&&this.translateX(e);e=this.tdiff*this.lookSpeed;
-this.activeLook||(e=0);this.lon+=this.mouseX*e;this.lookVertical&&(this.lat-=this.mouseY*e);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;b=this.target.position;var f=this.position;b.x=f.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=f.y+100*Math.cos(this.phi);b.z=f.z+100*Math.sin(this.phi)*Math.sin(this.theta)}this.lon+=this.mouseX*e;this.lookVertical&&(this.lat-=this.mouseY*e);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)/3.14+this.verticalMin;b=this.target.position;f=this.position;b.x=f.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=f.y+100*Math.cos(this.phi);b.z=f.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.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
-THREE.QuakeCamera.prototype.translate=function(a,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(a));this.target.position.addSelf(c.multiplyScalar(a))};
-THREE.PathCamera=function(a){function c(l,k,m,p){var n={name:m,fps:0.6,length:p,hierarchy:[]},v,A=k.getControlPointsArray(),w=k.getLength(),u=A.length,y=0;v=u-1;k={parent:-1,keys:[]};k.keys[0]={time:0,pos:A[0],rot:[0,0,0,1],scl:[1,1,1]};k.keys[v]={time:p,pos:A[v],rot:[0,0,0,1],scl:[1,1,1]};for(v=1;v<u-1;v++){y=p*w.chunks[v]/w.total;k.keys[v]={time:y,pos:A[v]}}n.hierarchy[0]=k;THREE.AnimationHandler.add(n);return new THREE.Animation(l,m,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function b(l,k){var m,
-p,n=new THREE.Geometry;for(m=0;m<l.points.length*k;m++){p=m/(l.points.length*k);p=l.getPoint(p);n.vertices[m]=new THREE.Vertex(new THREE.Vector3(p.x,p.y,p.z))}return n}function e(l,k){var m=b(k,10),p=b(k,10),n=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(m,n);particleObj=new THREE.ParticleSystem(p,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);l.addChild(lineObj);particleObj.scale.set(1,1,1);l.addChild(particleObj);p=new THREE.Sphere(1,
-16,8);n=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<k.points.length;i++){m=new THREE.Mesh(p,n);m.position.copy(k.points[i]);m.updateMatrix();l.addChild(m)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookVertical=
-!0;this.lookHorizontal=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(a){if(a.duration!==undefined)this.duration=a.duration*1E3;if(a.waypoints!==undefined)this.waypoints=a.waypoints;if(a.useConstantSpeed!==undefined)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==undefined)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==undefined)this.createDebugPath=a.createDebugPath;
-if(a.createDebugDummy!==undefined)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==undefined)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==undefined)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==undefined)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==undefined)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=
-this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var f=Math.PI*2,d=Math.PI/180;this.update=function(l,k,m){var p,n;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)*d;this.theta=this.lon*d;p=this.phi%f;this.phi=p>=0?p:p+f;p=this.verticalAngleMap.srcRange;n=this.verticalAngleMap.dstRange;
-var v=n[1]-n[0];this.phi=TWEEN.Easing.Quadratic.EaseInOut(((this.phi-p[0])*(n[1]-n[0])/(p[1]-p[0])+n[0]-n[0])/v)*v+n[0];p=this.horizontalAngleMap.srcRange;n=this.horizontalAngleMap.dstRange;v=n[1]-n[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-p[0])*(n[1]-n[0])/(p[1]-p[0])+n[0]-n[0])/v)*v+n[0];p=this.target.position;p.x=100*Math.sin(this.phi)*Math.cos(this.theta);p.y=100*Math.cos(this.phi);p.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,l,k,m)};this.onMouseMove=
-function(l){this.mouseX=l.clientX-this.windowHalfX;this.mouseY=l.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){a=new THREE.MeshLambertMaterial({color:30719});var g=new THREE.MeshLambertMaterial({color:65280}),h=new THREE.Cube(10,10,20),j=new THREE.Cube(2,2,10);this.animationParent=new THREE.Mesh(h,a);a=new THREE.Mesh(j,g);a.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(a)}else{this.animation=c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this.target);this.animationParent.addChild(this)}this.createDebugPath&&e(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(l,k){return function(){k.apply(l,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 c(b,e){return function(){e.apply(b,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.dragToLook=!1;this.autoForward=!1;this.domElement=document;if(a){if(a.movementSpeed!==undefined)this.movementSpeed=a.movementSpeed;if(a.rollSpeed!==undefined)this.rollSpeed=a.rollSpeed;if(a.dragToLook!==undefined)this.dragToLook=a.dragToLook;if(a.autoForward!==undefined)this.autoForward=
-a.autoForward;if(a.domElement!==undefined)this.domElement=a.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(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=
+THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(this.hierarchy[a].animationCache!==void 0)this.hierarchy[a]instanceof THREE.Bone?this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix:this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix,delete this.hierarchy[a].animationCache};
+THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,d,e,f,g,j,h,l,k=this.data.JIT.hierarchy,n,p;this.currentTime+=a*this.timeScale;p=this.currentTime;n=this.currentTime%=this.data.length;l=parseInt(Math.min(n*this.data.fps,this.data.length*this.data.fps),10);for(var o=0,t=this.hierarchy.length;o<t;o++)if(a=this.hierarchy[o],h=a.animationCache,this.JITCompile&&k[o][l]!==void 0)a instanceof THREE.Bone?(a.skinMatrix=k[o][l],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=
+!1):(a.matrix=k[o][l],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)a instanceof THREE.Bone?a.skinMatrix=a.animationCache.originalMatrix:a.matrix=a.animationCache.originalMatrix;for(var v=0;v<3;v++){c=b[v];g=h.prevKey[c];j=h.nextKey[c];if(j.time<=p){if(n<p)if(this.loop){g=this.data.hierarchy[o].keys[0];for(j=this.getNextKeyWith(c,o,1);j.time<n;)g=j,j=this.getNextKeyWith(c,o,j.index+1)}else{this.stop();return}else{do g=j,j=this.getNextKeyWith(c,o,j.index+1);while(j.time<
+n)}h.prevKey[c]=g;h.nextKey[c]=j}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;d=(n-g.time)/(j.time-g.time);e=g[c];f=j[c];if(d<0||d>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+o),d=d<0?0:1;if(c==="pos")if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+(f[2]-e[2])*d;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
+this.getPrevKeyWith("pos",o,g.index-1).pos,this.points[1]=e,this.points[2]=f,this.points[3]=this.getNextKeyWith("pos",o,j.index+1).pos,d=d*0.33+0.33,e=this.interpolateCatmullRom(this.points,d),c.x=e[0],c.y=e[1],c.z=e[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)d=this.interpolateCatmullRom(this.points,d*1.01),this.target.set(d[0],d[1],d[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),d=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,d,0)}else if(c===
+"rot")THREE.Quaternion.slerp(e,f,a.quaternion,d);else if(c==="scl")c=a.scale,c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+(f[2]-e[2])*d}}if(this.JITCompile&&k[0][l]===void 0){this.hierarchy[0].update(void 0,!0);for(o=0;o<this.hierarchy.length;o++)k[o][l]=this.hierarchy[o]instanceof THREE.Bone?this.hierarchy[o].skinMatrix.clone():this.hierarchy[o].matrix.clone()}}};
+THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],e,f,g,j,h,l;e=(a.length-1)*b;f=Math.floor(e);e-=f;c[0]=f==0?f:f-1;c[1]=f;c[2]=f>a.length-2?f:f+1;c[3]=f>a.length-3?f:f+2;f=a[c[0]];j=a[c[1]];h=a[c[2]];l=a[c[3]];c=e*e;g=e*c;d[0]=this.interpolate(f[0],j[0],h[0],l[0],e,c,g);d[1]=this.interpolate(f[1],j[1],h[1],l[1],e,c,g);d[2]=this.interpolate(f[2],j[2],h[2],l[2],e,c,g);return d};
+THREE.Animation.prototype.interpolate=function(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c<d.length-1?c:d.length-1:c%=d.length;c<d.length;c++)if(d[c][a]!==void 0)return d[c];return this.data.hierarchy[b].keys[0]};
+THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+d.length;c>=0;c--)if(d[c][a]!==void 0)return d[c];return this.data.hierarchy[b].keys[d.length-1]};
+THREE.QuakeCamera=function(a){function b(a,d){return function(){d.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;this.lastUpdate=(new Date).getTime();this.tdiff=0;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=
+a.movementSpeed;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.noFly!==void 0)this.noFly=a.noFly;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.autoForward!==void 0)this.autoForward=a.autoForward;if(a.activeLook!==void 0)this.activeLook=a.activeLook;if(a.heightSpeed!==void 0)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==void 0)this.heightCoef=a.heightCoef;if(a.heightMin!==void 0)this.heightMin=a.heightMin;if(a.heightMax!==void 0)this.heightMax=a.heightMax;if(a.constrainVertical!==
+void 0)this.constrainVertical=a.constrainVertical;if(a.verticalMin!==void 0)this.verticalMin=a.verticalMin;if(a.verticalMax!==void 0)this.verticalMax=a.verticalMax;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(a){a.preventDefault();
+a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.mouseX=a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.onKeyDown=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=
+!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 81:this.freeze=!this.freeze}};this.onKeyUp=function(a){switch(a.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}};this.update=function(){var a=(new Date).getTime();this.tdiff=(a-this.lastUpdate)/1E3;this.lastUpdate=a;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 d=this.tdiff*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.translateZ(-(d+this.autoSpeedFactor));this.moveBackward&&this.translateZ(d);this.moveLeft&&this.translateX(-d);this.moveRight&&this.translateX(d);d=this.tdiff*this.lookSpeed;this.activeLook||(d=0);this.lon+=this.mouseX*d;this.lookVertical&&
+(this.lat-=this.mouseY*d);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 a=this.target.position,b=this.position;a.x=b.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=b.y+100*Math.cos(this.phi);a.z=b.z+100*Math.sin(this.phi)*Math.sin(this.theta)}this.lon+=this.mouseX*d;this.lookVertical&&(this.lat-=this.mouseY*d);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)/3.14+this.verticalMin;a=this.target.position;b=this.position;a.x=b.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=b.y+100*Math.cos(this.phi);a.z=b.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",b(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",b(this,this.onMouseDown),
+!1);this.domElement.addEventListener("mouseup",b(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",b(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",b(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
+THREE.QuakeCamera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);if(this.noFly)b.y=0;this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};
+THREE.PathCamera=function(a){function b(a,c,b,d){var f={name:b,fps:0.6,length:d,hierarchy:[]},g,e=c.getControlPointsArray(),j=c.getLength(),h=e.length,w=0;g=h-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:e[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[g]={time:d,pos:e[g],rot:[0,0,0,1],scl:[1,1,1]};for(g=1;g<h-1;g++)w=d*j.chunks[g]/j.total,c.keys[g]={time:w,pos:e[g]};f.hierarchy[0]=c;THREE.AnimationHandler.add(f);return new THREE.Animation(a,b,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function c(a,c){var b,
+d,f=new THREE.Geometry;for(b=0;b<a.points.length*c;b++)d=b/(a.points.length*c),d=a.getPoint(d),f.vertices[b]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return f}function d(a,b){var d=c(b,10),f=c(b,10),g=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(d,g);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.Sphere(1,
+16,8);g=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<b.points.length;i++)d=new THREE.Mesh(f,g),d.position.copy(b.points[i]),d.updateMatrix(),a.addChild(d)}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=
+this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(a){if(a.duration!==void 0)this.duration=a.duration*1E3;if(a.waypoints!==void 0)this.waypoints=a.waypoints;if(a.useConstantSpeed!==void 0)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==void 0)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==void 0)this.createDebugPath=a.createDebugPath;if(a.createDebugDummy!==
+void 0)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==void 0)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==void 0)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==void 0)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==void 0)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==void 0)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==void 0)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=
+window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var e=Math.PI*2,f=Math.PI/180;this.update=function(a,c,b){var d,g;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*f;this.theta=this.lon*f;d=this.phi%e;this.phi=d>=0?d:d+e;d=this.verticalAngleMap.srcRange;g=this.verticalAngleMap.dstRange;var j=g[1]-g[0];this.phi=
+TWEEN.Easing.Quadratic.EaseInOut(((this.phi-d[0])*(g[1]-g[0])/(d[1]-d[0])+g[0]-g[0])/j)*j+g[0];d=this.horizontalAngleMap.srcRange;g=this.horizontalAngleMap.dstRange;j=g[1]-g[0];this.theta=TWEEN.Easing.Quadratic.EaseInOut(((this.theta-d[0])*(g[1]-g[0])/(d[1]-d[0])+g[0]-g[0])/j)*j+g[0];d=this.target.position;d.x=100*Math.sin(this.phi)*Math.cos(this.theta);d.y=100*Math.cos(this.phi);d.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,a,c,b)};this.onMouseMove=function(a){this.mouseX=
+a.clientX-this.windowHalfX;this.mouseY=a.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),g=new THREE.MeshLambertMaterial({color:65280}),j=new THREE.Cube(10,10,20),h=new THREE.Cube(2,2,10);this.animationParent=new THREE.Mesh(j,a);a=new THREE.Mesh(h,g);a.position.set(0,10,0);this.animation=b(this.animationParent,
+this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else this.animation=b(this.animationParent,this.spline,this.id,this.duration),this.animationParent.addChild(this.target),this.animationParent.addChild(this);this.createDebugPath&&d(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(a,c){return function(){c.apply(a,arguments)}}(this,this.onMouseMove),!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,d){return function(){d.apply(a,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.tmpQuaternion=new THREE.Quaternion;this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.domElement=document;if(a){if(a.movementSpeed!==void 0)this.movementSpeed=a.movementSpeed;if(a.rollSpeed!==void 0)this.rollSpeed=a.rollSpeed;if(a.dragToLook!==void 0)this.dragToLook=a.dragToLook;if(a.autoForward!==void 0)this.autoForward=
+a.autoForward;if(a.domElement!==void 0)this.domElement=a.domElement}this.useTarget=!1;this.useQuaternion=!0;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(a){if(typeof this[a.type]=="function")this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=
 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){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 e=this.getContainerDimensions(),f=e.size[0]/2,d=e.size[1]/2;this.moveState.yawLeft=-(b.clientX-e.offset[0]-f)/f;this.moveState.pitchDown=(b.clientY-
-e.offset[1]-d)/d;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;b=this.tdiff*this.movementSpeed;var e=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*e,this.rotationVector.y*e,this.rotationVector.z*e,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);window.addEventListener("keydown",c(this,this.keydown),!1);window.addEventListener("keyup",c(this,
+this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;
+case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(a.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}};this.mousemove=function(a){if(!this.dragToLook||this.mouseStatus>0){var d=this.getContainerDimensions(),b=d.size[0]/2,f=d.size[1]/2;this.moveState.yawLeft=-(a.clientX-d.offset[0]-b)/b;this.moveState.pitchDown=(a.clientY-
+d.offset[1]-f)/f;this.updateRotationVector()}};this.mouseup=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(){var a=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.tdiff=(a-this.lastUpdate)/1E3;this.lastUpdate=a;var a=this.tdiff*this.movementSpeed,d=this.tdiff*
+this.rollSpeed;this.translateX(this.moveVector.x*a);this.translateY(this.moveVector.y*a);this.translateZ(this.moveVector.z*a);this.tmpQuaternion.set(this.rotationVector.x*d,this.rotationVector.y*d,this.rotationVector.z*d,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 a=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=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=
+document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",b(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",b(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",b(this,this.mouseup),!1);window.addEventListener("keydown",b(this,this.keydown),!1);window.addEventListener("keyup",b(this,
 this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};THREE.FlyCamera.prototype=new THREE.Camera;THREE.FlyCamera.prototype.constructor=THREE.FlyCamera;THREE.FlyCamera.prototype.supr=THREE.Camera.prototype;
-THREE.RollCamera=function(a,c,b,e){THREE.Camera.call(this,a,c,b,e);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.useTarget=!1;this.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var f=new THREE.Vector3,d=new THREE.Vector3,g=new THREE.Vector3,h=new THREE.Matrix4,j=!1,l=1,k=0,m=0,p=0,n=0,v=0,A=window.innerWidth/2,w=window.innerHeight/2;this.update=
-function(){var u=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=u;this.delta=(u-this.lastUpdate)/1E3;this.lastUpdate=u;if(this.mouseLook){u=this.delta*this.lookSpeed;this.rotateHorizontally(u*n);this.rotateVertically(u*v)}u=this.delta*this.movementSpeed;this.translateZ(u*(k>0||this.autoForward&&!(k<0)?1:k));this.translateX(u*m);this.translateY(u*p);j&&(this.roll+=this.rollSpeed*this.delta*l);if(this.forward.y>this.constrainVertical[1]){this.forward.y=this.constrainVertical[1];this.forward.normalize()}else if(this.forward.y<
-this.constrainVertical[0]){this.forward.y=this.constrainVertical[0];this.forward.normalize()}g.copy(this.forward);d.set(0,1,0);f.cross(d,g).normalize();d.cross(g,f).normalize();this.matrix.n11=f.x;this.matrix.n12=d.x;this.matrix.n13=g.x;this.matrix.n21=f.y;this.matrix.n22=d.y;this.matrix.n23=g.y;this.matrix.n31=f.z;this.matrix.n32=d.z;this.matrix.n33=g.z;h.identity();h.n11=Math.cos(this.roll);h.n12=-Math.sin(this.roll);h.n21=Math.sin(this.roll);h.n22=Math.cos(this.roll);this.matrix.multiplySelf(h);
-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(u){this.position.x+=this.matrix.n11*u;this.position.y+=this.matrix.n21*u;this.position.z+=this.matrix.n31*u};this.translateY=function(u){this.position.x+=this.matrix.n12*u;this.position.y+=this.matrix.n22*u;this.position.z+=this.matrix.n32*u};this.translateZ=function(u){this.position.x-=this.matrix.n13*u;this.position.y-=
-this.matrix.n23*u;this.position.z-=this.matrix.n33*u};this.rotateHorizontally=function(u){f.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);f.multiplyScalar(u);this.forward.subSelf(f);this.forward.normalize()};this.rotateVertically=function(u){d.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);d.multiplyScalar(u);this.forward.addSelf(d);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(u){u.preventDefault()},!1);this.domElement.addEventListener("mousemove",
-function(u){n=(u.clientX-A)/window.innerWidth;v=(u.clientY-w)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(u){u.preventDefault();u.stopPropagation();switch(u.button){case 0:k=1;break;case 2:k=-1}},!1);this.domElement.addEventListener("mouseup",function(u){u.preventDefault();u.stopPropagation();switch(u.button){case 0:k=0;break;case 2:k=0}},!1);this.domElement.addEventListener("keydown",function(u){switch(u.keyCode){case 38:case 87:k=1;break;case 37:case 65:m=-1;break;
-case 40:case 83:k=-1;break;case 39:case 68:m=1;break;case 81:j=!0;l=1;break;case 69:j=!0;l=-1;break;case 82:p=1;break;case 70:p=-1}},!1);this.domElement.addEventListener("keyup",function(u){switch(u.keyCode){case 38:case 87:k=0;break;case 37:case 65:m=0;break;case 40:case 83:k=0;break;case 39:case 68:m=0;break;case 81:j=!1;break;case 69:j=!1;break;case 82:p=0;break;case 70:p=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
+THREE.RollCamera=function(a,b,c,d){THREE.Camera.call(this,a,b,c,d);this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.domElement=document;this.matrixAutoUpdate=this.useTarget=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var e=new THREE.Vector3,f=new THREE.Vector3,g=new THREE.Vector3,j=new THREE.Matrix4,h=!1,l=1,k=0,n=0,p=0,o=0,t=0,v=window.innerWidth/2,u=window.innerHeight/2;this.update=
+function(){var a=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.delta=(a-this.lastUpdate)/1E3;this.lastUpdate=a;this.mouseLook&&(a=this.delta*this.lookSpeed,this.rotateHorizontally(a*o),this.rotateVertically(a*t));a=this.delta*this.movementSpeed;this.translateZ(a*(k>0||this.autoForward&&!(k<0)?1:k));this.translateX(a*n);this.translateY(a*p);h&&(this.roll+=this.rollSpeed*this.delta*l);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();
+else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();g.copy(this.forward);f.set(0,1,0);e.cross(f,g).normalize();f.cross(g,e).normalize();this.matrix.n11=e.x;this.matrix.n12=f.x;this.matrix.n13=g.x;this.matrix.n21=e.y;this.matrix.n22=f.y;this.matrix.n23=g.y;this.matrix.n31=e.z;this.matrix.n32=f.z;this.matrix.n33=g.z;j.identity();j.n11=Math.cos(this.roll);j.n12=-Math.sin(this.roll);j.n21=Math.sin(this.roll);j.n22=Math.cos(this.roll);this.matrix.multiplySelf(j);
+this.matrixWorldNeedsUpdate=!0;this.matrix.n14=this.position.x;this.matrix.n24=this.position.y;this.matrix.n34=this.position.z;this.supr.update.call(this)};this.translateX=function(a){this.position.x+=this.matrix.n11*a;this.position.y+=this.matrix.n21*a;this.position.z+=this.matrix.n31*a};this.translateY=function(a){this.position.x+=this.matrix.n12*a;this.position.y+=this.matrix.n22*a;this.position.z+=this.matrix.n32*a};this.translateZ=function(a){this.position.x-=this.matrix.n13*a;this.position.y-=
+this.matrix.n23*a;this.position.z-=this.matrix.n33*a};this.rotateHorizontally=function(a){e.set(this.matrix.n11,this.matrix.n21,this.matrix.n31);e.multiplyScalar(a);this.forward.subSelf(e);this.forward.normalize()};this.rotateVertically=function(a){f.set(this.matrix.n12,this.matrix.n22,this.matrix.n32);f.multiplyScalar(a);this.forward.addSelf(f);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",
+function(a){o=(a.clientX-v)/window.innerWidth;t=(a.clientY-u)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:k=1;break;case 2:k=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:k=0;break;case 2:k=0}},!1);this.domElement.addEventListener("keydown",function(a){switch(a.keyCode){case 38:case 87:k=1;break;case 37:case 65:n=-1;break;
+case 40:case 83:k=-1;break;case 39:case 68:n=1;break;case 81:h=!0;l=1;break;case 69:h=!0;l=-1;break;case 82:p=1;break;case 70:p=-1}},!1);this.domElement.addEventListener("keyup",function(a){switch(a.keyCode){case 38:case 87:k=0;break;case 37:case 65:n=0;break;case 40:case 83:k=0;break;case 39:case 68:n=0;break;case 81:h=!1;break;case 69:h=!1;break;case 82:p=0;break;case 70:p=0}},!1)};THREE.RollCamera.prototype=new THREE.Camera;THREE.RollCamera.prototype.constructor=THREE.RollCamera;
 THREE.RollCamera.prototype.supr=THREE.Camera.prototype;
-THREE.Cube=function(a,c,b,e,f,d,g,h,j){function l(w,u,y,o,z,B,I,K){var J,G,D=e||1,L=f||1,R=z/2,O=B/2,S=k.vertices.length;if(w=="x"&&u=="y"||w=="y"&&u=="x")J="z";else if(w=="x"&&u=="z"||w=="z"&&u=="x"){J="y";L=d||1}else if(w=="z"&&u=="y"||w=="y"&&u=="z"){J="x";D=d||1}var P=D+1,F=L+1;z/=D;var N=B/L;for(G=0;G<F;G++)for(B=0;B<P;B++){var Q=new THREE.Vector3;Q[w]=(B*z-R)*y;Q[u]=(G*N-O)*o;Q[J]=I;k.vertices.push(new THREE.Vertex(Q))}for(G=0;G<L;G++)for(B=0;B<D;B++){k.faces.push(new THREE.Face4(B+P*G+S,B+
-P*(G+1)+S,B+1+P*(G+1)+S,B+1+P*G+S,null,null,K));k.faceVertexUvs[0].push([new THREE.UV(B/D,G/L),new THREE.UV(B/D,(G+1)/L),new THREE.UV((B+1)/D,(G+1)/L),new THREE.UV((B+1)/D,G/L)])}}THREE.Geometry.call(this);var k=this,m=a/2,p=c/2,n=b/2;h=h?-1:1;if(g!==undefined)if(g instanceof Array)this.materials=g;else{this.materials=[];for(var v=0;v<6;v++)this.materials.push([g])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(j!=undefined)for(var A in j)this.sides[A]!=undefined&&(this.sides[A]=
-j[A]);this.sides.px&&l("z","y",1*h,-1,b,c,-m,this.materials[0]);this.sides.nx&&l("z","y",-1*h,-1,b,c,m,this.materials[1]);this.sides.py&&l("x","z",1*h,1,a,b,p,this.materials[2]);this.sides.ny&&l("x","z",1*h,-1,a,b,-p,this.materials[3]);this.sides.pz&&l("x","y",1*h,-1,a,c,n,this.materials[4]);this.sides.nz&&l("x","y",-1*h,-1,a,c,-n,this.materials[5]);(function(){for(var w=[],u=[],y=0,o=k.vertices.length;y<o;y++){for(var z=k.vertices[y],B=!1,I=0,K=w.length;I<K;I++){var J=w[I];if(z.position.x==J.position.x&&
-z.position.y==J.position.y&&z.position.z==J.position.z){u[y]=I;B=!0;break}}if(!B){u[y]=w.length;w.push(new THREE.Vertex(z.position.clone()))}}y=0;for(o=k.faces.length;y<o;y++){z=k.faces[y];z.a=u[z.a];z.b=u[z.b];z.c=u[z.c];z.d=u[z.d]}k.vertices=w})();this.computeCentroids();this.computeFaceNormals()};THREE.Cube.prototype=new THREE.Geometry;THREE.Cube.prototype.constructor=THREE.Cube;
-THREE.Cylinder=function(a,c,b,e,f,d){function g(p,n,v){h.vertices.push(new THREE.Vertex(new THREE.Vector3(p,n,v)))}THREE.Geometry.call(this);var h=this,j,l=Math.PI*2,k=e/2;for(j=0;j<a;j++)g(Math.sin(l*j/a)*c,Math.cos(l*j/a)*c,-k);for(j=0;j<a;j++)g(Math.sin(l*j/a)*b,Math.cos(l*j/a)*b,k);for(j=0;j<a;j++)h.faces.push(new THREE.Face4(j,j+a,a+(j+1)%a,(j+1)%a));if(b>0){g(0,0,-k-(d||0));for(j=a;j<a+a/2;j++)h.faces.push(new THREE.Face4(2*a,(2*j-2*a)%a,(2*j-2*a+1)%a,(2*j-2*a+2)%a))}if(c>0){g(0,0,k+(f||0));
-for(j=a+a/2;j<2*a;j++)h.faces.push(new THREE.Face4(2*a+1,(2*j-2*a+2)%a+a,(2*j-2*a+1)%a+a,(2*j-2*a)%a+a))}j=0;for(a=this.faces.length;j<a;j++){c=[];b=this.faces[j];f=this.vertices[b.a];d=this.vertices[b.b];k=this.vertices[b.c];var m=this.vertices[b.d];c.push(new THREE.UV(0.5+Math.atan2(f.position.x,f.position.y)/l,0.5+f.position.z/e));c.push(new THREE.UV(0.5+Math.atan2(d.position.x,d.position.y)/l,0.5+d.position.z/e));c.push(new THREE.UV(0.5+Math.atan2(k.position.x,k.position.y)/l,0.5+k.position.z/
-e));b instanceof THREE.Face4&&c.push(new THREE.UV(0.5+Math.atan2(m.position.x,m.position.y)/l,0.5+m.position.z/e));this.faceVertexUvs[0].push(c)}this.computeCentroids();this.computeFaceNormals()};THREE.Cylinder.prototype=new THREE.Geometry;THREE.Cylinder.prototype.constructor=THREE.Cylinder;
-THREE.Icosahedron=function(a){function c(m,p,n){var v=Math.sqrt(m*m+p*p+n*n);return f.vertices.push(new THREE.Vertex(new THREE.Vector3(m/v,p/v,n/v)))-1}function b(m,p,n,v){v.faces.push(new THREE.Face3(m,p,n))}function e(m,p){var n=f.vertices[m].position,v=f.vertices[p].position;return c((n.x+v.x)/2,(n.y+v.y)/2,(n.z+v.z)/2)}var f=this,d=new THREE.Geometry,g;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;c(-1,a,0);c(1,a,0);c(-1,-a,0);c(1,-a,0);c(0,-1,a);c(0,1,a);c(0,-1,-a);c(0,
-1,-a);c(a,0,-1);c(a,0,1);c(-a,0,-1);c(-a,0,1);b(0,11,5,d);b(0,5,1,d);b(0,1,7,d);b(0,7,10,d);b(0,10,11,d);b(1,5,9,d);b(5,11,4,d);b(11,10,2,d);b(10,7,6,d);b(7,1,8,d);b(3,9,4,d);b(3,4,2,d);b(3,2,6,d);b(3,6,8,d);b(3,8,9,d);b(4,9,5,d);b(2,4,11,d);b(6,2,10,d);b(8,6,7,d);b(9,8,1,d);for(a=0;a<this.subdivisions;a++){g=new THREE.Geometry;for(var h in d.faces){var j=e(d.faces[h].a,d.faces[h].b),l=e(d.faces[h].b,d.faces[h].c),k=e(d.faces[h].c,d.faces[h].a);b(d.faces[h].a,j,k,g);b(d.faces[h].b,l,j,g);b(d.faces[h].c,
-k,l,g);b(j,l,k,g)}d.faces=g.faces}f.faces=d.faces;delete d;delete g;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Icosahedron.prototype=new THREE.Geometry;THREE.Icosahedron.prototype.constructor=THREE.Icosahedron;
-THREE.Lathe=function(a,c,b){THREE.Geometry.call(this);this.steps=c||12;this.angle=b||2*Math.PI;c=this.angle/this.steps;b=[];for(var e=[],f=[],d=[],g=(new THREE.Matrix4).setRotationZ(c),h=0;h<a.length;h++){this.vertices.push(new THREE.Vertex(a[h]));b[h]=a[h].clone();e[h]=this.vertices.length-1}for(var j=0;j<=this.angle+0.001;j+=c){for(h=0;h<b.length;h++)if(j<this.angle){b[h]=g.multiplyVector3(b[h].clone());this.vertices.push(new THREE.Vertex(b[h]));f[h]=this.vertices.length-1}else f=d;j==0&&(d=e);
-for(h=0;h<e.length-1;h++){this.faces.push(new THREE.Face4(f[h],f[h+1],e[h+1],e[h]));this.faceVertexUvs[0].push([new THREE.UV(1-j/this.angle,h/a.length),new THREE.UV(1-j/this.angle,(h+1)/a.length),new THREE.UV(1-(j-c)/this.angle,(h+1)/a.length),new THREE.UV(1-(j-c)/this.angle,h/a.length)])}e=f;f=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Lathe.prototype=new THREE.Geometry;THREE.Lathe.prototype.constructor=THREE.Lathe;
-THREE.Plane=function(a,c,b,e){THREE.Geometry.call(this);var f,d=a/2,g=c/2;b=b||1;e=e||1;var h=b+1,j=e+1;a/=b;var l=c/e;for(f=0;f<j;f++)for(c=0;c<h;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*a-d,-(f*l-g),0)));for(f=0;f<e;f++)for(c=0;c<b;c++){this.faces.push(new THREE.Face4(c+h*f,c+h*(f+1),c+1+h*(f+1),c+1+h*f));this.faceVertexUvs[0].push([new THREE.UV(c/b,f/e),new THREE.UV(c/b,(f+1)/e),new THREE.UV((c+1)/b,(f+1)/e),new THREE.UV((c+1)/b,f/e)])}this.computeCentroids();this.computeFaceNormals()};
+THREE.Cube=function(a,b,c,d,e,f,g,j,h){function l(a,c,b,g,j,h,l,n){var o,p,t=d||1,v=e||1,K=j/2,H=h/2,L=k.vertices.length;if(a=="x"&&c=="y"||a=="y"&&c=="x")o="z";else if(a=="x"&&c=="z"||a=="z"&&c=="x")o="y",v=f||1;else if(a=="z"&&c=="y"||a=="y"&&c=="z")o="x",t=f||1;var I=t+1,z=v+1;j/=t;var G=h/v;for(p=0;p<z;p++)for(h=0;h<I;h++){var J=new THREE.Vector3;J[a]=(h*j-K)*b;J[c]=(p*G-H)*g;J[o]=l;k.vertices.push(new THREE.Vertex(J))}for(p=0;p<v;p++)for(h=0;h<t;h++)k.faces.push(new THREE.Face4(h+I*p+L,h+I*(p+
+1)+L,h+1+I*(p+1)+L,h+1+I*p+L,null,null,n)),k.faceVertexUvs[0].push([new THREE.UV(h/t,p/v),new THREE.UV(h/t,(p+1)/v),new THREE.UV((h+1)/t,(p+1)/v),new THREE.UV((h+1)/t,p/v)])}THREE.Geometry.call(this);var k=this,n=a/2,p=b/2,o=c/2,j=j?-1:1;if(g!==void 0)if(g instanceof Array)this.materials=g;else{this.materials=[];for(var t=0;t<6;t++)this.materials.push([g])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(h!=void 0)for(var v in h)this.sides[v]!=void 0&&(this.sides[v]=h[v]);
+this.sides.px&&l("z","y",1*j,-1,c,b,-n,this.materials[0]);this.sides.nx&&l("z","y",-1*j,-1,c,b,n,this.materials[1]);this.sides.py&&l("x","z",1*j,1,a,c,p,this.materials[2]);this.sides.ny&&l("x","z",1*j,-1,a,c,-p,this.materials[3]);this.sides.pz&&l("x","y",1*j,-1,a,b,o,this.materials[4]);this.sides.nz&&l("x","y",-1*j,-1,a,b,-o,this.materials[5]);(function(){for(var a=[],c=[],d=0,b=k.vertices.length;d<b;d++){for(var f=k.vertices[d],g=!1,e=0,j=a.length;e<j;e++){var h=a[e];if(f.position.x==h.position.x&&
+f.position.y==h.position.y&&f.position.z==h.position.z){c[d]=e;g=!0;break}}if(!g)c[d]=a.length,a.push(new THREE.Vertex(f.position.clone()))}d=0;for(b=k.faces.length;d<b;d++)f=k.faces[d],f.a=c[f.a],f.b=c[f.b],f.c=c[f.c],f.d=c[f.d];k.vertices=a})();this.computeCentroids();this.computeFaceNormals()};THREE.Cube.prototype=new THREE.Geometry;THREE.Cube.prototype.constructor=THREE.Cube;
+THREE.Cylinder=function(a,b,c,d,e,f){function g(a,c,d){j.vertices.push(new THREE.Vertex(new THREE.Vector3(a,c,d)))}THREE.Geometry.call(this);var j=this,h,l=Math.PI*2,k=d/2;for(h=0;h<a;h++)g(Math.sin(l*h/a)*b,Math.cos(l*h/a)*b,-k);for(h=0;h<a;h++)g(Math.sin(l*h/a)*c,Math.cos(l*h/a)*c,k);for(h=0;h<a;h++)j.faces.push(new THREE.Face4(h,h+a,a+(h+1)%a,(h+1)%a));if(c>0){g(0,0,-k-(f||0));for(h=a;h<a+a/2;h++)j.faces.push(new THREE.Face4(2*a,(2*h-2*a)%a,(2*h-2*a+1)%a,(2*h-2*a+2)%a))}if(b>0){g(0,0,k+(e||0));
+for(h=a+a/2;h<2*a;h++)j.faces.push(new THREE.Face4(2*a+1,(2*h-2*a+2)%a+a,(2*h-2*a+1)%a+a,(2*h-2*a)%a+a))}h=0;for(a=this.faces.length;h<a;h++){var b=[],c=this.faces[h],e=this.vertices[c.a],f=this.vertices[c.b],k=this.vertices[c.c],n=this.vertices[c.d];b.push(new THREE.UV(0.5+Math.atan2(e.position.x,e.position.y)/l,0.5+e.position.z/d));b.push(new THREE.UV(0.5+Math.atan2(f.position.x,f.position.y)/l,0.5+f.position.z/d));b.push(new THREE.UV(0.5+Math.atan2(k.position.x,k.position.y)/l,0.5+k.position.z/
+d));c instanceof THREE.Face4&&b.push(new THREE.UV(0.5+Math.atan2(n.position.x,n.position.y)/l,0.5+n.position.z/d));this.faceVertexUvs[0].push(b)}this.computeCentroids();this.computeFaceNormals()};THREE.Cylinder.prototype=new THREE.Geometry;THREE.Cylinder.prototype.constructor=THREE.Cylinder;
+THREE.Icosahedron=function(a){function b(a,c,d){var b=Math.sqrt(a*a+c*c+d*d);return e.vertices.push(new THREE.Vertex(new THREE.Vector3(a/b,c/b,d/b)))-1}function c(a,c,d,b){b.faces.push(new THREE.Face3(a,c,d))}function d(a,c){var d=e.vertices[a].position,f=e.vertices[c].position;return b((d.x+f.x)/2,(d.y+f.y)/2,(d.z+f.z)/2)}var e=this,f=new THREE.Geometry,g;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;b(-1,a,0);b(1,a,0);b(-1,-a,0);b(1,-a,0);b(0,-1,a);b(0,1,a);b(0,-1,-a);b(0,
+1,-a);b(a,0,-1);b(a,0,1);b(-a,0,-1);b(-a,0,1);c(0,11,5,f);c(0,5,1,f);c(0,1,7,f);c(0,7,10,f);c(0,10,11,f);c(1,5,9,f);c(5,11,4,f);c(11,10,2,f);c(10,7,6,f);c(7,1,8,f);c(3,9,4,f);c(3,4,2,f);c(3,2,6,f);c(3,6,8,f);c(3,8,9,f);c(4,9,5,f);c(2,4,11,f);c(6,2,10,f);c(8,6,7,f);c(9,8,1,f);for(a=0;a<this.subdivisions;a++){g=new THREE.Geometry;for(var j in f.faces){var h=d(f.faces[j].a,f.faces[j].b),l=d(f.faces[j].b,f.faces[j].c),k=d(f.faces[j].c,f.faces[j].a);c(f.faces[j].a,h,k,g);c(f.faces[j].b,l,h,g);c(f.faces[j].c,
+k,l,g);c(h,l,k,g)}f.faces=g.faces}e.faces=f.faces;delete f;delete g;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Icosahedron.prototype=new THREE.Geometry;THREE.Icosahedron.prototype.constructor=THREE.Icosahedron;
+THREE.Lathe=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],e=[],f=[],g=(new THREE.Matrix4).setRotationZ(b),j=0;j<a.length;j++)this.vertices.push(new THREE.Vertex(a[j])),c[j]=a[j].clone(),d[j]=this.vertices.length-1;for(var h=0;h<=this.angle+0.001;h+=b){for(j=0;j<c.length;j++)h<this.angle?(c[j]=g.multiplyVector3(c[j].clone()),this.vertices.push(new THREE.Vertex(c[j])),e[j]=this.vertices.length-1):e=f;h==0&&(f=d);for(j=0;j<
+d.length-1;j++)this.faces.push(new THREE.Face4(e[j],e[j+1],d[j+1],d[j])),this.faceVertexUvs[0].push([new THREE.UV(1-h/this.angle,j/a.length),new THREE.UV(1-h/this.angle,(j+1)/a.length),new THREE.UV(1-(h-b)/this.angle,(j+1)/a.length),new THREE.UV(1-(h-b)/this.angle,j/a.length)]);d=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Lathe.prototype=new THREE.Geometry;THREE.Lathe.prototype.constructor=THREE.Lathe;
+THREE.Plane=function(a,b,c,d){THREE.Geometry.call(this);var e,f=a/2,g=b/2,c=c||1,d=d||1,j=c+1,h=d+1;a/=c;var l=b/d;for(e=0;e<h;e++)for(b=0;b<j;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*a-f,-(e*l-g),0)));for(e=0;e<d;e++)for(b=0;b<c;b++)this.faces.push(new THREE.Face4(b+j*e,b+j*(e+1),b+1+j*(e+1),b+1+j*e)),this.faceVertexUvs[0].push([new THREE.UV(b/c,e/d),new THREE.UV(b/c,(e+1)/d),new THREE.UV((b+1)/c,(e+1)/d),new THREE.UV((b+1)/c,e/d)]);this.computeCentroids();this.computeFaceNormals()};
 THREE.Plane.prototype=new THREE.Geometry;THREE.Plane.prototype.constructor=THREE.Plane;
-THREE.Sphere=function(a,c,b){THREE.Geometry.call(this);var e,f=Math.PI,d=Math.max(3,c||8),g=Math.max(2,b||6);c=[];for(b=0;b<g+1;b++){e=b/g;var h=a*Math.cos(e*f),j=a*Math.sin(e*f),l=[],k=0;for(e=0;e<d;e++){var m=2*e/d,p=j*Math.sin(m*f);m=j*Math.cos(m*f);(b==0||b==g)&&e>0||(k=this.vertices.push(new THREE.Vertex(new THREE.Vector3(m,h,p)))-1);l.push(k)}c.push(l)}var n,v,A;f=c.length;for(b=0;b<f;b++){d=c[b].length;if(b>0)for(e=0;e<d;e++){l=e==d-1;g=c[b][l?0:e+1];h=c[b][l?d-1:e];j=c[b-1][l?d-1:e];l=c[b-
-1][l?0:e+1];p=b/(f-1);n=(b-1)/(f-1);v=(e+1)/d;m=e/d;k=new THREE.UV(1-v,p);p=new THREE.UV(1-m,p);m=new THREE.UV(1-m,n);var w=new THREE.UV(1-v,n);if(b<c.length-1){n=this.vertices[g].position.clone();v=this.vertices[h].position.clone();A=this.vertices[j].position.clone();n.normalize();v.normalize();A.normalize();this.faces.push(new THREE.Face3(g,h,j,[new THREE.Vector3(n.x,n.y,n.z),new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(A.x,A.y,A.z)]));this.faceVertexUvs[0].push([k,p,m])}if(b>1){n=this.vertices[g].position.clone();
-v=this.vertices[j].position.clone();A=this.vertices[l].position.clone();n.normalize();v.normalize();A.normalize();this.faces.push(new THREE.Face3(g,j,l,[new THREE.Vector3(n.x,n.y,n.z),new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(A.x,A.y,A.z)]));this.faceVertexUvs[0].push([k,m,w])}}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.Sphere.prototype=new THREE.Geometry;THREE.Sphere.prototype.constructor=THREE.Sphere;
-THREE.Torus=function(a,c,b,e){THREE.Geometry.call(this);this.radius=a||100;this.tube=c||40;this.segmentsR=b||8;this.segmentsT=e||6;a=[];for(c=0;c<=this.segmentsR;++c)for(b=0;b<=this.segmentsT;++b){e=b/this.segmentsT*2*Math.PI;var f=c/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(f))*Math.cos(e),(this.radius+this.tube*Math.cos(f))*Math.sin(e),this.tube*Math.sin(f))));a.push([b/this.segmentsT,1-c/this.segmentsR])}for(c=1;c<=this.segmentsR;++c)for(b=
-1;b<=this.segmentsT;++b){e=(this.segmentsT+1)*c+b;f=(this.segmentsT+1)*c+b-1;var d=(this.segmentsT+1)*(c-1)+b-1,g=(this.segmentsT+1)*(c-1)+b;this.faces.push(new THREE.Face4(e,f,d,g));this.faceVertexUvs[0].push([new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[d][0],a[d][1]),new THREE.UV(a[g][0],a[g][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Torus.prototype=new THREE.Geometry;THREE.Torus.prototype.constructor=THREE.Torus;
-THREE.TorusKnot=function(a,c,b,e,f,d,g){function h(m,p,n,v,A,w){p=n/v*m;n=Math.cos(p);return new THREE.Vector3(A*(2+n)*0.5*Math.cos(m),A*(2+n)*Math.sin(m)*0.5,w*A*Math.sin(p)*0.5)}THREE.Geometry.call(this);this.radius=a||200;this.tube=c||40;this.segmentsR=b||64;this.segmentsT=e||8;this.p=f||2;this.q=d||3;this.heightScale=g||1;this.grid=Array(this.segmentsR);b=new THREE.Vector3;e=new THREE.Vector3;d=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=Array(this.segmentsT);for(c=0;c<this.segmentsT;++c){var j=
-a/this.segmentsR*2*this.p*Math.PI;g=c/this.segmentsT*2*Math.PI;f=h(j,g,this.q,this.p,this.radius,this.heightScale);j=h(j+0.01,g,this.q,this.p,this.radius,this.heightScale);b.x=j.x-f.x;b.y=j.y-f.y;b.z=j.z-f.z;e.x=j.x+f.x;e.y=j.y+f.y;e.z=j.z+f.z;d.cross(b,e);e.cross(d,b);d.normalize();e.normalize();j=-this.tube*Math.cos(g);g=this.tube*Math.sin(g);f.x+=j*e.x+g*d.x;f.y+=j*e.y+g*d.y;f.z+=j*e.z+g*d.z;this.grid[a][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z)))-1}}for(a=0;a<this.segmentsR;++a)for(c=
-0;c<this.segmentsT;++c){e=(a+1)%this.segmentsR;d=(c+1)%this.segmentsT;f=this.grid[a][c];b=this.grid[e][c];e=this.grid[e][d];d=this.grid[a][d];g=new THREE.UV(a/this.segmentsR,c/this.segmentsT);j=new THREE.UV((a+1)/this.segmentsR,c/this.segmentsT);var l=new THREE.UV((a+1)/this.segmentsR,(c+1)/this.segmentsT),k=new THREE.UV(a/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face4(f,b,e,d));this.faceVertexUvs[0].push([g,j,l,k])}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};
+THREE.Sphere=function(a,b,c){THREE.Geometry.call(this);for(var d,e=Math.PI,f=Math.max(3,b||8),g=Math.max(2,c||6),b=[],c=0;c<g+1;c++){d=c/g;var j=a*Math.cos(d*e),h=a*Math.sin(d*e),l=[],k=0;for(d=0;d<f;d++){var n=2*d/f,p=h*Math.sin(n*e),n=h*Math.cos(n*e);(c==0||c==g)&&d>0||(k=this.vertices.push(new THREE.Vertex(new THREE.Vector3(n,j,p)))-1);l.push(k)}b.push(l)}for(var o,t,v,e=b.length,c=0;c<e;c++)if(f=b[c].length,c>0)for(d=0;d<f;d++){l=d==f-1;g=b[c][l?0:d+1];j=b[c][l?f-1:d];h=b[c-1][l?f-1:d];l=b[c-
+1][l?0:d+1];p=c/(e-1);o=(c-1)/(e-1);t=(d+1)/f;var n=d/f,k=new THREE.UV(1-t,p),p=new THREE.UV(1-n,p),n=new THREE.UV(1-n,o),u=new THREE.UV(1-t,o);c<b.length-1&&(o=this.vertices[g].position.clone(),t=this.vertices[j].position.clone(),v=this.vertices[h].position.clone(),o.normalize(),t.normalize(),v.normalize(),this.faces.push(new THREE.Face3(g,j,h,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([k,p,n]));c>1&&(o=this.vertices[g].position.clone(),
+t=this.vertices[h].position.clone(),v=this.vertices[l].position.clone(),o.normalize(),t.normalize(),v.normalize(),this.faces.push(new THREE.Face3(g,h,l,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([k,n,u]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.Sphere.prototype=new THREE.Geometry;THREE.Sphere.prototype.constructor=THREE.Sphere;
+THREE.Torus=function(a,b,c,d){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=d||6;a=[];for(b=0;b<=this.segmentsR;++b)for(c=0;c<=this.segmentsT;++c){var d=c/this.segmentsT*2*Math.PI,e=b/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(e))*Math.cos(d),(this.radius+this.tube*Math.cos(e))*Math.sin(d),this.tube*Math.sin(e))));a.push([c/this.segmentsT,1-b/this.segmentsR])}for(b=1;b<=this.segmentsR;++b)for(c=
+1;c<=this.segmentsT;++c){var d=(this.segmentsT+1)*b+c,e=(this.segmentsT+1)*b+c-1,f=(this.segmentsT+1)*(b-1)+c-1,g=(this.segmentsT+1)*(b-1)+c;this.faces.push(new THREE.Face4(d,e,f,g));this.faceVertexUvs[0].push([new THREE.UV(a[d][0],a[d][1]),new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[g][0],a[g][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Torus.prototype=new THREE.Geometry;THREE.Torus.prototype.constructor=THREE.Torus;
+THREE.TorusKnot=function(a,b,c,d,e,f,g){function j(a,c,d,b,f,g){c=d/b*a;d=Math.cos(c);return new THREE.Vector3(f*(2+d)*0.5*Math.cos(a),f*(2+d)*Math.sin(a)*0.5,g*f*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=a||200;this.tube=b||40;this.segmentsR=c||64;this.segmentsT=d||8;this.p=e||2;this.q=f||3;this.heightScale=g||1;this.grid=Array(this.segmentsR);c=new THREE.Vector3;d=new THREE.Vector3;f=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=Array(this.segmentsT);for(b=0;b<this.segmentsT;++b){var h=
+a/this.segmentsR*2*this.p*Math.PI,g=b/this.segmentsT*2*Math.PI,e=j(h,g,this.q,this.p,this.radius,this.heightScale),h=j(h+0.01,g,this.q,this.p,this.radius,this.heightScale);c.x=h.x-e.x;c.y=h.y-e.y;c.z=h.z-e.z;d.x=h.x+e.x;d.y=h.y+e.y;d.z=h.z+e.z;f.cross(c,d);d.cross(f,c);f.normalize();d.normalize();h=-this.tube*Math.cos(g);g=this.tube*Math.sin(g);e.x+=h*d.x+g*f.x;e.y+=h*d.y+g*f.y;e.z+=h*d.z+g*f.z;this.grid[a][b]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(e.x,e.y,e.z)))-1}}for(a=0;a<this.segmentsR;++a)for(b=
+0;b<this.segmentsT;++b){var d=(a+1)%this.segmentsR,f=(b+1)%this.segmentsT,e=this.grid[a][b],c=this.grid[d][b],d=this.grid[d][f],f=this.grid[a][f],g=new THREE.UV(a/this.segmentsR,b/this.segmentsT),h=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT),l=new THREE.UV((a+1)/this.segmentsR,(b+1)/this.segmentsT),k=new THREE.UV(a/this.segmentsR,(b+1)/this.segmentsT);this.faces.push(new THREE.Face4(e,c,d,f));this.faceVertexUvs[0].push([g,h,l,k])}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};
 THREE.TorusKnot.prototype=new THREE.Geometry;THREE.TorusKnot.prototype.constructor=THREE.TorusKnot;THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
-THREE.Loader.prototype={addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var c="Loaded ";c+=a.total?(100*a.loaded/a.total).toFixed(0)+"%":(a.loaded/1E3).toFixed(2)+" KB";
-this.statusDomElement.innerHTML=c},extractUrlbase:function(a){a=a.split("/");a.pop();return a.join("/")},init_materials:function(a,c,b){a.materials=[];for(var e=0;e<c.length;++e)a.materials[e]=[THREE.Loader.prototype.createMaterial(c[e],b)]},createMaterial:function(a,c){function b(h){h=Math.log(h)/Math.LN2;return Math.floor(h)==h}function e(h,j){var l=new Image;l.onload=function(){if(!b(this.width)||!b(this.height)){var k=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),m=Math.pow(2,Math.round(Math.log(this.height)/
-Math.LN2));h.image.width=k;h.image.height=m;h.image.getContext("2d").drawImage(this,0,0,k,m)}else h.image=this;h.needsUpdate=!0};l.src=j}var f,d,g;f="MeshLambertMaterial";d={color:15658734,opacity:1,map:null,lightMap:null,wireframe:a.wireframe};if(a.shading)if(a.shading=="Phong")f="MeshPhongMaterial";else a.shading=="Basic"&&(f="MeshBasicMaterial");if(a.blending)if(a.blending=="Additive")d.blending=THREE.AdditiveBlending;else if(a.blending=="Subtractive")d.blending=THREE.SubtractiveBlending;else if(a.blending==
-"Multiply")d.blending=THREE.MultiplyBlending;if(a.transparent!==undefined||a.opacity<1)d.transparent=a.transparent;if(a.depthTest!==undefined)d.depthTest=a.depthTest;if(a.vertexColors!==undefined)if(a.vertexColors=="face")d.vertexColors=THREE.FaceColors;else if(a.vertexColors)d.vertexColors=THREE.VertexColors;if(a.mapDiffuse&&c){g=document.createElement("canvas");d.map=new THREE.Texture(g);d.map.sourceFile=a.mapDiffuse;e(d.map,c+"/"+a.mapDiffuse)}else if(a.colorDiffuse){g=(a.colorDiffuse[0]*255<<
-16)+(a.colorDiffuse[1]*255<<8)+a.colorDiffuse[2]*255;d.color=g;d.opacity=a.transparency}else if(a.DbgColor)d.color=a.DbgColor;if(a.mapLightmap&&c){g=document.createElement("canvas");d.lightMap=new THREE.Texture(g);d.lightMap.sourceFile=a.mapLightmap;e(d.lightMap,c+"/"+a.mapLightmap)}return new THREE[f](d)}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;
-THREE.JSONLoader.prototype.load=function(a){var c=this,b=a.model,e=a.callback,f=a.texture_path?a.texture_path:this.extractUrlbase(b);a=new Worker(b);a.onmessage=function(d){c.createModel(d.data,e,f);c.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
-THREE.JSONLoader.prototype.createModel=function(a,c,b){var e=new THREE.Geometry,f=a.scale!==undefined?1/a.scale:1;this.init_materials(e,a.materials,b);(function(d){if(a.version===undefined||a.version!=2)console.error("Deprecated file format.");else{var g,h,j,l,k,m,p,n,v,A,w,u,y,o,z=a.faces;m=a.vertices;var B=a.normals,I=a.colors,K=0;for(g=0;g<a.uvs.length;g++)a.uvs[g].length&&K++;for(g=0;g<K;g++){e.faceUvs[g]=[];e.faceVertexUvs[g]=[]}l=0;for(k=m.length;l<k;){p=new THREE.Vertex;p.position.x=m[l++]*
-d;p.position.y=m[l++]*d;p.position.z=m[l++]*d;e.vertices.push(p)}l=0;for(k=z.length;l<k;){d=z[l++];m=d&1;j=d&2;g=d&4;h=d&8;n=d&16;p=d&32;A=d&64;d&=128;if(m){w=new THREE.Face4;w.a=z[l++];w.b=z[l++];w.c=z[l++];w.d=z[l++];m=4}else{w=new THREE.Face3;w.a=z[l++];w.b=z[l++];w.c=z[l++];m=3}if(j){j=z[l++];w.materials=e.materials[j]}j=e.faces.length;if(g)for(g=0;g<K;g++){u=a.uvs[g];v=z[l++];o=u[v*2];v=u[v*2+1];e.faceUvs[g][j]=new THREE.UV(o,v)}if(h)for(g=0;g<K;g++){u=a.uvs[g];y=[];for(h=0;h<m;h++){v=z[l++];
-o=u[v*2];v=u[v*2+1];y[h]=new THREE.UV(o,v)}e.faceVertexUvs[g][j]=y}if(n){n=z[l++]*3;h=new THREE.Vector3;h.x=B[n++];h.y=B[n++];h.z=B[n];w.normal=h}if(p)for(g=0;g<m;g++){n=z[l++]*3;h=new THREE.Vector3;h.x=B[n++];h.y=B[n++];h.z=B[n];w.vertexNormals.push(h)}if(A){p=z[l++];p=new THREE.Color(I[p]);w.color=p}if(d)for(g=0;g<m;g++){p=z[l++];p=new THREE.Color(I[p]);w.vertexColors.push(p)}e.faces.push(w)}}})(f);(function(){var d,g,h,j;if(a.skinWeights){d=0;for(g=a.skinWeights.length;d<g;d+=2){h=a.skinWeights[d];
-j=a.skinWeights[d+1];e.skinWeights.push(new THREE.Vector4(h,j,0,0))}}if(a.skinIndices){d=0;for(g=a.skinIndices.length;d<g;d+=2){h=a.skinIndices[d];j=a.skinIndices[d+1];e.skinIndices.push(new THREE.Vector4(h,j,0,0))}}e.bones=a.bones;e.animation=a.animation})();(function(d){if(a.morphTargets!==undefined){var g,h,j,l,k,m,p,n,v;g=0;for(h=a.morphTargets.length;g<h;g++){e.morphTargets[g]={};e.morphTargets[g].name=a.morphTargets[g].name;e.morphTargets[g].vertices=[];n=e.morphTargets[g].vertices;v=a.morphTargets[g].vertices;
-j=0;for(l=v.length;j<l;j+=3){k=v[j]*d;m=v[j+1]*d;p=v[j+2]*d;n.push(new THREE.Vertex(new THREE.Vector3(k,m,p)))}}}if(a.morphColors!==undefined){g=0;for(h=a.morphColors.length;g<h;g++){e.morphColors[g]={};e.morphColors[g].name=a.morphColors[g].name;e.morphColors[g].colors=[];l=e.morphColors[g].colors;k=a.morphColors[g].colors;d=0;for(j=k.length;d<j;d+=3){m=new THREE.Color(16755200);m.setRGB(k[d],k[d+1],k[d+2]);l.push(m)}}}})(f);(function(){if(a.edges!==undefined){var d,g,h;for(d=0;d<a.edges.length;d+=
-2){g=a.edges[d];h=a.edges[d+1];e.edges.push(new THREE.Edge(e.vertices[g],e.vertices[h],g,h))}}})();e.computeFaceNormals();c(e)};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
-THREE.BinaryLoader.prototype={load:function(a){var c=a.model,b=a.callback,e=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(c),f=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(c);a=(new Date).getTime();c=new Worker(c);var d=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(g){THREE.BinaryLoader.prototype.loadAjaxBuffers(g.data.buffers,g.data.materials,b,f,e,d)};c.onerror=function(g){alert("worker.onerror: "+g.message+"\n"+g.data);g.preventDefault()};
-c.postMessage(a)},loadAjaxBuffers:function(a,c,b,e,f,d){var g=new XMLHttpRequest,h=e+"/"+a,j=0;g.onreadystatechange=function(){if(g.readyState==4)g.status==200||g.status==0?THREE.BinaryLoader.prototype.createBinModel(g.responseText,b,f,c):alert("Couldn't load ["+h+"] ["+g.status+"]");else if(g.readyState==3){if(d){j==0&&(j=g.getResponseHeader("Content-Length"));d({total:j,loaded:g.responseText.length})}}else g.readyState==2&&(j=g.getResponseHeader("Content-Length"))};g.open("GET",h,!0);g.overrideMimeType("text/plain; charset=x-user-defined");
-g.setRequestHeader("Content-Type","text/plain");g.send(null)},createBinModel:function(a,c,b,e){var f=function(d){function g(t,x){var C=k(t,x),E=k(t,x+1),H=k(t,x+2),T=k(t,x+3),V=(T<<1&255|H>>7)-127;C|=(H&127)<<16|E<<8;if(C==0&&V==-127)return 0;return(1-2*(T>>7))*(1+C*Math.pow(2,-23))*Math.pow(2,V)}function h(t,x){var C=k(t,x),E=k(t,x+1),H=k(t,x+2);return(k(t,x+3)<<24)+(H<<16)+(E<<8)+C}function j(t,x){var C=k(t,x);return(k(t,x+1)<<8)+C}function l(t,x){var C=k(t,x);return C>127?C-256:C}function k(t,
-x){return t.charCodeAt(x)&255}function m(t){var x,C,E;x=h(a,t);C=h(a,t+I);E=h(a,t+K);t=j(a,t+J);THREE.BinaryLoader.prototype.f3(u,x,C,E,t)}function p(t){var x,C,E,H,T,V;x=h(a,t);C=h(a,t+I);E=h(a,t+K);H=j(a,t+J);T=h(a,t+G);V=h(a,t+D);t=h(a,t+L);THREE.BinaryLoader.prototype.f3n(u,z,x,C,E,H,T,V,t)}function n(t){var x,C,E,H;x=h(a,t);C=h(a,t+R);E=h(a,t+O);H=h(a,t+S);t=j(a,t+P);THREE.BinaryLoader.prototype.f4(u,x,C,E,H,t)}function v(t){var x,C,E,H,T,V,ca,da;x=h(a,t);C=h(a,t+R);E=h(a,t+O);H=h(a,t+S);T=j(a,
-t+P);V=h(a,t+F);ca=h(a,t+N);da=h(a,t+Q);t=h(a,t+U);THREE.BinaryLoader.prototype.f4n(u,z,x,C,E,H,T,V,ca,da,t)}function A(t){var x,C;x=h(a,t);C=h(a,t+M);t=h(a,t+W);THREE.BinaryLoader.prototype.uv3(u.faceVertexUvs[0],B[x*2],B[x*2+1],B[C*2],B[C*2+1],B[t*2],B[t*2+1])}function w(t){var x,C,E;x=h(a,t);C=h(a,t+ea);E=h(a,t+fa);t=h(a,t+ga);THREE.BinaryLoader.prototype.uv4(u.faceVertexUvs[0],B[x*2],B[x*2+1],B[C*2],B[C*2+1],B[E*2],B[E*2+1],B[t*2],B[t*2+1])}var u=this,y=0,o,z=[],B=[],I,K,J,G,D,L,R,O,S,P,F,N,Q,
-U,M,W,ea,fa,ga,Y,Z,$,aa,ba,X;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(u,e,d);o={signature:a.substr(y,8),header_bytes:k(a,y+8),vertex_coordinate_bytes:k(a,y+9),normal_coordinate_bytes:k(a,y+10),uv_coordinate_bytes:k(a,y+11),vertex_index_bytes:k(a,y+12),normal_index_bytes:k(a,y+13),uv_index_bytes:k(a,y+14),material_index_bytes:k(a,y+15),nvertices:h(a,y+16),nnormals:h(a,y+16+4),nuvs:h(a,y+16+8),ntri_flat:h(a,y+16+12),ntri_smooth:h(a,y+16+16),ntri_flat_uv:h(a,y+16+20),ntri_smooth_uv:h(a,
-y+16+24),nquad_flat:h(a,y+16+28),nquad_smooth:h(a,y+16+32),nquad_flat_uv:h(a,y+16+36),nquad_smooth_uv:h(a,y+16+40)};y+=o.header_bytes;I=o.vertex_index_bytes;K=o.vertex_index_bytes*2;J=o.vertex_index_bytes*3;G=o.vertex_index_bytes*3+o.material_index_bytes;D=o.vertex_index_bytes*3+o.material_index_bytes+o.normal_index_bytes;L=o.vertex_index_bytes*3+o.material_index_bytes+o.normal_index_bytes*2;R=o.vertex_index_bytes;O=o.vertex_index_bytes*2;S=o.vertex_index_bytes*3;P=o.vertex_index_bytes*4;F=o.vertex_index_bytes*
-4+o.material_index_bytes;N=o.vertex_index_bytes*4+o.material_index_bytes+o.normal_index_bytes;Q=o.vertex_index_bytes*4+o.material_index_bytes+o.normal_index_bytes*2;U=o.vertex_index_bytes*4+o.material_index_bytes+o.normal_index_bytes*3;M=o.uv_index_bytes;W=o.uv_index_bytes*2;ea=o.uv_index_bytes;fa=o.uv_index_bytes*2;ga=o.uv_index_bytes*3;d=o.vertex_index_bytes*3+o.material_index_bytes;X=o.vertex_index_bytes*4+o.material_index_bytes;Y=o.ntri_flat*d;Z=o.ntri_smooth*(d+o.normal_index_bytes*3);$=o.ntri_flat_uv*
-(d+o.uv_index_bytes*3);aa=o.ntri_smooth_uv*(d+o.normal_index_bytes*3+o.uv_index_bytes*3);ba=o.nquad_flat*X;d=o.nquad_smooth*(X+o.normal_index_bytes*4);X=o.nquad_flat_uv*(X+o.uv_index_bytes*4);y+=function(t){for(var x,C,E,H=o.vertex_coordinate_bytes*3,T=t+o.nvertices*H;t<T;t+=H){x=g(a,t);C=g(a,t+o.vertex_coordinate_bytes);E=g(a,t+o.vertex_coordinate_bytes*2);THREE.BinaryLoader.prototype.v(u,x,C,E)}return o.nvertices*H}(y);y+=function(t){for(var x,C,E,H=o.normal_coordinate_bytes*3,T=t+o.nnormals*H;t<
-T;t+=H){x=l(a,t);C=l(a,t+o.normal_coordinate_bytes);E=l(a,t+o.normal_coordinate_bytes*2);z.push(x/127,C/127,E/127)}return o.nnormals*H}(y);y+=function(t){for(var x,C,E=o.uv_coordinate_bytes*2,H=t+o.nuvs*E;t<H;t+=E){x=g(a,t);C=g(a,t+o.uv_coordinate_bytes);B.push(x,C)}return o.nuvs*E}(y);Y=y+Y;Z=Y+Z;$=Z+$;aa=$+aa;ba=aa+ba;d=ba+d;X=d+X;(function(t){var x,C=o.vertex_index_bytes*3+o.material_index_bytes,E=C+o.uv_index_bytes*3,H=t+o.ntri_flat_uv*E;for(x=t;x<H;x+=E){m(x);A(x+C)}return H-t})(Z);(function(t){var x,
-C=o.vertex_index_bytes*3+o.material_index_bytes+o.normal_index_bytes*3,E=C+o.uv_index_bytes*3,H=t+o.ntri_smooth_uv*E;for(x=t;x<H;x+=E){p(x);A(x+C)}return H-t})($);(function(t){var x,C=o.vertex_index_bytes*4+o.material_index_bytes,E=C+o.uv_index_bytes*4,H=t+o.nquad_flat_uv*E;for(x=t;x<H;x+=E){n(x);w(x+C)}return H-t})(d);(function(t){var x,C=o.vertex_index_bytes*4+o.material_index_bytes+o.normal_index_bytes*4,E=C+o.uv_index_bytes*4,H=t+o.nquad_smooth_uv*E;for(x=t;x<H;x+=E){v(x);w(x+C)}return H-t})(X);
-(function(t){var x,C=o.vertex_index_bytes*3+o.material_index_bytes,E=t+o.ntri_flat*C;for(x=t;x<E;x+=C)m(x);return E-t})(y);(function(t){var x,C=o.vertex_index_bytes*3+o.material_index_bytes+o.normal_index_bytes*3,E=t+o.ntri_smooth*C;for(x=t;x<E;x+=C)p(x);return E-t})(Y);(function(t){var x,C=o.vertex_index_bytes*4+o.material_index_bytes,E=t+o.nquad_flat*C;for(x=t;x<E;x+=C)n(x);return E-t})(aa);(function(t){var x,C=o.vertex_index_bytes*4+o.material_index_bytes+o.normal_index_bytes*4,E=t+o.nquad_smooth*
-C;for(x=t;x<E;x+=C)v(x);return E-t})(ba);this.computeCentroids();this.computeFaceNormals()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;c(new f(b))},v:function(a,c,b,e){a.vertices.push(new THREE.Vertex(new THREE.Vector3(c,b,e)))},f3:function(a,c,b,e,f){a.faces.push(new THREE.Face3(c,b,e,null,null,a.materials[f]))},f4:function(a,c,b,e,f,d){a.faces.push(new THREE.Face4(c,b,e,f,null,null,a.materials[d]))},f3n:function(a,c,b,e,f,d,g,h,j){d=a.materials[d];var l=c[h*3],k=c[h*3+1];h=c[h*3+2];
-var m=c[j*3],p=c[j*3+1];j=c[j*3+2];a.faces.push(new THREE.Face3(b,e,f,[new THREE.Vector3(c[g*3],c[g*3+1],c[g*3+2]),new THREE.Vector3(l,k,h),new THREE.Vector3(m,p,j)],null,d))},f4n:function(a,c,b,e,f,d,g,h,j,l,k){g=a.materials[g];var m=c[j*3],p=c[j*3+1];j=c[j*3+2];var n=c[l*3],v=c[l*3+1];l=c[l*3+2];var A=c[k*3],w=c[k*3+1];k=c[k*3+2];a.faces.push(new THREE.Face4(b,e,f,d,[new THREE.Vector3(c[h*3],c[h*3+1],c[h*3+2]),new THREE.Vector3(m,p,j),new THREE.Vector3(n,v,l),new THREE.Vector3(A,w,k)],null,g))},
-uv3:function(a,c,b,e,f,d,g){var h=[];h.push(new THREE.UV(c,b));h.push(new THREE.UV(e,f));h.push(new THREE.UV(d,g));a.push(h)},uv4:function(a,c,b,e,f,d,g,h,j){var l=[];l.push(new THREE.UV(c,b));l.push(new THREE.UV(e,f));l.push(new THREE.UV(d,g));l.push(new THREE.UV(h,j));a.push(l)}};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
-THREE.SceneLoader.prototype={load:function(a,c){var b=this,e=new Worker(a);e.postMessage(0);var f=THREE.Loader.prototype.extractUrlbase(a);e.onmessage=function(d){function g(M,W){return W=="relativeToHTML"?M:f+"/"+M}function h(){for(n in D.objects)if(!F.objects[n]){y=D.objects[n];if(y.geometry!==undefined){if(I=F.geometries[y.geometry]){G=[];for(U=0;U<y.materials.length;U++)G[U]=F.materials[y.materials[U]];o=y.position;r=y.rotation;q=y.quaternion;s=y.scale;q=0;G.length==0&&(G[0]=new THREE.MeshFaceMaterial);
-G.length>1&&(G=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(I,G);object.name=n;object.position.set(o[0],o[1],o[2]);if(q){object.quaternion.set(q[0],q[1],q[2],q[3]);object.useQuaternion=!0}else object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=y.visible;F.scene.addObject(object);F.objects[n]=object;if(y.meshCollider){var M=THREE.CollisionUtils.MeshColliderWBox(object);F.scene.collisions.colliders.push(M)}if(y.castsShadow){M=new THREE.ShadowVolume(I);F.scene.addChild(M);
-M.position=object.position;M.rotation=object.rotation;M.scale=object.scale}if(y.trigger&&y.trigger.toLowerCase()!="none"){M={type:y.trigger,object:y};F.triggers[object.name]=M}}}else{o=y.position;r=y.rotation;q=y.quaternion;s=y.scale;q=0;object=new THREE.Object3D;object.name=n;object.position.set(o[0],o[1],o[2]);if(q){object.quaternion.set(q[0],q[1],q[2],q[3]);object.useQuaternion=!0}else object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=y.visible!==undefined?y.visible:
-!1;F.scene.addObject(object);F.objects[n]=object;F.empties[n]=object;if(y.trigger&&y.trigger.toLowerCase()!="none"){M={type:y.trigger,object:y};F.triggers[object.name]=M}}}}function j(M){return function(W){F.geometries[M]=W;h();R-=1;b.onLoadComplete();k()}}function l(M){return function(W){F.geometries[M]=W}}function k(){b.callbackProgress({totalModels:S,totalTextures:P,loadedModels:S-R,loadedTextures:P-O},F);b.onLoadProgress();R==0&&O==0&&c(F)}var m,p,n,v,A,w,u,y,o,z,B,I,K,J,G,D,L,R,O,S,P,F;D=d.data;
-d=new THREE.BinaryLoader;L=new THREE.JSONLoader;O=R=0;F={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};var N=!1;for(n in D.objects){y=D.objects[n];if(y.meshCollider){N=!0;break}}if(N)F.scene.collisions=new THREE.CollisionSystem;if(D.transform){N=D.transform.position;z=D.transform.rotation;var Q=D.transform.scale;N&&F.scene.position.set(N[0],N[1],N[2]);z&&F.scene.rotation.set(z[0],z[1],z[2]);Q&&F.scene.scale.set(Q[0],Q[1],
-Q[2]);(N||z||Q)&&F.scene.updateMatrix()}N=function(){O-=1;k();b.onLoadComplete()};for(A in D.cameras){z=D.cameras[A];if(z.type=="perspective")K=new THREE.Camera(z.fov,z.aspect,z.near,z.far);else if(z.type=="ortho"){K=new THREE.Camera;K.projectionMatrix=THREE.Matrix4.makeOrtho(z.left,z.right,z.top,z.bottom,z.near,z.far)}o=z.position;z=z.target;K.position.set(o[0],o[1],o[2]);K.target.position.set(z[0],z[1],z[2]);F.cameras[A]=K}for(v in D.lights){A=D.lights[v];K=A.color!==undefined?A.color:16777215;
-z=A.intensity!==undefined?A.intensity:1;if(A.type=="directional"){o=A.direction;light=new THREE.DirectionalLight(K,z);light.position.set(o[0],o[1],o[2]);light.position.normalize()}else if(A.type=="point"){o=A.position;light=new THREE.PointLight(K,z);light.position.set(o[0],o[1],o[2])}F.scene.addLight(light);F.lights[v]=light}for(w in D.fogs){v=D.fogs[w];if(v.type=="linear")J=new THREE.Fog(0,v.near,v.far);else v.type=="exp2"&&(J=new THREE.FogExp2(0,v.density));z=v.color;J.color.setRGB(z[0],z[1],z[2]);
-F.fogs[w]=J}if(F.cameras&&D.defaults.camera)F.currentCamera=F.cameras[D.defaults.camera];if(F.fogs&&D.defaults.fog)F.scene.fog=F.fogs[D.defaults.fog];z=D.defaults.bgcolor;F.bgColor=new THREE.Color;F.bgColor.setRGB(z[0],z[1],z[2]);F.bgColorAlpha=D.defaults.bgalpha;for(m in D.geometries){w=D.geometries[m];if(w.type=="bin_mesh"||w.type=="ascii_mesh"){R+=1;b.onLoadStart()}}S=R;for(m in D.geometries){w=D.geometries[m];if(w.type=="cube"){I=new THREE.Cube(w.width,w.height,w.depth,w.segmentsWidth,w.segmentsHeight,
-w.segmentsDepth,null,w.flipped,w.sides);F.geometries[m]=I}else if(w.type=="plane"){I=new THREE.Plane(w.width,w.height,w.segmentsWidth,w.segmentsHeight);F.geometries[m]=I}else if(w.type=="sphere"){I=new THREE.Sphere(w.radius,w.segmentsWidth,w.segmentsHeight);F.geometries[m]=I}else if(w.type=="cylinder"){I=new THREE.Cylinder(w.numSegs,w.topRad,w.botRad,w.height,w.topOffset,w.botOffset);F.geometries[m]=I}else if(w.type=="torus"){I=new THREE.Torus(w.radius,w.tube,w.segmentsR,w.segmentsT);F.geometries[m]=
-I}else if(w.type=="icosahedron"){I=new THREE.Icosahedron(w.subdivisions);F.geometries[m]=I}else if(w.type=="bin_mesh")d.load({model:g(w.url,D.urlBaseType),callback:j(m)});else if(w.type=="ascii_mesh")L.load({model:g(w.url,D.urlBaseType),callback:j(m)});else if(w.type=="embedded_mesh")(w=D.embeds[w.id])&&L.createModel(w,l(m),"")}for(u in D.textures){m=D.textures[u];if(m.url instanceof Array){O+=m.url.length;for(d=0;d<m.url.length;d++)b.onLoadStart()}else{O+=1;b.onLoadStart()}}P=O;for(u in D.textures){m=
-D.textures[u];if(m.mapping!=undefined&&THREE[m.mapping]!=undefined)m.mapping=new THREE[m.mapping];if(m.url instanceof Array){d=[];for(var U=0;U<m.url.length;U++)d[U]=g(m.url[U],D.urlBaseType);d=THREE.ImageUtils.loadTextureCube(d,m.mapping,N)}else{d=THREE.ImageUtils.loadTexture(g(m.url,D.urlBaseType),m.mapping,N);if(THREE[m.minFilter]!=undefined)d.minFilter=THREE[m.minFilter];if(THREE[m.magFilter]!=undefined)d.magFilter=THREE[m.magFilter]}F.textures[u]=d}for(p in D.materials){u=D.materials[p];for(B in u.parameters)if(B==
-"envMap"||B=="map"||B=="lightMap")u.parameters[B]=F.textures[u.parameters[B]];else if(B=="shading")u.parameters[B]=u.parameters[B]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(B=="blending")u.parameters[B]=THREE[u.parameters[B]]?THREE[u.parameters[B]]:THREE.NormalBlending;else if(B=="combine")u.parameters[B]=u.parameters[B]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(B=="vertexColors")if(u.parameters[B]=="face")u.parameters[B]=THREE.FaceColors;else if(u.parameters[B])u.parameters[B]=
-THREE.VertexColors;if(u.parameters.opacity!==undefined&&u.parameters.opacity<1)u.parameters.transparent=!0;u=new THREE[u.type](u.parameters);F.materials[p]=u}h();b.callbackSync(F)}}};
-THREE.MarchingCubes=function(a,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.hasPos=!1;this.hasNormal=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,e,f){return b+(e-b)*f};this.VIntX=function(b,e,f,d,g,h,j,l,k,m){g=(g-k)/(m-k);k=this.normal_cache;e[d]=h+g*this.delta;e[d+1]=j;e[d+2]=l;f[d]=this.lerp(k[b],k[b+3],g);f[d+1]=this.lerp(k[b+1],k[b+4],g);f[d+2]=this.lerp(k[b+2],k[b+5],g)};this.VIntY=function(b,e,f,d,g,h,j,l,k,m){g=(g-k)/(m-k);k=this.normal_cache;e[d]=h;e[d+1]=j+g*this.delta;e[d+
-2]=l;e=b+this.yd*3;f[d]=this.lerp(k[b],k[e],g);f[d+1]=this.lerp(k[b+1],k[e+1],g);f[d+2]=this.lerp(k[b+2],k[e+2],g)};this.VIntZ=function(b,e,f,d,g,h,j,l,k,m){g=(g-k)/(m-k);k=this.normal_cache;e[d]=h;e[d+1]=j;e[d+2]=l+g*this.delta;e=b+this.zd*3;f[d]=this.lerp(k[b],k[e],g);f[d+1]=this.lerp(k[b+1],k[e+1],g);f[d+2]=this.lerp(k[b+2],k[e+2],g)};this.compNorm=function(b){var e=b*3;if(this.normal_cache[e]==0){this.normal_cache[e]=this.field[b-1]-this.field[b+1];this.normal_cache[e+1]=this.field[b-this.yd]-
-this.field[b+this.yd];this.normal_cache[e+2]=this.field[b-this.zd]-this.field[b+this.zd]}};this.polygonize=function(b,e,f,d,g,h){var j=d+1,l=d+this.yd,k=d+this.zd,m=j+this.yd,p=j+this.zd,n=d+this.yd+this.zd,v=j+this.yd+this.zd,A=0,w=this.field[d],u=this.field[j],y=this.field[l],o=this.field[m],z=this.field[k],B=this.field[p],I=this.field[n],K=this.field[v];w<g&&(A|=1);u<g&&(A|=2);y<g&&(A|=8);o<g&&(A|=4);z<g&&(A|=16);B<g&&(A|=32);I<g&&(A|=128);K<g&&(A|=64);var J=THREE.edgeTable[A];if(J==0)return 0;
-var G=this.delta,D=b+G,L=e+G;G=f+G;if(J&1){this.compNorm(d);this.compNorm(j);this.VIntX(d*3,this.vlist,this.nlist,0,g,b,e,f,w,u)}if(J&2){this.compNorm(j);this.compNorm(m);this.VIntY(j*3,this.vlist,this.nlist,3,g,D,e,f,u,o)}if(J&4){this.compNorm(l);this.compNorm(m);this.VIntX(l*3,this.vlist,this.nlist,6,g,b,L,f,y,o)}if(J&8){this.compNorm(d);this.compNorm(l);this.VIntY(d*3,this.vlist,this.nlist,9,g,b,e,f,w,y)}if(J&16){this.compNorm(k);this.compNorm(p);this.VIntX(k*3,this.vlist,this.nlist,12,g,b,e,G,
-z,B)}if(J&32){this.compNorm(p);this.compNorm(v);this.VIntY(p*3,this.vlist,this.nlist,15,g,D,e,G,B,K)}if(J&64){this.compNorm(n);this.compNorm(v);this.VIntX(n*3,this.vlist,this.nlist,18,g,b,L,G,I,K)}if(J&128){this.compNorm(k);this.compNorm(n);this.VIntY(k*3,this.vlist,this.nlist,21,g,b,e,G,z,I)}if(J&256){this.compNorm(d);this.compNorm(k);this.VIntZ(d*3,this.vlist,this.nlist,24,g,b,e,f,w,z)}if(J&512){this.compNorm(j);this.compNorm(p);this.VIntZ(j*3,this.vlist,this.nlist,27,g,D,e,f,u,B)}if(J&1024){this.compNorm(m);
-this.compNorm(v);this.VIntZ(m*3,this.vlist,this.nlist,30,g,D,L,f,o,K)}if(J&2048){this.compNorm(l);this.compNorm(n);this.VIntZ(l*3,this.vlist,this.nlist,33,g,b,L,f,y,I)}A<<=4;for(g=d=0;THREE.triTable[A+g]!=-1;){b=A+g;e=b+1;f=b+2;this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[e],3*THREE.triTable[f],h);g+=3;d++}return d};this.posnormtriv=function(b,e,f,d,g,h){var j=this.count*3;this.positionArray[j]=b[f];this.positionArray[j+1]=b[f+1];this.positionArray[j+2]=b[f+2];this.positionArray[j+
-3]=b[d];this.positionArray[j+4]=b[d+1];this.positionArray[j+5]=b[d+2];this.positionArray[j+6]=b[g];this.positionArray[j+7]=b[g+1];this.positionArray[j+8]=b[g+2];this.normalArray[j]=e[f];this.normalArray[j+1]=e[f+1];this.normalArray[j+2]=e[f+2];this.normalArray[j+3]=e[d];this.normalArray[j+4]=e[d+1];this.normalArray[j+5]=e[d+2];this.normalArray[j+6]=e[g];this.normalArray[j+7]=e[g+1];this.normalArray[j+8]=e[g+2];this.hasPos=!0;this.hasNormal=!0;this.count+=3;this.count>=this.maxCount-3&&h(this)};this.begin=
-function(){this.count=0;this.hasPos=!1;this.hasNormal=!1};this.end=function(b){if(this.count!=0){for(var e=this.count*3;e<this.positionArray.length;e++)this.positionArray[e]=0;b(this)}};this.addBall=function(b,e,f,d,g){var h=this.size*Math.sqrt(d/g),j=f*this.size,l=e*this.size,k=b*this.size,m=Math.floor(j-h);m<1&&(m=1);j=Math.floor(j+h);j>this.size-1&&(j=this.size-1);var p=Math.floor(l-h);p<1&&(p=1);l=Math.floor(l+h);l>this.size-1&&(l=this.size-1);var n=Math.floor(k-h);n<1&&(n=1);h=Math.floor(k+h);
-h>this.size-1&&(h=this.size-1);for(var v,A,w,u,y,o;m<j;m++){k=this.size2*m;A=m/this.size-f;y=A*A;for(A=p;A<l;A++){w=k+this.size*A;v=A/this.size-e;o=v*v;for(v=n;v<h;v++){u=v/this.size-b;u=d/(1.0E-6+u*u+o+y)-g;u>0&&(this.field[w+v]+=u)}}}};this.addPlaneX=function(b,e){var f,d,g,h,j,l=this.size,k=this.yd,m=this.zd,p=this.field,n=l*Math.sqrt(b/e);n>l&&(n=l);for(f=0;f<n;f++){d=f/l;d*=d;h=b/(1.0E-4+d)-e;if(h>0)for(d=0;d<l;d++){j=f+d*k;for(g=0;g<l;g++)p[m*g+j]+=h}}};this.addPlaneY=function(b,e){var f,d,
-g,h,j,l,k=this.size,m=this.yd,p=this.zd,n=this.field,v=k*Math.sqrt(b/e);v>k&&(v=k);for(d=0;d<v;d++){f=d/k;f*=f;h=b/(1.0E-4+f)-e;if(h>0){j=d*m;for(f=0;f<k;f++){l=j+f;for(g=0;g<k;g++)n[p*g+l]+=h}}}};this.addPlaneZ=function(b,e){var f,d,g,h,j,l;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/e);dist>size&&(dist=size);for(g=0;g<dist;g++){f=g/size;f*=f;h=b/(1.0E-4+f)-e;if(h>0){j=zd*g;for(d=0;d<size;d++){l=j+d*yd;for(f=0;f<size;f++)field[l+f]+=h}}}};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 e,f,d,g,h,j,l,k,m,p=this.size-2;for(g=1;g<p;g++){m=this.size2*g;l=(g-this.halfsize)/this.halfsize;for(d=1;d<p;d++){k=m+this.size*d;j=(d-this.halfsize)/this.halfsize;for(f=1;f<p;f++){h=(f-this.halfsize)/this.halfsize;e=k+f;this.polygonize(h,j,l,e,this.isolation,b)}}}this.end(b)};this.generateGeometry=function(){var b=0,e=new THREE.Geometry,f=[];this.render(function(d){var g,h,j,l,k,m,p,n;for(g=
-0;g<d.count;g++){p=g*3;k=p+1;n=p+2;h=d.positionArray[p];j=d.positionArray[k];l=d.positionArray[n];m=new THREE.Vector3(h,j,l);h=d.normalArray[p];j=d.normalArray[k];l=d.normalArray[n];p=new THREE.Vector3(h,j,l);p.normalize();k=new THREE.Vertex(m);e.vertices.push(k);f.push(p)}nfaces=d.count/3;for(g=0;g<nfaces;g++){p=(b+g)*3;k=p+1;n=p+2;m=f[p];h=f[k];j=f[n];p=new THREE.Face3(p,k,n,[m,h,j]);e.faces.push(p)}b+=nfaces;d.count=0});return e};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;
-THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
+THREE.Loader.prototype={addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ";b+=a.total?(100*a.loaded/a.total).toFixed(0)+"%":(a.loaded/1E3).toFixed(2)+" KB";
+this.statusDomElement.innerHTML=b},extractUrlbase:function(a){a=a.split("/");a.pop();return a.join("/")},init_materials:function(a,b,c){a.materials=[];for(var d=0;d<b.length;++d)a.materials[d]=[THREE.Loader.prototype.createMaterial(b[d],c)]},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.floor(a)==a}function d(a,d){var b=new Image;b.onload=function(){if(!c(this.width)||!c(this.height)){var d=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),b=Math.pow(2,Math.round(Math.log(this.height)/
+Math.LN2));a.image.width=d;a.image.height=b;a.image.getContext("2d").drawImage(this,0,0,d,b)}else a.image=this;a.needsUpdate=!0};b.src=d}var e,f,g;e="MeshLambertMaterial";f={color:15658734,opacity:1,map:null,lightMap:null,wireframe:a.wireframe};a.shading&&(a.shading=="Phong"?e="MeshPhongMaterial":a.shading=="Basic"&&(e="MeshBasicMaterial"));if(a.blending)if(a.blending=="Additive")f.blending=THREE.AdditiveBlending;else if(a.blending=="Subtractive")f.blending=THREE.SubtractiveBlending;else if(a.blending==
+"Multiply")f.blending=THREE.MultiplyBlending;if(a.transparent!==void 0||a.opacity<1)f.transparent=a.transparent;if(a.depthTest!==void 0)f.depthTest=a.depthTest;if(a.vertexColors!==void 0)if(a.vertexColors=="face")f.vertexColors=THREE.FaceColors;else if(a.vertexColors)f.vertexColors=THREE.VertexColors;if(a.mapDiffuse&&b)g=document.createElement("canvas"),f.map=new THREE.Texture(g),f.map.sourceFile=a.mapDiffuse,d(f.map,b+"/"+a.mapDiffuse);else if(a.colorDiffuse)g=(a.colorDiffuse[0]*255<<16)+(a.colorDiffuse[1]*
+255<<8)+a.colorDiffuse[2]*255,f.color=g,f.opacity=a.transparency;else if(a.DbgColor)f.color=a.DbgColor;if(a.mapLightmap&&b)g=document.createElement("canvas"),f.lightMap=new THREE.Texture(g),f.lightMap.sourceFile=a.mapLightmap,d(f.lightMap,b+"/"+a.mapLightmap);return new THREE[e](f)}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;
+THREE.JSONLoader.prototype.load=function(a){var b=this,c=a.model,d=a.callback,e=a.texture_path?a.texture_path:this.extractUrlbase(c),a=new Worker(c);a.onmessage=function(a){b.createModel(a.data,d,e);b.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
+THREE.JSONLoader.prototype.createModel=function(a,b,c){var d=new THREE.Geometry,e=a.scale!==void 0?1/a.scale:1;this.init_materials(d,a.materials,c);(function(c){if(a.version===void 0||a.version!=2)console.error("Deprecated file format.");else{var b,e,h,l,k,n,p,o,t,v,u,y,w,m,x=a.faces;n=a.vertices;var A=a.normals,C=a.colors,D=0;for(b=0;b<a.uvs.length;b++)a.uvs[b].length&&D++;for(b=0;b<D;b++)d.faceUvs[b]=[],d.faceVertexUvs[b]=[];l=0;for(k=n.length;l<k;)p=new THREE.Vertex,p.position.x=n[l++]*c,p.position.y=
+n[l++]*c,p.position.z=n[l++]*c,d.vertices.push(p);l=0;for(k=x.length;l<k;){c=x[l++];n=c&1;h=c&2;b=c&4;e=c&8;o=c&16;p=c&32;v=c&64;c&=128;n?(u=new THREE.Face4,u.a=x[l++],u.b=x[l++],u.c=x[l++],u.d=x[l++],n=4):(u=new THREE.Face3,u.a=x[l++],u.b=x[l++],u.c=x[l++],n=3);if(h)h=x[l++],u.materials=d.materials[h];h=d.faces.length;if(b)for(b=0;b<D;b++)y=a.uvs[b],t=x[l++],m=y[t*2],t=y[t*2+1],d.faceUvs[b][h]=new THREE.UV(m,t);if(e)for(b=0;b<D;b++){y=a.uvs[b];w=[];for(e=0;e<n;e++)t=x[l++],m=y[t*2],t=y[t*2+1],w[e]=
+new THREE.UV(m,t);d.faceVertexUvs[b][h]=w}if(o)o=x[l++]*3,e=new THREE.Vector3,e.x=A[o++],e.y=A[o++],e.z=A[o],u.normal=e;if(p)for(b=0;b<n;b++)o=x[l++]*3,e=new THREE.Vector3,e.x=A[o++],e.y=A[o++],e.z=A[o],u.vertexNormals.push(e);if(v)p=x[l++],p=new THREE.Color(C[p]),u.color=p;if(c)for(b=0;b<n;b++)p=x[l++],p=new THREE.Color(C[p]),u.vertexColors.push(p);d.faces.push(u)}}})(e);(function(){var c,b,e,h;if(a.skinWeights){c=0;for(b=a.skinWeights.length;c<b;c+=2)e=a.skinWeights[c],h=a.skinWeights[c+1],d.skinWeights.push(new THREE.Vector4(e,
+h,0,0))}if(a.skinIndices){c=0;for(b=a.skinIndices.length;c<b;c+=2)e=a.skinIndices[c],h=a.skinIndices[c+1],d.skinIndices.push(new THREE.Vector4(e,h,0,0))}d.bones=a.bones;d.animation=a.animation})();(function(c){if(a.morphTargets!==void 0){var b,e,h,l,k,n,p,o,t;b=0;for(e=a.morphTargets.length;b<e;b++){d.morphTargets[b]={};d.morphTargets[b].name=a.morphTargets[b].name;d.morphTargets[b].vertices=[];o=d.morphTargets[b].vertices;t=a.morphTargets[b].vertices;h=0;for(l=t.length;h<l;h+=3)k=t[h]*c,n=t[h+1]*
+c,p=t[h+2]*c,o.push(new THREE.Vertex(new THREE.Vector3(k,n,p)))}}if(a.morphColors!==void 0){b=0;for(e=a.morphColors.length;b<e;b++){d.morphColors[b]={};d.morphColors[b].name=a.morphColors[b].name;d.morphColors[b].colors=[];l=d.morphColors[b].colors;k=a.morphColors[b].colors;c=0;for(h=k.length;c<h;c+=3)n=new THREE.Color(16755200),n.setRGB(k[c],k[c+1],k[c+2]),l.push(n)}}})(e);(function(){if(a.edges!==void 0){var c,b,e;for(c=0;c<a.edges.length;c+=2)b=a.edges[c],e=a.edges[c+1],d.edges.push(new THREE.Edge(d.vertices[b],
+d.vertices[e],b,e))}})();d.computeFaceNormals();b(d)};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
+THREE.BinaryLoader.prototype={load:function(a){var b=a.model,c=a.callback,d=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(b),e=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(b),a=(new Date).getTime(),b=new Worker(b),f=this.showProgress?THREE.Loader.prototype.updateProgress:null;b.onmessage=function(a){THREE.BinaryLoader.prototype.loadAjaxBuffers(a.data.buffers,a.data.materials,c,e,d,f)};b.onerror=function(a){alert("worker.onerror: "+a.message+"\n"+a.data);a.preventDefault()};
+b.postMessage(a)},loadAjaxBuffers:function(a,b,c,d,e,f){var g=new XMLHttpRequest,j=d+"/"+a,h=0;g.onreadystatechange=function(){g.readyState==4?g.status==200||g.status==0?THREE.BinaryLoader.prototype.createBinModel(g.responseText,c,e,b):alert("Couldn't load ["+j+"] ["+g.status+"]"):g.readyState==3?f&&(h==0&&(h=g.getResponseHeader("Content-Length")),f({total:h,loaded:g.responseText.length})):g.readyState==2&&(h=g.getResponseHeader("Content-Length"))};g.open("GET",j,!0);g.overrideMimeType("text/plain; charset=x-user-defined");
+g.setRequestHeader("Content-Type","text/plain");g.send(null)},createBinModel:function(a,b,c,d){var e=function(c){function b(a,c){var d=k(a,c),e=k(a,c+1),f=k(a,c+2),g=k(a,c+3),h=(g<<1&255|f>>7)-127;d|=(f&127)<<16|e<<8;if(d==0&&h==-127)return 0;return(1-2*(g>>7))*(1+d*Math.pow(2,-23))*Math.pow(2,h)}function e(a,c){var b=k(a,c),d=k(a,c+1),f=k(a,c+2);return(k(a,c+3)<<24)+(f<<16)+(d<<8)+b}function h(a,c){var b=k(a,c);return(k(a,c+1)<<8)+b}function l(a,c){var b=k(a,c);return b>127?b-256:b}function k(a,
+c){return a.charCodeAt(c)&255}function n(c){var b,d,f;b=e(a,c);d=e(a,c+C);f=e(a,c+D);c=h(a,c+E);THREE.BinaryLoader.prototype.f3(y,b,d,f,c)}function p(c){var b,d,f,g,k,l;b=e(a,c);d=e(a,c+C);f=e(a,c+D);g=h(a,c+E);k=e(a,c+F);l=e(a,c+B);c=e(a,c+N);THREE.BinaryLoader.prototype.f3n(y,x,b,d,f,g,k,l,c)}function o(c){var b,d,f,g;b=e(a,c);d=e(a,c+K);f=e(a,c+H);g=e(a,c+L);c=h(a,c+I);THREE.BinaryLoader.prototype.f4(y,b,d,f,g,c)}function t(c){var b,d,f,g,k,l,m,n;b=e(a,c);d=e(a,c+K);f=e(a,c+H);g=e(a,c+L);k=h(a,
+c+I);l=e(a,c+z);m=e(a,c+G);n=e(a,c+J);c=e(a,c+M);THREE.BinaryLoader.prototype.f4n(y,x,b,d,f,g,k,l,m,n,c)}function v(c){var b,d;b=e(a,c);d=e(a,c+U);c=e(a,c+V);THREE.BinaryLoader.prototype.uv3(y.faceVertexUvs[0],A[b*2],A[b*2+1],A[d*2],A[d*2+1],A[c*2],A[c*2+1])}function u(c){var b,d,f;b=e(a,c);d=e(a,c+W);f=e(a,c+X);c=e(a,c+Y);THREE.BinaryLoader.prototype.uv4(y.faceVertexUvs[0],A[b*2],A[b*2+1],A[d*2],A[d*2+1],A[f*2],A[f*2+1],A[c*2],A[c*2+1])}var y=this,w=0,m,x=[],A=[],C,D,E,F,B,N,K,H,L,I,z,G,J,M,U,V,
+W,X,Y,P,Q,R,S,T,O;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(y,d,c);m={signature:a.substr(w,8),header_bytes:k(a,w+8),vertex_coordinate_bytes:k(a,w+9),normal_coordinate_bytes:k(a,w+10),uv_coordinate_bytes:k(a,w+11),vertex_index_bytes:k(a,w+12),normal_index_bytes:k(a,w+13),uv_index_bytes:k(a,w+14),material_index_bytes:k(a,w+15),nvertices:e(a,w+16),nnormals:e(a,w+16+4),nuvs:e(a,w+16+8),ntri_flat:e(a,w+16+12),ntri_smooth:e(a,w+16+16),ntri_flat_uv:e(a,w+16+20),ntri_smooth_uv:e(a,w+
+16+24),nquad_flat:e(a,w+16+28),nquad_smooth:e(a,w+16+32),nquad_flat_uv:e(a,w+16+36),nquad_smooth_uv:e(a,w+16+40)};w+=m.header_bytes;C=m.vertex_index_bytes;D=m.vertex_index_bytes*2;E=m.vertex_index_bytes*3;F=m.vertex_index_bytes*3+m.material_index_bytes;B=m.vertex_index_bytes*3+m.material_index_bytes+m.normal_index_bytes;N=m.vertex_index_bytes*3+m.material_index_bytes+m.normal_index_bytes*2;K=m.vertex_index_bytes;H=m.vertex_index_bytes*2;L=m.vertex_index_bytes*3;I=m.vertex_index_bytes*4;z=m.vertex_index_bytes*
+4+m.material_index_bytes;G=m.vertex_index_bytes*4+m.material_index_bytes+m.normal_index_bytes;J=m.vertex_index_bytes*4+m.material_index_bytes+m.normal_index_bytes*2;M=m.vertex_index_bytes*4+m.material_index_bytes+m.normal_index_bytes*3;U=m.uv_index_bytes;V=m.uv_index_bytes*2;W=m.uv_index_bytes;X=m.uv_index_bytes*2;Y=m.uv_index_bytes*3;c=m.vertex_index_bytes*3+m.material_index_bytes;O=m.vertex_index_bytes*4+m.material_index_bytes;P=m.ntri_flat*c;Q=m.ntri_smooth*(c+m.normal_index_bytes*3);R=m.ntri_flat_uv*
+(c+m.uv_index_bytes*3);S=m.ntri_smooth_uv*(c+m.normal_index_bytes*3+m.uv_index_bytes*3);T=m.nquad_flat*O;c=m.nquad_smooth*(O+m.normal_index_bytes*4);O=m.nquad_flat_uv*(O+m.uv_index_bytes*4);w+=function(c){for(var d,e,f,h=m.vertex_coordinate_bytes*3,j=c+m.nvertices*h;c<j;c+=h)d=b(a,c),e=b(a,c+m.vertex_coordinate_bytes),f=b(a,c+m.vertex_coordinate_bytes*2),THREE.BinaryLoader.prototype.v(y,d,e,f);return m.nvertices*h}(w);w+=function(c){for(var b,d,e,f=m.normal_coordinate_bytes*3,g=c+m.nnormals*f;c<g;c+=
+f)b=l(a,c),d=l(a,c+m.normal_coordinate_bytes),e=l(a,c+m.normal_coordinate_bytes*2),x.push(b/127,d/127,e/127);return m.nnormals*f}(w);w+=function(c){for(var d,e,f=m.uv_coordinate_bytes*2,h=c+m.nuvs*f;c<h;c+=f)d=b(a,c),e=b(a,c+m.uv_coordinate_bytes),A.push(d,e);return m.nuvs*f}(w);P=w+P;Q=P+Q;R=Q+R;S=R+S;T=S+T;c=T+c;O=c+O;(function(a){var c,b=m.vertex_index_bytes*3+m.material_index_bytes,d=b+m.uv_index_bytes*3,e=a+m.ntri_flat_uv*d;for(c=a;c<e;c+=d)n(c),v(c+b);return e-a})(Q);(function(a){var c,b=m.vertex_index_bytes*
+3+m.material_index_bytes+m.normal_index_bytes*3,d=b+m.uv_index_bytes*3,e=a+m.ntri_smooth_uv*d;for(c=a;c<e;c+=d)p(c),v(c+b);return e-a})(R);(function(a){var c,b=m.vertex_index_bytes*4+m.material_index_bytes,d=b+m.uv_index_bytes*4,e=a+m.nquad_flat_uv*d;for(c=a;c<e;c+=d)o(c),u(c+b);return e-a})(c);(function(a){var c,b=m.vertex_index_bytes*4+m.material_index_bytes+m.normal_index_bytes*4,d=b+m.uv_index_bytes*4,e=a+m.nquad_smooth_uv*d;for(c=a;c<e;c+=d)t(c),u(c+b);return e-a})(O);(function(a){var c,b=m.vertex_index_bytes*
+3+m.material_index_bytes,d=a+m.ntri_flat*b;for(c=a;c<d;c+=b)n(c);return d-a})(w);(function(a){var c,b=m.vertex_index_bytes*3+m.material_index_bytes+m.normal_index_bytes*3,d=a+m.ntri_smooth*b;for(c=a;c<d;c+=b)p(c);return d-a})(P);(function(a){var c,b=m.vertex_index_bytes*4+m.material_index_bytes,d=a+m.nquad_flat*b;for(c=a;c<d;c+=b)o(c);return d-a})(S);(function(a){var c,b=m.vertex_index_bytes*4+m.material_index_bytes+m.normal_index_bytes*4,d=a+m.nquad_smooth*b;for(c=a;c<d;c+=b)t(c);return d-a})(T);
+this.computeCentroids();this.computeFaceNormals()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;b(new e(c))},v:function(a,b,c,d){a.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,d)))},f3:function(a,b,c,d,e){a.faces.push(new THREE.Face3(b,c,d,null,null,a.materials[e]))},f4:function(a,b,c,d,e,f){a.faces.push(new THREE.Face4(b,c,d,e,null,null,a.materials[f]))},f3n:function(a,b,c,d,e,f,g,j,h){var f=a.materials[f],l=b[j*3],k=b[j*3+1],j=b[j*3+2],n=b[h*3],p=b[h*3+1],h=b[h*3+2];a.faces.push(new THREE.Face3(c,
+d,e,[new THREE.Vector3(b[g*3],b[g*3+1],b[g*3+2]),new THREE.Vector3(l,k,j),new THREE.Vector3(n,p,h)],null,f))},f4n:function(a,b,c,d,e,f,g,j,h,l,k){var g=a.materials[g],n=b[h*3],p=b[h*3+1],h=b[h*3+2],o=b[l*3],t=b[l*3+1],l=b[l*3+2],v=b[k*3],u=b[k*3+1],k=b[k*3+2];a.faces.push(new THREE.Face4(c,d,e,f,[new THREE.Vector3(b[j*3],b[j*3+1],b[j*3+2]),new THREE.Vector3(n,p,h),new THREE.Vector3(o,t,l),new THREE.Vector3(v,u,k)],null,g))},uv3:function(a,b,c,d,e,f,g){var j=[];j.push(new THREE.UV(b,c));j.push(new THREE.UV(d,
+e));j.push(new THREE.UV(f,g));a.push(j)},uv4:function(a,b,c,d,e,f,g,j,h){var l=[];l.push(new THREE.UV(b,c));l.push(new THREE.UV(d,e));l.push(new THREE.UV(f,g));l.push(new THREE.UV(j,h));a.push(l)}};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
+THREE.SceneLoader.prototype={load:function(a,b){var c=this,d=new Worker(a);d.postMessage(0);var e=THREE.Loader.prototype.extractUrlbase(a);d.onmessage=function(a){function d(a,c){return c=="relativeToHTML"?a:e+"/"+a}function j(){for(o in B.objects)if(!z.objects[o])if(w=B.objects[o],w.geometry!==void 0){if(C=z.geometries[w.geometry]){F=[];for(M=0;M<w.materials.length;M++)F[M]=z.materials[w.materials[M]];m=w.position;r=w.rotation;q=w.quaternion;s=w.scale;q=0;F.length==0&&(F[0]=new THREE.MeshFaceMaterial);
+F.length>1&&(F=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(C,F);object.name=o;object.position.set(m[0],m[1],m[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=w.visible;z.scene.addObject(object);z.objects[o]=object;if(w.meshCollider){var a=THREE.CollisionUtils.MeshColliderWBox(object);z.scene.collisions.colliders.push(a)}if(w.castsShadow)a=new THREE.ShadowVolume(C),z.scene.addChild(a),
+a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;w.trigger&&w.trigger.toLowerCase()!="none"&&(a={type:w.trigger,object:w},z.triggers[object.name]=a)}}else m=w.position,r=w.rotation,q=w.quaternion,s=w.scale,q=0,object=new THREE.Object3D,object.name=o,object.position.set(m[0],m[1],m[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],s[1],s[2]),object.visible=w.visible!==void 0?w.visible:!1,z.scene.addObject(object),
+z.objects[o]=object,z.empties[o]=object,w.trigger&&w.trigger.toLowerCase()!="none"&&(a={type:w.trigger,object:w},z.triggers[object.name]=a)}function h(a){return function(b){z.geometries[a]=b;j();K-=1;c.onLoadComplete();k()}}function l(a){return function(c){z.geometries[a]=c}}function k(){c.callbackProgress({totalModels:L,totalTextures:I,loadedModels:L-K,loadedTextures:I-H},z);c.onLoadProgress();K==0&&H==0&&b(z)}var n,p,o,t,v,u,y,w,m,x,A,C,D,E,F,B,N,K,H,L,I,z;B=a.data;a=new THREE.BinaryLoader;N=new THREE.JSONLoader;
+H=K=0;z={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};var G=!1;for(o in B.objects)if(w=B.objects[o],w.meshCollider){G=!0;break}if(G)z.scene.collisions=new THREE.CollisionSystem;if(B.transform){G=B.transform.position;x=B.transform.rotation;var J=B.transform.scale;G&&z.scene.position.set(G[0],G[1],G[2]);x&&z.scene.rotation.set(x[0],x[1],x[2]);J&&z.scene.scale.set(J[0],J[1],J[2]);(G||x||J)&&z.scene.updateMatrix()}G=function(){H-=
+1;k();c.onLoadComplete()};for(v in B.cameras){x=B.cameras[v];if(x.type=="perspective")D=new THREE.Camera(x.fov,x.aspect,x.near,x.far);else if(x.type=="ortho")D=new THREE.Camera,D.projectionMatrix=THREE.Matrix4.makeOrtho(x.left,x.right,x.top,x.bottom,x.near,x.far);m=x.position;x=x.target;D.position.set(m[0],m[1],m[2]);D.target.position.set(x[0],x[1],x[2]);z.cameras[v]=D}for(t in B.lights){v=B.lights[t];D=v.color!==void 0?v.color:16777215;x=v.intensity!==void 0?v.intensity:1;if(v.type=="directional")m=
+v.direction,light=new THREE.DirectionalLight(D,x),light.position.set(m[0],m[1],m[2]),light.position.normalize();else if(v.type=="point")m=v.position,light=new THREE.PointLight(D,x),light.position.set(m[0],m[1],m[2]);z.scene.addLight(light);z.lights[t]=light}for(u in B.fogs)t=B.fogs[u],t.type=="linear"?E=new THREE.Fog(0,t.near,t.far):t.type=="exp2"&&(E=new THREE.FogExp2(0,t.density)),x=t.color,E.color.setRGB(x[0],x[1],x[2]),z.fogs[u]=E;if(z.cameras&&B.defaults.camera)z.currentCamera=z.cameras[B.defaults.camera];
+if(z.fogs&&B.defaults.fog)z.scene.fog=z.fogs[B.defaults.fog];x=B.defaults.bgcolor;z.bgColor=new THREE.Color;z.bgColor.setRGB(x[0],x[1],x[2]);z.bgColorAlpha=B.defaults.bgalpha;for(n in B.geometries)if(u=B.geometries[n],u.type=="bin_mesh"||u.type=="ascii_mesh")K+=1,c.onLoadStart();L=K;for(n in B.geometries)u=B.geometries[n],u.type=="cube"?(C=new THREE.Cube(u.width,u.height,u.depth,u.segmentsWidth,u.segmentsHeight,u.segmentsDepth,null,u.flipped,u.sides),z.geometries[n]=C):u.type=="plane"?(C=new THREE.Plane(u.width,
+u.height,u.segmentsWidth,u.segmentsHeight),z.geometries[n]=C):u.type=="sphere"?(C=new THREE.Sphere(u.radius,u.segmentsWidth,u.segmentsHeight),z.geometries[n]=C):u.type=="cylinder"?(C=new THREE.Cylinder(u.numSegs,u.topRad,u.botRad,u.height,u.topOffset,u.botOffset),z.geometries[n]=C):u.type=="torus"?(C=new THREE.Torus(u.radius,u.tube,u.segmentsR,u.segmentsT),z.geometries[n]=C):u.type=="icosahedron"?(C=new THREE.Icosahedron(u.subdivisions),z.geometries[n]=C):u.type=="bin_mesh"?a.load({model:d(u.url,
+B.urlBaseType),callback:h(n)}):u.type=="ascii_mesh"?N.load({model:d(u.url,B.urlBaseType),callback:h(n)}):u.type=="embedded_mesh"&&(u=B.embeds[u.id])&&N.createModel(u,l(n),"");for(y in B.textures)if(n=B.textures[y],n.url instanceof Array){H+=n.url.length;for(a=0;a<n.url.length;a++)c.onLoadStart()}else H+=1,c.onLoadStart();I=H;for(y in B.textures){n=B.textures[y];if(n.mapping!=void 0&&THREE[n.mapping]!=void 0)n.mapping=new THREE[n.mapping];if(n.url instanceof Array){for(var a=[],M=0;M<n.url.length;M++)a[M]=
+d(n.url[M],B.urlBaseType);a=THREE.ImageUtils.loadTextureCube(a,n.mapping,G)}else{a=THREE.ImageUtils.loadTexture(d(n.url,B.urlBaseType),n.mapping,G);if(THREE[n.minFilter]!=void 0)a.minFilter=THREE[n.minFilter];if(THREE[n.magFilter]!=void 0)a.magFilter=THREE[n.magFilter]}z.textures[y]=a}for(p in B.materials){y=B.materials[p];for(A in y.parameters)if(A=="envMap"||A=="map"||A=="lightMap")y.parameters[A]=z.textures[y.parameters[A]];else if(A=="shading")y.parameters[A]=y.parameters[A]=="flat"?THREE.FlatShading:
+THREE.SmoothShading;else if(A=="blending")y.parameters[A]=THREE[y.parameters[A]]?THREE[y.parameters[A]]:THREE.NormalBlending;else if(A=="combine")y.parameters[A]=y.parameters[A]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(A=="vertexColors")if(y.parameters[A]=="face")y.parameters[A]=THREE.FaceColors;else if(y.parameters[A])y.parameters[A]=THREE.VertexColors;if(y.parameters.opacity!==void 0&&y.parameters.opacity<1)y.parameters.transparent=!0;y=new THREE[y.type](y.parameters);
+z.materials[p]=y}j();c.callbackSync(z)}}};
+THREE.MarchingCubes=function(a,b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b];this.init=function(a){this.isolation=80;this.size=a;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(this.size3*3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=
+0;this.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(a,b,e){return a+(b-a)*e};this.VIntX=function(a,b,e,f,g,j,h,l,k,n){g=(g-k)/(n-k);k=this.normal_cache;b[f]=j+g*this.delta;b[f+1]=h;b[f+2]=l;e[f]=this.lerp(k[a],k[a+3],g);e[f+1]=this.lerp(k[a+1],k[a+4],g);e[f+2]=this.lerp(k[a+2],k[a+5],g)};this.VIntY=function(a,b,e,f,g,j,h,l,k,n){g=(g-k)/(n-k);k=this.normal_cache;b[f]=j;b[f+1]=h+g*this.delta;b[f+
+2]=l;b=a+this.yd*3;e[f]=this.lerp(k[a],k[b],g);e[f+1]=this.lerp(k[a+1],k[b+1],g);e[f+2]=this.lerp(k[a+2],k[b+2],g)};this.VIntZ=function(a,b,e,f,g,j,h,l,k,n){g=(g-k)/(n-k);k=this.normal_cache;b[f]=j;b[f+1]=h;b[f+2]=l+g*this.delta;b=a+this.zd*3;e[f]=this.lerp(k[a],k[b],g);e[f+1]=this.lerp(k[a+1],k[b+1],g);e[f+2]=this.lerp(k[a+2],k[b+2],g)};this.compNorm=function(a){var b=a*3;this.normal_cache[b]==0&&(this.normal_cache[b]=this.field[a-1]-this.field[a+1],this.normal_cache[b+1]=this.field[a-this.yd]-this.field[a+
+this.yd],this.normal_cache[b+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,b,e,f,g,j){var h=f+1,l=f+this.yd,k=f+this.zd,n=h+this.yd,p=h+this.zd,o=f+this.yd+this.zd,t=h+this.yd+this.zd,v=0,u=this.field[f],y=this.field[h],w=this.field[l],m=this.field[n],x=this.field[k],A=this.field[p],C=this.field[o],D=this.field[t];u<g&&(v|=1);y<g&&(v|=2);w<g&&(v|=8);m<g&&(v|=4);x<g&&(v|=16);A<g&&(v|=32);C<g&&(v|=128);D<g&&(v|=64);var E=THREE.edgeTable[v];if(E==0)return 0;var F=this.delta,
+B=a+F,N=b+F,F=e+F;E&1&&(this.compNorm(f),this.compNorm(h),this.VIntX(f*3,this.vlist,this.nlist,0,g,a,b,e,u,y));E&2&&(this.compNorm(h),this.compNorm(n),this.VIntY(h*3,this.vlist,this.nlist,3,g,B,b,e,y,m));E&4&&(this.compNorm(l),this.compNorm(n),this.VIntX(l*3,this.vlist,this.nlist,6,g,a,N,e,w,m));E&8&&(this.compNorm(f),this.compNorm(l),this.VIntY(f*3,this.vlist,this.nlist,9,g,a,b,e,u,w));E&16&&(this.compNorm(k),this.compNorm(p),this.VIntX(k*3,this.vlist,this.nlist,12,g,a,b,F,x,A));E&32&&(this.compNorm(p),
+this.compNorm(t),this.VIntY(p*3,this.vlist,this.nlist,15,g,B,b,F,A,D));E&64&&(this.compNorm(o),this.compNorm(t),this.VIntX(o*3,this.vlist,this.nlist,18,g,a,N,F,C,D));E&128&&(this.compNorm(k),this.compNorm(o),this.VIntY(k*3,this.vlist,this.nlist,21,g,a,b,F,x,C));E&256&&(this.compNorm(f),this.compNorm(k),this.VIntZ(f*3,this.vlist,this.nlist,24,g,a,b,e,u,x));E&512&&(this.compNorm(h),this.compNorm(p),this.VIntZ(h*3,this.vlist,this.nlist,27,g,B,b,e,y,A));E&1024&&(this.compNorm(n),this.compNorm(t),this.VIntZ(n*
+3,this.vlist,this.nlist,30,g,B,N,e,m,D));E&2048&&(this.compNorm(l),this.compNorm(o),this.VIntZ(l*3,this.vlist,this.nlist,33,g,a,N,e,w,C));v<<=4;for(g=f=0;THREE.triTable[v+g]!=-1;)a=v+g,b=a+1,e=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[b],3*THREE.triTable[e],j),g+=3,f++;return f};this.posnormtriv=function(a,b,e,f,g,j){var h=this.count*3;this.positionArray[h]=a[e];this.positionArray[h+1]=a[e+1];this.positionArray[h+2]=a[e+2];this.positionArray[h+3]=a[f];this.positionArray[h+
+4]=a[f+1];this.positionArray[h+5]=a[f+2];this.positionArray[h+6]=a[g];this.positionArray[h+7]=a[g+1];this.positionArray[h+8]=a[g+2];this.normalArray[h]=b[e];this.normalArray[h+1]=b[e+1];this.normalArray[h+2]=b[e+2];this.normalArray[h+3]=b[f];this.normalArray[h+4]=b[f+1];this.normalArray[h+5]=b[f+2];this.normalArray[h+6]=b[g];this.normalArray[h+7]=b[g+1];this.normalArray[h+8]=b[g+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&j(this)};this.begin=function(){this.count=0;
+this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var b=this.count*3;b<this.positionArray.length;b++)this.positionArray[b]=0;a(this)}};this.addBall=function(a,b,e,f,g){var j=this.size*Math.sqrt(f/g),h=e*this.size,l=b*this.size,k=a*this.size,n=Math.floor(h-j);n<1&&(n=1);h=Math.floor(h+j);h>this.size-1&&(h=this.size-1);var p=Math.floor(l-j);p<1&&(p=1);l=Math.floor(l+j);l>this.size-1&&(l=this.size-1);var o=Math.floor(k-j);o<1&&(o=1);j=Math.floor(k+j);j>this.size-1&&(j=this.size-
+1);for(var t,v,u,y,w,m;n<h;n++){k=this.size2*n;v=n/this.size-e;w=v*v;for(v=p;v<l;v++){u=k+this.size*v;t=v/this.size-b;m=t*t;for(t=o;t<j;t++)y=t/this.size-a,y=f/(1.0E-6+y*y+m+w)-g,y>0&&(this.field[u+t]+=y)}}};this.addPlaneX=function(a,b){var e,f,g,j,h,l=this.size,k=this.yd,n=this.zd,p=this.field,o=l*Math.sqrt(a/b);o>l&&(o=l);for(e=0;e<o;e++)if(f=e/l,f*=f,j=a/(1.0E-4+f)-b,j>0)for(f=0;f<l;f++){h=e+f*k;for(g=0;g<l;g++)p[n*g+h]+=j}};this.addPlaneY=function(a,b){var e,f,g,j,h,l,k=this.size,n=this.yd,p=
+this.zd,o=this.field,t=k*Math.sqrt(a/b);t>k&&(t=k);for(f=0;f<t;f++)if(e=f/k,e*=e,j=a/(1.0E-4+e)-b,j>0){h=f*n;for(e=0;e<k;e++){l=h+e;for(g=0;g<k;g++)o[p*g+l]+=j}}};this.addPlaneZ=function(a,b){var e,f,g,j,h,l;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(a/b);dist>size&&(dist=size);for(g=0;g<dist;g++)if(e=g/size,e*=e,j=a/(1.0E-4+e)-b,j>0){h=zd*g;for(f=0;f<size;f++){l=h+f*yd;for(e=0;e<size;e++)field[l+e]+=j}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[a*
+3]=0,this.field[a]=0};this.render=function(a){this.begin();var b,e,f,g,j,h,l,k,n,p=this.size-2;for(g=1;g<p;g++){n=this.size2*g;l=(g-this.halfsize)/this.halfsize;for(f=1;f<p;f++){k=n+this.size*f;h=(f-this.halfsize)/this.halfsize;for(e=1;e<p;e++)j=(e-this.halfsize)/this.halfsize,b=k+e,this.polygonize(j,h,l,b,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,b=new THREE.Geometry,e=[];this.render(function(f){var g,j,h,l,k,n,p,o;for(g=0;g<f.count;g++)p=g*3,k=p+1,o=p+2,j=f.positionArray[p],
+h=f.positionArray[k],l=f.positionArray[o],n=new THREE.Vector3(j,h,l),j=f.normalArray[p],h=f.normalArray[k],l=f.normalArray[o],p=new THREE.Vector3(j,h,l),p.normalize(),k=new THREE.Vertex(n),b.vertices.push(k),e.push(p);nfaces=f.count/3;for(g=0;g<nfaces;g++)p=(a+g)*3,k=p+1,o=p+2,n=e[p],j=e[k],h=e[o],p=new THREE.Face3(p,k,o,[n,j,h]),b.faces.push(p);a+=nfaces;f.count=0});return b};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
 THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
 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]);
@@ -174,21 +173,21 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 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(a){function c(d){return new THREE.Mesh(new THREE.Cylinder(30,0.1,a.length/20,a.length/5),new THREE.MeshBasicMaterial({color:d}))}function b(d,g){var h=new THREE.Geometry;h.vertices=[new THREE.Vertex,new THREE.Vertex(d)];return new THREE.Line(h,new THREE.LineBasicMaterial({color:g}))}THREE.Object3D.call(this);var e=Math.PI/2,f;a=a||THREE.Trident.defaultParams;if(a!==THREE.Trident.defaultParams)for(f in THREE.Trident.defaultParams)a.hasOwnProperty(f)||(a[f]=THREE.Trident.defaultParams[f]);
-this.scale=new THREE.Vector3(a.scale,a.scale,a.scale);this.addChild(b(new THREE.Vector3(a.length,0,0),a.xAxisColor));this.addChild(b(new THREE.Vector3(0,a.length,0),a.yAxisColor));this.addChild(b(new THREE.Vector3(0,0,a.length),a.zAxisColor));if(a.showArrows){f=c(a.xAxisColor);f.rotation.y=-e;f.position.x=a.length;this.addChild(f);f=c(a.yAxisColor);f.rotation.x=e;f.position.y=a.length;this.addChild(f);f=c(a.zAxisColor);f.rotation.y=Math.PI;f.position.z=a.length;this.addChild(f)}};
-THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.Trident.defaultParams={xAxisColor:16711680,yAxisColor:65280,zAxisColor:255,showArrows:!0,length:100,scale:1};THREE.PlaneCollider=function(a,c){this.point=a;this.normal=c};THREE.SphereCollider=function(a,c){this.center=a;this.radius=c;this.radiusSq=c*c};THREE.BoxCollider=function(a,c){this.min=a;this.max=c;this.dynamic=!0;this.normal=new THREE.Vector3};
-THREE.MeshCollider=function(a,c){this.mesh=a;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(a){this.colliders=this.colliders.concat(a.colliders);this.hits=this.hits.concat(a.hits)};
-THREE.CollisionSystem.prototype.rayCastAll=function(a){a.direction.normalize();this.hits.length=0;var c,b,e,f,d=0;c=0;for(b=this.colliders.length;c<b;c++){f=this.colliders[c];e=this.rayCast(a,f);if(e<Number.MAX_VALUE){f.distance=e;e>d?this.hits.push(f):this.hits.unshift(f);d=e}}return this.hits};
-THREE.CollisionSystem.prototype.rayCastNearest=function(a){var c=this.rayCastAll(a);if(c.length==0)return null;for(var b=0;c[b]instanceof THREE.MeshCollider;){var e=this.rayMesh(a,c[b]);if(e.dist<Number.MAX_VALUE){c[b].distance=e.dist;c[b].faceIndex=e.faceIndex;break}b++}if(b>c.length)return null;return c[b]};
-THREE.CollisionSystem.prototype.rayCast=function(a,c){if(c instanceof THREE.PlaneCollider)return this.rayPlane(a,c);else if(c instanceof THREE.SphereCollider)return this.raySphere(a,c);else if(c instanceof THREE.BoxCollider)return this.rayBox(a,c);else if(c instanceof THREE.MeshCollider&&c.box)return this.rayBox(a,c.box)};
-THREE.CollisionSystem.prototype.rayMesh=function(a,c){for(var b=this.makeRayLocal(a,c.mesh),e=Number.MAX_VALUE,f,d=0;d<c.numFaces;d++){var g=c.mesh.geometry.faces[d],h=c.mesh.geometry.vertices[g.a].position,j=c.mesh.geometry.vertices[g.b].position,l=c.mesh.geometry.vertices[g.c].position,k=g instanceof THREE.Face4?c.mesh.geometry.vertices[g.d].position:null;if(g instanceof THREE.Face3){g=this.rayTriangle(b,h,j,l,e,this.collisionNormal);if(g<e){e=g;f=d;c.normal.copy(this.collisionNormal);c.normal.normalize()}}else if(g instanceof
-THREE.Face4){g=this.rayTriangle(b,h,j,k,e,this.collisionNormal);if(g<e){e=g;f=d;c.normal.copy(this.collisionNormal);c.normal.normalize()}g=this.rayTriangle(b,j,l,k,e,this.collisionNormal);if(g<e){e=g;f=d;c.normal.copy(this.collisionNormal);c.normal.normalize()}}}return{dist:e,faceIndex:f}};
-THREE.CollisionSystem.prototype.rayTriangle=function(a,c,b,e,f,d){var g=THREE.CollisionSystem.__v1,h=THREE.CollisionSystem.__v2;d.set(0,0,0);g.sub(b,c);h.sub(e,b);d.cross(g,h);h=d.dot(a.direction);if(!(h<0))return Number.MAX_VALUE;g=d.dot(c)-d.dot(a.origin);if(!(g<=0))return Number.MAX_VALUE;if(!(g>=h*f))return Number.MAX_VALUE;g/=h;h=THREE.CollisionSystem.__v3;h.copy(a.direction);h.multiplyScalar(g);h.addSelf(a.origin);if(Math.abs(d.x)>Math.abs(d.y))if(Math.abs(d.x)>Math.abs(d.z)){a=h.y-c.y;d=b.y-
-c.y;f=e.y-c.y;h=h.z-c.z;b=b.z-c.z;e=e.z-c.z}else{a=h.x-c.x;d=b.x-c.x;f=e.x-c.x;h=h.y-c.y;b=b.y-c.y;e=e.y-c.y}else if(Math.abs(d.y)>Math.abs(d.z)){a=h.x-c.x;d=b.x-c.x;f=e.x-c.x;h=h.z-c.z;b=b.z-c.z;e=e.z-c.z}else{a=h.x-c.x;d=b.x-c.x;f=e.x-c.x;h=h.y-c.y;b=b.y-c.y;e=e.y-c.y}c=d*e-b*f;if(c==0)return Number.MAX_VALUE;c=1/c;e=(a*e-h*f)*c;if(!(e>=0))return Number.MAX_VALUE;c*=d*h-b*a;if(!(c>=0))return Number.MAX_VALUE;if(!(1-e-c>=0))return Number.MAX_VALUE;return g};
-THREE.CollisionSystem.prototype.makeRayLocal=function(a,c){var b=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(c.matrixWorld,b);var e=THREE.CollisionSystem.__r;e.origin.copy(a.origin);e.direction.copy(a.direction);b.multiplyVector3(e.origin);b.rotateAxis(e.direction);e.direction.normalize();return e};
-THREE.CollisionSystem.prototype.rayBox=function(a,c){var b;if(c.dynamic&&c.mesh&&c.mesh.matrixWorld)b=this.makeRayLocal(a,c.mesh);else{b=THREE.CollisionSystem.__r;b.origin.copy(a.origin);b.direction.copy(a.direction)}var e=0,f=0,d=0,g=0,h=0,j=0,l=!0;if(b.origin.x<c.min.x){e=c.min.x-b.origin.x;e/=b.direction.x;l=!1;g=-1}else if(b.origin.x>c.max.x){e=c.max.x-b.origin.x;e/=b.direction.x;l=!1;g=1}if(b.origin.y<c.min.y){f=c.min.y-b.origin.y;f/=b.direction.y;l=!1;h=-1}else if(b.origin.y>c.max.y){f=c.max.y-
-b.origin.y;f/=b.direction.y;l=!1;h=1}if(b.origin.z<c.min.z){d=c.min.z-b.origin.z;d/=b.direction.z;l=!1;j=-1}else if(b.origin.z>c.max.z){d=c.max.z-b.origin.z;d/=b.direction.z;l=!1;j=1}if(l)return-1;l=0;if(f>e){l=1;e=f}if(d>e){l=2;e=d}switch(l){case 0:h=b.origin.y+b.direction.y*e;if(h<c.min.y||h>c.max.y)return Number.MAX_VALUE;b=b.origin.z+b.direction.z*e;if(b<c.min.z||b>c.max.z)return Number.MAX_VALUE;c.normal.set(g,0,0);break;case 1:g=b.origin.x+b.direction.x*e;if(g<c.min.x||g>c.max.x)return Number.MAX_VALUE;
-b=b.origin.z+b.direction.z*e;if(b<c.min.z||b>c.max.z)return Number.MAX_VALUE;c.normal.set(0,h,0);break;case 2:g=b.origin.x+b.direction.x*e;if(g<c.min.x||g>c.max.x)return Number.MAX_VALUE;h=b.origin.y+b.direction.y*e;if(h<c.min.y||h>c.max.y)return Number.MAX_VALUE;c.normal.set(0,0,j)}return e};THREE.CollisionSystem.prototype.rayPlane=function(a,c){var b=a.direction.dot(c.normal),e=c.point.dot(c.normal);if(b<0)b=(e-a.origin.dot(c.normal))/b;else return Number.MAX_VALUE;return b>0?b:Number.MAX_VALUE};
-THREE.CollisionSystem.prototype.raySphere=function(a,c){var b=c.center.clone().subSelf(a.origin);if(b.lengthSq<c.radiusSq)return-1;var e=b.dot(a.direction.clone());if(e<=0)return Number.MAX_VALUE;b=c.radiusSq-(b.lengthSq()-e*e);if(b>=0)return Math.abs(e)-Math.sqrt(b);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4;
-THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(a){a.geometry.computeBoundingBox();var c=a.geometry.boundingBox,b=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]);b=new THREE.BoxCollider(b,c);b.mesh=a;return b};THREE.CollisionUtils.MeshAABB=function(a){var c=THREE.CollisionUtils.MeshOBB(a);c.min.addSelf(a.position);c.max.addSelf(a.position);c.dynamic=!1;return c};
+THREE.Trident=function(a){function b(b){return new THREE.Mesh(new THREE.Cylinder(30,0.1,a.length/20,a.length/5),new THREE.MeshBasicMaterial({color:b}))}function c(a,b){var c=new THREE.Geometry;c.vertices=[new THREE.Vertex,new THREE.Vertex(a)];return new THREE.Line(c,new THREE.LineBasicMaterial({color:b}))}THREE.Object3D.call(this);var d=Math.PI/2,e,a=a||THREE.Trident.defaultParams;if(a!==THREE.Trident.defaultParams)for(e in THREE.Trident.defaultParams)a.hasOwnProperty(e)||(a[e]=THREE.Trident.defaultParams[e]);
+this.scale=new THREE.Vector3(a.scale,a.scale,a.scale);this.addChild(c(new THREE.Vector3(a.length,0,0),a.xAxisColor));this.addChild(c(new THREE.Vector3(0,a.length,0),a.yAxisColor));this.addChild(c(new THREE.Vector3(0,0,a.length),a.zAxisColor));if(a.showArrows)e=b(a.xAxisColor),e.rotation.y=-d,e.position.x=a.length,this.addChild(e),e=b(a.yAxisColor),e.rotation.x=d,e.position.y=a.length,this.addChild(e),e=b(a.zAxisColor),e.rotation.y=Math.PI,e.position.z=a.length,this.addChild(e)};
+THREE.Trident.prototype=new THREE.Object3D;THREE.Trident.prototype.constructor=THREE.Trident;THREE.Trident.defaultParams={xAxisColor:16711680,yAxisColor:65280,zAxisColor:255,showArrows:!0,length:100,scale: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){this.colliders=this.colliders.concat(a.colliders);this.hits=this.hits.concat(a.hits)};
+THREE.CollisionSystem.prototype.rayCastAll=function(a){a.direction.normalize();this.hits.length=0;var b,c,d,e,f=0;b=0;for(c=this.colliders.length;b<c;b++)if(e=this.colliders[b],d=this.rayCast(a,e),d<Number.MAX_VALUE)e.distance=d,d>f?this.hits.push(e):this.hits.unshift(e),f=d;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 d=this.rayMesh(a,b[c]);if(d.dist<Number.MAX_VALUE){b[c].distance=d.dist;b[c].faceIndex=d.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),d=Number.MAX_VALUE,e,f=0;f<b.numFaces;f++){var g=b.mesh.geometry.faces[f],j=b.mesh.geometry.vertices[g.a].position,h=b.mesh.geometry.vertices[g.b].position,l=b.mesh.geometry.vertices[g.c].position,k=g instanceof THREE.Face4?b.mesh.geometry.vertices[g.d].position:null;g instanceof THREE.Face3?(g=this.rayTriangle(c,j,h,l,d,this.collisionNormal),g<d&&(d=g,e=f,b.normal.copy(this.collisionNormal),b.normal.normalize())):
+g instanceof THREE.Face4&&(g=this.rayTriangle(c,j,h,k,d,this.collisionNormal),g<d&&(d=g,e=f,b.normal.copy(this.collisionNormal),b.normal.normalize()),g=this.rayTriangle(c,h,l,k,d,this.collisionNormal),g<d&&(d=g,e=f,b.normal.copy(this.collisionNormal),b.normal.normalize()))}return{dist:d,faceIndex:e}};
+THREE.CollisionSystem.prototype.rayTriangle=function(a,b,c,d,e,f){var g=THREE.CollisionSystem.__v1,j=THREE.CollisionSystem.__v2;f.set(0,0,0);g.sub(c,b);j.sub(d,c);f.cross(g,j);j=f.dot(a.direction);if(!(j<0))return Number.MAX_VALUE;g=f.dot(b)-f.dot(a.origin);if(!(g<=0))return Number.MAX_VALUE;if(!(g>=j*e))return Number.MAX_VALUE;g/=j;j=THREE.CollisionSystem.__v3;j.copy(a.direction);j.multiplyScalar(g);j.addSelf(a.origin);Math.abs(f.x)>Math.abs(f.y)?Math.abs(f.x)>Math.abs(f.z)?(a=j.y-b.y,f=c.y-b.y,
+e=d.y-b.y,j=j.z-b.z,c=c.z-b.z,d=d.z-b.z):(a=j.x-b.x,f=c.x-b.x,e=d.x-b.x,j=j.y-b.y,c=c.y-b.y,d=d.y-b.y):Math.abs(f.y)>Math.abs(f.z)?(a=j.x-b.x,f=c.x-b.x,e=d.x-b.x,j=j.z-b.z,c=c.z-b.z,d=d.z-b.z):(a=j.x-b.x,f=c.x-b.x,e=d.x-b.x,j=j.y-b.y,c=c.y-b.y,d=d.y-b.y);b=f*d-c*e;if(b==0)return Number.MAX_VALUE;b=1/b;d=(a*d-j*e)*b;if(!(d>=0))return Number.MAX_VALUE;b*=f*j-c*a;if(!(b>=0))return Number.MAX_VALUE;if(!(1-d-b>=0))return Number.MAX_VALUE;return g};
+THREE.CollisionSystem.prototype.makeRayLocal=function(a,b){var c=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(b.matrixWorld,c);var d=THREE.CollisionSystem.__r;d.origin.copy(a.origin);d.direction.copy(a.direction);c.multiplyVector3(d.origin);c.rotateAxis(d.direction);d.direction.normalize();return d};
+THREE.CollisionSystem.prototype.rayBox=function(a,b){var c;b.dynamic&&b.mesh&&b.mesh.matrixWorld?c=this.makeRayLocal(a,b.mesh):(c=THREE.CollisionSystem.__r,c.origin.copy(a.origin),c.direction.copy(a.direction));var d=0,e=0,f=0,g=0,j=0,h=0,l=!0;c.origin.x<b.min.x?(d=b.min.x-c.origin.x,d/=c.direction.x,l=!1,g=-1):c.origin.x>b.max.x&&(d=b.max.x-c.origin.x,d/=c.direction.x,l=!1,g=1);c.origin.y<b.min.y?(e=b.min.y-c.origin.y,e/=c.direction.y,l=!1,j=-1):c.origin.y>b.max.y&&(e=b.max.y-c.origin.y,e/=c.direction.y,
+l=!1,j=1);c.origin.z<b.min.z?(f=b.min.z-c.origin.z,f/=c.direction.z,l=!1,h=-1):c.origin.z>b.max.z&&(f=b.max.z-c.origin.z,f/=c.direction.z,l=!1,h=1);if(l)return-1;l=0;e>d&&(l=1,d=e);f>d&&(l=2,d=f);switch(l){case 0:j=c.origin.y+c.direction.y*d;if(j<b.min.y||j>b.max.y)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*d;if(c<b.min.z||c>b.max.z)return Number.MAX_VALUE;b.normal.set(g,0,0);break;case 1:g=c.origin.x+c.direction.x*d;if(g<b.min.x||g>b.max.x)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*
+d;if(c<b.min.z||c>b.max.z)return Number.MAX_VALUE;b.normal.set(0,j,0);break;case 2:g=c.origin.x+c.direction.x*d;if(g<b.min.x||g>b.max.x)return Number.MAX_VALUE;j=c.origin.y+c.direction.y*d;if(j<b.min.y||j>b.max.y)return Number.MAX_VALUE;b.normal.set(0,0,h)}return d};THREE.CollisionSystem.prototype.rayPlane=function(a,b){var c=a.direction.dot(b.normal),d=b.point.dot(b.normal);if(c<0)c=(d-a.origin.dot(b.normal))/c;else return Number.MAX_VALUE;return c>0?c:Number.MAX_VALUE};
+THREE.CollisionSystem.prototype.raySphere=function(a,b){var c=b.center.clone().subSelf(a.origin);if(c.lengthSq<b.radiusSq)return-1;var d=c.dot(a.direction.clone());if(d<=0)return Number.MAX_VALUE;c=b.radiusSq-(c.lengthSq()-d*d);if(c>=0)return Math.abs(d)-Math.sqrt(c);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4;
+THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(a){a.geometry.computeBoundingBox();var b=a.geometry.boundingBox,c=new THREE.Vector3(b.x[0],b.y[0],b.z[0]),b=new THREE.Vector3(b.x[1],b.y[1],b.z[1]),c=new THREE.BoxCollider(c,b);c.mesh=a;return c};THREE.CollisionUtils.MeshAABB=function(a){var b=THREE.CollisionUtils.MeshOBB(a);b.min.addSelf(a.position);b.max.addSelf(a.position);b.dynamic=!1;return b};
 THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))};

+ 99 - 100
build/custom/ThreeSVG.js

@@ -1,128 +1,127 @@
 // ThreeSVG.js r41/ROME - http://github.com/mrdoob/three.js
-var THREE=THREE||{};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}THREE.Color=function(a){this.setHex(a)};
-THREE.Color.prototype={copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex},setHex:function(a){this.hex=~~a&16777215;this.updateRGB()},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;this.updateHex()},setHSV:function(a,b,c){var d,e,g,f,j,h;if(c==0)d=e=g=0;else{f=Math.floor(a*6);j=a*6-f;a=c*(1-b);h=c*(1-b*j);b=c*(1-b*(1-j));switch(f){case 1:d=h;e=c;g=a;break;case 2:d=a;e=c;g=b;break;case 3:d=a;e=h;g=c;break;case 4:d=b;e=a;g=c;break;case 5:d=c;e=a;g=h;break;case 6:case 0:d=c;e=b;g=a}}this.setRGB(d,
+var THREE=THREE||{};if(!window.Int32Array)window.Int32Array=Array,window.Float32Array=Array;THREE.Color=function(a){this.setHex(a)};
+THREE.Color.prototype={copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex},setHex:function(a){this.hex=~~a&16777215;this.updateRGB()},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;this.updateHex()},setHSV:function(a,b,c){var d,e,g,f,h,j;if(c==0)d=e=g=0;else switch(f=Math.floor(a*6),h=a*6-f,a=c*(1-b),j=c*(1-b*h),b=c*(1-b*(1-h)),f){case 1:d=j;e=c;g=a;break;case 2:d=a;e=c;g=b;break;case 3:d=a;e=j;g=c;break;case 4:d=b;e=a;g=c;break;case 5:d=c;e=a;g=j;break;case 6:case 0:d=c,e=b,g=a}this.setRGB(d,
 e,g)},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},clone:function(){return new THREE.Color(this.hex)}};THREE.Vector2=function(a,b){this.set(a||0,b||0)};
 THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.set(a.x,a.y);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a);return this},negate:function(){this.set(-this.x,-this.y);return this},unit:function(){this.multiplyScalar(1/
 this.length());return this},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)};
 THREE.Vector3.prototype={set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.set(a.x,a.y,a.z);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z);return this},addScalar:function(a){this.set(this.x+a,this.y+a,this.z+a);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z);return this},cross:function(a,
 b){this.set(a.y*b.z-a.z*b.y,a.z*b.x-a.x*b.z,a.x*b.y-a.y*b.x);return this},crossSelf:function(a){var b=this.x,c=this.y,d=this.z;this.set(c*a.z-d*a.y,d*a.x-b*a.z,b*a.y-c*a.x);return this},multiply:function(a,b){this.set(a.x*b.x,a.y*b.y,a.z*b.z);return this},multiplySelf:function(a){this.set(this.x*a.x,this.y*a.y,this.z*a.z);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a,this.z*a);return this},divideSelf:function(a){this.set(this.x/a.x,this.y/a.y,this.z/a.z);return this},divideScalar:function(a){this.set(this.x/
-a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a=
-this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);if(Math.abs(b)>1.0E-5){this.x=Math.atan2(-a.n23/b,a.n33/b);this.z=Math.atan2(-a.n12/b,a.n11/b)}else{this.x=0;this.z=Math.atan2(a.n21,a.n22)}},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<
-1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)};
+a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y,a=this.z-a.z;return b*b+c*c+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a=
+this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13);Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&
+Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)};
 THREE.Vector4.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z,a.w+b.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z,a.w-b.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x*
 a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,b){this.set(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)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
-THREE.Ray.prototype={intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d,e=[];b=0;for(c=a.length;b<c;b++){d=a[b];d instanceof THREE.Mesh&&(e=e.concat(this.intersectObject(d)))}e.sort(function(g,f){return g.distance-f.distance});return e},intersectObject:function(a){function b(v,w,I,D){D=D.clone().subSelf(w);I=I.clone().subSelf(w);var N=v.clone().subSelf(w);v=D.dot(D);w=D.dot(I);D=D.dot(N);var x=I.dot(I);I=I.dot(N);N=1/(v*x-w*w);x=(x*D-w*I)*N;
-v=(v*I-w*D)*N;return x>0&&v>0&&x+v<1}var c,d,e,g,f,j,h,i,k,n,m,o=a.geometry,q=o.vertices,r=[];c=0;for(d=o.faces.length;c<d;c++){e=o.faces[c];n=this.origin.clone();m=this.direction.clone();h=a.matrixWorld;g=h.multiplyVector3(q[e.a].position.clone());f=h.multiplyVector3(q[e.b].position.clone());j=h.multiplyVector3(q[e.c].position.clone());h=e instanceof THREE.Face4?h.multiplyVector3(q[e.d].position.clone()):null;i=a.matrixRotationWorld.multiplyVector3(e.normal.clone());k=m.dot(i);if(a.doubleSided||
-(a.flipSided?k>0:k<0)){i=i.dot((new THREE.Vector3).sub(g,n))/k;n=n.addSelf(m.multiplyScalar(i));if(e instanceof THREE.Face3){if(b(n,g,f,j)){e={distance:this.origin.distanceTo(n),point:n,face:e,object:a};r.push(e)}}else if(e instanceof THREE.Face4&&(b(n,g,f,h)||b(n,f,j,h))){e={distance:this.origin.distanceTo(n),point:n,face:e,object:a};r.push(e)}}}return r}};
-THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,j=!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(h,i,k,n){j=!1;b=h;c=i;d=k;e=n;a()};this.addPoint=function(h,i){if(j){j=!1;b=h;c=i;d=h;e=i}else{b=b<h?b:h;c=c<i?c:i;d=d>h?d:h;e=e>i?e:i}a()};
-this.add3Points=function(h,i,k,n,m,o){if(j){j=!1;b=h<k?h<m?h:m:k<m?k:m;c=i<n?i<o?i:o:n<o?n:o;d=h>k?h>m?h:m:k>m?k:m;e=i>n?i>o?i:o:n>o?n:o}else{b=h<k?h<m?h<b?h:b:m<b?m:b:k<m?k<b?k:b:m<b?m:b;c=i<n?i<o?i<c?i:c:o<c?o:c:n<o?n<c?n:c:o<c?o:c;d=h>k?h>m?h>d?h:d:m>d?m:d:k>m?k>d?k:d:m>d?m:d;e=i>n?i>o?i>e?i:e:o>e?o:e:n>o?n>e?n:e:o>e?o:e}a()};this.addRectangle=function(h){if(j){j=!1;b=h.getLeft();c=h.getTop();d=h.getRight();e=h.getBottom()}else{b=b<h.getLeft()?b:h.getLeft();c=c<h.getTop()?c:h.getTop();d=d>h.getRight()?
-d:h.getRight();e=e>h.getBottom()?e:h.getBottom()}a()};this.inflate=function(h){b-=h;c-=h;d+=h;e+=h;a()};this.minSelf=function(h){b=b>h.getLeft()?b:h.getLeft();c=c>h.getTop()?c:h.getTop();d=d<h.getRight()?d:h.getRight();e=e<h.getBottom()?e:h.getBottom();a()};this.instersects=function(h){return Math.min(d,h.getRight())-Math.max(b,h.getLeft())>=0&&Math.min(e,h.getBottom())-Math.max(c,h.getTop())>=0};this.empty=function(){j=!0;e=d=c=b=0;a()};this.isEmpty=function(){return j}};
-THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={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,j,h,i,k,n,m,o,q,r){this.set(a||1,b||0,c||0,d||0,e||0,g||1,f||0,j||0,h||0,i||0,k||1,n||0,m||0,o||0,q||0,r||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={set:function(a,b,c,d,e,g,f,j,h,i,k,n,m,o,q,r){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=g;this.n23=f;this.n24=j;this.n31=h;this.n32=i;this.n33=k;this.n34=n;this.n41=m;this.n42=o;this.n43=q;this.n44=r;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.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();if(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;a.y=(this.n21*b+this.n22*c+this.n23*
+THREE.Ray.prototype={intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d,e=[];b=0;for(c=a.length;b<c;b++)d=a[b],d instanceof THREE.Mesh&&(e=e.concat(this.intersectObject(d)));e.sort(function(a,b){return a.distance-b.distance});return e},intersectObject:function(a){function b(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}var c,d,e,g,f,h,j,m,n,k,i,o=a.geometry,p=o.vertices,q=[];c=0;for(d=o.faces.length;c<d;c++)if(e=o.faces[c],k=this.origin.clone(),i=this.direction.clone(),j=a.matrixWorld,g=j.multiplyVector3(p[e.a].position.clone()),f=j.multiplyVector3(p[e.b].position.clone()),h=j.multiplyVector3(p[e.c].position.clone()),j=e instanceof THREE.Face4?j.multiplyVector3(p[e.d].position.clone()):null,m=a.matrixRotationWorld.multiplyVector3(e.normal.clone()),n=i.dot(m),a.doubleSided||(a.flipSided?
+n>0:n<0))if(m=m.dot((new THREE.Vector3).sub(g,k))/n,k=k.addSelf(i.multiplyScalar(m)),e instanceof THREE.Face3)b(k,g,f,h)&&(e={distance:this.origin.distanceTo(k),point:k,face:e,object:a},q.push(e));else if(e instanceof THREE.Face4&&(b(k,g,f,j)||b(k,f,h,j)))e={distance:this.origin.distanceTo(k),point:k,face:e,object:a},q.push(e);return q}};
+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,k){h=!1;b=f;c=g;d=n;e=k;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,k,i,o){h?(h=!1,b=f<n?f<i?f:i:n<i?n:i,c=g<k?g<o?g:o:k<o?k:o,d=f>n?f>i?f:i:n>i?n:i,e=g>k?g>o?g:o:k>o?k:o):(b=f<n?f<i?f<b?f:b:i<b?i:b:n<i?n<b?n:b:i<b?i:b,c=g<k?g<o?g<c?g:c:o<c?o:c:k<o?k<c?k:c:o<c?o:c,d=f>n?f>i?f>d?f:d:i>d?i:d:n>i?n>d?n:d:i>d?i:d,e=g>k?g>o?g>e?g:e:o>e?o:e:k>o?k>e?k:e:o>e?o: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.instersects=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={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,j,m,n,k,i,o,p,q){this.set(a||1,b||0,c||0,d||0,e||0,g||1,f||0,h||0,j||0,m||0,n||1,k||0,i||0,o||0,p||0,q||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={set:function(a,b,c,d,e,g,f,h,j,m,n,k,i,o,p,q){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=j;this.n32=m;this.n33=n;this.n34=k;this.n41=i;this.n42=o;this.n43=p;this.n44=q;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;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,j=a.n22,h=a.n23,i=a.n24,k=a.n31,n=a.n32,m=a.n33,o=a.n34,q=a.n41,r=a.n42,v=a.n43,w=a.n44,I=b.n11,D=b.n12,N=b.n13,x=b.n14,l=b.n21,J=b.n22,
-K=b.n23,P=b.n24,L=b.n31,B=b.n32,z=b.n33,M=b.n34;this.n11=c*I+d*l+e*L;this.n12=c*D+d*J+e*B;this.n13=c*N+d*K+e*z;this.n14=c*x+d*P+e*M+g;this.n21=f*I+j*l+h*L;this.n22=f*D+j*J+h*B;this.n23=f*N+j*K+h*z;this.n24=f*x+j*P+h*M+i;this.n31=k*I+n*l+m*L;this.n32=k*D+n*J+m*B;this.n33=k*N+n*K+m*z;this.n34=k*x+n*P+m*M+o;this.n41=q*I+r*l+v*L;this.n42=q*D+r*J+v*B;this.n43=q*N+r*K+v*z;this.n44=q*x+r*P+v*M+w;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]=
+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,j=a.n23,m=a.n24,n=a.n31,k=a.n32,i=a.n33,o=a.n34,p=a.n41,q=a.n42,t=a.n43,u=a.n44,G=b.n11,y=b.n12,E=b.n13,r=b.n14,l=b.n21,z=b.n22,
+A=b.n23,C=b.n24,v=b.n31,L=b.n32,F=b.n33,J=b.n34;this.n11=c*G+d*l+e*v;this.n12=c*y+d*z+e*L;this.n13=c*E+d*A+e*F;this.n14=c*r+d*C+e*J+g;this.n21=f*G+h*l+j*v;this.n22=f*y+h*z+j*L;this.n23=f*E+h*A+j*F;this.n24=f*r+h*C+j*J+m;this.n31=n*G+k*l+i*v;this.n32=n*y+k*z+i*L;this.n33=n*E+k*A+i*F;this.n34=n*r+k*C+i*J+o;this.n41=p*G+q*l+t*v;this.n42=p*y+q*z+t*L;this.n43=p*E+q*A+t*F;this.n44=p*r+q*C+t*J+u;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,j=this.n24,h=this.n31,i=this.n32,k=this.n33,n=this.n34,m=this.n41,o=this.n42,q=this.n43,r=this.n44;return d*f*i*m-c*j*i*m-d*g*k*m+b*j*k*m+c*g*n*m-b*f*n*m-d*f*h*o+c*j*h*o+d*e*k*o-a*j*k*o-c*e*n*o+a*f*n*o+d*g*h*q-b*j*h*q-d*e*i*q+a*j*i*q+b*e*n*q-a*g*n*q-c*g*h*r+b*f*h*r+c*e*i*r-a*f*i*r-b*e*k*r+a*g*k*r},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.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,j=this.n31,m=this.n32,n=this.n33,k=this.n34,i=this.n41,o=this.n42,p=this.n43,q=this.n44;return d*f*m*i-c*h*m*i-d*g*n*i+b*h*n*i+c*g*k*i-b*f*k*i-d*f*j*o+c*h*j*o+d*e*n*o-a*h*n*o-c*e*k*o+a*f*k*o+d*g*j*p-b*h*j*p-d*e*m*p+a*h*m*p+b*e*k*p-a*g*k*p-c*g*j*q+b*f*j*q+c*e*m*q-a*f*m*q-b*e*n*q+a*g*n*q},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,j=a.z,h=e*g,i=e*f;this.set(h*
-g+c,h*f-d*j,h*j+d*f,0,h*f+d*j,i*f+c,i*j-d*g,0,h*j-d*f,i*j+d*g,e*j*j+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){var b=a.x,c=a.y,d=a.z;a=Math.cos(b);b=Math.sin(b);var e=Math.cos(c);c=Math.sin(c);var g=Math.cos(d);d=Math.sin(d);var f=a*c,j=b*c;this.n11=e*g;this.n12=-e*d;this.n13=c;this.n21=j*g+a*d;this.n22=-j*d+a*g;this.n23=-b*e;this.n31=-f*g+b*d;this.n32=f*d+b*g;this.n33=a*e;return this},
-setRotationFromQuaternion:function(a){var b=a.x,c=a.y,d=a.z,e=a.w,g=b+b,f=c+c,j=d+d;a=b*g;var h=b*f;b*=j;var i=c*f;c*=j;d*=j;g*=e;f*=e;e*=j;this.n11=1-(i+d);this.n12=h-e;this.n13=b+f;this.n21=h+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+i);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},extractPosition:function(a){this.n14=
+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,j=e*g,m=e*f;this.set(j*
+g+c,j*f-d*h,j*h+d*f,0,j*f+d*h,m*f+c,m*h-d*g,0,j*h-d*f,m*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){var b=a.x,c=a.y,d=a.z,a=Math.cos(b),b=Math.sin(b),e=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),f=a*c,h=b*c;this.n11=e*g;this.n12=-e*d;this.n13=c;this.n21=h*g+a*d;this.n22=-h*d+a*g;this.n23=-b*e;this.n31=-f*g+b*d;this.n32=f*d+b*g;this.n33=a*e;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,j=b*f;b*=h;var m=c*f;c*=h;d*=h;g*=e;f*=e;e*=h;this.n11=1-(m+d);this.n12=j-e;this.n13=b+f;this.n21=j+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+m);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},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,j=a.n22,h=a.n23,i=a.n24,k=a.n31,n=a.n32,m=a.n33,o=a.n34,q=a.n41,r=a.n42,v=a.n43,w=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=h*o*r-i*m*r+i*n*v-j*o*v-h*n*w+j*m*w;b.n12=g*m*r-e*o*r-g*n*v+d*o*v+e*n*w-d*m*w;b.n13=e*i*r-g*h*r+g*j*v-d*i*v-e*j*w+d*h*w;b.n14=g*h*n-e*i*n-g*j*m+d*i*m+e*j*o-d*h*o;b.n21=i*m*q-h*o*q-i*k*v+f*o*v+h*k*w-f*m*w;b.n22=e*o*q-g*m*q+g*k*v-c*o*v-e*k*w+c*m*w;b.n23=g*h*q-e*i*q-g*f*v+c*i*v+e*f*w-c*h*w;
-b.n24=e*i*k-g*h*k+g*f*m-c*i*m-e*f*o+c*h*o;b.n31=j*o*q-i*n*q+i*k*r-f*o*r-j*k*w+f*n*w;b.n32=g*n*q-d*o*q-g*k*r+c*o*r+d*k*w-c*n*w;b.n33=e*i*q-g*j*q+g*f*r-c*i*r-d*f*w+c*j*w;b.n34=g*j*k-d*i*k-g*f*n+c*i*n+d*f*o-c*j*o;b.n41=h*n*q-j*m*q-h*k*r+f*m*r+j*k*v-f*n*v;b.n42=d*m*q-e*n*q+e*k*r-c*m*r-d*k*v+c*n*v;b.n43=e*j*q-d*h*q-e*f*r+c*h*r+d*f*v-c*j*v;b.n44=d*h*k-e*j*k+e*f*n-c*h*n-d*f*m+c*j*m;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,j=a.n33*a.n11-a.n31*a.n13,h=-a.n32*a.n11+a.n31*a.n12,i=a.n23*a.n12-a.n22*a.n13,k=-a.n23*a.n11+a.n21*a.n13,n=a.n22*a.n11-a.n21*a.n12;a=a.n11*d+a.n21*f+a.n31*i;if(a==0)throw"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*j;c[5]=a*h;c[6]=a*i;c[7]=a*k;c[8]=a*n;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,j,h,i;f=new THREE.Matrix4;j=b-a;h=c-d;i=g-e;f.n11=2/j;f.n12=0;f.n13=0;f.n14=-((b+a)/j);f.n21=0;f.n22=2/h;f.n23=0;f.n24=-((c+d)/h);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.Object3D=function(){this.parent=undefined;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.dynamic=!1;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=
-1;this.visible=!0;this._vector=new THREE.Vector3;this.name=""};
+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,j=a.n23,m=a.n24,n=a.n31,k=a.n32,i=a.n33,o=a.n34,p=a.n41,q=a.n42,t=a.n43,u=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=j*o*q-m*i*q+m*k*t-h*o*t-j*k*u+h*i*u;b.n12=g*i*q-e*o*q-g*k*t+d*o*t+e*k*u-d*i*u;b.n13=e*m*q-g*j*q+g*h*t-d*m*t-e*h*u+d*j*u;b.n14=g*j*k-e*m*k-g*h*i+d*m*i+e*h*o-d*j*o;b.n21=m*i*p-j*o*p-m*n*t+f*o*t+j*n*u-f*i*u;b.n22=e*o*p-g*i*p+g*n*t-c*o*t-e*n*u+c*i*u;b.n23=g*j*p-e*m*p-g*f*t+c*m*t+e*f*u-c*j*u;b.n24=
+e*m*n-g*j*n+g*f*i-c*m*i-e*f*o+c*j*o;b.n31=h*o*p-m*k*p+m*n*q-f*o*q-h*n*u+f*k*u;b.n32=g*k*p-d*o*p-g*n*q+c*o*q+d*n*u-c*k*u;b.n33=e*m*p-g*h*p+g*f*q-c*m*q-d*f*u+c*h*u;b.n34=g*h*n-d*m*n-g*f*k+c*m*k+d*f*o-c*h*o;b.n41=j*k*p-h*i*p-j*n*q+f*i*q+h*n*t-f*k*t;b.n42=d*i*p-e*k*p+e*n*q-c*i*q-d*n*t+c*k*t;b.n43=e*h*p-d*j*p-e*f*q+c*j*q+d*f*t-c*h*t;b.n44=d*j*n-e*h*n+e*f*k-c*j*k-d*f*i+c*h*i;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,j=-a.n32*a.n11+a.n31*a.n12,m=a.n23*a.n12-a.n22*a.n13,n=-a.n23*a.n11+a.n21*a.n13,k=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*m;if(a==0)throw"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*j;c[6]=a*m;c[7]=a*n;c[8]=a*k;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,j,m;f=new THREE.Matrix4;h=b-a;j=c-d;m=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/m;f.n34=-((g+e)/m);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.Object3D=function(){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.scale=new THREE.Vector3(1,1,1);this.dynamic=!1;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._vector=new THREE.Vector3;this.name=""};
 THREE.Object3D.prototype={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)},addChild:function(a){if(this.children.indexOf(a)===
--1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==undefined;)b=b.parent;b!==undefined&&b instanceof THREE.Scene&&b.addChildRecurse(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=undefined;this.children.splice(b,1)}},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);if(e!==undefined)return e}}},updateMatrix:function(){this.matrix.setPosition(this.position);
-this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation);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}a=0;for(var d=this.children.length;a<d;a++)this.children[a].update(this.matrixWorld,b,c)}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==undefined?d:1)};
-THREE.Quaternion.prototype={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=0.5*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);var g=Math.cos(c);c=Math.sin(c);var f=a*b,j=d*e;this.w=f*g-j*c;this.x=f*c+j*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);this.x=a.x*d;this.y=
-a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a==0)this.w=this.z=this.y=this.x=0;else{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,j=a.z;a=a.w;this.x=b*a+e*g+c*j-d*f;this.y=c*a+e*f+d*g-b*j;this.z=d*a+e*j+b*f-c*g;this.w=e*a-b*g-c*f-d*j;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,j=this.z,h=this.w,i=h*c+f*e-j*d,k=
-h*d+j*c-g*e,n=h*e+g*d-f*c;c=-g*c-f*d-j*e;b.x=i*h+c*-g+k*-j-n*-f;b.y=k*h+c*-f+n*-g-i*-j;b.z=n*h+c*-j+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){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.001){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);return 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};
+-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)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1)a.parent=void 0,this.children.splice(b,1)},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);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)}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==void 0?d:1)};
+THREE.Quaternion.prototype={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=0.5*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);this.x=a.x*d;this.y=a.y*
+d;this.z=a.z*d;this.w=Math.cos(c);return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a==0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},
+multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,j=this.w,m=j*c+f*e-h*d,n=
+j*d+h*c-g*e,k=j*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=m*j+c*-g+n*-h-k*-f;b.y=n*j+c*-f+k*-g-m*-h;b.z=k*j+c*-h+m*-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.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.set(a||0,b||0)};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
-THREE.Geometry.prototype={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);if(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)}else if(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,j=new THREE.Vector3,h=new THREE.Vector3;d=0;for(e=this.faces.length;d<e;d++){g=this.faces[d];if(a&&g.vertexNormals.length){j.set(0,0,0);b=0;for(c=g.vertexNormals.length;b<c;b++)j.addSelf(g.vertexNormals[b]);j.divideScalar(3)}else{b=this.vertices[g.a];c=this.vertices[g.b];f=this.vertices[g.c];j.sub(f.position,c.position);h.sub(b.position,c.position);j.crossSelf(h)}j.isZero()||
-j.normalize();g.normal.copy(j)}},computeVertexNormals:function(){var a,b,c,d;if(this.__tmpVertices==undefined){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++){c=this.faces[a];if(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];if(c instanceof THREE.Face3){d[c.a].addSelf(c.normal);d[c.b].addSelf(c.normal);d[c.c].addSelf(c.normal)}else if(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];if(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])}else if(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(F,t,C,A,y,s,p){j=F.vertices[t].position;h=F.vertices[C].position;i=F.vertices[A].position;k=f[y];n=f[s];m=f[p];o=h.x-j.x;q=i.x-j.x;r=h.y-j.y;v=i.y-j.y;w=h.z-j.z;I=i.z-j.z;D=n.u-k.u;N=m.u-k.u;x=n.v-k.v;l=m.v-k.v;J=1/(D*l-N*x);B.set((l*
-o-x*q)*J,(l*r-x*v)*J,(l*w-x*I)*J);z.set((D*q-N*o)*J,(D*v-N*r)*J,(D*I-N*w)*J);P[t].addSelf(B);P[C].addSelf(B);P[A].addSelf(B);L[t].addSelf(z);L[C].addSelf(z);L[A].addSelf(z)}var b,c,d,e,g,f,j,h,i,k,n,m,o,q,r,v,w,I,D,N,x,l,J,K,P=[],L=[],B=new THREE.Vector3,z=new THREE.Vector3,M=new THREE.Vector3,G=new THREE.Vector3,Q=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++){P[b]=new THREE.Vector3;L[b]=new THREE.Vector3}b=0;for(c=this.faces.length;b<c;b++){g=this.faces[b];f=this.faceVertexUvs[0][b];
-if(g instanceof THREE.Face3)a(this,g.a,g.b,g.c,0,1,2);else if(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 O=["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++){Q.copy(g.vertexNormals[d]);e=g[O[d]];K=P[e];M.copy(K);M.subSelf(Q.multiplyScalar(Q.dot(K))).normalize();G.cross(g.vertexNormals[d],K);e=G.dot(L[e]);e=e<0?-1:1;g.vertexTangents[d]=new THREE.Vector4(M.x,M.y,M.z,e)}}this.hasTangents=!0},computeBoundingBox:function(){var a;
+THREE.Geometry.prototype={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,j=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),j.sub(b.position,c.position),h.crossSelf(j);h.isZero()||
+h.normalize();g.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,D){h=a.vertices[b].position;j=a.vertices[c].position;m=a.vertices[d].position;n=f[e];k=f[g];i=f[D];o=j.x-h.x;p=m.x-h.x;q=j.y-h.y;t=m.y-h.y;u=j.z-h.z;G=m.z-h.z;y=k.u-n.u;E=i.u-n.u;r=k.v-n.v;l=i.v-n.v;z=1/(y*l-E*r);L.set((l*o-r*p)*
+z,(l*q-r*t)*z,(l*u-r*G)*z);F.set((y*p-E*o)*z,(y*t-E*q)*z,(y*G-E*u)*z);C[b].addSelf(L);C[c].addSelf(L);C[d].addSelf(L);v[b].addSelf(F);v[c].addSelf(F);v[d].addSelf(F)}var b,c,d,e,g,f,h,j,m,n,k,i,o,p,q,t,u,G,y,E,r,l,z,A,C=[],v=[],L=new THREE.Vector3,F=new THREE.Vector3,J=new THREE.Vector3,B=new THREE.Vector3,Q=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)C[b]=new THREE.Vector3,v[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 S=["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++)Q.copy(g.vertexNormals[d]),e=g[S[d]],A=C[e],J.copy(A),J.subSelf(Q.multiplyScalar(Q.dot(A))).normalize(),B.cross(g.vertexNormals[d],A),e=B.dot(v[e]),e=e<0?-1:1,g.vertexTangents[d]=new THREE.Vector4(J.x,J.y,J.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=this.boundingSphere===null?0:this.boundingSphere.radius,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(h,i){return Math.min(h,
-i)+"_"+Math.max(h,i)}function b(h,i,k){if(h[i]===undefined){h[i]={set:{},array:[]};h[i].set[k]=1;h[i].array.push(k)}else if(h[i].set[k]===undefined){h[i].set[k]=1;h[i].array.push(k)}}var c,d,e,g,f,j={};c=0;for(d=this.faces.length;c<d;c++){f=this.faces[c];if(f instanceof THREE.Face3){e=a(f.a,f.b);b(j,e,c);e=a(f.b,f.c);b(j,e,c);e=a(f.a,f.c);b(j,e,c)}else if(f instanceof THREE.Face4){e=a(f.b,f.d);b(j,e,c);e=a(f.a,f.b);b(j,e,c);e=a(f.a,f.d);b(j,e,c);e=a(f.b,f.c);b(j,e,c);e=a(f.c,f.d);b(j,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=j[a(e,g)].array;for(e=0;e<f.faceIndices.length;e++){g=f.faceIndices[e];f.faces.push(this.faces[g])}}}};THREE.GeometryIdCounter=0;THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=d||2E3;this.target=e||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};
-THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
-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{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.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,d){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0;this.castShadow=d!==undefined?d:!1};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;this.intensity=b||1;this.distance=c||0};
-THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.Material=function(a){this.id=THREE.MaterialCounter.value++;a=a||{};this.opacity=a.opacity!==undefined?a.opacity:1;this.transparent=a.transparent!==undefined?a.transparent:!1;this.blending=a.blending!==undefined?a.blending:THREE.NormalBlending;this.depthTest=a.depthTest!==undefined?a.depthTest:!0};THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;
+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=this.boundingSphere===null?0:this.boundingSphere.radius,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.GeometryIdCounter=0;THREE.Camera=function(a,b,c,d,e){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=d||2E3;this.target=e||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;
+THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};
+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.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,d){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0;this.castShadow=d!==void 0?d:!1};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;this.intensity=b||1;this.distance=c||0};
+THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.Material=function(a){this.id=THREE.MaterialCounter.value++;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};THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;
 THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.AdditiveAlphaBlending=4;THREE.MaterialCounter={value:0};
-THREE.LineBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==undefined?new THREE.Color(a.color):new THREE.Color(16777215);this.linewidth=a.linewidth!==undefined?a.linewidth:1;this.linecap=a.linecap!==undefined?a.linecap:"round";this.linejoin=a.linejoin!==undefined?a.linejoin:"round";this.vertexColors=a.vertexColors?a.vertexColors:!1};THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
-THREE.MeshBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==undefined?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==undefined?a.map:null;this.lightMap=a.lightMap!==undefined?a.lightMap:null;this.envMap=a.envMap!==undefined?a.envMap:null;this.combine=a.combine!==undefined?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==undefined?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==undefined?a.refractionRatio:0.98;this.shading=
-a.shading!==undefined?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==undefined?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==undefined?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==undefined?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==undefined?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==undefined?a.vertexColors:!1;this.skinning=a.skinning!==undefined?a.skinning:!1;this.morphTargets=a.morphTargets!==undefined?
-a.morphTargets:!1};THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
-THREE.MeshLambertMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==undefined?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==undefined?a.map:null;this.lightMap=a.lightMap!==undefined?a.lightMap:null;this.envMap=a.envMap!==undefined?a.envMap:null;this.combine=a.combine!==undefined?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==undefined?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==undefined?a.refractionRatio:0.98;this.shading=
-a.shading!==undefined?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==undefined?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==undefined?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==undefined?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==undefined?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==undefined?a.vertexColors:!1;this.skinning=a.skinning!==undefined?a.skinning:!1;this.morphTargets=a.morphTargets!==undefined?
-a.morphTargets:!1};THREE.MeshLambertMaterial.prototype=new THREE.Material;THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial;
-THREE.MeshPhongMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==undefined?new THREE.Color(a.color):new THREE.Color(16777215);this.ambient=a.ambient!==undefined?new THREE.Color(a.ambient):new THREE.Color(328965);this.specular=a.specular!==undefined?new THREE.Color(a.specular):new THREE.Color(1118481);this.shininess=a.shininess!==undefined?a.shininess:30;this.map=a.map!==undefined?a.map:null;this.lightMap=a.lightMap!==undefined?a.lightMap:null;this.envMap=a.envMap!==undefined?
-a.envMap:null;this.combine=a.combine!==undefined?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==undefined?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==undefined?a.refractionRatio:0.98;this.shading=a.shading!==undefined?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==undefined?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==undefined?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==undefined?a.wireframeLinecap:"round";this.wireframeLinejoin=
-a.wireframeLinejoin!==undefined?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==undefined?a.vertexColors:!1;this.skinning=a.skinning!==undefined?a.skinning:!1;this.morphTargets=a.morphTargets!==undefined?a.morphTargets:!1};THREE.MeshPhongMaterial.prototype=new THREE.Material;THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial;
-THREE.MeshDepthMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading!==undefined?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==undefined?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==undefined?a.wireframeLinewidth:1};THREE.MeshDepthMaterial.prototype=new THREE.Material;THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial;
+THREE.LineBasicMaterial=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.linewidth=a.linewidth!==void 0?a.linewidth:1;this.linecap=a.linecap!==void 0?a.linecap:"round";this.linejoin=a.linejoin!==void 0?a.linejoin:"round";this.vertexColors=a.vertexColors?a.vertexColors:!1};THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
+THREE.MeshBasicMaterial=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.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.shading=a.shading!==
+void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};
+THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
+THREE.MeshLambertMaterial=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.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.shading=a.shading!==
+void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};
+THREE.MeshLambertMaterial.prototype=new THREE.Material;THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial;
+THREE.MeshPhongMaterial=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.ambient=a.ambient!==void 0?new THREE.Color(a.ambient):new THREE.Color(328965);this.specular=a.specular!==void 0?new THREE.Color(a.specular):new THREE.Color(1118481);this.shininess=a.shininess!==void 0?a.shininess:30;this.map=a.map!==void 0?a.map:null;this.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;
+this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==
+void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};THREE.MeshPhongMaterial.prototype=new THREE.Material;THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial;
+THREE.MeshDepthMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1};THREE.MeshDepthMaterial.prototype=new THREE.Material;THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial;
 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!==undefined?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==undefined?a.map:null;this.size=a.size!==undefined?a.size:1;this.sizeAttenuation=a.sizeAttenuation!==undefined?a.sizeAttenuation:!0;this.vertexColors=a.vertexColors!==undefined?a.vertexColors:!1};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
-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!=undefined?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
-THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b&&b.length?b:[b];this.flipSided=!1;this.doubleSided=!1;this.overdraw=!1;if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius;if(this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++){this.morphTargetInfluences.push(0);
-this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}}}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==undefined)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
+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};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
+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};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
+THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b&&b.length?b:[b];this.overdraw=this.doubleSided=this.flipSided=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=a.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++)this.morphTargetInfluences.push(0),
+this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 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!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);if(!(a instanceof THREE.Bone))this.hasNoneBoneChildren=!0}};
-THREE.Sound=function(a,b,c,d){THREE.Object3D.call(this);this.isLoaded=!1;this.isAddedToDOM=!1;this.isPlaying=!1;this.duration=-1;this.radius=b!==undefined?Math.abs(b):100;this.volume=Math.min(1,Math.max(0,c!==undefined?c:1));this.domElement=document.createElement("audio");this.domElement.volume=0;this.domElement.pan=0;this.domElement.loop=d!==undefined?d:!0;this.sources=a instanceof Array?a:[a];var e;c=this.sources.length;for(a=0;a<c;a++){b=this.sources[a];b.toLowerCase();if(b.indexOf(".mp3")!==-1)e=
-"audio/mpeg";else if(b.indexOf(".ogg")!==-1)e="audio/ogg";else b.indexOf(".wav")!==-1&&(e="audio/wav");if(this.domElement.canPlayType(e)){e=document.createElement("source");e.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(e);this.domElement.addEventListener("canplay",this.onLoad,!0);this.domElement.load();break}}};THREE.Sound.prototype=new THREE.Object3D;THREE.Sound.prototype.constructor=THREE.Sound;THREE.Sound.prototype.supr=THREE.Object3D.prototype;
-THREE.Sound.prototype.onLoad=function(){var a=this.THREESound;if(!a.isLoaded){this.removeEventListener("canplay",this.onLoad,!0);a.isLoaded=!0;a.duration=this.duration;a.isPlaying&&a.play()}};THREE.Sound.prototype.addToDOM=function(a){this.isAddedToDOM=!0;a.appendChild(this.domElement)};THREE.Sound.prototype.play=function(a){this.isPlaying=!0;if(this.isLoaded){this.domElement.play();if(a)this.domElement.currentTime=a%this.duration}};THREE.Sound.prototype.pause=function(){this.isPlaying=!1;this.domElement.pause()};
+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.Sound=function(a,b,c,d){THREE.Object3D.call(this);this.isPlaying=this.isAddedToDOM=this.isLoaded=!1;this.duration=-1;this.radius=b!==void 0?Math.abs(b):100;this.volume=Math.min(1,Math.max(0,c!==void 0?c:1));this.domElement=document.createElement("audio");this.domElement.volume=0;this.domElement.pan=0;this.domElement.loop=d!==void 0?d:!0;this.sources=a instanceof Array?a:[a];for(var e,c=this.sources.length,a=0;a<c;a++)if(b=this.sources[a],b.toLowerCase(),b.indexOf(".mp3")!==-1?e="audio/mpeg":
+b.indexOf(".ogg")!==-1?e="audio/ogg":b.indexOf(".wav")!==-1&&(e="audio/wav"),this.domElement.canPlayType(e)){e=document.createElement("source");e.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(e);this.domElement.addEventListener("canplay",this.onLoad,!0);this.domElement.load();break}};THREE.Sound.prototype=new THREE.Object3D;THREE.Sound.prototype.constructor=THREE.Sound;THREE.Sound.prototype.supr=THREE.Object3D.prototype;
+THREE.Sound.prototype.onLoad=function(){var a=this.THREESound;if(!a.isLoaded)this.removeEventListener("canplay",this.onLoad,!0),a.isLoaded=!0,a.duration=this.duration,a.isPlaying&&a.play()};THREE.Sound.prototype.addToDOM=function(a){this.isAddedToDOM=!0;a.appendChild(this.domElement)};THREE.Sound.prototype.play=function(a){this.isPlaying=!0;if(this.isLoaded&&(this.domElement.play(),a))this.domElement.currentTime=a%this.duration};THREE.Sound.prototype.pause=function(){this.isPlaying=!1;this.domElement.pause()};
 THREE.Sound.prototype.stop=function(){this.isPlaying=!1;this.domElement.pause();this.domElement.currentTime=0};THREE.Sound.prototype.calculateVolumeAndPan=function(a){a=a.length();this.domElement.volume=a<=this.radius?this.volume*(1-a/this.radius):0};
-THREE.Sound.prototype.update=function(a,b,c){if(this.matrixAutoUpdate){this.matrix.setPosition(this.position);b=!0}if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;b=!0}var d=this.children.length;for(a=0;a<d;a++)this.children[a].update(this.matrixWorld,b,c)};
+THREE.Sound.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(this.matrix.setPosition(this.position),b=!0);if(b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;for(var d=this.children.length,a=0;a<d;a++)this.children[a].update(this.matrixWorld,b,c)};
 THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.collisions=this.fog=null;this.objects=[];this.lights=[];this.sounds=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};
-THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1){this.objects.push(a);this.__objectsAdded.push(a)}for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
-THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};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 if(a instanceof THREE.Sound){b=this.sounds.indexOf(a);b!==-1&&this.sounds.splice(b,1)}else if(!(a instanceof THREE.Camera)){b=this.objects.indexOf(a);if(b!==-1){this.objects.splice(b,1);this.__objectsRemoved.push(a)}}for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};
+THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1)this.objects.push(a),this.__objectsAdded.push(a);for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
+THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};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.Sound?(b=this.sounds.indexOf(a),b!==-1&&this.sounds.splice(b,1)):a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a)));for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};
 THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;
-THREE.Projector=function(){function a(){var B=h[j]=h[j]||new THREE.RenderableVertex;j++;return B}function b(B,z){return z.z-B.z}function c(B,z){var M=0,G=1,Q=B.z+B.w,O=z.z+z.w,F=-B.z+B.w,t=-z.z+z.w;if(Q>=0&&O>=0&&F>=0&&t>=0)return!0;else if(Q<0&&O<0||F<0&&t<0)return!1;else{if(Q<0)M=Math.max(M,Q/(Q-O));else O<0&&(G=Math.min(G,Q/(Q-O)));if(F<0)M=Math.max(M,F/(F-t));else t<0&&(G=Math.min(G,F/(F-t)));if(G<M)return!1;else{B.lerpSelf(z,M);z.lerpSelf(B,1-G);return!0}}}var d,e,g=[],f,j,h=[],i,k,n=[],m,o=
-[],q,r,v=[],w,I,D=[],N=new THREE.Vector4,x=new THREE.Vector4,l=new THREE.Matrix4,J=new THREE.Matrix4,K=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],P=new THREE.Vector4,L=new THREE.Vector4;this.projectVector=function(B,z){l.multiply(z.projectionMatrix,z.matrixWorldInverse);l.multiplyVector3(B);return B};this.unprojectVector=function(B,z){l.multiply(z.matrixWorld,THREE.Matrix4.makeInvert(z.projectionMatrix));l.multiplyVector3(B);return B};
-this.projectObjects=function(B,z,M){z=[];var G,Q,O;e=0;Q=B.objects;B=0;for(G=Q.length;B<G;B++){O=Q[B];var F;if(!(F=!O.visible))if(F=O instanceof THREE.Mesh){a:{F=void 0;for(var t=O.matrixWorld,C=-O.geometry.boundingSphere.radius*Math.max(O.scale.x,Math.max(O.scale.y,O.scale.z)),A=0;A<6;A++){F=K[A].x*t.n14+K[A].y*t.n24+K[A].z*t.n34+K[A].w;if(F<=C){F=!1;break a}}F=!0}F=!F}if(!F){F=g[e]=g[e]||new THREE.RenderableObject;e++;d=F;N.copy(O.position);l.multiplyVector3(N);d.object=O;d.z=N.z;z.push(d)}}M&&
-z.sort(b);return z};this.projectScene=function(B,z,M){var G=[],Q=z.near,O=z.far,F,t,C,A,y,s,p,E,R,u,H,S,W,X,T,V,U;I=r=m=k=0;z.matrixAutoUpdate&&z.update(undefined,!0);B.update(undefined,!1,z);l.multiply(z.projectionMatrix,z.matrixWorldInverse);K[0].set(l.n41-l.n11,l.n42-l.n12,l.n43-l.n13,l.n44-l.n14);K[1].set(l.n41+l.n11,l.n42+l.n12,l.n43+l.n13,l.n44+l.n14);K[2].set(l.n41+l.n21,l.n42+l.n22,l.n43+l.n23,l.n44+l.n24);K[3].set(l.n41-l.n21,l.n42-l.n22,l.n43-l.n23,l.n44-l.n24);K[4].set(l.n41-l.n31,l.n42-
-l.n32,l.n43-l.n33,l.n44-l.n34);K[5].set(l.n41+l.n31,l.n42+l.n32,l.n43+l.n33,l.n44+l.n34);for(F=0;F<6;F++){R=K[F];R.divideScalar(Math.sqrt(R.x*R.x+R.y*R.y+R.z*R.z))}R=this.projectObjects(B,z,!0);B=0;for(F=R.length;B<F;B++){u=R[B].object;if(u.visible){H=u.matrixWorld;S=u.matrixRotationWorld;W=u.materials;X=u.overdraw;j=0;if(u instanceof THREE.Mesh){T=u.geometry;A=T.vertices;V=T.faces;T=T.faceVertexUvs;t=0;for(C=A.length;t<C;t++){f=a();f.positionWorld.copy(A[t].position);H.multiplyVector3(f.positionWorld);
-f.positionScreen.copy(f.positionWorld);l.multiplyVector4(f.positionScreen);f.positionScreen.x/=f.positionScreen.w;f.positionScreen.y/=f.positionScreen.w;f.visible=f.positionScreen.z>Q&&f.positionScreen.z<O}A=0;for(t=V.length;A<t;A++){C=V[A];if(C instanceof THREE.Face3){y=h[C.a];s=h[C.b];p=h[C.c];if(y.visible&&s.visible&&p.visible&&(u.doubleSided||u.flipSided!=(p.positionScreen.x-y.positionScreen.x)*(s.positionScreen.y-y.positionScreen.y)-(p.positionScreen.y-y.positionScreen.y)*(s.positionScreen.x-
-y.positionScreen.x)<0)){E=n[k]=n[k]||new THREE.RenderableFace3;k++;i=E;i.v1.copy(y);i.v2.copy(s);i.v3.copy(p)}else continue}else if(C instanceof THREE.Face4){y=h[C.a];s=h[C.b];p=h[C.c];E=h[C.d];if(y.visible&&s.visible&&p.visible&&E.visible&&(u.doubleSided||u.flipSided!=((E.positionScreen.x-y.positionScreen.x)*(s.positionScreen.y-y.positionScreen.y)-(E.positionScreen.y-y.positionScreen.y)*(s.positionScreen.x-y.positionScreen.x)<0||(s.positionScreen.x-p.positionScreen.x)*(E.positionScreen.y-p.positionScreen.y)-
-(s.positionScreen.y-p.positionScreen.y)*(E.positionScreen.x-p.positionScreen.x)<0))){U=o[m]=o[m]||new THREE.RenderableFace4;m++;i=U;i.v1.copy(y);i.v2.copy(s);i.v3.copy(p);i.v4.copy(E)}else continue}i.normalWorld.copy(C.normal);S.multiplyVector3(i.normalWorld);i.centroidWorld.copy(C.centroid);H.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);l.multiplyVector3(i.centroidScreen);p=C.vertexNormals;y=0;for(s=p.length;y<s;y++){E=i.vertexNormalsWorld[y];E.copy(p[y]);S.multiplyVector3(E)}y=
-0;for(s=T.length;y<s;y++)if(U=T[y][A]){p=0;for(E=U.length;p<E;p++)i.uvs[y][p]=U[p]}i.meshMaterials=W;i.faceMaterials=C.materials;i.overdraw=X;i.z=i.centroidScreen.z;G.push(i)}}else if(u instanceof THREE.Line){J.multiply(l,H);A=u.geometry.vertices;y=a();y.positionScreen.copy(A[0].position);J.multiplyVector4(y.positionScreen);t=1;for(C=A.length;t<C;t++){y=a();y.positionScreen.copy(A[t].position);J.multiplyVector4(y.positionScreen);s=h[j-2];P.copy(y.positionScreen);L.copy(s.positionScreen);if(c(P,L)){P.multiplyScalar(1/
-P.w);L.multiplyScalar(1/L.w);H=v[r]=v[r]||new THREE.RenderableLine;r++;q=H;q.v1.positionScreen.copy(P);q.v2.positionScreen.copy(L);q.z=Math.max(P.z,L.z);q.materials=u.materials;G.push(q)}}}else if(u instanceof THREE.Particle){x.set(u.matrixWorld.n14,u.matrixWorld.n24,u.matrixWorld.n34,1);l.multiplyVector4(x);x.z/=x.w;if(x.z>0&&x.z<1){H=D[I]=D[I]||new THREE.RenderableParticle;I++;w=H;w.x=x.x/x.w;w.y=x.y/x.w;w.z=x.z;w.rotation=u.rotation.z;w.scale.x=u.scale.x*Math.abs(w.x-(x.x+z.projectionMatrix.n11)/
-(x.w+z.projectionMatrix.n14));w.scale.y=u.scale.y*Math.abs(w.y-(x.y+z.projectionMatrix.n22)/(x.w+z.projectionMatrix.n24));w.materials=u.materials;G.push(w)}}}}M&&G.sort(b);return G}};
-THREE.SVGRenderer=function(){function a(t,C,A){var y,s,p,E;y=0;for(s=t.lights.length;y<s;y++){p=t.lights[y];if(p instanceof THREE.DirectionalLight){E=C.normalWorld.dot(p.position)*p.intensity;if(E>0){A.r+=p.color.r*E;A.g+=p.color.g*E;A.b+=p.color.b*E}}else if(p instanceof THREE.PointLight){B.sub(p.position,C.centroidWorld);B.normalize();E=C.normalWorld.dot(B)*p.intensity;if(E>0){A.r+=p.color.r*E;A.g+=p.color.g*E;A.b+=p.color.b*E}}}}function b(t,C,A,y,s,p){f.data.vertices+=3;f.data.faces++;G=d(Q++);
-G.setAttribute("d","M "+t.positionScreen.x+" "+t.positionScreen.y+" L "+C.positionScreen.x+" "+C.positionScreen.y+" L "+A.positionScreen.x+","+A.positionScreen.y+"z");if(s instanceof THREE.MeshBasicMaterial)x.hex=s.color.hex;else if(s instanceof THREE.MeshLambertMaterial)if(N){l.r=J.r;l.g=J.g;l.b=J.b;a(p,y,l);x.r=Math.max(0,Math.min(s.color.r*l.r,1));x.g=Math.max(0,Math.min(s.color.g*l.g,1));x.b=Math.max(0,Math.min(s.color.b*l.b,1));x.updateHex()}else x.hex=s.color.hex;else if(s instanceof THREE.MeshDepthMaterial){L=
-1-s.__2near/(s.__farPlusNear-y.z*s.__farMinusNear);x.setRGB(L,L,L)}else s instanceof THREE.MeshNormalMaterial&&x.setRGB(e(y.normalWorld.x),e(y.normalWorld.y),e(y.normalWorld.z));s.wireframe?G.setAttribute("style","fill: none; stroke: #"+g(x.hex.toString(16))+"; stroke-width: "+s.wireframeLinewidth+"; stroke-opacity: "+s.opacity+"; stroke-linecap: "+s.wireframeLinecap+"; stroke-linejoin: "+s.wireframeLinejoin):G.setAttribute("style","fill: #"+g(x.hex.toString(16))+"; fill-opacity: "+s.opacity);i.appendChild(G)}
-function c(t,C,A,y,s,p,E){f.data.vertices+=4;f.data.faces++;G=d(Q++);G.setAttribute("d","M "+t.positionScreen.x+" "+t.positionScreen.y+" L "+C.positionScreen.x+" "+C.positionScreen.y+" L "+A.positionScreen.x+","+A.positionScreen.y+" L "+y.positionScreen.x+","+y.positionScreen.y+"z");if(p instanceof THREE.MeshBasicMaterial)x.hex=p.color.hex;else if(p instanceof THREE.MeshLambertMaterial)if(N){l.r=J.r;l.g=J.g;l.b=J.b;a(E,s,l);x.r=Math.max(0,Math.min(p.color.r*l.r,1));x.g=Math.max(0,Math.min(p.color.g*
-l.g,1));x.b=Math.max(0,Math.min(p.color.b*l.b,1));x.updateHex()}else x.hex=p.color.hex;else if(p instanceof THREE.MeshDepthMaterial){L=1-p.__2near/(p.__farPlusNear-s.z*p.__farMinusNear);x.setRGB(L,L,L)}else p instanceof THREE.MeshNormalMaterial&&x.setRGB(e(s.normalWorld.x),e(s.normalWorld.y),e(s.normalWorld.z));p.wireframe?G.setAttribute("style","fill: none; stroke: #"+g(x.hex.toString(16))+"; stroke-width: "+p.wireframeLinewidth+"; stroke-opacity: "+p.opacity+"; stroke-linecap: "+p.wireframeLinecap+
-"; stroke-linejoin: "+p.wireframeLinejoin):G.setAttribute("style","fill: #"+g(x.hex.toString(16))+"; fill-opacity: "+p.opacity);i.appendChild(G)}function d(t){if(z[t]==null){z[t]=document.createElementNS("http://www.w3.org/2000/svg","path");F==0&&z[t].setAttribute("shape-rendering","crispEdges")}return z[t]}function e(t){t=(t+1)*0.5;return t<0?0:t>1?1:t}function g(t){for(;t.length<6;)t="0"+t;return t}var f=this,j=null,h=new THREE.Projector,i=document.createElementNS("http://www.w3.org/2000/svg","svg"),
-k,n,m,o,q,r,v,w,I=new THREE.Rectangle,D=new THREE.Rectangle,N=!1,x=new THREE.Color(16777215),l=new THREE.Color(16777215),J=new THREE.Color(0),K=new THREE.Color(0),P=new THREE.Color(0),L,B=new THREE.Vector3,z=[],M=[],G,Q,O,F=1;this.domElement=i;this.autoClear=!0;this.sortObjects=!0;this.sortElements=!0;this.data={vertices:0,faces:0};this.setQuality=function(t){switch(t){case "high":F=1;break;case "low":F=0}};this.setSize=function(t,C){k=t;n=C;m=k/2;o=n/2;i.setAttribute("viewBox",-m+" "+-o+" "+k+" "+
-n);i.setAttribute("width",k);i.setAttribute("height",n);I.set(-m,-o,m,o)};this.clear=function(){for(;i.childNodes.length>0;)i.removeChild(i.childNodes[0])};this.render=function(t,C){var A,y,s,p,E,R,u,H;this.autoClear&&this.clear();f.data.vertices=0;f.data.faces=0;j=h.projectScene(t,C,this.sortElements);O=Q=0;if(N=t.lights.length>0){u=t.lights;J.setRGB(0,0,0);K.setRGB(0,0,0);P.setRGB(0,0,0);A=0;for(y=u.length;A<y;A++){s=u[A];p=s.color;if(s instanceof THREE.AmbientLight){J.r+=p.r;J.g+=p.g;J.b+=p.b}else if(s instanceof
-THREE.DirectionalLight){K.r+=p.r;K.g+=p.g;K.b+=p.b}else if(s instanceof THREE.PointLight){P.r+=p.r;P.g+=p.g;P.b+=p.b}}}A=0;for(y=j.length;A<y;A++){u=j[A];D.empty();if(u instanceof THREE.RenderableParticle){q=u;q.x*=m;q.y*=-o;s=0;for(p=u.materials.length;s<p;)s++}else if(u instanceof THREE.RenderableLine){q=u.v1;r=u.v2;q.positionScreen.x*=m;q.positionScreen.y*=-o;r.positionScreen.x*=m;r.positionScreen.y*=-o;D.addPoint(q.positionScreen.x,q.positionScreen.y);D.addPoint(r.positionScreen.x,r.positionScreen.y);
-if(I.instersects(D)){s=0;for(p=u.materials.length;s<p;)if((H=u.materials[s++])&&H.opacity!=0){E=q;R=r;var S=O++;if(M[S]==null){M[S]=document.createElementNS("http://www.w3.org/2000/svg","line");F==0&&M[S].setAttribute("shape-rendering","crispEdges")}G=M[S];G.setAttribute("x1",E.positionScreen.x);G.setAttribute("y1",E.positionScreen.y);G.setAttribute("x2",R.positionScreen.x);G.setAttribute("y2",R.positionScreen.y);if(H instanceof THREE.LineBasicMaterial){G.setAttribute("style","fill: none; stroke: ##"+
-g(H.color.hex.toString(16))+"; stroke-width: "+H.linewidth+"; stroke-opacity: "+H.opacity+"; stroke-linecap: "+H.linecap+"; stroke-linejoin: "+H.linejoin);i.appendChild(G)}}}}else if(u instanceof THREE.RenderableFace3){q=u.v1;r=u.v2;v=u.v3;q.positionScreen.x*=m;q.positionScreen.y*=-o;r.positionScreen.x*=m;r.positionScreen.y*=-o;v.positionScreen.x*=m;v.positionScreen.y*=-o;D.addPoint(q.positionScreen.x,q.positionScreen.y);D.addPoint(r.positionScreen.x,r.positionScreen.y);D.addPoint(v.positionScreen.x,
-v.positionScreen.y);if(I.instersects(D)){s=0;for(p=u.meshMaterials.length;s<p;){H=u.meshMaterials[s++];if(H instanceof THREE.MeshFaceMaterial){E=0;for(R=u.faceMaterials.length;E<R;)(H=u.faceMaterials[E++])&&H.opacity!=0&&b(q,r,v,u,H,t)}else H&&H.opacity!=0&&b(q,r,v,u,H,t)}}}else if(u instanceof THREE.RenderableFace4){q=u.v1;r=u.v2;v=u.v3;w=u.v4;q.positionScreen.x*=m;q.positionScreen.y*=-o;r.positionScreen.x*=m;r.positionScreen.y*=-o;v.positionScreen.x*=m;v.positionScreen.y*=-o;w.positionScreen.x*=
-m;w.positionScreen.y*=-o;D.addPoint(q.positionScreen.x,q.positionScreen.y);D.addPoint(r.positionScreen.x,r.positionScreen.y);D.addPoint(v.positionScreen.x,v.positionScreen.y);D.addPoint(w.positionScreen.x,w.positionScreen.y);if(I.instersects(D)){s=0;for(p=u.meshMaterials.length;s<p;){H=u.meshMaterials[s++];if(H instanceof THREE.MeshFaceMaterial){E=0;for(R=u.faceMaterials.length;E<R;)(H=u.faceMaterials[E++])&&H.opacity!=0&&c(q,r,v,w,u,H,t)}else H&&H.opacity!=0&&c(q,r,v,w,u,H,t)}}}}}};
-THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(a,b,c){c&&a.update(undefined,!1,b);c=a.sounds;var d,e=c.length;for(d=0;d<e;d++){a=c[d];this.soundPosition.set(a.matrixWorld.n14,a.matrixWorld.n24,a.matrixWorld.n34);this.soundPosition.subSelf(b.position);if(a.isPlaying&&a.isLoaded){a.isAddedToDOM||a.addToDOM(this.domElement);a.calculateVolumeAndPan(this.soundPosition)}}}};
+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,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,j=[],m,n,k=[],i,o=[],p,q,t=[],u,G,y=[],E=new THREE.Vector4,r=new THREE.Vector4,
+l=new THREE.Matrix4,z=new THREE.Matrix4,A=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],C=new THREE.Vector4,v=new THREE.Vector4;this.projectVector=function(a,b){l.multiply(b.projectionMatrix,b.matrixWorldInverse);l.multiplyVector3(a);return a};this.unprojectVector=function(a,b){l.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));l.multiplyVector3(a);return a};this.projectObjects=function(a,c,f){var c=[],h,m,j;e=0;m=
+a.objects;a=0;for(h=m.length;a<h;a++){j=m[a];var i;if(!(i=!j.visible))if(i=j instanceof THREE.Mesh){a:{i=void 0;for(var k=j.matrixWorld,n=-j.geometry.boundingSphere.radius*Math.max(j.scale.x,Math.max(j.scale.y,j.scale.z)),o=0;o<6;o++)if(i=A[o].x*k.n14+A[o].y*k.n24+A[o].z*k.n34+A[o].w,i<=n){i=!1;break a}i=!0}i=!i}if(!i)i=g[e]=g[e]||new THREE.RenderableObject,e++,d=i,E.copy(j.position),l.multiplyVector3(E),d.object=j,d.z=E.z,c.push(d)}f&&c.sort(b);return c};this.projectScene=function(d,e,g){var B=[],
+E=e.near,S=e.far,N,P,H,M,x,I,D,K,O,s,w,U,W,X,R,V,T;G=q=i=n=0;e.matrixAutoUpdate&&e.update(void 0,!0);d.update(void 0,!1,e);l.multiply(e.projectionMatrix,e.matrixWorldInverse);A[0].set(l.n41-l.n11,l.n42-l.n12,l.n43-l.n13,l.n44-l.n14);A[1].set(l.n41+l.n11,l.n42+l.n12,l.n43+l.n13,l.n44+l.n14);A[2].set(l.n41+l.n21,l.n42+l.n22,l.n43+l.n23,l.n44+l.n24);A[3].set(l.n41-l.n21,l.n42-l.n22,l.n43-l.n23,l.n44-l.n24);A[4].set(l.n41-l.n31,l.n42-l.n32,l.n43-l.n33,l.n44-l.n34);A[5].set(l.n41+l.n31,l.n42+l.n32,l.n43+
+l.n33,l.n44+l.n34);for(N=0;N<6;N++)O=A[N],O.divideScalar(Math.sqrt(O.x*O.x+O.y*O.y+O.z*O.z));O=this.projectObjects(d,e,!0);d=0;for(N=O.length;d<N;d++)if(s=O[d].object,s.visible)if(w=s.matrixWorld,U=s.matrixRotationWorld,W=s.materials,X=s.overdraw,h=0,s instanceof THREE.Mesh){R=s.geometry;M=R.vertices;V=R.faces;R=R.faceVertexUvs;P=0;for(H=M.length;P<H;P++)f=a(),f.positionWorld.copy(M[P].position),w.multiplyVector3(f.positionWorld),f.positionScreen.copy(f.positionWorld),l.multiplyVector4(f.positionScreen),
+f.positionScreen.x/=f.positionScreen.w,f.positionScreen.y/=f.positionScreen.w,f.visible=f.positionScreen.z>E&&f.positionScreen.z<S;M=0;for(P=V.length;M<P;M++){H=V[M];if(H instanceof THREE.Face3)if(x=j[H.a],I=j[H.b],D=j[H.c],x.visible&&I.visible&&D.visible&&(s.doubleSided||s.flipSided!=(D.positionScreen.x-x.positionScreen.x)*(I.positionScreen.y-x.positionScreen.y)-(D.positionScreen.y-x.positionScreen.y)*(I.positionScreen.x-x.positionScreen.x)<0))K=k[n]=k[n]||new THREE.RenderableFace3,n++,m=K,m.v1.copy(x),
+m.v2.copy(I),m.v3.copy(D);else continue;else if(H instanceof THREE.Face4)if(x=j[H.a],I=j[H.b],D=j[H.c],K=j[H.d],x.visible&&I.visible&&D.visible&&K.visible&&(s.doubleSided||s.flipSided!=((K.positionScreen.x-x.positionScreen.x)*(I.positionScreen.y-x.positionScreen.y)-(K.positionScreen.y-x.positionScreen.y)*(I.positionScreen.x-x.positionScreen.x)<0||(I.positionScreen.x-D.positionScreen.x)*(K.positionScreen.y-D.positionScreen.y)-(I.positionScreen.y-D.positionScreen.y)*(K.positionScreen.x-D.positionScreen.x)<
+0)))T=o[i]=o[i]||new THREE.RenderableFace4,i++,m=T,m.v1.copy(x),m.v2.copy(I),m.v3.copy(D),m.v4.copy(K);else continue;m.normalWorld.copy(H.normal);U.multiplyVector3(m.normalWorld);m.centroidWorld.copy(H.centroid);w.multiplyVector3(m.centroidWorld);m.centroidScreen.copy(m.centroidWorld);l.multiplyVector3(m.centroidScreen);D=H.vertexNormals;x=0;for(I=D.length;x<I;x++)K=m.vertexNormalsWorld[x],K.copy(D[x]),U.multiplyVector3(K);x=0;for(I=R.length;x<I;x++)if(T=R[x][M]){D=0;for(K=T.length;D<K;D++)m.uvs[x][D]=
+T[D]}m.meshMaterials=W;m.faceMaterials=H.materials;m.overdraw=X;m.z=m.centroidScreen.z;B.push(m)}}else if(s instanceof THREE.Line){z.multiply(l,w);M=s.geometry.vertices;x=a();x.positionScreen.copy(M[0].position);z.multiplyVector4(x.positionScreen);P=1;for(H=M.length;P<H;P++)if(x=a(),x.positionScreen.copy(M[P].position),z.multiplyVector4(x.positionScreen),I=j[h-2],C.copy(x.positionScreen),v.copy(I.positionScreen),c(C,v))C.multiplyScalar(1/C.w),v.multiplyScalar(1/v.w),w=t[q]=t[q]||new THREE.RenderableLine,
+q++,p=w,p.v1.positionScreen.copy(C),p.v2.positionScreen.copy(v),p.z=Math.max(C.z,v.z),p.materials=s.materials,B.push(p)}else if(s instanceof THREE.Particle&&(r.set(s.matrixWorld.n14,s.matrixWorld.n24,s.matrixWorld.n34,1),l.multiplyVector4(r),r.z/=r.w,r.z>0&&r.z<1))w=y[G]=y[G]||new THREE.RenderableParticle,G++,u=w,u.x=r.x/r.w,u.y=r.y/r.w,u.z=r.z,u.rotation=s.rotation.z,u.scale.x=s.scale.x*Math.abs(u.x-(r.x+e.projectionMatrix.n11)/(r.w+e.projectionMatrix.n14)),u.scale.y=s.scale.y*Math.abs(u.y-(r.y+
+e.projectionMatrix.n22)/(r.w+e.projectionMatrix.n24)),u.materials=s.materials,B.push(u);g&&B.sort(b);return B}};
+THREE.SVGRenderer=function(){function a(a,b,c){var d,e,f,g;d=0;for(e=a.lights.length;d<e;d++)f=a.lights[d],f instanceof THREE.DirectionalLight?(g=b.normalWorld.dot(f.position)*f.intensity,g>0&&(c.r+=f.color.r*g,c.g+=f.color.g*g,c.b+=f.color.b*g)):f instanceof THREE.PointLight&&(L.sub(f.position,b.centroidWorld),L.normalize(),g=b.normalWorld.dot(L)*f.intensity,g>0&&(c.r+=f.color.r*g,c.g+=f.color.g*g,c.b+=f.color.b*g))}function b(b,c,h,j,i,k){f.data.vertices+=3;f.data.faces++;B=d(Q++);B.setAttribute("d",
+"M "+b.positionScreen.x+" "+b.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+"z");i instanceof THREE.MeshBasicMaterial?r.hex=i.color.hex:i instanceof THREE.MeshLambertMaterial?E?(l.r=z.r,l.g=z.g,l.b=z.b,a(k,j,l),r.r=Math.max(0,Math.min(i.color.r*l.r,1)),r.g=Math.max(0,Math.min(i.color.g*l.g,1)),r.b=Math.max(0,Math.min(i.color.b*l.b,1)),r.updateHex()):r.hex=i.color.hex:i instanceof THREE.MeshDepthMaterial?(v=1-i.__2near/(i.__farPlusNear-
+j.z*i.__farMinusNear),r.setRGB(v,v,v)):i instanceof THREE.MeshNormalMaterial&&r.setRGB(e(j.normalWorld.x),e(j.normalWorld.y),e(j.normalWorld.z));i.wireframe?B.setAttribute("style","fill: none; stroke: #"+g(r.hex.toString(16))+"; stroke-width: "+i.wireframeLinewidth+"; stroke-opacity: "+i.opacity+"; stroke-linecap: "+i.wireframeLinecap+"; stroke-linejoin: "+i.wireframeLinejoin):B.setAttribute("style","fill: #"+g(r.hex.toString(16))+"; fill-opacity: "+i.opacity);m.appendChild(B)}function c(b,c,h,i,
+j,k,o){f.data.vertices+=4;f.data.faces++;B=d(Q++);B.setAttribute("d","M "+b.positionScreen.x+" "+b.positionScreen.y+" L "+c.positionScreen.x+" "+c.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+" L "+i.positionScreen.x+","+i.positionScreen.y+"z");k instanceof THREE.MeshBasicMaterial?r.hex=k.color.hex:k instanceof THREE.MeshLambertMaterial?E?(l.r=z.r,l.g=z.g,l.b=z.b,a(o,j,l),r.r=Math.max(0,Math.min(k.color.r*l.r,1)),r.g=Math.max(0,Math.min(k.color.g*l.g,1)),r.b=Math.max(0,Math.min(k.color.b*
+l.b,1)),r.updateHex()):r.hex=k.color.hex:k instanceof THREE.MeshDepthMaterial?(v=1-k.__2near/(k.__farPlusNear-j.z*k.__farMinusNear),r.setRGB(v,v,v)):k instanceof THREE.MeshNormalMaterial&&r.setRGB(e(j.normalWorld.x),e(j.normalWorld.y),e(j.normalWorld.z));k.wireframe?B.setAttribute("style","fill: none; stroke: #"+g(r.hex.toString(16))+"; stroke-width: "+k.wireframeLinewidth+"; stroke-opacity: "+k.opacity+"; stroke-linecap: "+k.wireframeLinecap+"; stroke-linejoin: "+k.wireframeLinejoin):B.setAttribute("style",
+"fill: #"+g(r.hex.toString(16))+"; fill-opacity: "+k.opacity);m.appendChild(B)}function d(a){F[a]==null&&(F[a]=document.createElementNS("http://www.w3.org/2000/svg","path"),N==0&&F[a].setAttribute("shape-rendering","crispEdges"));return F[a]}function e(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function g(a){for(;a.length<6;)a="0"+a;return a}var f=this,h=null,j=new THREE.Projector,m=document.createElementNS("http://www.w3.org/2000/svg","svg"),n,k,i,o,p,q,t,u,G=new THREE.Rectangle,y=new THREE.Rectangle,E=
+!1,r=new THREE.Color(16777215),l=new THREE.Color(16777215),z=new THREE.Color(0),A=new THREE.Color(0),C=new THREE.Color(0),v,L=new THREE.Vector3,F=[],J=[],B,Q,S,N=1;this.domElement=m;this.sortElements=this.sortObjects=this.autoClear=!0;this.data={vertices:0,faces:0};this.setQuality=function(a){switch(a){case "high":N=1;break;case "low":N=0}};this.setSize=function(a,b){n=a;k=b;i=n/2;o=k/2;m.setAttribute("viewBox",-i+" "+-o+" "+n+" "+k);m.setAttribute("width",n);m.setAttribute("height",k);G.set(-i,-o,
+i,o)};this.clear=function(){for(;m.childNodes.length>0;)m.removeChild(m.childNodes[0])};this.render=function(a,d){var e,k,l,n,r,v,s,w;this.autoClear&&this.clear();f.data.vertices=0;f.data.faces=0;h=j.projectScene(a,d,this.sortElements);S=Q=0;if(E=a.lights.length>0){s=a.lights;z.setRGB(0,0,0);A.setRGB(0,0,0);C.setRGB(0,0,0);e=0;for(k=s.length;e<k;e++)l=s[e],n=l.color,l instanceof THREE.AmbientLight?(z.r+=n.r,z.g+=n.g,z.b+=n.b):l instanceof THREE.DirectionalLight?(A.r+=n.r,A.g+=n.g,A.b+=n.b):l instanceof
+THREE.PointLight&&(C.r+=n.r,C.g+=n.g,C.b+=n.b)}e=0;for(k=h.length;e<k;e++)if(s=h[e],y.empty(),s instanceof THREE.RenderableParticle){p=s;p.x*=i;p.y*=-o;l=0;for(n=s.materials.length;l<n;)l++}else if(s instanceof THREE.RenderableLine){if(p=s.v1,q=s.v2,p.positionScreen.x*=i,p.positionScreen.y*=-o,q.positionScreen.x*=i,q.positionScreen.y*=-o,y.addPoint(p.positionScreen.x,p.positionScreen.y),y.addPoint(q.positionScreen.x,q.positionScreen.y),G.instersects(y)){l=0;for(n=s.materials.length;l<n;)if((w=s.materials[l++])&&
+w.opacity!=0){r=p;v=q;var F=S++;J[F]==null&&(J[F]=document.createElementNS("http://www.w3.org/2000/svg","line"),N==0&&J[F].setAttribute("shape-rendering","crispEdges"));B=J[F];B.setAttribute("x1",r.positionScreen.x);B.setAttribute("y1",r.positionScreen.y);B.setAttribute("x2",v.positionScreen.x);B.setAttribute("y2",v.positionScreen.y);w instanceof THREE.LineBasicMaterial&&(B.setAttribute("style","fill: none; stroke: ##"+g(w.color.hex.toString(16))+"; stroke-width: "+w.linewidth+"; stroke-opacity: "+
+w.opacity+"; stroke-linecap: "+w.linecap+"; stroke-linejoin: "+w.linejoin),m.appendChild(B))}}}else if(s instanceof THREE.RenderableFace3){if(p=s.v1,q=s.v2,t=s.v3,p.positionScreen.x*=i,p.positionScreen.y*=-o,q.positionScreen.x*=i,q.positionScreen.y*=-o,t.positionScreen.x*=i,t.positionScreen.y*=-o,y.addPoint(p.positionScreen.x,p.positionScreen.y),y.addPoint(q.positionScreen.x,q.positionScreen.y),y.addPoint(t.positionScreen.x,t.positionScreen.y),G.instersects(y)){l=0;for(n=s.meshMaterials.length;l<
+n;)if(w=s.meshMaterials[l++],w instanceof THREE.MeshFaceMaterial){r=0;for(v=s.faceMaterials.length;r<v;)(w=s.faceMaterials[r++])&&w.opacity!=0&&b(p,q,t,s,w,a)}else w&&w.opacity!=0&&b(p,q,t,s,w,a)}}else if(s instanceof THREE.RenderableFace4&&(p=s.v1,q=s.v2,t=s.v3,u=s.v4,p.positionScreen.x*=i,p.positionScreen.y*=-o,q.positionScreen.x*=i,q.positionScreen.y*=-o,t.positionScreen.x*=i,t.positionScreen.y*=-o,u.positionScreen.x*=i,u.positionScreen.y*=-o,y.addPoint(p.positionScreen.x,p.positionScreen.y),y.addPoint(q.positionScreen.x,
+q.positionScreen.y),y.addPoint(t.positionScreen.x,t.positionScreen.y),y.addPoint(u.positionScreen.x,u.positionScreen.y),G.instersects(y))){l=0;for(n=s.meshMaterials.length;l<n;)if(w=s.meshMaterials[l++],w instanceof THREE.MeshFaceMaterial){r=0;for(v=s.faceMaterials.length;r<v;)(w=s.faceMaterials[r++])&&w.opacity!=0&&c(p,q,t,u,s,w,a)}else w&&w.opacity!=0&&c(p,q,t,u,s,w,a)}}};
+THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(a,b,c){c&&a.update(void 0,!1,b);var c=a.sounds,d,e=c.length;for(d=0;d<e;d++)a=c[d],this.soundPosition.set(a.matrixWorld.n14,a.matrixWorld.n24,a.matrixWorld.n34),this.soundPosition.subSelf(b.position),a.isPlaying&&a.isLoaded&&(a.isAddedToDOM||a.addToDOM(this.domElement),a.calculateVolumeAndPan(this.soundPosition))}};
 THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
 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};

Plik diff jest za duży
+ 133 - 135
build/custom/ThreeWebGL.js


+ 1 - 1
src/core/Quaternion.js

@@ -1,4 +1,4 @@
-/*
+/**
  * @author mikael emtinger / http://gomo.se/
  * @author alteredq / http://alteredqualia.com/
  */

+ 3 - 3
utils/build.py

@@ -320,8 +320,8 @@ def compress(text):
 		handle.write(text)
 
 	out_tuple = tempfile.mkstemp()
-	# os.system("java -jar yuicompressor-2.4.2.jar %s --type js -o %s --charset utf-8 -v" % (in_tuple[1], out_tuple[1]))
-	os.system("java -jar compiler.jar --language_in=ECMASCRIPT5 --js %s --js_output_file %s" % (in_tuple[1], out_tuple[1]))
+
+	os.system("java -jar compiler/compiler.jar --language_in=ECMASCRIPT5_STRICT --js %s --js_output_file %s" % (in_tuple[1], out_tuple[1]))
 
 	with os.fdopen(out_tuple[0], 'r') as handle:
 		compressed = handle.read()
@@ -372,7 +372,7 @@ def buildLib(files, debug, unminified, filename):
 
 	if not unminified:
 		text = compress(text)
-	
+
 	output(addHeader(text, filename), folder + filename)
 
 

+ 202 - 0
utils/compiler/COPYING

@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 278 - 0
utils/compiler/README

@@ -0,0 +1,278 @@
+/*
+ * Copyright 2009 The Closure Compiler Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// Contents
+//
+
+The Closure Compiler performs checking, instrumentation, and
+optimizations on JavaScript code. The purpose of this README is to
+explain how to build and run the Closure Compiler.
+
+The Closure Compiler requires Java 6 or higher.
+http://www.java.com/
+
+
+//
+// Building The Closure Compiler
+//
+
+There are three ways to get a Closure Compiler executable.
+
+1) Use one we built for you.
+
+Pre-built Closure binaries can be found at
+http://code.google.com/p/closure-compiler/downloads/list
+
+
+2) Check out the source and build it with Apache Ant.
+
+First, check out the full source tree of the Closure Compiler. There
+are instructions on how to do this at the project site.
+http://code.google.com/p/closure-compiler/source/checkout
+
+Apache Ant is a cross-platform build tool.
+http://ant.apache.org/
+
+At the root of the source tree, there is an Ant file named
+build.xml. To use it, navigate to the same directory and type the
+command
+
+ant jar
+
+This will produce a jar file called "build/compiler.jar".
+
+
+3) Check out the source and build it with Eclipse.
+
+Eclipse is a cross-platform IDE.
+http://www.eclipse.org/
+
+Under Eclipse's File menu, click "New > Project ..." and create a
+"Java Project."  You will see an options screen. Give the project a
+name, select "Create project from existing source," and choose the
+root of the checked-out source tree as the existing directory. Verify
+that you are using JRE version 6 or higher.
+
+Eclipse can use the build.xml file to discover rules. When you
+navigate to the build.xml file, you will see all the build rules in
+the "Outline" pane. Run the "jar" rule to build the compiler in
+build/compiler.jar.
+
+
+//
+// Running The Closure Compiler
+//
+
+Once you have the jar binary, running the Closure Compiler is straightforward.
+
+On the command line, type
+
+java -jar compiler.jar
+
+This starts the compiler in interactive mode. Type
+
+var x = 17 + 25;
+
+then hit "Enter", then hit "Ctrl-Z" (on Windows) or "Ctrl-D" (on Mac or Linux)
+and "Enter" again. The Compiler will respond:
+
+var x=42;
+
+The Closure Compiler has many options for reading input from a file,
+writing output to a file, checking your code, and running
+optimizations. To learn more, type
+
+java -jar compiler.jar --help
+
+You can read more detailed documentation about the many flags at
+http://code.google.com/closure/compiler/docs/gettingstarted_app.html
+
+
+//
+// Compiling Multiple Scripts
+//
+
+If you have multiple scripts, you should compile them all together with
+one compile command.
+
+java -jar compiler.jar --js=in1.js --js=in2.js ... --js_output_file=out.js
+
+The Closure Compiler will concatenate the files in the order they're
+passed at the command line.
+
+If you need to compile many, many scripts together, you may start to
+run into problems with managing dependencies between scripts. You
+should check out the Closure Library. It contains functions for
+enforcing dependencies between scripts, and a tool called calcdeps.py
+that knows how to give scripts to the Closure Compiler in the right
+order.
+
+http://code.google.com/p/closure-library/
+
+//
+// Licensing
+//
+
+Unless otherwise stated, all source files are licensed under
+the Apache License, Version 2.0.
+
+
+-----
+Code under:
+src/com/google/javascript/rhino
+test/com/google/javascript/rhino
+
+URL: http://www.mozilla.org/rhino
+Version:  1.5R3, with heavy modifications
+License:  Netscape Public License and MPL / GPL dual license
+
+Description: A partial copy of Mozilla Rhino. Mozilla Rhino is an
+implementation of JavaScript for the JVM.  The JavaScript parser and
+the parse tree data structures were extracted and modified
+significantly for use by Google's JavaScript compiler.
+
+Local Modifications: The packages have been renamespaced. All code not
+relavant to parsing has been removed. A JSDoc parser and static typing
+system have been added.
+
+
+-----
+Code in:
+lib/libtrunk_rhino_parser_jarjared.jar
+
+Rhino
+URL: http://www.mozilla.org/rhino
+Version:  Trunk
+License:  Netscape Public License and MPL / GPL dual license
+
+Description: Mozilla Rhino is an implementation of JavaScript for the JVM.
+
+Local Modifications: None. We've used JarJar to renamespace the code
+post-compilation. See:
+http://code.google.com/p/jarjar/
+
+
+-----
+Code in:
+lib/args4j.jar
+
+Args4j
+URL: https://args4j.dev.java.net/
+Version: 2.0.12
+License: MIT
+
+Description:
+args4j is a small Java class library that makes it easy to parse command line
+options/arguments in your CUI application.
+
+Local Modifications: None.
+
+
+-----
+Code in:
+lib/guava.jar
+
+Guava Libraries
+URL: http://code.google.com/p/guava-libraries/
+Version:  r08
+License: Apache License 2.0
+
+Description: Google's core Java libraries.
+
+Local Modifications: None.
+
+
+-----
+Code in:
+lib/jsr305.jar
+
+Annotations for software defect detection
+URL: http://code.google.com/p/jsr-305/
+Version: svn revision 47
+License: BSD License
+
+Description: Annotations for software defect detection.
+
+Local Modifications: None.
+
+
+----
+Code in:
+lib/junit.jar
+
+JUnit
+URL:  http://sourceforge.net/projects/junit/
+Version:  4.8.2
+License:  Common Public License 1.0
+
+Description: A framework for writing and running automated tests in Java.
+
+Local Modifications: None.
+
+
+---
+Code in:
+lib/protobuf-java.jar
+
+Protocol Buffers
+URL: http://code.google.com/p/protobuf/
+Version: 2.3.0
+License: New BSD License
+
+Description: Supporting libraries for protocol buffers,
+an encoding of structured data.
+
+Local Modifications: None
+
+
+---
+Code in:
+lib/ant.jar
+lib/ant-launcher.jar
+
+URL: http://ant.apache.org/bindownload.cgi
+Version: 1.8.1
+License: Apache License 2.0
+Description:
+  Ant is a Java based build tool. In theory it is kind of like "make"
+  without make's wrinkles and with the full portability of pure java code.
+
+Local Modifications: None
+
+
+---
+Code in:
+lib/json.jar
+URL: http://json.org/java/index.html
+Version: JSON version 20090211
+License: MIT license
+Description:
+JSON is a set of java files for use in transmitting data in JSON format.
+
+Local Modifications: None
+
+---
+Code in:
+tools/maven-ant-tasks-2.1.1.jar
+URL: http://maven.apache.org
+Version 2.1.1
+License: Apache License 2.0
+Description:
+  Maven Ant tasks are used to manage dependencies and to install/deploy to
+  maven repositories.
+
+Local Modifications: None

BIN
utils/compiler.jar → utils/compiler/compiler.jar


+ 2 - 2
utils/exporters/blender/2.57/scripts/addons/io_mesh_threejs/export_threejs.py

@@ -80,8 +80,8 @@ COLORS = [0xeeeeee, 0xee0000, 0x00ee00, 0x0000ee, 0xeeee00, 0x00eeee, 0xee00ee]
 TEMPLATE_SCENE_ASCII = """\
 /* Converted from: %(fname)s
  *
- * File generated with Blender 2.56 Exporter
- * https://github.com/alteredq/three.js/tree/master/utils/exporters/blender/
+ * File generated with Blender 2.57 Exporter
+ * https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender/
  *
  * objects:    %(nobjects)s
  * geometries: %(ngeometries)s

BIN
utils/yuicompressor-2.4.2.jar


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików