2
0
Эх сурвалжийг харах

src/animation ⟶ src/extras/animation
Improved lod and grass examples.

Mr.doob 14 жил өмнө
parent
commit
3bc9f48c2f

+ 24 - 25
build/Three.js

@@ -48,7 +48,7 @@ d,c)}};THREE.Quaternion=function(b,d,c,f){this.set(b||0,d||0,c||0,f!==undefined?
 THREE.Quaternion.prototype={set:function(b,d,c,f){this.x=b;this.y=d;this.z=c;this.w=f;return this},setFromEuler:function(b){var d=0.5*Math.PI/360,c=b.x*d,f=b.y*d,g=b.z*d;b=Math.cos(f);f=Math.sin(f);d=Math.cos(-g);g=Math.sin(-g);var h=Math.cos(c);c=Math.sin(c);var j=b*d,k=f*g;this.w=j*h-k*c;this.x=j*c+k*h;this.y=f*d*h+b*g*c;this.z=b*g*h-f*d*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*=
 THREE.Quaternion.prototype={set:function(b,d,c,f){this.x=b;this.y=d;this.z=c;this.w=f;return this},setFromEuler:function(b){var d=0.5*Math.PI/360,c=b.x*d,f=b.y*d,g=b.z*d;b=Math.cos(f);f=Math.sin(f);d=Math.cos(-g);g=Math.sin(-g);var h=Math.cos(c);c=Math.sin(c);var j=b*d,k=f*g;this.w=j*h-k*c;this.x=j*c+k*h;this.y=f*d*h+b*g*c;this.z=b*g*h-f*d*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 b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(b==0)this.w=this.z=this.y=this.x=0;else{b=1/b;this.x*=b;this.y*=b;this.z*=b;this.w*=b}return this},multiplySelf:function(b){var d=this.x,c=this.y,f=this.z,g=this.w,h=b.x,j=b.y,k=b.z;b=b.w;this.x=d*b+g*h+c*k-f*j;this.y=c*b+g*j+f*h-d*k;this.z=f*b+g*k+d*j-c*h;this.w=g*b-d*h-c*j-f*k;return this},
 -1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(b==0)this.w=this.z=this.y=this.x=0;else{b=1/b;this.x*=b;this.y*=b;this.z*=b;this.w*=b}return this},multiplySelf:function(b){var d=this.x,c=this.y,f=this.z,g=this.w,h=b.x,j=b.y,k=b.z;b=b.w;this.x=d*b+g*h+c*k-f*j;this.y=c*b+g*j+f*h-d*k;this.z=f*b+g*k+d*j-c*h;this.w=g*b-d*h-c*j-f*k;return this},
 multiplyVector3:function(b,d){d||(d=b);var c=b.x,f=b.y,g=b.z,h=this.x,j=this.y,k=this.z,m=this.w,p=m*c+j*g-k*f,o=m*f+k*c-h*g,u=m*g+h*f-j*c;c=-h*c-j*f-k*g;d.x=p*m+c*-h+o*-k-u*-j;d.y=o*m+c*-j+u*-h-p*-k;d.z=u*m+c*-k+p*-j-o*-h;return d}};
 multiplyVector3:function(b,d){d||(d=b);var c=b.x,f=b.y,g=b.z,h=this.x,j=this.y,k=this.z,m=this.w,p=m*c+j*g-k*f,o=m*f+k*c-h*g,u=m*g+h*f-j*c;c=-h*c-j*f-k*g;d.x=p*m+c*-h+o*-k-u*-j;d.y=o*m+c*-j+u*-h-p*-k;d.z=u*m+c*-k+p*-j-o*-h;return d}};
-THREE.Quaternion.slerp=function(b,d,c,f){var g=b.w*d.w+b.x*d.x+b.y*d.y+b.z*d.z;if(Math.abs(g)>=1){c.w=b.w;c.x=b.x;c.y=b.y;c.z=b.z;return c}var h=Math.acos(g),j=Math.sqrt(1-g*g);if(Math.abs(j)<0.0010){c.w=0.5*(b.w+d.w);c.x=0.5*(b.x+d.x);c.y=0.5*(b.y+d.y);c.z=0.5*(b.z+d.z);return c}g=Math.sin((1-f)*h)/j;f=Math.sin(f*h)/j;c.w=b.w*g+d.w*f;c.x=b.x*g+d.x*f;c.y=b.y*g+d.y*f;c.z=b.z*g+d.z*f;return c};THREE.Vertex=function(b){this.position=b||new THREE.Vector3};
+THREE.Quaternion.slerp=function(b,d,c,f){var g=b.w*d.w+b.x*d.x+b.y*d.y+b.z*d.z;if(Math.abs(g)>=1){c.w=b.w;c.x=b.x;c.y=b.y;c.z=b.z;return c}var h=Math.acos(g),j=Math.sqrt(1-g*g);if(Math.abs(j)<0.001){c.w=0.5*(b.w+d.w);c.x=0.5*(b.x+d.x);c.y=0.5*(b.y+d.y);c.z=0.5*(b.z+d.z);return c}g=Math.sin((1-f)*h)/j;f=Math.sin(f*h)/j;c.w=b.w*g+d.w*f;c.x=b.x*g+d.x*f;c.y=b.y*g+d.y*f;c.z=b.z*g+d.z*f;return c};THREE.Vertex=function(b){this.position=b||new THREE.Vector3};
 THREE.Face3=function(b,d,c,f,g,h){this.a=b;this.b=d;this.c=c;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=h instanceof Array?h:[h];this.centroid=new THREE.Vector3};
 THREE.Face3=function(b,d,c,f,g,h){this.a=b;this.b=d;this.c=c;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=h instanceof Array?h:[h];this.centroid=new THREE.Vector3};
 THREE.Face4=function(b,d,c,f,g,h,j){this.a=b;this.b=d;this.c=c;this.d=f;this.normal=g instanceof THREE.Vector3?g:new THREE.Vector3;this.vertexNormals=g instanceof Array?g:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,d){this.set(b||0,d||0)};
 THREE.Face4=function(b,d,c,f,g,h,j){this.a=b;this.b=d;this.c=c;this.d=f;this.normal=g instanceof THREE.Vector3?g:new THREE.Vector3;this.vertexNormals=g instanceof Array?g:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,d){this.set(b||0,d||0)};
 THREE.UV.prototype={set:function(b,d){this.u=b;this.v=d;return this},copy:function(b){this.set(b.u,b.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
 THREE.UV.prototype={set:function(b,d){this.u=b;this.v=d;return this},copy:function(b){this.set(b.u,b.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
@@ -66,26 +66,8 @@ g=b(j.a,j.d);d(k,g,c);g=b(j.b,j.c);d(k,g,c);g=b(j.c,j.d);d(k,g,c)}}c=0;for(f=thi
 THREE.Spline=function(b){function d(t,B,F,H,G,X,A){t=(F-t)*0.5;H=(H-B)*0.5;return(2*(B-F)+t+H)*A+(-3*(B-F)-2*t-H)*X+t*G+B}this.points=b;var c=[],f={x:0,y:0,z:0},g,h,j,k,m,p,o,u,y;this.initFromArray=function(t){this.points=[];for(var B=0;B<t.length;B++)this.points[B]={x:t[B][0],y:t[B][1],z:t[B][2]}};this.getPoint=function(t){g=(this.points.length-1)*t;h=Math.floor(g);j=g-h;c[0]=h==0?h:h-1;c[1]=h;c[2]=h>this.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;p=this.points[c[0]];o=this.points[c[1]];
 THREE.Spline=function(b){function d(t,B,F,H,G,X,A){t=(F-t)*0.5;H=(H-B)*0.5;return(2*(B-F)+t+H)*A+(-3*(B-F)-2*t-H)*X+t*G+B}this.points=b;var c=[],f={x:0,y:0,z:0},g,h,j,k,m,p,o,u,y;this.initFromArray=function(t){this.points=[];for(var B=0;B<t.length;B++)this.points[B]={x:t[B][0],y:t[B][1],z:t[B][2]}};this.getPoint=function(t){g=(this.points.length-1)*t;h=Math.floor(g);j=g-h;c[0]=h==0?h:h-1;c[1]=h;c[2]=h>this.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;p=this.points[c[0]];o=this.points[c[1]];
 u=this.points[c[2]];y=this.points[c[3]];k=j*j;m=j*k;f.x=d(p.x,o.x,u.x,y.x,j,k,m);f.y=d(p.y,o.y,u.y,y.y,j,k,m);f.z=d(p.z,o.z,u.z,y.z,j,k,m);return f};this.getControlPointsArray=function(){var t,B,F=this.points.length,H=[];for(t=0;t<F;t++){B=this.points[t];H[t]=[B.x,B.y,B.z]}return H};this.getLength=function(t){var B,F,H=B=B=0,G=new THREE.Vector3,X=new THREE.Vector3,A=[],M=0;A[0]=0;t||(t=100);F=this.points.length*t;G.copy(this.points[0]);for(t=1;t<F;t++){B=t/F;position=this.getPoint(B);X.copy(position);
 u=this.points[c[2]];y=this.points[c[3]];k=j*j;m=j*k;f.x=d(p.x,o.x,u.x,y.x,j,k,m);f.y=d(p.y,o.y,u.y,y.y,j,k,m);f.z=d(p.z,o.z,u.z,y.z,j,k,m);return f};this.getControlPointsArray=function(){var t,B,F=this.points.length,H=[];for(t=0;t<F;t++){B=this.points[t];H[t]=[B.x,B.y,B.z]}return H};this.getLength=function(t){var B,F,H=B=B=0,G=new THREE.Vector3,X=new THREE.Vector3,A=[],M=0;A[0]=0;t||(t=100);F=this.points.length*t;G.copy(this.points[0]);for(t=1;t<F;t++){B=t/F;position=this.getPoint(B);X.copy(position);
 M+=X.distanceTo(G);G.copy(position);B*=this.points.length-1;B=Math.floor(B);if(B!=H){A[B]=M;H=B}}A[A.length]=M;return{chunks:A,total:M}};this.reparametrizeByArcLength=function(t){var B,F,H,G,X,A,M=[],Q=new THREE.Vector3,R=this.getLength();M.push(Q.copy(this.points[0]).clone());for(B=1;B<this.points.length;B++){F=R.chunks[B]-R.chunks[B-1];A=Math.ceil(t*F/R.total);G=(B-1)/(this.points.length-1);X=B/(this.points.length-1);for(F=1;F<A-1;F++){H=G+F*(1/A)*(X-G);position=this.getPoint(H);M.push(Q.copy(position).clone())}M.push(Q.copy(this.points[B]).clone())}this.points=
 M+=X.distanceTo(G);G.copy(position);B*=this.points.length-1;B=Math.floor(B);if(B!=H){A[B]=M;H=B}}A[A.length]=M;return{chunks:A,total:M}};this.reparametrizeByArcLength=function(t){var B,F,H,G,X,A,M=[],Q=new THREE.Vector3,R=this.getLength();M.push(Q.copy(this.points[0]).clone());for(B=1;B<this.points.length;B++){F=R.chunks[B]-R.chunks[B-1];A=Math.ceil(t*F/R.total);G=(B-1)/(this.points.length-1);X=B/(this.points.length-1);for(F=1;F<A-1;F++){H=G+F*(1/A)*(X-G);position=this.getPoint(H);M.push(Q.copy(position).clone())}M.push(Q.copy(this.points[B]).clone())}this.points=
-M}};THREE.Edge=function(b,d,c,f){this.vertices=[b,d];this.vertexIndices=[c,f];this.faces=[];this.faceIndices=[]};
-THREE.AnimationHandler=function(){var b=[],d={},c={};c.update=function(g){for(var h=0;h<b.length;h++)b[h].update(g)};c.addToUpdate=function(g){b.indexOf(g)===-1&&b.push(g)};c.removeFromUpdate=function(g){g=b.indexOf(g);g!==-1&&b.splice(g,1)};c.add=function(g){d[g.name]!==undefined&&console.log("THREE.AnimationHandler.add: Warning! "+g.name+" already exists in library. Overwriting.");d[g.name]=g;if(g.initialized!==!0){for(var h=0;h<g.hierarchy.length;h++){for(var j=0;j<g.hierarchy[h].keys.length;j++){if(g.hierarchy[h].keys[j].time<
-0)g.hierarchy[h].keys[j].time=0;if(g.hierarchy[h].keys[j].rot!==undefined&&!(g.hierarchy[h].keys[j].rot instanceof THREE.Quaternion)){var k=g.hierarchy[h].keys[j].rot;g.hierarchy[h].keys[j].rot=new THREE.Quaternion(k[0],k[1],k[2],k[3])}}if(g.hierarchy[h].keys[0].morphTargets!==undefined){k={};for(j=0;j<g.hierarchy[h].keys.length;j++)for(var m=0;m<g.hierarchy[h].keys[j].morphTargets.length;m++){var p=g.hierarchy[h].keys[j].morphTargets[m];k[p]=-1}g.hierarchy[h].usedMorphTargets=k;for(j=0;j<g.hierarchy[h].keys.length;j++){var o=
-{};for(p in k){for(m=0;m<g.hierarchy[h].keys[j].morphTargets.length;m++)if(g.hierarchy[h].keys[j].morphTargets[m]===p){o[p]=g.hierarchy[h].keys[j].morphTargetsInfluences[m];break}m===g.hierarchy[h].keys[j].morphTargets.length&&(o[p]=0)}g.hierarchy[h].keys[j].morphTargetsInfluences=o}}for(j=1;j<g.hierarchy[h].keys.length;j++)if(g.hierarchy[h].keys[j].time===g.hierarchy[h].keys[j-1].time){g.hierarchy[h].keys.splice(j,1);j--}for(j=1;j<g.hierarchy[h].keys.length;j++)g.hierarchy[h].keys[j].index=j}j=parseInt(g.length*
-g.fps,10);g.JIT={};g.JIT.hierarchy=[];for(h=0;h<g.hierarchy.length;h++)g.JIT.hierarchy.push(Array(j));g.initialized=!0}};c.get=function(g){if(typeof g==="string")if(d[g])return d[g];else{console.log("THREE.AnimationHandler.get: Couldn't find animation "+g);return null}};c.parse=function(g){var h=[];if(g instanceof THREE.SkinnedMesh)for(var j=0;j<g.bones.length;j++)h.push(g.bones[j]);else f(g,h);return h};var f=function(g,h){h.push(g);for(var j=0;j<g.children.length;j++)f(g.children[j],h)};c.LINEAR=
-0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(b,d,c,f){this.root=b;this.data=THREE.AnimationHandler.get(d);this.hierarchy=THREE.AnimationHandler.parse(b);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.isPaused=!0;this.loop=!0;this.interpolationType=c!==undefined?c:THREE.AnimationHandler.LINEAR;this.JITCompile=f!==undefined?f:!0;this.points=[];this.target=new THREE.Vector3};
-THREE.Animation.prototype.play=function(b,d){if(!this.isPlaying){this.isPlaying=!0;this.loop=b!==undefined?b:!0;this.currentTime=d!==undefined?d:0;var c,f=this.hierarchy.length,g;for(c=0;c<f;c++){g=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)g.useQuaternion=!0;g.matrixAutoUpdate=!0;if(g.animationCache===undefined){g.animationCache={};g.animationCache.prevKey={pos:0,rot:0,scl:0};g.animationCache.nextKey={pos:0,rot:0,scl:0};g.animationCache.originalMatrix=
-g instanceof THREE.Bone?g.skinMatrix:g.matrix}var h=g.animationCache.prevKey;g=g.animationCache.nextKey;h.pos=this.data.hierarchy[c].keys[0];h.rot=this.data.hierarchy[c].keys[0];h.scl=this.data.hierarchy[c].keys[0];g.pos=this.getNextKeyWith("pos",c,1);g.rot=this.getNextKeyWith("rot",c,1);g.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 b=0;b<this.hierarchy.length;b++)if(this.hierarchy[b].animationCache!==undefined){if(this.hierarchy[b]instanceof THREE.Bone)this.hierarchy[b].skinMatrix=this.hierarchy[b].animationCache.originalMatrix;else this.hierarchy[b].matrix=this.hierarchy[b].animationCache.originalMatrix;delete this.hierarchy[b].animationCache}};
-THREE.Animation.prototype.update=function(b){if(this.isPlaying){var d=["pos","rot","scl"],c,f,g,h,j,k,m,p,o=this.data.JIT.hierarchy,u,y;this.currentTime+=b*this.timeScale;y=this.currentTime;u=this.currentTime%=this.data.length;p=parseInt(Math.min(u*this.data.fps,this.data.length*this.data.fps),10);for(var t=0,B=this.hierarchy.length;t<B;t++){b=this.hierarchy[t];m=b.animationCache;if(this.JITCompile&&o[t][p]!==undefined)if(b instanceof THREE.Bone){b.skinMatrix=o[t][p];b.matrixAutoUpdate=!1;b.matrixWorldNeedsUpdate=
-!1}else{b.matrix=o[t][p];b.matrixAutoUpdate=!1;b.matrixWorldNeedsUpdate=!0}else{if(this.JITCompile)if(b instanceof THREE.Bone)b.skinMatrix=b.animationCache.originalMatrix;else b.matrix=b.animationCache.originalMatrix;for(var F=0;F<3;F++){c=d[F];j=m.prevKey[c];k=m.nextKey[c];if(k.time<=y){if(u<y)if(this.loop){j=this.data.hierarchy[t].keys[0];for(k=this.getNextKeyWith(c,t,1);k.time<u;){j=k;k=this.getNextKeyWith(c,t,k.index+1)}}else{this.stop();return}else{do{j=k;k=this.getNextKeyWith(c,t,k.index+1)}while(k.time<
-u)}m.prevKey[c]=j;m.nextKey[c]=k}b.matrixAutoUpdate=!0;b.matrixWorldNeedsUpdate=!0;f=(u-j.time)/(k.time-j.time);g=j[c];h=k[c];if(f<0||f>1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+t);f=f<0?0:1}if(c==="pos"){c=b.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){c.x=g[0]+(h[0]-g[0])*f;c.y=g[1]+(h[1]-g[1])*f;c.z=g[2]+(h[2]-g[2])*f}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=
-this.getPrevKeyWith("pos",t,j.index-1).pos;this.points[1]=g;this.points[2]=h;this.points[3]=this.getNextKeyWith("pos",t,k.index+1).pos;f=f*0.33+0.33;g=this.interpolateCatmullRom(this.points,f);c.x=g[0];c.y=g[1];c.z=g[2];if(this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){f=this.interpolateCatmullRom(this.points,f*1.01);this.target.set(f[0],f[1],f[2]);this.target.subSelf(c);this.target.y=0;this.target.normalize();f=Math.atan2(this.target.x,this.target.z);b.rotation.set(0,f,0)}}}else if(c===
-"rot")THREE.Quaternion.slerp(g,h,b.quaternion,f);else if(c==="scl"){c=b.scale;c.x=g[0]+(h[0]-g[0])*f;c.y=g[1]+(h[1]-g[1])*f;c.z=g[2]+(h[2]-g[2])*f}}}}if(this.JITCompile&&o[0][p]===undefined){this.hierarchy[0].update(undefined,!0);for(t=0;t<this.hierarchy.length;t++)o[t][p]=this.hierarchy[t]instanceof THREE.Bone?this.hierarchy[t].skinMatrix.clone():this.hierarchy[t].matrix.clone()}}};
-THREE.Animation.prototype.interpolateCatmullRom=function(b,d){var c=[],f=[],g,h,j,k,m,p;g=(b.length-1)*d;h=Math.floor(g);g-=h;c[0]=h==0?h:h-1;c[1]=h;c[2]=h>b.length-2?h:h+1;c[3]=h>b.length-3?h:h+2;h=b[c[0]];k=b[c[1]];m=b[c[2]];p=b[c[3]];c=g*g;j=g*c;f[0]=this.interpolate(h[0],k[0],m[0],p[0],g,c,j);f[1]=this.interpolate(h[1],k[1],m[1],p[1],g,c,j);f[2]=this.interpolate(h[2],k[2],m[2],p[2],g,c,j);return f};
-THREE.Animation.prototype.interpolate=function(b,d,c,f,g,h,j){b=(c-b)*0.5;f=(f-d)*0.5;return(2*(d-c)+b+f)*j+(-3*(d-c)-2*b-f)*h+b*g+d};THREE.Animation.prototype.getNextKeyWith=function(b,d,c){var f=this.data.hierarchy[d].keys;if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)c=c<f.length-1?c:f.length-1;else c%=f.length;for(;c<f.length;c++)if(f[c][b]!==undefined)return f[c];return this.data.hierarchy[d].keys[0]};
-THREE.Animation.prototype.getPrevKeyWith=function(b,d,c){var f=this.data.hierarchy[d].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+f.length;c>=0;c--)if(f[c][b]!==undefined)return f[c];return this.data.hierarchy[d].keys[f.length-1]};
-THREE.Camera=function(b,d,c,f,g){THREE.Object3D.call(this);this.fov=b||50;this.aspect=d||1;this.near=c||0.1;this.far=f||2E3;this.target=g||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;
-THREE.Camera.prototype.translate=function(b,d){this.matrix.rotateAxis(d);this.position.addSelf(d.multiplyScalar(b));this.target.position.addSelf(d.multiplyScalar(b))};THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Camera.prototype.updateMatrix=function(){this.update(undefined,!0)};
+M}};THREE.Edge=function(b,d,c,f){this.vertices=[b,d];this.vertexIndices=[c,f];this.faces=[];this.faceIndices=[]};THREE.Camera=function(b,d,c,f,g){THREE.Object3D.call(this);this.fov=b||50;this.aspect=d||1;this.near=c||0.1;this.far=f||2E3;this.target=g||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;
+THREE.Camera.prototype.supr=THREE.Object3D.prototype;THREE.Camera.prototype.translate=function(b,d){this.matrix.rotateAxis(d);this.position.addSelf(d.multiplyScalar(b));this.target.position.addSelf(d.multiplyScalar(b))};THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Camera.prototype.updateMatrix=function(){this.update(undefined,!0)};
 THREE.Camera.prototype.update=function(b,d,c){if(this.useTarget){this.matrix.lookAt(this.position,this.target.position,this.up);this.matrix.setPosition(this.position);b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix);THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);d=!0}else{this.matrixAutoUpdate&&(d|=this.updateMatrix());if(d||this.matrixWorldNeedsUpdate){b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=
 THREE.Camera.prototype.update=function(b,d,c){if(this.useTarget){this.matrix.lookAt(this.position,this.target.position,this.up);this.matrix.setPosition(this.position);b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix);THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);d=!0}else{this.matrixAutoUpdate&&(d|=this.updateMatrix());if(d||this.matrixWorldNeedsUpdate){b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=
 !1;d=!0;THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse)}}for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,d,c)};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;
 !1;d=!0;THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse)}}for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,d,c)};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(b,d,c){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.intensity=d||1;this.distance=c||0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(b,d,c){THREE.Light.call(this,b);this.position=new THREE.Vector3;this.intensity=d||1;this.distance=c||0};THREE.PointLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(b,d,c){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.intensity=d||1;this.distance=c||0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(b,d,c){THREE.Light.call(this,b);this.position=new THREE.Vector3;this.intensity=d||1;this.distance=c||0};THREE.PointLight.prototype=new THREE.Light;
@@ -268,7 +250,7 @@ w=0;for(x=n.__webglSprites.length;w<x;w++){z=n.__webglSprites[w];if(z.material==
 e.depthMask(Z)}function F(n,C){var w,x,z=n.__webglLensFlares.length,J,K,I,S=new THREE.Vector3,D=la/ja,O=ja*0.5,L=la*0.5,$=16/la,V=[$*D,$],xa=[1,1,0],Ja=[1,1],za=N.uniforms;w=N.attributes;e.useProgram(N.program);Ba=N.program;ga="";if(!Ca){e.enableVertexAttribArray(N.attributes.vertex);e.enableVertexAttribArray(N.attributes.uv);Ca=!0}e.uniform1i(za.occlusionMap,0);e.uniform1i(za.map,1);e.bindBuffer(e.ARRAY_BUFFER,N.vertexBuffer);e.vertexAttribPointer(w.vertex,2,e.FLOAT,!1,16,0);e.vertexAttribPointer(w.uv,
 e.depthMask(Z)}function F(n,C){var w,x,z=n.__webglLensFlares.length,J,K,I,S=new THREE.Vector3,D=la/ja,O=ja*0.5,L=la*0.5,$=16/la,V=[$*D,$],xa=[1,1,0],Ja=[1,1],za=N.uniforms;w=N.attributes;e.useProgram(N.program);Ba=N.program;ga="";if(!Ca){e.enableVertexAttribArray(N.attributes.vertex);e.enableVertexAttribArray(N.attributes.uv);Ca=!0}e.uniform1i(za.occlusionMap,0);e.uniform1i(za.map,1);e.bindBuffer(e.ARRAY_BUFFER,N.vertexBuffer);e.vertexAttribPointer(w.vertex,2,e.FLOAT,!1,16,0);e.vertexAttribPointer(w.uv,
 2,e.FLOAT,!1,16,8);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,N.elementBuffer);e.disable(e.CULL_FACE);e.depthMask(!1);e.activeTexture(e.TEXTURE0);e.bindTexture(e.TEXTURE_2D,N.occlusionTexture);e.activeTexture(e.TEXTURE1);for(x=0;x<z;x++){w=n.__webglLensFlares[x].object;S.set(w.matrixWorld.n14,w.matrixWorld.n24,w.matrixWorld.n34);C.matrixWorldInverse.multiplyVector3(S);C.projectionMatrix.multiplyVector3(S);xa[0]=S.x;xa[1]=S.y;xa[2]=S.z;Ja[0]=xa[0]*O+O;Ja[1]=xa[1]*L+L;if(N.hasVertexTexture||Ja[0]>0&&Ja[0]<
 2,e.FLOAT,!1,16,8);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,N.elementBuffer);e.disable(e.CULL_FACE);e.depthMask(!1);e.activeTexture(e.TEXTURE0);e.bindTexture(e.TEXTURE_2D,N.occlusionTexture);e.activeTexture(e.TEXTURE1);for(x=0;x<z;x++){w=n.__webglLensFlares[x].object;S.set(w.matrixWorld.n14,w.matrixWorld.n24,w.matrixWorld.n34);C.matrixWorldInverse.multiplyVector3(S);C.projectionMatrix.multiplyVector3(S);xa[0]=S.x;xa[1]=S.y;xa[2]=S.z;Ja[0]=xa[0]*O+O;Ja[1]=xa[1]*L+L;if(N.hasVertexTexture||Ja[0]>0&&Ja[0]<
 ja&&Ja[1]>0&&Ja[1]<la){e.bindTexture(e.TEXTURE_2D,N.tempTexture);e.copyTexImage2D(e.TEXTURE_2D,0,e.RGB,Ja[0]-8,Ja[1]-8,16,16,0);e.uniform1i(za.renderType,0);e.uniform2fv(za.scale,V);e.uniform3fv(za.screenPosition,xa);e.disable(e.BLEND);e.enable(e.DEPTH_TEST);e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0);e.bindTexture(e.TEXTURE_2D,N.occlusionTexture);e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,Ja[0]-8,Ja[1]-8,16,16,0);e.uniform1i(za.renderType,1);e.disable(e.DEPTH_TEST);e.bindTexture(e.TEXTURE_2D,N.tempTexture);
 ja&&Ja[1]>0&&Ja[1]<la){e.bindTexture(e.TEXTURE_2D,N.tempTexture);e.copyTexImage2D(e.TEXTURE_2D,0,e.RGB,Ja[0]-8,Ja[1]-8,16,16,0);e.uniform1i(za.renderType,0);e.uniform2fv(za.scale,V);e.uniform3fv(za.screenPosition,xa);e.disable(e.BLEND);e.enable(e.DEPTH_TEST);e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0);e.bindTexture(e.TEXTURE_2D,N.occlusionTexture);e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,Ja[0]-8,Ja[1]-8,16,16,0);e.uniform1i(za.renderType,1);e.disable(e.DEPTH_TEST);e.bindTexture(e.TEXTURE_2D,N.tempTexture);
-e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0);w.positionScreen.x=xa[0];w.positionScreen.y=xa[1];w.positionScreen.z=xa[2];w.customUpdateCallback?w.customUpdateCallback(w):w.updateLensFlares();e.uniform1i(za.renderType,2);e.enable(e.BLEND);J=0;for(K=w.lensFlares.length;J<K;J++){I=w.lensFlares[J];if(I.opacity>0.0010&&I.scale>0.0010){xa[0]=I.x;xa[1]=I.y;xa[2]=I.z;$=I.size*I.scale/la;V[0]=$*D;V[1]=$;e.uniform3fv(za.screenPosition,xa);e.uniform2fv(za.scale,V);e.uniform1f(za.rotation,I.rotation);e.uniform1f(za.opacity,
+e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0);w.positionScreen.x=xa[0];w.positionScreen.y=xa[1];w.positionScreen.z=xa[2];w.customUpdateCallback?w.customUpdateCallback(w):w.updateLensFlares();e.uniform1i(za.renderType,2);e.enable(e.BLEND);J=0;for(K=w.lensFlares.length;J<K;J++){I=w.lensFlares[J];if(I.opacity>0.001&&I.scale>0.001){xa[0]=I.x;xa[1]=I.y;xa[2]=I.z;$=I.size*I.scale/la;V[0]=$*D;V[1]=$;e.uniform3fv(za.screenPosition,xa);e.uniform2fv(za.scale,V);e.uniform1f(za.rotation,I.rotation);e.uniform1f(za.opacity,
 I.opacity);M(I.blending);R(I.texture,1);e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)}}}}e.enable(e.CULL_FACE);e.enable(e.DEPTH_TEST);e.depthMask(Z)}function H(n,C){n._modelViewMatrix.multiplyToArray(C.matrixWorldInverse,n.matrixWorld,n._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(n._modelViewMatrix).transposeIntoArray(n._normalMatrixArray)}function G(n){var C,w,x,z,J;if(n instanceof THREE.Mesh){w=n.geometry;for(C in w.geometryGroups){x=w.geometryGroups[C];J=!1;for(z in x.__webglCustomAttributes)if(x.__webglCustomAttributes[z].needsUpdate){J=
 I.opacity);M(I.blending);R(I.texture,1);e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)}}}}e.enable(e.CULL_FACE);e.enable(e.DEPTH_TEST);e.depthMask(Z)}function H(n,C){n._modelViewMatrix.multiplyToArray(C.matrixWorldInverse,n.matrixWorld,n._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(n._modelViewMatrix).transposeIntoArray(n._normalMatrixArray)}function G(n){var C,w,x,z,J;if(n instanceof THREE.Mesh){w=n.geometry;for(C in w.geometryGroups){x=w.geometryGroups[C];J=!1;for(z in x.__webglCustomAttributes)if(x.__webglCustomAttributes[z].needsUpdate){J=
 !0;break}if(w.__dirtyVertices||w.__dirtyMorphTargets||w.__dirtyElements||w.__dirtyUvs||w.__dirtyNormals||w.__dirtyColors||w.__dirtyTangents||J){J=e.DYNAMIC_DRAW;var K=void 0,I=void 0,S=void 0,D=void 0;S=void 0;var O=void 0,L=void 0,$=void 0,V=void 0,xa=void 0,Ja=void 0,za=void 0,ta=void 0,Oa=void 0,Ga=void 0,wa=void 0,Ha=void 0,Ua=void 0;L=void 0;$=void 0;D=void 0;V=void 0;D=void 0;var E=void 0,fa=void 0;L=void 0;E=void 0;fa=void 0;var v=void 0,bb=void 0;E=void 0;fa=void 0;v=void 0;bb=void 0;E=void 0;
 !0;break}if(w.__dirtyVertices||w.__dirtyMorphTargets||w.__dirtyElements||w.__dirtyUvs||w.__dirtyNormals||w.__dirtyColors||w.__dirtyTangents||J){J=e.DYNAMIC_DRAW;var K=void 0,I=void 0,S=void 0,D=void 0;S=void 0;var O=void 0,L=void 0,$=void 0,V=void 0,xa=void 0,Ja=void 0,za=void 0,ta=void 0,Oa=void 0,Ga=void 0,wa=void 0,Ha=void 0,Ua=void 0;L=void 0;$=void 0;D=void 0;V=void 0;D=void 0;var E=void 0,fa=void 0;L=void 0;E=void 0;fa=void 0;var v=void 0,bb=void 0;E=void 0;fa=void 0;v=void 0;bb=void 0;E=void 0;
 fa=void 0;v=void 0;bb=void 0;E=void 0;fa=void 0;v=void 0;D=void 0;V=void 0;O=void 0;S=void 0;S=void 0;E=void 0;fa=void 0;v=void 0;var db=void 0,Ma=0,Pa=0,hb=0,eb=0,$a=0,ab=0,La=0,cb=0,Aa=0,U=0,Qa=0;fa=E=0;var Sa=x.__vertexArray,jb=x.__uvArray,Xa=x.__uv2Array,W=x.__normalArray,ia=x.__tangentArray,ka=x.__colorArray,da=x.__skinVertexAArray,ra=x.__skinVertexBArray,qa=x.__skinIndexArray,ha=x.__skinWeightArray,Y=x.__morphTargetsArrays,Ia=x.__webglCustomAttributes;v=void 0;var Va=x.__faceArray,Ta=x.__lineArray,
 fa=void 0;v=void 0;bb=void 0;E=void 0;fa=void 0;v=void 0;D=void 0;V=void 0;O=void 0;S=void 0;S=void 0;E=void 0;fa=void 0;v=void 0;var db=void 0,Ma=0,Pa=0,hb=0,eb=0,$a=0,ab=0,La=0,cb=0,Aa=0,U=0,Qa=0;fa=E=0;var Sa=x.__vertexArray,jb=x.__uvArray,Xa=x.__uv2Array,W=x.__normalArray,ia=x.__tangentArray,ka=x.__colorArray,da=x.__skinVertexAArray,ra=x.__skinVertexBArray,qa=x.__skinIndexArray,ha=x.__skinWeightArray,Y=x.__morphTargetsArrays,Ia=x.__webglCustomAttributes;v=void 0;var Va=x.__faceArray,Ta=x.__lineArray,
@@ -355,6 +337,23 @@ THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.posi
 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.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableObject=function(){this.z=this.object=null};THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.materials=null};
 THREE.RenderableObject=function(){this.z=this.object=null};THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.materials=null};
+THREE.AnimationHandler=function(){var b=[],d={},c={};c.update=function(g){for(var h=0;h<b.length;h++)b[h].update(g)};c.addToUpdate=function(g){b.indexOf(g)===-1&&b.push(g)};c.removeFromUpdate=function(g){g=b.indexOf(g);g!==-1&&b.splice(g,1)};c.add=function(g){d[g.name]!==undefined&&console.log("THREE.AnimationHandler.add: Warning! "+g.name+" already exists in library. Overwriting.");d[g.name]=g;if(g.initialized!==!0){for(var h=0;h<g.hierarchy.length;h++){for(var j=0;j<g.hierarchy[h].keys.length;j++){if(g.hierarchy[h].keys[j].time<
+0)g.hierarchy[h].keys[j].time=0;if(g.hierarchy[h].keys[j].rot!==undefined&&!(g.hierarchy[h].keys[j].rot instanceof THREE.Quaternion)){var k=g.hierarchy[h].keys[j].rot;g.hierarchy[h].keys[j].rot=new THREE.Quaternion(k[0],k[1],k[2],k[3])}}if(g.hierarchy[h].keys[0].morphTargets!==undefined){k={};for(j=0;j<g.hierarchy[h].keys.length;j++)for(var m=0;m<g.hierarchy[h].keys[j].morphTargets.length;m++){var p=g.hierarchy[h].keys[j].morphTargets[m];k[p]=-1}g.hierarchy[h].usedMorphTargets=k;for(j=0;j<g.hierarchy[h].keys.length;j++){var o=
+{};for(p in k){for(m=0;m<g.hierarchy[h].keys[j].morphTargets.length;m++)if(g.hierarchy[h].keys[j].morphTargets[m]===p){o[p]=g.hierarchy[h].keys[j].morphTargetsInfluences[m];break}m===g.hierarchy[h].keys[j].morphTargets.length&&(o[p]=0)}g.hierarchy[h].keys[j].morphTargetsInfluences=o}}for(j=1;j<g.hierarchy[h].keys.length;j++)if(g.hierarchy[h].keys[j].time===g.hierarchy[h].keys[j-1].time){g.hierarchy[h].keys.splice(j,1);j--}for(j=1;j<g.hierarchy[h].keys.length;j++)g.hierarchy[h].keys[j].index=j}j=parseInt(g.length*
+g.fps,10);g.JIT={};g.JIT.hierarchy=[];for(h=0;h<g.hierarchy.length;h++)g.JIT.hierarchy.push(Array(j));g.initialized=!0}};c.get=function(g){if(typeof g==="string")if(d[g])return d[g];else{console.log("THREE.AnimationHandler.get: Couldn't find animation "+g);return null}};c.parse=function(g){var h=[];if(g instanceof THREE.SkinnedMesh)for(var j=0;j<g.bones.length;j++)h.push(g.bones[j]);else f(g,h);return h};var f=function(g,h){h.push(g);for(var j=0;j<g.children.length;j++)f(g.children[j],h)};c.LINEAR=
+0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(b,d,c,f){this.root=b;this.data=THREE.AnimationHandler.get(d);this.hierarchy=THREE.AnimationHandler.parse(b);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.isPaused=!0;this.loop=!0;this.interpolationType=c!==undefined?c:THREE.AnimationHandler.LINEAR;this.JITCompile=f!==undefined?f:!0;this.points=[];this.target=new THREE.Vector3};
+THREE.Animation.prototype.play=function(b,d){if(!this.isPlaying){this.isPlaying=!0;this.loop=b!==undefined?b:!0;this.currentTime=d!==undefined?d:0;var c,f=this.hierarchy.length,g;for(c=0;c<f;c++){g=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)g.useQuaternion=!0;g.matrixAutoUpdate=!0;if(g.animationCache===undefined){g.animationCache={};g.animationCache.prevKey={pos:0,rot:0,scl:0};g.animationCache.nextKey={pos:0,rot:0,scl:0};g.animationCache.originalMatrix=
+g instanceof THREE.Bone?g.skinMatrix:g.matrix}var h=g.animationCache.prevKey;g=g.animationCache.nextKey;h.pos=this.data.hierarchy[c].keys[0];h.rot=this.data.hierarchy[c].keys[0];h.scl=this.data.hierarchy[c].keys[0];g.pos=this.getNextKeyWith("pos",c,1);g.rot=this.getNextKeyWith("rot",c,1);g.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 b=0;b<this.hierarchy.length;b++)if(this.hierarchy[b].animationCache!==undefined){if(this.hierarchy[b]instanceof THREE.Bone)this.hierarchy[b].skinMatrix=this.hierarchy[b].animationCache.originalMatrix;else this.hierarchy[b].matrix=this.hierarchy[b].animationCache.originalMatrix;delete this.hierarchy[b].animationCache}};
+THREE.Animation.prototype.update=function(b){if(this.isPlaying){var d=["pos","rot","scl"],c,f,g,h,j,k,m,p,o=this.data.JIT.hierarchy,u,y;this.currentTime+=b*this.timeScale;y=this.currentTime;u=this.currentTime%=this.data.length;p=parseInt(Math.min(u*this.data.fps,this.data.length*this.data.fps),10);for(var t=0,B=this.hierarchy.length;t<B;t++){b=this.hierarchy[t];m=b.animationCache;if(this.JITCompile&&o[t][p]!==undefined)if(b instanceof THREE.Bone){b.skinMatrix=o[t][p];b.matrixAutoUpdate=!1;b.matrixWorldNeedsUpdate=
+!1}else{b.matrix=o[t][p];b.matrixAutoUpdate=!1;b.matrixWorldNeedsUpdate=!0}else{if(this.JITCompile)if(b instanceof THREE.Bone)b.skinMatrix=b.animationCache.originalMatrix;else b.matrix=b.animationCache.originalMatrix;for(var F=0;F<3;F++){c=d[F];j=m.prevKey[c];k=m.nextKey[c];if(k.time<=y){if(u<y)if(this.loop){j=this.data.hierarchy[t].keys[0];for(k=this.getNextKeyWith(c,t,1);k.time<u;){j=k;k=this.getNextKeyWith(c,t,k.index+1)}}else{this.stop();return}else{do{j=k;k=this.getNextKeyWith(c,t,k.index+1)}while(k.time<
+u)}m.prevKey[c]=j;m.nextKey[c]=k}b.matrixAutoUpdate=!0;b.matrixWorldNeedsUpdate=!0;f=(u-j.time)/(k.time-j.time);g=j[c];h=k[c];if(f<0||f>1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+t);f=f<0?0:1}if(c==="pos"){c=b.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){c.x=g[0]+(h[0]-g[0])*f;c.y=g[1]+(h[1]-g[1])*f;c.z=g[2]+(h[2]-g[2])*f}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=
+this.getPrevKeyWith("pos",t,j.index-1).pos;this.points[1]=g;this.points[2]=h;this.points[3]=this.getNextKeyWith("pos",t,k.index+1).pos;f=f*0.33+0.33;g=this.interpolateCatmullRom(this.points,f);c.x=g[0];c.y=g[1];c.z=g[2];if(this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){f=this.interpolateCatmullRom(this.points,f*1.01);this.target.set(f[0],f[1],f[2]);this.target.subSelf(c);this.target.y=0;this.target.normalize();f=Math.atan2(this.target.x,this.target.z);b.rotation.set(0,f,0)}}}else if(c===
+"rot")THREE.Quaternion.slerp(g,h,b.quaternion,f);else if(c==="scl"){c=b.scale;c.x=g[0]+(h[0]-g[0])*f;c.y=g[1]+(h[1]-g[1])*f;c.z=g[2]+(h[2]-g[2])*f}}}}if(this.JITCompile&&o[0][p]===undefined){this.hierarchy[0].update(undefined,!0);for(t=0;t<this.hierarchy.length;t++)o[t][p]=this.hierarchy[t]instanceof THREE.Bone?this.hierarchy[t].skinMatrix.clone():this.hierarchy[t].matrix.clone()}}};
+THREE.Animation.prototype.interpolateCatmullRom=function(b,d){var c=[],f=[],g,h,j,k,m,p;g=(b.length-1)*d;h=Math.floor(g);g-=h;c[0]=h==0?h:h-1;c[1]=h;c[2]=h>b.length-2?h:h+1;c[3]=h>b.length-3?h:h+2;h=b[c[0]];k=b[c[1]];m=b[c[2]];p=b[c[3]];c=g*g;j=g*c;f[0]=this.interpolate(h[0],k[0],m[0],p[0],g,c,j);f[1]=this.interpolate(h[1],k[1],m[1],p[1],g,c,j);f[2]=this.interpolate(h[2],k[2],m[2],p[2],g,c,j);return f};
+THREE.Animation.prototype.interpolate=function(b,d,c,f,g,h,j){b=(c-b)*0.5;f=(f-d)*0.5;return(2*(d-c)+b+f)*j+(-3*(d-c)-2*b-f)*h+b*g+d};THREE.Animation.prototype.getNextKeyWith=function(b,d,c){var f=this.data.hierarchy[d].keys;if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)c=c<f.length-1?c:f.length-1;else c%=f.length;for(;c<f.length;c++)if(f[c][b]!==undefined)return f[c];return this.data.hierarchy[d].keys[0]};
+THREE.Animation.prototype.getPrevKeyWith=function(b,d,c){var f=this.data.hierarchy[d].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+f.length;c>=0;c--)if(f[c][b]!==undefined)return f[c];return this.data.hierarchy[d].keys[f.length-1]};
 var GeometryUtils={merge:function(b,d){var c=d instanceof THREE.Mesh,f=b.vertices.length,g=c?d.geometry:d,h=b.vertices,j=g.vertices,k=b.faces,m=g.faces,p=b.faceVertexUvs[0];g=g.faceVertexUvs[0];c&&d.matrixAutoUpdate&&d.updateMatrix();for(var o=0,u=j.length;o<u;o++){var y=new THREE.Vertex(j[o].position.clone());c&&d.matrix.multiplyVector3(y.position);h.push(y)}o=0;for(u=m.length;o<u;o++){j=m[o];var t,B,F=j.vertexNormals;y=j.vertexColors;if(j instanceof THREE.Face3)t=new THREE.Face3(j.a+f,j.b+f,j.c+
 var GeometryUtils={merge:function(b,d){var c=d instanceof THREE.Mesh,f=b.vertices.length,g=c?d.geometry:d,h=b.vertices,j=g.vertices,k=b.faces,m=g.faces,p=b.faceVertexUvs[0];g=g.faceVertexUvs[0];c&&d.matrixAutoUpdate&&d.updateMatrix();for(var o=0,u=j.length;o<u;o++){var y=new THREE.Vertex(j[o].position.clone());c&&d.matrix.multiplyVector3(y.position);h.push(y)}o=0;for(u=m.length;o<u;o++){j=m[o];var t,B,F=j.vertexNormals;y=j.vertexColors;if(j instanceof THREE.Face3)t=new THREE.Face3(j.a+f,j.b+f,j.c+
 f);else j instanceof THREE.Face4&&(t=new THREE.Face4(j.a+f,j.b+f,j.c+f,j.d+f));t.normal.copy(j.normal);c=0;for(h=F.length;c<h;c++){B=F[c];t.vertexNormals.push(B.clone())}t.color.copy(j.color);c=0;for(h=y.length;c<h;c++){B=y[c];t.vertexColors.push(B.clone())}t.materials=j.materials.slice();t.centroid.copy(j.centroid);k.push(t)}o=0;for(u=g.length;o<u;o++){f=g[o];k=[];c=0;for(h=f.length;c<h;c++)k.push(new THREE.UV(f[c].u,f[c].v));p.push(k)}}};
 f);else j instanceof THREE.Face4&&(t=new THREE.Face4(j.a+f,j.b+f,j.c+f,j.d+f));t.normal.copy(j.normal);c=0;for(h=F.length;c<h;c++){B=F[c];t.vertexNormals.push(B.clone())}t.color.copy(j.color);c=0;for(h=y.length;c<h;c++){B=y[c];t.vertexColors.push(B.clone())}t.materials=j.materials.slice();t.centroid.copy(j.centroid);k.push(t)}o=0;for(u=g.length;o<u;o++){f=g[o];k=[];c=0;for(h=f.length;c<h;c++)k.push(new THREE.UV(f[c].u,f[c].v));p.push(k)}}};
 THREE.ImageUtils={loadTexture:function(b,d,c){var f=new Image,g=new THREE.Texture(f,d);f.onload=function(){g.needsUpdate=!0;c&&c(this)};f.src=b;return g},loadTextureCube:function(b,d,c){var f,g=[],h=new THREE.Texture(g,d);d=g.loadCount=0;for(f=b.length;d<f;++d){g[d]=new Image;g[d].onload=function(){g.loadCount+=1;if(g.loadCount==6)h.needsUpdate=!0;c&&c(this)};g[d].src=b[d]}return h}};
 THREE.ImageUtils={loadTexture:function(b,d,c){var f=new Image,g=new THREE.Texture(f,d);f.onload=function(){g.needsUpdate=!0;c&&c(this)};f.src=b;return g},loadTextureCube:function(b,d,c){var f,g=[],h=new THREE.Texture(g,d);d=g.loadCount=0;for(f=b.length;d<f;++d){g[d]=new Image;g[d].onload=function(){g.loadCount+=1;if(g.loadCount==6)h.needsUpdate=!0;c&&c(this)};g[d].src=b[d]}return h}};
@@ -372,7 +371,7 @@ value:0,texture:null},uImageIncrement:{type:"v2",value:new THREE.Vector2(0.00195
 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}"},
 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}",
 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(b){var d,c,f,g,h=2*Math.ceil(b*3)+1;h>25&&(h=25);g=(h-1)*0.5;c=Array(h);for(d=f=0;d<h;++d){c[d]=Math.exp(-((d-g)*(d-g))/(2*b*b));f+=c[d]}for(d=0;d<h;++d)c[d]/=f;return c}};
 fragmentShader:"void main() {\ngl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );\n}"}},buildKernel:function(b){var d,c,f,g,h=2*Math.ceil(b*3)+1;h>25&&(h=25);g=(h-1)*0.5;c=Array(h);for(d=f=0;d<h;++d){c[d]=Math.exp(-((d-g)*(d-g))/(2*b*b));f+=c[d]}for(d=0;d<h;++d)c[d]/=f;return c}};
-THREE.QuakeCamera=function(b){function d(c,f){return function(){f.apply(c,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;if(b){if(b.movementSpeed!==undefined)this.movementSpeed=b.movementSpeed;if(b.lookSpeed!==undefined)this.lookSpeed=
+THREE.QuakeCamera=function(b){function d(c,f){return function(){f.apply(c,arguments)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;if(b){if(b.movementSpeed!==undefined)this.movementSpeed=b.movementSpeed;if(b.lookSpeed!==undefined)this.lookSpeed=
 b.lookSpeed;if(b.noFly!==undefined)this.noFly=b.noFly;if(b.lookVertical!==undefined)this.lookVertical=b.lookVertical;if(b.autoForward!==undefined)this.autoForward=b.autoForward;if(b.activeLook!==undefined)this.activeLook=b.activeLook;if(b.heightSpeed!==undefined)this.heightSpeed=b.heightSpeed;if(b.heightCoef!==undefined)this.heightCoef=b.heightCoef;if(b.heightMin!==undefined)this.heightMin=b.heightMin;if(b.heightMax!==undefined)this.heightMax=b.heightMax;if(b.constrainVertical!==undefined)this.constrainVertical=
 b.lookSpeed;if(b.noFly!==undefined)this.noFly=b.noFly;if(b.lookVertical!==undefined)this.lookVertical=b.lookVertical;if(b.autoForward!==undefined)this.autoForward=b.autoForward;if(b.activeLook!==undefined)this.activeLook=b.activeLook;if(b.heightSpeed!==undefined)this.heightSpeed=b.heightSpeed;if(b.heightCoef!==undefined)this.heightCoef=b.heightCoef;if(b.heightMin!==undefined)this.heightMin=b.heightMin;if(b.heightMax!==undefined)this.heightMax=b.heightMax;if(b.constrainVertical!==undefined)this.constrainVertical=
 b.constrainVertical;if(b.verticalMin!==undefined)this.verticalMin=b.verticalMin;if(b.verticalMax!==undefined)this.verticalMax=b.verticalMax;if(b.domElement!==undefined)this.domElement=b.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(c){c.preventDefault();
 b.constrainVertical;if(b.verticalMin!==undefined)this.verticalMin=b.verticalMin;if(b.verticalMax!==undefined)this.verticalMax=b.verticalMax;if(b.domElement!==undefined)this.domElement=b.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(c){c.preventDefault();
 c.stopPropagation();if(this.activeLook)switch(c.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(c){c.preventDefault();c.stopPropagation();if(this.activeLook)switch(c.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(c){this.mouseX=c.clientX-this.windowHalfX;this.mouseY=c.clientY-this.windowHalfY};this.onKeyDown=function(c){switch(c.keyCode){case 38:case 87:this.moveForward=
 c.stopPropagation();if(this.activeLook)switch(c.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(c){c.preventDefault();c.stopPropagation();if(this.activeLook)switch(c.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(c){this.mouseX=c.clientX-this.windowHalfX;this.mouseY=c.clientY-this.windowHalfY};this.onKeyDown=function(c){switch(c.keyCode){case 38:case 87:this.moveForward=
@@ -383,7 +382,7 @@ this.heightMax?this.heightMax:this.position.y)-this.heightMin)*this.heightCoef:0
 this.onMouseUp),!1);this.domElement.addEventListener("keydown",d(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",d(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(b,d){this.matrix.rotateAxis(d);if(this.noFly)d.y=0;this.position.addSelf(d.multiplyScalar(b));this.target.position.addSelf(d.multiplyScalar(b))};
 this.onMouseUp),!1);this.domElement.addEventListener("keydown",d(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",d(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(b,d){this.matrix.rotateAxis(d);if(this.noFly)d.y=0;this.position.addSelf(d.multiplyScalar(b));this.target.position.addSelf(d.multiplyScalar(b))};
 THREE.PathCamera=function(b){function d(p,o,u,y){var t={name:u,fps:0.6,length:y,hierarchy:[]},B,F=o.getControlPointsArray(),H=o.getLength(),G=F.length,X=0;B=G-1;o={parent:-1,keys:[]};o.keys[0]={time:0,pos:F[0],rot:[0,0,0,1],scl:[1,1,1]};o.keys[B]={time:y,pos:F[B],rot:[0,0,0,1],scl:[1,1,1]};for(B=1;B<G-1;B++){X=y*H.chunks[B]/H.total;o.keys[B]={time:X,pos:F[B]}}t.hierarchy[0]=o;THREE.AnimationHandler.add(t);return new THREE.Animation(p,u,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function c(p,o){var u,
 THREE.PathCamera=function(b){function d(p,o,u,y){var t={name:u,fps:0.6,length:y,hierarchy:[]},B,F=o.getControlPointsArray(),H=o.getLength(),G=F.length,X=0;B=G-1;o={parent:-1,keys:[]};o.keys[0]={time:0,pos:F[0],rot:[0,0,0,1],scl:[1,1,1]};o.keys[B]={time:y,pos:F[B],rot:[0,0,0,1],scl:[1,1,1]};for(B=1;B<G-1;B++){X=y*H.chunks[B]/H.total;o.keys[B]={time:X,pos:F[B]}}t.hierarchy[0]=o;THREE.AnimationHandler.add(t);return new THREE.Animation(p,u,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function c(p,o){var u,
 y,t=new THREE.Geometry;for(u=0;u<p.points.length*o;u++){y=u/(p.points.length*o);y=p.getPoint(y);t.vertices[u]=new THREE.Vertex(new THREE.Vector3(y.x,y.y,y.z))}return t}function f(p,o){var u=c(o,10),y=c(o,10),t=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(u,t);particleObj=new THREE.ParticleSystem(y,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);p.addChild(lineObj);particleObj.scale.set(1,1,1);p.addChild(particleObj);y=new Sphere(1,
 y,t=new THREE.Geometry;for(u=0;u<p.points.length*o;u++){y=u/(p.points.length*o);y=p.getPoint(y);t.vertices[u]=new THREE.Vertex(new THREE.Vector3(y.x,y.y,y.z))}return t}function f(p,o){var u=c(o,10),y=c(o,10),t=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(u,t);particleObj=new THREE.ParticleSystem(y,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);p.addChild(lineObj);particleObj.scale.set(1,1,1);p.addChild(particleObj);y=new Sphere(1,
-16,8);t=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<o.points.length;i++){u=new THREE.Mesh(y,t);u.position.copy(o.points[i]);u.updateMatrix();p.addChild(u)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookVertical=
+16,8);t=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<o.points.length;i++){u=new THREE.Mesh(y,t);u.position.copy(o.points[i]);u.updateMatrix();p.addChild(u)}}THREE.Camera.call(this,b.fov,b.aspect,b.near,b.far,b.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.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(b){if(b.duration!==undefined)this.duration=b.duration*1E3;if(b.waypoints!==undefined)this.waypoints=b.waypoints;if(b.useConstantSpeed!==undefined)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==undefined)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==undefined)this.createDebugPath=b.createDebugPath;
 !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(b){if(b.duration!==undefined)this.duration=b.duration*1E3;if(b.waypoints!==undefined)this.waypoints=b.waypoints;if(b.useConstantSpeed!==undefined)this.useConstantSpeed=b.useConstantSpeed;if(b.resamplingCoef!==undefined)this.resamplingCoef=b.resamplingCoef;if(b.createDebugPath!==undefined)this.createDebugPath=b.createDebugPath;
 if(b.createDebugDummy!==undefined)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==undefined)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==undefined)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==undefined)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==undefined)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==undefined)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==undefined)this.domElement=b.domElement}this.theta=this.phi=this.lon=
 if(b.createDebugDummy!==undefined)this.createDebugDummy=b.createDebugDummy;if(b.lookSpeed!==undefined)this.lookSpeed=b.lookSpeed;if(b.lookVertical!==undefined)this.lookVertical=b.lookVertical;if(b.lookHorizontal!==undefined)this.lookHorizontal=b.lookHorizontal;if(b.verticalAngleMap!==undefined)this.verticalAngleMap=b.verticalAngleMap;if(b.horizontalAngleMap!==undefined)this.horizontalAngleMap=b.horizontalAngleMap;if(b.domElement!==undefined)this.domElement=b.domElement}this.theta=this.phi=this.lon=
 this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var g=Math.PI*2,h=Math.PI/180;this.update=function(p,o,u){var y,t;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*h;this.theta=this.lon*h;y=this.phi%g;this.phi=y>=0?y:y+g;y=this.verticalAngleMap.srcRange;t=this.verticalAngleMap.dstRange;
 this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var g=Math.PI*2,h=Math.PI/180;this.update=function(p,o,u){var y,t;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*h;this.theta=this.lon*h;y=this.phi%g;this.phi=y>=0?y:y+g;y=this.verticalAngleMap.srcRange;t=this.verticalAngleMap.dstRange;
@@ -400,7 +399,7 @@ f));c instanceof THREE.Face4&&d.push(new THREE.UV(0.5+Math.atan2(u.position.x,u.
 THREE.Icosahedron=function(b){function d(u,y,t){var B=Math.sqrt(u*u+y*y+t*t);return g.vertices.push(new THREE.Vertex(new THREE.Vector3(u/B,y/B,t/B)))-1}function c(u,y,t,B){B.faces.push(new THREE.Face3(u,y,t))}function f(u,y){var t=g.vertices[u].position,B=g.vertices[y].position;return d((t.x+B.x)/2,(t.y+B.y)/2,(t.z+B.z)/2)}var g=this,h=new THREE.Geometry,j;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;d(-1,b,0);d(1,b,0);d(-1,-b,0);d(1,-b,0);d(0,-1,b);d(0,1,b);d(0,-1,-b);d(0,
 THREE.Icosahedron=function(b){function d(u,y,t){var B=Math.sqrt(u*u+y*y+t*t);return g.vertices.push(new THREE.Vertex(new THREE.Vector3(u/B,y/B,t/B)))-1}function c(u,y,t,B){B.faces.push(new THREE.Face3(u,y,t))}function f(u,y){var t=g.vertices[u].position,B=g.vertices[y].position;return d((t.x+B.x)/2,(t.y+B.y)/2,(t.z+B.z)/2)}var g=this,h=new THREE.Geometry,j;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;d(-1,b,0);d(1,b,0);d(-1,-b,0);d(1,-b,0);d(0,-1,b);d(0,1,b);d(0,-1,-b);d(0,
 1,-b);d(b,0,-1);d(b,0,1);d(-b,0,-1);d(-b,0,1);c(0,11,5,h);c(0,5,1,h);c(0,1,7,h);c(0,7,10,h);c(0,10,11,h);c(1,5,9,h);c(5,11,4,h);c(11,10,2,h);c(10,7,6,h);c(7,1,8,h);c(3,9,4,h);c(3,4,2,h);c(3,2,6,h);c(3,6,8,h);c(3,8,9,h);c(4,9,5,h);c(2,4,11,h);c(6,2,10,h);c(8,6,7,h);c(9,8,1,h);for(b=0;b<this.subdivisions;b++){j=new THREE.Geometry;for(var k in h.faces){var m=f(h.faces[k].a,h.faces[k].b),p=f(h.faces[k].b,h.faces[k].c),o=f(h.faces[k].c,h.faces[k].a);c(h.faces[k].a,m,o,j);c(h.faces[k].b,p,m,j);c(h.faces[k].c,
 1,-b);d(b,0,-1);d(b,0,1);d(-b,0,-1);d(-b,0,1);c(0,11,5,h);c(0,5,1,h);c(0,1,7,h);c(0,7,10,h);c(0,10,11,h);c(1,5,9,h);c(5,11,4,h);c(11,10,2,h);c(10,7,6,h);c(7,1,8,h);c(3,9,4,h);c(3,4,2,h);c(3,2,6,h);c(3,6,8,h);c(3,8,9,h);c(4,9,5,h);c(2,4,11,h);c(6,2,10,h);c(8,6,7,h);c(9,8,1,h);for(b=0;b<this.subdivisions;b++){j=new THREE.Geometry;for(var k in h.faces){var m=f(h.faces[k].a,h.faces[k].b),p=f(h.faces[k].b,h.faces[k].c),o=f(h.faces[k].c,h.faces[k].a);c(h.faces[k].a,m,o,j);c(h.faces[k].b,p,m,j);c(h.faces[k].c,
 o,p,j);c(m,p,o,j)}h.faces=j.faces}g.faces=h.faces;delete h;delete j;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Icosahedron.prototype=new THREE.Geometry;THREE.Icosahedron.prototype.constructor=THREE.Icosahedron;
 o,p,j);c(m,p,o,j)}h.faces=j.faces}g.faces=h.faces;delete h;delete j;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Icosahedron.prototype=new THREE.Geometry;THREE.Icosahedron.prototype.constructor=THREE.Icosahedron;
-THREE.Lathe=function(b,d,c){THREE.Geometry.call(this);this.steps=d||12;this.angle=c||2*Math.PI;d=this.angle/this.steps;c=[];for(var f=[],g=[],h=[],j=(new THREE.Matrix4).setRotationZ(d),k=0;k<b.length;k++){this.vertices.push(new THREE.Vertex(b[k]));c[k]=b[k].clone();f[k]=this.vertices.length-1}for(var m=0;m<=this.angle+0.0010;m+=d){for(k=0;k<c.length;k++)if(m<this.angle){c[k]=j.multiplyVector3(c[k].clone());this.vertices.push(new THREE.Vertex(c[k]));g[k]=this.vertices.length-1}else g=h;m==0&&(h=f);
+THREE.Lathe=function(b,d,c){THREE.Geometry.call(this);this.steps=d||12;this.angle=c||2*Math.PI;d=this.angle/this.steps;c=[];for(var f=[],g=[],h=[],j=(new THREE.Matrix4).setRotationZ(d),k=0;k<b.length;k++){this.vertices.push(new THREE.Vertex(b[k]));c[k]=b[k].clone();f[k]=this.vertices.length-1}for(var m=0;m<=this.angle+0.001;m+=d){for(k=0;k<c.length;k++)if(m<this.angle){c[k]=j.multiplyVector3(c[k].clone());this.vertices.push(new THREE.Vertex(c[k]));g[k]=this.vertices.length-1}else g=h;m==0&&(h=f);
 for(k=0;k<f.length-1;k++){this.faces.push(new THREE.Face4(g[k],g[k+1],f[k+1],f[k]));this.faceVertexUvs[0].push([new THREE.UV(1-m/this.angle,k/b.length),new THREE.UV(1-m/this.angle,(k+1)/b.length),new THREE.UV(1-(m-d)/this.angle,(k+1)/b.length),new THREE.UV(1-(m-d)/this.angle,k/b.length)])}f=g;g=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Lathe.prototype=new THREE.Geometry;THREE.Lathe.prototype.constructor=THREE.Lathe;
 for(k=0;k<f.length-1;k++){this.faces.push(new THREE.Face4(g[k],g[k+1],f[k+1],f[k]));this.faceVertexUvs[0].push([new THREE.UV(1-m/this.angle,k/b.length),new THREE.UV(1-m/this.angle,(k+1)/b.length),new THREE.UV(1-(m-d)/this.angle,(k+1)/b.length),new THREE.UV(1-(m-d)/this.angle,k/b.length)])}f=g;g=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Lathe.prototype=new THREE.Geometry;THREE.Lathe.prototype.constructor=THREE.Lathe;
 THREE.Plane=function(b,d,c,f){THREE.Geometry.call(this);var g,h=b/2,j=d/2;c=c||1;f=f||1;var k=c+1,m=f+1;b/=c;var p=d/f;for(g=0;g<m;g++)for(d=0;d<k;d++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(d*b-h,-(g*p-j),0)));for(g=0;g<f;g++)for(d=0;d<c;d++){this.faces.push(new THREE.Face4(d+k*g,d+k*(g+1),d+1+k*(g+1),d+1+k*g));this.faceVertexUvs[0].push([new THREE.UV(d/c,g/f),new THREE.UV(d/c,(g+1)/f),new THREE.UV((d+1)/c,(g+1)/f),new THREE.UV((d+1)/c,g/f)])}this.computeCentroids();this.computeFaceNormals()};
 THREE.Plane=function(b,d,c,f){THREE.Geometry.call(this);var g,h=b/2,j=d/2;c=c||1;f=f||1;var k=c+1,m=f+1;b/=c;var p=d/f;for(g=0;g<m;g++)for(d=0;d<k;d++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(d*b-h,-(g*p-j),0)));for(g=0;g<f;g++)for(d=0;d<c;d++){this.faces.push(new THREE.Face4(d+k*g,d+k*(g+1),d+1+k*(g+1),d+1+k*g));this.faceVertexUvs[0].push([new THREE.UV(d/c,g/f),new THREE.UV(d/c,(g+1)/f),new THREE.UV((d+1)/c,(g+1)/f),new THREE.UV((d+1)/c,g/f)])}this.computeCentroids();this.computeFaceNormals()};
 THREE.Plane.prototype=new THREE.Geometry;THREE.Plane.prototype.constructor=THREE.Plane;
 THREE.Plane.prototype=new THREE.Geometry;THREE.Plane.prototype.constructor=THREE.Plane;

+ 88 - 105
build/custom/ThreeCanvas.js

@@ -1,87 +1,70 @@
 // ThreeCanvas.js r39 - http://github.com/mrdoob/three.js
 // ThreeCanvas.js r39 - 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)};
 var THREE=THREE||{};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}THREE.Color=function(a){this.setHex(a)};
-THREE.Color.prototype={autoUpdate:!0,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex;this.__styleString=a.__styleString},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,c){var e,d,g,f,i,h;if(c==0)e=d=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:e=h;d=c;g=a;break;case 2:e=a;d=c;g=b;break;case 3:e=a;d=h;g=c;break;case 4:e=b;d=a;g=c;break;case 5:e=c;d=a;
-g=h;break;case 6:case 0:e=c;d=b;g=a}}this.r=e;this.g=d;this.b=g;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},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},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
+THREE.Color.prototype={autoUpdate:!0,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex;this.__styleString=a.__styleString},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,c){var d,e,h,f,k,g;if(c==0)d=e=h=0;else{f=Math.floor(a*6);k=a*6-f;a=c*(1-b);g=c*(1-b*k);b=c*(1-b*(1-k));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.r=d;this.g=e;this.b=h;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},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},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
 255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)}};THREE.Vector2=function(a,b){this.set(a||0,b||0)};
 255)+","+~~(this.b*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/
 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)};
 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,
 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,e=this.z;this.set(c*a.z-e*a.y,e*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/
+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=
 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){this.y=Math.asin(a.n13);var b=Math.cos(this.y);if(Math.abs(b)>1.0E-5){this.x=Math.atan2(-a.n23/b,a.n33/b);this.z=Math.atan2(-a.n13/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)<
 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){this.y=Math.asin(a.n13);var b=Math.cos(this.y);if(Math.abs(b)>1.0E-5){this.x=Math.atan2(-a.n23/b,a.n33/b);this.z=Math.atan2(-a.n13/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,e){this.set(a||0,b||0,c||0,e||1)};
-THREE.Vector4.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;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*
+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};
 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){var b,c,e=a.objects,d=[];a=0;for(b=e.length;a<b;a++){c=e[a];c instanceof THREE.Mesh&&(d=d.concat(this.intersectObject(c)))}d.sort(function(g,f){return g.distance-f.distance});return d},intersectObject:function(a){function b(D,A,U,V){V=V.clone().subSelf(A);U=U.clone().subSelf(A);var B=D.clone().subSelf(A);D=V.dot(V);A=V.dot(U);V=V.dot(B);var u=U.dot(U);U=U.dot(B);B=1/(D*u-A*A);u=(u*V-A*U)*B;D=(D*U-A*V)*B;return u>0&&D>0&&u+D<1}var c,e,d,g,f,i,h,j,k,n,
-q,o=a.geometry,w=o.vertices,z=[];c=0;for(e=o.faces.length;c<e;c++){d=o.faces[c];n=this.origin.clone();q=this.direction.clone();h=a.matrixWorld;g=h.multiplyVector3(w[d.a].position.clone());f=h.multiplyVector3(w[d.b].position.clone());i=h.multiplyVector3(w[d.c].position.clone());h=d instanceof THREE.Face4?h.multiplyVector3(w[d.d].position.clone()):null;j=a.matrixRotationWorld.multiplyVector3(d.normal.clone());k=q.dot(j);if(a.doubleSided||(a.flipSided?k>0:k<0)){j=j.dot((new THREE.Vector3).sub(g,n))/
-k;n=n.addSelf(q.multiplyScalar(j));if(d instanceof THREE.Face3){if(b(n,g,f,i)){d={distance:this.origin.distanceTo(n),point:n,face:d,object:a};z.push(d)}}else if(d instanceof THREE.Face4&&(b(n,g,f,h)||b(n,f,i,h))){d={distance:this.origin.distanceTo(n),point:n,face:d,object:a};z.push(d)}}}return z}};
-THREE.Rectangle=function(){function a(){g=e-b;f=d-c}var b,c,e,d,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 e};this.getBottom=function(){return d};this.set=function(h,j,k,n){i=!1;b=h;c=j;e=k;d=n;a()};this.addPoint=function(h,j){if(i){i=!1;b=h;c=j;e=h;d=j}else{b=b<h?b:h;c=c<j?c:j;e=e>h?e:h;d=d>j?d:j}a()};
-this.add3Points=function(h,j,k,n,q,o){if(i){i=!1;b=h<k?h<q?h:q:k<q?k:q;c=j<n?j<o?j:o:n<o?n:o;e=h>k?h>q?h:q:k>q?k:q;d=j>n?j>o?j:o:n>o?n:o}else{b=h<k?h<q?h<b?h:b:q<b?q:b:k<q?k<b?k:b:q<b?q:b;c=j<n?j<o?j<c?j:c:o<c?o:c:n<o?n<c?n:c:o<c?o:c;e=h>k?h>q?h>e?h:e:q>e?q:e:k>q?k>e?k:e:q>e?q:e;d=j>n?j>o?j>d?j:d:o>d?o:d:n>o?n>d?n:d:o>d?o:d}a()};this.addRectangle=function(h){if(i){i=!1;b=h.getLeft();c=h.getTop();e=h.getRight();d=h.getBottom()}else{b=b<h.getLeft()?b:h.getLeft();c=c<h.getTop()?c:h.getTop();e=e>h.getRight()?
-e:h.getRight();d=d>h.getBottom()?d:h.getBottom()}a()};this.inflate=function(h){b-=h;c-=h;e+=h;d+=h;a()};this.minSelf=function(h){b=b>h.getLeft()?b:h.getLeft();c=c>h.getTop()?c:h.getTop();e=e<h.getRight()?e:h.getRight();d=d<h.getBottom()?d:h.getBottom();a()};this.instersects=function(h){return Math.min(e,h.getRight())-Math.max(b,h.getLeft())>=0&&Math.min(d,h.getBottom())-Math.max(c,h.getTop())>=0};this.empty=function(){i=!0;d=e=c=b=0;a()};this.isEmpty=function(){return i}};
+THREE.Ray.prototype={intersectScene:function(a){var b,c,d=a.objects,e=[];a=0;for(b=d.length;a<b;a++){c=d[a];c instanceof THREE.Mesh&&(e=e.concat(this.intersectObject(c)))}e.sort(function(h,f){return h.distance-f.distance});return e},intersectObject:function(a){function b(D,z,U,V){V=V.clone().subSelf(z);U=U.clone().subSelf(z);var B=D.clone().subSelf(z);D=V.dot(V);z=V.dot(U);V=V.dot(B);var u=U.dot(U);U=U.dot(B);B=1/(D*u-z*z);u=(u*V-z*U)*B;D=(D*U-z*V)*B;return u>0&&D>0&&u+D<1}var c,d,e,h,f,k,g,i,j,o,
+p,r=a.geometry,y=r.vertices,A=[];c=0;for(d=r.faces.length;c<d;c++){e=r.faces[c];o=this.origin.clone();p=this.direction.clone();g=a.matrixWorld;h=g.multiplyVector3(y[e.a].position.clone());f=g.multiplyVector3(y[e.b].position.clone());k=g.multiplyVector3(y[e.c].position.clone());g=e instanceof THREE.Face4?g.multiplyVector3(y[e.d].position.clone()):null;i=a.matrixRotationWorld.multiplyVector3(e.normal.clone());j=p.dot(i);if(a.doubleSided||(a.flipSided?j>0:j<0)){i=i.dot((new THREE.Vector3).sub(h,o))/
+j;o=o.addSelf(p.multiplyScalar(i));if(e instanceof THREE.Face3){if(b(o,h,f,k)){e={distance:this.origin.distanceTo(o),point:o,face:e,object:a};A.push(e)}}else if(e instanceof THREE.Face4&&(b(o,h,f,g)||b(o,f,k,g))){e={distance:this.origin.distanceTo(o),point:o,face:e,object:a};A.push(e)}}}return A}};
+THREE.Rectangle=function(){function a(){h=d-b;f=e-c}var b,c,d,e,h,f,k=!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,j,o){k=!1;b=g;c=i;d=j;e=o;a()};this.addPoint=function(g,i){if(k){k=!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,j,o,p,r){if(k){k=!1;b=g<j?g<p?g:p:j<p?j:p;c=i<o?i<r?i:r:o<r?o:r;d=g>j?g>p?g:p:j>p?j:p;e=i>o?i>r?i:r:o>r?o:r}else{b=g<j?g<p?g<b?g:b:p<b?p:b:j<p?j<b?j:b:p<b?p:b;c=i<o?i<r?i<c?i:c:r<c?r:c:o<r?o<c?o:c:r<c?r:c;d=g>j?g>p?g>d?g:d:p>d?p:d:j>p?j>d?j:d:p>d?p:d;e=i>o?i>r?i>e?i:e:r>e?r:e:o>r?o>e?o:e:r>e?r:e}a()};this.addRectangle=function(g){if(k){k=!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(){k=!0;e=d=c=b=0;a()};this.isEmpty=function(){return k}};
 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.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,e,d,g,f,i,h,j,k,n,q,o,w,z){this.set(a||1,b||0,c||0,e||0,d||0,g||1,f||0,i||0,h||0,j||0,k||1,n||0,q||0,o||0,w||0,z||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={set:function(a,b,c,e,d,g,f,i,h,j,k,n,q,o,w,z){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=d;this.n22=g;this.n23=f;this.n24=i;this.n31=h;this.n32=j;this.n33=k;this.n34=n;this.n41=q;this.n42=o;this.n43=w;this.n44=z;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(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 e=THREE.Matrix4.__v1,
-d=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;e.cross(c,g).normalize();if(e.length()===0){g.x+=1.0E-4;e.cross(c,g).normalize()}d.cross(g,e).normalize();this.n11=e.x;this.n12=d.x;this.n13=g.x;this.n21=e.y;this.n22=d.y;this.n23=g.y;this.n31=e.z;this.n32=d.z;this.n33=g.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,e=a.z,d=1/(this.n41*b+this.n42*c+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*e+this.n14)*d;a.y=(this.n21*b+this.n22*c+this.n23*
-e+this.n24)*d;a.z=(this.n31*b+this.n32*c+this.n33*e+this.n34)*d;return a},multiplyVector4:function(a){var b=a.x,c=a.y,e=a.z,d=a.w;a.x=this.n11*b+this.n12*c+this.n13*e+this.n14*d;a.y=this.n21*b+this.n22*c+this.n23*e+this.n24*d;a.z=this.n31*b+this.n32*c+this.n33*e+this.n34*d;a.w=this.n41*b+this.n42*c+this.n43*e+this.n44*d;return a},rotateAxis:function(a){var b=a.x,c=a.y,e=a.z;a.x=b*this.n11+c*this.n12+e*this.n13;a.y=b*this.n21+c*this.n22+e*this.n23;a.z=b*this.n31+c*this.n32+e*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,e=a.n12,d=a.n13,g=a.n14,f=a.n21,i=a.n22,h=a.n23,j=a.n24,k=a.n31,n=a.n32,q=a.n33,o=a.n34,w=a.n41,z=a.n42,D=a.n43,A=a.n44,U=b.n11,V=b.n12,B=b.n13,u=b.n14,p=b.n21,Y=b.n22,
-Z=b.n23,aa=b.n24,P=b.n31,x=b.n32,t=b.n33,K=b.n34;this.n11=c*U+e*p+d*P;this.n12=c*V+e*Y+d*x;this.n13=c*B+e*Z+d*t;this.n14=c*u+e*aa+d*K+g;this.n21=f*U+i*p+h*P;this.n22=f*V+i*Y+h*x;this.n23=f*B+i*Z+h*t;this.n24=f*u+i*aa+h*K+j;this.n31=k*U+n*p+q*P;this.n32=k*V+n*Y+q*x;this.n33=k*B+n*Z+q*t;this.n34=k*u+n*aa+q*K+o;this.n41=w*U+z*p+D*P;this.n42=w*V+z*Y+D*x;this.n43=w*B+z*Z+D*t;this.n44=w*u+z*aa+D*K+A;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;
+THREE.Matrix4=function(a,b,c,d,e,h,f,k,g,i,j,o,p,r,y,A){this.set(a||1,b||0,c||0,d||0,e||0,h||1,f||0,k||0,g||0,i||0,j||1,o||0,p||0,r||0,y||0,A||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={set:function(a,b,c,d,e,h,f,k,g,i,j,o,p,r,y,A){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=h;this.n23=f;this.n24=k;this.n31=g;this.n32=i;this.n33=j;this.n34=o;this.n41=p;this.n42=r;this.n43=y;this.n44=A;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*
+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,k=a.n22,g=a.n23,i=a.n24,j=a.n31,o=a.n32,p=a.n33,r=a.n34,y=a.n41,A=a.n42,D=a.n43,z=a.n44,U=b.n11,V=b.n12,B=b.n13,u=b.n14,n=b.n21,Y=b.n22,
+Z=b.n23,aa=b.n24,P=b.n31,w=b.n32,t=b.n33,K=b.n34;this.n11=c*U+d*n+e*P;this.n12=c*V+d*Y+e*w;this.n13=c*B+d*Z+e*t;this.n14=c*u+d*aa+e*K+h;this.n21=f*U+k*n+g*P;this.n22=f*V+k*Y+g*w;this.n23=f*B+k*Z+g*t;this.n24=f*u+k*aa+g*K+i;this.n31=j*U+o*n+p*P;this.n32=j*V+o*Y+p*w;this.n33=j*B+o*Z+p*t;this.n34=j*u+o*aa+p*K+r;this.n41=y*U+A*n+D*P;this.n42=y*V+A*Y+D*w;this.n43=y*B+A*Z+D*t;this.n44=y*u+A*aa+D*K+z;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=
 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,e=this.n14,d=this.n21,g=this.n22,f=this.n23,i=this.n24,h=this.n31,j=this.n32,k=this.n33,n=this.n34,q=this.n41,o=this.n42,w=this.n43,z=this.n44;return e*f*j*q-c*i*j*q-e*g*k*q+b*i*k*q+c*g*n*q-b*f*n*q-e*f*h*o+c*i*h*o+e*d*k*o-a*i*k*o-c*d*n*o+a*f*n*o+e*g*h*w-b*i*h*w-e*d*j*w+a*i*j*w+b*d*n*w-a*g*n*w-c*g*h*z+b*f*h*z+c*d*j*z-a*f*j*z-b*d*k*z+a*g*k*z},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,h=this.n22,f=this.n23,k=this.n24,g=this.n31,i=this.n32,j=this.n33,o=this.n34,p=this.n41,r=this.n42,y=this.n43,A=this.n44;return d*f*i*p-c*k*i*p-d*h*j*p+b*k*j*p+c*h*o*p-b*f*o*p-d*f*g*r+c*k*g*r+d*e*j*r-a*k*j*r-c*e*o*r+a*f*o*r+d*h*g*y-b*k*g*y-d*e*i*y+a*k*i*y+b*e*o*y-a*h*o*y-c*h*g*A+b*f*g*A+c*e*i*A-a*f*i*A-b*e*j*A+a*h*j*A},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.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.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,
 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),e=Math.sin(b),d=1-c,g=a.x,f=a.y,i=a.z,h=d*g,j=d*f;this.set(h*
-g+c,h*f-e*i,h*i+e*f,0,h*f+e*i,j*f+c,j*i-e*g,0,h*i-e*f,j*i+e*g,d*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},setRotationFromEuler:function(a){var b=a.x,c=a.y,e=a.z;a=Math.cos(b);b=Math.sin(b);var d=Math.cos(c);c=Math.sin(c);var g=Math.cos(e);e=Math.sin(e);var f=a*c,i=b*c;this.n11=d*g;this.n12=-d*e;this.n13=c;this.n21=i*g+a*e;this.n22=-i*e+a*g;this.n23=-b*d;this.n31=-f*g+b*e;this.n32=f*e+b*g;this.n33=a*d;return this},setRotationFromQuaternion:function(a){var b=
-a.x,c=a.y,e=a.z,d=a.w,g=b+b,f=c+c,i=e+e;a=b*g;var h=b*f;b*=i;var j=c*f;c*=i;e*=i;g*=d;f*=d;d*=i;this.n11=1-(j+e);this.n12=h-d;this.n13=b+f;this.n21=h+d;this.n22=1-(a+e);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=a.n14;this.n24=a.n24;this.n34=
-a.n34},extractRotation:function(a,b){var c=1/b.x,e=1/b.y,d=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*e;this.n22=a.n22*e;this.n32=a.n32*e;this.n13=a.n13*d;this.n23=a.n23*d;this.n33=a.n33*d}};
-THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,d=a.n13,g=a.n14,f=a.n21,i=a.n22,h=a.n23,j=a.n24,k=a.n31,n=a.n32,q=a.n33,o=a.n34,w=a.n41,z=a.n42,D=a.n43,A=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=h*o*z-j*q*z+j*n*D-i*o*D-h*n*A+i*q*A;b.n12=g*q*z-d*o*z-g*n*D+e*o*D+d*n*A-e*q*A;b.n13=d*j*z-g*h*z+g*i*D-e*j*D-d*i*A+e*h*A;b.n14=g*h*n-d*j*n-g*i*q+e*j*q+d*i*o-e*h*o;b.n21=j*q*w-h*o*w-j*k*D+f*o*D+h*k*A-f*q*A;b.n22=d*o*w-g*q*w+g*k*D-c*o*D-d*k*A+c*q*A;b.n23=g*h*w-d*j*w-g*f*D+c*j*D+d*f*A-c*h*A;
-b.n24=d*j*k-g*h*k+g*f*q-c*j*q-d*f*o+c*h*o;b.n31=i*o*w-j*n*w+j*k*z-f*o*z-i*k*A+f*n*A;b.n32=g*n*w-e*o*w-g*k*z+c*o*z+e*k*A-c*n*A;b.n33=d*j*w-g*i*w+g*f*z-c*j*z-e*f*A+c*i*A;b.n34=g*i*k-e*j*k-g*f*n+c*j*n+e*f*o-c*i*o;b.n41=h*n*w-i*q*w-h*k*z+f*q*z+i*k*D-f*n*D;b.n42=e*q*w-d*n*w+d*k*z-c*q*z-e*k*D+c*n*D;b.n43=d*i*w-e*h*w-d*f*z+c*h*z+e*f*D-c*i*D;b.n44=e*h*k-d*i*k+d*f*n-c*h*n-e*f*q+c*i*q;b.multiplyScalar(1/a.determinant());return b};
-THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,d=-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,k=-a.n23*a.n11+a.n21*a.n13,n=a.n22*a.n11-a.n21*a.n12;a=a.n11*e+a.n21*f+a.n31*j;if(a==0)throw"matrix not invertible";a=1/a;c[0]=a*e;c[1]=a*d;c[2]=a*g;c[3]=a*f;c[4]=a*i;c[5]=a*h;c[6]=a*j;c[7]=a*k;c[8]=a*n;return b};
-THREE.Matrix4.makeFrustum=function(a,b,c,e,d,g){var f;f=new THREE.Matrix4;f.n11=2*d/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*d/(e-c);f.n23=(e+c)/(e-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+d)/(g-d);f.n34=-2*g*d/(g-d);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,e){var d;a=c*Math.tan(a*Math.PI/360);d=-a;return THREE.Matrix4.makeFrustum(d*b,a*b,d,a,c,e)};
-THREE.Matrix4.makeOrtho=function(a,b,c,e,d,g){var f,i,h,j;f=new THREE.Matrix4;i=b-a;h=c-e;j=g-d;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+e)/h);f.n31=0;f.n32=0;f.n33=-2/j;f.n34=-((g+d)/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;
+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,k=a.z,g=e*h,i=e*f;this.set(g*
+h+c,g*f-d*k,g*k+d*f,0,g*f+d*k,i*f+c,i*k-d*h,0,g*k-d*f,i*k+d*h,e*k*k+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},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,k=b*c;this.n11=e*h;this.n12=-e*d;this.n13=c;this.n21=k*h+a*d;this.n22=-k*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,k=d+d;a=b*h;var g=b*f;b*=k;var i=c*f;c*=k;d*=k;h*=e;f*=e;e*=k;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=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,k=a.n22,g=a.n23,i=a.n24,j=a.n31,o=a.n32,p=a.n33,r=a.n34,y=a.n41,A=a.n42,D=a.n43,z=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=g*r*A-i*p*A+i*o*D-k*r*D-g*o*z+k*p*z;b.n12=h*p*A-e*r*A-h*o*D+d*r*D+e*o*z-d*p*z;b.n13=e*i*A-h*g*A+h*k*D-d*i*D-e*k*z+d*g*z;b.n14=h*g*o-e*i*o-h*k*p+d*i*p+e*k*r-d*g*r;b.n21=i*p*y-g*r*y-i*j*D+f*r*D+g*j*z-f*p*z;b.n22=e*r*y-h*p*y+h*j*D-c*r*D-e*j*z+c*p*z;b.n23=h*g*y-e*i*y-h*f*D+c*i*D+e*f*z-c*g*z;
+b.n24=e*i*j-h*g*j+h*f*p-c*i*p-e*f*r+c*g*r;b.n31=k*r*y-i*o*y+i*j*A-f*r*A-k*j*z+f*o*z;b.n32=h*o*y-d*r*y-h*j*A+c*r*A+d*j*z-c*o*z;b.n33=e*i*y-h*k*y+h*f*A-c*i*A-d*f*z+c*k*z;b.n34=h*k*j-d*i*j-h*f*o+c*i*o+d*f*r-c*k*r;b.n41=g*o*y-k*p*y-g*j*A+f*p*A+k*j*D-f*o*D;b.n42=d*p*y-e*o*y+e*j*A-c*p*A-d*j*D+c*o*D;b.n43=e*k*y-d*g*y-e*f*A+c*g*A+d*f*D-c*k*D;b.n44=d*g*j-e*k*j+e*f*o-c*g*o-d*f*p+c*k*p;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,k=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,j=-a.n23*a.n11+a.n21*a.n13,o=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*k;c[5]=a*g;c[6]=a*i;c[7]=a*j;c[8]=a*o;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,k,g,i;f=new THREE.Matrix4;k=b-a;g=c-d;i=h-e;f.n11=2/k;f.n12=0;f.n13=0;f.n14=-((b+a)/k);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.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=
 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.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};
 !0;this._vector=new THREE.Vector3};
 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(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(a){if(this.children.indexOf(a)===-1){a.parent!==
 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(this.position,a,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 instanceof THREE.Scene===!1&&b!==undefined;)b=b.parent;b!==undefined&&b.addChildRecurse(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=undefined;this.children.splice(b,1)}},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!==
 undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b instanceof THREE.Scene===!1&&b!==undefined;)b=b.parent;b!==undefined&&b.addChildRecurse(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=undefined;this.children.splice(b,1)}},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 e=this.children.length;a<e;a++)this.children[a].update(this.matrixWorld,
-b,c)}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==undefined?e:1)};
-THREE.Quaternion.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,e=a.y*b,d=a.z*b;a=Math.cos(e);e=Math.sin(e);b=Math.cos(-d);d=Math.sin(-d);var g=Math.cos(c);c=Math.sin(c);var f=a*b,i=e*d;this.w=f*g-i*c;this.x=f*c+i*g;this.y=e*b*g+a*d*c;this.z=a*d*g-e*b*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,e=this.z,d=this.w,g=a.x,f=a.y,i=a.z;a=a.w;this.x=b*a+d*g+c*i-e*f;this.y=c*a+d*f+e*g-b*i;this.z=e*a+d*i+b*f-c*g;this.w=d*a-b*g-c*f-e*i;return this},
-multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,d=a.z,g=this.x,f=this.y,i=this.z,h=this.w,j=h*c+f*d-i*e,k=h*e+i*c-g*d,n=h*d+g*e-f*c;c=-g*c-f*e-i*d;b.x=j*h+c*-g+k*-i-n*-f;b.y=k*h+c*-f+n*-g-j*-i;b.z=n*h+c*-i+j*-f-k*-g;return b}};
-THREE.Quaternion.slerp=function(a,b,c,e){var d=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(d)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var g=Math.acos(d),f=Math.sqrt(1-d*d);if(Math.abs(f)<0.0010){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}d=Math.sin((1-e)*g)/f;e=Math.sin(e*g)/f;c.w=a.w*d+b.w*e;c.x=a.x*d+b.x*e;c.y=a.y*d+b.y*e;c.z=a.z*d+b.z*e;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
-THREE.Face3=function(a,b,c,e,d,g){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=d instanceof THREE.Color?d:new THREE.Color;this.vertexColors=d instanceof Array?d:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
-THREE.Face4=function(a,b,c,e,d,g,f){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];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)};
+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},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,k=d*e;this.w=f*h-k*c;this.x=f*c+k*h;this.y=d*b*h+a*e*c;this.z=a*e*h-d*b*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,k=a.z;a=a.w;this.x=b*a+e*h+c*k-d*f;this.y=c*a+e*f+d*h-b*k;this.z=d*a+e*k+b*f-c*h;this.w=e*a-b*h-c*f-d*k;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,k=this.z,g=this.w,i=g*c+f*e-k*d,j=g*d+k*c-h*e,o=g*e+h*d-f*c;c=-h*c-f*d-k*e;b.x=i*g+c*-h+j*-k-o*-f;b.y=j*g+c*-f+o*-h-i*-k;b.z=o*g+c*-k+i*-f-j*-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)};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
 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);
 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,e,d,g,f,i=new THREE.Vector3,h=new THREE.Vector3;e=0;for(d=this.faces.length;e<d;e++){g=this.faces[e];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,e;if(this.__tmpVertices==undefined){e=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)e[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{e=
-this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)e[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];if(c instanceof THREE.Face3){e[c.a].addSelf(c.normal);e[c.b].addSelf(c.normal);e[c.c].addSelf(c.normal)}else if(c instanceof THREE.Face4){e[c.a].addSelf(c.normal);e[c.b].addSelf(c.normal);e[c.c].addSelf(c.normal);e[c.d].addSelf(c.normal)}}a=0;for(b=this.vertices.length;a<b;a++)e[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(e[c.a]);
-c.vertexNormals[1].copy(e[c.b]);c.vertexNormals[2].copy(e[c.c])}else if(c instanceof THREE.Face4){c.vertexNormals[0].copy(e[c.a]);c.vertexNormals[1].copy(e[c.b]);c.vertexNormals[2].copy(e[c.c]);c.vertexNormals[3].copy(e[c.d])}}},computeTangents:function(){function a(E,R,S,W,H,C,F){i=E.vertices[R].position;h=E.vertices[S].position;j=E.vertices[W].position;k=f[H];n=f[C];q=f[F];o=h.x-i.x;w=j.x-i.x;z=h.y-i.y;D=j.y-i.y;A=h.z-i.z;U=j.z-i.z;V=n.u-k.u;B=q.u-k.u;u=n.v-k.v;p=q.v-k.v;Y=1/(V*p-B*u);x.set((p*
-o-u*w)*Y,(p*z-u*D)*Y,(p*A-u*U)*Y);t.set((V*w-B*o)*Y,(V*D-B*z)*Y,(V*U-B*A)*Y);aa[R].addSelf(x);aa[S].addSelf(x);aa[W].addSelf(x);P[R].addSelf(t);P[S].addSelf(t);P[W].addSelf(t)}var b,c,e,d,g,f,i,h,j,k,n,q,o,w,z,D,A,U,V,B,u,p,Y,Z,aa=[],P=[],x=new THREE.Vector3,t=new THREE.Vector3,K=new THREE.Vector3,N=new THREE.Vector3,Q=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++){aa[b]=new THREE.Vector3;P[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 T=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){g=this.faces[b];for(e=0;e<g.vertexNormals.length;e++){Q.copy(g.vertexNormals[e]);d=g[T[e]];Z=aa[d];K.copy(Z);K.subSelf(Q.multiplyScalar(Q.dot(Z))).normalize();N.cross(g.vertexNormals[e],Z);d=N.dot(P[d]);d=d<0?-1:1;g.vertexTangents[e]=new THREE.Vector4(K.x,K.y,K.z,d)}}this.hasTangents=!0},computeBoundingBox:function(){var a;
+c.centroid.addSelf(this.vertices[c.d].position);c.centroid.divideScalar(4)}}},computeFaceNormals:function(a){var b,c,d,e,h,f,k=new THREE.Vector3,g=new THREE.Vector3;d=0;for(e=this.faces.length;d<e;d++){h=this.faces[d];if(a&&h.vertexNormals.length){k.set(0,0,0);b=0;for(c=h.vertexNormals.length;b<c;b++)k.addSelf(h.vertexNormals[b]);k.divideScalar(3)}else{b=this.vertices[h.a];c=this.vertices[h.b];f=this.vertices[h.c];k.sub(f.position,c.position);g.sub(b.position,c.position);k.crossSelf(g)}k.isZero()||
+k.normalize();h.normal.copy(k)}},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(E,R,S,W,H,C,F){k=E.vertices[R].position;g=E.vertices[S].position;i=E.vertices[W].position;j=f[H];o=f[C];p=f[F];r=g.x-k.x;y=i.x-k.x;A=g.y-k.y;D=i.y-k.y;z=g.z-k.z;U=i.z-k.z;V=o.u-j.u;B=p.u-j.u;u=o.v-j.v;n=p.v-j.v;Y=1/(V*n-B*u);w.set((n*
+r-u*y)*Y,(n*A-u*D)*Y,(n*z-u*U)*Y);t.set((V*y-B*r)*Y,(V*D-B*A)*Y,(V*U-B*z)*Y);aa[R].addSelf(w);aa[S].addSelf(w);aa[W].addSelf(w);P[R].addSelf(t);P[S].addSelf(t);P[W].addSelf(t)}var b,c,d,e,h,f,k,g,i,j,o,p,r,y,A,D,z,U,V,B,u,n,Y,Z,aa=[],P=[],w=new THREE.Vector3,t=new THREE.Vector3,K=new THREE.Vector3,N=new THREE.Vector3,Q=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++){aa[b]=new THREE.Vector3;P[b]=new THREE.Vector3}b=0;for(c=this.faces.length;b<c;b++){h=this.faces[b];f=this.faceVertexUvs[0][b];
+if(h instanceof THREE.Face3)a(this,h.a,h.b,h.c,0,1,2);else if(h instanceof THREE.Face4){a(this,h.a,h.b,h.c,0,1,2);a(this,h.a,h.b,h.d,0,1,3)}}var T=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){h=this.faces[b];for(d=0;d<h.vertexNormals.length;d++){Q.copy(h.vertexNormals[d]);e=h[T[d]];Z=aa[e];K.copy(Z);K.subSelf(Q.multiplyScalar(Q.dot(Z))).normalize();N.cross(h.vertexNormals[d],Z);e=N.dot(P[e]);e=e<0?-1:1;h.vertexTangents[d]=new THREE.Vector4(K.x,K.y,K.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;
 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,k){if(h[j]===undefined){h[j]={set:{},array:[]};h[j].set[k]=1;h[j].array.push(k)}else if(h[j].set[k]===undefined){h[j].set[k]=1;h[j].array.push(k)}}var c,e,d,g,f,i={};c=0;for(e=this.faces.length;c<e;c++){f=this.faces[c];if(f instanceof THREE.Face3){d=a(f.a,f.b);b(i,d,c);d=a(f.b,f.c);b(i,d,c);d=a(f.a,f.c);b(i,d,c)}else if(f instanceof THREE.Face4){d=a(f.b,f.d);b(i,d,c);d=a(f.a,f.b);b(i,d,c);d=a(f.a,f.d);b(i,d,c);d=a(f.b,f.c);b(i,d,c);d=a(f.c,f.d);b(i,d,c)}}c=0;for(e=
-this.edges.length;c<e;c++){f=this.edges[c];d=f.vertexIndices[0];g=f.vertexIndices[1];f.faceIndices=i[a(d,g)].array;for(d=0;d<f.faceIndices.length;d++){g=f.faceIndices[d];f.faces.push(this.faces[g])}}}};THREE.GeometryIdCounter=0;
-THREE.AnimationHandler=function(){var a=[],b={},c={};c.update=function(d){for(var g=0;g<a.length;g++)a[g].update(d)};c.addToUpdate=function(d){a.indexOf(d)===-1&&a.push(d)};c.removeFromUpdate=function(d){d=a.indexOf(d);d!==-1&&a.splice(d,1)};c.add=function(d){b[d.name]!==undefined&&console.log("THREE.AnimationHandler.add: Warning! "+d.name+" already exists in library. Overwriting.");b[d.name]=d;if(d.initialized!==!0){for(var g=0;g<d.hierarchy.length;g++){for(var f=0;f<d.hierarchy[g].keys.length;f++){if(d.hierarchy[g].keys[f].time<
-0)d.hierarchy[g].keys[f].time=0;if(d.hierarchy[g].keys[f].rot!==undefined&&!(d.hierarchy[g].keys[f].rot instanceof THREE.Quaternion)){var i=d.hierarchy[g].keys[f].rot;d.hierarchy[g].keys[f].rot=new THREE.Quaternion(i[0],i[1],i[2],i[3])}}if(d.hierarchy[g].keys[0].morphTargets!==undefined){i={};for(f=0;f<d.hierarchy[g].keys.length;f++)for(var h=0;h<d.hierarchy[g].keys[f].morphTargets.length;h++){var j=d.hierarchy[g].keys[f].morphTargets[h];i[j]=-1}d.hierarchy[g].usedMorphTargets=i;for(f=0;f<d.hierarchy[g].keys.length;f++){var k=
-{};for(j in i){for(h=0;h<d.hierarchy[g].keys[f].morphTargets.length;h++)if(d.hierarchy[g].keys[f].morphTargets[h]===j){k[j]=d.hierarchy[g].keys[f].morphTargetsInfluences[h];break}h===d.hierarchy[g].keys[f].morphTargets.length&&(k[j]=0)}d.hierarchy[g].keys[f].morphTargetsInfluences=k}}for(f=1;f<d.hierarchy[g].keys.length;f++)if(d.hierarchy[g].keys[f].time===d.hierarchy[g].keys[f-1].time){d.hierarchy[g].keys.splice(f,1);f--}for(f=1;f<d.hierarchy[g].keys.length;f++)d.hierarchy[g].keys[f].index=f}f=parseInt(d.length*
-d.fps,10);d.JIT={};d.JIT.hierarchy=[];for(g=0;g<d.hierarchy.length;g++)d.JIT.hierarchy.push(Array(f));d.initialized=!0}};c.get=function(d){if(typeof d==="string")if(b[d])return b[d];else{console.log("THREE.AnimationHandler.get: Couldn't find animation "+d);return null}};c.parse=function(d){var g=[];if(d instanceof THREE.SkinnedMesh)for(var f=0;f<d.bones.length;f++)g.push(d.bones[f]);else e(d,g);return g};var e=function(d,g){g.push(d);for(var f=0;f<d.children.length;f++)e(d.children[f],g)};c.LINEAR=
-0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(a,b,c,e){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.isPaused=!0;this.loop=!0;this.interpolationType=c!==undefined?c:THREE.AnimationHandler.LINEAR;this.JITCompile=e!==undefined?e:!0;this.points=[];this.target=new THREE.Vector3};
-THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=a!==undefined?a:!0;this.currentTime=b!==undefined?b:0;var c,e=this.hierarchy.length,d;for(c=0;c<e;c++){d=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)d.useQuaternion=!0;d.matrixAutoUpdate=!0;if(d.animationCache===undefined){d.animationCache={};d.animationCache.prevKey={pos:0,rot:0,scl:0};d.animationCache.nextKey={pos:0,rot:0,scl:0};d.animationCache.originalMatrix=
-d instanceof THREE.Bone?d.skinMatrix:d.matrix}var g=d.animationCache.prevKey;d=d.animationCache.nextKey;g.pos=this.data.hierarchy[c].keys[0];g.rot=this.data.hierarchy[c].keys[0];g.scl=this.data.hierarchy[c].keys[0];d.pos=this.getNextKeyWith("pos",c,1);d.rot=this.getNextKeyWith("rot",c,1);d.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 b=["pos","rot","scl"],c,e,d,g,f,i,h,j,k=this.data.JIT.hierarchy,n,q;this.currentTime+=a*this.timeScale;q=this.currentTime;n=this.currentTime%=this.data.length;j=parseInt(Math.min(n*this.data.fps,this.data.length*this.data.fps),10);for(var o=0,w=this.hierarchy.length;o<w;o++){a=this.hierarchy[o];h=a.animationCache;if(this.JITCompile&&k[o][j]!==undefined)if(a instanceof THREE.Bone){a.skinMatrix=k[o][j];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=
-!1}else{a.matrix=k[o][j];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 z=0;z<3;z++){c=b[z];f=h.prevKey[c];i=h.nextKey[c];if(i.time<=q){if(n<q)if(this.loop){f=this.data.hierarchy[o].keys[0];for(i=this.getNextKeyWith(c,o,1);i.time<n;){f=i;i=this.getNextKeyWith(c,o,i.index+1)}}else{this.stop();return}else{do{f=i;i=this.getNextKeyWith(c,o,i.index+1)}while(i.time<
-n)}h.prevKey[c]=f;h.nextKey[c]=i}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;e=(n-f.time)/(i.time-f.time);d=f[c];g=i[c];if(e<0||e>1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+o);e=e<0?0:1}if(c==="pos"){c=a.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){c.x=d[0]+(g[0]-d[0])*e;c.y=d[1]+(g[1]-d[1])*e;c.z=d[2]+(g[2]-d[2])*e}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=
-this.getPrevKeyWith("pos",o,f.index-1).pos;this.points[1]=d;this.points[2]=g;this.points[3]=this.getNextKeyWith("pos",o,i.index+1).pos;e=e*0.33+0.33;d=this.interpolateCatmullRom(this.points,e);c.x=d[0];c.y=d[1];c.z=d[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(c);this.target.y=0;this.target.normalize();e=Math.atan2(this.target.x,this.target.z);a.rotation.set(0,e,0)}}}else if(c===
-"rot")THREE.Quaternion.slerp(d,g,a.quaternion,e);else if(c==="scl"){c=a.scale;c.x=d[0]+(g[0]-d[0])*e;c.y=d[1]+(g[1]-d[1])*e;c.z=d[2]+(g[2]-d[2])*e}}}}if(this.JITCompile&&k[0][j]===undefined){this.hierarchy[0].update(undefined,!0);for(o=0;o<this.hierarchy.length;o++)k[o][j]=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=[],e=[],d,g,f,i,h,j;d=(a.length-1)*b;g=Math.floor(d);d-=g;c[0]=g==0?g:g-1;c[1]=g;c[2]=g>a.length-2?g:g+1;c[3]=g>a.length-3?g:g+2;g=a[c[0]];i=a[c[1]];h=a[c[2]];j=a[c[3]];c=d*d;f=d*c;e[0]=this.interpolate(g[0],i[0],h[0],j[0],d,c,f);e[1]=this.interpolate(g[1],i[1],h[1],j[1],d,c,f);e[2]=this.interpolate(g[2],i[2],h[2],j[2],d,c,f);return e};
-THREE.Animation.prototype.interpolate=function(a,b,c,e,d,g,f){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*f+(-3*(b-c)-2*a-e)*g+a*d+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)c=c<e.length-1?c:e.length-1;else c%=e.length;for(;c<e.length;c++)if(e[c][a]!==undefined)return e[c];return this.data.hierarchy[b].keys[0]};
-THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+e.length;c>=0;c--)if(e[c][a]!==undefined)return e[c];return this.data.hierarchy[b].keys[e.length-1]};
-THREE.Camera=function(a,b,c,e,d){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=e||2E3;this.target=d||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.updateMatrix=function(){this.update(undefined,!0)};
+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(g,i){return Math.min(g,
+i)+"_"+Math.max(g,i)}function b(g,i,j){if(g[i]===undefined){g[i]={set:{},array:[]};g[i].set[j]=1;g[i].array.push(j)}else if(g[i].set[j]===undefined){g[i].set[j]=1;g[i].array.push(j)}}var c,d,e,h,f,k={};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(k,e,c);e=a(f.b,f.c);b(k,e,c);e=a(f.a,f.c);b(k,e,c)}else if(f instanceof THREE.Face4){e=a(f.b,f.d);b(k,e,c);e=a(f.a,f.b);b(k,e,c);e=a(f.a,f.d);b(k,e,c);e=a(f.b,f.c);b(k,e,c);e=a(f.c,f.d);b(k,e,c)}}c=0;for(d=
+this.edges.length;c<d;c++){f=this.edges[c];e=f.vertexIndices[0];h=f.vertexIndices[1];f.faceIndices=k[a(e,h)].array;for(e=0;e<f.faceIndices.length;e++){h=f.faceIndices[e];f.faces.push(this.faces[h])}}}};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.updateMatrix=function(){this.update(undefined,!0)};
 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&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=
 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&&(b|=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;
 !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){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1;this.distance=c||0};THREE.PointLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1;this.distance=c||0};THREE.PointLight.prototype=new THREE.Light;
@@ -101,61 +84,61 @@ THREE.MeshDepthMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.sha
 THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading?a.shading:THREE.FlatShading;this.wireframe=a.wireframe?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth?a.wireframeLinewidth:1};THREE.MeshNormalMaterial.prototype=new THREE.Material;THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial;THREE.MeshFaceMaterial=function(){};
 THREE.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.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.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,e,d,g){this.image=a;this.mapping=b!==undefined?b:new THREE.UVMapping;this.wrapS=c!==undefined?c:THREE.ClampToEdgeWrapping;this.wrapT=e!==undefined?e:THREE.ClampToEdgeWrapping;this.magFilter=d!==undefined?d: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.Texture=function(a,b,c,d,e,h){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=h!==undefined?h: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.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];this.matrixAutoUpdate=!1};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.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a];this.matrixAutoUpdate=!1};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.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]=
 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};
 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.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=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 e,d=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(e=0;e<d;e++){a=this.children[e];a instanceof THREE.Bone?a.update(this.skinMatrix,b,c):a.update(this.matrixWorld,!0,c)}}else for(e=0;e<d;e++)this.children[e].update(this.skinMatrix,
+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}};
 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,e){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=e!==undefined?e:!0;this.sources=a instanceof Array?a:[a];var d;c=this.sources.length;for(a=0;a<c;a++){b=this.sources[a];b.toLowerCase();if(b.indexOf(".mp3")!==-1)d=
-"audio/mpeg";else if(b.indexOf(".ogg")!==-1)d="audio/ogg";else b.indexOf(".wav")!==-1&&(d="audio/wav");if(this.domElement.canPlayType(d)){d=document.createElement("source");d.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(d);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=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.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.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.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 e=this.children.length;for(a=0;a<e;a++)this.children[a].update(this.matrixWorld,b,c)};
+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.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;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=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;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.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.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.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.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 x=h[i]=h[i]||new THREE.RenderableVertex;i++;return x}function b(x,t){return t.z-x.z}function c(x,t){var K=0,N=1,Q=x.z+x.w,T=t.z+t.w,E=-x.z+x.w,R=-t.z+t.w;if(Q>=0&&T>=0&&E>=0&&R>=0)return!0;else if(Q<0&&T<0||E<0&&R<0)return!1;else{if(Q<0)K=Math.max(K,Q/(Q-T));else T<0&&(N=Math.min(N,Q/(Q-T)));if(E<0)K=Math.max(K,E/(E-R));else R<0&&(N=Math.min(N,E/(E-R)));if(N<K)return!1;else{x.lerpSelf(t,K);t.lerpSelf(x,1-N);return!0}}}var e,d,g=[],f,i,h=[],j,k,n=[],q,o=
-[],w,z,D=[],A,U,V=[],B=new THREE.Vector4,u=new THREE.Vector4,p=new THREE.Matrix4,Y=new THREE.Matrix4,Z=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],aa=new THREE.Vector4,P=new THREE.Vector4;this.projectVector=function(x,t){p.multiply(t.projectionMatrix,t.matrixWorldInverse);p.multiplyVector3(x);return x};this.unprojectVector=function(x,t){p.multiply(t.matrixWorld,THREE.Matrix4.makeInvert(t.projectionMatrix));p.multiplyVector3(x);return x};
-this.projectObjects=function(x,t,K){t=[];var N,Q,T;d=0;Q=x.objects;x=0;for(N=Q.length;x<N;x++){T=Q[x];var E;if(!(E=!T.visible))if(E=T instanceof THREE.Mesh){a:{E=void 0;for(var R=T.matrixWorld,S=-T.geometry.boundingSphere.radius*Math.max(T.scale.x,Math.max(T.scale.y,T.scale.z)),W=0;W<6;W++){E=Z[W].x*R.n14+Z[W].y*R.n24+Z[W].z*R.n34+Z[W].w;if(E<=S){E=!1;break a}}E=!0}E=!E}if(!E){E=g[d]=g[d]||new THREE.RenderableObject;d++;e=E;B.copy(T.position);p.multiplyVector3(B);e.object=T;e.z=B.z;t.push(e)}}K&&
-t.sort(b);return t};this.projectScene=function(x,t,K){var N=[],Q=t.near,T=t.far,E,R,S,W,H,C,F,I,M,G,da,ia,ja,fa,pa,Da,wa;U=z=q=k=0;t.matrixAutoUpdate&&t.updateMatrix();x.update(undefined,!1,t);p.multiply(t.projectionMatrix,t.matrixWorldInverse);Z[0].set(p.n41-p.n11,p.n42-p.n12,p.n43-p.n13,p.n44-p.n14);Z[1].set(p.n41+p.n11,p.n42+p.n12,p.n43+p.n13,p.n44+p.n14);Z[2].set(p.n41+p.n21,p.n42+p.n22,p.n43+p.n23,p.n44+p.n24);Z[3].set(p.n41-p.n21,p.n42-p.n22,p.n43-p.n23,p.n44-p.n24);Z[4].set(p.n41-p.n31,p.n42-
-p.n32,p.n43-p.n33,p.n44-p.n34);Z[5].set(p.n41+p.n31,p.n42+p.n32,p.n43+p.n33,p.n44+p.n34);for(E=0;E<6;E++){M=Z[E];M.divideScalar(Math.sqrt(M.x*M.x+M.y*M.y+M.z*M.z))}M=this.projectObjects(x,t,!0);x=0;for(E=M.length;x<E;x++){G=M[x].object;if(G.visible){da=G.matrixWorld;ia=G.matrixRotationWorld;ja=G.materials;fa=G.overdraw;i=0;if(G instanceof THREE.Mesh){pa=G.geometry;W=pa.vertices;Da=pa.faces;pa=pa.faceVertexUvs;R=0;for(S=W.length;R<S;R++){f=a();f.positionWorld.copy(W[R].position);da.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>Q&&f.positionScreen.z<T}W=0;for(R=Da.length;W<R;W++){S=Da[W];if(S instanceof THREE.Face3){H=h[S.a];C=h[S.b];F=h[S.c];if(H.visible&&C.visible&&F.visible&&(G.doubleSided||G.flipSided!=(F.positionScreen.x-H.positionScreen.x)*(C.positionScreen.y-H.positionScreen.y)-(F.positionScreen.y-H.positionScreen.y)*(C.positionScreen.x-
-H.positionScreen.x)<0)){I=n[k]=n[k]||new THREE.RenderableFace3;k++;j=I;j.v1.copy(H);j.v2.copy(C);j.v3.copy(F)}else continue}else if(S instanceof THREE.Face4){H=h[S.a];C=h[S.b];F=h[S.c];I=h[S.d];if(H.visible&&C.visible&&F.visible&&I.visible&&(G.doubleSided||G.flipSided!=((I.positionScreen.x-H.positionScreen.x)*(C.positionScreen.y-H.positionScreen.y)-(I.positionScreen.y-H.positionScreen.y)*(C.positionScreen.x-H.positionScreen.x)<0||(C.positionScreen.x-F.positionScreen.x)*(I.positionScreen.y-F.positionScreen.y)-
-(C.positionScreen.y-F.positionScreen.y)*(I.positionScreen.x-F.positionScreen.x)<0))){wa=o[q]=o[q]||new THREE.RenderableFace4;q++;j=wa;j.v1.copy(H);j.v2.copy(C);j.v3.copy(F);j.v4.copy(I)}else continue}j.normalWorld.copy(S.normal);ia.multiplyVector3(j.normalWorld);j.centroidWorld.copy(S.centroid);da.multiplyVector3(j.centroidWorld);j.centroidScreen.copy(j.centroidWorld);p.multiplyVector3(j.centroidScreen);F=S.vertexNormals;H=0;for(C=F.length;H<C;H++){I=j.vertexNormalsWorld[H];I.copy(F[H]);ia.multiplyVector3(I)}H=
-0;for(C=pa.length;H<C;H++)if(wa=pa[H][W]){F=0;for(I=wa.length;F<I;F++)j.uvs[H][F]=wa[F]}j.meshMaterials=ja;j.faceMaterials=S.materials;j.overdraw=fa;j.z=j.centroidScreen.z;N.push(j)}}else if(G instanceof THREE.Line){Y.multiply(p,da);W=G.geometry.vertices;H=a();H.positionScreen.copy(W[0].position);Y.multiplyVector4(H.positionScreen);R=1;for(S=W.length;R<S;R++){H=a();H.positionScreen.copy(W[R].position);Y.multiplyVector4(H.positionScreen);C=h[i-2];aa.copy(H.positionScreen);P.copy(C.positionScreen);
-if(c(aa,P)){aa.multiplyScalar(1/aa.w);P.multiplyScalar(1/P.w);da=D[z]=D[z]||new THREE.RenderableLine;z++;w=da;w.v1.positionScreen.copy(aa);w.v2.positionScreen.copy(P);w.z=Math.max(aa.z,P.z);w.materials=G.materials;N.push(w)}}}else if(G instanceof THREE.Particle){u.set(G.position.x,G.position.y,G.position.z,1);p.multiplyVector4(u);u.z/=u.w;if(u.z>0&&u.z<1){da=V[U]=V[U]||new THREE.RenderableParticle;U++;A=da;A.x=u.x/u.w;A.y=u.y/u.w;A.z=u.z;A.rotation=G.rotation.z;A.scale.x=G.scale.x*Math.abs(A.x-(u.x+
-t.projectionMatrix.n11)/(u.w+t.projectionMatrix.n14));A.scale.y=G.scale.y*Math.abs(A.y-(u.y+t.projectionMatrix.n22)/(u.w+t.projectionMatrix.n24));A.materials=G.materials;N.push(A)}}}}K&&N.sort(b);return N}};
-THREE.CanvasRenderer=function(){function a($){if(o!=$)k.globalAlpha=o=$}function b($){if(w!=$){switch($){case THREE.NormalBlending:k.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:k.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:k.globalCompositeOperation="darker"}w=$}}function c($){if(z!=$)k.strokeStyle=z=$}var e=null,d=new THREE.Projector,g=document.createElement("canvas"),f,i,h,j,k=g.getContext("2d"),n=new THREE.Color(0),q=0,o=1,w=0,z=null,D=null,
-A=null,U=null,V=null,B,u,p,Y,Z=new THREE.RenderableVertex,aa=new THREE.RenderableVertex,P,x,t,K,N,Q,T,E,R,S,W,H,C=new THREE.Color,F=new THREE.Color,I=new THREE.Color,M=new THREE.Color,G=new THREE.Color,da,ia,ja,fa,pa,Da,wa,Wa,Xa,Ya,Ba=new THREE.Rectangle,ka=new THREE.Rectangle,ea=new THREE.Rectangle,Ua=!1,ha=new THREE.Color,ga=new THREE.Color,Ma=new THREE.Color,Na=new THREE.Color,ba=new THREE.Vector3,Ha,Ia,Va,la,Ja,Oa,Ea=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);la=Va.data;Ja=document.createElement("canvas");Ja.width=Ja.height=Ea;Oa=Ja.getContext("2d");Oa.translate(-Ea/2,-Ea/2);Oa.scale(Ea,Ea);Ea--;this.domElement=g;this.autoClear=!0;this.sortObjects=!0;this.sortElements=!0;this.setSize=function($,ma){f=$;i=ma;h=f/2;j=i/2;g.width=f;g.height=i;Ba.set(-h,-j,h,j);o=1;w=0;V=U=A=D=z=null};this.setClearColor=function($,ma){n=$;q=ma};this.setClearColorHex=function($,ma){n.setHex($);q=
-ma};this.clear=function(){k.setTransform(1,0,0,-1,h,j);if(!ka.isEmpty()){ka.inflate(1);ka.minSelf(Ba);if(n.hex==0&&q==0)k.clearRect(ka.getX(),ka.getY(),ka.getWidth(),ka.getHeight());else{b(THREE.NormalBlending);a(1);k.fillStyle="rgba("+Math.floor(n.r*255)+","+Math.floor(n.g*255)+","+Math.floor(n.b*255)+","+q+")";k.fillRect(ka.getX(),ka.getY(),ka.getWidth(),ka.getHeight())}ka.empty()}};this.render=function($,ma){function ab(m){var y,s,r,L=m.lights;ga.setRGB(0,0,0);Ma.setRGB(0,0,0);Na.setRGB(0,0,0);
-m=0;for(y=L.length;m<y;m++){s=L[m];r=s.color;if(s instanceof THREE.AmbientLight){ga.r+=r.r;ga.g+=r.g;ga.b+=r.b}else if(s instanceof THREE.DirectionalLight){Ma.r+=r.r;Ma.g+=r.g;Ma.b+=r.b}else if(s instanceof THREE.PointLight){Na.r+=r.r;Na.g+=r.g;Na.b+=r.b}}}function ra(m,y,s,r){var L,J,v,l,X=m.lights;m=0;for(L=X.length;m<L;m++){J=X[m];v=J.color;if(J instanceof THREE.DirectionalLight){l=s.dot(J.position);if(!(l<=0)){l*=J.intensity;r.r+=v.r*l;r.g+=v.g*l;r.b+=v.b*l}}else if(J instanceof THREE.PointLight){l=
-s.dot(ba.sub(J.position,y).normalize());if(!(l<=0)){l*=J.distance==0?1:1-Math.min(y.distanceTo(J.position)/J.distance,1);if(l!=0){l*=J.intensity;r.r+=v.r*l;r.g+=v.g*l;r.b+=v.b*l}}}}}function bb(m,y,s){a(s.opacity);b(s.blending);var r,L,J,v,l,X;if(s instanceof THREE.ParticleBasicMaterial){if(s.map){v=s.map.image;l=v.width>>1;X=v.height>>1;s=y.scale.x*h;J=y.scale.y*j;r=s*l;L=J*X;ea.set(m.x-r,m.y-L,m.x+r,m.y+L);if(Ba.instersects(ea)){k.save();k.translate(m.x,m.y);k.rotate(-y.rotation);k.scale(s,-J);
-k.translate(-l,-X);k.drawImage(v,0,0);k.restore()}}}else if(s instanceof THREE.ParticleCanvasMaterial){r=y.scale.x*h;L=y.scale.y*j;ea.set(m.x-r,m.y-L,m.x+r,m.y+L);if(Ba.instersects(ea)){c(s.color.__styleString);J=s.color.__styleString;if(D!=J)k.fillStyle=D=J;k.save();k.translate(m.x,m.y);k.rotate(-y.rotation);k.scale(r,L);s.program(k);k.restore()}}}function cb(m,y,s,r){a(r.opacity);b(r.blending);k.beginPath();k.moveTo(m.positionScreen.x,m.positionScreen.y);k.lineTo(y.positionScreen.x,y.positionScreen.y);
-k.closePath();if(r instanceof THREE.LineBasicMaterial){C.__styleString=r.color.__styleString;m=r.linewidth;if(A!=m)k.lineWidth=A=m;m=r.linecap;if(U!=m)k.lineCap=U=m;m=r.linejoin;if(V!=m)k.lineJoin=V=m;c(C.__styleString);k.stroke();ea.inflate(r.linewidth*2)}}function Pa(m,y,s,r,L,J,v,l,X){a(l.opacity);b(l.blending);P=m.positionScreen.x;x=m.positionScreen.y;t=y.positionScreen.x;K=y.positionScreen.y;N=s.positionScreen.x;Q=s.positionScreen.y;Ka(P,x,t,K,N,Q);if(l instanceof THREE.MeshBasicMaterial)if(l.map){if(l.map.mapping instanceof
-THREE.UVMapping){fa=v.uvs[0];sa(P,x,t,K,N,Q,l.map.image,fa[r].u,fa[r].v,fa[L].u,fa[L].v,fa[J].u,fa[J].v)}}else if(l.envMap){if(l.envMap.mapping instanceof THREE.SphericalReflectionMapping){m=ma.matrixWorldInverse;ba.copy(v.vertexNormalsWorld[0]);pa=(ba.x*m.n11+ba.y*m.n12+ba.z*m.n13)*0.5+0.5;Da=-(ba.x*m.n21+ba.y*m.n22+ba.z*m.n23)*0.5+0.5;ba.copy(v.vertexNormalsWorld[1]);wa=(ba.x*m.n11+ba.y*m.n12+ba.z*m.n13)*0.5+0.5;Wa=-(ba.x*m.n21+ba.y*m.n22+ba.z*m.n23)*0.5+0.5;ba.copy(v.vertexNormalsWorld[2]);Xa=
-(ba.x*m.n11+ba.y*m.n12+ba.z*m.n13)*0.5+0.5;Ya=-(ba.x*m.n21+ba.y*m.n22+ba.z*m.n23)*0.5+0.5;sa(P,x,t,K,N,Q,l.envMap.image,pa,Da,wa,Wa,Xa,Ya)}}else l.wireframe?xa(l.color.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(l.color.__styleString);else if(l instanceof THREE.MeshLambertMaterial){if(l.map&&!l.wireframe){if(l.map.mapping instanceof THREE.UVMapping){fa=v.uvs[0];sa(P,x,t,K,N,Q,l.map.image,fa[r].u,fa[r].v,fa[L].u,fa[L].v,fa[J].u,fa[J].v)}b(THREE.SubtractiveBlending)}if(Ua)if(!l.wireframe&&
-l.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==3){F.r=I.r=M.r=ga.r;F.g=I.g=M.g=ga.g;F.b=I.b=M.b=ga.b;ra(X,v.v1.positionWorld,v.vertexNormalsWorld[0],F);ra(X,v.v2.positionWorld,v.vertexNormalsWorld[1],I);ra(X,v.v3.positionWorld,v.vertexNormalsWorld[2],M);G.r=(I.r+M.r)*0.5;G.g=(I.g+M.g)*0.5;G.b=(I.b+M.b)*0.5;ja=Qa(F,I,M,G);sa(P,x,t,K,N,Q,ja,0,0,1,0,0,1)}else{ha.r=ga.r;ha.g=ga.g;ha.b=ga.b;ra(X,v.centroidWorld,v.normalWorld,ha);C.r=l.color.r*ha.r;C.g=l.color.g*ha.g;C.b=l.color.b*ha.b;C.updateStyleString();
-l.wireframe?xa(C.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(C.__styleString)}else l.wireframe?xa(l.color.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(l.color.__styleString)}else if(l instanceof THREE.MeshDepthMaterial){da=ma.near;ia=ma.far;F.r=F.g=F.b=1-Ca(m.positionScreen.z,da,ia);I.r=I.g=I.b=1-Ca(y.positionScreen.z,da,ia);M.r=M.g=M.b=1-Ca(s.positionScreen.z,da,ia);G.r=(I.r+M.r)*0.5;G.g=(I.g+M.g)*0.5;G.b=(I.b+M.b)*0.5;ja=Qa(F,I,
-M,G);sa(P,x,t,K,N,Q,ja,0,0,1,0,0,1)}else if(l instanceof THREE.MeshNormalMaterial){C.r=Fa(v.normalWorld.x);C.g=Fa(v.normalWorld.y);C.b=Fa(v.normalWorld.z);C.updateStyleString();l.wireframe?xa(C.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(C.__styleString)}}function Za(m,y,s,r,L,J,v,l,X){a(l.opacity);b(l.blending);if(l.map||l.envMap){Pa(m,y,r,0,1,3,v,l,X);Pa(L,s,J,1,2,3,v,l,X)}else{P=m.positionScreen.x;x=m.positionScreen.y;t=y.positionScreen.x;K=y.positionScreen.y;
-N=s.positionScreen.x;Q=s.positionScreen.y;T=r.positionScreen.x;E=r.positionScreen.y;R=L.positionScreen.x;S=L.positionScreen.y;W=J.positionScreen.x;H=J.positionScreen.y;if(l instanceof THREE.MeshBasicMaterial){Ra(P,x,t,K,N,Q,T,E);l.wireframe?xa(l.color.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(l.color.__styleString)}else if(l instanceof THREE.MeshLambertMaterial)if(Ua)if(!l.wireframe&&l.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4){F.r=I.r=M.r=G.r=
-ga.r;F.g=I.g=M.g=G.g=ga.g;F.b=I.b=M.b=G.b=ga.b;ra(X,v.v1.positionWorld,v.vertexNormalsWorld[0],F);ra(X,v.v2.positionWorld,v.vertexNormalsWorld[1],I);ra(X,v.v4.positionWorld,v.vertexNormalsWorld[3],M);ra(X,v.v3.positionWorld,v.vertexNormalsWorld[2],G);ja=Qa(F,I,M,G);Ka(P,x,t,K,T,E);sa(P,x,t,K,T,E,ja,0,0,1,0,0,1);Ka(R,S,N,Q,W,H);sa(R,S,N,Q,W,H,ja,1,0,1,1,0,1)}else{ha.r=ga.r;ha.g=ga.g;ha.b=ga.b;ra(X,v.centroidWorld,v.normalWorld,ha);C.r=l.color.r*ha.r;C.g=l.color.g*ha.g;C.b=l.color.b*ha.b;C.updateStyleString();
-Ra(P,x,t,K,N,Q,T,E);l.wireframe?xa(C.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(C.__styleString)}else{Ra(P,x,t,K,N,Q,T,E);l.wireframe?xa(l.color.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(l.color.__styleString)}else if(l instanceof THREE.MeshNormalMaterial){C.r=Fa(v.normalWorld.x);C.g=Fa(v.normalWorld.y);C.b=Fa(v.normalWorld.z);C.updateStyleString();Ra(P,x,t,K,N,Q,T,E);l.wireframe?xa(C.__styleString,l.wireframeLinewidth,l.wireframeLinecap,
-l.wireframeLinejoin):ya(C.__styleString)}else if(l instanceof THREE.MeshDepthMaterial){da=ma.near;ia=ma.far;F.r=F.g=F.b=1-Ca(m.positionScreen.z,da,ia);I.r=I.g=I.b=1-Ca(y.positionScreen.z,da,ia);M.r=M.g=M.b=1-Ca(r.positionScreen.z,da,ia);G.r=G.g=G.b=1-Ca(s.positionScreen.z,da,ia);ja=Qa(F,I,M,G);Ka(P,x,t,K,T,E);sa(P,x,t,K,T,E,ja,0,0,1,0,0,1);Ka(R,S,N,Q,W,H);sa(R,S,N,Q,W,H,ja,1,0,1,1,0,1)}}}function Ka(m,y,s,r,L,J){k.beginPath();k.moveTo(m,y);k.lineTo(s,r);k.lineTo(L,J);k.lineTo(m,y);k.closePath()}function Ra(m,
-y,s,r,L,J,v,l){k.beginPath();k.moveTo(m,y);k.lineTo(s,r);k.lineTo(L,J);k.lineTo(v,l);k.lineTo(m,y);k.closePath()}function xa(m,y,s,r){if(A!=y)k.lineWidth=A=y;if(U!=s)k.lineCap=U=s;if(V!=r)k.lineJoin=V=r;c(m);k.stroke();ea.inflate(y*2)}function ya(m){if(D!=m)k.fillStyle=D=m;k.fill()}function sa(m,y,s,r,L,J,v,l,X,ta,na,ua,La){var qa,va;qa=v.width-1;va=v.height-1;l*=qa;X*=va;ta*=qa;na*=va;ua*=qa;La*=va;s-=m;r-=y;L-=m;J-=y;ta-=l;na-=X;ua-=l;La-=X;qa=ta*La-ua*na;if(qa!=0){va=1/qa;qa=(La*s-na*L)*va;na=
-(La*r-na*J)*va;s=(ta*L-ua*s)*va;r=(ta*J-ua*r)*va;m=m-qa*l-s*X;y=y-na*l-r*X;k.save();k.transform(qa,na,s,r,m,y);k.clip();k.drawImage(v,0,0);k.restore()}}function Qa(m,y,s,r){var L=~~(m.r*255),J=~~(m.g*255);m=~~(m.b*255);var v=~~(y.r*255),l=~~(y.g*255);y=~~(y.b*255);var X=~~(s.r*255),ta=~~(s.g*255);s=~~(s.b*255);var na=~~(r.r*255),ua=~~(r.g*255);r=~~(r.b*255);la[0]=L<0?0:L>255?255:L;la[1]=J<0?0:J>255?255:J;la[2]=m<0?0:m>255?255:m;la[4]=v<0?0:v>255?255:v;la[5]=l<0?0:l>255?255:l;la[6]=y<0?0:y>255?255:
-y;la[8]=X<0?0:X>255?255:X;la[9]=ta<0?0:ta>255?255:ta;la[10]=s<0?0:s>255?255:s;la[12]=na<0?0:na>255?255:na;la[13]=ua<0?0:ua>255?255:ua;la[14]=r<0?0:r>255?255:r;Ia.putImageData(Va,0,0);Oa.drawImage(Ha,0,0);return Ja}function Ca(m,y,s){m=(m-y)/(s-y);return m*m*(3-2*m)}function Fa(m){m=(m+1)*0.5;return m<0?0:m>1?1:m}function za(m,y){var s=y.x-m.x,r=y.y-m.y,L=1/Math.sqrt(s*s+r*r);s*=L;r*=L;y.x+=s;y.y+=r;m.x-=s;m.y-=r}var Sa,$a,O,oa,Aa,Ga,Ta,ca;this.autoClear?this.clear():k.setTransform(1,0,0,-1,h,j);e=
-d.projectScene($,ma,this.sortElements);(Ua=$.lights.length>0)&&ab($);Sa=0;for($a=e.length;Sa<$a;Sa++){O=e[Sa];ea.empty();if(O instanceof THREE.RenderableParticle){B=O;B.x*=h;B.y*=j;oa=0;for(Aa=O.materials.length;oa<Aa;){ca=O.materials[oa++];ca.opacity!=0&&bb(B,O,ca,$)}}else if(O instanceof THREE.RenderableLine){B=O.v1;u=O.v2;B.positionScreen.x*=h;B.positionScreen.y*=j;u.positionScreen.x*=h;u.positionScreen.y*=j;ea.addPoint(B.positionScreen.x,B.positionScreen.y);ea.addPoint(u.positionScreen.x,u.positionScreen.y);
-if(Ba.instersects(ea)){oa=0;for(Aa=O.materials.length;oa<Aa;){ca=O.materials[oa++];ca.opacity!=0&&cb(B,u,O,ca,$)}}}else if(O instanceof THREE.RenderableFace3){B=O.v1;u=O.v2;p=O.v3;B.positionScreen.x*=h;B.positionScreen.y*=j;u.positionScreen.x*=h;u.positionScreen.y*=j;p.positionScreen.x*=h;p.positionScreen.y*=j;if(O.overdraw){za(B.positionScreen,u.positionScreen);za(u.positionScreen,p.positionScreen);za(p.positionScreen,B.positionScreen)}ea.add3Points(B.positionScreen.x,B.positionScreen.y,u.positionScreen.x,
-u.positionScreen.y,p.positionScreen.x,p.positionScreen.y);if(Ba.instersects(ea)){oa=0;for(Aa=O.meshMaterials.length;oa<Aa;){ca=O.meshMaterials[oa++];if(ca instanceof THREE.MeshFaceMaterial){Ga=0;for(Ta=O.faceMaterials.length;Ga<Ta;)(ca=O.faceMaterials[Ga++])&&ca.opacity!=0&&Pa(B,u,p,0,1,2,O,ca,$)}else ca.opacity!=0&&Pa(B,u,p,0,1,2,O,ca,$)}}}else if(O instanceof THREE.RenderableFace4){B=O.v1;u=O.v2;p=O.v3;Y=O.v4;B.positionScreen.x*=h;B.positionScreen.y*=j;u.positionScreen.x*=h;u.positionScreen.y*=
-j;p.positionScreen.x*=h;p.positionScreen.y*=j;Y.positionScreen.x*=h;Y.positionScreen.y*=j;Z.positionScreen.copy(u.positionScreen);aa.positionScreen.copy(Y.positionScreen);if(O.overdraw){za(B.positionScreen,u.positionScreen);za(u.positionScreen,Y.positionScreen);za(Y.positionScreen,B.positionScreen);za(p.positionScreen,Z.positionScreen);za(p.positionScreen,aa.positionScreen)}ea.addPoint(B.positionScreen.x,B.positionScreen.y);ea.addPoint(u.positionScreen.x,u.positionScreen.y);ea.addPoint(p.positionScreen.x,
-p.positionScreen.y);ea.addPoint(Y.positionScreen.x,Y.positionScreen.y);if(Ba.instersects(ea)){oa=0;for(Aa=O.meshMaterials.length;oa<Aa;){ca=O.meshMaterials[oa++];if(ca instanceof THREE.MeshFaceMaterial){Ga=0;for(Ta=O.faceMaterials.length;Ga<Ta;)(ca=O.faceMaterials[Ga++])&&ca.opacity!=0&&Za(B,u,p,Y,Z,aa,O,ca,$)}else ca.opacity!=0&&Za(B,u,p,Y,Z,aa,O,ca,$)}}}ka.addRectangle(ea)}k.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 e,d=c.length;for(e=0;e<d;e++){a=c[e];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 w=g[k]=g[k]||new THREE.RenderableVertex;k++;return w}function b(w,t){return t.z-w.z}function c(w,t){var K=0,N=1,Q=w.z+w.w,T=t.z+t.w,E=-w.z+w.w,R=-t.z+t.w;if(Q>=0&&T>=0&&E>=0&&R>=0)return!0;else if(Q<0&&T<0||E<0&&R<0)return!1;else{if(Q<0)K=Math.max(K,Q/(Q-T));else T<0&&(N=Math.min(N,Q/(Q-T)));if(E<0)K=Math.max(K,E/(E-R));else R<0&&(N=Math.min(N,E/(E-R)));if(N<K)return!1;else{w.lerpSelf(t,K);t.lerpSelf(w,1-N);return!0}}}var d,e,h=[],f,k,g=[],i,j,o=[],p,r=
+[],y,A,D=[],z,U,V=[],B=new THREE.Vector4,u=new THREE.Vector4,n=new THREE.Matrix4,Y=new THREE.Matrix4,Z=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],aa=new THREE.Vector4,P=new THREE.Vector4;this.projectVector=function(w,t){n.multiply(t.projectionMatrix,t.matrixWorldInverse);n.multiplyVector3(w);return w};this.unprojectVector=function(w,t){n.multiply(t.matrixWorld,THREE.Matrix4.makeInvert(t.projectionMatrix));n.multiplyVector3(w);return w};
+this.projectObjects=function(w,t,K){t=[];var N,Q,T;e=0;Q=w.objects;w=0;for(N=Q.length;w<N;w++){T=Q[w];var E;if(!(E=!T.visible))if(E=T instanceof THREE.Mesh){a:{E=void 0;for(var R=T.matrixWorld,S=-T.geometry.boundingSphere.radius*Math.max(T.scale.x,Math.max(T.scale.y,T.scale.z)),W=0;W<6;W++){E=Z[W].x*R.n14+Z[W].y*R.n24+Z[W].z*R.n34+Z[W].w;if(E<=S){E=!1;break a}}E=!0}E=!E}if(!E){E=h[e]=h[e]||new THREE.RenderableObject;e++;d=E;B.copy(T.position);n.multiplyVector3(B);d.object=T;d.z=B.z;t.push(d)}}K&&
+t.sort(b);return t};this.projectScene=function(w,t,K){var N=[],Q=t.near,T=t.far,E,R,S,W,H,C,F,I,M,G,da,ia,ja,fa,pa,Da,wa;U=A=p=j=0;t.matrixAutoUpdate&&t.updateMatrix();w.update(undefined,!1,t);n.multiply(t.projectionMatrix,t.matrixWorldInverse);Z[0].set(n.n41-n.n11,n.n42-n.n12,n.n43-n.n13,n.n44-n.n14);Z[1].set(n.n41+n.n11,n.n42+n.n12,n.n43+n.n13,n.n44+n.n14);Z[2].set(n.n41+n.n21,n.n42+n.n22,n.n43+n.n23,n.n44+n.n24);Z[3].set(n.n41-n.n21,n.n42-n.n22,n.n43-n.n23,n.n44-n.n24);Z[4].set(n.n41-n.n31,n.n42-
+n.n32,n.n43-n.n33,n.n44-n.n34);Z[5].set(n.n41+n.n31,n.n42+n.n32,n.n43+n.n33,n.n44+n.n34);for(E=0;E<6;E++){M=Z[E];M.divideScalar(Math.sqrt(M.x*M.x+M.y*M.y+M.z*M.z))}M=this.projectObjects(w,t,!0);w=0;for(E=M.length;w<E;w++){G=M[w].object;if(G.visible){da=G.matrixWorld;ia=G.matrixRotationWorld;ja=G.materials;fa=G.overdraw;k=0;if(G instanceof THREE.Mesh){pa=G.geometry;W=pa.vertices;Da=pa.faces;pa=pa.faceVertexUvs;R=0;for(S=W.length;R<S;R++){f=a();f.positionWorld.copy(W[R].position);da.multiplyVector3(f.positionWorld);
+f.positionScreen.copy(f.positionWorld);n.multiplyVector4(f.positionScreen);f.positionScreen.x/=f.positionScreen.w;f.positionScreen.y/=f.positionScreen.w;f.visible=f.positionScreen.z>Q&&f.positionScreen.z<T}W=0;for(R=Da.length;W<R;W++){S=Da[W];if(S instanceof THREE.Face3){H=g[S.a];C=g[S.b];F=g[S.c];if(H.visible&&C.visible&&F.visible&&(G.doubleSided||G.flipSided!=(F.positionScreen.x-H.positionScreen.x)*(C.positionScreen.y-H.positionScreen.y)-(F.positionScreen.y-H.positionScreen.y)*(C.positionScreen.x-
+H.positionScreen.x)<0)){I=o[j]=o[j]||new THREE.RenderableFace3;j++;i=I;i.v1.copy(H);i.v2.copy(C);i.v3.copy(F)}else continue}else if(S instanceof THREE.Face4){H=g[S.a];C=g[S.b];F=g[S.c];I=g[S.d];if(H.visible&&C.visible&&F.visible&&I.visible&&(G.doubleSided||G.flipSided!=((I.positionScreen.x-H.positionScreen.x)*(C.positionScreen.y-H.positionScreen.y)-(I.positionScreen.y-H.positionScreen.y)*(C.positionScreen.x-H.positionScreen.x)<0||(C.positionScreen.x-F.positionScreen.x)*(I.positionScreen.y-F.positionScreen.y)-
+(C.positionScreen.y-F.positionScreen.y)*(I.positionScreen.x-F.positionScreen.x)<0))){wa=r[p]=r[p]||new THREE.RenderableFace4;p++;i=wa;i.v1.copy(H);i.v2.copy(C);i.v3.copy(F);i.v4.copy(I)}else continue}i.normalWorld.copy(S.normal);ia.multiplyVector3(i.normalWorld);i.centroidWorld.copy(S.centroid);da.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);n.multiplyVector3(i.centroidScreen);F=S.vertexNormals;H=0;for(C=F.length;H<C;H++){I=i.vertexNormalsWorld[H];I.copy(F[H]);ia.multiplyVector3(I)}H=
+0;for(C=pa.length;H<C;H++)if(wa=pa[H][W]){F=0;for(I=wa.length;F<I;F++)i.uvs[H][F]=wa[F]}i.meshMaterials=ja;i.faceMaterials=S.materials;i.overdraw=fa;i.z=i.centroidScreen.z;N.push(i)}}else if(G instanceof THREE.Line){Y.multiply(n,da);W=G.geometry.vertices;H=a();H.positionScreen.copy(W[0].position);Y.multiplyVector4(H.positionScreen);R=1;for(S=W.length;R<S;R++){H=a();H.positionScreen.copy(W[R].position);Y.multiplyVector4(H.positionScreen);C=g[k-2];aa.copy(H.positionScreen);P.copy(C.positionScreen);
+if(c(aa,P)){aa.multiplyScalar(1/aa.w);P.multiplyScalar(1/P.w);da=D[A]=D[A]||new THREE.RenderableLine;A++;y=da;y.v1.positionScreen.copy(aa);y.v2.positionScreen.copy(P);y.z=Math.max(aa.z,P.z);y.materials=G.materials;N.push(y)}}}else if(G instanceof THREE.Particle){u.set(G.position.x,G.position.y,G.position.z,1);n.multiplyVector4(u);u.z/=u.w;if(u.z>0&&u.z<1){da=V[U]=V[U]||new THREE.RenderableParticle;U++;z=da;z.x=u.x/u.w;z.y=u.y/u.w;z.z=u.z;z.rotation=G.rotation.z;z.scale.x=G.scale.x*Math.abs(z.x-(u.x+
+t.projectionMatrix.n11)/(u.w+t.projectionMatrix.n14));z.scale.y=G.scale.y*Math.abs(z.y-(u.y+t.projectionMatrix.n22)/(u.w+t.projectionMatrix.n24));z.materials=G.materials;N.push(z)}}}}K&&N.sort(b);return N}};
+THREE.CanvasRenderer=function(){function a($){if(r!=$)j.globalAlpha=r=$}function b($){if(y!=$){switch($){case THREE.NormalBlending:j.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:j.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:j.globalCompositeOperation="darker"}y=$}}function c($){if(A!=$)j.strokeStyle=A=$}var d=null,e=new THREE.Projector,h=document.createElement("canvas"),f,k,g,i,j=h.getContext("2d"),o=new THREE.Color(0),p=0,r=1,y=0,A=null,D=null,
+z=null,U=null,V=null,B,u,n,Y,Z=new THREE.RenderableVertex,aa=new THREE.RenderableVertex,P,w,t,K,N,Q,T,E,R,S,W,H,C=new THREE.Color,F=new THREE.Color,I=new THREE.Color,M=new THREE.Color,G=new THREE.Color,da,ia,ja,fa,pa,Da,wa,Wa,Xa,Ya,Ba=new THREE.Rectangle,ka=new THREE.Rectangle,ea=new THREE.Rectangle,Ua=!1,ha=new THREE.Color,ga=new THREE.Color,Ma=new THREE.Color,Na=new THREE.Color,ba=new THREE.Vector3,Ha,Ia,Va,la,Ja,Oa,Ea=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);la=Va.data;Ja=document.createElement("canvas");Ja.width=Ja.height=Ea;Oa=Ja.getContext("2d");Oa.translate(-Ea/2,-Ea/2);Oa.scale(Ea,Ea);Ea--;this.domElement=h;this.autoClear=!0;this.sortObjects=!0;this.sortElements=!0;this.setSize=function($,ma){f=$;k=ma;g=f/2;i=k/2;h.width=f;h.height=k;Ba.set(-g,-i,g,i);r=1;y=0;V=U=z=D=A=null};this.setClearColor=function($,ma){o=$;p=ma};this.setClearColorHex=function($,ma){o.setHex($);p=
+ma};this.clear=function(){j.setTransform(1,0,0,-1,g,i);if(!ka.isEmpty()){ka.inflate(1);ka.minSelf(Ba);if(o.hex==0&&p==0)j.clearRect(ka.getX(),ka.getY(),ka.getWidth(),ka.getHeight());else{b(THREE.NormalBlending);a(1);j.fillStyle="rgba("+Math.floor(o.r*255)+","+Math.floor(o.g*255)+","+Math.floor(o.b*255)+","+p+")";j.fillRect(ka.getX(),ka.getY(),ka.getWidth(),ka.getHeight())}ka.empty()}};this.render=function($,ma){function ab(m){var x,s,q,L=m.lights;ga.setRGB(0,0,0);Ma.setRGB(0,0,0);Na.setRGB(0,0,0);
+m=0;for(x=L.length;m<x;m++){s=L[m];q=s.color;if(s instanceof THREE.AmbientLight){ga.r+=q.r;ga.g+=q.g;ga.b+=q.b}else if(s instanceof THREE.DirectionalLight){Ma.r+=q.r;Ma.g+=q.g;Ma.b+=q.b}else if(s instanceof THREE.PointLight){Na.r+=q.r;Na.g+=q.g;Na.b+=q.b}}}function ra(m,x,s,q){var L,J,v,l,X=m.lights;m=0;for(L=X.length;m<L;m++){J=X[m];v=J.color;if(J instanceof THREE.DirectionalLight){l=s.dot(J.position);if(!(l<=0)){l*=J.intensity;q.r+=v.r*l;q.g+=v.g*l;q.b+=v.b*l}}else if(J instanceof THREE.PointLight){l=
+s.dot(ba.sub(J.position,x).normalize());if(!(l<=0)){l*=J.distance==0?1:1-Math.min(x.distanceTo(J.position)/J.distance,1);if(l!=0){l*=J.intensity;q.r+=v.r*l;q.g+=v.g*l;q.b+=v.b*l}}}}}function bb(m,x,s){a(s.opacity);b(s.blending);var q,L,J,v,l,X;if(s instanceof THREE.ParticleBasicMaterial){if(s.map){v=s.map.image;l=v.width>>1;X=v.height>>1;s=x.scale.x*g;J=x.scale.y*i;q=s*l;L=J*X;ea.set(m.x-q,m.y-L,m.x+q,m.y+L);if(Ba.instersects(ea)){j.save();j.translate(m.x,m.y);j.rotate(-x.rotation);j.scale(s,-J);
+j.translate(-l,-X);j.drawImage(v,0,0);j.restore()}}}else if(s instanceof THREE.ParticleCanvasMaterial){q=x.scale.x*g;L=x.scale.y*i;ea.set(m.x-q,m.y-L,m.x+q,m.y+L);if(Ba.instersects(ea)){c(s.color.__styleString);J=s.color.__styleString;if(D!=J)j.fillStyle=D=J;j.save();j.translate(m.x,m.y);j.rotate(-x.rotation);j.scale(q,L);s.program(j);j.restore()}}}function cb(m,x,s,q){a(q.opacity);b(q.blending);j.beginPath();j.moveTo(m.positionScreen.x,m.positionScreen.y);j.lineTo(x.positionScreen.x,x.positionScreen.y);
+j.closePath();if(q instanceof THREE.LineBasicMaterial){C.__styleString=q.color.__styleString;m=q.linewidth;if(z!=m)j.lineWidth=z=m;m=q.linecap;if(U!=m)j.lineCap=U=m;m=q.linejoin;if(V!=m)j.lineJoin=V=m;c(C.__styleString);j.stroke();ea.inflate(q.linewidth*2)}}function Pa(m,x,s,q,L,J,v,l,X){a(l.opacity);b(l.blending);P=m.positionScreen.x;w=m.positionScreen.y;t=x.positionScreen.x;K=x.positionScreen.y;N=s.positionScreen.x;Q=s.positionScreen.y;Ka(P,w,t,K,N,Q);if(l instanceof THREE.MeshBasicMaterial)if(l.map){if(l.map.mapping instanceof
+THREE.UVMapping){fa=v.uvs[0];sa(P,w,t,K,N,Q,l.map.image,fa[q].u,fa[q].v,fa[L].u,fa[L].v,fa[J].u,fa[J].v)}}else if(l.envMap){if(l.envMap.mapping instanceof THREE.SphericalReflectionMapping){m=ma.matrixWorldInverse;ba.copy(v.vertexNormalsWorld[0]);pa=(ba.x*m.n11+ba.y*m.n12+ba.z*m.n13)*0.5+0.5;Da=-(ba.x*m.n21+ba.y*m.n22+ba.z*m.n23)*0.5+0.5;ba.copy(v.vertexNormalsWorld[1]);wa=(ba.x*m.n11+ba.y*m.n12+ba.z*m.n13)*0.5+0.5;Wa=-(ba.x*m.n21+ba.y*m.n22+ba.z*m.n23)*0.5+0.5;ba.copy(v.vertexNormalsWorld[2]);Xa=
+(ba.x*m.n11+ba.y*m.n12+ba.z*m.n13)*0.5+0.5;Ya=-(ba.x*m.n21+ba.y*m.n22+ba.z*m.n23)*0.5+0.5;sa(P,w,t,K,N,Q,l.envMap.image,pa,Da,wa,Wa,Xa,Ya)}}else l.wireframe?xa(l.color.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(l.color.__styleString);else if(l instanceof THREE.MeshLambertMaterial){if(l.map&&!l.wireframe){if(l.map.mapping instanceof THREE.UVMapping){fa=v.uvs[0];sa(P,w,t,K,N,Q,l.map.image,fa[q].u,fa[q].v,fa[L].u,fa[L].v,fa[J].u,fa[J].v)}b(THREE.SubtractiveBlending)}if(Ua)if(!l.wireframe&&
+l.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==3){F.r=I.r=M.r=ga.r;F.g=I.g=M.g=ga.g;F.b=I.b=M.b=ga.b;ra(X,v.v1.positionWorld,v.vertexNormalsWorld[0],F);ra(X,v.v2.positionWorld,v.vertexNormalsWorld[1],I);ra(X,v.v3.positionWorld,v.vertexNormalsWorld[2],M);G.r=(I.r+M.r)*0.5;G.g=(I.g+M.g)*0.5;G.b=(I.b+M.b)*0.5;ja=Qa(F,I,M,G);sa(P,w,t,K,N,Q,ja,0,0,1,0,0,1)}else{ha.r=ga.r;ha.g=ga.g;ha.b=ga.b;ra(X,v.centroidWorld,v.normalWorld,ha);C.r=l.color.r*ha.r;C.g=l.color.g*ha.g;C.b=l.color.b*ha.b;C.updateStyleString();
+l.wireframe?xa(C.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(C.__styleString)}else l.wireframe?xa(l.color.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(l.color.__styleString)}else if(l instanceof THREE.MeshDepthMaterial){da=ma.near;ia=ma.far;F.r=F.g=F.b=1-Ca(m.positionScreen.z,da,ia);I.r=I.g=I.b=1-Ca(x.positionScreen.z,da,ia);M.r=M.g=M.b=1-Ca(s.positionScreen.z,da,ia);G.r=(I.r+M.r)*0.5;G.g=(I.g+M.g)*0.5;G.b=(I.b+M.b)*0.5;ja=Qa(F,I,
+M,G);sa(P,w,t,K,N,Q,ja,0,0,1,0,0,1)}else if(l instanceof THREE.MeshNormalMaterial){C.r=Fa(v.normalWorld.x);C.g=Fa(v.normalWorld.y);C.b=Fa(v.normalWorld.z);C.updateStyleString();l.wireframe?xa(C.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(C.__styleString)}}function Za(m,x,s,q,L,J,v,l,X){a(l.opacity);b(l.blending);if(l.map||l.envMap){Pa(m,x,q,0,1,3,v,l,X);Pa(L,s,J,1,2,3,v,l,X)}else{P=m.positionScreen.x;w=m.positionScreen.y;t=x.positionScreen.x;K=x.positionScreen.y;
+N=s.positionScreen.x;Q=s.positionScreen.y;T=q.positionScreen.x;E=q.positionScreen.y;R=L.positionScreen.x;S=L.positionScreen.y;W=J.positionScreen.x;H=J.positionScreen.y;if(l instanceof THREE.MeshBasicMaterial){Ra(P,w,t,K,N,Q,T,E);l.wireframe?xa(l.color.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(l.color.__styleString)}else if(l instanceof THREE.MeshLambertMaterial)if(Ua)if(!l.wireframe&&l.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4){F.r=I.r=M.r=G.r=
+ga.r;F.g=I.g=M.g=G.g=ga.g;F.b=I.b=M.b=G.b=ga.b;ra(X,v.v1.positionWorld,v.vertexNormalsWorld[0],F);ra(X,v.v2.positionWorld,v.vertexNormalsWorld[1],I);ra(X,v.v4.positionWorld,v.vertexNormalsWorld[3],M);ra(X,v.v3.positionWorld,v.vertexNormalsWorld[2],G);ja=Qa(F,I,M,G);Ka(P,w,t,K,T,E);sa(P,w,t,K,T,E,ja,0,0,1,0,0,1);Ka(R,S,N,Q,W,H);sa(R,S,N,Q,W,H,ja,1,0,1,1,0,1)}else{ha.r=ga.r;ha.g=ga.g;ha.b=ga.b;ra(X,v.centroidWorld,v.normalWorld,ha);C.r=l.color.r*ha.r;C.g=l.color.g*ha.g;C.b=l.color.b*ha.b;C.updateStyleString();
+Ra(P,w,t,K,N,Q,T,E);l.wireframe?xa(C.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(C.__styleString)}else{Ra(P,w,t,K,N,Q,T,E);l.wireframe?xa(l.color.__styleString,l.wireframeLinewidth,l.wireframeLinecap,l.wireframeLinejoin):ya(l.color.__styleString)}else if(l instanceof THREE.MeshNormalMaterial){C.r=Fa(v.normalWorld.x);C.g=Fa(v.normalWorld.y);C.b=Fa(v.normalWorld.z);C.updateStyleString();Ra(P,w,t,K,N,Q,T,E);l.wireframe?xa(C.__styleString,l.wireframeLinewidth,l.wireframeLinecap,
+l.wireframeLinejoin):ya(C.__styleString)}else if(l instanceof THREE.MeshDepthMaterial){da=ma.near;ia=ma.far;F.r=F.g=F.b=1-Ca(m.positionScreen.z,da,ia);I.r=I.g=I.b=1-Ca(x.positionScreen.z,da,ia);M.r=M.g=M.b=1-Ca(q.positionScreen.z,da,ia);G.r=G.g=G.b=1-Ca(s.positionScreen.z,da,ia);ja=Qa(F,I,M,G);Ka(P,w,t,K,T,E);sa(P,w,t,K,T,E,ja,0,0,1,0,0,1);Ka(R,S,N,Q,W,H);sa(R,S,N,Q,W,H,ja,1,0,1,1,0,1)}}}function Ka(m,x,s,q,L,J){j.beginPath();j.moveTo(m,x);j.lineTo(s,q);j.lineTo(L,J);j.lineTo(m,x);j.closePath()}function Ra(m,
+x,s,q,L,J,v,l){j.beginPath();j.moveTo(m,x);j.lineTo(s,q);j.lineTo(L,J);j.lineTo(v,l);j.lineTo(m,x);j.closePath()}function xa(m,x,s,q){if(z!=x)j.lineWidth=z=x;if(U!=s)j.lineCap=U=s;if(V!=q)j.lineJoin=V=q;c(m);j.stroke();ea.inflate(x*2)}function ya(m){if(D!=m)j.fillStyle=D=m;j.fill()}function sa(m,x,s,q,L,J,v,l,X,ta,na,ua,La){var qa,va;qa=v.width-1;va=v.height-1;l*=qa;X*=va;ta*=qa;na*=va;ua*=qa;La*=va;s-=m;q-=x;L-=m;J-=x;ta-=l;na-=X;ua-=l;La-=X;qa=ta*La-ua*na;if(qa!=0){va=1/qa;qa=(La*s-na*L)*va;na=
+(La*q-na*J)*va;s=(ta*L-ua*s)*va;q=(ta*J-ua*q)*va;m=m-qa*l-s*X;x=x-na*l-q*X;j.save();j.transform(qa,na,s,q,m,x);j.clip();j.drawImage(v,0,0);j.restore()}}function Qa(m,x,s,q){var L=~~(m.r*255),J=~~(m.g*255);m=~~(m.b*255);var v=~~(x.r*255),l=~~(x.g*255);x=~~(x.b*255);var X=~~(s.r*255),ta=~~(s.g*255);s=~~(s.b*255);var na=~~(q.r*255),ua=~~(q.g*255);q=~~(q.b*255);la[0]=L<0?0:L>255?255:L;la[1]=J<0?0:J>255?255:J;la[2]=m<0?0:m>255?255:m;la[4]=v<0?0:v>255?255:v;la[5]=l<0?0:l>255?255:l;la[6]=x<0?0:x>255?255:
+x;la[8]=X<0?0:X>255?255:X;la[9]=ta<0?0:ta>255?255:ta;la[10]=s<0?0:s>255?255:s;la[12]=na<0?0:na>255?255:na;la[13]=ua<0?0:ua>255?255:ua;la[14]=q<0?0:q>255?255:q;Ia.putImageData(Va,0,0);Oa.drawImage(Ha,0,0);return Ja}function Ca(m,x,s){m=(m-x)/(s-x);return m*m*(3-2*m)}function Fa(m){m=(m+1)*0.5;return m<0?0:m>1?1:m}function za(m,x){var s=x.x-m.x,q=x.y-m.y,L=1/Math.sqrt(s*s+q*q);s*=L;q*=L;x.x+=s;x.y+=q;m.x-=s;m.y-=q}var Sa,$a,O,oa,Aa,Ga,Ta,ca;this.autoClear?this.clear():j.setTransform(1,0,0,-1,g,i);d=
+e.projectScene($,ma,this.sortElements);(Ua=$.lights.length>0)&&ab($);Sa=0;for($a=d.length;Sa<$a;Sa++){O=d[Sa];ea.empty();if(O instanceof THREE.RenderableParticle){B=O;B.x*=g;B.y*=i;oa=0;for(Aa=O.materials.length;oa<Aa;){ca=O.materials[oa++];ca.opacity!=0&&bb(B,O,ca,$)}}else if(O instanceof THREE.RenderableLine){B=O.v1;u=O.v2;B.positionScreen.x*=g;B.positionScreen.y*=i;u.positionScreen.x*=g;u.positionScreen.y*=i;ea.addPoint(B.positionScreen.x,B.positionScreen.y);ea.addPoint(u.positionScreen.x,u.positionScreen.y);
+if(Ba.instersects(ea)){oa=0;for(Aa=O.materials.length;oa<Aa;){ca=O.materials[oa++];ca.opacity!=0&&cb(B,u,O,ca,$)}}}else if(O instanceof THREE.RenderableFace3){B=O.v1;u=O.v2;n=O.v3;B.positionScreen.x*=g;B.positionScreen.y*=i;u.positionScreen.x*=g;u.positionScreen.y*=i;n.positionScreen.x*=g;n.positionScreen.y*=i;if(O.overdraw){za(B.positionScreen,u.positionScreen);za(u.positionScreen,n.positionScreen);za(n.positionScreen,B.positionScreen)}ea.add3Points(B.positionScreen.x,B.positionScreen.y,u.positionScreen.x,
+u.positionScreen.y,n.positionScreen.x,n.positionScreen.y);if(Ba.instersects(ea)){oa=0;for(Aa=O.meshMaterials.length;oa<Aa;){ca=O.meshMaterials[oa++];if(ca instanceof THREE.MeshFaceMaterial){Ga=0;for(Ta=O.faceMaterials.length;Ga<Ta;)(ca=O.faceMaterials[Ga++])&&ca.opacity!=0&&Pa(B,u,n,0,1,2,O,ca,$)}else ca.opacity!=0&&Pa(B,u,n,0,1,2,O,ca,$)}}}else if(O instanceof THREE.RenderableFace4){B=O.v1;u=O.v2;n=O.v3;Y=O.v4;B.positionScreen.x*=g;B.positionScreen.y*=i;u.positionScreen.x*=g;u.positionScreen.y*=
+i;n.positionScreen.x*=g;n.positionScreen.y*=i;Y.positionScreen.x*=g;Y.positionScreen.y*=i;Z.positionScreen.copy(u.positionScreen);aa.positionScreen.copy(Y.positionScreen);if(O.overdraw){za(B.positionScreen,u.positionScreen);za(u.positionScreen,Y.positionScreen);za(Y.positionScreen,B.positionScreen);za(n.positionScreen,Z.positionScreen);za(n.positionScreen,aa.positionScreen)}ea.addPoint(B.positionScreen.x,B.positionScreen.y);ea.addPoint(u.positionScreen.x,u.positionScreen.y);ea.addPoint(n.positionScreen.x,
+n.positionScreen.y);ea.addPoint(Y.positionScreen.x,Y.positionScreen.y);if(Ba.instersects(ea)){oa=0;for(Aa=O.meshMaterials.length;oa<Aa;){ca=O.meshMaterials[oa++];if(ca instanceof THREE.MeshFaceMaterial){Ga=0;for(Ta=O.faceMaterials.length;Ga<Ta;)(ca=O.faceMaterials[Ga++])&&ca.opacity!=0&&Za(B,u,n,Y,Z,aa,O,ca,$)}else ca.opacity!=0&&Za(B,u,n,Y,Z,aa,O,ca,$)}}}ka.addRectangle(ea)}j.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.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.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.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.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};

+ 51 - 69
build/custom/ThreeDOM.js

@@ -1,101 +1,83 @@
 // ThreeDOM.js r39 - http://github.com/mrdoob/three.js
 // ThreeDOM.js r39 - 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)};
 var THREE=THREE||{};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}THREE.Color=function(a){this.setHex(a)};
-THREE.Color.prototype={autoUpdate:!0,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex;this.__styleString=a.__styleString},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,c){var e,d,g,f,i,h;if(c==0)e=d=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:e=h;d=c;g=a;break;case 2:e=a;d=c;g=b;break;case 3:e=a;d=h;g=c;break;case 4:e=b;d=a;g=c;break;case 5:e=c;d=a;
-g=h;break;case 6:case 0:e=c;d=b;g=a}}this.r=e;this.g=d;this.b=g;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},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},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
+THREE.Color.prototype={autoUpdate:!0,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex;this.__styleString=a.__styleString},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},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.r=d;this.g=e;this.b=h;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},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},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
 255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)}};THREE.Vector2=function(a,b){this.set(a||0,b||0)};
 255)+","+~~(this.b*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/
 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)};
 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,
 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,e=this.z;this.set(c*a.z-e*a.y,e*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/
+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=
 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){this.y=Math.asin(a.n13);var b=Math.cos(this.y);if(Math.abs(b)>1.0E-5){this.x=Math.atan2(-a.n23/b,a.n33/b);this.z=Math.atan2(-a.n13/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)<
 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){this.y=Math.asin(a.n13);var b=Math.cos(this.y);if(Math.abs(b)>1.0E-5){this.x=Math.atan2(-a.n23/b,a.n33/b);this.z=Math.atan2(-a.n13/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,e){this.set(a||0,b||0,c||0,e||1)};
-THREE.Vector4.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;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*
+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};
 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){var b,c,e=a.objects,d=[];a=0;for(b=e.length;a<b;a++){c=e[a];c instanceof THREE.Mesh&&(d=d.concat(this.intersectObject(c)))}d.sort(function(g,f){return g.distance-f.distance});return d},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,e,d,g,f,i,h,j,l,m,
-n,k=a.geometry,p=k.vertices,q=[];c=0;for(e=k.faces.length;c<e;c++){d=k.faces[c];m=this.origin.clone();n=this.direction.clone();h=a.matrixWorld;g=h.multiplyVector3(p[d.a].position.clone());f=h.multiplyVector3(p[d.b].position.clone());i=h.multiplyVector3(p[d.c].position.clone());h=d instanceof THREE.Face4?h.multiplyVector3(p[d.d].position.clone()):null;j=a.matrixRotationWorld.multiplyVector3(d.normal.clone());l=n.dot(j);if(a.doubleSided||(a.flipSided?l>0:l<0)){j=j.dot((new THREE.Vector3).sub(g,m))/
-l;m=m.addSelf(n.multiplyScalar(j));if(d instanceof THREE.Face3){if(b(m,g,f,i)){d={distance:this.origin.distanceTo(m),point:m,face:d,object:a};q.push(d)}}else if(d instanceof THREE.Face4&&(b(m,g,f,h)||b(m,f,i,h))){d={distance:this.origin.distanceTo(m),point:m,face:d,object:a};q.push(d)}}}return q}};
-THREE.Rectangle=function(){function a(){g=e-b;f=d-c}var b,c,e,d,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 e};this.getBottom=function(){return d};this.set=function(h,j,l,m){i=!1;b=h;c=j;e=l;d=m;a()};this.addPoint=function(h,j){if(i){i=!1;b=h;c=j;e=h;d=j}else{b=b<h?b:h;c=c<j?c:j;e=e>h?e:h;d=d>j?d:j}a()};
-this.add3Points=function(h,j,l,m,n,k){if(i){i=!1;b=h<l?h<n?h:n:l<n?l:n;c=j<m?j<k?j:k:m<k?m:k;e=h>l?h>n?h:n:l>n?l:n;d=j>m?j>k?j:k:m>k?m:k}else{b=h<l?h<n?h<b?h:b:n<b?n:b:l<n?l<b?l:b:n<b?n:b;c=j<m?j<k?j<c?j:c:k<c?k:c:m<k?m<c?m:c:k<c?k:c;e=h>l?h>n?h>e?h:e:n>e?n:e:l>n?l>e?l:e:n>e?n:e;d=j>m?j>k?j>d?j:d:k>d?k:d:m>k?m>d?m:d:k>d?k:d}a()};this.addRectangle=function(h){if(i){i=!1;b=h.getLeft();c=h.getTop();e=h.getRight();d=h.getBottom()}else{b=b<h.getLeft()?b:h.getLeft();c=c<h.getTop()?c:h.getTop();e=e>h.getRight()?
-e:h.getRight();d=d>h.getBottom()?d:h.getBottom()}a()};this.inflate=function(h){b-=h;c-=h;e+=h;d+=h;a()};this.minSelf=function(h){b=b>h.getLeft()?b:h.getLeft();c=c>h.getTop()?c:h.getTop();e=e<h.getRight()?e:h.getRight();d=d<h.getBottom()?d:h.getBottom();a()};this.instersects=function(h){return Math.min(e,h.getRight())-Math.max(b,h.getLeft())>=0&&Math.min(d,h.getBottom())-Math.max(c,h.getTop())>=0};this.empty=function(){i=!0;d=e=c=b=0;a()};this.isEmpty=function(){return i}};
+THREE.Ray.prototype={intersectScene:function(a){var b,c,d=a.objects,e=[];a=0;for(b=d.length;a<b;a++){c=d[a];c instanceof THREE.Mesh&&(e=e.concat(this.intersectObject(c)))}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.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,e,d,g,f,i,h,j,l,m,n,k,p,q){this.set(a||1,b||0,c||0,e||0,d||0,g||1,f||0,i||0,h||0,j||0,l||1,m||0,n||0,k||0,p||0,q||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={set:function(a,b,c,e,d,g,f,i,h,j,l,m,n,k,p,q){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=d;this.n22=g;this.n23=f;this.n24=i;this.n31=h;this.n32=j;this.n33=l;this.n34=m;this.n41=n;this.n42=k;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 e=THREE.Matrix4.__v1,
-d=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;e.cross(c,g).normalize();if(e.length()===0){g.x+=1.0E-4;e.cross(c,g).normalize()}d.cross(g,e).normalize();this.n11=e.x;this.n12=d.x;this.n13=g.x;this.n21=e.y;this.n22=d.y;this.n23=g.y;this.n31=e.z;this.n32=d.z;this.n33=g.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,e=a.z,d=1/(this.n41*b+this.n42*c+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*e+this.n14)*d;a.y=(this.n21*b+this.n22*c+this.n23*
-e+this.n24)*d;a.z=(this.n31*b+this.n32*c+this.n33*e+this.n34)*d;return a},multiplyVector4:function(a){var b=a.x,c=a.y,e=a.z,d=a.w;a.x=this.n11*b+this.n12*c+this.n13*e+this.n14*d;a.y=this.n21*b+this.n22*c+this.n23*e+this.n24*d;a.z=this.n31*b+this.n32*c+this.n33*e+this.n34*d;a.w=this.n41*b+this.n42*c+this.n43*e+this.n44*d;return a},rotateAxis:function(a){var b=a.x,c=a.y,e=a.z;a.x=b*this.n11+c*this.n12+e*this.n13;a.y=b*this.n21+c*this.n22+e*this.n23;a.z=b*this.n31+c*this.n32+e*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,e=a.n12,d=a.n13,g=a.n14,f=a.n21,i=a.n22,h=a.n23,j=a.n24,l=a.n31,m=a.n32,n=a.n33,k=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+e*o+d*O;this.n12=c*G+e*Q+d*u;this.n13=c*K+e*H+d*s;this.n14=c*x+e*N+d*I+g;this.n21=f*C+i*o+h*O;this.n22=f*G+i*Q+h*u;this.n23=f*K+i*H+h*s;this.n24=f*x+i*N+h*I+j;this.n31=l*C+m*o+n*O;this.n32=l*G+m*Q+n*u;this.n33=l*K+m*H+n*s;this.n34=l*x+m*N+n*I+k;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]=
+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*
+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]=
 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.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,e=this.n14,d=this.n21,g=this.n22,f=this.n23,i=this.n24,h=this.n31,j=this.n32,l=this.n33,m=this.n34,n=this.n41,k=this.n42,p=this.n43,q=this.n44;return e*f*j*n-c*i*j*n-e*g*l*n+b*i*l*n+c*g*m*n-b*f*m*n-e*f*h*k+c*i*h*k+e*d*l*k-a*i*l*k-c*d*m*k+a*f*m*k+e*g*h*p-b*i*h*p-e*d*j*p+a*i*j*p+b*d*m*p-a*g*m*p-c*g*h*q+b*f*h*q+c*d*j*q-a*f*j*q-b*d*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.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.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.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.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,
 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),e=Math.sin(b),d=1-c,g=a.x,f=a.y,i=a.z,h=d*g,j=d*f;this.set(h*
-g+c,h*f-e*i,h*i+e*f,0,h*f+e*i,j*f+c,j*i-e*g,0,h*i-e*f,j*i+e*g,d*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},setRotationFromEuler:function(a){var b=a.x,c=a.y,e=a.z;a=Math.cos(b);b=Math.sin(b);var d=Math.cos(c);c=Math.sin(c);var g=Math.cos(e);e=Math.sin(e);var f=a*c,i=b*c;this.n11=d*g;this.n12=-d*e;this.n13=c;this.n21=i*g+a*e;this.n22=-i*e+a*g;this.n23=-b*d;this.n31=-f*g+b*e;this.n32=f*e+b*g;this.n33=a*d;return this},setRotationFromQuaternion:function(a){var b=
-a.x,c=a.y,e=a.z,d=a.w,g=b+b,f=c+c,i=e+e;a=b*g;var h=b*f;b*=i;var j=c*f;c*=i;e*=i;g*=d;f*=d;d*=i;this.n11=1-(j+e);this.n12=h-d;this.n13=b+f;this.n21=h+d;this.n22=1-(a+e);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=a.n14;this.n24=a.n24;this.n34=
-a.n34},extractRotation:function(a,b){var c=1/b.x,e=1/b.y,d=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*e;this.n22=a.n22*e;this.n32=a.n32*e;this.n13=a.n13*d;this.n23=a.n23*d;this.n33=a.n33*d}};
-THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,d=a.n13,g=a.n14,f=a.n21,i=a.n22,h=a.n23,j=a.n24,l=a.n31,m=a.n32,n=a.n33,k=a.n34,p=a.n41,q=a.n42,t=a.n43,r=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=h*k*q-j*n*q+j*m*t-i*k*t-h*m*r+i*n*r;b.n12=g*n*q-d*k*q-g*m*t+e*k*t+d*m*r-e*n*r;b.n13=d*j*q-g*h*q+g*i*t-e*j*t-d*i*r+e*h*r;b.n14=g*h*m-d*j*m-g*i*n+e*j*n+d*i*k-e*h*k;b.n21=j*n*p-h*k*p-j*l*t+f*k*t+h*l*r-f*n*r;b.n22=d*k*p-g*n*p+g*l*t-c*k*t-d*l*r+c*n*r;b.n23=g*h*p-d*j*p-g*f*t+c*j*t+d*f*r-c*h*r;
-b.n24=d*j*l-g*h*l+g*f*n-c*j*n-d*f*k+c*h*k;b.n31=i*k*p-j*m*p+j*l*q-f*k*q-i*l*r+f*m*r;b.n32=g*m*p-e*k*p-g*l*q+c*k*q+e*l*r-c*m*r;b.n33=d*j*p-g*i*p+g*f*q-c*j*q-e*f*r+c*i*r;b.n34=g*i*l-e*j*l-g*f*m+c*j*m+e*f*k-c*i*k;b.n41=h*m*p-i*n*p-h*l*q+f*n*q+i*l*t-f*m*t;b.n42=e*n*p-d*m*p+d*l*q-c*n*q-e*l*t+c*m*t;b.n43=d*i*p-e*h*p-d*f*q+c*h*q+e*f*t-c*i*t;b.n44=e*h*l-d*i*l+d*f*m-c*h*m-e*f*n+c*i*n;b.multiplyScalar(1/a.determinant());return b};
-THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,d=-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,l=-a.n23*a.n11+a.n21*a.n13,m=a.n22*a.n11-a.n21*a.n12;a=a.n11*e+a.n21*f+a.n31*j;if(a==0)throw"matrix not invertible";a=1/a;c[0]=a*e;c[1]=a*d;c[2]=a*g;c[3]=a*f;c[4]=a*i;c[5]=a*h;c[6]=a*j;c[7]=a*l;c[8]=a*m;return b};
-THREE.Matrix4.makeFrustum=function(a,b,c,e,d,g){var f;f=new THREE.Matrix4;f.n11=2*d/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*d/(e-c);f.n23=(e+c)/(e-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+d)/(g-d);f.n34=-2*g*d/(g-d);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,e){var d;a=c*Math.tan(a*Math.PI/360);d=-a;return THREE.Matrix4.makeFrustum(d*b,a*b,d,a,c,e)};
-THREE.Matrix4.makeOrtho=function(a,b,c,e,d,g){var f,i,h,j;f=new THREE.Matrix4;i=b-a;h=c-e;j=g-d;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+e)/h);f.n31=0;f.n32=0;f.n33=-2/j;f.n34=-((g+d)/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;
+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},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=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.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=
 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.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};
 !0;this._vector=new THREE.Vector3};
 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(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(a){if(this.children.indexOf(a)===-1){a.parent!==
 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(this.position,a,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 instanceof THREE.Scene===!1&&b!==undefined;)b=b.parent;b!==undefined&&b.addChildRecurse(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=undefined;this.children.splice(b,1)}},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!==
 undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b instanceof THREE.Scene===!1&&b!==undefined;)b=b.parent;b!==undefined&&b.addChildRecurse(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=undefined;this.children.splice(b,1)}},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 e=this.children.length;a<e;a++)this.children[a].update(this.matrixWorld,
-b,c)}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==undefined?e:1)};
-THREE.Quaternion.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,e=a.y*b,d=a.z*b;a=Math.cos(e);e=Math.sin(e);b=Math.cos(-d);d=Math.sin(-d);var g=Math.cos(c);c=Math.sin(c);var f=a*b,i=e*d;this.w=f*g-i*c;this.x=f*c+i*g;this.y=e*b*g+a*d*c;this.z=a*d*g-e*b*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,e=this.z,d=this.w,g=a.x,f=a.y,i=a.z;a=a.w;this.x=b*a+d*g+c*i-e*f;this.y=c*a+d*f+e*g-b*i;this.z=e*a+d*i+b*f-c*g;this.w=d*a-b*g-c*f-e*i;return this},
-multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,d=a.z,g=this.x,f=this.y,i=this.z,h=this.w,j=h*c+f*d-i*e,l=h*e+i*c-g*d,m=h*d+g*e-f*c;c=-g*c-f*e-i*d;b.x=j*h+c*-g+l*-i-m*-f;b.y=l*h+c*-f+m*-g-j*-i;b.z=m*h+c*-i+j*-f-l*-g;return b}};
-THREE.Quaternion.slerp=function(a,b,c,e){var d=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(d)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var g=Math.acos(d),f=Math.sqrt(1-d*d);if(Math.abs(f)<0.0010){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}d=Math.sin((1-e)*g)/f;e=Math.sin(e*g)/f;c.w=a.w*d+b.w*e;c.x=a.x*d+b.x*e;c.y=a.y*d+b.y*e;c.z=a.z*d+b.z*e;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
-THREE.Face3=function(a,b,c,e,d,g){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=d instanceof THREE.Color?d:new THREE.Color;this.vertexColors=d instanceof Array?d:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
-THREE.Face4=function(a,b,c,e,d,g,f){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];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.AnimationHandler=function(){var a=[],b={},c={};c.update=function(d){for(var g=0;g<a.length;g++)a[g].update(d)};c.addToUpdate=function(d){a.indexOf(d)===-1&&a.push(d)};c.removeFromUpdate=function(d){d=a.indexOf(d);d!==-1&&a.splice(d,1)};c.add=function(d){b[d.name]!==undefined&&console.log("THREE.AnimationHandler.add: Warning! "+d.name+" already exists in library. Overwriting.");b[d.name]=d;if(d.initialized!==!0){for(var g=0;g<d.hierarchy.length;g++){for(var f=0;f<d.hierarchy[g].keys.length;f++){if(d.hierarchy[g].keys[f].time<
-0)d.hierarchy[g].keys[f].time=0;if(d.hierarchy[g].keys[f].rot!==undefined&&!(d.hierarchy[g].keys[f].rot instanceof THREE.Quaternion)){var i=d.hierarchy[g].keys[f].rot;d.hierarchy[g].keys[f].rot=new THREE.Quaternion(i[0],i[1],i[2],i[3])}}if(d.hierarchy[g].keys[0].morphTargets!==undefined){i={};for(f=0;f<d.hierarchy[g].keys.length;f++)for(var h=0;h<d.hierarchy[g].keys[f].morphTargets.length;h++){var j=d.hierarchy[g].keys[f].morphTargets[h];i[j]=-1}d.hierarchy[g].usedMorphTargets=i;for(f=0;f<d.hierarchy[g].keys.length;f++){var l=
-{};for(j in i){for(h=0;h<d.hierarchy[g].keys[f].morphTargets.length;h++)if(d.hierarchy[g].keys[f].morphTargets[h]===j){l[j]=d.hierarchy[g].keys[f].morphTargetsInfluences[h];break}h===d.hierarchy[g].keys[f].morphTargets.length&&(l[j]=0)}d.hierarchy[g].keys[f].morphTargetsInfluences=l}}for(f=1;f<d.hierarchy[g].keys.length;f++)if(d.hierarchy[g].keys[f].time===d.hierarchy[g].keys[f-1].time){d.hierarchy[g].keys.splice(f,1);f--}for(f=1;f<d.hierarchy[g].keys.length;f++)d.hierarchy[g].keys[f].index=f}f=parseInt(d.length*
-d.fps,10);d.JIT={};d.JIT.hierarchy=[];for(g=0;g<d.hierarchy.length;g++)d.JIT.hierarchy.push(Array(f));d.initialized=!0}};c.get=function(d){if(typeof d==="string")if(b[d])return b[d];else{console.log("THREE.AnimationHandler.get: Couldn't find animation "+d);return null}};c.parse=function(d){var g=[];if(d instanceof THREE.SkinnedMesh)for(var f=0;f<d.bones.length;f++)g.push(d.bones[f]);else e(d,g);return g};var e=function(d,g){g.push(d);for(var f=0;f<d.children.length;f++)e(d.children[f],g)};c.LINEAR=
-0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(a,b,c,e){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.isPaused=!0;this.loop=!0;this.interpolationType=c!==undefined?c:THREE.AnimationHandler.LINEAR;this.JITCompile=e!==undefined?e:!0;this.points=[];this.target=new THREE.Vector3};
-THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=a!==undefined?a:!0;this.currentTime=b!==undefined?b:0;var c,e=this.hierarchy.length,d;for(c=0;c<e;c++){d=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)d.useQuaternion=!0;d.matrixAutoUpdate=!0;if(d.animationCache===undefined){d.animationCache={};d.animationCache.prevKey={pos:0,rot:0,scl:0};d.animationCache.nextKey={pos:0,rot:0,scl:0};d.animationCache.originalMatrix=
-d instanceof THREE.Bone?d.skinMatrix:d.matrix}var g=d.animationCache.prevKey;d=d.animationCache.nextKey;g.pos=this.data.hierarchy[c].keys[0];g.rot=this.data.hierarchy[c].keys[0];g.scl=this.data.hierarchy[c].keys[0];d.pos=this.getNextKeyWith("pos",c,1);d.rot=this.getNextKeyWith("rot",c,1);d.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 b=["pos","rot","scl"],c,e,d,g,f,i,h,j,l=this.data.JIT.hierarchy,m,n;this.currentTime+=a*this.timeScale;n=this.currentTime;m=this.currentTime%=this.data.length;j=parseInt(Math.min(m*this.data.fps,this.data.length*this.data.fps),10);for(var k=0,p=this.hierarchy.length;k<p;k++){a=this.hierarchy[k];h=a.animationCache;if(this.JITCompile&&l[k][j]!==undefined)if(a instanceof THREE.Bone){a.skinMatrix=l[k][j];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=
-!1}else{a.matrix=l[k][j];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 q=0;q<3;q++){c=b[q];f=h.prevKey[c];i=h.nextKey[c];if(i.time<=n){if(m<n)if(this.loop){f=this.data.hierarchy[k].keys[0];for(i=this.getNextKeyWith(c,k,1);i.time<m;){f=i;i=this.getNextKeyWith(c,k,i.index+1)}}else{this.stop();return}else{do{f=i;i=this.getNextKeyWith(c,k,i.index+1)}while(i.time<
-m)}h.prevKey[c]=f;h.nextKey[c]=i}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;e=(m-f.time)/(i.time-f.time);d=f[c];g=i[c];if(e<0||e>1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+k);e=e<0?0:1}if(c==="pos"){c=a.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){c.x=d[0]+(g[0]-d[0])*e;c.y=d[1]+(g[1]-d[1])*e;c.z=d[2]+(g[2]-d[2])*e}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=
-this.getPrevKeyWith("pos",k,f.index-1).pos;this.points[1]=d;this.points[2]=g;this.points[3]=this.getNextKeyWith("pos",k,i.index+1).pos;e=e*0.33+0.33;d=this.interpolateCatmullRom(this.points,e);c.x=d[0];c.y=d[1];c.z=d[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(c);this.target.y=0;this.target.normalize();e=Math.atan2(this.target.x,this.target.z);a.rotation.set(0,e,0)}}}else if(c===
-"rot")THREE.Quaternion.slerp(d,g,a.quaternion,e);else if(c==="scl"){c=a.scale;c.x=d[0]+(g[0]-d[0])*e;c.y=d[1]+(g[1]-d[1])*e;c.z=d[2]+(g[2]-d[2])*e}}}}if(this.JITCompile&&l[0][j]===undefined){this.hierarchy[0].update(undefined,!0);for(k=0;k<this.hierarchy.length;k++)l[k][j]=this.hierarchy[k]instanceof THREE.Bone?this.hierarchy[k].skinMatrix.clone():this.hierarchy[k].matrix.clone()}}};
-THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],e=[],d,g,f,i,h,j;d=(a.length-1)*b;g=Math.floor(d);d-=g;c[0]=g==0?g:g-1;c[1]=g;c[2]=g>a.length-2?g:g+1;c[3]=g>a.length-3?g:g+2;g=a[c[0]];i=a[c[1]];h=a[c[2]];j=a[c[3]];c=d*d;f=d*c;e[0]=this.interpolate(g[0],i[0],h[0],j[0],d,c,f);e[1]=this.interpolate(g[1],i[1],h[1],j[1],d,c,f);e[2]=this.interpolate(g[2],i[2],h[2],j[2],d,c,f);return e};
-THREE.Animation.prototype.interpolate=function(a,b,c,e,d,g,f){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*f+(-3*(b-c)-2*a-e)*g+a*d+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)c=c<e.length-1?c:e.length-1;else c%=e.length;for(;c<e.length;c++)if(e[c][a]!==undefined)return e[c];return this.data.hierarchy[b].keys[0]};
-THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+e.length;c>=0;c--)if(e[c][a]!==undefined)return e[c];return this.data.hierarchy[b].keys[e.length-1]};
-THREE.Camera=function(a,b,c,e,d){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=e||2E3;this.target=d||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.updateMatrix=function(){this.update(undefined,!0)};
+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},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},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},
+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)};
+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.updateMatrix=function(){this.update(undefined,!0)};
 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&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=
 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&&(b|=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];this.matrixAutoUpdate=!1};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
 !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];this.matrixAutoUpdate=!1};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=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 e,d=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(e=0;e<d;e++){a=this.children[e];a instanceof THREE.Bone?a.update(this.skinMatrix,b,c):a.update(this.matrixWorld,!0,c)}}else for(e=0;e<d;e++)this.children[e].update(this.skinMatrix,
+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}};
 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,e){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=e!==undefined?e:!0;this.sources=a instanceof Array?a:[a];var d;c=this.sources.length;for(a=0;a<c;a++){b=this.sources[a];b.toLowerCase();if(b.indexOf(".mp3")!==-1)d=
-"audio/mpeg";else if(b.indexOf(".ogg")!==-1)d="audio/ogg";else b.indexOf(".wav")!==-1&&(d="audio/wav");if(this.domElement.canPlayType(d)){d=document.createElement("source");d.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(d);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=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.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.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.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 e=this.children.length;for(a=0;a<e;a++)this.children[a].update(this.matrixWorld,b,c)};
+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.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;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=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;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.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.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.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.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=h[i]=h[i]||new THREE.RenderableVertex;i++;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 e,d,g=[],f,i,h=[],j,l,m=[],n,k=
+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};
 [],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;d=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=g[d]=g[d]||new THREE.RenderableObject;d++;e=w;K.copy(E.position);o.multiplyVector3(K);e.object=E;e.z=K.z;s.push(e)}}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=n=l=0;s.matrixAutoUpdate&&s.updateMatrix();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;i=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=h[A.a];F=h[A.b];B=h[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=m[l]=m[l]||new THREE.RenderableFace3;l++;j=L;j.v1.copy(v);j.v2.copy(F);j.v3.copy(B)}else continue}else if(A instanceof THREE.Face4){v=h[A.a];F=h[A.b];B=h[A.c];L=h[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=k[n]=k[n]||new THREE.RenderableFace4;n++;j=T;j.v1.copy(v);j.v2.copy(F);j.v3.copy(B);j.v4.copy(L)}else continue}j.normalWorld.copy(A.normal);U.multiplyVector3(j.normalWorld);j.centroidWorld.copy(A.centroid);R.multiplyVector3(j.centroidWorld);j.centroidScreen.copy(j.centroidWorld);o.multiplyVector3(j.centroidScreen);B=A.vertexNormals;v=0;for(F=B.length;v<F;v++){L=j.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++)j.uvs[v][B]=T[B]}j.meshMaterials=W;j.faceMaterials=A.materials;j.overdraw=X;j.z=j.centroidScreen.z;J.push(j)}}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=h[i-2];N.copy(v.positionScreen);O.copy(F.positionScreen);if(c(N,O)){N.multiplyScalar(1/
+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.updateMatrix();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.position.x,y.position.y,y.position.z,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));
 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.position.x,y.position.y,y.position.z,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}};
 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,e,d,g;this.domElement=document.createElement("div");this.setSize=function(f,i){c=f;e=i;d=c/2;g=e/2};this.render=function(f,i){var h,j,l,m,n,k,p,q;a=b.projectScene(f,i);h=0;for(j=a.length;h<j;h++){n=a[h];if(n instanceof THREE.RenderableParticle){p=n.x*d+d;q=n.y*g+g;l=0;for(m=n.material.length;l<m;l++){k=n.material[l];if(k instanceof THREE.ParticleDOMMaterial){k=k.domElement;k.style.left=p+"px";k.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 e,d=c.length;for(e=0;e<d;e++){a=c[e];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.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.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};
 THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};

+ 126 - 109
build/custom/ThreeExtras.js

@@ -1,11 +1,28 @@
 // ThreeExtras.js r39 - http://github.com/mrdoob/three.js
 // ThreeExtras.js r39 - http://github.com/mrdoob/three.js
-var GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,d=a.vertices.length,e=c?b.geometry:b,f=a.vertices,h=e.vertices,g=a.faces,j=e.faces,l=a.faceVertexUvs[0];e=e.faceVertexUvs[0];c&&b.matrixAutoUpdate&&b.updateMatrix();for(var k=0,n=h.length;k<n;k++){var p=new THREE.Vertex(h[k].position.clone());c&&b.matrix.multiplyVector3(p.position);f.push(p)}k=0;for(n=j.length;k<n;k++){h=j[k];var t,w,x=h.vertexNormals;p=h.vertexColors;if(h instanceof THREE.Face3)t=new THREE.Face3(h.a+d,h.b+d,h.c+
-d);else h instanceof THREE.Face4&&(t=new THREE.Face4(h.a+d,h.b+d,h.c+d,h.d+d));t.normal.copy(h.normal);c=0;for(f=x.length;c<f;c++){w=x[c];t.vertexNormals.push(w.clone())}t.color.copy(h.color);c=0;for(f=p.length;c<f;c++){w=p[c];t.vertexColors.push(w.clone())}t.materials=h.materials.slice();t.centroid.copy(h.centroid);g.push(t)}k=0;for(n=e.length;k<n;k++){d=e[k];g=[];c=0;for(f=d.length;c<f;c++)g.push(new THREE.UV(d[c].u,d[c].v));l.push(g)}}};
-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,h,g,j,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=h;b.rotation.y=g;b.rotation.z=j;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);var 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(c){c.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.AnimationHandler=function(){var a=[],d={},b={};b.update=function(c){for(var f=0;f<a.length;f++)a[f].update(c)};b.addToUpdate=function(c){a.indexOf(c)===-1&&a.push(c)};b.removeFromUpdate=function(c){c=a.indexOf(c);c!==-1&&a.splice(c,1)};b.add=function(c){d[c.name]!==undefined&&console.log("THREE.AnimationHandler.add: Warning! "+c.name+" already exists in library. Overwriting.");d[c.name]=c;if(c.initialized!==!0){for(var f=0;f<c.hierarchy.length;f++){for(var g=0;g<c.hierarchy[f].keys.length;g++){if(c.hierarchy[f].keys[g].time<
+0)c.hierarchy[f].keys[g].time=0;if(c.hierarchy[f].keys[g].rot!==undefined&&!(c.hierarchy[f].keys[g].rot instanceof THREE.Quaternion)){var h=c.hierarchy[f].keys[g].rot;c.hierarchy[f].keys[g].rot=new THREE.Quaternion(h[0],h[1],h[2],h[3])}}if(c.hierarchy[f].keys[0].morphTargets!==undefined){h={};for(g=0;g<c.hierarchy[f].keys.length;g++)for(var j=0;j<c.hierarchy[f].keys[g].morphTargets.length;j++){var l=c.hierarchy[f].keys[g].morphTargets[j];h[l]=-1}c.hierarchy[f].usedMorphTargets=h;for(g=0;g<c.hierarchy[f].keys.length;g++){var k=
+{};for(l in h){for(j=0;j<c.hierarchy[f].keys[g].morphTargets.length;j++)if(c.hierarchy[f].keys[g].morphTargets[j]===l){k[l]=c.hierarchy[f].keys[g].morphTargetsInfluences[j];break}j===c.hierarchy[f].keys[g].morphTargets.length&&(k[l]=0)}c.hierarchy[f].keys[g].morphTargetsInfluences=k}}for(g=1;g<c.hierarchy[f].keys.length;g++)if(c.hierarchy[f].keys[g].time===c.hierarchy[f].keys[g-1].time){c.hierarchy[f].keys.splice(g,1);g--}for(g=1;g<c.hierarchy[f].keys.length;g++)c.hierarchy[f].keys[g].index=g}g=parseInt(c.length*
+c.fps,10);c.JIT={};c.JIT.hierarchy=[];for(f=0;f<c.hierarchy.length;f++)c.JIT.hierarchy.push(Array(g));c.initialized=!0}};b.get=function(c){if(typeof c==="string")if(d[c])return d[c];else{console.log("THREE.AnimationHandler.get: Couldn't find animation "+c);return null}};b.parse=function(c){var f=[];if(c instanceof THREE.SkinnedMesh)for(var g=0;g<c.bones.length;g++)f.push(c.bones[g]);else e(c,f);return f};var e=function(c,f){f.push(c);for(var g=0;g<c.children.length;g++)e(c.children[g],f)};b.LINEAR=
+0;b.CATMULLROM=1;b.CATMULLROM_FORWARD=2;return b}();THREE.Animation=function(a,d,b,e){this.root=a;this.data=THREE.AnimationHandler.get(d);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,d){if(!this.isPlaying){this.isPlaying=!0;this.loop=a!==undefined?a:!0;this.currentTime=d!==undefined?d:0;var b,e=this.hierarchy.length,c;for(b=0;b<e;b++){c=this.hierarchy[b];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)c.useQuaternion=!0;c.matrixAutoUpdate=!0;if(c.animationCache===undefined){c.animationCache={};c.animationCache.prevKey={pos:0,rot:0,scl:0};c.animationCache.nextKey={pos:0,rot:0,scl:0};c.animationCache.originalMatrix=
+c instanceof THREE.Bone?c.skinMatrix:c.matrix}var f=c.animationCache.prevKey;c=c.animationCache.nextKey;f.pos=this.data.hierarchy[b].keys[0];f.rot=this.data.hierarchy[b].keys[0];f.scl=this.data.hierarchy[b].keys[0];c.pos=this.getNextKeyWith("pos",b,1);c.rot=this.getNextKeyWith("rot",b,1);c.scl=this.getNextKeyWith("scl",b,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 d=["pos","rot","scl"],b,e,c,f,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 o=0,x=this.hierarchy.length;o<x;o++){a=this.hierarchy[o];j=a.animationCache;if(this.JITCompile&&k[o][l]!==undefined)if(a instanceof THREE.Bone){a.skinMatrix=k[o][l];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=
+!1}else{a.matrix=k[o][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 w=0;w<3;w++){b=d[w];g=j.prevKey[b];h=j.nextKey[b];if(h.time<=p){if(m<p)if(this.loop){g=this.data.hierarchy[o].keys[0];for(h=this.getNextKeyWith(b,o,1);h.time<m;){g=h;h=this.getNextKeyWith(b,o,h.index+1)}}else{this.stop();return}else{do{g=h;h=this.getNextKeyWith(b,o,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);c=g[b];f=h[b];if(e<0||e>1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+o);e=e<0?0:1}if(b==="pos"){b=a.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){b.x=c[0]+(f[0]-c[0])*e;b.y=c[1]+(f[1]-c[1])*e;b.z=c[2]+(f[2]-c[2])*e}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=
+this.getPrevKeyWith("pos",o,g.index-1).pos;this.points[1]=c;this.points[2]=f;this.points[3]=this.getNextKeyWith("pos",o,h.index+1).pos;e=e*0.33+0.33;c=this.interpolateCatmullRom(this.points,e);b.x=c[0];b.y=c[1];b.z=c[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(c,f,a.quaternion,e);else if(b==="scl"){b=a.scale;b.x=c[0]+(f[0]-c[0])*e;b.y=c[1]+(f[1]-c[1])*e;b.z=c[2]+(f[2]-c[2])*e}}}}if(this.JITCompile&&k[0][l]===undefined){this.hierarchy[0].update(undefined,!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,d){var b=[],e=[],c,f,g,h,j,l;c=(a.length-1)*d;f=Math.floor(c);c-=f;b[0]=f==0?f:f-1;b[1]=f;b[2]=f>a.length-2?f:f+1;b[3]=f>a.length-3?f:f+2;f=a[b[0]];h=a[b[1]];j=a[b[2]];l=a[b[3]];b=c*c;g=c*b;e[0]=this.interpolate(f[0],h[0],j[0],l[0],c,b,g);e[1]=this.interpolate(f[1],h[1],j[1],l[1],c,b,g);e[2]=this.interpolate(f[2],h[2],j[2],l[2],c,b,g);return e};
+THREE.Animation.prototype.interpolate=function(a,d,b,e,c,f,g){a=(b-a)*0.5;e=(e-d)*0.5;return(2*(d-b)+a+e)*g+(-3*(d-b)-2*a-e)*f+a*c+d};THREE.Animation.prototype.getNextKeyWith=function(a,d,b){var e=this.data.hierarchy[d].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[d].keys[0]};
+THREE.Animation.prototype.getPrevKeyWith=function(a,d,b){var e=this.data.hierarchy[d].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[d].keys[e.length-1]};
+var GeometryUtils={merge:function(a,d){var b=d instanceof THREE.Mesh,e=a.vertices.length,c=b?d.geometry:d,f=a.vertices,g=c.vertices,h=a.faces,j=c.faces,l=a.faceVertexUvs[0];c=c.faceVertexUvs[0];b&&d.matrixAutoUpdate&&d.updateMatrix();for(var k=0,m=g.length;k<m;k++){var p=new THREE.Vertex(g[k].position.clone());b&&d.matrix.multiplyVector3(p.position);f.push(p)}k=0;for(m=j.length;k<m;k++){g=j[k];var o,x,w=g.vertexNormals;p=g.vertexColors;if(g instanceof THREE.Face3)o=new THREE.Face3(g.a+e,g.b+e,g.c+
+e);else g instanceof THREE.Face4&&(o=new THREE.Face4(g.a+e,g.b+e,g.c+e,g.d+e));o.normal.copy(g.normal);b=0;for(f=w.length;b<f;b++){x=w[b];o.vertexNormals.push(x.clone())}o.color.copy(g.color);b=0;for(f=p.length;b<f;b++){x=p[b];o.vertexColors.push(x.clone())}o.materials=g.materials.slice();o.centroid.copy(g.centroid);h.push(o)}k=0;for(m=c.length;k<m;k++){e=c[k];h=[];b=0;for(f=e.length;b<f;b++)h.push(new THREE.UV(e[b].u,e[b].v));l.push(h)}}};
+THREE.ImageUtils={loadTexture:function(a,d,b){var e=new Image,c=new THREE.Texture(e,d);e.onload=function(){c.needsUpdate=!0;b&&b(this)};e.src=a;return c},loadTextureCube:function(a,d,b){var e,c=[],f=new THREE.Texture(c,d);d=c.loadCount=0;for(e=a.length;d<e;++d){c[d]=new Image;c[d].onload=function(){c.loadCount+=1;if(c.loadCount==6)f.needsUpdate=!0;b&&b(this)};c[d].src=a[d]}return f}};
+THREE.SceneUtils={addMesh:function(a,d,b,e,c,f,g,h,j,l){d=new THREE.Mesh(d,l);d.scale.x=d.scale.y=d.scale.z=b;d.position.x=e;d.position.y=c;d.position.z=f;d.rotation.x=g;d.rotation.y=h;d.rotation.z=j;a.addObject(d);return d},addPanoramaCubeWebGL:function(a,d,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});d=new THREE.Mesh(new THREE.Cube(d,d,d,1,1,1,null,!0),b);a.addObject(d);
+return d},addPanoramaCube:function(a,d,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])}));d=new THREE.Mesh(new THREE.Cube(d,d,d,1,1,e,!0),
+new THREE.MeshFaceMaterial);a.addObject(d);return d},addPanoramaCubePlanes:function(a,d,b){var e=d/2;d=new THREE.Plane(d,d);var c=Math.PI,f=Math.PI/2;THREE.SceneUtils.addMesh(a,d,1,0,0,-e,0,0,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[5])}));THREE.SceneUtils.addMesh(a,d,1,-e,0,0,0,f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[0])}));THREE.SceneUtils.addMesh(a,d,1,e,0,0,0,-f,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[1])}));THREE.SceneUtils.addMesh(a,d,1,0,e,0,f,
+0,c,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[2])}));THREE.SceneUtils.addMesh(a,d,1,0,-e,0,-f,0,c,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[3])}))},showHierarchy:function(a,d){THREE.SceneUtils.traverseHierarchy(a,function(b){b.visible=d})},traverseHierarchy:function(a,d){var b,e,c=a.children.length;for(e=0;e<c;e++){b=a.children[e];d(b);THREE.SceneUtils.traverseHierarchy(b,d)}}};
 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}",
 THREE.ShaderUtils={lib:{fresnel:{uniforms:{mRefractionRatio:{type:"f",value:1.02},mFresnelBias:{type:"f",value:0.1},mFresnelPower:{type:"f",value:2},mFresnelScale:{type:"f",value:1},tCube:{type:"t",value:1,texture:null}},fragmentShader:"uniform samplerCube tCube;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\nvec4 refractedColor = vec4( 1.0, 1.0, 1.0, 1.0 );\nrefractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;\nrefractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;\nrefractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;\nrefractedColor.a = 1.0;\ngl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );\n}",
 vertexShader:"uniform float mRefractionRatio;\nuniform float mFresnelBias;\nuniform float mFresnelScale;\nuniform float mFresnelPower;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = normalize ( mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal );\nvec3 I = mPosition.xyz - cameraPosition;\nvReflect = reflect( I, nWorld );\nvRefract[0] = refract( normalize( I ), nWorld, mRefractionRatio );\nvRefract[1] = refract( normalize( I ), nWorld, mRefractionRatio * 0.99 );\nvRefract[2] = refract( normalize( I ), nWorld, mRefractionRatio * 0.98 );\nvReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), nWorld ), mFresnelPower );\ngl_Position = projectionMatrix * mvPosition;\n}"},
 vertexShader:"uniform float mRefractionRatio;\nuniform float mFresnelBias;\nuniform float mFresnelScale;\nuniform float mFresnelPower;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = normalize ( mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal );\nvec3 I = mPosition.xyz - cameraPosition;\nvReflect = reflect( I, nWorld );\nvRefract[0] = refract( normalize( I ), nWorld, mRefractionRatio );\nvRefract[1] = refract( normalize( I ), nWorld, mRefractionRatio * 0.99 );\nvRefract[2] = refract( normalize( I ), nWorld, mRefractionRatio * 0.98 );\nvReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), nWorld ), mFresnelPower );\ngl_Position = projectionMatrix * mvPosition;\n}"},
 normal:{uniforms:{enableAO:{type:"i",value:0},enableDiffuse:{type:"i",value:0},tDiffuse:{type:"t",value:0,texture:null},tNormal:{type:"t",value:2,texture:null},tAO:{type:"t",value:3,texture:null},uNormalScale:{type:"f",value:1},tDisplacement:{type:"t",value:4,texture:null},uDisplacementBias:{type:"f",value:-0.5},uDisplacementScale:{type:"f",value:2.5},uPointLightPos:{type:"v3",value:new THREE.Vector3},uPointLightColor:{type:"c",value:new THREE.Color(15658734)},uDirLightPos:{type:"v3",value:new THREE.Vector3},
 normal:{uniforms:{enableAO:{type:"i",value:0},enableDiffuse:{type:"i",value:0},tDiffuse:{type:"t",value:0,texture:null},tNormal:{type:"t",value:2,texture:null},tAO:{type:"t",value:3,texture:null},uNormalScale:{type:"f",value:1},tDisplacement:{type:"t",value:4,texture:null},uDisplacementBias:{type:"f",value:-0.5},uDisplacementScale:{type:"f",value:2.5},uPointLightPos:{type:"v3",value:new THREE.Vector3},uPointLightColor:{type:"c",value:new THREE.Color(15658734)},uDirLightPos:{type:"v3",value:new THREE.Vector3},
@@ -15,98 +32,98 @@ 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}"},
 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}"},
 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}",
 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 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.QuakeCamera=function(a){function b(c,d){return function(){d.apply(c,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=3.14;this.domElement=document;if(a){if(a.movementSpeed!==undefined)this.movementSpeed=a.movementSpeed;if(a.lookSpeed!==undefined)this.lookSpeed=
+fragmentShader:"void main() {\ngl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );\n}"}},buildKernel:function(a){var d,b,e,c,f=2*Math.ceil(a*3)+1;f>25&&(f=25);c=(f-1)*0.5;b=Array(f);for(d=e=0;d<f;++d){b[d]=Math.exp(-((d-c)*(d-c))/(2*a*a));e+=b[d]}for(d=0;d<f;++d)b[d]/=e;return b}};
+THREE.QuakeCamera=function(a){function d(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;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.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(c){c.preventDefault();
-c.stopPropagation();if(this.activeLook)switch(c.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(c){c.preventDefault();c.stopPropagation();if(this.activeLook)switch(c.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(c){this.mouseX=c.clientX-this.windowHalfX;this.mouseY=c.clientY-this.windowHalfY};this.onKeyDown=function(c){switch(c.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(c){switch(c.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(){if(!this.freeze){this.autoSpeedFactor=this.heightSpeed?((this.position.y<this.heightMin?this.heightMin:this.position.y>
-this.heightMax?this.heightMax:this.position.y)-this.heightMin)*this.heightCoef:0;(this.moveForward||this.autoForward)&&this.translateZ(-(this.movementSpeed+this.autoSpeedFactor));this.moveBackward&&this.translateZ(this.movementSpeed);this.moveLeft&&this.translateX(-this.movementSpeed);this.moveRight&&this.translateX(this.movementSpeed);var c=this.lookSpeed;this.activeLook||(c=0);this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=
-(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var d=this.target.position,e=this.position;d.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);d.y=e.y+100*Math.cos(this.phi);d.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta)}this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax-this.verticalMin)/
-3.14+this.verticalMin;d=this.target.position;e=this.position;d.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);d.y=e.y+100*Math.cos(this.phi);d.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(c){c.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(l,k,n,p){var t={name:n,fps:0.6,length:p,hierarchy:[]},w,x=k.getControlPointsArray(),u=k.getLength(),B=x.length,z=0;w=B-1;k={parent:-1,keys:[]};k.keys[0]={time:0,pos:x[0],rot:[0,0,0,1],scl:[1,1,1]};k.keys[w]={time:p,pos:x[w],rot:[0,0,0,1],scl:[1,1,1]};for(w=1;w<B-1;w++){z=p*u.chunks[w]/u.total;k.keys[w]={time:z,pos:x[w]}}t.hierarchy[0]=k;THREE.AnimationHandler.add(t);return new THREE.Animation(l,n,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function c(l,k){var n,
-p,t=new THREE.Geometry;for(n=0;n<l.points.length*k;n++){p=n/(l.points.length*k);p=l.getPoint(p);t.vertices[n]=new THREE.Vertex(new THREE.Vector3(p.x,p.y,p.z))}return t}function d(l,k){var n=c(k,10),p=c(k,10),t=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(n,t);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 Sphere(1,
-16,8);t=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<k.points.length;i++){n=new THREE.Mesh(p,t);n.position.copy(k.points[i]);n.updateMatrix();l.addChild(n)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookVertical=
+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(){if(!this.freeze){this.autoSpeedFactor=this.heightSpeed?((this.position.y<this.heightMin?this.heightMin:this.position.y>
+this.heightMax?this.heightMax:this.position.y)-this.heightMin)*this.heightCoef:0;(this.moveForward||this.autoForward)&&this.translateZ(-(this.movementSpeed+this.autoSpeedFactor));this.moveBackward&&this.translateZ(this.movementSpeed);this.moveLeft&&this.translateX(-this.movementSpeed);this.moveRight&&this.translateX(this.movementSpeed);var b=this.lookSpeed;this.activeLook||(b=0);this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=
+(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var e=this.target.position,c=this.position;e.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);e.y=c.y+100*Math.cos(this.phi);e.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta)}this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax-this.verticalMin)/
+3.14+this.verticalMin;e=this.target.position;c=this.position;e.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);e.y=c.y+100*Math.cos(this.phi);e.z=c.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",d(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",d(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",d(this,
+this.onMouseUp),!1);this.domElement.addEventListener("keydown",d(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",d(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,d){this.matrix.rotateAxis(d);if(this.noFly)d.y=0;this.position.addSelf(d.multiplyScalar(a));this.target.position.addSelf(d.multiplyScalar(a))};
+THREE.PathCamera=function(a){function d(l,k,m,p){var o={name:m,fps:0.6,length:p,hierarchy:[]},x,w=k.getControlPointsArray(),u=k.getLength(),B=w.length,z=0;x=B-1;k={parent:-1,keys:[]};k.keys[0]={time:0,pos:w[0],rot:[0,0,0,1],scl:[1,1,1]};k.keys[x]={time:p,pos:w[x],rot:[0,0,0,1],scl:[1,1,1]};for(x=1;x<B-1;x++){z=p*u.chunks[x]/u.total;k.keys[x]={time:z,pos:w[x]}}o.hierarchy[0]=k;THREE.AnimationHandler.add(o);return new THREE.Animation(l,m,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function b(l,k){var m,
+p,o=new THREE.Geometry;for(m=0;m<l.points.length*k;m++){p=m/(l.points.length*k);p=l.getPoint(p);o.vertices[m]=new THREE.Vertex(new THREE.Vector3(p.x,p.y,p.z))}return o}function e(l,k){var m=b(k,10),p=b(k,10),o=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(m,o);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 Sphere(1,
+16,8);o=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<k.points.length;i++){m=new THREE.Mesh(p,o);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;
 !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=
 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 e=Math.PI*2,f=Math.PI/180;this.update=function(l,k,n){var p,t;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;p=this.phi%e;this.phi=p>=0?p:p+e;p=this.verticalAngleMap.srcRange;t=this.verticalAngleMap.dstRange;
-this.phi=(this.phi-p[0])*(t[1]-t[0])/(p[1]-p[0])+t[0];p=this.horizontalAngleMap.srcRange;t=this.horizontalAngleMap.dstRange;this.theta=(this.theta-p[0])*(t[1]-t[0])/(p[1]-p[0])+t[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,n)};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 h=new THREE.MeshLambertMaterial({color:65280}),g=new THREE.Cube(10,10,20),j=new THREE.Cube(2,2,10);this.animationParent=new THREE.Mesh(g,a);a=new THREE.Mesh(j,h);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(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.Cube=function(a,b,c,d,e,f,h,g,j){function l(u,B,z,m,y,C,G,K){var J,I,E=d||1,L=e||1,P=y/2,Q=C/2,R=k.vertices.length;if(u=="x"&&B=="y"||u=="y"&&B=="x")J="z";else if(u=="x"&&B=="z"||u=="z"&&B=="x"){J="y";L=f||1}else if(u=="z"&&B=="y"||u=="y"&&B=="z"){J="x";E=f||1}var M=E+1,F=L+1;y/=E;var N=C/L;for(I=0;I<F;I++)for(C=0;C<M;C++){var O=new THREE.Vector3;O[u]=(C*y-P)*z;O[B]=(I*N-Q)*m;O[J]=G;k.vertices.push(new THREE.Vertex(O))}for(I=0;I<L;I++)for(C=0;C<E;C++){k.faces.push(new THREE.Face4(C+M*I+R,C+
-M*(I+1)+R,C+1+M*(I+1)+R,C+1+M*I+R,null,null,K));k.faceVertexUvs[0].push([new THREE.UV(C/E,I/L),new THREE.UV(C/E,(I+1)/L),new THREE.UV((C+1)/E,(I+1)/L),new THREE.UV((C+1)/E,I/L)])}}THREE.Geometry.call(this);var k=this,n=a/2,p=b/2,t=c/2;g=g?-1:1;if(h!==undefined)if(h instanceof Array)this.materials=h;else{this.materials=[];for(var w=0;w<6;w++)this.materials.push([h])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(j!=undefined)for(var x in j)this.sides[x]!=undefined&&(this.sides[x]=
-j[x]);this.sides.px&&l("z","y",1*g,-1,c,b,-n,this.materials[0]);this.sides.nx&&l("z","y",-1*g,-1,c,b,n,this.materials[1]);this.sides.py&&l("x","z",1*g,1,a,c,p,this.materials[2]);this.sides.ny&&l("x","z",1*g,-1,a,c,-p,this.materials[3]);this.sides.pz&&l("x","y",1*g,-1,a,b,t,this.materials[4]);this.sides.nz&&l("x","y",-1*g,-1,a,b,-t,this.materials[5]);(function(){for(var u=[],B=[],z=0,m=k.vertices.length;z<m;z++){for(var y=k.vertices[z],C=!1,G=0,K=u.length;G<K;G++){var J=u[G];if(y.position.x==J.position.x&&
-y.position.y==J.position.y&&y.position.z==J.position.z){B[z]=G;C=!0;break}}if(!C){B[z]=u.length;u.push(new THREE.Vertex(y.position.clone()))}}z=0;for(m=k.faces.length;z<m;z++){y=k.faces[z];y.a=B[y.a];y.b=B[y.b];y.c=B[y.c];y.d=B[y.d]}k.vertices=u})();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 h(p,t,w){g.vertices.push(new THREE.Vertex(new THREE.Vector3(p,t,w)))}THREE.Geometry.call(this);var g=this,j,l=Math.PI*2,k=d/2;for(j=0;j<a;j++)h(Math.sin(l*j/a)*b,Math.cos(l*j/a)*b,-k);for(j=0;j<a;j++)h(Math.sin(l*j/a)*c,Math.cos(l*j/a)*c,k);for(j=0;j<a;j++)g.faces.push(new THREE.Face4(j,j+a,a+(j+1)%a,(j+1)%a));if(c>0){h(0,0,-k-(f||0));for(j=a;j<a+a/2;j++)g.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(b>0){h(0,0,k+(e||0));
-for(j=a+a/2;j<2*a;j++)g.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++){b=[];c=this.faces[j];e=this.vertices[c.a];f=this.vertices[c.b];k=this.vertices[c.c];var 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(n,p,t){var w=Math.sqrt(n*n+p*p+t*t);return e.vertices.push(new THREE.Vertex(new THREE.Vector3(n/w,p/w,t/w)))-1}function c(n,p,t,w){w.faces.push(new THREE.Face3(n,p,t))}function d(n,p){var t=e.vertices[n].position,w=e.vertices[p].position;return b((t.x+w.x)/2,(t.y+w.y)/2,(t.z+w.z)/2)}var e=this,f=new THREE.Geometry,h;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++){h=new THREE.Geometry;for(var g in f.faces){var j=d(f.faces[g].a,f.faces[g].b),l=d(f.faces[g].b,f.faces[g].c),k=d(f.faces[g].c,f.faces[g].a);c(f.faces[g].a,j,k,h);c(f.faces[g].b,l,j,h);c(f.faces[g].c,
-k,l,h);c(j,l,k,h)}f.faces=h.faces}e.faces=f.faces;delete f;delete h;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;b=this.angle/this.steps;c=[];for(var d=[],e=[],f=[],h=(new THREE.Matrix4).setRotationZ(b),g=0;g<a.length;g++){this.vertices.push(new THREE.Vertex(a[g]));c[g]=a[g].clone();d[g]=this.vertices.length-1}for(var j=0;j<=this.angle+0.0010;j+=b){for(g=0;g<c.length;g++)if(j<this.angle){c[g]=h.multiplyVector3(c[g].clone());this.vertices.push(new THREE.Vertex(c[g]));e[g]=this.vertices.length-1}else e=f;j==0&&(f=d);
-for(g=0;g<d.length-1;g++){this.faces.push(new THREE.Face4(e[g],e[g+1],d[g+1],d[g]));this.faceVertexUvs[0].push([new THREE.UV(1-j/this.angle,g/a.length),new THREE.UV(1-j/this.angle,(g+1)/a.length),new THREE.UV(1-(j-b)/this.angle,(g+1)/a.length),new THREE.UV(1-(j-b)/this.angle,g/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,h=b/2;c=c||1;d=d||1;var g=c+1,j=d+1;a/=c;var l=b/d;for(e=0;e<j;e++)for(b=0;b<g;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*a-f,-(e*l-h),0)));for(e=0;e<d;e++)for(b=0;b<c;b++){this.faces.push(new THREE.Face4(b+g*e,b+g*(e+1),b+1+g*(e+1),b+1+g*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()};
+this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var c=Math.PI*2,f=Math.PI/180;this.update=function(l,k,m){var p,o;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;p=this.phi%c;this.phi=p>=0?p:p+c;p=this.verticalAngleMap.srcRange;o=this.verticalAngleMap.dstRange;
+this.phi=(this.phi-p[0])*(o[1]-o[0])/(p[1]-p[0])+o[0];p=this.horizontalAngleMap.srcRange;o=this.horizontalAngleMap.dstRange;this.theta=(this.theta-p[0])*(o[1]-o[0])/(p[1]-p[0])+o[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=d(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else{this.animation=
+d(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.Cube=function(a,d,b,e,c,f,g,h,j){function l(u,B,z,n,y,C,G,K){var J,I,E=e||1,L=c||1,P=y/2,Q=C/2,R=k.vertices.length;if(u=="x"&&B=="y"||u=="y"&&B=="x")J="z";else if(u=="x"&&B=="z"||u=="z"&&B=="x"){J="y";L=f||1}else if(u=="z"&&B=="y"||u=="y"&&B=="z"){J="x";E=f||1}var M=E+1,F=L+1;y/=E;var N=C/L;for(I=0;I<F;I++)for(C=0;C<M;C++){var O=new THREE.Vector3;O[u]=(C*y-P)*z;O[B]=(I*N-Q)*n;O[J]=G;k.vertices.push(new THREE.Vertex(O))}for(I=0;I<L;I++)for(C=0;C<E;C++){k.faces.push(new THREE.Face4(C+M*I+R,C+
+M*(I+1)+R,C+1+M*(I+1)+R,C+1+M*I+R,null,null,K));k.faceVertexUvs[0].push([new THREE.UV(C/E,I/L),new THREE.UV(C/E,(I+1)/L),new THREE.UV((C+1)/E,(I+1)/L),new THREE.UV((C+1)/E,I/L)])}}THREE.Geometry.call(this);var k=this,m=a/2,p=d/2,o=b/2;h=h?-1:1;if(g!==undefined)if(g instanceof Array)this.materials=g;else{this.materials=[];for(var x=0;x<6;x++)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 w in j)this.sides[w]!=undefined&&(this.sides[w]=
+j[w]);this.sides.px&&l("z","y",1*h,-1,b,d,-m,this.materials[0]);this.sides.nx&&l("z","y",-1*h,-1,b,d,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,d,o,this.materials[4]);this.sides.nz&&l("x","y",-1*h,-1,a,d,-o,this.materials[5]);(function(){for(var u=[],B=[],z=0,n=k.vertices.length;z<n;z++){for(var y=k.vertices[z],C=!1,G=0,K=u.length;G<K;G++){var J=u[G];if(y.position.x==J.position.x&&
+y.position.y==J.position.y&&y.position.z==J.position.z){B[z]=G;C=!0;break}}if(!C){B[z]=u.length;u.push(new THREE.Vertex(y.position.clone()))}}z=0;for(n=k.faces.length;z<n;z++){y=k.faces[z];y.a=B[y.a];y.b=B[y.b];y.c=B[y.c];y.d=B[y.d]}k.vertices=u})();this.computeCentroids();this.computeFaceNormals()};THREE.Cube.prototype=new THREE.Geometry;THREE.Cube.prototype.constructor=THREE.Cube;
+THREE.Cylinder=function(a,d,b,e,c,f){function g(p,o,x){h.vertices.push(new THREE.Vertex(new THREE.Vector3(p,o,x)))}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)*d,Math.cos(l*j/a)*d,-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-(f||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(d>0){g(0,0,k+(c||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++){d=[];b=this.faces[j];c=this.vertices[b.a];f=this.vertices[b.b];k=this.vertices[b.c];var m=this.vertices[b.d];d.push(new THREE.UV(0.5+Math.atan2(c.position.x,c.position.y)/l,0.5+c.position.z/e));d.push(new THREE.UV(0.5+Math.atan2(f.position.x,f.position.y)/l,0.5+f.position.z/e));d.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&&d.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(d)}this.computeCentroids();this.computeFaceNormals()};THREE.Cylinder.prototype=new THREE.Geometry;THREE.Cylinder.prototype.constructor=THREE.Cylinder;
+THREE.Icosahedron=function(a){function d(m,p,o){var x=Math.sqrt(m*m+p*p+o*o);return c.vertices.push(new THREE.Vertex(new THREE.Vector3(m/x,p/x,o/x)))-1}function b(m,p,o,x){x.faces.push(new THREE.Face3(m,p,o))}function e(m,p){var o=c.vertices[m].position,x=c.vertices[p].position;return d((o.x+x.x)/2,(o.y+x.y)/2,(o.z+x.z)/2)}var c=this,f=new THREE.Geometry,g;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;d(-1,a,0);d(1,a,0);d(-1,-a,0);d(1,-a,0);d(0,-1,a);d(0,1,a);d(0,-1,-a);d(0,
+1,-a);d(a,0,-1);d(a,0,1);d(-a,0,-1);d(-a,0,1);b(0,11,5,f);b(0,5,1,f);b(0,1,7,f);b(0,7,10,f);b(0,10,11,f);b(1,5,9,f);b(5,11,4,f);b(11,10,2,f);b(10,7,6,f);b(7,1,8,f);b(3,9,4,f);b(3,4,2,f);b(3,2,6,f);b(3,6,8,f);b(3,8,9,f);b(4,9,5,f);b(2,4,11,f);b(6,2,10,f);b(8,6,7,f);b(9,8,1,f);for(a=0;a<this.subdivisions;a++){g=new THREE.Geometry;for(var h in f.faces){var j=e(f.faces[h].a,f.faces[h].b),l=e(f.faces[h].b,f.faces[h].c),k=e(f.faces[h].c,f.faces[h].a);b(f.faces[h].a,j,k,g);b(f.faces[h].b,l,j,g);b(f.faces[h].c,
+k,l,g);b(j,l,k,g)}f.faces=g.faces}c.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,d,b){THREE.Geometry.call(this);this.steps=d||12;this.angle=b||2*Math.PI;d=this.angle/this.steps;b=[];for(var e=[],c=[],f=[],g=(new THREE.Matrix4).setRotationZ(d),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+=d){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]));c[h]=this.vertices.length-1}else c=f;j==0&&(f=e);
+for(h=0;h<e.length-1;h++){this.faces.push(new THREE.Face4(c[h],c[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-d)/this.angle,(h+1)/a.length),new THREE.UV(1-(j-d)/this.angle,h/a.length)])}e=c;c=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.Lathe.prototype=new THREE.Geometry;THREE.Lathe.prototype.constructor=THREE.Lathe;
+THREE.Plane=function(a,d,b,e){THREE.Geometry.call(this);var c,f=a/2,g=d/2;b=b||1;e=e||1;var h=b+1,j=e+1;a/=b;var l=d/e;for(c=0;c<j;c++)for(d=0;d<h;d++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(d*a-f,-(c*l-g),0)));for(c=0;c<e;c++)for(d=0;d<b;d++){this.faces.push(new THREE.Face4(d+h*c,d+h*(c+1),d+1+h*(c+1),d+1+h*c));this.faceVertexUvs[0].push([new THREE.UV(d/b,c/e),new THREE.UV(d/b,(c+1)/e),new THREE.UV((d+1)/b,(c+1)/e),new THREE.UV((d+1)/b,c/e)])}this.computeCentroids();this.computeFaceNormals()};
 THREE.Plane.prototype=new THREE.Geometry;THREE.Plane.prototype.constructor=THREE.Plane;
 THREE.Plane.prototype=new THREE.Geometry;THREE.Plane.prototype.constructor=THREE.Plane;
-THREE.Sphere=function(a,b,c){THREE.Geometry.call(this);var d,e=Math.PI,f=Math.max(3,b||8),h=Math.max(2,c||6);b=[];for(c=0;c<h+1;c++){d=c/h;var g=a*Math.cos(d*e),j=a*Math.sin(d*e),l=[],k=0;for(d=0;d<f;d++){var n=2*d/f,p=j*Math.sin(n*e);n=j*Math.cos(n*e);(c==0||c==h)&&d>0||(k=this.vertices.push(new THREE.Vertex(new THREE.Vector3(n,g,p)))-1);l.push(k)}b.push(l)}var t,w,x;e=b.length;for(c=0;c<e;c++){f=b[c].length;if(c>0)for(d=0;d<f;d++){l=d==f-1;h=b[c][l?0:d+1];g=b[c][l?f-1:d];j=b[c-1][l?f-1:d];l=b[c-
-1][l?0:d+1];p=c/(e-1);t=(c-1)/(e-1);w=(d+1)/f;n=d/f;k=new THREE.UV(1-w,p);p=new THREE.UV(1-n,p);n=new THREE.UV(1-n,t);var u=new THREE.UV(1-w,t);if(c<b.length-1){t=this.vertices[h].position.clone();w=this.vertices[g].position.clone();x=this.vertices[j].position.clone();t.normalize();w.normalize();x.normalize();this.faces.push(new THREE.Face3(h,g,j,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(w.x,w.y,w.z),new THREE.Vector3(x.x,x.y,x.z)]));this.faceVertexUvs[0].push([k,p,n])}if(c>1){t=this.vertices[h].position.clone();
-w=this.vertices[j].position.clone();x=this.vertices[l].position.clone();t.normalize();w.normalize();x.normalize();this.faces.push(new THREE.Face3(h,j,l,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(w.x,w.y,w.z),new THREE.Vector3(x.x,x.y,x.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){d=c/this.segmentsT*2*Math.PI;var 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){d=(this.segmentsT+1)*b+c;e=(this.segmentsT+1)*b+c-1;var f=(this.segmentsT+1)*(b-1)+c-1,h=(this.segmentsT+1)*(b-1)+c;this.faces.push(new THREE.Face4(d,e,f,h));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[h][0],a[h][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,h){function g(n,p,t,w,x,u){p=t/w*n;t=Math.cos(p);return new THREE.Vector3(x*(2+t)*0.5*Math.cos(n),x*(2+t)*Math.sin(n)*0.5,u*x*Math.sin(p)*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=h||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 j=
-a/this.segmentsR*2*this.p*Math.PI;h=b/this.segmentsT*2*Math.PI;e=g(j,h,this.q,this.p,this.radius,this.heightScale);j=g(j+0.01,h,this.q,this.p,this.radius,this.heightScale);c.x=j.x-e.x;c.y=j.y-e.y;c.z=j.z-e.z;d.x=j.x+e.x;d.y=j.y+e.y;d.z=j.z+e.z;f.cross(c,d);d.cross(f,c);f.normalize();d.normalize();j=-this.tube*Math.cos(h);h=this.tube*Math.sin(h);e.x+=j*d.x+h*f.x;e.y+=j*d.y+h*f.y;e.z+=j*d.z+h*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){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];h=new THREE.UV(a/this.segmentsR,b/this.segmentsT);j=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT);var 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([h,j,l,k])}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};
+THREE.Sphere=function(a,d,b){THREE.Geometry.call(this);var e,c=Math.PI,f=Math.max(3,d||8),g=Math.max(2,b||6);d=[];for(b=0;b<g+1;b++){e=b/g;var h=a*Math.cos(e*c),j=a*Math.sin(e*c),l=[],k=0;for(e=0;e<f;e++){var m=2*e/f,p=j*Math.sin(m*c);m=j*Math.cos(m*c);(b==0||b==g)&&e>0||(k=this.vertices.push(new THREE.Vertex(new THREE.Vector3(m,h,p)))-1);l.push(k)}d.push(l)}var o,x,w;c=d.length;for(b=0;b<c;b++){f=d[b].length;if(b>0)for(e=0;e<f;e++){l=e==f-1;g=d[b][l?0:e+1];h=d[b][l?f-1:e];j=d[b-1][l?f-1:e];l=d[b-
+1][l?0:e+1];p=b/(c-1);o=(b-1)/(c-1);x=(e+1)/f;m=e/f;k=new THREE.UV(1-x,p);p=new THREE.UV(1-m,p);m=new THREE.UV(1-m,o);var u=new THREE.UV(1-x,o);if(b<d.length-1){o=this.vertices[g].position.clone();x=this.vertices[h].position.clone();w=this.vertices[j].position.clone();o.normalize();x.normalize();w.normalize();this.faces.push(new THREE.Face3(g,h,j,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(x.x,x.y,x.z),new THREE.Vector3(w.x,w.y,w.z)]));this.faceVertexUvs[0].push([k,p,m])}if(b>1){o=this.vertices[g].position.clone();
+x=this.vertices[j].position.clone();w=this.vertices[l].position.clone();o.normalize();x.normalize();w.normalize();this.faces.push(new THREE.Face3(g,j,l,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(x.x,x.y,x.z),new THREE.Vector3(w.x,w.y,w.z)]));this.faceVertexUvs[0].push([k,m,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,d,b,e){THREE.Geometry.call(this);this.radius=a||100;this.tube=d||40;this.segmentsR=b||8;this.segmentsT=e||6;a=[];for(d=0;d<=this.segmentsR;++d)for(b=0;b<=this.segmentsT;++b){e=b/this.segmentsT*2*Math.PI;var c=d/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(c))*Math.cos(e),(this.radius+this.tube*Math.cos(c))*Math.sin(e),this.tube*Math.sin(c))));a.push([b/this.segmentsT,1-d/this.segmentsR])}for(d=1;d<=this.segmentsR;++d)for(b=
+1;b<=this.segmentsT;++b){e=(this.segmentsT+1)*d+b;c=(this.segmentsT+1)*d+b-1;var f=(this.segmentsT+1)*(d-1)+b-1,g=(this.segmentsT+1)*(d-1)+b;this.faces.push(new THREE.Face4(e,c,f,g));this.faceVertexUvs[0].push([new THREE.UV(a[e][0],a[e][1]),new THREE.UV(a[c][0],a[c][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,d,b,e,c,f,g){function h(m,p,o,x,w,u){p=o/x*m;o=Math.cos(p);return new THREE.Vector3(w*(2+o)*0.5*Math.cos(m),w*(2+o)*Math.sin(m)*0.5,u*w*Math.sin(p)*0.5)}THREE.Geometry.call(this);this.radius=a||200;this.tube=d||40;this.segmentsR=b||64;this.segmentsT=e||8;this.p=c||2;this.q=f||3;this.heightScale=g||1;this.grid=Array(this.segmentsR);b=new THREE.Vector3;e=new THREE.Vector3;f=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=Array(this.segmentsT);for(d=0;d<this.segmentsT;++d){var j=
+a/this.segmentsR*2*this.p*Math.PI;g=d/this.segmentsT*2*Math.PI;c=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-c.x;b.y=j.y-c.y;b.z=j.z-c.z;e.x=j.x+c.x;e.y=j.y+c.y;e.z=j.z+c.z;f.cross(b,e);e.cross(f,b);f.normalize();e.normalize();j=-this.tube*Math.cos(g);g=this.tube*Math.sin(g);c.x+=j*e.x+g*f.x;c.y+=j*e.y+g*f.y;c.z+=j*e.z+g*f.z;this.grid[a][d]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(c.x,c.y,c.z)))-1}}for(a=0;a<this.segmentsR;++a)for(d=
+0;d<this.segmentsT;++d){e=(a+1)%this.segmentsR;f=(d+1)%this.segmentsT;c=this.grid[a][d];b=this.grid[e][d];e=this.grid[e][f];f=this.grid[a][f];g=new THREE.UV(a/this.segmentsR,d/this.segmentsT);j=new THREE.UV((a+1)/this.segmentsR,d/this.segmentsT);var l=new THREE.UV((a+1)/this.segmentsR,(d+1)/this.segmentsT),k=new THREE.UV(a/this.segmentsR,(d+1)/this.segmentsT);this.faces.push(new THREE.Face4(c,b,e,f));this.faceVertexUvs[0].push([g,j,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.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 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(g){g=Math.log(g)/Math.LN2;return Math.floor(g)==g}function d(g,j){var l=new Image;l.onload=function(){if(!c(this.width)||!c(this.height)){var k=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),n=Math.pow(2,Math.round(Math.log(this.height)/
-Math.LN2));g.image.width=k;g.image.height=n;g.image.getContext("2d").drawImage(this,0,0,k,n)}else g.image=this;g.needsUpdate=!0};l.src=j}var e,f,h;e="MeshLambertMaterial";f={color:15658734,opacity:1,map:null,lightMap:null,wireframe:a.wireframe};if(a.shading)if(a.shading=="Phong")e="MeshPhongMaterial";else 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!==undefined)f.transparent=a.transparent;if(a.depthTest!==undefined)f.depthTest=a.depthTest;if(a.vertexColors!==undefined)if(a.vertexColors=="face")f.vertexColors=THREE.FaceColors;else if(a.vertexColors)f.vertexColors=THREE.VertexColors;if(a.mapDiffuse&&b){h=document.createElement("canvas");f.map=new THREE.Texture(h);f.map.sourceFile=a.mapDiffuse;d(f.map,b+"/"+a.mapDiffuse)}else if(a.colorDiffuse){h=(a.colorDiffuse[0]*255<<16)+(a.colorDiffuse[1]*
-255<<8)+a.colorDiffuse[2]*255;f.color=h;f.opacity=a.transparency}else if(a.DbgColor)f.color=a.DbgColor;if(a.mapLightmap&&b){h=document.createElement("canvas");f.lightMap=new THREE.Texture(h);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(f){b.createModel(f.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;this.init_materials(d,a.materials,c);(function(){if(a.version===undefined||a.version!=2)console.error("Deprecated file format.");else{var e,f,h,g,j,l,k,n,p,t,w,x,u,B,z,m=a.faces;t=a.vertices;var y=a.normals,C=a.colors;l=a.scale!==undefined?a.scale:1;var G=0;for(e=0;e<a.uvs.length;e++)a.uvs[e].length&&G++;for(e=0;e<G;e++){d.faceUvs[e]=[];d.faceVertexUvs[e]=[]}g=0;for(j=t.length;g<j;){k=new THREE.Vertex;k.position.x=t[g++]/
-l;k.position.y=t[g++]/l;k.position.z=t[g++]/l;d.vertices.push(k)}g=0;for(j=m.length;g<j;){t=m[g++];l=t&1;h=t&2;e=t&4;f=t&8;n=t&16;k=t&32;w=t&64;t&=128;if(l){x=new THREE.Face4;x.a=m[g++];x.b=m[g++];x.c=m[g++];x.d=m[g++];l=4}else{x=new THREE.Face3;x.a=m[g++];x.b=m[g++];x.c=m[g++];l=3}if(h){h=m[g++];x.materials=d.materials[h]}h=d.faces.length;if(e)for(e=0;e<G;e++){u=a.uvs[e];p=m[g++];z=u[p*2];p=u[p*2+1];d.faceUvs[e][h]=new THREE.UV(z,p)}if(f)for(e=0;e<G;e++){u=a.uvs[e];B=[];for(f=0;f<l;f++){p=m[g++];
-z=u[p*2];p=u[p*2+1];B[f]=new THREE.UV(z,p)}d.faceVertexUvs[e][h]=B}if(n){n=m[g++]*3;f=new THREE.Vector3;f.x=y[n++];f.y=y[n++];f.z=y[n];x.normal=f}if(k)for(e=0;e<l;e++){n=m[g++]*3;f=new THREE.Vector3;f.x=y[n++];f.y=y[n++];f.z=y[n];x.vertexNormals.push(f)}if(w){k=m[g++];k=new THREE.Color(C[k]);x.color=k}if(t)for(e=0;e<l;e++){k=m[g++];k=new THREE.Color(C[k]);x.vertexColors.push(k)}d.faces.push(x)}}})();(function(){var e,f,h,g;if(a.skinWeights){e=0;for(f=a.skinWeights.length;e<f;e+=2){h=a.skinWeights[e];
-g=a.skinWeights[e+1];d.skinWeights.push(new THREE.Vector4(h,g,0,0))}}if(a.skinIndices){e=0;for(f=a.skinIndices.length;e<f;e+=2){h=a.skinIndices[e];g=a.skinIndices[e+1];d.skinIndices.push(new THREE.Vector4(h,g,0,0))}}d.bones=a.bones;d.animation=a.animation})();(function(){if(a.morphTargets!==undefined){var e,f,h,g,j,l;e=0;for(f=a.morphTargets.length;e<f;e++){d.morphTargets[e]={};d.morphTargets[e].name=a.morphTargets[e].name;d.morphTargets[e].vertices=[];j=d.morphTargets[e].vertices;l=a.morphTargets[e].vertices;
-h=0;for(g=l.length;h<g;h+=3)j.push(new THREE.Vertex(new THREE.Vector3(l[h],l[h+1],l[h+2])))}}if(a.morphColors!==undefined){var k,n;e=0;for(f=a.morphColors.length;e<f;e++){d.morphColors[e]={};d.morphColors[e].name=a.morphColors[e].name;d.morphColors[e].colors=[];l=d.morphColors[e].colors;k=a.morphColors[e].colors;g=0;for(j=k.length;g<j;g+=3){n=new THREE.Color(16755200);n.setRGB(k[h],k[h+1],k[h+2]);l.push(n)}}}})();(function(){if(a.edges!==undefined){var e,f,h;for(e=0;e<a.edges.length;e+=2){f=a.edges[e];
-h=a.edges[e+1];d.edges.push(new THREE.Edge(d.vertices[f],d.vertices[h],f,h))}}})();d.computeCentroids();d.computeFaceNormals();d.computeEdgeFaces();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);var f=this.showProgress?THREE.Loader.prototype.updateProgress:null;b.onmessage=function(h){THREE.BinaryLoader.prototype.loadAjaxBuffers(h.data.buffers,h.data.materials,c,e,d,f)};b.onerror=function(h){alert("worker.onerror: "+h.message+"\n"+h.data);h.preventDefault()};
-b.postMessage(a)},loadAjaxBuffers:function(a,b,c,d,e,f){var h=new XMLHttpRequest,g=d+"/"+a,j=0;h.onreadystatechange=function(){if(h.readyState==4)h.status==200||h.status==0?THREE.BinaryLoader.prototype.createBinModel(h.responseText,c,e,b):alert("Couldn't load ["+g+"] ["+h.status+"]");else if(h.readyState==3){if(f){j==0&&(j=h.getResponseHeader("Content-Length"));f({total:j,loaded:h.responseText.length})}}else h.readyState==2&&(j=h.getResponseHeader("Content-Length"))};h.open("GET",g,!0);h.overrideMimeType("text/plain; charset=x-user-defined");
-h.setRequestHeader("Content-Type","text/plain");h.send(null)},createBinModel:function(a,b,c,d){var e=function(f){function h(o,v){var A=k(o,v),D=k(o,v+1),H=k(o,v+2),S=k(o,v+3),V=(S<<1&255|H>>7)-127;A|=(H&127)<<16|D<<8;if(A==0&&V==-127)return 0;return(1-2*(S>>7))*(1+A*Math.pow(2,-23))*Math.pow(2,V)}function g(o,v){var A=k(o,v),D=k(o,v+1),H=k(o,v+2);return(k(o,v+3)<<24)+(H<<16)+(D<<8)+A}function j(o,v){var A=k(o,v);return(k(o,v+1)<<8)+A}function l(o,v){var A=k(o,v);return A>127?A-256:A}function k(o,
-v){return o.charCodeAt(v)&255}function n(o){var v,A,D;v=g(a,o);A=g(a,o+G);D=g(a,o+K);o=j(a,o+J);THREE.BinaryLoader.prototype.f3(B,v,A,D,o)}function p(o){var v,A,D,H,S,V;v=g(a,o);A=g(a,o+G);D=g(a,o+K);H=j(a,o+J);S=g(a,o+I);V=g(a,o+E);o=g(a,o+L);THREE.BinaryLoader.prototype.f3n(B,y,v,A,D,H,S,V,o)}function t(o){var v,A,D,H;v=g(a,o);A=g(a,o+P);D=g(a,o+Q);H=g(a,o+R);o=j(a,o+M);THREE.BinaryLoader.prototype.f4(B,v,A,D,H,o)}function w(o){var v,A,D,H,S,V,ca,da;v=g(a,o);A=g(a,o+P);D=g(a,o+Q);H=g(a,o+R);S=j(a,
-o+M);V=g(a,o+F);ca=g(a,o+N);da=g(a,o+O);o=g(a,o+T);THREE.BinaryLoader.prototype.f4n(B,y,v,A,D,H,S,V,ca,da,o)}function x(o){var v,A;v=g(a,o);A=g(a,o+U);o=g(a,o+X);THREE.BinaryLoader.prototype.uv3(B.faceVertexUvs[0],C[v*2],C[v*2+1],C[A*2],C[A*2+1],C[o*2],C[o*2+1])}function u(o){var v,A,D;v=g(a,o);A=g(a,o+ea);D=g(a,o+fa);o=g(a,o+ga);THREE.BinaryLoader.prototype.uv4(B.faceVertexUvs[0],C[v*2],C[v*2+1],C[A*2],C[A*2+1],C[D*2],C[D*2+1],C[o*2],C[o*2+1])}var B=this,z=0,m,y=[],C=[],G,K,J,I,E,L,P,Q,R,M,F,N,O,
-T,U,X,ea,fa,ga,Y,Z,$,aa,ba,W;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(B,d,f);m={signature:a.substr(z,8),header_bytes:k(a,z+8),vertex_coordinate_bytes:k(a,z+9),normal_coordinate_bytes:k(a,z+10),uv_coordinate_bytes:k(a,z+11),vertex_index_bytes:k(a,z+12),normal_index_bytes:k(a,z+13),uv_index_bytes:k(a,z+14),material_index_bytes:k(a,z+15),nvertices:g(a,z+16),nnormals:g(a,z+16+4),nuvs:g(a,z+16+8),ntri_flat:g(a,z+16+12),ntri_smooth:g(a,z+16+16),ntri_flat_uv:g(a,z+16+20),ntri_smooth_uv:g(a,
-z+16+24),nquad_flat:g(a,z+16+28),nquad_smooth:g(a,z+16+32),nquad_flat_uv:g(a,z+16+36),nquad_smooth_uv:g(a,z+16+40)};z+=m.header_bytes;G=m.vertex_index_bytes;K=m.vertex_index_bytes*2;J=m.vertex_index_bytes*3;I=m.vertex_index_bytes*3+m.material_index_bytes;E=m.vertex_index_bytes*3+m.material_index_bytes+m.normal_index_bytes;L=m.vertex_index_bytes*3+m.material_index_bytes+m.normal_index_bytes*2;P=m.vertex_index_bytes;Q=m.vertex_index_bytes*2;R=m.vertex_index_bytes*3;M=m.vertex_index_bytes*4;F=m.vertex_index_bytes*
-4+m.material_index_bytes;N=m.vertex_index_bytes*4+m.material_index_bytes+m.normal_index_bytes;O=m.vertex_index_bytes*4+m.material_index_bytes+m.normal_index_bytes*2;T=m.vertex_index_bytes*4+m.material_index_bytes+m.normal_index_bytes*3;U=m.uv_index_bytes;X=m.uv_index_bytes*2;ea=m.uv_index_bytes;fa=m.uv_index_bytes*2;ga=m.uv_index_bytes*3;f=m.vertex_index_bytes*3+m.material_index_bytes;W=m.vertex_index_bytes*4+m.material_index_bytes;Y=m.ntri_flat*f;Z=m.ntri_smooth*(f+m.normal_index_bytes*3);$=m.ntri_flat_uv*
-(f+m.uv_index_bytes*3);aa=m.ntri_smooth_uv*(f+m.normal_index_bytes*3+m.uv_index_bytes*3);ba=m.nquad_flat*W;f=m.nquad_smooth*(W+m.normal_index_bytes*4);W=m.nquad_flat_uv*(W+m.uv_index_bytes*4);z+=function(o){for(var v,A,D,H=m.vertex_coordinate_bytes*3,S=o+m.nvertices*H;o<S;o+=H){v=h(a,o);A=h(a,o+m.vertex_coordinate_bytes);D=h(a,o+m.vertex_coordinate_bytes*2);THREE.BinaryLoader.prototype.v(B,v,A,D)}return m.nvertices*H}(z);z+=function(o){for(var v,A,D,H=m.normal_coordinate_bytes*3,S=o+m.nnormals*H;o<
-S;o+=H){v=l(a,o);A=l(a,o+m.normal_coordinate_bytes);D=l(a,o+m.normal_coordinate_bytes*2);y.push(v/127,A/127,D/127)}return m.nnormals*H}(z);z+=function(o){for(var v,A,D=m.uv_coordinate_bytes*2,H=o+m.nuvs*D;o<H;o+=D){v=h(a,o);A=h(a,o+m.uv_coordinate_bytes);C.push(v,A)}return m.nuvs*D}(z);Y=z+Y;Z=Y+Z;$=Z+$;aa=$+aa;ba=aa+ba;f=ba+f;W=f+W;(function(o){var v,A=m.vertex_index_bytes*3+m.material_index_bytes,D=A+m.uv_index_bytes*3,H=o+m.ntri_flat_uv*D;for(v=o;v<H;v+=D){n(v);x(v+A)}return H-o})(Z);(function(o){var v,
-A=m.vertex_index_bytes*3+m.material_index_bytes+m.normal_index_bytes*3,D=A+m.uv_index_bytes*3,H=o+m.ntri_smooth_uv*D;for(v=o;v<H;v+=D){p(v);x(v+A)}return H-o})($);(function(o){var v,A=m.vertex_index_bytes*4+m.material_index_bytes,D=A+m.uv_index_bytes*4,H=o+m.nquad_flat_uv*D;for(v=o;v<H;v+=D){t(v);u(v+A)}return H-o})(f);(function(o){var v,A=m.vertex_index_bytes*4+m.material_index_bytes+m.normal_index_bytes*4,D=A+m.uv_index_bytes*4,H=o+m.nquad_smooth_uv*D;for(v=o;v<H;v+=D){w(v);u(v+A)}return H-o})(W);
-(function(o){var v,A=m.vertex_index_bytes*3+m.material_index_bytes,D=o+m.ntri_flat*A;for(v=o;v<D;v+=A)n(v);return D-o})(z);(function(o){var v,A=m.vertex_index_bytes*3+m.material_index_bytes+m.normal_index_bytes*3,D=o+m.ntri_smooth*A;for(v=o;v<D;v+=A)p(v);return D-o})(Y);(function(o){var v,A=m.vertex_index_bytes*4+m.material_index_bytes,D=o+m.nquad_flat*A;for(v=o;v<D;v+=A)t(v);return D-o})(aa);(function(o){var v,A=m.vertex_index_bytes*4+m.material_index_bytes+m.normal_index_bytes*4,D=o+m.nquad_smooth*
-A;for(v=o;v<D;v+=A)w(v);return D-o})(ba);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,h,g,j){f=a.materials[f];var l=b[g*3],k=b[g*3+1];g=b[g*3+2];
-var n=b[j*3],p=b[j*3+1];j=b[j*3+2];a.faces.push(new THREE.Face3(c,d,e,[new THREE.Vector3(b[h*3],b[h*3+1],b[h*3+2]),new THREE.Vector3(l,k,g),new THREE.Vector3(n,p,j)],null,f))},f4n:function(a,b,c,d,e,f,h,g,j,l,k){h=a.materials[h];var n=b[j*3],p=b[j*3+1];j=b[j*3+2];var t=b[l*3],w=b[l*3+1];l=b[l*3+2];var x=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[g*3],b[g*3+1],b[g*3+2]),new THREE.Vector3(n,p,j),new THREE.Vector3(t,w,l),new THREE.Vector3(x,u,k)],null,h))},
-uv3:function(a,b,c,d,e,f,h){var g=[];g.push(new THREE.UV(b,c));g.push(new THREE.UV(d,e));g.push(new THREE.UV(f,h));a.push(g)},uv4:function(a,b,c,d,e,f,h,g,j){var l=[];l.push(new THREE.UV(b,c));l.push(new THREE.UV(d,e));l.push(new THREE.UV(f,h));l.push(new THREE.UV(g,j));a.push(l)}};THREE.SceneLoader=function(){};
-THREE.SceneLoader.prototype={load:function(a,b,c,d){var e=new Worker(a);e.postMessage(0);var f=THREE.Loader.prototype.extractUrlbase(a);e.onmessage=function(h){function g(U,X){return X=="relativeToHTML"?U:f+"/"+U}function j(){for(t in E.objects)if(!F.objects[t]){z=E.objects[t];if(G=F.geometries[z.geometry]){I=[];for(T=0;T<z.materials.length;T++)I[T]=F.materials[z.materials[T]];m=z.position;r=z.rotation;q=z.quaternion;s=z.scale;q=0;I.length==0&&(I[0]=new THREE.MeshFaceMaterial);object=new THREE.Mesh(G,
-I);object.position.set(m[0],m[1],m[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=z.visible;F.scene.addObject(object);F.objects[t]=object;if(z.meshCollider){var U=THREE.CollisionUtils.MeshColliderWBox(object);THREE.Collisions.colliders.push(U)}}}}function l(U){return function(X){F.geometries[U]=X;j();P-=1;k()}}function k(){d({total_models:R,total_textures:M,loaded_models:R-P,loaded_textures:M-
-Q},F);P==0&&Q==0&&c(F)}var n,p,t,w,x,u,B,z,m,y,C,G,K,J,I,E,L,P,Q,R,M,F;E=h.data;h=new THREE.BinaryLoader;L=new THREE.JSONLoader;Q=P=0;F={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{}};if(E.transform){var N=E.transform.position;y=E.transform.rotation;var O=E.transform.scale;N&&F.scene.position.set(N[0],N[1],N[2]);y&&F.scene.rotation.set(y[0],y[1],y[2]);O&&F.scene.scale.set(O[0],O[1],O[2]);(N||y||O)&&F.scene.updateMatrix()}N=function(){Q-=1;k()};
-for(x in E.cameras){y=E.cameras[x];if(y.type=="perspective")K=new THREE.Camera(y.fov,y.aspect,y.near,y.far);else if(y.type=="ortho"){K=new THREE.Camera;K.projectionMatrix=THREE.Matrix4.makeOrtho(y.left,y.right,y.top,y.bottom,y.near,y.far)}m=y.position;y=y.target;K.position.set(m[0],m[1],m[2]);K.target.position.set(y[0],y[1],y[2]);F.cameras[x]=K}for(w in E.lights){x=E.lights[w];K=x.color!==undefined?x.color:16777215;y=x.intensity!==undefined?x.intensity:1;if(x.type=="directional"){m=x.direction;light=
-new THREE.DirectionalLight(K,y);light.position.set(m[0],m[1],m[2]);light.position.normalize()}else if(x.type=="point"){m=x.position;light=new THREE.PointLight(K,y);light.position.set(m[0],m[1],m[2])}F.scene.addLight(light);F.lights[w]=light}for(u in E.fogs){w=E.fogs[u];if(w.type=="linear")J=new THREE.Fog(0,w.near,w.far);else w.type=="exp2"&&(J=new THREE.FogExp2(0,w.density));y=w.color;J.color.setRGB(y[0],y[1],y[2]);F.fogs[u]=J}if(F.cameras&&E.defaults.camera)F.currentCamera=F.cameras[E.defaults.camera];
-if(F.fogs&&E.defaults.fog)F.scene.fog=F.fogs[E.defaults.fog];y=E.defaults.bgcolor;F.bgColor=new THREE.Color;F.bgColor.setRGB(y[0],y[1],y[2]);F.bgColorAlpha=E.defaults.bgalpha;for(n in E.geometries){u=E.geometries[n];if(u.type=="bin_mesh"||u.type=="ascii_mesh")P+=1}R=P;for(n in E.geometries){u=E.geometries[n];if(u.type=="cube"){G=new THREE.Cube(u.width,u.height,u.depth,u.segmentsWidth,u.segmentsHeight,u.segmentsDepth,null,u.flipped,u.sides);F.geometries[n]=G}else if(u.type=="plane"){G=new THREE.Plane(u.width,
-u.height,u.segmentsWidth,u.segmentsHeight);F.geometries[n]=G}else if(u.type=="sphere"){G=new THREE.Sphere(u.radius,u.segmentsWidth,u.segmentsHeight);F.geometries[n]=G}else if(u.type=="cylinder"){G=new THREE.Cylinder(u.numSegs,u.topRad,u.botRad,u.height,u.topOffset,u.botOffset);F.geometries[n]=G}else if(u.type=="torus"){G=new THREE.Torus(u.radius,u.tube,u.segmentsR,u.segmentsT);F.geometries[n]=G}else if(u.type=="icosahedron"){G=new THREE.Icosahedron(u.subdivisions);F.geometries[n]=G}else if(u.type==
-"bin_mesh")h.load({model:g(u.url,E.urlBaseType),callback:l(n)});else u.type=="ascii_mesh"&&L.load({model:g(u.url,E.urlBaseType),callback:l(n)})}for(B in E.textures){n=E.textures[B];Q+=n.url instanceof Array?n.url.length:1}M=Q;for(B in E.textures){n=E.textures[B];if(n.mapping!=undefined&&THREE[n.mapping]!=undefined)n.mapping=new THREE[n.mapping];if(n.url instanceof Array){u=[];for(var T=0;T<n.url.length;T++)u[T]=g(n.url[T],E.urlBaseType);u=THREE.ImageUtils.loadTextureCube(u,n.mapping,N)}else{u=THREE.ImageUtils.loadTexture(g(n.url,
-E.urlBaseType),n.mapping,N);if(THREE[n.minFilter]!=undefined)u.minFilter=THREE[n.minFilter];if(THREE[n.magFilter]!=undefined)u.magFilter=THREE[n.magFilter]}F.textures[B]=u}for(p in E.materials){B=E.materials[p];for(C in B.parameters)if(C=="envMap"||C=="map"||C=="lightMap")B.parameters[C]=F.textures[B.parameters[C]];else if(C=="shading")B.parameters[C]=B.parameters[C]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(C=="blending")B.parameters[C]=THREE[B.parameters[C]]?THREE[B.parameters[C]]:THREE.NormalBlending;
-else C=="combine"&&(B.parameters[C]=B.parameters[C]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation);B=new THREE[B.type](B.parameters);F.materials[p]=B}j();b(F)}}};
-THREE.MarchingCubes=function(a,b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b];this.init=function(c){this.isolation=80;this.size=c;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(c,d,e){return c+(d-c)*e};this.VIntX=function(c,d,e,f,h,g,j,l,k,n){h=(h-k)/(n-k);k=this.normal_cache;d[f]=g+h*this.delta;d[f+1]=j;d[f+2]=l;e[f]=this.lerp(k[c],k[c+3],h);e[f+1]=this.lerp(k[c+1],k[c+4],h);e[f+2]=this.lerp(k[c+2],k[c+5],h)};this.VIntY=function(c,d,e,f,h,g,j,l,k,n){h=(h-k)/(n-k);k=this.normal_cache;d[f]=g;d[f+1]=j+h*this.delta;d[f+
-2]=l;d=c+this.yd*3;e[f]=this.lerp(k[c],k[d],h);e[f+1]=this.lerp(k[c+1],k[d+1],h);e[f+2]=this.lerp(k[c+2],k[d+2],h)};this.VIntZ=function(c,d,e,f,h,g,j,l,k,n){h=(h-k)/(n-k);k=this.normal_cache;d[f]=g;d[f+1]=j;d[f+2]=l+h*this.delta;d=c+this.zd*3;e[f]=this.lerp(k[c],k[d],h);e[f+1]=this.lerp(k[c+1],k[d+1],h);e[f+2]=this.lerp(k[c+2],k[d+2],h)};this.compNorm=function(c){var d=c*3;if(this.normal_cache[d]==0){this.normal_cache[d]=this.field[c-1]-this.field[c+1];this.normal_cache[d+1]=this.field[c-this.yd]-
-this.field[c+this.yd];this.normal_cache[d+2]=this.field[c-this.zd]-this.field[c+this.zd]}};this.polygonize=function(c,d,e,f,h,g){var j=f+1,l=f+this.yd,k=f+this.zd,n=j+this.yd,p=j+this.zd,t=f+this.yd+this.zd,w=j+this.yd+this.zd,x=0,u=this.field[f],B=this.field[j],z=this.field[l],m=this.field[n],y=this.field[k],C=this.field[p],G=this.field[t],K=this.field[w];u<h&&(x|=1);B<h&&(x|=2);z<h&&(x|=8);m<h&&(x|=4);y<h&&(x|=16);C<h&&(x|=32);G<h&&(x|=128);K<h&&(x|=64);var J=THREE.edgeTable[x];if(J==0)return 0;
-var I=this.delta,E=c+I,L=d+I;I=e+I;if(J&1){this.compNorm(f);this.compNorm(j);this.VIntX(f*3,this.vlist,this.nlist,0,h,c,d,e,u,B)}if(J&2){this.compNorm(j);this.compNorm(n);this.VIntY(j*3,this.vlist,this.nlist,3,h,E,d,e,B,m)}if(J&4){this.compNorm(l);this.compNorm(n);this.VIntX(l*3,this.vlist,this.nlist,6,h,c,L,e,z,m)}if(J&8){this.compNorm(f);this.compNorm(l);this.VIntY(f*3,this.vlist,this.nlist,9,h,c,d,e,u,z)}if(J&16){this.compNorm(k);this.compNorm(p);this.VIntX(k*3,this.vlist,this.nlist,12,h,c,d,I,
-y,C)}if(J&32){this.compNorm(p);this.compNorm(w);this.VIntY(p*3,this.vlist,this.nlist,15,h,E,d,I,C,K)}if(J&64){this.compNorm(t);this.compNorm(w);this.VIntX(t*3,this.vlist,this.nlist,18,h,c,L,I,G,K)}if(J&128){this.compNorm(k);this.compNorm(t);this.VIntY(k*3,this.vlist,this.nlist,21,h,c,d,I,y,G)}if(J&256){this.compNorm(f);this.compNorm(k);this.VIntZ(f*3,this.vlist,this.nlist,24,h,c,d,e,u,y)}if(J&512){this.compNorm(j);this.compNorm(p);this.VIntZ(j*3,this.vlist,this.nlist,27,h,E,d,e,B,C)}if(J&1024){this.compNorm(n);
-this.compNorm(w);this.VIntZ(n*3,this.vlist,this.nlist,30,h,E,L,e,m,K)}if(J&2048){this.compNorm(l);this.compNorm(t);this.VIntZ(l*3,this.vlist,this.nlist,33,h,c,L,e,z,G)}x<<=4;for(h=f=0;THREE.triTable[x+h]!=-1;){c=x+h;d=c+1;e=c+2;this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[c],3*THREE.triTable[d],3*THREE.triTable[e],g);h+=3;f++}return f};this.posnormtriv=function(c,d,e,f,h,g){var j=this.count*3;this.positionArray[j]=c[e];this.positionArray[j+1]=c[e+1];this.positionArray[j+2]=c[e+2];this.positionArray[j+
-3]=c[f];this.positionArray[j+4]=c[f+1];this.positionArray[j+5]=c[f+2];this.positionArray[j+6]=c[h];this.positionArray[j+7]=c[h+1];this.positionArray[j+8]=c[h+2];this.normalArray[j]=d[e];this.normalArray[j+1]=d[e+1];this.normalArray[j+2]=d[e+2];this.normalArray[j+3]=d[f];this.normalArray[j+4]=d[f+1];this.normalArray[j+5]=d[f+2];this.normalArray[j+6]=d[h];this.normalArray[j+7]=d[h+1];this.normalArray[j+8]=d[h+2];this.hasPos=!0;this.hasNormal=!0;this.count+=3;this.count>=this.maxCount-3&&g(this)};this.begin=
-function(){this.count=0;this.hasPos=!1;this.hasNormal=!1};this.end=function(c){if(this.count!=0){for(var d=this.count*3;d<this.positionArray.length;d++)this.positionArray[d]=0;c(this)}};this.addBall=function(c,d,e,f,h){var g=this.size*Math.sqrt(f/h),j=e*this.size,l=d*this.size,k=c*this.size,n=Math.floor(j-g);n<1&&(n=1);j=Math.floor(j+g);j>this.size-1&&(j=this.size-1);var p=Math.floor(l-g);p<1&&(p=1);l=Math.floor(l+g);l>this.size-1&&(l=this.size-1);var t=Math.floor(k-g);t<1&&(t=1);g=Math.floor(k+g);
-g>this.size-1&&(g=this.size-1);for(var w,x,u,B,z,m;n<j;n++){k=this.size2*n;x=n/this.size-e;z=x*x;for(x=p;x<l;x++){u=k+this.size*x;w=x/this.size-d;m=w*w;for(w=t;w<g;w++){B=w/this.size-c;B=f/(1.0E-6+B*B+m+z)-h;B>0&&(this.field[u+w]+=B)}}}};this.addPlaneX=function(c,d){var e,f,h,g,j,l=this.size,k=this.yd,n=this.zd,p=this.field,t=l*Math.sqrt(c/d);t>l&&(t=l);for(e=0;e<t;e++){f=e/l;f*=f;g=c/(1.0E-4+f)-d;if(g>0)for(f=0;f<l;f++){j=e+f*k;for(h=0;h<l;h++)p[n*h+j]+=g}}};this.addPlaneY=function(c,d){var e,f,
-h,g,j,l,k=this.size,n=this.yd,p=this.zd,t=this.field,w=k*Math.sqrt(c/d);w>k&&(w=k);for(f=0;f<w;f++){e=f/k;e*=e;g=c/(1.0E-4+e)-d;if(g>0){j=f*n;for(e=0;e<k;e++){l=j+e;for(h=0;h<k;h++)t[p*h+l]+=g}}}};this.addPlaneZ=function(c,d){var e,f,h,g,j,l;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(c/d);dist>size&&(dist=size);for(h=0;h<dist;h++){e=h/size;e*=e;g=c/(1.0E-4+e)-d;if(g>0){j=zd*h;for(f=0;f<size;f++){l=j+f*yd;for(e=0;e<size;e++)field[l+e]+=g}}}};this.reset=function(){var c;
-for(c=0;c<this.size3;c++){this.normal_cache[c*3]=0;this.field[c]=0}};this.render=function(c){this.begin();var d,e,f,h,g,j,l,k,n,p=this.size-2;for(h=1;h<p;h++){n=this.size2*h;l=(h-this.halfsize)/this.halfsize;for(f=1;f<p;f++){k=n+this.size*f;j=(f-this.halfsize)/this.halfsize;for(e=1;e<p;e++){g=(e-this.halfsize)/this.halfsize;d=k+e;this.polygonize(g,j,l,d,this.isolation,c)}}}this.end(c)};this.generateGeometry=function(){var c=0,d=new THREE.Geometry,e=[];this.render(function(f){var h,g,j,l,k,n,p,t;for(h=
-0;h<f.count;h++){p=h*3;k=p+1;t=p+2;g=f.positionArray[p];j=f.positionArray[k];l=f.positionArray[t];n=new THREE.Vector3(g,j,l);g=f.normalArray[p];j=f.normalArray[k];l=f.normalArray[t];p=new THREE.Vector3(g,j,l);p.normalize();k=new THREE.Vertex(n);d.vertices.push(k);e.push(p)}nfaces=f.count/3;for(h=0;h<nfaces;h++){p=(c+h)*3;k=p+1;t=p+2;n=e[p];g=e[k];j=e[t];p=new THREE.Face3(p,k,t,[n,g,j]);d.faces.push(p)}c+=nfaces;f.count=0});return d};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;
+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 d="Loaded ";d+=a.total?(100*a.loaded/a.total).toFixed(0)+"%":(a.loaded/1E3).toFixed(2)+" KB";
+this.statusDomElement.innerHTML=d},extractUrlbase:function(a){a=a.split("/");a.pop();return a.join("/")},init_materials:function(a,d,b){a.materials=[];for(var e=0;e<d.length;++e)a.materials[e]=[THREE.Loader.prototype.createMaterial(d[e],b)]},createMaterial:function(a,d){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 c,f,g;c="MeshLambertMaterial";f={color:15658734,opacity:1,map:null,lightMap:null,wireframe:a.wireframe};if(a.shading)if(a.shading=="Phong")c="MeshPhongMaterial";else a.shading=="Basic"&&(c="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!==undefined)f.transparent=a.transparent;if(a.depthTest!==undefined)f.depthTest=a.depthTest;if(a.vertexColors!==undefined)if(a.vertexColors=="face")f.vertexColors=THREE.FaceColors;else if(a.vertexColors)f.vertexColors=THREE.VertexColors;if(a.mapDiffuse&&d){g=document.createElement("canvas");f.map=new THREE.Texture(g);f.map.sourceFile=a.mapDiffuse;e(f.map,d+"/"+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&&d){g=document.createElement("canvas");f.lightMap=new THREE.Texture(g);f.lightMap.sourceFile=a.mapLightmap;e(f.lightMap,d+"/"+a.mapLightmap)}return new THREE[c](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 d=this,b=a.model,e=a.callback,c=a.texture_path?a.texture_path:this.extractUrlbase(b);a=new Worker(b);a.onmessage=function(f){d.createModel(f.data,e,c);d.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
+THREE.JSONLoader.prototype.createModel=function(a,d,b){var e=new THREE.Geometry;this.init_materials(e,a.materials,b);(function(){if(a.version===undefined||a.version!=2)console.error("Deprecated file format.");else{var c,f,g,h,j,l,k,m,p,o,x,w,u,B,z,n=a.faces;o=a.vertices;var y=a.normals,C=a.colors;l=a.scale!==undefined?a.scale:1;var G=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&G++;for(c=0;c<G;c++){e.faceUvs[c]=[];e.faceVertexUvs[c]=[]}h=0;for(j=o.length;h<j;){k=new THREE.Vertex;k.position.x=o[h++]/
+l;k.position.y=o[h++]/l;k.position.z=o[h++]/l;e.vertices.push(k)}h=0;for(j=n.length;h<j;){o=n[h++];l=o&1;g=o&2;c=o&4;f=o&8;m=o&16;k=o&32;x=o&64;o&=128;if(l){w=new THREE.Face4;w.a=n[h++];w.b=n[h++];w.c=n[h++];w.d=n[h++];l=4}else{w=new THREE.Face3;w.a=n[h++];w.b=n[h++];w.c=n[h++];l=3}if(g){g=n[h++];w.materials=e.materials[g]}g=e.faces.length;if(c)for(c=0;c<G;c++){u=a.uvs[c];p=n[h++];z=u[p*2];p=u[p*2+1];e.faceUvs[c][g]=new THREE.UV(z,p)}if(f)for(c=0;c<G;c++){u=a.uvs[c];B=[];for(f=0;f<l;f++){p=n[h++];
+z=u[p*2];p=u[p*2+1];B[f]=new THREE.UV(z,p)}e.faceVertexUvs[c][g]=B}if(m){m=n[h++]*3;f=new THREE.Vector3;f.x=y[m++];f.y=y[m++];f.z=y[m];w.normal=f}if(k)for(c=0;c<l;c++){m=n[h++]*3;f=new THREE.Vector3;f.x=y[m++];f.y=y[m++];f.z=y[m];w.vertexNormals.push(f)}if(x){k=n[h++];k=new THREE.Color(C[k]);w.color=k}if(o)for(c=0;c<l;c++){k=n[h++];k=new THREE.Color(C[k]);w.vertexColors.push(k)}e.faces.push(w)}}})();(function(){var c,f,g,h;if(a.skinWeights){c=0;for(f=a.skinWeights.length;c<f;c+=2){g=a.skinWeights[c];
+h=a.skinWeights[c+1];e.skinWeights.push(new THREE.Vector4(g,h,0,0))}}if(a.skinIndices){c=0;for(f=a.skinIndices.length;c<f;c+=2){g=a.skinIndices[c];h=a.skinIndices[c+1];e.skinIndices.push(new THREE.Vector4(g,h,0,0))}}e.bones=a.bones;e.animation=a.animation})();(function(){if(a.morphTargets!==undefined){var c,f,g,h,j,l;c=0;for(f=a.morphTargets.length;c<f;c++){e.morphTargets[c]={};e.morphTargets[c].name=a.morphTargets[c].name;e.morphTargets[c].vertices=[];j=e.morphTargets[c].vertices;l=a.morphTargets[c].vertices;
+g=0;for(h=l.length;g<h;g+=3)j.push(new THREE.Vertex(new THREE.Vector3(l[g],l[g+1],l[g+2])))}}if(a.morphColors!==undefined){var k,m;c=0;for(f=a.morphColors.length;c<f;c++){e.morphColors[c]={};e.morphColors[c].name=a.morphColors[c].name;e.morphColors[c].colors=[];l=e.morphColors[c].colors;k=a.morphColors[c].colors;h=0;for(j=k.length;h<j;h+=3){m=new THREE.Color(16755200);m.setRGB(k[g],k[g+1],k[g+2]);l.push(m)}}}})();(function(){if(a.edges!==undefined){var c,f,g;for(c=0;c<a.edges.length;c+=2){f=a.edges[c];
+g=a.edges[c+1];e.edges.push(new THREE.Edge(e.vertices[f],e.vertices[g],f,g))}}})();e.computeCentroids();e.computeFaceNormals();e.computeEdgeFaces();d(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 d=a.model,b=a.callback,e=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(d),c=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(d);a=(new Date).getTime();d=new Worker(d);var f=this.showProgress?THREE.Loader.prototype.updateProgress:null;d.onmessage=function(g){THREE.BinaryLoader.prototype.loadAjaxBuffers(g.data.buffers,g.data.materials,b,c,e,f)};d.onerror=function(g){alert("worker.onerror: "+g.message+"\n"+g.data);g.preventDefault()};
+d.postMessage(a)},loadAjaxBuffers:function(a,d,b,e,c,f){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,c,d):alert("Couldn't load ["+h+"] ["+g.status+"]");else if(g.readyState==3){if(f){j==0&&(j=g.getResponseHeader("Content-Length"));f({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,d,b,e){var c=function(f){function g(t,v){var A=k(t,v),D=k(t,v+1),H=k(t,v+2),S=k(t,v+3),V=(S<<1&255|H>>7)-127;A|=(H&127)<<16|D<<8;if(A==0&&V==-127)return 0;return(1-2*(S>>7))*(1+A*Math.pow(2,-23))*Math.pow(2,V)}function h(t,v){var A=k(t,v),D=k(t,v+1),H=k(t,v+2);return(k(t,v+3)<<24)+(H<<16)+(D<<8)+A}function j(t,v){var A=k(t,v);return(k(t,v+1)<<8)+A}function l(t,v){var A=k(t,v);return A>127?A-256:A}function k(t,
+v){return t.charCodeAt(v)&255}function m(t){var v,A,D;v=h(a,t);A=h(a,t+G);D=h(a,t+K);t=j(a,t+J);THREE.BinaryLoader.prototype.f3(B,v,A,D,t)}function p(t){var v,A,D,H,S,V;v=h(a,t);A=h(a,t+G);D=h(a,t+K);H=j(a,t+J);S=h(a,t+I);V=h(a,t+E);t=h(a,t+L);THREE.BinaryLoader.prototype.f3n(B,y,v,A,D,H,S,V,t)}function o(t){var v,A,D,H;v=h(a,t);A=h(a,t+P);D=h(a,t+Q);H=h(a,t+R);t=j(a,t+M);THREE.BinaryLoader.prototype.f4(B,v,A,D,H,t)}function x(t){var v,A,D,H,S,V,ca,da;v=h(a,t);A=h(a,t+P);D=h(a,t+Q);H=h(a,t+R);S=j(a,
+t+M);V=h(a,t+F);ca=h(a,t+N);da=h(a,t+O);t=h(a,t+T);THREE.BinaryLoader.prototype.f4n(B,y,v,A,D,H,S,V,ca,da,t)}function w(t){var v,A;v=h(a,t);A=h(a,t+U);t=h(a,t+X);THREE.BinaryLoader.prototype.uv3(B.faceVertexUvs[0],C[v*2],C[v*2+1],C[A*2],C[A*2+1],C[t*2],C[t*2+1])}function u(t){var v,A,D;v=h(a,t);A=h(a,t+ea);D=h(a,t+fa);t=h(a,t+ga);THREE.BinaryLoader.prototype.uv4(B.faceVertexUvs[0],C[v*2],C[v*2+1],C[A*2],C[A*2+1],C[D*2],C[D*2+1],C[t*2],C[t*2+1])}var B=this,z=0,n,y=[],C=[],G,K,J,I,E,L,P,Q,R,M,F,N,O,
+T,U,X,ea,fa,ga,Y,Z,$,aa,ba,W;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(B,e,f);n={signature:a.substr(z,8),header_bytes:k(a,z+8),vertex_coordinate_bytes:k(a,z+9),normal_coordinate_bytes:k(a,z+10),uv_coordinate_bytes:k(a,z+11),vertex_index_bytes:k(a,z+12),normal_index_bytes:k(a,z+13),uv_index_bytes:k(a,z+14),material_index_bytes:k(a,z+15),nvertices:h(a,z+16),nnormals:h(a,z+16+4),nuvs:h(a,z+16+8),ntri_flat:h(a,z+16+12),ntri_smooth:h(a,z+16+16),ntri_flat_uv:h(a,z+16+20),ntri_smooth_uv:h(a,
+z+16+24),nquad_flat:h(a,z+16+28),nquad_smooth:h(a,z+16+32),nquad_flat_uv:h(a,z+16+36),nquad_smooth_uv:h(a,z+16+40)};z+=n.header_bytes;G=n.vertex_index_bytes;K=n.vertex_index_bytes*2;J=n.vertex_index_bytes*3;I=n.vertex_index_bytes*3+n.material_index_bytes;E=n.vertex_index_bytes*3+n.material_index_bytes+n.normal_index_bytes;L=n.vertex_index_bytes*3+n.material_index_bytes+n.normal_index_bytes*2;P=n.vertex_index_bytes;Q=n.vertex_index_bytes*2;R=n.vertex_index_bytes*3;M=n.vertex_index_bytes*4;F=n.vertex_index_bytes*
+4+n.material_index_bytes;N=n.vertex_index_bytes*4+n.material_index_bytes+n.normal_index_bytes;O=n.vertex_index_bytes*4+n.material_index_bytes+n.normal_index_bytes*2;T=n.vertex_index_bytes*4+n.material_index_bytes+n.normal_index_bytes*3;U=n.uv_index_bytes;X=n.uv_index_bytes*2;ea=n.uv_index_bytes;fa=n.uv_index_bytes*2;ga=n.uv_index_bytes*3;f=n.vertex_index_bytes*3+n.material_index_bytes;W=n.vertex_index_bytes*4+n.material_index_bytes;Y=n.ntri_flat*f;Z=n.ntri_smooth*(f+n.normal_index_bytes*3);$=n.ntri_flat_uv*
+(f+n.uv_index_bytes*3);aa=n.ntri_smooth_uv*(f+n.normal_index_bytes*3+n.uv_index_bytes*3);ba=n.nquad_flat*W;f=n.nquad_smooth*(W+n.normal_index_bytes*4);W=n.nquad_flat_uv*(W+n.uv_index_bytes*4);z+=function(t){for(var v,A,D,H=n.vertex_coordinate_bytes*3,S=t+n.nvertices*H;t<S;t+=H){v=g(a,t);A=g(a,t+n.vertex_coordinate_bytes);D=g(a,t+n.vertex_coordinate_bytes*2);THREE.BinaryLoader.prototype.v(B,v,A,D)}return n.nvertices*H}(z);z+=function(t){for(var v,A,D,H=n.normal_coordinate_bytes*3,S=t+n.nnormals*H;t<
+S;t+=H){v=l(a,t);A=l(a,t+n.normal_coordinate_bytes);D=l(a,t+n.normal_coordinate_bytes*2);y.push(v/127,A/127,D/127)}return n.nnormals*H}(z);z+=function(t){for(var v,A,D=n.uv_coordinate_bytes*2,H=t+n.nuvs*D;t<H;t+=D){v=g(a,t);A=g(a,t+n.uv_coordinate_bytes);C.push(v,A)}return n.nuvs*D}(z);Y=z+Y;Z=Y+Z;$=Z+$;aa=$+aa;ba=aa+ba;f=ba+f;W=f+W;(function(t){var v,A=n.vertex_index_bytes*3+n.material_index_bytes,D=A+n.uv_index_bytes*3,H=t+n.ntri_flat_uv*D;for(v=t;v<H;v+=D){m(v);w(v+A)}return H-t})(Z);(function(t){var v,
+A=n.vertex_index_bytes*3+n.material_index_bytes+n.normal_index_bytes*3,D=A+n.uv_index_bytes*3,H=t+n.ntri_smooth_uv*D;for(v=t;v<H;v+=D){p(v);w(v+A)}return H-t})($);(function(t){var v,A=n.vertex_index_bytes*4+n.material_index_bytes,D=A+n.uv_index_bytes*4,H=t+n.nquad_flat_uv*D;for(v=t;v<H;v+=D){o(v);u(v+A)}return H-t})(f);(function(t){var v,A=n.vertex_index_bytes*4+n.material_index_bytes+n.normal_index_bytes*4,D=A+n.uv_index_bytes*4,H=t+n.nquad_smooth_uv*D;for(v=t;v<H;v+=D){x(v);u(v+A)}return H-t})(W);
+(function(t){var v,A=n.vertex_index_bytes*3+n.material_index_bytes,D=t+n.ntri_flat*A;for(v=t;v<D;v+=A)m(v);return D-t})(z);(function(t){var v,A=n.vertex_index_bytes*3+n.material_index_bytes+n.normal_index_bytes*3,D=t+n.ntri_smooth*A;for(v=t;v<D;v+=A)p(v);return D-t})(Y);(function(t){var v,A=n.vertex_index_bytes*4+n.material_index_bytes,D=t+n.nquad_flat*A;for(v=t;v<D;v+=A)o(v);return D-t})(aa);(function(t){var v,A=n.vertex_index_bytes*4+n.material_index_bytes+n.normal_index_bytes*4,D=t+n.nquad_smooth*
+A;for(v=t;v<D;v+=A)x(v);return D-t})(ba);this.computeCentroids();this.computeFaceNormals()};c.prototype=new THREE.Geometry;c.prototype.constructor=c;d(new c(b))},v:function(a,d,b,e){a.vertices.push(new THREE.Vertex(new THREE.Vector3(d,b,e)))},f3:function(a,d,b,e,c){a.faces.push(new THREE.Face3(d,b,e,null,null,a.materials[c]))},f4:function(a,d,b,e,c,f){a.faces.push(new THREE.Face4(d,b,e,c,null,null,a.materials[f]))},f3n:function(a,d,b,e,c,f,g,h,j){f=a.materials[f];var l=d[h*3],k=d[h*3+1];h=d[h*3+2];
+var m=d[j*3],p=d[j*3+1];j=d[j*3+2];a.faces.push(new THREE.Face3(b,e,c,[new THREE.Vector3(d[g*3],d[g*3+1],d[g*3+2]),new THREE.Vector3(l,k,h),new THREE.Vector3(m,p,j)],null,f))},f4n:function(a,d,b,e,c,f,g,h,j,l,k){g=a.materials[g];var m=d[j*3],p=d[j*3+1];j=d[j*3+2];var o=d[l*3],x=d[l*3+1];l=d[l*3+2];var w=d[k*3],u=d[k*3+1];k=d[k*3+2];a.faces.push(new THREE.Face4(b,e,c,f,[new THREE.Vector3(d[h*3],d[h*3+1],d[h*3+2]),new THREE.Vector3(m,p,j),new THREE.Vector3(o,x,l),new THREE.Vector3(w,u,k)],null,g))},
+uv3:function(a,d,b,e,c,f,g){var h=[];h.push(new THREE.UV(d,b));h.push(new THREE.UV(e,c));h.push(new THREE.UV(f,g));a.push(h)},uv4:function(a,d,b,e,c,f,g,h,j){var l=[];l.push(new THREE.UV(d,b));l.push(new THREE.UV(e,c));l.push(new THREE.UV(f,g));l.push(new THREE.UV(h,j));a.push(l)}};THREE.SceneLoader=function(){};
+THREE.SceneLoader.prototype={load:function(a,d,b,e){var c=new Worker(a);c.postMessage(0);var f=THREE.Loader.prototype.extractUrlbase(a);c.onmessage=function(g){function h(U,X){return X=="relativeToHTML"?U:f+"/"+U}function j(){for(o in E.objects)if(!F.objects[o]){z=E.objects[o];if(G=F.geometries[z.geometry]){I=[];for(T=0;T<z.materials.length;T++)I[T]=F.materials[z.materials[T]];n=z.position;r=z.rotation;q=z.quaternion;s=z.scale;q=0;I.length==0&&(I[0]=new THREE.MeshFaceMaterial);object=new THREE.Mesh(G,
+I);object.position.set(n[0],n[1],n[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=z.visible;F.scene.addObject(object);F.objects[o]=object;if(z.meshCollider){var U=THREE.CollisionUtils.MeshColliderWBox(object);THREE.Collisions.colliders.push(U)}}}}function l(U){return function(X){F.geometries[U]=X;j();P-=1;k()}}function k(){e({total_models:R,total_textures:M,loaded_models:R-P,loaded_textures:M-
+Q},F);P==0&&Q==0&&b(F)}var m,p,o,x,w,u,B,z,n,y,C,G,K,J,I,E,L,P,Q,R,M,F;E=g.data;g=new THREE.BinaryLoader;L=new THREE.JSONLoader;Q=P=0;F={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{}};if(E.transform){var N=E.transform.position;y=E.transform.rotation;var O=E.transform.scale;N&&F.scene.position.set(N[0],N[1],N[2]);y&&F.scene.rotation.set(y[0],y[1],y[2]);O&&F.scene.scale.set(O[0],O[1],O[2]);(N||y||O)&&F.scene.updateMatrix()}N=function(){Q-=1;k()};
+for(w in E.cameras){y=E.cameras[w];if(y.type=="perspective")K=new THREE.Camera(y.fov,y.aspect,y.near,y.far);else if(y.type=="ortho"){K=new THREE.Camera;K.projectionMatrix=THREE.Matrix4.makeOrtho(y.left,y.right,y.top,y.bottom,y.near,y.far)}n=y.position;y=y.target;K.position.set(n[0],n[1],n[2]);K.target.position.set(y[0],y[1],y[2]);F.cameras[w]=K}for(x in E.lights){w=E.lights[x];K=w.color!==undefined?w.color:16777215;y=w.intensity!==undefined?w.intensity:1;if(w.type=="directional"){n=w.direction;light=
+new THREE.DirectionalLight(K,y);light.position.set(n[0],n[1],n[2]);light.position.normalize()}else if(w.type=="point"){n=w.position;light=new THREE.PointLight(K,y);light.position.set(n[0],n[1],n[2])}F.scene.addLight(light);F.lights[x]=light}for(u in E.fogs){x=E.fogs[u];if(x.type=="linear")J=new THREE.Fog(0,x.near,x.far);else x.type=="exp2"&&(J=new THREE.FogExp2(0,x.density));y=x.color;J.color.setRGB(y[0],y[1],y[2]);F.fogs[u]=J}if(F.cameras&&E.defaults.camera)F.currentCamera=F.cameras[E.defaults.camera];
+if(F.fogs&&E.defaults.fog)F.scene.fog=F.fogs[E.defaults.fog];y=E.defaults.bgcolor;F.bgColor=new THREE.Color;F.bgColor.setRGB(y[0],y[1],y[2]);F.bgColorAlpha=E.defaults.bgalpha;for(m in E.geometries){u=E.geometries[m];if(u.type=="bin_mesh"||u.type=="ascii_mesh")P+=1}R=P;for(m in E.geometries){u=E.geometries[m];if(u.type=="cube"){G=new THREE.Cube(u.width,u.height,u.depth,u.segmentsWidth,u.segmentsHeight,u.segmentsDepth,null,u.flipped,u.sides);F.geometries[m]=G}else if(u.type=="plane"){G=new THREE.Plane(u.width,
+u.height,u.segmentsWidth,u.segmentsHeight);F.geometries[m]=G}else if(u.type=="sphere"){G=new THREE.Sphere(u.radius,u.segmentsWidth,u.segmentsHeight);F.geometries[m]=G}else if(u.type=="cylinder"){G=new THREE.Cylinder(u.numSegs,u.topRad,u.botRad,u.height,u.topOffset,u.botOffset);F.geometries[m]=G}else if(u.type=="torus"){G=new THREE.Torus(u.radius,u.tube,u.segmentsR,u.segmentsT);F.geometries[m]=G}else if(u.type=="icosahedron"){G=new THREE.Icosahedron(u.subdivisions);F.geometries[m]=G}else if(u.type==
+"bin_mesh")g.load({model:h(u.url,E.urlBaseType),callback:l(m)});else u.type=="ascii_mesh"&&L.load({model:h(u.url,E.urlBaseType),callback:l(m)})}for(B in E.textures){m=E.textures[B];Q+=m.url instanceof Array?m.url.length:1}M=Q;for(B in E.textures){m=E.textures[B];if(m.mapping!=undefined&&THREE[m.mapping]!=undefined)m.mapping=new THREE[m.mapping];if(m.url instanceof Array){u=[];for(var T=0;T<m.url.length;T++)u[T]=h(m.url[T],E.urlBaseType);u=THREE.ImageUtils.loadTextureCube(u,m.mapping,N)}else{u=THREE.ImageUtils.loadTexture(h(m.url,
+E.urlBaseType),m.mapping,N);if(THREE[m.minFilter]!=undefined)u.minFilter=THREE[m.minFilter];if(THREE[m.magFilter]!=undefined)u.magFilter=THREE[m.magFilter]}F.textures[B]=u}for(p in E.materials){B=E.materials[p];for(C in B.parameters)if(C=="envMap"||C=="map"||C=="lightMap")B.parameters[C]=F.textures[B.parameters[C]];else if(C=="shading")B.parameters[C]=B.parameters[C]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(C=="blending")B.parameters[C]=THREE[B.parameters[C]]?THREE[B.parameters[C]]:THREE.NormalBlending;
+else C=="combine"&&(B.parameters[C]=B.parameters[C]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation);B=new THREE[B.type](B.parameters);F.materials[p]=B}j();d(F)}}};
+THREE.MarchingCubes=function(a,d){THREE.Object3D.call(this);this.materials=d instanceof Array?d:[d];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,c){return b+(e-b)*c};this.VIntX=function(b,e,c,f,g,h,j,l,k,m){g=(g-k)/(m-k);k=this.normal_cache;e[f]=h+g*this.delta;e[f+1]=j;e[f+2]=l;c[f]=this.lerp(k[b],k[b+3],g);c[f+1]=this.lerp(k[b+1],k[b+4],g);c[f+2]=this.lerp(k[b+2],k[b+5],g)};this.VIntY=function(b,e,c,f,g,h,j,l,k,m){g=(g-k)/(m-k);k=this.normal_cache;e[f]=h;e[f+1]=j+g*this.delta;e[f+
+2]=l;e=b+this.yd*3;c[f]=this.lerp(k[b],k[e],g);c[f+1]=this.lerp(k[b+1],k[e+1],g);c[f+2]=this.lerp(k[b+2],k[e+2],g)};this.VIntZ=function(b,e,c,f,g,h,j,l,k,m){g=(g-k)/(m-k);k=this.normal_cache;e[f]=h;e[f+1]=j;e[f+2]=l+g*this.delta;e=b+this.zd*3;c[f]=this.lerp(k[b],k[e],g);c[f+1]=this.lerp(k[b+1],k[e+1],g);c[f+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,c,f,g,h){var j=f+1,l=f+this.yd,k=f+this.zd,m=j+this.yd,p=j+this.zd,o=f+this.yd+this.zd,x=j+this.yd+this.zd,w=0,u=this.field[f],B=this.field[j],z=this.field[l],n=this.field[m],y=this.field[k],C=this.field[p],G=this.field[o],K=this.field[x];u<g&&(w|=1);B<g&&(w|=2);z<g&&(w|=8);n<g&&(w|=4);y<g&&(w|=16);C<g&&(w|=32);G<g&&(w|=128);K<g&&(w|=64);var J=THREE.edgeTable[w];if(J==0)return 0;
+var I=this.delta,E=b+I,L=e+I;I=c+I;if(J&1){this.compNorm(f);this.compNorm(j);this.VIntX(f*3,this.vlist,this.nlist,0,g,b,e,c,u,B)}if(J&2){this.compNorm(j);this.compNorm(m);this.VIntY(j*3,this.vlist,this.nlist,3,g,E,e,c,B,n)}if(J&4){this.compNorm(l);this.compNorm(m);this.VIntX(l*3,this.vlist,this.nlist,6,g,b,L,c,z,n)}if(J&8){this.compNorm(f);this.compNorm(l);this.VIntY(f*3,this.vlist,this.nlist,9,g,b,e,c,u,z)}if(J&16){this.compNorm(k);this.compNorm(p);this.VIntX(k*3,this.vlist,this.nlist,12,g,b,e,I,
+y,C)}if(J&32){this.compNorm(p);this.compNorm(x);this.VIntY(p*3,this.vlist,this.nlist,15,g,E,e,I,C,K)}if(J&64){this.compNorm(o);this.compNorm(x);this.VIntX(o*3,this.vlist,this.nlist,18,g,b,L,I,G,K)}if(J&128){this.compNorm(k);this.compNorm(o);this.VIntY(k*3,this.vlist,this.nlist,21,g,b,e,I,y,G)}if(J&256){this.compNorm(f);this.compNorm(k);this.VIntZ(f*3,this.vlist,this.nlist,24,g,b,e,c,u,y)}if(J&512){this.compNorm(j);this.compNorm(p);this.VIntZ(j*3,this.vlist,this.nlist,27,g,E,e,c,B,C)}if(J&1024){this.compNorm(m);
+this.compNorm(x);this.VIntZ(m*3,this.vlist,this.nlist,30,g,E,L,c,n,K)}if(J&2048){this.compNorm(l);this.compNorm(o);this.VIntZ(l*3,this.vlist,this.nlist,33,g,b,L,c,z,G)}w<<=4;for(g=f=0;THREE.triTable[w+g]!=-1;){b=w+g;e=b+1;c=b+2;this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[e],3*THREE.triTable[c],h);g+=3;f++}return f};this.posnormtriv=function(b,e,c,f,g,h){var j=this.count*3;this.positionArray[j]=b[c];this.positionArray[j+1]=b[c+1];this.positionArray[j+2]=b[c+2];this.positionArray[j+
+3]=b[f];this.positionArray[j+4]=b[f+1];this.positionArray[j+5]=b[f+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[c];this.normalArray[j+1]=e[c+1];this.normalArray[j+2]=e[c+2];this.normalArray[j+3]=e[f];this.normalArray[j+4]=e[f+1];this.normalArray[j+5]=e[f+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,c,f,g){var h=this.size*Math.sqrt(f/g),j=c*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 o=Math.floor(k-h);o<1&&(o=1);h=Math.floor(k+h);
+h>this.size-1&&(h=this.size-1);for(var x,w,u,B,z,n;m<j;m++){k=this.size2*m;w=m/this.size-c;z=w*w;for(w=p;w<l;w++){u=k+this.size*w;x=w/this.size-e;n=x*x;for(x=o;x<h;x++){B=x/this.size-b;B=f/(1.0E-6+B*B+n+z)-g;B>0&&(this.field[u+x]+=B)}}}};this.addPlaneX=function(b,e){var c,f,g,h,j,l=this.size,k=this.yd,m=this.zd,p=this.field,o=l*Math.sqrt(b/e);o>l&&(o=l);for(c=0;c<o;c++){f=c/l;f*=f;h=b/(1.0E-4+f)-e;if(h>0)for(f=0;f<l;f++){j=c+f*k;for(g=0;g<l;g++)p[m*g+j]+=h}}};this.addPlaneY=function(b,e){var c,f,
+g,h,j,l,k=this.size,m=this.yd,p=this.zd,o=this.field,x=k*Math.sqrt(b/e);x>k&&(x=k);for(f=0;f<x;f++){c=f/k;c*=c;h=b/(1.0E-4+c)-e;if(h>0){j=f*m;for(c=0;c<k;c++){l=j+c;for(g=0;g<k;g++)o[p*g+l]+=h}}}};this.addPlaneZ=function(b,e){var c,f,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++){c=g/size;c*=c;h=b/(1.0E-4+c)-e;if(h>0){j=zd*g;for(f=0;f<size;f++){l=j+f*yd;for(c=0;c<size;c++)field[l+c]+=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,c,f,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(f=1;f<p;f++){k=m+this.size*f;j=(f-this.halfsize)/this.halfsize;for(c=1;c<p;c++){h=(c-this.halfsize)/this.halfsize;e=k+c;this.polygonize(h,j,l,e,this.isolation,b)}}}this.end(b)};this.generateGeometry=function(){var b=0,e=new THREE.Geometry,c=[];this.render(function(f){var g,h,j,l,k,m,p,o;for(g=
+0;g<f.count;g++){p=g*3;k=p+1;o=p+2;h=f.positionArray[p];j=f.positionArray[k];l=f.positionArray[o];m=new THREE.Vector3(h,j,l);h=f.normalArray[p];j=f.normalArray[k];l=f.normalArray[o];p=new THREE.Vector3(h,j,l);p.normalize();k=new THREE.Vertex(m);e.vertices.push(k);c.push(p)}nfaces=f.count/3;for(g=0;g<nfaces;g++){p=(b+g)*3;k=p+1;o=p+2;m=c[p];h=c[k];j=c[o];p=new THREE.Face3(p,k,o,[m,h,j]);e.faces.push(p)}b+=nfaces;f.count=0});return e};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;
 THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
 THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
 THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
 THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
 1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,
 1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,
@@ -131,18 +148,18 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 2,11,1,5,1,11,-1,0,2,5,0,5,9,2,11,5,4,5,8,11,8,5,-1,9,4,5,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,5,10,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1,5,10,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1,3,10,2,3,5,10,3,8,5,4,5,8,0,1,9,-1,5,10,2,5,2,4,1,9,2,9,4,2,-1,-1,-1,-1,8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1,0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,4,5,8,5,3,9,0,5,0,3,5,-1,-1,-1,-1,9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,11,7,4,9,11,9,10,11,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,7,9,11,7,9,10,11,-1,-1,-1,-1,1,10,11,1,11,
 2,11,1,5,1,11,-1,0,2,5,0,5,9,2,11,5,4,5,8,11,8,5,-1,9,4,5,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,5,10,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1,5,10,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1,3,10,2,3,5,10,3,8,5,4,5,8,0,1,9,-1,5,10,2,5,2,4,1,9,2,9,4,2,-1,-1,-1,-1,8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1,0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,4,5,8,5,3,9,0,5,0,3,5,-1,-1,-1,-1,9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,11,7,4,9,11,9,10,11,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,7,9,11,7,9,10,11,-1,-1,-1,-1,1,10,11,1,11,
 4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
 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,
 -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.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};
-THREE.MeshCollider=function(a,b,c,d){this.vertices=a;this.faces=b;this.normals=c;this.box=d;this.numFaces=this.faces.length};THREE.CollisionSystem=function(){this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;
-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++){e=this.colliders[b];d=this.rayCast(a,e);if(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<Number.MAX_VALUE){b[c].distance=d;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=0;e<b.numFaces/3;e++){var f=e*3;d=Math.min(d,this.rayTriangle(c,b.vertices[b.faces[f+0]],b.vertices[b.faces[f+1]],b.vertices[b.faces[f+2]],b.normals[b.faces[e]],d))}return d};
-THREE.CollisionSystem.prototype.rayTriangle=function(a,b,c,d,e,f){var h=THREE.CollisionSystem.__v1,g=THREE.CollisionSystem.__v2;h.sub(c,b);g.sub(d,c);e.cross(h,g);g=e.dot(a.direction);if(!(g<0))return Number.MAX_VALUE;h=e.dot(b)-e.dot(a.origin);if(!(h<=0))return Number.MAX_VALUE;if(!(h>=g*f))return Number.MAX_VALUE;h/=g;g=THREE.CollisionSystem.__v3;g.copy(a.direction);g.multiplyScalar(h);g.addSelf(a.origin);if(Math.abs(e.x)>Math.abs(e.y))if(Math.abs(e.x)>Math.abs(e.z)){a=g.y-b.y;e=c.y-b.y;f=d.y-b.y;
-g=g.z-b.z;c=c.z-b.z;d=d.z-b.z}else{a=g.x-b.x;e=c.x-b.x;f=d.x-b.x;g=g.y-b.y;c=c.y-b.y;d=d.y-b.y}else if(Math.abs(e.y)>Math.abs(e.z)){a=g.x-b.x;e=c.x-b.x;f=d.x-b.x;g=g.z-b.z;c=c.z-b.z;d=d.z-b.z}else{a=g.x-b.x;e=c.x-b.x;f=d.x-b.x;g=g.y-b.y;c=c.y-b.y;d=d.y-b.y}b=e*d-c*f;if(b==0)return Number.MAX_VALUE;b=1/b;d=(a*d-g*f)*b;if(!(d>=0))return Number.MAX_VALUE;b*=e*g-c*a;if(!(b>=0))return Number.MAX_VALUE;if(!(1-d-b>=0))return Number.MAX_VALUE;return h};
-THREE.CollisionSystem.prototype.makeRayLocal=function(a,b){var c=new THREE.Ray(a.origin.clone(),a.direction.clone()),d=THREE.Matrix4.makeInvert(b.matrixWorld);d.multiplyVector3(c.origin);d.rotateAxis(c.direction);c.direction.normalize();return c};
-THREE.CollisionSystem.prototype.rayBox=function(a,b){var c;c=b.dynamic&&b.mesh&&b.mesh.matrixWorld?this.makeRayLocal(a,b.mesh):new THREE.Ray(a.origin.clone(),a.direction.clone());var d=0,e=0,f=0,h=0,g=0,j=0,l=!0;if(c.origin.x<b.min.x){d=b.min.x-c.origin.x;d/=c.direction.x;l=!1;h=-1}else if(c.origin.x>b.max.x){d=b.max.x-c.origin.x;d/=c.direction.x;l=!1;h=1}if(c.origin.y<b.min.y){e=b.min.y-c.origin.y;e/=c.direction.y;l=!1;g=-1}else if(c.origin.y>b.max.y){e=b.max.y-c.origin.y;e/=c.direction.y;l=!1;g=
-1}if(c.origin.z<b.min.z){f=b.min.z-c.origin.z;f/=c.direction.z;l=!1;j=-1}else if(c.origin.z>b.max.z){f=b.max.z-c.origin.z;f/=c.direction.z;l=!1;j=1}if(l)return-1;l=0;if(e>d){l=1;d=e}if(f>d){l=2;d=f}switch(l){case 0:g=c.origin.y+c.direction.y*d;if(g<b.min.y||g>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=new THREE.Vector3(h,0,0);break;case 1:h=c.origin.x+c.direction.x*d;if(h<b.min.x||h>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=new THREE.Vector3(0,g,0);break;case 2:h=c.origin.x+c.direction.x*d;if(h<b.min.x||h>b.max.x)return Number.MAX_VALUE;g=c.origin.y+c.direction.y*d;if(g<b.min.y||g>b.max.y)return Number.MAX_VALUE;b.normal=new THREE.Vector3(0,0,j)}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.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){for(var b=a.geometry.vertices,c=b.length,d=a.geometry.faces,e=d.length,f=[],h=[],g=[],j=0;j<c;j++)f.push(new THREE.Vector3(b[j].position.x,b[j].position.y,b[j].position.z));for(j=0;j<e;j++){h.push(d[j].a,d[j].b,d[j].c);g.push(new THREE.Vector3(d[j].normal.x,d[j].normal.y,d[j].normal.z))}b=new THREE.MeshCollider(f,h,g,THREE.CollisionUtils.MeshOBB(a));b.mesh=a;return b};
+2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);THREE.PlaneCollider=function(a,d){this.point=a;this.normal=d};THREE.SphereCollider=function(a,d){this.center=a;this.radius=d;this.radiusSq=d*d};THREE.BoxCollider=function(a,d){this.min=a;this.max=d;this.dynamic=!0};
+THREE.MeshCollider=function(a,d,b,e){this.vertices=a;this.faces=d;this.normals=b;this.box=e;this.numFaces=this.faces.length};THREE.CollisionSystem=function(){this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;
+THREE.CollisionSystem.prototype.rayCastAll=function(a){a.direction.normalize();this.hits.length=0;var d,b,e,c,f=0;d=0;for(b=this.colliders.length;d<b;d++){c=this.colliders[d];e=this.rayCast(a,c);if(e<Number.MAX_VALUE){c.distance=e;e>f?this.hits.push(c):this.hits.unshift(c);f=e}}return this.hits};
+THREE.CollisionSystem.prototype.rayCastNearest=function(a){var d=this.rayCastAll(a);if(d.length==0)return null;for(var b=0;d[b]instanceof THREE.MeshCollider;){var e=this.rayMesh(a,d[b]);if(e<Number.MAX_VALUE){d[b].distance=e;break}b++}if(b>d.length)return null;return d[b]};
+THREE.CollisionSystem.prototype.rayCast=function(a,d){if(d instanceof THREE.PlaneCollider)return this.rayPlane(a,d);else if(d instanceof THREE.SphereCollider)return this.raySphere(a,d);else if(d instanceof THREE.BoxCollider)return this.rayBox(a,d);else if(d instanceof THREE.MeshCollider&&d.box)return this.rayBox(a,d.box)};
+THREE.CollisionSystem.prototype.rayMesh=function(a,d){for(var b=this.makeRayLocal(a,d.mesh),e=Number.MAX_VALUE,c=0;c<d.numFaces/3;c++){var f=c*3;e=Math.min(e,this.rayTriangle(b,d.vertices[d.faces[f+0]],d.vertices[d.faces[f+1]],d.vertices[d.faces[f+2]],d.normals[d.faces[c]],e))}return e};
+THREE.CollisionSystem.prototype.rayTriangle=function(a,d,b,e,c,f){var g=THREE.CollisionSystem.__v1,h=THREE.CollisionSystem.__v2;g.sub(b,d);h.sub(e,b);c.cross(g,h);h=c.dot(a.direction);if(!(h<0))return Number.MAX_VALUE;g=c.dot(d)-c.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(c.x)>Math.abs(c.y))if(Math.abs(c.x)>Math.abs(c.z)){a=h.y-d.y;c=b.y-d.y;f=e.y-d.y;
+h=h.z-d.z;b=b.z-d.z;e=e.z-d.z}else{a=h.x-d.x;c=b.x-d.x;f=e.x-d.x;h=h.y-d.y;b=b.y-d.y;e=e.y-d.y}else if(Math.abs(c.y)>Math.abs(c.z)){a=h.x-d.x;c=b.x-d.x;f=e.x-d.x;h=h.z-d.z;b=b.z-d.z;e=e.z-d.z}else{a=h.x-d.x;c=b.x-d.x;f=e.x-d.x;h=h.y-d.y;b=b.y-d.y;e=e.y-d.y}d=c*e-b*f;if(d==0)return Number.MAX_VALUE;d=1/d;e=(a*e-h*f)*d;if(!(e>=0))return Number.MAX_VALUE;d*=c*h-b*a;if(!(d>=0))return Number.MAX_VALUE;if(!(1-e-d>=0))return Number.MAX_VALUE;return g};
+THREE.CollisionSystem.prototype.makeRayLocal=function(a,d){var b=new THREE.Ray(a.origin.clone(),a.direction.clone()),e=THREE.Matrix4.makeInvert(d.matrixWorld);e.multiplyVector3(b.origin);e.rotateAxis(b.direction);b.direction.normalize();return b};
+THREE.CollisionSystem.prototype.rayBox=function(a,d){var b;b=d.dynamic&&d.mesh&&d.mesh.matrixWorld?this.makeRayLocal(a,d.mesh):new THREE.Ray(a.origin.clone(),a.direction.clone());var e=0,c=0,f=0,g=0,h=0,j=0,l=!0;if(b.origin.x<d.min.x){e=d.min.x-b.origin.x;e/=b.direction.x;l=!1;g=-1}else if(b.origin.x>d.max.x){e=d.max.x-b.origin.x;e/=b.direction.x;l=!1;g=1}if(b.origin.y<d.min.y){c=d.min.y-b.origin.y;c/=b.direction.y;l=!1;h=-1}else if(b.origin.y>d.max.y){c=d.max.y-b.origin.y;c/=b.direction.y;l=!1;h=
+1}if(b.origin.z<d.min.z){f=d.min.z-b.origin.z;f/=b.direction.z;l=!1;j=-1}else if(b.origin.z>d.max.z){f=d.max.z-b.origin.z;f/=b.direction.z;l=!1;j=1}if(l)return-1;l=0;if(c>e){l=1;e=c}if(f>e){l=2;e=f}switch(l){case 0:h=b.origin.y+b.direction.y*e;if(h<d.min.y||h>d.max.y)return Number.MAX_VALUE;b=b.origin.z+b.direction.z*e;if(b<d.min.z||b>d.max.z)return Number.MAX_VALUE;d.normal=new THREE.Vector3(g,0,0);break;case 1:g=b.origin.x+b.direction.x*e;if(g<d.min.x||g>d.max.x)return Number.MAX_VALUE;b=b.origin.z+
+b.direction.z*e;if(b<d.min.z||b>d.max.z)return Number.MAX_VALUE;d.normal=new THREE.Vector3(0,h,0);break;case 2:g=b.origin.x+b.direction.x*e;if(g<d.min.x||g>d.max.x)return Number.MAX_VALUE;h=b.origin.y+b.direction.y*e;if(h<d.min.y||h>d.max.y)return Number.MAX_VALUE;d.normal=new THREE.Vector3(0,0,j)}return e};THREE.CollisionSystem.prototype.rayPlane=function(a,d){var b=a.direction.dot(d.normal),e=d.point.dot(d.normal);if(b<0)b=(e-a.origin.dot(d.normal))/b;else return Number.MAX_VALUE;return b>0?b:Number.MAX_VALUE};
+THREE.CollisionSystem.prototype.raySphere=function(a,d){var b=d.center.clone().subSelf(a.origin);if(b.lengthSq<d.radiusSq)return-1;var e=b.dot(a.direction.clone());if(e<=0)return Number.MAX_VALUE;b=d.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.CollisionUtils={};
+THREE.CollisionUtils.MeshOBB=function(a){a.geometry.computeBoundingBox();var d=a.geometry.boundingBox,b=new THREE.Vector3(d.x[0],d.y[0],d.z[0]);d=new THREE.Vector3(d.x[1],d.y[1],d.z[1]);b=new THREE.BoxCollider(b,d);b.mesh=a;return b};THREE.CollisionUtils.MeshAABB=function(a){var d=THREE.CollisionUtils.MeshOBB(a);d.min.addSelf(a.position);d.max.addSelf(a.position);d.dynamic=!1;return d};
+THREE.CollisionUtils.MeshColliderWBox=function(a){for(var d=a.geometry.vertices,b=d.length,e=a.geometry.faces,c=e.length,f=[],g=[],h=[],j=0;j<b;j++)f.push(new THREE.Vector3(d[j].position.x,d[j].position.y,d[j].position.z));for(j=0;j<c;j++){g.push(e[j].a,e[j].b,e[j].c);h.push(new THREE.Vector3(e[j].normal.x,e[j].normal.y,e[j].normal.z))}d=new THREE.MeshCollider(f,g,h,THREE.CollisionUtils.MeshOBB(a));d.mesh=a;return d};

+ 71 - 88
build/custom/ThreeSVG.js

@@ -1,87 +1,70 @@
 // ThreeSVG.js r39 - http://github.com/mrdoob/three.js
 // ThreeSVG.js r39 - 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)};
 var THREE=THREE||{};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}THREE.Color=function(a){this.setHex(a)};
-THREE.Color.prototype={autoUpdate:!0,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex;this.__styleString=a.__styleString},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,c){var e,d,g,f,i,h;if(c==0)e=d=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:e=h;d=c;g=a;break;case 2:e=a;d=c;g=b;break;case 3:e=a;d=h;g=c;break;case 4:e=b;d=a;g=c;break;case 5:e=c;d=a;
-g=h;break;case 6:case 0:e=c;d=b;g=a}}this.r=e;this.g=d;this.b=g;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},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},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
+THREE.Color.prototype={autoUpdate:!0,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex;this.__styleString=a.__styleString},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,c){var d,e,h,f,i,g;if(c==0)d=e=h=0;else{f=Math.floor(a*6);i=a*6-f;a=c*(1-b);g=c*(1-b*i);b=c*(1-b*(1-i));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.r=d;this.g=e;this.b=h;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},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},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
 255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)}};THREE.Vector2=function(a,b){this.set(a||0,b||0)};
 255)+","+~~(this.b*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/
 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)};
 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,
 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,e=this.z;this.set(c*a.z-e*a.y,e*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/
+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=
 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){this.y=Math.asin(a.n13);var b=Math.cos(this.y);if(Math.abs(b)>1.0E-5){this.x=Math.atan2(-a.n23/b,a.n33/b);this.z=Math.atan2(-a.n13/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)<
 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){this.y=Math.asin(a.n13);var b=Math.cos(this.y);if(Math.abs(b)>1.0E-5){this.x=Math.atan2(-a.n23/b,a.n33/b);this.z=Math.atan2(-a.n13/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,e){this.set(a||0,b||0,c||0,e||1)};
-THREE.Vector4.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;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*
+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};
 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){var b,c,e=a.objects,d=[];a=0;for(b=e.length;a<b;a++){c=e[a];c instanceof THREE.Mesh&&(d=d.concat(this.intersectObject(c)))}d.sort(function(g,f){return g.distance-f.distance});return d},intersectObject:function(a){function b(B,t,K,x){x=x.clone().subSelf(t);K=K.clone().subSelf(t);var G=B.clone().subSelf(t);B=x.dot(x);t=x.dot(K);x=x.dot(G);var C=K.dot(K);K=K.dot(G);G=1/(B*C-t*t);C=(C*x-t*K)*G;B=(B*K-t*x)*G;return C>0&&B>0&&C+B<1}var c,e,d,g,f,i,h,j,l,m,
-n,k=a.geometry,r=k.vertices,u=[];c=0;for(e=k.faces.length;c<e;c++){d=k.faces[c];m=this.origin.clone();n=this.direction.clone();h=a.matrixWorld;g=h.multiplyVector3(r[d.a].position.clone());f=h.multiplyVector3(r[d.b].position.clone());i=h.multiplyVector3(r[d.c].position.clone());h=d instanceof THREE.Face4?h.multiplyVector3(r[d.d].position.clone()):null;j=a.matrixRotationWorld.multiplyVector3(d.normal.clone());l=n.dot(j);if(a.doubleSided||(a.flipSided?l>0:l<0)){j=j.dot((new THREE.Vector3).sub(g,m))/
-l;m=m.addSelf(n.multiplyScalar(j));if(d instanceof THREE.Face3){if(b(m,g,f,i)){d={distance:this.origin.distanceTo(m),point:m,face:d,object:a};u.push(d)}}else if(d instanceof THREE.Face4&&(b(m,g,f,h)||b(m,f,i,h))){d={distance:this.origin.distanceTo(m),point:m,face:d,object:a};u.push(d)}}}return u}};
-THREE.Rectangle=function(){function a(){g=e-b;f=d-c}var b,c,e,d,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 e};this.getBottom=function(){return d};this.set=function(h,j,l,m){i=!1;b=h;c=j;e=l;d=m;a()};this.addPoint=function(h,j){if(i){i=!1;b=h;c=j;e=h;d=j}else{b=b<h?b:h;c=c<j?c:j;e=e>h?e:h;d=d>j?d:j}a()};
-this.add3Points=function(h,j,l,m,n,k){if(i){i=!1;b=h<l?h<n?h:n:l<n?l:n;c=j<m?j<k?j:k:m<k?m:k;e=h>l?h>n?h:n:l>n?l:n;d=j>m?j>k?j:k:m>k?m:k}else{b=h<l?h<n?h<b?h:b:n<b?n:b:l<n?l<b?l:b:n<b?n:b;c=j<m?j<k?j<c?j:c:k<c?k:c:m<k?m<c?m:c:k<c?k:c;e=h>l?h>n?h>e?h:e:n>e?n:e:l>n?l>e?l:e:n>e?n:e;d=j>m?j>k?j>d?j:d:k>d?k:d:m>k?m>d?m:d:k>d?k:d}a()};this.addRectangle=function(h){if(i){i=!1;b=h.getLeft();c=h.getTop();e=h.getRight();d=h.getBottom()}else{b=b<h.getLeft()?b:h.getLeft();c=c<h.getTop()?c:h.getTop();e=e>h.getRight()?
-e:h.getRight();d=d>h.getBottom()?d:h.getBottom()}a()};this.inflate=function(h){b-=h;c-=h;e+=h;d+=h;a()};this.minSelf=function(h){b=b>h.getLeft()?b:h.getLeft();c=c>h.getTop()?c:h.getTop();e=e<h.getRight()?e:h.getRight();d=d<h.getBottom()?d:h.getBottom();a()};this.instersects=function(h){return Math.min(e,h.getRight())-Math.max(b,h.getLeft())>=0&&Math.min(d,h.getBottom())-Math.max(c,h.getTop())>=0};this.empty=function(){i=!0;d=e=c=b=0;a()};this.isEmpty=function(){return i}};
+THREE.Ray.prototype={intersectScene:function(a){var b,c,d=a.objects,e=[];a=0;for(b=d.length;a<b;a++){c=d[a];c instanceof THREE.Mesh&&(e=e.concat(this.intersectObject(c)))}e.sort(function(h,f){return h.distance-f.distance});return e},intersectObject:function(a){function b(B,t,K,x){x=x.clone().subSelf(t);K=K.clone().subSelf(t);var G=B.clone().subSelf(t);B=x.dot(x);t=x.dot(K);x=x.dot(G);var C=K.dot(K);K=K.dot(G);G=1/(B*C-t*t);C=(C*x-t*K)*G;B=(B*K-t*x)*G;return C>0&&B>0&&C+B<1}var c,d,e,h,f,i,g,j,k,m,
+l,o=a.geometry,r=o.vertices,u=[];c=0;for(d=o.faces.length;c<d;c++){e=o.faces[c];m=this.origin.clone();l=this.direction.clone();g=a.matrixWorld;h=g.multiplyVector3(r[e.a].position.clone());f=g.multiplyVector3(r[e.b].position.clone());i=g.multiplyVector3(r[e.c].position.clone());g=e instanceof THREE.Face4?g.multiplyVector3(r[e.d].position.clone()):null;j=a.matrixRotationWorld.multiplyVector3(e.normal.clone());k=l.dot(j);if(a.doubleSided||(a.flipSided?k>0:k<0)){j=j.dot((new THREE.Vector3).sub(h,m))/
+k;m=m.addSelf(l.multiplyScalar(j));if(e instanceof THREE.Face3){if(b(m,h,f,i)){e={distance:this.origin.distanceTo(m),point:m,face:e,object:a};u.push(e)}}else if(e instanceof THREE.Face4&&(b(m,h,f,g)||b(m,f,i,g))){e={distance:this.origin.distanceTo(m),point:m,face:e,object:a};u.push(e)}}}return u}};
+THREE.Rectangle=function(){function a(){h=d-b;f=e-c}var b,c,d,e,h,f,i=!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,j,k,m){i=!1;b=g;c=j;d=k;e=m;a()};this.addPoint=function(g,j){if(i){i=!1;b=g;c=j;d=g;e=j}else{b=b<g?b:g;c=c<j?c:j;d=d>g?d:g;e=e>j?e:j}a()};
+this.add3Points=function(g,j,k,m,l,o){if(i){i=!1;b=g<k?g<l?g:l:k<l?k:l;c=j<m?j<o?j:o:m<o?m:o;d=g>k?g>l?g:l:k>l?k:l;e=j>m?j>o?j:o:m>o?m:o}else{b=g<k?g<l?g<b?g:b:l<b?l:b:k<l?k<b?k:b:l<b?l:b;c=j<m?j<o?j<c?j:c:o<c?o:c:m<o?m<c?m:c:o<c?o:c;d=g>k?g>l?g>d?g:d:l>d?l:d:k>l?k>d?k:d:l>d?l:d;e=j>m?j>o?j>e?j:e:o>e?o:e:m>o?m>e?m:e:o>e?o:e}a()};this.addRectangle=function(g){if(i){i=!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(){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.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,e,d,g,f,i,h,j,l,m,n,k,r,u){this.set(a||1,b||0,c||0,e||0,d||0,g||1,f||0,i||0,h||0,j||0,l||1,m||0,n||0,k||0,r||0,u||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={set:function(a,b,c,e,d,g,f,i,h,j,l,m,n,k,r,u){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=d;this.n22=g;this.n23=f;this.n24=i;this.n31=h;this.n32=j;this.n33=l;this.n34=m;this.n41=n;this.n42=k;this.n43=r;this.n44=u;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 e=THREE.Matrix4.__v1,
-d=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;e.cross(c,g).normalize();if(e.length()===0){g.x+=1.0E-4;e.cross(c,g).normalize()}d.cross(g,e).normalize();this.n11=e.x;this.n12=d.x;this.n13=g.x;this.n21=e.y;this.n22=d.y;this.n23=g.y;this.n31=e.z;this.n32=d.z;this.n33=g.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,e=a.z,d=1/(this.n41*b+this.n42*c+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*e+this.n14)*d;a.y=(this.n21*b+this.n22*c+this.n23*
-e+this.n24)*d;a.z=(this.n31*b+this.n32*c+this.n33*e+this.n34)*d;return a},multiplyVector4:function(a){var b=a.x,c=a.y,e=a.z,d=a.w;a.x=this.n11*b+this.n12*c+this.n13*e+this.n14*d;a.y=this.n21*b+this.n22*c+this.n23*e+this.n24*d;a.z=this.n31*b+this.n32*c+this.n33*e+this.n34*d;a.w=this.n41*b+this.n42*c+this.n43*e+this.n44*d;return a},rotateAxis:function(a){var b=a.x,c=a.y,e=a.z;a.x=b*this.n11+c*this.n12+e*this.n13;a.y=b*this.n21+c*this.n22+e*this.n23;a.z=b*this.n31+c*this.n32+e*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,e=a.n12,d=a.n13,g=a.n14,f=a.n21,i=a.n22,h=a.n23,j=a.n24,l=a.n31,m=a.n32,n=a.n33,k=a.n34,r=a.n41,u=a.n42,B=a.n43,t=a.n44,K=b.n11,x=b.n12,G=b.n13,C=b.n14,p=b.n21,O=b.n22,
-H=b.n23,P=b.n24,M=b.n31,A=b.n32,s=b.n33,L=b.n34;this.n11=c*K+e*p+d*M;this.n12=c*x+e*O+d*A;this.n13=c*G+e*H+d*s;this.n14=c*C+e*P+d*L+g;this.n21=f*K+i*p+h*M;this.n22=f*x+i*O+h*A;this.n23=f*G+i*H+h*s;this.n24=f*C+i*P+h*L+j;this.n31=l*K+m*p+n*M;this.n32=l*x+m*O+n*A;this.n33=l*G+m*H+n*s;this.n34=l*C+m*P+n*L+k;this.n41=r*K+u*p+B*M;this.n42=r*x+u*O+B*A;this.n43=r*G+u*H+B*s;this.n44=r*C+u*P+B*L+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]=
+THREE.Matrix4=function(a,b,c,d,e,h,f,i,g,j,k,m,l,o,r,u){this.set(a||1,b||0,c||0,d||0,e||0,h||1,f||0,i||0,g||0,j||0,k||1,m||0,l||0,o||0,r||0,u||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={set:function(a,b,c,d,e,h,f,i,g,j,k,m,l,o,r,u){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=h;this.n23=f;this.n24=i;this.n31=g;this.n32=j;this.n33=k;this.n34=m;this.n41=l;this.n42=o;this.n43=r;this.n44=u;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*
+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,i=a.n22,g=a.n23,j=a.n24,k=a.n31,m=a.n32,l=a.n33,o=a.n34,r=a.n41,u=a.n42,B=a.n43,t=a.n44,K=b.n11,x=b.n12,G=b.n13,C=b.n14,p=b.n21,O=b.n22,
+H=b.n23,P=b.n24,M=b.n31,A=b.n32,s=b.n33,L=b.n34;this.n11=c*K+d*p+e*M;this.n12=c*x+d*O+e*A;this.n13=c*G+d*H+e*s;this.n14=c*C+d*P+e*L+h;this.n21=f*K+i*p+g*M;this.n22=f*x+i*O+g*A;this.n23=f*G+i*H+g*s;this.n24=f*C+i*P+g*L+j;this.n31=k*K+m*p+l*M;this.n32=k*x+m*O+l*A;this.n33=k*G+m*H+l*s;this.n34=k*C+m*P+l*L+o;this.n41=r*K+u*p+B*M;this.n42=r*x+u*O+B*A;this.n43=r*G+u*H+B*s;this.n44=r*C+u*P+B*L+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.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,e=this.n14,d=this.n21,g=this.n22,f=this.n23,i=this.n24,h=this.n31,j=this.n32,l=this.n33,m=this.n34,n=this.n41,k=this.n42,r=this.n43,u=this.n44;return e*f*j*n-c*i*j*n-e*g*l*n+b*i*l*n+c*g*m*n-b*f*m*n-e*f*h*k+c*i*h*k+e*d*l*k-a*i*l*k-c*d*m*k+a*f*m*k+e*g*h*r-b*i*h*r-e*d*j*r+a*i*j*r+b*d*m*r-a*g*m*r-c*g*h*u+b*f*h*u+c*d*j*u-a*f*j*u-b*d*l*u+a*g*l*u},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,h=this.n22,f=this.n23,i=this.n24,g=this.n31,j=this.n32,k=this.n33,m=this.n34,l=this.n41,o=this.n42,r=this.n43,u=this.n44;return d*f*j*l-c*i*j*l-d*h*k*l+b*i*k*l+c*h*m*l-b*f*m*l-d*f*g*o+c*i*g*o+d*e*k*o-a*i*k*o-c*e*m*o+a*f*m*o+d*h*g*r-b*i*g*r-d*e*j*r+a*i*j*r+b*e*m*r-a*h*m*r-c*h*g*u+b*f*g*u+c*e*j*u-a*f*j*u-b*e*k*u+a*h*k*u},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.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.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,
 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),e=Math.sin(b),d=1-c,g=a.x,f=a.y,i=a.z,h=d*g,j=d*f;this.set(h*
-g+c,h*f-e*i,h*i+e*f,0,h*f+e*i,j*f+c,j*i-e*g,0,h*i-e*f,j*i+e*g,d*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},setRotationFromEuler:function(a){var b=a.x,c=a.y,e=a.z;a=Math.cos(b);b=Math.sin(b);var d=Math.cos(c);c=Math.sin(c);var g=Math.cos(e);e=Math.sin(e);var f=a*c,i=b*c;this.n11=d*g;this.n12=-d*e;this.n13=c;this.n21=i*g+a*e;this.n22=-i*e+a*g;this.n23=-b*d;this.n31=-f*g+b*e;this.n32=f*e+b*g;this.n33=a*d;return this},setRotationFromQuaternion:function(a){var b=
-a.x,c=a.y,e=a.z,d=a.w,g=b+b,f=c+c,i=e+e;a=b*g;var h=b*f;b*=i;var j=c*f;c*=i;e*=i;g*=d;f*=d;d*=i;this.n11=1-(j+e);this.n12=h-d;this.n13=b+f;this.n21=h+d;this.n22=1-(a+e);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=a.n14;this.n24=a.n24;this.n34=
-a.n34},extractRotation:function(a,b){var c=1/b.x,e=1/b.y,d=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*e;this.n22=a.n22*e;this.n32=a.n32*e;this.n13=a.n13*d;this.n23=a.n23*d;this.n33=a.n33*d}};
-THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,d=a.n13,g=a.n14,f=a.n21,i=a.n22,h=a.n23,j=a.n24,l=a.n31,m=a.n32,n=a.n33,k=a.n34,r=a.n41,u=a.n42,B=a.n43,t=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=h*k*u-j*n*u+j*m*B-i*k*B-h*m*t+i*n*t;b.n12=g*n*u-d*k*u-g*m*B+e*k*B+d*m*t-e*n*t;b.n13=d*j*u-g*h*u+g*i*B-e*j*B-d*i*t+e*h*t;b.n14=g*h*m-d*j*m-g*i*n+e*j*n+d*i*k-e*h*k;b.n21=j*n*r-h*k*r-j*l*B+f*k*B+h*l*t-f*n*t;b.n22=d*k*r-g*n*r+g*l*B-c*k*B-d*l*t+c*n*t;b.n23=g*h*r-d*j*r-g*f*B+c*j*B+d*f*t-c*h*t;
-b.n24=d*j*l-g*h*l+g*f*n-c*j*n-d*f*k+c*h*k;b.n31=i*k*r-j*m*r+j*l*u-f*k*u-i*l*t+f*m*t;b.n32=g*m*r-e*k*r-g*l*u+c*k*u+e*l*t-c*m*t;b.n33=d*j*r-g*i*r+g*f*u-c*j*u-e*f*t+c*i*t;b.n34=g*i*l-e*j*l-g*f*m+c*j*m+e*f*k-c*i*k;b.n41=h*m*r-i*n*r-h*l*u+f*n*u+i*l*B-f*m*B;b.n42=e*n*r-d*m*r+d*l*u-c*n*u-e*l*B+c*m*B;b.n43=d*i*r-e*h*r-d*f*u+c*h*u+e*f*B-c*i*B;b.n44=e*h*l-d*i*l+d*f*m-c*h*m-e*f*n+c*i*n;b.multiplyScalar(1/a.determinant());return b};
-THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,d=-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,l=-a.n23*a.n11+a.n21*a.n13,m=a.n22*a.n11-a.n21*a.n12;a=a.n11*e+a.n21*f+a.n31*j;if(a==0)throw"matrix not invertible";a=1/a;c[0]=a*e;c[1]=a*d;c[2]=a*g;c[3]=a*f;c[4]=a*i;c[5]=a*h;c[6]=a*j;c[7]=a*l;c[8]=a*m;return b};
-THREE.Matrix4.makeFrustum=function(a,b,c,e,d,g){var f;f=new THREE.Matrix4;f.n11=2*d/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*d/(e-c);f.n23=(e+c)/(e-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+d)/(g-d);f.n34=-2*g*d/(g-d);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,e){var d;a=c*Math.tan(a*Math.PI/360);d=-a;return THREE.Matrix4.makeFrustum(d*b,a*b,d,a,c,e)};
-THREE.Matrix4.makeOrtho=function(a,b,c,e,d,g){var f,i,h,j;f=new THREE.Matrix4;i=b-a;h=c-e;j=g-d;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+e)/h);f.n31=0;f.n32=0;f.n33=-2/j;f.n34=-((g+d)/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;
+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,i=a.z,g=e*h,j=e*f;this.set(g*
+h+c,g*f-d*i,g*i+d*f,0,g*f+d*i,j*f+c,j*i-d*h,0,g*i-d*f,j*i+d*h,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},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,i=b*c;this.n11=e*h;this.n12=-e*d;this.n13=c;this.n21=i*h+a*d;this.n22=-i*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,i=d+d;a=b*h;var g=b*f;b*=i;var j=c*f;c*=i;d*=i;h*=e;f*=e;e*=i;this.n11=1-(j+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+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=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,i=a.n22,g=a.n23,j=a.n24,k=a.n31,m=a.n32,l=a.n33,o=a.n34,r=a.n41,u=a.n42,B=a.n43,t=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=g*o*u-j*l*u+j*m*B-i*o*B-g*m*t+i*l*t;b.n12=h*l*u-e*o*u-h*m*B+d*o*B+e*m*t-d*l*t;b.n13=e*j*u-h*g*u+h*i*B-d*j*B-e*i*t+d*g*t;b.n14=h*g*m-e*j*m-h*i*l+d*j*l+e*i*o-d*g*o;b.n21=j*l*r-g*o*r-j*k*B+f*o*B+g*k*t-f*l*t;b.n22=e*o*r-h*l*r+h*k*B-c*o*B-e*k*t+c*l*t;b.n23=h*g*r-e*j*r-h*f*B+c*j*B+e*f*t-c*g*t;
+b.n24=e*j*k-h*g*k+h*f*l-c*j*l-e*f*o+c*g*o;b.n31=i*o*r-j*m*r+j*k*u-f*o*u-i*k*t+f*m*t;b.n32=h*m*r-d*o*r-h*k*u+c*o*u+d*k*t-c*m*t;b.n33=e*j*r-h*i*r+h*f*u-c*j*u-d*f*t+c*i*t;b.n34=h*i*k-d*j*k-h*f*m+c*j*m+d*f*o-c*i*o;b.n41=g*m*r-i*l*r-g*k*u+f*l*u+i*k*B-f*m*B;b.n42=d*l*r-e*m*r+e*k*u-c*l*u-d*k*B+c*m*B;b.n43=e*i*r-d*g*r-e*f*u+c*g*u+d*f*B-c*i*B;b.n44=d*g*k-e*i*k+e*f*m-c*g*m-d*f*l+c*i*l;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,i=a.n33*a.n11-a.n31*a.n13,g=-a.n32*a.n11+a.n31*a.n12,j=a.n23*a.n12-a.n22*a.n13,k=-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*j;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*i;c[5]=a*g;c[6]=a*j;c[7]=a*k;c[8]=a*m;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,i,g,j;f=new THREE.Matrix4;i=b-a;g=c-d;j=h-e;f.n11=2/i;f.n12=0;f.n13=0;f.n14=-((b+a)/i);f.n21=0;f.n22=2/g;f.n23=0;f.n24=-((c+d)/g);f.n31=0;f.n32=0;f.n33=-2/j;f.n34=-((h+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.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=
 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.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};
 !0;this._vector=new THREE.Vector3};
 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(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(a){if(this.children.indexOf(a)===-1){a.parent!==
 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(this.position,a,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 instanceof THREE.Scene===!1&&b!==undefined;)b=b.parent;b!==undefined&&b.addChildRecurse(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=undefined;this.children.splice(b,1)}},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!==
 undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b instanceof THREE.Scene===!1&&b!==undefined;)b=b.parent;b!==undefined&&b.addChildRecurse(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=undefined;this.children.splice(b,1)}},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 e=this.children.length;a<e;a++)this.children[a].update(this.matrixWorld,
-b,c)}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==undefined?e:1)};
-THREE.Quaternion.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,e=a.y*b,d=a.z*b;a=Math.cos(e);e=Math.sin(e);b=Math.cos(-d);d=Math.sin(-d);var g=Math.cos(c);c=Math.sin(c);var f=a*b,i=e*d;this.w=f*g-i*c;this.x=f*c+i*g;this.y=e*b*g+a*d*c;this.z=a*d*g-e*b*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,e=this.z,d=this.w,g=a.x,f=a.y,i=a.z;a=a.w;this.x=b*a+d*g+c*i-e*f;this.y=c*a+d*f+e*g-b*i;this.z=e*a+d*i+b*f-c*g;this.w=d*a-b*g-c*f-e*i;return this},
-multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,d=a.z,g=this.x,f=this.y,i=this.z,h=this.w,j=h*c+f*d-i*e,l=h*e+i*c-g*d,m=h*d+g*e-f*c;c=-g*c-f*e-i*d;b.x=j*h+c*-g+l*-i-m*-f;b.y=l*h+c*-f+m*-g-j*-i;b.z=m*h+c*-i+j*-f-l*-g;return b}};
-THREE.Quaternion.slerp=function(a,b,c,e){var d=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(d)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var g=Math.acos(d),f=Math.sqrt(1-d*d);if(Math.abs(f)<0.0010){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}d=Math.sin((1-e)*g)/f;e=Math.sin(e*g)/f;c.w=a.w*d+b.w*e;c.x=a.x*d+b.x*e;c.y=a.y*d+b.y*e;c.z=a.z*d+b.z*e;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
-THREE.Face3=function(a,b,c,e,d,g){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=d instanceof THREE.Color?d:new THREE.Color;this.vertexColors=d instanceof Array?d:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
-THREE.Face4=function(a,b,c,e,d,g,f){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];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)};
+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},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,i=d*e;this.w=f*h-i*c;this.x=f*c+i*h;this.y=d*b*h+a*e*c;this.z=a*e*h-d*b*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,i=a.z;a=a.w;this.x=b*a+e*h+c*i-d*f;this.y=c*a+e*f+d*h-b*i;this.z=d*a+e*i+b*f-c*h;this.w=e*a-b*h-c*f-d*i;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,i=this.z,g=this.w,j=g*c+f*e-i*d,k=g*d+i*c-h*e,m=g*e+h*d-f*c;c=-h*c-f*d-i*e;b.x=j*g+c*-h+k*-i-m*-f;b.y=k*g+c*-f+m*-h-j*-i;b.z=m*g+c*-i+j*-f-k*-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)};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
 THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.edges=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
 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);
 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,e,d,g,f,i=new THREE.Vector3,h=new THREE.Vector3;e=0;for(d=this.faces.length;e<d;e++){g=this.faces[e];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,e;if(this.__tmpVertices==undefined){e=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)e[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{e=
-this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)e[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];if(c instanceof THREE.Face3){e[c.a].addSelf(c.normal);e[c.b].addSelf(c.normal);e[c.c].addSelf(c.normal)}else if(c instanceof THREE.Face4){e[c.a].addSelf(c.normal);e[c.b].addSelf(c.normal);e[c.c].addSelf(c.normal);e[c.d].addSelf(c.normal)}}a=0;for(b=this.vertices.length;a<b;a++)e[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(e[c.a]);
-c.vertexNormals[1].copy(e[c.b]);c.vertexNormals[2].copy(e[c.c])}else if(c instanceof THREE.Face4){c.vertexNormals[0].copy(e[c.a]);c.vertexNormals[1].copy(e[c.b]);c.vertexNormals[2].copy(e[c.c]);c.vertexNormals[3].copy(e[c.d])}}},computeTangents:function(){function a(z,y,D,q,o,E,I){i=z.vertices[y].position;h=z.vertices[D].position;j=z.vertices[q].position;l=f[o];m=f[E];n=f[I];k=h.x-i.x;r=j.x-i.x;u=h.y-i.y;B=j.y-i.y;t=h.z-i.z;K=j.z-i.z;x=m.u-l.u;G=n.u-l.u;C=m.v-l.v;p=n.v-l.v;O=1/(x*p-G*C);A.set((p*
-k-C*r)*O,(p*u-C*B)*O,(p*t-C*K)*O);s.set((x*r-G*k)*O,(x*B-G*u)*O,(x*K-G*t)*O);P[y].addSelf(A);P[D].addSelf(A);P[q].addSelf(A);M[y].addSelf(s);M[D].addSelf(s);M[q].addSelf(s)}var b,c,e,d,g,f,i,h,j,l,m,n,k,r,u,B,t,K,x,G,C,p,O,H,P=[],M=[],A=new THREE.Vector3,s=new THREE.Vector3,L=new THREE.Vector3,Q=new THREE.Vector3,N=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++){P[b]=new THREE.Vector3;M[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 v=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){g=this.faces[b];for(e=0;e<g.vertexNormals.length;e++){N.copy(g.vertexNormals[e]);d=g[v[e]];H=P[d];L.copy(H);L.subSelf(N.multiplyScalar(N.dot(H))).normalize();Q.cross(g.vertexNormals[e],H);d=Q.dot(M[d]);d=d<0?-1:1;g.vertexTangents[e]=new THREE.Vector4(L.x,L.y,L.z,d)}}this.hasTangents=!0},computeBoundingBox:function(){var a;
+c.centroid.addSelf(this.vertices[c.d].position);c.centroid.divideScalar(4)}}},computeFaceNormals:function(a){var b,c,d,e,h,f,i=new THREE.Vector3,g=new THREE.Vector3;d=0;for(e=this.faces.length;d<e;d++){h=this.faces[d];if(a&&h.vertexNormals.length){i.set(0,0,0);b=0;for(c=h.vertexNormals.length;b<c;b++)i.addSelf(h.vertexNormals[b]);i.divideScalar(3)}else{b=this.vertices[h.a];c=this.vertices[h.b];f=this.vertices[h.c];i.sub(f.position,c.position);g.sub(b.position,c.position);i.crossSelf(g)}i.isZero()||
+i.normalize();h.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(z,y,D,q,n,E,I){i=z.vertices[y].position;g=z.vertices[D].position;j=z.vertices[q].position;k=f[n];m=f[E];l=f[I];o=g.x-i.x;r=j.x-i.x;u=g.y-i.y;B=j.y-i.y;t=g.z-i.z;K=j.z-i.z;x=m.u-k.u;G=l.u-k.u;C=m.v-k.v;p=l.v-k.v;O=1/(x*p-G*C);A.set((p*
+o-C*r)*O,(p*u-C*B)*O,(p*t-C*K)*O);s.set((x*r-G*o)*O,(x*B-G*u)*O,(x*K-G*t)*O);P[y].addSelf(A);P[D].addSelf(A);P[q].addSelf(A);M[y].addSelf(s);M[D].addSelf(s);M[q].addSelf(s)}var b,c,d,e,h,f,i,g,j,k,m,l,o,r,u,B,t,K,x,G,C,p,O,H,P=[],M=[],A=new THREE.Vector3,s=new THREE.Vector3,L=new THREE.Vector3,Q=new THREE.Vector3,N=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++){P[b]=new THREE.Vector3;M[b]=new THREE.Vector3}b=0;for(c=this.faces.length;b<c;b++){h=this.faces[b];f=this.faceVertexUvs[0][b];
+if(h instanceof THREE.Face3)a(this,h.a,h.b,h.c,0,1,2);else if(h instanceof THREE.Face4){a(this,h.a,h.b,h.c,0,1,2);a(this,h.a,h.b,h.d,0,1,3)}}var v=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){h=this.faces[b];for(d=0;d<h.vertexNormals.length;d++){N.copy(h.vertexNormals[d]);e=h[v[d]];H=P[e];L.copy(H);L.subSelf(N.multiplyScalar(N.dot(H))).normalize();Q.cross(h.vertexNormals[d],H);e=Q.dot(M[e]);e=e<0?-1:1;h.vertexTangents[d]=new THREE.Vector4(L.x,L.y,L.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;
 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,l){if(h[j]===undefined){h[j]={set:{},array:[]};h[j].set[l]=1;h[j].array.push(l)}else if(h[j].set[l]===undefined){h[j].set[l]=1;h[j].array.push(l)}}var c,e,d,g,f,i={};c=0;for(e=this.faces.length;c<e;c++){f=this.faces[c];if(f instanceof THREE.Face3){d=a(f.a,f.b);b(i,d,c);d=a(f.b,f.c);b(i,d,c);d=a(f.a,f.c);b(i,d,c)}else if(f instanceof THREE.Face4){d=a(f.b,f.d);b(i,d,c);d=a(f.a,f.b);b(i,d,c);d=a(f.a,f.d);b(i,d,c);d=a(f.b,f.c);b(i,d,c);d=a(f.c,f.d);b(i,d,c)}}c=0;for(e=
-this.edges.length;c<e;c++){f=this.edges[c];d=f.vertexIndices[0];g=f.vertexIndices[1];f.faceIndices=i[a(d,g)].array;for(d=0;d<f.faceIndices.length;d++){g=f.faceIndices[d];f.faces.push(this.faces[g])}}}};THREE.GeometryIdCounter=0;
-THREE.AnimationHandler=function(){var a=[],b={},c={};c.update=function(d){for(var g=0;g<a.length;g++)a[g].update(d)};c.addToUpdate=function(d){a.indexOf(d)===-1&&a.push(d)};c.removeFromUpdate=function(d){d=a.indexOf(d);d!==-1&&a.splice(d,1)};c.add=function(d){b[d.name]!==undefined&&console.log("THREE.AnimationHandler.add: Warning! "+d.name+" already exists in library. Overwriting.");b[d.name]=d;if(d.initialized!==!0){for(var g=0;g<d.hierarchy.length;g++){for(var f=0;f<d.hierarchy[g].keys.length;f++){if(d.hierarchy[g].keys[f].time<
-0)d.hierarchy[g].keys[f].time=0;if(d.hierarchy[g].keys[f].rot!==undefined&&!(d.hierarchy[g].keys[f].rot instanceof THREE.Quaternion)){var i=d.hierarchy[g].keys[f].rot;d.hierarchy[g].keys[f].rot=new THREE.Quaternion(i[0],i[1],i[2],i[3])}}if(d.hierarchy[g].keys[0].morphTargets!==undefined){i={};for(f=0;f<d.hierarchy[g].keys.length;f++)for(var h=0;h<d.hierarchy[g].keys[f].morphTargets.length;h++){var j=d.hierarchy[g].keys[f].morphTargets[h];i[j]=-1}d.hierarchy[g].usedMorphTargets=i;for(f=0;f<d.hierarchy[g].keys.length;f++){var l=
-{};for(j in i){for(h=0;h<d.hierarchy[g].keys[f].morphTargets.length;h++)if(d.hierarchy[g].keys[f].morphTargets[h]===j){l[j]=d.hierarchy[g].keys[f].morphTargetsInfluences[h];break}h===d.hierarchy[g].keys[f].morphTargets.length&&(l[j]=0)}d.hierarchy[g].keys[f].morphTargetsInfluences=l}}for(f=1;f<d.hierarchy[g].keys.length;f++)if(d.hierarchy[g].keys[f].time===d.hierarchy[g].keys[f-1].time){d.hierarchy[g].keys.splice(f,1);f--}for(f=1;f<d.hierarchy[g].keys.length;f++)d.hierarchy[g].keys[f].index=f}f=parseInt(d.length*
-d.fps,10);d.JIT={};d.JIT.hierarchy=[];for(g=0;g<d.hierarchy.length;g++)d.JIT.hierarchy.push(Array(f));d.initialized=!0}};c.get=function(d){if(typeof d==="string")if(b[d])return b[d];else{console.log("THREE.AnimationHandler.get: Couldn't find animation "+d);return null}};c.parse=function(d){var g=[];if(d instanceof THREE.SkinnedMesh)for(var f=0;f<d.bones.length;f++)g.push(d.bones[f]);else e(d,g);return g};var e=function(d,g){g.push(d);for(var f=0;f<d.children.length;f++)e(d.children[f],g)};c.LINEAR=
-0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(a,b,c,e){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.isPaused=!0;this.loop=!0;this.interpolationType=c!==undefined?c:THREE.AnimationHandler.LINEAR;this.JITCompile=e!==undefined?e:!0;this.points=[];this.target=new THREE.Vector3};
-THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=a!==undefined?a:!0;this.currentTime=b!==undefined?b:0;var c,e=this.hierarchy.length,d;for(c=0;c<e;c++){d=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)d.useQuaternion=!0;d.matrixAutoUpdate=!0;if(d.animationCache===undefined){d.animationCache={};d.animationCache.prevKey={pos:0,rot:0,scl:0};d.animationCache.nextKey={pos:0,rot:0,scl:0};d.animationCache.originalMatrix=
-d instanceof THREE.Bone?d.skinMatrix:d.matrix}var g=d.animationCache.prevKey;d=d.animationCache.nextKey;g.pos=this.data.hierarchy[c].keys[0];g.rot=this.data.hierarchy[c].keys[0];g.scl=this.data.hierarchy[c].keys[0];d.pos=this.getNextKeyWith("pos",c,1);d.rot=this.getNextKeyWith("rot",c,1);d.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 b=["pos","rot","scl"],c,e,d,g,f,i,h,j,l=this.data.JIT.hierarchy,m,n;this.currentTime+=a*this.timeScale;n=this.currentTime;m=this.currentTime%=this.data.length;j=parseInt(Math.min(m*this.data.fps,this.data.length*this.data.fps),10);for(var k=0,r=this.hierarchy.length;k<r;k++){a=this.hierarchy[k];h=a.animationCache;if(this.JITCompile&&l[k][j]!==undefined)if(a instanceof THREE.Bone){a.skinMatrix=l[k][j];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=
-!1}else{a.matrix=l[k][j];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 u=0;u<3;u++){c=b[u];f=h.prevKey[c];i=h.nextKey[c];if(i.time<=n){if(m<n)if(this.loop){f=this.data.hierarchy[k].keys[0];for(i=this.getNextKeyWith(c,k,1);i.time<m;){f=i;i=this.getNextKeyWith(c,k,i.index+1)}}else{this.stop();return}else{do{f=i;i=this.getNextKeyWith(c,k,i.index+1)}while(i.time<
-m)}h.prevKey[c]=f;h.nextKey[c]=i}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;e=(m-f.time)/(i.time-f.time);d=f[c];g=i[c];if(e<0||e>1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+k);e=e<0?0:1}if(c==="pos"){c=a.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){c.x=d[0]+(g[0]-d[0])*e;c.y=d[1]+(g[1]-d[1])*e;c.z=d[2]+(g[2]-d[2])*e}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=
-this.getPrevKeyWith("pos",k,f.index-1).pos;this.points[1]=d;this.points[2]=g;this.points[3]=this.getNextKeyWith("pos",k,i.index+1).pos;e=e*0.33+0.33;d=this.interpolateCatmullRom(this.points,e);c.x=d[0];c.y=d[1];c.z=d[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(c);this.target.y=0;this.target.normalize();e=Math.atan2(this.target.x,this.target.z);a.rotation.set(0,e,0)}}}else if(c===
-"rot")THREE.Quaternion.slerp(d,g,a.quaternion,e);else if(c==="scl"){c=a.scale;c.x=d[0]+(g[0]-d[0])*e;c.y=d[1]+(g[1]-d[1])*e;c.z=d[2]+(g[2]-d[2])*e}}}}if(this.JITCompile&&l[0][j]===undefined){this.hierarchy[0].update(undefined,!0);for(k=0;k<this.hierarchy.length;k++)l[k][j]=this.hierarchy[k]instanceof THREE.Bone?this.hierarchy[k].skinMatrix.clone():this.hierarchy[k].matrix.clone()}}};
-THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],e=[],d,g,f,i,h,j;d=(a.length-1)*b;g=Math.floor(d);d-=g;c[0]=g==0?g:g-1;c[1]=g;c[2]=g>a.length-2?g:g+1;c[3]=g>a.length-3?g:g+2;g=a[c[0]];i=a[c[1]];h=a[c[2]];j=a[c[3]];c=d*d;f=d*c;e[0]=this.interpolate(g[0],i[0],h[0],j[0],d,c,f);e[1]=this.interpolate(g[1],i[1],h[1],j[1],d,c,f);e[2]=this.interpolate(g[2],i[2],h[2],j[2],d,c,f);return e};
-THREE.Animation.prototype.interpolate=function(a,b,c,e,d,g,f){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*f+(-3*(b-c)-2*a-e)*g+a*d+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)c=c<e.length-1?c:e.length-1;else c%=e.length;for(;c<e.length;c++)if(e[c][a]!==undefined)return e[c];return this.data.hierarchy[b].keys[0]};
-THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+e.length;c>=0;c--)if(e[c][a]!==undefined)return e[c];return this.data.hierarchy[b].keys[e.length-1]};
-THREE.Camera=function(a,b,c,e,d){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=c||0.1;this.far=e||2E3;this.target=d||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.updateMatrix=function(){this.update(undefined,!0)};
+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(g,j){return Math.min(g,
+j)+"_"+Math.max(g,j)}function b(g,j,k){if(g[j]===undefined){g[j]={set:{},array:[]};g[j].set[k]=1;g[j].array.push(k)}else if(g[j].set[k]===undefined){g[j].set[k]=1;g[j].array.push(k)}}var c,d,e,h,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];h=f.vertexIndices[1];f.faceIndices=i[a(e,h)].array;for(e=0;e<f.faceIndices.length;e++){h=f.faceIndices[e];f.faces.push(this.faces[h])}}}};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.updateMatrix=function(){this.update(undefined,!0)};
 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&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=
 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&&(b|=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;
 !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){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1;this.distance=c||0};THREE.PointLight.prototype=new THREE.Light;
 THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1;this.distance=c||0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1;this.distance=c||0};THREE.PointLight.prototype=new THREE.Light;
@@ -104,42 +87,42 @@ THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof
 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);
 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};
 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.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=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 e,d=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(e=0;e<d;e++){a=this.children[e];a instanceof THREE.Bone?a.update(this.skinMatrix,b,c):a.update(this.matrixWorld,!0,c)}}else for(e=0;e<d;e++)this.children[e].update(this.skinMatrix,
+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}};
 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,e){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=e!==undefined?e:!0;this.sources=a instanceof Array?a:[a];var d;c=this.sources.length;for(a=0;a<c;a++){b=this.sources[a];b.toLowerCase();if(b.indexOf(".mp3")!==-1)d=
-"audio/mpeg";else if(b.indexOf(".ogg")!==-1)d="audio/ogg";else b.indexOf(".wav")!==-1&&(d="audio/wav");if(this.domElement.canPlayType(d)){d=document.createElement("source");d.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(d);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=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.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.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.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 e=this.children.length;for(a=0;a<e;a++)this.children[a].update(this.matrixWorld,b,c)};
+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.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;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=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;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.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.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.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.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 A=h[i]=h[i]||new THREE.RenderableVertex;i++;return A}function b(A,s){return s.z-A.z}function c(A,s){var L=0,Q=1,N=A.z+A.w,v=s.z+s.w,z=-A.z+A.w,y=-s.z+s.w;if(N>=0&&v>=0&&z>=0&&y>=0)return!0;else if(N<0&&v<0||z<0&&y<0)return!1;else{if(N<0)L=Math.max(L,N/(N-v));else v<0&&(Q=Math.min(Q,N/(N-v)));if(z<0)L=Math.max(L,z/(z-y));else y<0&&(Q=Math.min(Q,z/(z-y)));if(Q<L)return!1;else{A.lerpSelf(s,L);s.lerpSelf(A,1-Q);return!0}}}var e,d,g=[],f,i,h=[],j,l,m=[],n,k=
+THREE.Projector=function(){function a(){var A=g[i]=g[i]||new THREE.RenderableVertex;i++;return A}function b(A,s){return s.z-A.z}function c(A,s){var L=0,Q=1,N=A.z+A.w,v=s.z+s.w,z=-A.z+A.w,y=-s.z+s.w;if(N>=0&&v>=0&&z>=0&&y>=0)return!0;else if(N<0&&v<0||z<0&&y<0)return!1;else{if(N<0)L=Math.max(L,N/(N-v));else v<0&&(Q=Math.min(Q,N/(N-v)));if(z<0)L=Math.max(L,z/(z-y));else y<0&&(Q=Math.min(Q,z/(z-y)));if(Q<L)return!1;else{A.lerpSelf(s,L);s.lerpSelf(A,1-Q);return!0}}}var d,e,h=[],f,i,g=[],j,k,m=[],l,o=
 [],r,u,B=[],t,K,x=[],G=new THREE.Vector4,C=new THREE.Vector4,p=new THREE.Matrix4,O=new THREE.Matrix4,H=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],P=new THREE.Vector4,M=new THREE.Vector4;this.projectVector=function(A,s){p.multiply(s.projectionMatrix,s.matrixWorldInverse);p.multiplyVector3(A);return A};this.unprojectVector=function(A,s){p.multiply(s.matrixWorld,THREE.Matrix4.makeInvert(s.projectionMatrix));p.multiplyVector3(A);return A};
 [],r,u,B=[],t,K,x=[],G=new THREE.Vector4,C=new THREE.Vector4,p=new THREE.Matrix4,O=new THREE.Matrix4,H=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],P=new THREE.Vector4,M=new THREE.Vector4;this.projectVector=function(A,s){p.multiply(s.projectionMatrix,s.matrixWorldInverse);p.multiplyVector3(A);return A};this.unprojectVector=function(A,s){p.multiply(s.matrixWorld,THREE.Matrix4.makeInvert(s.projectionMatrix));p.multiplyVector3(A);return A};
-this.projectObjects=function(A,s,L){s=[];var Q,N,v;d=0;N=A.objects;A=0;for(Q=N.length;A<Q;A++){v=N[A];var z;if(!(z=!v.visible))if(z=v instanceof THREE.Mesh){a:{z=void 0;for(var y=v.matrixWorld,D=-v.geometry.boundingSphere.radius*Math.max(v.scale.x,Math.max(v.scale.y,v.scale.z)),q=0;q<6;q++){z=H[q].x*y.n14+H[q].y*y.n24+H[q].z*y.n34+H[q].w;if(z<=D){z=!1;break a}}z=!0}z=!z}if(!z){z=g[d]=g[d]||new THREE.RenderableObject;d++;e=z;G.copy(v.position);p.multiplyVector3(G);e.object=v;e.z=G.z;s.push(e)}}L&&
-s.sort(b);return s};this.projectScene=function(A,s,L){var Q=[],N=s.near,v=s.far,z,y,D,q,o,E,I,w,F,J,R,U,W,X,S,V,T;K=u=n=l=0;s.matrixAutoUpdate&&s.updateMatrix();A.update(undefined,!1,s);p.multiply(s.projectionMatrix,s.matrixWorldInverse);H[0].set(p.n41-p.n11,p.n42-p.n12,p.n43-p.n13,p.n44-p.n14);H[1].set(p.n41+p.n11,p.n42+p.n12,p.n43+p.n13,p.n44+p.n14);H[2].set(p.n41+p.n21,p.n42+p.n22,p.n43+p.n23,p.n44+p.n24);H[3].set(p.n41-p.n21,p.n42-p.n22,p.n43-p.n23,p.n44-p.n24);H[4].set(p.n41-p.n31,p.n42-p.n32,
+this.projectObjects=function(A,s,L){s=[];var Q,N,v;e=0;N=A.objects;A=0;for(Q=N.length;A<Q;A++){v=N[A];var z;if(!(z=!v.visible))if(z=v instanceof THREE.Mesh){a:{z=void 0;for(var y=v.matrixWorld,D=-v.geometry.boundingSphere.radius*Math.max(v.scale.x,Math.max(v.scale.y,v.scale.z)),q=0;q<6;q++){z=H[q].x*y.n14+H[q].y*y.n24+H[q].z*y.n34+H[q].w;if(z<=D){z=!1;break a}}z=!0}z=!z}if(!z){z=h[e]=h[e]||new THREE.RenderableObject;e++;d=z;G.copy(v.position);p.multiplyVector3(G);d.object=v;d.z=G.z;s.push(d)}}L&&
+s.sort(b);return s};this.projectScene=function(A,s,L){var Q=[],N=s.near,v=s.far,z,y,D,q,n,E,I,w,F,J,R,U,W,X,S,V,T;K=u=l=k=0;s.matrixAutoUpdate&&s.updateMatrix();A.update(undefined,!1,s);p.multiply(s.projectionMatrix,s.matrixWorldInverse);H[0].set(p.n41-p.n11,p.n42-p.n12,p.n43-p.n13,p.n44-p.n14);H[1].set(p.n41+p.n11,p.n42+p.n12,p.n43+p.n13,p.n44+p.n14);H[2].set(p.n41+p.n21,p.n42+p.n22,p.n43+p.n23,p.n44+p.n24);H[3].set(p.n41-p.n21,p.n42-p.n22,p.n43-p.n23,p.n44-p.n24);H[4].set(p.n41-p.n31,p.n42-p.n32,
 p.n43-p.n33,p.n44-p.n34);H[5].set(p.n41+p.n31,p.n42+p.n32,p.n43+p.n33,p.n44+p.n34);for(z=0;z<6;z++){F=H[z];F.divideScalar(Math.sqrt(F.x*F.x+F.y*F.y+F.z*F.z))}F=this.projectObjects(A,s,!0);A=0;for(z=F.length;A<z;A++){J=F[A].object;if(J.visible){R=J.matrixWorld;U=J.matrixRotationWorld;W=J.materials;X=J.overdraw;i=0;if(J instanceof THREE.Mesh){S=J.geometry;q=S.vertices;V=S.faces;S=S.faceVertexUvs;y=0;for(D=q.length;y<D;y++){f=a();f.positionWorld.copy(q[y].position);R.multiplyVector3(f.positionWorld);
 p.n43-p.n33,p.n44-p.n34);H[5].set(p.n41+p.n31,p.n42+p.n32,p.n43+p.n33,p.n44+p.n34);for(z=0;z<6;z++){F=H[z];F.divideScalar(Math.sqrt(F.x*F.x+F.y*F.y+F.z*F.z))}F=this.projectObjects(A,s,!0);A=0;for(z=F.length;A<z;A++){J=F[A].object;if(J.visible){R=J.matrixWorld;U=J.matrixRotationWorld;W=J.materials;X=J.overdraw;i=0;if(J instanceof THREE.Mesh){S=J.geometry;q=S.vertices;V=S.faces;S=S.faceVertexUvs;y=0;for(D=q.length;y<D;y++){f=a();f.positionWorld.copy(q[y].position);R.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>N&&f.positionScreen.z<v}q=0;for(y=V.length;q<y;q++){D=V[q];if(D instanceof THREE.Face3){o=h[D.a];E=h[D.b];I=h[D.c];if(o.visible&&E.visible&&I.visible&&(J.doubleSided||J.flipSided!=(I.positionScreen.x-o.positionScreen.x)*(E.positionScreen.y-o.positionScreen.y)-(I.positionScreen.y-o.positionScreen.y)*(E.positionScreen.x-
-o.positionScreen.x)<0)){w=m[l]=m[l]||new THREE.RenderableFace3;l++;j=w;j.v1.copy(o);j.v2.copy(E);j.v3.copy(I)}else continue}else if(D instanceof THREE.Face4){o=h[D.a];E=h[D.b];I=h[D.c];w=h[D.d];if(o.visible&&E.visible&&I.visible&&w.visible&&(J.doubleSided||J.flipSided!=((w.positionScreen.x-o.positionScreen.x)*(E.positionScreen.y-o.positionScreen.y)-(w.positionScreen.y-o.positionScreen.y)*(E.positionScreen.x-o.positionScreen.x)<0||(E.positionScreen.x-I.positionScreen.x)*(w.positionScreen.y-I.positionScreen.y)-
-(E.positionScreen.y-I.positionScreen.y)*(w.positionScreen.x-I.positionScreen.x)<0))){T=k[n]=k[n]||new THREE.RenderableFace4;n++;j=T;j.v1.copy(o);j.v2.copy(E);j.v3.copy(I);j.v4.copy(w)}else continue}j.normalWorld.copy(D.normal);U.multiplyVector3(j.normalWorld);j.centroidWorld.copy(D.centroid);R.multiplyVector3(j.centroidWorld);j.centroidScreen.copy(j.centroidWorld);p.multiplyVector3(j.centroidScreen);I=D.vertexNormals;o=0;for(E=I.length;o<E;o++){w=j.vertexNormalsWorld[o];w.copy(I[o]);U.multiplyVector3(w)}o=
-0;for(E=S.length;o<E;o++)if(T=S[o][q]){I=0;for(w=T.length;I<w;I++)j.uvs[o][I]=T[I]}j.meshMaterials=W;j.faceMaterials=D.materials;j.overdraw=X;j.z=j.centroidScreen.z;Q.push(j)}}else if(J instanceof THREE.Line){O.multiply(p,R);q=J.geometry.vertices;o=a();o.positionScreen.copy(q[0].position);O.multiplyVector4(o.positionScreen);y=1;for(D=q.length;y<D;y++){o=a();o.positionScreen.copy(q[y].position);O.multiplyVector4(o.positionScreen);E=h[i-2];P.copy(o.positionScreen);M.copy(E.positionScreen);if(c(P,M)){P.multiplyScalar(1/
+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>N&&f.positionScreen.z<v}q=0;for(y=V.length;q<y;q++){D=V[q];if(D instanceof THREE.Face3){n=g[D.a];E=g[D.b];I=g[D.c];if(n.visible&&E.visible&&I.visible&&(J.doubleSided||J.flipSided!=(I.positionScreen.x-n.positionScreen.x)*(E.positionScreen.y-n.positionScreen.y)-(I.positionScreen.y-n.positionScreen.y)*(E.positionScreen.x-
+n.positionScreen.x)<0)){w=m[k]=m[k]||new THREE.RenderableFace3;k++;j=w;j.v1.copy(n);j.v2.copy(E);j.v3.copy(I)}else continue}else if(D instanceof THREE.Face4){n=g[D.a];E=g[D.b];I=g[D.c];w=g[D.d];if(n.visible&&E.visible&&I.visible&&w.visible&&(J.doubleSided||J.flipSided!=((w.positionScreen.x-n.positionScreen.x)*(E.positionScreen.y-n.positionScreen.y)-(w.positionScreen.y-n.positionScreen.y)*(E.positionScreen.x-n.positionScreen.x)<0||(E.positionScreen.x-I.positionScreen.x)*(w.positionScreen.y-I.positionScreen.y)-
+(E.positionScreen.y-I.positionScreen.y)*(w.positionScreen.x-I.positionScreen.x)<0))){T=o[l]=o[l]||new THREE.RenderableFace4;l++;j=T;j.v1.copy(n);j.v2.copy(E);j.v3.copy(I);j.v4.copy(w)}else continue}j.normalWorld.copy(D.normal);U.multiplyVector3(j.normalWorld);j.centroidWorld.copy(D.centroid);R.multiplyVector3(j.centroidWorld);j.centroidScreen.copy(j.centroidWorld);p.multiplyVector3(j.centroidScreen);I=D.vertexNormals;n=0;for(E=I.length;n<E;n++){w=j.vertexNormalsWorld[n];w.copy(I[n]);U.multiplyVector3(w)}n=
+0;for(E=S.length;n<E;n++)if(T=S[n][q]){I=0;for(w=T.length;I<w;I++)j.uvs[n][I]=T[I]}j.meshMaterials=W;j.faceMaterials=D.materials;j.overdraw=X;j.z=j.centroidScreen.z;Q.push(j)}}else if(J instanceof THREE.Line){O.multiply(p,R);q=J.geometry.vertices;n=a();n.positionScreen.copy(q[0].position);O.multiplyVector4(n.positionScreen);y=1;for(D=q.length;y<D;y++){n=a();n.positionScreen.copy(q[y].position);O.multiplyVector4(n.positionScreen);E=g[i-2];P.copy(n.positionScreen);M.copy(E.positionScreen);if(c(P,M)){P.multiplyScalar(1/
 P.w);M.multiplyScalar(1/M.w);R=B[u]=B[u]||new THREE.RenderableLine;u++;r=R;r.v1.positionScreen.copy(P);r.v2.positionScreen.copy(M);r.z=Math.max(P.z,M.z);r.materials=J.materials;Q.push(r)}}}else if(J instanceof THREE.Particle){C.set(J.position.x,J.position.y,J.position.z,1);p.multiplyVector4(C);C.z/=C.w;if(C.z>0&&C.z<1){R=x[K]=x[K]||new THREE.RenderableParticle;K++;t=R;t.x=C.x/C.w;t.y=C.y/C.w;t.z=C.z;t.rotation=J.rotation.z;t.scale.x=J.scale.x*Math.abs(t.x-(C.x+s.projectionMatrix.n11)/(C.w+s.projectionMatrix.n14));
 P.w);M.multiplyScalar(1/M.w);R=B[u]=B[u]||new THREE.RenderableLine;u++;r=R;r.v1.positionScreen.copy(P);r.v2.positionScreen.copy(M);r.z=Math.max(P.z,M.z);r.materials=J.materials;Q.push(r)}}}else if(J instanceof THREE.Particle){C.set(J.position.x,J.position.y,J.position.z,1);p.multiplyVector4(C);C.z/=C.w;if(C.z>0&&C.z<1){R=x[K]=x[K]||new THREE.RenderableParticle;K++;t=R;t.x=C.x/C.w;t.y=C.y/C.w;t.z=C.z;t.rotation=J.rotation.z;t.scale.x=J.scale.x*Math.abs(t.x-(C.x+s.projectionMatrix.n11)/(C.w+s.projectionMatrix.n14));
 t.scale.y=J.scale.y*Math.abs(t.y-(C.y+s.projectionMatrix.n22)/(C.w+s.projectionMatrix.n24));t.materials=J.materials;Q.push(t)}}}}L&&Q.sort(b);return Q}};
 t.scale.y=J.scale.y*Math.abs(t.y-(C.y+s.projectionMatrix.n22)/(C.w+s.projectionMatrix.n24));t.materials=J.materials;Q.push(t)}}}}L&&Q.sort(b);return Q}};
-THREE.SVGRenderer=function(){function a(v,z,y){var D,q,o,E;D=0;for(q=v.lights.length;D<q;D++){o=v.lights[D];if(o instanceof THREE.DirectionalLight){E=z.normalWorld.dot(o.position)*o.intensity;if(E>0){y.r+=o.color.r*E;y.g+=o.color.g*E;y.b+=o.color.b*E}}else if(o instanceof THREE.PointLight){P.sub(o.position,z.centroidWorld);P.normalize();E=z.normalWorld.dot(P)*o.intensity;if(E>0){y.r+=o.color.r*E;y.g+=o.color.g*E;y.b+=o.color.b*E}}}}function b(v,z,y,D,q,o){s=e(L++);s.setAttribute("d","M "+v.positionScreen.x+
-" "+v.positionScreen.y+" L "+z.positionScreen.x+" "+z.positionScreen.y+" L "+y.positionScreen.x+","+y.positionScreen.y+"z");if(q instanceof THREE.MeshBasicMaterial)x.__styleString=q.color.__styleString;else if(q instanceof THREE.MeshLambertMaterial)if(K){G.r=C.r;G.g=C.g;G.b=C.b;a(o,D,G);x.r=q.color.r*G.r;x.g=q.color.g*G.g;x.b=q.color.b*G.b;x.updateStyleString()}else x.__styleString=q.color.__styleString;else if(q instanceof THREE.MeshDepthMaterial){H=1-q.__2near/(q.__farPlusNear-D.z*q.__farMinusNear);
-x.setRGB(H,H,H)}else q instanceof THREE.MeshNormalMaterial&&x.setRGB(d(D.normalWorld.x),d(D.normalWorld.y),d(D.normalWorld.z));q.wireframe?s.setAttribute("style","fill: none; stroke: "+x.__styleString+"; stroke-width: "+q.wireframeLinewidth+"; stroke-opacity: "+q.opacity+"; stroke-linecap: "+q.wireframeLinecap+"; stroke-linejoin: "+q.wireframeLinejoin):s.setAttribute("style","fill: "+x.__styleString+"; fill-opacity: "+q.opacity);i.appendChild(s)}function c(v,z,y,D,q,o,E){s=e(L++);s.setAttribute("d",
-"M "+v.positionScreen.x+" "+v.positionScreen.y+" L "+z.positionScreen.x+" "+z.positionScreen.y+" L "+y.positionScreen.x+","+y.positionScreen.y+" L "+D.positionScreen.x+","+D.positionScreen.y+"z");if(o instanceof THREE.MeshBasicMaterial)x.__styleString=o.color.__styleString;else if(o instanceof THREE.MeshLambertMaterial)if(K){G.r=C.r;G.g=C.g;G.b=C.b;a(E,q,G);x.r=o.color.r*G.r;x.g=o.color.g*G.g;x.b=o.color.b*G.b;x.updateStyleString()}else x.__styleString=o.color.__styleString;else if(o instanceof THREE.MeshDepthMaterial){H=
-1-o.__2near/(o.__farPlusNear-q.z*o.__farMinusNear);x.setRGB(H,H,H)}else o instanceof THREE.MeshNormalMaterial&&x.setRGB(d(q.normalWorld.x),d(q.normalWorld.y),d(q.normalWorld.z));o.wireframe?s.setAttribute("style","fill: none; stroke: "+x.__styleString+"; stroke-width: "+o.wireframeLinewidth+"; stroke-opacity: "+o.opacity+"; stroke-linecap: "+o.wireframeLinecap+"; stroke-linejoin: "+o.wireframeLinejoin):s.setAttribute("style","fill: "+x.__styleString+"; fill-opacity: "+o.opacity);i.appendChild(s)}
-function e(v){if(M[v]==null){M[v]=document.createElementNS("http://www.w3.org/2000/svg","path");N==0&&M[v].setAttribute("shape-rendering","crispEdges")}return M[v]}function d(v){return v<0?Math.min((1+v)*0.5,0.5):0.5+Math.min(v*0.5,0.5)}var g=null,f=new THREE.Projector,i=document.createElementNS("http://www.w3.org/2000/svg","svg"),h,j,l,m,n,k,r,u,B=new THREE.Rectangle,t=new THREE.Rectangle,K=!1,x=new THREE.Color(16777215),G=new THREE.Color(16777215),C=new THREE.Color(0),p=new THREE.Color(0),O=new THREE.Color(0),
-H,P=new THREE.Vector3,M=[],A=[],s,L,Q,N=1;this.domElement=i;this.autoClear=!0;this.sortObjects=!0;this.sortElements=!0;this.setQuality=function(v){switch(v){case "high":N=1;break;case "low":N=0}};this.setSize=function(v,z){h=v;j=z;l=h/2;m=j/2;i.setAttribute("viewBox",-l+" "+-m+" "+h+" "+j);i.setAttribute("width",h);i.setAttribute("height",j);B.set(-l,-m,l,m)};this.clear=function(){for(;i.childNodes.length>0;)i.removeChild(i.childNodes[0])};this.render=function(v,z){var y,D,q,o,E,I,w,F;this.autoClear&&
-this.clear();g=f.projectScene(v,z,this.sortElements);Q=L=0;if(K=v.lights.length>0){w=v.lights;C.setRGB(0,0,0);p.setRGB(0,0,0);O.setRGB(0,0,0);y=0;for(D=w.length;y<D;y++){q=w[y];o=q.color;if(q instanceof THREE.AmbientLight){C.r+=o.r;C.g+=o.g;C.b+=o.b}else if(q instanceof THREE.DirectionalLight){p.r+=o.r;p.g+=o.g;p.b+=o.b}else if(q instanceof THREE.PointLight){O.r+=o.r;O.g+=o.g;O.b+=o.b}}}y=0;for(D=g.length;y<D;y++){w=g[y];t.empty();if(w instanceof THREE.RenderableParticle){n=w;n.x*=l;n.y*=-m;q=0;for(o=
-w.materials.length;q<o;)q++}else if(w instanceof THREE.RenderableLine){n=w.v1;k=w.v2;n.positionScreen.x*=l;n.positionScreen.y*=-m;k.positionScreen.x*=l;k.positionScreen.y*=-m;t.addPoint(n.positionScreen.x,n.positionScreen.y);t.addPoint(k.positionScreen.x,k.positionScreen.y);if(B.instersects(t)){q=0;for(o=w.materials.length;q<o;)if((F=w.materials[q++])&&F.opacity!=0){E=n;I=k;var J=Q++;if(A[J]==null){A[J]=document.createElementNS("http://www.w3.org/2000/svg","line");N==0&&A[J].setAttribute("shape-rendering",
-"crispEdges")}s=A[J];s.setAttribute("x1",E.positionScreen.x);s.setAttribute("y1",E.positionScreen.y);s.setAttribute("x2",I.positionScreen.x);s.setAttribute("y2",I.positionScreen.y);if(F instanceof THREE.LineBasicMaterial){x.__styleString=F.color.__styleString;s.setAttribute("style","fill: none; stroke: "+x.__styleString+"; stroke-width: "+F.linewidth+"; stroke-opacity: "+F.opacity+"; stroke-linecap: "+F.linecap+"; stroke-linejoin: "+F.linejoin);i.appendChild(s)}}}}else if(w instanceof THREE.RenderableFace3){n=
-w.v1;k=w.v2;r=w.v3;n.positionScreen.x*=l;n.positionScreen.y*=-m;k.positionScreen.x*=l;k.positionScreen.y*=-m;r.positionScreen.x*=l;r.positionScreen.y*=-m;t.addPoint(n.positionScreen.x,n.positionScreen.y);t.addPoint(k.positionScreen.x,k.positionScreen.y);t.addPoint(r.positionScreen.x,r.positionScreen.y);if(B.instersects(t)){q=0;for(o=w.meshMaterials.length;q<o;){F=w.meshMaterials[q++];if(F instanceof THREE.MeshFaceMaterial){E=0;for(I=w.faceMaterials.length;E<I;)(F=w.faceMaterials[E++])&&F.opacity!=
-0&&b(n,k,r,w,F,v)}else F&&F.opacity!=0&&b(n,k,r,w,F,v)}}}else if(w instanceof THREE.RenderableFace4){n=w.v1;k=w.v2;r=w.v3;u=w.v4;n.positionScreen.x*=l;n.positionScreen.y*=-m;k.positionScreen.x*=l;k.positionScreen.y*=-m;r.positionScreen.x*=l;r.positionScreen.y*=-m;u.positionScreen.x*=l;u.positionScreen.y*=-m;t.addPoint(n.positionScreen.x,n.positionScreen.y);t.addPoint(k.positionScreen.x,k.positionScreen.y);t.addPoint(r.positionScreen.x,r.positionScreen.y);t.addPoint(u.positionScreen.x,u.positionScreen.y);
-if(B.instersects(t)){q=0;for(o=w.meshMaterials.length;q<o;){F=w.meshMaterials[q++];if(F instanceof THREE.MeshFaceMaterial){E=0;for(I=w.faceMaterials.length;E<I;)(F=w.faceMaterials[E++])&&F.opacity!=0&&c(n,k,r,u,w,F,v)}else F&&F.opacity!=0&&c(n,k,r,u,w,F,v)}}}}}};
-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 e,d=c.length;for(e=0;e<d;e++){a=c[e];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.SVGRenderer=function(){function a(v,z,y){var D,q,n,E;D=0;for(q=v.lights.length;D<q;D++){n=v.lights[D];if(n instanceof THREE.DirectionalLight){E=z.normalWorld.dot(n.position)*n.intensity;if(E>0){y.r+=n.color.r*E;y.g+=n.color.g*E;y.b+=n.color.b*E}}else if(n instanceof THREE.PointLight){P.sub(n.position,z.centroidWorld);P.normalize();E=z.normalWorld.dot(P)*n.intensity;if(E>0){y.r+=n.color.r*E;y.g+=n.color.g*E;y.b+=n.color.b*E}}}}function b(v,z,y,D,q,n){s=d(L++);s.setAttribute("d","M "+v.positionScreen.x+
+" "+v.positionScreen.y+" L "+z.positionScreen.x+" "+z.positionScreen.y+" L "+y.positionScreen.x+","+y.positionScreen.y+"z");if(q instanceof THREE.MeshBasicMaterial)x.__styleString=q.color.__styleString;else if(q instanceof THREE.MeshLambertMaterial)if(K){G.r=C.r;G.g=C.g;G.b=C.b;a(n,D,G);x.r=q.color.r*G.r;x.g=q.color.g*G.g;x.b=q.color.b*G.b;x.updateStyleString()}else x.__styleString=q.color.__styleString;else if(q instanceof THREE.MeshDepthMaterial){H=1-q.__2near/(q.__farPlusNear-D.z*q.__farMinusNear);
+x.setRGB(H,H,H)}else q instanceof THREE.MeshNormalMaterial&&x.setRGB(e(D.normalWorld.x),e(D.normalWorld.y),e(D.normalWorld.z));q.wireframe?s.setAttribute("style","fill: none; stroke: "+x.__styleString+"; stroke-width: "+q.wireframeLinewidth+"; stroke-opacity: "+q.opacity+"; stroke-linecap: "+q.wireframeLinecap+"; stroke-linejoin: "+q.wireframeLinejoin):s.setAttribute("style","fill: "+x.__styleString+"; fill-opacity: "+q.opacity);i.appendChild(s)}function c(v,z,y,D,q,n,E){s=d(L++);s.setAttribute("d",
+"M "+v.positionScreen.x+" "+v.positionScreen.y+" L "+z.positionScreen.x+" "+z.positionScreen.y+" L "+y.positionScreen.x+","+y.positionScreen.y+" L "+D.positionScreen.x+","+D.positionScreen.y+"z");if(n instanceof THREE.MeshBasicMaterial)x.__styleString=n.color.__styleString;else if(n instanceof THREE.MeshLambertMaterial)if(K){G.r=C.r;G.g=C.g;G.b=C.b;a(E,q,G);x.r=n.color.r*G.r;x.g=n.color.g*G.g;x.b=n.color.b*G.b;x.updateStyleString()}else x.__styleString=n.color.__styleString;else if(n instanceof THREE.MeshDepthMaterial){H=
+1-n.__2near/(n.__farPlusNear-q.z*n.__farMinusNear);x.setRGB(H,H,H)}else n instanceof THREE.MeshNormalMaterial&&x.setRGB(e(q.normalWorld.x),e(q.normalWorld.y),e(q.normalWorld.z));n.wireframe?s.setAttribute("style","fill: none; stroke: "+x.__styleString+"; stroke-width: "+n.wireframeLinewidth+"; stroke-opacity: "+n.opacity+"; stroke-linecap: "+n.wireframeLinecap+"; stroke-linejoin: "+n.wireframeLinejoin):s.setAttribute("style","fill: "+x.__styleString+"; fill-opacity: "+n.opacity);i.appendChild(s)}
+function d(v){if(M[v]==null){M[v]=document.createElementNS("http://www.w3.org/2000/svg","path");N==0&&M[v].setAttribute("shape-rendering","crispEdges")}return M[v]}function e(v){return v<0?Math.min((1+v)*0.5,0.5):0.5+Math.min(v*0.5,0.5)}var h=null,f=new THREE.Projector,i=document.createElementNS("http://www.w3.org/2000/svg","svg"),g,j,k,m,l,o,r,u,B=new THREE.Rectangle,t=new THREE.Rectangle,K=!1,x=new THREE.Color(16777215),G=new THREE.Color(16777215),C=new THREE.Color(0),p=new THREE.Color(0),O=new THREE.Color(0),
+H,P=new THREE.Vector3,M=[],A=[],s,L,Q,N=1;this.domElement=i;this.autoClear=!0;this.sortObjects=!0;this.sortElements=!0;this.setQuality=function(v){switch(v){case "high":N=1;break;case "low":N=0}};this.setSize=function(v,z){g=v;j=z;k=g/2;m=j/2;i.setAttribute("viewBox",-k+" "+-m+" "+g+" "+j);i.setAttribute("width",g);i.setAttribute("height",j);B.set(-k,-m,k,m)};this.clear=function(){for(;i.childNodes.length>0;)i.removeChild(i.childNodes[0])};this.render=function(v,z){var y,D,q,n,E,I,w,F;this.autoClear&&
+this.clear();h=f.projectScene(v,z,this.sortElements);Q=L=0;if(K=v.lights.length>0){w=v.lights;C.setRGB(0,0,0);p.setRGB(0,0,0);O.setRGB(0,0,0);y=0;for(D=w.length;y<D;y++){q=w[y];n=q.color;if(q instanceof THREE.AmbientLight){C.r+=n.r;C.g+=n.g;C.b+=n.b}else if(q instanceof THREE.DirectionalLight){p.r+=n.r;p.g+=n.g;p.b+=n.b}else if(q instanceof THREE.PointLight){O.r+=n.r;O.g+=n.g;O.b+=n.b}}}y=0;for(D=h.length;y<D;y++){w=h[y];t.empty();if(w instanceof THREE.RenderableParticle){l=w;l.x*=k;l.y*=-m;q=0;for(n=
+w.materials.length;q<n;)q++}else if(w instanceof THREE.RenderableLine){l=w.v1;o=w.v2;l.positionScreen.x*=k;l.positionScreen.y*=-m;o.positionScreen.x*=k;o.positionScreen.y*=-m;t.addPoint(l.positionScreen.x,l.positionScreen.y);t.addPoint(o.positionScreen.x,o.positionScreen.y);if(B.instersects(t)){q=0;for(n=w.materials.length;q<n;)if((F=w.materials[q++])&&F.opacity!=0){E=l;I=o;var J=Q++;if(A[J]==null){A[J]=document.createElementNS("http://www.w3.org/2000/svg","line");N==0&&A[J].setAttribute("shape-rendering",
+"crispEdges")}s=A[J];s.setAttribute("x1",E.positionScreen.x);s.setAttribute("y1",E.positionScreen.y);s.setAttribute("x2",I.positionScreen.x);s.setAttribute("y2",I.positionScreen.y);if(F instanceof THREE.LineBasicMaterial){x.__styleString=F.color.__styleString;s.setAttribute("style","fill: none; stroke: "+x.__styleString+"; stroke-width: "+F.linewidth+"; stroke-opacity: "+F.opacity+"; stroke-linecap: "+F.linecap+"; stroke-linejoin: "+F.linejoin);i.appendChild(s)}}}}else if(w instanceof THREE.RenderableFace3){l=
+w.v1;o=w.v2;r=w.v3;l.positionScreen.x*=k;l.positionScreen.y*=-m;o.positionScreen.x*=k;o.positionScreen.y*=-m;r.positionScreen.x*=k;r.positionScreen.y*=-m;t.addPoint(l.positionScreen.x,l.positionScreen.y);t.addPoint(o.positionScreen.x,o.positionScreen.y);t.addPoint(r.positionScreen.x,r.positionScreen.y);if(B.instersects(t)){q=0;for(n=w.meshMaterials.length;q<n;){F=w.meshMaterials[q++];if(F instanceof THREE.MeshFaceMaterial){E=0;for(I=w.faceMaterials.length;E<I;)(F=w.faceMaterials[E++])&&F.opacity!=
+0&&b(l,o,r,w,F,v)}else F&&F.opacity!=0&&b(l,o,r,w,F,v)}}}else if(w instanceof THREE.RenderableFace4){l=w.v1;o=w.v2;r=w.v3;u=w.v4;l.positionScreen.x*=k;l.positionScreen.y*=-m;o.positionScreen.x*=k;o.positionScreen.y*=-m;r.positionScreen.x*=k;r.positionScreen.y*=-m;u.positionScreen.x*=k;u.positionScreen.y*=-m;t.addPoint(l.positionScreen.x,l.positionScreen.y);t.addPoint(o.positionScreen.x,o.positionScreen.y);t.addPoint(r.positionScreen.x,r.positionScreen.y);t.addPoint(u.positionScreen.x,u.positionScreen.y);
+if(B.instersects(t)){q=0;for(n=w.meshMaterials.length;q<n;){F=w.meshMaterials[q++];if(F instanceof THREE.MeshFaceMaterial){E=0;for(I=w.faceMaterials.length;E<I;)(F=w.faceMaterials[E++])&&F.opacity!=0&&c(l,o,r,u,w,F,v)}else F&&F.opacity!=0&&c(l,o,r,u,w,F,v)}}}}}};
+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.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.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.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
 THREE.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};

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 105 - 122
build/custom/ThreeWebGL.js


+ 7 - 9
examples/webgl_lod.html

@@ -81,12 +81,7 @@
 				light.position.normalize();
 				light.position.normalize();
 				scene.addLight( light );
 				scene.addLight( light );
 
 
-				var material = [
-
-					new THREE.MeshLambertMaterial( { color: 0xffffff } ),
-					new THREE.MeshBasicMaterial( { color: 0xff0000, opacity: 0.5, wireframe: true } )
-
-				];
+				var material = new THREE.MeshLambertMaterial( { color: 0xffffff, wireframe: true } );
 
 
 				var geometry = [
 				var geometry = [
 
 
@@ -99,7 +94,7 @@
 
 
 				var i, j, mesh, lod;
 				var i, j, mesh, lod;
 
 
-				for ( j = 0; j < 1000; j++ ) {
+				for ( j = 0; j < 1000; j ++ ) {
 
 
 					lod = new THREE.LOD();
 					lod = new THREE.LOD();
 
 
@@ -107,6 +102,8 @@
 
 
 						mesh = new THREE.Mesh( geometry[ i ][ 0 ], material );
 						mesh = new THREE.Mesh( geometry[ i ][ 0 ], material );
 						mesh.scale.set( 1.5, 1.5, 1.5 );
 						mesh.scale.set( 1.5, 1.5, 1.5 );
+						mesh.updateMatrix();
+						mesh.matrixAutoUpdate = false;
 						lod.add( mesh, geometry[ i ][ 1 ] );
 						lod.add( mesh, geometry[ i ][ 1 ] );
 
 
 					}
 					}
@@ -114,14 +111,15 @@
 					lod.position.x = 10000 * ( 0.5 - Math.random() );
 					lod.position.x = 10000 * ( 0.5 - Math.random() );
 					lod.position.y =  7500 * ( 0.5 - Math.random() );
 					lod.position.y =  7500 * ( 0.5 - Math.random() );
 					lod.position.z = 10000 * ( 0.5 - Math.random() );
 					lod.position.z = 10000 * ( 0.5 - Math.random() );
-
+					lod.updateMatrix();
+					lod.matrixAutoUpdate = false;
 					scene.addObject( lod );
 					scene.addObject( lod );
 
 
 				}
 				}
 
 
 
 
 
 
-				renderer = new THREE.WebGLRenderer( { antialias: true, clearColor:0x000000, clearAlpha: 1 } );
+				renderer = new THREE.WebGLRenderer( { clearColor:0x000000, clearAlpha: 1 } );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 				renderer.setSize( window.innerWidth, window.innerHeight );
 				renderer.sortObjects = false;
 				renderer.sortObjects = false;
 				container.appendChild( renderer.domElement );
 				container.appendChild( renderer.domElement );

+ 12 - 4
examples/webgl_materials_grass.html

@@ -45,9 +45,9 @@
 				var texture = generateTextureBase();
 				var texture = generateTextureBase();
 				texture.needsUpdate = true;
 				texture.needsUpdate = true;
 
 
-				for ( var i = 0; i < 20; i ++ ) {
+				for ( var i = 0; i < 15; i ++ ) {
 
 
-					mesh = levels[ i ] = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { map: new THREE.Texture( generateTextureLevel( texture ), new THREE.UVMapping(), THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping ) } ) );
+					mesh = levels[ i ] = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { map: new THREE.Texture( generateTextureLevel( texture ), new THREE.UVMapping(), THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping ), depthTest: false } ) );
 					mesh.materials[0].map.needsUpdate = true;
 					mesh.materials[0].map.needsUpdate = true;
 					mesh.rotation.x = - 90 * ( Math.PI / 180 );
 					mesh.rotation.x = - 90 * ( Math.PI / 180 );
 					mesh.position.y = i * 0.25;
 					mesh.position.y = i * 0.25;
@@ -74,13 +74,13 @@
 
 
 					context.fillStyle = 'rgba(0,' + Math.floor( Math.random() * 64 + 32 ) + ',16,1)';
 					context.fillStyle = 'rgba(0,' + Math.floor( Math.random() * 64 + 32 ) + ',16,1)';
 					context.beginPath();
 					context.beginPath();
-					context.arc( Math.random() * canvas.width, Math.random() * canvas.height, Math.random() * 3 + 1, 0, Math.PI * 2, true );
+					context.arc( Math.random() * canvas.width, Math.random() * canvas.height, Math.random() * 2 + 1, 0, Math.PI * 2, true );
 					context.closePath();
 					context.closePath();
 					context.fill();
 					context.fill();
 
 
 				}
 				}
 
 
-				context.globalAlpha = 0.05;
+				context.globalAlpha = 0.075;
 				context.globalCompositeOperation = 'lighter';
 				context.globalCompositeOperation = 'lighter';
 
 
 				return canvas;
 				return canvas;
@@ -117,6 +117,14 @@
 				camera.position.x = 80 * Math.cos( time );
 				camera.position.x = 80 * Math.cos( time );
 				camera.position.z = 80 * Math.sin( time );
 				camera.position.z = 80 * Math.sin( time );
 
 
+				for ( var i = 0, l = levels.length; i < l; i ++ ) {
+
+					mesh = levels[ i ];
+					mesh.position.x = Math.sin( time * 4 ) * i * i * 0.005;
+					mesh.position.z = Math.cos( time * 6 ) * i * i * 0.005;
+
+				}
+
 				renderer.render( scene, camera );
 				renderer.render( scene, camera );
 
 
 			}
 			}

+ 0 - 0
src/animation/Animation.js → src/extras/animation/Animation.js


+ 0 - 0
src/animation/AnimationHandler.js → src/extras/animation/AnimationHandler.js


+ 0 - 0
src/animation/AnimationMorphTarget.js → src/extras/animation/AnimationMorphTarget.js


+ 2 - 10
utils/build.py

@@ -30,8 +30,6 @@ COMMON_FILES = [
 'core/Geometry.js',
 'core/Geometry.js',
 'core/Spline.js',
 'core/Spline.js',
 'core/Edge.js',
 'core/Edge.js',
-'animation/AnimationHandler.js',
-'animation/Animation.js',
 'cameras/Camera.js',
 'cameras/Camera.js',
 'lights/Light.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/AmbientLight.js',
@@ -84,6 +82,8 @@ COMMON_FILES = [
 ]
 ]
 
 
 EXTRAS_FILES = [
 EXTRAS_FILES = [
+'extras/animation/AnimationHandler.js',
+'extras/animation/Animation.js',
 'extras/GeometryUtils.js',
 'extras/GeometryUtils.js',
 'extras/ImageUtils.js',
 'extras/ImageUtils.js',
 'extras/SceneUtils.js',
 'extras/SceneUtils.js',
@@ -124,8 +124,6 @@ CANVAS_FILES = [
 'core/Face4.js',
 'core/Face4.js',
 'core/UV.js',
 'core/UV.js',
 'core/Geometry.js',
 'core/Geometry.js',
-'animation/AnimationHandler.js',
-'animation/Animation.js',
 'cameras/Camera.js',
 'cameras/Camera.js',
 'lights/Light.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/AmbientLight.js',
@@ -176,8 +174,6 @@ DOM_FILES = [
 'core/Face3.js',
 'core/Face3.js',
 'core/Face4.js',
 'core/Face4.js',
 'core/UV.js',
 'core/UV.js',
-'animation/AnimationHandler.js',
-'animation/Animation.js',
 'cameras/Camera.js',
 'cameras/Camera.js',
 'materials/ParticleDOMMaterial.js',
 'materials/ParticleDOMMaterial.js',
 'objects/Particle.js',
 'objects/Particle.js',
@@ -207,8 +203,6 @@ SVG_FILES = [
 'core/Face4.js',
 'core/Face4.js',
 'core/UV.js',
 'core/UV.js',
 'core/Geometry.js',
 'core/Geometry.js',
-'animation/AnimationHandler.js',
-'animation/Animation.js',
 'cameras/Camera.js',
 'cameras/Camera.js',
 'lights/Light.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/AmbientLight.js',
@@ -257,8 +251,6 @@ WEBGL_FILES = [
 'core/Face4.js',
 'core/Face4.js',
 'core/UV.js',
 'core/UV.js',
 'core/Geometry.js',
 'core/Geometry.js',
-'animation/AnimationHandler.js',
-'animation/Animation.js',
 'cameras/Camera.js',
 'cameras/Camera.js',
 'lights/Light.js',
 'lights/Light.js',
 'lights/AmbientLight.js',
 'lights/AmbientLight.js',

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно