Ver código fonte

ColladaLoader: Returning visualScenes[ 'visual_scene0' ] when url is empty.

Mr.doob 13 anos atrás
pai
commit
9541e7f4b8

+ 349 - 349
build/Three.js

@@ -2,7 +2,7 @@
 'use strict';var THREE=THREE||{REVISION:"48dev"};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;
 'use strict';var THREE=THREE||{REVISION:"48dev"};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;
 (function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];if(!window.requestAnimationFrame)window.requestAnimationFrame=function(b){var c=(new Date).getTime(),g=Math.max(0,16-(c-a)),f=window.setTimeout(function(){b(c+g)},g);a=c+g;return f};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
 (function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];if(!window.requestAnimationFrame)window.requestAnimationFrame=function(b){var c=(new Date).getTime(),g=Math.max(0,16-(c-a)),f=window.setTimeout(function(){b(c+g)},g);a=c+g;return f};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
 function(a){clearTimeout(a)}})();THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1};THREE.Clock.prototype.start=function(){this.oldTime=this.startTime=Date.now();this.running=!0};THREE.Clock.prototype.stop=function(){this.getElapsedTime();this.running=!1};THREE.Clock.prototype.getElapsedTime=function(){return this.elapsedTime+=this.getDelta()};
 function(a){clearTimeout(a)}})();THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1};THREE.Clock.prototype.start=function(){this.oldTime=this.startTime=Date.now();this.running=!0};THREE.Clock.prototype.stop=function(){this.getElapsedTime();this.running=!1};THREE.Clock.prototype.getElapsedTime=function(){return this.elapsedTime+=this.getDelta()};
-THREE.Clock.prototype.getDelta=function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=Date.now(),a=0.0010*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a};THREE.Color=function(a){void 0!==a&&this.setHex(a);return this};
+THREE.Clock.prototype.getDelta=function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=Date.now(),a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a};THREE.Color=function(a){void 0!==a&&this.setHex(a);return this};
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);
 THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);
 this.b=Math.sqrt(this.b);return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,g;if(0===c)this.r=this.g=this.b=0;else switch(d=Math.floor(6*a),e=6*a-d,a=c*(1-b),g=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=
 this.b=Math.sqrt(this.b);return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,g;if(0===c)this.r=this.g=this.b=0;else switch(d=Math.floor(6*a),e=6*a-d,a=c*(1-b),g=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=
 Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return Math.floor(255*this.r)<<16^Math.floor(255*this.g)<<8^Math.floor(255*this.b)},getContextStyle:function(){return"rgb("+Math.floor(255*this.r)+","+Math.floor(255*this.g)+","+Math.floor(255*this.b)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
 Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return Math.floor(255*this.r)<<16^Math.floor(255*this.g)<<8^Math.floor(255*this.b)},getContextStyle:function(){return"rgb("+Math.floor(255*this.r)+","+Math.floor(255*this.g)+","+Math.floor(255*this.b)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
@@ -19,68 +19,68 @@ this.z=a.z-b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.
 normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]};
 normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]};
 THREE.Frustum.prototype.setFromMatrix=function(a){var b,c=this.planes;c[0].set(a.n41-a.n11,a.n42-a.n12,a.n43-a.n13,a.n44-a.n14);c[1].set(a.n41+a.n11,a.n42+a.n12,a.n43+a.n13,a.n44+a.n14);c[2].set(a.n41+a.n21,a.n42+a.n22,a.n43+a.n23,a.n44+a.n24);c[3].set(a.n41-a.n21,a.n42-a.n22,a.n43-a.n23,a.n44-a.n24);c[4].set(a.n41-a.n31,a.n42-a.n32,a.n43-a.n33,a.n44-a.n34);c[5].set(a.n41+a.n31,a.n42+a.n32,a.n43+a.n33,a.n44+a.n34);for(a=0;6>a;a++)b=c[a],b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))};
 THREE.Frustum.prototype.setFromMatrix=function(a){var b,c=this.planes;c[0].set(a.n41-a.n11,a.n42-a.n12,a.n43-a.n13,a.n44-a.n14);c[1].set(a.n41+a.n11,a.n42+a.n12,a.n43+a.n13,a.n44+a.n14);c[2].set(a.n41+a.n21,a.n42+a.n22,a.n43+a.n23,a.n44+a.n24);c[3].set(a.n41-a.n21,a.n42-a.n22,a.n43-a.n23,a.n44-a.n24);c[4].set(a.n41-a.n31,a.n42-a.n32,a.n43-a.n33,a.n44-a.n34);c[5].set(a.n41+a.n31,a.n42+a.n32,a.n43+a.n33,a.n44+a.n34);for(a=0;6>a;a++)b=c[a],b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))};
 THREE.Frustum.prototype.contains=function(a){for(var b=this.planes,c=a.matrixWorld,d=THREE.Frustum.__v1.set(c.getColumnX().length(),c.getColumnY().length(),c.getColumnZ().length()),d=-a.geometry.boundingSphere.radius*Math.max(d.x,Math.max(d.y,d.z)),e=0;6>e;e++)if(a=b[e].x*c.n14+b[e].y*c.n24+b[e].z*c.n34+b[e].w,a<=d)return!1;return!0};THREE.Frustum.__v1=new THREE.Vector3;
 THREE.Frustum.prototype.contains=function(a){for(var b=this.planes,c=a.matrixWorld,d=THREE.Frustum.__v1.set(c.getColumnX().length(),c.getColumnY().length(),c.getColumnZ().length()),d=-a.geometry.boundingSphere.radius*Math.max(d.x,Math.max(d.y,d.z)),e=0;6>e;e++)if(a=b[e].x*c.n14+b[e].y*c.n24+b[e].z*c.n34+b[e].w,a<=d)return!1;return!0};THREE.Frustum.__v1=new THREE.Vector3;
-THREE.Ray=function(a,b){function c(a,b,c){o.sub(c,a);r=o.dot(b);s=q.add(a,m.copy(b).multiplyScalar(r));return t=c.distanceTo(s)}function d(a,b,c,d){o.sub(d,b);q.sub(c,b);m.sub(a,b);w=o.dot(o);u=o.dot(q);v=o.dot(m);y=q.dot(q);D=q.dot(m);A=1/(w*y-u*u);C=(y*v-u*D)*A;E=(w*D-u*v)*A;return 0<=C&&0<=E&&1>C+E}this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;this.intersectObjects=function(a){var b,c,d=[];for(b=0,c=a.length;b<c;b++)Array.prototype.push.apply(d,this.intersectObject(a[b]));
-d.sort(function(a,b){return a.distance-b.distance});return d};var e=new THREE.Vector3,g=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,i=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3;this.intersectObject=function(a){var b,m=[];if(a instanceof THREE.Particle){var o=c(this.origin,this.direction,a.matrixWorld.getPosition());if(o>a.scale.x)return[];b={distance:o,point:a.position,face:null,object:a};m.push(b)}else if(a instanceof THREE.Mesh){var o=
-c(this.origin,this.direction,a.matrixWorld.getPosition()),q=THREE.Frustum.__v1.set(a.matrixWorld.getColumnX().length(),a.matrixWorld.getColumnY().length(),a.matrixWorld.getColumnZ().length());if(o>a.geometry.boundingSphere.radius*Math.max(q.x,Math.max(q.y,q.z)))return m;var r,s,j=a.geometry,t=j.vertices,u;a.matrixRotationWorld.extractRotation(a.matrixWorld);for(o=0,q=j.faces.length;o<q;o++)if(b=j.faces[o],i.copy(this.origin),k.copy(this.direction),u=a.matrixWorld,l=u.multiplyVector3(l.copy(b.centroid)).subSelf(i),
-p=a.matrixRotationWorld.multiplyVector3(p.copy(b.normal)),r=k.dot(p),!(1.0E-4>Math.abs(r))&&(s=p.dot(l)/r,!(0>s)&&(a.doubleSided||(a.flipSided?0<r:0>r))))if(n.add(i,k.multiplyScalar(s)),b instanceof THREE.Face3)e=u.multiplyVector3(e.copy(t[b.a].position)),g=u.multiplyVector3(g.copy(t[b.b].position)),f=u.multiplyVector3(f.copy(t[b.c].position)),d(n,e,g,f)&&(b={distance:i.distanceTo(n),point:n.clone(),face:b,object:a},m.push(b));else if(b instanceof THREE.Face4&&(e=u.multiplyVector3(e.copy(t[b.a].position)),
-g=u.multiplyVector3(g.copy(t[b.b].position)),f=u.multiplyVector3(f.copy(t[b.c].position)),h=u.multiplyVector3(h.copy(t[b.d].position)),d(n,e,g,h)||d(n,g,f,h)))b={distance:i.distanceTo(n),point:n.clone(),face:b,object:a},m.push(b)}return m};var o=new THREE.Vector3,q=new THREE.Vector3,m=new THREE.Vector3,r,s,t,w,u,v,y,D,A,C,E};
-THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return f};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(g,f,l,p){h=!1;b=g;c=f;d=l;e=p;a()};this.addPoint=function(g,f){h?(h=!1,b=g,c=f,d=g,e=f):(b=b<g?b:g,c=c<f?c:f,d=d>g?d:g,e=e>f?e:f);a()};this.add3Points=
-function(g,f,l,p,n,o){h?(h=!1,b=g<l?g<n?g:n:l<n?l:n,c=f<p?f<o?f:o:p<o?p:o,d=g>l?g>n?g:n:l>n?l:n,e=f>p?f>o?f:o:p>o?p:o):(b=g<l?g<n?g<b?g:b:n<b?n:b:l<n?l<b?l:b:n<b?n:b,c=f<p?f<o?f<c?f:c:o<c?o:c:p<o?p<c?p:c:o<c?o:c,d=g>l?g>n?g>d?g:d:n>d?n:d:l>n?l>d?l:d:n>d?n:d,e=f>p?f>o?f>e?f:e:o>e?o:e:p>o?p>e?p:e:o>e?o:e);a()};this.addRectangle=function(g){h?(h=!1,b=g.getLeft(),c=g.getTop(),d=g.getRight(),e=g.getBottom()):(b=b<g.getLeft()?b:g.getLeft(),c=c<g.getTop()?c:g.getTop(),d=d>g.getRight()?d:g.getRight(),e=e>
+THREE.Ray=function(a,b){function c(a,b,c){o.sub(c,a);r=o.dot(b);s=q.add(a,m.copy(b).multiplyScalar(r));return t=c.distanceTo(s)}function d(a,b,c,d){o.sub(d,b);q.sub(c,b);m.sub(a,b);w=o.dot(o);u=o.dot(q);v=o.dot(m);y=q.dot(q);C=q.dot(m);A=1/(w*y-u*u);B=(y*v-u*C)*A;D=(w*C-u*v)*A;return 0<=B&&0<=D&&1>B+D}this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;this.intersectObjects=function(a){var b,c,d=[];for(b=0,c=a.length;b<c;b++)Array.prototype.push.apply(d,this.intersectObject(a[b]));
+d.sort(function(a,b){return a.distance-b.distance});return d};var e=new THREE.Vector3,g=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,i=new THREE.Vector3,l=new THREE.Vector3,k=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3;this.intersectObject=function(a){var b,m=[];if(a instanceof THREE.Particle){var o=c(this.origin,this.direction,a.matrixWorld.getPosition());if(o>a.scale.x)return[];b={distance:o,point:a.position,face:null,object:a};m.push(b)}else if(a instanceof THREE.Mesh){var o=
+c(this.origin,this.direction,a.matrixWorld.getPosition()),q=THREE.Frustum.__v1.set(a.matrixWorld.getColumnX().length(),a.matrixWorld.getColumnY().length(),a.matrixWorld.getColumnZ().length());if(o>a.geometry.boundingSphere.radius*Math.max(q.x,Math.max(q.y,q.z)))return m;var r,s,j=a.geometry,t=j.vertices,u;a.matrixRotationWorld.extractRotation(a.matrixWorld);for(o=0,q=j.faces.length;o<q;o++)if(b=j.faces[o],i.copy(this.origin),l.copy(this.direction),u=a.matrixWorld,k=u.multiplyVector3(k.copy(b.centroid)).subSelf(i),
+p=a.matrixRotationWorld.multiplyVector3(p.copy(b.normal)),r=l.dot(p),!(1.0E-4>Math.abs(r))&&(s=p.dot(k)/r,!(0>s)&&(a.doubleSided||(a.flipSided?0<r:0>r))))if(n.add(i,l.multiplyScalar(s)),b instanceof THREE.Face3)e=u.multiplyVector3(e.copy(t[b.a].position)),g=u.multiplyVector3(g.copy(t[b.b].position)),f=u.multiplyVector3(f.copy(t[b.c].position)),d(n,e,g,f)&&(b={distance:i.distanceTo(n),point:n.clone(),face:b,object:a},m.push(b));else if(b instanceof THREE.Face4&&(e=u.multiplyVector3(e.copy(t[b.a].position)),
+g=u.multiplyVector3(g.copy(t[b.b].position)),f=u.multiplyVector3(f.copy(t[b.c].position)),h=u.multiplyVector3(h.copy(t[b.d].position)),d(n,e,g,h)||d(n,g,f,h)))b={distance:i.distanceTo(n),point:n.clone(),face:b,object:a},m.push(b)}return m};var o=new THREE.Vector3,q=new THREE.Vector3,m=new THREE.Vector3,r,s,t,w,u,v,y,C,A,B,D};
+THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return f};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(g,f,k,p){h=!1;b=g;c=f;d=k;e=p;a()};this.addPoint=function(g,f){h?(h=!1,b=g,c=f,d=g,e=f):(b=b<g?b:g,c=c<f?c:f,d=d>g?d:g,e=e>f?e:f);a()};this.add3Points=
+function(g,f,k,p,n,o){h?(h=!1,b=g<k?g<n?g:n:k<n?k:n,c=f<p?f<o?f:o:p<o?p:o,d=g>k?g>n?g:n:k>n?k:n,e=f>p?f>o?f:o:p>o?p:o):(b=g<k?g<n?g<b?g:b:n<b?n:b:k<n?k<b?k:b:n<b?n:b,c=f<p?f<o?f<c?f:c:o<c?o:c:p<o?p<c?p:c:o<c?o:c,d=g>k?g>n?g>d?g:d:n>d?n:d:k>n?k>d?k:d:n>d?n:d,e=f>p?f>o?f>e?f:e:o>e?o:e:p>o?p>e?p:e:o>e?o:e);a()};this.addRectangle=function(g){h?(h=!1,b=g.getLeft(),c=g.getTop(),d=g.getRight(),e=g.getBottom()):(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.intersects=function(a){return d<a.getLeft()||b>a.getRight()||e<a.getTop()||c>a.getBottom()?!1:!0};this.empty=function(){h=!0;e=d=c=b=0;a()};this.isEmpty=function(){return h}};
 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.intersects=function(a){return d<a.getLeft()||b>a.getRight()||e<a.getTop()||c>a.getBottom()?!1:!0};this.empty=function(){h=!0;e=d=c=b=0;a()};this.isEmpty=function(){return h}};
 THREE.Math={clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(0.5-Math.random())}};THREE.Matrix3=function(){this.m=[]};
 THREE.Math={clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(0.5-Math.random())}};THREE.Matrix3=function(){this.m=[]};
 THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};
 THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};
-THREE.Matrix4=function(a,b,c,d,e,g,f,h,i,k,l,p,n,o,q,m){this.set(void 0!==a?a:1,b||0,c||0,d||0,e||0,void 0!==g?g:1,f||0,h||0,i||0,k||0,void 0!==l?l:1,p||0,n||0,o||0,q||0,void 0!==m?m:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,i,k,l,p,n,o,q,m){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=g;this.n23=f;this.n24=h;this.n31=i;this.n32=k;this.n33=l;this.n34=p;this.n41=n;this.n42=o;this.n43=q;this.n44=m;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
-b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(0===g.length())g.z=1;d.cross(c,g).normalize();0===d.length()&&(g.x+=1.0E-4,d.cross(c,g).normalize());e.cross(g,d).normalize();this.n11=d.x;this.n12=e.x;this.n13=g.x;this.n21=d.y;this.n22=e.y;this.n23=g.y;this.n31=d.z;this.n32=e.z;this.n33=g.z;return this},multiply:function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,i=a.n23,k=a.n24,l=a.n31,p=a.n32,n=a.n33,o=a.n34,q=a.n41,m=a.n42,r=a.n43,
-s=a.n44,t=b.n11,w=b.n12,u=b.n13,v=b.n14,y=b.n21,D=b.n22,A=b.n23,C=b.n24,E=b.n31,J=b.n32,N=b.n33,T=b.n34,K=b.n41,P=b.n42,M=b.n43,H=b.n44;this.n11=c*t+d*y+e*E+g*K;this.n12=c*w+d*D+e*J+g*P;this.n13=c*u+d*A+e*N+g*M;this.n14=c*v+d*C+e*T+g*H;this.n21=f*t+h*y+i*E+k*K;this.n22=f*w+h*D+i*J+k*P;this.n23=f*u+h*A+i*N+k*M;this.n24=f*v+h*C+i*T+k*H;this.n31=l*t+p*y+n*E+o*K;this.n32=l*w+p*D+n*J+o*P;this.n33=l*u+p*A+n*N+o*M;this.n34=l*v+p*C+n*T+o*H;this.n41=q*t+m*y+r*E+s*K;this.n42=q*w+m*D+r*J+s*P;this.n43=q*u+m*
-A+r*N+s*M;this.n44=q*v+m*C+r*T+s*H;return this},multiplySelf:function(a){return this.multiply(this,a)},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},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=
+THREE.Matrix4=function(a,b,c,d,e,g,f,h,i,l,k,p,n,o,q,m){this.set(void 0!==a?a:1,b||0,c||0,d||0,e||0,void 0!==g?g:1,f||0,h||0,i||0,l||0,void 0!==k?k:1,p||0,n||0,o||0,q||0,void 0!==m?m:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,i,l,k,p,n,o,q,m){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=e;this.n22=g;this.n23=f;this.n24=h;this.n31=i;this.n32=l;this.n33=k;this.n34=p;this.n41=n;this.n42=o;this.n43=q;this.n44=m;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
+b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(0===g.length())g.z=1;d.cross(c,g).normalize();0===d.length()&&(g.x+=1.0E-4,d.cross(c,g).normalize());e.cross(g,d).normalize();this.n11=d.x;this.n12=e.x;this.n13=g.x;this.n21=d.y;this.n22=e.y;this.n23=g.y;this.n31=d.z;this.n32=e.z;this.n33=g.z;return this},multiply:function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,i=a.n23,l=a.n24,k=a.n31,p=a.n32,n=a.n33,o=a.n34,q=a.n41,m=a.n42,r=a.n43,
+s=a.n44,t=b.n11,w=b.n12,u=b.n13,v=b.n14,y=b.n21,C=b.n22,A=b.n23,B=b.n24,D=b.n31,J=b.n32,N=b.n33,S=b.n34,K=b.n41,P=b.n42,M=b.n43,H=b.n44;this.n11=c*t+d*y+e*D+g*K;this.n12=c*w+d*C+e*J+g*P;this.n13=c*u+d*A+e*N+g*M;this.n14=c*v+d*B+e*S+g*H;this.n21=f*t+h*y+i*D+l*K;this.n22=f*w+h*C+i*J+l*P;this.n23=f*u+h*A+i*N+l*M;this.n24=f*v+h*B+i*S+l*H;this.n31=k*t+p*y+n*D+o*K;this.n32=k*w+p*C+n*J+o*P;this.n33=k*u+p*A+n*N+o*M;this.n34=k*v+p*B+n*S+o*H;this.n41=q*t+m*y+r*D+s*K;this.n42=q*w+m*C+r*J+s*P;this.n43=q*u+m*
+A+r*N+s*M;this.n44=q*v+m*B+r*S+s*H;return this},multiplySelf:function(a){return this.multiply(this,a)},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},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},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*
 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},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*
 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},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,i=this.n31,k=this.n32,l=this.n33,p=this.n34,n=this.n41,o=this.n42,q=this.n43,m=this.n44;return d*f*k*n-c*h*k*n-d*g*l*n+b*h*l*n+c*g*p*n-b*f*p*n-d*f*i*o+c*h*i*o+d*e*l*o-a*h*l*o-c*e*p*o+a*f*p*o+d*g*i*q-b*h*i*q-d*e*k*q+a*h*k*q+b*e*p*q-a*g*p*q-c*g*i*m+b*f*i*m+c*e*k*m-a*f*k*m-b*e*l*m+a*g*l*m},transpose:function(){var a;
+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},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,d=this.n14,e=this.n21,g=this.n22,f=this.n23,h=this.n24,i=this.n31,l=this.n32,k=this.n33,p=this.n34,n=this.n41,o=this.n42,q=this.n43,m=this.n44;return d*f*l*n-c*h*l*n-d*g*k*n+b*h*k*n+c*g*p*n-b*f*p*n-d*f*i*o+c*h*i*o+d*e*k*o-a*h*k*o-c*e*p*o+a*f*p*o+d*g*i*q-b*h*i*q-d*e*l*q+a*h*l*q+b*e*p*q-a*g*p*q-c*g*i*m+b*f*i*m+c*e*l*m-a*f*l*m-b*e*k*m+a*g*k*m},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.n34=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=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.n34=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.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;
 a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;a[b+15]=this.n44;return a},
 a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;a[b+15]=this.n44;return a},
 setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},
 setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},
-setRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,i=e*g,k=e*f;this.set(i*g+c,i*f-d*h,i*h+d*f,0,i*f+d*h,k*f+c,k*h-d*g,0,i*h-d*f,k*h+d*g,e*h*h+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){return THREE.Matrix4.__v1.set(this.n14,this.n24,this.n34)},getColumnX:function(){return THREE.Matrix4.__v1.set(this.n11,this.n21,this.n31)},getColumnY:function(){return THREE.Matrix4.__v1.set(this.n12,
-this.n22,this.n32)},getColumnZ:function(){return THREE.Matrix4.__v1.set(this.n13,this.n23,this.n33)},getInverse:function(a){var b=a.n11,c=a.n12,d=a.n13,e=a.n14,g=a.n21,f=a.n22,h=a.n23,i=a.n24,k=a.n31,l=a.n32,p=a.n33,n=a.n34,o=a.n41,q=a.n42,m=a.n43,r=a.n44;this.n11=h*n*q-i*p*q+i*l*m-f*n*m-h*l*r+f*p*r;this.n12=e*p*q-d*n*q-e*l*m+c*n*m+d*l*r-c*p*r;this.n13=d*i*q-e*h*q+e*f*m-c*i*m-d*f*r+c*h*r;this.n14=e*h*l-d*i*l-e*f*p+c*i*p+d*f*n-c*h*n;this.n21=i*p*o-h*n*o-i*k*m+g*n*m+h*k*r-g*p*r;this.n22=d*n*o-e*p*o+
-e*k*m-b*n*m-d*k*r+b*p*r;this.n23=e*h*o-d*i*o-e*g*m+b*i*m+d*g*r-b*h*r;this.n24=d*i*k-e*h*k+e*g*p-b*i*p-d*g*n+b*h*n;this.n31=f*n*o-i*l*o+i*k*q-g*n*q-f*k*r+g*l*r;this.n32=e*l*o-c*n*o-e*k*q+b*n*q+c*k*r-b*l*r;this.n33=c*i*o-e*f*o+e*g*q-b*i*q-c*g*r+b*f*r;this.n34=e*f*k-c*i*k-e*g*l+b*i*l+c*g*n-b*f*n;this.n41=h*l*o-f*p*o-h*k*q+g*p*q+f*k*m-g*l*m;this.n42=c*p*o-d*l*o+d*k*q-b*p*q-c*k*m+b*l*m;this.n43=d*f*o-c*h*o-d*g*q+b*h*q+c*g*m-b*f*m;this.n44=c*h*k-d*f*k+d*g*l-b*h*l-c*g*p+b*f*p;this.multiplyScalar(1/a.determinant());
-return this},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);switch(b){case "YXZ":var i=f*h,k=f*e,l=d*h,p=d*e;this.n11=i+p*c;this.n12=l*c-k;this.n13=g*d;this.n21=g*e;this.n22=g*h;this.n23=-c;this.n31=k*c-l;this.n32=p+i*c;this.n33=g*f;break;case "ZXY":i=f*h;k=f*e;l=d*h;p=d*e;this.n11=i-p*c;this.n12=-g*e;this.n13=l+k*c;this.n21=k+l*c;this.n22=g*h;this.n23=p-i*c;this.n31=-g*d;this.n32=c;this.n33=g*f;break;case "ZYX":i=
-g*h;k=g*e;l=c*h;p=c*e;this.n11=f*h;this.n12=l*d-k;this.n13=i*d+p;this.n21=f*e;this.n22=p*d+i;this.n23=k*d-l;this.n31=-d;this.n32=c*f;this.n33=g*f;break;case "YZX":i=g*f;k=g*d;l=c*f;p=c*d;this.n11=f*h;this.n12=p-i*e;this.n13=l*e+k;this.n21=e;this.n22=g*h;this.n23=-c*h;this.n31=-d*h;this.n32=k*e+l;this.n33=i-p*e;break;case "XZY":i=g*f;k=g*d;l=c*f;p=c*d;this.n11=f*h;this.n12=-e;this.n13=d*h;this.n21=i*e+p;this.n22=g*h;this.n23=k*e-l;this.n31=l*e-k;this.n32=c*h;this.n33=p*e+i;break;default:i=g*h,k=g*
-e,l=c*h,p=c*e,this.n11=f*h,this.n12=-f*e,this.n13=d,this.n21=k+l*d,this.n22=i-p*d,this.n23=-c*f,this.n31=p-i*d,this.n32=l+k*d,this.n33=g*f}return this},setRotationFromQuaternion:function(a){var b=a.x,c=a.y,d=a.z,e=a.w,g=b+b,f=c+c,h=d+d,a=b*g,i=b*f,b=b*h,k=c*f,c=c*h,d=d*h,g=e*g,f=e*f,e=e*h;this.n11=1-(k+d);this.n12=i-e;this.n13=b+f;this.n21=i+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+k);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=
+setRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,i=e*g,l=e*f;this.set(i*g+c,i*f-d*h,i*h+d*f,0,i*f+d*h,l*f+c,l*h-d*g,0,i*h-d*f,l*h+d*g,e*h*h+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){return THREE.Matrix4.__v1.set(this.n14,this.n24,this.n34)},getColumnX:function(){return THREE.Matrix4.__v1.set(this.n11,this.n21,this.n31)},getColumnY:function(){return THREE.Matrix4.__v1.set(this.n12,
+this.n22,this.n32)},getColumnZ:function(){return THREE.Matrix4.__v1.set(this.n13,this.n23,this.n33)},getInverse:function(a){var b=a.n11,c=a.n12,d=a.n13,e=a.n14,g=a.n21,f=a.n22,h=a.n23,i=a.n24,l=a.n31,k=a.n32,p=a.n33,n=a.n34,o=a.n41,q=a.n42,m=a.n43,r=a.n44;this.n11=h*n*q-i*p*q+i*k*m-f*n*m-h*k*r+f*p*r;this.n12=e*p*q-d*n*q-e*k*m+c*n*m+d*k*r-c*p*r;this.n13=d*i*q-e*h*q+e*f*m-c*i*m-d*f*r+c*h*r;this.n14=e*h*k-d*i*k-e*f*p+c*i*p+d*f*n-c*h*n;this.n21=i*p*o-h*n*o-i*l*m+g*n*m+h*l*r-g*p*r;this.n22=d*n*o-e*p*o+
+e*l*m-b*n*m-d*l*r+b*p*r;this.n23=e*h*o-d*i*o-e*g*m+b*i*m+d*g*r-b*h*r;this.n24=d*i*l-e*h*l+e*g*p-b*i*p-d*g*n+b*h*n;this.n31=f*n*o-i*k*o+i*l*q-g*n*q-f*l*r+g*k*r;this.n32=e*k*o-c*n*o-e*l*q+b*n*q+c*l*r-b*k*r;this.n33=c*i*o-e*f*o+e*g*q-b*i*q-c*g*r+b*f*r;this.n34=e*f*l-c*i*l-e*g*k+b*i*k+c*g*n-b*f*n;this.n41=h*k*o-f*p*o-h*l*q+g*p*q+f*l*m-g*k*m;this.n42=c*p*o-d*k*o+d*l*q-b*p*q-c*l*m+b*k*m;this.n43=d*f*o-c*h*o-d*g*q+b*h*q+c*g*m-b*f*m;this.n44=c*h*l-d*f*l+d*g*k-b*h*k-c*g*p+b*f*p;this.multiplyScalar(1/a.determinant());
+return this},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);switch(b){case "YXZ":var i=f*h,l=f*e,k=d*h,p=d*e;this.n11=i+p*c;this.n12=k*c-l;this.n13=g*d;this.n21=g*e;this.n22=g*h;this.n23=-c;this.n31=l*c-k;this.n32=p+i*c;this.n33=g*f;break;case "ZXY":i=f*h;l=f*e;k=d*h;p=d*e;this.n11=i-p*c;this.n12=-g*e;this.n13=k+l*c;this.n21=l+k*c;this.n22=g*h;this.n23=p-i*c;this.n31=-g*d;this.n32=c;this.n33=g*f;break;case "ZYX":i=
+g*h;l=g*e;k=c*h;p=c*e;this.n11=f*h;this.n12=k*d-l;this.n13=i*d+p;this.n21=f*e;this.n22=p*d+i;this.n23=l*d-k;this.n31=-d;this.n32=c*f;this.n33=g*f;break;case "YZX":i=g*f;l=g*d;k=c*f;p=c*d;this.n11=f*h;this.n12=p-i*e;this.n13=k*e+l;this.n21=e;this.n22=g*h;this.n23=-c*h;this.n31=-d*h;this.n32=l*e+k;this.n33=i-p*e;break;case "XZY":i=g*f;l=g*d;k=c*f;p=c*d;this.n11=f*h;this.n12=-e;this.n13=d*h;this.n21=i*e+p;this.n22=g*h;this.n23=l*e-k;this.n31=k*e-l;this.n32=c*h;this.n33=p*e+i;break;default:i=g*h,l=g*
+e,k=c*h,p=c*e,this.n11=f*h,this.n12=-f*e,this.n13=d,this.n21=l+k*d,this.n22=i-p*d,this.n23=-c*f,this.n31=p-i*d,this.n32=k+l*d,this.n33=g*f}return this},setRotationFromQuaternion:function(a){var b=a.x,c=a.y,d=a.z,e=a.w,g=b+b,f=c+c,h=d+d,a=b*g,i=b*f,b=b*h,l=c*f,c=c*h,d=d*h,g=e*g,f=e*f,e=e*h;this.n11=1-(l+d);this.n12=i-e;this.n13=b+f;this.n21=i+e;this.n22=1-(a+d);this.n23=c-g;this.n31=b-f;this.n32=c+g;this.n33=1-(a+l);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=
 a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,e=THREE.Matrix4.__m2;d.identity();d.setRotationFromQuaternion(b);e.setScale(c.x,c.y,c.z);this.multiply(d,e);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);e.set(this.n12,this.n22,this.n32);g.set(this.n13,
 a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,e=THREE.Matrix4.__m2;d.identity();d.setRotationFromQuaternion(b);e.setScale(c.x,c.y,c.z);this.multiply(d,e);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,e=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);e.set(this.n12,this.n22,this.n32);g.set(this.n13,
 this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=d.length();c.y=e.length();c.z=g.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=c.x;d.n21/=c.x;d.n31/=c.x;d.n12/=c.y;d.n22/=c.y;d.n32/=c.y;d.n13/=c.z;d.n23/=c.z;d.n33/=c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34;
 this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=d.length();c.y=e.length();c.z=g.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=c.x;d.n21/=c.x;d.n31/=c.x;d.n12/=c.y;d.n22/=c.y;d.n32/=c.y;d.n13/=c.z;d.n23/=c.z;d.n33/=c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34;
 return this},extractRotation:function(a){var b=THREE.Matrix4.__v1,c=1/b.set(a.n11,a.n21,a.n31).length(),d=1/b.set(a.n12,a.n22,a.n32).length(),b=1/b.set(a.n13,a.n23,a.n33).length();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*b;this.n23=a.n23*b;this.n33=a.n33*b;return this},rotateByAxis:function(a,b){if(1===a.x&&0===a.y&&0===a.z)return this.rotateX(b);if(0===a.x&&1===a.y&&0===a.z)return this.rotateY(b);if(0===a.x&&0===a.y&&1===
 return this},extractRotation:function(a){var b=THREE.Matrix4.__v1,c=1/b.set(a.n11,a.n21,a.n31).length(),d=1/b.set(a.n12,a.n22,a.n32).length(),b=1/b.set(a.n13,a.n23,a.n33).length();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*b;this.n23=a.n23*b;this.n33=a.n33*b;return this},rotateByAxis:function(a,b){if(1===a.x&&0===a.y&&0===a.z)return this.rotateX(b);if(0===a.x&&1===a.y&&0===a.z)return this.rotateY(b);if(0===a.x&&0===a.y&&1===
-a.z)return this.rotateZ(b);var c=a.x,d=a.y,e=a.z,g=Math.sqrt(c*c+d*d+e*e),c=c/g,d=d/g,e=e/g,g=c*c,f=d*d,h=e*e,i=Math.cos(b),k=Math.sin(b),l=1-i,p=c*d*l,n=c*e*l,l=d*e*l,c=c*k,o=d*k,k=e*k,e=g+(1-g)*i,g=p+k,d=n-o,p=p-k,f=f+(1-f)*i,k=l+c,n=n+o,l=l-c,h=h+(1-h)*i,i=this.n11,c=this.n21,o=this.n31,q=this.n41,m=this.n12,r=this.n22,s=this.n32,t=this.n42,w=this.n13,u=this.n23,v=this.n33,y=this.n43;this.n11=e*i+g*m+d*w;this.n21=e*c+g*r+d*u;this.n31=e*o+g*s+d*v;this.n41=e*q+g*t+d*y;this.n12=p*i+f*m+k*w;this.n22=
-p*c+f*r+k*u;this.n32=p*o+f*s+k*v;this.n42=p*q+f*t+k*y;this.n13=n*i+l*m+h*w;this.n23=n*c+l*r+h*u;this.n33=n*o+l*s+h*v;this.n43=n*q+l*t+h*y;return this},rotateX:function(a){var b=this.n12,c=this.n22,d=this.n32,e=this.n42,g=this.n13,f=this.n23,h=this.n33,i=this.n43,k=Math.cos(a),a=Math.sin(a);this.n12=k*b+a*g;this.n22=k*c+a*f;this.n32=k*d+a*h;this.n42=k*e+a*i;this.n13=k*g-a*b;this.n23=k*f-a*c;this.n33=k*h-a*d;this.n43=k*i-a*e;return this},rotateY:function(a){var b=this.n11,c=this.n21,d=this.n31,e=this.n41,
-g=this.n13,f=this.n23,h=this.n33,i=this.n43,k=Math.cos(a),a=Math.sin(a);this.n11=k*b-a*g;this.n21=k*c-a*f;this.n31=k*d-a*h;this.n41=k*e-a*i;this.n13=k*g+a*b;this.n23=k*f+a*c;this.n33=k*h+a*d;this.n43=k*i+a*e;return this},rotateZ:function(a){var b=this.n11,c=this.n21,d=this.n31,e=this.n41,g=this.n12,f=this.n22,h=this.n32,i=this.n42,k=Math.cos(a),a=Math.sin(a);this.n11=k*b+a*g;this.n21=k*c+a*f;this.n31=k*d+a*h;this.n41=k*e+a*i;this.n12=k*g-a*b;this.n22=k*f-a*c;this.n32=k*h-a*d;this.n42=k*i-a*e;return this},
+a.z)return this.rotateZ(b);var c=a.x,d=a.y,e=a.z,g=Math.sqrt(c*c+d*d+e*e),c=c/g,d=d/g,e=e/g,g=c*c,f=d*d,h=e*e,i=Math.cos(b),l=Math.sin(b),k=1-i,p=c*d*k,n=c*e*k,k=d*e*k,c=c*l,o=d*l,l=e*l,e=g+(1-g)*i,g=p+l,d=n-o,p=p-l,f=f+(1-f)*i,l=k+c,n=n+o,k=k-c,h=h+(1-h)*i,i=this.n11,c=this.n21,o=this.n31,q=this.n41,m=this.n12,r=this.n22,s=this.n32,t=this.n42,w=this.n13,u=this.n23,v=this.n33,y=this.n43;this.n11=e*i+g*m+d*w;this.n21=e*c+g*r+d*u;this.n31=e*o+g*s+d*v;this.n41=e*q+g*t+d*y;this.n12=p*i+f*m+l*w;this.n22=
+p*c+f*r+l*u;this.n32=p*o+f*s+l*v;this.n42=p*q+f*t+l*y;this.n13=n*i+k*m+h*w;this.n23=n*c+k*r+h*u;this.n33=n*o+k*s+h*v;this.n43=n*q+k*t+h*y;return this},rotateX:function(a){var b=this.n12,c=this.n22,d=this.n32,e=this.n42,g=this.n13,f=this.n23,h=this.n33,i=this.n43,l=Math.cos(a),a=Math.sin(a);this.n12=l*b+a*g;this.n22=l*c+a*f;this.n32=l*d+a*h;this.n42=l*e+a*i;this.n13=l*g-a*b;this.n23=l*f-a*c;this.n33=l*h-a*d;this.n43=l*i-a*e;return this},rotateY:function(a){var b=this.n11,c=this.n21,d=this.n31,e=this.n41,
+g=this.n13,f=this.n23,h=this.n33,i=this.n43,l=Math.cos(a),a=Math.sin(a);this.n11=l*b-a*g;this.n21=l*c-a*f;this.n31=l*d-a*h;this.n41=l*e-a*i;this.n13=l*g+a*b;this.n23=l*f+a*c;this.n33=l*h+a*d;this.n43=l*i+a*e;return this},rotateZ:function(a){var b=this.n11,c=this.n21,d=this.n31,e=this.n41,g=this.n12,f=this.n22,h=this.n32,i=this.n42,l=Math.cos(a),a=Math.sin(a);this.n11=l*b+a*g;this.n21=l*c+a*f;this.n31=l*d+a*h;this.n41=l*e+a*i;this.n12=l*g-a*b;this.n22=l*f-a*c;this.n32=l*h-a*d;this.n42=l*i-a*e;return this},
 translate:function(a){var b=a.x,c=a.y,a=a.z;this.n14=this.n11*b+this.n12*c+this.n13*a+this.n14;this.n24=this.n21*b+this.n22*c+this.n23*a+this.n24;this.n34=this.n31*b+this.n32*c+this.n33*a+this.n34;this.n44=this.n41*b+this.n42*c+this.n43*a+this.n44;return this}};
 translate:function(a){var b=a.x,c=a.y,a=a.z;this.n14=this.n11*b+this.n12*c+this.n13*a+this.n14;this.n24=this.n21*b+this.n22*c+this.n23*a+this.n24;this.n34=this.n31*b+this.n32*c+this.n33*a+this.n34;this.n44=this.n41*b+this.n42*c+this.n43*a+this.n44;return this}};
-THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,i=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,l=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*k;if(0===a)return null;a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*g;c[3]=a*f;c[4]=a*h;c[5]=a*i;c[6]=a*k;c[7]=a*l;c[8]=a*p;return b};
+THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,i=-a.n32*a.n11+a.n31*a.n12,l=a.n23*a.n12-a.n22*a.n13,k=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*l;if(0===a)return null;a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*g;c[3]=a*f;c[4]=a*h;c[5]=a*i;c[6]=a*l;c[7]=a*k;c[8]=a*p;return b};
 THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=2*e/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*e/(d-c);f.n23=(d+c)/(d-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+e)/(g-e);f.n34=-2*g*e/(g-e);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,d){var e,a=c*Math.tan(a*Math.PI/360);e=-a;return THREE.Matrix4.makeFrustum(e*b,a*b,e,a,c,d)};
 THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=2*e/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*e/(d-c);f.n23=(d+c)/(d-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+e)/(g-e);f.n34=-2*g*e/(g-e);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,d){var e,a=c*Math.tan(a*Math.PI/360);e=-a;return THREE.Matrix4.makeFrustum(e*b,a*b,e,a,c,d)};
-THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,i,k;f=new THREE.Matrix4;h=b-a;i=c-d;k=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/i;f.n23=0;f.n24=-((c+d)/i);f.n31=0;f.n32=0;f.n33=-2/k;f.n34=-((g+e)/k);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
+THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,i,l;f=new THREE.Matrix4;h=b-a;i=c-d;l=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/i;f.n23=0;f.n24=-((c+d)/i);f.n31=0;f.n32=0;f.n33=-2/l;f.n34=-((g+e)/l);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
 THREE.Object3D=function(){this.id=THREE.Object3DCount++;this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
 THREE.Object3D=function(){this.id=THREE.Object3DCount++;this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
 !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
 !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
 THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(a===
 THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(a===
 this)console.warn("THREE: Object3D.add(): An object can't be added as a child of itself.");else if(-1===this.children.indexOf(a)){void 0!==a.parent&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;void 0!==b.parent;)b=b.parent;void 0!==b&&b instanceof THREE.Scene&&b.addObject(a)}},remove:function(a){var b=this.children.indexOf(a);if(-1!==b){a.parent=void 0;this.children.splice(b,1);for(b=this;void 0!==b.parent;)b=b.parent;void 0!==b&&b instanceof THREE.Scene&&b.removeObject(a)}},
 this)console.warn("THREE: Object3D.add(): An object can't be added as a child of itself.");else if(-1===this.children.indexOf(a)){void 0!==a.parent&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;void 0!==b.parent;)b=b.parent;void 0!==b&&b instanceof THREE.Scene&&b.addObject(a)}},remove:function(a){var b=this.children.indexOf(a);if(-1!==b){a.parent=void 0;this.children.splice(b,1);for(b=this;void 0!==b.parent;)b=b.parent;void 0!==b&&b instanceof THREE.Scene&&b.removeObject(a)}},
 getChildByName:function(a,b){var c,d,e;for(c=0,d=this.children.length;c<d;c++){e=this.children[c];if(e.name===a||b&&(e=e.getChildByName(a,b),void 0!==e))return e}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(1!==this.scale.x||1!==this.scale.y||1!==this.scale.z)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,
 getChildByName:function(a,b){var c,d,e;for(c=0,d=this.children.length;c<d;c++){e=this.children[c];if(e.name===a||b&&(e=e.getChildByName(a,b),void 0!==e))return e}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(1!==this.scale.x||1!==this.scale.y||1!==this.scale.z)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,
 this.scale.z));this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)}};THREE.Object3DCount=0;
 this.scale.z));this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)}};THREE.Object3DCount=0;
-THREE.Projector=function(){function a(){var a=f[g]=f[g]||new THREE.RenderableObject;g++;return a}function b(){var a=k[i]=k[i]||new THREE.RenderableVertex;i++;return a}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,e=a.z+a.w,g=b.z+b.w,f=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=g&&0<=f&&0<=h)return!0;if(0>e&&0>g||0>f&&0>h)return!1;0>e?c=Math.max(c,e/(e-g)):0>g&&(d=Math.min(d,e/(e-g)));0>f?c=Math.max(c,f/(f-h)):0>h&&(d=Math.min(d,f/(f-h)));if(d<c)return!1;a.lerpSelf(b,c);b.lerpSelf(a,1-d);return!0}
-var e,g,f=[],h,i,k=[],l,p,n=[],o,q=[],m,r,s=[],t,w,u=[],v={objects:[],sprites:[],lights:[],elements:[]},y=new THREE.Vector3,D=new THREE.Vector4,A=new THREE.Matrix4,C=new THREE.Matrix4,E=new THREE.Frustum,J=new THREE.Vector4,N=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);A.multiply(b.projectionMatrix,b.matrixWorldInverse);A.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);A.multiply(b.matrixWorld,
-b.projectionMatrixInverse);A.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectGraph=function(b,d){g=0;v.objects.length=0;v.sprites.length=0;v.lights.length=0;var f=function(b){if(!1!==b.visible){(b instanceof THREE.Mesh||b instanceof THREE.Line)&&(!1===b.frustumCulled||E.contains(b))?(A.multiplyVector3(y.copy(b.position)),e=a(),e.object=
-b,e.z=y.z,v.objects.push(e)):b instanceof THREE.Sprite||b instanceof THREE.Particle?(A.multiplyVector3(y.copy(b.position)),e=a(),e.object=b,e.z=y.z,v.sprites.push(e)):b instanceof THREE.Light&&v.lights.push(b);for(var c=0,d=b.children.length;c<d;c++)f(b.children[c])}};f(b);d&&v.objects.sort(c);return v};this.projectScene=function(a,e,g){var f=e.near,H=e.far,j=!1,y,B,F,Z,O,ga,da,ia,S,aa,R,ba,ea,Ua,Ha;w=r=o=p=0;v.elements.length=0;void 0===e.parent&&(console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it..."),
-a.add(e));a.updateMatrixWorld();e.matrixWorldInverse.getInverse(e.matrixWorld);A.multiply(e.projectionMatrix,e.matrixWorldInverse);E.setFromMatrix(A);v=this.projectGraph(a,!1);for(a=0,y=v.objects.length;a<y;a++)if(S=v.objects[a].object,aa=S.matrixWorld,i=0,S instanceof THREE.Mesh){R=S.geometry;ba=S.geometry.materials;Z=R.vertices;ea=R.faces;Ua=R.faceVertexUvs;R=S.matrixRotationWorld.extractRotation(aa);for(B=0,F=Z.length;B<F;B++)h=b(),h.positionWorld.copy(Z[B].position),aa.multiplyVector3(h.positionWorld),
-h.positionScreen.copy(h.positionWorld),A.multiplyVector4(h.positionScreen),h.positionScreen.x/=h.positionScreen.w,h.positionScreen.y/=h.positionScreen.w,h.visible=h.positionScreen.z>f&&h.positionScreen.z<H;for(Z=0,B=ea.length;Z<B;Z++){F=ea[Z];if(F instanceof THREE.Face3)if(O=k[F.a],ga=k[F.b],da=k[F.c],O.visible&&ga.visible&&da.visible)if(j=0>(da.positionScreen.x-O.positionScreen.x)*(ga.positionScreen.y-O.positionScreen.y)-(da.positionScreen.y-O.positionScreen.y)*(ga.positionScreen.x-O.positionScreen.x),
-S.doubleSided||j!=S.flipSided)ia=n[p]=n[p]||new THREE.RenderableFace3,p++,l=ia,l.v1.copy(O),l.v2.copy(ga),l.v3.copy(da);else continue;else continue;else if(F instanceof THREE.Face4)if(O=k[F.a],ga=k[F.b],da=k[F.c],ia=k[F.d],O.visible&&ga.visible&&da.visible&&ia.visible)if(j=0>(ia.positionScreen.x-O.positionScreen.x)*(ga.positionScreen.y-O.positionScreen.y)-(ia.positionScreen.y-O.positionScreen.y)*(ga.positionScreen.x-O.positionScreen.x)||0>(ga.positionScreen.x-da.positionScreen.x)*(ia.positionScreen.y-
-da.positionScreen.y)-(ga.positionScreen.y-da.positionScreen.y)*(ia.positionScreen.x-da.positionScreen.x),S.doubleSided||j!=S.flipSided)Ha=q[o]=q[o]||new THREE.RenderableFace4,o++,l=Ha,l.v1.copy(O),l.v2.copy(ga),l.v3.copy(da),l.v4.copy(ia);else continue;else continue;l.normalWorld.copy(F.normal);!j&&(S.flipSided||S.doubleSided)&&l.normalWorld.negate();R.multiplyVector3(l.normalWorld);l.centroidWorld.copy(F.centroid);aa.multiplyVector3(l.centroidWorld);l.centroidScreen.copy(l.centroidWorld);A.multiplyVector3(l.centroidScreen);
-da=F.vertexNormals;for(O=0,ga=da.length;O<ga;O++)ia=l.vertexNormalsWorld[O],ia.copy(da[O]),!j&&(S.flipSided||S.doubleSided)&&ia.negate(),R.multiplyVector3(ia);for(O=0,ga=Ua.length;O<ga;O++)if(Ha=Ua[O][Z])for(da=0,ia=Ha.length;da<ia;da++)l.uvs[O][da]=Ha[da];l.material=S.material;l.faceMaterial=null!==F.materialIndex?ba[F.materialIndex]:null;l.z=l.centroidScreen.z;v.elements.push(l)}}else if(S instanceof THREE.Line){C.multiply(A,aa);Z=S.geometry.vertices;O=b();O.positionScreen.copy(Z[0].position);C.multiplyVector4(O.positionScreen);
-for(B=1,F=Z.length;B<F;B++)if(O=b(),O.positionScreen.copy(Z[B].position),C.multiplyVector4(O.positionScreen),ga=k[i-2],J.copy(O.positionScreen),N.copy(ga.positionScreen),d(J,N))J.multiplyScalar(1/J.w),N.multiplyScalar(1/N.w),aa=s[r]=s[r]||new THREE.RenderableLine,r++,m=aa,m.v1.positionScreen.copy(J),m.v2.positionScreen.copy(N),m.z=Math.max(J.z,N.z),m.material=S.material,v.elements.push(m)}for(a=0,y=v.sprites.length;a<y;a++)if(S=v.sprites[a].object,aa=S.matrixWorld,S instanceof THREE.Particle&&(D.set(aa.n14,
-aa.n24,aa.n34,1),A.multiplyVector4(D),D.z/=D.w,0<D.z&&1>D.z))f=u[w]=u[w]||new THREE.RenderableParticle,w++,t=f,t.x=D.x/D.w,t.y=D.y/D.w,t.z=D.z,t.rotation=S.rotation.z,t.scale.x=S.scale.x*Math.abs(t.x-(D.x+e.projectionMatrix.n11)/(D.w+e.projectionMatrix.n14)),t.scale.y=S.scale.y*Math.abs(t.y-(D.y+e.projectionMatrix.n22)/(D.w+e.projectionMatrix.n24)),t.material=S.material,v.elements.push(t);g&&v.elements.sort(c);return v}};
+THREE.Projector=function(){function a(){var a=f[g]=f[g]||new THREE.RenderableObject;g++;return a}function b(){var a=l[i]=l[i]||new THREE.RenderableVertex;i++;return a}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,e=a.z+a.w,g=b.z+b.w,f=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=g&&0<=f&&0<=h)return!0;if(0>e&&0>g||0>f&&0>h)return!1;0>e?c=Math.max(c,e/(e-g)):0>g&&(d=Math.min(d,e/(e-g)));0>f?c=Math.max(c,f/(f-h)):0>h&&(d=Math.min(d,f/(f-h)));if(d<c)return!1;a.lerpSelf(b,c);b.lerpSelf(a,1-d);return!0}
+var e,g,f=[],h,i,l=[],k,p,n=[],o,q=[],m,r,s=[],t,w,u=[],v={objects:[],sprites:[],lights:[],elements:[]},y=new THREE.Vector3,C=new THREE.Vector4,A=new THREE.Matrix4,B=new THREE.Matrix4,D=new THREE.Frustum,J=new THREE.Vector4,N=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);A.multiply(b.projectionMatrix,b.matrixWorldInverse);A.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);A.multiply(b.matrixWorld,
+b.projectionMatrixInverse);A.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectGraph=function(b,d){g=0;v.objects.length=0;v.sprites.length=0;v.lights.length=0;var f=function(b){if(!1!==b.visible){(b instanceof THREE.Mesh||b instanceof THREE.Line)&&(!1===b.frustumCulled||D.contains(b))?(A.multiplyVector3(y.copy(b.position)),e=a(),e.object=
+b,e.z=y.z,v.objects.push(e)):b instanceof THREE.Sprite||b instanceof THREE.Particle?(A.multiplyVector3(y.copy(b.position)),e=a(),e.object=b,e.z=y.z,v.sprites.push(e)):b instanceof THREE.Light&&v.lights.push(b);for(var c=0,d=b.children.length;c<d;c++)f(b.children[c])}};f(b);d&&v.objects.sort(c);return v};this.projectScene=function(a,e,g){var f=e.near,H=e.far,j=!1,y,F,E,Y,O,fa,ca,ha,R,$,Q,aa,da,Ua,Ha;w=r=o=p=0;v.elements.length=0;void 0===e.parent&&(console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it..."),
+a.add(e));a.updateMatrixWorld();e.matrixWorldInverse.getInverse(e.matrixWorld);A.multiply(e.projectionMatrix,e.matrixWorldInverse);D.setFromMatrix(A);v=this.projectGraph(a,!1);for(a=0,y=v.objects.length;a<y;a++)if(R=v.objects[a].object,$=R.matrixWorld,i=0,R instanceof THREE.Mesh){Q=R.geometry;aa=R.geometry.materials;Y=Q.vertices;da=Q.faces;Ua=Q.faceVertexUvs;Q=R.matrixRotationWorld.extractRotation($);for(F=0,E=Y.length;F<E;F++)h=b(),h.positionWorld.copy(Y[F].position),$.multiplyVector3(h.positionWorld),
+h.positionScreen.copy(h.positionWorld),A.multiplyVector4(h.positionScreen),h.positionScreen.x/=h.positionScreen.w,h.positionScreen.y/=h.positionScreen.w,h.visible=h.positionScreen.z>f&&h.positionScreen.z<H;for(Y=0,F=da.length;Y<F;Y++){E=da[Y];if(E instanceof THREE.Face3)if(O=l[E.a],fa=l[E.b],ca=l[E.c],O.visible&&fa.visible&&ca.visible)if(j=0>(ca.positionScreen.x-O.positionScreen.x)*(fa.positionScreen.y-O.positionScreen.y)-(ca.positionScreen.y-O.positionScreen.y)*(fa.positionScreen.x-O.positionScreen.x),
+R.doubleSided||j!=R.flipSided)ha=n[p]=n[p]||new THREE.RenderableFace3,p++,k=ha,k.v1.copy(O),k.v2.copy(fa),k.v3.copy(ca);else continue;else continue;else if(E instanceof THREE.Face4)if(O=l[E.a],fa=l[E.b],ca=l[E.c],ha=l[E.d],O.visible&&fa.visible&&ca.visible&&ha.visible)if(j=0>(ha.positionScreen.x-O.positionScreen.x)*(fa.positionScreen.y-O.positionScreen.y)-(ha.positionScreen.y-O.positionScreen.y)*(fa.positionScreen.x-O.positionScreen.x)||0>(fa.positionScreen.x-ca.positionScreen.x)*(ha.positionScreen.y-
+ca.positionScreen.y)-(fa.positionScreen.y-ca.positionScreen.y)*(ha.positionScreen.x-ca.positionScreen.x),R.doubleSided||j!=R.flipSided)Ha=q[o]=q[o]||new THREE.RenderableFace4,o++,k=Ha,k.v1.copy(O),k.v2.copy(fa),k.v3.copy(ca),k.v4.copy(ha);else continue;else continue;k.normalWorld.copy(E.normal);!j&&(R.flipSided||R.doubleSided)&&k.normalWorld.negate();Q.multiplyVector3(k.normalWorld);k.centroidWorld.copy(E.centroid);$.multiplyVector3(k.centroidWorld);k.centroidScreen.copy(k.centroidWorld);A.multiplyVector3(k.centroidScreen);
+ca=E.vertexNormals;for(O=0,fa=ca.length;O<fa;O++)ha=k.vertexNormalsWorld[O],ha.copy(ca[O]),!j&&(R.flipSided||R.doubleSided)&&ha.negate(),Q.multiplyVector3(ha);for(O=0,fa=Ua.length;O<fa;O++)if(Ha=Ua[O][Y])for(ca=0,ha=Ha.length;ca<ha;ca++)k.uvs[O][ca]=Ha[ca];k.material=R.material;k.faceMaterial=null!==E.materialIndex?aa[E.materialIndex]:null;k.z=k.centroidScreen.z;v.elements.push(k)}}else if(R instanceof THREE.Line){B.multiply(A,$);Y=R.geometry.vertices;O=b();O.positionScreen.copy(Y[0].position);B.multiplyVector4(O.positionScreen);
+for(F=1,E=Y.length;F<E;F++)if(O=b(),O.positionScreen.copy(Y[F].position),B.multiplyVector4(O.positionScreen),fa=l[i-2],J.copy(O.positionScreen),N.copy(fa.positionScreen),d(J,N))J.multiplyScalar(1/J.w),N.multiplyScalar(1/N.w),$=s[r]=s[r]||new THREE.RenderableLine,r++,m=$,m.v1.positionScreen.copy(J),m.v2.positionScreen.copy(N),m.z=Math.max(J.z,N.z),m.material=R.material,v.elements.push(m)}for(a=0,y=v.sprites.length;a<y;a++)if(R=v.sprites[a].object,$=R.matrixWorld,R instanceof THREE.Particle&&(C.set($.n14,
+$.n24,$.n34,1),A.multiplyVector4(C),C.z/=C.w,0<C.z&&1>C.z))f=u[w]=u[w]||new THREE.RenderableParticle,w++,t=f,t.x=C.x/C.w,t.y=C.y/C.w,t.z=C.z,t.rotation=R.rotation.z,t.scale.x=R.scale.x*Math.abs(t.x-(C.x+e.projectionMatrix.n11)/(C.w+e.projectionMatrix.n14)),t.scale.y=R.scale.y*Math.abs(t.y-(C.y+e.projectionMatrix.n22)/(C.w+e.projectionMatrix.n24)),t.material=R.material,v.elements.push(t);g&&v.elements.sort(c);return v}};
 THREE.Quaternion=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1};
 THREE.Quaternion=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1};
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),g=Math.cos(c),c=Math.sin(c),f=a*b,h=d*e;this.w=f*g-h*c;this.x=f*c+h*g;this.y=d*b*g+a*e*c;this.z=a*e*
 THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),g=Math.cos(c),c=Math.sin(c),f=a*b,h=d*e;this.w=f*g-h*c;this.x=f*c+h*g;this.y=d*b*g+a*e*c;this.z=a*e*
 g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=0>a.n32-a.n23?-Math.abs(this.x):Math.abs(this.x);this.y=0>a.n13-a.n31?
 g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=0>a.n32-a.n23?-Math.abs(this.x):Math.abs(this.x);this.y=0>a.n13-a.n31?
 -Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=
 -Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=
 this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=
 this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=
-a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,i=this.w,k=i*c+f*e-h*d,l=i*d+h*c-g*e,p=i*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=k*i+c*-g+l*-h-p*-f;b.y=l*i+c*-f+p*-g-k*-h;b.z=p*i+c*-h+k*-f-l*-g;return b}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),e=Math.sqrt(1-e*e);if(0.0010>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*g)/e;d=Math.sin(d*g)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
+a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,i=this.w,l=i*c+f*e-h*d,k=i*d+h*c-g*e,p=i*e+g*d-f*c,c=-g*c-f*d-h*e;b.x=l*i+c*-g+k*-h-p*-f;b.y=k*i+c*-f+p*-g-l*-h;b.z=p*i+c*-h+l*-f-k*-g;return b}};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),e=Math.sqrt(1-e*e);if(0.001>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*g)/e;d=Math.sin(d*g)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
 THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
 THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
@@ -91,16 +91,16 @@ b,c,d,e,g,f=new THREE.Vector3,h=new THREE.Vector3;for(a=0,b=this.faces.length;a<
 this.faces[a],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{d=this.__tmpVertices;for(a=0,b=this.vertices.length;a<b;a++)d[a].set(0,0,0)}for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal)):c instanceof THREE.Face4&&(d[c.a].addSelf(c.normal),
 this.faces[a],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{d=this.__tmpVertices;for(a=0,b=this.vertices.length;a<b;a++)d[a].set(0,0,0)}for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal)):c instanceof THREE.Face4&&(d[c.a].addSelf(c.normal),
 d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal),d[c.d].addSelf(c.normal));for(a=0,b=this.vertices.length;a<b;a++)d[a].normalize();for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(c.vertexNormals[0].copy(d[c.a]),c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c])):c instanceof THREE.Face4&&(c.vertexNormals[0].copy(d[c.a]),c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c]),c.vertexNormals[3].copy(d[c.d]))},computeMorphNormals:function(){var a,
 d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal),d[c.d].addSelf(c.normal));for(a=0,b=this.vertices.length;a<b;a++)d[a].normalize();for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(c.vertexNormals[0].copy(d[c.a]),c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c])):c instanceof THREE.Face4&&(c.vertexNormals[0].copy(d[c.a]),c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c]),c.vertexNormals[3].copy(d[c.d]))},computeMorphNormals:function(){var a,
 b,c,d,e;for(c=0,d=this.faces.length;c<d;c++){e=this.faces[c];e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone();if(!e.__originalVertexNormals)e.__originalVertexNormals=[];for(a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone()}var g=new THREE.Geometry;g.faces=this.faces;for(a=0,b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]=
 b,c,d,e;for(c=0,d=this.faces.length;c<d;c++){e=this.faces[c];e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone();if(!e.__originalVertexNormals)e.__originalVertexNormals=[];for(a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone()}var g=new THREE.Geometry;g.faces=this.faces;for(a=0,b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]=
-{};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];var f=this.morphNormals[a].faceNormals,h=this.morphNormals[a].vertexNormals,i,k;for(c=0,d=this.faces.length;c<d;c++)e=this.faces[c],i=new THREE.Vector3,k=e instanceof THREE.Face3?{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3}:{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3,d:new THREE.Vector3},f.push(i),h.push(k)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();
-g.computeVertexNormals();for(c=0,d=this.faces.length;c<d;c++)e=this.faces[c],i=f.faceNormals[c],k=f.vertexNormals[c],i.copy(e.normal),e instanceof THREE.Face3?(k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])):(k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2]),k.d.copy(e.vertexNormals[3]))}for(c=0,d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){function a(a,
-b,c,d,e,g,O){h=a.vertices[b].position;i=a.vertices[c].position;k=a.vertices[d].position;l=f[e];p=f[g];n=f[O];o=i.x-h.x;q=k.x-h.x;m=i.y-h.y;r=k.y-h.y;s=i.z-h.z;t=k.z-h.z;w=p.u-l.u;u=n.u-l.u;v=p.v-l.v;y=n.v-l.v;D=1/(w*y-u*v);J.set((y*o-v*q)*D,(y*m-v*r)*D,(y*s-v*t)*D);N.set((w*q-u*o)*D,(w*r-u*m)*D,(w*t-u*s)*D);C[b].addSelf(J);C[c].addSelf(J);C[d].addSelf(J);E[b].addSelf(N);E[c].addSelf(N);E[d].addSelf(N)}var b,c,d,e,g,f,h,i,k,l,p,n,o,q,m,r,s,t,w,u,v,y,D,A,C=[],E=[],J=new THREE.Vector3,N=new THREE.Vector3,
-T=new THREE.Vector3,K=new THREE.Vector3,P=new THREE.Vector3;for(b=0,c=this.vertices.length;b<c;b++)C[b]=new THREE.Vector3,E[b]=new THREE.Vector3;for(b=0,c=this.faces.length;b<c;b++)g=this.faces[b],f=this.faceVertexUvs[0][b],g instanceof THREE.Face3?a(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(a(this,g.a,g.b,g.c,0,1,2),a(this,g.a,g.b,g.d,0,1,3));var M=["a","b","c","d"];for(b=0,c=this.faces.length;b<c;b++){g=this.faces[b];for(d=0;d<g.vertexNormals.length;d++)P.copy(g.vertexNormals[d]),e=g[M[d]],
-A=C[e],T.copy(A),T.subSelf(P.multiplyScalar(P.dot(A))).normalize(),K.cross(g.vertexNormals[d],A),e=K.dot(E[e]),e=0>e?-1:1,g.vertexTangents[d]=new THREE.Vector4(T.x,T.y,T.z,e)}this.hasTangents=!0},computeBoundingBox:function(){if(!this.boundingBox)this.boundingBox={min:new THREE.Vector3,max:new THREE.Vector3};if(0<this.vertices.length){var a;a=this.vertices[0].position;this.boundingBox.min.copy(a);this.boundingBox.max.copy(a);for(var b=this.boundingBox.min,c=this.boundingBox.max,d=1,e=this.vertices.length;d<
+{};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];var f=this.morphNormals[a].faceNormals,h=this.morphNormals[a].vertexNormals,i,l;for(c=0,d=this.faces.length;c<d;c++)e=this.faces[c],i=new THREE.Vector3,l=e instanceof THREE.Face3?{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3}:{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3,d:new THREE.Vector3},f.push(i),h.push(l)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();
+g.computeVertexNormals();for(c=0,d=this.faces.length;c<d;c++)e=this.faces[c],i=f.faceNormals[c],l=f.vertexNormals[c],i.copy(e.normal),e instanceof THREE.Face3?(l.a.copy(e.vertexNormals[0]),l.b.copy(e.vertexNormals[1]),l.c.copy(e.vertexNormals[2])):(l.a.copy(e.vertexNormals[0]),l.b.copy(e.vertexNormals[1]),l.c.copy(e.vertexNormals[2]),l.d.copy(e.vertexNormals[3]))}for(c=0,d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){function a(a,
+b,c,d,e,g,O){h=a.vertices[b].position;i=a.vertices[c].position;l=a.vertices[d].position;k=f[e];p=f[g];n=f[O];o=i.x-h.x;q=l.x-h.x;m=i.y-h.y;r=l.y-h.y;s=i.z-h.z;t=l.z-h.z;w=p.u-k.u;u=n.u-k.u;v=p.v-k.v;y=n.v-k.v;C=1/(w*y-u*v);J.set((y*o-v*q)*C,(y*m-v*r)*C,(y*s-v*t)*C);N.set((w*q-u*o)*C,(w*r-u*m)*C,(w*t-u*s)*C);B[b].addSelf(J);B[c].addSelf(J);B[d].addSelf(J);D[b].addSelf(N);D[c].addSelf(N);D[d].addSelf(N)}var b,c,d,e,g,f,h,i,l,k,p,n,o,q,m,r,s,t,w,u,v,y,C,A,B=[],D=[],J=new THREE.Vector3,N=new THREE.Vector3,
+S=new THREE.Vector3,K=new THREE.Vector3,P=new THREE.Vector3;for(b=0,c=this.vertices.length;b<c;b++)B[b]=new THREE.Vector3,D[b]=new THREE.Vector3;for(b=0,c=this.faces.length;b<c;b++)g=this.faces[b],f=this.faceVertexUvs[0][b],g instanceof THREE.Face3?a(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(a(this,g.a,g.b,g.c,0,1,2),a(this,g.a,g.b,g.d,0,1,3));var M=["a","b","c","d"];for(b=0,c=this.faces.length;b<c;b++){g=this.faces[b];for(d=0;d<g.vertexNormals.length;d++)P.copy(g.vertexNormals[d]),e=g[M[d]],
+A=B[e],S.copy(A),S.subSelf(P.multiplyScalar(P.dot(A))).normalize(),K.cross(g.vertexNormals[d],A),e=K.dot(D[e]),e=0>e?-1:1,g.vertexTangents[d]=new THREE.Vector4(S.x,S.y,S.z,e)}this.hasTangents=!0},computeBoundingBox:function(){if(!this.boundingBox)this.boundingBox={min:new THREE.Vector3,max:new THREE.Vector3};if(0<this.vertices.length){var a;a=this.vertices[0].position;this.boundingBox.min.copy(a);this.boundingBox.max.copy(a);for(var b=this.boundingBox.min,c=this.boundingBox.max,d=1,e=this.vertices.length;d<
 e;d++){a=this.vertices[d].position;if(a.x<b.x)b.x=a.x;else if(a.x>c.x)c.x=a.x;if(a.y<b.y)b.y=a.y;else if(a.y>c.y)c.y=a.y;if(a.z<b.z)b.z=a.z;else if(a.z>c.z)c.z=a.z}}else this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)},computeBoundingSphere:function(){if(!this.boundingSphere)this.boundingSphere={radius:0};for(var a,b=0,c=0,d=this.vertices.length;c<d;c++)a=this.vertices[c].position.length(),a>b&&(b=a);this.boundingSphere.radius=b},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,
 e;d++){a=this.vertices[d].position;if(a.x<b.x)b.x=a.x;else if(a.x>c.x)c.x=a.x;if(a.y<b.y)b.y=a.y;else if(a.y>c.y)c.y=a.y;if(a.z<b.z)b.z=a.z;else if(a.z>c.z)c.z=a.z}}else this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)},computeBoundingSphere:function(){if(!this.boundingSphere)this.boundingSphere={radius:0};for(var a,b=0,c=0,d=this.vertices.length;c<d;c++)a=this.vertices[c].position.length(),a>b&&(b=a);this.boundingSphere.radius=b},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,
 4),g,f;for(g=0,f=this.vertices.length;g<f;g++)d=this.vertices[g].position,d=[Math.round(d.x*e),Math.round(d.y*e),Math.round(d.z*e)].join("_"),void 0===a[d]?(a[d]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[d]];for(g=0,f=this.faces.length;g<f;g++)if(a=this.faces[g],a instanceof THREE.Face3)a.a=c[a.a],a.b=c[a.b],a.c=c[a.c];else if(a instanceof THREE.Face4)a.a=c[a.a],a.b=c[a.b],a.c=c[a.c],a.d=c[a.d];this.vertices=b}};THREE.GeometryCount=0;
 4),g,f;for(g=0,f=this.vertices.length;g<f;g++)d=this.vertices[g].position,d=[Math.round(d.x*e),Math.round(d.y*e),Math.round(d.z*e)].join("_"),void 0===a[d]?(a[d]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[d]];for(g=0,f=this.faces.length;g<f;g++)if(a=this.faces[g],a instanceof THREE.Face3)a.a=c[a.a],a.b=c[a.b],a.c=c[a.c];else if(a instanceof THREE.Face4)a.a=c[a.a],a.b=c[a.b],a.c=c[a.c],a.d=c[a.d];this.vertices=b}};THREE.GeometryCount=0;
-THREE.Spline=function(a){function b(a,b,c,d,e,g,f){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,h,i,k,l,p,n;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;g=Math.floor(e);f=e-g;c[0]=0===g?g:g-1;c[1]=g;c[2]=g>this.points.length-2?g:g+1;c[3]=g>this.points.length-3?g:g+2;k=this.points[c[0]];l=this.points[c[1]];
-p=this.points[c[2]];n=this.points[c[3]];h=f*f;i=f*h;d.x=b(k.x,l.x,p.x,n.x,f,h,i);d.y=b(k.y,l.y,p.y,n.y,f,h,i);d.z=b(k.z,l.z,p.z,n.z,f,h,i);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,g=new THREE.Vector3,f=new THREE.Vector3,h=[],i=0;h[0]=0;a||(a=100);c=this.points.length*a;g.copy(this.points[0]);for(a=1;a<c;a++)b=a/c,d=this.getPoint(b),f.copy(d),i+=f.distanceTo(g),
-g.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=i,e=b);h[h.length]=i;return{chunks:h,total:i}};this.reparametrizeByArcLength=function(a){var b,c,d,e,g,f,h=[],i=new THREE.Vector3,n=this.getLength();h.push(i.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=n.chunks[b]-n.chunks[b-1];f=Math.ceil(a*c/n.total);e=(b-1)/(this.points.length-1);g=b/(this.points.length-1);for(c=1;c<f-1;c++)d=e+c*(1/f)*(g-e),d=this.getPoint(d),h.push(i.copy(d).clone());h.push(i.copy(this.points[b]).clone())}this.points=
+THREE.Spline=function(a){function b(a,b,c,d,e,g,f){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,h,i,l,k,p,n;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;g=Math.floor(e);f=e-g;c[0]=0===g?g:g-1;c[1]=g;c[2]=g>this.points.length-2?g:g+1;c[3]=g>this.points.length-3?g:g+2;l=this.points[c[0]];k=this.points[c[1]];
+p=this.points[c[2]];n=this.points[c[3]];h=f*f;i=f*h;d.x=b(l.x,k.x,p.x,n.x,f,h,i);d.y=b(l.y,k.y,p.y,n.y,f,h,i);d.z=b(l.z,k.z,p.z,n.z,f,h,i);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,g=new THREE.Vector3,f=new THREE.Vector3,h=[],i=0;h[0]=0;a||(a=100);c=this.points.length*a;g.copy(this.points[0]);for(a=1;a<c;a++)b=a/c,d=this.getPoint(b),f.copy(d),i+=f.distanceTo(g),
+g.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=i,e=b);h[h.length]=i;return{chunks:h,total:i}};this.reparametrizeByArcLength=function(a){var b,c,d,e,g,f,h=[],i=new THREE.Vector3,l=this.getLength();h.push(i.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=l.chunks[b]-l.chunks[b-1];f=Math.ceil(a*c/l.total);e=(b-1)/(this.points.length-1);g=b/(this.points.length-1);for(c=1;c<f-1;c++)d=e+c*(1/f)*(g-e),d=this.getPoint(d),h.push(i.copy(d).clone());h.push(i.copy(this.points[b]).clone())}this.points=
 h}};THREE.Edge=function(a,b,c,d){this.vertices=[a,b];this.vertexIndices=[c,d];this.faces=[];this.faceIndices=[]};THREE.Camera=function(){if(arguments.length)return console.warn("DEPRECATED: Camera() is now PerspectiveCamera() or OrthographicCamera()."),new THREE.PerspectiveCamera(arguments[0],arguments[1],arguments[2],arguments[3]);THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};
 h}};THREE.Edge=function(a,b,c,d){this.vertices=[a,b];this.vertexIndices=[c,d];this.faces=[];this.faceIndices=[]};THREE.Camera=function(){if(arguments.length)return console.warn("DEPRECATED: Camera() is now PerspectiveCamera() or OrthographicCamera()."),new THREE.PerspectiveCamera(arguments[0],arguments[1],arguments[2],arguments[3]);THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};
 THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};THREE.OrthographicCamera=function(a,b,c,d,e,g){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==g?g:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;
 THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};THREE.OrthographicCamera=function(a,b,c,d,e,g){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==g?g:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;
 THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;
 THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;
@@ -134,7 +134,7 @@ a.fog?a.fog:!1;this.lights=void 0!==a.lights?a.lights:!1;this.vertexColors=void
 THREE.Texture=function(a,b,c,d,e,g,f,h){this.id=THREE.TextureCount++;this.image=a;this.mapping=void 0!==b?b:new THREE.UVMapping;this.wrapS=void 0!==c?c:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==d?d:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==e?e:THREE.LinearFilter;this.minFilter=void 0!==g?g:THREE.LinearMipMapLinearFilter;this.format=void 0!==f?f:THREE.RGBAFormat;this.type=void 0!==h?h:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.generateMipmaps=
 THREE.Texture=function(a,b,c,d,e,g,f,h){this.id=THREE.TextureCount++;this.image=a;this.mapping=void 0!==b?b:new THREE.UVMapping;this.wrapS=void 0!==c?c:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==d?d:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==e?e:THREE.LinearFilter;this.minFilter=void 0!==g?g:THREE.LinearMipMapLinearFilter;this.format=void 0!==f?f:THREE.RGBAFormat;this.type=void 0!==h?h:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.generateMipmaps=
 !0;this.needsUpdate=!1;this.onUpdate=null};THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter,this.format,this.type);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};
 !0;this.needsUpdate=!1;this.onUpdate=null};THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter,this.format,this.type);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};
 THREE.LatitudeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;
 THREE.LatitudeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;
-THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(a,b,c,d,e,g,f,h,i,k){THREE.Texture.call(this,null,g,f,h,i,k,d,e);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
+THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(a,b,c,d,e,g,f,h,i,l){THREE.Texture.call(this,null,g,f,h,i,l,d,e);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
 THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.image.data,this.image.width,this.image.height,this.format,this.type,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};THREE.Particle=function(a){THREE.Object3D.call(this);this.material=a};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
 THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.image.data,this.image.width,this.image.height,this.format,this.type,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};THREE.Particle=function(a){THREE.Object3D.call(this);this.material=a};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
 THREE.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.sortParticles=!1;if(this.geometry)this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=a.boundingSphere.radius;this.frustumCulled=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;
 THREE.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.sortParticles=!1;if(this.geometry)this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=a.boundingSphere.radius;this.frustumCulled=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;
 THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.type=void 0!==c?c:THREE.LineStrip;this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere())};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
 THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.type=void 0!==c?c:THREE.LineStrip;this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere())};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
@@ -164,47 +164,47 @@ THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=
 THREE.Scene.prototype.addObject=function(a){if(a instanceof THREE.Light)-1===this.lights.indexOf(a)&&this.lights.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&-1===this.objects.indexOf(a)){this.objects.push(a);this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}for(b=0;b<a.children.length;b++)this.addObject(a.children[b])};
 THREE.Scene.prototype.addObject=function(a){if(a instanceof THREE.Light)-1===this.lights.indexOf(a)&&this.lights.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&-1===this.objects.indexOf(a)){this.objects.push(a);this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}for(b=0;b<a.children.length;b++)this.addObject(a.children[b])};
 THREE.Scene.prototype.removeObject=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);-1!==b&&this.lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.objects.indexOf(a),-1!==b&&(this.objects.splice(b,1),this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),-1!==b&&this.__objectsAdded.splice(b,1)));for(b=0;b<a.children.length;b++)this.removeObject(a.children[b])};
 THREE.Scene.prototype.removeObject=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);-1!==b&&this.lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.objects.indexOf(a),-1!==b&&(this.objects.splice(b,1),this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),-1!==b&&this.__objectsAdded.splice(b,1)));for(b=0;b<a.children.length;b++)this.removeObject(a.children[b])};
 THREE.Fog=function(a,b,c){this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};THREE.FogExp2=function(a,b){this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};
 THREE.Fog=function(a,b,c){this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};THREE.FogExp2=function(a,b){this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};
-THREE.DOMRenderer=function(){var a=null,b=new THREE.Projector,c,d,e,g;this.domElement=document.createElement("div");this.setSize=function(a,b){c=a;d=b;e=c/2;g=d/2};this.render=function(c,d){var i,k,l,p,n,o,q,m;a=b.projectScene(c,d);for(i=0,k=a.length;i<k;i++)if(n=a[i],n instanceof THREE.RenderableParticle){q=n.x*e+e;m=n.y*g+g;for(l=0,p=n.material.length;l<p;l++)if(o=n.material[l],o instanceof THREE.ParticleDOMMaterial)o=o.domElement,o.style.left=q+"px",o.style.top=m+"px"}}};
-THREE.CanvasRenderer=function(a){function b(a){if(t!=a)m.globalAlpha=t=a}function c(a){if(w!=a){switch(a){case THREE.NormalBlending:m.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:m.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:m.globalCompositeOperation="darker"}w=a}}function d(a){if(u!=a)m.strokeStyle=u=a}function e(a){if(v!=a)m.fillStyle=v=a}var a=a||{},g=this,f,h,i,k=new THREE.Projector,l=void 0!==a.canvas?a.canvas:document.createElement("canvas"),
-p,n,o,q,m=l.getContext("2d"),r=new THREE.Color(0),s=0,t=1,w=0,u=null,v=null,y=null,D=null,A=null,C,E,J,N,T=new THREE.RenderableVertex,K=new THREE.RenderableVertex,P,M,H,j,Y,B,F,Z,O,ga,da,ia,S=new THREE.Color,aa=new THREE.Color,R=new THREE.Color,ba=new THREE.Color,ea=new THREE.Color,Ua=[],Ha=[],na,Ia,ra,qa,ib,Va,lb,db,Wa,$a,La=new THREE.Rectangle,ta=new THREE.Rectangle,Aa=new THREE.Rectangle,Fa=!1,Ga=new THREE.Color,Xa=new THREE.Color,mb=new THREE.Color,$=new THREE.Vector3,Q,Fb,Uc,eb,pc,Cc,a=16;Q=
-document.createElement("canvas");Q.width=Q.height=2;Fb=Q.getContext("2d");Fb.fillStyle="rgba(0,0,0,1)";Fb.fillRect(0,0,2,2);Uc=Fb.getImageData(0,0,2,2);eb=Uc.data;pc=document.createElement("canvas");pc.width=pc.height=a;Cc=pc.getContext("2d");Cc.translate(-a/2,-a/2);Cc.scale(a,a);a--;this.domElement=l;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setSize=function(a,b){p=a;n=b;o=Math.floor(p/2);q=Math.floor(n/2);l.width=p;l.height=n;La.set(-o,-q,
-o,q);ta.set(-o,-q,o,q);t=1;w=0;A=D=y=v=u=null};this.setClearColor=function(a,b){r.copy(a);s=b;ta.set(-o,-q,o,q)};this.setClearColorHex=function(a,b){r.setHex(a);s=b;ta.set(-o,-q,o,q)};this.clear=function(){m.setTransform(1,0,0,-1,o,q);ta.isEmpty()||(ta.minSelf(La),ta.inflate(2),1>s&&m.clearRect(Math.floor(ta.getX()),Math.floor(ta.getY()),Math.floor(ta.getWidth()),Math.floor(ta.getHeight())),0<s&&(c(THREE.NormalBlending),b(1),e("rgba("+Math.floor(255*r.r)+","+Math.floor(255*r.g)+","+Math.floor(255*
-r.b)+","+s+")"),m.fillRect(Math.floor(ta.getX()),Math.floor(ta.getY()),Math.floor(ta.getWidth()),Math.floor(ta.getHeight()))),ta.empty())};this.render=function(a,n){function l(a){var b,c,d,e;Ga.setRGB(0,0,0);Xa.setRGB(0,0,0);mb.setRGB(0,0,0);for(b=0,c=a.length;b<c;b++)d=a[b],e=d.color,d instanceof THREE.AmbientLight?(Ga.r+=e.r,Ga.g+=e.g,Ga.b+=e.b):d instanceof THREE.DirectionalLight?(Xa.r+=e.r,Xa.g+=e.g,Xa.b+=e.b):d instanceof THREE.PointLight&&(mb.r+=e.r,mb.g+=e.g,mb.b+=e.b)}function p(a,b,c,d){var e,
-g,f,j,h,i;for(e=0,g=a.length;e<g;e++)f=a[e],j=f.color,f instanceof THREE.DirectionalLight?(h=f.matrixWorld.getPosition(),i=c.dot(h),0>=i||(i*=f.intensity,d.r+=j.r*i,d.g+=j.g*i,d.b+=j.b*i)):f instanceof THREE.PointLight&&(h=f.matrixWorld.getPosition(),i=c.dot($.sub(h,b).normalize()),0>=i||(i*=0==f.distance?1:1-Math.min(b.distanceTo(h)/f.distance,1),0!=i&&(i*=f.intensity,d.r+=j.r*i,d.g+=j.g*i,d.b+=j.b*i)))}function r(a,g,f){b(f.opacity);c(f.blending);var $,j,h,i,n,k;if(f instanceof THREE.ParticleBasicMaterial){if(f.map)i=
-f.map.image,n=i.width>>1,k=i.height>>1,f=g.scale.x*o,h=g.scale.y*q,$=f*n,j=h*k,Aa.set(a.x-$,a.y-j,a.x+$,a.y+j),La.intersects(Aa)&&(m.save(),m.translate(a.x,a.y),m.rotate(-g.rotation),m.scale(f,-h),m.translate(-n,-k),m.drawImage(i,0,0),m.restore())}else f instanceof THREE.ParticleCanvasMaterial&&($=g.scale.x*o,j=g.scale.y*q,Aa.set(a.x-$,a.y-j,a.x+$,a.y+j),La.intersects(Aa)&&(d(f.color.getContextStyle()),e(f.color.getContextStyle()),m.save(),m.translate(a.x,a.y),m.rotate(-g.rotation),m.scale($,j),f.program(m),
-m.restore()))}function s(a,e,g,f){b(f.opacity);c(f.blending);m.beginPath();m.moveTo(a.positionScreen.x,a.positionScreen.y);m.lineTo(e.positionScreen.x,e.positionScreen.y);m.closePath();if(f instanceof THREE.LineBasicMaterial){a=f.linewidth;if(y!=a)m.lineWidth=y=a;a=f.linecap;if(D!=a)m.lineCap=D=a;a=f.linejoin;if(A!=a)m.lineJoin=A=a;d(f.color.getContextStyle());m.stroke();Aa.inflate(2*f.linewidth)}}function t(a,d,e,f,h,k,m,Q){g.info.render.vertices+=3;g.info.render.faces++;b(Q.opacity);c(Q.blending);
-P=a.positionScreen.x;M=a.positionScreen.y;H=d.positionScreen.x;j=d.positionScreen.y;Y=e.positionScreen.x;B=e.positionScreen.y;w(P,M,H,j,Y,B);if(Q instanceof THREE.MeshBasicMaterial)if(Q.map)Q.map.mapping instanceof THREE.UVMapping&&(qa=m.uvs[0],Vc(P,M,H,j,Y,B,qa[f].u,qa[f].v,qa[h].u,qa[h].v,qa[k].u,qa[k].v,Q.map));else if(Q.envMap){if(Q.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=n.matrixWorldInverse,$.copy(m.vertexNormalsWorld[f]),ib=0.5*($.x*a.n11+$.y*a.n12+$.z*a.n13)+0.5,Va=0.5*
--($.x*a.n21+$.y*a.n22+$.z*a.n23)+0.5,$.copy(m.vertexNormalsWorld[h]),lb=0.5*($.x*a.n11+$.y*a.n12+$.z*a.n13)+0.5,db=0.5*-($.x*a.n21+$.y*a.n22+$.z*a.n23)+0.5,$.copy(m.vertexNormalsWorld[k]),Wa=0.5*($.x*a.n11+$.y*a.n12+$.z*a.n13)+0.5,$a=0.5*-($.x*a.n21+$.y*a.n22+$.z*a.n23)+0.5,Vc(P,M,H,j,Y,B,ib,Va,lb,db,Wa,$a,Q.envMap)}else Q.wireframe?Mb(Q.color,Q.wireframeLinewidth,Q.wireframeLinecap,Q.wireframeLinejoin):Gb(Q.color);else if(Q instanceof THREE.MeshLambertMaterial)Q.map&&!Q.wireframe&&(Q.map.mapping instanceof
-THREE.UVMapping&&(qa=m.uvs[0],Vc(P,M,H,j,Y,B,qa[f].u,qa[f].v,qa[h].u,qa[h].v,qa[k].u,qa[k].v,Q.map)),c(THREE.SubtractiveBlending)),Fa?!Q.wireframe&&Q.shading==THREE.SmoothShading&&3==m.vertexNormalsWorld.length?(aa.r=R.r=ba.r=Ga.r,aa.g=R.g=ba.g=Ga.g,aa.b=R.b=ba.b=Ga.b,p(i,m.v1.positionWorld,m.vertexNormalsWorld[0],aa),p(i,m.v2.positionWorld,m.vertexNormalsWorld[1],R),p(i,m.v3.positionWorld,m.vertexNormalsWorld[2],ba),aa.r=Math.max(0,Math.min(Q.color.r*aa.r,1)),aa.g=Math.max(0,Math.min(Q.color.g*aa.g,
-1)),aa.b=Math.max(0,Math.min(Q.color.b*aa.b,1)),R.r=Math.max(0,Math.min(Q.color.r*R.r,1)),R.g=Math.max(0,Math.min(Q.color.g*R.g,1)),R.b=Math.max(0,Math.min(Q.color.b*R.b,1)),ba.r=Math.max(0,Math.min(Q.color.r*ba.r,1)),ba.g=Math.max(0,Math.min(Q.color.g*ba.g,1)),ba.b=Math.max(0,Math.min(Q.color.b*ba.b,1)),ea.r=0.5*(R.r+ba.r),ea.g=0.5*(R.g+ba.g),ea.b=0.5*(R.b+ba.b),ra=Dc(aa,R,ba,ea),gc(P,M,H,j,Y,B,0,0,1,0,0,1,ra)):(S.r=Ga.r,S.g=Ga.g,S.b=Ga.b,p(i,m.centroidWorld,m.normalWorld,S),S.r=Math.max(0,Math.min(Q.color.r*
-S.r,1)),S.g=Math.max(0,Math.min(Q.color.g*S.g,1)),S.b=Math.max(0,Math.min(Q.color.b*S.b,1)),Q.wireframe?Mb(S,Q.wireframeLinewidth,Q.wireframeLinecap,Q.wireframeLinejoin):Gb(S)):Q.wireframe?Mb(Q.color,Q.wireframeLinewidth,Q.wireframeLinecap,Q.wireframeLinejoin):Gb(Q.color);else if(Q instanceof THREE.MeshDepthMaterial)na=n.near,Ia=n.far,aa.r=aa.g=aa.b=1-ac(a.positionScreen.z,na,Ia),R.r=R.g=R.b=1-ac(d.positionScreen.z,na,Ia),ba.r=ba.g=ba.b=1-ac(e.positionScreen.z,na,Ia),ea.r=0.5*(R.r+ba.r),ea.g=0.5*
-(R.g+ba.g),ea.b=0.5*(R.b+ba.b),ra=Dc(aa,R,ba,ea),gc(P,M,H,j,Y,B,0,0,1,0,0,1,ra);else if(Q instanceof THREE.MeshNormalMaterial)S.r=hc(m.normalWorld.x),S.g=hc(m.normalWorld.y),S.b=hc(m.normalWorld.z),Q.wireframe?Mb(S,Q.wireframeLinewidth,Q.wireframeLinecap,Q.wireframeLinejoin):Gb(S)}function u(a,d,e,f,$,h,Q,m,k){g.info.render.vertices+=4;g.info.render.faces++;b(m.opacity);c(m.blending);if(m.map||m.envMap)t(a,d,f,0,1,3,Q,m,k),t($,e,h,1,2,3,Q,m,k);else if(P=a.positionScreen.x,M=a.positionScreen.y,H=d.positionScreen.x,
-j=d.positionScreen.y,Y=e.positionScreen.x,B=e.positionScreen.y,F=f.positionScreen.x,Z=f.positionScreen.y,O=$.positionScreen.x,ga=$.positionScreen.y,da=h.positionScreen.x,ia=h.positionScreen.y,m instanceof THREE.MeshBasicMaterial)v(P,M,H,j,Y,B,F,Z),m.wireframe?Mb(m.color,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Gb(m.color);else if(m instanceof THREE.MeshLambertMaterial)Fa?!m.wireframe&&m.shading==THREE.SmoothShading&&4==Q.vertexNormalsWorld.length?(aa.r=R.r=ba.r=ea.r=Ga.r,aa.g=
-R.g=ba.g=ea.g=Ga.g,aa.b=R.b=ba.b=ea.b=Ga.b,p(i,Q.v1.positionWorld,Q.vertexNormalsWorld[0],aa),p(i,Q.v2.positionWorld,Q.vertexNormalsWorld[1],R),p(i,Q.v4.positionWorld,Q.vertexNormalsWorld[3],ba),p(i,Q.v3.positionWorld,Q.vertexNormalsWorld[2],ea),aa.r=Math.max(0,Math.min(m.color.r*aa.r,1)),aa.g=Math.max(0,Math.min(m.color.g*aa.g,1)),aa.b=Math.max(0,Math.min(m.color.b*aa.b,1)),R.r=Math.max(0,Math.min(m.color.r*R.r,1)),R.g=Math.max(0,Math.min(m.color.g*R.g,1)),R.b=Math.max(0,Math.min(m.color.b*R.b,1)),
-ba.r=Math.max(0,Math.min(m.color.r*ba.r,1)),ba.g=Math.max(0,Math.min(m.color.g*ba.g,1)),ba.b=Math.max(0,Math.min(m.color.b*ba.b,1)),ea.r=Math.max(0,Math.min(m.color.r*ea.r,1)),ea.g=Math.max(0,Math.min(m.color.g*ea.g,1)),ea.b=Math.max(0,Math.min(m.color.b*ea.b,1)),ra=Dc(aa,R,ba,ea),w(P,M,H,j,F,Z),gc(P,M,H,j,F,Z,0,0,1,0,0,1,ra),w(O,ga,Y,B,da,ia),gc(O,ga,Y,B,da,ia,1,0,1,1,0,1,ra)):(S.r=Ga.r,S.g=Ga.g,S.b=Ga.b,p(i,Q.centroidWorld,Q.normalWorld,S),S.r=Math.max(0,Math.min(m.color.r*S.r,1)),S.g=Math.max(0,
-Math.min(m.color.g*S.g,1)),S.b=Math.max(0,Math.min(m.color.b*S.b,1)),v(P,M,H,j,Y,B,F,Z),m.wireframe?Mb(S,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Gb(S)):(v(P,M,H,j,Y,B,F,Z),m.wireframe?Mb(m.color,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Gb(m.color));else if(m instanceof THREE.MeshNormalMaterial)S.r=hc(Q.normalWorld.x),S.g=hc(Q.normalWorld.y),S.b=hc(Q.normalWorld.z),v(P,M,H,j,Y,B,F,Z),m.wireframe?Mb(S,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):
-Gb(S);else if(m instanceof THREE.MeshDepthMaterial)na=n.near,Ia=n.far,aa.r=aa.g=aa.b=1-ac(a.positionScreen.z,na,Ia),R.r=R.g=R.b=1-ac(d.positionScreen.z,na,Ia),ba.r=ba.g=ba.b=1-ac(f.positionScreen.z,na,Ia),ea.r=ea.g=ea.b=1-ac(e.positionScreen.z,na,Ia),ra=Dc(aa,R,ba,ea),w(P,M,H,j,F,Z),gc(P,M,H,j,F,Z,0,0,1,0,0,1,ra),w(O,ga,Y,B,da,ia),gc(O,ga,Y,B,da,ia,1,0,1,1,0,1,ra)}function w(a,b,c,d,e,f){m.beginPath();m.moveTo(a,b);m.lineTo(c,d);m.lineTo(e,f);m.lineTo(a,b);m.closePath()}function v(a,b,c,d,e,f,g,$){m.beginPath();
-m.moveTo(a,b);m.lineTo(c,d);m.lineTo(e,f);m.lineTo(g,$);m.lineTo(a,b);m.closePath()}function Mb(a,b,c,e){if(y!=b)m.lineWidth=y=b;if(D!=c)m.lineCap=D=c;if(A!=e)m.lineJoin=A=e;d(a.getContextStyle());m.stroke();Aa.inflate(2*b)}function Gb(a){e(a.getContextStyle());m.fill()}function Vc(a,b,c,d,f,g,$,j,h,i,Q,n,k){if(0!=k.image.width){if(!0==k.needsUpdate||void 0==Ua[k.id]){var l=k.wrapS==THREE.RepeatWrapping,o=k.wrapT==THREE.RepeatWrapping;Ua[k.id]=m.createPattern(k.image,l&&o?"repeat":l&&!o?"repeat-x":
-!l&&o?"repeat-y":"no-repeat");k.needsUpdate=!1}e(Ua[k.id]);var l=k.offset.x/k.repeat.x,o=k.offset.y/k.repeat.y,Fb=k.image.width*k.repeat.x,p=k.image.height*k.repeat.y,$=($+l)*Fb,j=(j+o)*p,c=c-a,d=d-b,f=f-a,g=g-b,h=(h+l)*Fb-$,i=(i+o)*p-j,Q=(Q+l)*Fb-$,n=(n+o)*p-j,l=h*n-Q*i;if(0==l){if(void 0===Ha[k.id])b=document.createElement("canvas"),b.width=k.image.width,b.height=k.image.height,b=b.getContext("2d"),b.drawImage(k.image,0,0),Ha[k.id]=b.getImageData(0,0,k.image.width,k.image.height).data;b=Ha[k.id];
-$=4*(Math.floor($)+Math.floor(j)*k.image.width);S.setRGB(b[$]/255,b[$+1]/255,b[$+2]/255);Gb(S)}else l=1/l,k=(n*c-i*f)*l,i=(n*d-i*g)*l,c=(h*f-Q*c)*l,d=(h*g-Q*d)*l,a=a-k*$-c*j,$=b-i*$-d*j,m.save(),m.transform(k,i,c,d,a,$),m.fill(),m.restore()}}function gc(a,b,c,d,e,f,g,$,j,h,i,Q,k){var n,l;n=k.width-1;l=k.height-1;g*=n;$*=l;c-=a;d-=b;e-=a;f-=b;j=j*n-g;h=h*l-$;i=i*n-g;Q=Q*l-$;l=1/(j*Q-i*h);n=(Q*c-h*e)*l;h=(Q*d-h*f)*l;c=(j*e-i*c)*l;d=(j*f-i*d)*l;a=a-n*g-c*$;b=b-h*g-d*$;m.save();m.transform(n,h,c,d,a,
-b);m.clip();m.drawImage(k,0,0);m.restore()}function Dc(a,b,c,d){var e=~~(255*a.r),f=~~(255*a.g),a=~~(255*a.b),g=~~(255*b.r),$=~~(255*b.g),b=~~(255*b.b),j=~~(255*c.r),h=~~(255*c.g),c=~~(255*c.b),i=~~(255*d.r),m=~~(255*d.g),d=~~(255*d.b);eb[0]=0>e?0:255<e?255:e;eb[1]=0>f?0:255<f?255:f;eb[2]=0>a?0:255<a?255:a;eb[4]=0>g?0:255<g?255:g;eb[5]=0>$?0:255<$?255:$;eb[6]=0>b?0:255<b?255:b;eb[8]=0>j?0:255<j?255:j;eb[9]=0>h?0:255<h?255:h;eb[10]=0>c?0:255<c?255:c;eb[12]=0>i?0:255<i?255:i;eb[13]=0>m?0:255<m?255:
-m;eb[14]=0>d?0:255<d?255:d;Fb.putImageData(Uc,0,0);Cc.drawImage(Q,0,0);return pc}function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function hc(a){a=0.5*(a+1);return 0>a?0:1<a?1:a}function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;0!=e&&(e=1/Math.sqrt(e),c*=e,d*=e,b.x+=c,b.y+=d,a.x-=c,a.y-=d)}var Ec,fd,Pa,jb;this.autoClear?this.clear():m.setTransform(1,0,0,-1,o,q);g.info.render.vertices=0;g.info.render.faces=0;f=k.projectScene(a,n,this.sortElements);h=f.elements;i=f.lights;(Fa=0<i.length)&&l(i);
-for(Ec=0,fd=h.length;Ec<fd;Ec++)if(Pa=h[Ec],jb=Pa.material,jb=jb instanceof THREE.MeshFaceMaterial?Pa.faceMaterial:jb,!(null==jb||0==jb.opacity)){Aa.empty();if(Pa instanceof THREE.RenderableParticle)C=Pa,C.x*=o,C.y*=q,r(C,Pa,jb,a);else if(Pa instanceof THREE.RenderableLine)C=Pa.v1,E=Pa.v2,C.positionScreen.x*=o,C.positionScreen.y*=q,E.positionScreen.x*=o,E.positionScreen.y*=q,Aa.addPoint(C.positionScreen.x,C.positionScreen.y),Aa.addPoint(E.positionScreen.x,E.positionScreen.y),La.intersects(Aa)&&s(C,
-E,Pa,jb,a);else if(Pa instanceof THREE.RenderableFace3)C=Pa.v1,E=Pa.v2,J=Pa.v3,C.positionScreen.x*=o,C.positionScreen.y*=q,E.positionScreen.x*=o,E.positionScreen.y*=q,J.positionScreen.x*=o,J.positionScreen.y*=q,jb.overdraw&&(Nb(C.positionScreen,E.positionScreen),Nb(E.positionScreen,J.positionScreen),Nb(J.positionScreen,C.positionScreen)),Aa.add3Points(C.positionScreen.x,C.positionScreen.y,E.positionScreen.x,E.positionScreen.y,J.positionScreen.x,J.positionScreen.y),La.intersects(Aa)&&t(C,E,J,0,1,2,
-Pa,jb,a);else if(Pa instanceof THREE.RenderableFace4)C=Pa.v1,E=Pa.v2,J=Pa.v3,N=Pa.v4,C.positionScreen.x*=o,C.positionScreen.y*=q,E.positionScreen.x*=o,E.positionScreen.y*=q,J.positionScreen.x*=o,J.positionScreen.y*=q,N.positionScreen.x*=o,N.positionScreen.y*=q,T.positionScreen.copy(E.positionScreen),K.positionScreen.copy(N.positionScreen),jb.overdraw&&(Nb(C.positionScreen,E.positionScreen),Nb(E.positionScreen,N.positionScreen),Nb(N.positionScreen,C.positionScreen),Nb(J.positionScreen,T.positionScreen),
-Nb(J.positionScreen,K.positionScreen)),Aa.addPoint(C.positionScreen.x,C.positionScreen.y),Aa.addPoint(E.positionScreen.x,E.positionScreen.y),Aa.addPoint(J.positionScreen.x,J.positionScreen.y),Aa.addPoint(N.positionScreen.x,N.positionScreen.y),La.intersects(Aa)&&u(C,E,J,N,T,K,Pa,jb,a);ta.addRectangle(Aa)}m.setTransform(1,0,0,1,0,0)}};
-THREE.SVGRenderer=function(){function a(a,b,c,d){var e,f,g,h,i,m;for(e=0,f=a.length;e<f;e++)g=a[e],h=g.color,g instanceof THREE.DirectionalLight?(i=g.matrixWorld.getPosition(),m=c.dot(i),0>=m||(m*=g.intensity,d.r+=h.r*m,d.g+=h.g*m,d.b+=h.b*m)):g instanceof THREE.PointLight&&(i=g.matrixWorld.getPosition(),m=c.dot(C.sub(i,b).normalize()),0>=m||(m*=0==g.distance?1:1-Math.min(b.distanceTo(i)/g.distance,1),0!=m&&(m*=g.intensity,d.r+=h.r*m,d.g+=h.g*m,d.b+=h.b*m)))}function b(a){null==E[a]&&(E[a]=document.createElementNS("http://www.w3.org/2000/svg",
-"path"),0==P&&E[a].setAttribute("shape-rendering","crispEdges"));return E[a]}function c(a){a=0.5*(a+1);return 0>a?0:1<a?1:a}var d=this,e,g,f,h=new THREE.Projector,i=document.createElementNS("http://www.w3.org/2000/svg","svg"),k,l,p,n,o,q,m,r,s=new THREE.Rectangle,t=new THREE.Rectangle,w=!1,u=new THREE.Color,v=new THREE.Color,y=new THREE.Color,D=new THREE.Color,A,C=new THREE.Vector3,E=[],J=[],N,T,K,P=1;this.domElement=i;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,
-faces:0}};this.setQuality=function(a){switch(a){case "high":P=1;break;case "low":P=0}};this.setSize=function(a,b){k=a;l=b;p=k/2;n=l/2;i.setAttribute("viewBox",-p+" "+-n+" "+k+" "+l);i.setAttribute("width",k);i.setAttribute("height",l);s.set(-p,-n,p,n)};this.clear=function(){for(;0<i.childNodes.length;)i.removeChild(i.childNodes[0])};this.render=function(k,l){var j,C,B,F;this.autoClear&&this.clear();d.info.render.vertices=0;d.info.render.faces=0;e=h.projectScene(k,l,this.sortElements);g=e.elements;
-f=e.lights;K=T=0;if(w=0<f.length){v.setRGB(0,0,0);y.setRGB(0,0,0);D.setRGB(0,0,0);for(j=0,C=f.length;j<C;j++)F=f[j],B=F.color,F instanceof THREE.AmbientLight?(v.r+=B.r,v.g+=B.g,v.b+=B.b):F instanceof THREE.DirectionalLight?(y.r+=B.r,y.g+=B.g,y.b+=B.b):F instanceof THREE.PointLight&&(D.r+=B.r,D.g+=B.g,D.b+=B.b)}for(j=0,C=g.length;j<C;j++)if(B=g[j],F=B.material,F=F instanceof THREE.MeshFaceMaterial?B.faceMaterial:F,!(null==F||0==F.opacity))if(t.empty(),B instanceof THREE.RenderableParticle)o=B,o.x*=
-p,o.y*=-n;else if(B instanceof THREE.RenderableLine){if(o=B.v1,q=B.v2,o.positionScreen.x*=p,o.positionScreen.y*=-n,q.positionScreen.x*=p,q.positionScreen.y*=-n,t.addPoint(o.positionScreen.x,o.positionScreen.y),t.addPoint(q.positionScreen.x,q.positionScreen.y),s.intersects(t)){B=o;var Z=q,O=K++;null==J[O]&&(J[O]=document.createElementNS("http://www.w3.org/2000/svg","line"),0==P&&J[O].setAttribute("shape-rendering","crispEdges"));N=J[O];N.setAttribute("x1",B.positionScreen.x);N.setAttribute("y1",B.positionScreen.y);
-N.setAttribute("x2",Z.positionScreen.x);N.setAttribute("y2",Z.positionScreen.y);F instanceof THREE.LineBasicMaterial&&(N.setAttribute("style","fill: none; stroke: "+F.color.getContextStyle()+"; stroke-width: "+F.linewidth+"; stroke-opacity: "+F.opacity+"; stroke-linecap: "+F.linecap+"; stroke-linejoin: "+F.linejoin),i.appendChild(N))}}else if(B instanceof THREE.RenderableFace3){if(o=B.v1,q=B.v2,m=B.v3,o.positionScreen.x*=p,o.positionScreen.y*=-n,q.positionScreen.x*=p,q.positionScreen.y*=-n,m.positionScreen.x*=
-p,m.positionScreen.y*=-n,t.addPoint(o.positionScreen.x,o.positionScreen.y),t.addPoint(q.positionScreen.x,q.positionScreen.y),t.addPoint(m.positionScreen.x,m.positionScreen.y),s.intersects(t)){var Z=o,O=q,E=m;d.info.render.vertices+=3;d.info.render.faces++;N=b(T++);N.setAttribute("d","M "+Z.positionScreen.x+" "+Z.positionScreen.y+" L "+O.positionScreen.x+" "+O.positionScreen.y+" L "+E.positionScreen.x+","+E.positionScreen.y+"z");F instanceof THREE.MeshBasicMaterial?u.copy(F.color):F instanceof THREE.MeshLambertMaterial?
-w?(u.r=v.r,u.g=v.g,u.b=v.b,a(f,B.centroidWorld,B.normalWorld,u),u.r=Math.max(0,Math.min(F.color.r*u.r,1)),u.g=Math.max(0,Math.min(F.color.g*u.g,1)),u.b=Math.max(0,Math.min(F.color.b*u.b,1))):u.copy(F.color):F instanceof THREE.MeshDepthMaterial?(A=1-F.__2near/(F.__farPlusNear-B.z*F.__farMinusNear),u.setRGB(A,A,A)):F instanceof THREE.MeshNormalMaterial&&u.setRGB(c(B.normalWorld.x),c(B.normalWorld.y),c(B.normalWorld.z));F.wireframe?N.setAttribute("style","fill: none; stroke: "+u.getContextStyle()+"; stroke-width: "+
-F.wireframeLinewidth+"; stroke-opacity: "+F.opacity+"; stroke-linecap: "+F.wireframeLinecap+"; stroke-linejoin: "+F.wireframeLinejoin):N.setAttribute("style","fill: "+u.getContextStyle()+"; fill-opacity: "+F.opacity);i.appendChild(N)}}else if(B instanceof THREE.RenderableFace4&&(o=B.v1,q=B.v2,m=B.v3,r=B.v4,o.positionScreen.x*=p,o.positionScreen.y*=-n,q.positionScreen.x*=p,q.positionScreen.y*=-n,m.positionScreen.x*=p,m.positionScreen.y*=-n,r.positionScreen.x*=p,r.positionScreen.y*=-n,t.addPoint(o.positionScreen.x,
-o.positionScreen.y),t.addPoint(q.positionScreen.x,q.positionScreen.y),t.addPoint(m.positionScreen.x,m.positionScreen.y),t.addPoint(r.positionScreen.x,r.positionScreen.y),s.intersects(t))){var Z=o,O=q,E=m,da=r;d.info.render.vertices+=4;d.info.render.faces++;N=b(T++);N.setAttribute("d","M "+Z.positionScreen.x+" "+Z.positionScreen.y+" L "+O.positionScreen.x+" "+O.positionScreen.y+" L "+E.positionScreen.x+","+E.positionScreen.y+" L "+da.positionScreen.x+","+da.positionScreen.y+"z");F instanceof THREE.MeshBasicMaterial?
-u.copy(F.color):F instanceof THREE.MeshLambertMaterial?w?(u.r=v.r,u.g=v.g,u.b=v.b,a(f,B.centroidWorld,B.normalWorld,u),u.r=Math.max(0,Math.min(F.color.r*u.r,1)),u.g=Math.max(0,Math.min(F.color.g*u.g,1)),u.b=Math.max(0,Math.min(F.color.b*u.b,1))):u.copy(F.color):F instanceof THREE.MeshDepthMaterial?(A=1-F.__2near/(F.__farPlusNear-B.z*F.__farMinusNear),u.setRGB(A,A,A)):F instanceof THREE.MeshNormalMaterial&&u.setRGB(c(B.normalWorld.x),c(B.normalWorld.y),c(B.normalWorld.z));F.wireframe?N.setAttribute("style",
-"fill: none; stroke: "+u.getContextStyle()+"; stroke-width: "+F.wireframeLinewidth+"; stroke-opacity: "+F.opacity+"; stroke-linecap: "+F.wireframeLinecap+"; stroke-linejoin: "+F.wireframeLinejoin):N.setAttribute("style","fill: "+u.getContextStyle()+"; fill-opacity: "+F.opacity);i.appendChild(N)}}};
+THREE.DOMRenderer=function(){var a=null,b=new THREE.Projector,c,d,e,g;this.domElement=document.createElement("div");this.setSize=function(a,b){c=a;d=b;e=c/2;g=d/2};this.render=function(c,d){var i,l,k,p,n,o,q,m;a=b.projectScene(c,d);for(i=0,l=a.length;i<l;i++)if(n=a[i],n instanceof THREE.RenderableParticle){q=n.x*e+e;m=n.y*g+g;for(k=0,p=n.material.length;k<p;k++)if(o=n.material[k],o instanceof THREE.ParticleDOMMaterial)o=o.domElement,o.style.left=q+"px",o.style.top=m+"px"}}};
+THREE.CanvasRenderer=function(a){function b(a){if(t!=a)m.globalAlpha=t=a}function c(a){if(w!=a){switch(a){case THREE.NormalBlending:m.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:m.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:m.globalCompositeOperation="darker"}w=a}}function d(a){if(u!=a)m.strokeStyle=u=a}function e(a){if(v!=a)m.fillStyle=v=a}var a=a||{},g=this,f,h,i,l=new THREE.Projector,k=void 0!==a.canvas?a.canvas:document.createElement("canvas"),
+p,n,o,q,m=k.getContext("2d"),r=new THREE.Color(0),s=0,t=1,w=0,u=null,v=null,y=null,C=null,A=null,B,D,J,N,S=new THREE.RenderableVertex,K=new THREE.RenderableVertex,P,M,H,j,X,F,E,Y,O,fa,ca,ha,R=new THREE.Color,$=new THREE.Color,Q=new THREE.Color,aa=new THREE.Color,da=new THREE.Color,Ua=[],Ha=[],ma,Ia,ra,pa,ib,Va,lb,db,Wa,$a,La=new THREE.Rectangle,ta=new THREE.Rectangle,Aa=new THREE.Rectangle,Fa=!1,Ga=new THREE.Color,Xa=new THREE.Color,mb=new THREE.Color,Z=new THREE.Vector3,qa,Fb,Uc,eb,pc,Cc,a=16;qa=
+document.createElement("canvas");qa.width=qa.height=2;Fb=qa.getContext("2d");Fb.fillStyle="rgba(0,0,0,1)";Fb.fillRect(0,0,2,2);Uc=Fb.getImageData(0,0,2,2);eb=Uc.data;pc=document.createElement("canvas");pc.width=pc.height=a;Cc=pc.getContext("2d");Cc.translate(-a/2,-a/2);Cc.scale(a,a);a--;this.domElement=k;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setSize=function(a,b){p=a;n=b;o=Math.floor(p/2);q=Math.floor(n/2);k.width=p;k.height=n;La.set(-o,
+-q,o,q);ta.set(-o,-q,o,q);t=1;w=0;A=C=y=v=u=null};this.setClearColor=function(a,b){r.copy(a);s=b;ta.set(-o,-q,o,q)};this.setClearColorHex=function(a,b){r.setHex(a);s=b;ta.set(-o,-q,o,q)};this.clear=function(){m.setTransform(1,0,0,-1,o,q);ta.isEmpty()||(ta.minSelf(La),ta.inflate(2),1>s&&m.clearRect(Math.floor(ta.getX()),Math.floor(ta.getY()),Math.floor(ta.getWidth()),Math.floor(ta.getHeight())),0<s&&(c(THREE.NormalBlending),b(1),e("rgba("+Math.floor(255*r.r)+","+Math.floor(255*r.g)+","+Math.floor(255*
+r.b)+","+s+")"),m.fillRect(Math.floor(ta.getX()),Math.floor(ta.getY()),Math.floor(ta.getWidth()),Math.floor(ta.getHeight()))),ta.empty())};this.render=function(a,n){function k(a){var b,c,d,e;Ga.setRGB(0,0,0);Xa.setRGB(0,0,0);mb.setRGB(0,0,0);for(b=0,c=a.length;b<c;b++)d=a[b],e=d.color,d instanceof THREE.AmbientLight?(Ga.r+=e.r,Ga.g+=e.g,Ga.b+=e.b):d instanceof THREE.DirectionalLight?(Xa.r+=e.r,Xa.g+=e.g,Xa.b+=e.b):d instanceof THREE.PointLight&&(mb.r+=e.r,mb.g+=e.g,mb.b+=e.b)}function p(a,b,c,d){var e,
+g,f,j,h,i;for(e=0,g=a.length;e<g;e++)f=a[e],j=f.color,f instanceof THREE.DirectionalLight?(h=f.matrixWorld.getPosition(),i=c.dot(h),0>=i||(i*=f.intensity,d.r+=j.r*i,d.g+=j.g*i,d.b+=j.b*i)):f instanceof THREE.PointLight&&(h=f.matrixWorld.getPosition(),i=c.dot(Z.sub(h,b).normalize()),0>=i||(i*=0==f.distance?1:1-Math.min(b.distanceTo(h)/f.distance,1),0!=i&&(i*=f.intensity,d.r+=j.r*i,d.g+=j.g*i,d.b+=j.b*i)))}function r(a,g,f){b(f.opacity);c(f.blending);var Z,j,h,i,n,l;if(f instanceof THREE.ParticleBasicMaterial){if(f.map)i=
+f.map.image,n=i.width>>1,l=i.height>>1,f=g.scale.x*o,h=g.scale.y*q,Z=f*n,j=h*l,Aa.set(a.x-Z,a.y-j,a.x+Z,a.y+j),La.intersects(Aa)&&(m.save(),m.translate(a.x,a.y),m.rotate(-g.rotation),m.scale(f,-h),m.translate(-n,-l),m.drawImage(i,0,0),m.restore())}else f instanceof THREE.ParticleCanvasMaterial&&(Z=g.scale.x*o,j=g.scale.y*q,Aa.set(a.x-Z,a.y-j,a.x+Z,a.y+j),La.intersects(Aa)&&(d(f.color.getContextStyle()),e(f.color.getContextStyle()),m.save(),m.translate(a.x,a.y),m.rotate(-g.rotation),m.scale(Z,j),f.program(m),
+m.restore()))}function s(a,e,g,f){b(f.opacity);c(f.blending);m.beginPath();m.moveTo(a.positionScreen.x,a.positionScreen.y);m.lineTo(e.positionScreen.x,e.positionScreen.y);m.closePath();if(f instanceof THREE.LineBasicMaterial){a=f.linewidth;if(y!=a)m.lineWidth=y=a;a=f.linecap;if(C!=a)m.lineCap=C=a;a=f.linejoin;if(A!=a)m.lineJoin=A=a;d(f.color.getContextStyle());m.stroke();Aa.inflate(2*f.linewidth)}}function t(a,d,e,f,h,l,m,k){g.info.render.vertices+=3;g.info.render.faces++;b(k.opacity);c(k.blending);
+P=a.positionScreen.x;M=a.positionScreen.y;H=d.positionScreen.x;j=d.positionScreen.y;X=e.positionScreen.x;F=e.positionScreen.y;w(P,M,H,j,X,F);if(k instanceof THREE.MeshBasicMaterial)if(k.map)k.map.mapping instanceof THREE.UVMapping&&(pa=m.uvs[0],Vc(P,M,H,j,X,F,pa[f].u,pa[f].v,pa[h].u,pa[h].v,pa[l].u,pa[l].v,k.map));else if(k.envMap){if(k.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=n.matrixWorldInverse,Z.copy(m.vertexNormalsWorld[f]),ib=0.5*(Z.x*a.n11+Z.y*a.n12+Z.z*a.n13)+0.5,Va=0.5*
+-(Z.x*a.n21+Z.y*a.n22+Z.z*a.n23)+0.5,Z.copy(m.vertexNormalsWorld[h]),lb=0.5*(Z.x*a.n11+Z.y*a.n12+Z.z*a.n13)+0.5,db=0.5*-(Z.x*a.n21+Z.y*a.n22+Z.z*a.n23)+0.5,Z.copy(m.vertexNormalsWorld[l]),Wa=0.5*(Z.x*a.n11+Z.y*a.n12+Z.z*a.n13)+0.5,$a=0.5*-(Z.x*a.n21+Z.y*a.n22+Z.z*a.n23)+0.5,Vc(P,M,H,j,X,F,ib,Va,lb,db,Wa,$a,k.envMap)}else k.wireframe?Mb(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Gb(k.color);else if(k instanceof THREE.MeshLambertMaterial)k.map&&!k.wireframe&&(k.map.mapping instanceof
+THREE.UVMapping&&(pa=m.uvs[0],Vc(P,M,H,j,X,F,pa[f].u,pa[f].v,pa[h].u,pa[h].v,pa[l].u,pa[l].v,k.map)),c(THREE.SubtractiveBlending)),Fa?!k.wireframe&&k.shading==THREE.SmoothShading&&3==m.vertexNormalsWorld.length?($.r=Q.r=aa.r=Ga.r,$.g=Q.g=aa.g=Ga.g,$.b=Q.b=aa.b=Ga.b,p(i,m.v1.positionWorld,m.vertexNormalsWorld[0],$),p(i,m.v2.positionWorld,m.vertexNormalsWorld[1],Q),p(i,m.v3.positionWorld,m.vertexNormalsWorld[2],aa),$.r=Math.max(0,Math.min(k.color.r*$.r,1)),$.g=Math.max(0,Math.min(k.color.g*$.g,1)),
+$.b=Math.max(0,Math.min(k.color.b*$.b,1)),Q.r=Math.max(0,Math.min(k.color.r*Q.r,1)),Q.g=Math.max(0,Math.min(k.color.g*Q.g,1)),Q.b=Math.max(0,Math.min(k.color.b*Q.b,1)),aa.r=Math.max(0,Math.min(k.color.r*aa.r,1)),aa.g=Math.max(0,Math.min(k.color.g*aa.g,1)),aa.b=Math.max(0,Math.min(k.color.b*aa.b,1)),da.r=0.5*(Q.r+aa.r),da.g=0.5*(Q.g+aa.g),da.b=0.5*(Q.b+aa.b),ra=Dc($,Q,aa,da),gc(P,M,H,j,X,F,0,0,1,0,0,1,ra)):(R.r=Ga.r,R.g=Ga.g,R.b=Ga.b,p(i,m.centroidWorld,m.normalWorld,R),R.r=Math.max(0,Math.min(k.color.r*
+R.r,1)),R.g=Math.max(0,Math.min(k.color.g*R.g,1)),R.b=Math.max(0,Math.min(k.color.b*R.b,1)),k.wireframe?Mb(R,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Gb(R)):k.wireframe?Mb(k.color,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Gb(k.color);else if(k instanceof THREE.MeshDepthMaterial)ma=n.near,Ia=n.far,$.r=$.g=$.b=1-ac(a.positionScreen.z,ma,Ia),Q.r=Q.g=Q.b=1-ac(d.positionScreen.z,ma,Ia),aa.r=aa.g=aa.b=1-ac(e.positionScreen.z,ma,Ia),da.r=0.5*(Q.r+aa.r),da.g=0.5*(Q.g+
+aa.g),da.b=0.5*(Q.b+aa.b),ra=Dc($,Q,aa,da),gc(P,M,H,j,X,F,0,0,1,0,0,1,ra);else if(k instanceof THREE.MeshNormalMaterial)R.r=hc(m.normalWorld.x),R.g=hc(m.normalWorld.y),R.b=hc(m.normalWorld.z),k.wireframe?Mb(R,k.wireframeLinewidth,k.wireframeLinecap,k.wireframeLinejoin):Gb(R)}function u(a,d,e,f,Z,h,k,m,l){g.info.render.vertices+=4;g.info.render.faces++;b(m.opacity);c(m.blending);if(m.map||m.envMap)t(a,d,f,0,1,3,k,m,l),t(Z,e,h,1,2,3,k,m,l);else if(P=a.positionScreen.x,M=a.positionScreen.y,H=d.positionScreen.x,
+j=d.positionScreen.y,X=e.positionScreen.x,F=e.positionScreen.y,E=f.positionScreen.x,Y=f.positionScreen.y,O=Z.positionScreen.x,fa=Z.positionScreen.y,ca=h.positionScreen.x,ha=h.positionScreen.y,m instanceof THREE.MeshBasicMaterial)v(P,M,H,j,X,F,E,Y),m.wireframe?Mb(m.color,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Gb(m.color);else if(m instanceof THREE.MeshLambertMaterial)Fa?!m.wireframe&&m.shading==THREE.SmoothShading&&4==k.vertexNormalsWorld.length?($.r=Q.r=aa.r=da.r=Ga.r,$.g=Q.g=
+aa.g=da.g=Ga.g,$.b=Q.b=aa.b=da.b=Ga.b,p(i,k.v1.positionWorld,k.vertexNormalsWorld[0],$),p(i,k.v2.positionWorld,k.vertexNormalsWorld[1],Q),p(i,k.v4.positionWorld,k.vertexNormalsWorld[3],aa),p(i,k.v3.positionWorld,k.vertexNormalsWorld[2],da),$.r=Math.max(0,Math.min(m.color.r*$.r,1)),$.g=Math.max(0,Math.min(m.color.g*$.g,1)),$.b=Math.max(0,Math.min(m.color.b*$.b,1)),Q.r=Math.max(0,Math.min(m.color.r*Q.r,1)),Q.g=Math.max(0,Math.min(m.color.g*Q.g,1)),Q.b=Math.max(0,Math.min(m.color.b*Q.b,1)),aa.r=Math.max(0,
+Math.min(m.color.r*aa.r,1)),aa.g=Math.max(0,Math.min(m.color.g*aa.g,1)),aa.b=Math.max(0,Math.min(m.color.b*aa.b,1)),da.r=Math.max(0,Math.min(m.color.r*da.r,1)),da.g=Math.max(0,Math.min(m.color.g*da.g,1)),da.b=Math.max(0,Math.min(m.color.b*da.b,1)),ra=Dc($,Q,aa,da),w(P,M,H,j,E,Y),gc(P,M,H,j,E,Y,0,0,1,0,0,1,ra),w(O,fa,X,F,ca,ha),gc(O,fa,X,F,ca,ha,1,0,1,1,0,1,ra)):(R.r=Ga.r,R.g=Ga.g,R.b=Ga.b,p(i,k.centroidWorld,k.normalWorld,R),R.r=Math.max(0,Math.min(m.color.r*R.r,1)),R.g=Math.max(0,Math.min(m.color.g*
+R.g,1)),R.b=Math.max(0,Math.min(m.color.b*R.b,1)),v(P,M,H,j,X,F,E,Y),m.wireframe?Mb(R,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Gb(R)):(v(P,M,H,j,X,F,E,Y),m.wireframe?Mb(m.color,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Gb(m.color));else if(m instanceof THREE.MeshNormalMaterial)R.r=hc(k.normalWorld.x),R.g=hc(k.normalWorld.y),R.b=hc(k.normalWorld.z),v(P,M,H,j,X,F,E,Y),m.wireframe?Mb(R,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Gb(R);else if(m instanceof
+THREE.MeshDepthMaterial)ma=n.near,Ia=n.far,$.r=$.g=$.b=1-ac(a.positionScreen.z,ma,Ia),Q.r=Q.g=Q.b=1-ac(d.positionScreen.z,ma,Ia),aa.r=aa.g=aa.b=1-ac(f.positionScreen.z,ma,Ia),da.r=da.g=da.b=1-ac(e.positionScreen.z,ma,Ia),ra=Dc($,Q,aa,da),w(P,M,H,j,E,Y),gc(P,M,H,j,E,Y,0,0,1,0,0,1,ra),w(O,fa,X,F,ca,ha),gc(O,fa,X,F,ca,ha,1,0,1,1,0,1,ra)}function w(a,b,c,d,e,f){m.beginPath();m.moveTo(a,b);m.lineTo(c,d);m.lineTo(e,f);m.lineTo(a,b);m.closePath()}function v(a,b,c,d,e,f,g,Z){m.beginPath();m.moveTo(a,b);m.lineTo(c,
+d);m.lineTo(e,f);m.lineTo(g,Z);m.lineTo(a,b);m.closePath()}function Mb(a,b,c,e){if(y!=b)m.lineWidth=y=b;if(C!=c)m.lineCap=C=c;if(A!=e)m.lineJoin=A=e;d(a.getContextStyle());m.stroke();Aa.inflate(2*b)}function Gb(a){e(a.getContextStyle());m.fill()}function Vc(a,b,c,d,f,g,Z,j,h,i,k,l,n){if(0!=n.image.width){if(!0==n.needsUpdate||void 0==Ua[n.id]){var qa=n.wrapS==THREE.RepeatWrapping,o=n.wrapT==THREE.RepeatWrapping;Ua[n.id]=m.createPattern(n.image,qa&&o?"repeat":qa&&!o?"repeat-x":!qa&&o?"repeat-y":"no-repeat");
+n.needsUpdate=!1}e(Ua[n.id]);var qa=n.offset.x/n.repeat.x,o=n.offset.y/n.repeat.y,Fb=n.image.width*n.repeat.x,p=n.image.height*n.repeat.y,Z=(Z+qa)*Fb,j=(j+o)*p,c=c-a,d=d-b,f=f-a,g=g-b,h=(h+qa)*Fb-Z,i=(i+o)*p-j,k=(k+qa)*Fb-Z,l=(l+o)*p-j,qa=h*l-k*i;if(0==qa){if(void 0===Ha[n.id])b=document.createElement("canvas"),b.width=n.image.width,b.height=n.image.height,b=b.getContext("2d"),b.drawImage(n.image,0,0),Ha[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data;b=Ha[n.id];Z=4*(Math.floor(Z)+Math.floor(j)*
+n.image.width);R.setRGB(b[Z]/255,b[Z+1]/255,b[Z+2]/255);Gb(R)}else qa=1/qa,n=(l*c-i*f)*qa,i=(l*d-i*g)*qa,c=(h*f-k*c)*qa,d=(h*g-k*d)*qa,a=a-n*Z-c*j,Z=b-i*Z-d*j,m.save(),m.transform(n,i,c,d,a,Z),m.fill(),m.restore()}}function gc(a,b,c,d,e,f,g,Z,j,h,i,k,n){var l,qa;l=n.width-1;qa=n.height-1;g*=l;Z*=qa;c-=a;d-=b;e-=a;f-=b;j=j*l-g;h=h*qa-Z;i=i*l-g;k=k*qa-Z;qa=1/(j*k-i*h);l=(k*c-h*e)*qa;h=(k*d-h*f)*qa;c=(j*e-i*c)*qa;d=(j*f-i*d)*qa;a=a-l*g-c*Z;b=b-h*g-d*Z;m.save();m.transform(l,h,c,d,a,b);m.clip();m.drawImage(n,
+0,0);m.restore()}function Dc(a,b,c,d){var e=~~(255*a.r),f=~~(255*a.g),a=~~(255*a.b),g=~~(255*b.r),Z=~~(255*b.g),b=~~(255*b.b),j=~~(255*c.r),h=~~(255*c.g),c=~~(255*c.b),i=~~(255*d.r),k=~~(255*d.g),d=~~(255*d.b);eb[0]=0>e?0:255<e?255:e;eb[1]=0>f?0:255<f?255:f;eb[2]=0>a?0:255<a?255:a;eb[4]=0>g?0:255<g?255:g;eb[5]=0>Z?0:255<Z?255:Z;eb[6]=0>b?0:255<b?255:b;eb[8]=0>j?0:255<j?255:j;eb[9]=0>h?0:255<h?255:h;eb[10]=0>c?0:255<c?255:c;eb[12]=0>i?0:255<i?255:i;eb[13]=0>k?0:255<k?255:k;eb[14]=0>d?0:255<d?255:d;
+Fb.putImageData(Uc,0,0);Cc.drawImage(qa,0,0);return pc}function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function hc(a){a=0.5*(a+1);return 0>a?0:1<a?1:a}function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;0!=e&&(e=1/Math.sqrt(e),c*=e,d*=e,b.x+=c,b.y+=d,a.x-=c,a.y-=d)}var Ec,fd,Pa,jb;this.autoClear?this.clear():m.setTransform(1,0,0,-1,o,q);g.info.render.vertices=0;g.info.render.faces=0;f=l.projectScene(a,n,this.sortElements);h=f.elements;i=f.lights;(Fa=0<i.length)&&k(i);for(Ec=0,fd=h.length;Ec<fd;Ec++)if(Pa=
+h[Ec],jb=Pa.material,jb=jb instanceof THREE.MeshFaceMaterial?Pa.faceMaterial:jb,!(null==jb||0==jb.opacity)){Aa.empty();if(Pa instanceof THREE.RenderableParticle)B=Pa,B.x*=o,B.y*=q,r(B,Pa,jb,a);else if(Pa instanceof THREE.RenderableLine)B=Pa.v1,D=Pa.v2,B.positionScreen.x*=o,B.positionScreen.y*=q,D.positionScreen.x*=o,D.positionScreen.y*=q,Aa.addPoint(B.positionScreen.x,B.positionScreen.y),Aa.addPoint(D.positionScreen.x,D.positionScreen.y),La.intersects(Aa)&&s(B,D,Pa,jb,a);else if(Pa instanceof THREE.RenderableFace3)B=
+Pa.v1,D=Pa.v2,J=Pa.v3,B.positionScreen.x*=o,B.positionScreen.y*=q,D.positionScreen.x*=o,D.positionScreen.y*=q,J.positionScreen.x*=o,J.positionScreen.y*=q,jb.overdraw&&(Nb(B.positionScreen,D.positionScreen),Nb(D.positionScreen,J.positionScreen),Nb(J.positionScreen,B.positionScreen)),Aa.add3Points(B.positionScreen.x,B.positionScreen.y,D.positionScreen.x,D.positionScreen.y,J.positionScreen.x,J.positionScreen.y),La.intersects(Aa)&&t(B,D,J,0,1,2,Pa,jb,a);else if(Pa instanceof THREE.RenderableFace4)B=Pa.v1,
+D=Pa.v2,J=Pa.v3,N=Pa.v4,B.positionScreen.x*=o,B.positionScreen.y*=q,D.positionScreen.x*=o,D.positionScreen.y*=q,J.positionScreen.x*=o,J.positionScreen.y*=q,N.positionScreen.x*=o,N.positionScreen.y*=q,S.positionScreen.copy(D.positionScreen),K.positionScreen.copy(N.positionScreen),jb.overdraw&&(Nb(B.positionScreen,D.positionScreen),Nb(D.positionScreen,N.positionScreen),Nb(N.positionScreen,B.positionScreen),Nb(J.positionScreen,S.positionScreen),Nb(J.positionScreen,K.positionScreen)),Aa.addPoint(B.positionScreen.x,
+B.positionScreen.y),Aa.addPoint(D.positionScreen.x,D.positionScreen.y),Aa.addPoint(J.positionScreen.x,J.positionScreen.y),Aa.addPoint(N.positionScreen.x,N.positionScreen.y),La.intersects(Aa)&&u(B,D,J,N,S,K,Pa,jb,a);ta.addRectangle(Aa)}m.setTransform(1,0,0,1,0,0)}};
+THREE.SVGRenderer=function(){function a(a,b,c,d){var e,f,g,h,i,k;for(e=0,f=a.length;e<f;e++)g=a[e],h=g.color,g instanceof THREE.DirectionalLight?(i=g.matrixWorld.getPosition(),k=c.dot(i),0>=k||(k*=g.intensity,d.r+=h.r*k,d.g+=h.g*k,d.b+=h.b*k)):g instanceof THREE.PointLight&&(i=g.matrixWorld.getPosition(),k=c.dot(B.sub(i,b).normalize()),0>=k||(k*=0==g.distance?1:1-Math.min(b.distanceTo(i)/g.distance,1),0!=k&&(k*=g.intensity,d.r+=h.r*k,d.g+=h.g*k,d.b+=h.b*k)))}function b(a){null==D[a]&&(D[a]=document.createElementNS("http://www.w3.org/2000/svg",
+"path"),0==P&&D[a].setAttribute("shape-rendering","crispEdges"));return D[a]}function c(a){a=0.5*(a+1);return 0>a?0:1<a?1:a}var d=this,e,g,f,h=new THREE.Projector,i=document.createElementNS("http://www.w3.org/2000/svg","svg"),l,k,p,n,o,q,m,r,s=new THREE.Rectangle,t=new THREE.Rectangle,w=!1,u=new THREE.Color,v=new THREE.Color,y=new THREE.Color,C=new THREE.Color,A,B=new THREE.Vector3,D=[],J=[],N,S,K,P=1;this.domElement=i;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,
+faces:0}};this.setQuality=function(a){switch(a){case "high":P=1;break;case "low":P=0}};this.setSize=function(a,b){l=a;k=b;p=l/2;n=k/2;i.setAttribute("viewBox",-p+" "+-n+" "+l+" "+k);i.setAttribute("width",l);i.setAttribute("height",k);s.set(-p,-n,p,n)};this.clear=function(){for(;0<i.childNodes.length;)i.removeChild(i.childNodes[0])};this.render=function(k,l){var j,B,F,E;this.autoClear&&this.clear();d.info.render.vertices=0;d.info.render.faces=0;e=h.projectScene(k,l,this.sortElements);g=e.elements;
+f=e.lights;K=S=0;if(w=0<f.length){v.setRGB(0,0,0);y.setRGB(0,0,0);C.setRGB(0,0,0);for(j=0,B=f.length;j<B;j++)E=f[j],F=E.color,E instanceof THREE.AmbientLight?(v.r+=F.r,v.g+=F.g,v.b+=F.b):E instanceof THREE.DirectionalLight?(y.r+=F.r,y.g+=F.g,y.b+=F.b):E instanceof THREE.PointLight&&(C.r+=F.r,C.g+=F.g,C.b+=F.b)}for(j=0,B=g.length;j<B;j++)if(F=g[j],E=F.material,E=E instanceof THREE.MeshFaceMaterial?F.faceMaterial:E,!(null==E||0==E.opacity))if(t.empty(),F instanceof THREE.RenderableParticle)o=F,o.x*=
+p,o.y*=-n;else if(F instanceof THREE.RenderableLine){if(o=F.v1,q=F.v2,o.positionScreen.x*=p,o.positionScreen.y*=-n,q.positionScreen.x*=p,q.positionScreen.y*=-n,t.addPoint(o.positionScreen.x,o.positionScreen.y),t.addPoint(q.positionScreen.x,q.positionScreen.y),s.intersects(t)){F=o;var Y=q,O=K++;null==J[O]&&(J[O]=document.createElementNS("http://www.w3.org/2000/svg","line"),0==P&&J[O].setAttribute("shape-rendering","crispEdges"));N=J[O];N.setAttribute("x1",F.positionScreen.x);N.setAttribute("y1",F.positionScreen.y);
+N.setAttribute("x2",Y.positionScreen.x);N.setAttribute("y2",Y.positionScreen.y);E instanceof THREE.LineBasicMaterial&&(N.setAttribute("style","fill: none; stroke: "+E.color.getContextStyle()+"; stroke-width: "+E.linewidth+"; stroke-opacity: "+E.opacity+"; stroke-linecap: "+E.linecap+"; stroke-linejoin: "+E.linejoin),i.appendChild(N))}}else if(F instanceof THREE.RenderableFace3){if(o=F.v1,q=F.v2,m=F.v3,o.positionScreen.x*=p,o.positionScreen.y*=-n,q.positionScreen.x*=p,q.positionScreen.y*=-n,m.positionScreen.x*=
+p,m.positionScreen.y*=-n,t.addPoint(o.positionScreen.x,o.positionScreen.y),t.addPoint(q.positionScreen.x,q.positionScreen.y),t.addPoint(m.positionScreen.x,m.positionScreen.y),s.intersects(t)){var Y=o,O=q,D=m;d.info.render.vertices+=3;d.info.render.faces++;N=b(S++);N.setAttribute("d","M "+Y.positionScreen.x+" "+Y.positionScreen.y+" L "+O.positionScreen.x+" "+O.positionScreen.y+" L "+D.positionScreen.x+","+D.positionScreen.y+"z");E instanceof THREE.MeshBasicMaterial?u.copy(E.color):E instanceof THREE.MeshLambertMaterial?
+w?(u.r=v.r,u.g=v.g,u.b=v.b,a(f,F.centroidWorld,F.normalWorld,u),u.r=Math.max(0,Math.min(E.color.r*u.r,1)),u.g=Math.max(0,Math.min(E.color.g*u.g,1)),u.b=Math.max(0,Math.min(E.color.b*u.b,1))):u.copy(E.color):E instanceof THREE.MeshDepthMaterial?(A=1-E.__2near/(E.__farPlusNear-F.z*E.__farMinusNear),u.setRGB(A,A,A)):E instanceof THREE.MeshNormalMaterial&&u.setRGB(c(F.normalWorld.x),c(F.normalWorld.y),c(F.normalWorld.z));E.wireframe?N.setAttribute("style","fill: none; stroke: "+u.getContextStyle()+"; stroke-width: "+
+E.wireframeLinewidth+"; stroke-opacity: "+E.opacity+"; stroke-linecap: "+E.wireframeLinecap+"; stroke-linejoin: "+E.wireframeLinejoin):N.setAttribute("style","fill: "+u.getContextStyle()+"; fill-opacity: "+E.opacity);i.appendChild(N)}}else if(F instanceof THREE.RenderableFace4&&(o=F.v1,q=F.v2,m=F.v3,r=F.v4,o.positionScreen.x*=p,o.positionScreen.y*=-n,q.positionScreen.x*=p,q.positionScreen.y*=-n,m.positionScreen.x*=p,m.positionScreen.y*=-n,r.positionScreen.x*=p,r.positionScreen.y*=-n,t.addPoint(o.positionScreen.x,
+o.positionScreen.y),t.addPoint(q.positionScreen.x,q.positionScreen.y),t.addPoint(m.positionScreen.x,m.positionScreen.y),t.addPoint(r.positionScreen.x,r.positionScreen.y),s.intersects(t))){var Y=o,O=q,D=m,ca=r;d.info.render.vertices+=4;d.info.render.faces++;N=b(S++);N.setAttribute("d","M "+Y.positionScreen.x+" "+Y.positionScreen.y+" L "+O.positionScreen.x+" "+O.positionScreen.y+" L "+D.positionScreen.x+","+D.positionScreen.y+" L "+ca.positionScreen.x+","+ca.positionScreen.y+"z");E instanceof THREE.MeshBasicMaterial?
+u.copy(E.color):E instanceof THREE.MeshLambertMaterial?w?(u.r=v.r,u.g=v.g,u.b=v.b,a(f,F.centroidWorld,F.normalWorld,u),u.r=Math.max(0,Math.min(E.color.r*u.r,1)),u.g=Math.max(0,Math.min(E.color.g*u.g,1)),u.b=Math.max(0,Math.min(E.color.b*u.b,1))):u.copy(E.color):E instanceof THREE.MeshDepthMaterial?(A=1-E.__2near/(E.__farPlusNear-F.z*E.__farMinusNear),u.setRGB(A,A,A)):E instanceof THREE.MeshNormalMaterial&&u.setRGB(c(F.normalWorld.x),c(F.normalWorld.y),c(F.normalWorld.z));E.wireframe?N.setAttribute("style",
+"fill: none; stroke: "+u.getContextStyle()+"; stroke-width: "+E.wireframeLinewidth+"; stroke-opacity: "+E.opacity+"; stroke-linecap: "+E.wireframeLinecap+"; stroke-linejoin: "+E.wireframeLinejoin):N.setAttribute("style","fill: "+u.getContextStyle()+"; fill-opacity: "+E.opacity);i.appendChild(N)}}};
 THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#endif",
 THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#endif",
 envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * vReflect.x, vReflect.yz ) );\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity );\n} else {\ngl_FragColor.xyz = gl_FragColor.xyz * cubeColor.xyz;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[ 0 ].xyz, objectMatrix[ 1 ].xyz, objectMatrix[ 2 ].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",
 envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * vReflect.x, vReflect.yz ) );\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity );\n} else {\ngl_FragColor.xyz = gl_FragColor.xyz * cubeColor.xyz;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[ 0 ].xyz, objectMatrix[ 1 ].xyz, objectMatrix[ 2 ].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",
 map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform vec4 offsetRepeat;\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",map_fragment:"#ifdef USE_MAP\n#ifdef GAMMA_INPUT\nvec4 texelColor = texture2D( map, vUv );\ntexelColor.xyz *= texelColor.xyz;\ngl_FragColor = gl_FragColor * texelColor;\n#else\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif\n#endif",
 map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform vec4 offsetRepeat;\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",map_fragment:"#ifdef USE_MAP\n#ifdef GAMMA_INPUT\nvec4 texelColor = texture2D( map, vUv );\ntexelColor.xyz *= texelColor.xyz;\ngl_FragColor = gl_FragColor * texelColor;\n#else\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif\n#endif",
@@ -240,43 +240,43 @@ THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragme
 THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask  = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};
 THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask  = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};
 THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if(void 0===a.__webglCustomAttributesList)a.__webglCustomAttributesList=[];for(var e in d.attributes){var g=d.attributes[e];if(!g.__webglInitialized||g.createUniqueBuffers){g.__webglInitialized=!0;var f=1;"v2"===g.type?f=2:"v3"===g.type?f=3:"v4"===g.type?f=4:"c"===g.type&&(f=3);g.size=f;g.array=new Float32Array(c*f);g.buffer=j.createBuffer();g.buffer.belongsToAttribute=e;g.needsUpdate=!0}a.__webglCustomAttributesList.push(g)}}}
 THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if(void 0===a.__webglCustomAttributesList)a.__webglCustomAttributesList=[];for(var e in d.attributes){var g=d.attributes[e];if(!g.__webglInitialized||g.createUniqueBuffers){g.__webglInitialized=!0;var f=1;"v2"===g.type?f=2:"v3"===g.type?f=3:"v4"===g.type?f=4:"c"===g.type&&(f=3);g.size=f;g.array=new Float32Array(c*f);g.buffer=j.createBuffer();g.buffer.belongsToAttribute=e;g.needsUpdate=!0}a.__webglCustomAttributesList.push(g)}}}
 function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMaterial))return a.material;if(0<=b.materialIndex)return a.geometry.materials[b.materialIndex]}function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMaterial?!0:!1}function g(a,b,c){var d,e,g,f,h=a.vertices;f=h.length;
 function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMaterial))return a.material;if(0<=b.materialIndex)return a.geometry.materials[b.materialIndex]}function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMaterial?!0:!1}function g(a,b,c){var d,e,g,f,h=a.vertices;f=h.length;
-var i=a.colors,m=i.length,k=a.__vertexArray,n=a.__colorArray,l=a.__sortArray,o=a.__dirtyVertices,p=a.__dirtyColors,q=a.__webglCustomAttributesList;if(c.sortParticles){Wa.multiplySelf(c.matrixWorld);for(d=0;d<f;d++)e=h[d].position,$a.copy(e),Wa.multiplyVector3($a),l[d]=[$a.z,d];l.sort(function(a,b){return b[0]-a[0]});for(d=0;d<f;d++)e=h[l[d][1]].position,g=3*d,k[g]=e.x,k[g+1]=e.y,k[g+2]=e.z;for(d=0;d<m;d++)g=3*d,e=i[l[d][1]],n[g]=e.r,n[g+1]=e.g,n[g+2]=e.b;if(q)for(i=0,m=q.length;i<m;i++)if(h=q[i],
+var i=a.colors,k=i.length,m=a.__vertexArray,n=a.__colorArray,l=a.__sortArray,o=a.__dirtyVertices,p=a.__dirtyColors,q=a.__webglCustomAttributesList;if(c.sortParticles){Wa.multiplySelf(c.matrixWorld);for(d=0;d<f;d++)e=h[d].position,$a.copy(e),Wa.multiplyVector3($a),l[d]=[$a.z,d];l.sort(function(a,b){return b[0]-a[0]});for(d=0;d<f;d++)e=h[l[d][1]].position,g=3*d,m[g]=e.x,m[g+1]=e.y,m[g+2]=e.z;for(d=0;d<k;d++)g=3*d,e=i[l[d][1]],n[g]=e.r,n[g+1]=e.g,n[g+2]=e.b;if(q)for(i=0,k=q.length;i<k;i++)if(h=q[i],
 void 0===h.boundTo||"vertices"===h.boundTo)if(g=0,e=h.value.length,1===h.size)for(d=0;d<e;d++)f=l[d][1],h.array[d]=h.value[f];else if(2===h.size)for(d=0;d<e;d++)f=l[d][1],f=h.value[f],h.array[g]=f.x,h.array[g+1]=f.y,g+=2;else if(3===h.size)if("c"===h.type)for(d=0;d<e;d++)f=l[d][1],f=h.value[f],h.array[g]=f.r,h.array[g+1]=f.g,h.array[g+2]=f.b,g+=3;else for(d=0;d<e;d++)f=l[d][1],f=h.value[f],h.array[g]=f.x,h.array[g+1]=f.y,h.array[g+2]=f.z,g+=3;else if(4===h.size)for(d=0;d<e;d++)f=l[d][1],f=h.value[f],
 void 0===h.boundTo||"vertices"===h.boundTo)if(g=0,e=h.value.length,1===h.size)for(d=0;d<e;d++)f=l[d][1],h.array[d]=h.value[f];else if(2===h.size)for(d=0;d<e;d++)f=l[d][1],f=h.value[f],h.array[g]=f.x,h.array[g+1]=f.y,g+=2;else if(3===h.size)if("c"===h.type)for(d=0;d<e;d++)f=l[d][1],f=h.value[f],h.array[g]=f.r,h.array[g+1]=f.g,h.array[g+2]=f.b,g+=3;else for(d=0;d<e;d++)f=l[d][1],f=h.value[f],h.array[g]=f.x,h.array[g+1]=f.y,h.array[g+2]=f.z,g+=3;else if(4===h.size)for(d=0;d<e;d++)f=l[d][1],f=h.value[f],
-h.array[g]=f.x,h.array[g+1]=f.y,h.array[g+2]=f.z,h.array[g+3]=f.w,g+=4}else{if(o)for(d=0;d<f;d++)e=h[d].position,g=3*d,k[g]=e.x,k[g+1]=e.y,k[g+2]=e.z;if(p)for(d=0;d<m;d++)e=i[d],g=3*d,n[g]=e.r,n[g+1]=e.g,n[g+2]=e.b;if(q)for(i=0,m=q.length;i<m;i++)if(h=q[i],h.needsUpdate&&(void 0===h.boundTo||"vertices"===h.boundTo))if(e=h.value.length,g=0,1===h.size)for(d=0;d<e;d++)h.array[d]=h.value[d];else if(2===h.size)for(d=0;d<e;d++)f=h.value[d],h.array[g]=f.x,h.array[g+1]=f.y,g+=2;else if(3===h.size)if("c"===
-h.type)for(d=0;d<e;d++)f=h.value[d],h.array[g]=f.r,h.array[g+1]=f.g,h.array[g+2]=f.b,g+=3;else for(d=0;d<e;d++)f=h.value[d],h.array[g]=f.x,h.array[g+1]=f.y,h.array[g+2]=f.z,g+=3;else if(4===h.size)for(d=0;d<e;d++)f=h.value[d],h.array[g]=f.x,h.array[g+1]=f.y,h.array[g+2]=f.z,h.array[g+3]=f.w,g+=4}if(o||c.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,k,b);if(p||c.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,a.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,
-n,b);if(q)for(i=0,m=q.length;i<m;i++)if(h=q[i],h.needsUpdate||c.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,h.buffer),j.bufferData(j.ARRAY_BUFFER,h.array,b)}function f(a,b){return b.z-a.z}function h(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)ga=B=null,Z=O=ba=R=aa=-1,a[d].render(b,c,Va,lb),ga=B=null,Z=O=ba=R=aa=-1}function i(a,b,c,d,e,g,f,h){var j,i,m,k;b?(i=a.length-1,k=b=-1):(i=0,b=a.length,k=1);for(var n=i;n!==b;n+=k)if(j=a[n],j.render){i=j.object;m=j.buffer;if(h)j=h;else{j=j[c];if(!j)continue;
-f&&H.setBlending(j.blending);H.setDepthTest(j.depthTest);H.setDepthWrite(j.depthWrite);s(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits)}H.setObjectFaces(i);m instanceof THREE.BufferGeometry?H.renderBufferDirect(d,e,g,j,m,i):H.renderBuffer(d,e,g,j,m,i)}}function k(a,b,c,d,e,g,f){for(var h,j,i=0,m=a.length;i<m;i++)if(h=a[i],j=h.object,j.visible){if(f)h=f;else{h=h[b];if(!h)continue;g&&H.setBlending(h.blending);H.setDepthTest(h.depthTest);H.setDepthWrite(h.depthWrite);s(h.polygonOffset,h.polygonOffsetFactor,
-h.polygonOffsetUnits)}H.renderImmediateObject(c,d,e,h,j)}}function l(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function n(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function o(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function q(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function m(a,b,c,d,e){d.program||H.initMaterial(d,b,c,e);if(d.morphTargets&&
-!e.__webglMorphTargetInfluences){e.__webglMorphTargetInfluences=new Float32Array(H.maxMorphTargets);for(var g=0,f=H.maxMorphTargets;g<f;g++)e.__webglMorphTargetInfluences[g]=0}var h=!1,g=d.program,f=g.uniforms,i=d.uniforms;g!==B&&(j.useProgram(g),B=g,h=!0);if(d.id!==Z)Z=d.id,h=!0;if(h||a!==ga)j.uniformMatrix4fv(f.projectionMatrix,!1,a._projectionMatrixArray),a!==ga&&(ga=a);if(h){if(c&&d.fog)if(i.fogColor.value=c.color,c instanceof THREE.Fog)i.fogNear.value=c.near,i.fogFar.value=c.far;else if(c instanceof
-THREE.FogExp2)i.fogDensity.value=c.density;if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){var m,k=0,n=0,l=0,o,p,q,r=ta,s=r.directional.colors,t=r.directional.positions,F=r.point.colors,u=r.point.positions,v=r.point.distances,O=0,C=0,A=q=0;for(c=0,h=b.length;c<h;c++)if(m=b[c],!m.onlyShadow)if(o=m.color,p=m.intensity,q=m.distance,m instanceof THREE.AmbientLight)H.gammaInput?(k+=o.r*o.r,n+=o.g*o.g,l+=o.b*o.b):(k+=o.r,n+=o.g,l+=o.b);else if(m instanceof THREE.DirectionalLight)q=
-3*O,H.gammaInput?(s[q]=o.r*o.r*p*p,s[q+1]=o.g*o.g*p*p,s[q+2]=o.b*o.b*p*p):(s[q]=o.r*p,s[q+1]=o.g*p,s[q+2]=o.b*p),La.copy(m.matrixWorld.getPosition()),La.subSelf(m.target.matrixWorld.getPosition()),La.normalize(),t[q]=La.x,t[q+1]=La.y,t[q+2]=La.z,O+=1;else if(m instanceof THREE.PointLight||m instanceof THREE.SpotLight)A=3*C,H.gammaInput?(F[A]=o.r*o.r*p*p,F[A+1]=o.g*o.g*p*p,F[A+2]=o.b*o.b*p*p):(F[A]=o.r*p,F[A+1]=o.g*p,F[A+2]=o.b*p),m=m.matrixWorld.getPosition(),u[A]=m.x,u[A+1]=m.y,u[A+2]=m.z,v[C]=q,
-C+=1;for(c=3*O,h=s.length;c<h;c++)s[c]=0;for(c=3*C,h=F.length;c<h;c++)F[c]=0;r.point.length=C;r.directional.length=O;r.ambient[0]=k;r.ambient[1]=n;r.ambient[2]=l;c=ta;i.ambientLightColor.value=c.ambient;i.directionalLightColor.value=c.directional.colors;i.directionalLightDirection.value=c.directional.positions;i.pointLightColor.value=c.point.colors;i.pointLightPosition.value=c.point.positions;i.pointLightDistance.value=c.point.distances}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||
+h.array[g]=f.x,h.array[g+1]=f.y,h.array[g+2]=f.z,h.array[g+3]=f.w,g+=4}else{if(o)for(d=0;d<f;d++)e=h[d].position,g=3*d,m[g]=e.x,m[g+1]=e.y,m[g+2]=e.z;if(p)for(d=0;d<k;d++)e=i[d],g=3*d,n[g]=e.r,n[g+1]=e.g,n[g+2]=e.b;if(q)for(i=0,k=q.length;i<k;i++)if(h=q[i],h.needsUpdate&&(void 0===h.boundTo||"vertices"===h.boundTo))if(e=h.value.length,g=0,1===h.size)for(d=0;d<e;d++)h.array[d]=h.value[d];else if(2===h.size)for(d=0;d<e;d++)f=h.value[d],h.array[g]=f.x,h.array[g+1]=f.y,g+=2;else if(3===h.size)if("c"===
+h.type)for(d=0;d<e;d++)f=h.value[d],h.array[g]=f.r,h.array[g+1]=f.g,h.array[g+2]=f.b,g+=3;else for(d=0;d<e;d++)f=h.value[d],h.array[g]=f.x,h.array[g+1]=f.y,h.array[g+2]=f.z,g+=3;else if(4===h.size)for(d=0;d<e;d++)f=h.value[d],h.array[g]=f.x,h.array[g+1]=f.y,h.array[g+2]=f.z,h.array[g+3]=f.w,g+=4}if(o||c.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,m,b);if(p||c.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,a.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,
+n,b);if(q)for(i=0,k=q.length;i<k;i++)if(h=q[i],h.needsUpdate||c.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,h.buffer),j.bufferData(j.ARRAY_BUFFER,h.array,b)}function f(a,b){return b.z-a.z}function h(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)fa=F=null,Y=O=aa=Q=$=-1,a[d].render(b,c,Va,lb),fa=F=null,Y=O=aa=Q=$=-1}function i(a,b,c,d,e,g,f,h){var j,i,k,m;b?(i=a.length-1,m=b=-1):(i=0,b=a.length,m=1);for(var n=i;n!==b;n+=m)if(j=a[n],j.render){i=j.object;k=j.buffer;if(h)j=h;else{j=j[c];if(!j)continue;
+f&&H.setBlending(j.blending);H.setDepthTest(j.depthTest);H.setDepthWrite(j.depthWrite);s(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits)}H.setObjectFaces(i);k instanceof THREE.BufferGeometry?H.renderBufferDirect(d,e,g,j,k,i):H.renderBuffer(d,e,g,j,k,i)}}function l(a,b,c,d,e,g,f){for(var h,j,i=0,k=a.length;i<k;i++)if(h=a[i],j=h.object,j.visible){if(f)h=f;else{h=h[b];if(!h)continue;g&&H.setBlending(h.blending);H.setDepthTest(h.depthTest);H.setDepthWrite(h.depthWrite);s(h.polygonOffset,h.polygonOffsetFactor,
+h.polygonOffsetUnits)}H.renderImmediateObject(c,d,e,h,j)}}function k(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function n(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function o(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function q(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function m(a,b,c,d,e){d.program||H.initMaterial(d,b,c,e);if(d.morphTargets&&
+!e.__webglMorphTargetInfluences){e.__webglMorphTargetInfluences=new Float32Array(H.maxMorphTargets);for(var g=0,f=H.maxMorphTargets;g<f;g++)e.__webglMorphTargetInfluences[g]=0}var h=!1,g=d.program,f=g.uniforms,i=d.uniforms;g!==F&&(j.useProgram(g),F=g,h=!0);if(d.id!==Y)Y=d.id,h=!0;if(h||a!==fa)j.uniformMatrix4fv(f.projectionMatrix,!1,a._projectionMatrixArray),a!==fa&&(fa=a);if(h){if(c&&d.fog)if(i.fogColor.value=c.color,c instanceof THREE.Fog)i.fogNear.value=c.near,i.fogFar.value=c.far;else if(c instanceof
+THREE.FogExp2)i.fogDensity.value=c.density;if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){var k,m=0,n=0,l=0,o,p,q,r=ta,s=r.directional.colors,t=r.directional.positions,E=r.point.colors,u=r.point.positions,v=r.point.distances,O=0,B=0,A=q=0;for(c=0,h=b.length;c<h;c++)if(k=b[c],!k.onlyShadow)if(o=k.color,p=k.intensity,q=k.distance,k instanceof THREE.AmbientLight)H.gammaInput?(m+=o.r*o.r,n+=o.g*o.g,l+=o.b*o.b):(m+=o.r,n+=o.g,l+=o.b);else if(k instanceof THREE.DirectionalLight)q=
+3*O,H.gammaInput?(s[q]=o.r*o.r*p*p,s[q+1]=o.g*o.g*p*p,s[q+2]=o.b*o.b*p*p):(s[q]=o.r*p,s[q+1]=o.g*p,s[q+2]=o.b*p),La.copy(k.matrixWorld.getPosition()),La.subSelf(k.target.matrixWorld.getPosition()),La.normalize(),t[q]=La.x,t[q+1]=La.y,t[q+2]=La.z,O+=1;else if(k instanceof THREE.PointLight||k instanceof THREE.SpotLight)A=3*B,H.gammaInput?(E[A]=o.r*o.r*p*p,E[A+1]=o.g*o.g*p*p,E[A+2]=o.b*o.b*p*p):(E[A]=o.r*p,E[A+1]=o.g*p,E[A+2]=o.b*p),k=k.matrixWorld.getPosition(),u[A]=k.x,u[A+1]=k.y,u[A+2]=k.z,v[B]=q,
+B+=1;for(c=3*O,h=s.length;c<h;c++)s[c]=0;for(c=3*B,h=E.length;c<h;c++)E[c]=0;r.point.length=B;r.directional.length=O;r.ambient[0]=m;r.ambient[1]=n;r.ambient[2]=l;c=ta;i.ambientLightColor.value=c.ambient;i.directionalLightColor.value=c.directional.colors;i.directionalLightDirection.value=c.directional.positions;i.pointLightColor.value=c.point.colors;i.pointLightPosition.value=c.point.positions;i.pointLightDistance.value=c.point.distances}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||
 d instanceof THREE.MeshPhongMaterial)i.opacity.value=d.opacity,H.gammaInput?i.diffuse.value.copyGammaToLinear(d.color):i.diffuse.value=d.color,(i.map.texture=d.map)&&i.offsetRepeat.value.set(d.map.offset.x,d.map.offset.y,d.map.repeat.x,d.map.repeat.y),i.lightMap.texture=d.lightMap,i.envMap.texture=d.envMap,i.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,i.reflectivity.value=d.reflectivity,i.refractionRatio.value=d.refractionRatio,i.combine.value=d.combine,i.useRefract.value=
 d instanceof THREE.MeshPhongMaterial)i.opacity.value=d.opacity,H.gammaInput?i.diffuse.value.copyGammaToLinear(d.color):i.diffuse.value=d.color,(i.map.texture=d.map)&&i.offsetRepeat.value.set(d.map.offset.x,d.map.offset.y,d.map.repeat.x,d.map.repeat.y),i.lightMap.texture=d.lightMap,i.envMap.texture=d.envMap,i.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,i.reflectivity.value=d.reflectivity,i.refractionRatio.value=d.refractionRatio,i.combine.value=d.combine,i.useRefract.value=
-d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping;if(d instanceof THREE.LineBasicMaterial)i.diffuse.value=d.color,i.opacity.value=d.opacity;else if(d instanceof THREE.ParticleBasicMaterial)i.psColor.value=d.color,i.opacity.value=d.opacity,i.size.value=d.size,i.scale.value=D.height/2,i.map.texture=d.map;else if(d instanceof THREE.MeshPhongMaterial)i.shininess.value=d.shininess,H.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),i.specular.value.copyGammaToLinear(d.specular)):
+d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping;if(d instanceof THREE.LineBasicMaterial)i.diffuse.value=d.color,i.opacity.value=d.opacity;else if(d instanceof THREE.ParticleBasicMaterial)i.psColor.value=d.color,i.opacity.value=d.opacity,i.size.value=d.size,i.scale.value=C.height/2,i.map.texture=d.map;else if(d instanceof THREE.MeshPhongMaterial)i.shininess.value=d.shininess,H.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),i.specular.value.copyGammaToLinear(d.specular)):
 (i.ambient.value=d.ambient,i.specular.value=d.specular),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB);else if(d instanceof THREE.MeshLambertMaterial)H.gammaInput?i.ambient.value.copyGammaToLinear(d.ambient):i.ambient.value=d.ambient,d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB);else if(d instanceof THREE.MeshDepthMaterial)i.mNear.value=a.near,i.mFar.value=a.far,i.opacity.value=d.opacity;else if(d instanceof THREE.MeshNormalMaterial)i.opacity.value=d.opacity;if(e.receiveShadow&&!d._shadowPass&&i.shadowMatrix){h=
 (i.ambient.value=d.ambient,i.specular.value=d.specular),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB);else if(d instanceof THREE.MeshLambertMaterial)H.gammaInput?i.ambient.value.copyGammaToLinear(d.ambient):i.ambient.value=d.ambient,d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB);else if(d instanceof THREE.MeshDepthMaterial)i.mNear.value=a.near,i.mFar.value=a.far,i.opacity.value=d.opacity;else if(d instanceof THREE.MeshNormalMaterial)i.opacity.value=d.opacity;if(e.receiveShadow&&!d._shadowPass&&i.shadowMatrix){h=
-c=0;for(k=b.length;h<k;h++)if(n=b[h],n.castShadow&&(n instanceof THREE.SpotLight||n instanceof THREE.DirectionalLight&&!n.shadowCascade))i.shadowMap.texture[c]=n.shadowMap,i.shadowMapSize.value[c]=n.shadowMapSize,i.shadowMatrix.value[c]=n.shadowMatrix,i.shadowDarkness.value[c]=n.shadowDarkness,i.shadowBias.value[c]=n.shadowBias,c++}b=d.uniformsList;for(i=0,c=b.length;i<c;i++)if(n=g.uniforms[b[i][1]])if(h=b[i][0],l=h.type,k=h.value,"i"===l)j.uniform1i(n,k);else if("f"===l)j.uniform1f(n,k);else if("v2"===
-l)j.uniform2f(n,k.x,k.y);else if("v3"===l)j.uniform3f(n,k.x,k.y,k.z);else if("v4"===l)j.uniform4f(n,k.x,k.y,k.z,k.w);else if("c"===l)j.uniform3f(n,k.r,k.g,k.b);else if("fv1"===l)j.uniform1fv(n,k);else if("fv"===l)j.uniform3fv(n,k);else if("v2v"===l){if(!h._array)h._array=new Float32Array(2*k.length);for(l=0,r=k.length;l<r;l++)s=2*l,h._array[s]=k[l].x,h._array[s+1]=k[l].y;j.uniform2fv(n,h._array)}else if("v3v"===l){if(!h._array)h._array=new Float32Array(3*k.length);for(l=0,r=k.length;l<r;l++)s=3*l,
-h._array[s]=k[l].x,h._array[s+1]=k[l].y,h._array[s+2]=k[l].z;j.uniform3fv(n,h._array)}else if("v4v"==l){if(!h._array)h._array=new Float32Array(4*k.length);for(l=0,r=k.length;l<r;l++)s=4*l,h._array[s]=k[l].x,h._array[s+1]=k[l].y,h._array[s+2]=k[l].z,h._array[s+3]=k[l].w;j.uniform4fv(n,h._array)}else if("m4"===l){if(!h._array)h._array=new Float32Array(16);k.flattenToArray(h._array);j.uniformMatrix4fv(n,!1,h._array)}else if("m4v"===l){if(!h._array)h._array=new Float32Array(16*k.length);for(l=0,r=k.length;l<
-r;l++)k[l].flattenToArrayOffset(h._array,16*l);j.uniformMatrix4fv(n,!1,h._array)}else if("t"===l){if(j.uniform1i(n,k),n=h.texture)if(n.image instanceof Array&&6===n.image.length){if(h=n,6===h.image.length)if(h.needsUpdate){if(!h.image.__webglTextureCube)h.image.__webglTextureCube=j.createTexture();j.activeTexture(j.TEXTURE0+k);j.bindTexture(j.TEXTURE_CUBE_MAP,h.image.__webglTextureCube);k=[];for(n=0;6>n;n++){l=k;r=n;if(H.autoScaleCubemaps){if(s=h.image[n],F=Fa,!(s.width<=F&&s.height<=F))u=Math.max(s.width,
-s.height),t=Math.floor(s.width*F/u),F=Math.floor(s.height*F/u),u=document.createElement("canvas"),u.width=t,u.height=F,u.getContext("2d").drawImage(s,0,0,s.width,s.height,0,0,t,F),s=u}else s=h.image[n];l[r]=s}n=k[0];l=0===(n.width&n.width-1)&&0===(n.height&n.height-1);r=y(h.format);s=y(h.type);w(j.TEXTURE_CUBE_MAP,h,l);for(n=0;6>n;n++)j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,r,r,s,k[n]);h.generateMipmaps&&l&&j.generateMipmap(j.TEXTURE_CUBE_MAP);h.needsUpdate=!1;if(h.onUpdated)h.onUpdated()}else j.activeTexture(j.TEXTURE0+
-k),j.bindTexture(j.TEXTURE_CUBE_MAP,h.image.__webglTextureCube)}else n instanceof THREE.WebGLRenderTargetCube?(h=n,j.activeTexture(j.TEXTURE0+k),j.bindTexture(j.TEXTURE_CUBE_MAP,h.__webglTexture)):H.setTexture(n,k)}else if("tv"===l){if(!h._array){h._array=[];for(l=0,r=h.texture.length;l<r;l++)h._array[l]=k+l}j.uniform1iv(n,h._array);for(l=0,r=h.texture.length;l<r;l++)(n=h.texture[l])&&H.setTexture(n,h._array[l])}if((d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&
+c=0;for(m=b.length;h<m;h++)if(n=b[h],n.castShadow&&(n instanceof THREE.SpotLight||n instanceof THREE.DirectionalLight&&!n.shadowCascade))i.shadowMap.texture[c]=n.shadowMap,i.shadowMapSize.value[c]=n.shadowMapSize,i.shadowMatrix.value[c]=n.shadowMatrix,i.shadowDarkness.value[c]=n.shadowDarkness,i.shadowBias.value[c]=n.shadowBias,c++}b=d.uniformsList;for(i=0,c=b.length;i<c;i++)if(n=g.uniforms[b[i][1]])if(h=b[i][0],l=h.type,m=h.value,"i"===l)j.uniform1i(n,m);else if("f"===l)j.uniform1f(n,m);else if("v2"===
+l)j.uniform2f(n,m.x,m.y);else if("v3"===l)j.uniform3f(n,m.x,m.y,m.z);else if("v4"===l)j.uniform4f(n,m.x,m.y,m.z,m.w);else if("c"===l)j.uniform3f(n,m.r,m.g,m.b);else if("fv1"===l)j.uniform1fv(n,m);else if("fv"===l)j.uniform3fv(n,m);else if("v2v"===l){if(!h._array)h._array=new Float32Array(2*m.length);for(l=0,r=m.length;l<r;l++)s=2*l,h._array[s]=m[l].x,h._array[s+1]=m[l].y;j.uniform2fv(n,h._array)}else if("v3v"===l){if(!h._array)h._array=new Float32Array(3*m.length);for(l=0,r=m.length;l<r;l++)s=3*l,
+h._array[s]=m[l].x,h._array[s+1]=m[l].y,h._array[s+2]=m[l].z;j.uniform3fv(n,h._array)}else if("v4v"==l){if(!h._array)h._array=new Float32Array(4*m.length);for(l=0,r=m.length;l<r;l++)s=4*l,h._array[s]=m[l].x,h._array[s+1]=m[l].y,h._array[s+2]=m[l].z,h._array[s+3]=m[l].w;j.uniform4fv(n,h._array)}else if("m4"===l){if(!h._array)h._array=new Float32Array(16);m.flattenToArray(h._array);j.uniformMatrix4fv(n,!1,h._array)}else if("m4v"===l){if(!h._array)h._array=new Float32Array(16*m.length);for(l=0,r=m.length;l<
+r;l++)m[l].flattenToArrayOffset(h._array,16*l);j.uniformMatrix4fv(n,!1,h._array)}else if("t"===l){if(j.uniform1i(n,m),n=h.texture)if(n.image instanceof Array&&6===n.image.length){if(h=n,6===h.image.length)if(h.needsUpdate){if(!h.image.__webglTextureCube)h.image.__webglTextureCube=j.createTexture();j.activeTexture(j.TEXTURE0+m);j.bindTexture(j.TEXTURE_CUBE_MAP,h.image.__webglTextureCube);m=[];for(n=0;6>n;n++){l=m;r=n;if(H.autoScaleCubemaps){if(s=h.image[n],E=Fa,!(s.width<=E&&s.height<=E))u=Math.max(s.width,
+s.height),t=Math.floor(s.width*E/u),E=Math.floor(s.height*E/u),u=document.createElement("canvas"),u.width=t,u.height=E,u.getContext("2d").drawImage(s,0,0,s.width,s.height,0,0,t,E),s=u}else s=h.image[n];l[r]=s}n=m[0];l=0===(n.width&n.width-1)&&0===(n.height&n.height-1);r=y(h.format);s=y(h.type);w(j.TEXTURE_CUBE_MAP,h,l);for(n=0;6>n;n++)j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,r,r,s,m[n]);h.generateMipmaps&&l&&j.generateMipmap(j.TEXTURE_CUBE_MAP);h.needsUpdate=!1;if(h.onUpdated)h.onUpdated()}else j.activeTexture(j.TEXTURE0+
+m),j.bindTexture(j.TEXTURE_CUBE_MAP,h.image.__webglTextureCube)}else n instanceof THREE.WebGLRenderTargetCube?(h=n,j.activeTexture(j.TEXTURE0+m),j.bindTexture(j.TEXTURE_CUBE_MAP,h.__webglTexture)):H.setTexture(n,m)}else if("tv"===l){if(!h._array){h._array=[];for(l=0,r=h.texture.length;l<r;l++)h._array[l]=m+l}j.uniform1iv(n,h._array);for(l=0,r=h.texture.length;l<r;l++)(n=h.texture[l])&&H.setTexture(n,h._array[l])}if((d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&
 null!==f.cameraPosition)b=a.matrixWorld.getPosition(),j.uniform3f(f.cameraPosition,b.x,b.y,b.z);(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==f.viewMatrix&&j.uniformMatrix4fv(f.viewMatrix,!1,a._viewMatrixArray);d.skinning&&j.uniformMatrix4fv(f.boneGlobalMatrices,!1,e.boneMatrices)}j.uniformMatrix4fv(f.modelViewMatrix,!1,e._modelViewMatrixArray);f.normalMatrix&&j.uniformMatrix3fv(f.normalMatrix,!1,e._normalMatrixArray);
 null!==f.cameraPosition)b=a.matrixWorld.getPosition(),j.uniform3f(f.cameraPosition,b.x,b.y,b.z);(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==f.viewMatrix&&j.uniformMatrix4fv(f.viewMatrix,!1,a._viewMatrixArray);d.skinning&&j.uniformMatrix4fv(f.boneGlobalMatrices,!1,e.boneMatrices)}j.uniformMatrix4fv(f.modelViewMatrix,!1,e._modelViewMatrixArray);f.normalMatrix&&j.uniformMatrix3fv(f.normalMatrix,!1,e._normalMatrixArray);
-(d instanceof THREE.ShaderMaterial||d.envMap||d.skinning||e.receiveShadow)&&null!==f.objectMatrix&&j.uniformMatrix4fv(f.objectMatrix,!1,e._objectMatrixArray);return g}function r(a,b){a._modelViewMatrix.multiplyToArray(b.matrixWorldInverse,a.matrixWorld,a._modelViewMatrixArray);var c=THREE.Matrix4.makeInvert3x3(a._modelViewMatrix);c&&c.transposeIntoArray(a._normalMatrixArray)}function s(a,b,c){ea!==a&&(a?j.enable(j.POLYGON_OFFSET_FILL):j.disable(j.POLYGON_OFFSET_FILL),ea=a);if(a&&(Ua!==b||Ha!==c))j.polygonOffset(b,
+(d instanceof THREE.ShaderMaterial||d.envMap||d.skinning||e.receiveShadow)&&null!==f.objectMatrix&&j.uniformMatrix4fv(f.objectMatrix,!1,e._objectMatrixArray);return g}function r(a,b){a._modelViewMatrix.multiplyToArray(b.matrixWorldInverse,a.matrixWorld,a._modelViewMatrixArray);var c=THREE.Matrix4.makeInvert3x3(a._modelViewMatrix);c&&c.transposeIntoArray(a._normalMatrixArray)}function s(a,b,c){da!==a&&(a?j.enable(j.POLYGON_OFFSET_FILL):j.disable(j.POLYGON_OFFSET_FILL),da=a);if(a&&(Ua!==b||Ha!==c))j.polygonOffset(b,
 c),Ua=b,Ha=c}function t(a,b){var c;"fragment"===a?c=j.createShader(j.FRAGMENT_SHADER):"vertex"===a&&(c=j.createShader(j.VERTEX_SHADER));j.shaderSource(c,b);j.compileShader(c);return!j.getShaderParameter(c,j.COMPILE_STATUS)?(console.error(j.getShaderInfoLog(c)),console.error(b),null):c}function w(a,b,c){c?(j.texParameteri(a,j.TEXTURE_WRAP_S,y(b.wrapS)),j.texParameteri(a,j.TEXTURE_WRAP_T,y(b.wrapT)),j.texParameteri(a,j.TEXTURE_MAG_FILTER,y(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,y(b.minFilter))):
 c),Ua=b,Ha=c}function t(a,b){var c;"fragment"===a?c=j.createShader(j.FRAGMENT_SHADER):"vertex"===a&&(c=j.createShader(j.VERTEX_SHADER));j.shaderSource(c,b);j.compileShader(c);return!j.getShaderParameter(c,j.COMPILE_STATUS)?(console.error(j.getShaderInfoLog(c)),console.error(b),null):c}function w(a,b,c){c?(j.texParameteri(a,j.TEXTURE_WRAP_S,y(b.wrapS)),j.texParameteri(a,j.TEXTURE_WRAP_T,y(b.wrapT)),j.texParameteri(a,j.TEXTURE_MAG_FILTER,y(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,y(b.minFilter))):
 (j.texParameteri(a,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_MAG_FILTER,v(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,v(b.minFilter)))}function u(a,b){j.bindRenderbuffer(j.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_COMPONENT16,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_ATTACHMENT,j.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,
 (j.texParameteri(a,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_MAG_FILTER,v(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,v(b.minFilter)))}function u(a,b){j.bindRenderbuffer(j.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_COMPONENT16,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_ATTACHMENT,j.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,
 j.DEPTH_STENCIL,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_STENCIL_ATTACHMENT,j.RENDERBUFFER,a)):j.renderbufferStorage(j.RENDERBUFFER,j.RGBA4,b.width,b.height)}function v(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return j.NEAREST;default:return j.LINEAR}}function y(a){switch(a){case THREE.RepeatWrapping:return j.REPEAT;case THREE.ClampToEdgeWrapping:return j.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return j.MIRRORED_REPEAT;
 j.DEPTH_STENCIL,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_STENCIL_ATTACHMENT,j.RENDERBUFFER,a)):j.renderbufferStorage(j.RENDERBUFFER,j.RGBA4,b.width,b.height)}function v(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return j.NEAREST;default:return j.LINEAR}}function y(a){switch(a){case THREE.RepeatWrapping:return j.REPEAT;case THREE.ClampToEdgeWrapping:return j.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return j.MIRRORED_REPEAT;
 case THREE.NearestFilter:return j.NEAREST;case THREE.NearestMipMapNearestFilter:return j.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return j.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return j.LINEAR;case THREE.LinearMipMapNearestFilter:return j.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return j.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return j.BYTE;case THREE.UnsignedByteType:return j.UNSIGNED_BYTE;case THREE.ShortType:return j.SHORT;case THREE.UnsignedShortType:return j.UNSIGNED_SHORT;
 case THREE.NearestFilter:return j.NEAREST;case THREE.NearestMipMapNearestFilter:return j.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return j.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return j.LINEAR;case THREE.LinearMipMapNearestFilter:return j.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return j.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return j.BYTE;case THREE.UnsignedByteType:return j.UNSIGNED_BYTE;case THREE.ShortType:return j.SHORT;case THREE.UnsignedShortType:return j.UNSIGNED_SHORT;
-case THREE.IntType:return j.INT;case THREE.UnsignedShortType:return j.UNSIGNED_INT;case THREE.FloatType:return j.FLOAT;case THREE.AlphaFormat:return j.ALPHA;case THREE.RGBFormat:return j.RGB;case THREE.RGBAFormat:return j.RGBA;case THREE.LuminanceFormat:return j.LUMINANCE;case THREE.LuminanceAlphaFormat:return j.LUMINANCE_ALPHA}return 0}var a=a||{},D=void 0!==a.canvas?a.canvas:document.createElement("canvas"),A=void 0!==a.precision?a.precision:"mediump",C=void 0!==a.alpha?a.alpha:!0,E=void 0!==a.premultipliedAlpha?
-a.premultipliedAlpha:!0,J=void 0!==a.antialias?a.antialias:!1,N=void 0!==a.stencil?a.stencil:!0,T=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,K=void 0!==a.clearColor?new THREE.Color(a.clearColor):new THREE.Color(0),P=void 0!==a.clearAlpha?a.clearAlpha:0,M=void 0!==a.maxLights?a.maxLights:4;this.domElement=D;this.context=null;this.autoUpdateScene=this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=
-this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapCullFrontFaces=this.shadowMapSoft=this.shadowMapAutoUpdate=!0;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var H=this,j,Y=[],B=null,F=null,Z=-1,O=null,ga=null,da=0,ia=null,S=null,aa=null,R=null,ba=null,
-ea=null,Ua=null,Ha=null,na=null,Ia=0,ra=0,qa=0,ib=0,Va=0,lb=0,db=new THREE.Frustum,Wa=new THREE.Matrix4,$a=new THREE.Vector4,La=new THREE.Vector3,ta={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}};j=function(){var a;try{if(!(a=D.getContext("experimental-webgl",{alpha:C,premultipliedAlpha:E,antialias:J,stencil:N,preserveDrawingBuffer:T})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+a.getParameter(a.VERSION)+
+case THREE.IntType:return j.INT;case THREE.UnsignedShortType:return j.UNSIGNED_INT;case THREE.FloatType:return j.FLOAT;case THREE.AlphaFormat:return j.ALPHA;case THREE.RGBFormat:return j.RGB;case THREE.RGBAFormat:return j.RGBA;case THREE.LuminanceFormat:return j.LUMINANCE;case THREE.LuminanceAlphaFormat:return j.LUMINANCE_ALPHA}return 0}var a=a||{},C=void 0!==a.canvas?a.canvas:document.createElement("canvas"),A=void 0!==a.precision?a.precision:"mediump",B=void 0!==a.alpha?a.alpha:!0,D=void 0!==a.premultipliedAlpha?
+a.premultipliedAlpha:!0,J=void 0!==a.antialias?a.antialias:!1,N=void 0!==a.stencil?a.stencil:!0,S=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,K=void 0!==a.clearColor?new THREE.Color(a.clearColor):new THREE.Color(0),P=void 0!==a.clearAlpha?a.clearAlpha:0,M=void 0!==a.maxLights?a.maxLights:4;this.domElement=C;this.context=null;this.autoUpdateScene=this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=
+this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapCullFrontFaces=this.shadowMapSoft=this.shadowMapAutoUpdate=!0;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var H=this,j,X=[],F=null,E=null,Y=-1,O=null,fa=null,ca=0,ha=null,R=null,$=null,Q=null,aa=null,
+da=null,Ua=null,Ha=null,ma=null,Ia=0,ra=0,pa=0,ib=0,Va=0,lb=0,db=new THREE.Frustum,Wa=new THREE.Matrix4,$a=new THREE.Vector4,La=new THREE.Vector3,ta={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}};j=function(){var a;try{if(!(a=C.getContext("experimental-webgl",{alpha:B,premultipliedAlpha:D,antialias:J,stencil:N,preserveDrawingBuffer:S})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+a.getParameter(a.VERSION)+
 " | "+a.getParameter(a.VENDOR)+" | "+a.getParameter(a.RENDERER)+" | "+a.getParameter(a.SHADING_LANGUAGE_VERSION))}catch(b){console.error(b)}return a}();j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA);j.clearColor(K.r,K.g,K.b,P);this.context=j;var Aa=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);
 " | "+a.getParameter(a.VENDOR)+" | "+a.getParameter(a.RENDERER)+" | "+a.getParameter(a.SHADING_LANGUAGE_VERSION))}catch(b){console.error(b)}return a}();j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA);j.clearColor(K.r,K.g,K.b,P);this.context=j;var Aa=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);
-j.getParameter(j.MAX_TEXTURE_SIZE);var Fa=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE);this.getContext=function(){return j};this.supportsVertexTextures=function(){return 0<Aa};this.setSize=function(a,b){D.width=a;D.height=b;this.setViewport(0,0,D.width,D.height)};this.setViewport=function(a,b,c,d){Ia=a;ra=b;qa=c;ib=d;j.viewport(Ia,ra,qa,ib)};this.setScissor=function(a,b,c,d){j.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};this.setClearColorHex=
+j.getParameter(j.MAX_TEXTURE_SIZE);var Fa=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE);this.getContext=function(){return j};this.supportsVertexTextures=function(){return 0<Aa};this.setSize=function(a,b){C.width=a;C.height=b;this.setViewport(0,0,C.width,C.height)};this.setViewport=function(a,b,c,d){Ia=a;ra=b;pa=c;ib=d;j.viewport(Ia,ra,pa,ib)};this.setScissor=function(a,b,c,d){j.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};this.setClearColorHex=
 function(a,b){K.setHex(a);P=b;j.clearColor(K.r,K.g,K.b,P)};this.setClearColor=function(a,b){K.copy(a);P=b;j.clearColor(K.r,K.g,K.b,P)};this.getClearColor=function(){return K};this.getClearAlpha=function(){return P};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);
 function(a,b){K.setHex(a);P=b;j.clearColor(K.r,K.g,K.b,P)};this.setClearColor=function(a,b){K.copy(a);P=b;j.clearColor(K.r,K.g,K.b,P)};this.getClearColor=function(){return K};this.getClearAlpha=function(){return P};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);
 this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.deallocateObject=function(a){if(a.__webglInit)if(a.__webglInit=!1,delete a._modelViewMatrix,delete a._normalMatrixArray,delete a._modelViewMatrixArray,delete a._objectMatrixArray,a instanceof THREE.Mesh)for(var b in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[b];j.deleteBuffer(c.__webglVertexBuffer);j.deleteBuffer(c.__webglNormalBuffer);j.deleteBuffer(c.__webglTangentBuffer);
 this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.deallocateObject=function(a){if(a.__webglInit)if(a.__webglInit=!1,delete a._modelViewMatrix,delete a._normalMatrixArray,delete a._modelViewMatrixArray,delete a._objectMatrixArray,a instanceof THREE.Mesh)for(var b in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[b];j.deleteBuffer(c.__webglVertexBuffer);j.deleteBuffer(c.__webglNormalBuffer);j.deleteBuffer(c.__webglTangentBuffer);
 j.deleteBuffer(c.__webglColorBuffer);j.deleteBuffer(c.__webglUVBuffer);j.deleteBuffer(c.__webglUV2Buffer);j.deleteBuffer(c.__webglSkinVertexABuffer);j.deleteBuffer(c.__webglSkinVertexBBuffer);j.deleteBuffer(c.__webglSkinIndicesBuffer);j.deleteBuffer(c.__webglSkinWeightsBuffer);j.deleteBuffer(c.__webglFaceBuffer);j.deleteBuffer(c.__webglLineBuffer);var d=void 0,e=void 0;if(c.numMorphTargets)for(d=0,e=c.numMorphTargets;d<e;d++)j.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(c.numMorphNormals)for(d=
 j.deleteBuffer(c.__webglColorBuffer);j.deleteBuffer(c.__webglUVBuffer);j.deleteBuffer(c.__webglUV2Buffer);j.deleteBuffer(c.__webglSkinVertexABuffer);j.deleteBuffer(c.__webglSkinVertexBBuffer);j.deleteBuffer(c.__webglSkinIndicesBuffer);j.deleteBuffer(c.__webglSkinWeightsBuffer);j.deleteBuffer(c.__webglFaceBuffer);j.deleteBuffer(c.__webglLineBuffer);var d=void 0,e=void 0;if(c.numMorphTargets)for(d=0,e=c.numMorphTargets;d<e;d++)j.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(c.numMorphNormals)for(d=
 0,e=c.numMorphNormals;d<e;d++)j.deleteBuffer(c.__webglMorphNormalsBuffers[d]);if(c.__webglCustomAttributesList)for(d in d=void 0,c.__webglCustomAttributesList)j.deleteBuffer(c.__webglCustomAttributesList[d].buffer);H.info.memory.geometries--}else if(a instanceof THREE.Ribbon)a=a.geometry,j.deleteBuffer(a.__webglVertexBuffer),j.deleteBuffer(a.__webglColorBuffer),H.info.memory.geometries--;else if(a instanceof THREE.Line)a=a.geometry,j.deleteBuffer(a.__webglVertexBuffer),j.deleteBuffer(a.__webglColorBuffer),
 0,e=c.numMorphNormals;d<e;d++)j.deleteBuffer(c.__webglMorphNormalsBuffers[d]);if(c.__webglCustomAttributesList)for(d in d=void 0,c.__webglCustomAttributesList)j.deleteBuffer(c.__webglCustomAttributesList[d].buffer);H.info.memory.geometries--}else if(a instanceof THREE.Ribbon)a=a.geometry,j.deleteBuffer(a.__webglVertexBuffer),j.deleteBuffer(a.__webglColorBuffer),H.info.memory.geometries--;else if(a instanceof THREE.Line)a=a.geometry,j.deleteBuffer(a.__webglVertexBuffer),j.deleteBuffer(a.__webglColorBuffer),
-H.info.memory.geometries--;else if(a instanceof THREE.ParticleSystem)a=a.geometry,j.deleteBuffer(a.__webglVertexBuffer),j.deleteBuffer(a.__webglColorBuffer),H.info.memory.geometries--};this.deallocateTexture=function(a){if(a.__webglInit)a.__webglInit=!1,j.deleteTexture(a.__webglTexture),H.info.memory.textures--};this.updateShadowMap=function(a,b){B=null;Z=O=ba=R=aa=-1;this.shadowMapPlugin.update(a,b)};this.renderBufferImmediate=function(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=j.createBuffer();
+H.info.memory.geometries--;else if(a instanceof THREE.ParticleSystem)a=a.geometry,j.deleteBuffer(a.__webglVertexBuffer),j.deleteBuffer(a.__webglColorBuffer),H.info.memory.geometries--};this.deallocateTexture=function(a){if(a.__webglInit)a.__webglInit=!1,j.deleteTexture(a.__webglTexture),H.info.memory.textures--};this.updateShadowMap=function(a,b){F=null;Y=O=aa=Q=$=-1;this.shadowMapPlugin.update(a,b)};this.renderBufferImmediate=function(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=j.createBuffer();
 if(!a.__webglNormalBuffer)a.__webglNormalBuffer=j.createBuffer();a.hasPos&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,a.positionArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.position),j.vertexAttribPointer(b.attributes.position,3,j.FLOAT,!1,0,0));if(a.hasNormal){j.bindBuffer(j.ARRAY_BUFFER,a.__webglNormalBuffer);if(c===THREE.FlatShading){var d,e,g,f,h,i,m,k,n,l,o=3*a.count;for(l=0;l<o;l+=9)c=a.normalArray,d=c[l],e=c[l+1],g=c[l+2],f=c[l+3],i=c[l+
 if(!a.__webglNormalBuffer)a.__webglNormalBuffer=j.createBuffer();a.hasPos&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,a.positionArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.position),j.vertexAttribPointer(b.attributes.position,3,j.FLOAT,!1,0,0));if(a.hasNormal){j.bindBuffer(j.ARRAY_BUFFER,a.__webglNormalBuffer);if(c===THREE.FlatShading){var d,e,g,f,h,i,m,k,n,l,o=3*a.count;for(l=0;l<o;l+=9)c=a.normalArray,d=c[l],e=c[l+1],g=c[l+2],f=c[l+3],i=c[l+
 4],k=c[l+5],h=c[l+6],m=c[l+7],n=c[l+8],d=(d+f+h)/3,e=(e+i+m)/3,g=(g+k+n)/3,c[l]=d,c[l+1]=e,c[l+2]=g,c[l+3]=d,c[l+4]=e,c[l+5]=g,c[l+6]=d,c[l+7]=e,c[l+8]=g}j.bufferData(j.ARRAY_BUFFER,a.normalArray,j.DYNAMIC_DRAW);j.enableVertexAttribArray(b.attributes.normal);j.vertexAttribPointer(b.attributes.normal,3,j.FLOAT,!1,0,0)}j.drawArrays(j.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,g){if(0!==d.opacity&&(c=m(a,b,c,d,g),a=c.attributes,b=!1,d=16777215*e.id+2*c.id+(d.wireframe?
 4],k=c[l+5],h=c[l+6],m=c[l+7],n=c[l+8],d=(d+f+h)/3,e=(e+i+m)/3,g=(g+k+n)/3,c[l]=d,c[l+1]=e,c[l+2]=g,c[l+3]=d,c[l+4]=e,c[l+5]=g,c[l+6]=d,c[l+7]=e,c[l+8]=g}j.bufferData(j.ARRAY_BUFFER,a.normalArray,j.DYNAMIC_DRAW);j.enableVertexAttribArray(b.attributes.normal);j.vertexAttribPointer(b.attributes.normal,3,j.FLOAT,!1,0,0)}j.drawArrays(j.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,g){if(0!==d.opacity&&(c=m(a,b,c,d,g),a=c.attributes,b=!1,d=16777215*e.id+2*c.id+(d.wireframe?
 1:0),d!==O&&(O=d,b=!0),g instanceof THREE.Mesh)){g=e.offsets;d=0;for(c=g.length;d<c;++d)b&&(j.bindBuffer(j.ARRAY_BUFFER,e.vertexPositionBuffer),j.vertexAttribPointer(a.position,e.vertexPositionBuffer.itemSize,j.FLOAT,!1,0,12*g[d].index),0<=a.normal&&e.vertexNormalBuffer&&(j.bindBuffer(j.ARRAY_BUFFER,e.vertexNormalBuffer),j.vertexAttribPointer(a.normal,e.vertexNormalBuffer.itemSize,j.FLOAT,!1,0,12*g[d].index)),0<=a.uv&&e.vertexUvBuffer&&(e.vertexUvBuffer?(j.bindBuffer(j.ARRAY_BUFFER,e.vertexUvBuffer),
 1:0),d!==O&&(O=d,b=!0),g instanceof THREE.Mesh)){g=e.offsets;d=0;for(c=g.length;d<c;++d)b&&(j.bindBuffer(j.ARRAY_BUFFER,e.vertexPositionBuffer),j.vertexAttribPointer(a.position,e.vertexPositionBuffer.itemSize,j.FLOAT,!1,0,12*g[d].index),0<=a.normal&&e.vertexNormalBuffer&&(j.bindBuffer(j.ARRAY_BUFFER,e.vertexNormalBuffer),j.vertexAttribPointer(a.normal,e.vertexNormalBuffer.itemSize,j.FLOAT,!1,0,12*g[d].index)),0<=a.uv&&e.vertexUvBuffer&&(e.vertexUvBuffer?(j.bindBuffer(j.ARRAY_BUFFER,e.vertexUvBuffer),
@@ -287,79 +287,79 @@ f],3,j.FLOAT,!1,0,0)),g.__webglMorphTargetInfluences[f]=h[i[f]],f++}else{var i=[
 f],3,j.FLOAT,!1,0,0));g.__webglMorphTargetInfluences[f]=k;i[l]=1;k=-1;f++}}null!==d.program.uniforms.morphTargetInfluences&&j.uniform1fv(d.program.uniforms.morphTargetInfluences,g.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(f=0,h=e.__webglCustomAttributesList.length;f<h;f++)c=e.__webglCustomAttributesList[f],0<=b[c.buffer.belongsToAttribute]&&(j.bindBuffer(j.ARRAY_BUFFER,c.buffer),j.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,j.FLOAT,!1,0,0));0<=b.color&&
 f],3,j.FLOAT,!1,0,0));g.__webglMorphTargetInfluences[f]=k;i[l]=1;k=-1;f++}}null!==d.program.uniforms.morphTargetInfluences&&j.uniform1fv(d.program.uniforms.morphTargetInfluences,g.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(f=0,h=e.__webglCustomAttributesList.length;f<h;f++)c=e.__webglCustomAttributesList[f],0<=b[c.buffer.belongsToAttribute]&&(j.bindBuffer(j.ARRAY_BUFFER,c.buffer),j.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,j.FLOAT,!1,0,0));0<=b.color&&
 (j.bindBuffer(j.ARRAY_BUFFER,e.__webglColorBuffer),j.vertexAttribPointer(b.color,3,j.FLOAT,!1,0,0));0<=b.normal&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglNormalBuffer),j.vertexAttribPointer(b.normal,3,j.FLOAT,!1,0,0));0<=b.tangent&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglTangentBuffer),j.vertexAttribPointer(b.tangent,4,j.FLOAT,!1,0,0));0<=b.uv&&(e.__webglUVBuffer?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUVBuffer),j.vertexAttribPointer(b.uv,2,j.FLOAT,!1,0,0),j.enableVertexAttribArray(b.uv)):j.disableVertexAttribArray(b.uv));
 (j.bindBuffer(j.ARRAY_BUFFER,e.__webglColorBuffer),j.vertexAttribPointer(b.color,3,j.FLOAT,!1,0,0));0<=b.normal&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglNormalBuffer),j.vertexAttribPointer(b.normal,3,j.FLOAT,!1,0,0));0<=b.tangent&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglTangentBuffer),j.vertexAttribPointer(b.tangent,4,j.FLOAT,!1,0,0));0<=b.uv&&(e.__webglUVBuffer?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUVBuffer),j.vertexAttribPointer(b.uv,2,j.FLOAT,!1,0,0),j.enableVertexAttribArray(b.uv)):j.disableVertexAttribArray(b.uv));
 0<=b.uv2&&(e.__webglUV2Buffer?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUV2Buffer),j.vertexAttribPointer(b.uv2,2,j.FLOAT,!1,0,0),j.enableVertexAttribArray(b.uv2)):j.disableVertexAttribArray(b.uv2));d.skinning&&0<=b.skinVertexA&&0<=b.skinVertexB&&0<=b.skinIndex&&0<=b.skinWeight&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinVertexABuffer),j.vertexAttribPointer(b.skinVertexA,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinVertexBBuffer),j.vertexAttribPointer(b.skinVertexB,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,
 0<=b.uv2&&(e.__webglUV2Buffer?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUV2Buffer),j.vertexAttribPointer(b.uv2,2,j.FLOAT,!1,0,0),j.enableVertexAttribArray(b.uv2)):j.disableVertexAttribArray(b.uv2));d.skinning&&0<=b.skinVertexA&&0<=b.skinVertexB&&0<=b.skinIndex&&0<=b.skinWeight&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinVertexABuffer),j.vertexAttribPointer(b.skinVertexA,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinVertexBBuffer),j.vertexAttribPointer(b.skinVertexB,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,
-e.__webglSkinIndicesBuffer),j.vertexAttribPointer(b.skinIndex,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),j.vertexAttribPointer(b.skinWeight,4,j.FLOAT,!1,0,0))}g instanceof THREE.Mesh?(d.wireframe?(d=d.wireframeLinewidth,d!==na&&(j.lineWidth(d),na=d),a&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),j.drawElements(j.LINES,e.__webglLineCount,j.UNSIGNED_SHORT,0)):(a&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),j.drawElements(j.TRIANGLES,e.__webglFaceCount,
-j.UNSIGNED_SHORT,0)),H.info.render.calls++,H.info.render.vertices+=e.__webglFaceCount,H.info.render.faces+=e.__webglFaceCount/3):g instanceof THREE.Line?(g=g.type===THREE.LineStrip?j.LINE_STRIP:j.LINES,d=d.linewidth,d!==na&&(j.lineWidth(d),na=d),j.drawArrays(g,0,e.__webglLineCount),H.info.render.calls++):g instanceof THREE.ParticleSystem?(j.drawArrays(j.POINTS,0,e.__webglParticleCount),H.info.render.calls++,H.info.render.points+=e.__webglParticleCount):g instanceof THREE.Ribbon&&(j.drawArrays(j.TRIANGLE_STRIP,
-0,e.__webglVertexCount),H.info.render.calls++)}};this.render=function(a,b,c,d){var e,g,m,l,n=a.lights,o=a.fog;Z=-1;this.autoUpdateObjects&&this.initWebGLObjects(a);void 0===b.parent&&(console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it..."),a.add(b));this.autoUpdateScene&&a.updateMatrixWorld();h(this.renderPluginsPre,a,b);H.info.render.calls=0;H.info.render.vertices=0;H.info.render.faces=0;H.info.render.points=0;b.matrixWorldInverse.getInverse(b.matrixWorld);if(!b._viewMatrixArray)b._viewMatrixArray=
-new Float32Array(16);b.matrixWorldInverse.flattenToArray(b._viewMatrixArray);if(!b._projectionMatrixArray)b._projectionMatrixArray=new Float32Array(16);b.projectionMatrix.flattenToArray(b._projectionMatrixArray);Wa.multiply(b.projectionMatrix,b.matrixWorldInverse);db.setFromMatrix(Wa);this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);l=a.__webglObjects;for(d=0,e=l.length;d<e;d++)if(g=l[d],m=g.object,g.render=!1,m.visible&&(!(m instanceof
-THREE.Mesh||m instanceof THREE.ParticleSystem)||!m.frustumCulled||db.contains(m))){m.matrixWorld.flattenToArray(m._objectMatrixArray);r(m,b);var p=g,q=p.object,t=p.buffer,F=void 0,F=F=void 0,F=q.material;if(F instanceof THREE.MeshFaceMaterial){if(F=t.materialIndex,0<=F)F=q.geometry.materials[F],F.transparent?(p.transparent=F,p.opaque=null):(p.opaque=F,p.transparent=null)}else if(F)F.transparent?(p.transparent=F,p.opaque=null):(p.opaque=F,p.transparent=null);g.render=!0;if(this.sortObjects)m.renderDepth?
-g.z=m.renderDepth:($a.copy(m.position),Wa.multiplyVector3($a),g.z=$a.z)}this.sortObjects&&l.sort(f);l=a.__webglObjectsImmediate;for(d=0,e=l.length;d<e;d++)if(g=l[d],m=g.object,m.visible)m.matrixAutoUpdate&&m.matrixWorld.flattenToArray(m._objectMatrixArray),r(m,b),m=g.object.material,m.transparent?(g.transparent=m,g.opaque=null):(g.opaque=m,g.transparent=null);a.overrideMaterial?(this.setBlending(a.overrideMaterial.blending),this.setDepthTest(a.overrideMaterial.depthTest),this.setDepthWrite(a.overrideMaterial.depthWrite),
-s(a.overrideMaterial.polygonOffset,a.overrideMaterial.polygonOffsetFactor,a.overrideMaterial.polygonOffsetUnits),i(a.__webglObjects,!1,"",b,n,o,!0,a.overrideMaterial),k(a.__webglObjectsImmediate,"",b,n,o,!1,a.overrideMaterial)):(this.setBlending(THREE.NormalBlending),i(a.__webglObjects,!0,"opaque",b,n,o,!1),k(a.__webglObjectsImmediate,"opaque",b,n,o,!1),i(a.__webglObjects,!1,"transparent",b,n,o,!0),k(a.__webglObjectsImmediate,"transparent",b,n,o,!0));h(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&
+e.__webglSkinIndicesBuffer),j.vertexAttribPointer(b.skinIndex,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),j.vertexAttribPointer(b.skinWeight,4,j.FLOAT,!1,0,0))}g instanceof THREE.Mesh?(d.wireframe?(d=d.wireframeLinewidth,d!==ma&&(j.lineWidth(d),ma=d),a&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),j.drawElements(j.LINES,e.__webglLineCount,j.UNSIGNED_SHORT,0)):(a&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),j.drawElements(j.TRIANGLES,e.__webglFaceCount,
+j.UNSIGNED_SHORT,0)),H.info.render.calls++,H.info.render.vertices+=e.__webglFaceCount,H.info.render.faces+=e.__webglFaceCount/3):g instanceof THREE.Line?(g=g.type===THREE.LineStrip?j.LINE_STRIP:j.LINES,d=d.linewidth,d!==ma&&(j.lineWidth(d),ma=d),j.drawArrays(g,0,e.__webglLineCount),H.info.render.calls++):g instanceof THREE.ParticleSystem?(j.drawArrays(j.POINTS,0,e.__webglParticleCount),H.info.render.calls++,H.info.render.points+=e.__webglParticleCount):g instanceof THREE.Ribbon&&(j.drawArrays(j.TRIANGLE_STRIP,
+0,e.__webglVertexCount),H.info.render.calls++)}};this.render=function(a,b,c,d){var e,g,k,m,n=a.lights,o=a.fog;Y=-1;this.autoUpdateObjects&&this.initWebGLObjects(a);void 0===b.parent&&(console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it..."),a.add(b));this.autoUpdateScene&&a.updateMatrixWorld();h(this.renderPluginsPre,a,b);H.info.render.calls=0;H.info.render.vertices=0;H.info.render.faces=0;H.info.render.points=0;b.matrixWorldInverse.getInverse(b.matrixWorld);if(!b._viewMatrixArray)b._viewMatrixArray=
+new Float32Array(16);b.matrixWorldInverse.flattenToArray(b._viewMatrixArray);if(!b._projectionMatrixArray)b._projectionMatrixArray=new Float32Array(16);b.projectionMatrix.flattenToArray(b._projectionMatrixArray);Wa.multiply(b.projectionMatrix,b.matrixWorldInverse);db.setFromMatrix(Wa);this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=a.__webglObjects;for(d=0,e=m.length;d<e;d++)if(g=m[d],k=g.object,g.render=!1,k.visible&&(!(k instanceof
+THREE.Mesh||k instanceof THREE.ParticleSystem)||!k.frustumCulled||db.contains(k))){k.matrixWorld.flattenToArray(k._objectMatrixArray);r(k,b);var p=g,q=p.object,t=p.buffer,E=void 0,E=E=void 0,E=q.material;if(E instanceof THREE.MeshFaceMaterial){if(E=t.materialIndex,0<=E)E=q.geometry.materials[E],E.transparent?(p.transparent=E,p.opaque=null):(p.opaque=E,p.transparent=null)}else if(E)E.transparent?(p.transparent=E,p.opaque=null):(p.opaque=E,p.transparent=null);g.render=!0;if(this.sortObjects)k.renderDepth?
+g.z=k.renderDepth:($a.copy(k.position),Wa.multiplyVector3($a),g.z=$a.z)}this.sortObjects&&m.sort(f);m=a.__webglObjectsImmediate;for(d=0,e=m.length;d<e;d++)if(g=m[d],k=g.object,k.visible)k.matrixAutoUpdate&&k.matrixWorld.flattenToArray(k._objectMatrixArray),r(k,b),k=g.object.material,k.transparent?(g.transparent=k,g.opaque=null):(g.opaque=k,g.transparent=null);a.overrideMaterial?(this.setBlending(a.overrideMaterial.blending),this.setDepthTest(a.overrideMaterial.depthTest),this.setDepthWrite(a.overrideMaterial.depthWrite),
+s(a.overrideMaterial.polygonOffset,a.overrideMaterial.polygonOffsetFactor,a.overrideMaterial.polygonOffsetUnits),i(a.__webglObjects,!1,"",b,n,o,!0,a.overrideMaterial),l(a.__webglObjectsImmediate,"",b,n,o,!1,a.overrideMaterial)):(this.setBlending(THREE.NormalBlending),i(a.__webglObjects,!0,"opaque",b,n,o,!1),l(a.__webglObjectsImmediate,"opaque",b,n,o,!1),i(a.__webglObjects,!1,"transparent",b,n,o,!0),l(a.__webglObjectsImmediate,"transparent",b,n,o,!0));h(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&
 c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture),j.generateMipmap(j.TEXTURE_CUBE_MAP),j.bindTexture(j.TEXTURE_CUBE_MAP,null)):(j.bindTexture(j.TEXTURE_2D,c.__webglTexture),j.generateMipmap(j.TEXTURE_2D),j.bindTexture(j.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)};this.renderImmediateObject=function(a,b,c,d,e){var g=m(a,b,c,d,e);O=-1;H.setObjectFaces(e);e.immediateRenderCallback?
 c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture),j.generateMipmap(j.TEXTURE_CUBE_MAP),j.bindTexture(j.TEXTURE_CUBE_MAP,null)):(j.bindTexture(j.TEXTURE_2D,c.__webglTexture),j.generateMipmap(j.TEXTURE_2D),j.bindTexture(j.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)};this.renderImmediateObject=function(a,b,c,d,e){var g=m(a,b,c,d,e);O=-1;H.setObjectFaces(e);e.immediateRenderCallback?
-e.immediateRenderCallback(g,j,db):e.render(function(a){H.renderBufferImmediate(a,g,d.shading)})};this.initWebGLObjects=function(a){if(!a.__webglObjects)a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[];for(;a.__objectsAdded.length;){var f=a.__objectsAdded[0],h=a,i=void 0,m=void 0,k=void 0;if(!f.__webglInit)if(f.__webglInit=!0,f._modelViewMatrix=new THREE.Matrix4,f._normalMatrixArray=new Float32Array(9),f._modelViewMatrixArray=new Float32Array(16),f._objectMatrixArray=
-new Float32Array(16),f.matrixWorld.flattenToArray(f._objectMatrixArray),f instanceof THREE.Mesh){if(m=f.geometry,m instanceof THREE.Geometry){if(void 0===m.geometryGroups){var r=m,s=void 0,F=void 0,t=void 0,u=void 0,w=void 0,v=void 0,B=void 0,A={},C=r.morphTargets.length,O=r.morphNormals.length;r.geometryGroups={};for(s=0,F=r.faces.length;s<F;s++)t=r.faces[s],u=t.materialIndex,v=void 0!==u?u:-1,void 0===A[v]&&(A[v]={hash:v,counter:0}),B=A[v].hash+"_"+A[v].counter,void 0===r.geometryGroups[B]&&(r.geometryGroups[B]=
-{faces3:[],faces4:[],materialIndex:u,vertices:0,numMorphTargets:C,numMorphNormals:O}),w=t instanceof THREE.Face3?3:4,65535<r.geometryGroups[B].vertices+w&&(A[v].counter+=1,B=A[v].hash+"_"+A[v].counter,void 0===r.geometryGroups[B]&&(r.geometryGroups[B]={faces3:[],faces4:[],materialIndex:u,vertices:0,numMorphTargets:C,numMorphNormals:O})),t instanceof THREE.Face3?r.geometryGroups[B].faces3.push(s):r.geometryGroups[B].faces4.push(s),r.geometryGroups[B].vertices+=w;r.geometryGroupsList=[];var Z=void 0;
-for(Z in r.geometryGroups)r.geometryGroups[Z].id=da++,r.geometryGroupsList.push(r.geometryGroups[Z])}for(i in m.geometryGroups)if(k=m.geometryGroups[i],!k.__webglVertexBuffer){var y=k;y.__webglVertexBuffer=j.createBuffer();y.__webglNormalBuffer=j.createBuffer();y.__webglTangentBuffer=j.createBuffer();y.__webglColorBuffer=j.createBuffer();y.__webglUVBuffer=j.createBuffer();y.__webglUV2Buffer=j.createBuffer();y.__webglSkinVertexABuffer=j.createBuffer();y.__webglSkinVertexBBuffer=j.createBuffer();y.__webglSkinIndicesBuffer=
-j.createBuffer();y.__webglSkinWeightsBuffer=j.createBuffer();y.__webglFaceBuffer=j.createBuffer();y.__webglLineBuffer=j.createBuffer();var D=void 0,S=void 0;if(y.numMorphTargets){y.__webglMorphTargetsBuffers=[];for(D=0,S=y.numMorphTargets;D<S;D++)y.__webglMorphTargetsBuffers.push(j.createBuffer())}if(y.numMorphNormals){y.__webglMorphNormalsBuffers=[];for(D=0,S=y.numMorphNormals;D<S;D++)y.__webglMorphNormalsBuffers.push(j.createBuffer())}H.info.memory.geometries++;var E=k,M=f,K=M.geometry,J=E.faces3,
-ga=E.faces4,R=3*J.length+4*ga.length,N=1*J.length+2*ga.length,ia=3*J.length+4*ga.length,aa=c(M,E),ba=e(aa),P=d(aa),T=aa.vertexColors?aa.vertexColors:!1;E.__vertexArray=new Float32Array(3*R);if(P)E.__normalArray=new Float32Array(3*R);if(K.hasTangents)E.__tangentArray=new Float32Array(4*R);if(T)E.__colorArray=new Float32Array(3*R);if(ba){if(0<K.faceUvs.length||0<K.faceVertexUvs.length)E.__uvArray=new Float32Array(2*R);if(1<K.faceUvs.length||1<K.faceVertexUvs.length)E.__uv2Array=new Float32Array(2*R)}if(M.geometry.skinWeights.length&&
-M.geometry.skinIndices.length)E.__skinVertexAArray=new Float32Array(4*R),E.__skinVertexBArray=new Float32Array(4*R),E.__skinIndexArray=new Float32Array(4*R),E.__skinWeightArray=new Float32Array(4*R);E.__faceArray=new Uint16Array(3*N);E.__lineArray=new Uint16Array(2*ia);var ea=void 0,Y=void 0;if(E.numMorphTargets){E.__morphTargetsArrays=[];for(ea=0,Y=E.numMorphTargets;ea<Y;ea++)E.__morphTargetsArrays.push(new Float32Array(3*R))}if(E.numMorphNormals){E.__morphNormalsArrays=[];for(ea=0,Y=E.numMorphNormals;ea<
-Y;ea++)E.__morphNormalsArrays.push(new Float32Array(3*R))}E.__webglFaceCount=3*N;E.__webglLineCount=2*ia;if(aa.attributes){if(void 0===E.__webglCustomAttributesList)E.__webglCustomAttributesList=[];var Ua=void 0;for(Ua in aa.attributes){var Ha=aa.attributes[Ua],na={},qa;for(qa in Ha)na[qa]=Ha[qa];if(!na.__webglInitialized||na.createUniqueBuffers){na.__webglInitialized=!0;var ra=1;"v2"===na.type?ra=2:"v3"===na.type?ra=3:"v4"===na.type?ra=4:"c"===na.type&&(ra=3);na.size=ra;na.array=new Float32Array(R*
-ra);na.buffer=j.createBuffer();na.buffer.belongsToAttribute=Ua;Ha.needsUpdate=!0;na.__original=Ha}E.__webglCustomAttributesList.push(na)}}E.__inittedArrays=!0;m.__dirtyVertices=!0;m.__dirtyMorphTargets=!0;m.__dirtyElements=!0;m.__dirtyUvs=!0;m.__dirtyNormals=!0;m.__dirtyTangents=!0;m.__dirtyColors=!0}}}else if(f instanceof THREE.Ribbon){if(m=f.geometry,!m.__webglVertexBuffer){var Ia=m;Ia.__webglVertexBuffer=j.createBuffer();Ia.__webglColorBuffer=j.createBuffer();H.info.memory.geometries++;var ta=
+e.immediateRenderCallback(g,j,db):e.render(function(a){H.renderBufferImmediate(a,g,d.shading)})};this.initWebGLObjects=function(a){if(!a.__webglObjects)a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[];for(;a.__objectsAdded.length;){var f=a.__objectsAdded[0],h=a,i=void 0,m=void 0,l=void 0;if(!f.__webglInit)if(f.__webglInit=!0,f._modelViewMatrix=new THREE.Matrix4,f._normalMatrixArray=new Float32Array(9),f._modelViewMatrixArray=new Float32Array(16),f._objectMatrixArray=
+new Float32Array(16),f.matrixWorld.flattenToArray(f._objectMatrixArray),f instanceof THREE.Mesh){if(m=f.geometry,m instanceof THREE.Geometry){if(void 0===m.geometryGroups){var r=m,s=void 0,E=void 0,t=void 0,u=void 0,w=void 0,v=void 0,A=void 0,B={},F=r.morphTargets.length,O=r.morphNormals.length;r.geometryGroups={};for(s=0,E=r.faces.length;s<E;s++)t=r.faces[s],u=t.materialIndex,v=void 0!==u?u:-1,void 0===B[v]&&(B[v]={hash:v,counter:0}),A=B[v].hash+"_"+B[v].counter,void 0===r.geometryGroups[A]&&(r.geometryGroups[A]=
+{faces3:[],faces4:[],materialIndex:u,vertices:0,numMorphTargets:F,numMorphNormals:O}),w=t instanceof THREE.Face3?3:4,65535<r.geometryGroups[A].vertices+w&&(B[v].counter+=1,A=B[v].hash+"_"+B[v].counter,void 0===r.geometryGroups[A]&&(r.geometryGroups[A]={faces3:[],faces4:[],materialIndex:u,vertices:0,numMorphTargets:F,numMorphNormals:O})),t instanceof THREE.Face3?r.geometryGroups[A].faces3.push(s):r.geometryGroups[A].faces4.push(s),r.geometryGroups[A].vertices+=w;r.geometryGroupsList=[];var Y=void 0;
+for(Y in r.geometryGroups)r.geometryGroups[Y].id=ca++,r.geometryGroupsList.push(r.geometryGroups[Y])}for(i in m.geometryGroups)if(l=m.geometryGroups[i],!l.__webglVertexBuffer){var y=l;y.__webglVertexBuffer=j.createBuffer();y.__webglNormalBuffer=j.createBuffer();y.__webglTangentBuffer=j.createBuffer();y.__webglColorBuffer=j.createBuffer();y.__webglUVBuffer=j.createBuffer();y.__webglUV2Buffer=j.createBuffer();y.__webglSkinVertexABuffer=j.createBuffer();y.__webglSkinVertexBBuffer=j.createBuffer();y.__webglSkinIndicesBuffer=
+j.createBuffer();y.__webglSkinWeightsBuffer=j.createBuffer();y.__webglFaceBuffer=j.createBuffer();y.__webglLineBuffer=j.createBuffer();var C=void 0,R=void 0;if(y.numMorphTargets){y.__webglMorphTargetsBuffers=[];for(C=0,R=y.numMorphTargets;C<R;C++)y.__webglMorphTargetsBuffers.push(j.createBuffer())}if(y.numMorphNormals){y.__webglMorphNormalsBuffers=[];for(C=0,R=y.numMorphNormals;C<R;C++)y.__webglMorphNormalsBuffers.push(j.createBuffer())}H.info.memory.geometries++;var D=l,M=f,K=M.geometry,J=D.faces3,
+fa=D.faces4,Q=3*J.length+4*fa.length,N=1*J.length+2*fa.length,ha=3*J.length+4*fa.length,$=c(M,D),aa=e($),P=d($),S=$.vertexColors?$.vertexColors:!1;D.__vertexArray=new Float32Array(3*Q);if(P)D.__normalArray=new Float32Array(3*Q);if(K.hasTangents)D.__tangentArray=new Float32Array(4*Q);if(S)D.__colorArray=new Float32Array(3*Q);if(aa){if(0<K.faceUvs.length||0<K.faceVertexUvs.length)D.__uvArray=new Float32Array(2*Q);if(1<K.faceUvs.length||1<K.faceVertexUvs.length)D.__uv2Array=new Float32Array(2*Q)}if(M.geometry.skinWeights.length&&
+M.geometry.skinIndices.length)D.__skinVertexAArray=new Float32Array(4*Q),D.__skinVertexBArray=new Float32Array(4*Q),D.__skinIndexArray=new Float32Array(4*Q),D.__skinWeightArray=new Float32Array(4*Q);D.__faceArray=new Uint16Array(3*N);D.__lineArray=new Uint16Array(2*ha);var da=void 0,X=void 0;if(D.numMorphTargets){D.__morphTargetsArrays=[];for(da=0,X=D.numMorphTargets;da<X;da++)D.__morphTargetsArrays.push(new Float32Array(3*Q))}if(D.numMorphNormals){D.__morphNormalsArrays=[];for(da=0,X=D.numMorphNormals;da<
+X;da++)D.__morphNormalsArrays.push(new Float32Array(3*Q))}D.__webglFaceCount=3*N;D.__webglLineCount=2*ha;if($.attributes){if(void 0===D.__webglCustomAttributesList)D.__webglCustomAttributesList=[];var Ua=void 0;for(Ua in $.attributes){var Ha=$.attributes[Ua],ma={},pa;for(pa in Ha)ma[pa]=Ha[pa];if(!ma.__webglInitialized||ma.createUniqueBuffers){ma.__webglInitialized=!0;var ra=1;"v2"===ma.type?ra=2:"v3"===ma.type?ra=3:"v4"===ma.type?ra=4:"c"===ma.type&&(ra=3);ma.size=ra;ma.array=new Float32Array(Q*
+ra);ma.buffer=j.createBuffer();ma.buffer.belongsToAttribute=Ua;Ha.needsUpdate=!0;ma.__original=Ha}D.__webglCustomAttributesList.push(ma)}}D.__inittedArrays=!0;m.__dirtyVertices=!0;m.__dirtyMorphTargets=!0;m.__dirtyElements=!0;m.__dirtyUvs=!0;m.__dirtyNormals=!0;m.__dirtyTangents=!0;m.__dirtyColors=!0}}}else if(f instanceof THREE.Ribbon){if(m=f.geometry,!m.__webglVertexBuffer){var Ia=m;Ia.__webglVertexBuffer=j.createBuffer();Ia.__webglColorBuffer=j.createBuffer();H.info.memory.geometries++;var ta=
 m,Aa=ta.vertices.length;ta.__vertexArray=new Float32Array(3*Aa);ta.__colorArray=new Float32Array(3*Aa);ta.__webglVertexCount=Aa;m.__dirtyVertices=!0;m.__dirtyColors=!0}}else if(f instanceof THREE.Line){if(m=f.geometry,!m.__webglVertexBuffer){var La=m;La.__webglVertexBuffer=j.createBuffer();La.__webglColorBuffer=j.createBuffer();H.info.memory.geometries++;var Fa=m,ib=f,Wa=Fa.vertices.length;Fa.__vertexArray=new Float32Array(3*Wa);Fa.__colorArray=new Float32Array(3*Wa);Fa.__webglLineCount=Wa;b(Fa,ib);
 m,Aa=ta.vertices.length;ta.__vertexArray=new Float32Array(3*Aa);ta.__colorArray=new Float32Array(3*Aa);ta.__webglVertexCount=Aa;m.__dirtyVertices=!0;m.__dirtyColors=!0}}else if(f instanceof THREE.Line){if(m=f.geometry,!m.__webglVertexBuffer){var La=m;La.__webglVertexBuffer=j.createBuffer();La.__webglColorBuffer=j.createBuffer();H.info.memory.geometries++;var Fa=m,ib=f,Wa=Fa.vertices.length;Fa.__vertexArray=new Float32Array(3*Wa);Fa.__colorArray=new Float32Array(3*Wa);Fa.__webglLineCount=Wa;b(Fa,ib);
 m.__dirtyVertices=!0;m.__dirtyColors=!0}}else if(f instanceof THREE.ParticleSystem&&(m=f.geometry,!m.__webglVertexBuffer)){var $a=m;$a.__webglVertexBuffer=j.createBuffer();$a.__webglColorBuffer=j.createBuffer();H.info.geometries++;var Va=m,lb=f,db=Va.vertices.length;Va.__vertexArray=new Float32Array(3*db);Va.__colorArray=new Float32Array(3*db);Va.__sortArray=[];Va.__webglParticleCount=db;b(Va,lb);m.__dirtyVertices=!0;m.__dirtyColors=!0}if(!f.__webglActive){if(f instanceof THREE.Mesh)if(m=f.geometry,
 m.__dirtyVertices=!0;m.__dirtyColors=!0}}else if(f instanceof THREE.ParticleSystem&&(m=f.geometry,!m.__webglVertexBuffer)){var $a=m;$a.__webglVertexBuffer=j.createBuffer();$a.__webglColorBuffer=j.createBuffer();H.info.geometries++;var Va=m,lb=f,db=Va.vertices.length;Va.__vertexArray=new Float32Array(3*db);Va.__colorArray=new Float32Array(3*db);Va.__sortArray=[];Va.__webglParticleCount=db;b(Va,lb);m.__dirtyVertices=!0;m.__dirtyColors=!0}if(!f.__webglActive){if(f instanceof THREE.Mesh)if(m=f.geometry,
-m instanceof THREE.BufferGeometry)l(h.__webglObjects,m,f);else for(i in m.geometryGroups)k=m.geometryGroups[i],l(h.__webglObjects,k,f);else f instanceof THREE.Ribbon||f instanceof THREE.Line||f instanceof THREE.ParticleSystem?(m=f.geometry,l(h.__webglObjects,m,f)):void 0!==THREE.MarchingCubes&&f instanceof THREE.MarchingCubes||f.immediateRenderCallback?h.__webglObjectsImmediate.push({object:f,opaque:null,transparent:null}):f instanceof THREE.Sprite?h.__webglSprites.push(f):f instanceof THREE.LensFlare&&
+m instanceof THREE.BufferGeometry)k(h.__webglObjects,m,f);else for(i in m.geometryGroups)l=m.geometryGroups[i],k(h.__webglObjects,l,f);else f instanceof THREE.Ribbon||f instanceof THREE.Line||f instanceof THREE.ParticleSystem?(m=f.geometry,k(h.__webglObjects,m,f)):void 0!==THREE.MarchingCubes&&f instanceof THREE.MarchingCubes||f.immediateRenderCallback?h.__webglObjectsImmediate.push({object:f,opaque:null,transparent:null}):f instanceof THREE.Sprite?h.__webglSprites.push(f):f instanceof THREE.LensFlare&&
 h.__webglFlares.push(f);f.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;){var fb=a.__objectsRemoved[0],Fc=a;fb instanceof THREE.Mesh||fb instanceof THREE.ParticleSystem||fb instanceof THREE.Ribbon||fb instanceof THREE.Line?o(Fc.__webglObjects,fb):fb instanceof THREE.Sprite?q(Fc.__webglSprites,fb):fb instanceof THREE.LensFlare?q(Fc.__webglFlares,fb):(fb instanceof THREE.MarchingCubes||fb.immediateRenderCallback)&&o(Fc.__webglObjectsImmediate,fb);fb.__webglActive=!1;a.__objectsRemoved.splice(0,
 h.__webglFlares.push(f);f.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;){var fb=a.__objectsRemoved[0],Fc=a;fb instanceof THREE.Mesh||fb instanceof THREE.ParticleSystem||fb instanceof THREE.Ribbon||fb instanceof THREE.Line?o(Fc.__webglObjects,fb):fb instanceof THREE.Sprite?q(Fc.__webglSprites,fb):fb instanceof THREE.LensFlare?q(Fc.__webglFlares,fb):(fb instanceof THREE.MarchingCubes||fb.immediateRenderCallback)&&o(Fc.__webglObjectsImmediate,fb);fb.__webglActive=!1;a.__objectsRemoved.splice(0,
-1)}for(var Wc=0,rd=a.__webglObjects.length;Wc<rd;Wc++){var nb=a.__webglObjects[Wc].object,ja=nb.geometry,qc=void 0,ic=void 0,Ya=void 0;if(nb instanceof THREE.Mesh)if(ja instanceof THREE.BufferGeometry)ja.__dirtyVertices=!1,ja.__dirtyElements=!1,ja.__dirtyUvs=!1,ja.__dirtyNormals=!1,ja.__dirtyColors=!1;else{for(var Xc=0,sd=ja.geometryGroupsList.length;Xc<sd;Xc++)if(qc=ja.geometryGroupsList[Xc],Ya=c(nb,qc),ic=Ya.attributes&&p(Ya),ja.__dirtyVertices||ja.__dirtyMorphTargets||ja.__dirtyElements||ja.__dirtyUvs||
-ja.__dirtyNormals||ja.__dirtyColors||ja.__dirtyTangents||ic){var fa=qc,td=nb,ab=j.DYNAMIC_DRAW,ud=!ja.dynamic,bc=Ya;if(fa.__inittedArrays){var gd=d(bc),Yc=bc.vertexColors?bc.vertexColors:!1,hd=e(bc),Gc=gd===THREE.SmoothShading,G=void 0,U=void 0,kb=void 0,L=void 0,jc=void 0,Ob=void 0,ob=void 0,Hc=void 0,Hb=void 0,kc=void 0,lc=void 0,V=void 0,W=void 0,X=void 0,oa=void 0,pb=void 0,qb=void 0,rb=void 0,rc=void 0,sb=void 0,tb=void 0,ub=void 0,sc=void 0,vb=void 0,wb=void 0,xb=void 0,tc=void 0,yb=void 0,
-zb=void 0,Ab=void 0,uc=void 0,Bb=void 0,Cb=void 0,Db=void 0,vc=void 0,Pb=void 0,Qb=void 0,Rb=void 0,Ic=void 0,Sb=void 0,Tb=void 0,Ub=void 0,Jc=void 0,ka=void 0,id=void 0,Vb=void 0,mc=void 0,nc=void 0,Ma=void 0,jd=void 0,Ja=void 0,Ka=void 0,Wb=void 0,Ib=void 0,Ba=0,Ea=0,Jb=0,Kb=0,gb=0,Ra=0,pa=0,Sa=0,Ca=0,I=0,ca=0,z=0,bb=void 0,Na=fa.__vertexArray,wc=fa.__uvArray,xc=fa.__uv2Array,hb=fa.__normalArray,ua=fa.__tangentArray,Oa=fa.__colorArray,va=fa.__skinVertexAArray,wa=fa.__skinVertexBArray,xa=fa.__skinIndexArray,
-ya=fa.__skinWeightArray,Zc=fa.__morphTargetsArrays,$c=fa.__morphNormalsArrays,ad=fa.__webglCustomAttributesList,x=void 0,Eb=fa.__faceArray,cb=fa.__lineArray,Ta=td.geometry,vd=Ta.__dirtyElements,kd=Ta.__dirtyUvs,wd=Ta.__dirtyNormals,xd=Ta.__dirtyTangents,yd=Ta.__dirtyColors,zd=Ta.__dirtyMorphTargets,cc=Ta.vertices,la=fa.faces3,ma=fa.faces4,Da=Ta.faces,bd=Ta.faceVertexUvs[0],cd=Ta.faceVertexUvs[1],dc=Ta.skinVerticesA,ec=Ta.skinVerticesB,fc=Ta.skinIndices,Xb=Ta.skinWeights,Yb=Ta.morphTargets,Kc=Ta.morphNormals;
-if(Ta.__dirtyVertices){for(G=0,U=la.length;G<U;G++)L=Da[la[G]],V=cc[L.a].position,W=cc[L.b].position,X=cc[L.c].position,Na[Ea]=V.x,Na[Ea+1]=V.y,Na[Ea+2]=V.z,Na[Ea+3]=W.x,Na[Ea+4]=W.y,Na[Ea+5]=W.z,Na[Ea+6]=X.x,Na[Ea+7]=X.y,Na[Ea+8]=X.z,Ea+=9;for(G=0,U=ma.length;G<U;G++)L=Da[ma[G]],V=cc[L.a].position,W=cc[L.b].position,X=cc[L.c].position,oa=cc[L.d].position,Na[Ea]=V.x,Na[Ea+1]=V.y,Na[Ea+2]=V.z,Na[Ea+3]=W.x,Na[Ea+4]=W.y,Na[Ea+5]=W.z,Na[Ea+6]=X.x,Na[Ea+7]=X.y,Na[Ea+8]=X.z,Na[Ea+9]=oa.x,Na[Ea+10]=oa.y,
-Na[Ea+11]=oa.z,Ea+=12;j.bindBuffer(j.ARRAY_BUFFER,fa.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Na,ab)}if(zd)for(Ma=0,jd=Yb.length;Ma<jd;Ma++){ca=0;for(G=0,U=la.length;G<U;G++){Wb=la[G];L=Da[Wb];V=Yb[Ma].vertices[L.a].position;W=Yb[Ma].vertices[L.b].position;X=Yb[Ma].vertices[L.c].position;Ja=Zc[Ma];Ja[ca]=V.x;Ja[ca+1]=V.y;Ja[ca+2]=V.z;Ja[ca+3]=W.x;Ja[ca+4]=W.y;Ja[ca+5]=W.z;Ja[ca+6]=X.x;Ja[ca+7]=X.y;Ja[ca+8]=X.z;if(bc.morphNormals)Gc?(Ib=Kc[Ma].vertexNormals[Wb],sb=Ib.a,tb=Ib.b,ub=Ib.c):ub=
-tb=sb=Kc[Ma].faceNormals[Wb],Ka=$c[Ma],Ka[ca]=sb.x,Ka[ca+1]=sb.y,Ka[ca+2]=sb.z,Ka[ca+3]=tb.x,Ka[ca+4]=tb.y,Ka[ca+5]=tb.z,Ka[ca+6]=ub.x,Ka[ca+7]=ub.y,Ka[ca+8]=ub.z;ca+=9}for(G=0,U=ma.length;G<U;G++){Wb=ma[G];L=Da[Wb];V=Yb[Ma].vertices[L.a].position;W=Yb[Ma].vertices[L.b].position;X=Yb[Ma].vertices[L.c].position;oa=Yb[Ma].vertices[L.d].position;Ja=Zc[Ma];Ja[ca]=V.x;Ja[ca+1]=V.y;Ja[ca+2]=V.z;Ja[ca+3]=W.x;Ja[ca+4]=W.y;Ja[ca+5]=W.z;Ja[ca+6]=X.x;Ja[ca+7]=X.y;Ja[ca+8]=X.z;Ja[ca+9]=oa.x;Ja[ca+10]=oa.y;Ja[ca+
-11]=oa.z;if(bc.morphNormals)Gc?(Ib=Kc[Ma].vertexNormals[Wb],sb=Ib.a,tb=Ib.b,ub=Ib.c,sc=Ib.d):sc=ub=tb=sb=Kc[Ma].faceNormals[Wb],Ka=$c[Ma],Ka[ca]=sb.x,Ka[ca+1]=sb.y,Ka[ca+2]=sb.z,Ka[ca+3]=tb.x,Ka[ca+4]=tb.y,Ka[ca+5]=tb.z,Ka[ca+6]=ub.x,Ka[ca+7]=ub.y,Ka[ca+8]=ub.z,Ka[ca+9]=sc.x,Ka[ca+10]=sc.y,Ka[ca+11]=sc.z;ca+=12}j.bindBuffer(j.ARRAY_BUFFER,fa.__webglMorphTargetsBuffers[Ma]);j.bufferData(j.ARRAY_BUFFER,Zc[Ma],ab);bc.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,fa.__webglMorphNormalsBuffers[Ma]),j.bufferData(j.ARRAY_BUFFER,
-$c[Ma],ab))}if(Xb.length){for(G=0,U=la.length;G<U;G++)L=Da[la[G]],yb=Xb[L.a],zb=Xb[L.b],Ab=Xb[L.c],ya[I]=yb.x,ya[I+1]=yb.y,ya[I+2]=yb.z,ya[I+3]=yb.w,ya[I+4]=zb.x,ya[I+5]=zb.y,ya[I+6]=zb.z,ya[I+7]=zb.w,ya[I+8]=Ab.x,ya[I+9]=Ab.y,ya[I+10]=Ab.z,ya[I+11]=Ab.w,Bb=fc[L.a],Cb=fc[L.b],Db=fc[L.c],xa[I]=Bb.x,xa[I+1]=Bb.y,xa[I+2]=Bb.z,xa[I+3]=Bb.w,xa[I+4]=Cb.x,xa[I+5]=Cb.y,xa[I+6]=Cb.z,xa[I+7]=Cb.w,xa[I+8]=Db.x,xa[I+9]=Db.y,xa[I+10]=Db.z,xa[I+11]=Db.w,Pb=dc[L.a],Qb=dc[L.b],Rb=dc[L.c],va[I]=Pb.x,va[I+1]=Pb.y,
-va[I+2]=Pb.z,va[I+3]=1,va[I+4]=Qb.x,va[I+5]=Qb.y,va[I+6]=Qb.z,va[I+7]=1,va[I+8]=Rb.x,va[I+9]=Rb.y,va[I+10]=Rb.z,va[I+11]=1,Sb=ec[L.a],Tb=ec[L.b],Ub=ec[L.c],wa[I]=Sb.x,wa[I+1]=Sb.y,wa[I+2]=Sb.z,wa[I+3]=1,wa[I+4]=Tb.x,wa[I+5]=Tb.y,wa[I+6]=Tb.z,wa[I+7]=1,wa[I+8]=Ub.x,wa[I+9]=Ub.y,wa[I+10]=Ub.z,wa[I+11]=1,I+=12;for(G=0,U=ma.length;G<U;G++)L=Da[ma[G]],yb=Xb[L.a],zb=Xb[L.b],Ab=Xb[L.c],uc=Xb[L.d],ya[I]=yb.x,ya[I+1]=yb.y,ya[I+2]=yb.z,ya[I+3]=yb.w,ya[I+4]=zb.x,ya[I+5]=zb.y,ya[I+6]=zb.z,ya[I+7]=zb.w,ya[I+8]=
+1)}for(var Wc=0,rd=a.__webglObjects.length;Wc<rd;Wc++){var nb=a.__webglObjects[Wc].object,ia=nb.geometry,qc=void 0,ic=void 0,Ya=void 0;if(nb instanceof THREE.Mesh)if(ia instanceof THREE.BufferGeometry)ia.__dirtyVertices=!1,ia.__dirtyElements=!1,ia.__dirtyUvs=!1,ia.__dirtyNormals=!1,ia.__dirtyColors=!1;else{for(var Xc=0,sd=ia.geometryGroupsList.length;Xc<sd;Xc++)if(qc=ia.geometryGroupsList[Xc],Ya=c(nb,qc),ic=Ya.attributes&&p(Ya),ia.__dirtyVertices||ia.__dirtyMorphTargets||ia.__dirtyElements||ia.__dirtyUvs||
+ia.__dirtyNormals||ia.__dirtyColors||ia.__dirtyTangents||ic){var ea=qc,td=nb,ab=j.DYNAMIC_DRAW,ud=!ia.dynamic,bc=Ya;if(ea.__inittedArrays){var gd=d(bc),Yc=bc.vertexColors?bc.vertexColors:!1,hd=e(bc),Gc=gd===THREE.SmoothShading,G=void 0,T=void 0,kb=void 0,L=void 0,jc=void 0,Ob=void 0,ob=void 0,Hc=void 0,Hb=void 0,kc=void 0,lc=void 0,U=void 0,V=void 0,W=void 0,na=void 0,pb=void 0,qb=void 0,rb=void 0,rc=void 0,sb=void 0,tb=void 0,ub=void 0,sc=void 0,vb=void 0,wb=void 0,xb=void 0,tc=void 0,yb=void 0,
+zb=void 0,Ab=void 0,uc=void 0,Bb=void 0,Cb=void 0,Db=void 0,vc=void 0,Pb=void 0,Qb=void 0,Rb=void 0,Ic=void 0,Sb=void 0,Tb=void 0,Ub=void 0,Jc=void 0,ja=void 0,id=void 0,Vb=void 0,mc=void 0,nc=void 0,Ma=void 0,jd=void 0,Ja=void 0,Ka=void 0,Wb=void 0,Ib=void 0,Ba=0,Ea=0,Jb=0,Kb=0,gb=0,Ra=0,oa=0,Sa=0,Ca=0,I=0,ba=0,z=0,bb=void 0,Na=ea.__vertexArray,wc=ea.__uvArray,xc=ea.__uv2Array,hb=ea.__normalArray,ua=ea.__tangentArray,Oa=ea.__colorArray,va=ea.__skinVertexAArray,wa=ea.__skinVertexBArray,xa=ea.__skinIndexArray,
+ya=ea.__skinWeightArray,Zc=ea.__morphTargetsArrays,$c=ea.__morphNormalsArrays,ad=ea.__webglCustomAttributesList,x=void 0,Eb=ea.__faceArray,cb=ea.__lineArray,Ta=td.geometry,vd=Ta.__dirtyElements,kd=Ta.__dirtyUvs,wd=Ta.__dirtyNormals,xd=Ta.__dirtyTangents,yd=Ta.__dirtyColors,zd=Ta.__dirtyMorphTargets,cc=Ta.vertices,ka=ea.faces3,la=ea.faces4,Da=Ta.faces,bd=Ta.faceVertexUvs[0],cd=Ta.faceVertexUvs[1],dc=Ta.skinVerticesA,ec=Ta.skinVerticesB,fc=Ta.skinIndices,Xb=Ta.skinWeights,Yb=Ta.morphTargets,Kc=Ta.morphNormals;
+if(Ta.__dirtyVertices){for(G=0,T=ka.length;G<T;G++)L=Da[ka[G]],U=cc[L.a].position,V=cc[L.b].position,W=cc[L.c].position,Na[Ea]=U.x,Na[Ea+1]=U.y,Na[Ea+2]=U.z,Na[Ea+3]=V.x,Na[Ea+4]=V.y,Na[Ea+5]=V.z,Na[Ea+6]=W.x,Na[Ea+7]=W.y,Na[Ea+8]=W.z,Ea+=9;for(G=0,T=la.length;G<T;G++)L=Da[la[G]],U=cc[L.a].position,V=cc[L.b].position,W=cc[L.c].position,na=cc[L.d].position,Na[Ea]=U.x,Na[Ea+1]=U.y,Na[Ea+2]=U.z,Na[Ea+3]=V.x,Na[Ea+4]=V.y,Na[Ea+5]=V.z,Na[Ea+6]=W.x,Na[Ea+7]=W.y,Na[Ea+8]=W.z,Na[Ea+9]=na.x,Na[Ea+10]=na.y,
+Na[Ea+11]=na.z,Ea+=12;j.bindBuffer(j.ARRAY_BUFFER,ea.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Na,ab)}if(zd)for(Ma=0,jd=Yb.length;Ma<jd;Ma++){ba=0;for(G=0,T=ka.length;G<T;G++){Wb=ka[G];L=Da[Wb];U=Yb[Ma].vertices[L.a].position;V=Yb[Ma].vertices[L.b].position;W=Yb[Ma].vertices[L.c].position;Ja=Zc[Ma];Ja[ba]=U.x;Ja[ba+1]=U.y;Ja[ba+2]=U.z;Ja[ba+3]=V.x;Ja[ba+4]=V.y;Ja[ba+5]=V.z;Ja[ba+6]=W.x;Ja[ba+7]=W.y;Ja[ba+8]=W.z;if(bc.morphNormals)Gc?(Ib=Kc[Ma].vertexNormals[Wb],sb=Ib.a,tb=Ib.b,ub=Ib.c):ub=
+tb=sb=Kc[Ma].faceNormals[Wb],Ka=$c[Ma],Ka[ba]=sb.x,Ka[ba+1]=sb.y,Ka[ba+2]=sb.z,Ka[ba+3]=tb.x,Ka[ba+4]=tb.y,Ka[ba+5]=tb.z,Ka[ba+6]=ub.x,Ka[ba+7]=ub.y,Ka[ba+8]=ub.z;ba+=9}for(G=0,T=la.length;G<T;G++){Wb=la[G];L=Da[Wb];U=Yb[Ma].vertices[L.a].position;V=Yb[Ma].vertices[L.b].position;W=Yb[Ma].vertices[L.c].position;na=Yb[Ma].vertices[L.d].position;Ja=Zc[Ma];Ja[ba]=U.x;Ja[ba+1]=U.y;Ja[ba+2]=U.z;Ja[ba+3]=V.x;Ja[ba+4]=V.y;Ja[ba+5]=V.z;Ja[ba+6]=W.x;Ja[ba+7]=W.y;Ja[ba+8]=W.z;Ja[ba+9]=na.x;Ja[ba+10]=na.y;Ja[ba+
+11]=na.z;if(bc.morphNormals)Gc?(Ib=Kc[Ma].vertexNormals[Wb],sb=Ib.a,tb=Ib.b,ub=Ib.c,sc=Ib.d):sc=ub=tb=sb=Kc[Ma].faceNormals[Wb],Ka=$c[Ma],Ka[ba]=sb.x,Ka[ba+1]=sb.y,Ka[ba+2]=sb.z,Ka[ba+3]=tb.x,Ka[ba+4]=tb.y,Ka[ba+5]=tb.z,Ka[ba+6]=ub.x,Ka[ba+7]=ub.y,Ka[ba+8]=ub.z,Ka[ba+9]=sc.x,Ka[ba+10]=sc.y,Ka[ba+11]=sc.z;ba+=12}j.bindBuffer(j.ARRAY_BUFFER,ea.__webglMorphTargetsBuffers[Ma]);j.bufferData(j.ARRAY_BUFFER,Zc[Ma],ab);bc.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,ea.__webglMorphNormalsBuffers[Ma]),j.bufferData(j.ARRAY_BUFFER,
+$c[Ma],ab))}if(Xb.length){for(G=0,T=ka.length;G<T;G++)L=Da[ka[G]],yb=Xb[L.a],zb=Xb[L.b],Ab=Xb[L.c],ya[I]=yb.x,ya[I+1]=yb.y,ya[I+2]=yb.z,ya[I+3]=yb.w,ya[I+4]=zb.x,ya[I+5]=zb.y,ya[I+6]=zb.z,ya[I+7]=zb.w,ya[I+8]=Ab.x,ya[I+9]=Ab.y,ya[I+10]=Ab.z,ya[I+11]=Ab.w,Bb=fc[L.a],Cb=fc[L.b],Db=fc[L.c],xa[I]=Bb.x,xa[I+1]=Bb.y,xa[I+2]=Bb.z,xa[I+3]=Bb.w,xa[I+4]=Cb.x,xa[I+5]=Cb.y,xa[I+6]=Cb.z,xa[I+7]=Cb.w,xa[I+8]=Db.x,xa[I+9]=Db.y,xa[I+10]=Db.z,xa[I+11]=Db.w,Pb=dc[L.a],Qb=dc[L.b],Rb=dc[L.c],va[I]=Pb.x,va[I+1]=Pb.y,
+va[I+2]=Pb.z,va[I+3]=1,va[I+4]=Qb.x,va[I+5]=Qb.y,va[I+6]=Qb.z,va[I+7]=1,va[I+8]=Rb.x,va[I+9]=Rb.y,va[I+10]=Rb.z,va[I+11]=1,Sb=ec[L.a],Tb=ec[L.b],Ub=ec[L.c],wa[I]=Sb.x,wa[I+1]=Sb.y,wa[I+2]=Sb.z,wa[I+3]=1,wa[I+4]=Tb.x,wa[I+5]=Tb.y,wa[I+6]=Tb.z,wa[I+7]=1,wa[I+8]=Ub.x,wa[I+9]=Ub.y,wa[I+10]=Ub.z,wa[I+11]=1,I+=12;for(G=0,T=la.length;G<T;G++)L=Da[la[G]],yb=Xb[L.a],zb=Xb[L.b],Ab=Xb[L.c],uc=Xb[L.d],ya[I]=yb.x,ya[I+1]=yb.y,ya[I+2]=yb.z,ya[I+3]=yb.w,ya[I+4]=zb.x,ya[I+5]=zb.y,ya[I+6]=zb.z,ya[I+7]=zb.w,ya[I+8]=
 Ab.x,ya[I+9]=Ab.y,ya[I+10]=Ab.z,ya[I+11]=Ab.w,ya[I+12]=uc.x,ya[I+13]=uc.y,ya[I+14]=uc.z,ya[I+15]=uc.w,Bb=fc[L.a],Cb=fc[L.b],Db=fc[L.c],vc=fc[L.d],xa[I]=Bb.x,xa[I+1]=Bb.y,xa[I+2]=Bb.z,xa[I+3]=Bb.w,xa[I+4]=Cb.x,xa[I+5]=Cb.y,xa[I+6]=Cb.z,xa[I+7]=Cb.w,xa[I+8]=Db.x,xa[I+9]=Db.y,xa[I+10]=Db.z,xa[I+11]=Db.w,xa[I+12]=vc.x,xa[I+13]=vc.y,xa[I+14]=vc.z,xa[I+15]=vc.w,Pb=dc[L.a],Qb=dc[L.b],Rb=dc[L.c],Ic=dc[L.d],va[I]=Pb.x,va[I+1]=Pb.y,va[I+2]=Pb.z,va[I+3]=1,va[I+4]=Qb.x,va[I+5]=Qb.y,va[I+6]=Qb.z,va[I+7]=1,va[I+
 Ab.x,ya[I+9]=Ab.y,ya[I+10]=Ab.z,ya[I+11]=Ab.w,ya[I+12]=uc.x,ya[I+13]=uc.y,ya[I+14]=uc.z,ya[I+15]=uc.w,Bb=fc[L.a],Cb=fc[L.b],Db=fc[L.c],vc=fc[L.d],xa[I]=Bb.x,xa[I+1]=Bb.y,xa[I+2]=Bb.z,xa[I+3]=Bb.w,xa[I+4]=Cb.x,xa[I+5]=Cb.y,xa[I+6]=Cb.z,xa[I+7]=Cb.w,xa[I+8]=Db.x,xa[I+9]=Db.y,xa[I+10]=Db.z,xa[I+11]=Db.w,xa[I+12]=vc.x,xa[I+13]=vc.y,xa[I+14]=vc.z,xa[I+15]=vc.w,Pb=dc[L.a],Qb=dc[L.b],Rb=dc[L.c],Ic=dc[L.d],va[I]=Pb.x,va[I+1]=Pb.y,va[I+2]=Pb.z,va[I+3]=1,va[I+4]=Qb.x,va[I+5]=Qb.y,va[I+6]=Qb.z,va[I+7]=1,va[I+
-8]=Rb.x,va[I+9]=Rb.y,va[I+10]=Rb.z,va[I+11]=1,va[I+12]=Ic.x,va[I+13]=Ic.y,va[I+14]=Ic.z,va[I+15]=1,Sb=ec[L.a],Tb=ec[L.b],Ub=ec[L.c],Jc=ec[L.d],wa[I]=Sb.x,wa[I+1]=Sb.y,wa[I+2]=Sb.z,wa[I+3]=1,wa[I+4]=Tb.x,wa[I+5]=Tb.y,wa[I+6]=Tb.z,wa[I+7]=1,wa[I+8]=Ub.x,wa[I+9]=Ub.y,wa[I+10]=Ub.z,wa[I+11]=1,wa[I+12]=Jc.x,wa[I+13]=Jc.y,wa[I+14]=Jc.z,wa[I+15]=1,I+=16;0<I&&(j.bindBuffer(j.ARRAY_BUFFER,fa.__webglSkinVertexABuffer),j.bufferData(j.ARRAY_BUFFER,va,ab),j.bindBuffer(j.ARRAY_BUFFER,fa.__webglSkinVertexBBuffer),
-j.bufferData(j.ARRAY_BUFFER,wa,ab),j.bindBuffer(j.ARRAY_BUFFER,fa.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,xa,ab),j.bindBuffer(j.ARRAY_BUFFER,fa.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,ya,ab))}if(yd&&Yc){for(G=0,U=la.length;G<U;G++)L=Da[la[G]],ob=L.vertexColors,Hc=L.color,3===ob.length&&Yc===THREE.VertexColors?(vb=ob[0],wb=ob[1],xb=ob[2]):xb=wb=vb=Hc,Oa[Ca]=vb.r,Oa[Ca+1]=vb.g,Oa[Ca+2]=vb.b,Oa[Ca+3]=wb.r,Oa[Ca+4]=wb.g,Oa[Ca+5]=wb.b,Oa[Ca+6]=xb.r,Oa[Ca+7]=xb.g,Oa[Ca+8]=xb.b,
-Ca+=9;for(G=0,U=ma.length;G<U;G++)L=Da[ma[G]],ob=L.vertexColors,Hc=L.color,4===ob.length&&Yc===THREE.VertexColors?(vb=ob[0],wb=ob[1],xb=ob[2],tc=ob[3]):tc=xb=wb=vb=Hc,Oa[Ca]=vb.r,Oa[Ca+1]=vb.g,Oa[Ca+2]=vb.b,Oa[Ca+3]=wb.r,Oa[Ca+4]=wb.g,Oa[Ca+5]=wb.b,Oa[Ca+6]=xb.r,Oa[Ca+7]=xb.g,Oa[Ca+8]=xb.b,Oa[Ca+9]=tc.r,Oa[Ca+10]=tc.g,Oa[Ca+11]=tc.b,Ca+=12;0<Ca&&(j.bindBuffer(j.ARRAY_BUFFER,fa.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,Oa,ab))}if(xd&&Ta.hasTangents){for(G=0,U=la.length;G<U;G++)L=Da[la[G]],Hb=
-L.vertexTangents,pb=Hb[0],qb=Hb[1],rb=Hb[2],ua[pa]=pb.x,ua[pa+1]=pb.y,ua[pa+2]=pb.z,ua[pa+3]=pb.w,ua[pa+4]=qb.x,ua[pa+5]=qb.y,ua[pa+6]=qb.z,ua[pa+7]=qb.w,ua[pa+8]=rb.x,ua[pa+9]=rb.y,ua[pa+10]=rb.z,ua[pa+11]=rb.w,pa+=12;for(G=0,U=ma.length;G<U;G++)L=Da[ma[G]],Hb=L.vertexTangents,pb=Hb[0],qb=Hb[1],rb=Hb[2],rc=Hb[3],ua[pa]=pb.x,ua[pa+1]=pb.y,ua[pa+2]=pb.z,ua[pa+3]=pb.w,ua[pa+4]=qb.x,ua[pa+5]=qb.y,ua[pa+6]=qb.z,ua[pa+7]=qb.w,ua[pa+8]=rb.x,ua[pa+9]=rb.y,ua[pa+10]=rb.z,ua[pa+11]=rb.w,ua[pa+12]=rc.x,ua[pa+
-13]=rc.y,ua[pa+14]=rc.z,ua[pa+15]=rc.w,pa+=16;j.bindBuffer(j.ARRAY_BUFFER,fa.__webglTangentBuffer);j.bufferData(j.ARRAY_BUFFER,ua,ab)}if(wd&&gd){for(G=0,U=la.length;G<U;G++)if(L=Da[la[G]],jc=L.vertexNormals,Ob=L.normal,3===jc.length&&Gc)for(ka=0;3>ka;ka++)Vb=jc[ka],hb[Ra]=Vb.x,hb[Ra+1]=Vb.y,hb[Ra+2]=Vb.z,Ra+=3;else for(ka=0;3>ka;ka++)hb[Ra]=Ob.x,hb[Ra+1]=Ob.y,hb[Ra+2]=Ob.z,Ra+=3;for(G=0,U=ma.length;G<U;G++)if(L=Da[ma[G]],jc=L.vertexNormals,Ob=L.normal,4===jc.length&&Gc)for(ka=0;4>ka;ka++)Vb=jc[ka],
-hb[Ra]=Vb.x,hb[Ra+1]=Vb.y,hb[Ra+2]=Vb.z,Ra+=3;else for(ka=0;4>ka;ka++)hb[Ra]=Ob.x,hb[Ra+1]=Ob.y,hb[Ra+2]=Ob.z,Ra+=3;j.bindBuffer(j.ARRAY_BUFFER,fa.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,hb,ab)}if(kd&&bd&&hd){for(G=0,U=la.length;G<U;G++)if(kb=la[G],L=Da[kb],kc=bd[kb],void 0!==kc)for(ka=0;3>ka;ka++)mc=kc[ka],wc[Jb]=mc.u,wc[Jb+1]=mc.v,Jb+=2;for(G=0,U=ma.length;G<U;G++)if(kb=ma[G],L=Da[kb],kc=bd[kb],void 0!==kc)for(ka=0;4>ka;ka++)mc=kc[ka],wc[Jb]=mc.u,wc[Jb+1]=mc.v,Jb+=2;0<Jb&&(j.bindBuffer(j.ARRAY_BUFFER,
-fa.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,wc,ab))}if(kd&&cd&&hd){for(G=0,U=la.length;G<U;G++)if(kb=la[G],L=Da[kb],lc=cd[kb],void 0!==lc)for(ka=0;3>ka;ka++)nc=lc[ka],xc[Kb]=nc.u,xc[Kb+1]=nc.v,Kb+=2;for(G=0,U=ma.length;G<U;G++)if(kb=ma[G],L=Da[kb],lc=cd[kb],void 0!==lc)for(ka=0;4>ka;ka++)nc=lc[ka],xc[Kb]=nc.u,xc[Kb+1]=nc.v,Kb+=2;0<Kb&&(j.bindBuffer(j.ARRAY_BUFFER,fa.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,xc,ab))}if(vd){for(G=0,U=la.length;G<U;G++)L=Da[la[G]],Eb[gb]=Ba,Eb[gb+1]=Ba+1,Eb[gb+
-2]=Ba+2,gb+=3,cb[Sa]=Ba,cb[Sa+1]=Ba+1,cb[Sa+2]=Ba,cb[Sa+3]=Ba+2,cb[Sa+4]=Ba+1,cb[Sa+5]=Ba+2,Sa+=6,Ba+=3;for(G=0,U=ma.length;G<U;G++)L=Da[ma[G]],Eb[gb]=Ba,Eb[gb+1]=Ba+1,Eb[gb+2]=Ba+3,Eb[gb+3]=Ba+1,Eb[gb+4]=Ba+2,Eb[gb+5]=Ba+3,gb+=6,cb[Sa]=Ba,cb[Sa+1]=Ba+1,cb[Sa+2]=Ba,cb[Sa+3]=Ba+3,cb[Sa+4]=Ba+1,cb[Sa+5]=Ba+2,cb[Sa+6]=Ba+2,cb[Sa+7]=Ba+3,Sa+=8,Ba+=4;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,fa.__webglFaceBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Eb,ab);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,fa.__webglLineBuffer);
-j.bufferData(j.ELEMENT_ARRAY_BUFFER,cb,ab)}if(ad)for(ka=0,id=ad.length;ka<id;ka++)if(x=ad[ka],x.__original.needsUpdate){z=0;if(1===x.size)if(void 0===x.boundTo||"vertices"===x.boundTo){for(G=0,U=la.length;G<U;G++)L=Da[la[G]],x.array[z]=x.value[L.a],x.array[z+1]=x.value[L.b],x.array[z+2]=x.value[L.c],z+=3;for(G=0,U=ma.length;G<U;G++)L=Da[ma[G]],x.array[z]=x.value[L.a],x.array[z+1]=x.value[L.b],x.array[z+2]=x.value[L.c],x.array[z+3]=x.value[L.d],z+=4}else{if("faces"===x.boundTo){for(G=0,U=la.length;G<
-U;G++)bb=x.value[la[G]],x.array[z]=bb,x.array[z+1]=bb,x.array[z+2]=bb,z+=3;for(G=0,U=ma.length;G<U;G++)bb=x.value[ma[G]],x.array[z]=bb,x.array[z+1]=bb,x.array[z+2]=bb,x.array[z+3]=bb,z+=4}}else if(2===x.size)if(void 0===x.boundTo||"vertices"===x.boundTo){for(G=0,U=la.length;G<U;G++)L=Da[la[G]],V=x.value[L.a],W=x.value[L.b],X=x.value[L.c],x.array[z]=V.x,x.array[z+1]=V.y,x.array[z+2]=W.x,x.array[z+3]=W.y,x.array[z+4]=X.x,x.array[z+5]=X.y,z+=6;for(G=0,U=ma.length;G<U;G++)L=Da[ma[G]],V=x.value[L.a],W=
-x.value[L.b],X=x.value[L.c],oa=x.value[L.d],x.array[z]=V.x,x.array[z+1]=V.y,x.array[z+2]=W.x,x.array[z+3]=W.y,x.array[z+4]=X.x,x.array[z+5]=X.y,x.array[z+6]=oa.x,x.array[z+7]=oa.y,z+=8}else{if("faces"===x.boundTo){for(G=0,U=la.length;G<U;G++)X=W=V=bb=x.value[la[G]],x.array[z]=V.x,x.array[z+1]=V.y,x.array[z+2]=W.x,x.array[z+3]=W.y,x.array[z+4]=X.x,x.array[z+5]=X.y,z+=6;for(G=0,U=ma.length;G<U;G++)oa=X=W=V=bb=x.value[ma[G]],x.array[z]=V.x,x.array[z+1]=V.y,x.array[z+2]=W.x,x.array[z+3]=W.y,x.array[z+
-4]=X.x,x.array[z+5]=X.y,x.array[z+6]=oa.x,x.array[z+7]=oa.y,z+=8}}else if(3===x.size){var ha;ha="c"===x.type?["r","g","b"]:["x","y","z"];if(void 0===x.boundTo||"vertices"===x.boundTo){for(G=0,U=la.length;G<U;G++)L=Da[la[G]],V=x.value[L.a],W=x.value[L.b],X=x.value[L.c],x.array[z]=V[ha[0]],x.array[z+1]=V[ha[1]],x.array[z+2]=V[ha[2]],x.array[z+3]=W[ha[0]],x.array[z+4]=W[ha[1]],x.array[z+5]=W[ha[2]],x.array[z+6]=X[ha[0]],x.array[z+7]=X[ha[1]],x.array[z+8]=X[ha[2]],z+=9;for(G=0,U=ma.length;G<U;G++)L=Da[ma[G]],
-V=x.value[L.a],W=x.value[L.b],X=x.value[L.c],oa=x.value[L.d],x.array[z]=V[ha[0]],x.array[z+1]=V[ha[1]],x.array[z+2]=V[ha[2]],x.array[z+3]=W[ha[0]],x.array[z+4]=W[ha[1]],x.array[z+5]=W[ha[2]],x.array[z+6]=X[ha[0]],x.array[z+7]=X[ha[1]],x.array[z+8]=X[ha[2]],x.array[z+9]=oa[ha[0]],x.array[z+10]=oa[ha[1]],x.array[z+11]=oa[ha[2]],z+=12}else if("faces"===x.boundTo){for(G=0,U=la.length;G<U;G++)X=W=V=bb=x.value[la[G]],x.array[z]=V[ha[0]],x.array[z+1]=V[ha[1]],x.array[z+2]=V[ha[2]],x.array[z+3]=W[ha[0]],
-x.array[z+4]=W[ha[1]],x.array[z+5]=W[ha[2]],x.array[z+6]=X[ha[0]],x.array[z+7]=X[ha[1]],x.array[z+8]=X[ha[2]],z+=9;for(G=0,U=ma.length;G<U;G++)oa=X=W=V=bb=x.value[ma[G]],x.array[z]=V[ha[0]],x.array[z+1]=V[ha[1]],x.array[z+2]=V[ha[2]],x.array[z+3]=W[ha[0]],x.array[z+4]=W[ha[1]],x.array[z+5]=W[ha[2]],x.array[z+6]=X[ha[0]],x.array[z+7]=X[ha[1]],x.array[z+8]=X[ha[2]],x.array[z+9]=oa[ha[0]],x.array[z+10]=oa[ha[1]],x.array[z+11]=oa[ha[2]],z+=12}}else if(4===x.size)if(void 0===x.boundTo||"vertices"===x.boundTo){for(G=
-0,U=la.length;G<U;G++)L=Da[la[G]],V=x.value[L.a],W=x.value[L.b],X=x.value[L.c],x.array[z]=V.x,x.array[z+1]=V.y,x.array[z+2]=V.z,x.array[z+3]=V.w,x.array[z+4]=W.x,x.array[z+5]=W.y,x.array[z+6]=W.z,x.array[z+7]=W.w,x.array[z+8]=X.x,x.array[z+9]=X.y,x.array[z+10]=X.z,x.array[z+11]=X.w,z+=12;for(G=0,U=ma.length;G<U;G++)L=Da[ma[G]],V=x.value[L.a],W=x.value[L.b],X=x.value[L.c],oa=x.value[L.d],x.array[z]=V.x,x.array[z+1]=V.y,x.array[z+2]=V.z,x.array[z+3]=V.w,x.array[z+4]=W.x,x.array[z+5]=W.y,x.array[z+6]=
-W.z,x.array[z+7]=W.w,x.array[z+8]=X.x,x.array[z+9]=X.y,x.array[z+10]=X.z,x.array[z+11]=X.w,x.array[z+12]=oa.x,x.array[z+13]=oa.y,x.array[z+14]=oa.z,x.array[z+15]=oa.w,z+=16}else if("faces"===x.boundTo){for(G=0,U=la.length;G<U;G++)X=W=V=bb=x.value[la[G]],x.array[z]=V.x,x.array[z+1]=V.y,x.array[z+2]=V.z,x.array[z+3]=V.w,x.array[z+4]=W.x,x.array[z+5]=W.y,x.array[z+6]=W.z,x.array[z+7]=W.w,x.array[z+8]=X.x,x.array[z+9]=X.y,x.array[z+10]=X.z,x.array[z+11]=X.w,z+=12;for(G=0,U=ma.length;G<U;G++)oa=X=W=V=
-bb=x.value[ma[G]],x.array[z]=V.x,x.array[z+1]=V.y,x.array[z+2]=V.z,x.array[z+3]=V.w,x.array[z+4]=W.x,x.array[z+5]=W.y,x.array[z+6]=W.z,x.array[z+7]=W.w,x.array[z+8]=X.x,x.array[z+9]=X.y,x.array[z+10]=X.z,x.array[z+11]=X.w,x.array[z+12]=oa.x,x.array[z+13]=oa.y,x.array[z+14]=oa.z,x.array[z+15]=oa.w,z+=16}j.bindBuffer(j.ARRAY_BUFFER,x.buffer);j.bufferData(j.ARRAY_BUFFER,x.array,ab)}ud&&(delete fa.__inittedArrays,delete fa.__colorArray,delete fa.__normalArray,delete fa.__tangentArray,delete fa.__uvArray,
-delete fa.__uv2Array,delete fa.__faceArray,delete fa.__vertexArray,delete fa.__lineArray,delete fa.__skinVertexAArray,delete fa.__skinVertexBArray,delete fa.__skinIndexArray,delete fa.__skinWeightArray)}}ja.__dirtyVertices=!1;ja.__dirtyMorphTargets=!1;ja.__dirtyElements=!1;ja.__dirtyUvs=!1;ja.__dirtyNormals=!1;ja.__dirtyColors=!1;ja.__dirtyTangents=!1;Ya.attributes&&n(Ya)}else if(nb instanceof THREE.Ribbon){if(ja.__dirtyVertices||ja.__dirtyColors){var Zb=ja,ld=j.DYNAMIC_DRAW,yc=void 0,zc=void 0,Lc=
+8]=Rb.x,va[I+9]=Rb.y,va[I+10]=Rb.z,va[I+11]=1,va[I+12]=Ic.x,va[I+13]=Ic.y,va[I+14]=Ic.z,va[I+15]=1,Sb=ec[L.a],Tb=ec[L.b],Ub=ec[L.c],Jc=ec[L.d],wa[I]=Sb.x,wa[I+1]=Sb.y,wa[I+2]=Sb.z,wa[I+3]=1,wa[I+4]=Tb.x,wa[I+5]=Tb.y,wa[I+6]=Tb.z,wa[I+7]=1,wa[I+8]=Ub.x,wa[I+9]=Ub.y,wa[I+10]=Ub.z,wa[I+11]=1,wa[I+12]=Jc.x,wa[I+13]=Jc.y,wa[I+14]=Jc.z,wa[I+15]=1,I+=16;0<I&&(j.bindBuffer(j.ARRAY_BUFFER,ea.__webglSkinVertexABuffer),j.bufferData(j.ARRAY_BUFFER,va,ab),j.bindBuffer(j.ARRAY_BUFFER,ea.__webglSkinVertexBBuffer),
+j.bufferData(j.ARRAY_BUFFER,wa,ab),j.bindBuffer(j.ARRAY_BUFFER,ea.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,xa,ab),j.bindBuffer(j.ARRAY_BUFFER,ea.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,ya,ab))}if(yd&&Yc){for(G=0,T=ka.length;G<T;G++)L=Da[ka[G]],ob=L.vertexColors,Hc=L.color,3===ob.length&&Yc===THREE.VertexColors?(vb=ob[0],wb=ob[1],xb=ob[2]):xb=wb=vb=Hc,Oa[Ca]=vb.r,Oa[Ca+1]=vb.g,Oa[Ca+2]=vb.b,Oa[Ca+3]=wb.r,Oa[Ca+4]=wb.g,Oa[Ca+5]=wb.b,Oa[Ca+6]=xb.r,Oa[Ca+7]=xb.g,Oa[Ca+8]=xb.b,
+Ca+=9;for(G=0,T=la.length;G<T;G++)L=Da[la[G]],ob=L.vertexColors,Hc=L.color,4===ob.length&&Yc===THREE.VertexColors?(vb=ob[0],wb=ob[1],xb=ob[2],tc=ob[3]):tc=xb=wb=vb=Hc,Oa[Ca]=vb.r,Oa[Ca+1]=vb.g,Oa[Ca+2]=vb.b,Oa[Ca+3]=wb.r,Oa[Ca+4]=wb.g,Oa[Ca+5]=wb.b,Oa[Ca+6]=xb.r,Oa[Ca+7]=xb.g,Oa[Ca+8]=xb.b,Oa[Ca+9]=tc.r,Oa[Ca+10]=tc.g,Oa[Ca+11]=tc.b,Ca+=12;0<Ca&&(j.bindBuffer(j.ARRAY_BUFFER,ea.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,Oa,ab))}if(xd&&Ta.hasTangents){for(G=0,T=ka.length;G<T;G++)L=Da[ka[G]],Hb=
+L.vertexTangents,pb=Hb[0],qb=Hb[1],rb=Hb[2],ua[oa]=pb.x,ua[oa+1]=pb.y,ua[oa+2]=pb.z,ua[oa+3]=pb.w,ua[oa+4]=qb.x,ua[oa+5]=qb.y,ua[oa+6]=qb.z,ua[oa+7]=qb.w,ua[oa+8]=rb.x,ua[oa+9]=rb.y,ua[oa+10]=rb.z,ua[oa+11]=rb.w,oa+=12;for(G=0,T=la.length;G<T;G++)L=Da[la[G]],Hb=L.vertexTangents,pb=Hb[0],qb=Hb[1],rb=Hb[2],rc=Hb[3],ua[oa]=pb.x,ua[oa+1]=pb.y,ua[oa+2]=pb.z,ua[oa+3]=pb.w,ua[oa+4]=qb.x,ua[oa+5]=qb.y,ua[oa+6]=qb.z,ua[oa+7]=qb.w,ua[oa+8]=rb.x,ua[oa+9]=rb.y,ua[oa+10]=rb.z,ua[oa+11]=rb.w,ua[oa+12]=rc.x,ua[oa+
+13]=rc.y,ua[oa+14]=rc.z,ua[oa+15]=rc.w,oa+=16;j.bindBuffer(j.ARRAY_BUFFER,ea.__webglTangentBuffer);j.bufferData(j.ARRAY_BUFFER,ua,ab)}if(wd&&gd){for(G=0,T=ka.length;G<T;G++)if(L=Da[ka[G]],jc=L.vertexNormals,Ob=L.normal,3===jc.length&&Gc)for(ja=0;3>ja;ja++)Vb=jc[ja],hb[Ra]=Vb.x,hb[Ra+1]=Vb.y,hb[Ra+2]=Vb.z,Ra+=3;else for(ja=0;3>ja;ja++)hb[Ra]=Ob.x,hb[Ra+1]=Ob.y,hb[Ra+2]=Ob.z,Ra+=3;for(G=0,T=la.length;G<T;G++)if(L=Da[la[G]],jc=L.vertexNormals,Ob=L.normal,4===jc.length&&Gc)for(ja=0;4>ja;ja++)Vb=jc[ja],
+hb[Ra]=Vb.x,hb[Ra+1]=Vb.y,hb[Ra+2]=Vb.z,Ra+=3;else for(ja=0;4>ja;ja++)hb[Ra]=Ob.x,hb[Ra+1]=Ob.y,hb[Ra+2]=Ob.z,Ra+=3;j.bindBuffer(j.ARRAY_BUFFER,ea.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,hb,ab)}if(kd&&bd&&hd){for(G=0,T=ka.length;G<T;G++)if(kb=ka[G],L=Da[kb],kc=bd[kb],void 0!==kc)for(ja=0;3>ja;ja++)mc=kc[ja],wc[Jb]=mc.u,wc[Jb+1]=mc.v,Jb+=2;for(G=0,T=la.length;G<T;G++)if(kb=la[G],L=Da[kb],kc=bd[kb],void 0!==kc)for(ja=0;4>ja;ja++)mc=kc[ja],wc[Jb]=mc.u,wc[Jb+1]=mc.v,Jb+=2;0<Jb&&(j.bindBuffer(j.ARRAY_BUFFER,
+ea.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,wc,ab))}if(kd&&cd&&hd){for(G=0,T=ka.length;G<T;G++)if(kb=ka[G],L=Da[kb],lc=cd[kb],void 0!==lc)for(ja=0;3>ja;ja++)nc=lc[ja],xc[Kb]=nc.u,xc[Kb+1]=nc.v,Kb+=2;for(G=0,T=la.length;G<T;G++)if(kb=la[G],L=Da[kb],lc=cd[kb],void 0!==lc)for(ja=0;4>ja;ja++)nc=lc[ja],xc[Kb]=nc.u,xc[Kb+1]=nc.v,Kb+=2;0<Kb&&(j.bindBuffer(j.ARRAY_BUFFER,ea.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,xc,ab))}if(vd){for(G=0,T=ka.length;G<T;G++)L=Da[ka[G]],Eb[gb]=Ba,Eb[gb+1]=Ba+1,Eb[gb+
+2]=Ba+2,gb+=3,cb[Sa]=Ba,cb[Sa+1]=Ba+1,cb[Sa+2]=Ba,cb[Sa+3]=Ba+2,cb[Sa+4]=Ba+1,cb[Sa+5]=Ba+2,Sa+=6,Ba+=3;for(G=0,T=la.length;G<T;G++)L=Da[la[G]],Eb[gb]=Ba,Eb[gb+1]=Ba+1,Eb[gb+2]=Ba+3,Eb[gb+3]=Ba+1,Eb[gb+4]=Ba+2,Eb[gb+5]=Ba+3,gb+=6,cb[Sa]=Ba,cb[Sa+1]=Ba+1,cb[Sa+2]=Ba,cb[Sa+3]=Ba+3,cb[Sa+4]=Ba+1,cb[Sa+5]=Ba+2,cb[Sa+6]=Ba+2,cb[Sa+7]=Ba+3,Sa+=8,Ba+=4;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,ea.__webglFaceBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Eb,ab);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,ea.__webglLineBuffer);
+j.bufferData(j.ELEMENT_ARRAY_BUFFER,cb,ab)}if(ad)for(ja=0,id=ad.length;ja<id;ja++)if(x=ad[ja],x.__original.needsUpdate){z=0;if(1===x.size)if(void 0===x.boundTo||"vertices"===x.boundTo){for(G=0,T=ka.length;G<T;G++)L=Da[ka[G]],x.array[z]=x.value[L.a],x.array[z+1]=x.value[L.b],x.array[z+2]=x.value[L.c],z+=3;for(G=0,T=la.length;G<T;G++)L=Da[la[G]],x.array[z]=x.value[L.a],x.array[z+1]=x.value[L.b],x.array[z+2]=x.value[L.c],x.array[z+3]=x.value[L.d],z+=4}else{if("faces"===x.boundTo){for(G=0,T=ka.length;G<
+T;G++)bb=x.value[ka[G]],x.array[z]=bb,x.array[z+1]=bb,x.array[z+2]=bb,z+=3;for(G=0,T=la.length;G<T;G++)bb=x.value[la[G]],x.array[z]=bb,x.array[z+1]=bb,x.array[z+2]=bb,x.array[z+3]=bb,z+=4}}else if(2===x.size)if(void 0===x.boundTo||"vertices"===x.boundTo){for(G=0,T=ka.length;G<T;G++)L=Da[ka[G]],U=x.value[L.a],V=x.value[L.b],W=x.value[L.c],x.array[z]=U.x,x.array[z+1]=U.y,x.array[z+2]=V.x,x.array[z+3]=V.y,x.array[z+4]=W.x,x.array[z+5]=W.y,z+=6;for(G=0,T=la.length;G<T;G++)L=Da[la[G]],U=x.value[L.a],V=
+x.value[L.b],W=x.value[L.c],na=x.value[L.d],x.array[z]=U.x,x.array[z+1]=U.y,x.array[z+2]=V.x,x.array[z+3]=V.y,x.array[z+4]=W.x,x.array[z+5]=W.y,x.array[z+6]=na.x,x.array[z+7]=na.y,z+=8}else{if("faces"===x.boundTo){for(G=0,T=ka.length;G<T;G++)W=V=U=bb=x.value[ka[G]],x.array[z]=U.x,x.array[z+1]=U.y,x.array[z+2]=V.x,x.array[z+3]=V.y,x.array[z+4]=W.x,x.array[z+5]=W.y,z+=6;for(G=0,T=la.length;G<T;G++)na=W=V=U=bb=x.value[la[G]],x.array[z]=U.x,x.array[z+1]=U.y,x.array[z+2]=V.x,x.array[z+3]=V.y,x.array[z+
+4]=W.x,x.array[z+5]=W.y,x.array[z+6]=na.x,x.array[z+7]=na.y,z+=8}}else if(3===x.size){var ga;ga="c"===x.type?["r","g","b"]:["x","y","z"];if(void 0===x.boundTo||"vertices"===x.boundTo){for(G=0,T=ka.length;G<T;G++)L=Da[ka[G]],U=x.value[L.a],V=x.value[L.b],W=x.value[L.c],x.array[z]=U[ga[0]],x.array[z+1]=U[ga[1]],x.array[z+2]=U[ga[2]],x.array[z+3]=V[ga[0]],x.array[z+4]=V[ga[1]],x.array[z+5]=V[ga[2]],x.array[z+6]=W[ga[0]],x.array[z+7]=W[ga[1]],x.array[z+8]=W[ga[2]],z+=9;for(G=0,T=la.length;G<T;G++)L=Da[la[G]],
+U=x.value[L.a],V=x.value[L.b],W=x.value[L.c],na=x.value[L.d],x.array[z]=U[ga[0]],x.array[z+1]=U[ga[1]],x.array[z+2]=U[ga[2]],x.array[z+3]=V[ga[0]],x.array[z+4]=V[ga[1]],x.array[z+5]=V[ga[2]],x.array[z+6]=W[ga[0]],x.array[z+7]=W[ga[1]],x.array[z+8]=W[ga[2]],x.array[z+9]=na[ga[0]],x.array[z+10]=na[ga[1]],x.array[z+11]=na[ga[2]],z+=12}else if("faces"===x.boundTo){for(G=0,T=ka.length;G<T;G++)W=V=U=bb=x.value[ka[G]],x.array[z]=U[ga[0]],x.array[z+1]=U[ga[1]],x.array[z+2]=U[ga[2]],x.array[z+3]=V[ga[0]],
+x.array[z+4]=V[ga[1]],x.array[z+5]=V[ga[2]],x.array[z+6]=W[ga[0]],x.array[z+7]=W[ga[1]],x.array[z+8]=W[ga[2]],z+=9;for(G=0,T=la.length;G<T;G++)na=W=V=U=bb=x.value[la[G]],x.array[z]=U[ga[0]],x.array[z+1]=U[ga[1]],x.array[z+2]=U[ga[2]],x.array[z+3]=V[ga[0]],x.array[z+4]=V[ga[1]],x.array[z+5]=V[ga[2]],x.array[z+6]=W[ga[0]],x.array[z+7]=W[ga[1]],x.array[z+8]=W[ga[2]],x.array[z+9]=na[ga[0]],x.array[z+10]=na[ga[1]],x.array[z+11]=na[ga[2]],z+=12}}else if(4===x.size)if(void 0===x.boundTo||"vertices"===x.boundTo){for(G=
+0,T=ka.length;G<T;G++)L=Da[ka[G]],U=x.value[L.a],V=x.value[L.b],W=x.value[L.c],x.array[z]=U.x,x.array[z+1]=U.y,x.array[z+2]=U.z,x.array[z+3]=U.w,x.array[z+4]=V.x,x.array[z+5]=V.y,x.array[z+6]=V.z,x.array[z+7]=V.w,x.array[z+8]=W.x,x.array[z+9]=W.y,x.array[z+10]=W.z,x.array[z+11]=W.w,z+=12;for(G=0,T=la.length;G<T;G++)L=Da[la[G]],U=x.value[L.a],V=x.value[L.b],W=x.value[L.c],na=x.value[L.d],x.array[z]=U.x,x.array[z+1]=U.y,x.array[z+2]=U.z,x.array[z+3]=U.w,x.array[z+4]=V.x,x.array[z+5]=V.y,x.array[z+6]=
+V.z,x.array[z+7]=V.w,x.array[z+8]=W.x,x.array[z+9]=W.y,x.array[z+10]=W.z,x.array[z+11]=W.w,x.array[z+12]=na.x,x.array[z+13]=na.y,x.array[z+14]=na.z,x.array[z+15]=na.w,z+=16}else if("faces"===x.boundTo){for(G=0,T=ka.length;G<T;G++)W=V=U=bb=x.value[ka[G]],x.array[z]=U.x,x.array[z+1]=U.y,x.array[z+2]=U.z,x.array[z+3]=U.w,x.array[z+4]=V.x,x.array[z+5]=V.y,x.array[z+6]=V.z,x.array[z+7]=V.w,x.array[z+8]=W.x,x.array[z+9]=W.y,x.array[z+10]=W.z,x.array[z+11]=W.w,z+=12;for(G=0,T=la.length;G<T;G++)na=W=V=U=
+bb=x.value[la[G]],x.array[z]=U.x,x.array[z+1]=U.y,x.array[z+2]=U.z,x.array[z+3]=U.w,x.array[z+4]=V.x,x.array[z+5]=V.y,x.array[z+6]=V.z,x.array[z+7]=V.w,x.array[z+8]=W.x,x.array[z+9]=W.y,x.array[z+10]=W.z,x.array[z+11]=W.w,x.array[z+12]=na.x,x.array[z+13]=na.y,x.array[z+14]=na.z,x.array[z+15]=na.w,z+=16}j.bindBuffer(j.ARRAY_BUFFER,x.buffer);j.bufferData(j.ARRAY_BUFFER,x.array,ab)}ud&&(delete ea.__inittedArrays,delete ea.__colorArray,delete ea.__normalArray,delete ea.__tangentArray,delete ea.__uvArray,
+delete ea.__uv2Array,delete ea.__faceArray,delete ea.__vertexArray,delete ea.__lineArray,delete ea.__skinVertexAArray,delete ea.__skinVertexBArray,delete ea.__skinIndexArray,delete ea.__skinWeightArray)}}ia.__dirtyVertices=!1;ia.__dirtyMorphTargets=!1;ia.__dirtyElements=!1;ia.__dirtyUvs=!1;ia.__dirtyNormals=!1;ia.__dirtyColors=!1;ia.__dirtyTangents=!1;Ya.attributes&&n(Ya)}else if(nb instanceof THREE.Ribbon){if(ia.__dirtyVertices||ia.__dirtyColors){var Zb=ia,ld=j.DYNAMIC_DRAW,yc=void 0,zc=void 0,Lc=
 void 0,$b=void 0,Mc=void 0,md=Zb.vertices,nd=Zb.colors,Ad=md.length,Bd=nd.length,Nc=Zb.__vertexArray,Oc=Zb.__colorArray,Cd=Zb.__dirtyColors;if(Zb.__dirtyVertices){for(yc=0;yc<Ad;yc++)Lc=md[yc].position,$b=3*yc,Nc[$b]=Lc.x,Nc[$b+1]=Lc.y,Nc[$b+2]=Lc.z;j.bindBuffer(j.ARRAY_BUFFER,Zb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Nc,ld)}if(Cd){for(zc=0;zc<Bd;zc++)Mc=nd[zc],$b=3*zc,Oc[$b]=Mc.r,Oc[$b+1]=Mc.g,Oc[$b+2]=Mc.b;j.bindBuffer(j.ARRAY_BUFFER,Zb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,
 void 0,$b=void 0,Mc=void 0,md=Zb.vertices,nd=Zb.colors,Ad=md.length,Bd=nd.length,Nc=Zb.__vertexArray,Oc=Zb.__colorArray,Cd=Zb.__dirtyColors;if(Zb.__dirtyVertices){for(yc=0;yc<Ad;yc++)Lc=md[yc].position,$b=3*yc,Nc[$b]=Lc.x,Nc[$b+1]=Lc.y,Nc[$b+2]=Lc.z;j.bindBuffer(j.ARRAY_BUFFER,Zb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Nc,ld)}if(Cd){for(zc=0;zc<Bd;zc++)Mc=nd[zc],$b=3*zc,Oc[$b]=Mc.r,Oc[$b+1]=Mc.g,Oc[$b+2]=Mc.b;j.bindBuffer(j.ARRAY_BUFFER,Zb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,
-Oc,ld)}}ja.__dirtyVertices=!1;ja.__dirtyColors=!1}else if(nb instanceof THREE.Line){Ya=c(nb,qc);ic=Ya.attributes&&p(Ya);if(ja.__dirtyVertices||ja.__dirtyColors||ic){var Lb=ja,dd=j.DYNAMIC_DRAW,Ac=void 0,Bc=void 0,Pc=void 0,za=void 0,Qc=void 0,od=Lb.vertices,pd=Lb.colors,Dd=od.length,Ed=pd.length,Rc=Lb.__vertexArray,Sc=Lb.__colorArray,Fd=Lb.__dirtyColors,ed=Lb.__webglCustomAttributesList,Tc=void 0,qd=void 0,Qa=void 0,oc=void 0,Za=void 0,sa=void 0;if(Lb.__dirtyVertices){for(Ac=0;Ac<Dd;Ac++)Pc=od[Ac].position,
+Oc,ld)}}ia.__dirtyVertices=!1;ia.__dirtyColors=!1}else if(nb instanceof THREE.Line){Ya=c(nb,qc);ic=Ya.attributes&&p(Ya);if(ia.__dirtyVertices||ia.__dirtyColors||ic){var Lb=ia,dd=j.DYNAMIC_DRAW,Ac=void 0,Bc=void 0,Pc=void 0,za=void 0,Qc=void 0,od=Lb.vertices,pd=Lb.colors,Dd=od.length,Ed=pd.length,Rc=Lb.__vertexArray,Sc=Lb.__colorArray,Fd=Lb.__dirtyColors,ed=Lb.__webglCustomAttributesList,Tc=void 0,qd=void 0,Qa=void 0,oc=void 0,Za=void 0,sa=void 0;if(Lb.__dirtyVertices){for(Ac=0;Ac<Dd;Ac++)Pc=od[Ac].position,
 za=3*Ac,Rc[za]=Pc.x,Rc[za+1]=Pc.y,Rc[za+2]=Pc.z;j.bindBuffer(j.ARRAY_BUFFER,Lb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Rc,dd)}if(Fd){for(Bc=0;Bc<Ed;Bc++)Qc=pd[Bc],za=3*Bc,Sc[za]=Qc.r,Sc[za+1]=Qc.g,Sc[za+2]=Qc.b;j.bindBuffer(j.ARRAY_BUFFER,Lb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Sc,dd)}if(ed)for(Tc=0,qd=ed.length;Tc<qd;Tc++)if(sa=ed[Tc],sa.needsUpdate&&(void 0===sa.boundTo||"vertices"===sa.boundTo)){za=0;oc=sa.value.length;if(1===sa.size)for(Qa=0;Qa<oc;Qa++)sa.array[Qa]=sa.value[Qa];
 za=3*Ac,Rc[za]=Pc.x,Rc[za+1]=Pc.y,Rc[za+2]=Pc.z;j.bindBuffer(j.ARRAY_BUFFER,Lb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,Rc,dd)}if(Fd){for(Bc=0;Bc<Ed;Bc++)Qc=pd[Bc],za=3*Bc,Sc[za]=Qc.r,Sc[za+1]=Qc.g,Sc[za+2]=Qc.b;j.bindBuffer(j.ARRAY_BUFFER,Lb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Sc,dd)}if(ed)for(Tc=0,qd=ed.length;Tc<qd;Tc++)if(sa=ed[Tc],sa.needsUpdate&&(void 0===sa.boundTo||"vertices"===sa.boundTo)){za=0;oc=sa.value.length;if(1===sa.size)for(Qa=0;Qa<oc;Qa++)sa.array[Qa]=sa.value[Qa];
 else if(2===sa.size)for(Qa=0;Qa<oc;Qa++)Za=sa.value[Qa],sa.array[za]=Za.x,sa.array[za+1]=Za.y,za+=2;else if(3===sa.size)if("c"===sa.type)for(Qa=0;Qa<oc;Qa++)Za=sa.value[Qa],sa.array[za]=Za.r,sa.array[za+1]=Za.g,sa.array[za+2]=Za.b,za+=3;else for(Qa=0;Qa<oc;Qa++)Za=sa.value[Qa],sa.array[za]=Za.x,sa.array[za+1]=Za.y,sa.array[za+2]=Za.z,za+=3;else if(4===sa.size)for(Qa=0;Qa<oc;Qa++)Za=sa.value[Qa],sa.array[za]=Za.x,sa.array[za+1]=Za.y,sa.array[za+2]=Za.z,sa.array[za+3]=Za.w,za+=4;j.bindBuffer(j.ARRAY_BUFFER,
 else if(2===sa.size)for(Qa=0;Qa<oc;Qa++)Za=sa.value[Qa],sa.array[za]=Za.x,sa.array[za+1]=Za.y,za+=2;else if(3===sa.size)if("c"===sa.type)for(Qa=0;Qa<oc;Qa++)Za=sa.value[Qa],sa.array[za]=Za.r,sa.array[za+1]=Za.g,sa.array[za+2]=Za.b,za+=3;else for(Qa=0;Qa<oc;Qa++)Za=sa.value[Qa],sa.array[za]=Za.x,sa.array[za+1]=Za.y,sa.array[za+2]=Za.z,za+=3;else if(4===sa.size)for(Qa=0;Qa<oc;Qa++)Za=sa.value[Qa],sa.array[za]=Za.x,sa.array[za+1]=Za.y,sa.array[za+2]=Za.z,sa.array[za+3]=Za.w,za+=4;j.bindBuffer(j.ARRAY_BUFFER,
-sa.buffer);j.bufferData(j.ARRAY_BUFFER,sa.array,dd)}}ja.__dirtyVertices=!1;ja.__dirtyColors=!1;Ya.attributes&&n(Ya)}else if(nb instanceof THREE.ParticleSystem)Ya=c(nb,qc),ic=Ya.attributes&&p(Ya),(ja.__dirtyVertices||ja.__dirtyColors||nb.sortParticles||ic)&&g(ja,j.DYNAMIC_DRAW,nb),ja.__dirtyVertices=!1,ja.__dirtyColors=!1,Ya.attributes&&n(Ya)}};this.initMaterial=function(a,b,c,d){var e,g,f,h,i;a instanceof THREE.MeshDepthMaterial?i="depth":a instanceof THREE.MeshNormalMaterial?i="normal":a instanceof
+sa.buffer);j.bufferData(j.ARRAY_BUFFER,sa.array,dd)}}ia.__dirtyVertices=!1;ia.__dirtyColors=!1;Ya.attributes&&n(Ya)}else if(nb instanceof THREE.ParticleSystem)Ya=c(nb,qc),ic=Ya.attributes&&p(Ya),(ia.__dirtyVertices||ia.__dirtyColors||nb.sortParticles||ic)&&g(ia,j.DYNAMIC_DRAW,nb),ia.__dirtyVertices=!1,ia.__dirtyColors=!1,Ya.attributes&&n(Ya)}};this.initMaterial=function(a,b,c,d){var e,g,f,h,i;a instanceof THREE.MeshDepthMaterial?i="depth":a instanceof THREE.MeshNormalMaterial?i="normal":a instanceof
 THREE.MeshBasicMaterial?i="basic":a instanceof THREE.MeshLambertMaterial?i="lambert":a instanceof THREE.MeshPhongMaterial?i="phong":a instanceof THREE.LineBasicMaterial?i="basic":a instanceof THREE.ParticleBasicMaterial&&(i="particle_basic");if(i){var m=THREE.ShaderLib[i];a.uniforms=THREE.UniformsUtils.clone(m.uniforms);a.vertexShader=m.vertexShader;a.fragmentShader=m.fragmentShader}var k,l;g=m=0;for(k=0,l=b.length;k<l;k++)e=b[k],e.onlyShadow||(e instanceof THREE.DirectionalLight&&g++,e instanceof
 THREE.MeshBasicMaterial?i="basic":a instanceof THREE.MeshLambertMaterial?i="lambert":a instanceof THREE.MeshPhongMaterial?i="phong":a instanceof THREE.LineBasicMaterial?i="basic":a instanceof THREE.ParticleBasicMaterial&&(i="particle_basic");if(i){var m=THREE.ShaderLib[i];a.uniforms=THREE.UniformsUtils.clone(m.uniforms);a.vertexShader=m.vertexShader;a.fragmentShader=m.fragmentShader}var k,l;g=m=0;for(k=0,l=b.length;k<l;k++)e=b[k],e.onlyShadow||(e instanceof THREE.DirectionalLight&&g++,e instanceof
 THREE.PointLight&&m++,e instanceof THREE.SpotLight&&m++);m+g<=M?k=g:(k=Math.ceil(M*g/(m+g)),m=M-k);e=k;g=m;var n=0;for(m=0,k=b.length;m<k;m++)l=b[m],l.castShadow&&(l instanceof THREE.SpotLight&&n++,l instanceof THREE.DirectionalLight&&!l.shadowCascade&&n++);var o=50;if(void 0!==d&&d instanceof THREE.SkinnedMesh)o=d.bones.length;var p;a:{k=a.fragmentShader;l=a.vertexShader;var m=a.uniforms,b=a.attributes,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,
 THREE.PointLight&&m++,e instanceof THREE.SpotLight&&m++);m+g<=M?k=g:(k=Math.ceil(M*g/(m+g)),m=M-k);e=k;g=m;var n=0;for(m=0,k=b.length;m<k;m++)l=b[m],l.castShadow&&(l instanceof THREE.SpotLight&&n++,l instanceof THREE.DirectionalLight&&!l.shadowCascade&&n++);var o=50;if(void 0!==d&&d instanceof THREE.SkinnedMesh)o=d.bones.length;var p;a:{k=a.fragmentShader;l=a.vertexShader;var m=a.uniforms,b=a.attributes,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,
 sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:g,maxBones:o,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,maxShadows:n,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround},q,d=[];i?d.push(i):
 sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:g,maxBones:o,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,maxShadows:n,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround},q,d=[];i?d.push(i):
-(d.push(k),d.push(l));for(q in c)d.push(q),d.push(c[q]);i=d.join();for(q=0,d=Y.length;q<d;q++)if(Y[q].code===i){p=Y[q].program;break a}q=j.createProgram();d=[0<Aa?"#define VERTEX_TEXTURES":"",H.gammaInput?"#define GAMMA_INPUT":"",H.gammaOutput?"#define GAMMA_OUTPUT":"",H.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":
+(d.push(k),d.push(l));for(q in c)d.push(q),d.push(c[q]);i=d.join();for(q=0,d=X.length;q<d;q++)if(X[q].code===i){p=X[q].program;break a}q=j.createProgram();d=[0<Aa?"#define VERTEX_TEXTURES":"",H.gammaInput?"#define GAMMA_INPUT":"",H.gammaOutput?"#define GAMMA_OUTPUT":"",H.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":
 "",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",
 "",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",
 c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
 c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
 e=["precision "+A+" float;","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",H.gammaInput?"#define GAMMA_INPUT":"",H.gammaOutput?"#define GAMMA_OUTPUT":"",H.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?
 e=["precision "+A+" float;","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",H.gammaInput?"#define GAMMA_INPUT":"",H.gammaOutput?"#define GAMMA_OUTPUT":"",H.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?
 "#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");j.attachShader(q,t("fragment",e+k));j.attachShader(q,t("vertex",d+l));j.linkProgram(q);
 "#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");j.attachShader(q,t("fragment",e+k));j.attachShader(q,t("vertex",d+l));j.linkProgram(q);
 j.getProgramParameter(q,j.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+j.getProgramParameter(q,j.VALIDATE_STATUS)+", gl error ["+j.getError()+"]");q.uniforms={};q.attributes={};var r,d="viewMatrix,modelViewMatrix,projectionMatrix,normalMatrix,objectMatrix,cameraPosition,boneGlobalMatrices,morphTargetInfluences".split(",");for(r in m)d.push(r);r=d;for(d=0,m=r.length;d<m;d++)k=r[d],q.uniforms[k]=j.getUniformLocation(q,k);d="position,normal,uv,uv2,tangent,color,skinVertexA,skinVertexB,skinIndex,skinWeight".split(",");
 j.getProgramParameter(q,j.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+j.getProgramParameter(q,j.VALIDATE_STATUS)+", gl error ["+j.getError()+"]");q.uniforms={};q.attributes={};var r,d="viewMatrix,modelViewMatrix,projectionMatrix,normalMatrix,objectMatrix,cameraPosition,boneGlobalMatrices,morphTargetInfluences".split(",");for(r in m)d.push(r);r=d;for(d=0,m=r.length;d<m;d++)k=r[d],q.uniforms[k]=j.getUniformLocation(q,k);d="position,normal,uv,uv2,tangent,color,skinVertexA,skinVertexB,skinIndex,skinWeight".split(",");
-for(r=0;r<c.maxMorphTargets;r++)d.push("morphTarget"+r);for(r=0;r<c.maxMorphNormals;r++)d.push("morphNormal"+r);for(p in b)d.push(p);p=d;for(r=0,b=p.length;r<b;r++)c=p[r],q.attributes[c]=j.getAttribLocation(q,c);q.id=Y.length;Y.push({program:q,code:i});H.info.memory.programs=Y.length;p=q}a.program=p;p=a.program.attributes;0<=p.position&&j.enableVertexAttribArray(p.position);0<=p.color&&j.enableVertexAttribArray(p.color);0<=p.normal&&j.enableVertexAttribArray(p.normal);0<=p.tangent&&j.enableVertexAttribArray(p.tangent);
+for(r=0;r<c.maxMorphTargets;r++)d.push("morphTarget"+r);for(r=0;r<c.maxMorphNormals;r++)d.push("morphNormal"+r);for(p in b)d.push(p);p=d;for(r=0,b=p.length;r<b;r++)c=p[r],q.attributes[c]=j.getAttribLocation(q,c);q.id=X.length;X.push({program:q,code:i});H.info.memory.programs=X.length;p=q}a.program=p;p=a.program.attributes;0<=p.position&&j.enableVertexAttribArray(p.position);0<=p.color&&j.enableVertexAttribArray(p.color);0<=p.normal&&j.enableVertexAttribArray(p.normal);0<=p.tangent&&j.enableVertexAttribArray(p.tangent);
 a.skinning&&0<=p.skinVertexA&&0<=p.skinVertexB&&0<=p.skinIndex&&0<=p.skinWeight&&(j.enableVertexAttribArray(p.skinVertexA),j.enableVertexAttribArray(p.skinVertexB),j.enableVertexAttribArray(p.skinIndex),j.enableVertexAttribArray(p.skinWeight));if(a.attributes)for(h in a.attributes)void 0!==p[h]&&0<=p[h]&&j.enableVertexAttribArray(p[h]);if(a.morphTargets){a.numSupportedMorphTargets=0;q="morphTarget";for(h=0;h<this.maxMorphTargets;h++)r=q+h,0<=p[r]&&(j.enableVertexAttribArray(p[r]),a.numSupportedMorphTargets++)}if(a.morphNormals){a.numSupportedMorphNormals=
 a.skinning&&0<=p.skinVertexA&&0<=p.skinVertexB&&0<=p.skinIndex&&0<=p.skinWeight&&(j.enableVertexAttribArray(p.skinVertexA),j.enableVertexAttribArray(p.skinVertexB),j.enableVertexAttribArray(p.skinIndex),j.enableVertexAttribArray(p.skinWeight));if(a.attributes)for(h in a.attributes)void 0!==p[h]&&0<=p[h]&&j.enableVertexAttribArray(p[h]);if(a.morphTargets){a.numSupportedMorphTargets=0;q="morphTarget";for(h=0;h<this.maxMorphTargets;h++)r=q+h,0<=p[r]&&(j.enableVertexAttribArray(p[r]),a.numSupportedMorphTargets++)}if(a.morphNormals){a.numSupportedMorphNormals=
-0;q="morphNormal";for(h=0;h<this.maxMorphNormals;h++)r=q+h,0<=p[r]&&(j.enableVertexAttribArray(p[r]),a.numSupportedMorphNormals++)}a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.setFaceCulling=function(a,b){a?(!b||"ccw"===b?j.frontFace(j.CCW):j.frontFace(j.CW),"back"===a?j.cullFace(j.BACK):"front"===a?j.cullFace(j.FRONT):j.cullFace(j.FRONT_AND_BACK),j.enable(j.CULL_FACE)):j.disable(j.CULL_FACE)};this.setObjectFaces=function(a){if(ia!==a.doubleSided)a.doubleSided?
-j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),ia=a.doubleSided;if(S!==a.flipSided)a.flipSided?j.frontFace(j.CW):j.frontFace(j.CCW),S=a.flipSided};this.setDepthTest=function(a){R!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),R=a)};this.setDepthWrite=function(a){ba!==a&&(j.depthMask(a),ba=a)};this.setBlending=function(a){if(a!==aa){switch(a){case THREE.AdditiveBlending:j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE);break;case THREE.SubtractiveBlending:j.blendEquation(j.FUNC_ADD);
-j.blendFunc(j.ZERO,j.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:j.blendEquation(j.FUNC_ADD);j.blendFunc(j.ZERO,j.SRC_COLOR);break;default:j.blendEquationSeparate(j.FUNC_ADD,j.FUNC_ADD),j.blendFuncSeparate(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA,j.ONE,j.ONE_MINUS_SRC_ALPHA)}aa=a}};this.setTexture=function(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=j.createTexture(),H.info.memory.textures++;j.activeTexture(j.TEXTURE0+b);j.bindTexture(j.TEXTURE_2D,a.__webglTexture);
+0;q="morphNormal";for(h=0;h<this.maxMorphNormals;h++)r=q+h,0<=p[r]&&(j.enableVertexAttribArray(p[r]),a.numSupportedMorphNormals++)}a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.setFaceCulling=function(a,b){a?(!b||"ccw"===b?j.frontFace(j.CCW):j.frontFace(j.CW),"back"===a?j.cullFace(j.BACK):"front"===a?j.cullFace(j.FRONT):j.cullFace(j.FRONT_AND_BACK),j.enable(j.CULL_FACE)):j.disable(j.CULL_FACE)};this.setObjectFaces=function(a){if(ha!==a.doubleSided)a.doubleSided?
+j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),ha=a.doubleSided;if(R!==a.flipSided)a.flipSided?j.frontFace(j.CW):j.frontFace(j.CCW),R=a.flipSided};this.setDepthTest=function(a){Q!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),Q=a)};this.setDepthWrite=function(a){aa!==a&&(j.depthMask(a),aa=a)};this.setBlending=function(a){if(a!==$){switch(a){case THREE.AdditiveBlending:j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE);break;case THREE.SubtractiveBlending:j.blendEquation(j.FUNC_ADD);
+j.blendFunc(j.ZERO,j.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:j.blendEquation(j.FUNC_ADD);j.blendFunc(j.ZERO,j.SRC_COLOR);break;default:j.blendEquationSeparate(j.FUNC_ADD,j.FUNC_ADD),j.blendFuncSeparate(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA,j.ONE,j.ONE_MINUS_SRC_ALPHA)}$=a}};this.setTexture=function(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=j.createTexture(),H.info.memory.textures++;j.activeTexture(j.TEXTURE0+b);j.bindTexture(j.TEXTURE_2D,a.__webglTexture);
 var c=a.image,d=0===(c.width&c.width-1)&&0===(c.height&c.height-1),e=y(a.format),g=y(a.type);w(j.TEXTURE_2D,a,d);a instanceof THREE.DataTexture?j.texImage2D(j.TEXTURE_2D,0,e,c.width,c.height,0,e,g,c.data):j.texImage2D(j.TEXTURE_2D,0,e,e,g,a.image);a.generateMipmaps&&d&&j.generateMipmap(j.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdated)a.onUpdated()}else j.activeTexture(j.TEXTURE0+b),j.bindTexture(j.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;
 var c=a.image,d=0===(c.width&c.width-1)&&0===(c.height&c.height-1),e=y(a.format),g=y(a.type);w(j.TEXTURE_2D,a,d);a instanceof THREE.DataTexture?j.texImage2D(j.TEXTURE_2D,0,e,c.width,c.height,0,e,g,c.data):j.texImage2D(j.TEXTURE_2D,0,e,e,g,a.image);a.generateMipmaps&&d&&j.generateMipmap(j.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdated)a.onUpdated()}else j.activeTexture(j.TEXTURE0+b),j.bindTexture(j.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;
 if(a&&!a.__webglFramebuffer){if(void 0===a.depthBuffer)a.depthBuffer=!0;if(void 0===a.stencilBuffer)a.stencilBuffer=!0;a.__webglTexture=j.createTexture();var c=0===(a.width&a.width-1)&&0===(a.height&a.height-1),d=y(a.format),e=y(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];j.bindTexture(j.TEXTURE_CUBE_MAP,a.__webglTexture);w(j.TEXTURE_CUBE_MAP,a,c);for(c=0;6>c;c++){a.__webglFramebuffer[c]=j.createFramebuffer();a.__webglRenderbuffer[c]=j.createRenderbuffer();j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+
 if(a&&!a.__webglFramebuffer){if(void 0===a.depthBuffer)a.depthBuffer=!0;if(void 0===a.stencilBuffer)a.stencilBuffer=!0;a.__webglTexture=j.createTexture();var c=0===(a.width&a.width-1)&&0===(a.height&a.height-1),d=y(a.format),e=y(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];j.bindTexture(j.TEXTURE_CUBE_MAP,a.__webglTexture);w(j.TEXTURE_CUBE_MAP,a,c);for(c=0;6>c;c++){a.__webglFramebuffer[c]=j.createFramebuffer();a.__webglRenderbuffer[c]=j.createRenderbuffer();j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+
 c,0,d,a.width,a.height,0,d,e,null);var g=a,f=j.TEXTURE_CUBE_MAP_POSITIVE_X+c;j.bindFramebuffer(j.FRAMEBUFFER,a.__webglFramebuffer[c]);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,f,g.__webglTexture,0);u(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=j.createFramebuffer(),a.__webglRenderbuffer=j.createRenderbuffer(),j.bindTexture(j.TEXTURE_2D,a.__webglTexture),w(j.TEXTURE_2D,a,c),j.texImage2D(j.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=j.TEXTURE_2D,j.bindFramebuffer(j.FRAMEBUFFER,
 c,0,d,a.width,a.height,0,d,e,null);var g=a,f=j.TEXTURE_CUBE_MAP_POSITIVE_X+c;j.bindFramebuffer(j.FRAMEBUFFER,a.__webglFramebuffer[c]);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,f,g.__webglTexture,0);u(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=j.createFramebuffer(),a.__webglRenderbuffer=j.createRenderbuffer(),j.bindTexture(j.TEXTURE_2D,a.__webglTexture),w(j.TEXTURE_2D,a,c),j.texImage2D(j.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=j.TEXTURE_2D,j.bindFramebuffer(j.FRAMEBUFFER,
-a.__webglFramebuffer),j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,d,a.__webglTexture,0),u(a.__webglRenderbuffer,a);b?j.bindTexture(j.TEXTURE_CUBE_MAP,null):j.bindTexture(j.TEXTURE_2D,null);j.bindRenderbuffer(j.RENDERBUFFER,null);j.bindFramebuffer(j.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,d=a.width,a=a.height,c=e=0):(b=null,d=qa,a=ib,e=Ia,c=ra);b!==F&&(j.bindFramebuffer(j.FRAMEBUFFER,b),j.viewport(e,c,d,a),F=b);Va=d;lb=a};this.shadowMapPlugin=
+a.__webglFramebuffer),j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,d,a.__webglTexture,0),u(a.__webglRenderbuffer,a);b?j.bindTexture(j.TEXTURE_CUBE_MAP,null):j.bindTexture(j.TEXTURE_2D,null);j.bindRenderbuffer(j.RENDERBUFFER,null);j.bindFramebuffer(j.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,d=a.width,a=a.height,c=e=0):(b=null,d=pa,a=ib,e=Ia,c=ra);b!==E&&(j.bindFramebuffer(j.FRAMEBUFFER,b),j.viewport(e,c,d,a),E=b);Va=d;lb=a};this.shadowMapPlugin=
 new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};
 new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};
 THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:THREE.RGBAFormat;this.type=void 0!==c.type?c.type:
 THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:THREE.RGBAFormat;this.type=void 0!==c.type?c.type:
 THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0};
 THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0};
@@ -370,22 +370,22 @@ THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new
 THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.material=null};
 THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.material=null};
 THREE.ColorUtils={adjustHSV:function(a,b,c,d){var e=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,e);e.h=THREE.Math.clamp(e.h+b,0,1);e.s=THREE.Math.clamp(e.s+c,0,1);e.v=THREE.Math.clamp(e.v+d,0,1);a.setHSV(e.h,e.s,e.v)},rgbToHsv:function(a,b){var c=a.r,d=a.g,e=a.b,g=Math.max(Math.max(c,d),e),f=Math.min(Math.min(c,d),e);if(f===g)f=c=0;else{var h=g-f,f=h/g,c=(c===g?(d-e)/h:d===g?2+(e-c)/h:4+(c-d)/h)/6;0>c&&(c+=1);1<c&&(c-=1)}void 0===b&&(b={h:0,s:0,v:0});b.h=c;b.s=f;b.v=g;return b}};
 THREE.ColorUtils={adjustHSV:function(a,b,c,d){var e=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,e);e.h=THREE.Math.clamp(e.h+b,0,1);e.s=THREE.Math.clamp(e.s+c,0,1);e.v=THREE.Math.clamp(e.v+d,0,1);a.setHSV(e.h,e.s,e.v)},rgbToHsv:function(a,b){var c=a.r,d=a.g,e=a.b,g=Math.max(Math.max(c,d),e),f=Math.min(Math.min(c,d),e);if(f===g)f=c=0;else{var h=g-f,f=h/g,c=(c===g?(d-e)/h:d===g?2+(e-c)/h:4+(c-d)/h)/6;0>c&&(c+=1);1<c&&(c-=1)}void 0===b&&(b={h:0,s:0,v:0});b.h=c;b.s=f;b.v=g;return b}};
 THREE.ColorUtils.__hsv={h:0,s:0,v:0};
 THREE.ColorUtils.__hsv={h:0,s:0,v:0};
-THREE.GeometryUtils={merge:function(a,b){for(var c,d,e=a.vertices.length,g=b instanceof THREE.Mesh?b.geometry:b,f=a.vertices,h=g.vertices,i=a.faces,k=g.faces,l=a.faceVertexUvs[0],p=g.faceVertexUvs[0],n={},o=0;o<a.materials.length;o++)n[a.materials[o].id]=o;if(b instanceof THREE.Mesh)b.matrixAutoUpdate&&b.updateMatrix(),c=b.matrix,d=new THREE.Matrix4,d.extractRotation(c,b.scale);for(var o=0,q=h.length;o<q;o++){var m=new THREE.Vertex(h[o].position.clone());c&&c.multiplyVector3(m.position);f.push(m)}for(o=
-0,q=k.length;o<q;o++){var f=k[o],r,s,t=f.vertexNormals,w=f.vertexColors;f instanceof THREE.Face3?r=new THREE.Face3(f.a+e,f.b+e,f.c+e):f instanceof THREE.Face4&&(r=new THREE.Face4(f.a+e,f.b+e,f.c+e,f.d+e));r.normal.copy(f.normal);d&&d.multiplyVector3(r.normal);h=0;for(m=t.length;h<m;h++)s=t[h].clone(),d&&d.multiplyVector3(s),r.vertexNormals.push(s);r.color.copy(f.color);h=0;for(m=w.length;h<m;h++)s=w[h],r.vertexColors.push(s.clone());if(void 0!==f.materialIndex){h=g.materials[f.materialIndex];m=h.id;
-w=n[m];if(void 0===w)w=a.materials.length,n[m]=w,a.materials.push(h);r.materialIndex=w}r.centroid.copy(f.centroid);c&&c.multiplyVector3(r.centroid);i.push(r)}for(o=0,q=p.length;o<q;o++){c=p[o];d=[];h=0;for(m=c.length;h<m;h++)d.push(new THREE.UV(c[h].u,c[h].v));l.push(d)}},clone:function(a){var b=new THREE.Geometry,c,d=a.vertices,e=a.faces,g=a.faceVertexUvs[0];if(a.materials)b.materials=a.materials.slice();for(a=0,c=d.length;a<c;a++){var f=new THREE.Vertex(d[a].position.clone());b.vertices.push(f)}for(a=
-0,c=e.length;a<c;a++){var h=e[a],i,k,l=h.vertexNormals,p=h.vertexColors;h instanceof THREE.Face3?i=new THREE.Face3(h.a,h.b,h.c):h instanceof THREE.Face4&&(i=new THREE.Face4(h.a,h.b,h.c,h.d));i.normal.copy(h.normal);d=0;for(f=l.length;d<f;d++)k=l[d],i.vertexNormals.push(k.clone());i.color.copy(h.color);d=0;for(f=p.length;d<f;d++)k=p[d],i.vertexColors.push(k.clone());i.materialIndex=h.materialIndex;i.centroid.copy(h.centroid);b.faces.push(i)}for(a=0,c=g.length;a<c;a++){e=g[a];i=[];d=0;for(f=e.length;d<
+THREE.GeometryUtils={merge:function(a,b){for(var c,d,e=a.vertices.length,g=b instanceof THREE.Mesh?b.geometry:b,f=a.vertices,h=g.vertices,i=a.faces,l=g.faces,k=a.faceVertexUvs[0],p=g.faceVertexUvs[0],n={},o=0;o<a.materials.length;o++)n[a.materials[o].id]=o;if(b instanceof THREE.Mesh)b.matrixAutoUpdate&&b.updateMatrix(),c=b.matrix,d=new THREE.Matrix4,d.extractRotation(c,b.scale);for(var o=0,q=h.length;o<q;o++){var m=new THREE.Vertex(h[o].position.clone());c&&c.multiplyVector3(m.position);f.push(m)}for(o=
+0,q=l.length;o<q;o++){var f=l[o],r,s,t=f.vertexNormals,w=f.vertexColors;f instanceof THREE.Face3?r=new THREE.Face3(f.a+e,f.b+e,f.c+e):f instanceof THREE.Face4&&(r=new THREE.Face4(f.a+e,f.b+e,f.c+e,f.d+e));r.normal.copy(f.normal);d&&d.multiplyVector3(r.normal);h=0;for(m=t.length;h<m;h++)s=t[h].clone(),d&&d.multiplyVector3(s),r.vertexNormals.push(s);r.color.copy(f.color);h=0;for(m=w.length;h<m;h++)s=w[h],r.vertexColors.push(s.clone());if(void 0!==f.materialIndex){h=g.materials[f.materialIndex];m=h.id;
+w=n[m];if(void 0===w)w=a.materials.length,n[m]=w,a.materials.push(h);r.materialIndex=w}r.centroid.copy(f.centroid);c&&c.multiplyVector3(r.centroid);i.push(r)}for(o=0,q=p.length;o<q;o++){c=p[o];d=[];h=0;for(m=c.length;h<m;h++)d.push(new THREE.UV(c[h].u,c[h].v));k.push(d)}},clone:function(a){var b=new THREE.Geometry,c,d=a.vertices,e=a.faces,g=a.faceVertexUvs[0];if(a.materials)b.materials=a.materials.slice();for(a=0,c=d.length;a<c;a++){var f=new THREE.Vertex(d[a].position.clone());b.vertices.push(f)}for(a=
+0,c=e.length;a<c;a++){var h=e[a],i,l,k=h.vertexNormals,p=h.vertexColors;h instanceof THREE.Face3?i=new THREE.Face3(h.a,h.b,h.c):h instanceof THREE.Face4&&(i=new THREE.Face4(h.a,h.b,h.c,h.d));i.normal.copy(h.normal);d=0;for(f=k.length;d<f;d++)l=k[d],i.vertexNormals.push(l.clone());i.color.copy(h.color);d=0;for(f=p.length;d<f;d++)l=p[d],i.vertexColors.push(l.clone());i.materialIndex=h.materialIndex;i.centroid.copy(h.centroid);b.faces.push(i)}for(a=0,c=g.length;a<c;a++){e=g[a];i=[];d=0;for(f=e.length;d<
 f;d++)i.push(new THREE.UV(e[d].u,e[d].v));b.faceVertexUvs[0].push(i)}return b},randomPointInTriangle:function(a,b,c){var d,e,g,f=new THREE.Vector3,h=THREE.GeometryUtils.__v1;d=THREE.GeometryUtils.random();e=THREE.GeometryUtils.random();1<d+e&&(d=1-d,e=1-e);g=1-d-e;f.copy(a);f.multiplyScalar(d);h.copy(b);h.multiplyScalar(e);f.addSelf(h);h.copy(c);h.multiplyScalar(g);f.addSelf(h);return f},randomPointInFace:function(a,b,c){var d,e,g;if(a instanceof THREE.Face3)return d=b.vertices[a.a].position,e=b.vertices[a.b].position,
 f;d++)i.push(new THREE.UV(e[d].u,e[d].v));b.faceVertexUvs[0].push(i)}return b},randomPointInTriangle:function(a,b,c){var d,e,g,f=new THREE.Vector3,h=THREE.GeometryUtils.__v1;d=THREE.GeometryUtils.random();e=THREE.GeometryUtils.random();1<d+e&&(d=1-d,e=1-e);g=1-d-e;f.copy(a);f.multiplyScalar(d);h.copy(b);h.multiplyScalar(e);f.addSelf(h);h.copy(c);h.multiplyScalar(g);f.addSelf(h);return f},randomPointInFace:function(a,b,c){var d,e,g;if(a instanceof THREE.Face3)return d=b.vertices[a.a].position,e=b.vertices[a.b].position,
 g=b.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(d,e,g);if(a instanceof THREE.Face4){d=b.vertices[a.a].position;e=b.vertices[a.b].position;g=b.vertices[a.c].position;var b=b.vertices[a.d].position,f;c?a._area1&&a._area2?(c=a._area1,f=a._area2):(c=THREE.GeometryUtils.triangleArea(d,e,b),f=THREE.GeometryUtils.triangleArea(e,g,b),a._area1=c,a._area2=f):(c=THREE.GeometryUtils.triangleArea(d,e,b),f=THREE.GeometryUtils.triangleArea(e,g,b));return THREE.GeometryUtils.random()*(c+f)<c?
 g=b.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(d,e,g);if(a instanceof THREE.Face4){d=b.vertices[a.a].position;e=b.vertices[a.b].position;g=b.vertices[a.c].position;var b=b.vertices[a.d].position,f;c?a._area1&&a._area2?(c=a._area1,f=a._area2):(c=THREE.GeometryUtils.triangleArea(d,e,b),f=THREE.GeometryUtils.triangleArea(e,g,b),a._area1=c,a._area2=f):(c=THREE.GeometryUtils.triangleArea(d,e,b),f=THREE.GeometryUtils.triangleArea(e,g,b));return THREE.GeometryUtils.random()*(c+f)<c?
-THREE.GeometryUtils.randomPointInTriangle(d,e,b):THREE.GeometryUtils.randomPointInTriangle(e,g,b)}},randomPointsInGeometry:function(a,b){function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2);return k[e]>a?b(c,e-1):k[e]<a?b(e+1,d):e}return b(0,k.length-1)}var d,e,g=a.faces,f=a.vertices,h=g.length,i=0,k=[],l,p,n,o;for(e=0;e<h;e++){d=g[e];if(d instanceof THREE.Face3)l=f[d.a].position,p=f[d.b].position,n=f[d.c].position,d._area=THREE.GeometryUtils.triangleArea(l,p,n);else if(d instanceof
-THREE.Face4)l=f[d.a].position,p=f[d.b].position,n=f[d.c].position,o=f[d.d].position,d._area1=THREE.GeometryUtils.triangleArea(l,p,o),d._area2=THREE.GeometryUtils.triangleArea(p,n,o),d._area=d._area1+d._area2;i+=d._area;k[e]=i}d=[];for(e=0;e<b;e++)f=THREE.GeometryUtils.random()*i,f=c(f),d[e]=THREE.GeometryUtils.randomPointInFace(g[f],a,!0);return d},triangleArea:function(a,b,c){var d,e=THREE.GeometryUtils.__v1;e.sub(a,b);d=e.length();e.sub(a,c);a=e.length();e.sub(b,c);c=e.length();b=0.5*(d+a+c);return Math.sqrt(b*
+THREE.GeometryUtils.randomPointInTriangle(d,e,b):THREE.GeometryUtils.randomPointInTriangle(e,g,b)}},randomPointsInGeometry:function(a,b){function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2);return l[e]>a?b(c,e-1):l[e]<a?b(e+1,d):e}return b(0,l.length-1)}var d,e,g=a.faces,f=a.vertices,h=g.length,i=0,l=[],k,p,n,o;for(e=0;e<h;e++){d=g[e];if(d instanceof THREE.Face3)k=f[d.a].position,p=f[d.b].position,n=f[d.c].position,d._area=THREE.GeometryUtils.triangleArea(k,p,n);else if(d instanceof
+THREE.Face4)k=f[d.a].position,p=f[d.b].position,n=f[d.c].position,o=f[d.d].position,d._area1=THREE.GeometryUtils.triangleArea(k,p,o),d._area2=THREE.GeometryUtils.triangleArea(p,n,o),d._area=d._area1+d._area2;i+=d._area;l[e]=i}d=[];for(e=0;e<b;e++)f=THREE.GeometryUtils.random()*i,f=c(f),d[e]=THREE.GeometryUtils.randomPointInFace(g[f],a,!0);return d},triangleArea:function(a,b,c){var d,e=THREE.GeometryUtils.__v1;e.sub(a,b);d=e.length();e.sub(a,c);a=e.length();e.sub(b,c);c=e.length();b=0.5*(d+a+c);return Math.sqrt(b*
 (b-d)*(b-a)*(b-c))},center:function(a){a.computeBoundingBox();var b=a.boundingBox,c=new THREE.Vector3;c.add(b.min,b.max);c.multiplyScalar(-0.5);a.applyMatrix((new THREE.Matrix4).setTranslation(c.x,c.y,c.z));a.computeBoundingBox();return c},normalizeUVs:function(a){for(var a=a.faceVertexUvs[0],b=0,c=a.length;b<c;b++)for(var d=a[b],e=0,g=d.length;e<g;e++)1!==d[e].u&&(d[e].u-=Math.floor(d[e].u)),1!==d[e].v&&(d[e].v-=Math.floor(d[e].v))},triangulateQuads:function(a){for(var b=a.faces.length-1;0<=b;b--){var c=
 (b-d)*(b-a)*(b-c))},center:function(a){a.computeBoundingBox();var b=a.boundingBox,c=new THREE.Vector3;c.add(b.min,b.max);c.multiplyScalar(-0.5);a.applyMatrix((new THREE.Matrix4).setTranslation(c.x,c.y,c.z));a.computeBoundingBox();return c},normalizeUVs:function(a){for(var a=a.faceVertexUvs[0],b=0,c=a.length;b<c;b++)for(var d=a[b],e=0,g=d.length;e<g;e++)1!==d[e].u&&(d[e].u-=Math.floor(d[e].u)),1!==d[e].v&&(d[e].v-=Math.floor(d[e].v))},triangulateQuads:function(a){for(var b=a.faces.length-1;0<=b;b--){var c=
 a.faces[b];if(c instanceof THREE.Face4){var d=c.b,e=c.c,g=c.d,f=new THREE.Face3(c.a,d,g),d=new THREE.Face3(d,e,g);f.materialIndex=d.materialIndex=c.materialIndex;f.color.copy(c.color);d.color.copy(c.color);if(4===c.vertexColors.length){var e=c.vertexColors[1],g=c.vertexColors[2],h=c.vertexColors[3];f.vertexColors[0]=c.vertexColors[0].clone();f.vertexColors[1]=e.clone();f.vertexColors[2]=h.clone();d.vertexColors[0]=e.clone();d.vertexColors[1]=g.clone();d.vertexColors[2]=h.clone()}a.faces.splice(b,
 a.faces[b];if(c instanceof THREE.Face4){var d=c.b,e=c.c,g=c.d,f=new THREE.Face3(c.a,d,g),d=new THREE.Face3(d,e,g);f.materialIndex=d.materialIndex=c.materialIndex;f.color.copy(c.color);d.color.copy(c.color);if(4===c.vertexColors.length){var e=c.vertexColors[1],g=c.vertexColors[2],h=c.vertexColors[3];f.vertexColors[0]=c.vertexColors[0].clone();f.vertexColors[1]=e.clone();f.vertexColors[2]=h.clone();d.vertexColors[0]=e.clone();d.vertexColors[1]=g.clone();d.vertexColors[2]=h.clone()}a.faces.splice(b,
 1,f,d);for(c=0;c<a.faceVertexUvs.length;c++)a.faceVertexUvs[c].length&&(g=a.faceVertexUvs[c][b],f=g[1],d=g[2],e=g[3],g=[g[0].clone(),f.clone(),e.clone()],f=[f.clone(),d.clone(),e.clone()],a.faceVertexUvs[c].splice(b,1,g,f));for(c=0;c<a.faceUvs.length;c++)a.faceUvs[c].length&&(f=a.faceUvs[c][b],a.faceUvs[c].splice(b,1,f,f))}}a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals();a.hasTangents&&a.computeTangents()}};THREE.GeometryUtils.random=THREE.Math.random16;
 1,f,d);for(c=0;c<a.faceVertexUvs.length;c++)a.faceVertexUvs[c].length&&(g=a.faceVertexUvs[c][b],f=g[1],d=g[2],e=g[3],g=[g[0].clone(),f.clone(),e.clone()],f=[f.clone(),d.clone(),e.clone()],a.faceVertexUvs[c].splice(b,1,g,f));for(c=0;c<a.faceUvs.length;c++)a.faceUvs[c].length&&(f=a.faceUvs[c][b],a.faceUvs[c].splice(b,1,f,f))}}a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals();a.hasTangents&&a.computeTangents()}};THREE.GeometryUtils.random=THREE.Math.random16;
 THREE.GeometryUtils.__v1=new THREE.Vector3;
 THREE.GeometryUtils.__v1=new THREE.Vector3;
 THREE.ImageUtils={crossOrigin:"anonymous",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.crossOrigin=this.crossOrigin;d.src=a;return e},loadTextureCube:function(a,b,c){var d,e=[],g=new THREE.Texture(e,b);e.loadCount=0;for(b=0,d=a.length;b<d;++b)e[b]=new Image,e[b].onload=function(){e.loadCount+=1;if(6===e.loadCount)g.needsUpdate=!0;c&&c(this)},e[b].crossOrigin=this.crossOrigin,e[b].src=a[b];return g},getNormalMap:function(a,
 THREE.ImageUtils={crossOrigin:"anonymous",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.crossOrigin=this.crossOrigin;d.src=a;return e},loadTextureCube:function(a,b,c){var d,e=[],g=new THREE.Texture(e,b);e.loadCount=0;for(b=0,d=a.length;b<d;++b)e[b]=new Image,e[b].onload=function(){e.loadCount+=1;if(6===e.loadCount)g.needsUpdate=!0;c&&c(this)},e[b].crossOrigin=this.crossOrigin,e[b].src=a[b];return g},getNormalMap:function(a,
-b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]},b=b|1,d=a.width,e=a.height,g=document.createElement("canvas");g.width=d;g.height=e;var f=g.getContext("2d");f.drawImage(a,0,0);for(var h=f.getImageData(0,0,d,e).data,i=f.createImageData(d,e),k=i.data,l=0;l<d;l++)for(var p=1;p<e;p++){var n=0>p-1?e-1:p-1,o=(p+1)%e,q=0>l-1?d-1:l-1,m=(l+1)%d,r=[],s=[0,0,h[4*(p*d+l)]/255*b];r.push([-1,0,h[4*(p*d+q)]/255*b]);r.push([-1,-1,h[4*(n*d+q)]/255*b]);r.push([0,-1,
-h[4*(n*d+l)]/255*b]);r.push([1,-1,h[4*(n*d+m)]/255*b]);r.push([1,0,h[4*(p*d+m)]/255*b]);r.push([1,1,h[4*(o*d+m)]/255*b]);r.push([0,1,h[4*(o*d+l)]/255*b]);r.push([-1,1,h[4*(o*d+q)]/255*b]);n=[];q=r.length;for(o=0;o<q;o++){var m=r[o],t=r[(o+1)%q],m=[m[0]-s[0],m[1]-s[1],m[2]-s[2]],t=[t[0]-s[0],t[1]-s[1],t[2]-s[2]];n.push(c([m[1]*t[2]-m[2]*t[1],m[2]*t[0]-m[0]*t[2],m[0]*t[1]-m[1]*t[0]]))}r=[0,0,0];for(o=0;o<n.length;o++)r[0]+=n[o][0],r[1]+=n[o][1],r[2]+=n[o][2];r[0]/=n.length;r[1]/=n.length;r[2]/=n.length;
-s=4*(p*d+l);k[s]=255*((r[0]+1)/2)|0;k[s+1]=255*(r[1]+0.5)|0;k[s+2]=255*r[2]|0;k[s+3]=255}f.putImageData(i,0,0);return g},generateDataTexture:function(a,b,c){for(var d=a*b,e=new Uint8Array(3*d),g=Math.floor(255*c.r),f=Math.floor(255*c.g),c=Math.floor(255*c.b),h=0;h<d;h++)e[3*h]=g,e[3*h+1]=f,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
+b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]},b=b|1,d=a.width,e=a.height,g=document.createElement("canvas");g.width=d;g.height=e;var f=g.getContext("2d");f.drawImage(a,0,0);for(var h=f.getImageData(0,0,d,e).data,i=f.createImageData(d,e),l=i.data,k=0;k<d;k++)for(var p=1;p<e;p++){var n=0>p-1?e-1:p-1,o=(p+1)%e,q=0>k-1?d-1:k-1,m=(k+1)%d,r=[],s=[0,0,h[4*(p*d+k)]/255*b];r.push([-1,0,h[4*(p*d+q)]/255*b]);r.push([-1,-1,h[4*(n*d+q)]/255*b]);r.push([0,-1,
+h[4*(n*d+k)]/255*b]);r.push([1,-1,h[4*(n*d+m)]/255*b]);r.push([1,0,h[4*(p*d+m)]/255*b]);r.push([1,1,h[4*(o*d+m)]/255*b]);r.push([0,1,h[4*(o*d+k)]/255*b]);r.push([-1,1,h[4*(o*d+q)]/255*b]);n=[];q=r.length;for(o=0;o<q;o++){var m=r[o],t=r[(o+1)%q],m=[m[0]-s[0],m[1]-s[1],m[2]-s[2]],t=[t[0]-s[0],t[1]-s[1],t[2]-s[2]];n.push(c([m[1]*t[2]-m[2]*t[1],m[2]*t[0]-m[0]*t[2],m[0]*t[1]-m[1]*t[0]]))}r=[0,0,0];for(o=0;o<n.length;o++)r[0]+=n[o][0],r[1]+=n[o][1],r[2]+=n[o][2];r[0]/=n.length;r[1]/=n.length;r[2]/=n.length;
+s=4*(p*d+k);l[s]=255*((r[0]+1)/2)|0;l[s+1]=255*(r[1]+0.5)|0;l[s+2]=255*r[2]|0;l[s+3]=255}f.putImageData(i,0,0);return g},generateDataTexture:function(a,b,c){for(var d=a*b,e=new Uint8Array(3*d),g=Math.floor(255*c.r),f=Math.floor(255*c.g),c=Math.floor(255*c.b),h=0;h<d;h++)e[3*h]=g,e[3*h+1]=f,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
 THREE.SceneUtils={showHierarchy:function(a,b){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=b})},traverseHierarchy:function(a,b){var c,d,e=a.children.length;for(d=0;d<e;d++)c=a.children[d],b(c),THREE.SceneUtils.traverseHierarchy(c,b)},createMultiMaterialObject:function(a,b){var c,d=b.length,e=new THREE.Object3D;for(c=0;c<d;c++){var g=new THREE.Mesh(a,b[c]);e.add(g)}return e},cloneObject:function(a){var b;a instanceof THREE.MorphAnimMesh?(b=new THREE.MorphAnimMesh(a.geometry,a.material),
 THREE.SceneUtils={showHierarchy:function(a,b){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=b})},traverseHierarchy:function(a,b){var c,d,e=a.children.length;for(d=0;d<e;d++)c=a.children[d],b(c),THREE.SceneUtils.traverseHierarchy(c,b)},createMultiMaterialObject:function(a,b){var c,d=b.length,e=new THREE.Object3D;for(c=0;c<d;c++){var g=new THREE.Mesh(a,b[c]);e.add(g)}return e},cloneObject:function(a){var b;a instanceof THREE.MorphAnimMesh?(b=new THREE.MorphAnimMesh(a.geometry,a.material),
 b.duration=a.duration,b.mirroredLoop=a.mirroredLoop,b.time=a.time,b.lastKeyframe=a.lastKeyframe,b.currentKeyframe=a.currentKeyframe,b.direction=a.direction,b.directionBackwards=a.directionBackwards):a instanceof THREE.SkinnedMesh?b=new THREE.SkinnedMesh(a.geometry,a.material):a instanceof THREE.Mesh?b=new THREE.Mesh(a.geometry,a.material):a instanceof THREE.Line?b=new THREE.Line(a.geometry,a.material,a.type):a instanceof THREE.Ribbon?b=new THREE.Ribbon(a.geometry,a.material):a instanceof THREE.ParticleSystem?
 b.duration=a.duration,b.mirroredLoop=a.mirroredLoop,b.time=a.time,b.lastKeyframe=a.lastKeyframe,b.currentKeyframe=a.currentKeyframe,b.direction=a.direction,b.directionBackwards=a.directionBackwards):a instanceof THREE.SkinnedMesh?b=new THREE.SkinnedMesh(a.geometry,a.material):a instanceof THREE.Mesh?b=new THREE.Mesh(a.geometry,a.material):a instanceof THREE.Line?b=new THREE.Line(a.geometry,a.material,a.type):a instanceof THREE.Ribbon?b=new THREE.Ribbon(a.geometry,a.material):a instanceof THREE.ParticleSystem?
 (b=new THREE.ParticleSystem(a.geometry,a.material),b.sortParticles=a.sortParticles):a instanceof THREE.Particle?b=new THREE.Particle(a.material):a instanceof THREE.Sprite?(b=new THREE.Sprite({}),b.color.copy(a.color),b.map=a.map,b.blending=a.blending,b.useScreenCoordinates=a.useScreenCoordinates,b.mergeWith3D=a.mergeWith3D,b.affectedByDistance=a.affectedByDistance,b.scaleByViewport=a.scaleByViewport,b.alignment=a.alignment,b.rotation3d.copy(a.rotation3d),b.rotation=a.rotation,b.opacity=a.opacity,
 (b=new THREE.ParticleSystem(a.geometry,a.material),b.sortParticles=a.sortParticles):a instanceof THREE.Particle?b=new THREE.Particle(a.material):a instanceof THREE.Sprite?(b=new THREE.Sprite({}),b.color.copy(a.color),b.map=a.map,b.blending=a.blending,b.useScreenCoordinates=a.useScreenCoordinates,b.mergeWith3D=a.mergeWith3D,b.affectedByDistance=a.affectedByDistance,b.scaleByViewport=a.scaleByViewport,b.alignment=a.alignment,b.rotation3d.copy(a.rotation3d),b.rotation=a.rotation,b.opacity=a.opacity,
@@ -434,47 +434,47 @@ THREE.Path.prototype.quadraticCurveTo=function(a,b,c,d){var e=Array.prototype.sl
 THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,g){var f=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d),new THREE.Vector2(e,g)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:f})};
 THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,g){var f=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d),new THREE.Vector2(e,g)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:f})};
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);this.curves.push(new THREE.SplineCurve(c));this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);this.curves.push(new THREE.SplineCurve(c));this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};
 THREE.Path.prototype.arc=function(a,b,c,d,e,g){var f=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(a,b,c,d,e,g));this.actions.push({action:THREE.PathActions.ARC,args:f})};THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;c<a;c++)b.push(this.getPoint(c/a));return b};
 THREE.Path.prototype.arc=function(a,b,c,d,e,g){var f=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(a,b,c,d,e,g));this.actions.push({action:THREE.PathActions.ARC,args:f})};THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;c<a;c++)b.push(this.getPoint(c/a));return b};
-THREE.Path.prototype.getPoints=function(a,b){var a=a||12,c=[],d,e,g,f,h,i,k,l,p,n,o,q,m;for(d=0,e=this.actions.length;d<e;d++)switch(g=this.actions[d],f=g.action,g=g.args,f){case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=g[2];i=g[3];p=g[0];n=g[1];0<c.length?(f=c[c.length-1],o=f.x,q=f.y):(f=this.actions[d-1].args,o=f[f.length-2],q=f[f.length-1]);for(f=1;f<=a;f++)m=f/a,g=THREE.Shape.Utils.b2(m,o,p,h),m=THREE.Shape.Utils.b2(m,q,n,
-i),c.push(new THREE.Vector2(g,m));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];i=g[5];p=g[0];n=g[1];k=g[2];l=g[3];0<c.length?(f=c[c.length-1],o=f.x,q=f.y):(f=this.actions[d-1].args,o=f[f.length-2],q=f[f.length-1]);for(f=1;f<=a;f++)m=f/a,g=THREE.Shape.Utils.b3(m,o,p,k,h),m=THREE.Shape.Utils.b3(m,q,n,l,i),c.push(new THREE.Vector2(g,m));break;case THREE.PathActions.CSPLINE_THRU:f=this.actions[d-1].args;f=[new THREE.Vector2(f[f.length-2],f[f.length-1])];m=a*g[0].length;f=f.concat(g[0]);g=new THREE.SplineCurve(f);
-for(f=1;f<=m;f++)c.push(g.getPointAt(f/m));break;case THREE.PathActions.ARC:f=this.actions[d-1].args;h=g[0];i=g[1];k=g[2];p=g[3];m=g[4];n=!!g[5];l=f[f.length-2];o=f[f.length-1];0==f.length&&(l=o=0);q=m-p;var r=2*a;for(f=1;f<=r;f++)m=f/r,n||(m=1-m),m=p+m*q,g=l+h+k*Math.cos(m),m=o+i+k*Math.sin(m),c.push(new THREE.Vector2(g,m))}b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)};
-THREE.Path.prototype.nltransform=function(a,b,c,d,e,g){var f=this.getPoints(),h,i,k,l,p;for(h=0,i=f.length;h<i;h++)k=f[h],l=k.x,p=k.y,k.x=a*l+b*p+c,k.y=d*p+e*l+g;return f};
+THREE.Path.prototype.getPoints=function(a,b){var a=a||12,c=[],d,e,g,f,h,i,l,k,p,n,o,q,m;for(d=0,e=this.actions.length;d<e;d++)switch(g=this.actions[d],f=g.action,g=g.args,f){case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=g[2];i=g[3];p=g[0];n=g[1];0<c.length?(f=c[c.length-1],o=f.x,q=f.y):(f=this.actions[d-1].args,o=f[f.length-2],q=f[f.length-1]);for(f=1;f<=a;f++)m=f/a,g=THREE.Shape.Utils.b2(m,o,p,h),m=THREE.Shape.Utils.b2(m,q,n,
+i),c.push(new THREE.Vector2(g,m));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];i=g[5];p=g[0];n=g[1];l=g[2];k=g[3];0<c.length?(f=c[c.length-1],o=f.x,q=f.y):(f=this.actions[d-1].args,o=f[f.length-2],q=f[f.length-1]);for(f=1;f<=a;f++)m=f/a,g=THREE.Shape.Utils.b3(m,o,p,l,h),m=THREE.Shape.Utils.b3(m,q,n,k,i),c.push(new THREE.Vector2(g,m));break;case THREE.PathActions.CSPLINE_THRU:f=this.actions[d-1].args;f=[new THREE.Vector2(f[f.length-2],f[f.length-1])];m=a*g[0].length;f=f.concat(g[0]);g=new THREE.SplineCurve(f);
+for(f=1;f<=m;f++)c.push(g.getPointAt(f/m));break;case THREE.PathActions.ARC:f=this.actions[d-1].args;h=g[0];i=g[1];l=g[2];p=g[3];m=g[4];n=!!g[5];k=f[f.length-2];o=f[f.length-1];0==f.length&&(k=o=0);q=m-p;var r=2*a;for(f=1;f<=r;f++)m=f/r,n||(m=1-m),m=p+m*q,g=k+h+l*Math.cos(m),m=o+i+l*Math.sin(m),c.push(new THREE.Vector2(g,m))}b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)};
+THREE.Path.prototype.nltransform=function(a,b,c,d,e,g){var f=this.getPoints(),h,i,l,k,p;for(h=0,i=f.length;h<i;h++)l=f[h],k=l.x,p=l.y,l.x=a*k+b*p+c,l.y=d*p+e*k+g;return f};
 THREE.Path.prototype.debug=function(a){var b=this.getBoundingBox();a||(a=document.createElement("canvas"),a.setAttribute("width",b.maxX+100),a.setAttribute("height",b.maxY+100),document.body.appendChild(a));b=a.getContext("2d");b.fillStyle="white";b.fillRect(0,0,a.width,a.height);b.strokeStyle="black";b.beginPath();var c,d,e;for(a=0,c=this.actions.length;a<c;a++)d=this.actions[a],e=d.args,d=d.action,d!=THREE.PathActions.CSPLINE_THRU&&b[d].apply(b,e);b.stroke();b.closePath();b.strokeStyle="red";d=
 THREE.Path.prototype.debug=function(a){var b=this.getBoundingBox();a||(a=document.createElement("canvas"),a.setAttribute("width",b.maxX+100),a.setAttribute("height",b.maxY+100),document.body.appendChild(a));b=a.getContext("2d");b.fillStyle="white";b.fillRect(0,0,a.width,a.height);b.strokeStyle="black";b.beginPath();var c,d,e;for(a=0,c=this.actions.length;a<c;a++)d=this.actions[a],e=d.args,d=d.action,d!=THREE.PathActions.CSPLINE_THRU&&b[d].apply(b,e);b.stroke();b.closePath();b.strokeStyle="red";d=
 this.getPoints();for(a=0,c=d.length;a<c;a++)e=d[a],b.beginPath(),b.arc(e.x,e.y,1.5,0,2*Math.PI,!1),b.stroke(),b.closePath()};
 this.getPoints();for(a=0,c=d.length;a<c;a++)e=d[a],b.beginPath(),b.arc(e.x,e.y,1.5,0,2*Math.PI,!1),b.stroke(),b.closePath()};
 THREE.Path.prototype.toShapes=function(){var a,b,c,d,e=[],g=new THREE.Path;for(a=0,b=this.actions.length;a<b;a++)c=this.actions[a],d=c.args,c=c.action,c==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(e.push(g),g=new THREE.Path),g[c].apply(g,d);0!=g.actions.length&&e.push(g);if(0==e.length)return[];var f;d=[];a=!THREE.Shape.Utils.isClockWise(e[0].getPoints());if(1==e.length)return g=e[0],f=new THREE.Shape,f.actions=g.actions,f.curves=g.curves,d.push(f),d;if(a){f=new THREE.Shape;for(a=0,b=e.length;a<
 THREE.Path.prototype.toShapes=function(){var a,b,c,d,e=[],g=new THREE.Path;for(a=0,b=this.actions.length;a<b;a++)c=this.actions[a],d=c.args,c=c.action,c==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(e.push(g),g=new THREE.Path),g[c].apply(g,d);0!=g.actions.length&&e.push(g);if(0==e.length)return[];var f;d=[];a=!THREE.Shape.Utils.isClockWise(e[0].getPoints());if(1==e.length)return g=e[0],f=new THREE.Shape,f.actions=g.actions,f.curves=g.curves,d.push(f),d;if(a){f=new THREE.Shape;for(a=0,b=e.length;a<
 b;a++)g=e[a],THREE.Shape.Utils.isClockWise(g.getPoints())?(f.actions=g.actions,f.curves=g.curves,d.push(f),f=new THREE.Shape):f.holes.push(g)}else{for(a=0,b=e.length;a<b;a++)g=e[a],THREE.Shape.Utils.isClockWise(g.getPoints())?(f&&d.push(f),f=new THREE.Shape,f.actions=g.actions,f.curves=g.curves):f.holes.push(g);d.push(f)}return d};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;
 b;a++)g=e[a],THREE.Shape.Utils.isClockWise(g.getPoints())?(f.actions=g.actions,f.curves=g.curves,d.push(f),f=new THREE.Shape):f.holes.push(g)}else{for(a=0,b=e.length;a<b;a++)g=e[a],THREE.Shape.Utils.isClockWise(g.getPoints())?(f&&d.push(f),f=new THREE.Shape,f.actions=g.actions,f.curves=g.curves):f.holes.push(g);d.push(f)}return d};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;
 THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={removeHoles:function(a,b){var c=a.concat(),d=c.concat(),e,g,f,h,i,k,l,p,n,o,q=[];for(i=0;i<b.length;i++){k=b[i];Array.prototype.push.apply(d,k);g=Number.POSITIVE_INFINITY;for(e=0;e<k.length;e++){n=k[e];o=[];for(p=0;p<c.length;p++)l=c[p],l=n.distanceToSquared(l),o.push(l),l<g&&(g=l,f=e,h=p)}e=0<=h-1?h-1:c.length-1;g=0<=f-1?f-1:k.length-1;var m=[k[f],c[h],c[e]];p=THREE.FontUtils.Triangulate.area(m);var r=[k[f],k[g],c[h]];n=THREE.FontUtils.Triangulate.area(r);o=h;l=f;h+=1;f+=-1;0>
-h&&(h+=c.length);h%=c.length;0>f&&(f+=k.length);f%=k.length;e=0<=h-1?h-1:c.length-1;g=0<=f-1?f-1:k.length-1;m=[k[f],c[h],c[e]];m=THREE.FontUtils.Triangulate.area(m);r=[k[f],k[g],c[h]];r=THREE.FontUtils.Triangulate.area(r);p+n>m+r&&(h=o,f=l,0>h&&(h+=c.length),h%=c.length,0>f&&(f+=k.length),f%=k.length,e=0<=h-1?h-1:c.length-1,g=0<=f-1?f-1:k.length-1);p=c.slice(0,h);n=c.slice(h);o=k.slice(f);l=k.slice(0,f);g=[k[f],k[g],c[h]];q.push([k[f],c[h],c[e]]);q.push(g);c=p.concat(o).concat(l).concat(n)}return{shape:c,
-isolatedPts:q,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),g,f,h,i,k={};for(g=0,f=d.length;g<f;g++)i=d[g].x+":"+d[g].y,void 0!==k[i]&&console.log("Duplicate point",i),k[i]=g;for(g=0,f=c.length;g<f;g++){h=c[g];for(d=0;3>d;d++)i=h[d].x+":"+h[d].y,i=k[i],void 0!==i&&(h[d]=i)}for(g=0,f=e.length;g<f;g++){h=e[g];for(d=0;3>d;d++)i=h[d].x+":"+h[d].y,i=k[i],void 0!==i&&(h[d]=i)}return c.concat(e)},
+THREE.Shape.Utils={removeHoles:function(a,b){var c=a.concat(),d=c.concat(),e,g,f,h,i,l,k,p,n,o,q=[];for(i=0;i<b.length;i++){l=b[i];Array.prototype.push.apply(d,l);g=Number.POSITIVE_INFINITY;for(e=0;e<l.length;e++){n=l[e];o=[];for(p=0;p<c.length;p++)k=c[p],k=n.distanceToSquared(k),o.push(k),k<g&&(g=k,f=e,h=p)}e=0<=h-1?h-1:c.length-1;g=0<=f-1?f-1:l.length-1;var m=[l[f],c[h],c[e]];p=THREE.FontUtils.Triangulate.area(m);var r=[l[f],l[g],c[h]];n=THREE.FontUtils.Triangulate.area(r);o=h;k=f;h+=1;f+=-1;0>
+h&&(h+=c.length);h%=c.length;0>f&&(f+=l.length);f%=l.length;e=0<=h-1?h-1:c.length-1;g=0<=f-1?f-1:l.length-1;m=[l[f],c[h],c[e]];m=THREE.FontUtils.Triangulate.area(m);r=[l[f],l[g],c[h]];r=THREE.FontUtils.Triangulate.area(r);p+n>m+r&&(h=o,f=k,0>h&&(h+=c.length),h%=c.length,0>f&&(f+=l.length),f%=l.length,e=0<=h-1?h-1:c.length-1,g=0<=f-1?f-1:l.length-1);p=c.slice(0,h);n=c.slice(h);o=l.slice(f);k=l.slice(0,f);g=[l[f],l[g],c[h]];q.push([l[f],c[h],c[e]]);q.push(g);c=p.concat(o).concat(k).concat(n)}return{shape:c,
+isolatedPts:q,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),g,f,h,i,l={};for(g=0,f=d.length;g<f;g++)i=d[g].x+":"+d[g].y,void 0!==l[i]&&console.log("Duplicate point",i),l[i]=g;for(g=0,f=c.length;g<f;g++){h=c[g];for(d=0;3>d;d++)i=h[d].x+":"+h[d].y,i=l[i],void 0!==i&&(h[d]=i)}for(g=0,f=e.length;g<f;g++){h=e[g];for(d=0;3>d;d++)i=h[d].x+":"+h[d].y,i=l[i],void 0!==i&&(h[d]=i)}return c.concat(e)},
 isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+
 isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+
 this.b3p3(a,e)}};THREE.TextPath=function(a,b){THREE.Path.call(this);this.parameters=b||{};this.set(a)};THREE.TextPath.prototype.set=function(a,b){b=b||this.parameters;this.text=a;var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g};
 this.b3p3(a,e)}};THREE.TextPath=function(a,b){THREE.Path.call(this);this.parameters=b||{};this.set(a)};THREE.TextPath.prototype.set=function(a,b){b=b||this.parameters;this.text=a;var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g};
 THREE.TextPath.prototype.toShapes=function(){for(var a=THREE.FontUtils.drawText(this.text).paths,b=[],c=0,d=a.length;c<d;c++)Array.prototype.push.apply(b,a[c].toShapes());return b};
 THREE.TextPath.prototype.toShapes=function(){for(var a=THREE.FontUtils.drawText(this.text).paths,b=[],c=0,d=a.length;c<d;c++)Array.prototype.push.apply(b,a[c].toShapes());return b};
 THREE.AnimationHandler=function(){var a=[],b={},c={update:function(b){for(var c=0;c<a.length;c++)a[c].update(b)},addToUpdate:function(b){-1===a.indexOf(b)&&a.push(b)},removeFromUpdate:function(b){b=a.indexOf(b);-1!==b&&a.splice(b,1)},add:function(a){void 0!==b[a.name]&&console.log("THREE.AnimationHandler.add: Warning! "+a.name+" already exists in library. Overwriting.");b[a.name]=a;if(!0!==a.initialized){for(var c=0;c<a.hierarchy.length;c++){for(var d=0;d<a.hierarchy[c].keys.length;d++){if(0>a.hierarchy[c].keys[d].time)a.hierarchy[c].keys[d].time=
 THREE.AnimationHandler=function(){var a=[],b={},c={update:function(b){for(var c=0;c<a.length;c++)a[c].update(b)},addToUpdate:function(b){-1===a.indexOf(b)&&a.push(b)},removeFromUpdate:function(b){b=a.indexOf(b);-1!==b&&a.splice(b,1)},add:function(a){void 0!==b[a.name]&&console.log("THREE.AnimationHandler.add: Warning! "+a.name+" already exists in library. Overwriting.");b[a.name]=a;if(!0!==a.initialized){for(var c=0;c<a.hierarchy.length;c++){for(var d=0;d<a.hierarchy[c].keys.length;d++){if(0>a.hierarchy[c].keys[d].time)a.hierarchy[c].keys[d].time=
-0;if(void 0!==a.hierarchy[c].keys[d].rot&&!(a.hierarchy[c].keys[d].rot instanceof THREE.Quaternion)){var h=a.hierarchy[c].keys[d].rot;a.hierarchy[c].keys[d].rot=new THREE.Quaternion(h[0],h[1],h[2],h[3])}}if(a.hierarchy[c].keys.length&&void 0!==a.hierarchy[c].keys[0].morphTargets){h={};for(d=0;d<a.hierarchy[c].keys.length;d++)for(var i=0;i<a.hierarchy[c].keys[d].morphTargets.length;i++){var k=a.hierarchy[c].keys[d].morphTargets[i];h[k]=-1}a.hierarchy[c].usedMorphTargets=h;for(d=0;d<a.hierarchy[c].keys.length;d++){var l=
-{};for(k in h){for(i=0;i<a.hierarchy[c].keys[d].morphTargets.length;i++)if(a.hierarchy[c].keys[d].morphTargets[i]===k){l[k]=a.hierarchy[c].keys[d].morphTargetsInfluences[i];break}i===a.hierarchy[c].keys[d].morphTargets.length&&(l[k]=0)}a.hierarchy[c].keys[d].morphTargetsInfluences=l}}for(d=1;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].time===a.hierarchy[c].keys[d-1].time&&(a.hierarchy[c].keys.splice(d,1),d--);for(d=0;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].index=d}d=parseInt(a.length*
+0;if(void 0!==a.hierarchy[c].keys[d].rot&&!(a.hierarchy[c].keys[d].rot instanceof THREE.Quaternion)){var h=a.hierarchy[c].keys[d].rot;a.hierarchy[c].keys[d].rot=new THREE.Quaternion(h[0],h[1],h[2],h[3])}}if(a.hierarchy[c].keys.length&&void 0!==a.hierarchy[c].keys[0].morphTargets){h={};for(d=0;d<a.hierarchy[c].keys.length;d++)for(var i=0;i<a.hierarchy[c].keys[d].morphTargets.length;i++){var l=a.hierarchy[c].keys[d].morphTargets[i];h[l]=-1}a.hierarchy[c].usedMorphTargets=h;for(d=0;d<a.hierarchy[c].keys.length;d++){var k=
+{};for(l in h){for(i=0;i<a.hierarchy[c].keys[d].morphTargets.length;i++)if(a.hierarchy[c].keys[d].morphTargets[i]===l){k[l]=a.hierarchy[c].keys[d].morphTargetsInfluences[i];break}i===a.hierarchy[c].keys[d].morphTargets.length&&(k[l]=0)}a.hierarchy[c].keys[d].morphTargetsInfluences=k}}for(d=1;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].time===a.hierarchy[c].keys[d-1].time&&(a.hierarchy[c].keys.splice(d,1),d--);for(d=0;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].index=d}d=parseInt(a.length*
 a.fps,10);a.JIT={};a.JIT.hierarchy=[];for(c=0;c<a.hierarchy.length;c++)a.JIT.hierarchy.push(Array(d));a.initialized=!0}},get:function(a){if("string"===typeof a){if(b[a])return b[a];console.log("THREE.AnimationHandler.get: Couldn't find animation "+a);return null}},parse:function(a){var b=[];if(a instanceof THREE.SkinnedMesh)for(var c=0;c<a.bones.length;c++)b.push(a.bones[c]);else d(a,b);return b}},d=function(a,b){b.push(a);for(var c=0;c<a.children.length;c++)d(a.children[c],b)};c.LINEAR=0;c.CATMULLROM=
 a.fps,10);a.JIT={};a.JIT.hierarchy=[];for(c=0;c<a.hierarchy.length;c++)a.JIT.hierarchy.push(Array(d));a.initialized=!0}},get:function(a){if("string"===typeof a){if(b[a])return b[a];console.log("THREE.AnimationHandler.get: Couldn't find animation "+a);return null}},parse:function(a){var b=[];if(a instanceof THREE.SkinnedMesh)for(var c=0;c<a.bones.length;c++)b.push(a.bones[c]);else d(a,b);return b}},d=function(a,b){b.push(a);for(var c=0;c<a.children.length;c++)d(a.children[c],b)};c.LINEAR=0;c.CATMULLROM=
 1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(a,b,c,d){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=void 0!==c?c:THREE.AnimationHandler.LINEAR;this.JITCompile=void 0!==d?d:!0;this.points=[];this.target=new THREE.Vector3};
 1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(a,b,c,d){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=void 0!==c?c:THREE.AnimationHandler.LINEAR;this.JITCompile=void 0!==d?d:!0;this.points=[];this.target=new THREE.Vector3};
 THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;var c,d=this.hierarchy.length,e;for(c=0;c<d;c++){e=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)e.useQuaternion=!0;e.matrixAutoUpdate=!0;if(void 0===e.animationCache)e.animationCache={},e.animationCache.prevKey={pos:0,rot:0,scl:0},e.animationCache.nextKey={pos:0,rot:0,scl:0},e.animationCache.originalMatrix=e instanceof
 THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;var c,d=this.hierarchy.length,e;for(c=0;c<d;c++){e=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)e.useQuaternion=!0;e.matrixAutoUpdate=!0;if(void 0===e.animationCache)e.animationCache={},e.animationCache.prevKey={pos:0,rot:0,scl:0},e.animationCache.nextKey={pos:0,rot:0,scl:0},e.animationCache.originalMatrix=e instanceof
 THREE.Bone?e.skinMatrix:e.matrix;var g=e.animationCache.prevKey;e=e.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];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Bone?e.skinMatrix:e.matrix;var g=e.animationCache.prevKey;e=e.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];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(void 0!==this.hierarchy[a].animationCache)this.hierarchy[a]instanceof THREE.Bone?this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix:this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix,delete this.hierarchy[a].animationCache};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(void 0!==this.hierarchy[a].animationCache)this.hierarchy[a]instanceof THREE.Bone?this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix:this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix,delete this.hierarchy[a].animationCache};
-THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,d,e,g,f,h,i,k,l=this.data.JIT.hierarchy,p,n;n=this.currentTime+=a*this.timeScale;p=this.currentTime%=this.data.length;k=parseInt(Math.min(p*this.data.fps,this.data.length*this.data.fps),10);for(var o=0,q=this.hierarchy.length;o<q;o++)if(a=this.hierarchy[o],i=a.animationCache,this.JITCompile&&void 0!==l[o][k])a instanceof THREE.Bone?(a.skinMatrix=l[o][k],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!1):(a.matrix=
-l[o][k],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)a instanceof THREE.Bone?a.skinMatrix=a.animationCache.originalMatrix:a.matrix=a.animationCache.originalMatrix;for(var m=0;3>m;m++){c=b[m];f=i.prevKey[c];h=i.nextKey[c];if(h.time<=n){if(p<n)if(this.loop){f=this.data.hierarchy[o].keys[0];for(h=this.getNextKeyWith(c,o,1);h.time<p;)f=h,h=this.getNextKeyWith(c,o,h.index+1)}else{this.stop();return}else{do f=h,h=this.getNextKeyWith(c,o,h.index+1);while(h.time<p)}i.prevKey[c]=
+THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,d,e,g,f,h,i,l,k=this.data.JIT.hierarchy,p,n;n=this.currentTime+=a*this.timeScale;p=this.currentTime%=this.data.length;l=parseInt(Math.min(p*this.data.fps,this.data.length*this.data.fps),10);for(var o=0,q=this.hierarchy.length;o<q;o++)if(a=this.hierarchy[o],i=a.animationCache,this.JITCompile&&void 0!==k[o][l])a instanceof THREE.Bone?(a.skinMatrix=k[o][l],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!1):(a.matrix=
+k[o][l],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)a instanceof THREE.Bone?a.skinMatrix=a.animationCache.originalMatrix:a.matrix=a.animationCache.originalMatrix;for(var m=0;3>m;m++){c=b[m];f=i.prevKey[c];h=i.nextKey[c];if(h.time<=n){if(p<n)if(this.loop){f=this.data.hierarchy[o].keys[0];for(h=this.getNextKeyWith(c,o,1);h.time<p;)f=h,h=this.getNextKeyWith(c,o,h.index+1)}else{this.stop();return}else{do f=h,h=this.getNextKeyWith(c,o,h.index+1);while(h.time<p)}i.prevKey[c]=
 f;i.nextKey[c]=h}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;d=(p-f.time)/(h.time-f.time);e=f[c];g=h[c];if(0>d||1<d)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+o),d=0>d?0:1;if("pos"===c)if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=e[0]+(g[0]-e[0])*d,c.y=e[1]+(g[1]-e[1])*d,c.z=e[2]+(g[2]-e[2])*d;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
 f;i.nextKey[c]=h}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;d=(p-f.time)/(h.time-f.time);e=f[c];g=h[c];if(0>d||1<d)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+o),d=0>d?0:1;if("pos"===c)if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=e[0]+(g[0]-e[0])*d,c.y=e[1]+(g[1]-e[1])*d,c.z=e[2]+(g[2]-e[2])*d;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
 this.getPrevKeyWith("pos",o,f.index-1).pos,this.points[1]=e,this.points[2]=g,this.points[3]=this.getNextKeyWith("pos",o,h.index+1).pos,d=0.33*d+0.33,e=this.interpolateCatmullRom(this.points,d),c.x=e[0],c.y=e[1],c.z=e[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)d=this.interpolateCatmullRom(this.points,1.01*d),this.target.set(d[0],d[1],d[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),d=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,d,0)}else if("rot"===
 this.getPrevKeyWith("pos",o,f.index-1).pos,this.points[1]=e,this.points[2]=g,this.points[3]=this.getNextKeyWith("pos",o,h.index+1).pos,d=0.33*d+0.33,e=this.interpolateCatmullRom(this.points,d),c.x=e[0],c.y=e[1],c.z=e[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)d=this.interpolateCatmullRom(this.points,1.01*d),this.target.set(d[0],d[1],d[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),d=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,d,0)}else if("rot"===
-c)THREE.Quaternion.slerp(e,g,a.quaternion,d);else if("scl"===c)c=a.scale,c.x=e[0]+(g[0]-e[0])*d,c.y=e[1]+(g[1]-e[1])*d,c.z=e[2]+(g[2]-e[2])*d}}if(this.JITCompile&&void 0===l[0][k]){this.hierarchy[0].updateMatrixWorld(!0);for(o=0;o<this.hierarchy.length;o++)l[o][k]=this.hierarchy[o]instanceof THREE.Bone?this.hierarchy[o].skinMatrix.clone():this.hierarchy[o].matrix.clone()}}};
-THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],e,g,f,h,i,k;e=(a.length-1)*b;g=Math.floor(e);e-=g;c[0]=0===g?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]];h=a[c[1]];i=a[c[2]];k=a[c[3]];c=e*e;f=e*c;d[0]=this.interpolate(g[0],h[0],i[0],k[0],e,c,f);d[1]=this.interpolate(g[1],h[1],i[1],k[1],e,c,f);d[2]=this.interpolate(g[2],h[2],i[2],k[2],e,c,f);return d};
+c)THREE.Quaternion.slerp(e,g,a.quaternion,d);else if("scl"===c)c=a.scale,c.x=e[0]+(g[0]-e[0])*d,c.y=e[1]+(g[1]-e[1])*d,c.z=e[2]+(g[2]-e[2])*d}}if(this.JITCompile&&void 0===k[0][l]){this.hierarchy[0].updateMatrixWorld(!0);for(o=0;o<this.hierarchy.length;o++)k[o][l]=this.hierarchy[o]instanceof THREE.Bone?this.hierarchy[o].skinMatrix.clone():this.hierarchy[o].matrix.clone()}}};
+THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],e,g,f,h,i,l;e=(a.length-1)*b;g=Math.floor(e);e-=g;c[0]=0===g?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]];h=a[c[1]];i=a[c[2]];l=a[c[3]];c=e*e;f=e*c;d[0]=this.interpolate(g[0],h[0],i[0],l[0],e,c,f);d[1]=this.interpolate(g[1],h[1],i[1],l[1],e,c,f);d[2]=this.interpolate(g[2],h[2],i[2],l[2],e,c,f);return d};
 THREE.Animation.prototype.interpolate=function(a,b,c,d,e,g,f){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
 THREE.Animation.prototype.interpolate=function(a,b,c,d,e,g,f){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};
 THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};
-THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.0010;this.isPlaying=!1;this.loop=this.isPaused=!0;this.JITCompile=void 0!==c?c:!0;a=0;for(b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var g=c[e],f=this.getNextKeyWith(g,a,0);f&&f.apply(g)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
+THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.001;this.isPlaying=!1;this.loop=this.isPaused=!0;this.JITCompile=void 0!==c?c:!0;a=0;for(b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var g=c[e],f=this.getNextKeyWith(g,a,0);f&&f.apply(g)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 d.matrixWorldNeedsUpdate=!0}}};
 d.matrixWorldNeedsUpdate=!0}}};
 THREE.KeyFrameAnimation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;this.startTimeMs=b;this.startTime=1E7;this.endTime=-this.startTime;var c,d=this.hierarchy.length,e,g;for(c=0;c<d;c++){e=this.hierarchy[c];g=this.data.hierarchy[c];e.useQuaternion=!0;if(void 0===g.animationCache)g.animationCache={},g.animationCache.prevKey=null,g.animationCache.nextKey=null,g.animationCache.originalMatrix=e instanceof THREE.Bone?e.skinMatrix:
 THREE.KeyFrameAnimation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;this.startTimeMs=b;this.startTime=1E7;this.endTime=-this.startTime;var c,d=this.hierarchy.length,e,g;for(c=0;c<d;c++){e=this.hierarchy[c];g=this.data.hierarchy[c];e.useQuaternion=!0;if(void 0===g.animationCache)g.animationCache={},g.animationCache.prevKey=null,g.animationCache.nextKey=null,g.animationCache.originalMatrix=e instanceof THREE.Bone?e.skinMatrix:
 e.matrix;e=this.data.hierarchy[c].keys;if(e.length)g.animationCache.prevKey=e[0],g.animationCache.nextKey=e[1],this.startTime=Math.min(e[0].time,this.startTime),this.endTime=Math.max(e[e.length-1].time,this.endTime)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};THREE.KeyFrameAnimation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 e.matrix;e=this.data.hierarchy[c].keys;if(e.length)g.animationCache.prevKey=e[0],g.animationCache.nextKey=e[1],this.startTime=Math.min(e[0].time,this.startTime),this.endTime=Math.max(e[e.length-1].time,this.endTime)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};THREE.KeyFrameAnimation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.KeyFrameAnimation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++){var b=this.hierarchy[a];if(void 0!==b.animationCache){var c=b.animationCache.originalMatrix;b instanceof THREE.Bone?(c.copy(b.skinMatrix),b.skinMatrix=c):(c.copy(b.matrix),b.matrix=c);delete b.animationCache}}};
 THREE.KeyFrameAnimation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++){var b=this.hierarchy[a];if(void 0!==b.animationCache){var c=b.animationCache.originalMatrix;b instanceof THREE.Bone?(c.copy(b.skinMatrix),b.skinMatrix=c):(c.copy(b.matrix),b.matrix=c);delete b.animationCache}}};
-THREE.KeyFrameAnimation.prototype.update=function(a){if(this.isPlaying){var b,c,d,e,g=this.data.JIT.hierarchy,f,h,i;h=this.currentTime+=a*this.timeScale;f=this.currentTime%=this.data.length;if(f<this.startTimeMs)f=this.currentTime=this.startTimeMs+f;e=parseInt(Math.min(f*this.data.fps,this.data.length*this.data.fps),10);if((i=f<h)&&!this.loop){for(var a=0,k=this.hierarchy.length;a<k;a++){var l=this.data.hierarchy[a].keys,g=this.data.hierarchy[a].sids;d=l.length-1;e=this.hierarchy[a];if(l.length){for(l=
-0;l<g.length;l++)f=g[l],(h=this.getPrevKeyWith(f,a,d))&&h.apply(f);this.data.hierarchy[a].node.updateMatrix();e.matrixWorldNeedsUpdate=!0}}this.stop()}else if(!(f<this.startTime)){a=0;for(k=this.hierarchy.length;a<k;a++){d=this.hierarchy[a];b=this.data.hierarchy[a];var l=b.keys,p=b.animationCache;if(this.JITCompile&&void 0!==g[a][e])d instanceof THREE.Bone?(d.skinMatrix=g[a][e],d.matrixWorldNeedsUpdate=!1):(d.matrix=g[a][e],d.matrixWorldNeedsUpdate=!0);else if(l.length){if(this.JITCompile&&p)d instanceof
-THREE.Bone?d.skinMatrix=p.originalMatrix:d.matrix=p.originalMatrix;b=p.prevKey;c=p.nextKey;if(b&&c){if(c.time<=h){if(i&&this.loop){b=l[0];for(c=l[1];c.time<f;)b=c,c=l[b.index+1]}else if(!i)for(var n=l.length-1;c.time<f&&c.index!==n;)b=c,c=l[b.index+1];p.prevKey=b;p.nextKey=c}b.interpolate(c,f)}this.data.hierarchy[a].node.updateMatrix();d.matrixWorldNeedsUpdate=!0}}if(this.JITCompile&&void 0===g[0][e]){this.hierarchy[0].updateMatrixWorld(!0);for(a=0;a<this.hierarchy.length;a++)g[a][e]=this.hierarchy[a]instanceof
+THREE.KeyFrameAnimation.prototype.update=function(a){if(this.isPlaying){var b,c,d,e,g=this.data.JIT.hierarchy,f,h,i;h=this.currentTime+=a*this.timeScale;f=this.currentTime%=this.data.length;if(f<this.startTimeMs)f=this.currentTime=this.startTimeMs+f;e=parseInt(Math.min(f*this.data.fps,this.data.length*this.data.fps),10);if((i=f<h)&&!this.loop){for(var a=0,l=this.hierarchy.length;a<l;a++){var k=this.data.hierarchy[a].keys,g=this.data.hierarchy[a].sids;d=k.length-1;e=this.hierarchy[a];if(k.length){for(k=
+0;k<g.length;k++)f=g[k],(h=this.getPrevKeyWith(f,a,d))&&h.apply(f);this.data.hierarchy[a].node.updateMatrix();e.matrixWorldNeedsUpdate=!0}}this.stop()}else if(!(f<this.startTime)){a=0;for(l=this.hierarchy.length;a<l;a++){d=this.hierarchy[a];b=this.data.hierarchy[a];var k=b.keys,p=b.animationCache;if(this.JITCompile&&void 0!==g[a][e])d instanceof THREE.Bone?(d.skinMatrix=g[a][e],d.matrixWorldNeedsUpdate=!1):(d.matrix=g[a][e],d.matrixWorldNeedsUpdate=!0);else if(k.length){if(this.JITCompile&&p)d instanceof
+THREE.Bone?d.skinMatrix=p.originalMatrix:d.matrix=p.originalMatrix;b=p.prevKey;c=p.nextKey;if(b&&c){if(c.time<=h){if(i&&this.loop){b=k[0];for(c=k[1];c.time<f;)b=c,c=k[b.index+1]}else if(!i)for(var n=k.length-1;c.time<f&&c.index!==n;)b=c,c=k[b.index+1];p.prevKey=b;p.nextKey=c}b.interpolate(c,f)}this.data.hierarchy[a].node.updateMatrix();d.matrixWorldNeedsUpdate=!0}}if(this.JITCompile&&void 0===g[0][e]){this.hierarchy[0].updateMatrixWorld(!0);for(a=0;a<this.hierarchy.length;a++)g[a][e]=this.hierarchy[a]instanceof
 THREE.Bone?this.hierarchy[a].skinMatrix.clone():this.hierarchy[a].matrix.clone()}}}};THREE.KeyFrameAnimation.prototype.getNextKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c%=b.length;c<b.length;c++)if(b[c].hasTarget(a))return b[c];return b[0]};THREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};
 THREE.Bone?this.hierarchy[a].skinMatrix.clone():this.hierarchy[a].matrix.clone()}}}};THREE.KeyFrameAnimation.prototype.getNextKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c%=b.length;c<b.length;c++)if(b[c].hasTarget(a))return b[c];return b[0]};THREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};
 THREE.CubeCamera=function(a,b,c,d){this.heightOffset=c;this.position=new THREE.Vector3(0,c,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position=
 THREE.CubeCamera=function(a,b,c,d){this.heightOffset=c;this.position=new THREE.Vector3(0,c,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position=
 this.position;this.cameraNY.position=this.position;this.cameraPZ.position=this.position;this.cameraNZ.position=this.position;this.cameraPX.up.set(0,-1,0);this.cameraNX.up.set(0,-1,0);this.cameraPY.up.set(0,0,1);this.cameraNY.up.set(0,0,-1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.targetPX=new THREE.Vector3(0,0,0);this.targetNX=new THREE.Vector3(0,0,0);this.targetPY=new THREE.Vector3(0,0,0);this.targetNY=new THREE.Vector3(0,0,0);this.targetPZ=new THREE.Vector3(0,0,0);this.targetNZ=
 this.position;this.cameraNY.position=this.position;this.cameraPZ.position=this.position;this.cameraNZ.position=this.position;this.cameraPX.up.set(0,-1,0);this.cameraNX.up.set(0,-1,0);this.cameraPY.up.set(0,0,1);this.cameraNY.up.set(0,0,-1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.targetPX=new THREE.Vector3(0,0,0);this.targetNX=new THREE.Vector3(0,0,0);this.targetPY=new THREE.Vector3(0,0,0);this.targetNY=new THREE.Vector3(0,0,0);this.targetPZ=new THREE.Vector3(0,0,0);this.targetNZ=
@@ -486,7 +486,7 @@ THREE.CombinedCamera.prototype.toOrthographic=function(){var a=this.cameraP.aspe
 THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.setLens=function(a,b){var c=2*Math.atan((void 0!==b?b:24)/(2*a))*(180/Math.PI);this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};
 THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.setLens=function(a,b){var c=2*Math.atan((void 0!==b?b:24)/(2*a))*(180/Math.PI);this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};
 THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
-THREE.FirstPersonControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.target=new THREE.Vector3(0,0,0);this.domElement=void 0!==b?b:document;this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=
+THREE.FirstPersonControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.target=new THREE.Vector3(0,0,0);this.domElement=void 0!==b?b:document;this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=
 0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=
 0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=
 !0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown=
 !0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown=
 function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=
 function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=
@@ -496,14 +496,14 @@ this.moveUp&&this.object.translateY(b);this.moveDown&&this.object.translateY(-b)
 this.object.lookAt(b)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};
 this.object.lookAt(b)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};
 THREE.PathControls=function(a,b){function c(a){return 1>(a*=2)?0.5*a*a:-0.5*(--a*(a-2)-1)}function d(a,b){return function(){b.apply(a,arguments)}}function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},g,f=b.getControlPointsArray(),h=b.getLength(),r=f.length,s=0;g=r-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:f[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[g]={time:d,pos:f[g],rot:[0,0,0,1],scl:[1,1,1]};for(g=1;g<r-1;g++)s=d*h.chunks[g]/h.total,b.keys[g]={time:s,pos:f[g]};e.hierarchy[0]=b;THREE.AnimationHandler.add(e);
 THREE.PathControls=function(a,b){function c(a){return 1>(a*=2)?0.5*a*a:-0.5*(--a*(a-2)-1)}function d(a,b){return function(){b.apply(a,arguments)}}function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},g,f=b.getControlPointsArray(),h=b.getLength(),r=f.length,s=0;g=r-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:f[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[g]={time:d,pos:f[g],rot:[0,0,0,1],scl:[1,1,1]};for(g=1;g<r-1;g++)s=d*h.chunks[g]/h.total,b.keys[g]={time:s,pos:f[g]};e.hierarchy[0]=b;THREE.AnimationHandler.add(e);
 return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function g(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b;c++)d=c/(a.points.length*b),d=a.getPoint(d),e.vertices[c]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return e}this.object=a;this.domElement=void 0!==b?b:document;this.id="PathControls"+THREE.PathControlsIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=
 return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function g(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b;c++)d=c/(a.points.length*b),d=a.getPoint(d),e.vertices[c]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return e}this.object=a;this.domElement=void 0!==b?b:document;this.id="PathControls"+THREE.PathControlsIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=
-new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookHorizontal=this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/
+new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/
 2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var f=2*Math.PI,h=Math.PI/180;this.update=function(a){var b;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed*a);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed*a);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;a=this.phi%f;this.phi=0<=a?a:a+f;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange;
 2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var f=2*Math.PI,h=Math.PI/180;this.update=function(a){var b;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed*a);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed*a);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;a=this.phi%f;this.phi=0<=a?a:a+f;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange;
 b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var d=a[1]-a[0];this.phi=c((b-a[0])/d)*d+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);d=a[1]-a[0];this.theta=c((b-a[0])/d)*d+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(a){this.domElement===
 b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var d=a[1]-a[0];this.phi=c((b-a[0])/d)*d+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);d=a[1]-a[0];this.theta=c((b-a[0])/d)*d+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(a){this.domElement===
 document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),b=new THREE.MeshLambertMaterial({color:65280}),
 document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),b=new THREE.MeshLambertMaterial({color:65280}),
 c=new THREE.CubeGeometry(10,10,20),f=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,a);a=new THREE.Mesh(f,b);a.position.set(0,10,0);this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=e(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a=
 c=new THREE.CubeGeometry(10,10,20),f=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,a);a=new THREE.Mesh(f,b);a.position.set(0,10,0);this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=e(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a=
 this.debugPath,b=this.spline,f=g(b,10),c=g(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3}),f=new THREE.Line(f,h),c=new THREE.ParticleSystem(c,new THREE.ParticleBasicMaterial({color:16755200,size:3}));f.scale.set(1,1,1);a.add(f);c.scale.set(1,1,1);a.add(c);for(var f=new THREE.SphereGeometry(1,16,8),h=new THREE.MeshBasicMaterial({color:65280}),o=0;o<b.points.length;o++)c=new THREE.Mesh(f,h),c.position.copy(b.points[o]),a.add(c)}this.domElement.addEventListener("mousemove",d(this,this.onMouseMove),
 this.debugPath,b=this.spline,f=g(b,10),c=g(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3}),f=new THREE.Line(f,h),c=new THREE.ParticleSystem(c,new THREE.ParticleBasicMaterial({color:16755200,size:3}));f.scale.set(1,1,1);a.add(f);c.scale.set(1,1,1);a.add(c);for(var f=new THREE.SphereGeometry(1,16,8),h=new THREE.MeshBasicMaterial({color:65280}),o=0;o<b.points.length;o++)c=new THREE.Mesh(f,h),c.position.copy(b.points[o]),a.add(c)}this.domElement.addEventListener("mousemove",d(this,this.onMouseMove),
 !1)}};THREE.PathControlsIdCounter=0;
 !1)}};THREE.PathControlsIdCounter=0;
-THREE.FlyControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.domElement=void 0!==b?b:document;b&&this.domElement.setAttribute("tabindex",-1);this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.object.useQuaternion=!0;this.tmpQuaternion=new THREE.Quaternion;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,
+THREE.FlyControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.domElement=void 0!==b?b:document;b&&this.domElement.setAttribute("tabindex",-1);this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.object.useQuaternion=!0;this.tmpQuaternion=new THREE.Quaternion;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,
 0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.handleEvent=function(a){if("function"==typeof this[a.type])this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=
 0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.handleEvent=function(a){if("function"==typeof this[a.type])this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=
 1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=
 1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=
 0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(a.button){case 0:this.object.moveForward=
 0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(a.button){case 0:this.object.moveForward=
@@ -512,65 +512,65 @@ THREE.FlyControls=function(a,b){function c(a,b){return function(){b.apply(a,argu
 this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=
 this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=
 -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,
 -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,
 this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};
 this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};
-THREE.RollControls=function(a,b){this.object=a;this.domElement=void 0!==b?b:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Matrix4,f=!1,h=1,i=0,k=0,l=0,p=0,n=0,o=window.innerWidth/2,q=window.innerHeight/2;this.update=function(a){if(this.mouseLook){var b=a*this.lookSpeed;
-this.rotateHorizontally(b*p);this.rotateVertically(b*n)}b=a*this.movementSpeed;this.object.translateZ(-b*(0<i||this.autoForward&&!(0>i)?1:i));this.object.translateX(b*k);this.object.translateY(b*l);f&&(this.roll+=this.rollSpeed*a*h);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();e.copy(this.forward);d.set(0,1,0);c.cross(d,
+THREE.RollControls=function(a,b){this.object=a;this.domElement=void 0!==b?b:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Matrix4,f=!1,h=1,i=0,l=0,k=0,p=0,n=0,o=window.innerWidth/2,q=window.innerHeight/2;this.update=function(a){if(this.mouseLook){var b=a*this.lookSpeed;
+this.rotateHorizontally(b*p);this.rotateVertically(b*n)}b=a*this.movementSpeed;this.object.translateZ(-b*(0<i||this.autoForward&&!(0>i)?1:i));this.object.translateX(b*l);this.object.translateY(b*k);f&&(this.roll+=this.rollSpeed*a*h);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();e.copy(this.forward);d.set(0,1,0);c.cross(d,
 e).normalize();d.cross(e,c).normalize();this.object.matrix.n11=c.x;this.object.matrix.n12=d.x;this.object.matrix.n13=e.x;this.object.matrix.n21=c.y;this.object.matrix.n22=d.y;this.object.matrix.n23=e.y;this.object.matrix.n31=c.z;this.object.matrix.n32=d.z;this.object.matrix.n33=e.z;g.identity();g.n11=Math.cos(this.roll);g.n12=-Math.sin(this.roll);g.n21=Math.sin(this.roll);g.n22=Math.cos(this.roll);this.object.matrix.multiplySelf(g);this.object.matrixWorldNeedsUpdate=!0;this.object.matrix.n14=this.object.position.x;
 e).normalize();d.cross(e,c).normalize();this.object.matrix.n11=c.x;this.object.matrix.n12=d.x;this.object.matrix.n13=e.x;this.object.matrix.n21=c.y;this.object.matrix.n22=d.y;this.object.matrix.n23=e.y;this.object.matrix.n31=c.z;this.object.matrix.n32=d.z;this.object.matrix.n33=e.z;g.identity();g.n11=Math.cos(this.roll);g.n12=-Math.sin(this.roll);g.n21=Math.sin(this.roll);g.n22=Math.cos(this.roll);this.object.matrix.multiplySelf(g);this.object.matrixWorldNeedsUpdate=!0;this.object.matrix.n14=this.object.position.x;
 this.object.matrix.n24=this.object.position.y;this.object.matrix.n34=this.object.position.z};this.translateX=function(a){this.object.position.x+=this.object.matrix.n11*a;this.object.position.y+=this.object.matrix.n21*a;this.object.position.z+=this.object.matrix.n31*a};this.translateY=function(a){this.object.position.x+=this.object.matrix.n12*a;this.object.position.y+=this.object.matrix.n22*a;this.object.position.z+=this.object.matrix.n32*a};this.translateZ=function(a){this.object.position.x-=this.object.matrix.n13*
 this.object.matrix.n24=this.object.position.y;this.object.matrix.n34=this.object.position.z};this.translateX=function(a){this.object.position.x+=this.object.matrix.n11*a;this.object.position.y+=this.object.matrix.n21*a;this.object.position.z+=this.object.matrix.n31*a};this.translateY=function(a){this.object.position.x+=this.object.matrix.n12*a;this.object.position.y+=this.object.matrix.n22*a;this.object.position.z+=this.object.matrix.n32*a};this.translateZ=function(a){this.object.position.x-=this.object.matrix.n13*
 a;this.object.position.y-=this.object.matrix.n23*a;this.object.position.z-=this.object.matrix.n33*a};this.rotateHorizontally=function(a){c.set(this.object.matrix.n11,this.object.matrix.n21,this.object.matrix.n31);c.multiplyScalar(a);this.forward.subSelf(c);this.forward.normalize()};this.rotateVertically=function(a){d.set(this.object.matrix.n12,this.object.matrix.n22,this.object.matrix.n32);d.multiplyScalar(a);this.forward.addSelf(d);this.forward.normalize()};this.domElement.addEventListener("contextmenu",
 a;this.object.position.y-=this.object.matrix.n23*a;this.object.position.z-=this.object.matrix.n33*a};this.rotateHorizontally=function(a){c.set(this.object.matrix.n11,this.object.matrix.n21,this.object.matrix.n31);c.multiplyScalar(a);this.forward.subSelf(c);this.forward.normalize()};this.rotateVertically=function(a){d.set(this.object.matrix.n12,this.object.matrix.n22,this.object.matrix.n32);d.multiplyScalar(a);this.forward.addSelf(d);this.forward.normalize()};this.domElement.addEventListener("contextmenu",
 function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",function(a){p=(a.clientX-o)/window.innerWidth;n=(a.clientY-q)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:i=1;break;case 2:i=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:i=0;break;case 2:i=0}},!1);this.domElement.addEventListener("keydown",
 function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",function(a){p=(a.clientX-o)/window.innerWidth;n=(a.clientY-q)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:i=1;break;case 2:i=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:i=0;break;case 2:i=0}},!1);this.domElement.addEventListener("keydown",
-function(a){switch(a.keyCode){case 38:case 87:i=1;break;case 37:case 65:k=-1;break;case 40:case 83:i=-1;break;case 39:case 68:k=1;break;case 81:f=!0;h=1;break;case 69:f=!0;h=-1;break;case 82:l=1;break;case 70:l=-1}},!1);this.domElement.addEventListener("keyup",function(a){switch(a.keyCode){case 38:case 87:i=0;break;case 37:case 65:k=0;break;case 40:case 83:i=0;break;case 39:case 68:k=0;break;case 81:f=!1;break;case 69:f=!1;break;case 82:l=0;break;case 70:l=0}},!1)};
+function(a){switch(a.keyCode){case 38:case 87:i=1;break;case 37:case 65:l=-1;break;case 40:case 83:i=-1;break;case 39:case 68:l=1;break;case 81:f=!0;h=1;break;case 69:f=!0;h=-1;break;case 82:k=1;break;case 70:k=-1}},!1);this.domElement.addEventListener("keyup",function(a){switch(a.keyCode){case 38:case 87:i=0;break;case 37:case 65:l=0;break;case 40:case 83:i=0;break;case 39:case 68:l=0;break;case 81:f=!1;break;case 69:f=!1;break;case 82:k=0;break;case 70:k=0}},!1)};
 THREE.TrackballControls=function(a,b){var c=this;this.object=a;this.domElement=void 0!==b?b:document;this.enabled=!0;this.screen={width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=(this.screen.width+this.screen.height)/4;this.rotateSpeed=1;this.zoomSpeed=1.2;this.panSpeed=0.3;this.staticMoving=this.noPan=this.noZoom=this.noRotate=!1;this.dynamicDampingFactor=0.2;this.minDistance=0;this.maxDistance=Infinity;this.keys=[65,83,68];this.target=new THREE.Vector3(0,
 THREE.TrackballControls=function(a,b){var c=this;this.object=a;this.domElement=void 0!==b?b:document;this.enabled=!0;this.screen={width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=(this.screen.width+this.screen.height)/4;this.rotateSpeed=1;this.zoomSpeed=1.2;this.panSpeed=0.3;this.staticMoving=this.noPan=this.noZoom=this.noRotate=!1;this.dynamicDampingFactor=0.2;this.minDistance=0;this.maxDistance=Infinity;this.keys=[65,83,68];this.target=new THREE.Vector3(0,
-0,0);var d=!1,e=-1,g=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,i=new THREE.Vector2,k=new THREE.Vector2,l=new THREE.Vector2,p=new THREE.Vector2;this.handleEvent=function(a){if("function"==typeof this[a.type])this[a.type](a)};this.getMouseOnScreen=function(a,b){return new THREE.Vector2(0.5*((a-c.screen.offsetLeft)/c.radius),0.5*((b-c.screen.offsetTop)/c.radius))};this.getMouseProjectionOnBall=function(a,b){var d=new THREE.Vector3((a-0.5*c.screen.width-c.screen.offsetLeft)/c.radius,(0.5*
+0,0);var d=!1,e=-1,g=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,i=new THREE.Vector2,l=new THREE.Vector2,k=new THREE.Vector2,p=new THREE.Vector2;this.handleEvent=function(a){if("function"==typeof this[a.type])this[a.type](a)};this.getMouseOnScreen=function(a,b){return new THREE.Vector2(0.5*((a-c.screen.offsetLeft)/c.radius),0.5*((b-c.screen.offsetTop)/c.radius))};this.getMouseProjectionOnBall=function(a,b){var d=new THREE.Vector3((a-0.5*c.screen.width-c.screen.offsetLeft)/c.radius,(0.5*
 c.screen.height+c.screen.offsetTop-b)/c.radius,0),e=d.length();1<e?d.normalize():d.z=Math.sqrt(1-e*e);g.copy(c.object.position).subSelf(c.target);e=c.object.up.clone().setLength(d.y);e.addSelf(c.object.up.clone().crossSelf(g).setLength(d.x));e.addSelf(g.setLength(d.z));return e};this.rotateCamera=function(){var a=Math.acos(f.dot(h)/f.length()/h.length());if(a){var b=(new THREE.Vector3).cross(f,h).normalize(),d=new THREE.Quaternion,a=a*c.rotateSpeed;d.setFromAxisAngle(b,-a);d.multiplyVector3(g);d.multiplyVector3(c.object.up);
 c.screen.height+c.screen.offsetTop-b)/c.radius,0),e=d.length();1<e?d.normalize():d.z=Math.sqrt(1-e*e);g.copy(c.object.position).subSelf(c.target);e=c.object.up.clone().setLength(d.y);e.addSelf(c.object.up.clone().crossSelf(g).setLength(d.x));e.addSelf(g.setLength(d.z));return e};this.rotateCamera=function(){var a=Math.acos(f.dot(h)/f.length()/h.length());if(a){var b=(new THREE.Vector3).cross(f,h).normalize(),d=new THREE.Quaternion,a=a*c.rotateSpeed;d.setFromAxisAngle(b,-a);d.multiplyVector3(g);d.multiplyVector3(c.object.up);
-d.multiplyVector3(h);c.staticMoving?f=h:(d.setFromAxisAngle(b,a*(c.dynamicDampingFactor-1)),d.multiplyVector3(f))}};this.zoomCamera=function(){var a=1+(k.y-i.y)*c.zoomSpeed;1!==a&&0<a&&(g.multiplyScalar(a),c.staticMoving?i=k:i.y+=(k.y-i.y)*this.dynamicDampingFactor)};this.panCamera=function(){var a=p.clone().subSelf(l);if(a.lengthSq()){a.multiplyScalar(g.length()*c.panSpeed);var b=g.clone().crossSelf(c.object.up).setLength(a.x);b.addSelf(c.object.up.clone().setLength(a.y));c.object.position.addSelf(b);
-c.target.addSelf(b);c.staticMoving?l=p:l.addSelf(a.sub(p,l).multiplyScalar(c.dynamicDampingFactor))}};this.checkDistances=function(){if(!c.noZoom||!c.noPan)c.object.position.lengthSq()>c.maxDistance*c.maxDistance&&c.object.position.setLength(c.maxDistance),g.lengthSq()<c.minDistance*c.minDistance&&c.object.position.add(c.target,g.setLength(c.minDistance))};this.update=function(){g.copy(c.object.position).subSelf(this.target);c.noRotate||c.rotateCamera();c.noZoom||c.zoomCamera();c.noPan||c.panCamera();
-c.object.position.add(c.target,g);c.checkDistances();c.object.lookAt(c.target)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",function(a){c.enabled&&(d&&(f=h=c.getMouseProjectionOnBall(a.clientX,a.clientY),i=k=c.getMouseOnScreen(a.clientX,a.clientY),l=p=c.getMouseOnScreen(a.clientX,a.clientY),d=!1),-1!==e&&(0===e&&!c.noRotate?h=c.getMouseProjectionOnBall(a.clientX,a.clientY):1===e&&!c.noZoom?k=c.getMouseOnScreen(a.clientX,
-a.clientY):2===e&&!c.noPan&&(p=c.getMouseOnScreen(a.clientX,a.clientY))))},!1);this.domElement.addEventListener("mousedown",function(a){if(c.enabled&&(a.preventDefault(),a.stopPropagation(),-1===e))e=a.button,0===e&&!c.noRotate?f=h=c.getMouseProjectionOnBall(a.clientX,a.clientY):1===e&&!c.noZoom?i=k=c.getMouseOnScreen(a.clientX,a.clientY):this.noPan||(l=p=c.getMouseOnScreen(a.clientX,a.clientY))},!1);this.domElement.addEventListener("mouseup",function(a){c.enabled&&(a.preventDefault(),a.stopPropagation(),
+d.multiplyVector3(h);c.staticMoving?f=h:(d.setFromAxisAngle(b,a*(c.dynamicDampingFactor-1)),d.multiplyVector3(f))}};this.zoomCamera=function(){var a=1+(l.y-i.y)*c.zoomSpeed;1!==a&&0<a&&(g.multiplyScalar(a),c.staticMoving?i=l:i.y+=(l.y-i.y)*this.dynamicDampingFactor)};this.panCamera=function(){var a=p.clone().subSelf(k);if(a.lengthSq()){a.multiplyScalar(g.length()*c.panSpeed);var b=g.clone().crossSelf(c.object.up).setLength(a.x);b.addSelf(c.object.up.clone().setLength(a.y));c.object.position.addSelf(b);
+c.target.addSelf(b);c.staticMoving?k=p:k.addSelf(a.sub(p,k).multiplyScalar(c.dynamicDampingFactor))}};this.checkDistances=function(){if(!c.noZoom||!c.noPan)c.object.position.lengthSq()>c.maxDistance*c.maxDistance&&c.object.position.setLength(c.maxDistance),g.lengthSq()<c.minDistance*c.minDistance&&c.object.position.add(c.target,g.setLength(c.minDistance))};this.update=function(){g.copy(c.object.position).subSelf(this.target);c.noRotate||c.rotateCamera();c.noZoom||c.zoomCamera();c.noPan||c.panCamera();
+c.object.position.add(c.target,g);c.checkDistances();c.object.lookAt(c.target)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",function(a){c.enabled&&(d&&(f=h=c.getMouseProjectionOnBall(a.clientX,a.clientY),i=l=c.getMouseOnScreen(a.clientX,a.clientY),k=p=c.getMouseOnScreen(a.clientX,a.clientY),d=!1),-1!==e&&(0===e&&!c.noRotate?h=c.getMouseProjectionOnBall(a.clientX,a.clientY):1===e&&!c.noZoom?l=c.getMouseOnScreen(a.clientX,
+a.clientY):2===e&&!c.noPan&&(p=c.getMouseOnScreen(a.clientX,a.clientY))))},!1);this.domElement.addEventListener("mousedown",function(a){if(c.enabled&&(a.preventDefault(),a.stopPropagation(),-1===e))e=a.button,0===e&&!c.noRotate?f=h=c.getMouseProjectionOnBall(a.clientX,a.clientY):1===e&&!c.noZoom?i=l=c.getMouseOnScreen(a.clientX,a.clientY):this.noPan||(k=p=c.getMouseOnScreen(a.clientX,a.clientY))},!1);this.domElement.addEventListener("mouseup",function(a){c.enabled&&(a.preventDefault(),a.stopPropagation(),
 e=-1)},!1);window.addEventListener("keydown",function(a){c.enabled&&-1===e&&(a.keyCode===c.keys[0]&&!c.noRotate?e=0:a.keyCode===c.keys[1]&&!c.noZoom?e=1:a.keyCode===c.keys[2]&&!c.noPan&&(e=2),-1!==e&&(d=!0))},!1);window.addEventListener("keyup",function(){c.enabled&&-1!==e&&(e=-1)},!1)};
 e=-1)},!1);window.addEventListener("keydown",function(a){c.enabled&&-1===e&&(a.keyCode===c.keys[0]&&!c.noRotate?e=0:a.keyCode===c.keys[1]&&!c.noZoom?e=1:a.keyCode===c.keys[2]&&!c.noPan&&(e=2),-1!==e&&(d=!0))},!1);window.addEventListener("keyup",function(){c.enabled&&-1!==e&&(e=-1)},!1)};
-THREE.CubeGeometry=function(a,b,c,d,e,g,f,h){function i(a,b,c,f,h,i,m,l){var n,o=d||1,p=e||1,q=h/2,r=i/2,s=k.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)n="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)n="y",p=g||1;else if("z"===a&&"y"===b||"y"===a&&"z"===b)n="x",o=g||1;var j=o+1,t=p+1,w=h/o,F=i/p,Z=new THREE.Vector3;Z[n]=0<m?1:-1;for(h=0;h<t;h++)for(i=0;i<j;i++){var O=new THREE.Vector3;O[a]=(i*w-q)*c;O[b]=(h*F-r)*f;O[n]=m;k.vertices.push(new THREE.Vertex(O))}for(h=0;h<p;h++)for(i=0;i<o;i++)a=
-new THREE.Face4(i+j*h+s,i+j*(h+1)+s,i+1+j*(h+1)+s,i+1+j*h+s),a.normal.copy(Z),a.vertexNormals.push(Z.clone(),Z.clone(),Z.clone(),Z.clone()),a.materialIndex=l,k.faces.push(a),k.faceVertexUvs[0].push([new THREE.UV(i/o,h/p),new THREE.UV(i/o,(h+1)/p),new THREE.UV((i+1)/o,(h+1)/p),new THREE.UV((i+1)/o,h/p)])}THREE.Geometry.call(this);var k=this,l=a/2,p=b/2,n=c/2,o,q,m,r,s,t;if(void 0!==f){if(f instanceof Array)this.materials=f;else{this.materials=[];for(o=0;6>o;o++)this.materials.push(f)}o=0;r=1;q=2;s=
-3;m=4;t=5}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(void 0!=h)for(var w in h)void 0!==this.sides[w]&&(this.sides[w]=h[w]);this.sides.px&&i("z","y",-1,-1,c,b,l,o);this.sides.nx&&i("z","y",1,-1,c,b,-l,r);this.sides.py&&i("x","z",1,1,a,c,p,q);this.sides.ny&&i("x","z",1,-1,a,c,-p,s);this.sides.pz&&i("x","y",1,-1,a,b,n,m);this.sides.nz&&i("x","y",-1,-1,a,b,-n,t);this.computeCentroids();this.mergeVertices()};THREE.CubeGeometry.prototype=new THREE.Geometry;
+THREE.CubeGeometry=function(a,b,c,d,e,g,f,h){function i(a,b,c,f,h,i,k,m){var n,o=d||1,p=e||1,q=h/2,r=i/2,s=l.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)n="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)n="y",p=g||1;else if("z"===a&&"y"===b||"y"===a&&"z"===b)n="x",o=g||1;var j=o+1,t=p+1,w=h/o,E=i/p,Y=new THREE.Vector3;Y[n]=0<k?1:-1;for(h=0;h<t;h++)for(i=0;i<j;i++){var O=new THREE.Vector3;O[a]=(i*w-q)*c;O[b]=(h*E-r)*f;O[n]=k;l.vertices.push(new THREE.Vertex(O))}for(h=0;h<p;h++)for(i=0;i<o;i++)a=
+new THREE.Face4(i+j*h+s,i+j*(h+1)+s,i+1+j*(h+1)+s,i+1+j*h+s),a.normal.copy(Y),a.vertexNormals.push(Y.clone(),Y.clone(),Y.clone(),Y.clone()),a.materialIndex=m,l.faces.push(a),l.faceVertexUvs[0].push([new THREE.UV(i/o,h/p),new THREE.UV(i/o,(h+1)/p),new THREE.UV((i+1)/o,(h+1)/p),new THREE.UV((i+1)/o,h/p)])}THREE.Geometry.call(this);var l=this,k=a/2,p=b/2,n=c/2,o,q,m,r,s,t;if(void 0!==f){if(f instanceof Array)this.materials=f;else{this.materials=[];for(o=0;6>o;o++)this.materials.push(f)}o=0;r=1;q=2;s=
+3;m=4;t=5}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(void 0!=h)for(var w in h)void 0!==this.sides[w]&&(this.sides[w]=h[w]);this.sides.px&&i("z","y",-1,-1,c,b,k,o);this.sides.nx&&i("z","y",1,-1,c,b,-k,r);this.sides.py&&i("x","z",1,1,a,c,p,q);this.sides.ny&&i("x","z",1,-1,a,c,-p,s);this.sides.pz&&i("x","y",1,-1,a,b,n,m);this.sides.nz&&i("x","y",-1,-1,a,b,-n,t);this.computeCentroids();this.mergeVertices()};THREE.CubeGeometry.prototype=new THREE.Geometry;
 THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
 THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
-THREE.CylinderGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);var a=void 0!==a?a:20,b=void 0!==b?b:20,c=void 0!==c?c:100,f=c/2,d=d||8,e=e||1,h,i,k=[],l=[];for(i=0;i<=e;i++){var p=[],n=[],o=i/e,q=o*(b-a)+a;for(h=0;h<=d;h++){var m=h/d,r=q*Math.sin(2*m*Math.PI),s=-o*c+f,t=q*Math.cos(2*m*Math.PI);this.vertices.push(new THREE.Vertex(new THREE.Vector3(r,s,t)));p.push(this.vertices.length-1);n.push(new THREE.UV(m,o))}k.push(p);l.push(n)}for(i=0;i<e;i++)for(h=0;h<d;h++){var c=k[i][h],p=k[i+1][h],
-n=k[i+1][h+1],o=k[i][h+1],q=this.vertices[c].position.clone().setY(0).normalize(),m=this.vertices[p].position.clone().setY(0).normalize(),r=this.vertices[n].position.clone().setY(0).normalize(),s=this.vertices[o].position.clone().setY(0).normalize(),t=l[i][h].clone(),w=l[i+1][h].clone(),u=l[i+1][h+1].clone(),v=l[i][h+1].clone();this.faces.push(new THREE.Face4(c,p,n,o,[q,m,r,s]));this.faceVertexUvs[0].push([t,w,u,v])}if(!g&&0<a){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,f,0)));for(h=
-0;h<d;h++)c=k[0][h],p=k[0][h+1],n=this.vertices.length-1,q=new THREE.Vector3(0,1,0),m=new THREE.Vector3(0,1,0),r=new THREE.Vector3(0,1,0),t=l[0][h].clone(),w=l[0][h+1].clone(),u=new THREE.UV(w.u,0),this.faces.push(new THREE.Face3(c,p,n,[q,m,r])),this.faceVertexUvs[0].push([t,w,u])}if(!g&&0<b){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-f,0)));for(h=0;h<d;h++)c=k[i][h+1],p=k[i][h],n=this.vertices.length-1,q=new THREE.Vector3(0,-1,0),m=new THREE.Vector3(0,-1,0),r=new THREE.Vector3(0,-1,
-0),t=l[i][h+1].clone(),w=l[i][h].clone(),u=new THREE.UV(w.u,1),this.faces.push(new THREE.Face3(c,p,n,[q,m,r])),this.faceVertexUvs[0].push([t,w,u])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
+THREE.CylinderGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);var a=void 0!==a?a:20,b=void 0!==b?b:20,c=void 0!==c?c:100,f=c/2,d=d||8,e=e||1,h,i,l=[],k=[];for(i=0;i<=e;i++){var p=[],n=[],o=i/e,q=o*(b-a)+a;for(h=0;h<=d;h++){var m=h/d,r=q*Math.sin(2*m*Math.PI),s=-o*c+f,t=q*Math.cos(2*m*Math.PI);this.vertices.push(new THREE.Vertex(new THREE.Vector3(r,s,t)));p.push(this.vertices.length-1);n.push(new THREE.UV(m,o))}l.push(p);k.push(n)}for(i=0;i<e;i++)for(h=0;h<d;h++){var c=l[i][h],p=l[i+1][h],
+n=l[i+1][h+1],o=l[i][h+1],q=this.vertices[c].position.clone().setY(0).normalize(),m=this.vertices[p].position.clone().setY(0).normalize(),r=this.vertices[n].position.clone().setY(0).normalize(),s=this.vertices[o].position.clone().setY(0).normalize(),t=k[i][h].clone(),w=k[i+1][h].clone(),u=k[i+1][h+1].clone(),v=k[i][h+1].clone();this.faces.push(new THREE.Face4(c,p,n,o,[q,m,r,s]));this.faceVertexUvs[0].push([t,w,u,v])}if(!g&&0<a){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,f,0)));for(h=
+0;h<d;h++)c=l[0][h],p=l[0][h+1],n=this.vertices.length-1,q=new THREE.Vector3(0,1,0),m=new THREE.Vector3(0,1,0),r=new THREE.Vector3(0,1,0),t=k[0][h].clone(),w=k[0][h+1].clone(),u=new THREE.UV(w.u,0),this.faces.push(new THREE.Face3(c,p,n,[q,m,r])),this.faceVertexUvs[0].push([t,w,u])}if(!g&&0<b){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-f,0)));for(h=0;h<d;h++)c=l[i][h+1],p=l[i][h],n=this.vertices.length-1,q=new THREE.Vector3(0,-1,0),m=new THREE.Vector3(0,-1,0),r=new THREE.Vector3(0,-1,
+0),t=k[i][h+1].clone(),w=k[i][h].clone(),u=new THREE.UV(w.u,1),this.faces.push(new THREE.Face3(c,p,n,[q,m,r])),this.faceVertexUvs[0].push([t,w,u])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
 THREE.ExtrudeGeometry=function(a,b){if("undefined"!==typeof a){THREE.Geometry.call(this);var a=a instanceof Array?a:[a],c,d,e=a.length;this.shapebb=a[e-1].getBoundingBox();for(d=0;d<e;d++)c=a[d],this.addShape(c,b);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
 THREE.ExtrudeGeometry=function(a,b){if("undefined"!==typeof a){THREE.Geometry.call(this);var a=a instanceof Array?a:[a],c,d,e=a.length;this.shapebb=a[e-1].getBoundingBox();for(d=0;d<e;d++)c=a[d],this.addShape(c,b);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).addSelf(a)}function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,g=THREE.ExtrudeGeometry.__v3,f=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,j=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();g.set(-d.y,d.x);f.set(e.y,-e.x);h.copy(a).addSelf(g);j.copy(a).addSelf(f);if(h.equals(j))return f.clone();
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).addSelf(a)}function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,g=THREE.ExtrudeGeometry.__v3,f=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,j=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();g.set(-d.y,d.x);f.set(e.y,-e.x);h.copy(a).addSelf(g);j.copy(a).addSelf(f);if(h.equals(j))return f.clone();
-h.copy(b).addSelf(g);j.copy(c).addSelf(f);g=d.dot(f);f=j.subSelf(h).dot(f);0===g&&(console.log("Either infinite or no solutions!"),0===f?console.log("Its finite solutions."):console.log("Too bad, no solutions."));f/=g;return 0>f?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(f).addSelf(h).subSelf(a).clone()}function e(a){for(j=a.length;0<=--j;){B=j;F=j-1;0>F&&(F=a.length-1);for(var b=
-0,c=o+2*l,b=0;b<c;b++){var d=P*b,e=P*(b+1),g=da+B+d,f=da+B+e,m=g,d=da+F+d,e=da+F+e,k=f,m=m+E,d=d+E,e=e+E,k=k+E;C.faces.push(new THREE.Face4(m,d,e,k,null,null,u));void 0!==u&&(m=b/c,d=(b+1)/c,e=h+2*i,g=(C.vertices[g].position.z+i)/e,f=(C.vertices[f].position.z+i)/e,C.faceVertexUvs[0].push([new THREE.UV(g,m),new THREE.UV(f,m),new THREE.UV(f,d),new THREE.UV(g,d)]))}}}function g(a,b,c){C.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}function f(a,b,c){a+=E;b+=E;c+=E;C.faces.push(new THREE.Face3(a,
-b,c,null,null,w));if(void 0!==w){var d=v.minX,e=v.minY,g=v.maxY,f=v.maxX,h=C.vertices[b].position.x-d,b=C.vertices[b].position.y-e,j=C.vertices[c].position.x-d,c=C.vertices[c].position.y-e;C.faceVertexUvs[0].push([new THREE.UV((C.vertices[a].position.x-d)/f,(C.vertices[a].position.y-e)/g),new THREE.UV(h/f,b/g),new THREE.UV(j/f,c/g)])}}var h=void 0!==b.amount?b.amount:100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,l=void 0!==b.bevelSegments?b.bevelSegments:
-3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,o=void 0!==b.steps?b.steps:1,q=b.bendPath,m=b.extrudePath,r,s=!1,t=void 0!==b.useSpacedPoints?b.useSpacedPoints:!1,w=b.material,u=b.extrudeMaterial,v=this.shapebb;if(m)r=m.getPoints(n),o=r.length,s=!0,p=!1;p||(k=i=l=0);var y,D,A,C=this,E=this.vertices.length;q&&a.addWrapPath(q);n=t?a.extractAllSpacedPoints(n):a.extractAllPoints(n);q=n.shape;n=n.holes;if(m=!THREE.Shape.Utils.isClockWise(q)){q=q.reverse();for(D=
-0,A=n.length;D<A;D++)y=n[D],THREE.Shape.Utils.isClockWise(y)&&(n[D]=y.reverse());m=!1}m=THREE.Shape.Utils.triangulateShape(q,n);t=q;for(D=0,A=n.length;D<A;D++)y=n[D],q=q.concat(y);for(var J,N,T,K,P=q.length,M=m.length,H=[],j=0,Y=t.length,B=Y-1,F=j+1;j<Y;j++,B++,F++)B===Y&&(B=0),F===Y&&(F=0),H[j]=d(t[j],t[B],t[F]);var Z=[],O,ga=H.concat();for(D=0,A=n.length;D<A;D++){y=n[D];O=[];for(j=0,Y=y.length,B=Y-1,F=j+1;j<Y;j++,B++,F++)B===Y&&(B=0),F===Y&&(F=0),O[j]=d(y[j],y[B],y[F]);Z.push(O);ga=ga.concat(O)}for(J=
-0;J<l;J++){N=J/l;T=i*(1-N);N=k*Math.sin(N*Math.PI/2);for(j=0,Y=t.length;j<Y;j++)K=c(t[j],H[j],N),g(K.x,K.y,-T);for(D=0,A=n.length;D<A;D++){y=n[D];O=Z[D];for(j=0,Y=y.length;j<Y;j++)K=c(y[j],O[j],N),g(K.x,K.y,-T)}}N=k;for(j=0;j<P;j++)K=p?c(q[j],ga[j],N):q[j],s?g(K.x,K.y+r[0].y,r[0].x):g(K.x,K.y,0);for(J=1;J<=o;J++)for(j=0;j<P;j++)K=p?c(q[j],ga[j],N):q[j],s?g(K.x,K.y+r[J-1].y,r[J-1].x):g(K.x,K.y,h/o*J);for(J=l-1;0<=J;J--){N=J/l;T=i*(1-N);N=k*Math.sin(N*Math.PI/2);for(j=0,Y=t.length;j<Y;j++)K=c(t[j],
-H[j],N),g(K.x,K.y,h+T);for(D=0,A=n.length;D<A;D++){y=n[D];O=Z[D];for(j=0,Y=y.length;j<Y;j++)K=c(y[j],O[j],N),s?g(K.x,K.y+r[o-1].y,r[o-1].x+T):g(K.x,K.y,h+T)}}if(p){p=0*P;for(j=0;j<M;j++)k=m[j],f(k[2]+p,k[1]+p,k[0]+p);p=P*(o+2*l);for(j=0;j<M;j++)k=m[j],f(k[0]+p,k[1]+p,k[2]+p)}else{for(j=0;j<M;j++)k=m[j],f(k[2],k[1],k[0]);for(j=0;j<M;j++)k=m[j],f(k[0]+P*o,k[1]+P*o,k[2]+P*o)}var da=0;e(t);da+=t.length;for(D=0,A=n.length;D<A;D++)y=n[D],e(y),da+=y.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;
+h.copy(b).addSelf(g);j.copy(c).addSelf(f);g=d.dot(f);f=j.subSelf(h).dot(f);0===g&&(console.log("Either infinite or no solutions!"),0===f?console.log("Its finite solutions."):console.log("Too bad, no solutions."));f/=g;return 0>f?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(f).addSelf(h).subSelf(a).clone()}function e(a){for(j=a.length;0<=--j;){F=j;E=j-1;0>E&&(E=a.length-1);for(var b=
+0,c=o+2*k,b=0;b<c;b++){var d=P*b,e=P*(b+1),g=ca+F+d,f=ca+F+e,m=g,d=ca+E+d,e=ca+E+e,l=f,m=m+D,d=d+D,e=e+D,l=l+D;B.faces.push(new THREE.Face4(m,d,e,l,null,null,u));void 0!==u&&(m=b/c,d=(b+1)/c,e=h+2*i,g=(B.vertices[g].position.z+i)/e,f=(B.vertices[f].position.z+i)/e,B.faceVertexUvs[0].push([new THREE.UV(g,m),new THREE.UV(f,m),new THREE.UV(f,d),new THREE.UV(g,d)]))}}}function g(a,b,c){B.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}function f(a,b,c){a+=D;b+=D;c+=D;B.faces.push(new THREE.Face3(a,
+b,c,null,null,w));if(void 0!==w){var d=v.minX,e=v.minY,g=v.maxY,f=v.maxX,h=B.vertices[b].position.x-d,b=B.vertices[b].position.y-e,j=B.vertices[c].position.x-d,c=B.vertices[c].position.y-e;B.faceVertexUvs[0].push([new THREE.UV((B.vertices[a].position.x-d)/f,(B.vertices[a].position.y-e)/g),new THREE.UV(h/f,b/g),new THREE.UV(j/f,c/g)])}}var h=void 0!==b.amount?b.amount:100,i=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:i-2,k=void 0!==b.bevelSegments?b.bevelSegments:
+3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,o=void 0!==b.steps?b.steps:1,q=b.bendPath,m=b.extrudePath,r,s=!1,t=void 0!==b.useSpacedPoints?b.useSpacedPoints:!1,w=b.material,u=b.extrudeMaterial,v=this.shapebb;if(m)r=m.getPoints(n),o=r.length,s=!0,p=!1;p||(l=i=k=0);var y,C,A,B=this,D=this.vertices.length;q&&a.addWrapPath(q);n=t?a.extractAllSpacedPoints(n):a.extractAllPoints(n);q=n.shape;n=n.holes;if(m=!THREE.Shape.Utils.isClockWise(q)){q=q.reverse();for(C=
+0,A=n.length;C<A;C++)y=n[C],THREE.Shape.Utils.isClockWise(y)&&(n[C]=y.reverse());m=!1}m=THREE.Shape.Utils.triangulateShape(q,n);t=q;for(C=0,A=n.length;C<A;C++)y=n[C],q=q.concat(y);for(var J,N,S,K,P=q.length,M=m.length,H=[],j=0,X=t.length,F=X-1,E=j+1;j<X;j++,F++,E++)F===X&&(F=0),E===X&&(E=0),H[j]=d(t[j],t[F],t[E]);var Y=[],O,fa=H.concat();for(C=0,A=n.length;C<A;C++){y=n[C];O=[];for(j=0,X=y.length,F=X-1,E=j+1;j<X;j++,F++,E++)F===X&&(F=0),E===X&&(E=0),O[j]=d(y[j],y[F],y[E]);Y.push(O);fa=fa.concat(O)}for(J=
+0;J<k;J++){N=J/k;S=i*(1-N);N=l*Math.sin(N*Math.PI/2);for(j=0,X=t.length;j<X;j++)K=c(t[j],H[j],N),g(K.x,K.y,-S);for(C=0,A=n.length;C<A;C++){y=n[C];O=Y[C];for(j=0,X=y.length;j<X;j++)K=c(y[j],O[j],N),g(K.x,K.y,-S)}}N=l;for(j=0;j<P;j++)K=p?c(q[j],fa[j],N):q[j],s?g(K.x,K.y+r[0].y,r[0].x):g(K.x,K.y,0);for(J=1;J<=o;J++)for(j=0;j<P;j++)K=p?c(q[j],fa[j],N):q[j],s?g(K.x,K.y+r[J-1].y,r[J-1].x):g(K.x,K.y,h/o*J);for(J=k-1;0<=J;J--){N=J/k;S=i*(1-N);N=l*Math.sin(N*Math.PI/2);for(j=0,X=t.length;j<X;j++)K=c(t[j],
+H[j],N),g(K.x,K.y,h+S);for(C=0,A=n.length;C<A;C++){y=n[C];O=Y[C];for(j=0,X=y.length;j<X;j++)K=c(y[j],O[j],N),s?g(K.x,K.y+r[o-1].y,r[o-1].x+S):g(K.x,K.y,h+S)}}if(p){p=0*P;for(j=0;j<M;j++)l=m[j],f(l[2]+p,l[1]+p,l[0]+p);p=P*(o+2*k);for(j=0;j<M;j++)l=m[j],f(l[0]+p,l[1]+p,l[2]+p)}else{for(j=0;j<M;j++)l=m[j],f(l[2],l[1],l[0]);for(j=0;j<M;j++)l=m[j],f(l[0]+P*o,l[1]+P*o,l[2]+P*o)}var ca=0;e(t);ca+=t.length;for(C=0,A=n.length;C<A;C++)y=n[C],e(y),ca+=y.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
-THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],e=[],g=[],f=(new THREE.Matrix4).setRotationZ(b),h=0;h<a.length;h++)this.vertices.push(new THREE.Vertex(a[h])),c[h]=a[h].clone(),d[h]=this.vertices.length-1;for(var i=0;i<=this.angle+0.0010;i+=b){for(h=0;h<c.length;h++)i<this.angle?(c[h]=f.multiplyVector3(c[h].clone()),this.vertices.push(new THREE.Vertex(c[h])),e[h]=this.vertices.length-1):e=g;0==i&&(g=d);
+THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],e=[],g=[],f=(new THREE.Matrix4).setRotationZ(b),h=0;h<a.length;h++)this.vertices.push(new THREE.Vertex(a[h])),c[h]=a[h].clone(),d[h]=this.vertices.length-1;for(var i=0;i<=this.angle+0.001;i+=b){for(h=0;h<c.length;h++)i<this.angle?(c[h]=f.multiplyVector3(c[h].clone()),this.vertices.push(new THREE.Vertex(c[h])),e[h]=this.vertices.length-1):e=g;0==i&&(g=d);
 for(h=0;h<d.length-1;h++)this.faces.push(new THREE.Face4(e[h],e[h+1],d[h+1],d[h])),this.faceVertexUvs[0].push([new THREE.UV(1-i/this.angle,h/a.length),new THREE.UV(1-i/this.angle,(h+1)/a.length),new THREE.UV(1-(i-b)/this.angle,(h+1)/a.length),new THREE.UV(1-(i-b)/this.angle,h/a.length)]);d=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
 for(h=0;h<d.length-1;h++)this.faces.push(new THREE.Face4(e[h],e[h+1],d[h+1],d[h])),this.faceVertexUvs[0].push([new THREE.UV(1-i/this.angle,h/a.length),new THREE.UV(1-i/this.angle,(h+1)/a.length),new THREE.UV(1-(i-b)/this.angle,(h+1)/a.length),new THREE.UV(1-(i-b)/this.angle,h/a.length)]);d=e;e=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
-THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var e=a/2,g=b/2,c=c||1,d=d||1,f=c+1,h=d+1,i=a/c,k=b/d,l=new THREE.Vector3(0,0,1),a=0;a<h;a++)for(b=0;b<f;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*i-e,-(a*k-g),0)));for(a=0;a<d;a++)for(b=0;b<c;b++)e=new THREE.Face4(b+f*a,b+f*(a+1),b+1+f*(a+1),b+1+f*a),e.normal.copy(l),e.vertexNormals.push(l.clone(),l.clone(),l.clone(),l.clone()),this.faces.push(e),this.faceVertexUvs[0].push([new THREE.UV(b/c,a/d),new THREE.UV(b/
+THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var e=a/2,g=b/2,c=c||1,d=d||1,f=c+1,h=d+1,i=a/c,l=b/d,k=new THREE.Vector3(0,0,1),a=0;a<h;a++)for(b=0;b<f;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*i-e,-(a*l-g),0)));for(a=0;a<d;a++)for(b=0;b<c;b++)e=new THREE.Face4(b+f*a,b+f*(a+1),b+1+f*(a+1),b+1+f*a),e.normal.copy(k),e.vertexNormals.push(k.clone(),k.clone(),k.clone(),k.clone()),this.faces.push(e),this.faceVertexUvs[0].push([new THREE.UV(b/c,a/d),new THREE.UV(b/
 c,(a+1)/d),new THREE.UV((b+1)/c,(a+1)/d),new THREE.UV((b+1)/c,a/d)]);this.computeCentroids()};THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
 c,(a+1)/d),new THREE.UV((b+1)/c,(a+1)/d),new THREE.UV((b+1)/c,a/d)]);this.computeCentroids()};THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.SphereGeometry=function(a,b,c,d,e,g,f){THREE.Geometry.call(this);var a=a||50,d=void 0!==d?d:0,e=void 0!==e?e:2*Math.PI,g=void 0!==g?g:0,f=void 0!==f?f:Math.PI,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),h,i,k=[],l=[];for(i=0;i<=c;i++){var p=[],n=[];for(h=0;h<=b;h++){var o=h/b,q=i/c,m=-a*Math.cos(d+o*e)*Math.sin(g+q*f),r=a*Math.cos(g+q*f),s=a*Math.sin(d+o*e)*Math.sin(g+q*f);this.vertices.push(new THREE.Vertex(new THREE.Vector3(m,r,s)));p.push(this.vertices.length-1);n.push(new THREE.UV(o,
-q))}k.push(p);l.push(n)}for(i=0;i<c;i++)for(h=0;h<b;h++){var d=k[i][h+1],e=k[i][h],g=k[i+1][h],f=k[i+1][h+1],p=this.vertices[d].position.clone().normalize(),n=this.vertices[e].position.clone().normalize(),o=this.vertices[g].position.clone().normalize(),q=this.vertices[f].position.clone().normalize(),m=l[i][h+1].clone(),r=l[i][h].clone(),s=l[i+1][h].clone(),t=l[i+1][h+1].clone();Math.abs(this.vertices[d].position.y)==a?(this.faces.push(new THREE.Face3(d,g,f,[p,o,q])),this.faceVertexUvs[0].push([m,
+THREE.SphereGeometry=function(a,b,c,d,e,g,f){THREE.Geometry.call(this);var a=a||50,d=void 0!==d?d:0,e=void 0!==e?e:2*Math.PI,g=void 0!==g?g:0,f=void 0!==f?f:Math.PI,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),h,i,l=[],k=[];for(i=0;i<=c;i++){var p=[],n=[];for(h=0;h<=b;h++){var o=h/b,q=i/c,m=-a*Math.cos(d+o*e)*Math.sin(g+q*f),r=a*Math.cos(g+q*f),s=a*Math.sin(d+o*e)*Math.sin(g+q*f);this.vertices.push(new THREE.Vertex(new THREE.Vector3(m,r,s)));p.push(this.vertices.length-1);n.push(new THREE.UV(o,
+q))}l.push(p);k.push(n)}for(i=0;i<c;i++)for(h=0;h<b;h++){var d=l[i][h+1],e=l[i][h],g=l[i+1][h],f=l[i+1][h+1],p=this.vertices[d].position.clone().normalize(),n=this.vertices[e].position.clone().normalize(),o=this.vertices[g].position.clone().normalize(),q=this.vertices[f].position.clone().normalize(),m=k[i][h+1].clone(),r=k[i][h].clone(),s=k[i+1][h].clone(),t=k[i+1][h+1].clone();Math.abs(this.vertices[d].position.y)==a?(this.faces.push(new THREE.Face3(d,g,f,[p,o,q])),this.faceVertexUvs[0].push([m,
 s,t])):Math.abs(this.vertices[g].position.y)==a?(this.faces.push(new THREE.Face3(d,e,g,[p,n,o])),this.faceVertexUvs[0].push([m,r,s])):(this.faces.push(new THREE.Face4(d,e,g,f,[p,n,o,q])),this.faceVertexUvs[0].push([m,r,s,t]))}this.computeCentroids();this.computeFaceNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 s,t])):Math.abs(this.vertices[g].position.y)==a?(this.faces.push(new THREE.Face3(d,e,g,[p,n,o])),this.faceVertexUvs[0].push([m,r,s])):(this.faces.push(new THREE.Face4(d,e,g,f,[p,n,o,q])),this.faceVertexUvs[0].push([m,r,s,t]))}this.computeCentroids();this.computeFaceNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 THREE.TextGeometry=function(a,b){var c=(new THREE.TextPath(a,b)).toShapes();b.amount=void 0!==b.height?b.height:50;if(void 0===b.bevelThickness)b.bevelThickness=10;if(void 0===b.bevelSize)b.bevelSize=8;if(void 0===b.bevelEnabled)b.bevelEnabled=!1;if(b.bend){var d=c[c.length-1].getBoundingBox().maxX;b.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(d/2,120),new THREE.Vector2(d,0))}THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
 THREE.TextGeometry=function(a,b){var c=(new THREE.TextPath(a,b)).toShapes();b.amount=void 0!==b.height?b.height:50;if(void 0===b.bevelThickness)b.bevelThickness=10;if(void 0===b.bevelSize)b.bevelSize=8;if(void 0===b.bevelEnabled)b.bevelEnabled=!1;if(b.bend){var d=c[c.length-1].getBoundingBox().maxX;b.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(d/2,120),new THREE.Vector2(d,0))}THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){for(var b=this.getFace(),c=this.size/b.resolution,d=
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){for(var b=this.getFace(),c=this.size/b.resolution,d=
-0,e=(""+a).split(""),g=e.length,f=[],a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;f.push(h.path)}return{paths:f,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var g=[],f,h,i,k,l,p,n,o,q,m,r,s=b.glyphs[a]||b.glyphs["?"];if(s){if(s.o){b=s._cachedOutline||(s._cachedOutline=s.o.split(" "));k=b.length;for(a=0;a<k;)switch(i=b[a++],i){case "m":i=b[a++]*c+d;l=b[a++]*c;g.push(new THREE.Vector2(i,l));e.moveTo(i,l);break;case "l":i=b[a++]*c+d;l=b[a++]*c;g.push(new THREE.Vector2(i,
-l));e.lineTo(i,l);break;case "q":i=b[a++]*c+d;l=b[a++]*c;o=b[a++]*c+d;q=b[a++]*c;e.quadraticCurveTo(o,q,i,l);if(f=g[g.length-1]){p=f.x;n=f.y;for(f=1,h=this.divisions;f<=h;f++){var t=f/h,w=THREE.Shape.Utils.b2(t,p,o,i),t=THREE.Shape.Utils.b2(t,n,q,l);g.push(new THREE.Vector2(w,t))}}break;case "b":if(i=b[a++]*c+d,l=b[a++]*c,o=b[a++]*c+d,q=b[a++]*-c,m=b[a++]*c+d,r=b[a++]*-c,e.bezierCurveTo(i,l,o,q,m,r),f=g[g.length-1]){p=f.x;n=f.y;for(f=1,h=this.divisions;f<=h;f++)t=f/h,w=THREE.Shape.Utils.b3(t,p,o,
-m,i),t=THREE.Shape.Utils.b3(t,n,q,r,l),g.push(new THREE.Vector2(w,t))}}}return{offset:s.ha*c,points:g,path:e}}}};
-(function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],i,k,l;if(0<b(a))for(k=0;k<e;k++)f[k]=k;else for(k=0;k<e;k++)f[k]=e-1-k;var p=2*e;for(k=e-1;2<e;){if(0>=p--){console.log("Warning, unable to triangulate polygon!");break}i=k;e<=i&&(i=0);k=i+1;e<=k&&(k=0);l=k+1;e<=l&&(l=0);var n;a:{n=a;var o=i,q=k,m=l,r=e,s=f,t=void 0,w=void 0,u=void 0,v=void 0,y=void 0,
-D=void 0,A=void 0,C=void 0,E=void 0,w=n[s[o]].x,u=n[s[o]].y,v=n[s[q]].x,y=n[s[q]].y,D=n[s[m]].x,A=n[s[m]].y;if(1.0E-10>(v-w)*(A-u)-(y-u)*(D-w))n=!1;else{for(t=0;t<r;t++)if(!(t==o||t==q||t==m)){var C=n[s[t]].x,E=n[s[t]].y,J=void 0,N=void 0,T=void 0,K=void 0,P=void 0,M=void 0,H=void 0,j=void 0,Y=void 0,B=void 0,F=void 0,Z=void 0,J=T=P=void 0,J=D-v,N=A-y,T=w-D,K=u-A,P=v-w,M=y-u,H=C-w,j=E-u,Y=C-v,B=E-y,F=C-D,Z=E-A,J=J*B-N*Y,P=P*j-M*H,T=T*Z-K*F;if(0<=J&&0<=T&&0<=P){n=!1;break a}}n=!0}}if(n){g.push([a[f[i]],
-a[f[k]],a[f[l]]]);h.push([f[i],f[k],f[l]]);for(i=k,l=k+1;l<e;i++,l++)f[i]=f[l];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
+0,e=(""+a).split(""),g=e.length,f=[],a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;f.push(h.path)}return{paths:f,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var g=[],f,h,i,l,k,p,n,o,q,m,r,s=b.glyphs[a]||b.glyphs["?"];if(s){if(s.o){b=s._cachedOutline||(s._cachedOutline=s.o.split(" "));l=b.length;for(a=0;a<l;)switch(i=b[a++],i){case "m":i=b[a++]*c+d;k=b[a++]*c;g.push(new THREE.Vector2(i,k));e.moveTo(i,k);break;case "l":i=b[a++]*c+d;k=b[a++]*c;g.push(new THREE.Vector2(i,
+k));e.lineTo(i,k);break;case "q":i=b[a++]*c+d;k=b[a++]*c;o=b[a++]*c+d;q=b[a++]*c;e.quadraticCurveTo(o,q,i,k);if(f=g[g.length-1]){p=f.x;n=f.y;for(f=1,h=this.divisions;f<=h;f++){var t=f/h,w=THREE.Shape.Utils.b2(t,p,o,i),t=THREE.Shape.Utils.b2(t,n,q,k);g.push(new THREE.Vector2(w,t))}}break;case "b":if(i=b[a++]*c+d,k=b[a++]*c,o=b[a++]*c+d,q=b[a++]*-c,m=b[a++]*c+d,r=b[a++]*-c,e.bezierCurveTo(i,k,o,q,m,r),f=g[g.length-1]){p=f.x;n=f.y;for(f=1,h=this.divisions;f<=h;f++)t=f/h,w=THREE.Shape.Utils.b3(t,p,o,
+m,i),t=THREE.Shape.Utils.b3(t,n,q,r,k),g.push(new THREE.Vector2(w,t))}}}return{offset:s.ha*c,points:g,path:e}}}};
+(function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],i,l,k;if(0<b(a))for(l=0;l<e;l++)f[l]=l;else for(l=0;l<e;l++)f[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.log("Warning, unable to triangulate polygon!");break}i=l;e<=i&&(i=0);l=i+1;e<=l&&(l=0);k=l+1;e<=k&&(k=0);var n;a:{n=a;var o=i,q=l,m=k,r=e,s=f,t=void 0,w=void 0,u=void 0,v=void 0,y=void 0,
+C=void 0,A=void 0,B=void 0,D=void 0,w=n[s[o]].x,u=n[s[o]].y,v=n[s[q]].x,y=n[s[q]].y,C=n[s[m]].x,A=n[s[m]].y;if(1.0E-10>(v-w)*(A-u)-(y-u)*(C-w))n=!1;else{for(t=0;t<r;t++)if(!(t==o||t==q||t==m)){var B=n[s[t]].x,D=n[s[t]].y,J=void 0,N=void 0,S=void 0,K=void 0,P=void 0,M=void 0,H=void 0,j=void 0,X=void 0,F=void 0,E=void 0,Y=void 0,J=S=P=void 0,J=C-v,N=A-y,S=w-C,K=u-A,P=v-w,M=y-u,H=B-w,j=D-u,X=B-v,F=D-y,E=B-C,Y=D-A,J=J*F-N*X,P=P*j-M*H,S=S*Y-K*E;if(0<=J&&0<=S&&0<=P){n=!1;break a}}n=!0}}if(n){g.push([a[f[i]],
+a[f[l]],a[f[k]]]);h.push([f[i],f[l],f[k]]);for(i=l,k=l+1;k<e;i++,k++)f[i]=f[k];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=d||6;this.arc=e||2*Math.PI;e=new THREE.Vector3;a=[];b=[];for(c=0;c<=this.segmentsR;c++)for(d=0;d<=this.segmentsT;d++){var g=d/this.segmentsT*this.arc,f=2*c/this.segmentsR*Math.PI;e.x=this.radius*Math.cos(g);e.y=this.radius*Math.sin(g);var h=new THREE.Vector3;h.x=(this.radius+this.tube*Math.cos(f))*Math.cos(g);h.y=(this.radius+this.tube*Math.cos(f))*Math.sin(g);h.z=
 THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=d||6;this.arc=e||2*Math.PI;e=new THREE.Vector3;a=[];b=[];for(c=0;c<=this.segmentsR;c++)for(d=0;d<=this.segmentsT;d++){var g=d/this.segmentsT*this.arc,f=2*c/this.segmentsR*Math.PI;e.x=this.radius*Math.cos(g);e.y=this.radius*Math.sin(g);var h=new THREE.Vector3;h.x=(this.radius+this.tube*Math.cos(f))*Math.cos(g);h.y=(this.radius+this.tube*Math.cos(f))*Math.sin(g);h.z=
 this.tube*Math.sin(f);this.vertices.push(new THREE.Vertex(h));a.push(new THREE.UV(d/this.segmentsT,1-c/this.segmentsR));b.push(h.clone().subSelf(e).normalize())}for(c=1;c<=this.segmentsR;c++)for(d=1;d<=this.segmentsT;d++){var e=(this.segmentsT+1)*c+d-1,g=(this.segmentsT+1)*(c-1)+d-1,f=(this.segmentsT+1)*(c-1)+d,h=(this.segmentsT+1)*c+d,i=new THREE.Face4(e,g,f,h,[b[e],b[g],b[f],b[h]]);i.normal.addSelf(b[e]);i.normal.addSelf(b[g]);i.normal.addSelf(b[f]);i.normal.addSelf(b[h]);i.normal.normalize();this.faces.push(i);
 this.tube*Math.sin(f);this.vertices.push(new THREE.Vertex(h));a.push(new THREE.UV(d/this.segmentsT,1-c/this.segmentsR));b.push(h.clone().subSelf(e).normalize())}for(c=1;c<=this.segmentsR;c++)for(d=1;d<=this.segmentsT;d++){var e=(this.segmentsT+1)*c+d-1,g=(this.segmentsT+1)*(c-1)+d-1,f=(this.segmentsT+1)*(c-1)+d,h=(this.segmentsT+1)*c+d,i=new THREE.Face4(e,g,f,h,[b[e],b[g],b[f],b[h]]);i.normal.addSelf(b[e]);i.normal.addSelf(b[g]);i.normal.addSelf(b[f]);i.normal.addSelf(b[h]);i.normal.normalize();this.faces.push(i);
 this.faceVertexUvs[0].push([a[e].clone(),a[g].clone(),a[f].clone(),a[h].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
 this.faceVertexUvs[0].push([a[e].clone(),a[g].clone(),a[f].clone(),a[h].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
 THREE.TorusKnotGeometry=function(a,b,c,d,e,g,f){function h(a,b,c,d,e,g){var f=Math.cos(a);Math.cos(b);b=Math.sin(a);a*=c/d;c=Math.cos(a);f*=0.5*e*(2+c);b=0.5*e*(2+c)*b;e=0.5*g*e*Math.sin(a);return new THREE.Vector3(f,b,e)}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=g||3;this.heightScale=f||1;this.grid=Array(this.segmentsR);c=new THREE.Vector3;d=new THREE.Vector3;e=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=
 THREE.TorusKnotGeometry=function(a,b,c,d,e,g,f){function h(a,b,c,d,e,g){var f=Math.cos(a);Math.cos(b);b=Math.sin(a);a*=c/d;c=Math.cos(a);f*=0.5*e*(2+c);b=0.5*e*(2+c)*b;e=0.5*g*e*Math.sin(a);return new THREE.Vector3(f,b,e)}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=g||3;this.heightScale=f||1;this.grid=Array(this.segmentsR);c=new THREE.Vector3;d=new THREE.Vector3;e=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=
 Array(this.segmentsT);for(b=0;b<this.segmentsT;++b){var i=2*(a/this.segmentsR)*this.p*Math.PI,f=2*(b/this.segmentsT)*Math.PI,g=h(i,f,this.q,this.p,this.radius,this.heightScale),i=h(i+0.01,f,this.q,this.p,this.radius,this.heightScale);c.sub(i,g);d.add(i,g);e.cross(c,d);d.cross(e,c);e.normalize();d.normalize();i=-this.tube*Math.cos(f);f=this.tube*Math.sin(f);g.x+=i*d.x+f*e.x;g.y+=i*d.y+f*e.y;g.z+=i*d.z+f*e.z;this.grid[a][b]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(g.x,g.y,g.z)))-1}}for(a=
 Array(this.segmentsT);for(b=0;b<this.segmentsT;++b){var i=2*(a/this.segmentsR)*this.p*Math.PI,f=2*(b/this.segmentsT)*Math.PI,g=h(i,f,this.q,this.p,this.radius,this.heightScale),i=h(i+0.01,f,this.q,this.p,this.radius,this.heightScale);c.sub(i,g);d.add(i,g);e.cross(c,d);d.cross(e,c);e.normalize();d.normalize();i=-this.tube*Math.cos(f);f=this.tube*Math.sin(f);g.x+=i*d.x+f*e.x;g.y+=i*d.y+f*e.y;g.z+=i*d.z+f*e.z;this.grid[a][b]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(g.x,g.y,g.z)))-1}}for(a=
-0;a<this.segmentsR;++a)for(b=0;b<this.segmentsT;++b){var e=(a+1)%this.segmentsR,g=(b+1)%this.segmentsT,c=this.grid[a][b],d=this.grid[e][b],e=this.grid[e][g],g=this.grid[a][g],f=new THREE.UV(a/this.segmentsR,b/this.segmentsT),i=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT),k=new THREE.UV((a+1)/this.segmentsR,(b+1)/this.segmentsT),l=new THREE.UV(a/this.segmentsR,(b+1)/this.segmentsT);this.faces.push(new THREE.Face4(c,d,e,g));this.faceVertexUvs[0].push([f,i,k,l])}this.computeCentroids();this.computeFaceNormals();
+0;a<this.segmentsR;++a)for(b=0;b<this.segmentsT;++b){var e=(a+1)%this.segmentsR,g=(b+1)%this.segmentsT,c=this.grid[a][b],d=this.grid[e][b],e=this.grid[e][g],g=this.grid[a][g],f=new THREE.UV(a/this.segmentsR,b/this.segmentsT),i=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT),l=new THREE.UV((a+1)/this.segmentsR,(b+1)/this.segmentsT),k=new THREE.UV(a/this.segmentsR,(b+1)/this.segmentsT);this.faces.push(new THREE.Face4(c,d,e,g));this.faceVertexUvs[0].push([f,i,l,k])}this.computeCentroids();this.computeFaceNormals();
 this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
 this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
 THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=new THREE.Vertex(a.normalize());b.index=i.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+0.5,a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+0.5;b.uv=new THREE.UV(c,a);return b}function g(a,b,c,d){1>d?(d=new THREE.Face3(a.index,b.index,c.index,[a.position.clone(),b.position.clone(),c.position.clone()]),d.centroid.addSelf(a.position).addSelf(b.position).addSelf(c.position).divideScalar(3),d.normal=d.centroid.clone().normalize(),
 THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=new THREE.Vertex(a.normalize());b.index=i.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+0.5,a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+0.5;b.uv=new THREE.UV(c,a);return b}function g(a,b,c,d){1>d?(d=new THREE.Face3(a.index,b.index,c.index,[a.position.clone(),b.position.clone(),c.position.clone()]),d.centroid.addSelf(a.position).addSelf(b.position).addSelf(c.position).divideScalar(3),d.normal=d.centroid.clone().normalize(),
 i.faces.push(d),d=Math.atan2(d.centroid.z,-d.centroid.x),i.faceVertexUvs[0].push([h(a.uv,a.position,d),h(b.uv,b.position,d),h(c.uv,c.position,d)])):(d-=1,g(a,f(a,b),f(a,c),d),g(f(a,b),b,f(b,c),d),g(f(a,c),f(b,c),c,d),g(f(a,b),f(b,c),f(a,c),d))}function f(a,b){p[a.index]||(p[a.index]=[]);p[b.index]||(p[b.index]=[]);var c=p[a.index][b.index];void 0===c&&(p[a.index][b.index]=p[b.index][a.index]=c=e((new THREE.Vector3).add(a.position,b.position).divideScalar(2)));return c}function h(a,b,c){0>c&&1===a.u&&
 i.faces.push(d),d=Math.atan2(d.centroid.z,-d.centroid.x),i.faceVertexUvs[0].push([h(a.uv,a.position,d),h(b.uv,b.position,d),h(c.uv,c.position,d)])):(d-=1,g(a,f(a,b),f(a,c),d),g(f(a,b),b,f(b,c),d),g(f(a,c),f(b,c),c,d),g(f(a,b),f(b,c),f(a,c),d))}function f(a,b){p[a.index]||(p[a.index]=[]);p[b.index]||(p[b.index]=[]);var c=p[a.index][b.index];void 0===c&&(p[a.index][b.index]=p[b.index][a.index]=c=e((new THREE.Vector3).add(a.position,b.position).divideScalar(2)));return c}function h(a,b,c){0>c&&1===a.u&&
-(a=new THREE.UV(a.u-1,a.v));0===b.x&&0===b.z&&(a=new THREE.UV(c/2/Math.PI+0.5,a.v));return a}THREE.Geometry.call(this);for(var c=c||1,d=d||0,i=this,k=0,l=a.length;k<l;k++)e(new THREE.Vector3(a[k][0],a[k][1],a[k][2]));for(var p=[],a=this.vertices,k=0,l=b.length;k<l;k++)g(a[b[k][0]],a[b[k][1]],a[b[k][2]],d);this.mergeVertices();k=0;for(l=this.vertices.length;k<l;k++)this.vertices[k].position.multiplyScalar(c);this.boundingSphere={radius:c}};THREE.PolyhedronGeometry.prototype=new THREE.Geometry;
+(a=new THREE.UV(a.u-1,a.v));0===b.x&&0===b.z&&(a=new THREE.UV(c/2/Math.PI+0.5,a.v));return a}THREE.Geometry.call(this);for(var c=c||1,d=d||0,i=this,l=0,k=a.length;l<k;l++)e(new THREE.Vector3(a[l][0],a[l][1],a[l][2]));for(var p=[],a=this.vertices,l=0,k=b.length;l<k;l++)g(a[b[l][0]],a[b[l][1]],a[b[l][2]],d);this.mergeVertices();l=0;for(k=this.vertices.length;l<k;l++)this.vertices[l].position.multiplyScalar(c);this.boundingSphere={radius:c}};THREE.PolyhedronGeometry.prototype=new THREE.Geometry;
 THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[[-1,c,0],[1,c,0],[-1,-c,0],[1,-c,0],[0,-1,c],[0,1,c],[0,-1,-c],[0,1,-c],[c,0,-1],[c,0,1],[-c,0,-1],[-c,0,1]],[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]],a,b)};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;
 THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[[-1,c,0],[1,c,0],[-1,-c,0],[1,-c,0],[0,-1,c],[0,1,c],[0,-1,-c],[0,1,-c],[c,0,-1],[c,0,1],[-c,0,-1],[-c,0,1]],[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]],a,b)};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;
 THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;THREE.OctahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],[[0,2,4],[0,4,3],[0,3,5],[0,5,2],[1,2,5],[1,5,3],[1,3,4],[1,4,2]],a,b)};THREE.OctahedronGeometry.prototype=new THREE.Geometry;THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
 THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;THREE.OctahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],[[0,2,4],[0,4,3],[0,3,5],[0,5,2],[1,2,5],[1,5,3],[1,3,4],[1,4,2]],a,b)};THREE.OctahedronGeometry.prototype=new THREE.Geometry;THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
 THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,1,1],[-1,-1,1],[-1,1,-1],[1,-1,-1]],[[2,1,0],[0,3,2],[1,3,0],[2,3,1]],a,b)};THREE.TetrahedronGeometry.prototype=new THREE.Geometry;THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;
 THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,1,1],[-1,-1,1],[-1,1,-1],[1,-1,-1]],[[2,1,0],[0,3,2],[1,3,0],[2,3,1]],a,b)};THREE.TetrahedronGeometry.prototype=new THREE.Geometry;THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;
@@ -582,148 +582,148 @@ this.update(a);this.lines=new THREE.Line(this.lineGeometry,this.lineMaterial,THR
 THREE.CameraHelper.prototype.update=function(a){function b(a,b,g,f){THREE.CameraHelper.__v.set(b,g,f);THREE.CameraHelper.__projector.unprojectVector(THREE.CameraHelper.__v,THREE.CameraHelper.__c);a=c.pointMap[a];if(void 0!==a){b=0;for(g=a.length;b<g;b++)c.lineGeometry.vertices[a[b]].position.copy(THREE.CameraHelper.__v)}}var c=this;THREE.CameraHelper.__c.projectionMatrix.copy(a.projectionMatrix);b("c",0,0,-1);b("t",0,0,1);b("n1",-1,-1,-1);b("n2",1,-1,-1);b("n3",-1,1,-1);b("n4",1,1,-1);b("f1",-1,-1,
 THREE.CameraHelper.prototype.update=function(a){function b(a,b,g,f){THREE.CameraHelper.__v.set(b,g,f);THREE.CameraHelper.__projector.unprojectVector(THREE.CameraHelper.__v,THREE.CameraHelper.__c);a=c.pointMap[a];if(void 0!==a){b=0;for(g=a.length;b<g;b++)c.lineGeometry.vertices[a[b]].position.copy(THREE.CameraHelper.__v)}}var c=this;THREE.CameraHelper.__c.projectionMatrix.copy(a.projectionMatrix);b("c",0,0,-1);b("t",0,0,1);b("n1",-1,-1,-1);b("n2",1,-1,-1);b("n3",-1,1,-1);b("n4",1,1,-1);b("f1",-1,-1,
 1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,-1);b("u2",-0.7,1.1,-1);b("u3",0,2,-1);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,-1);b("cn2",1,0,-1);b("cn3",0,-1,-1);b("cn4",0,1,-1);this.lineGeometry.__dirtyVertices=!0};THREE.CameraHelper.__projector=new THREE.Projector;THREE.CameraHelper.__v=new THREE.Vector3;THREE.CameraHelper.__c=new THREE.Camera;
 1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,-1);b("u2",-0.7,1.1,-1);b("u3",0,2,-1);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,-1);b("cn2",1,0,-1);b("cn3",0,-1,-1);b("cn4",0,1,-1);this.lineGeometry.__dirtyVertices=!0};THREE.CameraHelper.__projector=new THREE.Projector;THREE.CameraHelper.__v=new THREE.Vector3;THREE.CameraHelper.__c=new THREE.Camera;
 THREE.SubdivisionModifier=function(a){this.subdivisions=void 0===a?1:a;this.useOldVertexColors=!1;this.supportUVs=!0};THREE.SubdivisionModifier.prototype.constructor=THREE.SubdivisionModifier;THREE.SubdivisionModifier.prototype.modify=function(a){for(var b=this.subdivisions;0<b--;)this.smooth(a)};
 THREE.SubdivisionModifier=function(a){this.subdivisions=void 0===a?1:a;this.useOldVertexColors=!1;this.supportUVs=!0};THREE.SubdivisionModifier.prototype.constructor=THREE.SubdivisionModifier;THREE.SubdivisionModifier.prototype.modify=function(a){for(var b=this.subdivisions;0<b--;)this.smooth(a)};
-THREE.SubdivisionModifier.prototype.smooth=function(a){function b(a,b,c,d,h,i){var m=new THREE.Face4(a,b,c,d,null,h.color,h.material);if(f.useOldVertexColors){m.vertexColors=[];for(var k,l,p,o=0;4>o;o++){p=i[o];k=new THREE.Color;k.setRGB(0,0,0);for(var q=0;q<p.length;q++)l=h.vertexColors[p[q]-1],k.r+=l.r,k.g+=l.g,k.b+=l.b;k.r/=p.length;k.g/=p.length;k.b/=p.length;m.vertexColors[o]=k}}e.push(m);(!f.supportUVs||0!=n.length)&&g.push([n[a],n[b],n[c],n[d]])}function c(a,b){return Math.min(a,b)+"_"+Math.max(a,
-b)}var d=[],e=[],g=[],f=this,h=a.vertices,d=a.faces,i=h.concat(),k=[],l={},p={},n=[],o,q,m,r,s,t=a.faceVertexUvs[0];for(o=0,q=t.length;o<q;o++)for(m=0,r=t[o].length;m<r;m++)s=d[o]["abcd".charAt(m)],n[s]||(n[s]=t[o][m]);var w;for(o=0,q=d.length;o<q;o++)if(s=d[o],k.push(s.centroid),i.push(new THREE.Vertex(s.centroid)),f.supportUVs&&0!=n.length){w=new THREE.UV;if(s instanceof THREE.Face3)w.u=n[s.a].u+n[s.b].u+n[s.c].u,w.v=n[s.a].v+n[s.b].v+n[s.c].v,w.u/=3,w.v/=3;else if(s instanceof THREE.Face4)w.u=
-n[s.a].u+n[s.b].u+n[s.c].u+n[s.d].u,w.v=n[s.a].v+n[s.b].v+n[s.c].v+n[s.d].v,w.u/=4,w.v/=4;n.push(w)}q=function(a){function b(a,c,d){void 0===a[c]&&(a[c]=[]);a[c].push(d)}var d,e,g,f,h={};for(d=0,e=a.faces.length;d<e;d++)g=a.faces[d],g instanceof THREE.Face3?(f=c(g.a,g.b),b(h,f,d),f=c(g.b,g.c),b(h,f,d),f=c(g.c,g.a),b(h,f,d)):g instanceof THREE.Face4&&(f=c(g.a,g.b),b(h,f,d),f=c(g.b,g.c),b(h,f,d),f=c(g.c,g.d),b(h,f,d),f=c(g.d,g.a),b(h,f,d));return h}(a);var u=0,t=h.length,v,y,D={},A={},C=function(a,
-b){void 0===D[a]&&(D[a]=[]);D[a].push(b)},E=function(a,b){void 0===A[a]&&(A[a]={});A[a][b]=null};for(o in q){w=q[o];v=o.split("_");y=v[0];v=v[1];C(y,[y,v]);C(v,[y,v]);for(m=0,r=w.length;m<r;m++)s=w[m],E(y,s,o),E(v,s,o);2>w.length&&(p[o]=!0)}for(o in q)if(w=q[o],s=w[0],w=w[1],v=o.split("_"),y=v[0],v=v[1],r=new THREE.Vector3,p[o]?(r.addSelf(h[y].position),r.addSelf(h[v].position),r.multiplyScalar(0.5)):(r.addSelf(k[s]),r.addSelf(k[w]),r.addSelf(h[y].position),r.addSelf(h[v].position),r.multiplyScalar(0.25)),
-l[o]=t+d.length+u,i.push(new THREE.Vertex(r)),u++,f.supportUVs&&0!=n.length)w=new THREE.UV,w.u=n[y].u+n[v].u,w.v=n[y].v+n[v].v,w.u/=2,w.v/=2,n.push(w);var J,N;v=["123","12","2","23"];r=["123","23","3","31"];var C=["123","31","1","12"],E=["1234","12","2","23"],T=["1234","23","3","34"],K=["1234","34","4","41"],P=["1234","41","1","12"];for(o=0,q=k.length;o<q;o++)s=d[o],w=t+o,s instanceof THREE.Face3?(u=c(s.a,s.b),y=c(s.b,s.c),J=c(s.c,s.a),b(w,l[u],s.b,l[y],s,v),b(w,l[y],s.c,l[J],s,r),b(w,l[J],s.a,l[u],
-s,C)):s instanceof THREE.Face4?(u=c(s.a,s.b),y=c(s.b,s.c),J=c(s.c,s.d),N=c(s.d,s.a),b(w,l[u],s.b,l[y],s,E),b(w,l[y],s.c,l[J],s,T),b(w,l[J],s.d,l[N],s,K),b(w,l[N],s.a,l[u],s,P)):console.log("face should be a face!",s);d=i;i=new THREE.Vector3;l=new THREE.Vector3;for(o=0,q=h.length;o<q;o++)if(void 0!==D[o]){i.set(0,0,0);l.set(0,0,0);s=new THREE.Vector3(0,0,0);w=0;for(m in A[o])i.addSelf(k[m]),w++;u=0;t=D[o].length;for(m=0;m<t;m++)p[c(D[o][m][0],D[o][m][1])]&&u++;if(2!=u){i.divideScalar(w);for(m=0;m<
-t;m++)w=D[o][m],w=h[w[0]].position.clone().addSelf(h[w[1]].position).divideScalar(2),l.addSelf(w);l.divideScalar(t);s.addSelf(h[o].position);s.multiplyScalar(t-3);s.addSelf(i);s.addSelf(l.multiplyScalar(2));s.divideScalar(t);d[o].position=s}}a.vertices=d;a.faces=e;a.faceVertexUvs[0]=g;delete a.__tmpVertices;a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals()};
+THREE.SubdivisionModifier.prototype.smooth=function(a){function b(a,b,c,d,h,i){var k=new THREE.Face4(a,b,c,d,null,h.color,h.material);if(f.useOldVertexColors){k.vertexColors=[];for(var m,l,p,o=0;4>o;o++){p=i[o];m=new THREE.Color;m.setRGB(0,0,0);for(var q=0;q<p.length;q++)l=h.vertexColors[p[q]-1],m.r+=l.r,m.g+=l.g,m.b+=l.b;m.r/=p.length;m.g/=p.length;m.b/=p.length;k.vertexColors[o]=m}}e.push(k);(!f.supportUVs||0!=n.length)&&g.push([n[a],n[b],n[c],n[d]])}function c(a,b){return Math.min(a,b)+"_"+Math.max(a,
+b)}var d=[],e=[],g=[],f=this,h=a.vertices,d=a.faces,i=h.concat(),l=[],k={},p={},n=[],o,q,m,r,s,t=a.faceVertexUvs[0];for(o=0,q=t.length;o<q;o++)for(m=0,r=t[o].length;m<r;m++)s=d[o]["abcd".charAt(m)],n[s]||(n[s]=t[o][m]);var w;for(o=0,q=d.length;o<q;o++)if(s=d[o],l.push(s.centroid),i.push(new THREE.Vertex(s.centroid)),f.supportUVs&&0!=n.length){w=new THREE.UV;if(s instanceof THREE.Face3)w.u=n[s.a].u+n[s.b].u+n[s.c].u,w.v=n[s.a].v+n[s.b].v+n[s.c].v,w.u/=3,w.v/=3;else if(s instanceof THREE.Face4)w.u=
+n[s.a].u+n[s.b].u+n[s.c].u+n[s.d].u,w.v=n[s.a].v+n[s.b].v+n[s.c].v+n[s.d].v,w.u/=4,w.v/=4;n.push(w)}q=function(a){function b(a,c,d){void 0===a[c]&&(a[c]=[]);a[c].push(d)}var d,e,g,f,h={};for(d=0,e=a.faces.length;d<e;d++)g=a.faces[d],g instanceof THREE.Face3?(f=c(g.a,g.b),b(h,f,d),f=c(g.b,g.c),b(h,f,d),f=c(g.c,g.a),b(h,f,d)):g instanceof THREE.Face4&&(f=c(g.a,g.b),b(h,f,d),f=c(g.b,g.c),b(h,f,d),f=c(g.c,g.d),b(h,f,d),f=c(g.d,g.a),b(h,f,d));return h}(a);var u=0,t=h.length,v,y,C={},A={},B=function(a,
+b){void 0===C[a]&&(C[a]=[]);C[a].push(b)},D=function(a,b){void 0===A[a]&&(A[a]={});A[a][b]=null};for(o in q){w=q[o];v=o.split("_");y=v[0];v=v[1];B(y,[y,v]);B(v,[y,v]);for(m=0,r=w.length;m<r;m++)s=w[m],D(y,s,o),D(v,s,o);2>w.length&&(p[o]=!0)}for(o in q)if(w=q[o],s=w[0],w=w[1],v=o.split("_"),y=v[0],v=v[1],r=new THREE.Vector3,p[o]?(r.addSelf(h[y].position),r.addSelf(h[v].position),r.multiplyScalar(0.5)):(r.addSelf(l[s]),r.addSelf(l[w]),r.addSelf(h[y].position),r.addSelf(h[v].position),r.multiplyScalar(0.25)),
+k[o]=t+d.length+u,i.push(new THREE.Vertex(r)),u++,f.supportUVs&&0!=n.length)w=new THREE.UV,w.u=n[y].u+n[v].u,w.v=n[y].v+n[v].v,w.u/=2,w.v/=2,n.push(w);var J,N;v=["123","12","2","23"];r=["123","23","3","31"];var B=["123","31","1","12"],D=["1234","12","2","23"],S=["1234","23","3","34"],K=["1234","34","4","41"],P=["1234","41","1","12"];for(o=0,q=l.length;o<q;o++)s=d[o],w=t+o,s instanceof THREE.Face3?(u=c(s.a,s.b),y=c(s.b,s.c),J=c(s.c,s.a),b(w,k[u],s.b,k[y],s,v),b(w,k[y],s.c,k[J],s,r),b(w,k[J],s.a,k[u],
+s,B)):s instanceof THREE.Face4?(u=c(s.a,s.b),y=c(s.b,s.c),J=c(s.c,s.d),N=c(s.d,s.a),b(w,k[u],s.b,k[y],s,D),b(w,k[y],s.c,k[J],s,S),b(w,k[J],s.d,k[N],s,K),b(w,k[N],s.a,k[u],s,P)):console.log("face should be a face!",s);d=i;i=new THREE.Vector3;k=new THREE.Vector3;for(o=0,q=h.length;o<q;o++)if(void 0!==C[o]){i.set(0,0,0);k.set(0,0,0);s=new THREE.Vector3(0,0,0);w=0;for(m in A[o])i.addSelf(l[m]),w++;u=0;t=C[o].length;for(m=0;m<t;m++)p[c(C[o][m][0],C[o][m][1])]&&u++;if(2!=u){i.divideScalar(w);for(m=0;m<
+t;m++)w=C[o][m],w=h[w[0]].position.clone().addSelf(h[w[1]].position).divideScalar(2),k.addSelf(w);k.divideScalar(t);s.addSelf(h[o].position);s.multiplyScalar(t-3);s.addSelf(i);s.addSelf(k.multiplyScalar(2));s.divideScalar(t);d[o].position=s}}a.vertices=d;a.faces=e;a.faceVertexUvs[0]=g;delete a.__tmpVertices;a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals()};
 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=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:"anonymous",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?b+((100*a.loaded/
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:"anonymous",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?b+((100*a.loaded/
 a.total).toFixed(0)+"%"):b+((a.loaded/1E3).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlbase:function(a){a=a.split("/");a.pop();return 1>a.length?"":a.join("/")+"/"},initMaterials:function(a,b,c){a.materials=[];for(var d=0;d<b.length;++d)a.materials[d]=THREE.Loader.prototype.createMaterial(b[d],c)},hasNormals:function(a){var b,c,d=a.materials.length;for(c=0;c<d;c++)if(b=a.materials[c],b instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=
 a.total).toFixed(0)+"%"):b+((a.loaded/1E3).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlbase:function(a){a=a.split("/");a.pop();return 1>a.length?"":a.join("/")+"/"},initMaterials:function(a,b,c){a.materials=[];for(var d=0;d<b.length;++d)a.materials[d]=THREE.Loader.prototype.createMaterial(b[d],c)},hasNormals:function(a){var b,c,d=a.materials.length;for(c=0;c<d;c++)if(b=a.materials[c],b instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=
 Math.log(a)/Math.LN2;return Math.floor(a)==a}function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function e(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!c(this.height)){var b=d(this.width),e=d(this.height);a.image.width=b;a.image.height=e;a.image.getContext("2d").drawImage(this,0,0,b,e)}else a.image=this;a.needsUpdate=!0};e.crossOrigin=h.crossOrigin;e.src=b}function g(a,c,d,g,f,h){var i=document.createElement("canvas");a[c]=new THREE.Texture(i);a[c].sourceFile=d;
 Math.log(a)/Math.LN2;return Math.floor(a)==a}function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function e(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!c(this.height)){var b=d(this.width),e=d(this.height);a.image.width=b;a.image.height=e;a.image.getContext("2d").drawImage(this,0,0,b,e)}else a.image=this;a.needsUpdate=!0};e.crossOrigin=h.crossOrigin;e.src=b}function g(a,c,d,g,f,h){var i=document.createElement("canvas");a[c]=new THREE.Texture(i);a[c].sourceFile=d;
-if(g){a[c].repeat.set(g[0],g[1]);if(1!=g[0])a[c].wrapS=THREE.RepeatWrapping;if(1!=g[1])a[c].wrapT=THREE.RepeatWrapping}f&&a[c].offset.set(f[0],f[1]);if(h){g={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(void 0!==g[h[0]])a[c].wrapS=g[h[0]];if(void 0!==g[h[1]])a[c].wrapT=g[h[1]]}e(a[c],b+"/"+d)}function f(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var h=this,i="MeshLambertMaterial",k={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:a.wireframe};a.shading&&
-("Phong"==a.shading?i="MeshPhongMaterial":"Basic"==a.shading&&(i="MeshBasicMaterial"));if(a.blending)if("Additive"==a.blending)k.blending=THREE.AdditiveBlending;else if("Subtractive"==a.blending)k.blending=THREE.SubtractiveBlending;else if("Multiply"==a.blending)k.blending=THREE.MultiplyBlending;if(void 0!==a.transparent||1>a.opacity)k.transparent=a.transparent;if(void 0!==a.depthTest)k.depthTest=a.depthTest;if(void 0!==a.vertexColors)if("face"==a.vertexColors)k.vertexColors=THREE.FaceColors;else if(a.vertexColors)k.vertexColors=
-THREE.VertexColors;if(a.colorDiffuse)k.color=f(a.colorDiffuse);else if(a.DbgColor)k.color=a.DbgColor;if(a.colorSpecular)k.specular=f(a.colorSpecular);if(a.colorAmbient)k.ambient=f(a.colorAmbient);if(a.transparency)k.opacity=a.transparency;if(a.specularCoef)k.shininess=a.specularCoef;a.mapDiffuse&&b&&g(k,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap);a.mapLight&&b&&g(k,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap);a.mapNormal&&b&&g(k,"normalMap",
-a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap);a.mapSpecular&&b&&g(k,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap);if(a.mapNormal){var i=THREE.ShaderUtils.lib.normal,l=THREE.UniformsUtils.clone(i.uniforms);l.tNormal.texture=k.normalMap;if(a.mapNormalFactor)l.uNormalScale.value=a.mapNormalFactor;if(k.map)l.tDiffuse.texture=k.map,l.enableDiffuse.value=!0;if(k.specularMap)l.tSpecular.texture=k.specularMap,l.enableSpecular.value=!0;if(k.lightMap)l.tAO.texture=
-k.lightMap,l.enableAO.value=!0;l.uDiffuseColor.value.setHex(k.color);l.uSpecularColor.value.setHex(k.specular);l.uAmbientColor.value.setHex(k.ambient);l.uShininess.value=k.shininess;if(void 0!==k.opacity)l.uOpacity.value=k.opacity;k=new THREE.ShaderMaterial({fragmentShader:i.fragmentShader,vertexShader:i.vertexShader,uniforms:l,lights:!0,fog:!0})}else k=new THREE[i](k);if(void 0!==a.DbgName)k.name=a.DbgName;return k}};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};
+if(g){a[c].repeat.set(g[0],g[1]);if(1!=g[0])a[c].wrapS=THREE.RepeatWrapping;if(1!=g[1])a[c].wrapT=THREE.RepeatWrapping}f&&a[c].offset.set(f[0],f[1]);if(h){g={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(void 0!==g[h[0]])a[c].wrapS=g[h[0]];if(void 0!==g[h[1]])a[c].wrapT=g[h[1]]}e(a[c],b+"/"+d)}function f(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var h=this,i="MeshLambertMaterial",l={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:a.wireframe};a.shading&&
+("Phong"==a.shading?i="MeshPhongMaterial":"Basic"==a.shading&&(i="MeshBasicMaterial"));if(a.blending)if("Additive"==a.blending)l.blending=THREE.AdditiveBlending;else if("Subtractive"==a.blending)l.blending=THREE.SubtractiveBlending;else if("Multiply"==a.blending)l.blending=THREE.MultiplyBlending;if(void 0!==a.transparent||1>a.opacity)l.transparent=a.transparent;if(void 0!==a.depthTest)l.depthTest=a.depthTest;if(void 0!==a.vertexColors)if("face"==a.vertexColors)l.vertexColors=THREE.FaceColors;else if(a.vertexColors)l.vertexColors=
+THREE.VertexColors;if(a.colorDiffuse)l.color=f(a.colorDiffuse);else if(a.DbgColor)l.color=a.DbgColor;if(a.colorSpecular)l.specular=f(a.colorSpecular);if(a.colorAmbient)l.ambient=f(a.colorAmbient);if(a.transparency)l.opacity=a.transparency;if(a.specularCoef)l.shininess=a.specularCoef;a.mapDiffuse&&b&&g(l,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap);a.mapLight&&b&&g(l,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap);a.mapNormal&&b&&g(l,"normalMap",
+a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap);a.mapSpecular&&b&&g(l,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap);if(a.mapNormal){var i=THREE.ShaderUtils.lib.normal,k=THREE.UniformsUtils.clone(i.uniforms);k.tNormal.texture=l.normalMap;if(a.mapNormalFactor)k.uNormalScale.value=a.mapNormalFactor;if(l.map)k.tDiffuse.texture=l.map,k.enableDiffuse.value=!0;if(l.specularMap)k.tSpecular.texture=l.specularMap,k.enableSpecular.value=!0;if(l.lightMap)k.tAO.texture=
+l.lightMap,k.enableAO.value=!0;k.uDiffuseColor.value.setHex(l.color);k.uSpecularColor.value.setHex(l.specular);k.uAmbientColor.value.setHex(l.ambient);k.uShininess.value=l.shininess;if(void 0!==l.opacity)k.uOpacity.value=l.opacity;l=new THREE.ShaderMaterial({fragmentShader:i.fragmentShader,vertexShader:i.vertexShader,uniforms:k,lights:!0,fog:!0})}else l=new THREE[i](l);if(void 0!==a.DbgName)l.name=a.DbgName;return l}};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=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
 THREE.BinaryLoader.prototype.load=function(a,b,c,d){if(a instanceof Object)console.warn("DEPRECATED: BinaryLoader( parameters ) is now BinaryLoader( url, callback, texturePath, binaryPath )."),d=a,a=d.model,b=d.callback,c=d.texture_path,d=d.bin_path;var c=c?c:this.extractUrlbase(a),d=d?d:this.extractUrlbase(a),e=this.showProgress?THREE.Loader.prototype.updateProgress:null;this.onLoadStart();this.loadAjaxJSON(this,a,b,c,d,e)};
 THREE.BinaryLoader.prototype.load=function(a,b,c,d){if(a instanceof Object)console.warn("DEPRECATED: BinaryLoader( parameters ) is now BinaryLoader( url, callback, texturePath, binaryPath )."),d=a,a=d.model,b=d.callback,c=d.texture_path,d=d.bin_path;var c=c?c:this.extractUrlbase(a),d=d?d:this.extractUrlbase(a),e=this.showProgress?THREE.Loader.prototype.updateProgress:null;this.onLoadStart();this.loadAjaxJSON(this,a,b,c,d,e)};
 THREE.BinaryLoader.prototype.loadAjaxJSON=function(a,b,c,d,e,g){var f=new XMLHttpRequest;f.onreadystatechange=function(){if(4==f.readyState)if(200==f.status||0==f.status)try{var h=JSON.parse(f.responseText);void 0===h.metadata||void 0===h.metadata.formatVersion||3!==h.metadata.formatVersion?console.error("Deprecated file format."):a.loadAjaxBuffers(h,c,e,d,g)}catch(i){console.error(i),console.warn("DEPRECATED: ["+b+"] seems to be using old model format")}else console.error("Couldn't load ["+b+"] ["+
 THREE.BinaryLoader.prototype.loadAjaxJSON=function(a,b,c,d,e,g){var f=new XMLHttpRequest;f.onreadystatechange=function(){if(4==f.readyState)if(200==f.status||0==f.status)try{var h=JSON.parse(f.responseText);void 0===h.metadata||void 0===h.metadata.formatVersion||3!==h.metadata.formatVersion?console.error("Deprecated file format."):a.loadAjaxBuffers(h,c,e,d,g)}catch(i){console.error(i),console.warn("DEPRECATED: ["+b+"] seems to be using old model format")}else console.error("Couldn't load ["+b+"] ["+
 f.status+"]")};f.open("GET",b,!0);f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined");f.setRequestHeader("Content-Type","text/plain");f.send(null)};
 f.status+"]")};f.open("GET",b,!0);f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined");f.setRequestHeader("Content-Type","text/plain");f.send(null)};
 THREE.BinaryLoader.prototype.loadAjaxBuffers=function(a,b,c,d,e){var g=new XMLHttpRequest,f=c+"/"+a.buffers,h=0;g.onreadystatechange=function(){4==g.readyState?200==g.status||0==g.status?THREE.BinaryLoader.prototype.createBinModel(g.response,b,d,a.materials):console.error("Couldn't load ["+f+"] ["+g.status+"]"):3==g.readyState?e&&(0==h&&(h=g.getResponseHeader("Content-Length")),e({total:h,loaded:g.responseText.length})):2==g.readyState&&(h=g.getResponseHeader("Content-Length"))};g.open("GET",f,!0);
 THREE.BinaryLoader.prototype.loadAjaxBuffers=function(a,b,c,d,e){var g=new XMLHttpRequest,f=c+"/"+a.buffers,h=0;g.onreadystatechange=function(){4==g.readyState?200==g.status||0==g.status?THREE.BinaryLoader.prototype.createBinModel(g.response,b,d,a.materials):console.error("Couldn't load ["+f+"] ["+g.status+"]"):3==g.readyState?e&&(0==h&&(h=g.getResponseHeader("Content-Length")),e({total:h,loaded:g.responseText.length})):2==g.readyState&&(h=g.getResponseHeader("Content-Length"))};g.open("GET",f,!0);
 g.responseType="arraybuffer";g.send(null)};
 g.responseType="arraybuffer";g.send(null)};
-THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,d){var e=function(b){var c,e,i,k,l,p,n,o,q,m,r,s,t,w,u,v;function y(a){return a%4?4-a%4:0}function D(a,b){return(new Uint8Array(a,b,1))[0]}function A(a,b){return(new Uint32Array(a,b,1))[0]}function C(b,c){var d,e,g,f,h,i,k,m,l=new Uint32Array(a,c,3*b);for(d=0;d<b;d++){e=l[3*d];g=l[3*d+1];f=l[3*d+2];h=j[2*e];e=j[2*e+1];i=j[2*g];k=j[2*g+1];g=j[2*f];m=j[2*f+1];f=P.faceVertexUvs[0];var n=[];n.push(new THREE.UV(h,e));n.push(new THREE.UV(i,k));
-n.push(new THREE.UV(g,m));f.push(n)}}function E(b,c){var d,e,g,f,h,i,k,m,l,n,o=new Uint32Array(a,c,4*b);for(d=0;d<b;d++){e=o[4*d];g=o[4*d+1];f=o[4*d+2];h=o[4*d+3];i=j[2*e];e=j[2*e+1];k=j[2*g];l=j[2*g+1];m=j[2*f];n=j[2*f+1];f=j[2*h];g=j[2*h+1];h=P.faceVertexUvs[0];var p=[];p.push(new THREE.UV(i,e));p.push(new THREE.UV(k,l));p.push(new THREE.UV(m,n));p.push(new THREE.UV(f,g));h.push(p)}}function J(b,c,d){for(var e,g,f,h,c=new Uint32Array(a,c,3*b),j=new Uint16Array(a,d,b),d=0;d<b;d++)e=c[3*d],g=c[3*
-d+1],f=c[3*d+2],h=j[d],P.faces.push(new THREE.Face3(e,g,f,null,null,h))}function N(b,c,d){for(var e,g,f,h,j,c=new Uint32Array(a,c,4*b),i=new Uint16Array(a,d,b),d=0;d<b;d++)e=c[4*d],g=c[4*d+1],f=c[4*d+2],h=c[4*d+3],j=i[d],P.faces.push(new THREE.Face4(e,g,f,h,null,null,j))}function T(b,c,d,e){for(var g,f,h,j,i,k,m,c=new Uint32Array(a,c,3*b),d=new Uint32Array(a,d,3*b),l=new Uint16Array(a,e,b),e=0;e<b;e++){g=c[3*e];f=c[3*e+1];h=c[3*e+2];i=d[3*e];k=d[3*e+1];m=d[3*e+2];j=l[e];var n=H[3*k],o=H[3*k+1];k=
+THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,d){var e=function(b){var c,e,i,l,k,p,n,o,q,m,r,s,t,w,u,v;function y(a){return a%4?4-a%4:0}function C(a,b){return(new Uint8Array(a,b,1))[0]}function A(a,b){return(new Uint32Array(a,b,1))[0]}function B(b,c){var d,e,g,f,h,i,k,m,l=new Uint32Array(a,c,3*b);for(d=0;d<b;d++){e=l[3*d];g=l[3*d+1];f=l[3*d+2];h=j[2*e];e=j[2*e+1];i=j[2*g];k=j[2*g+1];g=j[2*f];m=j[2*f+1];f=P.faceVertexUvs[0];var n=[];n.push(new THREE.UV(h,e));n.push(new THREE.UV(i,k));
+n.push(new THREE.UV(g,m));f.push(n)}}function D(b,c){var d,e,g,f,h,i,k,m,l,n,o=new Uint32Array(a,c,4*b);for(d=0;d<b;d++){e=o[4*d];g=o[4*d+1];f=o[4*d+2];h=o[4*d+3];i=j[2*e];e=j[2*e+1];k=j[2*g];l=j[2*g+1];m=j[2*f];n=j[2*f+1];f=j[2*h];g=j[2*h+1];h=P.faceVertexUvs[0];var p=[];p.push(new THREE.UV(i,e));p.push(new THREE.UV(k,l));p.push(new THREE.UV(m,n));p.push(new THREE.UV(f,g));h.push(p)}}function J(b,c,d){for(var e,g,f,h,c=new Uint32Array(a,c,3*b),j=new Uint16Array(a,d,b),d=0;d<b;d++)e=c[3*d],g=c[3*
+d+1],f=c[3*d+2],h=j[d],P.faces.push(new THREE.Face3(e,g,f,null,null,h))}function N(b,c,d){for(var e,g,f,h,j,c=new Uint32Array(a,c,4*b),i=new Uint16Array(a,d,b),d=0;d<b;d++)e=c[4*d],g=c[4*d+1],f=c[4*d+2],h=c[4*d+3],j=i[d],P.faces.push(new THREE.Face4(e,g,f,h,null,null,j))}function S(b,c,d,e){for(var g,f,h,j,i,k,m,c=new Uint32Array(a,c,3*b),d=new Uint32Array(a,d,3*b),l=new Uint16Array(a,e,b),e=0;e<b;e++){g=c[3*e];f=c[3*e+1];h=c[3*e+2];i=d[3*e];k=d[3*e+1];m=d[3*e+2];j=l[e];var n=H[3*k],o=H[3*k+1];k=
 H[3*k+2];var p=H[3*m],q=H[3*m+1];m=H[3*m+2];P.faces.push(new THREE.Face3(g,f,h,[new THREE.Vector3(H[3*i],H[3*i+1],H[3*i+2]),new THREE.Vector3(n,o,k),new THREE.Vector3(p,q,m)],null,j))}}function K(b,c,d,e){for(var g,f,h,j,i,k,m,l,n,c=new Uint32Array(a,c,4*b),d=new Uint32Array(a,d,4*b),o=new Uint16Array(a,e,b),e=0;e<b;e++){g=c[4*e];f=c[4*e+1];h=c[4*e+2];j=c[4*e+3];k=d[4*e];m=d[4*e+1];l=d[4*e+2];n=d[4*e+3];i=o[e];var p=H[3*m],q=H[3*m+1];m=H[3*m+2];var r=H[3*l],s=H[3*l+1];l=H[3*l+2];var t=H[3*n],u=H[3*
 H[3*k+2];var p=H[3*m],q=H[3*m+1];m=H[3*m+2];P.faces.push(new THREE.Face3(g,f,h,[new THREE.Vector3(H[3*i],H[3*i+1],H[3*i+2]),new THREE.Vector3(n,o,k),new THREE.Vector3(p,q,m)],null,j))}}function K(b,c,d,e){for(var g,f,h,j,i,k,m,l,n,c=new Uint32Array(a,c,4*b),d=new Uint32Array(a,d,4*b),o=new Uint16Array(a,e,b),e=0;e<b;e++){g=c[4*e];f=c[4*e+1];h=c[4*e+2];j=c[4*e+3];k=d[4*e];m=d[4*e+1];l=d[4*e+2];n=d[4*e+3];i=o[e];var p=H[3*m],q=H[3*m+1];m=H[3*m+2];var r=H[3*l],s=H[3*l+1];l=H[3*l+2];var t=H[3*n],u=H[3*
-n+1];n=H[3*n+2];P.faces.push(new THREE.Face4(g,f,h,j,[new THREE.Vector3(H[3*k],H[3*k+1],H[3*k+2]),new THREE.Vector3(p,q,m),new THREE.Vector3(r,s,l),new THREE.Vector3(t,u,n)],null,i))}}var P=this,M=0,H=[],j=[],Y,B;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(P,d,b);c=function(a,b,c){for(var a=new Uint8Array(a,b,c),d="",e=0;e<c;e++)d+=String.fromCharCode(a[b+e]);return d}(a,M,12);e=D(a,M+12);D(a,M+13);D(a,M+14);D(a,M+15);i=D(a,M+16);k=D(a,M+17);l=D(a,M+18);p=D(a,M+19);n=A(a,M+20);
-o=A(a,M+20+4);q=A(a,M+20+8);b=A(a,M+20+12);m=A(a,M+20+16);r=A(a,M+20+20);s=A(a,M+20+24);t=A(a,M+20+28);w=A(a,M+20+32);u=A(a,M+20+36);v=A(a,M+20+40);"Three.js 003"!==c&&console.warn("DEPRECATED: binary model seems to be using old format");M+=e;c=3*i+p;B=4*i+p;e=b*c;Y=m*(c+3*k);i=r*(c+3*l);p=s*(c+3*k+3*l);c=t*B;k=w*(B+4*k);l=u*(B+4*l);M+=function(b){var b=new Float32Array(a,b,3*n),c,d,e,g;for(c=0;c<n;c++)d=b[3*c],e=b[3*c+1],g=b[3*c+2],P.vertices.push(new THREE.Vertex(new THREE.Vector3(d,e,g)));return 3*
-n*Float32Array.BYTES_PER_ELEMENT}(M);M+=function(b){if(o){var b=new Int8Array(a,b,3*o),c,d,e,g;for(c=0;c<o;c++)d=b[3*c],e=b[3*c+1],g=b[3*c+2],H.push(d/127,e/127,g/127)}return 3*o*Int8Array.BYTES_PER_ELEMENT}(M);M+=y(3*o);M+=function(b){if(q){var b=new Float32Array(a,b,2*q),c,d,e;for(c=0;c<q;c++)d=b[2*c],e=b[2*c+1],j.push(d,e)}return 2*q*Float32Array.BYTES_PER_ELEMENT}(M);e=M+e+y(2*b);Y=e+Y+y(2*m);i=Y+i+y(2*r);p=i+p+y(2*s);c=p+c+y(2*t);k=c+k+y(2*w);l=k+l+y(2*u);(function(a){if(r){var b=a+3*r*Uint32Array.BYTES_PER_ELEMENT;
-J(r,a,b+3*r*Uint32Array.BYTES_PER_ELEMENT);C(r,b)}})(Y);(function(a){if(s){var b=a+3*s*Uint32Array.BYTES_PER_ELEMENT,c=b+3*s*Uint32Array.BYTES_PER_ELEMENT;T(s,a,b,c+3*s*Uint32Array.BYTES_PER_ELEMENT);C(s,c)}})(i);(function(a){if(u){var b=a+4*u*Uint32Array.BYTES_PER_ELEMENT;N(u,a,b+4*u*Uint32Array.BYTES_PER_ELEMENT);E(u,b)}})(k);(function(a){if(v){var b=a+4*v*Uint32Array.BYTES_PER_ELEMENT,c=b+4*v*Uint32Array.BYTES_PER_ELEMENT;K(v,a,b,c+4*v*Uint32Array.BYTES_PER_ELEMENT);E(v,c)}})(l);b&&J(b,M,M+3*b*
-Uint32Array.BYTES_PER_ELEMENT);(function(a){if(m){var b=a+3*m*Uint32Array.BYTES_PER_ELEMENT;T(m,a,b,b+3*m*Uint32Array.BYTES_PER_ELEMENT)}})(e);t&&N(t,p,p+4*t*Uint32Array.BYTES_PER_ELEMENT);(function(a){if(w){var b=a+4*w*Uint32Array.BYTES_PER_ELEMENT;K(w,a,b,b+4*w*Uint32Array.BYTES_PER_ELEMENT)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;b(new e(c))};
-THREE.ColladaLoader=function(){function a(a,d,e){R=a;d=d||Ua;void 0!==e&&(a=e.split("/"),a.pop(),$a=1>a.length?"":a.join("/")+"/");if((a=R.evaluate("//dae:asset",R,F,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&a.childNodes)for(e=0;e<a.childNodes.length;e++){var j=a.childNodes[e];switch(j.nodeName){case "unit":(j=j.getAttribute("meter"))&&parseFloat(j);break;case "up_axis":Ga=j.textContent.charAt(0)}}if(!Fa.convertUpAxis||Ga===Fa.upAxis)Xa=null;else switch(Ga){case "X":Xa="Y"===Fa.upAxis?
-"XtoY":"XtoZ";break;case "Y":Xa="X"===Fa.upAxis?"YtoX":"YtoZ";break;case "Z":Xa="X"===Fa.upAxis?"ZtoX":"ZtoY"}na=b("//dae:library_images/dae:image",f,"image");ib=b("//dae:library_materials/dae:material",A,"material");Va=b("//dae:library_effects/dae:effect",T,"effect");qa=b("//dae:library_geometries/dae:geometry",r,"geometry");lb=b(".//dae:library_cameras/dae:camera",Y,"camera");ra=b("//dae:library_controllers/dae:controller",h,"controller");Ia=b("//dae:library_animations/dae:animation",P,"animation");
-Wa=b(".//dae:library_visual_scenes/dae:visual_scene",l,"visual_scene");La=[];ta=[];(a=R.evaluate(".//dae:scene/dae:instance_visual_scene",R,F,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(a=a.getAttribute("url").replace(/^#/,""),ea=Wa[a]):ea=null;ba=new THREE.Object3D;for(a=0;a<ea.nodes.length;a++)ba.add(g(ea.nodes[a]));db=[];c(ba);a={scene:ba,morphs:La,skins:ta,animations:db,dae:{images:na,materials:ib,cameras:lb,effects:Va,geometries:qa,controllers:ra,animations:Ia,visualScenes:Wa,
-scene:ea}};d&&d(a);return a}function b(a,b,c){for(var a=R.evaluate(a,R,F,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),d={},e=a.iterateNext(),g=0;e;){e=(new b).parse(e);if(!e.id||0==e.id.length)e.id=c+g++;d[e.id]=e;e=a.iterateNext()}return d}function c(a){var b=ea.getChildById(a.name,!0),d=null;if(b&&b.keys){d={fps:60,hierarchy:[{node:b,keys:b.keys,sids:b.sids}],node:a,name:"animation_"+a.name,length:0};db.push(d);for(var e=0,g=b.keys.length;e<g;e++)d.length=Math.max(d.length,b.keys[e].time)}else d=
+n+1];n=H[3*n+2];P.faces.push(new THREE.Face4(g,f,h,j,[new THREE.Vector3(H[3*k],H[3*k+1],H[3*k+2]),new THREE.Vector3(p,q,m),new THREE.Vector3(r,s,l),new THREE.Vector3(t,u,n)],null,i))}}var P=this,M=0,H=[],j=[],X,F;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(P,d,b);c=function(a,b,c){for(var a=new Uint8Array(a,b,c),d="",e=0;e<c;e++)d+=String.fromCharCode(a[b+e]);return d}(a,M,12);e=C(a,M+12);C(a,M+13);C(a,M+14);C(a,M+15);i=C(a,M+16);l=C(a,M+17);k=C(a,M+18);p=C(a,M+19);n=A(a,M+20);
+o=A(a,M+20+4);q=A(a,M+20+8);b=A(a,M+20+12);m=A(a,M+20+16);r=A(a,M+20+20);s=A(a,M+20+24);t=A(a,M+20+28);w=A(a,M+20+32);u=A(a,M+20+36);v=A(a,M+20+40);"Three.js 003"!==c&&console.warn("DEPRECATED: binary model seems to be using old format");M+=e;c=3*i+p;F=4*i+p;e=b*c;X=m*(c+3*l);i=r*(c+3*k);p=s*(c+3*l+3*k);c=t*F;l=w*(F+4*l);k=u*(F+4*k);M+=function(b){var b=new Float32Array(a,b,3*n),c,d,e,g;for(c=0;c<n;c++)d=b[3*c],e=b[3*c+1],g=b[3*c+2],P.vertices.push(new THREE.Vertex(new THREE.Vector3(d,e,g)));return 3*
+n*Float32Array.BYTES_PER_ELEMENT}(M);M+=function(b){if(o){var b=new Int8Array(a,b,3*o),c,d,e,g;for(c=0;c<o;c++)d=b[3*c],e=b[3*c+1],g=b[3*c+2],H.push(d/127,e/127,g/127)}return 3*o*Int8Array.BYTES_PER_ELEMENT}(M);M+=y(3*o);M+=function(b){if(q){var b=new Float32Array(a,b,2*q),c,d,e;for(c=0;c<q;c++)d=b[2*c],e=b[2*c+1],j.push(d,e)}return 2*q*Float32Array.BYTES_PER_ELEMENT}(M);e=M+e+y(2*b);X=e+X+y(2*m);i=X+i+y(2*r);p=i+p+y(2*s);c=p+c+y(2*t);l=c+l+y(2*w);k=l+k+y(2*u);(function(a){if(r){var b=a+3*r*Uint32Array.BYTES_PER_ELEMENT;
+J(r,a,b+3*r*Uint32Array.BYTES_PER_ELEMENT);B(r,b)}})(X);(function(a){if(s){var b=a+3*s*Uint32Array.BYTES_PER_ELEMENT,c=b+3*s*Uint32Array.BYTES_PER_ELEMENT;S(s,a,b,c+3*s*Uint32Array.BYTES_PER_ELEMENT);B(s,c)}})(i);(function(a){if(u){var b=a+4*u*Uint32Array.BYTES_PER_ELEMENT;N(u,a,b+4*u*Uint32Array.BYTES_PER_ELEMENT);D(u,b)}})(l);(function(a){if(v){var b=a+4*v*Uint32Array.BYTES_PER_ELEMENT,c=b+4*v*Uint32Array.BYTES_PER_ELEMENT;K(v,a,b,c+4*v*Uint32Array.BYTES_PER_ELEMENT);D(v,c)}})(k);b&&J(b,M,M+3*b*
+Uint32Array.BYTES_PER_ELEMENT);(function(a){if(m){var b=a+3*m*Uint32Array.BYTES_PER_ELEMENT;S(m,a,b,b+3*m*Uint32Array.BYTES_PER_ELEMENT)}})(e);t&&N(t,p,p+4*t*Uint32Array.BYTES_PER_ELEMENT);(function(a){if(w){var b=a+4*w*Uint32Array.BYTES_PER_ELEMENT;K(w,a,b,b+4*w*Uint32Array.BYTES_PER_ELEMENT)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;b(new e(c))};
+THREE.ColladaLoader=function(){function a(a,d,e){Q=a;d=d||Ua;void 0!==e&&(a=e.split("/"),a.pop(),$a=1>a.length?"":a.join("/")+"/");if((a=Q.evaluate("//dae:asset",Q,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&a.childNodes)for(e=0;e<a.childNodes.length;e++){var j=a.childNodes[e];switch(j.nodeName){case "unit":(j=j.getAttribute("meter"))&&parseFloat(j);break;case "up_axis":Ga=j.textContent.charAt(0)}}if(!Fa.convertUpAxis||Ga===Fa.upAxis)Xa=null;else switch(Ga){case "X":Xa="Y"===Fa.upAxis?
+"XtoY":"XtoZ";break;case "Y":Xa="X"===Fa.upAxis?"YtoX":"YtoZ";break;case "Z":Xa="X"===Fa.upAxis?"ZtoX":"ZtoY"}ma=b("//dae:library_images/dae:image",f,"image");ib=b("//dae:library_materials/dae:material",A,"material");Va=b("//dae:library_effects/dae:effect",S,"effect");pa=b("//dae:library_geometries/dae:geometry",r,"geometry");lb=b(".//dae:library_cameras/dae:camera",X,"camera");ra=b("//dae:library_controllers/dae:controller",h,"controller");Ia=b("//dae:library_animations/dae:animation",P,"animation");
+Wa=b(".//dae:library_visual_scenes/dae:visual_scene",k,"visual_scene");La=[];ta=[];(a=Q.evaluate(".//dae:scene/dae:instance_visual_scene",Q,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(a=a.getAttribute("url").replace(/^#/,""),da=Wa[0<a.length?a:"visual_scene0"]):da=null;aa=new THREE.Object3D;for(a=0;a<da.nodes.length;a++)aa.add(g(da.nodes[a]));db=[];c(aa);a={scene:aa,morphs:La,skins:ta,animations:db,dae:{images:ma,materials:ib,cameras:lb,effects:Va,geometries:pa,controllers:ra,animations:Ia,
+visualScenes:Wa,scene:da}};d&&d(a);return a}function b(a,b,c){for(var a=Q.evaluate(a,Q,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),d={},e=a.iterateNext(),g=0;e;){e=(new b).parse(e);if(!e.id||0==e.id.length)e.id=c+g++;d[e.id]=e;e=a.iterateNext()}return d}function c(a){var b=da.getChildById(a.name,!0),d=null;if(b&&b.keys){d={fps:60,hierarchy:[{node:b,keys:b.keys,sids:b.sids}],node:a,name:"animation_"+a.name,length:0};db.push(d);for(var e=0,g=b.keys.length;e<g;e++)d.length=Math.max(d.length,b.keys[e].time)}else d=
 {hierarchy:[{keys:[],sids:[]}]};e=0;for(g=a.children.length;e<g;e++)for(var b=0,f=c(a.children[e]).hierarchy.length;b<f;b++)d.hierarchy.push({keys:[],sids:[]});return d}function d(a,b,c,e){a.world=a.world||new THREE.Matrix4;a.world.copy(a.matrix);if(a.channels&&a.channels.length){var g=a.channels[0].sampler.output[c];g instanceof THREE.Matrix4&&a.world.copy(g)}e&&a.world.multiply(e,a.world);b.push(a);for(e=0;e<a.nodes.length;e++)d(a.nodes[e],b,c,a.world)}function e(a,b,c){var e,g=ra[b.url];if(!g||
 {hierarchy:[{keys:[],sids:[]}]};e=0;for(g=a.children.length;e<g;e++)for(var b=0,f=c(a.children[e]).hierarchy.length;b<f;b++)d.hierarchy.push({keys:[],sids:[]});return d}function d(a,b,c,e){a.world=a.world||new THREE.Matrix4;a.world.copy(a.matrix);if(a.channels&&a.channels.length){var g=a.channels[0].sampler.output[c];g instanceof THREE.Matrix4&&a.world.copy(g)}e&&a.world.multiply(e,a.world);b.push(a);for(e=0;e<a.nodes.length;e++)d(a.nodes[e],b,c,a.world)}function e(a,b,c){var e,g=ra[b.url];if(!g||
-!g.skin)console.log("ColladaLoader: Could not find skin controller.");else if(!b.skeleton||!b.skeleton.length)console.log("ColladaLoader: Could not find the skeleton for the skin. ");else{var c=1E6,f=-c,h=0;for(e in Ia)for(var j=Ia[e],i=0;i<j.sampler.length;i++){var k=j.sampler[i];k.create();c=Math.min(c,k.startTime);f=Math.max(f,k.endTime);h=Math.max(h,k.input.length)}e=h;for(var b=ea.getChildById(b.skeleton[0],!0)||ea.getChildBySid(b.skeleton[0],!0),m,l,f=new THREE.Vector3,n,i=0;i<a.vertices.length;i++)g.skin.bindShapeMatrix.multiplyVector3(a.vertices[i].position);
+!g.skin)console.log("ColladaLoader: Could not find skin controller.");else if(!b.skeleton||!b.skeleton.length)console.log("ColladaLoader: Could not find the skeleton for the skin. ");else{var c=1E6,f=-c,h=0;for(e in Ia)for(var j=Ia[e],i=0;i<j.sampler.length;i++){var k=j.sampler[i];k.create();c=Math.min(c,k.startTime);f=Math.max(f,k.endTime);h=Math.max(h,k.input.length)}e=h;for(var b=da.getChildById(b.skeleton[0],!0)||da.getChildBySid(b.skeleton[0],!0),m,l,f=new THREE.Vector3,n,i=0;i<a.vertices.length;i++)g.skin.bindShapeMatrix.multiplyVector3(a.vertices[i].position);
 for(c=0;c<e;c++){h=[];j=[];for(i=0;i<a.vertices.length;i++)j.push(new THREE.Vertex(new THREE.Vector3));d(b,h,c);i=h;k=g.skin;for(l=0;l<i.length;l++)if(m=i[l],n=-1,"JOINT"==m.type){for(var o=0;o<k.joints.length;o++)if(m.sid==k.joints[o]){n=o;break}if(0<=n){o=k.invBindMatrices[n];m.invBindMatrix=o;m.skinningMatrix=new THREE.Matrix4;m.skinningMatrix.multiply(m.world,o);m.weights=[];for(o=0;o<k.weights.length;o++)for(var p=0;p<k.weights[o].length;p++){var q=k.weights[o][p];q.joint==n&&m.weights.push(q)}}else throw"ColladaLoader: Could not find joint '"+
 for(c=0;c<e;c++){h=[];j=[];for(i=0;i<a.vertices.length;i++)j.push(new THREE.Vertex(new THREE.Vector3));d(b,h,c);i=h;k=g.skin;for(l=0;l<i.length;l++)if(m=i[l],n=-1,"JOINT"==m.type){for(var o=0;o<k.joints.length;o++)if(m.sid==k.joints[o]){n=o;break}if(0<=n){o=k.invBindMatrices[n];m.invBindMatrix=o;m.skinningMatrix=new THREE.Matrix4;m.skinningMatrix.multiply(m.world,o);m.weights=[];for(o=0;o<k.weights.length;o++)for(var p=0;p<k.weights[o].length;p++){var q=k.weights[o][p];q.joint==n&&m.weights.push(q)}}else throw"ColladaLoader: Could not find joint '"+
-m.sid+"'.";}for(i=0;i<h.length;i++)if("JOINT"==h[i].type)for(k=0;k<h[i].weights.length;k++)m=h[i].weights[k],l=m.index,m=m.weight,n=a.vertices[l],l=j[l],f.x=n.position.x,f.y=n.position.y,f.z=n.position.z,h[i].skinningMatrix.multiplyVector3(f),l.position.x+=f.x*m,l.position.y+=f.y*m,l.position.z+=f.z*m;a.morphTargets.push({name:"target_"+c,vertices:j})}}}function g(a){var b=new THREE.Object3D,c,d,f,h;for(f=0;f<a.controllers.length;f++){var j=ra[a.controllers[f].url];switch(j.type){case "skin":if(qa[j.skin.source]){var i=
-new m;i.url=j.skin.source;i.instance_material=a.controllers[f].instance_material;a.geometries.push(i);c=a.controllers[f]}else if(ra[j.skin.source]&&(d=j=ra[j.skin.source],j.morph&&qa[j.morph.source]))i=new m,i.url=j.morph.source,i.instance_material=a.controllers[f].instance_material,a.geometries.push(i);break;case "morph":if(qa[j.morph.source])i=new m,i.url=j.morph.source,i.instance_material=a.controllers[f].instance_material,a.geometries.push(i),d=a.controllers[f];console.log("ColladaLoader: Morph-controller partially supported.")}}for(f=
-0;f<a.geometries.length;f++){var j=a.geometries[f],i=j.instance_material,j=qa[j.url],k={},l=[],n=0,p;if(j&&j.mesh&&j.mesh.primitives){if(0==b.name.length)b.name=j.id;if(i)for(h=0;h<i.length;h++){p=i[h];var q=ib[p.target],r=Va[q.instance_effect.url].shader;r.material.opacity=!r.material.opacity?1:r.material.opacity;k[p.symbol]=n;l.push(r.material);p=r.material;p.name=null==q.name||""===q.name?q.id:q.name;n++}i=p||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});j=j.mesh.geometry3js;
-if(1<n){i=new THREE.MeshFaceMaterial;j.materials=l;for(h=0;h<j.faces.length;h++)l=j.faces[h],l.materialIndex=k[l.daeMaterial]}if(void 0!==c)e(j,c),i.morphTargets=!0,i=new THREE.SkinnedMesh(j,i),i.skeleton=c.skeleton,i.skinController=ra[c.url],i.skinInstanceController=c,i.name="skin_"+ta.length,ta.push(i);else if(void 0!==d){h=j;k=d instanceof o?ra[d.url]:d;if(!k||!k.morph)console.log("could not find morph controller!");else{k=k.morph;for(l=0;l<k.targets.length;l++)if(n=qa[k.targets[l]],n.mesh&&n.mesh.primitives&&
+m.sid+"'.";}for(i=0;i<h.length;i++)if("JOINT"==h[i].type)for(k=0;k<h[i].weights.length;k++)m=h[i].weights[k],l=m.index,m=m.weight,n=a.vertices[l],l=j[l],f.x=n.position.x,f.y=n.position.y,f.z=n.position.z,h[i].skinningMatrix.multiplyVector3(f),l.position.x+=f.x*m,l.position.y+=f.y*m,l.position.z+=f.z*m;a.morphTargets.push({name:"target_"+c,vertices:j})}}}function g(a){var b=new THREE.Object3D,c,d,f,h;for(f=0;f<a.controllers.length;f++){var j=ra[a.controllers[f].url];switch(j.type){case "skin":if(pa[j.skin.source]){var i=
+new m;i.url=j.skin.source;i.instance_material=a.controllers[f].instance_material;a.geometries.push(i);c=a.controllers[f]}else if(ra[j.skin.source]&&(d=j=ra[j.skin.source],j.morph&&pa[j.morph.source]))i=new m,i.url=j.morph.source,i.instance_material=a.controllers[f].instance_material,a.geometries.push(i);break;case "morph":if(pa[j.morph.source])i=new m,i.url=j.morph.source,i.instance_material=a.controllers[f].instance_material,a.geometries.push(i),d=a.controllers[f];console.log("ColladaLoader: Morph-controller partially supported.")}}for(f=
+0;f<a.geometries.length;f++){var j=a.geometries[f],i=j.instance_material,j=pa[j.url],k={},l=[],n=0,p;if(j&&j.mesh&&j.mesh.primitives){if(0==b.name.length)b.name=j.id;if(i)for(h=0;h<i.length;h++){p=i[h];var q=ib[p.target],r=Va[q.instance_effect.url].shader;r.material.opacity=!r.material.opacity?1:r.material.opacity;k[p.symbol]=n;l.push(r.material);p=r.material;p.name=null==q.name||""===q.name?q.id:q.name;n++}i=p||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});j=j.mesh.geometry3js;
+if(1<n){i=new THREE.MeshFaceMaterial;j.materials=l;for(h=0;h<j.faces.length;h++)l=j.faces[h],l.materialIndex=k[l.daeMaterial]}if(void 0!==c)e(j,c),i.morphTargets=!0,i=new THREE.SkinnedMesh(j,i),i.skeleton=c.skeleton,i.skinController=ra[c.url],i.skinInstanceController=c,i.name="skin_"+ta.length,ta.push(i);else if(void 0!==d){h=j;k=d instanceof o?ra[d.url]:d;if(!k||!k.morph)console.log("could not find morph controller!");else{k=k.morph;for(l=0;l<k.targets.length;l++)if(n=pa[k.targets[l]],n.mesh&&n.mesh.primitives&&
 n.mesh.primitives.length)n=n.mesh.primitives[0].geometry,n.vertices.length===h.vertices.length&&h.morphTargets.push({name:"target_1",vertices:n.vertices});h.morphTargets.push({name:"target_Z",vertices:h.vertices})}i.morphTargets=!0;i=new THREE.Mesh(j,i);i.name="morph_"+La.length;La.push(i)}else i=new THREE.Mesh(j,i);1<a.geometries.length?b.add(i):b=i}}for(f=0;f<a.cameras.length;f++)b=lb[a.cameras[f].url],b=new THREE.PerspectiveCamera(b.fov,b.aspect_ratio,b.znear,b.zfar);b.name=a.id||"";b.matrix=a.matrix;
 n.mesh.primitives.length)n=n.mesh.primitives[0].geometry,n.vertices.length===h.vertices.length&&h.morphTargets.push({name:"target_1",vertices:n.vertices});h.morphTargets.push({name:"target_Z",vertices:h.vertices})}i.morphTargets=!0;i=new THREE.Mesh(j,i);i.name="morph_"+La.length;La.push(i)}else i=new THREE.Mesh(j,i);1<a.geometries.length?b.add(i):b=i}}for(f=0;f<a.cameras.length;f++)b=lb[a.cameras[f].url],b=new THREE.PerspectiveCamera(b.fov,b.aspect_ratio,b.znear,b.zfar);b.name=a.id||"";b.matrix=a.matrix;
-f=a.matrix.decompose();b.position=f[0];b.quaternion=f[1];b.useQuaternion=!0;b.scale=f[2];Fa.centerGeometry&&b.geometry&&(f=THREE.GeometryUtils.center(b.geometry),b.quaternion.multiplyVector3(f.multiplySelf(b.scale)),b.position.subSelf(f));for(f=0;f<a.nodes.length;f++)b.add(g(a.nodes[f],a));return b}function f(){this.init_from=this.id=""}function h(){this.type=this.name=this.id="";this.morph=this.skin=null}function i(){this.weights=this.targets=this.source=this.method=null}function k(){this.source=
-"";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function l(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function p(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=[];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function n(){this.type=this.sid="";this.data=[];this.obj=null}function o(){this.url="";this.skeleton=[];this.instance_material=[]}function q(){this.target=this.symbol=""}function m(){this.url=
-"";this.instance_material=[]}function r(){this.id="";this.mesh=null}function s(a){this.geometry=a.id;this.primitives=[];this.geometry3js=this.vertices=null}function t(){}function w(){this.material="";this.count=0;this.inputs=[];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function u(){this.source="";this.stride=this.count=0;this.params=[]}function v(){this.input={}}function y(){this.semantic="";this.offset=0;this.source="";this.set=0}function D(a){this.id=a;this.type=null}function A(){this.name=
-this.id="";this.instance_effect=null}function C(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texOpts=this.texcoord=this.texture=null}function E(a,b){this.type=a;this.effect=b;this.material=null}function J(a){this.effect=a;this.format=this.init_from=null}function N(a){this.effect=a;this.mipfilter=this.magfilter=this.minfilter=this.wrap_t=this.wrap_s=this.source=null}function T(){this.name=this.id="";this.sampler=this.surface=this.shader=
-null}function K(){this.url=""}function P(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function M(a){this.animation=a;this.target=this.source="";this.member=this.arrIndices=this.arrSyntax=this.dotSyntax=this.sid=this.fullSid=null}function H(a){this.id="";this.animation=a;this.inputs=[];this.endTime=this.startTime=this.interpolation=this.strideOut=this.output=this.input=null;this.duration=0}function j(a){this.targets=[];this.time=a}function Y(){this.name=this.id=""}function B(){this.url=
-""}function F(a){return"dae"==a?"http://www.collada.org/2005/11/COLLADASchema":null}function Z(a){for(var a=ga(a),b=[],c=0,d=a.length;c<d;c++)b.push(parseFloat(a[c]));return b}function O(a){for(var a=ga(a),b=[],c=0,d=a.length;c<d;c++)b.push(parseInt(a[c],10));return b}function ga(a){return 0<a.length?a.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s+/):[]}function da(a,b,c){return a.hasAttribute(b)?parseInt(a.getAttribute(b),10):c}function ia(a,b){if(Fa.convertUpAxis&&Ga!==Fa.upAxis)switch(Xa){case "XtoY":var c=
-a[0];a[0]=b*a[1];a[1]=c;break;case "XtoZ":c=a[2];a[2]=a[1];a[1]=a[0];a[0]=c;break;case "YtoX":c=a[0];a[0]=a[1];a[1]=b*c;break;case "YtoZ":c=a[1];a[1]=b*a[2];a[2]=c;break;case "ZtoX":c=a[0];a[0]=a[1];a[1]=a[2];a[2]=c;break;case "ZtoY":c=a[1],a[1]=a[2],a[2]=b*c}}function S(a,b){var c=[a[b],a[b+1],a[b+2]];ia(c,-1);return new THREE.Vector3(c[0],c[1],c[2])}function aa(a){if(Fa.convertUpAxis){var b=[a[0],a[4],a[8]];ia(b,-1);a[0]=b[0];a[4]=b[1];a[8]=b[2];b=[a[1],a[5],a[9]];ia(b,-1);a[1]=b[0];a[5]=b[1];a[9]=
-b[2];b=[a[2],a[6],a[10]];ia(b,-1);a[2]=b[0];a[6]=b[1];a[10]=b[2];b=[a[0],a[1],a[2]];ia(b,-1);a[0]=b[0];a[1]=b[1];a[2]=b[2];b=[a[4],a[5],a[6]];ia(b,-1);a[4]=b[0];a[5]=b[1];a[6]=b[2];b=[a[8],a[9],a[10]];ia(b,-1);a[8]=b[0];a[9]=b[1];a[10]=b[2];b=[a[3],a[7],a[11]];ia(b,-1);a[3]=b[0];a[7]=b[1];a[11]=b[2]}return new THREE.Matrix4(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15])}var R=null,ba=null,ea,Ua=null,Ha={},na={},Ia={},ra={},qa={},ib={},Va={},lb={},db,Wa,$a,La,
+f=a.matrix.decompose();b.position=f[0];b.quaternion=f[1];b.useQuaternion=!0;b.scale=f[2];Fa.centerGeometry&&b.geometry&&(f=THREE.GeometryUtils.center(b.geometry),b.quaternion.multiplyVector3(f.multiplySelf(b.scale)),b.position.subSelf(f));for(f=0;f<a.nodes.length;f++)b.add(g(a.nodes[f],a));return b}function f(){this.init_from=this.id=""}function h(){this.type=this.name=this.id="";this.morph=this.skin=null}function i(){this.weights=this.targets=this.source=this.method=null}function l(){this.source=
+"";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function k(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function p(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=[];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function n(){this.type=this.sid="";this.data=[];this.obj=null}function o(){this.url="";this.skeleton=[];this.instance_material=[]}function q(){this.target=this.symbol=""}function m(){this.url=
+"";this.instance_material=[]}function r(){this.id="";this.mesh=null}function s(a){this.geometry=a.id;this.primitives=[];this.geometry3js=this.vertices=null}function t(){}function w(){this.material="";this.count=0;this.inputs=[];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function u(){this.source="";this.stride=this.count=0;this.params=[]}function v(){this.input={}}function y(){this.semantic="";this.offset=0;this.source="";this.set=0}function C(a){this.id=a;this.type=null}function A(){this.name=
+this.id="";this.instance_effect=null}function B(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texOpts=this.texcoord=this.texture=null}function D(a,b){this.type=a;this.effect=b;this.material=null}function J(a){this.effect=a;this.format=this.init_from=null}function N(a){this.effect=a;this.mipfilter=this.magfilter=this.minfilter=this.wrap_t=this.wrap_s=this.source=null}function S(){this.name=this.id="";this.sampler=this.surface=this.shader=
+null}function K(){this.url=""}function P(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function M(a){this.animation=a;this.target=this.source="";this.member=this.arrIndices=this.arrSyntax=this.dotSyntax=this.sid=this.fullSid=null}function H(a){this.id="";this.animation=a;this.inputs=[];this.endTime=this.startTime=this.interpolation=this.strideOut=this.output=this.input=null;this.duration=0}function j(a){this.targets=[];this.time=a}function X(){this.name=this.id=""}function F(){this.url=
+""}function E(a){return"dae"==a?"http://www.collada.org/2005/11/COLLADASchema":null}function Y(a){for(var a=fa(a),b=[],c=0,d=a.length;c<d;c++)b.push(parseFloat(a[c]));return b}function O(a){for(var a=fa(a),b=[],c=0,d=a.length;c<d;c++)b.push(parseInt(a[c],10));return b}function fa(a){return 0<a.length?a.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s+/):[]}function ca(a,b,c){return a.hasAttribute(b)?parseInt(a.getAttribute(b),10):c}function ha(a,b){if(Fa.convertUpAxis&&Ga!==Fa.upAxis)switch(Xa){case "XtoY":var c=
+a[0];a[0]=b*a[1];a[1]=c;break;case "XtoZ":c=a[2];a[2]=a[1];a[1]=a[0];a[0]=c;break;case "YtoX":c=a[0];a[0]=a[1];a[1]=b*c;break;case "YtoZ":c=a[1];a[1]=b*a[2];a[2]=c;break;case "ZtoX":c=a[0];a[0]=a[1];a[1]=a[2];a[2]=c;break;case "ZtoY":c=a[1],a[1]=a[2],a[2]=b*c}}function R(a,b){var c=[a[b],a[b+1],a[b+2]];ha(c,-1);return new THREE.Vector3(c[0],c[1],c[2])}function $(a){if(Fa.convertUpAxis){var b=[a[0],a[4],a[8]];ha(b,-1);a[0]=b[0];a[4]=b[1];a[8]=b[2];b=[a[1],a[5],a[9]];ha(b,-1);a[1]=b[0];a[5]=b[1];a[9]=
+b[2];b=[a[2],a[6],a[10]];ha(b,-1);a[2]=b[0];a[6]=b[1];a[10]=b[2];b=[a[0],a[1],a[2]];ha(b,-1);a[0]=b[0];a[1]=b[1];a[2]=b[2];b=[a[4],a[5],a[6]];ha(b,-1);a[4]=b[0];a[5]=b[1];a[6]=b[2];b=[a[8],a[9],a[10]];ha(b,-1);a[8]=b[0];a[9]=b[1];a[10]=b[2];b=[a[3],a[7],a[11]];ha(b,-1);a[3]=b[0];a[7]=b[1];a[11]=b[2]}return new THREE.Matrix4(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15])}var Q=null,aa=null,da,Ua=null,Ha={},ma={},Ia={},ra={},pa={},ib={},Va={},lb={},db,Wa,$a,La,
 ta,Aa=THREE.SmoothShading,Fa={centerGeometry:!1,convertUpAxis:!1,subdivideFaces:!0,upAxis:"Y"},Ga="Y",Xa=null,mb=Math.PI/180;f.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if("init_from"==c.nodeName)this.init_from=c.textContent}return this};h.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.type="none";for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "skin":this.skin=
 ta,Aa=THREE.SmoothShading,Fa={centerGeometry:!1,convertUpAxis:!1,subdivideFaces:!0,upAxis:"Y"},Ga="Y",Xa=null,mb=Math.PI/180;f.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if("init_from"==c.nodeName)this.init_from=c.textContent}return this};h.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.type="none";for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "skin":this.skin=
-(new k).parse(c);this.type=c.nodeName;break;case "morph":this.morph=(new i).parse(c),this.type=c.nodeName}}return this};i.prototype.parse=function(a){var b={},c=[],d;this.method=a.getAttribute("method");this.source=a.getAttribute("source").replace(/^#/,"");for(d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if(1==e.nodeType)switch(e.nodeName){case "source":e=(new D).parse(e);b[e.id]=e;break;case "targets":c=this.parseInputs(e);break;default:console.log(e.nodeName)}}for(d=0;d<c.length;d++)switch(a=
-c[d],e=b[a.source],a.semantic){case "MORPH_TARGET":this.targets=e.read();break;case "MORPH_WEIGHT":this.weights=e.read()}return this};i.prototype.parseInputs=function(a){for(var b=[],c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "input":b.push((new y).parse(d))}}return b};k.prototype.parse=function(a){var b={},c,d;this.source=a.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var e=0;e<a.childNodes.length;e++){var f=
-a.childNodes[e];if(1==f.nodeType)switch(f.nodeName){case "bind_shape_matrix":f=Z(f.textContent);this.bindShapeMatrix=aa(f);break;case "source":f=(new D).parse(f);b[f.id]=f;break;case "joints":c=f;break;case "vertex_weights":d=f;break;default:console.log(f.nodeName)}}this.parseJoints(c,b);this.parseWeights(d,b);return this};k.prototype.parseJoints=function(a,b){for(var c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "input":var d=(new y).parse(d),e=b[d.source];
-if("JOINT"==d.semantic)this.joints=e.read();else if("INV_BIND_MATRIX"==d.semantic)this.invBindMatrices=e.read()}}};k.prototype.parseWeights=function(a,b){for(var c,d,e=[],f=0;f<a.childNodes.length;f++){var g=a.childNodes[f];if(1==g.nodeType)switch(g.nodeName){case "input":e.push((new y).parse(g));break;case "v":c=O(g.textContent);break;case "vcount":d=O(g.textContent)}}for(f=g=0;f<d.length;f++){for(var h=d[f],j=[],i=0;i<h;i++){for(var k={},m=0;m<e.length;m++){var l=e[m],n=c[g+l.offset];switch(l.semantic){case "JOINT":k.joint=
-n;break;case "WEIGHT":k.weight=b[l.source].data[n]}}j.push(k);g+=e.length}for(i=0;i<j.length;i++)j[i].index=f;this.weights.push(j)}};l.prototype.getChildById=function(a,b){for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildById(a,b);if(d)return d}return null};l.prototype.getChildBySid=function(a,b){for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildBySid(a,b);if(d)return d}return null};l.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");
+(new l).parse(c);this.type=c.nodeName;break;case "morph":this.morph=(new i).parse(c),this.type=c.nodeName}}return this};i.prototype.parse=function(a){var b={},c=[],d;this.method=a.getAttribute("method");this.source=a.getAttribute("source").replace(/^#/,"");for(d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if(1==e.nodeType)switch(e.nodeName){case "source":e=(new C).parse(e);b[e.id]=e;break;case "targets":c=this.parseInputs(e);break;default:console.log(e.nodeName)}}for(d=0;d<c.length;d++)switch(a=
+c[d],e=b[a.source],a.semantic){case "MORPH_TARGET":this.targets=e.read();break;case "MORPH_WEIGHT":this.weights=e.read()}return this};i.prototype.parseInputs=function(a){for(var b=[],c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "input":b.push((new y).parse(d))}}return b};l.prototype.parse=function(a){var b={},c,d;this.source=a.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var e=0;e<a.childNodes.length;e++){var f=
+a.childNodes[e];if(1==f.nodeType)switch(f.nodeName){case "bind_shape_matrix":f=Y(f.textContent);this.bindShapeMatrix=$(f);break;case "source":f=(new C).parse(f);b[f.id]=f;break;case "joints":c=f;break;case "vertex_weights":d=f;break;default:console.log(f.nodeName)}}this.parseJoints(c,b);this.parseWeights(d,b);return this};l.prototype.parseJoints=function(a,b){for(var c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "input":var d=(new y).parse(d),e=b[d.source];
+if("JOINT"==d.semantic)this.joints=e.read();else if("INV_BIND_MATRIX"==d.semantic)this.invBindMatrices=e.read()}}};l.prototype.parseWeights=function(a,b){for(var c,d,e=[],f=0;f<a.childNodes.length;f++){var g=a.childNodes[f];if(1==g.nodeType)switch(g.nodeName){case "input":e.push((new y).parse(g));break;case "v":c=O(g.textContent);break;case "vcount":d=O(g.textContent)}}for(f=g=0;f<d.length;f++){for(var h=d[f],j=[],i=0;i<h;i++){for(var k={},m=0;m<e.length;m++){var l=e[m],n=c[g+l.offset];switch(l.semantic){case "JOINT":k.joint=
+n;break;case "WEIGHT":k.weight=b[l.source].data[n]}}j.push(k);g+=e.length}for(i=0;i<j.length;i++)j[i].index=f;this.weights.push(j)}};k.prototype.getChildById=function(a,b){for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildById(a,b);if(d)return d}return null};k.prototype.getChildBySid=function(a,b){for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildBySid(a,b);if(d)return d}return null};k.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");
 this.nodes=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "node":this.nodes.push((new p).parse(c))}}return this};p.prototype.getChannelForTransform=function(a){for(var b=0;b<this.channels.length;b++){var c=this.channels[b],d=c.target.split("/");d.shift();var e=d.shift(),f=0<=e.indexOf("."),g=0<=e.indexOf("("),h;if(f)d=e.split("."),e=d.shift(),d.shift();else if(g){h=e.split("(");e=h.shift();for(d=0;d<h.length;d++)h[d]=parseInt(h[d].replace(/\)/,
 this.nodes=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "node":this.nodes.push((new p).parse(c))}}return this};p.prototype.getChannelForTransform=function(a){for(var b=0;b<this.channels.length;b++){var c=this.channels[b],d=c.target.split("/");d.shift();var e=d.shift(),f=0<=e.indexOf("."),g=0<=e.indexOf("("),h;if(f)d=e.split("."),e=d.shift(),d.shift();else if(g){h=e.split("(");e=h.shift();for(d=0;d<h.length;d++)h[d]=parseInt(h[d].replace(/\)/,
 ""))}if(e==a)return c.info={sid:e,dotSyntax:f,arrSyntax:g,arrIndices:h},c}return null};p.prototype.getChildById=function(a,b){if(this.id==a)return this;if(b)for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildById(a,b);if(d)return d}return null};p.prototype.getChildBySid=function(a,b){if(this.sid==a)return this;if(b)for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildBySid(a,b);if(d)return d}return null};p.prototype.getTransformBySid=function(a){for(var b=0;b<this.transforms.length;b++)if(this.transforms[b].sid==
 ""))}if(e==a)return c.info={sid:e,dotSyntax:f,arrSyntax:g,arrIndices:h},c}return null};p.prototype.getChildById=function(a,b){if(this.id==a)return this;if(b)for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildById(a,b);if(d)return d}return null};p.prototype.getChildBySid=function(a,b){if(this.sid==a)return this;if(b)for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildBySid(a,b);if(d)return d}return null};p.prototype.getTransformBySid=function(a){for(var b=0;b<this.transforms.length;b++)if(this.transforms[b].sid==
 a)return this.transforms[b];return null};p.prototype.parse=function(a){var b;this.id=a.getAttribute("id");this.sid=a.getAttribute("sid");this.name=a.getAttribute("name");this.type=a.getAttribute("type");this.type="JOINT"==this.type?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.cameras=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var c=0;c<a.childNodes.length;c++)if(b=a.childNodes[c],1==b.nodeType)switch(b.nodeName){case "node":this.nodes.push((new p).parse(b));
 a)return this.transforms[b];return null};p.prototype.parse=function(a){var b;this.id=a.getAttribute("id");this.sid=a.getAttribute("sid");this.name=a.getAttribute("name");this.type=a.getAttribute("type");this.type="JOINT"==this.type?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.cameras=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var c=0;c<a.childNodes.length;c++)if(b=a.childNodes[c],1==b.nodeType)switch(b.nodeName){case "node":this.nodes.push((new p).parse(b));
-break;case "instance_camera":this.cameras.push((new B).parse(b));break;case "instance_controller":this.controllers.push((new o).parse(b));break;case "instance_geometry":this.geometries.push((new m).parse(b));break;case "instance_light":break;case "instance_node":b=b.getAttribute("url").replace(/^#/,"");(b=R.evaluate(".//dae:library_nodes//dae:node[@id='"+b+"']",R,F,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new p).parse(b));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new n).parse(b));
+break;case "instance_camera":this.cameras.push((new F).parse(b));break;case "instance_controller":this.controllers.push((new o).parse(b));break;case "instance_geometry":this.geometries.push((new m).parse(b));break;case "instance_light":break;case "instance_node":b=b.getAttribute("url").replace(/^#/,"");(b=Q.evaluate(".//dae:library_nodes//dae:node[@id='"+b+"']",Q,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new p).parse(b));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new n).parse(b));
 break;case "extra":break;default:console.log(b.nodeName)}a=[];c=1E6;b=-1E6;for(var d in Ia)for(var e=Ia[d],f=0;f<e.channel.length;f++){var g=e.channel[f],h=e.sampler[f];d=g.target.split("/")[0];if(d==this.id)h.create(),g.sampler=h,c=Math.min(c,h.startTime),b=Math.max(b,h.endTime),a.push(g)}if(a.length)this.startTime=c,this.endTime=b;if((this.channels=a)&&this.channels.length){d=[];a=[];c=0;for(e=this.channels.length;c<e;c++){b=this.channels[c];f=b.fullSid;g=b.member;if(Fa.convertUpAxis)switch(g){case "X":switch(Xa){case "XtoY":case "XtoZ":case "YtoX":g=
 break;case "extra":break;default:console.log(b.nodeName)}a=[];c=1E6;b=-1E6;for(var d in Ia)for(var e=Ia[d],f=0;f<e.channel.length;f++){var g=e.channel[f],h=e.sampler[f];d=g.target.split("/")[0];if(d==this.id)h.create(),g.sampler=h,c=Math.min(c,h.startTime),b=Math.max(b,h.endTime),a.push(g)}if(a.length)this.startTime=c,this.endTime=b;if((this.channels=a)&&this.channels.length){d=[];a=[];c=0;for(e=this.channels.length;c<e;c++){b=this.channels[c];f=b.fullSid;g=b.member;if(Fa.convertUpAxis)switch(g){case "X":switch(Xa){case "XtoY":case "XtoZ":case "YtoX":g=
 "Y";break;case "ZtoX":g="Z"}break;case "Y":switch(Xa){case "XtoY":case "YtoX":case "ZtoX":g="X";break;case "XtoZ":case "YtoZ":case "ZtoY":g="Z"}break;case "Z":switch(Xa){case "XtoZ":g="X";break;case "YtoZ":case "ZtoX":case "ZtoY":g="Y"}}var h=b.sampler,i=h.input,k=this.getTransformBySid(b.sid);if(k){-1===a.indexOf(f)&&a.push(f);b=0;for(var l=i.length;b<l;b++){var q=i[b],r=h.getData(k.type,b),s;s=null;for(var t=0,u=d.length;t<u&&null==s;t++){var v=d[t];if(v.time===q)s=v;else if(v.time>q)break}if(!s){s=
 "Y";break;case "ZtoX":g="Z"}break;case "Y":switch(Xa){case "XtoY":case "YtoX":case "ZtoX":g="X";break;case "XtoZ":case "YtoZ":case "ZtoY":g="Z"}break;case "Z":switch(Xa){case "XtoZ":g="X";break;case "YtoZ":case "ZtoX":case "ZtoY":g="Y"}}var h=b.sampler,i=h.input,k=this.getTransformBySid(b.sid);if(k){-1===a.indexOf(f)&&a.push(f);b=0;for(var l=i.length;b<l;b++){var q=i[b],r=h.getData(k.type,b),s;s=null;for(var t=0,u=d.length;t<u&&null==s;t++){var v=d[t];if(v.time===q)s=v;else if(v.time>q)break}if(!s){s=
 new j(q);t=-1;u=0;for(v=d.length;u<v&&-1==t;u++)d[u].time>=q&&(t=u);q=t;d.splice(-1==q?d.length:q,0,s)}s.addTarget(f,k,g,r)}}else console.log('Could not find transform "'+b.sid+'" in node '+this.id)}for(c=0;c<a.length;c++){e=a[c];for(b=0;b<d.length;b++)if(s=d[b],!s.hasTarget(e)){h=d;f=s;k=b;g=e;i=void 0;a:{i=k?k-1:0;for(i=0<=i?i:i+h.length;0<=i;i--)if(l=h[i],l.hasTarget(g)){i=l;break a}i=null}l=void 0;a:{for(k+=1;k<h.length;k++)if(l=h[k],l.hasTarget(g))break a;l=null}if(i&&l){h=(f.time-i.time)/(l.time-
 new j(q);t=-1;u=0;for(v=d.length;u<v&&-1==t;u++)d[u].time>=q&&(t=u);q=t;d.splice(-1==q?d.length:q,0,s)}s.addTarget(f,k,g,r)}}else console.log('Could not find transform "'+b.sid+'" in node '+this.id)}for(c=0;c<a.length;c++){e=a[c];for(b=0;b<d.length;b++)if(s=d[b],!s.hasTarget(e)){h=d;f=s;k=b;g=e;i=void 0;a:{i=k?k-1:0;for(i=0<=i?i:i+h.length;0<=i;i--)if(l=h[i],l.hasTarget(g)){i=l;break a}i=null}l=void 0;a:{for(k+=1;k<h.length;k++)if(l=h[k],l.hasTarget(g))break a;l=null}if(i&&l){h=(f.time-i.time)/(l.time-
-i.time);i=i.getTarget(g);k=l.getTarget(g).data;l=i.data;r=void 0;if(l.length){r=[];for(q=0;q<l.length;++q)r[q]=l[q]+(k[q]-l[q])*h}else r=l+(k-l)*h;f.addTarget(g,i.transform,i.member,r)}}}this.keys=d;this.sids=a}this.updateMatrix();return this};p.prototype.updateMatrix=function(){this.matrix.identity();for(var a=0;a<this.transforms.length;a++)this.transforms[a].apply(this.matrix)};n.prototype.parse=function(a){this.sid=a.getAttribute("sid");this.type=a.nodeName;this.data=Z(a.textContent);this.convert();
-return this};n.prototype.convert=function(){switch(this.type){case "matrix":this.obj=aa(this.data);break;case "rotate":this.angle=this.data[3]*mb;case "translate":ia(this.data,-1);this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;case "scale":ia(this.data,1);this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;default:console.log("Can not convert Transform of type "+this.type)}};n.prototype.apply=function(a){switch(this.type){case "matrix":a.multiplySelf(this.obj);
+i.time);i=i.getTarget(g);k=l.getTarget(g).data;l=i.data;r=void 0;if(l.length){r=[];for(q=0;q<l.length;++q)r[q]=l[q]+(k[q]-l[q])*h}else r=l+(k-l)*h;f.addTarget(g,i.transform,i.member,r)}}}this.keys=d;this.sids=a}this.updateMatrix();return this};p.prototype.updateMatrix=function(){this.matrix.identity();for(var a=0;a<this.transforms.length;a++)this.transforms[a].apply(this.matrix)};n.prototype.parse=function(a){this.sid=a.getAttribute("sid");this.type=a.nodeName;this.data=Y(a.textContent);this.convert();
+return this};n.prototype.convert=function(){switch(this.type){case "matrix":this.obj=$(this.data);break;case "rotate":this.angle=this.data[3]*mb;case "translate":ha(this.data,-1);this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;case "scale":ha(this.data,1);this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;default:console.log("Can not convert Transform of type "+this.type)}};n.prototype.apply=function(a){switch(this.type){case "matrix":a.multiplySelf(this.obj);
 break;case "translate":a.translate(this.obj);break;case "rotate":a.rotateByAxis(this.obj,this.angle);break;case "scale":a.scale(this.obj)}};n.prototype.update=function(a,b){switch(this.type){case "matrix":console.log("Currently not handling matrix transform updates");break;case "translate":case "scale":switch(b){case "X":this.obj.x=a;break;case "Y":this.obj.y=a;break;case "Z":this.obj.z=a;break;default:this.obj.x=a[0],this.obj.y=a[1],this.obj.z=a[2]}break;case "rotate":switch(b){case "X":this.obj.x=
 break;case "translate":a.translate(this.obj);break;case "rotate":a.rotateByAxis(this.obj,this.angle);break;case "scale":a.scale(this.obj)}};n.prototype.update=function(a,b){switch(this.type){case "matrix":console.log("Currently not handling matrix transform updates");break;case "translate":case "scale":switch(b){case "X":this.obj.x=a;break;case "Y":this.obj.y=a;break;case "Z":this.obj.z=a;break;default:this.obj.x=a[0],this.obj.y=a[1],this.obj.z=a[2]}break;case "rotate":switch(b){case "X":this.obj.x=
-a;break;case "Y":this.obj.y=a;break;case "Z":this.obj.z=a;break;case "ANGLE":this.angle=a*mb;break;default:this.obj.x=a[0],this.obj.y=a[1],this.obj.z=a[2],this.angle=a[3]*mb}}};o.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "skeleton":this.skeleton.push(c.textContent.replace(/^#/,""));break;case "bind_material":if(c=R.evaluate(".//dae:instance_material",
-c,F,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(var d=c.iterateNext();d;)this.instance_material.push((new q).parse(d)),d=c.iterateNext()}}return this};q.prototype.parse=function(a){this.symbol=a.getAttribute("symbol");this.target=a.getAttribute("target").replace(/^#/,"");return this};m.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType&&"bind_material"==c.nodeName){if(a=
-R.evaluate(".//dae:instance_material",c,F,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(b=a.iterateNext();b;)this.instance_material.push((new q).parse(b)),b=a.iterateNext();break}}return this};r.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "mesh":this.mesh=(new s(this)).parse(c)}}return this};s.prototype.parse=function(a){this.primitives=[];var b;for(b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];
-switch(c.nodeName){case "source":var d=c.getAttribute("id");void 0==Ha[d]&&(Ha[d]=(new D(d)).parse(c));break;case "vertices":this.vertices=(new v).parse(c);break;case "triangles":this.primitives.push((new w).parse(c));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new t).parse(c))}}this.geometry3js=new THREE.Geometry;a=Ha[this.vertices.input.POSITION.source].data;for(b=0;b<a.length;b+=3)this.geometry3js.vertices.push(new THREE.Vertex(S(a,
+a;break;case "Y":this.obj.y=a;break;case "Z":this.obj.z=a;break;case "ANGLE":this.angle=a*mb;break;default:this.obj.x=a[0],this.obj.y=a[1],this.obj.z=a[2],this.angle=a[3]*mb}}};o.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "skeleton":this.skeleton.push(c.textContent.replace(/^#/,""));break;case "bind_material":if(c=Q.evaluate(".//dae:instance_material",
+c,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(var d=c.iterateNext();d;)this.instance_material.push((new q).parse(d)),d=c.iterateNext()}}return this};q.prototype.parse=function(a){this.symbol=a.getAttribute("symbol");this.target=a.getAttribute("target").replace(/^#/,"");return this};m.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType&&"bind_material"==c.nodeName){if(a=
+Q.evaluate(".//dae:instance_material",c,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(b=a.iterateNext();b;)this.instance_material.push((new q).parse(b)),b=a.iterateNext();break}}return this};r.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "mesh":this.mesh=(new s(this)).parse(c)}}return this};s.prototype.parse=function(a){this.primitives=[];var b;for(b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];
+switch(c.nodeName){case "source":var d=c.getAttribute("id");void 0==Ha[d]&&(Ha[d]=(new C(d)).parse(c));break;case "vertices":this.vertices=(new v).parse(c);break;case "triangles":this.primitives.push((new w).parse(c));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new t).parse(c))}}this.geometry3js=new THREE.Geometry;a=Ha[this.vertices.input.POSITION.source].data;for(b=0;b<a.length;b+=3)this.geometry3js.vertices.push(new THREE.Vertex(R(a,
 b)));for(b=0;b<this.primitives.length;b++)a=this.primitives[b],a.setVertices(this.vertices),this.handlePrimitive(a,this.geometry3js);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.calcNormals&&(this.geometry3js.computeVertexNormals(),delete this.geometry3js.calcNormals);this.geometry3js.computeBoundingBox();return this};s.prototype.handlePrimitive=function(a,b){var c=0,d,e,f=a.p,g=a.inputs,h,i,j,k,l=0,m=3,n=0,o=[];for(d=0;d<g.length;d++){h=g[d];var p=h.offset+
 b)));for(b=0;b<this.primitives.length;b++)a=this.primitives[b],a.setVertices(this.vertices),this.handlePrimitive(a,this.geometry3js);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.calcNormals&&(this.geometry3js.computeVertexNormals(),delete this.geometry3js.calcNormals);this.geometry3js.computeBoundingBox();return this};s.prototype.handlePrimitive=function(a,b){var c=0,d,e,f=a.p,g=a.inputs,h,i,j,k,l=0,m=3,n=0,o=[];for(d=0;d<g.length;d++){h=g[d];var p=h.offset+
-1,n=n<p?p:n;switch(h.semantic){case "TEXCOORD":o.push(h.set)}}for(;c<f.length;){var q=[],r=[],p={},s=[];a.vcount&&(m=a.vcount[l++]);for(d=0;d<m;d++)for(e=0;e<g.length;e++)switch(h=g[e],k=Ha[h.source],i=f[c+d*n+h.offset],j=k.accessor.params.length,j*=i,h.semantic){case "VERTEX":q.push(i);break;case "NORMAL":r.push(S(k.data,j));break;case "TEXCOORD":void 0===p[h.set]&&(p[h.set]=[]);p[h.set].push(new THREE.UV(k.data[j],1-k.data[j+1]));break;case "COLOR":s.push((new THREE.Color).setRGB(k.data[j],k.data[j+
-1],k.data[j+2]))}e=null;d=[];if(0==r.length)if(h=this.vertices.input.NORMAL){k=Ha[h.source];j=k.accessor.params.length;h=0;for(i=q.length;h<i;h++)r.push(S(k.data,q[h]*j))}else b.calcNormals=!0;if(3===m)d.push(new THREE.Face3(q[0],q[1],q[2],r,s.length?s:new THREE.Color));else if(4===m)d.push(new THREE.Face4(q[0],q[1],q[2],q[3],r,s.length?s:new THREE.Color));else if(4<m&&Fa.subdivideFaces){s=s.length?s:new THREE.Color;for(e=1;e<m-1;)d.push(new THREE.Face3(q[0],q[e],q[e+1],[r[0],r[e++],r[e]],s))}if(d.length){h=
+1,n=n<p?p:n;switch(h.semantic){case "TEXCOORD":o.push(h.set)}}for(;c<f.length;){var q=[],r=[],p={},s=[];a.vcount&&(m=a.vcount[l++]);for(d=0;d<m;d++)for(e=0;e<g.length;e++)switch(h=g[e],k=Ha[h.source],i=f[c+d*n+h.offset],j=k.accessor.params.length,j*=i,h.semantic){case "VERTEX":q.push(i);break;case "NORMAL":r.push(R(k.data,j));break;case "TEXCOORD":void 0===p[h.set]&&(p[h.set]=[]);p[h.set].push(new THREE.UV(k.data[j],1-k.data[j+1]));break;case "COLOR":s.push((new THREE.Color).setRGB(k.data[j],k.data[j+
+1],k.data[j+2]))}e=null;d=[];if(0==r.length)if(h=this.vertices.input.NORMAL){k=Ha[h.source];j=k.accessor.params.length;h=0;for(i=q.length;h<i;h++)r.push(R(k.data,q[h]*j))}else b.calcNormals=!0;if(3===m)d.push(new THREE.Face3(q[0],q[1],q[2],r,s.length?s:new THREE.Color));else if(4===m)d.push(new THREE.Face4(q[0],q[1],q[2],q[3],r,s.length?s:new THREE.Color));else if(4<m&&Fa.subdivideFaces){s=s.length?s:new THREE.Color;for(e=1;e<m-1;)d.push(new THREE.Face3(q[0],q[e],q[e+1],[r[0],r[e++],r[e]],s))}if(d.length){h=
 0;for(i=d.length;h<i;h++){e=d[h];e.daeMaterial=a.material;b.faces.push(e);for(e=0;e<o.length;e++)q=p[o[e]],q=4<m?[q[0],q[h+1],q[h+2]]:4===m?[q[0],q[1],q[2],q[3]]:[q[0],q[1],q[2]],b.faceVertexUvs[e]||(b.faceVertexUvs[e]=[]),b.faceVertexUvs[e].push(q)}}else console.log("dropped face with vcount "+m+" for geometry with id: "+b.id);c+=n*m}};t.prototype=new w;t.prototype.constructor=t;w.prototype.setVertices=function(a){for(var b=0;b<this.inputs.length;b++)if(this.inputs[b].source==a.id)this.inputs[b].source=
 0;for(i=d.length;h<i;h++){e=d[h];e.daeMaterial=a.material;b.faces.push(e);for(e=0;e<o.length;e++)q=p[o[e]],q=4<m?[q[0],q[h+1],q[h+2]]:4===m?[q[0],q[1],q[2],q[3]]:[q[0],q[1],q[2]],b.faceVertexUvs[e]||(b.faceVertexUvs[e]=[]),b.faceVertexUvs[e].push(q)}}else console.log("dropped face with vcount "+m+" for geometry with id: "+b.id);c+=n*m}};t.prototype=new w;t.prototype.constructor=t;w.prototype.setVertices=function(a){for(var b=0;b<this.inputs.length;b++)if(this.inputs[b].source==a.id)this.inputs[b].source=
-a.input.POSITION.source};w.prototype.parse=function(a){this.inputs=[];this.material=a.getAttribute("material");this.count=da(a,"count",0);for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "input":this.inputs.push((new y).parse(a.childNodes[b]));break;case "vcount":this.vcount=O(c.textContent);break;case "p":this.p=O(c.textContent)}}return this};u.prototype.parse=function(a){this.params=[];this.source=a.getAttribute("source");this.count=da(a,"count",0);this.stride=
-da(a,"stride",0);for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if("param"==c.nodeName){var d={};d.name=c.getAttribute("name");d.type=c.getAttribute("type");this.params.push(d)}}return this};v.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++)if("input"==a.childNodes[b].nodeName){var c=(new y).parse(a.childNodes[b]);this.input[c.semantic]=c}return this};y.prototype.parse=function(a){this.semantic=a.getAttribute("semantic");this.source=a.getAttribute("source").replace(/^#/,
-"");this.set=da(a,"set",-1);this.offset=da(a,"offset",0);if("TEXCOORD"==this.semantic&&0>this.set)this.set=0;return this};D.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "bool_array":for(var d=ga(c.textContent),e=[],f=0,g=d.length;f<g;f++)e.push("true"==d[f]||"1"==d[f]?!0:!1);this.data=e;this.type=c.nodeName;break;case "float_array":this.data=Z(c.textContent);this.type=c.nodeName;break;case "int_array":this.data=
-O(c.textContent);this.type=c.nodeName;break;case "IDREF_array":case "Name_array":this.data=ga(c.textContent);this.type=c.nodeName;break;case "technique_common":for(d=0;d<c.childNodes.length;d++)if("accessor"==c.childNodes[d].nodeName){this.accessor=(new u).parse(c.childNodes[d]);break}}}return this};D.prototype.read=function(){var a=[],b=this.accessor.params[0];switch(b.type){case "IDREF":case "Name":case "name":case "float":return this.data;case "float4x4":for(b=0;b<this.data.length;b+=16){var c=
-this.data.slice(b,b+16),c=aa(c);a.push(c)}break;default:console.log("ColladaLoader: Source: Read dont know how to read "+b.type+".")}return a};A.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");for(var b=0;b<a.childNodes.length;b++)if("instance_effect"==a.childNodes[b].nodeName){this.instance_effect=(new K).parse(a.childNodes[b]);break}return this};C.prototype.isColor=function(){return null==this.texture};C.prototype.isTexture=function(){return null!=this.texture};
-C.prototype.parse=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "color":c=Z(c.textContent);this.color=new THREE.Color(0);this.color.setRGB(c[0],c[1],c[2]);this.color.a=c[3];break;case "texture":this.texture=c.getAttribute("texture"),this.texcoord=c.getAttribute("texcoord"),this.texOpts={offsetU:0,offsetV:0,repeatU:1,repeatV:1,wrapU:1,wrapV:1},this.parseTexture(c)}}return this};C.prototype.parseTexture=function(a){if(!a.childNodes)return this;
-a.childNodes[1]&&"extra"===a.childNodes[1].nodeName&&(a=a.childNodes[1],a.childNodes[1]&&"technique"===a.childNodes[1].nodeName&&(a=a.childNodes[1]));for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "offsetU":case "offsetV":case "repeatU":case "repeatV":this.texOpts[c.nodeName]=parseFloat(c.textContent);break;case "wrapU":case "wrapV":this.texOpts[c.nodeName]=parseInt(c.textContent);break;default:this.texOpts[c.nodeName]=c.textContent}}return this};E.prototype.parse=
-function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[c.nodeName]=(new C).parse(c);break;case "shininess":case "reflectivity":case "transparency":var d;d=R.evaluate(".//dae:float",c,F,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var e=d.iterateNext(),f=[];e;)f.push(e),e=d.iterateNext();d=f;0<d.length&&(this[c.nodeName]=parseFloat(d[0].textContent))}}this.create();
-return this};E.prototype.create=function(){var a={},b=void 0!==this.transparency&&1>this.transparency,c;for(c in this)switch(c){case "ambient":case "emission":case "diffuse":case "specular":var d=this[c];if(d instanceof C)if(d.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid){var e=na[this.effect.surface.init_from];if(e)e=THREE.ImageUtils.loadTexture($a+e.init_from),e.wrapS=d.texOpts.wrapU?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,
+a.input.POSITION.source};w.prototype.parse=function(a){this.inputs=[];this.material=a.getAttribute("material");this.count=ca(a,"count",0);for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "input":this.inputs.push((new y).parse(a.childNodes[b]));break;case "vcount":this.vcount=O(c.textContent);break;case "p":this.p=O(c.textContent)}}return this};u.prototype.parse=function(a){this.params=[];this.source=a.getAttribute("source");this.count=ca(a,"count",0);this.stride=
+ca(a,"stride",0);for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if("param"==c.nodeName){var d={};d.name=c.getAttribute("name");d.type=c.getAttribute("type");this.params.push(d)}}return this};v.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++)if("input"==a.childNodes[b].nodeName){var c=(new y).parse(a.childNodes[b]);this.input[c.semantic]=c}return this};y.prototype.parse=function(a){this.semantic=a.getAttribute("semantic");this.source=a.getAttribute("source").replace(/^#/,
+"");this.set=ca(a,"set",-1);this.offset=ca(a,"offset",0);if("TEXCOORD"==this.semantic&&0>this.set)this.set=0;return this};C.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "bool_array":for(var d=fa(c.textContent),e=[],f=0,g=d.length;f<g;f++)e.push("true"==d[f]||"1"==d[f]?!0:!1);this.data=e;this.type=c.nodeName;break;case "float_array":this.data=Y(c.textContent);this.type=c.nodeName;break;case "int_array":this.data=
+O(c.textContent);this.type=c.nodeName;break;case "IDREF_array":case "Name_array":this.data=fa(c.textContent);this.type=c.nodeName;break;case "technique_common":for(d=0;d<c.childNodes.length;d++)if("accessor"==c.childNodes[d].nodeName){this.accessor=(new u).parse(c.childNodes[d]);break}}}return this};C.prototype.read=function(){var a=[],b=this.accessor.params[0];switch(b.type){case "IDREF":case "Name":case "name":case "float":return this.data;case "float4x4":for(b=0;b<this.data.length;b+=16){var c=
+this.data.slice(b,b+16),c=$(c);a.push(c)}break;default:console.log("ColladaLoader: Source: Read dont know how to read "+b.type+".")}return a};A.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");for(var b=0;b<a.childNodes.length;b++)if("instance_effect"==a.childNodes[b].nodeName){this.instance_effect=(new K).parse(a.childNodes[b]);break}return this};B.prototype.isColor=function(){return null==this.texture};B.prototype.isTexture=function(){return null!=this.texture};
+B.prototype.parse=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "color":c=Y(c.textContent);this.color=new THREE.Color(0);this.color.setRGB(c[0],c[1],c[2]);this.color.a=c[3];break;case "texture":this.texture=c.getAttribute("texture"),this.texcoord=c.getAttribute("texcoord"),this.texOpts={offsetU:0,offsetV:0,repeatU:1,repeatV:1,wrapU:1,wrapV:1},this.parseTexture(c)}}return this};B.prototype.parseTexture=function(a){if(!a.childNodes)return this;
+a.childNodes[1]&&"extra"===a.childNodes[1].nodeName&&(a=a.childNodes[1],a.childNodes[1]&&"technique"===a.childNodes[1].nodeName&&(a=a.childNodes[1]));for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "offsetU":case "offsetV":case "repeatU":case "repeatV":this.texOpts[c.nodeName]=parseFloat(c.textContent);break;case "wrapU":case "wrapV":this.texOpts[c.nodeName]=parseInt(c.textContent);break;default:this.texOpts[c.nodeName]=c.textContent}}return this};D.prototype.parse=
+function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[c.nodeName]=(new B).parse(c);break;case "shininess":case "reflectivity":case "transparency":var d;d=Q.evaluate(".//dae:float",c,E,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var e=d.iterateNext(),f=[];e;)f.push(e),e=d.iterateNext();d=f;0<d.length&&(this[c.nodeName]=parseFloat(d[0].textContent))}}this.create();
+return this};D.prototype.create=function(){var a={},b=void 0!==this.transparency&&1>this.transparency,c;for(c in this)switch(c){case "ambient":case "emission":case "diffuse":case "specular":var d=this[c];if(d instanceof B)if(d.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid){var e=ma[this.effect.surface.init_from];if(e)e=THREE.ImageUtils.loadTexture($a+e.init_from),e.wrapS=d.texOpts.wrapU?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,
 e.wrapT=d.texOpts.wrapV?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,e.offset.x=d.texOpts.offsetU,e.offset.y=d.texOpts.offsetV,e.repeat.x=d.texOpts.repeatU,e.repeat.y=d.texOpts.repeatV,a.map=e}}else"diffuse"==c?a.color=d.color.getHex():b||(a[c]=d.color.getHex());break;case "shininess":case "reflectivity":a[c]=this[c];break;case "transparency":if(b)a.transparent=!0,a.opacity=this[c],b=!0}a.shading=Aa;return this.material=new THREE.MeshLambertMaterial(a)};J.prototype.parse=function(a){for(var b=0;b<
 e.wrapT=d.texOpts.wrapV?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,e.offset.x=d.texOpts.offsetU,e.offset.y=d.texOpts.offsetV,e.repeat.x=d.texOpts.repeatU,e.repeat.y=d.texOpts.repeatV,a.map=e}}else"diffuse"==c?a.color=d.color.getHex():b||(a[c]=d.color.getHex());break;case "shininess":case "reflectivity":a[c]=this[c];break;case "transparency":if(b)a.transparent=!0,a.opacity=this[c],b=!0}a.shading=Aa;return this.material=new THREE.MeshLambertMaterial(a)};J.prototype.parse=function(a){for(var b=0;b<
 a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "init_from":this.init_from=c.textContent;break;case "format":this.format=c.textContent;break;default:console.log("unhandled Surface prop: "+c.nodeName)}}return this};N.prototype.parse=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "source":this.source=c.textContent;break;case "minfilter":this.minfilter=c.textContent;break;case "magfilter":this.magfilter=
 a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "init_from":this.init_from=c.textContent;break;case "format":this.format=c.textContent;break;default:console.log("unhandled Surface prop: "+c.nodeName)}}return this};N.prototype.parse=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "source":this.source=c.textContent;break;case "minfilter":this.minfilter=c.textContent;break;case "magfilter":this.magfilter=
-c.textContent;break;case "mipfilter":this.mipfilter=c.textContent;break;case "wrap_s":this.wrap_s=c.textContent;break;case "wrap_t":this.wrap_t=c.textContent;break;default:console.log("unhandled Sampler2D prop: "+c.nodeName)}}return this};T.prototype.create=function(){if(null==this.shader)return null};T.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.shader=null;for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(c))}}return this};
-T.prototype.parseNewparam=function(a){for(var b=a.getAttribute("sid"),c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "surface":this.surface=(new J(this)).parse(d);this.surface.sid=b;break;case "sampler2D":this.sampler=(new N(this)).parse(d);this.sampler.sid=b;break;case "extra":break;default:console.log(d.nodeName)}}};T.prototype.parseProfileCOMMON=function(a){for(var b,c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "profile_COMMON":this.parseProfileCOMMON(d);
-break;case "technique":b=d;break;case "newparam":this.parseNewparam(d);break;case "extra":break;default:console.log(d.nodeName)}}return b};T.prototype.parseTechnique=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "constant":case "lambert":case "blinn":case "phong":this.shader=(new E(c.nodeName,this)).parse(c)}}};K.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");return this};P.prototype.parse=function(a){this.id=
-a.getAttribute("id");this.name=a.getAttribute("name");this.source={};for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "source":c=(new D).parse(c);this.source[c.id]=c;break;case "sampler":this.sampler.push((new H(this)).parse(c));break;case "channel":this.channel.push((new M(this)).parse(c))}}return this};M.prototype.parse=function(a){this.source=a.getAttribute("source").replace(/^#/,"");this.target=a.getAttribute("target");var b=this.target.split("/");
+c.textContent;break;case "mipfilter":this.mipfilter=c.textContent;break;case "wrap_s":this.wrap_s=c.textContent;break;case "wrap_t":this.wrap_t=c.textContent;break;default:console.log("unhandled Sampler2D prop: "+c.nodeName)}}return this};S.prototype.create=function(){if(null==this.shader)return null};S.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.shader=null;for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(c))}}return this};
+S.prototype.parseNewparam=function(a){for(var b=a.getAttribute("sid"),c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "surface":this.surface=(new J(this)).parse(d);this.surface.sid=b;break;case "sampler2D":this.sampler=(new N(this)).parse(d);this.sampler.sid=b;break;case "extra":break;default:console.log(d.nodeName)}}};S.prototype.parseProfileCOMMON=function(a){for(var b,c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "profile_COMMON":this.parseProfileCOMMON(d);
+break;case "technique":b=d;break;case "newparam":this.parseNewparam(d);break;case "extra":break;default:console.log(d.nodeName)}}return b};S.prototype.parseTechnique=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "constant":case "lambert":case "blinn":case "phong":this.shader=(new D(c.nodeName,this)).parse(c)}}};K.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");return this};P.prototype.parse=function(a){this.id=
+a.getAttribute("id");this.name=a.getAttribute("name");this.source={};for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "source":c=(new C).parse(c);this.source[c.id]=c;break;case "sampler":this.sampler.push((new H(this)).parse(c));break;case "channel":this.channel.push((new M(this)).parse(c))}}return this};M.prototype.parse=function(a){this.source=a.getAttribute("source").replace(/^#/,"");this.target=a.getAttribute("target");var b=this.target.split("/");
 b.shift();var a=b.shift(),c=0<=a.indexOf("."),d=0<=a.indexOf("(");if(c)b=a.split("."),this.sid=b.shift(),this.member=b.shift();else if(d){b=a.split("(");this.sid=b.shift();for(var e=0;e<b.length;e++)b[e]=parseInt(b[e].replace(/\)/,""));this.arrIndices=b}else this.sid=a;this.fullSid=a;this.dotSyntax=c;this.arrSyntax=d;return this};H.prototype.parse=function(a){this.id=a.getAttribute("id");this.inputs=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "input":this.inputs.push((new y).parse(c))}}return this};
 b.shift();var a=b.shift(),c=0<=a.indexOf("."),d=0<=a.indexOf("(");if(c)b=a.split("."),this.sid=b.shift(),this.member=b.shift();else if(d){b=a.split("(");this.sid=b.shift();for(var e=0;e<b.length;e++)b[e]=parseInt(b[e].replace(/\)/,""));this.arrIndices=b}else this.sid=a;this.fullSid=a;this.dotSyntax=c;this.arrSyntax=d;return this};H.prototype.parse=function(a){this.id=a.getAttribute("id");this.inputs=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "input":this.inputs.push((new y).parse(c))}}return this};
 H.prototype.create=function(){for(var a=0;a<this.inputs.length;a++){var b=this.inputs[a],c=this.animation.source[b.source];switch(b.semantic){case "INPUT":this.input=c.read();break;case "OUTPUT":this.output=c.read();this.strideOut=c.accessor.stride;break;case "INTERPOLATION":this.interpolation=c.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(b.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(a=
 H.prototype.create=function(){for(var a=0;a<this.inputs.length;a++){var b=this.inputs[a],c=this.animation.source[b.source];switch(b.semantic){case "INPUT":this.input=c.read();break;case "OUTPUT":this.output=c.read();this.strideOut=c.accessor.stride;break;case "INTERPOLATION":this.interpolation=c.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(b.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(a=
-0;a<this.input.length;a++)this.startTime=Math.min(this.startTime,this.input[a]),this.endTime=Math.max(this.endTime,this.input[a]);this.duration=this.endTime-this.startTime}};H.prototype.getData=function(a,b){var c;if(1<this.strideOut){c=[];for(var b=b*this.strideOut,d=0;d<this.strideOut;++d)c[d]=this.output[b+d];if(3===this.strideOut)switch(a){case "rotate":case "translate":ia(c,-1);break;case "scale":ia(c,1)}}else c=this.output[b];return c};j.prototype.addTarget=function(a,b,c,d){this.targets.push({sid:a,
+0;a<this.input.length;a++)this.startTime=Math.min(this.startTime,this.input[a]),this.endTime=Math.max(this.endTime,this.input[a]);this.duration=this.endTime-this.startTime}};H.prototype.getData=function(a,b){var c;if(1<this.strideOut){c=[];for(var b=b*this.strideOut,d=0;d<this.strideOut;++d)c[d]=this.output[b+d];if(3===this.strideOut)switch(a){case "rotate":case "translate":ha(c,-1);break;case "scale":ha(c,1)}}else c=this.output[b];return c};j.prototype.addTarget=function(a,b,c,d){this.targets.push({sid:a,
 member:c,transform:b,data:d})};j.prototype.apply=function(a){for(var b=0;b<this.targets.length;++b){var c=this.targets[b];(!a||c.sid===a)&&c.transform.update(c.data,c.member)}};j.prototype.getTarget=function(a){for(var b=0;b<this.targets.length;++b)if(this.targets[b].sid===a)return this.targets[b];return null};j.prototype.hasTarget=function(a){for(var b=0;b<this.targets.length;++b)if(this.targets[b].sid===a)return!0;return!1};j.prototype.interpolate=function(a,b){for(var c=0;c<this.targets.length;++c){var d=
 member:c,transform:b,data:d})};j.prototype.apply=function(a){for(var b=0;b<this.targets.length;++b){var c=this.targets[b];(!a||c.sid===a)&&c.transform.update(c.data,c.member)}};j.prototype.getTarget=function(a){for(var b=0;b<this.targets.length;++b)if(this.targets[b].sid===a)return this.targets[b];return null};j.prototype.hasTarget=function(a){for(var b=0;b<this.targets.length;++b)if(this.targets[b].sid===a)return!0;return!1};j.prototype.interpolate=function(a,b){for(var c=0;c<this.targets.length;++c){var d=
-this.targets[c],e=a.getTarget(d.sid);if(e){var f=(b-this.time)/(a.time-this.time),g=e.data,h=d.data;if(0>f||1<f)console.log("Key.interpolate: Warning! Scale out of bounds:"+f),f=0>f?0:1;if(h.length)for(var e=[],i=0;i<h.length;++i)e[i]=h[i]+(g[i]-h[i])*f;else e=h+(g-h)*f}else e=d.data;d.transform.update(e,d.member)}};Y.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "optics":this.parseOptics(c)}}return this};
-Y.prototype.parseOptics=function(a){for(var b=0;b<a.childNodes.length;b++)if("technique_common"==a.childNodes[b].nodeName)for(var c=a.childNodes[b],d=0;d<c.childNodes.length;d++)if("perspective"==c.childNodes[d].nodeName)for(var e=c.childNodes[d],f=0;f<e.childNodes.length;f++){var g=e.childNodes[f];switch(g.nodeName){case "xfov":this.fov=g.textContent;break;case "znear":this.znear=0.4;break;case "zfar":this.zfar=1E15;break;case "aspect_ratio":this.aspect_ratio=g.textContent}}return this};B.prototype.parse=
+this.targets[c],e=a.getTarget(d.sid);if(e){var f=(b-this.time)/(a.time-this.time),g=e.data,h=d.data;if(0>f||1<f)console.log("Key.interpolate: Warning! Scale out of bounds:"+f),f=0>f?0:1;if(h.length)for(var e=[],i=0;i<h.length;++i)e[i]=h[i]+(g[i]-h[i])*f;else e=h+(g-h)*f}else e=d.data;d.transform.update(e,d.member)}};X.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "optics":this.parseOptics(c)}}return this};
+X.prototype.parseOptics=function(a){for(var b=0;b<a.childNodes.length;b++)if("technique_common"==a.childNodes[b].nodeName)for(var c=a.childNodes[b],d=0;d<c.childNodes.length;d++)if("perspective"==c.childNodes[d].nodeName)for(var e=c.childNodes[d],f=0;f<e.childNodes.length;f++){var g=e.childNodes[f];switch(g.nodeName){case "xfov":this.fov=g.textContent;break;case "znear":this.znear=0.4;break;case "zfar":this.zfar=1E15;break;case "aspect_ratio":this.aspect_ratio=g.textContent}}return this};F.prototype.parse=
 function(a){this.url=a.getAttribute("url").replace(/^#/,"");return this};return{load:function(b,c,d){var e=0;if(document.implementation&&document.implementation.createDocument){var f=new XMLHttpRequest;f.overrideMimeType&&f.overrideMimeType("text/xml");f.onreadystatechange=function(){if(4==f.readyState){if(0==f.status||200==f.status)f.responseXML?(Ua=c,a(f.responseXML,void 0,b)):console.error("ColladaLoader: Empty or non-existing file ("+b+")")}else 3==f.readyState&&d&&(0==e&&(e=f.getResponseHeader("Content-Length")),
 function(a){this.url=a.getAttribute("url").replace(/^#/,"");return this};return{load:function(b,c,d){var e=0;if(document.implementation&&document.implementation.createDocument){var f=new XMLHttpRequest;f.overrideMimeType&&f.overrideMimeType("text/xml");f.onreadystatechange=function(){if(4==f.readyState){if(0==f.status||200==f.status)f.responseXML?(Ua=c,a(f.responseXML,void 0,b)):console.error("ColladaLoader: Empty or non-existing file ("+b+")")}else 3==f.readyState&&d&&(0==e&&(e=f.getResponseHeader("Content-Length")),
-d({total:e,loaded:f.responseText.length}))};f.open("GET",b,!0);f.send(null)}else alert("Don't know how to parse XML!")},parse:a,setPreferredShading:function(a){Aa=a},applySkin:e,geometries:qa,options:Fa}};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;
+d({total:e,loaded:f.responseText.length}))};f.open("GET",b,!0);f.send(null)}else alert("Don't know how to parse XML!")},parse:a,setPreferredShading:function(a){Aa=a},applySkin:e,geometries:pa,options:Fa}};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,b,c){if(a instanceof Object)console.warn("DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath )."),c=a,a=c.model,b=c.callback,c=c.texture_path;c=c?c:this.extractUrlbase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.load=function(a,b,c){if(a instanceof Object)console.warn("DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath )."),c=a,a=c.model,b=c.callback,c=c.texture_path;c=c?c:this.extractUrlbase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var g=new XMLHttpRequest,f=0;g.onreadystatechange=function(){if(g.readyState===g.DONE)if(200===g.status||0===g.status){var h;try{g.responseText?h=JSON.parse(g.responseText):console.warn("EMPTY: ["+b+"] seems to be unreachable or file there is empty")}catch(i){console.warn("DEPRECATED: ["+b+"] seems to be using old model format or JSON is invalid")}h&&a.createModel(h,c,d);a.onLoadComplete()}else console.error("Couldn't load ["+b+"] ["+g.status+
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var g=new XMLHttpRequest,f=0;g.onreadystatechange=function(){if(g.readyState===g.DONE)if(200===g.status||0===g.status){var h;try{g.responseText?h=JSON.parse(g.responseText):console.warn("EMPTY: ["+b+"] seems to be unreachable or file there is empty")}catch(i){console.warn("DEPRECATED: ["+b+"] seems to be using old model format or JSON is invalid")}h&&a.createModel(h,c,d);a.onLoadComplete()}else console.error("Couldn't load ["+b+"] ["+g.status+
 "]");else g.readyState===g.LOADING?e&&(0===f&&(f=g.getResponseHeader("Content-Length")),e({total:f,loaded:g.responseText.length})):g.readyState===g.HEADERS_RECEIVED&&(f=g.getResponseHeader("Content-Length"))};g.open("GET",b,!0);g.overrideMimeType&&g.overrideMimeType("text/plain; charset=x-user-defined");g.setRequestHeader("Content-Type","text/plain");g.send(null)};
 "]");else g.readyState===g.LOADING?e&&(0===f&&(f=g.getResponseHeader("Content-Length")),e({total:f,loaded:g.responseText.length})):g.readyState===g.HEADERS_RECEIVED&&(f=g.getResponseHeader("Content-Length"))};g.open("GET",b,!0);g.overrideMimeType&&g.overrideMimeType("text/plain; charset=x-user-defined");g.setRequestHeader("Content-Type","text/plain");g.send(null)};
-THREE.JSONLoader.prototype.createModel=function(a,b,c){var d=new THREE.Geometry,e=void 0!==a.scale?1/a.scale:1;this.initMaterials(d,a.materials,c);(function(b){if(void 0===a.metadata||void 0===a.metadata.formatVersion||3!==a.metadata.formatVersion)console.error("Deprecated file format.");else{var c,e,i,k,l,p,n,o,q,m,r,s,t,w,u=a.faces;p=a.vertices;var v=a.normals,y=a.colors,D=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&D++;for(c=0;c<D;c++)d.faceUvs[c]=[],d.faceVertexUvs[c]=[];k=0;for(l=p.length;k<
-l;)n=new THREE.Vertex,n.position.x=p[k++]*b,n.position.y=p[k++]*b,n.position.z=p[k++]*b,d.vertices.push(n);k=0;for(l=u.length;k<l;){b=u[k++];p=b&1;i=b&2;c=b&4;e=b&8;o=b&16;n=b&32;m=b&64;b&=128;p?(r=new THREE.Face4,r.a=u[k++],r.b=u[k++],r.c=u[k++],r.d=u[k++],p=4):(r=new THREE.Face3,r.a=u[k++],r.b=u[k++],r.c=u[k++],p=3);if(i)i=u[k++],r.materialIndex=i;i=d.faces.length;if(c)for(c=0;c<D;c++)s=a.uvs[c],q=u[k++],w=s[2*q],q=s[2*q+1],d.faceUvs[c][i]=new THREE.UV(w,q);if(e)for(c=0;c<D;c++){s=a.uvs[c];t=[];
-for(e=0;e<p;e++)q=u[k++],w=s[2*q],q=s[2*q+1],t[e]=new THREE.UV(w,q);d.faceVertexUvs[c][i]=t}if(o)o=3*u[k++],e=new THREE.Vector3,e.x=v[o++],e.y=v[o++],e.z=v[o],r.normal=e;if(n)for(c=0;c<p;c++)o=3*u[k++],e=new THREE.Vector3,e.x=v[o++],e.y=v[o++],e.z=v[o],r.vertexNormals.push(e);if(m)n=u[k++],n=new THREE.Color(y[n]),r.color=n;if(b)for(c=0;c<p;c++)n=u[k++],n=new THREE.Color(y[n]),r.vertexColors.push(n);d.faces.push(r)}}})(e);(function(){var b,c,e,i;if(a.skinWeights)for(b=0,c=a.skinWeights.length;b<c;b+=
-2)e=a.skinWeights[b],i=a.skinWeights[b+1],d.skinWeights.push(new THREE.Vector4(e,i,0,0));if(a.skinIndices)for(b=0,c=a.skinIndices.length;b<c;b+=2)e=a.skinIndices[b],i=a.skinIndices[b+1],d.skinIndices.push(new THREE.Vector4(e,i,0,0));d.bones=a.bones;d.animation=a.animation})();(function(b){if(void 0!==a.morphTargets){var c,e,i,k,l,p,n,o,q;for(c=0,e=a.morphTargets.length;c<e;c++){d.morphTargets[c]={};d.morphTargets[c].name=a.morphTargets[c].name;d.morphTargets[c].vertices=[];o=d.morphTargets[c].vertices;
-q=a.morphTargets[c].vertices;for(i=0,k=q.length;i<k;i+=3)l=q[i]*b,p=q[i+1]*b,n=q[i+2]*b,o.push(new THREE.Vertex(new THREE.Vector3(l,p,n)))}}if(void 0!==a.morphColors)for(c=0,e=a.morphColors.length;c<e;c++){d.morphColors[c]={};d.morphColors[c].name=a.morphColors[c].name;d.morphColors[c].colors=[];k=d.morphColors[c].colors;l=a.morphColors[c].colors;for(b=0,i=l.length;b<i;b+=3)p=new THREE.Color(16755200),p.setRGB(l[b],l[b+1],l[b+2]),k.push(p)}})(e);d.computeCentroids();d.computeFaceNormals();this.hasNormals(d)&&
+THREE.JSONLoader.prototype.createModel=function(a,b,c){var d=new THREE.Geometry,e=void 0!==a.scale?1/a.scale:1;this.initMaterials(d,a.materials,c);(function(b){if(void 0===a.metadata||void 0===a.metadata.formatVersion||3!==a.metadata.formatVersion)console.error("Deprecated file format.");else{var c,e,i,l,k,p,n,o,q,m,r,s,t,w,u=a.faces;p=a.vertices;var v=a.normals,y=a.colors,C=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&C++;for(c=0;c<C;c++)d.faceUvs[c]=[],d.faceVertexUvs[c]=[];l=0;for(k=p.length;l<
+k;)n=new THREE.Vertex,n.position.x=p[l++]*b,n.position.y=p[l++]*b,n.position.z=p[l++]*b,d.vertices.push(n);l=0;for(k=u.length;l<k;){b=u[l++];p=b&1;i=b&2;c=b&4;e=b&8;o=b&16;n=b&32;m=b&64;b&=128;p?(r=new THREE.Face4,r.a=u[l++],r.b=u[l++],r.c=u[l++],r.d=u[l++],p=4):(r=new THREE.Face3,r.a=u[l++],r.b=u[l++],r.c=u[l++],p=3);if(i)i=u[l++],r.materialIndex=i;i=d.faces.length;if(c)for(c=0;c<C;c++)s=a.uvs[c],q=u[l++],w=s[2*q],q=s[2*q+1],d.faceUvs[c][i]=new THREE.UV(w,q);if(e)for(c=0;c<C;c++){s=a.uvs[c];t=[];
+for(e=0;e<p;e++)q=u[l++],w=s[2*q],q=s[2*q+1],t[e]=new THREE.UV(w,q);d.faceVertexUvs[c][i]=t}if(o)o=3*u[l++],e=new THREE.Vector3,e.x=v[o++],e.y=v[o++],e.z=v[o],r.normal=e;if(n)for(c=0;c<p;c++)o=3*u[l++],e=new THREE.Vector3,e.x=v[o++],e.y=v[o++],e.z=v[o],r.vertexNormals.push(e);if(m)n=u[l++],n=new THREE.Color(y[n]),r.color=n;if(b)for(c=0;c<p;c++)n=u[l++],n=new THREE.Color(y[n]),r.vertexColors.push(n);d.faces.push(r)}}})(e);(function(){var b,c,e,i;if(a.skinWeights)for(b=0,c=a.skinWeights.length;b<c;b+=
+2)e=a.skinWeights[b],i=a.skinWeights[b+1],d.skinWeights.push(new THREE.Vector4(e,i,0,0));if(a.skinIndices)for(b=0,c=a.skinIndices.length;b<c;b+=2)e=a.skinIndices[b],i=a.skinIndices[b+1],d.skinIndices.push(new THREE.Vector4(e,i,0,0));d.bones=a.bones;d.animation=a.animation})();(function(b){if(void 0!==a.morphTargets){var c,e,i,l,k,p,n,o,q;for(c=0,e=a.morphTargets.length;c<e;c++){d.morphTargets[c]={};d.morphTargets[c].name=a.morphTargets[c].name;d.morphTargets[c].vertices=[];o=d.morphTargets[c].vertices;
+q=a.morphTargets[c].vertices;for(i=0,l=q.length;i<l;i+=3)k=q[i]*b,p=q[i+1]*b,n=q[i+2]*b,o.push(new THREE.Vertex(new THREE.Vector3(k,p,n)))}}if(void 0!==a.morphColors)for(c=0,e=a.morphColors.length;c<e;c++){d.morphColors[c]={};d.morphColors[c].name=a.morphColors[c].name;d.morphColors[c].colors=[];l=d.morphColors[c].colors;k=a.morphColors[c].colors;for(b=0,i=k.length;b<i;b+=3)p=new THREE.Color(16755200),p.setRGB(k[b],k[b+1],k[b+2]),l.push(p)}})(e);d.computeCentroids();d.computeFaceNormals();this.hasNormals(d)&&
 d.computeTangents();b(d)};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};THREE.SceneLoader.prototype.constructor=THREE.SceneLoader;
 d.computeTangents();b(d)};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};THREE.SceneLoader.prototype.constructor=THREE.SceneLoader;
 THREE.SceneLoader.prototype.load=function(a,b){var c=this,d=new XMLHttpRequest;d.onreadystatechange=function(){if(4==d.readyState)if(200==d.status||0==d.status){try{var e=JSON.parse(d.responseText)}catch(g){console.warn("DEPRECATED: ["+a+"] seems to be using old model format")}c.createScene(e,b,a)}else console.error("Couldn't load ["+a+"] ["+d.status+"]")};d.open("GET",a,!0);d.overrideMimeType&&d.overrideMimeType("text/plain; charset=x-user-defined");d.setRequestHeader("Content-Type","text/plain");
 THREE.SceneLoader.prototype.load=function(a,b){var c=this,d=new XMLHttpRequest;d.onreadystatechange=function(){if(4==d.readyState)if(200==d.status||0==d.status){try{var e=JSON.parse(d.responseText)}catch(g){console.warn("DEPRECATED: ["+a+"] seems to be using old model format")}c.createScene(e,b,a)}else console.error("Couldn't load ["+a+"] ["+d.status+"]")};d.open("GET",a,!0);d.overrideMimeType&&d.overrideMimeType("text/plain; charset=x-user-defined");d.setRequestHeader("Content-Type","text/plain");
 d.send(null)};
 d.send(null)};
-THREE.SceneLoader.prototype.createScene=function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:k+"/"+a}function e(){var a;for(n in K.objects)if(!B.objects[n])if(s=K.objects[n],void 0!==s.geometry){if(E=B.geometries[s.geometry]){a=!1;J=B.materials[s.materials[0]];(a=J instanceof THREE.ShaderMaterial)&&E.computeTangents();u=s.position;v=s.rotation;y=s.quaternion;D=s.scale;y=0;0==s.materials.length&&(J=new THREE.MeshFaceMaterial);1<s.materials.length&&(J=new THREE.MeshFaceMaterial);a=new THREE.Mesh(E,
-J);a.name=n;a.position.set(u[0],u[1],u[2]);y?(a.quaternion.set(y[0],y[1],y[2],y[3]),a.useQuaternion=!0):a.rotation.set(v[0],v[1],v[2]);a.scale.set(D[0],D[1],D[2]);a.visible=s.visible;B.scene.add(a);B.objects[n]=a;if(s.meshCollider){var b=THREE.CollisionUtils.MeshColliderWBox(a);B.scene.collisions.colliders.push(b)}if(s.castsShadow)b=new THREE.ShadowVolume(E),B.scene.add(b),b.position=a.position,b.rotation=a.rotation,b.scale=a.scale;s.trigger&&"none"!=s.trigger.toLowerCase()&&(b={type:s.trigger,object:s},
-B.triggers[a.name]=b)}}else u=s.position,v=s.rotation,y=s.quaternion,D=s.scale,y=0,a=new THREE.Object3D,a.name=n,a.position.set(u[0],u[1],u[2]),y?(a.quaternion.set(y[0],y[1],y[2],y[3]),a.useQuaternion=!0):a.rotation.set(v[0],v[1],v[2]),a.scale.set(D[0],D[1],D[2]),a.visible=void 0!==s.visible?s.visible:!1,B.scene.add(a),B.objects[n]=a,B.empties[n]=a,s.trigger&&"none"!=s.trigger.toLowerCase()&&(b={type:s.trigger,object:s},B.triggers[a.name]=b)}function g(a){return function(b){B.geometries[a]=b;e();
-M-=1;i.onLoadComplete();h()}}function f(a){return function(b){B.geometries[a]=b}}function h(){i.callbackProgress({totalModels:j,totalTextures:Y,loadedModels:j-M,loadedTextures:Y-H},B);i.onLoadProgress();0==M&&0==H&&b(B)}var i=this,k=THREE.Loader.prototype.extractUrlbase(c),l,p,n,o,q,m,r,s,t,w,u,v,y,D,A,C,E,J,N,T,K,P,M,H,j,Y,B;K=a;c=new THREE.BinaryLoader;P=new THREE.JSONLoader;H=M=0;B={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},
-empties:{}};a=!1;for(n in K.objects)if(s=K.objects[n],s.meshCollider){a=!0;break}if(a)B.scene.collisions=new THREE.CollisionSystem;if(K.transform)a=K.transform.position,t=K.transform.rotation,A=K.transform.scale,a&&B.scene.position.set(a[0],a[1],a[2]),t&&B.scene.rotation.set(t[0],t[1],t[2]),A&&B.scene.scale.set(A[0],A[1],A[2]),(a||t||A)&&B.scene.updateMatrix();a=function(){H-=1;h();i.onLoadComplete()};for(q in K.cameras)A=K.cameras[q],"perspective"==A.type?N=new THREE.PerspectiveCamera(A.fov,A.aspect,
-A.near,A.far):"ortho"==A.type&&(N=new THREE.OrthographicCamera(A.left,A.right,A.top,A.bottom,A.near,A.far)),u=A.position,t=A.target,A=A.up,N.position.set(u[0],u[1],u[2]),N.target=new THREE.Vector3(t[0],t[1],t[2]),A&&N.up.set(A[0],A[1],A[2]),B.cameras[q]=N;for(o in K.lights)t=K.lights[o],q=void 0!==t.color?t.color:16777215,N=void 0!==t.intensity?t.intensity:1,"directional"==t.type?(u=t.direction,w=new THREE.DirectionalLight(q,N),w.position.set(u[0],u[1],u[2]),w.position.normalize()):"point"==t.type?
-(u=t.position,w=t.distance,w=new THREE.PointLight(q,N,w),w.position.set(u[0],u[1],u[2])):"ambient"==t.type&&(w=new THREE.AmbientLight(q)),B.scene.add(w),B.lights[o]=w;for(m in K.fogs)o=K.fogs[m],"linear"==o.type?T=new THREE.Fog(0,o.near,o.far):"exp2"==o.type&&(T=new THREE.FogExp2(0,o.density)),A=o.color,T.color.setRGB(A[0],A[1],A[2]),B.fogs[m]=T;if(B.cameras&&K.defaults.camera)B.currentCamera=B.cameras[K.defaults.camera];if(B.fogs&&K.defaults.fog)B.scene.fog=B.fogs[K.defaults.fog];A=K.defaults.bgcolor;
-B.bgColor=new THREE.Color;B.bgColor.setRGB(A[0],A[1],A[2]);B.bgColorAlpha=K.defaults.bgalpha;for(l in K.geometries)if(m=K.geometries[l],"bin_mesh"==m.type||"ascii_mesh"==m.type)M+=1,i.onLoadStart();j=M;for(l in K.geometries)if(m=K.geometries[l],"cube"==m.type)E=new THREE.CubeGeometry(m.width,m.height,m.depth,m.segmentsWidth,m.segmentsHeight,m.segmentsDepth,null,m.flipped,m.sides),B.geometries[l]=E;else if("plane"==m.type)E=new THREE.PlaneGeometry(m.width,m.height,m.segmentsWidth,m.segmentsHeight),
-B.geometries[l]=E;else if("sphere"==m.type)E=new THREE.SphereGeometry(m.radius,m.segmentsWidth,m.segmentsHeight),B.geometries[l]=E;else if("cylinder"==m.type)E=new THREE.CylinderGeometry(m.topRad,m.botRad,m.height,m.radSegs,m.heightSegs),B.geometries[l]=E;else if("torus"==m.type)E=new THREE.TorusGeometry(m.radius,m.tube,m.segmentsR,m.segmentsT),B.geometries[l]=E;else if("icosahedron"==m.type)E=new THREE.IcosahedronGeometry(m.radius,m.subdivisions),B.geometries[l]=E;else if("bin_mesh"==m.type)c.load(d(m.url,
-K.urlBaseType),g(l));else if("ascii_mesh"==m.type)P.load(d(m.url,K.urlBaseType),g(l));else if("embedded_mesh"==m.type)m=K.embeds[m.id],m.metadata=K.metadata,m&&P.createModel(m,f(l),"");for(r in K.textures)if(l=K.textures[r],l.url instanceof Array){H+=l.url.length;for(m=0;m<l.url.length;m++)i.onLoadStart()}else H+=1,i.onLoadStart();Y=H;for(r in K.textures){l=K.textures[r];if(void 0!=l.mapping&&void 0!=THREE[l.mapping])l.mapping=new THREE[l.mapping];if(l.url instanceof Array){m=[];for(T=0;T<l.url.length;T++)m[T]=
-d(l.url[T],K.urlBaseType);m=THREE.ImageUtils.loadTextureCube(m,l.mapping,a)}else{m=THREE.ImageUtils.loadTexture(d(l.url,K.urlBaseType),l.mapping,a);if(void 0!=THREE[l.minFilter])m.minFilter=THREE[l.minFilter];if(void 0!=THREE[l.magFilter])m.magFilter=THREE[l.magFilter];if(l.repeat){m.repeat.set(l.repeat[0],l.repeat[1]);if(1!=l.repeat[0])m.wrapS=THREE.RepeatWrapping;if(1!=l.repeat[1])m.wrapT=THREE.RepeatWrapping}l.offset&&m.offset.set(l.offset[0],l.offset[1]);if(l.wrap){T={repeat:THREE.RepeatWrapping,
-mirror:THREE.MirroredRepeatWrapping};if(void 0!==T[l.wrap[0]])m.wrapS=T[l.wrap[0]];if(void 0!==T[l.wrap[1]])m.wrapT=T[l.wrap[1]]}}B.textures[r]=m}for(p in K.materials){r=K.materials[p];for(C in r.parameters)if("envMap"==C||"map"==C||"lightMap"==C)r.parameters[C]=B.textures[r.parameters[C]];else if("shading"==C)r.parameters[C]="flat"==r.parameters[C]?THREE.FlatShading:THREE.SmoothShading;else if("blending"==C)r.parameters[C]=THREE[r.parameters[C]]?THREE[r.parameters[C]]:THREE.NormalBlending;else if("combine"==
-C)r.parameters[C]="MixOperation"==r.parameters[C]?THREE.MixOperation:THREE.MultiplyOperation;else if("vertexColors"==C)if("face"==r.parameters[C])r.parameters[C]=THREE.FaceColors;else if(r.parameters[C])r.parameters[C]=THREE.VertexColors;if(void 0!==r.parameters.opacity&&1>r.parameters.opacity)r.parameters.transparent=!0;if(r.parameters.normalMap){l=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(l.uniforms);m=r.parameters.color;T=r.parameters.specular;c=r.parameters.ambient;P=r.parameters.shininess;
-a.tNormal.texture=B.textures[r.parameters.normalMap];if(r.parameters.normalMapFactor)a.uNormalScale.value=r.parameters.normalMapFactor;if(r.parameters.map)a.tDiffuse.texture=r.parameters.map,a.enableDiffuse.value=!0;if(r.parameters.lightMap)a.tAO.texture=r.parameters.lightMap,a.enableAO.value=!0;if(r.parameters.specularMap)a.tSpecular.texture=B.textures[r.parameters.specularMap],a.enableSpecular.value=!0;a.uDiffuseColor.value.setHex(m);a.uSpecularColor.value.setHex(T);a.uAmbientColor.value.setHex(c);
-a.uShininess.value=P;if(r.parameters.opacity)a.uOpacity.value=r.parameters.opacity;J=new THREE.ShaderMaterial({fragmentShader:l.fragmentShader,vertexShader:l.vertexShader,uniforms:a,lights:!0,fog:!0})}else J=new THREE[r.type](r.parameters);B.materials[p]=J}e();i.callbackSync(B);h()};THREE.UTF8Loader=function(){};THREE.UTF8Loader.prototype=new THREE.UTF8Loader;THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
+THREE.SceneLoader.prototype.createScene=function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:l+"/"+a}function e(){var a;for(n in K.objects)if(!F.objects[n])if(s=K.objects[n],void 0!==s.geometry){if(D=F.geometries[s.geometry]){a=!1;J=F.materials[s.materials[0]];(a=J instanceof THREE.ShaderMaterial)&&D.computeTangents();u=s.position;v=s.rotation;y=s.quaternion;C=s.scale;y=0;0==s.materials.length&&(J=new THREE.MeshFaceMaterial);1<s.materials.length&&(J=new THREE.MeshFaceMaterial);a=new THREE.Mesh(D,
+J);a.name=n;a.position.set(u[0],u[1],u[2]);y?(a.quaternion.set(y[0],y[1],y[2],y[3]),a.useQuaternion=!0):a.rotation.set(v[0],v[1],v[2]);a.scale.set(C[0],C[1],C[2]);a.visible=s.visible;F.scene.add(a);F.objects[n]=a;if(s.castsShadow){var b=new THREE.ShadowVolume(D);F.scene.add(b);b.position=a.position;b.rotation=a.rotation;b.scale=a.scale}s.trigger&&"none"!=s.trigger.toLowerCase()&&(b={type:s.trigger,object:s},F.triggers[a.name]=b)}}else u=s.position,v=s.rotation,y=s.quaternion,C=s.scale,y=0,a=new THREE.Object3D,
+a.name=n,a.position.set(u[0],u[1],u[2]),y?(a.quaternion.set(y[0],y[1],y[2],y[3]),a.useQuaternion=!0):a.rotation.set(v[0],v[1],v[2]),a.scale.set(C[0],C[1],C[2]),a.visible=void 0!==s.visible?s.visible:!1,F.scene.add(a),F.objects[n]=a,F.empties[n]=a,s.trigger&&"none"!=s.trigger.toLowerCase()&&(b={type:s.trigger,object:s},F.triggers[a.name]=b)}function g(a){return function(b){F.geometries[a]=b;e();M-=1;i.onLoadComplete();h()}}function f(a){return function(b){F.geometries[a]=b}}function h(){i.callbackProgress({totalModels:j,
+totalTextures:X,loadedModels:j-M,loadedTextures:X-H},F);i.onLoadProgress();0==M&&0==H&&b(F)}var i=this,l=THREE.Loader.prototype.extractUrlbase(c),k,p,n,o,q,m,r,s,t,w,u,v,y,C,A,B,D,J,N,S,K,P,M,H,j,X,F;K=a;c=new THREE.BinaryLoader;P=new THREE.JSONLoader;H=M=0;F={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};if(K.transform)a=K.transform.position,t=K.transform.rotation,A=K.transform.scale,a&&F.scene.position.set(a[0],a[1],
+a[2]),t&&F.scene.rotation.set(t[0],t[1],t[2]),A&&F.scene.scale.set(A[0],A[1],A[2]),(a||t||A)&&F.scene.updateMatrix();a=function(){H-=1;h();i.onLoadComplete()};for(q in K.cameras)A=K.cameras[q],"perspective"==A.type?N=new THREE.PerspectiveCamera(A.fov,A.aspect,A.near,A.far):"ortho"==A.type&&(N=new THREE.OrthographicCamera(A.left,A.right,A.top,A.bottom,A.near,A.far)),u=A.position,t=A.target,A=A.up,N.position.set(u[0],u[1],u[2]),N.target=new THREE.Vector3(t[0],t[1],t[2]),A&&N.up.set(A[0],A[1],A[2]),
+F.cameras[q]=N;for(o in K.lights)t=K.lights[o],q=void 0!==t.color?t.color:16777215,N=void 0!==t.intensity?t.intensity:1,"directional"==t.type?(u=t.direction,w=new THREE.DirectionalLight(q,N),w.position.set(u[0],u[1],u[2]),w.position.normalize()):"point"==t.type?(u=t.position,w=t.distance,w=new THREE.PointLight(q,N,w),w.position.set(u[0],u[1],u[2])):"ambient"==t.type&&(w=new THREE.AmbientLight(q)),F.scene.add(w),F.lights[o]=w;for(m in K.fogs)o=K.fogs[m],"linear"==o.type?S=new THREE.Fog(0,o.near,o.far):
+"exp2"==o.type&&(S=new THREE.FogExp2(0,o.density)),A=o.color,S.color.setRGB(A[0],A[1],A[2]),F.fogs[m]=S;if(F.cameras&&K.defaults.camera)F.currentCamera=F.cameras[K.defaults.camera];if(F.fogs&&K.defaults.fog)F.scene.fog=F.fogs[K.defaults.fog];A=K.defaults.bgcolor;F.bgColor=new THREE.Color;F.bgColor.setRGB(A[0],A[1],A[2]);F.bgColorAlpha=K.defaults.bgalpha;for(k in K.geometries)if(m=K.geometries[k],"bin_mesh"==m.type||"ascii_mesh"==m.type)M+=1,i.onLoadStart();j=M;for(k in K.geometries)if(m=K.geometries[k],
+"cube"==m.type)D=new THREE.CubeGeometry(m.width,m.height,m.depth,m.segmentsWidth,m.segmentsHeight,m.segmentsDepth,null,m.flipped,m.sides),F.geometries[k]=D;else if("plane"==m.type)D=new THREE.PlaneGeometry(m.width,m.height,m.segmentsWidth,m.segmentsHeight),F.geometries[k]=D;else if("sphere"==m.type)D=new THREE.SphereGeometry(m.radius,m.segmentsWidth,m.segmentsHeight),F.geometries[k]=D;else if("cylinder"==m.type)D=new THREE.CylinderGeometry(m.topRad,m.botRad,m.height,m.radSegs,m.heightSegs),F.geometries[k]=
+D;else if("torus"==m.type)D=new THREE.TorusGeometry(m.radius,m.tube,m.segmentsR,m.segmentsT),F.geometries[k]=D;else if("icosahedron"==m.type)D=new THREE.IcosahedronGeometry(m.radius,m.subdivisions),F.geometries[k]=D;else if("bin_mesh"==m.type)c.load(d(m.url,K.urlBaseType),g(k));else if("ascii_mesh"==m.type)P.load(d(m.url,K.urlBaseType),g(k));else if("embedded_mesh"==m.type)m=K.embeds[m.id],m.metadata=K.metadata,m&&P.createModel(m,f(k),"");for(r in K.textures)if(k=K.textures[r],k.url instanceof Array){H+=
+k.url.length;for(m=0;m<k.url.length;m++)i.onLoadStart()}else H+=1,i.onLoadStart();X=H;for(r in K.textures){k=K.textures[r];if(void 0!=k.mapping&&void 0!=THREE[k.mapping])k.mapping=new THREE[k.mapping];if(k.url instanceof Array){m=[];for(S=0;S<k.url.length;S++)m[S]=d(k.url[S],K.urlBaseType);m=THREE.ImageUtils.loadTextureCube(m,k.mapping,a)}else{m=THREE.ImageUtils.loadTexture(d(k.url,K.urlBaseType),k.mapping,a);if(void 0!=THREE[k.minFilter])m.minFilter=THREE[k.minFilter];if(void 0!=THREE[k.magFilter])m.magFilter=
+THREE[k.magFilter];if(k.repeat){m.repeat.set(k.repeat[0],k.repeat[1]);if(1!=k.repeat[0])m.wrapS=THREE.RepeatWrapping;if(1!=k.repeat[1])m.wrapT=THREE.RepeatWrapping}k.offset&&m.offset.set(k.offset[0],k.offset[1]);if(k.wrap){S={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(void 0!==S[k.wrap[0]])m.wrapS=S[k.wrap[0]];if(void 0!==S[k.wrap[1]])m.wrapT=S[k.wrap[1]]}}F.textures[r]=m}for(p in K.materials){r=K.materials[p];for(B in r.parameters)if("envMap"==B||"map"==B||"lightMap"==B)r.parameters[B]=
+F.textures[r.parameters[B]];else if("shading"==B)r.parameters[B]="flat"==r.parameters[B]?THREE.FlatShading:THREE.SmoothShading;else if("blending"==B)r.parameters[B]=THREE[r.parameters[B]]?THREE[r.parameters[B]]:THREE.NormalBlending;else if("combine"==B)r.parameters[B]="MixOperation"==r.parameters[B]?THREE.MixOperation:THREE.MultiplyOperation;else if("vertexColors"==B)if("face"==r.parameters[B])r.parameters[B]=THREE.FaceColors;else if(r.parameters[B])r.parameters[B]=THREE.VertexColors;if(void 0!==
+r.parameters.opacity&&1>r.parameters.opacity)r.parameters.transparent=!0;if(r.parameters.normalMap){a=THREE.ShaderUtils.lib.normal;k=THREE.UniformsUtils.clone(a.uniforms);m=r.parameters.color;S=r.parameters.specular;c=r.parameters.ambient;P=r.parameters.shininess;k.tNormal.texture=F.textures[r.parameters.normalMap];if(r.parameters.normalMapFactor)k.uNormalScale.value=r.parameters.normalMapFactor;if(r.parameters.map)k.tDiffuse.texture=r.parameters.map,k.enableDiffuse.value=!0;if(r.parameters.lightMap)k.tAO.texture=
+r.parameters.lightMap,k.enableAO.value=!0;if(r.parameters.specularMap)k.tSpecular.texture=F.textures[r.parameters.specularMap],k.enableSpecular.value=!0;k.uDiffuseColor.value.setHex(m);k.uSpecularColor.value.setHex(S);k.uAmbientColor.value.setHex(c);k.uShininess.value=P;if(r.parameters.opacity)k.uOpacity.value=r.parameters.opacity;J=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:k,lights:!0,fog:!0})}else J=new THREE[r.type](r.parameters);F.materials[p]=
+J}e();i.callbackSync(F);h()};THREE.UTF8Loader=function(){};THREE.UTF8Loader.prototype=new THREE.UTF8Loader;THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
 THREE.UTF8Loader.prototype.load=function(a,b,c){if(a instanceof Object)console.warn("DEPRECATED: UTF8Loader( parameters ) is now UTF8Loader( url, callback, metaData )."),c=a,a=c.model,b=c.callback,c={scale:c.scale,offsetX:c.offsetX,offsetY:c.offsetY,offsetZ:c.offsetZ};var d=new XMLHttpRequest,e=void 0!==c.scale?c.scale:1,g=void 0!==c.offsetX?c.offsetX:0,f=void 0!==c.offsetY?c.offsetY:0,h=void 0!==c.offsetZ?c.offsetZ:0;d.onreadystatechange=function(){4==d.readyState?200==d.status||0==d.status?THREE.UTF8Loader.prototype.createModel(d.responseText,
 THREE.UTF8Loader.prototype.load=function(a,b,c){if(a instanceof Object)console.warn("DEPRECATED: UTF8Loader( parameters ) is now UTF8Loader( url, callback, metaData )."),c=a,a=c.model,b=c.callback,c={scale:c.scale,offsetX:c.offsetX,offsetY:c.offsetY,offsetZ:c.offsetZ};var d=new XMLHttpRequest,e=void 0!==c.scale?c.scale:1,g=void 0!==c.offsetX?c.offsetX:0,f=void 0!==c.offsetY?c.offsetY:0,h=void 0!==c.offsetZ?c.offsetZ:0;d.onreadystatechange=function(){4==d.readyState?200==d.status||0==d.status?THREE.UTF8Loader.prototype.createModel(d.responseText,
 b,e,g,f,h):alert("Couldn't load ["+a+"] ["+d.status+"]"):3!=d.readyState&&2==d.readyState&&d.getResponseHeader("Content-Length")};d.open("GET",a,!0);d.send(null)};THREE.UTF8Loader.prototype.decompressMesh=function(a){var b=a.charCodeAt(0);57344<=b&&(b-=2048);b++;for(var c=new Float32Array(8*b),d=1,e=0;8>e;e++){for(var g=0,f=0;f<b;++f){var h=a.charCodeAt(f+d),g=g+(h>>1^-(h&1));c[8*f+e]=g}d+=b}b=a.length-d;g=new Uint16Array(b);for(e=f=0;e<b;e++)h=a.charCodeAt(e+d),g[e]=f-h,0==h&&f++;return[c,g]};
 b,e,g,f,h):alert("Couldn't load ["+a+"] ["+d.status+"]"):3!=d.readyState&&2==d.readyState&&d.getResponseHeader("Content-Length")};d.open("GET",a,!0);d.send(null)};THREE.UTF8Loader.prototype.decompressMesh=function(a){var b=a.charCodeAt(0);57344<=b&&(b-=2048);b++;for(var c=new Float32Array(8*b),d=1,e=0;8>e;e++){for(var g=0,f=0;f<b;++f){var h=a.charCodeAt(f+d),g=g+(h>>1^-(h&1));c[8*f+e]=g}d+=b}b=a.length-d;g=new Uint16Array(b);for(e=f=0;e<b;e++)h=a.charCodeAt(e+d),g[e]=f-h,0==h&&f++;return[c,g]};
-THREE.UTF8Loader.prototype.createModel=function(a,b,c,d,e,g){var f=function(){var b=this;b.materials=[];THREE.Geometry.call(this);var f=THREE.UTF8Loader.prototype.decompressMesh(a),k=[],l=[];(function(a,f,i){for(var k,m,l,s=a.length;i<s;i+=f)k=a[i],m=a[i+1],l=a[i+2],k=k/16383*c,m=m/16383*c,l=l/16383*c,k+=d,m+=e,l+=g,b.vertices.push(new THREE.Vertex(new THREE.Vector3(k,m,l)))})(f[0],8,0);(function(a,b,c){for(var d,e,f=a.length;c<f;c+=b)d=a[c],e=a[c+1],d/=1023,e/=1023,l.push(d,1-e)})(f[0],8,3);(function(a,
-b,c){for(var d,e,f,g=a.length;c<g;c+=b)d=a[c],e=a[c+1],f=a[c+2],d=(d-512)/511,e=(e-512)/511,f=(f-512)/511,k.push(d,e,f)})(f[0],8,5);(function(a){var c,d,e,f,g,i,t,w,u,v=a.length;for(c=0;c<v;c+=3){d=a[c];e=a[c+1];f=a[c+2];g=b;w=d;u=e;i=f;var y=k[3*e],D=k[3*e+1],A=k[3*e+2],C=k[3*f],E=k[3*f+1],J=k[3*f+2];t=new THREE.Vector3(k[3*d],k[3*d+1],k[3*d+2]);y=new THREE.Vector3(y,D,A);C=new THREE.Vector3(C,E,J);g.faces.push(new THREE.Face3(w,u,i,[t,y,C],null,0));g=l[2*d];d=l[2*d+1];i=l[2*e];t=l[2*e+1];w=l[2*
-f];u=l[2*f+1];f=b.faceVertexUvs[0];e=i;i=t;t=[];t.push(new THREE.UV(g,d));t.push(new THREE.UV(e,i));t.push(new THREE.UV(w,u));f.push(t)}})(f[1]);this.computeCentroids();this.computeFaceNormals()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;b(new f)};
+THREE.UTF8Loader.prototype.createModel=function(a,b,c,d,e,g){var f=function(){var b=this;b.materials=[];THREE.Geometry.call(this);var f=THREE.UTF8Loader.prototype.decompressMesh(a),l=[],k=[];(function(a,f,i){for(var k,l,r,s=a.length;i<s;i+=f)k=a[i],l=a[i+1],r=a[i+2],k=k/16383*c,l=l/16383*c,r=r/16383*c,k+=d,l+=e,r+=g,b.vertices.push(new THREE.Vertex(new THREE.Vector3(k,l,r)))})(f[0],8,0);(function(a,b,c){for(var d,e,f=a.length;c<f;c+=b)d=a[c],e=a[c+1],d/=1023,e/=1023,k.push(d,1-e)})(f[0],8,3);(function(a,
+b,c){for(var d,e,f,g=a.length;c<g;c+=b)d=a[c],e=a[c+1],f=a[c+2],d=(d-512)/511,e=(e-512)/511,f=(f-512)/511,l.push(d,e,f)})(f[0],8,5);(function(a){var c,d,e,f,g,i,t,w,u,v=a.length;for(c=0;c<v;c+=3){d=a[c];e=a[c+1];f=a[c+2];g=b;w=d;u=e;i=f;var y=l[3*e],C=l[3*e+1],A=l[3*e+2],B=l[3*f],D=l[3*f+1],J=l[3*f+2];t=new THREE.Vector3(l[3*d],l[3*d+1],l[3*d+2]);y=new THREE.Vector3(y,C,A);B=new THREE.Vector3(B,D,J);g.faces.push(new THREE.Face3(w,u,i,[t,y,B],null,0));g=k[2*d];d=k[2*d+1];i=k[2*e];t=k[2*e+1];w=k[2*
+f];u=k[2*f+1];f=b.faceVertexUvs[0];e=i;i=t;t=[];t.push(new THREE.UV(g,d));t.push(new THREE.UV(e,i));t.push(new THREE.UV(w,u));f.push(t)}})(f[1]);this.computeCentroids();this.computeFaceNormals()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;b(new f)};
 THREE.MarchingCubes=function(a,b){THREE.Object3D.call(this);this.material=b;this.init=function(a){this.resolution=a;this.isolation=80;this.size=a;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(3*this.size3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=0;this.hasNormal=
 THREE.MarchingCubes=function(a,b){THREE.Object3D.call(this);this.material=b;this.init=function(a){this.resolution=a;this.isolation=80;this.size=a;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(3*this.size3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=0;this.hasNormal=
-this.hasPos=!1;this.positionArray=new Float32Array(3*this.maxCount);this.normalArray=new Float32Array(3*this.maxCount)};this.lerp=function(a,b,e){return a+(b-a)*e};this.VIntX=function(a,b,e,g,f,h,i,k,l,p){f=(f-l)/(p-l);l=this.normal_cache;b[g]=h+f*this.delta;b[g+1]=i;b[g+2]=k;e[g]=this.lerp(l[a],l[a+3],f);e[g+1]=this.lerp(l[a+1],l[a+4],f);e[g+2]=this.lerp(l[a+2],l[a+5],f)};this.VIntY=function(a,b,e,g,f,h,i,k,l,p){f=(f-l)/(p-l);l=this.normal_cache;b[g]=h;b[g+1]=i+f*this.delta;b[g+2]=k;b=a+3*this.yd;
-e[g]=this.lerp(l[a],l[b],f);e[g+1]=this.lerp(l[a+1],l[b+1],f);e[g+2]=this.lerp(l[a+2],l[b+2],f)};this.VIntZ=function(a,b,e,g,f,h,i,k,l,p){f=(f-l)/(p-l);l=this.normal_cache;b[g]=h;b[g+1]=i;b[g+2]=k+f*this.delta;b=a+3*this.zd;e[g]=this.lerp(l[a],l[b],f);e[g+1]=this.lerp(l[a+1],l[b+1],f);e[g+2]=this.lerp(l[a+2],l[b+2],f)};this.compNorm=function(a){var b=3*a;0===this.normal_cache[b]&&(this.normal_cache[b]=this.field[a-1]-this.field[a+1],this.normal_cache[b+1]=this.field[a-this.yd]-this.field[a+this.yd],
-this.normal_cache[b+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,b,e,g,f,h){var i=g+1,k=g+this.yd,l=g+this.zd,p=i+this.yd,n=i+this.zd,o=g+this.yd+this.zd,q=i+this.yd+this.zd,m=0,r=this.field[g],s=this.field[i],t=this.field[k],w=this.field[p],u=this.field[l],v=this.field[n],y=this.field[o],D=this.field[q];r<f&&(m|=1);s<f&&(m|=2);t<f&&(m|=8);w<f&&(m|=4);u<f&&(m|=16);v<f&&(m|=32);y<f&&(m|=128);D<f&&(m|=64);var A=THREE.edgeTable[m];if(0===A)return 0;var C=this.delta,E=a+
-C,J=b+C,C=e+C;A&1&&(this.compNorm(g),this.compNorm(i),this.VIntX(3*g,this.vlist,this.nlist,0,f,a,b,e,r,s));A&2&&(this.compNorm(i),this.compNorm(p),this.VIntY(3*i,this.vlist,this.nlist,3,f,E,b,e,s,w));A&4&&(this.compNorm(k),this.compNorm(p),this.VIntX(3*k,this.vlist,this.nlist,6,f,a,J,e,t,w));A&8&&(this.compNorm(g),this.compNorm(k),this.VIntY(3*g,this.vlist,this.nlist,9,f,a,b,e,r,t));A&16&&(this.compNorm(l),this.compNorm(n),this.VIntX(3*l,this.vlist,this.nlist,12,f,a,b,C,u,v));A&32&&(this.compNorm(n),
-this.compNorm(q),this.VIntY(3*n,this.vlist,this.nlist,15,f,E,b,C,v,D));A&64&&(this.compNorm(o),this.compNorm(q),this.VIntX(3*o,this.vlist,this.nlist,18,f,a,J,C,y,D));A&128&&(this.compNorm(l),this.compNorm(o),this.VIntY(3*l,this.vlist,this.nlist,21,f,a,b,C,u,y));A&256&&(this.compNorm(g),this.compNorm(l),this.VIntZ(3*g,this.vlist,this.nlist,24,f,a,b,e,r,u));A&512&&(this.compNorm(i),this.compNorm(n),this.VIntZ(3*i,this.vlist,this.nlist,27,f,E,b,e,s,v));A&1024&&(this.compNorm(p),this.compNorm(q),this.VIntZ(3*
-p,this.vlist,this.nlist,30,f,E,J,e,w,D));A&2048&&(this.compNorm(k),this.compNorm(o),this.VIntZ(3*k,this.vlist,this.nlist,33,f,a,J,e,t,y));m<<=4;for(f=g=0;-1!=THREE.triTable[m+f];)a=m+f,b=a+1,e=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[b],3*THREE.triTable[e],h),f+=3,g++;return g};this.posnormtriv=function(a,b,e,g,f,h){var i=3*this.count;this.positionArray[i]=a[e];this.positionArray[i+1]=a[e+1];this.positionArray[i+2]=a[e+2];this.positionArray[i+3]=a[g];this.positionArray[i+
+this.hasPos=!1;this.positionArray=new Float32Array(3*this.maxCount);this.normalArray=new Float32Array(3*this.maxCount)};this.lerp=function(a,b,e){return a+(b-a)*e};this.VIntX=function(a,b,e,g,f,h,i,l,k,p){f=(f-k)/(p-k);k=this.normal_cache;b[g]=h+f*this.delta;b[g+1]=i;b[g+2]=l;e[g]=this.lerp(k[a],k[a+3],f);e[g+1]=this.lerp(k[a+1],k[a+4],f);e[g+2]=this.lerp(k[a+2],k[a+5],f)};this.VIntY=function(a,b,e,g,f,h,i,l,k,p){f=(f-k)/(p-k);k=this.normal_cache;b[g]=h;b[g+1]=i+f*this.delta;b[g+2]=l;b=a+3*this.yd;
+e[g]=this.lerp(k[a],k[b],f);e[g+1]=this.lerp(k[a+1],k[b+1],f);e[g+2]=this.lerp(k[a+2],k[b+2],f)};this.VIntZ=function(a,b,e,g,f,h,i,l,k,p){f=(f-k)/(p-k);k=this.normal_cache;b[g]=h;b[g+1]=i;b[g+2]=l+f*this.delta;b=a+3*this.zd;e[g]=this.lerp(k[a],k[b],f);e[g+1]=this.lerp(k[a+1],k[b+1],f);e[g+2]=this.lerp(k[a+2],k[b+2],f)};this.compNorm=function(a){var b=3*a;0===this.normal_cache[b]&&(this.normal_cache[b]=this.field[a-1]-this.field[a+1],this.normal_cache[b+1]=this.field[a-this.yd]-this.field[a+this.yd],
+this.normal_cache[b+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,b,e,g,f,h){var i=g+1,l=g+this.yd,k=g+this.zd,p=i+this.yd,n=i+this.zd,o=g+this.yd+this.zd,q=i+this.yd+this.zd,m=0,r=this.field[g],s=this.field[i],t=this.field[l],w=this.field[p],u=this.field[k],v=this.field[n],y=this.field[o],C=this.field[q];r<f&&(m|=1);s<f&&(m|=2);t<f&&(m|=8);w<f&&(m|=4);u<f&&(m|=16);v<f&&(m|=32);y<f&&(m|=128);C<f&&(m|=64);var A=THREE.edgeTable[m];if(0===A)return 0;var B=this.delta,D=a+
+B,J=b+B,B=e+B;A&1&&(this.compNorm(g),this.compNorm(i),this.VIntX(3*g,this.vlist,this.nlist,0,f,a,b,e,r,s));A&2&&(this.compNorm(i),this.compNorm(p),this.VIntY(3*i,this.vlist,this.nlist,3,f,D,b,e,s,w));A&4&&(this.compNorm(l),this.compNorm(p),this.VIntX(3*l,this.vlist,this.nlist,6,f,a,J,e,t,w));A&8&&(this.compNorm(g),this.compNorm(l),this.VIntY(3*g,this.vlist,this.nlist,9,f,a,b,e,r,t));A&16&&(this.compNorm(k),this.compNorm(n),this.VIntX(3*k,this.vlist,this.nlist,12,f,a,b,B,u,v));A&32&&(this.compNorm(n),
+this.compNorm(q),this.VIntY(3*n,this.vlist,this.nlist,15,f,D,b,B,v,C));A&64&&(this.compNorm(o),this.compNorm(q),this.VIntX(3*o,this.vlist,this.nlist,18,f,a,J,B,y,C));A&128&&(this.compNorm(k),this.compNorm(o),this.VIntY(3*k,this.vlist,this.nlist,21,f,a,b,B,u,y));A&256&&(this.compNorm(g),this.compNorm(k),this.VIntZ(3*g,this.vlist,this.nlist,24,f,a,b,e,r,u));A&512&&(this.compNorm(i),this.compNorm(n),this.VIntZ(3*i,this.vlist,this.nlist,27,f,D,b,e,s,v));A&1024&&(this.compNorm(p),this.compNorm(q),this.VIntZ(3*
+p,this.vlist,this.nlist,30,f,D,J,e,w,C));A&2048&&(this.compNorm(l),this.compNorm(o),this.VIntZ(3*l,this.vlist,this.nlist,33,f,a,J,e,t,y));m<<=4;for(f=g=0;-1!=THREE.triTable[m+f];)a=m+f,b=a+1,e=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[b],3*THREE.triTable[e],h),f+=3,g++;return g};this.posnormtriv=function(a,b,e,g,f,h){var i=3*this.count;this.positionArray[i]=a[e];this.positionArray[i+1]=a[e+1];this.positionArray[i+2]=a[e+2];this.positionArray[i+3]=a[g];this.positionArray[i+
 4]=a[g+1];this.positionArray[i+5]=a[g+2];this.positionArray[i+6]=a[f];this.positionArray[i+7]=a[f+1];this.positionArray[i+8]=a[f+2];this.normalArray[i]=b[e];this.normalArray[i+1]=b[e+1];this.normalArray[i+2]=b[e+2];this.normalArray[i+3]=b[g];this.normalArray[i+4]=b[g+1];this.normalArray[i+5]=b[g+2];this.normalArray[i+6]=b[f];this.normalArray[i+7]=b[f+1];this.normalArray[i+8]=b[f+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&h(this)};this.begin=function(){this.count=0;
 4]=a[g+1];this.positionArray[i+5]=a[g+2];this.positionArray[i+6]=a[f];this.positionArray[i+7]=a[f+1];this.positionArray[i+8]=a[f+2];this.normalArray[i]=b[e];this.normalArray[i+1]=b[e+1];this.normalArray[i+2]=b[e+2];this.normalArray[i+3]=b[g];this.normalArray[i+4]=b[g+1];this.normalArray[i+5]=b[g+2];this.normalArray[i+6]=b[f];this.normalArray[i+7]=b[f+1];this.normalArray[i+8]=b[f+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&h(this)};this.begin=function(){this.count=0;
-this.hasNormal=this.hasPos=!1};this.end=function(a){if(0!==this.count){for(var b=3*this.count;b<this.positionArray.length;b++)this.positionArray[b]=0;a(this)}};this.addBall=function(a,b,e,g,f){var h=this.size*Math.sqrt(g/f),i=e*this.size,k=b*this.size,l=a*this.size,p=Math.floor(i-h);1>p&&(p=1);i=Math.floor(i+h);i>this.size-1&&(i=this.size-1);var n=Math.floor(k-h);1>n&&(n=1);k=Math.floor(k+h);k>this.size-1&&(k=this.size-1);var o=Math.floor(l-h);1>o&&(o=1);h=Math.floor(l+h);h>this.size-1&&(h=this.size-
-1);for(var q,m,r,s,t,w,u,l=p;l<i;l++){r=this.size2*l;t=l/this.size-e;w=t*t;for(p=n;p<k;p++){m=r+this.size*p;q=p/this.size-b;u=q*q;for(q=o;q<h;q++)s=q/this.size-a,s=g/(1.0E-6+s*s+u+w)-f,0<s&&(this.field[m+q]+=s)}}};this.addPlaneX=function(a,b){var e,g,f,h,i,k=this.size,l=this.yd,p=this.zd,n=this.field,o=k*Math.sqrt(a/b);o>k&&(o=k);for(e=0;e<o;e++)if(g=e/k,g*=g,h=a/(1.0E-4+g)-b,0<h)for(g=0;g<k;g++){i=e+g*l;for(f=0;f<k;f++)n[p*f+i]+=h}};this.addPlaneY=function(a,b){var e,g,f,h,i,k,l=this.size,p=this.yd,
-n=this.zd,o=this.field,q=l*Math.sqrt(a/b);q>l&&(q=l);for(g=0;g<q;g++)if(e=g/l,e*=e,h=a/(1.0E-4+e)-b,0<h){i=g*p;for(e=0;e<l;e++){k=i+e;for(f=0;f<l;f++)o[n*f+k]+=h}}};this.addPlaneZ=function(a,b){var e,g,f,h,i,k,l=this.size,p=this.yd,n=this.zd,o=this.field,q=l*Math.sqrt(a/b);q>l&&(q=l);for(f=0;f<q;f++)if(e=f/l,e*=e,h=a/(1.0E-4+e)-b,0<h){i=n*f;for(g=0;g<l;g++){k=i+g*p;for(e=0;e<l;e++)o[k+e]+=h}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[3*a]=0,this.field[a]=0};this.render=
-function(a){this.begin();var b,e,g,f,h,i,k,l,p,n=this.size-2;for(f=1;f<n;f++){p=this.size2*f;k=(f-this.halfsize)/this.halfsize;for(g=1;g<n;g++){l=p+this.size*g;i=(g-this.halfsize)/this.halfsize;for(e=1;e<n;e++)h=(e-this.halfsize)/this.halfsize,b=l+e,this.polygonize(h,i,k,b,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,b=new THREE.Geometry,e=[];this.render(function(g){var f,h,i,k,l,p,n,o;for(f=0;f<g.count;f++)n=3*f,l=n+1,o=n+2,h=g.positionArray[n],i=g.positionArray[l],k=
-g.positionArray[o],p=new THREE.Vector3(h,i,k),h=g.normalArray[n],i=g.normalArray[l],k=g.normalArray[o],n=new THREE.Vector3(h,i,k),n.normalize(),l=new THREE.Vertex(p),b.vertices.push(l),e.push(n);p=g.count/3;for(f=0;f<p;f++)n=3*(a+f),l=n+1,o=n+2,h=e[n],i=e[l],k=e[o],n=new THREE.Face3(n,l,o,[h,i,k]),b.faces.push(n);a+=p;g.count=0});return b};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
+this.hasNormal=this.hasPos=!1};this.end=function(a){if(0!==this.count){for(var b=3*this.count;b<this.positionArray.length;b++)this.positionArray[b]=0;a(this)}};this.addBall=function(a,b,e,g,f){var h=this.size*Math.sqrt(g/f),i=e*this.size,l=b*this.size,k=a*this.size,p=Math.floor(i-h);1>p&&(p=1);i=Math.floor(i+h);i>this.size-1&&(i=this.size-1);var n=Math.floor(l-h);1>n&&(n=1);l=Math.floor(l+h);l>this.size-1&&(l=this.size-1);var o=Math.floor(k-h);1>o&&(o=1);h=Math.floor(k+h);h>this.size-1&&(h=this.size-
+1);for(var q,m,r,s,t,w,u,k=p;k<i;k++){r=this.size2*k;t=k/this.size-e;w=t*t;for(p=n;p<l;p++){m=r+this.size*p;q=p/this.size-b;u=q*q;for(q=o;q<h;q++)s=q/this.size-a,s=g/(1.0E-6+s*s+u+w)-f,0<s&&(this.field[m+q]+=s)}}};this.addPlaneX=function(a,b){var e,g,f,h,i,l=this.size,k=this.yd,p=this.zd,n=this.field,o=l*Math.sqrt(a/b);o>l&&(o=l);for(e=0;e<o;e++)if(g=e/l,g*=g,h=a/(1.0E-4+g)-b,0<h)for(g=0;g<l;g++){i=e+g*k;for(f=0;f<l;f++)n[p*f+i]+=h}};this.addPlaneY=function(a,b){var e,g,f,h,i,l,k=this.size,p=this.yd,
+n=this.zd,o=this.field,q=k*Math.sqrt(a/b);q>k&&(q=k);for(g=0;g<q;g++)if(e=g/k,e*=e,h=a/(1.0E-4+e)-b,0<h){i=g*p;for(e=0;e<k;e++){l=i+e;for(f=0;f<k;f++)o[n*f+l]+=h}}};this.addPlaneZ=function(a,b){var e,g,f,h,i,l,k=this.size,p=this.yd,n=this.zd,o=this.field,q=k*Math.sqrt(a/b);q>k&&(q=k);for(f=0;f<q;f++)if(e=f/k,e*=e,h=a/(1.0E-4+e)-b,0<h){i=n*f;for(g=0;g<k;g++){l=i+g*p;for(e=0;e<k;e++)o[l+e]+=h}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[3*a]=0,this.field[a]=0};this.render=
+function(a){this.begin();var b,e,g,f,h,i,l,k,p,n=this.size-2;for(f=1;f<n;f++){p=this.size2*f;l=(f-this.halfsize)/this.halfsize;for(g=1;g<n;g++){k=p+this.size*g;i=(g-this.halfsize)/this.halfsize;for(e=1;e<n;e++)h=(e-this.halfsize)/this.halfsize,b=k+e,this.polygonize(h,i,l,b,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,b=new THREE.Geometry,e=[];this.render(function(g){var f,h,i,l,k,p,n,o;for(f=0;f<g.count;f++)n=3*f,k=n+1,o=n+2,h=g.positionArray[n],i=g.positionArray[k],l=
+g.positionArray[o],p=new THREE.Vector3(h,i,l),h=g.normalArray[n],i=g.normalArray[k],l=g.normalArray[o],n=new THREE.Vector3(h,i,l),n.normalize(),k=new THREE.Vertex(p),b.vertices.push(k),e.push(n);p=g.count/3;for(f=0;f<p;f++)n=3*(a+f),k=n+1,o=n+2,h=e[n],i=e[k],l=e[o],n=new THREE.Face3(n,k,o,[h,i,l]),b.faces.push(n);a+=p;g.count=0});return b};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
 THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
 THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
 1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,
 1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,
 419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]);
 419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]);
@@ -750,38 +750,38 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 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.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=new THREE.Object3D;THREE.LensFlare.prototype.constructor=THREE.LensFlare;
 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.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=new THREE.Object3D;THREE.LensFlare.prototype.constructor=THREE.LensFlare;
 THREE.LensFlare.prototype.supr=THREE.Object3D.prototype;THREE.LensFlare.prototype.add=function(a,b,c,d,e,g){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===g&&(g=1);void 0===e&&(e=new THREE.Color(16777215));if(void 0===d)d=THREE.NormalBlending;c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:g,color:e,blending:d})};
 THREE.LensFlare.prototype.supr=THREE.Object3D.prototype;THREE.LensFlare.prototype.add=function(a,b,c,d,e,g){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===g&&(g=1);void 0===e&&(e=new THREE.Color(16777215));if(void 0===d)d=THREE.NormalBlending;c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:g,color:e,blending:d})};
 THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a<b;a++)c=this.lensFlares[a],c.x=this.positionScreen.x+d*c.distance,c.y=this.positionScreen.y+e*c.distance,c.wantedRotation=0.25*c.x*Math.PI,c.rotation+=0.25*(c.wantedRotation-c.rotation)};
 THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a<b;a++)c=this.lensFlares[a],c.x=this.positionScreen.x+d*c.distance,c.y=this.positionScreen.y+e*c.distance,c.wantedRotation=0.25*c.x*Math.PI,c.rotation+=0.25*(c.wantedRotation-c.rotation)};
-THREE.LensFlarePlugin=function(){function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER),e=b.createShader(b.VERTEX_SHADER);b.shaderSource(d,a.fragmentShader);b.shaderSource(e,a.vertexShader);b.compileShader(d);b.compileShader(e);b.attachShader(c,d);b.attachShader(c,e);b.linkProgram(c);return c}var b,c,d,e,g,f,h,i,k,l,p,n,o;this.init=function(q){b=q.context;c=q;d=new Float32Array(16);e=new Uint16Array(6);q=0;d[q++]=-1;d[q++]=-1;d[q++]=0;d[q++]=0;d[q++]=1;d[q++]=-1;d[q++]=1;d[q++]=
+THREE.LensFlarePlugin=function(){function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER),e=b.createShader(b.VERTEX_SHADER);b.shaderSource(d,a.fragmentShader);b.shaderSource(e,a.vertexShader);b.compileShader(d);b.compileShader(e);b.attachShader(c,d);b.attachShader(c,e);b.linkProgram(c);return c}var b,c,d,e,g,f,h,i,l,k,p,n,o;this.init=function(q){b=q.context;c=q;d=new Float32Array(16);e=new Uint16Array(6);q=0;d[q++]=-1;d[q++]=-1;d[q++]=0;d[q++]=0;d[q++]=1;d[q++]=-1;d[q++]=1;d[q++]=
 0;d[q++]=1;d[q++]=1;d[q++]=1;d[q++]=1;d[q++]=-1;d[q++]=1;d[q++]=0;d[q++]=1;q=0;e[q++]=0;e[q++]=1;e[q++]=2;e[q++]=0;e[q++]=2;e[q++]=3;g=b.createBuffer();f=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,f);b.bufferData(b.ELEMENT_ARRAY_BUFFER,e,b.STATIC_DRAW);h=b.createTexture();i=b.createTexture();b.bindTexture(b.TEXTURE_2D,h);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,
 0;d[q++]=1;d[q++]=1;d[q++]=1;d[q++]=1;d[q++]=-1;d[q++]=1;d[q++]=0;d[q++]=1;q=0;e[q++]=0;e[q++]=1;e[q++]=2;e[q++]=0;e[q++]=2;e[q++]=3;g=b.createBuffer();f=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,f);b.bufferData(b.ELEMENT_ARRAY_BUFFER,e,b.STATIC_DRAW);h=b.createTexture();i=b.createTexture();b.bindTexture(b.TEXTURE_2D,h);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,
 b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,i);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);
 b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,i);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);
-b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(k=!1,l=a(THREE.ShaderFlares.lensFlare)):(k=!0,l=a(THREE.ShaderFlares.lensFlareVertexTexture));p={};n={};p.vertex=b.getAttribLocation(l,"position");p.uv=b.getAttribLocation(l,"uv");n.renderType=b.getUniformLocation(l,"renderType");n.map=b.getUniformLocation(l,"map");n.occlusionMap=b.getUniformLocation(l,"occlusionMap");n.opacity=b.getUniformLocation(l,"opacity");n.color=b.getUniformLocation(l,
-"color");n.scale=b.getUniformLocation(l,"scale");n.rotation=b.getUniformLocation(l,"rotation");n.screenPosition=b.getUniformLocation(l,"screenPosition");o=!1};this.render=function(a,d,e,s){var a=a.__webglFlares,t=a.length;if(t){var w=new THREE.Vector3,u=s/e,v=0.5*e,y=0.5*s,D=16/s,A=new THREE.Vector2(D*u,D),C=new THREE.Vector3(1,1,0),E=new THREE.Vector2(1,1),J=n,D=p;b.useProgram(l);o||(b.enableVertexAttribArray(p.vertex),b.enableVertexAttribArray(p.uv),o=!0);b.uniform1i(J.occlusionMap,0);b.uniform1i(J.map,
-1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(D.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(D.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,f);b.disable(b.CULL_FACE);b.depthMask(!1);var N,T,K,P,M;for(N=0;N<t;N++)if(D=16/s,A.set(D*u,D),P=a[N],w.set(P.matrixWorld.n14,P.matrixWorld.n24,P.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(w),d.projectionMatrix.multiplyVector3(w),C.copy(w),E.x=C.x*v+v,E.y=C.y*y+y,k||0<E.x&&E.x<e&&0<E.y&&E.y<s){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,
-h);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,E.x-8,E.y-8,16,16,0);b.uniform1i(J.renderType,0);b.uniform2f(J.scale,A.x,A.y);b.uniform3f(J.screenPosition,C.x,C.y,C.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,E.x-8,E.y-8,16,16,0);b.uniform1i(J.renderType,1);b.disable(b.DEPTH_TEST);b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,h);b.drawElements(b.TRIANGLES,
-6,b.UNSIGNED_SHORT,0);P.positionScreen.copy(C);P.customUpdateCallback?P.customUpdateCallback(P):P.updateLensFlares();b.uniform1i(J.renderType,2);b.enable(b.BLEND);for(T=0,K=P.lensFlares.length;T<K;T++)if(M=P.lensFlares[T],0.0010<M.opacity&&0.0010<M.scale)C.x=M.x,C.y=M.y,C.z=M.z,D=M.size*M.scale/s,A.x=D*u,A.y=D,b.uniform3f(J.screenPosition,C.x,C.y,C.z),b.uniform2f(J.scale,A.x,A.y),b.uniform1f(J.rotation,M.rotation),b.uniform1f(J.opacity,M.opacity),b.uniform3f(J.color,M.color.r,M.color.g,M.color.b),
-c.setBlending(M.blending),c.setTexture(M.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
+b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(l=!1,k=a(THREE.ShaderFlares.lensFlare)):(l=!0,k=a(THREE.ShaderFlares.lensFlareVertexTexture));p={};n={};p.vertex=b.getAttribLocation(k,"position");p.uv=b.getAttribLocation(k,"uv");n.renderType=b.getUniformLocation(k,"renderType");n.map=b.getUniformLocation(k,"map");n.occlusionMap=b.getUniformLocation(k,"occlusionMap");n.opacity=b.getUniformLocation(k,"opacity");n.color=b.getUniformLocation(k,
+"color");n.scale=b.getUniformLocation(k,"scale");n.rotation=b.getUniformLocation(k,"rotation");n.screenPosition=b.getUniformLocation(k,"screenPosition");o=!1};this.render=function(a,d,e,s){var a=a.__webglFlares,t=a.length;if(t){var w=new THREE.Vector3,u=s/e,v=0.5*e,y=0.5*s,C=16/s,A=new THREE.Vector2(C*u,C),B=new THREE.Vector3(1,1,0),D=new THREE.Vector2(1,1),J=n,C=p;b.useProgram(k);o||(b.enableVertexAttribArray(p.vertex),b.enableVertexAttribArray(p.uv),o=!0);b.uniform1i(J.occlusionMap,0);b.uniform1i(J.map,
+1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(C.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(C.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,f);b.disable(b.CULL_FACE);b.depthMask(!1);var N,S,K,P,M;for(N=0;N<t;N++)if(C=16/s,A.set(C*u,C),P=a[N],w.set(P.matrixWorld.n14,P.matrixWorld.n24,P.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(w),d.projectionMatrix.multiplyVector3(w),B.copy(w),D.x=B.x*v+v,D.y=B.y*y+y,l||0<D.x&&D.x<e&&0<D.y&&D.y<s){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,
+h);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,D.x-8,D.y-8,16,16,0);b.uniform1i(J.renderType,0);b.uniform2f(J.scale,A.x,A.y);b.uniform3f(J.screenPosition,B.x,B.y,B.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,D.x-8,D.y-8,16,16,0);b.uniform1i(J.renderType,1);b.disable(b.DEPTH_TEST);b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,h);b.drawElements(b.TRIANGLES,
+6,b.UNSIGNED_SHORT,0);P.positionScreen.copy(B);P.customUpdateCallback?P.customUpdateCallback(P):P.updateLensFlares();b.uniform1i(J.renderType,2);b.enable(b.BLEND);for(S=0,K=P.lensFlares.length;S<K;S++)if(M=P.lensFlares[S],0.001<M.opacity&&0.001<M.scale)B.x=M.x,B.y=M.y,B.z=M.z,C=M.size*M.scale/s,A.x=C*u,A.y=C,b.uniform3f(J.screenPosition,B.x,B.y,B.z),b.uniform2f(J.scale,A.x,A.y),b.uniform1f(J.rotation,M.rotation),b.uniform1f(J.opacity,M.opacity),b.uniform3f(J.color,M.color.r,M.color.g,M.color.b),c.setBlending(M.blending),
+c.setTexture(M.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
 THREE.ShadowMapPlugin=function(){var a,b,c,d,e=new THREE.Frustum,g=new THREE.Matrix4,f=new THREE.Vector3,h=new THREE.Vector3;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:!0});c._shadowPass=!0;d._shadowPass=!0};this.render=function(a,
 THREE.ShadowMapPlugin=function(){var a,b,c,d,e=new THREE.Frustum,g=new THREE.Matrix4,f=new THREE.Vector3,h=new THREE.Vector3;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:!0});c._shadowPass=!0;d._shadowPass=!0};this.render=function(a,
-c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(i,k){var l,p,n,o,q,m,r,s,t,w=[];o=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.shadowMapCullFrontFaces&&a.cullFace(a.FRONT);b.setDepthTest(!0);for(l=0,p=i.lights.length;l<p;l++)if(n=i.lights[l],n.castShadow)if(n instanceof THREE.DirectionalLight&&n.shadowCascade)for(q=0;q<n.shadowCascadeCount;q++){var u;if(n.shadowCascadeArray[q])u=n.shadowCascadeArray[q];else{t=n;r=q;u=new THREE.DirectionalLight;u.isVirtual=!0;u.onlyShadow=
+c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(i,l){var k,p,n,o,q,m,r,s,t,w=[];o=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.shadowMapCullFrontFaces&&a.cullFace(a.FRONT);b.setDepthTest(!0);for(k=0,p=i.lights.length;k<p;k++)if(n=i.lights[k],n.castShadow)if(n instanceof THREE.DirectionalLight&&n.shadowCascade)for(q=0;q<n.shadowCascadeCount;q++){var u;if(n.shadowCascadeArray[q])u=n.shadowCascadeArray[q];else{t=n;r=q;u=new THREE.DirectionalLight;u.isVirtual=!0;u.onlyShadow=
 !0;u.castShadow=!0;u.shadowCameraNear=t.shadowCameraNear;u.shadowCameraFar=t.shadowCameraFar;u.shadowCameraLeft=t.shadowCameraLeft;u.shadowCameraRight=t.shadowCameraRight;u.shadowCameraBottom=t.shadowCameraBottom;u.shadowCameraTop=t.shadowCameraTop;u.shadowCameraVisible=t.shadowCameraVisible;u.shadowDarkness=t.shadowDarkness;u.shadowBias=t.shadowCascadeBias[r];u.shadowMapWidth=t.shadowCascadeWidth[r];u.shadowMapHeight=t.shadowCascadeHeight[r];u.pointsWorld=[];u.pointsFrustum=[];s=u.pointsWorld;m=
 !0;u.castShadow=!0;u.shadowCameraNear=t.shadowCameraNear;u.shadowCameraFar=t.shadowCameraFar;u.shadowCameraLeft=t.shadowCameraLeft;u.shadowCameraRight=t.shadowCameraRight;u.shadowCameraBottom=t.shadowCameraBottom;u.shadowCameraTop=t.shadowCameraTop;u.shadowCameraVisible=t.shadowCameraVisible;u.shadowDarkness=t.shadowDarkness;u.shadowBias=t.shadowCascadeBias[r];u.shadowMapWidth=t.shadowCascadeWidth[r];u.shadowMapHeight=t.shadowCascadeHeight[r];u.pointsWorld=[];u.pointsFrustum=[];s=u.pointsWorld;m=
-u.pointsFrustum;for(var v=0;8>v;v++)s[v]=new THREE.Vector3,m[v]=new THREE.Vector3;s=t.shadowCascadeNearZ[r];t=t.shadowCascadeFarZ[r];m[0].set(-1,-1,s);m[1].set(1,-1,s);m[2].set(-1,1,s);m[3].set(1,1,s);m[4].set(-1,-1,t);m[5].set(1,-1,t);m[6].set(-1,1,t);m[7].set(1,1,t);u.originalCamera=k;m=new THREE.Gyroscope;m.position=n.shadowCascadeOffset;m.add(u);m.add(u.target);k.add(m);n.shadowCascadeArray[q]=u;console.log("Created virtualLight",u)}r=n;s=q;t=r.shadowCascadeArray[s];t.position.copy(r.position);
-t.target.position.copy(r.target.position);t.lookAt(t.target);t.shadowCameraVisible=r.shadowCameraVisible;t.shadowDarkness=r.shadowDarkness;t.shadowBias=r.shadowCascadeBias[s];m=r.shadowCascadeNearZ[s];r=r.shadowCascadeFarZ[s];t=t.pointsFrustum;t[0].z=m;t[1].z=m;t[2].z=m;t[3].z=m;t[4].z=r;t[5].z=r;t[6].z=r;t[7].z=r;w[o]=u;o++}else w[o]=n,o++;for(l=0,p=w.length;l<p;l++){n=w[l];if(!n.shadowMap)n.shadowMap=new THREE.WebGLRenderTarget(n.shadowMapWidth,n.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,
+u.pointsFrustum;for(var v=0;8>v;v++)s[v]=new THREE.Vector3,m[v]=new THREE.Vector3;s=t.shadowCascadeNearZ[r];t=t.shadowCascadeFarZ[r];m[0].set(-1,-1,s);m[1].set(1,-1,s);m[2].set(-1,1,s);m[3].set(1,1,s);m[4].set(-1,-1,t);m[5].set(1,-1,t);m[6].set(-1,1,t);m[7].set(1,1,t);u.originalCamera=l;m=new THREE.Gyroscope;m.position=n.shadowCascadeOffset;m.add(u);m.add(u.target);l.add(m);n.shadowCascadeArray[q]=u;console.log("Created virtualLight",u)}r=n;s=q;t=r.shadowCascadeArray[s];t.position.copy(r.position);
+t.target.position.copy(r.target.position);t.lookAt(t.target);t.shadowCameraVisible=r.shadowCameraVisible;t.shadowDarkness=r.shadowDarkness;t.shadowBias=r.shadowCascadeBias[s];m=r.shadowCascadeNearZ[s];r=r.shadowCascadeFarZ[s];t=t.pointsFrustum;t[0].z=m;t[1].z=m;t[2].z=m;t[3].z=m;t[4].z=r;t[5].z=r;t[6].z=r;t[7].z=r;w[o]=u;o++}else w[o]=n,o++;for(k=0,p=w.length;k<p;k++){n=w[k];if(!n.shadowMap)n.shadowMap=new THREE.WebGLRenderTarget(n.shadowMapWidth,n.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,
 format:THREE.RGBAFormat}),n.shadowMapSize=new THREE.Vector2(n.shadowMapWidth,n.shadowMapHeight),n.shadowMatrix=new THREE.Matrix4;if(!n.shadowCamera){if(n instanceof THREE.SpotLight)n.shadowCamera=new THREE.PerspectiveCamera(n.shadowCameraFov,n.shadowMapWidth/n.shadowMapHeight,n.shadowCameraNear,n.shadowCameraFar);else if(n instanceof THREE.DirectionalLight)n.shadowCamera=new THREE.OrthographicCamera(n.shadowCameraLeft,n.shadowCameraRight,n.shadowCameraTop,n.shadowCameraBottom,n.shadowCameraNear,n.shadowCameraFar);
 format:THREE.RGBAFormat}),n.shadowMapSize=new THREE.Vector2(n.shadowMapWidth,n.shadowMapHeight),n.shadowMatrix=new THREE.Matrix4;if(!n.shadowCamera){if(n instanceof THREE.SpotLight)n.shadowCamera=new THREE.PerspectiveCamera(n.shadowCameraFov,n.shadowMapWidth/n.shadowMapHeight,n.shadowCameraNear,n.shadowCameraFar);else if(n instanceof THREE.DirectionalLight)n.shadowCamera=new THREE.OrthographicCamera(n.shadowCameraLeft,n.shadowCameraRight,n.shadowCameraTop,n.shadowCameraBottom,n.shadowCameraNear,n.shadowCameraFar);
-else{console.error("Unsupported light type for shadow");continue}i.add(n.shadowCamera);b.autoUpdateScene&&i.updateMatrixWorld()}if(n.shadowCameraVisible&&!n.cameraHelper)n.cameraHelper=new THREE.CameraHelper(n.shadowCamera),n.shadowCamera.add(n.cameraHelper);if(n.isVirtual&&u.originalCamera==k){q=k;o=n.shadowCamera;m=n.pointsFrustum;t=n.pointsWorld;f.set(Infinity,Infinity,Infinity);h.set(-Infinity,-Infinity,-Infinity);for(r=0;8>r;r++){s=t[r];s.copy(m[r]);THREE.ShadowMapPlugin.__projector.unprojectVector(s,
+else{console.error("Unsupported light type for shadow");continue}i.add(n.shadowCamera);b.autoUpdateScene&&i.updateMatrixWorld()}if(n.shadowCameraVisible&&!n.cameraHelper)n.cameraHelper=new THREE.CameraHelper(n.shadowCamera),n.shadowCamera.add(n.cameraHelper);if(n.isVirtual&&u.originalCamera==l){q=l;o=n.shadowCamera;m=n.pointsFrustum;t=n.pointsWorld;f.set(Infinity,Infinity,Infinity);h.set(-Infinity,-Infinity,-Infinity);for(r=0;8>r;r++){s=t[r];s.copy(m[r]);THREE.ShadowMapPlugin.__projector.unprojectVector(s,
 q);o.matrixWorldInverse.multiplyVector3(s);if(s.x<f.x)f.x=s.x;if(s.x>h.x)h.x=s.x;if(s.y<f.y)f.y=s.y;if(s.y>h.y)h.y=s.y;if(s.z<f.z)f.z=s.z;if(s.z>h.z)h.z=s.z}o.left=f.x;o.right=h.x;o.top=h.y;o.bottom=f.y;o.updateProjectionMatrix()}o=n.shadowMap;m=n.shadowMatrix;q=n.shadowCamera;q.position.copy(n.matrixWorld.getPosition());q.lookAt(n.target.matrixWorld.getPosition());q.updateMatrixWorld();q.matrixWorldInverse.getInverse(q.matrixWorld);if(n.cameraHelper)n.cameraHelper.lines.visible=n.shadowCameraVisible;
 q);o.matrixWorldInverse.multiplyVector3(s);if(s.x<f.x)f.x=s.x;if(s.x>h.x)h.x=s.x;if(s.y<f.y)f.y=s.y;if(s.y>h.y)h.y=s.y;if(s.z<f.z)f.z=s.z;if(s.z>h.z)h.z=s.z}o.left=f.x;o.right=h.x;o.top=h.y;o.bottom=f.y;o.updateProjectionMatrix()}o=n.shadowMap;m=n.shadowMatrix;q=n.shadowCamera;q.position.copy(n.matrixWorld.getPosition());q.lookAt(n.target.matrixWorld.getPosition());q.updateMatrixWorld();q.matrixWorldInverse.getInverse(q.matrixWorld);if(n.cameraHelper)n.cameraHelper.lines.visible=n.shadowCameraVisible;
 n.shadowCameraVisible&&n.cameraHelper.update(n.shadowCamera);m.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);m.multiplySelf(q.projectionMatrix);m.multiplySelf(q.matrixWorldInverse);if(!q._viewMatrixArray)q._viewMatrixArray=new Float32Array(16);q.matrixWorldInverse.flattenToArray(q._viewMatrixArray);if(!q._projectionMatrixArray)q._projectionMatrixArray=new Float32Array(16);q.projectionMatrix.flattenToArray(q._projectionMatrixArray);g.multiply(q.projectionMatrix,q.matrixWorldInverse);e.setFromMatrix(g);
 n.shadowCameraVisible&&n.cameraHelper.update(n.shadowCamera);m.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);m.multiplySelf(q.projectionMatrix);m.multiplySelf(q.matrixWorldInverse);if(!q._viewMatrixArray)q._viewMatrixArray=new Float32Array(16);q.matrixWorldInverse.flattenToArray(q._viewMatrixArray);if(!q._projectionMatrixArray)q._projectionMatrixArray=new Float32Array(16);q.projectionMatrix.flattenToArray(q._projectionMatrixArray);g.multiply(q.projectionMatrix,q.matrixWorldInverse);e.setFromMatrix(g);
 b.setRenderTarget(o);b.clear();t=i.__webglObjects;for(n=0,o=t.length;n<o;n++)if(r=t[n],m=r.object,r.render=!1,m.visible&&m.castShadow&&(!(m instanceof THREE.Mesh)||!m.frustumCulled||e.contains(m)))m.matrixWorld.flattenToArray(m._objectMatrixArray),m._modelViewMatrix.multiplyToArray(q.matrixWorldInverse,m.matrixWorld,m._modelViewMatrixArray),r.render=!0;for(n=0,o=t.length;n<o;n++)if(r=t[n],r.render)m=r.object,r=r.buffer,b.setObjectFaces(m),s=m.customDepthMaterial?m.customDepthMaterial:m.geometry.morphTargets.length?
 b.setRenderTarget(o);b.clear();t=i.__webglObjects;for(n=0,o=t.length;n<o;n++)if(r=t[n],m=r.object,r.render=!1,m.visible&&m.castShadow&&(!(m instanceof THREE.Mesh)||!m.frustumCulled||e.contains(m)))m.matrixWorld.flattenToArray(m._objectMatrixArray),m._modelViewMatrix.multiplyToArray(q.matrixWorldInverse,m.matrixWorld,m._modelViewMatrixArray),r.render=!0;for(n=0,o=t.length;n<o;n++)if(r=t[n],r.render)m=r.object,r=r.buffer,b.setObjectFaces(m),s=m.customDepthMaterial?m.customDepthMaterial:m.geometry.morphTargets.length?
-d:c,r instanceof THREE.BufferGeometry?b.renderBufferDirect(q,i.lights,null,s,r,m):b.renderBuffer(q,i.lights,null,s,r,m);t=i.__webglObjectsImmediate;for(n=0,o=t.length;n<o;n++)r=t[n],m=r.object,m.visible&&m.castShadow&&(m.matrixAutoUpdate&&m.matrixWorld.flattenToArray(m._objectMatrixArray),m._modelViewMatrix.multiplyToArray(q.matrixWorldInverse,m.matrixWorld,m._modelViewMatrixArray),b.renderImmediateObject(q,i.lights,null,c,m))}l=b.getClearColor();p=b.getClearAlpha();a.clearColor(l.r,l.g,l.b,p);a.enable(a.BLEND);
+d:c,r instanceof THREE.BufferGeometry?b.renderBufferDirect(q,i.lights,null,s,r,m):b.renderBuffer(q,i.lights,null,s,r,m);t=i.__webglObjectsImmediate;for(n=0,o=t.length;n<o;n++)r=t[n],m=r.object,m.visible&&m.castShadow&&(m.matrixAutoUpdate&&m.matrixWorld.flattenToArray(m._objectMatrixArray),m._modelViewMatrix.multiplyToArray(q.matrixWorldInverse,m.matrixWorld,m._modelViewMatrixArray),b.renderImmediateObject(q,i.lights,null,c,m))}k=b.getClearColor();p=b.getClearAlpha();a.clearColor(k.r,k.g,k.b,p);a.enable(a.BLEND);
 b.shadowMapCullFrontFaces&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;
 b.shadowMapCullFrontFaces&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;
-THREE.SpritePlugin=function(){function a(a,b){return b.z-a.z}var b,c,d,e,g,f,h,i,k,l;this.init=function(a){b=a.context;c=a;d=new Float32Array(16);e=new Uint16Array(6);a=0;d[a++]=-1;d[a++]=-1;d[a++]=0;d[a++]=1;d[a++]=1;d[a++]=-1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=0;d[a++]=-1;d[a++]=1;d[a++]=0;a=d[a++]=0;e[a++]=0;e[a++]=1;e[a++]=2;e[a++]=0;e[a++]=2;e[a++]=3;g=b.createBuffer();f=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,
-f);b.bufferData(b.ELEMENT_ARRAY_BUFFER,e,b.STATIC_DRAW);var a=THREE.ShaderSprite.sprite,n=b.createProgram(),o=b.createShader(b.FRAGMENT_SHADER),q=b.createShader(b.VERTEX_SHADER);b.shaderSource(o,a.fragmentShader);b.shaderSource(q,a.vertexShader);b.compileShader(o);b.compileShader(q);b.attachShader(n,o);b.attachShader(n,q);b.linkProgram(n);h=n;i={};k={};i.position=b.getAttribLocation(h,"position");i.uv=b.getAttribLocation(h,"uv");k.uvOffset=b.getUniformLocation(h,"uvOffset");k.uvScale=b.getUniformLocation(h,
-"uvScale");k.rotation=b.getUniformLocation(h,"rotation");k.scale=b.getUniformLocation(h,"scale");k.alignment=b.getUniformLocation(h,"alignment");k.color=b.getUniformLocation(h,"color");k.map=b.getUniformLocation(h,"map");k.opacity=b.getUniformLocation(h,"opacity");k.useScreenCoordinates=b.getUniformLocation(h,"useScreenCoordinates");k.affectedByDistance=b.getUniformLocation(h,"affectedByDistance");k.screenPosition=b.getUniformLocation(h,"screenPosition");k.modelViewMatrix=b.getUniformLocation(h,"modelViewMatrix");
-k.projectionMatrix=b.getUniformLocation(h,"projectionMatrix");l=!1};this.render=function(d,e,o,q){var d=d.__webglSprites,m=d.length;if(m){var r=i,s=k,t=q/o,o=0.5*o,w=0.5*q,u=!0;b.useProgram(h);l||(b.enableVertexAttribArray(r.position),b.enableVertexAttribArray(r.uv),l=!0);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.depthMask(!0);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(r.position,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(r.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,f);b.uniformMatrix4fv(s.projectionMatrix,
+THREE.SpritePlugin=function(){function a(a,b){return b.z-a.z}var b,c,d,e,g,f,h,i,l,k;this.init=function(a){b=a.context;c=a;d=new Float32Array(16);e=new Uint16Array(6);a=0;d[a++]=-1;d[a++]=-1;d[a++]=0;d[a++]=1;d[a++]=1;d[a++]=-1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=0;d[a++]=-1;d[a++]=1;d[a++]=0;a=d[a++]=0;e[a++]=0;e[a++]=1;e[a++]=2;e[a++]=0;e[a++]=2;e[a++]=3;g=b.createBuffer();f=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,
+f);b.bufferData(b.ELEMENT_ARRAY_BUFFER,e,b.STATIC_DRAW);var a=THREE.ShaderSprite.sprite,n=b.createProgram(),o=b.createShader(b.FRAGMENT_SHADER),q=b.createShader(b.VERTEX_SHADER);b.shaderSource(o,a.fragmentShader);b.shaderSource(q,a.vertexShader);b.compileShader(o);b.compileShader(q);b.attachShader(n,o);b.attachShader(n,q);b.linkProgram(n);h=n;i={};l={};i.position=b.getAttribLocation(h,"position");i.uv=b.getAttribLocation(h,"uv");l.uvOffset=b.getUniformLocation(h,"uvOffset");l.uvScale=b.getUniformLocation(h,
+"uvScale");l.rotation=b.getUniformLocation(h,"rotation");l.scale=b.getUniformLocation(h,"scale");l.alignment=b.getUniformLocation(h,"alignment");l.color=b.getUniformLocation(h,"color");l.map=b.getUniformLocation(h,"map");l.opacity=b.getUniformLocation(h,"opacity");l.useScreenCoordinates=b.getUniformLocation(h,"useScreenCoordinates");l.affectedByDistance=b.getUniformLocation(h,"affectedByDistance");l.screenPosition=b.getUniformLocation(h,"screenPosition");l.modelViewMatrix=b.getUniformLocation(h,"modelViewMatrix");
+l.projectionMatrix=b.getUniformLocation(h,"projectionMatrix");k=!1};this.render=function(d,e,o,q){var d=d.__webglSprites,m=d.length;if(m){var r=i,s=l,t=q/o,o=0.5*o,w=0.5*q,u=!0;b.useProgram(h);k||(b.enableVertexAttribArray(r.position),b.enableVertexAttribArray(r.uv),k=!0);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.depthMask(!0);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(r.position,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(r.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,f);b.uniformMatrix4fv(s.projectionMatrix,
 !1,e._projectionMatrixArray);b.activeTexture(b.TEXTURE0);b.uniform1i(s.map,0);for(var v,y=[],r=0;r<m;r++)if(v=d[r],v.visible&&0!==v.opacity)v.useScreenCoordinates?v.z=-v.position.z:(v._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,v.matrixWorld,v._modelViewMatrixArray),v.z=-v._modelViewMatrix.n34);d.sort(a);for(r=0;r<m;r++)v=d[r],v.visible&&0!==v.opacity&&v.map&&v.map.image&&v.map.image.width&&(v.useScreenCoordinates?(b.uniform1i(s.useScreenCoordinates,1),b.uniform3f(s.screenPosition,(v.position.x-
 !1,e._projectionMatrixArray);b.activeTexture(b.TEXTURE0);b.uniform1i(s.map,0);for(var v,y=[],r=0;r<m;r++)if(v=d[r],v.visible&&0!==v.opacity)v.useScreenCoordinates?v.z=-v.position.z:(v._modelViewMatrix.multiplyToArray(e.matrixWorldInverse,v.matrixWorld,v._modelViewMatrixArray),v.z=-v._modelViewMatrix.n34);d.sort(a);for(r=0;r<m;r++)v=d[r],v.visible&&0!==v.opacity&&v.map&&v.map.image&&v.map.image.width&&(v.useScreenCoordinates?(b.uniform1i(s.useScreenCoordinates,1),b.uniform3f(s.screenPosition,(v.position.x-
 o)/o,(w-v.position.y)/w,Math.max(0,Math.min(1,v.position.z)))):(b.uniform1i(s.useScreenCoordinates,0),b.uniform1i(s.affectedByDistance,v.affectedByDistance?1:0),b.uniformMatrix4fv(s.modelViewMatrix,!1,v._modelViewMatrixArray)),e=v.map.image.width/(v.scaleByViewport?q:1),y[0]=e*t*v.scale.x,y[1]=e*v.scale.y,b.uniform2f(s.uvScale,v.uvScale.x,v.uvScale.y),b.uniform2f(s.uvOffset,v.uvOffset.x,v.uvOffset.y),b.uniform2f(s.alignment,v.alignment.x,v.alignment.y),b.uniform1f(s.opacity,v.opacity),b.uniform3f(s.color,
 o)/o,(w-v.position.y)/w,Math.max(0,Math.min(1,v.position.z)))):(b.uniform1i(s.useScreenCoordinates,0),b.uniform1i(s.affectedByDistance,v.affectedByDistance?1:0),b.uniformMatrix4fv(s.modelViewMatrix,!1,v._modelViewMatrixArray)),e=v.map.image.width/(v.scaleByViewport?q:1),y[0]=e*t*v.scale.x,y[1]=e*v.scale.y,b.uniform2f(s.uvScale,v.uvScale.x,v.uvScale.y),b.uniform2f(s.uvOffset,v.uvOffset.x,v.uvOffset.y),b.uniform2f(s.alignment,v.alignment.x,v.alignment.y),b.uniform1f(s.opacity,v.opacity),b.uniform3f(s.color,
 v.color.r,v.color.g,v.color.b),b.uniform1f(s.rotation,v.rotation),b.uniform2fv(s.scale,y),v.mergeWith3D&&!u?(b.enable(b.DEPTH_TEST),u=!0):!v.mergeWith3D&&u&&(b.disable(b.DEPTH_TEST),u=!1),c.setBlending(v.blending),c.setTexture(v.map,0),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
 v.color.r,v.color.g,v.color.b),b.uniform1f(s.rotation,v.rotation),b.uniform2fv(s.scale,y),v.mergeWith3D&&!u?(b.enable(b.DEPTH_TEST),u=!0):!v.mergeWith3D&&u&&(b.disable(b.DEPTH_TEST),u=!1),c.setBlending(v.blending),c.setTexture(v.map,0),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
-if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoUpdateScene=!1;var b=this,c=this.setSize,d=this.render,e=new THREE.PerspectiveCamera,g=new THREE.PerspectiveCamera,f=new THREE.Matrix4,h=new THREE.Matrix4,i,k,l,p;e.matrixAutoUpdate=g.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},n=new THREE.WebGLRenderTarget(512,512,a),o=new THREE.WebGLRenderTarget(512,512,a),q=new THREE.PerspectiveCamera(53,
+if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoUpdateScene=!1;var b=this,c=this.setSize,d=this.render,e=new THREE.PerspectiveCamera,g=new THREE.PerspectiveCamera,f=new THREE.Matrix4,h=new THREE.Matrix4,i,l,k,p;e.matrixAutoUpdate=g.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},n=new THREE.WebGLRenderTarget(512,512,a),o=new THREE.WebGLRenderTarget(512,512,a),q=new THREE.PerspectiveCamera(53,
 1,1,1E4);q.position.z=2;var a=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:n},mapRight:{type:"t",value:1,texture:o}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}),
 1,1,1E4);q.position.z=2;var a=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:n},mapRight:{type:"t",value:1,texture:o}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}),
-m=new THREE.Scene;m.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),a));m.add(q);this.setSize=function(a,d){c.call(b,a,d);n.width=a;n.height=d;o.width=a;o.height=d};this.render=function(a,c){a.updateMatrixWorld();if(i!==c.aspect||k!==c.near||l!==c.far||p!==c.fov){i=c.aspect;k=c.near;l=c.far;p=c.fov;var t=c.projectionMatrix.clone(),w=0.5*(125/30),u=w*k/125,v=k*Math.tan(p*Math.PI/360),y;f.n14=w;h.n14=-w;w=-v*i+u;y=v*i+u;t.n11=2*k/(y-w);t.n13=(y+w)/(y-w);e.projectionMatrix.copy(t);w=-v*i-u;y=v*i-u;t.n11=
-2*k/(y-w);t.n13=(y+w)/(y-w);g.projectionMatrix.copy(t)}e.matrixWorld.copy(c.matrixWorld).multiplySelf(h);e.position.copy(c.position);e.near=c.near;e.far=c.far;d.call(b,a,e,n,!0);g.matrixWorld.copy(c.matrixWorld).multiplySelf(f);g.position.copy(c.position);g.near=c.near;g.far=c.far;d.call(b,a,g,o,!0);m.updateMatrixWorld();d.call(b,m,q)}};
+m=new THREE.Scene;m.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),a));m.add(q);this.setSize=function(a,d){c.call(b,a,d);n.width=a;n.height=d;o.width=a;o.height=d};this.render=function(a,c){a.updateMatrixWorld();if(i!==c.aspect||l!==c.near||k!==c.far||p!==c.fov){i=c.aspect;l=c.near;k=c.far;p=c.fov;var t=c.projectionMatrix.clone(),w=0.5*(125/30),u=w*l/125,v=l*Math.tan(p*Math.PI/360),y;f.n14=w;h.n14=-w;w=-v*i+u;y=v*i+u;t.n11=2*l/(y-w);t.n13=(y+w)/(y-w);e.projectionMatrix.copy(t);w=-v*i-u;y=v*i-u;t.n11=
+2*l/(y-w);t.n13=(y+w)/(y-w);g.projectionMatrix.copy(t)}e.matrixWorld.copy(c.matrixWorld).multiplySelf(h);e.position.copy(c.position);e.near=c.near;e.far=c.far;d.call(b,a,e,n,!0);g.matrixWorld.copy(c.matrixWorld).multiplySelf(f);g.position.copy(c.position);g.near=c.near;g.far=c.far;d.call(b,a,g,o,!0);m.updateMatrixWorld();d.call(b,m,q)}};
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,d=this.render,e,g,f=new THREE.PerspectiveCamera;f.target=new THREE.Vector3(0,0,0);var h=new THREE.PerspectiveCamera;h.target=new THREE.Vector3(0,0,0);b.separation=10;if(a&&void 0!==a.separation)b.separation=a.separation;this.setSize=function(a,d){c.call(b,a,d);e=a/2;g=d};this.render=function(a,c){this.clear();f.fov=c.fov;f.aspect=0.5*c.aspect;f.near=c.near;f.far=
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,d=this.render,e,g,f=new THREE.PerspectiveCamera;f.target=new THREE.Vector3(0,0,0);var h=new THREE.PerspectiveCamera;h.target=new THREE.Vector3(0,0,0);b.separation=10;if(a&&void 0!==a.separation)b.separation=a.separation;this.setSize=function(a,d){c.call(b,a,d);e=a/2;g=d};this.render=function(a,c){this.clear();f.fov=c.fov;f.aspect=0.5*c.aspect;f.near=c.near;f.far=
 c.far;f.updateProjectionMatrix();f.position.copy(c.position);f.target.copy(c.target);f.translateX(b.separation);f.lookAt(f.target);h.projectionMatrix=f.projectionMatrix;h.position.copy(c.position);h.target.copy(c.target);h.translateX(-b.separation);h.lookAt(h.target);this.setViewport(0,0,e,g);d.call(b,a,f);this.setViewport(e,0,e,g);d.call(b,a,h,!1)}};
 c.far;f.updateProjectionMatrix();f.position.copy(c.position);f.target.copy(c.target);f.translateX(b.separation);f.lookAt(f.target);h.projectionMatrix=f.projectionMatrix;h.position.copy(c.position);h.target.copy(c.target);h.translateX(-b.separation);h.lookAt(h.target);this.setViewport(0,0,e,g);d.call(b,a,f);this.setViewport(e,0,e,g);d.call(b,a,h,!1)}};
 THREE.ShaderFlares={lensFlareVertexTexture:{vertexShader:"uniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform int renderType;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.5 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.1, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.1, 0.5 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = (       visibility.r / 9.0 ) *\n( 1.0 - visibility.g / 9.0 ) *\n(       visibility.b / 9.0 ) *\n( 1.0 - visibility.a / 9.0 );\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"precision mediump float;\nuniform sampler2D map;\nuniform float opacity;\nuniform int renderType;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
 THREE.ShaderFlares={lensFlareVertexTexture:{vertexShader:"uniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform int renderType;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.5 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.1, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.1, 0.5 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = (       visibility.r / 9.0 ) *\n( 1.0 - visibility.g / 9.0 ) *\n(       visibility.b / 9.0 ) *\n( 1.0 - visibility.a / 9.0 );\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"precision mediump float;\nuniform sampler2D map;\nuniform float opacity;\nuniform int renderType;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},

+ 1 - 1
build/custom/ThreeCanvas.js

@@ -79,7 +79,7 @@ f-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this
 -Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=
 -Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=
 this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y=c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=
 this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y=c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=
 a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,m=this.w,j=m*c+g*e-h*d,l=m*d+h*c-f*e,o=m*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=j*m+c*-f+l*-h-o*-g;b.y=l*m+c*-g+o*-f-j*-h;b.z=o*m+c*-h+j*-g-l*-f;return b}};
 a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,m=this.w,j=m*c+g*e-h*d,l=m*d+h*c-f*e,o=m*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=j*m+c*-f+l*-h-o*-g;b.y=l*m+c*-g+o*-f-j*-h;b.z=o*m+c*-h+j*-g-l*-f;return b}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var f=Math.acos(e),e=Math.sqrt(1-e*e);if(0.0010>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var f=Math.acos(e),e=Math.sqrt(1-e*e);if(0.001>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
 THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
 THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};

+ 1 - 1
build/custom/ThreeDOM.js

@@ -78,7 +78,7 @@ f-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this
 -Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=
 -Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=
 this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y=c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=
 this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y=c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=
 a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,k=this.w,i=k*c+g*e-h*d,j=k*d+h*c-f*e,l=k*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=i*k+c*-f+j*-h-l*-g;b.y=j*k+c*-g+l*-f-i*-h;b.z=l*k+c*-h+i*-g-j*-f;return b}};
 a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,k=this.w,i=k*c+g*e-h*d,j=k*d+h*c-f*e,l=k*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=i*k+c*-f+j*-h-l*-g;b.y=j*k+c*-g+l*-f-i*-h;b.z=l*k+c*-h+i*-g-j*-f;return b}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var f=Math.acos(e),e=Math.sqrt(1-e*e);if(0.0010>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var f=Math.acos(e),e=Math.sqrt(1-e*e);if(0.001>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
 THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
 THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};

+ 159 - 159
build/custom/ThreeExtras.js

@@ -1,22 +1,22 @@
 // ThreeExtras.js - http://github.com/mrdoob/three.js
 // ThreeExtras.js - http://github.com/mrdoob/three.js
 'use strict';THREE.ColorUtils={adjustHSV:function(a,b,c,d){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.Math.clamp(f.h+b,0,1);f.s=THREE.Math.clamp(f.s+c,0,1);f.v=THREE.Math.clamp(f.v+d,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,b){var c=a.r,d=a.g,f=a.b,g=Math.max(Math.max(c,d),f),e=Math.min(Math.min(c,d),f);if(e===g)e=c=0;else{var h=g-e,e=h/g,c=(c===g?(d-f)/h:d===g?2+(f-c)/h:4+(c-d)/h)/6;0>c&&(c+=1);1<c&&(c-=1)}void 0===b&&(b={h:0,s:0,v:0});b.h=c;b.s=e;b.v=g;return b}};
 'use strict';THREE.ColorUtils={adjustHSV:function(a,b,c,d){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.Math.clamp(f.h+b,0,1);f.s=THREE.Math.clamp(f.s+c,0,1);f.v=THREE.Math.clamp(f.v+d,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,b){var c=a.r,d=a.g,f=a.b,g=Math.max(Math.max(c,d),f),e=Math.min(Math.min(c,d),f);if(e===g)e=c=0;else{var h=g-e,e=h/g,c=(c===g?(d-f)/h:d===g?2+(f-c)/h:4+(c-d)/h)/6;0>c&&(c+=1);1<c&&(c-=1)}void 0===b&&(b={h:0,s:0,v:0});b.h=c;b.s=e;b.v=g;return b}};
 THREE.ColorUtils.__hsv={h:0,s:0,v:0};
 THREE.ColorUtils.__hsv={h:0,s:0,v:0};
-THREE.GeometryUtils={merge:function(a,b){for(var c,d,f=a.vertices.length,g=b instanceof THREE.Mesh?b.geometry:b,e=a.vertices,h=g.vertices,i=a.faces,k=g.faces,j=a.faceVertexUvs[0],q=g.faceVertexUvs[0],l={},n=0;n<a.materials.length;n++)l[a.materials[n].id]=n;if(b instanceof THREE.Mesh)b.matrixAutoUpdate&&b.updateMatrix(),c=b.matrix,d=new THREE.Matrix4,d.extractRotation(c,b.scale);for(var n=0,r=h.length;n<r;n++){var m=new THREE.Vertex(h[n].position.clone());c&&c.multiplyVector3(m.position);e.push(m)}for(n=
-0,r=k.length;n<r;n++){var e=k[n],o,p,s=e.vertexNormals,t=e.vertexColors;e instanceof THREE.Face3?o=new THREE.Face3(e.a+f,e.b+f,e.c+f):e instanceof THREE.Face4&&(o=new THREE.Face4(e.a+f,e.b+f,e.c+f,e.d+f));o.normal.copy(e.normal);d&&d.multiplyVector3(o.normal);h=0;for(m=s.length;h<m;h++)p=s[h].clone(),d&&d.multiplyVector3(p),o.vertexNormals.push(p);o.color.copy(e.color);h=0;for(m=t.length;h<m;h++)p=t[h],o.vertexColors.push(p.clone());if(void 0!==e.materialIndex){h=g.materials[e.materialIndex];m=h.id;
-t=l[m];if(void 0===t)t=a.materials.length,l[m]=t,a.materials.push(h);o.materialIndex=t}o.centroid.copy(e.centroid);c&&c.multiplyVector3(o.centroid);i.push(o)}for(n=0,r=q.length;n<r;n++){c=q[n];d=[];h=0;for(m=c.length;h<m;h++)d.push(new THREE.UV(c[h].u,c[h].v));j.push(d)}},clone:function(a){var b=new THREE.Geometry,c,d=a.vertices,f=a.faces,g=a.faceVertexUvs[0];if(a.materials)b.materials=a.materials.slice();for(a=0,c=d.length;a<c;a++){var e=new THREE.Vertex(d[a].position.clone());b.vertices.push(e)}for(a=
-0,c=f.length;a<c;a++){var h=f[a],i,k,j=h.vertexNormals,q=h.vertexColors;h instanceof THREE.Face3?i=new THREE.Face3(h.a,h.b,h.c):h instanceof THREE.Face4&&(i=new THREE.Face4(h.a,h.b,h.c,h.d));i.normal.copy(h.normal);d=0;for(e=j.length;d<e;d++)k=j[d],i.vertexNormals.push(k.clone());i.color.copy(h.color);d=0;for(e=q.length;d<e;d++)k=q[d],i.vertexColors.push(k.clone());i.materialIndex=h.materialIndex;i.centroid.copy(h.centroid);b.faces.push(i)}for(a=0,c=g.length;a<c;a++){f=g[a];i=[];d=0;for(e=f.length;d<
+THREE.GeometryUtils={merge:function(a,b){for(var c,d,f=a.vertices.length,g=b instanceof THREE.Mesh?b.geometry:b,e=a.vertices,h=g.vertices,i=a.faces,j=g.faces,k=a.faceVertexUvs[0],q=g.faceVertexUvs[0],l={},n=0;n<a.materials.length;n++)l[a.materials[n].id]=n;if(b instanceof THREE.Mesh)b.matrixAutoUpdate&&b.updateMatrix(),c=b.matrix,d=new THREE.Matrix4,d.extractRotation(c,b.scale);for(var n=0,r=h.length;n<r;n++){var m=new THREE.Vertex(h[n].position.clone());c&&c.multiplyVector3(m.position);e.push(m)}for(n=
+0,r=j.length;n<r;n++){var e=j[n],p,o,s=e.vertexNormals,t=e.vertexColors;e instanceof THREE.Face3?p=new THREE.Face3(e.a+f,e.b+f,e.c+f):e instanceof THREE.Face4&&(p=new THREE.Face4(e.a+f,e.b+f,e.c+f,e.d+f));p.normal.copy(e.normal);d&&d.multiplyVector3(p.normal);h=0;for(m=s.length;h<m;h++)o=s[h].clone(),d&&d.multiplyVector3(o),p.vertexNormals.push(o);p.color.copy(e.color);h=0;for(m=t.length;h<m;h++)o=t[h],p.vertexColors.push(o.clone());if(void 0!==e.materialIndex){h=g.materials[e.materialIndex];m=h.id;
+t=l[m];if(void 0===t)t=a.materials.length,l[m]=t,a.materials.push(h);p.materialIndex=t}p.centroid.copy(e.centroid);c&&c.multiplyVector3(p.centroid);i.push(p)}for(n=0,r=q.length;n<r;n++){c=q[n];d=[];h=0;for(m=c.length;h<m;h++)d.push(new THREE.UV(c[h].u,c[h].v));k.push(d)}},clone:function(a){var b=new THREE.Geometry,c,d=a.vertices,f=a.faces,g=a.faceVertexUvs[0];if(a.materials)b.materials=a.materials.slice();for(a=0,c=d.length;a<c;a++){var e=new THREE.Vertex(d[a].position.clone());b.vertices.push(e)}for(a=
+0,c=f.length;a<c;a++){var h=f[a],i,j,k=h.vertexNormals,q=h.vertexColors;h instanceof THREE.Face3?i=new THREE.Face3(h.a,h.b,h.c):h instanceof THREE.Face4&&(i=new THREE.Face4(h.a,h.b,h.c,h.d));i.normal.copy(h.normal);d=0;for(e=k.length;d<e;d++)j=k[d],i.vertexNormals.push(j.clone());i.color.copy(h.color);d=0;for(e=q.length;d<e;d++)j=q[d],i.vertexColors.push(j.clone());i.materialIndex=h.materialIndex;i.centroid.copy(h.centroid);b.faces.push(i)}for(a=0,c=g.length;a<c;a++){f=g[a];i=[];d=0;for(e=f.length;d<
 e;d++)i.push(new THREE.UV(f[d].u,f[d].v));b.faceVertexUvs[0].push(i)}return b},randomPointInTriangle:function(a,b,c){var d,f,g,e=new THREE.Vector3,h=THREE.GeometryUtils.__v1;d=THREE.GeometryUtils.random();f=THREE.GeometryUtils.random();1<d+f&&(d=1-d,f=1-f);g=1-d-f;e.copy(a);e.multiplyScalar(d);h.copy(b);h.multiplyScalar(f);e.addSelf(h);h.copy(c);h.multiplyScalar(g);e.addSelf(h);return e},randomPointInFace:function(a,b,c){var d,f,g;if(a instanceof THREE.Face3)return d=b.vertices[a.a].position,f=b.vertices[a.b].position,
 e;d++)i.push(new THREE.UV(f[d].u,f[d].v));b.faceVertexUvs[0].push(i)}return b},randomPointInTriangle:function(a,b,c){var d,f,g,e=new THREE.Vector3,h=THREE.GeometryUtils.__v1;d=THREE.GeometryUtils.random();f=THREE.GeometryUtils.random();1<d+f&&(d=1-d,f=1-f);g=1-d-f;e.copy(a);e.multiplyScalar(d);h.copy(b);h.multiplyScalar(f);e.addSelf(h);h.copy(c);h.multiplyScalar(g);e.addSelf(h);return e},randomPointInFace:function(a,b,c){var d,f,g;if(a instanceof THREE.Face3)return d=b.vertices[a.a].position,f=b.vertices[a.b].position,
 g=b.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(d,f,g);if(a instanceof THREE.Face4){d=b.vertices[a.a].position;f=b.vertices[a.b].position;g=b.vertices[a.c].position;var b=b.vertices[a.d].position,e;c?a._area1&&a._area2?(c=a._area1,e=a._area2):(c=THREE.GeometryUtils.triangleArea(d,f,b),e=THREE.GeometryUtils.triangleArea(f,g,b),a._area1=c,a._area2=e):(c=THREE.GeometryUtils.triangleArea(d,f,b),e=THREE.GeometryUtils.triangleArea(f,g,b));return THREE.GeometryUtils.random()*(c+e)<c?
 g=b.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(d,f,g);if(a instanceof THREE.Face4){d=b.vertices[a.a].position;f=b.vertices[a.b].position;g=b.vertices[a.c].position;var b=b.vertices[a.d].position,e;c?a._area1&&a._area2?(c=a._area1,e=a._area2):(c=THREE.GeometryUtils.triangleArea(d,f,b),e=THREE.GeometryUtils.triangleArea(f,g,b),a._area1=c,a._area2=e):(c=THREE.GeometryUtils.triangleArea(d,f,b),e=THREE.GeometryUtils.triangleArea(f,g,b));return THREE.GeometryUtils.random()*(c+e)<c?
-THREE.GeometryUtils.randomPointInTriangle(d,f,b):THREE.GeometryUtils.randomPointInTriangle(f,g,b)}},randomPointsInGeometry:function(a,b){function c(a){function b(c,d){if(d<c)return c;var f=c+Math.floor((d-c)/2);return k[f]>a?b(c,f-1):k[f]<a?b(f+1,d):f}return b(0,k.length-1)}var d,f,g=a.faces,e=a.vertices,h=g.length,i=0,k=[],j,q,l,n;for(f=0;f<h;f++){d=g[f];if(d instanceof THREE.Face3)j=e[d.a].position,q=e[d.b].position,l=e[d.c].position,d._area=THREE.GeometryUtils.triangleArea(j,q,l);else if(d instanceof
-THREE.Face4)j=e[d.a].position,q=e[d.b].position,l=e[d.c].position,n=e[d.d].position,d._area1=THREE.GeometryUtils.triangleArea(j,q,n),d._area2=THREE.GeometryUtils.triangleArea(q,l,n),d._area=d._area1+d._area2;i+=d._area;k[f]=i}d=[];for(f=0;f<b;f++)e=THREE.GeometryUtils.random()*i,e=c(e),d[f]=THREE.GeometryUtils.randomPointInFace(g[e],a,!0);return d},triangleArea:function(a,b,c){var d,f=THREE.GeometryUtils.__v1;f.sub(a,b);d=f.length();f.sub(a,c);a=f.length();f.sub(b,c);c=f.length();b=0.5*(d+a+c);return Math.sqrt(b*
+THREE.GeometryUtils.randomPointInTriangle(d,f,b):THREE.GeometryUtils.randomPointInTriangle(f,g,b)}},randomPointsInGeometry:function(a,b){function c(a){function b(c,d){if(d<c)return c;var f=c+Math.floor((d-c)/2);return j[f]>a?b(c,f-1):j[f]<a?b(f+1,d):f}return b(0,j.length-1)}var d,f,g=a.faces,e=a.vertices,h=g.length,i=0,j=[],k,q,l,n;for(f=0;f<h;f++){d=g[f];if(d instanceof THREE.Face3)k=e[d.a].position,q=e[d.b].position,l=e[d.c].position,d._area=THREE.GeometryUtils.triangleArea(k,q,l);else if(d instanceof
+THREE.Face4)k=e[d.a].position,q=e[d.b].position,l=e[d.c].position,n=e[d.d].position,d._area1=THREE.GeometryUtils.triangleArea(k,q,n),d._area2=THREE.GeometryUtils.triangleArea(q,l,n),d._area=d._area1+d._area2;i+=d._area;j[f]=i}d=[];for(f=0;f<b;f++)e=THREE.GeometryUtils.random()*i,e=c(e),d[f]=THREE.GeometryUtils.randomPointInFace(g[e],a,!0);return d},triangleArea:function(a,b,c){var d,f=THREE.GeometryUtils.__v1;f.sub(a,b);d=f.length();f.sub(a,c);a=f.length();f.sub(b,c);c=f.length();b=0.5*(d+a+c);return Math.sqrt(b*
 (b-d)*(b-a)*(b-c))},center:function(a){a.computeBoundingBox();var b=a.boundingBox,c=new THREE.Vector3;c.add(b.min,b.max);c.multiplyScalar(-0.5);a.applyMatrix((new THREE.Matrix4).setTranslation(c.x,c.y,c.z));a.computeBoundingBox();return c},normalizeUVs:function(a){for(var a=a.faceVertexUvs[0],b=0,c=a.length;b<c;b++)for(var d=a[b],f=0,g=d.length;f<g;f++)1!==d[f].u&&(d[f].u-=Math.floor(d[f].u)),1!==d[f].v&&(d[f].v-=Math.floor(d[f].v))},triangulateQuads:function(a){for(var b=a.faces.length-1;0<=b;b--){var c=
 (b-d)*(b-a)*(b-c))},center:function(a){a.computeBoundingBox();var b=a.boundingBox,c=new THREE.Vector3;c.add(b.min,b.max);c.multiplyScalar(-0.5);a.applyMatrix((new THREE.Matrix4).setTranslation(c.x,c.y,c.z));a.computeBoundingBox();return c},normalizeUVs:function(a){for(var a=a.faceVertexUvs[0],b=0,c=a.length;b<c;b++)for(var d=a[b],f=0,g=d.length;f<g;f++)1!==d[f].u&&(d[f].u-=Math.floor(d[f].u)),1!==d[f].v&&(d[f].v-=Math.floor(d[f].v))},triangulateQuads:function(a){for(var b=a.faces.length-1;0<=b;b--){var c=
 a.faces[b];if(c instanceof THREE.Face4){var d=c.b,f=c.c,g=c.d,e=new THREE.Face3(c.a,d,g),d=new THREE.Face3(d,f,g);e.materialIndex=d.materialIndex=c.materialIndex;e.color.copy(c.color);d.color.copy(c.color);if(4===c.vertexColors.length){var f=c.vertexColors[1],g=c.vertexColors[2],h=c.vertexColors[3];e.vertexColors[0]=c.vertexColors[0].clone();e.vertexColors[1]=f.clone();e.vertexColors[2]=h.clone();d.vertexColors[0]=f.clone();d.vertexColors[1]=g.clone();d.vertexColors[2]=h.clone()}a.faces.splice(b,
 a.faces[b];if(c instanceof THREE.Face4){var d=c.b,f=c.c,g=c.d,e=new THREE.Face3(c.a,d,g),d=new THREE.Face3(d,f,g);e.materialIndex=d.materialIndex=c.materialIndex;e.color.copy(c.color);d.color.copy(c.color);if(4===c.vertexColors.length){var f=c.vertexColors[1],g=c.vertexColors[2],h=c.vertexColors[3];e.vertexColors[0]=c.vertexColors[0].clone();e.vertexColors[1]=f.clone();e.vertexColors[2]=h.clone();d.vertexColors[0]=f.clone();d.vertexColors[1]=g.clone();d.vertexColors[2]=h.clone()}a.faces.splice(b,
 1,e,d);for(c=0;c<a.faceVertexUvs.length;c++)a.faceVertexUvs[c].length&&(g=a.faceVertexUvs[c][b],e=g[1],d=g[2],f=g[3],g=[g[0].clone(),e.clone(),f.clone()],e=[e.clone(),d.clone(),f.clone()],a.faceVertexUvs[c].splice(b,1,g,e));for(c=0;c<a.faceUvs.length;c++)a.faceUvs[c].length&&(e=a.faceUvs[c][b],a.faceUvs[c].splice(b,1,e,e))}}a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals();a.hasTangents&&a.computeTangents()}};THREE.GeometryUtils.random=THREE.Math.random16;
 1,e,d);for(c=0;c<a.faceVertexUvs.length;c++)a.faceVertexUvs[c].length&&(g=a.faceVertexUvs[c][b],e=g[1],d=g[2],f=g[3],g=[g[0].clone(),e.clone(),f.clone()],e=[e.clone(),d.clone(),f.clone()],a.faceVertexUvs[c].splice(b,1,g,e));for(c=0;c<a.faceUvs.length;c++)a.faceUvs[c].length&&(e=a.faceUvs[c][b],a.faceUvs[c].splice(b,1,e,e))}}a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals();a.hasTangents&&a.computeTangents()}};THREE.GeometryUtils.random=THREE.Math.random16;
 THREE.GeometryUtils.__v1=new THREE.Vector3;
 THREE.GeometryUtils.__v1=new THREE.Vector3;
 THREE.ImageUtils={crossOrigin:"anonymous",loadTexture:function(a,b,c){var d=new Image,f=new THREE.Texture(d,b);d.onload=function(){f.needsUpdate=!0;c&&c(this)};d.crossOrigin=this.crossOrigin;d.src=a;return f},loadTextureCube:function(a,b,c){var d,f=[],g=new THREE.Texture(f,b);f.loadCount=0;for(b=0,d=a.length;b<d;++b)f[b]=new Image,f[b].onload=function(){f.loadCount+=1;if(6===f.loadCount)g.needsUpdate=!0;c&&c(this)},f[b].crossOrigin=this.crossOrigin,f[b].src=a[b];return g},getNormalMap:function(a,
 THREE.ImageUtils={crossOrigin:"anonymous",loadTexture:function(a,b,c){var d=new Image,f=new THREE.Texture(d,b);d.onload=function(){f.needsUpdate=!0;c&&c(this)};d.crossOrigin=this.crossOrigin;d.src=a;return f},loadTextureCube:function(a,b,c){var d,f=[],g=new THREE.Texture(f,b);f.loadCount=0;for(b=0,d=a.length;b<d;++b)f[b]=new Image,f[b].onload=function(){f.loadCount+=1;if(6===f.loadCount)g.needsUpdate=!0;c&&c(this)},f[b].crossOrigin=this.crossOrigin,f[b].src=a[b];return g},getNormalMap:function(a,
-b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]},b=b|1,d=a.width,f=a.height,g=document.createElement("canvas");g.width=d;g.height=f;var e=g.getContext("2d");e.drawImage(a,0,0);for(var h=e.getImageData(0,0,d,f).data,i=e.createImageData(d,f),k=i.data,j=0;j<d;j++)for(var q=1;q<f;q++){var l=0>q-1?f-1:q-1,n=(q+1)%f,r=0>j-1?d-1:j-1,m=(j+1)%d,o=[],p=[0,0,h[4*(q*d+j)]/255*b];o.push([-1,0,h[4*(q*d+r)]/255*b]);o.push([-1,-1,h[4*(l*d+r)]/255*b]);o.push([0,-1,
-h[4*(l*d+j)]/255*b]);o.push([1,-1,h[4*(l*d+m)]/255*b]);o.push([1,0,h[4*(q*d+m)]/255*b]);o.push([1,1,h[4*(n*d+m)]/255*b]);o.push([0,1,h[4*(n*d+j)]/255*b]);o.push([-1,1,h[4*(n*d+r)]/255*b]);l=[];r=o.length;for(n=0;n<r;n++){var m=o[n],s=o[(n+1)%r],m=[m[0]-p[0],m[1]-p[1],m[2]-p[2]],s=[s[0]-p[0],s[1]-p[1],s[2]-p[2]];l.push(c([m[1]*s[2]-m[2]*s[1],m[2]*s[0]-m[0]*s[2],m[0]*s[1]-m[1]*s[0]]))}o=[0,0,0];for(n=0;n<l.length;n++)o[0]+=l[n][0],o[1]+=l[n][1],o[2]+=l[n][2];o[0]/=l.length;o[1]/=l.length;o[2]/=l.length;
-p=4*(q*d+j);k[p]=255*((o[0]+1)/2)|0;k[p+1]=255*(o[1]+0.5)|0;k[p+2]=255*o[2]|0;k[p+3]=255}e.putImageData(i,0,0);return g},generateDataTexture:function(a,b,c){for(var d=a*b,f=new Uint8Array(3*d),g=Math.floor(255*c.r),e=Math.floor(255*c.g),c=Math.floor(255*c.b),h=0;h<d;h++)f[3*h]=g,f[3*h+1]=e,f[3*h+2]=c;a=new THREE.DataTexture(f,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
+b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]},b=b|1,d=a.width,f=a.height,g=document.createElement("canvas");g.width=d;g.height=f;var e=g.getContext("2d");e.drawImage(a,0,0);for(var h=e.getImageData(0,0,d,f).data,i=e.createImageData(d,f),j=i.data,k=0;k<d;k++)for(var q=1;q<f;q++){var l=0>q-1?f-1:q-1,n=(q+1)%f,r=0>k-1?d-1:k-1,m=(k+1)%d,p=[],o=[0,0,h[4*(q*d+k)]/255*b];p.push([-1,0,h[4*(q*d+r)]/255*b]);p.push([-1,-1,h[4*(l*d+r)]/255*b]);p.push([0,-1,
+h[4*(l*d+k)]/255*b]);p.push([1,-1,h[4*(l*d+m)]/255*b]);p.push([1,0,h[4*(q*d+m)]/255*b]);p.push([1,1,h[4*(n*d+m)]/255*b]);p.push([0,1,h[4*(n*d+k)]/255*b]);p.push([-1,1,h[4*(n*d+r)]/255*b]);l=[];r=p.length;for(n=0;n<r;n++){var m=p[n],s=p[(n+1)%r],m=[m[0]-o[0],m[1]-o[1],m[2]-o[2]],s=[s[0]-o[0],s[1]-o[1],s[2]-o[2]];l.push(c([m[1]*s[2]-m[2]*s[1],m[2]*s[0]-m[0]*s[2],m[0]*s[1]-m[1]*s[0]]))}p=[0,0,0];for(n=0;n<l.length;n++)p[0]+=l[n][0],p[1]+=l[n][1],p[2]+=l[n][2];p[0]/=l.length;p[1]/=l.length;p[2]/=l.length;
+o=4*(q*d+k);j[o]=255*((p[0]+1)/2)|0;j[o+1]=255*(p[1]+0.5)|0;j[o+2]=255*p[2]|0;j[o+3]=255}e.putImageData(i,0,0);return g},generateDataTexture:function(a,b,c){for(var d=a*b,f=new Uint8Array(3*d),g=Math.floor(255*c.r),e=Math.floor(255*c.g),c=Math.floor(255*c.b),h=0;h<d;h++)f[3*h]=g,f[3*h+1]=e,f[3*h+2]=c;a=new THREE.DataTexture(f,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
 THREE.SceneUtils={showHierarchy:function(a,b){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=b})},traverseHierarchy:function(a,b){var c,d,f=a.children.length;for(d=0;d<f;d++)c=a.children[d],b(c),THREE.SceneUtils.traverseHierarchy(c,b)},createMultiMaterialObject:function(a,b){var c,d=b.length,f=new THREE.Object3D;for(c=0;c<d;c++){var g=new THREE.Mesh(a,b[c]);f.add(g)}return f},cloneObject:function(a){var b;a instanceof THREE.MorphAnimMesh?(b=new THREE.MorphAnimMesh(a.geometry,a.material),
 THREE.SceneUtils={showHierarchy:function(a,b){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=b})},traverseHierarchy:function(a,b){var c,d,f=a.children.length;for(d=0;d<f;d++)c=a.children[d],b(c),THREE.SceneUtils.traverseHierarchy(c,b)},createMultiMaterialObject:function(a,b){var c,d=b.length,f=new THREE.Object3D;for(c=0;c<d;c++){var g=new THREE.Mesh(a,b[c]);f.add(g)}return f},cloneObject:function(a){var b;a instanceof THREE.MorphAnimMesh?(b=new THREE.MorphAnimMesh(a.geometry,a.material),
 b.duration=a.duration,b.mirroredLoop=a.mirroredLoop,b.time=a.time,b.lastKeyframe=a.lastKeyframe,b.currentKeyframe=a.currentKeyframe,b.direction=a.direction,b.directionBackwards=a.directionBackwards):a instanceof THREE.SkinnedMesh?b=new THREE.SkinnedMesh(a.geometry,a.material):a instanceof THREE.Mesh?b=new THREE.Mesh(a.geometry,a.material):a instanceof THREE.Line?b=new THREE.Line(a.geometry,a.material,a.type):a instanceof THREE.Ribbon?b=new THREE.Ribbon(a.geometry,a.material):a instanceof THREE.ParticleSystem?
 b.duration=a.duration,b.mirroredLoop=a.mirroredLoop,b.time=a.time,b.lastKeyframe=a.lastKeyframe,b.currentKeyframe=a.currentKeyframe,b.direction=a.direction,b.directionBackwards=a.directionBackwards):a instanceof THREE.SkinnedMesh?b=new THREE.SkinnedMesh(a.geometry,a.material):a instanceof THREE.Mesh?b=new THREE.Mesh(a.geometry,a.material):a instanceof THREE.Line?b=new THREE.Line(a.geometry,a.material,a.type):a instanceof THREE.Ribbon?b=new THREE.Ribbon(a.geometry,a.material):a instanceof THREE.ParticleSystem?
 (b=new THREE.ParticleSystem(a.geometry,a.material),b.sortParticles=a.sortParticles):a instanceof THREE.Particle?b=new THREE.Particle(a.material):a instanceof THREE.Sprite?(b=new THREE.Sprite({}),b.color.copy(a.color),b.map=a.map,b.blending=a.blending,b.useScreenCoordinates=a.useScreenCoordinates,b.mergeWith3D=a.mergeWith3D,b.affectedByDistance=a.affectedByDistance,b.scaleByViewport=a.scaleByViewport,b.alignment=a.alignment,b.rotation3d.copy(a.rotation3d),b.rotation=a.rotation,b.opacity=a.opacity,
 (b=new THREE.ParticleSystem(a.geometry,a.material),b.sortParticles=a.sortParticles):a instanceof THREE.Particle?b=new THREE.Particle(a.material):a instanceof THREE.Sprite?(b=new THREE.Sprite({}),b.color.copy(a.color),b.map=a.map,b.blending=a.blending,b.useScreenCoordinates=a.useScreenCoordinates,b.mergeWith3D=a.mergeWith3D,b.affectedByDistance=a.affectedByDistance,b.scaleByViewport=a.scaleByViewport,b.alignment=a.alignment,b.rotation3d.copy(a.rotation3d),b.rotation=a.rotation,b.opacity=a.opacity,
@@ -65,47 +65,47 @@ THREE.Path.prototype.quadraticCurveTo=function(a,b,c,d){var f=Array.prototype.sl
 THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,f,g){var e=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d),new THREE.Vector2(f,g)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:e})};
 THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,f,g){var e=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d),new THREE.Vector2(f,g)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:e})};
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);this.curves.push(new THREE.SplineCurve(c));this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);this.curves.push(new THREE.SplineCurve(c));this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};
 THREE.Path.prototype.arc=function(a,b,c,d,f,g){var e=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(a,b,c,d,f,g));this.actions.push({action:THREE.PathActions.ARC,args:e})};THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;c<a;c++)b.push(this.getPoint(c/a));return b};
 THREE.Path.prototype.arc=function(a,b,c,d,f,g){var e=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(a,b,c,d,f,g));this.actions.push({action:THREE.PathActions.ARC,args:e})};THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;c<a;c++)b.push(this.getPoint(c/a));return b};
-THREE.Path.prototype.getPoints=function(a,b){var a=a||12,c=[],d,f,g,e,h,i,k,j,q,l,n,r,m;for(d=0,f=this.actions.length;d<f;d++)switch(g=this.actions[d],e=g.action,g=g.args,e){case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=g[2];i=g[3];q=g[0];l=g[1];0<c.length?(e=c[c.length-1],n=e.x,r=e.y):(e=this.actions[d-1].args,n=e[e.length-2],r=e[e.length-1]);for(e=1;e<=a;e++)m=e/a,g=THREE.Shape.Utils.b2(m,n,q,h),m=THREE.Shape.Utils.b2(m,r,l,
-i),c.push(new THREE.Vector2(g,m));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];i=g[5];q=g[0];l=g[1];k=g[2];j=g[3];0<c.length?(e=c[c.length-1],n=e.x,r=e.y):(e=this.actions[d-1].args,n=e[e.length-2],r=e[e.length-1]);for(e=1;e<=a;e++)m=e/a,g=THREE.Shape.Utils.b3(m,n,q,k,h),m=THREE.Shape.Utils.b3(m,r,l,j,i),c.push(new THREE.Vector2(g,m));break;case THREE.PathActions.CSPLINE_THRU:e=this.actions[d-1].args;e=[new THREE.Vector2(e[e.length-2],e[e.length-1])];m=a*g[0].length;e=e.concat(g[0]);g=new THREE.SplineCurve(e);
-for(e=1;e<=m;e++)c.push(g.getPointAt(e/m));break;case THREE.PathActions.ARC:e=this.actions[d-1].args;h=g[0];i=g[1];k=g[2];q=g[3];m=g[4];l=!!g[5];j=e[e.length-2];n=e[e.length-1];0==e.length&&(j=n=0);r=m-q;var o=2*a;for(e=1;e<=o;e++)m=e/o,l||(m=1-m),m=q+m*r,g=j+h+k*Math.cos(m),m=n+i+k*Math.sin(m),c.push(new THREE.Vector2(g,m))}b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)};
-THREE.Path.prototype.nltransform=function(a,b,c,d,f,g){var e=this.getPoints(),h,i,k,j,q;for(h=0,i=e.length;h<i;h++)k=e[h],j=k.x,q=k.y,k.x=a*j+b*q+c,k.y=d*q+f*j+g;return e};
+THREE.Path.prototype.getPoints=function(a,b){var a=a||12,c=[],d,f,g,e,h,i,j,k,q,l,n,r,m;for(d=0,f=this.actions.length;d<f;d++)switch(g=this.actions[d],e=g.action,g=g.args,e){case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=g[2];i=g[3];q=g[0];l=g[1];0<c.length?(e=c[c.length-1],n=e.x,r=e.y):(e=this.actions[d-1].args,n=e[e.length-2],r=e[e.length-1]);for(e=1;e<=a;e++)m=e/a,g=THREE.Shape.Utils.b2(m,n,q,h),m=THREE.Shape.Utils.b2(m,r,l,
+i),c.push(new THREE.Vector2(g,m));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];i=g[5];q=g[0];l=g[1];j=g[2];k=g[3];0<c.length?(e=c[c.length-1],n=e.x,r=e.y):(e=this.actions[d-1].args,n=e[e.length-2],r=e[e.length-1]);for(e=1;e<=a;e++)m=e/a,g=THREE.Shape.Utils.b3(m,n,q,j,h),m=THREE.Shape.Utils.b3(m,r,l,k,i),c.push(new THREE.Vector2(g,m));break;case THREE.PathActions.CSPLINE_THRU:e=this.actions[d-1].args;e=[new THREE.Vector2(e[e.length-2],e[e.length-1])];m=a*g[0].length;e=e.concat(g[0]);g=new THREE.SplineCurve(e);
+for(e=1;e<=m;e++)c.push(g.getPointAt(e/m));break;case THREE.PathActions.ARC:e=this.actions[d-1].args;h=g[0];i=g[1];j=g[2];q=g[3];m=g[4];l=!!g[5];k=e[e.length-2];n=e[e.length-1];0==e.length&&(k=n=0);r=m-q;var p=2*a;for(e=1;e<=p;e++)m=e/p,l||(m=1-m),m=q+m*r,g=k+h+j*Math.cos(m),m=n+i+j*Math.sin(m),c.push(new THREE.Vector2(g,m))}b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)};
+THREE.Path.prototype.nltransform=function(a,b,c,d,f,g){var e=this.getPoints(),h,i,j,k,q;for(h=0,i=e.length;h<i;h++)j=e[h],k=j.x,q=j.y,j.x=a*k+b*q+c,j.y=d*q+f*k+g;return e};
 THREE.Path.prototype.debug=function(a){var b=this.getBoundingBox();a||(a=document.createElement("canvas"),a.setAttribute("width",b.maxX+100),a.setAttribute("height",b.maxY+100),document.body.appendChild(a));b=a.getContext("2d");b.fillStyle="white";b.fillRect(0,0,a.width,a.height);b.strokeStyle="black";b.beginPath();var c,d,f;for(a=0,c=this.actions.length;a<c;a++)d=this.actions[a],f=d.args,d=d.action,d!=THREE.PathActions.CSPLINE_THRU&&b[d].apply(b,f);b.stroke();b.closePath();b.strokeStyle="red";d=
 THREE.Path.prototype.debug=function(a){var b=this.getBoundingBox();a||(a=document.createElement("canvas"),a.setAttribute("width",b.maxX+100),a.setAttribute("height",b.maxY+100),document.body.appendChild(a));b=a.getContext("2d");b.fillStyle="white";b.fillRect(0,0,a.width,a.height);b.strokeStyle="black";b.beginPath();var c,d,f;for(a=0,c=this.actions.length;a<c;a++)d=this.actions[a],f=d.args,d=d.action,d!=THREE.PathActions.CSPLINE_THRU&&b[d].apply(b,f);b.stroke();b.closePath();b.strokeStyle="red";d=
 this.getPoints();for(a=0,c=d.length;a<c;a++)f=d[a],b.beginPath(),b.arc(f.x,f.y,1.5,0,2*Math.PI,!1),b.stroke(),b.closePath()};
 this.getPoints();for(a=0,c=d.length;a<c;a++)f=d[a],b.beginPath(),b.arc(f.x,f.y,1.5,0,2*Math.PI,!1),b.stroke(),b.closePath()};
 THREE.Path.prototype.toShapes=function(){var a,b,c,d,f=[],g=new THREE.Path;for(a=0,b=this.actions.length;a<b;a++)c=this.actions[a],d=c.args,c=c.action,c==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[c].apply(g,d);0!=g.actions.length&&f.push(g);if(0==f.length)return[];var e;d=[];a=!THREE.Shape.Utils.isClockWise(f[0].getPoints());if(1==f.length)return g=f[0],e=new THREE.Shape,e.actions=g.actions,e.curves=g.curves,d.push(e),d;if(a){e=new THREE.Shape;for(a=0,b=f.length;a<
 THREE.Path.prototype.toShapes=function(){var a,b,c,d,f=[],g=new THREE.Path;for(a=0,b=this.actions.length;a<b;a++)c=this.actions[a],d=c.args,c=c.action,c==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[c].apply(g,d);0!=g.actions.length&&f.push(g);if(0==f.length)return[];var e;d=[];a=!THREE.Shape.Utils.isClockWise(f[0].getPoints());if(1==f.length)return g=f[0],e=new THREE.Shape,e.actions=g.actions,e.curves=g.curves,d.push(e),d;if(a){e=new THREE.Shape;for(a=0,b=f.length;a<
 b;a++)g=f[a],THREE.Shape.Utils.isClockWise(g.getPoints())?(e.actions=g.actions,e.curves=g.curves,d.push(e),e=new THREE.Shape):e.holes.push(g)}else{for(a=0,b=f.length;a<b;a++)g=f[a],THREE.Shape.Utils.isClockWise(g.getPoints())?(e&&d.push(e),e=new THREE.Shape,e.actions=g.actions,e.curves=g.curves):e.holes.push(g);d.push(e)}return d};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;
 b;a++)g=f[a],THREE.Shape.Utils.isClockWise(g.getPoints())?(e.actions=g.actions,e.curves=g.curves,d.push(e),e=new THREE.Shape):e.holes.push(g)}else{for(a=0,b=f.length;a<b;a++)g=f[a],THREE.Shape.Utils.isClockWise(g.getPoints())?(e&&d.push(e),e=new THREE.Shape,e.actions=g.actions,e.curves=g.curves):e.holes.push(g);d.push(e)}return d};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;
 THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={removeHoles:function(a,b){var c=a.concat(),d=c.concat(),f,g,e,h,i,k,j,q,l,n,r=[];for(i=0;i<b.length;i++){k=b[i];Array.prototype.push.apply(d,k);g=Number.POSITIVE_INFINITY;for(f=0;f<k.length;f++){l=k[f];n=[];for(q=0;q<c.length;q++)j=c[q],j=l.distanceToSquared(j),n.push(j),j<g&&(g=j,e=f,h=q)}f=0<=h-1?h-1:c.length-1;g=0<=e-1?e-1:k.length-1;var m=[k[e],c[h],c[f]];q=THREE.FontUtils.Triangulate.area(m);var o=[k[e],k[g],c[h]];l=THREE.FontUtils.Triangulate.area(o);n=h;j=e;h+=1;e+=-1;0>
-h&&(h+=c.length);h%=c.length;0>e&&(e+=k.length);e%=k.length;f=0<=h-1?h-1:c.length-1;g=0<=e-1?e-1:k.length-1;m=[k[e],c[h],c[f]];m=THREE.FontUtils.Triangulate.area(m);o=[k[e],k[g],c[h]];o=THREE.FontUtils.Triangulate.area(o);q+l>m+o&&(h=n,e=j,0>h&&(h+=c.length),h%=c.length,0>e&&(e+=k.length),e%=k.length,f=0<=h-1?h-1:c.length-1,g=0<=e-1?e-1:k.length-1);q=c.slice(0,h);l=c.slice(h);n=k.slice(e);j=k.slice(0,e);g=[k[e],k[g],c[h]];r.push([k[e],c[h],c[f]]);r.push(g);c=q.concat(n).concat(j).concat(l)}return{shape:c,
-isolatedPts:r,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,f=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),g,e,h,i,k={};for(g=0,e=d.length;g<e;g++)i=d[g].x+":"+d[g].y,void 0!==k[i]&&console.log("Duplicate point",i),k[i]=g;for(g=0,e=c.length;g<e;g++){h=c[g];for(d=0;3>d;d++)i=h[d].x+":"+h[d].y,i=k[i],void 0!==i&&(h[d]=i)}for(g=0,e=f.length;g<e;g++){h=f[g];for(d=0;3>d;d++)i=h[d].x+":"+h[d].y,i=k[i],void 0!==i&&(h[d]=i)}return c.concat(f)},
+THREE.Shape.Utils={removeHoles:function(a,b){var c=a.concat(),d=c.concat(),f,g,e,h,i,j,k,q,l,n,r=[];for(i=0;i<b.length;i++){j=b[i];Array.prototype.push.apply(d,j);g=Number.POSITIVE_INFINITY;for(f=0;f<j.length;f++){l=j[f];n=[];for(q=0;q<c.length;q++)k=c[q],k=l.distanceToSquared(k),n.push(k),k<g&&(g=k,e=f,h=q)}f=0<=h-1?h-1:c.length-1;g=0<=e-1?e-1:j.length-1;var m=[j[e],c[h],c[f]];q=THREE.FontUtils.Triangulate.area(m);var p=[j[e],j[g],c[h]];l=THREE.FontUtils.Triangulate.area(p);n=h;k=e;h+=1;e+=-1;0>
+h&&(h+=c.length);h%=c.length;0>e&&(e+=j.length);e%=j.length;f=0<=h-1?h-1:c.length-1;g=0<=e-1?e-1:j.length-1;m=[j[e],c[h],c[f]];m=THREE.FontUtils.Triangulate.area(m);p=[j[e],j[g],c[h]];p=THREE.FontUtils.Triangulate.area(p);q+l>m+p&&(h=n,e=k,0>h&&(h+=c.length),h%=c.length,0>e&&(e+=j.length),e%=j.length,f=0<=h-1?h-1:c.length-1,g=0<=e-1?e-1:j.length-1);q=c.slice(0,h);l=c.slice(h);n=j.slice(e);k=j.slice(0,e);g=[j[e],j[g],c[h]];r.push([j[e],c[h],c[f]]);r.push(g);c=q.concat(n).concat(k).concat(l)}return{shape:c,
+isolatedPts:r,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,f=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),g,e,h,i,j={};for(g=0,e=d.length;g<e;g++)i=d[g].x+":"+d[g].y,void 0!==j[i]&&console.log("Duplicate point",i),j[i]=g;for(g=0,e=c.length;g<e;g++){h=c[g];for(d=0;3>d;d++)i=h[d].x+":"+h[d].y,i=j[i],void 0!==i&&(h[d]=i)}for(g=0,e=f.length;g<e;g++){h=f[g];for(d=0;3>d;d++)i=h[d].x+":"+h[d].y,i=j[i],void 0!==i&&(h[d]=i)}return c.concat(f)},
 isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,f){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+
 isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,f){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+
 this.b3p3(a,f)}};THREE.TextPath=function(a,b){THREE.Path.call(this);this.parameters=b||{};this.set(a)};THREE.TextPath.prototype.set=function(a,b){b=b||this.parameters;this.text=a;var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",f=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=f;THREE.FontUtils.style=g};
 this.b3p3(a,f)}};THREE.TextPath=function(a,b){THREE.Path.call(this);this.parameters=b||{};this.set(a)};THREE.TextPath.prototype.set=function(a,b){b=b||this.parameters;this.text=a;var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",f=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=f;THREE.FontUtils.style=g};
 THREE.TextPath.prototype.toShapes=function(){for(var a=THREE.FontUtils.drawText(this.text).paths,b=[],c=0,d=a.length;c<d;c++)Array.prototype.push.apply(b,a[c].toShapes());return b};
 THREE.TextPath.prototype.toShapes=function(){for(var a=THREE.FontUtils.drawText(this.text).paths,b=[],c=0,d=a.length;c<d;c++)Array.prototype.push.apply(b,a[c].toShapes());return b};
 THREE.AnimationHandler=function(){var a=[],b={},c={update:function(b){for(var c=0;c<a.length;c++)a[c].update(b)},addToUpdate:function(b){-1===a.indexOf(b)&&a.push(b)},removeFromUpdate:function(b){b=a.indexOf(b);-1!==b&&a.splice(b,1)},add:function(a){void 0!==b[a.name]&&console.log("THREE.AnimationHandler.add: Warning! "+a.name+" already exists in library. Overwriting.");b[a.name]=a;if(!0!==a.initialized){for(var c=0;c<a.hierarchy.length;c++){for(var d=0;d<a.hierarchy[c].keys.length;d++){if(0>a.hierarchy[c].keys[d].time)a.hierarchy[c].keys[d].time=
 THREE.AnimationHandler=function(){var a=[],b={},c={update:function(b){for(var c=0;c<a.length;c++)a[c].update(b)},addToUpdate:function(b){-1===a.indexOf(b)&&a.push(b)},removeFromUpdate:function(b){b=a.indexOf(b);-1!==b&&a.splice(b,1)},add:function(a){void 0!==b[a.name]&&console.log("THREE.AnimationHandler.add: Warning! "+a.name+" already exists in library. Overwriting.");b[a.name]=a;if(!0!==a.initialized){for(var c=0;c<a.hierarchy.length;c++){for(var d=0;d<a.hierarchy[c].keys.length;d++){if(0>a.hierarchy[c].keys[d].time)a.hierarchy[c].keys[d].time=
-0;if(void 0!==a.hierarchy[c].keys[d].rot&&!(a.hierarchy[c].keys[d].rot instanceof THREE.Quaternion)){var h=a.hierarchy[c].keys[d].rot;a.hierarchy[c].keys[d].rot=new THREE.Quaternion(h[0],h[1],h[2],h[3])}}if(a.hierarchy[c].keys.length&&void 0!==a.hierarchy[c].keys[0].morphTargets){h={};for(d=0;d<a.hierarchy[c].keys.length;d++)for(var i=0;i<a.hierarchy[c].keys[d].morphTargets.length;i++){var k=a.hierarchy[c].keys[d].morphTargets[i];h[k]=-1}a.hierarchy[c].usedMorphTargets=h;for(d=0;d<a.hierarchy[c].keys.length;d++){var j=
-{};for(k in h){for(i=0;i<a.hierarchy[c].keys[d].morphTargets.length;i++)if(a.hierarchy[c].keys[d].morphTargets[i]===k){j[k]=a.hierarchy[c].keys[d].morphTargetsInfluences[i];break}i===a.hierarchy[c].keys[d].morphTargets.length&&(j[k]=0)}a.hierarchy[c].keys[d].morphTargetsInfluences=j}}for(d=1;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].time===a.hierarchy[c].keys[d-1].time&&(a.hierarchy[c].keys.splice(d,1),d--);for(d=0;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].index=d}d=parseInt(a.length*
+0;if(void 0!==a.hierarchy[c].keys[d].rot&&!(a.hierarchy[c].keys[d].rot instanceof THREE.Quaternion)){var h=a.hierarchy[c].keys[d].rot;a.hierarchy[c].keys[d].rot=new THREE.Quaternion(h[0],h[1],h[2],h[3])}}if(a.hierarchy[c].keys.length&&void 0!==a.hierarchy[c].keys[0].morphTargets){h={};for(d=0;d<a.hierarchy[c].keys.length;d++)for(var i=0;i<a.hierarchy[c].keys[d].morphTargets.length;i++){var j=a.hierarchy[c].keys[d].morphTargets[i];h[j]=-1}a.hierarchy[c].usedMorphTargets=h;for(d=0;d<a.hierarchy[c].keys.length;d++){var k=
+{};for(j in h){for(i=0;i<a.hierarchy[c].keys[d].morphTargets.length;i++)if(a.hierarchy[c].keys[d].morphTargets[i]===j){k[j]=a.hierarchy[c].keys[d].morphTargetsInfluences[i];break}i===a.hierarchy[c].keys[d].morphTargets.length&&(k[j]=0)}a.hierarchy[c].keys[d].morphTargetsInfluences=k}}for(d=1;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].time===a.hierarchy[c].keys[d-1].time&&(a.hierarchy[c].keys.splice(d,1),d--);for(d=0;d<a.hierarchy[c].keys.length;d++)a.hierarchy[c].keys[d].index=d}d=parseInt(a.length*
 a.fps,10);a.JIT={};a.JIT.hierarchy=[];for(c=0;c<a.hierarchy.length;c++)a.JIT.hierarchy.push(Array(d));a.initialized=!0}},get:function(a){if("string"===typeof a){if(b[a])return b[a];console.log("THREE.AnimationHandler.get: Couldn't find animation "+a);return null}},parse:function(a){var b=[];if(a instanceof THREE.SkinnedMesh)for(var c=0;c<a.bones.length;c++)b.push(a.bones[c]);else d(a,b);return b}},d=function(a,b){b.push(a);for(var c=0;c<a.children.length;c++)d(a.children[c],b)};c.LINEAR=0;c.CATMULLROM=
 a.fps,10);a.JIT={};a.JIT.hierarchy=[];for(c=0;c<a.hierarchy.length;c++)a.JIT.hierarchy.push(Array(d));a.initialized=!0}},get:function(a){if("string"===typeof a){if(b[a])return b[a];console.log("THREE.AnimationHandler.get: Couldn't find animation "+a);return null}},parse:function(a){var b=[];if(a instanceof THREE.SkinnedMesh)for(var c=0;c<a.bones.length;c++)b.push(a.bones[c]);else d(a,b);return b}},d=function(a,b){b.push(a);for(var c=0;c<a.children.length;c++)d(a.children[c],b)};c.LINEAR=0;c.CATMULLROM=
 1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(a,b,c,d){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=void 0!==c?c:THREE.AnimationHandler.LINEAR;this.JITCompile=void 0!==d?d:!0;this.points=[];this.target=new THREE.Vector3};
 1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(a,b,c,d){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=void 0!==c?c:THREE.AnimationHandler.LINEAR;this.JITCompile=void 0!==d?d:!0;this.points=[];this.target=new THREE.Vector3};
 THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;var c,d=this.hierarchy.length,f;for(c=0;c<d;c++){f=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)f.useQuaternion=!0;f.matrixAutoUpdate=!0;if(void 0===f.animationCache)f.animationCache={},f.animationCache.prevKey={pos:0,rot:0,scl:0},f.animationCache.nextKey={pos:0,rot:0,scl:0},f.animationCache.originalMatrix=f instanceof
 THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;var c,d=this.hierarchy.length,f;for(c=0;c<d;c++){f=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)f.useQuaternion=!0;f.matrixAutoUpdate=!0;if(void 0===f.animationCache)f.animationCache={},f.animationCache.prevKey={pos:0,rot:0,scl:0},f.animationCache.nextKey={pos:0,rot:0,scl:0},f.animationCache.originalMatrix=f instanceof
 THREE.Bone?f.skinMatrix:f.matrix;var g=f.animationCache.prevKey;f=f.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];f.pos=this.getNextKeyWith("pos",c,1);f.rot=this.getNextKeyWith("rot",c,1);f.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Bone?f.skinMatrix:f.matrix;var g=f.animationCache.prevKey;f=f.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];f.pos=this.getNextKeyWith("pos",c,1);f.rot=this.getNextKeyWith("rot",c,1);f.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(void 0!==this.hierarchy[a].animationCache)this.hierarchy[a]instanceof THREE.Bone?this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix:this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix,delete this.hierarchy[a].animationCache};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(void 0!==this.hierarchy[a].animationCache)this.hierarchy[a]instanceof THREE.Bone?this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix:this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix,delete this.hierarchy[a].animationCache};
-THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,d,f,g,e,h,i,k,j=this.data.JIT.hierarchy,q,l;l=this.currentTime+=a*this.timeScale;q=this.currentTime%=this.data.length;k=parseInt(Math.min(q*this.data.fps,this.data.length*this.data.fps),10);for(var n=0,r=this.hierarchy.length;n<r;n++)if(a=this.hierarchy[n],i=a.animationCache,this.JITCompile&&void 0!==j[n][k])a instanceof THREE.Bone?(a.skinMatrix=j[n][k],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!1):(a.matrix=
-j[n][k],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)a instanceof THREE.Bone?a.skinMatrix=a.animationCache.originalMatrix:a.matrix=a.animationCache.originalMatrix;for(var m=0;3>m;m++){c=b[m];e=i.prevKey[c];h=i.nextKey[c];if(h.time<=l){if(q<l)if(this.loop){e=this.data.hierarchy[n].keys[0];for(h=this.getNextKeyWith(c,n,1);h.time<q;)e=h,h=this.getNextKeyWith(c,n,h.index+1)}else{this.stop();return}else{do e=h,h=this.getNextKeyWith(c,n,h.index+1);while(h.time<q)}i.prevKey[c]=
+THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,d,f,g,e,h,i,j,k=this.data.JIT.hierarchy,q,l;l=this.currentTime+=a*this.timeScale;q=this.currentTime%=this.data.length;j=parseInt(Math.min(q*this.data.fps,this.data.length*this.data.fps),10);for(var n=0,r=this.hierarchy.length;n<r;n++)if(a=this.hierarchy[n],i=a.animationCache,this.JITCompile&&void 0!==k[n][j])a instanceof THREE.Bone?(a.skinMatrix=k[n][j],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!1):(a.matrix=
+k[n][j],a.matrixAutoUpdate=!1,a.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)a instanceof THREE.Bone?a.skinMatrix=a.animationCache.originalMatrix:a.matrix=a.animationCache.originalMatrix;for(var m=0;3>m;m++){c=b[m];e=i.prevKey[c];h=i.nextKey[c];if(h.time<=l){if(q<l)if(this.loop){e=this.data.hierarchy[n].keys[0];for(h=this.getNextKeyWith(c,n,1);h.time<q;)e=h,h=this.getNextKeyWith(c,n,h.index+1)}else{this.stop();return}else{do e=h,h=this.getNextKeyWith(c,n,h.index+1);while(h.time<q)}i.prevKey[c]=
 e;i.nextKey[c]=h}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;d=(q-e.time)/(h.time-e.time);f=e[c];g=h[c];if(0>d||1<d)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+n),d=0>d?0:1;if("pos"===c)if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=f[0]+(g[0]-f[0])*d,c.y=f[1]+(g[1]-f[1])*d,c.z=f[2]+(g[2]-f[2])*d;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
 e;i.nextKey[c]=h}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;d=(q-e.time)/(h.time-e.time);f=e[c];g=h[c];if(0>d||1<d)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+n),d=0>d?0:1;if("pos"===c)if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=f[0]+(g[0]-f[0])*d,c.y=f[1]+(g[1]-f[1])*d,c.z=f[2]+(g[2]-f[2])*d;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
 this.getPrevKeyWith("pos",n,e.index-1).pos,this.points[1]=f,this.points[2]=g,this.points[3]=this.getNextKeyWith("pos",n,h.index+1).pos,d=0.33*d+0.33,f=this.interpolateCatmullRom(this.points,d),c.x=f[0],c.y=f[1],c.z=f[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)d=this.interpolateCatmullRom(this.points,1.01*d),this.target.set(d[0],d[1],d[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),d=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,d,0)}else if("rot"===
 this.getPrevKeyWith("pos",n,e.index-1).pos,this.points[1]=f,this.points[2]=g,this.points[3]=this.getNextKeyWith("pos",n,h.index+1).pos,d=0.33*d+0.33,f=this.interpolateCatmullRom(this.points,d),c.x=f[0],c.y=f[1],c.z=f[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)d=this.interpolateCatmullRom(this.points,1.01*d),this.target.set(d[0],d[1],d[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),d=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,d,0)}else if("rot"===
-c)THREE.Quaternion.slerp(f,g,a.quaternion,d);else if("scl"===c)c=a.scale,c.x=f[0]+(g[0]-f[0])*d,c.y=f[1]+(g[1]-f[1])*d,c.z=f[2]+(g[2]-f[2])*d}}if(this.JITCompile&&void 0===j[0][k]){this.hierarchy[0].updateMatrixWorld(!0);for(n=0;n<this.hierarchy.length;n++)j[n][k]=this.hierarchy[n]instanceof THREE.Bone?this.hierarchy[n].skinMatrix.clone():this.hierarchy[n].matrix.clone()}}};
-THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],f,g,e,h,i,k;f=(a.length-1)*b;g=Math.floor(f);f-=g;c[0]=0===g?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]];h=a[c[1]];i=a[c[2]];k=a[c[3]];c=f*f;e=f*c;d[0]=this.interpolate(g[0],h[0],i[0],k[0],f,c,e);d[1]=this.interpolate(g[1],h[1],i[1],k[1],f,c,e);d[2]=this.interpolate(g[2],h[2],i[2],k[2],f,c,e);return d};
+c)THREE.Quaternion.slerp(f,g,a.quaternion,d);else if("scl"===c)c=a.scale,c.x=f[0]+(g[0]-f[0])*d,c.y=f[1]+(g[1]-f[1])*d,c.z=f[2]+(g[2]-f[2])*d}}if(this.JITCompile&&void 0===k[0][j]){this.hierarchy[0].updateMatrixWorld(!0);for(n=0;n<this.hierarchy.length;n++)k[n][j]=this.hierarchy[n]instanceof THREE.Bone?this.hierarchy[n].skinMatrix.clone():this.hierarchy[n].matrix.clone()}}};
+THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],f,g,e,h,i,j;f=(a.length-1)*b;g=Math.floor(f);f-=g;c[0]=0===g?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]];h=a[c[1]];i=a[c[2]];j=a[c[3]];c=f*f;e=f*c;d[0]=this.interpolate(g[0],h[0],i[0],j[0],f,c,e);d[1]=this.interpolate(g[1],h[1],i[1],j[1],f,c,e);d[2]=this.interpolate(g[2],h[2],i[2],j[2],f,c,e);return d};
 THREE.Animation.prototype.interpolate=function(a,b,c,d,f,g,e){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*e+(-3*(b-c)-2*a-d)*g+a*f+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
 THREE.Animation.prototype.interpolate=function(a,b,c,d,f,g,e){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*e+(-3*(b-c)-2*a-d)*g+a*f+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
 THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};
 THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};
-THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.0010;this.isPlaying=!1;this.loop=this.isPaused=!0;this.JITCompile=void 0!==c?c:!0;a=0;for(b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var f=0;f<c.length;f++){var g=c[f],e=this.getNextKeyWith(g,a,0);e&&e.apply(g)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
+THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.001;this.isPlaying=!1;this.loop=this.isPaused=!0;this.JITCompile=void 0!==c?c:!0;a=0;for(b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var f=0;f<c.length;f++){var g=c[f],e=this.getNextKeyWith(g,a,0);e&&e.apply(g)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 d.matrixWorldNeedsUpdate=!0}}};
 d.matrixWorldNeedsUpdate=!0}}};
 THREE.KeyFrameAnimation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;this.startTimeMs=b;this.startTime=1E7;this.endTime=-this.startTime;var c,d=this.hierarchy.length,f,g;for(c=0;c<d;c++){f=this.hierarchy[c];g=this.data.hierarchy[c];f.useQuaternion=!0;if(void 0===g.animationCache)g.animationCache={},g.animationCache.prevKey=null,g.animationCache.nextKey=null,g.animationCache.originalMatrix=f instanceof THREE.Bone?f.skinMatrix:
 THREE.KeyFrameAnimation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;this.startTimeMs=b;this.startTime=1E7;this.endTime=-this.startTime;var c,d=this.hierarchy.length,f,g;for(c=0;c<d;c++){f=this.hierarchy[c];g=this.data.hierarchy[c];f.useQuaternion=!0;if(void 0===g.animationCache)g.animationCache={},g.animationCache.prevKey=null,g.animationCache.nextKey=null,g.animationCache.originalMatrix=f instanceof THREE.Bone?f.skinMatrix:
 f.matrix;f=this.data.hierarchy[c].keys;if(f.length)g.animationCache.prevKey=f[0],g.animationCache.nextKey=f[1],this.startTime=Math.min(f[0].time,this.startTime),this.endTime=Math.max(f[f.length-1].time,this.endTime)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};THREE.KeyFrameAnimation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 f.matrix;f=this.data.hierarchy[c].keys;if(f.length)g.animationCache.prevKey=f[0],g.animationCache.nextKey=f[1],this.startTime=Math.min(f[0].time,this.startTime),this.endTime=Math.max(f[f.length-1].time,this.endTime)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};THREE.KeyFrameAnimation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.KeyFrameAnimation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++){var b=this.hierarchy[a];if(void 0!==b.animationCache){var c=b.animationCache.originalMatrix;b instanceof THREE.Bone?(c.copy(b.skinMatrix),b.skinMatrix=c):(c.copy(b.matrix),b.matrix=c);delete b.animationCache}}};
 THREE.KeyFrameAnimation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++){var b=this.hierarchy[a];if(void 0!==b.animationCache){var c=b.animationCache.originalMatrix;b instanceof THREE.Bone?(c.copy(b.skinMatrix),b.skinMatrix=c):(c.copy(b.matrix),b.matrix=c);delete b.animationCache}}};
-THREE.KeyFrameAnimation.prototype.update=function(a){if(this.isPlaying){var b,c,d,f,g=this.data.JIT.hierarchy,e,h,i;h=this.currentTime+=a*this.timeScale;e=this.currentTime%=this.data.length;if(e<this.startTimeMs)e=this.currentTime=this.startTimeMs+e;f=parseInt(Math.min(e*this.data.fps,this.data.length*this.data.fps),10);if((i=e<h)&&!this.loop){for(var a=0,k=this.hierarchy.length;a<k;a++){var j=this.data.hierarchy[a].keys,g=this.data.hierarchy[a].sids;d=j.length-1;f=this.hierarchy[a];if(j.length){for(j=
-0;j<g.length;j++)e=g[j],(h=this.getPrevKeyWith(e,a,d))&&h.apply(e);this.data.hierarchy[a].node.updateMatrix();f.matrixWorldNeedsUpdate=!0}}this.stop()}else if(!(e<this.startTime)){a=0;for(k=this.hierarchy.length;a<k;a++){d=this.hierarchy[a];b=this.data.hierarchy[a];var j=b.keys,q=b.animationCache;if(this.JITCompile&&void 0!==g[a][f])d instanceof THREE.Bone?(d.skinMatrix=g[a][f],d.matrixWorldNeedsUpdate=!1):(d.matrix=g[a][f],d.matrixWorldNeedsUpdate=!0);else if(j.length){if(this.JITCompile&&q)d instanceof
-THREE.Bone?d.skinMatrix=q.originalMatrix:d.matrix=q.originalMatrix;b=q.prevKey;c=q.nextKey;if(b&&c){if(c.time<=h){if(i&&this.loop){b=j[0];for(c=j[1];c.time<e;)b=c,c=j[b.index+1]}else if(!i)for(var l=j.length-1;c.time<e&&c.index!==l;)b=c,c=j[b.index+1];q.prevKey=b;q.nextKey=c}b.interpolate(c,e)}this.data.hierarchy[a].node.updateMatrix();d.matrixWorldNeedsUpdate=!0}}if(this.JITCompile&&void 0===g[0][f]){this.hierarchy[0].updateMatrixWorld(!0);for(a=0;a<this.hierarchy.length;a++)g[a][f]=this.hierarchy[a]instanceof
+THREE.KeyFrameAnimation.prototype.update=function(a){if(this.isPlaying){var b,c,d,f,g=this.data.JIT.hierarchy,e,h,i;h=this.currentTime+=a*this.timeScale;e=this.currentTime%=this.data.length;if(e<this.startTimeMs)e=this.currentTime=this.startTimeMs+e;f=parseInt(Math.min(e*this.data.fps,this.data.length*this.data.fps),10);if((i=e<h)&&!this.loop){for(var a=0,j=this.hierarchy.length;a<j;a++){var k=this.data.hierarchy[a].keys,g=this.data.hierarchy[a].sids;d=k.length-1;f=this.hierarchy[a];if(k.length){for(k=
+0;k<g.length;k++)e=g[k],(h=this.getPrevKeyWith(e,a,d))&&h.apply(e);this.data.hierarchy[a].node.updateMatrix();f.matrixWorldNeedsUpdate=!0}}this.stop()}else if(!(e<this.startTime)){a=0;for(j=this.hierarchy.length;a<j;a++){d=this.hierarchy[a];b=this.data.hierarchy[a];var k=b.keys,q=b.animationCache;if(this.JITCompile&&void 0!==g[a][f])d instanceof THREE.Bone?(d.skinMatrix=g[a][f],d.matrixWorldNeedsUpdate=!1):(d.matrix=g[a][f],d.matrixWorldNeedsUpdate=!0);else if(k.length){if(this.JITCompile&&q)d instanceof
+THREE.Bone?d.skinMatrix=q.originalMatrix:d.matrix=q.originalMatrix;b=q.prevKey;c=q.nextKey;if(b&&c){if(c.time<=h){if(i&&this.loop){b=k[0];for(c=k[1];c.time<e;)b=c,c=k[b.index+1]}else if(!i)for(var l=k.length-1;c.time<e&&c.index!==l;)b=c,c=k[b.index+1];q.prevKey=b;q.nextKey=c}b.interpolate(c,e)}this.data.hierarchy[a].node.updateMatrix();d.matrixWorldNeedsUpdate=!0}}if(this.JITCompile&&void 0===g[0][f]){this.hierarchy[0].updateMatrixWorld(!0);for(a=0;a<this.hierarchy.length;a++)g[a][f]=this.hierarchy[a]instanceof
 THREE.Bone?this.hierarchy[a].skinMatrix.clone():this.hierarchy[a].matrix.clone()}}}};THREE.KeyFrameAnimation.prototype.getNextKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c%=b.length;c<b.length;c++)if(b[c].hasTarget(a))return b[c];return b[0]};THREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};
 THREE.Bone?this.hierarchy[a].skinMatrix.clone():this.hierarchy[a].matrix.clone()}}}};THREE.KeyFrameAnimation.prototype.getNextKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c%=b.length;c<b.length;c++)if(b[c].hasTarget(a))return b[c];return b[0]};THREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};
 THREE.CubeCamera=function(a,b,c,d){this.heightOffset=c;this.position=new THREE.Vector3(0,c,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position=
 THREE.CubeCamera=function(a,b,c,d){this.heightOffset=c;this.position=new THREE.Vector3(0,c,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position=
 this.position;this.cameraNY.position=this.position;this.cameraPZ.position=this.position;this.cameraNZ.position=this.position;this.cameraPX.up.set(0,-1,0);this.cameraNX.up.set(0,-1,0);this.cameraPY.up.set(0,0,1);this.cameraNY.up.set(0,0,-1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.targetPX=new THREE.Vector3(0,0,0);this.targetNX=new THREE.Vector3(0,0,0);this.targetPY=new THREE.Vector3(0,0,0);this.targetNY=new THREE.Vector3(0,0,0);this.targetPZ=new THREE.Vector3(0,0,0);this.targetNZ=
 this.position;this.cameraNY.position=this.position;this.cameraPZ.position=this.position;this.cameraNZ.position=this.position;this.cameraPX.up.set(0,-1,0);this.cameraNX.up.set(0,-1,0);this.cameraPY.up.set(0,0,1);this.cameraNY.up.set(0,0,-1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.targetPX=new THREE.Vector3(0,0,0);this.targetNX=new THREE.Vector3(0,0,0);this.targetPY=new THREE.Vector3(0,0,0);this.targetNY=new THREE.Vector3(0,0,0);this.targetPZ=new THREE.Vector3(0,0,0);this.targetNZ=
@@ -117,7 +117,7 @@ THREE.CombinedCamera.prototype.toOrthographic=function(){var a=this.cameraP.aspe
 THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.setLens=function(a,b){var c=2*Math.atan((void 0!==b?b:24)/(2*a))*(180/Math.PI);this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};
 THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.setLens=function(a,b){var c=2*Math.atan((void 0!==b?b:24)/(2*a))*(180/Math.PI);this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};
 THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
-THREE.FirstPersonControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.target=new THREE.Vector3(0,0,0);this.domElement=void 0!==b?b:document;this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=
+THREE.FirstPersonControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.target=new THREE.Vector3(0,0,0);this.domElement=void 0!==b?b:document;this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor=
 0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=
 0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=
 !0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown=
 !0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown=
 function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=
 function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=
@@ -125,16 +125,16 @@ function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:
 this.moveUp&&this.object.translateY(b);this.moveDown&&this.object.translateY(-b);a*=this.lookSpeed;this.activeLook||(a=0);this.lon+=this.mouseX*a;this.lookVertical&&(this.lat-=this.mouseY*a);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target,c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta);b=1;this.constrainVertical&&
 this.moveUp&&this.object.translateY(b);this.moveDown&&this.object.translateY(-b);a*=this.lookSpeed;this.activeLook||(a=0);this.lon+=this.mouseX*a;this.lookVertical&&(this.lat-=this.mouseY*a);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target,c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta);b=1;this.constrainVertical&&
 (b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*a;this.lookVertical&&(this.lat-=this.mouseY*a*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=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);b=this.target;c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta);
 (b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*a;this.lookVertical&&(this.lat-=this.mouseY*a*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=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);b=this.target;c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta);
 this.object.lookAt(b)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};
 this.object.lookAt(b)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};
-THREE.PathControls=function(a,b){function c(a){return 1>(a*=2)?0.5*a*a:-0.5*(--a*(a-2)-1)}function d(a,b){return function(){b.apply(a,arguments)}}function f(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.getControlPointsArray(),h=b.getLength(),o=g.length,p=0;f=o-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[f]={time:d,pos:g[f],rot:[0,0,0,1],scl:[1,1,1]};for(f=1;f<o-1;f++)p=d*h.chunks[f]/h.total,b.keys[f]={time:p,pos:g[f]};e.hierarchy[0]=b;THREE.AnimationHandler.add(e);
+THREE.PathControls=function(a,b){function c(a){return 1>(a*=2)?0.5*a*a:-0.5*(--a*(a-2)-1)}function d(a,b){return function(){b.apply(a,arguments)}}function f(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.getControlPointsArray(),h=b.getLength(),p=g.length,o=0;f=p-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[f]={time:d,pos:g[f],rot:[0,0,0,1],scl:[1,1,1]};for(f=1;f<p-1;f++)o=d*h.chunks[f]/h.total,b.keys[f]={time:o,pos:g[f]};e.hierarchy[0]=b;THREE.AnimationHandler.add(e);
 return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function g(a,b){var c,d,f=new THREE.Geometry;for(c=0;c<a.points.length*b;c++)d=c/(a.points.length*b),d=a.getPoint(d),f.vertices[c]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return f}this.object=a;this.domElement=void 0!==b?b:document;this.id="PathControls"+THREE.PathControlsIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=
 return new THREE.Animation(a,c,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function g(a,b){var c,d,f=new THREE.Geometry;for(c=0;c<a.points.length*b;c++)d=c/(a.points.length*b),d=a.getPoint(d),f.vertices[c]=new THREE.Vertex(new THREE.Vector3(d.x,d.y,d.z));return f}this.object=a;this.domElement=void 0!==b?b:document;this.id="PathControls"+THREE.PathControlsIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=
-new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookHorizontal=this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/
+new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.005;this.lookHorizontal=this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/
 2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var e=2*Math.PI,h=Math.PI/180;this.update=function(a){var b;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed*a);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed*a);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;a=this.phi%e;this.phi=0<=a?a:a+e;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange;
 2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var e=2*Math.PI,h=Math.PI/180;this.update=function(a){var b;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed*a);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed*a);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;a=this.phi%e;this.phi=0<=a?a:a+e;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange;
 b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var d=a[1]-a[0];this.phi=c((b-a[0])/d)*d+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);d=a[1]-a[0];this.theta=c((b-a[0])/d)*d+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(a){this.domElement===
 b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var d=a[1]-a[0];this.phi=c((b-a[0])/d)*d+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);d=a[1]-a[0];this.theta=c((b-a[0])/d)*d+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(a){this.domElement===
 document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),b=new THREE.MeshLambertMaterial({color:65280}),
 document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),b=new THREE.MeshLambertMaterial({color:65280}),
 c=new THREE.CubeGeometry(10,10,20),e=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,a);a=new THREE.Mesh(e,b);a.position.set(0,10,0);this.animation=f(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=f(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a=
 c=new THREE.CubeGeometry(10,10,20),e=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,a);a=new THREE.Mesh(e,b);a.position.set(0,10,0);this.animation=f(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=f(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a=
 this.debugPath,b=this.spline,e=g(b,10),c=g(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3}),e=new THREE.Line(e,h),c=new THREE.ParticleSystem(c,new THREE.ParticleBasicMaterial({color:16755200,size:3}));e.scale.set(1,1,1);a.add(e);c.scale.set(1,1,1);a.add(c);for(var e=new THREE.SphereGeometry(1,16,8),h=new THREE.MeshBasicMaterial({color:65280}),n=0;n<b.points.length;n++)c=new THREE.Mesh(e,h),c.position.copy(b.points[n]),a.add(c)}this.domElement.addEventListener("mousemove",d(this,this.onMouseMove),
 this.debugPath,b=this.spline,e=g(b,10),c=g(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3}),e=new THREE.Line(e,h),c=new THREE.ParticleSystem(c,new THREE.ParticleBasicMaterial({color:16755200,size:3}));e.scale.set(1,1,1);a.add(e);c.scale.set(1,1,1);a.add(c);for(var e=new THREE.SphereGeometry(1,16,8),h=new THREE.MeshBasicMaterial({color:65280}),n=0;n<b.points.length;n++)c=new THREE.Mesh(e,h),c.position.copy(b.points[n]),a.add(c)}this.domElement.addEventListener("mousemove",d(this,this.onMouseMove),
 !1)}};THREE.PathControlsIdCounter=0;
 !1)}};THREE.PathControlsIdCounter=0;
-THREE.FlyControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.domElement=void 0!==b?b:document;b&&this.domElement.setAttribute("tabindex",-1);this.movementSpeed=1;this.rollSpeed=0.0050;this.autoForward=this.dragToLook=!1;this.object.useQuaternion=!0;this.tmpQuaternion=new THREE.Quaternion;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,
+THREE.FlyControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.domElement=void 0!==b?b:document;b&&this.domElement.setAttribute("tabindex",-1);this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.object.useQuaternion=!0;this.tmpQuaternion=new THREE.Quaternion;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,
 0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.handleEvent=function(a){if("function"==typeof this[a.type])this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=
 0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.handleEvent=function(a){if("function"==typeof this[a.type])this[a.type](a)};this.keydown=function(a){if(!a.altKey){switch(a.keyCode){case 16:this.movementSpeedMultiplier=0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=
 1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=
 1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=
 0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(a.button){case 0:this.object.moveForward=
 0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(a.button){case 0:this.object.moveForward=
@@ -143,65 +143,65 @@ THREE.FlyControls=function(a,b){function c(a,b){return function(){b.apply(a,argu
 this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=
 this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=
 -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,
 -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,
 this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};
 this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};
-THREE.RollControls=function(a,b){this.object=a;this.domElement=void 0!==b?b:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var c=new THREE.Vector3,d=new THREE.Vector3,f=new THREE.Vector3,g=new THREE.Matrix4,e=!1,h=1,i=0,k=0,j=0,q=0,l=0,n=window.innerWidth/2,r=window.innerHeight/2;this.update=function(a){if(this.mouseLook){var b=a*this.lookSpeed;
-this.rotateHorizontally(b*q);this.rotateVertically(b*l)}b=a*this.movementSpeed;this.object.translateZ(-b*(0<i||this.autoForward&&!(0>i)?1:i));this.object.translateX(b*k);this.object.translateY(b*j);e&&(this.roll+=this.rollSpeed*a*h);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();f.copy(this.forward);d.set(0,1,0);c.cross(d,
+THREE.RollControls=function(a,b){this.object=a;this.domElement=void 0!==b?b:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var c=new THREE.Vector3,d=new THREE.Vector3,f=new THREE.Vector3,g=new THREE.Matrix4,e=!1,h=1,i=0,j=0,k=0,q=0,l=0,n=window.innerWidth/2,r=window.innerHeight/2;this.update=function(a){if(this.mouseLook){var b=a*this.lookSpeed;
+this.rotateHorizontally(b*q);this.rotateVertically(b*l)}b=a*this.movementSpeed;this.object.translateZ(-b*(0<i||this.autoForward&&!(0>i)?1:i));this.object.translateX(b*j);this.object.translateY(b*k);e&&(this.roll+=this.rollSpeed*a*h);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();f.copy(this.forward);d.set(0,1,0);c.cross(d,
 f).normalize();d.cross(f,c).normalize();this.object.matrix.n11=c.x;this.object.matrix.n12=d.x;this.object.matrix.n13=f.x;this.object.matrix.n21=c.y;this.object.matrix.n22=d.y;this.object.matrix.n23=f.y;this.object.matrix.n31=c.z;this.object.matrix.n32=d.z;this.object.matrix.n33=f.z;g.identity();g.n11=Math.cos(this.roll);g.n12=-Math.sin(this.roll);g.n21=Math.sin(this.roll);g.n22=Math.cos(this.roll);this.object.matrix.multiplySelf(g);this.object.matrixWorldNeedsUpdate=!0;this.object.matrix.n14=this.object.position.x;
 f).normalize();d.cross(f,c).normalize();this.object.matrix.n11=c.x;this.object.matrix.n12=d.x;this.object.matrix.n13=f.x;this.object.matrix.n21=c.y;this.object.matrix.n22=d.y;this.object.matrix.n23=f.y;this.object.matrix.n31=c.z;this.object.matrix.n32=d.z;this.object.matrix.n33=f.z;g.identity();g.n11=Math.cos(this.roll);g.n12=-Math.sin(this.roll);g.n21=Math.sin(this.roll);g.n22=Math.cos(this.roll);this.object.matrix.multiplySelf(g);this.object.matrixWorldNeedsUpdate=!0;this.object.matrix.n14=this.object.position.x;
 this.object.matrix.n24=this.object.position.y;this.object.matrix.n34=this.object.position.z};this.translateX=function(a){this.object.position.x+=this.object.matrix.n11*a;this.object.position.y+=this.object.matrix.n21*a;this.object.position.z+=this.object.matrix.n31*a};this.translateY=function(a){this.object.position.x+=this.object.matrix.n12*a;this.object.position.y+=this.object.matrix.n22*a;this.object.position.z+=this.object.matrix.n32*a};this.translateZ=function(a){this.object.position.x-=this.object.matrix.n13*
 this.object.matrix.n24=this.object.position.y;this.object.matrix.n34=this.object.position.z};this.translateX=function(a){this.object.position.x+=this.object.matrix.n11*a;this.object.position.y+=this.object.matrix.n21*a;this.object.position.z+=this.object.matrix.n31*a};this.translateY=function(a){this.object.position.x+=this.object.matrix.n12*a;this.object.position.y+=this.object.matrix.n22*a;this.object.position.z+=this.object.matrix.n32*a};this.translateZ=function(a){this.object.position.x-=this.object.matrix.n13*
 a;this.object.position.y-=this.object.matrix.n23*a;this.object.position.z-=this.object.matrix.n33*a};this.rotateHorizontally=function(a){c.set(this.object.matrix.n11,this.object.matrix.n21,this.object.matrix.n31);c.multiplyScalar(a);this.forward.subSelf(c);this.forward.normalize()};this.rotateVertically=function(a){d.set(this.object.matrix.n12,this.object.matrix.n22,this.object.matrix.n32);d.multiplyScalar(a);this.forward.addSelf(d);this.forward.normalize()};this.domElement.addEventListener("contextmenu",
 a;this.object.position.y-=this.object.matrix.n23*a;this.object.position.z-=this.object.matrix.n33*a};this.rotateHorizontally=function(a){c.set(this.object.matrix.n11,this.object.matrix.n21,this.object.matrix.n31);c.multiplyScalar(a);this.forward.subSelf(c);this.forward.normalize()};this.rotateVertically=function(a){d.set(this.object.matrix.n12,this.object.matrix.n22,this.object.matrix.n32);d.multiplyScalar(a);this.forward.addSelf(d);this.forward.normalize()};this.domElement.addEventListener("contextmenu",
 function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",function(a){q=(a.clientX-n)/window.innerWidth;l=(a.clientY-r)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:i=1;break;case 2:i=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:i=0;break;case 2:i=0}},!1);this.domElement.addEventListener("keydown",
 function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",function(a){q=(a.clientX-n)/window.innerWidth;l=(a.clientY-r)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:i=1;break;case 2:i=-1}},!1);this.domElement.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation();switch(a.button){case 0:i=0;break;case 2:i=0}},!1);this.domElement.addEventListener("keydown",
-function(a){switch(a.keyCode){case 38:case 87:i=1;break;case 37:case 65:k=-1;break;case 40:case 83:i=-1;break;case 39:case 68:k=1;break;case 81:e=!0;h=1;break;case 69:e=!0;h=-1;break;case 82:j=1;break;case 70:j=-1}},!1);this.domElement.addEventListener("keyup",function(a){switch(a.keyCode){case 38:case 87:i=0;break;case 37:case 65:k=0;break;case 40:case 83:i=0;break;case 39:case 68:k=0;break;case 81:e=!1;break;case 69:e=!1;break;case 82:j=0;break;case 70:j=0}},!1)};
+function(a){switch(a.keyCode){case 38:case 87:i=1;break;case 37:case 65:j=-1;break;case 40:case 83:i=-1;break;case 39:case 68:j=1;break;case 81:e=!0;h=1;break;case 69:e=!0;h=-1;break;case 82:k=1;break;case 70:k=-1}},!1);this.domElement.addEventListener("keyup",function(a){switch(a.keyCode){case 38:case 87:i=0;break;case 37:case 65:j=0;break;case 40:case 83:i=0;break;case 39:case 68:j=0;break;case 81:e=!1;break;case 69:e=!1;break;case 82:k=0;break;case 70:k=0}},!1)};
 THREE.TrackballControls=function(a,b){var c=this;this.object=a;this.domElement=void 0!==b?b:document;this.enabled=!0;this.screen={width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=(this.screen.width+this.screen.height)/4;this.rotateSpeed=1;this.zoomSpeed=1.2;this.panSpeed=0.3;this.staticMoving=this.noPan=this.noZoom=this.noRotate=!1;this.dynamicDampingFactor=0.2;this.minDistance=0;this.maxDistance=Infinity;this.keys=[65,83,68];this.target=new THREE.Vector3(0,
 THREE.TrackballControls=function(a,b){var c=this;this.object=a;this.domElement=void 0!==b?b:document;this.enabled=!0;this.screen={width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=(this.screen.width+this.screen.height)/4;this.rotateSpeed=1;this.zoomSpeed=1.2;this.panSpeed=0.3;this.staticMoving=this.noPan=this.noZoom=this.noRotate=!1;this.dynamicDampingFactor=0.2;this.minDistance=0;this.maxDistance=Infinity;this.keys=[65,83,68];this.target=new THREE.Vector3(0,
-0,0);var d=!1,f=-1,g=new THREE.Vector3,e=new THREE.Vector3,h=new THREE.Vector3,i=new THREE.Vector2,k=new THREE.Vector2,j=new THREE.Vector2,q=new THREE.Vector2;this.handleEvent=function(a){if("function"==typeof this[a.type])this[a.type](a)};this.getMouseOnScreen=function(a,b){return new THREE.Vector2(0.5*((a-c.screen.offsetLeft)/c.radius),0.5*((b-c.screen.offsetTop)/c.radius))};this.getMouseProjectionOnBall=function(a,b){var d=new THREE.Vector3((a-0.5*c.screen.width-c.screen.offsetLeft)/c.radius,(0.5*
+0,0);var d=!1,f=-1,g=new THREE.Vector3,e=new THREE.Vector3,h=new THREE.Vector3,i=new THREE.Vector2,j=new THREE.Vector2,k=new THREE.Vector2,q=new THREE.Vector2;this.handleEvent=function(a){if("function"==typeof this[a.type])this[a.type](a)};this.getMouseOnScreen=function(a,b){return new THREE.Vector2(0.5*((a-c.screen.offsetLeft)/c.radius),0.5*((b-c.screen.offsetTop)/c.radius))};this.getMouseProjectionOnBall=function(a,b){var d=new THREE.Vector3((a-0.5*c.screen.width-c.screen.offsetLeft)/c.radius,(0.5*
 c.screen.height+c.screen.offsetTop-b)/c.radius,0),e=d.length();1<e?d.normalize():d.z=Math.sqrt(1-e*e);g.copy(c.object.position).subSelf(c.target);e=c.object.up.clone().setLength(d.y);e.addSelf(c.object.up.clone().crossSelf(g).setLength(d.x));e.addSelf(g.setLength(d.z));return e};this.rotateCamera=function(){var a=Math.acos(e.dot(h)/e.length()/h.length());if(a){var b=(new THREE.Vector3).cross(e,h).normalize(),d=new THREE.Quaternion,a=a*c.rotateSpeed;d.setFromAxisAngle(b,-a);d.multiplyVector3(g);d.multiplyVector3(c.object.up);
 c.screen.height+c.screen.offsetTop-b)/c.radius,0),e=d.length();1<e?d.normalize():d.z=Math.sqrt(1-e*e);g.copy(c.object.position).subSelf(c.target);e=c.object.up.clone().setLength(d.y);e.addSelf(c.object.up.clone().crossSelf(g).setLength(d.x));e.addSelf(g.setLength(d.z));return e};this.rotateCamera=function(){var a=Math.acos(e.dot(h)/e.length()/h.length());if(a){var b=(new THREE.Vector3).cross(e,h).normalize(),d=new THREE.Quaternion,a=a*c.rotateSpeed;d.setFromAxisAngle(b,-a);d.multiplyVector3(g);d.multiplyVector3(c.object.up);
-d.multiplyVector3(h);c.staticMoving?e=h:(d.setFromAxisAngle(b,a*(c.dynamicDampingFactor-1)),d.multiplyVector3(e))}};this.zoomCamera=function(){var a=1+(k.y-i.y)*c.zoomSpeed;1!==a&&0<a&&(g.multiplyScalar(a),c.staticMoving?i=k:i.y+=(k.y-i.y)*this.dynamicDampingFactor)};this.panCamera=function(){var a=q.clone().subSelf(j);if(a.lengthSq()){a.multiplyScalar(g.length()*c.panSpeed);var b=g.clone().crossSelf(c.object.up).setLength(a.x);b.addSelf(c.object.up.clone().setLength(a.y));c.object.position.addSelf(b);
-c.target.addSelf(b);c.staticMoving?j=q:j.addSelf(a.sub(q,j).multiplyScalar(c.dynamicDampingFactor))}};this.checkDistances=function(){if(!c.noZoom||!c.noPan)c.object.position.lengthSq()>c.maxDistance*c.maxDistance&&c.object.position.setLength(c.maxDistance),g.lengthSq()<c.minDistance*c.minDistance&&c.object.position.add(c.target,g.setLength(c.minDistance))};this.update=function(){g.copy(c.object.position).subSelf(this.target);c.noRotate||c.rotateCamera();c.noZoom||c.zoomCamera();c.noPan||c.panCamera();
-c.object.position.add(c.target,g);c.checkDistances();c.object.lookAt(c.target)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",function(a){c.enabled&&(d&&(e=h=c.getMouseProjectionOnBall(a.clientX,a.clientY),i=k=c.getMouseOnScreen(a.clientX,a.clientY),j=q=c.getMouseOnScreen(a.clientX,a.clientY),d=!1),-1!==f&&(0===f&&!c.noRotate?h=c.getMouseProjectionOnBall(a.clientX,a.clientY):1===f&&!c.noZoom?k=c.getMouseOnScreen(a.clientX,
-a.clientY):2===f&&!c.noPan&&(q=c.getMouseOnScreen(a.clientX,a.clientY))))},!1);this.domElement.addEventListener("mousedown",function(a){if(c.enabled&&(a.preventDefault(),a.stopPropagation(),-1===f))f=a.button,0===f&&!c.noRotate?e=h=c.getMouseProjectionOnBall(a.clientX,a.clientY):1===f&&!c.noZoom?i=k=c.getMouseOnScreen(a.clientX,a.clientY):this.noPan||(j=q=c.getMouseOnScreen(a.clientX,a.clientY))},!1);this.domElement.addEventListener("mouseup",function(a){c.enabled&&(a.preventDefault(),a.stopPropagation(),
+d.multiplyVector3(h);c.staticMoving?e=h:(d.setFromAxisAngle(b,a*(c.dynamicDampingFactor-1)),d.multiplyVector3(e))}};this.zoomCamera=function(){var a=1+(j.y-i.y)*c.zoomSpeed;1!==a&&0<a&&(g.multiplyScalar(a),c.staticMoving?i=j:i.y+=(j.y-i.y)*this.dynamicDampingFactor)};this.panCamera=function(){var a=q.clone().subSelf(k);if(a.lengthSq()){a.multiplyScalar(g.length()*c.panSpeed);var b=g.clone().crossSelf(c.object.up).setLength(a.x);b.addSelf(c.object.up.clone().setLength(a.y));c.object.position.addSelf(b);
+c.target.addSelf(b);c.staticMoving?k=q:k.addSelf(a.sub(q,k).multiplyScalar(c.dynamicDampingFactor))}};this.checkDistances=function(){if(!c.noZoom||!c.noPan)c.object.position.lengthSq()>c.maxDistance*c.maxDistance&&c.object.position.setLength(c.maxDistance),g.lengthSq()<c.minDistance*c.minDistance&&c.object.position.add(c.target,g.setLength(c.minDistance))};this.update=function(){g.copy(c.object.position).subSelf(this.target);c.noRotate||c.rotateCamera();c.noZoom||c.zoomCamera();c.noPan||c.panCamera();
+c.object.position.add(c.target,g);c.checkDistances();c.object.lookAt(c.target)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",function(a){c.enabled&&(d&&(e=h=c.getMouseProjectionOnBall(a.clientX,a.clientY),i=j=c.getMouseOnScreen(a.clientX,a.clientY),k=q=c.getMouseOnScreen(a.clientX,a.clientY),d=!1),-1!==f&&(0===f&&!c.noRotate?h=c.getMouseProjectionOnBall(a.clientX,a.clientY):1===f&&!c.noZoom?j=c.getMouseOnScreen(a.clientX,
+a.clientY):2===f&&!c.noPan&&(q=c.getMouseOnScreen(a.clientX,a.clientY))))},!1);this.domElement.addEventListener("mousedown",function(a){if(c.enabled&&(a.preventDefault(),a.stopPropagation(),-1===f))f=a.button,0===f&&!c.noRotate?e=h=c.getMouseProjectionOnBall(a.clientX,a.clientY):1===f&&!c.noZoom?i=j=c.getMouseOnScreen(a.clientX,a.clientY):this.noPan||(k=q=c.getMouseOnScreen(a.clientX,a.clientY))},!1);this.domElement.addEventListener("mouseup",function(a){c.enabled&&(a.preventDefault(),a.stopPropagation(),
 f=-1)},!1);window.addEventListener("keydown",function(a){c.enabled&&-1===f&&(a.keyCode===c.keys[0]&&!c.noRotate?f=0:a.keyCode===c.keys[1]&&!c.noZoom?f=1:a.keyCode===c.keys[2]&&!c.noPan&&(f=2),-1!==f&&(d=!0))},!1);window.addEventListener("keyup",function(){c.enabled&&-1!==f&&(f=-1)},!1)};
 f=-1)},!1);window.addEventListener("keydown",function(a){c.enabled&&-1===f&&(a.keyCode===c.keys[0]&&!c.noRotate?f=0:a.keyCode===c.keys[1]&&!c.noZoom?f=1:a.keyCode===c.keys[2]&&!c.noPan&&(f=2),-1!==f&&(d=!0))},!1);window.addEventListener("keyup",function(){c.enabled&&-1!==f&&(f=-1)},!1)};
-THREE.CubeGeometry=function(a,b,c,d,f,g,e,h){function i(a,b,c,e,h,i,l,j){var m,n=d||1,q=f||1,r=h/2,p=i/2,o=k.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)m="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)m="y",q=g||1;else if("z"===a&&"y"===b||"y"===a&&"z"===b)m="x",n=g||1;var s=n+1,t=q+1,C=h/n,L=i/q,N=new THREE.Vector3;N[m]=0<l?1:-1;for(h=0;h<t;h++)for(i=0;i<s;i++){var M=new THREE.Vector3;M[a]=(i*C-r)*c;M[b]=(h*L-p)*e;M[m]=l;k.vertices.push(new THREE.Vertex(M))}for(h=0;h<q;h++)for(i=0;i<n;i++)a=
-new THREE.Face4(i+s*h+o,i+s*(h+1)+o,i+1+s*(h+1)+o,i+1+s*h+o),a.normal.copy(N),a.vertexNormals.push(N.clone(),N.clone(),N.clone(),N.clone()),a.materialIndex=j,k.faces.push(a),k.faceVertexUvs[0].push([new THREE.UV(i/n,h/q),new THREE.UV(i/n,(h+1)/q),new THREE.UV((i+1)/n,(h+1)/q),new THREE.UV((i+1)/n,h/q)])}THREE.Geometry.call(this);var k=this,j=a/2,q=b/2,l=c/2,n,r,m,o,p,s;if(void 0!==e){if(e instanceof Array)this.materials=e;else{this.materials=[];for(n=0;6>n;n++)this.materials.push(e)}n=0;o=1;r=2;p=
-3;m=4;s=5}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(void 0!=h)for(var t in h)void 0!==this.sides[t]&&(this.sides[t]=h[t]);this.sides.px&&i("z","y",-1,-1,c,b,j,n);this.sides.nx&&i("z","y",1,-1,c,b,-j,o);this.sides.py&&i("x","z",1,1,a,c,q,r);this.sides.ny&&i("x","z",1,-1,a,c,-q,p);this.sides.pz&&i("x","y",1,-1,a,b,l,m);this.sides.nz&&i("x","y",-1,-1,a,b,-l,s);this.computeCentroids();this.mergeVertices()};THREE.CubeGeometry.prototype=new THREE.Geometry;
+THREE.CubeGeometry=function(a,b,c,d,f,g,e,h){function i(a,b,c,e,h,i,l,k){var m,n=d||1,q=f||1,r=h/2,o=i/2,p=j.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)m="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)m="y",q=g||1;else if("z"===a&&"y"===b||"y"===a&&"z"===b)m="x",n=g||1;var s=n+1,t=q+1,D=h/n,L=i/q,N=new THREE.Vector3;N[m]=0<l?1:-1;for(h=0;h<t;h++)for(i=0;i<s;i++){var M=new THREE.Vector3;M[a]=(i*D-r)*c;M[b]=(h*L-o)*e;M[m]=l;j.vertices.push(new THREE.Vertex(M))}for(h=0;h<q;h++)for(i=0;i<n;i++)a=
+new THREE.Face4(i+s*h+p,i+s*(h+1)+p,i+1+s*(h+1)+p,i+1+s*h+p),a.normal.copy(N),a.vertexNormals.push(N.clone(),N.clone(),N.clone(),N.clone()),a.materialIndex=k,j.faces.push(a),j.faceVertexUvs[0].push([new THREE.UV(i/n,h/q),new THREE.UV(i/n,(h+1)/q),new THREE.UV((i+1)/n,(h+1)/q),new THREE.UV((i+1)/n,h/q)])}THREE.Geometry.call(this);var j=this,k=a/2,q=b/2,l=c/2,n,r,m,p,o,s;if(void 0!==e){if(e instanceof Array)this.materials=e;else{this.materials=[];for(n=0;6>n;n++)this.materials.push(e)}n=0;p=1;r=2;o=
+3;m=4;s=5}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(void 0!=h)for(var t in h)void 0!==this.sides[t]&&(this.sides[t]=h[t]);this.sides.px&&i("z","y",-1,-1,c,b,k,n);this.sides.nx&&i("z","y",1,-1,c,b,-k,p);this.sides.py&&i("x","z",1,1,a,c,q,r);this.sides.ny&&i("x","z",1,-1,a,c,-q,o);this.sides.pz&&i("x","y",1,-1,a,b,l,m);this.sides.nz&&i("x","y",-1,-1,a,b,-l,s);this.computeCentroids();this.mergeVertices()};THREE.CubeGeometry.prototype=new THREE.Geometry;
 THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
 THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
-THREE.CylinderGeometry=function(a,b,c,d,f,g){THREE.Geometry.call(this);var a=void 0!==a?a:20,b=void 0!==b?b:20,c=void 0!==c?c:100,e=c/2,d=d||8,f=f||1,h,i,k=[],j=[];for(i=0;i<=f;i++){var q=[],l=[],n=i/f,r=n*(b-a)+a;for(h=0;h<=d;h++){var m=h/d,o=r*Math.sin(2*m*Math.PI),p=-n*c+e,s=r*Math.cos(2*m*Math.PI);this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,p,s)));q.push(this.vertices.length-1);l.push(new THREE.UV(m,n))}k.push(q);j.push(l)}for(i=0;i<f;i++)for(h=0;h<d;h++){var c=k[i][h],q=k[i+1][h],
-l=k[i+1][h+1],n=k[i][h+1],r=this.vertices[c].position.clone().setY(0).normalize(),m=this.vertices[q].position.clone().setY(0).normalize(),o=this.vertices[l].position.clone().setY(0).normalize(),p=this.vertices[n].position.clone().setY(0).normalize(),s=j[i][h].clone(),t=j[i+1][h].clone(),u=j[i+1][h+1].clone(),v=j[i][h+1].clone();this.faces.push(new THREE.Face4(c,q,l,n,[r,m,o,p]));this.faceVertexUvs[0].push([s,t,u,v])}if(!g&&0<a){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,e,0)));for(h=
-0;h<d;h++)c=k[0][h],q=k[0][h+1],l=this.vertices.length-1,r=new THREE.Vector3(0,1,0),m=new THREE.Vector3(0,1,0),o=new THREE.Vector3(0,1,0),s=j[0][h].clone(),t=j[0][h+1].clone(),u=new THREE.UV(t.u,0),this.faces.push(new THREE.Face3(c,q,l,[r,m,o])),this.faceVertexUvs[0].push([s,t,u])}if(!g&&0<b){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-e,0)));for(h=0;h<d;h++)c=k[i][h+1],q=k[i][h],l=this.vertices.length-1,r=new THREE.Vector3(0,-1,0),m=new THREE.Vector3(0,-1,0),o=new THREE.Vector3(0,-1,
-0),s=j[i][h+1].clone(),t=j[i][h].clone(),u=new THREE.UV(t.u,1),this.faces.push(new THREE.Face3(c,q,l,[r,m,o])),this.faceVertexUvs[0].push([s,t,u])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
+THREE.CylinderGeometry=function(a,b,c,d,f,g){THREE.Geometry.call(this);var a=void 0!==a?a:20,b=void 0!==b?b:20,c=void 0!==c?c:100,e=c/2,d=d||8,f=f||1,h,i,j=[],k=[];for(i=0;i<=f;i++){var q=[],l=[],n=i/f,r=n*(b-a)+a;for(h=0;h<=d;h++){var m=h/d,p=r*Math.sin(2*m*Math.PI),o=-n*c+e,s=r*Math.cos(2*m*Math.PI);this.vertices.push(new THREE.Vertex(new THREE.Vector3(p,o,s)));q.push(this.vertices.length-1);l.push(new THREE.UV(m,n))}j.push(q);k.push(l)}for(i=0;i<f;i++)for(h=0;h<d;h++){var c=j[i][h],q=j[i+1][h],
+l=j[i+1][h+1],n=j[i][h+1],r=this.vertices[c].position.clone().setY(0).normalize(),m=this.vertices[q].position.clone().setY(0).normalize(),p=this.vertices[l].position.clone().setY(0).normalize(),o=this.vertices[n].position.clone().setY(0).normalize(),s=k[i][h].clone(),t=k[i+1][h].clone(),u=k[i+1][h+1].clone(),v=k[i][h+1].clone();this.faces.push(new THREE.Face4(c,q,l,n,[r,m,p,o]));this.faceVertexUvs[0].push([s,t,u,v])}if(!g&&0<a){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,e,0)));for(h=
+0;h<d;h++)c=j[0][h],q=j[0][h+1],l=this.vertices.length-1,r=new THREE.Vector3(0,1,0),m=new THREE.Vector3(0,1,0),p=new THREE.Vector3(0,1,0),s=k[0][h].clone(),t=k[0][h+1].clone(),u=new THREE.UV(t.u,0),this.faces.push(new THREE.Face3(c,q,l,[r,m,p])),this.faceVertexUvs[0].push([s,t,u])}if(!g&&0<b){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-e,0)));for(h=0;h<d;h++)c=j[i][h+1],q=j[i][h],l=this.vertices.length-1,r=new THREE.Vector3(0,-1,0),m=new THREE.Vector3(0,-1,0),p=new THREE.Vector3(0,-1,
+0),s=k[i][h+1].clone(),t=k[i][h].clone(),u=new THREE.UV(t.u,1),this.faces.push(new THREE.Face3(c,q,l,[r,m,p])),this.faceVertexUvs[0].push([s,t,u])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
 THREE.ExtrudeGeometry=function(a,b){if("undefined"!==typeof a){THREE.Geometry.call(this);var a=a instanceof Array?a:[a],c,d,f=a.length;this.shapebb=a[f-1].getBoundingBox();for(d=0;d<f;d++)c=a[d],this.addShape(c,b);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
 THREE.ExtrudeGeometry=function(a,b){if("undefined"!==typeof a){THREE.Geometry.call(this);var a=a instanceof Array?a:[a],c,d,f=a.length;this.shapebb=a[f-1].getBoundingBox();for(d=0;d<f;d++)c=a[d],this.addShape(c,b);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).addSelf(a)}function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,f=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,i=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();f.set(-d.y,d.x);g.set(e.y,-e.x);h.copy(a).addSelf(f);i.copy(a).addSelf(g);if(h.equals(i))return g.clone();
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).addSelf(a)}function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,f=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,i=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();f.set(-d.y,d.x);g.set(e.y,-e.x);h.copy(a).addSelf(f);i.copy(a).addSelf(g);if(h.equals(i))return g.clone();
-h.copy(b).addSelf(f);i.copy(c).addSelf(g);f=d.dot(g);g=i.subSelf(h).dot(g);0===f&&(console.log("Either infinite or no solutions!"),0===g?console.log("Its finite solutions."):console.log("Too bad, no solutions."));g/=f;return 0>g?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(g).addSelf(h).subSelf(a).clone()}function f(a){for(y=a.length;0<=--y;){C=y;L=y-1;0>L&&(L=a.length-1);for(var b=
-0,c=n+2*j,b=0;b<c;b++){var d=H*b,e=H*(b+1),f=O+C+d,g=O+C+e,l=f,d=O+L+d,e=O+L+e,k=g,l=l+F,d=d+F,e=e+F,k=k+F;A.faces.push(new THREE.Face4(l,d,e,k,null,null,u));void 0!==u&&(l=b/c,d=(b+1)/c,e=h+2*i,f=(A.vertices[f].position.z+i)/e,g=(A.vertices[g].position.z+i)/e,A.faceVertexUvs[0].push([new THREE.UV(f,l),new THREE.UV(g,l),new THREE.UV(g,d),new THREE.UV(f,d)]))}}}function g(a,b,c){A.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}function e(a,b,c){a+=F;b+=F;c+=F;A.faces.push(new THREE.Face3(a,
-b,c,null,null,t));if(void 0!==t){var d=v.minX,e=v.minY,f=v.maxY,g=v.maxX,h=A.vertices[b].position.x-d,b=A.vertices[b].position.y-e,i=A.vertices[c].position.x-d,c=A.vertices[c].position.y-e;A.faceVertexUvs[0].push([new THREE.UV((A.vertices[a].position.x-d)/g,(A.vertices[a].position.y-e)/f),new THREE.UV(h/g,b/f),new THREE.UV(i/g,c/f)])}}var h=void 0!==b.amount?b.amount:100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,j=void 0!==b.bevelSegments?b.bevelSegments:
-3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,l=void 0!==b.curveSegments?b.curveSegments:12,n=void 0!==b.steps?b.steps:1,r=b.bendPath,m=b.extrudePath,o,p=!1,s=void 0!==b.useSpacedPoints?b.useSpacedPoints:!1,t=b.material,u=b.extrudeMaterial,v=this.shapebb;if(m)o=m.getPoints(l),n=o.length,p=!0,q=!1;q||(k=i=j=0);var w,z,x,A=this,F=this.vertices.length;r&&a.addWrapPath(r);l=s?a.extractAllSpacedPoints(l):a.extractAllPoints(l);r=l.shape;l=l.holes;if(m=!THREE.Shape.Utils.isClockWise(r)){r=r.reverse();for(z=
-0,x=l.length;z<x;z++)w=l[z],THREE.Shape.Utils.isClockWise(w)&&(l[z]=w.reverse());m=!1}m=THREE.Shape.Utils.triangulateShape(r,l);s=r;for(z=0,x=l.length;z<x;z++)w=l[z],r=r.concat(w);for(var E,J,G,B,H=r.length,D=m.length,I=[],y=0,K=s.length,C=K-1,L=y+1;y<K;y++,C++,L++)C===K&&(C=0),L===K&&(L=0),I[y]=d(s[y],s[C],s[L]);var N=[],M,S=I.concat();for(z=0,x=l.length;z<x;z++){w=l[z];M=[];for(y=0,K=w.length,C=K-1,L=y+1;y<K;y++,C++,L++)C===K&&(C=0),L===K&&(L=0),M[y]=d(w[y],w[C],w[L]);N.push(M);S=S.concat(M)}for(E=
-0;E<j;E++){J=E/j;G=i*(1-J);J=k*Math.sin(J*Math.PI/2);for(y=0,K=s.length;y<K;y++)B=c(s[y],I[y],J),g(B.x,B.y,-G);for(z=0,x=l.length;z<x;z++){w=l[z];M=N[z];for(y=0,K=w.length;y<K;y++)B=c(w[y],M[y],J),g(B.x,B.y,-G)}}J=k;for(y=0;y<H;y++)B=q?c(r[y],S[y],J):r[y],p?g(B.x,B.y+o[0].y,o[0].x):g(B.x,B.y,0);for(E=1;E<=n;E++)for(y=0;y<H;y++)B=q?c(r[y],S[y],J):r[y],p?g(B.x,B.y+o[E-1].y,o[E-1].x):g(B.x,B.y,h/n*E);for(E=j-1;0<=E;E--){J=E/j;G=i*(1-J);J=k*Math.sin(J*Math.PI/2);for(y=0,K=s.length;y<K;y++)B=c(s[y],I[y],
-J),g(B.x,B.y,h+G);for(z=0,x=l.length;z<x;z++){w=l[z];M=N[z];for(y=0,K=w.length;y<K;y++)B=c(w[y],M[y],J),p?g(B.x,B.y+o[n-1].y,o[n-1].x+G):g(B.x,B.y,h+G)}}if(q){q=0*H;for(y=0;y<D;y++)k=m[y],e(k[2]+q,k[1]+q,k[0]+q);q=H*(n+2*j);for(y=0;y<D;y++)k=m[y],e(k[0]+q,k[1]+q,k[2]+q)}else{for(y=0;y<D;y++)k=m[y],e(k[2],k[1],k[0]);for(y=0;y<D;y++)k=m[y],e(k[0]+H*n,k[1]+H*n,k[2]+H*n)}var O=0;f(s);O+=s.length;for(z=0,x=l.length;z<x;z++)w=l[z],f(w),O+=w.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;
+h.copy(b).addSelf(f);i.copy(c).addSelf(g);f=d.dot(g);g=i.subSelf(h).dot(g);0===f&&(console.log("Either infinite or no solutions!"),0===g?console.log("Its finite solutions."):console.log("Too bad, no solutions."));g/=f;return 0>g?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(g).addSelf(h).subSelf(a).clone()}function f(a){for(y=a.length;0<=--y;){D=y;L=y-1;0>L&&(L=a.length-1);for(var b=
+0,c=n+2*k,b=0;b<c;b++){var d=H*b,e=H*(b+1),f=O+D+d,g=O+D+e,l=f,d=O+L+d,e=O+L+e,j=g,l=l+F,d=d+F,e=e+F,j=j+F;A.faces.push(new THREE.Face4(l,d,e,j,null,null,u));void 0!==u&&(l=b/c,d=(b+1)/c,e=h+2*i,f=(A.vertices[f].position.z+i)/e,g=(A.vertices[g].position.z+i)/e,A.faceVertexUvs[0].push([new THREE.UV(f,l),new THREE.UV(g,l),new THREE.UV(g,d),new THREE.UV(f,d)]))}}}function g(a,b,c){A.vertices.push(new THREE.Vertex(new THREE.Vector3(a,b,c)))}function e(a,b,c){a+=F;b+=F;c+=F;A.faces.push(new THREE.Face3(a,
+b,c,null,null,t));if(void 0!==t){var d=v.minX,e=v.minY,f=v.maxY,g=v.maxX,h=A.vertices[b].position.x-d,b=A.vertices[b].position.y-e,i=A.vertices[c].position.x-d,c=A.vertices[c].position.y-e;A.faceVertexUvs[0].push([new THREE.UV((A.vertices[a].position.x-d)/g,(A.vertices[a].position.y-e)/f),new THREE.UV(h/g,b/f),new THREE.UV(i/g,c/f)])}}var h=void 0!==b.amount?b.amount:100,i=void 0!==b.bevelThickness?b.bevelThickness:6,j=void 0!==b.bevelSize?b.bevelSize:i-2,k=void 0!==b.bevelSegments?b.bevelSegments:
+3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,l=void 0!==b.curveSegments?b.curveSegments:12,n=void 0!==b.steps?b.steps:1,r=b.bendPath,m=b.extrudePath,p,o=!1,s=void 0!==b.useSpacedPoints?b.useSpacedPoints:!1,t=b.material,u=b.extrudeMaterial,v=this.shapebb;if(m)p=m.getPoints(l),n=p.length,o=!0,q=!1;q||(j=i=k=0);var w,z,x,A=this,F=this.vertices.length;r&&a.addWrapPath(r);l=s?a.extractAllSpacedPoints(l):a.extractAllPoints(l);r=l.shape;l=l.holes;if(m=!THREE.Shape.Utils.isClockWise(r)){r=r.reverse();for(z=
+0,x=l.length;z<x;z++)w=l[z],THREE.Shape.Utils.isClockWise(w)&&(l[z]=w.reverse());m=!1}m=THREE.Shape.Utils.triangulateShape(r,l);s=r;for(z=0,x=l.length;z<x;z++)w=l[z],r=r.concat(w);for(var E,J,G,B,H=r.length,C=m.length,I=[],y=0,K=s.length,D=K-1,L=y+1;y<K;y++,D++,L++)D===K&&(D=0),L===K&&(L=0),I[y]=d(s[y],s[D],s[L]);var N=[],M,S=I.concat();for(z=0,x=l.length;z<x;z++){w=l[z];M=[];for(y=0,K=w.length,D=K-1,L=y+1;y<K;y++,D++,L++)D===K&&(D=0),L===K&&(L=0),M[y]=d(w[y],w[D],w[L]);N.push(M);S=S.concat(M)}for(E=
+0;E<k;E++){J=E/k;G=i*(1-J);J=j*Math.sin(J*Math.PI/2);for(y=0,K=s.length;y<K;y++)B=c(s[y],I[y],J),g(B.x,B.y,-G);for(z=0,x=l.length;z<x;z++){w=l[z];M=N[z];for(y=0,K=w.length;y<K;y++)B=c(w[y],M[y],J),g(B.x,B.y,-G)}}J=j;for(y=0;y<H;y++)B=q?c(r[y],S[y],J):r[y],o?g(B.x,B.y+p[0].y,p[0].x):g(B.x,B.y,0);for(E=1;E<=n;E++)for(y=0;y<H;y++)B=q?c(r[y],S[y],J):r[y],o?g(B.x,B.y+p[E-1].y,p[E-1].x):g(B.x,B.y,h/n*E);for(E=k-1;0<=E;E--){J=E/k;G=i*(1-J);J=j*Math.sin(J*Math.PI/2);for(y=0,K=s.length;y<K;y++)B=c(s[y],I[y],
+J),g(B.x,B.y,h+G);for(z=0,x=l.length;z<x;z++){w=l[z];M=N[z];for(y=0,K=w.length;y<K;y++)B=c(w[y],M[y],J),o?g(B.x,B.y+p[n-1].y,p[n-1].x+G):g(B.x,B.y,h+G)}}if(q){q=0*H;for(y=0;y<C;y++)j=m[y],e(j[2]+q,j[1]+q,j[0]+q);q=H*(n+2*k);for(y=0;y<C;y++)j=m[y],e(j[0]+q,j[1]+q,j[2]+q)}else{for(y=0;y<C;y++)j=m[y],e(j[2],j[1],j[0]);for(y=0;y<C;y++)j=m[y],e(j[0]+H*n,j[1]+H*n,j[2]+H*n)}var O=0;f(s);O+=s.length;for(z=0,x=l.length;z<x;z++)w=l[z],f(w),O+=w.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
-THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],f=[],g=[],e=(new THREE.Matrix4).setRotationZ(b),h=0;h<a.length;h++)this.vertices.push(new THREE.Vertex(a[h])),c[h]=a[h].clone(),d[h]=this.vertices.length-1;for(var i=0;i<=this.angle+0.0010;i+=b){for(h=0;h<c.length;h++)i<this.angle?(c[h]=e.multiplyVector3(c[h].clone()),this.vertices.push(new THREE.Vertex(c[h])),f[h]=this.vertices.length-1):f=g;0==i&&(g=d);
+THREE.LatheGeometry=function(a,b,c){THREE.Geometry.call(this);this.steps=b||12;this.angle=c||2*Math.PI;for(var b=this.angle/this.steps,c=[],d=[],f=[],g=[],e=(new THREE.Matrix4).setRotationZ(b),h=0;h<a.length;h++)this.vertices.push(new THREE.Vertex(a[h])),c[h]=a[h].clone(),d[h]=this.vertices.length-1;for(var i=0;i<=this.angle+0.001;i+=b){for(h=0;h<c.length;h++)i<this.angle?(c[h]=e.multiplyVector3(c[h].clone()),this.vertices.push(new THREE.Vertex(c[h])),f[h]=this.vertices.length-1):f=g;0==i&&(g=d);
 for(h=0;h<d.length-1;h++)this.faces.push(new THREE.Face4(f[h],f[h+1],d[h+1],d[h])),this.faceVertexUvs[0].push([new THREE.UV(1-i/this.angle,h/a.length),new THREE.UV(1-i/this.angle,(h+1)/a.length),new THREE.UV(1-(i-b)/this.angle,(h+1)/a.length),new THREE.UV(1-(i-b)/this.angle,h/a.length)]);d=f;f=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
 for(h=0;h<d.length-1;h++)this.faces.push(new THREE.Face4(f[h],f[h+1],d[h+1],d[h])),this.faceVertexUvs[0].push([new THREE.UV(1-i/this.angle,h/a.length),new THREE.UV(1-i/this.angle,(h+1)/a.length),new THREE.UV(1-(i-b)/this.angle,(h+1)/a.length),new THREE.UV(1-(i-b)/this.angle,h/a.length)]);d=f;f=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
-THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var f=a/2,g=b/2,c=c||1,d=d||1,e=c+1,h=d+1,i=a/c,k=b/d,j=new THREE.Vector3(0,0,1),a=0;a<h;a++)for(b=0;b<e;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*i-f,-(a*k-g),0)));for(a=0;a<d;a++)for(b=0;b<c;b++)f=new THREE.Face4(b+e*a,b+e*(a+1),b+1+e*(a+1),b+1+e*a),f.normal.copy(j),f.vertexNormals.push(j.clone(),j.clone(),j.clone(),j.clone()),this.faces.push(f),this.faceVertexUvs[0].push([new THREE.UV(b/c,a/d),new THREE.UV(b/
+THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var f=a/2,g=b/2,c=c||1,d=d||1,e=c+1,h=d+1,i=a/c,j=b/d,k=new THREE.Vector3(0,0,1),a=0;a<h;a++)for(b=0;b<e;b++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(b*i-f,-(a*j-g),0)));for(a=0;a<d;a++)for(b=0;b<c;b++)f=new THREE.Face4(b+e*a,b+e*(a+1),b+1+e*(a+1),b+1+e*a),f.normal.copy(k),f.vertexNormals.push(k.clone(),k.clone(),k.clone(),k.clone()),this.faces.push(f),this.faceVertexUvs[0].push([new THREE.UV(b/c,a/d),new THREE.UV(b/
 c,(a+1)/d),new THREE.UV((b+1)/c,(a+1)/d),new THREE.UV((b+1)/c,a/d)]);this.computeCentroids()};THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
 c,(a+1)/d),new THREE.UV((b+1)/c,(a+1)/d),new THREE.UV((b+1)/c,a/d)]);this.computeCentroids()};THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.SphereGeometry=function(a,b,c,d,f,g,e){THREE.Geometry.call(this);var a=a||50,d=void 0!==d?d:0,f=void 0!==f?f:2*Math.PI,g=void 0!==g?g:0,e=void 0!==e?e:Math.PI,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),h,i,k=[],j=[];for(i=0;i<=c;i++){var q=[],l=[];for(h=0;h<=b;h++){var n=h/b,r=i/c,m=-a*Math.cos(d+n*f)*Math.sin(g+r*e),o=a*Math.cos(g+r*e),p=a*Math.sin(d+n*f)*Math.sin(g+r*e);this.vertices.push(new THREE.Vertex(new THREE.Vector3(m,o,p)));q.push(this.vertices.length-1);l.push(new THREE.UV(n,
-r))}k.push(q);j.push(l)}for(i=0;i<c;i++)for(h=0;h<b;h++){var d=k[i][h+1],f=k[i][h],g=k[i+1][h],e=k[i+1][h+1],q=this.vertices[d].position.clone().normalize(),l=this.vertices[f].position.clone().normalize(),n=this.vertices[g].position.clone().normalize(),r=this.vertices[e].position.clone().normalize(),m=j[i][h+1].clone(),o=j[i][h].clone(),p=j[i+1][h].clone(),s=j[i+1][h+1].clone();Math.abs(this.vertices[d].position.y)==a?(this.faces.push(new THREE.Face3(d,g,e,[q,n,r])),this.faceVertexUvs[0].push([m,
-p,s])):Math.abs(this.vertices[g].position.y)==a?(this.faces.push(new THREE.Face3(d,f,g,[q,l,n])),this.faceVertexUvs[0].push([m,o,p])):(this.faces.push(new THREE.Face4(d,f,g,e,[q,l,n,r])),this.faceVertexUvs[0].push([m,o,p,s]))}this.computeCentroids();this.computeFaceNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
+THREE.SphereGeometry=function(a,b,c,d,f,g,e){THREE.Geometry.call(this);var a=a||50,d=void 0!==d?d:0,f=void 0!==f?f:2*Math.PI,g=void 0!==g?g:0,e=void 0!==e?e:Math.PI,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),h,i,j=[],k=[];for(i=0;i<=c;i++){var q=[],l=[];for(h=0;h<=b;h++){var n=h/b,r=i/c,m=-a*Math.cos(d+n*f)*Math.sin(g+r*e),p=a*Math.cos(g+r*e),o=a*Math.sin(d+n*f)*Math.sin(g+r*e);this.vertices.push(new THREE.Vertex(new THREE.Vector3(m,p,o)));q.push(this.vertices.length-1);l.push(new THREE.UV(n,
+r))}j.push(q);k.push(l)}for(i=0;i<c;i++)for(h=0;h<b;h++){var d=j[i][h+1],f=j[i][h],g=j[i+1][h],e=j[i+1][h+1],q=this.vertices[d].position.clone().normalize(),l=this.vertices[f].position.clone().normalize(),n=this.vertices[g].position.clone().normalize(),r=this.vertices[e].position.clone().normalize(),m=k[i][h+1].clone(),p=k[i][h].clone(),o=k[i+1][h].clone(),s=k[i+1][h+1].clone();Math.abs(this.vertices[d].position.y)==a?(this.faces.push(new THREE.Face3(d,g,e,[q,n,r])),this.faceVertexUvs[0].push([m,
+o,s])):Math.abs(this.vertices[g].position.y)==a?(this.faces.push(new THREE.Face3(d,f,g,[q,l,n])),this.faceVertexUvs[0].push([m,p,o])):(this.faces.push(new THREE.Face4(d,f,g,e,[q,l,n,r])),this.faceVertexUvs[0].push([m,p,o,s]))}this.computeCentroids();this.computeFaceNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry;THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 THREE.TextGeometry=function(a,b){var c=(new THREE.TextPath(a,b)).toShapes();b.amount=void 0!==b.height?b.height:50;if(void 0===b.bevelThickness)b.bevelThickness=10;if(void 0===b.bevelSize)b.bevelSize=8;if(void 0===b.bevelEnabled)b.bevelEnabled=!1;if(b.bend){var d=c[c.length-1].getBoundingBox().maxX;b.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(d/2,120),new THREE.Vector2(d,0))}THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
 THREE.TextGeometry=function(a,b){var c=(new THREE.TextPath(a,b)).toShapes();b.amount=void 0!==b.height?b.height:50;if(void 0===b.bevelThickness)b.bevelThickness=10;if(void 0===b.bevelSize)b.bevelSize=8;if(void 0===b.bevelEnabled)b.bevelEnabled=!1;if(b.bend){var d=c[c.length-1].getBoundingBox().maxX;b.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(d/2,120),new THREE.Vector2(d,0))}THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){for(var b=this.getFace(),c=this.size/b.resolution,d=
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){for(var b=this.getFace(),c=this.size/b.resolution,d=
-0,f=(""+a).split(""),g=f.length,e=[],a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(f[a],b,c,d,h),d=d+h.offset;e.push(h.path)}return{paths:e,offset:d/2}},extractGlyphPoints:function(a,b,c,d,f){var g=[],e,h,i,k,j,q,l,n,r,m,o,p=b.glyphs[a]||b.glyphs["?"];if(p){if(p.o){b=p._cachedOutline||(p._cachedOutline=p.o.split(" "));k=b.length;for(a=0;a<k;)switch(i=b[a++],i){case "m":i=b[a++]*c+d;j=b[a++]*c;g.push(new THREE.Vector2(i,j));f.moveTo(i,j);break;case "l":i=b[a++]*c+d;j=b[a++]*c;g.push(new THREE.Vector2(i,
-j));f.lineTo(i,j);break;case "q":i=b[a++]*c+d;j=b[a++]*c;n=b[a++]*c+d;r=b[a++]*c;f.quadraticCurveTo(n,r,i,j);if(e=g[g.length-1]){q=e.x;l=e.y;for(e=1,h=this.divisions;e<=h;e++){var s=e/h,t=THREE.Shape.Utils.b2(s,q,n,i),s=THREE.Shape.Utils.b2(s,l,r,j);g.push(new THREE.Vector2(t,s))}}break;case "b":if(i=b[a++]*c+d,j=b[a++]*c,n=b[a++]*c+d,r=b[a++]*-c,m=b[a++]*c+d,o=b[a++]*-c,f.bezierCurveTo(i,j,n,r,m,o),e=g[g.length-1]){q=e.x;l=e.y;for(e=1,h=this.divisions;e<=h;e++)s=e/h,t=THREE.Shape.Utils.b3(s,q,n,
-m,i),s=THREE.Shape.Utils.b3(s,l,r,o,j),g.push(new THREE.Vector2(t,s))}}}return{offset:p.ha*c,points:g,path:f}}}};
-(function(a){var b=function(a){for(var b=a.length,f=0,g=b-1,e=0;e<b;g=e++)f+=a[g].x*a[e].y-a[e].x*a[g].y;return 0.5*f};a.Triangulate=function(a,d){var f=a.length;if(3>f)return null;var g=[],e=[],h=[],i,k,j;if(0<b(a))for(k=0;k<f;k++)e[k]=k;else for(k=0;k<f;k++)e[k]=f-1-k;var q=2*f;for(k=f-1;2<f;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}i=k;f<=i&&(i=0);k=i+1;f<=k&&(k=0);j=k+1;f<=j&&(j=0);var l;a:{l=a;var n=i,r=k,m=j,o=f,p=e,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0,
-z=void 0,x=void 0,A=void 0,F=void 0,t=l[p[n]].x,u=l[p[n]].y,v=l[p[r]].x,w=l[p[r]].y,z=l[p[m]].x,x=l[p[m]].y;if(1.0E-10>(v-t)*(x-u)-(w-u)*(z-t))l=!1;else{for(s=0;s<o;s++)if(!(s==n||s==r||s==m)){var A=l[p[s]].x,F=l[p[s]].y,E=void 0,J=void 0,G=void 0,B=void 0,H=void 0,D=void 0,I=void 0,y=void 0,K=void 0,C=void 0,L=void 0,N=void 0,E=G=H=void 0,E=z-v,J=x-w,G=t-z,B=u-x,H=v-t,D=w-u,I=A-t,y=F-u,K=A-v,C=F-w,L=A-z,N=F-x,E=E*C-J*K,H=H*y-D*I,G=G*N-B*L;if(0<=E&&0<=G&&0<=H){l=!1;break a}}l=!0}}if(l){g.push([a[e[i]],
-a[e[k]],a[e[j]]]);h.push([e[i],e[k],e[j]]);for(i=k,j=k+1;j<f;i++,j++)e[i]=e[j];f--;q=2*f}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
+0,f=(""+a).split(""),g=f.length,e=[],a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(f[a],b,c,d,h),d=d+h.offset;e.push(h.path)}return{paths:e,offset:d/2}},extractGlyphPoints:function(a,b,c,d,f){var g=[],e,h,i,j,k,q,l,n,r,m,p,o=b.glyphs[a]||b.glyphs["?"];if(o){if(o.o){b=o._cachedOutline||(o._cachedOutline=o.o.split(" "));j=b.length;for(a=0;a<j;)switch(i=b[a++],i){case "m":i=b[a++]*c+d;k=b[a++]*c;g.push(new THREE.Vector2(i,k));f.moveTo(i,k);break;case "l":i=b[a++]*c+d;k=b[a++]*c;g.push(new THREE.Vector2(i,
+k));f.lineTo(i,k);break;case "q":i=b[a++]*c+d;k=b[a++]*c;n=b[a++]*c+d;r=b[a++]*c;f.quadraticCurveTo(n,r,i,k);if(e=g[g.length-1]){q=e.x;l=e.y;for(e=1,h=this.divisions;e<=h;e++){var s=e/h,t=THREE.Shape.Utils.b2(s,q,n,i),s=THREE.Shape.Utils.b2(s,l,r,k);g.push(new THREE.Vector2(t,s))}}break;case "b":if(i=b[a++]*c+d,k=b[a++]*c,n=b[a++]*c+d,r=b[a++]*-c,m=b[a++]*c+d,p=b[a++]*-c,f.bezierCurveTo(i,k,n,r,m,p),e=g[g.length-1]){q=e.x;l=e.y;for(e=1,h=this.divisions;e<=h;e++)s=e/h,t=THREE.Shape.Utils.b3(s,q,n,
+m,i),s=THREE.Shape.Utils.b3(s,l,r,p,k),g.push(new THREE.Vector2(t,s))}}}return{offset:o.ha*c,points:g,path:f}}}};
+(function(a){var b=function(a){for(var b=a.length,f=0,g=b-1,e=0;e<b;g=e++)f+=a[g].x*a[e].y-a[e].x*a[g].y;return 0.5*f};a.Triangulate=function(a,d){var f=a.length;if(3>f)return null;var g=[],e=[],h=[],i,j,k;if(0<b(a))for(j=0;j<f;j++)e[j]=j;else for(j=0;j<f;j++)e[j]=f-1-j;var q=2*f;for(j=f-1;2<f;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}i=j;f<=i&&(i=0);j=i+1;f<=j&&(j=0);k=j+1;f<=k&&(k=0);var l;a:{l=a;var n=i,r=j,m=k,p=f,o=e,s=void 0,t=void 0,u=void 0,v=void 0,w=void 0,
+z=void 0,x=void 0,A=void 0,F=void 0,t=l[o[n]].x,u=l[o[n]].y,v=l[o[r]].x,w=l[o[r]].y,z=l[o[m]].x,x=l[o[m]].y;if(1.0E-10>(v-t)*(x-u)-(w-u)*(z-t))l=!1;else{for(s=0;s<p;s++)if(!(s==n||s==r||s==m)){var A=l[o[s]].x,F=l[o[s]].y,E=void 0,J=void 0,G=void 0,B=void 0,H=void 0,C=void 0,I=void 0,y=void 0,K=void 0,D=void 0,L=void 0,N=void 0,E=G=H=void 0,E=z-v,J=x-w,G=t-z,B=u-x,H=v-t,C=w-u,I=A-t,y=F-u,K=A-v,D=F-w,L=A-z,N=F-x,E=E*D-J*K,H=H*y-C*I,G=G*N-B*L;if(0<=E&&0<=G&&0<=H){l=!1;break a}}l=!0}}if(l){g.push([a[e[i]],
+a[e[j]],a[e[k]]]);h.push([e[i],e[j],e[k]]);for(i=j,k=j+1;k<f;i++,k++)e[i]=e[k];f--;q=2*f}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
 THREE.TorusGeometry=function(a,b,c,d,f){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=d||6;this.arc=f||2*Math.PI;f=new THREE.Vector3;a=[];b=[];for(c=0;c<=this.segmentsR;c++)for(d=0;d<=this.segmentsT;d++){var g=d/this.segmentsT*this.arc,e=2*c/this.segmentsR*Math.PI;f.x=this.radius*Math.cos(g);f.y=this.radius*Math.sin(g);var h=new THREE.Vector3;h.x=(this.radius+this.tube*Math.cos(e))*Math.cos(g);h.y=(this.radius+this.tube*Math.cos(e))*Math.sin(g);h.z=
 THREE.TorusGeometry=function(a,b,c,d,f){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.segmentsR=c||8;this.segmentsT=d||6;this.arc=f||2*Math.PI;f=new THREE.Vector3;a=[];b=[];for(c=0;c<=this.segmentsR;c++)for(d=0;d<=this.segmentsT;d++){var g=d/this.segmentsT*this.arc,e=2*c/this.segmentsR*Math.PI;f.x=this.radius*Math.cos(g);f.y=this.radius*Math.sin(g);var h=new THREE.Vector3;h.x=(this.radius+this.tube*Math.cos(e))*Math.cos(g);h.y=(this.radius+this.tube*Math.cos(e))*Math.sin(g);h.z=
 this.tube*Math.sin(e);this.vertices.push(new THREE.Vertex(h));a.push(new THREE.UV(d/this.segmentsT,1-c/this.segmentsR));b.push(h.clone().subSelf(f).normalize())}for(c=1;c<=this.segmentsR;c++)for(d=1;d<=this.segmentsT;d++){var f=(this.segmentsT+1)*c+d-1,g=(this.segmentsT+1)*(c-1)+d-1,e=(this.segmentsT+1)*(c-1)+d,h=(this.segmentsT+1)*c+d,i=new THREE.Face4(f,g,e,h,[b[f],b[g],b[e],b[h]]);i.normal.addSelf(b[f]);i.normal.addSelf(b[g]);i.normal.addSelf(b[e]);i.normal.addSelf(b[h]);i.normal.normalize();this.faces.push(i);
 this.tube*Math.sin(e);this.vertices.push(new THREE.Vertex(h));a.push(new THREE.UV(d/this.segmentsT,1-c/this.segmentsR));b.push(h.clone().subSelf(f).normalize())}for(c=1;c<=this.segmentsR;c++)for(d=1;d<=this.segmentsT;d++){var f=(this.segmentsT+1)*c+d-1,g=(this.segmentsT+1)*(c-1)+d-1,e=(this.segmentsT+1)*(c-1)+d,h=(this.segmentsT+1)*c+d,i=new THREE.Face4(f,g,e,h,[b[f],b[g],b[e],b[h]]);i.normal.addSelf(b[f]);i.normal.addSelf(b[g]);i.normal.addSelf(b[e]);i.normal.addSelf(b[h]);i.normal.normalize();this.faces.push(i);
 this.faceVertexUvs[0].push([a[f].clone(),a[g].clone(),a[e].clone(),a[h].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
 this.faceVertexUvs[0].push([a[f].clone(),a[g].clone(),a[e].clone(),a[h].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
 THREE.TorusKnotGeometry=function(a,b,c,d,f,g,e){function h(a,b,c,d,e,f){var g=Math.cos(a);Math.cos(b);b=Math.sin(a);a*=c/d;c=Math.cos(a);g*=0.5*e*(2+c);b=0.5*e*(2+c)*b;e=0.5*f*e*Math.sin(a);return new THREE.Vector3(g,b,e)}THREE.Geometry.call(this);this.radius=a||200;this.tube=b||40;this.segmentsR=c||64;this.segmentsT=d||8;this.p=f||2;this.q=g||3;this.heightScale=e||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]=
 THREE.TorusKnotGeometry=function(a,b,c,d,f,g,e){function h(a,b,c,d,e,f){var g=Math.cos(a);Math.cos(b);b=Math.sin(a);a*=c/d;c=Math.cos(a);g*=0.5*e*(2+c);b=0.5*e*(2+c)*b;e=0.5*f*e*Math.sin(a);return new THREE.Vector3(g,b,e)}THREE.Geometry.call(this);this.radius=a||200;this.tube=b||40;this.segmentsR=c||64;this.segmentsT=d||8;this.p=f||2;this.q=g||3;this.heightScale=e||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 i=2*(a/this.segmentsR)*this.p*Math.PI,e=2*(b/this.segmentsT)*Math.PI,g=h(i,e,this.q,this.p,this.radius,this.heightScale),i=h(i+0.01,e,this.q,this.p,this.radius,this.heightScale);c.sub(i,g);d.add(i,g);f.cross(c,d);d.cross(f,c);f.normalize();d.normalize();i=-this.tube*Math.cos(e);e=this.tube*Math.sin(e);g.x+=i*d.x+e*f.x;g.y+=i*d.y+e*f.y;g.z+=i*d.z+e*f.z;this.grid[a][b]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(g.x,g.y,g.z)))-1}}for(a=
 Array(this.segmentsT);for(b=0;b<this.segmentsT;++b){var i=2*(a/this.segmentsR)*this.p*Math.PI,e=2*(b/this.segmentsT)*Math.PI,g=h(i,e,this.q,this.p,this.radius,this.heightScale),i=h(i+0.01,e,this.q,this.p,this.radius,this.heightScale);c.sub(i,g);d.add(i,g);f.cross(c,d);d.cross(f,c);f.normalize();d.normalize();i=-this.tube*Math.cos(e);e=this.tube*Math.sin(e);g.x+=i*d.x+e*f.x;g.y+=i*d.y+e*f.y;g.z+=i*d.z+e*f.z;this.grid[a][b]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(g.x,g.y,g.z)))-1}}for(a=
-0;a<this.segmentsR;++a)for(b=0;b<this.segmentsT;++b){var f=(a+1)%this.segmentsR,g=(b+1)%this.segmentsT,c=this.grid[a][b],d=this.grid[f][b],f=this.grid[f][g],g=this.grid[a][g],e=new THREE.UV(a/this.segmentsR,b/this.segmentsT),i=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT),k=new THREE.UV((a+1)/this.segmentsR,(b+1)/this.segmentsT),j=new THREE.UV(a/this.segmentsR,(b+1)/this.segmentsT);this.faces.push(new THREE.Face4(c,d,f,g));this.faceVertexUvs[0].push([e,i,k,j])}this.computeCentroids();this.computeFaceNormals();
+0;a<this.segmentsR;++a)for(b=0;b<this.segmentsT;++b){var f=(a+1)%this.segmentsR,g=(b+1)%this.segmentsT,c=this.grid[a][b],d=this.grid[f][b],f=this.grid[f][g],g=this.grid[a][g],e=new THREE.UV(a/this.segmentsR,b/this.segmentsT),i=new THREE.UV((a+1)/this.segmentsR,b/this.segmentsT),j=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(c,d,f,g));this.faceVertexUvs[0].push([e,i,j,k])}this.computeCentroids();this.computeFaceNormals();
 this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
 this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
 THREE.PolyhedronGeometry=function(a,b,c,d){function f(a){var b=new THREE.Vertex(a.normalize());b.index=i.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+0.5,a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+0.5;b.uv=new THREE.UV(c,a);return b}function g(a,b,c,d){1>d?(d=new THREE.Face3(a.index,b.index,c.index,[a.position.clone(),b.position.clone(),c.position.clone()]),d.centroid.addSelf(a.position).addSelf(b.position).addSelf(c.position).divideScalar(3),d.normal=d.centroid.clone().normalize(),
 THREE.PolyhedronGeometry=function(a,b,c,d){function f(a){var b=new THREE.Vertex(a.normalize());b.index=i.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+0.5,a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+0.5;b.uv=new THREE.UV(c,a);return b}function g(a,b,c,d){1>d?(d=new THREE.Face3(a.index,b.index,c.index,[a.position.clone(),b.position.clone(),c.position.clone()]),d.centroid.addSelf(a.position).addSelf(b.position).addSelf(c.position).divideScalar(3),d.normal=d.centroid.clone().normalize(),
 i.faces.push(d),d=Math.atan2(d.centroid.z,-d.centroid.x),i.faceVertexUvs[0].push([h(a.uv,a.position,d),h(b.uv,b.position,d),h(c.uv,c.position,d)])):(d-=1,g(a,e(a,b),e(a,c),d),g(e(a,b),b,e(b,c),d),g(e(a,c),e(b,c),c,d),g(e(a,b),e(b,c),e(a,c),d))}function e(a,b){q[a.index]||(q[a.index]=[]);q[b.index]||(q[b.index]=[]);var c=q[a.index][b.index];void 0===c&&(q[a.index][b.index]=q[b.index][a.index]=c=f((new THREE.Vector3).add(a.position,b.position).divideScalar(2)));return c}function h(a,b,c){0>c&&1===a.u&&
 i.faces.push(d),d=Math.atan2(d.centroid.z,-d.centroid.x),i.faceVertexUvs[0].push([h(a.uv,a.position,d),h(b.uv,b.position,d),h(c.uv,c.position,d)])):(d-=1,g(a,e(a,b),e(a,c),d),g(e(a,b),b,e(b,c),d),g(e(a,c),e(b,c),c,d),g(e(a,b),e(b,c),e(a,c),d))}function e(a,b){q[a.index]||(q[a.index]=[]);q[b.index]||(q[b.index]=[]);var c=q[a.index][b.index];void 0===c&&(q[a.index][b.index]=q[b.index][a.index]=c=f((new THREE.Vector3).add(a.position,b.position).divideScalar(2)));return c}function h(a,b,c){0>c&&1===a.u&&
-(a=new THREE.UV(a.u-1,a.v));0===b.x&&0===b.z&&(a=new THREE.UV(c/2/Math.PI+0.5,a.v));return a}THREE.Geometry.call(this);for(var c=c||1,d=d||0,i=this,k=0,j=a.length;k<j;k++)f(new THREE.Vector3(a[k][0],a[k][1],a[k][2]));for(var q=[],a=this.vertices,k=0,j=b.length;k<j;k++)g(a[b[k][0]],a[b[k][1]],a[b[k][2]],d);this.mergeVertices();k=0;for(j=this.vertices.length;k<j;k++)this.vertices[k].position.multiplyScalar(c);this.boundingSphere={radius:c}};THREE.PolyhedronGeometry.prototype=new THREE.Geometry;
+(a=new THREE.UV(a.u-1,a.v));0===b.x&&0===b.z&&(a=new THREE.UV(c/2/Math.PI+0.5,a.v));return a}THREE.Geometry.call(this);for(var c=c||1,d=d||0,i=this,j=0,k=a.length;j<k;j++)f(new THREE.Vector3(a[j][0],a[j][1],a[j][2]));for(var q=[],a=this.vertices,j=0,k=b.length;j<k;j++)g(a[b[j][0]],a[b[j][1]],a[b[j][2]],d);this.mergeVertices();j=0;for(k=this.vertices.length;j<k;j++)this.vertices[j].position.multiplyScalar(c);this.boundingSphere={radius:c}};THREE.PolyhedronGeometry.prototype=new THREE.Geometry;
 THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[[-1,c,0],[1,c,0],[-1,-c,0],[1,-c,0],[0,-1,c],[0,1,c],[0,-1,-c],[0,1,-c],[c,0,-1],[c,0,1],[-c,0,-1],[-c,0,1]],[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]],a,b)};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;
 THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[[-1,c,0],[1,c,0],[-1,-c,0],[1,-c,0],[0,-1,c],[0,1,c],[0,-1,-c],[0,1,-c],[c,0,-1],[c,0,1],[-c,0,-1],[-c,0,1]],[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]],a,b)};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;
 THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;THREE.OctahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],[[0,2,4],[0,4,3],[0,3,5],[0,5,2],[1,2,5],[1,5,3],[1,3,4],[1,4,2]],a,b)};THREE.OctahedronGeometry.prototype=new THREE.Geometry;THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
 THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;THREE.OctahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],[[0,2,4],[0,4,3],[0,3,5],[0,5,2],[1,2,5],[1,5,3],[1,3,4],[1,4,2]],a,b)};THREE.OctahedronGeometry.prototype=new THREE.Geometry;THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
 THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,1,1],[-1,-1,1],[-1,1,-1],[1,-1,-1]],[[2,1,0],[0,3,2],[1,3,0],[2,3,1]],a,b)};THREE.TetrahedronGeometry.prototype=new THREE.Geometry;THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;
 THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[[1,1,1],[-1,-1,1],[-1,1,-1],[1,-1,-1]],[[2,1,0],[0,3,2],[1,3,0],[2,3,1]],a,b)};THREE.TetrahedronGeometry.prototype=new THREE.Geometry;THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;
@@ -214,66 +214,66 @@ THREE.CameraHelper.prototype.update=function(a){function b(a,b,g,e){THREE.Camera
 1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,-1);b("u2",-0.7,1.1,-1);b("u3",0,2,-1);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,-1);b("cn2",1,0,-1);b("cn3",0,-1,-1);b("cn4",0,1,-1);this.lineGeometry.__dirtyVertices=!0};THREE.CameraHelper.__projector=new THREE.Projector;THREE.CameraHelper.__v=new THREE.Vector3;THREE.CameraHelper.__c=new THREE.Camera;
 1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,-1);b("u2",-0.7,1.1,-1);b("u3",0,2,-1);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,-1);b("cn2",1,0,-1);b("cn3",0,-1,-1);b("cn4",0,1,-1);this.lineGeometry.__dirtyVertices=!0};THREE.CameraHelper.__projector=new THREE.Projector;THREE.CameraHelper.__v=new THREE.Vector3;THREE.CameraHelper.__c=new THREE.Camera;
 THREE.SubdivisionModifier=function(a){this.subdivisions=void 0===a?1:a;this.useOldVertexColors=!1;this.supportUVs=!0};THREE.SubdivisionModifier.prototype.constructor=THREE.SubdivisionModifier;THREE.SubdivisionModifier.prototype.modify=function(a){for(var b=this.subdivisions;0<b--;)this.smooth(a)};
 THREE.SubdivisionModifier=function(a){this.subdivisions=void 0===a?1:a;this.useOldVertexColors=!1;this.supportUVs=!0};THREE.SubdivisionModifier.prototype.constructor=THREE.SubdivisionModifier;THREE.SubdivisionModifier.prototype.modify=function(a){for(var b=this.subdivisions;0<b--;)this.smooth(a)};
 THREE.SubdivisionModifier.prototype.smooth=function(a){function b(a,b,c,d,h,i){var k=new THREE.Face4(a,b,c,d,null,h.color,h.material);if(e.useOldVertexColors){k.vertexColors=[];for(var j,m,q,n=0;4>n;n++){q=i[n];j=new THREE.Color;j.setRGB(0,0,0);for(var p=0;p<q.length;p++)m=h.vertexColors[q[p]-1],j.r+=m.r,j.g+=m.g,j.b+=m.b;j.r/=q.length;j.g/=q.length;j.b/=q.length;k.vertexColors[n]=j}}f.push(k);(!e.supportUVs||0!=l.length)&&g.push([l[a],l[b],l[c],l[d]])}function c(a,b){return Math.min(a,b)+"_"+Math.max(a,
 THREE.SubdivisionModifier.prototype.smooth=function(a){function b(a,b,c,d,h,i){var k=new THREE.Face4(a,b,c,d,null,h.color,h.material);if(e.useOldVertexColors){k.vertexColors=[];for(var j,m,q,n=0;4>n;n++){q=i[n];j=new THREE.Color;j.setRGB(0,0,0);for(var p=0;p<q.length;p++)m=h.vertexColors[q[p]-1],j.r+=m.r,j.g+=m.g,j.b+=m.b;j.r/=q.length;j.g/=q.length;j.b/=q.length;k.vertexColors[n]=j}}f.push(k);(!e.supportUVs||0!=l.length)&&g.push([l[a],l[b],l[c],l[d]])}function c(a,b){return Math.min(a,b)+"_"+Math.max(a,
-b)}var d=[],f=[],g=[],e=this,h=a.vertices,d=a.faces,i=h.concat(),k=[],j={},q={},l=[],n,r,m,o,p,s=a.faceVertexUvs[0];for(n=0,r=s.length;n<r;n++)for(m=0,o=s[n].length;m<o;m++)p=d[n]["abcd".charAt(m)],l[p]||(l[p]=s[n][m]);var t;for(n=0,r=d.length;n<r;n++)if(p=d[n],k.push(p.centroid),i.push(new THREE.Vertex(p.centroid)),e.supportUVs&&0!=l.length){t=new THREE.UV;if(p instanceof THREE.Face3)t.u=l[p.a].u+l[p.b].u+l[p.c].u,t.v=l[p.a].v+l[p.b].v+l[p.c].v,t.u/=3,t.v/=3;else if(p instanceof THREE.Face4)t.u=
-l[p.a].u+l[p.b].u+l[p.c].u+l[p.d].u,t.v=l[p.a].v+l[p.b].v+l[p.c].v+l[p.d].v,t.u/=4,t.v/=4;l.push(t)}r=function(a){function b(a,c,d){void 0===a[c]&&(a[c]=[]);a[c].push(d)}var d,e,f,g,h={};for(d=0,e=a.faces.length;d<e;d++)f=a.faces[d],f instanceof THREE.Face3?(g=c(f.a,f.b),b(h,g,d),g=c(f.b,f.c),b(h,g,d),g=c(f.c,f.a),b(h,g,d)):f instanceof THREE.Face4&&(g=c(f.a,f.b),b(h,g,d),g=c(f.b,f.c),b(h,g,d),g=c(f.c,f.d),b(h,g,d),g=c(f.d,f.a),b(h,g,d));return h}(a);var u=0,s=h.length,v,w,z={},x={},A=function(a,
-b){void 0===z[a]&&(z[a]=[]);z[a].push(b)},F=function(a,b){void 0===x[a]&&(x[a]={});x[a][b]=null};for(n in r){t=r[n];v=n.split("_");w=v[0];v=v[1];A(w,[w,v]);A(v,[w,v]);for(m=0,o=t.length;m<o;m++)p=t[m],F(w,p,n),F(v,p,n);2>t.length&&(q[n]=!0)}for(n in r)if(t=r[n],p=t[0],t=t[1],v=n.split("_"),w=v[0],v=v[1],o=new THREE.Vector3,q[n]?(o.addSelf(h[w].position),o.addSelf(h[v].position),o.multiplyScalar(0.5)):(o.addSelf(k[p]),o.addSelf(k[t]),o.addSelf(h[w].position),o.addSelf(h[v].position),o.multiplyScalar(0.25)),
-j[n]=s+d.length+u,i.push(new THREE.Vertex(o)),u++,e.supportUVs&&0!=l.length)t=new THREE.UV,t.u=l[w].u+l[v].u,t.v=l[w].v+l[v].v,t.u/=2,t.v/=2,l.push(t);var E,J;v=["123","12","2","23"];o=["123","23","3","31"];var A=["123","31","1","12"],F=["1234","12","2","23"],G=["1234","23","3","34"],B=["1234","34","4","41"],H=["1234","41","1","12"];for(n=0,r=k.length;n<r;n++)p=d[n],t=s+n,p instanceof THREE.Face3?(u=c(p.a,p.b),w=c(p.b,p.c),E=c(p.c,p.a),b(t,j[u],p.b,j[w],p,v),b(t,j[w],p.c,j[E],p,o),b(t,j[E],p.a,j[u],
-p,A)):p instanceof THREE.Face4?(u=c(p.a,p.b),w=c(p.b,p.c),E=c(p.c,p.d),J=c(p.d,p.a),b(t,j[u],p.b,j[w],p,F),b(t,j[w],p.c,j[E],p,G),b(t,j[E],p.d,j[J],p,B),b(t,j[J],p.a,j[u],p,H)):console.log("face should be a face!",p);d=i;i=new THREE.Vector3;j=new THREE.Vector3;for(n=0,r=h.length;n<r;n++)if(void 0!==z[n]){i.set(0,0,0);j.set(0,0,0);p=new THREE.Vector3(0,0,0);t=0;for(m in x[n])i.addSelf(k[m]),t++;u=0;s=z[n].length;for(m=0;m<s;m++)q[c(z[n][m][0],z[n][m][1])]&&u++;if(2!=u){i.divideScalar(t);for(m=0;m<
-s;m++)t=z[n][m],t=h[t[0]].position.clone().addSelf(h[t[1]].position).divideScalar(2),j.addSelf(t);j.divideScalar(s);p.addSelf(h[n].position);p.multiplyScalar(s-3);p.addSelf(i);p.addSelf(j.multiplyScalar(2));p.divideScalar(s);d[n].position=p}}a.vertices=d;a.faces=f;a.faceVertexUvs[0]=g;delete a.__tmpVertices;a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals()};
+b)}var d=[],f=[],g=[],e=this,h=a.vertices,d=a.faces,i=h.concat(),j=[],k={},q={},l=[],n,r,m,p,o,s=a.faceVertexUvs[0];for(n=0,r=s.length;n<r;n++)for(m=0,p=s[n].length;m<p;m++)o=d[n]["abcd".charAt(m)],l[o]||(l[o]=s[n][m]);var t;for(n=0,r=d.length;n<r;n++)if(o=d[n],j.push(o.centroid),i.push(new THREE.Vertex(o.centroid)),e.supportUVs&&0!=l.length){t=new THREE.UV;if(o instanceof THREE.Face3)t.u=l[o.a].u+l[o.b].u+l[o.c].u,t.v=l[o.a].v+l[o.b].v+l[o.c].v,t.u/=3,t.v/=3;else if(o instanceof THREE.Face4)t.u=
+l[o.a].u+l[o.b].u+l[o.c].u+l[o.d].u,t.v=l[o.a].v+l[o.b].v+l[o.c].v+l[o.d].v,t.u/=4,t.v/=4;l.push(t)}r=function(a){function b(a,c,d){void 0===a[c]&&(a[c]=[]);a[c].push(d)}var d,e,f,g,h={};for(d=0,e=a.faces.length;d<e;d++)f=a.faces[d],f instanceof THREE.Face3?(g=c(f.a,f.b),b(h,g,d),g=c(f.b,f.c),b(h,g,d),g=c(f.c,f.a),b(h,g,d)):f instanceof THREE.Face4&&(g=c(f.a,f.b),b(h,g,d),g=c(f.b,f.c),b(h,g,d),g=c(f.c,f.d),b(h,g,d),g=c(f.d,f.a),b(h,g,d));return h}(a);var u=0,s=h.length,v,w,z={},x={},A=function(a,
+b){void 0===z[a]&&(z[a]=[]);z[a].push(b)},F=function(a,b){void 0===x[a]&&(x[a]={});x[a][b]=null};for(n in r){t=r[n];v=n.split("_");w=v[0];v=v[1];A(w,[w,v]);A(v,[w,v]);for(m=0,p=t.length;m<p;m++)o=t[m],F(w,o,n),F(v,o,n);2>t.length&&(q[n]=!0)}for(n in r)if(t=r[n],o=t[0],t=t[1],v=n.split("_"),w=v[0],v=v[1],p=new THREE.Vector3,q[n]?(p.addSelf(h[w].position),p.addSelf(h[v].position),p.multiplyScalar(0.5)):(p.addSelf(j[o]),p.addSelf(j[t]),p.addSelf(h[w].position),p.addSelf(h[v].position),p.multiplyScalar(0.25)),
+k[n]=s+d.length+u,i.push(new THREE.Vertex(p)),u++,e.supportUVs&&0!=l.length)t=new THREE.UV,t.u=l[w].u+l[v].u,t.v=l[w].v+l[v].v,t.u/=2,t.v/=2,l.push(t);var E,J;v=["123","12","2","23"];p=["123","23","3","31"];var A=["123","31","1","12"],F=["1234","12","2","23"],G=["1234","23","3","34"],B=["1234","34","4","41"],H=["1234","41","1","12"];for(n=0,r=j.length;n<r;n++)o=d[n],t=s+n,o instanceof THREE.Face3?(u=c(o.a,o.b),w=c(o.b,o.c),E=c(o.c,o.a),b(t,k[u],o.b,k[w],o,v),b(t,k[w],o.c,k[E],o,p),b(t,k[E],o.a,k[u],
+o,A)):o instanceof THREE.Face4?(u=c(o.a,o.b),w=c(o.b,o.c),E=c(o.c,o.d),J=c(o.d,o.a),b(t,k[u],o.b,k[w],o,F),b(t,k[w],o.c,k[E],o,G),b(t,k[E],o.d,k[J],o,B),b(t,k[J],o.a,k[u],o,H)):console.log("face should be a face!",o);d=i;i=new THREE.Vector3;k=new THREE.Vector3;for(n=0,r=h.length;n<r;n++)if(void 0!==z[n]){i.set(0,0,0);k.set(0,0,0);o=new THREE.Vector3(0,0,0);t=0;for(m in x[n])i.addSelf(j[m]),t++;u=0;s=z[n].length;for(m=0;m<s;m++)q[c(z[n][m][0],z[n][m][1])]&&u++;if(2!=u){i.divideScalar(t);for(m=0;m<
+s;m++)t=z[n][m],t=h[t[0]].position.clone().addSelf(h[t[1]].position).divideScalar(2),k.addSelf(t);k.divideScalar(s);o.addSelf(h[n].position);o.multiplyScalar(s-3);o.addSelf(i);o.addSelf(k.multiplyScalar(2));o.divideScalar(s);d[n].position=o}}a.vertices=d;a.faces=f;a.faceVertexUvs[0]=g;delete a.__tmpVertices;a.computeCentroids();a.computeFaceNormals();a.computeVertexNormals()};
 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=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:"anonymous",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?b+((100*a.loaded/
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:"anonymous",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?b+((100*a.loaded/
 a.total).toFixed(0)+"%"):b+((a.loaded/1E3).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlbase:function(a){a=a.split("/");a.pop();return 1>a.length?"":a.join("/")+"/"},initMaterials:function(a,b,c){a.materials=[];for(var d=0;d<b.length;++d)a.materials[d]=THREE.Loader.prototype.createMaterial(b[d],c)},hasNormals:function(a){var b,c,d=a.materials.length;for(c=0;c<d;c++)if(b=a.materials[c],b instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=
 a.total).toFixed(0)+"%"):b+((a.loaded/1E3).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlbase:function(a){a=a.split("/");a.pop();return 1>a.length?"":a.join("/")+"/"},initMaterials:function(a,b,c){a.materials=[];for(var d=0;d<b.length;++d)a.materials[d]=THREE.Loader.prototype.createMaterial(b[d],c)},hasNormals:function(a){var b,c,d=a.materials.length;for(c=0;c<d;c++)if(b=a.materials[c],b instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=
 Math.log(a)/Math.LN2;return Math.floor(a)==a}function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function f(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!c(this.height)){var b=d(this.width),e=d(this.height);a.image.width=b;a.image.height=e;a.image.getContext("2d").drawImage(this,0,0,b,e)}else a.image=this;a.needsUpdate=!0};e.crossOrigin=h.crossOrigin;e.src=b}function g(a,c,d,e,g,h){var i=document.createElement("canvas");a[c]=new THREE.Texture(i);a[c].sourceFile=d;
 Math.log(a)/Math.LN2;return Math.floor(a)==a}function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function f(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!c(this.height)){var b=d(this.width),e=d(this.height);a.image.width=b;a.image.height=e;a.image.getContext("2d").drawImage(this,0,0,b,e)}else a.image=this;a.needsUpdate=!0};e.crossOrigin=h.crossOrigin;e.src=b}function g(a,c,d,e,g,h){var i=document.createElement("canvas");a[c]=new THREE.Texture(i);a[c].sourceFile=d;
-if(e){a[c].repeat.set(e[0],e[1]);if(1!=e[0])a[c].wrapS=THREE.RepeatWrapping;if(1!=e[1])a[c].wrapT=THREE.RepeatWrapping}g&&a[c].offset.set(g[0],g[1]);if(h){e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(void 0!==e[h[0]])a[c].wrapS=e[h[0]];if(void 0!==e[h[1]])a[c].wrapT=e[h[1]]}f(a[c],b+"/"+d)}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var h=this,i="MeshLambertMaterial",k={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:a.wireframe};a.shading&&
-("Phong"==a.shading?i="MeshPhongMaterial":"Basic"==a.shading&&(i="MeshBasicMaterial"));if(a.blending)if("Additive"==a.blending)k.blending=THREE.AdditiveBlending;else if("Subtractive"==a.blending)k.blending=THREE.SubtractiveBlending;else if("Multiply"==a.blending)k.blending=THREE.MultiplyBlending;if(void 0!==a.transparent||1>a.opacity)k.transparent=a.transparent;if(void 0!==a.depthTest)k.depthTest=a.depthTest;if(void 0!==a.vertexColors)if("face"==a.vertexColors)k.vertexColors=THREE.FaceColors;else if(a.vertexColors)k.vertexColors=
-THREE.VertexColors;if(a.colorDiffuse)k.color=e(a.colorDiffuse);else if(a.DbgColor)k.color=a.DbgColor;if(a.colorSpecular)k.specular=e(a.colorSpecular);if(a.colorAmbient)k.ambient=e(a.colorAmbient);if(a.transparency)k.opacity=a.transparency;if(a.specularCoef)k.shininess=a.specularCoef;a.mapDiffuse&&b&&g(k,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap);a.mapLight&&b&&g(k,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap);a.mapNormal&&b&&g(k,"normalMap",
-a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap);a.mapSpecular&&b&&g(k,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap);if(a.mapNormal){var i=THREE.ShaderUtils.lib.normal,j=THREE.UniformsUtils.clone(i.uniforms);j.tNormal.texture=k.normalMap;if(a.mapNormalFactor)j.uNormalScale.value=a.mapNormalFactor;if(k.map)j.tDiffuse.texture=k.map,j.enableDiffuse.value=!0;if(k.specularMap)j.tSpecular.texture=k.specularMap,j.enableSpecular.value=!0;if(k.lightMap)j.tAO.texture=
-k.lightMap,j.enableAO.value=!0;j.uDiffuseColor.value.setHex(k.color);j.uSpecularColor.value.setHex(k.specular);j.uAmbientColor.value.setHex(k.ambient);j.uShininess.value=k.shininess;if(void 0!==k.opacity)j.uOpacity.value=k.opacity;k=new THREE.ShaderMaterial({fragmentShader:i.fragmentShader,vertexShader:i.vertexShader,uniforms:j,lights:!0,fog:!0})}else k=new THREE[i](k);if(void 0!==a.DbgName)k.name=a.DbgName;return k}};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};
+if(e){a[c].repeat.set(e[0],e[1]);if(1!=e[0])a[c].wrapS=THREE.RepeatWrapping;if(1!=e[1])a[c].wrapT=THREE.RepeatWrapping}g&&a[c].offset.set(g[0],g[1]);if(h){e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(void 0!==e[h[0]])a[c].wrapS=e[h[0]];if(void 0!==e[h[1]])a[c].wrapT=e[h[1]]}f(a[c],b+"/"+d)}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var h=this,i="MeshLambertMaterial",j={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:a.wireframe};a.shading&&
+("Phong"==a.shading?i="MeshPhongMaterial":"Basic"==a.shading&&(i="MeshBasicMaterial"));if(a.blending)if("Additive"==a.blending)j.blending=THREE.AdditiveBlending;else if("Subtractive"==a.blending)j.blending=THREE.SubtractiveBlending;else if("Multiply"==a.blending)j.blending=THREE.MultiplyBlending;if(void 0!==a.transparent||1>a.opacity)j.transparent=a.transparent;if(void 0!==a.depthTest)j.depthTest=a.depthTest;if(void 0!==a.vertexColors)if("face"==a.vertexColors)j.vertexColors=THREE.FaceColors;else if(a.vertexColors)j.vertexColors=
+THREE.VertexColors;if(a.colorDiffuse)j.color=e(a.colorDiffuse);else if(a.DbgColor)j.color=a.DbgColor;if(a.colorSpecular)j.specular=e(a.colorSpecular);if(a.colorAmbient)j.ambient=e(a.colorAmbient);if(a.transparency)j.opacity=a.transparency;if(a.specularCoef)j.shininess=a.specularCoef;a.mapDiffuse&&b&&g(j,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap);a.mapLight&&b&&g(j,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap);a.mapNormal&&b&&g(j,"normalMap",
+a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap);a.mapSpecular&&b&&g(j,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap);if(a.mapNormal){var i=THREE.ShaderUtils.lib.normal,k=THREE.UniformsUtils.clone(i.uniforms);k.tNormal.texture=j.normalMap;if(a.mapNormalFactor)k.uNormalScale.value=a.mapNormalFactor;if(j.map)k.tDiffuse.texture=j.map,k.enableDiffuse.value=!0;if(j.specularMap)k.tSpecular.texture=j.specularMap,k.enableSpecular.value=!0;if(j.lightMap)k.tAO.texture=
+j.lightMap,k.enableAO.value=!0;k.uDiffuseColor.value.setHex(j.color);k.uSpecularColor.value.setHex(j.specular);k.uAmbientColor.value.setHex(j.ambient);k.uShininess.value=j.shininess;if(void 0!==j.opacity)k.uOpacity.value=j.opacity;j=new THREE.ShaderMaterial({fragmentShader:i.fragmentShader,vertexShader:i.vertexShader,uniforms:k,lights:!0,fog:!0})}else j=new THREE[i](j);if(void 0!==a.DbgName)j.name=a.DbgName;return j}};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=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
 THREE.BinaryLoader.prototype.load=function(a,b,c,d){if(a instanceof Object)console.warn("DEPRECATED: BinaryLoader( parameters ) is now BinaryLoader( url, callback, texturePath, binaryPath )."),d=a,a=d.model,b=d.callback,c=d.texture_path,d=d.bin_path;var c=c?c:this.extractUrlbase(a),d=d?d:this.extractUrlbase(a),f=this.showProgress?THREE.Loader.prototype.updateProgress:null;this.onLoadStart();this.loadAjaxJSON(this,a,b,c,d,f)};
 THREE.BinaryLoader.prototype.load=function(a,b,c,d){if(a instanceof Object)console.warn("DEPRECATED: BinaryLoader( parameters ) is now BinaryLoader( url, callback, texturePath, binaryPath )."),d=a,a=d.model,b=d.callback,c=d.texture_path,d=d.bin_path;var c=c?c:this.extractUrlbase(a),d=d?d:this.extractUrlbase(a),f=this.showProgress?THREE.Loader.prototype.updateProgress:null;this.onLoadStart();this.loadAjaxJSON(this,a,b,c,d,f)};
 THREE.BinaryLoader.prototype.loadAjaxJSON=function(a,b,c,d,f,g){var e=new XMLHttpRequest;e.onreadystatechange=function(){if(4==e.readyState)if(200==e.status||0==e.status)try{var h=JSON.parse(e.responseText);void 0===h.metadata||void 0===h.metadata.formatVersion||3!==h.metadata.formatVersion?console.error("Deprecated file format."):a.loadAjaxBuffers(h,c,f,d,g)}catch(i){console.error(i),console.warn("DEPRECATED: ["+b+"] seems to be using old model format")}else console.error("Couldn't load ["+b+"] ["+
 THREE.BinaryLoader.prototype.loadAjaxJSON=function(a,b,c,d,f,g){var e=new XMLHttpRequest;e.onreadystatechange=function(){if(4==e.readyState)if(200==e.status||0==e.status)try{var h=JSON.parse(e.responseText);void 0===h.metadata||void 0===h.metadata.formatVersion||3!==h.metadata.formatVersion?console.error("Deprecated file format."):a.loadAjaxBuffers(h,c,f,d,g)}catch(i){console.error(i),console.warn("DEPRECATED: ["+b+"] seems to be using old model format")}else console.error("Couldn't load ["+b+"] ["+
 e.status+"]")};e.open("GET",b,!0);e.overrideMimeType&&e.overrideMimeType("text/plain; charset=x-user-defined");e.setRequestHeader("Content-Type","text/plain");e.send(null)};
 e.status+"]")};e.open("GET",b,!0);e.overrideMimeType&&e.overrideMimeType("text/plain; charset=x-user-defined");e.setRequestHeader("Content-Type","text/plain");e.send(null)};
 THREE.BinaryLoader.prototype.loadAjaxBuffers=function(a,b,c,d,f){var g=new XMLHttpRequest,e=c+"/"+a.buffers,h=0;g.onreadystatechange=function(){4==g.readyState?200==g.status||0==g.status?THREE.BinaryLoader.prototype.createBinModel(g.response,b,d,a.materials):console.error("Couldn't load ["+e+"] ["+g.status+"]"):3==g.readyState?f&&(0==h&&(h=g.getResponseHeader("Content-Length")),f({total:h,loaded:g.responseText.length})):2==g.readyState&&(h=g.getResponseHeader("Content-Length"))};g.open("GET",e,!0);
 THREE.BinaryLoader.prototype.loadAjaxBuffers=function(a,b,c,d,f){var g=new XMLHttpRequest,e=c+"/"+a.buffers,h=0;g.onreadystatechange=function(){4==g.readyState?200==g.status||0==g.status?THREE.BinaryLoader.prototype.createBinModel(g.response,b,d,a.materials):console.error("Couldn't load ["+e+"] ["+g.status+"]"):3==g.readyState?f&&(0==h&&(h=g.getResponseHeader("Content-Length")),f({total:h,loaded:g.responseText.length})):2==g.readyState&&(h=g.getResponseHeader("Content-Length"))};g.open("GET",e,!0);
 g.responseType="arraybuffer";g.send(null)};
 g.responseType="arraybuffer";g.send(null)};
-THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,d){var f=function(b){var c,f,i,k,j,q,l,n,r,m,o,p,s,t,u,v;function w(a){return a%4?4-a%4:0}function z(a,b){return(new Uint8Array(a,b,1))[0]}function x(a,b){return(new Uint32Array(a,b,1))[0]}function A(b,c){var d,e,f,g,h,i,j,k,m=new Uint32Array(a,c,3*b);for(d=0;d<b;d++){e=m[3*d];f=m[3*d+1];g=m[3*d+2];h=y[2*e];e=y[2*e+1];i=y[2*f];j=y[2*f+1];f=y[2*g];k=y[2*g+1];g=H.faceVertexUvs[0];var l=[];l.push(new THREE.UV(h,e));l.push(new THREE.UV(i,j));
+THREE.BinaryLoader.prototype.createBinModel=function(a,b,c,d){var f=function(b){var c,f,i,j,k,q,l,n,r,m,p,o,s,t,u,v;function w(a){return a%4?4-a%4:0}function z(a,b){return(new Uint8Array(a,b,1))[0]}function x(a,b){return(new Uint32Array(a,b,1))[0]}function A(b,c){var d,e,f,g,h,i,j,k,m=new Uint32Array(a,c,3*b);for(d=0;d<b;d++){e=m[3*d];f=m[3*d+1];g=m[3*d+2];h=y[2*e];e=y[2*e+1];i=y[2*f];j=y[2*f+1];f=y[2*g];k=y[2*g+1];g=H.faceVertexUvs[0];var l=[];l.push(new THREE.UV(h,e));l.push(new THREE.UV(i,j));
 l.push(new THREE.UV(f,k));g.push(l)}}function F(b,c){var d,e,f,g,h,i,j,k,m,l,n=new Uint32Array(a,c,4*b);for(d=0;d<b;d++){e=n[4*d];f=n[4*d+1];g=n[4*d+2];h=n[4*d+3];i=y[2*e];e=y[2*e+1];j=y[2*f];m=y[2*f+1];k=y[2*g];l=y[2*g+1];g=y[2*h];f=y[2*h+1];h=H.faceVertexUvs[0];var q=[];q.push(new THREE.UV(i,e));q.push(new THREE.UV(j,m));q.push(new THREE.UV(k,l));q.push(new THREE.UV(g,f));h.push(q)}}function E(b,c,d){for(var e,f,g,h,c=new Uint32Array(a,c,3*b),i=new Uint16Array(a,d,b),d=0;d<b;d++)e=c[3*d],f=c[3*
 l.push(new THREE.UV(f,k));g.push(l)}}function F(b,c){var d,e,f,g,h,i,j,k,m,l,n=new Uint32Array(a,c,4*b);for(d=0;d<b;d++){e=n[4*d];f=n[4*d+1];g=n[4*d+2];h=n[4*d+3];i=y[2*e];e=y[2*e+1];j=y[2*f];m=y[2*f+1];k=y[2*g];l=y[2*g+1];g=y[2*h];f=y[2*h+1];h=H.faceVertexUvs[0];var q=[];q.push(new THREE.UV(i,e));q.push(new THREE.UV(j,m));q.push(new THREE.UV(k,l));q.push(new THREE.UV(g,f));h.push(q)}}function E(b,c,d){for(var e,f,g,h,c=new Uint32Array(a,c,3*b),i=new Uint16Array(a,d,b),d=0;d<b;d++)e=c[3*d],f=c[3*
 d+1],g=c[3*d+2],h=i[d],H.faces.push(new THREE.Face3(e,f,g,null,null,h))}function J(b,c,d){for(var e,f,g,h,i,c=new Uint32Array(a,c,4*b),j=new Uint16Array(a,d,b),d=0;d<b;d++)e=c[4*d],f=c[4*d+1],g=c[4*d+2],h=c[4*d+3],i=j[d],H.faces.push(new THREE.Face4(e,f,g,h,null,null,i))}function G(b,c,d,e){for(var f,g,h,i,j,k,m,c=new Uint32Array(a,c,3*b),d=new Uint32Array(a,d,3*b),l=new Uint16Array(a,e,b),e=0;e<b;e++){f=c[3*e];g=c[3*e+1];h=c[3*e+2];j=d[3*e];k=d[3*e+1];m=d[3*e+2];i=l[e];var n=I[3*k],q=I[3*k+1];k=
 d+1],g=c[3*d+2],h=i[d],H.faces.push(new THREE.Face3(e,f,g,null,null,h))}function J(b,c,d){for(var e,f,g,h,i,c=new Uint32Array(a,c,4*b),j=new Uint16Array(a,d,b),d=0;d<b;d++)e=c[4*d],f=c[4*d+1],g=c[4*d+2],h=c[4*d+3],i=j[d],H.faces.push(new THREE.Face4(e,f,g,h,null,null,i))}function G(b,c,d,e){for(var f,g,h,i,j,k,m,c=new Uint32Array(a,c,3*b),d=new Uint32Array(a,d,3*b),l=new Uint16Array(a,e,b),e=0;e<b;e++){f=c[3*e];g=c[3*e+1];h=c[3*e+2];j=d[3*e];k=d[3*e+1];m=d[3*e+2];i=l[e];var n=I[3*k],q=I[3*k+1];k=
 I[3*k+2];var p=I[3*m],o=I[3*m+1];m=I[3*m+2];H.faces.push(new THREE.Face3(f,g,h,[new THREE.Vector3(I[3*j],I[3*j+1],I[3*j+2]),new THREE.Vector3(n,q,k),new THREE.Vector3(p,o,m)],null,i))}}function B(b,c,d,e){for(var f,g,h,i,j,k,m,l,n,c=new Uint32Array(a,c,4*b),d=new Uint32Array(a,d,4*b),q=new Uint16Array(a,e,b),e=0;e<b;e++){f=c[4*e];g=c[4*e+1];h=c[4*e+2];i=c[4*e+3];k=d[4*e];m=d[4*e+1];l=d[4*e+2];n=d[4*e+3];j=q[e];var p=I[3*m],o=I[3*m+1];m=I[3*m+2];var r=I[3*l],s=I[3*l+1];l=I[3*l+2];var t=I[3*n],u=I[3*
 I[3*k+2];var p=I[3*m],o=I[3*m+1];m=I[3*m+2];H.faces.push(new THREE.Face3(f,g,h,[new THREE.Vector3(I[3*j],I[3*j+1],I[3*j+2]),new THREE.Vector3(n,q,k),new THREE.Vector3(p,o,m)],null,i))}}function B(b,c,d,e){for(var f,g,h,i,j,k,m,l,n,c=new Uint32Array(a,c,4*b),d=new Uint32Array(a,d,4*b),q=new Uint16Array(a,e,b),e=0;e<b;e++){f=c[4*e];g=c[4*e+1];h=c[4*e+2];i=c[4*e+3];k=d[4*e];m=d[4*e+1];l=d[4*e+2];n=d[4*e+3];j=q[e];var p=I[3*m],o=I[3*m+1];m=I[3*m+2];var r=I[3*l],s=I[3*l+1];l=I[3*l+2];var t=I[3*n],u=I[3*
-n+1];n=I[3*n+2];H.faces.push(new THREE.Face4(f,g,h,i,[new THREE.Vector3(I[3*k],I[3*k+1],I[3*k+2]),new THREE.Vector3(p,o,m),new THREE.Vector3(r,s,l),new THREE.Vector3(t,u,n)],null,j))}}var H=this,D=0,I=[],y=[],K,C;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(H,d,b);c=function(a,b,c){for(var a=new Uint8Array(a,b,c),d="",e=0;e<c;e++)d+=String.fromCharCode(a[b+e]);return d}(a,D,12);f=z(a,D+12);z(a,D+13);z(a,D+14);z(a,D+15);i=z(a,D+16);k=z(a,D+17);j=z(a,D+18);q=z(a,D+19);l=x(a,D+20);
-n=x(a,D+20+4);r=x(a,D+20+8);b=x(a,D+20+12);m=x(a,D+20+16);o=x(a,D+20+20);p=x(a,D+20+24);s=x(a,D+20+28);t=x(a,D+20+32);u=x(a,D+20+36);v=x(a,D+20+40);"Three.js 003"!==c&&console.warn("DEPRECATED: binary model seems to be using old format");D+=f;c=3*i+q;C=4*i+q;f=b*c;K=m*(c+3*k);i=o*(c+3*j);q=p*(c+3*k+3*j);c=s*C;k=t*(C+4*k);j=u*(C+4*j);D+=function(b){var b=new Float32Array(a,b,3*l),c,d,e,f;for(c=0;c<l;c++)d=b[3*c],e=b[3*c+1],f=b[3*c+2],H.vertices.push(new THREE.Vertex(new THREE.Vector3(d,e,f)));return 3*
-l*Float32Array.BYTES_PER_ELEMENT}(D);D+=function(b){if(n){var b=new Int8Array(a,b,3*n),c,d,e,f;for(c=0;c<n;c++)d=b[3*c],e=b[3*c+1],f=b[3*c+2],I.push(d/127,e/127,f/127)}return 3*n*Int8Array.BYTES_PER_ELEMENT}(D);D+=w(3*n);D+=function(b){if(r){var b=new Float32Array(a,b,2*r),c,d,e;for(c=0;c<r;c++)d=b[2*c],e=b[2*c+1],y.push(d,e)}return 2*r*Float32Array.BYTES_PER_ELEMENT}(D);f=D+f+w(2*b);K=f+K+w(2*m);i=K+i+w(2*o);q=i+q+w(2*p);c=q+c+w(2*s);k=c+k+w(2*t);j=k+j+w(2*u);(function(a){if(o){var b=a+3*o*Uint32Array.BYTES_PER_ELEMENT;
-E(o,a,b+3*o*Uint32Array.BYTES_PER_ELEMENT);A(o,b)}})(K);(function(a){if(p){var b=a+3*p*Uint32Array.BYTES_PER_ELEMENT,c=b+3*p*Uint32Array.BYTES_PER_ELEMENT;G(p,a,b,c+3*p*Uint32Array.BYTES_PER_ELEMENT);A(p,c)}})(i);(function(a){if(u){var b=a+4*u*Uint32Array.BYTES_PER_ELEMENT;J(u,a,b+4*u*Uint32Array.BYTES_PER_ELEMENT);F(u,b)}})(k);(function(a){if(v){var b=a+4*v*Uint32Array.BYTES_PER_ELEMENT,c=b+4*v*Uint32Array.BYTES_PER_ELEMENT;B(v,a,b,c+4*v*Uint32Array.BYTES_PER_ELEMENT);F(v,c)}})(j);b&&E(b,D,D+3*b*
+n+1];n=I[3*n+2];H.faces.push(new THREE.Face4(f,g,h,i,[new THREE.Vector3(I[3*k],I[3*k+1],I[3*k+2]),new THREE.Vector3(p,o,m),new THREE.Vector3(r,s,l),new THREE.Vector3(t,u,n)],null,j))}}var H=this,C=0,I=[],y=[],K,D;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(H,d,b);c=function(a,b,c){for(var a=new Uint8Array(a,b,c),d="",e=0;e<c;e++)d+=String.fromCharCode(a[b+e]);return d}(a,C,12);f=z(a,C+12);z(a,C+13);z(a,C+14);z(a,C+15);i=z(a,C+16);j=z(a,C+17);k=z(a,C+18);q=z(a,C+19);l=x(a,C+20);
+n=x(a,C+20+4);r=x(a,C+20+8);b=x(a,C+20+12);m=x(a,C+20+16);p=x(a,C+20+20);o=x(a,C+20+24);s=x(a,C+20+28);t=x(a,C+20+32);u=x(a,C+20+36);v=x(a,C+20+40);"Three.js 003"!==c&&console.warn("DEPRECATED: binary model seems to be using old format");C+=f;c=3*i+q;D=4*i+q;f=b*c;K=m*(c+3*j);i=p*(c+3*k);q=o*(c+3*j+3*k);c=s*D;j=t*(D+4*j);k=u*(D+4*k);C+=function(b){var b=new Float32Array(a,b,3*l),c,d,e,f;for(c=0;c<l;c++)d=b[3*c],e=b[3*c+1],f=b[3*c+2],H.vertices.push(new THREE.Vertex(new THREE.Vector3(d,e,f)));return 3*
+l*Float32Array.BYTES_PER_ELEMENT}(C);C+=function(b){if(n){var b=new Int8Array(a,b,3*n),c,d,e,f;for(c=0;c<n;c++)d=b[3*c],e=b[3*c+1],f=b[3*c+2],I.push(d/127,e/127,f/127)}return 3*n*Int8Array.BYTES_PER_ELEMENT}(C);C+=w(3*n);C+=function(b){if(r){var b=new Float32Array(a,b,2*r),c,d,e;for(c=0;c<r;c++)d=b[2*c],e=b[2*c+1],y.push(d,e)}return 2*r*Float32Array.BYTES_PER_ELEMENT}(C);f=C+f+w(2*b);K=f+K+w(2*m);i=K+i+w(2*p);q=i+q+w(2*o);c=q+c+w(2*s);j=c+j+w(2*t);k=j+k+w(2*u);(function(a){if(p){var b=a+3*p*Uint32Array.BYTES_PER_ELEMENT;
+E(p,a,b+3*p*Uint32Array.BYTES_PER_ELEMENT);A(p,b)}})(K);(function(a){if(o){var b=a+3*o*Uint32Array.BYTES_PER_ELEMENT,c=b+3*o*Uint32Array.BYTES_PER_ELEMENT;G(o,a,b,c+3*o*Uint32Array.BYTES_PER_ELEMENT);A(o,c)}})(i);(function(a){if(u){var b=a+4*u*Uint32Array.BYTES_PER_ELEMENT;J(u,a,b+4*u*Uint32Array.BYTES_PER_ELEMENT);F(u,b)}})(j);(function(a){if(v){var b=a+4*v*Uint32Array.BYTES_PER_ELEMENT,c=b+4*v*Uint32Array.BYTES_PER_ELEMENT;B(v,a,b,c+4*v*Uint32Array.BYTES_PER_ELEMENT);F(v,c)}})(k);b&&E(b,C,C+3*b*
 Uint32Array.BYTES_PER_ELEMENT);(function(a){if(m){var b=a+3*m*Uint32Array.BYTES_PER_ELEMENT;G(m,a,b,b+3*m*Uint32Array.BYTES_PER_ELEMENT)}})(f);s&&J(s,q,q+4*s*Uint32Array.BYTES_PER_ELEMENT);(function(a){if(t){var b=a+4*t*Uint32Array.BYTES_PER_ELEMENT;B(t,a,b,b+4*t*Uint32Array.BYTES_PER_ELEMENT)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;b(new f(c))};
 Uint32Array.BYTES_PER_ELEMENT);(function(a){if(m){var b=a+3*m*Uint32Array.BYTES_PER_ELEMENT;G(m,a,b,b+3*m*Uint32Array.BYTES_PER_ELEMENT)}})(f);s&&J(s,q,q+4*s*Uint32Array.BYTES_PER_ELEMENT);(function(a){if(t){var b=a+4*t*Uint32Array.BYTES_PER_ELEMENT;B(t,a,b,b+4*t*Uint32Array.BYTES_PER_ELEMENT)}})(c);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;b(new f(c))};
 THREE.ColladaLoader=function(){function a(a,d,f){Q=a;d=d||la;void 0!==f&&(a=f.split("/"),a.pop(),ma=1>a.length?"":a.join("/")+"/");if((a=Q.evaluate("//dae:asset",Q,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&a.childNodes)for(f=0;f<a.childNodes.length;f++){var i=a.childNodes[f];switch(i.nodeName){case "unit":(i=i.getAttribute("meter"))&&parseFloat(i);break;case "up_axis":$=i.textContent.charAt(0)}}if(!R.convertUpAxis||$===R.upAxis)W=null;else switch($){case "X":W="Y"===R.upAxis?
 THREE.ColladaLoader=function(){function a(a,d,f){Q=a;d=d||la;void 0!==f&&(a=f.split("/"),a.pop(),ma=1>a.length?"":a.join("/")+"/");if((a=Q.evaluate("//dae:asset",Q,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&a.childNodes)for(f=0;f<a.childNodes.length;f++){var i=a.childNodes[f];switch(i.nodeName){case "unit":(i=i.getAttribute("meter"))&&parseFloat(i);break;case "up_axis":$=i.textContent.charAt(0)}}if(!R.convertUpAxis||$===R.upAxis)W=null;else switch($){case "X":W="Y"===R.upAxis?
-"XtoY":"XtoZ";break;case "Y":W="X"===R.upAxis?"YtoX":"YtoZ";break;case "Z":W="X"===R.upAxis?"ZtoX":"ZtoY"}ea=b("//dae:library_images/dae:image",e,"image");fa=b("//dae:library_materials/dae:material",x,"material");ga=b("//dae:library_effects/dae:effect",G,"effect");V=b("//dae:library_geometries/dae:geometry",o,"geometry");ha=b(".//dae:library_cameras/dae:camera",K,"camera");U=b("//dae:library_controllers/dae:controller",h,"controller");X=b("//dae:library_animations/dae:animation",H,"animation");ia=
-b(".//dae:library_visual_scenes/dae:visual_scene",j,"visual_scene");aa=[];ba=[];(a=Q.evaluate(".//dae:scene/dae:instance_visual_scene",Q,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(a=a.getAttribute("url").replace(/^#/,""),T=ia[a]):T=null;Z=new THREE.Object3D;for(a=0;a<T.nodes.length;a++)Z.add(g(T.nodes[a]));ja=[];c(Z);a={scene:Z,morphs:aa,skins:ba,animations:ja,dae:{images:ea,materials:fa,cameras:ha,effects:ga,geometries:V,controllers:U,animations:X,visualScenes:ia,scene:T}};d&&
-d(a);return a}function b(a,b,c){for(var a=Q.evaluate(a,Q,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),d={},e=a.iterateNext(),f=0;e;){e=(new b).parse(e);if(!e.id||0==e.id.length)e.id=c+f++;d[e.id]=e;e=a.iterateNext()}return d}function c(a){var b=T.getChildById(a.name,!0),d=null;if(b&&b.keys){d={fps:60,hierarchy:[{node:b,keys:b.keys,sids:b.sids}],node:a,name:"animation_"+a.name,length:0};ja.push(d);for(var e=0,f=b.keys.length;e<f;e++)d.length=Math.max(d.length,b.keys[e].time)}else d={hierarchy:[{keys:[],
-sids:[]}]};e=0;for(f=a.children.length;e<f;e++)for(var b=0,g=c(a.children[e]).hierarchy.length;b<g;b++)d.hierarchy.push({keys:[],sids:[]});return d}function d(a,b,c,e){a.world=a.world||new THREE.Matrix4;a.world.copy(a.matrix);if(a.channels&&a.channels.length){var f=a.channels[0].sampler.output[c];f instanceof THREE.Matrix4&&a.world.copy(f)}e&&a.world.multiply(e,a.world);b.push(a);for(e=0;e<a.nodes.length;e++)d(a.nodes[e],b,c,a.world)}function f(a,b,c){var e,f=U[b.url];if(!f||!f.skin)console.log("ColladaLoader: Could not find skin controller.");
-else if(!b.skeleton||!b.skeleton.length)console.log("ColladaLoader: Could not find the skeleton for the skin. ");else{var c=1E6,g=-c,h=0;for(e in X)for(var i=X[e],j=0;j<i.sampler.length;j++){var k=i.sampler[j];k.create();c=Math.min(c,k.startTime);g=Math.max(g,k.endTime);h=Math.max(h,k.input.length)}e=h;for(var b=T.getChildById(b.skeleton[0],!0)||T.getChildBySid(b.skeleton[0],!0),m,l,g=new THREE.Vector3,n,j=0;j<a.vertices.length;j++)f.skin.bindShapeMatrix.multiplyVector3(a.vertices[j].position);for(c=
-0;c<e;c++){h=[];i=[];for(j=0;j<a.vertices.length;j++)i.push(new THREE.Vertex(new THREE.Vector3));d(b,h,c);j=h;k=f.skin;for(l=0;l<j.length;l++)if(m=j[l],n=-1,"JOINT"==m.type){for(var q=0;q<k.joints.length;q++)if(m.sid==k.joints[q]){n=q;break}if(0<=n){q=k.invBindMatrices[n];m.invBindMatrix=q;m.skinningMatrix=new THREE.Matrix4;m.skinningMatrix.multiply(m.world,q);m.weights=[];for(q=0;q<k.weights.length;q++)for(var p=0;p<k.weights[q].length;p++){var o=k.weights[q][p];o.joint==n&&m.weights.push(o)}}else throw"ColladaLoader: Could not find joint '"+
+"XtoY":"XtoZ";break;case "Y":W="X"===R.upAxis?"YtoX":"YtoZ";break;case "Z":W="X"===R.upAxis?"ZtoX":"ZtoY"}ea=b("//dae:library_images/dae:image",e,"image");fa=b("//dae:library_materials/dae:material",x,"material");ga=b("//dae:library_effects/dae:effect",G,"effect");V=b("//dae:library_geometries/dae:geometry",p,"geometry");ha=b(".//dae:library_cameras/dae:camera",K,"camera");U=b("//dae:library_controllers/dae:controller",h,"controller");X=b("//dae:library_animations/dae:animation",H,"animation");ia=
+b(".//dae:library_visual_scenes/dae:visual_scene",k,"visual_scene");aa=[];ba=[];(a=Q.evaluate(".//dae:scene/dae:instance_visual_scene",Q,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(a=a.getAttribute("url").replace(/^#/,""),T=ia[0<a.length?a:"visual_scene0"]):T=null;Z=new THREE.Object3D;for(a=0;a<T.nodes.length;a++)Z.add(g(T.nodes[a]));ja=[];c(Z);a={scene:Z,morphs:aa,skins:ba,animations:ja,dae:{images:ea,materials:fa,cameras:ha,effects:ga,geometries:V,controllers:U,animations:X,visualScenes:ia,
+scene:T}};d&&d(a);return a}function b(a,b,c){for(var a=Q.evaluate(a,Q,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),d={},e=a.iterateNext(),f=0;e;){e=(new b).parse(e);if(!e.id||0==e.id.length)e.id=c+f++;d[e.id]=e;e=a.iterateNext()}return d}function c(a){var b=T.getChildById(a.name,!0),d=null;if(b&&b.keys){d={fps:60,hierarchy:[{node:b,keys:b.keys,sids:b.sids}],node:a,name:"animation_"+a.name,length:0};ja.push(d);for(var e=0,f=b.keys.length;e<f;e++)d.length=Math.max(d.length,b.keys[e].time)}else d=
+{hierarchy:[{keys:[],sids:[]}]};e=0;for(f=a.children.length;e<f;e++)for(var b=0,g=c(a.children[e]).hierarchy.length;b<g;b++)d.hierarchy.push({keys:[],sids:[]});return d}function d(a,b,c,e){a.world=a.world||new THREE.Matrix4;a.world.copy(a.matrix);if(a.channels&&a.channels.length){var f=a.channels[0].sampler.output[c];f instanceof THREE.Matrix4&&a.world.copy(f)}e&&a.world.multiply(e,a.world);b.push(a);for(e=0;e<a.nodes.length;e++)d(a.nodes[e],b,c,a.world)}function f(a,b,c){var e,f=U[b.url];if(!f||
+!f.skin)console.log("ColladaLoader: Could not find skin controller.");else if(!b.skeleton||!b.skeleton.length)console.log("ColladaLoader: Could not find the skeleton for the skin. ");else{var c=1E6,g=-c,h=0;for(e in X)for(var i=X[e],j=0;j<i.sampler.length;j++){var k=i.sampler[j];k.create();c=Math.min(c,k.startTime);g=Math.max(g,k.endTime);h=Math.max(h,k.input.length)}e=h;for(var b=T.getChildById(b.skeleton[0],!0)||T.getChildBySid(b.skeleton[0],!0),m,l,g=new THREE.Vector3,n,j=0;j<a.vertices.length;j++)f.skin.bindShapeMatrix.multiplyVector3(a.vertices[j].position);
+for(c=0;c<e;c++){h=[];i=[];for(j=0;j<a.vertices.length;j++)i.push(new THREE.Vertex(new THREE.Vector3));d(b,h,c);j=h;k=f.skin;for(l=0;l<j.length;l++)if(m=j[l],n=-1,"JOINT"==m.type){for(var q=0;q<k.joints.length;q++)if(m.sid==k.joints[q]){n=q;break}if(0<=n){q=k.invBindMatrices[n];m.invBindMatrix=q;m.skinningMatrix=new THREE.Matrix4;m.skinningMatrix.multiply(m.world,q);m.weights=[];for(q=0;q<k.weights.length;q++)for(var p=0;p<k.weights[q].length;p++){var o=k.weights[q][p];o.joint==n&&m.weights.push(o)}}else throw"ColladaLoader: Could not find joint '"+
 m.sid+"'.";}for(j=0;j<h.length;j++)if("JOINT"==h[j].type)for(k=0;k<h[j].weights.length;k++)m=h[j].weights[k],l=m.index,m=m.weight,n=a.vertices[l],l=i[l],g.x=n.position.x,g.y=n.position.y,g.z=n.position.z,h[j].skinningMatrix.multiplyVector3(g),l.position.x+=g.x*m,l.position.y+=g.y*m,l.position.z+=g.z*m;a.morphTargets.push({name:"target_"+c,vertices:i})}}}function g(a){var b=new THREE.Object3D,c,d,e,h;for(e=0;e<a.controllers.length;e++){var i=U[a.controllers[e].url];switch(i.type){case "skin":if(V[i.skin.source]){var j=
 m.sid+"'.";}for(j=0;j<h.length;j++)if("JOINT"==h[j].type)for(k=0;k<h[j].weights.length;k++)m=h[j].weights[k],l=m.index,m=m.weight,n=a.vertices[l],l=i[l],g.x=n.position.x,g.y=n.position.y,g.z=n.position.z,h[j].skinningMatrix.multiplyVector3(g),l.position.x+=g.x*m,l.position.y+=g.y*m,l.position.z+=g.z*m;a.morphTargets.push({name:"target_"+c,vertices:i})}}}function g(a){var b=new THREE.Object3D,c,d,e,h;for(e=0;e<a.controllers.length;e++){var i=U[a.controllers[e].url];switch(i.type){case "skin":if(V[i.skin.source]){var j=
 new m;j.url=i.skin.source;j.instance_material=a.controllers[e].instance_material;a.geometries.push(j);c=a.controllers[e]}else if(U[i.skin.source]&&(d=i=U[i.skin.source],i.morph&&V[i.morph.source]))j=new m,j.url=i.morph.source,j.instance_material=a.controllers[e].instance_material,a.geometries.push(j);break;case "morph":if(V[i.morph.source])j=new m,j.url=i.morph.source,j.instance_material=a.controllers[e].instance_material,a.geometries.push(j),d=a.controllers[e];console.log("ColladaLoader: Morph-controller partially supported.")}}for(e=
 new m;j.url=i.skin.source;j.instance_material=a.controllers[e].instance_material;a.geometries.push(j);c=a.controllers[e]}else if(U[i.skin.source]&&(d=i=U[i.skin.source],i.morph&&V[i.morph.source]))j=new m,j.url=i.morph.source,j.instance_material=a.controllers[e].instance_material,a.geometries.push(j);break;case "morph":if(V[i.morph.source])j=new m,j.url=i.morph.source,j.instance_material=a.controllers[e].instance_material,a.geometries.push(j),d=a.controllers[e];console.log("ColladaLoader: Morph-controller partially supported.")}}for(e=
 0;e<a.geometries.length;e++){var i=a.geometries[e],j=i.instance_material,i=V[i.url],k={},l=[],q=0,p;if(i&&i.mesh&&i.mesh.primitives){if(0==b.name.length)b.name=i.id;if(j)for(h=0;h<j.length;h++){p=j[h];var o=fa[p.target],r=ga[o.instance_effect.url].shader;r.material.opacity=!r.material.opacity?1:r.material.opacity;k[p.symbol]=q;l.push(r.material);p=r.material;p.name=null==o.name||""===o.name?o.id:o.name;q++}j=p||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});i=i.mesh.geometry3js;
 0;e<a.geometries.length;e++){var i=a.geometries[e],j=i.instance_material,i=V[i.url],k={},l=[],q=0,p;if(i&&i.mesh&&i.mesh.primitives){if(0==b.name.length)b.name=i.id;if(j)for(h=0;h<j.length;h++){p=j[h];var o=fa[p.target],r=ga[o.instance_effect.url].shader;r.material.opacity=!r.material.opacity?1:r.material.opacity;k[p.symbol]=q;l.push(r.material);p=r.material;p.name=null==o.name||""===o.name?o.id:o.name;q++}j=p||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});i=i.mesh.geometry3js;
 if(1<q){j=new THREE.MeshFaceMaterial;i.materials=l;for(h=0;h<i.faces.length;h++)l=i.faces[h],l.materialIndex=k[l.daeMaterial]}if(void 0!==c)f(i,c),j.morphTargets=!0,j=new THREE.SkinnedMesh(i,j),j.skeleton=c.skeleton,j.skinController=U[c.url],j.skinInstanceController=c,j.name="skin_"+ba.length,ba.push(j);else if(void 0!==d){h=i;k=d instanceof n?U[d.url]:d;if(!k||!k.morph)console.log("could not find morph controller!");else{k=k.morph;for(l=0;l<k.targets.length;l++)if(q=V[k.targets[l]],q.mesh&&q.mesh.primitives&&
 if(1<q){j=new THREE.MeshFaceMaterial;i.materials=l;for(h=0;h<i.faces.length;h++)l=i.faces[h],l.materialIndex=k[l.daeMaterial]}if(void 0!==c)f(i,c),j.morphTargets=!0,j=new THREE.SkinnedMesh(i,j),j.skeleton=c.skeleton,j.skinController=U[c.url],j.skinInstanceController=c,j.name="skin_"+ba.length,ba.push(j);else if(void 0!==d){h=i;k=d instanceof n?U[d.url]:d;if(!k||!k.morph)console.log("could not find morph controller!");else{k=k.morph;for(l=0;l<k.targets.length;l++)if(q=V[k.targets[l]],q.mesh&&q.mesh.primitives&&
 q.mesh.primitives.length)q=q.mesh.primitives[0].geometry,q.vertices.length===h.vertices.length&&h.morphTargets.push({name:"target_1",vertices:q.vertices});h.morphTargets.push({name:"target_Z",vertices:h.vertices})}j.morphTargets=!0;j=new THREE.Mesh(i,j);j.name="morph_"+aa.length;aa.push(j)}else j=new THREE.Mesh(i,j);1<a.geometries.length?b.add(j):b=j}}for(e=0;e<a.cameras.length;e++)b=ha[a.cameras[e].url],b=new THREE.PerspectiveCamera(b.fov,b.aspect_ratio,b.znear,b.zfar);b.name=a.id||"";b.matrix=a.matrix;
 q.mesh.primitives.length)q=q.mesh.primitives[0].geometry,q.vertices.length===h.vertices.length&&h.morphTargets.push({name:"target_1",vertices:q.vertices});h.morphTargets.push({name:"target_Z",vertices:h.vertices})}j.morphTargets=!0;j=new THREE.Mesh(i,j);j.name="morph_"+aa.length;aa.push(j)}else j=new THREE.Mesh(i,j);1<a.geometries.length?b.add(j):b=j}}for(e=0;e<a.cameras.length;e++)b=ha[a.cameras[e].url],b=new THREE.PerspectiveCamera(b.fov,b.aspect_ratio,b.znear,b.zfar);b.name=a.id||"";b.matrix=a.matrix;
-e=a.matrix.decompose();b.position=e[0];b.quaternion=e[1];b.useQuaternion=!0;b.scale=e[2];R.centerGeometry&&b.geometry&&(e=THREE.GeometryUtils.center(b.geometry),b.quaternion.multiplyVector3(e.multiplySelf(b.scale)),b.position.subSelf(e));for(e=0;e<a.nodes.length;e++)b.add(g(a.nodes[e],a));return b}function e(){this.init_from=this.id=""}function h(){this.type=this.name=this.id="";this.morph=this.skin=null}function i(){this.weights=this.targets=this.source=this.method=null}function k(){this.source=
-"";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function j(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function q(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=[];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function l(){this.type=this.sid="";this.data=[];this.obj=null}function n(){this.url="";this.skeleton=[];this.instance_material=[]}function r(){this.target=this.symbol=""}function m(){this.url=
-"";this.instance_material=[]}function o(){this.id="";this.mesh=null}function p(a){this.geometry=a.id;this.primitives=[];this.geometry3js=this.vertices=null}function s(){}function t(){this.material="";this.count=0;this.inputs=[];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function u(){this.source="";this.stride=this.count=0;this.params=[]}function v(){this.input={}}function w(){this.semantic="";this.offset=0;this.source="";this.set=0}function z(a){this.id=a;this.type=null}function x(){this.name=
+e=a.matrix.decompose();b.position=e[0];b.quaternion=e[1];b.useQuaternion=!0;b.scale=e[2];R.centerGeometry&&b.geometry&&(e=THREE.GeometryUtils.center(b.geometry),b.quaternion.multiplyVector3(e.multiplySelf(b.scale)),b.position.subSelf(e));for(e=0;e<a.nodes.length;e++)b.add(g(a.nodes[e],a));return b}function e(){this.init_from=this.id=""}function h(){this.type=this.name=this.id="";this.morph=this.skin=null}function i(){this.weights=this.targets=this.source=this.method=null}function j(){this.source=
+"";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function k(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function q(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=[];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function l(){this.type=this.sid="";this.data=[];this.obj=null}function n(){this.url="";this.skeleton=[];this.instance_material=[]}function r(){this.target=this.symbol=""}function m(){this.url=
+"";this.instance_material=[]}function p(){this.id="";this.mesh=null}function o(a){this.geometry=a.id;this.primitives=[];this.geometry3js=this.vertices=null}function s(){}function t(){this.material="";this.count=0;this.inputs=[];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function u(){this.source="";this.stride=this.count=0;this.params=[]}function v(){this.input={}}function w(){this.semantic="";this.offset=0;this.source="";this.set=0}function z(a){this.id=a;this.type=null}function x(){this.name=
 this.id="";this.instance_effect=null}function A(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texOpts=this.texcoord=this.texture=null}function F(a,b){this.type=a;this.effect=b;this.material=null}function E(a){this.effect=a;this.format=this.init_from=null}function J(a){this.effect=a;this.mipfilter=this.magfilter=this.minfilter=this.wrap_t=this.wrap_s=this.source=null}function G(){this.name=this.id="";this.sampler=this.surface=this.shader=
 this.id="";this.instance_effect=null}function A(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texOpts=this.texcoord=this.texture=null}function F(a,b){this.type=a;this.effect=b;this.material=null}function E(a){this.effect=a;this.format=this.init_from=null}function J(a){this.effect=a;this.mipfilter=this.magfilter=this.minfilter=this.wrap_t=this.wrap_s=this.source=null}function G(){this.name=this.id="";this.sampler=this.surface=this.shader=
-null}function B(){this.url=""}function H(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function D(a){this.animation=a;this.target=this.source="";this.member=this.arrIndices=this.arrSyntax=this.dotSyntax=this.sid=this.fullSid=null}function I(a){this.id="";this.animation=a;this.inputs=[];this.endTime=this.startTime=this.interpolation=this.strideOut=this.output=this.input=null;this.duration=0}function y(a){this.targets=[];this.time=a}function K(){this.name=this.id=""}function C(){this.url=
+null}function B(){this.url=""}function H(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function C(a){this.animation=a;this.target=this.source="";this.member=this.arrIndices=this.arrSyntax=this.dotSyntax=this.sid=this.fullSid=null}function I(a){this.id="";this.animation=a;this.inputs=[];this.endTime=this.startTime=this.interpolation=this.strideOut=this.output=this.input=null;this.duration=0}function y(a){this.targets=[];this.time=a}function K(){this.name=this.id=""}function D(){this.url=
 ""}function L(a){return"dae"==a?"http://www.collada.org/2005/11/COLLADASchema":null}function N(a){for(var a=S(a),b=[],c=0,d=a.length;c<d;c++)b.push(parseFloat(a[c]));return b}function M(a){for(var a=S(a),b=[],c=0,d=a.length;c<d;c++)b.push(parseInt(a[c],10));return b}function S(a){return 0<a.length?a.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s+/):[]}function O(a,b,c){return a.hasAttribute(b)?parseInt(a.getAttribute(b),10):c}function P(a,b){if(R.convertUpAxis&&$!==R.upAxis)switch(W){case "XtoY":var c=
 ""}function L(a){return"dae"==a?"http://www.collada.org/2005/11/COLLADASchema":null}function N(a){for(var a=S(a),b=[],c=0,d=a.length;c<d;c++)b.push(parseFloat(a[c]));return b}function M(a){for(var a=S(a),b=[],c=0,d=a.length;c<d;c++)b.push(parseInt(a[c],10));return b}function S(a){return 0<a.length?a.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s+/):[]}function O(a,b,c){return a.hasAttribute(b)?parseInt(a.getAttribute(b),10):c}function P(a,b){if(R.convertUpAxis&&$!==R.upAxis)switch(W){case "XtoY":var c=
 a[0];a[0]=b*a[1];a[1]=c;break;case "XtoZ":c=a[2];a[2]=a[1];a[1]=a[0];a[0]=c;break;case "YtoX":c=a[0];a[0]=a[1];a[1]=b*c;break;case "YtoZ":c=a[1];a[1]=b*a[2];a[2]=c;break;case "ZtoX":c=a[0];a[0]=a[1];a[1]=a[2];a[2]=c;break;case "ZtoY":c=a[1],a[1]=a[2],a[2]=b*c}}function ca(a,b){var c=[a[b],a[b+1],a[b+2]];P(c,-1);return new THREE.Vector3(c[0],c[1],c[2])}function da(a){if(R.convertUpAxis){var b=[a[0],a[4],a[8]];P(b,-1);a[0]=b[0];a[4]=b[1];a[8]=b[2];b=[a[1],a[5],a[9]];P(b,-1);a[1]=b[0];a[5]=b[1];a[9]=
 a[0];a[0]=b*a[1];a[1]=c;break;case "XtoZ":c=a[2];a[2]=a[1];a[1]=a[0];a[0]=c;break;case "YtoX":c=a[0];a[0]=a[1];a[1]=b*c;break;case "YtoZ":c=a[1];a[1]=b*a[2];a[2]=c;break;case "ZtoX":c=a[0];a[0]=a[1];a[1]=a[2];a[2]=c;break;case "ZtoY":c=a[1],a[1]=a[2],a[2]=b*c}}function ca(a,b){var c=[a[b],a[b+1],a[b+2]];P(c,-1);return new THREE.Vector3(c[0],c[1],c[2])}function da(a){if(R.convertUpAxis){var b=[a[0],a[4],a[8]];P(b,-1);a[0]=b[0];a[4]=b[1];a[8]=b[2];b=[a[1],a[5],a[9]];P(b,-1);a[1]=b[0];a[5]=b[1];a[9]=
 b[2];b=[a[2],a[6],a[10]];P(b,-1);a[2]=b[0];a[6]=b[1];a[10]=b[2];b=[a[0],a[1],a[2]];P(b,-1);a[0]=b[0];a[1]=b[1];a[2]=b[2];b=[a[4],a[5],a[6]];P(b,-1);a[4]=b[0];a[5]=b[1];a[6]=b[2];b=[a[8],a[9],a[10]];P(b,-1);a[8]=b[0];a[9]=b[1];a[10]=b[2];b=[a[3],a[7],a[11]];P(b,-1);a[3]=b[0];a[7]=b[1];a[11]=b[2]}return new THREE.Matrix4(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15])}var Q=null,Z=null,T,la=null,Y={},ea={},X={},U={},V={},fa={},ga={},ha={},ja,ia,ma,aa,ba,na=THREE.SmoothShading,
 b[2];b=[a[2],a[6],a[10]];P(b,-1);a[2]=b[0];a[6]=b[1];a[10]=b[2];b=[a[0],a[1],a[2]];P(b,-1);a[0]=b[0];a[1]=b[1];a[2]=b[2];b=[a[4],a[5],a[6]];P(b,-1);a[4]=b[0];a[5]=b[1];a[6]=b[2];b=[a[8],a[9],a[10]];P(b,-1);a[8]=b[0];a[9]=b[1];a[10]=b[2];b=[a[3],a[7],a[11]];P(b,-1);a[3]=b[0];a[7]=b[1];a[11]=b[2]}return new THREE.Matrix4(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15])}var Q=null,Z=null,T,la=null,Y={},ea={},X={},U={},V={},fa={},ga={},ha={},ja,ia,ma,aa,ba,na=THREE.SmoothShading,
-R={centerGeometry:!1,convertUpAxis:!1,subdivideFaces:!0,upAxis:"Y"},$="Y",W=null,ka=Math.PI/180;e.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if("init_from"==c.nodeName)this.init_from=c.textContent}return this};h.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.type="none";for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "skin":this.skin=(new k).parse(c);
+R={centerGeometry:!1,convertUpAxis:!1,subdivideFaces:!0,upAxis:"Y"},$="Y",W=null,ka=Math.PI/180;e.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if("init_from"==c.nodeName)this.init_from=c.textContent}return this};h.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.type="none";for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "skin":this.skin=(new j).parse(c);
 this.type=c.nodeName;break;case "morph":this.morph=(new i).parse(c),this.type=c.nodeName}}return this};i.prototype.parse=function(a){var b={},c=[],d;this.method=a.getAttribute("method");this.source=a.getAttribute("source").replace(/^#/,"");for(d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if(1==e.nodeType)switch(e.nodeName){case "source":e=(new z).parse(e);b[e.id]=e;break;case "targets":c=this.parseInputs(e);break;default:console.log(e.nodeName)}}for(d=0;d<c.length;d++)switch(a=c[d],e=b[a.source],
 this.type=c.nodeName;break;case "morph":this.morph=(new i).parse(c),this.type=c.nodeName}}return this};i.prototype.parse=function(a){var b={},c=[],d;this.method=a.getAttribute("method");this.source=a.getAttribute("source").replace(/^#/,"");for(d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if(1==e.nodeType)switch(e.nodeName){case "source":e=(new z).parse(e);b[e.id]=e;break;case "targets":c=this.parseInputs(e);break;default:console.log(e.nodeName)}}for(d=0;d<c.length;d++)switch(a=c[d],e=b[a.source],
-a.semantic){case "MORPH_TARGET":this.targets=e.read();break;case "MORPH_WEIGHT":this.weights=e.read()}return this};i.prototype.parseInputs=function(a){for(var b=[],c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "input":b.push((new w).parse(d))}}return b};k.prototype.parse=function(a){var b={},c,d;this.source=a.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var e=0;e<a.childNodes.length;e++){var f=a.childNodes[e];
-if(1==f.nodeType)switch(f.nodeName){case "bind_shape_matrix":f=N(f.textContent);this.bindShapeMatrix=da(f);break;case "source":f=(new z).parse(f);b[f.id]=f;break;case "joints":c=f;break;case "vertex_weights":d=f;break;default:console.log(f.nodeName)}}this.parseJoints(c,b);this.parseWeights(d,b);return this};k.prototype.parseJoints=function(a,b){for(var c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "input":var d=(new w).parse(d),e=b[d.source];if("JOINT"==
-d.semantic)this.joints=e.read();else if("INV_BIND_MATRIX"==d.semantic)this.invBindMatrices=e.read()}}};k.prototype.parseWeights=function(a,b){for(var c,d,e=[],f=0;f<a.childNodes.length;f++){var g=a.childNodes[f];if(1==g.nodeType)switch(g.nodeName){case "input":e.push((new w).parse(g));break;case "v":c=M(g.textContent);break;case "vcount":d=M(g.textContent)}}for(f=g=0;f<d.length;f++){for(var h=d[f],i=[],j=0;j<h;j++){for(var k={},m=0;m<e.length;m++){var l=e[m],n=c[g+l.offset];switch(l.semantic){case "JOINT":k.joint=
-n;break;case "WEIGHT":k.weight=b[l.source].data[n]}}i.push(k);g+=e.length}for(j=0;j<i.length;j++)i[j].index=f;this.weights.push(i)}};j.prototype.getChildById=function(a,b){for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildById(a,b);if(d)return d}return null};j.prototype.getChildBySid=function(a,b){for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildBySid(a,b);if(d)return d}return null};j.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");
+a.semantic){case "MORPH_TARGET":this.targets=e.read();break;case "MORPH_WEIGHT":this.weights=e.read()}return this};i.prototype.parseInputs=function(a){for(var b=[],c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "input":b.push((new w).parse(d))}}return b};j.prototype.parse=function(a){var b={},c,d;this.source=a.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var e=0;e<a.childNodes.length;e++){var f=a.childNodes[e];
+if(1==f.nodeType)switch(f.nodeName){case "bind_shape_matrix":f=N(f.textContent);this.bindShapeMatrix=da(f);break;case "source":f=(new z).parse(f);b[f.id]=f;break;case "joints":c=f;break;case "vertex_weights":d=f;break;default:console.log(f.nodeName)}}this.parseJoints(c,b);this.parseWeights(d,b);return this};j.prototype.parseJoints=function(a,b){for(var c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "input":var d=(new w).parse(d),e=b[d.source];if("JOINT"==
+d.semantic)this.joints=e.read();else if("INV_BIND_MATRIX"==d.semantic)this.invBindMatrices=e.read()}}};j.prototype.parseWeights=function(a,b){for(var c,d,e=[],f=0;f<a.childNodes.length;f++){var g=a.childNodes[f];if(1==g.nodeType)switch(g.nodeName){case "input":e.push((new w).parse(g));break;case "v":c=M(g.textContent);break;case "vcount":d=M(g.textContent)}}for(f=g=0;f<d.length;f++){for(var h=d[f],i=[],j=0;j<h;j++){for(var k={},m=0;m<e.length;m++){var l=e[m],n=c[g+l.offset];switch(l.semantic){case "JOINT":k.joint=
+n;break;case "WEIGHT":k.weight=b[l.source].data[n]}}i.push(k);g+=e.length}for(j=0;j<i.length;j++)i[j].index=f;this.weights.push(i)}};k.prototype.getChildById=function(a,b){for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildById(a,b);if(d)return d}return null};k.prototype.getChildBySid=function(a,b){for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildBySid(a,b);if(d)return d}return null};k.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");
 this.nodes=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "node":this.nodes.push((new q).parse(c))}}return this};q.prototype.getChannelForTransform=function(a){for(var b=0;b<this.channels.length;b++){var c=this.channels[b],d=c.target.split("/");d.shift();var e=d.shift(),f=0<=e.indexOf("."),g=0<=e.indexOf("("),h;if(f)d=e.split("."),e=d.shift(),d.shift();else if(g){h=e.split("(");e=h.shift();for(d=0;d<h.length;d++)h[d]=parseInt(h[d].replace(/\)/,
 this.nodes=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "node":this.nodes.push((new q).parse(c))}}return this};q.prototype.getChannelForTransform=function(a){for(var b=0;b<this.channels.length;b++){var c=this.channels[b],d=c.target.split("/");d.shift();var e=d.shift(),f=0<=e.indexOf("."),g=0<=e.indexOf("("),h;if(f)d=e.split("."),e=d.shift(),d.shift();else if(g){h=e.split("(");e=h.shift();for(d=0;d<h.length;d++)h[d]=parseInt(h[d].replace(/\)/,
 ""))}if(e==a)return c.info={sid:e,dotSyntax:f,arrSyntax:g,arrIndices:h},c}return null};q.prototype.getChildById=function(a,b){if(this.id==a)return this;if(b)for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildById(a,b);if(d)return d}return null};q.prototype.getChildBySid=function(a,b){if(this.sid==a)return this;if(b)for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildBySid(a,b);if(d)return d}return null};q.prototype.getTransformBySid=function(a){for(var b=0;b<this.transforms.length;b++)if(this.transforms[b].sid==
 ""))}if(e==a)return c.info={sid:e,dotSyntax:f,arrSyntax:g,arrIndices:h},c}return null};q.prototype.getChildById=function(a,b){if(this.id==a)return this;if(b)for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildById(a,b);if(d)return d}return null};q.prototype.getChildBySid=function(a,b){if(this.sid==a)return this;if(b)for(var c=0;c<this.nodes.length;c++){var d=this.nodes[c].getChildBySid(a,b);if(d)return d}return null};q.prototype.getTransformBySid=function(a){for(var b=0;b<this.transforms.length;b++)if(this.transforms[b].sid==
 a)return this.transforms[b];return null};q.prototype.parse=function(a){var b;this.id=a.getAttribute("id");this.sid=a.getAttribute("sid");this.name=a.getAttribute("name");this.type=a.getAttribute("type");this.type="JOINT"==this.type?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.cameras=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var c=0;c<a.childNodes.length;c++)if(b=a.childNodes[c],1==b.nodeType)switch(b.nodeName){case "node":this.nodes.push((new q).parse(b));
 a)return this.transforms[b];return null};q.prototype.parse=function(a){var b;this.id=a.getAttribute("id");this.sid=a.getAttribute("sid");this.name=a.getAttribute("name");this.type=a.getAttribute("type");this.type="JOINT"==this.type?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.cameras=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var c=0;c<a.childNodes.length;c++)if(b=a.childNodes[c],1==b.nodeType)switch(b.nodeName){case "node":this.nodes.push((new q).parse(b));
-break;case "instance_camera":this.cameras.push((new C).parse(b));break;case "instance_controller":this.controllers.push((new n).parse(b));break;case "instance_geometry":this.geometries.push((new m).parse(b));break;case "instance_light":break;case "instance_node":b=b.getAttribute("url").replace(/^#/,"");(b=Q.evaluate(".//dae:library_nodes//dae:node[@id='"+b+"']",Q,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new q).parse(b));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new l).parse(b));
+break;case "instance_camera":this.cameras.push((new D).parse(b));break;case "instance_controller":this.controllers.push((new n).parse(b));break;case "instance_geometry":this.geometries.push((new m).parse(b));break;case "instance_light":break;case "instance_node":b=b.getAttribute("url").replace(/^#/,"");(b=Q.evaluate(".//dae:library_nodes//dae:node[@id='"+b+"']",Q,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new q).parse(b));break;case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new l).parse(b));
 break;case "extra":break;default:console.log(b.nodeName)}a=[];c=1E6;b=-1E6;for(var d in X)for(var e=X[d],f=0;f<e.channel.length;f++){var g=e.channel[f],h=e.sampler[f];d=g.target.split("/")[0];if(d==this.id)h.create(),g.sampler=h,c=Math.min(c,h.startTime),b=Math.max(b,h.endTime),a.push(g)}if(a.length)this.startTime=c,this.endTime=b;if((this.channels=a)&&this.channels.length){d=[];a=[];c=0;for(e=this.channels.length;c<e;c++){b=this.channels[c];f=b.fullSid;g=b.member;if(R.convertUpAxis)switch(g){case "X":switch(W){case "XtoY":case "XtoZ":case "YtoX":g=
 break;case "extra":break;default:console.log(b.nodeName)}a=[];c=1E6;b=-1E6;for(var d in X)for(var e=X[d],f=0;f<e.channel.length;f++){var g=e.channel[f],h=e.sampler[f];d=g.target.split("/")[0];if(d==this.id)h.create(),g.sampler=h,c=Math.min(c,h.startTime),b=Math.max(b,h.endTime),a.push(g)}if(a.length)this.startTime=c,this.endTime=b;if((this.channels=a)&&this.channels.length){d=[];a=[];c=0;for(e=this.channels.length;c<e;c++){b=this.channels[c];f=b.fullSid;g=b.member;if(R.convertUpAxis)switch(g){case "X":switch(W){case "XtoY":case "XtoZ":case "YtoX":g=
 "Y";break;case "ZtoX":g="Z"}break;case "Y":switch(W){case "XtoY":case "YtoX":case "ZtoX":g="X";break;case "XtoZ":case "YtoZ":case "ZtoY":g="Z"}break;case "Z":switch(W){case "XtoZ":g="X";break;case "YtoZ":case "ZtoX":case "ZtoY":g="Y"}}var h=b.sampler,i=h.input,j=this.getTransformBySid(b.sid);if(j){-1===a.indexOf(f)&&a.push(f);b=0;for(var k=i.length;b<k;b++){var p=i[b],o=h.getData(j.type,b),r;r=null;for(var s=0,t=d.length;s<t&&null==r;s++){var u=d[s];if(u.time===p)r=u;else if(u.time>p)break}if(!r){r=
 "Y";break;case "ZtoX":g="Z"}break;case "Y":switch(W){case "XtoY":case "YtoX":case "ZtoX":g="X";break;case "XtoZ":case "YtoZ":case "ZtoY":g="Z"}break;case "Z":switch(W){case "XtoZ":g="X";break;case "YtoZ":case "ZtoX":case "ZtoY":g="Y"}}var h=b.sampler,i=h.input,j=this.getTransformBySid(b.sid);if(j){-1===a.indexOf(f)&&a.push(f);b=0;for(var k=i.length;b<k;b++){var p=i[b],o=h.getData(j.type,b),r;r=null;for(var s=0,t=d.length;s<t&&null==r;s++){var u=d[s];if(u.time===p)r=u;else if(u.time>p)break}if(!r){r=
 new y(p);s=-1;t=0;for(u=d.length;t<u&&-1==s;t++)d[t].time>=p&&(s=t);p=s;d.splice(-1==p?d.length:p,0,r)}r.addTarget(f,j,g,o)}}else console.log('Could not find transform "'+b.sid+'" in node '+this.id)}for(c=0;c<a.length;c++){e=a[c];for(b=0;b<d.length;b++)if(r=d[b],!r.hasTarget(e)){h=d;f=r;j=b;g=e;i=void 0;a:{i=j?j-1:0;for(i=0<=i?i:i+h.length;0<=i;i--)if(k=h[i],k.hasTarget(g)){i=k;break a}i=null}k=void 0;a:{for(j+=1;j<h.length;j++)if(k=h[j],k.hasTarget(g))break a;k=null}if(i&&k){h=(f.time-i.time)/(k.time-
 new y(p);s=-1;t=0;for(u=d.length;t<u&&-1==s;t++)d[t].time>=p&&(s=t);p=s;d.splice(-1==p?d.length:p,0,r)}r.addTarget(f,j,g,o)}}else console.log('Could not find transform "'+b.sid+'" in node '+this.id)}for(c=0;c<a.length;c++){e=a[c];for(b=0;b<d.length;b++)if(r=d[b],!r.hasTarget(e)){h=d;f=r;j=b;g=e;i=void 0;a:{i=j?j-1:0;for(i=0<=i?i:i+h.length;0<=i;i--)if(k=h[i],k.hasTarget(g)){i=k;break a}i=null}k=void 0;a:{for(j+=1;j<h.length;j++)if(k=h[j],k.hasTarget(g))break a;k=null}if(i&&k){h=(f.time-i.time)/(k.time-
@@ -282,9 +282,9 @@ return this};l.prototype.convert=function(){switch(this.type){case "matrix":this
 break;case "translate":a.translate(this.obj);break;case "rotate":a.rotateByAxis(this.obj,this.angle);break;case "scale":a.scale(this.obj)}};l.prototype.update=function(a,b){switch(this.type){case "matrix":console.log("Currently not handling matrix transform updates");break;case "translate":case "scale":switch(b){case "X":this.obj.x=a;break;case "Y":this.obj.y=a;break;case "Z":this.obj.z=a;break;default:this.obj.x=a[0],this.obj.y=a[1],this.obj.z=a[2]}break;case "rotate":switch(b){case "X":this.obj.x=
 break;case "translate":a.translate(this.obj);break;case "rotate":a.rotateByAxis(this.obj,this.angle);break;case "scale":a.scale(this.obj)}};l.prototype.update=function(a,b){switch(this.type){case "matrix":console.log("Currently not handling matrix transform updates");break;case "translate":case "scale":switch(b){case "X":this.obj.x=a;break;case "Y":this.obj.y=a;break;case "Z":this.obj.z=a;break;default:this.obj.x=a[0],this.obj.y=a[1],this.obj.z=a[2]}break;case "rotate":switch(b){case "X":this.obj.x=
 a;break;case "Y":this.obj.y=a;break;case "Z":this.obj.z=a;break;case "ANGLE":this.angle=a*ka;break;default:this.obj.x=a[0],this.obj.y=a[1],this.obj.z=a[2],this.angle=a[3]*ka}}};n.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "skeleton":this.skeleton.push(c.textContent.replace(/^#/,""));break;case "bind_material":if(c=Q.evaluate(".//dae:instance_material",
 a;break;case "Y":this.obj.y=a;break;case "Z":this.obj.z=a;break;case "ANGLE":this.angle=a*ka;break;default:this.obj.x=a[0],this.obj.y=a[1],this.obj.z=a[2],this.angle=a[3]*ka}}};n.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "skeleton":this.skeleton.push(c.textContent.replace(/^#/,""));break;case "bind_material":if(c=Q.evaluate(".//dae:instance_material",
 c,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(var d=c.iterateNext();d;)this.instance_material.push((new r).parse(d)),d=c.iterateNext()}}return this};r.prototype.parse=function(a){this.symbol=a.getAttribute("symbol");this.target=a.getAttribute("target").replace(/^#/,"");return this};m.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType&&"bind_material"==c.nodeName){if(a=
 c,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(var d=c.iterateNext();d;)this.instance_material.push((new r).parse(d)),d=c.iterateNext()}}return this};r.prototype.parse=function(a){this.symbol=a.getAttribute("symbol");this.target=a.getAttribute("target").replace(/^#/,"");return this};m.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType&&"bind_material"==c.nodeName){if(a=
-Q.evaluate(".//dae:instance_material",c,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(b=a.iterateNext();b;)this.instance_material.push((new r).parse(b)),b=a.iterateNext();break}}return this};o.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "mesh":this.mesh=(new p(this)).parse(c)}}return this};p.prototype.parse=function(a){this.primitives=[];var b;for(b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];
+Q.evaluate(".//dae:instance_material",c,L,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(b=a.iterateNext();b;)this.instance_material.push((new r).parse(b)),b=a.iterateNext();break}}return this};p.prototype.parse=function(a){this.id=a.getAttribute("id");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];switch(c.nodeName){case "mesh":this.mesh=(new o(this)).parse(c)}}return this};o.prototype.parse=function(a){this.primitives=[];var b;for(b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];
 switch(c.nodeName){case "source":var d=c.getAttribute("id");void 0==Y[d]&&(Y[d]=(new z(d)).parse(c));break;case "vertices":this.vertices=(new v).parse(c);break;case "triangles":this.primitives.push((new t).parse(c));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new s).parse(c))}}this.geometry3js=new THREE.Geometry;a=Y[this.vertices.input.POSITION.source].data;for(b=0;b<a.length;b+=3)this.geometry3js.vertices.push(new THREE.Vertex(ca(a,
 switch(c.nodeName){case "source":var d=c.getAttribute("id");void 0==Y[d]&&(Y[d]=(new z(d)).parse(c));break;case "vertices":this.vertices=(new v).parse(c);break;case "triangles":this.primitives.push((new t).parse(c));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new s).parse(c))}}this.geometry3js=new THREE.Geometry;a=Y[this.vertices.input.POSITION.source].data;for(b=0;b<a.length;b+=3)this.geometry3js.vertices.push(new THREE.Vertex(ca(a,
-b)));for(b=0;b<this.primitives.length;b++)a=this.primitives[b],a.setVertices(this.vertices),this.handlePrimitive(a,this.geometry3js);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.calcNormals&&(this.geometry3js.computeVertexNormals(),delete this.geometry3js.calcNormals);this.geometry3js.computeBoundingBox();return this};p.prototype.handlePrimitive=function(a,b){var c=0,d,e,f=a.p,g=a.inputs,h,i,j,k,m=0,l=3,n=0,q=[];for(d=0;d<g.length;d++){h=g[d];var p=h.offset+
+b)));for(b=0;b<this.primitives.length;b++)a=this.primitives[b],a.setVertices(this.vertices),this.handlePrimitive(a,this.geometry3js);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.calcNormals&&(this.geometry3js.computeVertexNormals(),delete this.geometry3js.calcNormals);this.geometry3js.computeBoundingBox();return this};o.prototype.handlePrimitive=function(a,b){var c=0,d,e,f=a.p,g=a.inputs,h,i,j,k,m=0,l=3,n=0,q=[];for(d=0;d<g.length;d++){h=g[d];var p=h.offset+
 1,n=n<p?p:n;switch(h.semantic){case "TEXCOORD":q.push(h.set)}}for(;c<f.length;){var o=[],r=[],p={},s=[];a.vcount&&(l=a.vcount[m++]);for(d=0;d<l;d++)for(e=0;e<g.length;e++)switch(h=g[e],k=Y[h.source],i=f[c+d*n+h.offset],j=k.accessor.params.length,j*=i,h.semantic){case "VERTEX":o.push(i);break;case "NORMAL":r.push(ca(k.data,j));break;case "TEXCOORD":void 0===p[h.set]&&(p[h.set]=[]);p[h.set].push(new THREE.UV(k.data[j],1-k.data[j+1]));break;case "COLOR":s.push((new THREE.Color).setRGB(k.data[j],k.data[j+
 1,n=n<p?p:n;switch(h.semantic){case "TEXCOORD":q.push(h.set)}}for(;c<f.length;){var o=[],r=[],p={},s=[];a.vcount&&(l=a.vcount[m++]);for(d=0;d<l;d++)for(e=0;e<g.length;e++)switch(h=g[e],k=Y[h.source],i=f[c+d*n+h.offset],j=k.accessor.params.length,j*=i,h.semantic){case "VERTEX":o.push(i);break;case "NORMAL":r.push(ca(k.data,j));break;case "TEXCOORD":void 0===p[h.set]&&(p[h.set]=[]);p[h.set].push(new THREE.UV(k.data[j],1-k.data[j+1]));break;case "COLOR":s.push((new THREE.Color).setRGB(k.data[j],k.data[j+
 1],k.data[j+2]))}e=null;d=[];if(0==r.length)if(h=this.vertices.input.NORMAL){k=Y[h.source];j=k.accessor.params.length;h=0;for(i=o.length;h<i;h++)r.push(ca(k.data,o[h]*j))}else b.calcNormals=!0;if(3===l)d.push(new THREE.Face3(o[0],o[1],o[2],r,s.length?s:new THREE.Color));else if(4===l)d.push(new THREE.Face4(o[0],o[1],o[2],o[3],r,s.length?s:new THREE.Color));else if(4<l&&R.subdivideFaces){s=s.length?s:new THREE.Color;for(e=1;e<l-1;)d.push(new THREE.Face3(o[0],o[e],o[e+1],[r[0],r[e++],r[e]],s))}if(d.length){h=
 1],k.data[j+2]))}e=null;d=[];if(0==r.length)if(h=this.vertices.input.NORMAL){k=Y[h.source];j=k.accessor.params.length;h=0;for(i=o.length;h<i;h++)r.push(ca(k.data,o[h]*j))}else b.calcNormals=!0;if(3===l)d.push(new THREE.Face3(o[0],o[1],o[2],r,s.length?s:new THREE.Color));else if(4===l)d.push(new THREE.Face4(o[0],o[1],o[2],o[3],r,s.length?s:new THREE.Color));else if(4<l&&R.subdivideFaces){s=s.length?s:new THREE.Color;for(e=1;e<l-1;)d.push(new THREE.Face3(o[0],o[e],o[e+1],[r[0],r[e++],r[e]],s))}if(d.length){h=
 0;for(i=d.length;h<i;h++){e=d[h];e.daeMaterial=a.material;b.faces.push(e);for(e=0;e<q.length;e++)o=p[q[e]],o=4<l?[o[0],o[h+1],o[h+2]]:4===l?[o[0],o[1],o[2],o[3]]:[o[0],o[1],o[2]],b.faceVertexUvs[e]||(b.faceVertexUvs[e]=[]),b.faceVertexUvs[e].push(o)}}else console.log("dropped face with vcount "+l+" for geometry with id: "+b.id);c+=n*l}};s.prototype=new t;s.prototype.constructor=s;t.prototype.setVertices=function(a){for(var b=0;b<this.inputs.length;b++)if(this.inputs[b].source==a.id)this.inputs[b].source=
 0;for(i=d.length;h<i;h++){e=d[h];e.daeMaterial=a.material;b.faces.push(e);for(e=0;e<q.length;e++)o=p[q[e]],o=4<l?[o[0],o[h+1],o[h+2]]:4===l?[o[0],o[1],o[2],o[3]]:[o[0],o[1],o[2]],b.faceVertexUvs[e]||(b.faceVertexUvs[e]=[]),b.faceVertexUvs[e].push(o)}}else console.log("dropped face with vcount "+l+" for geometry with id: "+b.id);c+=n*l}};s.prototype=new t;s.prototype.constructor=s;t.prototype.setVertices=function(a){for(var b=0;b<this.inputs.length;b++)if(this.inputs[b].source==a.id)this.inputs[b].source=
@@ -302,59 +302,59 @@ a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeNam
 c.textContent;break;case "mipfilter":this.mipfilter=c.textContent;break;case "wrap_s":this.wrap_s=c.textContent;break;case "wrap_t":this.wrap_t=c.textContent;break;default:console.log("unhandled Sampler2D prop: "+c.nodeName)}}return this};G.prototype.create=function(){if(null==this.shader)return null};G.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.shader=null;for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(c))}}return this};
 c.textContent;break;case "mipfilter":this.mipfilter=c.textContent;break;case "wrap_s":this.wrap_s=c.textContent;break;case "wrap_t":this.wrap_t=c.textContent;break;default:console.log("unhandled Sampler2D prop: "+c.nodeName)}}return this};G.prototype.create=function(){if(null==this.shader)return null};G.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");this.shader=null;for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(c))}}return this};
 G.prototype.parseNewparam=function(a){for(var b=a.getAttribute("sid"),c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "surface":this.surface=(new E(this)).parse(d);this.surface.sid=b;break;case "sampler2D":this.sampler=(new J(this)).parse(d);this.sampler.sid=b;break;case "extra":break;default:console.log(d.nodeName)}}};G.prototype.parseProfileCOMMON=function(a){for(var b,c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "profile_COMMON":this.parseProfileCOMMON(d);
 G.prototype.parseNewparam=function(a){for(var b=a.getAttribute("sid"),c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "surface":this.surface=(new E(this)).parse(d);this.surface.sid=b;break;case "sampler2D":this.sampler=(new J(this)).parse(d);this.sampler.sid=b;break;case "extra":break;default:console.log(d.nodeName)}}};G.prototype.parseProfileCOMMON=function(a){for(var b,c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(1==d.nodeType)switch(d.nodeName){case "profile_COMMON":this.parseProfileCOMMON(d);
 break;case "technique":b=d;break;case "newparam":this.parseNewparam(d);break;case "extra":break;default:console.log(d.nodeName)}}return b};G.prototype.parseTechnique=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "constant":case "lambert":case "blinn":case "phong":this.shader=(new F(c.nodeName,this)).parse(c)}}};B.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");return this};H.prototype.parse=function(a){this.id=
 break;case "technique":b=d;break;case "newparam":this.parseNewparam(d);break;case "extra":break;default:console.log(d.nodeName)}}return b};G.prototype.parseTechnique=function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "constant":case "lambert":case "blinn":case "phong":this.shader=(new F(c.nodeName,this)).parse(c)}}};B.prototype.parse=function(a){this.url=a.getAttribute("url").replace(/^#/,"");return this};H.prototype.parse=function(a){this.id=
-a.getAttribute("id");this.name=a.getAttribute("name");this.source={};for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "source":c=(new z).parse(c);this.source[c.id]=c;break;case "sampler":this.sampler.push((new I(this)).parse(c));break;case "channel":this.channel.push((new D(this)).parse(c))}}return this};D.prototype.parse=function(a){this.source=a.getAttribute("source").replace(/^#/,"");this.target=a.getAttribute("target");var b=this.target.split("/");
+a.getAttribute("id");this.name=a.getAttribute("name");this.source={};for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "source":c=(new z).parse(c);this.source[c.id]=c;break;case "sampler":this.sampler.push((new I(this)).parse(c));break;case "channel":this.channel.push((new C(this)).parse(c))}}return this};C.prototype.parse=function(a){this.source=a.getAttribute("source").replace(/^#/,"");this.target=a.getAttribute("target");var b=this.target.split("/");
 b.shift();var a=b.shift(),c=0<=a.indexOf("."),d=0<=a.indexOf("(");if(c)b=a.split("."),this.sid=b.shift(),this.member=b.shift();else if(d){b=a.split("(");this.sid=b.shift();for(var e=0;e<b.length;e++)b[e]=parseInt(b[e].replace(/\)/,""));this.arrIndices=b}else this.sid=a;this.fullSid=a;this.dotSyntax=c;this.arrSyntax=d;return this};I.prototype.parse=function(a){this.id=a.getAttribute("id");this.inputs=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "input":this.inputs.push((new w).parse(c))}}return this};
 b.shift();var a=b.shift(),c=0<=a.indexOf("."),d=0<=a.indexOf("(");if(c)b=a.split("."),this.sid=b.shift(),this.member=b.shift();else if(d){b=a.split("(");this.sid=b.shift();for(var e=0;e<b.length;e++)b[e]=parseInt(b[e].replace(/\)/,""));this.arrIndices=b}else this.sid=a;this.fullSid=a;this.dotSyntax=c;this.arrSyntax=d;return this};I.prototype.parse=function(a){this.id=a.getAttribute("id");this.inputs=[];for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "input":this.inputs.push((new w).parse(c))}}return this};
 I.prototype.create=function(){for(var a=0;a<this.inputs.length;a++){var b=this.inputs[a],c=this.animation.source[b.source];switch(b.semantic){case "INPUT":this.input=c.read();break;case "OUTPUT":this.output=c.read();this.strideOut=c.accessor.stride;break;case "INTERPOLATION":this.interpolation=c.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(b.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(a=
 I.prototype.create=function(){for(var a=0;a<this.inputs.length;a++){var b=this.inputs[a],c=this.animation.source[b.source];switch(b.semantic){case "INPUT":this.input=c.read();break;case "OUTPUT":this.output=c.read();this.strideOut=c.accessor.stride;break;case "INTERPOLATION":this.interpolation=c.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(b.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(a=
 0;a<this.input.length;a++)this.startTime=Math.min(this.startTime,this.input[a]),this.endTime=Math.max(this.endTime,this.input[a]);this.duration=this.endTime-this.startTime}};I.prototype.getData=function(a,b){var c;if(1<this.strideOut){c=[];for(var b=b*this.strideOut,d=0;d<this.strideOut;++d)c[d]=this.output[b+d];if(3===this.strideOut)switch(a){case "rotate":case "translate":P(c,-1);break;case "scale":P(c,1)}}else c=this.output[b];return c};y.prototype.addTarget=function(a,b,c,d){this.targets.push({sid:a,
 0;a<this.input.length;a++)this.startTime=Math.min(this.startTime,this.input[a]),this.endTime=Math.max(this.endTime,this.input[a]);this.duration=this.endTime-this.startTime}};I.prototype.getData=function(a,b){var c;if(1<this.strideOut){c=[];for(var b=b*this.strideOut,d=0;d<this.strideOut;++d)c[d]=this.output[b+d];if(3===this.strideOut)switch(a){case "rotate":case "translate":P(c,-1);break;case "scale":P(c,1)}}else c=this.output[b];return c};y.prototype.addTarget=function(a,b,c,d){this.targets.push({sid:a,
 member:c,transform:b,data:d})};y.prototype.apply=function(a){for(var b=0;b<this.targets.length;++b){var c=this.targets[b];(!a||c.sid===a)&&c.transform.update(c.data,c.member)}};y.prototype.getTarget=function(a){for(var b=0;b<this.targets.length;++b)if(this.targets[b].sid===a)return this.targets[b];return null};y.prototype.hasTarget=function(a){for(var b=0;b<this.targets.length;++b)if(this.targets[b].sid===a)return!0;return!1};y.prototype.interpolate=function(a,b){for(var c=0;c<this.targets.length;++c){var d=
 member:c,transform:b,data:d})};y.prototype.apply=function(a){for(var b=0;b<this.targets.length;++b){var c=this.targets[b];(!a||c.sid===a)&&c.transform.update(c.data,c.member)}};y.prototype.getTarget=function(a){for(var b=0;b<this.targets.length;++b)if(this.targets[b].sid===a)return this.targets[b];return null};y.prototype.hasTarget=function(a){for(var b=0;b<this.targets.length;++b)if(this.targets[b].sid===a)return!0;return!1};y.prototype.interpolate=function(a,b){for(var c=0;c<this.targets.length;++c){var d=
 this.targets[c],e=a.getTarget(d.sid);if(e){var f=(b-this.time)/(a.time-this.time),g=e.data,h=d.data;if(0>f||1<f)console.log("Key.interpolate: Warning! Scale out of bounds:"+f),f=0>f?0:1;if(h.length)for(var e=[],i=0;i<h.length;++i)e[i]=h[i]+(g[i]-h[i])*f;else e=h+(g-h)*f}else e=d.data;d.transform.update(e,d.member)}};K.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "optics":this.parseOptics(c)}}return this};
 this.targets[c],e=a.getTarget(d.sid);if(e){var f=(b-this.time)/(a.time-this.time),g=e.data,h=d.data;if(0>f||1<f)console.log("Key.interpolate: Warning! Scale out of bounds:"+f),f=0>f?0:1;if(h.length)for(var e=[],i=0;i<h.length;++i)e[i]=h[i]+(g[i]-h[i])*f;else e=h+(g-h)*f}else e=d.data;d.transform.update(e,d.member)}};K.prototype.parse=function(a){this.id=a.getAttribute("id");this.name=a.getAttribute("name");for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(1==c.nodeType)switch(c.nodeName){case "optics":this.parseOptics(c)}}return this};
-K.prototype.parseOptics=function(a){for(var b=0;b<a.childNodes.length;b++)if("technique_common"==a.childNodes[b].nodeName)for(var c=a.childNodes[b],d=0;d<c.childNodes.length;d++)if("perspective"==c.childNodes[d].nodeName)for(var e=c.childNodes[d],f=0;f<e.childNodes.length;f++){var g=e.childNodes[f];switch(g.nodeName){case "xfov":this.fov=g.textContent;break;case "znear":this.znear=0.4;break;case "zfar":this.zfar=1E15;break;case "aspect_ratio":this.aspect_ratio=g.textContent}}return this};C.prototype.parse=
+K.prototype.parseOptics=function(a){for(var b=0;b<a.childNodes.length;b++)if("technique_common"==a.childNodes[b].nodeName)for(var c=a.childNodes[b],d=0;d<c.childNodes.length;d++)if("perspective"==c.childNodes[d].nodeName)for(var e=c.childNodes[d],f=0;f<e.childNodes.length;f++){var g=e.childNodes[f];switch(g.nodeName){case "xfov":this.fov=g.textContent;break;case "znear":this.znear=0.4;break;case "zfar":this.zfar=1E15;break;case "aspect_ratio":this.aspect_ratio=g.textContent}}return this};D.prototype.parse=
 function(a){this.url=a.getAttribute("url").replace(/^#/,"");return this};return{load:function(b,c,d){var e=0;if(document.implementation&&document.implementation.createDocument){var f=new XMLHttpRequest;f.overrideMimeType&&f.overrideMimeType("text/xml");f.onreadystatechange=function(){if(4==f.readyState){if(0==f.status||200==f.status)f.responseXML?(la=c,a(f.responseXML,void 0,b)):console.error("ColladaLoader: Empty or non-existing file ("+b+")")}else 3==f.readyState&&d&&(0==e&&(e=f.getResponseHeader("Content-Length")),
 function(a){this.url=a.getAttribute("url").replace(/^#/,"");return this};return{load:function(b,c,d){var e=0;if(document.implementation&&document.implementation.createDocument){var f=new XMLHttpRequest;f.overrideMimeType&&f.overrideMimeType("text/xml");f.onreadystatechange=function(){if(4==f.readyState){if(0==f.status||200==f.status)f.responseXML?(la=c,a(f.responseXML,void 0,b)):console.error("ColladaLoader: Empty or non-existing file ("+b+")")}else 3==f.readyState&&d&&(0==e&&(e=f.getResponseHeader("Content-Length")),
 d({total:e,loaded:f.responseText.length}))};f.open("GET",b,!0);f.send(null)}else alert("Don't know how to parse XML!")},parse:a,setPreferredShading:function(a){na=a},applySkin:f,geometries:V,options:R}};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;
 d({total:e,loaded:f.responseText.length}))};f.open("GET",b,!0);f.send(null)}else alert("Don't know how to parse XML!")},parse:a,setPreferredShading:function(a){na=a},applySkin:f,geometries:V,options:R}};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,b,c){if(a instanceof Object)console.warn("DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath )."),c=a,a=c.model,b=c.callback,c=c.texture_path;c=c?c:this.extractUrlbase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.load=function(a,b,c){if(a instanceof Object)console.warn("DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath )."),c=a,a=c.model,b=c.callback,c=c.texture_path;c=c?c:this.extractUrlbase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,f){var g=new XMLHttpRequest,e=0;g.onreadystatechange=function(){if(g.readyState===g.DONE)if(200===g.status||0===g.status){var h;try{g.responseText?h=JSON.parse(g.responseText):console.warn("EMPTY: ["+b+"] seems to be unreachable or file there is empty")}catch(i){console.warn("DEPRECATED: ["+b+"] seems to be using old model format or JSON is invalid")}h&&a.createModel(h,c,d);a.onLoadComplete()}else console.error("Couldn't load ["+b+"] ["+g.status+
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,f){var g=new XMLHttpRequest,e=0;g.onreadystatechange=function(){if(g.readyState===g.DONE)if(200===g.status||0===g.status){var h;try{g.responseText?h=JSON.parse(g.responseText):console.warn("EMPTY: ["+b+"] seems to be unreachable or file there is empty")}catch(i){console.warn("DEPRECATED: ["+b+"] seems to be using old model format or JSON is invalid")}h&&a.createModel(h,c,d);a.onLoadComplete()}else console.error("Couldn't load ["+b+"] ["+g.status+
 "]");else g.readyState===g.LOADING?f&&(0===e&&(e=g.getResponseHeader("Content-Length")),f({total:e,loaded:g.responseText.length})):g.readyState===g.HEADERS_RECEIVED&&(e=g.getResponseHeader("Content-Length"))};g.open("GET",b,!0);g.overrideMimeType&&g.overrideMimeType("text/plain; charset=x-user-defined");g.setRequestHeader("Content-Type","text/plain");g.send(null)};
 "]");else g.readyState===g.LOADING?f&&(0===e&&(e=g.getResponseHeader("Content-Length")),f({total:e,loaded:g.responseText.length})):g.readyState===g.HEADERS_RECEIVED&&(e=g.getResponseHeader("Content-Length"))};g.open("GET",b,!0);g.overrideMimeType&&g.overrideMimeType("text/plain; charset=x-user-defined");g.setRequestHeader("Content-Type","text/plain");g.send(null)};
-THREE.JSONLoader.prototype.createModel=function(a,b,c){var d=new THREE.Geometry,f=void 0!==a.scale?1/a.scale:1;this.initMaterials(d,a.materials,c);(function(b){if(void 0===a.metadata||void 0===a.metadata.formatVersion||3!==a.metadata.formatVersion)console.error("Deprecated file format.");else{var c,f,i,k,j,q,l,n,r,m,o,p,s,t,u=a.faces;q=a.vertices;var v=a.normals,w=a.colors,z=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&z++;for(c=0;c<z;c++)d.faceUvs[c]=[],d.faceVertexUvs[c]=[];k=0;for(j=q.length;k<
-j;)l=new THREE.Vertex,l.position.x=q[k++]*b,l.position.y=q[k++]*b,l.position.z=q[k++]*b,d.vertices.push(l);k=0;for(j=u.length;k<j;){b=u[k++];q=b&1;i=b&2;c=b&4;f=b&8;n=b&16;l=b&32;m=b&64;b&=128;q?(o=new THREE.Face4,o.a=u[k++],o.b=u[k++],o.c=u[k++],o.d=u[k++],q=4):(o=new THREE.Face3,o.a=u[k++],o.b=u[k++],o.c=u[k++],q=3);if(i)i=u[k++],o.materialIndex=i;i=d.faces.length;if(c)for(c=0;c<z;c++)p=a.uvs[c],r=u[k++],t=p[2*r],r=p[2*r+1],d.faceUvs[c][i]=new THREE.UV(t,r);if(f)for(c=0;c<z;c++){p=a.uvs[c];s=[];
-for(f=0;f<q;f++)r=u[k++],t=p[2*r],r=p[2*r+1],s[f]=new THREE.UV(t,r);d.faceVertexUvs[c][i]=s}if(n)n=3*u[k++],f=new THREE.Vector3,f.x=v[n++],f.y=v[n++],f.z=v[n],o.normal=f;if(l)for(c=0;c<q;c++)n=3*u[k++],f=new THREE.Vector3,f.x=v[n++],f.y=v[n++],f.z=v[n],o.vertexNormals.push(f);if(m)l=u[k++],l=new THREE.Color(w[l]),o.color=l;if(b)for(c=0;c<q;c++)l=u[k++],l=new THREE.Color(w[l]),o.vertexColors.push(l);d.faces.push(o)}}})(f);(function(){var b,c,f,i;if(a.skinWeights)for(b=0,c=a.skinWeights.length;b<c;b+=
-2)f=a.skinWeights[b],i=a.skinWeights[b+1],d.skinWeights.push(new THREE.Vector4(f,i,0,0));if(a.skinIndices)for(b=0,c=a.skinIndices.length;b<c;b+=2)f=a.skinIndices[b],i=a.skinIndices[b+1],d.skinIndices.push(new THREE.Vector4(f,i,0,0));d.bones=a.bones;d.animation=a.animation})();(function(b){if(void 0!==a.morphTargets){var c,f,i,k,j,q,l,n,r;for(c=0,f=a.morphTargets.length;c<f;c++){d.morphTargets[c]={};d.morphTargets[c].name=a.morphTargets[c].name;d.morphTargets[c].vertices=[];n=d.morphTargets[c].vertices;
-r=a.morphTargets[c].vertices;for(i=0,k=r.length;i<k;i+=3)j=r[i]*b,q=r[i+1]*b,l=r[i+2]*b,n.push(new THREE.Vertex(new THREE.Vector3(j,q,l)))}}if(void 0!==a.morphColors)for(c=0,f=a.morphColors.length;c<f;c++){d.morphColors[c]={};d.morphColors[c].name=a.morphColors[c].name;d.morphColors[c].colors=[];k=d.morphColors[c].colors;j=a.morphColors[c].colors;for(b=0,i=j.length;b<i;b+=3)q=new THREE.Color(16755200),q.setRGB(j[b],j[b+1],j[b+2]),k.push(q)}})(f);d.computeCentroids();d.computeFaceNormals();this.hasNormals(d)&&
+THREE.JSONLoader.prototype.createModel=function(a,b,c){var d=new THREE.Geometry,f=void 0!==a.scale?1/a.scale:1;this.initMaterials(d,a.materials,c);(function(b){if(void 0===a.metadata||void 0===a.metadata.formatVersion||3!==a.metadata.formatVersion)console.error("Deprecated file format.");else{var c,f,i,j,k,q,l,n,r,m,p,o,s,t,u=a.faces;q=a.vertices;var v=a.normals,w=a.colors,z=0;for(c=0;c<a.uvs.length;c++)a.uvs[c].length&&z++;for(c=0;c<z;c++)d.faceUvs[c]=[],d.faceVertexUvs[c]=[];j=0;for(k=q.length;j<
+k;)l=new THREE.Vertex,l.position.x=q[j++]*b,l.position.y=q[j++]*b,l.position.z=q[j++]*b,d.vertices.push(l);j=0;for(k=u.length;j<k;){b=u[j++];q=b&1;i=b&2;c=b&4;f=b&8;n=b&16;l=b&32;m=b&64;b&=128;q?(p=new THREE.Face4,p.a=u[j++],p.b=u[j++],p.c=u[j++],p.d=u[j++],q=4):(p=new THREE.Face3,p.a=u[j++],p.b=u[j++],p.c=u[j++],q=3);if(i)i=u[j++],p.materialIndex=i;i=d.faces.length;if(c)for(c=0;c<z;c++)o=a.uvs[c],r=u[j++],t=o[2*r],r=o[2*r+1],d.faceUvs[c][i]=new THREE.UV(t,r);if(f)for(c=0;c<z;c++){o=a.uvs[c];s=[];
+for(f=0;f<q;f++)r=u[j++],t=o[2*r],r=o[2*r+1],s[f]=new THREE.UV(t,r);d.faceVertexUvs[c][i]=s}if(n)n=3*u[j++],f=new THREE.Vector3,f.x=v[n++],f.y=v[n++],f.z=v[n],p.normal=f;if(l)for(c=0;c<q;c++)n=3*u[j++],f=new THREE.Vector3,f.x=v[n++],f.y=v[n++],f.z=v[n],p.vertexNormals.push(f);if(m)l=u[j++],l=new THREE.Color(w[l]),p.color=l;if(b)for(c=0;c<q;c++)l=u[j++],l=new THREE.Color(w[l]),p.vertexColors.push(l);d.faces.push(p)}}})(f);(function(){var b,c,f,i;if(a.skinWeights)for(b=0,c=a.skinWeights.length;b<c;b+=
+2)f=a.skinWeights[b],i=a.skinWeights[b+1],d.skinWeights.push(new THREE.Vector4(f,i,0,0));if(a.skinIndices)for(b=0,c=a.skinIndices.length;b<c;b+=2)f=a.skinIndices[b],i=a.skinIndices[b+1],d.skinIndices.push(new THREE.Vector4(f,i,0,0));d.bones=a.bones;d.animation=a.animation})();(function(b){if(void 0!==a.morphTargets){var c,f,i,j,k,q,l,n,r;for(c=0,f=a.morphTargets.length;c<f;c++){d.morphTargets[c]={};d.morphTargets[c].name=a.morphTargets[c].name;d.morphTargets[c].vertices=[];n=d.morphTargets[c].vertices;
+r=a.morphTargets[c].vertices;for(i=0,j=r.length;i<j;i+=3)k=r[i]*b,q=r[i+1]*b,l=r[i+2]*b,n.push(new THREE.Vertex(new THREE.Vector3(k,q,l)))}}if(void 0!==a.morphColors)for(c=0,f=a.morphColors.length;c<f;c++){d.morphColors[c]={};d.morphColors[c].name=a.morphColors[c].name;d.morphColors[c].colors=[];j=d.morphColors[c].colors;k=a.morphColors[c].colors;for(b=0,i=k.length;b<i;b+=3)q=new THREE.Color(16755200),q.setRGB(k[b],k[b+1],k[b+2]),j.push(q)}})(f);d.computeCentroids();d.computeFaceNormals();this.hasNormals(d)&&
 d.computeTangents();b(d)};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};THREE.SceneLoader.prototype.constructor=THREE.SceneLoader;
 d.computeTangents();b(d)};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};THREE.SceneLoader.prototype.constructor=THREE.SceneLoader;
 THREE.SceneLoader.prototype.load=function(a,b){var c=this,d=new XMLHttpRequest;d.onreadystatechange=function(){if(4==d.readyState)if(200==d.status||0==d.status){try{var f=JSON.parse(d.responseText)}catch(g){console.warn("DEPRECATED: ["+a+"] seems to be using old model format")}c.createScene(f,b,a)}else console.error("Couldn't load ["+a+"] ["+d.status+"]")};d.open("GET",a,!0);d.overrideMimeType&&d.overrideMimeType("text/plain; charset=x-user-defined");d.setRequestHeader("Content-Type","text/plain");
 THREE.SceneLoader.prototype.load=function(a,b){var c=this,d=new XMLHttpRequest;d.onreadystatechange=function(){if(4==d.readyState)if(200==d.status||0==d.status){try{var f=JSON.parse(d.responseText)}catch(g){console.warn("DEPRECATED: ["+a+"] seems to be using old model format")}c.createScene(f,b,a)}else console.error("Couldn't load ["+a+"] ["+d.status+"]")};d.open("GET",a,!0);d.overrideMimeType&&d.overrideMimeType("text/plain; charset=x-user-defined");d.setRequestHeader("Content-Type","text/plain");
 d.send(null)};
 d.send(null)};
-THREE.SceneLoader.prototype.createScene=function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:k+"/"+a}function f(){var a;for(l in B.objects)if(!C.objects[l])if(p=B.objects[l],void 0!==p.geometry){if(F=C.geometries[p.geometry]){a=!1;E=C.materials[p.materials[0]];(a=E instanceof THREE.ShaderMaterial)&&F.computeTangents();u=p.position;v=p.rotation;w=p.quaternion;z=p.scale;w=0;0==p.materials.length&&(E=new THREE.MeshFaceMaterial);1<p.materials.length&&(E=new THREE.MeshFaceMaterial);a=new THREE.Mesh(F,
-E);a.name=l;a.position.set(u[0],u[1],u[2]);w?(a.quaternion.set(w[0],w[1],w[2],w[3]),a.useQuaternion=!0):a.rotation.set(v[0],v[1],v[2]);a.scale.set(z[0],z[1],z[2]);a.visible=p.visible;C.scene.add(a);C.objects[l]=a;if(p.meshCollider){var b=THREE.CollisionUtils.MeshColliderWBox(a);C.scene.collisions.colliders.push(b)}if(p.castsShadow)b=new THREE.ShadowVolume(F),C.scene.add(b),b.position=a.position,b.rotation=a.rotation,b.scale=a.scale;p.trigger&&"none"!=p.trigger.toLowerCase()&&(b={type:p.trigger,object:p},
-C.triggers[a.name]=b)}}else u=p.position,v=p.rotation,w=p.quaternion,z=p.scale,w=0,a=new THREE.Object3D,a.name=l,a.position.set(u[0],u[1],u[2]),w?(a.quaternion.set(w[0],w[1],w[2],w[3]),a.useQuaternion=!0):a.rotation.set(v[0],v[1],v[2]),a.scale.set(z[0],z[1],z[2]),a.visible=void 0!==p.visible?p.visible:!1,C.scene.add(a),C.objects[l]=a,C.empties[l]=a,p.trigger&&"none"!=p.trigger.toLowerCase()&&(b={type:p.trigger,object:p},C.triggers[a.name]=b)}function g(a){return function(b){C.geometries[a]=b;f();
-D-=1;i.onLoadComplete();h()}}function e(a){return function(b){C.geometries[a]=b}}function h(){i.callbackProgress({totalModels:y,totalTextures:K,loadedModels:y-D,loadedTextures:K-I},C);i.onLoadProgress();0==D&&0==I&&b(C)}var i=this,k=THREE.Loader.prototype.extractUrlbase(c),j,q,l,n,r,m,o,p,s,t,u,v,w,z,x,A,F,E,J,G,B,H,D,I,y,K,C;B=a;c=new THREE.BinaryLoader;H=new THREE.JSONLoader;I=D=0;C={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},
-empties:{}};a=!1;for(l in B.objects)if(p=B.objects[l],p.meshCollider){a=!0;break}if(a)C.scene.collisions=new THREE.CollisionSystem;if(B.transform)a=B.transform.position,s=B.transform.rotation,x=B.transform.scale,a&&C.scene.position.set(a[0],a[1],a[2]),s&&C.scene.rotation.set(s[0],s[1],s[2]),x&&C.scene.scale.set(x[0],x[1],x[2]),(a||s||x)&&C.scene.updateMatrix();a=function(){I-=1;h();i.onLoadComplete()};for(r in B.cameras)x=B.cameras[r],"perspective"==x.type?J=new THREE.PerspectiveCamera(x.fov,x.aspect,
-x.near,x.far):"ortho"==x.type&&(J=new THREE.OrthographicCamera(x.left,x.right,x.top,x.bottom,x.near,x.far)),u=x.position,s=x.target,x=x.up,J.position.set(u[0],u[1],u[2]),J.target=new THREE.Vector3(s[0],s[1],s[2]),x&&J.up.set(x[0],x[1],x[2]),C.cameras[r]=J;for(n in B.lights)s=B.lights[n],r=void 0!==s.color?s.color:16777215,J=void 0!==s.intensity?s.intensity:1,"directional"==s.type?(u=s.direction,t=new THREE.DirectionalLight(r,J),t.position.set(u[0],u[1],u[2]),t.position.normalize()):"point"==s.type?
-(u=s.position,t=s.distance,t=new THREE.PointLight(r,J,t),t.position.set(u[0],u[1],u[2])):"ambient"==s.type&&(t=new THREE.AmbientLight(r)),C.scene.add(t),C.lights[n]=t;for(m in B.fogs)n=B.fogs[m],"linear"==n.type?G=new THREE.Fog(0,n.near,n.far):"exp2"==n.type&&(G=new THREE.FogExp2(0,n.density)),x=n.color,G.color.setRGB(x[0],x[1],x[2]),C.fogs[m]=G;if(C.cameras&&B.defaults.camera)C.currentCamera=C.cameras[B.defaults.camera];if(C.fogs&&B.defaults.fog)C.scene.fog=C.fogs[B.defaults.fog];x=B.defaults.bgcolor;
-C.bgColor=new THREE.Color;C.bgColor.setRGB(x[0],x[1],x[2]);C.bgColorAlpha=B.defaults.bgalpha;for(j in B.geometries)if(m=B.geometries[j],"bin_mesh"==m.type||"ascii_mesh"==m.type)D+=1,i.onLoadStart();y=D;for(j in B.geometries)if(m=B.geometries[j],"cube"==m.type)F=new THREE.CubeGeometry(m.width,m.height,m.depth,m.segmentsWidth,m.segmentsHeight,m.segmentsDepth,null,m.flipped,m.sides),C.geometries[j]=F;else if("plane"==m.type)F=new THREE.PlaneGeometry(m.width,m.height,m.segmentsWidth,m.segmentsHeight),
-C.geometries[j]=F;else if("sphere"==m.type)F=new THREE.SphereGeometry(m.radius,m.segmentsWidth,m.segmentsHeight),C.geometries[j]=F;else if("cylinder"==m.type)F=new THREE.CylinderGeometry(m.topRad,m.botRad,m.height,m.radSegs,m.heightSegs),C.geometries[j]=F;else if("torus"==m.type)F=new THREE.TorusGeometry(m.radius,m.tube,m.segmentsR,m.segmentsT),C.geometries[j]=F;else if("icosahedron"==m.type)F=new THREE.IcosahedronGeometry(m.radius,m.subdivisions),C.geometries[j]=F;else if("bin_mesh"==m.type)c.load(d(m.url,
-B.urlBaseType),g(j));else if("ascii_mesh"==m.type)H.load(d(m.url,B.urlBaseType),g(j));else if("embedded_mesh"==m.type)m=B.embeds[m.id],m.metadata=B.metadata,m&&H.createModel(m,e(j),"");for(o in B.textures)if(j=B.textures[o],j.url instanceof Array){I+=j.url.length;for(m=0;m<j.url.length;m++)i.onLoadStart()}else I+=1,i.onLoadStart();K=I;for(o in B.textures){j=B.textures[o];if(void 0!=j.mapping&&void 0!=THREE[j.mapping])j.mapping=new THREE[j.mapping];if(j.url instanceof Array){m=[];for(G=0;G<j.url.length;G++)m[G]=
-d(j.url[G],B.urlBaseType);m=THREE.ImageUtils.loadTextureCube(m,j.mapping,a)}else{m=THREE.ImageUtils.loadTexture(d(j.url,B.urlBaseType),j.mapping,a);if(void 0!=THREE[j.minFilter])m.minFilter=THREE[j.minFilter];if(void 0!=THREE[j.magFilter])m.magFilter=THREE[j.magFilter];if(j.repeat){m.repeat.set(j.repeat[0],j.repeat[1]);if(1!=j.repeat[0])m.wrapS=THREE.RepeatWrapping;if(1!=j.repeat[1])m.wrapT=THREE.RepeatWrapping}j.offset&&m.offset.set(j.offset[0],j.offset[1]);if(j.wrap){G={repeat:THREE.RepeatWrapping,
-mirror:THREE.MirroredRepeatWrapping};if(void 0!==G[j.wrap[0]])m.wrapS=G[j.wrap[0]];if(void 0!==G[j.wrap[1]])m.wrapT=G[j.wrap[1]]}}C.textures[o]=m}for(q in B.materials){o=B.materials[q];for(A in o.parameters)if("envMap"==A||"map"==A||"lightMap"==A)o.parameters[A]=C.textures[o.parameters[A]];else if("shading"==A)o.parameters[A]="flat"==o.parameters[A]?THREE.FlatShading:THREE.SmoothShading;else if("blending"==A)o.parameters[A]=THREE[o.parameters[A]]?THREE[o.parameters[A]]:THREE.NormalBlending;else if("combine"==
-A)o.parameters[A]="MixOperation"==o.parameters[A]?THREE.MixOperation:THREE.MultiplyOperation;else if("vertexColors"==A)if("face"==o.parameters[A])o.parameters[A]=THREE.FaceColors;else if(o.parameters[A])o.parameters[A]=THREE.VertexColors;if(void 0!==o.parameters.opacity&&1>o.parameters.opacity)o.parameters.transparent=!0;if(o.parameters.normalMap){j=THREE.ShaderUtils.lib.normal;a=THREE.UniformsUtils.clone(j.uniforms);m=o.parameters.color;G=o.parameters.specular;c=o.parameters.ambient;H=o.parameters.shininess;
-a.tNormal.texture=C.textures[o.parameters.normalMap];if(o.parameters.normalMapFactor)a.uNormalScale.value=o.parameters.normalMapFactor;if(o.parameters.map)a.tDiffuse.texture=o.parameters.map,a.enableDiffuse.value=!0;if(o.parameters.lightMap)a.tAO.texture=o.parameters.lightMap,a.enableAO.value=!0;if(o.parameters.specularMap)a.tSpecular.texture=C.textures[o.parameters.specularMap],a.enableSpecular.value=!0;a.uDiffuseColor.value.setHex(m);a.uSpecularColor.value.setHex(G);a.uAmbientColor.value.setHex(c);
-a.uShininess.value=H;if(o.parameters.opacity)a.uOpacity.value=o.parameters.opacity;E=new THREE.ShaderMaterial({fragmentShader:j.fragmentShader,vertexShader:j.vertexShader,uniforms:a,lights:!0,fog:!0})}else E=new THREE[o.type](o.parameters);C.materials[q]=E}f();i.callbackSync(C);h()};THREE.UTF8Loader=function(){};THREE.UTF8Loader.prototype=new THREE.UTF8Loader;THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
+THREE.SceneLoader.prototype.createScene=function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:j+"/"+a}function f(){var a;for(l in B.objects)if(!D.objects[l])if(o=B.objects[l],void 0!==o.geometry){if(F=D.geometries[o.geometry]){a=!1;E=D.materials[o.materials[0]];(a=E instanceof THREE.ShaderMaterial)&&F.computeTangents();u=o.position;v=o.rotation;w=o.quaternion;z=o.scale;w=0;0==o.materials.length&&(E=new THREE.MeshFaceMaterial);1<o.materials.length&&(E=new THREE.MeshFaceMaterial);a=new THREE.Mesh(F,
+E);a.name=l;a.position.set(u[0],u[1],u[2]);w?(a.quaternion.set(w[0],w[1],w[2],w[3]),a.useQuaternion=!0):a.rotation.set(v[0],v[1],v[2]);a.scale.set(z[0],z[1],z[2]);a.visible=o.visible;D.scene.add(a);D.objects[l]=a;if(o.castsShadow){var b=new THREE.ShadowVolume(F);D.scene.add(b);b.position=a.position;b.rotation=a.rotation;b.scale=a.scale}o.trigger&&"none"!=o.trigger.toLowerCase()&&(b={type:o.trigger,object:o},D.triggers[a.name]=b)}}else u=o.position,v=o.rotation,w=o.quaternion,z=o.scale,w=0,a=new THREE.Object3D,
+a.name=l,a.position.set(u[0],u[1],u[2]),w?(a.quaternion.set(w[0],w[1],w[2],w[3]),a.useQuaternion=!0):a.rotation.set(v[0],v[1],v[2]),a.scale.set(z[0],z[1],z[2]),a.visible=void 0!==o.visible?o.visible:!1,D.scene.add(a),D.objects[l]=a,D.empties[l]=a,o.trigger&&"none"!=o.trigger.toLowerCase()&&(b={type:o.trigger,object:o},D.triggers[a.name]=b)}function g(a){return function(b){D.geometries[a]=b;f();C-=1;i.onLoadComplete();h()}}function e(a){return function(b){D.geometries[a]=b}}function h(){i.callbackProgress({totalModels:y,
+totalTextures:K,loadedModels:y-C,loadedTextures:K-I},D);i.onLoadProgress();0==C&&0==I&&b(D)}var i=this,j=THREE.Loader.prototype.extractUrlbase(c),k,q,l,n,r,m,p,o,s,t,u,v,w,z,x,A,F,E,J,G,B,H,C,I,y,K,D;B=a;c=new THREE.BinaryLoader;H=new THREE.JSONLoader;I=C=0;D={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};if(B.transform)a=B.transform.position,s=B.transform.rotation,x=B.transform.scale,a&&D.scene.position.set(a[0],a[1],
+a[2]),s&&D.scene.rotation.set(s[0],s[1],s[2]),x&&D.scene.scale.set(x[0],x[1],x[2]),(a||s||x)&&D.scene.updateMatrix();a=function(){I-=1;h();i.onLoadComplete()};for(r in B.cameras)x=B.cameras[r],"perspective"==x.type?J=new THREE.PerspectiveCamera(x.fov,x.aspect,x.near,x.far):"ortho"==x.type&&(J=new THREE.OrthographicCamera(x.left,x.right,x.top,x.bottom,x.near,x.far)),u=x.position,s=x.target,x=x.up,J.position.set(u[0],u[1],u[2]),J.target=new THREE.Vector3(s[0],s[1],s[2]),x&&J.up.set(x[0],x[1],x[2]),
+D.cameras[r]=J;for(n in B.lights)s=B.lights[n],r=void 0!==s.color?s.color:16777215,J=void 0!==s.intensity?s.intensity:1,"directional"==s.type?(u=s.direction,t=new THREE.DirectionalLight(r,J),t.position.set(u[0],u[1],u[2]),t.position.normalize()):"point"==s.type?(u=s.position,t=s.distance,t=new THREE.PointLight(r,J,t),t.position.set(u[0],u[1],u[2])):"ambient"==s.type&&(t=new THREE.AmbientLight(r)),D.scene.add(t),D.lights[n]=t;for(m in B.fogs)n=B.fogs[m],"linear"==n.type?G=new THREE.Fog(0,n.near,n.far):
+"exp2"==n.type&&(G=new THREE.FogExp2(0,n.density)),x=n.color,G.color.setRGB(x[0],x[1],x[2]),D.fogs[m]=G;if(D.cameras&&B.defaults.camera)D.currentCamera=D.cameras[B.defaults.camera];if(D.fogs&&B.defaults.fog)D.scene.fog=D.fogs[B.defaults.fog];x=B.defaults.bgcolor;D.bgColor=new THREE.Color;D.bgColor.setRGB(x[0],x[1],x[2]);D.bgColorAlpha=B.defaults.bgalpha;for(k in B.geometries)if(m=B.geometries[k],"bin_mesh"==m.type||"ascii_mesh"==m.type)C+=1,i.onLoadStart();y=C;for(k in B.geometries)if(m=B.geometries[k],
+"cube"==m.type)F=new THREE.CubeGeometry(m.width,m.height,m.depth,m.segmentsWidth,m.segmentsHeight,m.segmentsDepth,null,m.flipped,m.sides),D.geometries[k]=F;else if("plane"==m.type)F=new THREE.PlaneGeometry(m.width,m.height,m.segmentsWidth,m.segmentsHeight),D.geometries[k]=F;else if("sphere"==m.type)F=new THREE.SphereGeometry(m.radius,m.segmentsWidth,m.segmentsHeight),D.geometries[k]=F;else if("cylinder"==m.type)F=new THREE.CylinderGeometry(m.topRad,m.botRad,m.height,m.radSegs,m.heightSegs),D.geometries[k]=
+F;else if("torus"==m.type)F=new THREE.TorusGeometry(m.radius,m.tube,m.segmentsR,m.segmentsT),D.geometries[k]=F;else if("icosahedron"==m.type)F=new THREE.IcosahedronGeometry(m.radius,m.subdivisions),D.geometries[k]=F;else if("bin_mesh"==m.type)c.load(d(m.url,B.urlBaseType),g(k));else if("ascii_mesh"==m.type)H.load(d(m.url,B.urlBaseType),g(k));else if("embedded_mesh"==m.type)m=B.embeds[m.id],m.metadata=B.metadata,m&&H.createModel(m,e(k),"");for(p in B.textures)if(k=B.textures[p],k.url instanceof Array){I+=
+k.url.length;for(m=0;m<k.url.length;m++)i.onLoadStart()}else I+=1,i.onLoadStart();K=I;for(p in B.textures){k=B.textures[p];if(void 0!=k.mapping&&void 0!=THREE[k.mapping])k.mapping=new THREE[k.mapping];if(k.url instanceof Array){m=[];for(G=0;G<k.url.length;G++)m[G]=d(k.url[G],B.urlBaseType);m=THREE.ImageUtils.loadTextureCube(m,k.mapping,a)}else{m=THREE.ImageUtils.loadTexture(d(k.url,B.urlBaseType),k.mapping,a);if(void 0!=THREE[k.minFilter])m.minFilter=THREE[k.minFilter];if(void 0!=THREE[k.magFilter])m.magFilter=
+THREE[k.magFilter];if(k.repeat){m.repeat.set(k.repeat[0],k.repeat[1]);if(1!=k.repeat[0])m.wrapS=THREE.RepeatWrapping;if(1!=k.repeat[1])m.wrapT=THREE.RepeatWrapping}k.offset&&m.offset.set(k.offset[0],k.offset[1]);if(k.wrap){G={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(void 0!==G[k.wrap[0]])m.wrapS=G[k.wrap[0]];if(void 0!==G[k.wrap[1]])m.wrapT=G[k.wrap[1]]}}D.textures[p]=m}for(q in B.materials){p=B.materials[q];for(A in p.parameters)if("envMap"==A||"map"==A||"lightMap"==A)p.parameters[A]=
+D.textures[p.parameters[A]];else if("shading"==A)p.parameters[A]="flat"==p.parameters[A]?THREE.FlatShading:THREE.SmoothShading;else if("blending"==A)p.parameters[A]=THREE[p.parameters[A]]?THREE[p.parameters[A]]:THREE.NormalBlending;else if("combine"==A)p.parameters[A]="MixOperation"==p.parameters[A]?THREE.MixOperation:THREE.MultiplyOperation;else if("vertexColors"==A)if("face"==p.parameters[A])p.parameters[A]=THREE.FaceColors;else if(p.parameters[A])p.parameters[A]=THREE.VertexColors;if(void 0!==
+p.parameters.opacity&&1>p.parameters.opacity)p.parameters.transparent=!0;if(p.parameters.normalMap){a=THREE.ShaderUtils.lib.normal;k=THREE.UniformsUtils.clone(a.uniforms);m=p.parameters.color;G=p.parameters.specular;c=p.parameters.ambient;H=p.parameters.shininess;k.tNormal.texture=D.textures[p.parameters.normalMap];if(p.parameters.normalMapFactor)k.uNormalScale.value=p.parameters.normalMapFactor;if(p.parameters.map)k.tDiffuse.texture=p.parameters.map,k.enableDiffuse.value=!0;if(p.parameters.lightMap)k.tAO.texture=
+p.parameters.lightMap,k.enableAO.value=!0;if(p.parameters.specularMap)k.tSpecular.texture=D.textures[p.parameters.specularMap],k.enableSpecular.value=!0;k.uDiffuseColor.value.setHex(m);k.uSpecularColor.value.setHex(G);k.uAmbientColor.value.setHex(c);k.uShininess.value=H;if(p.parameters.opacity)k.uOpacity.value=p.parameters.opacity;E=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:k,lights:!0,fog:!0})}else E=new THREE[p.type](p.parameters);D.materials[q]=
+E}f();i.callbackSync(D);h()};THREE.UTF8Loader=function(){};THREE.UTF8Loader.prototype=new THREE.UTF8Loader;THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
 THREE.UTF8Loader.prototype.load=function(a,b,c){if(a instanceof Object)console.warn("DEPRECATED: UTF8Loader( parameters ) is now UTF8Loader( url, callback, metaData )."),c=a,a=c.model,b=c.callback,c={scale:c.scale,offsetX:c.offsetX,offsetY:c.offsetY,offsetZ:c.offsetZ};var d=new XMLHttpRequest,f=void 0!==c.scale?c.scale:1,g=void 0!==c.offsetX?c.offsetX:0,e=void 0!==c.offsetY?c.offsetY:0,h=void 0!==c.offsetZ?c.offsetZ:0;d.onreadystatechange=function(){4==d.readyState?200==d.status||0==d.status?THREE.UTF8Loader.prototype.createModel(d.responseText,
 THREE.UTF8Loader.prototype.load=function(a,b,c){if(a instanceof Object)console.warn("DEPRECATED: UTF8Loader( parameters ) is now UTF8Loader( url, callback, metaData )."),c=a,a=c.model,b=c.callback,c={scale:c.scale,offsetX:c.offsetX,offsetY:c.offsetY,offsetZ:c.offsetZ};var d=new XMLHttpRequest,f=void 0!==c.scale?c.scale:1,g=void 0!==c.offsetX?c.offsetX:0,e=void 0!==c.offsetY?c.offsetY:0,h=void 0!==c.offsetZ?c.offsetZ:0;d.onreadystatechange=function(){4==d.readyState?200==d.status||0==d.status?THREE.UTF8Loader.prototype.createModel(d.responseText,
 b,f,g,e,h):alert("Couldn't load ["+a+"] ["+d.status+"]"):3!=d.readyState&&2==d.readyState&&d.getResponseHeader("Content-Length")};d.open("GET",a,!0);d.send(null)};THREE.UTF8Loader.prototype.decompressMesh=function(a){var b=a.charCodeAt(0);57344<=b&&(b-=2048);b++;for(var c=new Float32Array(8*b),d=1,f=0;8>f;f++){for(var g=0,e=0;e<b;++e){var h=a.charCodeAt(e+d),g=g+(h>>1^-(h&1));c[8*e+f]=g}d+=b}b=a.length-d;g=new Uint16Array(b);for(f=e=0;f<b;f++)h=a.charCodeAt(f+d),g[f]=e-h,0==h&&e++;return[c,g]};
 b,f,g,e,h):alert("Couldn't load ["+a+"] ["+d.status+"]"):3!=d.readyState&&2==d.readyState&&d.getResponseHeader("Content-Length")};d.open("GET",a,!0);d.send(null)};THREE.UTF8Loader.prototype.decompressMesh=function(a){var b=a.charCodeAt(0);57344<=b&&(b-=2048);b++;for(var c=new Float32Array(8*b),d=1,f=0;8>f;f++){for(var g=0,e=0;e<b;++e){var h=a.charCodeAt(e+d),g=g+(h>>1^-(h&1));c[8*e+f]=g}d+=b}b=a.length-d;g=new Uint16Array(b);for(f=e=0;f<b;f++)h=a.charCodeAt(f+d),g[f]=e-h,0==h&&e++;return[c,g]};
-THREE.UTF8Loader.prototype.createModel=function(a,b,c,d,f,g){var e=function(){var b=this;b.materials=[];THREE.Geometry.call(this);var e=THREE.UTF8Loader.prototype.decompressMesh(a),k=[],j=[];(function(a,e,i){for(var j,k,o,p=a.length;i<p;i+=e)j=a[i],k=a[i+1],o=a[i+2],j=j/16383*c,k=k/16383*c,o=o/16383*c,j+=d,k+=f,o+=g,b.vertices.push(new THREE.Vertex(new THREE.Vector3(j,k,o)))})(e[0],8,0);(function(a,b,c){for(var d,e,f=a.length;c<f;c+=b)d=a[c],e=a[c+1],d/=1023,e/=1023,j.push(d,1-e)})(e[0],8,3);(function(a,
-b,c){for(var d,e,f,g=a.length;c<g;c+=b)d=a[c],e=a[c+1],f=a[c+2],d=(d-512)/511,e=(e-512)/511,f=(f-512)/511,k.push(d,e,f)})(e[0],8,5);(function(a){var c,d,e,f,g,i,s,t,u,v=a.length;for(c=0;c<v;c+=3){d=a[c];e=a[c+1];f=a[c+2];g=b;t=d;u=e;i=f;var w=k[3*e],z=k[3*e+1],x=k[3*e+2],A=k[3*f],F=k[3*f+1],E=k[3*f+2];s=new THREE.Vector3(k[3*d],k[3*d+1],k[3*d+2]);w=new THREE.Vector3(w,z,x);A=new THREE.Vector3(A,F,E);g.faces.push(new THREE.Face3(t,u,i,[s,w,A],null,0));g=j[2*d];d=j[2*d+1];i=j[2*e];s=j[2*e+1];t=j[2*
-f];u=j[2*f+1];f=b.faceVertexUvs[0];e=i;i=s;s=[];s.push(new THREE.UV(g,d));s.push(new THREE.UV(e,i));s.push(new THREE.UV(t,u));f.push(s)}})(e[1]);this.computeCentroids();this.computeFaceNormals()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;b(new e)};
+THREE.UTF8Loader.prototype.createModel=function(a,b,c,d,f,g){var e=function(){var b=this;b.materials=[];THREE.Geometry.call(this);var e=THREE.UTF8Loader.prototype.decompressMesh(a),j=[],k=[];(function(a,e,i){for(var j,k,p,o=a.length;i<o;i+=e)j=a[i],k=a[i+1],p=a[i+2],j=j/16383*c,k=k/16383*c,p=p/16383*c,j+=d,k+=f,p+=g,b.vertices.push(new THREE.Vertex(new THREE.Vector3(j,k,p)))})(e[0],8,0);(function(a,b,c){for(var d,e,f=a.length;c<f;c+=b)d=a[c],e=a[c+1],d/=1023,e/=1023,k.push(d,1-e)})(e[0],8,3);(function(a,
+b,c){for(var d,e,f,g=a.length;c<g;c+=b)d=a[c],e=a[c+1],f=a[c+2],d=(d-512)/511,e=(e-512)/511,f=(f-512)/511,j.push(d,e,f)})(e[0],8,5);(function(a){var c,d,e,f,g,i,s,t,u,v=a.length;for(c=0;c<v;c+=3){d=a[c];e=a[c+1];f=a[c+2];g=b;t=d;u=e;i=f;var w=j[3*e],z=j[3*e+1],x=j[3*e+2],A=j[3*f],F=j[3*f+1],E=j[3*f+2];s=new THREE.Vector3(j[3*d],j[3*d+1],j[3*d+2]);w=new THREE.Vector3(w,z,x);A=new THREE.Vector3(A,F,E);g.faces.push(new THREE.Face3(t,u,i,[s,w,A],null,0));g=k[2*d];d=k[2*d+1];i=k[2*e];s=k[2*e+1];t=k[2*
+f];u=k[2*f+1];f=b.faceVertexUvs[0];e=i;i=s;s=[];s.push(new THREE.UV(g,d));s.push(new THREE.UV(e,i));s.push(new THREE.UV(t,u));f.push(s)}})(e[1]);this.computeCentroids();this.computeFaceNormals()};e.prototype=new THREE.Geometry;e.prototype.constructor=e;b(new e)};
 THREE.MarchingCubes=function(a,b){THREE.Object3D.call(this);this.material=b;this.init=function(a){this.resolution=a;this.isolation=80;this.size=a;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(3*this.size3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=0;this.hasNormal=
 THREE.MarchingCubes=function(a,b){THREE.Object3D.call(this);this.material=b;this.init=function(a){this.resolution=a;this.isolation=80;this.size=a;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(3*this.size3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=0;this.hasNormal=
-this.hasPos=!1;this.positionArray=new Float32Array(3*this.maxCount);this.normalArray=new Float32Array(3*this.maxCount)};this.lerp=function(a,b,f){return a+(b-a)*f};this.VIntX=function(a,b,f,g,e,h,i,k,j,q){e=(e-j)/(q-j);j=this.normal_cache;b[g]=h+e*this.delta;b[g+1]=i;b[g+2]=k;f[g]=this.lerp(j[a],j[a+3],e);f[g+1]=this.lerp(j[a+1],j[a+4],e);f[g+2]=this.lerp(j[a+2],j[a+5],e)};this.VIntY=function(a,b,f,g,e,h,i,k,j,q){e=(e-j)/(q-j);j=this.normal_cache;b[g]=h;b[g+1]=i+e*this.delta;b[g+2]=k;b=a+3*this.yd;
-f[g]=this.lerp(j[a],j[b],e);f[g+1]=this.lerp(j[a+1],j[b+1],e);f[g+2]=this.lerp(j[a+2],j[b+2],e)};this.VIntZ=function(a,b,f,g,e,h,i,k,j,q){e=(e-j)/(q-j);j=this.normal_cache;b[g]=h;b[g+1]=i;b[g+2]=k+e*this.delta;b=a+3*this.zd;f[g]=this.lerp(j[a],j[b],e);f[g+1]=this.lerp(j[a+1],j[b+1],e);f[g+2]=this.lerp(j[a+2],j[b+2],e)};this.compNorm=function(a){var b=3*a;0===this.normal_cache[b]&&(this.normal_cache[b]=this.field[a-1]-this.field[a+1],this.normal_cache[b+1]=this.field[a-this.yd]-this.field[a+this.yd],
-this.normal_cache[b+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,b,f,g,e,h){var i=g+1,k=g+this.yd,j=g+this.zd,q=i+this.yd,l=i+this.zd,n=g+this.yd+this.zd,r=i+this.yd+this.zd,m=0,o=this.field[g],p=this.field[i],s=this.field[k],t=this.field[q],u=this.field[j],v=this.field[l],w=this.field[n],z=this.field[r];o<e&&(m|=1);p<e&&(m|=2);s<e&&(m|=8);t<e&&(m|=4);u<e&&(m|=16);v<e&&(m|=32);w<e&&(m|=128);z<e&&(m|=64);var x=THREE.edgeTable[m];if(0===x)return 0;var A=this.delta,F=a+
-A,E=b+A,A=f+A;x&1&&(this.compNorm(g),this.compNorm(i),this.VIntX(3*g,this.vlist,this.nlist,0,e,a,b,f,o,p));x&2&&(this.compNorm(i),this.compNorm(q),this.VIntY(3*i,this.vlist,this.nlist,3,e,F,b,f,p,t));x&4&&(this.compNorm(k),this.compNorm(q),this.VIntX(3*k,this.vlist,this.nlist,6,e,a,E,f,s,t));x&8&&(this.compNorm(g),this.compNorm(k),this.VIntY(3*g,this.vlist,this.nlist,9,e,a,b,f,o,s));x&16&&(this.compNorm(j),this.compNorm(l),this.VIntX(3*j,this.vlist,this.nlist,12,e,a,b,A,u,v));x&32&&(this.compNorm(l),
-this.compNorm(r),this.VIntY(3*l,this.vlist,this.nlist,15,e,F,b,A,v,z));x&64&&(this.compNorm(n),this.compNorm(r),this.VIntX(3*n,this.vlist,this.nlist,18,e,a,E,A,w,z));x&128&&(this.compNorm(j),this.compNorm(n),this.VIntY(3*j,this.vlist,this.nlist,21,e,a,b,A,u,w));x&256&&(this.compNorm(g),this.compNorm(j),this.VIntZ(3*g,this.vlist,this.nlist,24,e,a,b,f,o,u));x&512&&(this.compNorm(i),this.compNorm(l),this.VIntZ(3*i,this.vlist,this.nlist,27,e,F,b,f,p,v));x&1024&&(this.compNorm(q),this.compNorm(r),this.VIntZ(3*
-q,this.vlist,this.nlist,30,e,F,E,f,t,z));x&2048&&(this.compNorm(k),this.compNorm(n),this.VIntZ(3*k,this.vlist,this.nlist,33,e,a,E,f,s,w));m<<=4;for(e=g=0;-1!=THREE.triTable[m+e];)a=m+e,b=a+1,f=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[b],3*THREE.triTable[f],h),e+=3,g++;return g};this.posnormtriv=function(a,b,f,g,e,h){var i=3*this.count;this.positionArray[i]=a[f];this.positionArray[i+1]=a[f+1];this.positionArray[i+2]=a[f+2];this.positionArray[i+3]=a[g];this.positionArray[i+
+this.hasPos=!1;this.positionArray=new Float32Array(3*this.maxCount);this.normalArray=new Float32Array(3*this.maxCount)};this.lerp=function(a,b,f){return a+(b-a)*f};this.VIntX=function(a,b,f,g,e,h,i,j,k,q){e=(e-k)/(q-k);k=this.normal_cache;b[g]=h+e*this.delta;b[g+1]=i;b[g+2]=j;f[g]=this.lerp(k[a],k[a+3],e);f[g+1]=this.lerp(k[a+1],k[a+4],e);f[g+2]=this.lerp(k[a+2],k[a+5],e)};this.VIntY=function(a,b,f,g,e,h,i,j,k,q){e=(e-k)/(q-k);k=this.normal_cache;b[g]=h;b[g+1]=i+e*this.delta;b[g+2]=j;b=a+3*this.yd;
+f[g]=this.lerp(k[a],k[b],e);f[g+1]=this.lerp(k[a+1],k[b+1],e);f[g+2]=this.lerp(k[a+2],k[b+2],e)};this.VIntZ=function(a,b,f,g,e,h,i,j,k,q){e=(e-k)/(q-k);k=this.normal_cache;b[g]=h;b[g+1]=i;b[g+2]=j+e*this.delta;b=a+3*this.zd;f[g]=this.lerp(k[a],k[b],e);f[g+1]=this.lerp(k[a+1],k[b+1],e);f[g+2]=this.lerp(k[a+2],k[b+2],e)};this.compNorm=function(a){var b=3*a;0===this.normal_cache[b]&&(this.normal_cache[b]=this.field[a-1]-this.field[a+1],this.normal_cache[b+1]=this.field[a-this.yd]-this.field[a+this.yd],
+this.normal_cache[b+2]=this.field[a-this.zd]-this.field[a+this.zd])};this.polygonize=function(a,b,f,g,e,h){var i=g+1,j=g+this.yd,k=g+this.zd,q=i+this.yd,l=i+this.zd,n=g+this.yd+this.zd,r=i+this.yd+this.zd,m=0,p=this.field[g],o=this.field[i],s=this.field[j],t=this.field[q],u=this.field[k],v=this.field[l],w=this.field[n],z=this.field[r];p<e&&(m|=1);o<e&&(m|=2);s<e&&(m|=8);t<e&&(m|=4);u<e&&(m|=16);v<e&&(m|=32);w<e&&(m|=128);z<e&&(m|=64);var x=THREE.edgeTable[m];if(0===x)return 0;var A=this.delta,F=a+
+A,E=b+A,A=f+A;x&1&&(this.compNorm(g),this.compNorm(i),this.VIntX(3*g,this.vlist,this.nlist,0,e,a,b,f,p,o));x&2&&(this.compNorm(i),this.compNorm(q),this.VIntY(3*i,this.vlist,this.nlist,3,e,F,b,f,o,t));x&4&&(this.compNorm(j),this.compNorm(q),this.VIntX(3*j,this.vlist,this.nlist,6,e,a,E,f,s,t));x&8&&(this.compNorm(g),this.compNorm(j),this.VIntY(3*g,this.vlist,this.nlist,9,e,a,b,f,p,s));x&16&&(this.compNorm(k),this.compNorm(l),this.VIntX(3*k,this.vlist,this.nlist,12,e,a,b,A,u,v));x&32&&(this.compNorm(l),
+this.compNorm(r),this.VIntY(3*l,this.vlist,this.nlist,15,e,F,b,A,v,z));x&64&&(this.compNorm(n),this.compNorm(r),this.VIntX(3*n,this.vlist,this.nlist,18,e,a,E,A,w,z));x&128&&(this.compNorm(k),this.compNorm(n),this.VIntY(3*k,this.vlist,this.nlist,21,e,a,b,A,u,w));x&256&&(this.compNorm(g),this.compNorm(k),this.VIntZ(3*g,this.vlist,this.nlist,24,e,a,b,f,p,u));x&512&&(this.compNorm(i),this.compNorm(l),this.VIntZ(3*i,this.vlist,this.nlist,27,e,F,b,f,o,v));x&1024&&(this.compNorm(q),this.compNorm(r),this.VIntZ(3*
+q,this.vlist,this.nlist,30,e,F,E,f,t,z));x&2048&&(this.compNorm(j),this.compNorm(n),this.VIntZ(3*j,this.vlist,this.nlist,33,e,a,E,f,s,w));m<<=4;for(e=g=0;-1!=THREE.triTable[m+e];)a=m+e,b=a+1,f=a+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[a],3*THREE.triTable[b],3*THREE.triTable[f],h),e+=3,g++;return g};this.posnormtriv=function(a,b,f,g,e,h){var i=3*this.count;this.positionArray[i]=a[f];this.positionArray[i+1]=a[f+1];this.positionArray[i+2]=a[f+2];this.positionArray[i+3]=a[g];this.positionArray[i+
 4]=a[g+1];this.positionArray[i+5]=a[g+2];this.positionArray[i+6]=a[e];this.positionArray[i+7]=a[e+1];this.positionArray[i+8]=a[e+2];this.normalArray[i]=b[f];this.normalArray[i+1]=b[f+1];this.normalArray[i+2]=b[f+2];this.normalArray[i+3]=b[g];this.normalArray[i+4]=b[g+1];this.normalArray[i+5]=b[g+2];this.normalArray[i+6]=b[e];this.normalArray[i+7]=b[e+1];this.normalArray[i+8]=b[e+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&h(this)};this.begin=function(){this.count=0;
 4]=a[g+1];this.positionArray[i+5]=a[g+2];this.positionArray[i+6]=a[e];this.positionArray[i+7]=a[e+1];this.positionArray[i+8]=a[e+2];this.normalArray[i]=b[f];this.normalArray[i+1]=b[f+1];this.normalArray[i+2]=b[f+2];this.normalArray[i+3]=b[g];this.normalArray[i+4]=b[g+1];this.normalArray[i+5]=b[g+2];this.normalArray[i+6]=b[e];this.normalArray[i+7]=b[e+1];this.normalArray[i+8]=b[e+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&h(this)};this.begin=function(){this.count=0;
-this.hasNormal=this.hasPos=!1};this.end=function(a){if(0!==this.count){for(var b=3*this.count;b<this.positionArray.length;b++)this.positionArray[b]=0;a(this)}};this.addBall=function(a,b,f,g,e){var h=this.size*Math.sqrt(g/e),i=f*this.size,k=b*this.size,j=a*this.size,q=Math.floor(i-h);1>q&&(q=1);i=Math.floor(i+h);i>this.size-1&&(i=this.size-1);var l=Math.floor(k-h);1>l&&(l=1);k=Math.floor(k+h);k>this.size-1&&(k=this.size-1);var n=Math.floor(j-h);1>n&&(n=1);h=Math.floor(j+h);h>this.size-1&&(h=this.size-
-1);for(var r,m,o,p,s,t,u,j=q;j<i;j++){o=this.size2*j;s=j/this.size-f;t=s*s;for(q=l;q<k;q++){m=o+this.size*q;r=q/this.size-b;u=r*r;for(r=n;r<h;r++)p=r/this.size-a,p=g/(1.0E-6+p*p+u+t)-e,0<p&&(this.field[m+r]+=p)}}};this.addPlaneX=function(a,b){var f,g,e,h,i,k=this.size,j=this.yd,q=this.zd,l=this.field,n=k*Math.sqrt(a/b);n>k&&(n=k);for(f=0;f<n;f++)if(g=f/k,g*=g,h=a/(1.0E-4+g)-b,0<h)for(g=0;g<k;g++){i=f+g*j;for(e=0;e<k;e++)l[q*e+i]+=h}};this.addPlaneY=function(a,b){var f,g,e,h,i,k,j=this.size,q=this.yd,
-l=this.zd,n=this.field,r=j*Math.sqrt(a/b);r>j&&(r=j);for(g=0;g<r;g++)if(f=g/j,f*=f,h=a/(1.0E-4+f)-b,0<h){i=g*q;for(f=0;f<j;f++){k=i+f;for(e=0;e<j;e++)n[l*e+k]+=h}}};this.addPlaneZ=function(a,b){var f,g,e,h,i,k,j=this.size,q=this.yd,l=this.zd,n=this.field,r=j*Math.sqrt(a/b);r>j&&(r=j);for(e=0;e<r;e++)if(f=e/j,f*=f,h=a/(1.0E-4+f)-b,0<h){i=l*e;for(g=0;g<j;g++){k=i+g*q;for(f=0;f<j;f++)n[k+f]+=h}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[3*a]=0,this.field[a]=0};this.render=
-function(a){this.begin();var b,f,g,e,h,i,k,j,q,l=this.size-2;for(e=1;e<l;e++){q=this.size2*e;k=(e-this.halfsize)/this.halfsize;for(g=1;g<l;g++){j=q+this.size*g;i=(g-this.halfsize)/this.halfsize;for(f=1;f<l;f++)h=(f-this.halfsize)/this.halfsize,b=j+f,this.polygonize(h,i,k,b,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,b=new THREE.Geometry,f=[];this.render(function(g){var e,h,i,k,j,q,l,n;for(e=0;e<g.count;e++)l=3*e,j=l+1,n=l+2,h=g.positionArray[l],i=g.positionArray[j],k=
-g.positionArray[n],q=new THREE.Vector3(h,i,k),h=g.normalArray[l],i=g.normalArray[j],k=g.normalArray[n],l=new THREE.Vector3(h,i,k),l.normalize(),j=new THREE.Vertex(q),b.vertices.push(j),f.push(l);q=g.count/3;for(e=0;e<q;e++)l=3*(a+e),j=l+1,n=l+2,h=f[l],i=f[j],k=f[n],l=new THREE.Face3(l,j,n,[h,i,k]),b.faces.push(l);a+=q;g.count=0});return b};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
+this.hasNormal=this.hasPos=!1};this.end=function(a){if(0!==this.count){for(var b=3*this.count;b<this.positionArray.length;b++)this.positionArray[b]=0;a(this)}};this.addBall=function(a,b,f,g,e){var h=this.size*Math.sqrt(g/e),i=f*this.size,j=b*this.size,k=a*this.size,q=Math.floor(i-h);1>q&&(q=1);i=Math.floor(i+h);i>this.size-1&&(i=this.size-1);var l=Math.floor(j-h);1>l&&(l=1);j=Math.floor(j+h);j>this.size-1&&(j=this.size-1);var n=Math.floor(k-h);1>n&&(n=1);h=Math.floor(k+h);h>this.size-1&&(h=this.size-
+1);for(var r,m,p,o,s,t,u,k=q;k<i;k++){p=this.size2*k;s=k/this.size-f;t=s*s;for(q=l;q<j;q++){m=p+this.size*q;r=q/this.size-b;u=r*r;for(r=n;r<h;r++)o=r/this.size-a,o=g/(1.0E-6+o*o+u+t)-e,0<o&&(this.field[m+r]+=o)}}};this.addPlaneX=function(a,b){var f,g,e,h,i,j=this.size,k=this.yd,q=this.zd,l=this.field,n=j*Math.sqrt(a/b);n>j&&(n=j);for(f=0;f<n;f++)if(g=f/j,g*=g,h=a/(1.0E-4+g)-b,0<h)for(g=0;g<j;g++){i=f+g*k;for(e=0;e<j;e++)l[q*e+i]+=h}};this.addPlaneY=function(a,b){var f,g,e,h,i,j,k=this.size,q=this.yd,
+l=this.zd,n=this.field,r=k*Math.sqrt(a/b);r>k&&(r=k);for(g=0;g<r;g++)if(f=g/k,f*=f,h=a/(1.0E-4+f)-b,0<h){i=g*q;for(f=0;f<k;f++){j=i+f;for(e=0;e<k;e++)n[l*e+j]+=h}}};this.addPlaneZ=function(a,b){var f,g,e,h,i,j,k=this.size,q=this.yd,l=this.zd,n=this.field,r=k*Math.sqrt(a/b);r>k&&(r=k);for(e=0;e<r;e++)if(f=e/k,f*=f,h=a/(1.0E-4+f)-b,0<h){i=l*e;for(g=0;g<k;g++){j=i+g*q;for(f=0;f<k;f++)n[j+f]+=h}}};this.reset=function(){var a;for(a=0;a<this.size3;a++)this.normal_cache[3*a]=0,this.field[a]=0};this.render=
+function(a){this.begin();var b,f,g,e,h,i,j,k,q,l=this.size-2;for(e=1;e<l;e++){q=this.size2*e;j=(e-this.halfsize)/this.halfsize;for(g=1;g<l;g++){k=q+this.size*g;i=(g-this.halfsize)/this.halfsize;for(f=1;f<l;f++)h=(f-this.halfsize)/this.halfsize,b=k+f,this.polygonize(h,i,j,b,this.isolation,a)}}this.end(a)};this.generateGeometry=function(){var a=0,b=new THREE.Geometry,f=[];this.render(function(g){var e,h,i,j,k,q,l,n;for(e=0;e<g.count;e++)l=3*e,k=l+1,n=l+2,h=g.positionArray[l],i=g.positionArray[k],j=
+g.positionArray[n],q=new THREE.Vector3(h,i,j),h=g.normalArray[l],i=g.normalArray[k],j=g.normalArray[n],l=new THREE.Vector3(h,i,j),l.normalize(),k=new THREE.Vertex(q),b.vertices.push(k),f.push(l);q=g.count/3;for(e=0;e<q;e++)l=3*(a+e),k=l+1,n=l+2,h=f[l],i=f[k],j=f[n],l=new THREE.Face3(l,k,n,[h,i,j]),b.faces.push(l);a+=q;g.count=0});return b};this.init(a)};THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
 THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
 THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
 1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,
 1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,
 419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]);
 419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]);
@@ -381,38 +381,38 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 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.LensFlare=function(a,b,c,d,f){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,f)};THREE.LensFlare.prototype=new THREE.Object3D;THREE.LensFlare.prototype.constructor=THREE.LensFlare;
 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.LensFlare=function(a,b,c,d,f){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,f)};THREE.LensFlare.prototype=new THREE.Object3D;THREE.LensFlare.prototype.constructor=THREE.LensFlare;
 THREE.LensFlare.prototype.supr=THREE.Object3D.prototype;THREE.LensFlare.prototype.add=function(a,b,c,d,f,g){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===g&&(g=1);void 0===f&&(f=new THREE.Color(16777215));if(void 0===d)d=THREE.NormalBlending;c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:g,color:f,blending:d})};
 THREE.LensFlare.prototype.supr=THREE.Object3D.prototype;THREE.LensFlare.prototype.add=function(a,b,c,d,f,g){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===g&&(g=1);void 0===f&&(f=new THREE.Color(16777215));if(void 0===d)d=THREE.NormalBlending;c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:g,color:f,blending:d})};
 THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,f=2*-this.positionScreen.y;for(a=0;a<b;a++)c=this.lensFlares[a],c.x=this.positionScreen.x+d*c.distance,c.y=this.positionScreen.y+f*c.distance,c.wantedRotation=0.25*c.x*Math.PI,c.rotation+=0.25*(c.wantedRotation-c.rotation)};
 THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,f=2*-this.positionScreen.y;for(a=0;a<b;a++)c=this.lensFlares[a],c.x=this.positionScreen.x+d*c.distance,c.y=this.positionScreen.y+f*c.distance,c.wantedRotation=0.25*c.x*Math.PI,c.rotation+=0.25*(c.wantedRotation-c.rotation)};
-THREE.LensFlarePlugin=function(){function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER),e=b.createShader(b.VERTEX_SHADER);b.shaderSource(d,a.fragmentShader);b.shaderSource(e,a.vertexShader);b.compileShader(d);b.compileShader(e);b.attachShader(c,d);b.attachShader(c,e);b.linkProgram(c);return c}var b,c,d,f,g,e,h,i,k,j,q,l,n;this.init=function(r){b=r.context;c=r;d=new Float32Array(16);f=new Uint16Array(6);r=0;d[r++]=-1;d[r++]=-1;d[r++]=0;d[r++]=0;d[r++]=1;d[r++]=-1;d[r++]=1;d[r++]=
+THREE.LensFlarePlugin=function(){function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER),e=b.createShader(b.VERTEX_SHADER);b.shaderSource(d,a.fragmentShader);b.shaderSource(e,a.vertexShader);b.compileShader(d);b.compileShader(e);b.attachShader(c,d);b.attachShader(c,e);b.linkProgram(c);return c}var b,c,d,f,g,e,h,i,j,k,q,l,n;this.init=function(r){b=r.context;c=r;d=new Float32Array(16);f=new Uint16Array(6);r=0;d[r++]=-1;d[r++]=-1;d[r++]=0;d[r++]=0;d[r++]=1;d[r++]=-1;d[r++]=1;d[r++]=
 0;d[r++]=1;d[r++]=1;d[r++]=1;d[r++]=1;d[r++]=-1;d[r++]=1;d[r++]=0;d[r++]=1;r=0;f[r++]=0;f[r++]=1;f[r++]=2;f[r++]=0;f[r++]=2;f[r++]=3;g=b.createBuffer();e=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);h=b.createTexture();i=b.createTexture();b.bindTexture(b.TEXTURE_2D,h);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,
 0;d[r++]=1;d[r++]=1;d[r++]=1;d[r++]=1;d[r++]=-1;d[r++]=1;d[r++]=0;d[r++]=1;r=0;f[r++]=0;f[r++]=1;f[r++]=2;f[r++]=0;f[r++]=2;f[r++]=3;g=b.createBuffer();e=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);h=b.createTexture();i=b.createTexture();b.bindTexture(b.TEXTURE_2D,h);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,
 b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,i);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);
 b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,i);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);
-b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(k=!1,j=a(THREE.ShaderFlares.lensFlare)):(k=!0,j=a(THREE.ShaderFlares.lensFlareVertexTexture));q={};l={};q.vertex=b.getAttribLocation(j,"position");q.uv=b.getAttribLocation(j,"uv");l.renderType=b.getUniformLocation(j,"renderType");l.map=b.getUniformLocation(j,"map");l.occlusionMap=b.getUniformLocation(j,"occlusionMap");l.opacity=b.getUniformLocation(j,"opacity");l.color=b.getUniformLocation(j,
-"color");l.scale=b.getUniformLocation(j,"scale");l.rotation=b.getUniformLocation(j,"rotation");l.screenPosition=b.getUniformLocation(j,"screenPosition");n=!1};this.render=function(a,d,f,p){var a=a.__webglFlares,s=a.length;if(s){var t=new THREE.Vector3,u=p/f,v=0.5*f,w=0.5*p,z=16/p,x=new THREE.Vector2(z*u,z),A=new THREE.Vector3(1,1,0),F=new THREE.Vector2(1,1),E=l,z=q;b.useProgram(j);n||(b.enableVertexAttribArray(q.vertex),b.enableVertexAttribArray(q.uv),n=!0);b.uniform1i(E.occlusionMap,0);b.uniform1i(E.map,
-1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(z.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(z.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e);b.disable(b.CULL_FACE);b.depthMask(!1);var J,G,B,H,D;for(J=0;J<s;J++)if(z=16/p,x.set(z*u,z),H=a[J],t.set(H.matrixWorld.n14,H.matrixWorld.n24,H.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(t),d.projectionMatrix.multiplyVector3(t),A.copy(t),F.x=A.x*v+v,F.y=A.y*w+w,k||0<F.x&&F.x<f&&0<F.y&&F.y<p){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,
+b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(j=!1,k=a(THREE.ShaderFlares.lensFlare)):(j=!0,k=a(THREE.ShaderFlares.lensFlareVertexTexture));q={};l={};q.vertex=b.getAttribLocation(k,"position");q.uv=b.getAttribLocation(k,"uv");l.renderType=b.getUniformLocation(k,"renderType");l.map=b.getUniformLocation(k,"map");l.occlusionMap=b.getUniformLocation(k,"occlusionMap");l.opacity=b.getUniformLocation(k,"opacity");l.color=b.getUniformLocation(k,
+"color");l.scale=b.getUniformLocation(k,"scale");l.rotation=b.getUniformLocation(k,"rotation");l.screenPosition=b.getUniformLocation(k,"screenPosition");n=!1};this.render=function(a,d,f,o){var a=a.__webglFlares,s=a.length;if(s){var t=new THREE.Vector3,u=o/f,v=0.5*f,w=0.5*o,z=16/o,x=new THREE.Vector2(z*u,z),A=new THREE.Vector3(1,1,0),F=new THREE.Vector2(1,1),E=l,z=q;b.useProgram(k);n||(b.enableVertexAttribArray(q.vertex),b.enableVertexAttribArray(q.uv),n=!0);b.uniform1i(E.occlusionMap,0);b.uniform1i(E.map,
+1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(z.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(z.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e);b.disable(b.CULL_FACE);b.depthMask(!1);var J,G,B,H,C;for(J=0;J<s;J++)if(z=16/o,x.set(z*u,z),H=a[J],t.set(H.matrixWorld.n14,H.matrixWorld.n24,H.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(t),d.projectionMatrix.multiplyVector3(t),A.copy(t),F.x=A.x*v+v,F.y=A.y*w+w,j||0<F.x&&F.x<f&&0<F.y&&F.y<o){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,
 h);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,F.x-8,F.y-8,16,16,0);b.uniform1i(E.renderType,0);b.uniform2f(E.scale,x.x,x.y);b.uniform3f(E.screenPosition,A.x,A.y,A.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,F.x-8,F.y-8,16,16,0);b.uniform1i(E.renderType,1);b.disable(b.DEPTH_TEST);b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,h);b.drawElements(b.TRIANGLES,
 h);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,F.x-8,F.y-8,16,16,0);b.uniform1i(E.renderType,0);b.uniform2f(E.scale,x.x,x.y);b.uniform3f(E.screenPosition,A.x,A.y,A.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,F.x-8,F.y-8,16,16,0);b.uniform1i(E.renderType,1);b.disable(b.DEPTH_TEST);b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,h);b.drawElements(b.TRIANGLES,
-6,b.UNSIGNED_SHORT,0);H.positionScreen.copy(A);H.customUpdateCallback?H.customUpdateCallback(H):H.updateLensFlares();b.uniform1i(E.renderType,2);b.enable(b.BLEND);for(G=0,B=H.lensFlares.length;G<B;G++)if(D=H.lensFlares[G],0.0010<D.opacity&&0.0010<D.scale)A.x=D.x,A.y=D.y,A.z=D.z,z=D.size*D.scale/p,x.x=z*u,x.y=z,b.uniform3f(E.screenPosition,A.x,A.y,A.z),b.uniform2f(E.scale,x.x,x.y),b.uniform1f(E.rotation,D.rotation),b.uniform1f(E.opacity,D.opacity),b.uniform3f(E.color,D.color.r,D.color.g,D.color.b),
-c.setBlending(D.blending),c.setTexture(D.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
+6,b.UNSIGNED_SHORT,0);H.positionScreen.copy(A);H.customUpdateCallback?H.customUpdateCallback(H):H.updateLensFlares();b.uniform1i(E.renderType,2);b.enable(b.BLEND);for(G=0,B=H.lensFlares.length;G<B;G++)if(C=H.lensFlares[G],0.001<C.opacity&&0.001<C.scale)A.x=C.x,A.y=C.y,A.z=C.z,z=C.size*C.scale/o,x.x=z*u,x.y=z,b.uniform3f(E.screenPosition,A.x,A.y,A.z),b.uniform2f(E.scale,x.x,x.y),b.uniform1f(E.rotation,C.rotation),b.uniform1f(E.opacity,C.opacity),b.uniform3f(E.color,C.color.r,C.color.g,C.color.b),c.setBlending(C.blending),
+c.setTexture(C.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
 THREE.ShadowMapPlugin=function(){var a,b,c,d,f=new THREE.Frustum,g=new THREE.Matrix4,e=new THREE.Vector3,h=new THREE.Vector3;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:!0});c._shadowPass=!0;d._shadowPass=!0};this.render=function(a,
 THREE.ShadowMapPlugin=function(){var a,b,c,d,f=new THREE.Frustum,g=new THREE.Matrix4,e=new THREE.Vector3,h=new THREE.Vector3;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:!0});c._shadowPass=!0;d._shadowPass=!0};this.render=function(a,
-c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(i,k){var j,q,l,n,r,m,o,p,s,t=[];n=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.shadowMapCullFrontFaces&&a.cullFace(a.FRONT);b.setDepthTest(!0);for(j=0,q=i.lights.length;j<q;j++)if(l=i.lights[j],l.castShadow)if(l instanceof THREE.DirectionalLight&&l.shadowCascade)for(r=0;r<l.shadowCascadeCount;r++){var u;if(l.shadowCascadeArray[r])u=l.shadowCascadeArray[r];else{s=l;o=r;u=new THREE.DirectionalLight;u.isVirtual=!0;u.onlyShadow=
-!0;u.castShadow=!0;u.shadowCameraNear=s.shadowCameraNear;u.shadowCameraFar=s.shadowCameraFar;u.shadowCameraLeft=s.shadowCameraLeft;u.shadowCameraRight=s.shadowCameraRight;u.shadowCameraBottom=s.shadowCameraBottom;u.shadowCameraTop=s.shadowCameraTop;u.shadowCameraVisible=s.shadowCameraVisible;u.shadowDarkness=s.shadowDarkness;u.shadowBias=s.shadowCascadeBias[o];u.shadowMapWidth=s.shadowCascadeWidth[o];u.shadowMapHeight=s.shadowCascadeHeight[o];u.pointsWorld=[];u.pointsFrustum=[];p=u.pointsWorld;m=
-u.pointsFrustum;for(var v=0;8>v;v++)p[v]=new THREE.Vector3,m[v]=new THREE.Vector3;p=s.shadowCascadeNearZ[o];s=s.shadowCascadeFarZ[o];m[0].set(-1,-1,p);m[1].set(1,-1,p);m[2].set(-1,1,p);m[3].set(1,1,p);m[4].set(-1,-1,s);m[5].set(1,-1,s);m[6].set(-1,1,s);m[7].set(1,1,s);u.originalCamera=k;m=new THREE.Gyroscope;m.position=l.shadowCascadeOffset;m.add(u);m.add(u.target);k.add(m);l.shadowCascadeArray[r]=u;console.log("Created virtualLight",u)}o=l;p=r;s=o.shadowCascadeArray[p];s.position.copy(o.position);
-s.target.position.copy(o.target.position);s.lookAt(s.target);s.shadowCameraVisible=o.shadowCameraVisible;s.shadowDarkness=o.shadowDarkness;s.shadowBias=o.shadowCascadeBias[p];m=o.shadowCascadeNearZ[p];o=o.shadowCascadeFarZ[p];s=s.pointsFrustum;s[0].z=m;s[1].z=m;s[2].z=m;s[3].z=m;s[4].z=o;s[5].z=o;s[6].z=o;s[7].z=o;t[n]=u;n++}else t[n]=l,n++;for(j=0,q=t.length;j<q;j++){l=t[j];if(!l.shadowMap)l.shadowMap=new THREE.WebGLRenderTarget(l.shadowMapWidth,l.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,
+c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(i,j){var k,q,l,n,r,m,p,o,s,t=[];n=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.shadowMapCullFrontFaces&&a.cullFace(a.FRONT);b.setDepthTest(!0);for(k=0,q=i.lights.length;k<q;k++)if(l=i.lights[k],l.castShadow)if(l instanceof THREE.DirectionalLight&&l.shadowCascade)for(r=0;r<l.shadowCascadeCount;r++){var u;if(l.shadowCascadeArray[r])u=l.shadowCascadeArray[r];else{s=l;p=r;u=new THREE.DirectionalLight;u.isVirtual=!0;u.onlyShadow=
+!0;u.castShadow=!0;u.shadowCameraNear=s.shadowCameraNear;u.shadowCameraFar=s.shadowCameraFar;u.shadowCameraLeft=s.shadowCameraLeft;u.shadowCameraRight=s.shadowCameraRight;u.shadowCameraBottom=s.shadowCameraBottom;u.shadowCameraTop=s.shadowCameraTop;u.shadowCameraVisible=s.shadowCameraVisible;u.shadowDarkness=s.shadowDarkness;u.shadowBias=s.shadowCascadeBias[p];u.shadowMapWidth=s.shadowCascadeWidth[p];u.shadowMapHeight=s.shadowCascadeHeight[p];u.pointsWorld=[];u.pointsFrustum=[];o=u.pointsWorld;m=
+u.pointsFrustum;for(var v=0;8>v;v++)o[v]=new THREE.Vector3,m[v]=new THREE.Vector3;o=s.shadowCascadeNearZ[p];s=s.shadowCascadeFarZ[p];m[0].set(-1,-1,o);m[1].set(1,-1,o);m[2].set(-1,1,o);m[3].set(1,1,o);m[4].set(-1,-1,s);m[5].set(1,-1,s);m[6].set(-1,1,s);m[7].set(1,1,s);u.originalCamera=j;m=new THREE.Gyroscope;m.position=l.shadowCascadeOffset;m.add(u);m.add(u.target);j.add(m);l.shadowCascadeArray[r]=u;console.log("Created virtualLight",u)}p=l;o=r;s=p.shadowCascadeArray[o];s.position.copy(p.position);
+s.target.position.copy(p.target.position);s.lookAt(s.target);s.shadowCameraVisible=p.shadowCameraVisible;s.shadowDarkness=p.shadowDarkness;s.shadowBias=p.shadowCascadeBias[o];m=p.shadowCascadeNearZ[o];p=p.shadowCascadeFarZ[o];s=s.pointsFrustum;s[0].z=m;s[1].z=m;s[2].z=m;s[3].z=m;s[4].z=p;s[5].z=p;s[6].z=p;s[7].z=p;t[n]=u;n++}else t[n]=l,n++;for(k=0,q=t.length;k<q;k++){l=t[k];if(!l.shadowMap)l.shadowMap=new THREE.WebGLRenderTarget(l.shadowMapWidth,l.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,
 format:THREE.RGBAFormat}),l.shadowMapSize=new THREE.Vector2(l.shadowMapWidth,l.shadowMapHeight),l.shadowMatrix=new THREE.Matrix4;if(!l.shadowCamera){if(l instanceof THREE.SpotLight)l.shadowCamera=new THREE.PerspectiveCamera(l.shadowCameraFov,l.shadowMapWidth/l.shadowMapHeight,l.shadowCameraNear,l.shadowCameraFar);else if(l instanceof THREE.DirectionalLight)l.shadowCamera=new THREE.OrthographicCamera(l.shadowCameraLeft,l.shadowCameraRight,l.shadowCameraTop,l.shadowCameraBottom,l.shadowCameraNear,l.shadowCameraFar);
 format:THREE.RGBAFormat}),l.shadowMapSize=new THREE.Vector2(l.shadowMapWidth,l.shadowMapHeight),l.shadowMatrix=new THREE.Matrix4;if(!l.shadowCamera){if(l instanceof THREE.SpotLight)l.shadowCamera=new THREE.PerspectiveCamera(l.shadowCameraFov,l.shadowMapWidth/l.shadowMapHeight,l.shadowCameraNear,l.shadowCameraFar);else if(l instanceof THREE.DirectionalLight)l.shadowCamera=new THREE.OrthographicCamera(l.shadowCameraLeft,l.shadowCameraRight,l.shadowCameraTop,l.shadowCameraBottom,l.shadowCameraNear,l.shadowCameraFar);
-else{console.error("Unsupported light type for shadow");continue}i.add(l.shadowCamera);b.autoUpdateScene&&i.updateMatrixWorld()}if(l.shadowCameraVisible&&!l.cameraHelper)l.cameraHelper=new THREE.CameraHelper(l.shadowCamera),l.shadowCamera.add(l.cameraHelper);if(l.isVirtual&&u.originalCamera==k){r=k;n=l.shadowCamera;m=l.pointsFrustum;s=l.pointsWorld;e.set(Infinity,Infinity,Infinity);h.set(-Infinity,-Infinity,-Infinity);for(o=0;8>o;o++){p=s[o];p.copy(m[o]);THREE.ShadowMapPlugin.__projector.unprojectVector(p,
-r);n.matrixWorldInverse.multiplyVector3(p);if(p.x<e.x)e.x=p.x;if(p.x>h.x)h.x=p.x;if(p.y<e.y)e.y=p.y;if(p.y>h.y)h.y=p.y;if(p.z<e.z)e.z=p.z;if(p.z>h.z)h.z=p.z}n.left=e.x;n.right=h.x;n.top=h.y;n.bottom=e.y;n.updateProjectionMatrix()}n=l.shadowMap;m=l.shadowMatrix;r=l.shadowCamera;r.position.copy(l.matrixWorld.getPosition());r.lookAt(l.target.matrixWorld.getPosition());r.updateMatrixWorld();r.matrixWorldInverse.getInverse(r.matrixWorld);if(l.cameraHelper)l.cameraHelper.lines.visible=l.shadowCameraVisible;
+else{console.error("Unsupported light type for shadow");continue}i.add(l.shadowCamera);b.autoUpdateScene&&i.updateMatrixWorld()}if(l.shadowCameraVisible&&!l.cameraHelper)l.cameraHelper=new THREE.CameraHelper(l.shadowCamera),l.shadowCamera.add(l.cameraHelper);if(l.isVirtual&&u.originalCamera==j){r=j;n=l.shadowCamera;m=l.pointsFrustum;s=l.pointsWorld;e.set(Infinity,Infinity,Infinity);h.set(-Infinity,-Infinity,-Infinity);for(p=0;8>p;p++){o=s[p];o.copy(m[p]);THREE.ShadowMapPlugin.__projector.unprojectVector(o,
+r);n.matrixWorldInverse.multiplyVector3(o);if(o.x<e.x)e.x=o.x;if(o.x>h.x)h.x=o.x;if(o.y<e.y)e.y=o.y;if(o.y>h.y)h.y=o.y;if(o.z<e.z)e.z=o.z;if(o.z>h.z)h.z=o.z}n.left=e.x;n.right=h.x;n.top=h.y;n.bottom=e.y;n.updateProjectionMatrix()}n=l.shadowMap;m=l.shadowMatrix;r=l.shadowCamera;r.position.copy(l.matrixWorld.getPosition());r.lookAt(l.target.matrixWorld.getPosition());r.updateMatrixWorld();r.matrixWorldInverse.getInverse(r.matrixWorld);if(l.cameraHelper)l.cameraHelper.lines.visible=l.shadowCameraVisible;
 l.shadowCameraVisible&&l.cameraHelper.update(l.shadowCamera);m.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);m.multiplySelf(r.projectionMatrix);m.multiplySelf(r.matrixWorldInverse);if(!r._viewMatrixArray)r._viewMatrixArray=new Float32Array(16);r.matrixWorldInverse.flattenToArray(r._viewMatrixArray);if(!r._projectionMatrixArray)r._projectionMatrixArray=new Float32Array(16);r.projectionMatrix.flattenToArray(r._projectionMatrixArray);g.multiply(r.projectionMatrix,r.matrixWorldInverse);f.setFromMatrix(g);
 l.shadowCameraVisible&&l.cameraHelper.update(l.shadowCamera);m.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);m.multiplySelf(r.projectionMatrix);m.multiplySelf(r.matrixWorldInverse);if(!r._viewMatrixArray)r._viewMatrixArray=new Float32Array(16);r.matrixWorldInverse.flattenToArray(r._viewMatrixArray);if(!r._projectionMatrixArray)r._projectionMatrixArray=new Float32Array(16);r.projectionMatrix.flattenToArray(r._projectionMatrixArray);g.multiply(r.projectionMatrix,r.matrixWorldInverse);f.setFromMatrix(g);
-b.setRenderTarget(n);b.clear();s=i.__webglObjects;for(l=0,n=s.length;l<n;l++)if(o=s[l],m=o.object,o.render=!1,m.visible&&m.castShadow&&(!(m instanceof THREE.Mesh)||!m.frustumCulled||f.contains(m)))m.matrixWorld.flattenToArray(m._objectMatrixArray),m._modelViewMatrix.multiplyToArray(r.matrixWorldInverse,m.matrixWorld,m._modelViewMatrixArray),o.render=!0;for(l=0,n=s.length;l<n;l++)if(o=s[l],o.render)m=o.object,o=o.buffer,b.setObjectFaces(m),p=m.customDepthMaterial?m.customDepthMaterial:m.geometry.morphTargets.length?
-d:c,o instanceof THREE.BufferGeometry?b.renderBufferDirect(r,i.lights,null,p,o,m):b.renderBuffer(r,i.lights,null,p,o,m);s=i.__webglObjectsImmediate;for(l=0,n=s.length;l<n;l++)o=s[l],m=o.object,m.visible&&m.castShadow&&(m.matrixAutoUpdate&&m.matrixWorld.flattenToArray(m._objectMatrixArray),m._modelViewMatrix.multiplyToArray(r.matrixWorldInverse,m.matrixWorld,m._modelViewMatrixArray),b.renderImmediateObject(r,i.lights,null,c,m))}j=b.getClearColor();q=b.getClearAlpha();a.clearColor(j.r,j.g,j.b,q);a.enable(a.BLEND);
+b.setRenderTarget(n);b.clear();s=i.__webglObjects;for(l=0,n=s.length;l<n;l++)if(p=s[l],m=p.object,p.render=!1,m.visible&&m.castShadow&&(!(m instanceof THREE.Mesh)||!m.frustumCulled||f.contains(m)))m.matrixWorld.flattenToArray(m._objectMatrixArray),m._modelViewMatrix.multiplyToArray(r.matrixWorldInverse,m.matrixWorld,m._modelViewMatrixArray),p.render=!0;for(l=0,n=s.length;l<n;l++)if(p=s[l],p.render)m=p.object,p=p.buffer,b.setObjectFaces(m),o=m.customDepthMaterial?m.customDepthMaterial:m.geometry.morphTargets.length?
+d:c,p instanceof THREE.BufferGeometry?b.renderBufferDirect(r,i.lights,null,o,p,m):b.renderBuffer(r,i.lights,null,o,p,m);s=i.__webglObjectsImmediate;for(l=0,n=s.length;l<n;l++)p=s[l],m=p.object,m.visible&&m.castShadow&&(m.matrixAutoUpdate&&m.matrixWorld.flattenToArray(m._objectMatrixArray),m._modelViewMatrix.multiplyToArray(r.matrixWorldInverse,m.matrixWorld,m._modelViewMatrixArray),b.renderImmediateObject(r,i.lights,null,c,m))}k=b.getClearColor();q=b.getClearAlpha();a.clearColor(k.r,k.g,k.b,q);a.enable(a.BLEND);
 b.shadowMapCullFrontFaces&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;
 b.shadowMapCullFrontFaces&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;
-THREE.SpritePlugin=function(){function a(a,b){return b.z-a.z}var b,c,d,f,g,e,h,i,k,j;this.init=function(a){b=a.context;c=a;d=new Float32Array(16);f=new Uint16Array(6);a=0;d[a++]=-1;d[a++]=-1;d[a++]=0;d[a++]=1;d[a++]=1;d[a++]=-1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=0;d[a++]=-1;d[a++]=1;d[a++]=0;a=d[a++]=0;f[a++]=0;f[a++]=1;f[a++]=2;f[a++]=0;f[a++]=2;f[a++]=3;g=b.createBuffer();e=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,
-e);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);var a=THREE.ShaderSprite.sprite,l=b.createProgram(),n=b.createShader(b.FRAGMENT_SHADER),r=b.createShader(b.VERTEX_SHADER);b.shaderSource(n,a.fragmentShader);b.shaderSource(r,a.vertexShader);b.compileShader(n);b.compileShader(r);b.attachShader(l,n);b.attachShader(l,r);b.linkProgram(l);h=l;i={};k={};i.position=b.getAttribLocation(h,"position");i.uv=b.getAttribLocation(h,"uv");k.uvOffset=b.getUniformLocation(h,"uvOffset");k.uvScale=b.getUniformLocation(h,
-"uvScale");k.rotation=b.getUniformLocation(h,"rotation");k.scale=b.getUniformLocation(h,"scale");k.alignment=b.getUniformLocation(h,"alignment");k.color=b.getUniformLocation(h,"color");k.map=b.getUniformLocation(h,"map");k.opacity=b.getUniformLocation(h,"opacity");k.useScreenCoordinates=b.getUniformLocation(h,"useScreenCoordinates");k.affectedByDistance=b.getUniformLocation(h,"affectedByDistance");k.screenPosition=b.getUniformLocation(h,"screenPosition");k.modelViewMatrix=b.getUniformLocation(h,"modelViewMatrix");
-k.projectionMatrix=b.getUniformLocation(h,"projectionMatrix");j=!1};this.render=function(d,f,n,r){var d=d.__webglSprites,m=d.length;if(m){var o=i,p=k,s=r/n,n=0.5*n,t=0.5*r,u=!0;b.useProgram(h);j||(b.enableVertexAttribArray(o.position),b.enableVertexAttribArray(o.uv),j=!0);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.depthMask(!0);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(o.position,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(o.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e);b.uniformMatrix4fv(p.projectionMatrix,
-!1,f._projectionMatrixArray);b.activeTexture(b.TEXTURE0);b.uniform1i(p.map,0);for(var v,w=[],o=0;o<m;o++)if(v=d[o],v.visible&&0!==v.opacity)v.useScreenCoordinates?v.z=-v.position.z:(v._modelViewMatrix.multiplyToArray(f.matrixWorldInverse,v.matrixWorld,v._modelViewMatrixArray),v.z=-v._modelViewMatrix.n34);d.sort(a);for(o=0;o<m;o++)v=d[o],v.visible&&0!==v.opacity&&v.map&&v.map.image&&v.map.image.width&&(v.useScreenCoordinates?(b.uniform1i(p.useScreenCoordinates,1),b.uniform3f(p.screenPosition,(v.position.x-
-n)/n,(t-v.position.y)/t,Math.max(0,Math.min(1,v.position.z)))):(b.uniform1i(p.useScreenCoordinates,0),b.uniform1i(p.affectedByDistance,v.affectedByDistance?1:0),b.uniformMatrix4fv(p.modelViewMatrix,!1,v._modelViewMatrixArray)),f=v.map.image.width/(v.scaleByViewport?r:1),w[0]=f*s*v.scale.x,w[1]=f*v.scale.y,b.uniform2f(p.uvScale,v.uvScale.x,v.uvScale.y),b.uniform2f(p.uvOffset,v.uvOffset.x,v.uvOffset.y),b.uniform2f(p.alignment,v.alignment.x,v.alignment.y),b.uniform1f(p.opacity,v.opacity),b.uniform3f(p.color,
-v.color.r,v.color.g,v.color.b),b.uniform1f(p.rotation,v.rotation),b.uniform2fv(p.scale,w),v.mergeWith3D&&!u?(b.enable(b.DEPTH_TEST),u=!0):!v.mergeWith3D&&u&&(b.disable(b.DEPTH_TEST),u=!1),c.setBlending(v.blending),c.setTexture(v.map,0),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
-if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoUpdateScene=!1;var b=this,c=this.setSize,d=this.render,f=new THREE.PerspectiveCamera,g=new THREE.PerspectiveCamera,e=new THREE.Matrix4,h=new THREE.Matrix4,i,k,j,q;f.matrixAutoUpdate=g.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},l=new THREE.WebGLRenderTarget(512,512,a),n=new THREE.WebGLRenderTarget(512,512,a),r=new THREE.PerspectiveCamera(53,
+THREE.SpritePlugin=function(){function a(a,b){return b.z-a.z}var b,c,d,f,g,e,h,i,j,k;this.init=function(a){b=a.context;c=a;d=new Float32Array(16);f=new Uint16Array(6);a=0;d[a++]=-1;d[a++]=-1;d[a++]=0;d[a++]=1;d[a++]=1;d[a++]=-1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=1;d[a++]=0;d[a++]=-1;d[a++]=1;d[a++]=0;a=d[a++]=0;f[a++]=0;f[a++]=1;f[a++]=2;f[a++]=0;f[a++]=2;f[a++]=3;g=b.createBuffer();e=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,
+e);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);var a=THREE.ShaderSprite.sprite,l=b.createProgram(),n=b.createShader(b.FRAGMENT_SHADER),r=b.createShader(b.VERTEX_SHADER);b.shaderSource(n,a.fragmentShader);b.shaderSource(r,a.vertexShader);b.compileShader(n);b.compileShader(r);b.attachShader(l,n);b.attachShader(l,r);b.linkProgram(l);h=l;i={};j={};i.position=b.getAttribLocation(h,"position");i.uv=b.getAttribLocation(h,"uv");j.uvOffset=b.getUniformLocation(h,"uvOffset");j.uvScale=b.getUniformLocation(h,
+"uvScale");j.rotation=b.getUniformLocation(h,"rotation");j.scale=b.getUniformLocation(h,"scale");j.alignment=b.getUniformLocation(h,"alignment");j.color=b.getUniformLocation(h,"color");j.map=b.getUniformLocation(h,"map");j.opacity=b.getUniformLocation(h,"opacity");j.useScreenCoordinates=b.getUniformLocation(h,"useScreenCoordinates");j.affectedByDistance=b.getUniformLocation(h,"affectedByDistance");j.screenPosition=b.getUniformLocation(h,"screenPosition");j.modelViewMatrix=b.getUniformLocation(h,"modelViewMatrix");
+j.projectionMatrix=b.getUniformLocation(h,"projectionMatrix");k=!1};this.render=function(d,f,n,r){var d=d.__webglSprites,m=d.length;if(m){var p=i,o=j,s=r/n,n=0.5*n,t=0.5*r,u=!0;b.useProgram(h);k||(b.enableVertexAttribArray(p.position),b.enableVertexAttribArray(p.uv),k=!0);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.depthMask(!0);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(p.position,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(p.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e);b.uniformMatrix4fv(o.projectionMatrix,
+!1,f._projectionMatrixArray);b.activeTexture(b.TEXTURE0);b.uniform1i(o.map,0);for(var v,w=[],p=0;p<m;p++)if(v=d[p],v.visible&&0!==v.opacity)v.useScreenCoordinates?v.z=-v.position.z:(v._modelViewMatrix.multiplyToArray(f.matrixWorldInverse,v.matrixWorld,v._modelViewMatrixArray),v.z=-v._modelViewMatrix.n34);d.sort(a);for(p=0;p<m;p++)v=d[p],v.visible&&0!==v.opacity&&v.map&&v.map.image&&v.map.image.width&&(v.useScreenCoordinates?(b.uniform1i(o.useScreenCoordinates,1),b.uniform3f(o.screenPosition,(v.position.x-
+n)/n,(t-v.position.y)/t,Math.max(0,Math.min(1,v.position.z)))):(b.uniform1i(o.useScreenCoordinates,0),b.uniform1i(o.affectedByDistance,v.affectedByDistance?1:0),b.uniformMatrix4fv(o.modelViewMatrix,!1,v._modelViewMatrixArray)),f=v.map.image.width/(v.scaleByViewport?r:1),w[0]=f*s*v.scale.x,w[1]=f*v.scale.y,b.uniform2f(o.uvScale,v.uvScale.x,v.uvScale.y),b.uniform2f(o.uvOffset,v.uvOffset.x,v.uvOffset.y),b.uniform2f(o.alignment,v.alignment.x,v.alignment.y),b.uniform1f(o.opacity,v.opacity),b.uniform3f(o.color,
+v.color.r,v.color.g,v.color.b),b.uniform1f(o.rotation,v.rotation),b.uniform2fv(o.scale,w),v.mergeWith3D&&!u?(b.enable(b.DEPTH_TEST),u=!0):!v.mergeWith3D&&u&&(b.disable(b.DEPTH_TEST),u=!1),c.setBlending(v.blending),c.setTexture(v.map,0),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
+if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoUpdateScene=!1;var b=this,c=this.setSize,d=this.render,f=new THREE.PerspectiveCamera,g=new THREE.PerspectiveCamera,e=new THREE.Matrix4,h=new THREE.Matrix4,i,j,k,q;f.matrixAutoUpdate=g.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},l=new THREE.WebGLRenderTarget(512,512,a),n=new THREE.WebGLRenderTarget(512,512,a),r=new THREE.PerspectiveCamera(53,
 1,1,1E4);r.position.z=2;var a=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:l},mapRight:{type:"t",value:1,texture:n}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}),
 1,1,1E4);r.position.z=2;var a=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:l},mapRight:{type:"t",value:1,texture:n}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}),
-m=new THREE.Scene;m.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),a));m.add(r);this.setSize=function(a,d){c.call(b,a,d);l.width=a;l.height=d;n.width=a;n.height=d};this.render=function(a,c){a.updateMatrixWorld();if(i!==c.aspect||k!==c.near||j!==c.far||q!==c.fov){i=c.aspect;k=c.near;j=c.far;q=c.fov;var s=c.projectionMatrix.clone(),t=0.5*(125/30),u=t*k/125,v=k*Math.tan(q*Math.PI/360),w;e.n14=t;h.n14=-t;t=-v*i+u;w=v*i+u;s.n11=2*k/(w-t);s.n13=(w+t)/(w-t);f.projectionMatrix.copy(s);t=-v*i-u;w=v*i-u;s.n11=
-2*k/(w-t);s.n13=(w+t)/(w-t);g.projectionMatrix.copy(s)}f.matrixWorld.copy(c.matrixWorld).multiplySelf(h);f.position.copy(c.position);f.near=c.near;f.far=c.far;d.call(b,a,f,l,!0);g.matrixWorld.copy(c.matrixWorld).multiplySelf(e);g.position.copy(c.position);g.near=c.near;g.far=c.far;d.call(b,a,g,n,!0);m.updateMatrixWorld();d.call(b,m,r)}};
+m=new THREE.Scene;m.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),a));m.add(r);this.setSize=function(a,d){c.call(b,a,d);l.width=a;l.height=d;n.width=a;n.height=d};this.render=function(a,c){a.updateMatrixWorld();if(i!==c.aspect||j!==c.near||k!==c.far||q!==c.fov){i=c.aspect;j=c.near;k=c.far;q=c.fov;var s=c.projectionMatrix.clone(),t=0.5*(125/30),u=t*j/125,v=j*Math.tan(q*Math.PI/360),w;e.n14=t;h.n14=-t;t=-v*i+u;w=v*i+u;s.n11=2*j/(w-t);s.n13=(w+t)/(w-t);f.projectionMatrix.copy(s);t=-v*i-u;w=v*i-u;s.n11=
+2*j/(w-t);s.n13=(w+t)/(w-t);g.projectionMatrix.copy(s)}f.matrixWorld.copy(c.matrixWorld).multiplySelf(h);f.position.copy(c.position);f.near=c.near;f.far=c.far;d.call(b,a,f,l,!0);g.matrixWorld.copy(c.matrixWorld).multiplySelf(e);g.position.copy(c.position);g.near=c.near;g.far=c.far;d.call(b,a,g,n,!0);m.updateMatrixWorld();d.call(b,m,r)}};
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,d=this.render,f,g,e=new THREE.PerspectiveCamera;e.target=new THREE.Vector3(0,0,0);var h=new THREE.PerspectiveCamera;h.target=new THREE.Vector3(0,0,0);b.separation=10;if(a&&void 0!==a.separation)b.separation=a.separation;this.setSize=function(a,d){c.call(b,a,d);f=a/2;g=d};this.render=function(a,c){this.clear();e.fov=c.fov;e.aspect=0.5*c.aspect;e.near=c.near;e.far=
 if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,d=this.render,f,g,e=new THREE.PerspectiveCamera;e.target=new THREE.Vector3(0,0,0);var h=new THREE.PerspectiveCamera;h.target=new THREE.Vector3(0,0,0);b.separation=10;if(a&&void 0!==a.separation)b.separation=a.separation;this.setSize=function(a,d){c.call(b,a,d);f=a/2;g=d};this.render=function(a,c){this.clear();e.fov=c.fov;e.aspect=0.5*c.aspect;e.near=c.near;e.far=
 c.far;e.updateProjectionMatrix();e.position.copy(c.position);e.target.copy(c.target);e.translateX(b.separation);e.lookAt(e.target);h.projectionMatrix=e.projectionMatrix;h.position.copy(c.position);h.target.copy(c.target);h.translateX(-b.separation);h.lookAt(h.target);this.setViewport(0,0,f,g);d.call(b,a,e);this.setViewport(f,0,f,g);d.call(b,a,h,!1)}};
 c.far;e.updateProjectionMatrix();e.position.copy(c.position);e.target.copy(c.target);e.translateX(b.separation);e.lookAt(e.target);h.projectionMatrix=e.projectionMatrix;h.position.copy(c.position);h.target.copy(c.target);h.translateX(-b.separation);h.lookAt(h.target);this.setViewport(0,0,f,g);d.call(b,a,e);this.setViewport(f,0,f,g);d.call(b,a,h,!1)}};
 THREE.ShaderFlares={lensFlareVertexTexture:{vertexShader:"uniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform int renderType;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.5 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.1, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.1, 0.5 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = (       visibility.r / 9.0 ) *\n( 1.0 - visibility.g / 9.0 ) *\n(       visibility.b / 9.0 ) *\n( 1.0 - visibility.a / 9.0 );\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"precision mediump float;\nuniform sampler2D map;\nuniform float opacity;\nuniform int renderType;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
 THREE.ShaderFlares={lensFlareVertexTexture:{vertexShader:"uniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform int renderType;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.1 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.5 ) ) +\ntexture2D( occlusionMap, vec2( 0.9, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.1, 0.9 ) ) +\ntexture2D( occlusionMap, vec2( 0.1, 0.5 ) ) +\ntexture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = (       visibility.r / 9.0 ) *\n( 1.0 - visibility.g / 9.0 ) *\n(       visibility.b / 9.0 ) *\n( 1.0 - visibility.a / 9.0 );\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"precision mediump float;\nuniform sampler2D map;\nuniform float opacity;\nuniform int renderType;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},

+ 1 - 1
build/custom/ThreeSVG.js

@@ -78,7 +78,7 @@ f-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this
 -Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=
 -Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=
 this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y=c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=
 this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y=c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=
 a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,l=this.w,i=l*c+g*e-h*d,j=l*d+h*c-f*e,m=l*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=i*l+c*-f+j*-h-m*-g;b.y=j*l+c*-g+m*-f-i*-h;b.z=m*l+c*-h+i*-g-j*-f;return b}};
 a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,l=this.w,i=l*c+g*e-h*d,j=l*d+h*c-f*e,m=l*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=i*l+c*-f+j*-h-m*-g;b.y=j*l+c*-g+m*-f-i*-h;b.z=m*l+c*-h+i*-g-j*-f;return b}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var f=Math.acos(e),e=Math.sqrt(1-e*e);if(0.0010>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var f=Math.acos(e),e=Math.sqrt(1-e*e);if(0.001>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
 THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
 THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};

+ 2 - 2
build/custom/ThreeWebGL.js

@@ -79,7 +79,7 @@ g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this
 -Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=
 -Math.abs(this.y):Math.abs(this.y);this.z=0>a.n21-a.n12?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?this.w=this.z=
 this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,h=a.y,i=a.z,a=a.w;this.x=b*a+e*g+c*i-d*h;this.y=c*a+e*h+d*g-b*i;this.z=d*a+e*i+b*h-c*g;this.w=e*a-b*g-c*h-d*i;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=
 this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,g=a.x,h=a.y,i=a.z,a=a.w;this.x=b*a+e*g+c*i-d*h;this.y=c*a+e*h+d*g-b*i;this.z=d*a+e*i+b*h-c*g;this.w=e*a-b*g-c*h-d*i;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=
 a);var c=a.x,d=a.y,e=a.z,g=this.x,h=this.y,i=this.z,k=this.w,l=k*c+h*e-i*d,j=k*d+i*c-g*e,n=k*e+g*d-h*c,c=-g*c-h*d-i*e;b.x=l*k+c*-g+j*-i-n*-h;b.y=j*k+c*-h+n*-g-l*-i;b.z=n*k+c*-i+l*-h-j*-g;return b}};
 a);var c=a.x,d=a.y,e=a.z,g=this.x,h=this.y,i=this.z,k=this.w,l=k*c+h*e-i*d,j=k*d+i*c-g*e,n=k*e+g*d-h*c,c=-g*c-h*d-i*e;b.x=l*k+c*-g+j*-i-n*-h;b.y=j*k+c*-h+n*-g-l*-i;b.z=n*k+c*-i+l*-h-j*-g;return b}};
-THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),e=Math.sqrt(1-e*e);if(0.0010>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*g)/e;d=Math.sin(d*g)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
+THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;0>e?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,e=-e):c.copy(b);if(1<=Math.abs(e))return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),e=Math.sqrt(1-e*e);if(0.001>Math.abs(e))return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*g)/e;d=Math.sin(d*g)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
 THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
 THREE.Face4=function(a,b,c,d,e,g,h){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
 THREE.Face4=function(a,b,c,d,e,g,h){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
 THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
@@ -374,7 +374,7 @@ b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b
 "color");m.scale=b.getUniformLocation(j,"scale");m.rotation=b.getUniformLocation(j,"rotation");m.screenPosition=b.getUniformLocation(j,"screenPosition");q=!1};this.render=function(a,d,e,y){var a=a.__webglFlares,u=a.length;if(u){var K=new THREE.Vector3,A=y/e,v=0.5*e,I=0.5*y,B=16/y,E=new THREE.Vector2(B*A,B),L=new THREE.Vector3(1,1,0),J=new THREE.Vector2(1,1),N=m,B=n;b.useProgram(j);q||(b.enableVertexAttribArray(n.vertex),b.enableVertexAttribArray(n.uv),q=!0);b.uniform1i(N.occlusionMap,0);b.uniform1i(N.map,
 "color");m.scale=b.getUniformLocation(j,"scale");m.rotation=b.getUniformLocation(j,"rotation");m.screenPosition=b.getUniformLocation(j,"screenPosition");q=!1};this.render=function(a,d,e,y){var a=a.__webglFlares,u=a.length;if(u){var K=new THREE.Vector3,A=y/e,v=0.5*e,I=0.5*y,B=16/y,E=new THREE.Vector2(B*A,B),L=new THREE.Vector3(1,1,0),J=new THREE.Vector2(1,1),N=m,B=n;b.useProgram(j);q||(b.enableVertexAttribArray(n.vertex),b.enableVertexAttribArray(n.uv),q=!0);b.uniform1i(N.occlusionMap,0);b.uniform1i(N.map,
 1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(B.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(B.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(!1);var ja,oa,ka,X,$;for(ja=0;ja<u;ja++)if(B=16/y,E.set(B*A,B),X=a[ja],K.set(X.matrixWorld.n14,X.matrixWorld.n24,X.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(K),d.projectionMatrix.multiplyVector3(K),L.copy(K),J.x=L.x*v+v,J.y=L.y*I+I,l||0<J.x&&J.x<e&&0<J.y&&J.y<y){b.activeTexture(b.TEXTURE1);
 1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(B.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(B.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(!1);var ja,oa,ka,X,$;for(ja=0;ja<u;ja++)if(B=16/y,E.set(B*A,B),X=a[ja],K.set(X.matrixWorld.n14,X.matrixWorld.n24,X.matrixWorld.n34),d.matrixWorldInverse.multiplyVector3(K),d.projectionMatrix.multiplyVector3(K),L.copy(K),J.x=L.x*v+v,J.y=L.y*I+I,l||0<J.x&&J.x<e&&0<J.y&&J.y<y){b.activeTexture(b.TEXTURE1);
 b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,J.x-8,J.y-8,16,16,0);b.uniform1i(N.renderType,0);b.uniform2f(N.scale,E.x,E.y);b.uniform3f(N.screenPosition,L.x,L.y,L.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,k);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,J.x-8,J.y-8,16,16,0);b.uniform1i(N.renderType,1);b.disable(b.DEPTH_TEST);b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,
 b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,J.x-8,J.y-8,16,16,0);b.uniform1i(N.renderType,0);b.uniform2f(N.scale,E.x,E.y);b.uniform3f(N.screenPosition,L.x,L.y,L.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,k);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,J.x-8,J.y-8,16,16,0);b.uniform1i(N.renderType,1);b.disable(b.DEPTH_TEST);b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,
-i);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);X.positionScreen.copy(L);X.customUpdateCallback?X.customUpdateCallback(X):X.updateLensFlares();b.uniform1i(N.renderType,2);b.enable(b.BLEND);for(oa=0,ka=X.lensFlares.length;oa<ka;oa++)if($=X.lensFlares[oa],0.0010<$.opacity&&0.0010<$.scale)L.x=$.x,L.y=$.y,L.z=$.z,B=$.size*$.scale/y,E.x=B*A,E.y=B,b.uniform3f(N.screenPosition,L.x,L.y,L.z),b.uniform2f(N.scale,E.x,E.y),b.uniform1f(N.rotation,$.rotation),b.uniform1f(N.opacity,$.opacity),b.uniform3f(N.color,
+i);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);X.positionScreen.copy(L);X.customUpdateCallback?X.customUpdateCallback(X):X.updateLensFlares();b.uniform1i(N.renderType,2);b.enable(b.BLEND);for(oa=0,ka=X.lensFlares.length;oa<ka;oa++)if($=X.lensFlares[oa],0.001<$.opacity&&0.001<$.scale)L.x=$.x,L.y=$.y,L.z=$.z,B=$.size*$.scale/y,E.x=B*A,E.y=B,b.uniform3f(N.screenPosition,L.x,L.y,L.z),b.uniform2f(N.scale,E.x,E.y),b.uniform1f(N.rotation,$.rotation),b.uniform1f(N.opacity,$.opacity),b.uniform3f(N.color,
 $.color.r,$.color.g,$.color.b),c.setBlending($.blending),c.setTexture($.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
 $.color.r,$.color.g,$.color.b),c.setBlending($.blending),c.setTexture($.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
 THREE.ShadowMapPlugin=function(){var a,b,c,d,e=new THREE.Frustum,g=new THREE.Matrix4,h=new THREE.Vector3,i=new THREE.Vector3;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,g=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:g});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:g,morphTargets:!0});c._shadowPass=!0;d._shadowPass=!0};this.render=function(a,
 THREE.ShadowMapPlugin=function(){var a,b,c,d,e=new THREE.Frustum,g=new THREE.Matrix4,h=new THREE.Vector3,i=new THREE.Vector3;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,g=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:g});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:g,morphTargets:!0});c._shadowPass=!0;d._shadowPass=!0};this.render=function(a,
 c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(k,l){var j,n,m,q,r,o,p,y,u,K=[];q=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.shadowMapCullFrontFaces&&a.cullFace(a.FRONT);b.setDepthTest(!0);for(j=0,n=k.lights.length;j<n;j++)if(m=k.lights[j],m.castShadow)if(m instanceof THREE.DirectionalLight&&m.shadowCascade)for(r=0;r<m.shadowCascadeCount;r++){var A;if(m.shadowCascadeArray[r])A=m.shadowCascadeArray[r];else{u=m;p=r;A=new THREE.DirectionalLight;A.isVirtual=!0;A.onlyShadow=
 c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(k,l){var j,n,m,q,r,o,p,y,u,K=[];q=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.shadowMapCullFrontFaces&&a.cullFace(a.FRONT);b.setDepthTest(!0);for(j=0,n=k.lights.length;j<n;j++)if(m=k.lights[j],m.castShadow)if(m instanceof THREE.DirectionalLight&&m.shadowCascade)for(r=0;r<m.shadowCascadeCount;r++){var A;if(m.shadowCascadeArray[r])A=m.shadowCascadeArray[r];else{u=m;p=r;A=new THREE.DirectionalLight;A.isVirtual=!0;A.onlyShadow=

+ 2 - 2
src/extras/loaders/ColladaLoader.js

@@ -244,14 +244,14 @@ THREE.ColladaLoader = function () {
 
 
 	};
 	};
 
 
-	function parseScene () {
+	function parseScene() {
 
 
 		var sceneElement = COLLADA.evaluate( './/dae:scene/dae:instance_visual_scene', COLLADA, _nsResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ).iterateNext();
 		var sceneElement = COLLADA.evaluate( './/dae:scene/dae:instance_visual_scene', COLLADA, _nsResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ).iterateNext();
 
 
 		if ( sceneElement ) {
 		if ( sceneElement ) {
 
 
 			var url = sceneElement.getAttribute( 'url' ).replace( /^#/, '' );
 			var url = sceneElement.getAttribute( 'url' ).replace( /^#/, '' );
-			return visualScenes[ url ];
+			return visualScenes[ url.length > 0 ? url : 'visual_scene0' ];
 
 
 		} else {
 		} else {