compo.filler音乐可视化屏保三维频谱动画效果代码

代码语言:html

所属分类:动画

代码描述:compo.filler音乐可视化屏保三维频谱动画效果代码

代码标签: compo filler 动画 屏保 可视化 频谱

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE HTML>
<html>

<head>

   
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
   
<meta http-equiv="X-UA-Compatible" content="chrome=1">
   
<style type="text/css">
        body
{ color: white; background-color: black; font-family: Helvetica; font-size: 20px; margin: 0px; overflow: hidden; }
                               
.title { color: #444; font-size: 64px; font-style: italic; letter-spacing: .125em; }
                               
.by-line { color: #222; font-size: 16px; margin-top: -1em; margin-left:20em; font-style: italic; letter-spacing: .5em; }
                               
.start { background-color: #111; color: #ccc; cursor: pointer; font-style: bold; margin-top: .75em; padding: .25em; font-style: italic; letter-spacing: .5em; }
                               
.start:hover { background-color: #222; }
                               
.credits1 { display: block; color: #444; font-size: 16px; font-style: italic; margin-top: 1em; letter-spacing: .25em; opacity: .75; }
                               
.credits2 { display: block; color: #444; font-size: 16px; font-style: italic; margin-top: .25em; letter-spacing: .25em; opacity: .75; }
                                a
{ text-decoration: none; }
                               
a:hover { color:#888; text-decoration: none; }
   
</style>
</head>

<body>
   
<div id="splash" style="padding-top: 225px; text-align: center">
       
<div class='title'>compo/filler</div>
       
<div class='by-line'>by vrtx</div>
       
<div class='start' onClick="start(0);">start demo</div>

   
</div>
   
<audio id="audio" autobuffer>
       
                       
<source src="//repo.bfw.wiki/bfwrepo/sound/5c89fd22dea6948307.mp3" type="audio/mpeg">
               
</audio>
   
<script type="text/javascript">
        var THREE=THREE||{REVISION:"48"};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)),e=window.setTimeout(function(){b(c+g)},g);a=c+g;return e};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
function(a){clearTimeout(a)}})();THREE.Clock=function(a){this.autoStart=a!==void 0?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(){this.elapsedTime+=this.getDelta();return this.elapsedTime};
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){a!==void 0&&this.setHex(a);return this};
THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},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,f,g;if(c===0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),f=a*6-d,a=c*(1-b),g=c*(1-b*f),b=c*(1-b*(1-f)),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(this.r*255)<<16^Math.floor(this.g*255)<<8^Math.floor(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},
divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)},
lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},isZero:function(){return this.lengthSq()<1.0E-4}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0};
THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},
addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},divideSelf:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},
divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a):this.z=this.y=this.x=0;return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},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;return this},cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){var b=this.x,c=this.y,d=this.z;this.x=c*a.z-d*a.y;this.y=d*a.x-b*a.z;this.z=b*a.y-c*a.x;return this},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this,a).lengthSq()},getPositionFromMatrix:function(a){this.x=
a.n14;this.y=a.n24;this.z=a.n34;return this},getRotationFromMatrix:function(a,b){var c=b?b.x:1,d=b?b.y:1,f=b?b.z:1,g=a.n11/c,e=a.n12/d,c=a.n21/c,d=a.n22/d,h=a.n23/f,i=a.n33/f;this.y=Math.asin(a.n13/f);f=Math.cos(this.y);Math.abs(f)>1.0E-5?(this.x=Math.atan2(-h/f,i/f),this.z=Math.atan2(-e/f,g/f)):(this.x=0,this.z=Math.atan2(c,d));return this},getScaleFromMatrix:function(a){var b=this.set(a.n11,a.n21,a.n31).length(),c=this.set(a.n12,a.n22,a.n32).length(),a=this.set(a.n13,a.n23,a.n33).length();this.x=
b;this.y=c;this.z=a},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},isZero:function(){return this.lengthSq()<1.0E-4}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1};
THREE.Vector4.prototype={constructor:THREE.Vector4,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!==void 0?a.w:1;return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;
this.z=a.z-b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a,this.w/=a):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
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;a<6;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)),f=0;f<6;f++)if(a=b[f].x*c.n14+b[f].y*c.n24+b[f].z*c.n34+b[f].w,a<=d)return!1;return!0};THREE.Frustum.__v1=new THREE.Vector3;
THREE.Ray=function(a,b){function c(a,b,c){s.sub(c,a);r=s.dot(b);t=m.add(a,p.copy(b).multiplyScalar(r));return v=c.distanceTo(t)}function d(a,b,c,d){s.sub(d,b);m.sub(c,b);p.sub(a,b);u=s.dot(s);w=s.dot(m);y=s.dot(p);F=m.dot(m);D=m.dot(p);G=1/(u*F-w*w);I=(F*y-w*D)*G;K=(u*D-w*y)*G;return I>=0&&K>=0&&I+K<1}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 f=1.0E-4;this.setPrecision=function(a){f=a};var g=new THREE.Vector3,e=new THREE.Vector3,h=new THREE.Vector3,i=new THREE.Vector3,j=new THREE.Vector3,k=new THREE.Vector3,q=new THREE.Vector3,n=new THREE.Vector3,o=new THREE.Vector3;this.intersectObject=function(a){var b,m=[];if(a instanceof THREE.Particle){var s=c(this.origin,this.direction,a.matrixWorld.getPosition());if(s>a.scale.x)return[];b={distance:s,point:a.position,face:null,object:a};
m.push(b)}else if(a instanceof THREE.Mesh){var s=c(this.origin,this.direction,a.matrixWorld.getPosition()),p=THREE.Frustum.__v1.set(a.matrixWorld.getColumnX().length(),a.matrixWorld.getColumnY().length(),a.matrixWorld.getColumnZ().length());if(s>a.geometry.boundingSphere.radius*Math.max(p.x,Math.max(p.y,p.z)))return m;var r,l,t=a.geometry,u=t.vertices,z;a.matrixRotationWorld.extractRotation(a.matrixWorld);for(s=0,p=t.faces.length;s<p;s++)if(b=t.faces[s],j.copy(this.origin),k.copy(this.direction),
z=a.matrixWorld,q=z.multiplyVector3(q.copy(b.centroid)).subSelf(j),n=a.matrixRotationWorld.multiplyVector3(n.copy(b.normal)),r=k.dot(n),!(Math.abs(r)<f)&&(l=n.dot(q)/r,!(l<0)&&(a.doubleSided||(a.flipSided?r>0:r<0))))if(o.add(j,k.multiplyScalar(l)),b instanceof THREE.Face3)g=z.multiplyVector3(g.copy(u[b.a].position)),e=z.multiplyVector3(e.copy(u[b.b].position)),h=z.multiplyVector3(h.copy(u[b.c].position)),d(o,g,e,h)&&(b={distance:j.distanceTo(o),point:o.clone(),face:b,object:a},m.push(b));else if(b instanceof
THREE.Face4&&(g=z.multiplyVector3(g.copy(u[b.a].position)),e=z.multiplyVector3(e.copy(u[b.b].position)),h=z.multiplyVector3(h.copy(u[b.c].position)),i=z.multiplyVector3(i.copy(u[b.d].position)),d(o,g,e,i)||d(o,e,h,i)))b={distance:j.distanceTo(o),point:o.clone(),face:b,object:a},m.push(b)}return m};var s=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,r,t,v,u,w,y,F,D,G,I,K};
THREE.Rectangle=function(){function a(){g=d-b;e=f-c}var b,c,d,f,g,e,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return e};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return f};this.set=function(g,e,k,q){h=!1;b=g;c=e;d=k;f=q;a()};this.addPoint=function(g,e){h?(h=!1,b=g,c=e,d=g,f=e):(b=b<g?b:g,c=c
<e?c:e,d=d>g?d:g,f=f>e?f:e);a()};this.add3Points=
function(g,e,k,q,n,o){h?(h=!1,b=g<k?g<n?g:n:k<n?k:n,c=e<q?e<o?e:o:q
<o?q:o,d=g>k?g>n?g:n:k>n?k:n,f=e>q?e>o?e:o:q>o?q: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=e<q?e<o?e<c?e:c:o<c?o:c:q<o?q<c?q: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,f=e>q?e>o?e>f?e:f:o>f?o:f:q>o?q>f?q:f:o>f?o:f);a()};this.addRectangle=function(g){h?(h=!1,b=g.getLeft(),c=g.getTop(),d=g.getRight(),f=g.getBottom()):(b=b<g.getLeft()?b:g.getLeft(),c=c<g.getTop()?c:g.getTop(),d=d>g.getRight()?d:g.getRight(),f=f>
g.getBottom()?f:g.getBottom());a()};this.inflate=function(g){b-=g;c-=g;d+=g;f+=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();f=f<g.getBottom()?f:g.getBottom();a()};this.intersects=function(a){return d
<a.getLeft()?!1:b>a.getRight()?!1:f<a.getTop()?!1:c>a.getBottom()?!1:!0};this.empty=function(){h=!0;f=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,f){return d+(a-b)*(f-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())},sign:function(a){return a<0?-1:a>0?1:0}};THREE.Matrix3=function(){this.m=[]};
THREE.Matrix3.prototype={constructor:THREE.Matrix3,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,f,g,e,h,i,j,k,q,n,o,s,m){this.set(a!==void 0?a:1,b||0,c||0,d||0,f||0,g!==void 0?g:1,e||0,h||0,i||0,j||0,k!==void 0?k:1,q||0,n||0,o||0,s||0,m!==void 0?m:1);this.m33=new THREE.Matrix3};
THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,f,g,e,h,i,j,k,q,n,o,s,m){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=f;this.n22=g;this.n23=e;this.n24=h;this.n31=i;this.n32=j;this.n33=k;this.n34=q;this.n41=n;this.n42=o;this.n43=s;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,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;d.cross(c,g).normalize();d.length()===0&&(g.x+=1.0E-4,d.cross(c,g).normalize());f.cross(g,d);this.n11=d.x;this.n12=f.x;this.n13=g.x;this.n21=d.y;this.n22=f.y;this.n23=g.y;this.n31=d.z;this.n32=f.z;this.n33=g.z;return this},multiply:function(a,b){var c=a.n11,d=a.n12,f=a.n13,g=a.n14,e=a.n21,h=a.n22,i=a.n23,j=a.n24,k=a.n31,q=a.n32,n=a.n33,o=a.n34,s=a.n41,m=a.n42,p=a.n43,r=a.n44,t=b.n11,
v=b.n12,u=b.n13,w=b.n14,y=b.n21,F=b.n22,D=b.n23,G=b.n24,I=b.n31,K=b.n32,Q=b.n33,N=b.n34,B=b.n41,O=b.n42,S=b.n43,A=b.n44;this.n11=c*t+d*y+f*I+g*B;this.n12=c*v+d*F+f*K+g*O;this.n13=c*u+d*D+f*Q+g*S;this.n14=c*w+d*G+f*N+g*A;this.n21=e*t+h*y+i*I+j*B;this.n22=e*v+h*F+i*K+j*O;this.n23=e*u+h*D+i*Q+j*S;this.n24=e*w+h*G+i*N+j*A;this.n31=k*t+q*y+n*I+o*B;this.n32=k*v+q*F+n*K+o*O;this.n33=k*u+q*D+n*Q+o*S;this.n34=k*w+q*G+n*N+o*A;this.n41=s*t+m*y+p*I+r*B;this.n42=s*v+m*F+p*K+r*O;this.n43=s*u+m*D+p*Q+r*S;this.n44=
s*w+m*G+p*N+r*A;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,f=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)*f;a.y=(this.n21*b+this.n22*c+this.n23*d+this.n24)*f;a.z=(this.n31*b+this.n32*c+this.n33*d+this.n34)*f;return a},multiplyVector4:function(a){var b=a.x,c=a.y,d=a.z,f=a.w;a.x=this.n11*b+this.n12*c+this.n13*d+this.n14*f;a.y=this.n21*b+this.n22*c+this.n23*
d+this.n24*f;a.z=this.n31*b+this.n32*c+this.n33*d+this.n34*f;a.w=this.n41*b+this.n42*c+this.n43*d+this.n44*f;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,f=this.n21,g=this.n22,e=this.n23,h=this.n24,i=this.n31,j=this.n32,k=this.n33,q=this.n34,n=this.n41,o=this.n42,s=this.n43,m=this.n44;return d*e*j*n-c*h*j*n-d*g*k*n+b*h*k*n+c*g*q*n-b*e*q*n-d*e*i*o+c*h*i*o+d*f*k*o-a*h*k*o-c*f*q*o+a*e*q*o+d*g*i*s-b*h*i*s-d*f*j*s+a*h*j*s+b*f*q*s-a*g*q*s-c*g*i*m+b*e*i*m+c*f*j*m-a*e*j*m-b*f*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.n43=this.n43;a.n44=this.n44;return a},flattenToArray:function(a){a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+
10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=
Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),f=1-c,g=a.x,e=a.y,h=a.z,i=f*g,j=f*e;this.set(i*g+c,i*e-d*h,i*h+d*e,0,i*e+d*h,j*e+c,j*h-d*g,0,i*h-d*e,j*h+d*g,f*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,f=a.n14,g=a.n21,e=a.n22,h=a.n23,i=a.n24,j=a.n31,k=a.n32,q=a.n33,n=a.n34,o=a.n41,s=a.n42,m=a.n43,p=a.n44;this.n11=h*n*s-i*q*s+i*k*m-e*n*m-h*k*p+e*q*p;this.n12=f*q*s-d*n*s-f*k*m+c*n*m+d*k*p-c*q*p;this.n13=d*i*s-f*h*s+f*e*m-c*i*m-d*e*p+c*h*p;this.n14=f*h*k-d*i*k-f*e*q+c*
i*q+d*e*n-c*h*n;this.n21=i*q*o-h*n*o-i*j*m+g*n*m+h*j*p-g*q*p;this.n22=d*n*o-f*q*o+f*j*m-b*n*m-d*j*p+b*q*p;this.n23=f*h*o-d*i*o-f*g*m+b*i*m+d*g*p-b*h*p;this.n24=d*i*j-f*h*j+f*g*q-b*i*q-d*g*n+b*h*n;this.n31=e*n*o-i*k*o+i*j*s-g*n*s-e*j*p+g*k*p;this.n32=f*k*o-c*n*o-f*j*s+b*n*s+c*j*p-b*k*p;this.n33=c*i*o-f*e*o+f*g*s-b*i*s-c*g*p+b*e*p;this.n34=f*e*j-c*i*j-f*g*k+b*i*k+c*g*n-b*e*n;this.n41=h*k*o-e*q*o-h*j*s+g*q*s+e*j*m-g*k*m;this.n42=c*q*o-d*k*o+d*j*s-b*q*s-c*j*m+b*k*m;this.n43=d*e*o-c*h*o-d*g*s+b*h*s+c*
g*m-b*e*m;this.n44=c*h*j-d*e*j+d*g*k-b*h*k-c*g*q+b*e*q;this.multiplyScalar(1/a.determinant());return this},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,f=a.z,g=Math.cos(c),c=Math.sin(c),e=Math.cos(d),d=Math.sin(d),h=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var i=e*h,j=e*f,k=d*h,q=d*f;this.n11=i+q*c;this.n12=k*c-j;this.n13=g*d;this.n21=g*f;this.n22=g*h;this.n23=-c;this.n31=j*c-k;this.n32=q+i*c;this.n33=g*e;break;case "ZXY":i=e*h;j=e*f;k=d*h;q=d*f;this.n11=i-q*c;this.n12=-g*f;this.n13=k+
j*c;this.n21=j+k*c;this.n22=g*h;this.n23=q-i*c;this.n31=-g*d;this.n32=c;this.n33=g*e;break;case "ZYX":i=g*h;j=g*f;k=c*h;q=c*f;this.n11=e*h;this.n12=k*d-j;this.n13=i*d+q;this.n21=e*f;this.n22=q*d+i;this.n23=j*d-k;this.n31=-d;this.n32=c*e;this.n33=g*e;break;case "YZX":i=g*e;j=g*d;k=c*e;q=c*d;this.n11=e*h;this.n12=q-i*f;this.n13=k*f+j;this.n21=f;this.n22=g*h;this.n23=-c*h;this.n31=-d*h;this.n32=j*f+k;this.n33=i-q*f;break;case "XZY":i=g*e;j=g*d;k=c*e;q=c*d;this.n11=e*h;this.n12=-f;this.n13=d*h;this.n21=
i*f+q;this.n22=g*h;this.n23=j*f-k;this.n31=k*f-j;this.n32=c*h;this.n33=q*f+i;break;default:i=g*h,j=g*f,k=c*h,q=c*f,this.n11=e*h,this.n12=-e*f,this.n13=d,this.n21=j+k*d,this.n22=i-q*d,this.n23=-c*e,this.n31=q-i*d,this.n32=k+j*d,this.n33=g*e}return this},setRotationFromQuaternion:function(a){var b=a.x,c=a.y,d=a.z,f=a.w,g=b+b,e=c+c,h=d+d,a=b*g,i=b*e;b*=h;var j=c*e;c*=h;d*=h;g*=f;e*=f;f*=h;this.n11=1-(j+d);this.n12=i-f;this.n13=b+e;this.n21=i+f;this.n22=1-(a+d);this.n23=c-g;this.n31=b-e;this.n32=c+g;
this.n33=1-(a+j);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2;d.identity();d.setRotationFromQuaternion(b);f.setScale(c.x,c.y,c.z);this.multiply(d,f);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,
g=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);f.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=f.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(a.x===1&&a.y===0&&a.z===0)return this.rotateX(b);
else if(a.x===0&&a.y===1&&a.z===0)return this.rotateY(b);else if(a.x===0&&a.y===0&&a.z===1)return this.rotateZ(b);var c=a.x,d=a.y,f=a.z,g=Math.sqrt(c*c+d*d+f*f);c/=g;d/=g;f/=g;var g=c*c,e=d*d,h=f*f,i=Math.cos(b),j=Math.sin(b),k=1-i,q=c*d*k,n=c*f*k;k*=d*f;c*=j;var o=d*j;j*=f;f=g+(1-g)*i;g=q+j;d=n-o;q-=j;e+=(1-e)*i;j=k+c;n+=o;k-=c;h+=(1-h)*i;var i=this.n11,c=this.n21,o=this.n31,s=this.n41,m=this.n12,p=this.n22,r=this.n32,t=this.n42,v=this.n13,u=this.n23,w=this.n33,y=this.n43;this.n11=f*i+g*m+d*v;this.n21=
f*c+g*p+d*u;this.n31=f*o+g*r+d*w;this.n41=f*s+g*t+d*y;this.n12=q*i+e*m+j*v;this.n22=q*c+e*p+j*u;this.n32=q*o+e*r+j*w;this.n42=q*s+e*t+j*y;this.n13=n*i+k*m+h*v;this.n23=n*c+k*p+h*u;this.n33=n*o+k*r+h*w;this.n43=n*s+k*t+h*y;return this},rotateX:function(a){var b=this.n12,c=this.n22,d=this.n32,f=this.n42,g=this.n13,e=this.n23,h=this.n33,i=this.n43,j=Math.cos(a),a=Math.sin(a);this.n12=j*b+a*g;this.n22=j*c+a*e;this.n32=j*d+a*h;this.n42=j*f+a*i;this.n13=j*g-a*b;this.n23=j*e-a*c;this.n33=j*h-a*d;this.n43=
j*i-a*f;return this},rotateY:function(a){var b=this.n11,c=this.n21,d=this.n31,f=this.n41,g=this.n13,e=this.n23,h=this.n33,i=this.n43,j=Math.cos(a),a=Math.sin(a);this.n11=j*b-a*g;this.n21=j*c-a*e;this.n31=j*d-a*h;this.n41=j*f-a*i;this.n13=j*g+a*b;this.n23=j*e+a*c;this.n33=j*h+a*d;this.n43=j*i+a*f;return this},rotateZ:function(a){var b=this.n11,c=this.n21,d=this.n31,f=this.n41,g=this.n12,e=this.n22,h=this.n32,i=this.n42,j=Math.cos(a),a=Math.sin(a);this.n11=j*b+a*g;this.n21=j*c+a*e;this.n31=j*d+a*h;
this.n41=j*f+a*i;this.n12=j*g-a*b;this.n22=j*e-a*c;this.n32=j*h-a*d;this.n42=j*i-a*f;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,f=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,e=-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,j=a.n23*a.n12-a.n22*a.n13,k=-a.n23*a.n11+a.n21*a.n13,q=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*e+a.n31*j;if(a===0)return null;a=1/a;c[0]=a*d;c[1]=a*f;c[2]=a*g;c[3]=a*e;c[4]=a*h;c[5]=a*i;c[6]=a*j;c[7]=a*k;c[8]=a*q;return b};
THREE.Matrix4.makeFrustum=function(a,b,c,d,f,g){var e;e=new THREE.Matrix4;e.n11=2*f/(b-a);e.n12=0;e.n13=(b+a)/(b-a);e.n14=0;e.n21=0;e.n22=2*f/(d-c);e.n23=(d+c)/(d-c);e.n24=0;e.n31=0;e.n32=0;e.n33=-(g+f)/(g-f);e.n34=-2*g*f/(g-f);e.n41=0;e.n42=0;e.n43=-1;e.n44=0;return e};THREE.Matrix4.makePerspective=function(a,b,c,d){var f,a=c*Math.tan(a*Math.PI/360);f=-a;return THREE.Matrix4.makeFrustum(f*b,a*b,f,a,c,d)};
THREE.Matrix4.makeOrtho=function(a,b,c,d,f,g){var e,h,i,j;e=new THREE.Matrix4;h=b-a;i=c-d;j=g-f;e.n11=2/h;e.n12=0;e.n13=0;e.n14=-((b+a)/h);e.n21=0;e.n22=2/i;e.n23=0;e.n24=-((c+d)/i);e.n31=0;e.n32=0;e.n33=-2/j;e.n34=-((g+f)/j);e.n41=0;e.n42=0;e.n43=0;e.n44=1;return e};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=
!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,applyMatrix:function(a){this.matrix.multiply(a,this.matrix);this.scale.getScaleFromMatrix(this.matrix);this.rotation.getRotationFromMatrix(this.matrix,this.scale);this.position.getPositionFromMatrix(this.matrix)},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.getRotationFromMatrix(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(this.children.indexOf(a)===-1){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__addObject(a)}},remove:function(a){var b=
this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__removeObject(a)}},getChildByName:function(a,b){var c,d,f;for(c=0,d=this.children.length;c<d;c++){f=this.children[c];if(f.name===a)return f;if(b&&(f=f.getChildByName(a,b),f!==void 0))return f}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,
this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},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=e[g]=e[g]||new THREE.RenderableObject;g++;return a}function b(){var a=j[i]=j[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,f=a.z+a.w,g=b.z+b.w,e=-a.z+a.w,h=-b.z+b.w;return f>=0&&g>=0&&e>=0&&h>=0?!0:f<0&&g<0||e<0&&h<0?!1:(f<0?c=Math.max(c,f/(f-g)):g<0&&(d=Math.min(d,f/(f-g))),e<0?c=Math.max(c,e/(e-h)):h<0&&(d=Math.min(d,e/(e-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var f,g,e=[],h,i,j=[],
k,q,n=[],o,s=[],m,p,r=[],t,v,u=[],w={objects:[],sprites:[],lights:[],elements:[]},y=new THREE.Vector3,F=new THREE.Vector4,D=new THREE.Matrix4,G=new THREE.Matrix4,I=new THREE.Frustum,K=new THREE.Vector4,Q=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);D.multiply(b.projectionMatrix,b.matrixWorldInverse);D.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);D.multiply(b.matrixWorld,
b.projectionMatrixInverse);D.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;w.objects.length=0;w.sprites.length=0;w.lights.length=0;var e=function(b){if(b.visible!==!1){(b instanceof THREE.Mesh||b instanceof THREE.Line)&&(b.frustumCulled===!1||I.contains(b))?(D.multiplyVector3(y.copy(b.position)),f=a(),f.object=
b,f.z=y.z,w.objects.push(f)):b instanceof THREE.Sprite||b instanceof THREE.Particle?(D.multiplyVector3(y.copy(b.position)),f=a(),f.object=b,f.z=y.z,w.sprites.push(f)):b instanceof THREE.Light&&w.lights.push(b);for(var c=0,d=b.children.length;c<d;c++)e(b.children[c])}};e(b);d&&w.objects.sort(c);return w};this.projectScene=function(a,f,g){var e=f.near,A=f.far,l=!1,y,E,z,T,W,M,ma,aa,Z,X,U,Y,$,oa,ga;v=p=o=q=0;w.elements.length=0;f.parent===void 0&&(console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it..."),
a.add(f));a.updateMatrixWorld();f.matrixWorldInverse.getInverse(f.matrixWorld);D.multiply(f.projectionMatrix,f.matrixWorldInverse);I.setFromMatrix(D);w=this.projectGraph(a,!1);for(a=0,y=w.objects.length;a<y;a++)if(Z=w.objects[a].object,X=Z.matrixWorld,i=0,Z instanceof THREE.Mesh){U=Z.geometry;Y=Z.geometry.materials;T=U.vertices;$=U.faces;oa=U.faceVertexUvs;U=Z.matrixRotationWorld.extractRotation(X);for(E=0,z=T.length;E
<z;E++)h=b(),h.positionWorld.copy(T[E].position),X.multiplyVector3(h.positionWorld),
h.positionScreen.copy(h.positionWorld),D.multiplyVector4(h.positionScreen),h.positionScreen.x/=h.positionScreen.w,h.positionScreen.y/=h.positionScreen.w,h.visible=h.positionScreen.z>e&&h.positionScreen.z<A;for(T=0,E=$.length;T<E;T++){z=$[T];if(z instanceof THREE.Face3)if(W=j[z.a],M=j[z.b],ma=j[z.c],W.visible&&M.visible&&ma.visible)if(l=(ma.positionScreen.x-W.positionScreen.x)*(M.positionScreen.y-W.positionScreen.y)-(ma.positionScreen.y-W.positionScreen.y)*(M.positionScreen.x-W.positionScreen.x)<0,
Z.doubleSided||l!=Z.flipSided)aa=n[q]=n[q]||new THREE.RenderableFace3,q++,k=aa,k.v1.copy(W),k.v2.copy(M),k.v3.copy(ma);else continue;else continue;else if(z instanceof THREE.Face4)if(W=j[z.a],M=j[z.b],ma=j[z.c],aa=j[z.d],W.visible&&M.visible&&ma.visible&&aa.visible)if(l=(aa.positionScreen.x-W.positionScreen.x)*(M.positionScreen.y-W.positionScreen.y)-(aa.positionScreen.y-W.positionScreen.y)*(M.positionScreen.x-W.positionScreen.x)<0||(M.positionScreen.x-ma.positionScreen.x)*(aa.positionScreen.y-ma.positionScreen.y)-
(M.positionScreen.y-ma.positionScreen.y)*(aa.positionScreen.x-ma.positionScreen.x)<0,Z.doubleSided||l!=Z.flipSided)ga=s[o]=s[o]||new THREE.RenderableFace4,o++,k=ga,k.v1.copy(W),k.v2.copy(M),k.v3.copy(ma),k.v4.copy(aa);else continue;else continue;k.normalWorld.copy(z.normal);!l&&(Z.flipSided||Z.doubleSided)&&k.normalWorld.negate();U.multiplyVector3(k.normalWorld);k.centroidWorld.copy(z.centroid);X.multiplyVector3(k.centroidWorld);k.centroidScreen.copy(k.centroidWorld);D.multiplyVector3(k.centroidScreen);
ma=z.vertexNormals;for(W=0,M=ma.length;W<M;W++)aa=k.vertexNormalsWorld[W],aa.copy(ma[W]),!l&&(Z.flipSided||Z.doubleSided)&&aa.negate(),U.multiplyVector3(aa);for(W=0,M=oa.length;W<M;W++)if(ga=oa[W][T])for(ma=0,aa=ga.length;ma<aa;ma++)k.uvs[W][ma]=ga[ma];k.material=Z.material;k.faceMaterial=z.materialIndex!==null?Y[z.materialIndex]:null;k.z=k.centroidScreen.z;w.elements.push(k)}}else if(Z instanceof THREE.Line){G.multiply(D,X);T=Z.geometry.vertices;W=b();W.positionScreen.copy(T[0].position);G.multiplyVector4(W.positionScreen);
for(E=1,z=T.length;E<z;E++)if(W=b(),W.positionScreen.copy(T[E].position),G.multiplyVector4(W.positionScreen),M=j[i-2],K.copy(W.positionScreen),Q.copy(M.positionScreen),d(K,Q))K.multiplyScalar(1/K.w),Q.multiplyScalar(1/Q.w),X=r[p]=r[p]||new THREE.RenderableLine,p++,m=X,m.v1.positionScreen.copy(K),m.v2.positionScreen.copy(Q),m.z=Math.max(K.z,Q.z),m.material=Z.material,w.elements.push(m)}for(a=0,y=w.sprites.length;a
<y;a++)if(Z=w.sprites[a].object,X=Z.matrixWorld,Z instanceof THREE.Particle&&(F.set(X.n14,
X.n24,X.n34,1),D.multiplyVector4(F),F.z/=F.w,F.z>0&&F.z<1))e=u[v]=u[v]||new THREE.RenderableParticle,v++,t=e,t.x=F.x/F.w,t.y=F.y/F.w,t.z=F.z,t.rotation=Z.rotation.z,t.scale.x=Z.scale.x*Math.abs(t.x-(F.x+f.projectionMatrix.n11)/(F.w+f.projectionMatrix.n14)),t.scale.y=Z.scale.y*Math.abs(t.y-(F.y+f.projectionMatrix.n22)/(F.w+f.projectionMatrix.n24)),t.material=Z.material,w.elements.push(t);g&&w.elements.sort(c);return w}};
THREE.Quaternion=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1};
THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},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,f=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-f),f=Math.sin(-f),g=Math.cos(c),c=Math.sin(c),e=a*b,h=d*f;this.w=e*g-h*c;this.x=e*c+h*g;this.y=d*b*g+a*f*c;this.z=a*f*
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=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?
-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a===0?this.w=this.z=
this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,f=this.w,g=a.x,e=a.y,h=a.z,a=a.w;this.x=b*a+f*g+c*h-d*e;this.y=c*a+f*e+d*g-b*h;this.z=d*a+f*h+b*e-c*g;this.w=f*a-b*g-c*e-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,f=a.z,g=this.x,e=this.y,h=this.z,i=this.w,j=i*c+e*f-h*d,k=i*d+h*c-g*f,q=i*f+g*d-e*c,c=-g*c-e*d-h*f;b.x=j*i+c*-g+k*-h-q*-e;b.y=k*i+c*-e+q*-g-j*-h;b.z=q*i+c*-h+j*-e-k*-g;return b}};
THREE.Quaternion.slerp=function(a,b,c,d){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;f<0?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,f=-f):c.copy(b);if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(f),f=Math.sqrt(1-f*f);if(Math.abs(f)<0.001)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;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.Vertex.prototype={constructor:THREE.Vertex,clone:function(){return new THREE.Vertex(this.position.clone())}};THREE.Face3=function(a,b,c,d,f,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=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.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;for(b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();for(b=0,c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();for(b=0,c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
return a}};THREE.Face4=function(a,b,c,d,f,g,e){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materialIndex=e;this.centroid=new THREE.Vector3};
THREE.Face4.prototype={constructor:THREE.Face4,clone:function(){var a=new THREE.Face4(this.a,this.b,this.c,this.d);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;for(b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();for(b=0,c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();for(b=0,c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
return a}};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},lerpSelf:function(a,b){this.u+=(a.u-this.u)*b;this.v+=(a.v-this.v)*b;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a);for(var c=0,d=this.vertices.length;c<d;c++)a.multiplyVector3(this.vertices[c].position);c=0;for(d=this.faces.length;c<d;c++){var f=this.faces[c];b.multiplyVector3(f.normal);for(var g=0,e=f.vertexNormals.length;g<e;g++)b.multiplyVector3(f.vertexNormals[g]);a.multiplyVector3(f.centroid)}},computeCentroids:function(){var a,b,c;for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],c.centroid.set(0,
0,0),c instanceof THREE.Face3?(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.divideScalar(3)):c instanceof THREE.Face4&&(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.addSelf(this.vertices[c.d].position),c.centroid.divideScalar(4))},computeFaceNormals:function(){var a,b,c,d,f,g,e=new THREE.Vector3,
h=new THREE.Vector3;for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],e.sub(g.position,f.position),h.sub(d.position,f.position),e.crossSelf(h),e.isZero()||e.normalize(),c.normal.copy(e)},computeVertexNormals:function(){var a,b,c,d;if(this.__tmpVertices===void 0){d=this.__tmpVertices=Array(this.vertices.length);for(a=0,b=this.vertices.length;a<b;a++)d[a]=new THREE.Vector3;for(a=0,b=this.faces.length;a<b;a++)if(c=this.faces[a],c instanceof
THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{d=this.__tmpVertices;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,b,c,d,f;for(c=0,d=this.faces.length;c<
d;c++){f=this.faces[c];f.__originalFaceNormal?f.__originalFaceNormal.copy(f.normal):f.__originalFaceNormal=f.normal.clone();if(!f.__originalVertexNormals)f.__originalVertexNormals=[];for(a=0,b=f.vertexNormals.length;a<b;a++)f.__originalVertexNormals[a]?f.__originalVertexNormals[a].copy(f.vertexNormals[a]):f.__originalVertexNormals[a]=f.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 e=this.morphNormals[a].faceNormals,h=this.morphNormals[a].vertexNormals,i,j;for(c=0,d=this.faces.length;c<d;c++)f=this.faces[c],i=new THREE.Vector3,j=f 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},e.push(i),h.push(j)}e=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();
g.computeVertexNormals();for(c=0,d=this.faces.length;c<d;c++)f=this.faces[c],i=e.faceNormals[c],j=e.vertexNormals[c],i.copy(f.normal),f instanceof THREE.Face3?(j.a.copy(f.vertexNormals[0]),j.b.copy(f.vertexNormals[1]),j.c.copy(f.vertexNormals[2])):(j.a.copy(f.vertexNormals[0]),j.b.copy(f.vertexNormals[1]),j.c.copy(f.vertexNormals[2]),j.d.copy(f.vertexNormals[3]))}for(c=0,d=this.faces.length;c<d;c++)f=this.faces[c],f.normal=f.__originalFaceNormal,f.vertexNormals=f.__originalVertexNormals},computeTangents:function(){function a(a,
b,c,d,f,g,D){h=a.vertices[b].position;i=a.vertices[c].position;j=a.vertices[d].position;k=e[f];q=e[g];n=e[D];o=i.x-h.x;s=j.x-h.x;m=i.y-h.y;p=j.y-h.y;r=i.z-h.z;t=j.z-h.z;v=q.u-k.u;u=n.u-k.u;w=q.v-k.v;y=n.v-k.v;F=1/(v*y-u*w);K.set((y*o-w*s)*F,(y*m-w*p)*F,(y*r-w*t)*F);Q.set((v*s-u*o)*F,(v*p-u*m)*F,(v*t-u*r)*F);G[b].addSelf(K);G[c].addSelf(K);G[d].addSelf(K);I[b].addSelf(Q);I[c].addSelf(Q);I[d].addSelf(Q)}var b,c,d,f,g,e,h,i,j,k,q,n,o,s,m,p,r,t,v,u,w,y,F,D,G=[],I=[],K=new THREE.Vector3,Q=new THREE.Vector3,
N=new THREE.Vector3,B=new THREE.Vector3,O=new THREE.Vector3;for(b=0,c=this.vertices.length;b<c;b++)G[b]=new THREE.Vector3,I[b]=new THREE.Vector3;for(b=0,c=this.faces.length;b<c;b++)g=this.faces[b],e=this.faceVertexUvs[0][b],g instanceof THREE.Face3?a(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(a(this,g.a,g.b,g.c,0,1,2),a(this,g.a,g.b,g.d,0,1,3));var S=["a","b","c","d"];for(b=0,c=this.faces.length;b<c;b++){g=this.faces[b];for(d=0;d<g.vertexNormals.length;d++)O.copy(g.vertexNormals[d]),f=g[S[d]],
D=G[f],N.copy(D),N.subSelf(O.multiplyScalar(O.dot(D))).normalize(),B.cross(g.vertexNormals[d],D),f=B.dot(I[f]),f=f<0?-1:1,g.vertexTangents[d]=new THREE.Vector4(N.x,N.y,N.z,f)}this.hasTangents=!0},computeBoundingBox:function(){if(!this.boundingBox)this.boundingBox={min:new THREE.Vector3,max:new THREE.Vector3};if(this.vertices.length>0){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,f=this.vertices.length;d<
f;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,f=Math.pow(10,
4),g,e;for(g=0,e=this.vertices.length;g<e;g++)d=this.vertices[g].position,d=[Math.round(d.x*f),Math.round(d.y*f),Math.round(d.z*f)].join("_"),a[d]===void 0?(a[d]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[d]];for(g=0,e=this.faces.length;g<e;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,f,g,e){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*e+(-3*(b-c)-2*a-d)*g+a*f+b}this.points=a;var c=[],d={x:0,y:0,z:0},f,g,e,h,i,j,k,q,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){f=(this.points.length-1)*a;g=Math.floor(f);e=f-g;c[0]=g===0?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;j=this.points[c[0]];k=this.points[c[1]];
q=this.points[c[2]];n=this.points[c[3]];h=e*e;i=e*h;d.x=b(j.x,k.x,q.x,n.x,e,h,i);d.y=b(j.y,k.y,q.y,n.y,e,h,i);d.z=b(j.z,k.z,q.z,n.z,e,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,f=b=b=0,g=new THREE.Vector3,e=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),e.copy(d),i+=e.distanceTo(g),
g.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=f&&(h[b]=i,f=b);h[h.length]=i;return{chunks:h,total:i}};this.reparametrizeByArcLength=function(a){var b,c,d,f,g,e,h=[],i=new THREE.Vector3,j=this.getLength();h.push(i.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=j.chunks[b]-j.chunks[b-1];e=Math.ceil(a*c/j.total);f=(b-1)/(this.points.length-1);g=b/(this.points.length-1);for(c=1;c<e-1;c++)d=f+c*(1/e)*(g-f),d=this.getPoint(d),h.push(i.copy(d).clone());h.push(i.copy(this.points[b]).clone())}this.points=
h}};THREE.Camera=function(){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.getRotationFromMatrix(this.matrix)};
THREE.OrthographicCamera=function(a,b,c,d,f,g){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=f!==void 0?f:0.1;this.far=g!==void 0?g:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};
THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a!==void 0?a:50;this.aspect=b!==void 0?b:1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;THREE.PerspectiveCamera.prototype.setLens=function(a,b){this.fov=2*Math.atan((b!==void 0?b:24)/(a*2))*(180/Math.PI);this.updateProjectionMatrix()};
THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,f,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=f;this.height=g;this.updateProjectionMatrix()};
THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,
this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;
THREE.DirectionalLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCascade=
!1;this.shadowCascadeOffset=new THREE.Vector3(0,0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;
THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;
THREE.SpotLight=function(a,b,c,d){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0;this.castShadow=d!==void 0?d:!1;this.onlyShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};
THREE.SpotLight.prototype=new THREE.Light;THREE.SpotLight.prototype.constructor=THREE.SpotLight;
THREE.Material=function(a){a=a||{};this.id=THREE.MaterialCount++;this.name="";this.opacity=a.opacity!==void 0?a.opacity:1;this.transparent=a.transparent!==void 0?a.transparent:!1;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.depthTest=a.depthTest!==void 0?a.depthTest:!0;this.depthWrite=a.depthWrite!==void 0?a.depthWrite:!0;this.polygonOffset=a.polygonOffset!==void 0?a.polygonOffset:!1;this.polygonOffsetFactor=a.polygonOffsetFactor!==void 0?a.polygonOffsetFactor:0;this.polygonOffsetUnits=
a.polygonOffsetUnits!==void 0?a.polygonOffsetUnits:0;this.alphaTest=a.alphaTest!==void 0?a.alphaTest:0;this.overdraw=a.overdraw!==void 0?a.overdraw:!1};THREE.MaterialCount=0;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0;THREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.AdditiveAlphaBlending=5;
THREE.LineBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.linewidth=a.linewidth!==void 0?a.linewidth:1;this.linecap=a.linecap!==void 0?a.linecap:"round";this.linejoin=a.linejoin!==void 0?a.linejoin:"round";this.vertexColors=a.vertexColors?a.vertexColors:!1;this.fog=a.fog!==void 0?a.fog:!0};THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
THREE.MeshBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:null;this.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.fog=a.fog!==void 0?a.fog:
!0;this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:
!1};THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
THREE.MeshLambertMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.ambient=a.ambient!==void 0?new THREE.Color(a.ambient):new THREE.Color(16777215);this.wrapAround=a.wrapAround!==void 0?a.wrapAround:!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.map=a.map!==void 0?a.map:null;this.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:
THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.fog=a.fog!==void 0?a.fog:!0;this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?
a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1;this.morphNormals=a.morphNormals!==void 0?a.morphNormals:!1};THREE.MeshLambertMaterial.prototype=new THREE.Material;THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial;
THREE.MeshPhongMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.ambient=a.ambient!==void 0?new THREE.Color(a.ambient):new THREE.Color(16777215);this.specular=a.specular!==void 0?new THREE.Color(a.specular):new THREE.Color(1118481);this.shininess=a.shininess!==void 0?a.shininess:30;this.metal=a.metal!==void 0?a.metal:!1;this.perPixel=a.perPixel!==void 0?a.perPixel:!1;this.wrapAround=a.wrapAround!==void 0?a.wrapAround:
!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.map=a.map!==void 0?a.map:null;this.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.fog=a.fog!==void 0?a.fog:!0;this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:
!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1;this.morphNormals=a.morphNormals!==void 0?a.morphNormals:!1};THREE.MeshPhongMaterial.prototype=new THREE.Material;
THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial;THREE.MeshDepthMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1};THREE.MeshDepthMaterial.prototype=new THREE.Material;THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial;
THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading?a.shading:THREE.FlatShading;this.wireframe=a.wireframe?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth?a.wireframeLinewidth:1};THREE.MeshNormalMaterial.prototype=new THREE.Material;THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial;THREE.MeshFaceMaterial=function(){};
THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:null;this.size=a.size!==void 0?a.size:1;this.sizeAttenuation=a.sizeAttenuation!==void 0?a.sizeAttenuation:!0;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.fog=a.fog!==void 0?a.fog:!0};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
THREE.ParticleCanvasMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.program=a.program!==void 0?a.program:function(){}};THREE.ParticleCanvasMaterial.prototype=new THREE.Material;THREE.ParticleCanvasMaterial.prototype.constructor=THREE.ParticleCanvasMaterial;THREE.ParticleDOMMaterial=function(a){THREE.Material.call(this);this.domElement=a};
THREE.ShaderMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.fragmentShader=a.fragmentShader!==void 0?a.fragmentShader:"void main() {}";this.vertexShader=a.vertexShader!==void 0?a.vertexShader:"void main() {}";this.uniforms=a.uniforms!==void 0?a.uniforms:{};this.attributes=a.attributes;this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.fog=a.fog!==
void 0?a.fog:!1;this.lights=a.lights!==void 0?a.lights:!1;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};THREE.ShaderMaterial.prototype=new THREE.Material;THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial;
THREE.Texture=function(a,b,c,d,f,g,e,h){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=d!==void 0?d:THREE.ClampToEdgeWrapping;this.magFilter=f!==void 0?f:THREE.LinearFilter;this.minFilter=g!==void 0?g:THREE.LinearMipMapLinearFilter;this.format=e!==void 0?e:THREE.RGBAFormat;this.type=h!==void 0?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(){};
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,f,g,e,h,i,j){THREE.Texture.call(this,null,g,e,h,i,j,d,f);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.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.ParticleBasicMaterial({color:Math.random()*16777215});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!==void 0?b:new THREE.LineBasicMaterial({color:Math.random()*16777215});this.type=c!==void 0?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.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b!==void 0?b:new THREE.MeshBasicMaterial({color:Math.random()*16777215,wireframe:!0});if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=a.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++)this.morphTargetInfluences.push(0),
this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
THREE.Bone.prototype.update=function(a,b){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;var c,d=this.children.length;for(c=0;c<d;c++)this.children[c].update(this.skinMatrix,b)};
THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var c,d,f,g,e,h;if(this.geometry.bones!==void 0){for(c=0;c<this.geometry.bones.length;c++)f=this.geometry.bones[c],g=f.pos,e=f.rotq,h=f.scl,d=this.addBone(),d.name=f.name,d.position.set(g[0],g[1],g[2]),d.quaternion.set(e[0],e[1],e[2],e[3]),d.useQuaternion=!0,h!==void 0?d.scale.set(h[0],h[1],h[2]):d.scale.set(1,1,1);for(c=0;c<this.bones.length;c++)f=this.geometry.bones[c],
d=this.bones[c],f.parent===-1?this.add(d):this.bones[f.parent].add(d);this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;THREE.SkinnedMesh.prototype.addBone=function(a){a===void 0&&(a=new THREE.Bone(this));this.bones.push(a);return a};
THREE.SkinnedMesh.prototype.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;for(var a=0,b=this.children.length;a<b;a++){var c=this.children[a];c instanceof THREE.Bone?c.update(this.identityMatrix,!1):c.updateMatrixWorld(!0)}for(var b=this.bones.length,c=this.bones,d=this.boneMatrices,a=0;a<b;a++)c[a].skinMatrix.flattenToArrayOffset(d,
a*16)};
THREE.SkinnedMesh.prototype.pose=function(){this.updateMatrixWorld(!0);for(var a,b=[],c=0;c<this.bones.length;c++){a=this.bones[c];var d=new THREE.Matrix4;d.getInverse(a.skinMatrix);b.push(d);a.skinMatrix.flattenToArrayOffset(this.boneMatrices,c*16)}if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];for(a=0;a<this.geometry.skinIndices.length;a++){var c=this.geometry.vertices[a].position,f=this.geometry.skinIndices[a].x,g=this.geometry.skinIndices[a].y,d=
new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesA.push(b[f].multiplyVector3(d));d=new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesB.push(b[g].multiplyVector3(d));this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1&&(c=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5,this.geometry.skinWeights[a].x+=c,this.geometry.skinWeights[a].y+=c)}}};
THREE.MorphAnimMesh=function(a,b){THREE.Mesh.call(this,a,b);this.duration=1E3;this.mirroredLoop=!1;this.currentKeyframe=this.lastKeyframe=this.time=0;this.direction=1;this.directionBackwards=!1;this.setFrameRange(0,this.geometry.morphTargets.length-1)};THREE.MorphAnimMesh.prototype=new THREE.Mesh;THREE.MorphAnimMesh.prototype.constructor=THREE.MorphAnimMesh;
THREE.MorphAnimMesh.prototype.setFrameRange=function(a,b){this.startKeyframe=a;this.endKeyframe=b;this.length=this.endKeyframe-this.startKeyframe+1};THREE.MorphAnimMesh.prototype.setDirectionForward=function(){this.direction=1;this.directionBackwards=!1};THREE.MorphAnimMesh.prototype.setDirectionBackward=function(){this.direction=-1;this.directionBackwards=!0};
THREE.MorphAnimMesh.prototype.parseAnimations=function(){var a=this.geometry;if(!a.animations)a.animations={};for(var b,c=a.animations,d=/([a-z]+)(\d+)/,f=0,g=a.morphTargets.length;f
<g;f++){var e=a.morphTargets[f].name.match(d);if(e&&e.length>1){e=e[1];c[e]||(c[e]={start:Infinity,end:-Infinity});var h=c[e];if(f<h.start)h.start=f;if(f>h.end)h.end=f;b||(b=e)}}a.firstAnimation=b};
THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){if(!this.geometry.animations)this.geometry.animations={};this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=1E3*((c.end-c.start)/b),this.time=0):console.warn("animation["+a+"] undefined")};
THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||this.time<0){this.direction*=-1;if(this.time>this.duration)this.time=this.duration,this.directionBackwards=!0;if(this.time<0)this.time=0,this.directionBackwards=!1}}else this.time%=this.duration,this.time<0&&(this.time+=this.duration);a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1);if(a!==this.currentKeyframe)this.morphTargetInfluences[this.lastKeyframe]=
0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a;b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b};THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b};THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;
THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c<this.LODs.length;c++)if(b
<this.LODs[c].visibleAtDistance)break;this.LODs.splice(c,0,{visibleAtDistance:b,object3D:a});this.add(a)};
THREE.LOD.prototype.update=function(a){if(this.LODs.length>1){a.matrixWorldInverse.getInverse(a.matrixWorld);a=a.matrixWorldInverse;a=-(a.n31*this.matrixWorld.n14+a.n32*this.matrixWorld.n24+a.n33*this.matrixWorld.n34+a.n34);this.LODs[0].object3D.visible=!0;for(var b=1;b<this.LODs.length;b++)if(a>=this.LODs[b].visibleAtDistance)this.LODs[b-1].object3D.visible=!1,this.LODs[b].object3D.visible=!0;else break;for(;b<this.LODs.length;b++)this.LODs[b].object3D.visible=!1}};
THREE.Sprite=function(a){THREE.Object3D.call(this);this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:new THREE.Texture;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.useScreenCoordinates=a.useScreenCoordinates!==void 0?a.useScreenCoordinates:!0;this.mergeWith3D=a.mergeWith3D!==void 0?a.mergeWith3D:!this.useScreenCoordinates;this.affectedByDistance=a.affectedByDistance!==void 0?a.affectedByDistance:!this.useScreenCoordinates;
this.scaleByViewport=a.scaleByViewport!==void 0?a.scaleByViewport:!this.affectedByDistance;this.alignment=a.alignment instanceof THREE.Vector2?a.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;
THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,this.scale.y);this.matrixWorldNeedsUpdate=!0};THREE.SpriteAlignment={};THREE.SpriteAlignment.topLeft=new THREE.Vector2(1,-1);THREE.SpriteAlignment.topCenter=new THREE.Vector2(0,-1);
THREE.SpriteAlignment.topRight=new THREE.Vector2(-1,-1);THREE.SpriteAlignment.centerLeft=new THREE.Vector2(1,0);THREE.SpriteAlignment.center=new THREE.Vector2(0,0);THREE.SpriteAlignment.centerRight=new THREE.Vector2(-1,0);THREE.SpriteAlignment.bottomLeft=new THREE.Vector2(1,1);THREE.SpriteAlignment.bottomCenter=new THREE.Vector2(0,1);THREE.SpriteAlignment.bottomRight=new THREE.Vector2(-1,1);
THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.matrixAutoUpdate=!1;this.__objects=[];this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;
THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)this.__lights.indexOf(a)===-1&&this.__lights.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.__objects.indexOf(a)===-1){this.__objects.push(a);this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);b!==-1&&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);b!==-1&&this.__lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.__objects.indexOf(a),b!==-1&&(this.__objects.splice(b,1),this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),b!==-1&&this.__objectsAdded.splice(b,1)));for(b=0;b<a.children.length;b++)this.__removeObject(a.children[b])};
THREE.Fog=function(a,b,c){this.color=new THREE.Color(a);this.near=b!==void 0?b:1;this.far=c!==void 0?c:1E3};THREE.FogExp2=function(a,b){this.color=new THREE.Color(a);this.density=b!==void 0?b:2.5E-4};
THREE.DOMRenderer=function(){var a,b,c=new THREE.Projector,d,f,g,e;this.domElement=document.createElement("div");this.setSize=function(a,b){d=a;f=b;g=d/2;e=f/2};this.render=function(d,f){var j,k,q,n,o;a=c.projectScene(d,f);b=a.elements;for(j=0,k=b.length;j<k;j++)if(q=b[j],q instanceof THREE.RenderableParticle&&(n=q.x*g+g,o=q.y*e+e,q=q.material,q instanceof THREE.ParticleDOMMaterial))q=q.domElement,q.style.left=n+"px",q.style.top=o+"px"}};
THREE.CanvasRenderer=function(a){function b(a){if(t!=a)m.globalAlpha=t=a}function c(a){if(v!=a){switch(a){case THREE.NormalBlending:m.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:m.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:m.globalCompositeOperation="darker"}v=a}}function d(a){if(u!=a)m.strokeStyle=u=a}function f(a){if(w!=a)m.fillStyle=w=a}var a=a||{},g=this,e,h,i,j=new THREE.Projector,k=a.canvas!==void 0?a.canvas:document.createElement("canvas"),
q,n,o,s,m=k.getContext("2d"),p=new THREE.Color(0),r=0,t=1,v=0,u=null,w=null,y=null,F=null,D=null,G,I,K,Q,N=new THREE.RenderableVertex,B=new THREE.RenderableVertex,O,S,A,l,V,E,z,T,W,M,ma,aa,Z=new THREE.Color,X=new THREE.Color,U=new THREE.Color,Y=new THREE.Color,$=new THREE.Color,oa=[],ga=[],ra,qa,ha,ka,Ea,Aa,ya,xa,za,wa,sa=new THREE.Rectangle,na=new THREE.Rectangle,ja=new THREE.Rectangle,ta=!1,ua=new THREE.Color,Ba=new THREE.Color,Ga=new THREE.Color,da=new THREE.Vector3,R,Ca,Ra,Da,Oa,Pa,a=16;R=document.createElement("canvas");
R.width=R.height=2;Ca=R.getContext("2d");Ca.fillStyle="rgba(0,0,0,1)";Ca.fillRect(0,0,2,2);Ra=Ca.getImageData(0,0,2,2);Da=Ra.data;Oa=document.createElement("canvas");Oa.width=Oa.height=a;Pa=Oa.getContext("2d");Pa.translate(-a/2,-a/2);Pa.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){q=a;n=b;o=Math.floor(q/2);s=Math.floor(n/2);k.width=q;k.height=n;sa.set(-o,-s,o,s);na.set(-o,-s,o,s);t=1;v=0;D=
F=y=w=u=null};this.setClearColor=function(a,b){p.copy(a);r=b;na.set(-o,-s,o,s)};this.setClearColorHex=function(a,b){p.setHex(a);r=b;na.set(-o,-s,o,s)};this.clear=function(){m.setTransform(1,0,0,-1,o,s);na.isEmpty()||(na.minSelf(sa),na.inflate(2),r<1&&m.clearRect(Math.floor(na.getX()),Math.floor(na.getY()),Math.floor(na.getWidth()),Math.floor(na.getHeight())),r>0&&(c(THREE.NormalBlending),b(1),f("rgba("+Math.floor(p.r*255)+","+Math.floor(p.g*255)+","+Math.floor(p.b*255)+","+r+")"),m.fillRect(Math.floor(na.getX()),
Math.floor(na.getY()),Math.floor(na.getWidth()),Math.floor(na.getHeight()))),na.empty())};this.render=function(a,k){function n(a){var b,c,d,f;ua.setRGB(0,0,0);Ba.setRGB(0,0,0);Ga.setRGB(0,0,0);for(b=0,c=a.length;b<c;b++)d=a[b],f=d.color,d instanceof THREE.AmbientLight?(ua.r+=f.r,ua.g+=f.g,ua.b+=f.b):d instanceof THREE.DirectionalLight?(Ba.r+=f.r,Ba.g+=f.g,Ba.b+=f.b):d instanceof THREE.PointLight&&(Ga.r+=f.r,Ga.g+=f.g,Ga.b+=f.b)}function q(a,b,c,d){var f,g,e,h,i,l;for(f=0,g=a.length;f<g;f++)e=a[f],
h=e.color,e instanceof THREE.DirectionalLight?(i=e.matrixWorld.getPosition(),l=c.dot(i),l<=0||(l*=e.intensity,d.r+=h.r*l,d.g+=h.g*l,d.b+=h.b*l)):e instanceof THREE.PointLight&&(i=e.matrixWorld.getPosition(),l=c.dot(da.sub(i,b).normalize()),l<=0||(l*=e.distance==0?1:1-Math.min(b.distanceTo(i)/e.distance,1),l!=0&&(l*=e.intensity,d.r+=h.r*l,d.g+=h.g*l,d.b+=h.b*l)))}function p(a,g,e){b(e.opacity);c(e.blending);var h,da,i,l,j,k;if(e instanceof THREE.ParticleBasicMaterial){if(e.map)l=e.map.image,j=l.width>>
1,k=l.height>>1,e=g.scale.x*o,i=g.scale.y*s,h=e*j,da=i*k,ja.set(a.x-h,a.y-da,a.x+h,a.y+da),sa.intersects(ja)&&(m.save(),m.translate(a.x,a.y),m.rotate(-g.rotation),m.scale(e,-i),m.translate(-j,-k),m.drawImage(l,0,0),m.restore())}else e instanceof THREE.ParticleCanvasMaterial&&(h=g.scale.x*o,da=g.scale.y*s,ja.set(a.x-h,a.y-da,a.x+h,a.y+da),sa.intersects(ja)&&(d(e.color.getContextStyle()),f(e.color.getContextStyle()),m.save(),m.translate(a.x,a.y),m.rotate(-g.rotation),m.scale(h,da),e.program(m),m.restore()))}
function r(a,f,g,e){b(e.opacity);c(e.blending);m.beginPath();m.moveTo(a.positionScreen.x,a.positionScreen.y);m.lineTo(f.positionScreen.x,f.positionScreen.y);m.closePath();if(e instanceof THREE.LineBasicMaterial){a=e.linewidth;if(y!=a)m.lineWidth=y=a;a=e.linecap;if(F!=a)m.lineCap=F=a;a=e.linejoin;if(D!=a)m.lineJoin=D=a;d(e.color.getContextStyle());m.stroke();ja.inflate(e.linewidth*2)}}function t(a,d,f,e,h,j,m,R){g.info.render.vertices+=3;g.info.render.faces++;b(R.opacity);c(R.blending);O=a.positionScreen.x;
S=a.positionScreen.y;A=d.positionScreen.x;l=d.positionScreen.y;V=f.positionScreen.x;E=f.positionScreen.y;w(O,S,A,l,V,E);if(R instanceof THREE.MeshBasicMaterial)if(R.map)R.map.mapping instanceof THREE.UVMapping&&(ka=m.uvs[0],Sa(O,S,A,l,V,E,ka[e].u,ka[e].v,ka[h].u,ka[h].v,ka[j].u,ka[j].v,R.map));else if(R.envMap){if(R.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=k.matrixWorldInverse,da.copy(m.vertexNormalsWorld[e]),Ea=(da.x*a.n11+da.y*a.n12+da.z*a.n13)*0.5+0.5,Aa=-(da.x*a.n21+da.y*a.n22+
da.z*a.n23)*0.5+0.5,da.copy(m.vertexNormalsWorld[h]),ya=(da.x*a.n11+da.y*a.n12+da.z*a.n13)*0.5+0.5,xa=-(da.x*a.n21+da.y*a.n22+da.z*a.n23)*0.5+0.5,da.copy(m.vertexNormalsWorld[j]),za=(da.x*a.n11+da.y*a.n12+da.z*a.n13)*0.5+0.5,wa=-(da.x*a.n21+da.y*a.n22+da.z*a.n23)*0.5+0.5,Sa(O,S,A,l,V,E,Ea,Aa,ya,xa,za,wa,R.envMap)}else R.wireframe?Ha(R.color,R.wireframeLinewidth,R.wireframeLinecap,R.wireframeLinejoin):J(R.color);else if(R instanceof THREE.MeshLambertMaterial)R.map&&!R.wireframe&&(R.map.mapping instanceof
THREE.UVMapping&&(ka=m.uvs[0],Sa(O,S,A,l,V,E,ka[e].u,ka[e].v,ka[h].u,ka[h].v,ka[j].u,ka[j].v,R.map)),c(THREE.SubtractiveBlending)),ta?!R.wireframe&&R.shading==THREE.SmoothShading&&m.vertexNormalsWorld.length==3?(X.r=U.r=Y.r=ua.r,X.g=U.g=Y.g=ua.g,X.b=U.b=Y.b=ua.b,q(i,m.v1.positionWorld,m.vertexNormalsWorld[0],X),q(i,m.v2.positionWorld,m.vertexNormalsWorld[1],U),q(i,m.v3.positionWorld,m.vertexNormalsWorld[2],Y),X.r=Math.max(0,Math.min(R.color.r*X.r,1)),X.g=Math.max(0,Math.min(R.color.g*X.g,1)),X.b=
Math.max(0,Math.min(R.color.b*X.b,1)),U.r=Math.max(0,Math.min(R.color.r*U.r,1)),U.g=Math.max(0,Math.min(R.color.g*U.g,1)),U.b=Math.max(0,Math.min(R.color.b*U.b,1)),Y.r=Math.max(0,Math.min(R.color.r*Y.r,1)),Y.g=Math.max(0,Math.min(R.color.g*Y.g,1)),Y.b=Math.max(0,Math.min(R.color.b*Y.b,1)),$.r=(U.r+Y.r)*0.5,$.g=(U.g+Y.g)*0.5,$.b=(U.b+Y.b)*0.5,ha=L(X,U,Y,$),Ma(O,S,A,l,V,E,0,0,1,0,0,1,ha)):(Z.r=ua.r,Z.g=ua.g,Z.b=ua.b,q(i,m.centroidWorld,m.normalWorld,Z),Z.r=Math.max(0,Math.min(R.color.r*Z.r,1)),Z.g=
Math.max(0,Math.min(R.color.g*Z.g,1)),Z.b=Math.max(0,Math.min(R.color.b*Z.b,1)),R.wireframe?Ha(Z,R.wireframeLinewidth,R.wireframeLinecap,R.wireframeLinejoin):J(Z)):R.wireframe?Ha(R.color,R.wireframeLinewidth,R.wireframeLinecap,R.wireframeLinejoin):J(R.color);else if(R instanceof THREE.MeshDepthMaterial)ra=k.near,qa=k.far,X.r=X.g=X.b=1-La(a.positionScreen.z,ra,qa),U.r=U.g=U.b=1-La(d.positionScreen.z,ra,qa),Y.r=Y.g=Y.b=1-La(f.positionScreen.z,ra,qa),$.r=(U.r+Y.r)*0.5,$.g=(U.g+Y.g)*0.5,$.b=(U.b+Y.b)*
0.5,ha=L(X,U,Y,$),Ma(O,S,A,l,V,E,0,0,1,0,0,1,ha);else if(R instanceof THREE.MeshNormalMaterial)Z.r=Na(m.normalWorld.x),Z.g=Na(m.normalWorld.y),Z.b=Na(m.normalWorld.z),R.wireframe?Ha(Z,R.wireframeLinewidth,R.wireframeLinecap,R.wireframeLinejoin):J(Z)}function u(a,d,f,e,h,da,j,R,m){g.info.render.vertices+=4;g.info.render.faces++;b(R.opacity);c(R.blending);if(R.map||R.envMap)t(a,d,e,0,1,3,j,R,m),t(h,f,da,1,2,3,j,R,m);else if(O=a.positionScreen.x,S=a.positionScreen.y,A=d.positionScreen.x,l=d.positionScreen.y,
V=f.positionScreen.x,E=f.positionScreen.y,z=e.positionScreen.x,T=e.positionScreen.y,W=h.positionScreen.x,M=h.positionScreen.y,ma=da.positionScreen.x,aa=da.positionScreen.y,R instanceof THREE.MeshBasicMaterial)v(O,S,A,l,V,E,z,T),R.wireframe?Ha(R.color,R.wireframeLinewidth,R.wireframeLinecap,R.wireframeLinejoin):J(R.color);else if(R instanceof THREE.MeshLambertMaterial)ta?!R.wireframe&&R.shading==THREE.SmoothShading&&j.vertexNormalsWorld.length==4?(X.r=U.r=Y.r=$.r=ua.r,X.g=U.g=Y.g=$.g=ua.g,X.b=U.b=
Y.b=$.b=ua.b,q(i,j.v1.positionWorld,j.vertexNormalsWorld[0],X),q(i,j.v2.positionWorld,j.vertexNormalsWorld[1],U),q(i,j.v4.positionWorld,j.vertexNormalsWorld[3],Y),q(i,j.v3.positionWorld,j.vertexNormalsWorld[2],$),X.r=Math.max(0,Math.min(R.color.r*X.r,1)),X.g=Math.max(0,Math.min(R.color.g*X.g,1)),X.b=Math.max(0,Math.min(R.color.b*X.b,1)),U.r=Math.max(0,Math.min(R.color.r*U.r,1)),U.g=Math.max(0,Math.min(R.color.g*U.g,1)),U.b=Math.max(0,Math.min(R.color.b*U.b,1)),Y.r=Math.max(0,Math.min(R.color.r*Y.r,
1)),Y.g=Math.max(0,Math.min(R.color.g*Y.g,1)),Y.b=Math.max(0,Math.min(R.color.b*Y.b,1)),$.r=Math.max(0,Math.min(R.color.r*$.r,1)),$.g=Math.max(0,Math.min(R.color.g*$.g,1)),$.b=Math.max(0,Math.min(R.color.b*$.b,1)),ha=L(X,U,Y,$),w(O,S,A,l,z,T),Ma(O,S,A,l,z,T,0,0,1,0,0,1,ha),w(W,M,V,E,ma,aa),Ma(W,M,V,E,ma,aa,1,0,1,1,0,1,ha)):(Z.r=ua.r,Z.g=ua.g,Z.b=ua.b,q(i,j.centroidWorld,j.normalWorld,Z),Z.r=Math.max(0,Math.min(R.color.r*Z.r,1)),Z.g=Math.max(0,Math.min(R.color.g*Z.g,1)),Z.b=Math.max(0,Math.min(R.color.b*
Z.b,1)),v(O,S,A,l,V,E,z,T),R.wireframe?Ha(Z,R.wireframeLinewidth,R.wireframeLinecap,R.wireframeLinejoin):J(Z)):(v(O,S,A,l,V,E,z,T),R.wireframe?Ha(R.color,R.wireframeLinewidth,R.wireframeLinecap,R.wireframeLinejoin):J(R.color));else if(R instanceof THREE.MeshNormalMaterial)Z.r=Na(j.normalWorld.x),Z.g=Na(j.normalWorld.y),Z.b=Na(j.normalWorld.z),v(O,S,A,l,V,E,z,T),R.wireframe?Ha(Z,R.wireframeLinewidth,R.wireframeLinecap,R.wireframeLinejoin):J(Z);else if(R instanceof THREE.MeshDepthMaterial)ra=k.near,
qa=k.far,X.r=X.g=X.b=1-La(a.positionScreen.z,ra,qa),U.r=U.g=U.b=1-La(d.positionScreen.z,ra,qa),Y.r=Y.g=Y.b=1-La(e.positionScreen.z,ra,qa),$.r=$.g=$.b=1-La(f.positionScreen.z,ra,qa),ha=L(X,U,Y,$),w(O,S,A,l,z,T),Ma(O,S,A,l,z,T,0,0,1,0,0,1,ha),w(W,M,V,E,ma,aa),Ma(W,M,V,E,ma,aa,1,0,1,1,0,1,ha)}function w(a,b,c,d,f,g){m.beginPath();m.moveTo(a,b);m.lineTo(c,d);m.lineTo(f,g);m.lineTo(a,b);m.closePath()}function v(a,b,c,d,f,g,e,h){m.beginPath();m.moveTo(a,b);m.lineTo(c,d);m.lineTo(f,g);m.lineTo(e,h);m.lineTo(a,
b);m.closePath()}function Ha(a,b,c,f){if(y!=b)m.lineWidth=y=b;if(F!=c)m.lineCap=F=c;if(D!=f)m.lineJoin=D=f;d(a.getContextStyle());m.stroke();ja.inflate(b*2)}function J(a){f(a.getContextStyle());m.fill()}function Sa(a,b,c,d,g,e,h,da,i,l,j,R,k){if(k.image.width!=0){if(k.needsUpdate==!0||oa[k.id]==void 0){var n=k.wrapS==THREE.RepeatWrapping,Ca=k.wrapT==THREE.RepeatWrapping;oa[k.id]=m.createPattern(k.image,n&&Ca?"repeat":n&&!Ca?"repeat-x":!n&&Ca?"repeat-y":"no-repeat");k.needsUpdate=!1}f(oa[k.id]);var n=
k.offset.x/k.repeat.x,Ca=k.offset.y/k.repeat.y,q=k.image.width*k.repeat.x,o=k.image.height*k.repeat.y,h=(h+n)*q,da=(da+Ca)*o,i=(i+n)*q,l=(l+Ca)*o,j=(j+n)*q,R=(R+Ca)*o;c-=a;d-=b;g-=a;e-=b;i-=h;l-=da;j-=h;R-=da;n=i*R-j*l;if(n==0){if(ga[k.id]===void 0)b=document.createElement("canvas"),b.width=k.image.width,b.height=k.image.height,b=b.getContext("2d"),b.drawImage(k.image,0,0),ga[k.id]=b.getImageData(0,0,k.image.width,k.image.height).data;b=ga[k.id];h=(Math.floor(h)+Math.floor(da)*k.image.width)*4;Z.setRGB(b[h]/
255,b[h+1]/255,b[h+2]/255);J(Z)}else n=1/n,k=(R*c-l*g)*n,l=(R*d-l*e)*n,c=(i*g-j*c)*n,d=(i*e-j*d)*n,a=a-k*h-c*da,h=b-l*h-d*da,m.save(),m.transform(k,l,c,d,a,h),m.fill(),m.restore()}}function Ma(a,b,c,d,f,g,e,h,da,i,l,j,R){var k,n;k=R.width-1;n=R.height-1;e*=k;h*=n;da*=k;i*=n;l*=k;j*=n;c-=a;d-=b;f-=a;g-=b;da-=e;i-=h;l-=e;j-=h;n=1/(da*j-l*i);k=(j*c-i*f)*n;i=(j*d-i*g)*n;c=(da*f-l*c)*n;d=(da*g-l*d)*n;a=a-k*e-c*h;b=b-i*e-d*h;m.save();m.transform(k,i,c,d,a,b);m.clip();m.drawImage(R,0,0);m.restore()}function L(a,
b,c,d){var f=~~(a.r*255),g=~~(a.g*255),a=~~(a.b*255),e=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),da=~~(c.r*255),i=~~(c.g*255),c=~~(c.b*255),l=~~(d.r*255),j=~~(d.g*255),d=~~(d.b*255);Da[0]=f<0?0:f>255?255:f;Da[1]=g<0?0:g>255?255:g;Da[2]=a<0?0:a>255?255:a;Da[4]=e<0?0:e>255?255:e;Da[5]=h<0?0:h>255?255:h;Da[6]=b<0?0:b>255?255:b;Da[8]=da<0?0:da>255?255:da;Da[9]=i<0?0:i>255?255:i;Da[10]=c<0?0:c>255?255:c;Da[12]=l<0?0:l>255?255:l;Da[13]=j<0?0:j>255?255:j;Da[14]=d<0?0:d>255?255:d;Ca.putImageData(Ra,0,0);Pa.drawImage(R,
0,0);return Oa}function La(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function Na(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function Ia(a,b){var c=b.x-a.x,d=b.y-a.y,f=c*c+d*d;f!=0&&(f=1/Math.sqrt(f),c*=f,d*=f,b.x+=c,b.y+=d,a.x-=c,a.y-=d)}var P,Ta,va,Fa;this.autoClear?this.clear():m.setTransform(1,0,0,-1,o,s);g.info.render.vertices=0;g.info.render.faces=0;e=j.projectScene(a,k,this.sortElements);h=e.elements;i=e.lights;(ta=i.length>0)&&n(i);for(P=0,Ta=h.length;P<Ta;P++)if(va=h[P],Fa=va.material,Fa=Fa instanceof
THREE.MeshFaceMaterial?va.faceMaterial:Fa,!(Fa==null||Fa.opacity==0)){ja.empty();if(va instanceof THREE.RenderableParticle)G=va,G.x*=o,G.y*=s,p(G,va,Fa,a);else if(va instanceof THREE.RenderableLine)G=va.v1,I=va.v2,G.positionScreen.x*=o,G.positionScreen.y*=s,I.positionScreen.x*=o,I.positionScreen.y*=s,ja.addPoint(G.positionScreen.x,G.positionScreen.y),ja.addPoint(I.positionScreen.x,I.positionScreen.y),sa.intersects(ja)&&r(G,I,va,Fa,a);else if(va instanceof THREE.RenderableFace3)G=va.v1,I=va.v2,K=va.v3,
G.positionScreen.x*=o,G.positionScreen.y*=s,I.positionScreen.x*=o,I.positionScreen.y*=s,K.positionScreen.x*=o,K.positionScreen.y*=s,Fa.overdraw&&(Ia(G.positionScreen,I.positionScreen),Ia(I.positionScreen,K.positionScreen),Ia(K.positionScreen,G.positionScreen)),ja.add3Points(G.positionScreen.x,G.positionScreen.y,I.positionScreen.x,I.positionScreen.y,K.positionScreen.x,K.positionScreen.y),sa.intersects(ja)&&t(G,I,K,0,1,2,va,Fa,a);else if(va instanceof THREE.RenderableFace4)G=va.v1,I=va.v2,K=va.v3,Q=
va.v4,G.positionScreen.x*=o,G.positionScreen.y*=s,I.positionScreen.x*=o,I.positionScreen.y*=s,K.positionScreen.x*=o,K.positionScreen.y*=s,Q.positionScreen.x*=o,Q.positionScreen.y*=s,N.positionScreen.copy(I.positionScreen),B.positionScreen.copy(Q.positionScreen),Fa.overdraw&&(Ia(G.positionScreen,I.positionScreen),Ia(I.positionScreen,Q.positionScreen),Ia(Q.positionScreen,G.positionScreen),Ia(K.positionScreen,N.positionScreen),Ia(K.positionScreen,B.positionScreen)),ja.addPoint(G.positionScreen.x,G.positionScreen.y),
ja.addPoint(I.positionScreen.x,I.positionScreen.y),ja.addPoint(K.positionScreen.x,K.positionScreen.y),ja.addPoint(Q.positionScreen.x,Q.positionScreen.y),sa.intersects(ja)&&u(G,I,K,Q,N,B,va,Fa,a);na.addRectangle(ja)}m.setTransform(1,0,0,1,0,0)}};
THREE.SVGRenderer=function(){function a(a,b,c,d){var f,g,e,h,i,j;for(f=0,g=a.length;f<g;f++)e=a[f],h=e.color,e instanceof THREE.DirectionalLight?(i=e.matrixWorld.getPosition(),j=c.dot(i),j<=0||(j*=e.intensity,d.r+=h.r*j,d.g+=h.g*j,d.b+=h.b*j)):e instanceof THREE.PointLight&&(i=e.matrixWorld.getPosition(),j=c.dot(G.sub(i,b).normalize()),j<=0||(j*=e.distance==0?1:1-Math.min(b.distanceTo(i)/e.distance,1),j!=0&&(j*=e.intensity,d.r+=h.r*j,d.g+=h.g*j,d.b+=h.b*j)))}function b(a){I[a]==null&&(I[a]=document.createElementNS("http://www.w3.org/2000/svg",
"path"),O==0&&I[a].setAttribute("shape-rendering","crispEdges"));return I[a]}function c(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}var d=this,f,g,e,h=new THREE.Projector,i=document.createElementNS("http://www.w3.org/2000/svg","svg"),j,k,q,n,o,s,m,p,r=new THREE.Rectangle,t=new THREE.Rectangle,v=!1,u=new THREE.Color,w=new THREE.Color,y=new THREE.Color,F=new THREE.Color,D,G=new THREE.Vector3,I=[],K=[],Q,N,B,O=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":O=1;break;case "low":O=0}};this.setSize=function(a,b){j=a;k=b;q=j/2;n=k/2;i.setAttribute("viewBox",-q+" "+-n+" "+j+" "+k);i.setAttribute("width",j);i.setAttribute("height",k);r.set(-q,-n,q,n)};this.clear=function(){for(;i.childNodes.length>0;)i.removeChild(i.childNodes[0])};this.render=function(j,k){var l,G,E,z;this.autoClear&&this.clear();d.info.render.vertices=0;d.info.render.faces=0;f=h.projectScene(j,k,this.sortElements);g=f.elements;
e=f.lights;B=N=0;if(v=e.length>0){w.setRGB(0,0,0);y.setRGB(0,0,0);F.setRGB(0,0,0);for(l=0,G=e.length;l<G;l++)z=e[l],E=z.color,z instanceof THREE.AmbientLight?(w.r+=E.r,w.g+=E.g,w.b+=E.b):z instanceof THREE.DirectionalLight?(y.r+=E.r,y.g+=E.g,y.b+=E.b):z instanceof THREE.PointLight&&(F.r+=E.r,F.g+=E.g,F.b+=E.b)}for(l=0,G=g.length;l
<G;l++)if(E=g[l],z=E.material,z=z instanceof THREE.MeshFaceMaterial?E.faceMaterial:z,!(z==null||z.opacity==0))if(t.empty(),E instanceof THREE.RenderableParticle)o=E,o.x*=
q,o.y*=-n;else if(E instanceof THREE.RenderableLine){if(o=E.v1,s=E.v2,o.positionScreen.x*=q,o.positionScreen.y*=-n,s.positionScreen.x*=q,s.positionScreen.y*=-n,t.addPoint(o.positionScreen.x,o.positionScreen.y),t.addPoint(s.positionScreen.x,s.positionScreen.y),r.intersects(t)){E=o;var T=s,W=B++;K[W]==null&&(K[W]=document.createElementNS("http://www.w3.org/2000/svg","line"),O==0&&K[W].setAttribute("shape-rendering","crispEdges"));Q=K[W];Q.setAttribute("x1",E.positionScreen.x);Q.setAttribute("y1",E.positionScreen.y);
Q.setAttribute("x2",T.positionScreen.x);Q.setAttribute("y2",T.positionScreen.y);z instanceof THREE.LineBasicMaterial&&(Q.setAttribute("style","fill: none; stroke: "+z.color.getContextStyle()+"; stroke-width: "+z.linewidth+"; stroke-opacity: "+z.opacity+"; stroke-linecap: "+z.linecap+"; stroke-linejoin: "+z.linejoin),i.appendChild(Q))}}else if(E instanceof THREE.RenderableFace3){if(o=E.v1,s=E.v2,m=E.v3,o.positionScreen.x*=q,o.positionScreen.y*=-n,s.positionScreen.x*=q,s.positionScreen.y*=-n,m.positionScreen.x*=
q,m.positionScreen.y*=-n,t.addPoint(o.positionScreen.x,o.positionScreen.y),t.addPoint(s.positionScreen.x,s.positionScreen.y),t.addPoint(m.positionScreen.x,m.positionScreen.y),r.intersects(t)){var T=o,W=s,I=m;d.info.render.vertices+=3;d.info.render.faces++;Q=b(N++);Q.setAttribute("d","M "+T.positionScreen.x+" "+T.positionScreen.y+" L "+W.positionScreen.x+" "+W.positionScreen.y+" L "+I.positionScreen.x+","+I.positionScreen.y+"z");z instanceof THREE.MeshBasicMaterial?u.copy(z.color):z instanceof THREE.MeshLambertMaterial?
v?(u.r=w.r,u.g=w.g,u.b=w.b,a(e,E.centroidWorld,E.normalWorld,u),u.r=Math.max(0,Math.min(z.color.r*u.r,1)),u.g=Math.max(0,Math.min(z.color.g*u.g,1)),u.b=Math.max(0,Math.min(z.color.b*u.b,1))):u.copy(z.color):z instanceof THREE.MeshDepthMaterial?(D=1-z.__2near/(z.__farPlusNear-E.z*z.__farMinusNear),u.setRGB(D,D,D)):z instanceof THREE.MeshNormalMaterial&&u.setRGB(c(E.normalWorld.x),c(E.normalWorld.y),c(E.normalWorld.z));z.wireframe?Q.setAttribute("style","fill: none; stroke: "+u.getContextStyle()+"; stroke-width: "+
z.wireframeLinewidth+"; stroke-opacity: "+z.opacity+"; stroke-linecap: "+z.wireframeLinecap+"; stroke-linejoin: "+z.wireframeLinejoin):Q.setAttribute("style","fill: "+u.getContextStyle()+"; fill-opacity: "+z.opacity);i.appendChild(Q)}}else if(E instanceof THREE.RenderableFace4&&(o=E.v1,s=E.v2,m=E.v3,p=E.v4,o.positionScreen.x*=q,o.positionScreen.y*=-n,s.positionScreen.x*=q,s.positionScreen.y*=-n,m.positionScreen.x*=q,m.positionScreen.y*=-n,p.positionScreen.x*=q,p.positionScreen.y*=-n,t.addPoint(o.positionScreen.x,
o.positionScreen.y),t.addPoint(s.positionScreen.x,s.positionScreen.y),t.addPoint(m.positionScreen.x,m.positionScreen.y),t.addPoint(p.positionScreen.x,p.positionScreen.y),r.intersects(t))){var T=o,W=s,I=m,ma=p;d.info.render.vertices+=4;d.info.render.faces++;Q=b(N++);Q.setAttribute("d","M "+T.positionScreen.x+" "+T.positionScreen.y+" L "+W.positionScreen.x+" "+W.positionScreen.y+" L "+I.positionScreen.x+","+I.positionScreen.y+" L "+ma.positionScreen.x+","+ma.positionScreen.y+"z");z instanceof THREE.MeshBasicMaterial?
u.copy(z.color):z instanceof THREE.MeshLambertMaterial?v?(u.r=w.r,u.g=w.g,u.b=w.b,a(e,E.centroidWorld,E.normalWorld,u),u.r=Math.max(0,Math.min(z.color.r*u.r,1)),u.g=Math.max(0,Math.min(z.color.g*u.g,1)),u.b=Math.max(0,Math.min(z.color.b*u.b,1))):u.copy(z.color):z instanceof THREE.MeshDepthMaterial?(D=1-z.__2near/(z.__farPlusNear-E.z*z.__farMinusNear),u.setRGB(D,D,D)):z instanceof THREE.MeshNormalMaterial&&u.setRGB(c(E.normalWorld.x),c(E.normalWorld.y),c(E.normalWorld.z));z.wireframe?Q.setAttribute("style",
"fill: none; stroke: "+u.getContextStyle()+"; stroke-width: "+z.wireframeLinewidth+"; stroke-opacity: "+z.opacity+"; stroke-linecap: "+z.wireframeLinecap+"; stroke-linejoin: "+z.wireframeLinejoin):Q.setAttribute("style","fill: "+u.getContextStyle()+"; fill-opacity: "+z.opacity);i.appendChild(Q)}}};
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\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * vReflect.x, vReflect.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * vReflect.x, vReflect.yz ) );\n#endif\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",
lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\nvarying vec2 vUv2;\nuniform sampler2D lightMap;\n#endif",lightmap_pars_vertex:"#ifdef USE_LIGHTMAP\nvarying vec2 vUv2;\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\ngl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );\n#endif",lightmap_vertex:"#ifdef USE_LIGHTMAP\nvUv2 = uv2;\n#endif",lights_lambert_pars_vertex:"uniform vec3 ambient;\nuniform vec3 diffuse;\nuniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#endif\n#ifdef WRAP_AROUND\nuniform vec3 wrapRGB;\n#endif",
lights_lambert_vertex:"vLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\nvLightBack = vec3( 0.0 );\n#endif\ntransformedNormal = normalize( transformedNormal );\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\nfloat dotProduct = dot( transformedNormal, dirVector );\nvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n#ifdef DOUBLE_SIDED\nvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n#ifdef WRAP_AROUND\nvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n#endif\n#endif\n#ifdef WRAP_AROUND\nvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\ndirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n#ifdef DOUBLE_SIDED\ndirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n#endif\n#endif\nvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n#ifdef DOUBLE_SIDED\nvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n#endif\n}\n#endif\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nfloat dotProduct = dot( transformedNormal, lVector );\nvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n#ifdef DOUBLE_SIDED\nvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n#ifdef WRAP_AROUND\nvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n#endif\n#endif\n#ifdef WRAP_AROUND\nvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\npointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n#ifdef DOUBLE_SIDED\npointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n#endif\n#endif\nvLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;\n#ifdef DOUBLE_SIDED\nvLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;\n#endif\n}\n#endif\nvLightFront = vLightFront * diffuse + ambient * ambientLightColor;\n#ifdef DOUBLE_SIDED\nvLightBack = vLightBack * diffuse + ambient * ambientLightColor;\n#endif",
lights_phong_pars_vertex:"#if MAX_POINT_LIGHTS > 0\n#ifndef PHONG_PER_PIXEL\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\n#endif",lights_phong_vertex:"#if MAX_POINT_LIGHTS > 0\n#ifndef PHONG_PER_PIXEL\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#endif",
lights_phong_pars_fragment:"uniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n#ifdef PHONG_PER_PIXEL\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#else\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\n#endif\n#ifdef WRAP_AROUND\nuniform vec3 wrapRGB;\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",
lights_phong_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\n#ifdef DOUBLE_SIDED\nnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n#endif\n#if MAX_POINT_LIGHTS > 0\nvec3 pointDiffuse  = vec3( 0.0 );\nvec3 pointSpecular = vec3( 0.0 );\nfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n#ifdef PHONG_PER_PIXEL\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz + vViewPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\n#else\nvec3 lVector = normalize( vPointLight[ i ].xyz );\nfloat lDistance = vPointLight[ i ].w;\n#endif\nfloat dotProduct = dot( normal, lVector );\n#ifdef WRAP_AROUND\nfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\nfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\nvec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n#else\nfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n#endif\npointDiffuse  += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;\nvec3 pointHalfVector = normalize( lVector + viewPosition );\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointSpecularWeight = max( pow( pointDotNormalHalf, shininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( lVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance;\n#else\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance;\n#endif\n}\n#endif\n#if MAX_DIR_LIGHTS > 0\nvec3 dirDiffuse  = vec3( 0.0 );\nvec3 dirSpecular = vec3( 0.0 );\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\nfloat dotProduct = dot( normal, dirVector );\n#ifdef WRAP_AROUND\nfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\nfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\nvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n#else\nfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n#endif\ndirDiffuse  += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\nvec3 dirHalfVector = normalize( dirVector + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirSpecularWeight = max( pow( dirDotNormalHalf, shininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( dirVector, dirHalfVector ), 5.0 );\ndirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;\n#else\ndirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;\n#endif\n}\n#endif\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\ntotalDiffuse += dirDiffuse;\ntotalSpecular += dirSpecular;\n#endif\n#if MAX_POINT_LIGHTS > 0\ntotalDiffuse += pointDiffuse;\ntotalSpecular += pointSpecular;\n#endif\n#ifdef METAL\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );\n#else\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n#endif",
color_pars_fragment:"#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif",color_fragment:"#ifdef USE_COLOR\ngl_FragColor = gl_FragColor * vec4( vColor, opacity );\n#endif",color_pars_vertex:"#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n#ifdef GAMMA_INPUT\nvColor = color * color;\n#else\nvColor = color;\n#endif\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\nuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n#endif",skinning_vertex:"#ifdef USE_SKINNING\ngl_Position  = ( boneGlobalMatrices[ int( skinIndex.x ) ] * skinVertexA ) * skinWeight.x;\ngl_Position += ( boneGlobalMatrices[ int( skinIndex.y ) ] * skinVertexB ) * skinWeight.y;\ngl_Position  = projectionMatrix * modelViewMatrix * gl_Position;\n#endif",
morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n#ifndef USE_MORPHNORMALS\nuniform float morphTargetInfluences[ 8 ];\n#else\nuniform float morphTargetInfluences[ 4 ];\n#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\nvec3 morphed = vec3( 0.0 );\nmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\nmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\nmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\nmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n#ifndef USE_MORPHNORMALS\nmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\nmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\nmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\nmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n#endif\nmorphed += position;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( morphed, 1.0 );\n#endif",
default_vertex:"#ifndef USE_MORPHTARGETS\n#ifndef USE_SKINNING\ngl_Position = projectionMatrix * mvPosition;\n#endif\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\nvec3 morphedNormal = vec3( 0.0 );\nmorphedNormal +=  ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\nmorphedNormal +=  ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\nmorphedNormal +=  ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\nmorphedNormal +=  ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\nmorphedNormal += normal;\nvec3 transformedNormal = normalMatrix * morphedNormal;\n#else\nvec3 transformedNormal = normalMatrix * normal;\n#endif",
shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform vec2 shadowMapSize[ MAX_SHADOWS ];\nuniform float shadowDarkness[ MAX_SHADOWS ];\nuniform float shadowBias[ MAX_SHADOWS ];\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif",shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_DEBUG\nvec3 frustumColors[3];\nfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\nfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\nfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n#endif\n#ifdef SHADOWMAP_CASCADE\nint inFrustumCount = 0;\n#endif\nfloat fDepth;\nvec3 shadowColor = vec3( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\nbool inFrustum = all( inFrustumVec );\n#ifdef SHADOWMAP_CASCADE\ninFrustumCount += int( inFrustum );\nbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n#else\nbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n#endif\nbool frustumTest = all( frustumTestVec );\nif ( frustumTest ) {\nshadowCoord.z += shadowBias[ i ];\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nconst float shadowDelta = 1.0 / 9.0;\nfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\nfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\nfloat dx0 = -1.25 * xPixelOffset;\nfloat dy0 = -1.25 * yPixelOffset;\nfloat dx1 = 1.25 * xPixelOffset;\nfloat dy1 = 1.25 * yPixelOffset;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n#endif\n}\n#ifdef SHADOWMAP_DEBUG\n#ifdef SHADOWMAP_CASCADE\nif ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];\n#else\nif ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];\n#endif\n#endif\n}\n#ifdef GAMMA_OUTPUT\nshadowColor *= shadowColor;\n#endif\ngl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\n#endif",
shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n#ifdef USE_MORPHTARGETS\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( morphed, 1.0 );\n#else\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n#endif\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif",
linear_to_gamma_fragment:"#ifdef GAMMA_OUTPUT\ngl_FragColor.xyz = sqrt( gl_FragColor.xyz );\n#endif"};
THREE.UniformsUtils={merge:function(a){var b,c,d,f={};for(b=0;b
<a.length;b++)for(c in d=this.clone(a[b]),d)f[c]=d[c];return f},clone:function(a){var b,c,d,f={};for(b in a)for(c in f[b]={},a[b])d=a[b][c],f[b][c]=d instanceof THREE.Color||d instanceof THREE.Vector2||d instanceof THREE.Vector3||d instanceof THREE.Vector4||d instanceof THREE.Matrix4||d instanceof THREE.Texture?d.clone():d instanceof Array?d.slice():d;return f}};
THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:0,texture:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:2,texture:null},envMap:{type:"t",value:1,texture:null},flipEnvMap:{type:"f",value:-1},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:0.98},combine:{type:"i",value:0},morphTargetInfluences:{type:"f",value:0}},fog:{fogDensity:{type:"f",
value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",
value:1},map:{type:"t",value:0,texture:null},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:6,texture:[]},shadowMapSize:{type:"v2v",value:[]},shadowBias:{type:"fv1",value:[]},shadowDarkness:{type:"fv1",value:[]},shadowMatrix:{type:"m4v",value:[]}}};
THREE.ShaderLib={depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},vertexShader:"void main() {\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform float mNear;\nuniform float mFar;\nuniform float opacity;\nvoid main() {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat color = 1.0 - smoothstep( mNear, mFar, depth );\ngl_FragColor = vec4( vec3( color ), opacity );\n}"},normal:{uniforms:{opacity:{type:"f",
value:1}},vertexShader:"varying vec3 vNormal;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvNormal = normalize( normalMatrix * normal );\ngl_Position = projectionMatrix * mvPosition;\n}",fragmentShader:"uniform float opacity;\nvarying vec3 vNormal;\nvoid main() {\ngl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n}"},basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.shadowmap]),vertexShader:[THREE.ShaderChunk.map_pars_vertex,
THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,
THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( diffuse, opacity );",THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphatest_fragment,
THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},lambert:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{ambient:{type:"c",value:new THREE.Color(328965)},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),vertexShader:["varying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\nvarying vec3 vLightBack;\n#endif",
THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_lambert_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,
THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.lights_lambert_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\nvarying vec3 vLightBack;\n#endif",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,
THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( vec3 ( 1.0 ), opacity );",THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphatest_fragment,"#ifdef DOUBLE_SIDED\nif ( gl_FrontFacing )\ngl_FragColor.xyz *= vLightFront;\nelse\ngl_FragColor.xyz *= vLightBack;\n#else\ngl_FragColor.xyz *= vLightFront;\n#endif",THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,
THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},phong:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{ambient:{type:"c",value:new THREE.Color(328965)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"f",value:30},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),vertexShader:["varying vec3 vViewPosition;\nvarying vec3 vNormal;",THREE.ShaderChunk.map_pars_vertex,
THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_phong_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,"#ifndef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\n#endif\nvViewPosition = -mvPosition.xyz;",
THREE.ShaderChunk.morphnormal_vertex,"vNormal = transformedNormal;",THREE.ShaderChunk.lights_phong_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\nuniform vec3 ambient;\nuniform vec3 specular;\nuniform float shininess;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,
THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.lights_phong_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( vec3 ( 1.0 ), opacity );",THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.lights_phong_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,
THREE.ShaderChunk.fog_fragment,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",
THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,
"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask  = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};
THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if(a.__webglCustomAttributesList===void 0)a.__webglCustomAttributesList=[];for(var f in d.attributes){var e=d.attributes[f];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var g=1;e.type==="v2"?g=2:e.type==="v3"?g=3:e.type==="v4"?g=4:e.type==="c"&&(g=3);e.size=g;e.array=new Float32Array(c*g);e.buffer=l.createBuffer();e.buffer.belongsToAttribute=f;e.needsUpdate=!0}a.__webglCustomAttributesList.push(e)}}}
function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMaterial))return a.material;else if(b.materialIndex>=0)return a.geometry.materials[b.materialIndex]}function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&a.shading!==void 0&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a instanceof THREE.ShaderMaterial?!0:!1}function g(a,b,c){var d,f,e,g,h=a.vertices;g=h.length;
var i=a.colors,j=i.length,k=a.__vertexArray,m=a.__colorArray,n=a.__sortArray,q=a.__dirtyVertices,o=a.__dirtyColors,s=a.__webglCustomAttributesList;if(c.sortParticles){za.multiplySelf(c.matrixWorld);for(d=0;d<g;d++)f=h[d].position,wa.copy(f),za.multiplyVector3(wa),n[d]=[wa.z,d];n.sort(function(a,b){return b[0]-a[0]});for(d=0;d<g;d++)f=h[n[d][1]].position,e=d*3,k[e]=f.x,k[e+1]=f.y,k[e+2]=f.z;for(d=0;d<j;d++)e=d*3,f=i[n[d][1]],m[e]=f.r,m[e+1]=f.g,m[e+2]=f.b;if(s)for(i=0,j=s.length;i<j;i++)if(h=s[i],
h.boundTo===void 0||h.boundTo==="vertices")if(e=0,f=h.value.length,h.size===1)for(d=0;d<f;d++)g=n[d][1],h.array[d]=h.value[g];else if(h.size===2)for(d=0;d<f;d++)g=n[d][1],g=h.value[g],h.array[e]=g.x,h.array[e+1]=g.y,e+=2;else if(h.size===3)if(h.type==="c")for(d=0;d<f;d++)g=n[d][1],g=h.value[g],h.array[e]=g.r,h.array[e+1]=g.g,h.array[e+2]=g.b,e+=3;else for(d=0;d<f;d++)g=n[d][1],g=h.value[g],h.array[e]=g.x,h.array[e+1]=g.y,h.array[e+2]=g.z,e+=3;else if(h.size===4)for(d=0;d<f;d++)g=n[d][1],g=h.value[g],
h.array[e]=g.x,h.array[e+1]=g.y,h.array[e+2]=g.z,h.array[e+3]=g.w,e+=4}else{if(q)for(d=0;d<g;d++)f=h[d].position,e=d*3,k[e]=f.x,k[e+1]=f.y,k[e+2]=f.z;if(o)for(d=0;d<j;d++)f=i[d],e=d*3,m[e]=f.r,m[e+1]=f.g,m[e+2]=f.b;if(s)for(i=0,j=s.length;i<j;i++)if(h=s[i],h.needsUpdate&&(h.boundTo===void 0||h.boundTo==="vertices"))if(f=h.value.length,e=0,h.size===1)for(d=0;d<f;d++)h.array[d]=h.value[d];else if(h.size===2)for(d=0;d<f;d++)g=h.value[d],h.array[e]=g.x,h.array[e+1]=g.y,e+=2;else if(h.size===3)if(h.type===
"c")for(d=0;d<f;d++)g=h.value[d],h.array[e]=g.r,h.array[e+1]=g.g,h.array[e+2]=g.b,e+=3;else for(d=0;d<f;d++)g=h.value[d],h.array[e]=g.x,h.array[e+1]=g.y,h.array[e+2]=g.z,e+=3;else if(h.size===4)for(d=0;d<f;d++)g=h.value[d],h.array[e]=g.x,h.array[e+1]=g.y,h.array[e+2]=g.z,h.array[e+3]=g.w,e+=4}if(q||c.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,k,b);if(o||c.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,a.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,m,
b);if(s)for(i=0,j=s.length;i<j;i++)if(h=s[i],h.needsUpdate||c.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,h.buffer),l.bufferData(l.ARRAY_BUFFER,h.array,b)}function e(a,b){return b.z-a.z}function h(a,b,c){if(a.length)for(var d=0,f=a.length;d<f;d++)M=E=null,T=W=Y=U=X=-1,a[d].render(b,c,Aa,ya),M=E=null,T=W=Y=U=X=-1}function i(a,b,c,d,f,e,g,h){var i,j,l,k;b?(j=a.length-1,k=b=-1):(j=0,b=a.length,k=1);for(var m=j;m!==b;m+=k)if(i=a[m],i.render){j=i.object;l=i.buffer;if(h)i=h;else{i=i[c];if(!i)continue;g&&
A.setBlending(i.blending);A.setDepthTest(i.depthTest);A.setDepthWrite(i.depthWrite);r(i.polygonOffset,i.polygonOffsetFactor,i.polygonOffsetUnits)}A.setObjectFaces(j);l instanceof THREE.BufferGeometry?A.renderBufferDirect(d,f,e,i,l,j):A.renderBuffer(d,f,e,i,l,j)}}function j(a,b,c,d,f,e,g){for(var h,i,j=0,l=a.length;j
<l;j++)if(h=a[j],i=h.object,i.visible){if(g)h=g;else{h=h[b];if(!h)continue;e&&A.setBlending(h.blending);A.setDepthTest(h.depthTest);A.setDepthWrite(h.depthWrite);r(h.polygonOffset,h.polygonOffsetFactor,
h.polygonOffsetUnits)}A.renderImmediateObject(c,d,f,h,i)}}function k(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}function q(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;c>=0;c--)a[c].object===b&&a.splice(c,1)}function s(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}function m(a,b,c,d,f){d.program||A.initMaterial(d,b,c,f);if(d.morphTargets&&
!f.__webglMorphTargetInfluences){f.__webglMorphTargetInfluences=new Float32Array(A.maxMorphTargets);for(var e=0,g=A.maxMorphTargets;e<g;e++)f.__webglMorphTargetInfluences[e]=0}var h=!1,e=d.program,g=e.uniforms,i=d.uniforms;e!==E&&(l.useProgram(e),E=e,h=!0);if(d.id!==T)T=d.id,h=!0;if(h||a!==M)l.uniformMatrix4fv(g.projectionMatrix,!1,a._projectionMatrixArray),a!==M&&(M=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 j,k=0,m=0,n=0,q,o,s,p=na,r=p.directional.colors,t=p.directional.positions,z=p.point.colors,u=p.point.positions,w=p.point.distances,D=0,G=0,W=s=0;for(c=0,h=b.length;c<h;c++)if(j=b[c],!j.onlyShadow)if(q=j.color,o=j.intensity,s=j.distance,j instanceof THREE.AmbientLight)A.gammaInput?(k+=q.r*q.r,m+=q.g*q.g,n+=q.b*q.b):(k+=q.r,m+=q.g,n+=q.b);else if(j instanceof THREE.DirectionalLight)s=
D*3,A.gammaInput?(r[s]=q.r*q.r*o*o,r[s+1]=q.g*q.g*o*o,r[s+2]=q.b*q.b*o*o):(r[s]=q.r*o,r[s+1]=q.g*o,r[s+2]=q.b*o),sa.copy(j.matrixWorld.getPosition()),sa.subSelf(j.target.matrixWorld.getPosition()),sa.normalize(),t[s]=sa.x,t[s+1]=sa.y,t[s+2]=sa.z,D+=1;else if(j instanceof THREE.PointLight||j instanceof THREE.SpotLight)W=G*3,A.gammaInput?(z[W]=q.r*q.r*o*o,z[W+1]=q.g*q.g*o*o,z[W+2]=q.b*q.b*o*o):(z[W]=q.r*o,z[W+1]=q.g*o,z[W+2]=q.b*o),j=j.matrixWorld.getPosition(),u[W]=j.x,u[W+1]=j.y,u[W+2]=j.z,w[G]=s,
G+=1;for(c=D*3,h=r.length;c<h;c++)r[c]=0;for(c=G*3,h=z.length;c<h;c++)z[c]=0;p.point.length=G;p.directional.length=D;p.ambient[0]=k;p.ambient[1]=m;p.ambient[2]=n;c=na;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,A.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=F.height/2,i.map.texture=d.map;else if(d instanceof THREE.MeshPhongMaterial)i.shininess.value=d.shininess,A.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)A.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(f.receiveShadow&&!d._shadowPass&&i.shadowMatrix){h=
c=0;for(k=b.length;h<k;h++)if(m=b[h],m.castShadow&&(m instanceof THREE.SpotLight||m instanceof THREE.DirectionalLight&&!m.shadowCascade))i.shadowMap.texture[c]=m.shadowMap,i.shadowMapSize.value[c]=m.shadowMapSize,i.shadowMatrix.value[c]=m.shadowMatrix,i.shadowDarkness.value[c]=m.shadowDarkness,i.shadowBias.value[c]=m.shadowBias,c++}b=d.uniformsList;for(i=0,c=b.length;i<c;i++)if(m=e.uniforms[b[i][1]])if(h=b[i][0],n=h.type,k=h.value,n==="i")l.uniform1i(m,k);else if(n==="f")l.uniform1f(m,k);else if(n===
"v2")l.uniform2f(m,k.x,k.y);else if(n==="v3")l.uniform3f(m,k.x,k.y,k.z);else if(n==="v4")l.uniform4f(m,k.x,k.y,k.z,k.w);else if(n==="c")l.uniform3f(m,k.r,k.g,k.b);else if(n==="fv1")l.uniform1fv(m,k);else if(n==="fv")l.uniform3fv(m,k);else if(n==="v2v"){if(!h._array)h._array=new Float32Array(2*k.length);for(n=0,p=k.length;n<p;n++)r=n*2,h._array[r]=k[n].x,h._array[r+1]=k[n].y;l.uniform2fv(m,h._array)}else if(n==="v3v"){if(!h._array)h._array=new Float32Array(3*k.length);for(n=0,p=k.length;n<p;n++)r=
n*3,h._array[r]=k[n].x,h._array[r+1]=k[n].y,h._array[r+2]=k[n].z;l.uniform3fv(m,h._array)}else if(n=="v4v"){if(!h._array)h._array=new Float32Array(4*k.length);for(n=0,p=k.length;n<p;n++)r=n*4,h._array[r]=k[n].x,h._array[r+1]=k[n].y,h._array[r+2]=k[n].z,h._array[r+3]=k[n].w;l.uniform4fv(m,h._array)}else if(n==="m4"){if(!h._array)h._array=new Float32Array(16);k.flattenToArray(h._array);l.uniformMatrix4fv(m,!1,h._array)}else if(n==="m4v"){if(!h._array)h._array=new Float32Array(16*k.length);for(n=0,p=
k.length;n<p;n++)k[n].flattenToArrayOffset(h._array,n*16);l.uniformMatrix4fv(m,!1,h._array)}else if(n==="t"){if(l.uniform1i(m,k),m=h.texture)if(m.image instanceof Array&&m.image.length===6){if(h=m,h.image.length===6)if(h.needsUpdate){if(!h.image.__webglTextureCube)h.image.__webglTextureCube=l.createTexture();l.activeTexture(l.TEXTURE0+k);l.bindTexture(l.TEXTURE_CUBE_MAP,h.image.__webglTextureCube);k=[];for(m=0;m<6;m++){n=k;p=m;if(A.autoScaleCubemaps){if(r=h.image[m],z=ta,!(r.width<=z&&r.height<=z))u=
Math.max(r.width,r.height),t=Math.floor(r.width*z/u),z=Math.floor(r.height*z/u),u=document.createElement("canvas"),u.width=t,u.height=z,u.getContext("2d").drawImage(r,0,0,r.width,r.height,0,0,t,z),r=u}else r=h.image[m];n[p]=r}m=k[0];n=(m.width&m.width-1)===0&&(m.height&m.height-1)===0;p=y(h.format);r=y(h.type);v(l.TEXTURE_CUBE_MAP,h,n);for(m=0;m<6;m++)l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,p,p,r,k[m]);h.generateMipmaps&&n&&l.generateMipmap(l.TEXTURE_CUBE_MAP);h.needsUpdate=!1;if(h.onUpdate)h.onUpdate()}else l.activeTexture(l.TEXTURE0+
k),l.bindTexture(l.TEXTURE_CUBE_MAP,h.image.__webglTextureCube)}else m instanceof THREE.WebGLRenderTargetCube?(h=m,l.activeTexture(l.TEXTURE0+k),l.bindTexture(l.TEXTURE_CUBE_MAP,h.__webglTexture)):A.setTexture(m,k)}else if(n==="tv"){if(!h._array){h._array=[];for(n=0,p=h.texture.length;n<p;n++)h._array[n]=k+n}l.uniform1iv(m,h._array);for(n=0,p=h.texture.length;n
<p;n++)(m=h.texture[n])&&A.setTexture(m,h._array[n])}if((d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&
g.cameraPosition!==null)b=a.matrixWorld.getPosition(),l.uniform3f(g.cameraPosition,b.x,b.y,b.z);(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&g.viewMatrix!==null&&l.uniformMatrix4fv(g.viewMatrix,!1,a._viewMatrixArray);d.skinning&&l.uniformMatrix4fv(g.boneGlobalMatrices,!1,f.boneMatrices)}l.uniformMatrix4fv(g.modelViewMatrix,!1,f._modelViewMatrixArray);g.normalMatrix&&l.uniformMatrix3fv(g.normalMatrix,!1,f._normalMatrixArray);
(
d instanceof THREE.ShaderMaterial||d.envMap||d.skinning||f.receiveShadow)&&g.objectMatrix!==null&&l.uniformMatrix4fv(g.objectMatrix,!1,f._objectMatrixArray);return e}function p(a,b){a._modelViewMatrix.multiplyToArray(b.matrixWorldInverse,a.matrixWorld,a._modelViewMatrixArray);var c=THREE.Matrix4.makeInvert3x3(a._modelViewMatrix);c&&c.transposeIntoArray(a._normalMatrixArray)}function r(a,b,c){$!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),$=a);if(a&&(oa!==b||ga!==c))l.polygonOffset(b,
c),oa=b,ga=c}function t(a,b){var c;a==="fragment"?c=l.createShader(l.FRAGMENT_SHADER):a==="vertex"&&(c=l.createShader(l.VERTEX_SHADER));l.shaderSource(c,b);l.compileShader(c);return!l.getShaderParameter(c,l.COMPILE_STATUS)?(console.error(l.getShaderInfoLog(c)),console.error(b),null):c}function v(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,y(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,y(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,y(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,y(b.minFilter))):
(
l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_MAG_FILTER,w(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,w(b.minFilter)))}function u(a,b){l.bindRenderbuffer(l.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,
l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function w(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return l.NEAREST;default:return l.LINEAR}}function y(a){switch(a){case THREE.RepeatWrapping:return l.REPEAT;case THREE.ClampToEdgeWrapping:return l.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return l.MIRRORED_REPEAT;
case THREE.NearestFilter:return l.NEAREST;case THREE.NearestMipMapNearestFilter:return l.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return l.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return l.LINEAR;case THREE.LinearMipMapNearestFilter:return l.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return l.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return l.BYTE;case THREE.UnsignedByteType:return l.UNSIGNED_BYTE;case THREE.ShortType:return l.SHORT;case THREE.UnsignedShortType:return l.UNSIGNED_SHORT;
case THREE.IntType:return l.INT;case THREE.UnsignedIntType:return l.UNSIGNED_INT;case THREE.FloatType:return l.FLOAT;case THREE.AlphaFormat:return l.ALPHA;case THREE.RGBFormat:return l.RGB;case THREE.RGBAFormat:return l.RGBA;case THREE.LuminanceFormat:return l.LUMINANCE;case THREE.LuminanceAlphaFormat:return l.LUMINANCE_ALPHA}return 0}var a=a||{},F=a.canvas!==void 0?a.canvas:document.createElement("canvas"),D=a.precision!==void 0?a.precision:"mediump",G=a.alpha!==void 0?a.alpha:!0,I=a.premultipliedAlpha!==
void 0?a.premultipliedAlpha:!0,K=a.antialias!==void 0?a.antialias:!1,Q=a.stencil!==void 0?a.stencil:!0,N=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,B=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),O=a.clearAlpha!==void 0?a.clearAlpha:0,S=a.maxLights!==void 0?a.maxLights:4;this.domElement=F;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 A=this,l,V=[],E=null,z=null,T=-1,W=null,M=null,ma=0,aa=null,Z=null,X=null,U=null,Y=null,
$
=null,oa=null,ga=null,ra=null,qa=0,ha=0,ka=0,Ea=0,Aa=0,ya=0,xa=new THREE.Frustum,za=new THREE.Matrix4,wa=new THREE.Vector4,sa=new THREE.Vector3,na={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}};l=function(){var a;try{if(!(a=F.getContext("experimental-webgl",{alpha:G,premultipliedAlpha:I,antialias:K,stencil:Q,preserveDrawingBuffer:N})))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}();l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.clearColor(B.r,B.g,B.b,O);this.context=l;var ja=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS);
l.getParameter(l.MAX_TEXTURE_SIZE);var ta=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE);this.getContext=function(){return l};this.supportsVertexTextures=function(){return ja>0};this.setSize=function(a,b){F.width=a;F.height=b;this.setViewport(0,0,F.width,F.height)};this.setViewport=function(a,b,c,d){qa=a;ha=b;ka=c;Ea=d;l.viewport(qa,ha,ka,Ea)};this.setScissor=function(a,b,c,d){l.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.setClearColorHex=
function(a,b){B.setHex(a);O=b;l.clearColor(B.r,B.g,B.b,O)};this.setClearColor=function(a,b){B.copy(a);O=b;l.clearColor(B.r,B.g,B.b,O)};this.getClearColor=function(){return B};this.getClearAlpha=function(){return O};this.clear=function(a,b,c){var d=0;if(a===void 0||a)d|=l.COLOR_BUFFER_BIT;if(b===void 0||b)d|=l.DEPTH_BUFFER_BIT;if(c===void 0||c)d|=l.STENCIL_BUFFER_BIT;l.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];l.deleteBuffer(c.__webglVertexBuffer);l.deleteBuffer(c.__webglNormalBuffer);l.deleteBuffer(c.__webglTangentBuffer);
l.deleteBuffer(c.__webglColorBuffer);l.deleteBuffer(c.__webglUVBuffer);l.deleteBuffer(c.__webglUV2Buffer);l.deleteBuffer(c.__webglSkinVertexABuffer);l.deleteBuffer(c.__webglSkinVertexBBuffer);l.deleteBuffer(c.__webglSkinIndicesBuffer);l.deleteBuffer(c.__webglSkinWeightsBuffer);l.deleteBuffer(c.__webglFaceBuffer);l.deleteBuffer(c.__webglLineBuffer);var d=void 0,f=void 0;if(c.numMorphTargets)for(d=0,f=c.numMorphTargets;d<f;d++)l.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(c.numMorphNormals)for(d=
0,f=c.numMorphNormals;d<f;d++)l.deleteBuffer(c.__webglMorphNormalsBuffers[d]);if(c.__webglCustomAttributesList)for(d in d=void 0,c.__webglCustomAttributesList)l.deleteBuffer(c.__webglCustomAttributesList[d].buffer);A.info.memory.geometries--}else if(a instanceof THREE.Ribbon)a=a.geometry,l.deleteBuffer(a.__webglVertexBuffer),l.deleteBuffer(a.__webglColorBuffer),A.info.memory.geometries--;else if(a instanceof THREE.Line)a=a.geometry,l.deleteBuffer(a.__webglVertexBuffer),l.deleteBuffer(a.__webglColorBuffer),
A.info.memory.geometries--;else if(a instanceof THREE.ParticleSystem)a=a.geometry,l.deleteBuffer(a.__webglVertexBuffer),l.deleteBuffer(a.__webglColorBuffer),A.info.memory.geometries--};this.deallocateTexture=function(a){if(a.__webglInit)a.__webglInit=!1,l.deleteTexture(a.__webglTexture),A.info.memory.textures--};this.updateShadowMap=function(a,b){E=null;T=W=Y=U=X=-1;this.shadowMapPlugin.update(a,b)};this.renderBufferImmediate=function(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=l.createBuffer();
if(!a.__webglNormalBuffer)a.__webglNormalBuffer=l.createBuffer();a.hasPos&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,a.positionArray,l.DYNAMIC_DRAW),l.enableVertexAttribArray(b.attributes.position),l.vertexAttribPointer(b.attributes.position,3,l.FLOAT,!1,0,0));if(a.hasNormal){l.bindBuffer(l.ARRAY_BUFFER,a.__webglNormalBuffer);if(c===THREE.FlatShading){var d,f,e,g,h,i,j,k,m,n,q=a.count*3;for(n=0;n<q;n+=9)c=a.normalArray,d=c[n],f=c[n+1],e=c[n+2],g=c[n+3],i=c[n+
4],k=c[n+5],h=c[n+6],j=c[n+7],m=c[n+8],d=(d+g+h)/3,f=(f+i+j)/3,e=(e+k+m)/3,c[n]=d,c[n+1]=f,c[n+2]=e,c[n+3]=d,c[n+4]=f,c[n+5]=e,c[n+6]=d,c[n+7]=f,c[n+8]=e}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);l.enableVertexAttribArray(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}l.drawArrays(l.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,f,e){if(d.opacity!==0&&(c=m(a,b,c,d,e),a=c.attributes,b=!1,d=f.id*16777215+c.id*2+(d.wireframe?
1:0),d!==W&&(W=d,b=!0),e instanceof THREE.Mesh)){e=f.offsets;d=0;for(c=e.length;d
<c;++d)b&&(l.bindBuffer(l.ARRAY_BUFFER,f.vertexPositionBuffer),l.vertexAttribPointer(a.position,f.vertexPositionBuffer.itemSize,l.FLOAT,!1,0,e[d].index*12),a.normal>=0&&f.vertexNormalBuffer&&(l.bindBuffer(l.ARRAY_BUFFER,f.vertexNormalBuffer),l.vertexAttribPointer(a.normal,f.vertexNormalBuffer.itemSize,l.FLOAT,!1,0,e[d].index*12)),a.uv>=0&&f.vertexUvBuffer&&(f.vertexUvBuffer?(l.bindBuffer(l.ARRAY_BUFFER,f.vertexUvBuffer),
l.vertexAttribPointer(a.uv,f.vertexUvBuffer.itemSize,l.FLOAT,!1,0,e[d].index*8),l.enableVertexAttribArray(a.uv)):l.disableVertexAttribArray(a.uv)),a.color>=0&&f.vertexColorBuffer&&(l.bindBuffer(l.ARRAY_BUFFER,f.vertexColorBuffer),l.vertexAttribPointer(a.color,f.vertexColorBuffer.itemSize,l.FLOAT,!1,0,e[d].index*16)),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,f.vertexIndexBuffer)),l.drawElements(l.TRIANGLES,e[d].count,l.UNSIGNED_SHORT,e[d].start*2),A.info.render.calls++,A.info.render.vertices+=e[d].count,
A.info.render.faces+=e[d].count/3}};this.renderBuffer=function(a,b,c,d,f,e){if(d.opacity!==0){var g,h,c=m(a,b,c,d,e),b=c.attributes,a=!1,c=f.id*16777215+c.id*2+(d.wireframe?1:0);c!==W&&(W=c,a=!0);if(!d.morphTargets&&b.position>=0)a&&(l.bindBuffer(l.ARRAY_BUFFER,f.__webglVertexBuffer),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(e.morphTargetBase){c=d.program.attributes;e.morphTargetBase!==-1?(l.bindBuffer(l.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[e.morphTargetBase]),l.vertexAttribPointer(c.position,
3,l.FLOAT,!1,0,0)):c.position>=0&&(l.bindBuffer(l.ARRAY_BUFFER,f.__webglVertexBuffer),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(e.morphTargetForcedOrder.length){g=0;var i=e.morphTargetForcedOrder;for(h=e.morphTargetInfluences;g<d.numSupportedMorphTargets&&g<i.length;)l.bindBuffer(l.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[i[g]]),l.vertexAttribPointer(c["morphTarget"+g],3,l.FLOAT,!1,0,0),d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,f.__webglMorphNormalsBuffers[i[g]]),l.vertexAttribPointer(c["morphNormal"+
g],3,l.FLOAT,!1,0,0)),e.__webglMorphTargetInfluences[g]=h[i[g]],g++}else{var i=[],j=-1,k=0;h=e.morphTargetInfluences;var n,q=h.length;g=0;for(e.morphTargetBase!==-1&&(i[e.morphTargetBase]=!0);g<d.numSupportedMorphTargets;){for(n=0;n
<q;n++)!i[n]&&h[n]>j&&(k=n,j=h[k]);l.bindBuffer(l.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[k]);l.vertexAttribPointer(c["morphTarget"+g],3,l.FLOAT,!1,0,0);d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,f.__webglMorphNormalsBuffers[k]),l.vertexAttribPointer(c["morphNormal"+
g],3,l.FLOAT,!1,0,0));e.__webglMorphTargetInfluences[g]=j;i[k]=1;j=-1;g++}}d.program.uniforms.morphTargetInfluences!==null&&l.uniform1fv(d.program.uniforms.morphTargetInfluences,e.__webglMorphTargetInfluences)}if(a){if(f.__webglCustomAttributesList)for(g=0,h=f.__webglCustomAttributesList.length;g
<h;g++)c=f.__webglCustomAttributesList[g],b[c.buffer.belongsToAttribute]>=0&&(l.bindBuffer(l.ARRAY_BUFFER,c.buffer),l.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,l.FLOAT,!1,0,0));b.color>=0&&
(l.bindBuffer(l.ARRAY_BUFFER,f.__webglColorBuffer),l.vertexAttribPointer(b.color,3,l.FLOAT,!1,0,0));b.normal>=0&&(l.bindBuffer(l.ARRAY_BUFFER,f.__webglNormalBuffer),l.vertexAttribPointer(b.normal,3,l.FLOAT,!1,0,0));b.tangent>=0&&(l.bindBuffer(l.ARRAY_BUFFER,f.__webglTangentBuffer),l.vertexAttribPointer(b.tangent,4,l.FLOAT,!1,0,0));b.uv>=0&&(f.__webglUVBuffer?(l.bindBuffer(l.ARRAY_BUFFER,f.__webglUVBuffer),l.vertexAttribPointer(b.uv,2,l.FLOAT,!1,0,0),l.enableVertexAttribArray(b.uv)):l.disableVertexAttribArray(b.uv));
b.uv2>=0&&(f.__webglUV2Buffer?(l.bindBuffer(l.ARRAY_BUFFER,f.__webglUV2Buffer),l.vertexAttribPointer(b.uv2,2,l.FLOAT,!1,0,0),l.enableVertexAttribArray(b.uv2)):l.disableVertexAttribArray(b.uv2));d.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(l.bindBuffer(l.ARRAY_BUFFER,f.__webglSkinVertexABuffer),l.vertexAttribPointer(b.skinVertexA,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),l.vertexAttribPointer(b.skinVertexB,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,
f.__webglSkinIndicesBuffer),l.vertexAttribPointer(b.skinIndex,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0))}e instanceof THREE.Mesh?(d.wireframe?(d=d.wireframeLinewidth,d!==ra&&(l.lineWidth(d),ra=d),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),l.drawElements(l.LINES,f.__webglLineCount,l.UNSIGNED_SHORT,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),l.drawElements(l.TRIANGLES,f.__webglFaceCount,
l.UNSIGNED_SHORT,0)),A.info.render.calls++,A.info.render.vertices+=f.__webglFaceCount,A.info.render.faces+=f.__webglFaceCount/3):e instanceof THREE.Line?(e=e.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,d=d.linewidth,d!==ra&&(l.lineWidth(d),ra=d),l.drawArrays(e,0,f.__webglLineCount),A.info.render.calls++):e instanceof THREE.ParticleSystem?(l.drawArrays(l.POINTS,0,f.__webglParticleCount),A.info.render.calls++,A.info.render.points+=f.__webglParticleCount):e instanceof THREE.Ribbon&&(l.drawArrays(l.TRIANGLE_STRIP,
0,f.__webglVertexCount),A.info.render.calls++)}};this.render=function(a,b,c,d){var f,g,k,n,m=a.__lights,q=a.fog;T=-1;this.autoUpdateObjects&&this.initWebGLObjects(a);b.parent===void 0&&(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);A.info.render.calls=0;A.info.render.vertices=0;A.info.render.faces=0;A.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);za.multiply(b.projectionMatrix,b.matrixWorldInverse);xa.setFromMatrix(za);this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);n=a.__webglObjects;for(d=0,f=n.length;d
<f;d++)if(g=n[d],k=g.object,g.render=!1,k.visible&&(!(k instanceof
THREE.Mesh||k instanceof THREE.ParticleSystem)||!k.frustumCulled||xa.contains(k))){k.matrixWorld.flattenToArray(k._objectMatrixArray);p(k,b);var o=g,s=o.object,t=o.buffer,z=void 0,z=z=void 0,z=s.material;if(z instanceof THREE.MeshFaceMaterial){if(z=t.materialIndex,z>=0)z=s.geometry.materials[z],z.transparent?(o.transparent=z,o.opaque=null):(o.opaque=z,o.transparent=null)}else if(z)z.transparent?(o.transparent=z,o.opaque=null):(o.opaque=z,o.transparent=null);g.render=!0;if(this.sortObjects)k.renderDepth?
g.z=k.renderDepth:(wa.copy(k.position),za.multiplyVector3(wa),g.z=wa.z)}this.sortObjects&&n.sort(e);n=a.__webglObjectsImmediate;for(d=0,f=n.length;d<f;d++)if(g=n[d],k=g.object,k.visible)k.matrixAutoUpdate&&k.matrixWorld.flattenToArray(k._objectMatrixArray),p(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),
r(a.overrideMaterial.polygonOffset,a.overrideMaterial.polygonOffsetFactor,a.overrideMaterial.polygonOffsetUnits),i(a.__webglObjects,!1,"",b,m,q,!0,a.overrideMaterial),j(a.__webglObjectsImmediate,"",b,m,q,!1,a.overrideMaterial)):(this.setBlending(THREE.NormalBlending),i(a.__webglObjects,!0,"opaque",b,m,q,!1),j(a.__webglObjectsImmediate,"opaque",b,m,q,!1),i(a.__webglObjects,!1,"transparent",b,m,q,!0),j(a.__webglObjectsImmediate,"transparent",b,m,q,!0));h(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&
c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,c.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,c.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)};this.renderImmediateObject=function(a,b,c,d,f){var e=m(a,b,c,d,f);W=-1;A.setObjectFaces(f);f.immediateRenderCallback?
f.immediateRenderCallback(e,l,xa):f.render(function(a){A.renderBufferImmediate(a,e,d.shading)})};this.initWebGLObjects=function(a){if(!a.__webglObjects)a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[];for(;a.__objectsAdded.length;){var e=a.__objectsAdded[0],h=a,i=void 0,j=void 0,m=void 0;if(!e.__webglInit)if(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrixArray=new Float32Array(9),e._modelViewMatrixArray=new Float32Array(16),e._objectMatrixArray=
new Float32Array(16),e.matrixWorld.flattenToArray(e._objectMatrixArray),e instanceof THREE.Mesh){if(j=e.geometry,j instanceof THREE.Geometry){if(j.geometryGroups===void 0){var m=j,p=void 0,r=void 0,t=void 0,z=void 0,C=void 0,u=void 0,w=void 0,v={},D=m.morphTargets.length,E=m.morphNormals.length;m.geometryGroups={};for(p=0,r=m.faces.length;p
<r;p++)t=m.faces[p],z=t.materialIndex,u=z!==void 0?z:-1,v[u]===void 0&&(v[u]={hash:u,counter:0}),w=v[u].hash+"_"+v[u].counter,m.geometryGroups[w]===void 0&&(m.geometryGroups[w]=
{faces3:[],faces4:[],materialIndex:z,vertices:0,numMorphTargets:D,numMorphNormals:E}),C=t instanceof THREE.Face3?3:4,m.geometryGroups[w].vertices+C>65535&&(v[u].counter+=1,w=v[u].hash+"_"+v[u].counter,m.geometryGroups[w]===void 0&&(m.geometryGroups[w]={faces3:[],faces4:[],materialIndex:z,vertices:0,numMorphTargets:D,numMorphNormals:E})),t instanceof THREE.Face3?m.geometryGroups[w].faces3.push(p):m.geometryGroups[w].faces4.push(p),m.geometryGroups[w].vertices+=C;m.geometryGroupsList=[];p=void 0;for(p in m.geometryGroups)m.geometryGroups[p].id=
ma++,m.geometryGroupsList.push(m.geometryGroups[p])}for(i in j.geometryGroups)if(m=j.geometryGroups[i],!m.__webglVertexBuffer){p=m;p.__webglVertexBuffer=l.createBuffer();p.__webglNormalBuffer=l.createBuffer();p.__webglTangentBuffer=l.createBuffer();p.__webglColorBuffer=l.createBuffer();p.__webglUVBuffer=l.createBuffer();p.__webglUV2Buffer=l.createBuffer();p.__webglSkinVertexABuffer=l.createBuffer();p.__webglSkinVertexBBuffer=l.createBuffer();p.__webglSkinIndicesBuffer=l.createBuffer();p.__webglSkinWeightsBuffer=
l.createBuffer();p.__webglFaceBuffer=l.createBuffer();p.__webglLineBuffer=l.createBuffer();t=r=void 0;if(p.numMorphTargets){p.__webglMorphTargetsBuffers=[];for(r=0,t=p.numMorphTargets;r<t;r++)p.__webglMorphTargetsBuffers.push(l.createBuffer())}if(p.numMorphNormals){p.__webglMorphNormalsBuffers=[];for(r=0,t=p.numMorphNormals;r
<t;r++)p.__webglMorphNormalsBuffers.push(l.createBuffer())}A.info.memory.geometries++;z=e;C=z.geometry;r=m.faces3;u=m.faces4;p=r.length*3+u.length*4;t=r.length*1+u.length*2;u=
r.length*3+u.length*4;r=c(z,m);w=f(r);v=d(r);D=r.vertexColors?r.vertexColors:!1;m.__vertexArray=new Float32Array(p*3);if(v)m.__normalArray=new Float32Array(p*3);if(C.hasTangents)m.__tangentArray=new Float32Array(p*4);if(D)m.__colorArray=new Float32Array(p*3);if(w){if(C.faceUvs.length>0||C.faceVertexUvs.length>0)m.__uvArray=new Float32Array(p*2);if(C.faceUvs.length>1||C.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(p*2)}if(z.geometry.skinWeights.length&&z.geometry.skinIndices.length)m.__skinVertexAArray=
new Float32Array(p*4),m.__skinVertexBArray=new Float32Array(p*4),m.__skinIndexArray=new Float32Array(p*4),m.__skinWeightArray=new Float32Array(p*4);m.__faceArray=new Uint16Array(t*3);m.__lineArray=new Uint16Array(u*2);C=z=void 0;if(m.numMorphTargets){m.__morphTargetsArrays=[];for(z=0,C=m.numMorphTargets;z<C;z++)m.__morphTargetsArrays.push(new Float32Array(p*3))}if(m.numMorphNormals){m.__morphNormalsArrays=[];for(z=0,C=m.numMorphNormals;z<C;z++)m.__morphNormalsArrays.push(new Float32Array(p*3))}m.__webglFaceCount=
t*3;m.__webglLineCount=u*2;if(r.attributes){if(m.__webglCustomAttributesList===void 0)m.__webglCustomAttributesList=[];t=void 0;for(t in r.attributes){var z=r.attributes[t],C={},y;for(y in z)C[y]=z[y];if(!C.__webglInitialized||C.createUniqueBuffers)C.__webglInitialized=!0,u=1,C.type==="v2"?u=2:C.type==="v3"?u=3:C.type==="v4"?u=4:C.type==="c"&&(u=3),C.size=u,C.array=new Float32Array(p*u),C.buffer=l.createBuffer(),C.buffer.belongsToAttribute=t,z.needsUpdate=!0,C.__original=z;m.__webglCustomAttributesList.push(C)}}m.__inittedArrays=
!0;j.__dirtyVertices=!0;j.__dirtyMorphTargets=!0;j.__dirtyElements=!0;j.__dirtyUvs=!0;j.__dirtyNormals=!0;j.__dirtyTangents=!0;j.__dirtyColors=!0}}}else if(e instanceof THREE.Ribbon){if(j=e.geometry,!j.__webglVertexBuffer)m=j,m.__webglVertexBuffer=l.createBuffer(),m.__webglColorBuffer=l.createBuffer(),A.info.memory.geometries++,m=j,p=m.vertices.length,m.__vertexArray=new Float32Array(p*3),m.__colorArray=new Float32Array(p*3),m.__webglVertexCount=p,j.__dirtyVertices=!0,j.__dirtyColors=!0}else if(e instanceof
THREE.Line){if(j=e.geometry,!j.__webglVertexBuffer)m=j,m.__webglVertexBuffer=l.createBuffer(),m.__webglColorBuffer=l.createBuffer(),A.info.memory.geometries++,m=j,p=e,r=m.vertices.length,m.__vertexArray=new Float32Array(r*3),m.__colorArray=new Float32Array(r*3),m.__webglLineCount=r,b(m,p),j.__dirtyVertices=!0,j.__dirtyColors=!0}else if(e instanceof THREE.ParticleSystem&&(j=e.geometry,!j.__webglVertexBuffer))m=j,m.__webglVertexBuffer=l.createBuffer(),m.__webglColorBuffer=l.createBuffer(),A.info.geometries++,
m=j,p=e,r=m.vertices.length,m.__vertexArray=new Float32Array(r*3),m.__colorArray=new Float32Array(r*3),m.__sortArray=[],m.__webglParticleCount=r,b(m,p),j.__dirtyVertices=!0,j.__dirtyColors=!0;if(!e.__webglActive){if(e instanceof THREE.Mesh)if(j=e.geometry,j instanceof THREE.BufferGeometry)k(h.__webglObjects,j,e);else for(i in j.geometryGroups)m=j.geometryGroups[i],k(h.__webglObjects,m,e);else e instanceof THREE.Ribbon||e instanceof THREE.Line||e instanceof THREE.ParticleSystem?(j=e.geometry,k(h.__webglObjects,
j,e)):THREE.MarchingCubes!==void 0&&e instanceof THREE.MarchingCubes||e.immediateRenderCallback?h.__webglObjectsImmediate.push({object:e,opaque:null,transparent:null}):e instanceof THREE.Sprite?h.__webglSprites.push(e):e instanceof THREE.LensFlare&&h.__webglFlares.push(e);e.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;)e=a.__objectsRemoved[0],h=a,e instanceof THREE.Mesh||e instanceof THREE.ParticleSystem||e instanceof THREE.Ribbon||e instanceof THREE.Line?o(h.__webglObjects,
e):e instanceof THREE.Sprite?s(h.__webglSprites,e):e instanceof THREE.LensFlare?s(h.__webglFlares,e):(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&o(h.__webglObjectsImmediate,e),e.__webglActive=!1,a.__objectsRemoved.splice(0,1);e=0;for(h=a.__webglObjects.length;e<h;e++)if(y=a.__webglObjects[e].object,i=y.geometry,j=t=r=void 0,y instanceof THREE.Mesh)if(i instanceof THREE.BufferGeometry)i.__dirtyVertices=!1,i.__dirtyElements=!1,i.__dirtyUvs=!1,i.__dirtyNormals=!1,i.__dirtyColors=!1;
else{m=0;for(p=i.geometryGroupsList.length;m<p;m++)if(r=i.geometryGroupsList[m],j=c(y,r),t=j.attributes&&q(j),i.__dirtyVertices||i.__dirtyMorphTargets||i.__dirtyElements||i.__dirtyUvs||i.__dirtyNormals||i.__dirtyColors||i.__dirtyTangents||t){var T=y,t=l.DYNAMIC_DRAW,z=!i.dynamic,v=j;if(r.__inittedArrays){var D=d(v),E=v.vertexColors?v.vertexColors:!1,W=f(v),G=D===THREE.SmoothShading,F=u=C=void 0,J=void 0,I=void 0,Z=void 0,L=void 0,K=void 0,S=void 0,O=F=void 0,P=void 0,M=void 0,B=void 0,N=J=void 0,
aa=void 0,Q=void 0,U=B=M=P=J=S=void 0,X=void 0,Y=void 0,$=L=void 0,V=void 0,ca=J=P=V=$=M=P=V=$=M=P=V=$=M=P=void 0,ga=void 0,oa=Z=void 0,ka=void 0,ia=void 0,ra=void 0,ha=void 0,la=void 0,B=la=void 0,qa=O=ia=ga=0,na=0,ja=ca.........完整代码请登录后点击上方下载按钮下载查看

网友评论0