From 3ce8fbb3b6ca1aa8e271d05b0bad5ab515f03b46 Mon Sep 17 00:00:00 2001 From: alteredq Date: Wed, 12 Oct 2011 03:31:37 +0200 Subject: [PATCH 01/33] Started to explore physically based shading / linear color space. Do not merge, this is very experimental, not sure about correctness, also tons of unsolved things. --- build/Three.js | 763 ++++++++++++++------------- build/custom/ThreeCanvas.js | 6 +- build/custom/ThreeDOM.js | 6 +- build/custom/ThreeSVG.js | 6 +- build/custom/ThreeWebGL.js | 292 +++++----- examples/webgl_shading_physical.html | 521 ++++++++++++++++++ src/core/Color.js | 22 +- src/renderers/WebGLRenderer.js | 116 +++- src/renderers/WebGLShaders.js | 126 ++++- 9 files changed, 1296 insertions(+), 562 deletions(-) create mode 100644 examples/webgl_shading_physical.html diff --git a/build/Three.js b/build/Three.js index 475c9432..832e058f 100644 --- a/build/Three.js +++ b/build/Three.js @@ -1,8 +1,8 @@ // Three.js r46dev - http://github.com/mrdoob/three.js var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this}; -THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var f,h,k;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),h=b*6-f,b=e*(1-c),k=e*(1-c*h),c=e*(1-c*(1-h)),f){case 1:this.r=k;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=k;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r= -e;this.g=b;this.b=k;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}}; -THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0}; +THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},copyGammaToLinear:function(b){this.r=b.r*b.r;this.g=b.g*b.g;this.b=b.b*b.b;return this},copyLinearToGamma:function(b){this.r=Math.sqrt(b.r);this.g=Math.sqrt(b.g);this.b=Math.sqrt(b.b);return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var f,h,k;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),h=b*6-f,b=e*(1-c),k=e*(1- +c*h),c=e*(1-c*(1-h)),f){case 1:this.r=k;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=k;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=e;this.g=b;this.b=k;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ +Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this}, divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var c=this.x-b.x,b=this.y-b.y;return c*c+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)}, equals:function(b){return b.x==this.x&&b.y==this.y}};THREE.Vector3=function(b,c,e){this.x=b||0;this.y=c||0;this.z=e||0}; @@ -16,37 +16,37 @@ c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,f=[];c=0;for(e=b.length;c0&&b>0&&k+b<1}for(var f,h=[],k=0,m=b.children.length;kb.scale.x)return[];f={distance:k,point:b.position,face:null,object:b};h.push(f)}else if(b instanceof THREE.Mesh){k=c(this.origin, -this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,t,u,w,o,x,v,z,y=b.geometry,A=y.vertices,k=0,m=y.faces.length;k0:x<0)))if(x=o.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(z.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,t,u)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,t,w)||e(v,t,u,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; +this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,u,t,w,o,x,v,z,A=b.geometry,y=A.vertices,k=0,m=A.faces.length;k0:x<0)))if(x=o.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(z.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,u,t)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,u,w)||e(v,u,t,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,o){n=!1;c=k;e=m;f=w;h=o;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=ck?f:k,h=h>m?h:m);b()};this.add3Points= function(k,m,w,o,x,v){n?(n=!1,c=kw?k>x?k:x:w>x?w:x,h=m>o?m>v?m:v:o>v?o:v):(c=kw?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>o?m>v?m>h?m:h:v>h?v:h:o>v?o>h?o:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=ck.getRight()?f:k.getRight(),h=h> k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}};THREE.Matrix3=function(){this.m=[]}; THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}}; -THREE.Matrix4=function(b,c,e,f,h,k,m,n,t,u,w,o,x,v,z,y){this.set(b!==void 0?b:1,c||0,e||0,f||0,h||0,k!==void 0?k:1,m||0,n||0,t||0,u||0,w!==void 0?w:1,o||0,x||0,v||0,z||0,y!==void 0?y:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,h,k,m,n,t,u,w,o,x,v,z,y){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=h;this.n22=k;this.n23=m;this.n24=n;this.n31=t;this.n32=u;this.n33=w;this.n34=o;this.n41=x;this.n42=v;this.n43=z;this.n44=y;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b, +THREE.Matrix4=function(b,c,e,f,h,k,m,n,u,t,w,o,x,v,z,A){this.set(b!==void 0?b:1,c||0,e||0,f||0,h||0,k!==void 0?k:1,m||0,n||0,u||0,t||0,w!==void 0?w:1,o||0,x||0,v||0,z||0,A!==void 0?A:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,h,k,m,n,u,t,w,o,x,v,z,A){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=h;this.n22=k;this.n23=m;this.n24=n;this.n31=u;this.n32=t;this.n33=w;this.n34=o;this.n41=x;this.n42=v;this.n43=z;this.n44=A;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b, c,e){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,k=THREE.Matrix4.__v3;k.sub(b,c).normalize();if(k.length()===0)k.z=1;f.cross(e,k).normalize();f.length()===0&&(k.x+=1.0E-4,f.cross(e,k).normalize());h.cross(k,f).normalize();this.n11=f.x;this.n12=h.x;this.n13=k.x;this.n21=f.y;this.n22=h.y;this.n23=k.y;this.n31=f.z;this.n32=h.z;this.n33=k.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,f=b.z,h=1/(this.n41*c+this.n42*e+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*e+this.n13*f+this.n14)*h; b.y=(this.n21*c+this.n22*e+this.n23*f+this.n24)*h;b.z=(this.n31*c+this.n32*e+this.n33*f+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,e=b.y,f=b.z,h=b.w;b.x=this.n11*c+this.n12*e+this.n13*f+this.n14*h;b.y=this.n21*c+this.n22*e+this.n23*f+this.n24*h;b.z=this.n31*c+this.n32*e+this.n33*f+this.n34*h;b.w=this.n41*c+this.n42*e+this.n43*f+this.n44*h;return b},rotateAxis:function(b){var c=b.x,e=b.y,f=b.z;b.x=c*this.n11+e*this.n12+f*this.n13;b.y=c*this.n21+e*this.n22+f*this.n23;b.z=c*this.n31+ -e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,t=b.n23,u=b.n24,w=b.n31,o=b.n32,x=b.n33,v=b.n34,z=b.n41,y=b.n42,A=b.n43,E=b.n44,F=c.n11,C=c.n12, -G=c.n13,J=c.n14,O=c.n21,K=c.n22,B=c.n23,N=c.n24,Y=c.n31,H=c.n32,T=c.n33,Q=c.n34,Z=c.n41,$=c.n42,S=c.n43,p=c.n44;this.n11=e*F+f*O+h*Y+k*Z;this.n12=e*C+f*K+h*H+k*$;this.n13=e*G+f*B+h*T+k*S;this.n14=e*J+f*N+h*Q+k*p;this.n21=m*F+n*O+t*Y+u*Z;this.n22=m*C+n*K+t*H+u*$;this.n23=m*G+n*B+t*T+u*S;this.n24=m*J+n*N+t*Q+u*p;this.n31=w*F+o*O+x*Y+v*Z;this.n32=w*C+o*K+x*H+v*$;this.n33=w*G+o*B+x*T+v*S;this.n34=w*J+o*N+x*Q+v*p;this.n41=z*F+y*O+A*Y+E*Z;this.n42=z*C+y*K+A*H+E*$;this.n43=z*G+y*B+A*T+E*S;this.n44=z*J+y* -N+A*Q+E*p;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=b;this.n31*= -b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,h=this.n21,k=this.n22,m=this.n23,n=this.n24,t=this.n31,u=this.n32,w=this.n33,o=this.n34,x=this.n41,v=this.n42,z=this.n43,y=this.n44;return f*m*u*x-e*n*u*x-f*k*w*x+c*n*w*x+e*k*o*x-c*m*o*x-f*m*t*v+e*n*t*v+f*h*w*v-b*n*w*v-e*h*o*v+b*m*o*v+f*k*t*z-c*n*t*z-f*h*u*z+b*n*u*z+c*h*o*z-b*k*o*z-e*k*t*y+c*m*t*y+e*h*u*y-b*m*u*y-c*h*w*y+b*k*w*y}, +e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,u=b.n23,t=b.n24,w=b.n31,o=b.n32,x=b.n33,v=b.n34,z=b.n41,A=b.n42,y=b.n43,E=b.n44,F=c.n11,C=c.n12, +G=c.n13,J=c.n14,M=c.n21,K=c.n22,B=c.n23,L=c.n24,Y=c.n31,H=c.n32,T=c.n33,Q=c.n34,Z=c.n41,$=c.n42,P=c.n43,p=c.n44;this.n11=e*F+f*M+h*Y+k*Z;this.n12=e*C+f*K+h*H+k*$;this.n13=e*G+f*B+h*T+k*P;this.n14=e*J+f*L+h*Q+k*p;this.n21=m*F+n*M+u*Y+t*Z;this.n22=m*C+n*K+u*H+t*$;this.n23=m*G+n*B+u*T+t*P;this.n24=m*J+n*L+u*Q+t*p;this.n31=w*F+o*M+x*Y+v*Z;this.n32=w*C+o*K+x*H+v*$;this.n33=w*G+o*B+x*T+v*P;this.n34=w*J+o*L+x*Q+v*p;this.n41=z*F+A*M+y*Y+E*Z;this.n42=z*C+A*K+y*H+E*$;this.n43=z*G+A*B+y*T+E*P;this.n44=z*J+A* +L+y*Q+E*p;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=b;this.n31*= +b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,h=this.n21,k=this.n22,m=this.n23,n=this.n24,u=this.n31,t=this.n32,w=this.n33,o=this.n34,x=this.n41,v=this.n42,z=this.n43,A=this.n44;return f*m*t*x-e*n*t*x-f*k*w*x+c*n*w*x+e*k*o*x-c*m*o*x-f*m*u*v+e*n*u*v+f*h*w*v-b*n*w*v-e*h*o*v+b*m*o*v+f*k*u*z-c*n*u*z-f*h*t*z+b*n*t*z+c*h*o*z-b*k*o*z-e*k*u*A+c*m*u*A+e*h*t*A-b*m*t*A-c*h*w*A+b*k*w*A}, transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32;b.n33=this.n33;b.n34=this.n34; b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]=this.n11; b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=this.n34; b[c+15]=this.n44;return b},setTranslation:function(b,c,e){this.set(1,0,0,b,0,1,0,c,0,0,1,e,0,0,0,1);return this},setScale:function(b,c,e){this.set(b,0,0,0,0,c,0,0,0,0,e,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,-b,0,0,b,c,0,0, -0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),f=Math.sin(c),h=1-e,k=b.x,m=b.y,n=b.z,t=h*k,u=h*m;this.set(t*k+e,t*m-f*n,t*n+f*m,0,t*m+f*n,u*m+e,u*n-f*k,0,t*n-f*m,u*n+f*k,h*n*n+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= -new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,f=b.y,h=b.z,k=Math.cos(e),e=Math.sin(e),m=Math.cos(f),f=Math.sin(f),n=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var t= -m*n,u=m*h,w=f*n,o=f*h;this.n11=t+o*e;this.n12=w*e-u;this.n13=k*f;this.n21=k*h;this.n22=k*n;this.n23=-e;this.n31=u*e-w;this.n32=o+t*e;this.n33=k*m;break;case "ZXY":t=m*n;u=m*h;w=f*n;o=f*h;this.n11=t-o*e;this.n12=-k*h;this.n13=w+u*e;this.n21=u+w*e;this.n22=k*n;this.n23=o-t*e;this.n31=-k*f;this.n32=e;this.n33=k*m;break;case "ZYX":t=k*n;u=k*h;w=e*n;o=e*h;this.n11=m*n;this.n12=w*f-u;this.n13=t*f+o;this.n21=m*h;this.n22=o*f+t;this.n23=u*f-w;this.n31=-f;this.n32=e*m;this.n33=k*m;break;case "YZX":t=k*m;u= -k*f;w=e*m;o=e*f;this.n11=m*n;this.n12=o-t*h;this.n13=w*h+u;this.n21=h;this.n22=k*n;this.n23=-e*n;this.n31=-f*n;this.n32=u*h+w;this.n33=t-o*h;break;case "XZY":t=k*m;u=k*f;w=e*m;o=e*f;this.n11=m*n;this.n12=-h;this.n13=f*n;this.n21=t*h+o;this.n22=k*n;this.n23=u*h-w;this.n31=w*h-u;this.n32=e*n;this.n33=o*h+t;break;default:t=k*n,u=k*h,w=e*n,o=e*h,this.n11=m*n,this.n12=-m*h,this.n13=f,this.n21=u+w*f,this.n22=t-o*f,this.n23=-e*m,this.n31=o-t*f,this.n32=w+u*f,this.n33=k*m}return this},setRotationFromQuaternion:function(b){var c= -b.x,e=b.y,f=b.z,h=b.w,k=c+c,m=e+e,n=f+f,b=c*k,t=c*m;c*=n;var u=e*m;e*=n;f*=n;k*=h;m*=h;h*=n;this.n11=1-(u+f);this.n12=t-h;this.n13=c+m;this.n21=t+h;this.n22=1-(b+f);this.n23=e-k;this.n31=c-m;this.n32=e+k;this.n33=1-(b+u);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var f=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2; +0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),f=Math.sin(c),h=1-e,k=b.x,m=b.y,n=b.z,u=h*k,t=h*m;this.set(u*k+e,u*m-f*n,u*n+f*m,0,u*m+f*n,t*m+e,t*n-f*k,0,u*n-f*m,t*n+f*k,h*n*n+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= +new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,f=b.y,h=b.z,k=Math.cos(e),e=Math.sin(e),m=Math.cos(f),f=Math.sin(f),n=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var u= +m*n,t=m*h,w=f*n,o=f*h;this.n11=u+o*e;this.n12=w*e-t;this.n13=k*f;this.n21=k*h;this.n22=k*n;this.n23=-e;this.n31=t*e-w;this.n32=o+u*e;this.n33=k*m;break;case "ZXY":u=m*n;t=m*h;w=f*n;o=f*h;this.n11=u-o*e;this.n12=-k*h;this.n13=w+t*e;this.n21=t+w*e;this.n22=k*n;this.n23=o-u*e;this.n31=-k*f;this.n32=e;this.n33=k*m;break;case "ZYX":u=k*n;t=k*h;w=e*n;o=e*h;this.n11=m*n;this.n12=w*f-t;this.n13=u*f+o;this.n21=m*h;this.n22=o*f+u;this.n23=t*f-w;this.n31=-f;this.n32=e*m;this.n33=k*m;break;case "YZX":u=k*m;t= +k*f;w=e*m;o=e*f;this.n11=m*n;this.n12=o-u*h;this.n13=w*h+t;this.n21=h;this.n22=k*n;this.n23=-e*n;this.n31=-f*n;this.n32=t*h+w;this.n33=u-o*h;break;case "XZY":u=k*m;t=k*f;w=e*m;o=e*f;this.n11=m*n;this.n12=-h;this.n13=f*n;this.n21=u*h+o;this.n22=k*n;this.n23=t*h-w;this.n31=w*h-t;this.n32=e*n;this.n33=o*h+u;break;default:u=k*n,t=k*h,w=e*n,o=e*h,this.n11=m*n,this.n12=-m*h,this.n13=f,this.n21=t+w*f,this.n22=u-o*f,this.n23=-e*m,this.n31=o-u*f,this.n32=w+t*f,this.n33=k*m}return this},setRotationFromQuaternion:function(b){var c= +b.x,e=b.y,f=b.z,h=b.w,k=c+c,m=e+e,n=f+f,b=c*k,u=c*m;c*=n;var t=e*m;e*=n;f*=n;k*=h;m*=h;h*=n;this.n11=1-(t+f);this.n12=u-h;this.n13=c+m;this.n21=u+h;this.n22=1-(b+f);this.n23=e-k;this.n31=c-m;this.n32=e+k;this.n33=1-(b+t);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var f=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2; f.identity();f.setRotationFromQuaternion(c);h.setScale(e.x,e.y,e.z);this.multiply(f,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,k=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);k.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;e=e instanceof THREE.Vector3?e:new THREE.Vector3;e.x=f.length(); e.y=h.length();e.z=k.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=e.x;f.n21/=e.x;f.n31/=e.x;f.n12/=e.y;f.n22/=e.y;f.n32/=e.y;f.n13/=e.z;f.n23/=e.z;f.n33/=e.z;c.setFromRotationMatrix(f);return[b,c,e]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var e=1/c.x,f=1/c.y,h=1/c.z;this.n11=b.n11*e;this.n21=b.n21*e;this.n31=b.n31*e;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*h;this.n23= b.n23*h;this.n33=b.n33*h}}; -THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,t=b.n23,u=b.n24,w=b.n31,o=b.n32,x=b.n33,v=b.n34,z=b.n41,y=b.n42,A=b.n43,E=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=t*v*y-u*x*y+u*o*A-n*v*A-t*o*E+n*x*E;c.n12=k*x*y-h*v*y-k*o*A+f*v*A+h*o*E-f*x*E;c.n13=h*u*y-k*t*y+k*n*A-f*u*A-h*n*E+f*t*E;c.n14=k*t*o-h*u*o-k*n*x+f*u*x+h*n*v-f*t*v;c.n21=u*x*z-t*v*z-u*w*A+m*v*A+t*w*E-m*x*E;c.n22=h*v*z-k*x*z+k*w*A-e*v*A-h*w*E+e*x*E;c.n23=k*t*z-h*u*z-k*m*A+e*u*A+h*m*E-e*t*E;c.n24= -h*u*w-k*t*w+k*m*x-e*u*x-h*m*v+e*t*v;c.n31=n*v*z-u*o*z+u*w*y-m*v*y-n*w*E+m*o*E;c.n32=k*o*z-f*v*z-k*w*y+e*v*y+f*w*E-e*o*E;c.n33=h*u*z-k*n*z+k*m*y-e*u*y-f*m*E+e*n*E;c.n34=k*n*w-f*u*w-k*m*o+e*u*o+f*m*v-e*n*v;c.n41=t*o*z-n*x*z-t*w*y+m*x*y+n*w*A-m*o*A;c.n42=f*x*z-h*o*z+h*w*y-e*x*y-f*w*A+e*o*A;c.n43=h*n*z-f*t*z-h*m*y+e*t*y+f*m*A-e*n*A;c.n44=f*t*w-h*n*w+h*m*o-e*t*o-f*m*x+e*n*x;c.multiplyScalar(1/b.determinant());return c}; -THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,f=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,k=b.n32*b.n21-b.n31*b.n22,m=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,t=-b.n32*b.n11+b.n31*b.n12,u=b.n23*b.n12-b.n22*b.n13,w=-b.n23*b.n11+b.n21*b.n13,o=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*m+b.n31*u;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*h;e[2]=b*k;e[3]=b*m;e[4]=b*n;e[5]=b*t;e[6]=b*u;e[7]=b*w;e[8]=b*o;return c}; +THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,u=b.n23,t=b.n24,w=b.n31,o=b.n32,x=b.n33,v=b.n34,z=b.n41,A=b.n42,y=b.n43,E=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=u*v*A-t*x*A+t*o*y-n*v*y-u*o*E+n*x*E;c.n12=k*x*A-h*v*A-k*o*y+f*v*y+h*o*E-f*x*E;c.n13=h*t*A-k*u*A+k*n*y-f*t*y-h*n*E+f*u*E;c.n14=k*u*o-h*t*o-k*n*x+f*t*x+h*n*v-f*u*v;c.n21=t*x*z-u*v*z-t*w*y+m*v*y+u*w*E-m*x*E;c.n22=h*v*z-k*x*z+k*w*y-e*v*y-h*w*E+e*x*E;c.n23=k*u*z-h*t*z-k*m*y+e*t*y+h*m*E-e*u*E;c.n24= +h*t*w-k*u*w+k*m*x-e*t*x-h*m*v+e*u*v;c.n31=n*v*z-t*o*z+t*w*A-m*v*A-n*w*E+m*o*E;c.n32=k*o*z-f*v*z-k*w*A+e*v*A+f*w*E-e*o*E;c.n33=h*t*z-k*n*z+k*m*A-e*t*A-f*m*E+e*n*E;c.n34=k*n*w-f*t*w-k*m*o+e*t*o+f*m*v-e*n*v;c.n41=u*o*z-n*x*z-u*w*A+m*x*A+n*w*y-m*o*y;c.n42=f*x*z-h*o*z+h*w*A-e*x*A-f*w*y+e*o*y;c.n43=h*n*z-f*u*z-h*m*A+e*u*A+f*m*y-e*n*y;c.n44=f*u*w-h*n*w+h*m*o-e*u*o-f*m*x+e*n*x;c.multiplyScalar(1/b.determinant());return c}; +THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,f=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,k=b.n32*b.n21-b.n31*b.n22,m=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,u=-b.n32*b.n11+b.n31*b.n12,t=b.n23*b.n12-b.n22*b.n13,w=-b.n23*b.n11+b.n21*b.n13,o=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*m+b.n31*t;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*h;e[2]=b*k;e[3]=b*m;e[4]=b*n;e[5]=b*u;e[6]=b*t;e[7]=b*w;e[8]=b*o;return c}; THREE.Matrix4.makeFrustum=function(b,c,e,f,h,k){var m;m=new THREE.Matrix4;m.n11=2*h/(c-b);m.n12=0;m.n13=(c+b)/(c-b);m.n14=0;m.n21=0;m.n22=2*h/(f-e);m.n23=(f+e)/(f-e);m.n24=0;m.n31=0;m.n32=0;m.n33=-(k+h)/(k-h);m.n34=-2*k*h/(k-h);m.n41=0;m.n42=0;m.n43=-1;m.n44=0;return m};THREE.Matrix4.makePerspective=function(b,c,e,f){var h,b=e*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,e,f)}; -THREE.Matrix4.makeOrtho=function(b,c,e,f,h,k){var m,n,t,u;m=new THREE.Matrix4;n=c-b;t=e-f;u=k-h;m.n11=2/n;m.n12=0;m.n13=0;m.n14=-((c+b)/n);m.n21=0;m.n22=2/t;m.n23=0;m.n24=-((e+f)/t);m.n31=0;m.n32=0;m.n33=-2/u;m.n34=-((k+h)/u);m.n41=0;m.n42=0;m.n43=0;m.n44=1;return m};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; +THREE.Matrix4.makeOrtho=function(b,c,e,f,h,k){var m,n,u,t;m=new THREE.Matrix4;n=c-b;u=e-f;t=k-h;m.n11=2/n;m.n12=0;m.n13=0;m.n14=-((c+b)/n);m.n21=0;m.n22=2/u;m.n23=0;m.n24=-((e+f)/u);m.n31=0;m.n32=0;m.n33=-2/t;m.n34=-((k+h)/t);m.n41=0;m.n42=0;m.n43=0;m.n44=1;return m};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3}; THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(b){if(this.children.indexOf(b)=== @@ -54,41 +54,41 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){thi b)return h;if(c&&(h=h.getChildByName(b,c),h!==void 0))return h}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,e){this.matrixAutoUpdate&& this.updateMatrix();if(this.matrixWorldNeedsUpdate||c)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,c=!0;for(var b=0,f=this.children.length;b=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?e=Math.max(e,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),fG&&m.positionScreen.z=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?e=Math.max(e,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),fG&&m.positionScreen.z0&&K.z<1))ia=C[F]=C[F]||new THREE.RenderableParticle,F++,E=ia,E.x=K.x/K.w,E.y=K.y/K.w,E.z=K.z,E.rotation=U.rotation.z,E.scale.x=U.scale.x*Math.abs(E.x-(K.x+k.projectionMatrix.n11)/(K.w+k.projectionMatrix.n14)),E.scale.y=U.scale.y*Math.abs(E.y-(K.y+k.projectionMatrix.n22)/(K.w+k.projectionMatrix.n24)),E.materials=U.materials,J.push(E);h&&J.sort(c);return J}}; THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,e=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),k=Math.cos(e),e=Math.sin(e),m=b*c,n=f*h;this.w=m*k-n*e;this.x=m*e+n*k;this.y=f*c*k+b*h*e;this.z=b*h*k-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e); this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z); this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c= -this.x,e=this.y,f=this.z,h=this.w,k=b.x,m=b.y,n=b.z,b=b.w;this.x=c*b+h*k+e*n-f*m;this.y=e*b+h*m+f*k-c*n;this.z=f*b+h*n+c*m-e*k;this.w=h*b-c*k-e*m-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,h=b.z,k=this.x,m=this.y,n=this.z,t=this.w,u=t*e+m*h-n*f,w=t*f+n*e-k*h,o=t*h+k*f-m*e,e=-k* -e-m*f-n*h;c.x=u*t+e*-k+w*-n-o*-m;c.y=w*t+e*-m+o*-k-u*-n;c.z=o*t+e*-n+u*-m-w*-k;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var k=Math.acos(h),m=Math.sqrt(1-h*h);if(Math.abs(m)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-f)*k)/m;f=Math.sin(f*k)/m;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e}; +this.x,e=this.y,f=this.z,h=this.w,k=b.x,m=b.y,n=b.z,b=b.w;this.x=c*b+h*k+e*n-f*m;this.y=e*b+h*m+f*k-c*n;this.z=f*b+h*n+c*m-e*k;this.w=h*b-c*k-e*m-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,h=b.z,k=this.x,m=this.y,n=this.z,u=this.w,t=u*e+m*h-n*f,w=u*f+n*e-k*h,o=u*h+k*f-m*e,e=-k* +e-m*f-n*h;c.x=t*u+e*-k+w*-n-o*-m;c.y=w*u+e*-m+o*-k-t*-n;c.z=o*u+e*-n+t*-m-w*-k;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var k=Math.acos(h),m=Math.sqrt(1-h*h);if(Math.abs(m)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-f)*k)/m;f=Math.sin(f*k)/m;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e}; THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,h,k){this.a=b;this.b=c;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=k instanceof Array?k:[k];this.centroid=new THREE.Vector3}; THREE.Face4=function(b,c,e,f,h,k,m){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=k instanceof THREE.Color?k:new THREE.Color;this.vertexColors=k instanceof Array?k:[];this.vertexTangents=[];this.materials=m instanceof Array?m:[m];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var e=0,f=this.vertices.length;e0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, +e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c]),e.vertexNormals[3].copy(f[e.d]))},computeTangents:function(){function b(b,c,e,f,k,h,B){n=b.vertices[c].position;u=b.vertices[e].position;t=b.vertices[f].position;w=m[k];o=m[h];x=m[B];v=u.x-n.x;z=t.x-n.x;A=u.y-n.y;y=t.y-n.y;E=u.z-n.z;F=t.z-n.z;C=o.u-w.u;G=x.u-w.u;J=o.v-w.v;M=x.v-w.v;K=1/(C*M-G*J);H.set((M*v-J*z)*K,(M*A-J*y)*K,(M*E-J*F)*K);T.set((C*z-G*v)*K,(C*y-G*A)*K,(C*F-G*E)*K);L[c].addSelf(H);L[e].addSelf(H);L[f].addSelf(H);Y[c].addSelf(T); +Y[e].addSelf(T);Y[f].addSelf(T)}var c,e,f,h,k,m,n,u,t,w,o,x,v,z,A,y,E,F,C,G,J,M,K,B,L=[],Y=[],H=new THREE.Vector3,T=new THREE.Vector3,Q=new THREE.Vector3,Z=new THREE.Vector3,$=new THREE.Vector3;c=0;for(e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;cthis.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;u=this.points[e[0]];w=this.points[e[1]]; -o=this.points[e[2]];x=this.points[e[3]];n=m*m;t=m*n;f.x=c(u.x,w.x,o.x,x.x,m,n,t);f.y=c(u.y,w.y,o.y,x.y,m,n,t);f.z=c(u.z,w.z,o.z,x.z,m,n,t);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;bthis.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;t=this.points[e[0]];w=this.points[e[1]]; +o=this.points[e[2]];x=this.points[e[3]];n=m*m;u=m*n;f.x=c(t.x,w.x,o.x,x.x,m,n,u);f.y=c(t.y,w.y,o.y,x.y,m,n,u);f.z=c(t.z,w.z,o.z,x.z,m,n,u);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;b0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(z.r*255)+","+Math.floor(z.g*255)+","+ -Math.floor(z.b*255)+","+y+")"),v.fillRect(Math.floor(L.getX()),Math.floor(L.getY()),Math.floor(L.getWidth()),Math.floor(L.getHeight()))),L.empty())};this.render=function(b,t){function u(b){var c,e,f,k=b.lights;P.setRGB(0,0,0);ma.setRGB(0,0,0);ua.setRGB(0,0,0);b=0;for(c=k.length;b>1,xa=u.height>>1,m=k.scale.x*o,t=k.scale.y*x,p=m*w,n=t*xa,M.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(M)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-t),v.translate(-w,-xa),v.drawImage(u,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(p=k.scale.x*o,n=k.scale.y*x,M.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(M)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(p,n),m.program(v), -v.restore()))}function eb(b,k,h,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(k.positionScreen.x,k.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(J!=b)v.lineCap=J=b;b=m.linejoin;if(O!=b)v.lineJoin=O=b;f(m.color.getContextStyle());v.stroke();M.inflate(m.linewidth*2)}}function A(b,f,h,m,n,u,o,v,xa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); -Q=b.positionScreen.x;Z=b.positionScreen.y;$=f.positionScreen.x;S=f.positionScreen.y;p=h.positionScreen.x;V=h.positionScreen.y;F(Q,Z,$,S,p,V);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,S,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[u].u,ra[u].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=t.matrixWorldInverse,oa.copy(o.vertexNormalsWorld[0]),sa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,ya= --(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[1]),Ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Ga=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[2]),Fa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Da=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,ab(Q,Z,$,S,p,V,sa,ya,Ca,Ga,Fa,Da,v.envMap)}else v.wireframe?C(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):Na(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&& -(v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,S,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[u].u,ra[u].v,v.map)),e(THREE.SubtractiveBlending)),fa?!v.wireframe&&v.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==3?(W.r=U.r=ia.r=P.r,W.g=U.g=ia.g=P.g,W.b=U.b=ia.b=P.b,w(xa,o.v1.positionWorld,o.vertexNormalsWorld[0],W),w(xa,o.v2.positionWorld,o.vertexNormalsWorld[1],U),w(xa,o.v3.positionWorld,o.vertexNormalsWorld[2],ia),W.r=Math.max(0,Math.min(v.color.r*W.r,1)),W.g=Math.max(0,Math.min(v.color.g* -W.g,1)),W.b=Math.max(0,Math.min(v.color.b*W.b,1)),U.r=Math.max(0,Math.min(v.color.r*U.r,1)),U.g=Math.max(0,Math.min(v.color.g*U.g,1)),U.b=Math.max(0,Math.min(v.color.b*U.b,1)),ia.r=Math.max(0,Math.min(v.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(v.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(v.color.b*ia.b,1)),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,S,p,V,0,0,1,0,0,1,pa)):(qa.r=P.r,qa.g=P.g,qa.b=P.b,w(xa,o.centroidWorld,o.normalWorld,qa),aa.r=Math.max(0,Math.min(v.color.r* -qa.r,1)),aa.g=Math.max(0,Math.min(v.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(v.color.b*qa.b,1)),v.wireframe?C(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):Na(aa)):v.wireframe?C(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):Na(v.color);else if(v instanceof THREE.MeshDepthMaterial)la=t.near,ca=t.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(h.positionScreen.z,la,ca),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ -ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,S,p,V,0,0,1,0,0,1,pa);else if(v instanceof THREE.MeshNormalMaterial)aa.r=Va(o.normalWorld.x),aa.g=Va(o.normalWorld.y),aa.b=Va(o.normalWorld.z),v.wireframe?C(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):Na(aa)}function z(b,f,h,m,n,u,v,o,xa){k.info.render.vertices+=4;k.info.render.faces++;c(o.opacity);e(o.blending);if(o.map||o.envMap)A(b,f,m,0,1,3,v,o,xa),A(n,h,u,1,2,3,v,o,xa);else if(Q=b.positionScreen.x,Z=b.positionScreen.y, -$=f.positionScreen.x,S=f.positionScreen.y,p=h.positionScreen.x,V=h.positionScreen.y,ea=m.positionScreen.x,da=m.positionScreen.y,ha=n.positionScreen.x,ga=n.positionScreen.y,ka=u.positionScreen.x,na=u.positionScreen.y,o instanceof THREE.MeshBasicMaterial)E(Q,Z,$,S,p,V,ea,da),o.wireframe?C(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):Na(o.color);else if(o instanceof THREE.MeshLambertMaterial)fa?!o.wireframe&&o.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4?(W.r= -U.r=ia.r=ja.r=P.r,W.g=U.g=ia.g=ja.g=P.g,W.b=U.b=ia.b=ja.b=P.b,w(xa,v.v1.positionWorld,v.vertexNormalsWorld[0],W),w(xa,v.v2.positionWorld,v.vertexNormalsWorld[1],U),w(xa,v.v4.positionWorld,v.vertexNormalsWorld[3],ia),w(xa,v.v3.positionWorld,v.vertexNormalsWorld[2],ja),W.r=Math.max(0,Math.min(o.color.r*W.r,1)),W.g=Math.max(0,Math.min(o.color.g*W.g,1)),W.b=Math.max(0,Math.min(o.color.b*W.b,1)),U.r=Math.max(0,Math.min(o.color.r*U.r,1)),U.g=Math.max(0,Math.min(o.color.g*U.g,1)),U.b=Math.max(0,Math.min(o.color.b* -U.b,1)),ia.r=Math.max(0,Math.min(o.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(o.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(o.color.b*ia.b,1)),ja.r=Math.max(0,Math.min(o.color.r*ja.r,1)),ja.g=Math.max(0,Math.min(o.color.g*ja.g,1)),ja.b=Math.max(0,Math.min(o.color.b*ja.b,1)),pa=Ya(W,U,ia,ja),F(Q,Z,$,S,ea,da),Ua(Q,Z,$,S,ea,da,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)):(qa.r=P.r,qa.g=P.g,qa.b=P.b,w(xa,v.centroidWorld,v.normalWorld,qa),aa.r=Math.max(0,Math.min(o.color.r*qa.r, -1)),aa.g=Math.max(0,Math.min(o.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(o.color.b*qa.b,1)),E(Q,Z,$,S,p,V,ea,da),o.wireframe?C(aa,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):Na(aa)):(E(Q,Z,$,S,p,V,ea,da),o.wireframe?C(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):Na(o.color));else if(o instanceof THREE.MeshNormalMaterial)aa.r=Va(v.normalWorld.x),aa.g=Va(v.normalWorld.y),aa.b=Va(v.normalWorld.z),E(Q,Z,$,S,p,V,ea,da),o.wireframe?C(aa,o.wireframeLinewidth,o.wireframeLinecap, -o.wireframeLinejoin):Na(aa);else if(o instanceof THREE.MeshDepthMaterial)la=t.near,ca=t.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,la,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,la,ca),pa=Ya(W,U,ia,ja),F(Q,Z,$,S,ea,da),Ua(Q,Z,$,S,ea,da,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)}function F(b,c,e,f,k,h){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(b,c);v.closePath()}function E(b, -c,e,f,k,h,m,p){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(m,p);v.lineTo(b,c);v.closePath()}function C(b,c,e,k){if(G!=c)v.lineWidth=G=c;if(J!=e)v.lineCap=J=e;if(O!=k)v.lineJoin=O=k;f(b.getContextStyle());v.stroke();M.inflate(c*2)}function Na(b){h(b.getContextStyle());v.fill()}function ab(b,c,e,f,k,m,p,n,t,o,u,xa,w){if(w.image.width!=0){if(w.needsUpdate==!0||ta[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,L=w.wrapT==THREE.RepeatWrapping;ta[w.id]=v.createPattern(w.image,x&& -L?"repeat":x&&!L?"repeat-x":!x&&L?"repeat-y":"no-repeat");w.needsUpdate=!1}h(ta[w.id]);var x=w.offset.x/w.repeat.x,L=w.offset.y/w.repeat.y,y=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,p=(p+x)*y,n=(n+L)*w,t=(t+x)*y,o=(o+L)*w,u=(u+x)*y,xa=(xa+L)*w;e-=b;f-=c;k-=b;m-=c;t-=p;o-=n;u-=p;xa-=n;x=1/(t*xa-u*o);w=(xa*e-o*k)*x;o=(xa*f-o*m)*x;e=(t*k-u*e)*x;f=(t*m-u*f)*x;b=b-w*p-e*n;c=c-o*p-f*n;v.save();v.transform(w,o,e,f,b,c);v.fill();v.restore()}}function Ua(b,c,e,f,k,h,m,p,n,t,o,u,w){var xa, -x;xa=w.width-1;x=w.height-1;m*=xa;p*=x;n*=xa;t*=x;o*=xa;u*=x;e-=b;f-=c;k-=b;h-=c;n-=m;t-=p;o-=m;u-=p;x=1/(n*u-o*t);xa=(u*e-t*k)*x;t=(u*f-t*h)*x;e=(n*k-o*e)*x;f=(n*h-o*f)*x;b=b-xa*m-e*p;c=c-t*m-f*p;v.save();v.transform(xa,t,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var k=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),p=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),t=~~(e.g*255),e=~~(e.b*255),o=~~(f.r*255),u=~~(f.g*255),f=~~(f.b*255);va[0]=k<0?0:k>255?255:k;va[1]=h<0?0: -h>255?255:h;va[2]=b<0?0:b>255?255:b;va[4]=m<0?0:m>255?255:m;va[5]=p<0?0:p>255?255:p;va[6]=c<0?0:c>255?255:c;va[8]=n<0?0:n>255?255:n;va[9]=t<0?0:t>255?255:t;va[10]=e<0?0:e>255?255:e;va[12]=o<0?0:o>255?255:o;va[13]=u<0?0:u>255?255:u;va[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,k=e*e+f*f;k!=0&&(k=1/Math.sqrt(k),e*=k,f*=k,c.x+= -e,c.y+=f,b.x-=e,b.y-=f)}var Za,bb,wa,Ja,Pa,Wa,$a,Aa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,o,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,t,this.sortElements);(fa=b.lights.length>0)&&u(b);Za=0;for(bb=m.length;Za0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m)):h instanceof THREE.PointLight&&(Y.sub(h.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*h.intensity,m>0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m))}function c(c,e,m,n,o,u){k.info.render.vertices+=3;k.info.render.faces++;Q=f(Z++); -Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");o instanceof THREE.MeshBasicMaterial?G.copy(o.color):o instanceof THREE.MeshLambertMaterial?C?(J.r=O.r,J.g=O.g,J.b=O.b,b(u,n,J),G.r=Math.max(0,Math.min(o.color.r*J.r,1)),G.g=Math.max(0,Math.min(o.color.g*J.g,1)),G.b=Math.max(0,Math.min(o.color.b*J.b,1))):G.copy(o.color):o instanceof THREE.MeshDepthMaterial?(N=1-o.__2near/(o.__farPlusNear- -n.z*o.__farMinusNear),G.setRGB(N,N,N)):o instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));o.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+o.wireframeLinewidth+"; stroke-opacity: "+o.opacity+"; stroke-linecap: "+o.wireframeLinecap+"; stroke-linejoin: "+o.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+o.opacity);t.appendChild(Q)}function e(c,e,m,n,o,u,v){k.info.render.vertices+= -4;k.info.render.faces++;Q=f(Z++);Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");u instanceof THREE.MeshBasicMaterial?G.copy(u.color):u instanceof THREE.MeshLambertMaterial?C?(J.r=O.r,J.g=O.g,J.b=O.b,b(v,o,J),G.r=Math.max(0,Math.min(u.color.r*J.r,1)),G.g=Math.max(0,Math.min(u.color.g*J.g,1)),G.b=Math.max(0,Math.min(u.color.b*J.b,1))): -G.copy(u.color):u instanceof THREE.MeshDepthMaterial?(N=1-u.__2near/(u.__farPlusNear-o.z*u.__farMinusNear),G.setRGB(N,N,N)):u instanceof THREE.MeshNormalMaterial&&G.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));u.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+u.wireframeLinewidth+"; stroke-opacity: "+u.opacity+"; stroke-linecap: "+u.wireframeLinecap+"; stroke-linejoin: "+u.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+ -"; fill-opacity: "+u.opacity);t.appendChild(Q)}function f(b){H[b]==null&&(H[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),S==0&&H[b].setAttribute("shape-rendering","crispEdges"));return H[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,t=document.createElementNS("http://www.w3.org/2000/svg","svg"),u,w,o,x,v,z,y,A,E=new THREE.Rectangle,F=new THREE.Rectangle,C=!1,G=new THREE.Color(16777215),J=new THREE.Color(16777215),O=new THREE.Color(0), -K=new THREE.Color(0),B=new THREE.Color(0),N,Y=new THREE.Vector3,H=[],T=[],Q,Z,$,S=1;this.domElement=t;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":S=1;break;case "low":S=0}};this.setSize=function(b,c){u=b;w=c;o=u/2;x=w/2;t.setAttribute("viewBox",-o+" "+-x+" "+u+" "+w);t.setAttribute("width",u);t.setAttribute("height",w);E.set(-o,-x,o,x)};this.clear=function(){for(;t.childNodes.length>0;)t.removeChild(t.childNodes[0])}; -this.render=function(b,f){var h,u,w,G,H,N,J,W;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);$=Z=0;if(C=b.lights.length>0){J=b.lights;O.setRGB(0,0,0);K.setRGB(0,0,0);B.setRGB(0,0,0);h=0;for(u=J.length;h0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(z.r*255)+","+Math.floor(z.g*255)+","+ +Math.floor(z.b*255)+","+A+")"),v.fillRect(Math.floor(S.getX()),Math.floor(S.getY()),Math.floor(S.getWidth()),Math.floor(S.getHeight()))),S.empty())};this.render=function(b,u){function t(b){var c,e,f,k=b.lights;N.setRGB(0,0,0);ma.setRGB(0,0,0);ua.setRGB(0,0,0);b=0;for(c=k.length;b>1,xa=t.height>>1,m=k.scale.x*o,u=k.scale.y*x,p=m*w,n=u*xa,O.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(O)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-u),v.translate(-w,-xa),v.drawImage(t,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(p=k.scale.x*o,n=k.scale.y*x,O.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(O)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(p,n),m.program(v), +v.restore()))}function eb(b,k,h,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(k.positionScreen.x,k.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(J!=b)v.lineCap=J=b;b=m.linejoin;if(M!=b)v.lineJoin=M=b;f(m.color.getContextStyle());v.stroke();O.inflate(m.linewidth*2)}}function y(b,f,h,m,n,t,o,v,xa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); +Q=b.positionScreen.x;Z=b.positionScreen.y;$=f.positionScreen.x;P=f.positionScreen.y;p=h.positionScreen.x;V=h.positionScreen.y;F(Q,Z,$,P,p,V);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,P,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=u.matrixWorldInverse,oa.copy(o.vertexNormalsWorld[0]),sa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,ya= +-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[1]),Ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Ga=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[2]),Fa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Da=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,ab(Q,Z,$,P,p,V,sa,ya,Ca,Ga,Fa,Da,v.envMap)}else v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&& +(v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,P,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map)),e(THREE.SubtractiveBlending)),da?!v.wireframe&&v.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==3?(W.r=U.r=ia.r=N.r,W.g=U.g=ia.g=N.g,W.b=U.b=ia.b=N.b,w(xa,o.v1.positionWorld,o.vertexNormalsWorld[0],W),w(xa,o.v2.positionWorld,o.vertexNormalsWorld[1],U),w(xa,o.v3.positionWorld,o.vertexNormalsWorld[2],ia),W.r=Math.max(0,Math.min(v.color.r*W.r,1)),W.g=Math.max(0,Math.min(v.color.g* +W.g,1)),W.b=Math.max(0,Math.min(v.color.b*W.b,1)),U.r=Math.max(0,Math.min(v.color.r*U.r,1)),U.g=Math.max(0,Math.min(v.color.g*U.g,1)),U.b=Math.max(0,Math.min(v.color.b*U.b,1)),ia.r=Math.max(0,Math.min(v.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(v.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(v.color.b*ia.b,1)),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,p,V,0,0,1,0,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,o.centroidWorld,o.normalWorld,qa),aa.r=Math.max(0,Math.min(v.color.r* +qa.r,1)),aa.g=Math.max(0,Math.min(v.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(v.color.b*qa.b,1)),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)):v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshDepthMaterial)la=u.near,ca=u.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(h.positionScreen.z,la,ca),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ +ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,p,V,0,0,1,0,0,1,pa);else if(v instanceof THREE.MeshNormalMaterial)aa.r=Va(o.normalWorld.x),aa.g=Va(o.normalWorld.y),aa.b=Va(o.normalWorld.z),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)}function z(b,f,h,m,n,t,v,o,xa){k.info.render.vertices+=4;k.info.render.faces++;c(o.opacity);e(o.blending);if(o.map||o.envMap)y(b,f,m,0,1,3,v,o,xa),y(n,h,t,1,2,3,v,o,xa);else if(Q=b.positionScreen.x,Z=b.positionScreen.y, +$=f.positionScreen.x,P=f.positionScreen.y,p=h.positionScreen.x,V=h.positionScreen.y,fa=m.positionScreen.x,ea=m.positionScreen.y,ha=n.positionScreen.x,ga=n.positionScreen.y,ka=t.positionScreen.x,na=t.positionScreen.y,o instanceof THREE.MeshBasicMaterial)E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(o.color);else if(o instanceof THREE.MeshLambertMaterial)da?!o.wireframe&&o.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4?(W.r= +U.r=ia.r=ja.r=N.r,W.g=U.g=ia.g=ja.g=N.g,W.b=U.b=ia.b=ja.b=N.b,w(xa,v.v1.positionWorld,v.vertexNormalsWorld[0],W),w(xa,v.v2.positionWorld,v.vertexNormalsWorld[1],U),w(xa,v.v4.positionWorld,v.vertexNormalsWorld[3],ia),w(xa,v.v3.positionWorld,v.vertexNormalsWorld[2],ja),W.r=Math.max(0,Math.min(o.color.r*W.r,1)),W.g=Math.max(0,Math.min(o.color.g*W.g,1)),W.b=Math.max(0,Math.min(o.color.b*W.b,1)),U.r=Math.max(0,Math.min(o.color.r*U.r,1)),U.g=Math.max(0,Math.min(o.color.g*U.g,1)),U.b=Math.max(0,Math.min(o.color.b* +U.b,1)),ia.r=Math.max(0,Math.min(o.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(o.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(o.color.b*ia.b,1)),ja.r=Math.max(0,Math.min(o.color.r*ja.r,1)),ja.g=Math.max(0,Math.min(o.color.g*ja.g,1)),ja.b=Math.max(0,Math.min(o.color.b*ja.b,1)),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,v.centroidWorld,v.normalWorld,qa),aa.r=Math.max(0,Math.min(o.color.r*qa.r, +1)),aa.g=Math.max(0,Math.min(o.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(o.color.b*qa.b,1)),E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(aa,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(aa)):(E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(o.color));else if(o instanceof THREE.MeshNormalMaterial)aa.r=Va(v.normalWorld.x),aa.g=Va(v.normalWorld.y),aa.b=Va(v.normalWorld.z),E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(aa,o.wireframeLinewidth,o.wireframeLinecap, +o.wireframeLinejoin):C(aa);else if(o instanceof THREE.MeshDepthMaterial)la=u.near,ca=u.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,la,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,la,ca),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)}function F(b,c,e,f,k,h){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(b,c);v.closePath()}function E(b, +c,e,f,k,h,m,p){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(m,p);v.lineTo(b,c);v.closePath()}function Na(b,c,e,k){if(G!=c)v.lineWidth=G=c;if(J!=e)v.lineCap=J=e;if(M!=k)v.lineJoin=M=k;f(b.getContextStyle());v.stroke();O.inflate(c*2)}function C(b){h(b.getContextStyle());v.fill()}function ab(b,c,e,f,k,m,p,n,u,o,t,xa,w){if(w.image.width!=0){if(w.needsUpdate==!0||ta[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,S=w.wrapT==THREE.RepeatWrapping;ta[w.id]=v.createPattern(w.image,x&& +S?"repeat":x&&!S?"repeat-x":!x&&S?"repeat-y":"no-repeat");w.needsUpdate=!1}h(ta[w.id]);var x=w.offset.x/w.repeat.x,S=w.offset.y/w.repeat.y,A=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,p=(p+x)*A,n=(n+S)*w,u=(u+x)*A,o=(o+S)*w,t=(t+x)*A,xa=(xa+S)*w;e-=b;f-=c;k-=b;m-=c;u-=p;o-=n;t-=p;xa-=n;x=1/(u*xa-t*o);w=(xa*e-o*k)*x;o=(xa*f-o*m)*x;e=(u*k-t*e)*x;f=(u*m-t*f)*x;b=b-w*p-e*n;c=c-o*p-f*n;v.save();v.transform(w,o,e,f,b,c);v.fill();v.restore()}}function Ua(b,c,e,f,k,h,m,p,n,u,o,t,w){var xa, +x;xa=w.width-1;x=w.height-1;m*=xa;p*=x;n*=xa;u*=x;o*=xa;t*=x;e-=b;f-=c;k-=b;h-=c;n-=m;u-=p;o-=m;t-=p;x=1/(n*t-o*u);xa=(t*e-u*k)*x;u=(t*f-u*h)*x;e=(n*k-o*e)*x;f=(n*h-o*f)*x;b=b-xa*m-e*p;c=c-u*m-f*p;v.save();v.transform(xa,u,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var k=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),p=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),u=~~(e.g*255),e=~~(e.b*255),o=~~(f.r*255),t=~~(f.g*255),f=~~(f.b*255);va[0]=k<0?0:k>255?255:k;va[1]=h<0?0: +h>255?255:h;va[2]=b<0?0:b>255?255:b;va[4]=m<0?0:m>255?255:m;va[5]=p<0?0:p>255?255:p;va[6]=c<0?0:c>255?255:c;va[8]=n<0?0:n>255?255:n;va[9]=u<0?0:u>255?255:u;va[10]=e<0?0:e>255?255:e;va[12]=o<0?0:o>255?255:o;va[13]=t<0?0:t>255?255:t;va[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,k=e*e+f*f;k!=0&&(k=1/Math.sqrt(k),e*=k,f*=k,c.x+= +e,c.y+=f,b.x-=e,b.y-=f)}var Za,bb,wa,Ja,Pa,Wa,$a,Aa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,o,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,u,this.sortElements);(da=b.lights.length>0)&&t(b);Za=0;for(bb=m.length;Za0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m)):h instanceof THREE.PointLight&&(Y.sub(h.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*h.intensity,m>0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m))}function c(c,e,m,n,o,t){k.info.render.vertices+=3;k.info.render.faces++;Q=f(Z++); +Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");o instanceof THREE.MeshBasicMaterial?G.copy(o.color):o instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(t,n,J),G.r=Math.max(0,Math.min(o.color.r*J.r,1)),G.g=Math.max(0,Math.min(o.color.g*J.g,1)),G.b=Math.max(0,Math.min(o.color.b*J.b,1))):G.copy(o.color):o instanceof THREE.MeshDepthMaterial?(L=1-o.__2near/(o.__farPlusNear- +n.z*o.__farMinusNear),G.setRGB(L,L,L)):o instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));o.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+o.wireframeLinewidth+"; stroke-opacity: "+o.opacity+"; stroke-linecap: "+o.wireframeLinecap+"; stroke-linejoin: "+o.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+o.opacity);u.appendChild(Q)}function e(c,e,m,n,o,t,v){k.info.render.vertices+= +4;k.info.render.faces++;Q=f(Z++);Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?G.copy(t.color):t instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(v,o,J),G.r=Math.max(0,Math.min(t.color.r*J.r,1)),G.g=Math.max(0,Math.min(t.color.g*J.g,1)),G.b=Math.max(0,Math.min(t.color.b*J.b,1))): +G.copy(t.color):t instanceof THREE.MeshDepthMaterial?(L=1-t.__2near/(t.__farPlusNear-o.z*t.__farMinusNear),G.setRGB(L,L,L)):t instanceof THREE.MeshNormalMaterial&&G.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));t.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+ +"; fill-opacity: "+t.opacity);u.appendChild(Q)}function f(b){H[b]==null&&(H[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),P==0&&H[b].setAttribute("shape-rendering","crispEdges"));return H[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,u=document.createElementNS("http://www.w3.org/2000/svg","svg"),t,w,o,x,v,z,A,y,E=new THREE.Rectangle,F=new THREE.Rectangle,C=!1,G=new THREE.Color(16777215),J=new THREE.Color(16777215),M=new THREE.Color(0), +K=new THREE.Color(0),B=new THREE.Color(0),L,Y=new THREE.Vector3,H=[],T=[],Q,Z,$,P=1;this.domElement=u;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":P=1;break;case "low":P=0}};this.setSize=function(b,c){t=b;w=c;o=t/2;x=w/2;u.setAttribute("viewBox",-o+" "+-x+" "+t+" "+w);u.setAttribute("width",t);u.setAttribute("height",w);E.set(-o,-x,o,x)};this.clear=function(){for(;u.childNodes.length>0;)u.removeChild(u.childNodes[0])}; +this.render=function(b,f){var h,t,w,G,H,L,J,W;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);$=Z=0;if(C=b.lights.length>0){J=b.lights;M.setRGB(0,0,0);K.setRGB(0,0,0);B.setRGB(0,0,0);h=0;for(t=J.length;h 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", lights_vertex:"if ( !enableLighting ) {\nvLightWeighting = vec3( 1.0 );\n} else {\nvLightWeighting = ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nfloat directionalLightWeighting = max( dot( transformedNormal, normalize( lDirection.xyz ) ), 0.0 );\nvLightWeighting += directionalLightColor[ i ] * directionalLightWeighting;\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 pointLightWeighting = max( dot( transformedNormal, lVector ), 0.0 );\nvLightWeighting += pointLightColor[ i ] * pointLightWeighting * lDistance;\n}\n#endif\n}", lights_phong_pars_vertex:"#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif",lights_phong_vertex:"#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif", -lights_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 ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",lights_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\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 ++ ) {\nvec3 pointVector = normalize( vPointLight[ i ].xyz );\nvec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );\nfloat pointDistance = vPointLight[ i ].w;\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = pow( pointDotNormalHalf, shininess );\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * pointDistance;\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\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 );\nvec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = pow( dirDotNormalHalf, shininess );\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\ndirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;\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\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;", -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\nvColor = color;\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 * viewMatrix * objectMatrix * gl_Position;\n#endif", +lights_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 ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",lights_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\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 ++ ) {\nvec3 pointVector = normalize( vPointLight[ i ].xyz );\nvec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );\nfloat pointDistance = vPointLight[ i ].w;\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = pow( pointDotNormalHalf, shininess );\n#ifdef PHYSICALLY_BASED_SHADING\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( pointVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#else\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#endif\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * pointDistance;\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 );\nvec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = pow( dirDotNormalHalf, shininess );\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\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\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\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient * diffuse ) + totalSpecular;", +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 * viewMatrix * objectMatrix * gl_Position;\n#endif", morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\nuniform float morphTargetInfluences[ 8 ];\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\nvec3 morphed = vec3( 0.0, 0.0, 0.0 );\nmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\nmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\nmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\nmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\nmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\nmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\nmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\nmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\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",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform float shadowDarkness;\nuniform float shadowBias;\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif", -shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_SOFT\nconst float xPixelOffset = 1.0 / SHADOWMAP_WIDTH;\nconst float yPixelOffset = 1.0 / SHADOWMAP_HEIGHT;\n#endif\nvec4 shadowColor = vec4( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nshadowCoord.z += shadowBias;\nif ( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec4( vec3( ( 1.0 - shadowDarkness * shadow ) ), 1.0 );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec4( vec3( shadowDarkness ), 1.0 );\n#endif\n}\n}\ngl_FragColor = gl_FragColor * shadowColor;\n#endif", -shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif"}; +shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_SOFT\nconst float xPixelOffset = 1.0 / SHADOWMAP_WIDTH;\nconst float yPixelOffset = 1.0 / SHADOWMAP_HEIGHT;\n#endif\nvec3 shadowColor = vec3( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nshadowCoord.z += shadowBias;\nif ( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\n#ifdef GAMMA_OUTPUT\nvec3 darkening = vec3( ( 1.0 - shadowDarkness * shadow ) );\ndarkening *= darkening;\nshadowColor = shadowColor * darkening;\n#else\nshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness * shadow ) );\n#endif\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec3( shadowDarkness );\n#endif\n}\n}\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 ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\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(b){var c,e,f,h={};for(c=0;c=0)c&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(b.position, -3,p.FLOAT,!1,0,0));else if(m.morphTargetBase){f=h.program.attributes;m.morphTargetBase!==-1?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[m.morphTargetBase]),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0)):f.position>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var o=0,t=m.morphTargetForcedOrder,u=m.morphTargetInfluences;ov&&(w=x,v=u[w]);p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[w]);p.vertexAttribPointer(f["morphTarget"+o],3,p.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[o]=v;t[w]=1;v= --1;o++}}h.program.uniforms.morphTargetInfluences!==null&&p.uniform1fv(h.program.uniforms.morphTargetInfluences,m.__webglMorphTargetInfluences)}if(c){if(k.__webglCustomAttributes)for(n in k.__webglCustomAttributes)b[n]>=0&&(f=k.__webglCustomAttributes[n],p.bindBuffer(p.ARRAY_BUFFER,f.buffer),p.vertexAttribPointer(b[n],f.size,p.FLOAT,!1,0,0));b.color>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglColorBuffer),p.vertexAttribPointer(b.color,3,p.FLOAT,!1,0,0));b.normal>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglNormalBuffer), -p.vertexAttribPointer(b.normal,3,p.FLOAT,!1,0,0));b.tangent>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglTangentBuffer),p.vertexAttribPointer(b.tangent,4,p.FLOAT,!1,0,0));b.uv>=0&&(k.__webglUVBuffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUVBuffer),p.vertexAttribPointer(b.uv,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv)):p.disableVertexAttribArray(b.uv));b.uv2>=0&&(k.__webglUV2Buffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUV2Buffer),p.vertexAttribPointer(b.uv2,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv2)): -p.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexABuffer),p.vertexAttribPointer(b.skinVertexA,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexBBuffer),p.vertexAttribPointer(b.skinVertexB,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinIndicesBuffer),p.vertexAttribPointer(b.skinIndex,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinWeightsBuffer), -p.vertexAttribPointer(b.skinWeight,4,p.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(h.wireframe?(p.lineWidth(h.wireframeLinewidth),c&&p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,k.__webglLineBuffer),p.drawElements(p.LINES,k.__webglLineCount,p.UNSIGNED_SHORT,0)):(c&&p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,k.__webglFaceBuffer),p.drawElements(p.TRIANGLES,k.__webglFaceCount,p.UNSIGNED_SHORT,0)),S.info.render.calls++,S.info.render.vertices+=k.__webglFaceCount,S.info.render.faces+=k.__webglFaceCount/3):m instanceof THREE.Line? -(m=m.type==THREE.LineStrip?p.LINE_STRIP:p.LINES,p.lineWidth(h.linewidth),p.drawArrays(m,0,k.__webglLineCount),S.info.render.calls++):m instanceof THREE.ParticleSystem?(p.drawArrays(p.POINTS,0,k.__webglParticleCount),S.info.render.calls++):m instanceof THREE.Ribbon&&(p.drawArrays(p.TRIANGLE_STRIP,0,k.__webglVertexCount),S.info.render.calls++)}}function h(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=p.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=p.createBuffer();b.hasPos&& -(p.bindBuffer(p.ARRAY_BUFFER,b.__webglVertexBuffer),p.bufferData(p.ARRAY_BUFFER,b.positionArray,p.DYNAMIC_DRAW),p.enableVertexAttribArray(c.attributes.position),p.vertexAttribPointer(c.attributes.position,3,p.FLOAT,!1,0,0));if(b.hasNormal){p.bindBuffer(p.ARRAY_BUFFER,b.__webglNormalBuffer);if(e==THREE.FlatShading){var f,k,h,m,n,o,t,u,v,w,x=b.count*3;for(w=0;w=0;e--)b[e].object==c&&b.splice(e,1)}function J(b){function c(b){var k=[];e=0;for(f=b.length;e65535&&(t[p].counter+=1,o=t[p].hash+"_"+t[p].counter,b.geometryGroups[o]==void 0&&(b.geometryGroups[o]={faces:[],materials:n,vertices:0,numMorphTargets:u})),b.geometryGroups[o].faces.push(k),b.geometryGroups[o].vertices+=m;b.geometryGroupsList=[];for(var v in b.geometryGroups)b.geometryGroups[v].id=ka++,b.geometryGroupsList.push(b.geometryGroups[v])} -function O(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function K(b){if(b!=W){switch(b){case THREE.AdditiveBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.SRC_ALPHA,p.ONE);break;case THREE.SubtractiveBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.ZERO,p.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.ZERO,p.SRC_COLOR);break;default:p.blendEquationSeparate(p.FUNC_ADD,p.FUNC_ADD),p.blendFuncSeparate(p.SRC_ALPHA, -p.ONE_MINUS_SRC_ALPHA,p.ONE,p.ONE_MINUS_SRC_ALPHA)}W=b}}function B(b,c,e){(e.width&e.width-1)==0&&(e.height&e.height-1)==0?(p.texParameteri(b,p.TEXTURE_WRAP_S,$(c.wrapS)),p.texParameteri(b,p.TEXTURE_WRAP_T,$(c.wrapT)),p.texParameteri(b,p.TEXTURE_MAG_FILTER,$(c.magFilter)),p.texParameteri(b,p.TEXTURE_MIN_FILTER,$(c.minFilter)),p.generateMipmap(b)):(p.texParameteri(b,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(b,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(b,p.TEXTURE_MAG_FILTER,Z(c.magFilter)), -p.texParameteri(b,p.TEXTURE_MIN_FILTER,Z(c.minFilter)))}function N(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=p.createTexture(),S.info.memory.textures++;p.activeTexture(p.TEXTURE0+c);p.bindTexture(p.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?p.texImage2D(p.TEXTURE_2D,0,$(b.format),b.image.width,b.image.height,0,$(b.format),p.UNSIGNED_BYTE,b.image.data):p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,b.image);B(p.TEXTURE_2D,b,b.image);b.needsUpdate= -!1}else p.activeTexture(p.TEXTURE0+c),p.bindTexture(p.TEXTURE_2D,b.__webglTexture)}function Y(b,c){p.bindRenderbuffer(p.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_COMPONENT16,c.width,c.height),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_STENCIL,c.width,c.height),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_STENCIL_ATTACHMENT,p.RENDERBUFFER, -b)):p.renderbufferStorage(p.RENDERBUFFER,p.RGBA4,c.width,c.height)}function H(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=p.createTexture();if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];p.bindTexture(p.TEXTURE_CUBE_MAP,b.__webglTexture);B(p.TEXTURE_CUBE_MAP,b,b);for(var e=0;e<6;e++){b.__webglFramebuffer[e]=p.createFramebuffer();b.__webglRenderbuffer[e]= -p.createRenderbuffer();p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,$(b.format),b.width,b.height,0,$(b.format),$(b.type),null);var f=b,k=p.TEXTURE_CUBE_MAP_POSITIVE_X+e;p.bindFramebuffer(p.FRAMEBUFFER,b.__webglFramebuffer[e]);p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,k,f.__webglTexture,0);Y(b.__webglRenderbuffer[e],b)}}else b.__webglFramebuffer=p.createFramebuffer(),b.__webglRenderbuffer=p.createRenderbuffer(),p.bindTexture(p.TEXTURE_2D,b.__webglTexture),B(p.TEXTURE_2D,b,b),p.texImage2D(p.TEXTURE_2D, -0,$(b.format),b.width,b.height,0,$(b.format),$(b.type),null),e=p.TEXTURE_2D,p.bindFramebuffer(p.FRAMEBUFFER,b.__webglFramebuffer),p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,e,b.__webglTexture,0),p.bindRenderbuffer(p.RENDERBUFFER,b.__webglRenderbuffer),Y(b.__webglRenderbuffer,b);c?p.bindTexture(p.TEXTURE_CUBE_MAP,null):p.bindTexture(p.TEXTURE_2D,null);p.bindRenderbuffer(p.RENDERBUFFER,null);p.bindFramebuffer(p.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer, -e=b.width,b=b.height,k=f=0):(c=null,e=ra,b=sa,f=ca,k=pa);c!=da&&(p.bindFramebuffer(p.FRAMEBUFFER,c),p.viewport(f,k,e,b),da=c)}function T(b){b instanceof THREE.WebGLRenderTargetCube?(p.bindTexture(p.TEXTURE_CUBE_MAP,b.__webglTexture),p.generateMipmap(p.TEXTURE_CUBE_MAP),p.bindTexture(p.TEXTURE_CUBE_MAP,null)):(p.bindTexture(p.TEXTURE_2D,b.__webglTexture),p.generateMipmap(p.TEXTURE_2D),p.bindTexture(p.TEXTURE_2D,null))}function Q(b,c){var e;b=="fragment"?e=p.createShader(p.FRAGMENT_SHADER):b=="vertex"&& -(e=p.createShader(p.VERTEX_SHADER));p.shaderSource(e,c);p.compileShader(e);if(!p.getShaderParameter(e,p.COMPILE_STATUS))return console.error(p.getShaderInfoLog(e)),console.error(c),null;return e}function Z(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return p.NEAREST;default:return p.LINEAR}}function $(b){switch(b){case THREE.RepeatWrapping:return p.REPEAT;case THREE.ClampToEdgeWrapping:return p.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return p.MIRRORED_REPEAT; +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]),vertexShader:["varying vec3 vLightWeighting;",THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex, +THREE.ShaderChunk.lights_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,"vec3 transformedNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.lights_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;\nvarying vec3 vLightWeighting;",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,"gl_FragColor = gl_FragColor * vec4( vLightWeighting, 1.0 );",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}}]),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;\nvec3 transformedNormal = normalize( normalMatrix * normal );\nvNormal = 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_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_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(b){function c(b,c,e){var f,k,h,m=b.vertices,n=m.length,u=b.colors,o=u.length,t=b.__vertexArray,v=b.__colorArray,w=b.__sortArray,x=b.__dirtyVertices,S=b.__dirtyColors,A=b.__webglCustomAttributes,y,z;if(A)for(y in A)A[y].offset=0;if(e.sortParticles){Ca.multiplySelf(e.matrixWorld);for(f=0;f=0)c&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(b.position,3,p.FLOAT,!1,0,0));else if(m.morphTargetBase){f=h.program.attributes;m.morphTargetBase!== +-1?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[m.morphTargetBase]),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0)):f.position>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var o=0,t=m.morphTargetForcedOrder,u=m.morphTargetInfluences;ov&&(w=x,v=u[w]);p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[w]);p.vertexAttribPointer(f["morphTarget"+o],3,p.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[o]=v;t[w]=1;v=-1;o++}}h.program.uniforms.morphTargetInfluences!==null&&p.uniform1fv(h.program.uniforms.morphTargetInfluences, +m.__webglMorphTargetInfluences)}if(c){if(k.__webglCustomAttributes)for(n in k.__webglCustomAttributes)b[n]>=0&&(f=k.__webglCustomAttributes[n],p.bindBuffer(p.ARRAY_BUFFER,f.buffer),p.vertexAttribPointer(b[n],f.size,p.FLOAT,!1,0,0));b.color>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglColorBuffer),p.vertexAttribPointer(b.color,3,p.FLOAT,!1,0,0));b.normal>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglNormalBuffer),p.vertexAttribPointer(b.normal,3,p.FLOAT,!1,0,0));b.tangent>=0&&(p.bindBuffer(p.ARRAY_BUFFER, +k.__webglTangentBuffer),p.vertexAttribPointer(b.tangent,4,p.FLOAT,!1,0,0));b.uv>=0&&(k.__webglUVBuffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUVBuffer),p.vertexAttribPointer(b.uv,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv)):p.disableVertexAttribArray(b.uv));b.uv2>=0&&(k.__webglUV2Buffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUV2Buffer),p.vertexAttribPointer(b.uv2,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv2)):p.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>= +0&&b.skinIndex>=0&&b.skinWeight>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexABuffer),p.vertexAttribPointer(b.skinVertexA,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexBBuffer),p.vertexAttribPointer(b.skinVertexB,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinIndicesBuffer),p.vertexAttribPointer(b.skinIndex,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinWeightsBuffer),p.vertexAttribPointer(b.skinWeight,4,p.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(h.wireframe? +(p.lineWidth(h.wireframeLinewidth),c&&p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,k.__webglLineBuffer),p.drawElements(p.LINES,k.__webglLineCount,p.UNSIGNED_SHORT,0)):(c&&p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,k.__webglFaceBuffer),p.drawElements(p.TRIANGLES,k.__webglFaceCount,p.UNSIGNED_SHORT,0)),P.info.render.calls++,P.info.render.vertices+=k.__webglFaceCount,P.info.render.faces+=k.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?p.LINE_STRIP:p.LINES,p.lineWidth(h.linewidth),p.drawArrays(m, +0,k.__webglLineCount),P.info.render.calls++):m instanceof THREE.ParticleSystem?(p.drawArrays(p.POINTS,0,k.__webglParticleCount),P.info.render.calls++):m instanceof THREE.Ribbon&&(p.drawArrays(p.TRIANGLE_STRIP,0,k.__webglVertexCount),P.info.render.calls++)}}function h(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=p.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=p.createBuffer();b.hasPos&&(p.bindBuffer(p.ARRAY_BUFFER,b.__webglVertexBuffer),p.bufferData(p.ARRAY_BUFFER,b.positionArray, +p.DYNAMIC_DRAW),p.enableVertexAttribArray(c.attributes.position),p.vertexAttribPointer(c.attributes.position,3,p.FLOAT,!1,0,0));if(b.hasNormal){p.bindBuffer(p.ARRAY_BUFFER,b.__webglNormalBuffer);if(e==THREE.FlatShading){var f,k,h,m,n,o,t,u,v,w,x=b.count*3;for(w=0;w=0;e--)b[e].object==c&&b.splice(e,1)}function J(b){function c(b){var k=[];e=0;for(f=b.length;e65535&&(t[p].counter+=1,o=t[p].hash+"_"+t[p].counter,b.geometryGroups[o]==void 0&&(b.geometryGroups[o]={faces:[],materials:n,vertices:0,numMorphTargets:u})),b.geometryGroups[o].faces.push(k),b.geometryGroups[o].vertices+=m;b.geometryGroupsList=[];for(var v in b.geometryGroups)b.geometryGroups[v].id=ka++,b.geometryGroupsList.push(b.geometryGroups[v])}function M(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0}, +transparent:{list:[],count:0}})}function K(b){if(b!=W){switch(b){case THREE.AdditiveBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.SRC_ALPHA,p.ONE);break;case THREE.SubtractiveBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.ZERO,p.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.ZERO,p.SRC_COLOR);break;default:p.blendEquationSeparate(p.FUNC_ADD,p.FUNC_ADD),p.blendFuncSeparate(p.SRC_ALPHA,p.ONE_MINUS_SRC_ALPHA,p.ONE,p.ONE_MINUS_SRC_ALPHA)}W=b}} +function B(b,c,e){(e.width&e.width-1)==0&&(e.height&e.height-1)==0?(p.texParameteri(b,p.TEXTURE_WRAP_S,$(c.wrapS)),p.texParameteri(b,p.TEXTURE_WRAP_T,$(c.wrapT)),p.texParameteri(b,p.TEXTURE_MAG_FILTER,$(c.magFilter)),p.texParameteri(b,p.TEXTURE_MIN_FILTER,$(c.minFilter)),p.generateMipmap(b)):(p.texParameteri(b,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(b,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(b,p.TEXTURE_MAG_FILTER,Z(c.magFilter)),p.texParameteri(b,p.TEXTURE_MIN_FILTER,Z(c.minFilter)))} +function L(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=p.createTexture(),P.info.memory.textures++;p.activeTexture(p.TEXTURE0+c);p.bindTexture(p.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?p.texImage2D(p.TEXTURE_2D,0,$(b.format),b.image.width,b.image.height,0,$(b.format),p.UNSIGNED_BYTE,b.image.data):p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,b.image);B(p.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else p.activeTexture(p.TEXTURE0+c),p.bindTexture(p.TEXTURE_2D, +b.__webglTexture)}function Y(b,c){p.bindRenderbuffer(p.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_COMPONENT16,c.width,c.height),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_STENCIL,c.width,c.height),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_STENCIL_ATTACHMENT,p.RENDERBUFFER,b)):p.renderbufferStorage(p.RENDERBUFFER,p.RGBA4,c.width,c.height)} +function H(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=p.createTexture();if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];p.bindTexture(p.TEXTURE_CUBE_MAP,b.__webglTexture);B(p.TEXTURE_CUBE_MAP,b,b);for(var e=0;e<6;e++){b.__webglFramebuffer[e]=p.createFramebuffer();b.__webglRenderbuffer[e]=p.createRenderbuffer();p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X+ +e,0,$(b.format),b.width,b.height,0,$(b.format),$(b.type),null);var f=b,k=p.TEXTURE_CUBE_MAP_POSITIVE_X+e;p.bindFramebuffer(p.FRAMEBUFFER,b.__webglFramebuffer[e]);p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,k,f.__webglTexture,0);Y(b.__webglRenderbuffer[e],b)}}else b.__webglFramebuffer=p.createFramebuffer(),b.__webglRenderbuffer=p.createRenderbuffer(),p.bindTexture(p.TEXTURE_2D,b.__webglTexture),B(p.TEXTURE_2D,b,b),p.texImage2D(p.TEXTURE_2D,0,$(b.format),b.width,b.height,0,$(b.format), +$(b.type),null),e=p.TEXTURE_2D,p.bindFramebuffer(p.FRAMEBUFFER,b.__webglFramebuffer),p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,e,b.__webglTexture,0),p.bindRenderbuffer(p.RENDERBUFFER,b.__webglRenderbuffer),Y(b.__webglRenderbuffer,b);c?p.bindTexture(p.TEXTURE_CUBE_MAP,null):p.bindTexture(p.TEXTURE_2D,null);p.bindRenderbuffer(p.RENDERBUFFER,null);p.bindFramebuffer(p.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,e=b.width,b=b.height,k=f=0):(c=null, +e=ra,b=sa,f=ca,k=pa);c!=ea&&(p.bindFramebuffer(p.FRAMEBUFFER,c),p.viewport(f,k,e,b),ea=c)}function T(b){b instanceof THREE.WebGLRenderTargetCube?(p.bindTexture(p.TEXTURE_CUBE_MAP,b.__webglTexture),p.generateMipmap(p.TEXTURE_CUBE_MAP),p.bindTexture(p.TEXTURE_CUBE_MAP,null)):(p.bindTexture(p.TEXTURE_2D,b.__webglTexture),p.generateMipmap(p.TEXTURE_2D),p.bindTexture(p.TEXTURE_2D,null))}function Q(b,c){var e;b=="fragment"?e=p.createShader(p.FRAGMENT_SHADER):b=="vertex"&&(e=p.createShader(p.VERTEX_SHADER)); +p.shaderSource(e,c);p.compileShader(e);if(!p.getShaderParameter(e,p.COMPILE_STATUS))return console.error(p.getShaderInfoLog(e)),console.error(c),null;return e}function Z(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return p.NEAREST;default:return p.LINEAR}}function $(b){switch(b){case THREE.RepeatWrapping:return p.REPEAT;case THREE.ClampToEdgeWrapping:return p.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return p.MIRRORED_REPEAT; case THREE.NearestFilter:return p.NEAREST;case THREE.NearestMipMapNearestFilter:return p.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return p.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return p.LINEAR;case THREE.LinearMipMapNearestFilter:return p.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return p.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return p.BYTE;case THREE.UnsignedByteType:return p.UNSIGNED_BYTE;case THREE.ShortType:return p.SHORT;case THREE.UnsignedShortType:return p.UNSIGNED_SHORT; -case THREE.IntType:return p.INT;case THREE.UnsignedShortType:return p.UNSIGNED_INT;case THREE.FloatType:return p.FLOAT;case THREE.AlphaFormat:return p.ALPHA;case THREE.RGBFormat:return p.RGB;case THREE.RGBAFormat:return p.RGBA;case THREE.LuminanceFormat:return p.LUMINANCE;case THREE.LuminanceAlphaFormat:return p.LUMINANCE_ALPHA}return 0}var S=this,p,V=[],ea=null,da=null,ha=-1,ga=null,ka=0,na=null,aa=null,W=null,U=null,ia=null,ja=null,ta=null,la=null,ca=0,pa=0,ra=0,sa=0,ya=[new THREE.Vector4,new THREE.Vector4, -new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Ga=new Float32Array(16),Fa=new Float32Array(16),Da=new THREE.Vector4,za={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},L=b.canvas!==void 0?b.canvas:document.createElement("canvas"),M=b.stencil!==void 0?b.stencil:!0,fa=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,qa=b.antialias!==void 0?b.antialias:!1,P=b.clearColor!== -void 0?new THREE.Color(b.clearColor):new THREE.Color(0),ma=b.clearAlpha!==void 0?b.clearAlpha:0,ua=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=L;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar= -5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=!0;var oa,Ea=[],b=THREE.ShaderLib.depthRGBA,Ia=THREE.UniformsUtils.clone(b.uniforms),Ba=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Ia}),va=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Ia,morphTargets:!0});Ba._shadowPass=!0;va._shadowPass=!0;try{if(!(p=L.getContext("experimental-webgl",{antialias:qa,stencil:M, -preserveDrawingBuffer:fa})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+p.getParameter(p.VERSION)+" | "+p.getParameter(p.VENDOR)+" | "+p.getParameter(p.RENDERER)+" | "+p.getParameter(p.SHADING_LANGUAGE_VERSION))}catch(Ka){console.error(Ka)}p.clearColor(0,0,0,1);p.clearDepth(1);p.clearStencil(0);p.enable(p.DEPTH_TEST);p.depthFunc(p.LEQUAL);p.frontFace(p.CCW);p.cullFace(p.BACK);p.enable(p.CULL_FACE);p.enable(p.BLEND);p.blendEquation(p.FUNC_ADD);p.blendFunc(p.SRC_ALPHA, -p.ONE_MINUS_SRC_ALPHA);p.clearColor(P.r,P.g,P.b,ma);this.context=p;var Ha=p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,X={};X.vertices=new Float32Array(16);X.faces=new Uint16Array(6);M=0;X.vertices[M++]=-1;X.vertices[M++]=-1;X.vertices[M++]=0;X.vertices[M++]=1;X.vertices[M++]=1;X.vertices[M++]=-1;X.vertices[M++]=1;X.vertices[M++]=1;X.vertices[M++]=1;X.vertices[M++]=1;X.vertices[M++]=1;X.vertices[M++]=0;X.vertices[M++]=-1;X.vertices[M++]=1;X.vertices[M++]=0;M=X.vertices[M++]=0;X.faces[M++]=0; -X.faces[M++]=1;X.faces[M++]=2;X.faces[M++]=0;X.faces[M++]=2;X.faces[M++]=3;X.vertexBuffer=p.createBuffer();X.elementBuffer=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,X.vertexBuffer);p.bufferData(p.ARRAY_BUFFER,X.vertices,p.STATIC_DRAW);p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,X.elementBuffer);p.bufferData(p.ELEMENT_ARRAY_BUFFER,X.faces,p.STATIC_DRAW);X.program=p.createProgram();p.attachShader(X.program,Q("fragment",THREE.ShaderLib.sprite.fragmentShader));p.attachShader(X.program,Q("vertex",THREE.ShaderLib.sprite.vertexShader)); -p.linkProgram(X.program);X.attributes={};X.uniforms={};X.attributes.position=p.getAttribLocation(X.program,"position");X.attributes.uv=p.getAttribLocation(X.program,"uv");X.uniforms.uvOffset=p.getUniformLocation(X.program,"uvOffset");X.uniforms.uvScale=p.getUniformLocation(X.program,"uvScale");X.uniforms.rotation=p.getUniformLocation(X.program,"rotation");X.uniforms.scale=p.getUniformLocation(X.program,"scale");X.uniforms.alignment=p.getUniformLocation(X.program,"alignment");X.uniforms.color=p.getUniformLocation(X.program, -"color");X.uniforms.map=p.getUniformLocation(X.program,"map");X.uniforms.opacity=p.getUniformLocation(X.program,"opacity");X.uniforms.useScreenCoordinates=p.getUniformLocation(X.program,"useScreenCoordinates");X.uniforms.affectedByDistance=p.getUniformLocation(X.program,"affectedByDistance");X.uniforms.screenPosition=p.getUniformLocation(X.program,"screenPosition");X.uniforms.modelViewMatrix=p.getUniformLocation(X.program,"modelViewMatrix");X.uniforms.projectionMatrix=p.getUniformLocation(X.program, -"projectionMatrix");var Xa=!1;this.setSize=function(b,c){L.width=b;L.height=c;this.setViewport(0,0,L.width,L.height)};this.setViewport=function(b,c,e,f){ca=b;pa=c;ra=e;sa=f;p.viewport(ca,pa,ra,sa)};this.setScissor=function(b,c,e,f){p.scissor(b,c,e,f)};this.enableScissorTest=function(b){b?p.enable(p.SCISSOR_TEST):p.disable(p.SCISSOR_TEST)};this.setClearColorHex=function(b,c){P.setHex(b);ma=c;p.clearColor(P.r,P.g,P.b,ma)};this.setClearColor=function(b,c){P.copy(b);ma=c;p.clearColor(P.r,P.g,P.b,ma)}; -this.getClearColor=function(){return P};this.getClearAlpha=function(){return ma};this.clear=function(b,c,e){var f=0;if(b==void 0||b)f|=p.COLOR_BUFFER_BIT;if(c==void 0||c)f|=p.DEPTH_BUFFER_BIT;if(e==void 0||e)f|=p.STENCIL_BUFFER_BIT;p.clear(f)};this.getContext=function(){return p};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c= -b.geometry.geometryGroups[g];p.deleteBuffer(c.__webglVertexBuffer);p.deleteBuffer(c.__webglNormalBuffer);p.deleteBuffer(c.__webglTangentBuffer);p.deleteBuffer(c.__webglColorBuffer);p.deleteBuffer(c.__webglUVBuffer);p.deleteBuffer(c.__webglUV2Buffer);p.deleteBuffer(c.__webglSkinVertexABuffer);p.deleteBuffer(c.__webglSkinVertexBBuffer);p.deleteBuffer(c.__webglSkinIndicesBuffer);p.deleteBuffer(c.__webglSkinWeightsBuffer);p.deleteBuffer(c.__webglFaceBuffer);p.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var e= -0,f=c.numMorphTargets;e=0&&p.enableVertexAttribArray(x.position);x.color>=0&&p.enableVertexAttribArray(x.color);x.normal>=0&&p.enableVertexAttribArray(x.normal);x.tangent>=0&&p.enableVertexAttribArray(x.tangent);b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(p.enableVertexAttribArray(x.skinVertexA), -p.enableVertexAttribArray(x.skinVertexB),p.enableVertexAttribArray(x.skinIndex),p.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(h in b.attributes)x[h]!==void 0&&x[h]>=0&&p.enableVertexAttribArray(x[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h=0&&(p.enableVertexAttribArray(x[L]),b.numSupportedMorphTargets++);b.uniformsList=[];for(k in b.uniforms)b.uniformsList.push([b.uniforms[k],k])};this.clearTarget=function(b,c,e,f){H(b); -this.clear(c,e,f)};this.render=function(b,c,o,L){var M,fa,F,C,G,qa,B,la,J=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&y(b,c);S.info.render.calls=0;S.info.render.vertices=0;S.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Fa);c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);u(Ca);this.initWebGLObjects(b);H(o);(this.autoClear||L)&&this.clear(this.autoClearColor, -this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(L=0;L=0;L--)if(M=b.__webglObjects[L],M.render){B=M.object;la=M.buffer;F=M.opaque;k(B);for(M=0;M0||x.faceVertexUvs.length>0)m.__uvArray=new Float32Array(o*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(o*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray= -new Float32Array(o*4),m.__skinVertexBArray=new Float32Array(o*4),m.__skinIndexArray=new Float32Array(o*4),m.__skinWeightArray=new Float32Array(o*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(z*2);if(m.numMorphTargets){m.__morphTargetsArrays=[];x=0;for(L=m.numMorphTargets;x=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0, -1)}e=0;for(f=b.__webglObjects.length;e0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglColorBuffer),p.bufferData(p.ARRAY_BUFFER,da,y));Ga&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglNormalBuffer),p.bufferData(p.ARRAY_BUFFER,ga,y));Da&&va.hasTangents&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglTangentBuffer),p.bufferData(p.ARRAY_BUFFER,ha,y));Ha&&ra>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglUVBuffer),p.bufferData(p.ARRAY_BUFFER,ia,y));Ha&&T>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglUV2Buffer),p.bufferData(p.ARRAY_BUFFER,Ea,y));Ca&&(p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, -t.__webglFaceBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,Ba,y),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,ta,y));R>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexABuffer),p.bufferData(p.ARRAY_BUFFER,ja,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexBBuffer),p.bufferData(p.ARRAY_BUFFER,sa,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),p.bufferData(p.ARRAY_BUFFER,aa,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),p.bufferData(p.ARRAY_BUFFER, -ea,y));z&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray,delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}k.__dirtyVertices=!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(m)}else if(h instanceof THREE.Ribbon){k= -h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=p.DYNAMIC_DRAW;n=x=z=z=void 0;u=h.vertices;o=h.colors;v=u.length;t=o.length;L=h.__vertexArray;y=h.__colorArray;M=h.__dirtyColors;if(h.__dirtyVertices){for(z=0;z0,X={};X.vertices=new Float32Array(16);X.faces=new Uint16Array(6);O=0;X.vertices[O++]=-1;X.vertices[O++]=-1;X.vertices[O++]=0;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=-1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=0;X.vertices[O++]=-1; +X.vertices[O++]=1;X.vertices[O++]=0;O=X.vertices[O++]=0;X.faces[O++]=0;X.faces[O++]=1;X.faces[O++]=2;X.faces[O++]=0;X.faces[O++]=2;X.faces[O++]=3;X.vertexBuffer=p.createBuffer();X.elementBuffer=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,X.vertexBuffer);p.bufferData(p.ARRAY_BUFFER,X.vertices,p.STATIC_DRAW);p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,X.elementBuffer);p.bufferData(p.ELEMENT_ARRAY_BUFFER,X.faces,p.STATIC_DRAW);X.program=p.createProgram();p.attachShader(X.program,Q("fragment",THREE.ShaderLib.sprite.fragmentShader)); +p.attachShader(X.program,Q("vertex",THREE.ShaderLib.sprite.vertexShader));p.linkProgram(X.program);X.attributes={};X.uniforms={};X.attributes.position=p.getAttribLocation(X.program,"position");X.attributes.uv=p.getAttribLocation(X.program,"uv");X.uniforms.uvOffset=p.getUniformLocation(X.program,"uvOffset");X.uniforms.uvScale=p.getUniformLocation(X.program,"uvScale");X.uniforms.rotation=p.getUniformLocation(X.program,"rotation");X.uniforms.scale=p.getUniformLocation(X.program,"scale");X.uniforms.alignment= +p.getUniformLocation(X.program,"alignment");X.uniforms.color=p.getUniformLocation(X.program,"color");X.uniforms.map=p.getUniformLocation(X.program,"map");X.uniforms.opacity=p.getUniformLocation(X.program,"opacity");X.uniforms.useScreenCoordinates=p.getUniformLocation(X.program,"useScreenCoordinates");X.uniforms.affectedByDistance=p.getUniformLocation(X.program,"affectedByDistance");X.uniforms.screenPosition=p.getUniformLocation(X.program,"screenPosition");X.uniforms.modelViewMatrix=p.getUniformLocation(X.program, +"modelViewMatrix");X.uniforms.projectionMatrix=p.getUniformLocation(X.program,"projectionMatrix");var Xa=!1;this.setSize=function(b,c){S.width=b;S.height=c;this.setViewport(0,0,S.width,S.height)};this.setViewport=function(b,c,e,f){ca=b;pa=c;ra=e;sa=f;p.viewport(ca,pa,ra,sa)};this.setScissor=function(b,c,e,f){p.scissor(b,c,e,f)};this.enableScissorTest=function(b){b?p.enable(p.SCISSOR_TEST):p.disable(p.SCISSOR_TEST)};this.setClearColorHex=function(b,c){N.setHex(b);ma=c;p.clearColor(N.r,N.g,N.b,ma)}; +this.setClearColor=function(b,c){N.copy(b);ma=c;p.clearColor(N.r,N.g,N.b,ma)};this.getClearColor=function(){return N};this.getClearAlpha=function(){return ma};this.clear=function(b,c,e){var f=0;if(b==void 0||b)f|=p.COLOR_BUFFER_BIT;if(c==void 0||c)f|=p.DEPTH_BUFFER_BIT;if(e==void 0||e)f|=p.STENCIL_BUFFER_BIT;p.clear(f)};this.getContext=function(){return p};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray, +delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];p.deleteBuffer(c.__webglVertexBuffer);p.deleteBuffer(c.__webglNormalBuffer);p.deleteBuffer(c.__webglTangentBuffer);p.deleteBuffer(c.__webglColorBuffer);p.deleteBuffer(c.__webglUVBuffer);p.deleteBuffer(c.__webglUV2Buffer);p.deleteBuffer(c.__webglSkinVertexABuffer);p.deleteBuffer(c.__webglSkinVertexBBuffer);p.deleteBuffer(c.__webglSkinIndicesBuffer);p.deleteBuffer(c.__webglSkinWeightsBuffer); +p.deleteBuffer(c.__webglFaceBuffer);p.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var e=0,f=c.numMorphTargets;e=0&&p.enableVertexAttribArray(x.position);x.color>=0&&p.enableVertexAttribArray(x.color);x.normal>=0&&p.enableVertexAttribArray(x.normal);x.tangent>=0&&p.enableVertexAttribArray(x.tangent); +b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(p.enableVertexAttribArray(x.skinVertexA),p.enableVertexAttribArray(x.skinVertexB),p.enableVertexAttribArray(x.skinIndex),p.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(h in b.attributes)x[h]!==void 0&&x[h]>=0&&p.enableVertexAttribArray(x[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h=0&&(p.enableVertexAttribArray(x[A]),b.numSupportedMorphTargets++); +b.uniformsList=[];for(k in b.uniforms)b.uniformsList.push([b.uniforms[k],k])};this.clearTarget=function(b,c,e,f){H(b);this.clear(c,e,f)};this.render=function(b,c,o,S){var O,da,F,C,G,qa,B,la,J=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&A(b,c);P.info.render.calls=0;P.info.render.vertices=0;P.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Fa);c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix, +c.matrixWorldInverse);t(Ca);this.initWebGLObjects(b);H(o);(this.autoClear||S)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(S=0;S=0;S--)if(O=b.__webglObjects[S],O.render){B=O.object;la=O.buffer;F=O.opaque;k(B);for(O=0;O0||x.faceVertexUvs.length>0)m.__uvArray=new Float32Array(o* +2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(o*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(o*4),m.__skinVertexBArray=new Float32Array(o*4),m.__skinIndexArray=new Float32Array(o*4),m.__skinWeightArray=new Float32Array(o*4);m.__faceArray=new Uint16Array(A*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(S*2);if(m.numMorphTargets){m.__morphTargetsArrays=[];x=0;for(y= +m.numMorphTargets;x=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglColorBuffer),p.bufferData(p.ARRAY_BUFFER,ea,A));Ga&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglNormalBuffer),p.bufferData(p.ARRAY_BUFFER,ga,A));Da&&va.hasTangents&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglTangentBuffer),p.bufferData(p.ARRAY_BUFFER,ha,A));Ha&&ra>0&&(p.bindBuffer(p.ARRAY_BUFFER, +t.__webglUVBuffer),p.bufferData(p.ARRAY_BUFFER,ia,A));Ha&&T>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglUV2Buffer),p.bufferData(p.ARRAY_BUFFER,Ea,A));Ca&&(p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,Ba,A),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,ta,A));R>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexABuffer),p.bufferData(p.ARRAY_BUFFER,ja,A),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexBBuffer), +p.bufferData(p.ARRAY_BUFFER,sa,A),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),p.bufferData(p.ARRAY_BUFFER,aa,A),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),p.bufferData(p.ARRAY_BUFFER,fa,A));S&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray,delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}k.__dirtyVertices= +!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(m)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=p.DYNAMIC_DRAW;n=x=S=S=void 0;u=h.vertices;o=h.colors;v=u.length;t=o.length;y=h.__vertexArray;A=h.__colorArray;z=h.__dirtyColors;if(h.__dirtyVertices){for(S=0;S1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=m;c.v=k;return c}, clamp:function(b,c,e){return be?e:b}};THREE.ColorUtils.__hsv={h:0,s:0,v:0}; -THREE.GeometryUtils={merge:function(b,c){var e,f,h=b.vertices.length,k=c instanceof THREE.Mesh?c.geometry:c,m=b.vertices,n=k.vertices,t=b.faces,u=k.faces,w=b.faceVertexUvs[0],k=k.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var o=0,x=n.length;o1&&(f=1-f,h=1-h);k=1-f-h;m.copy(b);m.multiplyScalar(f);n.copy(c);n.multiplyScalar(h);m.addSelf(n);n.copy(e);n.multiplyScalar(k);m.addSelf(n);return m},randomPointInFace:function(b,c,e){var f,h,k;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,h=c.vertices[b.b].position,k=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,h,k);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;h=c.vertices[b.b].position;k=c.vertices[b.c].position;var c=c.vertices[b.d].position, -m;e?b._area1&&b._area2?(e=b._area1,m=b._area2):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c),b._area1=e,b._area2=m):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c));return THREE.GeometryUtils.random()*(e+m) -b?c(e,k-1):u[k] +b?c(e,k-1):t[k]0)n=f-1;else{n=f;break}f=n;if(e[f]==k)return f/(h-1);m=e[f];return e=(f+(k-m)/(e[f+1]-m))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)}; +THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,h=e.length,k;k=c?c:b*e[h-1];time=Date.now();for(var m=0,n=h-1,u;m<=n;)if(f=Math.floor(m+(n-m)/2),u=e[f]-k,u<0)m=f+1;else if(u>0)n=f-1;else{n=f;break}f=n;if(e[f]==k)return f/(h-1);m=e[f];return e=(f+(k-m)/(e[f+1]-m))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)}; THREE.Curve.prototype.getTangent=function(b){var c=b-1.0E-4;b+=1.0E-4;c<0&&(c=0);b>1&&(b=1);var c=this.getPoint(c),b=this.getPoint(b),e=new THREE.Vector2;e.sub(b,c);return e.unit()};THREE.LineCurve=function(b,c){b instanceof THREE.Vector2?(this.v1=b,this.v2=c):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(b,c,e,f){this.constructor(new THREE.Vector2(b,c),new THREE.Vector2(e,f))};THREE.LineCurve.prototype=new THREE.Curve; THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2;c.sub(this.v2,this.v1);c.multiplyScalar(b).addSelf(this.v1);return c};THREE.LineCurve.prototype.getPointAt=function(b){return this.getPoint(b)};THREE.LineCurve.prototype.getTangent=function(){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.normalize();return b}; THREE.QuadraticBezierCurve=function(b,c,e){if(!(c instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),b=new THREE.Vector2(f[0],f[1]),c=new THREE.Vector2(f[2],f[3]),e=new THREE.Vector2(f[4],f[5]);this.v0=b;this.v1=c;this.v2=e};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; @@ -387,47 +390,47 @@ THREE.SplineCurve3=THREE.Curve.create(function(b){this.points=b},function(b){var THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(b){this.curves.push(b)};THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){}; THREE.CurvePath.prototype.getPoint=function(b){for(var c=b*this.getLength(),e=this.getCurveLengths(),b=0;b=c)return c=e[b]-c,b=this.curves[b],c=1-c/b.getLength(),b.getPointAt(c);b++}return null};THREE.CurvePath.prototype.getLength=function(){var b=this.getCurveLengths();return b[b.length-1]}; THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var b=[],c=0,e,f=this.curves.length;for(e=0;ec)c=k.x;else if(k.xe)e=k.y;else if(k.yc)c=k.x;else if(k.xe)e=k.y;else if(k.y0?(m=e[e.length-1],v=m.x,z=m.y):(m=this.actions[f-1].args,v=m[m.length-2],z=m[m.length-1]);for(m=1;m<=b;m++)y=m/b,k=THREE.Shape.Utils.b2(y,v,o,n),y=THREE.Shape.Utils.b2(y,z,x, -t),e.push(new THREE.Vector2(k,y));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];t=k[5];o=k[0];x=k[1];u=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,z=m.y):(m=this.actions[f-1].args,v=m[m.length-2],z=m[m.length-1]);for(m=1;m<=b;m++)y=m/b,k=THREE.Shape.Utils.b3(y,v,o,u,n),y=THREE.Shape.Utils.b3(y,z,x,w,t),e.push(new THREE.Vector2(k,y));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];y=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m); -for(m=1;m<=y;m++)e.push(k.getPointAt(m/y));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];t=k[1];u=k[2];o=k[3];y=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);z=y-o;var A=b*2;for(m=1;m<=A;m++)y=m/A,x||(y=1-y),y=o+y*z,k=w+n+u*Math.cos(y),y=v+t+u*Math.sin(y),e.push(new THREE.Vector2(k,y))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)}; -THREE.Path.prototype.nltransform=function(b,c,e,f,h,k){var m=this.getPoints(),n,t,u,w,o;n=0;for(t=m.length;n0?(m=e[e.length-1],v=m.x,z=m.y):(m=this.actions[f-1].args,v=m[m.length-2],z=m[m.length-1]);for(m=1;m<=b;m++)A=m/b,k=THREE.Shape.Utils.b2(A,v,o,n),A=THREE.Shape.Utils.b2(A,z,x, +u),e.push(new THREE.Vector2(k,A));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];u=k[5];o=k[0];x=k[1];t=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,z=m.y):(m=this.actions[f-1].args,v=m[m.length-2],z=m[m.length-1]);for(m=1;m<=b;m++)A=m/b,k=THREE.Shape.Utils.b3(A,v,o,t,n),A=THREE.Shape.Utils.b3(A,z,x,w,u),e.push(new THREE.Vector2(k,A));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];A=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m); +for(m=1;m<=A;m++)e.push(k.getPointAt(m/A));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];u=k[1];t=k[2];o=k[3];A=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);z=A-o;var y=b*2;for(m=1;m<=y;m++)A=m/y,x||(A=1-A),A=o+A*z,k=w+n+t*Math.cos(A),A=v+u+t*Math.sin(A),e.push(new THREE.Vector2(k,A))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)}; +THREE.Path.prototype.nltransform=function(b,c,e,f,h,k){var m=this.getPoints(),n,u,t,w,o;n=0;for(u=m.length;n=0?n-1:e.length-1;k=m-1>=0?m-1:u.length-1;var y=[u[m],e[n],e[h]];o=THREE.FontUtils.Triangulate.area(y);var A=[u[m],u[k],e[n]];x=THREE.FontUtils.Triangulate.area(A);v=n;w=m;n+=1;m+=-1;n< -0&&(n+=e.length);n%=e.length;m<0&&(m+=u.length);m%=u.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:u.length-1;y=[u[m],e[n],e[h]];y=THREE.FontUtils.Triangulate.area(y);A=[u[m],u[k],e[n]];A=THREE.FontUtils.Triangulate.area(A);o+x>y+A&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=u.length),m%=u.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:u.length-1);o=e.slice(0,n);x=e.slice(n);v=u.slice(m);w=u.slice(0,m);k=[u[m],u[k],e[n]];z.push([u[m],e[n],e[h]]);z.push(k);e=o.concat(v).concat(w).concat(x)}return{shape:e, -isolatedPts:z,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,t,u={};k=0;for(m=f.length;k=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;var A=[t[m],e[n],e[h]];o=THREE.FontUtils.Triangulate.area(A);var y=[t[m],t[k],e[n]];x=THREE.FontUtils.Triangulate.area(y);v=n;w=m;n+=1;m+=-1;n< +0&&(n+=e.length);n%=e.length;m<0&&(m+=t.length);m%=t.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;A=[t[m],e[n],e[h]];A=THREE.FontUtils.Triangulate.area(A);y=[t[m],t[k],e[n]];y=THREE.FontUtils.Triangulate.area(y);o+x>A+y&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=t.length),m%=t.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:t.length-1);o=e.slice(0,n);x=e.slice(n);v=t.slice(m);w=t.slice(0,m);k=[t[m],t[k],e[n]];z.push([t[m],e[n],e[h]]);z.push(k);e=o.concat(v).concat(w).concat(x)}return{shape:e, +isolatedPts:z,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,u,t={};k=0;for(m=f.length;k1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= +THREE.Animation.prototype.update=function(b){if(this.isPlaying){var c=["pos","rot","scl"],e,f,h,k,m,n,u,t,w=this.data.JIT.hierarchy,o,x;this.currentTime+=b*this.timeScale;x=this.currentTime;o=this.currentTime%=this.data.length;t=parseInt(Math.min(o*this.data.fps,this.data.length*this.data.fps),10);for(var v=0,z=this.hierarchy.length;v1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= this.getPrevKeyWith("pos",v,m.index-1).pos,this.points[1]=h,this.points[2]=k,this.points[3]=this.getNextKeyWith("pos",v,n.index+1).pos,f=f*0.33+0.33,h=this.interpolateCatmullRom(this.points,f),e.x=h[0],e.y=h[1],e.z=h[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e=== -"rot")THREE.Quaternion.slerp(h,k,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f}}if(this.JITCompile&&w[0][u]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;vb.length-2?k:k+1;e[3]=k>b.length-3?k:k+2;k=b[e[0]];n=b[e[1]];t=b[e[2]];u=b[e[3]];e=h*h;m=h*e;f[0]=this.interpolate(k[0],n[0],t[0],u[0],h,e,m);f[1]=this.interpolate(k[1],n[1],t[1],u[1],h,e,m);f[2]=this.interpolate(k[2],n[2],t[2],u[2],h,e,m);return f}; +"rot")THREE.Quaternion.slerp(h,k,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f}}if(this.JITCompile&&w[0][t]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;vb.length-2?k:k+1;e[3]=k>b.length-3?k:k+2;k=b[e[0]];n=b[e[1]];u=b[e[2]];t=b[e[3]];e=h*h;m=h*e;f[0]=this.interpolate(k[0],n[0],u[0],t[0],h,e,m);f[1]=this.interpolate(k[1],n[1],u[1],t[1],h,e,m);f[2]=this.interpolate(k[2],n[2],u[2],t[2],h,e,m);return f}; THREE.Animation.prototype.interpolate=function(b,c,e,f,h,k,m){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*m+(-3*(c-e)-2*b-f)*k+b*h+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,e){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e=e0?e:0:e>=0?e:e+f.length;e>=0;e--)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[f.length-1]}; THREE.CubeCamera=function(b,c,e,f){this.heightOffset=e;this.position=new THREE.Vector3(0,e,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position= @@ -447,7 +450,7 @@ b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown=function(b){sw Math.PI/180;var b=this.target,c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta)}b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*e;this.lookVertical&&(this.lat-=this.mouseY*e*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax- this.verticalMin)/(Math.PI-0)+this.verticalMin;b=this.target;c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(b)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",e(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",e(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup", e(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",e(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",e(this,this.onKeyUp),!1)}; -THREE.PathControls=function(b,c){function e(b){if((b*=2)<1)return 0.5*b*b;return-0.5*(--b*(b-2)-1)}function f(b,e){return function(){e.apply(b,arguments)}}function h(b,e,c,f){var k={name:c,fps:0.6,length:f,hierarchy:[]},h,m=e.getControlPointsArray(),n=e.getLength(),A=m.length,E=0;h=A-1;e={parent:-1,keys:[]};e.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};e.keys[h]={time:f,pos:m[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h=0?b:b+m;b=this.verticalAngleMap.srcRange; @@ -465,201 +468,201 @@ THREE.FlyControls=function(b,c){function e(b,e){return function(){e.apply(b,argu 1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion);this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var b=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back}; this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0, 0]}};this.domElement.addEventListener("mousemove",e(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",e(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",e(this,this.mouseup),!1);this.domElement.addEventListener("keydown",e(this,this.keydown),!1);this.domElement.addEventListener("keyup",e(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(b,c){this.object=b;this.domElement=c!==void 0?c:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Matrix4,m=!1,n=1,t=0,u=0,w=0,o=0,x=0,v=window.innerWidth/2,z=window.innerHeight/2;this.update=function(){var b= -(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.delta=(b-this.lastUpdate)/1E3;this.lastUpdate=b;this.mouseLook&&(b=this.delta*this.lookSpeed,this.rotateHorizontally(b*o),this.rotateVertically(b*x));b=this.delta*this.movementSpeed;this.object.translateZ(-b*(t>0||this.autoForward&&!(t<0)?1:t));this.object.translateX(b*u);this.object.translateY(b*w);m&&(this.roll+=this.rollSpeed*this.delta*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize(); +THREE.RollControls=function(b,c){this.object=b;this.domElement=c!==void 0?c:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Matrix4,m=!1,n=1,u=0,t=0,w=0,o=0,x=0,v=window.innerWidth/2,z=window.innerHeight/2;this.update=function(){var b= +(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.delta=(b-this.lastUpdate)/1E3;this.lastUpdate=b;this.mouseLook&&(b=this.delta*this.lookSpeed,this.rotateHorizontally(b*o),this.rotateVertically(b*x));b=this.delta*this.movementSpeed;this.object.translateZ(-b*(u>0||this.autoForward&&!(u<0)?1:u));this.object.translateX(b*t);this.object.translateY(b*w);m&&(this.roll+=this.rollSpeed*this.delta*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize(); else if(this.forward.y1?c.normalize():c.z=Math.sqrt(1-f*f);k.copy(this.object.position).subSelf(this.target);f=this.object.up.clone().setLength(c.y);f.addSelf(this.object.up.clone().crossSelf(k).setLength(c.x));f.addSelf(k.setLength(c.z));return f};this.rotateCamera=function(){var b=Math.acos(m.dot(n)/m.length()/n.length());if(b){var e=(new THREE.Vector3).cross(m,n).normalize(),c=new THREE.Quaternion;b*=this.rotateSpeed;c.setFromAxisAngle(e, --b);c.multiplyVector3(k);c.multiplyVector3(this.object.up);c.multiplyVector3(n);this.staticMoving?m=n:(c.setFromAxisAngle(e,b*(this.dynamicDampingFactor-1)),c.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(u.y-t.y)*this.zoomSpeed;b!==1&&b>0&&(k.multiplyScalar(b),this.staticMoving?t=u:t.y+=(u.y-t.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=o.clone().subSelf(w);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var e=k.clone().crossSelf(this.object.up).setLength(b.x); +-b);c.multiplyVector3(k);c.multiplyVector3(this.object.up);c.multiplyVector3(n);this.staticMoving?m=n:(c.setFromAxisAngle(e,b*(this.dynamicDampingFactor-1)),c.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(t.y-u.y)*this.zoomSpeed;b!==1&&b>0&&(k.multiplyScalar(b),this.staticMoving?u=t:u.y+=(t.y-u.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=o.clone().subSelf(w);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var e=k.clone().crossSelf(this.object.up).setLength(b.x); e.addSelf(this.object.up.clone().setLength(b.y));this.object.position.addSelf(e);this.target.addSelf(e);this.staticMoving?w=o:w.addSelf(b.sub(o,w).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;nb&&(b+=Math.PI*2),anglec=(e+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function h(b){for(H=b.length;--H>=0;){ka=H;na=H-1;na<0&&(na=b.length- -1);for(var e=0,c=v+w*2,e=0;e=0;Q--){Z=Q/w;$=t*(1-Z);Z=u*Math.sin(Z*Math.PI/2);H=0;for(T=F.length;H=0;Q--){Z=Q/w;$=u*(1-Z);Z=t*Math.sin(Z*Math.PI/2);H=0;for(T=F.length;H0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,n,x)))-1);u.push(w)}c.push(u)}for(var v,z,y,h=c.length,e=0;e0)for(f=0;f1&&(v= -this.vertices[m].position.clone(),z=this.vertices[t].position.clone(),y=this.vertices[u].position.clone(),v.normalize(),z.normalize(),y.normalize(),this.faces.push(new THREE.Face3(m,t,u,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(y.x,y.y,y.z)])),this.faceVertexUvs[0].push([w,o,A]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry; +THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f,h=Math.PI,k=Math.max(3,c||8),m=Math.max(2,e||6),c=[],e=0;e0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,n,x)))-1);t.push(w)}c.push(t)}for(var v,z,A,h=c.length,e=0;e0)for(f=0;f1&&(v= +this.vertices[m].position.clone(),z=this.vertices[u].position.clone(),A=this.vertices[t].position.clone(),v.normalize(),z.normalize(),A.normalize(),this.faces.push(new THREE.Face3(m,u,t,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(A.x,A.y,A.z)])),this.faceVertexUvs[0].push([w,o,y]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry; THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry; THREE.TextGeometry=function(b,c){var e=(new THREE.TextPath(b,c)).toShapes();c.amount=c.height!==void 0?c.height:50;if(c.bevelThickness===void 0)c.bevelThickness=10;if(c.bevelSize===void 0)c.bevelSize=8;if(c.bevelEnabled===void 0)c.bevelEnabled=!1;if(c.bend){var f=e[e.length-1].getBoundingBox().maxX;c.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(f/2,120),new THREE.Vector2(f,0))}THREE.ExtrudeGeometry.call(this,e,c)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry; THREE.TextGeometry.prototype.constructor=THREE.TextGeometry; THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(b,c){return(new TextPath(b,c)).toShapes()},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var c= -this.getFace(),e=this.size/c.resolution,f=0,h=String(b).split(""),k=h.length,m=[],b=0;b0)for(u=0;u2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}t=u;h<=t&&(t=0);u=t+1;h<=u&&(u=0);w=u+1;h<=w&&(w=0);var x;a:{x=b;var v=t,z=u,y=w,A=h,E=m,F=void 0,C=void 0,G=void 0, -J=void 0,O=void 0,K=void 0,B=void 0,N=void 0,Y=void 0,C=x[E[v]].x,G=x[E[v]].y,J=x[E[z]].x,O=x[E[z]].y,K=x[E[y]].x,B=x[E[y]].y;if(1.0E-10>(J-C)*(B-G)-(O-G)*(K-C))x=!1;else{for(F=0;F=0&&Q>=0&&$>=0){x=!1;break a}}x= -!0}}if(x){k.push([b[m[t]],b[m[u]],b[m[w]]]);n.push([m[t],m[u],m[w]]);t=u;for(w=u+1;w0)for(t=0;t2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}u=t;h<=u&&(u=0);t=u+1;h<=t&&(t=0);w=t+1;h<=w&&(w=0);var x;a:{x=b;var v=u,z=t,A=w,y=h,E=m,F=void 0,C=void 0,G=void 0, +J=void 0,M=void 0,K=void 0,B=void 0,L=void 0,Y=void 0,C=x[E[v]].x,G=x[E[v]].y,J=x[E[z]].x,M=x[E[z]].y,K=x[E[A]].x,B=x[E[A]].y;if(1.0E-10>(J-C)*(B-G)-(M-G)*(K-C))x=!1;else{for(F=0;F=0&&Q>=0&&$>=0){x=!1;break a}}x= +!0}}if(x){k.push([b[m[u]],b[m[t]],b[m[w]]]);n.push([m[u],m[t],m[w]]);u=t;for(w=t+1;w0;)this.smooth(b)}; -THREE.SubdivisionModifier.prototype.smooth=function(b){function c(b,e,c,f,n,t){var v=new THREE.Face4(b,e,c,f,null,n.color,n.material);if(m.useOldVertexColors){v.vertexColors=[];for(var u,p,w,x=0;x<4;x++){w=t[x];u=new THREE.Color;u.setRGB(0,0,0);for(var y=0;y>7)-127;f|=(h&127)<<16|k<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,e){var c=w(b,e),f=w(b,e+1),k=w(b,e+2);return(w(b,e+3)<<24)+(k<<16)+(f<<8)+c}function t(b,e){var c=w(b,e);return(w(b,e+1)<<8)+c}function u(b,e){var c=w(b,e);return c>127?c-256:c}function w(b,e){return b.charCodeAt(e)&255}function o(e){var c, -f,k;c=h(b,e);f=h(b,e+O);k=h(b,e+K);e=t(b,e+B);E.faces.push(new THREE.Face3(c,f,k,null,null,E.materials[e]))}function x(e){var c,f,k,m,o,p;c=h(b,e);f=h(b,e+O);k=h(b,e+K);m=t(b,e+B);o=h(b,e+N);p=h(b,e+Y);e=h(b,e+H);m=E.materials[m];var u=G[p*3],v=G[p*3+1];p=G[p*3+2];var w=G[e*3],x=G[e*3+1],e=G[e*3+2];E.faces.push(new THREE.Face3(c,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(u,v,p),new THREE.Vector3(w,x,e)],null,m))}function v(e){var c,f,k,m;c=h(b,e);f=h(b,e+T);k=h(b,e+Q);m=h(b, -e+Z);e=t(b,e+$);E.faces.push(new THREE.Face4(c,f,k,m,null,null,E.materials[e]))}function z(e){var c,f,k,m,o,u,v,w;c=h(b,e);f=h(b,e+T);k=h(b,e+Q);m=h(b,e+Z);o=t(b,e+$);u=h(b,e+S);v=h(b,e+p);w=h(b,e+V);e=h(b,e+ea);o=E.materials[o];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var L=G[w*3],M=G[w*3+1];w=G[w*3+2];var z=G[e*3],A=G[e*3+1],e=G[e*3+2];E.faces.push(new THREE.Face4(c,f,k,m,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(L,M,w),new THREE.Vector3(z,A,e)],null,o))} -function y(e){var c,f,k,m;c=h(b,e);f=h(b,e+da);k=h(b,e+ha);e=J[c*2];m=J[c*2+1];c=J[f*2];var o=E.faceVertexUvs[0];f=J[f*2+1];var p=J[k*2];k=J[k*2+1];var t=[];t.push(new THREE.UV(e,m));t.push(new THREE.UV(c,f));t.push(new THREE.UV(p,k));o.push(t)}function A(e){var c,f,k,m,o,p;c=h(b,e);f=h(b,e+ga);k=h(b,e+ka);m=h(b,e+na);e=J[c*2];o=J[c*2+1];c=J[f*2];p=J[f*2+1];f=J[k*2];var t=E.faceVertexUvs[0];k=J[k*2+1];var v=J[m*2];m=J[m*2+1];var u=[];u.push(new THREE.UV(e,o));u.push(new THREE.UV(c,p));u.push(new THREE.UV(f, -k));u.push(new THREE.UV(v,m));t.push(u)}var E=this,F=0,C,G=[],J=[],O,K,B,N,Y,H,T,Q,Z,$,S,p,V,ea,da,ha,ga,ka,na,aa,W,U,ia,ja,ta;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(E,f,e);C={signature:b.substr(F,8),header_bytes:w(b,F+8),vertex_coordinate_bytes:w(b,F+9),normal_coordinate_bytes:w(b,F+10),uv_coordinate_bytes:w(b,F+11),vertex_index_bytes:w(b,F+12),normal_index_bytes:w(b,F+13),uv_index_bytes:w(b,F+14),material_index_bytes:w(b,F+15),nvertices:h(b,F+16),nnormals:h(b,F+16+4),nuvs:h(b, -F+16+8),ntri_flat:h(b,F+16+12),ntri_smooth:h(b,F+16+16),ntri_flat_uv:h(b,F+16+20),ntri_smooth_uv:h(b,F+16+24),nquad_flat:h(b,F+16+28),nquad_smooth:h(b,F+16+32),nquad_flat_uv:h(b,F+16+36),nquad_smooth_uv:h(b,F+16+40)};F+=C.header_bytes;O=C.vertex_index_bytes;K=C.vertex_index_bytes*2;B=C.vertex_index_bytes*3;N=C.vertex_index_bytes*3+C.material_index_bytes;Y=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;H=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;T=C.vertex_index_bytes; -Q=C.vertex_index_bytes*2;Z=C.vertex_index_bytes*3;$=C.vertex_index_bytes*4;S=C.vertex_index_bytes*4+C.material_index_bytes;p=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;V=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;ea=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;da=C.uv_index_bytes;ha=C.uv_index_bytes*2;ga=C.uv_index_bytes;ka=C.uv_index_bytes*2;na=C.uv_index_bytes*3;e=C.vertex_index_bytes*3+C.material_index_bytes;ta=C.vertex_index_bytes* +THREE.BinaryLoader.prototype.createBinModel=function(b,c,e,f){var h=function(e){function c(b,e){var f=w(b,e),k=w(b,e+1),h=w(b,e+2),m=w(b,e+3),n=(m<<1&255|h>>7)-127;f|=(h&127)<<16|k<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,e){var c=w(b,e),f=w(b,e+1),k=w(b,e+2);return(w(b,e+3)<<24)+(k<<16)+(f<<8)+c}function u(b,e){var c=w(b,e);return(w(b,e+1)<<8)+c}function t(b,e){var c=w(b,e);return c>127?c-256:c}function w(b,e){return b.charCodeAt(e)&255}function o(e){var c, +f,k;c=h(b,e);f=h(b,e+M);k=h(b,e+K);e=u(b,e+B);E.faces.push(new THREE.Face3(c,f,k,null,null,E.materials[e]))}function x(e){var c,f,k,m,o,p;c=h(b,e);f=h(b,e+M);k=h(b,e+K);m=u(b,e+B);o=h(b,e+L);p=h(b,e+Y);e=h(b,e+H);m=E.materials[m];var t=G[p*3],v=G[p*3+1];p=G[p*3+2];var w=G[e*3],x=G[e*3+1],e=G[e*3+2];E.faces.push(new THREE.Face3(c,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(t,v,p),new THREE.Vector3(w,x,e)],null,m))}function v(e){var c,f,k,m;c=h(b,e);f=h(b,e+T);k=h(b,e+Q);m=h(b, +e+Z);e=u(b,e+$);E.faces.push(new THREE.Face4(c,f,k,m,null,null,E.materials[e]))}function z(e){var c,f,k,m,o,t,v,w;c=h(b,e);f=h(b,e+T);k=h(b,e+Q);m=h(b,e+Z);o=u(b,e+$);t=h(b,e+P);v=h(b,e+p);w=h(b,e+V);e=h(b,e+fa);o=E.materials[o];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var S=G[w*3],A=G[w*3+1];w=G[w*3+2];var z=G[e*3],B=G[e*3+1],e=G[e*3+2];E.faces.push(new THREE.Face4(c,f,k,m,[new THREE.Vector3(G[t*3],G[t*3+1],G[t*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(S,A,w),new THREE.Vector3(z,B,e)],null,o))} +function A(e){var c,f,k,m;c=h(b,e);f=h(b,e+ea);k=h(b,e+ha);e=J[c*2];m=J[c*2+1];c=J[f*2];var o=E.faceVertexUvs[0];f=J[f*2+1];var p=J[k*2];k=J[k*2+1];var t=[];t.push(new THREE.UV(e,m));t.push(new THREE.UV(c,f));t.push(new THREE.UV(p,k));o.push(t)}function y(e){var c,f,k,m,o,p;c=h(b,e);f=h(b,e+ga);k=h(b,e+ka);m=h(b,e+na);e=J[c*2];o=J[c*2+1];c=J[f*2];p=J[f*2+1];f=J[k*2];var t=E.faceVertexUvs[0];k=J[k*2+1];var u=J[m*2];m=J[m*2+1];var v=[];v.push(new THREE.UV(e,o));v.push(new THREE.UV(c,p));v.push(new THREE.UV(f, +k));v.push(new THREE.UV(u,m));t.push(v)}var E=this,F=0,C,G=[],J=[],M,K,B,L,Y,H,T,Q,Z,$,P,p,V,fa,ea,ha,ga,ka,na,aa,W,U,ia,ja,ta;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(E,f,e);C={signature:b.substr(F,8),header_bytes:w(b,F+8),vertex_coordinate_bytes:w(b,F+9),normal_coordinate_bytes:w(b,F+10),uv_coordinate_bytes:w(b,F+11),vertex_index_bytes:w(b,F+12),normal_index_bytes:w(b,F+13),uv_index_bytes:w(b,F+14),material_index_bytes:w(b,F+15),nvertices:h(b,F+16),nnormals:h(b,F+16+4),nuvs:h(b, +F+16+8),ntri_flat:h(b,F+16+12),ntri_smooth:h(b,F+16+16),ntri_flat_uv:h(b,F+16+20),ntri_smooth_uv:h(b,F+16+24),nquad_flat:h(b,F+16+28),nquad_smooth:h(b,F+16+32),nquad_flat_uv:h(b,F+16+36),nquad_smooth_uv:h(b,F+16+40)};F+=C.header_bytes;M=C.vertex_index_bytes;K=C.vertex_index_bytes*2;B=C.vertex_index_bytes*3;L=C.vertex_index_bytes*3+C.material_index_bytes;Y=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;H=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;T=C.vertex_index_bytes; +Q=C.vertex_index_bytes*2;Z=C.vertex_index_bytes*3;$=C.vertex_index_bytes*4;P=C.vertex_index_bytes*4+C.material_index_bytes;p=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;V=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;fa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;ea=C.uv_index_bytes;ha=C.uv_index_bytes*2;ga=C.uv_index_bytes;ka=C.uv_index_bytes*2;na=C.uv_index_bytes*3;e=C.vertex_index_bytes*3+C.material_index_bytes;ta=C.vertex_index_bytes* 4+C.material_index_bytes;aa=C.ntri_flat*e;W=C.ntri_smooth*(e+C.normal_index_bytes*3);U=C.ntri_flat_uv*(e+C.uv_index_bytes*3);ia=C.ntri_smooth_uv*(e+C.normal_index_bytes*3+C.uv_index_bytes*3);ja=C.nquad_flat*ta;e=C.nquad_smooth*(ta+C.normal_index_bytes*4);ta=C.nquad_flat_uv*(ta+C.uv_index_bytes*4);F+=function(e){for(var f,k,h,n=C.vertex_coordinate_bytes*3,o=e+C.nvertices*n;e=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];for(y=0;y=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];for(y=0;y1){o=new THREE.MeshFaceMaterial;for(j=0;j1?c[1].substr(0,e):"0";c[1].length=0,m=k.indexOf("(")>=0,n;if(h)f=k.split("."),k=f.shift(),f.shift();else if(m){n=k.split("(");k=n.shift(); for(f=0;fe){u=t.output[p];break}m=u!==void 0?u instanceof THREE.Matrix4? -m.multiply(m,u):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);e=m;c.push({time:b,pos:[e.n14,e.n24,e.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=c}this.updateMatrix();return this};o.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b0&&(this[c.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};Y.prototype.create=function(){var b={},e=this.transparency!==void 0&&this.transparency<1,c;for(c in this)switch(c){case "ambient":case "emission":case "diffuse":case "specular":var f=this[c];if(f instanceof N)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=la[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ga+f.init_from), +"instance_effect"){this.instance_effect=(new Z).parse(b.childNodes[e]);break}return this};L.prototype.isColor=function(){return this.texture==null};L.prototype.isTexture=function(){return this.texture!=null};L.prototype.parse=function(b){for(var e=0;e0&&(this[c.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};Y.prototype.create=function(){var b={},e=this.transparency!==void 0&&this.transparency<1,c;for(c in this)switch(c){case "ambient":case "emission":case "diffuse":case "specular":var f=this[c];if(f instanceof L)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=la[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ga+f.init_from), b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else c=="diffuse"?b.color=f.color.getHex():e||(b[c]=f.color.getHex());break;case "shininess":case "reflectivity":b[c]=this[c];break;case "transparency":if(e)b.transparent=!0,b.opacity=this[c],e=!0}b.shading=za;return this.material=new THREE.MeshLambertMaterial(b)};H.prototype.parse=function(b){for(var e=0;e=0,f=b.indexOf("(")>=0,k,h;if(c)e=b.split("."),b=e.shift(),h=e.shift();else if(f){k=b.split("(");b=k.shift();for(e=0;e=0,f=b.indexOf("(")>=0,k,h;if(c)e=b.split("."),b=e.shift(),h=e.shift();else if(f){k=b.split("(");b=k.shift();for(e=0;e1&&(Y=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(O,Y);object.name=v;object.position.set(C[0],C[1],C[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=F.visible;V.scene.add(object);V.objects[v]=object;F.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),V.scene.collisions.colliders.push(b)); -if(F.castsShadow)b=new THREE.ShadowVolume(O),V.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}}else C=F.position,r=F.rotation,q=F.quaternion,s=F.scale,q=0,object=new THREE.Object3D,object.name=v,object.position.set(C[0],C[1],C[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0], -s[1],s[2]),object.visible=F.visible!==void 0?F.visible:!1,V.scene.add(object),V.objects[v]=object,V.empties[v]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}function t(b){return function(c){V.geometries[b]=c;n();Z-=1;e.onLoadComplete();w()}}function u(b){return function(e){V.geometries[b]=e}}function w(){e.callbackProgress({totalModels:S,totalTextures:p,loadedModels:S-Z,loadedTextures:p-$},V);e.onLoadProgress();Z==0&&$==0&&c(V)}var o,x, -v,z,y,A,E,F,C,G,J,O,K,B,N,Y,H,T,Q,Z,$,S,p,V;T=b.data;N=new THREE.BinaryLoader;Q=new THREE.JSONLoader;$=Z=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in T.objects)if(F=T.objects[v],F.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(T.transform){b=T.transform.position;G=T.transform.rotation;var ea=T.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);G&&V.scene.rotation.set(G[0], -G[1],G[2]);ea&&V.scene.scale.set(ea[0],ea[1],ea[2]);(b||G||ea)&&V.scene.updateMatrix()}b=function(){$-=1;w();e.onLoadComplete()};for(y in T.cameras)G=T.cameras[y],G.type=="perspective"?K=new THREE.PerspectiveCamera(G.fov,G.aspect,G.near,G.far):G.type=="ortho"&&(K=new THREE.OrthographicCamera(G.left,G.right,G.top,G.bottom,G.near,G.far)),C=G.position,G=G.target,K.position.set(C[0],C[1],C[2]),K.target=new THREE.Vector3(G[0],G[1],G[2]),V.cameras[y]=K;for(z in T.lights)y=T.lights[z],K=y.color!==void 0? -y.color:16777215,G=y.intensity!==void 0?y.intensity:1,y.type=="directional"?(C=y.direction,H=new THREE.DirectionalLight(K,G),H.position.set(C[0],C[1],C[2]),H.position.normalize()):y.type=="point"?(C=y.position,d=y.distance,H=new THREE.PointLight(K,G,d),H.position.set(C[0],C[1],C[2])):y.type=="ambient"&&(H=new THREE.AmbientLight(K)),V.scene.add(H),V.lights[z]=H;for(A in T.fogs)z=T.fogs[A],z.type=="linear"?B=new THREE.Fog(0,z.near,z.far):z.type=="exp2"&&(B=new THREE.FogExp2(0,z.density)),G=z.color, -B.color.setRGB(G[0],G[1],G[2]),V.fogs[A]=B;if(V.cameras&&T.defaults.camera)V.currentCamera=V.cameras[T.defaults.camera];if(V.fogs&&T.defaults.fog)V.scene.fog=V.fogs[T.defaults.fog];G=T.defaults.bgcolor;V.bgColor=new THREE.Color;V.bgColor.setRGB(G[0],G[1],G[2]);V.bgColorAlpha=T.defaults.bgalpha;for(o in T.geometries)if(A=T.geometries[o],A.type=="bin_mesh"||A.type=="ascii_mesh")Z+=1,e.onLoadStart();S=Z;for(o in T.geometries)A=T.geometries[o],A.type=="cube"?(O=new THREE.CubeGeometry(A.width,A.height, -A.depth,A.segmentsWidth,A.segmentsHeight,A.segmentsDepth,null,A.flipped,A.sides),V.geometries[o]=O):A.type=="plane"?(O=new THREE.PlaneGeometry(A.width,A.height,A.segmentsWidth,A.segmentsHeight),V.geometries[o]=O):A.type=="sphere"?(O=new THREE.SphereGeometry(A.radius,A.segmentsWidth,A.segmentsHeight),V.geometries[o]=O):A.type=="cylinder"?(O=new THREE.CylinderGeometry(A.topRad,A.botRad,A.height,A.radSegs,A.heightSegs),V.geometries[o]=O):A.type=="torus"?(O=new THREE.TorusGeometry(A.radius,A.tube,A.segmentsR, -A.segmentsT),V.geometries[o]=O):A.type=="icosahedron"?(O=new THREE.IcosahedronGeometry(A.subdivisions),V.geometries[o]=O):A.type=="bin_mesh"?N.load({model:f(A.url,T.urlBaseType),callback:t(o)}):A.type=="ascii_mesh"?Q.load({model:f(A.url,T.urlBaseType),callback:t(o)}):A.type=="embedded_mesh"&&(A=T.embeds[A.id])&&Q.createModel(A,u(o),"");for(E in T.textures)if(o=T.textures[E],o.url instanceof Array){$+=o.url.length;for(N=0;N1&&(Y=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(M,Y);object.name=v;object.position.set(C[0],C[1],C[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=F.visible;V.scene.add(object);V.objects[v]=object;F.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),V.scene.collisions.colliders.push(b)); +if(F.castsShadow)b=new THREE.ShadowVolume(M),V.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}}else C=F.position,r=F.rotation,q=F.quaternion,s=F.scale,q=0,object=new THREE.Object3D,object.name=v,object.position.set(C[0],C[1],C[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0], +s[1],s[2]),object.visible=F.visible!==void 0?F.visible:!1,V.scene.add(object),V.objects[v]=object,V.empties[v]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}function u(b){return function(c){V.geometries[b]=c;n();Z-=1;e.onLoadComplete();w()}}function t(b){return function(e){V.geometries[b]=e}}function w(){e.callbackProgress({totalModels:P,totalTextures:p,loadedModels:P-Z,loadedTextures:p-$},V);e.onLoadProgress();Z==0&&$==0&&c(V)}var o,x, +v,z,A,y,E,F,C,G,J,M,K,B,L,Y,H,T,Q,Z,$,P,p,V;T=b.data;L=new THREE.BinaryLoader;Q=new THREE.JSONLoader;$=Z=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in T.objects)if(F=T.objects[v],F.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(T.transform){b=T.transform.position;G=T.transform.rotation;var fa=T.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);G&&V.scene.rotation.set(G[0], +G[1],G[2]);fa&&V.scene.scale.set(fa[0],fa[1],fa[2]);(b||G||fa)&&V.scene.updateMatrix()}b=function(){$-=1;w();e.onLoadComplete()};for(A in T.cameras)G=T.cameras[A],G.type=="perspective"?K=new THREE.PerspectiveCamera(G.fov,G.aspect,G.near,G.far):G.type=="ortho"&&(K=new THREE.OrthographicCamera(G.left,G.right,G.top,G.bottom,G.near,G.far)),C=G.position,G=G.target,K.position.set(C[0],C[1],C[2]),K.target=new THREE.Vector3(G[0],G[1],G[2]),V.cameras[A]=K;for(z in T.lights)A=T.lights[z],K=A.color!==void 0? +A.color:16777215,G=A.intensity!==void 0?A.intensity:1,A.type=="directional"?(C=A.direction,H=new THREE.DirectionalLight(K,G),H.position.set(C[0],C[1],C[2]),H.position.normalize()):A.type=="point"?(C=A.position,d=A.distance,H=new THREE.PointLight(K,G,d),H.position.set(C[0],C[1],C[2])):A.type=="ambient"&&(H=new THREE.AmbientLight(K)),V.scene.add(H),V.lights[z]=H;for(y in T.fogs)z=T.fogs[y],z.type=="linear"?B=new THREE.Fog(0,z.near,z.far):z.type=="exp2"&&(B=new THREE.FogExp2(0,z.density)),G=z.color, +B.color.setRGB(G[0],G[1],G[2]),V.fogs[y]=B;if(V.cameras&&T.defaults.camera)V.currentCamera=V.cameras[T.defaults.camera];if(V.fogs&&T.defaults.fog)V.scene.fog=V.fogs[T.defaults.fog];G=T.defaults.bgcolor;V.bgColor=new THREE.Color;V.bgColor.setRGB(G[0],G[1],G[2]);V.bgColorAlpha=T.defaults.bgalpha;for(o in T.geometries)if(y=T.geometries[o],y.type=="bin_mesh"||y.type=="ascii_mesh")Z+=1,e.onLoadStart();P=Z;for(o in T.geometries)y=T.geometries[o],y.type=="cube"?(M=new THREE.CubeGeometry(y.width,y.height, +y.depth,y.segmentsWidth,y.segmentsHeight,y.segmentsDepth,null,y.flipped,y.sides),V.geometries[o]=M):y.type=="plane"?(M=new THREE.PlaneGeometry(y.width,y.height,y.segmentsWidth,y.segmentsHeight),V.geometries[o]=M):y.type=="sphere"?(M=new THREE.SphereGeometry(y.radius,y.segmentsWidth,y.segmentsHeight),V.geometries[o]=M):y.type=="cylinder"?(M=new THREE.CylinderGeometry(y.topRad,y.botRad,y.height,y.radSegs,y.heightSegs),V.geometries[o]=M):y.type=="torus"?(M=new THREE.TorusGeometry(y.radius,y.tube,y.segmentsR, +y.segmentsT),V.geometries[o]=M):y.type=="icosahedron"?(M=new THREE.IcosahedronGeometry(y.subdivisions),V.geometries[o]=M):y.type=="bin_mesh"?L.load({model:f(y.url,T.urlBaseType),callback:u(o)}):y.type=="ascii_mesh"?Q.load({model:f(y.url,T.urlBaseType),callback:u(o)}):y.type=="embedded_mesh"&&(y=T.embeds[y.id])&&Q.createModel(y,t(o),"");for(E in T.textures)if(o=T.textures[E],o.url instanceof Array){$+=o.url.length;for(L=0;L=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,h=0;h<8;h++){for(var k=0,m=0;m>1^-(n&1);e[8*m+h]=k}f+=c}c=b.length-f;k=new Uint16Array(c);for(h=m=0;h=this.maxCount-3&&n(this)};this.begin=function(){this.count=0; -this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(t=this.size-1);var x=Math.floor(u-n);x<1&&(x=1);u=Math.floor(u+n);u>this.size-1&&(u=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size- -1);for(var z,y,A,E,F,C;o0&&(this.field[A+z]+=E)}}};this.addPlaneX=function(b,c){var h,k,m,n,t,u=this.size,w=this.yd,o=this.zd,x=this.field,v=u*Math.sqrt(b/c);v>u&&(v=u);for(h=0;h0)for(k=0;kw&&(z=w);for(k=0;k0){t=k*o;for(h=0;hsize&&(dist=size);for(m=0;m0){t=zd*m;for(k=0;k=this.maxCount-3&&n(this)};this.begin=function(){this.count=0; +this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(u=this.size-1);var x=Math.floor(t-n);x<1&&(x=1);t=Math.floor(t+n);t>this.size-1&&(t=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size- +1);for(var z,A,y,E,F,C;o0&&(this.field[y+z]+=E)}}};this.addPlaneX=function(b,c){var h,k,m,n,u,t=this.size,w=this.yd,o=this.zd,x=this.field,v=t*Math.sqrt(b/c);v>t&&(v=t);for(h=0;h0)for(k=0;kw&&(z=w);for(k=0;k0){u=k*o;for(h=0;hsize&&(dist=size);for(m=0;m0){u=zd*m;for(k=0;kk?this.hits.push(h):this.hits.unshift(h),k=f;return this.hits}; THREE.CollisionSystem.prototype.rayCastNearest=function(b){var c=this.rayCastAll(b);if(c.length==0)return null;for(var e=0;c[e]instanceof THREE.MeshCollider;){var f=this.rayMesh(b,c[e]);if(f.distc.length)return null;return c[e]}; THREE.CollisionSystem.prototype.rayCast=function(b,c){if(c instanceof THREE.PlaneCollider)return this.rayPlane(b,c);else if(c instanceof THREE.SphereCollider)return this.raySphere(b,c);else if(c instanceof THREE.BoxCollider)return this.rayBox(b,c);else if(c instanceof THREE.MeshCollider&&c.box)return this.rayBox(b,c.box)}; -THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,k=0;k=n*h))return Number.MAX_VALUE;m/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(m);n.addSelf(b.origin);Math.abs(k.x)> +THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,k=0;k=n*h))return Number.MAX_VALUE;m/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(m);n.addSelf(b.origin);Math.abs(k.x)> Math.abs(k.y)?Math.abs(k.x)>Math.abs(k.z)?(b=n.y-c.y,k=e.y-c.y,h=f.y-c.y,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(k.y)>Math.abs(k.z)?(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y);c=k*f-e*h;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-n*h)*c;if(!(f>=0))return Number.MAX_VALUE;c*=k*n-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return m}; THREE.CollisionSystem.prototype.makeRayLocal=function(b,c){var e=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(c.matrixWorld,e);var f=THREE.CollisionSystem.__r;f.origin.copy(b.origin);f.direction.copy(b.direction);e.multiplyVector3(f.origin);e.rotateAxis(f.direction);f.direction.normalize();return f}; -THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,h=0,k=0,m=0,n=0,t=0,u=!0;e.origin.xc.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,u=!1,m=1);e.origin.yc.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y, -u=!1,n=1);e.origin.zc.max.z&&(k=c.max.z-e.origin.z,k/=e.direction.z,u=!1,t=1);if(u)return-1;u=0;h>f&&(u=1,f=h);k>f&&(u=2,f=k);switch(u){case 0:n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(m,0,0);break;case 1:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z* -f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;c.normal.set(0,0,t)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE}; +THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,h=0,k=0,m=0,n=0,u=0,t=!0;e.origin.xc.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,t=!1,m=1);e.origin.yc.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y, +t=!1,n=1);e.origin.zc.max.z&&(k=c.max.z-e.origin.z,k/=e.direction.z,t=!1,u=1);if(t)return-1;t=0;h>f&&(t=1,f=h);k>f&&(t=2,f=k);switch(t){case 0:n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(m,0,0);break;case 1:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z* +f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;c.normal.set(0,0,u)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE}; THREE.CollisionSystem.prototype.raySphere=function(b,c){var e=c.center.clone().subSelf(b.origin);if(e.lengthSq=0)return Math.abs(f)-Math.sqrt(e);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4; THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(b){b.geometry.computeBoundingBox();var c=b.geometry.boundingBox,e=new THREE.Vector3(c.x[0],c.y[0],c.z[0]),c=new THREE.Vector3(c.x[1],c.y[1],c.z[1]),e=new THREE.BoxCollider(e,c);e.mesh=b;return e};THREE.CollisionUtils.MeshAABB=function(b){var c=THREE.CollisionUtils.MeshOBB(b);c.min.addSelf(b.position);c.max.addSelf(b.position);c.dynamic=!1;return c}; THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))}; -if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,m=new THREE.Matrix4,n=new THREE.Matrix4,t,u,w;h.matrixAutoUpdate=k.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},o=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.PerspectiveCamera(53,1,1,1E4);v.position.z= +if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,m=new THREE.Matrix4,n=new THREE.Matrix4,u,t,w;h.matrixAutoUpdate=k.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},o=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.PerspectiveCamera(53,1,1,1E4);v.position.z= 2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:o},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); -var z=new THREE.Scene;z.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);o.width=b;o.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(t!==e.aspect||u!==e.near||w!==e.fov){t=e.aspect;u=e.near;w=e.fov;var E=e.projectionMatrix.clone(),F=125/30*0.5,C=F*u/125,G=u*Math.tan(w*Math.PI/360),J;m.n14=F;n.n14=-F;F=-G*t+C;J=G*t+C;E.n11=2*u/(J-F);E.n13=(J+F)/(J-F);h.projectionMatrix=E.clone();F=-G*t-C;J=G*t-C;E.n11=2*u/(J-F);E.n13= -(J+F)/(J-F);k.projectionMatrix=E.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=u;h.far=e.far;f.call(c,b,h,o,!0);k.matrix=e.matrixWorld.clone().multiplySelf(m);k.update(null,!0);k.position.copy(e.position);k.near=u;k.far=e.far;f.call(c,b,k,x,!0);f.call(c,z,v)}}; +var z=new THREE.Scene;z.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);o.width=b;o.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(u!==e.aspect||t!==e.near||w!==e.fov){u=e.aspect;t=e.near;w=e.fov;var E=e.projectionMatrix.clone(),F=125/30*0.5,C=F*t/125,G=t*Math.tan(w*Math.PI/360),J;m.n14=F;n.n14=-F;F=-G*u+C;J=G*u+C;E.n11=2*t/(J-F);E.n13=(J+F)/(J-F);h.projectionMatrix=E.clone();F=-G*u-C;J=G*u-C;E.n11=2*t/(J-F);E.n13= +(J+F)/(J-F);k.projectionMatrix=E.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=t;h.far=e.far;f.call(c,b,h,o,!0);k.matrix=e.matrixWorld.clone().multiplySelf(m);k.update(null,!0);k.position.copy(e.position);k.near=t;k.far=e.far;f.call(c,b,k,x,!0);f.call(c,z,v)}}; if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,h,k,m=new THREE.PerspectiveCamera;m.target=new THREE.Vector3(0,0,0);var n=new THREE.PerspectiveCamera;n.target=new THREE.Vector3(0,0,0);c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;this.setSize=function(b,f){e.call(c,b,f);h=b/2;k=f};this.render=function(b,e){this.clear();m.fov=e.fov;m.aspect=0.5*e.aspect;m.near=e.near;m.far= e.far;m.updateProjectionMatrix();m.position.copy(e.position);m.target.copy(e.target);m.translateX(c.separation);m.lookAt(m.target);n.projectionMatrix=m.projectionMatrix;n.position.copy(e.position);n.target.copy(e.target);n.translateX(-c.separation);n.lookAt(n.target);this.setViewport(0,0,h,k);f.call(c,b,m);this.setViewport(h,0,h,k);f.call(c,b,n,!1)}}; diff --git a/build/custom/ThreeCanvas.js b/build/custom/ThreeCanvas.js index a4440c15..6730b071 100644 --- a/build/custom/ThreeCanvas.js +++ b/build/custom/ThreeCanvas.js @@ -1,8 +1,8 @@ // ThreeCanvas.js r46dev - http://github.com/mrdoob/three.js var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this}; -THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,f,e;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),e=c*(1-b*f),b=c*(1-b*(1-f)),d){case 1:this.r=e;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=e;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=e;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}}; -THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; +THREE.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},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,f,e;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),e=c*(1- +b*f),b=c*(1-b*(1-f)),d){case 1:this.r=e;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=e;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=e;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ +Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; diff --git a/build/custom/ThreeDOM.js b/build/custom/ThreeDOM.js index 97f1c51e..d8f2a557 100644 --- a/build/custom/ThreeDOM.js +++ b/build/custom/ThreeDOM.js @@ -1,8 +1,8 @@ // ThreeDOM.js r46dev - http://github.com/mrdoob/three.js var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this}; -THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,g;if(c==0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),e=a*6-d,a=c*(1-b),g=c*(1-b*e),b=c*(1-b*(1-e)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r= -c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}}; -THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; +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},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,e,g;if(c==0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),e=a*6-d,a=c*(1-b),g=c*(1- +b*e),b=c*(1-b*(1-e)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ +Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.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)}, equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; diff --git a/build/custom/ThreeSVG.js b/build/custom/ThreeSVG.js index 2ff94c24..788caa77 100644 --- a/build/custom/ThreeSVG.js +++ b/build/custom/ThreeSVG.js @@ -1,8 +1,8 @@ // ThreeSVG.js r46dev - http://github.com/mrdoob/three.js var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this}; -THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,f,e;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),e=c*(1-b*f),b=c*(1-b*(1-f)),d){case 1:this.r=e;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=e;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=e;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}}; -THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; +THREE.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},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,f,e;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),e=c*(1- +b*f),b=c*(1-b*(1-f)),d){case 1:this.r=e;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=e;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=e;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ +Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; diff --git a/build/custom/ThreeWebGL.js b/build/custom/ThreeWebGL.js index 05ff3aa2..471ca05f 100644 --- a/build/custom/ThreeWebGL.js +++ b/build/custom/ThreeWebGL.js @@ -1,8 +1,8 @@ // ThreeWebGL.js r46dev - http://github.com/mrdoob/three.js var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this}; -THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var d,h,i;if(e==0)this.r=this.g=this.b=0;else switch(d=Math.floor(b*6),h=b*6-d,b=e*(1-c),i=e*(1-c*h),c=e*(1-c*(1-h)),d){case 1:this.r=i;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=i;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r= -e;this.g=b;this.b=i;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}}; -THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0}; +THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},copyGammaToLinear:function(b){this.r=b.r*b.r;this.g=b.g*b.g;this.b=b.b*b.b;return this},copyLinearToGamma:function(b){this.r=Math.sqrt(b.r);this.g=Math.sqrt(b.g);this.b=Math.sqrt(b.b);return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var d,h,i;if(e==0)this.r=this.g=this.b=0;else switch(d=Math.floor(b*6),h=b*6-d,b=e*(1-c),i=e*(1- +c*h),c=e*(1-c*(1-h)),d){case 1:this.r=i;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=i;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=e;this.g=b;this.b=i;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ +Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this}, divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var c=this.x-b.x,b=this.y-b.y;return c*c+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)}, equals:function(b){return b.x==this.x&&b.y==this.y}};THREE.Vector3=function(b,c,e){this.x=b||0;this.y=c||0;this.z=e||0}; @@ -16,35 +16,35 @@ c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,d=[];c=0;for(e=b.length;c0&&b>0&&i+b<1}for(var d,h=[],i=0,j=b.children.length;ib.scale.x)return[];d={distance:i,point:b.position,face:null,object:b};h.push(d)}else if(b instanceof THREE.Mesh){i=c(this.origin, -this.direction,b.matrixWorld.getPosition());if(i==null||i>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var k,n,p,q,m,r,t,A,y=b.geometry,J=y.vertices,i=0,j=y.faces.length;i0:r<0)))if(r=m.dot((new THREE.Vector3).sub(k,t))/r,t=t.addSelf(A.multiplyScalar(r)),d instanceof THREE.Face3)e(t,k,n,p)&&(d={distance:this.origin.distanceTo(t),point:t,face:d,object:b},h.push(d));else if(d instanceof THREE.Face4&&(e(t,k,n,q)||e(t,n,p,q)))d={distance:this.origin.distanceTo(t),point:t,face:d,object:b},h.push(d)}return h}}; -THREE.Rectangle=function(){function b(){i=d-c;j=h-e}var c,e,d,h,i,j,k=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return i};this.getHeight=function(){return j};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return d};this.getBottom=function(){return h};this.set=function(i,j,q,m){k=!1;c=i;e=j;d=q;h=m;b()};this.addPoint=function(i,j){k?(k=!1,c=i,e=j,d=i,h=j):(c=ci?d:i,h=h>j?h:j);b()};this.add3Points= -function(i,j,q,m,r,t){k?(k=!1,c=iq?i>r?i:r:q>r?q:r,h=j>m?j>t?j:t:m>t?m:t):(c=iq?i>r?i>d?i:d:r>d?r:d:q>r?q>d?q:d:r>d?r:d,h=j>m?j>t?j>h?j:h:t>h?t:h:m>t?m>h?m:h:t>h?t:h);b()};this.addRectangle=function(i){k?(k=!1,c=i.getLeft(),e=i.getTop(),d=i.getRight(),h=i.getBottom()):(c=ci.getRight()?d:i.getRight(),h=h> +this.direction,b.matrixWorld.getPosition());if(i==null||i>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var k,n,p,q,t,s,m,B,y=b.geometry,J=y.vertices,i=0,j=y.faces.length;i0:s<0)))if(s=t.dot((new THREE.Vector3).sub(k,m))/s,m=m.addSelf(B.multiplyScalar(s)),d instanceof THREE.Face3)e(m,k,n,p)&&(d={distance:this.origin.distanceTo(m),point:m,face:d,object:b},h.push(d));else if(d instanceof THREE.Face4&&(e(m,k,n,q)||e(m,n,p,q)))d={distance:this.origin.distanceTo(m),point:m,face:d,object:b},h.push(d)}return h}}; +THREE.Rectangle=function(){function b(){i=d-c;j=h-e}var c,e,d,h,i,j,k=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return i};this.getHeight=function(){return j};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return d};this.getBottom=function(){return h};this.set=function(i,j,q,t){k=!1;c=i;e=j;d=q;h=t;b()};this.addPoint=function(i,j){k?(k=!1,c=i,e=j,d=i,h=j):(c=ci?d:i,h=h>j?h:j);b()};this.add3Points= +function(i,j,q,t,s,m){k?(k=!1,c=iq?i>s?i:s:q>s?q:s,h=j>t?j>m?j:m:t>m?t:m):(c=iq?i>s?i>d?i:d:s>d?s:d:q>s?q>d?q:d:s>d?s:d,h=j>t?j>m?j>h?j:h:m>h?m:h:t>m?t>h?t:h:m>h?m:h);b()};this.addRectangle=function(i){k?(k=!1,c=i.getLeft(),e=i.getTop(),d=i.getRight(),h=i.getBottom()):(c=ci.getRight()?d:i.getRight(),h=h> i.getBottom()?h:i.getBottom());b()};this.inflate=function(i){c-=i;e-=i;d+=i;h+=i;b()};this.minSelf=function(i){c=c>i.getLeft()?c:i.getLeft();e=e>i.getTop()?e:i.getTop();d=d=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){k=!0;h=d=e=c=0;b()};this.isEmpty=function(){return k}};THREE.Matrix3=function(){this.m=[]}; THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}}; -THREE.Matrix4=function(b,c,e,d,h,i,j,k,n,p,q,m,r,t,A,y){this.set(b!==void 0?b:1,c||0,e||0,d||0,h||0,i!==void 0?i:1,j||0,k||0,n||0,p||0,q!==void 0?q:1,m||0,r||0,t||0,A||0,y!==void 0?y:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,d,h,i,j,k,n,p,q,m,r,t,A,y){this.n11=b;this.n12=c;this.n13=e;this.n14=d;this.n21=h;this.n22=i;this.n23=j;this.n24=k;this.n31=n;this.n32=p;this.n33=q;this.n34=m;this.n41=r;this.n42=t;this.n43=A;this.n44=y;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b, +THREE.Matrix4=function(b,c,e,d,h,i,j,k,n,p,q,t,s,m,B,y){this.set(b!==void 0?b:1,c||0,e||0,d||0,h||0,i!==void 0?i:1,j||0,k||0,n||0,p||0,q!==void 0?q:1,t||0,s||0,m||0,B||0,y!==void 0?y:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,d,h,i,j,k,n,p,q,t,s,m,B,y){this.n11=b;this.n12=c;this.n13=e;this.n14=d;this.n21=h;this.n22=i;this.n23=j;this.n24=k;this.n31=n;this.n32=p;this.n33=q;this.n34=t;this.n41=s;this.n42=m;this.n43=B;this.n44=y;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b, c,e){var d=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,i=THREE.Matrix4.__v3;i.sub(b,c).normalize();if(i.length()===0)i.z=1;d.cross(e,i).normalize();d.length()===0&&(i.x+=1.0E-4,d.cross(e,i).normalize());h.cross(i,d).normalize();this.n11=d.x;this.n12=h.x;this.n13=i.x;this.n21=d.y;this.n22=h.y;this.n23=i.y;this.n31=d.z;this.n32=h.z;this.n33=i.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,d=b.z,h=1/(this.n41*c+this.n42*e+this.n43*d+this.n44);b.x=(this.n11*c+this.n12*e+this.n13*d+this.n14)*h; b.y=(this.n21*c+this.n22*e+this.n23*d+this.n24)*h;b.z=(this.n31*c+this.n32*e+this.n33*d+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,e=b.y,d=b.z,h=b.w;b.x=this.n11*c+this.n12*e+this.n13*d+this.n14*h;b.y=this.n21*c+this.n22*e+this.n23*d+this.n24*h;b.z=this.n31*c+this.n32*e+this.n33*d+this.n34*h;b.w=this.n41*c+this.n42*e+this.n43*d+this.n44*h;return b},rotateAxis:function(b){var c=b.x,e=b.y,d=b.z;b.x=c*this.n11+e*this.n12+d*this.n13;b.y=c*this.n21+e*this.n22+d*this.n23;b.z=c*this.n31+ -e*this.n32+d*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,d=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,n=b.n23,p=b.n24,q=b.n31,m=b.n32,r=b.n33,t=b.n34,A=b.n41,y=b.n42,J=b.n43,F=b.n44,xa=c.n11,ya= -c.n12,ja=c.n13,ta=c.n14,ha=c.n21,G=c.n22,v=c.n23,T=c.n24,L=c.n31,V=c.n32,la=c.n33,Z=c.n34,Ca=c.n41,$=c.n42,M=c.n43,f=c.n44;this.n11=e*xa+d*ha+h*L+i*Ca;this.n12=e*ya+d*G+h*V+i*$;this.n13=e*ja+d*v+h*la+i*M;this.n14=e*ta+d*T+h*Z+i*f;this.n21=j*xa+k*ha+n*L+p*Ca;this.n22=j*ya+k*G+n*V+p*$;this.n23=j*ja+k*v+n*la+p*M;this.n24=j*ta+k*T+n*Z+p*f;this.n31=q*xa+m*ha+r*L+t*Ca;this.n32=q*ya+m*G+r*V+t*$;this.n33=q*ja+m*v+r*la+t*M;this.n34=q*ta+m*T+r*Z+t*f;this.n41=A*xa+y*ha+J*L+F*Ca;this.n42=A*ya+y*G+J*V+F*$;this.n43= -A*ja+y*v+J*la+F*M;this.n44=A*ta+y*T+J*Z+F*f;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*= -b;this.n23*=b;this.n24*=b;this.n31*=b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,d=this.n14,h=this.n21,i=this.n22,j=this.n23,k=this.n24,n=this.n31,p=this.n32,q=this.n33,m=this.n34,r=this.n41,t=this.n42,A=this.n43,y=this.n44;return d*j*p*r-e*k*p*r-d*i*q*r+c*k*q*r+e*i*m*r-c*j*m*r-d*j*n*t+e*k*n*t+d*h*q*t-b*k*q*t-e*h*m*t+b*j*m*t+d*i*n*A-c*k*n*A-d*h*p*A+b*k*p*A+c*h*m*A-b*i*m*A-e*i*n*y+c*j* +e*this.n32+d*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,d=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,n=b.n23,p=b.n24,q=b.n31,t=b.n32,s=b.n33,m=b.n34,B=b.n41,y=b.n42,J=b.n43,F=b.n44,xa=c.n11,ya= +c.n12,ja=c.n13,ta=c.n14,ha=c.n21,G=c.n22,v=c.n23,T=c.n24,L=c.n31,V=c.n32,la=c.n33,Z=c.n34,Ca=c.n41,$=c.n42,H=c.n43,f=c.n44;this.n11=e*xa+d*ha+h*L+i*Ca;this.n12=e*ya+d*G+h*V+i*$;this.n13=e*ja+d*v+h*la+i*H;this.n14=e*ta+d*T+h*Z+i*f;this.n21=j*xa+k*ha+n*L+p*Ca;this.n22=j*ya+k*G+n*V+p*$;this.n23=j*ja+k*v+n*la+p*H;this.n24=j*ta+k*T+n*Z+p*f;this.n31=q*xa+t*ha+s*L+m*Ca;this.n32=q*ya+t*G+s*V+m*$;this.n33=q*ja+t*v+s*la+m*H;this.n34=q*ta+t*T+s*Z+m*f;this.n41=B*xa+y*ha+J*L+F*Ca;this.n42=B*ya+y*G+J*V+F*$;this.n43= +B*ja+y*v+J*la+F*H;this.n44=B*ta+y*T+J*Z+F*f;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*= +b;this.n23*=b;this.n24*=b;this.n31*=b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,d=this.n14,h=this.n21,i=this.n22,j=this.n23,k=this.n24,n=this.n31,p=this.n32,q=this.n33,t=this.n34,s=this.n41,m=this.n42,B=this.n43,y=this.n44;return d*j*p*s-e*k*p*s-d*i*q*s+c*k*q*s+e*i*t*s-c*j*t*s-d*j*n*m+e*k*n*m+d*h*q*m-b*k*q*m-e*h*t*m+b*j*t*m+d*i*n*B-c*k*n*B-d*h*p*B+b*k*p*B+c*h*t*B-b*i*t*B-e*i*n*y+c*j* n*y+e*h*p*y-b*j*p*y-c*h*q*y+b*i*q*y},transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32; b.n33=this.n33;b.n34=this.n34;b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]= this.n11;b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]= this.n34;b[c+15]=this.n44;return b},setTranslation:function(b,c,e){this.set(1,0,0,b,0,1,0,c,0,0,1,e,0,0,0,1);return this},setScale:function(b,c,e){this.set(b,0,0,0,0,c,0,0,0,0,e,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,-b,0, 0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),d=Math.sin(c),h=1-e,i=b.x,j=b.y,k=b.z,n=h*i,p=h*j;this.set(n*i+e,n*j-d*k,n*k+d*j,0,n*j+d*k,p*j+e,p*k-d*i,0,n*k-d*j,p*k+d*i,h*k*k+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,d=b.y,h=b.z,i=Math.cos(e),e=Math.sin(e),j=Math.cos(d),d=Math.sin(d),k=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var n= -j*k,p=j*h,q=d*k,m=d*h;this.n11=n+m*e;this.n12=q*e-p;this.n13=i*d;this.n21=i*h;this.n22=i*k;this.n23=-e;this.n31=p*e-q;this.n32=m+n*e;this.n33=i*j;break;case "ZXY":n=j*k;p=j*h;q=d*k;m=d*h;this.n11=n-m*e;this.n12=-i*h;this.n13=q+p*e;this.n21=p+q*e;this.n22=i*k;this.n23=m-n*e;this.n31=-i*d;this.n32=e;this.n33=i*j;break;case "ZYX":n=i*k;p=i*h;q=e*k;m=e*h;this.n11=j*k;this.n12=q*d-p;this.n13=n*d+m;this.n21=j*h;this.n22=m*d+n;this.n23=p*d-q;this.n31=-d;this.n32=e*j;this.n33=i*j;break;case "YZX":n=i*j;p= -i*d;q=e*j;m=e*d;this.n11=j*k;this.n12=m-n*h;this.n13=q*h+p;this.n21=h;this.n22=i*k;this.n23=-e*k;this.n31=-d*k;this.n32=p*h+q;this.n33=n-m*h;break;case "XZY":n=i*j;p=i*d;q=e*j;m=e*d;this.n11=j*k;this.n12=-h;this.n13=d*k;this.n21=n*h+m;this.n22=i*k;this.n23=p*h-q;this.n31=q*h-p;this.n32=e*k;this.n33=m*h+n;break;default:n=i*k,p=i*h,q=e*k,m=e*h,this.n11=j*k,this.n12=-j*h,this.n13=d,this.n21=p+q*d,this.n22=n-m*d,this.n23=-e*j,this.n31=m-n*d,this.n32=q+p*d,this.n33=i*j}return this},setRotationFromQuaternion:function(b){var c= +j*k,p=j*h,q=d*k,t=d*h;this.n11=n+t*e;this.n12=q*e-p;this.n13=i*d;this.n21=i*h;this.n22=i*k;this.n23=-e;this.n31=p*e-q;this.n32=t+n*e;this.n33=i*j;break;case "ZXY":n=j*k;p=j*h;q=d*k;t=d*h;this.n11=n-t*e;this.n12=-i*h;this.n13=q+p*e;this.n21=p+q*e;this.n22=i*k;this.n23=t-n*e;this.n31=-i*d;this.n32=e;this.n33=i*j;break;case "ZYX":n=i*k;p=i*h;q=e*k;t=e*h;this.n11=j*k;this.n12=q*d-p;this.n13=n*d+t;this.n21=j*h;this.n22=t*d+n;this.n23=p*d-q;this.n31=-d;this.n32=e*j;this.n33=i*j;break;case "YZX":n=i*j;p= +i*d;q=e*j;t=e*d;this.n11=j*k;this.n12=t-n*h;this.n13=q*h+p;this.n21=h;this.n22=i*k;this.n23=-e*k;this.n31=-d*k;this.n32=p*h+q;this.n33=n-t*h;break;case "XZY":n=i*j;p=i*d;q=e*j;t=e*d;this.n11=j*k;this.n12=-h;this.n13=d*k;this.n21=n*h+t;this.n22=i*k;this.n23=p*h-q;this.n31=q*h-p;this.n32=e*k;this.n33=t*h+n;break;default:n=i*k,p=i*h,q=e*k,t=e*h,this.n11=j*k,this.n12=-j*h,this.n13=d,this.n21=p+q*d,this.n22=n-t*d,this.n23=-e*j,this.n31=t-n*d,this.n32=q+p*d,this.n33=i*j}return this},setRotationFromQuaternion:function(b){var c= b.x,e=b.y,d=b.z,h=b.w,i=c+c,j=e+e,k=d+d,b=c*i,n=c*j;c*=k;var p=e*j;e*=k;d*=k;i*=h;j*=h;h*=k;this.n11=1-(p+d);this.n12=n-h;this.n13=c+j;this.n21=n+h;this.n22=1-(b+d);this.n23=e-i;this.n31=c-j;this.n32=e+i;this.n33=1-(b+p);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var d=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2; d.identity();d.setRotationFromQuaternion(c);h.setScale(e.x,e.y,e.z);this.multiply(d,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var d=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,i=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);i.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;e=e instanceof THREE.Vector3?e:new THREE.Vector3;e.x=d.length(); e.y=h.length();e.z=i.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=e.x;d.n21/=e.x;d.n31/=e.x;d.n12/=e.y;d.n22/=e.y;d.n32/=e.y;d.n13/=e.z;d.n23/=e.z;d.n33/=e.z;c.setFromRotationMatrix(d);return[b,c,e]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var e=1/c.x,d=1/c.y,h=1/c.z;this.n11=b.n11*e;this.n21=b.n21*e;this.n31=b.n31*e;this.n12=b.n12*d;this.n22=b.n22*d;this.n32=b.n32*d;this.n13=b.n13*h;this.n23= b.n23*h;this.n33=b.n33*h}}; -THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,d=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,n=b.n23,p=b.n24,q=b.n31,m=b.n32,r=b.n33,t=b.n34,A=b.n41,y=b.n42,J=b.n43,F=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=n*t*y-p*r*y+p*m*J-k*t*J-n*m*F+k*r*F;c.n12=i*r*y-h*t*y-i*m*J+d*t*J+h*m*F-d*r*F;c.n13=h*p*y-i*n*y+i*k*J-d*p*J-h*k*F+d*n*F;c.n14=i*n*m-h*p*m-i*k*r+d*p*r+h*k*t-d*n*t;c.n21=p*r*A-n*t*A-p*q*J+j*t*J+n*q*F-j*r*F;c.n22=h*t*A-i*r*A+i*q*J-e*t*J-h*q*F+e*r*F;c.n23=i*n*A-h*p*A-i*j*J+e*p*J+h*j*F-e*n*F;c.n24= -h*p*q-i*n*q+i*j*r-e*p*r-h*j*t+e*n*t;c.n31=k*t*A-p*m*A+p*q*y-j*t*y-k*q*F+j*m*F;c.n32=i*m*A-d*t*A-i*q*y+e*t*y+d*q*F-e*m*F;c.n33=h*p*A-i*k*A+i*j*y-e*p*y-d*j*F+e*k*F;c.n34=i*k*q-d*p*q-i*j*m+e*p*m+d*j*t-e*k*t;c.n41=n*m*A-k*r*A-n*q*y+j*r*y+k*q*J-j*m*J;c.n42=d*r*A-h*m*A+h*q*y-e*r*y-d*q*J+e*m*J;c.n43=h*k*A-d*n*A-h*j*y+e*n*y+d*j*J-e*k*J;c.n44=d*n*q-h*k*q+h*j*m-e*n*m-d*j*r+e*k*r;c.multiplyScalar(1/b.determinant());return c}; -THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,d=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,i=b.n32*b.n21-b.n31*b.n22,j=-b.n33*b.n12+b.n32*b.n13,k=b.n33*b.n11-b.n31*b.n13,n=-b.n32*b.n11+b.n31*b.n12,p=b.n23*b.n12-b.n22*b.n13,q=-b.n23*b.n11+b.n21*b.n13,m=b.n22*b.n11-b.n21*b.n12,b=b.n11*d+b.n21*j+b.n31*p;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*d;e[1]=b*h;e[2]=b*i;e[3]=b*j;e[4]=b*k;e[5]=b*n;e[6]=b*p;e[7]=b*q;e[8]=b*m;return c}; +THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,d=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,n=b.n23,p=b.n24,q=b.n31,t=b.n32,s=b.n33,m=b.n34,B=b.n41,y=b.n42,J=b.n43,F=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=n*m*y-p*s*y+p*t*J-k*m*J-n*t*F+k*s*F;c.n12=i*s*y-h*m*y-i*t*J+d*m*J+h*t*F-d*s*F;c.n13=h*p*y-i*n*y+i*k*J-d*p*J-h*k*F+d*n*F;c.n14=i*n*t-h*p*t-i*k*s+d*p*s+h*k*m-d*n*m;c.n21=p*s*B-n*m*B-p*q*J+j*m*J+n*q*F-j*s*F;c.n22=h*m*B-i*s*B+i*q*J-e*m*J-h*q*F+e*s*F;c.n23=i*n*B-h*p*B-i*j*J+e*p*J+h*j*F-e*n*F;c.n24= +h*p*q-i*n*q+i*j*s-e*p*s-h*j*m+e*n*m;c.n31=k*m*B-p*t*B+p*q*y-j*m*y-k*q*F+j*t*F;c.n32=i*t*B-d*m*B-i*q*y+e*m*y+d*q*F-e*t*F;c.n33=h*p*B-i*k*B+i*j*y-e*p*y-d*j*F+e*k*F;c.n34=i*k*q-d*p*q-i*j*t+e*p*t+d*j*m-e*k*m;c.n41=n*t*B-k*s*B-n*q*y+j*s*y+k*q*J-j*t*J;c.n42=d*s*B-h*t*B+h*q*y-e*s*y-d*q*J+e*t*J;c.n43=h*k*B-d*n*B-h*j*y+e*n*y+d*j*J-e*k*J;c.n44=d*n*q-h*k*q+h*j*t-e*n*t-d*j*s+e*k*s;c.multiplyScalar(1/b.determinant());return c}; +THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,d=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,i=b.n32*b.n21-b.n31*b.n22,j=-b.n33*b.n12+b.n32*b.n13,k=b.n33*b.n11-b.n31*b.n13,n=-b.n32*b.n11+b.n31*b.n12,p=b.n23*b.n12-b.n22*b.n13,q=-b.n23*b.n11+b.n21*b.n13,t=b.n22*b.n11-b.n21*b.n12,b=b.n11*d+b.n21*j+b.n31*p;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*d;e[1]=b*h;e[2]=b*i;e[3]=b*j;e[4]=b*k;e[5]=b*n;e[6]=b*p;e[7]=b*q;e[8]=b*t;return c}; THREE.Matrix4.makeFrustum=function(b,c,e,d,h,i){var j;j=new THREE.Matrix4;j.n11=2*h/(c-b);j.n12=0;j.n13=(c+b)/(c-b);j.n14=0;j.n21=0;j.n22=2*h/(d-e);j.n23=(d+e)/(d-e);j.n24=0;j.n31=0;j.n32=0;j.n33=-(i+h)/(i-h);j.n34=-2*i*h/(i-h);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};THREE.Matrix4.makePerspective=function(b,c,e,d){var h,b=e*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,e,d)}; THREE.Matrix4.makeOrtho=function(b,c,e,d,h,i){var j,k,n,p;j=new THREE.Matrix4;k=c-b;n=e-d;p=i-h;j.n11=2/k;j.n12=0;j.n13=0;j.n14=-((c+b)/k);j.n21=0;j.n22=2/n;j.n23=0;j.n24=-((e+d)/n);j.n31=0;j.n32=0;j.n33=-2/p;j.n34=-((i+h)/p);j.n41=0;j.n42=0;j.n43=0;j.n44=1;return j};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= @@ -54,23 +54,23 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){thi b)return h;if(c&&(h=h.getChildByName(b,c),h!==void 0))return h}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,e){this.matrixAutoUpdate&& this.updateMatrix();if(this.matrixWorldNeedsUpdate||c)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,c=!0;for(var b=0,d=this.children.length;b=0&&i>=0&&h>=0&&j>=0?!0:f<0&&i<0||h<0&&j<0?!1:(f<0?e=Math.max(e,f/(f-i)):i<0&&(d=Math.min(d,f/(f-i))),h<0?e=Math.max(e,h/(h-j)):j<0&&(d=Math.min(d,h/(h-j))),d=0&&i>=0&&h>=0&&j>=0?!0:f<0&&i<0||h<0&&j<0?!1:(f<0?e=Math.max(e,f/(f-i)):i<0&&(d=Math.min(d,f/(f-i))),h<0?e=Math.max(e,h/(h-j)):j<0&&(d=Math.min(d,h/(h-j))),dM&&j.positionScreen.zH&&j.positionScreen.z0&&G.z<1))za=ya[xa]=ya[xa]||new THREE.RenderableParticle,xa++,F=za,F.x=G.x/G.w,F.y=G.y/G.w,F.z=G.z,F.rotation=P.rotation.z,F.scale.x=P.scale.x*Math.abs(F.x-(G.x+i.projectionMatrix.n11)/(G.w+i.projectionMatrix.n14)),F.scale.y=P.scale.y*Math.abs(F.y-(G.y+i.projectionMatrix.n22)/(G.w+i.projectionMatrix.n24)),F.materials=P.materials,ta.push(F);h&&ta.sort(c);return ta}}; THREE.Quaternion=function(b,c,e,d){this.set(b||0,c||0,e||0,d!==void 0?d:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,d){this.x=b;this.y=c;this.z=e;this.w=d;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,e=b.x*c,d=b.y*c,h=b.z*c,b=Math.cos(d),d=Math.sin(d),c=Math.cos(-h),h=Math.sin(-h),i=Math.cos(e),e=Math.sin(e),j=b*c,k=d*h;this.w=j*i-k*e;this.x=j*e+k*i;this.y=d*c*i+b*h*e;this.z=b*h*i-d*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,d=Math.sin(e); this.x=b.x*d;this.y=b.y*d;this.z=b.z*d;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z); this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c= -this.x,e=this.y,d=this.z,h=this.w,i=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+h*i+e*k-d*j;this.y=e*b+h*j+d*i-c*k;this.z=d*b+h*k+c*j-e*i;this.w=h*b-c*i-e*j-d*k;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,d=b.y,h=b.z,i=this.x,j=this.y,k=this.z,n=this.w,p=n*e+j*h-k*d,q=n*d+k*e-i*h,m=n*h+i*d-j*e,e=-i* -e-j*d-k*h;c.x=p*n+e*-i+q*-k-m*-j;c.y=q*n+e*-j+m*-i-p*-k;c.z=m*n+e*-k+p*-j-q*-i;return c}};THREE.Quaternion.slerp=function(b,c,e,d){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var i=Math.acos(h),j=Math.sqrt(1-h*h);if(Math.abs(j)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-d)*i)/j;d=Math.sin(d*i)/j;e.w=b.w*h+c.w*d;e.x=b.x*h+c.x*d;e.y=b.y*h+c.y*d;e.z=b.z*h+c.z*d;return e}; +this.x,e=this.y,d=this.z,h=this.w,i=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+h*i+e*k-d*j;this.y=e*b+h*j+d*i-c*k;this.z=d*b+h*k+c*j-e*i;this.w=h*b-c*i-e*j-d*k;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,d=b.y,h=b.z,i=this.x,j=this.y,k=this.z,n=this.w,p=n*e+j*h-k*d,q=n*d+k*e-i*h,t=n*h+i*d-j*e,e=-i* +e-j*d-k*h;c.x=p*n+e*-i+q*-k-t*-j;c.y=q*n+e*-j+t*-i-p*-k;c.z=t*n+e*-k+p*-j-q*-i;return c}};THREE.Quaternion.slerp=function(b,c,e,d){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var i=Math.acos(h),j=Math.sqrt(1-h*h);if(Math.abs(j)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-d)*i)/j;d=Math.sin(d*i)/j;e.w=b.w*h+c.w*d;e.x=b.x*h+c.x*d;e.y=b.y*h+c.y*d;e.z=b.z*h+c.z*d;return e}; THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,d,h,i){this.a=b;this.b=c;this.c=e;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=i instanceof Array?i:[i];this.centroid=new THREE.Vector3}; THREE.Face4=function(b,c,e,d,h,i,j){this.a=b;this.b=c;this.c=e;this.d=d;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=i instanceof THREE.Color?i:new THREE.Color;this.vertexColors=i instanceof Array?i:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; @@ -79,14 +79,14 @@ c;b++)e=this.faces[b],e.centroid.set(0,0,0),e instanceof THREE.Face3?(e.centroid e,d,h,i,j,k=new THREE.Vector3,n=new THREE.Vector3;d=0;for(h=this.faces.length;d0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x], +e.vertexNormals[1].copy(d[e.b]),e.vertexNormals[2].copy(d[e.c]),e.vertexNormals[3].copy(d[e.d]))},computeTangents:function(){function b(b,c,e,d,i,h,v){k=b.vertices[c].position;n=b.vertices[e].position;p=b.vertices[d].position;q=j[i];t=j[h];s=j[v];m=n.x-k.x;B=p.x-k.x;y=n.y-k.y;J=p.y-k.y;F=n.z-k.z;xa=p.z-k.z;ya=t.u-q.u;ja=s.u-q.u;ta=t.v-q.v;ha=s.v-q.v;G=1/(ya*ha-ja*ta);V.set((ha*m-ta*B)*G,(ha*y-ta*J)*G,(ha*F-ta*xa)*G);la.set((ya*B-ja*m)*G,(ya*J-ja*y)*G,(ya*xa-ja*F)*G);T[c].addSelf(V);T[e].addSelf(V); +T[d].addSelf(V);L[c].addSelf(la);L[e].addSelf(la);L[d].addSelf(la)}var c,e,d,h,i,j,k,n,p,q,t,s,m,B,y,J,F,xa,ya,ja,ta,ha,G,v,T=[],L=[],V=new THREE.Vector3,la=new THREE.Vector3,Z=new THREE.Vector3,Ca=new THREE.Vector3,$=new THREE.Vector3;c=0;for(e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x], y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.z< this.boundingBox.z[0])this.boundingBox.z[0]=b.position.z;else if(b.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;cthis.points.length-2?i:i+1;e[3]=i>this.points.length-3?i:i+2;p=this.points[e[0]];q=this.points[e[1]]; -m=this.points[e[2]];r=this.points[e[3]];k=j*j;n=j*k;d.x=c(p.x,q.x,m.x,r.x,j,k,n);d.y=c(p.y,q.y,m.y,r.y,j,k,n);d.z=c(p.z,q.z,m.z,r.z,j,k,n);return d};this.getControlPointsArray=function(){var b,c,e=this.points.length,d=[];for(b=0;bthis.points.length-2?i:i+1;e[3]=i>this.points.length-3?i:i+2;p=this.points[e[0]];q=this.points[e[1]]; +t=this.points[e[2]];s=this.points[e[3]];k=j*j;n=j*k;d.x=c(p.x,q.x,t.x,s.x,j,k,n);d.y=c(p.y,q.y,t.y,s.y,j,k,n);d.z=c(p.z,q.z,t.z,s.z,j,k,n);return d};this.getControlPointsArray=function(){var b,c,e=this.points.length,d=[];for(b=0;b 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", +envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * vReflect.x, vReflect.yz ) );\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity );\n} else {\ngl_FragColor.xyz = gl_FragColor.xyz * cubeColor.xyz;\n}\n#endif", +envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[ 0 ].xyz, objectMatrix[ 1 ].xyz, objectMatrix[ 2 ].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif", +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_pars_vertex:"uniform bool enableLighting;\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", lights_vertex:"if ( !enableLighting ) {\nvLightWeighting = vec3( 1.0 );\n} else {\nvLightWeighting = ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nfloat directionalLightWeighting = max( dot( transformedNormal, normalize( lDirection.xyz ) ), 0.0 );\nvLightWeighting += directionalLightColor[ i ] * directionalLightWeighting;\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 pointLightWeighting = max( dot( transformedNormal, lVector ), 0.0 );\nvLightWeighting += pointLightColor[ i ] * pointLightWeighting * lDistance;\n}\n#endif\n}", lights_phong_pars_vertex:"#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif",lights_phong_vertex:"#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif", -lights_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 ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",lights_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\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 ++ ) {\nvec3 pointVector = normalize( vPointLight[ i ].xyz );\nvec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );\nfloat pointDistance = vPointLight[ i ].w;\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = pow( pointDotNormalHalf, shininess );\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * pointDistance;\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\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 );\nvec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = pow( dirDotNormalHalf, shininess );\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\ndirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;\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\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;", -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\nvColor = color;\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 * viewMatrix * objectMatrix * gl_Position;\n#endif", +lights_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 ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",lights_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\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 ++ ) {\nvec3 pointVector = normalize( vPointLight[ i ].xyz );\nvec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );\nfloat pointDistance = vPointLight[ i ].w;\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = pow( pointDotNormalHalf, shininess );\n#ifdef PHYSICALLY_BASED_SHADING\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( pointVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#else\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#endif\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * pointDistance;\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 );\nvec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = pow( dirDotNormalHalf, shininess );\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\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\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\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient * diffuse ) + totalSpecular;", +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 * viewMatrix * objectMatrix * gl_Position;\n#endif", morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\nuniform float morphTargetInfluences[ 8 ];\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\nvec3 morphed = vec3( 0.0, 0.0, 0.0 );\nmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\nmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\nmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\nmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\nmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\nmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\nmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\nmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\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",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform float shadowDarkness;\nuniform float shadowBias;\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif", -shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_SOFT\nconst float xPixelOffset = 1.0 / SHADOWMAP_WIDTH;\nconst float yPixelOffset = 1.0 / SHADOWMAP_HEIGHT;\n#endif\nvec4 shadowColor = vec4( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nshadowCoord.z += shadowBias;\nif ( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec4( vec3( ( 1.0 - shadowDarkness * shadow ) ), 1.0 );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec4( vec3( shadowDarkness ), 1.0 );\n#endif\n}\n}\ngl_FragColor = gl_FragColor * shadowColor;\n#endif", -shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif"}; +shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_SOFT\nconst float xPixelOffset = 1.0 / SHADOWMAP_WIDTH;\nconst float yPixelOffset = 1.0 / SHADOWMAP_HEIGHT;\n#endif\nvec3 shadowColor = vec3( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nshadowCoord.z += shadowBias;\nif ( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\n#ifdef GAMMA_OUTPUT\nvec3 darkening = vec3( ( 1.0 - shadowDarkness * shadow ) );\ndarkening *= darkening;\nshadowColor = shadowColor * darkening;\n#else\nshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness * shadow ) );\n#endif\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec3( shadowDarkness );\n#endif\n}\n}\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 ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\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(b){var c,e,d,h={};for(c=0;c=0)c&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglVertexBuffer),f.vertexAttribPointer(b.position,3,f.FLOAT,!1,0,0));else if(j.morphTargetBase){d=i.program.attributes;j.morphTargetBase!== -1?(f.bindBuffer(f.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[j.morphTargetBase]),f.vertexAttribPointer(d.position,3,f.FLOAT,!1,0,0)):d.position>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglVertexBuffer),f.vertexAttribPointer(d.position,3,f.FLOAT,!1,0,0));if(j.morphTargetForcedOrder.length)for(var n=0,x=j.morphTargetForcedOrder,p=j.morphTargetInfluences;nq&&(m=t,q=p[m]);f.bindBuffer(f.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[m]);f.vertexAttribPointer(d["morphTarget"+n],3,f.FLOAT,!1,0,0);j.__webglMorphTargetInfluences[n]=q;x[m]=1;q=-1;n++}}i.program.uniforms.morphTargetInfluences!==null&&f.uniform1fv(i.program.uniforms.morphTargetInfluences, +f.FLOAT,!1,0,0),j.__webglMorphTargetInfluences[n]=p[x[n]],n++;else{var x=[],z=-1,q=0,p=j.morphTargetInfluences,m,t=p.length,n=0;for(j.morphTargetBase!==-1&&(x[j.morphTargetBase]=!0);nz&&(q=m,z=p[q]);f.bindBuffer(f.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[q]);f.vertexAttribPointer(d["morphTarget"+n],3,f.FLOAT,!1,0,0);j.__webglMorphTargetInfluences[n]=z;x[q]=1;z=-1;n++}}i.program.uniforms.morphTargetInfluences!==null&&f.uniform1fv(i.program.uniforms.morphTargetInfluences, j.__webglMorphTargetInfluences)}if(c){if(h.__webglCustomAttributes)for(k in h.__webglCustomAttributes)b[k]>=0&&(d=h.__webglCustomAttributes[k],f.bindBuffer(f.ARRAY_BUFFER,d.buffer),f.vertexAttribPointer(b[k],d.size,f.FLOAT,!1,0,0));b.color>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglColorBuffer),f.vertexAttribPointer(b.color,3,f.FLOAT,!1,0,0));b.normal>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglNormalBuffer),f.vertexAttribPointer(b.normal,3,f.FLOAT,!1,0,0));b.tangent>=0&&(f.bindBuffer(f.ARRAY_BUFFER, h.__webglTangentBuffer),f.vertexAttribPointer(b.tangent,4,f.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(f.bindBuffer(f.ARRAY_BUFFER,h.__webglUVBuffer),f.vertexAttribPointer(b.uv,2,f.FLOAT,!1,0,0),f.enableVertexAttribArray(b.uv)):f.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(f.bindBuffer(f.ARRAY_BUFFER,h.__webglUV2Buffer),f.vertexAttribPointer(b.uv2,2,f.FLOAT,!1,0,0),f.enableVertexAttribArray(b.uv2)):f.disableVertexAttribArray(b.uv2));i.skinning&&b.skinVertexA>=0&&b.skinVertexB>= 0&&b.skinIndex>=0&&b.skinWeight>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinVertexABuffer),f.vertexAttribPointer(b.skinVertexA,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),f.vertexAttribPointer(b.skinVertexB,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),f.vertexAttribPointer(b.skinIndex,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),f.vertexAttribPointer(b.skinWeight,4,f.FLOAT,!1,0,0))}j instanceof THREE.Mesh?(i.wireframe? -(f.lineWidth(i.wireframeLinewidth),c&&f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),f.drawElements(f.LINES,h.__webglLineCount,f.UNSIGNED_SHORT,0)):(c&&f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),f.drawElements(f.TRIANGLES,h.__webglFaceCount,f.UNSIGNED_SHORT,0)),M.info.render.calls++,M.info.render.vertices+=h.__webglFaceCount,M.info.render.faces+=h.__webglFaceCount/3):j instanceof THREE.Line?(j=j.type==THREE.LineStrip?f.LINE_STRIP:f.LINES,f.lineWidth(i.linewidth),f.drawArrays(j, -0,h.__webglLineCount),M.info.render.calls++):j instanceof THREE.ParticleSystem?(f.drawArrays(f.POINTS,0,h.__webglParticleCount),M.info.render.calls++):j instanceof THREE.Ribbon&&(f.drawArrays(f.TRIANGLE_STRIP,0,h.__webglVertexCount),M.info.render.calls++)}}function h(b,c,d){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=f.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=f.createBuffer();b.hasPos&&(f.bindBuffer(f.ARRAY_BUFFER,b.__webglVertexBuffer),f.bufferData(f.ARRAY_BUFFER,b.positionArray, -f.DYNAMIC_DRAW),f.enableVertexAttribArray(c.attributes.position),f.vertexAttribPointer(c.attributes.position,3,f.FLOAT,!1,0,0));if(b.hasNormal){f.bindBuffer(f.ARRAY_BUFFER,b.__webglNormalBuffer);if(d==THREE.FlatShading){var e,h,i,j,k,x,n,p,q,m,C=b.count*3;for(m=0;m=0;f--)b[f].object==c&&b.splice(f,1)}f materials:j,vertices:0,numMorphTargets:p}),i=i instanceof THREE.Face3?3:4,b.geometryGroups[n].vertices+i>65535&&(m[k].counter+=1,n=m[k].hash+"_"+m[k].counter,b.geometryGroups[n]==void 0&&(b.geometryGroups[n]={faces:[],materials:j,vertices:0,numMorphTargets:p})),b.geometryGroups[n].faces.push(e),b.geometryGroups[n].vertices+=i;b.geometryGroupsList=[];for(var q in b.geometryGroups)b.geometryGroups[q].id=R++,b.geometryGroupsList.push(b.geometryGroups[q])}function ha(b,c,f){b.push({buffer:c,object:f, opaque:{list:[],count:0},transparent:{list:[],count:0}})}function G(b){if(b!=ia){switch(b){case THREE.AdditiveBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.SRC_ALPHA,f.ONE);break;case THREE.SubtractiveBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.ZERO,f.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.ZERO,f.SRC_COLOR);break;default:f.blendEquationSeparate(f.FUNC_ADD,f.FUNC_ADD),f.blendFuncSeparate(f.SRC_ALPHA,f.ONE_MINUS_SRC_ALPHA,f.ONE,f.ONE_MINUS_SRC_ALPHA)}ia= b}}function v(b,c,d){(d.width&d.width-1)==0&&(d.height&d.height-1)==0?(f.texParameteri(b,f.TEXTURE_WRAP_S,$(c.wrapS)),f.texParameteri(b,f.TEXTURE_WRAP_T,$(c.wrapT)),f.texParameteri(b,f.TEXTURE_MAG_FILTER,$(c.magFilter)),f.texParameteri(b,f.TEXTURE_MIN_FILTER,$(c.minFilter)),f.generateMipmap(b)):(f.texParameteri(b,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(b,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(b,f.TEXTURE_MAG_FILTER,Ca(c.magFilter)),f.texParameteri(b,f.TEXTURE_MIN_FILTER,Ca(c.minFilter)))} -function T(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=f.createTexture(),M.info.memory.textures++;f.activeTexture(f.TEXTURE0+c);f.bindTexture(f.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?f.texImage2D(f.TEXTURE_2D,0,$(b.format),b.image.width,b.image.height,0,$(b.format),f.UNSIGNED_BYTE,b.image.data):f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,b.image);v(f.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else f.activeTexture(f.TEXTURE0+c),f.bindTexture(f.TEXTURE_2D, +function T(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=f.createTexture(),H.info.memory.textures++;f.activeTexture(f.TEXTURE0+c);f.bindTexture(f.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?f.texImage2D(f.TEXTURE_2D,0,$(b.format),b.image.width,b.image.height,0,$(b.format),f.UNSIGNED_BYTE,b.image.data):f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,b.image);v(f.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else f.activeTexture(f.TEXTURE0+c),f.bindTexture(f.TEXTURE_2D, b.__webglTexture)}function L(b,c){f.bindRenderbuffer(f.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,c.width,c.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_STENCIL,c.width,c.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_STENCIL_ATTACHMENT,f.RENDERBUFFER,b)):f.renderbufferStorage(f.RENDERBUFFER,f.RGBA4,c.width,c.height)} function V(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=f.createTexture();if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];f.bindTexture(f.TEXTURE_CUBE_MAP,b.__webglTexture);v(f.TEXTURE_CUBE_MAP,b,b);for(var d=0;d<6;d++){b.__webglFramebuffer[d]=f.createFramebuffer();b.__webglRenderbuffer[d]=f.createRenderbuffer();f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+ d,0,$(b.format),b.width,b.height,0,$(b.format),$(b.type),null);var e=b,h=f.TEXTURE_CUBE_MAP_POSITIVE_X+d;f.bindFramebuffer(f.FRAMEBUFFER,b.__webglFramebuffer[d]);f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,h,e.__webglTexture,0);L(b.__webglRenderbuffer[d],b)}}else b.__webglFramebuffer=f.createFramebuffer(),b.__webglRenderbuffer=f.createRenderbuffer(),f.bindTexture(f.TEXTURE_2D,b.__webglTexture),v(f.TEXTURE_2D,b,b),f.texImage2D(f.TEXTURE_2D,0,$(b.format),b.width,b.height,0,$(b.format), $(b.type),null),d=f.TEXTURE_2D,f.bindFramebuffer(f.FRAMEBUFFER,b.__webglFramebuffer),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,d,b.__webglTexture,0),f.bindRenderbuffer(f.RENDERBUFFER,b.__webglRenderbuffer),L(b.__webglRenderbuffer,b);c?f.bindTexture(f.TEXTURE_CUBE_MAP,null):f.bindTexture(f.TEXTURE_2D,null);f.bindRenderbuffer(f.RENDERBUFFER,null);f.bindFramebuffer(f.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,d=b.width,b=b.height,h=e=0):(c=null, -d=va,b=Ka,e=Aa,h=Da);c!=aa&&(f.bindFramebuffer(f.FRAMEBUFFER,c),f.viewport(e,h,d,b),aa=c)}function la(b){b instanceof THREE.WebGLRenderTargetCube?(f.bindTexture(f.TEXTURE_CUBE_MAP,b.__webglTexture),f.generateMipmap(f.TEXTURE_CUBE_MAP),f.bindTexture(f.TEXTURE_CUBE_MAP,null)):(f.bindTexture(f.TEXTURE_2D,b.__webglTexture),f.generateMipmap(f.TEXTURE_2D),f.bindTexture(f.TEXTURE_2D,null))}function Z(b,c){var d;b=="fragment"?d=f.createShader(f.FRAGMENT_SHADER):b=="vertex"&&(d=f.createShader(f.VERTEX_SHADER)); +d=va,b=Ka,e=Aa,h=Ea);c!=aa&&(f.bindFramebuffer(f.FRAMEBUFFER,c),f.viewport(e,h,d,b),aa=c)}function la(b){b instanceof THREE.WebGLRenderTargetCube?(f.bindTexture(f.TEXTURE_CUBE_MAP,b.__webglTexture),f.generateMipmap(f.TEXTURE_CUBE_MAP),f.bindTexture(f.TEXTURE_CUBE_MAP,null)):(f.bindTexture(f.TEXTURE_2D,b.__webglTexture),f.generateMipmap(f.TEXTURE_2D),f.bindTexture(f.TEXTURE_2D,null))}function Z(b,c){var d;b=="fragment"?d=f.createShader(f.FRAGMENT_SHADER):b=="vertex"&&(d=f.createShader(f.VERTEX_SHADER)); f.shaderSource(d,c);f.compileShader(d);if(!f.getShaderParameter(d,f.COMPILE_STATUS))return console.error(f.getShaderInfoLog(d)),console.error(c),null;return d}function Ca(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return f.NEAREST;default:return f.LINEAR}}function $(b){switch(b){case THREE.RepeatWrapping:return f.REPEAT;case THREE.ClampToEdgeWrapping:return f.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return f.MIRRORED_REPEAT; case THREE.NearestFilter:return f.NEAREST;case THREE.NearestMipMapNearestFilter:return f.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return f.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return f.LINEAR;case THREE.LinearMipMapNearestFilter:return f.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return f.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return f.BYTE;case THREE.UnsignedByteType:return f.UNSIGNED_BYTE;case THREE.ShortType:return f.SHORT;case THREE.UnsignedShortType:return f.UNSIGNED_SHORT; -case THREE.IntType:return f.INT;case THREE.UnsignedShortType:return f.UNSIGNED_INT;case THREE.FloatType:return f.FLOAT;case THREE.AlphaFormat:return f.ALPHA;case THREE.RGBFormat:return f.RGB;case THREE.RGBAFormat:return f.RGBA;case THREE.LuminanceFormat:return f.LUMINANCE;case THREE.LuminanceAlphaFormat:return f.LUMINANCE_ALPHA}return 0}var M=this,f,Ha=[],Za=null,aa=null,na=-1,D=null,R=0,U=null,W=null,ia=null,P=null,za=null,Ma=null,Sa=null,Ta=null,Aa=0,Da=0,va=0,Ka=0,X=[new THREE.Vector4,new THREE.Vector4, -new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ea=new THREE.Matrix4,Wa=new Float32Array(16),Xa=new Float32Array(16),Ja=new THREE.Vector4,ab={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},Fa=b.canvas!==void 0?b.canvas:document.createElement("canvas"),Q=b.stencil!==void 0?b.stencil:!0,fb=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,gb=b.antialias!==void 0?b.antialias:!1,wa=b.clearColor!== -void 0?new THREE.Color(b.clearColor):new THREE.Color(0),Ba=b.clearAlpha!==void 0?b.clearAlpha:0,$a=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=Fa;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar= -5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=!0;var sa,Va=[],b=THREE.ShaderLib.depthRGBA,db=THREE.UniformsUtils.clone(b.uniforms),Ya=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:db}),bb=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:db,morphTargets:!0});Ya._shadowPass=!0;bb._shadowPass=!0;try{if(!(f=Fa.getContext("experimental-webgl",{antialias:gb,stencil:Q, -preserveDrawingBuffer:fb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+f.getParameter(f.VERSION)+" | "+f.getParameter(f.VENDOR)+" | "+f.getParameter(f.RENDERER)+" | "+f.getParameter(f.SHADING_LANGUAGE_VERSION))}catch(hb){console.error(hb)}f.clearColor(0,0,0,1);f.clearDepth(1);f.clearStencil(0);f.enable(f.DEPTH_TEST);f.depthFunc(f.LEQUAL);f.frontFace(f.CCW);f.cullFace(f.BACK);f.enable(f.CULL_FACE);f.enable(f.BLEND);f.blendEquation(f.FUNC_ADD);f.blendFunc(f.SRC_ALPHA, -f.ONE_MINUS_SRC_ALPHA);f.clearColor(wa.r,wa.g,wa.b,Ba);this.context=f;var eb=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,u={};u.vertices=new Float32Array(16);u.faces=new Uint16Array(6);Q=0;u.vertices[Q++]=-1;u.vertices[Q++]=-1;u.vertices[Q++]=0;u.vertices[Q++]=1;u.vertices[Q++]=1;u.vertices[Q++]=-1;u.vertices[Q++]=1;u.vertices[Q++]=1;u.vertices[Q++]=1;u.vertices[Q++]=1;u.vertices[Q++]=1;u.vertices[Q++]=0;u.vertices[Q++]=-1;u.vertices[Q++]=1;u.vertices[Q++]=0;Q=u.vertices[Q++]=0;u.faces[Q++]= -0;u.faces[Q++]=1;u.faces[Q++]=2;u.faces[Q++]=0;u.faces[Q++]=2;u.faces[Q++]=3;u.vertexBuffer=f.createBuffer();u.elementBuffer=f.createBuffer();f.bindBuffer(f.ARRAY_BUFFER,u.vertexBuffer);f.bufferData(f.ARRAY_BUFFER,u.vertices,f.STATIC_DRAW);f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,u.elementBuffer);f.bufferData(f.ELEMENT_ARRAY_BUFFER,u.faces,f.STATIC_DRAW);u.program=f.createProgram();f.attachShader(u.program,Z("fragment",THREE.ShaderLib.sprite.fragmentShader));f.attachShader(u.program,Z("vertex",THREE.ShaderLib.sprite.vertexShader)); -f.linkProgram(u.program);u.attributes={};u.uniforms={};u.attributes.position=f.getAttribLocation(u.program,"position");u.attributes.uv=f.getAttribLocation(u.program,"uv");u.uniforms.uvOffset=f.getUniformLocation(u.program,"uvOffset");u.uniforms.uvScale=f.getUniformLocation(u.program,"uvScale");u.uniforms.rotation=f.getUniformLocation(u.program,"rotation");u.uniforms.scale=f.getUniformLocation(u.program,"scale");u.uniforms.alignment=f.getUniformLocation(u.program,"alignment");u.uniforms.color=f.getUniformLocation(u.program, -"color");u.uniforms.map=f.getUniformLocation(u.program,"map");u.uniforms.opacity=f.getUniformLocation(u.program,"opacity");u.uniforms.useScreenCoordinates=f.getUniformLocation(u.program,"useScreenCoordinates");u.uniforms.affectedByDistance=f.getUniformLocation(u.program,"affectedByDistance");u.uniforms.screenPosition=f.getUniformLocation(u.program,"screenPosition");u.uniforms.modelViewMatrix=f.getUniformLocation(u.program,"modelViewMatrix");u.uniforms.projectionMatrix=f.getUniformLocation(u.program, -"projectionMatrix");var cb=!1;this.setSize=function(b,c){Fa.width=b;Fa.height=c;this.setViewport(0,0,Fa.width,Fa.height)};this.setViewport=function(b,c,d,e){Aa=b;Da=c;va=d;Ka=e;f.viewport(Aa,Da,va,Ka)};this.setScissor=function(b,c,d,e){f.scissor(b,c,d,e)};this.enableScissorTest=function(b){b?f.enable(f.SCISSOR_TEST):f.disable(f.SCISSOR_TEST)};this.setClearColorHex=function(b,c){wa.setHex(b);Ba=c;f.clearColor(wa.r,wa.g,wa.b,Ba)};this.setClearColor=function(b,c){wa.copy(b);Ba=c;f.clearColor(wa.r,wa.g, -wa.b,Ba)};this.getClearColor=function(){return wa};this.getClearAlpha=function(){return Ba};this.clear=function(b,c,d){var e=0;if(b==void 0||b)e|=f.COLOR_BUFFER_BIT;if(c==void 0||c)e|=f.DEPTH_BUFFER_BIT;if(d==void 0||d)e|=f.STENCIL_BUFFER_BIT;f.clear(e)};this.getContext=function(){return f};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c= -b.geometry.geometryGroups[g];f.deleteBuffer(c.__webglVertexBuffer);f.deleteBuffer(c.__webglNormalBuffer);f.deleteBuffer(c.__webglTangentBuffer);f.deleteBuffer(c.__webglColorBuffer);f.deleteBuffer(c.__webglUVBuffer);f.deleteBuffer(c.__webglUV2Buffer);f.deleteBuffer(c.__webglSkinVertexABuffer);f.deleteBuffer(c.__webglSkinVertexBBuffer);f.deleteBuffer(c.__webglSkinIndicesBuffer);f.deleteBuffer(c.__webglSkinWeightsBuffer);f.deleteBuffer(c.__webglFaceBuffer);f.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var d= -0,e=c.numMorphTargets;d=0&&f.enableVertexAttribArray(C.position);C.color>=0&&f.enableVertexAttribArray(C.color);C.normal>=0&&f.enableVertexAttribArray(C.normal);C.tangent>=0&&f.enableVertexAttribArray(C.tangent);b.skinning&&C.skinVertexA>=0&&C.skinVertexB>=0&&C.skinIndex>=0&&C.skinWeight>=0&&(f.enableVertexAttribArray(C.skinVertexA), -f.enableVertexAttribArray(C.skinVertexB),f.enableVertexAttribArray(C.skinIndex),f.enableVertexAttribArray(C.skinWeight));if(b.attributes)for(i in b.attributes)C[i]!==void 0&&C[i]>=0&&f.enableVertexAttribArray(C[i]);if(b.morphTargets)for(i=b.numSupportedMorphTargets=0;i=0&&(f.enableVertexAttribArray(C[u]),b.numSupportedMorphTargets++);b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,d,f){V(b); -this.clear(c,d,f)};this.render=function(b,c,m,u){var I,Ia,v,S,x,Ua,E,Qa,Ra=b.lights,C=b.fog;na=-1;this.shadowMapEnabled&&y(b,c);M.info.render.calls=0;M.info.render.vertices=0;M.info.render.faces=0;if(c.matrixAutoUpdate){for(x=c;x.parent;)x=x.parent;x.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Xa);c.projectionMatrix.flattenToArray(Wa);Ea.multiply(c.projectionMatrix,c.matrixWorldInverse);p(Ea);this.initWebGLObjects(b);V(m);(this.autoClear||u)&&this.clear(this.autoClearColor, -this.autoClearDepth,this.autoClearStencil);x=b.__webglObjects.length;for(u=0;u=0;u--)if(I=b.__webglObjects[u],I.render){E=I.object;Qa=I.buffer;v=I.opaque;i(E);for(I=0;I0||u.faceVertexUvs.length>0)j.__uvArray=new Float32Array(n*2);if(u.faceUvs.length>1||u.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(n*2)}if(k.geometry.skinWeights.length&&k.geometry.skinIndices.length)j.__skinVertexAArray= -new Float32Array(n*4),j.__skinVertexBArray=new Float32Array(n*4),j.__skinIndexArray=new Float32Array(n*4),j.__skinWeightArray=new Float32Array(n*4);j.__faceArray=new Uint16Array(v*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0));j.__lineArray=new Uint16Array(A*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];u=0;for(t=j.numMorphTargets;u=0;i--)e[i]==h&&e.splice(i,1)}else(d instanceof THREE.MarchingCubes||d.immediateRenderCallback)&&ja(e.__webglObjectsImmediate,d);d.__webglActive= -!1;b.__objectsRemoved.splice(0,1)}d=0;for(e=b.__webglObjects.length;d0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglColorBuffer),f.bufferData(f.ARRAY_BUFFER,ra,v));Ca&&(f.bindBuffer(f.ARRAY_BUFFER, -m.__webglNormalBuffer),f.bufferData(f.ARRAY_BUFFER,W,v));Da&&ua.hasTangents&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglTangentBuffer),f.bufferData(f.ARRAY_BUFFER,ca,v));va&&$>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglUVBuffer),f.bufferData(f.ARRAY_BUFFER,la,v));va&&aa>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglUV2Buffer),f.bufferData(f.ARRAY_BUFFER,na,v));Aa&&(f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,m.__webglFaceBuffer),f.bufferData(f.ELEMENT_ARRAY_BUFFER,ia,v),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,m.__webglLineBuffer), -f.bufferData(f.ELEMENT_ARRAY_BUFFER,X,v));w>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinVertexABuffer),f.bufferData(f.ARRAY_BUFFER,da,v),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinVertexBBuffer),f.bufferData(f.ARRAY_BUFFER,ea,v),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinIndicesBuffer),f.bufferData(f.ARRAY_BUFFER,fa,v),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinWeightsBuffer),f.bufferData(f.ARRAY_BUFFER,ga,v));A&&(delete m.__inittedArrays,delete m.__colorArray,delete m.__normalArray,delete m.__tangentArray, -delete m.__uvArray,delete m.__uv2Array,delete m.__faceArray,delete m.__vertexArray,delete m.__lineArray,delete m.__skinVertexAArray,delete m.__skinVertexBArray,delete m.__skinIndexArray,delete m.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;ya(j)}else if(i instanceof THREE.Ribbon){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=f.DYNAMIC_DRAW;k=u=A=A=void 0;p=i.vertices;n= -i.colors;q=p.length;m=n.length;t=i.__vertexArray;v=i.__colorArray;y=i.__dirtyColors;if(i.__dirtyVertices){for(A=0;A0,r={};r.vertices=new Float32Array(16);r.faces=new Uint16Array(6);Q=0;r.vertices[Q++]=-1;r.vertices[Q++]=-1;r.vertices[Q++]=0;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=-1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=0;r.vertices[Q++]= +-1;r.vertices[Q++]=1;r.vertices[Q++]=0;Q=r.vertices[Q++]=0;r.faces[Q++]=0;r.faces[Q++]=1;r.faces[Q++]=2;r.faces[Q++]=0;r.faces[Q++]=2;r.faces[Q++]=3;r.vertexBuffer=f.createBuffer();r.elementBuffer=f.createBuffer();f.bindBuffer(f.ARRAY_BUFFER,r.vertexBuffer);f.bufferData(f.ARRAY_BUFFER,r.vertices,f.STATIC_DRAW);f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,r.elementBuffer);f.bufferData(f.ELEMENT_ARRAY_BUFFER,r.faces,f.STATIC_DRAW);r.program=f.createProgram();f.attachShader(r.program,Z("fragment",THREE.ShaderLib.sprite.fragmentShader)); +f.attachShader(r.program,Z("vertex",THREE.ShaderLib.sprite.vertexShader));f.linkProgram(r.program);r.attributes={};r.uniforms={};r.attributes.position=f.getAttribLocation(r.program,"position");r.attributes.uv=f.getAttribLocation(r.program,"uv");r.uniforms.uvOffset=f.getUniformLocation(r.program,"uvOffset");r.uniforms.uvScale=f.getUniformLocation(r.program,"uvScale");r.uniforms.rotation=f.getUniformLocation(r.program,"rotation");r.uniforms.scale=f.getUniformLocation(r.program,"scale");r.uniforms.alignment= +f.getUniformLocation(r.program,"alignment");r.uniforms.color=f.getUniformLocation(r.program,"color");r.uniforms.map=f.getUniformLocation(r.program,"map");r.uniforms.opacity=f.getUniformLocation(r.program,"opacity");r.uniforms.useScreenCoordinates=f.getUniformLocation(r.program,"useScreenCoordinates");r.uniforms.affectedByDistance=f.getUniformLocation(r.program,"affectedByDistance");r.uniforms.screenPosition=f.getUniformLocation(r.program,"screenPosition");r.uniforms.modelViewMatrix=f.getUniformLocation(r.program, +"modelViewMatrix");r.uniforms.projectionMatrix=f.getUniformLocation(r.program,"projectionMatrix");var cb=!1;this.setSize=function(b,c){Ga.width=b;Ga.height=c;this.setViewport(0,0,Ga.width,Ga.height)};this.setViewport=function(b,c,d,e){Aa=b;Ea=c;va=d;Ka=e;f.viewport(Aa,Ea,va,Ka)};this.setScissor=function(b,c,d,e){f.scissor(b,c,d,e)};this.enableScissorTest=function(b){b?f.enable(f.SCISSOR_TEST):f.disable(f.SCISSOR_TEST)};this.setClearColorHex=function(b,c){wa.setHex(b);Ba=c;f.clearColor(wa.r,wa.g,wa.b, +Ba)};this.setClearColor=function(b,c){wa.copy(b);Ba=c;f.clearColor(wa.r,wa.g,wa.b,Ba)};this.getClearColor=function(){return wa};this.getClearAlpha=function(){return Ba};this.clear=function(b,c,d){var e=0;if(b==void 0||b)e|=f.COLOR_BUFFER_BIT;if(c==void 0||c)e|=f.DEPTH_BUFFER_BIT;if(d==void 0||d)e|=f.STENCIL_BUFFER_BIT;f.clear(e)};this.getContext=function(){return f};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray, +delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];f.deleteBuffer(c.__webglVertexBuffer);f.deleteBuffer(c.__webglNormalBuffer);f.deleteBuffer(c.__webglTangentBuffer);f.deleteBuffer(c.__webglColorBuffer);f.deleteBuffer(c.__webglUVBuffer);f.deleteBuffer(c.__webglUV2Buffer);f.deleteBuffer(c.__webglSkinVertexABuffer);f.deleteBuffer(c.__webglSkinVertexBBuffer);f.deleteBuffer(c.__webglSkinIndicesBuffer);f.deleteBuffer(c.__webglSkinWeightsBuffer); +f.deleteBuffer(c.__webglFaceBuffer);f.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d=0&&f.enableVertexAttribArray(s.position);s.color>=0&&f.enableVertexAttribArray(s.color);s.normal>=0&&f.enableVertexAttribArray(s.normal);s.tangent>=0&&f.enableVertexAttribArray(s.tangent); +b.skinning&&s.skinVertexA>=0&&s.skinVertexB>=0&&s.skinIndex>=0&&s.skinWeight>=0&&(f.enableVertexAttribArray(s.skinVertexA),f.enableVertexAttribArray(s.skinVertexB),f.enableVertexAttribArray(s.skinIndex),f.enableVertexAttribArray(s.skinWeight));if(b.attributes)for(i in b.attributes)s[i]!==void 0&&s[i]>=0&&f.enableVertexAttribArray(s[i]);if(b.morphTargets)for(i=b.numSupportedMorphTargets=0;i=0&&(f.enableVertexAttribArray(s[v]),b.numSupportedMorphTargets++); +b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,d,f){V(b);this.clear(c,d,f)};this.render=function(b,c,t,r){var I,v,Da,S,x,Ua,z,Qa,Ra=b.lights,M=b.fog;na=-1;this.shadowMapEnabled&&y(b,c);H.info.render.calls=0;H.info.render.vertices=0;H.info.render.faces=0;if(c.matrixAutoUpdate){for(x=c;x.parent;)x=x.parent;x.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Xa);c.projectionMatrix.flattenToArray(Wa);Fa.multiply(c.projectionMatrix, +c.matrixWorldInverse);p(Fa);this.initWebGLObjects(b);V(t);(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);x=b.__webglObjects.length;for(r=0;r=0;r--)if(I=b.__webglObjects[r],I.render){z=I.object;Qa=I.buffer;Da=I.opaque;i(z);for(I=0;I0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(n* +2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(n*2)}if(k.geometry.skinWeights.length&&k.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(n*4),j.__skinVertexBArray=new Float32Array(n*4),j.__skinIndexArray=new Float32Array(n*4),j.__skinWeightArray=new Float32Array(n*4);j.__faceArray=new Uint16Array(v*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0));j.__lineArray=new Uint16Array(B*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(r= +j.numMorphTargets;t=0;i--)e[i]==h&&e.splice(i,1)}else(d instanceof THREE.MarchingCubes||d.immediateRenderCallback)&&ja(e.__webglObjectsImmediate,d);d.__webglActive=!1;b.__objectsRemoved.splice(0,1)}d=0;for(e=b.__webglObjects.length;d0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglColorBuffer),f.bufferData(f.ARRAY_BUFFER,ra,v));Ca&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglNormalBuffer),f.bufferData(f.ARRAY_BUFFER,W,v));Ea&&ua.hasTangents&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglTangentBuffer),f.bufferData(f.ARRAY_BUFFER,ca,v));va&&$>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglUVBuffer),f.bufferData(f.ARRAY_BUFFER,la,v));va&&aa>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglUV2Buffer),f.bufferData(f.ARRAY_BUFFER, +na,v));Aa&&(f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,m.__webglFaceBuffer),f.bufferData(f.ELEMENT_ARRAY_BUFFER,ia,v),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,m.__webglLineBuffer),f.bufferData(f.ELEMENT_ARRAY_BUFFER,X,v));w>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinVertexABuffer),f.bufferData(f.ARRAY_BUFFER,da,v),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinVertexBBuffer),f.bufferData(f.ARRAY_BUFFER,ea,v),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinIndicesBuffer),f.bufferData(f.ARRAY_BUFFER,fa,v),f.bindBuffer(f.ARRAY_BUFFER, +m.__webglSkinWeightsBuffer),f.bufferData(f.ARRAY_BUFFER,ga,v));B&&(delete m.__inittedArrays,delete m.__colorArray,delete m.__normalArray,delete m.__tangentArray,delete m.__uvArray,delete m.__uv2Array,delete m.__faceArray,delete m.__vertexArray,delete m.__lineArray,delete m.__skinVertexAArray,delete m.__skinVertexBArray,delete m.__skinIndexArray,delete m.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors= +!1;ya(j)}else if(i instanceof THREE.Ribbon){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=f.DYNAMIC_DRAW;k=t=B=B=void 0;p=i.vertices;n=i.colors;q=p.length;m=n.length;r=i.__vertexArray;v=i.__colorArray;y=i.__dirtyColors;if(i.__dirtyVertices){for(B=0;B + + + three.js webgl - physically based shading + + + + + + +
+ three.js - webgl physically based shading testbed +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/core/Color.js b/src/core/Color.js index 0983a41a..05ecc74a 100644 --- a/src/core/Color.js +++ b/src/core/Color.js @@ -12,7 +12,7 @@ THREE.Color = function ( hex ) { THREE.Color.prototype = { constructor: THREE.Color, - + r: 1, g: 1, b: 1, copy: function ( color ) { @@ -25,6 +25,26 @@ THREE.Color.prototype = { }, + copyGammaToLinear: function ( color ) { + + this.r = color.r * color.r; + this.g = color.g * color.g; + this.b = color.b * color.b; + + return this; + + }, + + copyLinearToGamma: function ( color ) { + + this.r = Math.sqrt( color.r ); + this.g = Math.sqrt( color.g ); + this.b = Math.sqrt( color.b ); + + return this; + + }, + setRGB: function ( r, g, b ) { this.r = r; diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index 9177a64a..3089868b 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -105,6 +105,12 @@ THREE.WebGLRenderer = function ( parameters ) { this.sortObjects = true; + // physically based shading + + this.gammaInput = false; + this.gammaOutput = false; + this.physicallyBasedShading = false; + // shadow map this.shadowMapBias = 0.0039; @@ -412,17 +418,37 @@ THREE.WebGLRenderer = function ( parameters ) { if ( light instanceof THREE.AmbientLight ) { - r += color.r; - g += color.g; - b += color.b; + if ( _this.gammaInput ) { + + r += color.r * color.r; + g += color.g * color.g; + b += color.b * color.b; + + } else { + + r += color.r; + g += color.g; + b += color.b; + + } } else if ( light instanceof THREE.DirectionalLight ) { doffset = dlength * 3; - dcolors[ doffset ] = color.r * intensity; - dcolors[ doffset + 1 ] = color.g * intensity; - dcolors[ doffset + 2 ] = color.b * intensity; + if ( _this.gammaInput ) { + + dcolors[ doffset ] = color.r * color.r * intensity * intensity; + dcolors[ doffset + 1 ] = color.g * color.g * intensity * intensity; + dcolors[ doffset + 2 ] = color.b * color.b * intensity * intensity; + + } else { + + dcolors[ doffset ] = color.r * intensity; + dcolors[ doffset + 1 ] = color.g * intensity; + dcolors[ doffset + 2 ] = color.b * intensity; + + } dpositions[ doffset ] = position.x; dpositions[ doffset + 1 ] = position.y; @@ -434,9 +460,19 @@ THREE.WebGLRenderer = function ( parameters ) { doffset = dlength * 3; - dcolors[ doffset ] = color.r * intensity; - dcolors[ doffset + 1 ] = color.g * intensity; - dcolors[ doffset + 2 ] = color.b * intensity; + if ( _this.gammaInput ) { + + dcolors[ doffset ] = color.r * color.r * intensity * intensity; + dcolors[ doffset + 1 ] = color.g * color.g * intensity * intensity; + dcolors[ doffset + 2 ] = color.b * color.b * intensity * intensity; + + } else { + + dcolors[ doffset ] = color.r * intensity; + dcolors[ doffset + 1 ] = color.g * intensity; + dcolors[ doffset + 2 ] = color.b * intensity; + + } n = 1 / position.length(); @@ -450,9 +486,19 @@ THREE.WebGLRenderer = function ( parameters ) { poffset = plength * 3; - pcolors[ poffset ] = color.r * intensity; - pcolors[ poffset + 1 ] = color.g * intensity; - pcolors[ poffset + 2 ] = color.b * intensity; + if ( _this.gammaInput ) { + + pcolors[ poffset ] = color.r * color.r * intensity * intensity; + pcolors[ poffset + 1 ] = color.g * color.g * intensity * intensity; + pcolors[ poffset + 2 ] = color.b * color.b * intensity * intensity; + + } else { + + pcolors[ poffset ] = color.r * intensity; + pcolors[ poffset + 1 ] = color.g * intensity; + pcolors[ poffset + 2 ] = color.b * intensity; + + } ppositions[ poffset ] = position.x; ppositions[ poffset + 1 ] = position.y; @@ -2489,9 +2535,18 @@ THREE.WebGLRenderer = function ( parameters ) { function refreshUniformsCommon( uniforms, material ) { - uniforms.diffuse.value = material.color; uniforms.opacity.value = material.opacity; + if ( _this.gammaInput ) { + + uniforms.diffuse.value.copyGammaToLinear( material.color ); + + } else { + + uniforms.diffuse.value = material.color; + + } + uniforms.map.texture = material.map; if ( material.map ) { @@ -2503,7 +2558,18 @@ THREE.WebGLRenderer = function ( parameters ) { uniforms.envMap.texture = material.envMap; uniforms.flipEnvMap.value = ( material.envMap instanceof THREE.WebGLRenderTargetCube ) ? 1 : -1; - uniforms.reflectivity.value = material.reflectivity; + + if ( _this.gammaInput ) { + + //uniforms.reflectivity.value = material.reflectivity * material.reflectivity; + uniforms.reflectivity.value = material.reflectivity; + + } else { + + uniforms.reflectivity.value = material.reflectivity; + + } + uniforms.refractionRatio.value = material.refractionRatio; uniforms.combine.value = material.combine; uniforms.useRefract.value = material.envMap && material.envMap.mapping instanceof THREE.CubeRefractionMapping; @@ -2547,10 +2613,20 @@ THREE.WebGLRenderer = function ( parameters ) { function refreshUniformsPhong( uniforms, material ) { - uniforms.ambient.value = material.ambient; - uniforms.specular.value = material.specular; uniforms.shininess.value = material.shininess; + if ( _this.gammaInput ) { + + uniforms.ambient.value.copyGammaToLinear( material.ambient ); + uniforms.specular.value.copyGammaToLinear( material.specular ); + + } else { + + uniforms.ambient.value = material.ambient; + uniforms.specular.value = material.specular; + + } + }; @@ -4759,6 +4835,10 @@ THREE.WebGLRenderer = function ( parameters ) { _supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", + _this.gammaInput ? "#define GAMMA_INPUT" : "", + _this.gammaOutput ? "#define GAMMA_OUTPUT" : "", + _this.physicallyBasedShading ? "#define PHYSICALLY_BASED_SHADING" : "", + "#define MAX_DIR_LIGHTS " + parameters.maxDirLights, "#define MAX_POINT_LIGHTS " + parameters.maxPointLights, @@ -4837,6 +4917,10 @@ THREE.WebGLRenderer = function ( parameters ) { parameters.alphaTest ? "#define ALPHATEST " + parameters.alphaTest: "", + _this.gammaInput ? "#define GAMMA_INPUT" : "", + _this.gammaOutput ? "#define GAMMA_OUTPUT" : "", + _this.physicallyBasedShading ? "#define PHYSICALLY_BASED_SHADING" : "", + ( parameters.useFog && parameters.fog ) ? "#define USE_FOG" : "", ( parameters.useFog && parameters.fog instanceof THREE.FogExp2 ) ? "#define FOG_EXP2" : "", diff --git a/src/renderers/WebGLShaders.js b/src/renderers/WebGLShaders.js index 0d35f1ae..e242b898 100644 --- a/src/renderers/WebGLShaders.js +++ b/src/renderers/WebGLShaders.js @@ -76,6 +76,12 @@ THREE.ShaderChunk = { "vec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * vReflect.x, vReflect.yz ) );", + "#ifdef GAMMA_INPUT", + + "cubeColor.xyz *= cubeColor.xyz;", + + "#endif", + "if ( combine == 1 ) {", "gl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity );", @@ -185,7 +191,18 @@ THREE.ShaderChunk = { "#ifdef USE_MAP", - "gl_FragColor = gl_FragColor * texture2D( map, vUv );", + "#ifdef GAMMA_INPUT", + + "vec4 texelColor = texture2D( map, vUv );", + "texelColor.xyz *= texelColor.xyz;", + + "gl_FragColor = gl_FragColor * texelColor;", + + "#else", + + "gl_FragColor = gl_FragColor * texture2D( map, vUv );", + + "#endif", "#endif" @@ -391,8 +408,18 @@ THREE.ShaderChunk = { "float pointSpecularWeight = pow( pointDotNormalHalf, shininess );", + "#ifdef PHYSICALLY_BASED_SHADING", + + "vec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( pointVector, pointHalfVector ), 5.0 );", + "pointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;", + + "#else", + + "pointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;", + + "#endif", + "pointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * pointDistance;", - "pointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;", "}", @@ -415,8 +442,42 @@ THREE.ShaderChunk = { "float dirSpecularWeight = pow( dirDotNormalHalf, shininess );", + "#ifdef PHYSICALLY_BASED_SHADING", + + /* + // fresnel term from skin shader + "const float F0 = 0.128;", + + "float base = 1.0 - dot( viewPosition, dirHalfVector );", + "float exponential = pow( base, 5.0 );", + + "float fresnel = exponential + F0 * ( 1.0 - exponential );", + */ + + /* + // fresnel term from fresnel shader + "const float mFresnelBias = 0.08;", + "const float mFresnelScale = 0.3;", + "const float mFresnelPower = 5.0;", + + "float fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );", + */ + + // normalization factor + //float specularNormalization = ( shininess + 2.0 ) / 8.0; + + //"dirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;", + + "vec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( dirVector, dirHalfVector ), 5.0 );", + "dirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;", + + "#else", + + "dirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;", + + "#endif", + "dirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;", - "dirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;", "}", @@ -439,7 +500,7 @@ THREE.ShaderChunk = { "#endif", - "gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;" + "gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient * diffuse ) + totalSpecular;" ].join("\n"), @@ -481,7 +542,15 @@ THREE.ShaderChunk = { "#ifdef USE_COLOR", - "vColor = color;", + "#ifdef GAMMA_INPUT", + + "vColor = color * color;", + + "#else", + + "vColor = color;", + + "#endif", "#endif" @@ -600,7 +669,7 @@ THREE.ShaderChunk = { "#endif", - "vec4 shadowColor = vec4( 1.0 );", + "vec3 shadowColor = vec3( 1.0 );", "for( int i = 0; i < MAX_SHADOWS; i ++ ) {", @@ -634,7 +703,18 @@ THREE.ShaderChunk = { "shadow /= 9.0;", - "shadowColor = shadowColor * vec4( vec3( ( 1.0 - shadowDarkness * shadow ) ), 1.0 );", + "#ifdef GAMMA_OUTPUT", + + "vec3 darkening = vec3( ( 1.0 - shadowDarkness * shadow ) );", + "darkening *= darkening;", + + "shadowColor = shadowColor * darkening;", + + "#else", + + "shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness * shadow ) );", + + "#endif", "#else", @@ -645,11 +725,11 @@ THREE.ShaderChunk = { // spot with multiple shadows is darker - "shadowColor = shadowColor * vec4( vec3( shadowDarkness ), 1.0 );", + "shadowColor = shadowColor * vec3( shadowDarkness );", // spot with multiple shadows has the same color as single shadow spot - //"shadowColor = min( shadowColor, vec4( vec3( shadowDarkness ), 1.0 ) );", + //"shadowColor = min( shadowColor, vec3( shadowDarkness ) );", "#endif", @@ -658,11 +738,11 @@ THREE.ShaderChunk = { // uncomment to see light frustum boundaries //"if ( !( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) )", - // "gl_FragColor = gl_FragColor * vec4( 1.0, 0.0, 0.0, 1.0 );", + // "gl_FragColor.xyz = gl_FragColor.xyz * vec3( 1.0, 0.0, 0.0 );", "}", - "gl_FragColor = gl_FragColor * shadowColor;", + "gl_FragColor.xyz = gl_FragColor.xyz * shadowColor;", "#endif" @@ -703,7 +783,20 @@ THREE.ShaderChunk = { "#endif" - ].join("\n") + ].join("\n"), + + // LINEAR SPACE + + linear_to_gamma_fragment: [ + + "#ifdef GAMMA_OUTPUT", + + "gl_FragColor.xyz = sqrt( gl_FragColor.xyz );", + + "#endif" + + ].join("\n"), + }; @@ -1050,6 +1143,9 @@ THREE.ShaderLib = { THREE.ShaderChunk[ "color_fragment" ], THREE.ShaderChunk[ "envmap_fragment" ], THREE.ShaderChunk[ "shadowmap_fragment" ], + + THREE.ShaderChunk[ "linear_to_gamma_fragment" ], + THREE.ShaderChunk[ "fog_fragment" ], "}" @@ -1131,6 +1227,9 @@ THREE.ShaderLib = { THREE.ShaderChunk[ "color_fragment" ], THREE.ShaderChunk[ "envmap_fragment" ], THREE.ShaderChunk[ "shadowmap_fragment" ], + + THREE.ShaderChunk[ "linear_to_gamma_fragment" ], + THREE.ShaderChunk[ "fog_fragment" ], "}" @@ -1230,6 +1329,9 @@ THREE.ShaderLib = { THREE.ShaderChunk[ "color_fragment" ], THREE.ShaderChunk[ "envmap_fragment" ], THREE.ShaderChunk[ "shadowmap_fragment" ], + + THREE.ShaderChunk[ "linear_to_gamma_fragment" ], + THREE.ShaderChunk[ "fog_fragment" ], "}" From 4f7fe37a7069083467e0f0228cb628db3fc5af0a Mon Sep 17 00:00:00 2001 From: alteredq Date: Wed, 12 Oct 2011 03:40:41 +0200 Subject: [PATCH 02/33] Added forgotten texture. Disabled browser-based antialiasing. --- .../textures/patterns/bright_squares256.png | Bin 0 -> 26698 bytes examples/textures/patterns/readme.txt | 6 ++++++ examples/webgl_shading_physical.html | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 examples/textures/patterns/bright_squares256.png create mode 100644 examples/textures/patterns/readme.txt diff --git a/examples/textures/patterns/bright_squares256.png b/examples/textures/patterns/bright_squares256.png new file mode 100644 index 0000000000000000000000000000000000000000..cc9afcbd033b4ffc017e735e47687639b21a9b40 GIT binary patch literal 26698 zcmV()K;OTKP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RW3JVl7FKr2mDF6T<07*naRCwA< zd|R(H*K!-lTC=4S#R2k||Nq~dAaQ`iImeQAuOjon-m(Eb=<;c%r@L2G@mBm_o_HMG zKTm?lBtpo#f0N9eWS)Z!sO5OBfCZvt?m-As&a5XxBl>pcQsSS#gp{rP>hJ)GkLgd6 z^Si=0v-)KfWA^j+u~vIbP~Z~T3HDe_v~$G-pR6)>mX<$PL=0z$?4OjS)&9+db#cCL zh%kKq+mlQZWOJ^P^Bm;Lo-o6lK^#R4aG0zxi~t85^Y|tXr7RO!iNH_H-n*R;p4kDT z{Cc*ZoQ3sGaAy-f03QHLD!@gSSV9>>1c9~ggdPqDgH15^b3-{Hl6XAeBF2EjB**8# zg7AePh?HNB6>>4VQ0@@x@g#^9(m?`ANNj@0f&f4S*d(N+*og@y>p%(M1W*hRl%Zuf zn=v8mf-pk%E+n8yg@~O1BuS7K;TTz9V<4J92#GlBjF4yvn1QJD0>;#waOi$IECSjXVt*Cm#LP&5!b8LW2>}6sUK7Z0qDh2cya5OS#u(0IDKSXM zNkTCMITlF35Wo-#KqH92#6l)g(lbhHE04X8ZXTl(mLxN6*AQmCnKO8!UEdrYvh9D4NDFGrK zj{6Z|uptlq>y1Gn;;Wn6oO>$hG!#X5paZr*?_j4grLa8OHwc= z$sR6%xAlYERYtodX zVB{GB>iZS*$P_*wDA)jAF{{I@;bet)J`N3N!OTIxv+xFw86JR2bk5@Jda%hCvs$26 zVju|&D{FXRfC-5KxN(3ZP#i|b@-;zj5?nGlTKf(G2OE&QIx?`hfO8~)xxfYqvBRNz z{5+gkE3G#aiKCnuI0$@~$q+Nlgmy$bpt6>4#z+*5Rmje^njaDt}Kp; zU?L%8BmxMmV!!SE5iHNmh zNj6C_f%<|*NJIvJ7NHT+6Uzi4fiyWAKmaJ>ER5T#AwW1*AO|rW8kws=ZU^ek?LQ(! z!0?|1TbMWi02&`N7;DLRJVrzSCQJYpA;W@)&Lm?fp5H%C%V;bG;eLT(!n8qU%ppt* z*rCHjSWp|v=vRawJla5+?=~%&BsOTtW)OZQVFLaxg6uC8WyGv&q*^lAJgU z39il~#YsQ`00f*J)5IjE-K%$IL6R98fL06xz2y(oEWx*NoE^ZRqVQ6G(8`BXPQxb&%C30d%H)Jk{Xzx=9Gv*bALlM+NUt6TtL4Jk_ za7Dl~5ED9Z0DT?mNL1p{?)x4r_U=gSK#7o%LdIB5Tc1H@I3&)J62di3NLh43;84zLDm~XA|){Pnt|}XK%_trCseBtndL@Dw5S0|!hy8(PfZb>I4c+= z0;FdPIA9im2BF!{q)juVc>&-c3TDkX5eW?Y=0Kr7Hpt=H2FO7!lf)zt3uJVLW81m? z5{`j(9}qH_5Mlx^(E6o;laMX7SyCc`#16s)?g8yEO9X)pOq3vCY!7H~6@VBFf=QcQ zLT~~CmP7mu-vsD526k*4aS*(7a{e8b>=}fJ00cx~E5#(80v%xqgX$;1eF|XS>!%G8 zB)}{TgVa!zC@CU4(+6M-FbqH`>ktA1kp=-}V?)f41p=Ttq~L8zFNWk0Y`wv$Bup`y0IRs~;#^}u znm!N3ApK8**64c@Eigr>02O19Ng`$l03L(k+!rwdTJ+zo07Q1IbHVW}gO#FW2-uj* zW9^_|7m*AEqAg@xoa3MGN015H2Dr04$=S54ElCUR$P=AMG%h|@U_xX5_=;z#tFu0f zSr9FkP%;RjI~ZMjfXOvv=6kLI9AuG6=y@iT6)pw-p9L8* zU>Ps)AHamhd9FEJkB5Qj0g(?DnfW(z2YmP|33wcR(7}*@j~D`r-!6n5z$+!x=5&7I z{9T9@*}svU(C;{88JE!`z`p{D?gZcJoz8!H6h?cVe|&ZTo6sy^U_z~hDq0qqa~!B7co zMbKN1djTQ<=msFxWfTYjWQ#}`gyS}Fge(>$vVLccHl~g?{a+c1U>L$AG$EYMnC@65 zlA$zja|?l+K@`(*QrI`8;6#7`3HCc_*jkD-U{X+NOeWd5Rg*4%MwELpCmO>eK*xf!^xpaNxaRmxLIW+G5j zB%ecAEM2)4yag};%$I!cEA46T9d*=Sj>rU~(1r!EAc&*b6p~_jb+U4HqhW-jjRQJM zg6_bups5jTZ~~AApOfSmBK;mMFWzx)1h}LCh4OMQ=`=YK1a$%l4nrOlPteSz7Hps6 z`c4Raodr$bpxkeAVvIOhJ0PHUq$^P6&j3f}(K@6|V!_KM@MFh*? z8s75qH?3))fjuNJ=YXk1F+&4lZm>pH2o5R6Vp}cfDSbId8J$^7cH)mnD=17zlE2<# z+<^z6?=j7UK4u7rx0Cziy|P3ui96_oX)#(1!ziN_0FY}ih~kL;xO6Z;?4Tf~WH||H za%BzyQ*Ij)FLMbnBoU}J#M3%>5{Tu20O(E}OmNmpS-TCwHt_@tM$ydxnkyh# zti#`K!5WKwca;bQOrQKb|~Tn2`mByaL7oWB8afv_K3bO149>5+G+)asj=u zz$t+}{xC}9T@pfU8JQ@#&?-c7QBoHy|M$~cpiuoo=J`|R%4x|b5h**F4ZlBb`&x2k zW8ozY#`qiJN%r%U>ehR2>0%e4R4CR_?uQ0Vk4tezDn^a8I0y5Qa)ty>s{o1s1g3AU z41@1@wa$t&33xWL+Y=9~>RCfbqccv=?+3;(vOU#a1}O`w33GrdIdfL4!BB@oE^K*; zAxF_Ml=TjPsfv~(?8Y3!#2QlPDD64Kp){r1KoV4RPLVedBTH#bOT0*U3=lwkJo9}N zd6p&z4`l^ooKQC)E=fEinG}~k4{2(1$$;_LVX~(u-60O)9N9 zc-90iuRu7_M`;6*K?2Cii~AqTv-6d4oG4}faWYiYr&N@ zK70-XV?{*ql&}wCb3?I-G=uCjsLH$W?^6RtW{p zG3^LL>MuP+6~V}m9D!K^hE?hnN!i>C83@9y!3nz3Ej16As|F6;a_LHj%Q=6Q?{F1SB&*`g^7C8-~iPiDUs{B)?pel8u8|bQqzL zF#!lBh%I<4$V#>6sPe}!!Qx8fdgkZDePywNmkr3RW$m}m$lWpT(cD7eSo{CZEPqrhI84_BS zPD32oAe2hv>GT*zv#EiBWRy5slQQ8Ok>KGtVvo{bfPNF;lLe87dSX!#m z{tHX{@7FNag=-3FW5Jc!cO%Yl5DSyGXo^f_{}D%59PA^rVi$tLKEz7b3cy;i{Ix3=XMAXDP4VHh0}+PTRl+uuo~rAg~CIe=SL!(PXKzX z-^D=pU#s&Fye^IE5g>uwfYu?9`&PzHs2!42e=3dSZO4`?uE=m$9eDts^~`(LG@R410EiiT zN+fC*ICsQ{#tI${Zp;pWJ)nrF6W>BctOJg0)CwOS{Dx??xMb z5)EK78x1fyoQc}HXy_@E8o=Zc;|nslo-J5ps1pcEl<|rXa$e3h!R$xA8DIfFJvgt1 z>5O!VWHqz)83c6QKXBD$EBXn* ztKt?XxUz4`k8n7Gt`SoU5e~)qSS5mz*d!fHLdUB;x?psckWE20u1zd3Uh=tKGbBr= z@c9Um4%3sUlEH#URa=9pN!Etj8543fJ4u!@Jn0vLP?pBY=C5*9dD5G{rikjBTuq3~ zs)B(6ONKdh^H?JLOzNTZtJBxv+sDY>w4$ifbM#itSE@w6Q8Y=Mg;2i+N!Y)_*E-v4+}10tyoHWDR3^_8dxW4UA{HhLM{v_QtH$T z4w!l(JkQxSJYd@Br24iD1%vm77plv2<$f@AdHEUqMJ6-tf-5h>oIe*YX|uyCgnRh& zs5D}PoIjNSl%0Ew4c1!VK>%sNF#0&cX7r0G!L}UDe zlZ}!%Dpev}!+8xGac~yYoIBjz%kZ`Im948e50lS^eheV{wCmCg?1hta1|AHC({o$) zhyn-GVFn+JShys@=hUhB_Tw4O&5*c*8>WKd55Bc({AlKCwmL6(ZfEu zN$3qz#`D8DqGJEB%EpIeR@XCqU*YV$gjB0Io;Ff(Ktj97Y$nN$G75ZwT)^q)W`ulkYl%U~~l&E|8q*Oruv59+Z z_E3}!t9y+>SW7`(mA|xiQUl{go4iA9{cb=o{euuYyVA)ZwKB-Tq`)ne!t%~MwNJsr z5JR*!#Tm`U-~foWf@C|G=8c`uQ6N%pB!%kL#VY$SlXIWU-&VHU_Xx zV4oQEND4k0itE=4f!8^n3Ag^}^*Rd{jft#zC;13kORh39yZ)j< zve^%Zw)SrU_AH6e^5~wYs`$m%XEEY_axvecThzsD=9IdLKW9VbbB_t(VfjxU-sOEO ztd7SC50=(5mdQX{v@v>KVshb+h$Xnc z&=DPelGElHz;mSxvlC*^H(W@chC-r5+(+L6q;_N$rG@#-{2&JWUGNL~m zJDAV{Riq~DEuC`n6^349nR9!#qr9$qp+z5DnUf4egQGtbU|y%~Rd%G(AFrnR(u2ku z^Lvdry!fehFSVU1*!r216y2>i9+J_rM1MULY+q4sp zmx0NJF$c@hgXeL$&}gI~m6eDo860osIMQ}tSj-OY)AY83TpDEaaH8+I?R}nd3aTAi zJB!ffah?N;_-x5_$2|-lsCI4b*j9P<@TxN*C>gVxrRccsOk4&J*#OIx_MG%ZJ1mKp z%nHxAPNj=8TxBxBm~?A=A3tbXDI<>u#^dS(TMTQj{0zP;!*()27T z1Ej&_Qap_Q$~W*OO6P)e<=0~ngiR`-d4<4X#=wbFLuV*nf!qMOEJ0JD7>3Aj>*O6U zuiS83ucgMOIOqxie=r6XIhC)mhiL?mc|%1ku4(8IQ|p6}<_b=lgfU-XtRJLA?l=ql z48LWi3af}ZIc{}lvNnep%;o${cb-Qf9x}*-DI5w&?->MQFf@L$!$B4kA7+3VWP`56&~OC>F|@Vyx{1Dt zVH4A}3PrQSg_6(KzXO`5VeUlIzBh`XxPu6ouCf@WF3QE*nLia^!6c((JD-#Otj##Y z=B$6P_<+r;yczTPZd16kr+WkfL&RE{Ba1it8p3RW<)o`RS*X$Mv$DrcsC2yW(Zld8 zl(<5<8-u^+A`=`#8=7-*{6<@#jpXS-gKc2jqfFq47?l}W3DGXVWdu12U27C_iUR9V zpo5&T%~L3s(^R+j>^Y5Xa|H1UyU&c|O?EL*Bppzkrqk=*p%zpYxwusYlF_?o0ilwe z*{EW9+&Ip;wL3#hIzxMh~~>6&Qi+ z-X{L<`u~Ia0BUF^f8|WyQ2D!U>dmp3a*X5Y|IJ`| zwi_Bq=WA6L$B7jY0_Te@bj#ZtfxiBlWH2uwAFMsge24^xC-xz2%42A)hM8jCDk>-( zn$EfBwc`SJfd##CM1W1klRq;<&=|zK*9Ai~t42ipsn-x+AwQ10Go%}`+B08adEYrc zbwNNs5qLF%=;Viks{I?MYo=;Xd=0W=ZDv~4N}2SS&-@uko>F= zag%>jRHK4WkKcGG_u>dzSCI4Q9sD#)=VKroPn>0nHsC$Dc5QS7qc-CPA`R*iAd_p<`9XPpaW z3~Lq$Z`al|DAVO$S&o5~x+O5lSjY}AfP=&DWzetyl?06%duWQp9TPj>O(k^LGn%J2 z=XIY{UA(8pmt~bs`zV8on|N0%ZgYMvmQ%oHi3}Ky7Lejd*uYgv9QnmLN+cv1Qc7)d z1Ow?E1J$TzhN3wp5XO6PgkAni>*jA zT0+q?KTn-OuIO1+ueRv$p|s=R5?0Hoqu0Z>)u-OwUa0}81#ST!GtljPGW)Yk1$>kA zm&z%M;Xe=G+{b3H;A|c2^((&-Ka03*#%&k~`wmU)Mj@hks={U&^+n^)(Ip5AV;Y$I zi{V+Z6*8EI2g%2*XdcAm0smc$fpEunTEdapIwzvu|C*Ww``|_kLY}gglYL(h+5)hh z4SfPdt~s|J6?C=jsGA>x&!@)uZ)+DA#L^*mH}^Iq(^%37S3e8ez+-Py;EN*s z%sC`ZcnEY`7&%kxJ~(sJ05S8exrC%eeulG6C@MxRTv$#iwQf#(%fN>Dk8AjF2o2$e zLm$tH_69Xh&cq__fj~_TZLEO-dBBB5-=^~zH>T(veRRa+<_M4io^DR9EQ|rRJNHbg ziY*Rs-;jUbLGJ?F_v4B=c|gn;cDkRmxo#ff$eRU($Jl*$WvR&EkWlPt`CO2TJIdjD5^j2F9O(ipgsb?qv^Koml(17XA8HWI z%R##iV9sZFuAp=gJ|GJBq1)j-3TJ9$<7AHY6yOPWYoL4O7F&r z?(JZ-(?c5;+tsMN%^!DBhoj0ac}EpA48C3Ll6MzM!X{Ni=S@tiv|}m_y)+iMw_L#+ z$&z-W3IJL<3tlSenM=PXHNCQ4#DCXn`ne^X?If zUwrub4M|Q{0;tw1fWtU5K(rw;D0$OeyaF+y*R>vWb*5`-z|{R|Zv;Xb>)lrncL#+E zGyrbE(Y`vQyZJ;IYi+#i2y??ORe7BU)#g&A=-qfH;3s4GlQe#vbl|Q0kB~ulMbe`IKswU^?npwsxV?6(^GhuuIzo2>Q}b>nCwxI+HLRW9-dR)%udXb)Z&B&>tYzKk^N8D{4RqE8OP zjBM$o-aq_!!mG7}sYc#;aw+bG9bW8)#16?Ng%vIE!kc)o0JZm)>qErTBP%JmM9td;IG< zpN;q@JBe^4QwWJx( z7>3{f-3%MHY{M{SEOpn-*rb0jP6-gCmegH!D^H&9i`bi7%kEzulhTg`(*NQXHuL*^ z(G@_R1^g*YCd5@CqBvp?tl$535LpJ!g~B})%v((RPeT0jl0o?Mq?|YX(d|j}Z!?Ko z&N5FD-k+y3Hsf?X+*bsf*d*pLp3yJHD_^%YQ)EdKRTh}2e>rXXpZKX|W44utjbrh4 z0`#DA%|rEt*^aext{7w6ODE0{J{%c;VDTP?I4#+=aWVZ+6<`XneSLj(^119|P}`q9 zqGd2|Ygyb#4^6|zF)A)FU@J*|AV#kp2lvG{O>nE&{Z#LWVEk?|DY(zngzrzuah^<8%9Lwjxg1kGXT zC)Gee%2Akcn^~%JIN7D_fx+cdF}VMmS|~H;(dp%+eQ>@*Tqhel zh=0ao{hR}J>6pa$i43Lxoo#rr^S##PqxU7C1Zv;wmSjH?z9}H6<`mqeL1$5qiIiYP zcc6zZZ`#eHhg4xkYHiUSY?gC&1zH{ICF7#(Ve)HiGzhfNbS!|rjS9r~?LZ3dZC#H! z@IDDfAW9`Av#(GXOnJXGU~sgtXfDj$o>uN7c!7RfGy?E_<6$+7JaB0yj&el8x*lme zi%xKjC}f$s3B%7h4LhteCks$DXV{$i>4|bQB>}`)CX5d?YIxoW=S(8%}efbqop7kwerO=`;yWY*K8sP_78>rr}g=>|A_5FK_z*96JnXM5G4Ll5~qW$O;e%->H} zKYS^_cNgnLB(0BkE5Waz-a#=~Zum%q#oM%bse+4w5p(WUW(j*99Hh{l*2-T!#{%K) z&NN5{KFV>(&h4oL=La!0YpOIDOiw~{2HTncUTQ;77lE#r58;*}eh(P@d2mZ13-_N^ zk6zyK&0DV^3SYe`;f;M3u-t1%W>R|8{2u3?+ndEwivC+?qZs@%qv}w4OE;yo`y)qN z&~=DThgC|!QU1=04KcbvY{hQpihuv-b-=T_23BjXvVt^4nN*4bY4Aa62a3m-Y~WT3 z7p)}&8q9zj;_A~BiG-nr(v_ay`O96J8N%`k9J~@0J9X`gF3ARVuIn&C0V5l= zU=Dk|MsTeqvcBiQqY%*G9)a_#_((1}XI}^5c6dFv`5~L)_~-#l7piNo!izdR=|FkgSz4 zyq0@h_A3qwpf26uNuOSCulS(ceaZVpBKzEor3f?)fZNF^Qv<;8r5KAq>E#|g5*Aa*kR_jqP%s7A0nZSl|LkAN=A{N!p*p1Q49lqfu*+{l_Je3COIx znSxaOj{dKB@t164WNClXVj7lD6w*x6-=8A$U7|JW=LM_TRD9d2^SKB3KUxIFM zYe38@_Dt_YDFe4tC)Ezry$m0xKe(Oir0J{e0n4vXZw1m+^rJ@K3$ZB)tmj1Ip@*5c`kE_#xOhvb<@66<@4 zeQSX8_RLRgmKej!Vbm@`wxy#V+!#!nm;BBI!UfiI2HB<@TBnyGtj^idY5~gkAjoh1 z{PJ7^6yk&Z61bxX3rAuupmV|d?N94)ZghMbxI=(-k1VY&JU_-b#H0((24aTZY&6wi zwKE&oU$3$I6Lr*_A+R{O-tVz3TyVu)uE@J;S)nRDHbc#w-JDgTjcCO=Ht|)s+0_Ly z`}-GyV`@F3$I$&laOTxRAnvCj*NDDv`0P7e&!zQk5$N}f*2)`__gCir!p+BIk>Pa= zy#<)A1YbpZS&!_m*TpxogcmXYccLTT&!md9KmOl=ifrh5xYg1-?DN=u`4#xXG z-cEXE|LyF+0X`SgR^ybxJ-`2@sP+aoS@#f3Xp8g(LEf{U*A!T2kqi83#p1Se!VCJ0!%lv*|Jt{F)I;0OW(0zOr(~gQfB15$0V6->B4rlk9EC8 zgW3;j&4qc8#OCbK#YWFs@%stmId|S(iWMn}rPROGXm|K#)9V#Xb}`AHv?-sGrY%Un zV&Tx;;7laCtD%b@pJk0fZ;{Yk&0p9BLtHmZu6ftUzFH*gVwl*H3POaHpYD7XM%(_L zw}I}Yt)c2ygQ#hf)f(8~8S$n6uVuS2TP-#wngfHGnJnD#a-AvrWK#on$wWufVAOhB zwGcAhUCq3%dqLSWGM!wa|Av?mB@^c&Yi@|O1Ur{ASUW=2s>el_)&b*-VZMiqk2p$Z z7TDcv3jri?=BMo6yX$m}vv^%hqwy7jb=qhb8glks@AV+W>S3WpgwlzQH!VrRbdY{pA6M+4QoDC2`DWr6K3&Qv*;0 z%Ugh4=BRK;4yiSiGZ##p&o5XXOlEjb2z<{x=n@{w!^d@*wmSA;S{Nr2;Y)}zkvs2n zgP#!qjCj<<3Q?Ia<(w}Kq~l=^QcJJ6oe`rYn1(geH+#aJw*;htkK+@{1FN^=E*e&| z%!<JZMk7|NnqPdEr{lU za?=lLpU$igtw5bzwI$6B?UyTr=v=x%4~6pC8fpg61CVj{))d@NqKeC6-)hLD{TBnb zoCld;req44;Qz^eCEZah+Q0rjOd?D6v6`xQR9?UG-TIG3MmJJ)f$YbdL4CMawj_uKMw;(NrxIq9ap8R_2|UeT=#(*{IXcN4F)wVRWq=Q3LRUOx8S+H>b(DZthwm9mUbLY!1kPtF8D5ziFw@BX%1&(O8w*huyIT=}C@ptS z6GUQ9k(}`GI>=br@b`Bg0jK=qn5UKzdtadO5OFRt9g%%Ji z0vK-3t9&v}bt$g8*-(>`iYs2@Enu`L;P(SK~U6n+*9DEegC_uoGQz((6qf6+V9!?k+*9eng0@u@GXewjFReX{d1GWi~jt&0qt z!@a|q;vcV|fwONZxN}TyM7pfIIxX5_0B>sF?S*t2%$uYY>3H7b4f|J(mi);OEax_& zlW6@x-?@b1I+=$NuGj?oDLdiw+CP3xf>Y`&&h9)?rrxJoT2^6BAM6JkWPJ2qMSJF| zP=@WSSZ2fX3C@wl9dm}FRu}US)^dKzocH6?CwD=BUtuwK}kBMf3!P!Qq#qQ+VAc>;Vg2}y`TmsrX z3(}|9p&A@Gjl4>v&jg{q=e5!3C?`u@#?x;HqmWC4{&i1!kndsY;THVmXO$4W_k;U< z1D*wNas~dF8y5S=_Aw40C#g ztIpY3_hw<1(4M)|VDWF zJIWZqIKTc;9%eZ7XTzMF9Yv-{$^9MpKEs2Md57QAw^Oi)TzEqZXT%RAq^tX7Ea4b3 z$4WBIGMicLkD{a4i z@M=K*5uU+d6VtaHVm*+u9P$?Q&kZCMPw>+H0tNN`=5<_cd-GVzsw@s}nuk0#Qft%t zS#FkVoWUTMI&l2+G@w^Iy~^+gdl5|UD9uQprykYW>tJ!l=Pp*yvb>Azs+59d&g+T> z;)=aQ>$wv&oD(rLjy+xFfWP54n)K`Y>oXsL|UaGRLhmc1^%oAVYP)`{Y zcID=82ye8(d~TKozuu}6fbF+q0uo;iVv9%nGMk7C9BGU9MJ7+i8nLjVLRZ|w$bRG; zJJ$TfU%PMa@ilImKO}N8lrO0%-QV@a_BR!_%eSic9MPv00ks)%i|cLGobK88EwKx) za_g)8eYcy|ohV3Jr8raEqzvZFv&k4}|GZi(^*!a)yQn073Sy)kr7*a|Wa27knVoyY z9trCbP&^jv$nHO0IA?0fi&5m@8;C(J&u1FC%Fp!qX9!+^p8eB(oId&WM$`tyVEuAc zs%1D2{85_Uqu6gtFG&1!W3E=CkiZ_5A~zT2H0{%g9-lI!`d_0aGItW0BshajqmXDF!l2Km`A+ z5#<3TrxvfvWx7SV`ieQZor~3r*&8Tc{2PO9Ww3zXLc+TUxW8mDqr0uX@$!EYy4U;w zw5a9E)cwR%W+Mjw7#GPl$YW{$IgN_%xnqPG{br}I{uPOv!Tp$-`@#1Q{(Rm4{gY&{ z{I!!(94|`;vjlL3%YPSeR=EH53mH>@vzf`~|2pp*$|ettKsK<8tgHRm2c_>Mc| zD$W#{0+VztE~Jqa`Xr+`x*&;xt-<}|o*fLSxkM%}jt-CaV0SXm9|;%aS<8oyV4VuC?ljW+7BYnn_Lr{% z`ysxwp{9k=hLIK7nimjjcgJ7m4TnK28U`<%5bFp+tlLP%O!*{!3F6LjlM^_%;j%RA zt}){%qb7A5E2nldm|Hx>y2i_-?FLT+q>TO&GYzy@HQoQ|UI2_c6YjCK5pwuEolcVB zP)aaFaGoDohZQovxpU8fIC2>OQ2*L)h}EhQ-sFeg^&3QK3sZc;mj_fC0fWs0R1tp- zUMM*!v%Dh4&Z*oNl^FJ?O751_#vb8=^=NpcAM{NNnCzow)Ywoj8q>(G(@!XXnzWfkh zmfu?tq2$g>`*9LqV7z}sB39Pz zujEG^&e8=IBZl`VOs!PyE5FcFp8uU&!ejr>q?UNi+7d&(Wu;hg;io;PEYc!(jxLbc z;|p2C$`u_SCh~^RCz)2%`O3JLB|2oa<0&bxnnYHGyp}qZ0;xy--4UkQ`E;S`A;?Q{IvB2uC~pB-n; z#XxQ~&JJ&ei=2&zo-BYXM{p6JgAK=rUSO_Tj5KmNA*Z9u`v(E!JYZ`Sp5IdgixgWN z^S0RZ;t^w<45Mr1Cij#S{pN{8ToU8&*%!MniX!J}lR5^X>B)|R_y>tw;ThnP zH0S&2a6ge1QhRuXh^7wSfNdv<&sw}cIgk6(DQhc76JWT%Ok@vJ00@0{00uWSvx3`Bfi7#C}1RsXT)HUc%f{w z%$-Wb7;p)HCV)Pz>$(V!{ppRy8aKXNg=;sM?tjS5ES8%TC+Z%rnwvR7lJzhXM0Ktk^JsMvg@jLv1!TM6vS84ea9tZa8r7^gJR?z?*zkzS7zR9@S zMww6h+-A4fWM0I}dE74GZLO$>6pdrn z4A3H=f0+N|#gysFQZ6j`frUqqC=CDrAOJ~3K~%>N^ZT0AEsJ2E)J2T~?#BB@nN2c@ z>JKmc51+Ii`}hZAqGyk~^LDlUNfqR%Mko6R6*QPUK?t1<=X6@pw3kRuvrTR-n}U7E zdfvSUbse>pSJ=f8W@lG5oT<)dI?G3vX|oj+-B>|e^Yy=V!1uZ`k6GM@`>S6BPL;6H zx=Rh#_*K>9tF)7^O8xAu$tZK^tda=BO_KWd#9n=#QtR1E18;_?T94LLy*)V%KyM%N zXgWf)IV#S`eeRpUu_8$GeT1$j8^HEQyp^NqHP&tih4A>NYX6|)RggdP3I^@5*FfH) zeh_n|oeX_!2*Sl|4Kx*R_O`ZX#l#ad8s;4b=ZR^F3oE$;;SxJ;!9Dz6yLU5=O3+vS zJPim(++#+UNAV=epIRXizrTPbGIzS<@y7>-f9?1;XCwOj`Jas%kp7L&aa23ZdVueA z^Na5w;yP!RC2empq0TdZ?~vw>iTOQ?_JZb4gC>n~=0wmP2A+SUaLSRTg*N*2RjcxR zxf1Oet`tMk@0o>nigABPA$jn*FEGC|JN=Y?fgZy6fY>1VjaE{PjCWuOXIHv%W|sJ| zZUEP3W$i)4jXd6Y;Yy`Ybv5I(7yFKK*-k(5Mj$l z@|aTbdP?kOw|nSqI=JWjHK-{TDbjlk>jmirKfx>_Bzb`H*Kst8n0wF=QPC@Oz2ZtY zmkt%59!ZN@ug9xbo)MFAcSaO2ORA)jl$>6yYq!-@Uxzhb73k3ZKOT5Ruhm)Ez;rLx zkz!9V5UrO`cuoCBOl)qhzdnz%Pxm_Ad0b1Q?p57Lw{P9%n2iAlN~#HR-I9!-2k`u*QXjyX`x|!n_c|i^4 zCPLKDU;8qvhH%&vWv8VNX~X0b3AeWs#1~J$_;Q8&M#H8T(F}r{8P8ZJJ2j4<|)PSt2f+JfJwl5*NWBe0PIE74w0S-Oj`gsFP% zVsF=g5=SoWAPgHJAve0?;tO&4?BOhIx~sT5$-W!6CC}X9ULTy^CyRXu$NCX%o1f3z z;+Q?@2xB*Mv6gtzqXVAyjV15BQfk(QuazBq!i@9^QeCqi)CPFeRNx`uXnt?WqhFHUY5=cR?46J{xEFhp_zFqb+3_98mBnBR%7zCz0z?80X3PeZWt z1XG}+3-g)bwdDPY47QNKV1s$--{hTT8dlW?6O@3hI9B-Ok4PbU+wA1dxgNmGWm>SxOpefEoJa>@m5~ivsfmxq0d(vPqd$TPAC4Mq@4s0!2{|a z19KgokB6c1`8P6HLf(%fVDG$Csz1mvh@F4*!JHd>Pk?=oN+SAAG&h33ZQnF19=LkF z``}|%(XIR*U^ckFtQY#H=9kcbG0>kjRWS zdPC-)Iv!hyd9#foJ>CptzannCL7tboi+p) znj!&QQuKzflhGrsg%fAMB)1npZikuQVDA%-2LSFYi=W!4IDm-?{&L^5Rf3`H25Hhl z7`$c(LG!M>*(JOj+2x5!&|vcyO`$y>mp^ zg7bBvqu~))g_L~(oo}MO9u6EhW<~=}I|e-vqhuWsSD710`W8=vLt^XJXoQy`Ze6HU z)P#yi`Qm}a;qw~Wn^M~5@ME;a!BLmm!#LOY3G&gDCi}&2nbGY@=kD@kN5*Y4D~Ea` z)$*bn)LuVJ%^7@+gXD{2MCVjdN@4aJTm!iCkpx`VwRay~&J!f(;A+0pETbE2Pmd#Q zi3t7P!L=I#)AJT_ekPc+mOMX(q=xc}UG27){7KlPWwPcL)b;#uAt)!%njtS~w*6J{ z`V>IigLvh34VB_qWg{^B5}R#ic3zD2M;&p<`-s`7Y83IO3Je(bX4EQ0p?zgVsD*&n zGJNi$Ja4wmH(nm1$A$(gxt-mV>ZKW=c;6=s*iY{?++^rY592w756^jCIX z-_+in=R!}yF`r5ZKbeKXm^D0o$2%kCY41zxqaEgP%Q~V}CG>6W^ATKrZa-}V3$Sl~ zemtnXxA&+wunTVMK%o_CgL8wIEbuDRo)_cv1B1G#r!d9MG| zs;KB!kI-s7T%FrDmft|u@cwa-PZ0in@gFuD-IL(Jw1BxL_yyMECyhwSiQCI`(O{nH zt#go}d-(E8nBcty(;9$z|7rEo0ev2T;Q#V#qxmxPheK_I3pocj=j`&p%nq=mj~A)5 zaf!17fB!af1@fNXfSKc2xAf$h=+!*2Qy}->U%)y46iW%0#T|n452ae7{Go+n=pUNw zF#7%sS1D5#syuonv)~HNXNU7u;k=>wJ>$Rox6OE>9YUNp)G56mi25$m%F*fG zUXX-T-k zxUeC#Hz4`xAhu1}sC@ZCOL~=>_`bQ6o-MKYG10!klT|^D zMfJUaDRI5Mn?^uYHkDK3d|&Nl(7VVCy#0zE!Pzh}e%jN9ySwJrL-dkDdF>H`)3yM9 zQnzjTq*HTtVoIsETi0Gd0$b>^CV7pupMU-g!OXfki>j?VWDWCXEfP4%Pc5ZW-NxGU zVC+%rN!(74@HPbiL zdslMc+a$8Sd}j-1%mtz0Y`ad`&x^(r#ML?@+`#!%I7R7`xj>R{F{8N2>X78UP8qTq z>^bUzEq4qz@y@GRRoT|!5ak-9baTHrxm5i9^an`M{&Lh$i1=kY& z&=qz@n4t!Ws84S&w5Io_$V;4I?4(mT^0WQ_+`GnD=ghHS7#GQD`LEIgKXS;>!p&6a zp@;tW;hpx|g0ouj&V(16^A}Gfja@Vjyz+#b`5Npp3>#Cc1wHYDm0U%t4hqTq9ut{% z!Dg2D?A#_*fT}O!gVG5cdvZY>+(;}4=&a~^Dgd{8Y5CHpwRFtRQ!sO}od+q~I;8&E z&(*t(3et;uaG4-!k83q6xM)Ix(@0;zRc_||r|kfbRVZR%$o4!7g#^ySbflD`%f;v- zLFHnP!1#zKo|Y{DJR%0?)yv4f*IzgMr5y`FTK*sG-~DZo&G?Vf95dezyy^R&4De3p zMT#6epTrt(*NHSgsSHz>n3dr_+@~*djK4&zjh*YipVkoWf3^qayH+M?2q_#J z|30j7=0E>AFK9sVlEnUPOSYuHb&7NU$#3?Qt1W5y5UBjFZV(eEGPkr2pLcH!h&$_0 zC5pAJQ+;_m$+E{_CKe4-Drb#RGnTy*5mUyen|t%;x(1H?EGTPe!B=3#O<*~=>J+U1 z)&1oCRe07DKmI^y@MKXy8{%noyFp`E&>NGP!Rk)J0#9-3nt3St25_e@dLVFBFb9tM zYSB(M!d$(CV3Os7ro7%KJ-xl#6Y3k%IIlO=@j{5X4RCRUtCM)jA#5jt-$x^Q1cV0c z-H*r6EUL$&!8;eh+-N+g6HF^q5Ybs9-j@nZSXL{qM!fEBd{;BDrqVCs{79%=H_ryV zSu@vB^t$qzWRlBqa>$fN>-wPfnnVt+=}eAF&1O&fVr@A{&`_>1$>x3sqBUpKB!et&6*FltM?!up+ok z2#fB{#2Cip_zu-M$8fKu@E#;*PdEQUVg{T(Q+>OakC^nHG)0R8Fek7)TjRWm zbB~=412bj6>}J5PU~sLwB<<*)JIk{ZX=%^{WEts3{r$|D7fA(|egSz6ZNDJ&wu9n}@2`?Jj2VIzhbi0wLdpDgiH!T&3s%F$% zheomi9pCn%;b7ti9(s%QJm(UEt8Ub%3#0rjr1=*Pm>t+TRNW6xPy1>;Abxb^D(IRc zJ>7LJ9z~*%>)gwp&L6!Ms)R(?9~*c-H zM5S!mA2u{wP<+?e)?{1KIG2Zym%T)Wv_@$+9V_Jf-WX~sCyy-o57D}lC!P;x6@|x4 zuUf*kx%%zqyI%{{j0&G7M6eP(@^Lp3w2a;%!~(hvv>?|F;u6shBH!+Op7<~=@BeH zRqV$tQpvZ(mh$(uQTx0fY}g4uJXhzhs+!*`#_vq-XJ&$y&U=oAZ!;4%jEKg*`&53> zytlxAib1{RnBJ?6Crbheq`(VL3;TI zUq>bpyN+$k8SJB{Fj^wZAF1Te6s!+$ydM-Z^Os`9oBCAW`oaC<_sHMS2vtJb%UfZj z>F51`wk5XJf}n1kP$^sKYK6E+D)E#`sl^{AdAXkPucoj3^3`+hFChmiPg$j)bLt7Uste5U-dhK8_f%Y2iyGx zNDozOGMS}qqZa!~M)+cUzY4R$F@5cEx0!Qd*)xTwkjKy6h2&!aP$rCr&i9FSK|2tkv-| zb2s~81*e=^3NH6RKdm7I`WP85Efh*Y`D+IUH|$&^xZk1_+JPb##O=Sjd4bg6gE{BZ zs639UHwPCF0M`yqY1ljvHlMq!E=HIEI_nSTo{m7=AmRYHy5nr8?y%$r-J>+HNbQx+ zefh;%LKgDmGi(I&){8;##Bk@SFn-8i_se;$*e5gkNm(|Exsyj#A;c}5m8osJZucOV zRYO=^cTN_^nbaZ&I4a;_g-}FdY<|ybO=ApHP^3)W-8biG{?%=0Z5{`5Ic$b36bGewyjUvPzpkb+=-X ztinJyHt0Q@a6d3O=g+{ny8h!A`d-Wtq#aaSuh9A^$uDIO8d_6+H{9D*w)#I^L7g6k zD(#BSlKh7Vc<$W){9Mji+^RS8$3`y=N6H80lqYU};RyHa{ByWk_2&)*v#agC;@9mt z{5QUD!;hy{nHQM-*i(gUU@Gd({18FMAocwMxxe}rZfbR6@YZPvge|G`hpYX|j~;op zg0~+QeYylZkj!J6#LPq19Pl09@Xk>kqn#(dZ!jc)xC#&CMR|QBUq8S}v72QY!^>XI47T81CKU-qh)V+hd2{u#9*YI@D_9&A5XZ5wx1`)m1u;7|2bQjl=nY{UKt8`!NWG6f? zDobq{_Ke&LY0I}ejZT^AIxsAf4HdJ9+A%wv^5 zEU#H`Q$p?q1>3>==eXPb%W)CogGpU}4%&UTqh-c43^ z)DLt#bqoExT9ZDr3~cOZf40rZA|;GUDyk($_9f_8r-jJ-)(m7$8CB1j*?mwiq>jS} z(``Y;(NqHkclR+povO3=P37c0{1cPE9JtbUTJLWD_#Z;keyO;eA-vE`*gtb4 ze175*|GY!30p<5mNBu6qjcNgqf~LJ2G;f};n~NW(eKRfm(WSjYPkeWlgSQLY=4Esz z(LD{LWwv)hY1V@ADF`U38Z3=d$oYKFzK~wX?lVXe_W+AioUu0N-xA50ub50Sj*R-| zSUSbQ>T2vEX5H;z_OrZA`8GT8)vqv_bWctzqO3R*j;v^q{B1qM%W<%$`;|52wP$Sk zY{-ALW;2;x%y;1V{Xcx0M$wdhnJr_|Izc+zq5RH|3O0$ zzw=eNIL1F)J4vE{`_Ss1wqI0L<)^Fsdautf$A?%z_v6<0`NxV(^7(&04bCJmq=o!P z;fty|A(qeItsM~7$54X#{XhMwB>os3Wfzj+@Gzek)zN*svF|=G zKk0e3E|5KCWPq#pHDo*(P=9O-0GfH#%JUB!480W_5AbSSrfZOmD%dfqvLAh!RaC=K53 zN?+j|&tw#nZ)%YDbVoVSwf*UW)Nj35&=|(D-x=ZI4VxVieb6*?B>`-x1TZ%#G;s2E z33?qC0Kk%5Hh4Cwlk82#NaCHe*&zm+P^U_#FBa3CM74dmX=czWY{4fMa-;;*{l_94?kR(ZJY z>$$?4UK8?acb&SGvCxFonD5E_{}**OJ98z;4J8>_>K-q=@cX}_SA!W$t1?J0m|uG( zKoIl;Ro$BzL7tNzL_qH;fw!cxwfKaY%`u68=kDGtwkBN{OsP(W-+FBT&$Jo(_kt%{ zxIMl+FbXFkR2~grH4H`=8d7o;ynq}=!QG#tp4B&WZh2MkovDH=jjV%jDWH>ujf@(ETrn8H(NXHwu$_rtGK@cZX2a!E(v6OR+q&?9 z(hKW$F;_4VlUZJx*h7A^kk6Z{RVlxJ_REJMzLUXOe~?S8hI{GJ;9KF?gD}CsxOX>= z&&Ba#R=lUrG2xO%d*_|b&jP^bK0YYqlIS@WxCa-^PESkkz!8D|4)C!XO-QIuhL0(S zJvM0TW=1@vgDl8PU4w`;*=QVpQboxq#uQ9exbc8n1);x3j;Nh@`58H1+Z}R}z(Ju6 zYfhQCklTUBvyb84BSYd&v$FI)n^-WP#i8MEOX~9Cz%?=_Tj1J^mx<3W48J!SmBtt2 zUOpZgHWq zvS<$e>V`zzUy|nHQ{6q4?Cq;gw}X9mRNPe1cY(?8x%|^DynK)GmV+XWgybKuIAQwu zn27!=5|j7y@pI;$IZgwu)?^`mh#xz=d-|t|a(Q}xBa&yif=OX~vZwLTpC`Ry;hy}w zFnYJyK{z|QTWY8EvK|Iu%L1)SdDY2CDYRuw#y~!E5{%o-Zyz>oj)0(S*A*T-oXf~= zBuB5*8)n0CFT8HS#@KU^g^|8z${icp_Od*}%D~?_Pr%^YsGfME2UijwOS+WM~EN-dHtbKAGVF-&kU4*`iT|!@s zdJfv#VH-GNU-FwTpyhaOr;S78n{=`Sat|Ev@Dj#=_iJnr-Wk&8$Nl0Exwno==w9dB z{RsHcJL3rc)+O#7B^OqBg9B`9Q-`6(Hx62(XxBA|nD|DL+gS+it%@%LY~fsw2FFsd z7}dzy%J60(r~yeO9DFL@tY(2_n3c^zSNT(JN9HGF!)DsW*x&V#MZYq?)D=QvVu+c- z+P47SmL>*Fr1^1mRycxa_`*BMLT4(fMWna`61~P2Kc#3|qBKqZ5#j@xwt|QI7@o2= zIlYGrfSZ`g3-Ufr>A;!Xm?Wkg*Y=$`Y6|ml(;HHMll&qrTO!a(>@=TOb+~rC{q{BB z57fRE+$Mx9xabq&@foxWg4^HRH5D4ddWLW3E*u-Vs^Nz}0w2g;zFHxFzE&pOy_z zBzfN|j8$_sJSN(I$A*h^m6zw|_VZvLZ}!#?aNhN>#?lT5-!+UPr(Au&TQ}-+)9auM z5o3|TXrc-6Z0TLjDfL_Lk96Q?m#eGYGT^Ov!x0*Lr{Mo1me_rC$+Bu&BjZ*#;a*b!a$jz+K+^?{M-Bb=uhM9xWn??}onFIn z5G(;}v(OFmAr~VLKF36O^zYQZh5MV)#Qx^!_5xNuk83+0i#uO7m^SqyrDwc+cDD8Z z@GCQWZUTDgv2l_C?qol|^Kk&&Q{PtBd02fMd2~;6+KKM3xhjZJe?57X|A<^l?wI-xqTBxV zYQNKF*yCB@tA_!?`p=Cp4iKAXgZ$5pkJkMC1y=Nc|67*x;csUE?Cc+x<2?_h!#8>_ z>Un|Uahu3IjmS3juFHrkW6JOhJVm_Vm8v};a0^zNvM#PzAS~byI|w6xKkCr_YLOHC z9`s0vJ!?qYP`*PkEhq$eoHCuzn{f?eD@&`)K zt{=C{@@XOdVc?5`3gUK`REh)p4q8I}lP6g3&#vaZnoa)1t!Zc?___Y_)FTJ*kVQHU z5-CfncD{Ir9x*c?k{0-Jp_Bk( z1I}*g`h5&PtP=-q*lkGZ|GO=GQq_mws_A!y^j2C&xhyu4RQ1^Xx6NrZ@2Xv<-`CjhnIJnx#Exc7u$DfekgkdUUu>o zxCVm`ghI@`eDLG1DO@m89&% zyvA!$p3w5llefQLXD$W|`6~t%ww=K>g7cw9Urvw%e5eD$Z-PNlR@EoLpF<*;F z_JDB{iw33vqm51=?cNxhUq6ahzP^<2^tn)U$OUYFc#!WR>mls2?ZlfTxVjwqJl=N5 zxs9~)Rvc7D&bB+@tM{@lh%o}WyR+3~2;r2W*DU8?!;8Ct zi8(l(^E#(kZF(UwCv8=BAb+;ATH=xOOZm;Yg^SFpCX=5Q7`Myd-zVT?FFc1o52aF6^QSJ24t_@HICsA4r|xYBb%6f-|b~_cg1#DaB#^?Cz{K z14jGV7x2~zR>A!7@ACbtfSh!|(2wVAmGG^WCv$O1@Ndz4yr$LvpXV#dqpJ2@;+|@V zX>vAye_OgHDHQ1Osn8Ikd$WEK1(_c(D=mhv+*x<&u;^>;yR{UZm41c>$wWS>^N$IRa-0oF1}(+lQ)`<+ zT!c69M#2zoRv0FHH=O!k^?`Kf%Y4ozBv;|XHwp~FUYad&}DiuM^DeFC$@wt0yq44qDl5P6rh zH_%Z(w?6V@ocmRdG`9yM=<^P?6@o-7;f8l$;6h&1*igtt(#pVtzMhng=gFdUN z^P^wKMzFjuv_D^98(y!CEzvez)lIdKSe27ab${lNc@4gfCr3TjFIWvxT!@{Uz3hFe z6}r}D%Nq;b)97>P8Q|uLbmHoRrgy#foRGb(oMZti8b*XfjNTDZ*hD8_GT1DtrNlfe zZA*VYO!L~UrV*ouO0iNu z?o^x3wM&$GTACvPcgNrnOGS7c4*b1M?;)h*oFz;_MmYi`&G0=1UuudOKJGiU-I}4Q zz{Io_x8~AYiqv9eBY*W?J*oR3fKKxuT1K&q5x2KJzv6m(pEe6kxK2yboTk*!MOTKm zn0fLiAJ1;~+^b%z3=QM<$~|4ADdox(Z^IyOp*Oqa*wFM28_L_Ae6|@M%F~#GRQ@i7 z^ReKOknf)Coy6Zks_s1Z*JZTln|X_xQbl{nBZ4%Km25^HjC}g l0H0ex+u(|Ht{%be{{WtWa?tQsgG>Mb002ovPDHLkV1hOy`Lh53 literal 0 HcmV?d00001 diff --git a/examples/textures/patterns/readme.txt b/examples/textures/patterns/readme.txt new file mode 100644 index 00000000..48cdcecc --- /dev/null +++ b/examples/textures/patterns/readme.txt @@ -0,0 +1,6 @@ +Textures from http://subtlepatterns.com/ + +Slightly modified to have more GPU friendly sizes. + +Licensed under a Creative Commons Attribution 3.0 Unported License: +http://creativecommons.org/licenses/by/3.0/ \ No newline at end of file diff --git a/examples/webgl_shading_physical.html b/examples/webgl_shading_physical.html index 6dce4c73..c167ef70 100644 --- a/examples/webgl_shading_physical.html +++ b/examples/webgl_shading_physical.html @@ -375,7 +375,7 @@ // RENDERER - renderer = new THREE.WebGLRenderer( { clearColor: 0x00aaff, clearAlpha: 1, antialias: true } ); + renderer = new THREE.WebGLRenderer( { clearColor: 0x00aaff, clearAlpha: 1, antialias: false } ); renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT ); if ( scene.fog ) From 55e2337404b8143a7a322c21f5e1f859d9c8f6e8 Mon Sep 17 00:00:00 2001 From: alteredq Date: Wed, 12 Oct 2011 11:42:00 +0200 Subject: [PATCH 03/33] Added day/night toggle to rendering testbed. --- examples/webgl_shading_physical.html | 117 ++++++++++++++++++++++----- 1 file changed, 98 insertions(+), 19 deletions(-) diff --git a/examples/webgl_shading_physical.html b/examples/webgl_shading_physical.html index c167ef70..e0aaca93 100644 --- a/examples/webgl_shading_physical.html +++ b/examples/webgl_shading_physical.html @@ -169,6 +169,7 @@ + + @@ -110,6 +111,7 @@ + @@ -190,6 +192,14 @@ var sunLight, pointLight, ambientLight; + var morph; + + var composer, effectFXAA, hblur, vblur; + + var parameters, tweenDirection, tweenDay, tweenNight; + + var oldTime; + init(); animate(); @@ -368,6 +378,31 @@ addObjectColor( new THREE.SphereGeometry( 100, 32, 26 ), 0xffffff, -300, 100, 300, 0 ); + // MORPHS + + var loader = new THREE.JSONLoader(); + + loader.load( "models/animated/sittingBox.js", function( geometry ) { + + var morphMaterial = new THREE.MeshPhongMaterial( { ambient: 0x444444, color: 0x000000, specular: 0xff9900, shininess: 50, morphTargets: true } ); + morphMaterial.shading = THREE.FlatShading; + + //geometry.computeVertexNormals(); + morph = new THREE.MorphAnimMesh( geometry, morphMaterial ); + + var s = 200; + morph.scale.set( s, s, s ); + + morph.duration = 8000; + morph.mirroredLoop = true; + + morph.castShadow = true; + morph.receiveShadow = true; + + scene.add( morph ); + + } ); + // LIGHTS var sunIntensity = 0.3, @@ -485,7 +520,7 @@ parameters = { control: 0 }; - direction = -1; + tweenDirection = -1; tweenDay = new TWEEN.Tween( parameters ).to( { control: 100 }, 1000 ).easing( TWEEN.Easing.Exponential.EaseOut ); tweenNight = new TWEEN.Tween( parameters ).to( { control: 0 }, 1000 ).easing( TWEEN.Easing.Exponential.EaseOut ); @@ -522,35 +557,26 @@ switch( event.keyCode ) { - case 78: /*N*/ if ( direction == 1 ) { + case 78: /*N*/ if ( tweenDirection == 1 ) { tweenDay.stop(); tweenNight.start(); - direction = -1; + tweenDirection = -1; } else { tweenNight.stop(); tweenDay.start(); - direction = 1; + tweenDirection = 1; } break; } - }; - - // - - function map_linear( x, sa, sb, ea, eb ) { - - return ( x - sa ) * ( eb - ea ) / ( sb - sa ) + ea; - - }; - + } // @@ -565,16 +591,24 @@ function render() { + if ( oldTime === undefined ) oldTime = new Date().getTime(); + + var newTime = new Date().getTime(); + var delta = newTime - oldTime; + oldTime = newTime; + TWEEN.update(); controls.update(); - scene.fog.color.setHSV( 0.13, 0.25, map_linear( parameters.control, 0, 100, 0.1, 0.99 ) ); + if ( morph ) morph.updateAnimation( delta ); + + scene.fog.color.setHSV( 0.13, 0.25, THREE.MathUtils.mapLinear( parameters.control, 0, 100, 0.1, 0.99 ) ); renderer.setClearColor( scene.fog.color, 1 ); - sunLight.intensity = map_linear( parameters.control, 0, 100, 0.3, 1 ); - pointLight.intensity = map_linear( parameters.control, 0, 100, 1, 0.5 ); + sunLight.intensity = THREE.MathUtils.mapLinear( parameters.control, 0, 100, 0.3, 1 ); + pointLight.intensity = THREE.MathUtils.mapLinear( parameters.control, 0, 100, 1, 0.5 ); - pointLight.color.setHSV( 0.1, map_linear( parameters.control, 0, 100, 0.99, 0 ), 0.9 ); + pointLight.color.setHSV( 0.1, THREE.MathUtils.mapLinear( parameters.control, 0, 100, 0.99, 0 ), 0.9 ); renderer.shadowMapDarkness = 0.5 * sunLight.intensity; diff --git a/src/extras/MathUtils.js b/src/extras/MathUtils.js new file mode 100644 index 00000000..03db5ff0 --- /dev/null +++ b/src/extras/MathUtils.js @@ -0,0 +1,19 @@ +/** + * @author alteredq / http://alteredqualia.com/ + */ + +THREE.MathUtils = { + + clamp: function ( x, a, b ) { + + return ( x < a ) ? a : ( ( x > b ) ? b : x ); + + }, + + mapLinear: function( x, sa, sb, ea, eb ) { + + return ( x - sa ) * ( eb - ea ) / ( sb - sa ) + ea; + + } + +}; diff --git a/src/objects/MorphAnimMesh.js b/src/objects/MorphAnimMesh.js new file mode 100644 index 00000000..e6f6409a --- /dev/null +++ b/src/objects/MorphAnimMesh.js @@ -0,0 +1,89 @@ +/** + * @author alteredq / http://alteredqualia.com/ + */ + +THREE.MorphAnimMesh = function( geometry, materials ) { + + THREE.Mesh.call( this, geometry, materials ); + + // API + + this.duration = 1000; // milliseconds + this.mirroredLoop = false; + + // internals + + this.lastKeyframe = 0; + this.currentKeyframe = 0; + + this.time = 0; + this.offset = 0; + + this.direction = 1; + this.directionBackwards = false; + +}; + +THREE.MorphAnimMesh.prototype = new THREE.Mesh(); +THREE.MorphAnimMesh.prototype.constructor = THREE.MorphAnimMesh; + +THREE.MorphAnimMesh.prototype.updateAnimation = function ( delta ) { + + var frameTime = this.duration / this.geometry.morphTargets.length; + + this.time += this.direction * delta; + + 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 = true; + + } + + if ( this.time < 0 ) { + + this.time = 0; + this.directionBackwards = false; + + } + + } + + } else { + + this.time = this.time % this.duration; + + } + + var keyframe = THREE.MathUtils.clamp( Math.floor( this.time / frameTime ), 0, this.geometry.morphTargets.length - 1 ); + + if ( keyframe != this.currentKeyframe ) { + + this.morphTargetInfluences[ this.lastKeyframe ] = 0; + this.morphTargetInfluences[ this.currentKeyframe ] = 1; + + this.morphTargetInfluences[ keyframe ] = 0; + + this.lastKeyframe = this.currentKeyframe; + this.currentKeyframe = keyframe; + + } + + var mix = ( this.time % frameTime ) / frameTime; + + if ( this.directionBackwards ) { + + mix = 1 - mix; + + } + + this.morphTargetInfluences[ this.currentKeyframe ] = mix; + this.morphTargetInfluences[ this.lastKeyframe ] = 1 - mix; + +}; diff --git a/src/renderers/WebGLShaders.js b/src/renderers/WebGLShaders.js index e242b898..b355e82b 100644 --- a/src/renderers/WebGLShaders.js +++ b/src/renderers/WebGLShaders.js @@ -702,19 +702,7 @@ THREE.ShaderChunk = { "}", "shadow /= 9.0;", - - "#ifdef GAMMA_OUTPUT", - - "vec3 darkening = vec3( ( 1.0 - shadowDarkness * shadow ) );", - "darkening *= darkening;", - - "shadowColor = shadowColor * darkening;", - - "#else", - - "shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness * shadow ) );", - - "#endif", + "shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness * shadow ) );", "#else", @@ -742,6 +730,12 @@ THREE.ShaderChunk = { "}", + "#ifdef GAMMA_OUTPUT", + + "shadowColor *= shadowColor;", + + "#endif", + "gl_FragColor.xyz = gl_FragColor.xyz * shadowColor;", "#endif" diff --git a/utils/build.py b/utils/build.py index f0398d34..fe3cd837 100644 --- a/utils/build.py +++ b/utils/build.py @@ -60,6 +60,7 @@ COMMON_FILES = [ 'objects/Mesh.js', 'objects/Bone.js', 'objects/SkinnedMesh.js', +'objects/MorphAnimMesh.js', 'objects/Ribbon.js', 'objects/LOD.js', 'objects/Sprite.js', @@ -85,6 +86,7 @@ EXTRAS_FILES = [ 'extras/ColorUtils.js', 'extras/GeometryUtils.js', 'extras/ImageUtils.js', +'extras/MathUtils.js', 'extras/SceneUtils.js', 'extras/ShaderUtils.js', 'extras/core/Curve.js', From 15c899b46f088844c4bc7aaa99a15f090016b46a Mon Sep 17 00:00:00 2001 From: alteredq Date: Wed, 12 Oct 2011 14:05:30 +0200 Subject: [PATCH 05/33] Added renderer.shadowMapAutoUpdate parameter. This is for being able to render shadowmap just once per frame - all dynamic cubemap faces and full scene can share the same shadowmap (at least until we don't have camera-specific fine-tuned shadowmaps). --- build/Three.js | 286 +++++++++++++-------------- build/custom/ThreeWebGL.js | 54 ++--- examples/webgl_shading_physical.html | 3 + src/renderers/WebGLRenderer.js | 10 +- 4 files changed, 182 insertions(+), 171 deletions(-) diff --git a/build/Three.js b/build/Three.js index f2a09d76..3d50806a 100644 --- a/build/Three.js +++ b/build/Three.js @@ -16,20 +16,20 @@ c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,f=[];c=0;for(e=b.length;c0&&b>0&&k+b<1}for(var f,h=[],k=0,m=b.children.length;kb.scale.x)return[];f={distance:k,point:b.position,face:null,object:b};h.push(f)}else if(b instanceof THREE.Mesh){k=c(this.origin, -this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,u,t,w,o,x,v,z,A=b.geometry,y=A.vertices,k=0,m=A.faces.length;k0:x<0)))if(x=o.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(z.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,u,t)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,u,w)||e(v,u,t,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; +this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,u,t,w,o,x,v,A,z=b.geometry,y=z.vertices,k=0,m=z.faces.length;k0:x<0)))if(x=o.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(A.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,u,t)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,u,w)||e(v,u,t,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,o){n=!1;c=k;e=m;f=w;h=o;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=ck?f:k,h=h>m?h:m);b()};this.add3Points= function(k,m,w,o,x,v){n?(n=!1,c=kw?k>x?k:x:w>x?w:x,h=m>o?m>v?m:v:o>v?o:v):(c=kw?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>o?m>v?m>h?m:h:v>h?v:h:o>v?o>h?o:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=ck.getRight()?f:k.getRight(),h=h> k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}};THREE.Matrix3=function(){this.m=[]}; THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}}; -THREE.Matrix4=function(b,c,e,f,h,k,m,n,u,t,w,o,x,v,z,A){this.set(b!==void 0?b:1,c||0,e||0,f||0,h||0,k!==void 0?k:1,m||0,n||0,u||0,t||0,w!==void 0?w:1,o||0,x||0,v||0,z||0,A!==void 0?A:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,h,k,m,n,u,t,w,o,x,v,z,A){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=h;this.n22=k;this.n23=m;this.n24=n;this.n31=u;this.n32=t;this.n33=w;this.n34=o;this.n41=x;this.n42=v;this.n43=z;this.n44=A;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b, +THREE.Matrix4=function(b,c,e,f,h,k,m,n,u,t,w,o,x,v,A,z){this.set(b!==void 0?b:1,c||0,e||0,f||0,h||0,k!==void 0?k:1,m||0,n||0,u||0,t||0,w!==void 0?w:1,o||0,x||0,v||0,A||0,z!==void 0?z:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,h,k,m,n,u,t,w,o,x,v,A,z){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=h;this.n22=k;this.n23=m;this.n24=n;this.n31=u;this.n32=t;this.n33=w;this.n34=o;this.n41=x;this.n42=v;this.n43=A;this.n44=z;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b, c,e){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,k=THREE.Matrix4.__v3;k.sub(b,c).normalize();if(k.length()===0)k.z=1;f.cross(e,k).normalize();f.length()===0&&(k.x+=1.0E-4,f.cross(e,k).normalize());h.cross(k,f).normalize();this.n11=f.x;this.n12=h.x;this.n13=k.x;this.n21=f.y;this.n22=h.y;this.n23=k.y;this.n31=f.z;this.n32=h.z;this.n33=k.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,f=b.z,h=1/(this.n41*c+this.n42*e+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*e+this.n13*f+this.n14)*h; b.y=(this.n21*c+this.n22*e+this.n23*f+this.n24)*h;b.z=(this.n31*c+this.n32*e+this.n33*f+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,e=b.y,f=b.z,h=b.w;b.x=this.n11*c+this.n12*e+this.n13*f+this.n14*h;b.y=this.n21*c+this.n22*e+this.n23*f+this.n24*h;b.z=this.n31*c+this.n32*e+this.n33*f+this.n34*h;b.w=this.n41*c+this.n42*e+this.n43*f+this.n44*h;return b},rotateAxis:function(b){var c=b.x,e=b.y,f=b.z;b.x=c*this.n11+e*this.n12+f*this.n13;b.y=c*this.n21+e*this.n22+f*this.n23;b.z=c*this.n31+ -e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,u=b.n23,t=b.n24,w=b.n31,o=b.n32,x=b.n33,v=b.n34,z=b.n41,A=b.n42,y=b.n43,E=b.n44,F=c.n11,C=c.n12, -G=c.n13,J=c.n14,M=c.n21,K=c.n22,B=c.n23,L=c.n24,Y=c.n31,H=c.n32,T=c.n33,Q=c.n34,Z=c.n41,$=c.n42,P=c.n43,p=c.n44;this.n11=e*F+f*M+h*Y+k*Z;this.n12=e*C+f*K+h*H+k*$;this.n13=e*G+f*B+h*T+k*P;this.n14=e*J+f*L+h*Q+k*p;this.n21=m*F+n*M+u*Y+t*Z;this.n22=m*C+n*K+u*H+t*$;this.n23=m*G+n*B+u*T+t*P;this.n24=m*J+n*L+u*Q+t*p;this.n31=w*F+o*M+x*Y+v*Z;this.n32=w*C+o*K+x*H+v*$;this.n33=w*G+o*B+x*T+v*P;this.n34=w*J+o*L+x*Q+v*p;this.n41=z*F+A*M+y*Y+E*Z;this.n42=z*C+A*K+y*H+E*$;this.n43=z*G+A*B+y*T+E*P;this.n44=z*J+A* +e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,u=b.n23,t=b.n24,w=b.n31,o=b.n32,x=b.n33,v=b.n34,A=b.n41,z=b.n42,y=b.n43,E=b.n44,F=c.n11,C=c.n12, +G=c.n13,J=c.n14,M=c.n21,K=c.n22,B=c.n23,L=c.n24,Y=c.n31,H=c.n32,T=c.n33,Q=c.n34,Z=c.n41,$=c.n42,P=c.n43,p=c.n44;this.n11=e*F+f*M+h*Y+k*Z;this.n12=e*C+f*K+h*H+k*$;this.n13=e*G+f*B+h*T+k*P;this.n14=e*J+f*L+h*Q+k*p;this.n21=m*F+n*M+u*Y+t*Z;this.n22=m*C+n*K+u*H+t*$;this.n23=m*G+n*B+u*T+t*P;this.n24=m*J+n*L+u*Q+t*p;this.n31=w*F+o*M+x*Y+v*Z;this.n32=w*C+o*K+x*H+v*$;this.n33=w*G+o*B+x*T+v*P;this.n34=w*J+o*L+x*Q+v*p;this.n41=A*F+z*M+y*Y+E*Z;this.n42=A*C+z*K+y*H+E*$;this.n43=A*G+z*B+y*T+E*P;this.n44=A*J+z* L+y*Q+E*p;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=b;this.n31*= -b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,h=this.n21,k=this.n22,m=this.n23,n=this.n24,u=this.n31,t=this.n32,w=this.n33,o=this.n34,x=this.n41,v=this.n42,z=this.n43,A=this.n44;return f*m*t*x-e*n*t*x-f*k*w*x+c*n*w*x+e*k*o*x-c*m*o*x-f*m*u*v+e*n*u*v+f*h*w*v-b*n*w*v-e*h*o*v+b*m*o*v+f*k*u*z-c*n*u*z-f*h*t*z+b*n*t*z+c*h*o*z-b*k*o*z-e*k*u*A+c*m*u*A+e*h*t*A-b*m*t*A-c*h*w*A+b*k*w*A}, +b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,h=this.n21,k=this.n22,m=this.n23,n=this.n24,u=this.n31,t=this.n32,w=this.n33,o=this.n34,x=this.n41,v=this.n42,A=this.n43,z=this.n44;return f*m*t*x-e*n*t*x-f*k*w*x+c*n*w*x+e*k*o*x-c*m*o*x-f*m*u*v+e*n*u*v+f*h*w*v-b*n*w*v-e*h*o*v+b*m*o*v+f*k*u*A-c*n*u*A-f*h*t*A+b*n*t*A+c*h*o*A-b*k*o*A-e*k*u*z+c*m*u*z+e*h*t*z-b*m*t*z-c*h*w*z+b*k*w*z}, transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32;b.n33=this.n33;b.n34=this.n34; b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]=this.n11; b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=this.n34; @@ -42,8 +42,8 @@ b.x,e=b.y,f=b.z,h=b.w,k=c+c,m=e+e,n=f+f,b=c*k,u=c*m;c*=n;var t=e*m;e*=n;f*=n;k*= f.identity();f.setRotationFromQuaternion(c);h.setScale(e.x,e.y,e.z);this.multiply(f,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,k=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);k.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;e=e instanceof THREE.Vector3?e:new THREE.Vector3;e.x=f.length(); e.y=h.length();e.z=k.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=e.x;f.n21/=e.x;f.n31/=e.x;f.n12/=e.y;f.n22/=e.y;f.n32/=e.y;f.n13/=e.z;f.n23/=e.z;f.n33/=e.z;c.setFromRotationMatrix(f);return[b,c,e]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var e=1/c.x,f=1/c.y,h=1/c.z;this.n11=b.n11*e;this.n21=b.n21*e;this.n31=b.n31*e;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*h;this.n23= b.n23*h;this.n33=b.n33*h}}; -THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,u=b.n23,t=b.n24,w=b.n31,o=b.n32,x=b.n33,v=b.n34,z=b.n41,A=b.n42,y=b.n43,E=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=u*v*A-t*x*A+t*o*y-n*v*y-u*o*E+n*x*E;c.n12=k*x*A-h*v*A-k*o*y+f*v*y+h*o*E-f*x*E;c.n13=h*t*A-k*u*A+k*n*y-f*t*y-h*n*E+f*u*E;c.n14=k*u*o-h*t*o-k*n*x+f*t*x+h*n*v-f*u*v;c.n21=t*x*z-u*v*z-t*w*y+m*v*y+u*w*E-m*x*E;c.n22=h*v*z-k*x*z+k*w*y-e*v*y-h*w*E+e*x*E;c.n23=k*u*z-h*t*z-k*m*y+e*t*y+h*m*E-e*u*E;c.n24= -h*t*w-k*u*w+k*m*x-e*t*x-h*m*v+e*u*v;c.n31=n*v*z-t*o*z+t*w*A-m*v*A-n*w*E+m*o*E;c.n32=k*o*z-f*v*z-k*w*A+e*v*A+f*w*E-e*o*E;c.n33=h*t*z-k*n*z+k*m*A-e*t*A-f*m*E+e*n*E;c.n34=k*n*w-f*t*w-k*m*o+e*t*o+f*m*v-e*n*v;c.n41=u*o*z-n*x*z-u*w*A+m*x*A+n*w*y-m*o*y;c.n42=f*x*z-h*o*z+h*w*A-e*x*A-f*w*y+e*o*y;c.n43=h*n*z-f*u*z-h*m*A+e*u*A+f*m*y-e*n*y;c.n44=f*u*w-h*n*w+h*m*o-e*u*o-f*m*x+e*n*x;c.multiplyScalar(1/b.determinant());return c}; +THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,u=b.n23,t=b.n24,w=b.n31,o=b.n32,x=b.n33,v=b.n34,A=b.n41,z=b.n42,y=b.n43,E=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=u*v*z-t*x*z+t*o*y-n*v*y-u*o*E+n*x*E;c.n12=k*x*z-h*v*z-k*o*y+f*v*y+h*o*E-f*x*E;c.n13=h*t*z-k*u*z+k*n*y-f*t*y-h*n*E+f*u*E;c.n14=k*u*o-h*t*o-k*n*x+f*t*x+h*n*v-f*u*v;c.n21=t*x*A-u*v*A-t*w*y+m*v*y+u*w*E-m*x*E;c.n22=h*v*A-k*x*A+k*w*y-e*v*y-h*w*E+e*x*E;c.n23=k*u*A-h*t*A-k*m*y+e*t*y+h*m*E-e*u*E;c.n24= +h*t*w-k*u*w+k*m*x-e*t*x-h*m*v+e*u*v;c.n31=n*v*A-t*o*A+t*w*z-m*v*z-n*w*E+m*o*E;c.n32=k*o*A-f*v*A-k*w*z+e*v*z+f*w*E-e*o*E;c.n33=h*t*A-k*n*A+k*m*z-e*t*z-f*m*E+e*n*E;c.n34=k*n*w-f*t*w-k*m*o+e*t*o+f*m*v-e*n*v;c.n41=u*o*A-n*x*A-u*w*z+m*x*z+n*w*y-m*o*y;c.n42=f*x*A-h*o*A+h*w*z-e*x*z-f*w*y+e*o*y;c.n43=h*n*A-f*u*A-h*m*z+e*u*z+f*m*y-e*n*y;c.n44=f*u*w-h*n*w+h*m*o-e*u*o-f*m*x+e*n*x;c.multiplyScalar(1/b.determinant());return c}; THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,f=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,k=b.n32*b.n21-b.n31*b.n22,m=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,u=-b.n32*b.n11+b.n31*b.n12,t=b.n23*b.n12-b.n22*b.n13,w=-b.n23*b.n11+b.n21*b.n13,o=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*m+b.n31*t;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*h;e[2]=b*k;e[3]=b*m;e[4]=b*n;e[5]=b*u;e[6]=b*t;e[7]=b*w;e[8]=b*o;return c}; THREE.Matrix4.makeFrustum=function(b,c,e,f,h,k){var m;m=new THREE.Matrix4;m.n11=2*h/(c-b);m.n12=0;m.n13=(c+b)/(c-b);m.n14=0;m.n21=0;m.n22=2*h/(f-e);m.n23=(f+e)/(f-e);m.n24=0;m.n31=0;m.n32=0;m.n33=-(k+h)/(k-h);m.n34=-2*k*h/(k-h);m.n41=0;m.n42=0;m.n43=-1;m.n44=0;return m};THREE.Matrix4.makePerspective=function(b,c,e,f){var h,b=e*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,e,f)}; THREE.Matrix4.makeOrtho=function(b,c,e,f,h,k){var m,n,u,t;m=new THREE.Matrix4;n=c-b;u=e-f;t=k-h;m.n11=2/n;m.n12=0;m.n13=0;m.n14=-((c+b)/n);m.n21=0;m.n22=2/u;m.n23=0;m.n24=-((e+f)/u);m.n31=0;m.n32=0;m.n33=-2/t;m.n34=-((k+h)/t);m.n41=0;m.n42=0;m.n43=0;m.n44=1;return m};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; @@ -54,16 +54,16 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){thi b)return h;if(c&&(h=h.getChildByName(b,c),h!==void 0))return h}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,e){this.matrixAutoUpdate&& this.updateMatrix();if(this.matrixWorldNeedsUpdate||c)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,c=!0;for(var b=0,f=this.children.length;b=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?e=Math.max(e,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),f=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?e=Math.max(e,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),fG&&m.positionScreen.z0&&K.z<1))ia=C[F]=C[F]||new THREE.RenderableParticle,F++,E=ia,E.x=K.x/K.w,E.y=K.y/K.w,E.z=K.z,E.rotation=U.rotation.z,E.scale.x=U.scale.x*Math.abs(E.x-(K.x+k.projectionMatrix.n11)/(K.w+k.projectionMatrix.n14)),E.scale.y=U.scale.y*Math.abs(E.y-(K.y+k.projectionMatrix.n22)/(K.w+k.projectionMatrix.n24)),E.materials=U.materials,J.push(E);h&&J.sort(c);return J}}; THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,e=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),k=Math.cos(e),e=Math.sin(e),m=b*c,n=f*h;this.w=m*k-n*e;this.x=m*e+n*k;this.y=f*c*k+b*h*e;this.z=b*h*k-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e); @@ -79,8 +79,8 @@ c;b++)e=this.faces[b],e.centroid.set(0,0,0),e instanceof THREE.Face3?(e.centroid e,f,h,k,m,n=new THREE.Vector3,u=new THREE.Vector3;f=0;for(h=this.faces.length;f0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;c0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(z.r*255)+","+Math.floor(z.g*255)+","+ -Math.floor(z.b*255)+","+A+")"),v.fillRect(Math.floor(S.getX()),Math.floor(S.getY()),Math.floor(S.getWidth()),Math.floor(S.getHeight()))),S.empty())};this.render=function(b,u){function t(b){var c,e,f,k=b.lights;N.setRGB(0,0,0);ma.setRGB(0,0,0);ua.setRGB(0,0,0);b=0;for(c=k.length;b0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(A.r*255)+","+Math.floor(A.g*255)+","+ +Math.floor(A.b*255)+","+z+")"),v.fillRect(Math.floor(S.getX()),Math.floor(S.getY()),Math.floor(S.getWidth()),Math.floor(S.getHeight()))),S.empty())};this.render=function(b,u){function t(b){var c,e,f,k=b.lights;N.setRGB(0,0,0);ma.setRGB(0,0,0);ua.setRGB(0,0,0);b=0;for(c=k.length;b>1,xa=t.height>>1,m=k.scale.x*o,u=k.scale.y*x,p=m*w,n=u*xa,O.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(O)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-u),v.translate(-w,-xa),v.drawImage(t,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(p=k.scale.x*o,n=k.scale.y*x,O.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(O)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(p,n),m.program(v), v.restore()))}function eb(b,k,h,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(k.positionScreen.x,k.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(J!=b)v.lineCap=J=b;b=m.linejoin;if(M!=b)v.lineJoin=M=b;f(m.color.getContextStyle());v.stroke();O.inflate(m.linewidth*2)}}function y(b,f,h,m,n,t,o,v,xa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); Q=b.positionScreen.x;Z=b.positionScreen.y;$=f.positionScreen.x;P=f.positionScreen.y;p=h.positionScreen.x;V=h.positionScreen.y;F(Q,Z,$,P,p,V);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,P,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=u.matrixWorldInverse,oa.copy(o.vertexNormalsWorld[0]),sa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,ya= @@ -164,35 +164,35 @@ Q=b.positionScreen.x;Z=b.positionScreen.y;$=f.positionScreen.x;P=f.positionScree (v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,P,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map)),e(THREE.SubtractiveBlending)),da?!v.wireframe&&v.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==3?(W.r=U.r=ia.r=N.r,W.g=U.g=ia.g=N.g,W.b=U.b=ia.b=N.b,w(xa,o.v1.positionWorld,o.vertexNormalsWorld[0],W),w(xa,o.v2.positionWorld,o.vertexNormalsWorld[1],U),w(xa,o.v3.positionWorld,o.vertexNormalsWorld[2],ia),W.r=Math.max(0,Math.min(v.color.r*W.r,1)),W.g=Math.max(0,Math.min(v.color.g* W.g,1)),W.b=Math.max(0,Math.min(v.color.b*W.b,1)),U.r=Math.max(0,Math.min(v.color.r*U.r,1)),U.g=Math.max(0,Math.min(v.color.g*U.g,1)),U.b=Math.max(0,Math.min(v.color.b*U.b,1)),ia.r=Math.max(0,Math.min(v.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(v.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(v.color.b*ia.b,1)),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,p,V,0,0,1,0,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,o.centroidWorld,o.normalWorld,qa),aa.r=Math.max(0,Math.min(v.color.r* qa.r,1)),aa.g=Math.max(0,Math.min(v.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(v.color.b*qa.b,1)),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)):v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshDepthMaterial)la=u.near,ca=u.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(h.positionScreen.z,la,ca),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ -ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,p,V,0,0,1,0,0,1,pa);else if(v instanceof THREE.MeshNormalMaterial)aa.r=Va(o.normalWorld.x),aa.g=Va(o.normalWorld.y),aa.b=Va(o.normalWorld.z),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)}function z(b,f,h,m,n,t,v,o,xa){k.info.render.vertices+=4;k.info.render.faces++;c(o.opacity);e(o.blending);if(o.map||o.envMap)y(b,f,m,0,1,3,v,o,xa),y(n,h,t,1,2,3,v,o,xa);else if(Q=b.positionScreen.x,Z=b.positionScreen.y, +ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,p,V,0,0,1,0,0,1,pa);else if(v instanceof THREE.MeshNormalMaterial)aa.r=Va(o.normalWorld.x),aa.g=Va(o.normalWorld.y),aa.b=Va(o.normalWorld.z),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)}function A(b,f,h,m,n,t,v,o,xa){k.info.render.vertices+=4;k.info.render.faces++;c(o.opacity);e(o.blending);if(o.map||o.envMap)y(b,f,m,0,1,3,v,o,xa),y(n,h,t,1,2,3,v,o,xa);else if(Q=b.positionScreen.x,Z=b.positionScreen.y, $=f.positionScreen.x,P=f.positionScreen.y,p=h.positionScreen.x,V=h.positionScreen.y,fa=m.positionScreen.x,ea=m.positionScreen.y,ha=n.positionScreen.x,ga=n.positionScreen.y,ka=t.positionScreen.x,na=t.positionScreen.y,o instanceof THREE.MeshBasicMaterial)E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(o.color);else if(o instanceof THREE.MeshLambertMaterial)da?!o.wireframe&&o.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4?(W.r= U.r=ia.r=ja.r=N.r,W.g=U.g=ia.g=ja.g=N.g,W.b=U.b=ia.b=ja.b=N.b,w(xa,v.v1.positionWorld,v.vertexNormalsWorld[0],W),w(xa,v.v2.positionWorld,v.vertexNormalsWorld[1],U),w(xa,v.v4.positionWorld,v.vertexNormalsWorld[3],ia),w(xa,v.v3.positionWorld,v.vertexNormalsWorld[2],ja),W.r=Math.max(0,Math.min(o.color.r*W.r,1)),W.g=Math.max(0,Math.min(o.color.g*W.g,1)),W.b=Math.max(0,Math.min(o.color.b*W.b,1)),U.r=Math.max(0,Math.min(o.color.r*U.r,1)),U.g=Math.max(0,Math.min(o.color.g*U.g,1)),U.b=Math.max(0,Math.min(o.color.b* U.b,1)),ia.r=Math.max(0,Math.min(o.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(o.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(o.color.b*ia.b,1)),ja.r=Math.max(0,Math.min(o.color.r*ja.r,1)),ja.g=Math.max(0,Math.min(o.color.g*ja.g,1)),ja.b=Math.max(0,Math.min(o.color.b*ja.b,1)),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,v.centroidWorld,v.normalWorld,qa),aa.r=Math.max(0,Math.min(o.color.r*qa.r, 1)),aa.g=Math.max(0,Math.min(o.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(o.color.b*qa.b,1)),E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(aa,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(aa)):(E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(o.color));else if(o instanceof THREE.MeshNormalMaterial)aa.r=Va(v.normalWorld.x),aa.g=Va(v.normalWorld.y),aa.b=Va(v.normalWorld.z),E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(aa,o.wireframeLinewidth,o.wireframeLinecap, o.wireframeLinejoin):C(aa);else if(o instanceof THREE.MeshDepthMaterial)la=u.near,ca=u.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,la,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,la,ca),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)}function F(b,c,e,f,k,h){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(b,c);v.closePath()}function E(b, c,e,f,k,h,m,p){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(m,p);v.lineTo(b,c);v.closePath()}function Na(b,c,e,k){if(G!=c)v.lineWidth=G=c;if(J!=e)v.lineCap=J=e;if(M!=k)v.lineJoin=M=k;f(b.getContextStyle());v.stroke();O.inflate(c*2)}function C(b){h(b.getContextStyle());v.fill()}function ab(b,c,e,f,k,m,p,n,u,o,t,xa,w){if(w.image.width!=0){if(w.needsUpdate==!0||ta[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,S=w.wrapT==THREE.RepeatWrapping;ta[w.id]=v.createPattern(w.image,x&& -S?"repeat":x&&!S?"repeat-x":!x&&S?"repeat-y":"no-repeat");w.needsUpdate=!1}h(ta[w.id]);var x=w.offset.x/w.repeat.x,S=w.offset.y/w.repeat.y,A=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,p=(p+x)*A,n=(n+S)*w,u=(u+x)*A,o=(o+S)*w,t=(t+x)*A,xa=(xa+S)*w;e-=b;f-=c;k-=b;m-=c;u-=p;o-=n;t-=p;xa-=n;x=1/(u*xa-t*o);w=(xa*e-o*k)*x;o=(xa*f-o*m)*x;e=(u*k-t*e)*x;f=(u*m-t*f)*x;b=b-w*p-e*n;c=c-o*p-f*n;v.save();v.transform(w,o,e,f,b,c);v.fill();v.restore()}}function Ua(b,c,e,f,k,h,m,p,n,u,o,t,w){var xa, +S?"repeat":x&&!S?"repeat-x":!x&&S?"repeat-y":"no-repeat");w.needsUpdate=!1}h(ta[w.id]);var x=w.offset.x/w.repeat.x,S=w.offset.y/w.repeat.y,z=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,p=(p+x)*z,n=(n+S)*w,u=(u+x)*z,o=(o+S)*w,t=(t+x)*z,xa=(xa+S)*w;e-=b;f-=c;k-=b;m-=c;u-=p;o-=n;t-=p;xa-=n;x=1/(u*xa-t*o);w=(xa*e-o*k)*x;o=(xa*f-o*m)*x;e=(u*k-t*e)*x;f=(u*m-t*f)*x;b=b-w*p-e*n;c=c-o*p-f*n;v.save();v.transform(w,o,e,f,b,c);v.fill();v.restore()}}function Ua(b,c,e,f,k,h,m,p,n,u,o,t,w){var xa, x;xa=w.width-1;x=w.height-1;m*=xa;p*=x;n*=xa;u*=x;o*=xa;t*=x;e-=b;f-=c;k-=b;h-=c;n-=m;u-=p;o-=m;t-=p;x=1/(n*t-o*u);xa=(t*e-u*k)*x;u=(t*f-u*h)*x;e=(n*k-o*e)*x;f=(n*h-o*f)*x;b=b-xa*m-e*p;c=c-u*m-f*p;v.save();v.transform(xa,u,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var k=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),p=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),u=~~(e.g*255),e=~~(e.b*255),o=~~(f.r*255),t=~~(f.g*255),f=~~(f.b*255);va[0]=k<0?0:k>255?255:k;va[1]=h<0?0: h>255?255:h;va[2]=b<0?0:b>255?255:b;va[4]=m<0?0:m>255?255:m;va[5]=p<0?0:p>255?255:p;va[6]=c<0?0:c>255?255:c;va[8]=n<0?0:n>255?255:n;va[9]=u<0?0:u>255?255:u;va[10]=e<0?0:e>255?255:e;va[12]=o<0?0:o>255?255:o;va[13]=t<0?0:t>255?255:t;va[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,k=e*e+f*f;k!=0&&(k=1/Math.sqrt(k),e*=k,f*=k,c.x+= -e,c.y+=f,b.x-=e,b.y-=f)}var Za,bb,wa,Ja,Pa,Wa,$a,Aa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,o,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,u,this.sortElements);(da=b.lights.length>0)&&t(b);Za=0;for(bb=m.length;Za0)&&t(b);Za=0;for(bb=m.length;Za0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m)):h instanceof THREE.PointLight&&(Y.sub(h.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*h.intensity,m>0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m))}function c(c,e,m,n,o,t){k.info.render.vertices+=3;k.info.render.faces++;Q=f(Z++); Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");o instanceof THREE.MeshBasicMaterial?G.copy(o.color):o instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(t,n,J),G.r=Math.max(0,Math.min(o.color.r*J.r,1)),G.g=Math.max(0,Math.min(o.color.g*J.g,1)),G.b=Math.max(0,Math.min(o.color.b*J.b,1))):G.copy(o.color):o instanceof THREE.MeshDepthMaterial?(L=1-o.__2near/(o.__farPlusNear- n.z*o.__farMinusNear),G.setRGB(L,L,L)):o instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));o.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+o.wireframeLinewidth+"; stroke-opacity: "+o.opacity+"; stroke-linecap: "+o.wireframeLinecap+"; stroke-linejoin: "+o.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+o.opacity);u.appendChild(Q)}function e(c,e,m,n,o,t,v){k.info.render.vertices+= 4;k.info.render.faces++;Q=f(Z++);Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?G.copy(t.color):t instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(v,o,J),G.r=Math.max(0,Math.min(t.color.r*J.r,1)),G.g=Math.max(0,Math.min(t.color.g*J.g,1)),G.b=Math.max(0,Math.min(t.color.b*J.b,1))): G.copy(t.color):t instanceof THREE.MeshDepthMaterial?(L=1-t.__2near/(t.__farPlusNear-o.z*t.__farMinusNear),G.setRGB(L,L,L)):t instanceof THREE.MeshNormalMaterial&&G.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));t.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+ -"; fill-opacity: "+t.opacity);u.appendChild(Q)}function f(b){H[b]==null&&(H[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),P==0&&H[b].setAttribute("shape-rendering","crispEdges"));return H[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,u=document.createElementNS("http://www.w3.org/2000/svg","svg"),t,w,o,x,v,z,A,y,E=new THREE.Rectangle,F=new THREE.Rectangle,C=!1,G=new THREE.Color(16777215),J=new THREE.Color(16777215),M=new THREE.Color(0), +"; fill-opacity: "+t.opacity);u.appendChild(Q)}function f(b){H[b]==null&&(H[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),P==0&&H[b].setAttribute("shape-rendering","crispEdges"));return H[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,u=document.createElementNS("http://www.w3.org/2000/svg","svg"),t,w,o,x,v,A,z,y,E=new THREE.Rectangle,F=new THREE.Rectangle,C=!1,G=new THREE.Color(16777215),J=new THREE.Color(16777215),M=new THREE.Color(0), K=new THREE.Color(0),B=new THREE.Color(0),L,Y=new THREE.Vector3,H=[],T=[],Q,Z,$,P=1;this.domElement=u;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":P=1;break;case "low":P=0}};this.setSize=function(b,c){t=b;w=c;o=t/2;x=w/2;u.setAttribute("viewBox",-o+" "+-x+" "+t+" "+w);u.setAttribute("width",t);u.setAttribute("height",w);E.set(-o,-x,o,x)};this.clear=function(){for(;u.childNodes.length>0;)u.removeChild(u.childNodes[0])}; this.render=function(b,f){var h,t,w,G,H,L,J,W;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);$=Z=0;if(C=b.lights.length>0){J=b.lights;M.setRGB(0,0,0);K.setRGB(0,0,0);B.setRGB(0,0,0);h=0;for(t=J.length;h=0)c&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(b.position,3,p.FLOAT,!1,0,0));else if(m.morphTargetBase){f=h.program.attributes;m.morphTargetBase!== -1?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[m.morphTargetBase]),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0)):f.position>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var o=0,t=m.morphTargetForcedOrder,u=m.morphTargetInfluences;ov&&(w=x,v=u[w]);p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[w]);p.vertexAttribPointer(f["morphTarget"+o],3,p.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[o]=v;t[w]=1;v=-1;o++}}h.program.uniforms.morphTargetInfluences!==null&&p.uniform1fv(h.program.uniforms.morphTargetInfluences, +p.FLOAT,!1,0,0),m.__webglMorphTargetInfluences[o]=u[t[o]],o++;else{var t=[],v=-1,w=0,u=m.morphTargetInfluences,x,z=u.length,o=0;for(m.morphTargetBase!==-1&&(t[m.morphTargetBase]=!0);ov&&(w=x,v=u[w]);p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[w]);p.vertexAttribPointer(f["morphTarget"+o],3,p.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[o]=v;t[w]=1;v=-1;o++}}h.program.uniforms.morphTargetInfluences!==null&&p.uniform1fv(h.program.uniforms.morphTargetInfluences, m.__webglMorphTargetInfluences)}if(c){if(k.__webglCustomAttributes)for(n in k.__webglCustomAttributes)b[n]>=0&&(f=k.__webglCustomAttributes[n],p.bindBuffer(p.ARRAY_BUFFER,f.buffer),p.vertexAttribPointer(b[n],f.size,p.FLOAT,!1,0,0));b.color>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglColorBuffer),p.vertexAttribPointer(b.color,3,p.FLOAT,!1,0,0));b.normal>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglNormalBuffer),p.vertexAttribPointer(b.normal,3,p.FLOAT,!1,0,0));b.tangent>=0&&(p.bindBuffer(p.ARRAY_BUFFER, k.__webglTangentBuffer),p.vertexAttribPointer(b.tangent,4,p.FLOAT,!1,0,0));b.uv>=0&&(k.__webglUVBuffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUVBuffer),p.vertexAttribPointer(b.uv,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv)):p.disableVertexAttribArray(b.uv));b.uv2>=0&&(k.__webglUV2Buffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUV2Buffer),p.vertexAttribPointer(b.uv2,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv2)):p.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>= 0&&b.skinIndex>=0&&b.skinWeight>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexABuffer),p.vertexAttribPointer(b.skinVertexA,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexBBuffer),p.vertexAttribPointer(b.skinVertexB,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinIndicesBuffer),p.vertexAttribPointer(b.skinIndex,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinWeightsBuffer),p.vertexAttribPointer(b.skinWeight,4,p.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(h.wireframe? @@ -253,12 +253,12 @@ p.DYNAMIC_DRAW),p.enableVertexAttribArray(c.attributes.position),p.vertexAttribP b.normalArray,p.DYNAMIC_DRAW);p.enableVertexAttribArray(c.attributes.normal);p.vertexAttribPointer(c.attributes.normal,3,p.FLOAT,!1,0,0)}p.drawArrays(p.TRIANGLES,0,b.count);b.count=0}function k(b){if(na!=b.doubleSided)b.doubleSided?p.disable(p.CULL_FACE):p.enable(p.CULL_FACE),na=b.doubleSided;if(aa!=b.flipSided)b.flipSided?p.frontFace(p.CW):p.frontFace(p.CCW),aa=b.flipSided}function m(b){U!=b&&(b?p.enable(p.DEPTH_TEST):p.disable(p.DEPTH_TEST),U=b)}function n(b){ia!=b&&(p.depthMask(b),ia=b)}function u(b, c,e){ja!=b&&(b?p.enable(p.POLYGON_OFFSET_FILL):p.disable(p.POLYGON_OFFSET_FILL),ja=b);if(b&&(ta!=c||la!=e))p.polygonOffset(c,e),ta=c,la=e}function t(b){ya[0].set(b.n41-b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);ya[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);ya[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);ya[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);ya[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);ya[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34); for(var c,b=0;b<6;b++)c=ya[b],c.divideScalar(Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z))}function w(b){for(var c=b.matrixWorld,e=-b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)),f=0;f<6;f++)if(b=ya[f].x*c.n14+ya[f].y*c.n24+ya[f].z*c.n34+ya[f].w,b<=e)return!1;return!0}function o(b,c){b.list[b.count]=c;b.count+=1}function x(b){var c,e,f=b.object,k=b.opaque,h=b.transparent;h.count=0;b=k.count=0;for(c=f.materials.length;b0,X={};X.vertices=new Float32Array(16);X.faces=new Uint16Array(6);O=0;X.vertices[O++]=-1;X.vertices[O++]=-1;X.vertices[O++]=0;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=-1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=0;X.vertices[O++]=-1; X.vertices[O++]=1;X.vertices[O++]=0;O=X.vertices[O++]=0;X.faces[O++]=0;X.faces[O++]=1;X.faces[O++]=2;X.faces[O++]=0;X.faces[O++]=2;X.faces[O++]=3;X.vertexBuffer=p.createBuffer();X.elementBuffer=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,X.vertexBuffer);p.bufferData(p.ARRAY_BUFFER,X.vertices,p.STATIC_DRAW);p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,X.elementBuffer);p.bufferData(p.ELEMENT_ARRAY_BUFFER,X.faces,p.STATIC_DRAW);X.program=p.createProgram();p.attachShader(X.program,Q("fragment",THREE.ShaderLib.sprite.fragmentShader)); p.attachShader(X.program,Q("vertex",THREE.ShaderLib.sprite.vertexShader));p.linkProgram(X.program);X.attributes={};X.uniforms={};X.attributes.position=p.getAttribLocation(X.program,"position");X.attributes.uv=p.getAttribLocation(X.program,"uv");X.uniforms.uvOffset=p.getUniformLocation(X.program,"uvOffset");X.uniforms.uvScale=p.getUniformLocation(X.program,"uvScale");X.uniforms.rotation=p.getUniformLocation(X.program,"rotation");X.uniforms.scale=p.getUniformLocation(X.program,"scale");X.uniforms.alignment= @@ -290,58 +290,58 @@ p.deleteBuffer(c.__webglFaceBuffer);p.deleteBuffer(c.__webglLineBuffer);if(c.num else if(b instanceof THREE.ParticleSystem)b=b.geometry,p.deleteBuffer(b.__webglVertexBuffer),p.deleteBuffer(b.__webglColorBuffer),P.info.memory.geometries--};this.deallocateTexture=function(b){if(b.__webglInit)b.__webglInit=!1,p.deleteTexture(b.__webglTexture),P.info.memory.textures--};this.initMaterial=function(b,c,e,f){var k,h,m,n;b instanceof THREE.MeshDepthMaterial?n="depth":b instanceof THREE.MeshNormalMaterial?n="normal":b instanceof THREE.MeshBasicMaterial?n="basic":b instanceof THREE.MeshLambertMaterial? n="lambert":b instanceof THREE.MeshPhongMaterial?n="phong":b instanceof THREE.LineBasicMaterial?n="basic":b instanceof THREE.ParticleBasicMaterial&&(n="particle_basic");if(n){var o=THREE.ShaderLib[n];b.uniforms=THREE.UniformsUtils.clone(o.uniforms);b.vertexShader=o.vertexShader;b.fragmentShader=o.fragmentShader}var t,u,v;t=v=o=0;for(u=c.length;t=0&&p.enableVertexAttribArray(x.position);x.color>=0&&p.enableVertexAttribArray(x.color);x.normal>=0&&p.enableVertexAttribArray(x.normal);x.tangent>=0&&p.enableVertexAttribArray(x.tangent); -b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(p.enableVertexAttribArray(x.skinVertexA),p.enableVertexAttribArray(x.skinVertexB),p.enableVertexAttribArray(x.skinIndex),p.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(h in b.attributes)x[h]!==void 0&&x[h]>=0&&p.enableVertexAttribArray(x[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h=0&&(p.enableVertexAttribArray(x[A]),b.numSupportedMorphTargets++); -b.uniformsList=[];for(k in b.uniforms)b.uniformsList.push([b.uniforms[k],k])};this.clearTarget=function(b,c,e,f){H(b);this.clear(c,e,f)};this.render=function(b,c,o,S){var O,da,F,C,G,qa,B,la,J=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&A(b,c);P.info.render.calls=0;P.info.render.vertices=0;P.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Fa);c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix, -c.matrixWorldInverse);t(Ca);this.initWebGLObjects(b);H(o);(this.autoClear||S)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(S=0;S=0;S--)if(O=b.__webglObjects[S],O.render){B=O.object;la=O.buffer;F=O.opaque;k(B);for(O=0;O0||x.faceVertexUvs.length>0)m.__uvArray=new Float32Array(o* -2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(o*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(o*4),m.__skinVertexBArray=new Float32Array(o*4),m.__skinIndexArray=new Float32Array(o*4),m.__skinWeightArray=new Float32Array(o*4);m.__faceArray=new Uint16Array(A*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(S*2);if(m.numMorphTargets){m.__morphTargetsArrays=[];x=0;for(y= -m.numMorphTargets;x=0&&p.enableVertexAttribArray(x.position);x.color>=0&&p.enableVertexAttribArray(x.color);x.normal>=0&&p.enableVertexAttribArray(x.normal);x.tangent>=0&&p.enableVertexAttribArray(x.tangent); +b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(p.enableVertexAttribArray(x.skinVertexA),p.enableVertexAttribArray(x.skinVertexB),p.enableVertexAttribArray(x.skinIndex),p.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(h in b.attributes)x[h]!==void 0&&x[h]>=0&&p.enableVertexAttribArray(x[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h=0&&(p.enableVertexAttribArray(x[y]),b.numSupportedMorphTargets++); +b.uniformsList=[];for(k in b.uniforms)b.uniformsList.push([b.uniforms[k],k])};this.clearTarget=function(b,c,e,f){H(b);this.clear(c,e,f)};this.updateShadowMap=function(b,c){z(b,c)};this.render=function(b,c,o,S){var O,da,F,C,G,qa,B,la,J=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&z(b,c);P.info.render.calls=0;P.info.render.vertices=0;P.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Fa); +c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);t(Ca);this.initWebGLObjects(b);H(o);(this.autoClear||S)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(S=0;S=0;S--)if(O=b.__webglObjects[S],O.render){B=O.object;la=O.buffer;F=O.opaque;k(B);for(O=0;O0||x.faceVertexUvs.length> +0)m.__uvArray=new Float32Array(o*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(o*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(o*4),m.__skinVertexBArray=new Float32Array(o*4),m.__skinIndexArray=new Float32Array(o*4),m.__skinWeightArray=new Float32Array(o*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(S*2);if(m.numMorphTargets){m.__morphTargetsArrays= +[];x=0;for(z=m.numMorphTargets;x=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglColorBuffer),p.bufferData(p.ARRAY_BUFFER,ea,A));Ga&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglNormalBuffer),p.bufferData(p.ARRAY_BUFFER,ga,A));Da&&va.hasTangents&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglTangentBuffer),p.bufferData(p.ARRAY_BUFFER,ha,A));Ha&&ra>0&&(p.bindBuffer(p.ARRAY_BUFFER, -t.__webglUVBuffer),p.bufferData(p.ARRAY_BUFFER,ia,A));Ha&&T>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglUV2Buffer),p.bufferData(p.ARRAY_BUFFER,Ea,A));Ca&&(p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,Ba,A),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,ta,A));R>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexABuffer),p.bufferData(p.ARRAY_BUFFER,ja,A),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexBBuffer), -p.bufferData(p.ARRAY_BUFFER,sa,A),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),p.bufferData(p.ARRAY_BUFFER,aa,A),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),p.bufferData(p.ARRAY_BUFFER,fa,A));S&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray,delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}k.__dirtyVertices= -!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(m)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=p.DYNAMIC_DRAW;n=x=S=S=void 0;u=h.vertices;o=h.colors;v=u.length;t=o.length;y=h.__vertexArray;A=h.__colorArray;z=h.__dirtyColors;if(h.__dirtyVertices){for(S=0;S0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglColorBuffer),p.bufferData(p.ARRAY_BUFFER,ea,y));Ga&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglNormalBuffer),p.bufferData(p.ARRAY_BUFFER,ga,y));Da&&va.hasTangents&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglTangentBuffer),p.bufferData(p.ARRAY_BUFFER,ha,y));Ha&&ra>0&&(p.bindBuffer(p.ARRAY_BUFFER, +t.__webglUVBuffer),p.bufferData(p.ARRAY_BUFFER,ia,y));Ha&&T>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglUV2Buffer),p.bufferData(p.ARRAY_BUFFER,Ea,y));Ca&&(p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,Ba,y),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,ta,y));R>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexABuffer),p.bufferData(p.ARRAY_BUFFER,ja,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexBBuffer), +p.bufferData(p.ARRAY_BUFFER,sa,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),p.bufferData(p.ARRAY_BUFFER,aa,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),p.bufferData(p.ARRAY_BUFFER,fa,y));S&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray,delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}k.__dirtyVertices= +!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(m)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=p.DYNAMIC_DRAW;n=x=S=S=void 0;u=h.vertices;o=h.colors;v=u.length;t=o.length;z=h.__vertexArray;y=h.__colorArray;A=h.__dirtyColors;if(h.__dirtyVertices){for(S=0;S1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=m;c.v=k;return c}, clamp:function(b,c,e){return be?e:b}};THREE.ColorUtils.__hsv={h:0,s:0,v:0}; -THREE.GeometryUtils={merge:function(b,c){var e,f,h=b.vertices.length,k=c instanceof THREE.Mesh?c.geometry:c,m=b.vertices,n=k.vertices,u=b.faces,t=k.faces,w=b.faceVertexUvs[0],k=k.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var o=0,x=n.length;o1&&(f=1-f,h=1-h);k=1-f-h;m.copy(b);m.multiplyScalar(f);n.copy(c);n.multiplyScalar(h);m.addSelf(n);n.copy(e);n.multiplyScalar(k);m.addSelf(n);return m},randomPointInFace:function(b,c,e){var f,h,k;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,h=c.vertices[b.b].position,k=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,h,k);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;h=c.vertices[b.b].position;k=c.vertices[b.c].position;var c=c.vertices[b.d].position, @@ -362,8 +362,8 @@ b?c(e,k-1):t[k]e?e:b},mapLinear:function(b,c,e,f,h){return(b-c)*(h-f)/(e-c)+f}};THREE.SceneUtils={showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var e,f,h=b.children.length;for(f=0;f0?(m=e[e.length-1],v=m.x,z=m.y):(m=this.actions[f-1].args,v=m[m.length-2],z=m[m.length-1]);for(m=1;m<=b;m++)A=m/b,k=THREE.Shape.Utils.b2(A,v,o,n),A=THREE.Shape.Utils.b2(A,z,x, -u),e.push(new THREE.Vector2(k,A));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];u=k[5];o=k[0];x=k[1];t=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,z=m.y):(m=this.actions[f-1].args,v=m[m.length-2],z=m[m.length-1]);for(m=1;m<=b;m++)A=m/b,k=THREE.Shape.Utils.b3(A,v,o,t,n),A=THREE.Shape.Utils.b3(A,z,x,w,u),e.push(new THREE.Vector2(k,A));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];A=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m); -for(m=1;m<=A;m++)e.push(k.getPointAt(m/A));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];u=k[1];t=k[2];o=k[3];A=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);z=A-o;var y=b*2;for(m=1;m<=y;m++)A=m/y,x||(A=1-A),A=o+A*z,k=w+n+t*Math.cos(A),A=v+u+t*Math.sin(A),e.push(new THREE.Vector2(k,A))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)}; +THREE.Path.prototype.getPoints=function(b,c){var b=b||12,e=[],f,h,k,m,n,u,t,w,o,x,v,A,z;f=0;for(h=this.actions.length;f0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b2(z,v,o,n),z=THREE.Shape.Utils.b2(z,A,x, +u),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];u=k[5];o=k[0];x=k[1];t=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b3(z,v,o,t,n),z=THREE.Shape.Utils.b3(z,A,x,w,u),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];z=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m); +for(m=1;m<=z;m++)e.push(k.getPointAt(m/z));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];u=k[1];t=k[2];o=k[3];z=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);A=z-o;var y=b*2;for(m=1;m<=y;m++)z=m/y,x||(z=1-z),z=o+z*A,k=w+n+t*Math.cos(z),z=v+u+t*Math.sin(z),e.push(new THREE.Vector2(k,z))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)}; THREE.Path.prototype.nltransform=function(b,c,e,f,h,k){var m=this.getPoints(),n,u,t,w,o;n=0;for(u=m.length;n=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;var A=[t[m],e[n],e[h]];o=THREE.FontUtils.Triangulate.area(A);var y=[t[m],t[k],e[n]];x=THREE.FontUtils.Triangulate.area(y);v=n;w=m;n+=1;m+=-1;n< -0&&(n+=e.length);n%=e.length;m<0&&(m+=t.length);m%=t.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;A=[t[m],e[n],e[h]];A=THREE.FontUtils.Triangulate.area(A);y=[t[m],t[k],e[n]];y=THREE.FontUtils.Triangulate.area(y);o+x>A+y&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=t.length),m%=t.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:t.length-1);o=e.slice(0,n);x=e.slice(n);v=t.slice(m);w=t.slice(0,m);k=[t[m],t[k],e[n]];z.push([t[m],e[n],e[h]]);z.push(k);e=o.concat(v).concat(w).concat(x)}return{shape:e, -isolatedPts:z,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,u,t={};k=0;for(m=f.length;k=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;var z=[t[m],e[n],e[h]];o=THREE.FontUtils.Triangulate.area(z);var y=[t[m],t[k],e[n]];x=THREE.FontUtils.Triangulate.area(y);v=n;w=m;n+=1;m+=-1;n< +0&&(n+=e.length);n%=e.length;m<0&&(m+=t.length);m%=t.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;z=[t[m],e[n],e[h]];z=THREE.FontUtils.Triangulate.area(z);y=[t[m],t[k],e[n]];y=THREE.FontUtils.Triangulate.area(y);o+x>z+y&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=t.length),m%=t.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:t.length-1);o=e.slice(0,n);x=e.slice(n);v=t.slice(m);w=t.slice(0,m);k=[t[m],t[k],e[n]];A.push([t[m],e[n],e[h]]);A.push(k);e=o.concat(v).concat(w).concat(x)}return{shape:e, +isolatedPts:A,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,u,t={};k=0;for(m=f.length;k1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= this.getPrevKeyWith("pos",v,m.index-1).pos,this.points[1]=h,this.points[2]=k,this.points[3]=this.getNextKeyWith("pos",v,n.index+1).pos,f=f*0.33+0.33,h=this.interpolateCatmullRom(this.points,f),e.x=h[0],e.y=h[1],e.z=h[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e=== "rot")THREE.Quaternion.slerp(h,k,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f}}if(this.JITCompile&&w[0][t]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;v0||this.autoForward&&!(u<0)?1:u));this.object.translateX(b*t);this.object.translateY(b*w);m&&(this.roll+=this.rollSpeed*this.delta*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize(); else if(this.forward.y0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;nb&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function h(b){for(H=b.length;--H>=0;){ka=H;na=H-1;na<0&&(na=b.length- 1);for(var c=0,e=v+w*2,c=0;c=0;Q--){Z=Q/w;$=u*(1-Z);Z=t*Math.sin(Z*Math.PI/2);H=0;for(T=F.length;H=0;Q--){Z=Q/w;$=u*(1-Z);Z=t*Math.sin(Z*Math.PI/2);H=0;for(T=F.length;H0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,n,x)))-1);t.push(w)}c.push(t)}for(var v,z,A,h=c.length,e=0;e0)for(f=0;f1&&(v= -this.vertices[m].position.clone(),z=this.vertices[u].position.clone(),A=this.vertices[t].position.clone(),v.normalize(),z.normalize(),A.normalize(),this.faces.push(new THREE.Face3(m,u,t,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(A.x,A.y,A.z)])),this.faceVertexUvs[0].push([w,o,y]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry; +THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f,h=Math.PI,k=Math.max(3,c||8),m=Math.max(2,e||6),c=[],e=0;e0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,n,x)))-1);t.push(w)}c.push(t)}for(var v,A,z,h=c.length,e=0;e0)for(f=0;f1&&(v= +this.vertices[m].position.clone(),A=this.vertices[u].position.clone(),z=this.vertices[t].position.clone(),v.normalize(),A.normalize(),z.normalize(),this.faces.push(new THREE.Face3(m,u,t,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(A.x,A.y,A.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([w,o,y]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry; THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry; THREE.TextGeometry=function(b,c){var e=(new THREE.TextPath(b,c)).toShapes();c.amount=c.height!==void 0?c.height:50;if(c.bevelThickness===void 0)c.bevelThickness=10;if(c.bevelSize===void 0)c.bevelSize=8;if(c.bevelEnabled===void 0)c.bevelEnabled=!1;if(c.bend){var f=e[e.length-1].getBoundingBox().maxX;c.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(f/2,120),new THREE.Vector2(f,0))}THREE.ExtrudeGeometry.call(this,e,c)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry; THREE.TextGeometry.prototype.constructor=THREE.TextGeometry; THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(b,c){return(new TextPath(b,c)).toShapes()},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var c= -this.getFace(),e=this.size/c.resolution,f=0,h=String(b).split(""),k=h.length,m=[],b=0;b0)for(t=0;t2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}u=t;h<=u&&(u=0);t=u+1;h<=t&&(t=0);w=t+1;h<=w&&(w=0);var x;a:{x=b;var v=u,z=t,A=w,y=h,E=m,F=void 0,C=void 0,G=void 0, -J=void 0,M=void 0,K=void 0,B=void 0,L=void 0,Y=void 0,C=x[E[v]].x,G=x[E[v]].y,J=x[E[z]].x,M=x[E[z]].y,K=x[E[A]].x,B=x[E[A]].y;if(1.0E-10>(J-C)*(B-G)-(M-G)*(K-C))x=!1;else{for(F=0;F=0&&Q>=0&&$>=0){x=!1;break a}}x= +this.getFace(),e=this.size/c.resolution,f=0,h=String(b).split(""),k=h.length,m=[],b=0;b0)for(t=0;t2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}u=t;h<=u&&(u=0);t=u+1;h<=t&&(t=0);w=t+1;h<=w&&(w=0);var x;a:{x=b;var v=u,A=t,z=w,y=h,E=m,F=void 0,C=void 0,G=void 0, +J=void 0,M=void 0,K=void 0,B=void 0,L=void 0,Y=void 0,C=x[E[v]].x,G=x[E[v]].y,J=x[E[A]].x,M=x[E[A]].y,K=x[E[z]].x,B=x[E[z]].y;if(1.0E-10>(J-C)*(B-G)-(M-G)*(K-C))x=!1;else{for(F=0;F=0&&Q>=0&&$>=0){x=!1;break a}}x= !0}}if(x){k.push([b[m[u]],b[m[t]],b[m[w]]]);n.push([m[u],m[t],m[w]]);u=t;for(w=t+1;w0;)this.smooth(b)}; THREE.SubdivisionModifier.prototype.smooth=function(b){function c(b,c,e,f,n,t){var u=new THREE.Face4(b,c,e,f,null,n.color,n.material);if(m.useOldVertexColors){u.vertexColors=[];for(var v,p,w,x=0;x<4;x++){w=t[x];v=new THREE.Color;v.setRGB(0,0,0);for(var y=0;y>7)-127;f|=(h&127)<<16|k<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,c){var e=w(b,c),f=w(b,c+1),k=w(b,c+2);return(w(b,c+3)<<24)+(k<<16)+(f<<8)+e}function u(b,c){var e=w(b,c);return(w(b,c+1)<<8)+e}function t(b,c){var e=w(b,c);return e>127?e-256:e}function w(b,c){return b.charCodeAt(c)&255}function o(c){var e, f,k;e=h(b,c);f=h(b,c+M);k=h(b,c+K);c=u(b,c+B);E.faces.push(new THREE.Face3(e,f,k,null,null,E.materials[c]))}function x(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+M);k=h(b,c+K);m=u(b,c+B);o=h(b,c+L);p=h(b,c+Y);c=h(b,c+H);m=E.materials[m];var t=G[p*3],v=G[p*3+1];p=G[p*3+2];var w=G[c*3],x=G[c*3+1],c=G[c*3+2];E.faces.push(new THREE.Face3(e,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(t,v,p),new THREE.Vector3(w,x,c)],null,m))}function v(c){var e,f,k,m;e=h(b,c);f=h(b,c+T);k=h(b,c+Q);m=h(b, -c+Z);c=u(b,c+$);E.faces.push(new THREE.Face4(e,f,k,m,null,null,E.materials[c]))}function z(c){var e,f,k,m,o,t,v,w;e=h(b,c);f=h(b,c+T);k=h(b,c+Q);m=h(b,c+Z);o=u(b,c+$);t=h(b,c+P);v=h(b,c+p);w=h(b,c+V);c=h(b,c+fa);o=E.materials[o];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var S=G[w*3],A=G[w*3+1];w=G[w*3+2];var z=G[c*3],B=G[c*3+1],c=G[c*3+2];E.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(G[t*3],G[t*3+1],G[t*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(S,A,w),new THREE.Vector3(z,B,c)],null,o))} -function A(c){var e,f,k,m;e=h(b,c);f=h(b,c+ea);k=h(b,c+ha);c=J[e*2];m=J[e*2+1];e=J[f*2];var o=E.faceVertexUvs[0];f=J[f*2+1];var p=J[k*2];k=J[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,k));o.push(t)}function y(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+ga);k=h(b,c+ka);m=h(b,c+na);c=J[e*2];o=J[e*2+1];e=J[f*2];p=J[f*2+1];f=J[k*2];var t=E.faceVertexUvs[0];k=J[k*2+1];var u=J[m*2];m=J[m*2+1];var v=[];v.push(new THREE.UV(c,o));v.push(new THREE.UV(e,p));v.push(new THREE.UV(f, +c+Z);c=u(b,c+$);E.faces.push(new THREE.Face4(e,f,k,m,null,null,E.materials[c]))}function A(c){var e,f,k,m,o,t,v,w;e=h(b,c);f=h(b,c+T);k=h(b,c+Q);m=h(b,c+Z);o=u(b,c+$);t=h(b,c+P);v=h(b,c+p);w=h(b,c+V);c=h(b,c+fa);o=E.materials[o];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var S=G[w*3],z=G[w*3+1];w=G[w*3+2];var A=G[c*3],B=G[c*3+1],c=G[c*3+2];E.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(G[t*3],G[t*3+1],G[t*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(S,z,w),new THREE.Vector3(A,B,c)],null,o))} +function z(c){var e,f,k,m;e=h(b,c);f=h(b,c+ea);k=h(b,c+ha);c=J[e*2];m=J[e*2+1];e=J[f*2];var o=E.faceVertexUvs[0];f=J[f*2+1];var p=J[k*2];k=J[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,k));o.push(t)}function y(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+ga);k=h(b,c+ka);m=h(b,c+na);c=J[e*2];o=J[e*2+1];e=J[f*2];p=J[f*2+1];f=J[k*2];var t=E.faceVertexUvs[0];k=J[k*2+1];var u=J[m*2];m=J[m*2+1];var v=[];v.push(new THREE.UV(c,o));v.push(new THREE.UV(e,p));v.push(new THREE.UV(f, k));v.push(new THREE.UV(u,m));t.push(v)}var E=this,F=0,C,G=[],J=[],M,K,B,L,Y,H,T,Q,Z,$,P,p,V,fa,ea,ha,ga,ka,na,aa,W,U,ia,ja,ta;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(E,f,c);C={signature:b.substr(F,8),header_bytes:w(b,F+8),vertex_coordinate_bytes:w(b,F+9),normal_coordinate_bytes:w(b,F+10),uv_coordinate_bytes:w(b,F+11),vertex_index_bytes:w(b,F+12),normal_index_bytes:w(b,F+13),uv_index_bytes:w(b,F+14),material_index_bytes:w(b,F+15),nvertices:h(b,F+16),nnormals:h(b,F+16+4),nuvs:h(b, F+16+8),ntri_flat:h(b,F+16+12),ntri_smooth:h(b,F+16+16),ntri_flat_uv:h(b,F+16+20),ntri_smooth_uv:h(b,F+16+24),nquad_flat:h(b,F+16+28),nquad_smooth:h(b,F+16+32),nquad_flat_uv:h(b,F+16+36),nquad_smooth_uv:h(b,F+16+40)};F+=C.header_bytes;M=C.vertex_index_bytes;K=C.vertex_index_bytes*2;B=C.vertex_index_bytes*3;L=C.vertex_index_bytes*3+C.material_index_bytes;Y=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;H=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;T=C.vertex_index_bytes; Q=C.vertex_index_bytes*2;Z=C.vertex_index_bytes*3;$=C.vertex_index_bytes*4;P=C.vertex_index_bytes*4+C.material_index_bytes;p=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;V=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;fa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;ea=C.uv_index_bytes;ha=C.uv_index_bytes*2;ga=C.uv_index_bytes;ka=C.uv_index_bytes*2;na=C.uv_index_bytes*3;c=C.vertex_index_bytes*3+C.material_index_bytes;ta=C.vertex_index_bytes* 4+C.material_index_bytes;aa=C.ntri_flat*c;W=C.ntri_smooth*(c+C.normal_index_bytes*3);U=C.ntri_flat_uv*(c+C.uv_index_bytes*3);ia=C.ntri_smooth_uv*(c+C.normal_index_bytes*3+C.uv_index_bytes*3);ja=C.nquad_flat*ta;c=C.nquad_smooth*(ta+C.normal_index_bytes*4);ta=C.nquad_flat_uv*(ta+C.uv_index_bytes*4);F+=function(c){for(var f,k,h,n=C.vertex_coordinate_bytes*3,o=c+C.nvertices*n;c=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];for(y=0;y=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];for(y=0;y1){o=new THREE.MeshFaceMaterial;for(j=0;j=0,m=k.indexOf("(")>=0,n;if(h)f=k.split("."),k=f.shift(),f.shift();else if(m){n=k.split("(");k=n.shift(); for(f=0;fc){u=t.output[p];break}m=u!==void 0?u instanceof THREE.Matrix4? m.multiply(m,u):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};o.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b1&&(Y=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(M,Y);object.name=v;object.position.set(C[0],C[1],C[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=F.visible;V.scene.add(object);V.objects[v]=object;F.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),V.scene.collisions.colliders.push(b)); if(F.castsShadow)b=new THREE.ShadowVolume(M),V.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}}else C=F.position,r=F.rotation,q=F.quaternion,s=F.scale,q=0,object=new THREE.Object3D,object.name=v,object.position.set(C[0],C[1],C[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0], s[1],s[2]),object.visible=F.visible!==void 0?F.visible:!1,V.scene.add(object),V.objects[v]=object,V.empties[v]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}function u(b){return function(c){V.geometries[b]=c;n();Z-=1;e.onLoadComplete();w()}}function t(b){return function(c){V.geometries[b]=c}}function w(){e.callbackProgress({totalModels:P,totalTextures:p,loadedModels:P-Z,loadedTextures:p-$},V);e.onLoadProgress();Z==0&&$==0&&c(V)}var o,x, -v,z,A,y,E,F,C,G,J,M,K,B,L,Y,H,T,Q,Z,$,P,p,V;T=b.data;L=new THREE.BinaryLoader;Q=new THREE.JSONLoader;$=Z=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in T.objects)if(F=T.objects[v],F.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(T.transform){b=T.transform.position;G=T.transform.rotation;var fa=T.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);G&&V.scene.rotation.set(G[0], -G[1],G[2]);fa&&V.scene.scale.set(fa[0],fa[1],fa[2]);(b||G||fa)&&V.scene.updateMatrix()}b=function(){$-=1;w();e.onLoadComplete()};for(A in T.cameras)G=T.cameras[A],G.type=="perspective"?K=new THREE.PerspectiveCamera(G.fov,G.aspect,G.near,G.far):G.type=="ortho"&&(K=new THREE.OrthographicCamera(G.left,G.right,G.top,G.bottom,G.near,G.far)),C=G.position,G=G.target,K.position.set(C[0],C[1],C[2]),K.target=new THREE.Vector3(G[0],G[1],G[2]),V.cameras[A]=K;for(z in T.lights)A=T.lights[z],K=A.color!==void 0? -A.color:16777215,G=A.intensity!==void 0?A.intensity:1,A.type=="directional"?(C=A.direction,H=new THREE.DirectionalLight(K,G),H.position.set(C[0],C[1],C[2]),H.position.normalize()):A.type=="point"?(C=A.position,d=A.distance,H=new THREE.PointLight(K,G,d),H.position.set(C[0],C[1],C[2])):A.type=="ambient"&&(H=new THREE.AmbientLight(K)),V.scene.add(H),V.lights[z]=H;for(y in T.fogs)z=T.fogs[y],z.type=="linear"?B=new THREE.Fog(0,z.near,z.far):z.type=="exp2"&&(B=new THREE.FogExp2(0,z.density)),G=z.color, +v,A,z,y,E,F,C,G,J,M,K,B,L,Y,H,T,Q,Z,$,P,p,V;T=b.data;L=new THREE.BinaryLoader;Q=new THREE.JSONLoader;$=Z=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in T.objects)if(F=T.objects[v],F.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(T.transform){b=T.transform.position;G=T.transform.rotation;var fa=T.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);G&&V.scene.rotation.set(G[0], +G[1],G[2]);fa&&V.scene.scale.set(fa[0],fa[1],fa[2]);(b||G||fa)&&V.scene.updateMatrix()}b=function(){$-=1;w();e.onLoadComplete()};for(z in T.cameras)G=T.cameras[z],G.type=="perspective"?K=new THREE.PerspectiveCamera(G.fov,G.aspect,G.near,G.far):G.type=="ortho"&&(K=new THREE.OrthographicCamera(G.left,G.right,G.top,G.bottom,G.near,G.far)),C=G.position,G=G.target,K.position.set(C[0],C[1],C[2]),K.target=new THREE.Vector3(G[0],G[1],G[2]),V.cameras[z]=K;for(A in T.lights)z=T.lights[A],K=z.color!==void 0? +z.color:16777215,G=z.intensity!==void 0?z.intensity:1,z.type=="directional"?(C=z.direction,H=new THREE.DirectionalLight(K,G),H.position.set(C[0],C[1],C[2]),H.position.normalize()):z.type=="point"?(C=z.position,d=z.distance,H=new THREE.PointLight(K,G,d),H.position.set(C[0],C[1],C[2])):z.type=="ambient"&&(H=new THREE.AmbientLight(K)),V.scene.add(H),V.lights[A]=H;for(y in T.fogs)A=T.fogs[y],A.type=="linear"?B=new THREE.Fog(0,A.near,A.far):A.type=="exp2"&&(B=new THREE.FogExp2(0,A.density)),G=A.color, B.color.setRGB(G[0],G[1],G[2]),V.fogs[y]=B;if(V.cameras&&T.defaults.camera)V.currentCamera=V.cameras[T.defaults.camera];if(V.fogs&&T.defaults.fog)V.scene.fog=V.fogs[T.defaults.fog];G=T.defaults.bgcolor;V.bgColor=new THREE.Color;V.bgColor.setRGB(G[0],G[1],G[2]);V.bgColorAlpha=T.defaults.bgalpha;for(o in T.geometries)if(y=T.geometries[o],y.type=="bin_mesh"||y.type=="ascii_mesh")Z+=1,e.onLoadStart();P=Z;for(o in T.geometries)y=T.geometries[o],y.type=="cube"?(M=new THREE.CubeGeometry(y.width,y.height, y.depth,y.segmentsWidth,y.segmentsHeight,y.segmentsDepth,null,y.flipped,y.sides),V.geometries[o]=M):y.type=="plane"?(M=new THREE.PlaneGeometry(y.width,y.height,y.segmentsWidth,y.segmentsHeight),V.geometries[o]=M):y.type=="sphere"?(M=new THREE.SphereGeometry(y.radius,y.segmentsWidth,y.segmentsHeight),V.geometries[o]=M):y.type=="cylinder"?(M=new THREE.CylinderGeometry(y.topRad,y.botRad,y.height,y.radSegs,y.heightSegs),V.geometries[o]=M):y.type=="torus"?(M=new THREE.TorusGeometry(y.radius,y.tube,y.segmentsR, y.segmentsT),V.geometries[o]=M):y.type=="icosahedron"?(M=new THREE.IcosahedronGeometry(y.subdivisions),V.geometries[o]=M):y.type=="bin_mesh"?L.load({model:f(y.url,T.urlBaseType),callback:u(o)}):y.type=="ascii_mesh"?Q.load({model:f(y.url,T.urlBaseType),callback:u(o)}):y.type=="embedded_mesh"&&(y=T.embeds[y.id])&&Q.createModel(y,t(o),"");for(E in T.textures)if(o=T.textures[E],o.url instanceof Array){$+=o.url.length;for(L=0;L=this.maxCount-3&&n(this)};this.begin=function(){this.count=0; this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(u=this.size-1);var x=Math.floor(t-n);x<1&&(x=1);t=Math.floor(t+n);t>this.size-1&&(t=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size- -1);for(var z,A,y,E,F,C;o0&&(this.field[y+z]+=E)}}};this.addPlaneX=function(b,c){var h,k,m,n,u,t=this.size,w=this.yd,o=this.zd,x=this.field,v=t*Math.sqrt(b/c);v>t&&(v=t);for(h=0;h0)for(k=0;kw&&(z=w);for(k=0;k0){u=k*o;for(h=0;hsize&&(dist=size);for(m=0;m0){u=zd*m;for(k=0;k0&&(this.field[y+A]+=E)}}};this.addPlaneX=function(b,c){var h,k,m,n,u,t=this.size,w=this.yd,o=this.zd,x=this.field,v=t*Math.sqrt(b/c);v>t&&(v=t);for(h=0;h0)for(k=0;kw&&(A=w);for(k=0;k0){u=k*o;for(h=0;hsize&&(dist=size);for(m=0;m0){u=zd*m;for(k=0;k0,r={};r.vertices=new Float32Array(16);r.faces=new Uint16Array(6);Q=0;r.vertices[Q++]=-1;r.vertices[Q++]=-1;r.vertices[Q++]=0;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=-1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=0;r.vertices[Q++]= --1;r.vertices[Q++]=1;r.vertices[Q++]=0;Q=r.vertices[Q++]=0;r.faces[Q++]=0;r.faces[Q++]=1;r.faces[Q++]=2;r.faces[Q++]=0;r.faces[Q++]=2;r.faces[Q++]=3;r.vertexBuffer=f.createBuffer();r.elementBuffer=f.createBuffer();f.bindBuffer(f.ARRAY_BUFFER,r.vertexBuffer);f.bufferData(f.ARRAY_BUFFER,r.vertices,f.STATIC_DRAW);f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,r.elementBuffer);f.bufferData(f.ELEMENT_ARRAY_BUFFER,r.faces,f.STATIC_DRAW);r.program=f.createProgram();f.attachShader(r.program,Z("fragment",THREE.ShaderLib.sprite.fragmentShader)); -f.attachShader(r.program,Z("vertex",THREE.ShaderLib.sprite.vertexShader));f.linkProgram(r.program);r.attributes={};r.uniforms={};r.attributes.position=f.getAttribLocation(r.program,"position");r.attributes.uv=f.getAttribLocation(r.program,"uv");r.uniforms.uvOffset=f.getUniformLocation(r.program,"uvOffset");r.uniforms.uvScale=f.getUniformLocation(r.program,"uvScale");r.uniforms.rotation=f.getUniformLocation(r.program,"rotation");r.uniforms.scale=f.getUniformLocation(r.program,"scale");r.uniforms.alignment= -f.getUniformLocation(r.program,"alignment");r.uniforms.color=f.getUniformLocation(r.program,"color");r.uniforms.map=f.getUniformLocation(r.program,"map");r.uniforms.opacity=f.getUniformLocation(r.program,"opacity");r.uniforms.useScreenCoordinates=f.getUniformLocation(r.program,"useScreenCoordinates");r.uniforms.affectedByDistance=f.getUniformLocation(r.program,"affectedByDistance");r.uniforms.screenPosition=f.getUniformLocation(r.program,"screenPosition");r.uniforms.modelViewMatrix=f.getUniformLocation(r.program, -"modelViewMatrix");r.uniforms.projectionMatrix=f.getUniformLocation(r.program,"projectionMatrix");var cb=!1;this.setSize=function(b,c){Ga.width=b;Ga.height=c;this.setViewport(0,0,Ga.width,Ga.height)};this.setViewport=function(b,c,d,e){Aa=b;Ea=c;va=d;Ka=e;f.viewport(Aa,Ea,va,Ka)};this.setScissor=function(b,c,d,e){f.scissor(b,c,d,e)};this.enableScissorTest=function(b){b?f.enable(f.SCISSOR_TEST):f.disable(f.SCISSOR_TEST)};this.setClearColorHex=function(b,c){wa.setHex(b);Ba=c;f.clearColor(wa.r,wa.g,wa.b, -Ba)};this.setClearColor=function(b,c){wa.copy(b);Ba=c;f.clearColor(wa.r,wa.g,wa.b,Ba)};this.getClearColor=function(){return wa};this.getClearAlpha=function(){return Ba};this.clear=function(b,c,d){var e=0;if(b==void 0||b)e|=f.COLOR_BUFFER_BIT;if(c==void 0||c)e|=f.DEPTH_BUFFER_BIT;if(d==void 0||d)e|=f.STENCIL_BUFFER_BIT;f.clear(e)};this.getContext=function(){return f};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray, -delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];f.deleteBuffer(c.__webglVertexBuffer);f.deleteBuffer(c.__webglNormalBuffer);f.deleteBuffer(c.__webglTangentBuffer);f.deleteBuffer(c.__webglColorBuffer);f.deleteBuffer(c.__webglUVBuffer);f.deleteBuffer(c.__webglUV2Buffer);f.deleteBuffer(c.__webglSkinVertexABuffer);f.deleteBuffer(c.__webglSkinVertexBBuffer);f.deleteBuffer(c.__webglSkinIndicesBuffer);f.deleteBuffer(c.__webglSkinWeightsBuffer); -f.deleteBuffer(c.__webglFaceBuffer);f.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d0,r={};r.vertices=new Float32Array(16);r.faces=new Uint16Array(6);Q=0;r.vertices[Q++]=-1;r.vertices[Q++]=-1;r.vertices[Q++]=0;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=-1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]= +0;r.vertices[Q++]=-1;r.vertices[Q++]=1;r.vertices[Q++]=0;Q=r.vertices[Q++]=0;r.faces[Q++]=0;r.faces[Q++]=1;r.faces[Q++]=2;r.faces[Q++]=0;r.faces[Q++]=2;r.faces[Q++]=3;r.vertexBuffer=f.createBuffer();r.elementBuffer=f.createBuffer();f.bindBuffer(f.ARRAY_BUFFER,r.vertexBuffer);f.bufferData(f.ARRAY_BUFFER,r.vertices,f.STATIC_DRAW);f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,r.elementBuffer);f.bufferData(f.ELEMENT_ARRAY_BUFFER,r.faces,f.STATIC_DRAW);r.program=f.createProgram();f.attachShader(r.program,Z("fragment", +THREE.ShaderLib.sprite.fragmentShader));f.attachShader(r.program,Z("vertex",THREE.ShaderLib.sprite.vertexShader));f.linkProgram(r.program);r.attributes={};r.uniforms={};r.attributes.position=f.getAttribLocation(r.program,"position");r.attributes.uv=f.getAttribLocation(r.program,"uv");r.uniforms.uvOffset=f.getUniformLocation(r.program,"uvOffset");r.uniforms.uvScale=f.getUniformLocation(r.program,"uvScale");r.uniforms.rotation=f.getUniformLocation(r.program,"rotation");r.uniforms.scale=f.getUniformLocation(r.program, +"scale");r.uniforms.alignment=f.getUniformLocation(r.program,"alignment");r.uniforms.color=f.getUniformLocation(r.program,"color");r.uniforms.map=f.getUniformLocation(r.program,"map");r.uniforms.opacity=f.getUniformLocation(r.program,"opacity");r.uniforms.useScreenCoordinates=f.getUniformLocation(r.program,"useScreenCoordinates");r.uniforms.affectedByDistance=f.getUniformLocation(r.program,"affectedByDistance");r.uniforms.screenPosition=f.getUniformLocation(r.program,"screenPosition");r.uniforms.modelViewMatrix= +f.getUniformLocation(r.program,"modelViewMatrix");r.uniforms.projectionMatrix=f.getUniformLocation(r.program,"projectionMatrix");var cb=!1;this.setSize=function(b,c){Ga.width=b;Ga.height=c;this.setViewport(0,0,Ga.width,Ga.height)};this.setViewport=function(b,c,d,e){Aa=b;Ea=c;va=d;Ka=e;f.viewport(Aa,Ea,va,Ka)};this.setScissor=function(b,c,d,e){f.scissor(b,c,d,e)};this.enableScissorTest=function(b){b?f.enable(f.SCISSOR_TEST):f.disable(f.SCISSOR_TEST)};this.setClearColorHex=function(b,c){wa.setHex(b); +Ba=c;f.clearColor(wa.r,wa.g,wa.b,Ba)};this.setClearColor=function(b,c){wa.copy(b);Ba=c;f.clearColor(wa.r,wa.g,wa.b,Ba)};this.getClearColor=function(){return wa};this.getClearAlpha=function(){return Ba};this.clear=function(b,c,d){var e=0;if(b==void 0||b)e|=f.COLOR_BUFFER_BIT;if(c==void 0||c)e|=f.DEPTH_BUFFER_BIT;if(d==void 0||d)e|=f.STENCIL_BUFFER_BIT;f.clear(e)};this.getContext=function(){return f};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray, +delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];f.deleteBuffer(c.__webglVertexBuffer);f.deleteBuffer(c.__webglNormalBuffer);f.deleteBuffer(c.__webglTangentBuffer);f.deleteBuffer(c.__webglColorBuffer);f.deleteBuffer(c.__webglUVBuffer);f.deleteBuffer(c.__webglUV2Buffer);f.deleteBuffer(c.__webglSkinVertexABuffer);f.deleteBuffer(c.__webglSkinVertexBBuffer);f.deleteBuffer(c.__webglSkinIndicesBuffer); +f.deleteBuffer(c.__webglSkinWeightsBuffer);f.deleteBuffer(c.__webglFaceBuffer);f.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d=0&&f.enableVertexAttribArray(s.position);s.color>=0&&f.enableVertexAttribArray(s.color);s.normal>=0&&f.enableVertexAttribArray(s.normal);s.tangent>=0&&f.enableVertexAttribArray(s.tangent); b.skinning&&s.skinVertexA>=0&&s.skinVertexB>=0&&s.skinIndex>=0&&s.skinWeight>=0&&(f.enableVertexAttribArray(s.skinVertexA),f.enableVertexAttribArray(s.skinVertexB),f.enableVertexAttribArray(s.skinIndex),f.enableVertexAttribArray(s.skinWeight));if(b.attributes)for(i in b.attributes)s[i]!==void 0&&s[i]>=0&&f.enableVertexAttribArray(s[i]);if(b.morphTargets)for(i=b.numSupportedMorphTargets=0;i=0&&(f.enableVertexAttribArray(s[v]),b.numSupportedMorphTargets++); -b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,d,f){V(b);this.clear(c,d,f)};this.render=function(b,c,t,r){var I,v,Da,S,x,Ua,z,Qa,Ra=b.lights,M=b.fog;na=-1;this.shadowMapEnabled&&y(b,c);H.info.render.calls=0;H.info.render.vertices=0;H.info.render.faces=0;if(c.matrixAutoUpdate){for(x=c;x.parent;)x=x.parent;x.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Xa);c.projectionMatrix.flattenToArray(Wa);Fa.multiply(c.projectionMatrix, -c.matrixWorldInverse);p(Fa);this.initWebGLObjects(b);V(t);(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);x=b.__webglObjects.length;for(r=0;r=0;r--)if(I=b.__webglObjects[r],I.render){z=I.object;Qa=I.buffer;Da=I.opaque;i(z);for(I=0;I0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(n* +b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,d,f){V(b);this.clear(c,d,f)};this.updateShadowMap=function(b,c){y(b,c)};this.render=function(b,c,t,r){var I,v,Da,S,x,Ua,z,Qa,Ra=b.lights,M=b.fog;na=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&y(b,c);H.info.render.calls=0;H.info.render.vertices=0;H.info.render.faces=0;if(c.matrixAutoUpdate){for(x=c;x.parent;)x=x.parent;x.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Xa); +c.projectionMatrix.flattenToArray(Wa);Fa.multiply(c.projectionMatrix,c.matrixWorldInverse);p(Fa);this.initWebGLObjects(b);V(t);(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);x=b.__webglObjects.length;for(r=0;r=0;r--)if(I=b.__webglObjects[r],I.render){z=I.object;Qa=I.buffer;Da=I.opaque;i(z);for(I=0;I0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(n* 2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(n*2)}if(k.geometry.skinWeights.length&&k.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(n*4),j.__skinVertexBArray=new Float32Array(n*4),j.__skinIndexArray=new Float32Array(n*4),j.__skinWeightArray=new Float32Array(n*4);j.__faceArray=new Uint16Array(v*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0));j.__lineArray=new Uint16Array(B*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(r= j.numMorphTargets;t Date: Wed, 12 Oct 2011 16:00:53 +0200 Subject: [PATCH 06/33] Replaced extra clamp and map_linear functions with MathUtils versions. --- build/Three.js | 638 +++++++++--------- build/custom/ThreeExtras.js | 22 +- examples/js/Car.js | 26 +- examples/webgl_materials_cubemap_dynamic.html | 16 +- src/extras/ColorUtils.js | 32 +- src/extras/MathUtils.js | 10 +- src/extras/controls/FirstPersonControls.js | 22 +- src/extras/controls/PathControls.js | 16 +- 8 files changed, 371 insertions(+), 411 deletions(-) diff --git a/build/Three.js b/build/Three.js index 3d50806a..49193449 100644 --- a/build/Three.js +++ b/build/Three.js @@ -16,37 +16,37 @@ c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,f=[];c=0;for(e=b.length;c0&&b>0&&k+b<1}for(var f,h=[],k=0,m=b.children.length;kb.scale.x)return[];f={distance:k,point:b.position,face:null,object:b};h.push(f)}else if(b instanceof THREE.Mesh){k=c(this.origin, -this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,u,t,w,o,x,v,A,z=b.geometry,y=z.vertices,k=0,m=z.faces.length;k0:x<0)))if(x=o.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(A.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,u,t)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,u,w)||e(v,u,t,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; -THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,o){n=!1;c=k;e=m;f=w;h=o;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=ck?f:k,h=h>m?h:m);b()};this.add3Points= -function(k,m,w,o,x,v){n?(n=!1,c=kw?k>x?k:x:w>x?w:x,h=m>o?m>v?m:v:o>v?o:v):(c=kw?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>o?m>v?m>h?m:h:v>h?v:h:o>v?o>h?o:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=ck.getRight()?f:k.getRight(),h=h> +this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,p,t,w,u,x,v,A,z=b.geometry,y=z.vertices,k=0,m=z.faces.length;k0:x<0)))if(x=u.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(A.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,p,t)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,p,w)||e(v,p,t,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; +THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,u){n=!1;c=k;e=m;f=w;h=u;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=ck?f:k,h=h>m?h:m);b()};this.add3Points= +function(k,m,w,u,x,v){n?(n=!1,c=kw?k>x?k:x:w>x?w:x,h=m>u?m>v?m:v:u>v?u:v):(c=kw?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>u?m>v?m>h?m:h:v>h?v:h:u>v?u>h?u:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=ck.getRight()?f:k.getRight(),h=h> k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}};THREE.Matrix3=function(){this.m=[]}; THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}}; -THREE.Matrix4=function(b,c,e,f,h,k,m,n,u,t,w,o,x,v,A,z){this.set(b!==void 0?b:1,c||0,e||0,f||0,h||0,k!==void 0?k:1,m||0,n||0,u||0,t||0,w!==void 0?w:1,o||0,x||0,v||0,A||0,z!==void 0?z:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,h,k,m,n,u,t,w,o,x,v,A,z){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=h;this.n22=k;this.n23=m;this.n24=n;this.n31=u;this.n32=t;this.n33=w;this.n34=o;this.n41=x;this.n42=v;this.n43=A;this.n44=z;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b, +THREE.Matrix4=function(b,c,e,f,h,k,m,n,p,t,w,u,x,v,A,z){this.set(b!==void 0?b:1,c||0,e||0,f||0,h||0,k!==void 0?k:1,m||0,n||0,p||0,t||0,w!==void 0?w:1,u||0,x||0,v||0,A||0,z!==void 0?z:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,f,h,k,m,n,p,t,w,u,x,v,A,z){this.n11=b;this.n12=c;this.n13=e;this.n14=f;this.n21=h;this.n22=k;this.n23=m;this.n24=n;this.n31=p;this.n32=t;this.n33=w;this.n34=u;this.n41=x;this.n42=v;this.n43=A;this.n44=z;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b, c,e){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,k=THREE.Matrix4.__v3;k.sub(b,c).normalize();if(k.length()===0)k.z=1;f.cross(e,k).normalize();f.length()===0&&(k.x+=1.0E-4,f.cross(e,k).normalize());h.cross(k,f).normalize();this.n11=f.x;this.n12=h.x;this.n13=k.x;this.n21=f.y;this.n22=h.y;this.n23=k.y;this.n31=f.z;this.n32=h.z;this.n33=k.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,f=b.z,h=1/(this.n41*c+this.n42*e+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*e+this.n13*f+this.n14)*h; b.y=(this.n21*c+this.n22*e+this.n23*f+this.n24)*h;b.z=(this.n31*c+this.n32*e+this.n33*f+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,e=b.y,f=b.z,h=b.w;b.x=this.n11*c+this.n12*e+this.n13*f+this.n14*h;b.y=this.n21*c+this.n22*e+this.n23*f+this.n24*h;b.z=this.n31*c+this.n32*e+this.n33*f+this.n34*h;b.w=this.n41*c+this.n42*e+this.n43*f+this.n44*h;return b},rotateAxis:function(b){var c=b.x,e=b.y,f=b.z;b.x=c*this.n11+e*this.n12+f*this.n13;b.y=c*this.n21+e*this.n22+f*this.n23;b.z=c*this.n31+ -e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,u=b.n23,t=b.n24,w=b.n31,o=b.n32,x=b.n33,v=b.n34,A=b.n41,z=b.n42,y=b.n43,E=b.n44,F=c.n11,C=c.n12, -G=c.n13,J=c.n14,M=c.n21,K=c.n22,B=c.n23,L=c.n24,Y=c.n31,H=c.n32,T=c.n33,Q=c.n34,Z=c.n41,$=c.n42,P=c.n43,p=c.n44;this.n11=e*F+f*M+h*Y+k*Z;this.n12=e*C+f*K+h*H+k*$;this.n13=e*G+f*B+h*T+k*P;this.n14=e*J+f*L+h*Q+k*p;this.n21=m*F+n*M+u*Y+t*Z;this.n22=m*C+n*K+u*H+t*$;this.n23=m*G+n*B+u*T+t*P;this.n24=m*J+n*L+u*Q+t*p;this.n31=w*F+o*M+x*Y+v*Z;this.n32=w*C+o*K+x*H+v*$;this.n33=w*G+o*B+x*T+v*P;this.n34=w*J+o*L+x*Q+v*p;this.n41=A*F+z*M+y*Y+E*Z;this.n42=A*C+z*K+y*H+E*$;this.n43=A*G+z*B+y*T+E*P;this.n44=A*J+z* -L+y*Q+E*p;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=b;this.n31*= -b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,h=this.n21,k=this.n22,m=this.n23,n=this.n24,u=this.n31,t=this.n32,w=this.n33,o=this.n34,x=this.n41,v=this.n42,A=this.n43,z=this.n44;return f*m*t*x-e*n*t*x-f*k*w*x+c*n*w*x+e*k*o*x-c*m*o*x-f*m*u*v+e*n*u*v+f*h*w*v-b*n*w*v-e*h*o*v+b*m*o*v+f*k*u*A-c*n*u*A-f*h*t*A+b*n*t*A+c*h*o*A-b*k*o*A-e*k*u*z+c*m*u*z+e*h*t*z-b*m*t*z-c*h*w*z+b*k*w*z}, +e*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,p=b.n23,t=b.n24,w=b.n31,u=b.n32,x=b.n33,v=b.n34,A=b.n41,z=b.n42,y=b.n43,E=b.n44,F=c.n11,C=c.n12, +G=c.n13,J=c.n14,M=c.n21,K=c.n22,B=c.n23,L=c.n24,Y=c.n31,H=c.n32,T=c.n33,Q=c.n34,Z=c.n41,$=c.n42,P=c.n43,o=c.n44;this.n11=e*F+f*M+h*Y+k*Z;this.n12=e*C+f*K+h*H+k*$;this.n13=e*G+f*B+h*T+k*P;this.n14=e*J+f*L+h*Q+k*o;this.n21=m*F+n*M+p*Y+t*Z;this.n22=m*C+n*K+p*H+t*$;this.n23=m*G+n*B+p*T+t*P;this.n24=m*J+n*L+p*Q+t*o;this.n31=w*F+u*M+x*Y+v*Z;this.n32=w*C+u*K+x*H+v*$;this.n33=w*G+u*B+x*T+v*P;this.n34=w*J+u*L+x*Q+v*o;this.n41=A*F+z*M+y*Y+E*Z;this.n42=A*C+z*K+y*H+E*$;this.n43=A*G+z*B+y*T+E*P;this.n44=A*J+z* +L+y*Q+E*o;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=b;this.n31*= +b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,f=this.n14,h=this.n21,k=this.n22,m=this.n23,n=this.n24,p=this.n31,t=this.n32,w=this.n33,u=this.n34,x=this.n41,v=this.n42,A=this.n43,z=this.n44;return f*m*t*x-e*n*t*x-f*k*w*x+c*n*w*x+e*k*u*x-c*m*u*x-f*m*p*v+e*n*p*v+f*h*w*v-b*n*w*v-e*h*u*v+b*m*u*v+f*k*p*A-c*n*p*A-f*h*t*A+b*n*t*A+c*h*u*A-b*k*u*A-e*k*p*z+c*m*p*z+e*h*t*z-b*m*t*z-c*h*w*z+b*k*w*z}, transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32;b.n33=this.n33;b.n34=this.n34; b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]=this.n11; b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=this.n34; b[c+15]=this.n44;return b},setTranslation:function(b,c,e){this.set(1,0,0,b,0,1,0,c,0,0,1,e,0,0,0,1);return this},setScale:function(b,c,e){this.set(b,0,0,0,0,c,0,0,0,0,e,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,-b,0,0,b,c,0,0, -0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),f=Math.sin(c),h=1-e,k=b.x,m=b.y,n=b.z,u=h*k,t=h*m;this.set(u*k+e,u*m-f*n,u*n+f*m,0,u*m+f*n,t*m+e,t*n-f*k,0,u*n-f*m,t*n+f*k,h*n*n+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= -new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,f=b.y,h=b.z,k=Math.cos(e),e=Math.sin(e),m=Math.cos(f),f=Math.sin(f),n=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var u= -m*n,t=m*h,w=f*n,o=f*h;this.n11=u+o*e;this.n12=w*e-t;this.n13=k*f;this.n21=k*h;this.n22=k*n;this.n23=-e;this.n31=t*e-w;this.n32=o+u*e;this.n33=k*m;break;case "ZXY":u=m*n;t=m*h;w=f*n;o=f*h;this.n11=u-o*e;this.n12=-k*h;this.n13=w+t*e;this.n21=t+w*e;this.n22=k*n;this.n23=o-u*e;this.n31=-k*f;this.n32=e;this.n33=k*m;break;case "ZYX":u=k*n;t=k*h;w=e*n;o=e*h;this.n11=m*n;this.n12=w*f-t;this.n13=u*f+o;this.n21=m*h;this.n22=o*f+u;this.n23=t*f-w;this.n31=-f;this.n32=e*m;this.n33=k*m;break;case "YZX":u=k*m;t= -k*f;w=e*m;o=e*f;this.n11=m*n;this.n12=o-u*h;this.n13=w*h+t;this.n21=h;this.n22=k*n;this.n23=-e*n;this.n31=-f*n;this.n32=t*h+w;this.n33=u-o*h;break;case "XZY":u=k*m;t=k*f;w=e*m;o=e*f;this.n11=m*n;this.n12=-h;this.n13=f*n;this.n21=u*h+o;this.n22=k*n;this.n23=t*h-w;this.n31=w*h-t;this.n32=e*n;this.n33=o*h+u;break;default:u=k*n,t=k*h,w=e*n,o=e*h,this.n11=m*n,this.n12=-m*h,this.n13=f,this.n21=t+w*f,this.n22=u-o*f,this.n23=-e*m,this.n31=o-u*f,this.n32=w+t*f,this.n33=k*m}return this},setRotationFromQuaternion:function(b){var c= -b.x,e=b.y,f=b.z,h=b.w,k=c+c,m=e+e,n=f+f,b=c*k,u=c*m;c*=n;var t=e*m;e*=n;f*=n;k*=h;m*=h;h*=n;this.n11=1-(t+f);this.n12=u-h;this.n13=c+m;this.n21=u+h;this.n22=1-(b+f);this.n23=e-k;this.n31=c-m;this.n32=e+k;this.n33=1-(b+t);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var f=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2; +0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),f=Math.sin(c),h=1-e,k=b.x,m=b.y,n=b.z,p=h*k,t=h*m;this.set(p*k+e,p*m-f*n,p*n+f*m,0,p*m+f*n,t*m+e,t*n-f*k,0,p*n-f*m,t*n+f*k,h*n*n+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= +new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,f=b.y,h=b.z,k=Math.cos(e),e=Math.sin(e),m=Math.cos(f),f=Math.sin(f),n=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var p= +m*n,t=m*h,w=f*n,u=f*h;this.n11=p+u*e;this.n12=w*e-t;this.n13=k*f;this.n21=k*h;this.n22=k*n;this.n23=-e;this.n31=t*e-w;this.n32=u+p*e;this.n33=k*m;break;case "ZXY":p=m*n;t=m*h;w=f*n;u=f*h;this.n11=p-u*e;this.n12=-k*h;this.n13=w+t*e;this.n21=t+w*e;this.n22=k*n;this.n23=u-p*e;this.n31=-k*f;this.n32=e;this.n33=k*m;break;case "ZYX":p=k*n;t=k*h;w=e*n;u=e*h;this.n11=m*n;this.n12=w*f-t;this.n13=p*f+u;this.n21=m*h;this.n22=u*f+p;this.n23=t*f-w;this.n31=-f;this.n32=e*m;this.n33=k*m;break;case "YZX":p=k*m;t= +k*f;w=e*m;u=e*f;this.n11=m*n;this.n12=u-p*h;this.n13=w*h+t;this.n21=h;this.n22=k*n;this.n23=-e*n;this.n31=-f*n;this.n32=t*h+w;this.n33=p-u*h;break;case "XZY":p=k*m;t=k*f;w=e*m;u=e*f;this.n11=m*n;this.n12=-h;this.n13=f*n;this.n21=p*h+u;this.n22=k*n;this.n23=t*h-w;this.n31=w*h-t;this.n32=e*n;this.n33=u*h+p;break;default:p=k*n,t=k*h,w=e*n,u=e*h,this.n11=m*n,this.n12=-m*h,this.n13=f,this.n21=t+w*f,this.n22=p-u*f,this.n23=-e*m,this.n31=u-p*f,this.n32=w+t*f,this.n33=k*m}return this},setRotationFromQuaternion:function(b){var c= +b.x,e=b.y,f=b.z,h=b.w,k=c+c,m=e+e,n=f+f,b=c*k,p=c*m;c*=n;var t=e*m;e*=n;f*=n;k*=h;m*=h;h*=n;this.n11=1-(t+f);this.n12=p-h;this.n13=c+m;this.n21=p+h;this.n22=1-(b+f);this.n23=e-k;this.n31=c-m;this.n32=e+k;this.n33=1-(b+t);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var f=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2; f.identity();f.setRotationFromQuaternion(c);h.setScale(e.x,e.y,e.z);this.multiply(f,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,k=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);k.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;e=e instanceof THREE.Vector3?e:new THREE.Vector3;e.x=f.length(); e.y=h.length();e.z=k.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=e.x;f.n21/=e.x;f.n31/=e.x;f.n12/=e.y;f.n22/=e.y;f.n32/=e.y;f.n13/=e.z;f.n23/=e.z;f.n33/=e.z;c.setFromRotationMatrix(f);return[b,c,e]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var e=1/c.x,f=1/c.y,h=1/c.z;this.n11=b.n11*e;this.n21=b.n21*e;this.n31=b.n31*e;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*h;this.n23= b.n23*h;this.n33=b.n33*h}}; -THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,u=b.n23,t=b.n24,w=b.n31,o=b.n32,x=b.n33,v=b.n34,A=b.n41,z=b.n42,y=b.n43,E=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=u*v*z-t*x*z+t*o*y-n*v*y-u*o*E+n*x*E;c.n12=k*x*z-h*v*z-k*o*y+f*v*y+h*o*E-f*x*E;c.n13=h*t*z-k*u*z+k*n*y-f*t*y-h*n*E+f*u*E;c.n14=k*u*o-h*t*o-k*n*x+f*t*x+h*n*v-f*u*v;c.n21=t*x*A-u*v*A-t*w*y+m*v*y+u*w*E-m*x*E;c.n22=h*v*A-k*x*A+k*w*y-e*v*y-h*w*E+e*x*E;c.n23=k*u*A-h*t*A-k*m*y+e*t*y+h*m*E-e*u*E;c.n24= -h*t*w-k*u*w+k*m*x-e*t*x-h*m*v+e*u*v;c.n31=n*v*A-t*o*A+t*w*z-m*v*z-n*w*E+m*o*E;c.n32=k*o*A-f*v*A-k*w*z+e*v*z+f*w*E-e*o*E;c.n33=h*t*A-k*n*A+k*m*z-e*t*z-f*m*E+e*n*E;c.n34=k*n*w-f*t*w-k*m*o+e*t*o+f*m*v-e*n*v;c.n41=u*o*A-n*x*A-u*w*z+m*x*z+n*w*y-m*o*y;c.n42=f*x*A-h*o*A+h*w*z-e*x*z-f*w*y+e*o*y;c.n43=h*n*A-f*u*A-h*m*z+e*u*z+f*m*y-e*n*y;c.n44=f*u*w-h*n*w+h*m*o-e*u*o-f*m*x+e*n*x;c.multiplyScalar(1/b.determinant());return c}; -THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,f=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,k=b.n32*b.n21-b.n31*b.n22,m=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,u=-b.n32*b.n11+b.n31*b.n12,t=b.n23*b.n12-b.n22*b.n13,w=-b.n23*b.n11+b.n21*b.n13,o=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*m+b.n31*t;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*h;e[2]=b*k;e[3]=b*m;e[4]=b*n;e[5]=b*u;e[6]=b*t;e[7]=b*w;e[8]=b*o;return c}; +THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,p=b.n23,t=b.n24,w=b.n31,u=b.n32,x=b.n33,v=b.n34,A=b.n41,z=b.n42,y=b.n43,E=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=p*v*z-t*x*z+t*u*y-n*v*y-p*u*E+n*x*E;c.n12=k*x*z-h*v*z-k*u*y+f*v*y+h*u*E-f*x*E;c.n13=h*t*z-k*p*z+k*n*y-f*t*y-h*n*E+f*p*E;c.n14=k*p*u-h*t*u-k*n*x+f*t*x+h*n*v-f*p*v;c.n21=t*x*A-p*v*A-t*w*y+m*v*y+p*w*E-m*x*E;c.n22=h*v*A-k*x*A+k*w*y-e*v*y-h*w*E+e*x*E;c.n23=k*p*A-h*t*A-k*m*y+e*t*y+h*m*E-e*p*E;c.n24= +h*t*w-k*p*w+k*m*x-e*t*x-h*m*v+e*p*v;c.n31=n*v*A-t*u*A+t*w*z-m*v*z-n*w*E+m*u*E;c.n32=k*u*A-f*v*A-k*w*z+e*v*z+f*w*E-e*u*E;c.n33=h*t*A-k*n*A+k*m*z-e*t*z-f*m*E+e*n*E;c.n34=k*n*w-f*t*w-k*m*u+e*t*u+f*m*v-e*n*v;c.n41=p*u*A-n*x*A-p*w*z+m*x*z+n*w*y-m*u*y;c.n42=f*x*A-h*u*A+h*w*z-e*x*z-f*w*y+e*u*y;c.n43=h*n*A-f*p*A-h*m*z+e*p*z+f*m*y-e*n*y;c.n44=f*p*w-h*n*w+h*m*u-e*p*u-f*m*x+e*n*x;c.multiplyScalar(1/b.determinant());return c}; +THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,f=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,k=b.n32*b.n21-b.n31*b.n22,m=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,p=-b.n32*b.n11+b.n31*b.n12,t=b.n23*b.n12-b.n22*b.n13,w=-b.n23*b.n11+b.n21*b.n13,u=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*m+b.n31*t;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*f;e[1]=b*h;e[2]=b*k;e[3]=b*m;e[4]=b*n;e[5]=b*p;e[6]=b*t;e[7]=b*w;e[8]=b*u;return c}; THREE.Matrix4.makeFrustum=function(b,c,e,f,h,k){var m;m=new THREE.Matrix4;m.n11=2*h/(c-b);m.n12=0;m.n13=(c+b)/(c-b);m.n14=0;m.n21=0;m.n22=2*h/(f-e);m.n23=(f+e)/(f-e);m.n24=0;m.n31=0;m.n32=0;m.n33=-(k+h)/(k-h);m.n34=-2*k*h/(k-h);m.n41=0;m.n42=0;m.n43=-1;m.n44=0;return m};THREE.Matrix4.makePerspective=function(b,c,e,f){var h,b=e*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,e,f)}; -THREE.Matrix4.makeOrtho=function(b,c,e,f,h,k){var m,n,u,t;m=new THREE.Matrix4;n=c-b;u=e-f;t=k-h;m.n11=2/n;m.n12=0;m.n13=0;m.n14=-((c+b)/n);m.n21=0;m.n22=2/u;m.n23=0;m.n24=-((e+f)/u);m.n31=0;m.n32=0;m.n33=-2/t;m.n34=-((k+h)/t);m.n41=0;m.n42=0;m.n43=0;m.n44=1;return m};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; +THREE.Matrix4.makeOrtho=function(b,c,e,f,h,k){var m,n,p,t;m=new THREE.Matrix4;n=c-b;p=e-f;t=k-h;m.n11=2/n;m.n12=0;m.n13=0;m.n14=-((c+b)/n);m.n21=0;m.n22=2/p;m.n23=0;m.n24=-((e+f)/p);m.n31=0;m.n32=0;m.n33=-2/t;m.n34=-((k+h)/t);m.n41=0;m.n42=0;m.n43=0;m.n44=1;return m};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3}; THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(b){if(this.children.indexOf(b)=== @@ -54,41 +54,41 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){thi b)return h;if(c&&(h=h.getChildByName(b,c),h!==void 0))return h}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,e){this.matrixAutoUpdate&& this.updateMatrix();if(this.matrixWorldNeedsUpdate||c)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,c=!0;for(var b=0,f=this.children.length;b=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?e=Math.max(e,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),f=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?e=Math.max(e,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),fG&&m.positionScreen.zG&&m.positionScreen.z0&&K.z<1))ia=C[F]=C[F]||new THREE.RenderableParticle,F++,E=ia,E.x=K.x/K.w,E.y=K.y/K.w,E.z=K.z,E.rotation=U.rotation.z,E.scale.x=U.scale.x*Math.abs(E.x-(K.x+k.projectionMatrix.n11)/(K.w+k.projectionMatrix.n14)),E.scale.y=U.scale.y*Math.abs(E.y-(K.y+k.projectionMatrix.n22)/(K.w+k.projectionMatrix.n24)),E.materials=U.materials,J.push(E);h&&J.sort(c);return J}}; THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,e=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),k=Math.cos(e),e=Math.sin(e),m=b*c,n=f*h;this.w=m*k-n*e;this.x=m*e+n*k;this.y=f*c*k+b*h*e;this.z=b*h*k-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e); this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z); this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c= -this.x,e=this.y,f=this.z,h=this.w,k=b.x,m=b.y,n=b.z,b=b.w;this.x=c*b+h*k+e*n-f*m;this.y=e*b+h*m+f*k-c*n;this.z=f*b+h*n+c*m-e*k;this.w=h*b-c*k-e*m-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,h=b.z,k=this.x,m=this.y,n=this.z,u=this.w,t=u*e+m*h-n*f,w=u*f+n*e-k*h,o=u*h+k*f-m*e,e=-k* -e-m*f-n*h;c.x=t*u+e*-k+w*-n-o*-m;c.y=w*u+e*-m+o*-k-t*-n;c.z=o*u+e*-n+t*-m-w*-k;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var k=Math.acos(h),m=Math.sqrt(1-h*h);if(Math.abs(m)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-f)*k)/m;f=Math.sin(f*k)/m;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e}; +this.x,e=this.y,f=this.z,h=this.w,k=b.x,m=b.y,n=b.z,b=b.w;this.x=c*b+h*k+e*n-f*m;this.y=e*b+h*m+f*k-c*n;this.z=f*b+h*n+c*m-e*k;this.w=h*b-c*k-e*m-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,h=b.z,k=this.x,m=this.y,n=this.z,p=this.w,t=p*e+m*h-n*f,w=p*f+n*e-k*h,u=p*h+k*f-m*e,e=-k* +e-m*f-n*h;c.x=t*p+e*-k+w*-n-u*-m;c.y=w*p+e*-m+u*-k-t*-n;c.z=u*p+e*-n+t*-m-w*-k;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var k=Math.acos(h),m=Math.sqrt(1-h*h);if(Math.abs(m)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-f)*k)/m;f=Math.sin(f*k)/m;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e}; THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,h,k){this.a=b;this.b=c;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=k instanceof Array?k:[k];this.centroid=new THREE.Vector3}; THREE.Face4=function(b,c,e,f,h,k,m){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=k instanceof THREE.Color?k:new THREE.Color;this.vertexColors=k instanceof Array?k:[];this.vertexTangents=[];this.materials=m instanceof Array?m:[m];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var e=0,f=this.vertices.length;e0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;cthis.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;t=this.points[e[0]];w=this.points[e[1]]; -o=this.points[e[2]];x=this.points[e[3]];n=m*m;u=m*n;f.x=c(t.x,w.x,o.x,x.x,m,n,u);f.y=c(t.y,w.y,o.y,x.y,m,n,u);f.z=c(t.z,w.z,o.z,x.z,m,n,u);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;bthis.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;t=this.points[e[0]];w=this.points[e[1]]; +u=this.points[e[2]];x=this.points[e[3]];n=m*m;p=m*n;f.x=c(t.x,w.x,u.x,x.x,m,n,p);f.y=c(t.y,w.y,u.y,x.y,m,n,p);f.z=c(t.z,w.z,u.z,x.z,m,n,p);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;b0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(A.r*255)+","+Math.floor(A.g*255)+","+ -Math.floor(A.b*255)+","+z+")"),v.fillRect(Math.floor(S.getX()),Math.floor(S.getY()),Math.floor(S.getWidth()),Math.floor(S.getHeight()))),S.empty())};this.render=function(b,u){function t(b){var c,e,f,k=b.lights;N.setRGB(0,0,0);ma.setRGB(0,0,0);ua.setRGB(0,0,0);b=0;for(c=k.length;b>1,xa=t.height>>1,m=k.scale.x*o,u=k.scale.y*x,p=m*w,n=u*xa,O.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(O)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-u),v.translate(-w,-xa),v.drawImage(t,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(p=k.scale.x*o,n=k.scale.y*x,O.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(O)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(p,n),m.program(v), -v.restore()))}function eb(b,k,h,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(k.positionScreen.x,k.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(J!=b)v.lineCap=J=b;b=m.linejoin;if(M!=b)v.lineJoin=M=b;f(m.color.getContextStyle());v.stroke();O.inflate(m.linewidth*2)}}function y(b,f,h,m,n,t,o,v,xa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); -Q=b.positionScreen.x;Z=b.positionScreen.y;$=f.positionScreen.x;P=f.positionScreen.y;p=h.positionScreen.x;V=h.positionScreen.y;F(Q,Z,$,P,p,V);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,P,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=u.matrixWorldInverse,oa.copy(o.vertexNormalsWorld[0]),sa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,ya= --(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[1]),Ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Ga=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[2]),Fa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Da=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,ab(Q,Z,$,P,p,V,sa,ya,Ca,Ga,Fa,Da,v.envMap)}else v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&& -(v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,P,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map)),e(THREE.SubtractiveBlending)),da?!v.wireframe&&v.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==3?(W.r=U.r=ia.r=N.r,W.g=U.g=ia.g=N.g,W.b=U.b=ia.b=N.b,w(xa,o.v1.positionWorld,o.vertexNormalsWorld[0],W),w(xa,o.v2.positionWorld,o.vertexNormalsWorld[1],U),w(xa,o.v3.positionWorld,o.vertexNormalsWorld[2],ia),W.r=Math.max(0,Math.min(v.color.r*W.r,1)),W.g=Math.max(0,Math.min(v.color.g* -W.g,1)),W.b=Math.max(0,Math.min(v.color.b*W.b,1)),U.r=Math.max(0,Math.min(v.color.r*U.r,1)),U.g=Math.max(0,Math.min(v.color.g*U.g,1)),U.b=Math.max(0,Math.min(v.color.b*U.b,1)),ia.r=Math.max(0,Math.min(v.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(v.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(v.color.b*ia.b,1)),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,p,V,0,0,1,0,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,o.centroidWorld,o.normalWorld,qa),aa.r=Math.max(0,Math.min(v.color.r* -qa.r,1)),aa.g=Math.max(0,Math.min(v.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(v.color.b*qa.b,1)),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)):v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshDepthMaterial)la=u.near,ca=u.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(h.positionScreen.z,la,ca),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ -ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,p,V,0,0,1,0,0,1,pa);else if(v instanceof THREE.MeshNormalMaterial)aa.r=Va(o.normalWorld.x),aa.g=Va(o.normalWorld.y),aa.b=Va(o.normalWorld.z),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)}function A(b,f,h,m,n,t,v,o,xa){k.info.render.vertices+=4;k.info.render.faces++;c(o.opacity);e(o.blending);if(o.map||o.envMap)y(b,f,m,0,1,3,v,o,xa),y(n,h,t,1,2,3,v,o,xa);else if(Q=b.positionScreen.x,Z=b.positionScreen.y, -$=f.positionScreen.x,P=f.positionScreen.y,p=h.positionScreen.x,V=h.positionScreen.y,fa=m.positionScreen.x,ea=m.positionScreen.y,ha=n.positionScreen.x,ga=n.positionScreen.y,ka=t.positionScreen.x,na=t.positionScreen.y,o instanceof THREE.MeshBasicMaterial)E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(o.color);else if(o instanceof THREE.MeshLambertMaterial)da?!o.wireframe&&o.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4?(W.r= -U.r=ia.r=ja.r=N.r,W.g=U.g=ia.g=ja.g=N.g,W.b=U.b=ia.b=ja.b=N.b,w(xa,v.v1.positionWorld,v.vertexNormalsWorld[0],W),w(xa,v.v2.positionWorld,v.vertexNormalsWorld[1],U),w(xa,v.v4.positionWorld,v.vertexNormalsWorld[3],ia),w(xa,v.v3.positionWorld,v.vertexNormalsWorld[2],ja),W.r=Math.max(0,Math.min(o.color.r*W.r,1)),W.g=Math.max(0,Math.min(o.color.g*W.g,1)),W.b=Math.max(0,Math.min(o.color.b*W.b,1)),U.r=Math.max(0,Math.min(o.color.r*U.r,1)),U.g=Math.max(0,Math.min(o.color.g*U.g,1)),U.b=Math.max(0,Math.min(o.color.b* -U.b,1)),ia.r=Math.max(0,Math.min(o.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(o.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(o.color.b*ia.b,1)),ja.r=Math.max(0,Math.min(o.color.r*ja.r,1)),ja.g=Math.max(0,Math.min(o.color.g*ja.g,1)),ja.b=Math.max(0,Math.min(o.color.b*ja.b,1)),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,v.centroidWorld,v.normalWorld,qa),aa.r=Math.max(0,Math.min(o.color.r*qa.r, -1)),aa.g=Math.max(0,Math.min(o.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(o.color.b*qa.b,1)),E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(aa,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(aa)):(E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(o.color));else if(o instanceof THREE.MeshNormalMaterial)aa.r=Va(v.normalWorld.x),aa.g=Va(v.normalWorld.y),aa.b=Va(v.normalWorld.z),E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(aa,o.wireframeLinewidth,o.wireframeLinecap, -o.wireframeLinejoin):C(aa);else if(o instanceof THREE.MeshDepthMaterial)la=u.near,ca=u.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,la,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,la,ca),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)}function F(b,c,e,f,k,h){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(b,c);v.closePath()}function E(b, -c,e,f,k,h,m,p){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(m,p);v.lineTo(b,c);v.closePath()}function Na(b,c,e,k){if(G!=c)v.lineWidth=G=c;if(J!=e)v.lineCap=J=e;if(M!=k)v.lineJoin=M=k;f(b.getContextStyle());v.stroke();O.inflate(c*2)}function C(b){h(b.getContextStyle());v.fill()}function ab(b,c,e,f,k,m,p,n,u,o,t,xa,w){if(w.image.width!=0){if(w.needsUpdate==!0||ta[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,S=w.wrapT==THREE.RepeatWrapping;ta[w.id]=v.createPattern(w.image,x&& -S?"repeat":x&&!S?"repeat-x":!x&&S?"repeat-y":"no-repeat");w.needsUpdate=!1}h(ta[w.id]);var x=w.offset.x/w.repeat.x,S=w.offset.y/w.repeat.y,z=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,p=(p+x)*z,n=(n+S)*w,u=(u+x)*z,o=(o+S)*w,t=(t+x)*z,xa=(xa+S)*w;e-=b;f-=c;k-=b;m-=c;u-=p;o-=n;t-=p;xa-=n;x=1/(u*xa-t*o);w=(xa*e-o*k)*x;o=(xa*f-o*m)*x;e=(u*k-t*e)*x;f=(u*m-t*f)*x;b=b-w*p-e*n;c=c-o*p-f*n;v.save();v.transform(w,o,e,f,b,c);v.fill();v.restore()}}function Ua(b,c,e,f,k,h,m,p,n,u,o,t,w){var xa, -x;xa=w.width-1;x=w.height-1;m*=xa;p*=x;n*=xa;u*=x;o*=xa;t*=x;e-=b;f-=c;k-=b;h-=c;n-=m;u-=p;o-=m;t-=p;x=1/(n*t-o*u);xa=(t*e-u*k)*x;u=(t*f-u*h)*x;e=(n*k-o*e)*x;f=(n*h-o*f)*x;b=b-xa*m-e*p;c=c-u*m-f*p;v.save();v.transform(xa,u,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var k=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),p=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),u=~~(e.g*255),e=~~(e.b*255),o=~~(f.r*255),t=~~(f.g*255),f=~~(f.b*255);va[0]=k<0?0:k>255?255:k;va[1]=h<0?0: -h>255?255:h;va[2]=b<0?0:b>255?255:b;va[4]=m<0?0:m>255?255:m;va[5]=p<0?0:p>255?255:p;va[6]=c<0?0:c>255?255:c;va[8]=n<0?0:n>255?255:n;va[9]=u<0?0:u>255?255:u;va[10]=e<0?0:e>255?255:e;va[12]=o<0?0:o>255?255:o;va[13]=t<0?0:t>255?255:t;va[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,k=e*e+f*f;k!=0&&(k=1/Math.sqrt(k),e*=k,f*=k,c.x+= -e,c.y+=f,b.x-=e,b.y-=f)}var Za,bb,wa,Ja,Pa,Wa,$a,Aa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,o,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,u,this.sortElements);(da=b.lights.length>0)&&t(b);Za=0;for(bb=m.length;Za0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(A.r*255)+","+Math.floor(A.g*255)+","+ +Math.floor(A.b*255)+","+z+")"),v.fillRect(Math.floor(S.getX()),Math.floor(S.getY()),Math.floor(S.getWidth()),Math.floor(S.getHeight()))),S.empty())};this.render=function(b,p){function t(b){var c,e,f,k=b.lights;N.setRGB(0,0,0);ma.setRGB(0,0,0);ua.setRGB(0,0,0);b=0;for(c=k.length;b>1,xa=t.height>>1,m=k.scale.x*u,p=k.scale.y*x,o=m*w,n=p*xa,O.set(b.x-o,b.y-n,b.x+o,b.y+n),za.intersects(O)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-p),v.translate(-w,-xa),v.drawImage(t,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(o=k.scale.x*u,n=k.scale.y*x,O.set(b.x-o,b.y-n,b.x+o,b.y+n),za.intersects(O)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(o,n),m.program(v), +v.restore()))}function eb(b,k,h,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(k.positionScreen.x,k.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(J!=b)v.lineCap=J=b;b=m.linejoin;if(M!=b)v.lineJoin=M=b;f(m.color.getContextStyle());v.stroke();O.inflate(m.linewidth*2)}}function y(b,f,h,m,n,t,u,v,xa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); +Q=b.positionScreen.x;Z=b.positionScreen.y;$=f.positionScreen.x;P=f.positionScreen.y;o=h.positionScreen.x;V=h.positionScreen.y;F(Q,Z,$,P,o,V);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=u.uvs[0],ab(Q,Z,$,P,o,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=p.matrixWorldInverse,oa.copy(u.vertexNormalsWorld[0]),sa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,ya= +-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(u.vertexNormalsWorld[1]),Ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Ga=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(u.vertexNormalsWorld[2]),Fa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Da=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,ab(Q,Z,$,P,o,V,sa,ya,Ca,Ga,Fa,Da,v.envMap)}else v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&& +(v.map.mapping instanceof THREE.UVMapping&&(ra=u.uvs[0],ab(Q,Z,$,P,o,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map)),e(THREE.SubtractiveBlending)),da?!v.wireframe&&v.shading==THREE.SmoothShading&&u.vertexNormalsWorld.length==3?(W.r=U.r=ia.r=N.r,W.g=U.g=ia.g=N.g,W.b=U.b=ia.b=N.b,w(xa,u.v1.positionWorld,u.vertexNormalsWorld[0],W),w(xa,u.v2.positionWorld,u.vertexNormalsWorld[1],U),w(xa,u.v3.positionWorld,u.vertexNormalsWorld[2],ia),W.r=Math.max(0,Math.min(v.color.r*W.r,1)),W.g=Math.max(0,Math.min(v.color.g* +W.g,1)),W.b=Math.max(0,Math.min(v.color.b*W.b,1)),U.r=Math.max(0,Math.min(v.color.r*U.r,1)),U.g=Math.max(0,Math.min(v.color.g*U.g,1)),U.b=Math.max(0,Math.min(v.color.b*U.b,1)),ia.r=Math.max(0,Math.min(v.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(v.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(v.color.b*ia.b,1)),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,o,V,0,0,1,0,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,u.centroidWorld,u.normalWorld,qa),aa.r=Math.max(0,Math.min(v.color.r* +qa.r,1)),aa.g=Math.max(0,Math.min(v.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(v.color.b*qa.b,1)),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)):v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshDepthMaterial)la=p.near,ca=p.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(h.positionScreen.z,la,ca),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ +ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,o,V,0,0,1,0,0,1,pa);else if(v instanceof THREE.MeshNormalMaterial)aa.r=Va(u.normalWorld.x),aa.g=Va(u.normalWorld.y),aa.b=Va(u.normalWorld.z),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)}function A(b,f,h,m,n,t,v,u,xa){k.info.render.vertices+=4;k.info.render.faces++;c(u.opacity);e(u.blending);if(u.map||u.envMap)y(b,f,m,0,1,3,v,u,xa),y(n,h,t,1,2,3,v,u,xa);else if(Q=b.positionScreen.x,Z=b.positionScreen.y, +$=f.positionScreen.x,P=f.positionScreen.y,o=h.positionScreen.x,V=h.positionScreen.y,fa=m.positionScreen.x,ea=m.positionScreen.y,ha=n.positionScreen.x,ga=n.positionScreen.y,ka=t.positionScreen.x,na=t.positionScreen.y,u instanceof THREE.MeshBasicMaterial)E(Q,Z,$,P,o,V,fa,ea),u.wireframe?Na(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(u.color);else if(u instanceof THREE.MeshLambertMaterial)da?!u.wireframe&&u.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4?(W.r= +U.r=ia.r=ja.r=N.r,W.g=U.g=ia.g=ja.g=N.g,W.b=U.b=ia.b=ja.b=N.b,w(xa,v.v1.positionWorld,v.vertexNormalsWorld[0],W),w(xa,v.v2.positionWorld,v.vertexNormalsWorld[1],U),w(xa,v.v4.positionWorld,v.vertexNormalsWorld[3],ia),w(xa,v.v3.positionWorld,v.vertexNormalsWorld[2],ja),W.r=Math.max(0,Math.min(u.color.r*W.r,1)),W.g=Math.max(0,Math.min(u.color.g*W.g,1)),W.b=Math.max(0,Math.min(u.color.b*W.b,1)),U.r=Math.max(0,Math.min(u.color.r*U.r,1)),U.g=Math.max(0,Math.min(u.color.g*U.g,1)),U.b=Math.max(0,Math.min(u.color.b* +U.b,1)),ia.r=Math.max(0,Math.min(u.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(u.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(u.color.b*ia.b,1)),ja.r=Math.max(0,Math.min(u.color.r*ja.r,1)),ja.g=Math.max(0,Math.min(u.color.g*ja.g,1)),ja.b=Math.max(0,Math.min(u.color.b*ja.b,1)),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,o,V,ka,na),Ua(ha,ga,o,V,ka,na,1,0,1,1,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,v.centroidWorld,v.normalWorld,qa),aa.r=Math.max(0,Math.min(u.color.r*qa.r, +1)),aa.g=Math.max(0,Math.min(u.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(u.color.b*qa.b,1)),E(Q,Z,$,P,o,V,fa,ea),u.wireframe?Na(aa,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(aa)):(E(Q,Z,$,P,o,V,fa,ea),u.wireframe?Na(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(u.color));else if(u instanceof THREE.MeshNormalMaterial)aa.r=Va(v.normalWorld.x),aa.g=Va(v.normalWorld.y),aa.b=Va(v.normalWorld.z),E(Q,Z,$,P,o,V,fa,ea),u.wireframe?Na(aa,u.wireframeLinewidth,u.wireframeLinecap, +u.wireframeLinejoin):C(aa);else if(u instanceof THREE.MeshDepthMaterial)la=p.near,ca=p.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,la,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,la,ca),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,o,V,ka,na),Ua(ha,ga,o,V,ka,na,1,0,1,1,0,1,pa)}function F(b,c,e,f,k,h){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(b,c);v.closePath()}function E(b, +c,e,f,k,h,m,o){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(m,o);v.lineTo(b,c);v.closePath()}function Na(b,c,e,k){if(G!=c)v.lineWidth=G=c;if(J!=e)v.lineCap=J=e;if(M!=k)v.lineJoin=M=k;f(b.getContextStyle());v.stroke();O.inflate(c*2)}function C(b){h(b.getContextStyle());v.fill()}function ab(b,c,e,f,k,m,o,n,p,u,t,xa,w){if(w.image.width!=0){if(w.needsUpdate==!0||ta[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,S=w.wrapT==THREE.RepeatWrapping;ta[w.id]=v.createPattern(w.image,x&& +S?"repeat":x&&!S?"repeat-x":!x&&S?"repeat-y":"no-repeat");w.needsUpdate=!1}h(ta[w.id]);var x=w.offset.x/w.repeat.x,S=w.offset.y/w.repeat.y,z=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,o=(o+x)*z,n=(n+S)*w,p=(p+x)*z,u=(u+S)*w,t=(t+x)*z,xa=(xa+S)*w;e-=b;f-=c;k-=b;m-=c;p-=o;u-=n;t-=o;xa-=n;x=1/(p*xa-t*u);w=(xa*e-u*k)*x;u=(xa*f-u*m)*x;e=(p*k-t*e)*x;f=(p*m-t*f)*x;b=b-w*o-e*n;c=c-u*o-f*n;v.save();v.transform(w,u,e,f,b,c);v.fill();v.restore()}}function Ua(b,c,e,f,k,h,m,o,n,p,u,t,w){var xa, +x;xa=w.width-1;x=w.height-1;m*=xa;o*=x;n*=xa;p*=x;u*=xa;t*=x;e-=b;f-=c;k-=b;h-=c;n-=m;p-=o;u-=m;t-=o;x=1/(n*t-u*p);xa=(t*e-p*k)*x;p=(t*f-p*h)*x;e=(n*k-u*e)*x;f=(n*h-u*f)*x;b=b-xa*m-e*o;c=c-p*m-f*o;v.save();v.transform(xa,p,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var k=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),o=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),p=~~(e.g*255),e=~~(e.b*255),u=~~(f.r*255),t=~~(f.g*255),f=~~(f.b*255);va[0]=k<0?0:k>255?255:k;va[1]=h<0?0: +h>255?255:h;va[2]=b<0?0:b>255?255:b;va[4]=m<0?0:m>255?255:m;va[5]=o<0?0:o>255?255:o;va[6]=c<0?0:c>255?255:c;va[8]=n<0?0:n>255?255:n;va[9]=p<0?0:p>255?255:p;va[10]=e<0?0:e>255?255:e;va[12]=u<0?0:u>255?255:u;va[13]=t<0?0:t>255?255:t;va[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,k=e*e+f*f;k!=0&&(k=1/Math.sqrt(k),e*=k,f*=k,c.x+= +e,c.y+=f,b.x-=e,b.y-=f)}var Za,bb,wa,Ja,Pa,Wa,$a,Aa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,u,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,p,this.sortElements);(da=b.lights.length>0)&&t(b);Za=0;for(bb=m.length;Za0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m)):h instanceof THREE.PointLight&&(Y.sub(h.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*h.intensity,m>0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m))}function c(c,e,m,n,o,t){k.info.render.vertices+=3;k.info.render.faces++;Q=f(Z++); -Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");o instanceof THREE.MeshBasicMaterial?G.copy(o.color):o instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(t,n,J),G.r=Math.max(0,Math.min(o.color.r*J.r,1)),G.g=Math.max(0,Math.min(o.color.g*J.g,1)),G.b=Math.max(0,Math.min(o.color.b*J.b,1))):G.copy(o.color):o instanceof THREE.MeshDepthMaterial?(L=1-o.__2near/(o.__farPlusNear- -n.z*o.__farMinusNear),G.setRGB(L,L,L)):o instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));o.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+o.wireframeLinewidth+"; stroke-opacity: "+o.opacity+"; stroke-linecap: "+o.wireframeLinecap+"; stroke-linejoin: "+o.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+o.opacity);u.appendChild(Q)}function e(c,e,m,n,o,t,v){k.info.render.vertices+= -4;k.info.render.faces++;Q=f(Z++);Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?G.copy(t.color):t instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(v,o,J),G.r=Math.max(0,Math.min(t.color.r*J.r,1)),G.g=Math.max(0,Math.min(t.color.g*J.g,1)),G.b=Math.max(0,Math.min(t.color.b*J.b,1))): -G.copy(t.color):t instanceof THREE.MeshDepthMaterial?(L=1-t.__2near/(t.__farPlusNear-o.z*t.__farMinusNear),G.setRGB(L,L,L)):t instanceof THREE.MeshNormalMaterial&&G.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));t.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+ -"; fill-opacity: "+t.opacity);u.appendChild(Q)}function f(b){H[b]==null&&(H[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),P==0&&H[b].setAttribute("shape-rendering","crispEdges"));return H[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,u=document.createElementNS("http://www.w3.org/2000/svg","svg"),t,w,o,x,v,A,z,y,E=new THREE.Rectangle,F=new THREE.Rectangle,C=!1,G=new THREE.Color(16777215),J=new THREE.Color(16777215),M=new THREE.Color(0), -K=new THREE.Color(0),B=new THREE.Color(0),L,Y=new THREE.Vector3,H=[],T=[],Q,Z,$,P=1;this.domElement=u;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":P=1;break;case "low":P=0}};this.setSize=function(b,c){t=b;w=c;o=t/2;x=w/2;u.setAttribute("viewBox",-o+" "+-x+" "+t+" "+w);u.setAttribute("width",t);u.setAttribute("height",w);E.set(-o,-x,o,x)};this.clear=function(){for(;u.childNodes.length>0;)u.removeChild(u.childNodes[0])}; +THREE.SVGRenderer=function(){function b(b,c,e){var f,k,h,m;f=0;for(k=b.lights.length;f0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m)):h instanceof THREE.PointLight&&(Y.sub(h.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*h.intensity,m>0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m))}function c(c,e,m,n,u,t){k.info.render.vertices+=3;k.info.render.faces++;Q=f(Z++); +Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");u instanceof THREE.MeshBasicMaterial?G.copy(u.color):u instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(t,n,J),G.r=Math.max(0,Math.min(u.color.r*J.r,1)),G.g=Math.max(0,Math.min(u.color.g*J.g,1)),G.b=Math.max(0,Math.min(u.color.b*J.b,1))):G.copy(u.color):u instanceof THREE.MeshDepthMaterial?(L=1-u.__2near/(u.__farPlusNear- +n.z*u.__farMinusNear),G.setRGB(L,L,L)):u instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));u.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+u.wireframeLinewidth+"; stroke-opacity: "+u.opacity+"; stroke-linecap: "+u.wireframeLinecap+"; stroke-linejoin: "+u.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+u.opacity);p.appendChild(Q)}function e(c,e,m,n,u,t,v){k.info.render.vertices+= +4;k.info.render.faces++;Q=f(Z++);Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?G.copy(t.color):t instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(v,u,J),G.r=Math.max(0,Math.min(t.color.r*J.r,1)),G.g=Math.max(0,Math.min(t.color.g*J.g,1)),G.b=Math.max(0,Math.min(t.color.b*J.b,1))): +G.copy(t.color):t instanceof THREE.MeshDepthMaterial?(L=1-t.__2near/(t.__farPlusNear-u.z*t.__farMinusNear),G.setRGB(L,L,L)):t instanceof THREE.MeshNormalMaterial&&G.setRGB(h(u.normalWorld.x),h(u.normalWorld.y),h(u.normalWorld.z));t.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+ +"; fill-opacity: "+t.opacity);p.appendChild(Q)}function f(b){H[b]==null&&(H[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),P==0&&H[b].setAttribute("shape-rendering","crispEdges"));return H[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,p=document.createElementNS("http://www.w3.org/2000/svg","svg"),t,w,u,x,v,A,z,y,E=new THREE.Rectangle,F=new THREE.Rectangle,C=!1,G=new THREE.Color(16777215),J=new THREE.Color(16777215),M=new THREE.Color(0), +K=new THREE.Color(0),B=new THREE.Color(0),L,Y=new THREE.Vector3,H=[],T=[],Q,Z,$,P=1;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":P=1;break;case "low":P=0}};this.setSize=function(b,c){t=b;w=c;u=t/2;x=w/2;p.setAttribute("viewBox",-u+" "+-x+" "+t+" "+w);p.setAttribute("width",t);p.setAttribute("height",w);E.set(-u,-x,u,x)};this.clear=function(){for(;p.childNodes.length>0;)p.removeChild(p.childNodes[0])}; this.render=function(b,f){var h,t,w,G,H,L,J,W;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);$=Z=0;if(C=b.lights.length>0){J=b.lights;M.setRGB(0,0,0);K.setRGB(0,0,0);B.setRGB(0,0,0);h=0;for(t=J.length;h=0)c&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(b.position,3,p.FLOAT,!1,0,0));else if(m.morphTargetBase){f=h.program.attributes;m.morphTargetBase!== --1?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[m.morphTargetBase]),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0)):f.position>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var o=0,t=m.morphTargetForcedOrder,u=m.morphTargetInfluences;ov&&(w=x,v=u[w]);p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[w]);p.vertexAttribPointer(f["morphTarget"+o],3,p.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[o]=v;t[w]=1;v=-1;o++}}h.program.uniforms.morphTargetInfluences!==null&&p.uniform1fv(h.program.uniforms.morphTargetInfluences, -m.__webglMorphTargetInfluences)}if(c){if(k.__webglCustomAttributes)for(n in k.__webglCustomAttributes)b[n]>=0&&(f=k.__webglCustomAttributes[n],p.bindBuffer(p.ARRAY_BUFFER,f.buffer),p.vertexAttribPointer(b[n],f.size,p.FLOAT,!1,0,0));b.color>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglColorBuffer),p.vertexAttribPointer(b.color,3,p.FLOAT,!1,0,0));b.normal>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglNormalBuffer),p.vertexAttribPointer(b.normal,3,p.FLOAT,!1,0,0));b.tangent>=0&&(p.bindBuffer(p.ARRAY_BUFFER, -k.__webglTangentBuffer),p.vertexAttribPointer(b.tangent,4,p.FLOAT,!1,0,0));b.uv>=0&&(k.__webglUVBuffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUVBuffer),p.vertexAttribPointer(b.uv,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv)):p.disableVertexAttribArray(b.uv));b.uv2>=0&&(k.__webglUV2Buffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUV2Buffer),p.vertexAttribPointer(b.uv2,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv2)):p.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>= -0&&b.skinIndex>=0&&b.skinWeight>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexABuffer),p.vertexAttribPointer(b.skinVertexA,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexBBuffer),p.vertexAttribPointer(b.skinVertexB,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinIndicesBuffer),p.vertexAttribPointer(b.skinIndex,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinWeightsBuffer),p.vertexAttribPointer(b.skinWeight,4,p.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(h.wireframe? -(p.lineWidth(h.wireframeLinewidth),c&&p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,k.__webglLineBuffer),p.drawElements(p.LINES,k.__webglLineCount,p.UNSIGNED_SHORT,0)):(c&&p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,k.__webglFaceBuffer),p.drawElements(p.TRIANGLES,k.__webglFaceCount,p.UNSIGNED_SHORT,0)),P.info.render.calls++,P.info.render.vertices+=k.__webglFaceCount,P.info.render.faces+=k.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?p.LINE_STRIP:p.LINES,p.lineWidth(h.linewidth),p.drawArrays(m, -0,k.__webglLineCount),P.info.render.calls++):m instanceof THREE.ParticleSystem?(p.drawArrays(p.POINTS,0,k.__webglParticleCount),P.info.render.calls++):m instanceof THREE.Ribbon&&(p.drawArrays(p.TRIANGLE_STRIP,0,k.__webglVertexCount),P.info.render.calls++)}}function h(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=p.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=p.createBuffer();b.hasPos&&(p.bindBuffer(p.ARRAY_BUFFER,b.__webglVertexBuffer),p.bufferData(p.ARRAY_BUFFER,b.positionArray, -p.DYNAMIC_DRAW),p.enableVertexAttribArray(c.attributes.position),p.vertexAttribPointer(c.attributes.position,3,p.FLOAT,!1,0,0));if(b.hasNormal){p.bindBuffer(p.ARRAY_BUFFER,b.__webglNormalBuffer);if(e==THREE.FlatShading){var f,k,h,m,n,o,t,u,v,w,x=b.count*3;for(w=0;w=0)c&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer),o.vertexAttribPointer(b.position,3,o.FLOAT,!1,0,0));else if(m.morphTargetBase){f=h.program.attributes;m.morphTargetBase!== +-1?(o.bindBuffer(o.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[m.morphTargetBase]),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0)):f.position>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var p=0,t=m.morphTargetForcedOrder,u=m.morphTargetInfluences;pv&&(w=x,v=u[w]);o.bindBuffer(o.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[w]);o.vertexAttribPointer(f["morphTarget"+p],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[p]=v;t[w]=1;v=-1;p++}}h.program.uniforms.morphTargetInfluences!==null&&o.uniform1fv(h.program.uniforms.morphTargetInfluences, +m.__webglMorphTargetInfluences)}if(c){if(k.__webglCustomAttributes)for(n in k.__webglCustomAttributes)b[n]>=0&&(f=k.__webglCustomAttributes[n],o.bindBuffer(o.ARRAY_BUFFER,f.buffer),o.vertexAttribPointer(b[n],f.size,o.FLOAT,!1,0,0));b.color>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer),o.vertexAttribPointer(b.color,3,o.FLOAT,!1,0,0));b.normal>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglNormalBuffer),o.vertexAttribPointer(b.normal,3,o.FLOAT,!1,0,0));b.tangent>=0&&(o.bindBuffer(o.ARRAY_BUFFER, +k.__webglTangentBuffer),o.vertexAttribPointer(b.tangent,4,o.FLOAT,!1,0,0));b.uv>=0&&(k.__webglUVBuffer?(o.bindBuffer(o.ARRAY_BUFFER,k.__webglUVBuffer),o.vertexAttribPointer(b.uv,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv)):o.disableVertexAttribArray(b.uv));b.uv2>=0&&(k.__webglUV2Buffer?(o.bindBuffer(o.ARRAY_BUFFER,k.__webglUV2Buffer),o.vertexAttribPointer(b.uv2,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv2)):o.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>= +0&&b.skinIndex>=0&&b.skinWeight>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinVertexABuffer),o.vertexAttribPointer(b.skinVertexA,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinVertexBBuffer),o.vertexAttribPointer(b.skinVertexB,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinIndicesBuffer),o.vertexAttribPointer(b.skinIndex,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinWeightsBuffer),o.vertexAttribPointer(b.skinWeight,4,o.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(h.wireframe? +(o.lineWidth(h.wireframeLinewidth),c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,k.__webglLineBuffer),o.drawElements(o.LINES,k.__webglLineCount,o.UNSIGNED_SHORT,0)):(c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,k.__webglFaceBuffer),o.drawElements(o.TRIANGLES,k.__webglFaceCount,o.UNSIGNED_SHORT,0)),P.info.render.calls++,P.info.render.vertices+=k.__webglFaceCount,P.info.render.faces+=k.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?o.LINE_STRIP:o.LINES,o.lineWidth(h.linewidth),o.drawArrays(m, +0,k.__webglLineCount),P.info.render.calls++):m instanceof THREE.ParticleSystem?(o.drawArrays(o.POINTS,0,k.__webglParticleCount),P.info.render.calls++):m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP,0,k.__webglVertexCount),P.info.render.calls++)}}function h(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=o.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=o.createBuffer();b.hasPos&&(o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,b.positionArray, +o.DYNAMIC_DRAW),o.enableVertexAttribArray(c.attributes.position),o.vertexAttribPointer(c.attributes.position,3,o.FLOAT,!1,0,0));if(b.hasNormal){o.bindBuffer(o.ARRAY_BUFFER,b.__webglNormalBuffer);if(e==THREE.FlatShading){var f,k,h,m,n,p,t,u,v,w,x=b.count*3;for(w=0;w=0;e--)b[e].object==c&&b.splice(e,1)}function J(b){function c(b){var k=[];e=0;for(f=b.length;e65535&&(t[p].counter+=1,o=t[p].hash+"_"+t[p].counter,b.geometryGroups[o]==void 0&&(b.geometryGroups[o]={faces:[],materials:n,vertices:0,numMorphTargets:u})),b.geometryGroups[o].faces.push(k),b.geometryGroups[o].vertices+=m;b.geometryGroupsList=[];for(var v in b.geometryGroups)b.geometryGroups[v].id=ka++,b.geometryGroupsList.push(b.geometryGroups[v])}function M(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0}, -transparent:{list:[],count:0}})}function K(b){if(b!=W){switch(b){case THREE.AdditiveBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.SRC_ALPHA,p.ONE);break;case THREE.SubtractiveBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.ZERO,p.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.ZERO,p.SRC_COLOR);break;default:p.blendEquationSeparate(p.FUNC_ADD,p.FUNC_ADD),p.blendFuncSeparate(p.SRC_ALPHA,p.ONE_MINUS_SRC_ALPHA,p.ONE,p.ONE_MINUS_SRC_ALPHA)}W=b}} -function B(b,c,e){(e.width&e.width-1)==0&&(e.height&e.height-1)==0?(p.texParameteri(b,p.TEXTURE_WRAP_S,$(c.wrapS)),p.texParameteri(b,p.TEXTURE_WRAP_T,$(c.wrapT)),p.texParameteri(b,p.TEXTURE_MAG_FILTER,$(c.magFilter)),p.texParameteri(b,p.TEXTURE_MIN_FILTER,$(c.minFilter)),p.generateMipmap(b)):(p.texParameteri(b,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(b,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(b,p.TEXTURE_MAG_FILTER,Z(c.magFilter)),p.texParameteri(b,p.TEXTURE_MIN_FILTER,Z(c.minFilter)))} -function L(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=p.createTexture(),P.info.memory.textures++;p.activeTexture(p.TEXTURE0+c);p.bindTexture(p.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?p.texImage2D(p.TEXTURE_2D,0,$(b.format),b.image.width,b.image.height,0,$(b.format),p.UNSIGNED_BYTE,b.image.data):p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,b.image);B(p.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else p.activeTexture(p.TEXTURE0+c),p.bindTexture(p.TEXTURE_2D, -b.__webglTexture)}function Y(b,c){p.bindRenderbuffer(p.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_COMPONENT16,c.width,c.height),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_STENCIL,c.width,c.height),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_STENCIL_ATTACHMENT,p.RENDERBUFFER,b)):p.renderbufferStorage(p.RENDERBUFFER,p.RGBA4,c.width,c.height)} -function H(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=p.createTexture();if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];p.bindTexture(p.TEXTURE_CUBE_MAP,b.__webglTexture);B(p.TEXTURE_CUBE_MAP,b,b);for(var e=0;e<6;e++){b.__webglFramebuffer[e]=p.createFramebuffer();b.__webglRenderbuffer[e]=p.createRenderbuffer();p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X+ -e,0,$(b.format),b.width,b.height,0,$(b.format),$(b.type),null);var f=b,k=p.TEXTURE_CUBE_MAP_POSITIVE_X+e;p.bindFramebuffer(p.FRAMEBUFFER,b.__webglFramebuffer[e]);p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,k,f.__webglTexture,0);Y(b.__webglRenderbuffer[e],b)}}else b.__webglFramebuffer=p.createFramebuffer(),b.__webglRenderbuffer=p.createRenderbuffer(),p.bindTexture(p.TEXTURE_2D,b.__webglTexture),B(p.TEXTURE_2D,b,b),p.texImage2D(p.TEXTURE_2D,0,$(b.format),b.width,b.height,0,$(b.format), -$(b.type),null),e=p.TEXTURE_2D,p.bindFramebuffer(p.FRAMEBUFFER,b.__webglFramebuffer),p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,e,b.__webglTexture,0),p.bindRenderbuffer(p.RENDERBUFFER,b.__webglRenderbuffer),Y(b.__webglRenderbuffer,b);c?p.bindTexture(p.TEXTURE_CUBE_MAP,null):p.bindTexture(p.TEXTURE_2D,null);p.bindRenderbuffer(p.RENDERBUFFER,null);p.bindFramebuffer(p.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,e=b.width,b=b.height,k=f=0):(c=null, -e=ra,b=sa,f=ca,k=pa);c!=ea&&(p.bindFramebuffer(p.FRAMEBUFFER,c),p.viewport(f,k,e,b),ea=c)}function T(b){b instanceof THREE.WebGLRenderTargetCube?(p.bindTexture(p.TEXTURE_CUBE_MAP,b.__webglTexture),p.generateMipmap(p.TEXTURE_CUBE_MAP),p.bindTexture(p.TEXTURE_CUBE_MAP,null)):(p.bindTexture(p.TEXTURE_2D,b.__webglTexture),p.generateMipmap(p.TEXTURE_2D),p.bindTexture(p.TEXTURE_2D,null))}function Q(b,c){var e;b=="fragment"?e=p.createShader(p.FRAGMENT_SHADER):b=="vertex"&&(e=p.createShader(p.VERTEX_SHADER)); -p.shaderSource(e,c);p.compileShader(e);if(!p.getShaderParameter(e,p.COMPILE_STATUS))return console.error(p.getShaderInfoLog(e)),console.error(c),null;return e}function Z(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return p.NEAREST;default:return p.LINEAR}}function $(b){switch(b){case THREE.RepeatWrapping:return p.REPEAT;case THREE.ClampToEdgeWrapping:return p.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return p.MIRRORED_REPEAT; -case THREE.NearestFilter:return p.NEAREST;case THREE.NearestMipMapNearestFilter:return p.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return p.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return p.LINEAR;case THREE.LinearMipMapNearestFilter:return p.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return p.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return p.BYTE;case THREE.UnsignedByteType:return p.UNSIGNED_BYTE;case THREE.ShortType:return p.SHORT;case THREE.UnsignedShortType:return p.UNSIGNED_SHORT; -case THREE.IntType:return p.INT;case THREE.UnsignedShortType:return p.UNSIGNED_INT;case THREE.FloatType:return p.FLOAT;case THREE.AlphaFormat:return p.ALPHA;case THREE.RGBFormat:return p.RGB;case THREE.RGBAFormat:return p.RGBA;case THREE.LuminanceFormat:return p.LUMINANCE;case THREE.LuminanceAlphaFormat:return p.LUMINANCE_ALPHA}return 0}var P=this,p,V=[],fa=null,ea=null,ha=-1,ga=null,ka=0,na=null,aa=null,W=null,U=null,ia=null,ja=null,ta=null,la=null,ca=0,pa=0,ra=0,sa=0,ya=[new THREE.Vector4,new THREE.Vector4, +c){var e;for(e=b.length-1;e>=0;e--)b[e].object==c&&b.splice(e,1)}function J(b){function c(b){var k=[];e=0;for(f=b.length;e65535&&(t[o].counter+=1,p=t[o].hash+"_"+t[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[],materials:n,vertices:0,numMorphTargets:u})),b.geometryGroups[p].faces.push(k),b.geometryGroups[p].vertices+=m;b.geometryGroupsList=[];for(var v in b.geometryGroups)b.geometryGroups[v].id=ka++,b.geometryGroupsList.push(b.geometryGroups[v])}function M(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0}, +transparent:{list:[],count:0}})}function K(b){if(b!=W){switch(b){case THREE.AdditiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE);break;case THREE.SubtractiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,o.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,o.SRC_COLOR);break;default:o.blendEquationSeparate(o.FUNC_ADD,o.FUNC_ADD),o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA)}W=b}} +function B(b,c,e){(e.width&e.width-1)==0&&(e.height&e.height-1)==0?(o.texParameteri(b,o.TEXTURE_WRAP_S,$(c.wrapS)),o.texParameteri(b,o.TEXTURE_WRAP_T,$(c.wrapT)),o.texParameteri(b,o.TEXTURE_MAG_FILTER,$(c.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,$(c.minFilter)),o.generateMipmap(b)):(o.texParameteri(b,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_MAG_FILTER,Z(c.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,Z(c.minFilter)))} +function L(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=o.createTexture(),P.info.memory.textures++;o.activeTexture(o.TEXTURE0+c);o.bindTexture(o.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?o.texImage2D(o.TEXTURE_2D,0,$(b.format),b.image.width,b.image.height,0,$(b.format),o.UNSIGNED_BYTE,b.image.data):o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,b.image);B(o.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+c),o.bindTexture(o.TEXTURE_2D, +b.__webglTexture)}function Y(b,c){o.bindRenderbuffer(o.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_COMPONENT16,c.width,c.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,c.width,c.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,b)):o.renderbufferStorage(o.RENDERBUFFER,o.RGBA4,c.width,c.height)} +function H(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=o.createTexture();if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture);B(o.TEXTURE_CUBE_MAP,b,b);for(var e=0;e<6;e++){b.__webglFramebuffer[e]=o.createFramebuffer();b.__webglRenderbuffer[e]=o.createRenderbuffer();o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+ +e,0,$(b.format),b.width,b.height,0,$(b.format),$(b.type),null);var f=b,k=o.TEXTURE_CUBE_MAP_POSITIVE_X+e;o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer[e]);o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,k,f.__webglTexture,0);Y(b.__webglRenderbuffer[e],b)}}else b.__webglFramebuffer=o.createFramebuffer(),b.__webglRenderbuffer=o.createRenderbuffer(),o.bindTexture(o.TEXTURE_2D,b.__webglTexture),B(o.TEXTURE_2D,b,b),o.texImage2D(o.TEXTURE_2D,0,$(b.format),b.width,b.height,0,$(b.format), +$(b.type),null),e=o.TEXTURE_2D,o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,e,b.__webglTexture,0),o.bindRenderbuffer(o.RENDERBUFFER,b.__webglRenderbuffer),Y(b.__webglRenderbuffer,b);c?o.bindTexture(o.TEXTURE_CUBE_MAP,null):o.bindTexture(o.TEXTURE_2D,null);o.bindRenderbuffer(o.RENDERBUFFER,null);o.bindFramebuffer(o.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,e=b.width,b=b.height,k=f=0):(c=null, +e=ra,b=sa,f=ca,k=pa);c!=ea&&(o.bindFramebuffer(o.FRAMEBUFFER,c),o.viewport(f,k,e,b),ea=c)}function T(b){b instanceof THREE.WebGLRenderTargetCube?(o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture),o.generateMipmap(o.TEXTURE_CUBE_MAP),o.bindTexture(o.TEXTURE_CUBE_MAP,null)):(o.bindTexture(o.TEXTURE_2D,b.__webglTexture),o.generateMipmap(o.TEXTURE_2D),o.bindTexture(o.TEXTURE_2D,null))}function Q(b,c){var e;b=="fragment"?e=o.createShader(o.FRAGMENT_SHADER):b=="vertex"&&(e=o.createShader(o.VERTEX_SHADER)); +o.shaderSource(e,c);o.compileShader(e);if(!o.getShaderParameter(e,o.COMPILE_STATUS))return console.error(o.getShaderInfoLog(e)),console.error(c),null;return e}function Z(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return o.NEAREST;default:return o.LINEAR}}function $(b){switch(b){case THREE.RepeatWrapping:return o.REPEAT;case THREE.ClampToEdgeWrapping:return o.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return o.MIRRORED_REPEAT; +case THREE.NearestFilter:return o.NEAREST;case THREE.NearestMipMapNearestFilter:return o.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return o.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return o.LINEAR;case THREE.LinearMipMapNearestFilter:return o.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return o.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return o.BYTE;case THREE.UnsignedByteType:return o.UNSIGNED_BYTE;case THREE.ShortType:return o.SHORT;case THREE.UnsignedShortType:return o.UNSIGNED_SHORT; +case THREE.IntType:return o.INT;case THREE.UnsignedShortType:return o.UNSIGNED_INT;case THREE.FloatType:return o.FLOAT;case THREE.AlphaFormat:return o.ALPHA;case THREE.RGBFormat:return o.RGB;case THREE.RGBAFormat:return o.RGBA;case THREE.LuminanceFormat:return o.LUMINANCE;case THREE.LuminanceAlphaFormat:return o.LUMINANCE_ALPHA}return 0}var P=this,o,V=[],fa=null,ea=null,ha=-1,ga=null,ka=0,na=null,aa=null,W=null,U=null,ia=null,ja=null,ta=null,la=null,ca=0,pa=0,ra=0,sa=0,ya=[new THREE.Vector4,new THREE.Vector4, new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Ga=new Float32Array(16),Fa=new Float32Array(16),Da=new THREE.Vector4,za={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},S=b.canvas!==void 0?b.canvas:document.createElement("canvas"),O=b.stencil!==void 0?b.stencil:!0,da=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,qa=b.antialias!==void 0?b.antialias:!1,N=b.clearColor!== void 0?new THREE.Color(b.clearColor):new THREE.Color(0),ma=b.clearAlpha!==void 0?b.clearAlpha:0,ua=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=S;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight= this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var oa,Ea=[],b=THREE.ShaderLib.depthRGBA,Ia=THREE.UniformsUtils.clone(b.uniforms),Ba=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Ia}),va=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Ia,morphTargets:!0});Ba._shadowPass= -!0;va._shadowPass=!0;try{if(!(p=S.getContext("experimental-webgl",{antialias:qa,stencil:O,preserveDrawingBuffer:da})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+p.getParameter(p.VERSION)+" | "+p.getParameter(p.VENDOR)+" | "+p.getParameter(p.RENDERER)+" | "+p.getParameter(p.SHADING_LANGUAGE_VERSION))}catch(Ka){console.error(Ka)}p.clearColor(0,0,0,1);p.clearDepth(1);p.clearStencil(0);p.enable(p.DEPTH_TEST);p.depthFunc(p.LEQUAL);p.frontFace(p.CCW);p.cullFace(p.BACK);p.enable(p.CULL_FACE); -p.enable(p.BLEND);p.blendEquation(p.FUNC_ADD);p.blendFunc(p.SRC_ALPHA,p.ONE_MINUS_SRC_ALPHA);p.clearColor(N.r,N.g,N.b,ma);this.context=p;var Ha=p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,X={};X.vertices=new Float32Array(16);X.faces=new Uint16Array(6);O=0;X.vertices[O++]=-1;X.vertices[O++]=-1;X.vertices[O++]=0;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=-1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=0;X.vertices[O++]=-1; -X.vertices[O++]=1;X.vertices[O++]=0;O=X.vertices[O++]=0;X.faces[O++]=0;X.faces[O++]=1;X.faces[O++]=2;X.faces[O++]=0;X.faces[O++]=2;X.faces[O++]=3;X.vertexBuffer=p.createBuffer();X.elementBuffer=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,X.vertexBuffer);p.bufferData(p.ARRAY_BUFFER,X.vertices,p.STATIC_DRAW);p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,X.elementBuffer);p.bufferData(p.ELEMENT_ARRAY_BUFFER,X.faces,p.STATIC_DRAW);X.program=p.createProgram();p.attachShader(X.program,Q("fragment",THREE.ShaderLib.sprite.fragmentShader)); -p.attachShader(X.program,Q("vertex",THREE.ShaderLib.sprite.vertexShader));p.linkProgram(X.program);X.attributes={};X.uniforms={};X.attributes.position=p.getAttribLocation(X.program,"position");X.attributes.uv=p.getAttribLocation(X.program,"uv");X.uniforms.uvOffset=p.getUniformLocation(X.program,"uvOffset");X.uniforms.uvScale=p.getUniformLocation(X.program,"uvScale");X.uniforms.rotation=p.getUniformLocation(X.program,"rotation");X.uniforms.scale=p.getUniformLocation(X.program,"scale");X.uniforms.alignment= -p.getUniformLocation(X.program,"alignment");X.uniforms.color=p.getUniformLocation(X.program,"color");X.uniforms.map=p.getUniformLocation(X.program,"map");X.uniforms.opacity=p.getUniformLocation(X.program,"opacity");X.uniforms.useScreenCoordinates=p.getUniformLocation(X.program,"useScreenCoordinates");X.uniforms.affectedByDistance=p.getUniformLocation(X.program,"affectedByDistance");X.uniforms.screenPosition=p.getUniformLocation(X.program,"screenPosition");X.uniforms.modelViewMatrix=p.getUniformLocation(X.program, -"modelViewMatrix");X.uniforms.projectionMatrix=p.getUniformLocation(X.program,"projectionMatrix");var Xa=!1;this.setSize=function(b,c){S.width=b;S.height=c;this.setViewport(0,0,S.width,S.height)};this.setViewport=function(b,c,e,f){ca=b;pa=c;ra=e;sa=f;p.viewport(ca,pa,ra,sa)};this.setScissor=function(b,c,e,f){p.scissor(b,c,e,f)};this.enableScissorTest=function(b){b?p.enable(p.SCISSOR_TEST):p.disable(p.SCISSOR_TEST)};this.setClearColorHex=function(b,c){N.setHex(b);ma=c;p.clearColor(N.r,N.g,N.b,ma)}; -this.setClearColor=function(b,c){N.copy(b);ma=c;p.clearColor(N.r,N.g,N.b,ma)};this.getClearColor=function(){return N};this.getClearAlpha=function(){return ma};this.clear=function(b,c,e){var f=0;if(b==void 0||b)f|=p.COLOR_BUFFER_BIT;if(c==void 0||c)f|=p.DEPTH_BUFFER_BIT;if(e==void 0||e)f|=p.STENCIL_BUFFER_BIT;p.clear(f)};this.getContext=function(){return p};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray, -delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];p.deleteBuffer(c.__webglVertexBuffer);p.deleteBuffer(c.__webglNormalBuffer);p.deleteBuffer(c.__webglTangentBuffer);p.deleteBuffer(c.__webglColorBuffer);p.deleteBuffer(c.__webglUVBuffer);p.deleteBuffer(c.__webglUV2Buffer);p.deleteBuffer(c.__webglSkinVertexABuffer);p.deleteBuffer(c.__webglSkinVertexBBuffer);p.deleteBuffer(c.__webglSkinIndicesBuffer);p.deleteBuffer(c.__webglSkinWeightsBuffer); -p.deleteBuffer(c.__webglFaceBuffer);p.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var e=0,f=c.numMorphTargets;e0,X={};X.vertices=new Float32Array(16);X.faces=new Uint16Array(6);O=0;X.vertices[O++]=-1;X.vertices[O++]=-1;X.vertices[O++]=0;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=-1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=0;X.vertices[O++]=-1; +X.vertices[O++]=1;X.vertices[O++]=0;O=X.vertices[O++]=0;X.faces[O++]=0;X.faces[O++]=1;X.faces[O++]=2;X.faces[O++]=0;X.faces[O++]=2;X.faces[O++]=3;X.vertexBuffer=o.createBuffer();X.elementBuffer=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,X.vertexBuffer);o.bufferData(o.ARRAY_BUFFER,X.vertices,o.STATIC_DRAW);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,X.elementBuffer);o.bufferData(o.ELEMENT_ARRAY_BUFFER,X.faces,o.STATIC_DRAW);X.program=o.createProgram();o.attachShader(X.program,Q("fragment",THREE.ShaderLib.sprite.fragmentShader)); +o.attachShader(X.program,Q("vertex",THREE.ShaderLib.sprite.vertexShader));o.linkProgram(X.program);X.attributes={};X.uniforms={};X.attributes.position=o.getAttribLocation(X.program,"position");X.attributes.uv=o.getAttribLocation(X.program,"uv");X.uniforms.uvOffset=o.getUniformLocation(X.program,"uvOffset");X.uniforms.uvScale=o.getUniformLocation(X.program,"uvScale");X.uniforms.rotation=o.getUniformLocation(X.program,"rotation");X.uniforms.scale=o.getUniformLocation(X.program,"scale");X.uniforms.alignment= +o.getUniformLocation(X.program,"alignment");X.uniforms.color=o.getUniformLocation(X.program,"color");X.uniforms.map=o.getUniformLocation(X.program,"map");X.uniforms.opacity=o.getUniformLocation(X.program,"opacity");X.uniforms.useScreenCoordinates=o.getUniformLocation(X.program,"useScreenCoordinates");X.uniforms.affectedByDistance=o.getUniformLocation(X.program,"affectedByDistance");X.uniforms.screenPosition=o.getUniformLocation(X.program,"screenPosition");X.uniforms.modelViewMatrix=o.getUniformLocation(X.program, +"modelViewMatrix");X.uniforms.projectionMatrix=o.getUniformLocation(X.program,"projectionMatrix");var Xa=!1;this.setSize=function(b,c){S.width=b;S.height=c;this.setViewport(0,0,S.width,S.height)};this.setViewport=function(b,c,e,f){ca=b;pa=c;ra=e;sa=f;o.viewport(ca,pa,ra,sa)};this.setScissor=function(b,c,e,f){o.scissor(b,c,e,f)};this.enableScissorTest=function(b){b?o.enable(o.SCISSOR_TEST):o.disable(o.SCISSOR_TEST)};this.setClearColorHex=function(b,c){N.setHex(b);ma=c;o.clearColor(N.r,N.g,N.b,ma)}; +this.setClearColor=function(b,c){N.copy(b);ma=c;o.clearColor(N.r,N.g,N.b,ma)};this.getClearColor=function(){return N};this.getClearAlpha=function(){return ma};this.clear=function(b,c,e){var f=0;if(b==void 0||b)f|=o.COLOR_BUFFER_BIT;if(c==void 0||c)f|=o.DEPTH_BUFFER_BIT;if(e==void 0||e)f|=o.STENCIL_BUFFER_BIT;o.clear(f)};this.getContext=function(){return o};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray, +delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];o.deleteBuffer(c.__webglVertexBuffer);o.deleteBuffer(c.__webglNormalBuffer);o.deleteBuffer(c.__webglTangentBuffer);o.deleteBuffer(c.__webglColorBuffer);o.deleteBuffer(c.__webglUVBuffer);o.deleteBuffer(c.__webglUV2Buffer);o.deleteBuffer(c.__webglSkinVertexABuffer);o.deleteBuffer(c.__webglSkinVertexBBuffer);o.deleteBuffer(c.__webglSkinIndicesBuffer);o.deleteBuffer(c.__webglSkinWeightsBuffer); +o.deleteBuffer(c.__webglFaceBuffer);o.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var e=0,f=c.numMorphTargets;e=0&&p.enableVertexAttribArray(x.position);x.color>=0&&p.enableVertexAttribArray(x.color);x.normal>=0&&p.enableVertexAttribArray(x.normal);x.tangent>=0&&p.enableVertexAttribArray(x.tangent); -b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(p.enableVertexAttribArray(x.skinVertexA),p.enableVertexAttribArray(x.skinVertexB),p.enableVertexAttribArray(x.skinIndex),p.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(h in b.attributes)x[h]!==void 0&&x[h]>=0&&p.enableVertexAttribArray(x[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h=0&&(p.enableVertexAttribArray(x[y]),b.numSupportedMorphTargets++); -b.uniformsList=[];for(k in b.uniforms)b.uniformsList.push([b.uniforms[k],k])};this.clearTarget=function(b,c,e,f){H(b);this.clear(c,e,f)};this.updateShadowMap=function(b,c){z(b,c)};this.render=function(b,c,o,S){var O,da,F,C,G,qa,B,la,J=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&z(b,c);P.info.render.calls=0;P.info.render.vertices=0;P.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Fa); -c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);t(Ca);this.initWebGLObjects(b);H(o);(this.autoClear||S)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(S=0;S=0&&o.enableVertexAttribArray(x.position);x.color>=0&&o.enableVertexAttribArray(x.color);x.normal>=0&&o.enableVertexAttribArray(x.normal);x.tangent>=0&&o.enableVertexAttribArray(x.tangent); +b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(o.enableVertexAttribArray(x.skinVertexA),o.enableVertexAttribArray(x.skinVertexB),o.enableVertexAttribArray(x.skinIndex),o.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(h in b.attributes)x[h]!==void 0&&x[h]>=0&&o.enableVertexAttribArray(x[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h=0&&(o.enableVertexAttribArray(x[y]),b.numSupportedMorphTargets++); +b.uniformsList=[];for(k in b.uniforms)b.uniformsList.push([b.uniforms[k],k])};this.clearTarget=function(b,c,e,f){H(b);this.clear(c,e,f)};this.updateShadowMap=function(b,c){z(b,c)};this.render=function(b,c,u,S){var O,da,F,C,G,qa,B,la,J=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&z(b,c);P.info.render.calls=0;P.info.render.vertices=0;P.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Fa); +c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);t(Ca);this.initWebGLObjects(b);H(u);(this.autoClear||S)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(S=0;S=0;S--)if(O=b.__webglObjects[S],O.render){B=O.object;la=O.buffer;F=O.opaque;k(B);for(O=0;O0||x.faceVertexUvs.length> -0)m.__uvArray=new Float32Array(o*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(o*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(o*4),m.__skinVertexBArray=new Float32Array(o*4),m.__skinIndexArray=new Float32Array(o*4),m.__skinWeightArray=new Float32Array(o*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(S*2);if(m.numMorphTargets){m.__morphTargetsArrays= -[];x=0;for(z=m.numMorphTargets;x=0;S--)if(O=b.__webglObjects[S],O.render){B=O.object;la=O.buffer;F=O.opaque;k(B);for(O=0;O0||x.faceVertexUvs.length> +0)m.__uvArray=new Float32Array(p*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(p*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(p*4),m.__skinVertexBArray=new Float32Array(p*4),m.__skinIndexArray=new Float32Array(p*4),m.__skinWeightArray=new Float32Array(p*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(S*2);if(m.numMorphTargets){m.__morphTargetsArrays= +[];x=0;for(z=m.numMorphTargets;x=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglColorBuffer),p.bufferData(p.ARRAY_BUFFER,ea,y));Ga&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglNormalBuffer),p.bufferData(p.ARRAY_BUFFER,ga,y));Da&&va.hasTangents&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglTangentBuffer),p.bufferData(p.ARRAY_BUFFER,ha,y));Ha&&ra>0&&(p.bindBuffer(p.ARRAY_BUFFER, -t.__webglUVBuffer),p.bufferData(p.ARRAY_BUFFER,ia,y));Ha&&T>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglUV2Buffer),p.bufferData(p.ARRAY_BUFFER,Ea,y));Ca&&(p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,Ba,y),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,ta,y));R>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexABuffer),p.bufferData(p.ARRAY_BUFFER,ja,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexBBuffer), -p.bufferData(p.ARRAY_BUFFER,sa,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),p.bufferData(p.ARRAY_BUFFER,aa,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),p.bufferData(p.ARRAY_BUFFER,fa,y));S&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray,delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}k.__dirtyVertices= -!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(m)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=p.DYNAMIC_DRAW;n=x=S=S=void 0;u=h.vertices;o=h.colors;v=u.length;t=o.length;z=h.__vertexArray;y=h.__colorArray;A=h.__dirtyColors;if(h.__dirtyVertices){for(S=0;S0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,ea,y));Ga&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglNormalBuffer),o.bufferData(o.ARRAY_BUFFER,ga,y));Da&&va.hasTangents&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglTangentBuffer),o.bufferData(o.ARRAY_BUFFER,ha,y));Ha&&ra>0&&(o.bindBuffer(o.ARRAY_BUFFER, +t.__webglUVBuffer),o.bufferData(o.ARRAY_BUFFER,ia,y));Ha&&T>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglUV2Buffer),o.bufferData(o.ARRAY_BUFFER,Ea,y));Ca&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,Ba,y),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,ta,y));R>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinVertexABuffer),o.bufferData(o.ARRAY_BUFFER,ja,y),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinVertexBBuffer), +o.bufferData(o.ARRAY_BUFFER,sa,y),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),o.bufferData(o.ARRAY_BUFFER,aa,y),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),o.bufferData(o.ARRAY_BUFFER,fa,y));S&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray,delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}k.__dirtyVertices= +!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(m)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=o.DYNAMIC_DRAW;n=x=S=S=void 0;u=h.vertices;p=h.colors;v=u.length;t=p.length;z=h.__vertexArray;y=h.__colorArray;A=h.__dirtyColors;if(h.__dirtyVertices){for(S=0;S1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=m;c.v=k;return c}, -clamp:function(b,c,e){return be?e:b}};THREE.ColorUtils.__hsv={h:0,s:0,v:0}; -THREE.GeometryUtils={merge:function(b,c){var e,f,h=b.vertices.length,k=c instanceof THREE.Mesh?c.geometry:c,m=b.vertices,n=k.vertices,u=b.faces,t=k.faces,w=b.faceVertexUvs[0],k=k.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var o=0,x=n.length;o1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=m;c.v=k;return c}}; +THREE.ColorUtils.__hsv={h:0,s:0,v:0}; +THREE.GeometryUtils={merge:function(b,c){var e,f,h=b.vertices.length,k=c instanceof THREE.Mesh?c.geometry:c,m=b.vertices,n=k.vertices,p=b.faces,t=k.faces,w=b.faceVertexUvs[0],k=k.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var u=0,x=n.length;u1&&(f=1-f,h=1-h);k=1-f-h;m.copy(b);m.multiplyScalar(f);n.copy(c);n.multiplyScalar(h);m.addSelf(n);n.copy(e);n.multiplyScalar(k);m.addSelf(n);return m},randomPointInFace:function(b,c,e){var f,h,k;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,h=c.vertices[b.b].position,k=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,h,k);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;h=c.vertices[b.b].position;k=c.vertices[b.c].position;var c=c.vertices[b.d].position, m;e?b._area1&&b._area2?(e=b._area1,m=b._area2):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c),b._area1=e,b._area2=m):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c));return THREE.GeometryUtils.random()*(e+m) -b?c(e,k-1):t[k]e?e:b},mapLinear:function(b,c,e,f,h){return(b-c)*(h-f)/(e-c)+f}};THREE.SceneUtils={showHierarchy:function(b,c){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=c})},traverseHierarchy:function(b,c){var e,f,h=b.children.length;for(f=0;fe?e:b},clampBottom:function(b,c){return b0)n=f-1;else{n=f;break}f=n;if(e[f]==k)return f/(h-1);m=e[f];return e=(f+(k-m)/(e[f+1]-m))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)}; +THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,h=e.length,k;k=c?c:b*e[h-1];time=Date.now();for(var m=0,n=h-1,p;m<=n;)if(f=Math.floor(m+(n-m)/2),p=e[f]-k,p<0)m=f+1;else if(p>0)n=f-1;else{n=f;break}f=n;if(e[f]==k)return f/(h-1);m=e[f];return e=(f+(k-m)/(e[f+1]-m))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)}; THREE.Curve.prototype.getTangent=function(b){var c=b-1.0E-4;b+=1.0E-4;c<0&&(c=0);b>1&&(b=1);var c=this.getPoint(c),b=this.getPoint(b),e=new THREE.Vector2;e.sub(b,c);return e.unit()};THREE.LineCurve=function(b,c){b instanceof THREE.Vector2?(this.v1=b,this.v2=c):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(b,c,e,f){this.constructor(new THREE.Vector2(b,c),new THREE.Vector2(e,f))};THREE.LineCurve.prototype=new THREE.Curve; THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2;c.sub(this.v2,this.v1);c.multiplyScalar(b).addSelf(this.v1);return c};THREE.LineCurve.prototype.getPointAt=function(b){return this.getPoint(b)};THREE.LineCurve.prototype.getTangent=function(){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.normalize();return b}; THREE.QuadraticBezierCurve=function(b,c,e){if(!(c instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),b=new THREE.Vector2(f[0],f[1]),c=new THREE.Vector2(f[2],f[3]),e=new THREE.Vector2(f[4],f[5]);this.v0=b;this.v1=c;this.v2=e};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; @@ -393,72 +393,72 @@ THREE.SplineCurve3=THREE.Curve.create(function(b){this.points=b},function(b){var THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(b){this.curves.push(b)};THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){}; THREE.CurvePath.prototype.getPoint=function(b){for(var c=b*this.getLength(),e=this.getCurveLengths(),b=0;b=c)return c=e[b]-c,b=this.curves[b],c=1-c/b.getLength(),b.getPointAt(c);b++}return null};THREE.CurvePath.prototype.getLength=function(){var b=this.getCurveLengths();return b[b.length-1]}; THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var b=[],c=0,e,f=this.curves.length;for(e=0;ec)c=k.x;else if(k.xe)e=k.y;else if(k.yc)c=k.x;else if(k.xe)e=k.y;else if(k.y0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b2(z,v,o,n),z=THREE.Shape.Utils.b2(z,A,x, -u),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];u=k[5];o=k[0];x=k[1];t=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b3(z,v,o,t,n),z=THREE.Shape.Utils.b3(z,A,x,w,u),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];z=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m); -for(m=1;m<=z;m++)e.push(k.getPointAt(m/z));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];u=k[1];t=k[2];o=k[3];z=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);A=z-o;var y=b*2;for(m=1;m<=y;m++)z=m/y,x||(z=1-z),z=o+z*A,k=w+n+t*Math.cos(z),z=v+u+t*Math.sin(z),e.push(new THREE.Vector2(k,z))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)}; -THREE.Path.prototype.nltransform=function(b,c,e,f,h,k){var m=this.getPoints(),n,u,t,w,o;n=0;for(u=m.length;n0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b2(z,v,u,n),z=THREE.Shape.Utils.b2(z,A,x, +p),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];p=k[5];u=k[0];x=k[1];t=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b3(z,v,u,t,n),z=THREE.Shape.Utils.b3(z,A,x,w,p),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];z=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m); +for(m=1;m<=z;m++)e.push(k.getPointAt(m/z));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];p=k[1];t=k[2];u=k[3];z=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);A=z-u;var y=b*2;for(m=1;m<=y;m++)z=m/y,x||(z=1-z),z=u+z*A,k=w+n+t*Math.cos(z),z=v+p+t*Math.sin(z),e.push(new THREE.Vector2(k,z))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)}; +THREE.Path.prototype.nltransform=function(b,c,e,f,h,k){var m=this.getPoints(),n,p,t,w,u;n=0;for(p=m.length;n=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;var z=[t[m],e[n],e[h]];o=THREE.FontUtils.Triangulate.area(z);var y=[t[m],t[k],e[n]];x=THREE.FontUtils.Triangulate.area(y);v=n;w=m;n+=1;m+=-1;n< -0&&(n+=e.length);n%=e.length;m<0&&(m+=t.length);m%=t.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;z=[t[m],e[n],e[h]];z=THREE.FontUtils.Triangulate.area(z);y=[t[m],t[k],e[n]];y=THREE.FontUtils.Triangulate.area(y);o+x>z+y&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=t.length),m%=t.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:t.length-1);o=e.slice(0,n);x=e.slice(n);v=t.slice(m);w=t.slice(0,m);k=[t[m],t[k],e[n]];A.push([t[m],e[n],e[h]]);A.push(k);e=o.concat(v).concat(w).concat(x)}return{shape:e, -isolatedPts:A,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,u,t={};k=0;for(m=f.length;k=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;var z=[t[m],e[n],e[h]];u=THREE.FontUtils.Triangulate.area(z);var y=[t[m],t[k],e[n]];x=THREE.FontUtils.Triangulate.area(y);v=n;w=m;n+=1;m+=-1;n< +0&&(n+=e.length);n%=e.length;m<0&&(m+=t.length);m%=t.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;z=[t[m],e[n],e[h]];z=THREE.FontUtils.Triangulate.area(z);y=[t[m],t[k],e[n]];y=THREE.FontUtils.Triangulate.area(y);u+x>z+y&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=t.length),m%=t.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:t.length-1);u=e.slice(0,n);x=e.slice(n);v=t.slice(m);w=t.slice(0,m);k=[t[m],t[k],e[n]];A.push([t[m],e[n],e[h]]);A.push(k);e=u.concat(v).concat(w).concat(x)}return{shape:e, +isolatedPts:A,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,p,t={};k=0;for(m=f.length;k1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= +THREE.Animation.prototype.update=function(b){if(this.isPlaying){var c=["pos","rot","scl"],e,f,h,k,m,n,p,t,w=this.data.JIT.hierarchy,u,x;this.currentTime+=b*this.timeScale;x=this.currentTime;u=this.currentTime%=this.data.length;t=parseInt(Math.min(u*this.data.fps,this.data.length*this.data.fps),10);for(var v=0,A=this.hierarchy.length;v1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= this.getPrevKeyWith("pos",v,m.index-1).pos,this.points[1]=h,this.points[2]=k,this.points[3]=this.getNextKeyWith("pos",v,n.index+1).pos,f=f*0.33+0.33,h=this.interpolateCatmullRom(this.points,f),e.x=h[0],e.y=h[1],e.z=h[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e=== "rot")THREE.Quaternion.slerp(h,k,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f}}if(this.JITCompile&&w[0][t]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;vb.length-2?k:k+1;e[3]=k>b.length-3?k:k+2;k=b[e[0]];n=b[e[1]];u=b[e[2]];t=b[e[3]];e=h*h;m=h*e;f[0]=this.interpolate(k[0],n[0],u[0],t[0],h,e,m);f[1]=this.interpolate(k[1],n[1],u[1],t[1],h,e,m);f[2]=this.interpolate(k[2],n[2],u[2],t[2],h,e,m);return f}; +THREE.Animation.prototype.interpolateCatmullRom=function(b,c){var e=[],f=[],h,k,m,n,p,t;h=(b.length-1)*c;k=Math.floor(h);h-=k;e[0]=k==0?k:k-1;e[1]=k;e[2]=k>b.length-2?k:k+1;e[3]=k>b.length-3?k:k+2;k=b[e[0]];n=b[e[1]];p=b[e[2]];t=b[e[3]];e=h*h;m=h*e;f[0]=this.interpolate(k[0],n[0],p[0],t[0],h,e,m);f[1]=this.interpolate(k[1],n[1],p[1],t[1],h,e,m);f[2]=this.interpolate(k[2],n[2],p[2],t[2],h,e,m);return f}; THREE.Animation.prototype.interpolate=function(b,c,e,f,h,k,m){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*m+(-3*(c-e)-2*b-f)*k+b*h+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,e){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e=e0?e:0:e>=0?e:e+f.length;e>=0;e--)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[f.length-1]}; THREE.CubeCamera=function(b,c,e,f){this.heightOffset=e;this.position=new THREE.Vector3(0,e,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position= this.position;this.cameraNY.position=this.position;this.cameraPZ.position=this.position;this.cameraNZ.position=this.position;this.cameraPX.up.set(0,-1,0);this.cameraNX.up.set(0,-1,0);this.cameraPY.up.set(0,0,1);this.cameraNY.up.set(0,0,-1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.targetPX=new THREE.Vector3(0,0,0);this.targetNX=new THREE.Vector3(0,0,0);this.targetPY=new THREE.Vector3(0,0,0);this.targetNY=new THREE.Vector3(0,0,0);this.targetPZ=new THREE.Vector3(0,0,0);this.targetNZ= new THREE.Vector3(0,0,0);this.renderTarget=new THREE.WebGLRenderTargetCube(f,f,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updatePosition=function(b){this.position.copy(b);this.position.y+=this.heightOffset;this.targetPX.copy(this.position);this.targetNX.copy(this.position);this.targetPY.copy(this.position);this.targetNY.copy(this.position);this.targetPZ.copy(this.position);this.targetNZ.copy(this.position);this.targetPX.x+=1;this.targetNX.x-=1;this.targetPY.y+= -1;this.targetNY.y-=1;this.targetPZ.z+=1;this.targetNZ.z-=1;this.cameraPX.lookAt(this.targetPX);this.cameraNX.lookAt(this.targetNX);this.cameraPY.lookAt(this.targetPY);this.cameraNY.lookAt(this.targetNY);this.cameraPZ.lookAt(this.targetPZ);this.cameraNZ.lookAt(this.targetNZ)};this.updateCubeMap=function(b,e){var c=this.renderTarget;c.activeCubeFace=0;b.render(e,this.cameraPX,c);c.activeCubeFace=1;b.render(e,this.cameraNX,c);c.activeCubeFace=2;b.render(e,this.cameraPY,c);c.activeCubeFace=3;b.render(e, -this.cameraNY,c);c.activeCubeFace=4;b.render(e,this.cameraPZ,c);c.activeCubeFace=5;b.render(e,this.cameraNZ,c)}};THREE.FirstPersonCamera=function(){console.warn("DEPRECATED: FirstPersonCamera() is FirstPersonControls().")};THREE.PathCamera=function(){console.warn("DEPRECATED: PathCamera() is PathControls().")};THREE.FlyCamera=function(){console.warn("DEPRECATED: FlyCamera() is FlyControls().")};THREE.RollCamera=function(){console.warn("DEPRECATED: RollCamera() is RollControls().")}; +1;this.targetNY.y-=1;this.targetPZ.z+=1;this.targetNZ.z-=1;this.cameraPX.lookAt(this.targetPX);this.cameraNX.lookAt(this.targetNX);this.cameraPY.lookAt(this.targetPY);this.cameraNY.lookAt(this.targetNY);this.cameraPZ.lookAt(this.targetPZ);this.cameraNZ.lookAt(this.targetNZ)};this.updateCubeMap=function(b,c){var e=this.renderTarget;e.activeCubeFace=0;b.render(c,this.cameraPX,e);e.activeCubeFace=1;b.render(c,this.cameraNX,e);e.activeCubeFace=2;b.render(c,this.cameraPY,e);e.activeCubeFace=3;b.render(c, +this.cameraNY,e);e.activeCubeFace=4;b.render(c,this.cameraPZ,e);e.activeCubeFace=5;b.render(c,this.cameraNZ,e)}};THREE.FirstPersonCamera=function(){console.warn("DEPRECATED: FirstPersonCamera() is FirstPersonControls().")};THREE.PathCamera=function(){console.warn("DEPRECATED: PathCamera() is PathControls().")};THREE.FlyCamera=function(){console.warn("DEPRECATED: FlyCamera() is FlyControls().")};THREE.RollCamera=function(){console.warn("DEPRECATED: RollCamera() is RollControls().")}; THREE.TrackballCamera=function(){console.warn("DEPRECATED: TrackballCamera() is TrackballControls().")};THREE.CombinedCamera=function(b,c,e,f,h,k,m){THREE.Camera.call(this);this.cameraO=new THREE.OrthographicCamera(b/-2,b/2,c/2,c/-2,k,m);this.cameraP=new THREE.PerspectiveCamera(e,b/c,f,h);this.toPerspective()};THREE.CombinedCamera.prototype=new THREE.Camera;THREE.CombinedCamera.prototype.constructor=THREE.CoolCamera; THREE.CombinedCamera.prototype.toPerspective=function(){this.near=this.cameraP.near;this.far=this.cameraP.far;this.projectionMatrix=this.cameraP.projectionMatrix};THREE.CombinedCamera.prototype.toOrthographic=function(){this.near=this.cameraO.near;this.far=this.cameraO.far;this.projectionMatrix=this.cameraO.projectionMatrix};THREE.CombinedCamera.prototype.setFov=function(b){this.cameraP.fov=b;this.cameraP.updateProjectionMatrix();this.toPerspective()}; THREE.CombinedCamera.prototype.setLens=function(b,c){c||(c=43.25);var e=2*Math.atan(c/(b*2));e*=180/Math.PI;this.setFov(e);return e}; -THREE.FirstPersonControls=function(b,c){function e(b,c){return function(){c.apply(b,arguments)}}this.object=b;this.target=new THREE.Vector3(0,0,0);this.domElement=c!==void 0?c:document;this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.lastUpdate=(new Date).getTime();this.theta=this.phi=this.lon=this.lat= +THREE.FirstPersonControls=function(b,c){function e(b,e){return function(){e.apply(b,arguments)}}this.object=b;this.target=new THREE.Vector3(0,0,0);this.domElement=c!==void 0?c:document;this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.lastUpdate=(new Date).getTime();this.theta=this.phi=this.lon=this.lat= this.mouseY=this.mouseX=this.autoSpeedFactor=this.tdiff=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(b){this.domElement!==document&&this.domElement.focus();b.preventDefault();b.stopPropagation(); if(this.activeLook)switch(b.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(b){b.preventDefault();b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY= b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward= -!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}};this.update=function(){var b=(new Date).getTime();this.tdiff=(b-this.lastUpdate)/1E3;this.lastUpdate=b;if(!this.freeze){this.autoSpeedFactor=this.heightSpeed?this.tdiff*((this.object.position.ythis.heightMax?this.heightMax:this.object.position.y)-this.heightMin)*this.heightCoef:0;var c=this.tdiff*this.movementSpeed;(this.moveForward||this.autoForward&& -!this.moveBackward)&&this.object.translateZ(-(c+this.autoSpeedFactor));this.moveBackward&&this.object.translateZ(c);this.moveLeft&&this.object.translateX(-c);this.moveRight&&this.object.translateX(c);this.moveUp&&this.object.translateY(c);this.moveDown&&this.object.translateY(-c);c=this.tdiff*this.lookSpeed;this.activeLook||(c=0);this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon* -Math.PI/180;var b=this.target,e=this.object.position;b.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=e.y+100*Math.cos(this.phi);b.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta)}b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax- -this.verticalMin)/(Math.PI-0)+this.verticalMin;b=this.target;e=this.object.position;b.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=e.y+100*Math.cos(this.phi);b.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(b)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",e(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",e(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup", -e(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",e(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",e(this,this.onKeyUp),!1)}; -THREE.PathControls=function(b,c){function e(b){if((b*=2)<1)return 0.5*b*b;return-0.5*(--b*(b-2)-1)}function f(b,c){return function(){c.apply(b,arguments)}}function h(b,c,e,f){var k={name:e,fps:0.6,length:f,hierarchy:[]},h,m=c.getControlPointsArray(),n=c.getLength(),y=m.length,E=0;h=y-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[h]={time:f,pos:m[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h=0?b:b+m;b=this.verticalAngleMap.srcRange; -c=this.verticalAngleMap.dstRange;var f=c[1]-c[0];this.phi=e(((this.phi-b[0])*(c[1]-c[0])/(b[1]-b[0])+c[0]-c[0])/f)*f+c[0];b=this.horizontalAngleMap.srcRange;c=this.horizontalAngleMap.dstRange;f=c[1]-c[0];this.theta=e(((this.theta-b[0])*(c[1]-c[0])/(b[1]-b[0])+c[0]-c[0])/f)*f+c[0];b=this.target.position;b.x=100*Math.sin(this.phi)*Math.cos(this.theta);b.y=100*Math.cos(this.phi);b.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(b){this.domElement=== -document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}), +this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var m=Math.PI*2,n=Math.PI/180;this.update=function(){var b,c;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*n;this.theta=this.lon*n;c=this.phi%m;this.phi=c>=0?c:c+m;b=this.verticalAngleMap.srcRange; +c=this.verticalAngleMap.dstRange;b=THREE.MathUtils.mapLinear(this.phi,b[0],b[1],c[0],c[1]);var f=c[1]-c[0];this.phi=e((b-c[0])/f)*f+c[0];b=this.horizontalAngleMap.srcRange;c=this.horizontalAngleMap.dstRange;b=THREE.MathUtils.mapLinear(this.theta,b[0],b[1],c[0],c[1]);f=c[1]-c[0];this.theta=e((b-c[0])/f)*f+c[0];c=this.target.position;c.x=100*Math.sin(this.phi)*Math.cos(this.theta);c.y=100*Math.cos(this.phi);c.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= +function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}), e=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(e,b);b=new THREE.Mesh(m,c);b.position.set(0,10,0);this.animation=h(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(b)}else this.animation=h(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var b= this.debugPath,c=this.spline,e=k(c,10),m=k(c,10),n=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,n);particleObj=new THREE.ParticleSystem(m,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.add(lineObj);particleObj.scale.set(1,1,1);b.add(particleObj);m=new THREE.SphereGeometry(1,16,8);n=new THREE.MeshBasicMaterial({color:65280});for(i=0;i0||this.autoForward&&!(u<0)?1:u));this.object.translateX(b*t);this.object.translateY(b*w);m&&(this.roll+=this.rollSpeed*this.delta*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize(); +THREE.RollControls=function(b,c){this.object=b;this.domElement=c!==void 0?c:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Matrix4,m=!1,n=1,p=0,t=0,w=0,u=0,x=0,v=window.innerWidth/2,A=window.innerHeight/2;this.update=function(){var b= +(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.delta=(b-this.lastUpdate)/1E3;this.lastUpdate=b;this.mouseLook&&(b=this.delta*this.lookSpeed,this.rotateHorizontally(b*u),this.rotateVertically(b*x));b=this.delta*this.movementSpeed;this.object.translateZ(-b*(p>0||this.autoForward&&!(p<0)?1:p));this.object.translateX(b*t);this.object.translateY(b*w);m&&(this.roll+=this.rollSpeed*this.delta*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize(); else if(this.forward.y1?e.normalize():e.z=Math.sqrt(1-f*f);k.copy(this.object.position).subSelf(this.target);f=this.object.up.clone().setLength(e.y);f.addSelf(this.object.up.clone().crossSelf(k).setLength(e.x));f.addSelf(k.setLength(e.z));return f};this.rotateCamera=function(){var b=Math.acos(m.dot(n)/m.length()/n.length());if(b){var c=(new THREE.Vector3).cross(m,n).normalize(),e=new THREE.Quaternion;b*=this.rotateSpeed;e.setFromAxisAngle(c, --b);e.multiplyVector3(k);e.multiplyVector3(this.object.up);e.multiplyVector3(n);this.staticMoving?m=n:(e.setFromAxisAngle(c,b*(this.dynamicDampingFactor-1)),e.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(t.y-u.y)*this.zoomSpeed;b!==1&&b>0&&(k.multiplyScalar(b),this.staticMoving?u=t:u.y+=(t.y-u.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=o.clone().subSelf(w);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var c=k.clone().crossSelf(this.object.up).setLength(b.x); -c.addSelf(this.object.up.clone().setLength(b.y));this.object.position.addSelf(c);this.target.addSelf(c);this.staticMoving?w=o:w.addSelf(b.sub(o,w).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()0&&(k.multiplyScalar(b),this.staticMoving?p=t:p.y+=(t.y-p.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=u.clone().subSelf(w);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var c=k.clone().crossSelf(this.object.up).setLength(b.x); +c.addSelf(this.object.up.clone().setLength(b.y));this.object.position.addSelf(c);this.target.addSelf(c);this.staticMoving?w=u:w.addSelf(b.sub(u,w).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;nb&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function h(b){for(H=b.length;--H>=0;){ka=H;na=H-1;na<0&&(na=b.length- -1);for(var c=0,e=v+w*2,c=0;c=0;Q--){Z=Q/w;$=u*(1-Z);Z=t*Math.sin(Z*Math.PI/2);H=0;for(T=F.length;H=0;Q--){Z=Q/w;$=p*(1-Z);Z=t*Math.sin(Z*Math.PI/2);H=0;for(T=F.length;H0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,n,x)))-1);t.push(w)}c.push(t)}for(var v,A,z,h=c.length,e=0;e0)for(f=0;f1&&(v= -this.vertices[m].position.clone(),A=this.vertices[u].position.clone(),z=this.vertices[t].position.clone(),v.normalize(),A.normalize(),z.normalize(),this.faces.push(new THREE.Face3(m,u,t,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(A.x,A.y,A.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([w,o,y]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry; +THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f,h=Math.PI,k=Math.max(3,c||8),m=Math.max(2,e||6),c=[],e=0;e0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(u,n,x)))-1);t.push(w)}c.push(t)}for(var v,A,z,h=c.length,e=0;e0)for(f=0;f1&&(v= +this.vertices[m].position.clone(),A=this.vertices[p].position.clone(),z=this.vertices[t].position.clone(),v.normalize(),A.normalize(),z.normalize(),this.faces.push(new THREE.Face3(m,p,t,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(A.x,A.y,A.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([w,u,y]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry; THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry; THREE.TextGeometry=function(b,c){var e=(new THREE.TextPath(b,c)).toShapes();c.amount=c.height!==void 0?c.height:50;if(c.bevelThickness===void 0)c.bevelThickness=10;if(c.bevelSize===void 0)c.bevelSize=8;if(c.bevelEnabled===void 0)c.bevelEnabled=!1;if(c.bend){var f=e[e.length-1].getBoundingBox().maxX;c.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(f/2,120),new THREE.Vector2(f,0))}THREE.ExtrudeGeometry.call(this,e,c)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry; THREE.TextGeometry.prototype.constructor=THREE.TextGeometry; THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(b,c){return(new TextPath(b,c)).toShapes()},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var c= -this.getFace(),e=this.size/c.resolution,f=0,h=String(b).split(""),k=h.length,m=[],b=0;b0)for(t=0;t2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}u=t;h<=u&&(u=0);t=u+1;h<=t&&(t=0);w=t+1;h<=w&&(w=0);var x;a:{x=b;var v=u,A=t,z=w,y=h,E=m,F=void 0,C=void 0,G=void 0, -J=void 0,M=void 0,K=void 0,B=void 0,L=void 0,Y=void 0,C=x[E[v]].x,G=x[E[v]].y,J=x[E[A]].x,M=x[E[A]].y,K=x[E[z]].x,B=x[E[z]].y;if(1.0E-10>(J-C)*(B-G)-(M-G)*(K-C))x=!1;else{for(F=0;F=0&&Q>=0&&$>=0){x=!1;break a}}x= -!0}}if(x){k.push([b[m[u]],b[m[t]],b[m[w]]]);n.push([m[u],m[t],m[w]]);u=t;for(w=t+1;w0)for(t=0;t2;){if(u--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}p=t;h<=p&&(p=0);t=p+1;h<=t&&(t=0);w=t+1;h<=w&&(w=0);var x;a:{x=b;var v=p,A=t,z=w,y=h,E=m,F=void 0,C=void 0,G=void 0, +J=void 0,M=void 0,K=void 0,B=void 0,L=void 0,Y=void 0,C=x[E[v]].x,G=x[E[v]].y,J=x[E[A]].x,M=x[E[A]].y,K=x[E[z]].x,B=x[E[z]].y;if(1.0E-10>(J-C)*(B-G)-(M-G)*(K-C))x=!1;else{for(F=0;F=0&&Q>=0&&$>=0){x=!1;break a}}x= +!0}}if(x){k.push([b[m[p]],b[m[t]],b[m[w]]]);n.push([m[p],m[t],m[w]]);p=t;for(w=t+1;w0;)this.smooth(b)}; -THREE.SubdivisionModifier.prototype.smooth=function(b){function c(b,c,e,f,n,t){var u=new THREE.Face4(b,c,e,f,null,n.color,n.material);if(m.useOldVertexColors){u.vertexColors=[];for(var v,p,w,x=0;x<4;x++){w=t[x];v=new THREE.Color;v.setRGB(0,0,0);for(var y=0;y>7)-127;f|=(h&127)<<16|k<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,c){var e=w(b,c),f=w(b,c+1),k=w(b,c+2);return(w(b,c+3)<<24)+(k<<16)+(f<<8)+e}function u(b,c){var e=w(b,c);return(w(b,c+1)<<8)+e}function t(b,c){var e=w(b,c);return e>127?e-256:e}function w(b,c){return b.charCodeAt(c)&255}function o(c){var e, -f,k;e=h(b,c);f=h(b,c+M);k=h(b,c+K);c=u(b,c+B);E.faces.push(new THREE.Face3(e,f,k,null,null,E.materials[c]))}function x(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+M);k=h(b,c+K);m=u(b,c+B);o=h(b,c+L);p=h(b,c+Y);c=h(b,c+H);m=E.materials[m];var t=G[p*3],v=G[p*3+1];p=G[p*3+2];var w=G[c*3],x=G[c*3+1],c=G[c*3+2];E.faces.push(new THREE.Face3(e,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(t,v,p),new THREE.Vector3(w,x,c)],null,m))}function v(c){var e,f,k,m;e=h(b,c);f=h(b,c+T);k=h(b,c+Q);m=h(b, -c+Z);c=u(b,c+$);E.faces.push(new THREE.Face4(e,f,k,m,null,null,E.materials[c]))}function A(c){var e,f,k,m,o,t,v,w;e=h(b,c);f=h(b,c+T);k=h(b,c+Q);m=h(b,c+Z);o=u(b,c+$);t=h(b,c+P);v=h(b,c+p);w=h(b,c+V);c=h(b,c+fa);o=E.materials[o];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var S=G[w*3],z=G[w*3+1];w=G[w*3+2];var A=G[c*3],B=G[c*3+1],c=G[c*3+2];E.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(G[t*3],G[t*3+1],G[t*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(S,z,w),new THREE.Vector3(A,B,c)],null,o))} +THREE.BinaryLoader.prototype.createBinModel=function(b,c,e,f){var h=function(c){function e(b,c){var f=w(b,c),k=w(b,c+1),h=w(b,c+2),m=w(b,c+3),n=(m<<1&255|h>>7)-127;f|=(h&127)<<16|k<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,c){var e=w(b,c),f=w(b,c+1),k=w(b,c+2);return(w(b,c+3)<<24)+(k<<16)+(f<<8)+e}function p(b,c){var e=w(b,c);return(w(b,c+1)<<8)+e}function t(b,c){var e=w(b,c);return e>127?e-256:e}function w(b,c){return b.charCodeAt(c)&255}function u(c){var e, +f,k;e=h(b,c);f=h(b,c+M);k=h(b,c+K);c=p(b,c+B);E.faces.push(new THREE.Face3(e,f,k,null,null,E.materials[c]))}function x(c){var e,f,k,m,o,t;e=h(b,c);f=h(b,c+M);k=h(b,c+K);m=p(b,c+B);o=h(b,c+L);t=h(b,c+Y);c=h(b,c+H);m=E.materials[m];var u=G[t*3],v=G[t*3+1];t=G[t*3+2];var w=G[c*3],x=G[c*3+1],c=G[c*3+2];E.faces.push(new THREE.Face3(e,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(u,v,t),new THREE.Vector3(w,x,c)],null,m))}function v(c){var e,f,k,m;e=h(b,c);f=h(b,c+T);k=h(b,c+Q);m=h(b, +c+Z);c=p(b,c+$);E.faces.push(new THREE.Face4(e,f,k,m,null,null,E.materials[c]))}function A(c){var e,f,k,m,t,u,v,w;e=h(b,c);f=h(b,c+T);k=h(b,c+Q);m=h(b,c+Z);t=p(b,c+$);u=h(b,c+P);v=h(b,c+o);w=h(b,c+V);c=h(b,c+fa);t=E.materials[t];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var S=G[w*3],z=G[w*3+1];w=G[w*3+2];var A=G[c*3],B=G[c*3+1],c=G[c*3+2];E.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(S,z,w),new THREE.Vector3(A,B,c)],null,t))} function z(c){var e,f,k,m;e=h(b,c);f=h(b,c+ea);k=h(b,c+ha);c=J[e*2];m=J[e*2+1];e=J[f*2];var o=E.faceVertexUvs[0];f=J[f*2+1];var p=J[k*2];k=J[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,k));o.push(t)}function y(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+ga);k=h(b,c+ka);m=h(b,c+na);c=J[e*2];o=J[e*2+1];e=J[f*2];p=J[f*2+1];f=J[k*2];var t=E.faceVertexUvs[0];k=J[k*2+1];var u=J[m*2];m=J[m*2+1];var v=[];v.push(new THREE.UV(c,o));v.push(new THREE.UV(e,p));v.push(new THREE.UV(f, -k));v.push(new THREE.UV(u,m));t.push(v)}var E=this,F=0,C,G=[],J=[],M,K,B,L,Y,H,T,Q,Z,$,P,p,V,fa,ea,ha,ga,ka,na,aa,W,U,ia,ja,ta;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(E,f,c);C={signature:b.substr(F,8),header_bytes:w(b,F+8),vertex_coordinate_bytes:w(b,F+9),normal_coordinate_bytes:w(b,F+10),uv_coordinate_bytes:w(b,F+11),vertex_index_bytes:w(b,F+12),normal_index_bytes:w(b,F+13),uv_index_bytes:w(b,F+14),material_index_bytes:w(b,F+15),nvertices:h(b,F+16),nnormals:h(b,F+16+4),nuvs:h(b, +k));v.push(new THREE.UV(u,m));t.push(v)}var E=this,F=0,C,G=[],J=[],M,K,B,L,Y,H,T,Q,Z,$,P,o,V,fa,ea,ha,ga,ka,na,aa,W,U,ia,ja,ta;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(E,f,c);C={signature:b.substr(F,8),header_bytes:w(b,F+8),vertex_coordinate_bytes:w(b,F+9),normal_coordinate_bytes:w(b,F+10),uv_coordinate_bytes:w(b,F+11),vertex_index_bytes:w(b,F+12),normal_index_bytes:w(b,F+13),uv_index_bytes:w(b,F+14),material_index_bytes:w(b,F+15),nvertices:h(b,F+16),nnormals:h(b,F+16+4),nuvs:h(b, F+16+8),ntri_flat:h(b,F+16+12),ntri_smooth:h(b,F+16+16),ntri_flat_uv:h(b,F+16+20),ntri_smooth_uv:h(b,F+16+24),nquad_flat:h(b,F+16+28),nquad_smooth:h(b,F+16+32),nquad_flat_uv:h(b,F+16+36),nquad_smooth_uv:h(b,F+16+40)};F+=C.header_bytes;M=C.vertex_index_bytes;K=C.vertex_index_bytes*2;B=C.vertex_index_bytes*3;L=C.vertex_index_bytes*3+C.material_index_bytes;Y=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;H=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;T=C.vertex_index_bytes; -Q=C.vertex_index_bytes*2;Z=C.vertex_index_bytes*3;$=C.vertex_index_bytes*4;P=C.vertex_index_bytes*4+C.material_index_bytes;p=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;V=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;fa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;ea=C.uv_index_bytes;ha=C.uv_index_bytes*2;ga=C.uv_index_bytes;ka=C.uv_index_bytes*2;na=C.uv_index_bytes*3;c=C.vertex_index_bytes*3+C.material_index_bytes;ta=C.vertex_index_bytes* +Q=C.vertex_index_bytes*2;Z=C.vertex_index_bytes*3;$=C.vertex_index_bytes*4;P=C.vertex_index_bytes*4+C.material_index_bytes;o=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;V=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;fa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;ea=C.uv_index_bytes;ha=C.uv_index_bytes*2;ga=C.uv_index_bytes;ka=C.uv_index_bytes*2;na=C.uv_index_bytes*3;c=C.vertex_index_bytes*3+C.material_index_bytes;ta=C.vertex_index_bytes* 4+C.material_index_bytes;aa=C.ntri_flat*c;W=C.ntri_smooth*(c+C.normal_index_bytes*3);U=C.ntri_flat_uv*(c+C.uv_index_bytes*3);ia=C.ntri_smooth_uv*(c+C.normal_index_bytes*3+C.uv_index_bytes*3);ja=C.nquad_flat*ta;c=C.nquad_smooth*(ta+C.normal_index_bytes*4);ta=C.nquad_flat_uv*(ta+C.uv_index_bytes*4);F+=function(c){for(var f,k,h,n=C.vertex_coordinate_bytes*3,o=c+C.nvertices*n;c1){o=new THREE.MeshFaceMaterial;for(j=0;j1?e[1].substr(0,c):"0";e[1].length=0,m=k.indexOf("(")>=0,n;if(h)f=k.split("."),k=f.shift(),f.shift();else if(m){n=k.split("(");k=n.shift(); -for(f=0;f=0,m=k.indexOf("(")>=0,n;if(h)f=k.split("."),k=f.shift(),f.shift();else if(m){n=k.split("(");k=n.shift(); +for(f=0;fc){u=t.output[p];break}m=u!==void 0?u instanceof THREE.Matrix4? -m.multiply(m,u):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};o.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;bc){t=p.output[o];break}m=t!==void 0?t instanceof THREE.Matrix4? +m.multiply(m,t):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};u.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b=0,f=b.indexOf("(")>=0,k,h;if(e)c=b.split("."),b=c.shift(),h=c.shift();else if(f){k=b.split("(");b=k.shift();for(c=0;c=0,f=b.indexOf("(")>=0,k,h;if(e)c=b.split("."),b=c.shift(),h=c.shift();else if(f){k=b.split("(");b=k.shift();for(c=0;c1&&(Y=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(M,Y);object.name=v;object.position.set(C[0],C[1],C[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=F.visible;V.scene.add(object);V.objects[v]=object;F.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),V.scene.collisions.colliders.push(b)); if(F.castsShadow)b=new THREE.ShadowVolume(M),V.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}}else C=F.position,r=F.rotation,q=F.quaternion,s=F.scale,q=0,object=new THREE.Object3D,object.name=v,object.position.set(C[0],C[1],C[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0], -s[1],s[2]),object.visible=F.visible!==void 0?F.visible:!1,V.scene.add(object),V.objects[v]=object,V.empties[v]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}function u(b){return function(c){V.geometries[b]=c;n();Z-=1;e.onLoadComplete();w()}}function t(b){return function(c){V.geometries[b]=c}}function w(){e.callbackProgress({totalModels:P,totalTextures:p,loadedModels:P-Z,loadedTextures:p-$},V);e.onLoadProgress();Z==0&&$==0&&c(V)}var o,x, -v,A,z,y,E,F,C,G,J,M,K,B,L,Y,H,T,Q,Z,$,P,p,V;T=b.data;L=new THREE.BinaryLoader;Q=new THREE.JSONLoader;$=Z=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in T.objects)if(F=T.objects[v],F.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(T.transform){b=T.transform.position;G=T.transform.rotation;var fa=T.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);G&&V.scene.rotation.set(G[0], +s[1],s[2]),object.visible=F.visible!==void 0?F.visible:!1,V.scene.add(object),V.objects[v]=object,V.empties[v]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}function p(b){return function(c){V.geometries[b]=c;n();Z-=1;e.onLoadComplete();w()}}function t(b){return function(c){V.geometries[b]=c}}function w(){e.callbackProgress({totalModels:P,totalTextures:o,loadedModels:P-Z,loadedTextures:o-$},V);e.onLoadProgress();Z==0&&$==0&&c(V)}var u,x, +v,A,z,y,E,F,C,G,J,M,K,B,L,Y,H,T,Q,Z,$,P,o,V;T=b.data;L=new THREE.BinaryLoader;Q=new THREE.JSONLoader;$=Z=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in T.objects)if(F=T.objects[v],F.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(T.transform){b=T.transform.position;G=T.transform.rotation;var fa=T.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);G&&V.scene.rotation.set(G[0], G[1],G[2]);fa&&V.scene.scale.set(fa[0],fa[1],fa[2]);(b||G||fa)&&V.scene.updateMatrix()}b=function(){$-=1;w();e.onLoadComplete()};for(z in T.cameras)G=T.cameras[z],G.type=="perspective"?K=new THREE.PerspectiveCamera(G.fov,G.aspect,G.near,G.far):G.type=="ortho"&&(K=new THREE.OrthographicCamera(G.left,G.right,G.top,G.bottom,G.near,G.far)),C=G.position,G=G.target,K.position.set(C[0],C[1],C[2]),K.target=new THREE.Vector3(G[0],G[1],G[2]),V.cameras[z]=K;for(A in T.lights)z=T.lights[A],K=z.color!==void 0? z.color:16777215,G=z.intensity!==void 0?z.intensity:1,z.type=="directional"?(C=z.direction,H=new THREE.DirectionalLight(K,G),H.position.set(C[0],C[1],C[2]),H.position.normalize()):z.type=="point"?(C=z.position,d=z.distance,H=new THREE.PointLight(K,G,d),H.position.set(C[0],C[1],C[2])):z.type=="ambient"&&(H=new THREE.AmbientLight(K)),V.scene.add(H),V.lights[A]=H;for(y in T.fogs)A=T.fogs[y],A.type=="linear"?B=new THREE.Fog(0,A.near,A.far):A.type=="exp2"&&(B=new THREE.FogExp2(0,A.density)),G=A.color, -B.color.setRGB(G[0],G[1],G[2]),V.fogs[y]=B;if(V.cameras&&T.defaults.camera)V.currentCamera=V.cameras[T.defaults.camera];if(V.fogs&&T.defaults.fog)V.scene.fog=V.fogs[T.defaults.fog];G=T.defaults.bgcolor;V.bgColor=new THREE.Color;V.bgColor.setRGB(G[0],G[1],G[2]);V.bgColorAlpha=T.defaults.bgalpha;for(o in T.geometries)if(y=T.geometries[o],y.type=="bin_mesh"||y.type=="ascii_mesh")Z+=1,e.onLoadStart();P=Z;for(o in T.geometries)y=T.geometries[o],y.type=="cube"?(M=new THREE.CubeGeometry(y.width,y.height, -y.depth,y.segmentsWidth,y.segmentsHeight,y.segmentsDepth,null,y.flipped,y.sides),V.geometries[o]=M):y.type=="plane"?(M=new THREE.PlaneGeometry(y.width,y.height,y.segmentsWidth,y.segmentsHeight),V.geometries[o]=M):y.type=="sphere"?(M=new THREE.SphereGeometry(y.radius,y.segmentsWidth,y.segmentsHeight),V.geometries[o]=M):y.type=="cylinder"?(M=new THREE.CylinderGeometry(y.topRad,y.botRad,y.height,y.radSegs,y.heightSegs),V.geometries[o]=M):y.type=="torus"?(M=new THREE.TorusGeometry(y.radius,y.tube,y.segmentsR, -y.segmentsT),V.geometries[o]=M):y.type=="icosahedron"?(M=new THREE.IcosahedronGeometry(y.subdivisions),V.geometries[o]=M):y.type=="bin_mesh"?L.load({model:f(y.url,T.urlBaseType),callback:u(o)}):y.type=="ascii_mesh"?Q.load({model:f(y.url,T.urlBaseType),callback:u(o)}):y.type=="embedded_mesh"&&(y=T.embeds[y.id])&&Q.createModel(y,t(o),"");for(E in T.textures)if(o=T.textures[E],o.url instanceof Array){$+=o.url.length;for(L=0;L=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,h=0;h<8;h++){for(var k=0,m=0;m>1^-(n&1);e[8*m+h]=k}f+=c}c=b.length-f;k=new Uint16Array(c);for(h=m=0;h=this.maxCount-3&&n(this)};this.begin=function(){this.count=0; -this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(u=this.size-1);var x=Math.floor(t-n);x<1&&(x=1);t=Math.floor(t+n);t>this.size-1&&(t=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size- -1);for(var A,z,y,E,F,C;o0&&(this.field[y+A]+=E)}}};this.addPlaneX=function(b,c){var h,k,m,n,u,t=this.size,w=this.yd,o=this.zd,x=this.field,v=t*Math.sqrt(b/c);v>t&&(v=t);for(h=0;h0)for(k=0;kw&&(A=w);for(k=0;k0){u=k*o;for(h=0;hsize&&(dist=size);for(m=0;m0){u=zd*m;for(k=0;k=this.maxCount-3&&n(this)};this.begin=function(){this.count=0; +this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(p=this.size-1);var x=Math.floor(t-n);x<1&&(x=1);t=Math.floor(t+n);t>this.size-1&&(t=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size- +1);for(var A,z,y,E,F,C;u0&&(this.field[y+A]+=E)}}};this.addPlaneX=function(b,c){var h,k,m,n,p,t=this.size,w=this.yd,u=this.zd,x=this.field,v=t*Math.sqrt(b/c);v>t&&(v=t);for(h=0;h0)for(k=0;kw&&(A=w);for(k=0;k0){p=k*u;for(h=0;hsize&&(dist=size);for(m=0;m0){p=zd*m;for(k=0;kk?this.hits.push(h):this.hits.unshift(h),k=f;return this.hits}; THREE.CollisionSystem.prototype.rayCastNearest=function(b){var c=this.rayCastAll(b);if(c.length==0)return null;for(var e=0;c[e]instanceof THREE.MeshCollider;){var f=this.rayMesh(b,c[e]);if(f.distc.length)return null;return c[e]}; THREE.CollisionSystem.prototype.rayCast=function(b,c){if(c instanceof THREE.PlaneCollider)return this.rayPlane(b,c);else if(c instanceof THREE.SphereCollider)return this.raySphere(b,c);else if(c instanceof THREE.BoxCollider)return this.rayBox(b,c);else if(c instanceof THREE.MeshCollider&&c.box)return this.rayBox(b,c.box)}; -THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,k=0;k=n*h))return Number.MAX_VALUE;m/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(m);n.addSelf(b.origin);Math.abs(k.x)> +THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,k=0;k=n*h))return Number.MAX_VALUE;m/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(m);n.addSelf(b.origin);Math.abs(k.x)> Math.abs(k.y)?Math.abs(k.x)>Math.abs(k.z)?(b=n.y-c.y,k=e.y-c.y,h=f.y-c.y,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(k.y)>Math.abs(k.z)?(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y);c=k*f-e*h;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-n*h)*c;if(!(f>=0))return Number.MAX_VALUE;c*=k*n-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return m}; THREE.CollisionSystem.prototype.makeRayLocal=function(b,c){var e=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(c.matrixWorld,e);var f=THREE.CollisionSystem.__r;f.origin.copy(b.origin);f.direction.copy(b.direction);e.multiplyVector3(f.origin);e.rotateAxis(f.direction);f.direction.normalize();return f}; -THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,h=0,k=0,m=0,n=0,u=0,t=!0;e.origin.xc.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,t=!1,m=1);e.origin.yc.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y, -t=!1,n=1);e.origin.zc.max.z&&(k=c.max.z-e.origin.z,k/=e.direction.z,t=!1,u=1);if(t)return-1;t=0;h>f&&(t=1,f=h);k>f&&(t=2,f=k);switch(t){case 0:n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(m,0,0);break;case 1:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z* -f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;c.normal.set(0,0,u)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE}; +THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,h=0,k=0,m=0,n=0,p=0,t=!0;e.origin.xc.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,t=!1,m=1);e.origin.yc.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y, +t=!1,n=1);e.origin.zc.max.z&&(k=c.max.z-e.origin.z,k/=e.direction.z,t=!1,p=1);if(t)return-1;t=0;h>f&&(t=1,f=h);k>f&&(t=2,f=k);switch(t){case 0:n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(m,0,0);break;case 1:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z* +f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;c.normal.set(0,0,p)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE}; THREE.CollisionSystem.prototype.raySphere=function(b,c){var e=c.center.clone().subSelf(b.origin);if(e.lengthSq=0)return Math.abs(f)-Math.sqrt(e);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4; THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(b){b.geometry.computeBoundingBox();var c=b.geometry.boundingBox,e=new THREE.Vector3(c.x[0],c.y[0],c.z[0]),c=new THREE.Vector3(c.x[1],c.y[1],c.z[1]),e=new THREE.BoxCollider(e,c);e.mesh=b;return e};THREE.CollisionUtils.MeshAABB=function(b){var c=THREE.CollisionUtils.MeshOBB(b);c.min.addSelf(b.position);c.max.addSelf(b.position);c.dynamic=!1;return c}; THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))}; -if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,m=new THREE.Matrix4,n=new THREE.Matrix4,u,t,w;h.matrixAutoUpdate=k.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},o=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.PerspectiveCamera(53,1,1,1E4);v.position.z= -2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:o},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); -var A=new THREE.Scene;A.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);o.width=b;o.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(u!==e.aspect||t!==e.near||w!==e.fov){u=e.aspect;t=e.near;w=e.fov;var E=e.projectionMatrix.clone(),F=125/30*0.5,C=F*t/125,G=t*Math.tan(w*Math.PI/360),J;m.n14=F;n.n14=-F;F=-G*u+C;J=G*u+C;E.n11=2*t/(J-F);E.n13=(J+F)/(J-F);h.projectionMatrix=E.clone();F=-G*u-C;J=G*u-C;E.n11=2*t/(J-F);E.n13= -(J+F)/(J-F);k.projectionMatrix=E.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=t;h.far=e.far;f.call(c,b,h,o,!0);k.matrix=e.matrixWorld.clone().multiplySelf(m);k.update(null,!0);k.position.copy(e.position);k.near=t;k.far=e.far;f.call(c,b,k,x,!0);f.call(c,A,v)}}; +if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,m=new THREE.Matrix4,n=new THREE.Matrix4,p,t,w;h.matrixAutoUpdate=k.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},u=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.PerspectiveCamera(53,1,1,1E4);v.position.z= +2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:u},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); +var A=new THREE.Scene;A.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);u.width=b;u.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(p!==e.aspect||t!==e.near||w!==e.fov){p=e.aspect;t=e.near;w=e.fov;var E=e.projectionMatrix.clone(),F=125/30*0.5,C=F*t/125,G=t*Math.tan(w*Math.PI/360),J;m.n14=F;n.n14=-F;F=-G*p+C;J=G*p+C;E.n11=2*t/(J-F);E.n13=(J+F)/(J-F);h.projectionMatrix=E.clone();F=-G*p-C;J=G*p-C;E.n11=2*t/(J-F);E.n13= +(J+F)/(J-F);k.projectionMatrix=E.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=t;h.far=e.far;f.call(c,b,h,u,!0);k.matrix=e.matrixWorld.clone().multiplySelf(m);k.update(null,!0);k.position.copy(e.position);k.near=t;k.far=e.far;f.call(c,b,k,x,!0);f.call(c,A,v)}}; if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,h,k,m=new THREE.PerspectiveCamera;m.target=new THREE.Vector3(0,0,0);var n=new THREE.PerspectiveCamera;n.target=new THREE.Vector3(0,0,0);c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;this.setSize=function(b,f){e.call(c,b,f);h=b/2;k=f};this.render=function(b,e){this.clear();m.fov=e.fov;m.aspect=0.5*e.aspect;m.near=e.near;m.far= e.far;m.updateProjectionMatrix();m.position.copy(e.position);m.target.copy(e.target);m.translateX(c.separation);m.lookAt(m.target);n.projectionMatrix=m.projectionMatrix;n.position.copy(e.position);n.target.copy(e.target);n.translateX(-c.separation);n.lookAt(n.target);this.setViewport(0,0,h,k);f.call(c,b,m);this.setViewport(h,0,h,k);f.call(c,b,n,!1)}}; diff --git a/build/custom/ThreeExtras.js b/build/custom/ThreeExtras.js index dd29d352..36e050ef 100644 --- a/build/custom/ThreeExtras.js +++ b/build/custom/ThreeExtras.js @@ -1,6 +1,6 @@ // ThreeExtras.js r46dev - http://github.com/mrdoob/three.js -THREE.ColorUtils={adjustHSV:function(a,b,c,e){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.ColorUtils.clamp(f.h+b,0,1);f.s=THREE.ColorUtils.clamp(f.s+c,0,1);f.v=THREE.ColorUtils.clamp(f.v+e,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,b){var c=a.r,e=a.g,f=a.b,h=Math.max(Math.max(c,e),f),g=Math.min(Math.min(c,e),f);if(g==h)g=c=0;else{var k=h-g,g=k/h,c=c==h?(e-f)/k:e==h?2+(f-c)/k:4+(c-e)/k;c/=6;c<0&&(c+=1);c>1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=g;b.v=h;return b}, -clamp:function(a,b,c){return ac?c:a}};THREE.ColorUtils.__hsv={h:0,s:0,v:0}; +THREE.ColorUtils={adjustHSV:function(a,b,c,e){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.MathUtils.clamp(f.h+b,0,1);f.s=THREE.MathUtils.clamp(f.s+c,0,1);f.v=THREE.MathUtils.clamp(f.v+e,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,b){var c=a.r,e=a.g,f=a.b,h=Math.max(Math.max(c,e),f),g=Math.min(Math.min(c,e),f);if(g==h)g=c=0;else{var k=h-g,g=k/h,c=c==h?(e-f)/k:e==h?2+(f-c)/k:4+(c-e)/k;c/=6;c<0&&(c+=1);c>1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=g;b.v=h;return b}}; +THREE.ColorUtils.__hsv={h:0,s:0,v:0}; THREE.GeometryUtils={merge:function(a,b){var c,e,f=a.vertices.length,h=b instanceof THREE.Mesh?b.geometry:b,g=a.vertices,k=h.vertices,l=a.faces,m=h.faces,n=a.faceVertexUvs[0],h=h.faceVertexUvs[0];if(b instanceof THREE.Mesh)b.matrixAutoUpdate&&b.updateMatrix(),c=b.matrix,e=new THREE.Matrix4,e.extractRotation(c,b.scale);for(var o=0,t=k.length;oc?c:a},mapLinear:function(a,b,c,e,f){return(a-b)*(f-e)/(c-b)+e}};THREE.SceneUtils={showHierarchy:function(a,b){THREE.SceneUtils.traverseHierarchy(a,function(a){a.visible=b})},traverseHierarchy:function(a,b){var c,e,f=a.children.length;for(e=0;ec?c:a},clampBottom:function(a,b){return athis.heightMax?this.heightMax:this.object.position.y)-this.heightMin)*this.heightCoef:0;var c=this.tdiff*this.movementSpeed;(this.moveForward||this.autoForward&& -!this.moveBackward)&&this.object.translateZ(-(c+this.autoSpeedFactor));this.moveBackward&&this.object.translateZ(c);this.moveLeft&&this.object.translateX(-c);this.moveRight&&this.object.translateX(c);this.moveUp&&this.object.translateY(c);this.moveDown&&this.object.translateY(-c);c=this.tdiff*this.lookSpeed;this.activeLook||(c=0);this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon* -Math.PI/180;var a=this.target,b=this.object.position;a.x=b.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=b.y+100*Math.cos(this.phi);a.z=b.z+100*Math.sin(this.phi)*Math.sin(this.theta)}a=1;this.constrainVertical&&(a=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c*a);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax- -this.verticalMin)/(Math.PI-0)+this.verticalMin;a=this.target;b=this.object.position;a.x=b.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=b.y+100*Math.cos(this.phi);a.z=b.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(a)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup", -c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)}; +!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}};this.update=function(){var a=(new Date).getTime();this.tdiff=(a-this.lastUpdate)/1E3;this.lastUpdate=a;if(!this.freeze){this.autoSpeedFactor=this.heightSpeed?this.tdiff*(THREE.MathUtils.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin)*this.heightCoef:0;var c=this.tdiff*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(c+ +this.autoSpeedFactor));this.moveBackward&&this.object.translateZ(c);this.moveLeft&&this.object.translateX(-c);this.moveRight&&this.object.translateX(c);this.moveUp&&this.object.translateY(c);this.moveDown&&this.object.translateY(-c);c=this.tdiff*this.lookSpeed;this.activeLook||(c=0);this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var a=this.target,b=this.object.position; +a.x=b.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=b.y+100*Math.cos(this.phi);a.z=b.z+100*Math.sin(this.phi)*Math.sin(this.theta)}a=1;this.constrainVertical&&(a=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c*a);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=THREE.MathUtils.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax); +a=this.target;b=this.object.position;a.x=b.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=b.y+100*Math.cos(this.phi);a.z=b.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(a)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown", +c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)}; THREE.PathControls=function(a,b){function c(a){if((a*=2)<1)return 0.5*a*a;return-0.5*(--a*(a-2)-1)}function e(a,c){return function(){c.apply(a,arguments)}}function f(a,c,b,e){var g={name:b,fps:0.6,length:e,hierarchy:[]},h,f=c.getControlPointsArray(),k=c.getLength(),p=f.length,z=0;h=p-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:f[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[h]={time:e,pos:f[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h=0?a:a+g;a=this.verticalAngleMap.srcRange; -b=this.verticalAngleMap.dstRange;var e=b[1]-b[0];this.phi=c(((this.phi-a[0])*(b[1]-b[0])/(a[1]-a[0])+b[0]-b[0])/e)*e+b[0];a=this.horizontalAngleMap.srcRange;b=this.horizontalAngleMap.dstRange;e=b[1]-b[0];this.theta=c(((this.theta-a[0])*(b[1]-b[0])/(a[1]-a[0])+b[0]-b[0])/e)*e+b[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(a){this.domElement=== -document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}), +this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var g=Math.PI*2,k=Math.PI/180;this.update=function(){var a,b;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*k;this.theta=this.lon*k;b=this.phi%g;this.phi=b>=0?b:b+g;a=this.verticalAngleMap.srcRange; +b=this.verticalAngleMap.dstRange;a=THREE.MathUtils.mapLinear(this.phi,a[0],a[1],b[0],b[1]);var e=b[1]-b[0];this.phi=c((a-b[0])/e)*e+b[0];a=this.horizontalAngleMap.srcRange;b=this.horizontalAngleMap.dstRange;a=THREE.MathUtils.mapLinear(this.theta,a[0],a[1],b[0],b[1]);e=b[1]-b[0];this.theta=c((a-b[0])/e)*e+b[0];b=this.target.position;b.x=100*Math.sin(this.phi)*Math.cos(this.theta);b.y=100*Math.cos(this.phi);b.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= +function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}), b=new THREE.CubeGeometry(10,10,20),g=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(b,a);a=new THREE.Mesh(g,c);a.position.set(0,10,0);this.animation=f(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=f(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a= this.debugPath,c=this.spline,b=h(c,10),g=h(c,10),k=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(b,k);particleObj=new THREE.ParticleSystem(g,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.add(lineObj);particleObj.scale.set(1,1,1);a.add(particleObj);g=new THREE.SphereGeometry(1,16,8);k=new THREE.MeshBasicMaterial({color:65280});for(i=0;i 0 ) { - this.wheelOrientation = clamp( this.wheelOrientation - delta * this.WHEEL_ANGULAR_DECCELERATION, 0, this.MAX_WHEEL_ROTATION ); + this.wheelOrientation = THREE.MathUtils.clamp( this.wheelOrientation - delta * this.WHEEL_ANGULAR_DECCELERATION, 0, this.MAX_WHEEL_ROTATION ); } else { - this.wheelOrientation = clamp( this.wheelOrientation + delta * this.WHEEL_ANGULAR_DECCELERATION, - this.MAX_WHEEL_ROTATION, 0 ); + this.wheelOrientation = THREE.MathUtils.clamp( this.wheelOrientation + delta * this.WHEEL_ANGULAR_DECCELERATION, - this.MAX_WHEEL_ROTATION, 0 ); } @@ -360,8 +360,6 @@ THREE.Car = function () { }; - function clamp( x, a, b ) { return x < a ? a : ( x > b ? b : x ); } - function quadraticEaseOut( k ) { return - k * ( k - 2 ); } function cubicEaseOut( k ) { return --k * k * k + 1; } function circularEaseOut( k ) { return Math.sqrt( 1 - --k * k ); } diff --git a/examples/webgl_materials_cubemap_dynamic.html b/examples/webgl_materials_cubemap_dynamic.html index 3c5670f4..e9988eeb 100644 --- a/examples/webgl_materials_cubemap_dynamic.html +++ b/examples/webgl_materials_cubemap_dynamic.html @@ -873,14 +873,6 @@ } - function clamp( x, a, b ) { return x < a ? a : ( x > b ? b : x ); } - - function map_linear( x, sa, sb, ea, eb ) { - - return ( x - sa ) * ( eb - ea ) / ( sb - sa ) + ea; - - }; - function render() { var newTime = new Date().getTime(); @@ -889,7 +881,7 @@ // day / night - v = clamp( v + 0.5 * delta * vdir, 0.1, 0.9 ); + v = THREE.MathUtils.clamp( v + 0.5 * delta * vdir, 0.1, 0.9 ); scene.fog.color.setHSV( 0.51, 0.5, v ); renderer.setClearColor( scene.fog.color, 1 ); @@ -942,10 +934,10 @@ } - effectBloom.screenUniforms[ "opacity" ].value = map_linear( vnorm, 0, 1, 1, 0.75 ); + effectBloom.screenUniforms[ "opacity" ].value = THREE.MathUtils.mapLinear( vnorm, 0, 1, 1, 0.75 ); - ambientLight.color.setHSV( 0, 0, map_linear( vnorm, 0, 1, 0.07, 0.33 ) ); - groundBasic.color.setHSV( 0.1, 0.45, map_linear( vnorm, 0, 1, 0.725, 0.995 ) ); + ambientLight.color.setHSV( 0, 0, THREE.MathUtils.mapLinear( vnorm, 0, 1, 0.07, 0.33 ) ); + groundBasic.color.setHSV( 0.1, 0.45, THREE.MathUtils.mapLinear( vnorm, 0, 1, 0.725, 0.995 ) ); // blur diff --git a/src/extras/ColorUtils.js b/src/extras/ColorUtils.js index 1114f48d..63420246 100644 --- a/src/extras/ColorUtils.js +++ b/src/extras/ColorUtils.js @@ -3,21 +3,21 @@ */ THREE.ColorUtils = { - + adjustHSV : function ( color, h, s, v ) { var hsv = THREE.ColorUtils.__hsv; - + THREE.ColorUtils.rgbToHsv( color, hsv ); - hsv.h = THREE.ColorUtils.clamp( hsv.h + h, 0, 1 ); - hsv.s = THREE.ColorUtils.clamp( hsv.s + s, 0, 1 ); - hsv.v = THREE.ColorUtils.clamp( hsv.v + v, 0, 1 ); - + hsv.h = THREE.MathUtils.clamp( hsv.h + h, 0, 1 ); + hsv.s = THREE.MathUtils.clamp( hsv.s + s, 0, 1 ); + hsv.v = THREE.MathUtils.clamp( hsv.v + v, 0, 1 ); + color.setHSV( hsv.h, hsv.s, hsv.v ); }, - + // based on MochiKit implementation by Bob Ippolito rgbToHsv : function ( color, hsv ) { @@ -25,7 +25,7 @@ THREE.ColorUtils = { var r = color.r; var g = color.g; var b = color.b; - + var max = Math.max( Math.max( r, g ), b ); var min = Math.min( Math.min( r, g ), b ); @@ -63,7 +63,7 @@ THREE.ColorUtils = { hue += 1; } - + if ( hue > 1 ) { hue -= 1; @@ -71,24 +71,18 @@ THREE.ColorUtils = { } } - + if ( hsv === undefined ) { - + hsv = { h: 0, s: 0, v: 0 }; } - + hsv.h = hue; hsv.s = saturation; hsv.v = value; - - return hsv; - }, - - clamp: function ( x, a, b ) { - - return x < a ? a : ( x > b ? b : x ); + return hsv; } diff --git a/src/extras/MathUtils.js b/src/extras/MathUtils.js index 03db5ff0..c70746f8 100644 --- a/src/extras/MathUtils.js +++ b/src/extras/MathUtils.js @@ -10,9 +10,15 @@ THREE.MathUtils = { }, - mapLinear: function( x, sa, sb, ea, eb ) { + clampBottom: function ( x, a ) { - return ( x - sa ) * ( eb - ea ) / ( sb - sa ) + ea; + return x < a ? a : x; + + }, + + mapLinear: function( x, a1, a2, b1, b2 ) { + + return b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 ); } diff --git a/src/extras/controls/FirstPersonControls.js b/src/extras/controls/FirstPersonControls.js index 80ee2c1c..e121139d 100644 --- a/src/extras/controls/FirstPersonControls.js +++ b/src/extras/controls/FirstPersonControls.js @@ -183,7 +183,7 @@ THREE.FirstPersonControls = function ( object, domElement ) { if ( this.heightSpeed ) { - var y = clamp( this.object.position.y, this.heightMin, this.heightMax ); + var y = THREE.MathUtils.clamp( this.object.position.y, this.heightMin, this.heightMax ); var delta = y - this.heightMin; this.autoSpeedFactor = this.tdiff * ( delta * this.heightCoef ); @@ -247,7 +247,7 @@ THREE.FirstPersonControls = function ( object, domElement ) { if ( this.constrainVertical ) { - this.phi = map_linear( this.phi, 0, Math.PI, this.verticalMin, this.verticalMax ); + this.phi = THREE.MathUtils.mapLinear( this.phi, 0, Math.PI, this.verticalMin, this.verticalMax ); } @@ -281,22 +281,4 @@ THREE.FirstPersonControls = function ( object, domElement ) { }; - function map_linear( x, sa, sb, ea, eb ) { - - return ( x - sa ) * ( eb - ea ) / ( sb - sa ) + ea; - - }; - - function clamp_bottom( x, a ) { - - return x < a ? a : x; - - }; - - function clamp( x, a, b ) { - - return x < a ? a : ( x > b ? b : x ); - - }; - }; diff --git a/src/extras/controls/PathControls.js b/src/extras/controls/PathControls.js index d8ab3ee6..30a4aea1 100644 --- a/src/extras/controls/PathControls.js +++ b/src/extras/controls/PathControls.js @@ -79,7 +79,7 @@ THREE.PathControls = function ( object, domElement ) { srcRange = this.verticalAngleMap.srcRange; dstRange = this.verticalAngleMap.dstRange; - var tmpPhi = map_linear( this.phi, srcRange[ 0 ], srcRange[ 1 ], dstRange[ 0 ], dstRange[ 1 ] ); + var tmpPhi = THREE.MathUtils.mapLinear( this.phi, srcRange[ 0 ], srcRange[ 1 ], dstRange[ 0 ], dstRange[ 1 ] ); var tmpPhiFullRange = dstRange[ 1 ] - dstRange[ 0 ]; var tmpPhiNormalized = ( tmpPhi - dstRange[ 0 ] ) / tmpPhiFullRange; @@ -90,7 +90,7 @@ THREE.PathControls = function ( object, domElement ) { srcRange = this.horizontalAngleMap.srcRange; dstRange = this.horizontalAngleMap.dstRange; - var tmpTheta = map_linear( this.theta, srcRange[ 0 ], srcRange[ 1 ], dstRange[ 0 ], dstRange[ 1 ] ); + var tmpTheta = THREE.MathUtils.mapLinear( this.theta, srcRange[ 0 ], srcRange[ 1 ], dstRange[ 0 ], dstRange[ 1 ] ); var tmpThetaFullRange = dstRange[ 1 ] - dstRange[ 0 ]; var tmpThetaNormalized = ( tmpTheta - dstRange[ 0 ] ) / tmpThetaFullRange; @@ -132,18 +132,6 @@ THREE.PathControls = function ( object, domElement ) { }; - function cap( x, a, b ) { - - return ( x < a ) ? a : ( ( x > b ) ? b : x ); - - }; - - function map_linear( x, sa, sb, ea, eb ) { - - return ( x - sa ) * ( eb - ea ) / ( sb - sa ) + ea; - - }; - function distance( a, b ) { var dx = a[ 0 ] - b[ 0 ], From 912b6975308d4d5ce2d25ccabe98b19d84f8f95d Mon Sep 17 00:00:00 2001 From: alteredq Date: Wed, 12 Oct 2011 23:16:09 +0200 Subject: [PATCH 07/33] Added forgotten sittingBox.js animated model. --- examples/models/animated/sittingBox.js | 103 +++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 examples/models/animated/sittingBox.js diff --git a/examples/models/animated/sittingBox.js b/examples/models/animated/sittingBox.js new file mode 100644 index 00000000..2a008bd2 --- /dev/null +++ b/examples/models/animated/sittingBox.js @@ -0,0 +1,103 @@ +/* + * File generated with Blender 2.58 Exporter + * https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender/ + * + * vertices: 1226 + * faces: 1008 + * normals: 0 + * uvs: 0 + * colors: 0 + * materials: 1 + * edges: 0 + * morphTargets: 31 + * + */ + +var model = { + + "version" : 2, + + "scale" : 100.000000, + + "materials": [ { + "DbgColor" : 15658734, + "DbgIndex" : 0, + "DbgName" : "default", + "vertexColors" : false + }, + + { + "DbgColor" : 15597568, + "DbgIndex" : 1, + "DbgName" : "Material", + "colorAmbient" : [0.0, 0.0, 0.0], + "colorDiffuse" : [0.434594637671033, 0.434594637671033, 0.434594637671033], + "colorSpecular" : [0.10135135054588318, 0.10135135054588318, 0.10135135054588318], + "shading" : "Lambert", + "specularCoef" : 50, + "transparency" : 1.0, + "vertexColors" : false + }, + + { + "DbgColor" : 15597568, + "DbgIndex" : 1, + "DbgName" : "Material", + "colorAmbient" : [0.0, 0.0, 0.0], + "colorDiffuse" : [0.434594637671033, 0.434594637671033, 0.434594637671033], + "colorSpecular" : [0.10135135054588318, 0.10135135054588318, 0.10135135054588318], + "shading" : "Lambert", + "specularCoef" : 50, + "transparency" : 1.0, + "vertexColors" : false + }], + + "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-2,65,-5,-12,63,-3,0,71,6,-12,70,8,-5,76,-11,-15,74,-9,-3,82,2,-14,80,4,0,68,0,-13,66,2,-3,81,-5,-16,79,-3,-2,61,3,-8,60,5,-2,64,11,-6,64,11,-1,77,4,-13,74,7,-3,71,-10,-15,69,-8,0,75,-3,-16,72,0,-5,72,11,-7,63,-6,-9,82,4,-11,76,-12,-6,67,1,-10,82,-5,-5,61,4,-4,64,11,-7,77,8,-9,69,-11,-1,75,4,-13,73,7,-2,68,-8,-14,66,-6,0,72,-1,-15,69,1,-6,75,8,-8,66,-9,20,45,10,-31,35,7,20,49,8,-33,38,5,17,52,7,-32,43,3,13,53,7,-30,46,4,11,51,9,-27,45,6,11,47,11,-25,42,9,13,44,13,-25,38,10,17,43,12,-28,35,10,13,26,-22,-9,24,-23,12,31,-26,-11,28,-26,9,36,-26,-11,34,-27,5,39,-23,-10,39,-23,2,38,-18,-8,40,-18,2,32,-14,-5,35,-14,6,26,-14,-5,29,-13,10,25,-18,-6,25,-17,16,37,-15,-19,31,-16,15,32,-13,-16,28,-14,12,42,-16,-19,37,-17,7,43,-16,-15,41,-17,3,40,-13,-11,41,-14,3,35,-11,-8,37,-11,7,30,-9,-8,31,-9,12,29,-11,-12,27,-11,18,43,-4,-26,35,-6,18,39,-2,-23,31,-4,14,47,-5,-25,40,-7,10,48,-4,-22,43,-6,7,46,-2,-19,44,-4,7,41,0,-16,40,-1,10,37,0,-16,35,0,15,36,0,-19,31,-1,28,13,15,-30,10,31,30,15,18,-33,12,32,30,16,21,-34,15,35,27,16,24,-33,17,37,24,15,23,-29,17,37,22,13,20,-26,15,36,23,12,17,-25,12,33,25,12,14,-27,10,31,19,45,5,-30,34,5,22,47,9,-34,36,7,21,48,14,-35,39,11,18,48,17,-33,42,13,14,47,16,-29,42,14,11,45,12,-25,40,12,11,44,8,-23,37,9,15,44,5,-25,34,6,24,38,10,-34,28,14,22,36,6,-29,26,12,24,39,15,-35,32,17,21,39,19,-33,34,20,16,37,18,-28,35,21,14,35,14,-24,33,19,14,34,9,-23,29,15,17,34,6,-25,26,12,26,31,12,-33,23,19,24,29,8,-29,21,17,26,32,17,-35,26,22,23,31,20,-33,29,25,18,30,19,-28,29,26,16,28,15,-24,27,24,16,27,11,-23,24,20,20,28,8,-25,21,17,28,22,15,-33,17,26,26,21,12,-30,15,25,28,23,19,-34,20,29,25,23,22,-33,22,31,22,22,21,-29,22,32,19,20,18,-26,21,30,20,19,14,-24,18,27,22,19,12,-26,16,25,17,49,17,-32,40,14,19,53,12,-35,42,9,14,54,13,-31,46,10,12,48,15,-27,42,13,16,44,14,-27,37,12,21,47,12,-33,36,9,15,54,8,-32,45,4,10,51,9,-26,45,7,12,45,10,-24,40,8,17,44,8,-28,36,5,19,50,7,-32,39,3,14,48,5,-27,41,2,19,52,15,-34,41,12,16,52,16,-32,43,13,16,54,13,-34,45,9,20,48,15,-33,38,12,21,50,13,-35,39,9,14,49,17,-29,41,14,12,51,15,-29,45,12,17,46,16,-30,38,13,14,45,15,-27,39,13,19,45,14,-30,35,11,21,48,9,-33,37,6,19,51,10,-33,41,6,17,54,10,-34,44,6,14,55,11,-32,46,7,11,53,12,-29,46,9,11,50,12,-27,44,10,12,46,13,-25,41,10,14,43,12,-25,38,10,17,43,11,-27,35,9,20,45,10,-31,35,7,17,52,7,-32,42,3,12,53,8,-29,46,5,10,47,9,-24,43,7,14,44,8,-25,37,6,19,46,7,-30,37,4,17,49,5,-30,40,2,14,51,6,-29,44,3,11,50,7,-26,44,4,12,46,7,-25,41,4,15,46,6,-27,38,3,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-33,-9,37,-31,10,38,-27,-10,35,-25,8,36,-22,-7,34,-20,1,34,-18,0,38,-34,5,52,-31,-9,50,-29,8,51,-25,-11,49,-23,5,50,-19,-7,48,-18,0,49,-16,-1,51,-31,9,45,-26,-10,42,-24,7,46,-32,-9,44,-30,7,43,-20,-6,41,-18,0,42,-17,-1,45,-32,4,56,-28,-9,51,-28,9,51,-26,-10,45,-26,7,45,-25,-5,41,-24,1,41,-24,-2,55,-28,4,60,-22,-10,54,-21,8,56,-18,-12,49,-17,7,51,-13,-7,45,-12,0,47,-12,-4,58,-23,9,53,-22,-11,46,-21,4,58,-25,-10,52,-25,7,48,-17,-6,44,-17,1,44,-16,-3,57,-26,3,60,-22,-11,55,-22,8,56,-18,-12,49,-17,7,51,-13,-7,46,-12,0,47,-12,-4,58,-23,0,66,-9,-10,62,-8,3,63,-8,-11,58,-8,1,59,-8,-7,56,-7,-2,56,-7,-5,66,-9,-2,65,-8,-8,63,-8,0,62,-7,-8,59,-8,0,59,-7,-6,57,-7,-2,56,-7,-5,66,-8,-3,65,-3,-8,63,-3,-1,63,-2,-8,61,-3,-1,60,-2,-6,58,-3,-3,58,-2,-6,65,-3,-3,64,-3,-7,63,-3,-1,63,-1,-8,60,-2,-1,60,0,-6,58,0,-3,58,0,-5,65,-4,-4,67,-1,-9,65,-2,-2,65,0,-9,62,-1,-2,61,0,-7,60,0,-4,59,0,-7,67,-2,16,57,-7,-17,57,-10,14,55,-7,-15,55,-9,12,54,-7,-14,56,-6,10,56,-6,-14,58,-4,9,59,-6,-15,60,-4,11,61,-6,-17,61,-5,13,61,-6,-18,61,-8,16,60,-7,-18,59,-10,18,55,11,-31,47,0,17,53,11,-29,46,0,15,53,11,-28,46,2,13,54,12,-28,48,3,13,56,12,-29,50,4,14,58,12,-30,51,3,17,58,12,-31,51,1,18,57,11,-32,49,0,16,53,4,-24,49,-3,18,55,4,-25,50,-4,14,53,4,-22,49,0,11,54,5,-22,51,1,11,57,5,-24,53,1,13,59,5,-25,55,0,16,59,5,-27,54,-2,18,58,4,-27,53,-4,15,54,0,-20,52,-5,17,56,-1,-22,53,-7,13,53,0,-18,52,-3,11,55,0,-18,54,-1,10,58,0,-20,56,-1,12,60,0,-21,58,-2,15,60,0,-23,57,-4,17,59,0,-23,56,-6,15,54,-4,-17,54,-7,16,56,-4,-19,55,-8,12,54,-3,-16,54,-5,10,56,-3,-16,56,-3,10,58,-3,-17,58,-2,11,60,-3,-19,60,-4,14,61,-3,-20,59,-6,16,59,-4,-20,57,-8,5,49,26,-24,43,18,4,49,25,-23,44,18,3,48,24,-21,44,17,4,47,23,-21,44,16,5,46,23,-21,42,16,6,46,24,-22,41,16,7,47,26,-24,41,17,6,48,26,-25,42,17,17,58,14,-34,49,3,16,58,13,-33,51,3,15,57,11,-30,51,1,15,55,11,-29,49,0,17,53,11,-30,47,0,18,53,12,-31,46,0,19,55,14,-33,46,1,19,57,15,-34,47,2,7,51,22,-25,46,14,8,51,23,-27,45,14,6,50,20,-24,46,13,7,49,20,-23,45,12,8,48,20,-23,43,11,9,48,21,-25,42,11,10,49,22,-26,42,12,10,50,23,-27,43,13,13,57,15,-31,50,6,15,57,17,-32,48,6,12,55,14,-29,50,5,13,53,13,-27,48,3,15,51,13,-28,46,2,16,51,14,-29,44,2,17,53,16,-31,44,3,16,55,17,-32,46,5,15,58,14,-32,50,3,17,58,15,-34,49,3,13,56,12,-30,50,3,14,54,12,-29,49,2,16,53,12,-29,47,1,18,53,13,-31,45,0,19,54,14,-33,46,1,18,56,15,-34,47,2,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,14,60,-11,-18,61,-11,12,56,-10,-16,56,-10,0,55,-11,-4,55,-11,4,62,-17,-7,62,-17,13,62,-5,-17,63,-5,11,56,-4,-16,56,-4,0,56,-8,-3,55,-7,5,65,-7,-8,65,-7,7,54,-11,-12,54,-11,11,58,-15,-15,58,-15,7,58,-4,-12,58,-4,9,64,-5,-13,64,-5,13,57,-11,-17,58,-11,3,59,-17,-7,59,-16,13,59,-3,-17,59,-3,6,59,-11,-10,59,-11,10,55,-14,-15,56,-14,8,60,-4,-12,60,-3,11,55,-7,-15,55,-7,14,62,-8,-17,63,-8,0,55,-9,-3,54,-9,4,65,-12,-8,65,-12,6,54,-7,-11,54,-7,10,64,-11,-13,65,-10,10,55,-10,-14,55,-10,12,59,-13,-16,60,-13,9,57,-3,-14,57,-3,11,63,-5,-15,63,-5,11,56,-12,-16,57,-12,10,60,-3,-14,60,-3,9,55,-7,-13,55,-7,12,63,-9,-15,64,-9,-2,39,31,-17,34,25,-3,39,29,-16,33,22,1,43,25,-21,37,19,3,43,27,-22,39,21,-3,41,31,-15,36,24,-5,41,29,-14,34,22,0,45,26,-19,39,18,0,46,28,-18,41,20,1,46,29,-19,42,21,0,46,27,-18,41,19,-3,41,31,-14,36,22,-2,41,33,-14,37,25,4,43,28,-22,39,23,2,43,26,-21,38,20,-1,38,30,-16,34,23,0,38,32,-17,35,26,1,39,33,-17,36,27,0,38,31,-16,35,25,4,43,27,-22,38,22,5,44,29,-22,40,23,0,40,34,-15,38,26,-1,40,32,-14,37,24,1,46,29,-19,42,20,3,46,30,-20,43,22,4,46,31,-21,43,24,2,46,30,-20,43,21,0,40,33,-14,39,24,2,40,34,-15,40,27,6,44,29,-22,41,25,4,44,28,-22,40,22,1,38,31,-16,37,25,3,39,33,-16,38,27,6,44,30,-23,42,24,1,43,25,-22,38,18,3,45,23,-23,40,17,6,46,27,-24,43,21,5,46,31,-21,43,23,0,46,25,-19,39,18,1,47,24,-20,41,16,5,48,28,-23,44,20,1,47,29,-19,42,20,3,48,26,-21,43,18,4,42,28,-23,39,22,5,45,25,-24,41,19,3,36,32,-15,37,29,2,36,31,-14,36,28,1,40,31,-16,37,25,3,40,32,-17,38,26,3,36,33,-13,38,29,1,36,33,-13,37,27,0,39,33,-15,38,25,2,39,34,-15,39,26,2,35,32,-13,36,28,3,35,33,-13,37,29,2,36,32,-14,36,28,3,36,32,-14,37,29,4,36,31,-14,36,30,3,35,31,-14,35,29,4,35,32,-13,36,30,2,34,31,-12,35,29,3,35,31,-12,35,29,4,35,31,-13,35,30,2,35,32,-14,34,29,3,35,32,-14,35,30,3,37,32,-14,34,31,2,37,31,-13,33,30,4,37,31,-13,34,32,3,36,30,-13,33,31,2,35,29,-12,29,30,3,35,30,-12,30,31,1,36,30,-13,30,29,2,36,31,-14,30,30,1,35,32,-14,32,30,0,34,31,-13,31,28,2,33,31,-12,32,30,1,33,30,-12,31,29,0,33,31,-12,32,28,2,33,32,-12,33,30,1,35,30,-13,32,28,2,35,32,-14,32,29,1,36,33,-14,34,28,0,36,32,-13,33,27,0,35,34,-12,34,29,0,34,32,-12,34,27,0,40,34,-15,38,26,-1,39,33,-14,37,24,0,35,33,-12,34,27,0,35,34,-12,35,28,1,40,32,-17,36,26,0,40,31,-16,35,25,0,35,31,-13,33,27,1,36,33,-14,34,29,0,36,32,-13,32,27,-1,35,31,-13,31,25,-2,40,30,-16,34,23,0,40,31,-16,35,25,-2,35,33,-11,33,27,-3,35,32,-11,32,25,-4,40,31,-14,36,23,-2,40,33,-14,36,25,-2,34,31,-11,32,26,-1,35,33,-11,32,27,-2,36,31,-12,31,26,-1,36,33,-13,32,27,0,36,31,-12,30,28,-1,36,30,-12,29,27,0,35,31,-10,31,28,0,34,30,-10,30,27,0,35,29,-10,29,27,0,35,30,-10,30,29,-1,36,30,-11,29,27,0,36,31,-12,30,29,0,38,30,-11,28,29,0,38,29,-11,27,28,1,37,29,-10,28,30,0,37,28,-10,27,29,-1,37,28,-9,28,27,0,37,29,-10,28,28,-1,37,28,-11,28,27,-1,37,29,-11,28,28,-1,36,30,-12,29,27,-2,36,29,-11,29,26,0,35,30,-10,30,27,-1,35,29,-10,29,26,-2,35,29,-10,30,25,-1,35,31,-11,31,27,-2,36,29,-12,29,25,-1,37,30,-12,30,27,-3,37,31,-13,31,26,-4,37,30,-12,30,25,-2,35,32,-11,32,26,-4,35,30,-11,31,24,-4,41,31,-15,36,24,-5,40,30,-15,34,22,-4,36,31,-12,32,24,-3,36,32,-12,33,26,-2,41,30,-16,34,24,-3,40,28,-16,33,22,-3,36,30,-13,31,24,-2,36,31,-13,32,26,-2,35,29,-10,30,26,-2,36,29,-11,29,26,-1,36,30,-12,30,27,-1,35,30,-10,30,27,-4,35,31,-11,31,24,-4,36,30,-13,30,24,-2,36,31,-13,31,26,-3,36,32,-12,32,26,-1,35,33,-11,33,27,-1,36,32,-13,32,27,-2,35,31,-12,31,26,-3,35,32,-11,32,25,0,35,31,-10,30,29,0,36,31,-12,30,28,-1,36,30,-11,29,27,0,35,30,-10,30,27,0,35,33,-12,34,27,0,36,32,-13,33,27,1,36,33,-14,34,29,0,35,34,-12,35,29,1,33,31,-12,32,29,0,34,31,-13,31,28,2,35,32,-14,32,30,2,33,32,-12,32,30,3,36,33,-13,37,29,3,36,32,-14,37,29,2,36,32,-14,36,28,1,35,33,-13,37,28,4,34,32,-13,36,30,4,35,32,-14,35,30,2,35,31,-14,35,29,3,34,31,-12,35,29,-2,41,25,-16,36,18,-1,41,28,-18,35,20,0,39,26,-19,34,18,0,39,24,-17,35,16,-3,38,26,-15,32,19,-2,38,28,-17,33,20,0,37,27,-18,32,19,-1,37,25,-16,31,17,2,42,27,-22,37,21,-1,43,29,-17,38,21,2,44,23,-21,38,16,0,45,24,-20,40,17,-1,38,25,-17,33,17,-2,39,26,-16,34,18,0,38,27,-19,33,18,-1,40,28,-18,34,20,-1,36,26,-16,30,18,-3,37,27,-15,31,20,0,36,27,-18,32,19,-2,37,28,-17,32,20,-2,35,29,-18,30,22,-1,34,29,-18,29,21,-3,34,28,-17,29,22,-2,33,28,-17,28,20,-2,40,25,-16,35,18,-1,40,28,-18,34,20,0,39,27,-19,33,18,0,39,24,-17,34,16,0,37,27,-18,32,19,-1,36,25,-16,31,18,-2,38,28,-17,32,20,-3,37,26,-15,32,19,0,44,27,-19,38,19,5,60,-13,-11,54,-12,1,63,-15,-10,59,-15,7,55,-10,-9,49,-9,0,51,-9,-5,62,-16,4,55,-11,-8,55,-11,7,60,-16,-11,60,-16,3,56,-6,-7,56,-6,7,64,-6,-10,64,-6,6,57,-15,-11,57,-15,6,61,-6,-10,60,-6,2,54,-8,-7,54,-8,7,65,-11,-10,65,-11], + + "morphTargets": [{ "name": "animation_000000", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-7,66,-7,-17,67,-7,-6,70,5,-17,71,5,-5,78,-11,-16,79,-11,-5,81,3,-15,82,3,-5,67,0,-19,69,0,-3,81,-4,-17,83,-4,-10,61,1,-15,62,1,-10,63,8,-14,63,8,-4,75,5,-17,76,5,-5,73,-11,-17,74,-11,-3,75,-3,-19,77,-3,-11,71,10,-12,66,-9,-10,83,4,-11,80,-12,-12,68,0,-10,84,-5,-12,61,1,-12,63,8,-11,76,7,-11,73,-13,-5,73,4,-17,74,4,-6,69,-10,-18,70,-9,-3,71,-2,-19,73,-1,-11,74,7,-12,69,-11,15,44,12,-26,38,10,14,48,10,-27,42,8,11,51,9,-25,46,7,7,51,9,-22,48,8,4,48,10,-18,46,10,5,44,12,-17,42,12,8,41,14,-19,38,13,12,41,14,-22,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-10,36,-26,3,38,-23,-7,39,-22,0,36,-18,-4,39,-18,1,30,-15,-3,33,-14,6,25,-14,-5,26,-14,10,25,-18,-8,24,-18,14,38,-14,-17,34,-15,14,33,-12,-16,29,-13,10,41,-15,-16,39,-15,4,42,-15,-11,42,-15,1,38,-13,-7,40,-13,2,33,-11,-5,35,-10,6,29,-10,-7,29,-9,11,29,-10,-12,27,-11,14,43,-2,-22,38,-4,15,39,0,-21,33,-2,10,46,-3,-20,43,-4,5,46,-3,-16,45,-3,3,43,-2,-12,44,-2,3,39,0,-11,39,0,7,35,0,-13,34,0,12,35,0,-17,32,0,28,14,15,-31,11,31,29,15,18,-33,13,33,29,16,22,-33,16,35,26,15,24,-31,17,38,23,14,23,-28,16,38,22,12,20,-26,14,36,23,11,16,-26,11,33,25,12,14,-28,10,31,14,45,7,-25,36,8,16,47,11,-28,39,10,15,47,16,-28,42,14,12,46,19,-25,44,17,8,44,18,-21,43,17,6,42,13,-18,40,15,7,41,9,-18,37,11,10,43,6,-21,35,8,20,38,12,-30,31,16,18,36,8,-27,28,13,19,38,17,-30,34,20,16,37,20,-27,36,23,12,35,19,-22,35,23,10,33,15,-19,32,20,11,32,9,-19,29,16,14,33,7,-22,27,13,23,31,13,-31,25,20,21,29,9,-28,23,18,22,31,18,-31,28,24,19,30,21,-28,30,27,15,28,20,-24,29,27,13,26,16,-21,26,25,14,26,11,-21,23,21,18,27,8,-24,22,18,26,23,16,-32,19,27,25,21,13,-30,16,25,26,23,20,-32,22,30,23,22,22,-30,23,33,20,20,21,-26,22,33,18,19,18,-23,20,31,19,18,14,-24,17,27,22,19,12,-26,16,25,11,47,19,-25,42,17,12,51,15,-27,45,12,6,51,15,-22,48,14,6,45,16,-19,43,16,11,42,16,-22,37,14,15,46,14,-27,39,12,8,52,10,-23,48,8,4,48,11,-18,46,10,7,42,11,-18,40,10,12,43,9,-22,38,8,13,49,9,-26,42,7,8,46,7,-20,43,5,12,50,17,-27,44,15,9,49,18,-24,45,17,9,52,15,-25,48,13,13,46,17,-26,40,15,14,49,15,-28,42,13,8,46,18,-22,42,17,6,48,17,-20,46,16,11,44,18,-23,39,16,8,43,17,-20,40,15,13,43,15,-25,37,13,15,47,12,-27,40,9,12,50,12,-26,44,10,11,52,12,-26,47,10,7,52,13,-23,48,12,5,50,13,-20,48,13,5,47,13,-19,45,13,6,43,14,-18,41,13,9,41,13,-19,38,12,12,41,12,-22,37,11,15,44,12,-25,38,10,11,51,9,-25,46,7,6,50,10,-20,48,9,4,45,10,-17,43,10,10,42,10,-20,38,9,13,45,9,-25,40,7,11,48,7,-23,43,5,8,49,7,-22,46,6,6,47,8,-19,45,7,7,44,8,-18,41,7,10,44,7,-21,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,52,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-11,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-30,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-5,59,-25,-4,67,-11,-14,64,-12,-1,65,-9,-15,60,-12,-2,60,-9,-12,57,-10,-7,57,-9,-9,67,-12,-6,67,-10,-12,65,-12,-4,64,-9,-13,61,-11,-4,60,-8,-11,58,-10,-7,58,-9,-9,67,-11,-8,66,-5,-13,65,-7,-7,64,-4,-13,62,-6,-7,61,-4,-11,60,-6,-9,59,-5,-11,67,-6,-8,66,-5,-12,65,-6,-7,64,-4,-13,62,-5,-8,61,-3,-12,60,-4,-10,59,-3,-10,66,-6,-9,68,-3,-14,67,-5,-7,65,-2,-14,64,-4,-8,62,-1,-13,61,-3,-10,60,-2,-11,69,-4,11,59,-6,-19,57,-9,10,56,-6,-17,58,-8,7,56,-6,-16,59,-6,5,57,-6,-17,61,-4,4,59,-5,-20,62,-4,5,62,-4,-22,62,-5,8,62,-4,-23,60,-7,10,61,-5,-22,58,-8,12,53,12,-22,45,5,11,51,12,-20,45,6,9,51,12,-19,46,7,7,52,12,-20,48,8,7,54,13,-22,49,9,8,56,13,-24,48,8,10,56,13,-25,47,6,12,55,13,-24,45,5,11,53,5,-18,49,0,12,55,5,-21,49,0,8,52,5,-17,51,2,6,53,5,-18,53,4,5,55,6,-21,54,4,7,58,6,-23,53,3,9,59,6,-24,52,1,12,57,6,-23,50,0,10,54,0,-18,53,-3,12,57,0,-20,53,-4,8,54,0,-17,55,-1,5,55,0,-18,57,0,5,57,1,-20,58,0,6,59,1,-23,57,0,9,60,1,-24,55,-2,11,59,1,-22,53,-3,10,55,-3,-17,55,-5,11,58,-2,-19,55,-6,8,54,-3,-16,57,-3,5,56,-2,-17,59,-2,4,58,-2,-20,60,-2,6,61,-1,-22,59,-3,8,61,-1,-23,58,-4,11,60,-2,-22,56,-6,0,44,26,-13,60,8,0,44,25,-13,60,7,-1,43,24,-13,60,5,0,42,23,-13,59,4,0,41,23,-11,58,4,1,41,24,-11,58,6,2,42,26,-11,58,7,1,43,26,-11,59,8,10,56,15,-24,45,10,9,56,14,-26,46,9,8,55,13,-26,46,7,9,53,12,-24,45,5,10,52,12,-22,43,5,12,52,13,-22,42,7,13,53,14,-22,43,9,12,55,16,-23,44,11,1,47,22,-17,56,7,3,47,23,-16,56,9,1,46,21,-17,56,6,1,45,20,-16,55,4,3,44,20,-14,54,5,4,44,21,-13,54,6,5,45,23,-13,54,8,4,46,24,-14,55,9,6,54,16,-24,49,8,8,54,18,-22,48,10,6,53,15,-23,49,6,7,51,13,-22,47,5,9,49,13,-20,46,5,10,49,15,-19,45,6,11,50,16,-19,45,8,10,52,18,-20,46,10,8,55,15,-25,47,9,10,56,16,-24,46,10,7,54,13,-25,47,6,8,52,12,-23,46,5,10,51,12,-22,44,5,12,51,13,-21,43,7,12,53,15,-21,43,9,12,54,16,-23,44,10,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,10,61,-9,-23,62,-10,7,56,-8,-21,57,-9,-3,56,-12,-9,56,-13,1,63,-18,-14,63,-18,8,63,-3,-21,64,-4,6,57,-2,-19,57,-3,-5,57,-9,-8,56,-9,0,66,-8,-13,66,-8,3,55,-10,-17,55,-11,8,58,-13,-21,59,-14,2,59,-4,-15,59,-4,4,65,-5,-17,65,-6,8,58,-9,-22,59,-10,0,60,-17,-13,60,-18,7,60,-1,-20,60,-2,2,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-7,9,63,-7,-22,64,-8,-5,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-8,6,65,-10,-18,66,-11,5,56,-9,-19,56,-10,9,59,-11,-22,60,-12,4,58,-2,-17,58,-3,6,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-18,61,-3,3,56,-6,-17,56,-7,8,64,-8,-20,65,-9,-2,31,26,-16,67,0,-4,31,25,-16,66,-1,-1,38,23,-10,63,2,0,38,25,-11,64,4,-4,31,28,-18,65,1,-6,32,26,-17,64,-1,-4,39,25,-13,60,3,-3,39,28,-14,61,5,-2,39,29,-14,62,6,-3,39,27,-14,61,4,-4,31,27,-18,64,0,-2,31,29,-19,66,2,1,38,26,-11,66,5,0,38,24,-11,63,3,-2,31,25,-16,66,0,0,31,27,-17,68,1,1,31,28,-17,68,2,0,31,26,-17,67,1,0,38,25,-11,65,4,1,39,27,-11,66,6,0,31,30,-19,67,3,-2,31,28,-19,65,2,-2,39,29,-14,61,6,0,39,30,-14,63,8,1,39,30,-13,65,9,-1,39,30,-13,62,7,0,32,28,-19,65,3,2,32,29,-19,67,5,2,40,28,-12,66,8,0,40,26,-11,65,6,1,32,26,-17,67,2,3,33,28,-18,68,4,2,39,28,-11,66,8,-1,38,23,-10,62,2,-1,41,23,-8,60,4,2,42,27,-9,63,8,1,40,30,-13,64,9,-4,39,25,-13,60,3,-3,42,25,-11,59,4,0,43,28,-11,62,9,-2,39,29,-14,61,6,-2,43,27,-11,59,7,1,38,25,-10,65,5,0,42,25,-8,62,6,4,30,27,-18,70,3,2,29,26,-18,69,2,1,32,27,-17,66,3,2,33,28,-17,67,5,3,29,28,-20,70,3,2,29,28,-20,69,2,0,32,28,-19,66,3,2,32,29,-19,67,5,2,28,27,-20,69,1,4,29,28,-19,70,2,2,29,27,-18,69,2,4,30,27,-18,70,3,4,29,26,-18,71,2,3,28,26,-18,70,1,4,28,27,-19,71,2,3,27,26,-19,70,1,4,27,26,-18,71,0,5,28,26,-18,72,1,3,28,27,-17,70,1,4,29,27,-17,71,2,4,30,26,-16,72,1,3,30,25,-16,72,0,5,29,25,-17,73,1,4,29,25,-17,72,0,2,25,24,-18,73,-3,3,25,25,-19,74,-2,2,26,24,-18,72,-2,3,27,25,-18,73,-1,2,26,27,-19,72,0,1,26,26,-19,71,-1,2,25,27,-20,72,-1,1,25,26,-20,71,-2,1,25,26,-20,71,-2,2,25,27,-20,72,0,1,26,25,-19,70,-1,2,26,26,-19,71,0,1,28,28,-20,70,0,0,27,26,-19,69,0,1,26,29,-21,70,0,0,26,27,-21,69,-1,0,31,29,-19,67,3,-1,31,28,-19,66,1,0,27,28,-21,69,0,1,27,29,-21,70,1,1,32,28,-17,68,2,0,31,26,-17,67,1,0,27,26,-19,69,0,2,28,27,-20,70,0,-1,26,28,-20,70,-1,-2,26,27,-20,68,-3,-2,31,26,-16,66,0,-1,31,27,-17,67,1,-2,26,29,-21,69,-1,-4,26,28,-21,67,-2,-4,31,27,-19,65,0,-2,31,29,-19,66,1,-4,25,28,-21,68,-3,-2,25,29,-22,70,-2,-2,26,27,-20,68,-2,-1,26,28,-20,69,-1,-1,24,28,-20,71,-2,-2,24,26,-19,70,-4,-2,23,29,-21,71,-3,-3,23,28,-21,70,-4,-2,23,27,-20,71,-5,-1,23,28,-21,72,-3,-2,24,26,-19,70,-4,-1,24,28,-20,71,-2,0,22,27,-18,72,-3,-1,22,26,-18,71,-4,0,21,27,-19,73,-4,-1,21,26,-19,72,-5,-6,22,28,-19,71,-6,-5,22,29,-19,72,-6,-5,22,27,-18,71,-6,-4,22,28,-18,72,-5,-4,24,28,-19,71,-4,-5,24,27,-19,70,-5,-5,24,29,-20,71,-4,-6,24,28,-20,70,-6,-6,25,28,-20,69,-5,-5,25,29,-20,70,-4,-5,24,27,-19,69,-5,-4,25,28,-19,70,-4,-4,26,28,-19,69,-2,-5,26,27,-18,68,-4,-5,26,29,-20,69,-3,-6,26,28,-20,68,-4,-4,32,28,-18,66,0,-5,31,26,-18,64,0,-6,27,27,-20,67,-3,-5,28,29,-20,68,-2,-3,31,26,-16,67,0,-4,31,25,-16,65,-1,-5,27,26,-18,68,-4,-4,27,28,-19,69,-2,-6,24,28,-20,70,-5,-5,24,27,-19,69,-5,-4,24,28,-19,71,-4,-5,24,29,-20,71,-4,-6,27,28,-20,67,-4,-5,26,27,-18,68,-4,-4,27,28,-19,69,-2,-5,27,29,-20,69,-2,-2,26,29,-22,69,-1,-1,26,28,-20,69,-1,-3,26,27,-20,68,-3,-4,26,28,-21,68,-3,-1,23,29,-21,71,-3,-1,24,28,-20,71,-2,-2,24,26,-19,70,-4,-3,23,27,-21,70,-4,0,26,28,-21,69,0,0,27,26,-20,69,0,1,28,28,-20,70,0,1,27,29,-21,70,0,1,25,26,-20,71,-2,1,26,26,-19,71,-1,2,26,27,-19,72,0,2,25,27,-20,72,0,4,29,28,-20,70,3,4,30,27,-18,70,3,2,29,27,-18,69,2,2,28,28,-20,69,1,5,28,27,-19,71,2,4,28,27,-18,71,2,3,28,26,-18,70,1,4,27,26,-19,71,0,-4,34,22,-15,61,0,-2,34,25,-14,64,0,0,35,23,-12,63,-1,-2,35,21,-13,60,-1,-4,31,22,-16,63,-3,-2,32,24,-14,64,-2,-1,32,22,-13,64,-3,-2,32,20,-14,62,-4,0,37,25,-11,65,3,-3,35,27,-15,63,2,-2,40,22,-10,59,2,-4,40,24,-12,60,3,-2,33,21,-14,61,-3,-4,33,22,-15,62,-2,0,33,23,-12,63,-2,-2,33,24,-14,64,-1,-2,31,20,-14,63,-5,-3,30,22,-16,64,-4,0,31,22,-13,64,-3,-2,31,24,-14,65,-2,-1,28,23,-14,67,-4,0,28,22,-13,66,-4,-2,27,22,-15,67,-5,-1,28,21,-14,66,-6,-4,34,22,-15,61,-1,-2,33,24,-14,64,0,0,34,23,-12,63,-2,-2,34,21,-13,60,-2,-1,32,22,-13,64,-3,-2,31,20,-14,63,-5,-2,31,24,-14,64,-2,-4,31,22,-16,63,-4,-3,38,26,-13,62,3,2,60,-13,-15,55,-16,-1,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,61,-16,-1,58,-6,-12,57,-7,2,66,-6,-15,66,-7,3,58,-15,-16,58,-16,1,62,-6,-14,62,-7,-1,56,-8,-11,55,-9,3,66,-11,-16,66,-12] }, + { "name": "animation_000001", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-7,65,-7,-17,67,-7,-5,70,5,-17,71,6,-5,78,-11,-16,79,-11,-5,81,3,-15,82,3,-5,67,0,-18,69,0,-3,81,-4,-17,83,-4,-10,61,1,-15,62,1,-10,63,8,-14,63,8,-4,75,5,-17,76,5,-5,73,-11,-17,74,-11,-2,74,-3,-19,77,-3,-11,71,10,-12,66,-9,-10,83,4,-10,80,-12,-12,68,0,-9,84,-5,-12,61,1,-12,63,8,-10,76,7,-11,73,-13,-5,73,4,-17,75,4,-6,69,-10,-18,70,-9,-3,71,-2,-19,73,-1,-11,74,7,-12,69,-11,15,44,12,-26,38,10,14,48,10,-28,41,8,11,51,9,-26,46,7,7,51,9,-23,48,7,4,48,10,-20,47,9,5,44,12,-18,43,11,8,41,14,-20,38,12,12,41,14,-23,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-11,35,-26,3,38,-23,-8,39,-22,0,36,-18,-5,39,-18,1,30,-15,-3,33,-14,6,25,-14,-5,27,-14,10,25,-18,-8,24,-18,14,38,-14,-18,34,-15,14,33,-12,-16,29,-13,10,41,-15,-16,39,-16,4,42,-15,-12,42,-15,1,38,-13,-8,41,-13,2,33,-11,-6,35,-10,6,29,-10,-8,29,-9,11,29,-10,-12,27,-11,14,43,-2,-22,38,-4,15,39,0,-21,33,-2,10,46,-3,-21,42,-5,5,46,-3,-17,45,-4,3,43,-2,-13,44,-2,3,39,0,-12,39,0,7,35,0,-13,34,0,12,35,0,-17,32,0,28,14,15,-31,11,31,29,15,18,-34,14,33,29,16,22,-34,16,36,26,15,24,-31,18,38,23,14,23,-28,17,38,22,12,20,-26,15,36,23,11,16,-26,12,34,25,12,14,-28,11,32,14,45,7,-26,36,7,16,47,11,-29,39,10,15,47,16,-29,42,14,12,46,19,-26,44,16,8,44,18,-22,43,17,6,42,13,-19,40,14,7,41,9,-19,37,10,10,43,6,-22,35,8,20,38,12,-31,31,16,18,36,8,-27,28,13,19,38,17,-31,35,20,16,37,20,-28,36,23,12,35,19,-23,35,23,10,33,15,-20,32,20,11,32,9,-20,29,16,14,33,7,-23,27,13,23,31,13,-32,25,20,21,29,9,-29,23,18,22,31,18,-32,29,24,19,30,21,-29,30,27,15,28,20,-24,29,27,13,26,16,-21,27,25,14,26,11,-21,24,21,18,27,8,-24,22,18,26,23,16,-33,19,27,25,21,13,-30,17,25,26,23,20,-33,22,30,23,22,22,-30,23,33,20,20,21,-27,23,33,18,19,18,-24,20,31,19,18,14,-24,17,28,22,19,12,-26,16,26,11,47,19,-26,42,16,12,51,15,-29,45,12,6,51,15,-24,48,14,6,45,16,-20,43,15,11,42,16,-22,38,14,15,46,14,-28,39,12,8,52,10,-25,48,8,4,48,11,-19,46,10,7,42,11,-18,40,10,12,43,9,-23,38,7,13,49,9,-27,42,6,8,46,7,-21,43,5,12,50,17,-28,44,15,9,49,18,-25,45,16,9,52,15,-27,47,13,13,46,17,-27,40,15,14,49,15,-29,42,12,8,46,18,-23,43,17,6,48,17,-22,46,15,11,44,18,-24,39,16,8,43,17,-21,40,15,13,43,15,-25,38,13,15,47,12,-28,40,9,12,50,12,-27,44,9,11,52,12,-27,47,10,7,52,13,-24,49,11,5,50,13,-21,48,12,5,47,13,-20,45,12,6,43,14,-19,42,13,9,41,13,-20,38,12,12,41,12,-23,37,11,15,44,12,-26,37,9,11,51,9,-26,45,6,6,50,10,-22,48,8,4,45,10,-18,43,10,10,42,10,-20,38,8,13,45,9,-25,40,6,11,48,7,-24,43,5,8,49,7,-23,46,6,6,47,8,-20,45,7,7,44,8,-19,42,7,10,44,7,-22,40,5,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,52,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-11,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-30,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-5,59,-25,-4,67,-11,-14,64,-12,-1,65,-9,-15,60,-12,-2,60,-9,-12,57,-10,-7,57,-9,-9,67,-12,-6,67,-10,-12,65,-12,-4,64,-9,-13,61,-11,-4,60,-8,-11,58,-10,-7,58,-9,-9,67,-11,-8,66,-5,-13,65,-7,-7,64,-4,-13,62,-6,-7,61,-4,-11,60,-6,-9,59,-5,-11,67,-6,-8,66,-5,-12,65,-6,-7,63,-4,-13,62,-5,-8,61,-3,-12,60,-4,-10,59,-3,-10,66,-6,-9,68,-3,-14,67,-5,-7,65,-2,-14,64,-4,-8,62,-1,-13,61,-3,-10,60,-2,-11,69,-4,11,59,-6,-19,57,-9,10,56,-6,-17,58,-8,7,56,-6,-16,60,-6,5,57,-6,-17,62,-4,4,59,-5,-19,63,-4,5,62,-4,-22,62,-5,8,62,-4,-23,61,-7,10,61,-5,-22,59,-8,12,53,12,-23,45,5,11,51,12,-21,45,6,9,51,12,-20,47,7,7,52,12,-21,48,8,7,54,13,-23,49,8,8,56,13,-25,49,8,10,56,13,-26,47,6,12,55,13,-25,46,5,11,53,5,-19,50,0,12,55,5,-21,49,0,8,52,5,-18,51,2,6,53,5,-19,53,4,5,55,6,-21,54,4,7,58,6,-24,54,3,9,59,6,-25,52,1,12,57,6,-24,50,0,10,54,0,-18,53,-3,12,57,0,-20,53,-4,8,54,0,-17,55,-1,5,55,0,-18,57,0,5,57,1,-20,58,0,6,59,1,-23,58,0,9,60,1,-24,56,-2,11,59,1,-23,54,-4,10,55,-3,-17,56,-5,11,58,-2,-20,55,-6,8,54,-3,-16,57,-3,5,56,-2,-17,59,-2,4,58,-2,-20,60,-2,6,61,-1,-22,60,-3,8,61,-1,-23,58,-4,11,60,-2,-22,56,-6,0,44,26,-13,59,8,0,44,25,-13,60,7,-1,43,24,-13,60,5,0,42,23,-13,59,4,0,41,23,-12,58,4,1,41,24,-11,57,6,2,42,26,-11,58,7,1,43,26,-11,58,8,10,56,15,-25,45,10,9,56,14,-26,46,9,8,55,13,-26,46,6,9,53,12,-25,45,5,10,52,12,-24,44,5,12,52,13,-23,43,7,13,53,14,-23,43,9,12,55,16,-24,44,10,1,47,22,-17,56,7,3,47,23,-16,56,9,1,46,21,-17,56,6,1,45,20,-16,55,4,3,44,20,-15,54,4,4,44,21,-14,53,6,5,45,23,-14,53,8,4,46,24,-15,54,9,6,54,16,-24,50,8,8,54,18,-23,48,10,6,53,15,-24,49,6,7,51,13,-23,48,4,9,49,13,-21,46,4,10,49,15,-20,45,6,11,50,16,-20,45,8,10,52,18,-21,47,10,8,55,15,-26,48,8,10,56,16,-25,46,10,7,54,13,-25,48,6,8,52,12,-24,46,5,10,51,12,-23,45,5,12,51,13,-22,43,6,12,53,15,-22,43,9,12,54,16,-24,44,10,30,14,16,-33,15,32,31,14,23,-34,15,39,24,14,24,-28,15,42,23,14,17,-26,16,34,35,2,24,-38,3,39,30,4,12,-32,6,28,23,4,22,-26,5,38,23,4,15,-25,6,31,25,2,31,-30,2,47,25,7,31,-30,7,48,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-32,14,42,26,14,15,-29,15,32,25,4,12,-28,6,29,29,8,30,-33,9,46,31,14,19,-34,15,36,23,14,21,-26,15,38,33,4,17,-35,5,33,22,4,17,-25,6,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,33,22,0,17,-25,1,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,1,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,1,31,23,0,21,-26,0,38,35,0,24,-38,0,39,30,0,12,-32,1,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,6,34,33,4,17,-35,5,33,22,0,17,-25,1,34,33,0,17,-35,0,33,25,4,12,-28,6,29,25,0,12,-28,1,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,6,31,23,4,22,-26,5,38,30,4,12,-32,6,28,35,2,24,-38,3,39,23,0,14,-25,1,31,23,0,21,-26,0,38,35,0,24,-38,0,39,30,0,12,-32,1,28,10,61,-9,-22,62,-10,7,56,-8,-21,58,-9,-3,56,-12,-9,56,-13,1,63,-18,-13,63,-18,8,63,-3,-21,64,-4,6,57,-2,-19,58,-3,-5,57,-9,-8,56,-9,0,66,-8,-12,66,-8,3,55,-10,-17,56,-11,8,58,-13,-21,60,-14,2,59,-4,-15,59,-4,4,65,-5,-16,65,-5,8,58,-9,-22,59,-10,0,60,-17,-13,61,-18,7,60,-1,-20,61,-2,2,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-7,9,63,-7,-22,64,-8,-5,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-8,6,65,-10,-18,66,-11,5,56,-9,-19,57,-10,9,59,-11,-22,61,-12,4,58,-2,-17,59,-3,6,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-18,61,-3,3,56,-6,-17,56,-7,8,64,-8,-20,65,-9,-2,31,26,-16,67,0,-4,31,25,-16,66,-1,-1,38,23,-10,62,2,0,38,25,-10,64,4,-4,31,28,-18,66,1,-6,32,26,-17,64,-1,-4,39,25,-13,60,3,-3,39,28,-14,61,5,-2,39,29,-14,62,6,-3,39,27,-13,60,4,-4,31,27,-18,64,0,-2,31,29,-19,66,2,1,38,26,-11,66,5,0,38,24,-11,63,3,-2,31,25,-16,66,0,0,31,27,-16,68,1,1,31,28,-17,68,2,0,31,26,-16,67,1,0,38,25,-10,65,4,1,39,27,-11,66,6,0,31,30,-19,67,3,-2,31,28,-19,65,2,-2,39,29,-14,61,6,0,39,30,-14,63,8,1,39,30,-13,65,9,-1,39,30,-13,62,7,0,32,28,-19,65,3,2,32,29,-19,67,5,2,40,28,-12,66,8,0,40,26,-11,65,6,1,32,26,-17,67,2,3,33,28,-18,68,4,2,39,28,-11,65,8,-1,38,23,-10,62,2,-1,41,23,-8,60,4,2,42,27,-9,63,9,1,40,30,-12,64,9,-4,39,25,-12,60,3,-3,42,25,-11,58,4,0,43,28,-10,61,9,-2,39,29,-14,61,6,-2,43,27,-11,59,7,1,38,25,-10,65,5,0,42,25,-8,62,6,4,30,27,-18,70,3,2,29,26,-18,69,2,1,32,27,-17,66,3,2,33,28,-17,67,5,3,29,28,-19,70,3,2,29,28,-20,69,2,0,32,28,-19,66,3,2,32,29,-19,67,5,2,28,27,-19,70,1,4,29,28,-19,70,3,2,29,27,-18,69,2,4,30,27,-18,70,3,4,29,26,-18,71,2,3,28,26,-18,70,1,4,28,27,-19,71,2,3,27,26,-19,71,1,4,27,26,-18,71,1,5,28,26,-18,72,2,3,28,27,-17,70,1,4,29,27,-17,71,2,4,30,26,-16,72,1,3,30,25,-16,72,0,5,29,25,-17,73,1,4,29,25,-17,72,0,2,25,24,-18,73,-3,3,25,25,-18,74,-2,2,26,24,-17,72,-2,3,27,25,-18,73,-1,2,26,27,-19,72,0,1,26,26,-18,71,-1,2,25,27,-20,72,-1,1,25,26,-20,71,-2,1,25,26,-20,71,-1,2,25,27,-20,72,0,1,26,25,-18,70,-1,2,26,26,-19,71,0,1,28,28,-19,70,1,0,27,26,-19,69,0,1,26,29,-21,70,0,0,26,27,-21,69,0,0,31,29,-19,67,3,-1,31,28,-19,66,2,0,27,28,-21,69,0,1,27,29,-21,70,1,1,32,28,-17,68,2,0,31,26,-17,67,1,0,27,26,-19,69,0,2,28,27,-19,70,0,-1,26,28,-20,70,-1,-2,26,27,-19,68,-3,-2,31,26,-16,66,0,-1,31,27,-16,67,1,-2,26,29,-21,69,-1,-4,26,28,-21,68,-2,-4,31,27,-18,65,0,-2,31,29,-19,66,1,-4,25,28,-21,68,-3,-2,25,29,-21,70,-1,-2,26,27,-19,68,-2,-1,26,28,-20,69,-1,-1,24,28,-19,71,-2,-2,24,26,-19,70,-4,-2,23,29,-21,71,-3,-3,23,28,-21,70,-4,-2,23,27,-20,71,-4,-1,23,28,-20,72,-3,-2,24,26,-19,70,-4,-1,24,28,-19,71,-2,0,22,27,-18,72,-3,-1,22,26,-18,71,-4,0,21,27,-19,73,-4,-1,21,26,-18,72,-5,-6,22,28,-18,72,-6,-5,22,29,-19,72,-5,-5,22,27,-17,71,-6,-4,22,28,-18,72,-5,-4,24,28,-18,71,-4,-5,24,27,-18,70,-5,-5,24,29,-20,71,-4,-6,24,28,-19,70,-5,-6,25,28,-19,69,-5,-5,25,29,-20,70,-4,-5,24,27,-18,69,-5,-4,25,28,-18,71,-3,-4,26,28,-18,69,-2,-5,26,27,-18,68,-4,-5,26,29,-20,69,-2,-6,26,28,-20,68,-4,-4,32,28,-18,66,0,-5,31,26,-17,64,0,-6,27,27,-19,67,-3,-5,28,29,-20,68,-2,-3,31,26,-16,67,0,-4,31,25,-16,65,-1,-5,27,26,-18,68,-3,-4,27,28,-18,69,-2,-6,24,28,-19,70,-5,-5,24,27,-18,70,-5,-4,24,28,-18,71,-4,-5,24,29,-20,71,-4,-6,27,28,-20,68,-4,-5,26,27,-18,68,-4,-4,27,28,-18,69,-2,-5,27,29,-20,69,-2,-2,26,29,-21,69,-1,-1,26,28,-20,70,-1,-3,26,27,-20,68,-2,-4,26,28,-21,68,-2,-1,23,29,-21,72,-3,-1,24,28,-19,71,-2,-2,24,26,-19,70,-4,-3,23,27,-20,70,-4,0,26,28,-21,69,0,0,27,26,-19,69,0,1,28,28,-19,70,0,1,27,29,-21,70,0,1,25,26,-20,71,-2,1,26,26,-18,71,-1,2,26,27,-19,72,0,2,25,27,-20,72,0,4,29,28,-20,70,3,4,30,27,-18,70,3,2,29,27,-18,69,2,2,28,28,-20,69,2,5,28,27,-18,71,2,4,28,27,-17,71,2,3,28,26,-17,70,1,4,27,26,-19,71,1,-4,34,22,-14,61,0,-2,34,25,-13,64,0,0,35,23,-11,62,-1,-2,35,21,-13,60,-1,-4,31,22,-15,63,-3,-2,32,24,-14,64,-2,-1,32,22,-12,63,-3,-2,32,20,-14,62,-4,0,37,25,-11,65,3,-3,35,27,-15,63,2,-2,40,22,-10,59,2,-4,40,24,-12,60,3,-2,33,21,-13,61,-3,-4,33,22,-15,62,-1,0,33,23,-12,63,-2,-2,33,24,-14,64,0,-2,31,20,-14,63,-5,-3,30,22,-15,64,-4,0,31,22,-12,64,-3,-2,31,24,-14,64,-2,-1,28,23,-14,67,-4,0,28,22,-12,66,-4,-2,27,22,-14,67,-5,-1,28,21,-13,66,-6,-4,34,22,-15,61,-1,-2,33,24,-14,63,0,0,34,23,-12,62,-2,-2,34,21,-13,60,-2,-1,32,22,-12,64,-3,-2,31,20,-14,63,-4,-2,31,24,-14,64,-2,-4,31,22,-15,63,-3,-3,38,26,-13,62,3,2,60,-13,-15,55,-16,-1,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,62,-16,-1,58,-6,-11,57,-7,2,66,-6,-14,66,-7,3,58,-15,-16,59,-16,1,62,-6,-14,62,-7,-1,56,-8,-11,55,-9,3,66,-11,-15,66,-12] }, + { "name": "animation_000002", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-7,65,-7,-17,67,-7,-5,69,5,-17,71,6,-5,78,-11,-15,79,-11,-4,80,3,-14,82,3,-5,67,0,-18,69,0,-2,81,-4,-16,83,-4,-10,61,1,-15,62,1,-11,63,8,-14,63,8,-4,74,5,-17,77,5,-5,73,-11,-17,75,-11,-2,74,-3,-18,77,-3,-11,71,10,-12,66,-9,-9,83,4,-10,80,-12,-11,68,0,-9,84,-5,-13,61,1,-12,63,8,-10,76,7,-11,73,-13,-4,73,4,-17,75,4,-5,69,-10,-17,71,-9,-3,70,-2,-19,73,-1,-10,74,7,-12,69,-11,15,44,12,-26,37,10,14,48,10,-28,41,8,11,51,9,-26,46,7,7,51,9,-23,48,7,4,48,10,-20,46,9,5,44,12,-18,43,11,8,41,14,-20,38,12,12,41,14,-23,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-11,35,-26,3,38,-23,-8,39,-22,0,36,-18,-5,39,-18,1,30,-15,-3,33,-14,6,25,-14,-5,27,-14,10,25,-18,-8,24,-18,14,38,-14,-18,34,-15,14,33,-12,-16,29,-13,10,41,-15,-16,39,-16,4,42,-15,-12,42,-15,1,38,-13,-8,41,-13,2,33,-11,-6,35,-10,6,29,-10,-8,29,-9,11,29,-10,-12,27,-11,14,43,-2,-22,38,-4,15,39,0,-21,33,-2,10,46,-3,-21,42,-5,5,46,-3,-17,45,-4,3,43,-2,-13,44,-2,3,39,0,-12,39,0,7,35,0,-13,34,0,12,35,0,-17,32,0,28,14,15,-31,11,31,29,15,18,-33,13,33,29,16,22,-33,16,35,26,15,24,-31,17,37,23,14,23,-28,16,38,22,12,20,-26,14,36,23,11,16,-25,11,33,25,12,14,-28,10,31,14,45,7,-26,36,7,16,47,11,-29,39,10,15,47,16,-29,42,14,12,46,19,-26,44,17,8,44,18,-22,43,17,6,42,13,-19,40,14,7,41,9,-19,37,10,10,43,6,-22,35,8,20,38,12,-31,31,16,18,36,8,-27,28,13,19,38,17,-31,34,20,16,37,20,-28,36,23,12,35,19,-23,35,23,10,33,15,-20,32,20,11,32,9,-20,29,16,14,33,7,-23,27,13,23,31,13,-32,25,20,21,29,9,-28,22,18,22,31,18,-32,28,24,19,30,21,-29,30,27,15,28,20,-24,29,27,13,26,16,-21,26,24,14,26,11,-21,23,21,18,27,8,-24,22,18,26,23,16,-32,19,27,25,21,13,-30,16,25,26,23,20,-32,21,30,23,22,22,-30,23,32,20,20,21,-26,22,33,18,19,18,-24,20,30,19,18,14,-24,17,27,22,19,12,-26,16,25,11,47,19,-26,42,17,12,51,15,-29,45,12,6,51,15,-24,48,14,6,45,16,-20,43,15,11,42,16,-22,37,14,15,46,14,-28,39,12,8,52,10,-25,48,8,4,48,11,-19,46,10,7,42,11,-18,40,10,12,43,9,-23,38,8,13,49,9,-27,42,6,8,46,7,-21,43,5,12,50,17,-28,44,15,9,49,18,-25,45,16,9,52,15,-27,47,13,13,46,17,-27,40,15,14,49,15,-29,42,12,8,46,18,-23,42,17,6,48,17,-22,46,15,11,44,18,-24,39,16,8,43,17,-21,40,15,13,43,15,-25,37,13,15,47,12,-28,40,9,12,50,12,-27,44,9,11,52,12,-27,47,10,7,52,13,-24,48,11,5,50,13,-21,48,12,5,47,13,-20,45,12,6,43,14,-19,41,13,9,41,13,-20,38,12,12,41,12,-23,37,11,15,44,12,-26,37,9,11,51,9,-26,45,6,6,50,10,-22,48,8,4,45,10,-18,43,10,10,42,10,-20,38,8,13,45,9,-25,39,6,11,48,7,-24,43,5,8,49,7,-23,46,6,6,47,8,-20,45,7,7,44,8,-19,41,7,10,44,7,-22,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,52,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-11,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-30,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-5,59,-25,-4,67,-11,-14,64,-12,-1,65,-9,-15,60,-12,-2,60,-9,-12,57,-10,-7,57,-9,-9,67,-12,-6,67,-10,-12,65,-12,-4,64,-9,-13,61,-11,-4,60,-8,-11,58,-10,-7,58,-9,-9,67,-11,-8,66,-5,-13,65,-7,-7,64,-4,-13,62,-6,-7,61,-4,-11,60,-6,-9,59,-5,-11,67,-6,-8,66,-5,-12,65,-6,-7,63,-4,-13,62,-5,-8,61,-3,-12,60,-4,-10,59,-3,-10,66,-6,-8,68,-3,-14,67,-5,-7,65,-2,-14,64,-4,-8,62,-1,-13,61,-3,-10,60,-2,-11,69,-4,11,59,-6,-19,57,-9,10,56,-6,-17,58,-8,7,56,-6,-16,60,-6,5,57,-6,-17,62,-4,4,59,-5,-19,63,-4,5,62,-4,-22,62,-5,8,62,-4,-23,61,-7,10,61,-5,-22,59,-8,12,53,12,-23,45,5,11,51,12,-21,45,6,9,51,12,-20,47,7,7,52,12,-21,48,8,7,54,13,-23,49,8,8,56,13,-25,49,8,10,56,13,-26,47,6,12,55,13,-25,46,5,11,53,5,-19,50,0,12,55,5,-21,49,0,8,52,5,-18,51,2,6,53,5,-19,53,4,5,55,6,-21,54,4,7,58,6,-24,54,3,9,59,6,-25,52,1,12,57,6,-24,50,0,10,54,0,-18,53,-3,12,57,0,-20,53,-4,8,54,0,-17,55,-1,5,55,0,-18,57,0,5,57,1,-20,58,0,6,59,1,-23,58,0,9,60,1,-24,56,-2,11,59,1,-23,54,-4,10,55,-3,-17,56,-5,11,58,-2,-20,55,-6,8,54,-3,-16,57,-3,5,56,-2,-17,59,-2,4,58,-2,-20,60,-2,6,61,-1,-22,60,-3,8,61,-1,-23,58,-4,11,60,-2,-22,56,-6,0,44,26,-13,59,8,0,44,25,-13,60,7,-1,43,24,-13,60,5,0,42,23,-13,59,4,0,41,23,-12,58,4,1,41,24,-11,57,6,2,42,26,-11,58,7,1,43,26,-11,58,8,10,56,15,-25,45,10,9,56,14,-26,46,9,8,55,13,-26,46,6,9,53,12,-25,45,5,10,52,12,-24,44,5,12,52,13,-23,43,7,13,53,14,-23,43,9,12,55,16,-24,44,10,1,47,22,-17,56,7,3,47,23,-16,56,9,1,46,21,-17,56,6,1,45,20,-16,55,4,3,44,20,-15,54,4,4,44,21,-14,53,6,5,45,23,-14,53,8,4,46,24,-15,54,9,6,54,16,-24,50,8,8,54,18,-23,48,10,6,53,15,-24,49,6,7,51,13,-23,48,4,9,49,13,-21,46,4,10,49,15,-20,45,6,11,50,16,-20,45,8,10,52,18,-21,47,10,8,55,15,-26,48,8,10,56,16,-25,46,10,7,54,13,-25,48,6,8,52,12,-24,46,5,10,51,12,-23,45,5,12,51,13,-22,43,6,12,53,15,-22,43,9,12,54,16,-24,44,10,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,10,61,-9,-22,62,-10,7,56,-8,-21,58,-9,-3,56,-12,-9,56,-13,1,63,-18,-13,63,-18,8,63,-3,-21,64,-4,6,57,-2,-19,58,-3,-5,57,-9,-8,56,-9,0,66,-8,-12,66,-8,3,55,-10,-17,56,-11,8,58,-13,-21,60,-14,2,59,-4,-15,59,-4,4,65,-5,-16,65,-5,8,58,-9,-22,59,-10,0,60,-17,-13,61,-18,7,60,-1,-20,61,-2,2,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-7,9,63,-7,-22,64,-8,-5,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-8,6,65,-10,-18,66,-11,5,56,-9,-19,57,-10,9,59,-11,-22,61,-12,4,58,-2,-17,59,-3,6,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-18,61,-3,3,56,-6,-17,56,-7,8,64,-8,-20,65,-9,-2,31,26,-16,67,0,-4,31,25,-16,66,-1,-1,38,23,-10,62,2,0,38,25,-10,64,4,-4,31,28,-18,66,1,-6,32,26,-17,64,-1,-4,39,25,-13,60,3,-3,39,28,-14,61,5,-2,39,29,-14,62,6,-3,39,27,-13,61,4,-4,31,27,-18,64,0,-2,31,29,-19,66,2,1,38,26,-11,66,5,0,38,24,-11,63,3,-2,31,25,-16,66,0,0,31,27,-16,68,1,1,31,28,-17,68,2,0,31,26,-16,67,1,0,38,25,-10,65,4,1,39,27,-11,66,6,0,31,30,-19,67,3,-2,31,28,-19,65,2,-2,39,29,-14,61,6,0,39,30,-14,63,8,1,39,30,-13,65,9,-1,39,30,-13,62,7,0,32,28,-19,65,3,2,32,29,-19,67,5,2,40,28,-12,66,8,0,40,26,-11,65,6,1,32,26,-17,67,2,3,33,28,-18,68,4,2,39,28,-11,65,8,-1,38,23,-10,62,2,-1,41,23,-8,60,4,2,42,27,-9,63,9,1,40,30,-12,64,9,-4,39,25,-12,60,3,-3,42,25,-11,58,4,0,43,28,-10,61,9,-2,39,29,-14,61,6,-2,43,27,-11,59,7,1,38,25,-10,65,5,0,42,25,-8,62,6,4,30,27,-18,70,3,2,29,26,-18,69,2,1,32,27,-17,66,3,2,33,28,-17,67,5,3,29,28,-20,70,3,2,29,28,-20,69,2,0,32,28,-19,66,3,2,32,29,-19,67,5,2,28,27,-20,70,1,4,29,28,-19,70,3,2,29,27,-18,69,2,4,30,27,-18,70,3,4,29,26,-18,71,2,3,28,26,-18,70,1,4,28,27,-19,71,2,3,27,26,-19,71,1,4,27,26,-19,71,1,5,28,26,-19,72,2,3,28,27,-18,70,1,4,29,27,-18,71,2,4,30,26,-17,72,1,3,30,25,-17,72,0,5,29,25,-17,73,1,4,29,25,-17,72,0,2,25,24,-18,73,-3,3,25,25,-18,74,-2,2,26,24,-17,72,-2,3,27,25,-17,73,-1,2,26,27,-18,72,0,1,26,26,-18,71,-1,2,25,27,-20,72,-1,1,25,26,-20,71,-2,1,25,26,-20,71,-1,2,25,27,-20,72,0,1,26,25,-18,70,-1,2,26,26,-19,71,0,1,28,28,-19,70,1,0,27,26,-19,69,0,1,26,29,-21,71,0,0,26,27,-21,69,0,0,31,29,-19,67,3,-1,31,28,-19,66,2,0,27,28,-21,69,0,1,27,29,-21,70,1,1,32,28,-17,68,2,0,31,26,-17,67,1,0,27,26,-19,69,0,2,28,27,-19,71,0,-1,26,28,-20,70,-1,-2,26,27,-19,69,-3,-2,31,26,-16,66,0,-1,31,27,-16,67,1,-2,26,29,-21,69,-1,-4,26,28,-21,68,-2,-4,31,27,-18,65,0,-2,31,29,-19,66,1,-4,25,28,-21,69,-3,-2,25,29,-21,70,-1,-2,26,27,-19,68,-2,-1,26,28,-20,70,-1,-1,24,28,-19,71,-2,-2,24,26,-19,70,-4,-2,23,29,-21,71,-3,-3,23,28,-20,70,-4,-2,23,27,-20,71,-4,-1,23,28,-20,72,-3,-2,24,26,-19,70,-4,-1,24,28,-19,71,-2,0,22,27,-18,72,-3,-1,22,26,-18,72,-4,0,21,27,-18,73,-4,-1,21,26,-18,72,-5,-6,22,28,-18,72,-6,-5,22,29,-18,72,-5,-5,22,27,-17,71,-6,-4,22,28,-18,72,-5,-4,24,28,-18,71,-4,-5,24,27,-18,70,-5,-5,24,29,-19,71,-4,-6,24,28,-19,70,-5,-6,25,28,-19,69,-5,-5,25,29,-20,71,-4,-5,24,27,-18,70,-5,-4,25,28,-18,71,-3,-4,26,28,-18,69,-2,-5,26,27,-18,68,-4,-5,26,29,-20,69,-2,-6,26,28,-19,68,-4,-4,32,28,-18,66,0,-5,31,26,-17,64,0,-6,27,27,-19,67,-3,-5,28,29,-20,69,-2,-3,31,26,-16,67,0,-4,31,25,-16,65,-1,-5,27,26,-18,68,-3,-4,27,28,-18,69,-2,-6,24,28,-19,70,-5,-5,24,27,-18,70,-5,-4,24,28,-18,71,-4,-5,24,29,-20,71,-4,-6,27,28,-19,68,-4,-5,26,27,-18,68,-4,-4,27,28,-18,69,-2,-5,27,29,-20,69,-2,-2,26,29,-21,69,-1,-1,26,28,-20,70,-1,-3,26,27,-19,68,-2,-4,26,28,-21,68,-2,-1,23,29,-21,72,-3,-1,24,28,-19,71,-2,-2,24,26,-19,70,-4,-3,23,27,-20,71,-4,0,26,28,-21,69,0,0,27,26,-19,69,0,1,28,28,-19,70,0,1,27,29,-21,70,0,1,25,26,-20,71,-2,1,26,26,-18,71,-1,2,26,27,-19,72,0,2,25,27,-20,72,0,4,29,28,-20,70,3,4,30,27,-18,70,3,2,29,27,-18,69,2,2,28,28,-20,69,2,5,28,27,-19,72,2,4,28,27,-18,71,2,3,28,26,-18,70,1,4,27,26,-19,71,1,-4,34,22,-14,61,0,-2,34,25,-13,64,0,0,35,23,-11,62,-1,-2,35,21,-13,60,-1,-4,31,22,-15,63,-3,-2,32,24,-14,64,-2,-1,32,22,-12,63,-3,-2,32,20,-14,62,-4,0,37,25,-11,65,3,-3,35,27,-15,63,2,-2,40,22,-10,59,2,-4,40,24,-12,60,3,-2,33,21,-13,61,-3,-4,33,22,-15,62,-1,0,33,23,-12,63,-2,-2,33,24,-14,64,0,-2,31,20,-14,63,-5,-3,30,22,-15,64,-4,0,31,22,-12,64,-3,-2,31,24,-14,65,-2,-1,28,23,-14,67,-4,0,28,22,-12,66,-4,-2,27,22,-14,67,-5,-1,28,21,-13,66,-6,-4,34,22,-15,61,-1,-2,33,24,-14,64,0,0,34,23,-12,62,-2,-2,34,21,-13,60,-2,-1,32,22,-12,64,-3,-2,31,20,-14,63,-4,-2,31,24,-14,64,-2,-4,31,22,-15,63,-3,-3,38,26,-13,62,3,2,60,-13,-15,55,-16,-1,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,62,-16,-1,58,-6,-11,57,-7,2,66,-6,-14,66,-7,3,58,-15,-16,59,-16,1,62,-6,-14,62,-7,-1,56,-8,-11,55,-9,3,66,-11,-15,66,-12] }, + { "name": "animation_000003", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-7,65,-7,-17,67,-7,-5,69,5,-17,71,5,-5,78,-11,-15,79,-11,-4,80,3,-14,82,3,-5,67,0,-18,69,0,-2,81,-4,-16,83,-4,-10,61,1,-15,62,1,-11,63,8,-14,63,8,-3,74,4,-16,77,5,-5,73,-11,-17,75,-11,-2,74,-3,-18,77,-3,-11,71,10,-12,66,-9,-9,83,4,-10,80,-12,-11,68,0,-9,84,-5,-13,61,1,-12,63,8,-10,76,7,-11,73,-13,-4,73,4,-16,75,4,-5,69,-10,-17,71,-9,-3,70,-2,-19,73,-1,-10,74,7,-12,69,-11,15,44,12,-26,37,10,14,48,10,-28,41,8,11,51,9,-26,46,7,7,51,9,-23,48,7,4,48,10,-19,46,9,5,44,12,-18,43,12,8,41,14,-20,38,12,12,41,14,-23,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-11,35,-26,3,38,-23,-8,39,-22,0,36,-18,-5,39,-18,1,30,-15,-3,33,-14,6,25,-14,-5,27,-14,10,25,-18,-8,24,-18,14,38,-14,-18,34,-15,14,33,-12,-16,29,-13,10,41,-15,-16,39,-16,4,42,-15,-12,42,-15,1,38,-13,-8,41,-13,2,33,-11,-6,35,-10,6,29,-10,-8,29,-9,11,29,-10,-12,27,-11,14,43,-2,-22,38,-4,15,39,0,-21,33,-2,10,46,-3,-21,42,-5,5,46,-3,-17,45,-4,3,43,-2,-13,44,-2,3,39,0,-12,39,0,7,35,0,-13,34,0,12,35,0,-17,32,0,28,14,15,-31,11,31,29,15,18,-33,13,33,29,16,22,-33,16,35,26,15,24,-31,17,37,23,14,23,-28,16,38,22,12,20,-26,14,36,23,11,16,-25,11,33,25,12,14,-28,10,31,14,45,7,-26,36,7,16,47,11,-29,39,10,15,47,16,-29,42,14,12,46,19,-26,44,17,8,44,18,-22,43,17,6,42,13,-19,40,14,7,41,9,-18,37,10,10,43,6,-21,35,8,20,38,12,-31,31,16,18,36,8,-27,28,13,19,38,17,-31,34,20,16,37,20,-28,36,23,12,35,19,-23,35,23,10,33,15,-20,32,20,11,32,9,-20,29,16,14,33,7,-23,27,13,23,31,13,-32,25,20,21,29,9,-28,22,18,22,31,18,-32,28,24,19,30,21,-29,30,27,15,28,20,-24,29,27,13,26,16,-21,26,25,14,26,11,-21,23,21,18,27,8,-24,22,18,26,23,16,-32,19,27,25,21,13,-30,16,25,26,23,20,-32,21,30,23,22,22,-30,23,32,20,20,21,-26,22,33,18,19,18,-24,20,30,19,18,14,-24,17,27,22,19,12,-26,16,25,11,47,19,-26,42,17,12,51,15,-29,45,12,6,51,15,-24,48,14,6,45,16,-20,43,15,11,42,16,-22,37,14,15,46,14,-28,39,12,8,52,10,-24,48,8,4,48,11,-19,46,10,7,42,11,-18,40,10,12,43,9,-23,38,8,13,49,9,-27,42,6,8,46,7,-21,43,5,12,50,17,-28,44,15,9,49,18,-25,45,16,9,52,15,-26,47,13,13,46,17,-27,40,15,14,49,15,-29,42,12,8,46,18,-23,42,17,6,48,17,-22,46,15,11,44,18,-24,39,16,8,43,17,-21,40,15,13,43,15,-25,37,13,15,47,12,-28,40,9,12,50,12,-27,44,9,11,52,12,-27,47,10,7,52,13,-24,48,11,5,50,13,-21,48,12,5,47,13,-20,45,12,6,43,14,-19,41,13,9,41,13,-20,38,12,12,41,12,-23,37,11,15,44,12,-26,37,9,11,51,9,-26,45,6,6,50,10,-22,48,9,4,45,10,-18,43,10,10,42,10,-20,38,8,13,45,9,-25,39,6,11,48,7,-24,43,5,8,49,7,-23,46,6,6,47,8,-20,45,7,7,44,8,-19,41,7,10,44,7,-22,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,52,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-11,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-30,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-5,59,-25,-4,67,-11,-14,64,-12,-1,65,-9,-15,60,-12,-2,60,-9,-12,57,-10,-7,57,-9,-9,67,-12,-6,67,-10,-12,65,-12,-4,64,-9,-13,61,-11,-4,60,-8,-11,58,-10,-7,58,-9,-9,67,-11,-8,66,-5,-13,65,-7,-7,64,-4,-13,62,-6,-7,61,-4,-11,60,-6,-9,59,-5,-11,67,-6,-8,66,-5,-12,65,-6,-7,63,-4,-13,62,-5,-8,61,-3,-12,60,-4,-10,59,-3,-10,66,-6,-8,68,-3,-14,67,-5,-7,65,-2,-14,64,-4,-8,62,-1,-13,61,-3,-10,60,-2,-11,69,-4,11,59,-6,-19,57,-9,10,56,-6,-17,58,-8,7,56,-6,-16,60,-6,5,57,-6,-17,62,-4,4,59,-5,-19,63,-4,5,62,-4,-22,62,-5,8,62,-4,-23,61,-7,10,61,-5,-22,59,-8,12,53,12,-23,45,5,11,51,12,-21,45,6,9,51,12,-20,47,7,7,52,12,-21,48,8,7,54,13,-23,49,8,8,56,13,-25,49,8,10,56,13,-26,47,6,12,55,13,-25,46,5,11,53,5,-19,50,0,12,55,5,-21,49,0,8,52,5,-18,51,2,6,53,5,-19,53,4,5,55,6,-21,54,4,7,58,6,-24,54,3,9,59,6,-25,52,1,12,57,6,-24,50,0,10,54,0,-18,53,-3,12,57,0,-20,53,-4,8,54,0,-17,55,-1,5,55,0,-18,57,0,5,57,1,-20,58,0,6,59,1,-23,58,0,9,60,1,-24,56,-2,11,59,1,-23,54,-4,10,55,-3,-17,56,-5,11,58,-2,-20,55,-6,8,54,-3,-16,57,-3,5,56,-2,-17,59,-2,4,58,-2,-20,60,-2,6,61,-1,-22,60,-3,8,61,-1,-23,58,-4,11,60,-2,-22,56,-6,0,44,26,-13,59,8,0,44,25,-13,60,7,-1,43,24,-13,60,5,0,42,23,-13,59,4,0,41,23,-12,58,4,1,41,24,-11,58,6,2,42,26,-11,58,7,1,43,26,-11,58,8,10,56,15,-25,45,10,9,56,14,-26,46,9,8,55,13,-26,46,6,9,53,12,-25,45,5,10,52,12,-23,44,5,12,52,13,-23,43,7,13,53,14,-23,43,9,12,55,16,-24,44,10,1,47,22,-17,57,7,3,47,23,-16,56,9,1,46,21,-17,56,6,1,45,20,-16,55,4,3,44,20,-15,54,4,4,44,21,-14,53,6,5,45,23,-14,53,8,4,46,24,-15,54,9,6,54,16,-24,50,8,8,54,18,-23,48,10,6,53,15,-24,49,6,7,51,13,-23,48,4,9,49,13,-21,46,4,10,49,15,-20,45,6,11,50,16,-20,45,8,10,52,18,-21,47,10,8,55,15,-26,48,8,10,56,16,-25,46,10,7,54,13,-25,48,6,8,52,12,-24,46,5,10,51,12,-23,45,5,12,51,13,-22,43,6,12,53,15,-22,43,9,12,54,16,-23,44,10,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,10,61,-9,-22,62,-10,7,56,-8,-21,58,-9,-3,56,-12,-9,56,-13,1,63,-18,-13,63,-18,8,63,-3,-21,64,-4,6,57,-2,-19,58,-3,-5,57,-9,-8,56,-9,0,66,-8,-12,66,-8,3,55,-10,-17,56,-11,8,58,-13,-21,60,-14,2,59,-4,-15,59,-4,4,65,-5,-16,65,-5,8,58,-9,-22,59,-10,0,60,-17,-13,61,-18,7,60,-1,-20,61,-2,2,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-7,9,63,-7,-22,64,-8,-5,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-8,6,65,-10,-18,66,-11,5,56,-9,-19,57,-10,9,59,-11,-22,61,-12,4,58,-2,-17,59,-3,6,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-18,61,-3,3,56,-6,-17,56,-7,8,64,-8,-20,65,-9,-2,31,26,-15,68,0,-4,31,25,-15,66,-1,-1,38,23,-10,62,2,0,38,25,-10,64,4,-4,31,28,-18,66,1,-6,32,26,-17,64,-1,-4,39,25,-13,60,3,-3,39,28,-14,61,5,-2,39,29,-14,62,6,-3,39,27,-13,61,4,-4,31,27,-18,64,0,-2,31,29,-19,66,2,1,38,26,-11,66,5,0,38,24,-10,63,3,-2,31,25,-16,67,0,0,31,27,-16,68,1,1,31,28,-17,69,2,0,31,26,-16,67,1,0,38,25,-10,65,4,1,39,27,-11,66,6,0,31,30,-19,67,3,-2,31,28,-18,65,2,-2,39,29,-13,61,6,0,39,30,-14,63,8,1,39,30,-13,65,9,-1,39,30,-13,62,7,0,32,28,-19,65,3,2,32,29,-19,67,5,2,40,28,-11,66,8,0,40,26,-11,65,6,1,32,26,-17,67,2,3,33,28,-17,68,4,2,39,28,-10,65,8,-1,38,23,-10,62,2,-1,41,23,-8,60,4,2,42,27,-9,63,9,1,40,30,-12,64,9,-4,39,25,-12,60,3,-3,42,25,-11,58,4,0,43,28,-10,61,9,-2,39,29,-14,61,6,-2,43,27,-11,59,7,1,38,25,-10,65,5,0,42,25,-8,62,6,4,30,27,-18,70,3,2,29,26,-18,69,2,1,32,27,-17,66,3,2,33,28,-17,67,5,3,29,28,-19,70,3,2,29,28,-20,69,2,0,32,28,-19,66,3,2,32,29,-19,67,5,2,28,27,-19,70,1,4,29,28,-19,71,3,2,29,27,-18,69,2,4,30,27,-18,70,3,4,29,26,-18,71,2,3,28,26,-18,70,1,4,28,27,-19,72,2,3,27,26,-19,71,1,4,27,26,-18,71,1,5,28,26,-18,72,2,3,28,27,-17,71,1,4,29,27,-17,71,2,4,30,26,-16,73,1,3,30,25,-17,72,0,5,29,25,-17,73,1,4,29,25,-17,73,0,2,25,24,-18,73,-3,3,25,25,-18,74,-2,2,26,24,-17,72,-2,3,27,25,-17,73,-1,2,26,27,-18,72,0,1,26,26,-18,71,-1,2,25,27,-19,73,-1,1,24,26,-19,72,-2,1,25,26,-20,71,-1,2,25,27,-20,72,0,1,26,25,-18,71,-1,2,26,26,-18,72,0,1,28,28,-19,70,1,0,27,26,-19,69,0,1,26,29,-21,71,0,0,26,27,-20,70,0,0,31,29,-19,67,3,-1,31,28,-19,66,2,0,27,28,-20,69,0,1,27,29,-21,70,1,1,32,28,-17,68,2,0,31,26,-16,67,1,0,27,26,-19,70,0,2,28,27,-19,71,0,-1,26,28,-19,70,-1,-2,26,27,-19,69,-3,-2,31,26,-16,66,0,-1,31,27,-16,67,1,-2,26,29,-21,69,-1,-4,26,28,-21,68,-2,-4,31,27,-18,65,0,-2,31,29,-18,66,1,-4,25,28,-21,69,-3,-2,25,29,-21,70,-1,-2,26,27,-19,69,-2,-1,26,28,-19,70,-1,-1,24,28,-19,71,-2,-2,24,26,-19,70,-4,-2,23,29,-20,72,-3,-3,23,28,-20,70,-4,-2,23,27,-20,71,-4,-1,23,28,-20,72,-3,-2,24,26,-19,70,-4,-1,24,28,-19,71,-2,0,22,27,-17,73,-3,-1,22,26,-17,72,-4,0,21,27,-18,73,-4,-1,21,26,-18,72,-5,-5,22,28,-18,72,-6,-5,22,29,-18,73,-5,-5,22,27,-17,71,-6,-4,22,28,-17,72,-5,-4,24,28,-18,71,-4,-5,24,27,-18,70,-5,-5,24,29,-19,71,-4,-6,24,28,-19,70,-5,-6,25,28,-19,70,-5,-5,25,29,-19,71,-4,-5,24,27,-18,70,-5,-4,25,28,-18,71,-3,-4,26,28,-18,70,-2,-5,26,27,-18,68,-4,-5,26,29,-20,70,-3,-6,26,28,-19,68,-4,-4,32,28,-18,66,0,-5,31,26,-17,65,0,-6,27,27,-19,67,-3,-5,28,29,-19,69,-2,-3,31,26,-16,67,0,-4,31,25,-16,65,-1,-5,27,26,-18,68,-3,-4,27,28,-18,69,-2,-6,24,28,-19,70,-5,-5,24,27,-18,70,-5,-4,24,28,-18,71,-4,-5,24,29,-19,71,-4,-6,27,28,-19,68,-4,-5,26,27,-18,68,-4,-4,27,28,-18,69,-2,-5,27,29,-20,69,-2,-2,26,29,-21,70,-1,-1,26,28,-19,70,-1,-3,26,27,-19,69,-2,-4,26,28,-21,68,-3,-1,23,29,-20,72,-3,-1,24,28,-19,71,-2,-2,24,26,-19,70,-4,-3,23,27,-20,71,-4,0,26,28,-21,69,0,0,27,26,-19,69,0,1,28,28,-19,70,0,1,27,29,-21,70,0,1,25,26,-20,71,-2,1,26,26,-18,71,-1,2,26,27,-18,72,0,2,25,27,-20,72,0,4,29,28,-20,70,3,4,30,27,-18,70,3,2,29,27,-18,69,2,2,28,28,-20,69,2,5,28,27,-19,72,2,4,28,27,-17,71,2,3,28,26,-18,70,1,4,27,26,-19,71,1,-4,34,22,-14,61,0,-2,34,25,-13,64,0,0,35,23,-11,62,-1,-2,35,21,-13,60,-1,-4,31,22,-15,63,-3,-2,32,24,-14,64,-2,-1,32,22,-12,63,-3,-2,32,20,-14,62,-4,0,37,25,-11,65,3,-3,35,27,-15,63,2,-2,40,22,-10,59,2,-4,40,24,-12,60,3,-2,33,21,-13,61,-3,-4,33,22,-15,62,-1,0,33,23,-12,63,-2,-2,33,24,-13,64,0,-2,31,20,-14,63,-5,-3,30,22,-15,64,-4,0,31,22,-12,64,-3,-2,31,24,-14,65,-2,-1,28,23,-13,67,-4,0,28,22,-12,66,-4,-2,27,22,-14,67,-5,-1,28,21,-13,66,-6,-4,34,22,-15,61,-1,-2,33,24,-13,64,0,0,34,23,-12,62,-2,-2,34,21,-13,60,-2,-1,32,22,-12,64,-3,-2,31,20,-14,63,-4,-2,31,24,-14,64,-2,-4,31,22,-15,63,-3,-3,38,26,-13,62,3,2,60,-13,-15,55,-16,-1,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,62,-16,-1,58,-6,-11,57,-7,2,66,-6,-14,66,-7,3,58,-15,-16,59,-16,1,62,-6,-14,62,-7,-1,56,-8,-11,55,-9,3,66,-11,-15,66,-12] }, + { "name": "animation_000004", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-7,65,-7,-17,67,-7,-5,70,5,-17,72,5,-5,77,-11,-15,79,-11,-4,81,2,-14,82,2,-5,67,0,-18,70,0,-2,81,-4,-16,83,-4,-10,61,1,-15,62,1,-11,63,8,-14,64,8,-3,75,4,-16,77,5,-5,72,-11,-17,75,-11,-2,74,-3,-18,77,-3,-11,71,10,-12,66,-9,-9,83,4,-10,80,-13,-11,68,0,-9,84,-5,-13,61,1,-12,63,8,-10,76,7,-11,73,-13,-4,73,4,-16,75,4,-5,68,-10,-17,71,-9,-3,70,-2,-19,73,-1,-10,74,7,-12,69,-11,15,44,12,-26,38,10,14,48,10,-27,42,8,11,51,9,-26,46,7,7,51,9,-22,48,8,4,48,10,-19,46,10,5,44,12,-18,42,12,8,41,14,-19,38,13,12,41,14,-23,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-10,36,-26,3,38,-23,-7,39,-22,0,36,-18,-5,39,-18,1,30,-15,-3,33,-14,6,25,-14,-5,26,-14,10,25,-18,-8,24,-18,14,38,-14,-18,34,-15,14,33,-12,-16,29,-13,10,41,-15,-16,39,-16,4,42,-15,-11,42,-15,1,38,-13,-7,40,-13,2,33,-11,-5,35,-10,6,29,-10,-7,29,-9,11,29,-10,-12,27,-11,14,43,-2,-22,38,-4,15,39,0,-21,33,-2,10,46,-3,-20,42,-5,5,46,-3,-16,45,-4,3,43,-2,-13,44,-2,3,39,0,-11,39,0,7,35,0,-13,34,0,12,35,0,-17,32,0,28,14,15,-31,11,31,29,15,18,-33,13,33,29,16,22,-33,16,35,26,15,24,-31,17,37,23,14,23,-28,16,38,22,12,20,-26,14,36,23,11,16,-26,11,33,25,12,14,-28,10,31,14,45,7,-25,36,8,16,47,11,-29,39,10,15,47,16,-29,42,14,12,46,19,-26,44,17,8,44,18,-21,43,17,6,42,13,-18,40,14,7,41,9,-18,37,11,10,43,6,-21,35,8,20,38,12,-30,31,16,18,36,8,-27,28,13,19,38,17,-30,34,20,16,37,20,-27,36,23,12,35,19,-23,35,23,10,33,15,-20,32,20,11,32,9,-19,29,16,14,33,7,-23,27,13,23,31,13,-31,25,20,21,29,9,-28,22,18,22,31,18,-31,28,24,19,30,21,-28,30,27,15,28,20,-24,29,27,13,26,16,-21,26,25,14,26,11,-21,23,21,18,27,8,-24,22,18,26,23,16,-32,19,27,25,21,13,-30,16,25,26,23,20,-32,21,30,23,22,22,-30,23,32,20,20,21,-26,22,33,18,19,18,-24,20,30,19,18,14,-24,17,27,22,19,12,-26,16,25,11,47,19,-25,42,17,12,51,15,-28,45,12,6,51,15,-23,48,14,6,45,16,-19,43,15,11,42,16,-22,38,14,15,46,14,-27,39,12,8,52,10,-24,48,8,4,48,11,-19,46,10,7,42,11,-18,40,10,12,43,9,-23,38,8,13,49,9,-26,42,7,8,46,7,-21,43,5,12,50,17,-27,44,15,9,49,18,-24,45,16,9,52,15,-26,47,13,13,46,17,-27,40,15,14,49,15,-28,42,12,8,46,18,-22,42,17,6,48,17,-21,46,16,11,44,18,-24,39,16,8,43,17,-20,40,15,13,43,15,-25,37,13,15,47,12,-27,40,9,12,50,12,-27,44,10,11,52,12,-26,47,10,7,52,13,-24,48,11,5,50,13,-20,48,12,5,47,13,-19,45,13,6,43,14,-18,41,13,9,41,13,-19,38,12,12,41,12,-22,37,11,15,44,12,-26,37,9,11,51,9,-26,45,7,6,50,10,-21,48,9,4,45,10,-17,43,10,10,42,10,-20,38,8,13,45,9,-25,40,7,11,48,7,-24,43,5,8,49,7,-22,46,6,6,47,8,-19,45,7,7,44,8,-19,41,7,10,44,7,-21,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,52,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-11,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-30,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-5,59,-25,-4,67,-11,-14,64,-12,-1,65,-9,-15,60,-12,-2,60,-9,-12,57,-10,-7,57,-9,-9,67,-12,-6,67,-10,-12,65,-12,-4,64,-9,-13,61,-11,-4,60,-8,-11,58,-10,-7,58,-9,-9,67,-11,-8,66,-5,-13,65,-7,-7,64,-4,-13,62,-6,-7,61,-4,-11,60,-6,-9,59,-5,-11,67,-6,-8,66,-5,-12,65,-6,-7,63,-4,-13,62,-5,-8,61,-3,-12,60,-4,-10,59,-3,-10,66,-6,-8,68,-3,-13,67,-5,-7,65,-2,-14,64,-4,-8,62,-1,-13,61,-3,-10,60,-2,-11,69,-4,11,59,-6,-19,57,-9,10,56,-6,-17,58,-8,7,56,-6,-16,60,-6,5,57,-6,-17,62,-4,4,59,-5,-19,63,-4,5,62,-4,-22,62,-5,8,62,-4,-23,60,-7,10,61,-5,-22,58,-8,12,53,12,-22,45,5,11,51,12,-20,45,6,9,51,12,-20,47,7,7,52,12,-20,48,8,7,54,13,-22,49,8,8,56,13,-24,49,8,10,56,13,-25,47,6,12,55,13,-24,46,5,11,53,5,-18,50,0,12,55,5,-21,49,0,8,52,5,-17,51,2,6,53,5,-18,53,4,5,55,6,-21,54,4,7,58,6,-23,54,3,9,59,6,-24,52,1,12,57,6,-23,50,0,10,54,0,-18,53,-3,12,57,0,-20,53,-4,8,54,0,-17,55,-1,5,55,0,-18,57,0,5,57,1,-20,58,0,6,59,1,-23,57,0,9,60,1,-24,56,-2,11,59,1,-22,54,-4,10,55,-3,-17,56,-5,11,58,-2,-19,55,-6,8,54,-3,-16,57,-3,5,56,-2,-17,59,-2,4,58,-2,-20,60,-2,6,61,-1,-22,60,-3,8,61,-1,-23,58,-4,11,60,-2,-22,56,-6,0,44,26,-12,60,8,0,44,25,-13,60,7,-1,43,24,-13,60,5,0,42,23,-13,59,4,0,41,23,-11,58,4,1,41,24,-11,58,6,2,42,26,-11,58,7,1,43,26,-11,59,8,10,56,15,-25,45,10,9,56,14,-26,46,9,8,55,13,-26,46,6,9,53,12,-24,45,5,10,52,12,-23,43,5,12,52,13,-22,42,7,13,53,14,-22,43,9,12,55,16,-23,44,10,1,47,22,-17,57,7,3,47,23,-16,56,9,1,46,21,-17,56,6,1,45,20,-16,56,4,3,44,20,-14,54,5,4,44,21,-14,54,6,5,45,23,-14,54,8,4,46,24,-14,55,9,6,54,16,-24,49,8,8,54,18,-23,48,10,6,53,15,-24,49,6,7,51,13,-22,48,4,9,49,13,-20,46,4,10,49,15,-19,45,6,11,50,16,-20,45,8,10,52,18,-21,47,10,8,55,15,-25,47,9,10,56,16,-25,46,10,7,54,13,-25,47,6,8,52,12,-24,46,5,10,51,12,-22,44,5,12,51,13,-21,43,7,12,53,15,-22,43,9,12,54,16,-23,44,10,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,10,61,-9,-22,62,-10,7,56,-8,-21,57,-9,-3,56,-12,-9,56,-13,1,63,-18,-14,63,-18,8,63,-3,-21,64,-4,6,57,-2,-19,58,-3,-5,57,-9,-8,56,-9,0,66,-8,-12,66,-8,3,55,-10,-17,56,-11,8,58,-13,-21,60,-14,2,59,-4,-15,59,-4,4,65,-5,-17,65,-5,8,58,-9,-22,59,-10,0,60,-17,-13,60,-18,7,60,-1,-20,61,-2,2,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-7,9,63,-7,-22,64,-8,-5,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-8,6,65,-10,-18,66,-11,5,56,-9,-19,57,-10,9,59,-11,-22,61,-12,4,58,-2,-17,58,-3,6,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-18,61,-3,3,56,-6,-17,56,-7,8,64,-8,-20,65,-9,-2,31,26,-16,68,0,-4,31,25,-16,66,-1,-1,38,23,-10,62,2,0,38,25,-10,64,4,-4,31,28,-18,66,1,-6,32,26,-17,65,-1,-4,39,25,-13,60,3,-3,39,28,-14,61,5,-2,39,29,-14,62,6,-3,39,27,-13,61,4,-4,31,27,-18,65,0,-2,31,29,-19,66,2,1,38,26,-11,66,5,0,38,24,-11,63,3,-2,31,25,-16,67,0,0,31,27,-16,68,1,1,31,28,-17,69,2,0,31,26,-16,67,1,0,38,25,-10,65,4,1,39,27,-11,66,6,0,31,30,-19,67,3,-2,31,28,-19,65,2,-2,39,29,-14,61,6,0,39,30,-14,63,8,1,39,30,-13,65,9,-1,39,30,-13,62,7,0,32,28,-19,65,3,2,32,29,-19,67,5,2,40,28,-12,66,8,0,40,26,-11,65,6,1,32,26,-17,67,2,3,33,28,-17,68,4,2,39,28,-11,66,8,-1,38,23,-10,62,2,-1,41,23,-8,60,4,2,42,27,-9,63,8,1,40,30,-12,64,9,-4,39,25,-12,60,3,-3,42,25,-11,59,4,0,43,28,-10,62,9,-2,39,29,-14,62,6,-2,43,27,-11,59,7,1,38,25,-10,65,5,0,42,25,-8,62,6,4,30,27,-18,70,3,2,29,26,-18,69,2,1,32,27,-17,66,3,2,33,28,-17,67,5,3,29,28,-20,70,3,2,29,28,-20,69,2,0,32,28,-19,66,3,2,32,29,-19,67,5,2,28,27,-19,70,1,4,29,28,-19,71,3,2,29,27,-18,69,2,4,30,27,-18,70,3,4,29,26,-18,71,2,3,28,26,-18,70,1,4,28,27,-19,72,2,3,27,26,-19,71,1,4,27,26,-19,71,0,5,28,26,-19,72,2,3,28,27,-18,71,1,4,29,27,-17,72,2,4,30,26,-17,73,1,3,30,25,-17,72,0,5,29,25,-17,73,1,4,29,25,-17,73,0,2,25,24,-18,73,-3,3,25,25,-18,74,-2,2,26,24,-17,72,-2,3,26,25,-17,73,-1,2,26,27,-18,72,0,1,26,26,-18,71,-1,2,25,27,-20,73,-1,1,24,26,-19,72,-2,1,25,26,-20,71,-1,2,25,27,-20,72,0,1,26,25,-18,71,-1,2,26,26,-18,72,0,1,28,28,-19,70,1,0,27,26,-19,69,0,1,26,29,-21,71,0,0,26,27,-21,70,0,0,31,29,-19,67,3,-1,31,28,-19,66,1,0,27,28,-21,69,0,1,27,29,-21,70,1,1,32,28,-17,68,2,0,31,26,-17,67,1,0,27,26,-19,70,0,2,28,27,-19,71,0,-1,26,28,-19,70,-1,-2,26,27,-19,69,-3,-2,31,26,-16,66,0,-1,31,27,-16,68,1,-2,26,29,-21,69,-1,-4,26,28,-21,68,-2,-4,31,27,-18,65,0,-2,31,29,-19,66,1,-4,25,28,-21,69,-3,-2,25,29,-21,70,-2,-2,26,27,-19,69,-2,-1,26,28,-19,70,-1,-1,24,28,-19,72,-2,-2,24,26,-19,70,-4,-2,23,29,-20,72,-3,-3,23,28,-20,71,-4,-2,23,27,-20,71,-5,-1,23,28,-20,72,-3,-2,24,26,-19,70,-4,-1,24,28,-19,72,-2,0,22,27,-17,73,-3,-1,22,26,-17,72,-4,0,21,27,-18,74,-4,-1,21,26,-18,73,-5,-5,22,28,-18,72,-6,-5,22,29,-18,73,-5,-5,22,27,-17,72,-6,-4,22,28,-17,72,-5,-4,24,28,-18,71,-4,-5,24,27,-18,70,-5,-5,24,29,-19,72,-4,-6,24,28,-19,70,-5,-6,25,28,-19,70,-5,-5,25,29,-19,71,-4,-5,24,27,-18,70,-5,-4,25,28,-18,71,-3,-4,26,28,-18,70,-2,-5,26,27,-18,69,-4,-5,26,29,-20,70,-3,-6,26,28,-19,68,-4,-4,32,28,-18,66,0,-5,31,26,-17,65,0,-6,27,27,-19,68,-3,-5,28,29,-19,69,-2,-3,31,26,-16,67,0,-4,31,25,-16,65,-1,-5,27,26,-18,68,-3,-4,27,28,-18,70,-2,-6,24,28,-19,70,-5,-5,24,27,-18,70,-5,-4,24,28,-18,71,-4,-5,24,29,-19,71,-4,-6,27,28,-19,68,-4,-5,26,27,-18,68,-4,-4,27,28,-18,70,-2,-5,27,29,-20,69,-2,-2,26,29,-21,70,-1,-1,26,28,-20,70,-1,-3,26,27,-19,69,-2,-4,26,28,-21,69,-3,-1,23,29,-20,72,-3,-1,24,28,-19,72,-2,-2,24,26,-19,70,-4,-3,23,27,-20,71,-4,0,26,28,-21,69,0,0,27,26,-19,69,0,1,28,28,-19,71,0,1,27,29,-21,71,0,1,24,26,-20,72,-2,1,26,26,-18,71,-1,2,26,27,-18,72,0,2,25,27,-20,73,0,4,29,28,-20,70,3,4,30,27,-18,70,3,2,29,27,-18,69,2,2,28,28,-20,69,2,5,28,27,-19,72,2,4,28,27,-18,71,2,3,28,26,-18,71,1,4,27,26,-19,71,1,-4,34,22,-15,61,0,-2,34,25,-13,64,0,0,35,23,-11,63,-1,-2,35,21,-13,60,-1,-4,31,22,-15,63,-3,-2,32,24,-14,65,-2,-1,32,22,-12,64,-3,-2,32,20,-14,62,-4,0,37,25,-11,65,3,-3,35,27,-15,64,2,-2,40,22,-10,59,2,-4,40,24,-12,60,3,-2,33,21,-13,61,-3,-4,33,22,-15,62,-1,0,33,23,-12,63,-2,-2,33,24,-14,64,-1,-2,31,20,-14,63,-5,-3,30,22,-15,64,-4,0,31,22,-12,64,-3,-2,31,24,-14,65,-2,-1,28,23,-13,67,-4,0,28,22,-12,67,-4,-2,27,22,-14,67,-5,-1,28,21,-13,66,-6,-4,34,22,-15,62,-1,-2,33,24,-14,64,0,0,34,23,-12,63,-2,-2,34,21,-13,61,-2,-1,32,22,-12,64,-3,-2,31,20,-14,63,-4,-2,31,24,-14,65,-2,-4,31,22,-15,64,-3,-3,38,26,-13,62,3,2,60,-13,-15,55,-16,-1,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,61,-16,-1,58,-6,-12,57,-7,2,66,-6,-14,66,-7,3,58,-15,-16,59,-16,1,62,-6,-14,62,-7,-1,56,-8,-11,55,-9,3,66,-11,-15,66,-12] }, + { "name": "animation_000005", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-7,66,-7,-17,66,-7,-6,70,5,-17,71,5,-6,78,-11,-17,79,-11,-6,81,2,-16,82,2,-5,68,0,-19,69,0,-4,82,-4,-18,82,-4,-9,61,1,-15,62,1,-10,63,8,-13,63,8,-5,76,4,-18,76,5,-6,73,-11,-18,74,-11,-3,75,-3,-20,76,-3,-11,71,10,-12,66,-9,-11,83,3,-11,80,-13,-12,68,0,-11,85,-5,-12,61,1,-12,63,8,-11,77,7,-12,73,-13,-5,74,4,-18,74,4,-6,69,-10,-18,70,-9,-4,71,-2,-20,72,-1,-11,75,7,-12,69,-11,15,44,12,-26,38,10,14,48,10,-27,42,8,11,51,9,-26,46,7,7,51,9,-22,48,8,4,48,10,-19,46,10,5,44,12,-18,42,12,8,41,14,-19,38,13,12,41,14,-23,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-10,36,-26,3,38,-23,-7,39,-22,0,36,-18,-4,39,-18,1,30,-15,-3,33,-14,6,25,-14,-5,26,-14,10,25,-18,-8,24,-18,14,38,-14,-18,34,-15,14,33,-12,-16,29,-13,10,41,-15,-16,39,-16,4,42,-15,-11,42,-15,1,38,-13,-7,40,-13,2,33,-11,-5,35,-10,6,29,-10,-7,29,-9,11,29,-10,-12,27,-11,14,43,-2,-22,38,-4,15,39,0,-21,33,-2,10,46,-3,-20,42,-5,5,46,-3,-16,45,-4,3,43,-2,-13,44,-2,3,39,0,-11,39,0,7,35,0,-13,34,0,12,35,0,-17,32,0,28,14,15,-31,11,31,29,15,18,-33,13,33,29,16,22,-33,16,35,26,15,24,-31,17,37,23,14,23,-28,16,38,22,12,20,-26,14,36,23,11,16,-26,11,33,25,12,14,-28,10,31,14,45,7,-25,36,8,16,47,11,-29,39,10,15,47,16,-29,42,14,12,46,19,-26,44,17,8,44,18,-21,43,17,6,42,13,-18,40,14,7,41,9,-18,37,11,10,43,6,-21,35,8,20,38,12,-30,31,16,18,36,8,-27,28,13,19,38,17,-30,34,20,16,37,20,-27,36,23,12,35,19,-23,35,23,10,33,15,-20,32,20,11,32,9,-19,29,16,14,33,7,-23,27,13,23,31,13,-31,25,20,21,29,9,-28,22,18,22,31,18,-31,28,24,19,30,21,-28,30,27,15,28,20,-24,29,27,13,26,16,-21,26,25,14,26,11,-21,23,21,18,27,8,-24,22,18,26,23,16,-32,19,27,25,21,13,-30,16,25,26,23,20,-32,21,30,23,22,22,-30,23,32,20,20,21,-26,22,33,18,19,18,-24,20,30,19,18,14,-24,17,27,22,19,12,-26,16,25,11,47,19,-25,42,17,12,51,15,-28,45,12,6,51,15,-23,48,14,6,45,16,-19,43,15,11,42,16,-22,38,14,15,46,14,-27,39,12,8,52,10,-24,48,8,4,48,11,-19,46,10,7,42,11,-18,40,10,12,43,9,-23,38,8,13,49,9,-26,42,7,8,46,7,-21,43,5,12,50,17,-27,44,15,9,49,18,-24,45,16,9,52,15,-26,47,13,13,46,17,-27,40,15,14,49,15,-28,42,12,8,46,18,-22,42,17,6,48,17,-21,46,16,11,44,18,-24,39,16,8,43,17,-20,40,15,13,43,15,-25,37,13,15,47,12,-27,40,9,12,50,12,-27,44,10,11,52,12,-26,47,10,7,52,13,-24,48,11,5,50,13,-20,48,12,5,47,13,-19,45,13,6,43,14,-18,41,13,9,41,13,-19,38,12,12,41,12,-22,37,11,15,44,12,-26,38,9,11,51,9,-26,45,7,6,50,10,-21,48,9,4,45,10,-17,43,10,10,42,10,-20,38,8,13,45,9,-25,40,7,11,48,7,-24,43,5,8,49,7,-22,46,6,6,47,8,-19,45,7,7,44,8,-19,41,7,10,44,7,-21,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,52,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-11,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-30,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-5,59,-25,-4,67,-11,-14,64,-12,-1,65,-9,-15,60,-12,-2,60,-9,-12,57,-10,-7,57,-9,-9,67,-12,-6,67,-10,-12,65,-12,-4,64,-9,-13,61,-11,-4,60,-8,-11,58,-10,-7,58,-9,-9,67,-11,-8,66,-5,-13,65,-7,-7,64,-4,-13,62,-6,-7,61,-4,-11,60,-6,-9,59,-5,-11,67,-6,-8,66,-5,-12,65,-6,-7,64,-4,-13,62,-5,-8,61,-3,-12,60,-4,-10,60,-3,-10,66,-6,-9,68,-3,-14,67,-5,-7,65,-2,-14,64,-4,-8,62,-1,-13,61,-3,-10,60,-2,-11,69,-5,11,59,-6,-19,57,-9,10,56,-6,-17,58,-8,7,56,-6,-16,59,-6,5,57,-6,-17,61,-4,4,59,-5,-20,63,-4,5,62,-4,-22,62,-5,8,62,-4,-23,60,-7,10,61,-5,-22,58,-8,12,53,12,-22,45,5,11,51,12,-20,45,6,9,51,12,-19,46,7,7,52,12,-20,48,8,7,54,13,-22,49,9,8,56,13,-24,48,8,10,56,13,-25,47,6,12,55,13,-24,45,5,11,53,5,-18,49,0,12,55,5,-21,49,0,8,52,5,-17,51,2,6,53,5,-18,53,4,5,55,6,-21,54,4,7,58,6,-23,53,3,9,59,6,-24,52,1,12,57,6,-23,50,0,10,54,0,-18,53,-3,12,57,0,-20,53,-4,8,54,0,-17,55,-1,5,55,0,-18,57,0,5,57,1,-20,58,0,6,59,1,-23,57,0,9,60,1,-24,56,-2,11,59,1,-22,54,-4,10,55,-3,-17,55,-5,11,58,-2,-19,55,-6,8,54,-3,-16,57,-3,5,56,-2,-17,59,-2,4,58,-2,-20,60,-2,6,61,-1,-22,60,-3,8,61,-1,-23,58,-4,11,60,-2,-22,56,-6,0,44,26,-13,60,8,0,44,25,-13,60,7,-1,43,24,-13,60,5,0,42,23,-13,59,4,0,41,23,-11,58,4,1,41,24,-11,58,6,2,42,26,-11,58,7,1,43,26,-11,59,8,10,56,15,-25,45,10,9,56,14,-26,46,9,8,55,13,-26,46,7,9,53,12,-24,45,5,10,52,12,-23,43,5,12,52,13,-22,42,7,13,53,14,-22,43,9,12,55,16,-23,44,10,1,47,22,-17,56,7,3,47,23,-16,56,9,1,46,21,-17,56,6,1,45,20,-16,55,4,3,44,20,-14,54,5,4,44,21,-13,54,6,5,45,23,-13,54,8,4,46,24,-14,55,9,6,54,16,-24,49,8,8,54,18,-23,48,10,6,53,15,-24,49,6,7,51,13,-22,47,4,9,49,13,-20,46,4,10,49,15,-19,45,6,11,50,16,-19,45,8,10,52,18,-21,46,10,8,55,15,-25,47,9,10,56,16,-24,46,10,7,54,13,-25,47,6,8,52,12,-23,46,5,10,51,12,-22,44,5,12,51,13,-21,43,7,12,53,15,-22,43,9,12,54,16,-23,44,10,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,10,61,-9,-22,62,-10,7,56,-8,-21,57,-9,-3,56,-12,-9,56,-13,1,63,-18,-14,63,-18,8,63,-3,-21,64,-4,6,57,-2,-19,58,-3,-5,57,-9,-8,56,-9,0,66,-8,-12,66,-8,3,55,-10,-17,56,-11,8,58,-13,-21,59,-14,2,59,-4,-15,59,-4,4,65,-5,-17,65,-5,8,58,-9,-22,59,-10,0,60,-17,-13,60,-18,7,60,-1,-20,61,-2,2,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-7,9,63,-7,-22,64,-8,-5,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-8,6,65,-10,-18,66,-11,5,56,-9,-19,56,-10,9,59,-11,-22,61,-12,4,58,-2,-17,58,-3,6,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-18,61,-3,3,56,-6,-17,56,-7,8,64,-8,-20,65,-9,-2,31,26,-16,67,0,-4,31,25,-16,66,-1,-1,38,23,-10,62,2,0,38,25,-11,64,4,-4,31,28,-18,65,1,-6,32,26,-17,64,-1,-4,39,25,-13,60,3,-3,39,28,-14,61,5,-2,39,29,-14,62,6,-3,39,27,-13,61,4,-4,31,27,-18,64,0,-2,31,29,-19,66,2,1,38,26,-11,66,5,0,38,24,-11,63,3,-2,31,25,-16,66,0,0,31,27,-17,68,1,1,31,28,-17,68,2,0,31,26,-17,67,1,0,38,25,-11,65,4,1,39,27,-11,66,6,0,31,30,-19,67,3,-2,31,28,-19,65,2,-2,39,29,-14,61,6,0,39,30,-14,63,8,1,39,30,-13,65,9,-1,39,30,-13,62,7,0,32,28,-19,65,3,2,32,29,-19,67,5,2,40,28,-12,66,8,0,40,26,-11,65,6,1,32,26,-17,67,2,3,33,28,-18,68,4,2,39,28,-11,66,8,-1,38,23,-10,62,2,-1,42,23,-8,60,4,2,42,27,-9,63,8,1,40,30,-13,64,9,-4,39,25,-12,60,3,-3,42,25,-11,59,4,0,43,28,-11,62,9,-2,39,29,-14,61,6,-2,43,27,-11,59,7,1,38,25,-10,65,5,0,42,25,-8,62,6,4,30,27,-19,70,3,2,29,26,-19,69,2,1,32,27,-17,66,3,2,33,28,-17,67,5,3,29,28,-20,69,3,2,29,28,-20,69,2,0,32,28,-19,66,3,2,32,29,-19,67,5,2,28,27,-20,69,1,4,29,28,-20,70,3,2,29,27,-19,69,2,4,30,27,-19,70,3,4,29,26,-18,71,2,3,28,26,-18,70,1,4,28,27,-19,71,2,3,27,26,-19,70,1,4,27,26,-19,71,0,5,28,26,-19,72,2,3,28,27,-18,70,1,4,29,27,-18,71,2,4,30,26,-17,73,1,3,30,25,-17,72,0,5,29,25,-18,73,1,4,29,25,-18,72,0,2,25,24,-19,73,-3,3,25,25,-19,74,-2,2,26,24,-18,72,-2,3,26,25,-18,73,-1,2,26,27,-19,72,0,1,26,26,-19,71,-1,2,25,27,-20,72,-1,1,24,26,-20,71,-2,1,25,26,-21,71,-1,2,25,27,-21,72,0,1,26,25,-19,70,-1,2,26,26,-19,71,0,1,28,28,-20,70,1,0,27,26,-20,69,0,1,26,29,-21,70,0,0,26,27,-21,69,0,0,31,29,-19,67,3,-1,31,28,-19,66,1,0,27,28,-21,68,0,1,27,29,-21,70,1,1,32,28,-17,68,2,0,31,26,-17,67,1,0,27,26,-20,69,0,2,28,27,-20,70,0,-1,26,28,-20,70,-1,-2,26,27,-20,68,-3,-2,31,26,-16,66,0,-1,31,27,-17,67,1,-2,26,29,-21,69,-1,-4,26,28,-21,67,-2,-4,31,27,-19,65,0,-2,31,29,-19,66,1,-4,25,28,-21,68,-3,-2,25,29,-22,70,-2,-2,26,27,-20,68,-2,-1,26,28,-20,69,-1,-1,24,28,-20,71,-2,-2,24,26,-19,70,-4,-2,23,29,-21,71,-3,-3,23,28,-21,70,-4,-2,23,27,-20,71,-5,-1,23,28,-21,72,-3,-2,24,26,-19,70,-4,0,24,28,-20,71,-2,0,22,27,-18,72,-3,-1,22,26,-18,71,-4,0,21,27,-19,73,-4,-1,21,26,-19,72,-5,-5,22,28,-18,72,-6,-5,22,29,-19,72,-6,-5,22,27,-18,71,-6,-4,22,28,-18,72,-5,-4,24,28,-18,71,-4,-5,24,27,-18,70,-5,-5,24,29,-20,71,-4,-6,24,28,-19,70,-6,-6,25,28,-20,69,-5,-5,25,29,-20,70,-4,-5,24,27,-18,69,-5,-4,25,28,-18,71,-4,-4,26,28,-18,69,-2,-5,26,27,-18,68,-4,-5,26,29,-20,69,-3,-6,26,28,-20,68,-4,-4,32,28,-18,66,0,-5,31,26,-18,64,0,-6,27,27,-19,67,-3,-5,28,29,-20,68,-2,-3,31,26,-16,67,0,-4,31,25,-16,65,-1,-5,27,26,-18,68,-4,-4,27,28,-18,69,-2,-6,24,28,-20,70,-5,-5,24,27,-18,70,-5,-4,24,28,-18,71,-4,-5,24,29,-20,71,-4,-6,27,28,-20,68,-4,-5,26,27,-18,68,-4,-4,27,28,-19,69,-2,-5,27,29,-20,69,-2,-2,26,29,-22,69,-1,-1,26,28,-20,69,-1,-2,26,27,-20,68,-2,-4,26,28,-21,68,-3,-1,23,29,-21,71,-3,-1,24,28,-20,71,-2,-2,24,26,-19,70,-4,-3,23,27,-21,70,-4,0,26,28,-21,69,0,0,27,26,-20,69,0,1,28,28,-20,70,0,1,27,29,-21,70,0,1,24,26,-20,71,-2,1,26,26,-19,70,-1,2,26,27,-19,72,0,2,25,27,-21,72,0,4,29,28,-20,70,3,4,30,27,-19,70,3,2,29,27,-19,69,2,2,28,28,-20,69,2,5,28,27,-19,71,2,4,28,27,-18,71,2,3,28,26,-18,70,1,4,27,26,-19,71,1,-4,34,22,-15,61,0,-2,34,25,-14,64,0,0,35,23,-11,63,-1,-2,35,21,-13,60,-1,-4,31,22,-16,63,-3,-2,32,24,-14,64,-2,-1,32,22,-13,64,-3,-2,32,20,-14,62,-4,0,37,25,-11,65,3,-3,35,27,-15,63,2,-2,40,22,-10,59,2,-4,40,24,-12,60,3,-2,33,21,-14,61,-3,-4,33,22,-15,62,-2,0,33,23,-12,63,-2,-2,33,24,-14,64,-1,-2,31,20,-14,63,-5,-3,30,22,-16,64,-4,0,31,22,-13,64,-3,-2,31,24,-14,65,-2,-1,28,23,-14,67,-4,0,28,22,-13,66,-4,-2,27,22,-15,67,-5,-1,28,21,-14,66,-6,-4,34,22,-15,61,-1,-2,33,24,-14,64,0,0,34,23,-12,63,-2,-2,34,21,-13,60,-2,-1,32,22,-13,64,-3,-2,31,20,-14,63,-5,-2,31,24,-14,64,-2,-4,31,22,-16,63,-4,-3,38,26,-13,62,3,2,60,-13,-15,55,-16,-1,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,61,-16,-1,58,-6,-12,57,-7,2,66,-6,-15,66,-7,3,58,-15,-16,59,-16,1,62,-6,-14,62,-7,-1,56,-8,-11,55,-9,3,66,-11,-16,66,-12] }, + { "name": "animation_000006", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-7,66,-7,-17,66,-7,-6,70,5,-17,71,5,-6,78,-11,-17,79,-11,-6,81,2,-16,82,2,-5,68,0,-19,69,0,-4,82,-4,-18,82,-4,-9,61,1,-15,62,1,-10,63,8,-13,63,8,-5,76,4,-18,76,5,-6,73,-11,-18,74,-11,-3,75,-3,-20,76,-3,-12,71,10,-12,66,-9,-11,83,4,-12,80,-13,-12,68,0,-11,85,-5,-12,61,1,-12,63,8,-11,76,7,-12,73,-13,-5,74,4,-18,74,4,-6,69,-10,-18,70,-9,-4,72,-2,-20,72,-1,-11,74,7,-12,69,-11,15,44,12,-26,38,10,14,48,10,-27,41,8,11,51,9,-26,46,7,7,51,9,-22,48,8,4,48,10,-19,46,10,5,44,12,-18,42,12,8,41,14,-19,38,13,12,41,14,-23,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-10,36,-26,3,38,-23,-7,39,-22,0,36,-18,-5,39,-18,1,30,-15,-3,33,-14,6,25,-14,-5,26,-14,10,25,-18,-8,24,-18,14,38,-14,-18,34,-15,14,33,-12,-16,29,-13,10,41,-15,-16,39,-16,4,42,-15,-11,42,-15,1,38,-13,-7,40,-13,2,33,-11,-6,35,-10,6,29,-10,-7,29,-9,11,29,-10,-12,27,-11,14,43,-2,-22,38,-4,15,39,0,-21,33,-2,10,46,-3,-21,42,-5,5,46,-3,-16,45,-4,3,43,-2,-13,44,-2,3,39,0,-11,39,0,7,35,0,-13,34,0,12,35,0,-17,32,0,28,14,15,-31,11,31,29,15,18,-33,13,33,29,16,22,-33,16,35,26,15,24,-31,17,37,23,14,23,-28,16,38,22,12,20,-26,14,36,23,11,16,-26,11,33,25,12,14,-28,10,31,14,45,7,-26,36,8,16,47,11,-29,39,10,15,47,16,-29,42,14,12,46,19,-26,44,17,8,44,18,-21,43,17,6,42,13,-18,40,14,7,41,9,-18,37,11,10,43,6,-21,35,8,20,38,12,-30,31,16,18,36,8,-27,28,13,19,38,17,-30,34,20,16,37,20,-27,36,23,12,35,19,-23,35,23,10,33,15,-20,32,20,11,32,9,-20,29,16,14,33,7,-23,27,13,23,31,13,-31,25,20,21,29,9,-28,22,18,22,31,18,-32,28,24,19,30,21,-28,30,27,15,28,20,-24,29,27,13,26,16,-21,26,25,14,26,11,-21,23,21,18,27,8,-24,22,18,26,23,16,-32,19,27,25,21,13,-30,16,25,26,23,20,-32,21,30,23,22,22,-30,23,32,20,20,21,-26,22,33,18,19,18,-24,20,30,19,18,14,-24,17,27,22,19,12,-26,16,25,11,47,19,-25,42,17,12,51,15,-28,45,12,6,51,15,-23,48,14,6,45,16,-20,43,15,11,42,16,-22,38,14,15,46,14,-27,39,12,8,52,10,-24,48,8,4,48,11,-19,46,10,7,42,11,-18,40,10,12,43,9,-23,38,8,13,49,9,-27,42,7,8,46,7,-21,43,5,12,50,17,-27,44,15,9,49,18,-25,45,16,9,52,15,-26,47,13,13,46,17,-27,40,15,14,49,15,-29,42,12,8,46,18,-22,42,17,6,48,17,-21,46,16,11,44,18,-24,39,16,8,43,17,-21,40,15,13,43,15,-25,37,13,15,47,12,-28,40,9,12,50,12,-27,44,10,11,52,12,-27,47,10,7,52,13,-24,48,11,5,50,13,-21,48,12,5,47,13,-20,45,13,6,43,14,-19,41,13,9,41,13,-20,38,12,12,41,12,-22,37,11,15,44,12,-26,37,9,11,51,9,-26,45,7,6,50,10,-21,48,9,4,45,10,-17,43,10,10,42,10,-20,38,8,13,45,9,-25,40,6,11,48,7,-24,43,5,8,49,7,-22,46,6,6,47,8,-19,45,7,7,44,8,-19,41,7,10,44,7,-22,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,52,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-11,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-30,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-5,59,-25,-4,67,-11,-14,64,-12,-1,65,-9,-15,60,-12,-2,60,-9,-12,57,-10,-7,57,-9,-9,67,-12,-6,67,-10,-12,65,-12,-4,64,-9,-13,61,-11,-4,60,-8,-11,58,-10,-7,58,-9,-9,67,-11,-8,66,-5,-13,65,-7,-7,64,-4,-13,62,-6,-7,61,-4,-11,60,-6,-9,59,-5,-11,67,-6,-8,66,-5,-12,65,-6,-7,64,-4,-13,62,-5,-8,61,-3,-12,60,-4,-10,59,-3,-10,66,-6,-9,68,-3,-14,67,-5,-7,65,-2,-14,64,-4,-8,62,-1,-13,61,-3,-10,60,-2,-11,69,-4,11,59,-6,-19,57,-9,10,56,-6,-17,58,-8,7,56,-6,-16,59,-6,5,57,-6,-17,61,-4,4,59,-5,-20,63,-4,5,62,-4,-22,62,-5,8,62,-4,-23,60,-7,10,61,-5,-22,58,-8,12,53,12,-22,45,5,11,51,12,-20,45,6,9,51,12,-20,46,7,7,52,12,-20,48,8,7,54,13,-22,49,9,8,56,13,-24,48,8,10,56,13,-25,47,6,12,55,13,-24,45,5,11,53,5,-18,49,0,12,55,5,-21,49,0,8,52,5,-17,51,2,6,53,5,-18,53,4,5,55,6,-21,54,4,7,58,6,-23,53,3,9,59,6,-24,52,1,12,57,6,-23,50,0,10,54,0,-18,53,-3,12,57,0,-20,53,-4,8,54,0,-17,55,-1,5,55,0,-18,57,0,5,57,1,-20,58,0,6,59,1,-23,57,0,9,60,1,-24,56,-2,11,59,1,-23,54,-4,10,55,-3,-17,55,-5,11,58,-2,-20,55,-6,8,54,-3,-16,57,-3,5,56,-2,-17,59,-2,4,58,-2,-20,60,-2,6,61,-1,-22,60,-3,8,61,-1,-23,58,-4,11,60,-2,-22,56,-6,0,44,26,-13,60,8,0,44,25,-13,60,7,-1,43,24,-13,60,5,0,42,23,-13,59,4,0,41,23,-11,58,4,1,41,24,-11,58,6,2,42,26,-11,58,7,1,43,26,-11,59,8,10,56,15,-25,45,10,9,56,14,-26,46,9,8,55,13,-26,46,7,9,53,12,-24,45,5,10,52,12,-23,43,5,12,52,13,-22,42,7,13,53,14,-22,43,9,12,55,16,-23,44,10,1,47,22,-17,56,7,3,47,23,-16,56,9,1,46,21,-17,56,6,1,45,20,-16,55,4,3,44,20,-14,54,5,4,44,21,-14,53,6,5,45,23,-14,54,8,4,46,24,-14,54,9,6,54,16,-24,49,8,8,54,18,-23,48,10,6,53,15,-24,49,6,7,51,13,-22,48,4,9,49,13,-20,46,4,10,49,15,-19,45,6,11,50,16,-20,45,8,10,52,18,-21,46,10,8,55,15,-25,47,9,10,56,16,-24,46,10,7,54,13,-25,47,6,8,52,12,-24,46,5,10,51,12,-22,44,5,12,51,13,-21,43,7,12,53,15,-22,43,9,12,54,16,-23,44,10,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,28,-33,9,46,34,7,27,-38,8,44,36,2,29,-40,2,43,25,7,30,-30,7,48,26,3,32,-30,2,48,30,9,36,-36,6,53,27,8,36,-32,6,53,36,8,33,-41,5,49,37,5,35,-41,2,50,27,6,38,-32,2,54,31,6,38,-36,2,54,28,3,39,-32,0,54,31,4,39,-36,0,54,37,3,36,-41,0,50,26,0,33,-30,0,48,37,0,30,-40,0,43,30,0,32,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,6,38,-36,2,54,27,6,38,-32,2,54,37,5,35,-41,2,50,28,3,39,-32,0,54,31,4,39,-36,0,54,37,3,36,-41,0,50,26,3,32,-30,2,48,26,0,33,-30,0,48,36,2,29,-40,2,43,37,0,30,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,10,61,-9,-22,62,-10,7,56,-8,-21,57,-9,-3,56,-12,-9,56,-13,1,63,-18,-14,63,-18,8,63,-3,-21,64,-4,6,57,-2,-19,58,-3,-5,57,-9,-8,56,-9,0,66,-8,-12,66,-8,3,55,-10,-17,56,-11,8,58,-13,-21,59,-14,2,59,-4,-15,59,-4,4,65,-5,-17,65,-5,8,58,-9,-22,59,-10,0,60,-17,-13,60,-18,7,60,-1,-20,61,-2,2,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-7,9,63,-7,-22,64,-8,-5,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-8,6,65,-10,-18,66,-11,5,56,-9,-19,56,-10,9,59,-11,-22,61,-12,4,58,-2,-17,58,-3,6,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-18,61,-3,3,56,-6,-17,56,-7,8,64,-8,-20,65,-9,-2,31,26,-16,67,0,-4,31,25,-16,66,-1,-1,38,23,-10,62,2,0,38,25,-11,64,4,-4,32,28,-18,65,1,-6,32,26,-17,64,-1,-4,39,25,-13,60,3,-3,39,28,-14,61,5,-2,39,29,-14,62,6,-3,39,27,-13,61,4,-4,31,27,-18,64,0,-2,31,29,-19,66,2,1,38,26,-11,66,5,0,38,24,-11,63,3,-2,31,25,-16,66,0,0,31,27,-17,68,1,1,31,28,-17,68,2,0,31,26,-17,67,1,0,38,25,-11,65,4,1,39,27,-11,66,6,0,31,30,-19,67,3,-2,31,28,-19,65,2,-2,39,29,-14,61,6,0,39,30,-14,63,8,1,39,30,-13,65,9,-1,39,30,-13,62,7,0,32,28,-19,65,3,2,32,29,-19,67,5,2,40,28,-12,66,8,0,40,26,-11,65,6,1,32,26,-17,67,2,3,33,28,-18,68,4,2,39,28,-11,66,8,-1,38,23,-10,62,2,-1,42,23,-8,60,4,2,42,27,-9,63,8,1,40,30,-13,64,9,-4,39,25,-12,60,3,-3,42,25,-11,59,4,0,43,28,-11,62,9,-2,39,29,-14,61,6,-2,43,27,-11,59,7,1,38,25,-10,65,5,0,42,25,-8,62,6,4,30,27,-19,70,3,2,29,26,-19,69,2,1,32,27,-17,66,3,2,33,28,-17,67,5,3,29,28,-20,69,3,2,29,28,-20,68,2,0,32,28,-19,66,3,2,32,29,-19,67,5,2,28,27,-20,69,1,4,29,28,-20,70,3,2,29,27,-19,69,2,4,30,27,-19,70,3,4,29,26,-18,71,2,3,28,26,-18,70,1,4,28,27,-20,71,2,3,27,26,-20,70,1,4,27,26,-19,71,0,5,28,26,-19,72,2,3,28,27,-18,70,1,4,29,27,-18,71,2,4,30,26,-18,73,1,3,30,25,-18,72,0,5,29,25,-18,73,1,4,29,25,-18,72,0,2,25,24,-19,73,-3,3,25,25,-20,73,-2,2,26,24,-18,72,-2,3,26,25,-19,73,-1,2,26,27,-19,72,0,1,26,26,-19,71,-1,2,25,27,-21,72,-1,1,24,26,-21,71,-2,1,25,26,-21,71,-1,2,25,27,-21,72,0,1,26,25,-19,70,-1,2,26,26,-19,71,0,1,28,28,-20,70,1,0,27,26,-20,69,0,1,26,29,-22,70,0,0,26,27,-21,69,0,0,31,29,-19,67,3,-1,31,28,-19,66,1,0,27,28,-21,68,0,1,27,29,-21,69,1,1,32,28,-17,68,2,0,31,26,-17,67,1,0,27,26,-20,69,0,2,28,27,-20,70,0,-1,26,28,-20,70,-1,-2,26,27,-20,68,-3,-2,31,26,-16,66,0,-1,31,27,-17,67,1,-2,26,29,-22,69,-1,-4,26,28,-21,67,-2,-4,31,27,-18,65,0,-2,31,29,-19,66,1,-4,25,28,-22,68,-3,-2,25,29,-22,69,-1,-2,26,27,-20,68,-2,-1,26,28,-20,69,-1,-1,24,28,-20,71,-2,-2,24,26,-20,70,-4,-2,23,29,-21,71,-3,-3,23,28,-21,70,-4,-2,23,27,-21,71,-5,-1,23,28,-21,72,-3,-2,24,26,-20,70,-4,0,24,28,-20,71,-2,0,22,27,-19,72,-3,-1,22,26,-18,71,-4,0,21,27,-19,73,-4,-1,21,26,-19,72,-5,-5,22,28,-18,72,-6,-5,22,29,-18,72,-6,-5,22,27,-17,71,-6,-4,22,28,-18,72,-5,-4,24,28,-18,71,-4,-5,24,27,-18,70,-5,-5,24,29,-20,71,-4,-6,24,28,-19,70,-6,-6,25,28,-19,69,-5,-5,25,29,-20,70,-4,-5,24,27,-18,69,-5,-4,25,28,-18,71,-4,-4,26,28,-18,69,-2,-5,26,27,-18,68,-4,-5,26,29,-20,69,-3,-6,26,28,-20,68,-4,-4,32,28,-18,66,0,-5,31,26,-18,64,0,-6,27,27,-19,67,-3,-5,28,29,-20,68,-2,-3,31,26,-16,67,0,-4,31,25,-16,65,-1,-5,27,26,-18,68,-4,-4,27,28,-18,69,-2,-6,24,28,-19,70,-5,-5,24,27,-18,70,-5,-4,24,28,-18,71,-4,-5,24,29,-20,71,-4,-6,27,28,-20,68,-4,-5,26,27,-18,68,-4,-4,27,28,-18,69,-2,-5,27,29,-20,69,-2,-2,26,29,-22,69,-1,-1,26,28,-20,69,-1,-2,26,27,-20,68,-2,-4,26,28,-22,68,-2,-1,23,29,-21,71,-3,-1,24,28,-20,71,-2,-2,24,26,-20,70,-4,-3,23,27,-21,70,-4,0,26,28,-21,69,0,0,27,26,-20,69,0,1,28,28,-20,70,0,1,27,29,-22,70,0,1,24,26,-21,71,-2,1,26,26,-19,70,-1,2,26,27,-19,71,0,2,25,27,-21,72,0,4,29,28,-20,70,3,4,30,27,-19,70,3,2,29,27,-19,69,2,2,28,28,-20,69,2,5,28,27,-20,71,2,4,28,27,-18,71,2,3,28,26,-18,70,1,4,27,26,-20,71,1,-4,34,22,-15,61,0,-2,34,25,-14,64,0,0,35,23,-11,62,-1,-2,35,21,-13,60,-1,-4,31,22,-16,63,-3,-2,32,24,-14,64,-2,-1,32,22,-13,64,-3,-2,32,20,-14,62,-4,0,37,25,-11,65,3,-3,35,27,-15,63,2,-2,40,22,-10,59,2,-4,40,24,-12,60,3,-2,33,21,-14,61,-3,-4,33,22,-15,62,-2,0,33,23,-12,63,-2,-2,33,24,-14,64,-1,-2,31,20,-14,63,-5,-3,30,22,-16,64,-4,0,31,22,-13,64,-3,-2,31,24,-14,65,-2,-1,28,23,-14,67,-4,0,28,22,-13,66,-4,-2,28,22,-15,67,-5,-1,28,21,-13,66,-6,-4,34,22,-15,61,-1,-2,33,24,-14,64,0,0,34,23,-12,63,-2,-2,34,21,-13,60,-2,-1,32,22,-13,64,-3,-2,31,20,-14,63,-5,-2,31,24,-14,64,-2,-3,31,22,-16,63,-4,-3,38,26,-13,62,3,2,60,-13,-15,55,-16,-1,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,61,-16,-1,58,-6,-12,57,-7,2,66,-6,-15,66,-7,3,58,-15,-16,59,-16,1,62,-6,-14,62,-7,-1,56,-8,-11,55,-9,3,66,-11,-16,66,-12] }, + { "name": "animation_000007", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-7,66,-7,-17,67,-7,-6,70,5,-17,71,5,-6,78,-11,-17,79,-11,-6,81,2,-16,82,3,-5,68,0,-19,69,0,-4,82,-4,-18,82,-4,-9,61,1,-15,62,1,-10,63,8,-13,63,8,-5,75,4,-18,76,5,-6,73,-11,-18,74,-11,-3,75,-3,-20,76,-3,-11,71,10,-12,66,-9,-11,83,4,-11,80,-12,-12,68,0,-11,85,-5,-12,61,1,-12,63,8,-11,76,7,-12,73,-13,-5,73,4,-18,74,4,-6,69,-10,-18,70,-9,-4,71,-2,-20,72,-1,-11,74,7,-12,69,-11,15,44,12,-26,38,10,14,48,10,-27,41,8,11,51,9,-26,46,7,7,51,9,-22,48,8,4,48,10,-19,46,10,5,44,12,-18,42,12,8,41,14,-20,38,13,12,41,14,-23,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-11,36,-26,3,38,-23,-7,39,-22,0,36,-18,-5,39,-18,1,30,-15,-3,33,-14,6,25,-14,-5,27,-14,10,25,-18,-8,24,-18,14,38,-14,-18,34,-15,14,33,-12,-16,29,-13,10,41,-15,-16,39,-16,4,42,-15,-12,42,-15,1,38,-13,-7,41,-13,2,33,-11,-6,35,-10,6,29,-10,-7,29,-9,11,29,-10,-12,27,-11,14,43,-2,-22,38,-4,15,39,0,-21,33,-2,10,46,-3,-21,42,-5,5,46,-3,-17,45,-4,3,43,-2,-13,44,-2,3,39,0,-11,39,0,7,35,0,-13,34,0,12,35,0,-17,32,0,28,14,15,-31,11,31,29,15,18,-33,13,33,29,16,22,-33,16,35,26,15,24,-31,17,37,23,14,23,-28,16,38,22,12,20,-26,14,36,23,11,16,-25,11,33,25,12,14,-28,10,31,14,45,7,-26,36,8,16,47,11,-29,39,10,15,47,16,-29,42,14,12,46,19,-26,44,17,8,44,18,-22,43,17,6,42,13,-18,40,14,7,41,9,-18,37,10,10,43,6,-21,35,8,20,38,12,-30,31,16,18,36,8,-27,28,13,19,38,17,-31,34,20,16,37,20,-27,36,23,12,35,19,-23,35,23,10,33,15,-20,32,20,11,32,9,-20,29,16,14,33,7,-23,27,13,23,31,13,-31,25,20,21,29,9,-28,22,18,22,31,18,-32,28,24,19,30,21,-28,30,27,15,28,20,-24,29,27,13,26,16,-21,26,25,14,26,11,-21,23,21,18,27,8,-24,22,18,26,23,16,-32,19,27,25,21,13,-30,16,25,26,23,20,-32,21,30,23,22,22,-30,23,32,20,20,21,-26,22,33,18,19,18,-24,20,30,19,18,14,-24,17,27,22,19,12,-26,16,25,11,47,19,-25,42,17,12,51,15,-28,45,12,6,51,15,-23,48,14,6,45,16,-20,43,15,11,42,16,-22,38,14,15,46,14,-28,39,12,8,52,10,-24,48,8,4,48,11,-19,46,10,7,42,11,-18,40,10,12,43,9,-23,38,8,13,49,9,-27,42,7,8,46,7,-21,43,5,12,50,17,-28,44,15,9,49,18,-25,45,16,9,52,15,-26,47,13,13,46,17,-27,40,15,14,49,15,-29,42,12,8,46,18,-22,42,17,6,48,17,-21,46,15,11,44,18,-24,39,16,8,43,17,-21,40,15,13,43,15,-25,37,13,15,47,12,-28,40,9,12,50,12,-27,44,10,11,52,12,-27,47,10,7,52,13,-24,48,11,5,50,13,-21,48,12,5,47,13,-20,45,12,6,43,14,-19,41,13,9,41,13,-20,38,12,12,41,12,-22,37,11,15,44,12,-26,37,9,11,51,9,-26,45,7,6,50,10,-21,48,9,4,45,10,-17,43,10,10,42,10,-20,38,8,13,45,9,-25,39,6,11,48,7,-24,43,5,8,49,7,-22,46,6,6,47,8,-19,45,7,7,44,8,-19,41,7,10,44,7,-22,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,52,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-11,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-30,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-5,59,-25,-4,67,-11,-14,64,-12,-1,65,-9,-15,60,-12,-2,60,-9,-12,57,-10,-7,57,-9,-9,67,-12,-6,67,-10,-12,65,-12,-4,64,-9,-13,61,-11,-4,60,-8,-11,58,-10,-7,58,-9,-9,67,-11,-8,66,-5,-13,65,-7,-7,64,-4,-13,62,-6,-7,61,-4,-11,60,-6,-9,59,-5,-11,67,-6,-8,66,-5,-12,65,-6,-7,64,-4,-13,62,-5,-8,61,-3,-12,60,-4,-10,59,-3,-10,66,-6,-9,68,-3,-14,67,-5,-7,65,-2,-14,64,-4,-8,62,-1,-13,61,-3,-10,60,-2,-11,69,-4,11,59,-6,-19,57,-9,10,56,-6,-17,58,-8,7,56,-6,-16,60,-6,5,57,-6,-17,62,-4,4,59,-5,-19,63,-4,5,62,-4,-22,62,-5,8,62,-4,-23,61,-7,10,61,-5,-22,59,-8,12,53,12,-23,45,5,11,51,12,-21,45,6,9,51,12,-20,47,7,7,52,12,-21,48,8,7,54,13,-23,49,8,8,56,13,-25,49,8,10,56,13,-25,47,6,12,55,13,-24,46,5,11,53,5,-19,50,0,12,55,5,-21,49,0,8,52,5,-18,51,2,6,53,5,-19,53,4,5,55,6,-21,54,4,7,58,6,-23,54,3,9,59,6,-24,52,1,12,57,6,-23,50,0,10,54,0,-18,53,-3,12,57,0,-20,53,-4,8,54,0,-17,55,-1,5,55,0,-18,57,0,5,57,1,-20,58,0,6,59,1,-23,58,0,9,60,1,-24,56,-2,11,59,0,-23,54,-4,10,55,-3,-17,56,-5,11,58,-2,-20,55,-6,8,54,-3,-16,57,-3,5,56,-2,-17,59,-2,4,58,-2,-20,60,-2,6,61,-1,-22,60,-3,8,61,-1,-23,58,-4,11,60,-2,-22,56,-6,0,44,26,-13,59,8,0,44,25,-13,60,7,-1,43,24,-13,60,5,0,42,23,-13,59,4,0,41,23,-11,58,4,1,41,24,-11,58,6,2,42,26,-11,58,7,1,43,26,-11,58,8,10,56,15,-25,45,10,9,56,14,-26,46,9,8,55,13,-26,46,6,9,53,12,-25,45,5,10,52,12,-23,43,5,12,52,13,-22,43,7,13,53,14,-23,43,9,12,55,16,-24,44,10,1,47,22,-17,57,7,3,47,23,-16,56,9,1,46,21,-17,56,6,1,45,20,-16,55,4,3,44,20,-15,54,5,4,44,21,-14,53,6,5,45,23,-14,54,8,4,46,24,-15,54,9,6,54,16,-24,49,8,8,54,18,-23,48,10,6,53,15,-24,49,6,7,51,13,-22,48,4,9,49,13,-21,46,4,10,49,15,-20,45,6,11,50,16,-20,45,8,10,52,18,-21,47,10,8,55,15,-26,47,9,10,56,16,-25,46,10,7,54,13,-25,47,6,8,52,12,-24,46,5,10,51,12,-22,44,5,12,51,13,-21,43,6,12,53,15,-22,43,9,12,54,16,-23,44,10,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,10,61,-9,-22,62,-10,7,56,-8,-21,58,-9,-3,56,-12,-9,56,-13,1,63,-18,-13,63,-18,8,63,-3,-21,64,-4,6,57,-2,-19,58,-3,-5,57,-9,-8,56,-9,0,66,-8,-12,66,-8,3,55,-10,-17,56,-11,8,58,-13,-21,60,-14,2,59,-4,-15,59,-4,4,65,-5,-17,65,-5,8,58,-9,-22,59,-10,0,60,-17,-13,61,-18,7,60,-1,-20,61,-2,2,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-7,9,63,-7,-22,64,-8,-5,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-8,6,65,-10,-18,66,-11,5,56,-9,-19,57,-10,9,59,-11,-22,61,-12,4,58,-2,-17,59,-3,6,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-18,61,-3,3,56,-6,-17,56,-7,8,64,-8,-20,65,-9,-2,31,26,-16,68,0,-4,31,25,-16,66,-1,-1,38,23,-10,62,2,0,38,25,-10,64,4,-4,32,28,-18,66,1,-6,32,26,-17,64,-1,-4,39,25,-13,60,3,-3,39,28,-14,61,5,-2,39,29,-14,62,6,-3,39,27,-13,61,4,-4,31,27,-18,64,0,-2,31,29,-19,66,2,1,38,26,-11,66,5,0,38,24,-11,63,3,-2,31,25,-16,67,0,0,31,27,-16,68,1,1,31,28,-17,68,2,0,31,26,-17,67,1,0,39,25,-10,65,4,1,39,27,-11,66,6,0,31,30,-19,67,3,-2,31,28,-19,65,2,-2,39,29,-14,61,6,0,39,30,-14,63,8,1,39,30,-13,65,9,-1,39,30,-13,62,7,0,32,28,-19,65,3,2,32,29,-19,67,5,2,40,28,-12,66,8,0,40,26,-11,65,6,1,32,26,-17,67,2,3,33,28,-18,68,4,2,39,28,-11,66,8,-1,38,23,-10,62,2,-1,42,23,-8,60,4,2,42,27,-9,63,9,1,40,30,-12,64,9,-4,39,25,-12,60,3,-3,42,25,-11,58,4,0,43,28,-10,61,9,-2,39,29,-14,61,6,-2,43,27,-11,59,7,1,38,25,-10,65,5,0,42,25,-8,62,6,4,30,27,-19,70,3,2,29,26,-19,69,2,1,32,27,-17,66,3,2,33,28,-17,67,5,3,29,28,-20,69,3,2,29,28,-20,69,2,0,32,28,-19,66,3,2,32,29,-19,67,5,2,28,27,-20,69,1,4,29,28,-20,70,3,2,29,27,-19,69,2,4,30,27,-19,70,3,4,29,26,-18,71,2,3,28,26,-18,70,1,4,28,27,-19,71,2,3,27,26,-20,71,1,4,27,26,-19,71,1,5,28,26,-19,72,2,3,28,27,-18,71,1,4,29,27,-18,71,2,4,30,26,-17,73,1,3,30,25,-18,72,0,5,29,25,-18,73,1,4,29,25,-18,72,0,2,25,24,-19,73,-3,3,25,25,-19,74,-2,2,26,24,-18,72,-2,3,26,25,-18,73,-1,2,26,27,-19,72,0,1,26,26,-19,71,-1,2,25,27,-21,72,0,1,24,26,-20,71,-2,1,25,26,-21,71,-1,2,25,27,-21,72,0,1,26,25,-19,70,-1,2,26,26,-19,71,0,1,28,28,-20,70,1,0,27,26,-20,69,0,1,26,29,-21,70,0,0,26,27,-21,69,0,0,31,29,-19,67,3,-1,31,28,-19,66,2,0,27,28,-21,68,0,1,27,29,-21,70,1,1,32,28,-17,68,2,0,31,26,-17,67,1,0,27,26,-20,69,0,2,28,27,-20,70,0,-1,26,28,-20,70,-1,-2,26,27,-20,68,-3,-2,31,26,-16,66,0,-1,31,27,-17,67,1,-2,26,29,-21,69,-1,-4,26,28,-21,67,-2,-4,31,27,-18,65,0,-2,31,29,-19,66,1,-4,25,28,-21,68,-3,-2,25,29,-22,70,-1,-2,26,27,-20,68,-2,-1,26,28,-20,69,-1,-1,24,28,-20,71,-2,-2,24,26,-19,70,-4,-2,23,29,-21,71,-3,-3,23,28,-21,70,-4,-2,23,27,-21,71,-4,-1,23,28,-21,72,-3,-2,24,26,-19,70,-4,0,24,28,-20,71,-2,0,22,27,-18,72,-3,-1,22,26,-18,71,-4,0,21,27,-19,73,-4,-1,21,26,-19,72,-5,-5,22,28,-18,72,-6,-5,22,29,-18,73,-5,-5,22,27,-17,71,-6,-4,22,28,-17,72,-5,-4,24,28,-18,71,-4,-5,24,27,-17,70,-5,-5,24,29,-19,71,-4,-6,24,28,-19,70,-5,-6,25,28,-19,70,-5,-5,25,29,-19,71,-4,-5,24,27,-17,70,-5,-4,25,28,-18,71,-3,-4,26,28,-18,70,-2,-5,26,27,-18,68,-4,-5,26,29,-20,70,-3,-6,26,28,-19,68,-4,-4,32,28,-18,66,0,-5,31,26,-17,64,0,-6,27,27,-19,67,-3,-5,28,29,-19,69,-2,-3,31,26,-16,67,0,-4,31,25,-16,65,-1,-5,27,26,-18,68,-3,-4,27,28,-18,69,-2,-6,24,28,-19,70,-5,-5,24,27,-18,70,-5,-4,24,28,-18,71,-4,-5,24,29,-19,71,-4,-6,27,28,-19,68,-4,-5,26,27,-18,68,-4,-4,27,28,-18,69,-2,-5,27,29,-20,69,-2,-2,26,29,-22,69,-1,-1,26,28,-20,70,-1,-2,26,27,-20,68,-2,-4,26,28,-21,68,-2,-1,23,29,-21,71,-3,-1,24,28,-20,71,-2,-2,24,26,-19,70,-4,-3,23,27,-21,70,-4,0,26,28,-21,69,0,0,27,26,-20,69,0,1,28,28,-20,70,0,1,27,29,-21,70,0,1,24,26,-21,71,-2,1,26,26,-19,71,-1,2,26,27,-19,72,0,2,25,27,-21,72,0,4,29,28,-20,70,3,4,30,27,-19,70,3,2,29,27,-19,69,2,2,28,28,-20,69,2,5,28,27,-19,72,2,4,29,27,-18,71,2,3,28,26,-18,70,1,4,27,26,-19,71,1,-4,34,22,-15,61,0,-2,34,25,-13,64,0,0,35,23,-11,62,-1,-2,35,21,-13,60,-1,-4,31,22,-15,63,-3,-2,32,24,-14,64,-2,-1,32,22,-12,64,-3,-2,32,20,-14,62,-4,0,37,25,-11,65,3,-3,35,27,-15,63,2,-2,40,22,-10,59,2,-4,40,24,-12,60,3,-2,33,21,-13,61,-3,-4,33,22,-15,62,-1,0,33,23,-12,63,-2,-2,33,24,-14,64,-1,-2,31,20,-14,63,-5,-3,30,22,-15,64,-4,0,31,22,-12,64,-3,-2,31,24,-14,65,-2,-1,28,23,-14,67,-4,0,28,22,-13,66,-4,-2,28,22,-14,67,-5,-1,28,21,-13,66,-6,-4,34,22,-15,61,-1,-2,33,24,-14,64,0,0,34,23,-12,63,-2,-2,34,21,-13,60,-2,0,32,22,-12,64,-3,-2,31,20,-14,63,-4,-2,31,24,-14,64,-2,-3,31,22,-15,63,-3,-3,38,26,-13,62,3,2,60,-13,-15,55,-16,-1,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,61,-16,-1,58,-6,-11,57,-7,2,66,-6,-14,66,-7,3,58,-15,-16,59,-16,1,62,-6,-14,62,-7,-1,56,-8,-11,55,-9,3,66,-11,-15,66,-12] }, + { "name": "animation_000008", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-7,66,-7,-17,67,-7,-6,70,5,-17,71,5,-6,78,-11,-17,79,-11,-6,81,3,-16,82,3,-5,68,0,-19,69,0,-4,81,-4,-18,82,-4,-9,61,1,-15,62,1,-10,63,8,-13,63,8,-5,75,4,-18,76,5,-6,73,-11,-18,74,-11,-3,75,-3,-20,76,-3,-11,71,10,-12,66,-9,-11,83,4,-11,80,-12,-12,68,0,-11,85,-5,-12,61,1,-12,63,8,-11,76,7,-12,73,-13,-5,73,4,-18,74,4,-6,69,-10,-18,70,-9,-4,71,-2,-20,72,-1,-11,74,7,-12,69,-11,15,44,12,-26,38,10,14,48,10,-27,41,8,11,51,9,-26,46,7,7,51,9,-22,48,8,4,48,10,-19,46,10,5,44,12,-18,42,12,8,41,14,-20,38,13,12,41,14,-23,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-11,36,-26,3,38,-23,-7,39,-22,0,36,-18,-5,39,-18,1,30,-15,-3,33,-14,6,25,-14,-5,26,-14,10,25,-18,-8,24,-18,14,38,-14,-18,34,-15,14,33,-12,-16,29,-13,10,41,-15,-16,39,-16,4,42,-15,-11,42,-15,1,38,-13,-7,40,-13,2,33,-11,-6,35,-10,6,29,-10,-7,29,-9,11,29,-10,-12,27,-11,14,43,-2,-22,38,-4,15,39,0,-21,33,-2,10,46,-3,-21,42,-5,5,46,-3,-16,45,-4,3,43,-2,-13,44,-2,3,39,0,-11,39,0,7,35,0,-13,34,0,12,35,0,-17,32,0,28,14,15,-31,11,31,29,15,18,-33,13,33,29,16,22,-33,16,35,26,15,24,-31,17,37,23,14,23,-28,16,38,22,12,20,-26,14,36,23,11,16,-26,11,33,25,12,14,-28,10,31,14,45,7,-26,36,8,16,47,11,-29,39,10,15,47,16,-29,42,14,12,46,19,-26,44,17,8,44,18,-22,43,17,6,42,13,-18,40,14,7,41,9,-18,37,11,10,43,6,-21,35,8,20,38,12,-30,31,16,18,36,8,-27,28,13,19,38,17,-31,34,20,16,37,20,-27,36,23,12,35,19,-23,35,23,10,33,15,-20,32,20,11,32,9,-20,29,16,14,33,7,-23,27,13,23,31,13,-31,25,20,21,29,9,-28,22,18,22,31,18,-32,28,24,19,30,21,-28,30,27,15,28,20,-24,29,27,13,26,16,-21,26,25,14,26,11,-21,23,21,18,27,8,-24,22,18,26,23,16,-32,19,27,25,21,13,-30,16,25,26,23,20,-32,21,30,23,22,22,-30,23,32,20,20,21,-26,22,33,18,19,18,-24,20,30,19,18,14,-24,17,27,22,19,12,-26,16,25,11,47,19,-25,42,17,12,51,15,-28,45,12,6,51,15,-23,48,14,6,45,16,-20,43,15,11,42,16,-22,38,14,15,46,14,-27,39,12,8,52,10,-24,48,8,4,48,11,-19,46,10,7,42,11,-18,40,10,12,43,9,-23,38,8,13,49,9,-27,42,7,8,46,7,-21,43,5,12,50,17,-27,44,15,9,49,18,-25,45,16,9,52,15,-26,47,13,13,46,17,-27,40,15,14,49,15,-29,42,12,8,46,18,-22,42,17,6,48,17,-21,46,15,11,44,18,-24,39,16,8,43,17,-21,40,15,13,43,15,-25,37,13,15,47,12,-28,40,9,12,50,12,-27,44,10,11,52,12,-27,47,10,7,52,13,-24,48,11,5,50,13,-21,48,12,5,47,13,-20,45,13,6,43,14,-19,41,13,9,41,13,-20,38,12,12,41,12,-22,37,11,15,44,12,-26,37,9,11,51,9,-26,45,7,6,50,10,-21,48,9,4,45,10,-17,43,10,10,42,10,-20,38,8,13,45,9,-25,39,6,11,48,7,-24,43,5,8,49,7,-22,46,6,6,47,8,-19,45,7,7,44,8,-19,41,7,10,44,7,-22,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,52,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-11,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-30,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-5,59,-25,-4,67,-11,-14,64,-12,-1,65,-9,-15,60,-12,-2,60,-9,-12,57,-10,-7,57,-9,-9,67,-12,-6,67,-10,-12,65,-12,-4,64,-9,-13,61,-11,-4,60,-8,-11,58,-10,-7,58,-9,-9,67,-11,-8,66,-5,-13,65,-7,-7,64,-4,-13,62,-6,-7,61,-4,-11,60,-6,-9,59,-5,-11,67,-6,-8,66,-5,-12,65,-6,-7,64,-4,-13,62,-5,-8,61,-3,-12,60,-4,-10,59,-3,-10,66,-6,-9,68,-3,-14,67,-5,-7,65,-2,-14,64,-4,-8,62,-1,-13,61,-3,-10,60,-2,-11,69,-4,11,59,-6,-19,57,-9,10,56,-6,-17,58,-8,7,56,-6,-16,60,-6,5,57,-6,-17,62,-4,4,59,-5,-19,63,-4,5,62,-4,-22,62,-5,8,62,-4,-23,61,-7,10,61,-5,-22,59,-8,12,53,12,-23,45,5,11,51,12,-21,45,6,9,51,12,-20,47,7,7,52,12,-21,48,8,7,54,13,-23,49,8,8,56,13,-25,49,8,10,56,13,-25,47,6,12,55,13,-24,46,5,11,53,5,-19,50,0,12,55,5,-21,49,0,8,52,5,-18,51,2,6,53,5,-19,53,4,5,55,6,-21,54,4,7,58,6,-23,54,3,9,59,6,-24,52,1,12,57,6,-23,50,0,10,54,0,-18,53,-3,12,57,0,-20,53,-4,8,54,0,-17,55,-1,5,55,0,-18,57,0,5,57,1,-20,58,0,6,59,1,-23,58,0,9,60,1,-24,56,-2,11,59,0,-23,54,-4,10,55,-3,-17,56,-5,11,58,-2,-20,55,-6,8,54,-3,-16,57,-3,5,56,-2,-17,59,-2,4,58,-2,-20,60,-2,6,61,-1,-22,60,-3,8,61,-1,-23,58,-4,11,60,-2,-22,56,-6,0,44,26,-13,59,8,0,44,25,-13,60,7,-1,43,24,-13,60,5,0,42,23,-13,59,4,0,41,23,-12,58,4,1,41,24,-11,58,6,2,42,26,-11,58,7,1,43,26,-11,58,8,10,56,15,-25,45,10,9,56,14,-26,46,9,8,55,13,-26,46,6,9,53,12,-25,45,5,11,52,12,-23,43,5,12,52,13,-22,43,7,13,53,14,-23,43,9,12,55,16,-24,44,10,1,47,22,-17,57,7,3,47,23,-16,56,9,1,46,21,-17,56,6,1,45,20,-16,55,4,3,44,20,-15,54,5,4,44,21,-14,53,6,5,45,23,-14,54,8,4,46,24,-15,54,9,6,54,16,-24,49,8,8,54,18,-23,48,10,6,53,15,-24,49,6,7,51,13,-23,48,4,9,49,13,-21,46,4,10,49,15,-20,45,6,11,50,16,-20,45,8,10,52,18,-21,47,10,8,55,15,-26,47,9,10,56,16,-25,46,10,7,54,13,-25,47,6,8,52,12,-24,46,5,10,51,12,-22,44,5,12,51,13,-22,43,6,12,53,15,-22,43,9,12,54,16,-23,44,10,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,29,-33,9,46,34,8,28,-38,8,44,36,2,28,-40,2,43,25,7,30,-30,7,48,26,2,32,-30,2,48,30,8,37,-36,6,53,27,7,37,-32,6,53,36,7,34,-41,5,49,37,4,35,-41,2,50,27,4,38,-32,2,54,31,4,38,-36,2,54,28,2,39,-32,0,54,31,2,39,-36,0,54,37,1,36,-41,0,50,26,0,32,-30,0,48,37,0,29,-40,0,43,30,0,31,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,4,38,-36,2,54,27,4,38,-32,2,54,37,4,35,-41,2,50,28,2,39,-32,0,54,31,2,39,-36,0,54,37,1,36,-41,0,50,26,2,32,-30,2,48,26,0,32,-30,0,48,36,2,28,-40,2,43,37,0,29,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,10,61,-9,-22,62,-10,7,56,-8,-21,58,-9,-3,56,-12,-9,56,-13,1,63,-18,-13,63,-18,8,63,-3,-21,64,-4,6,57,-2,-19,58,-3,-5,57,-9,-8,56,-9,0,66,-8,-12,66,-8,3,55,-10,-17,56,-11,8,58,-13,-21,60,-14,2,59,-4,-15,59,-4,4,65,-5,-17,65,-5,8,58,-9,-22,59,-10,0,60,-17,-13,61,-18,7,60,-1,-20,61,-2,2,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-7,9,63,-7,-22,64,-8,-5,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-8,6,65,-10,-18,66,-11,5,56,-9,-19,57,-10,9,59,-11,-22,61,-12,4,58,-2,-17,59,-3,6,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-18,61,-3,3,56,-6,-17,56,-7,8,64,-8,-20,65,-9,-2,31,26,-16,68,0,-4,31,25,-16,66,-1,-1,38,23,-10,62,2,0,38,25,-10,64,4,-4,32,28,-18,66,1,-6,32,26,-17,64,-1,-4,39,25,-13,60,3,-3,39,28,-14,61,5,-2,39,29,-14,62,6,-3,39,27,-13,61,4,-4,31,27,-18,64,0,-2,31,29,-19,66,2,1,38,26,-11,66,5,0,38,24,-11,63,3,-2,31,25,-16,67,0,0,31,27,-16,68,1,1,32,28,-17,68,2,0,31,26,-16,67,1,0,39,25,-10,65,4,1,39,27,-11,66,6,0,31,30,-19,67,3,-2,31,28,-19,65,2,-2,39,29,-14,61,6,0,39,30,-14,63,8,1,39,30,-13,65,9,-1,39,30,-13,62,7,0,32,28,-19,65,3,2,32,29,-19,67,5,2,40,28,-12,66,8,0,40,26,-11,65,6,1,32,26,-17,67,2,3,33,28,-18,68,4,2,39,28,-11,66,8,-1,38,23,-10,62,2,-1,42,23,-8,60,4,2,42,27,-9,63,9,1,40,30,-12,64,9,-4,39,25,-12,60,3,-3,42,25,-11,58,4,0,43,28,-10,61,9,-2,39,29,-14,61,6,-2,43,27,-11,59,7,1,38,25,-10,65,5,0,42,25,-8,62,6,4,30,27,-19,70,3,2,29,26,-19,69,2,1,32,27,-17,66,3,2,33,28,-17,67,5,3,29,28,-20,69,3,2,29,28,-20,69,2,0,32,28,-19,66,3,2,32,29,-19,67,5,3,28,27,-20,69,1,4,29,28,-20,70,3,2,29,27,-19,69,2,4,30,27,-19,70,3,4,29,26,-18,71,2,3,28,26,-18,70,1,5,28,27,-20,71,2,3,27,26,-20,71,1,4,27,26,-19,71,1,5,28,26,-19,72,2,3,28,27,-18,71,1,4,29,27,-18,71,2,4,30,26,-18,73,1,3,30,25,-18,72,0,5,29,25,-18,73,1,4,29,25,-19,73,0,2,25,24,-19,73,-3,3,25,25,-19,74,-2,2,26,24,-18,72,-2,3,26,25,-18,73,-1,2,26,27,-19,72,0,1,26,26,-19,71,-1,2,25,27,-20,72,0,1,24,26,-20,71,-2,1,25,26,-21,71,-1,2,25,27,-21,72,0,1,26,25,-19,70,-1,2,26,26,-19,71,0,2,28,28,-20,70,1,0,27,26,-19,69,0,1,26,29,-21,70,0,0,26,27,-21,69,0,0,31,29,-19,67,3,-1,31,28,-19,66,2,0,27,28,-21,68,0,1,27,29,-21,70,1,1,32,28,-17,68,2,0,31,26,-17,67,1,0,27,26,-19,69,0,2,28,27,-20,70,0,-1,26,28,-20,70,-1,-2,26,27,-19,69,-3,-2,31,26,-16,66,0,0,31,27,-16,67,1,-2,26,29,-21,69,-1,-4,26,28,-21,68,-2,-4,31,27,-18,65,0,-2,31,29,-19,66,1,-3,25,28,-21,68,-3,-2,25,29,-21,70,-1,-2,26,27,-20,68,-2,-1,26,28,-20,70,-1,-1,24,28,-19,71,-2,-2,24,26,-19,70,-4,-2,23,29,-21,71,-3,-3,23,28,-21,70,-4,-2,23,27,-20,71,-4,-1,23,28,-21,72,-3,-2,24,26,-19,70,-4,0,24,28,-19,71,-2,0,22,27,-18,72,-3,-1,22,26,-18,72,-4,0,21,27,-19,73,-4,-1,21,26,-19,72,-5,-5,22,28,-17,72,-6,-5,22,29,-18,73,-5,-5,22,27,-17,71,-6,-4,22,28,-17,72,-5,-4,24,28,-18,71,-4,-5,24,27,-17,70,-5,-5,24,29,-19,71,-4,-6,24,28,-19,70,-5,-6,25,28,-19,70,-5,-5,25,29,-19,71,-4,-5,25,27,-17,70,-5,-4,25,28,-18,71,-3,-4,26,28,-18,70,-2,-5,26,27,-17,68,-4,-5,27,29,-19,70,-3,-6,26,28,-19,68,-4,-4,32,28,-18,66,0,-5,31,26,-17,64,0,-6,27,27,-19,67,-3,-5,28,29,-19,69,-2,-3,31,26,-16,67,0,-4,31,25,-16,65,-1,-5,27,26,-17,68,-3,-4,27,28,-18,69,-2,-6,24,28,-19,70,-5,-5,24,27,-17,70,-5,-4,24,28,-18,71,-4,-5,24,29,-19,71,-4,-6,27,28,-19,68,-4,-5,26,27,-18,68,-4,-4,27,28,-18,69,-2,-5,27,29,-19,69,-2,-2,26,29,-22,69,-1,-1,26,28,-20,70,-1,-2,26,27,-20,68,-2,-4,26,28,-21,68,-2,-1,23,29,-21,72,-3,-1,24,28,-20,71,-2,-2,24,26,-19,70,-4,-3,23,27,-21,70,-4,0,26,28,-21,69,0,0,27,26,-20,69,0,2,28,28,-20,70,0,1,27,29,-21,70,0,1,24,26,-20,71,-2,1,26,26,-19,71,-1,2,26,27,-19,72,0,2,25,27,-21,72,0,4,29,28,-20,70,3,4,30,27,-19,70,3,2,29,27,-19,69,2,2,28,28,-20,69,2,5,28,27,-19,72,2,4,29,27,-18,71,2,3,28,26,-18,70,1,4,27,26,-20,71,1,-4,35,22,-15,61,0,-2,34,25,-13,64,0,0,35,23,-11,62,-1,-2,35,21,-13,60,-1,-4,31,22,-15,63,-3,-2,32,24,-14,64,-2,-1,32,22,-12,64,-3,-2,32,20,-14,62,-4,0,37,25,-11,65,3,-3,35,27,-15,63,2,-2,40,22,-10,59,2,-4,40,24,-12,60,3,-2,33,21,-13,61,-3,-4,33,22,-15,62,-1,0,33,23,-12,63,-2,-2,33,24,-14,64,-1,-2,31,20,-14,63,-5,-3,30,22,-15,64,-4,0,31,22,-12,64,-3,-2,31,24,-14,65,-2,-1,28,23,-14,67,-4,0,28,22,-13,66,-4,-2,28,22,-14,67,-5,-1,28,21,-13,66,-6,-4,34,22,-15,61,-1,-2,33,24,-14,64,0,0,34,23,-12,63,-2,-2,34,21,-13,60,-2,0,32,22,-12,64,-3,-2,31,20,-14,63,-4,-2,31,24,-14,64,-2,-3,31,22,-15,63,-3,-3,38,26,-13,62,3,2,60,-13,-15,55,-16,-1,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,61,-16,-1,58,-6,-11,57,-7,2,66,-6,-14,66,-7,3,58,-15,-16,59,-16,1,62,-6,-14,62,-7,-1,56,-8,-11,55,-9,3,66,-11,-15,66,-12] }, + { "name": "animation_000009", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-7,66,-7,-17,66,-7,-6,70,5,-17,71,5,-6,78,-11,-17,79,-11,-6,81,2,-16,82,3,-5,68,0,-19,69,0,-4,81,-4,-18,82,-4,-9,61,1,-15,62,1,-10,63,8,-13,63,8,-5,75,4,-18,76,5,-6,73,-11,-18,74,-11,-3,75,-3,-20,76,-3,-11,71,10,-12,66,-9,-11,83,4,-11,80,-12,-12,68,0,-11,84,-5,-12,61,1,-12,63,8,-11,76,7,-12,73,-13,-5,73,4,-17,74,4,-6,69,-10,-18,70,-9,-4,71,-2,-20,72,-1,-11,74,7,-12,69,-11,15,44,12,-26,38,10,14,48,10,-27,41,8,11,51,9,-26,46,7,7,51,9,-22,48,8,4,48,10,-19,46,10,5,44,12,-18,42,12,8,41,14,-20,38,13,12,41,14,-23,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-11,36,-26,3,38,-23,-7,39,-22,0,36,-18,-5,39,-18,1,30,-15,-3,33,-14,6,25,-14,-5,27,-14,10,25,-18,-8,24,-18,14,38,-14,-18,34,-15,14,33,-12,-16,29,-13,10,41,-15,-16,39,-16,4,42,-15,-12,42,-15,1,38,-13,-7,41,-13,2,33,-11,-6,35,-10,6,29,-10,-8,29,-9,11,29,-10,-12,27,-11,14,43,-2,-22,38,-4,15,39,0,-21,33,-2,10,46,-3,-21,42,-5,5,46,-3,-17,45,-4,3,43,-2,-13,44,-2,3,39,0,-11,39,0,7,35,0,-13,34,0,12,35,0,-17,32,0,28,14,15,-31,11,31,29,15,18,-33,13,33,29,16,22,-33,16,35,26,15,24,-31,17,37,23,14,23,-28,16,38,22,12,20,-26,14,36,23,11,16,-25,11,33,25,12,14,-28,10,31,14,45,7,-26,36,8,16,47,11,-29,39,10,15,47,16,-29,42,14,12,46,19,-26,44,17,8,44,18,-22,43,17,6,42,13,-18,40,14,7,41,9,-18,37,10,10,43,6,-21,35,8,20,38,12,-30,31,16,18,36,8,-27,28,13,19,38,17,-31,34,20,16,37,20,-27,36,23,12,35,19,-23,35,23,10,33,15,-20,32,20,11,32,9,-20,29,16,14,33,7,-23,27,13,23,31,13,-31,25,20,21,29,9,-28,22,18,22,31,18,-32,28,24,19,30,21,-28,30,27,15,28,20,-24,29,27,13,26,16,-21,26,25,14,26,11,-21,23,21,18,27,8,-24,22,18,26,23,16,-32,19,27,25,21,13,-30,16,25,26,23,20,-32,21,30,23,22,22,-30,23,32,20,20,21,-26,22,33,18,19,18,-24,20,30,19,18,14,-24,17,27,22,19,12,-26,16,25,11,47,19,-25,42,17,12,51,15,-28,45,12,6,51,15,-23,48,14,6,45,16,-20,43,15,11,42,16,-22,38,14,15,46,14,-28,39,12,8,52,10,-24,48,8,4,48,11,-19,46,10,7,42,11,-18,40,10,12,43,9,-23,38,8,13,49,9,-27,42,7,8,46,7,-21,43,5,12,50,17,-28,44,15,9,49,18,-25,45,16,9,52,15,-26,47,13,13,46,17,-27,40,15,14,49,15,-29,42,12,8,46,18,-23,42,17,6,48,17,-21,46,15,11,44,18,-24,39,16,8,43,17,-21,40,15,13,43,15,-25,37,13,15,47,12,-28,40,9,12,50,12,-27,44,10,11,52,12,-27,47,10,7,52,13,-24,48,11,5,50,13,-21,48,12,5,47,13,-20,45,12,6,43,14,-19,41,13,9,41,13,-20,38,12,12,41,12,-22,37,11,15,44,12,-26,37,9,11,51,9,-26,45,7,6,50,10,-21,48,9,4,45,10,-17,43,10,10,42,10,-20,38,8,13,45,9,-25,39,6,11,48,7,-24,43,5,8,49,7,-22,46,6,6,47,8,-19,45,7,7,44,8,-19,41,7,10,44,7,-22,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,52,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-11,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-30,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-5,59,-25,-4,67,-11,-14,64,-12,-1,65,-9,-15,60,-12,-2,60,-9,-12,57,-10,-7,57,-9,-9,67,-12,-6,67,-10,-12,65,-12,-4,64,-9,-13,61,-11,-4,60,-8,-11,58,-10,-7,58,-9,-9,67,-11,-8,66,-5,-13,65,-7,-7,64,-4,-13,62,-6,-7,61,-4,-11,60,-6,-9,59,-5,-11,67,-6,-8,66,-5,-12,65,-6,-7,64,-4,-13,62,-5,-8,61,-3,-12,60,-4,-10,59,-3,-10,66,-6,-9,68,-3,-14,67,-5,-7,65,-2,-14,64,-4,-8,62,-1,-13,61,-3,-10,60,-2,-11,69,-4,11,59,-6,-19,57,-9,10,56,-6,-17,58,-8,7,56,-6,-16,60,-6,5,57,-6,-17,62,-4,4,59,-5,-19,63,-4,5,62,-4,-22,62,-5,8,62,-4,-23,61,-7,10,61,-5,-22,59,-8,12,53,12,-23,45,5,11,51,12,-21,45,6,9,51,12,-20,47,7,7,52,12,-21,48,8,7,54,13,-23,49,8,8,56,13,-25,49,8,10,56,13,-25,47,6,12,55,13,-25,46,5,11,53,5,-19,50,0,12,55,5,-21,49,0,8,52,5,-18,51,2,6,53,5,-19,53,4,5,55,6,-21,54,4,7,58,6,-24,54,3,9,59,6,-25,52,1,12,57,6,-24,50,0,10,54,0,-18,53,-3,12,57,0,-20,53,-4,8,54,0,-17,55,-1,6,55,0,-18,57,0,5,57,1,-20,58,0,6,59,1,-23,58,0,9,60,1,-24,56,-2,11,59,0,-23,54,-4,10,55,-3,-17,56,-5,11,58,-2,-20,55,-6,8,54,-3,-16,57,-3,5,56,-2,-17,59,-2,4,58,-2,-20,60,-2,6,61,-1,-22,60,-3,8,61,-1,-23,58,-4,11,60,-2,-22,56,-6,0,44,26,-13,59,8,0,44,25,-13,60,7,-1,43,24,-13,60,5,0,42,23,-13,59,4,0,41,23,-12,58,4,1,41,24,-11,58,6,2,42,26,-11,58,7,1,43,26,-11,58,8,10,56,15,-25,45,10,9,56,14,-26,46,9,8,55,13,-26,46,6,9,53,12,-25,45,5,11,52,12,-23,44,5,12,52,13,-23,43,7,13,53,14,-23,43,9,12,55,16,-24,44,10,1,47,22,-17,57,7,3,47,23,-16,56,9,1,46,21,-17,56,6,1,45,20,-16,55,4,3,44,20,-15,54,5,4,44,21,-14,53,6,5,45,23,-14,54,8,4,46,24,-15,54,9,6,54,16,-24,50,8,8,54,18,-23,48,10,6,53,15,-24,49,6,7,51,13,-23,48,4,9,49,13,-21,46,4,10,49,15,-20,45,6,11,50,16,-20,45,8,10,52,18,-21,47,10,8,55,15,-26,48,9,10,56,16,-25,46,10,7,54,13,-25,48,6,8,52,12,-24,46,5,10,51,12,-23,45,5,12,51,13,-22,43,7,12,53,15,-22,43,9,12,54,16,-23,44,10,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,10,61,-9,-22,62,-10,7,56,-8,-21,58,-9,-3,56,-12,-9,56,-13,1,63,-18,-13,63,-18,8,63,-3,-21,64,-4,6,57,-2,-19,58,-3,-5,57,-9,-8,56,-9,0,66,-8,-12,66,-8,3,55,-10,-17,56,-11,8,58,-13,-21,60,-14,2,59,-4,-15,59,-4,4,65,-5,-17,65,-5,8,58,-9,-22,59,-10,0,60,-17,-13,61,-18,7,60,-1,-20,61,-2,2,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-7,9,63,-7,-22,64,-8,-5,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-8,6,65,-10,-18,66,-11,5,56,-9,-19,57,-10,9,59,-11,-22,61,-12,4,58,-2,-17,59,-3,6,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-18,61,-3,3,56,-6,-17,56,-7,8,64,-8,-20,65,-9,-2,31,26,-15,68,0,-4,31,25,-15,66,-1,-1,38,23,-10,62,2,0,38,25,-10,64,4,-4,32,28,-18,66,1,-5,32,26,-17,65,-1,-4,39,25,-13,60,3,-3,39,28,-14,61,5,-2,39,29,-14,62,6,-3,39,27,-13,61,4,-4,31,27,-18,65,0,-2,31,29,-19,66,2,1,38,26,-10,66,5,0,38,24,-10,63,3,-2,31,25,-16,67,0,0,31,27,-16,68,1,1,32,28,-16,69,2,0,31,26,-16,67,1,0,39,25,-10,65,4,1,39,27,-11,66,6,0,31,30,-18,67,3,-2,31,28,-18,65,2,-2,39,29,-14,61,6,0,39,30,-14,63,8,1,39,30,-13,65,9,-1,39,30,-13,62,7,0,32,28,-19,65,3,2,32,29,-19,67,5,2,40,28,-11,66,8,0,40,26,-11,65,6,1,32,26,-17,67,2,3,33,28,-17,68,4,2,39,28,-10,65,8,-1,38,23,-10,62,2,-1,42,23,-8,60,4,2,42,27,-9,63,9,1,40,30,-12,64,9,-4,39,25,-12,60,3,-3,42,25,-11,58,4,0,43,28,-10,61,9,-2,39,29,-14,61,6,-2,43,27,-11,59,7,1,38,25,-10,65,5,0,42,25,-8,62,6,4,30,27,-18,70,3,2,29,26,-18,69,2,1,32,27,-17,67,3,2,33,28,-17,67,5,3,29,28,-20,70,3,2,29,28,-20,69,2,0,32,28,-19,66,3,2,32,29,-18,67,5,3,28,27,-20,70,1,4,29,28,-19,71,3,3,29,27,-18,69,2,4,30,27,-18,70,3,5,29,26,-18,71,2,3,28,26,-18,71,1,5,28,27,-19,72,2,3,27,26,-19,71,1,4,28,26,-19,71,0,5,28,26,-19,72,2,3,28,27,-18,71,1,4,29,27,-18,72,2,4,30,26,-17,73,1,3,30,25,-17,72,0,5,30,25,-18,73,1,4,29,25,-18,73,0,2,25,24,-18,73,-3,4,25,25,-18,74,-2,2,26,24,-17,72,-2,3,26,25,-17,73,-1,2,26,27,-18,72,0,1,26,26,-18,71,-1,2,25,27,-20,73,-1,1,24,26,-20,72,-2,1,25,27,-20,71,-1,2,25,27,-20,72,0,1,26,26,-18,71,-1,2,26,26,-18,72,0,2,28,28,-19,70,1,0,27,26,-19,69,0,1,26,29,-21,71,0,0,26,27,-21,70,0,0,31,29,-19,67,3,-1,31,28,-18,66,1,0,27,28,-21,69,0,1,27,29,-21,70,1,1,32,28,-17,68,2,0,32,26,-16,67,1,0,27,26,-19,70,0,2,28,27,-19,71,0,-1,26,28,-19,70,-1,-2,26,27,-19,69,-3,-2,31,26,-16,66,0,0,31,27,-16,67,1,-2,26,29,-21,69,-1,-4,26,28,-20,68,-2,-4,31,27,-18,65,0,-2,31,29,-18,66,1,-3,25,28,-21,69,-3,-2,25,29,-21,70,-2,-2,26,27,-19,69,-2,-1,26,28,-19,70,-1,0,24,28,-19,72,-2,-2,24,26,-18,70,-4,-2,23,29,-20,72,-3,-3,23,28,-20,71,-4,-2,23,27,-20,71,-5,-1,23,28,-20,72,-3,-2,24,26,-19,70,-4,0,24,28,-19,72,-2,0,22,27,-17,73,-3,-1,22,26,-17,72,-4,0,21,27,-18,73,-4,-1,21,26,-18,73,-5,-5,22,28,-17,72,-6,-5,22,29,-17,73,-5,-5,22,27,-16,72,-6,-4,22,28,-16,72,-5,-4,24,28,-17,71,-4,-5,24,27,-17,70,-5,-5,24,29,-18,72,-4,-6,24,28,-18,71,-6,-6,25,28,-18,70,-5,-5,25,29,-18,71,-4,-5,25,27,-17,70,-5,-4,25,28,-17,71,-3,-4,26,28,-17,70,-2,-5,26,27,-17,69,-4,-5,27,29,-19,70,-3,-6,26,28,-19,69,-4,-4,32,28,-18,66,0,-5,31,26,-17,65,0,-6,27,27,-19,68,-3,-5,28,29,-19,69,-2,-2,31,26,-16,67,0,-4,31,25,-15,65,-1,-5,27,26,-17,68,-3,-4,27,28,-17,70,-2,-6,24,28,-18,70,-5,-5,24,27,-17,70,-5,-4,24,28,-17,71,-4,-5,24,29,-18,71,-4,-6,27,28,-19,68,-4,-5,26,27,-17,68,-4,-4,27,28,-17,70,-2,-5,27,29,-19,70,-2,-2,26,29,-21,70,-1,-1,26,28,-19,70,-1,-2,26,27,-19,69,-2,-4,26,28,-21,69,-3,-1,23,29,-20,72,-3,0,24,28,-19,72,-2,-2,24,26,-19,70,-4,-3,23,27,-20,71,-4,0,26,28,-21,69,0,0,27,26,-19,69,0,2,28,28,-19,71,0,1,27,29,-21,70,0,1,24,26,-20,71,-2,1,26,26,-18,71,-1,2,26,27,-18,72,0,2,25,27,-20,73,0,4,29,28,-20,70,3,4,30,27,-18,70,3,2,29,27,-18,69,2,2,28,28,-20,69,2,5,28,27,-19,72,2,4,29,27,-18,71,2,3,28,26,-18,71,1,4,27,26,-19,71,1,-4,35,22,-15,61,0,-2,34,25,-13,64,0,0,35,23,-11,62,-1,-2,35,21,-13,60,-1,-4,31,22,-15,63,-3,-2,32,24,-14,64,-2,-1,32,22,-12,64,-3,-2,32,20,-14,62,-4,0,37,25,-11,65,3,-3,35,27,-15,64,2,-1,40,22,-10,59,2,-4,40,24,-12,60,3,-2,34,21,-13,61,-3,-4,33,22,-15,62,-1,0,33,23,-12,63,-2,-2,33,24,-13,64,-1,-2,31,20,-14,63,-5,-3,30,22,-15,64,-4,0,31,22,-12,64,-3,-2,31,24,-14,65,-2,-1,28,23,-13,67,-4,0,28,22,-12,66,-4,-2,28,22,-14,67,-5,-1,28,21,-13,66,-6,-4,34,22,-15,61,-1,-2,33,24,-13,64,0,0,34,23,-12,62,-2,-2,34,21,-13,60,-2,0,32,22,-12,64,-3,-2,31,20,-14,63,-4,-2,31,24,-14,64,-2,-3,31,22,-15,64,-3,-3,38,26,-13,62,3,2,60,-13,-15,55,-16,-1,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,61,-16,-1,58,-6,-11,57,-7,2,66,-6,-14,66,-7,3,58,-15,-16,59,-16,1,62,-6,-14,62,-7,-1,56,-8,-11,55,-9,3,66,-11,-15,66,-12] }, + { "name": "animation_000010", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-8,65,-8,-19,67,-8,-7,70,5,-19,71,4,-7,77,-12,-17,79,-12,-7,81,2,-17,82,1,-7,67,-1,-20,69,-1,-5,81,-5,-18,83,-5,-12,61,0,-17,62,0,-13,63,8,-16,64,8,-6,75,4,-19,77,3,-7,72,-12,-18,74,-12,-4,74,-4,-21,77,-4,-13,71,9,-14,66,-10,-12,83,3,-12,79,-13,-13,68,-1,-11,84,-6,-14,61,0,-14,63,8,-12,76,6,-13,73,-14,-7,73,3,-19,75,3,-7,68,-10,-19,70,-10,-5,71,-2,-21,73,-3,-13,74,6,-13,69,-12,15,44,12,-28,37,9,15,48,10,-30,40,7,12,51,9,-28,45,6,7,51,9,-25,47,6,5,48,10,-22,46,8,6,44,12,-21,43,11,9,41,14,-22,38,12,13,41,14,-25,36,11,13,27,-22,-10,25,-23,12,32,-26,-11,29,-26,8,36,-26,-11,35,-26,3,38,-23,-8,39,-23,0,36,-18,-6,39,-18,1,30,-15,-4,34,-14,6,25,-14,-5,27,-14,10,25,-18,-7,24,-18,14,38,-14,-18,33,-16,14,33,-12,-16,29,-13,10,41,-15,-17,38,-16,5,42,-15,-13,42,-16,1,39,-13,-9,41,-13,2,33,-11,-6,36,-10,6,29,-9,-8,30,-9,11,29,-10,-12,27,-11,14,43,-3,-24,37,-5,15,39,-1,-22,33,-3,10,46,-3,-22,42,-6,6,46,-3,-19,44,-5,3,44,-2,-15,44,-3,3,39,0,-13,40,0,7,35,0,-14,35,0,12,35,0,-18,32,0,28,14,15,-31,10,31,30,15,18,-33,13,33,29,16,22,-34,15,35,26,15,24,-32,17,37,23,14,23,-28,17,38,22,12,20,-26,14,36,23,11,16,-25,12,33,25,12,14,-27,10,31,14,45,7,-27,35,7,16,47,11,-31,38,9,15,47,16,-31,41,13,12,46,18,-29,43,16,8,44,18,-24,43,16,6,42,13,-21,40,14,7,42,9,-20,37,10,11,43,6,-23,35,7,21,38,12,-32,30,15,19,36,8,-28,27,12,20,38,17,-32,33,19,16,37,20,-30,36,22,12,35,19,-25,35,22,10,33,15,-21,32,20,11,33,9,-21,29,16,15,34,7,-23,27,13,24,31,13,-32,24,20,22,29,9,-29,22,17,23,31,18,-33,27,23,19,30,21,-30,29,26,16,28,20,-26,29,27,13,27,16,-22,27,24,14,26,11,-22,24,21,18,27,8,-24,22,18,27,23,16,-33,18,27,25,21,13,-30,16,25,26,23,20,-33,21,30,23,22,22,-31,23,32,20,21,21,-27,22,32,18,19,18,-24,20,30,19,18,14,-24,17,27,22,19,12,-26,16,25,11,47,19,-28,42,16,13,52,14,-31,44,11,7,52,15,-26,48,12,6,45,16,-22,43,14,11,42,15,-24,37,13,15,46,14,-30,38,11,9,52,10,-27,47,7,5,48,11,-22,46,9,7,42,11,-20,40,9,13,43,9,-25,37,7,14,49,9,-29,41,5,9,47,6,-23,43,4,13,50,17,-30,43,14,9,50,18,-28,45,15,10,53,15,-29,47,12,14,47,17,-29,39,14,15,49,15,-31,41,11,9,46,18,-25,42,16,6,49,17,-24,46,14,12,44,18,-26,39,15,9,43,16,-23,40,14,14,43,15,-27,37,12,15,47,11,-30,39,8,13,50,12,-30,43,8,11,53,12,-30,46,9,8,52,13,-27,48,10,5,50,13,-24,47,11,6,47,13,-23,45,11,7,44,14,-21,42,12,9,41,13,-22,38,11,12,42,12,-24,36,10,15,44,12,-28,37,8,12,51,9,-28,44,5,6,51,10,-24,47,7,5,45,10,-20,43,9,10,42,10,-22,38,8,14,45,8,-27,39,5,12,48,7,-26,42,4,9,50,7,-25,45,5,6,47,8,-22,45,6,8,44,8,-21,41,6,11,44,7,-24,40,5,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-26,-10,35,-27,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-10,50,-31,7,52,-25,-12,48,-25,4,50,-19,-8,48,-19,-2,49,-17,-2,51,-32,8,45,-25,-11,42,-25,7,46,-31,-9,43,-31,5,44,-19,-8,41,-19,-1,42,-17,-1,45,-33,4,56,-28,-10,51,-31,7,51,-24,-11,45,-28,5,45,-23,-7,41,-25,0,41,-23,-3,55,-30,1,60,-22,-12,55,-25,5,57,-16,-15,50,-21,2,52,-12,-12,46,-15,-4,48,-13,-5,59,-25,6,54,-20,-13,47,-24,3,58,-25,-11,53,-28,3,49,-16,-10,44,-19,-2,45,-16,-4,57,-28,1,60,-22,-12,55,-25,5,57,-16,-15,50,-21,2,52,-12,-12,47,-15,-4,48,-13,-5,59,-25,-5,67,-11,-15,64,-13,-2,65,-9,-17,60,-12,-4,60,-9,-13,57,-11,-8,57,-9,-11,67,-13,-7,67,-10,-13,65,-12,-5,64,-9,-14,61,-12,-6,60,-9,-12,58,-11,-8,58,-10,-10,67,-12,-10,66,-6,-14,65,-7,-8,64,-5,-14,62,-7,-8,61,-5,-13,60,-6,-10,59,-5,-12,67,-7,-9,66,-6,-14,65,-7,-8,63,-4,-15,62,-6,-9,61,-3,-14,60,-5,-11,59,-3,-12,66,-7,-10,68,-4,-15,67,-6,-9,65,-3,-16,64,-5,-10,62,-2,-15,61,-4,-12,60,-2,-13,69,-5,10,59,-6,-20,57,-10,8,57,-6,-18,58,-9,6,56,-6,-17,59,-7,3,57,-5,-18,61,-5,3,60,-4,-21,62,-5,4,62,-4,-23,62,-6,6,63,-4,-24,60,-8,9,61,-5,-23,58,-10,12,54,12,-25,45,4,11,52,12,-23,45,5,9,51,12,-22,47,6,7,52,12,-23,48,7,6,54,13,-25,49,7,7,56,13,-27,49,6,9,57,13,-27,47,5,11,56,12,-27,46,4,10,53,5,-20,49,0,11,55,5,-23,49,-1,7,52,5,-20,51,1,5,53,6,-21,53,3,4,56,6,-23,54,3,6,58,7,-25,54,2,8,59,6,-26,52,0,11,58,6,-25,50,-1,9,55,0,-19,53,-4,11,57,0,-22,53,-5,7,54,0,-19,55,-2,4,55,0,-20,57,0,4,57,1,-22,58,0,5,60,1,-24,57,-1,7,61,1,-25,56,-3,10,60,1,-24,54,-5,9,56,-3,-19,55,-6,10,58,-2,-21,55,-7,6,55,-3,-18,57,-4,4,56,-2,-19,59,-3,3,59,-1,-22,60,-3,4,61,-1,-24,60,-4,7,62,-1,-25,58,-6,9,60,-2,-24,56,-7,0,44,26,-15,59,7,0,44,25,-15,60,6,-1,43,24,-15,60,4,0,42,23,-15,59,3,0,41,23,-14,58,4,1,41,24,-13,58,5,2,42,26,-13,58,7,1,43,26,-14,58,8,10,56,16,-27,45,9,8,57,14,-28,46,8,7,55,13,-28,46,5,8,53,12,-27,45,4,10,52,12,-25,43,4,12,52,13,-25,43,6,12,54,14,-25,43,8,12,55,16,-26,44,9,1,47,22,-19,56,6,3,47,23,-18,56,8,1,46,21,-19,56,5,1,45,20,-18,55,4,3,44,20,-17,54,4,4,44,21,-16,53,5,5,45,23,-16,54,7,4,46,24,-17,55,8,6,54,17,-26,49,7,8,54,18,-25,48,9,5,53,15,-26,49,5,6,51,13,-25,48,3,8,50,13,-23,46,3,10,49,15,-22,45,5,11,51,16,-22,45,7,10,53,18,-23,47,9,7,56,15,-28,47,7,9,56,16,-27,46,9,6,54,13,-27,47,5,8,53,13,-26,46,4,9,51,12,-24,44,4,11,51,13,-24,43,6,12,53,15,-24,43,8,11,55,16,-26,44,9,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-35,6,53,27,5,37,-32,6,53,36,5,34,-40,5,50,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-35,2,54,27,0,38,-32,0,54,31,0,38,-35,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-38,0,39,30,0,12,-32,0,28,31,2,38,-35,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-35,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-38,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-38,0,39,30,0,12,-32,0,28,8,61,-9,-24,62,-11,6,57,-8,-22,57,-10,-4,56,-12,-10,56,-13,0,63,-18,-14,63,-19,6,63,-3,-22,64,-5,4,57,-2,-21,57,-4,-6,57,-9,-9,56,-10,0,66,-8,-14,66,-9,2,55,-10,-18,55,-12,7,58,-13,-22,59,-15,0,59,-4,-17,59,-5,2,65,-5,-18,65,-6,7,58,-9,-23,59,-11,0,60,-17,-14,60,-18,5,60,-1,-22,61,-3,1,60,-10,-16,61,-12,6,56,-12,-21,57,-15,0,62,-3,-17,62,-5,4,56,-5,-21,57,-8,8,63,-6,-23,64,-9,-6,56,-10,-9,55,-11,0,66,-13,-14,66,-14,0,55,-7,-16,55,-8,4,65,-10,-19,66,-12,4,56,-9,-20,56,-11,7,60,-11,-23,61,-13,2,58,-2,-19,58,-4,5,64,-4,-20,65,-6,6,57,-10,-22,58,-13,3,61,-2,-19,61,-4,2,56,-6,-19,56,-8,6,64,-8,-21,65,-10,0,31,26,-17,68,0,-2,31,25,-17,66,-2,-1,38,23,-12,62,1,0,38,25,-12,64,3,-3,31,28,-20,66,0,-4,31,26,-19,65,-2,-4,39,25,-15,60,2,-3,39,28,-16,61,4,-1,39,29,-16,62,5,-3,39,27,-15,61,4,-3,31,27,-20,65,0,-1,31,29,-20,66,0,2,38,26,-13,66,4,0,38,24,-12,63,3,0,31,25,-17,67,-1,1,31,27,-18,68,0,2,32,28,-18,69,1,1,31,26,-18,67,0,0,39,25,-12,65,3,2,39,27,-13,66,6,1,32,30,-20,67,2,0,31,28,-20,65,1,-2,39,29,-16,61,5,0,39,30,-16,63,7,1,39,30,-15,65,8,0,39,30,-15,62,7,1,32,28,-20,66,2,3,33,29,-21,67,4,2,40,28,-14,66,7,0,40,26,-13,65,5,2,33,26,-19,67,1,4,33,28,-19,68,3,3,39,28,-13,66,7,-1,38,23,-12,62,1,-1,41,23,-11,60,3,2,42,27,-11,63,8,1,40,30,-14,64,8,-4,39,25,-14,60,2,-3,42,25,-13,58,4,0,43,28,-13,61,9,-2,39,29,-16,61,5,-2,42,27,-14,59,6,1,38,25,-12,65,4,0,42,25,-10,62,6,5,31,27,-20,70,2,4,30,26,-20,69,0,2,33,27,-19,67,2,3,33,28,-19,67,4,5,30,28,-21,70,2,3,29,28,-21,69,1,1,32,28,-20,66,2,3,33,29,-20,67,4,4,29,27,-21,70,0,5,29,28,-21,71,1,4,30,27,-20,69,0,5,30,27,-20,70,2,6,30,26,-19,71,1,5,29,26,-19,71,0,6,29,27,-20,72,1,5,28,26,-20,71,0,5,28,26,-20,72,0,6,29,26,-20,72,0,5,29,27,-19,71,0,6,29,27,-19,72,1,5,31,26,-18,73,0,4,30,25,-18,72,0,6,30,25,-19,73,0,5,30,25,-19,73,-1,4,25,24,-19,73,-4,5,25,25,-20,74,-3,4,26,25,-19,72,-3,5,26,25,-19,73,-2,4,27,27,-20,72,-1,3,26,26,-20,71,-2,4,25,27,-21,73,-2,3,25,26,-21,72,-3,2,25,27,-21,71,-3,4,25,28,-21,72,-1,3,26,26,-20,71,-2,4,26,27,-20,72,-1,3,28,28,-21,71,0,2,28,27,-20,69,-1,2,27,29,-22,71,0,1,26,28,-22,70,-2,1,31,29,-20,67,2,0,31,28,-20,66,0,1,27,28,-22,69,-1,2,27,29,-22,70,0,2,32,28,-18,68,1,0,32,26,-18,67,0,2,28,26,-20,70,-1,3,28,28,-21,71,0,0,26,28,-20,70,-2,-1,26,27,-20,69,-4,-1,31,26,-18,66,-1,0,31,27,-18,67,0,-1,26,29,-22,70,-2,-2,26,28,-22,68,-3,-3,31,27,-20,65,0,-1,31,29,-20,66,0,-2,25,28,-22,69,-4,0,25,29,-22,70,-3,-1,26,27,-20,69,-4,0,26,28,-21,70,-2,0,24,28,-20,72,-4,0,24,27,-20,70,-5,0,23,29,-21,72,-4,-1,23,28,-21,71,-5,0,22,28,-21,71,-6,0,23,29,-21,72,-5,0,23,27,-20,70,-5,0,24,28,-20,72,-4,1,22,27,-18,73,-4,0,22,26,-18,72,-5,1,21,28,-19,73,-5,0,21,27,-19,73,-6,-4,22,28,-18,72,-7,-3,22,29,-18,73,-7,-3,22,28,-17,71,-7,-2,22,28,-17,72,-6,-2,24,28,-18,71,-5,-3,24,27,-18,70,-6,-3,24,29,-19,72,-6,-4,23,28,-19,71,-7,-4,24,28,-19,70,-6,-3,24,29,-20,71,-5,-3,24,27,-18,70,-6,-2,24,28,-18,71,-5,-2,26,28,-19,70,-3,-3,26,27,-18,69,-5,-3,26,29,-20,70,-4,-5,26,28,-20,69,-5,-3,31,28,-20,66,0,-4,31,26,-19,65,-2,-5,27,27,-20,68,-4,-3,27,29,-20,69,-3,-1,31,26,-18,67,0,-3,30,25,-17,65,-2,-3,26,26,-18,68,-5,-2,27,28,-19,70,-3,-4,24,28,-19,70,-6,-3,24,27,-18,70,-6,-2,24,28,-18,71,-5,-3,24,29,-20,71,-5,-5,26,28,-20,68,-5,-3,26,27,-18,68,-5,-2,26,28,-19,70,-3,-3,27,29,-20,70,-3,-1,26,29,-22,70,-2,0,26,28,-21,70,-2,-1,26,27,-20,69,-4,-2,25,28,-22,69,-4,0,23,29,-21,72,-4,0,24,28,-20,72,-4,0,24,27,-20,70,-5,-1,23,28,-21,71,-6,1,27,28,-22,69,-1,2,28,27,-21,70,-1,3,28,28,-21,71,0,2,27,29,-22,71,0,3,25,26,-21,72,-3,3,26,26,-20,71,-2,4,26,27,-20,72,-1,4,25,27,-21,73,-2,5,30,28,-21,70,2,5,30,27,-20,70,2,4,30,27,-20,69,0,4,29,28,-21,70,0,6,29,27,-20,72,0,6,29,27,-19,72,1,5,29,26,-19,71,0,5,28,26,-20,71,0,-3,34,22,-16,61,-1,-1,34,25,-15,64,-1,0,35,23,-13,62,-2,-2,35,21,-15,60,-2,-2,31,22,-17,63,-4,-1,31,24,-16,64,-3,0,32,22,-14,63,-4,-1,32,20,-15,62,-5,0,37,25,-13,65,2,-3,35,27,-17,64,1,-1,40,22,-12,59,1,-3,39,24,-14,60,3,-1,33,21,-15,61,-4,-3,33,22,-17,62,-2,0,33,23,-13,63,-3,-1,33,24,-15,64,-1,-1,31,20,-15,63,-6,-2,30,22,-17,64,-5,0,31,22,-14,64,-4,-1,31,24,-16,65,-3,0,28,23,-15,67,-5,0,28,22,-14,66,-5,-1,27,22,-16,67,-6,0,28,21,-14,66,-6,-3,34,22,-17,61,-2,-1,33,24,-15,64,-1,0,34,23,-13,62,-2,-1,34,21,-15,60,-3,0,32,22,-14,64,-4,-1,31,20,-15,63,-5,-1,31,24,-16,64,-3,-2,31,22,-17,64,-4,-3,38,26,-15,62,2,1,61,-13,-15,55,-17,-2,64,-17,-14,59,-19,1,56,-9,-14,50,-13,-6,52,-10,-8,63,-19,-1,56,-11,-14,56,-13,4,61,-15,-18,61,-17,-2,58,-6,-13,57,-7,0,66,-6,-16,66,-8,2,58,-15,-17,59,-17,0,62,-6,-15,62,-7,-3,56,-8,-13,55,-10,2,66,-11,-17,66,-13] }, + { "name": "animation_000011", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-8,65,-8,-19,67,-8,-7,70,4,-19,72,4,-6,77,-12,-16,79,-13,-5,81,1,-16,83,0,-6,67,-1,-20,70,-1,-3,80,-6,-17,83,-6,-12,61,0,-17,63,0,-13,64,8,-16,65,8,-5,75,3,-18,78,3,-6,72,-12,-18,74,-13,-3,74,-4,-20,77,-5,-13,72,9,-13,66,-10,-10,83,2,-11,79,-14,-13,68,-1,-10,84,-7,-15,62,0,-14,64,8,-12,77,5,-12,72,-14,-6,73,3,-18,76,2,-7,68,-10,-19,70,-11,-5,70,-2,-20,74,-3,-12,75,6,-13,68,-12,16,44,12,-26,37,10,15,48,10,-28,41,8,12,51,9,-26,46,7,8,51,9,-23,48,7,5,49,10,-20,46,9,6,45,12,-18,43,11,9,42,14,-20,38,12,13,41,13,-23,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-11,35,-26,3,38,-23,-8,39,-22,0,36,-18,-5,39,-18,2,30,-15,-3,33,-14,6,25,-14,-5,27,-14,10,25,-18,-8,24,-18,14,38,-14,-18,34,-15,14,33,-12,-16,29,-13,10,41,-15,-16,39,-16,5,42,-15,-12,42,-15,1,39,-13,-8,41,-13,2,33,-11,-6,35,-10,6,29,-9,-8,29,-9,11,29,-10,-12,27,-11,14,43,-3,-22,38,-4,15,39,-1,-21,33,-2,11,46,-3,-21,42,-5,6,46,-3,-17,45,-4,3,44,-2,-13,44,-2,4,39,0,-12,39,0,7,35,0,-13,34,0,12,35,0,-17,32,0,28,14,15,-31,11,31,30,15,18,-33,13,33,29,16,22,-33,16,35,26,15,24,-31,17,37,23,14,23,-28,16,38,22,12,20,-26,14,36,23,11,16,-25,11,33,25,12,14,-28,10,31,15,45,7,-26,36,7,17,47,11,-29,39,10,16,47,16,-29,42,14,12,46,18,-26,44,17,9,44,17,-22,43,17,6,42,13,-19,40,14,7,42,8,-19,37,10,11,43,6,-22,35,8,21,38,12,-31,31,16,19,36,8,-27,28,13,20,38,17,-31,34,20,16,37,20,-28,36,23,13,35,19,-23,35,23,10,33,15,-20,32,20,11,33,9,-20,29,16,15,34,7,-23,27,13,24,31,13,-32,25,20,22,29,9,-28,22,18,23,32,18,-32,28,24,20,31,21,-29,30,27,16,29,20,-24,29,27,14,27,16,-21,26,24,14,26,11,-21,23,21,18,27,8,-24,22,18,27,23,16,-32,19,27,25,21,12,-30,16,25,26,23,20,-32,21,30,23,22,22,-30,23,32,20,21,21,-26,22,33,18,19,18,-24,20,30,19,18,14,-24,17,27,22,19,12,-26,16,25,12,48,18,-26,42,17,13,52,14,-29,45,12,7,52,15,-24,48,14,7,45,16,-20,43,15,11,42,15,-22,37,14,16,46,14,-28,39,12,9,52,9,-25,48,8,5,48,11,-19,46,10,7,43,11,-18,40,10,13,43,9,-23,38,8,14,49,9,-27,42,6,9,47,6,-21,43,5,13,50,17,-28,44,15,10,50,18,-25,45,16,10,53,15,-27,47,13,14,47,17,-27,40,15,15,49,15,-29,42,12,9,46,18,-23,42,17,7,49,16,-22,46,15,12,44,18,-24,39,16,9,43,16,-21,40,15,14,43,15,-25,37,13,16,47,11,-28,40,9,13,50,12,-27,44,9,11,53,12,-27,47,10,8,53,13,-24,48,11,6,50,13,-21,48,12,6,47,13,-20,45,12,7,44,14,-19,41,13,9,41,13,-20,38,12,13,42,12,-23,37,11,16,44,11,-26,37,9,12,51,8,-26,45,6,7,51,10,-22,48,8,5,45,10,-18,43,10,10,42,9,-20,38,8,14,46,8,-25,39,6,12,48,7,-24,43,5,9,50,7,-23,46,6,6,48,8,-20,45,7,8,44,8,-19,41,7,11,44,7,-22,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-26,-10,35,-27,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-10,50,-31,7,52,-24,-12,48,-25,4,50,-19,-8,48,-19,-2,49,-17,-2,51,-32,8,45,-25,-11,42,-25,7,46,-31,-9,43,-31,5,44,-19,-8,41,-19,-1,42,-17,-1,45,-33,4,56,-28,-10,51,-31,7,51,-24,-11,45,-28,5,45,-23,-7,41,-25,0,41,-23,-3,55,-30,1,60,-22,-12,55,-25,5,57,-16,-15,50,-21,2,52,-12,-12,47,-15,-4,48,-13,-5,59,-25,6,54,-20,-13,47,-24,3,58,-25,-11,53,-28,3,49,-16,-10,44,-19,-2,45,-16,-4,57,-28,1,60,-22,-12,55,-25,5,57,-16,-15,50,-21,2,52,-12,-12,47,-15,-4,48,-13,-5,59,-25,-5,67,-11,-15,64,-13,-2,65,-9,-17,60,-12,-4,60,-9,-13,57,-11,-8,57,-9,-11,67,-12,-7,67,-10,-13,65,-12,-5,64,-9,-14,61,-12,-6,60,-9,-12,58,-11,-8,58,-9,-10,67,-12,-10,66,-6,-14,65,-7,-8,64,-5,-14,62,-7,-8,61,-5,-13,60,-6,-10,59,-5,-12,67,-7,-9,66,-6,-14,65,-7,-8,64,-4,-15,62,-6,-9,61,-3,-14,60,-4,-11,60,-3,-12,66,-7,-10,68,-4,-15,67,-6,-9,66,-3,-16,64,-5,-10,62,-2,-15,61,-3,-12,61,-2,-13,69,-5,9,59,-6,-20,57,-10,8,56,-6,-18,58,-9,6,56,-6,-17,60,-7,3,57,-5,-19,62,-5,3,60,-4,-21,63,-5,4,62,-4,-23,62,-6,6,63,-4,-24,60,-8,9,61,-5,-23,58,-10,12,54,12,-23,45,4,11,52,12,-21,45,5,9,51,12,-21,47,6,7,52,12,-22,48,7,7,54,13,-24,49,8,8,56,13,-26,48,7,10,57,13,-26,47,5,12,56,12,-25,45,4,10,53,5,-19,50,0,12,55,5,-22,49,-1,8,52,5,-19,52,2,5,53,6,-20,53,3,5,56,6,-22,54,3,6,58,7,-25,53,2,9,59,6,-25,52,0,11,58,6,-24,50,-1,9,55,0,-19,54,-3,11,57,0,-21,53,-5,7,54,0,-18,55,-2,4,55,0,-19,57,0,4,57,1,-22,58,0,5,60,1,-24,57,-1,8,61,1,-25,55,-3,10,59,0,-23,54,-5,9,55,-3,-18,56,-6,10,58,-2,-20,55,-7,6,55,-3,-18,58,-4,4,56,-2,-19,59,-3,3,59,-1,-22,60,-3,4,61,-1,-24,60,-4,7,62,-1,-24,58,-6,9,60,-2,-23,56,-7,0,44,26,-15,60,7,0,44,25,-16,61,6,-1,44,24,-15,61,4,0,42,23,-15,60,3,0,42,23,-13,59,4,1,42,24,-13,59,5,2,42,26,-13,59,7,1,44,26,-14,60,8,10,56,16,-26,45,9,9,57,15,-27,46,8,8,55,13,-27,46,5,9,54,12,-25,45,4,10,52,12,-23,43,4,12,52,13,-23,43,6,13,54,14,-23,43,8,12,55,16,-24,44,10,1,48,22,-19,57,7,3,48,24,-18,56,8,1,47,21,-18,57,5,1,45,20,-17,56,4,3,44,20,-16,55,4,4,44,21,-15,54,5,5,45,23,-15,54,7,4,47,24,-16,55,8,6,55,17,-25,49,7,8,54,18,-24,48,9,6,53,15,-25,49,5,7,51,13,-23,48,4,9,50,13,-21,46,4,10,50,15,-20,45,5,11,51,16,-21,46,8,10,53,18,-22,47,9,8,56,15,-27,47,7,10,56,16,-26,46,9,7,55,14,-26,47,5,8,53,13,-24,46,4,10,51,12,-23,44,4,12,51,13,-22,43,6,12,53,15,-23,43,8,12,55,16,-24,44,10,30,14,16,-32,14,32,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-29,2,47,25,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,44,25,7,31,-29,7,48,25,2,31,-29,2,48,31,6,38,-35,6,54,27,5,37,-32,6,53,36,5,34,-40,5,50,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-35,2,54,27,0,38,-32,0,54,31,0,38,-35,0,54,37,0,35,-41,0,50,25,0,31,-29,0,48,36,0,28,-40,0,44,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-29,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-38,0,39,30,0,12,-32,0,28,31,2,38,-35,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-35,0,54,37,0,35,-41,0,50,25,2,31,-29,2,48,25,0,31,-29,0,48,36,2,28,-40,2,44,36,0,28,-40,0,44,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-29,0,47,25,2,31,-29,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-38,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-38,0,39,30,0,12,-32,0,28,8,61,-9,-24,62,-11,6,57,-8,-22,57,-10,-4,56,-12,-10,56,-13,0,63,-18,-14,63,-19,6,63,-3,-22,64,-6,4,57,-2,-21,58,-4,-6,57,-9,-9,56,-10,0,66,-8,-14,66,-9,2,55,-10,-18,56,-12,7,58,-13,-22,59,-15,0,59,-4,-17,59,-5,2,65,-5,-18,65,-6,7,58,-9,-23,59,-12,0,60,-17,-13,60,-18,5,60,-1,-22,61,-3,1,60,-10,-16,61,-12,6,56,-12,-21,57,-15,0,62,-3,-17,62,-5,4,56,-5,-21,57,-8,8,63,-6,-23,64,-9,-6,56,-10,-9,55,-11,0,66,-13,-14,66,-14,0,55,-7,-16,55,-8,4,65,-10,-19,66,-12,4,56,-9,-20,56,-11,7,60,-11,-23,61,-13,2,58,-2,-19,58,-4,5,64,-4,-20,65,-6,6,57,-10,-22,58,-13,3,61,-2,-19,61,-4,2,56,-6,-19,56,-8,6,64,-8,-21,65,-10,0,31,26,-18,68,0,-2,31,25,-18,66,-2,-1,38,23,-12,63,1,0,39,25,-13,65,3,-2,31,28,-20,66,0,-4,31,26,-19,65,-2,-3,39,25,-15,61,2,-2,39,28,-16,62,4,-1,39,29,-16,63,5,-3,39,27,-16,62,4,-2,31,27,-20,65,0,0,31,29,-21,67,0,2,39,26,-13,67,4,0,39,24,-13,64,3,0,31,25,-18,67,-1,1,32,27,-19,69,0,3,33,27,-19,69,1,1,32,26,-19,68,0,1,39,25,-13,66,3,2,40,27,-14,67,5,1,32,30,-21,68,2,0,32,28,-21,66,0,-2,39,29,-16,62,5,0,40,30,-16,64,7,1,40,30,-16,66,8,0,39,30,-16,63,6,1,32,28,-21,66,2,3,33,29,-21,67,4,2,41,28,-14,67,7,1,40,26,-13,66,5,3,33,26,-20,68,1,4,34,28,-20,68,3,3,40,28,-13,67,7,-1,39,23,-12,63,1,-1,42,23,-11,61,3,2,43,27,-11,64,8,1,41,30,-15,65,8,-3,39,25,-15,61,2,-3,42,25,-13,60,4,0,43,29,-13,63,9,-2,40,29,-16,62,5,-2,43,27,-13,60,6,1,39,25,-13,66,4,0,42,25,-11,63,6,6,31,27,-21,70,2,4,30,27,-21,69,0,2,33,27,-20,67,2,4,34,27,-20,68,3,5,31,29,-22,70,2,4,30,28,-22,69,0,2,32,28,-21,66,2,3,33,29,-21,67,4,5,29,28,-22,70,0,6,30,28,-22,71,1,5,30,27,-21,70,0,6,31,27,-21,70,2,7,30,27,-20,71,1,6,29,26,-20,71,0,7,29,27,-21,72,0,6,29,27,-21,71,0,6,28,26,-21,72,0,7,29,27,-21,72,0,5,29,27,-20,71,0,6,30,27,-20,72,0,7,31,25,-19,73,0,6,30,25,-19,73,-1,7,30,25,-20,74,0,6,30,25,-20,73,-1,5,26,24,-21,73,-4,6,26,25,-21,74,-3,5,27,24,-20,73,-3,6,27,25,-20,74,-2,5,27,27,-21,72,-1,3,27,26,-21,71,-3,5,26,27,-22,73,-2,4,25,26,-22,72,-3,3,26,27,-22,71,-3,5,26,28,-23,72,-2,4,27,26,-21,71,-2,5,27,26,-21,72,-1,4,29,27,-22,71,0,2,28,26,-21,69,-1,3,27,29,-23,71,-1,2,27,27,-23,70,-2,1,32,29,-21,67,2,0,31,28,-21,66,0,2,28,28,-23,69,-1,3,28,29,-23,70,0,2,33,27,-19,68,1,1,32,26,-19,67,0,2,28,26,-21,70,-2,4,29,27,-22,71,0,1,27,28,-22,70,-3,0,26,27,-21,69,-4,0,31,25,-18,67,-1,0,32,27,-19,68,0,0,27,29,-23,69,-2,-1,26,28,-23,68,-4,-2,31,27,-21,65,0,-1,31,29,-21,66,0,-1,25,28,-23,69,-4,0,26,29,-23,70,-3,0,26,27,-21,69,-4,1,26,28,-22,70,-2,1,24,28,-21,72,-4,0,24,26,-21,71,-5,0,24,29,-22,72,-4,0,23,28,-22,71,-6,0,23,27,-22,71,-6,1,23,29,-22,72,-5,0,24,26,-21,71,-5,2,24,28,-21,72,-4,3,22,27,-19,73,-4,2,22,26,-19,72,-5,2,21,28,-20,74,-5,1,21,27,-20,73,-6,-2,22,28,-19,72,-8,-2,22,29,-19,73,-7,-1,22,27,-18,72,-7,-1,22,28,-19,72,-6,-1,24,28,-19,71,-5,-2,24,27,-19,70,-6,-2,24,29,-21,72,-6,-3,24,28,-20,71,-7,-3,24,28,-21,70,-6,-2,25,29,-21,71,-5,-2,24,27,-19,70,-6,-1,25,28,-20,71,-5,-1,26,28,-20,70,-3,-2,26,26,-19,69,-5,-2,26,29,-21,70,-4,-4,26,28,-21,69,-5,-2,32,28,-20,66,0,-3,31,26,-20,65,-2,-4,27,27,-21,68,-5,-2,27,29,-21,69,-3,-1,31,26,-18,67,0,-2,31,25,-18,66,-2,-2,27,26,-19,69,-5,-1,27,28,-20,70,-3,-3,24,28,-20,70,-7,-2,24,27,-19,70,-6,-1,24,28,-20,71,-5,-2,24,29,-21,71,-5,-4,27,27,-21,68,-5,-2,26,26,-19,69,-5,-1,27,28,-20,70,-3,-2,27,29,-21,70,-4,0,26,29,-23,70,-3,1,27,28,-22,70,-2,0,26,27,-21,69,-4,-1,26,28,-23,69,-4,1,23,29,-22,72,-5,1,24,28,-21,72,-4,0,24,26,-21,71,-5,0,23,27,-22,71,-6,2,27,28,-23,69,-2,2,28,26,-22,70,-1,4,29,28,-22,71,0,3,28,29,-23,70,0,4,25,26,-22,72,-3,4,27,26,-21,71,-2,5,27,27,-21,72,-1,5,26,27,-23,73,-2,6,30,28,-22,71,1,6,31,27,-21,70,2,5,30,27,-21,70,0,4,29,28,-22,70,0,7,29,27,-21,72,0,7,30,27,-20,72,1,6,29,26,-20,71,0,6,28,27,-21,71,0,-3,35,22,-16,62,-1,-1,34,25,-16,64,-1,0,35,23,-13,63,-2,-1,35,21,-15,61,-2,-2,31,22,-17,63,-4,0,32,24,-16,65,-3,0,33,22,-14,64,-4,0,32,20,-15,63,-5,0,37,25,-13,66,2,-2,35,27,-17,64,1,-1,40,22,-12,60,1,-3,40,24,-14,61,3,-1,34,21,-15,62,-4,-2,33,22,-17,62,-2,0,34,22,-14,64,-3,-1,33,24,-16,64,-1,0,31,20,-15,64,-6,-1,31,22,-17,65,-5,0,32,22,-14,65,-4,0,31,23,-16,65,-3,0,29,23,-16,67,-5,1,29,22,-15,67,-5,0,28,22,-16,67,-6,0,28,21,-15,67,-7,-3,34,22,-17,62,-2,-1,34,24,-16,64,-1,0,35,23,-14,63,-2,-1,34,21,-15,61,-3,0,32,22,-14,64,-4,0,32,20,-16,63,-5,0,31,23,-16,65,-3,-2,31,22,-17,64,-4,-2,38,26,-15,63,2,1,60,-13,-15,55,-17,-2,64,-17,-14,60,-19,1,56,-9,-14,50,-13,-6,52,-10,-8,63,-19,-1,56,-11,-14,56,-13,4,60,-15,-18,61,-17,-3,58,-6,-13,57,-7,0,66,-6,-16,66,-8,2,58,-15,-17,59,-17,0,62,-6,-15,62,-7,-3,56,-8,-13,55,-10,2,66,-11,-17,66,-13] }, + { "name": "animation_000012", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-7,65,-8,-17,67,-8,-5,72,4,-16,74,3,-4,75,-14,-15,78,-14,-3,82,-1,-14,84,-1,-5,68,-1,-18,71,-2,-2,80,-8,-15,83,-9,-10,63,1,-16,64,1,-11,67,8,-14,67,8,-3,77,2,-16,79,1,-5,71,-13,-16,73,-13,-2,74,-6,-18,78,-6,-11,75,8,-12,65,-9,-8,85,0,-9,77,-16,-11,69,-1,-8,84,-10,-13,63,1,-12,67,8,-9,79,4,-11,71,-15,-4,75,2,-16,77,1,-5,67,-11,-17,70,-11,-3,71,-3,-18,74,-4,-10,77,4,-11,68,-12,15,44,12,-24,38,11,15,48,10,-25,42,9,11,51,9,-23,46,8,7,51,9,-20,48,9,5,48,10,-17,46,10,5,44,12,-16,42,12,9,41,14,-18,38,13,13,41,14,-21,36,12,13,27,-22,-11,25,-23,12,32,-26,-12,30,-26,8,36,-26,-10,36,-26,3,38,-23,-7,39,-22,0,36,-18,-4,38,-17,1,30,-15,-3,32,-14,6,25,-14,-5,26,-14,10,25,-18,-8,24,-19,14,38,-14,-17,34,-15,14,33,-12,-15,29,-13,10,41,-15,-15,39,-15,5,42,-15,-10,42,-14,1,39,-13,-6,40,-12,2,33,-11,-5,34,-10,6,29,-9,-7,29,-9,11,29,-10,-12,27,-11,14,43,-2,-21,39,-4,15,39,-1,-20,34,-2,10,46,-3,-19,43,-4,6,46,-3,-15,45,-3,3,44,-2,-11,43,-1,3,39,0,-10,39,0,7,35,0,-12,34,0,12,35,0,-16,32,0,28,14,15,-31,11,31,30,15,18,-33,14,33,29,16,22,-33,16,36,26,15,24,-31,17,38,23,14,23,-27,16,38,22,12,20,-25,13,36,23,11,16,-26,11,33,25,12,14,-28,10,31,14,45,7,-24,37,8,16,47,11,-27,40,11,15,47,16,-27,43,15,12,46,19,-23,44,18,8,44,18,-19,43,18,6,42,13,-16,40,15,7,42,9,-17,37,11,10,43,6,-20,35,8,21,38,12,-29,32,16,18,36,8,-26,28,14,20,38,17,-29,35,21,16,37,20,-25,36,23,12,35,19,-21,35,23,10,33,15,-18,32,20,11,33,9,-19,28,16,15,34,7,-22,27,13,24,31,13,-31,26,21,22,29,9,-28,23,18,23,31,18,-30,29,25,19,30,21,-27,30,27,15,28,20,-23,29,27,13,27,16,-20,26,25,14,26,11,-20,23,21,18,27,8,-24,22,18,27,23,16,-32,19,27,25,21,13,-30,17,25,26,23,20,-32,22,31,23,22,22,-29,23,33,20,21,21,-25,22,33,18,19,18,-23,19,31,19,18,14,-23,17,27,22,19,12,-26,16,25,11,47,19,-23,42,18,13,52,14,-26,46,13,7,52,15,-20,48,15,6,45,16,-17,42,16,11,42,15,-20,37,15,15,46,14,-26,39,13,9,52,10,-21,48,9,5,48,11,-16,46,11,7,42,11,-16,40,10,13,43,9,-21,38,8,14,49,9,-25,43,8,9,47,6,-19,43,6,13,50,17,-25,44,16,9,50,18,-22,45,17,10,53,15,-23,48,14,14,47,17,-25,40,16,15,49,15,-26,42,13,9,46,18,-20,42,18,6,48,17,-19,45,16,11,44,18,-22,39,17,8,43,16,-18,39,16,14,43,15,-23,38,14,15,47,11,-26,41,10,13,50,12,-25,44,11,11,53,12,-24,47,11,8,52,13,-21,49,12,5,50,13,-18,47,13,6,47,13,-17,44,13,6,44,14,-16,41,13,9,41,13,-18,38,13,12,42,12,-21,37,11,15,44,12,-24,38,10,12,51,9,-23,46,8,6,51,10,-19,48,10,5,45,10,-15,43,11,10,42,10,-18,38,9,14,45,8,-23,40,7,11,48,7,-22,43,6,9,50,7,-20,46,7,6,47,8,-17,45,8,7,44,8,-17,41,8,11,44,7,-20,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,52,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-11,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-30,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-5,59,-25,-4,67,-11,-14,64,-12,-1,65,-9,-15,60,-12,-2,60,-9,-12,57,-10,-7,57,-9,-9,67,-12,-6,67,-10,-12,65,-12,-4,64,-9,-12,61,-11,-4,60,-8,-10,58,-10,-7,58,-9,-9,67,-11,-8,67,-5,-13,65,-7,-7,64,-4,-13,62,-6,-7,61,-4,-11,60,-5,-9,60,-4,-11,67,-6,-8,66,-6,-12,65,-7,-7,64,-4,-13,63,-5,-8,62,-2,-12,61,-3,-10,60,-2,-10,66,-7,-8,69,-4,-14,68,-6,-7,66,-3,-14,65,-4,-8,63,-1,-13,62,-2,-10,61,-1,-11,69,-6,11,58,-6,-18,58,-9,10,56,-6,-16,58,-8,7,55,-6,-16,60,-6,5,57,-5,-17,62,-4,4,60,-5,-20,63,-4,6,62,-4,-22,62,-5,8,62,-4,-23,60,-7,10,61,-5,-21,58,-8,12,53,12,-20,45,5,11,51,12,-18,45,6,9,51,12,-17,47,7,7,52,12,-19,48,8,7,54,13,-21,49,8,8,56,13,-22,48,8,10,56,13,-23,47,6,12,55,13,-22,45,5,10,52,5,-17,50,0,12,55,5,-19,49,0,8,52,5,-16,52,2,6,53,5,-17,53,4,5,56,6,-20,54,4,7,58,6,-22,53,3,9,59,6,-23,51,1,12,57,6,-22,50,0,10,54,0,-17,54,-3,11,56,0,-19,53,-4,7,54,0,-16,56,-1,5,55,0,-17,57,0,5,57,1,-20,58,0,6,60,1,-22,57,0,9,60,1,-23,55,-2,11,59,0,-21,54,-4,10,55,-3,-16,56,-5,11,57,-2,-19,55,-6,7,54,-3,-16,58,-3,5,56,-2,-17,60,-2,4,58,-2,-20,60,-2,6,61,-1,-22,60,-3,8,61,-1,-23,58,-4,11,60,-2,-21,56,-6,0,45,26,-12,61,8,-1,45,25,-13,61,7,-2,44,24,-13,61,5,-2,43,23,-12,61,4,-1,42,23,-11,60,4,0,42,24,-10,59,6,0,43,26,-10,59,7,0,44,26,-11,60,8,10,56,16,-22,45,10,9,56,14,-24,45,9,8,55,13,-24,45,6,8,53,12,-22,45,5,10,52,12,-20,43,5,12,52,13,-19,42,7,12,53,15,-20,43,9,12,55,16,-21,43,10,0,48,22,-16,57,7,2,48,23,-15,56,9,0,47,21,-16,57,6,0,46,20,-15,56,4,2,45,20,-14,55,5,3,45,21,-13,55,6,4,45,23,-13,55,8,3,47,24,-14,55,9,6,54,16,-22,49,8,8,54,18,-21,48,10,5,53,15,-22,49,6,6,51,13,-20,47,4,8,49,14,-18,46,4,10,49,15,-17,45,6,10,50,17,-17,45,8,10,52,18,-19,47,10,8,56,15,-23,47,8,10,56,16,-22,45,10,7,54,13,-23,47,6,8,52,13,-21,46,5,9,51,12,-20,44,5,11,51,14,-19,43,6,12,52,15,-19,43,9,12,54,16,-20,44,10,30,14,16,-32,14,32,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-29,2,47,25,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-29,7,48,25,2,31,-29,2,48,31,6,38,-35,6,54,27,5,37,-32,6,53,36,5,34,-40,5,50,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-35,2,54,27,0,38,-32,0,54,31,0,38,-35,0,54,37,0,35,-41,0,50,25,0,31,-29,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-29,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-38,0,39,30,0,12,-32,0,28,31,2,38,-35,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-35,0,54,37,0,35,-41,0,50,25,2,31,-29,2,48,25,0,31,-29,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-29,0,47,25,2,31,-29,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-38,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-38,0,39,30,0,12,-32,0,28,10,61,-9,-22,62,-10,7,56,-8,-21,58,-9,-3,56,-12,-9,56,-13,1,63,-18,-13,63,-18,8,63,-3,-21,64,-4,6,57,-2,-19,58,-3,-5,57,-9,-8,56,-9,0,66,-8,-12,66,-8,3,55,-10,-17,56,-11,8,58,-13,-21,60,-14,2,59,-4,-15,59,-4,4,65,-5,-17,65,-5,8,58,-9,-22,59,-10,0,60,-17,-13,61,-18,7,60,-1,-20,61,-2,2,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-7,9,63,-7,-22,64,-8,-5,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-8,6,65,-10,-18,66,-11,5,56,-9,-19,57,-10,9,59,-11,-22,61,-12,4,58,-2,-17,59,-3,6,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-18,61,-3,3,56,-6,-17,56,-7,8,64,-8,-20,65,-9,0,32,25,-17,68,0,-2,32,24,-16,67,-1,-2,39,23,-10,64,2,0,40,25,-11,66,4,-2,32,27,-19,66,1,-4,32,25,-18,65,-1,-4,39,25,-13,61,3,-3,40,28,-14,62,5,-2,40,29,-14,63,6,-4,39,27,-14,62,5,-2,32,26,-19,65,0,0,32,28,-20,66,2,1,40,26,-12,67,5,-1,40,24,-11,65,3,0,32,24,-17,67,0,1,33,26,-17,69,1,3,34,27,-18,69,2,1,33,25,-17,68,1,0,40,25,-11,66,4,1,41,27,-12,67,6,1,33,29,-20,67,3,0,32,27,-19,65,2,-3,40,28,-14,62,6,-1,40,29,-14,64,8,0,41,30,-14,66,9,-1,40,29,-14,63,7,1,34,27,-19,65,3,3,35,28,-20,67,5,1,42,28,-13,68,8,0,41,26,-12,66,6,2,35,25,-18,68,2,4,35,27,-19,68,5,2,41,28,-11,67,8,-2,40,23,-10,64,2,-3,43,23,-8,62,4,0,44,27,-9,65,9,0,41,30,-13,65,9,-5,40,25,-12,61,3,-5,42,25,-11,60,4,-1,44,29,-11,63,9,-3,40,28,-14,62,6,-3,43,27,-11,61,7,0,40,25,-11,66,5,0,43,25,-9,64,6,6,33,26,-19,70,3,4,32,26,-19,69,2,2,34,26,-18,67,3,3,35,27,-18,68,5,5,32,28,-21,70,3,4,31,27,-20,69,2,2,34,27,-20,66,3,3,35,28,-20,67,5,5,31,26,-20,70,1,6,32,27,-21,71,3,5,32,26,-19,70,2,6,33,26,-19,70,3,7,32,25,-19,71,2,6,31,25,-19,71,1,7,31,26,-20,72,2,6,30,26,-20,71,1,6,31,25,-20,72,0,7,31,25,-20,72,2,5,31,26,-19,71,1,6,32,26,-19,72,2,6,33,25,-18,73,1,5,33,24,-18,73,0,7,33,24,-19,74,1,6,32,24,-19,73,0,6,28,23,-20,73,-3,7,28,24,-20,74,-2,5,29,23,-19,73,-2,6,29,24,-19,74,-1,5,29,26,-20,72,0,4,29,25,-20,71,-1,6,28,25,-21,73,-1,5,27,25,-21,72,-2,4,27,25,-21,71,-1,5,28,26,-22,72,0,4,29,24,-20,71,-1,5,29,25,-20,72,0,4,30,26,-21,70,1,3,30,25,-20,69,0,4,29,27,-22,71,0,3,28,26,-22,70,0,1,33,28,-20,67,3,0,32,27,-19,66,1,2,29,27,-22,69,0,3,29,28,-22,70,1,2,34,27,-18,68,3,1,33,26,-18,67,1,3,30,25,-20,70,0,4,30,26,-21,71,0,1,28,27,-20,70,-1,0,27,25,-20,69,-3,0,32,25,-17,67,0,0,33,26,-17,68,1,0,27,28,-22,69,-1,0,27,27,-21,68,-2,-2,32,27,-19,65,0,0,32,28,-20,66,1,0,26,27,-22,69,-3,0,27,28,-22,70,-2,0,27,25,-20,69,-2,1,28,27,-20,70,-1,2,26,26,-20,72,-2,1,25,25,-19,71,-3,2,25,27,-21,72,-3,0,25,26,-21,71,-4,1,24,26,-21,71,-4,2,24,27,-21,72,-3,1,25,25,-20,71,-3,3,26,26,-20,72,-2,4,24,25,-18,73,-3,3,24,24,-18,72,-4,4,23,26,-19,74,-4,3,23,25,-19,73,-5,-1,22,26,-18,73,-6,0,23,27,-19,73,-5,0,23,26,-18,72,-5,0,23,27,-18,73,-5,0,25,27,-19,72,-4,-1,25,26,-18,71,-5,-1,25,28,-20,72,-4,-2,24,27,-19,71,-5,-2,25,27,-20,70,-5,-1,25,28,-20,71,-4,-1,25,26,-18,70,-5,0,26,27,-19,71,-3,0,27,27,-19,70,-2,-2,27,25,-18,69,-4,-2,27,28,-20,70,-3,-3,26,26,-20,69,-4,-2,32,27,-19,66,0,-3,32,25,-18,65,0,-3,27,26,-20,68,-3,-2,28,28,-20,69,-2,-1,32,26,-17,67,0,-2,32,24,-16,66,-1,-2,27,25,-18,69,-3,0,28,27,-19,70,-2,-2,24,27,-20,71,-5,-1,25,26,-18,70,-5,0,25,27,-19,71,-3,-1,25,28,-20,72,-4,-3,27,26,-20,68,-4,-2,27,25,-18,69,-3,0,28,27,-19,70,-2,-2,27,28,-20,70,-2,0,27,28,-22,70,-1,1,28,27,-21,70,-1,0,27,25,-20,69,-2,0,27,27,-22,69,-3,2,25,27,-21,72,-3,2,26,26,-20,72,-2,1,25,25,-20,71,-4,1,24,26,-21,71,-4,2,28,26,-22,69,0,3,30,25,-20,69,0,4,30,26,-21,71,0,4,29,28,-22,70,0,4,27,25,-21,71,-2,4,28,24,-20,71,-1,5,29,25,-20,72,0,5,28,26,-22,72,0,6,32,27,-21,70,3,6,33,26,-19,70,3,5,32,26,-19,69,2,5,31,27,-21,69,2,7,31,26,-20,72,2,7,32,26,-19,72,2,6,31,25,-19,71,1,6,30,25,-20,71,1,-3,35,22,-15,62,0,-1,35,24,-14,65,0,0,37,22,-12,64,-1,-2,36,20,-13,61,-1,-2,32,21,-16,64,-3,-1,33,23,-15,65,-2,0,34,21,-13,65,-3,-1,34,20,-14,63,-4,0,38,24,-12,66,3,-3,36,26,-16,64,2,-3,41,22,-10,61,2,-4,40,24,-12,61,3,-1,35,20,-14,62,-3,-3,34,22,-15,63,-1,0,35,22,-12,64,-2,-1,34,24,-14,65,0,0,33,20,-14,64,-5,-2,32,21,-16,65,-4,0,33,21,-13,65,-3,0,32,23,-15,66,-2,0,30,22,-15,68,-4,1,31,21,-13,68,-4,0,29,21,-15,68,-5,0,30,20,-14,67,-6,-3,35,22,-15,62,-1,-1,35,24,-14,65,0,0,36,22,-12,64,-2,-2,36,20,-13,62,-2,0,34,21,-13,65,-3,0,33,20,-14,64,-4,0,33,23,-15,65,-2,-2,32,21,-16,64,-3,-3,38,25,-13,63,3,2,60,-13,-15,55,-16,-1,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,61,-16,-1,58,-6,-12,57,-7,2,65,-6,-14,66,-7,3,58,-15,-16,59,-16,1,62,-6,-14,62,-7,-1,56,-8,-11,55,-9,3,66,-11,-15,66,-12] }, + { "name": "animation_000013", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-6,65,-8,-17,66,-8,-5,73,3,-17,74,3,-6,76,-14,-16,77,-14,-5,83,-1,-16,84,-1,-5,69,-1,-18,70,-1,-4,81,-8,-17,82,-9,-9,63,1,-15,63,1,-10,67,8,-13,67,8,-4,78,1,-17,79,1,-5,71,-13,-17,72,-13,-3,75,-6,-19,76,-6,-11,75,8,-12,65,-9,-10,85,0,-11,78,-16,-12,69,-1,-10,84,-10,-12,63,1,-12,67,8,-11,79,3,-11,71,-15,-5,76,1,-17,77,1,-6,68,-11,-18,69,-11,-3,72,-3,-19,73,-4,-11,77,4,-12,67,-12,13,43,13,-25,38,10,12,48,11,-26,42,8,9,50,9,-25,46,7,5,50,9,-21,48,8,3,47,11,-18,46,10,3,43,13,-17,42,12,7,40,14,-19,38,13,11,40,14,-22,36,12,14,27,-22,-11,25,-23,12,32,-25,-12,30,-26,8,37,-26,-10,36,-26,3,38,-23,-7,39,-22,0,35,-19,-4,39,-18,1,30,-15,-3,33,-14,6,25,-15,-5,26,-14,11,25,-18,-8,24,-18,13,38,-13,-17,34,-15,14,33,-12,-16,29,-13,9,41,-14,-15,39,-15,4,41,-15,-11,42,-15,0,38,-13,-7,40,-12,1,32,-11,-5,35,-10,6,28,-10,-7,29,-9,11,29,-10,-12,27,-11,12,43,-2,-22,38,-4,14,38,0,-21,34,-2,9,46,-3,-20,43,-4,4,45,-3,-16,45,-3,1,43,-2,-12,44,-2,2,38,0,-11,39,0,6,34,0,-13,34,0,11,35,0,-17,32,0,28,14,15,-31,11,31,29,16,18,-33,13,33,28,16,22,-33,16,36,26,15,24,-31,17,38,23,13,23,-28,16,38,22,12,20,-25,14,36,23,11,16,-26,11,33,25,12,14,-28,10,31,12,44,7,-25,36,8,14,46,12,-28,39,11,13,46,16,-28,43,14,10,45,19,-25,44,17,6,43,18,-20,43,17,4,41,14,-17,40,15,5,41,9,-17,37,11,9,42,6,-21,35,8,19,37,13,-30,31,16,17,35,8,-27,28,13,18,38,18,-30,35,20,14,36,20,-26,36,23,11,34,19,-22,35,23,9,32,15,-19,32,20,10,32,10,-19,29,16,13,33,7,-22,27,13,22,31,14,-31,25,21,21,29,10,-28,23,18,21,31,18,-31,28,24,18,30,21,-28,30,27,14,28,20,-23,29,27,13,26,16,-20,26,25,14,25,11,-21,23,21,17,27,8,-24,22,18,26,23,16,-32,19,27,25,21,13,-30,16,25,25,23,20,-32,22,30,22,22,22,-29,23,33,19,20,21,-26,22,33,18,18,18,-23,19,31,19,18,14,-23,17,27,22,19,12,-26,16,25,9,46,19,-24,42,17,10,51,15,-27,45,13,4,50,16,-22,48,14,4,44,17,-18,43,16,9,41,16,-21,37,14,13,45,15,-27,39,12,6,51,10,-23,48,9,2,47,11,-18,46,10,5,41,11,-17,40,10,11,42,10,-22,38,8,12,48,9,-26,43,7,7,46,7,-20,43,6,10,49,18,-26,44,16,7,48,18,-23,45,17,7,51,16,-25,48,14,12,46,18,-26,40,15,12,48,15,-28,42,13,6,45,19,-21,42,17,4,47,17,-20,46,16,9,43,18,-23,39,16,6,42,17,-19,40,16,12,42,16,-24,38,14,13,47,12,-27,41,9,10,49,12,-26,44,10,8,52,13,-25,47,10,5,51,13,-23,49,12,3,49,14,-19,48,13,4,46,14,-19,45,13,4,42,14,-18,41,13,7,40,13,-19,38,12,10,41,13,-22,37,11,13,43,12,-25,38,10,9,50,9,-25,46,7,4,49,10,-20,48,9,3,43,11,-16,43,10,8,41,10,-19,38,9,12,45,9,-24,40,7,9,47,7,-23,43,5,6,49,8,-21,46,6,4,46,8,-18,45,7,6,43,8,-18,41,7,9,43,8,-21,40,6,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-21,0,34,-18,0,38,-34,5,52,-31,-9,50,-31,8,51,-25,-12,49,-24,4,50,-19,-8,48,-19,-1,49,-17,-2,51,-32,8,45,-25,-10,42,-25,7,46,-31,-9,43,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-30,8,51,-25,-10,45,-28,6,45,-23,-6,41,-25,0,41,-23,-2,55,-29,2,60,-22,-12,55,-24,6,56,-17,-14,50,-20,4,51,-12,-11,47,-14,-3,48,-12,-4,59,-25,7,53,-20,-13,47,-23,3,58,-25,-11,53,-27,4,49,-16,-9,44,-18,-2,45,-16,-3,57,-27,2,60,-22,-12,55,-25,6,56,-17,-14,50,-20,3,52,-12,-11,47,-14,-3,48,-13,-4,59,-25,-4,67,-10,-14,64,-12,0,65,-9,-15,60,-11,-2,60,-9,-12,57,-10,-6,57,-9,-9,67,-12,-5,67,-10,-12,65,-12,-3,64,-9,-12,61,-11,-4,60,-8,-10,58,-10,-7,58,-9,-9,67,-11,-8,67,-5,-12,65,-7,-6,64,-4,-13,62,-6,-7,61,-4,-11,60,-5,-8,60,-4,-10,67,-6,-8,66,-5,-12,65,-6,-6,64,-3,-13,62,-5,-7,62,-2,-12,61,-3,-9,60,-2,-10,66,-7,-8,69,-4,-13,67,-5,-7,66,-2,-14,64,-4,-8,63,-1,-13,62,-2,-10,61,-1,-11,69,-6,11,58,-6,-19,57,-9,10,56,-6,-16,58,-7,7,55,-6,-15,60,-6,5,57,-6,-17,62,-4,4,60,-5,-19,63,-4,6,62,-5,-22,62,-5,8,62,-4,-22,60,-7,11,61,-5,-21,58,-8,11,53,12,-22,45,5,10,52,12,-20,45,6,8,51,12,-19,46,7,6,52,12,-20,48,8,6,54,13,-22,49,9,7,56,13,-24,48,8,9,57,13,-25,47,6,11,55,13,-24,45,5,10,53,5,-18,49,0,12,55,5,-20,49,0,7,52,5,-17,51,2,5,53,5,-18,53,4,5,56,6,-20,54,4,6,58,6,-23,53,3,9,59,6,-24,52,1,11,57,6,-23,50,0,10,54,0,-17,53,-3,11,56,0,-20,53,-4,7,54,0,-16,55,-1,5,55,0,-17,57,0,5,58,1,-20,58,0,6,60,1,-22,57,0,9,60,1,-23,56,-2,11,59,1,-22,54,-3,10,55,-3,-17,56,-5,11,57,-2,-19,55,-6,7,54,-3,-16,57,-3,5,56,-2,-17,59,-2,4,59,-2,-20,60,-1,6,61,-1,-22,60,-2,9,61,-1,-23,58,-4,11,60,-2,-22,56,-6,-1,46,26,-12,60,8,-3,46,25,-13,60,7,-3,45,24,-13,60,5,-3,44,23,-12,59,4,-2,43,23,-11,58,5,-1,43,24,-10,58,6,0,44,26,-10,58,7,0,45,26,-11,59,9,10,56,16,-24,45,10,8,57,14,-25,46,9,7,55,13,-25,46,7,8,53,12,-24,45,5,9,52,12,-22,43,5,11,52,13,-21,42,7,12,53,15,-22,43,9,11,55,16,-23,44,10,0,49,22,-16,56,8,1,49,23,-15,56,9,0,48,21,-16,56,6,0,46,20,-15,55,5,1,45,20,-14,54,5,2,45,21,-13,53,6,3,46,23,-13,54,8,2,48,24,-14,54,9,5,55,16,-23,49,9,7,55,18,-22,48,10,5,53,15,-23,49,6,5,51,14,-22,47,5,7,50,14,-20,46,5,9,49,15,-19,45,6,9,51,17,-19,45,8,9,53,18,-20,46,10,7,56,15,-25,47,9,9,56,16,-24,46,10,6,55,13,-24,47,6,7,53,13,-23,46,5,8,51,13,-21,44,5,10,51,14,-21,43,7,11,53,15,-21,43,9,11,55,16,-22,44,10,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,10,60,-9,-22,62,-10,8,56,-8,-21,58,-9,-3,56,-12,-9,56,-13,2,63,-18,-13,63,-18,8,63,-4,-21,64,-4,6,57,-2,-19,58,-3,-4,57,-9,-8,56,-9,0,66,-8,-12,66,-8,3,55,-10,-16,56,-11,8,58,-13,-20,60,-14,2,59,-4,-15,59,-4,4,65,-5,-16,65,-5,9,58,-9,-21,59,-10,0,60,-17,-12,61,-17,7,60,-1,-20,61,-2,3,60,-10,-15,61,-11,7,56,-13,-20,57,-14,2,62,-3,-15,62,-4,6,56,-5,-19,57,-6,9,63,-7,-21,64,-7,-4,56,-10,-8,55,-10,1,66,-13,-13,66,-13,1,55,-7,-15,55,-7,6,65,-10,-18,66,-10,6,56,-9,-19,57,-10,9,59,-11,-21,61,-12,4,58,-2,-17,58,-3,7,64,-4,-19,65,-5,8,57,-11,-21,58,-12,5,61,-2,-17,61,-2,4,56,-6,-17,56,-7,8,64,-8,-20,65,-9,-1,33,26,-16,68,0,-3,33,24,-15,66,-1,-3,40,23,-10,62,2,-1,40,25,-10,64,4,-4,33,28,-18,66,1,-5,33,25,-17,64,0,-6,40,25,-12,60,3,-5,40,28,-13,61,5,-3,41,29,-14,62,7,-5,40,27,-13,61,5,-4,33,27,-18,64,0,-2,33,29,-19,66,2,0,41,26,-10,66,5,-2,41,24,-10,63,3,-1,33,25,-16,67,0,0,34,27,-16,68,1,1,35,27,-17,68,3,0,34,26,-16,67,1,-1,41,25,-10,65,4,0,42,27,-11,66,7,0,34,29,-19,67,4,-1,33,28,-18,65,2,-4,40,28,-13,61,6,-2,41,30,-13,63,8,0,42,30,-13,65,9,-3,41,30,-13,62,8,0,34,28,-18,65,4,2,36,29,-19,67,6,0,43,28,-11,66,8,-1,42,26,-11,65,6,1,35,26,-17,67,2,2,36,27,-17,68,5,0,42,28,-10,66,8,-3,41,23,-10,62,2,-4,44,23,-8,60,4,0,45,27,-8,63,9,0,42,30,-12,64,9,-6,40,25,-12,60,3,-6,43,25,-10,59,5,-2,45,29,-10,61,9,-4,41,28,-13,61,6,-5,44,27,-11,59,7,0,41,25,-10,65,5,-2,44,25,-8,62,6,4,34,27,-19,70,3,3,33,26,-19,69,2,1,35,26,-17,66,3,2,36,27,-17,67,5,4,33,28,-20,69,4,3,32,27,-20,68,2,0,35,28,-19,66,4,2,35,29,-18,67,5,3,32,27,-20,69,2,5,33,28,-20,70,3,3,33,26,-19,69,2,4,34,27,-19,70,3,5,33,26,-19,71,2,4,32,25,-19,70,1,5,32,27,-20,71,2,4,31,26,-20,70,1,5,32,25,-20,71,1,6,32,26,-20,72,2,4,32,26,-19,71,1,5,33,27,-19,72,2,4,34,26,-19,73,1,3,33,25,-19,73,0,5,34,25,-20,73,1,4,33,25,-20,73,0,4,29,23,-21,73,-3,5,30,24,-21,74,-2,3,30,24,-20,73,-2,4,30,25,-20,73,-1,4,30,26,-20,72,0,2,29,25,-20,71,-1,4,29,26,-22,72,0,3,28,25,-21,71,-1,3,28,26,-21,71,-1,4,29,27,-22,72,0,3,29,25,-20,71,-1,4,30,26,-20,72,0,3,31,27,-20,70,1,1,30,26,-20,69,0,2,30,28,-21,70,1,1,29,27,-21,69,0,0,34,29,-19,67,3,-1,33,28,-18,66,2,1,30,27,-21,68,0,2,30,28,-21,69,1,1,35,27,-17,68,3,0,34,26,-17,67,1,1,30,26,-20,69,0,3,31,27,-20,70,1,0,29,27,-19,70,-1,-1,28,26,-19,69,-2,-1,33,25,-16,66,0,0,33,26,-16,67,1,0,28,29,-21,69,0,-2,28,27,-20,68,-2,-3,32,27,-18,65,0,-2,33,28,-18,66,2,-1,27,27,-21,69,-3,0,27,28,-21,70,-1,-1,28,26,-19,69,-2,0,29,27,-19,70,-1,1,28,26,-19,72,-2,0,27,25,-19,71,-4,1,26,27,-21,71,-3,0,26,26,-21,70,-4,0,26,26,-20,71,-4,1,26,27,-21,72,-3,0,27,25,-19,71,-4,1,28,26,-19,72,-3,2,27,25,-19,73,-4,1,27,24,-18,72,-5,3,26,25,-20,74,-4,2,26,24,-20,73,-5,0,25,25,-19,72,-6,0,25,26,-19,73,-5,0,26,25,-18,72,-6,0,26,26,-18,72,-5,-1,27,27,-18,71,-4,-2,27,26,-18,70,-5,-1,26,27,-20,71,-4,-2,25,26,-20,70,-5,-3,26,26,-20,69,-5,-2,26,28,-20,71,-3,-2,27,26,-18,70,-5,-1,27,27,-18,71,-3,-2,29,27,-18,70,-2,-3,28,26,-18,68,-3,-3,28,28,-20,69,-2,-4,27,27,-19,68,-4,-4,33,27,-18,66,1,-5,32,25,-17,65,0,-4,28,27,-19,67,-3,-3,29,28,-19,69,-1,-2,33,26,-16,67,0,-3,32,24,-15,65,0,-3,28,26,-18,68,-3,-2,29,27,-18,69,-2,-3,26,26,-20,70,-5,-2,27,26,-18,70,-5,-1,27,27,-18,71,-3,-1,26,28,-20,71,-4,-4,28,27,-19,68,-3,-3,28,26,-18,68,-3,-2,29,27,-18,69,-2,-3,28,28,-20,69,-2,0,28,29,-21,69,-1,0,29,28,-19,70,-1,-1,28,26,-19,69,-2,-2,27,27,-21,68,-2,1,26,27,-21,72,-3,1,28,26,-19,72,-2,0,27,25,-19,71,-4,0,26,26,-21,71,-4,1,29,27,-21,69,0,1,30,26,-20,69,0,3,31,27,-20,70,1,2,30,28,-21,70,1,3,28,25,-21,71,-1,3,29,25,-20,71,-1,4,30,26,-20,72,0,4,28,26,-22,72,0,4,33,28,-20,70,3,4,34,27,-19,70,3,3,33,26,-19,69,2,3,32,27,-20,69,2,6,32,26,-20,71,2,5,33,26,-19,71,2,4,32,26,-19,71,1,5,31,26,-20,71,1,-5,36,22,-14,61,0,-3,36,24,-13,64,0,-1,37,23,-11,63,-1,-3,37,21,-13,60,-1,-3,33,21,-15,63,-3,-2,34,23,-14,64,-2,-1,35,22,-12,64,-3,-2,34,20,-13,62,-4,-1,39,24,-11,65,3,-4,37,27,-15,63,2,-4,42,22,-9,59,2,-6,41,24,-11,60,3,-3,36,20,-13,61,-3,-4,35,22,-15,62,-1,-1,36,22,-11,63,-2,-2,35,24,-13,64,0,-2,33,20,-13,63,-5,-3,32,21,-15,64,-4,0,34,22,-12,64,-3,-2,33,23,-14,65,-2,0,31,22,-13,67,-3,0,31,21,-12,67,-4,-1,30,21,-14,67,-5,0,31,20,-13,66,-5,-4,35,22,-15,61,-1,-3,35,24,-13,64,0,-1,37,22,-11,63,-1,-3,36,20,-13,61,-2,0,34,22,-12,64,-3,-2,34,20,-13,63,-4,-2,33,23,-14,65,-2,-3,33,21,-15,64,-3,-5,39,26,-12,62,3,2,60,-13,-14,55,-16,0,63,-16,-13,60,-18,2,56,-9,-13,50,-12,-5,52,-10,-7,63,-18,0,56,-11,-13,56,-12,5,60,-15,-17,61,-16,-1,58,-6,-11,57,-7,2,65,-6,-14,66,-6,4,58,-15,-16,59,-15,1,62,-6,-13,62,-6,-1,56,-8,-11,55,-9,4,66,-11,-15,66,-11] }, + { "name": "animation_000014", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,-6,66,-8,-16,64,-6,-5,74,3,-16,72,5,-9,77,-14,-19,74,-13,-8,84,-1,-18,81,0,-4,70,-2,-17,68,0,-7,82,-9,-21,79,-7,-6,64,2,-12,63,2,-7,67,9,-10,67,9,-5,79,1,-18,76,3,-7,72,-13,-19,70,-11,-5,77,-6,-21,73,-4,-10,75,8,-11,64,-8,-14,84,0,-14,76,-15,-11,69,-1,-15,83,-9,-9,63,2,-9,67,9,-12,79,4,-13,70,-14,-5,77,1,-17,74,3,-6,69,-11,-18,66,-9,-4,73,-4,-19,70,-1,-11,77,5,-12,66,-11,15,44,12,-28,37,9,14,48,10,-30,40,7,11,51,9,-29,45,5,7,51,9,-26,47,6,4,48,10,-22,46,8,5,44,12,-21,43,11,8,41,14,-22,38,12,12,41,14,-25,36,11,13,27,-22,-10,25,-23,12,32,-26,-11,29,-26,8,36,-26,-11,35,-26,3,38,-23,-9,39,-23,0,36,-18,-6,39,-18,1,30,-15,-4,34,-14,6,25,-14,-5,27,-14,10,25,-18,-7,24,-18,14,38,-14,-18,33,-16,14,33,-12,-16,29,-13,10,41,-15,-17,38,-16,4,42,-15,-13,41,-16,1,38,-13,-9,41,-13,2,33,-11,-7,36,-10,6,29,-10,-8,30,-9,11,29,-10,-12,27,-11,14,43,-2,-24,37,-5,15,39,0,-22,33,-3,10,46,-3,-23,42,-6,5,46,-3,-19,44,-5,2,43,-2,-15,44,-3,3,38,0,-13,40,0,7,35,0,-14,35,0,12,35,0,-18,32,0,28,14,15,-31,10,31,29,15,18,-33,13,32,29,16,22,-34,15,35,26,15,24,-32,17,37,23,14,23,-29,17,37,22,12,20,-26,14,36,23,11,16,-25,12,33,25,12,14,-27,10,31,14,45,7,-27,35,7,16,47,11,-31,38,9,15,47,16,-32,41,13,11,46,19,-29,43,15,8,44,18,-25,43,16,6,42,13,-21,40,13,7,41,9,-20,37,10,10,42,6,-23,35,7,20,38,12,-32,30,15,18,36,8,-28,27,12,19,38,17,-33,33,19,16,37,20,-30,36,22,12,35,19,-25,35,22,10,33,15,-22,33,20,11,32,9,-21,29,16,14,33,7,-24,27,13,23,31,13,-32,24,20,21,29,9,-29,22,17,22,31,18,-33,27,23,19,30,21,-30,29,26,15,28,20,-26,29,26,13,26,16,-22,27,24,14,26,11,-22,24,21,18,27,8,-24,21,18,26,23,16,-33,18,27,25,21,13,-30,16,25,26,23,20,-33,21,30,23,22,22,-31,23,32,20,20,21,-27,22,32,18,19,18,-24,20,30,19,18,14,-24,17,27,22,19,12,-26,16,25,11,47,19,-28,42,15,12,51,15,-31,44,11,6,51,15,-27,48,12,6,45,16,-23,43,14,11,42,16,-24,37,13,15,46,14,-30,38,11,8,52,10,-27,47,7,4,48,11,-22,46,9,7,42,11,-21,40,9,12,43,10,-25,37,7,13,48,9,-29,41,5,8,46,7,-24,43,4,12,50,17,-31,43,14,8,49,18,-28,45,15,9,52,15,-30,47,12,13,46,17,-30,39,14,14,49,15,-31,41,11,8,46,18,-25,42,16,6,48,17,-25,46,14,11,44,18,-27,39,15,8,43,17,-23,40,14,13,43,15,-27,37,12,15,47,12,-30,39,8,12,50,12,-30,43,8,10,52,12,-30,46,8,7,52,13,-27,48,10,5,50,13,-24,47,11,5,47,14,-23,45,11,6,43,14,-21,42,12,8,41,13,-22,38,11,12,41,13,-25,36,10,15,44,12,-28,37,8,11,51,9,-29,44,5,6,50,10,-25,47,7,4,44,11,-20,43,9,9,42,10,-22,38,7,13,45,9,-27,39,5,11,48,7,-26,42,4,8,49,7,-25,45,5,6,47,8,-22,45,6,7,44,8,-21,41,6,10,44,7,-24,39,5,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-32,-9,36,-32,10,38,-27,-10,35,-26,8,36,-21,-7,34,-20,0,34,-18,0,38,-34,5,52,-31,-9,50,-30,8,51,-25,-11,49,-24,5,50,-19,-7,48,-19,-1,49,-17,-2,51,-32,9,45,-25,-10,42,-25,7,46,-31,-9,44,-31,6,43,-19,-7,41,-19,0,42,-17,-1,45,-33,4,56,-28,-10,51,-29,8,51,-25,-10,45,-27,6,45,-24,-6,41,-25,0,41,-23,-2,55,-29,3,60,-22,-11,55,-24,7,56,-17,-14,50,-19,5,51,-12,-10,46,-14,-2,48,-12,-4,59,-25,8,53,-21,-12,47,-23,4,58,-25,-10,53,-27,5,49,-16,-8,44,-18,-1,45,-16,-3,57,-27,3,60,-22,-11,55,-24,7,56,-17,-14,50,-19,5,51,-12,-10,47,-14,-2,48,-12,-4,59,-24,-2,67,-10,-13,64,-11,0,64,-9,-14,60,-10,-1,60,-8,-10,57,-9,-5,57,-8,-8,67,-11,-4,66,-9,-10,64,-11,-2,63,-8,-11,61,-10,-2,60,-8,-9,58,-9,-5,58,-8,-8,67,-10,-6,66,-5,-11,65,-6,-5,64,-4,-11,62,-5,-5,61,-3,-9,60,-4,-7,59,-4,-9,67,-5,-6,66,-5,-11,64,-6,-5,64,-3,-11,62,-4,-5,62,-1,-10,60,-2,-7,60,-1,-9,66,-6,-7,69,-4,-12,67,-5,-5,66,-2,-12,64,-3,-6,63,0,-11,61,-1,-8,61,0,-10,69,-5,13,58,-6,-19,58,-9,11,55,-6,-17,57,-8,9,55,-6,-15,58,-6,6,57,-6,-16,60,-4,6,59,-5,-17,62,-4,8,62,-5,-19,63,-5,10,62,-5,-21,62,-7,12,60,-5,-21,60,-9,13,53,12,-29,47,2,12,51,11,-27,47,3,9,51,11,-26,47,5,8,52,12,-26,49,6,7,54,12,-28,51,7,9,56,13,-29,51,6,11,56,13,-31,51,4,13,55,12,-31,49,3,12,52,5,-23,50,0,13,54,5,-25,51,-1,9,52,5,-22,51,1,7,53,5,-22,53,3,6,56,6,-23,55,3,8,58,6,-26,56,2,11,58,6,-27,55,0,13,57,6,-27,53,-1,11,54,0,-20,53,-4,13,56,0,-23,54,-5,9,53,0,-19,54,-2,7,55,0,-19,56,0,6,57,0,-21,58,0,8,59,1,-23,59,-1,10,60,1,-24,58,-3,13,58,0,-24,56,-5,11,55,-3,-19,55,-6,13,57,-3,-21,56,-7,9,54,-3,-17,56,-4,7,56,-3,-17,58,-2,6,58,-2,-19,60,-2,8,60,-2,-21,61,-3,10,61,-2,-23,60,-5,13,59,-2,-23,58,-7,0,46,26,-16,50,17,-1,46,25,-16,51,17,-2,45,24,-15,51,15,-1,44,23,-14,50,14,0,43,23,-14,49,14,0,43,24,-15,48,15,1,43,26,-16,47,16,0,45,26,-16,48,17,11,56,15,-32,48,7,9,56,14,-32,50,6,9,55,12,-30,51,4,9,53,12,-29,49,3,11,51,11,-29,47,3,12,51,13,-30,45,4,13,52,14,-31,45,5,13,54,15,-32,46,7,1,48,22,-20,51,14,2,48,23,-21,49,15,0,47,21,-19,51,12,1,46,20,-18,50,11,2,45,20,-18,48,11,4,45,21,-19,47,12,4,46,23,-20,46,13,4,47,24,-21,47,15,7,54,16,-29,51,8,9,54,17,-29,49,9,6,53,14,-27,51,6,7,51,13,-26,49,5,9,49,13,-26,47,4,10,49,15,-27,45,5,11,50,16,-28,45,7,10,52,18,-29,47,9,8,55,15,-31,51,7,10,55,16,-32,49,8,7,54,13,-29,51,5,8,52,12,-28,49,4,10,50,12,-28,47,3,12,50,13,-29,45,4,13,52,15,-31,45,6,12,54,16,-32,46,7,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,11,60,-10,-21,62,-10,9,56,-8,-19,58,-9,-2,56,-12,-8,56,-12,2,62,-18,-11,63,-18,10,63,-4,-19,64,-4,8,57,-3,-18,58,-3,-3,57,-8,-6,56,-9,2,66,-8,-10,66,-8,5,55,-10,-15,56,-11,9,58,-14,-19,60,-14,4,59,-4,-14,59,-4,6,64,-5,-15,65,-5,10,57,-10,-20,59,-11,1,60,-17,-10,60,-17,9,60,-2,-19,61,-2,4,60,-10,-13,61,-11,8,55,-13,-18,57,-14,4,61,-3,-14,62,-4,7,56,-6,-18,57,-7,11,62,-7,-20,64,-8,-3,56,-9,-6,55,-10,2,66,-12,-11,66,-12,3,55,-7,-13,55,-7,7,65,-10,-16,66,-11,7,55,-9,-17,57,-10,10,59,-12,-20,61,-12,6,58,-3,-16,59,-3,8,64,-4,-17,65,-5,9,56,-11,-19,58,-12,7,61,-2,-16,61,-3,5,55,-6,-16,56,-7,9,64,-9,-18,65,-9,-2,33,28,-10,59,14,-4,32,26,-10,58,11,-2,39,24,-10,51,15,0,39,26,-11,52,17,-5,34,30,-13,59,12,-6,33,27,-12,57,10,-5,40,26,-13,51,13,-4,41,28,-15,52,15,-3,41,29,-15,53,17,-4,41,28,-14,51,15,-5,33,29,-13,58,11,-3,33,31,-14,59,13,0,40,27,-11,54,19,-1,40,25,-11,52,16,-2,33,27,-10,58,12,0,33,29,-11,59,14,1,34,29,-12,60,15,0,33,28,-11,59,13,0,40,26,-10,53,18,1,41,27,-12,54,19,0,34,31,-15,60,15,-2,33,30,-14,58,12,-3,41,29,-15,52,16,-1,41,30,-15,53,18,0,42,30,-15,54,20,-2,41,30,-15,52,18,0,34,30,-16,58,14,1,35,31,-16,59,16,1,42,28,-13,54,20,0,41,27,-12,53,19,0,34,28,-13,59,14,2,35,29,-14,59,16,1,41,29,-13,53,21,-2,40,24,-10,51,15,-2,43,23,-11,48,16,1,44,27,-13,49,21,0,42,30,-15,53,20,-5,41,25,-13,50,13,-4,43,25,-13,48,15,0,45,28,-15,49,20,-3,41,29,-15,52,16,-3,44,27,-15,48,17,0,39,26,-11,53,18,0,43,25,-11,49,19,3,32,29,-14,62,15,2,32,28,-13,62,14,0,35,29,-14,58,15,1,35,29,-14,59,16,3,32,30,-15,62,15,2,31,30,-15,62,14,0,34,30,-15,59,14,1,35,31,-16,59,16,2,31,29,-14,63,13,4,31,30,-15,63,15,2,32,29,-13,62,14,3,32,29,-14,62,15,4,32,28,-13,63,15,3,31,28,-12,63,14,4,31,29,-14,64,15,3,30,28,-13,64,14,3,30,28,-13,64,14,4,31,28,-13,65,15,3,30,29,-12,63,14,4,31,29,-12,64,15,3,33,29,-11,65,15,2,32,28,-11,65,14,4,33,28,-12,66,15,3,32,27,-11,65,14,2,30,26,-9,66,11,3,30,27,-10,67,12,1,30,27,-9,65,12,2,31,28,-9,65,13,2,29,29,-11,65,13,1,29,28,-11,64,12,3,29,28,-12,66,12,2,28,27,-11,65,11,1,28,28,-12,65,11,2,28,29,-12,65,12,1,29,27,-11,64,12,2,30,28,-11,64,13,1,31,30,-13,63,13,0,30,29,-12,62,12,1,29,30,-14,64,12,0,29,29,-13,64,11,0,33,31,-15,60,14,-2,33,30,-14,59,13,0,29,30,-14,63,11,1,30,31,-14,64,13,0,34,29,-12,60,15,0,34,28,-12,59,13,0,30,28,-12,63,12,2,30,29,-13,64,13,0,29,29,-11,63,11,-1,28,28,-11,63,9,-2,33,27,-11,58,12,-1,34,29,-11,59,14,-1,29,31,-13,63,10,-3,28,29,-12,62,9,-4,33,29,-13,58,11,-3,33,31,-14,59,13,-2,27,29,-12,63,8,-1,28,30,-13,64,10,-2,29,28,-11,63,9,-1,29,30,-11,64,11,0,29,28,-11,66,10,0,29,27,-10,65,9,0,27,29,-12,66,9,0,27,28,-11,65,8,0,27,27,-11,66,8,1,28,28,-12,67,9,0,28,27,-10,65,9,0,29,29,-10,66,10,1,30,27,-9,68,9,0,30,26,-9,67,8,1,29,26,-10,68,8,0,29,25,-10,68,7,-1,27,26,-11,66,6,0,28,27,-11,67,7,-1,28,26,-10,66,7,-1,29,27,-10,66,8,-2,29,28,-11,65,9,-3,28,27,-10,64,7,-1,27,28,-12,65,8,-2,27,27,-11,64,7,-3,27,28,-12,64,7,-2,27,29,-12,65,8,-3,28,27,-10,64,8,-2,29,28,-11,64,9,-3,29,29,-11,63,10,-4,29,28,-10,62,8,-3,28,30,-12,63,9,-4,27,29,-12,62,8,-5,33,30,-13,59,12,-6,33,28,-12,57,10,-5,29,29,-12,61,8,-4,29,30,-13,62,10,-3,33,28,-11,59,13,-4,33,26,-10,58,11,-4,29,28,-10,62,9,-3,29,29,-11,63,10,-3,27,28,-12,64,7,-3,28,27,-10,64,7,-2,29,28,-11,65,9,-2,27,29,-12,65,8,-5,28,29,-12,62,8,-4,29,28,-10,62,8,-3,29,29,-11,63,10,-4,28,30,-13,63,9,-1,28,31,-13,64,10,-1,29,30,-11,64,11,-2,29,28,-11,63,9,-2,28,29,-12,63,9,0,27,28,-12,66,9,0,29,28,-10,66,10,0,28,27,-10,65,9,0,27,27,-11,65,8,0,29,30,-14,63,11,0,30,29,-12,63,12,1,30,30,-13,63,13,1,29,31,-14,64,12,2,28,28,-12,65,11,1,29,28,-11,64,12,2,29,29,-11,64,13,3,28,29,-12,66,12,3,32,30,-15,63,15,3,32,29,-14,62,15,2,32,29,-13,62,14,2,31,30,-14,62,13,5,31,28,-13,64,15,4,31,29,-13,63,15,3,31,28,-12,63,14,3,30,28,-13,64,14,-4,35,24,-12,53,10,-3,35,26,-10,55,12,-1,36,24,-8,53,11,-3,36,22,-10,52,9,-4,32,24,-10,56,8,-3,33,25,-9,56,10,-1,33,24,-7,54,10,-2,33,22,-8,54,8,0,38,26,-10,53,16,-4,37,28,-13,55,13,-2,41,23,-11,48,13,-4,41,24,-13,50,14,-3,34,22,-9,53,8,-4,34,24,-11,54,9,-1,35,24,-8,53,11,-3,34,26,-10,55,11,-2,32,22,-7,55,8,-4,31,24,-9,57,8,-1,32,24,-7,55,10,-2,32,25,-9,56,10,-2,29,25,-6,58,10,0,30,24,-6,57,10,-2,29,24,-6,58,9,-1,29,23,-5,57,9,-4,35,24,-11,54,9,-3,35,26,-10,55,12,-1,35,24,-8,53,11,-3,35,22,-10,52,9,-1,33,24,-7,54,10,-2,32,22,-8,55,8,-2,32,25,-9,56,10,-4,32,24,-9,56,8,-4,39,26,-12,52,14,3,60,-13,-13,55,-15,0,63,-16,-12,60,-17,4,55,-9,-12,50,-11,-3,52,-10,-6,63,-18,1,55,-11,-11,56,-12,6,60,-16,-15,62,-16,0,57,-6,-10,57,-6,4,65,-6,-13,66,-6,5,58,-15,-14,59,-16,3,61,-6,-12,62,-6,0,55,-8,-10,55,-9,5,65,-11,-13,66,-12] }, + { "name": "animation_000015", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,0,65,-5,-10,63,-2,2,70,7,-8,69,10,-3,76,-9,-13,75,-6,0,81,4,-10,79,6,2,67,0,-10,66,4,0,81,-3,-13,79,0,0,60,4,-5,60,5,0,63,11,-2,62,12,2,75,5,-10,74,9,-2,72,-9,-13,70,-6,1,75,-2,-13,73,1,-1,70,13,-6,63,-5,-4,82,6,-9,77,-9,-4,67,2,-7,82,-2,-2,60,4,0,62,12,-3,75,9,-8,70,-9,2,73,5,-9,72,9,-1,68,-8,-12,66,-4,2,71,-1,-12,69,3,-2,73,10,-7,66,-7,25,45,8,-31,35,7,25,49,6,-33,38,5,23,53,4,-32,43,3,19,54,5,-30,46,4,16,52,7,-26,46,7,16,49,10,-24,42,9,18,45,11,-25,38,11,22,43,11,-27,35,10,12,26,-22,-9,24,-23,12,30,-26,-11,28,-26,10,36,-27,-11,34,-27,6,39,-23,-10,39,-23,3,39,-18,-7,40,-18,3,33,-14,-5,35,-14,6,27,-13,-5,28,-13,9,25,-17,-6,25,-17,17,37,-16,-19,32,-16,16,32,-13,-16,28,-14,14,41,-17,-18,37,-17,9,43,-16,-15,41,-17,6,41,-14,-11,41,-14,5,36,-11,-8,37,-11,8,31,-9,-8,31,-9,13,30,-11,-12,27,-11,21,43,-6,-25,35,-6,21,38,-3,-23,31,-4,18,47,-6,-25,40,-7,14,48,-6,-22,43,-6,11,47,-4,-19,44,-4,10,43,-1,-16,40,-1,13,38,0,-16,35,0,17,36,-1,-19,31,-1,28,13,15,-30,10,31,30,14,17,-33,12,32,30,15,21,-34,15,35,28,16,23,-33,17,37,25,15,23,-29,17,37,23,14,20,-26,15,36,22,12,17,-25,12,33,25,12,15,-27,10,31,23,45,3,-30,34,5,26,47,7,-34,36,7,27,48,11,-35,39,11,24,49,15,-33,42,13,19,48,14,-29,42,14,16,47,11,-24,40,12,16,45,6,-23,37,9,19,45,3,-25,34,6,28,37,9,-34,28,14,25,36,5,-29,26,12,28,39,14,-35,32,17,25,39,17,-33,34,20,20,38,17,-28,35,21,17,37,13,-24,33,19,17,35,8,-23,29,15,20,35,5,-25,26,12,29,30,11,-33,23,19,26,29,7,-29,21,17,29,31,15,-35,26,22,26,32,18,-33,29,25,21,31,18,-28,29,26,18,30,15,-24,27,24,18,28,10,-23,24,20,21,28,7,-25,21,17,29,22,14,-33,17,26,27,20,11,-30,15,25,29,23,18,-34,20,29,27,23,21,-32,22,31,23,23,21,-29,22,32,21,21,18,-26,21,30,21,20,14,-24,18,27,23,20,11,-26,16,25,23,50,15,-32,40,14,25,53,10,-35,42,9,20,55,11,-31,46,10,17,50,13,-27,43,13,21,45,12,-27,37,12,26,47,10,-33,36,9,21,54,5,-31,45,5,16,52,8,-26,46,7,16,46,8,-24,40,8,22,44,6,-27,36,5,24,49,4,-32,39,4,19,49,3,-27,41,3,25,52,13,-34,41,12,22,53,14,-32,43,13,23,55,10,-34,45,9,25,48,13,-33,38,12,26,50,10,-35,39,9,20,50,15,-29,41,14,19,53,13,-29,45,12,22,47,14,-30,38,14,19,47,14,-26,39,13,24,45,12,-30,36,11,26,48,7,-33,37,6,24,51,7,-33,41,6,24,54,7,-34,44,6,21,55,8,-32,46,8,18,54,10,-29,46,9,17,51,10,-27,44,10,17,48,11,-25,41,10,18,45,11,-25,38,10,21,44,9,-27,35,9,25,45,8,-30,35,7,23,52,4,-32,42,3,18,54,6,-29,46,5,15,49,8,-24,43,7,19,44,7,-25,37,6,23,46,5,-30,37,4,22,49,3,-29,40,2,20,52,3,-29,44,3,17,51,5,-26,44,4,17,47,5,-24,41,5,20,46,4,-27,38,3,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,39,-33,-9,37,-31,11,37,-28,-10,35,-25,9,35,-22,-6,34,-20,1,34,-18,0,38,-34,6,52,-31,-9,50,-29,9,51,-25,-10,49,-23,6,50,-19,-6,48,-17,0,49,-16,-1,51,-31,9,44,-26,-9,42,-24,7,46,-32,-9,44,-30,7,43,-20,-6,41,-18,0,41,-17,-1,45,-32,4,56,-28,-9,51,-27,9,51,-27,-9,45,-25,8,45,-25,-4,41,-24,2,41,-24,-2,55,-28,4,59,-22,-10,54,-20,9,56,-18,-11,49,-16,9,51,-13,-6,45,-12,1,47,-12,-3,58,-23,9,53,-22,-10,46,-20,4,58,-25,-9,52,-24,8,48,-18,-5,43,-16,2,44,-17,-3,57,-25,4,60,-22,-10,54,-21,9,56,-18,-11,49,-16,9,51,-13,-6,45,-12,1,47,-12,-3,58,-23,1,66,-8,-8,62,-7,4,63,-8,-9,58,-6,3,59,-8,-5,55,-7,0,56,-7,-4,65,-8,0,65,-7,-6,63,-7,2,62,-7,-7,59,-7,1,58,-7,-4,56,-7,0,56,-7,-4,65,-7,-1,65,-2,-5,63,-2,0,62,-2,-5,60,-2,0,59,-2,-4,58,-2,-1,57,-2,-3,65,-2,-1,64,-2,-5,62,-2,0,62,-1,-5,60,-1,0,60,0,-4,58,0,-1,58,0,-3,64,-3,-1,67,-1,-6,65,-1,0,64,0,-6,62,0,0,61,0,-4,59,0,-1,59,1,-4,67,-1,18,57,-9,-15,57,-9,16,55,-8,-14,55,-8,14,54,-7,-12,55,-6,12,56,-7,-12,57,-4,11,59,-6,-13,59,-3,13,61,-7,-15,61,-4,15,61,-8,-16,61,-6,17,59,-8,-16,59,-8,23,56,9,-30,48,0,22,54,9,-28,47,0,20,54,10,-27,47,2,18,55,11,-27,48,4,18,57,11,-28,50,4,19,59,10,-29,51,3,21,59,10,-30,51,2,23,58,9,-31,50,0,20,54,3,-23,49,-2,22,56,2,-24,51,-3,18,53,3,-21,49,0,15,55,4,-21,51,1,15,57,4,-22,53,2,17,59,4,-24,55,1,19,60,3,-25,55,-1,21,58,2,-25,53,-3,18,54,-2,-19,52,-5,20,56,-2,-20,54,-6,16,54,-1,-17,52,-2,14,55,0,-17,53,0,13,58,0,-18,56,0,15,60,0,-20,58,-1,17,60,-1,-21,58,-3,19,59,-2,-21,56,-5,17,54,-5,-16,53,-6,19,56,-5,-18,55,-7,15,54,-4,-15,53,-4,13,56,-3,-14,55,-2,12,58,-3,-15,58,-1,14,60,-4,-17,59,-2,16,61,-4,-18,59,-5,18,59,-5,-19,58,-7,12,50,26,-24,42,18,11,50,25,-23,43,18,10,49,24,-21,43,17,10,48,23,-21,42,16,11,47,23,-21,40,16,13,47,24,-23,40,16,14,48,25,-24,40,17,13,49,26,-25,40,18,23,59,12,-33,50,3,21,59,11,-31,51,3,20,58,10,-29,51,2,20,56,9,-28,49,1,22,54,9,-29,48,0,24,55,10,-31,47,0,24,56,12,-32,47,1,24,58,13,-34,48,3,13,53,21,-25,45,14,15,53,22,-27,44,14,13,52,20,-23,45,13,13,50,19,-23,44,12,14,49,19,-23,42,12,16,49,20,-25,41,12,17,50,22,-26,41,13,16,52,22,-27,42,14,18,58,14,-30,50,6,20,58,15,-31,49,6,17,57,12,-28,50,5,18,54,11,-26,48,4,20,52,11,-27,46,3,22,52,13,-29,44,3,23,54,14,-31,45,4,22,56,15,-32,46,5,20,59,12,-31,51,4,22,59,13,-33,50,4,19,57,11,-28,51,4,19,55,10,-28,49,2,21,54,10,-28,47,1,23,54,11,-30,46,1,24,56,12,-32,47,2,24,58,13,-33,48,3,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,15,60,-12,-16,60,-10,13,55,-11,-14,56,-9,1,55,-11,-3,54,-11,5,62,-17,-6,62,-16,15,62,-6,-15,62,-4,14,56,-5,-14,56,-3,1,56,-7,-2,55,-7,6,65,-7,-6,64,-6,9,54,-11,-10,54,-10,12,58,-15,-14,58,-14,9,57,-5,-10,57,-3,11,63,-6,-11,63,-4,14,57,-12,-15,57,-10,4,59,-17,-5,59,-16,15,59,-4,-15,59,-2,8,59,-11,-9,59,-10,11,55,-15,-13,55,-13,10,60,-4,-10,60,-3,13,55,-8,-13,55,-6,15,62,-9,-16,62,-7,1,55,-8,-2,54,-8,6,65,-12,-6,65,-11,8,54,-8,-9,54,-6,11,64,-11,-11,64,-9,11,55,-11,-12,55,-9,14,59,-14,-15,59,-12,11,57,-4,-12,57,-2,13,63,-6,-13,63,-4,13,56,-13,-14,56,-11,12,59,-4,-12,59,-2,10,54,-8,-11,54,-6,13,63,-10,-14,63,-8,3,43,32,-23,31,25,2,42,29,-23,30,23,8,44,25,-24,36,18,9,44,28,-24,37,21,2,45,32,-20,31,24,0,45,29,-20,30,22,6,48,26,-21,36,18,7,49,28,-20,38,20,8,49,29,-20,38,22,7,48,27,-20,37,20,2,45,31,-19,31,23,3,45,33,-20,32,26,11,44,29,-25,38,22,9,45,27,-24,37,20,3,42,31,-23,30,24,5,42,33,-23,32,26,6,42,34,-22,33,27,5,41,32,-22,31,25,10,45,27,-25,37,21,11,45,29,-24,39,23,5,44,35,-20,33,27,3,44,33,-19,32,25,8,49,29,-20,39,21,9,49,30,-21,40,23,11,48,31,-22,40,24,9,49,30,-20,40,22,5,43,33,-19,33,25,8,43,35,-19,35,28,12,46,30,-24,40,24,11,46,28,-24,38,22,7,41,32,-21,33,26,8,42,34,-21,34,28,12,46,31,-24,41,23,8,45,25,-24,36,18,10,46,24,-24,39,16,13,47,28,-24,42,21,11,48,31,-22,41,24,7,48,25,-21,36,18,9,49,24,-21,39,17,13,49,28,-22,43,21,8,49,28,-20,39,21,10,50,26,-20,41,19,10,44,29,-25,38,21,12,46,26,-24,40,19,8,40,33,-21,32,29,7,39,32,-21,31,28,7,43,32,-21,33,26,8,43,33,-21,35,27,8,39,34,-20,32,30,6,39,34,-20,31,28,6,43,34,-19,33,26,7,43,35,-19,35,27,7,38,33,-20,30,29,8,38,34,-20,31,30,7,39,33,-21,31,28,8,39,33,-21,32,29,9,39,32,-22,31,30,8,38,32,-22,30,29,9,38,33,-22,31,30,7,37,32,-21,30,29,8,38,32,-22,29,30,9,38,32,-22,30,31,7,38,33,-22,30,29,8,38,33,-23,31,30,8,40,33,-24,30,30,7,40,32,-24,29,29,9,40,32,-24,29,31,8,40,31,-23,29,30,7,38,30,-26,26,28,8,38,31,-26,27,29,7,39,31,-26,27,27,7,39,32,-26,28,29,7,38,33,-24,29,29,5,38,32,-24,28,27,7,37,33,-24,27,30,6,37,32,-23,26,28,6,37,32,-23,27,28,7,37,33,-23,28,30,6,38,31,-23,28,27,7,38,33,-24,29,29,6,40,34,-22,30,28,5,40,32,-22,29,27,6,38,35,-21,29,29,4,38,33,-21,28,28,5,43,34,-20,33,27,4,43,33,-20,32,25,4,39,34,-20,28,28,5,39,35,-21,29,29,6,43,33,-22,33,26,5,43,32,-22,32,25,5,39,32,-22,28,27,7,39,34,-22,29,29,5,40,32,-23,27,27,4,39,31,-23,27,26,3,44,30,-22,31,23,4,45,32,-22,32,25,4,39,33,-21,27,28,2,39,32,-21,26,26,1,44,32,-19,30,24,2,44,33,-20,31,25,3,38,31,-21,25,26,4,39,33,-21,26,28,3,40,31,-23,26,26,4,40,33,-23,27,27,5,41,31,-24,25,28,4,41,30,-24,25,27,6,39,31,-23,25,29,5,39,30,-22,24,27,5,40,29,-23,23,27,6,40,31,-23,24,29,4,40,30,-24,24,27,5,40,32,-24,25,28,5,42,31,-25,24,29,4,42,30,-25,23,28,6,42,30,-25,23,29,5,42,29,-25,22,28,4,42,28,-23,22,27,5,42,29,-23,22,28,3,42,29,-24,22,27,4,42,29,-24,23,28,4,41,31,-23,24,27,3,40,29,-23,24,26,5,40,30,-22,24,28,4,40,29,-22,23,26,3,39,29,-22,24,26,4,40,31,-22,24,27,3,41,29,-23,24,25,4,41,30,-23,25,27,2,41,32,-23,26,26,1,41,30,-23,26,25,3,39,32,-21,26,27,2,39,30,-21,25,25,1,45,32,-20,31,25,0,44,30,-20,30,22,1,40,31,-21,26,25,2,40,32,-21,27,26,3,45,30,-22,31,24,1,44,29,-22,30,22,2,40,30,-23,26,24,3,40,31,-23,27,26,3,39,29,-22,23,26,3,40,29,-23,24,26,4,41,30,-23,25,27,4,40,30,-22,24,27,1,39,31,-21,26,25,2,40,30,-23,26,24,3,40,32,-23,27,26,2,40,32,-21,26,27,4,39,33,-21,27,28,4,40,33,-23,27,27,3,40,31,-23,26,26,3,39,32,-21,26,26,6,40,31,-23,24,29,5,40,31,-24,25,28,4,40,30,-24,24,27,5,39,30,-23,24,27,4,39,33,-21,28,28,5,39,32,-22,29,27,6,39,34,-22,30,29,5,39,35,-21,29,29,6,37,32,-23,27,28,6,38,32,-24,28,27,7,38,33,-24,29,29,7,37,33,-23,27,30,8,39,34,-20,32,30,8,39,33,-21,32,29,7,39,33,-21,31,28,6,39,34,-20,31,29,9,37,33,-22,30,30,9,38,33,-22,31,30,7,38,32,-22,30,29,8,37,32,-22,29,30,3,43,26,-20,32,18,4,43,28,-23,32,20,6,42,27,-24,32,18,5,42,25,-21,31,16,2,41,27,-21,28,19,3,41,29,-23,30,20,4,40,28,-24,30,18,3,39,26,-22,28,17,8,44,28,-25,36,21,4,46,29,-21,34,22,9,45,24,-22,37,16,7,47,24,-21,37,18,4,41,26,-22,30,17,3,42,26,-21,30,19,5,41,28,-24,31,18,4,43,29,-23,31,20,3,39,27,-23,27,18,1,40,28,-22,28,20,4,39,29,-24,29,18,3,41,29,-23,29,20,1,38,31,-25,28,21,2,38,30,-26,28,20,0,38,30,-25,26,21,1,37,29,-26,26,20,3,43,26,-20,31,19,4,43,28,-23,32,20,6,41,28,-24,31,18,4,41,25,-21,31,17,4,40,29,-24,29,18,3,39,27,-23,28,18,3,41,29,-23,30,20,1,40,27,-22,28,20,6,47,27,-22,36,20,6,60,-13,-10,53,-11,2,63,-15,-9,58,-14,8,55,-10,-7,49,-8,0,51,-9,-3,62,-15,5,55,-11,-6,54,-10,8,60,-16,-10,60,-15,5,56,-6,-6,56,-5,9,64,-7,-8,64,-5,8,57,-16,-9,57,-14,8,60,-6,-8,60,-5,4,54,-8,-5,54,-7,8,65,-12,-9,65,-10] }, + { "name": "animation_000016", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,64,-5,-8,64,-2,6,69,6,-4,70,10,1,76,-10,-9,76,-7,5,80,3,-4,81,6,5,66,0,-7,67,4,4,80,-4,-8,80,0,2,60,4,-3,60,6,3,63,11,0,63,12,7,75,5,-5,75,9,1,71,-10,-9,71,-6,6,74,-3,-9,74,1,2,71,12,-3,64,-5,0,82,5,-4,77,-10,0,67,2,-2,83,-3,0,60,5,1,63,12,1,76,9,-4,70,-10,6,73,5,-5,73,8,2,67,-8,-9,67,-4,6,70,-1,-8,71,3,1,74,9,-4,66,-7,28,45,7,-31,35,7,29,48,4,-33,38,5,27,52,3,-32,43,3,23,54,3,-30,46,4,20,53,6,-26,46,7,19,49,8,-24,42,9,21,45,10,-25,38,10,25,43,9,-27,35,10,11,25,-22,-9,24,-23,11,30,-26,-11,28,-26,10,35,-27,-11,34,-27,7,39,-24,-10,39,-23,4,39,-19,-7,40,-18,4,34,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-6,25,-17,18,36,-17,-19,32,-16,16,31,-14,-16,28,-14,16,41,-18,-18,37,-17,11,43,-17,-15,41,-17,7,42,-14,-11,41,-14,6,37,-11,-8,37,-11,9,32,-9,-8,31,-9,13,30,-11,-12,27,-11,23,42,-7,-25,35,-6,22,38,-4,-23,31,-4,21,46,-8,-25,40,-7,17,48,-7,-22,43,-6,13,48,-5,-19,44,-4,12,43,-2,-16,40,-1,14,39,0,-16,35,0,19,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,20,-34,15,35,29,16,23,-33,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-30,34,5,30,46,5,-34,36,7,30,48,10,-35,39,11,27,49,13,-33,42,13,23,48,13,-29,42,14,19,47,10,-24,40,12,19,45,5,-23,37,9,22,44,2,-25,34,6,30,36,7,-34,28,14,26,35,4,-29,26,12,31,38,12,-35,32,17,28,39,16,-33,34,20,23,39,16,-28,35,21,20,37,12,-24,33,19,19,36,7,-23,29,15,22,35,4,-25,26,12,30,29,10,-33,23,19,27,28,6,-29,21,17,31,31,14,-35,26,22,28,32,17,-33,29,25,23,32,18,-28,29,26,20,30,14,-24,27,24,20,29,10,-23,24,20,22,28,7,-25,21,17,30,21,14,-33,17,26,27,20,11,-30,15,25,31,22,17,-34,20,29,28,23,20,-33,22,31,25,23,20,-29,22,32,22,22,18,-26,21,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-32,40,14,29,52,8,-35,42,9,24,55,9,-31,46,10,21,50,12,-27,43,13,24,45,11,-27,37,12,29,46,8,-33,36,9,25,54,4,-31,45,5,20,53,6,-26,46,7,20,46,7,-24,40,8,24,44,5,-27,36,5,28,49,3,-32,39,4,22,49,2,-27,41,3,29,52,11,-34,41,12,26,53,12,-32,43,13,27,55,8,-34,45,9,29,48,11,-33,38,12,30,49,8,-35,39,9,24,50,13,-29,41,14,23,53,11,-29,45,12,26,47,13,-30,38,14,22,47,12,-27,39,13,27,45,10,-30,36,11,29,47,5,-33,37,6,28,51,5,-33,41,6,28,54,5,-34,44,6,25,55,7,-32,46,8,22,54,8,-29,46,9,21,52,9,-27,44,10,20,48,10,-25,41,10,21,45,9,-25,38,10,24,44,8,-27,35,9,28,44,6,-30,35,7,27,52,2,-32,42,3,22,54,4,-29,46,5,18,49,7,-24,43,7,22,44,6,-25,37,6,26,46,3,-30,37,4,25,49,1,-29,40,2,23,52,2,-29,44,3,20,51,3,-26,44,4,20,47,4,-24,41,5,23,46,3,-27,38,3,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-6,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,9,50,-25,-10,49,-23,6,49,-19,-6,48,-17,0,49,-16,-1,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,5,56,-29,-9,52,-26,9,50,-27,-9,45,-25,8,45,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-9,55,-20,11,55,-18,-10,49,-15,10,50,-14,-5,46,-11,2,47,-12,-2,59,-23,10,52,-22,-10,47,-19,6,57,-26,-9,53,-23,9,47,-18,-5,44,-16,2,44,-17,-2,57,-25,6,59,-22,-9,55,-20,10,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-2,59,-22,3,65,-8,-6,63,-7,7,62,-8,-8,59,-6,5,58,-8,-4,56,-6,0,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-5,59,-7,3,58,-7,-2,56,-6,0,56,-6,-1,65,-7,1,64,-2,-3,63,-2,3,62,-2,-3,60,-2,2,59,-2,-2,58,-2,0,57,-2,-1,65,-2,1,64,-2,-3,63,-2,3,62,-1,-3,60,-1,2,59,0,-2,58,0,0,58,0,-1,64,-3,1,66,-1,-3,65,-1,3,64,0,-4,62,0,2,61,0,-2,59,1,0,59,1,-1,67,-1,19,55,-9,-14,56,-8,18,53,-8,-12,55,-7,15,53,-7,-11,54,-5,13,55,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,61,-3,17,59,-8,-14,61,-5,19,57,-9,-15,59,-8,26,55,8,-29,48,0,25,53,9,-27,47,1,23,53,9,-26,47,3,21,55,10,-26,48,5,21,57,10,-27,50,5,23,58,9,-28,52,4,25,58,9,-29,52,2,26,57,8,-29,50,1,22,52,2,-22,49,-1,24,54,1,-23,51,-3,20,52,3,-20,49,0,18,54,4,-20,51,2,18,57,4,-21,53,3,20,59,3,-22,55,1,22,59,2,-24,55,0,24,57,1,-24,53,-2,20,53,-2,-18,52,-4,22,55,-3,-19,53,-5,18,52,-1,-16,52,-2,16,54,0,-16,53,0,16,57,0,-17,56,0,17,59,-1,-18,57,0,20,59,-2,-20,58,-2,22,57,-3,-20,56,-4,19,53,-5,-15,53,-6,20,55,-6,-17,55,-7,16,52,-4,-13,53,-3,15,54,-3,-13,55,-1,14,57,-3,-14,57,-1,16,59,-4,-16,59,-2,19,59,-5,-17,59,-4,20,57,-6,-17,57,-6,15,52,26,-23,41,19,14,52,25,-22,42,18,13,51,24,-20,42,18,13,49,23,-19,41,17,14,48,23,-20,40,16,15,48,24,-21,39,16,16,49,25,-23,39,17,16,51,26,-23,40,18,26,59,11,-32,50,4,24,59,10,-30,52,4,23,57,9,-28,51,3,23,55,9,-27,50,2,25,54,8,-28,48,1,26,54,9,-30,47,1,27,55,11,-31,47,2,27,57,11,-32,49,3,17,54,21,-24,45,15,18,54,22,-25,44,15,16,53,20,-22,45,14,16,51,19,-21,43,13,17,50,19,-22,42,12,19,50,20,-24,41,12,20,51,21,-25,41,13,19,52,22,-26,42,14,22,58,13,-28,50,7,24,58,14,-30,49,7,21,56,12,-26,50,6,21,54,11,-25,48,4,23,52,11,-26,46,3,25,52,12,-28,45,3,26,53,13,-30,45,5,25,56,14,-31,47,6,23,59,11,-29,51,5,25,59,12,-31,50,5,22,57,10,-27,51,4,22,55,9,-27,49,3,24,53,9,-27,47,2,26,53,10,-29,46,2,27,55,11,-31,47,2,27,57,12,-32,48,4,30,14,16,-32,14,31,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-39,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-30,2,47,25,7,31,-30,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-28,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-30,7,48,25,2,31,-30,2,48,31,6,38,-36,6,53,27,5,37,-32,6,53,36,5,34,-41,5,49,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-36,2,54,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,0,31,-30,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-30,0,47,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,31,2,38,-36,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-36,0,54,37,0,35,-41,0,50,25,2,31,-30,2,48,25,0,31,-30,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-30,0,47,25,2,31,-30,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-39,2,39,23,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-39,0,39,30,0,12,-32,0,28,17,58,-12,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,17,60,-6,-14,62,-3,15,54,-5,-12,55,-2,2,55,-7,0,55,-7,9,64,-7,-5,64,-6,10,53,-11,-9,54,-9,14,56,-16,-13,58,-13,11,56,-5,-8,57,-3,13,62,-6,-9,63,-4,16,55,-12,-14,57,-9,5,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,54,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-12,55,-5,17,60,-10,-14,62,-6,2,54,-8,0,54,-8,8,64,-12,-5,65,-11,9,53,-8,-7,53,-6,13,63,-12,-10,64,-9,13,53,-11,-11,55,-9,15,57,-14,-14,59,-11,13,55,-4,-10,56,-2,16,61,-6,-12,63,-3,14,55,-14,-13,56,-11,14,58,-4,-11,59,-1,12,53,-8,-10,54,-6,16,61,-11,-13,63,-7,11,40,29,-21,30,24,9,40,27,-21,29,22,12,46,24,-23,35,19,14,46,26,-23,37,21,8,41,30,-18,30,24,7,41,28,-19,29,22,10,47,26,-19,36,18,11,48,28,-18,37,20,12,48,29,-19,38,22,10,48,28,-19,37,20,8,41,29,-18,30,23,10,41,32,-18,31,25,16,46,27,-23,37,23,13,46,25,-23,36,20,11,39,28,-21,30,23,13,40,30,-21,31,25,14,40,30,-20,32,26,13,40,29,-20,31,25,15,46,26,-23,37,22,16,47,28,-23,38,24,13,41,32,-18,32,27,11,41,31,-17,31,24,11,48,29,-18,38,21,13,48,30,-19,39,23,15,48,31,-20,40,25,13,48,30,-19,39,22,13,41,31,-17,33,25,15,41,32,-17,34,27,17,48,29,-22,39,25,15,48,27,-23,38,23,14,40,29,-19,32,25,16,41,30,-19,33,27,17,47,29,-23,40,24,12,46,24,-23,36,18,13,49,23,-22,39,17,17,50,27,-23,42,21,15,49,31,-20,40,24,10,48,25,-19,36,18,11,50,25,-20,38,17,15,51,28,-20,42,21,11,49,29,-18,38,21,12,51,27,-19,40,19,15,46,27,-23,37,22,15,49,25,-23,40,19,17,41,28,-20,31,29,15,40,28,-19,30,27,14,42,30,-19,33,25,15,42,31,-19,34,26,17,39,29,-18,31,29,16,39,28,-18,30,28,14,40,31,-17,33,26,15,41,31,-17,34,27,16,39,28,-19,29,28,17,39,28,-19,30,29,16,40,28,-19,30,27,17,40,28,-19,31,28,17,41,27,-20,31,28,16,40,26,-20,30,27,18,39,27,-20,30,29,17,39,26,-20,29,28,17,40,26,-21,29,28,18,40,26,-21,30,29,16,39,27,-21,30,27,18,40,27,-21,31,28,17,41,28,-23,31,28,15,41,28,-22,30,27,17,42,27,-23,30,28,16,41,27,-23,30,27,15,41,26,-24,28,26,16,42,26,-24,29,27,15,41,27,-23,29,25,16,41,27,-23,29,27,16,39,28,-22,29,27,15,39,27,-21,28,26,17,40,26,-22,28,28,16,39,25,-22,27,27,16,38,26,-21,27,27,17,39,27,-22,28,28,15,40,26,-21,28,26,16,40,27,-21,29,27,15,40,29,-19,29,28,14,39,28,-19,28,26,16,38,29,-20,28,29,15,38,27,-19,27,27,13,40,32,-18,32,26,11,40,31,-18,31,25,14,38,28,-19,27,27,15,38,29,-19,28,28,13,42,31,-20,32,26,12,42,30,-20,31,24,14,39,27,-20,28,26,16,40,28,-21,28,28,14,39,28,-21,27,26,12,39,26,-21,26,25,9,42,29,-20,30,23,11,42,30,-20,31,24,13,38,29,-19,26,27,12,37,27,-19,25,25,9,40,30,-18,30,23,10,40,31,-18,31,25,13,38,26,-20,25,25,14,38,28,-20,25,27,12,38,27,-20,26,25,13,39,29,-21,27,26,13,41,28,-22,26,27,12,40,27,-22,25,25,14,40,27,-22,24,27,13,40,26,-22,24,26,13,41,26,-22,23,26,14,41,27,-22,24,27,12,40,27,-22,25,25,13,40,28,-22,26,27,12,42,28,-24,25,27,11,41,27,-24,25,25,13,43,28,-25,24,27,12,42,27,-25,24,26,11,41,25,-23,22,25,12,42,26,-23,22,26,10,41,26,-23,23,25,11,41,27,-23,23,26,12,39,27,-22,24,26,11,39,26,-22,24,24,13,40,26,-21,23,26,12,39,25,-21,23,25,12,38,25,-21,23,25,13,39,27,-21,24,26,11,39,26,-22,24,24,12,40,27,-22,25,26,11,39,28,-21,26,25,10,38,27,-21,25,24,12,38,28,-20,25,26,11,37,26,-19,24,24,8,40,30,-18,30,24,7,40,28,-19,29,22,10,37,27,-19,25,24,11,37,28,-19,26,25,9,42,29,-21,30,24,8,41,27,-20,29,22,11,38,26,-21,25,24,12,39,28,-21,26,25,12,39,25,-21,23,25,11,39,26,-22,24,24,12,40,27,-22,24,26,13,39,26,-21,23,26,10,37,27,-19,25,24,10,38,26,-21,25,24,11,38,28,-21,26,25,12,37,28,-19,25,26,14,37,28,-19,26,27,13,39,28,-21,27,27,12,38,27,-20,26,25,12,37,27,-19,25,25,14,40,27,-22,24,27,13,40,28,-22,26,27,12,40,26,-22,25,25,13,40,26,-22,23,26,14,38,28,-19,27,27,14,39,28,-20,28,26,16,40,29,-20,29,28,16,38,29,-19,28,29,16,39,26,-22,27,27,15,39,26,-21,28,26,16,40,27,-22,29,27,17,39,27,-22,28,28,17,39,29,-19,30,29,17,40,28,-19,31,29,16,40,28,-19,30,27,16,39,28,-18,29,28,18,40,27,-21,30,29,18,40,27,-21,31,28,16,40,27,-20,30,27,17,39,26,-21,29,28,9,42,24,-19,31,18,11,42,27,-21,31,20,13,42,25,-23,31,17,11,42,23,-20,31,16,9,39,24,-20,28,19,10,40,26,-21,29,20,12,40,25,-23,29,18,11,39,23,-21,28,17,14,44,26,-23,35,21,10,44,28,-19,33,22,12,47,23,-21,36,16,10,48,24,-20,37,18,11,41,23,-20,30,16,9,41,24,-19,30,18,13,41,25,-23,31,18,11,41,26,-21,31,20,11,38,23,-22,27,17,9,38,25,-21,27,19,12,39,25,-23,29,18,10,39,26,-22,29,20,11,36,26,-24,27,21,12,36,26,-24,27,20,10,35,25,-23,26,21,11,35,24,-24,26,19,9,42,24,-19,31,18,11,42,26,-21,31,20,13,42,25,-22,31,17,11,41,23,-20,30,16,12,39,25,-23,29,18,11,39,23,-21,27,17,10,39,26,-21,29,20,9,39,24,-20,27,19,10,46,26,-20,35,20,8,59,-13,-8,54,-11,4,62,-15,-7,59,-14,10,54,-11,-6,49,-8,1,51,-9,-1,62,-15,6,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,56,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,54,-8,-4,54,-7,11,64,-12,-8,64,-10] }, + { "name": "animation_000017", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,64,-5,-7,65,-2,7,69,6,-3,70,10,2,76,-10,-8,77,-7,6,80,2,-3,81,6,6,66,0,-6,67,4,5,79,-4,-7,81,0,2,60,4,-2,61,6,3,63,11,0,63,12,8,74,5,-4,75,9,2,71,-10,-8,72,-6,7,73,-3,-8,75,1,3,71,12,-3,64,-5,2,82,5,-3,77,-10,0,67,2,0,83,-3,0,60,5,2,63,12,2,76,9,-3,70,-10,7,72,5,-4,74,8,2,67,-8,-8,68,-4,7,70,-1,-8,71,3,2,74,9,-3,67,-7,28,45,7,-30,36,8,29,48,4,-32,39,5,27,52,3,-31,43,4,23,54,3,-28,46,5,20,53,6,-25,46,7,19,49,8,-23,43,10,21,45,10,-24,38,11,25,43,9,-27,35,10,11,25,-22,-9,24,-23,11,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-6,25,-18,18,36,-17,-19,32,-16,16,31,-14,-16,28,-14,16,41,-18,-18,37,-17,11,43,-17,-14,41,-16,7,42,-14,-10,41,-13,6,37,-11,-8,36,-10,9,32,-9,-8,30,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-3,21,46,-8,-24,41,-7,17,48,-7,-21,44,-6,13,48,-5,-17,44,-3,12,43,-2,-15,40,-1,15,39,0,-16,35,0,19,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,20,-34,15,35,29,16,23,-32,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,34,6,30,46,5,-33,37,8,30,48,10,-34,40,11,27,49,13,-31,43,14,23,48,13,-27,43,15,19,47,10,-23,40,13,19,45,5,-22,37,9,22,44,2,-24,35,6,30,36,7,-33,29,14,26,35,4,-29,26,12,31,38,12,-34,32,18,28,39,16,-32,35,21,23,39,16,-27,35,21,20,37,12,-23,33,19,19,36,7,-22,29,15,22,35,4,-24,27,12,30,29,10,-33,23,19,27,28,6,-29,21,17,31,31,14,-34,27,23,28,32,17,-32,29,25,24,32,18,-27,29,26,20,30,14,-23,27,24,20,29,10,-22,24,20,22,28,7,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,15,25,31,22,17,-34,20,29,28,23,20,-32,22,31,25,23,20,-28,22,32,22,22,18,-25,20,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-31,41,14,29,52,8,-34,43,9,24,55,9,-30,47,11,21,50,12,-25,43,13,24,45,11,-26,37,12,29,46,8,-32,37,10,25,54,3,-30,46,5,20,53,6,-25,46,8,20,46,7,-23,40,8,25,44,5,-27,36,6,28,49,3,-31,40,4,22,49,2,-26,42,3,29,52,11,-33,42,12,26,53,12,-31,44,14,27,55,8,-32,46,10,29,48,11,-32,38,13,30,49,8,-33,40,10,24,50,13,-28,42,15,23,53,11,-27,45,13,26,47,13,-29,38,14,22,47,12,-25,40,13,27,45,10,-29,36,11,29,47,5,-32,38,7,28,51,5,-32,42,7,28,54,5,-32,45,7,25,55,6,-30,47,8,22,54,8,-27,47,10,21,52,9,-25,44,10,20,48,10,-24,41,11,21,45,9,-24,38,10,24,44,8,-26,36,9,28,44,6,-30,36,8,27,52,2,-31,43,4,22,54,4,-27,47,6,19,49,7,-22,43,8,22,44,6,-24,38,7,26,46,3,-29,38,4,25,49,1,-28,41,3,23,52,2,-28,44,3,20,51,3,-25,44,5,20,47,4,-23,41,5,23,46,3,-26,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,2,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,65,-1,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,-1,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,14,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,55,8,-28,48,1,25,53,9,-27,46,2,23,53,9,-26,46,3,22,55,10,-25,48,5,22,57,10,-26,50,6,23,58,9,-27,51,5,25,58,8,-29,51,3,26,57,8,-29,50,1,22,52,2,-21,49,-1,24,54,1,-23,51,-2,20,52,3,-20,49,0,18,54,4,-19,50,2,18,57,4,-20,53,3,20,59,3,-22,54,2,22,59,2,-23,55,0,24,57,1,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,18,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,18,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,17,52,-4,-13,53,-3,15,54,-3,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,15,52,25,-20,42,18,14,52,25,-19,43,18,13,51,24,-17,43,17,13,50,23,-17,42,16,14,49,23,-17,40,15,16,49,24,-19,39,16,17,50,25,-20,39,17,16,51,26,-21,40,18,26,59,11,-31,50,5,25,59,10,-30,51,5,23,58,9,-28,51,3,23,55,8,-27,49,2,25,54,8,-28,47,1,27,54,9,-29,46,2,28,55,11,-31,47,3,28,57,11,-32,48,4,17,54,21,-22,45,14,18,54,22,-23,44,15,16,53,20,-20,45,13,16,51,19,-20,44,12,17,50,19,-20,42,12,19,50,20,-22,41,12,20,51,21,-23,41,13,20,53,22,-24,42,14,22,58,13,-27,50,8,24,58,14,-29,48,8,21,57,12,-26,50,6,21,54,11,-25,48,4,23,52,11,-25,46,3,25,52,12,-27,44,4,26,53,13,-29,45,5,26,56,14,-30,46,7,24,59,11,-29,51,6,26,59,12,-31,50,6,22,57,10,-27,50,5,23,55,9,-26,49,3,24,53,9,-27,47,2,26,53,10,-29,46,2,27,55,11,-30,46,3,27,57,12,-32,48,5,30,14,15,-32,14,32,31,14,23,-34,14,39,24,14,24,-28,14,41,23,14,17,-26,15,33,35,2,24,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,23,4,15,-25,5,31,25,2,31,-29,2,47,25,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,29,29,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,33,4,17,-35,4,33,22,4,17,-25,5,34,29,8,30,-33,9,46,34,7,29,-38,8,44,36,2,28,-40,2,43,25,7,31,-29,7,48,25,2,31,-29,2,48,31,6,38,-35,6,54,27,5,37,-32,6,53,36,5,34,-40,5,50,37,2,35,-41,2,50,27,2,38,-32,2,54,31,2,38,-35,2,54,27,0,38,-32,0,54,31,0,38,-35,0,54,37,0,35,-41,0,50,25,0,31,-29,0,48,36,0,28,-40,0,43,29,0,30,-33,0,46,27,0,17,-29,0,34,22,0,17,-25,0,34,33,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,25,0,31,-29,0,47,22,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-38,0,39,30,0,12,-32,0,28,31,2,38,-35,2,54,27,2,38,-32,2,54,37,2,35,-41,2,50,27,0,38,-32,0,54,31,0,38,-35,0,54,37,0,35,-41,0,50,25,2,31,-29,2,48,25,0,31,-29,0,48,36,2,28,-40,2,43,36,0,28,-40,0,43,22,4,17,-25,5,34,33,4,17,-35,4,33,22,0,17,-25,0,34,33,0,17,-35,0,33,25,4,12,-28,5,29,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,25,0,31,-29,0,47,25,2,31,-29,2,47,23,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,24,-38,2,39,22,0,14,-25,0,31,23,0,21,-26,0,38,35,0,24,-38,0,39,30,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,15,40,26,-16,31,24,13,39,24,-16,29,21,13,47,23,-19,36,18,16,47,25,-19,37,21,12,40,28,-13,31,23,11,40,25,-14,30,20,11,47,25,-16,36,17,12,47,28,-15,38,19,13,47,29,-15,39,21,11,47,27,-15,38,19,12,40,27,-13,31,21,14,40,29,-12,32,24,17,48,26,-19,37,23,14,47,24,-19,36,20,15,40,25,-16,30,22,17,40,27,-16,31,25,18,41,27,-15,32,26,17,41,26,-15,31,24,16,48,25,-19,37,21,17,48,27,-19,38,23,17,41,29,-13,33,25,15,40,28,-12,32,23,12,47,28,-15,39,20,14,48,30,-15,40,22,17,48,30,-16,40,24,14,47,30,-15,40,21,17,41,28,-12,34,23,19,42,29,-12,35,26,17,49,28,-18,39,24,16,49,26,-19,38,22,18,42,26,-14,32,24,19,43,27,-14,34,26,18,49,28,-19,40,24,13,47,23,-19,36,18,13,50,23,-20,39,17,17,51,27,-20,42,21,16,49,30,-17,41,23,11,47,25,-16,37,17,11,50,25,-17,39,16,15,52,29,-18,42,20,12,48,28,-15,39,20,12,51,27,-16,41,18,16,47,25,-20,37,22,15,51,25,-20,40,19,20,43,25,-14,32,27,19,42,24,-13,31,26,17,43,27,-14,33,24,18,43,28,-14,34,25,21,42,25,-12,32,28,19,41,25,-12,31,26,18,41,28,-12,34,24,19,42,28,-12,35,26,20,42,24,-13,30,27,21,42,25,-13,31,28,19,42,24,-13,31,26,20,43,25,-13,32,27,20,44,24,-14,31,28,19,43,23,-14,31,26,21,43,23,-14,30,28,20,42,23,-14,30,27,20,43,23,-14,29,27,20,44,23,-15,30,28,20,42,23,-15,30,27,21,43,24,-15,31,28,19,44,25,-17,30,28,19,43,25,-17,30,27,19,44,25,-16,30,28,18,44,24,-16,29,27,18,44,23,-18,27,26,19,45,24,-18,27,28,18,43,24,-17,28,26,19,44,25,-18,28,27,20,42,24,-16,29,27,19,42,23,-16,28,26,20,43,23,-16,27,28,19,43,22,-15,27,26,19,42,22,-15,27,26,20,42,23,-15,28,28,18,43,23,-15,28,26,19,43,24,-16,29,27,19,42,25,-14,30,27,18,41,24,-14,29,25,20,41,25,-13,28,27,19,40,24,-13,27,26,17,40,28,-13,33,25,16,40,27,-12,32,23,18,40,24,-12,28,25,20,40,25,-12,29,27,16,42,28,-15,33,25,15,42,27,-15,32,23,18,42,24,-14,28,25,19,42,25,-14,29,27,18,40,24,-15,27,26,16,40,23,-15,26,24,13,41,26,-15,31,22,14,42,28,-15,32,24,18,38,25,-13,27,26,16,38,24,-13,26,24,13,39,27,-13,31,22,14,39,28,-12,31,24,17,39,23,-13,25,24,18,39,24,-13,26,26,16,39,24,-14,27,24,17,39,25,-14,27,25,17,42,24,-16,26,26,16,41,23,-16,26,24,18,41,23,-15,25,26,17,41,22,-15,24,25,17,42,22,-16,24,25,18,42,23,-16,25,27,16,41,23,-16,26,24,17,41,24,-16,26,26,16,42,25,-18,26,26,15,42,24,-18,26,25,16,44,24,-19,25,26,15,43,24,-19,25,25,14,42,22,-17,22,25,15,43,23,-17,23,26,14,41,23,-17,23,24,14,42,24,-17,23,25,16,40,24,-16,25,25,15,40,23,-16,24,24,16,41,23,-15,24,26,15,41,22,-15,23,24,16,40,22,-15,24,24,17,40,23,-15,24,25,14,40,23,-16,24,23,15,41,24,-16,25,25,15,39,25,-15,26,25,14,39,23,-15,26,23,17,39,24,-14,26,25,15,38,22,-14,25,23,12,39,27,-13,31,23,11,39,26,-14,30,21,15,37,23,-14,26,23,16,38,25,-13,27,24,13,41,27,-15,31,23,11,40,25,-15,30,21,15,39,23,-15,26,23,16,39,24,-15,27,24,16,40,22,-15,23,24,15,40,23,-16,24,24,16,40,24,-16,25,25,17,41,23,-15,24,25,15,38,23,-14,25,23,15,39,23,-15,26,23,16,39,24,-15,27,24,16,38,24,-13,26,25,18,39,24,-13,26,26,18,40,25,-14,27,26,16,39,23,-14,26,24,17,38,23,-13,26,24,18,42,23,-16,25,27,17,41,24,-16,26,26,16,41,23,-16,26,24,17,41,22,-16,24,25,19,40,24,-13,28,26,18,41,24,-14,28,25,19,42,25,-14,29,27,20,40,25,-13,29,27,19,42,22,-15,27,26,19,42,23,-16,28,26,20,43,24,-16,29,27,20,43,23,-15,27,28,21,42,25,-12,31,28,20,43,25,-13,32,27,19,42,24,-13,31,26,20,41,24,-12,30,27,21,43,23,-14,30,28,21,43,24,-15,31,28,20,43,23,-15,30,27,20,43,23,-14,30,27,12,43,22,-15,32,17,13,43,24,-17,32,19,15,44,22,-19,31,17,13,44,21,-16,32,15,13,40,21,-15,29,18,14,40,23,-17,30,19,15,41,22,-18,29,18,14,41,20,-17,28,16,15,46,24,-19,35,21,12,44,27,-15,34,21,13,49,22,-18,37,15,11,48,24,-17,37,17,13,42,20,-16,30,16,12,42,22,-15,30,17,15,43,22,-18,31,17,14,42,24,-17,31,19,14,40,20,-17,27,17,13,39,21,-16,28,18,16,40,22,-18,29,18,14,40,23,-17,29,19,16,37,22,-18,27,20,16,38,21,-19,27,19,15,37,21,-18,26,20,16,37,20,-19,26,19,12,42,22,-15,31,17,14,42,24,-17,31,19,15,43,22,-18,31,17,13,43,20,-16,31,15,16,41,22,-18,29,18,14,40,20,-17,28,16,14,40,23,-17,29,19,13,40,21,-15,28,18,12,46,26,-17,36,19,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000018", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,64,-5,-7,65,-2,7,69,6,-3,70,10,2,75,-10,-7,77,-7,7,80,3,-2,81,6,6,66,0,-6,68,4,6,79,-4,-6,81,0,2,60,4,-2,61,6,3,62,11,0,63,12,8,74,5,-3,76,9,2,70,-10,-8,72,-6,7,73,-3,-8,75,1,3,70,12,-3,64,-5,2,82,5,-2,77,-10,0,67,2,0,83,-3,0,60,5,2,63,12,3,76,9,-3,71,-10,8,72,5,-3,74,8,2,67,-8,-8,68,-4,7,69,-1,-7,71,3,3,74,9,-3,67,-7,28,44,6,-30,36,8,29,48,4,-31,39,6,27,52,2,-31,44,4,24,54,3,-28,46,5,21,53,5,-25,46,7,20,49,8,-23,43,10,22,45,10,-24,38,11,25,43,9,-26,35,10,11,25,-22,-9,24,-23,11,29,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,5,40,-19,-7,40,-18,4,35,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-7,25,-18,18,36,-17,-19,32,-16,17,31,-14,-16,28,-14,16,41,-18,-18,38,-17,11,43,-17,-14,41,-16,8,42,-14,-10,41,-13,6,37,-11,-7,36,-10,9,32,-9,-8,30,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,23,38,-4,-23,32,-3,21,46,-8,-24,41,-6,17,48,-7,-21,44,-5,14,48,-5,-17,44,-3,13,43,-2,-15,40,-1,15,39,0,-15,35,0,19,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,20,-34,15,35,29,16,23,-32,17,37,26,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,27,45,1,-29,34,6,30,46,5,-33,37,8,31,48,9,-34,40,12,28,49,13,-31,43,14,24,48,13,-27,43,15,20,47,10,-23,40,13,19,45,5,-22,37,9,22,44,1,-24,35,6,30,36,7,-33,29,14,27,35,4,-29,27,12,31,38,12,-34,32,18,28,39,15,-32,35,21,24,39,16,-27,35,21,20,37,12,-23,33,19,19,36,7,-22,29,15,22,35,4,-24,27,12,31,29,9,-33,23,19,27,28,6,-29,21,17,31,31,14,-34,27,23,28,32,17,-32,29,25,24,32,17,-27,29,26,20,30,14,-23,27,24,20,29,10,-22,24,20,23,28,6,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,15,25,31,22,17,-34,20,29,29,23,20,-32,22,31,25,23,20,-28,22,32,22,22,18,-25,20,30,21,20,14,-24,18,27,24,19,11,-26,16,25,28,50,12,-30,41,14,30,52,7,-33,43,10,25,55,9,-29,47,11,22,50,12,-25,43,13,25,45,11,-26,37,12,30,46,8,-31,37,10,26,54,3,-30,46,5,21,53,6,-24,46,8,20,46,7,-22,40,8,25,44,5,-26,36,6,28,49,2,-31,40,4,22,49,1,-25,42,3,30,51,10,-33,42,13,27,53,12,-30,44,14,28,55,8,-32,46,10,29,48,11,-31,39,13,31,49,8,-33,40,10,25,50,13,-28,42,15,23,53,11,-27,45,13,27,47,12,-28,38,14,23,47,12,-25,40,14,28,45,10,-29,36,11,29,47,5,-31,38,7,29,51,5,-32,42,7,28,54,5,-32,45,7,25,55,6,-30,47,9,23,54,8,-27,47,10,22,52,8,-25,44,10,21,48,9,-23,41,11,22,45,9,-24,38,11,25,44,8,-26,36,9,28,44,6,-29,36,8,27,52,2,-31,43,4,23,54,4,-27,47,6,19,50,6,-22,43,8,22,44,5,-24,38,7,27,46,3,-29,38,5,25,48,1,-28,41,3,24,52,1,-27,44,4,21,51,3,-24,44,5,21,47,4,-23,41,5,23,46,2,-25,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,2,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,66,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,0,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,14,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-9,-14,60,-5,19,57,-9,-15,59,-7,27,55,8,-28,48,1,25,53,8,-27,46,2,23,53,9,-26,46,3,22,55,10,-25,48,5,22,57,10,-26,50,6,23,58,9,-27,51,5,25,58,8,-29,51,3,27,57,8,-29,50,1,23,52,2,-21,49,-1,24,54,1,-23,51,-2,20,52,3,-20,49,0,18,54,4,-19,50,2,18,57,4,-20,53,3,20,59,3,-22,54,2,23,59,2,-23,55,0,24,57,1,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,18,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,18,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,17,52,-4,-13,53,-3,15,54,-3,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,16,52,25,-20,42,18,14,52,25,-19,43,18,13,51,24,-18,43,17,14,50,23,-17,42,16,15,49,23,-17,40,15,16,49,24,-19,39,16,17,50,25,-20,39,17,17,51,26,-21,40,18,27,59,11,-31,50,5,25,59,10,-30,51,5,23,58,9,-28,51,3,24,55,8,-27,49,2,25,54,8,-28,47,1,27,54,9,-29,46,2,28,55,10,-31,47,3,28,57,11,-32,48,4,17,54,21,-22,45,14,19,54,22,-23,44,15,16,53,20,-20,45,13,16,51,19,-20,44,12,17,50,19,-20,42,12,19,50,20,-22,41,12,20,51,21,-23,41,13,20,53,22,-24,42,14,22,58,13,-27,50,8,24,58,14,-29,48,8,21,57,11,-26,50,6,21,54,11,-25,48,4,23,52,11,-25,46,3,25,52,12,-27,44,4,26,54,13,-29,45,5,26,56,14,-30,46,7,24,59,11,-29,51,6,26,59,12,-31,50,6,22,57,10,-27,50,5,23,55,9,-26,49,3,24,53,9,-27,47,2,26,53,10,-29,46,2,28,55,11,-30,46,3,28,57,12,-32,48,5,30,14,15,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,22,4,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,4,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,4,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,14,40,27,-16,31,24,12,40,25,-16,29,21,14,47,23,-19,36,18,16,47,25,-19,37,21,12,40,28,-13,31,23,10,40,26,-14,30,21,11,47,25,-16,36,17,12,48,28,-15,38,19,13,48,29,-15,39,21,11,48,27,-15,38,19,12,40,28,-13,31,21,13,40,29,-13,32,24,17,47,26,-19,37,23,15,47,25,-19,36,20,14,40,26,-16,30,22,16,40,27,-16,31,25,18,41,28,-15,32,26,16,40,26,-15,31,24,16,48,25,-19,37,21,17,48,27,-19,38,23,16,41,30,-13,33,25,14,40,29,-12,32,23,12,48,29,-15,39,20,15,48,30,-16,39,22,17,48,30,-16,40,24,14,48,30,-16,40,21,16,41,29,-12,34,24,18,42,30,-12,35,26,18,49,28,-18,39,24,16,49,26,-19,38,22,17,41,26,-14,32,24,19,42,28,-14,34,26,18,48,28,-19,40,24,14,47,23,-19,36,18,13,50,23,-20,39,17,17,51,27,-20,42,21,16,49,30,-17,41,23,11,48,25,-16,37,17,11,50,25,-17,39,16,15,52,28,-18,42,20,12,48,29,-15,39,20,13,51,27,-16,41,18,17,47,26,-20,37,22,16,51,25,-20,40,19,20,40,27,-14,32,28,19,40,26,-14,31,26,17,42,27,-14,33,24,18,43,28,-14,34,25,20,40,28,-13,32,28,19,39,27,-12,31,26,17,41,29,-12,33,24,18,42,29,-13,34,26,20,38,26,-13,30,27,21,39,27,-13,31,28,19,40,26,-13,31,26,21,40,27,-14,32,27,21,40,25,-15,32,27,20,39,25,-15,31,26,22,39,26,-15,31,28,21,38,25,-14,30,27,21,39,25,-15,30,27,22,39,25,-15,31,28,20,39,25,-15,31,26,21,40,26,-15,31,27,21,41,25,-17,31,27,20,41,24,-17,30,26,21,41,24,-17,30,28,20,40,24,-17,30,27,20,37,23,-18,27,26,21,37,24,-18,28,27,20,38,24,-18,28,26,21,38,25,-18,29,27,20,37,26,-16,29,27,19,37,25,-16,28,26,21,36,25,-16,27,28,20,36,24,-16,27,26,19,36,25,-15,27,26,20,36,26,-15,28,28,19,37,25,-16,28,25,20,37,26,-16,29,27,19,38,27,-14,30,27,18,38,26,-14,29,25,19,37,28,-13,28,28,18,36,27,-13,27,26,16,40,30,-13,32,25,15,40,28,-13,32,24,17,37,27,-13,28,26,18,37,28,-13,29,27,17,42,28,-15,33,25,16,41,27,-15,32,23,18,38,26,-15,28,26,19,38,27,-15,29,27,17,36,27,-15,27,26,15,36,25,-15,26,24,13,41,26,-15,31,22,15,41,27,-15,32,24,15,36,28,-13,27,26,14,35,27,-13,26,24,12,39,28,-13,31,22,13,40,29,-13,31,24,15,34,26,-14,25,24,16,35,28,-14,26,26,15,36,26,-15,27,24,17,36,27,-15,27,25,18,35,26,-16,26,26,17,35,25,-17,26,24,17,34,26,-16,25,26,16,33,25,-16,24,25,17,33,25,-17,24,25,18,33,26,-17,25,27,17,35,24,-16,26,24,18,35,26,-16,26,26,19,34,24,-18,26,26,19,34,23,-19,26,25,20,33,24,-19,25,26,19,33,23,-19,25,25,16,32,24,-17,22,25,17,32,25,-17,22,26,16,33,24,-18,23,25,17,33,25,-18,23,26,16,35,25,-16,25,25,15,34,24,-16,24,24,16,33,26,-15,24,26,15,33,25,-15,23,24,14,34,25,-15,24,24,15,34,26,-15,24,25,15,35,24,-16,24,24,16,35,26,-16,25,25,15,36,26,-16,26,25,14,36,25,-16,26,23,14,35,27,-14,26,25,13,35,26,-14,25,23,11,40,28,-13,31,23,10,39,26,-14,30,21,12,36,26,-14,26,23,13,36,27,-14,27,24,13,41,27,-16,31,23,11,40,25,-16,30,21,13,36,25,-16,26,23,15,37,26,-16,27,24,14,33,25,-15,23,24,15,34,24,-16,24,24,16,35,26,-16,25,25,15,34,26,-15,24,26,13,35,26,-14,25,23,13,36,25,-15,26,23,15,36,26,-15,27,25,14,36,27,-14,26,25,16,35,28,-13,26,26,16,36,27,-15,27,26,15,36,26,-15,26,24,14,35,27,-13,26,24,18,33,26,-16,25,27,18,35,26,-16,26,26,17,35,25,-16,26,24,17,33,25,-16,24,25,17,36,27,-13,28,26,18,38,26,-14,28,25,19,38,27,-14,29,27,19,37,28,-13,28,27,19,35,25,-16,27,26,19,37,25,-16,28,26,20,37,26,-16,29,27,20,36,26,-16,28,28,21,39,27,-13,31,28,21,40,27,-14,32,28,19,40,26,-13,31,26,19,39,27,-13,30,27,22,39,25,-15,31,28,21,40,26,-15,32,27,20,39,25,-15,31,26,21,38,25,-15,30,27,11,43,23,-15,32,17,13,43,25,-17,32,19,15,44,23,-19,31,17,13,43,21,-16,32,15,12,40,22,-15,29,18,13,40,24,-17,30,19,15,41,23,-18,29,18,14,40,21,-17,28,16,15,46,25,-19,35,21,12,44,27,-15,34,21,13,49,22,-19,37,15,11,48,24,-17,37,17,13,42,21,-17,30,16,12,42,22,-15,30,17,15,42,23,-19,31,17,13,42,24,-17,31,19,14,40,21,-17,27,17,12,39,22,-16,28,18,15,40,23,-19,29,18,14,39,24,-17,29,19,15,37,23,-19,27,20,16,37,22,-20,27,20,14,36,22,-18,26,20,15,37,21,-19,26,19,12,42,23,-15,31,17,13,42,25,-17,31,19,15,43,23,-19,31,17,13,43,21,-16,31,15,15,40,23,-18,29,18,14,40,21,-17,28,17,14,40,24,-17,29,19,12,39,22,-16,28,18,12,46,26,-17,36,19,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000019", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,63,-5,-7,65,-2,7,69,6,-3,70,10,2,75,-10,-7,77,-7,7,80,3,-2,81,6,6,66,0,-6,68,4,6,79,-4,-6,81,0,2,60,4,-2,61,6,3,62,11,0,63,12,8,74,5,-3,76,9,2,70,-10,-8,72,-6,7,73,-3,-7,75,1,3,70,12,-3,64,-5,3,82,5,-2,77,-10,0,67,2,0,83,-3,0,60,5,2,63,12,3,76,9,-3,71,-10,8,72,5,-3,74,8,2,67,-8,-8,68,-4,7,69,-1,-7,71,3,3,74,9,-3,67,-7,28,44,7,-30,36,8,29,48,4,-31,39,6,27,52,2,-31,44,4,23,54,3,-28,46,5,20,53,5,-25,46,7,20,49,8,-23,43,10,22,45,10,-23,38,11,25,43,9,-26,35,10,11,25,-22,-9,24,-23,11,29,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-7,25,-18,18,36,-17,-19,32,-16,16,31,-14,-16,28,-14,16,41,-18,-18,38,-17,11,43,-17,-14,41,-16,7,42,-14,-10,41,-13,6,37,-11,-7,36,-10,9,32,-9,-8,30,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-3,21,46,-8,-24,41,-6,17,48,-7,-20,44,-5,14,48,-5,-17,44,-3,12,43,-2,-15,40,-1,15,39,0,-15,35,0,19,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,20,-34,15,35,29,16,23,-32,17,37,26,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,35,6,30,46,5,-32,37,8,30,48,9,-33,40,12,28,49,13,-31,43,14,23,48,13,-27,43,15,20,47,10,-23,40,13,19,45,5,-22,37,9,22,44,2,-24,35,6,30,36,7,-33,29,14,26,35,4,-29,27,12,31,38,12,-34,33,18,28,39,16,-31,35,21,23,39,16,-27,35,21,20,37,12,-23,33,19,19,36,7,-22,29,15,22,35,4,-24,27,12,30,29,10,-33,23,19,27,28,6,-29,21,17,31,31,14,-34,27,23,28,32,17,-31,29,25,24,32,18,-27,29,26,20,30,14,-23,27,24,20,29,10,-22,24,20,22,28,7,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,16,25,31,22,17,-34,20,29,28,23,20,-32,22,32,25,23,20,-28,22,32,22,22,18,-25,20,30,21,20,14,-24,18,27,24,19,11,-26,16,25,28,50,13,-30,41,15,30,52,7,-33,43,10,25,55,9,-29,47,11,22,50,12,-25,43,13,24,45,11,-26,37,12,29,46,8,-31,37,10,25,54,3,-30,46,6,20,53,6,-24,46,8,20,46,7,-22,40,8,25,44,5,-26,37,6,28,49,3,-31,40,4,22,49,2,-25,42,3,29,52,11,-33,42,13,26,53,12,-30,44,14,28,55,8,-32,46,11,29,48,11,-31,39,13,30,49,8,-33,40,10,25,50,13,-27,42,15,23,53,11,-27,45,13,26,47,13,-28,39,14,23,47,12,-25,40,14,27,45,10,-29,36,12,29,47,5,-31,38,7,28,51,5,-32,42,7,28,54,5,-32,45,7,25,55,6,-30,47,9,22,54,8,-27,47,10,21,52,9,-25,44,10,21,48,10,-23,41,11,22,45,9,-23,38,11,25,44,8,-26,36,9,28,44,6,-29,36,8,27,52,2,-31,43,4,22,54,4,-27,47,6,19,50,6,-22,43,8,22,44,6,-24,38,7,27,46,3,-29,38,5,25,49,1,-28,41,3,23,52,2,-27,44,4,20,51,3,-24,44,5,20,47,4,-23,41,5,23,46,2,-25,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,2,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,66,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,0,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,55,8,-28,48,1,25,53,9,-27,46,2,23,53,10,-26,46,3,21,55,10,-25,48,5,21,57,10,-26,50,6,23,58,9,-27,51,5,25,58,9,-29,51,3,26,57,8,-29,50,1,22,52,2,-21,49,-1,24,54,1,-23,51,-2,20,52,3,-20,49,0,18,54,4,-19,50,2,18,57,4,-20,53,3,20,59,3,-22,54,2,22,59,2,-23,55,0,24,57,1,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,18,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,18,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,17,52,-4,-13,53,-3,15,54,-3,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,15,52,25,-21,41,18,14,52,25,-19,42,18,13,51,24,-18,42,17,13,50,23,-17,41,16,14,49,23,-18,40,16,15,49,24,-19,39,16,16,50,25,-21,39,17,16,51,26,-21,40,18,26,59,11,-31,50,5,24,59,10,-30,51,5,23,58,9,-28,51,3,23,55,9,-27,49,2,25,54,9,-28,47,1,27,54,10,-29,46,2,27,55,11,-31,47,3,27,57,12,-32,48,4,16,54,21,-22,45,15,18,54,22,-23,44,15,15,53,20,-21,45,14,16,51,19,-20,43,12,17,50,19,-20,42,12,18,50,20,-22,41,12,19,51,21,-23,41,13,19,53,22,-24,42,14,22,58,13,-27,50,8,24,58,14,-29,48,8,21,57,12,-26,50,6,21,54,11,-25,48,4,23,52,11,-25,46,3,25,52,12,-27,44,4,25,53,13,-29,45,5,25,56,14,-30,46,7,23,59,11,-29,51,6,26,59,12,-31,50,6,22,57,10,-27,50,5,22,55,10,-26,49,3,24,53,9,-27,47,2,26,53,10,-29,46,2,27,55,11,-30,46,3,27,57,12,-32,48,5,30,14,15,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,22,4,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,4,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,4,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,13,40,27,-17,30,24,11,40,25,-17,29,22,13,47,23,-20,35,18,15,47,25,-20,37,21,10,40,28,-14,31,23,9,40,26,-15,30,21,10,48,25,-16,36,18,11,48,28,-15,37,20,12,48,29,-16,38,21,10,48,27,-16,37,19,10,40,27,-14,31,22,12,40,29,-13,31,24,16,47,26,-20,37,23,14,47,25,-20,36,20,13,40,26,-17,30,23,15,40,27,-17,31,25,16,41,28,-16,32,26,15,40,26,-16,31,24,15,47,25,-20,37,22,16,48,27,-19,38,23,15,40,30,-14,33,26,13,40,29,-13,32,23,11,48,29,-16,38,20,13,48,30,-16,39,22,16,48,30,-17,40,24,13,48,30,-16,39,22,15,41,29,-13,33,24,17,41,30,-13,34,26,17,49,28,-19,39,25,15,49,26,-20,38,22,16,41,26,-15,32,25,18,42,28,-15,34,27,17,48,28,-20,40,24,13,47,23,-20,36,18,13,50,23,-20,38,17,16,51,27,-20,42,21,15,49,30,-17,41,24,10,48,25,-17,36,17,10,51,25,-17,39,16,15,52,29,-18,42,21,11,48,29,-15,38,20,12,51,27,-17,41,18,16,47,26,-20,37,22,15,51,25,-21,40,19,19,39,28,-15,31,28,18,39,27,-15,30,27,16,41,27,-15,33,24,17,42,28,-15,34,26,19,39,29,-14,31,28,17,38,28,-13,30,27,16,41,29,-13,33,25,17,41,29,-13,34,26,18,37,28,-14,30,27,19,38,29,-14,31,28,18,38,27,-14,31,26,19,39,28,-14,32,28,20,38,27,-16,31,28,19,37,26,-16,31,27,20,37,28,-16,30,28,19,37,27,-15,30,27,19,36,27,-16,30,27,20,37,27,-16,30,28,19,37,27,-16,31,27,20,38,27,-16,31,28,21,38,26,-18,31,27,20,38,25,-18,30,26,21,37,26,-18,30,28,20,37,25,-18,30,27,19,34,24,-19,27,26,20,34,25,-19,27,28,18,35,24,-19,28,26,19,35,25,-19,28,27,18,36,27,-17,29,27,17,35,26,-17,28,26,18,34,27,-17,27,28,17,34,26,-17,26,27,17,34,27,-16,27,27,18,34,28,-16,27,28,17,35,26,-17,28,26,18,36,27,-17,29,27,17,37,28,-15,29,27,16,37,26,-15,29,26,17,36,29,-15,28,28,15,35,28,-14,27,26,15,40,30,-14,32,26,13,40,29,-14,31,24,15,36,28,-14,28,26,16,36,29,-14,29,28,16,41,28,-16,32,25,14,41,27,-16,32,24,16,37,26,-16,28,26,17,37,28,-16,29,27,15,36,27,-16,27,26,14,36,25,-16,26,24,12,41,26,-16,31,22,13,41,27,-16,31,24,14,35,28,-14,27,26,13,35,27,-14,26,24,11,39,28,-14,30,22,12,40,29,-14,31,24,13,34,26,-15,25,25,14,35,28,-15,26,26,14,36,25,-16,26,24,15,36,27,-16,27,26,16,34,26,-17,26,26,15,34,25,-17,25,25,16,33,27,-17,25,27,15,33,26,-17,24,25,15,33,25,-18,24,25,16,33,26,-18,25,27,15,34,25,-17,25,25,17,34,26,-17,26,26,18,33,25,-19,26,26,17,33,24,-19,26,25,18,32,25,-20,25,26,17,32,24,-20,25,25,14,32,24,-18,22,25,15,32,25,-18,22,26,15,33,24,-19,23,25,15,33,25,-19,23,26,14,34,26,-18,24,25,13,34,24,-18,24,24,14,33,26,-17,23,26,13,33,25,-17,23,24,12,33,25,-16,23,24,13,34,27,-16,24,26,13,34,24,-17,24,24,14,35,26,-17,25,25,13,36,26,-17,26,25,12,36,25,-17,25,23,12,35,27,-15,25,25,11,35,26,-15,25,23,10,40,28,-14,30,23,9,40,26,-15,30,21,11,36,26,-15,26,23,12,36,27,-15,26,25,11,41,27,-16,31,23,10,40,25,-16,30,21,12,36,25,-17,26,23,13,37,26,-16,26,25,13,33,25,-16,23,24,13,34,24,-17,24,24,14,35,26,-17,25,25,14,33,26,-16,24,26,11,35,26,-15,25,23,12,36,25,-16,26,23,13,36,26,-16,26,25,12,35,27,-15,26,25,14,35,28,-14,26,26,15,36,27,-16,27,26,14,36,25,-16,26,24,13,35,27,-14,25,25,16,33,27,-17,25,27,16,34,26,-17,26,26,15,34,25,-17,25,25,15,33,25,-17,24,25,15,36,28,-14,27,26,16,37,27,-15,28,26,17,37,28,-15,29,27,17,36,29,-14,28,28,17,34,26,-17,27,27,17,35,26,-17,28,26,18,36,27,-17,29,27,18,34,27,-17,27,28,19,38,29,-14,31,28,19,39,28,-15,32,28,18,38,27,-14,31,27,18,38,28,-14,30,27,20,37,28,-16,30,28,20,38,27,-16,31,28,19,37,27,-16,31,27,19,36,27,-16,30,27,10,43,23,-16,32,17,12,43,25,-18,31,19,14,43,23,-19,31,17,12,43,21,-17,31,16,11,40,22,-16,28,18,12,40,24,-18,29,19,14,41,23,-19,29,18,13,40,21,-18,28,16,14,46,25,-20,35,21,11,44,27,-16,34,21,12,49,22,-19,37,16,10,48,24,-17,37,17,12,42,21,-17,30,16,11,42,22,-16,30,18,14,42,23,-19,30,17,12,42,24,-18,31,19,13,40,21,-18,27,17,11,39,22,-17,27,19,14,40,23,-19,29,18,12,39,24,-18,29,20,13,37,23,-19,27,21,14,37,22,-20,27,20,13,36,22,-19,26,20,14,37,21,-20,26,19,10,42,22,-16,31,17,12,42,25,-18,31,19,14,43,23,-19,31,17,12,43,21,-17,31,16,14,40,23,-19,29,18,13,40,21,-18,28,17,12,40,24,-18,29,19,11,39,22,-16,28,18,11,46,26,-17,35,19,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000020", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,63,-5,-7,65,-2,7,69,6,-3,70,10,2,75,-10,-7,77,-7,7,80,3,-2,81,6,6,66,0,-6,68,4,6,79,-4,-6,81,0,2,60,4,-2,61,6,3,62,11,0,63,12,8,74,5,-3,76,9,2,70,-10,-8,72,-6,7,73,-3,-7,75,1,3,70,12,-3,64,-5,3,82,5,-2,77,-10,0,67,2,0,83,-3,0,60,5,2,63,12,3,76,9,-3,71,-10,8,72,5,-3,74,8,2,67,-8,-8,68,-4,7,69,-1,-7,71,3,3,74,9,-3,67,-7,28,45,7,-30,36,8,29,48,4,-31,39,6,27,52,2,-31,44,4,23,54,3,-28,46,5,20,53,6,-24,46,7,20,49,8,-23,43,10,22,45,10,-23,38,11,25,43,9,-26,35,10,11,25,-22,-9,24,-23,11,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-4,35,-14,6,28,-13,-5,28,-13,9,25,-17,-7,25,-18,18,36,-17,-19,32,-16,16,31,-14,-16,28,-14,16,41,-18,-18,38,-17,11,43,-17,-14,41,-16,7,42,-14,-10,41,-13,6,37,-11,-7,36,-10,9,32,-9,-8,30,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-3,21,46,-8,-24,41,-6,17,48,-7,-20,44,-5,13,48,-5,-17,44,-3,12,43,-2,-15,40,-1,15,39,0,-15,35,0,19,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,20,-34,15,35,29,16,23,-32,17,37,26,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,35,6,30,46,5,-32,37,8,30,48,10,-33,40,12,28,49,13,-31,43,14,23,48,13,-27,43,15,20,47,10,-23,40,13,19,45,5,-22,37,9,22,44,2,-24,35,6,30,36,7,-33,29,14,26,35,4,-29,27,12,31,38,12,-34,33,18,28,39,16,-31,35,21,23,39,16,-27,35,21,20,37,12,-23,33,19,19,36,7,-22,29,15,22,35,4,-24,27,12,30,29,10,-33,23,19,27,28,6,-29,21,17,31,31,14,-34,27,23,28,32,17,-31,29,26,24,32,18,-27,29,26,20,30,14,-23,27,24,20,29,10,-22,24,20,22,28,7,-25,21,18,30,21,14,-33,18,26,27,20,11,-30,16,25,31,22,17,-34,20,29,28,23,20,-32,22,32,25,23,20,-28,22,32,22,22,18,-25,20,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-30,41,15,30,52,8,-33,43,10,24,55,9,-29,47,11,21,50,12,-25,43,14,24,45,11,-26,37,12,29,46,8,-31,37,10,25,54,3,-29,46,6,20,53,6,-24,46,8,20,46,7,-22,40,8,25,44,5,-26,37,6,28,49,3,-31,40,4,22,49,2,-25,42,3,29,52,11,-32,42,13,26,53,12,-30,44,14,27,55,8,-32,46,11,29,48,11,-31,39,13,30,49,8,-33,40,10,24,50,13,-27,42,15,23,53,11,-27,45,13,26,47,13,-28,39,14,23,47,12,-25,40,14,27,45,10,-29,36,12,29,47,5,-31,38,7,28,51,5,-32,42,7,28,54,5,-32,45,7,25,55,6,-30,47,9,22,54,8,-26,47,10,21,52,9,-25,45,11,20,48,10,-23,41,11,22,45,9,-23,38,11,24,44,8,-26,36,9,28,44,6,-29,36,8,27,52,2,-31,43,4,22,54,4,-27,47,6,19,50,6,-22,43,8,22,44,6,-24,38,7,27,46,3,-29,38,5,25,49,1,-28,41,3,23,52,2,-27,45,4,20,51,3,-24,44,5,20,47,4,-23,41,5,23,46,3,-25,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,2,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,66,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,0,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,55,8,-28,48,1,25,53,9,-27,46,2,23,53,10,-26,46,3,21,55,10,-25,48,5,21,57,10,-26,50,6,23,58,9,-27,51,5,25,58,9,-29,51,3,26,57,8,-29,50,1,22,52,2,-21,49,-1,24,54,1,-23,51,-2,20,52,3,-20,49,0,18,54,4,-19,50,2,18,57,4,-20,53,3,20,59,3,-22,54,2,22,59,2,-23,55,0,24,57,1,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,18,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,18,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,17,52,-4,-13,53,-3,15,54,-3,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,15,52,25,-21,41,19,14,52,25,-20,42,19,13,52,24,-19,42,18,13,50,23,-18,41,17,14,49,23,-19,40,16,15,49,24,-20,39,16,16,50,25,-21,39,17,16,51,26,-22,40,18,26,59,11,-31,50,5,24,59,10,-30,51,5,23,58,9,-28,51,4,23,55,9,-27,49,2,25,54,9,-27,47,1,26,54,10,-29,46,1,27,55,11,-31,47,3,27,57,12,-32,48,4,16,54,21,-23,44,15,18,54,22,-24,43,15,15,53,20,-21,44,14,15,51,19,-20,43,13,17,50,19,-21,42,12,18,50,20,-22,41,12,19,51,21,-24,41,13,19,53,22,-25,42,14,22,58,13,-28,50,8,24,58,14,-29,48,8,21,57,12,-26,49,6,21,54,11,-25,48,5,23,52,11,-25,46,4,24,52,12,-27,44,4,25,54,13,-29,45,5,25,56,14,-30,46,7,23,59,11,-29,51,6,25,59,12,-31,50,6,22,57,10,-27,50,5,22,55,10,-26,49,3,24,53,9,-27,47,2,26,53,10,-29,46,2,27,55,11,-30,46,3,27,57,12,-32,48,4,30,14,15,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,22,4,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,4,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,4,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,12,40,27,-19,30,24,10,40,25,-18,29,22,13,47,23,-21,35,19,15,47,25,-21,36,21,10,40,28,-16,30,24,8,40,26,-16,29,21,10,48,25,-17,36,18,11,48,28,-16,37,20,12,48,29,-17,38,22,10,48,27,-17,37,20,10,40,27,-15,30,22,12,40,29,-15,31,25,16,47,26,-21,37,23,13,47,25,-21,36,20,13,40,26,-18,29,23,14,40,27,-18,30,25,16,41,28,-18,32,26,15,40,27,-18,30,25,15,48,25,-21,36,22,16,48,27,-21,38,24,15,41,30,-15,32,26,12,40,29,-15,31,24,11,48,29,-17,38,21,13,48,30,-17,39,23,15,48,30,-18,39,25,13,48,30,-17,39,22,14,41,29,-14,33,25,17,41,30,-15,34,27,17,49,28,-20,39,25,15,49,26,-21,37,23,16,41,26,-17,32,25,17,42,28,-16,33,27,17,48,28,-21,39,24,12,47,23,-21,35,19,13,50,23,-21,38,17,16,51,27,-21,41,21,15,49,30,-18,40,24,10,48,25,-18,36,18,10,51,25,-18,38,17,15,52,29,-19,42,21,11,48,29,-16,38,21,12,51,27,-18,40,19,15,47,26,-21,37,22,15,51,25,-22,40,19,19,39,28,-17,31,28,17,38,27,-16,30,27,16,41,27,-16,33,25,17,42,28,-16,34,26,18,39,29,-15,31,29,17,38,28,-15,30,27,15,41,29,-15,33,25,17,41,30,-15,34,27,18,37,28,-16,29,28,19,38,29,-16,30,29,18,38,27,-16,30,27,19,39,28,-16,31,28,20,38,27,-17,31,28,19,37,27,-17,30,27,20,37,28,-17,30,29,18,36,28,-17,29,28,19,36,27,-18,29,28,20,37,28,-18,30,29,18,37,27,-18,30,27,19,38,28,-18,31,28,20,38,26,-20,31,28,19,38,25,-20,30,27,21,37,26,-20,30,28,20,37,25,-20,29,27,18,34,25,-21,26,27,19,34,26,-21,27,28,18,35,25,-21,28,26,19,35,25,-21,28,27,18,36,27,-19,28,28,17,35,26,-19,28,26,18,34,27,-19,27,28,17,34,26,-19,26,27,16,34,27,-18,26,27,17,34,28,-18,27,28,17,35,26,-18,28,26,18,36,27,-19,28,28,17,37,28,-17,29,28,16,37,27,-17,28,26,16,36,29,-16,27,29,15,35,28,-16,27,27,14,40,30,-15,32,26,13,40,29,-15,31,25,15,36,28,-15,27,27,16,36,29,-16,28,28,16,41,28,-17,32,26,14,41,27,-17,31,24,16,37,27,-17,27,26,17,37,28,-17,28,28,15,36,27,-18,26,26,13,36,26,-18,26,25,12,41,26,-18,30,23,13,41,27,-18,31,24,14,36,28,-16,26,27,12,35,27,-16,25,25,10,40,28,-15,30,23,11,40,29,-15,31,25,13,35,26,-17,25,25,14,35,28,-17,25,27,14,36,26,-17,26,25,15,36,27,-17,27,26,16,34,26,-19,26,27,15,34,25,-19,25,25,15,33,27,-19,24,27,14,33,26,-19,24,26,15,33,25,-19,24,26,16,33,27,-19,24,27,15,34,25,-19,25,25,16,34,26,-19,26,27,17,33,25,-21,26,26,17,33,24,-21,25,25,17,32,25,-22,25,27,16,32,24,-22,24,26,14,32,25,-20,22,25,14,32,26,-20,22,27,14,33,24,-21,23,25,15,33,25,-21,23,26,14,34,26,-19,24,26,13,34,24,-19,24,24,13,33,27,-19,23,26,12,33,25,-19,22,25,12,33,25,-18,23,25,13,34,27,-18,24,26,13,34,25,-19,24,24,14,35,26,-19,24,26,13,36,26,-18,26,25,12,36,25,-18,25,24,12,35,27,-17,25,26,11,35,26,-17,24,24,10,40,28,-16,30,24,9,40,26,-16,29,22,10,36,26,-16,25,24,11,36,27,-16,26,25,11,41,27,-18,30,24,10,40,25,-18,29,22,12,36,25,-18,25,23,13,37,26,-18,26,25,12,33,25,-18,23,25,13,34,25,-19,24,24,14,34,26,-19,24,26,13,33,27,-18,23,26,11,35,26,-17,25,24,12,36,25,-18,25,24,13,36,26,-18,26,25,12,36,27,-17,25,26,14,35,28,-16,26,27,15,36,27,-17,27,26,13,36,26,-17,26,25,12,35,27,-16,25,25,15,33,27,-19,24,27,16,34,26,-19,26,27,15,34,25,-19,25,25,14,33,26,-19,24,26,15,36,28,-16,27,27,16,37,27,-17,28,26,17,37,28,-17,29,28,16,36,29,-16,28,28,16,34,27,-19,26,27,17,35,26,-19,28,26,18,35,27,-19,28,28,18,34,28,-19,27,28,19,38,29,-16,30,29,19,39,28,-16,31,28,18,38,27,-16,30,27,17,38,28,-15,30,28,20,37,28,-18,30,29,20,38,27,-18,31,28,19,37,27,-17,30,27,19,36,27,-17,29,28,10,43,23,-17,31,18,12,43,25,-19,31,20,14,43,23,-20,31,18,12,44,21,-18,31,16,11,40,22,-17,28,19,12,40,24,-19,29,20,14,41,23,-20,29,18,12,41,21,-19,28,17,14,46,25,-21,35,21,10,44,27,-17,33,22,12,49,22,-20,36,16,10,48,24,-18,37,18,12,42,21,-18,29,16,10,42,22,-17,30,18,14,42,23,-20,30,18,12,42,24,-19,30,20,13,40,21,-19,27,18,11,39,22,-18,27,19,14,40,23,-20,29,18,12,39,24,-19,29,20,13,37,23,-21,27,21,14,37,23,-22,27,20,12,36,22,-20,25,21,13,37,21,-21,25,20,10,43,22,-17,31,18,12,42,25,-19,31,20,14,43,23,-20,31,18,12,43,21,-18,30,16,14,40,23,-20,29,18,12,40,21,-19,27,17,12,40,24,-19,29,20,11,40,22,-18,27,19,11,47,26,-18,35,20,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000021", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,63,-5,-7,65,-2,7,69,6,-3,70,10,2,75,-10,-7,77,-7,7,80,3,-2,81,6,6,66,0,-6,68,4,6,79,-4,-6,81,0,2,60,4,-2,61,6,3,62,11,0,63,12,8,74,5,-3,76,9,2,70,-10,-8,72,-6,7,73,-3,-7,75,1,3,70,12,-3,64,-5,3,82,5,-2,77,-10,0,67,2,0,83,-3,0,60,5,2,63,12,3,76,9,-3,71,-10,8,72,5,-3,74,8,2,67,-8,-8,68,-4,7,69,-1,-7,71,3,3,74,9,-3,67,-7,28,45,7,-30,36,8,29,48,4,-31,39,6,27,52,3,-31,44,4,23,54,3,-28,46,5,20,53,6,-24,46,7,19,49,8,-23,43,10,21,45,10,-23,38,11,25,43,9,-26,35,10,11,25,-22,-9,24,-23,11,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-4,35,-14,6,28,-13,-5,28,-13,9,25,-17,-7,25,-18,18,36,-17,-19,32,-16,16,31,-14,-16,28,-14,16,41,-18,-18,38,-17,11,43,-17,-14,41,-16,7,42,-14,-10,41,-13,6,37,-11,-7,36,-10,9,32,-9,-8,30,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-3,21,46,-8,-24,41,-6,17,48,-7,-20,44,-5,13,48,-5,-17,44,-3,12,43,-2,-15,40,-1,14,39,0,-15,35,0,19,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,20,-34,15,35,29,16,23,-32,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,35,6,30,46,5,-32,37,8,30,48,10,-33,40,12,27,49,13,-31,43,14,23,48,13,-27,43,15,19,47,10,-23,40,13,19,45,5,-22,37,9,22,44,2,-24,35,6,30,36,7,-33,29,14,26,35,4,-29,27,12,31,38,12,-34,33,18,28,39,16,-31,35,21,23,39,16,-27,35,21,20,37,12,-23,33,19,19,36,7,-22,29,15,22,35,4,-24,27,12,30,29,10,-33,23,19,27,28,6,-29,21,17,31,31,14,-34,27,23,28,32,17,-31,29,26,23,32,18,-27,29,26,20,30,14,-23,27,24,20,29,10,-22,24,20,22,28,7,-25,21,18,30,21,14,-33,18,26,27,20,11,-30,16,25,31,22,17,-34,20,29,28,23,20,-32,22,32,25,23,20,-28,22,32,22,22,18,-25,20,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-30,41,15,29,52,8,-33,43,10,24,55,9,-29,47,11,21,50,12,-25,43,14,24,45,11,-26,37,12,29,46,8,-31,37,10,25,54,4,-29,46,6,20,53,6,-24,46,8,20,46,7,-22,40,8,24,44,5,-26,37,6,28,49,3,-31,40,4,22,49,2,-25,42,3,29,52,11,-32,42,13,26,53,12,-30,44,14,27,55,8,-32,46,11,29,48,11,-31,39,13,30,49,8,-33,40,10,24,50,13,-27,42,15,23,53,11,-27,45,13,26,47,13,-28,39,14,22,47,12,-25,40,14,27,45,10,-29,36,12,29,47,5,-31,38,7,28,51,5,-32,42,7,28,54,5,-32,45,7,25,55,7,-30,47,9,22,54,8,-26,47,10,21,52,9,-25,45,11,20,48,10,-23,41,11,21,45,9,-23,38,11,24,44,8,-26,36,9,28,44,6,-29,36,8,27,52,2,-31,43,4,22,54,4,-27,47,6,18,49,7,-22,43,8,22,44,6,-24,38,7,26,46,3,-29,38,5,25,49,1,-28,41,3,23,52,2,-27,45,4,20,51,3,-24,44,5,20,47,4,-23,41,5,23,46,3,-25,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,2,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,66,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,0,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,55,8,-28,48,1,25,53,9,-27,46,2,23,53,10,-26,46,3,21,55,10,-25,48,5,21,57,10,-26,50,6,23,58,9,-27,51,5,25,58,9,-29,51,3,26,57,8,-29,50,1,22,52,2,-21,49,-1,24,54,1,-23,51,-2,20,52,3,-20,49,0,18,54,4,-19,50,2,18,57,4,-20,53,3,20,59,3,-22,54,2,22,59,2,-23,55,0,24,57,1,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,18,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,18,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,16,52,-4,-13,53,-3,15,54,-3,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,15,52,25,-22,41,19,13,52,25,-20,42,19,12,51,24,-19,42,18,12,50,23,-18,41,17,13,49,23,-19,40,16,15,49,24,-20,39,17,16,50,25,-22,39,17,16,51,26,-22,40,18,26,59,11,-31,50,5,24,59,10,-30,51,5,23,57,9,-28,51,4,23,55,9,-27,49,2,24,54,9,-27,47,1,26,54,10,-29,46,1,27,55,11,-31,47,3,27,57,12,-32,48,4,16,54,21,-23,44,15,18,54,22,-24,43,15,15,53,20,-21,44,14,15,51,19,-20,43,13,16,50,19,-21,42,12,18,50,20,-23,41,12,19,51,21,-24,41,13,19,53,22,-25,42,14,22,58,13,-28,50,8,23,58,14,-29,48,8,20,56,12,-26,49,6,21,54,11,-25,48,5,22,52,11,-25,45,4,24,52,12,-27,44,4,25,53,13,-29,45,5,25,56,14,-30,46,7,23,59,11,-29,51,6,25,59,12,-31,50,6,22,57,10,-27,50,5,22,55,10,-26,49,3,23,53,10,-27,47,2,26,53,10,-29,46,2,27,55,11,-30,46,3,27,57,12,-32,48,4,30,14,15,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,22,4,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,4,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,4,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,12,40,27,-19,30,24,10,40,25,-19,29,22,12,47,23,-21,35,19,14,47,25,-21,36,21,9,40,28,-16,30,24,8,40,26,-16,29,22,9,48,25,-18,36,18,10,48,28,-17,37,20,12,48,29,-17,38,22,10,48,27,-17,37,20,9,40,27,-15,30,22,11,40,29,-15,31,25,16,47,26,-22,37,23,13,47,25,-21,36,20,12,40,26,-18,29,23,14,40,28,-19,30,26,16,41,28,-18,31,27,14,40,27,-18,30,25,14,47,25,-22,36,22,16,48,27,-21,38,24,14,40,30,-16,32,27,12,40,29,-15,31,24,11,48,29,-17,38,21,13,48,30,-17,39,23,15,48,30,-18,39,25,12,48,30,-17,39,22,14,41,29,-15,33,25,16,41,30,-15,34,27,16,49,28,-21,38,25,14,49,26,-21,37,23,15,41,26,-17,32,25,17,42,28,-17,33,27,17,48,28,-21,39,24,12,47,23,-21,35,19,12,50,23,-21,38,17,16,51,27,-21,41,21,15,49,30,-19,40,24,9,48,25,-18,36,18,10,51,25,-18,38,17,14,52,29,-19,42,21,11,48,29,-17,38,21,11,51,27,-18,40,19,15,47,26,-22,37,22,15,50,25,-22,40,19,18,39,28,-17,31,29,17,38,27,-17,30,27,15,41,27,-17,33,25,17,42,28,-17,34,27,18,38,29,-16,31,29,16,38,29,-16,30,28,15,41,29,-15,32,26,16,41,30,-15,33,27,17,37,28,-16,29,28,18,38,29,-17,30,29,17,38,27,-16,30,27,18,39,28,-17,31,28,19,38,27,-18,31,28,18,37,27,-18,30,27,19,37,28,-18,30,29,18,36,28,-18,29,28,18,36,27,-18,29,28,20,36,28,-19,30,29,18,37,27,-18,30,27,19,38,28,-18,31,28,20,38,26,-20,31,28,19,37,25,-20,30,27,20,37,26,-20,30,28,19,36,25,-20,29,27,18,33,25,-22,26,27,19,34,26,-22,27,28,17,35,25,-21,27,26,18,35,26,-21,28,27,17,35,27,-19,28,28,16,35,26,-19,27,26,17,34,27,-20,27,29,16,33,26,-19,26,27,16,34,27,-19,26,27,17,34,28,-19,27,29,16,35,26,-19,27,26,17,35,27,-19,28,28,16,37,28,-17,29,28,15,37,27,-17,28,26,16,36,29,-17,27,29,14,35,28,-17,26,27,14,40,30,-16,32,26,12,40,29,-15,31,25,14,36,28,-16,27,27,15,36,29,-16,28,28,15,41,28,-18,32,26,14,41,27,-18,31,24,15,37,27,-18,27,26,16,37,28,-18,28,28,14,36,27,-18,26,27,13,36,26,-18,26,25,11,41,26,-18,30,23,13,41,28,-18,31,25,13,35,28,-16,26,27,12,35,27,-16,25,25,10,40,28,-15,30,23,11,40,29,-15,30,25,12,34,27,-17,24,25,13,35,28,-17,25,27,13,36,26,-18,26,25,14,36,27,-18,27,26,15,34,26,-20,26,27,14,34,25,-20,25,25,15,33,27,-19,24,27,14,33,26,-19,24,26,14,32,25,-20,24,26,15,33,27,-20,24,27,15,34,25,-20,25,25,16,34,26,-20,26,27,17,33,25,-22,26,26,16,33,24,-22,25,25,17,32,25,-22,25,27,16,31,24,-22,24,26,13,31,25,-21,22,25,14,31,26,-21,22,27,13,32,25,-21,23,25,14,32,25,-21,23,26,13,34,26,-20,24,26,12,34,25,-20,24,24,12,33,27,-19,23,26,11,33,25,-19,22,25,11,33,26,-19,23,25,12,34,27,-19,23,26,12,34,25,-20,24,24,13,34,26,-20,24,26,12,36,26,-19,26,25,11,36,25,-19,25,24,11,35,27,-17,25,26,10,35,26,-17,24,24,9,40,28,-16,30,24,8,40,26,-16,29,22,10,36,26,-17,25,24,11,36,27,-17,26,26,11,41,27,-18,30,24,9,40,25,-18,29,22,11,36,25,-19,25,24,12,37,26,-19,26,25,11,33,26,-19,23,25,12,34,25,-20,24,24,13,34,26,-20,24,26,12,33,27,-19,23,26,10,35,26,-17,24,24,11,36,25,-19,25,24,12,36,26,-19,26,25,11,36,27,-17,25,26,13,35,28,-17,26,27,14,36,27,-18,26,27,13,36,26,-18,26,25,12,35,27,-17,25,25,15,33,27,-20,24,27,16,34,26,-20,26,27,14,34,25,-20,25,25,14,33,26,-19,24,26,14,36,28,-16,27,27,15,37,27,-17,28,26,16,37,28,-17,28,28,16,36,29,-16,28,29,16,34,27,-19,26,27,16,35,26,-19,27,26,17,35,27,-19,28,28,17,34,28,-19,27,29,18,38,29,-16,30,29,18,39,28,-17,31,29,17,38,27,-16,30,27,17,37,28,-16,29,28,19,36,28,-18,30,29,19,37,28,-18,31,28,18,37,27,-18,30,27,18,36,28,-18,29,28,10,43,23,-17,31,18,11,43,25,-19,31,20,13,43,23,-21,31,18,11,43,21,-18,31,16,10,40,22,-18,28,19,12,40,24,-19,29,20,13,41,23,-21,29,18,12,40,21,-19,28,17,14,45,25,-21,35,21,10,44,27,-17,33,22,12,49,22,-20,36,16,10,48,24,-18,37,18,12,42,21,-19,29,17,10,42,22,-17,30,18,13,42,23,-21,30,18,11,42,24,-19,30,20,12,40,21,-20,27,18,10,39,22,-18,27,19,13,40,23,-21,29,18,12,39,24,-20,29,20,12,37,23,-21,27,21,14,37,23,-22,27,20,12,36,22,-21,25,21,13,37,21,-22,25,20,10,42,22,-17,30,18,11,42,25,-19,31,20,13,43,23,-21,31,18,11,43,21,-18,30,16,13,40,23,-21,29,18,12,40,21,-19,27,17,12,40,24,-19,29,20,10,40,22,-18,27,19,10,47,26,-19,35,20,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000022", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,63,-5,-7,65,-2,7,69,6,-3,70,10,2,75,-10,-7,77,-7,7,80,3,-2,81,6,6,66,0,-6,68,4,6,79,-4,-6,81,0,2,60,4,-2,61,6,3,62,11,0,63,12,8,74,5,-3,76,9,2,70,-10,-8,72,-6,7,73,-3,-7,75,1,3,70,12,-3,64,-5,3,82,5,-2,77,-10,0,67,2,0,83,-3,0,60,5,2,63,12,3,76,9,-3,71,-10,8,72,5,-3,74,8,2,67,-8,-8,68,-4,7,69,-1,-7,71,3,3,74,9,-3,67,-7,28,45,7,-30,36,8,28,48,4,-31,39,6,26,52,3,-31,44,4,23,54,3,-28,46,5,20,53,6,-25,46,7,19,49,9,-23,43,10,21,45,10,-23,38,11,25,43,9,-26,35,10,11,25,-22,-9,24,-23,12,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-4,35,-14,6,28,-13,-5,28,-13,9,25,-17,-7,25,-18,18,36,-16,-19,32,-16,16,31,-14,-16,28,-14,16,41,-18,-18,38,-17,11,43,-17,-14,41,-16,7,42,-14,-10,41,-13,6,37,-11,-7,36,-10,9,32,-9,-8,30,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-3,20,46,-8,-24,41,-6,16,48,-7,-20,44,-5,13,47,-4,-17,44,-3,12,43,-2,-15,40,-1,14,39,0,-15,35,0,18,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,21,-34,15,35,29,16,23,-32,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,35,6,29,46,5,-32,37,8,30,48,10,-33,40,12,27,49,13,-31,43,14,23,48,13,-27,43,15,19,47,10,-23,40,13,19,45,5,-22,37,9,21,45,2,-24,35,6,30,37,8,-33,29,14,26,35,4,-29,27,12,30,38,12,-34,33,18,27,39,16,-31,35,21,23,39,16,-27,35,21,19,37,12,-23,33,19,19,36,8,-22,29,15,22,35,4,-24,27,12,30,29,10,-33,23,19,27,28,7,-29,21,17,31,31,14,-34,27,23,28,32,18,-31,29,26,23,32,18,-27,29,26,20,30,15,-23,27,24,19,29,10,-22,24,20,22,28,7,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,16,25,30,22,18,-34,20,29,28,23,20,-32,22,32,25,23,20,-28,22,32,22,22,18,-25,20,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-30,41,15,29,53,8,-33,43,10,24,55,9,-29,47,11,21,50,12,-25,43,14,24,45,11,-26,37,12,29,46,9,-31,37,10,24,54,4,-30,46,6,19,53,6,-24,46,8,19,46,7,-22,40,8,24,44,5,-26,37,6,27,49,3,-31,40,4,21,49,2,-25,42,3,29,52,11,-32,42,13,26,53,12,-30,44,14,27,55,9,-32,46,11,28,48,11,-31,39,13,30,49,8,-33,40,10,24,50,13,-27,42,15,22,53,12,-27,45,13,26,47,13,-28,39,14,22,47,12,-25,40,14,27,45,10,-29,36,12,29,47,6,-31,38,7,28,51,6,-32,42,7,27,54,5,-32,45,7,24,55,7,-30,47,9,21,54,8,-27,47,10,21,52,9,-25,44,10,20,48,10,-23,41,11,21,45,9,-23,38,11,24,44,8,-26,36,9,27,44,6,-29,36,8,26,52,3,-31,43,4,22,54,5,-27,47,6,18,49,7,-22,43,8,21,44,6,-24,38,7,26,46,3,-29,38,5,24,49,2,-28,41,3,23,52,2,-27,44,4,20,51,4,-24,44,5,20,47,4,-23,41,5,23,46,3,-25,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,2,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,66,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,0,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,54,8,-28,48,1,24,53,9,-27,46,2,22,53,10,-26,46,3,21,54,10,-25,48,5,21,57,10,-26,50,6,22,58,10,-27,51,5,24,58,9,-29,51,3,26,57,8,-29,50,1,22,52,2,-21,49,-1,24,54,2,-23,51,-2,19,52,3,-20,49,0,18,54,4,-19,50,2,18,57,4,-20,53,3,19,58,3,-22,54,2,22,58,2,-23,55,0,24,57,1,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,18,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,17,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,16,52,-4,-13,53,-3,15,54,-4,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,14,52,26,-22,41,19,13,52,25,-20,42,19,12,51,24,-19,42,18,12,50,23,-18,41,17,13,49,23,-19,40,16,14,49,24,-20,39,17,15,50,25,-22,39,17,15,51,26,-22,40,18,26,58,12,-31,50,5,24,59,10,-30,51,5,22,57,9,-28,51,4,23,55,9,-27,49,2,24,53,9,-27,47,1,26,54,10,-29,46,1,27,55,11,-31,47,3,27,57,12,-32,48,4,16,54,21,-23,44,15,17,54,22,-24,43,15,15,53,20,-21,44,14,15,51,19,-21,43,13,16,50,19,-21,42,12,18,50,20,-23,41,12,19,51,21,-24,41,13,18,52,22,-25,42,15,21,58,13,-28,50,8,23,57,14,-29,48,8,20,56,12,-26,49,6,20,54,11,-25,48,5,22,52,11,-25,45,4,24,52,12,-27,44,4,25,53,14,-29,45,5,25,56,15,-30,46,7,23,58,11,-29,51,6,25,58,12,-31,50,6,21,57,10,-27,50,5,22,55,10,-26,49,3,23,53,10,-26,47,2,25,53,11,-29,46,2,26,55,11,-30,46,3,27,57,12,-32,48,4,30,14,15,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,22,4,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,4,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,4,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,11,39,27,-19,30,24,10,39,25,-19,29,22,12,46,23,-21,35,19,14,46,25,-22,36,21,9,40,28,-16,30,24,8,40,26,-17,29,22,9,47,25,-18,36,18,10,48,28,-17,37,20,11,48,29,-17,38,22,10,48,27,-17,37,20,9,40,28,-16,30,23,11,40,30,-16,31,25,15,47,26,-22,37,23,13,47,25,-21,36,20,12,39,26,-19,29,23,13,40,28,-19,30,26,15,40,28,-18,31,27,14,40,27,-18,30,25,14,47,25,-22,36,22,15,48,27,-21,38,24,14,40,30,-16,32,27,11,40,29,-15,31,24,10,48,29,-17,38,21,12,48,30,-18,39,23,15,48,30,-19,39,25,12,47,30,-18,39,22,14,40,29,-15,33,25,16,41,30,-15,34,27,16,48,28,-21,38,25,14,48,26,-21,37,23,15,41,27,-17,31,25,17,42,28,-17,33,27,16,48,29,-21,39,24,12,47,23,-21,35,19,12,50,23,-21,38,17,15,51,27,-22,41,21,14,49,30,-19,40,24,9,48,25,-18,36,18,10,50,25,-18,38,17,14,51,29,-19,42,21,10,48,29,-17,38,21,11,51,27,-18,40,19,15,46,26,-22,37,22,14,50,25,-22,40,19,18,39,28,-17,31,29,16,38,27,-17,30,27,15,41,27,-17,33,25,16,42,28,-17,34,27,17,38,30,-16,31,29,16,37,29,-16,30,28,14,40,29,-15,32,26,16,41,30,-15,33,27,16,37,29,-17,29,28,18,37,29,-17,30,29,17,37,28,-17,30,27,18,38,28,-17,31,29,19,37,28,-18,31,28,18,36,27,-18,30,27,18,36,29,-18,30,29,17,36,28,-18,29,28,18,35,28,-19,29,28,19,36,28,-19,30,29,17,37,27,-18,30,27,18,37,28,-19,31,28,19,37,26,-20,31,28,18,36,26,-20,30,27,20,36,27,-21,30,28,19,36,26,-20,29,27,17,33,25,-22,27,27,18,33,26,-22,27,28,17,34,25,-21,28,26,18,34,26,-21,28,27,17,35,27,-20,28,28,15,34,26,-19,28,26,17,33,28,-20,27,28,15,33,27,-20,26,27,15,33,27,-19,26,27,16,34,28,-19,27,29,16,34,26,-19,28,26,17,35,27,-19,28,28,16,36,28,-17,29,28,14,36,27,-17,28,26,15,35,29,-17,27,29,14,35,28,-17,26,27,13,40,30,-16,31,26,12,39,29,-16,31,25,13,36,28,-16,27,27,15,36,29,-16,28,28,15,41,28,-18,32,26,13,40,27,-18,31,24,14,36,27,-18,27,27,16,37,28,-18,28,28,14,36,27,-19,26,27,12,36,26,-18,25,25,11,40,26,-18,30,23,12,41,28,-18,31,25,12,35,29,-17,26,27,11,35,27,-17,25,25,9,39,28,-16,30,23,11,40,29,-16,30,25,12,34,27,-17,24,25,13,34,28,-17,25,27,12,35,26,-18,26,25,14,35,27,-18,27,27,15,34,27,-20,26,27,14,33,25,-20,25,25,14,33,27,-19,24,27,13,32,26,-19,24,26,13,32,26,-20,24,26,14,32,27,-20,24,27,14,33,25,-20,25,25,15,33,26,-20,26,27,16,32,25,-22,26,26,15,32,24,-22,25,25,16,31,26,-23,25,27,15,31,25,-23,24,26,10,30,27,-21,22,25,11,30,28,-22,22,27,11,31,26,-22,23,25,12,31,27,-22,23,26,11,33,27,-20,24,26,11,32,26,-20,24,24,10,32,28,-20,23,26,9,32,27,-20,22,25,9,33,27,-19,23,25,10,33,28,-19,23,26,10,33,26,-20,24,24,11,33,27,-20,24,26,11,35,27,-19,26,25,10,35,26,-19,25,24,10,35,28,-18,25,26,9,34,27,-18,24,24,9,40,28,-16,30,24,8,40,26,-17,29,22,8,35,27,-17,25,24,10,36,28,-17,26,26,10,40,27,-18,30,24,9,40,25,-18,29,22,10,36,26,-19,25,24,11,36,27,-19,26,25,9,32,27,-19,23,25,10,33,26,-20,24,24,11,33,27,-20,24,26,10,33,28,-19,23,26,9,35,27,-17,24,24,10,35,26,-19,25,24,11,35,27,-19,26,25,10,35,28,-17,25,26,12,35,28,-17,25,27,14,36,27,-18,26,27,12,35,26,-18,26,25,11,34,27,-17,25,25,14,32,27,-20,24,27,15,34,26,-20,26,27,14,33,25,-20,25,25,13,32,26,-20,24,26,14,35,28,-17,27,27,14,36,27,-18,27,26,16,36,28,-18,28,28,15,36,29,-17,27,29,15,33,27,-19,26,27,15,34,26,-19,28,26,17,35,27,-19,28,28,16,33,28,-20,27,28,17,38,29,-16,30,29,18,38,28,-17,31,29,17,38,28,-17,30,27,16,37,29,-16,29,28,19,36,29,-19,30,29,19,37,28,-18,31,28,17,36,27,-18,30,27,18,35,28,-18,29,28,9,43,23,-17,31,18,11,42,25,-20,31,20,13,43,23,-21,31,18,11,43,21,-19,31,16,10,40,22,-18,28,19,11,40,24,-20,29,20,13,40,23,-21,29,18,11,40,21,-19,28,17,13,45,25,-22,35,22,10,44,27,-17,33,22,12,48,22,-20,36,16,9,48,24,-18,36,18,11,42,21,-19,29,17,9,42,22,-18,30,18,13,42,23,-21,30,18,11,41,25,-20,30,20,12,39,21,-20,27,18,10,39,22,-19,27,19,13,40,23,-21,28,18,11,39,24,-20,29,20,12,36,23,-22,27,21,13,37,23,-22,27,20,11,36,22,-21,25,21,12,36,21,-22,25,20,9,42,23,-17,30,18,11,42,25,-19,31,20,13,42,23,-21,30,18,11,42,21,-19,30,16,13,40,23,-21,29,18,12,40,21,-20,27,17,11,40,24,-20,29,20,10,39,22,-18,27,19,10,46,26,-19,35,20,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000023", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,64,-5,-7,65,-1,7,69,6,-3,70,10,2,76,-10,-7,77,-6,7,80,2,-2,81,6,6,66,0,-6,68,4,6,79,-4,-6,81,0,2,60,4,-2,61,6,4,62,11,1,63,12,8,74,4,-3,76,9,2,71,-10,-8,72,-6,7,73,-3,-8,75,1,3,70,12,-3,64,-5,2,82,5,-3,77,-10,0,67,2,0,83,-3,0,60,5,2,63,12,3,76,9,-4,71,-9,8,72,4,-3,74,8,2,67,-8,-8,68,-4,7,69,-1,-7,71,3,3,74,9,-3,67,-7,27,45,7,-30,36,8,28,48,4,-31,39,6,26,52,3,-31,44,4,22,54,3,-28,46,5,20,53,6,-25,46,7,19,49,9,-23,43,10,21,45,10,-23,38,11,24,43,9,-26,35,10,11,25,-22,-9,24,-23,12,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-7,25,-18,18,36,-16,-19,32,-16,16,31,-14,-16,28,-14,15,41,-18,-18,38,-17,11,43,-17,-14,41,-16,7,42,-14,-10,41,-13,6,37,-11,-7,36,-10,9,32,-9,-8,30,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-3,20,46,-8,-24,41,-6,16,48,-7,-21,44,-5,13,47,-4,-17,44,-3,12,43,-2,-15,40,-1,14,39,0,-15,35,0,18,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,21,-34,15,35,29,16,23,-32,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,35,6,29,46,5,-33,37,8,30,48,10,-34,40,12,27,49,13,-31,43,14,22,48,13,-27,43,15,19,47,10,-23,40,13,18,45,5,-22,37,9,21,45,2,-24,35,6,30,37,8,-33,29,14,26,35,4,-29,27,12,30,38,12,-34,32,18,27,39,16,-31,35,21,23,39,16,-27,35,21,19,37,12,-23,33,19,19,36,8,-22,29,15,22,35,4,-24,27,12,30,29,10,-33,23,19,27,28,7,-29,21,17,30,31,14,-34,27,23,28,32,18,-32,29,25,23,32,18,-27,29,26,20,30,15,-23,27,24,19,29,10,-22,24,20,22,28,7,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,16,25,30,22,18,-34,20,29,28,23,20,-32,22,32,24,23,20,-28,22,32,22,22,18,-25,20,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-30,41,15,29,53,8,-33,43,10,24,55,9,-29,47,11,21,50,12,-25,43,13,24,45,11,-26,37,12,29,46,9,-31,37,10,24,54,4,-30,46,5,19,53,6,-24,46,8,19,46,7,-22,40,8,24,44,5,-26,37,6,27,49,3,-31,40,4,21,49,2,-25,42,3,28,52,11,-33,42,13,26,53,12,-30,44,14,27,55,9,-32,46,10,28,48,11,-31,39,13,30,49,8,-33,40,10,24,50,13,-28,42,15,22,53,12,-27,45,13,25,47,13,-28,39,14,22,47,12,-25,40,14,27,45,10,-29,36,12,28,47,6,-31,38,7,28,51,6,-32,42,7,27,54,6,-32,45,7,24,55,7,-30,47,9,21,54,8,-27,47,10,20,52,9,-25,44,10,20,48,10,-23,41,11,21,45,9,-24,38,11,24,44,8,-26,36,9,27,44,7,-29,36,8,26,52,3,-31,43,4,21,54,5,-27,47,6,18,49,7,-22,43,8,21,44,6,-24,38,7,26,46,3,-29,38,5,24,49,2,-28,41,3,23,52,2,-27,44,4,20,51,4,-24,44,5,20,47,4,-23,41,5,22,46,3,-25,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,1,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,66,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,-1,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,54,8,-28,48,1,24,53,9,-27,46,2,22,53,10,-26,46,3,21,54,10,-25,48,5,21,56,10,-26,50,6,22,58,10,-27,51,5,24,58,9,-29,51,3,26,56,8,-29,50,1,22,52,2,-21,49,-1,24,54,2,-23,51,-2,19,52,3,-20,49,0,17,54,4,-19,50,2,18,56,4,-20,53,3,19,58,3,-22,54,2,22,58,2,-23,55,0,24,56,2,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,17,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,17,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,16,52,-4,-13,53,-3,15,54,-4,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,14,52,26,-22,41,19,12,52,25,-20,42,19,11,51,24,-19,42,18,11,50,23,-18,41,17,12,49,23,-19,40,16,14,49,24,-20,39,17,15,50,25,-22,39,17,15,51,26,-22,40,18,25,58,12,-31,50,5,24,59,11,-30,51,5,22,57,9,-28,51,4,22,55,9,-27,49,2,24,53,9,-27,47,1,26,53,10,-29,46,1,27,55,11,-31,47,3,27,57,12,-32,48,4,15,54,21,-23,44,15,17,54,22,-24,43,15,14,53,20,-21,44,14,14,51,19,-21,43,13,16,50,19,-21,42,12,17,50,20,-23,41,12,18,51,22,-24,41,13,18,52,22,-25,42,15,21,58,13,-28,50,8,23,57,14,-29,48,8,20,56,12,-26,49,6,20,54,11,-25,48,5,22,52,11,-25,45,4,24,51,12,-27,44,4,25,53,14,-29,45,5,24,55,15,-30,46,7,23,58,11,-29,51,6,25,58,12,-31,50,6,21,57,10,-27,50,5,22,55,10,-26,49,3,23,53,10,-26,47,2,25,53,11,-29,46,2,26,54,11,-30,46,3,26,56,12,-32,48,4,30,14,15,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,22,4,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,4,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,4,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,11,40,27,-20,30,25,9,40,25,-19,29,22,11,46,23,-21,35,19,13,46,26,-22,36,21,8,40,29,-17,30,24,7,40,26,-17,29,22,8,47,25,-18,35,18,9,48,28,-17,37,20,11,48,29,-17,38,22,9,48,27,-17,37,20,8,40,28,-16,30,23,10,40,30,-16,31,25,15,47,26,-22,37,23,12,47,25,-21,36,20,11,40,26,-19,29,23,13,40,28,-19,30,26,14,40,29,-19,31,27,13,40,27,-19,30,25,13,47,25,-22,36,22,15,48,27,-21,38,24,13,40,31,-16,32,27,11,40,29,-16,31,24,10,48,29,-17,38,21,12,48,30,-18,39,23,14,48,30,-19,39,25,11,48,30,-18,39,22,13,41,29,-15,32,25,15,41,30,-16,34,27,15,48,28,-21,38,25,13,48,26,-21,37,23,14,41,27,-18,31,25,16,42,29,-17,33,27,16,48,29,-21,39,24,11,47,23,-21,35,19,11,50,23,-21,38,17,15,51,27,-22,41,21,14,49,30,-19,40,24,8,48,25,-18,36,18,9,50,25,-19,38,17,13,51,28,-19,42,21,10,48,29,-17,38,21,10,51,27,-18,40,19,14,46,26,-22,37,22,14,50,25,-22,40,19,17,38,29,-18,31,29,16,38,28,-18,30,27,14,41,28,-17,32,25,16,42,28,-17,33,27,16,38,30,-16,31,29,15,37,29,-16,30,28,14,41,29,-16,32,26,15,41,30,-16,33,27,15,37,29,-17,29,28,17,37,30,-17,30,29,16,37,28,-17,30,27,17,38,29,-17,31,29,18,37,29,-18,31,28,17,36,28,-18,30,27,17,36,30,-19,30,29,16,36,29,-18,29,28,17,35,29,-19,29,28,18,36,29,-19,30,29,17,36,28,-19,30,27,18,37,29,-19,31,28,19,36,27,-21,31,28,18,36,27,-21,30,27,19,35,28,-21,30,28,18,35,27,-21,30,27,15,32,27,-22,27,26,16,32,28,-22,28,27,16,33,26,-21,28,26,17,33,27,-22,29,27,16,34,28,-20,29,28,14,34,27,-20,28,26,15,33,29,-20,27,28,14,33,28,-20,27,27,14,33,28,-20,26,27,15,34,29,-20,27,28,14,34,27,-19,28,26,16,34,28,-20,29,28,15,36,29,-18,29,28,13,36,28,-17,28,26,14,35,30,-18,27,29,13,35,29,-18,26,27,13,40,30,-16,31,27,11,40,29,-16,31,25,12,36,29,-17,27,27,14,36,30,-17,28,29,14,40,28,-18,32,26,13,40,27,-18,31,24,13,36,28,-18,27,27,15,36,29,-19,28,28,12,35,29,-19,26,27,11,35,27,-19,25,25,10,40,26,-18,30,23,12,40,28,-19,31,25,11,35,30,-17,26,27,9,35,28,-17,25,25,9,40,28,-16,29,23,10,40,30,-16,30,25,10,34,28,-18,24,26,11,34,30,-18,25,27,11,34,27,-18,26,25,12,35,29,-18,27,27,12,33,29,-20,26,27,11,32,27,-20,25,25,11,32,30,-20,25,27,10,32,28,-20,24,26,10,31,28,-21,24,26,11,32,30,-21,24,27,11,32,27,-20,25,25,13,32,29,-20,26,27,13,30,28,-22,26,26,12,30,27,-22,26,25,12,29,29,-23,25,27,11,29,28,-23,25,25,8,30,29,-22,22,25,8,31,30,-22,23,26,9,31,28,-22,23,25,9,31,29,-22,24,26,9,33,29,-21,24,26,8,32,28,-21,24,24,8,33,30,-20,23,26,7,32,28,-20,23,25,7,33,28,-20,23,25,8,33,30,-20,24,26,8,33,27,-20,24,24,9,33,29,-21,25,26,10,35,28,-19,26,25,8,35,27,-19,25,24,8,35,29,-18,25,26,7,35,28,-18,24,24,8,40,28,-17,30,24,7,40,26,-17,29,22,7,36,28,-18,25,24,8,36,29,-18,26,26,10,40,27,-19,30,24,8,40,25,-19,29,22,8,35,27,-19,25,24,10,36,28,-19,26,25,7,33,28,-20,23,25,8,33,27,-21,24,24,9,33,29,-21,24,26,8,33,30,-20,23,26,7,35,28,-18,24,24,8,35,27,-19,25,24,10,35,28,-19,26,26,8,36,29,-18,25,26,11,35,30,-17,25,27,12,35,29,-18,26,27,11,35,27,-18,26,25,9,34,28,-17,25,25,11,32,30,-21,24,27,12,32,29,-20,26,27,11,32,27,-20,25,25,10,32,28,-20,24,26,12,35,29,-17,27,27,13,36,28,-18,27,27,15,36,29,-18,28,28,14,36,30,-17,27,29,14,33,28,-20,26,27,14,34,27,-20,28,26,16,34,28,-20,29,28,15,33,29,-20,27,28,16,38,30,-17,30,29,17,38,29,-17,31,29,16,37,28,-17,30,28,15,37,29,-16,29,28,18,36,30,-19,30,29,18,37,29,-19,31,28,17,36,28,-18,30,27,17,35,29,-19,29,28,9,43,23,-18,31,18,10,43,25,-20,31,20,12,43,23,-21,31,18,10,43,21,-19,31,16,9,40,22,-18,28,19,10,40,24,-20,29,20,12,40,23,-21,29,18,11,40,21,-19,28,17,13,45,25,-22,35,21,9,44,27,-18,33,22,11,48,22,-20,36,16,9,48,24,-19,36,18,10,42,21,-19,29,17,9,42,23,-18,30,18,12,42,23,-21,30,18,10,41,25,-20,30,20,11,39,21,-20,27,18,9,39,23,-19,27,19,12,40,23,-21,29,18,11,39,24,-20,29,20,11,36,24,-22,27,21,12,37,23,-23,27,20,10,36,23,-21,25,21,12,36,22,-22,25,20,9,42,23,-18,30,18,10,42,25,-20,31,20,12,42,23,-21,30,18,10,42,21,-19,30,16,12,40,23,-21,29,18,11,40,21,-20,27,17,10,40,24,-20,29,20,9,39,23,-19,27,19,9,46,26,-19,35,20,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000024", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,64,-5,-7,65,-1,7,69,6,-2,70,10,1,76,-10,-8,77,-6,7,80,2,-2,81,6,6,66,0,-6,68,5,5,79,-5,-6,81,0,2,60,4,-2,61,6,4,62,11,1,63,12,8,74,4,-3,76,9,1,71,-10,-9,72,-5,7,73,-3,-8,75,2,4,70,12,-3,64,-5,2,82,5,-3,77,-10,0,67,2,0,83,-3,0,60,5,3,63,12,3,76,9,-4,71,-9,8,72,4,-3,74,9,2,67,-8,-9,68,-4,7,69,-1,-7,71,3,3,74,9,-4,67,-7,27,45,7,-30,36,8,28,48,4,-32,39,6,26,52,3,-31,44,4,22,54,4,-28,46,5,19,53,6,-25,46,7,19,49,9,-23,43,10,21,45,10,-24,38,11,24,43,9,-26,35,10,11,25,-22,-9,24,-23,12,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-7,25,-18,18,36,-16,-19,32,-16,16,31,-14,-16,28,-14,15,41,-17,-18,37,-17,11,43,-17,-14,41,-16,7,42,-14,-10,41,-13,6,37,-11,-7,36,-10,9,32,-9,-8,30,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-3,20,46,-8,-24,41,-6,16,48,-7,-21,44,-6,13,47,-4,-17,44,-3,12,43,-2,-15,40,-1,14,38,0,-15,35,0,18,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,21,-34,15,35,29,16,23,-32,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,34,6,29,46,5,-33,37,8,30,48,10,-34,40,11,27,49,13,-31,43,14,22,48,13,-27,43,15,19,47,10,-23,40,13,18,45,5,-22,37,9,21,45,2,-24,35,6,30,37,8,-33,29,14,26,35,4,-29,26,12,30,38,12,-34,32,18,27,39,16,-32,35,21,23,39,16,-27,35,21,19,37,12,-23,33,19,19,36,8,-22,29,15,21,35,4,-24,27,12,30,29,10,-33,23,19,27,28,7,-29,21,17,30,31,14,-34,27,23,28,32,18,-32,29,25,23,31,18,-27,29,26,20,30,15,-23,27,24,19,29,10,-22,24,20,22,28,7,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,15,25,30,22,18,-34,20,29,28,23,20,-32,22,31,24,23,20,-28,22,32,22,22,18,-25,20,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-31,41,14,29,53,8,-34,43,9,24,55,10,-29,47,11,21,50,12,-25,43,13,24,45,11,-26,37,12,29,46,9,-31,37,10,24,54,4,-30,46,5,19,53,6,-24,46,8,19,46,7,-22,40,8,24,44,5,-26,36,6,27,49,3,-31,40,4,21,49,2,-25,42,3,28,52,11,-33,42,13,25,53,12,-30,44,14,26,55,9,-32,46,10,28,48,12,-32,38,13,30,50,9,-33,40,10,24,50,14,-28,42,15,22,53,12,-27,45,13,25,47,13,-28,38,14,22,47,12,-25,40,14,27,45,10,-29,36,11,28,47,6,-32,38,7,28,51,6,-32,42,7,27,54,6,-32,45,7,24,55,7,-30,47,8,21,54,8,-27,47,10,20,52,9,-25,44,10,20,48,10,-23,41,11,21,45,10,-24,38,10,24,44,8,-26,36,9,27,44,7,-30,36,8,26,52,3,-31,43,4,21,54,5,-27,47,6,18,49,7,-22,43,8,21,44,6,-24,38,7,26,46,3,-29,38,4,24,49,2,-28,41,3,23,52,2,-28,44,4,20,51,4,-24,44,5,20,47,4,-23,41,5,22,46,3,-26,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,1,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,65,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,-1,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,54,8,-28,48,1,24,53,9,-27,46,2,22,53,10,-26,46,3,21,54,10,-25,48,5,21,56,10,-26,50,6,22,58,10,-27,51,5,24,58,9,-29,51,3,26,56,8,-29,50,1,22,52,2,-21,49,-1,24,54,2,-23,51,-2,19,52,3,-20,49,0,17,54,4,-19,50,2,18,56,4,-20,53,3,19,58,3,-22,54,2,22,58,2,-23,55,0,24,56,2,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,17,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,17,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,16,52,-4,-13,53,-3,15,54,-4,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,14,52,26,-22,41,19,12,52,25,-21,42,19,11,51,24,-19,42,18,11,50,23,-18,41,17,12,49,23,-19,40,16,14,49,24,-20,39,17,15,50,25,-22,39,17,15,51,26,-22,40,18,25,58,12,-31,50,5,24,59,11,-30,51,5,22,57,9,-28,51,4,22,55,9,-27,49,2,24,53,9,-27,47,1,26,53,10,-29,46,1,27,55,11,-31,47,3,27,57,12,-32,48,4,15,54,21,-23,44,15,17,54,22,-24,43,15,14,53,20,-21,44,14,14,51,19,-21,43,13,16,50,19,-21,42,12,17,50,20,-23,41,12,18,51,22,-24,41,13,18,52,22,-25,42,15,21,58,13,-28,50,8,23,57,14,-29,48,8,20,56,12,-26,49,6,20,54,11,-25,48,5,22,52,11,-25,45,4,24,51,12,-27,44,4,25,53,14,-29,45,5,24,55,15,-30,46,7,23,58,11,-29,51,6,25,58,12,-31,50,6,21,57,10,-27,50,5,22,55,10,-26,49,3,23,53,10,-26,47,2,25,53,11,-29,46,2,26,54,11,-30,46,3,26,56,12,-32,48,4,30,14,15,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,22,4,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,4,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,4,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,9,40,29,-20,30,25,7,40,27,-20,29,22,11,46,24,-22,35,19,13,46,26,-22,36,21,7,42,30,-17,30,24,5,41,28,-17,29,22,8,48,26,-18,35,19,9,48,28,-17,37,21,10,48,29,-17,38,22,9,48,28,-17,37,20,7,41,29,-16,30,23,8,41,32,-16,30,25,14,46,27,-22,37,23,12,47,25,-21,36,20,9,40,28,-19,29,23,11,40,30,-20,30,26,13,41,30,-19,31,27,11,40,29,-19,30,25,13,47,26,-22,36,22,14,47,28,-22,38,24,11,41,32,-17,32,27,9,41,31,-16,31,24,9,49,29,-17,38,21,12,49,30,-18,38,23,14,48,31,-19,39,25,11,48,30,-18,39,22,11,41,31,-16,32,25,14,42,32,-16,33,27,15,48,29,-21,38,25,13,48,27,-22,37,23,13,41,29,-18,31,26,14,42,30,-18,33,28,15,48,29,-22,39,24,11,46,24,-22,35,19,11,49,23,-21,38,17,15,50,27,-22,41,21,14,49,31,-19,40,24,8,48,25,-18,36,18,9,50,25,-19,38,17,13,52,28,-19,42,21,10,49,29,-17,38,21,11,52,27,-18,40,19,13,46,27,-22,37,22,14,50,25,-22,40,19,15,38,31,-18,31,29,14,38,31,-18,30,27,13,41,29,-18,32,25,14,41,30,-18,33,27,14,39,33,-17,31,29,13,38,32,-17,30,28,12,41,31,-16,32,26,13,42,32,-16,33,27,13,37,32,-18,29,28,14,38,33,-18,30,29,14,37,31,-17,30,27,15,38,32,-18,31,29,15,36,32,-19,31,28,14,36,31,-19,30,27,15,36,33,-19,30,29,14,36,32,-19,29,28,14,35,32,-20,29,28,15,36,33,-20,30,29,14,36,31,-19,30,27,15,36,32,-19,31,28,16,35,31,-21,31,27,15,35,31,-21,31,26,16,34,32,-21,31,28,15,34,31,-21,30,27,12,32,31,-23,28,26,13,32,32,-23,29,27,12,33,30,-22,29,26,14,33,31,-22,29,27,13,34,32,-20,29,28,12,34,31,-20,28,26,12,33,33,-21,28,28,11,33,32,-21,27,27,11,34,32,-20,27,27,12,34,33,-20,27,28,12,34,31,-20,28,26,13,34,32,-20,29,28,12,36,32,-18,29,28,11,36,31,-18,28,26,11,36,33,-18,27,29,10,36,32,-18,26,27,11,41,32,-17,31,27,10,41,31,-16,30,25,10,36,32,-17,27,27,11,37,33,-18,28,29,12,41,30,-19,32,26,11,40,29,-19,31,25,11,36,30,-19,27,27,12,37,32,-19,28,28,9,36,32,-20,26,27,8,36,30,-19,25,25,9,40,28,-19,30,23,10,40,30,-19,31,25,8,36,33,-18,26,27,7,36,31,-18,25,25,7,41,30,-16,29,23,8,41,31,-16,30,25,7,35,32,-19,24,26,8,36,33,-19,25,27,8,35,30,-19,26,25,9,35,32,-19,27,27,9,33,32,-21,26,27,8,33,31,-21,26,25,8,34,33,-21,25,27,7,33,32,-21,24,26,7,33,32,-22,24,26,8,33,34,-22,25,27,8,32,31,-21,25,25,9,33,33,-21,26,27,9,31,33,-23,27,26,8,30,32,-22,26,25,8,31,34,-24,26,26,7,30,33,-23,26,25,4,32,32,-23,23,25,5,33,33,-23,23,26,5,32,32,-23,24,24,6,32,33,-23,24,25,6,34,32,-21,25,26,5,34,31,-21,24,24,5,34,33,-21,23,26,4,34,32,-21,23,25,4,35,31,-20,23,25,5,35,33,-21,24,26,6,34,31,-21,24,24,7,35,32,-21,25,26,7,36,31,-20,26,25,6,36,30,-20,25,24,6,37,32,-19,25,26,5,36,31,-19,24,24,7,42,30,-17,30,24,5,41,28,-17,29,22,5,37,30,-18,25,24,6,37,32,-18,26,26,8,41,29,-19,30,24,7,40,27,-19,29,22,6,36,29,-20,25,24,7,37,31,-20,26,26,4,34,31,-21,23,25,5,34,31,-21,24,24,6,34,32,-21,25,26,5,35,33,-21,24,26,5,37,30,-18,24,24,6,36,29,-20,25,24,7,36,31,-20,26,26,6,37,32,-19,25,26,8,36,33,-18,25,27,9,36,32,-19,26,27,8,35,30,-19,25,25,7,36,31,-18,24,26,8,33,33,-21,25,27,9,33,32,-21,26,27,8,33,31,-21,25,25,7,33,32,-21,24,26,10,36,32,-18,26,27,11,36,31,-18,27,27,12,37,32,-19,28,28,11,36,33,-18,27,29,11,33,32,-21,27,27,12,34,31,-20,28,26,13,34,32,-20,29,28,12,34,33,-21,27,28,14,38,33,-17,30,29,15,38,32,-18,31,29,14,38,31,-18,30,28,13,38,32,-17,29,28,15,36,33,-19,30,29,15,36,32,-19,31,28,14,36,31,-19,30,27,14,36,32,-19,29,28,8,43,24,-18,31,18,9,43,27,-20,31,20,11,43,25,-21,31,18,9,43,23,-19,31,16,8,40,24,-19,28,19,9,40,26,-20,29,20,11,40,25,-21,29,18,9,39,23,-20,28,17,12,45,26,-22,35,21,8,45,28,-18,33,22,11,48,23,-20,36,16,9,48,24,-19,36,18,9,41,23,-19,29,17,8,42,24,-18,29,19,11,41,25,-21,30,18,9,42,26,-20,30,20,9,39,23,-21,27,18,8,39,25,-19,27,20,11,39,25,-22,29,18,9,39,26,-20,29,20,9,36,26,-22,27,21,10,36,26,-23,27,20,8,36,25,-22,25,21,10,36,24,-23,25,20,8,42,24,-18,30,18,9,42,26,-20,31,20,11,42,25,-21,30,18,9,42,23,-19,30,16,11,40,25,-21,29,18,9,39,23,-20,27,17,9,40,26,-20,29,20,8,39,24,-19,27,19,9,47,26,-19,35,20,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000025", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,64,-5,-7,65,-1,7,69,6,-2,70,10,1,76,-10,-8,77,-6,7,80,2,-2,81,6,6,66,0,-6,68,5,6,79,-5,-6,81,0,2,60,4,-2,61,6,4,62,11,1,63,12,8,74,4,-3,76,9,1,71,-10,-9,72,-5,7,73,-3,-8,75,2,4,70,12,-3,64,-5,2,82,5,-3,77,-10,0,67,2,0,83,-3,0,60,5,3,63,12,3,76,9,-4,71,-9,8,72,4,-3,74,9,2,67,-8,-9,68,-4,7,69,-1,-7,71,3,3,74,9,-4,67,-7,27,45,7,-30,36,8,28,48,4,-32,39,5,26,52,3,-31,43,4,22,54,3,-28,46,5,19,53,6,-25,46,7,19,49,9,-23,43,10,21,45,10,-24,38,11,24,43,9,-27,35,10,11,25,-22,-9,24,-23,12,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-6,25,-18,18,36,-16,-19,32,-16,16,31,-14,-16,28,-14,15,41,-17,-18,37,-17,11,43,-17,-14,41,-16,7,42,-14,-10,41,-14,6,37,-11,-8,37,-10,9,32,-9,-8,30,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-3,20,46,-8,-24,41,-7,16,48,-7,-21,44,-6,13,47,-4,-17,44,-3,12,43,-2,-15,40,-1,14,39,0,-16,35,0,18,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,21,-34,15,35,29,16,23,-32,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,34,6,29,46,5,-33,37,8,30,48,10,-34,40,11,27,49,13,-32,42,14,22,48,13,-27,43,15,19,47,10,-23,40,13,18,45,5,-22,37,9,21,45,2,-24,34,6,30,37,8,-33,29,14,26,35,4,-29,26,12,30,38,12,-34,32,18,27,39,16,-32,35,21,23,39,16,-27,35,21,19,37,12,-23,33,19,19,36,8,-22,29,15,21,35,4,-24,27,12,30,29,10,-33,23,19,27,28,7,-29,21,17,30,31,14,-34,26,23,28,32,18,-32,29,25,23,32,18,-27,29,26,20,30,15,-24,27,24,19,29,10,-23,24,20,22,28,7,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,15,25,30,22,18,-34,20,29,28,23,20,-32,22,31,24,23,20,-28,22,32,22,22,18,-25,20,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-31,41,14,29,53,8,-34,43,9,24,55,10,-30,47,11,21,50,12,-25,43,13,24,45,11,-26,37,12,29,46,9,-32,37,10,24,54,4,-30,46,5,19,53,6,-25,46,8,19,46,7,-23,40,8,24,44,5,-27,36,6,27,49,3,-31,40,4,21,49,2,-26,42,3,28,52,11,-33,42,12,25,53,12,-31,44,14,26,55,9,-32,46,10,28,48,12,-32,38,13,30,49,9,-33,39,10,24,50,14,-28,42,15,22,53,12,-27,45,13,25,47,13,-29,38,14,22,47,12,-25,40,13,27,45,10,-29,36,11,28,47,6,-32,38,7,28,51,6,-32,42,7,27,54,6,-33,45,7,24,55,7,-30,47,8,21,54,8,-27,47,10,20,52,9,-26,44,10,20,48,10,-24,41,11,21,45,10,-24,38,10,24,44,8,-26,36,9,27,44,7,-30,36,7,26,52,3,-31,43,4,21,54,5,-27,47,6,18,49,7,-23,43,8,21,44,6,-24,38,7,26,46,3,-29,38,4,24,49,2,-28,41,3,23,52,2,-28,44,3,20,51,4,-25,44,5,20,47,4,-23,41,5,22,46,3,-26,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,1,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,65,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,-1,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,54,8,-28,48,1,24,53,9,-27,46,2,22,53,10,-26,46,3,21,54,10,-25,48,5,21,56,10,-26,50,6,22,58,10,-27,51,5,24,58,9,-29,51,3,26,56,8,-29,50,1,22,52,2,-21,49,-1,24,54,2,-23,51,-2,19,52,3,-20,49,0,17,54,4,-19,50,2,18,56,4,-20,53,3,19,58,3,-22,54,2,22,58,2,-23,55,0,24,56,2,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,17,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,17,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,16,52,-4,-13,53,-3,15,54,-4,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,14,52,26,-22,41,19,12,52,25,-21,42,19,11,51,24,-19,42,18,11,50,23,-19,41,17,12,49,23,-19,40,17,14,49,24,-21,39,17,15,50,25,-22,39,17,15,51,26,-23,40,18,25,58,12,-31,50,5,24,59,11,-30,51,5,22,57,9,-28,51,4,22,55,9,-27,49,2,24,53,9,-27,47,1,26,53,10,-29,46,1,27,55,11,-31,47,3,27,57,12,-32,48,4,15,54,21,-23,44,15,17,54,22,-25,43,15,14,53,20,-21,44,14,14,51,19,-21,43,13,16,50,19,-21,41,12,17,50,20,-23,40,13,18,51,22,-24,41,13,18,52,22,-25,42,15,21,58,13,-28,50,8,23,57,14,-30,48,8,20,56,12,-26,49,6,20,54,11,-25,48,5,22,52,11,-25,45,4,24,51,12,-27,44,4,25,53,14,-29,45,5,24,55,15,-30,46,7,23,58,11,-29,51,6,25,58,12,-31,50,5,21,57,10,-27,50,5,22,55,10,-26,49,3,23,53,10,-26,47,2,25,53,11,-29,46,2,26,54,11,-30,46,3,26,56,12,-32,48,4,30,14,15,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,22,4,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,4,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,4,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,8,41,30,-21,30,25,6,41,28,-20,29,22,10,46,24,-22,35,19,12,46,27,-22,36,21,6,42,31,-18,30,24,4,42,28,-18,29,22,8,48,26,-18,35,19,9,49,28,-18,37,21,10,49,29,-18,37,22,8,49,28,-18,36,20,6,42,30,-17,29,23,7,42,32,-17,30,25,14,46,28,-23,37,23,11,46,26,-22,36,20,8,40,29,-20,29,24,10,41,30,-20,30,26,12,41,31,-20,31,27,10,40,29,-20,30,25,13,47,26,-23,36,22,14,47,28,-22,38,24,10,42,33,-17,32,27,8,42,31,-17,31,25,9,49,29,-18,37,21,11,49,30,-18,38,23,13,49,31,-19,39,25,11,49,30,-18,39,23,10,42,32,-16,32,25,12,42,33,-17,33,28,15,48,29,-22,38,25,13,48,27,-22,37,23,12,41,29,-19,31,26,13,42,31,-18,33,28,15,48,29,-22,39,24,10,46,24,-22,35,19,11,49,23,-22,38,17,15,50,27,-22,41,22,13,49,31,-20,40,24,8,48,25,-18,36,18,9,51,25,-19,38,17,14,51,28,-20,42,22,9,49,29,-18,37,21,11,52,27,-18,40,19,13,46,27,-23,37,22,14,49,25,-22,40,19,13,38,33,-19,31,29,12,38,32,-19,30,28,12,41,30,-18,32,26,13,41,31,-18,33,27,12,39,34,-18,30,29,11,39,33,-18,29,28,11,41,32,-17,32,26,12,42,32,-17,33,27,11,38,34,-19,29,28,13,38,34,-19,30,29,12,38,33,-18,30,28,13,38,33,-18,31,29,13,37,34,-20,31,28,12,36,33,-19,30,27,13,37,35,-20,30,29,12,36,34,-20,29,28,12,36,34,-20,30,28,13,36,35,-21,30,29,12,36,33,-20,30,27,13,37,34,-20,31,28,14,35,33,-21,32,27,13,35,33,-21,31,26,14,35,34,-22,31,28,13,34,34,-22,30,27,10,32,32,-23,28,26,11,32,33,-23,29,27,10,33,32,-22,29,25,11,33,33,-22,30,27,11,35,33,-21,29,27,9,35,32,-21,28,26,10,34,34,-22,28,28,9,34,33,-22,27,27,8,35,33,-21,27,27,10,35,34,-21,28,28,9,35,32,-20,28,26,11,35,33,-21,29,28,11,37,33,-19,29,28,9,37,32,-19,28,27,9,37,34,-19,27,29,8,37,33,-19,26,27,10,41,33,-17,31,27,8,41,31,-17,30,25,8,37,33,-18,27,27,9,38,34,-18,28,29,11,41,31,-19,32,26,10,41,30,-19,31,25,9,37,32,-20,27,27,11,37,33,-20,28,28,8,37,32,-20,26,27,6,36,31,-20,25,25,8,41,29,-20,30,23,9,41,30,-20,31,25,6,38,33,-19,26,27,5,37,32,-19,25,25,6,42,30,-17,29,24,7,42,32,-17,30,25,5,36,32,-20,24,26,6,37,34,-20,25,27,6,36,31,-20,26,25,7,36,33,-20,27,27,7,34,33,-22,26,27,6,34,32,-22,26,25,6,35,34,-22,25,27,5,34,33,-22,24,26,5,34,33,-23,24,25,6,34,34,-23,25,27,6,34,32,-21,25,25,7,34,33,-22,26,27,7,32,34,-23,27,26,6,31,33,-23,27,24,6,32,35,-24,27,26,5,31,34,-24,26,25,3,33,33,-24,24,24,3,34,34,-24,24,26,4,33,32,-24,25,24,4,33,33,-24,25,25,5,35,33,-22,25,26,4,35,31,-22,24,24,4,36,34,-23,24,26,3,35,32,-22,23,25,3,36,32,-22,23,25,4,36,33,-22,24,26,4,35,31,-22,25,24,5,36,32,-22,25,26,5,37,32,-21,26,26,4,37,30,-21,25,24,4,38,33,-20,25,26,3,37,31,-20,24,24,6,42,30,-18,29,24,4,42,29,-18,29,22,3,38,31,-19,25,24,4,39,32,-19,25,26,7,41,29,-20,30,24,6,41,28,-20,29,22,4,37,30,-21,25,24,6,38,31,-21,26,26,3,36,32,-22,23,25,4,35,31,-22,24,24,5,35,33,-22,25,26,4,36,33,-22,24,26,3,38,31,-19,24,24,4,37,30,-20,25,24,5,37,32,-21,26,26,4,38,32,-19,25,26,6,37,34,-19,25,27,7,37,33,-20,26,27,6,36,31,-20,25,25,5,37,32,-19,24,26,6,34,34,-22,25,27,7,34,33,-22,26,27,6,34,32,-22,25,25,5,34,33,-22,24,26,8,37,33,-19,26,27,9,37,32,-19,27,27,11,37,33,-19,28,28,9,37,34,-19,27,29,8,34,33,-21,27,27,9,35,32,-21,28,26,11,35,33,-21,29,28,10,34,34,-22,28,28,12,39,34,-18,30,30,13,38,33,-19,31,29,12,38,32,-18,30,28,11,38,34,-18,29,28,13,37,35,-20,30,29,13,37,34,-20,31,28,12,36,33,-20,30,27,12,36,34,-20,29,28,7,43,24,-18,31,18,8,43,27,-21,31,20,10,43,25,-22,31,18,9,43,23,-19,31,16,6,40,25,-19,28,19,8,41,27,-21,29,20,9,40,26,-22,29,18,8,40,24,-20,28,17,11,45,26,-22,35,21,7,45,29,-18,33,22,11,48,23,-20,36,16,9,48,24,-19,36,18,8,41,23,-20,29,17,7,42,25,-19,29,19,10,41,25,-22,30,18,8,42,27,-21,30,20,8,39,24,-21,27,18,6,39,25,-20,27,20,9,39,26,-22,29,18,8,40,27,-21,29,20,8,37,27,-23,27,21,9,37,27,-24,27,20,7,36,26,-23,25,21,8,36,25,-23,25,20,7,43,25,-18,30,19,8,43,27,-20,31,20,10,42,25,-22,30,18,8,42,23,-19,30,17,9,40,26,-22,29,18,8,39,24,-21,27,17,8,40,27,-21,29,20,6,40,25,-20,27,19,8,47,27,-20,35,20,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000026", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,63,-5,-7,65,-1,7,69,6,-2,70,10,1,75,-10,-8,77,-6,7,80,2,-2,81,6,6,66,0,-6,68,5,6,79,-5,-6,81,0,2,60,4,-2,61,6,4,63,11,1,63,12,8,74,4,-3,76,9,1,70,-10,-9,72,-6,7,73,-4,-8,75,1,4,71,12,-3,64,-5,3,82,5,-3,77,-10,0,67,2,0,83,-3,0,60,5,3,63,12,3,76,8,-4,70,-9,8,72,4,-3,74,8,2,66,-8,-9,68,-4,7,69,-2,-7,71,3,3,74,9,-4,67,-7,27,45,7,-30,36,8,28,48,4,-32,39,5,26,52,3,-31,43,4,23,54,3,-29,46,5,20,53,6,-25,46,7,19,49,9,-23,42,10,21,45,10,-24,38,11,24,43,9,-27,35,10,11,25,-22,-9,24,-23,12,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-6,25,-18,18,36,-16,-19,32,-16,16,31,-14,-16,28,-14,15,41,-18,-18,37,-17,11,43,-17,-15,41,-16,7,42,-14,-10,41,-14,6,37,-11,-8,37,-11,9,32,-9,-8,31,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-3,20,46,-8,-24,40,-7,16,48,-7,-21,44,-6,13,48,-4,-18,44,-4,12,43,-2,-15,40,-1,14,39,0,-16,35,0,18,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,21,-34,15,35,29,16,23,-32,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,34,6,29,46,5,-33,36,8,30,48,10,-34,40,11,27,49,13,-32,42,14,22,49,13,-27,43,15,19,47,10,-23,40,13,18,45,5,-22,37,9,21,45,2,-25,34,6,30,37,8,-33,29,14,26,35,4,-29,26,12,30,38,12,-34,32,18,27,39,16,-32,35,21,23,39,16,-27,35,21,19,37,12,-23,33,19,19,36,8,-22,29,15,22,35,4,-24,27,12,30,30,10,-33,23,19,27,28,7,-29,21,17,30,31,14,-34,26,22,28,32,18,-32,29,25,23,32,18,-28,29,26,20,30,15,-24,27,24,19,29,10,-23,24,20,22,28,7,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,15,25,30,23,18,-34,20,29,28,23,20,-32,22,31,24,23,20,-28,22,32,22,22,18,-25,21,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-31,41,14,29,53,8,-34,43,9,24,55,9,-30,47,11,21,50,12,-25,43,13,24,45,11,-27,37,12,29,46,9,-32,37,10,24,54,4,-30,46,5,19,53,6,-25,46,8,19,46,7,-23,40,8,24,44,5,-27,36,6,27,49,3,-31,40,4,21,49,2,-26,42,3,28,52,11,-33,42,12,26,53,12,-31,44,14,27,55,9,-33,45,10,28,48,11,-32,38,13,30,50,8,-34,39,10,24,50,13,-28,42,15,22,53,12,-28,45,13,25,47,13,-29,38,14,22,47,12,-26,40,13,27,45,10,-29,36,11,28,47,6,-32,38,7,28,51,6,-32,42,7,27,54,5,-33,45,7,24,55,7,-30,47,8,21,55,8,-27,47,10,20,52,9,-26,44,10,20,48,10,-24,41,11,21,45,9,-24,38,10,24,44,8,-26,36,9,27,45,7,-30,36,7,26,52,3,-31,43,4,21,54,5,-28,47,6,18,50,7,-23,43,8,21,45,6,-24,38,7,26,46,3,-29,37,4,24,49,2,-29,41,3,23,52,2,-28,44,3,20,51,4,-25,44,5,20,47,4,-24,41,5,22,46,3,-26,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,1,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,66,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,-1,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,54,8,-28,48,1,24,53,9,-27,46,2,22,53,10,-26,46,3,21,54,10,-25,48,5,21,57,10,-26,50,6,22,58,10,-27,51,5,24,58,9,-29,51,3,26,57,8,-29,50,1,22,52,2,-21,49,-1,24,54,2,-23,51,-2,19,52,3,-20,49,0,17,54,4,-19,50,2,17,57,4,-20,53,3,19,58,3,-22,54,2,22,58,2,-23,55,0,24,57,2,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,17,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,17,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,16,52,-4,-13,53,-3,15,54,-4,-13,54,-1,14,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,14,52,26,-22,41,19,12,52,25,-21,42,19,11,51,24,-19,42,18,11,50,23,-19,41,17,13,49,23,-19,40,17,14,49,24,-21,39,17,15,50,25,-22,39,18,15,51,26,-23,40,18,25,58,12,-31,50,5,24,59,11,-30,51,5,22,57,9,-28,51,4,22,55,9,-27,49,2,24,53,9,-27,47,1,26,53,10,-29,46,1,27,55,11,-31,47,3,27,57,12,-32,48,4,15,54,21,-23,44,15,17,54,22,-25,43,15,14,53,20,-22,44,14,14,51,19,-21,43,13,16,50,19,-21,41,12,17,50,20,-23,40,13,18,51,22,-25,41,13,18,52,22,-25,42,15,21,58,13,-28,50,8,23,57,14,-30,48,8,20,56,12,-26,49,6,20,54,11,-25,48,5,22,52,11,-25,45,4,24,52,12,-27,44,4,25,53,14,-29,45,5,24,55,15,-30,46,7,23,58,11,-29,51,6,25,58,12,-31,50,5,21,57,10,-27,50,5,22,55,10,-26,49,3,23,53,10,-26,47,2,25,53,11,-29,46,2,26,54,11,-30,46,3,26,57,12,-32,48,4,30,14,16,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,5,12,-32,5,28,23,4,22,-26,5,38,22,5,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,27,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,5,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,5,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,27,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,21,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,5,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,5,12,-28,5,28,25,0,12,-28,0,28,36,0,27,-40,0,43,36,2,27,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,5,15,-25,5,31,23,4,22,-26,5,38,30,5,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,21,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,8,41,30,-21,30,25,6,41,28,-21,29,22,10,46,24,-22,35,19,12,46,27,-23,36,21,6,43,31,-18,30,24,4,42,28,-19,28,22,8,48,26,-19,35,19,9,49,28,-18,36,21,10,49,29,-18,37,22,8,49,28,-18,36,20,6,42,30,-18,29,23,7,42,32,-18,30,26,14,46,28,-23,37,23,11,46,26,-22,36,20,8,40,29,-21,29,24,10,41,31,-21,30,26,12,41,31,-20,31,27,10,41,30,-20,30,25,13,47,26,-23,36,22,14,47,28,-22,38,24,10,42,33,-18,32,27,8,42,31,-17,30,25,9,49,29,-18,37,21,11,49,30,-19,38,24,13,49,31,-20,39,25,11,49,30,-18,38,23,10,42,32,-17,32,26,12,42,33,-17,33,28,15,48,29,-22,38,25,13,48,27,-22,37,23,12,41,29,-19,31,26,13,42,31,-19,33,28,15,47,29,-22,39,24,10,46,24,-22,35,19,11,49,23,-22,38,17,15,50,27,-22,41,21,13,49,31,-20,40,24,8,49,25,-19,35,18,9,51,24,-19,38,17,14,51,28,-20,42,22,9,49,29,-18,37,22,11,52,27,-18,40,19,13,46,27,-23,37,22,14,49,25,-22,40,19,13,39,33,-21,31,29,11,38,33,-20,30,27,11,41,30,-19,32,26,13,41,31,-19,33,27,12,39,34,-19,30,29,11,39,34,-19,29,28,11,42,32,-17,32,26,12,42,32,-18,33,28,11,38,34,-20,29,28,12,38,35,-20,30,29,11,38,33,-19,30,28,13,38,34,-19,31,29,13,37,34,-20,32,28,12,36,34,-20,31,27,12,37,35,-21,31,28,11,37,35,-21,30,27,11,36,35,-21,30,27,12,36,35,-22,31,28,12,36,34,-20,31,27,13,37,34,-21,32,28,13,35,34,-22,33,27,12,35,34,-21,32,26,13,35,35,-22,32,27,12,34,34,-22,32,26,9,32,33,-24,29,25,10,32,33,-24,30,26,10,33,32,-23,30,25,11,33,33,-23,30,26,10,35,33,-22,29,27,9,35,32,-21,29,26,9,34,34,-23,28,28,8,34,33,-23,28,26,8,35,33,-22,27,26,9,35,34,-22,28,28,9,35,32,-21,29,26,10,35,33,-22,29,27,10,37,33,-20,29,28,9,37,32,-20,28,27,9,37,34,-21,27,29,8,37,33,-21,26,27,10,42,33,-18,31,27,8,41,31,-18,30,25,8,37,33,-19,27,27,9,38,34,-20,28,29,11,41,31,-20,32,26,10,41,30,-20,31,25,9,37,32,-21,27,27,10,37,33,-21,28,28,7,37,32,-21,26,27,6,37,31,-21,25,25,8,41,29,-20,30,23,9,41,30,-20,31,25,6,38,33,-20,26,27,5,37,32,-19,25,25,6,42,30,-18,29,24,7,42,32,-18,30,25,5,36,32,-21,24,26,6,37,34,-21,25,27,6,36,31,-20,26,25,7,36,33,-21,27,27,7,34,33,-23,27,26,6,34,32,-22,26,25,6,34,34,-23,25,27,5,34,33,-23,24,25,5,34,33,-24,25,25,6,34,34,-24,26,27,6,34,32,-22,26,25,7,34,33,-22,26,26,8,32,33,-24,28,26,7,32,32,-23,27,24,7,31,34,-25,27,26,6,31,33,-25,27,24,4,33,32,-25,25,24,4,33,33,-25,25,25,5,33,32,-24,25,24,5,33,32,-25,26,25,5,35,32,-23,25,25,4,35,31,-23,25,24,4,35,33,-24,24,26,3,35,32,-23,24,24,3,36,32,-23,23,25,4,36,33,-23,24,26,4,35,31,-23,25,24,5,36,32,-23,26,25,6,37,32,-21,26,25,4,37,30,-21,25,24,4,38,33,-21,25,26,3,37,31,-21,24,24,5,42,30,-18,29,25,4,42,29,-19,28,22,3,38,31,-20,25,24,4,39,32,-20,25,26,7,41,29,-21,30,24,6,41,28,-20,29,22,4,37,30,-22,25,24,6,38,31,-22,26,26,3,35,32,-23,23,25,4,35,31,-23,25,24,5,35,32,-23,25,25,4,36,33,-23,24,26,3,38,31,-20,24,24,4,37,30,-21,25,24,6,38,32,-21,26,26,4,38,32,-20,25,26,6,37,34,-20,25,27,7,37,33,-21,26,27,6,36,31,-21,25,25,5,37,32,-20,24,26,6,34,34,-23,25,27,7,34,33,-23,26,26,6,34,32,-22,26,25,5,34,33,-23,25,25,8,37,33,-20,26,27,9,37,32,-20,27,27,10,37,33,-21,28,28,9,37,34,-20,27,29,8,34,33,-23,27,26,9,35,32,-21,28,26,10,35,33,-22,29,27,9,35,34,-23,28,28,12,39,35,-20,30,29,13,38,33,-20,31,29,11,38,33,-20,30,28,11,38,34,-20,29,28,12,37,35,-21,31,28,13,37,34,-20,32,28,12,36,34,-20,31,27,11,36,35,-21,30,27,7,43,24,-19,31,19,8,43,27,-21,31,20,10,43,25,-22,31,18,8,43,23,-20,31,16,6,40,25,-20,27,19,8,41,27,-21,29,20,9,40,26,-22,29,18,8,40,24,-21,28,17,11,45,26,-23,35,21,7,45,29,-19,33,22,11,48,23,-21,36,16,9,48,24,-19,36,18,8,41,23,-20,29,17,7,42,25,-19,29,19,10,41,25,-22,30,18,8,42,27,-21,30,20,8,39,24,-22,27,18,6,39,25,-21,27,20,9,39,26,-23,29,18,8,40,27,-22,29,20,7,37,27,-24,27,21,9,37,27,-24,27,20,7,36,26,-23,25,21,8,36,25,-24,25,20,7,43,25,-19,30,19,8,43,27,-21,31,20,10,42,25,-22,31,18,8,42,23,-20,30,17,9,40,26,-22,29,18,8,39,24,-21,27,18,8,40,27,-21,29,20,6,40,25,-20,27,19,8,47,27,-20,35,20,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000027", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,63,-5,-7,65,-1,8,69,6,-2,71,10,1,75,-10,-8,77,-6,7,80,2,-1,81,5,6,66,0,-6,68,5,6,79,-5,-6,81,0,2,60,4,-2,61,6,4,63,11,1,63,12,9,74,4,-3,76,9,1,70,-10,-9,72,-6,7,73,-4,-7,75,1,4,71,12,-3,64,-5,3,82,4,-3,77,-10,0,67,2,0,83,-4,0,60,5,3,63,12,3,76,8,-4,70,-9,8,72,4,-3,74,8,2,66,-8,-8,68,-3,7,69,-2,-7,71,3,3,74,9,-4,67,-7,28,45,7,-30,36,8,28,48,4,-32,39,5,26,52,3,-31,43,4,23,54,3,-29,46,5,20,53,6,-25,46,7,19,49,8,-23,42,10,21,45,10,-24,38,11,25,43,9,-27,35,10,11,25,-22,-9,24,-23,12,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-6,25,-18,18,36,-17,-19,32,-16,16,31,-14,-16,28,-14,16,41,-18,-18,37,-17,11,43,-17,-15,41,-16,7,42,-14,-11,41,-14,6,37,-11,-8,37,-11,9,32,-9,-8,31,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-4,20,46,-8,-24,40,-7,16,48,-7,-21,44,-6,13,48,-5,-18,44,-4,12,43,-2,-15,40,-1,14,39,0,-16,35,0,18,36,-1,-19,31,-1,28,13,15,-30,10,31,30,14,17,-33,12,32,31,15,21,-34,15,35,29,16,23,-32,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,25,12,15,-27,10,31,26,45,2,-29,34,6,29,46,5,-33,36,8,30,48,10,-34,40,11,27,49,13,-32,42,14,23,49,13,-28,43,15,19,47,10,-24,40,12,19,46,5,-22,37,9,21,45,2,-25,34,6,30,37,8,-33,29,14,26,35,4,-29,26,12,30,38,12,-34,32,18,27,39,16,-32,35,21,23,39,16,-28,35,21,19,37,12,-23,33,19,19,36,8,-22,29,15,22,35,4,-24,27,12,30,30,10,-33,23,19,27,28,7,-29,21,17,31,31,14,-34,26,22,28,32,18,-32,29,25,23,32,18,-28,29,26,20,30,15,-24,27,24,19,29,10,-23,24,20,22,28,7,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,15,25,31,23,18,-34,20,29,28,23,20,-32,22,31,25,23,20,-28,22,32,22,22,18,-25,21,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-31,41,14,29,53,8,-34,42,9,24,55,9,-30,47,11,21,50,12,-26,43,13,24,45,11,-27,37,12,29,46,9,-32,37,10,24,54,4,-30,46,5,19,53,6,-25,46,8,19,47,7,-23,40,8,24,44,5,-27,36,6,27,49,3,-31,40,4,21,49,2,-26,42,3,29,52,11,-33,42,12,26,53,12,-31,44,14,27,55,9,-33,45,10,28,48,11,-32,38,12,30,50,8,-34,39,10,24,50,13,-28,42,15,22,53,12,-28,45,13,26,47,13,-29,38,14,22,47,12,-26,40,13,27,45,10,-29,36,11,29,47,6,-32,38,7,28,51,5,-32,42,7,27,54,5,-33,45,7,24,55,7,-31,47,8,21,55,8,-27,47,10,21,52,9,-26,44,10,20,48,10,-24,41,11,21,45,9,-24,38,10,24,44,8,-26,36,9,27,45,6,-30,35,7,26,52,2,-31,43,4,22,54,4,-28,46,6,18,50,7,-23,43,8,21,45,6,-24,38,7,26,46,3,-29,37,4,24,49,1,-29,41,3,23,52,2,-28,44,3,20,51,3,-25,44,5,20,47,4,-24,41,5,23,46,3,-26,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,1,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,66,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,-1,67,-1,20,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,55,8,-28,48,1,24,53,9,-27,46,2,22,53,10,-26,46,3,21,54,10,-25,48,5,21,57,10,-26,50,6,22,58,10,-27,51,5,24,58,9,-29,51,3,26,57,8,-29,50,1,22,52,2,-21,49,-1,24,54,2,-23,51,-2,19,52,3,-20,49,0,18,54,4,-19,50,2,18,57,4,-20,53,3,19,58,3,-22,54,2,22,59,2,-23,55,0,24,57,2,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,17,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,17,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,16,52,-4,-13,53,-3,15,54,-4,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,14,52,26,-22,41,19,13,52,25,-21,42,19,12,51,24,-19,42,18,12,50,23,-19,41,17,13,49,23,-19,40,17,14,49,24,-21,39,17,15,50,25,-22,39,18,15,51,26,-23,40,18,25,58,12,-31,50,5,24,59,11,-30,51,5,22,57,9,-28,51,4,23,55,9,-27,49,2,24,53,9,-27,47,1,26,54,10,-29,46,1,27,55,11,-31,47,3,27,57,12,-32,48,4,15,54,21,-23,44,15,17,54,22,-25,43,15,14,53,20,-22,44,14,15,51,19,-21,43,13,16,50,19,-21,41,12,17,50,20,-23,40,13,18,51,22,-25,41,13,18,52,22,-25,42,15,21,58,13,-28,50,8,23,58,14,-30,48,8,20,56,12,-26,49,6,20,54,11,-25,48,5,22,52,11,-25,45,4,24,52,12,-27,44,4,25,53,14,-29,45,5,24,56,15,-30,46,7,23,59,11,-29,51,6,25,58,12,-31,50,5,21,57,10,-27,50,5,22,55,10,-26,49,3,23,53,10,-26,47,2,25,53,11,-29,46,2,26,55,11,-30,46,3,26,57,12,-32,48,4,30,14,16,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,15,17,-26,15,33,35,2,23,-38,2,39,30,5,12,-32,5,28,23,5,22,-26,5,38,22,5,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,27,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,5,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,5,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,29,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,27,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,21,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,5,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,5,12,-28,5,28,25,0,12,-28,0,28,36,0,27,-40,0,43,36,2,27,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,5,15,-25,5,31,23,5,22,-26,5,38,30,5,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,21,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,8,41,30,-22,30,25,6,41,28,-22,29,22,10,46,24,-22,35,19,12,46,27,-23,37,21,6,42,31,-19,30,25,5,42,28,-19,28,22,8,48,26,-19,35,19,9,49,28,-18,36,21,10,49,29,-18,37,23,9,49,28,-18,36,20,6,42,30,-18,29,23,7,42,32,-19,30,26,14,46,28,-23,37,23,11,46,26,-22,36,20,8,40,29,-22,29,24,10,40,30,-22,30,26,12,41,31,-21,31,27,10,40,29,-21,30,25,13,46,26,-23,36,22,14,47,28,-23,38,24,10,42,33,-19,31,27,8,42,31,-18,30,25,9,49,29,-18,37,21,11,49,30,-19,38,24,14,48,31,-20,39,25,11,49,30,-19,38,23,10,42,31,-18,32,26,13,42,33,-18,33,28,15,48,29,-22,39,25,13,48,27,-23,38,23,12,41,29,-20,31,26,14,42,31,-20,33,28,15,47,29,-22,40,24,11,46,24,-22,36,19,12,49,23,-22,38,17,15,50,27,-22,41,21,14,49,31,-20,40,24,8,48,25,-19,35,19,10,51,25,-19,38,17,14,51,28,-20,42,22,10,49,29,-18,37,22,11,52,27,-18,40,19,13,46,27,-23,37,22,14,49,25,-22,40,19,13,39,34,-22,31,28,11,38,33,-21,30,27,12,41,30,-19,32,25,13,41,31,-20,34,27,12,39,35,-21,31,29,11,39,34,-20,30,28,11,41,32,-18,32,26,12,42,32,-18,33,28,11,38,34,-21,30,28,12,39,35,-22,31,29,11,38,33,-20,30,27,13,38,34,-20,31,29,13,37,35,-21,32,28,12,37,34,-21,31,27,12,37,36,-22,31,28,11,37,35,-22,31,27,11,36,35,-22,31,27,12,37,36,-22,32,28,12,37,34,-21,31,27,13,37,35,-21,32,28,13,35,35,-22,33,26,12,35,34,-22,33,25,13,35,36,-23,33,26,12,35,35,-22,32,25,9,32,33,-24,31,24,11,32,34,-24,32,25,10,33,32,-23,31,25,11,33,33,-23,32,26,11,35,33,-23,30,27,9,35,32,-22,29,26,10,34,34,-24,30,27,9,34,33,-24,29,25,8,35,33,-24,28,26,10,35,34,-24,29,27,9,35,32,-22,29,26,11,35,33,-22,30,27,11,37,33,-21,29,28,9,37,32,-21,28,26,9,37,34,-23,28,28,8,37,33,-22,27,27,10,41,33,-19,31,27,9,41,31,-19,30,25,8,37,33,-21,27,27,9,38,34,-22,28,28,11,41,31,-21,32,26,10,40,30,-20,31,25,9,37,32,-23,28,26,11,37,33,-23,29,28,8,37,32,-23,27,27,7,36,31,-23,26,25,8,41,29,-21,30,23,9,41,30,-21,31,25,6,37,33,-21,26,27,5,37,32,-21,25,25,6,42,30,-19,29,24,7,42,32,-19,30,26,5,36,32,-22,25,25,7,36,33,-23,25,27,7,36,31,-22,26,25,8,37,32,-22,27,27,8,35,32,-24,27,26,7,34,31,-24,27,24,7,34,33,-24,26,26,6,34,32,-24,25,25,6,33,32,-25,26,25,7,33,33,-25,27,26,7,34,31,-23,26,25,8,34,32,-24,27,26,9,33,32,-24,29,25,8,32,31,-24,28,24,9,32,32,-25,29,25,8,31,31,-25,28,24,6,33,31,-26,25,24,6,33,32,-26,26,25,6,34,30,-25,26,23,7,34,31,-25,27,24,6,35,31,-24,26,25,5,35,30,-24,25,24,5,35,32,-25,25,26,4,34,31,-25,24,24,4,35,31,-24,24,24,5,35,32,-24,25,26,5,35,30,-24,25,24,6,36,31,-24,26,25,6,37,31,-22,26,25,5,37,30,-22,25,24,5,37,32,-22,25,26,4,37,31,-22,24,24,6,42,30,-19,29,25,5,42,29,-19,28,22,4,38,31,-21,25,24,5,38,32,-21,26,26,7,41,29,-21,30,24,6,41,28,-21,29,22,5,37,30,-23,25,24,6,38,31,-23,26,25,4,35,31,-24,24,24,5,35,30,-24,25,24,6,36,31,-24,26,25,5,35,32,-25,25,26,4,37,31,-21,24,24,5,37,30,-22,25,24,6,38,31,-22,26,26,5,38,32,-22,25,26,6,37,34,-22,25,27,8,37,32,-22,27,27,6,36,31,-22,26,25,5,37,32,-22,25,26,7,34,33,-25,26,26,8,34,32,-24,27,26,7,34,31,-24,27,25,6,34,32,-25,26,25,8,37,33,-22,27,27,9,37,32,-22,28,26,11,37,33,-22,29,28,9,37,34,-22,28,29,8,34,33,-24,29,26,9,35,32,-22,29,26,11,35,33,-23,30,27,10,34,34,-24,29,27,12,39,35,-21,30,29,13,38,34,-21,31,29,11,38,33,-21,30,27,11,39,34,-21,29,28,12,37,36,-22,32,28,13,37,35,-21,32,28,12,37,34,-21,31,27,11,37,35,-22,31,27,7,43,24,-19,31,19,8,43,27,-22,31,20,11,43,25,-23,31,18,9,43,23,-20,31,17,7,40,25,-20,27,19,8,40,27,-22,29,20,10,40,26,-23,29,18,8,40,24,-21,28,17,12,45,26,-23,35,21,8,45,29,-19,33,22,11,48,23,-21,36,16,9,48,24,-19,36,18,8,41,23,-21,29,17,7,42,25,-20,29,19,10,41,25,-23,30,18,8,42,27,-22,30,20,8,39,24,-22,27,18,7,39,25,-21,27,20,10,39,26,-23,29,18,8,40,27,-22,29,20,8,37,27,-24,27,21,9,37,26,-25,27,20,7,36,26,-24,26,21,8,36,25,-25,26,19,7,43,25,-19,30,19,8,42,27,-21,31,20,10,42,25,-23,31,18,9,42,23,-20,30,17,10,40,26,-23,29,18,8,39,24,-22,27,17,8,40,27,-22,29,20,7,40,25,-21,27,19,8,47,27,-20,35,20,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000028", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,63,-5,-7,65,-1,8,69,6,-2,71,10,1,75,-10,-8,77,-6,7,80,2,-1,81,5,6,66,0,-6,68,5,6,79,-5,-6,81,0,2,60,4,-2,61,6,4,63,11,1,63,12,9,74,4,-3,76,9,1,70,-10,-9,72,-6,7,73,-4,-7,75,1,4,71,12,-3,64,-5,3,82,4,-3,77,-10,0,67,2,0,82,-4,0,60,5,3,63,12,3,76,8,-4,70,-9,8,72,4,-3,74,8,2,66,-8,-8,68,-3,7,69,-2,-7,71,3,3,74,9,-4,67,-7,28,45,7,-30,36,8,28,48,4,-32,39,5,26,52,3,-31,43,4,23,54,3,-29,46,5,20,53,6,-25,46,7,19,49,9,-23,42,10,21,45,10,-24,38,11,25,43,9,-27,35,10,11,25,-22,-9,24,-23,12,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-6,25,-18,18,36,-16,-19,32,-16,16,31,-14,-16,28,-14,15,41,-18,-18,37,-17,11,43,-17,-15,41,-16,7,42,-14,-11,41,-14,6,37,-11,-8,37,-11,9,32,-9,-8,31,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-4,20,46,-8,-24,40,-7,16,48,-7,-21,44,-6,13,47,-4,-18,44,-4,12,43,-2,-15,40,-1,14,39,0,-16,35,0,18,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,21,-34,15,35,29,16,23,-32,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,34,6,29,46,5,-33,36,8,30,48,10,-34,40,11,27,49,13,-32,42,14,22,48,13,-28,43,15,19,47,10,-24,40,12,19,45,5,-22,37,9,21,45,2,-25,34,6,30,37,8,-33,29,14,26,35,4,-29,26,12,30,38,12,-34,32,18,27,39,16,-32,35,21,23,39,16,-28,35,21,19,37,12,-23,33,19,19,36,8,-22,29,15,22,35,4,-24,27,12,30,29,10,-33,23,19,27,28,7,-29,21,17,31,31,14,-34,26,22,28,32,18,-32,29,25,23,32,18,-28,29,26,20,30,15,-24,27,24,19,29,10,-23,24,20,22,28,7,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,15,25,30,22,18,-34,20,29,28,23,20,-32,22,31,24,23,20,-28,22,32,22,22,18,-25,21,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-31,41,14,29,53,8,-34,42,9,24,55,9,-30,47,11,21,50,12,-26,43,13,24,45,11,-27,37,12,29,46,9,-32,37,10,24,54,4,-30,46,5,19,53,6,-25,46,8,19,46,7,-23,40,8,24,44,5,-27,36,6,27,49,3,-31,40,4,21,49,2,-26,42,3,29,52,11,-33,42,12,26,53,12,-31,44,14,27,55,9,-33,45,10,28,48,11,-32,38,12,30,49,8,-34,39,10,24,50,13,-28,42,15,22,53,12,-28,45,13,26,47,13,-29,38,14,22,47,12,-26,40,13,27,45,10,-29,36,11,29,47,6,-32,38,7,28,51,6,-32,42,7,27,54,5,-33,45,7,24,55,7,-31,47,8,21,54,8,-27,47,10,21,52,9,-26,44,10,20,48,10,-24,41,11,21,45,9,-24,38,10,24,44,8,-26,36,9,27,44,7,-30,35,7,26,52,3,-31,43,4,21,54,5,-28,46,6,18,49,7,-23,43,8,21,44,6,-24,38,7,26,46,3,-29,37,4,24,49,2,-29,41,3,23,52,2,-28,44,3,20,51,4,-25,44,5,20,47,4,-24,41,5,23,46,3,-26,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,1,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,66,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,-1,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,54,8,-28,48,1,24,53,9,-27,46,2,22,53,10,-26,46,3,21,54,10,-25,48,5,21,56,10,-26,50,6,22,58,10,-27,51,5,24,58,9,-29,51,3,26,56,8,-29,50,1,22,52,2,-21,49,-1,24,54,2,-23,51,-2,19,52,3,-20,49,0,17,54,4,-19,50,2,18,56,4,-20,53,3,19,58,3,-22,54,2,22,58,2,-23,55,0,24,57,2,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,17,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,17,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,16,52,-4,-13,53,-3,15,54,-4,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,14,52,26,-22,41,19,12,52,25,-21,42,19,12,51,24,-19,42,18,12,50,23,-19,41,17,13,49,23,-19,40,17,14,49,24,-21,39,17,15,50,25,-22,39,18,15,51,26,-23,40,18,25,58,12,-31,50,5,24,59,11,-30,51,5,22,57,9,-28,51,4,23,55,9,-27,49,2,24,53,9,-27,47,1,26,53,10,-29,46,1,27,55,11,-31,47,3,27,57,12,-32,48,4,15,54,21,-23,44,15,17,54,22,-25,43,15,14,53,20,-22,44,14,15,51,19,-21,43,13,16,50,19,-21,41,12,17,50,20,-23,40,13,18,51,22,-25,41,13,18,52,22,-25,42,15,21,58,13,-28,50,8,23,57,14,-30,48,8,20,56,12,-26,49,6,20,54,11,-25,48,5,22,52,11,-25,45,4,24,51,12,-27,44,4,25,53,14,-29,45,5,24,55,15,-30,46,7,23,58,11,-29,51,6,25,58,12,-31,50,5,21,57,10,-27,50,5,22,55,10,-26,49,3,23,53,10,-26,47,2,25,53,11,-29,46,2,26,54,11,-30,46,3,26,56,12,-32,48,4,30,14,15,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,22,4,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,4,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,4,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,9,40,29,-22,30,25,7,40,27,-22,29,22,11,46,24,-22,35,19,13,46,26,-23,37,21,7,42,30,-19,30,25,5,41,28,-19,28,22,8,48,26,-19,35,19,9,48,28,-18,36,21,10,48,29,-18,37,23,9,48,28,-18,36,20,7,41,29,-18,29,23,8,41,32,-19,30,26,14,46,27,-23,37,23,12,46,25,-22,36,20,9,40,28,-22,29,24,11,40,30,-22,30,26,13,41,30,-21,31,27,11,40,29,-21,30,25,13,47,26,-23,36,22,14,47,28,-23,38,24,11,41,32,-19,31,27,9,41,31,-18,30,25,9,49,29,-18,37,21,12,49,30,-19,38,24,14,48,31,-20,39,25,11,48,30,-19,38,23,11,41,31,-18,32,26,13,42,32,-18,33,28,15,48,29,-22,39,25,13,48,27,-23,38,23,13,41,29,-20,31,26,14,41,30,-20,33,28,15,48,29,-22,40,24,11,46,24,-22,36,19,11,49,23,-22,38,17,15,50,27,-22,41,21,14,49,31,-20,40,24,8,48,25,-19,35,19,9,50,25,-19,38,17,14,51,28,-20,42,22,10,49,29,-18,37,22,11,51,27,-18,40,19,13,46,27,-23,37,22,14,49,25,-22,40,19,14,38,33,-22,31,28,13,38,32,-21,30,27,13,40,30,-19,32,25,14,41,31,-20,34,27,13,39,34,-21,31,29,12,39,33,-20,30,28,12,41,31,-18,32,26,13,42,32,-18,33,28,12,38,34,-21,30,28,13,38,34,-22,31,29,13,37,33,-20,30,27,14,38,33,-20,31,29,14,37,34,-21,32,28,13,36,33,-21,31,27,13,37,35,-22,31,28,12,37,34,-22,30,27,12,36,35,-22,31,27,13,36,35,-22,32,28,13,36,34,-21,31,27,14,37,34,-21,32,28,15,35,34,-22,33,26,13,34,34,-22,33,25,14,35,35,-23,33,26,13,34,35,-23,32,25,11,31,32,-24,31,24,12,32,32,-24,32,25,12,32,31,-22,31,24,13,33,32,-23,32,26,12,34,32,-22,30,27,11,34,31,-22,29,25,11,33,33,-24,30,27,10,33,32,-24,29,25,10,34,32,-24,29,26,11,34,34,-24,30,27,11,34,31,-22,29,25,12,34,32,-22,30,27,12,36,32,-21,29,28,10,36,31,-21,28,26,11,36,33,-23,28,28,9,36,32,-23,27,27,11,41,32,-19,31,27,9,41,31,-19,30,25,9,37,32,-22,27,27,11,37,33,-22,28,28,12,40,30,-21,32,26,11,40,29,-20,31,24,10,36,31,-23,28,26,12,37,32,-23,29,28,9,36,31,-23,27,26,8,36,30,-23,26,25,9,40,28,-21,30,23,10,41,30,-21,31,25,8,36,33,-22,26,27,7,36,31,-22,25,25,7,41,30,-19,29,24,8,41,31,-19,30,26,7,35,31,-23,25,25,8,35,33,-23,26,27,8,36,30,-22,26,25,9,36,31,-22,27,26,10,35,31,-24,28,26,9,34,30,-24,27,24,9,34,32,-25,27,26,8,33,31,-25,26,25,9,33,30,-25,27,24,10,33,31,-25,28,26,9,34,30,-23,27,24,10,34,31,-24,28,26,11,34,30,-23,30,25,10,33,29,-23,29,24,11,32,30,-25,30,24,10,32,29,-24,29,23,8,33,29,-27,26,23,9,33,30,-27,26,24,9,34,28,-26,26,23,9,34,29,-26,27,24,8,35,30,-24,26,25,7,35,29,-24,25,24,8,34,31,-25,25,25,7,34,29,-25,24,24,6,34,30,-24,24,24,7,35,31,-24,25,26,7,35,29,-24,26,24,8,35,30,-24,26,25,7,37,30,-23,26,25,6,37,29,-22,26,24,6,36,31,-23,25,26,5,36,30,-22,24,24,6,42,30,-19,29,25,5,41,28,-19,28,22,5,37,30,-21,25,24,6,37,31,-22,26,26,8,41,29,-21,30,24,7,40,27,-21,29,22,6,36,29,-23,25,24,7,37,30,-23,26,25,6,34,30,-25,24,24,7,35,29,-24,25,24,8,35,30,-24,26,25,7,34,31,-25,25,26,5,36,30,-22,24,24,6,36,29,-23,25,24,7,37,30,-23,26,25,6,37,31,-22,25,26,8,36,33,-22,26,27,9,36,32,-23,27,27,8,36,30,-22,26,25,7,36,31,-22,25,25,9,33,32,-25,27,26,10,34,31,-24,28,26,9,34,30,-24,27,24,8,33,30,-25,27,24,9,36,32,-22,27,27,10,36,31,-22,28,26,12,36,32,-22,29,28,11,37,33,-22,28,28,10,34,33,-24,29,25,11,34,31,-22,29,25,12,34,32,-22,30,27,11,34,34,-24,30,27,13,39,34,-21,30,29,14,38,33,-21,31,29,13,38,33,-21,30,27,12,38,34,-21,29,28,13,37,35,-22,32,28,14,37,34,-21,32,28,13,36,34,-21,31,27,12,36,35,-22,31,27,8,43,24,-19,31,19,9,43,27,-22,31,20,11,43,25,-23,31,18,9,42,23,-20,31,17,7,40,24,-20,27,19,9,40,26,-22,29,20,10,40,25,-23,29,18,9,39,23,-21,28,17,12,45,26,-23,35,21,8,45,28,-19,33,22,11,48,23,-21,36,16,9,48,24,-19,36,18,9,41,23,-21,29,17,7,42,24,-20,29,19,11,41,25,-23,30,18,9,42,26,-22,30,20,9,39,23,-22,27,18,7,39,25,-21,27,20,10,39,25,-23,29,18,9,39,26,-22,29,20,9,36,26,-24,27,21,10,36,26,-25,27,20,8,36,25,-24,26,21,9,36,25,-25,26,19,7,42,24,-19,30,19,9,42,26,-21,31,20,11,42,25,-23,31,18,9,42,23,-20,30,17,10,40,25,-23,29,18,9,39,23,-22,27,17,9,40,26,-22,29,20,7,39,24,-21,27,19,9,47,26,-20,35,20,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000029", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,63,-5,-7,65,-1,8,69,6,-2,71,10,1,75,-10,-8,77,-6,7,80,2,-1,81,5,6,66,0,-6,68,5,6,79,-5,-6,81,0,2,60,4,-2,61,6,4,63,11,1,63,12,9,74,4,-3,76,9,1,70,-10,-9,72,-6,7,73,-4,-7,75,1,4,71,12,-3,64,-5,3,82,4,-3,77,-10,0,67,2,0,82,-4,0,60,5,3,63,12,3,76,8,-4,70,-9,8,72,4,-3,74,8,2,66,-8,-8,68,-3,7,69,-2,-7,71,3,3,74,9,-4,67,-7,28,45,7,-30,36,8,28,48,4,-32,39,5,26,52,3,-31,43,4,23,54,3,-29,46,5,20,53,6,-25,46,7,19,49,9,-23,42,10,21,45,10,-24,38,11,25,43,9,-27,35,10,11,25,-22,-9,24,-23,12,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-6,25,-18,18,36,-16,-19,32,-16,16,31,-14,-16,28,-14,15,41,-18,-18,37,-17,11,43,-17,-15,41,-16,7,42,-14,-10,41,-14,6,37,-11,-8,37,-11,9,32,-9,-8,31,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-3,20,46,-8,-24,40,-7,16,48,-7,-21,44,-6,13,47,-4,-18,44,-4,12,43,-2,-15,40,-1,14,39,0,-16,35,0,18,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,21,-34,15,35,29,16,23,-32,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,34,6,29,46,5,-33,36,8,30,48,10,-34,40,11,27,49,13,-32,42,14,22,48,13,-27,43,15,19,47,10,-23,40,13,19,45,5,-22,37,9,21,45,2,-25,34,6,30,37,8,-33,29,14,26,35,4,-29,26,12,30,38,12,-34,32,18,27,39,16,-32,35,21,23,39,16,-27,35,21,19,37,12,-23,33,19,19,36,8,-22,29,15,22,35,4,-24,27,12,30,29,10,-33,23,19,27,28,7,-29,21,17,31,31,14,-34,26,22,28,32,18,-32,29,25,23,32,18,-28,29,26,20,30,15,-24,27,24,19,29,10,-23,24,20,22,28,7,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,15,25,30,22,18,-34,20,29,28,23,20,-32,22,31,24,23,20,-28,22,32,22,22,18,-25,21,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-31,41,14,29,53,8,-34,43,9,24,55,9,-30,47,11,21,50,12,-25,43,13,24,45,11,-26,37,12,29,46,9,-32,37,10,24,54,4,-30,46,5,19,53,6,-25,46,8,19,46,7,-23,40,8,24,44,5,-27,36,6,27,49,3,-31,40,4,21,49,2,-26,42,3,29,52,11,-33,42,12,26,53,12,-31,44,14,27,55,9,-33,45,10,28,48,11,-32,38,13,30,49,8,-34,39,10,24,50,13,-28,42,15,22,53,12,-28,45,13,26,47,13,-29,38,14,22,47,12,-26,40,13,27,45,10,-29,36,11,29,47,6,-32,38,7,28,51,6,-32,42,7,27,54,5,-33,45,7,24,55,7,-30,47,8,21,54,8,-27,47,10,21,52,9,-26,44,10,20,48,10,-24,41,11,21,45,9,-24,38,10,24,44,8,-26,36,9,27,44,7,-30,36,7,26,52,3,-31,43,4,21,54,5,-27,47,6,18,49,7,-23,43,8,21,44,6,-24,38,7,26,46,3,-29,37,4,24,49,2,-29,41,3,23,52,2,-28,44,3,20,51,4,-25,44,5,20,47,4,-24,41,5,23,46,3,-26,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,1,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,66,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,-1,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,54,8,-28,48,1,24,53,9,-27,46,2,22,53,10,-26,46,3,21,54,10,-25,48,5,21,56,10,-26,50,6,22,58,10,-27,51,5,24,58,9,-29,51,3,26,56,8,-29,50,1,22,52,2,-21,49,-1,24,54,2,-23,51,-2,19,52,3,-20,49,0,17,54,4,-19,50,2,18,56,4,-20,53,3,19,58,3,-22,54,2,22,58,2,-23,55,0,24,57,2,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,17,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,17,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,16,52,-4,-13,53,-3,15,54,-4,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,14,52,26,-22,41,19,12,52,25,-21,42,19,12,51,24,-19,42,18,12,50,23,-19,41,17,13,49,23,-19,40,17,14,49,24,-21,39,17,15,50,25,-22,39,18,15,51,26,-23,40,18,25,58,12,-31,50,5,24,59,11,-30,51,5,22,57,9,-28,51,4,23,55,9,-27,49,2,24,53,9,-27,47,1,26,53,10,-29,46,1,27,55,11,-31,47,3,27,57,12,-32,48,4,15,54,21,-23,44,15,17,54,22,-25,43,15,14,53,20,-21,44,14,14,51,19,-21,43,13,16,50,19,-21,41,12,17,50,20,-23,40,13,18,51,22,-25,41,13,18,52,22,-25,42,15,21,58,13,-28,50,8,23,57,14,-30,48,8,20,56,12,-26,49,6,20,54,11,-25,48,5,22,52,11,-25,45,4,24,51,12,-27,44,4,25,53,14,-29,45,5,24,55,15,-30,46,7,23,58,11,-29,51,6,25,58,12,-31,50,5,21,57,10,-27,50,5,22,55,10,-26,49,3,23,53,10,-26,47,2,25,53,11,-29,46,2,26,54,11,-30,46,3,26,56,12,-32,48,4,30,14,15,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,22,4,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,4,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,4,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,10,40,28,-22,30,25,8,40,27,-22,29,22,11,46,24,-22,35,19,13,46,26,-23,37,21,7,41,30,-19,30,24,6,41,28,-19,28,22,8,48,26,-19,35,19,9,48,28,-18,36,21,10,48,29,-18,37,23,9,48,27,-18,36,20,7,41,29,-18,29,23,9,41,31,-18,30,26,14,46,27,-23,37,23,12,47,25,-22,36,20,10,40,28,-21,29,23,12,40,29,-22,30,26,14,40,30,-21,31,27,12,40,28,-21,30,25,13,47,26,-23,36,22,15,47,28,-22,38,24,12,41,32,-19,31,27,10,41,30,-18,30,25,10,48,29,-18,37,21,12,48,30,-19,38,24,14,48,30,-20,39,25,11,48,30,-19,38,23,12,41,30,-17,32,26,14,41,31,-18,33,28,15,48,28,-22,39,25,13,48,27,-22,38,23,14,41,28,-20,31,26,15,42,30,-20,33,28,15,48,29,-22,40,24,11,46,24,-22,36,19,11,49,23,-22,38,17,15,50,27,-22,41,21,14,49,30,-20,40,24,8,48,25,-19,35,19,9,50,25,-19,38,17,14,51,28,-20,42,22,10,49,29,-18,37,22,11,51,27,-18,40,19,14,46,26,-23,37,22,14,50,25,-22,40,19,15,38,32,-21,31,28,14,38,31,-21,30,27,13,40,29,-19,32,25,15,41,30,-19,34,27,14,39,33,-20,31,29,13,38,33,-20,30,28,13,41,30,-18,32,26,14,42,31,-18,33,28,13,37,33,-21,29,28,14,38,34,-21,30,29,14,37,32,-20,30,27,15,38,32,-20,31,29,15,37,33,-21,32,28,14,36,32,-21,31,27,15,37,34,-22,31,28,14,36,33,-22,30,27,14,36,33,-22,31,27,15,36,34,-22,32,28,14,36,32,-21,31,27,15,37,33,-21,32,28,16,35,32,-22,33,26,15,35,32,-22,33,25,16,35,33,-23,33,26,15,34,33,-23,32,25,13,32,30,-24,31,24,14,32,30,-24,32,25,13,33,29,-22,31,24,15,33,30,-23,32,26,14,34,31,-22,30,27,12,34,30,-22,29,25,13,33,32,-24,30,27,12,33,31,-24,29,25,12,33,31,-23,29,26,13,34,32,-24,29,27,12,34,30,-22,29,25,14,34,31,-22,30,27,13,36,31,-21,29,28,12,36,30,-21,28,26,12,36,33,-23,28,28,11,35,31,-22,27,27,12,40,32,-19,31,27,10,40,30,-19,30,25,11,36,31,-21,27,27,12,36,33,-22,28,28,13,40,30,-20,32,26,12,40,29,-20,31,24,12,36,30,-23,28,26,13,36,31,-23,29,28,11,36,30,-23,27,26,9,35,29,-23,26,25,10,40,28,-20,30,23,11,40,29,-21,31,25,9,36,32,-22,26,27,8,35,30,-21,25,25,8,40,29,-18,29,24,9,41,31,-19,30,26,8,34,30,-23,25,25,10,35,31,-23,26,27,9,36,29,-22,26,25,10,36,31,-22,27,26,12,35,30,-23,28,26,10,34,28,-23,28,24,11,33,30,-25,27,26,10,33,29,-24,26,24,11,33,29,-25,27,24,12,33,30,-25,28,25,10,34,28,-23,27,24,12,35,30,-23,28,26,13,35,28,-23,30,25,12,34,27,-23,29,24,13,33,28,-24,30,24,12,33,27,-24,29,23,11,33,27,-27,26,23,11,34,28,-27,26,24,10,35,27,-26,26,23,11,35,28,-26,27,24,10,35,29,-24,26,25,9,35,28,-24,25,24,10,34,29,-25,25,25,9,33,28,-25,24,24,8,34,28,-24,24,24,9,34,30,-24,25,26,9,35,28,-24,26,23,10,35,29,-24,26,25,9,37,29,-23,26,25,8,36,28,-22,26,24,8,35,30,-23,25,26,7,35,29,-22,24,24,7,41,30,-19,29,25,6,40,28,-19,28,22,6,36,29,-21,25,24,8,37,30,-22,26,26,9,41,28,-21,30,24,8,40,27,-21,29,22,8,36,28,-23,26,24,9,36,29,-23,26,25,8,34,28,-25,24,24,9,35,28,-24,25,24,10,35,29,-24,26,25,9,34,29,-25,25,26,6,35,29,-22,24,24,7,36,28,-23,25,24,9,36,30,-23,26,25,8,36,31,-22,25,26,9,35,32,-22,26,27,10,36,31,-22,27,27,9,35,29,-22,26,25,8,35,30,-22,25,25,11,33,30,-25,28,26,12,35,30,-24,28,26,10,34,28,-23,27,24,10,33,29,-25,27,24,11,36,31,-22,27,27,12,36,30,-22,28,26,13,36,31,-22,29,28,12,36,33,-22,28,28,12,33,31,-24,29,25,12,34,30,-22,29,25,14,34,31,-22,30,27,13,33,32,-24,30,27,14,38,33,-21,30,29,15,38,32,-21,31,29,14,37,32,-21,30,27,13,38,33,-21,29,28,15,36,34,-22,31,28,15,37,33,-21,32,28,14,36,32,-21,31,27,14,36,34,-22,31,27,8,43,24,-19,31,19,10,43,26,-21,31,20,12,43,24,-23,31,18,10,43,22,-20,31,16,8,39,24,-20,27,19,9,40,26,-22,29,20,11,40,24,-23,29,18,10,40,23,-21,28,17,12,45,26,-23,35,21,8,44,28,-19,33,22,11,48,23,-21,36,16,9,48,24,-19,36,18,10,41,22,-20,29,17,8,41,24,-20,29,19,11,41,24,-23,30,18,10,41,26,-22,30,20,10,39,23,-22,27,18,8,39,24,-21,27,20,11,39,24,-23,29,18,10,39,26,-22,29,20,10,36,26,-24,27,21,11,36,25,-25,27,20,9,36,25,-24,26,21,10,36,24,-25,26,19,8,42,24,-19,30,19,10,42,26,-21,31,20,12,42,24,-23,31,18,10,42,22,-20,30,17,11,40,24,-23,29,18,10,39,23,-22,27,17,10,39,26,-22,29,20,8,39,24,-21,27,19,9,47,26,-20,35,20,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }, + { "name": "animation_000030", "vertices": [27,0,-78,27,0,-24,-27,0,-24,-27,0,-78,27,24,-78,27,24,-24,-27,24,-24,-27,24,-78,2,63,-5,-7,65,-1,8,69,6,-2,71,10,1,75,-10,-8,77,-6,7,80,2,-1,81,5,6,66,0,-6,68,5,6,79,-5,-6,81,0,2,60,4,-2,61,6,4,63,11,1,63,12,9,74,4,-3,76,9,1,70,-10,-9,72,-6,7,73,-4,-7,75,1,4,71,12,-3,64,-5,3,82,4,-3,77,-10,0,67,2,0,82,-4,0,60,5,3,63,12,3,76,8,-4,70,-9,8,72,4,-3,74,8,2,66,-8,-8,68,-3,7,69,-2,-7,71,3,3,74,9,-4,67,-7,28,45,7,-30,36,8,28,48,4,-32,39,5,26,52,3,-31,43,4,23,54,3,-28,46,5,20,53,6,-25,46,7,19,49,9,-23,43,10,21,45,10,-24,38,11,25,43,9,-27,35,10,11,25,-22,-9,24,-23,12,30,-26,-11,29,-26,10,35,-27,-11,35,-27,7,39,-24,-9,39,-23,4,39,-19,-7,40,-18,4,34,-14,-5,35,-14,6,28,-13,-5,28,-13,9,25,-17,-6,25,-18,18,36,-16,-19,32,-16,16,31,-14,-16,28,-14,15,41,-18,-18,37,-17,11,43,-17,-14,41,-16,7,42,-14,-10,41,-14,6,37,-11,-8,37,-10,9,32,-9,-8,30,-9,13,30,-11,-12,27,-11,23,42,-7,-25,36,-6,22,38,-4,-23,32,-3,20,46,-8,-24,41,-7,16,48,-7,-21,44,-6,13,47,-4,-18,44,-3,12,43,-2,-15,40,-1,14,39,0,-16,35,0,18,36,-1,-19,31,-1,28,12,15,-30,10,31,30,14,17,-33,12,32,31,15,21,-34,15,35,29,16,23,-32,17,37,25,16,23,-29,17,37,23,14,21,-26,15,36,22,13,17,-25,12,33,24,12,15,-27,10,31,26,45,2,-29,34,6,29,46,5,-33,37,8,30,48,10,-34,40,11,27,49,13,-32,42,14,22,48,13,-27,43,15,19,47,10,-23,40,13,19,45,5,-22,37,9,21,45,2,-25,34,6,30,37,8,-33,29,14,26,35,4,-29,26,12,30,38,12,-34,32,18,27,39,16,-32,35,21,23,39,16,-27,35,21,19,37,12,-23,33,19,19,36,8,-22,29,15,22,35,4,-24,27,12,30,29,10,-33,23,19,27,28,7,-29,21,17,31,31,14,-34,26,22,28,32,18,-32,29,25,23,32,18,-27,29,26,20,30,15,-24,27,24,19,29,10,-23,24,20,22,28,7,-25,21,18,30,21,14,-33,17,26,27,20,11,-30,15,25,30,22,18,-34,20,29,28,23,20,-32,22,31,24,23,20,-28,22,32,22,22,18,-25,21,30,21,20,14,-24,18,27,24,20,11,-26,16,25,27,50,13,-31,41,14,29,53,8,-34,43,9,24,55,9,-30,47,11,21,50,12,-25,43,13,24,45,11,-26,37,12,29,46,9,-32,37,10,24,54,4,-30,46,5,19,53,6,-25,46,8,19,46,7,-23,40,8,24,44,5,-27,36,6,27,49,3,-31,40,4,21,49,2,-26,42,3,29,52,11,-33,42,12,26,53,12,-31,44,14,27,55,9,-32,45,10,28,48,11,-32,38,13,30,49,8,-34,39,10,24,50,13,-28,42,15,22,53,12,-28,45,13,26,47,13,-29,38,14,22,47,12,-25,40,13,27,45,10,-29,36,11,29,47,6,-32,38,7,28,51,6,-32,42,7,27,54,5,-33,45,7,24,55,7,-30,47,8,21,54,8,-27,47,10,21,52,9,-26,44,10,20,48,10,-24,41,11,21,45,9,-24,38,10,24,44,8,-26,36,9,27,44,7,-30,36,7,26,52,3,-31,43,4,21,54,5,-27,47,6,18,49,7,-23,43,8,21,44,6,-24,38,7,26,46,3,-29,38,4,24,49,2,-29,41,3,23,52,2,-28,44,3,20,51,4,-25,44,5,20,47,4,-24,41,5,23,46,3,-26,39,4,11,26,-27,-11,26,-27,11,34,-19,-11,34,-19,8,38,-34,-8,38,-34,8,44,-24,-8,44,-24,0,31,-15,0,22,-25,0,45,-22,0,37,-35,13,30,-23,-13,30,-23,10,41,-28,-10,41,-28,0,24,-21,0,43,-29,10,38,-21,-10,38,-21,10,29,-30,-10,29,-30,0,37,-17,0,27,-33,12,36,-25,-12,36,-25,3,33,-16,-3,33,-16,6,23,-27,-6,23,-27,4,45,-22,-4,45,-22,4,37,-35,-4,37,-35,4,27,-22,-4,27,-22,5,43,-29,-5,43,-29,4,38,-18,-4,38,-18,5,27,-33,-5,27,-33,8,38,-33,-9,37,-31,11,37,-28,-10,36,-25,9,35,-22,-7,34,-20,1,34,-18,0,38,-34,6,52,-31,-8,51,-29,10,50,-25,-10,49,-23,7,49,-19,-5,49,-17,0,49,-16,0,51,-31,9,44,-26,-9,43,-24,7,45,-32,-9,44,-30,7,42,-20,-6,41,-18,1,41,-17,0,45,-32,6,56,-29,-8,52,-26,9,50,-27,-9,46,-25,8,44,-26,-5,41,-24,2,41,-24,-1,55,-28,6,59,-22,-8,55,-20,11,55,-19,-10,50,-15,10,49,-14,-5,46,-11,2,47,-12,-1,59,-23,10,52,-23,-9,47,-19,6,57,-26,-8,53,-23,9,47,-18,-5,44,-16,2,44,-17,-1,57,-25,6,59,-22,-8,55,-20,11,55,-19,-10,50,-16,10,50,-14,-5,46,-11,2,47,-12,-1,59,-22,4,65,-8,-6,63,-7,7,62,-8,-7,59,-6,5,58,-8,-4,56,-6,1,55,-7,-1,65,-8,2,65,-7,-4,63,-7,4,62,-7,-4,60,-7,4,58,-7,-2,57,-6,1,56,-6,0,65,-7,1,64,-2,-2,63,-2,3,62,-2,-3,61,-2,3,59,-2,-1,58,-2,0,57,-2,0,65,-2,1,64,-2,-2,63,-2,3,62,-1,-3,60,-1,3,59,0,-1,58,0,0,58,0,0,64,-3,1,66,-1,-3,66,0,3,64,0,-3,62,0,3,61,0,-2,60,1,0,59,1,-1,67,-1,19,54,-9,-14,56,-8,18,52,-8,-12,54,-7,15,52,-7,-11,54,-5,13,54,-7,-10,56,-3,13,57,-7,-11,59,-2,15,59,-7,-13,60,-3,18,59,-8,-14,60,-5,19,57,-9,-15,59,-7,26,54,8,-28,48,1,24,53,9,-27,46,2,22,53,10,-26,46,3,21,54,10,-25,48,5,21,56,10,-26,50,6,22,58,10,-27,51,5,24,58,9,-29,51,3,26,56,8,-29,50,1,22,52,2,-21,49,-1,24,54,2,-23,51,-2,19,52,3,-20,49,0,17,54,4,-19,50,2,18,56,4,-20,53,3,19,58,3,-22,54,2,22,58,2,-23,55,0,24,57,2,-24,53,-2,20,52,-2,-17,51,-4,22,54,-3,-19,53,-5,17,52,-1,-16,51,-1,16,54,0,-15,53,0,16,57,0,-16,55,0,17,59,-1,-18,57,0,20,59,-2,-19,57,-2,22,57,-3,-20,56,-4,19,52,-5,-15,53,-5,21,54,-6,-16,55,-6,16,52,-4,-13,53,-3,15,54,-4,-13,54,-1,15,57,-4,-14,57,0,16,59,-4,-15,59,-1,19,59,-5,-17,59,-4,21,57,-6,-17,57,-6,14,52,26,-22,41,19,12,52,25,-21,42,19,12,51,24,-19,42,18,12,50,23,-19,41,17,13,49,23,-19,40,17,14,49,24,-21,39,17,15,50,25,-22,39,18,15,51,26,-23,40,18,25,58,12,-31,50,5,24,59,11,-30,51,5,22,57,9,-28,51,4,23,55,9,-27,49,2,24,53,9,-27,47,1,26,53,10,-29,46,1,27,55,11,-31,47,3,27,57,12,-32,48,4,15,54,21,-23,44,15,17,54,22,-25,43,15,14,53,20,-21,44,14,14,51,19,-21,43,13,16,50,19,-21,41,12,17,50,20,-23,40,13,18,51,22,-24,41,13,18,52,22,-25,42,15,21,58,13,-28,50,8,23,57,14,-30,48,8,20,56,12,-26,49,6,20,54,11,-25,48,5,22,52,11,-25,45,4,24,51,12,-27,44,4,25,53,14,-29,45,5,24,55,15,-30,46,7,23,58,11,-29,51,6,25,58,12,-31,50,5,21,57,10,-27,50,5,22,55,10,-26,49,3,23,53,10,-26,47,2,25,53,11,-29,46,2,26,54,11,-30,46,3,26,56,12,-32,48,4,30,14,15,-32,14,32,31,14,23,-34,14,39,25,14,25,-28,14,41,23,14,17,-26,15,33,35,2,23,-38,2,39,30,4,12,-32,5,28,23,4,22,-26,5,38,22,4,15,-25,5,31,26,2,31,-29,2,47,26,7,31,-29,7,47,36,2,28,-40,2,43,34,7,28,-38,8,44,28,14,25,-31,14,41,26,14,15,-29,14,31,25,4,12,-28,5,28,30,8,30,-33,9,46,31,14,19,-34,14,35,23,14,21,-26,14,37,32,4,17,-35,4,33,22,4,17,-25,5,34,30,8,30,-33,9,46,34,7,28,-38,8,44,37,2,28,-40,2,43,26,7,31,-29,7,48,26,2,31,-29,2,48,31,6,38,-35,6,54,28,5,37,-32,6,53,36,5,34,-40,5,50,37,2,34,-41,2,50,28,2,38,-32,2,54,31,2,38,-35,2,54,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,0,31,-29,0,48,37,0,28,-40,0,43,30,0,30,-33,0,46,26,0,17,-29,0,34,22,0,17,-25,0,34,32,0,17,-35,0,33,30,0,30,-33,0,46,25,0,12,-28,0,28,28,0,23,-31,0,39,36,0,28,-40,0,43,26,0,31,-29,0,47,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,31,2,38,-35,2,54,28,2,38,-32,2,54,37,2,34,-41,2,50,28,0,38,-32,0,54,31,0,38,-35,0,54,37,0,34,-41,0,50,26,2,31,-29,2,48,26,0,31,-29,0,48,37,2,28,-40,2,43,37,0,28,-40,0,43,22,4,17,-25,5,34,32,4,17,-35,4,33,22,0,17,-25,0,34,32,0,17,-35,0,33,25,4,12,-28,5,28,25,0,12,-28,0,28,36,0,28,-40,0,43,36,2,28,-40,2,43,26,0,31,-29,0,47,26,2,31,-29,2,47,22,4,15,-25,5,31,23,4,22,-26,5,38,30,4,12,-32,5,28,35,2,23,-38,2,39,22,0,15,-25,0,31,23,0,22,-26,0,38,35,0,23,-38,0,39,29,0,12,-32,0,28,17,58,-13,-15,60,-9,15,54,-11,-13,55,-8,3,55,-11,-1,54,-11,7,61,-18,-5,62,-16,18,60,-6,-13,62,-3,15,54,-5,-12,55,-2,3,55,-7,0,55,-7,9,64,-8,-5,64,-6,10,53,-12,-9,54,-9,14,56,-16,-12,57,-13,12,56,-5,-8,57,-3,14,62,-6,-9,63,-3,16,55,-12,-14,57,-9,6,59,-17,-4,59,-15,17,57,-4,-13,58,-1,10,58,-11,-7,59,-9,13,53,-15,-12,55,-12,12,59,-4,-8,60,-2,14,53,-8,-11,54,-5,18,60,-10,-14,62,-6,2,54,-8,0,54,-8,9,64,-12,-5,65,-11,10,53,-8,-7,53,-6,14,63,-12,-10,64,-9,13,53,-11,-11,54,-8,16,57,-14,-14,59,-11,14,55,-4,-10,56,-1,16,61,-6,-12,62,-3,14,54,-14,-13,56,-10,15,58,-4,-10,59,-1,12,53,-8,-9,54,-5,16,61,-11,-12,63,-7,10,40,28,-21,30,25,8,40,27,-21,29,22,11,46,24,-22,35,19,13,46,26,-22,36,21,7,41,30,-18,30,24,6,41,28,-18,29,22,8,48,26,-19,35,19,9,48,28,-18,36,21,10,48,29,-18,37,22,9,48,27,-18,36,20,7,41,29,-17,29,23,9,41,31,-17,30,26,14,46,27,-23,37,23,12,47,25,-22,36,20,10,40,27,-21,29,24,12,40,29,-21,30,26,14,40,30,-20,31,27,12,40,28,-20,30,25,13,47,26,-23,36,22,15,47,28,-22,38,24,12,41,32,-18,32,27,10,41,30,-17,31,25,10,48,29,-18,37,21,12,48,30,-18,38,23,14,48,30,-20,39,25,11,48,30,-18,38,23,12,41,30,-17,32,26,14,41,31,-17,33,28,15,48,28,-22,38,25,13,48,27,-22,37,23,14,41,28,-19,31,26,15,42,30,-19,33,28,15,48,29,-22,39,24,11,47,24,-22,35,19,11,49,23,-22,38,17,15,50,27,-22,41,21,14,49,30,-20,40,24,8,48,25,-19,36,18,9,50,25,-19,38,17,14,51,28,-20,42,22,10,49,29,-18,37,22,11,51,27,-18,40,19,14,46,26,-23,37,22,14,50,25,-22,40,19,15,38,32,-20,31,28,14,38,31,-20,30,27,14,40,29,-18,33,25,15,41,30,-19,34,27,14,39,33,-19,31,29,13,38,32,-19,30,28,13,41,30,-17,32,26,14,42,31,-17,33,28,13,37,33,-20,29,28,15,38,33,-20,30,29,14,37,32,-19,30,27,15,38,32,-19,31,29,15,37,33,-20,32,28,14,36,32,-20,31,27,15,37,34,-21,31,28,14,36,33,-21,30,27,14,35,33,-21,31,27,15,36,34,-21,31,28,14,36,32,-20,31,27,15,37,33,-20,32,28,16,36,32,-21,33,26,15,35,31,-21,32,25,16,35,32,-22,33,27,15,34,32,-22,32,26,14,32,29,-23,31,24,15,33,30,-23,31,26,14,34,29,-22,31,25,15,34,30,-22,32,26,14,35,31,-21,30,27,12,34,30,-21,29,25,14,33,31,-23,30,27,12,33,30,-23,29,26,12,33,31,-22,28,26,13,34,32,-23,29,27,13,34,30,-21,29,25,14,34,31,-21,30,27,13,36,31,-20,29,28,12,36,30,-20,28,26,12,36,32,-21,28,28,11,35,31,-21,27,27,12,40,31,-18,31,27,10,40,30,-18,30,25,11,36,31,-20,27,27,12,36,32,-20,28,28,13,40,30,-20,32,26,12,40,29,-19,31,24,12,36,30,-21,28,26,13,36,31,-22,29,28,11,36,30,-22,27,26,9,35,29,-22,26,25,10,40,28,-20,30,23,11,40,29,-20,31,25,9,36,32,-20,26,27,8,35,30,-20,25,25,8,40,29,-17,29,24,9,41,31,-18,30,25,9,34,30,-21,25,25,10,35,31,-22,26,27,9,36,29,-20,26,25,10,36,30,-21,27,26,12,35,29,-22,28,26,11,35,28,-22,27,24,11,33,30,-23,27,26,10,33,29,-23,26,25,11,33,28,-24,27,24,12,33,29,-24,28,26,11,35,28,-22,27,25,12,35,29,-22,27,26,13,35,28,-22,29,25,12,35,27,-22,29,24,14,34,28,-23,30,25,13,33,27,-23,29,23,11,34,26,-25,25,24,12,34,27,-26,26,25,11,35,26,-25,26,24,11,35,27,-25,26,24,10,35,29,-23,26,25,9,35,27,-23,25,24,10,34,29,-24,25,26,9,34,28,-24,24,24,8,34,28,-23,24,24,9,34,29,-23,25,26,9,35,27,-23,25,24,10,35,29,-23,26,25,9,37,29,-21,26,25,8,36,28,-21,26,24,8,35,30,-21,25,26,7,35,29,-21,24,24,7,41,30,-18,29,25,6,40,28,-18,28,22,7,36,29,-20,25,24,8,36,30,-20,26,26,9,41,28,-20,30,24,8,40,27,-20,29,22,8,36,28,-22,25,24,9,36,29,-22,26,25,9,34,28,-23,24,24,9,35,27,-23,25,24,10,35,29,-23,26,25,10,34,29,-23,24,26,7,35,29,-20,24,24,8,36,28,-21,25,24,9,36,29,-21,26,25,8,36,30,-21,25,26,10,35,32,-21,26,27,11,36,31,-21,27,27,9,35,29,-21,26,25,8,35,30,-21,25,25,12,33,30,-24,27,26,12,35,29,-22,28,26,11,34,28,-22,27,24,11,33,29,-23,26,25,11,36,31,-21,27,27,12,36,30,-21,28,26,13,36,31,-21,29,28,12,36,32,-21,28,28,12,33,31,-23,29,26,12,34,30,-21,29,26,14,34,31,-21,30,27,13,33,32,-23,29,27,14,38,33,-20,30,29,15,38,32,-20,31,29,14,37,32,-19,30,27,13,38,33,-19,29,28,15,36,34,-21,31,28,15,37,33,-20,32,28,14,36,32,-20,31,27,14,36,33,-21,30,27,8,43,24,-18,31,18,10,43,26,-21,31,20,12,43,24,-22,31,18,10,43,22,-19,31,16,8,39,24,-20,27,19,10,40,26,-21,29,20,11,40,24,-22,29,18,10,40,22,-21,28,17,12,45,26,-23,35,21,9,44,28,-19,33,22,11,48,23,-21,36,16,9,48,24,-19,36,18,10,41,22,-20,29,17,8,41,24,-19,29,19,12,41,24,-22,30,18,10,41,26,-21,30,20,10,39,23,-21,27,18,8,39,24,-20,27,20,11,39,24,-22,29,18,10,39,26,-21,29,20,10,36,26,-23,27,21,11,36,25,-24,27,20,9,36,25,-23,25,21,10,36,24,-24,25,20,8,42,24,-19,30,19,10,42,26,-21,31,20,12,42,24,-22,31,18,10,42,22,-20,30,17,11,40,24,-22,29,18,10,39,23,-21,27,17,10,39,26,-21,29,20,8,39,24,-20,27,19,9,46,26,-20,35,20,9,59,-14,-8,54,-11,5,62,-15,-7,59,-14,10,53,-11,-6,49,-8,2,51,-9,-1,62,-15,7,54,-11,-5,54,-10,10,59,-17,-9,60,-14,7,55,-6,-4,55,-5,11,63,-7,-7,64,-5,9,56,-16,-8,57,-14,10,59,-7,-6,60,-5,6,53,-8,-3,54,-7,11,63,-12,-8,64,-10] }], + + "normals": [], + + "colors": [], + + "uvs": [[]], + + "faces": [3,0,1,2,3,0,3,4,7,6,5,0,3,0,4,5,1,0,3,1,5,6,2,0,3,2,6,7,3,0,3,4,0,3,7,0,3,16,10,22,20,1,3,23,11,17,21,1,3,18,28,26,12,1,3,27,29,19,13,1,3,14,24,28,18,1,3,29,25,15,19,1,3,31,8,16,34,1,3,17,9,31,34,1,3,35,18,12,33,1,3,13,19,35,33,1,3,32,14,18,35,1,3,19,15,32,35,1,3,34,16,20,36,1,3,21,17,34,36,1,3,10,30,37,22,1,3,37,30,11,23,1,3,22,37,36,20,1,3,36,37,23,21,1,3,14,32,38,24,1,3,38,32,15,25,1,3,26,39,33,12,1,3,33,39,27,13,1,3,8,42,44,16,1,3,45,43,9,17,1,3,42,26,28,44,1,3,29,27,43,45,1,3,24,40,44,28,1,3,45,41,25,29,1,3,40,10,16,44,1,3,17,11,41,45,1,3,38,46,40,24,1,3,41,46,38,25,1,3,46,30,10,40,1,3,11,30,46,41,1,3,42,8,31,47,1,3,31,9,43,47,1,3,47,39,26,42,1,3,27,39,47,43,1,3,82,64,66,80,2,3,67,65,83,81,2,3,80,66,68,84,2,3,69,67,81,85,2,3,84,68,70,86,2,3,71,69,85,87,2,3,86,70,72,88,2,3,73,71,87,89,2,3,88,72,74,90,2,3,75,73,89,91,2,3,90,74,76,92,2,3,77,75,91,93,2,3,92,76,78,94,2,3,79,77,93,95,2,3,94,78,64,82,2,3,65,79,95,83,2,3,48,98,96,50,2,3,97,99,49,51,2,3,98,82,80,96,2,3,81,83,99,97,2,3,50,96,100,52,2,3,101,97,51,53,2,3,96,80,84,100,2,3,85,81,97,101,2,3,52,100,102,54,2,3,103,101,53,55,2,3,100,84,86,102,2,3,87,85,101,103,2,3,54,102,104,56,2,3,105,103,55,57,2,3,102,86,88,104,2,3,89,87,103,105,2,3,56,104,106,58,2,3,107,105,57,59,2,3,104,88,90,106,2,3,91,89,105,107,2,3,58,106,108,60,2,3,109,107,59,61,2,3,106,90,92,108,2,3,93,91,107,109,2,3,60,108,110,62,2,3,111,109,61,63,2,3,108,92,94,110,2,3,95,93,109,111,2,3,98,48,62,110,2,3,63,49,99,111,2,3,110,94,82,98,2,3,83,95,111,99,2,3,146,128,130,144,2,3,131,129,147,145,2,3,144,130,132,148,2,3,133,131,145,149,2,3,148,132,134,150,2,3,135,133,149,151,2,3,150,134,136,152,2,3,137,135,151,153,2,3,152,136,138,154,2,3,139,137,153,155,2,3,154,138,140,156,2,3,141,139,155,157,2,3,156,140,142,158,2,3,143,141,157,159,2,3,158,142,128,146,2,3,129,143,159,147,2,3,162,146,144,160,2,3,145,147,163,161,2,3,160,144,148,164,2,3,149,145,161,165,2,3,164,148,150,166,2,3,151,149,165,167,2,3,166,150,152,168,2,3,153,151,167,169,2,3,168,152,154,170,2,3,155,153,169,171,2,3,170,154,156,172,2,3,157,155,171,173,2,3,172,156,158,174,2,3,159,157,173,175,2,3,174,158,146,162,2,3,147,159,175,163,2,3,112,178,176,114,2,3,177,179,113,115,2,3,178,162,160,176,2,3,161,163,179,177,2,3,114,176,180,116,2,3,181,177,115,117,2,3,176,160,164,180,2,3,165,161,177,181,2,3,116,180,182,118,2,3,183,181,117,119,2,3,180,164,166,182,2,3,167,165,181,183,2,3,118,182,184,120,2,3,185,183,119,121,2,3,182,166,168,184,2,3,169,167,183,185,2,3,120,184,186,122,2,3,187,185,121,123,2,3,184,168,170,186,2,3,171,169,185,187,2,3,122,186,188,124,2,3,189,187,123,125,2,3,186,170,172,188,2,3,173,171,187,189,2,3,124,188,190,126,2,3,191,189,125,127,2,3,188,172,174,190,2,3,175,173,189,191,2,3,126,190,178,112,2,3,179,191,127,113,2,3,190,174,162,178,2,3,163,175,191,179,2,2,220,216,194,2,2,195,217,221,2,2,216,220,218,2,2,219,221,217,2,2,196,218,220,2,2,221,219,197,2,2,218,192,216,2,2,217,193,219,2,2,224,194,216,2,2,217,195,225,2,2,216,222,224,2,2,225,223,217,2,2,202,224,222,2,2,223,225,203,2,2,222,216,192,2,2,193,217,223,2,2,228,218,196,2,2,197,219,229,2,2,218,228,226,2,2,227,229,219,2,2,198,226,228,2,2,229,227,199,2,2,226,192,218,2,2,219,193,227,2,2,232,226,198,2,2,199,227,233,2,2,226,232,230,2,2,231,233,227,2,2,200,230,232,2,2,233,231,201,2,2,230,192,226,2,2,227,193,231,2,2,234,230,200,2,2,201,231,235,2,2,230,234,222,2,2,223,235,231,2,2,202,222,234,2,2,235,223,203,2,2,222,192,230,2,2,231,193,223,2,2,238,194,224,2,2,225,195,239,2,2,224,236,238,2,2,239,237,225,2,2,212,238,236,2,2,237,239,213,2,2,236,224,202,2,2,203,225,237,2,2,242,196,220,2,2,221,197,243,2,2,220,240,242,2,2,243,241,221,2,2,204,242,240,2,2,241,243,205,2,2,240,220,194,2,2,195,221,241,2,2,246,198,228,2,2,229,199,247,2,2,228,244,246,2,2,247,245,229,2,2,206,246,244,2,2,245,247,207,2,2,244,228,196,2,2,197,229,245,2,2,250,200,232,2,2,233,201,251,2,2,232,248,250,2,2,251,249,233,2,2,208,250,248,2,2,249,251,209,2,2,248,232,198,2,2,199,233,249,2,2,254,202,234,2,2,235,203,255,2,2,234,252,254,2,2,255,253,235,2,2,210,254,252,2,2,253,255,211,2,2,252,234,200,2,2,201,235,253,2,2,256,238,212,2,2,213,239,257,2,2,238,256,240,2,2,241,257,239,2,2,204,240,256,2,2,257,241,205,2,2,240,194,238,2,2,239,195,241,2,2,258,242,204,2,2,205,243,259,2,2,242,258,244,2,2,245,259,243,2,2,206,244,258,2,2,259,245,207,2,2,244,196,242,2,2,243,197,245,2,2,260,246,206,2,2,207,247,261,2,2,246,260,248,2,2,249,261,247,2,2,208,248,260,2,2,261,249,209,2,2,248,198,246,2,2,247,199,249,2,2,262,250,208,2,2,209,251,263,2,2,250,262,252,2,2,253,263,251,2,2,210,252,262,2,2,263,253,211,2,2,252,200,250,2,2,251,201,253,2,2,264,254,210,2,2,211,255,265,2,2,254,264,236,2,2,237,265,255,2,2,212,236,264,2,2,265,237,213,2,2,236,202,254,2,2,255,203,237,2,2,268,204,256,2,2,257,205,269,2,2,256,266,268,2,2,269,267,257,2,2,214,268,266,2,2,267,269,215,2,2,266,256,212,2,2,213,257,267,2,2,270,206,258,2,2,259,207,271,2,2,258,268,270,2,2,271,269,259,2,2,214,270,268,2,2,269,271,215,2,2,268,258,204,2,2,205,259,269,2,2,272,208,260,2,2,261,209,273,2,2,260,270,272,2,2,273,271,261,2,2,214,272,270,2,2,271,273,215,2,2,270,260,206,2,2,207,261,271,2,2,274,210,262,2,2,263,211,275,2,2,262,272,274,2,2,275,273,263,2,2,214,274,272,2,2,273,275,215,2,2,272,262,208,2,2,209,263,273,2,2,266,212,264,2,2,265,213,267,2,2,264,274,266,2,2,267,275,265,2,2,214,266,274,2,2,275,267,215,2,2,274,264,210,2,2,211,265,275,2,3,290,300,296,280,2,3,297,301,291,281,2,3,300,288,276,296,2,3,277,289,301,297,2,3,282,294,300,290,2,3,301,295,283,291,2,3,294,278,288,300,2,3,289,279,295,301,2,3,288,310,304,276,2,3,305,311,289,277,2,3,310,292,285,304,2,3,285,292,311,305,2,3,278,302,310,288,2,3,311,303,279,289,2,3,302,284,292,310,2,3,292,284,303,311,2,3,293,312,308,287,2,3,309,313,293,287,2,3,312,290,280,308,2,3,281,291,313,309,2,3,286,306,312,293,2,3,313,307,286,293,2,3,306,282,290,312,2,3,291,283,307,313,2,3,298,314,306,286,2,3,307,315,298,286,2,3,314,294,282,306,2,3,283,295,315,307,2,3,284,302,314,298,2,3,315,303,284,298,2,3,302,278,294,314,2,3,295,279,303,315,2,3,296,316,308,280,2,3,309,317,297,281,2,3,316,299,287,308,2,3,287,299,317,309,2,3,276,304,316,296,2,3,317,305,277,297,2,3,304,285,299,316,2,3,299,285,305,317,2,3,318,336,334,320,2,3,335,337,319,321,2,3,336,326,328,334,2,3,329,327,337,335,2,3,320,334,338,322,2,3,339,335,321,323,2,3,334,328,330,338,2,3,331,329,335,339,2,3,322,338,340,324,2,3,340,339,323,324,2,3,338,330,332,340,2,3,332,331,339,340,2,3,325,341,336,318,2,3,337,341,325,319,2,3,341,333,326,336,2,3,327,333,341,337,2,3,342,360,358,344,2,3,359,361,343,345,2,3,360,350,352,358,2,3,353,351,361,359,2,3,344,358,362,346,2,3,363,359,345,347,2,3,358,352,354,362,2,3,355,353,359,363,2,3,346,362,364,348,2,3,364,363,347,348,2,3,362,354,356,364,2,3,356,355,363,364,2,3,349,365,360,342,2,3,361,365,349,343,2,3,365,357,350,360,2,3,351,357,365,361,2,3,382,390,392,384,2,3,393,391,383,385,2,3,384,392,394,386,2,3,395,393,385,387,2,3,386,394,396,388,2,3,396,395,387,388,2,3,389,397,390,382,2,3,391,397,389,383,2,3,398,400,408,406,2,3,409,401,399,407,2,3,400,402,410,408,2,3,411,403,401,409,2,3,402,404,412,410,2,3,412,404,403,411,2,3,405,398,406,413,2,3,407,399,405,413,2,3,448,430,432,446,2,3,433,431,449,447,2,3,446,432,434,450,2,3,435,433,447,451,2,3,450,434,436,452,2,3,437,435,451,453,2,3,452,436,438,454,2,3,439,437,453,455,2,3,454,438,440,456,2,3,441,439,455,457,2,3,456,440,442,458,2,3,443,441,457,459,2,3,458,442,444,460,2,3,445,443,459,461,2,3,460,444,430,448,2,3,431,445,461,449,2,3,464,448,446,462,2,3,447,449,465,463,2,3,462,446,450,466,2,3,451,447,463,467,2,3,466,450,452,468,2,3,453,451,467,469,2,3,468,452,454,470,2,3,455,453,469,471,2,3,470,454,456,472,2,3,457,455,471,473,2,3,472,456,458,474,2,3,459,457,473,475,2,3,474,458,460,476,2,3,461,459,475,477,2,3,476,460,448,464,2,3,449,461,477,465,2,3,414,480,478,416,2,3,479,481,415,417,2,3,480,464,462,478,2,3,463,465,481,479,2,3,416,478,482,418,2,3,483,479,417,419,2,3,478,462,466,482,2,3,467,463,479,483,2,3,418,482,484,420,2,3,485,483,419,421,2,3,482,466,468,484,2,3,469,467,483,485,2,3,420,484,486,422,2,3,487,485,421,423,2,3,484,468,470,486,2,3,471,469,485,487,2,3,422,486,488,424,2,3,489,487,423,425,2,3,486,470,472,488,2,3,473,471,487,489,2,3,424,488,490,426,2,3,491,489,425,427,2,3,488,472,474,490,2,3,475,473,489,491,2,3,426,490,492,428,2,3,493,491,427,429,2,3,490,474,476,492,2,3,477,475,491,493,2,3,428,492,480,414,2,3,481,493,429,415,2,3,492,476,464,480,2,3,465,477,493,481,2,3,494,528,526,496,2,3,527,529,495,497,2,3,496,526,530,498,2,3,531,527,497,499,2,3,498,530,532,500,2,3,533,531,499,501,2,3,500,532,534,502,2,3,535,533,501,503,2,3,502,534,536,504,2,3,537,535,503,505,2,3,504,536,538,506,2,3,539,537,505,507,2,3,506,538,540,508,2,3,541,539,507,509,2,3,508,540,528,494,2,3,529,541,509,495,2,3,528,544,542,526,2,3,543,545,529,527,2,3,526,542,546,530,2,3,547,543,527,531,2,3,530,546,548,532,2,3,549,547,531,533,2,3,532,548,550,534,2,3,551,549,533,535,2,3,534,550,552,536,2,3,553,551,535,537,2,3,536,552,554,538,2,3,555,553,537,539,2,3,538,554,556,540,2,3,557,555,539,541,2,3,540,556,544,528,2,3,545,557,541,529,2,3,544,560,558,542,2,3,559,561,545,543,2,3,560,510,512,558,2,3,513,511,561,559,2,3,542,558,562,546,2,3,563,559,543,547,2,3,558,512,514,562,2,3,515,513,559,563,2,3,546,562,564,548,2,3,565,563,547,549,2,3,562,514,516,564,2,3,517,515,563,565,2,3,548,564,566,550,2,3,567,565,549,551,2,3,564,516,518,566,2,3,519,517,565,567,2,3,550,566,568,552,2,3,569,567,551,553,2,3,566,518,520,568,2,3,521,519,567,569,2,3,552,568,570,554,2,3,571,569,553,555,2,3,568,520,522,570,2,3,523,521,569,571,2,3,554,570,572,556,2,3,573,571,555,557,2,3,570,522,524,572,2,3,525,523,571,573,2,3,556,572,560,544,2,3,561,573,557,545,2,3,572,524,510,560,2,3,511,525,573,561,2,3,578,586,590,592,2,3,591,587,579,593,2,3,582,576,596,594,2,3,597,577,583,595,2,3,580,600,602,588,2,3,603,601,581,589,2,3,600,574,584,602,2,3,585,575,601,603,2,3,576,598,604,596,2,3,605,599,577,597,2,3,598,578,592,604,2,3,593,579,599,605,2,3,574,606,610,584,2,3,611,607,575,585,2,3,606,576,582,610,2,3,583,577,607,611,2,3,578,608,612,586,2,3,613,609,579,587,2,3,608,580,588,612,2,3,589,581,609,613,2,3,614,620,626,624,2,3,627,621,615,625,2,3,614,624,628,616,2,3,629,625,615,617,2,3,616,628,630,618,2,3,631,629,617,619,2,3,620,622,632,626,2,3,633,623,621,627,2,3,624,626,632,634,2,3,633,627,625,635,2,3,628,624,634,630,2,3,635,625,629,631,2,3,646,642,636,638,2,3,637,643,647,639,2,3,646,638,640,644,2,3,641,639,647,645,2,3,652,648,658,668,2,3,659,649,653,669,2,3,670,656,648,652,2,3,649,657,671,653,2,3,648,650,666,658,2,3,667,651,649,659,2,3,656,664,650,648,2,3,651,665,657,649,2,3,658,654,660,668,2,3,661,655,659,669,2,3,666,662,654,658,2,3,655,663,667,659,2,3,682,676,672,680,2,3,673,677,683,681,2,3,680,672,674,678,2,3,675,673,681,679,2,3,686,678,674,684,2,3,675,679,687,685,2,3,690,688,676,682,2,3,677,689,691,683,2,3,692,712,720,696,2,3,721,713,693,697,2,3,714,692,696,722,2,3,697,693,715,723,2,3,694,718,724,698,2,3,725,719,695,699,2,3,716,694,698,726,2,3,699,695,717,727,2,3,700,716,726,702,2,3,727,717,701,703,2,3,712,700,702,720,2,3,703,701,713,721,2,3,724,718,706,704,2,3,707,719,725,705,2,3,714,722,708,710,2,3,709,723,715,711,2,3,752,784,778,728,2,3,779,785,753,729,2,3,784,760,746,778,2,3,747,761,785,779,2,3,730,776,784,752,2,3,785,777,731,753,2,3,776,744,760,784,2,3,761,745,777,785,2,3,762,786,782,750,2,3,783,787,763,751,2,3,786,756,736,782,2,3,737,757,787,783,2,3,748,780,786,762,2,3,787,781,749,763,2,3,780,738,756,786,2,3,757,739,781,787,2,3,772,788,780,748,2,3,781,789,773,749,2,3,788,764,738,780,2,3,739,765,789,781,2,3,744,776,788,772,2,3,789,777,745,773,2,3,776,730,764,788,2,3,765,731,777,789,2,3,766,790,782,736,2,3,783,791,767,737,2,3,790,774,750,782,2,3,751,775,791,783,2,3,728,778,790,766,2,3,791,779,729,767,2,3,778,746,774,790,2,3,775,747,779,791,2,3,796,798,792,794,2,3,793,799,797,795,2,3,800,806,804,802,2,3,805,807,801,803,2,3,794,802,804,796,2,3,805,803,795,797,2,3,814,808,810,812,2,3,811,809,815,813,2,3,818,816,822,820,2,3,823,817,819,821,2,3,828,830,824,826,2,3,825,831,829,827,2,3,832,838,836,834,2,3,837,839,833,835,2,3,848,840,846,854,2,3,847,841,849,855,2,3,846,840,842,844,2,3,843,841,847,845,2,3,850,848,854,852,2,3,855,849,851,853,2,3,862,870,864,856,2,3,865,871,863,857,2,3,858,866,868,860,2,3,869,867,859,861,2,3,870,874,872,864,2,3,873,875,871,865,2,3,874,868,866,872,2,3,867,869,875,873,2,3,860,878,876,858,2,3,877,879,861,859,2,3,878,862,856,876,2,3,857,863,879,877,2,3,884,886,880,882,2,3,881,887,885,883,2,3,888,894,892,890,2,3,893,895,889,891,2,3,882,890,892,884,2,3,893,891,883,885,2,3,886,894,888,880,2,3,889,895,887,881,2,3,900,902,904,906,2,3,905,903,901,907,2,3,898,896,910,908,2,3,911,897,899,909,2,3,896,900,906,910,2,3,907,901,897,911,2,3,902,898,908,904,2,3,909,899,903,905,2,3,916,918,920,922,2,3,921,919,917,923,2,3,914,912,926,924,2,3,927,913,915,925,2,3,912,916,922,926,2,3,923,917,913,927,2,3,918,914,924,920,2,3,925,915,919,921,2,3,920,924,926,922,2,3,927,925,921,923,2,3,934,930,928,932,2,3,929,931,935,933,2,3,936,940,930,934,2,3,931,941,937,935,2,3,942,938,932,928,2,3,933,939,943,929,2,3,940,942,928,930,2,3,929,943,941,931,2,3,938,936,934,932,2,3,935,937,939,933,2,3,952,956,946,950,2,3,947,957,953,951,2,3,958,954,948,944,2,3,949,955,959,945,2,3,956,958,944,946,2,3,945,959,957,947,2,3,954,952,950,948,2,3,951,953,955,949,2,3,968,960,966,974,2,3,967,961,969,975,2,3,972,964,962,970,2,3,963,965,973,971,2,3,966,960,962,964,2,3,963,961,967,965,2,3,970,968,974,972,2,3,975,969,971,973,2,3,980,982,976,978,2,3,977,983,981,979,2,3,984,990,988,986,2,3,989,991,985,987,2,3,978,986,988,980,2,3,989,987,979,981,2,3,982,990,984,976,2,3,985,991,983,977,2,3,996,998,1000,1002,2,3,1001,999,997,1003,2,3,994,992,1006,1004,2,3,1007,993,995,1005,2,3,992,996,1002,1006,2,3,1003,997,993,1007,2,3,998,994,1004,1000,2,3,1005,995,999,1001,2,3,1012,1014,1016,1018,2,3,1017,1015,1013,1019,2,3,1010,1008,1022,1020,2,3,1023,1009,1011,1021,2,3,1008,1012,1018,1022,2,3,1019,1013,1009,1023,2,3,1014,1010,1020,1016,2,3,1021,1011,1015,1017,2,3,1016,1020,1022,1018,2,3,1023,1021,1017,1019,2,3,1030,1026,1024,1028,2,3,1025,1027,1031,1029,2,3,1032,1036,1026,1030,2,3,1027,1037,1033,1031,2,3,1038,1034,1028,1024,2,3,1029,1035,1039,1025,2,3,1036,1038,1024,1026,2,3,1025,1039,1037,1027,2,3,1034,1032,1030,1028,2,3,1031,1033,1035,1029,2,3,1048,1052,1042,1046,2,3,1043,1053,1049,1047,2,3,1054,1050,1044,1040,2,3,1045,1051,1055,1041,2,3,1052,1054,1040,1042,2,3,1041,1055,1053,1043,2,3,1050,1048,1046,1044,2,3,1047,1049,1051,1045,2,3,1064,1056,1062,1070,2,3,1063,1057,1065,1071,2,3,1068,1060,1058,1066,2,3,1059,1061,1069,1067,2,3,1062,1056,1058,1060,2,3,1059,1057,1063,1061,2,3,1066,1064,1070,1068,2,3,1071,1065,1067,1069,2,3,1046,1076,1074,1044,2,3,1075,1077,1047,1045,2,3,1076,1032,1034,1074,2,3,1035,1033,1077,1075,2,3,1040,1072,1078,1042,2,3,1079,1073,1041,1043,2,3,1072,1038,1036,1078,2,3,1037,1039,1073,1079,2,3,1044,1074,1072,1040,2,3,1073,1075,1045,1041,2,3,1074,1034,1038,1072,2,3,1039,1035,1075,1073,2,3,1042,1078,1076,1046,2,3,1077,1079,1043,1047,2,3,1078,1036,1032,1076,2,3,1033,1037,1079,1077,2,3,1070,1084,1082,1068,2,3,1083,1085,1071,1069,2,3,1084,1048,1050,1082,2,3,1051,1049,1085,1083,2,3,1060,1080,1086,1062,2,3,1087,1081,1061,1063,2,3,1080,1054,1052,1086,2,3,1053,1055,1081,1087,2,3,1068,1082,1080,1060,2,3,1081,1083,1069,1061,2,3,1082,1050,1054,1080,2,3,1055,1051,1083,1081,2,3,1062,1086,1084,1070,2,3,1085,1087,1063,1071,2,3,1086,1052,1048,1084,2,3,1049,1053,1087,1085,2,3,984,1088,1090,976,2,3,1091,1089,985,977,2,3,1088,994,998,1090,2,3,999,995,1089,1091,2,3,978,1092,1094,986,2,3,1095,1093,979,987,2,3,1092,996,992,1094,2,3,993,997,1093,1095,2,3,986,1094,1088,984,2,3,1089,1095,987,985,2,3,1094,992,994,1088,2,3,995,993,1095,1089,2,3,976,1090,1092,978,2,3,1093,1091,977,979,2,3,1090,998,996,1092,2,3,997,999,1091,1093,2,3,1004,1096,1098,1000,2,3,1099,1097,1005,1001,2,3,1096,1010,1014,1098,2,3,1015,1011,1097,1099,2,3,1002,1100,1102,1006,2,3,1103,1101,1003,1007,2,3,1100,1012,1008,1102,2,3,1009,1013,1101,1103,2,3,1006,1102,1096,1004,2,3,1097,1103,1007,1005,2,3,1102,1008,1010,1096,2,3,1011,1009,1103,1097,2,3,1000,1098,1100,1002,2,3,1101,1099,1001,1003,2,3,1098,1014,1012,1100,2,3,1013,1015,1099,1101,2,3,974,1108,1106,972,2,3,1107,1109,975,973,2,3,1108,952,954,1106,2,3,955,953,1109,1107,2,3,964,1104,1110,966,2,3,1111,1105,965,967,2,3,1104,958,956,1110,2,3,957,959,1105,1111,2,3,972,1106,1104,964,2,3,1105,1107,973,965,2,3,1106,954,958,1104,2,3,959,955,1107,1105,2,3,966,1110,1108,974,2,3,1109,1111,967,975,2,3,1110,956,952,1108,2,3,953,957,1111,1109,2,3,950,1116,1114,948,2,3,1115,1117,951,949,2,3,1116,936,938,1114,2,3,939,937,1117,1115,2,3,944,1112,1118,946,2,3,1119,1113,945,947,2,3,1112,942,940,1118,2,3,941,943,1113,1119,2,3,948,1114,1112,944,2,3,1113,1115,949,945,2,3,1114,938,942,1112,2,3,943,939,1115,1113,2,3,946,1118,1116,950,2,3,1117,1119,947,951,2,3,1118,940,936,1116,2,3,937,941,1119,1117,2,3,888,1120,1122,880,2,3,1123,1121,889,881,2,3,1120,898,902,1122,2,3,903,899,1121,1123,2,3,882,1124,1126,890,2,3,1127,1125,883,891,2,3,1124,900,896,1126,2,3,897,901,1125,1127,2,3,890,1126,1120,888,2,3,1121,1127,891,889,2,3,1126,896,898,1120,2,3,899,897,1127,1121,2,3,880,1122,1124,882,2,3,1125,1123,881,883,2,3,1122,902,900,1124,2,3,901,903,1123,1125,2,3,908,1128,1130,904,2,3,1131,1129,909,905,2,3,1128,914,918,1130,2,3,919,915,1129,1131,2,3,906,1132,1134,910,2,3,1135,1133,907,911,2,3,1132,916,912,1134,2,3,913,917,1133,1135,2,3,910,1134,1128,908,2,3,1129,1135,911,909,2,3,1134,912,914,1128,2,3,915,913,1135,1129,2,3,904,1130,1132,906,2,3,1133,1131,905,907,2,3,1130,918,916,1132,2,3,917,919,1131,1133,2,3,1152,1154,1138,1140,2,3,1139,1155,1153,1141,2,3,1136,1158,1156,1142,2,3,1157,1159,1137,1143,2,3,1140,1142,1156,1152,2,3,1157,1143,1141,1153,2,3,1164,1166,1146,1148,2,3,1147,1167,1165,1149,2,3,1162,1160,1150,1144,2,3,1151,1161,1163,1145,2,3,1160,1164,1148,1150,2,3,1149,1165,1161,1151,2,3,1166,1162,1144,1146,2,3,1145,1163,1167,1147,2,3,1172,1174,1176,1178,2,3,1177,1175,1173,1179,2,3,1170,1168,1182,1180,2,3,1183,1169,1171,1181,2,3,1168,1172,1178,1182,2,3,1179,1173,1169,1183,2,3,1174,1170,1180,1176,2,3,1181,1171,1175,1177,2,3,1176,1180,1182,1178,2,3,1183,1181,1177,1179,2,3,1136,1184,1186,1138,2,3,1187,1185,1137,1139,2,3,1140,1188,1190,1142,2,3,1191,1189,1141,1143,2,3,1188,1164,1160,1190,2,3,1161,1165,1189,1191,2,3,1142,1190,1184,1136,2,3,1185,1191,1143,1137,2,3,1190,1160,1162,1184,2,3,1163,1161,1191,1185,2,3,1138,1186,1188,1140,2,3,1189,1187,1139,1141,2,3,1186,1166,1164,1188,2,3,1165,1167,1187,1189,2,3,1162,1166,1186,1184,2,3,1187,1167,1163,1185,2,3,1148,1192,1194,1150,2,3,1195,1193,1149,1151,2,3,1192,1172,1168,1194,2,3,1169,1173,1193,1195,2,3,1146,1196,1192,1148,2,3,1193,1197,1147,1149,2,3,1196,1174,1172,1192,2,3,1173,1175,1197,1193,2,3,1144,1198,1196,1146,2,3,1197,1199,1145,1147,2,3,1198,1170,1174,1196,2,3,1175,1171,1199,1197,2,3,1150,1194,1198,1144,2,3,1199,1195,1151,1145,2,3,1194,1168,1170,1198,2,3,1171,1169,1195,1199,2,2,1154,1200,1138,2,2,1139,1201,1155,2,3,1136,1138,1200,1158,2,3,1201,1139,1137,1159,2,3,366,1204,1202,368,2,3,1203,1205,367,369,2,3,1204,374,376,1202,2,3,377,375,1205,1203,2,3,368,1202,1206,370,2,3,1207,1203,369,371,2,3,1202,376,378,1206,2,3,379,377,1203,1207,2,3,370,1206,1208,372,2,3,1208,1207,371,372,2,3,1206,378,380,1208,2,3,380,379,1207,1208,2,3,373,1209,1204,366,2,3,1205,1209,373,367,2,3,1209,381,374,1204,2,3,375,381,1209,1205,2,3,760,1218,1212,746,2,3,1213,1219,761,747,2,3,1218,754,734,1212,2,3,735,755,1219,1213,2,3,744,1210,1218,760,2,3,1219,1211,745,761,2,3,1210,732,754,1218,2,3,755,733,1211,1219,2,3,758,1220,1216,742,2,3,1217,1221,759,743,2,3,1220,762,750,1216,2,3,751,763,1221,1217,2,3,740,1214,1220,758,2,3,1221,1215,741,759,2,3,1214,748,762,1220,2,3,763,749,1215,1221,2,3,768,1222,1214,740,2,3,1215,1223,769,741,2,3,1222,772,748,1214,2,3,749,773,1223,1215,2,3,732,1210,1222,768,2,3,1223,1211,733,769,2,3,1210,744,772,1222,2,3,773,745,1211,1223,2,3,774,1224,1216,750,2,3,1217,1225,775,751,2,3,1224,770,742,1216,2,3,743,771,1225,1217,2,3,746,1212,1224,774,2,3,1225,1213,747,775,2,3,1212,734,770,1224,2,3,771,735,1213,1225,2], + + "edges" : [] + + +}; + +postMessage( model ); +close(); From 59f0e645a4d766f521f0589799d90287c53c3b02 Mon Sep 17 00:00:00 2001 From: alteredq Date: Thu, 13 Oct 2011 05:02:16 +0200 Subject: [PATCH 08/33] Refactored shadowmap example to use MorphAnimMesh. --- build/Three.js | 4 +- examples/webgl_shadowmap.html | 80 +++++++++++++---------------------- src/objects/MorphAnimMesh.js | 6 +-- 3 files changed, 34 insertions(+), 56 deletions(-) diff --git a/build/Three.js b/build/Three.js index 49193449..596ba99d 100644 --- a/build/Three.js +++ b/build/Three.js @@ -135,8 +135,8 @@ THREE.SkinnedMesh.prototype.update=function(b,c,e){if(this.visible){this.matrixA c*16)}};THREE.SkinnedMesh.prototype.addBone=function(b){b===void 0&&(b=new THREE.Bone(this));this.bones.push(b);return b}; THREE.SkinnedMesh.prototype.pose=function(){this.update(void 0,!0);for(var b,c=[],e=0;ethis.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;b=THREE.MathUtils.clamp(Math.floor(this.time/c),0,this.geometry.morphTargets.length-1);if(b!=this.currentKeyframe)this.morphTargetInfluences[this.lastKeyframe]= +THREE.MorphAnimMesh=function(b,c){THREE.Mesh.call(this,b,c);this.duration=1E3;this.mirroredLoop=!1;this.currentKeyframe=this.lastKeyframe=this.time=0;this.direction=1;this.directionBackwards=!1};THREE.MorphAnimMesh.prototype=new THREE.Mesh;THREE.MorphAnimMesh.prototype.constructor=THREE.MorphAnimMesh; +THREE.MorphAnimMesh.prototype.updateAnimation=function(b){var c=this.duration/(this.geometry.morphTargets.length-1);this.time+=this.direction*b;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;b=THREE.MathUtils.clamp(Math.floor(this.time/c),0,this.geometry.morphTargets.length-1);if(b!=this.currentKeyframe)this.morphTargetInfluences[this.lastKeyframe]= 0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[b]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=b;c=this.time%c/c;this.directionBackwards&&(c=1-c);this.morphTargetInfluences[this.currentKeyframe]=c;this.morphTargetInfluences[this.lastKeyframe]=1-c};THREE.Ribbon=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c]};THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon; THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(b,c){c===void 0&&(c=0);for(var c=Math.abs(c),e=0;e1){b=e.matrixWorldInverse;b=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(var f=1;f=this.LODs[f].visibleAtDistance)this.LODs[f-1].object3D.visible=!1, diff --git a/examples/webgl_shadowmap.html b/examples/webgl_shadowmap.html index 4afa3391..44e8e82d 100644 --- a/examples/webgl_shadowmap.html +++ b/examples/webgl_shadowmap.html @@ -60,10 +60,12 @@ var sceneHUD, cameraOrtho, hudMaterial; - var morphs = []; + var morph, morphs = []; var light; + var delta, newTime, oldTime; + init(); animate(); @@ -246,7 +248,11 @@ if ( fudgeColor ) THREE.ColorUtils.adjustHSV( material.color, 0, 0.5 - Math.random(), 0.5 - Math.random() ); - var meshAnim = new THREE.Mesh( geometry, material ); + var meshAnim = new THREE.MorphAnimMesh( geometry, material ); + + meshAnim.speed = speed; + meshAnim.duration = duration; + meshAnim.time = 600 * Math.random(); meshAnim.position.set( x, y, z ); meshAnim.rotation.y = Math.PI/2; @@ -256,9 +262,7 @@ scene.add( meshAnim ); - morphs.push( { mesh: meshAnim, lastKeyframe: 0, currentKeyframe: 0, - offset: Math.random() * 6, speed: speed, duration: duration, - oldTime: new Date().getTime() } ); + morphs.push( meshAnim ); } @@ -343,54 +347,10 @@ addMorph( geometry, 0.45, 500, 500 - Math.random() * 500, FLOOR + 300, 700 ); } } ); - */ } - - var t = 0, newTime, delta; - - - function updateMorph( morph ) { - - // Alternate morph targets - - var interpolation = morph.duration / ( morph.mesh.geometry.morphTargets.length - 1 ); - - var time = ( new Date().getTime() + morph.offset * 100 ) % morph.duration; - var keyframe = Math.floor( time / interpolation ) + 1; - - var mesh = morph.mesh; - - if ( keyframe != morph.currentKeyframe ) { - - mesh.morphTargetInfluences[ morph.lastKeyframe ] = 0; - mesh.morphTargetInfluences[ morph.currentKeyframe ] = 1; - mesh.morphTargetInfluences[ keyframe ] = 0; - - morph.lastKeyframe = morph.currentKeyframe; - morph.currentKeyframe = keyframe; - - } - - mesh.morphTargetInfluences[ keyframe ] = ( time % interpolation ) / interpolation; - mesh.morphTargetInfluences[ morph.lastKeyframe ] = 1 - mesh.morphTargetInfluences[ keyframe ]; - - var newTime = new Date().getTime(); - delta = newTime - morph.oldTime; - morph.oldTime = newTime; - - mesh.position.x += morph.speed * delta; - - if ( mesh.position.x > 2000 ) { - - mesh.position.x = -1000 - Math.random() * 500; - - } - - } - // function animate() { @@ -404,7 +364,27 @@ function render() { - for ( var i = 0; i < morphs.length; i++ ) updateMorph( morphs[ i ] ); + if ( oldTime === undefined ) oldTime = new Date().getTime(); + + newTime = new Date().getTime(); + delta = newTime - oldTime; + oldTime = newTime; + + for ( var i = 0; i < morphs.length; i ++ ) { + + morph = morphs[ i ]; + + morph.updateAnimation( delta ); + + morph.position.x += morph.speed * delta; + + if ( morph.position.x > 2000 ) { + + morph.position.x = -1000 - Math.random() * 500; + + } + + } controls.update(); diff --git a/src/objects/MorphAnimMesh.js b/src/objects/MorphAnimMesh.js index e6f6409a..1a0144dd 100644 --- a/src/objects/MorphAnimMesh.js +++ b/src/objects/MorphAnimMesh.js @@ -10,15 +10,13 @@ THREE.MorphAnimMesh = function( geometry, materials ) { this.duration = 1000; // milliseconds this.mirroredLoop = false; + this.time = 0; // internals this.lastKeyframe = 0; this.currentKeyframe = 0; - this.time = 0; - this.offset = 0; - this.direction = 1; this.directionBackwards = false; @@ -29,7 +27,7 @@ THREE.MorphAnimMesh.prototype.constructor = THREE.MorphAnimMesh; THREE.MorphAnimMesh.prototype.updateAnimation = function ( delta ) { - var frameTime = this.duration / this.geometry.morphTargets.length; + var frameTime = this.duration / ( this.geometry.morphTargets.length - 1 ); this.time += this.direction * delta; From 89bddf3827394350b9b0d98be9d7b52d3d2c436d Mon Sep 17 00:00:00 2001 From: alteredq Date: Thu, 13 Oct 2011 17:50:16 +0200 Subject: [PATCH 09/33] Moved "extras/MathUtils" to "core/Math" (thanks to @mrdoob). --- build/Three.js | 16 ++++++------- build/custom/ThreeExtras.js | 14 +++++------ examples/js/Car.js | 24 +++++++++---------- examples/webgl_materials_cubemap_dynamic.html | 8 +++---- examples/webgl_shading_physical.html | 10 ++++---- src/{extras/MathUtils.js => core/Math.js} | 2 +- src/extras/ColorUtils.js | 6 ++--- src/extras/controls/FirstPersonControls.js | 4 ++-- src/extras/controls/PathControls.js | 4 ++-- src/objects/MorphAnimMesh.js | 2 +- utils/build.py | 2 +- 11 files changed, 46 insertions(+), 46 deletions(-) rename src/{extras/MathUtils.js => core/Math.js} (94%) diff --git a/build/Three.js b/build/Three.js index 596ba99d..93ec49ba 100644 --- a/build/Three.js +++ b/build/Three.js @@ -20,8 +20,8 @@ this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSph w=f instanceof THREE.Face4?w.multiplyVector3(y[f.d].position.clone()):null,u=b.matrixRotationWorld.multiplyVector3(f.normal.clone()),x=A.dot(u),b.doubleSided||(b.flipSided?x>0:x<0)))if(x=u.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(A.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,p,t)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,p,w)||e(v,p,t,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,u){n=!1;c=k;e=m;f=w;h=u;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=ck?f:k,h=h>m?h:m);b()};this.add3Points= function(k,m,w,u,x,v){n?(n=!1,c=kw?k>x?k:x:w>x?w:x,h=m>u?m>v?m:v:u>v?u:v):(c=kw?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>u?m>v?m>h?m:h:v>h?v:h:u>v?u>h?u:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=ck.getRight()?f:k.getRight(),h=h> -k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}};THREE.Matrix3=function(){this.m=[]}; -THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}}; +k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}}; +THREE.Math={clamp:function(b,c,e){return be?e:b},clampBottom:function(b,c){return bthis.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;b=THREE.MathUtils.clamp(Math.floor(this.time/c),0,this.geometry.morphTargets.length-1);if(b!=this.currentKeyframe)this.morphTargetInfluences[this.lastKeyframe]= +THREE.MorphAnimMesh.prototype.updateAnimation=function(b){var c=this.duration/(this.geometry.morphTargets.length-1);this.time+=this.direction*b;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;b=THREE.Math.clamp(Math.floor(this.time/c),0,this.geometry.morphTargets.length-1);if(b!=this.currentKeyframe)this.morphTargetInfluences[this.lastKeyframe]= 0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[b]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=b;c=this.time%c/c;this.directionBackwards&&(c=1-c);this.morphTargetInfluences[this.currentKeyframe]=c;this.morphTargetInfluences[this.lastKeyframe]=1-c};THREE.Ribbon=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c]};THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon; THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(b,c){c===void 0&&(c=0);for(var c=Math.abs(c),e=0;e1){b=e.matrixWorldInverse;b=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(var f=1;f=this.LODs[f].visibleAtDistance)this.LODs[f-1].object3D.visible=!1, @@ -350,7 +350,7 @@ THREE.WebGLRenderTargetCube.prototype=new THREE.WebGLRenderTarget;THREE.WebGLRen THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null}; THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null}; THREE.RenderableObject=function(){this.z=this.object=null};THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.materials=null}; -THREE.ColorUtils={adjustHSV:function(b,c,e,f){var h=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,h);h.h=THREE.MathUtils.clamp(h.h+c,0,1);h.s=THREE.MathUtils.clamp(h.s+e,0,1);h.v=THREE.MathUtils.clamp(h.v+f,0,1);b.setHSV(h.h,h.s,h.v)},rgbToHsv:function(b,c){var e=b.r,f=b.g,h=b.b,k=Math.max(Math.max(e,f),h),m=Math.min(Math.min(e,f),h);if(m==k)m=e=0;else{var n=k-m,m=n/k,e=e==k?(f-h)/n:f==k?2+(h-e)/n:4+(e-f)/n;e/=6;e<0&&(e+=1);e>1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=m;c.v=k;return c}}; +THREE.ColorUtils={adjustHSV:function(b,c,e,f){var h=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,h);h.h=THREE.Math.clamp(h.h+c,0,1);h.s=THREE.Math.clamp(h.s+e,0,1);h.v=THREE.Math.clamp(h.v+f,0,1);b.setHSV(h.h,h.s,h.v)},rgbToHsv:function(b,c){var e=b.r,f=b.g,h=b.b,k=Math.max(Math.max(e,f),h),m=Math.min(Math.min(e,f),h);if(m==k)m=e=0;else{var n=k-m,m=n/k,e=e==k?(f-h)/n:f==k?2+(h-e)/n:4+(e-f)/n;e/=6;e<0&&(e+=1);e>1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=m;c.v=k;return c}}; THREE.ColorUtils.__hsv={h:0,s:0,v:0}; THREE.GeometryUtils={merge:function(b,c){var e,f,h=b.vertices.length,k=c instanceof THREE.Mesh?c.geometry:c,m=b.vertices,n=k.vertices,p=b.faces,t=k.faces,w=b.faceVertexUvs[0],k=k.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var u=0,x=n.length;ue?e:b},clampBottom:function(b,c){return b=0?c:c+m;b=this.verticalAngleMap.srcRange; -c=this.verticalAngleMap.dstRange;b=THREE.MathUtils.mapLinear(this.phi,b[0],b[1],c[0],c[1]);var f=c[1]-c[0];this.phi=e((b-c[0])/f)*f+c[0];b=this.horizontalAngleMap.srcRange;c=this.horizontalAngleMap.dstRange;b=THREE.MathUtils.mapLinear(this.theta,b[0],b[1],c[0],c[1]);f=c[1]-c[0];this.theta=e((b-c[0])/f)*f+c[0];c=this.target.position;c.x=100*Math.sin(this.phi)*Math.cos(this.theta);c.y=100*Math.cos(this.phi);c.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= +c=this.verticalAngleMap.dstRange;b=THREE.Math.mapLinear(this.phi,b[0],b[1],c[0],c[1]);var f=c[1]-c[0];this.phi=e((b-c[0])/f)*f+c[0];b=this.horizontalAngleMap.srcRange;c=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],c[0],c[1]);f=c[1]-c[0];this.theta=e((b-c[0])/f)*f+c[0];c=this.target.position;c.x=100*Math.sin(this.phi)*Math.cos(this.theta);c.y=100*Math.cos(this.phi);c.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}), e=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(e,b);b=new THREE.Mesh(m,c);b.position.set(0,10,0);this.animation=h(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(b)}else this.animation=h(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var b= this.debugPath,c=this.spline,e=k(c,10),m=k(c,10),n=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,n);particleObj=new THREE.ParticleSystem(m,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.add(lineObj);particleObj.scale.set(1,1,1);b.add(particleObj);m=new THREE.SphereGeometry(1,16,8);n=new THREE.MeshBasicMaterial({color:65280});for(i=0;i1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=g;b.v=h;return b}}; +THREE.ColorUtils={adjustHSV:function(a,b,c,e){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.Math.clamp(f.h+b,0,1);f.s=THREE.Math.clamp(f.s+c,0,1);f.v=THREE.Math.clamp(f.v+e,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,b){var c=a.r,e=a.g,f=a.b,h=Math.max(Math.max(c,e),f),g=Math.min(Math.min(c,e),f);if(g==h)g=c=0;else{var k=h-g,g=k/h,c=c==h?(e-f)/k:e==h?2+(f-c)/k:4+(c-e)/k;c/=6;c<0&&(c+=1);c>1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=g;b.v=h;return b}}; THREE.ColorUtils.__hsv={h:0,s:0,v:0}; THREE.GeometryUtils={merge:function(a,b){var c,e,f=a.vertices.length,h=b instanceof THREE.Mesh?b.geometry:b,g=a.vertices,k=h.vertices,l=a.faces,m=h.faces,n=a.faceVertexUvs[0],h=h.faceVertexUvs[0];if(b instanceof THREE.Mesh)b.matrixAutoUpdate&&b.updateMatrix(),c=b.matrix,e=new THREE.Matrix4,e.extractRotation(c,b.scale);for(var o=0,t=k.length;oc?c:a},clampBottom:function(a,b){return a=0?b:b+g;a=this.verticalAngleMap.srcRange; -b=this.verticalAngleMap.dstRange;a=THREE.MathUtils.mapLinear(this.phi,a[0],a[1],b[0],b[1]);var e=b[1]-b[0];this.phi=c((a-b[0])/e)*e+b[0];a=this.horizontalAngleMap.srcRange;b=this.horizontalAngleMap.dstRange;a=THREE.MathUtils.mapLinear(this.theta,a[0],a[1],b[0],b[1]);e=b[1]-b[0];this.theta=c((a-b[0])/e)*e+b[0];b=this.target.position;b.x=100*Math.sin(this.phi)*Math.cos(this.theta);b.y=100*Math.cos(this.phi);b.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= +b=this.verticalAngleMap.dstRange;a=THREE.Math.mapLinear(this.phi,a[0],a[1],b[0],b[1]);var e=b[1]-b[0];this.phi=c((a-b[0])/e)*e+b[0];a=this.horizontalAngleMap.srcRange;b=this.horizontalAngleMap.dstRange;a=THREE.Math.mapLinear(this.theta,a[0],a[1],b[0],b[1]);e=b[1]-b[0];this.theta=c((a-b[0])/e)*e+b[0];b=this.target.position;b.x=100*Math.sin(this.phi)*Math.cos(this.theta);b.y=100*Math.cos(this.phi);b.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}), b=new THREE.CubeGeometry(10,10,20),g=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(b,a);a=new THREE.Mesh(g,c);a.position.set(0,10,0);this.animation=f(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=f(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a= this.debugPath,c=this.spline,b=h(c,10),g=h(c,10),k=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(b,k);particleObj=new THREE.ParticleSystem(g,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.add(lineObj);particleObj.scale.set(1,1,1);a.add(particleObj);g=new THREE.SphereGeometry(1,16,8);k=new THREE.MeshBasicMaterial({color:65280});for(i=0;i 0 ) { - this.wheelOrientation = THREE.MathUtils.clamp( this.wheelOrientation - delta * this.WHEEL_ANGULAR_DECCELERATION, 0, this.MAX_WHEEL_ROTATION ); + this.wheelOrientation = THREE.Math.clamp( this.wheelOrientation - delta * this.WHEEL_ANGULAR_DECCELERATION, 0, this.MAX_WHEEL_ROTATION ); } else { - this.wheelOrientation = THREE.MathUtils.clamp( this.wheelOrientation + delta * this.WHEEL_ANGULAR_DECCELERATION, - this.MAX_WHEEL_ROTATION, 0 ); + this.wheelOrientation = THREE.Math.clamp( this.wheelOrientation + delta * this.WHEEL_ANGULAR_DECCELERATION, - this.MAX_WHEEL_ROTATION, 0 ); } diff --git a/examples/webgl_materials_cubemap_dynamic.html b/examples/webgl_materials_cubemap_dynamic.html index e9988eeb..3d4a008c 100644 --- a/examples/webgl_materials_cubemap_dynamic.html +++ b/examples/webgl_materials_cubemap_dynamic.html @@ -881,7 +881,7 @@ // day / night - v = THREE.MathUtils.clamp( v + 0.5 * delta * vdir, 0.1, 0.9 ); + v = THREE.Math.clamp( v + 0.5 * delta * vdir, 0.1, 0.9 ); scene.fog.color.setHSV( 0.51, 0.5, v ); renderer.setClearColor( scene.fog.color, 1 ); @@ -934,10 +934,10 @@ } - effectBloom.screenUniforms[ "opacity" ].value = THREE.MathUtils.mapLinear( vnorm, 0, 1, 1, 0.75 ); + effectBloom.screenUniforms[ "opacity" ].value = THREE.Math.mapLinear( vnorm, 0, 1, 1, 0.75 ); - ambientLight.color.setHSV( 0, 0, THREE.MathUtils.mapLinear( vnorm, 0, 1, 0.07, 0.33 ) ); - groundBasic.color.setHSV( 0.1, 0.45, THREE.MathUtils.mapLinear( vnorm, 0, 1, 0.725, 0.995 ) ); + ambientLight.color.setHSV( 0, 0, THREE.Math.mapLinear( vnorm, 0, 1, 0.07, 0.33 ) ); + groundBasic.color.setHSV( 0.1, 0.45, THREE.Math.mapLinear( vnorm, 0, 1, 0.725, 0.995 ) ); // blur diff --git a/examples/webgl_shading_physical.html b/examples/webgl_shading_physical.html index 78350187..8c177548 100644 --- a/examples/webgl_shading_physical.html +++ b/examples/webgl_shading_physical.html @@ -47,6 +47,7 @@ + @@ -111,7 +112,6 @@ - @@ -603,13 +603,13 @@ if ( morph ) morph.updateAnimation( delta ); - scene.fog.color.setHSV( 0.13, 0.25, THREE.MathUtils.mapLinear( parameters.control, 0, 100, 0.1, 0.99 ) ); + scene.fog.color.setHSV( 0.13, 0.25, THREE.Math.mapLinear( parameters.control, 0, 100, 0.1, 0.99 ) ); renderer.setClearColor( scene.fog.color, 1 ); - sunLight.intensity = THREE.MathUtils.mapLinear( parameters.control, 0, 100, 0.3, 1 ); - pointLight.intensity = THREE.MathUtils.mapLinear( parameters.control, 0, 100, 1, 0.5 ); + sunLight.intensity = THREE.Math.mapLinear( parameters.control, 0, 100, 0.3, 1 ); + pointLight.intensity = THREE.Math.mapLinear( parameters.control, 0, 100, 1, 0.5 ); - pointLight.color.setHSV( 0.1, THREE.MathUtils.mapLinear( parameters.control, 0, 100, 0.99, 0 ), 0.9 ); + pointLight.color.setHSV( 0.1, THREE.Math.mapLinear( parameters.control, 0, 100, 0.99, 0 ), 0.9 ); renderer.shadowMapDarkness = 0.5 * sunLight.intensity; diff --git a/src/extras/MathUtils.js b/src/core/Math.js similarity index 94% rename from src/extras/MathUtils.js rename to src/core/Math.js index c70746f8..0bfd6347 100644 --- a/src/extras/MathUtils.js +++ b/src/core/Math.js @@ -2,7 +2,7 @@ * @author alteredq / http://alteredqualia.com/ */ -THREE.MathUtils = { +THREE.Math = { clamp: function ( x, a, b ) { diff --git a/src/extras/ColorUtils.js b/src/extras/ColorUtils.js index 63420246..242497ca 100644 --- a/src/extras/ColorUtils.js +++ b/src/extras/ColorUtils.js @@ -10,9 +10,9 @@ THREE.ColorUtils = { THREE.ColorUtils.rgbToHsv( color, hsv ); - hsv.h = THREE.MathUtils.clamp( hsv.h + h, 0, 1 ); - hsv.s = THREE.MathUtils.clamp( hsv.s + s, 0, 1 ); - hsv.v = THREE.MathUtils.clamp( hsv.v + v, 0, 1 ); + hsv.h = THREE.Math.clamp( hsv.h + h, 0, 1 ); + hsv.s = THREE.Math.clamp( hsv.s + s, 0, 1 ); + hsv.v = THREE.Math.clamp( hsv.v + v, 0, 1 ); color.setHSV( hsv.h, hsv.s, hsv.v ); diff --git a/src/extras/controls/FirstPersonControls.js b/src/extras/controls/FirstPersonControls.js index e121139d..341e4d35 100644 --- a/src/extras/controls/FirstPersonControls.js +++ b/src/extras/controls/FirstPersonControls.js @@ -183,7 +183,7 @@ THREE.FirstPersonControls = function ( object, domElement ) { if ( this.heightSpeed ) { - var y = THREE.MathUtils.clamp( this.object.position.y, this.heightMin, this.heightMax ); + var y = THREE.Math.clamp( this.object.position.y, this.heightMin, this.heightMax ); var delta = y - this.heightMin; this.autoSpeedFactor = this.tdiff * ( delta * this.heightCoef ); @@ -247,7 +247,7 @@ THREE.FirstPersonControls = function ( object, domElement ) { if ( this.constrainVertical ) { - this.phi = THREE.MathUtils.mapLinear( this.phi, 0, Math.PI, this.verticalMin, this.verticalMax ); + this.phi = THREE.Math.mapLinear( this.phi, 0, Math.PI, this.verticalMin, this.verticalMax ); } diff --git a/src/extras/controls/PathControls.js b/src/extras/controls/PathControls.js index 30a4aea1..1d3ec87a 100644 --- a/src/extras/controls/PathControls.js +++ b/src/extras/controls/PathControls.js @@ -79,7 +79,7 @@ THREE.PathControls = function ( object, domElement ) { srcRange = this.verticalAngleMap.srcRange; dstRange = this.verticalAngleMap.dstRange; - var tmpPhi = THREE.MathUtils.mapLinear( this.phi, srcRange[ 0 ], srcRange[ 1 ], dstRange[ 0 ], dstRange[ 1 ] ); + var tmpPhi = THREE.Math.mapLinear( this.phi, srcRange[ 0 ], srcRange[ 1 ], dstRange[ 0 ], dstRange[ 1 ] ); var tmpPhiFullRange = dstRange[ 1 ] - dstRange[ 0 ]; var tmpPhiNormalized = ( tmpPhi - dstRange[ 0 ] ) / tmpPhiFullRange; @@ -90,7 +90,7 @@ THREE.PathControls = function ( object, domElement ) { srcRange = this.horizontalAngleMap.srcRange; dstRange = this.horizontalAngleMap.dstRange; - var tmpTheta = THREE.MathUtils.mapLinear( this.theta, srcRange[ 0 ], srcRange[ 1 ], dstRange[ 0 ], dstRange[ 1 ] ); + var tmpTheta = THREE.Math.mapLinear( this.theta, srcRange[ 0 ], srcRange[ 1 ], dstRange[ 0 ], dstRange[ 1 ] ); var tmpThetaFullRange = dstRange[ 1 ] - dstRange[ 0 ]; var tmpThetaNormalized = ( tmpTheta - dstRange[ 0 ] ) / tmpThetaFullRange; diff --git a/src/objects/MorphAnimMesh.js b/src/objects/MorphAnimMesh.js index 1a0144dd..3b0ee91f 100644 --- a/src/objects/MorphAnimMesh.js +++ b/src/objects/MorphAnimMesh.js @@ -59,7 +59,7 @@ THREE.MorphAnimMesh.prototype.updateAnimation = function ( delta ) { } - var keyframe = THREE.MathUtils.clamp( Math.floor( this.time / frameTime ), 0, this.geometry.morphTargets.length - 1 ); + var keyframe = THREE.Math.clamp( Math.floor( this.time / frameTime ), 0, this.geometry.morphTargets.length - 1 ); if ( keyframe != this.currentKeyframe ) { diff --git a/utils/build.py b/utils/build.py index fe3cd837..7b88bc8f 100644 --- a/utils/build.py +++ b/utils/build.py @@ -19,6 +19,7 @@ COMMON_FILES = [ 'core/Vector4.js', 'core/Ray.js', 'core/Rectangle.js', +'core/Math.js', 'core/Matrix3.js', 'core/Matrix4.js', 'core/Object3D.js', @@ -86,7 +87,6 @@ EXTRAS_FILES = [ 'extras/ColorUtils.js', 'extras/GeometryUtils.js', 'extras/ImageUtils.js', -'extras/MathUtils.js', 'extras/SceneUtils.js', 'extras/ShaderUtils.js', 'extras/core/Curve.js', From 42544a0f29756158984d7c416677ff1623f95b0f Mon Sep 17 00:00:00 2001 From: alteredq Date: Thu, 13 Oct 2011 18:03:05 +0200 Subject: [PATCH 10/33] Moved GeometryUtils.random16 => Math.random16 --- src/core/Math.js | 9 +++++++++ src/extras/GeometryUtils.js | 13 ++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/core/Math.js b/src/core/Math.js index 0bfd6347..6d0fe4bb 100644 --- a/src/core/Math.js +++ b/src/core/Math.js @@ -20,6 +20,15 @@ THREE.Math = { return b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 ); + }, + + // Get 16 bits of randomness + // (standard Math.random() creates repetitive patterns when applied over larger space) + + random16: function() { + + return ( 65280 * Math.random() + 255 * Math.random() ) / 65535; + } }; diff --git a/src/extras/GeometryUtils.js b/src/extras/GeometryUtils.js index 81089680..2e6af8fd 100644 --- a/src/extras/GeometryUtils.js +++ b/src/extras/GeometryUtils.js @@ -4,7 +4,7 @@ */ THREE.GeometryUtils = { - + merge: function ( geometry1, object2 /* mesh | geometry */ ) { var matrix, matrixRotation, @@ -437,15 +437,6 @@ THREE.GeometryUtils = { }, - // Get 16 bits of randomness - // (standard Math.random() creates repetitive patterns when applied over larger space) - - random16: function() { - - return ( 65280 * Math.random() + 255 * Math.random() ) / 65535; - - }, - center: function( geometry ) { geometry.computeBoundingBox(); @@ -467,6 +458,6 @@ THREE.GeometryUtils = { }; -THREE.GeometryUtils.random = THREE.GeometryUtils.random16; +THREE.GeometryUtils.random = THREE.Math.random16; THREE.GeometryUtils.__v1 = new THREE.Vector3(); From 9902cbbf2dd235377e49d59fb99f701b6834fa86 Mon Sep 17 00:00:00 2001 From: alteredq Date: Thu, 13 Oct 2011 20:17:21 +0200 Subject: [PATCH 11/33] Experimenting with Date.now(). Updated builds. --- build/Three.js | 7 ++++--- build/custom/ThreeExtras.js | 4 ++-- examples/webgl_materials_cars.html | 2 +- examples/webgl_materials_cubemap_dynamic.html | 4 ++-- examples/webgl_particles_dynamic.html | 8 ++------ examples/webgl_postprocessing.html | 2 +- examples/webgl_postprocessing_dof.html | 2 +- examples/webgl_ribbons.html | 2 +- examples/webgl_shader_lava.html | 2 +- examples/webgl_shading_physical.html | 4 ++-- examples/webgl_shadowmap.html | 4 ++-- 11 files changed, 19 insertions(+), 22 deletions(-) diff --git a/build/Three.js b/build/Three.js index 93ec49ba..e0ba0df6 100644 --- a/build/Three.js +++ b/build/Three.js @@ -21,7 +21,8 @@ w=f instanceof THREE.Face4?w.multiplyVector3(y[f.d].position.clone()):null,u=b.m THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,u){n=!1;c=k;e=m;f=w;h=u;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=ck?f:k,h=h>m?h:m);b()};this.add3Points= function(k,m,w,u,x,v){n?(n=!1,c=kw?k>x?k:x:w>x?w:x,h=m>u?m>v?m:v:u>v?u:v):(c=kw?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>u?m>v?m>h?m:h:v>h?v:h:u>v?u>h?u:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=ck.getRight()?f:k.getRight(),h=h> k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}}; -THREE.Math={clamp:function(b,c,e){return be?e:b},clampBottom:function(b,c){return be?e:b},clampBottom:function(b,c){return b1&&(f=1-f,h=1-h);k=1-f-h;m.copy(b);m.multiplyScalar(f);n.copy(c);n.multiplyScalar(h);m.addSelf(n);n.copy(e);n.multiplyScalar(k);m.addSelf(n);return m},randomPointInFace:function(b,c,e){var f,h,k;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,h=c.vertices[b.b].position,k=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,h,k);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;h=c.vertices[b.b].position;k=c.vertices[b.c].position;var c=c.vertices[b.d].position, m;e?b._area1&&b._area2?(e=b._area1,m=b._area2):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c),b._area1=e,b._area2=m):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c));return THREE.GeometryUtils.random()*(e+m) b?c(e,k-1):t[k]1&&(e=1-e,f=1-f);h=1-e-f;g.copy(a);g.multiplyScalar(e);k.copy(b);k.multiplyScalar(f);g.addSelf(k);k.copy(c);k.multiplyScalar(h);g.addSelf(k);return g},randomPointInFace:function(a,b,c){var e,f,h;if(a instanceof THREE.Face3)return e=b.vertices[a.a].position,f=b.vertices[a.b].position,h=b.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(e,f,h);else if(a instanceof THREE.Face4){e=b.vertices[a.a].position;f=b.vertices[a.b].position;h=b.vertices[a.c].position;var b=b.vertices[a.d].position, g;c?a._area1&&a._area2?(c=a._area1,g=a._area2):(c=THREE.GeometryUtils.triangleArea(e,f,b),g=THREE.GeometryUtils.triangleArea(f,h,b),a._area1=c,a._area2=g):(c=THREE.GeometryUtils.triangleArea(e,f,b),g=THREE.GeometryUtils.triangleArea(f,h,b));return THREE.GeometryUtils.random()*(c+g) a?c(b,g-1):m[g] Date: Thu, 13 Oct 2011 21:46:08 +0200 Subject: [PATCH 12/33] First attempt at Clock object. Got tired of redoing deltas all the time. Not sure about API or implementation details, but so far seems to be useful. In future, we could for example have clocks that are slower / faster than realtime, or fixed step based. --- build/Three.js | 3 +- examples/misc_sound.html | 4 +- examples/webgl_animation_skinning.html | 16 ++--- examples/webgl_materials_cars.html | 4 +- examples/webgl_materials_cubemap_dynamic.html | 6 +- examples/webgl_shader_lava.html | 12 ++-- examples/webgl_shading_physical.html | 9 +-- examples/webgl_shadowmap.html | 8 +-- src/core/Clock.js | 65 +++++++++++++++++++ utils/build.py | 1 + 10 files changed, 95 insertions(+), 33 deletions(-) create mode 100644 src/core/Clock.js diff --git a/build/Three.js b/build/Three.js index e0ba0df6..76094869 100644 --- a/build/Three.js +++ b/build/Three.js @@ -1,5 +1,6 @@ // Three.js r46dev - http://github.com/mrdoob/three.js -var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this}; +var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Clock=function(b){this.autoStart=b!==void 0?b:!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.elapsed();this.running=!1};THREE.Clock.prototype.elapsed=function(){this.elapsedTime+=this.delta();return this.elapsedTime}; +THREE.Clock.prototype.delta=function(){var b=0;this.autoStart&&!this.running&&this.start();if(this.running){var c=Date.now(),b=c-this.oldTime;this.oldTime=c;this.elapsedTime+=b}return b};THREE.Color=function(b){b!==void 0&&this.setHex(b);return this}; THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},copyGammaToLinear:function(b){this.r=b.r*b.r;this.g=b.g*b.g;this.b=b.b*b.b;return this},copyLinearToGamma:function(b){this.r=Math.sqrt(b.r);this.g=Math.sqrt(b.g);this.b=Math.sqrt(b.b);return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var f,h,k;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),h=b*6-f,b=e*(1-c),k=e*(1- c*h),c=e*(1-c*(1-h)),f){case 1:this.r=k;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=k;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=e;this.g=b;this.b=k;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0}; diff --git a/examples/misc_sound.html b/examples/misc_sound.html index 47c36158..72794a5f 100644 --- a/examples/misc_sound.html +++ b/examples/misc_sound.html @@ -60,6 +60,8 @@ var sound1, sound2; + var clock = new THREE.Clock(); + var Sound = function ( sources, radius, volume ) { var audio = document.createElement( 'audio' ); @@ -190,7 +192,7 @@ function render() { - var time = new Date().getTime() * 0.005; + var time = clock.elapsed() * 0.005; controls.update(); diff --git a/examples/webgl_animation_skinning.html b/examples/webgl_animation_skinning.html index be0924fe..bf52c688 100644 --- a/examples/webgl_animation_skinning.html +++ b/examples/webgl_animation_skinning.html @@ -71,6 +71,8 @@ var floor, dz = 0, dstep = -10, playback = false; + var clock = new THREE.Clock(); + function init() { container = document.getElementById( 'container' ); @@ -198,28 +200,26 @@ } - var oldTime = new Date().getTime(); - function loop() { requestAnimationFrame( loop, renderer.domElement ); - var time = new Date().getTime(); + var delta = clock.delta(); - THREE.AnimationHandler.update( 0.001 * ( time - oldTime ) ); - - oldTime = time; + THREE.AnimationHandler.update( 0.001 * delta ); camera.position.x += ( mouseX - camera.position.x ) * 0.05; camera.lookAt( scene.position ); if ( buffalos && playback ) { - camera.position.z += 2 * Math.sin( new Date().getTime() * 0.001 ); + var elapsed = clock.elapsed() * 0.001; + + camera.position.z += 2 * Math.sin( elapsed ); for( i = 0; i < buffalos.length; i++ ) { - buffalos[ i ].position.z += 2 * Math.sin( new Date().getTime() * 0.001 + offset[ i ] ); + buffalos[ i ].position.z += 2 * Math.sin( elapsed + offset[ i ] ); } diff --git a/examples/webgl_materials_cars.html b/examples/webgl_materials_cars.html index 7def081a..0a71972f 100644 --- a/examples/webgl_materials_cars.html +++ b/examples/webgl_materials_cars.html @@ -153,6 +153,8 @@ var loader = new THREE.BinaryLoader( true ); document.body.appendChild( loader.statusDomElement ); + var clock = new THREE.Clock(); + init(); animate(); @@ -601,7 +603,7 @@ function render() { - var timer = - Date.now() * 0.0002; + var timer = -0.0002 * clock.elapsed(); camera.position.y += ( - mouseY - camera.position.y ) * .05; diff --git a/examples/webgl_materials_cubemap_dynamic.html b/examples/webgl_materials_cubemap_dynamic.html index dddcc2da..1dc1e0ba 100644 --- a/examples/webgl_materials_cubemap_dynamic.html +++ b/examples/webgl_materials_cubemap_dynamic.html @@ -93,7 +93,7 @@ var cubeCamera; - var oldTime = Date.now(); + var clock = new THREE.Clock(); var controlsGallardo = { @@ -875,9 +875,7 @@ function render() { - var newTime = Date.now(); - var delta = 0.001 * ( newTime - oldTime ); - oldTime = newTime; + var delta = 0.001 * clock.delta(); // day / night diff --git a/examples/webgl_shader_lava.html b/examples/webgl_shader_lava.html index de07fee7..37b65f99 100644 --- a/examples/webgl_shader_lava.html +++ b/examples/webgl_shader_lava.html @@ -121,7 +121,7 @@ var container, stats; - var start_time; + var clock = new THREE.Clock(); var camera, scene, renderer, composer; @@ -145,8 +145,6 @@ scene = new THREE.Scene(); - start_time = Date.now(); - uniforms = { fogDensity: { type: "f", value: 0.45 }, @@ -240,10 +238,12 @@ function render() { - uniforms.time.value += 0.02; + var delta = 0.05 * clock.delta(); - mesh.rotation.y += 0.00125; - mesh.rotation.x += 0.005; + uniforms.time.value += 0.02 * delta; + + mesh.rotation.y += 0.00125 * delta; + mesh.rotation.x += 0.005 * delta; renderer.clear(); composer.render( 0.01 ); diff --git a/examples/webgl_shading_physical.html b/examples/webgl_shading_physical.html index 52b710e7..e5e2977d 100644 --- a/examples/webgl_shading_physical.html +++ b/examples/webgl_shading_physical.html @@ -42,6 +42,7 @@ + @@ -198,7 +199,7 @@ var parameters, tweenDirection, tweenDay, tweenNight; - var oldTime; + var clock = new THREE.Clock(); init(); animate(); @@ -592,11 +593,7 @@ function render() { - if ( oldTime === undefined ) oldTime = Date.now(); - - var newTime = Date.now(); - var delta = newTime - oldTime; - oldTime = newTime; + var delta = clock.delta(); TWEEN.update(); controls.update(); diff --git a/examples/webgl_shadowmap.html b/examples/webgl_shadowmap.html index 86f563fa..043611dd 100644 --- a/examples/webgl_shadowmap.html +++ b/examples/webgl_shadowmap.html @@ -64,7 +64,7 @@ var light; - var delta, newTime, oldTime; + var clock = new THREE.Clock(); init(); animate(); @@ -364,11 +364,7 @@ function render() { - if ( oldTime === undefined ) oldTime = Date.now(); - - newTime = Date.now(); - delta = newTime - oldTime; - oldTime = newTime; + var delta = clock.delta(); for ( var i = 0; i < morphs.length; i ++ ) { diff --git a/src/core/Clock.js b/src/core/Clock.js new file mode 100644 index 00000000..7cb38986 --- /dev/null +++ b/src/core/Clock.js @@ -0,0 +1,65 @@ +/** + * @author alteredq / http://alteredqualia.com/ + */ + +THREE.Clock = function ( autoStart ) { + + this.autoStart = ( autoStart !== undefined ) ? autoStart : true; + + this.startTime = 0; + this.oldTime = 0; + this.elapsedTime = 0; + + this.running = false; + +}; + +THREE.Clock.prototype.start = function () { + + this.startTime = Date.now(); + this.oldTime = this.startTime; + + this.running = true; + +}; + +THREE.Clock.prototype.stop = function () { + + this.elapsed(); + + this.running = false; + +}; + +THREE.Clock.prototype.elapsed = function () { + + this.elapsedTime += this.delta(); + + return this.elapsedTime; + +}; + + +THREE.Clock.prototype.delta = function () { + + var diff = 0; + + if ( this.autoStart && ! this.running ) { + + this.start(); + + } + + if ( this.running ) { + + var newTime = Date.now(); + diff = newTime - this.oldTime; + this.oldTime = newTime; + + this.elapsedTime += diff; + + } + + return diff; + +}; \ No newline at end of file diff --git a/utils/build.py b/utils/build.py index 7b88bc8f..fa1ee8c8 100644 --- a/utils/build.py +++ b/utils/build.py @@ -13,6 +13,7 @@ import sys COMMON_FILES = [ 'Three.js', +'core/Clock.js', 'core/Color.js', 'core/Vector2.js', 'core/Vector3.js', From 093f17f38c974f3d7dda61ea03ac011bcd2db53f Mon Sep 17 00:00:00 2001 From: alteredq Date: Thu, 13 Oct 2011 22:09:25 +0200 Subject: [PATCH 13/33] Refactored FirstPersonControls to use externally supplied time delta. Changed few examples to use this. --- build/Three.js | 73 +++++++++++----------- build/custom/ThreeExtras.js | 17 +++-- examples/misc_sound.html | 9 +-- examples/webgl_geometry_dynamic.html | 9 ++- examples/webgl_geometry_minecraft.html | 3 +- examples/webgl_geometry_minecraft_ao.html | 9 ++- examples/webgl_geometry_terrain.html | 3 +- src/extras/controls/FirstPersonControls.js | 18 ++---- 8 files changed, 69 insertions(+), 72 deletions(-) diff --git a/build/Three.js b/build/Three.js index 76094869..b81b3b3f 100644 --- a/build/Three.js +++ b/build/Three.js @@ -56,17 +56,17 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){thi b)return h;if(c&&(h=h.getChildByName(b,c),h!==void 0))return h}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(b,c,e){this.matrixAutoUpdate&& this.updateMatrix();if(this.matrixWorldNeedsUpdate||c)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,c=!0;for(var b=0,f=this.children.length;b=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?e=Math.max(e,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),f=0&&k>=0&&m>=0&&n>=0?!0:h<0&&k<0||m<0&&n<0?!1:(h<0?e=Math.max(e,h/(h-k)):k<0&&(f=Math.min(f,h/(h-k))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),fG&&m.positionScreen.z0&&K.z<1))ia=C[F]=C[F]||new THREE.RenderableParticle,F++,E=ia,E.x=K.x/K.w,E.y=K.y/K.w,E.z=K.z,E.rotation=U.rotation.z,E.scale.x=U.scale.x*Math.abs(E.x-(K.x+k.projectionMatrix.n11)/(K.w+k.projectionMatrix.n14)),E.scale.y=U.scale.y*Math.abs(E.y-(K.y+k.projectionMatrix.n22)/(K.w+k.projectionMatrix.n24)),E.materials=U.materials,J.push(E);h&&J.sort(c);return J}}; +(K.set(U.matrixWorld.n14,U.matrixWorld.n24,U.matrixWorld.n34,1),B.multiplyVector4(K),K.z/=K.w,K.z>0&&K.z<1))ia=C[F]=C[F]||new THREE.RenderableParticle,F++,E=ia,E.x=K.x/K.w,E.y=K.y/K.w,E.z=K.z,E.rotation=U.rotation.z,E.scale.x=U.scale.x*Math.abs(E.x-(K.x+h.projectionMatrix.n11)/(K.w+h.projectionMatrix.n14)),E.scale.y=U.scale.y*Math.abs(E.y-(K.y+h.projectionMatrix.n22)/(K.w+h.projectionMatrix.n24)),E.materials=U.materials,J.push(E);k&&J.sort(c);return J}}; THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,e=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),k=Math.cos(e),e=Math.sin(e),m=b*c,n=f*h;this.w=m*k-n*e;this.x=m*e+n*k;this.y=f*c*k+b*h*e;this.z=b*h*k-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e); this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z); @@ -81,15 +81,15 @@ c;b++)e=this.faces[b],e.centroid.set(0,0,0),e instanceof THREE.Face3?(e.centroid e,f,h,k,m,n=new THREE.Vector3,p=new THREE.Vector3;f=0;for(h=this.faces.length;f0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;cthis.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;t=this.points[e[0]];w=this.points[e[1]]; -u=this.points[e[2]];x=this.points[e[3]];n=m*m;p=m*n;f.x=c(t.x,w.x,u.x,x.x,m,n,p);f.y=c(t.y,w.y,u.y,x.y,m,n,p);f.z=c(t.z,w.z,u.z,x.z,m,n,p);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;bthis.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;t=this.points[e[0]];w=this.points[e[1]]; +u=this.points[e[2]];x=this.points[e[3]];n=m*m;p=m*n;f.x=c(t.x,w.x,u.x,x.x,m,n,p);f.y=c(t.y,w.y,u.y,x.y,m,n,p);f.z=c(t.z,w.z,u.z,x.z,m,n,p);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;b0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(A.r*255)+","+Math.floor(A.g*255)+","+ -Math.floor(A.b*255)+","+z+")"),v.fillRect(Math.floor(S.getX()),Math.floor(S.getY()),Math.floor(S.getWidth()),Math.floor(S.getHeight()))),S.empty())};this.render=function(b,p){function t(b){var c,e,f,k=b.lights;N.setRGB(0,0,0);ma.setRGB(0,0,0);ua.setRGB(0,0,0);b=0;for(c=k.length;b>1,xa=t.height>>1,m=k.scale.x*u,p=k.scale.y*x,o=m*w,n=p*xa,O.set(b.x-o,b.y-n,b.x+o,b.y+n),za.intersects(O)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-p),v.translate(-w,-xa),v.drawImage(t,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(o=k.scale.x*u,n=k.scale.y*x,O.set(b.x-o,b.y-n,b.x+o,b.y+n),za.intersects(O)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(o,n),m.program(v), -v.restore()))}function eb(b,k,h,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(k.positionScreen.x,k.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(J!=b)v.lineCap=J=b;b=m.linejoin;if(M!=b)v.lineJoin=M=b;f(m.color.getContextStyle());v.stroke();O.inflate(m.linewidth*2)}}function y(b,f,h,m,n,t,u,v,xa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); +v.restore()))}function eb(b,h,k,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(h.positionScreen.x,h.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(J!=b)v.lineCap=J=b;b=m.linejoin;if(M!=b)v.lineJoin=M=b;f(m.color.getContextStyle());v.stroke();O.inflate(m.linewidth*2)}}function y(b,f,h,m,n,t,u,v,xa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); Q=b.positionScreen.x;Z=b.positionScreen.y;$=f.positionScreen.x;P=f.positionScreen.y;o=h.positionScreen.x;V=h.positionScreen.y;F(Q,Z,$,P,o,V);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=u.uvs[0],ab(Q,Z,$,P,o,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=p.matrixWorldInverse,oa.copy(u.vertexNormalsWorld[0]),sa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,ya= -(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(u.vertexNormalsWorld[1]),Ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Ga=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(u.vertexNormalsWorld[2]),Fa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Da=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,ab(Q,Z,$,P,o,V,sa,ya,Ca,Ga,Fa,Da,v.envMap)}else v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&& (v.map.mapping instanceof THREE.UVMapping&&(ra=u.uvs[0],ab(Q,Z,$,P,o,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map)),e(THREE.SubtractiveBlending)),da?!v.wireframe&&v.shading==THREE.SmoothShading&&u.vertexNormalsWorld.length==3?(W.r=U.r=ia.r=N.r,W.g=U.g=ia.g=N.g,W.b=U.b=ia.b=N.b,w(xa,u.v1.positionWorld,u.vertexNormalsWorld[0],W),w(xa,u.v2.positionWorld,u.vertexNormalsWorld[1],U),w(xa,u.v3.positionWorld,u.vertexNormalsWorld[2],ia),W.r=Math.max(0,Math.min(v.color.r*W.r,1)),W.g=Math.max(0,Math.min(v.color.g* @@ -171,18 +171,18 @@ $=f.positionScreen.x,P=f.positionScreen.y,o=h.positionScreen.x,V=h.positionScree U.r=ia.r=ja.r=N.r,W.g=U.g=ia.g=ja.g=N.g,W.b=U.b=ia.b=ja.b=N.b,w(xa,v.v1.positionWorld,v.vertexNormalsWorld[0],W),w(xa,v.v2.positionWorld,v.vertexNormalsWorld[1],U),w(xa,v.v4.positionWorld,v.vertexNormalsWorld[3],ia),w(xa,v.v3.positionWorld,v.vertexNormalsWorld[2],ja),W.r=Math.max(0,Math.min(u.color.r*W.r,1)),W.g=Math.max(0,Math.min(u.color.g*W.g,1)),W.b=Math.max(0,Math.min(u.color.b*W.b,1)),U.r=Math.max(0,Math.min(u.color.r*U.r,1)),U.g=Math.max(0,Math.min(u.color.g*U.g,1)),U.b=Math.max(0,Math.min(u.color.b* U.b,1)),ia.r=Math.max(0,Math.min(u.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(u.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(u.color.b*ia.b,1)),ja.r=Math.max(0,Math.min(u.color.r*ja.r,1)),ja.g=Math.max(0,Math.min(u.color.g*ja.g,1)),ja.b=Math.max(0,Math.min(u.color.b*ja.b,1)),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,o,V,ka,na),Ua(ha,ga,o,V,ka,na,1,0,1,1,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,v.centroidWorld,v.normalWorld,qa),aa.r=Math.max(0,Math.min(u.color.r*qa.r, 1)),aa.g=Math.max(0,Math.min(u.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(u.color.b*qa.b,1)),E(Q,Z,$,P,o,V,fa,ea),u.wireframe?Na(aa,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(aa)):(E(Q,Z,$,P,o,V,fa,ea),u.wireframe?Na(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(u.color));else if(u instanceof THREE.MeshNormalMaterial)aa.r=Va(v.normalWorld.x),aa.g=Va(v.normalWorld.y),aa.b=Va(v.normalWorld.z),E(Q,Z,$,P,o,V,fa,ea),u.wireframe?Na(aa,u.wireframeLinewidth,u.wireframeLinecap, -u.wireframeLinejoin):C(aa);else if(u instanceof THREE.MeshDepthMaterial)la=p.near,ca=p.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,la,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,la,ca),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,o,V,ka,na),Ua(ha,ga,o,V,ka,na,1,0,1,1,0,1,pa)}function F(b,c,e,f,k,h){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(b,c);v.closePath()}function E(b, -c,e,f,k,h,m,o){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(k,h);v.lineTo(m,o);v.lineTo(b,c);v.closePath()}function Na(b,c,e,k){if(G!=c)v.lineWidth=G=c;if(J!=e)v.lineCap=J=e;if(M!=k)v.lineJoin=M=k;f(b.getContextStyle());v.stroke();O.inflate(c*2)}function C(b){h(b.getContextStyle());v.fill()}function ab(b,c,e,f,k,m,o,n,p,u,t,xa,w){if(w.image.width!=0){if(w.needsUpdate==!0||ta[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,S=w.wrapT==THREE.RepeatWrapping;ta[w.id]=v.createPattern(w.image,x&& -S?"repeat":x&&!S?"repeat-x":!x&&S?"repeat-y":"no-repeat");w.needsUpdate=!1}h(ta[w.id]);var x=w.offset.x/w.repeat.x,S=w.offset.y/w.repeat.y,z=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,o=(o+x)*z,n=(n+S)*w,p=(p+x)*z,u=(u+S)*w,t=(t+x)*z,xa=(xa+S)*w;e-=b;f-=c;k-=b;m-=c;p-=o;u-=n;t-=o;xa-=n;x=1/(p*xa-t*u);w=(xa*e-u*k)*x;u=(xa*f-u*m)*x;e=(p*k-t*e)*x;f=(p*m-t*f)*x;b=b-w*o-e*n;c=c-u*o-f*n;v.save();v.transform(w,u,e,f,b,c);v.fill();v.restore()}}function Ua(b,c,e,f,k,h,m,o,n,p,u,t,w){var xa, -x;xa=w.width-1;x=w.height-1;m*=xa;o*=x;n*=xa;p*=x;u*=xa;t*=x;e-=b;f-=c;k-=b;h-=c;n-=m;p-=o;u-=m;t-=o;x=1/(n*t-u*p);xa=(t*e-p*k)*x;p=(t*f-p*h)*x;e=(n*k-u*e)*x;f=(n*h-u*f)*x;b=b-xa*m-e*o;c=c-p*m-f*o;v.save();v.transform(xa,p,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var k=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),o=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),p=~~(e.g*255),e=~~(e.b*255),u=~~(f.r*255),t=~~(f.g*255),f=~~(f.b*255);va[0]=k<0?0:k>255?255:k;va[1]=h<0?0: -h>255?255:h;va[2]=b<0?0:b>255?255:b;va[4]=m<0?0:m>255?255:m;va[5]=o<0?0:o>255?255:o;va[6]=c<0?0:c>255?255:c;va[8]=n<0?0:n>255?255:n;va[9]=p<0?0:p>255?255:p;va[10]=e<0?0:e>255?255:e;va[12]=u<0?0:u>255?255:u;va[13]=t<0?0:t>255?255:t;va[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,k=e*e+f*f;k!=0&&(k=1/Math.sqrt(k),e*=k,f*=k,c.x+= +u.wireframeLinejoin):C(aa);else if(u instanceof THREE.MeshDepthMaterial)la=p.near,ca=p.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,la,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,la,ca),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,o,V,ka,na),Ua(ha,ga,o,V,ka,na,1,0,1,1,0,1,pa)}function F(b,c,e,f,h,k){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(b,c);v.closePath()}function E(b, +c,e,f,h,k,m,o){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(m,o);v.lineTo(b,c);v.closePath()}function Na(b,c,e,h){if(G!=c)v.lineWidth=G=c;if(J!=e)v.lineCap=J=e;if(M!=h)v.lineJoin=M=h;f(b.getContextStyle());v.stroke();O.inflate(c*2)}function C(b){h(b.getContextStyle());v.fill()}function ab(b,c,e,f,k,m,o,n,p,u,t,xa,w){if(w.image.width!=0){if(w.needsUpdate==!0||ta[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,S=w.wrapT==THREE.RepeatWrapping;ta[w.id]=v.createPattern(w.image,x&& +S?"repeat":x&&!S?"repeat-x":!x&&S?"repeat-y":"no-repeat");w.needsUpdate=!1}h(ta[w.id]);var x=w.offset.x/w.repeat.x,S=w.offset.y/w.repeat.y,z=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,o=(o+x)*z,n=(n+S)*w,p=(p+x)*z,u=(u+S)*w,t=(t+x)*z,xa=(xa+S)*w;e-=b;f-=c;k-=b;m-=c;p-=o;u-=n;t-=o;xa-=n;x=1/(p*xa-t*u);w=(xa*e-u*k)*x;u=(xa*f-u*m)*x;e=(p*k-t*e)*x;f=(p*m-t*f)*x;b=b-w*o-e*n;c=c-u*o-f*n;v.save();v.transform(w,u,e,f,b,c);v.fill();v.restore()}}function Ua(b,c,e,f,h,k,m,o,n,p,u,t,w){var xa, +x;xa=w.width-1;x=w.height-1;m*=xa;o*=x;n*=xa;p*=x;u*=xa;t*=x;e-=b;f-=c;h-=b;k-=c;n-=m;p-=o;u-=m;t-=o;x=1/(n*t-u*p);xa=(t*e-p*h)*x;p=(t*f-p*k)*x;e=(n*h-u*e)*x;f=(n*k-u*f)*x;b=b-xa*m-e*o;c=c-p*m-f*o;v.save();v.transform(xa,p,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var h=~~(b.r*255),k=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),o=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),p=~~(e.g*255),e=~~(e.b*255),u=~~(f.r*255),t=~~(f.g*255),f=~~(f.b*255);va[0]=h<0?0:h>255?255:h;va[1]=k<0?0: +k>255?255:k;va[2]=b<0?0:b>255?255:b;va[4]=m<0?0:m>255?255:m;va[5]=o<0?0:o>255?255:o;va[6]=c<0?0:c>255?255:c;va[8]=n<0?0:n>255?255:n;va[9]=p<0?0:p>255?255:p;va[10]=e<0?0:e>255?255:e;va[12]=u<0?0:u>255?255:u;va[13]=t<0?0:t>255?255:t;va[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,h=e*e+f*f;h!=0&&(h=1/Math.sqrt(h),e*=h,f*=h,c.x+= e,c.y+=f,b.x-=e,b.y-=f)}var Za,bb,wa,Ja,Pa,Wa,$a,Aa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,u,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,p,this.sortElements);(da=b.lights.length>0)&&t(b);Za=0;for(bb=m.length;Za0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m)):h instanceof THREE.PointLight&&(Y.sub(h.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*h.intensity,m>0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m))}function c(c,e,m,n,u,t){k.info.render.vertices+=3;k.info.render.faces++;Q=f(Z++); +THREE.SVGRenderer=function(){function b(b,c,e){var f,h,k,m;f=0;for(h=b.lights.length;f0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m)):k instanceof THREE.PointLight&&(Y.sub(k.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*k.intensity,m>0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m))}function c(c,e,m,n,u,t){k.info.render.vertices+=3;k.info.render.faces++;Q=f(Z++); Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");u instanceof THREE.MeshBasicMaterial?G.copy(u.color):u instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(t,n,J),G.r=Math.max(0,Math.min(u.color.r*J.r,1)),G.g=Math.max(0,Math.min(u.color.g*J.g,1)),G.b=Math.max(0,Math.min(u.color.b*J.b,1))):G.copy(u.color):u instanceof THREE.MeshDepthMaterial?(L=1-u.__2near/(u.__farPlusNear- n.z*u.__farMinusNear),G.setRGB(L,L,L)):u instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));u.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+u.wireframeLinewidth+"; stroke-opacity: "+u.opacity+"; stroke-linecap: "+u.wireframeLinecap+"; stroke-linejoin: "+u.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+u.opacity);p.appendChild(Q)}function e(c,e,m,n,u,t,v){k.info.render.vertices+= 4;k.info.render.faces++;Q=f(Z++);Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?G.copy(t.color):t instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(v,u,J),G.r=Math.max(0,Math.min(t.color.r*J.r,1)),G.g=Math.max(0,Math.min(t.color.g*J.g,1)),G.b=Math.max(0,Math.min(t.color.b*J.b,1))): @@ -227,9 +227,9 @@ THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.Shader THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment, THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex, THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}}; -THREE.WebGLRenderer=function(b){function c(b,c,e){var f,k,h,m=b.vertices,n=m.length,u=b.colors,p=u.length,t=b.__vertexArray,v=b.__colorArray,w=b.__sortArray,x=b.__dirtyVertices,S=b.__dirtyColors,z=b.__webglCustomAttributes,y,A;if(z)for(y in z)z[y].offset=0;if(e.sortParticles){Ca.multiplySelf(e.matrixWorld);for(f=0;f0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;nb&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function h(b){for(H=b.length;--H>=0;){ka=H;na=H-1;na<0&&(na=b.length- -1);for(var c=0,e=v+w*2,c=0;cb&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(h).addSelf(n).subSelf(b).clone()}function h(b){for(H=b.length;--H>=0;){ka=H;na=H-1;na<0&&(na=b.length- +1);for(var c=0,e=v+w*2,c=0;c=0;Q--){Z=Q/w;$=p*(1-Z);Z=t*Math.sin(Z*Math.PI/2);H=0;for(T=F.length;H0;)this.smooth(b)}; THREE.SubdivisionModifier.prototype.smooth=function(b){function c(b,c,e,f,n,p){var t=new THREE.Face4(b,c,e,f,null,n.color,n.material);if(m.useOldVertexColors){t.vertexColors=[];for(var v,o,w,x=0;x<4;x++){w=p[x];v=new THREE.Color;v.setRGB(0,0,0);for(var y=0;y Date: Fri, 14 Oct 2011 05:44:12 +0200 Subject: [PATCH 14/33] Refactored RollControls, FlyControls and PathControls to use externally supplied time delta. --- build/Three.js | 753 +++++++++++++-------------- build/custom/ThreeExtras.js | 33 +- examples/misc_camera_path.html | 10 +- examples/misc_camera_roll.html | 4 +- examples/webgl_flycamera_earth.html | 40 +- examples/webgl_shading_physical.html | 2 +- examples/webgl_shadowmap.html | 2 +- src/extras/controls/FlyControls.js | 16 +- src/extras/controls/PathControls.js | 8 +- src/extras/controls/RollControls.js | 18 +- 10 files changed, 427 insertions(+), 459 deletions(-) diff --git a/build/Three.js b/build/Three.js index b81b3b3f..2646c9e6 100644 --- a/build/Three.js +++ b/build/Three.js @@ -17,38 +17,38 @@ c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,f=[];c=0;for(e=b.length;c0&&b>0&&k+b<1}for(var f,h=[],k=0,m=b.children.length;kb.scale.x)return[];f={distance:k,point:b.position,face:null,object:b};h.push(f)}else if(b instanceof THREE.Mesh){k=c(this.origin, -this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,p,t,w,u,x,v,A,z=b.geometry,y=z.vertices,k=0,m=z.faces.length;k0:x<0)))if(x=u.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(A.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,p,t)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,p,w)||e(v,p,t,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; -THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,u){n=!1;c=k;e=m;f=w;h=u;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=ck?f:k,h=h>m?h:m);b()};this.add3Points= -function(k,m,w,u,x,v){n?(n=!1,c=kw?k>x?k:x:w>x?w:x,h=m>u?m>v?m:v:u>v?u:v):(c=kw?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>u?m>v?m>h?m:h:v>h?v:h:u>v?u>h?u:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=ck.getRight()?f:k.getRight(),h=h> +this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,t,u,w,o,x,v,A,z=b.geometry,y=z.vertices,k=0,m=z.faces.length;k0:x<0)))if(x=o.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(A.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,t,u)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,t,w)||e(v,t,u,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; +THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,o){n=!1;c=k;e=m;f=w;h=o;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=ck?f:k,h=h>m?h:m);b()};this.add3Points= +function(k,m,w,o,x,v){n?(n=!1,c=kw?k>x?k:x:w>x?w:x,h=m>o?m>v?m:v:o>v?o:v):(c=kw?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>o?m>v?m>h?m:h:v>h?v:h:o>v?o>h?o:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=ck.getRight()?f:k.getRight(),h=h> k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}}; THREE.Math={clamp:function(b,c,e){return be?e:b},clampBottom:function(b,c){return b=0&&k>=0&&m>=0&&n>=0?!0:h<0&&k<0||m<0&&n<0?!1:(h<0?e=Math.max(e,h/(h-k)):k<0&&(f=Math.min(f,h/(h-k))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),f=0&&k>=0&&m>=0&&n>=0?!0:h<0&&k<0||m<0&&n<0?!1:(h<0?e=Math.max(e,h/(h-k)):k<0&&(f=Math.min(f,h/(h-k))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),fG&&m.positionScreen.zG&&m.positionScreen.z0&&K.z<1))ia=C[F]=C[F]||new THREE.RenderableParticle,F++,E=ia,E.x=K.x/K.w,E.y=K.y/K.w,E.z=K.z,E.rotation=U.rotation.z,E.scale.x=U.scale.x*Math.abs(E.x-(K.x+h.projectionMatrix.n11)/(K.w+h.projectionMatrix.n14)),E.scale.y=U.scale.y*Math.abs(E.y-(K.y+h.projectionMatrix.n22)/(K.w+h.projectionMatrix.n24)),E.materials=U.materials,J.push(E);k&&J.sort(c);return J}}; THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,e=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),k=Math.cos(e),e=Math.sin(e),m=b*c,n=f*h;this.w=m*k-n*e;this.x=m*e+n*k;this.y=f*c*k+b*h*e;this.z=b*h*k-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e); this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z); this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c= -this.x,e=this.y,f=this.z,h=this.w,k=b.x,m=b.y,n=b.z,b=b.w;this.x=c*b+h*k+e*n-f*m;this.y=e*b+h*m+f*k-c*n;this.z=f*b+h*n+c*m-e*k;this.w=h*b-c*k-e*m-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,h=b.z,k=this.x,m=this.y,n=this.z,p=this.w,t=p*e+m*h-n*f,w=p*f+n*e-k*h,u=p*h+k*f-m*e,e=-k* -e-m*f-n*h;c.x=t*p+e*-k+w*-n-u*-m;c.y=w*p+e*-m+u*-k-t*-n;c.z=u*p+e*-n+t*-m-w*-k;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var k=Math.acos(h),m=Math.sqrt(1-h*h);if(Math.abs(m)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-f)*k)/m;f=Math.sin(f*k)/m;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e}; +this.x,e=this.y,f=this.z,h=this.w,k=b.x,m=b.y,n=b.z,b=b.w;this.x=c*b+h*k+e*n-f*m;this.y=e*b+h*m+f*k-c*n;this.z=f*b+h*n+c*m-e*k;this.w=h*b-c*k-e*m-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,h=b.z,k=this.x,m=this.y,n=this.z,t=this.w,u=t*e+m*h-n*f,w=t*f+n*e-k*h,o=t*h+k*f-m*e,e=-k* +e-m*f-n*h;c.x=u*t+e*-k+w*-n-o*-m;c.y=w*t+e*-m+o*-k-u*-n;c.z=o*t+e*-n+u*-m-w*-k;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var k=Math.acos(h),m=Math.sqrt(1-h*h);if(Math.abs(m)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-f)*k)/m;f=Math.sin(f*k)/m;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e}; THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,h,k){this.a=b;this.b=c;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=k instanceof Array?k:[k];this.centroid=new THREE.Vector3}; THREE.Face4=function(b,c,e,f,h,k,m){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=k instanceof THREE.Color?k:new THREE.Color;this.vertexColors=k instanceof Array?k:[];this.vertexTangents=[];this.materials=m instanceof Array?m:[m];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var e=0,f=this.vertices.length;e0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;cthis.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;t=this.points[e[0]];w=this.points[e[1]]; -u=this.points[e[2]];x=this.points[e[3]];n=m*m;p=m*n;f.x=c(t.x,w.x,u.x,x.x,m,n,p);f.y=c(t.y,w.y,u.y,x.y,m,n,p);f.z=c(t.z,w.z,u.z,x.z,m,n,p);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;bthis.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;u=this.points[e[0]];w=this.points[e[1]]; +o=this.points[e[2]];x=this.points[e[3]];n=m*m;t=m*n;f.x=c(u.x,w.x,o.x,x.x,m,n,t);f.y=c(u.y,w.y,o.y,x.y,m,n,t);f.z=c(u.z,w.z,o.z,x.z,m,n,t);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;b0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(A.r*255)+","+Math.floor(A.g*255)+","+ -Math.floor(A.b*255)+","+z+")"),v.fillRect(Math.floor(S.getX()),Math.floor(S.getY()),Math.floor(S.getWidth()),Math.floor(S.getHeight()))),S.empty())};this.render=function(b,p){function t(b){var c,e,f,h=b.lights;N.setRGB(0,0,0);ma.setRGB(0,0,0);ua.setRGB(0,0,0);b=0;for(c=h.length;b>1,xa=t.height>>1,m=k.scale.x*u,p=k.scale.y*x,o=m*w,n=p*xa,O.set(b.x-o,b.y-n,b.x+o,b.y+n),za.intersects(O)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-p),v.translate(-w,-xa),v.drawImage(t,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(o=k.scale.x*u,n=k.scale.y*x,O.set(b.x-o,b.y-n,b.x+o,b.y+n),za.intersects(O)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(o,n),m.program(v), -v.restore()))}function eb(b,h,k,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(h.positionScreen.x,h.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(J!=b)v.lineCap=J=b;b=m.linejoin;if(M!=b)v.lineJoin=M=b;f(m.color.getContextStyle());v.stroke();O.inflate(m.linewidth*2)}}function y(b,f,h,m,n,t,u,v,xa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); -Q=b.positionScreen.x;Z=b.positionScreen.y;$=f.positionScreen.x;P=f.positionScreen.y;o=h.positionScreen.x;V=h.positionScreen.y;F(Q,Z,$,P,o,V);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=u.uvs[0],ab(Q,Z,$,P,o,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=p.matrixWorldInverse,oa.copy(u.vertexNormalsWorld[0]),sa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,ya= --(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(u.vertexNormalsWorld[1]),Ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Ga=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(u.vertexNormalsWorld[2]),Fa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Da=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,ab(Q,Z,$,P,o,V,sa,ya,Ca,Ga,Fa,Da,v.envMap)}else v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&& -(v.map.mapping instanceof THREE.UVMapping&&(ra=u.uvs[0],ab(Q,Z,$,P,o,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[t].u,ra[t].v,v.map)),e(THREE.SubtractiveBlending)),da?!v.wireframe&&v.shading==THREE.SmoothShading&&u.vertexNormalsWorld.length==3?(W.r=U.r=ia.r=N.r,W.g=U.g=ia.g=N.g,W.b=U.b=ia.b=N.b,w(xa,u.v1.positionWorld,u.vertexNormalsWorld[0],W),w(xa,u.v2.positionWorld,u.vertexNormalsWorld[1],U),w(xa,u.v3.positionWorld,u.vertexNormalsWorld[2],ia),W.r=Math.max(0,Math.min(v.color.r*W.r,1)),W.g=Math.max(0,Math.min(v.color.g* -W.g,1)),W.b=Math.max(0,Math.min(v.color.b*W.b,1)),U.r=Math.max(0,Math.min(v.color.r*U.r,1)),U.g=Math.max(0,Math.min(v.color.g*U.g,1)),U.b=Math.max(0,Math.min(v.color.b*U.b,1)),ia.r=Math.max(0,Math.min(v.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(v.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(v.color.b*ia.b,1)),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,o,V,0,0,1,0,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,u.centroidWorld,u.normalWorld,qa),aa.r=Math.max(0,Math.min(v.color.r* -qa.r,1)),aa.g=Math.max(0,Math.min(v.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(v.color.b*qa.b,1)),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)):v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshDepthMaterial)la=p.near,ca=p.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(h.positionScreen.z,la,ca),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ -ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,o,V,0,0,1,0,0,1,pa);else if(v instanceof THREE.MeshNormalMaterial)aa.r=Va(u.normalWorld.x),aa.g=Va(u.normalWorld.y),aa.b=Va(u.normalWorld.z),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)}function A(b,f,h,m,n,t,v,u,xa){k.info.render.vertices+=4;k.info.render.faces++;c(u.opacity);e(u.blending);if(u.map||u.envMap)y(b,f,m,0,1,3,v,u,xa),y(n,h,t,1,2,3,v,u,xa);else if(Q=b.positionScreen.x,Z=b.positionScreen.y, -$=f.positionScreen.x,P=f.positionScreen.y,o=h.positionScreen.x,V=h.positionScreen.y,fa=m.positionScreen.x,ea=m.positionScreen.y,ha=n.positionScreen.x,ga=n.positionScreen.y,ka=t.positionScreen.x,na=t.positionScreen.y,u instanceof THREE.MeshBasicMaterial)E(Q,Z,$,P,o,V,fa,ea),u.wireframe?Na(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(u.color);else if(u instanceof THREE.MeshLambertMaterial)da?!u.wireframe&&u.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4?(W.r= -U.r=ia.r=ja.r=N.r,W.g=U.g=ia.g=ja.g=N.g,W.b=U.b=ia.b=ja.b=N.b,w(xa,v.v1.positionWorld,v.vertexNormalsWorld[0],W),w(xa,v.v2.positionWorld,v.vertexNormalsWorld[1],U),w(xa,v.v4.positionWorld,v.vertexNormalsWorld[3],ia),w(xa,v.v3.positionWorld,v.vertexNormalsWorld[2],ja),W.r=Math.max(0,Math.min(u.color.r*W.r,1)),W.g=Math.max(0,Math.min(u.color.g*W.g,1)),W.b=Math.max(0,Math.min(u.color.b*W.b,1)),U.r=Math.max(0,Math.min(u.color.r*U.r,1)),U.g=Math.max(0,Math.min(u.color.g*U.g,1)),U.b=Math.max(0,Math.min(u.color.b* -U.b,1)),ia.r=Math.max(0,Math.min(u.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(u.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(u.color.b*ia.b,1)),ja.r=Math.max(0,Math.min(u.color.r*ja.r,1)),ja.g=Math.max(0,Math.min(u.color.g*ja.g,1)),ja.b=Math.max(0,Math.min(u.color.b*ja.b,1)),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,o,V,ka,na),Ua(ha,ga,o,V,ka,na,1,0,1,1,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,v.centroidWorld,v.normalWorld,qa),aa.r=Math.max(0,Math.min(u.color.r*qa.r, -1)),aa.g=Math.max(0,Math.min(u.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(u.color.b*qa.b,1)),E(Q,Z,$,P,o,V,fa,ea),u.wireframe?Na(aa,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(aa)):(E(Q,Z,$,P,o,V,fa,ea),u.wireframe?Na(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(u.color));else if(u instanceof THREE.MeshNormalMaterial)aa.r=Va(v.normalWorld.x),aa.g=Va(v.normalWorld.y),aa.b=Va(v.normalWorld.z),E(Q,Z,$,P,o,V,fa,ea),u.wireframe?Na(aa,u.wireframeLinewidth,u.wireframeLinecap, -u.wireframeLinejoin):C(aa);else if(u instanceof THREE.MeshDepthMaterial)la=p.near,ca=p.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,la,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,la,ca),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,o,V,ka,na),Ua(ha,ga,o,V,ka,na,1,0,1,1,0,1,pa)}function F(b,c,e,f,h,k){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(b,c);v.closePath()}function E(b, -c,e,f,h,k,m,o){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(m,o);v.lineTo(b,c);v.closePath()}function Na(b,c,e,h){if(G!=c)v.lineWidth=G=c;if(J!=e)v.lineCap=J=e;if(M!=h)v.lineJoin=M=h;f(b.getContextStyle());v.stroke();O.inflate(c*2)}function C(b){h(b.getContextStyle());v.fill()}function ab(b,c,e,f,k,m,o,n,p,u,t,xa,w){if(w.image.width!=0){if(w.needsUpdate==!0||ta[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,S=w.wrapT==THREE.RepeatWrapping;ta[w.id]=v.createPattern(w.image,x&& -S?"repeat":x&&!S?"repeat-x":!x&&S?"repeat-y":"no-repeat");w.needsUpdate=!1}h(ta[w.id]);var x=w.offset.x/w.repeat.x,S=w.offset.y/w.repeat.y,z=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,o=(o+x)*z,n=(n+S)*w,p=(p+x)*z,u=(u+S)*w,t=(t+x)*z,xa=(xa+S)*w;e-=b;f-=c;k-=b;m-=c;p-=o;u-=n;t-=o;xa-=n;x=1/(p*xa-t*u);w=(xa*e-u*k)*x;u=(xa*f-u*m)*x;e=(p*k-t*e)*x;f=(p*m-t*f)*x;b=b-w*o-e*n;c=c-u*o-f*n;v.save();v.transform(w,u,e,f,b,c);v.fill();v.restore()}}function Ua(b,c,e,f,h,k,m,o,n,p,u,t,w){var xa, -x;xa=w.width-1;x=w.height-1;m*=xa;o*=x;n*=xa;p*=x;u*=xa;t*=x;e-=b;f-=c;h-=b;k-=c;n-=m;p-=o;u-=m;t-=o;x=1/(n*t-u*p);xa=(t*e-p*h)*x;p=(t*f-p*k)*x;e=(n*h-u*e)*x;f=(n*k-u*f)*x;b=b-xa*m-e*o;c=c-p*m-f*o;v.save();v.transform(xa,p,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var h=~~(b.r*255),k=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),o=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),p=~~(e.g*255),e=~~(e.b*255),u=~~(f.r*255),t=~~(f.g*255),f=~~(f.b*255);va[0]=h<0?0:h>255?255:h;va[1]=k<0?0: -k>255?255:k;va[2]=b<0?0:b>255?255:b;va[4]=m<0?0:m>255?255:m;va[5]=o<0?0:o>255?255:o;va[6]=c<0?0:c>255?255:c;va[8]=n<0?0:n>255?255:n;va[9]=p<0?0:p>255?255:p;va[10]=e<0?0:e>255?255:e;va[12]=u<0?0:u>255?255:u;va[13]=t<0?0:t>255?255:t;va[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,h=e*e+f*f;h!=0&&(h=1/Math.sqrt(h),e*=h,f*=h,c.x+= -e,c.y+=f,b.x-=e,b.y-=f)}var Za,bb,wa,Ja,Pa,Wa,$a,Aa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,u,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,p,this.sortElements);(da=b.lights.length>0)&&t(b);Za=0;for(bb=m.length;Za0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(A.r*255)+","+Math.floor(A.g*255)+","+ +Math.floor(A.b*255)+","+z+")"),v.fillRect(Math.floor(S.getX()),Math.floor(S.getY()),Math.floor(S.getWidth()),Math.floor(S.getHeight()))),S.empty())};this.render=function(b,t){function u(b){var c,e,f,h=b.lights;N.setRGB(0,0,0);ma.setRGB(0,0,0);ua.setRGB(0,0,0);b=0;for(c=h.length;b>1,xa=u.height>>1,m=k.scale.x*o,t=k.scale.y*x,p=m*w,n=t*xa,O.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(O)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-t),v.translate(-w,-xa),v.drawImage(u,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(p=k.scale.x*o,n=k.scale.y*x,O.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(O)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(p,n),m.program(v), +v.restore()))}function eb(b,h,k,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(h.positionScreen.x,h.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(J!=b)v.lineCap=J=b;b=m.linejoin;if(M!=b)v.lineJoin=M=b;f(m.color.getContextStyle());v.stroke();O.inflate(m.linewidth*2)}}function y(b,f,h,m,n,u,o,v,xa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); +Q=b.positionScreen.x;Z=b.positionScreen.y;$=f.positionScreen.x;P=f.positionScreen.y;p=h.positionScreen.x;V=h.positionScreen.y;F(Q,Z,$,P,p,V);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,P,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[u].u,ra[u].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=t.matrixWorldInverse,oa.copy(o.vertexNormalsWorld[0]),sa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,ya= +-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[1]),Ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Ga=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[2]),Fa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Da=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,ab(Q,Z,$,P,p,V,sa,ya,Ca,Ga,Fa,Da,v.envMap)}else v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&& +(v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,P,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[u].u,ra[u].v,v.map)),e(THREE.SubtractiveBlending)),da?!v.wireframe&&v.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==3?(W.r=U.r=ia.r=N.r,W.g=U.g=ia.g=N.g,W.b=U.b=ia.b=N.b,w(xa,o.v1.positionWorld,o.vertexNormalsWorld[0],W),w(xa,o.v2.positionWorld,o.vertexNormalsWorld[1],U),w(xa,o.v3.positionWorld,o.vertexNormalsWorld[2],ia),W.r=Math.max(0,Math.min(v.color.r*W.r,1)),W.g=Math.max(0,Math.min(v.color.g* +W.g,1)),W.b=Math.max(0,Math.min(v.color.b*W.b,1)),U.r=Math.max(0,Math.min(v.color.r*U.r,1)),U.g=Math.max(0,Math.min(v.color.g*U.g,1)),U.b=Math.max(0,Math.min(v.color.b*U.b,1)),ia.r=Math.max(0,Math.min(v.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(v.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(v.color.b*ia.b,1)),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,p,V,0,0,1,0,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,o.centroidWorld,o.normalWorld,qa),aa.r=Math.max(0,Math.min(v.color.r* +qa.r,1)),aa.g=Math.max(0,Math.min(v.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(v.color.b*qa.b,1)),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)):v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshDepthMaterial)la=t.near,ca=t.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(h.positionScreen.z,la,ca),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ +ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,p,V,0,0,1,0,0,1,pa);else if(v instanceof THREE.MeshNormalMaterial)aa.r=Va(o.normalWorld.x),aa.g=Va(o.normalWorld.y),aa.b=Va(o.normalWorld.z),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)}function A(b,f,h,m,n,u,v,o,xa){k.info.render.vertices+=4;k.info.render.faces++;c(o.opacity);e(o.blending);if(o.map||o.envMap)y(b,f,m,0,1,3,v,o,xa),y(n,h,u,1,2,3,v,o,xa);else if(Q=b.positionScreen.x,Z=b.positionScreen.y, +$=f.positionScreen.x,P=f.positionScreen.y,p=h.positionScreen.x,V=h.positionScreen.y,fa=m.positionScreen.x,ea=m.positionScreen.y,ha=n.positionScreen.x,ga=n.positionScreen.y,ka=u.positionScreen.x,na=u.positionScreen.y,o instanceof THREE.MeshBasicMaterial)E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(o.color);else if(o instanceof THREE.MeshLambertMaterial)da?!o.wireframe&&o.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4?(W.r= +U.r=ia.r=ja.r=N.r,W.g=U.g=ia.g=ja.g=N.g,W.b=U.b=ia.b=ja.b=N.b,w(xa,v.v1.positionWorld,v.vertexNormalsWorld[0],W),w(xa,v.v2.positionWorld,v.vertexNormalsWorld[1],U),w(xa,v.v4.positionWorld,v.vertexNormalsWorld[3],ia),w(xa,v.v3.positionWorld,v.vertexNormalsWorld[2],ja),W.r=Math.max(0,Math.min(o.color.r*W.r,1)),W.g=Math.max(0,Math.min(o.color.g*W.g,1)),W.b=Math.max(0,Math.min(o.color.b*W.b,1)),U.r=Math.max(0,Math.min(o.color.r*U.r,1)),U.g=Math.max(0,Math.min(o.color.g*U.g,1)),U.b=Math.max(0,Math.min(o.color.b* +U.b,1)),ia.r=Math.max(0,Math.min(o.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(o.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(o.color.b*ia.b,1)),ja.r=Math.max(0,Math.min(o.color.r*ja.r,1)),ja.g=Math.max(0,Math.min(o.color.g*ja.g,1)),ja.b=Math.max(0,Math.min(o.color.b*ja.b,1)),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,v.centroidWorld,v.normalWorld,qa),aa.r=Math.max(0,Math.min(o.color.r*qa.r, +1)),aa.g=Math.max(0,Math.min(o.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(o.color.b*qa.b,1)),E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(aa,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(aa)):(E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(o.color));else if(o instanceof THREE.MeshNormalMaterial)aa.r=Va(v.normalWorld.x),aa.g=Va(v.normalWorld.y),aa.b=Va(v.normalWorld.z),E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(aa,o.wireframeLinewidth,o.wireframeLinecap, +o.wireframeLinejoin):C(aa);else if(o instanceof THREE.MeshDepthMaterial)la=t.near,ca=t.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,la,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,la,ca),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)}function F(b,c,e,f,h,k){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(b,c);v.closePath()}function E(b, +c,e,f,h,k,m,p){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(m,p);v.lineTo(b,c);v.closePath()}function Na(b,c,e,h){if(G!=c)v.lineWidth=G=c;if(J!=e)v.lineCap=J=e;if(M!=h)v.lineJoin=M=h;f(b.getContextStyle());v.stroke();O.inflate(c*2)}function C(b){h(b.getContextStyle());v.fill()}function ab(b,c,e,f,k,m,p,n,t,o,u,xa,w){if(w.image.width!=0){if(w.needsUpdate==!0||ta[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,S=w.wrapT==THREE.RepeatWrapping;ta[w.id]=v.createPattern(w.image,x&& +S?"repeat":x&&!S?"repeat-x":!x&&S?"repeat-y":"no-repeat");w.needsUpdate=!1}h(ta[w.id]);var x=w.offset.x/w.repeat.x,S=w.offset.y/w.repeat.y,z=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,p=(p+x)*z,n=(n+S)*w,t=(t+x)*z,o=(o+S)*w,u=(u+x)*z,xa=(xa+S)*w;e-=b;f-=c;k-=b;m-=c;t-=p;o-=n;u-=p;xa-=n;x=1/(t*xa-u*o);w=(xa*e-o*k)*x;o=(xa*f-o*m)*x;e=(t*k-u*e)*x;f=(t*m-u*f)*x;b=b-w*p-e*n;c=c-o*p-f*n;v.save();v.transform(w,o,e,f,b,c);v.fill();v.restore()}}function Ua(b,c,e,f,h,k,m,p,n,t,o,u,w){var xa, +x;xa=w.width-1;x=w.height-1;m*=xa;p*=x;n*=xa;t*=x;o*=xa;u*=x;e-=b;f-=c;h-=b;k-=c;n-=m;t-=p;o-=m;u-=p;x=1/(n*u-o*t);xa=(u*e-t*h)*x;t=(u*f-t*k)*x;e=(n*h-o*e)*x;f=(n*k-o*f)*x;b=b-xa*m-e*p;c=c-t*m-f*p;v.save();v.transform(xa,t,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var h=~~(b.r*255),k=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),p=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),t=~~(e.g*255),e=~~(e.b*255),o=~~(f.r*255),u=~~(f.g*255),f=~~(f.b*255);va[0]=h<0?0:h>255?255:h;va[1]=k<0?0: +k>255?255:k;va[2]=b<0?0:b>255?255:b;va[4]=m<0?0:m>255?255:m;va[5]=p<0?0:p>255?255:p;va[6]=c<0?0:c>255?255:c;va[8]=n<0?0:n>255?255:n;va[9]=t<0?0:t>255?255:t;va[10]=e<0?0:e>255?255:e;va[12]=o<0?0:o>255?255:o;va[13]=u<0?0:u>255?255:u;va[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,h=e*e+f*f;h!=0&&(h=1/Math.sqrt(h),e*=h,f*=h,c.x+= +e,c.y+=f,b.x-=e,b.y-=f)}var Za,bb,wa,Ja,Pa,Wa,$a,Aa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,o,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,t,this.sortElements);(da=b.lights.length>0)&&u(b);Za=0;for(bb=m.length;Za0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m)):k instanceof THREE.PointLight&&(Y.sub(k.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*k.intensity,m>0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m))}function c(c,e,m,n,u,t){k.info.render.vertices+=3;k.info.render.faces++;Q=f(Z++); -Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");u instanceof THREE.MeshBasicMaterial?G.copy(u.color):u instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(t,n,J),G.r=Math.max(0,Math.min(u.color.r*J.r,1)),G.g=Math.max(0,Math.min(u.color.g*J.g,1)),G.b=Math.max(0,Math.min(u.color.b*J.b,1))):G.copy(u.color):u instanceof THREE.MeshDepthMaterial?(L=1-u.__2near/(u.__farPlusNear- -n.z*u.__farMinusNear),G.setRGB(L,L,L)):u instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));u.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+u.wireframeLinewidth+"; stroke-opacity: "+u.opacity+"; stroke-linecap: "+u.wireframeLinecap+"; stroke-linejoin: "+u.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+u.opacity);p.appendChild(Q)}function e(c,e,m,n,u,t,v){k.info.render.vertices+= -4;k.info.render.faces++;Q=f(Z++);Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?G.copy(t.color):t instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(v,u,J),G.r=Math.max(0,Math.min(t.color.r*J.r,1)),G.g=Math.max(0,Math.min(t.color.g*J.g,1)),G.b=Math.max(0,Math.min(t.color.b*J.b,1))): -G.copy(t.color):t instanceof THREE.MeshDepthMaterial?(L=1-t.__2near/(t.__farPlusNear-u.z*t.__farMinusNear),G.setRGB(L,L,L)):t instanceof THREE.MeshNormalMaterial&&G.setRGB(h(u.normalWorld.x),h(u.normalWorld.y),h(u.normalWorld.z));t.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+ -"; fill-opacity: "+t.opacity);p.appendChild(Q)}function f(b){H[b]==null&&(H[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),P==0&&H[b].setAttribute("shape-rendering","crispEdges"));return H[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,p=document.createElementNS("http://www.w3.org/2000/svg","svg"),t,w,u,x,v,A,z,y,E=new THREE.Rectangle,F=new THREE.Rectangle,C=!1,G=new THREE.Color(16777215),J=new THREE.Color(16777215),M=new THREE.Color(0), -K=new THREE.Color(0),B=new THREE.Color(0),L,Y=new THREE.Vector3,H=[],T=[],Q,Z,$,P=1;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":P=1;break;case "low":P=0}};this.setSize=function(b,c){t=b;w=c;u=t/2;x=w/2;p.setAttribute("viewBox",-u+" "+-x+" "+t+" "+w);p.setAttribute("width",t);p.setAttribute("height",w);E.set(-u,-x,u,x)};this.clear=function(){for(;p.childNodes.length>0;)p.removeChild(p.childNodes[0])}; -this.render=function(b,f){var h,t,w,G,H,L,J,W;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);$=Z=0;if(C=b.lights.length>0){J=b.lights;M.setRGB(0,0,0);K.setRGB(0,0,0);B.setRGB(0,0,0);h=0;for(t=J.length;h0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m)):k instanceof THREE.PointLight&&(Y.sub(k.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*k.intensity,m>0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m))}function c(c,e,m,n,o,u){k.info.render.vertices+=3;k.info.render.faces++;Q=f(Z++); +Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");o instanceof THREE.MeshBasicMaterial?G.copy(o.color):o instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(u,n,J),G.r=Math.max(0,Math.min(o.color.r*J.r,1)),G.g=Math.max(0,Math.min(o.color.g*J.g,1)),G.b=Math.max(0,Math.min(o.color.b*J.b,1))):G.copy(o.color):o instanceof THREE.MeshDepthMaterial?(L=1-o.__2near/(o.__farPlusNear- +n.z*o.__farMinusNear),G.setRGB(L,L,L)):o instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));o.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+o.wireframeLinewidth+"; stroke-opacity: "+o.opacity+"; stroke-linecap: "+o.wireframeLinecap+"; stroke-linejoin: "+o.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+o.opacity);t.appendChild(Q)}function e(c,e,m,n,o,u,v){k.info.render.vertices+= +4;k.info.render.faces++;Q=f(Z++);Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");u instanceof THREE.MeshBasicMaterial?G.copy(u.color):u instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(v,o,J),G.r=Math.max(0,Math.min(u.color.r*J.r,1)),G.g=Math.max(0,Math.min(u.color.g*J.g,1)),G.b=Math.max(0,Math.min(u.color.b*J.b,1))): +G.copy(u.color):u instanceof THREE.MeshDepthMaterial?(L=1-u.__2near/(u.__farPlusNear-o.z*u.__farMinusNear),G.setRGB(L,L,L)):u instanceof THREE.MeshNormalMaterial&&G.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));u.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+u.wireframeLinewidth+"; stroke-opacity: "+u.opacity+"; stroke-linecap: "+u.wireframeLinecap+"; stroke-linejoin: "+u.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+ +"; fill-opacity: "+u.opacity);t.appendChild(Q)}function f(b){H[b]==null&&(H[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),P==0&&H[b].setAttribute("shape-rendering","crispEdges"));return H[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,t=document.createElementNS("http://www.w3.org/2000/svg","svg"),u,w,o,x,v,A,z,y,E=new THREE.Rectangle,F=new THREE.Rectangle,C=!1,G=new THREE.Color(16777215),J=new THREE.Color(16777215),M=new THREE.Color(0), +K=new THREE.Color(0),B=new THREE.Color(0),L,Y=new THREE.Vector3,H=[],T=[],Q,Z,$,P=1;this.domElement=t;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":P=1;break;case "low":P=0}};this.setSize=function(b,c){u=b;w=c;o=u/2;x=w/2;t.setAttribute("viewBox",-o+" "+-x+" "+u+" "+w);t.setAttribute("width",u);t.setAttribute("height",w);E.set(-o,-x,o,x)};this.clear=function(){for(;t.childNodes.length>0;)t.removeChild(t.childNodes[0])}; +this.render=function(b,f){var h,u,w,G,H,L,J,W;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);$=Z=0;if(C=b.lights.length>0){J=b.lights;M.setRGB(0,0,0);K.setRGB(0,0,0);B.setRGB(0,0,0);h=0;for(u=J.length;h=0)c&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer),o.vertexAttribPointer(b.position,3,o.FLOAT,!1,0,0));else if(m.morphTargetBase){f=h.program.attributes;m.morphTargetBase!== --1?(o.bindBuffer(o.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[m.morphTargetBase]),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0)):f.position>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglVertexBuffer),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var p=0,t=m.morphTargetForcedOrder,u=m.morphTargetInfluences;pv&&(w=x,v=u[w]);o.bindBuffer(o.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[w]);o.vertexAttribPointer(f["morphTarget"+p],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[p]=v;t[w]=1;v=-1;p++}}h.program.uniforms.morphTargetInfluences!==null&&o.uniform1fv(h.program.uniforms.morphTargetInfluences, -m.__webglMorphTargetInfluences)}if(c){if(k.__webglCustomAttributes)for(n in k.__webglCustomAttributes)b[n]>=0&&(f=k.__webglCustomAttributes[n],o.bindBuffer(o.ARRAY_BUFFER,f.buffer),o.vertexAttribPointer(b[n],f.size,o.FLOAT,!1,0,0));b.color>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglColorBuffer),o.vertexAttribPointer(b.color,3,o.FLOAT,!1,0,0));b.normal>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglNormalBuffer),o.vertexAttribPointer(b.normal,3,o.FLOAT,!1,0,0));b.tangent>=0&&(o.bindBuffer(o.ARRAY_BUFFER, -k.__webglTangentBuffer),o.vertexAttribPointer(b.tangent,4,o.FLOAT,!1,0,0));b.uv>=0&&(k.__webglUVBuffer?(o.bindBuffer(o.ARRAY_BUFFER,k.__webglUVBuffer),o.vertexAttribPointer(b.uv,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv)):o.disableVertexAttribArray(b.uv));b.uv2>=0&&(k.__webglUV2Buffer?(o.bindBuffer(o.ARRAY_BUFFER,k.__webglUV2Buffer),o.vertexAttribPointer(b.uv2,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv2)):o.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>= -0&&b.skinIndex>=0&&b.skinWeight>=0&&(o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinVertexABuffer),o.vertexAttribPointer(b.skinVertexA,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinVertexBBuffer),o.vertexAttribPointer(b.skinVertexB,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinIndicesBuffer),o.vertexAttribPointer(b.skinIndex,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,k.__webglSkinWeightsBuffer),o.vertexAttribPointer(b.skinWeight,4,o.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(h.wireframe? -(o.lineWidth(h.wireframeLinewidth),c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,k.__webglLineBuffer),o.drawElements(o.LINES,k.__webglLineCount,o.UNSIGNED_SHORT,0)):(c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,k.__webglFaceBuffer),o.drawElements(o.TRIANGLES,k.__webglFaceCount,o.UNSIGNED_SHORT,0)),P.info.render.calls++,P.info.render.vertices+=k.__webglFaceCount,P.info.render.faces+=k.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?o.LINE_STRIP:o.LINES,o.lineWidth(h.linewidth),o.drawArrays(m, -0,k.__webglLineCount),P.info.render.calls++):m instanceof THREE.ParticleSystem?(o.drawArrays(o.POINTS,0,k.__webglParticleCount),P.info.render.calls++):m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP,0,k.__webglVertexCount),P.info.render.calls++)}}function h(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=o.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=o.createBuffer();b.hasPos&&(o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,b.positionArray, -o.DYNAMIC_DRAW),o.enableVertexAttribArray(c.attributes.position),o.vertexAttribPointer(c.attributes.position,3,o.FLOAT,!1,0,0));if(b.hasNormal){o.bindBuffer(o.ARRAY_BUFFER,b.__webglNormalBuffer);if(e==THREE.FlatShading){var f,k,h,m,n,p,t,u,v,w,x=b.count*3;for(w=0;w=0)c&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(b.position,3,p.FLOAT,!1,0,0));else if(m.morphTargetBase){f=h.program.attributes;m.morphTargetBase!== +-1?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[m.morphTargetBase]),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0)):f.position>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var o=0,t=m.morphTargetForcedOrder,u=m.morphTargetInfluences;ov&&(w=x,v=u[w]);p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[w]);p.vertexAttribPointer(f["morphTarget"+o],3,p.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[o]=v;t[w]=1;v=-1;o++}}h.program.uniforms.morphTargetInfluences!==null&&p.uniform1fv(h.program.uniforms.morphTargetInfluences, +m.__webglMorphTargetInfluences)}if(c){if(k.__webglCustomAttributes)for(n in k.__webglCustomAttributes)b[n]>=0&&(f=k.__webglCustomAttributes[n],p.bindBuffer(p.ARRAY_BUFFER,f.buffer),p.vertexAttribPointer(b[n],f.size,p.FLOAT,!1,0,0));b.color>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglColorBuffer),p.vertexAttribPointer(b.color,3,p.FLOAT,!1,0,0));b.normal>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglNormalBuffer),p.vertexAttribPointer(b.normal,3,p.FLOAT,!1,0,0));b.tangent>=0&&(p.bindBuffer(p.ARRAY_BUFFER, +k.__webglTangentBuffer),p.vertexAttribPointer(b.tangent,4,p.FLOAT,!1,0,0));b.uv>=0&&(k.__webglUVBuffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUVBuffer),p.vertexAttribPointer(b.uv,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv)):p.disableVertexAttribArray(b.uv));b.uv2>=0&&(k.__webglUV2Buffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUV2Buffer),p.vertexAttribPointer(b.uv2,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv2)):p.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>= +0&&b.skinIndex>=0&&b.skinWeight>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexABuffer),p.vertexAttribPointer(b.skinVertexA,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexBBuffer),p.vertexAttribPointer(b.skinVertexB,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinIndicesBuffer),p.vertexAttribPointer(b.skinIndex,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinWeightsBuffer),p.vertexAttribPointer(b.skinWeight,4,p.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(h.wireframe? +(p.lineWidth(h.wireframeLinewidth),c&&p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,k.__webglLineBuffer),p.drawElements(p.LINES,k.__webglLineCount,p.UNSIGNED_SHORT,0)):(c&&p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,k.__webglFaceBuffer),p.drawElements(p.TRIANGLES,k.__webglFaceCount,p.UNSIGNED_SHORT,0)),P.info.render.calls++,P.info.render.vertices+=k.__webglFaceCount,P.info.render.faces+=k.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?p.LINE_STRIP:p.LINES,p.lineWidth(h.linewidth),p.drawArrays(m, +0,k.__webglLineCount),P.info.render.calls++):m instanceof THREE.ParticleSystem?(p.drawArrays(p.POINTS,0,k.__webglParticleCount),P.info.render.calls++):m instanceof THREE.Ribbon&&(p.drawArrays(p.TRIANGLE_STRIP,0,k.__webglVertexCount),P.info.render.calls++)}}function h(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=p.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=p.createBuffer();b.hasPos&&(p.bindBuffer(p.ARRAY_BUFFER,b.__webglVertexBuffer),p.bufferData(p.ARRAY_BUFFER,b.positionArray, +p.DYNAMIC_DRAW),p.enableVertexAttribArray(c.attributes.position),p.vertexAttribPointer(c.attributes.position,3,p.FLOAT,!1,0,0));if(b.hasNormal){p.bindBuffer(p.ARRAY_BUFFER,b.__webglNormalBuffer);if(e==THREE.FlatShading){var f,k,h,m,n,o,t,u,v,w,x=b.count*3;for(w=0;w=0;e--)b[e].object==c&&b.splice(e,1)}function J(b){function c(b){var k=[];e=0;for(f=b.length;e65535&&(t[o].counter+=1,p=t[o].hash+"_"+t[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[],materials:n,vertices:0,numMorphTargets:u})),b.geometryGroups[p].faces.push(k),b.geometryGroups[p].vertices+=m;b.geometryGroupsList=[];for(var v in b.geometryGroups)b.geometryGroups[v].id=ka++,b.geometryGroupsList.push(b.geometryGroups[v])}function M(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0}, -transparent:{list:[],count:0}})}function K(b){if(b!=W){switch(b){case THREE.AdditiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE);break;case THREE.SubtractiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,o.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,o.SRC_COLOR);break;default:o.blendEquationSeparate(o.FUNC_ADD,o.FUNC_ADD),o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA)}W=b}} -function B(b,c,e){(e.width&e.width-1)==0&&(e.height&e.height-1)==0?(o.texParameteri(b,o.TEXTURE_WRAP_S,$(c.wrapS)),o.texParameteri(b,o.TEXTURE_WRAP_T,$(c.wrapT)),o.texParameteri(b,o.TEXTURE_MAG_FILTER,$(c.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,$(c.minFilter)),o.generateMipmap(b)):(o.texParameteri(b,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_MAG_FILTER,Z(c.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,Z(c.minFilter)))} -function L(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=o.createTexture(),P.info.memory.textures++;o.activeTexture(o.TEXTURE0+c);o.bindTexture(o.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?o.texImage2D(o.TEXTURE_2D,0,$(b.format),b.image.width,b.image.height,0,$(b.format),o.UNSIGNED_BYTE,b.image.data):o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,b.image);B(o.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+c),o.bindTexture(o.TEXTURE_2D, -b.__webglTexture)}function Y(b,c){o.bindRenderbuffer(o.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_COMPONENT16,c.width,c.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,c.width,c.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,b)):o.renderbufferStorage(o.RENDERBUFFER,o.RGBA4,c.width,c.height)} -function H(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=o.createTexture();if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture);B(o.TEXTURE_CUBE_MAP,b,b);for(var e=0;e<6;e++){b.__webglFramebuffer[e]=o.createFramebuffer();b.__webglRenderbuffer[e]=o.createRenderbuffer();o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+ -e,0,$(b.format),b.width,b.height,0,$(b.format),$(b.type),null);var f=b,k=o.TEXTURE_CUBE_MAP_POSITIVE_X+e;o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer[e]);o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,k,f.__webglTexture,0);Y(b.__webglRenderbuffer[e],b)}}else b.__webglFramebuffer=o.createFramebuffer(),b.__webglRenderbuffer=o.createRenderbuffer(),o.bindTexture(o.TEXTURE_2D,b.__webglTexture),B(o.TEXTURE_2D,b,b),o.texImage2D(o.TEXTURE_2D,0,$(b.format),b.width,b.height,0,$(b.format), -$(b.type),null),e=o.TEXTURE_2D,o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,e,b.__webglTexture,0),o.bindRenderbuffer(o.RENDERBUFFER,b.__webglRenderbuffer),Y(b.__webglRenderbuffer,b);c?o.bindTexture(o.TEXTURE_CUBE_MAP,null):o.bindTexture(o.TEXTURE_2D,null);o.bindRenderbuffer(o.RENDERBUFFER,null);o.bindFramebuffer(o.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,e=b.width,b=b.height,k=f=0):(c=null, -e=ra,b=sa,f=ca,k=pa);c!=ea&&(o.bindFramebuffer(o.FRAMEBUFFER,c),o.viewport(f,k,e,b),ea=c)}function T(b){b instanceof THREE.WebGLRenderTargetCube?(o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture),o.generateMipmap(o.TEXTURE_CUBE_MAP),o.bindTexture(o.TEXTURE_CUBE_MAP,null)):(o.bindTexture(o.TEXTURE_2D,b.__webglTexture),o.generateMipmap(o.TEXTURE_2D),o.bindTexture(o.TEXTURE_2D,null))}function Q(b,c){var e;b=="fragment"?e=o.createShader(o.FRAGMENT_SHADER):b=="vertex"&&(e=o.createShader(o.VERTEX_SHADER)); -o.shaderSource(e,c);o.compileShader(e);if(!o.getShaderParameter(e,o.COMPILE_STATUS))return console.error(o.getShaderInfoLog(e)),console.error(c),null;return e}function Z(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return o.NEAREST;default:return o.LINEAR}}function $(b){switch(b){case THREE.RepeatWrapping:return o.REPEAT;case THREE.ClampToEdgeWrapping:return o.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return o.MIRRORED_REPEAT; -case THREE.NearestFilter:return o.NEAREST;case THREE.NearestMipMapNearestFilter:return o.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return o.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return o.LINEAR;case THREE.LinearMipMapNearestFilter:return o.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return o.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return o.BYTE;case THREE.UnsignedByteType:return o.UNSIGNED_BYTE;case THREE.ShortType:return o.SHORT;case THREE.UnsignedShortType:return o.UNSIGNED_SHORT; -case THREE.IntType:return o.INT;case THREE.UnsignedShortType:return o.UNSIGNED_INT;case THREE.FloatType:return o.FLOAT;case THREE.AlphaFormat:return o.ALPHA;case THREE.RGBFormat:return o.RGB;case THREE.RGBAFormat:return o.RGBA;case THREE.LuminanceFormat:return o.LUMINANCE;case THREE.LuminanceAlphaFormat:return o.LUMINANCE_ALPHA}return 0}var P=this,o,V=[],fa=null,ea=null,ha=-1,ga=null,ka=0,na=null,aa=null,W=null,U=null,ia=null,ja=null,ta=null,la=null,ca=0,pa=0,ra=0,sa=0,ya=[new THREE.Vector4,new THREE.Vector4, +c){var e;for(e=b.length-1;e>=0;e--)b[e].object==c&&b.splice(e,1)}function J(b){function c(b){var k=[];e=0;for(f=b.length;e65535&&(t[p].counter+=1,o=t[p].hash+"_"+t[p].counter,b.geometryGroups[o]==void 0&&(b.geometryGroups[o]={faces:[],materials:n,vertices:0,numMorphTargets:u})),b.geometryGroups[o].faces.push(k),b.geometryGroups[o].vertices+=m;b.geometryGroupsList=[];for(var v in b.geometryGroups)b.geometryGroups[v].id=ka++,b.geometryGroupsList.push(b.geometryGroups[v])}function M(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0}, +transparent:{list:[],count:0}})}function K(b){if(b!=W){switch(b){case THREE.AdditiveBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.SRC_ALPHA,p.ONE);break;case THREE.SubtractiveBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.ZERO,p.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.ZERO,p.SRC_COLOR);break;default:p.blendEquationSeparate(p.FUNC_ADD,p.FUNC_ADD),p.blendFuncSeparate(p.SRC_ALPHA,p.ONE_MINUS_SRC_ALPHA,p.ONE,p.ONE_MINUS_SRC_ALPHA)}W=b}} +function B(b,c,e){(e.width&e.width-1)==0&&(e.height&e.height-1)==0?(p.texParameteri(b,p.TEXTURE_WRAP_S,$(c.wrapS)),p.texParameteri(b,p.TEXTURE_WRAP_T,$(c.wrapT)),p.texParameteri(b,p.TEXTURE_MAG_FILTER,$(c.magFilter)),p.texParameteri(b,p.TEXTURE_MIN_FILTER,$(c.minFilter)),p.generateMipmap(b)):(p.texParameteri(b,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(b,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(b,p.TEXTURE_MAG_FILTER,Z(c.magFilter)),p.texParameteri(b,p.TEXTURE_MIN_FILTER,Z(c.minFilter)))} +function L(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=p.createTexture(),P.info.memory.textures++;p.activeTexture(p.TEXTURE0+c);p.bindTexture(p.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?p.texImage2D(p.TEXTURE_2D,0,$(b.format),b.image.width,b.image.height,0,$(b.format),p.UNSIGNED_BYTE,b.image.data):p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,b.image);B(p.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else p.activeTexture(p.TEXTURE0+c),p.bindTexture(p.TEXTURE_2D, +b.__webglTexture)}function Y(b,c){p.bindRenderbuffer(p.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_COMPONENT16,c.width,c.height),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_STENCIL,c.width,c.height),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_STENCIL_ATTACHMENT,p.RENDERBUFFER,b)):p.renderbufferStorage(p.RENDERBUFFER,p.RGBA4,c.width,c.height)} +function H(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=p.createTexture();if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];p.bindTexture(p.TEXTURE_CUBE_MAP,b.__webglTexture);B(p.TEXTURE_CUBE_MAP,b,b);for(var e=0;e<6;e++){b.__webglFramebuffer[e]=p.createFramebuffer();b.__webglRenderbuffer[e]=p.createRenderbuffer();p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X+ +e,0,$(b.format),b.width,b.height,0,$(b.format),$(b.type),null);var f=b,k=p.TEXTURE_CUBE_MAP_POSITIVE_X+e;p.bindFramebuffer(p.FRAMEBUFFER,b.__webglFramebuffer[e]);p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,k,f.__webglTexture,0);Y(b.__webglRenderbuffer[e],b)}}else b.__webglFramebuffer=p.createFramebuffer(),b.__webglRenderbuffer=p.createRenderbuffer(),p.bindTexture(p.TEXTURE_2D,b.__webglTexture),B(p.TEXTURE_2D,b,b),p.texImage2D(p.TEXTURE_2D,0,$(b.format),b.width,b.height,0,$(b.format), +$(b.type),null),e=p.TEXTURE_2D,p.bindFramebuffer(p.FRAMEBUFFER,b.__webglFramebuffer),p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,e,b.__webglTexture,0),p.bindRenderbuffer(p.RENDERBUFFER,b.__webglRenderbuffer),Y(b.__webglRenderbuffer,b);c?p.bindTexture(p.TEXTURE_CUBE_MAP,null):p.bindTexture(p.TEXTURE_2D,null);p.bindRenderbuffer(p.RENDERBUFFER,null);p.bindFramebuffer(p.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,e=b.width,b=b.height,k=f=0):(c=null, +e=ra,b=sa,f=ca,k=pa);c!=ea&&(p.bindFramebuffer(p.FRAMEBUFFER,c),p.viewport(f,k,e,b),ea=c)}function T(b){b instanceof THREE.WebGLRenderTargetCube?(p.bindTexture(p.TEXTURE_CUBE_MAP,b.__webglTexture),p.generateMipmap(p.TEXTURE_CUBE_MAP),p.bindTexture(p.TEXTURE_CUBE_MAP,null)):(p.bindTexture(p.TEXTURE_2D,b.__webglTexture),p.generateMipmap(p.TEXTURE_2D),p.bindTexture(p.TEXTURE_2D,null))}function Q(b,c){var e;b=="fragment"?e=p.createShader(p.FRAGMENT_SHADER):b=="vertex"&&(e=p.createShader(p.VERTEX_SHADER)); +p.shaderSource(e,c);p.compileShader(e);if(!p.getShaderParameter(e,p.COMPILE_STATUS))return console.error(p.getShaderInfoLog(e)),console.error(c),null;return e}function Z(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return p.NEAREST;default:return p.LINEAR}}function $(b){switch(b){case THREE.RepeatWrapping:return p.REPEAT;case THREE.ClampToEdgeWrapping:return p.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return p.MIRRORED_REPEAT; +case THREE.NearestFilter:return p.NEAREST;case THREE.NearestMipMapNearestFilter:return p.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return p.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return p.LINEAR;case THREE.LinearMipMapNearestFilter:return p.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return p.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return p.BYTE;case THREE.UnsignedByteType:return p.UNSIGNED_BYTE;case THREE.ShortType:return p.SHORT;case THREE.UnsignedShortType:return p.UNSIGNED_SHORT; +case THREE.IntType:return p.INT;case THREE.UnsignedShortType:return p.UNSIGNED_INT;case THREE.FloatType:return p.FLOAT;case THREE.AlphaFormat:return p.ALPHA;case THREE.RGBFormat:return p.RGB;case THREE.RGBAFormat:return p.RGBA;case THREE.LuminanceFormat:return p.LUMINANCE;case THREE.LuminanceAlphaFormat:return p.LUMINANCE_ALPHA}return 0}var P=this,p,V=[],fa=null,ea=null,ha=-1,ga=null,ka=0,na=null,aa=null,W=null,U=null,ia=null,ja=null,ta=null,la=null,ca=0,pa=0,ra=0,sa=0,ya=[new THREE.Vector4,new THREE.Vector4, new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Ga=new Float32Array(16),Fa=new Float32Array(16),Da=new THREE.Vector4,za={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},S=b.canvas!==void 0?b.canvas:document.createElement("canvas"),O=b.stencil!==void 0?b.stencil:!0,da=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,qa=b.antialias!==void 0?b.antialias:!1,N=b.clearColor!== void 0?new THREE.Color(b.clearColor):new THREE.Color(0),ma=b.clearAlpha!==void 0?b.clearAlpha:0,ua=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=S;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight= this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var oa,Ea=[],b=THREE.ShaderLib.depthRGBA,Ia=THREE.UniformsUtils.clone(b.uniforms),Ba=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Ia}),va=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Ia,morphTargets:!0});Ba._shadowPass= -!0;va._shadowPass=!0;try{if(!(o=S.getContext("experimental-webgl",{antialias:qa,stencil:O,preserveDrawingBuffer:da})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+o.getParameter(o.VERSION)+" | "+o.getParameter(o.VENDOR)+" | "+o.getParameter(o.RENDERER)+" | "+o.getParameter(o.SHADING_LANGUAGE_VERSION))}catch(Ka){console.error(Ka)}o.clearColor(0,0,0,1);o.clearDepth(1);o.clearStencil(0);o.enable(o.DEPTH_TEST);o.depthFunc(o.LEQUAL);o.frontFace(o.CCW);o.cullFace(o.BACK);o.enable(o.CULL_FACE); -o.enable(o.BLEND);o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA);o.clearColor(N.r,N.g,N.b,ma);this.context=o;var Ha=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,X={};X.vertices=new Float32Array(16);X.faces=new Uint16Array(6);O=0;X.vertices[O++]=-1;X.vertices[O++]=-1;X.vertices[O++]=0;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=-1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=0;X.vertices[O++]=-1; -X.vertices[O++]=1;X.vertices[O++]=0;O=X.vertices[O++]=0;X.faces[O++]=0;X.faces[O++]=1;X.faces[O++]=2;X.faces[O++]=0;X.faces[O++]=2;X.faces[O++]=3;X.vertexBuffer=o.createBuffer();X.elementBuffer=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,X.vertexBuffer);o.bufferData(o.ARRAY_BUFFER,X.vertices,o.STATIC_DRAW);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,X.elementBuffer);o.bufferData(o.ELEMENT_ARRAY_BUFFER,X.faces,o.STATIC_DRAW);X.program=o.createProgram();o.attachShader(X.program,Q("fragment",THREE.ShaderLib.sprite.fragmentShader)); -o.attachShader(X.program,Q("vertex",THREE.ShaderLib.sprite.vertexShader));o.linkProgram(X.program);X.attributes={};X.uniforms={};X.attributes.position=o.getAttribLocation(X.program,"position");X.attributes.uv=o.getAttribLocation(X.program,"uv");X.uniforms.uvOffset=o.getUniformLocation(X.program,"uvOffset");X.uniforms.uvScale=o.getUniformLocation(X.program,"uvScale");X.uniforms.rotation=o.getUniformLocation(X.program,"rotation");X.uniforms.scale=o.getUniformLocation(X.program,"scale");X.uniforms.alignment= -o.getUniformLocation(X.program,"alignment");X.uniforms.color=o.getUniformLocation(X.program,"color");X.uniforms.map=o.getUniformLocation(X.program,"map");X.uniforms.opacity=o.getUniformLocation(X.program,"opacity");X.uniforms.useScreenCoordinates=o.getUniformLocation(X.program,"useScreenCoordinates");X.uniforms.affectedByDistance=o.getUniformLocation(X.program,"affectedByDistance");X.uniforms.screenPosition=o.getUniformLocation(X.program,"screenPosition");X.uniforms.modelViewMatrix=o.getUniformLocation(X.program, -"modelViewMatrix");X.uniforms.projectionMatrix=o.getUniformLocation(X.program,"projectionMatrix");var Xa=!1;this.setSize=function(b,c){S.width=b;S.height=c;this.setViewport(0,0,S.width,S.height)};this.setViewport=function(b,c,e,f){ca=b;pa=c;ra=e;sa=f;o.viewport(ca,pa,ra,sa)};this.setScissor=function(b,c,e,f){o.scissor(b,c,e,f)};this.enableScissorTest=function(b){b?o.enable(o.SCISSOR_TEST):o.disable(o.SCISSOR_TEST)};this.setClearColorHex=function(b,c){N.setHex(b);ma=c;o.clearColor(N.r,N.g,N.b,ma)}; -this.setClearColor=function(b,c){N.copy(b);ma=c;o.clearColor(N.r,N.g,N.b,ma)};this.getClearColor=function(){return N};this.getClearAlpha=function(){return ma};this.clear=function(b,c,e){var f=0;if(b==void 0||b)f|=o.COLOR_BUFFER_BIT;if(c==void 0||c)f|=o.DEPTH_BUFFER_BIT;if(e==void 0||e)f|=o.STENCIL_BUFFER_BIT;o.clear(f)};this.getContext=function(){return o};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray, -delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];o.deleteBuffer(c.__webglVertexBuffer);o.deleteBuffer(c.__webglNormalBuffer);o.deleteBuffer(c.__webglTangentBuffer);o.deleteBuffer(c.__webglColorBuffer);o.deleteBuffer(c.__webglUVBuffer);o.deleteBuffer(c.__webglUV2Buffer);o.deleteBuffer(c.__webglSkinVertexABuffer);o.deleteBuffer(c.__webglSkinVertexBBuffer);o.deleteBuffer(c.__webglSkinIndicesBuffer);o.deleteBuffer(c.__webglSkinWeightsBuffer); -o.deleteBuffer(c.__webglFaceBuffer);o.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var e=0,f=c.numMorphTargets;e0,X={};X.vertices=new Float32Array(16);X.faces=new Uint16Array(6);O=0;X.vertices[O++]=-1;X.vertices[O++]=-1;X.vertices[O++]=0;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=-1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=0;X.vertices[O++]=-1; +X.vertices[O++]=1;X.vertices[O++]=0;O=X.vertices[O++]=0;X.faces[O++]=0;X.faces[O++]=1;X.faces[O++]=2;X.faces[O++]=0;X.faces[O++]=2;X.faces[O++]=3;X.vertexBuffer=p.createBuffer();X.elementBuffer=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,X.vertexBuffer);p.bufferData(p.ARRAY_BUFFER,X.vertices,p.STATIC_DRAW);p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,X.elementBuffer);p.bufferData(p.ELEMENT_ARRAY_BUFFER,X.faces,p.STATIC_DRAW);X.program=p.createProgram();p.attachShader(X.program,Q("fragment",THREE.ShaderLib.sprite.fragmentShader)); +p.attachShader(X.program,Q("vertex",THREE.ShaderLib.sprite.vertexShader));p.linkProgram(X.program);X.attributes={};X.uniforms={};X.attributes.position=p.getAttribLocation(X.program,"position");X.attributes.uv=p.getAttribLocation(X.program,"uv");X.uniforms.uvOffset=p.getUniformLocation(X.program,"uvOffset");X.uniforms.uvScale=p.getUniformLocation(X.program,"uvScale");X.uniforms.rotation=p.getUniformLocation(X.program,"rotation");X.uniforms.scale=p.getUniformLocation(X.program,"scale");X.uniforms.alignment= +p.getUniformLocation(X.program,"alignment");X.uniforms.color=p.getUniformLocation(X.program,"color");X.uniforms.map=p.getUniformLocation(X.program,"map");X.uniforms.opacity=p.getUniformLocation(X.program,"opacity");X.uniforms.useScreenCoordinates=p.getUniformLocation(X.program,"useScreenCoordinates");X.uniforms.affectedByDistance=p.getUniformLocation(X.program,"affectedByDistance");X.uniforms.screenPosition=p.getUniformLocation(X.program,"screenPosition");X.uniforms.modelViewMatrix=p.getUniformLocation(X.program, +"modelViewMatrix");X.uniforms.projectionMatrix=p.getUniformLocation(X.program,"projectionMatrix");var Xa=!1;this.setSize=function(b,c){S.width=b;S.height=c;this.setViewport(0,0,S.width,S.height)};this.setViewport=function(b,c,e,f){ca=b;pa=c;ra=e;sa=f;p.viewport(ca,pa,ra,sa)};this.setScissor=function(b,c,e,f){p.scissor(b,c,e,f)};this.enableScissorTest=function(b){b?p.enable(p.SCISSOR_TEST):p.disable(p.SCISSOR_TEST)};this.setClearColorHex=function(b,c){N.setHex(b);ma=c;p.clearColor(N.r,N.g,N.b,ma)}; +this.setClearColor=function(b,c){N.copy(b);ma=c;p.clearColor(N.r,N.g,N.b,ma)};this.getClearColor=function(){return N};this.getClearAlpha=function(){return ma};this.clear=function(b,c,e){var f=0;if(b==void 0||b)f|=p.COLOR_BUFFER_BIT;if(c==void 0||c)f|=p.DEPTH_BUFFER_BIT;if(e==void 0||e)f|=p.STENCIL_BUFFER_BIT;p.clear(f)};this.getContext=function(){return p};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray, +delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];p.deleteBuffer(c.__webglVertexBuffer);p.deleteBuffer(c.__webglNormalBuffer);p.deleteBuffer(c.__webglTangentBuffer);p.deleteBuffer(c.__webglColorBuffer);p.deleteBuffer(c.__webglUVBuffer);p.deleteBuffer(c.__webglUV2Buffer);p.deleteBuffer(c.__webglSkinVertexABuffer);p.deleteBuffer(c.__webglSkinVertexBBuffer);p.deleteBuffer(c.__webglSkinIndicesBuffer);p.deleteBuffer(c.__webglSkinWeightsBuffer); +p.deleteBuffer(c.__webglFaceBuffer);p.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var e=0,f=c.numMorphTargets;e=0&&o.enableVertexAttribArray(x.position);x.color>=0&&o.enableVertexAttribArray(x.color);x.normal>=0&&o.enableVertexAttribArray(x.normal);x.tangent>=0&&o.enableVertexAttribArray(x.tangent); -b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(o.enableVertexAttribArray(x.skinVertexA),o.enableVertexAttribArray(x.skinVertexB),o.enableVertexAttribArray(x.skinIndex),o.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(h in b.attributes)x[h]!==void 0&&x[h]>=0&&o.enableVertexAttribArray(x[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h=0&&(o.enableVertexAttribArray(x[y]),b.numSupportedMorphTargets++); -b.uniformsList=[];for(k in b.uniforms)b.uniformsList.push([b.uniforms[k],k])};this.clearTarget=function(b,c,e,f){H(b);this.clear(c,e,f)};this.updateShadowMap=function(b,c){z(b,c)};this.render=function(b,c,u,S){var O,da,F,C,G,qa,B,la,J=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&z(b,c);P.info.render.calls=0;P.info.render.vertices=0;P.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Fa); -c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);t(Ca);this.initWebGLObjects(b);H(u);(this.autoClear||S)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(S=0;S=0&&p.enableVertexAttribArray(x.position);x.color>=0&&p.enableVertexAttribArray(x.color);x.normal>=0&&p.enableVertexAttribArray(x.normal);x.tangent>=0&&p.enableVertexAttribArray(x.tangent); +b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(p.enableVertexAttribArray(x.skinVertexA),p.enableVertexAttribArray(x.skinVertexB),p.enableVertexAttribArray(x.skinIndex),p.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(h in b.attributes)x[h]!==void 0&&x[h]>=0&&p.enableVertexAttribArray(x[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h=0&&(p.enableVertexAttribArray(x[y]),b.numSupportedMorphTargets++); +b.uniformsList=[];for(k in b.uniforms)b.uniformsList.push([b.uniforms[k],k])};this.clearTarget=function(b,c,e,f){H(b);this.clear(c,e,f)};this.updateShadowMap=function(b,c){z(b,c)};this.render=function(b,c,o,S){var O,da,F,C,G,qa,B,la,J=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&z(b,c);P.info.render.calls=0;P.info.render.vertices=0;P.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Fa); +c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);u(Ca);this.initWebGLObjects(b);H(o);(this.autoClear||S)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(S=0;S=0;S--)if(O=b.__webglObjects[S],O.render){B=O.object;la=O.buffer;F=O.opaque;k(B);for(O=0;O0||x.faceVertexUvs.length> -0)m.__uvArray=new Float32Array(p*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(p*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(p*4),m.__skinVertexBArray=new Float32Array(p*4),m.__skinIndexArray=new Float32Array(p*4),m.__skinWeightArray=new Float32Array(p*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(S*2);if(m.numMorphTargets){m.__morphTargetsArrays= -[];x=0;for(z=m.numMorphTargets;x=0;S--)if(O=b.__webglObjects[S],O.render){B=O.object;la=O.buffer;F=O.opaque;k(B);for(O=0;O0||x.faceVertexUvs.length> +0)m.__uvArray=new Float32Array(o*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(o*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(o*4),m.__skinVertexBArray=new Float32Array(o*4),m.__skinIndexArray=new Float32Array(o*4),m.__skinWeightArray=new Float32Array(o*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(S*2);if(m.numMorphTargets){m.__morphTargetsArrays= +[];x=0;for(z=m.numMorphTargets;x=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,ea,y));Ga&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglNormalBuffer),o.bufferData(o.ARRAY_BUFFER,ga,y));Da&&va.hasTangents&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglTangentBuffer),o.bufferData(o.ARRAY_BUFFER,ha,y));Ha&&ra>0&&(o.bindBuffer(o.ARRAY_BUFFER, -t.__webglUVBuffer),o.bufferData(o.ARRAY_BUFFER,ia,y));Ha&&T>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglUV2Buffer),o.bufferData(o.ARRAY_BUFFER,Ea,y));Ca&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,Ba,y),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,ta,y));R>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinVertexABuffer),o.bufferData(o.ARRAY_BUFFER,ja,y),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinVertexBBuffer), -o.bufferData(o.ARRAY_BUFFER,sa,y),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),o.bufferData(o.ARRAY_BUFFER,aa,y),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),o.bufferData(o.ARRAY_BUFFER,fa,y));S&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray,delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}k.__dirtyVertices= -!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(m)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=o.DYNAMIC_DRAW;n=x=S=S=void 0;u=h.vertices;p=h.colors;v=u.length;t=p.length;z=h.__vertexArray;y=h.__colorArray;A=h.__dirtyColors;if(h.__dirtyVertices){for(S=0;S0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglColorBuffer),p.bufferData(p.ARRAY_BUFFER,ea,y));Ga&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglNormalBuffer),p.bufferData(p.ARRAY_BUFFER,ga,y));Da&&va.hasTangents&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglTangentBuffer),p.bufferData(p.ARRAY_BUFFER,ha,y));Ha&&ra>0&&(p.bindBuffer(p.ARRAY_BUFFER, +t.__webglUVBuffer),p.bufferData(p.ARRAY_BUFFER,ia,y));Ha&&T>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglUV2Buffer),p.bufferData(p.ARRAY_BUFFER,Ea,y));Ca&&(p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,Ba,y),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,ta,y));R>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexABuffer),p.bufferData(p.ARRAY_BUFFER,ja,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexBBuffer), +p.bufferData(p.ARRAY_BUFFER,sa,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),p.bufferData(p.ARRAY_BUFFER,aa,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),p.bufferData(p.ARRAY_BUFFER,fa,y));S&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray,delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}k.__dirtyVertices= +!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(m)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=p.DYNAMIC_DRAW;n=x=S=S=void 0;u=h.vertices;o=h.colors;v=u.length;t=o.length;z=h.__vertexArray;y=h.__colorArray;A=h.__dirtyColors;if(h.__dirtyVertices){for(S=0;S1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=m;c.v=k;return c}}; THREE.ColorUtils.__hsv={h:0,s:0,v:0}; -THREE.GeometryUtils={merge:function(b,c){var e,f,h=b.vertices.length,k=c instanceof THREE.Mesh?c.geometry:c,m=b.vertices,n=k.vertices,p=b.faces,t=k.faces,w=b.faceVertexUvs[0],k=k.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var u=0,x=n.length;u1&&(f=1-f,h=1-h);k=1-f-h;m.copy(b);m.multiplyScalar(f);n.copy(c);n.multiplyScalar(h);m.addSelf(n);n.copy(e);n.multiplyScalar(k);m.addSelf(n);return m},randomPointInFace:function(b,c,e){var f,h,k;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,h=c.vertices[b.b].position,k=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,h,k);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;h=c.vertices[b.b].position;k=c.vertices[b.c].position;var c=c.vertices[b.d].position, -m;e?b._area1&&b._area2?(e=b._area1,m=b._area2):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c),b._area1=e,b._area2=m):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c));return THREE.GeometryUtils.random()*(e+m) -b?c(e,k-1):t[k] +b?c(e,k-1):u[k]0)n=f-1;else{n=f;break}f=n;if(e[f]==k)return f/(h-1);m=e[f];return e=(f+(k-m)/(e[f+1]-m))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)}; +THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,h=e.length,k;k=c?c:b*e[h-1];time=Date.now();for(var m=0,n=h-1,t;m<=n;)if(f=Math.floor(m+(n-m)/2),t=e[f]-k,t<0)m=f+1;else if(t>0)n=f-1;else{n=f;break}f=n;if(e[f]==k)return f/(h-1);m=e[f];return e=(f+(k-m)/(e[f+1]-m))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)}; THREE.Curve.prototype.getTangent=function(b){var c=b-1.0E-4;b+=1.0E-4;c<0&&(c=0);b>1&&(b=1);var c=this.getPoint(c),b=this.getPoint(b),e=new THREE.Vector2;e.sub(b,c);return e.unit()};THREE.LineCurve=function(b,c){b instanceof THREE.Vector2?(this.v1=b,this.v2=c):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(b,c,e,f){this.constructor(new THREE.Vector2(b,c),new THREE.Vector2(e,f))};THREE.LineCurve.prototype=new THREE.Curve; THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2;c.sub(this.v2,this.v1);c.multiplyScalar(b).addSelf(this.v1);return c};THREE.LineCurve.prototype.getPointAt=function(b){return this.getPoint(b)};THREE.LineCurve.prototype.getTangent=function(){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.normalize();return b}; THREE.QuadraticBezierCurve=function(b,c,e){if(!(c instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),b=new THREE.Vector2(f[0],f[1]),c=new THREE.Vector2(f[2],f[3]),e=new THREE.Vector2(f[4],f[5]);this.v0=b;this.v1=c;this.v2=e};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; @@ -395,47 +395,47 @@ THREE.SplineCurve3=THREE.Curve.create(function(b){this.points=b},function(b){var THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(b){this.curves.push(b)};THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){}; THREE.CurvePath.prototype.getPoint=function(b){for(var c=b*this.getLength(),e=this.getCurveLengths(),b=0;b=c)return c=e[b]-c,b=this.curves[b],c=1-c/b.getLength(),b.getPointAt(c);b++}return null};THREE.CurvePath.prototype.getLength=function(){var b=this.getCurveLengths();return b[b.length-1]}; THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var b=[],c=0,e,f=this.curves.length;for(e=0;ec)c=k.x;else if(k.xe)e=k.y;else if(k.yc)c=k.x;else if(k.xe)e=k.y;else if(k.y0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b2(z,v,u,n),z=THREE.Shape.Utils.b2(z,A,x, -p),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];p=k[5];u=k[0];x=k[1];t=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b3(z,v,u,t,n),z=THREE.Shape.Utils.b3(z,A,x,w,p),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];z=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m); -for(m=1;m<=z;m++)e.push(k.getPointAt(m/z));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];p=k[1];t=k[2];u=k[3];z=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);A=z-u;var y=b*2;for(m=1;m<=y;m++)z=m/y,x||(z=1-z),z=u+z*A,k=w+n+t*Math.cos(z),z=v+p+t*Math.sin(z),e.push(new THREE.Vector2(k,z))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)}; -THREE.Path.prototype.nltransform=function(b,c,e,f,h,k){var m=this.getPoints(),n,p,t,w,u;n=0;for(p=m.length;n0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b2(z,v,o,n),z=THREE.Shape.Utils.b2(z,A,x, +t),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];t=k[5];o=k[0];x=k[1];u=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b3(z,v,o,u,n),z=THREE.Shape.Utils.b3(z,A,x,w,t),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];z=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m); +for(m=1;m<=z;m++)e.push(k.getPointAt(m/z));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];t=k[1];u=k[2];o=k[3];z=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);A=z-o;var y=b*2;for(m=1;m<=y;m++)z=m/y,x||(z=1-z),z=o+z*A,k=w+n+u*Math.cos(z),z=v+t+u*Math.sin(z),e.push(new THREE.Vector2(k,z))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)}; +THREE.Path.prototype.nltransform=function(b,c,e,f,h,k){var m=this.getPoints(),n,t,u,w,o;n=0;for(t=m.length;n=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;var z=[t[m],e[n],e[h]];u=THREE.FontUtils.Triangulate.area(z);var y=[t[m],t[k],e[n]];x=THREE.FontUtils.Triangulate.area(y);v=n;w=m;n+=1;m+=-1;n< -0&&(n+=e.length);n%=e.length;m<0&&(m+=t.length);m%=t.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;z=[t[m],e[n],e[h]];z=THREE.FontUtils.Triangulate.area(z);y=[t[m],t[k],e[n]];y=THREE.FontUtils.Triangulate.area(y);u+x>z+y&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=t.length),m%=t.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:t.length-1);u=e.slice(0,n);x=e.slice(n);v=t.slice(m);w=t.slice(0,m);k=[t[m],t[k],e[n]];A.push([t[m],e[n],e[h]]);A.push(k);e=u.concat(v).concat(w).concat(x)}return{shape:e, -isolatedPts:A,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,p,t={};k=0;for(m=f.length;k=0?n-1:e.length-1;k=m-1>=0?m-1:u.length-1;var z=[u[m],e[n],e[h]];o=THREE.FontUtils.Triangulate.area(z);var y=[u[m],u[k],e[n]];x=THREE.FontUtils.Triangulate.area(y);v=n;w=m;n+=1;m+=-1;n< +0&&(n+=e.length);n%=e.length;m<0&&(m+=u.length);m%=u.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:u.length-1;z=[u[m],e[n],e[h]];z=THREE.FontUtils.Triangulate.area(z);y=[u[m],u[k],e[n]];y=THREE.FontUtils.Triangulate.area(y);o+x>z+y&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=u.length),m%=u.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:u.length-1);o=e.slice(0,n);x=e.slice(n);v=u.slice(m);w=u.slice(0,m);k=[u[m],u[k],e[n]];A.push([u[m],e[n],e[h]]);A.push(k);e=o.concat(v).concat(w).concat(x)}return{shape:e, +isolatedPts:A,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,t,u={};k=0;for(m=f.length;k1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= +THREE.Animation.prototype.update=function(b){if(this.isPlaying){var c=["pos","rot","scl"],e,f,h,k,m,n,t,u,w=this.data.JIT.hierarchy,o,x;this.currentTime+=b*this.timeScale;x=this.currentTime;o=this.currentTime%=this.data.length;u=parseInt(Math.min(o*this.data.fps,this.data.length*this.data.fps),10);for(var v=0,A=this.hierarchy.length;v1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= this.getPrevKeyWith("pos",v,m.index-1).pos,this.points[1]=h,this.points[2]=k,this.points[3]=this.getNextKeyWith("pos",v,n.index+1).pos,f=f*0.33+0.33,h=this.interpolateCatmullRom(this.points,f),e.x=h[0],e.y=h[1],e.z=h[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e=== -"rot")THREE.Quaternion.slerp(h,k,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f}}if(this.JITCompile&&w[0][t]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;vb.length-2?k:k+1;e[3]=k>b.length-3?k:k+2;k=b[e[0]];n=b[e[1]];p=b[e[2]];t=b[e[3]];e=h*h;m=h*e;f[0]=this.interpolate(k[0],n[0],p[0],t[0],h,e,m);f[1]=this.interpolate(k[1],n[1],p[1],t[1],h,e,m);f[2]=this.interpolate(k[2],n[2],p[2],t[2],h,e,m);return f}; +"rot")THREE.Quaternion.slerp(h,k,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f}}if(this.JITCompile&&w[0][u]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;vb.length-2?k:k+1;e[3]=k>b.length-3?k:k+2;k=b[e[0]];n=b[e[1]];t=b[e[2]];u=b[e[3]];e=h*h;m=h*e;f[0]=this.interpolate(k[0],n[0],t[0],u[0],h,e,m);f[1]=this.interpolate(k[1],n[1],t[1],u[1],h,e,m);f[2]=this.interpolate(k[2],n[2],t[2],u[2],h,e,m);return f}; THREE.Animation.prototype.interpolate=function(b,c,e,f,h,k,m){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*m+(-3*(c-e)-2*b-f)*k+b*h+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,e){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e=e0?e:0:e>=0?e:e+f.length;e>=0;e--)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[f.length-1]}; THREE.CubeCamera=function(b,c,e,f){this.heightOffset=e;this.position=new THREE.Vector3(0,e,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position= @@ -457,216 +457,215 @@ Math.sin(this.theta);this.object.lookAt(b)};this.domElement.addEventListener("co THREE.PathControls=function(b,c){function e(b){if((b*=2)<1)return 0.5*b*b;return-0.5*(--b*(b-2)-1)}function f(b,e){return function(){e.apply(b,arguments)}}function h(b,e,c,f){var k={name:c,fps:0.6,length:f,hierarchy:[]},h,m=e.getControlPointsArray(),n=e.getLength(),y=m.length,E=0;h=y-1;e={parent:-1,keys:[]};e.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};e.keys[h]={time:f,pos:m[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h=0?c:c+m;b=this.verticalAngleMap.srcRange; -c=this.verticalAngleMap.dstRange;b=THREE.Math.mapLinear(this.phi,b[0],b[1],c[0],c[1]);var f=c[1]-c[0];this.phi=e((b-c[0])/f)*f+c[0];b=this.horizontalAngleMap.srcRange;c=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],c[0],c[1]);f=c[1]-c[0];this.theta=e((b-c[0])/f)*f+c[0];c=this.target.position;c.x=100*Math.sin(this.phi)*Math.cos(this.theta);c.y=100*Math.cos(this.phi);c.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= -function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}), -e=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(e,b);b=new THREE.Mesh(m,c);b.position.set(0,10,0);this.animation=h(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(b)}else this.animation=h(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var b= -this.debugPath,c=this.spline,e=k(c,10),m=k(c,10),n=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,n);particleObj=new THREE.ParticleSystem(m,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.add(lineObj);particleObj.scale.set(1,1,1);b.add(particleObj);m=new THREE.SphereGeometry(1,16,8);n=new THREE.MeshBasicMaterial({color:65280});for(i=0;i=0?b:b+m;c=this.verticalAngleMap.srcRange; +b=this.verticalAngleMap.dstRange;c=THREE.Math.mapLinear(this.phi,c[0],c[1],b[0],b[1]);var f=b[1]-b[0];this.phi=e((c-b[0])/f)*f+b[0];c=this.horizontalAngleMap.srcRange;b=this.horizontalAngleMap.dstRange;c=THREE.Math.mapLinear(this.theta,c[0],c[1],b[0],b[1]);f=b[1]-b[0];this.theta=e((c-b[0])/f)*f+b[0];b=this.target.position;b.x=100*Math.sin(this.phi)*Math.cos(this.theta);b.y=100*Math.cos(this.phi);b.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= +function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),e=new THREE.MeshLambertMaterial({color:65280}), +c=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,b);b=new THREE.Mesh(m,e);b.position.set(0,10,0);this.animation=h(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(b)}else this.animation=h(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var b= +this.debugPath,e=this.spline,c=k(e,10),m=k(e,10),n=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(c,n);particleObj=new THREE.ParticleSystem(m,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.add(lineObj);particleObj.scale.set(1,1,1);b.add(particleObj);m=new THREE.SphereGeometry(1,16,8);n=new THREE.MeshBasicMaterial({color:65280});for(i=0;i0){var c=this.getContainerDimensions(),e=c.size[0]/2,m=c.size[1]/2;this.moveState.yawLeft=-(b.pageX-c.offset[0]-e)/e;this.moveState.pitchDown=(b.pageY-c.offset[1]-m)/m;this.updateRotationVector()}};this.mouseup=function(b){b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(b.button){case 0:this.moveForward= -!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.tdiff=(b-this.lastUpdate)/1E3;this.lastUpdate=b;var b=this.tdiff*this.movementSpeed,c=this.tdiff*this.rollSpeed;this.object.translateX(this.moveVector.x*b);this.object.translateY(this.moveVector.y*b);this.object.translateZ(this.moveVector.z*b);this.tmpQuaternion.set(this.rotationVector.x*c,this.rotationVector.y*c,this.rotationVector.z*c, -1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion);this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var b=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back}; -this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0, -0]}};this.domElement.addEventListener("mousemove",e(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",e(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",e(this,this.mouseup),!1);this.domElement.addEventListener("keydown",e(this,this.keydown),!1);this.domElement.addEventListener("keyup",e(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(b,c){this.object=b;this.domElement=c!==void 0?c:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Matrix4,m=!1,n=1,p=0,t=0,w=0,u=0,x=0,v=window.innerWidth/2,A=window.innerHeight/2;this.update=function(){var b= -(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.delta=(b-this.lastUpdate)/1E3;this.lastUpdate=b;this.mouseLook&&(b=this.delta*this.lookSpeed,this.rotateHorizontally(b*u),this.rotateVertically(b*x));b=this.delta*this.movementSpeed;this.object.translateZ(-b*(p>0||this.autoForward&&!(p<0)?1:p));this.object.translateX(b*t);this.object.translateY(b*w);m&&(this.roll+=this.rollSpeed*this.delta*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize(); -else if(this.forward.y1?e.normalize():e.z=Math.sqrt(1-f*f);k.copy(this.object.position).subSelf(this.target);f=this.object.up.clone().setLength(e.y);f.addSelf(this.object.up.clone().crossSelf(k).setLength(e.x));f.addSelf(k.setLength(e.z));return f};this.rotateCamera=function(){var b=Math.acos(m.dot(n)/m.length()/n.length());if(b){var c=(new THREE.Vector3).cross(m,n).normalize(),e=new THREE.Quaternion;b*=this.rotateSpeed;e.setFromAxisAngle(c, --b);e.multiplyVector3(k);e.multiplyVector3(this.object.up);e.multiplyVector3(n);this.staticMoving?m=n:(e.setFromAxisAngle(c,b*(this.dynamicDampingFactor-1)),e.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(t.y-p.y)*this.zoomSpeed;b!==1&&b>0&&(k.multiplyScalar(b),this.staticMoving?p=t:p.y+=(t.y-p.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=u.clone().subSelf(w);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var c=k.clone().crossSelf(this.object.up).setLength(b.x); -c.addSelf(this.object.up.clone().setLength(b.y));this.object.position.addSelf(c);this.target.addSelf(c);this.staticMoving?w=u:w.addSelf(b.sub(u,w).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()0){var e=this.getContainerDimensions(),c=e.size[0]/2,m=e.size[1]/2;this.moveState.yawLeft=-(b.pageX-e.offset[0]-c)/c;this.moveState.pitchDown=(b.pageY-e.offset[1]-m)/m;this.updateRotationVector()}};this.mouseup=function(b){b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(b.button){case 0:this.moveForward= +!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(b){b*=0.0010;var e=b*this.movementSpeed;b*=this.rollSpeed;this.object.translateX(this.moveVector.x*e);this.object.translateY(this.moveVector.y*e);this.object.translateZ(this.moveVector.z*e);this.tmpQuaternion.set(this.rotationVector.x*b,this.rotationVector.y*b,this.rotationVector.z*b,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion); +this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var b=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z= +-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",e(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",e(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",e(this, +this.mouseup),!1);this.domElement.addEventListener("keydown",e(this,this.keydown),!1);this.domElement.addEventListener("keyup",e(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; +THREE.RollControls=function(b,c){this.object=b;this.domElement=c!==void 0?c:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Matrix4,m=!1,n=1,t=0,u=0,w=0,o=0,x=0,v=window.innerWidth/2,A=window.innerHeight/2;this.update=function(b){b*=0.0010;if(this.mouseLook){var c= +b*this.lookSpeed;this.rotateHorizontally(c*o);this.rotateVertically(c*x)}c=b*this.movementSpeed;this.object.translateZ(-c*(t>0||this.autoForward&&!(t<0)?1:t));this.object.translateX(c*u);this.object.translateY(c*w);m&&(this.roll+=this.rollSpeed*b*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y1?c.normalize():c.z=Math.sqrt(1-f*f);k.copy(this.object.position).subSelf(this.target);f=this.object.up.clone().setLength(c.y);f.addSelf(this.object.up.clone().crossSelf(k).setLength(c.x));f.addSelf(k.setLength(c.z));return f};this.rotateCamera=function(){var b=Math.acos(m.dot(n)/m.length()/n.length());if(b){var e=(new THREE.Vector3).cross(m,n).normalize(),c=new THREE.Quaternion;b*=this.rotateSpeed;c.setFromAxisAngle(e, +-b);c.multiplyVector3(k);c.multiplyVector3(this.object.up);c.multiplyVector3(n);this.staticMoving?m=n:(c.setFromAxisAngle(e,b*(this.dynamicDampingFactor-1)),c.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(u.y-t.y)*this.zoomSpeed;b!==1&&b>0&&(k.multiplyScalar(b),this.staticMoving?t=u:t.y+=(u.y-t.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=o.clone().subSelf(w);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var e=k.clone().crossSelf(this.object.up).setLength(b.x); +e.addSelf(this.object.up.clone().setLength(b.y));this.object.position.addSelf(e);this.target.addSelf(e);this.staticMoving?w=o:w.addSelf(b.sub(o,w).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;nb&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(h).addSelf(n).subSelf(b).clone()}function h(b){for(H=b.length;--H>=0;){ka=H;na=H-1;na<0&&(na=b.length- -1);for(var c=0,e=v+w*2,c=0;c=0;Q--){Z=Q/w;$=p*(1-Z);Z=t*Math.sin(Z*Math.PI/2);H=0;for(T=F.length;Hb&&(b+=Math.PI*2),anglec=(e+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(h).addSelf(n).subSelf(b).clone()}function h(b){for(H=b.length;--H>=0;){ka=H;na=H-1;na<0&&(na=b.length- +1);for(var e=0,c=v+w*2,e=0;e=0;Q--){Z=Q/w;$=t*(1-Z);Z=u*Math.sin(Z*Math.PI/2);H=0;for(T=F.length;H0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(u,n,x)))-1);t.push(w)}c.push(t)}for(var v,A,z,h=c.length,e=0;e0)for(f=0;f1&&(v= -this.vertices[m].position.clone(),A=this.vertices[p].position.clone(),z=this.vertices[t].position.clone(),v.normalize(),A.normalize(),z.normalize(),this.faces.push(new THREE.Face3(m,p,t,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(A.x,A.y,A.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([w,u,y]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry; +THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f,h=Math.PI,k=Math.max(3,c||8),m=Math.max(2,e||6),c=[],e=0;e0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,n,x)))-1);u.push(w)}c.push(u)}for(var v,A,z,h=c.length,e=0;e0)for(f=0;f1&&(v= +this.vertices[m].position.clone(),A=this.vertices[t].position.clone(),z=this.vertices[u].position.clone(),v.normalize(),A.normalize(),z.normalize(),this.faces.push(new THREE.Face3(m,t,u,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(A.x,A.y,A.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([w,o,y]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry; THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry; THREE.TextGeometry=function(b,c){var e=(new THREE.TextPath(b,c)).toShapes();c.amount=c.height!==void 0?c.height:50;if(c.bevelThickness===void 0)c.bevelThickness=10;if(c.bevelSize===void 0)c.bevelSize=8;if(c.bevelEnabled===void 0)c.bevelEnabled=!1;if(c.bend){var f=e[e.length-1].getBoundingBox().maxX;c.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(f/2,120),new THREE.Vector2(f,0))}THREE.ExtrudeGeometry.call(this,e,c)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry; THREE.TextGeometry.prototype.constructor=THREE.TextGeometry; THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(b,c){return(new TextPath(b,c)).toShapes()},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var c= -this.getFace(),e=this.size/c.resolution,f=0,h=String(b).split(""),k=h.length,m=[],b=0;b0)for(t=0;t2;){if(u--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}p=t;h<=p&&(p=0);t=p+1;h<=t&&(t=0);w=t+1;h<=w&&(w=0);var x;a:{x=b;var v=p,A=t,z=w,y=h,E=m,F=void 0,C=void 0,G=void 0, -J=void 0,M=void 0,K=void 0,B=void 0,L=void 0,Y=void 0,C=x[E[v]].x,G=x[E[v]].y,J=x[E[A]].x,M=x[E[A]].y,K=x[E[z]].x,B=x[E[z]].y;if(1.0E-10>(J-C)*(B-G)-(M-G)*(K-C))x=!1;else{for(F=0;F=0&&Q>=0&&$>=0){x=!1;break a}}x= -!0}}if(x){k.push([b[m[p]],b[m[t]],b[m[w]]]);n.push([m[p],m[t],m[w]]);p=t;for(w=t+1;w0)for(u=0;u2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}t=u;h<=t&&(t=0);u=t+1;h<=u&&(u=0);w=u+1;h<=w&&(w=0);var x;a:{x=b;var v=t,A=u,z=w,y=h,E=m,F=void 0,C=void 0,G=void 0, +J=void 0,M=void 0,K=void 0,B=void 0,L=void 0,Y=void 0,C=x[E[v]].x,G=x[E[v]].y,J=x[E[A]].x,M=x[E[A]].y,K=x[E[z]].x,B=x[E[z]].y;if(1.0E-10>(J-C)*(B-G)-(M-G)*(K-C))x=!1;else{for(F=0;F=0&&Q>=0&&$>=0){x=!1;break a}}x= +!0}}if(x){k.push([b[m[t]],b[m[u]],b[m[w]]]);n.push([m[t],m[u],m[w]]);t=u;for(w=u+1;w0;)this.smooth(b)}; -THREE.SubdivisionModifier.prototype.smooth=function(b){function c(b,c,e,f,n,p){var t=new THREE.Face4(b,c,e,f,null,n.color,n.material);if(m.useOldVertexColors){t.vertexColors=[];for(var v,o,w,x=0;x<4;x++){w=p[x];v=new THREE.Color;v.setRGB(0,0,0);for(var y=0;y>7)-127;f|=(h&127)<<16|k<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,c){var e=w(b,c),f=w(b,c+1),k=w(b,c+2);return(w(b,c+3)<<24)+(k<<16)+(f<<8)+e}function p(b,c){var e=w(b,c);return(w(b,c+1)<<8)+e}function t(b,c){var e=w(b,c);return e>127?e-256:e}function w(b,c){return b.charCodeAt(c)&255}function u(c){var e, -f,k;e=h(b,c);f=h(b,c+M);k=h(b,c+K);c=p(b,c+B);E.faces.push(new THREE.Face3(e,f,k,null,null,E.materials[c]))}function x(c){var e,f,k,m,o,t;e=h(b,c);f=h(b,c+M);k=h(b,c+K);m=p(b,c+B);o=h(b,c+L);t=h(b,c+Y);c=h(b,c+H);m=E.materials[m];var u=G[t*3],v=G[t*3+1];t=G[t*3+2];var w=G[c*3],x=G[c*3+1],c=G[c*3+2];E.faces.push(new THREE.Face3(e,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(u,v,t),new THREE.Vector3(w,x,c)],null,m))}function v(c){var e,f,k,m;e=h(b,c);f=h(b,c+T);k=h(b,c+Q);m=h(b, -c+Z);c=p(b,c+$);E.faces.push(new THREE.Face4(e,f,k,m,null,null,E.materials[c]))}function A(c){var e,f,k,m,t,u,v,w;e=h(b,c);f=h(b,c+T);k=h(b,c+Q);m=h(b,c+Z);t=p(b,c+$);u=h(b,c+P);v=h(b,c+o);w=h(b,c+V);c=h(b,c+fa);t=E.materials[t];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var S=G[w*3],z=G[w*3+1];w=G[w*3+2];var A=G[c*3],B=G[c*3+1],c=G[c*3+2];E.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(S,z,w),new THREE.Vector3(A,B,c)],null,t))} -function z(c){var e,f,k,m;e=h(b,c);f=h(b,c+ea);k=h(b,c+ha);c=J[e*2];m=J[e*2+1];e=J[f*2];var o=E.faceVertexUvs[0];f=J[f*2+1];var p=J[k*2];k=J[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,k));o.push(t)}function y(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+ga);k=h(b,c+ka);m=h(b,c+na);c=J[e*2];o=J[e*2+1];e=J[f*2];p=J[f*2+1];f=J[k*2];var t=E.faceVertexUvs[0];k=J[k*2+1];var u=J[m*2];m=J[m*2+1];var v=[];v.push(new THREE.UV(c,o));v.push(new THREE.UV(e,p));v.push(new THREE.UV(f, -k));v.push(new THREE.UV(u,m));t.push(v)}var E=this,F=0,C,G=[],J=[],M,K,B,L,Y,H,T,Q,Z,$,P,o,V,fa,ea,ha,ga,ka,na,aa,W,U,ia,ja,ta;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(E,f,c);C={signature:b.substr(F,8),header_bytes:w(b,F+8),vertex_coordinate_bytes:w(b,F+9),normal_coordinate_bytes:w(b,F+10),uv_coordinate_bytes:w(b,F+11),vertex_index_bytes:w(b,F+12),normal_index_bytes:w(b,F+13),uv_index_bytes:w(b,F+14),material_index_bytes:w(b,F+15),nvertices:h(b,F+16),nnormals:h(b,F+16+4),nuvs:h(b, +THREE.BinaryLoader.prototype.createBinModel=function(b,c,e,f){var h=function(e){function c(b,e){var f=w(b,e),k=w(b,e+1),h=w(b,e+2),m=w(b,e+3),n=(m<<1&255|h>>7)-127;f|=(h&127)<<16|k<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,e){var c=w(b,e),f=w(b,e+1),k=w(b,e+2);return(w(b,e+3)<<24)+(k<<16)+(f<<8)+c}function t(b,e){var c=w(b,e);return(w(b,e+1)<<8)+c}function u(b,e){var c=w(b,e);return c>127?c-256:c}function w(b,e){return b.charCodeAt(e)&255}function o(e){var c, +f,k;c=h(b,e);f=h(b,e+M);k=h(b,e+K);e=t(b,e+B);E.faces.push(new THREE.Face3(c,f,k,null,null,E.materials[e]))}function x(e){var c,f,k,m,o,p;c=h(b,e);f=h(b,e+M);k=h(b,e+K);m=t(b,e+B);o=h(b,e+L);p=h(b,e+Y);e=h(b,e+H);m=E.materials[m];var u=G[p*3],v=G[p*3+1];p=G[p*3+2];var w=G[e*3],x=G[e*3+1],e=G[e*3+2];E.faces.push(new THREE.Face3(c,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(u,v,p),new THREE.Vector3(w,x,e)],null,m))}function v(e){var c,f,k,m;c=h(b,e);f=h(b,e+T);k=h(b,e+Q);m=h(b, +e+Z);e=t(b,e+$);E.faces.push(new THREE.Face4(c,f,k,m,null,null,E.materials[e]))}function A(e){var c,f,k,m,o,u,v,w;c=h(b,e);f=h(b,e+T);k=h(b,e+Q);m=h(b,e+Z);o=t(b,e+$);u=h(b,e+P);v=h(b,e+p);w=h(b,e+V);e=h(b,e+fa);o=E.materials[o];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var S=G[w*3],z=G[w*3+1];w=G[w*3+2];var A=G[e*3],B=G[e*3+1],e=G[e*3+2];E.faces.push(new THREE.Face4(c,f,k,m,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(S,z,w),new THREE.Vector3(A,B,e)],null,o))} +function z(e){var c,f,k,m;c=h(b,e);f=h(b,e+ea);k=h(b,e+ha);e=J[c*2];m=J[c*2+1];c=J[f*2];var o=E.faceVertexUvs[0];f=J[f*2+1];var p=J[k*2];k=J[k*2+1];var t=[];t.push(new THREE.UV(e,m));t.push(new THREE.UV(c,f));t.push(new THREE.UV(p,k));o.push(t)}function y(e){var c,f,k,m,o,p;c=h(b,e);f=h(b,e+ga);k=h(b,e+ka);m=h(b,e+na);e=J[c*2];o=J[c*2+1];c=J[f*2];p=J[f*2+1];f=J[k*2];var t=E.faceVertexUvs[0];k=J[k*2+1];var u=J[m*2];m=J[m*2+1];var v=[];v.push(new THREE.UV(e,o));v.push(new THREE.UV(c,p));v.push(new THREE.UV(f, +k));v.push(new THREE.UV(u,m));t.push(v)}var E=this,F=0,C,G=[],J=[],M,K,B,L,Y,H,T,Q,Z,$,P,p,V,fa,ea,ha,ga,ka,na,aa,W,U,ia,ja,ta;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(E,f,e);C={signature:b.substr(F,8),header_bytes:w(b,F+8),vertex_coordinate_bytes:w(b,F+9),normal_coordinate_bytes:w(b,F+10),uv_coordinate_bytes:w(b,F+11),vertex_index_bytes:w(b,F+12),normal_index_bytes:w(b,F+13),uv_index_bytes:w(b,F+14),material_index_bytes:w(b,F+15),nvertices:h(b,F+16),nnormals:h(b,F+16+4),nuvs:h(b, F+16+8),ntri_flat:h(b,F+16+12),ntri_smooth:h(b,F+16+16),ntri_flat_uv:h(b,F+16+20),ntri_smooth_uv:h(b,F+16+24),nquad_flat:h(b,F+16+28),nquad_smooth:h(b,F+16+32),nquad_flat_uv:h(b,F+16+36),nquad_smooth_uv:h(b,F+16+40)};F+=C.header_bytes;M=C.vertex_index_bytes;K=C.vertex_index_bytes*2;B=C.vertex_index_bytes*3;L=C.vertex_index_bytes*3+C.material_index_bytes;Y=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;H=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;T=C.vertex_index_bytes; -Q=C.vertex_index_bytes*2;Z=C.vertex_index_bytes*3;$=C.vertex_index_bytes*4;P=C.vertex_index_bytes*4+C.material_index_bytes;o=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;V=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;fa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;ea=C.uv_index_bytes;ha=C.uv_index_bytes*2;ga=C.uv_index_bytes;ka=C.uv_index_bytes*2;na=C.uv_index_bytes*3;c=C.vertex_index_bytes*3+C.material_index_bytes;ta=C.vertex_index_bytes* -4+C.material_index_bytes;aa=C.ntri_flat*c;W=C.ntri_smooth*(c+C.normal_index_bytes*3);U=C.ntri_flat_uv*(c+C.uv_index_bytes*3);ia=C.ntri_smooth_uv*(c+C.normal_index_bytes*3+C.uv_index_bytes*3);ja=C.nquad_flat*ta;c=C.nquad_smooth*(ta+C.normal_index_bytes*4);ta=C.nquad_flat_uv*(ta+C.uv_index_bytes*4);F+=function(c){for(var f,k,h,n=C.vertex_coordinate_bytes*3,o=c+C.nvertices*n;c=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];for(y=0;y1){o=new THREE.MeshFaceMaterial;for(j=0;j1){o=new THREE.MeshFaceMaterial;for(j=0;j1?e[1].substr(0,c):"0";e[1].length=0,m=k.indexOf("(")>=0,n;if(h)f=k.split("."),k=f.shift(),f.shift();else if(m){n=k.split("(");k=n.shift(); -for(f=0;fc){t=p.output[o];break}m=t!==void 0?t instanceof THREE.Matrix4? -m.multiply(m,t):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};u.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b1?c[1].substr(0,e):"0";c[1].length=0,m=k.indexOf("(")>=0,n;if(h)f=k.split("."),k=f.shift(),f.shift();else if(m){n=k.split("(");k=n.shift(); +for(f=0;fe){u=t.output[p];break}m=u!==void 0?u instanceof THREE.Matrix4? +m.multiply(m,u):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);e=m;c.push({time:b,pos:[e.n14,e.n24,e.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=c}this.updateMatrix();return this};o.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b0&&(this[e.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};Y.prototype.create=function(){var b={},c=this.transparency!==void 0&&this.transparency<1,e;for(e in this)switch(e){case "ambient":case "emission":case "diffuse":case "specular":var f=this[e];if(f instanceof L)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=la[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ga+f.init_from), -b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else e=="diffuse"?b.color=f.color.getHex():c||(b[e]=f.color.getHex());break;case "shininess":case "reflectivity":b[e]=this[e];break;case "transparency":if(c)b.transparent=!0,b.opacity=this[e],c=!0}b.shading=za;return this.material=new THREE.MeshLambertMaterial(b)};H.prototype.parse=function(b){for(var c=0;c=0,f=b.indexOf("(")>=0,k,h;if(e)c=b.split("."),b=c.shift(),h=c.shift();else if(f){k=b.split("(");b=k.shift();for(c=0;c0&&(this[c.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};Y.prototype.create=function(){var b={},e=this.transparency!==void 0&&this.transparency<1,c;for(c in this)switch(c){case "ambient":case "emission":case "diffuse":case "specular":var f=this[c];if(f instanceof L)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=la[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ga+f.init_from), +b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else c=="diffuse"?b.color=f.color.getHex():e||(b[c]=f.color.getHex());break;case "shininess":case "reflectivity":b[c]=this[c];break;case "transparency":if(e)b.transparent=!0,b.opacity=this[c],e=!0}b.shading=za;return this.material=new THREE.MeshLambertMaterial(b)};H.prototype.parse=function(b){for(var e=0;e=0,f=b.indexOf("(")>=0,k,h;if(c)e=b.split("."),b=e.shift(),h=e.shift();else if(f){k=b.split("(");b=k.shift();for(e=0;e1&&(Y=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(M,Y);object.name=v;object.position.set(C[0],C[1],C[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=F.visible;V.scene.add(object);V.objects[v]=object;F.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),V.scene.collisions.colliders.push(b)); if(F.castsShadow)b=new THREE.ShadowVolume(M),V.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}}else C=F.position,r=F.rotation,q=F.quaternion,s=F.scale,q=0,object=new THREE.Object3D,object.name=v,object.position.set(C[0],C[1],C[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0], -s[1],s[2]),object.visible=F.visible!==void 0?F.visible:!1,V.scene.add(object),V.objects[v]=object,V.empties[v]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}function p(b){return function(c){V.geometries[b]=c;n();Z-=1;e.onLoadComplete();w()}}function t(b){return function(c){V.geometries[b]=c}}function w(){e.callbackProgress({totalModels:P,totalTextures:o,loadedModels:P-Z,loadedTextures:o-$},V);e.onLoadProgress();Z==0&&$==0&&c(V)}var u,x, -v,A,z,y,E,F,C,G,J,M,K,B,L,Y,H,T,Q,Z,$,P,o,V;T=b.data;L=new THREE.BinaryLoader;Q=new THREE.JSONLoader;$=Z=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in T.objects)if(F=T.objects[v],F.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(T.transform){b=T.transform.position;G=T.transform.rotation;var fa=T.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);G&&V.scene.rotation.set(G[0], +s[1],s[2]),object.visible=F.visible!==void 0?F.visible:!1,V.scene.add(object),V.objects[v]=object,V.empties[v]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}function t(b){return function(c){V.geometries[b]=c;n();Z-=1;e.onLoadComplete();w()}}function u(b){return function(e){V.geometries[b]=e}}function w(){e.callbackProgress({totalModels:P,totalTextures:p,loadedModels:P-Z,loadedTextures:p-$},V);e.onLoadProgress();Z==0&&$==0&&c(V)}var o,x, +v,A,z,y,E,F,C,G,J,M,K,B,L,Y,H,T,Q,Z,$,P,p,V;T=b.data;L=new THREE.BinaryLoader;Q=new THREE.JSONLoader;$=Z=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in T.objects)if(F=T.objects[v],F.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(T.transform){b=T.transform.position;G=T.transform.rotation;var fa=T.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);G&&V.scene.rotation.set(G[0], G[1],G[2]);fa&&V.scene.scale.set(fa[0],fa[1],fa[2]);(b||G||fa)&&V.scene.updateMatrix()}b=function(){$-=1;w();e.onLoadComplete()};for(z in T.cameras)G=T.cameras[z],G.type=="perspective"?K=new THREE.PerspectiveCamera(G.fov,G.aspect,G.near,G.far):G.type=="ortho"&&(K=new THREE.OrthographicCamera(G.left,G.right,G.top,G.bottom,G.near,G.far)),C=G.position,G=G.target,K.position.set(C[0],C[1],C[2]),K.target=new THREE.Vector3(G[0],G[1],G[2]),V.cameras[z]=K;for(A in T.lights)z=T.lights[A],K=z.color!==void 0? z.color:16777215,G=z.intensity!==void 0?z.intensity:1,z.type=="directional"?(C=z.direction,H=new THREE.DirectionalLight(K,G),H.position.set(C[0],C[1],C[2]),H.position.normalize()):z.type=="point"?(C=z.position,d=z.distance,H=new THREE.PointLight(K,G,d),H.position.set(C[0],C[1],C[2])):z.type=="ambient"&&(H=new THREE.AmbientLight(K)),V.scene.add(H),V.lights[A]=H;for(y in T.fogs)A=T.fogs[y],A.type=="linear"?B=new THREE.Fog(0,A.near,A.far):A.type=="exp2"&&(B=new THREE.FogExp2(0,A.density)),G=A.color, -B.color.setRGB(G[0],G[1],G[2]),V.fogs[y]=B;if(V.cameras&&T.defaults.camera)V.currentCamera=V.cameras[T.defaults.camera];if(V.fogs&&T.defaults.fog)V.scene.fog=V.fogs[T.defaults.fog];G=T.defaults.bgcolor;V.bgColor=new THREE.Color;V.bgColor.setRGB(G[0],G[1],G[2]);V.bgColorAlpha=T.defaults.bgalpha;for(u in T.geometries)if(y=T.geometries[u],y.type=="bin_mesh"||y.type=="ascii_mesh")Z+=1,e.onLoadStart();P=Z;for(u in T.geometries)y=T.geometries[u],y.type=="cube"?(M=new THREE.CubeGeometry(y.width,y.height, -y.depth,y.segmentsWidth,y.segmentsHeight,y.segmentsDepth,null,y.flipped,y.sides),V.geometries[u]=M):y.type=="plane"?(M=new THREE.PlaneGeometry(y.width,y.height,y.segmentsWidth,y.segmentsHeight),V.geometries[u]=M):y.type=="sphere"?(M=new THREE.SphereGeometry(y.radius,y.segmentsWidth,y.segmentsHeight),V.geometries[u]=M):y.type=="cylinder"?(M=new THREE.CylinderGeometry(y.topRad,y.botRad,y.height,y.radSegs,y.heightSegs),V.geometries[u]=M):y.type=="torus"?(M=new THREE.TorusGeometry(y.radius,y.tube,y.segmentsR, -y.segmentsT),V.geometries[u]=M):y.type=="icosahedron"?(M=new THREE.IcosahedronGeometry(y.subdivisions),V.geometries[u]=M):y.type=="bin_mesh"?L.load({model:f(y.url,T.urlBaseType),callback:p(u)}):y.type=="ascii_mesh"?Q.load({model:f(y.url,T.urlBaseType),callback:p(u)}):y.type=="embedded_mesh"&&(y=T.embeds[y.id])&&Q.createModel(y,t(u),"");for(E in T.textures)if(u=T.textures[E],u.url instanceof Array){$+=u.url.length;for(L=0;L=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,h=0;h<8;h++){for(var k=0,m=0;m>1^-(n&1);e[8*m+h]=k}f+=c}c=b.length-f;k=new Uint16Array(c);for(h=m=0;h=this.maxCount-3&&n(this)};this.begin=function(){this.count=0; -this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(p=this.size-1);var x=Math.floor(t-n);x<1&&(x=1);t=Math.floor(t+n);t>this.size-1&&(t=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size- -1);for(var A,z,y,E,F,C;u0&&(this.field[y+A]+=E)}}};this.addPlaneX=function(b,c){var h,k,m,n,p,t=this.size,w=this.yd,u=this.zd,x=this.field,v=t*Math.sqrt(b/c);v>t&&(v=t);for(h=0;h0)for(k=0;kw&&(A=w);for(k=0;k0){p=k*u;for(h=0;hsize&&(dist=size);for(m=0;m0){p=zd*m;for(k=0;k=this.maxCount-3&&n(this)};this.begin=function(){this.count=0; +this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(t=this.size-1);var x=Math.floor(u-n);x<1&&(x=1);u=Math.floor(u+n);u>this.size-1&&(u=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size- +1);for(var A,z,y,E,F,C;o0&&(this.field[y+A]+=E)}}};this.addPlaneX=function(b,c){var h,k,m,n,t,u=this.size,w=this.yd,o=this.zd,x=this.field,v=u*Math.sqrt(b/c);v>u&&(v=u);for(h=0;h0)for(k=0;kw&&(A=w);for(k=0;k0){t=k*o;for(h=0;hsize&&(dist=size);for(m=0;m0){t=zd*m;for(k=0;kk?this.hits.push(h):this.hits.unshift(h),k=f;return this.hits}; THREE.CollisionSystem.prototype.rayCastNearest=function(b){var c=this.rayCastAll(b);if(c.length==0)return null;for(var e=0;c[e]instanceof THREE.MeshCollider;){var f=this.rayMesh(b,c[e]);if(f.distc.length)return null;return c[e]}; THREE.CollisionSystem.prototype.rayCast=function(b,c){if(c instanceof THREE.PlaneCollider)return this.rayPlane(b,c);else if(c instanceof THREE.SphereCollider)return this.raySphere(b,c);else if(c instanceof THREE.BoxCollider)return this.rayBox(b,c);else if(c instanceof THREE.MeshCollider&&c.box)return this.rayBox(b,c.box)}; -THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,k=0;k=n*h))return Number.MAX_VALUE;m/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(m);n.addSelf(b.origin);Math.abs(k.x)> +THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,k=0;k=n*h))return Number.MAX_VALUE;m/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(m);n.addSelf(b.origin);Math.abs(k.x)> Math.abs(k.y)?Math.abs(k.x)>Math.abs(k.z)?(b=n.y-c.y,k=e.y-c.y,h=f.y-c.y,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(k.y)>Math.abs(k.z)?(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y);c=k*f-e*h;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-n*h)*c;if(!(f>=0))return Number.MAX_VALUE;c*=k*n-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return m}; THREE.CollisionSystem.prototype.makeRayLocal=function(b,c){var e=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(c.matrixWorld,e);var f=THREE.CollisionSystem.__r;f.origin.copy(b.origin);f.direction.copy(b.direction);e.multiplyVector3(f.origin);e.rotateAxis(f.direction);f.direction.normalize();return f}; -THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,h=0,k=0,m=0,n=0,p=0,t=!0;e.origin.xc.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,t=!1,m=1);e.origin.yc.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y, -t=!1,n=1);e.origin.zc.max.z&&(k=c.max.z-e.origin.z,k/=e.direction.z,t=!1,p=1);if(t)return-1;t=0;h>f&&(t=1,f=h);k>f&&(t=2,f=k);switch(t){case 0:n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(m,0,0);break;case 1:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z* -f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;c.normal.set(0,0,p)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE}; +THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,h=0,k=0,m=0,n=0,t=0,u=!0;e.origin.xc.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,u=!1,m=1);e.origin.yc.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y, +u=!1,n=1);e.origin.zc.max.z&&(k=c.max.z-e.origin.z,k/=e.direction.z,u=!1,t=1);if(u)return-1;u=0;h>f&&(u=1,f=h);k>f&&(u=2,f=k);switch(u){case 0:n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(m,0,0);break;case 1:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z* +f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;c.normal.set(0,0,t)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE}; THREE.CollisionSystem.prototype.raySphere=function(b,c){var e=c.center.clone().subSelf(b.origin);if(e.lengthSq=0)return Math.abs(f)-Math.sqrt(e);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4; THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(b){b.geometry.computeBoundingBox();var c=b.geometry.boundingBox,e=new THREE.Vector3(c.x[0],c.y[0],c.z[0]),c=new THREE.Vector3(c.x[1],c.y[1],c.z[1]),e=new THREE.BoxCollider(e,c);e.mesh=b;return e};THREE.CollisionUtils.MeshAABB=function(b){var c=THREE.CollisionUtils.MeshOBB(b);c.min.addSelf(b.position);c.max.addSelf(b.position);c.dynamic=!1;return c}; THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))}; -if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,m=new THREE.Matrix4,n=new THREE.Matrix4,p,t,w;h.matrixAutoUpdate=k.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},u=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.PerspectiveCamera(53,1,1,1E4);v.position.z= -2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:u},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); -var A=new THREE.Scene;A.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);u.width=b;u.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(p!==e.aspect||t!==e.near||w!==e.fov){p=e.aspect;t=e.near;w=e.fov;var E=e.projectionMatrix.clone(),F=125/30*0.5,C=F*t/125,G=t*Math.tan(w*Math.PI/360),J;m.n14=F;n.n14=-F;F=-G*p+C;J=G*p+C;E.n11=2*t/(J-F);E.n13=(J+F)/(J-F);h.projectionMatrix=E.clone();F=-G*p-C;J=G*p-C;E.n11=2*t/(J-F);E.n13= -(J+F)/(J-F);k.projectionMatrix=E.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=t;h.far=e.far;f.call(c,b,h,u,!0);k.matrix=e.matrixWorld.clone().multiplySelf(m);k.update(null,!0);k.position.copy(e.position);k.near=t;k.far=e.far;f.call(c,b,k,x,!0);f.call(c,A,v)}}; +if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,m=new THREE.Matrix4,n=new THREE.Matrix4,t,u,w;h.matrixAutoUpdate=k.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},o=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.PerspectiveCamera(53,1,1,1E4);v.position.z= +2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:o},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); +var A=new THREE.Scene;A.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);o.width=b;o.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(t!==e.aspect||u!==e.near||w!==e.fov){t=e.aspect;u=e.near;w=e.fov;var E=e.projectionMatrix.clone(),F=125/30*0.5,C=F*u/125,G=u*Math.tan(w*Math.PI/360),J;m.n14=F;n.n14=-F;F=-G*t+C;J=G*t+C;E.n11=2*u/(J-F);E.n13=(J+F)/(J-F);h.projectionMatrix=E.clone();F=-G*t-C;J=G*t-C;E.n11=2*u/(J-F);E.n13= +(J+F)/(J-F);k.projectionMatrix=E.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=u;h.far=e.far;f.call(c,b,h,o,!0);k.matrix=e.matrixWorld.clone().multiplySelf(m);k.update(null,!0);k.position.copy(e.position);k.near=u;k.far=e.far;f.call(c,b,k,x,!0);f.call(c,A,v)}}; if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,h,k,m=new THREE.PerspectiveCamera;m.target=new THREE.Vector3(0,0,0);var n=new THREE.PerspectiveCamera;n.target=new THREE.Vector3(0,0,0);c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;this.setSize=function(b,f){e.call(c,b,f);h=b/2;k=f};this.render=function(b,e){this.clear();m.fov=e.fov;m.aspect=0.5*e.aspect;m.near=e.near;m.far= e.far;m.updateProjectionMatrix();m.position.copy(e.position);m.target.copy(e.target);m.translateX(c.separation);m.lookAt(m.target);n.projectionMatrix=m.projectionMatrix;n.position.copy(e.position);n.target.copy(e.target);n.translateX(-c.separation);n.lookAt(n.target);this.setViewport(0,0,h,k);f.call(c,b,m);this.setViewport(h,0,h,k);f.call(c,b,n,!1)}}; diff --git a/build/custom/ThreeExtras.js b/build/custom/ThreeExtras.js index f09924ef..adfacf8a 100644 --- a/build/custom/ThreeExtras.js +++ b/build/custom/ThreeExtras.js @@ -104,29 +104,28 @@ Math.sin(this.theta);this.object.lookAt(a)};this.domElement.addEventListener("co THREE.PathControls=function(a,b){function c(a){if((a*=2)<1)return 0.5*a*a;return-0.5*(--a*(a-2)-1)}function e(a,c){return function(){c.apply(a,arguments)}}function f(a,c,b,e){var g={name:b,fps:0.6,length:e,hierarchy:[]},h,f=c.getControlPointsArray(),k=c.getLength(),p=f.length,z=0;h=p-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:f[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[h]={time:e,pos:f[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h=0?b:b+g;a=this.verticalAngleMap.srcRange; -b=this.verticalAngleMap.dstRange;a=THREE.Math.mapLinear(this.phi,a[0],a[1],b[0],b[1]);var e=b[1]-b[0];this.phi=c((a-b[0])/e)*e+b[0];a=this.horizontalAngleMap.srcRange;b=this.horizontalAngleMap.dstRange;a=THREE.Math.mapLinear(this.theta,a[0],a[1],b[0],b[1]);e=b[1]-b[0];this.theta=c((a-b[0])/e)*e+b[0];b=this.target.position;b.x=100*Math.sin(this.phi)*Math.cos(this.theta);b.y=100*Math.cos(this.phi);b.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= +this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var g=Math.PI*2,k=Math.PI/180;this.update=function(a){a*=0.0010;var b;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed*a);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed*a);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*k;this.theta=this.lon*k;a=this.phi%g;this.phi=a>=0?a:a+g;b=this.verticalAngleMap.srcRange; +a=this.verticalAngleMap.dstRange;b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var e=a[1]-a[0];this.phi=c((b-a[0])/e)*e+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);e=a[1]-a[0];this.theta=c((b-a[0])/e)*e+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}), b=new THREE.CubeGeometry(10,10,20),g=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(b,a);a=new THREE.Mesh(g,c);a.position.set(0,10,0);this.animation=f(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=f(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a= this.debugPath,c=this.spline,b=h(c,10),g=h(c,10),k=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(b,k);particleObj=new THREE.ParticleSystem(g,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.add(lineObj);particleObj.scale.set(1,1,1);a.add(particleObj);g=new THREE.SphereGeometry(1,16,8);k=new THREE.MeshBasicMaterial({color:65280});for(i=0;i0){var c=this.getContainerDimensions(),b=c.size[0]/2,g=c.size[1]/2;this.moveState.yawLeft=-(a.pageX-c.offset[0]-b)/b;this.moveState.pitchDown=(a.pageY-c.offset[1]-g)/g;this.updateRotationVector()}};this.mouseup=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(a.button){case 0:this.moveForward= -!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(){var a=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.tdiff=(a-this.lastUpdate)/1E3;this.lastUpdate=a;var a=this.tdiff*this.movementSpeed,c=this.tdiff*this.rollSpeed;this.object.translateX(this.moveVector.x*a);this.object.translateY(this.moveVector.y*a);this.object.translateZ(this.moveVector.z*a);this.tmpQuaternion.set(this.rotationVector.x*c,this.rotationVector.y*c,this.rotationVector.z*c, -1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion);this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back}; -this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0, -0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(a,b){this.object=a;this.domElement=b!==void 0?b:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var c=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Matrix4,g=!1,k=1,l=0,m=0,n=0,o=0,t=0,u=window.innerWidth/2,v=window.innerHeight/2;this.update=function(){var a= -(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=a;this.delta=(a-this.lastUpdate)/1E3;this.lastUpdate=a;this.mouseLook&&(a=this.delta*this.lookSpeed,this.rotateHorizontally(a*o),this.rotateVertically(a*t));a=this.delta*this.movementSpeed;this.object.translateZ(-a*(l>0||this.autoForward&&!(l<0)?1:l));this.object.translateX(a*m);this.object.translateY(a*n);g&&(this.roll+=this.rollSpeed*this.delta*k);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize(); -else if(this.forward.y0||this.autoForward&&!(l<0)?1:l));this.object.translateX(b*m);this.object.translateY(b*n);g&&(this.roll+=this.rollSpeed*a*k);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y1?b.normalize():b.z=Math.sqrt(1-e*e);h.copy(this.object.position).subSelf(this.target);e=this.object.up.clone().setLength(b.y);e.addSelf(this.object.up.clone().crossSelf(h).setLength(b.x));e.addSelf(h.setLength(b.z));return e};this.rotateCamera=function(){var a=Math.acos(g.dot(k)/g.length()/k.length());if(a){var c=(new THREE.Vector3).cross(g,k).normalize(),b=new THREE.Quaternion;a*=this.rotateSpeed;b.setFromAxisAngle(c, diff --git a/examples/misc_camera_path.html b/examples/misc_camera_path.html index 4f4b1211..a3a19195 100644 --- a/examples/misc_camera_path.html +++ b/examples/misc_camera_path.html @@ -54,6 +54,8 @@ var cross; + var clock = new THREE.Clock(); + init(); animate(); @@ -71,7 +73,7 @@ controls.useConstantSpeed = true; //controls.createDebugPath = true; //controls.createDebugDummy = true; - controls.lookSpeed = 0.0006; + controls.lookSpeed = 0.06; controls.lookVertical = true; controls.lookHorizontal = true; controls.verticalAngleMap = { srcRange: [ 0, 2 * Math.PI ], dstRange: [ 1.1, 3.8 ] }; @@ -156,9 +158,11 @@ function render() { - THREE.AnimationHandler.update( 1/60 ); + var delta = clock.delta(); - controls.update(); + THREE.AnimationHandler.update( 0.001 * delta ); + + controls.update( delta ); renderer.render( scene, camera ); } diff --git a/examples/misc_camera_roll.html b/examples/misc_camera_roll.html index 9a1387ce..fd158aa5 100644 --- a/examples/misc_camera_roll.html +++ b/examples/misc_camera_roll.html @@ -53,6 +53,8 @@ var cross; + var clock = new THREE.Clock(); + init(); animate(); @@ -140,7 +142,7 @@ function render() { - controls.update(); + controls.update( clock.delta() ); renderer.render( scene, camera ); } diff --git a/examples/webgl_flycamera_earth.html b/examples/webgl_flycamera_earth.html index 0dd63729..ad3c4c9a 100644 --- a/examples/webgl_flycamera_earth.html +++ b/examples/webgl_flycamera_earth.html @@ -74,9 +74,10 @@ var camera, controls, scene, sceneCube, renderer; var geometry, meshPlanet, meshClouds, meshMoon; var dirLight, pointLight, ambientLight; - var lastUpdate = new Date().getTime(); - var delta, d, dPlanet, dMoon, dMoonVec = new THREE.Vector3(); + var d, dPlanet, dMoon, dMoonVec = new THREE.Vector3(); + + var clock = new THREE.Clock(); init(); animate(); @@ -187,7 +188,7 @@ } - for ( i = 0; i < 1500; ++i ) { + for ( i = 0; i < 1500; i ++ ) { vector1 = new THREE.Vector3( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 ); vector1.multiplyScalar( r ); @@ -266,15 +267,8 @@ composer.reset(); - } - - function cap_bottom( val, bottom ) { - - return val < bottom ? bottom : val; - }; - function animate() { requestAnimationFrame( animate ); @@ -284,21 +278,14 @@ }; - - function cap( val, bottom ) { - - return val > bottom ? val : bottom; - - }; - function render() { // rotate the planet and clouds - delta = this.getFrametime(); + var delta = clock.delta(); - meshPlanet.rotation.y += rotationSpeed * delta; - meshClouds.rotation.y += 1.25 * rotationSpeed * delta; + meshPlanet.rotation.y += 0.001 * rotationSpeed * delta; + meshClouds.rotation.y += 0.001 * 1.25 * rotationSpeed * delta; // slow down as we approach the surface @@ -318,19 +305,10 @@ } controls.movementSpeed = 0.33 * d; - controls.update(); + controls.update( delta ); renderer.clear(); - composer.render( delta ); - - }; - - function getFrametime() { - - var now = new Date().getTime(); - var tdiff = ( now - lastUpdate ) / 1000; - lastUpdate = now; - return tdiff; + composer.render( 0.001 * delta ); }; diff --git a/examples/webgl_shading_physical.html b/examples/webgl_shading_physical.html index e5e2977d..65032908 100644 --- a/examples/webgl_shading_physical.html +++ b/examples/webgl_shading_physical.html @@ -596,7 +596,7 @@ var delta = clock.delta(); TWEEN.update(); - controls.update(); + controls.update( delta ); if ( morph ) morph.updateAnimation( delta ); diff --git a/examples/webgl_shadowmap.html b/examples/webgl_shadowmap.html index 043611dd..43f88624 100644 --- a/examples/webgl_shadowmap.html +++ b/examples/webgl_shadowmap.html @@ -382,7 +382,7 @@ } - controls.update(); + controls.update( delta ); renderer.clear(); renderer.render( scene, camera ); diff --git a/src/extras/controls/FlyControls.js b/src/extras/controls/FlyControls.js index 0ed97f7e..771b26b4 100644 --- a/src/extras/controls/FlyControls.js +++ b/src/extras/controls/FlyControls.js @@ -31,9 +31,6 @@ THREE.FlyControls = function ( object, domElement ) { this.moveVector = new THREE.Vector3( 0, 0, 0 ); this.rotationVector = new THREE.Vector3( 0, 0, 0 ); - this.lastUpdate = -1; - this.tdiff = 0; - this.handleEvent = function ( event ) { if ( typeof this[ event.type ] == 'function' ) { @@ -183,17 +180,12 @@ THREE.FlyControls = function ( object, domElement ) { }; - this.update = function( parentMatrixWorld, forceUpdate, camera ) { + this.update = function( delta ) { - var now = new Date().getTime(); + delta *= 0.001; - if ( this.lastUpdate == -1 ) this.lastUpdate = now; - - this.tdiff = ( now - this.lastUpdate ) / 1000; - this.lastUpdate = now; - - var moveMult = this.tdiff * this.movementSpeed; - var rotMult = this.tdiff * this.rollSpeed; + var moveMult = delta * this.movementSpeed; + var rotMult = delta * this.rollSpeed; this.object.translateX( this.moveVector.x * moveMult ); this.object.translateY( this.moveVector.y * moveMult ); diff --git a/src/extras/controls/PathControls.js b/src/extras/controls/PathControls.js index 1d3ec87a..6c28569e 100644 --- a/src/extras/controls/PathControls.js +++ b/src/extras/controls/PathControls.js @@ -59,12 +59,14 @@ THREE.PathControls = function ( object, domElement ) { // methods - this.update = function () { + this.update = function ( delta ) { + + delta *= 0.001; var srcRange, dstRange; - if( this.lookHorizontal ) this.lon += this.mouseX * this.lookSpeed; - if( this.lookVertical ) this.lat -= this.mouseY * this.lookSpeed; + if( this.lookHorizontal ) this.lon += this.mouseX * this.lookSpeed * delta; + if( this.lookVertical ) this.lat -= this.mouseY * this.lookSpeed * delta; this.lon = Math.max( 0, Math.min( 360, this.lon ) ); this.lat = Math.max( - 85, Math.min( 85, this.lat ) ); diff --git a/src/extras/controls/RollControls.js b/src/extras/controls/RollControls.js index e8dadb7b..da516d65 100644 --- a/src/extras/controls/RollControls.js +++ b/src/extras/controls/RollControls.js @@ -28,9 +28,6 @@ THREE.RollControls = function ( object, domElement ) { this.forward = new THREE.Vector3( 0, 0, 1 ); this.roll = 0; - this.lastUpdate = -1; - this.delta = 0; - var xTemp = new THREE.Vector3(); var yTemp = new THREE.Vector3(); var zTemp = new THREE.Vector3(); @@ -45,25 +42,20 @@ THREE.RollControls = function ( object, domElement ) { // custom update - this.update = function() { + this.update = function ( delta ) { - var now = new Date().getTime(); - - if ( this.lastUpdate == -1 ) this.lastUpdate = now; - - this.delta = ( now - this.lastUpdate ) / 1000; - this.lastUpdate = now; + delta *= 0.001; if ( this.mouseLook ) { - var actualLookSpeed = this.delta * this.lookSpeed; + var actualLookSpeed = delta * this.lookSpeed; this.rotateHorizontally( actualLookSpeed * mouseX ); this.rotateVertically( actualLookSpeed * mouseY ); } - var actualSpeed = this.delta * this.movementSpeed; + var actualSpeed = delta * this.movementSpeed; var forwardOrAuto = ( forwardSpeed > 0 || ( this.autoForward && ! ( forwardSpeed < 0 ) ) ) ? 1 : forwardSpeed; this.object.translateZ( -actualSpeed * forwardOrAuto ); @@ -72,7 +64,7 @@ THREE.RollControls = function ( object, domElement ) { if( doRoll ) { - this.roll += this.rollSpeed * this.delta * rollDirection; + this.roll += this.rollSpeed * delta * rollDirection; } From 41eb500677d39b35294c9d47db765746370c25b1 Mon Sep 17 00:00:00 2001 From: alteredq Date: Fri, 14 Oct 2011 18:53:07 +0200 Subject: [PATCH 15/33] Refactored custom attributes handling to use lists to remove massive bottleneck. Apparently iterating over object properties is dangerous even if that code path is not executed. Stress-testing particles buffers setting showed 60% performance increase (in Chrome) even when there were no custom attributes (and thus custom attributes handling code behind "if ( customAttributes )" was never executed). I suspect this may be caused by some V8 optimization heuristics. --- build/Three.js | 788 ++++++++++++++++----------------- build/custom/ThreeWebGL.js | 435 +++++++++--------- src/renderers/WebGLRenderer.js | 90 ++-- 3 files changed, 645 insertions(+), 668 deletions(-) diff --git a/build/Three.js b/build/Three.js index 2646c9e6..a00a8e89 100644 --- a/build/Three.js +++ b/build/Three.js @@ -17,38 +17,38 @@ c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,f=[];c=0;for(e=b.length;c0&&b>0&&k+b<1}for(var f,h=[],k=0,m=b.children.length;kb.scale.x)return[];f={distance:k,point:b.position,face:null,object:b};h.push(f)}else if(b instanceof THREE.Mesh){k=c(this.origin, -this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,t,u,w,o,x,v,A,z=b.geometry,y=z.vertices,k=0,m=z.faces.length;k0:x<0)))if(x=o.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(A.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,t,u)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,t,w)||e(v,t,u,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; -THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,o){n=!1;c=k;e=m;f=w;h=o;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=ck?f:k,h=h>m?h:m);b()};this.add3Points= -function(k,m,w,o,x,v){n?(n=!1,c=kw?k>x?k:x:w>x?w:x,h=m>o?m>v?m:v:o>v?o:v):(c=kw?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>o?m>v?m>h?m:h:v>h?v:h:o>v?o>h?o:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=ck.getRight()?f:k.getRight(),h=h> +this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,p,t,w,u,x,v,A,z=b.geometry,y=z.vertices,k=0,m=z.faces.length;k0:x<0)))if(x=u.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(A.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,p,t)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,p,w)||e(v,p,t,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; +THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,u){n=!1;c=k;e=m;f=w;h=u;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=ck?f:k,h=h>m?h:m);b()};this.add3Points= +function(k,m,w,u,x,v){n?(n=!1,c=kw?k>x?k:x:w>x?w:x,h=m>u?m>v?m:v:u>v?u:v):(c=kw?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>u?m>v?m>h?m:h:v>h?v:h:u>v?u>h?u:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=ck.getRight()?f:k.getRight(),h=h> k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}}; THREE.Math={clamp:function(b,c,e){return be?e:b},clampBottom:function(b,c){return b=0&&k>=0&&m>=0&&n>=0?!0:h<0&&k<0||m<0&&n<0?!1:(h<0?e=Math.max(e,h/(h-k)):k<0&&(f=Math.min(f,h/(h-k))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),fG&&m.positionScreen.z0&&K.z<1))ia=C[F]=C[F]||new THREE.RenderableParticle,F++,E=ia,E.x=K.x/K.w,E.y=K.y/K.w,E.z=K.z,E.rotation=U.rotation.z,E.scale.x=U.scale.x*Math.abs(E.x-(K.x+h.projectionMatrix.n11)/(K.w+h.projectionMatrix.n14)),E.scale.y=U.scale.y*Math.abs(E.y-(K.y+h.projectionMatrix.n22)/(K.w+h.projectionMatrix.n24)),E.materials=U.materials,J.push(E);k&&J.sort(c);return J}}; +THREE.Projector=function(){function b(){var b=p[n]=p[n]||new THREE.RenderableVertex;n++;return b}function c(b,c){return c.z-b.z}function e(b,c){var e=0,f=1,h=b.z+b.w,k=c.z+c.w,m=-b.z+b.w,n=-c.z+c.w;return h>=0&&k>=0&&m>=0&&n>=0?!0:h<0&&k<0||m<0&&n<0?!1:(h<0?e=Math.max(e,h/(h-k)):k<0&&(f=Math.min(f,h/(h-k))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),fG&&m.positionScreen.z0&&K.z<1))ia=C[E]=C[E]||new THREE.RenderableParticle,E++,D=ia,D.x=K.x/K.w,D.y=K.y/K.w,D.z=K.z,D.rotation=X.rotation.z,D.scale.x=X.scale.x*Math.abs(D.x-(K.x+h.projectionMatrix.n11)/(K.w+h.projectionMatrix.n14)),D.scale.y=X.scale.y*Math.abs(D.y-(K.y+h.projectionMatrix.n22)/(K.w+h.projectionMatrix.n24)),D.materials=X.materials,I.push(D);k&&I.sort(c);return I}}; THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,e=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),k=Math.cos(e),e=Math.sin(e),m=b*c,n=f*h;this.w=m*k-n*e;this.x=m*e+n*k;this.y=f*c*k+b*h*e;this.z=b*h*k-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e); this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z); this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c= -this.x,e=this.y,f=this.z,h=this.w,k=b.x,m=b.y,n=b.z,b=b.w;this.x=c*b+h*k+e*n-f*m;this.y=e*b+h*m+f*k-c*n;this.z=f*b+h*n+c*m-e*k;this.w=h*b-c*k-e*m-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,h=b.z,k=this.x,m=this.y,n=this.z,t=this.w,u=t*e+m*h-n*f,w=t*f+n*e-k*h,o=t*h+k*f-m*e,e=-k* -e-m*f-n*h;c.x=u*t+e*-k+w*-n-o*-m;c.y=w*t+e*-m+o*-k-u*-n;c.z=o*t+e*-n+u*-m-w*-k;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var k=Math.acos(h),m=Math.sqrt(1-h*h);if(Math.abs(m)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-f)*k)/m;f=Math.sin(f*k)/m;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e}; +this.x,e=this.y,f=this.z,h=this.w,k=b.x,m=b.y,n=b.z,b=b.w;this.x=c*b+h*k+e*n-f*m;this.y=e*b+h*m+f*k-c*n;this.z=f*b+h*n+c*m-e*k;this.w=h*b-c*k-e*m-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,h=b.z,k=this.x,m=this.y,n=this.z,p=this.w,t=p*e+m*h-n*f,w=p*f+n*e-k*h,u=p*h+k*f-m*e,e=-k* +e-m*f-n*h;c.x=t*p+e*-k+w*-n-u*-m;c.y=w*p+e*-m+u*-k-t*-n;c.z=u*p+e*-n+t*-m-w*-k;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var k=Math.acos(h),m=Math.sqrt(1-h*h);if(Math.abs(m)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-f)*k)/m;f=Math.sin(f*k)/m;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e}; THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,h,k){this.a=b;this.b=c;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=k instanceof Array?k:[k];this.centroid=new THREE.Vector3}; THREE.Face4=function(b,c,e,f,h,k,m){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=k instanceof THREE.Color?k:new THREE.Color;this.vertexColors=k instanceof Array?k:[];this.vertexTangents=[];this.materials=m instanceof Array?m:[m];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var e=0,f=this.vertices.length;e0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, +e.vertexNormals[1].copy(f[e.b]),e.vertexNormals[2].copy(f[e.c]),e.vertexNormals[3].copy(f[e.d]))},computeTangents:function(){function b(b,c,e,f,h,k,B){n=b.vertices[c].position;p=b.vertices[e].position;t=b.vertices[f].position;w=m[h];u=m[k];x=m[B];v=p.x-n.x;A=t.x-n.x;z=p.y-n.y;y=t.y-n.y;D=p.z-n.z;E=t.z-n.z;C=u.u-w.u;G=x.u-w.u;I=u.v-w.v;P=x.v-w.v;K=1/(C*P-G*I);N.set((P*v-I*A)*K,(P*z-I*y)*K,(P*D-I*E)*K);V.set((C*A-G*v)*K,(C*y-G*z)*K,(C*E-G*D)*K);O[c].addSelf(N);O[e].addSelf(N);O[f].addSelf(N);Y[c].addSelf(V); +Y[e].addSelf(V);Y[f].addSelf(V)}var c,e,f,h,k,m,n,p,t,w,u,x,v,A,z,y,D,E,C,G,I,P,K,B,O=[],Y=[],N=new THREE.Vector3,V=new THREE.Vector3,J=new THREE.Vector3,$=new THREE.Vector3,Z=new THREE.Vector3;c=0;for(e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;cthis.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;u=this.points[e[0]];w=this.points[e[1]]; -o=this.points[e[2]];x=this.points[e[3]];n=m*m;t=m*n;f.x=c(u.x,w.x,o.x,x.x,m,n,t);f.y=c(u.y,w.y,o.y,x.y,m,n,t);f.z=c(u.z,w.z,o.z,x.z,m,n,t);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;bthis.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;t=this.points[e[0]];w=this.points[e[1]]; +u=this.points[e[2]];x=this.points[e[3]];n=m*m;p=m*n;f.x=c(t.x,w.x,u.x,x.x,m,n,p);f.y=c(t.y,w.y,u.y,x.y,m,n,p);f.z=c(t.z,w.z,u.z,x.z,m,n,p);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;b0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(A.r*255)+","+Math.floor(A.g*255)+","+ -Math.floor(A.b*255)+","+z+")"),v.fillRect(Math.floor(S.getX()),Math.floor(S.getY()),Math.floor(S.getWidth()),Math.floor(S.getHeight()))),S.empty())};this.render=function(b,t){function u(b){var c,e,f,h=b.lights;N.setRGB(0,0,0);ma.setRGB(0,0,0);ua.setRGB(0,0,0);b=0;for(c=h.length;b>1,xa=u.height>>1,m=k.scale.x*o,t=k.scale.y*x,p=m*w,n=t*xa,O.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(O)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-t),v.translate(-w,-xa),v.drawImage(u,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(p=k.scale.x*o,n=k.scale.y*x,O.set(b.x-p,b.y-n,b.x+p,b.y+n),za.intersects(O)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(p,n),m.program(v), -v.restore()))}function eb(b,h,k,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(h.positionScreen.x,h.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(J!=b)v.lineCap=J=b;b=m.linejoin;if(M!=b)v.lineJoin=M=b;f(m.color.getContextStyle());v.stroke();O.inflate(m.linewidth*2)}}function y(b,f,h,m,n,u,o,v,xa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); -Q=b.positionScreen.x;Z=b.positionScreen.y;$=f.positionScreen.x;P=f.positionScreen.y;p=h.positionScreen.x;V=h.positionScreen.y;F(Q,Z,$,P,p,V);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,P,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[u].u,ra[u].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=t.matrixWorldInverse,oa.copy(o.vertexNormalsWorld[0]),sa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,ya= --(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[1]),Ca=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Ga=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,oa.copy(o.vertexNormalsWorld[2]),Fa=(oa.x*b.n11+oa.y*b.n12+oa.z*b.n13)*0.5+0.5,Da=-(oa.x*b.n21+oa.y*b.n22+oa.z*b.n23)*0.5+0.5,ab(Q,Z,$,P,p,V,sa,ya,Ca,Ga,Fa,Da,v.envMap)}else v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&& -(v.map.mapping instanceof THREE.UVMapping&&(ra=o.uvs[0],ab(Q,Z,$,P,p,V,ra[m].u,ra[m].v,ra[n].u,ra[n].v,ra[u].u,ra[u].v,v.map)),e(THREE.SubtractiveBlending)),da?!v.wireframe&&v.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==3?(W.r=U.r=ia.r=N.r,W.g=U.g=ia.g=N.g,W.b=U.b=ia.b=N.b,w(xa,o.v1.positionWorld,o.vertexNormalsWorld[0],W),w(xa,o.v2.positionWorld,o.vertexNormalsWorld[1],U),w(xa,o.v3.positionWorld,o.vertexNormalsWorld[2],ia),W.r=Math.max(0,Math.min(v.color.r*W.r,1)),W.g=Math.max(0,Math.min(v.color.g* -W.g,1)),W.b=Math.max(0,Math.min(v.color.b*W.b,1)),U.r=Math.max(0,Math.min(v.color.r*U.r,1)),U.g=Math.max(0,Math.min(v.color.g*U.g,1)),U.b=Math.max(0,Math.min(v.color.b*U.b,1)),ia.r=Math.max(0,Math.min(v.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(v.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(v.color.b*ia.b,1)),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,p,V,0,0,1,0,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,o.centroidWorld,o.normalWorld,qa),aa.r=Math.max(0,Math.min(v.color.r* -qa.r,1)),aa.g=Math.max(0,Math.min(v.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(v.color.b*qa.b,1)),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)):v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshDepthMaterial)la=t.near,ca=t.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(h.positionScreen.z,la,ca),ja.r=(U.r+ia.r)*0.5,ja.g=(U.g+ -ia.g)*0.5,ja.b=(U.b+ia.b)*0.5,pa=Ya(W,U,ia,ja),Ua(Q,Z,$,P,p,V,0,0,1,0,0,1,pa);else if(v instanceof THREE.MeshNormalMaterial)aa.r=Va(o.normalWorld.x),aa.g=Va(o.normalWorld.y),aa.b=Va(o.normalWorld.z),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)}function A(b,f,h,m,n,u,v,o,xa){k.info.render.vertices+=4;k.info.render.faces++;c(o.opacity);e(o.blending);if(o.map||o.envMap)y(b,f,m,0,1,3,v,o,xa),y(n,h,u,1,2,3,v,o,xa);else if(Q=b.positionScreen.x,Z=b.positionScreen.y, -$=f.positionScreen.x,P=f.positionScreen.y,p=h.positionScreen.x,V=h.positionScreen.y,fa=m.positionScreen.x,ea=m.positionScreen.y,ha=n.positionScreen.x,ga=n.positionScreen.y,ka=u.positionScreen.x,na=u.positionScreen.y,o instanceof THREE.MeshBasicMaterial)E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(o.color);else if(o instanceof THREE.MeshLambertMaterial)da?!o.wireframe&&o.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4?(W.r= -U.r=ia.r=ja.r=N.r,W.g=U.g=ia.g=ja.g=N.g,W.b=U.b=ia.b=ja.b=N.b,w(xa,v.v1.positionWorld,v.vertexNormalsWorld[0],W),w(xa,v.v2.positionWorld,v.vertexNormalsWorld[1],U),w(xa,v.v4.positionWorld,v.vertexNormalsWorld[3],ia),w(xa,v.v3.positionWorld,v.vertexNormalsWorld[2],ja),W.r=Math.max(0,Math.min(o.color.r*W.r,1)),W.g=Math.max(0,Math.min(o.color.g*W.g,1)),W.b=Math.max(0,Math.min(o.color.b*W.b,1)),U.r=Math.max(0,Math.min(o.color.r*U.r,1)),U.g=Math.max(0,Math.min(o.color.g*U.g,1)),U.b=Math.max(0,Math.min(o.color.b* -U.b,1)),ia.r=Math.max(0,Math.min(o.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(o.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(o.color.b*ia.b,1)),ja.r=Math.max(0,Math.min(o.color.r*ja.r,1)),ja.g=Math.max(0,Math.min(o.color.g*ja.g,1)),ja.b=Math.max(0,Math.min(o.color.b*ja.b,1)),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)):(qa.r=N.r,qa.g=N.g,qa.b=N.b,w(xa,v.centroidWorld,v.normalWorld,qa),aa.r=Math.max(0,Math.min(o.color.r*qa.r, -1)),aa.g=Math.max(0,Math.min(o.color.g*qa.g,1)),aa.b=Math.max(0,Math.min(o.color.b*qa.b,1)),E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(aa,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(aa)):(E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):C(o.color));else if(o instanceof THREE.MeshNormalMaterial)aa.r=Va(v.normalWorld.x),aa.g=Va(v.normalWorld.y),aa.b=Va(v.normalWorld.z),E(Q,Z,$,P,p,V,fa,ea),o.wireframe?Na(aa,o.wireframeLinewidth,o.wireframeLinecap, -o.wireframeLinejoin):C(aa);else if(o instanceof THREE.MeshDepthMaterial)la=t.near,ca=t.far,W.r=W.g=W.b=1-Qa(b.positionScreen.z,la,ca),U.r=U.g=U.b=1-Qa(f.positionScreen.z,la,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,la,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,la,ca),pa=Ya(W,U,ia,ja),F(Q,Z,$,P,fa,ea),Ua(Q,Z,$,P,fa,ea,0,0,1,0,0,1,pa),F(ha,ga,p,V,ka,na),Ua(ha,ga,p,V,ka,na,1,0,1,1,0,1,pa)}function F(b,c,e,f,h,k){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(b,c);v.closePath()}function E(b, -c,e,f,h,k,m,p){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(m,p);v.lineTo(b,c);v.closePath()}function Na(b,c,e,h){if(G!=c)v.lineWidth=G=c;if(J!=e)v.lineCap=J=e;if(M!=h)v.lineJoin=M=h;f(b.getContextStyle());v.stroke();O.inflate(c*2)}function C(b){h(b.getContextStyle());v.fill()}function ab(b,c,e,f,k,m,p,n,t,o,u,xa,w){if(w.image.width!=0){if(w.needsUpdate==!0||ta[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,S=w.wrapT==THREE.RepeatWrapping;ta[w.id]=v.createPattern(w.image,x&& -S?"repeat":x&&!S?"repeat-x":!x&&S?"repeat-y":"no-repeat");w.needsUpdate=!1}h(ta[w.id]);var x=w.offset.x/w.repeat.x,S=w.offset.y/w.repeat.y,z=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,p=(p+x)*z,n=(n+S)*w,t=(t+x)*z,o=(o+S)*w,u=(u+x)*z,xa=(xa+S)*w;e-=b;f-=c;k-=b;m-=c;t-=p;o-=n;u-=p;xa-=n;x=1/(t*xa-u*o);w=(xa*e-o*k)*x;o=(xa*f-o*m)*x;e=(t*k-u*e)*x;f=(t*m-u*f)*x;b=b-w*p-e*n;c=c-o*p-f*n;v.save();v.transform(w,o,e,f,b,c);v.fill();v.restore()}}function Ua(b,c,e,f,h,k,m,p,n,t,o,u,w){var xa, -x;xa=w.width-1;x=w.height-1;m*=xa;p*=x;n*=xa;t*=x;o*=xa;u*=x;e-=b;f-=c;h-=b;k-=c;n-=m;t-=p;o-=m;u-=p;x=1/(n*u-o*t);xa=(u*e-t*h)*x;t=(u*f-t*k)*x;e=(n*h-o*e)*x;f=(n*k-o*f)*x;b=b-xa*m-e*p;c=c-t*m-f*p;v.save();v.transform(xa,t,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var h=~~(b.r*255),k=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),p=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),t=~~(e.g*255),e=~~(e.b*255),o=~~(f.r*255),u=~~(f.g*255),f=~~(f.b*255);va[0]=h<0?0:h>255?255:h;va[1]=k<0?0: -k>255?255:k;va[2]=b<0?0:b>255?255:b;va[4]=m<0?0:m>255?255:m;va[5]=p<0?0:p>255?255:p;va[6]=c<0?0:c>255?255:c;va[8]=n<0?0:n>255?255:n;va[9]=t<0?0:t>255?255:t;va[10]=e<0?0:e>255?255:e;va[12]=o<0?0:o>255?255:o;va[13]=u<0?0:u>255?255:u;va[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,h=e*e+f*f;h!=0&&(h=1/Math.sqrt(h),e*=h,f*=h,c.x+= -e,c.y+=f,b.x-=e,b.y-=f)}var Za,bb,wa,Ja,Pa,Wa,$a,Aa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,o,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,t,this.sortElements);(da=b.lights.length>0)&&u(b);Za=0;for(bb=m.length;Za0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m)):k instanceof THREE.PointLight&&(Y.sub(k.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*k.intensity,m>0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m))}function c(c,e,m,n,o,u){k.info.render.vertices+=3;k.info.render.faces++;Q=f(Z++); -Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");o instanceof THREE.MeshBasicMaterial?G.copy(o.color):o instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(u,n,J),G.r=Math.max(0,Math.min(o.color.r*J.r,1)),G.g=Math.max(0,Math.min(o.color.g*J.g,1)),G.b=Math.max(0,Math.min(o.color.b*J.b,1))):G.copy(o.color):o instanceof THREE.MeshDepthMaterial?(L=1-o.__2near/(o.__farPlusNear- -n.z*o.__farMinusNear),G.setRGB(L,L,L)):o instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));o.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+o.wireframeLinewidth+"; stroke-opacity: "+o.opacity+"; stroke-linecap: "+o.wireframeLinecap+"; stroke-linejoin: "+o.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+o.opacity);t.appendChild(Q)}function e(c,e,m,n,o,u,v){k.info.render.vertices+= -4;k.info.render.faces++;Q=f(Z++);Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");u instanceof THREE.MeshBasicMaterial?G.copy(u.color):u instanceof THREE.MeshLambertMaterial?C?(J.r=M.r,J.g=M.g,J.b=M.b,b(v,o,J),G.r=Math.max(0,Math.min(u.color.r*J.r,1)),G.g=Math.max(0,Math.min(u.color.g*J.g,1)),G.b=Math.max(0,Math.min(u.color.b*J.b,1))): -G.copy(u.color):u instanceof THREE.MeshDepthMaterial?(L=1-u.__2near/(u.__farPlusNear-o.z*u.__farMinusNear),G.setRGB(L,L,L)):u instanceof THREE.MeshNormalMaterial&&G.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));u.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+u.wireframeLinewidth+"; stroke-opacity: "+u.opacity+"; stroke-linecap: "+u.wireframeLinecap+"; stroke-linejoin: "+u.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+ -"; fill-opacity: "+u.opacity);t.appendChild(Q)}function f(b){H[b]==null&&(H[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),P==0&&H[b].setAttribute("shape-rendering","crispEdges"));return H[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,t=document.createElementNS("http://www.w3.org/2000/svg","svg"),u,w,o,x,v,A,z,y,E=new THREE.Rectangle,F=new THREE.Rectangle,C=!1,G=new THREE.Color(16777215),J=new THREE.Color(16777215),M=new THREE.Color(0), -K=new THREE.Color(0),B=new THREE.Color(0),L,Y=new THREE.Vector3,H=[],T=[],Q,Z,$,P=1;this.domElement=t;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":P=1;break;case "low":P=0}};this.setSize=function(b,c){u=b;w=c;o=u/2;x=w/2;t.setAttribute("viewBox",-o+" "+-x+" "+u+" "+w);t.setAttribute("width",u);t.setAttribute("height",w);E.set(-o,-x,o,x)};this.clear=function(){for(;t.childNodes.length>0;)t.removeChild(t.childNodes[0])}; -this.render=function(b,f){var h,u,w,G,H,L,J,W;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);$=Z=0;if(C=b.lights.length>0){J=b.lights;M.setRGB(0,0,0);K.setRGB(0,0,0);B.setRGB(0,0,0);h=0;for(u=J.length;h0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(A.r*255)+","+Math.floor(A.g*255)+","+ +Math.floor(A.b*255)+","+z+")"),v.fillRect(Math.floor(U.getX()),Math.floor(U.getY()),Math.floor(U.getWidth()),Math.floor(U.getHeight()))),U.empty())};this.render=function(b,p){function t(b){var c,e,f,h=b.lights;M.setRGB(0,0,0);na.setRGB(0,0,0);ya.setRGB(0,0,0);b=0;for(c=h.length;b>1,wa=t.height>>1,m=k.scale.x*u,p=k.scale.y*x,o=m*w,n=p*wa,L.set(b.x-o,b.y-n,b.x+o,b.y+n),za.intersects(L)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-p),v.translate(-w,-wa),v.drawImage(t,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(o=k.scale.x*u,n=k.scale.y*x,L.set(b.x-o,b.y-n,b.x+o,b.y+n),za.intersects(L)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(o,n),m.program(v), +v.restore()))}function y(b,h,k,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(h.positionScreen.x,h.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(I!=b)v.lineCap=I=b;b=m.linejoin;if(P!=b)v.lineJoin=P=b;f(m.color.getContextStyle());v.stroke();L.inflate(m.linewidth*2)}}function A(b,f,h,m,n,t,u,v,wa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); +J=b.positionScreen.x;$=b.positionScreen.y;Z=f.positionScreen.x;Q=f.positionScreen.y;o=h.positionScreen.x;R=h.positionScreen.y;D(J,$,Z,Q,o,R);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(qa=u.uvs[0],bb(J,$,Z,Q,o,R,qa[m].u,qa[m].v,qa[n].u,qa[n].v,qa[t].u,qa[t].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=p.matrixWorldInverse,ka.copy(u.vertexNormalsWorld[0]),ra=(ka.x*b.n11+ka.y*b.n12+ka.z*b.n13)*0.5+0.5,xa= +-(ka.x*b.n21+ka.y*b.n22+ka.z*b.n23)*0.5+0.5,ka.copy(u.vertexNormalsWorld[1]),Ca=(ka.x*b.n11+ka.y*b.n12+ka.z*b.n13)*0.5+0.5,Ga=-(ka.x*b.n21+ka.y*b.n22+ka.z*b.n23)*0.5+0.5,ka.copy(u.vertexNormalsWorld[2]),Fa=(ka.x*b.n11+ka.y*b.n12+ka.z*b.n13)*0.5+0.5,Da=-(ka.x*b.n21+ka.y*b.n22+ka.z*b.n23)*0.5+0.5,bb(J,$,Z,Q,o,R,ra,xa,Ca,Ga,Fa,Da,v.envMap)}else v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&& +(v.map.mapping instanceof THREE.UVMapping&&(qa=u.uvs[0],bb(J,$,Z,Q,o,R,qa[m].u,qa[m].v,qa[n].u,qa[n].v,qa[t].u,qa[t].v,v.map)),e(THREE.SubtractiveBlending)),da?!v.wireframe&&v.shading==THREE.SmoothShading&&u.vertexNormalsWorld.length==3?(T.r=X.r=ia.r=M.r,T.g=X.g=ia.g=M.g,T.b=X.b=ia.b=M.b,w(wa,u.v1.positionWorld,u.vertexNormalsWorld[0],T),w(wa,u.v2.positionWorld,u.vertexNormalsWorld[1],X),w(wa,u.v3.positionWorld,u.vertexNormalsWorld[2],ia),T.r=Math.max(0,Math.min(v.color.r*T.r,1)),T.g=Math.max(0,Math.min(v.color.g* +T.g,1)),T.b=Math.max(0,Math.min(v.color.b*T.b,1)),X.r=Math.max(0,Math.min(v.color.r*X.r,1)),X.g=Math.max(0,Math.min(v.color.g*X.g,1)),X.b=Math.max(0,Math.min(v.color.b*X.b,1)),ia.r=Math.max(0,Math.min(v.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(v.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(v.color.b*ia.b,1)),ja.r=(X.r+ia.r)*0.5,ja.g=(X.g+ia.g)*0.5,ja.b=(X.b+ia.b)*0.5,ua=Ya(T,X,ia,ja),Ua(J,$,Z,Q,o,R,0,0,1,0,0,1,ua)):(pa.r=M.r,pa.g=M.g,pa.b=M.b,w(wa,u.centroidWorld,u.normalWorld,pa),aa.r=Math.max(0,Math.min(v.color.r* +pa.r,1)),aa.g=Math.max(0,Math.min(v.color.g*pa.g,1)),aa.b=Math.max(0,Math.min(v.color.b*pa.b,1)),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)):v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshDepthMaterial)ma=p.near,ca=p.far,T.r=T.g=T.b=1-Qa(b.positionScreen.z,ma,ca),X.r=X.g=X.b=1-Qa(f.positionScreen.z,ma,ca),ia.r=ia.g=ia.b=1-Qa(h.positionScreen.z,ma,ca),ja.r=(X.r+ia.r)*0.5,ja.g=(X.g+ +ia.g)*0.5,ja.b=(X.b+ia.b)*0.5,ua=Ya(T,X,ia,ja),Ua(J,$,Z,Q,o,R,0,0,1,0,0,1,ua);else if(v instanceof THREE.MeshNormalMaterial)aa.r=Va(u.normalWorld.x),aa.g=Va(u.normalWorld.y),aa.b=Va(u.normalWorld.z),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)}function E(b,f,h,m,n,t,v,u,wa){k.info.render.vertices+=4;k.info.render.faces++;c(u.opacity);e(u.blending);if(u.map||u.envMap)A(b,f,m,0,1,3,v,u,wa),A(n,h,t,1,2,3,v,u,wa);else if(J=b.positionScreen.x,$=b.positionScreen.y, +Z=f.positionScreen.x,Q=f.positionScreen.y,o=h.positionScreen.x,R=h.positionScreen.y,fa=m.positionScreen.x,ea=m.positionScreen.y,ha=n.positionScreen.x,ga=n.positionScreen.y,la=t.positionScreen.x,oa=t.positionScreen.y,u instanceof THREE.MeshBasicMaterial)Za(J,$,Z,Q,o,R,fa,ea),u.wireframe?Na(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(u.color);else if(u instanceof THREE.MeshLambertMaterial)da?!u.wireframe&&u.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4?(T.r= +X.r=ia.r=ja.r=M.r,T.g=X.g=ia.g=ja.g=M.g,T.b=X.b=ia.b=ja.b=M.b,w(wa,v.v1.positionWorld,v.vertexNormalsWorld[0],T),w(wa,v.v2.positionWorld,v.vertexNormalsWorld[1],X),w(wa,v.v4.positionWorld,v.vertexNormalsWorld[3],ia),w(wa,v.v3.positionWorld,v.vertexNormalsWorld[2],ja),T.r=Math.max(0,Math.min(u.color.r*T.r,1)),T.g=Math.max(0,Math.min(u.color.g*T.g,1)),T.b=Math.max(0,Math.min(u.color.b*T.b,1)),X.r=Math.max(0,Math.min(u.color.r*X.r,1)),X.g=Math.max(0,Math.min(u.color.g*X.g,1)),X.b=Math.max(0,Math.min(u.color.b* +X.b,1)),ia.r=Math.max(0,Math.min(u.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(u.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(u.color.b*ia.b,1)),ja.r=Math.max(0,Math.min(u.color.r*ja.r,1)),ja.g=Math.max(0,Math.min(u.color.g*ja.g,1)),ja.b=Math.max(0,Math.min(u.color.b*ja.b,1)),ua=Ya(T,X,ia,ja),D(J,$,Z,Q,fa,ea),Ua(J,$,Z,Q,fa,ea,0,0,1,0,0,1,ua),D(ha,ga,o,R,la,oa),Ua(ha,ga,o,R,la,oa,1,0,1,1,0,1,ua)):(pa.r=M.r,pa.g=M.g,pa.b=M.b,w(wa,v.centroidWorld,v.normalWorld,pa),aa.r=Math.max(0,Math.min(u.color.r*pa.r, +1)),aa.g=Math.max(0,Math.min(u.color.g*pa.g,1)),aa.b=Math.max(0,Math.min(u.color.b*pa.b,1)),Za(J,$,Z,Q,o,R,fa,ea),u.wireframe?Na(aa,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(aa)):(Za(J,$,Z,Q,o,R,fa,ea),u.wireframe?Na(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(u.color));else if(u instanceof THREE.MeshNormalMaterial)aa.r=Va(v.normalWorld.x),aa.g=Va(v.normalWorld.y),aa.b=Va(v.normalWorld.z),Za(J,$,Z,Q,o,R,fa,ea),u.wireframe?Na(aa,u.wireframeLinewidth, +u.wireframeLinecap,u.wireframeLinejoin):C(aa);else if(u instanceof THREE.MeshDepthMaterial)ma=p.near,ca=p.far,T.r=T.g=T.b=1-Qa(b.positionScreen.z,ma,ca),X.r=X.g=X.b=1-Qa(f.positionScreen.z,ma,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,ma,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,ma,ca),ua=Ya(T,X,ia,ja),D(J,$,Z,Q,fa,ea),Ua(J,$,Z,Q,fa,ea,0,0,1,0,0,1,ua),D(ha,ga,o,R,la,oa),Ua(ha,ga,o,R,la,oa,1,0,1,1,0,1,ua)}function D(b,c,e,f,h,k){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(b,c); +v.closePath()}function Za(b,c,e,f,h,k,m,o){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(m,o);v.lineTo(b,c);v.closePath()}function Na(b,c,e,h){if(G!=c)v.lineWidth=G=c;if(I!=e)v.lineCap=I=e;if(P!=h)v.lineJoin=P=h;f(b.getContextStyle());v.stroke();L.inflate(c*2)}function C(b){h(b.getContextStyle());v.fill()}function bb(b,c,e,f,k,m,o,n,p,u,t,wa,w){if(w.image.width!=0){if(w.needsUpdate==!0||sa[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,U=w.wrapT==THREE.RepeatWrapping;sa[w.id]= +v.createPattern(w.image,x&&U?"repeat":x&&!U?"repeat-x":!x&&U?"repeat-y":"no-repeat");w.needsUpdate=!1}h(sa[w.id]);var x=w.offset.x/w.repeat.x,U=w.offset.y/w.repeat.y,z=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,o=(o+x)*z,n=(n+U)*w,p=(p+x)*z,u=(u+U)*w,t=(t+x)*z,wa=(wa+U)*w;e-=b;f-=c;k-=b;m-=c;p-=o;u-=n;t-=o;wa-=n;x=1/(p*wa-t*u);w=(wa*e-u*k)*x;u=(wa*f-u*m)*x;e=(p*k-t*e)*x;f=(p*m-t*f)*x;b=b-w*o-e*n;c=c-u*o-f*n;v.save();v.transform(w,u,e,f,b,c);v.fill();v.restore()}}function Ua(b,c, +e,f,h,k,m,o,n,p,u,t,w){var wa,x;wa=w.width-1;x=w.height-1;m*=wa;o*=x;n*=wa;p*=x;u*=wa;t*=x;e-=b;f-=c;h-=b;k-=c;n-=m;p-=o;u-=m;t-=o;x=1/(n*t-u*p);wa=(t*e-p*h)*x;p=(t*f-p*k)*x;e=(n*h-u*e)*x;f=(n*k-u*f)*x;b=b-wa*m-e*o;c=c-p*m-f*o;v.save();v.transform(wa,p,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var h=~~(b.r*255),k=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),o=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),p=~~(e.g*255),e=~~(e.b*255),u=~~(f.r*255),t=~~(f.g*255),f=~~(f.b*255);ta[0]= +h<0?0:h>255?255:h;ta[1]=k<0?0:k>255?255:k;ta[2]=b<0?0:b>255?255:b;ta[4]=m<0?0:m>255?255:m;ta[5]=o<0?0:o>255?255:o;ta[6]=c<0?0:c>255?255:c;ta[8]=n<0?0:n>255?255:n;ta[9]=p<0?0:p>255?255:p;ta[10]=e<0?0:e>255?255:e;ta[12]=u<0?0:u>255?255:u;ta[13]=t<0?0:t>255?255:t;ta[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,h=e*e+f*f;h!=0&&(h= +1/Math.sqrt(h),e*=h,f*=h,c.x+=e,c.y+=f,b.x-=e,b.y-=f)}var $a,cb,va,Ja,Pa,Wa,ab,Aa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,u,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,p,this.sortElements);(da=b.lights.length>0)&&t(b);$a=0;for(cb=m.length;$a0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m)):k instanceof THREE.PointLight&&(Y.sub(k.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*k.intensity,m>0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m))}function c(c,e,m,n,u,t){k.info.render.vertices+=3;k.info.render.faces++;J=f($++); +J.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");u instanceof THREE.MeshBasicMaterial?G.copy(u.color):u instanceof THREE.MeshLambertMaterial?C?(I.r=P.r,I.g=P.g,I.b=P.b,b(t,n,I),G.r=Math.max(0,Math.min(u.color.r*I.r,1)),G.g=Math.max(0,Math.min(u.color.g*I.g,1)),G.b=Math.max(0,Math.min(u.color.b*I.b,1))):G.copy(u.color):u instanceof THREE.MeshDepthMaterial?(O=1-u.__2near/(u.__farPlusNear- +n.z*u.__farMinusNear),G.setRGB(O,O,O)):u instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));u.wireframe?J.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+u.wireframeLinewidth+"; stroke-opacity: "+u.opacity+"; stroke-linecap: "+u.wireframeLinecap+"; stroke-linejoin: "+u.wireframeLinejoin):J.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+u.opacity);p.appendChild(J)}function e(c,e,m,n,u,t,v){k.info.render.vertices+= +4;k.info.render.faces++;J=f($++);J.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?G.copy(t.color):t instanceof THREE.MeshLambertMaterial?C?(I.r=P.r,I.g=P.g,I.b=P.b,b(v,u,I),G.r=Math.max(0,Math.min(t.color.r*I.r,1)),G.g=Math.max(0,Math.min(t.color.g*I.g,1)),G.b=Math.max(0,Math.min(t.color.b*I.b,1))): +G.copy(t.color):t instanceof THREE.MeshDepthMaterial?(O=1-t.__2near/(t.__farPlusNear-u.z*t.__farMinusNear),G.setRGB(O,O,O)):t instanceof THREE.MeshNormalMaterial&&G.setRGB(h(u.normalWorld.x),h(u.normalWorld.y),h(u.normalWorld.z));t.wireframe?J.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):J.setAttribute("style","fill: "+G.getContextStyle()+ +"; fill-opacity: "+t.opacity);p.appendChild(J)}function f(b){N[b]==null&&(N[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),Q==0&&N[b].setAttribute("shape-rendering","crispEdges"));return N[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,p=document.createElementNS("http://www.w3.org/2000/svg","svg"),t,w,u,x,v,A,z,y,D=new THREE.Rectangle,E=new THREE.Rectangle,C=!1,G=new THREE.Color(16777215),I=new THREE.Color(16777215),P=new THREE.Color(0), +K=new THREE.Color(0),B=new THREE.Color(0),O,Y=new THREE.Vector3,N=[],V=[],J,$,Z,Q=1;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":Q=1;break;case "low":Q=0}};this.setSize=function(b,c){t=b;w=c;u=t/2;x=w/2;p.setAttribute("viewBox",-u+" "+-x+" "+t+" "+w);p.setAttribute("width",t);p.setAttribute("height",w);D.set(-u,-x,u,x)};this.clear=function(){for(;p.childNodes.length>0;)p.removeChild(p.childNodes[0])}; +this.render=function(b,f){var h,t,w,G,N,O,I,T;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);Z=$=0;if(C=b.lights.length>0){I=b.lights;P.setRGB(0,0,0);K.setRGB(0,0,0);B.setRGB(0,0,0);h=0;for(t=I.length;h=0)c&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(b.position,3,p.FLOAT,!1,0,0));else if(m.morphTargetBase){f=h.program.attributes;m.morphTargetBase!== --1?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[m.morphTargetBase]),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0)):f.position>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglVertexBuffer),p.vertexAttribPointer(f.position,3,p.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var o=0,t=m.morphTargetForcedOrder,u=m.morphTargetInfluences;ov&&(w=x,v=u[w]);p.bindBuffer(p.ARRAY_BUFFER,k.__webglMorphTargetsBuffers[w]);p.vertexAttribPointer(f["morphTarget"+o],3,p.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[o]=v;t[w]=1;v=-1;o++}}h.program.uniforms.morphTargetInfluences!==null&&p.uniform1fv(h.program.uniforms.morphTargetInfluences, -m.__webglMorphTargetInfluences)}if(c){if(k.__webglCustomAttributes)for(n in k.__webglCustomAttributes)b[n]>=0&&(f=k.__webglCustomAttributes[n],p.bindBuffer(p.ARRAY_BUFFER,f.buffer),p.vertexAttribPointer(b[n],f.size,p.FLOAT,!1,0,0));b.color>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglColorBuffer),p.vertexAttribPointer(b.color,3,p.FLOAT,!1,0,0));b.normal>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglNormalBuffer),p.vertexAttribPointer(b.normal,3,p.FLOAT,!1,0,0));b.tangent>=0&&(p.bindBuffer(p.ARRAY_BUFFER, -k.__webglTangentBuffer),p.vertexAttribPointer(b.tangent,4,p.FLOAT,!1,0,0));b.uv>=0&&(k.__webglUVBuffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUVBuffer),p.vertexAttribPointer(b.uv,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv)):p.disableVertexAttribArray(b.uv));b.uv2>=0&&(k.__webglUV2Buffer?(p.bindBuffer(p.ARRAY_BUFFER,k.__webglUV2Buffer),p.vertexAttribPointer(b.uv2,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(b.uv2)):p.disableVertexAttribArray(b.uv2));h.skinning&&b.skinVertexA>=0&&b.skinVertexB>= -0&&b.skinIndex>=0&&b.skinWeight>=0&&(p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexABuffer),p.vertexAttribPointer(b.skinVertexA,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinVertexBBuffer),p.vertexAttribPointer(b.skinVertexB,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinIndicesBuffer),p.vertexAttribPointer(b.skinIndex,4,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,k.__webglSkinWeightsBuffer),p.vertexAttribPointer(b.skinWeight,4,p.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(h.wireframe? -(p.lineWidth(h.wireframeLinewidth),c&&p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,k.__webglLineBuffer),p.drawElements(p.LINES,k.__webglLineCount,p.UNSIGNED_SHORT,0)):(c&&p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,k.__webglFaceBuffer),p.drawElements(p.TRIANGLES,k.__webglFaceCount,p.UNSIGNED_SHORT,0)),P.info.render.calls++,P.info.render.vertices+=k.__webglFaceCount,P.info.render.faces+=k.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?p.LINE_STRIP:p.LINES,p.lineWidth(h.linewidth),p.drawArrays(m, -0,k.__webglLineCount),P.info.render.calls++):m instanceof THREE.ParticleSystem?(p.drawArrays(p.POINTS,0,k.__webglParticleCount),P.info.render.calls++):m instanceof THREE.Ribbon&&(p.drawArrays(p.TRIANGLE_STRIP,0,k.__webglVertexCount),P.info.render.calls++)}}function h(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=p.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=p.createBuffer();b.hasPos&&(p.bindBuffer(p.ARRAY_BUFFER,b.__webglVertexBuffer),p.bufferData(p.ARRAY_BUFFER,b.positionArray, -p.DYNAMIC_DRAW),p.enableVertexAttribArray(c.attributes.position),p.vertexAttribPointer(c.attributes.position,3,p.FLOAT,!1,0,0));if(b.hasNormal){p.bindBuffer(p.ARRAY_BUFFER,b.__webglNormalBuffer);if(e==THREE.FlatShading){var f,k,h,m,n,o,t,u,v,w,x=b.count*3;for(w=0;w=0;e--)b[e].object==c&&b.splice(e,1)}function J(b){function c(b){var k=[];e=0;for(f=b.length;e65535&&(t[p].counter+=1,o=t[p].hash+"_"+t[p].counter,b.geometryGroups[o]==void 0&&(b.geometryGroups[o]={faces:[],materials:n,vertices:0,numMorphTargets:u})),b.geometryGroups[o].faces.push(k),b.geometryGroups[o].vertices+=m;b.geometryGroupsList=[];for(var v in b.geometryGroups)b.geometryGroups[v].id=ka++,b.geometryGroupsList.push(b.geometryGroups[v])}function M(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0}, -transparent:{list:[],count:0}})}function K(b){if(b!=W){switch(b){case THREE.AdditiveBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.SRC_ALPHA,p.ONE);break;case THREE.SubtractiveBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.ZERO,p.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:p.blendEquation(p.FUNC_ADD);p.blendFunc(p.ZERO,p.SRC_COLOR);break;default:p.blendEquationSeparate(p.FUNC_ADD,p.FUNC_ADD),p.blendFuncSeparate(p.SRC_ALPHA,p.ONE_MINUS_SRC_ALPHA,p.ONE,p.ONE_MINUS_SRC_ALPHA)}W=b}} -function B(b,c,e){(e.width&e.width-1)==0&&(e.height&e.height-1)==0?(p.texParameteri(b,p.TEXTURE_WRAP_S,$(c.wrapS)),p.texParameteri(b,p.TEXTURE_WRAP_T,$(c.wrapT)),p.texParameteri(b,p.TEXTURE_MAG_FILTER,$(c.magFilter)),p.texParameteri(b,p.TEXTURE_MIN_FILTER,$(c.minFilter)),p.generateMipmap(b)):(p.texParameteri(b,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(b,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(b,p.TEXTURE_MAG_FILTER,Z(c.magFilter)),p.texParameteri(b,p.TEXTURE_MIN_FILTER,Z(c.minFilter)))} -function L(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=p.createTexture(),P.info.memory.textures++;p.activeTexture(p.TEXTURE0+c);p.bindTexture(p.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?p.texImage2D(p.TEXTURE_2D,0,$(b.format),b.image.width,b.image.height,0,$(b.format),p.UNSIGNED_BYTE,b.image.data):p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,b.image);B(p.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else p.activeTexture(p.TEXTURE0+c),p.bindTexture(p.TEXTURE_2D, -b.__webglTexture)}function Y(b,c){p.bindRenderbuffer(p.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_COMPONENT16,c.width,c.height),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_STENCIL,c.width,c.height),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_STENCIL_ATTACHMENT,p.RENDERBUFFER,b)):p.renderbufferStorage(p.RENDERBUFFER,p.RGBA4,c.width,c.height)} -function H(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=p.createTexture();if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];p.bindTexture(p.TEXTURE_CUBE_MAP,b.__webglTexture);B(p.TEXTURE_CUBE_MAP,b,b);for(var e=0;e<6;e++){b.__webglFramebuffer[e]=p.createFramebuffer();b.__webglRenderbuffer[e]=p.createRenderbuffer();p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X+ -e,0,$(b.format),b.width,b.height,0,$(b.format),$(b.type),null);var f=b,k=p.TEXTURE_CUBE_MAP_POSITIVE_X+e;p.bindFramebuffer(p.FRAMEBUFFER,b.__webglFramebuffer[e]);p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,k,f.__webglTexture,0);Y(b.__webglRenderbuffer[e],b)}}else b.__webglFramebuffer=p.createFramebuffer(),b.__webglRenderbuffer=p.createRenderbuffer(),p.bindTexture(p.TEXTURE_2D,b.__webglTexture),B(p.TEXTURE_2D,b,b),p.texImage2D(p.TEXTURE_2D,0,$(b.format),b.width,b.height,0,$(b.format), -$(b.type),null),e=p.TEXTURE_2D,p.bindFramebuffer(p.FRAMEBUFFER,b.__webglFramebuffer),p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,e,b.__webglTexture,0),p.bindRenderbuffer(p.RENDERBUFFER,b.__webglRenderbuffer),Y(b.__webglRenderbuffer,b);c?p.bindTexture(p.TEXTURE_CUBE_MAP,null):p.bindTexture(p.TEXTURE_2D,null);p.bindRenderbuffer(p.RENDERBUFFER,null);p.bindFramebuffer(p.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,e=b.width,b=b.height,k=f=0):(c=null, -e=ra,b=sa,f=ca,k=pa);c!=ea&&(p.bindFramebuffer(p.FRAMEBUFFER,c),p.viewport(f,k,e,b),ea=c)}function T(b){b instanceof THREE.WebGLRenderTargetCube?(p.bindTexture(p.TEXTURE_CUBE_MAP,b.__webglTexture),p.generateMipmap(p.TEXTURE_CUBE_MAP),p.bindTexture(p.TEXTURE_CUBE_MAP,null)):(p.bindTexture(p.TEXTURE_2D,b.__webglTexture),p.generateMipmap(p.TEXTURE_2D),p.bindTexture(p.TEXTURE_2D,null))}function Q(b,c){var e;b=="fragment"?e=p.createShader(p.FRAGMENT_SHADER):b=="vertex"&&(e=p.createShader(p.VERTEX_SHADER)); -p.shaderSource(e,c);p.compileShader(e);if(!p.getShaderParameter(e,p.COMPILE_STATUS))return console.error(p.getShaderInfoLog(e)),console.error(c),null;return e}function Z(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return p.NEAREST;default:return p.LINEAR}}function $(b){switch(b){case THREE.RepeatWrapping:return p.REPEAT;case THREE.ClampToEdgeWrapping:return p.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return p.MIRRORED_REPEAT; -case THREE.NearestFilter:return p.NEAREST;case THREE.NearestMipMapNearestFilter:return p.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return p.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return p.LINEAR;case THREE.LinearMipMapNearestFilter:return p.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return p.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return p.BYTE;case THREE.UnsignedByteType:return p.UNSIGNED_BYTE;case THREE.ShortType:return p.SHORT;case THREE.UnsignedShortType:return p.UNSIGNED_SHORT; -case THREE.IntType:return p.INT;case THREE.UnsignedShortType:return p.UNSIGNED_INT;case THREE.FloatType:return p.FLOAT;case THREE.AlphaFormat:return p.ALPHA;case THREE.RGBFormat:return p.RGB;case THREE.RGBAFormat:return p.RGBA;case THREE.LuminanceFormat:return p.LUMINANCE;case THREE.LuminanceAlphaFormat:return p.LUMINANCE_ALPHA}return 0}var P=this,p,V=[],fa=null,ea=null,ha=-1,ga=null,ka=0,na=null,aa=null,W=null,U=null,ia=null,ja=null,ta=null,la=null,ca=0,pa=0,ra=0,sa=0,ya=[new THREE.Vector4,new THREE.Vector4, -new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Ga=new Float32Array(16),Fa=new Float32Array(16),Da=new THREE.Vector4,za={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},S=b.canvas!==void 0?b.canvas:document.createElement("canvas"),O=b.stencil!==void 0?b.stencil:!0,da=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,qa=b.antialias!==void 0?b.antialias:!1,N=b.clearColor!== -void 0?new THREE.Color(b.clearColor):new THREE.Color(0),ma=b.clearAlpha!==void 0?b.clearAlpha:0,ua=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=S;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight= -this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var oa,Ea=[],b=THREE.ShaderLib.depthRGBA,Ia=THREE.UniformsUtils.clone(b.uniforms),Ba=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Ia}),va=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Ia,morphTargets:!0});Ba._shadowPass= -!0;va._shadowPass=!0;try{if(!(p=S.getContext("experimental-webgl",{antialias:qa,stencil:O,preserveDrawingBuffer:da})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+p.getParameter(p.VERSION)+" | "+p.getParameter(p.VENDOR)+" | "+p.getParameter(p.RENDERER)+" | "+p.getParameter(p.SHADING_LANGUAGE_VERSION))}catch(Ka){console.error(Ka)}p.clearColor(0,0,0,1);p.clearDepth(1);p.clearStencil(0);p.enable(p.DEPTH_TEST);p.depthFunc(p.LEQUAL);p.frontFace(p.CCW);p.cullFace(p.BACK);p.enable(p.CULL_FACE); -p.enable(p.BLEND);p.blendEquation(p.FUNC_ADD);p.blendFunc(p.SRC_ALPHA,p.ONE_MINUS_SRC_ALPHA);p.clearColor(N.r,N.g,N.b,ma);this.context=p;var Ha=p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,X={};X.vertices=new Float32Array(16);X.faces=new Uint16Array(6);O=0;X.vertices[O++]=-1;X.vertices[O++]=-1;X.vertices[O++]=0;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=-1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=1;X.vertices[O++]=0;X.vertices[O++]=-1; -X.vertices[O++]=1;X.vertices[O++]=0;O=X.vertices[O++]=0;X.faces[O++]=0;X.faces[O++]=1;X.faces[O++]=2;X.faces[O++]=0;X.faces[O++]=2;X.faces[O++]=3;X.vertexBuffer=p.createBuffer();X.elementBuffer=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,X.vertexBuffer);p.bufferData(p.ARRAY_BUFFER,X.vertices,p.STATIC_DRAW);p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,X.elementBuffer);p.bufferData(p.ELEMENT_ARRAY_BUFFER,X.faces,p.STATIC_DRAW);X.program=p.createProgram();p.attachShader(X.program,Q("fragment",THREE.ShaderLib.sprite.fragmentShader)); -p.attachShader(X.program,Q("vertex",THREE.ShaderLib.sprite.vertexShader));p.linkProgram(X.program);X.attributes={};X.uniforms={};X.attributes.position=p.getAttribLocation(X.program,"position");X.attributes.uv=p.getAttribLocation(X.program,"uv");X.uniforms.uvOffset=p.getUniformLocation(X.program,"uvOffset");X.uniforms.uvScale=p.getUniformLocation(X.program,"uvScale");X.uniforms.rotation=p.getUniformLocation(X.program,"rotation");X.uniforms.scale=p.getUniformLocation(X.program,"scale");X.uniforms.alignment= -p.getUniformLocation(X.program,"alignment");X.uniforms.color=p.getUniformLocation(X.program,"color");X.uniforms.map=p.getUniformLocation(X.program,"map");X.uniforms.opacity=p.getUniformLocation(X.program,"opacity");X.uniforms.useScreenCoordinates=p.getUniformLocation(X.program,"useScreenCoordinates");X.uniforms.affectedByDistance=p.getUniformLocation(X.program,"affectedByDistance");X.uniforms.screenPosition=p.getUniformLocation(X.program,"screenPosition");X.uniforms.modelViewMatrix=p.getUniformLocation(X.program, -"modelViewMatrix");X.uniforms.projectionMatrix=p.getUniformLocation(X.program,"projectionMatrix");var Xa=!1;this.setSize=function(b,c){S.width=b;S.height=c;this.setViewport(0,0,S.width,S.height)};this.setViewport=function(b,c,e,f){ca=b;pa=c;ra=e;sa=f;p.viewport(ca,pa,ra,sa)};this.setScissor=function(b,c,e,f){p.scissor(b,c,e,f)};this.enableScissorTest=function(b){b?p.enable(p.SCISSOR_TEST):p.disable(p.SCISSOR_TEST)};this.setClearColorHex=function(b,c){N.setHex(b);ma=c;p.clearColor(N.r,N.g,N.b,ma)}; -this.setClearColor=function(b,c){N.copy(b);ma=c;p.clearColor(N.r,N.g,N.b,ma)};this.getClearColor=function(){return N};this.getClearAlpha=function(){return ma};this.clear=function(b,c,e){var f=0;if(b==void 0||b)f|=p.COLOR_BUFFER_BIT;if(c==void 0||c)f|=p.DEPTH_BUFFER_BIT;if(e==void 0||e)f|=p.STENCIL_BUFFER_BIT;p.clear(f)};this.getContext=function(){return p};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray, -delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];p.deleteBuffer(c.__webglVertexBuffer);p.deleteBuffer(c.__webglNormalBuffer);p.deleteBuffer(c.__webglTangentBuffer);p.deleteBuffer(c.__webglColorBuffer);p.deleteBuffer(c.__webglUVBuffer);p.deleteBuffer(c.__webglUV2Buffer);p.deleteBuffer(c.__webglSkinVertexABuffer);p.deleteBuffer(c.__webglSkinVertexBBuffer);p.deleteBuffer(c.__webglSkinIndicesBuffer);p.deleteBuffer(c.__webglSkinWeightsBuffer); -p.deleteBuffer(c.__webglFaceBuffer);p.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var e=0,f=c.numMorphTargets;e=0&&p.enableVertexAttribArray(x.position);x.color>=0&&p.enableVertexAttribArray(x.color);x.normal>=0&&p.enableVertexAttribArray(x.normal);x.tangent>=0&&p.enableVertexAttribArray(x.tangent); -b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(p.enableVertexAttribArray(x.skinVertexA),p.enableVertexAttribArray(x.skinVertexB),p.enableVertexAttribArray(x.skinIndex),p.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(h in b.attributes)x[h]!==void 0&&x[h]>=0&&p.enableVertexAttribArray(x[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h=0&&(p.enableVertexAttribArray(x[y]),b.numSupportedMorphTargets++); -b.uniformsList=[];for(k in b.uniforms)b.uniformsList.push([b.uniforms[k],k])};this.clearTarget=function(b,c,e,f){H(b);this.clear(c,e,f)};this.updateShadowMap=function(b,c){z(b,c)};this.render=function(b,c,o,S){var O,da,F,C,G,qa,B,la,J=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&z(b,c);P.info.render.calls=0;P.info.render.vertices=0;P.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Fa); -c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);u(Ca);this.initWebGLObjects(b);H(o);(this.autoClear||S)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(S=0;S=0;S--)if(O=b.__webglObjects[S],O.render){B=O.object;la=O.buffer;F=O.opaque;k(B);for(O=0;O0||x.faceVertexUvs.length> -0)m.__uvArray=new Float32Array(o*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(o*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(o*4),m.__skinVertexBArray=new Float32Array(o*4),m.__skinIndexArray=new Float32Array(o*4),m.__skinWeightArray=new Float32Array(o*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(S*2);if(m.numMorphTargets){m.__morphTargetsArrays= -[];x=0;for(z=m.numMorphTargets;x=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglColorBuffer),p.bufferData(p.ARRAY_BUFFER,ea,y));Ga&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglNormalBuffer),p.bufferData(p.ARRAY_BUFFER,ga,y));Da&&va.hasTangents&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglTangentBuffer),p.bufferData(p.ARRAY_BUFFER,ha,y));Ha&&ra>0&&(p.bindBuffer(p.ARRAY_BUFFER, -t.__webglUVBuffer),p.bufferData(p.ARRAY_BUFFER,ia,y));Ha&&T>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglUV2Buffer),p.bufferData(p.ARRAY_BUFFER,Ea,y));Ca&&(p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,Ba,y),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,ta,y));R>0&&(p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexABuffer),p.bufferData(p.ARRAY_BUFFER,ja,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinVertexBBuffer), -p.bufferData(p.ARRAY_BUFFER,sa,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),p.bufferData(p.ARRAY_BUFFER,aa,y),p.bindBuffer(p.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),p.bufferData(p.ARRAY_BUFFER,fa,y));S&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray,delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}k.__dirtyVertices= -!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(m)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=p.DYNAMIC_DRAW;n=x=S=S=void 0;u=h.vertices;o=h.colors;v=u.length;t=o.length;z=h.__vertexArray;y=h.__colorArray;A=h.__dirtyColors;if(h.__dirtyVertices){for(S=0;S=0)c&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer), +o.vertexAttribPointer(b.position,3,o.FLOAT,!1,0,0));else if(m.morphTargetBase){f=k.program.attributes;m.morphTargetBase!==-1?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[m.morphTargetBase]),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0)):f.position>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length){n=0;var t=m.morphTargetForcedOrder;for(p=m.morphTargetInfluences;nu&&(v=w,u=p[v]);o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[v]);o.vertexAttribPointer(f["morphTarget"+n],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[n]= +u;t[v]=1;u=-1;n++}}k.program.uniforms.morphTargetInfluences!==null&&o.uniform1fv(k.program.uniforms.morphTargetInfluences,m.__webglMorphTargetInfluences)}if(c){if(h.__webglCustomAttributesList){n=0;for(p=h.__webglCustomAttributesList.length;n=0&&(o.bindBuffer(o.ARRAY_BUFFER,f.buffer),o.vertexAttribPointer(b[f.buffer.belongsToAttribute],f.size,o.FLOAT,!1,0,0))}b.color>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglColorBuffer),o.vertexAttribPointer(b.color, +3,o.FLOAT,!1,0,0));b.normal>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglNormalBuffer),o.vertexAttribPointer(b.normal,3,o.FLOAT,!1,0,0));b.tangent>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglTangentBuffer),o.vertexAttribPointer(b.tangent,4,o.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglUVBuffer),o.vertexAttribPointer(b.uv,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv)):o.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglUV2Buffer), +o.vertexAttribPointer(b.uv2,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv2)):o.disableVertexAttribArray(b.uv2));k.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinVertexABuffer),o.vertexAttribPointer(b.skinVertexA,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),o.vertexAttribPointer(b.skinVertexB,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),o.vertexAttribPointer(b.skinIndex, +4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),o.vertexAttribPointer(b.skinWeight,4,o.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(k.wireframe?(o.lineWidth(k.wireframeLinewidth),c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),o.drawElements(o.LINES,h.__webglLineCount,o.UNSIGNED_SHORT,0)):(c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),o.drawElements(o.TRIANGLES,h.__webglFaceCount,o.UNSIGNED_SHORT,0)),Q.info.render.calls++,Q.info.render.vertices+=h.__webglFaceCount, +Q.info.render.faces+=h.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?o.LINE_STRIP:o.LINES,o.lineWidth(k.linewidth),o.drawArrays(m,0,h.__webglLineCount),Q.info.render.calls++):m instanceof THREE.ParticleSystem?(o.drawArrays(o.POINTS,0,h.__webglParticleCount),Q.info.render.calls++):m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP,0,h.__webglVertexCount),Q.info.render.calls++)}}function h(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=o.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer= +o.createBuffer();b.hasPos&&(o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,b.positionArray,o.DYNAMIC_DRAW),o.enableVertexAttribArray(c.attributes.position),o.vertexAttribPointer(c.attributes.position,3,o.FLOAT,!1,0,0));if(b.hasNormal){o.bindBuffer(o.ARRAY_BUFFER,b.__webglNormalBuffer);if(e==THREE.FlatShading){var f,h,k,m,n,p,t,u,v,w,x=b.count*3;for(w=0;w=0;e--)b[e].object==c&&b.splice(e,1)}function I(b){function c(b){var h=[];e=0;for(f=b.length;e65535&&(t[o].counter+=1,p=t[o].hash+"_"+t[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[],materials:n,vertices:0,numMorphTargets:u})),b.geometryGroups[p].faces.push(h),b.geometryGroups[p].vertices+=m;b.geometryGroupsList=[];for(var v in b.geometryGroups)b.geometryGroups[v].id= +la++,b.geometryGroupsList.push(b.geometryGroups[v])}function P(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function K(b){if(b!=T){switch(b){case THREE.AdditiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE);break;case THREE.SubtractiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,o.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,o.SRC_COLOR);break;default:o.blendEquationSeparate(o.FUNC_ADD, +o.FUNC_ADD),o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA)}T=b}}function B(b,c,e){(e.width&e.width-1)==0&&(e.height&e.height-1)==0?(o.texParameteri(b,o.TEXTURE_WRAP_S,Z(c.wrapS)),o.texParameteri(b,o.TEXTURE_WRAP_T,Z(c.wrapT)),o.texParameteri(b,o.TEXTURE_MAG_FILTER,Z(c.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,Z(c.minFilter)),o.generateMipmap(b)):(o.texParameteri(b,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(b, +o.TEXTURE_MAG_FILTER,$(c.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,$(c.minFilter)))}function O(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=o.createTexture(),Q.info.memory.textures++;o.activeTexture(o.TEXTURE0+c);o.bindTexture(o.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?o.texImage2D(o.TEXTURE_2D,0,Z(b.format),b.image.width,b.image.height,0,Z(b.format),o.UNSIGNED_BYTE,b.image.data):o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,b.image); +B(o.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+c),o.bindTexture(o.TEXTURE_2D,b.__webglTexture)}function Y(b,c){o.bindRenderbuffer(o.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_COMPONENT16,c.width,c.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,c.width,c.height),o.framebufferRenderbuffer(o.FRAMEBUFFER, +o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,b)):o.renderbufferStorage(o.RENDERBUFFER,o.RGBA4,c.width,c.height)}function N(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=o.createTexture();if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture);B(o.TEXTURE_CUBE_MAP,b,b);for(var e=0;e<6;e++){b.__webglFramebuffer[e]= +o.createFramebuffer();b.__webglRenderbuffer[e]=o.createRenderbuffer();o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,Z(b.format),b.width,b.height,0,Z(b.format),Z(b.type),null);var f=b,h=o.TEXTURE_CUBE_MAP_POSITIVE_X+e;o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer[e]);o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,h,f.__webglTexture,0);Y(b.__webglRenderbuffer[e],b)}}else b.__webglFramebuffer=o.createFramebuffer(),b.__webglRenderbuffer=o.createRenderbuffer(),o.bindTexture(o.TEXTURE_2D, +b.__webglTexture),B(o.TEXTURE_2D,b,b),o.texImage2D(o.TEXTURE_2D,0,Z(b.format),b.width,b.height,0,Z(b.format),Z(b.type),null),e=o.TEXTURE_2D,o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,e,b.__webglTexture,0),o.bindRenderbuffer(o.RENDERBUFFER,b.__webglRenderbuffer),Y(b.__webglRenderbuffer,b);c?o.bindTexture(o.TEXTURE_CUBE_MAP,null):o.bindTexture(o.TEXTURE_2D,null);o.bindRenderbuffer(o.RENDERBUFFER,null);o.bindFramebuffer(o.FRAMEBUFFER, +null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,e=b.width,b=b.height,h=f=0):(c=null,e=qa,b=ra,f=ca,h=ua);c!=ea&&(o.bindFramebuffer(o.FRAMEBUFFER,c),o.viewport(f,h,e,b),ea=c)}function V(b){b instanceof THREE.WebGLRenderTargetCube?(o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture),o.generateMipmap(o.TEXTURE_CUBE_MAP),o.bindTexture(o.TEXTURE_CUBE_MAP,null)):(o.bindTexture(o.TEXTURE_2D,b.__webglTexture),o.generateMipmap(o.TEXTURE_2D),o.bindTexture(o.TEXTURE_2D,null))}function J(b, +c){var e;b=="fragment"?e=o.createShader(o.FRAGMENT_SHADER):b=="vertex"&&(e=o.createShader(o.VERTEX_SHADER));o.shaderSource(e,c);o.compileShader(e);if(!o.getShaderParameter(e,o.COMPILE_STATUS))return console.error(o.getShaderInfoLog(e)),console.error(c),null;return e}function $(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return o.NEAREST;default:return o.LINEAR}}function Z(b){switch(b){case THREE.RepeatWrapping:return o.REPEAT;case THREE.ClampToEdgeWrapping:return o.CLAMP_TO_EDGE; +case THREE.MirroredRepeatWrapping:return o.MIRRORED_REPEAT;case THREE.NearestFilter:return o.NEAREST;case THREE.NearestMipMapNearestFilter:return o.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return o.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return o.LINEAR;case THREE.LinearMipMapNearestFilter:return o.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return o.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return o.BYTE;case THREE.UnsignedByteType:return o.UNSIGNED_BYTE;case THREE.ShortType:return o.SHORT; +case THREE.UnsignedShortType:return o.UNSIGNED_SHORT;case THREE.IntType:return o.INT;case THREE.UnsignedShortType:return o.UNSIGNED_INT;case THREE.FloatType:return o.FLOAT;case THREE.AlphaFormat:return o.ALPHA;case THREE.RGBFormat:return o.RGB;case THREE.RGBAFormat:return o.RGBA;case THREE.LuminanceFormat:return o.LUMINANCE;case THREE.LuminanceAlphaFormat:return o.LUMINANCE_ALPHA}return 0}var Q=this,o,R=[],fa=null,ea=null,ha=-1,ga=null,la=0,oa=null,aa=null,T=null,X=null,ia=null,ja=null,sa=null,ma= +null,ca=0,ua=0,qa=0,ra=0,xa=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Ga=new Float32Array(16),Fa=new Float32Array(16),Da=new THREE.Vector4,za={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},U=b.canvas!==void 0?b.canvas:document.createElement("canvas"),L=b.stencil!==void 0?b.stencil:!0,da=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer: +!1,pa=b.antialias!==void 0?b.antialias:!1,M=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),na=b.clearAlpha!==void 0?b.clearAlpha:0,ya=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=U;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias= +0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var ka,Ea=[],b=THREE.ShaderLib.depthRGBA,Ia=THREE.UniformsUtils.clone(b.uniforms),Ba=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Ia}),ta=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader, +uniforms:Ia,morphTargets:!0});Ba._shadowPass=!0;ta._shadowPass=!0;try{if(!(o=U.getContext("experimental-webgl",{antialias:pa,stencil:L,preserveDrawingBuffer:da})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+o.getParameter(o.VERSION)+" | "+o.getParameter(o.VENDOR)+" | "+o.getParameter(o.RENDERER)+" | "+o.getParameter(o.SHADING_LANGUAGE_VERSION))}catch(Ka){console.error(Ka)}o.clearColor(0,0,0,1);o.clearDepth(1);o.clearStencil(0);o.enable(o.DEPTH_TEST);o.depthFunc(o.LEQUAL); +o.frontFace(o.CCW);o.cullFace(o.BACK);o.enable(o.CULL_FACE);o.enable(o.BLEND);o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA);o.clearColor(M.r,M.g,M.b,na);this.context=o;var Ha=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,W={};W.vertices=new Float32Array(16);W.faces=new Uint16Array(6);L=0;W.vertices[L++]=-1;W.vertices[L++]=-1;W.vertices[L++]=0;W.vertices[L++]=1;W.vertices[L++]=1;W.vertices[L++]=-1;W.vertices[L++]=1;W.vertices[L++]=1;W.vertices[L++]=1;W.vertices[L++]= +1;W.vertices[L++]=1;W.vertices[L++]=0;W.vertices[L++]=-1;W.vertices[L++]=1;W.vertices[L++]=0;L=W.vertices[L++]=0;W.faces[L++]=0;W.faces[L++]=1;W.faces[L++]=2;W.faces[L++]=0;W.faces[L++]=2;W.faces[L++]=3;W.vertexBuffer=o.createBuffer();W.elementBuffer=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,W.vertexBuffer);o.bufferData(o.ARRAY_BUFFER,W.vertices,o.STATIC_DRAW);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,W.elementBuffer);o.bufferData(o.ELEMENT_ARRAY_BUFFER,W.faces,o.STATIC_DRAW);W.program=o.createProgram(); +o.attachShader(W.program,J("fragment",THREE.ShaderLib.sprite.fragmentShader));o.attachShader(W.program,J("vertex",THREE.ShaderLib.sprite.vertexShader));o.linkProgram(W.program);W.attributes={};W.uniforms={};W.attributes.position=o.getAttribLocation(W.program,"position");W.attributes.uv=o.getAttribLocation(W.program,"uv");W.uniforms.uvOffset=o.getUniformLocation(W.program,"uvOffset");W.uniforms.uvScale=o.getUniformLocation(W.program,"uvScale");W.uniforms.rotation=o.getUniformLocation(W.program,"rotation"); +W.uniforms.scale=o.getUniformLocation(W.program,"scale");W.uniforms.alignment=o.getUniformLocation(W.program,"alignment");W.uniforms.color=o.getUniformLocation(W.program,"color");W.uniforms.map=o.getUniformLocation(W.program,"map");W.uniforms.opacity=o.getUniformLocation(W.program,"opacity");W.uniforms.useScreenCoordinates=o.getUniformLocation(W.program,"useScreenCoordinates");W.uniforms.affectedByDistance=o.getUniformLocation(W.program,"affectedByDistance");W.uniforms.screenPosition=o.getUniformLocation(W.program, +"screenPosition");W.uniforms.modelViewMatrix=o.getUniformLocation(W.program,"modelViewMatrix");W.uniforms.projectionMatrix=o.getUniformLocation(W.program,"projectionMatrix");var Xa=!1;this.setSize=function(b,c){U.width=b;U.height=c;this.setViewport(0,0,U.width,U.height)};this.setViewport=function(b,c,e,f){ca=b;ua=c;qa=e;ra=f;o.viewport(ca,ua,qa,ra)};this.setScissor=function(b,c,e,f){o.scissor(b,c,e,f)};this.enableScissorTest=function(b){b?o.enable(o.SCISSOR_TEST):o.disable(o.SCISSOR_TEST)};this.setClearColorHex= +function(b,c){M.setHex(b);na=c;o.clearColor(M.r,M.g,M.b,na)};this.setClearColor=function(b,c){M.copy(b);na=c;o.clearColor(M.r,M.g,M.b,na)};this.getClearColor=function(){return M};this.getClearAlpha=function(){return na};this.clear=function(b,c,e){var f=0;if(b==void 0||b)f|=o.COLOR_BUFFER_BIT;if(c==void 0||c)f|=o.DEPTH_BUFFER_BIT;if(e==void 0||e)f|=o.STENCIL_BUFFER_BIT;o.clear(f)};this.getContext=function(){return o};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix, +delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];o.deleteBuffer(c.__webglVertexBuffer);o.deleteBuffer(c.__webglNormalBuffer);o.deleteBuffer(c.__webglTangentBuffer);o.deleteBuffer(c.__webglColorBuffer);o.deleteBuffer(c.__webglUVBuffer);o.deleteBuffer(c.__webglUV2Buffer);o.deleteBuffer(c.__webglSkinVertexABuffer);o.deleteBuffer(c.__webglSkinVertexBBuffer);o.deleteBuffer(c.__webglSkinIndicesBuffer); +o.deleteBuffer(c.__webglSkinWeightsBuffer);o.deleteBuffer(c.__webglFaceBuffer);o.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var e=0,f=c.numMorphTargets;e=0&&o.enableVertexAttribArray(x.position);x.color>=0&&o.enableVertexAttribArray(x.color);x.normal>=0&&o.enableVertexAttribArray(x.normal);x.tangent>=0&&o.enableVertexAttribArray(x.tangent); +b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(o.enableVertexAttribArray(x.skinVertexA),o.enableVertexAttribArray(x.skinVertexB),o.enableVertexAttribArray(x.skinIndex),o.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(k in b.attributes)x[k]!==void 0&&x[k]>=0&&o.enableVertexAttribArray(x[k]);if(b.morphTargets)for(k=b.numSupportedMorphTargets=0;k=0&&(o.enableVertexAttribArray(x[z]),b.numSupportedMorphTargets++); +b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,e,f){N(b);this.clear(c,e,f)};this.updateShadowMap=function(b,c){z(b,c)};this.render=function(b,c,u,U){var L,da,E,C,G,pa,B,ma,I=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&z(b,c);Q.info.render.calls=0;Q.info.render.vertices=0;Q.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Fa); +c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);t(Ca);this.initWebGLObjects(b);N(u);(this.autoClear||U)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(U=0;U=0;U--)if(L=b.__webglObjects[U],L.render){B=L.object;ma=L.buffer;E=L.opaque;k(B);for(L=0;L0||x.faceVertexUvs.length> +0)m.__uvArray=new Float32Array(p*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(p*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(p*4),m.__skinVertexBArray=new Float32Array(p*4),m.__skinIndexArray=new Float32Array(p*4),m.__skinWeightArray=new Float32Array(p*4);m.__faceArray=new Uint16Array(z*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(U*2);if(m.numMorphTargets){m.__morphTargetsArrays= +[];x=0;for(y=m.numMorphTargets;x=0;k--)f[k]==h&&f.splice(k,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,ea,z));Ga&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglNormalBuffer),o.bufferData(o.ARRAY_BUFFER,ga,z));Da&&ta.hasTangents&&(o.bindBuffer(o.ARRAY_BUFFER, +t.__webglTangentBuffer),o.bufferData(o.ARRAY_BUFFER,ha,z));Ha&&ua>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglUVBuffer),o.bufferData(o.ARRAY_BUFFER,ia,z));Ha&&qa>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglUV2Buffer),o.bufferData(o.ARRAY_BUFFER,Ea,z));Ca&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,Ba,z),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,sa,z));S>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinVertexABuffer), +o.bufferData(o.ARRAY_BUFFER,ja,z),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinVertexBBuffer),o.bufferData(o.ARRAY_BUFFER,ra,z),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),o.bufferData(o.ARRAY_BUFFER,aa,z),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),o.bufferData(o.ARRAY_BUFFER,fa,z));U&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray, +delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;C(m)}else if(k instanceof THREE.Ribbon){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=x=U=U=void 0;u=k.vertices;p=k.colors;v=u.length;t=p.length;y=k.__vertexArray;z=k.__colorArray;L=k.__dirtyColors;if(k.__dirtyVertices){for(U= +0;U1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=m;c.v=k;return c}}; THREE.ColorUtils.__hsv={h:0,s:0,v:0}; -THREE.GeometryUtils={merge:function(b,c){var e,f,h=b.vertices.length,k=c instanceof THREE.Mesh?c.geometry:c,m=b.vertices,n=k.vertices,t=b.faces,u=k.faces,w=b.faceVertexUvs[0],k=k.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var o=0,x=n.length;o1&&(f=1-f,h=1-h);k=1-f-h;m.copy(b);m.multiplyScalar(f);n.copy(c);n.multiplyScalar(h);m.addSelf(n);n.copy(e);n.multiplyScalar(k);m.addSelf(n);return m},randomPointInFace:function(b,c,e){var f,h,k;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,h=c.vertices[b.b].position,k=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,h,k);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;h=c.vertices[b.b].position;k=c.vertices[b.c].position;var c=c.vertices[b.d].position, -m;e?b._area1&&b._area2?(e=b._area1,m=b._area2):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c),b._area1=e,b._area2=m):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c));return THREE.GeometryUtils.random()*(e+m) -b?c(e,k-1):u[k] +b?c(e,h-1):t[h]0)n=f-1;else{n=f;break}f=n;if(e[f]==k)return f/(h-1);m=e[f];return e=(f+(k-m)/(e[f+1]-m))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)}; +THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,h=e.length,k;k=c?c:b*e[h-1];time=Date.now();for(var m=0,n=h-1,p;m<=n;)if(f=Math.floor(m+(n-m)/2),p=e[f]-k,p<0)m=f+1;else if(p>0)n=f-1;else{n=f;break}f=n;if(e[f]==k)return f/(h-1);m=e[f];return e=(f+(k-m)/(e[f+1]-m))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)}; THREE.Curve.prototype.getTangent=function(b){var c=b-1.0E-4;b+=1.0E-4;c<0&&(c=0);b>1&&(b=1);var c=this.getPoint(c),b=this.getPoint(b),e=new THREE.Vector2;e.sub(b,c);return e.unit()};THREE.LineCurve=function(b,c){b instanceof THREE.Vector2?(this.v1=b,this.v2=c):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(b,c,e,f){this.constructor(new THREE.Vector2(b,c),new THREE.Vector2(e,f))};THREE.LineCurve.prototype=new THREE.Curve; THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2;c.sub(this.v2,this.v1);c.multiplyScalar(b).addSelf(this.v1);return c};THREE.LineCurve.prototype.getPointAt=function(b){return this.getPoint(b)};THREE.LineCurve.prototype.getTangent=function(){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.normalize();return b}; THREE.QuadraticBezierCurve=function(b,c,e){if(!(c instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),b=new THREE.Vector2(f[0],f[1]),c=new THREE.Vector2(f[2],f[3]),e=new THREE.Vector2(f[4],f[5]);this.v0=b;this.v1=c;this.v2=e};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; @@ -395,47 +395,47 @@ THREE.SplineCurve3=THREE.Curve.create(function(b){this.points=b},function(b){var THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(b){this.curves.push(b)};THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){}; THREE.CurvePath.prototype.getPoint=function(b){for(var c=b*this.getLength(),e=this.getCurveLengths(),b=0;b=c)return c=e[b]-c,b=this.curves[b],c=1-c/b.getLength(),b.getPointAt(c);b++}return null};THREE.CurvePath.prototype.getLength=function(){var b=this.getCurveLengths();return b[b.length-1]}; THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var b=[],c=0,e,f=this.curves.length;for(e=0;ec)c=k.x;else if(k.xe)e=k.y;else if(k.yc)c=k.x;else if(k.xe)e=k.y;else if(k.y0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b2(z,v,o,n),z=THREE.Shape.Utils.b2(z,A,x, -t),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];t=k[5];o=k[0];x=k[1];u=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b3(z,v,o,u,n),z=THREE.Shape.Utils.b3(z,A,x,w,t),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];z=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m); -for(m=1;m<=z;m++)e.push(k.getPointAt(m/z));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];t=k[1];u=k[2];o=k[3];z=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);A=z-o;var y=b*2;for(m=1;m<=y;m++)z=m/y,x||(z=1-z),z=o+z*A,k=w+n+u*Math.cos(z),z=v+t+u*Math.sin(z),e.push(new THREE.Vector2(k,z))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)}; -THREE.Path.prototype.nltransform=function(b,c,e,f,h,k){var m=this.getPoints(),n,t,u,w,o;n=0;for(t=m.length;n0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b2(z,v,u,n),z=THREE.Shape.Utils.b2(z,A,x, +p),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];p=k[5];u=k[0];x=k[1];t=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b3(z,v,u,t,n),z=THREE.Shape.Utils.b3(z,A,x,w,p),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];z=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m); +for(m=1;m<=z;m++)e.push(k.getPointAt(m/z));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];p=k[1];t=k[2];u=k[3];z=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);A=z-u;var y=b*2;for(m=1;m<=y;m++)z=m/y,x||(z=1-z),z=u+z*A,k=w+n+t*Math.cos(z),z=v+p+t*Math.sin(z),e.push(new THREE.Vector2(k,z))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)}; +THREE.Path.prototype.nltransform=function(b,c,e,f,h,k){var m=this.getPoints(),n,p,t,w,u;n=0;for(p=m.length;n=0?n-1:e.length-1;k=m-1>=0?m-1:u.length-1;var z=[u[m],e[n],e[h]];o=THREE.FontUtils.Triangulate.area(z);var y=[u[m],u[k],e[n]];x=THREE.FontUtils.Triangulate.area(y);v=n;w=m;n+=1;m+=-1;n< -0&&(n+=e.length);n%=e.length;m<0&&(m+=u.length);m%=u.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:u.length-1;z=[u[m],e[n],e[h]];z=THREE.FontUtils.Triangulate.area(z);y=[u[m],u[k],e[n]];y=THREE.FontUtils.Triangulate.area(y);o+x>z+y&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=u.length),m%=u.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:u.length-1);o=e.slice(0,n);x=e.slice(n);v=u.slice(m);w=u.slice(0,m);k=[u[m],u[k],e[n]];A.push([u[m],e[n],e[h]]);A.push(k);e=o.concat(v).concat(w).concat(x)}return{shape:e, -isolatedPts:A,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,t,u={};k=0;for(m=f.length;k=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;var z=[t[m],e[n],e[h]];u=THREE.FontUtils.Triangulate.area(z);var y=[t[m],t[k],e[n]];x=THREE.FontUtils.Triangulate.area(y);v=n;w=m;n+=1;m+=-1;n< +0&&(n+=e.length);n%=e.length;m<0&&(m+=t.length);m%=t.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;z=[t[m],e[n],e[h]];z=THREE.FontUtils.Triangulate.area(z);y=[t[m],t[k],e[n]];y=THREE.FontUtils.Triangulate.area(y);u+x>z+y&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=t.length),m%=t.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:t.length-1);u=e.slice(0,n);x=e.slice(n);v=t.slice(m);w=t.slice(0,m);k=[t[m],t[k],e[n]];A.push([t[m],e[n],e[h]]);A.push(k);e=u.concat(v).concat(w).concat(x)}return{shape:e, +isolatedPts:A,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,p,t={};k=0;for(m=f.length;k1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= +THREE.Animation.prototype.update=function(b){if(this.isPlaying){var c=["pos","rot","scl"],e,f,h,k,m,n,p,t,w=this.data.JIT.hierarchy,u,x;this.currentTime+=b*this.timeScale;x=this.currentTime;u=this.currentTime%=this.data.length;t=parseInt(Math.min(u*this.data.fps,this.data.length*this.data.fps),10);for(var v=0,A=this.hierarchy.length;v1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= this.getPrevKeyWith("pos",v,m.index-1).pos,this.points[1]=h,this.points[2]=k,this.points[3]=this.getNextKeyWith("pos",v,n.index+1).pos,f=f*0.33+0.33,h=this.interpolateCatmullRom(this.points,f),e.x=h[0],e.y=h[1],e.z=h[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e=== -"rot")THREE.Quaternion.slerp(h,k,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f}}if(this.JITCompile&&w[0][u]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;vb.length-2?k:k+1;e[3]=k>b.length-3?k:k+2;k=b[e[0]];n=b[e[1]];t=b[e[2]];u=b[e[3]];e=h*h;m=h*e;f[0]=this.interpolate(k[0],n[0],t[0],u[0],h,e,m);f[1]=this.interpolate(k[1],n[1],t[1],u[1],h,e,m);f[2]=this.interpolate(k[2],n[2],t[2],u[2],h,e,m);return f}; +"rot")THREE.Quaternion.slerp(h,k,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f}}if(this.JITCompile&&w[0][t]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;vb.length-2?k:k+1;e[3]=k>b.length-3?k:k+2;k=b[e[0]];n=b[e[1]];p=b[e[2]];t=b[e[3]];e=h*h;m=h*e;f[0]=this.interpolate(k[0],n[0],p[0],t[0],h,e,m);f[1]=this.interpolate(k[1],n[1],p[1],t[1],h,e,m);f[2]=this.interpolate(k[2],n[2],p[2],t[2],h,e,m);return f}; THREE.Animation.prototype.interpolate=function(b,c,e,f,h,k,m){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*m+(-3*(c-e)-2*b-f)*k+b*h+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,e){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e=e0?e:0:e>=0?e:e+f.length;e>=0;e--)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[f.length-1]}; THREE.CubeCamera=function(b,c,e,f){this.heightOffset=e;this.position=new THREE.Vector3(0,e,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position= @@ -454,8 +454,8 @@ function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!0;break;case 37: this.object.translateX(e);this.moveUp&&this.object.translateY(e);this.moveDown&&this.object.translateY(-e);e=b*this.lookSpeed;this.activeLook||(e=0);this.lon+=this.mouseX*e;this.lookVertical&&(this.lat-=this.mouseY*e);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target,c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta)}b= 1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*e;this.lookVertical&&(this.lat-=this.mouseY*e*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);b=this.target;c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)* Math.sin(this.theta);this.object.lookAt(b)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",e(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",e(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",e(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",e(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",e(this,this.onKeyUp),!1)}; -THREE.PathControls=function(b,c){function e(b){if((b*=2)<1)return 0.5*b*b;return-0.5*(--b*(b-2)-1)}function f(b,e){return function(){e.apply(b,arguments)}}function h(b,e,c,f){var k={name:c,fps:0.6,length:f,hierarchy:[]},h,m=e.getControlPointsArray(),n=e.getLength(),y=m.length,E=0;h=y-1;e={parent:-1,keys:[]};e.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};e.keys[h]={time:f,pos:m[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h=0?b:b+m;c=this.verticalAngleMap.srcRange; b=this.verticalAngleMap.dstRange;c=THREE.Math.mapLinear(this.phi,c[0],c[1],b[0],b[1]);var f=b[1]-b[0];this.phi=e((c-b[0])/f)*f+b[0];c=this.horizontalAngleMap.srcRange;b=this.horizontalAngleMap.dstRange;c=THREE.Math.mapLinear(this.theta,c[0],c[1],b[0],b[1]);f=b[1]-b[0];this.theta=e((c-b[0])/f)*f+b[0];b=this.target.position;b.x=100*Math.sin(this.phi)*Math.cos(this.theta);b.y=100*Math.cos(this.phi);b.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= @@ -472,200 +472,200 @@ THREE.FlyControls=function(b,c){function e(b,e){return function(){e.apply(b,argu this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var b=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z= -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",e(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",e(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",e(this, this.mouseup),!1);this.domElement.addEventListener("keydown",e(this,this.keydown),!1);this.domElement.addEventListener("keyup",e(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(b,c){this.object=b;this.domElement=c!==void 0?c:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Matrix4,m=!1,n=1,t=0,u=0,w=0,o=0,x=0,v=window.innerWidth/2,A=window.innerHeight/2;this.update=function(b){b*=0.0010;if(this.mouseLook){var c= -b*this.lookSpeed;this.rotateHorizontally(c*o);this.rotateVertically(c*x)}c=b*this.movementSpeed;this.object.translateZ(-c*(t>0||this.autoForward&&!(t<0)?1:t));this.object.translateX(c*u);this.object.translateY(c*w);m&&(this.roll+=this.rollSpeed*b*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y0||this.autoForward&&!(p<0)?1:p));this.object.translateX(c*t);this.object.translateY(c*w);m&&(this.roll+=this.rollSpeed*b*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y1?c.normalize():c.z=Math.sqrt(1-f*f);k.copy(this.object.position).subSelf(this.target);f=this.object.up.clone().setLength(c.y);f.addSelf(this.object.up.clone().crossSelf(k).setLength(c.x));f.addSelf(k.setLength(c.z));return f};this.rotateCamera=function(){var b=Math.acos(m.dot(n)/m.length()/n.length());if(b){var e=(new THREE.Vector3).cross(m,n).normalize(),c=new THREE.Quaternion;b*=this.rotateSpeed;c.setFromAxisAngle(e, --b);c.multiplyVector3(k);c.multiplyVector3(this.object.up);c.multiplyVector3(n);this.staticMoving?m=n:(c.setFromAxisAngle(e,b*(this.dynamicDampingFactor-1)),c.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(u.y-t.y)*this.zoomSpeed;b!==1&&b>0&&(k.multiplyScalar(b),this.staticMoving?t=u:t.y+=(u.y-t.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=o.clone().subSelf(w);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var e=k.clone().crossSelf(this.object.up).setLength(b.x); -e.addSelf(this.object.up.clone().setLength(b.y));this.object.position.addSelf(e);this.target.addSelf(e);this.staticMoving?w=o:w.addSelf(b.sub(o,w).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()0&&(k.multiplyScalar(b),this.staticMoving?p=t:p.y+=(t.y-p.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=u.clone().subSelf(w);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var e=k.clone().crossSelf(this.object.up).setLength(b.x); +e.addSelf(this.object.up.clone().setLength(b.y));this.object.position.addSelf(e);this.target.addSelf(e);this.staticMoving?w=u:w.addSelf(b.sub(u,w).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;nb&&(b+=Math.PI*2),anglec=(e+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(h).addSelf(n).subSelf(b).clone()}function h(b){for(H=b.length;--H>=0;){ka=H;na=H-1;na<0&&(na=b.length- -1);for(var e=0,c=v+w*2,e=0;e=0;Q--){Z=Q/w;$=t*(1-Z);Z=u*Math.sin(Z*Math.PI/2);H=0;for(T=F.length;Hb&&(b+=Math.PI*2),anglec=(e+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function h(b){for(N=b.length;--N>=0;){la=N;oa=N-1;oa<0&&(oa=b.length- +1);for(var e=0,c=v+w*2,e=0;e=0;J--){$=J/w;Z=p*(1-$);$=t*Math.sin($*Math.PI/2);N=0;for(V=E.length;N0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,n,x)))-1);u.push(w)}c.push(u)}for(var v,A,z,h=c.length,e=0;e0)for(f=0;f1&&(v= -this.vertices[m].position.clone(),A=this.vertices[t].position.clone(),z=this.vertices[u].position.clone(),v.normalize(),A.normalize(),z.normalize(),this.faces.push(new THREE.Face3(m,t,u,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(A.x,A.y,A.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([w,o,y]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry; +THREE.SphereGeometry=function(b,c,e){THREE.Geometry.call(this);for(var b=b||50,f,h=Math.PI,k=Math.max(3,c||8),m=Math.max(2,e||6),c=[],e=0;e0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(u,n,x)))-1);t.push(w)}c.push(t)}for(var v,A,z,h=c.length,e=0;e0)for(f=0;f1&&(v= +this.vertices[m].position.clone(),A=this.vertices[p].position.clone(),z=this.vertices[t].position.clone(),v.normalize(),A.normalize(),z.normalize(),this.faces.push(new THREE.Face3(m,p,t,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(A.x,A.y,A.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([w,u,y]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry; THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry; THREE.TextGeometry=function(b,c){var e=(new THREE.TextPath(b,c)).toShapes();c.amount=c.height!==void 0?c.height:50;if(c.bevelThickness===void 0)c.bevelThickness=10;if(c.bevelSize===void 0)c.bevelSize=8;if(c.bevelEnabled===void 0)c.bevelEnabled=!1;if(c.bend){var f=e[e.length-1].getBoundingBox().maxX;c.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(f/2,120),new THREE.Vector2(f,0))}THREE.ExtrudeGeometry.call(this,e,c)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry; THREE.TextGeometry.prototype.constructor=THREE.TextGeometry; THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(b,c){return(new TextPath(b,c)).toShapes()},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var c= -this.getFace(),e=this.size/c.resolution,f=0,h=String(b).split(""),k=h.length,m=[],b=0;b0)for(u=0;u2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}t=u;h<=t&&(t=0);u=t+1;h<=u&&(u=0);w=u+1;h<=w&&(w=0);var x;a:{x=b;var v=t,A=u,z=w,y=h,E=m,F=void 0,C=void 0,G=void 0, -J=void 0,M=void 0,K=void 0,B=void 0,L=void 0,Y=void 0,C=x[E[v]].x,G=x[E[v]].y,J=x[E[A]].x,M=x[E[A]].y,K=x[E[z]].x,B=x[E[z]].y;if(1.0E-10>(J-C)*(B-G)-(M-G)*(K-C))x=!1;else{for(F=0;F=0&&Q>=0&&$>=0){x=!1;break a}}x= -!0}}if(x){k.push([b[m[t]],b[m[u]],b[m[w]]]);n.push([m[t],m[u],m[w]]);t=u;for(w=u+1;w0)for(t=0;t2;){if(u--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}p=t;h<=p&&(p=0);t=p+1;h<=t&&(t=0);w=t+1;h<=w&&(w=0);var x;a:{x=b;var v=p,A=t,z=w,y=h,D=m,E=void 0,C=void 0,G=void 0, +I=void 0,P=void 0,K=void 0,B=void 0,O=void 0,Y=void 0,C=x[D[v]].x,G=x[D[v]].y,I=x[D[A]].x,P=x[D[A]].y,K=x[D[z]].x,B=x[D[z]].y;if(1.0E-10>(I-C)*(B-G)-(P-G)*(K-C))x=!1;else{for(E=0;E=0&&J>=0&&Z>=0){x=!1;break a}}x= +!0}}if(x){k.push([b[m[p]],b[m[t]],b[m[w]]]);n.push([m[p],m[t],m[w]]);p=t;for(w=t+1;w0;)this.smooth(b)}; -THREE.SubdivisionModifier.prototype.smooth=function(b){function c(b,e,c,f,n,t){var v=new THREE.Face4(b,e,c,f,null,n.color,n.material);if(m.useOldVertexColors){v.vertexColors=[];for(var u,p,w,x=0;x<4;x++){w=t[x];u=new THREE.Color;u.setRGB(0,0,0);for(var y=0;y>7)-127;f|=(h&127)<<16|k<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,e){var c=w(b,e),f=w(b,e+1),k=w(b,e+2);return(w(b,e+3)<<24)+(k<<16)+(f<<8)+c}function t(b,e){var c=w(b,e);return(w(b,e+1)<<8)+c}function u(b,e){var c=w(b,e);return c>127?c-256:c}function w(b,e){return b.charCodeAt(e)&255}function o(e){var c, -f,k;c=h(b,e);f=h(b,e+M);k=h(b,e+K);e=t(b,e+B);E.faces.push(new THREE.Face3(c,f,k,null,null,E.materials[e]))}function x(e){var c,f,k,m,o,p;c=h(b,e);f=h(b,e+M);k=h(b,e+K);m=t(b,e+B);o=h(b,e+L);p=h(b,e+Y);e=h(b,e+H);m=E.materials[m];var u=G[p*3],v=G[p*3+1];p=G[p*3+2];var w=G[e*3],x=G[e*3+1],e=G[e*3+2];E.faces.push(new THREE.Face3(c,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(u,v,p),new THREE.Vector3(w,x,e)],null,m))}function v(e){var c,f,k,m;c=h(b,e);f=h(b,e+T);k=h(b,e+Q);m=h(b, -e+Z);e=t(b,e+$);E.faces.push(new THREE.Face4(c,f,k,m,null,null,E.materials[e]))}function A(e){var c,f,k,m,o,u,v,w;c=h(b,e);f=h(b,e+T);k=h(b,e+Q);m=h(b,e+Z);o=t(b,e+$);u=h(b,e+P);v=h(b,e+p);w=h(b,e+V);e=h(b,e+fa);o=E.materials[o];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var S=G[w*3],z=G[w*3+1];w=G[w*3+2];var A=G[e*3],B=G[e*3+1],e=G[e*3+2];E.faces.push(new THREE.Face4(c,f,k,m,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(S,z,w),new THREE.Vector3(A,B,e)],null,o))} -function z(e){var c,f,k,m;c=h(b,e);f=h(b,e+ea);k=h(b,e+ha);e=J[c*2];m=J[c*2+1];c=J[f*2];var o=E.faceVertexUvs[0];f=J[f*2+1];var p=J[k*2];k=J[k*2+1];var t=[];t.push(new THREE.UV(e,m));t.push(new THREE.UV(c,f));t.push(new THREE.UV(p,k));o.push(t)}function y(e){var c,f,k,m,o,p;c=h(b,e);f=h(b,e+ga);k=h(b,e+ka);m=h(b,e+na);e=J[c*2];o=J[c*2+1];c=J[f*2];p=J[f*2+1];f=J[k*2];var t=E.faceVertexUvs[0];k=J[k*2+1];var u=J[m*2];m=J[m*2+1];var v=[];v.push(new THREE.UV(e,o));v.push(new THREE.UV(c,p));v.push(new THREE.UV(f, -k));v.push(new THREE.UV(u,m));t.push(v)}var E=this,F=0,C,G=[],J=[],M,K,B,L,Y,H,T,Q,Z,$,P,p,V,fa,ea,ha,ga,ka,na,aa,W,U,ia,ja,ta;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(E,f,e);C={signature:b.substr(F,8),header_bytes:w(b,F+8),vertex_coordinate_bytes:w(b,F+9),normal_coordinate_bytes:w(b,F+10),uv_coordinate_bytes:w(b,F+11),vertex_index_bytes:w(b,F+12),normal_index_bytes:w(b,F+13),uv_index_bytes:w(b,F+14),material_index_bytes:w(b,F+15),nvertices:h(b,F+16),nnormals:h(b,F+16+4),nuvs:h(b, -F+16+8),ntri_flat:h(b,F+16+12),ntri_smooth:h(b,F+16+16),ntri_flat_uv:h(b,F+16+20),ntri_smooth_uv:h(b,F+16+24),nquad_flat:h(b,F+16+28),nquad_smooth:h(b,F+16+32),nquad_flat_uv:h(b,F+16+36),nquad_smooth_uv:h(b,F+16+40)};F+=C.header_bytes;M=C.vertex_index_bytes;K=C.vertex_index_bytes*2;B=C.vertex_index_bytes*3;L=C.vertex_index_bytes*3+C.material_index_bytes;Y=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;H=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;T=C.vertex_index_bytes; -Q=C.vertex_index_bytes*2;Z=C.vertex_index_bytes*3;$=C.vertex_index_bytes*4;P=C.vertex_index_bytes*4+C.material_index_bytes;p=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;V=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;fa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;ea=C.uv_index_bytes;ha=C.uv_index_bytes*2;ga=C.uv_index_bytes;ka=C.uv_index_bytes*2;na=C.uv_index_bytes*3;e=C.vertex_index_bytes*3+C.material_index_bytes;ta=C.vertex_index_bytes* -4+C.material_index_bytes;aa=C.ntri_flat*e;W=C.ntri_smooth*(e+C.normal_index_bytes*3);U=C.ntri_flat_uv*(e+C.uv_index_bytes*3);ia=C.ntri_smooth_uv*(e+C.normal_index_bytes*3+C.uv_index_bytes*3);ja=C.nquad_flat*ta;e=C.nquad_smooth*(ta+C.normal_index_bytes*4);ta=C.nquad_flat_uv*(ta+C.uv_index_bytes*4);F+=function(e){for(var f,k,h,n=C.vertex_coordinate_bytes*3,o=e+C.nvertices*n;e>7)-127;f|=(k&127)<<16|h<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,e){var c=w(b,e),f=w(b,e+1),k=w(b,e+2);return(w(b,e+3)<<24)+(k<<16)+(f<<8)+c}function p(b,e){var c=w(b,e);return(w(b,e+1)<<8)+c}function t(b,e){var c=w(b,e);return c>127?c-256:c}function w(b,e){return b.charCodeAt(e)&255}function u(e){var c, +f,k;c=h(b,e);f=h(b,e+P);k=h(b,e+K);e=p(b,e+B);D.faces.push(new THREE.Face3(c,f,k,null,null,D.materials[e]))}function x(e){var c,f,k,m,o,t;c=h(b,e);f=h(b,e+P);k=h(b,e+K);m=p(b,e+B);o=h(b,e+O);t=h(b,e+Y);e=h(b,e+N);m=D.materials[m];var u=G[t*3],v=G[t*3+1];t=G[t*3+2];var w=G[e*3],x=G[e*3+1],e=G[e*3+2];D.faces.push(new THREE.Face3(c,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(u,v,t),new THREE.Vector3(w,x,e)],null,m))}function v(e){var c,f,k,m;c=h(b,e);f=h(b,e+V);k=h(b,e+J);m=h(b, +e+$);e=p(b,e+Z);D.faces.push(new THREE.Face4(c,f,k,m,null,null,D.materials[e]))}function A(e){var c,f,k,m,t,u,v,w;c=h(b,e);f=h(b,e+V);k=h(b,e+J);m=h(b,e+$);t=p(b,e+Z);u=h(b,e+Q);v=h(b,e+o);w=h(b,e+R);e=h(b,e+fa);t=D.materials[t];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var U=G[w*3],L=G[w*3+1];w=G[w*3+2];var z=G[e*3],A=G[e*3+1],e=G[e*3+2];D.faces.push(new THREE.Face4(c,f,k,m,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(U,L,w),new THREE.Vector3(z,A,e)],null,t))} +function z(e){var c,f,k,m;c=h(b,e);f=h(b,e+ea);k=h(b,e+ha);e=I[c*2];m=I[c*2+1];c=I[f*2];var o=D.faceVertexUvs[0];f=I[f*2+1];var p=I[k*2];k=I[k*2+1];var t=[];t.push(new THREE.UV(e,m));t.push(new THREE.UV(c,f));t.push(new THREE.UV(p,k));o.push(t)}function y(e){var c,f,k,m,o,p;c=h(b,e);f=h(b,e+ga);k=h(b,e+la);m=h(b,e+oa);e=I[c*2];o=I[c*2+1];c=I[f*2];p=I[f*2+1];f=I[k*2];var t=D.faceVertexUvs[0];k=I[k*2+1];var u=I[m*2];m=I[m*2+1];var v=[];v.push(new THREE.UV(e,o));v.push(new THREE.UV(c,p));v.push(new THREE.UV(f, +k));v.push(new THREE.UV(u,m));t.push(v)}var D=this,E=0,C,G=[],I=[],P,K,B,O,Y,N,V,J,$,Z,Q,o,R,fa,ea,ha,ga,la,oa,aa,T,X,ia,ja,sa;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(D,f,e);C={signature:b.substr(E,8),header_bytes:w(b,E+8),vertex_coordinate_bytes:w(b,E+9),normal_coordinate_bytes:w(b,E+10),uv_coordinate_bytes:w(b,E+11),vertex_index_bytes:w(b,E+12),normal_index_bytes:w(b,E+13),uv_index_bytes:w(b,E+14),material_index_bytes:w(b,E+15),nvertices:h(b,E+16),nnormals:h(b,E+16+4),nuvs:h(b, +E+16+8),ntri_flat:h(b,E+16+12),ntri_smooth:h(b,E+16+16),ntri_flat_uv:h(b,E+16+20),ntri_smooth_uv:h(b,E+16+24),nquad_flat:h(b,E+16+28),nquad_smooth:h(b,E+16+32),nquad_flat_uv:h(b,E+16+36),nquad_smooth_uv:h(b,E+16+40)};E+=C.header_bytes;P=C.vertex_index_bytes;K=C.vertex_index_bytes*2;B=C.vertex_index_bytes*3;O=C.vertex_index_bytes*3+C.material_index_bytes;Y=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;N=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;V=C.vertex_index_bytes; +J=C.vertex_index_bytes*2;$=C.vertex_index_bytes*3;Z=C.vertex_index_bytes*4;Q=C.vertex_index_bytes*4+C.material_index_bytes;o=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;R=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;fa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;ea=C.uv_index_bytes;ha=C.uv_index_bytes*2;ga=C.uv_index_bytes;la=C.uv_index_bytes*2;oa=C.uv_index_bytes*3;e=C.vertex_index_bytes*3+C.material_index_bytes;sa=C.vertex_index_bytes* +4+C.material_index_bytes;aa=C.ntri_flat*e;T=C.ntri_smooth*(e+C.normal_index_bytes*3);X=C.ntri_flat_uv*(e+C.uv_index_bytes*3);ia=C.ntri_smooth_uv*(e+C.normal_index_bytes*3+C.uv_index_bytes*3);ja=C.nquad_flat*sa;e=C.nquad_smooth*(sa+C.normal_index_bytes*4);sa=C.nquad_flat_uv*(sa+C.uv_index_bytes*4);E+=function(e){for(var f,h,k,n=C.vertex_coordinate_bytes*3,o=e+C.nvertices*n;e=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];for(y=0;y1){o=new THREE.MeshFaceMaterial;for(j=0;j1?c[1].substr(0,e):"0";c[1].length=0,m=k.indexOf("(")>=0,n;if(h)f=k.split("."),k=f.shift(),f.shift();else if(m){n=k.split("(");k=n.shift(); -for(f=0;fe){u=t.output[p];break}m=u!==void 0?u instanceof THREE.Matrix4? -m.multiply(m,u):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);e=m;c.push({time:b,pos:[e.n14,e.n24,e.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=c}this.updateMatrix();return this};o.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];for(y=0;y1){o=new THREE.MeshFaceMaterial;for(j=0;j1?c[1].substr(0,e):"0";c[1].length=0,m=h.indexOf("(")>=0,n;if(k)f=h.split("."),h=f.shift(),f.shift();else if(m){n=h.split("(");h=n.shift(); +for(f=0;fe){t=p.output[o];break}m=t!==void 0?t instanceof THREE.Matrix4? +m.multiply(m,t):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);e=m;c.push({time:b,pos:[e.n14,e.n24,e.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=c}this.updateMatrix();return this};u.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b0&&(this[c.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};Y.prototype.create=function(){var b={},e=this.transparency!==void 0&&this.transparency<1,c;for(c in this)switch(c){case "ambient":case "emission":case "diffuse":case "specular":var f=this[c];if(f instanceof L)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=la[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ga+f.init_from), -b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else c=="diffuse"?b.color=f.color.getHex():e||(b[c]=f.color.getHex());break;case "shininess":case "reflectivity":b[c]=this[c];break;case "transparency":if(e)b.transparent=!0,b.opacity=this[c],e=!0}b.shading=za;return this.material=new THREE.MeshLambertMaterial(b)};H.prototype.parse=function(b){for(var e=0;e=0,f=b.indexOf("(")>=0,k,h;if(c)e=b.split("."),b=e.shift(),h=e.shift();else if(f){k=b.split("(");b=k.shift();for(e=0;e0&&(this[c.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};Y.prototype.create=function(){var b={},e=this.transparency!==void 0&&this.transparency<1,c;for(c in this)switch(c){case "ambient":case "emission":case "diffuse":case "specular":var f=this[c];if(f instanceof O)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=ma[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ga+f.init_from), +b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else c=="diffuse"?b.color=f.color.getHex():e||(b[c]=f.color.getHex());break;case "shininess":case "reflectivity":b[c]=this[c];break;case "transparency":if(e)b.transparent=!0,b.opacity=this[c],e=!0}b.shading=za;return this.material=new THREE.MeshLambertMaterial(b)};N.prototype.parse=function(b){for(var e=0;e=0,f=b.indexOf("(")>=0,h,k;if(c)e=b.split("."),b=e.shift(),k=e.shift();else if(f){h=b.split("(");b=h.shift();for(e=0;e1&&(Y=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(M,Y);object.name=v;object.position.set(C[0],C[1],C[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=F.visible;V.scene.add(object);V.objects[v]=object;F.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),V.scene.collisions.colliders.push(b)); -if(F.castsShadow)b=new THREE.ShadowVolume(M),V.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}}else C=F.position,r=F.rotation,q=F.quaternion,s=F.scale,q=0,object=new THREE.Object3D,object.name=v,object.position.set(C[0],C[1],C[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0], -s[1],s[2]),object.visible=F.visible!==void 0?F.visible:!1,V.scene.add(object),V.objects[v]=object,V.empties[v]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},V.triggers[object.name]=b)}function t(b){return function(c){V.geometries[b]=c;n();Z-=1;e.onLoadComplete();w()}}function u(b){return function(e){V.geometries[b]=e}}function w(){e.callbackProgress({totalModels:P,totalTextures:p,loadedModels:P-Z,loadedTextures:p-$},V);e.onLoadProgress();Z==0&&$==0&&c(V)}var o,x, -v,A,z,y,E,F,C,G,J,M,K,B,L,Y,H,T,Q,Z,$,P,p,V;T=b.data;L=new THREE.BinaryLoader;Q=new THREE.JSONLoader;$=Z=0;V={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in T.objects)if(F=T.objects[v],F.meshCollider){b=!0;break}if(b)V.scene.collisions=new THREE.CollisionSystem;if(T.transform){b=T.transform.position;G=T.transform.rotation;var fa=T.transform.scale;b&&V.scene.position.set(b[0],b[1],b[2]);G&&V.scene.rotation.set(G[0], -G[1],G[2]);fa&&V.scene.scale.set(fa[0],fa[1],fa[2]);(b||G||fa)&&V.scene.updateMatrix()}b=function(){$-=1;w();e.onLoadComplete()};for(z in T.cameras)G=T.cameras[z],G.type=="perspective"?K=new THREE.PerspectiveCamera(G.fov,G.aspect,G.near,G.far):G.type=="ortho"&&(K=new THREE.OrthographicCamera(G.left,G.right,G.top,G.bottom,G.near,G.far)),C=G.position,G=G.target,K.position.set(C[0],C[1],C[2]),K.target=new THREE.Vector3(G[0],G[1],G[2]),V.cameras[z]=K;for(A in T.lights)z=T.lights[A],K=z.color!==void 0? -z.color:16777215,G=z.intensity!==void 0?z.intensity:1,z.type=="directional"?(C=z.direction,H=new THREE.DirectionalLight(K,G),H.position.set(C[0],C[1],C[2]),H.position.normalize()):z.type=="point"?(C=z.position,d=z.distance,H=new THREE.PointLight(K,G,d),H.position.set(C[0],C[1],C[2])):z.type=="ambient"&&(H=new THREE.AmbientLight(K)),V.scene.add(H),V.lights[A]=H;for(y in T.fogs)A=T.fogs[y],A.type=="linear"?B=new THREE.Fog(0,A.near,A.far):A.type=="exp2"&&(B=new THREE.FogExp2(0,A.density)),G=A.color, -B.color.setRGB(G[0],G[1],G[2]),V.fogs[y]=B;if(V.cameras&&T.defaults.camera)V.currentCamera=V.cameras[T.defaults.camera];if(V.fogs&&T.defaults.fog)V.scene.fog=V.fogs[T.defaults.fog];G=T.defaults.bgcolor;V.bgColor=new THREE.Color;V.bgColor.setRGB(G[0],G[1],G[2]);V.bgColorAlpha=T.defaults.bgalpha;for(o in T.geometries)if(y=T.geometries[o],y.type=="bin_mesh"||y.type=="ascii_mesh")Z+=1,e.onLoadStart();P=Z;for(o in T.geometries)y=T.geometries[o],y.type=="cube"?(M=new THREE.CubeGeometry(y.width,y.height, -y.depth,y.segmentsWidth,y.segmentsHeight,y.segmentsDepth,null,y.flipped,y.sides),V.geometries[o]=M):y.type=="plane"?(M=new THREE.PlaneGeometry(y.width,y.height,y.segmentsWidth,y.segmentsHeight),V.geometries[o]=M):y.type=="sphere"?(M=new THREE.SphereGeometry(y.radius,y.segmentsWidth,y.segmentsHeight),V.geometries[o]=M):y.type=="cylinder"?(M=new THREE.CylinderGeometry(y.topRad,y.botRad,y.height,y.radSegs,y.heightSegs),V.geometries[o]=M):y.type=="torus"?(M=new THREE.TorusGeometry(y.radius,y.tube,y.segmentsR, -y.segmentsT),V.geometries[o]=M):y.type=="icosahedron"?(M=new THREE.IcosahedronGeometry(y.subdivisions),V.geometries[o]=M):y.type=="bin_mesh"?L.load({model:f(y.url,T.urlBaseType),callback:t(o)}):y.type=="ascii_mesh"?Q.load({model:f(y.url,T.urlBaseType),callback:t(o)}):y.type=="embedded_mesh"&&(y=T.embeds[y.id])&&Q.createModel(y,u(o),"");for(E in T.textures)if(o=T.textures[E],o.url instanceof Array){$+=o.url.length;for(L=0;L1&&(Y=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(P,Y);object.name=v;object.position.set(C[0],C[1],C[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=E.visible;R.scene.add(object);R.objects[v]=object;E.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),R.scene.collisions.colliders.push(b)); +if(E.castsShadow)b=new THREE.ShadowVolume(P),R.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},R.triggers[object.name]=b)}}else C=E.position,r=E.rotation,q=E.quaternion,s=E.scale,q=0,object=new THREE.Object3D,object.name=v,object.position.set(C[0],C[1],C[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0], +s[1],s[2]),object.visible=E.visible!==void 0?E.visible:!1,R.scene.add(object),R.objects[v]=object,R.empties[v]=object,E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},R.triggers[object.name]=b)}function p(b){return function(c){R.geometries[b]=c;n();$-=1;e.onLoadComplete();w()}}function t(b){return function(e){R.geometries[b]=e}}function w(){e.callbackProgress({totalModels:Q,totalTextures:o,loadedModels:Q-$,loadedTextures:o-Z},R);e.onLoadProgress();$==0&&Z==0&&c(R)}var u,x, +v,A,z,y,D,E,C,G,I,P,K,B,O,Y,N,V,J,$,Z,Q,o,R;V=b.data;O=new THREE.BinaryLoader;J=new THREE.JSONLoader;Z=$=0;R={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in V.objects)if(E=V.objects[v],E.meshCollider){b=!0;break}if(b)R.scene.collisions=new THREE.CollisionSystem;if(V.transform){b=V.transform.position;G=V.transform.rotation;var fa=V.transform.scale;b&&R.scene.position.set(b[0],b[1],b[2]);G&&R.scene.rotation.set(G[0], +G[1],G[2]);fa&&R.scene.scale.set(fa[0],fa[1],fa[2]);(b||G||fa)&&R.scene.updateMatrix()}b=function(){Z-=1;w();e.onLoadComplete()};for(z in V.cameras)G=V.cameras[z],G.type=="perspective"?K=new THREE.PerspectiveCamera(G.fov,G.aspect,G.near,G.far):G.type=="ortho"&&(K=new THREE.OrthographicCamera(G.left,G.right,G.top,G.bottom,G.near,G.far)),C=G.position,G=G.target,K.position.set(C[0],C[1],C[2]),K.target=new THREE.Vector3(G[0],G[1],G[2]),R.cameras[z]=K;for(A in V.lights)z=V.lights[A],K=z.color!==void 0? +z.color:16777215,G=z.intensity!==void 0?z.intensity:1,z.type=="directional"?(C=z.direction,N=new THREE.DirectionalLight(K,G),N.position.set(C[0],C[1],C[2]),N.position.normalize()):z.type=="point"?(C=z.position,d=z.distance,N=new THREE.PointLight(K,G,d),N.position.set(C[0],C[1],C[2])):z.type=="ambient"&&(N=new THREE.AmbientLight(K)),R.scene.add(N),R.lights[A]=N;for(y in V.fogs)A=V.fogs[y],A.type=="linear"?B=new THREE.Fog(0,A.near,A.far):A.type=="exp2"&&(B=new THREE.FogExp2(0,A.density)),G=A.color, +B.color.setRGB(G[0],G[1],G[2]),R.fogs[y]=B;if(R.cameras&&V.defaults.camera)R.currentCamera=R.cameras[V.defaults.camera];if(R.fogs&&V.defaults.fog)R.scene.fog=R.fogs[V.defaults.fog];G=V.defaults.bgcolor;R.bgColor=new THREE.Color;R.bgColor.setRGB(G[0],G[1],G[2]);R.bgColorAlpha=V.defaults.bgalpha;for(u in V.geometries)if(y=V.geometries[u],y.type=="bin_mesh"||y.type=="ascii_mesh")$+=1,e.onLoadStart();Q=$;for(u in V.geometries)y=V.geometries[u],y.type=="cube"?(P=new THREE.CubeGeometry(y.width,y.height, +y.depth,y.segmentsWidth,y.segmentsHeight,y.segmentsDepth,null,y.flipped,y.sides),R.geometries[u]=P):y.type=="plane"?(P=new THREE.PlaneGeometry(y.width,y.height,y.segmentsWidth,y.segmentsHeight),R.geometries[u]=P):y.type=="sphere"?(P=new THREE.SphereGeometry(y.radius,y.segmentsWidth,y.segmentsHeight),R.geometries[u]=P):y.type=="cylinder"?(P=new THREE.CylinderGeometry(y.topRad,y.botRad,y.height,y.radSegs,y.heightSegs),R.geometries[u]=P):y.type=="torus"?(P=new THREE.TorusGeometry(y.radius,y.tube,y.segmentsR, +y.segmentsT),R.geometries[u]=P):y.type=="icosahedron"?(P=new THREE.IcosahedronGeometry(y.subdivisions),R.geometries[u]=P):y.type=="bin_mesh"?O.load({model:f(y.url,V.urlBaseType),callback:p(u)}):y.type=="ascii_mesh"?J.load({model:f(y.url,V.urlBaseType),callback:p(u)}):y.type=="embedded_mesh"&&(y=V.embeds[y.id])&&J.createModel(y,t(u),"");for(D in V.textures)if(u=V.textures[D],u.url instanceof Array){Z+=u.url.length;for(O=0;O=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,h=0;h<8;h++){for(var k=0,m=0;m>1^-(n&1);e[8*m+h]=k}f+=c}c=b.length-f;k=new Uint16Array(c);for(h=m=0;h=this.maxCount-3&&n(this)};this.begin=function(){this.count=0; -this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(t=this.size-1);var x=Math.floor(u-n);x<1&&(x=1);u=Math.floor(u+n);u>this.size-1&&(u=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size- -1);for(var A,z,y,E,F,C;o0&&(this.field[y+A]+=E)}}};this.addPlaneX=function(b,c){var h,k,m,n,t,u=this.size,w=this.yd,o=this.zd,x=this.field,v=u*Math.sqrt(b/c);v>u&&(v=u);for(h=0;h0)for(k=0;kw&&(A=w);for(k=0;k0){t=k*o;for(h=0;hsize&&(dist=size);for(m=0;m0){t=zd*m;for(k=0;k=this.maxCount-3&&n(this)};this.begin=function(){this.count=0; +this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(p=this.size-1);var x=Math.floor(t-n);x<1&&(x=1);t=Math.floor(t+n);t>this.size-1&&(t=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size- +1);for(var A,z,y,D,E,C;u0&&(this.field[y+A]+=D)}}};this.addPlaneX=function(b,c){var h,k,m,n,p,t=this.size,w=this.yd,u=this.zd,x=this.field,v=t*Math.sqrt(b/c);v>t&&(v=t);for(h=0;h0)for(k=0;kw&&(A=w);for(k=0;k0){p=k*u;for(h=0;hsize&&(dist=size);for(m=0;m0){p=zd*m;for(k=0;kk?this.hits.push(h):this.hits.unshift(h),k=f;return this.hits}; THREE.CollisionSystem.prototype.rayCastNearest=function(b){var c=this.rayCastAll(b);if(c.length==0)return null;for(var e=0;c[e]instanceof THREE.MeshCollider;){var f=this.rayMesh(b,c[e]);if(f.distc.length)return null;return c[e]}; THREE.CollisionSystem.prototype.rayCast=function(b,c){if(c instanceof THREE.PlaneCollider)return this.rayPlane(b,c);else if(c instanceof THREE.SphereCollider)return this.raySphere(b,c);else if(c instanceof THREE.BoxCollider)return this.rayBox(b,c);else if(c instanceof THREE.MeshCollider&&c.box)return this.rayBox(b,c.box)}; -THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,k=0;k=n*h))return Number.MAX_VALUE;m/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(m);n.addSelf(b.origin);Math.abs(k.x)> +THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,k=0;k=n*h))return Number.MAX_VALUE;m/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(m);n.addSelf(b.origin);Math.abs(k.x)> Math.abs(k.y)?Math.abs(k.x)>Math.abs(k.z)?(b=n.y-c.y,k=e.y-c.y,h=f.y-c.y,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(k.y)>Math.abs(k.z)?(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y);c=k*f-e*h;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-n*h)*c;if(!(f>=0))return Number.MAX_VALUE;c*=k*n-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return m}; THREE.CollisionSystem.prototype.makeRayLocal=function(b,c){var e=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(c.matrixWorld,e);var f=THREE.CollisionSystem.__r;f.origin.copy(b.origin);f.direction.copy(b.direction);e.multiplyVector3(f.origin);e.rotateAxis(f.direction);f.direction.normalize();return f}; -THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,h=0,k=0,m=0,n=0,t=0,u=!0;e.origin.xc.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,u=!1,m=1);e.origin.yc.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y, -u=!1,n=1);e.origin.zc.max.z&&(k=c.max.z-e.origin.z,k/=e.direction.z,u=!1,t=1);if(u)return-1;u=0;h>f&&(u=1,f=h);k>f&&(u=2,f=k);switch(u){case 0:n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(m,0,0);break;case 1:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z* -f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;c.normal.set(0,0,t)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE}; +THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,h=0,k=0,m=0,n=0,p=0,t=!0;e.origin.xc.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,t=!1,m=1);e.origin.yc.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y, +t=!1,n=1);e.origin.zc.max.z&&(k=c.max.z-e.origin.z,k/=e.direction.z,t=!1,p=1);if(t)return-1;t=0;h>f&&(t=1,f=h);k>f&&(t=2,f=k);switch(t){case 0:n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(m,0,0);break;case 1:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z* +f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;c.normal.set(0,0,p)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE}; THREE.CollisionSystem.prototype.raySphere=function(b,c){var e=c.center.clone().subSelf(b.origin);if(e.lengthSq=0)return Math.abs(f)-Math.sqrt(e);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4; THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(b){b.geometry.computeBoundingBox();var c=b.geometry.boundingBox,e=new THREE.Vector3(c.x[0],c.y[0],c.z[0]),c=new THREE.Vector3(c.x[1],c.y[1],c.z[1]),e=new THREE.BoxCollider(e,c);e.mesh=b;return e};THREE.CollisionUtils.MeshAABB=function(b){var c=THREE.CollisionUtils.MeshOBB(b);c.min.addSelf(b.position);c.max.addSelf(b.position);c.dynamic=!1;return c}; THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))}; -if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,m=new THREE.Matrix4,n=new THREE.Matrix4,t,u,w;h.matrixAutoUpdate=k.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},o=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.PerspectiveCamera(53,1,1,1E4);v.position.z= -2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:o},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); -var A=new THREE.Scene;A.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);o.width=b;o.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(t!==e.aspect||u!==e.near||w!==e.fov){t=e.aspect;u=e.near;w=e.fov;var E=e.projectionMatrix.clone(),F=125/30*0.5,C=F*u/125,G=u*Math.tan(w*Math.PI/360),J;m.n14=F;n.n14=-F;F=-G*t+C;J=G*t+C;E.n11=2*u/(J-F);E.n13=(J+F)/(J-F);h.projectionMatrix=E.clone();F=-G*t-C;J=G*t-C;E.n11=2*u/(J-F);E.n13= -(J+F)/(J-F);k.projectionMatrix=E.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=u;h.far=e.far;f.call(c,b,h,o,!0);k.matrix=e.matrixWorld.clone().multiplySelf(m);k.update(null,!0);k.position.copy(e.position);k.near=u;k.far=e.far;f.call(c,b,k,x,!0);f.call(c,A,v)}}; +if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,m=new THREE.Matrix4,n=new THREE.Matrix4,p,t,w;h.matrixAutoUpdate=k.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},u=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.PerspectiveCamera(53,1,1,1E4);v.position.z= +2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:u},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); +var A=new THREE.Scene;A.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);u.width=b;u.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(p!==e.aspect||t!==e.near||w!==e.fov){p=e.aspect;t=e.near;w=e.fov;var D=e.projectionMatrix.clone(),E=125/30*0.5,C=E*t/125,G=t*Math.tan(w*Math.PI/360),I;m.n14=E;n.n14=-E;E=-G*p+C;I=G*p+C;D.n11=2*t/(I-E);D.n13=(I+E)/(I-E);h.projectionMatrix=D.clone();E=-G*p-C;I=G*p-C;D.n11=2*t/(I-E);D.n13= +(I+E)/(I-E);k.projectionMatrix=D.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=t;h.far=e.far;f.call(c,b,h,u,!0);k.matrix=e.matrixWorld.clone().multiplySelf(m);k.update(null,!0);k.position.copy(e.position);k.near=t;k.far=e.far;f.call(c,b,k,x,!0);f.call(c,A,v)}}; if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,h,k,m=new THREE.PerspectiveCamera;m.target=new THREE.Vector3(0,0,0);var n=new THREE.PerspectiveCamera;n.target=new THREE.Vector3(0,0,0);c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;this.setSize=function(b,f){e.call(c,b,f);h=b/2;k=f};this.render=function(b,e){this.clear();m.fov=e.fov;m.aspect=0.5*e.aspect;m.near=e.near;m.far= e.far;m.updateProjectionMatrix();m.position.copy(e.position);m.target.copy(e.target);m.translateX(c.separation);m.lookAt(m.target);n.projectionMatrix=m.projectionMatrix;n.position.copy(e.position);n.target.copy(e.target);n.translateX(-c.separation);n.lookAt(n.target);this.setViewport(0,0,h,k);f.call(c,b,m);this.setViewport(h,0,h,k);f.call(c,b,n,!1)}}; diff --git a/build/custom/ThreeWebGL.js b/build/custom/ThreeWebGL.js index 90834254..bb7c0023 100644 --- a/build/custom/ThreeWebGL.js +++ b/build/custom/ThreeWebGL.js @@ -1,103 +1,102 @@ // ThreeWebGL.js r46dev - http://github.com/mrdoob/three.js var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this}; -THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},copyGammaToLinear:function(b){this.r=b.r*b.r;this.g=b.g*b.g;this.b=b.b*b.b;return this},copyLinearToGamma:function(b){this.r=Math.sqrt(b.r);this.g=Math.sqrt(b.g);this.b=Math.sqrt(b.b);return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var d,h,i;if(e==0)this.r=this.g=this.b=0;else switch(d=Math.floor(b*6),h=b*6-d,b=e*(1-c),i=e*(1- -c*h),c=e*(1-c*(1-h)),d){case 1:this.r=i;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=i;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=e;this.g=b;this.b=i;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ +THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},copyGammaToLinear:function(b){this.r=b.r*b.r;this.g=b.g*b.g;this.b=b.b*b.b;return this},copyLinearToGamma:function(b){this.r=Math.sqrt(b.r);this.g=Math.sqrt(b.g);this.b=Math.sqrt(b.b);return this},setRGB:function(b,c,d){this.r=b;this.g=c;this.b=d;return this},setHSV:function(b,c,d){var f,h,i;if(d==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),h=b*6-f,b=d*(1-c),i=d*(1- +c*h),c=d*(1-c*(1-h)),f){case 1:this.r=i;this.g=d;this.b=b;break;case 2:this.r=b;this.g=d;this.b=c;break;case 3:this.r=b;this.g=i;this.b=d;break;case 4:this.r=c;this.g=b;this.b=d;break;case 5:this.r=d;this.g=b;this.b=i;break;case 6:case 0:this.r=d,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this}, divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var c=this.x-b.x,b=this.y-b.y;return c*c+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)}, -equals:function(b){return b.x==this.x&&b.y==this.y}};THREE.Vector3=function(b,c,e){this.x=b||0;this.y=c||0;this.z=e||0}; -THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(b,c,e){this.x=b;this.y=c;this.z=e;return this},setX:function(b){this.x=b;return this},setY:function(b){this.y=b;return this},setZ:function(b){this.z=b;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;return this}, +equals:function(b){return b.x==this.x&&b.y==this.y}};THREE.Vector3=function(b,c,d){this.x=b||0;this.y=c||0;this.z=d||0}; +THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(b,c,d){this.x=b;this.y=c;this.z=d;return this},setX:function(b){this.x=b;return this},setY:function(b){this.y=b;return this},setZ:function(b){this.z=b;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;return this}, addScalar:function(b){this.x+=b;this.y+=b;this.z+=b;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=b.z-c.z;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;return this},multiply:function(b,c){this.x=b.x*c.x;this.y=b.y*c.y;this.z=b.z*c.z;return this},multiplySelf:function(b){this.x*=b.x;this.y*=b.y;this.z*=b.z;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;return this},divideSelf:function(b){this.x/=b.x;this.y/=b.y;this.z/=b.z;return this}, divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.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 this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)}, cross:function(b,c){this.x=b.y*c.z-b.z*c.y;this.y=b.z*c.x-b.x*c.z;this.z=b.x*c.y-b.y*c.x;return this},crossSelf:function(b){return this.set(this.y*b.z-this.z*b.y,this.z*b.x-this.x*b.z,this.x*b.y-this.y*b.x)},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){return(new THREE.Vector3).sub(this,b).lengthSq()},setPositionFromMatrix:function(b){this.x=b.n14;this.y=b.n24;this.z=b.n34},setRotationFromMatrix:function(b){var c=Math.cos(this.y);this.y=Math.asin(b.n13); -Math.abs(c)>1.0E-5?(this.x=Math.atan2(-b.n23/c,b.n33/c),this.z=Math.atan2(-b.n12/c,b.n11/c)):(this.x=0,this.z=Math.atan2(b.n21,b.n22))},isZero:function(){return this.lengthSq()<1.0E-4}};THREE.Vector4=function(b,c,e,d){this.x=b||0;this.y=c||0;this.z=e||0;this.w=d!==void 0?d:1}; -THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,c,e,d){this.x=b;this.y=c;this.z=e;this.w=d;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w!==void 0?b.w:1},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;this.w=b.w+c.w;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;this.w+=b.w;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=b.z- +Math.abs(c)>1.0E-5?(this.x=Math.atan2(-b.n23/c,b.n33/c),this.z=Math.atan2(-b.n12/c,b.n11/c)):(this.x=0,this.z=Math.atan2(b.n21,b.n22))},isZero:function(){return this.lengthSq()<1.0E-4}};THREE.Vector4=function(b,c,d,f){this.x=b||0;this.y=c||0;this.z=d||0;this.w=f!==void 0?f:1}; +THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,c,d,f){this.x=b;this.y=c;this.z=d;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w!==void 0?b.w:1},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;this.w=b.w+c.w;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;this.w+=b.w;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=b.z- c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;this.w-=b.w;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;this.w*=b;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b,this.w/=b):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z+this.w*b.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())}, normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3}; -THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,d=[];c=0;for(e=b.length;c0&&b>0&&i+b<1}for(var d,h=[],i=0,j=b.children.length;ib.scale.x)return[];d={distance:i,point:b.position,face:null,object:b};h.push(d)}else if(b instanceof THREE.Mesh){i=c(this.origin, -this.direction,b.matrixWorld.getPosition());if(i==null||i>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var k,n,p,q,t,s,m,B,y=b.geometry,J=y.vertices,i=0,j=y.faces.length;i0:s<0)))if(s=t.dot((new THREE.Vector3).sub(k,m))/s,m=m.addSelf(B.multiplyScalar(s)),d instanceof THREE.Face3)e(m,k,n,p)&&(d={distance:this.origin.distanceTo(m),point:m,face:d,object:b},h.push(d));else if(d instanceof THREE.Face4&&(e(m,k,n,q)||e(m,n,p,q)))d={distance:this.origin.distanceTo(m),point:m,face:d,object:b},h.push(d)}return h}}; -THREE.Rectangle=function(){function b(){i=d-c;j=h-e}var c,e,d,h,i,j,k=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return i};this.getHeight=function(){return j};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return d};this.getBottom=function(){return h};this.set=function(i,j,q,t){k=!1;c=i;e=j;d=q;h=t;b()};this.addPoint=function(i,j){k?(k=!1,c=i,e=j,d=i,h=j):(c=ci?d:i,h=h>j?h:j);b()};this.add3Points= -function(i,j,q,t,s,m){k?(k=!1,c=iq?i>s?i:s:q>s?q:s,h=j>t?j>m?j:m:t>m?t:m):(c=iq?i>s?i>d?i:d:s>d?s:d:q>s?q>d?q:d:s>d?s:d,h=j>t?j>m?j>h?j:h:m>h?m:h:t>m?t>h?t:h:m>h?m:h);b()};this.addRectangle=function(i){k?(k=!1,c=i.getLeft(),e=i.getTop(),d=i.getRight(),h=i.getBottom()):(c=ci.getRight()?d:i.getRight(),h=h> -i.getBottom()?h:i.getBottom());b()};this.inflate=function(i){c-=i;e-=i;d+=i;h+=i;b()};this.minSelf=function(i){c=c>i.getLeft()?c:i.getLeft();e=e>i.getTop()?e:i.getTop();d=d=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){k=!0;h=d=e=c=0;b()};this.isEmpty=function(){return k}};THREE.Matrix3=function(){this.m=[]}; +THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,d,f=[];c=0;for(d=b.length;c0&&b>0&&i+b<1}for(var f,h=[],i=0,j=b.children.length;ib.scale.x)return[];f={distance:i,point:b.position,face:null,object:b};h.push(f)}else if(b instanceof THREE.Mesh){i=c(this.origin, +this.direction,b.matrixWorld.getPosition());if(i==null||i>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var k,n,m,r,o,v,w,A,F=b.geometry,L=F.vertices,i=0,j=F.faces.length;i0:v<0)))if(v=o.dot((new THREE.Vector3).sub(k,w))/v,w=w.addSelf(A.multiplyScalar(v)),f instanceof THREE.Face3)d(w,k,n,m)&&(f={distance:this.origin.distanceTo(w),point:w,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(d(w,k,n,r)||d(w,n,m,r)))f={distance:this.origin.distanceTo(w),point:w,face:f,object:b},h.push(f)}return h}}; +THREE.Rectangle=function(){function b(){i=f-c;j=h-d}var c,d,f,h,i,j,k=!0;this.getX=function(){return c};this.getY=function(){return d};this.getWidth=function(){return i};this.getHeight=function(){return j};this.getLeft=function(){return c};this.getTop=function(){return d};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(i,j,r,o){k=!1;c=i;d=j;f=r;h=o;b()};this.addPoint=function(i,j){k?(k=!1,c=i,d=j,f=i,h=j):(c=ci?f:i,h=h>j?h:j);b()};this.add3Points= +function(i,j,r,o,v,w){k?(k=!1,c=ir?i>v?i:v:r>v?r:v,h=j>o?j>w?j:w:o>w?o:w):(c=ir?i>v?i>f?i:f:v>f?v:f:r>v?r>f?r:f:v>f?v:f,h=j>o?j>w?j>h?j:h:w>h?w:h:o>w?o>h?o:h:w>h?w:h);b()};this.addRectangle=function(i){k?(k=!1,c=i.getLeft(),d=i.getTop(),f=i.getRight(),h=i.getBottom()):(c=ci.getRight()?f:i.getRight(),h=h> +i.getBottom()?h:i.getBottom());b()};this.inflate=function(i){c-=i;d-=i;f+=i;h+=i;b()};this.minSelf=function(i){c=c>i.getLeft()?c:i.getLeft();d=d>i.getTop()?d:i.getTop();f=f=0&&Math.min(h,b.getBottom())-Math.max(d,b.getTop())>=0};this.empty=function(){k=!0;h=f=d=c=0;b()};this.isEmpty=function(){return k}};THREE.Matrix3=function(){this.m=[]}; THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}}; -THREE.Matrix4=function(b,c,e,d,h,i,j,k,n,p,q,t,s,m,B,y){this.set(b!==void 0?b:1,c||0,e||0,d||0,h||0,i!==void 0?i:1,j||0,k||0,n||0,p||0,q!==void 0?q:1,t||0,s||0,m||0,B||0,y!==void 0?y:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,e,d,h,i,j,k,n,p,q,t,s,m,B,y){this.n11=b;this.n12=c;this.n13=e;this.n14=d;this.n21=h;this.n22=i;this.n23=j;this.n24=k;this.n31=n;this.n32=p;this.n33=q;this.n34=t;this.n41=s;this.n42=m;this.n43=B;this.n44=y;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b, -c,e){var d=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,i=THREE.Matrix4.__v3;i.sub(b,c).normalize();if(i.length()===0)i.z=1;d.cross(e,i).normalize();d.length()===0&&(i.x+=1.0E-4,d.cross(e,i).normalize());h.cross(i,d).normalize();this.n11=d.x;this.n12=h.x;this.n13=i.x;this.n21=d.y;this.n22=h.y;this.n23=i.y;this.n31=d.z;this.n32=h.z;this.n33=i.z;return this},multiplyVector3:function(b){var c=b.x,e=b.y,d=b.z,h=1/(this.n41*c+this.n42*e+this.n43*d+this.n44);b.x=(this.n11*c+this.n12*e+this.n13*d+this.n14)*h; -b.y=(this.n21*c+this.n22*e+this.n23*d+this.n24)*h;b.z=(this.n31*c+this.n32*e+this.n33*d+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,e=b.y,d=b.z,h=b.w;b.x=this.n11*c+this.n12*e+this.n13*d+this.n14*h;b.y=this.n21*c+this.n22*e+this.n23*d+this.n24*h;b.z=this.n31*c+this.n32*e+this.n33*d+this.n34*h;b.w=this.n41*c+this.n42*e+this.n43*d+this.n44*h;return b},rotateAxis:function(b){var c=b.x,e=b.y,d=b.z;b.x=c*this.n11+e*this.n12+d*this.n13;b.y=c*this.n21+e*this.n22+d*this.n23;b.z=c*this.n31+ -e*this.n32+d*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var e=b.n11,d=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,n=b.n23,p=b.n24,q=b.n31,t=b.n32,s=b.n33,m=b.n34,B=b.n41,y=b.n42,J=b.n43,F=b.n44,xa=c.n11,ya= -c.n12,ja=c.n13,ta=c.n14,ha=c.n21,G=c.n22,v=c.n23,T=c.n24,L=c.n31,V=c.n32,la=c.n33,Z=c.n34,Ca=c.n41,$=c.n42,H=c.n43,f=c.n44;this.n11=e*xa+d*ha+h*L+i*Ca;this.n12=e*ya+d*G+h*V+i*$;this.n13=e*ja+d*v+h*la+i*H;this.n14=e*ta+d*T+h*Z+i*f;this.n21=j*xa+k*ha+n*L+p*Ca;this.n22=j*ya+k*G+n*V+p*$;this.n23=j*ja+k*v+n*la+p*H;this.n24=j*ta+k*T+n*Z+p*f;this.n31=q*xa+t*ha+s*L+m*Ca;this.n32=q*ya+t*G+s*V+m*$;this.n33=q*ja+t*v+s*la+m*H;this.n34=q*ta+t*T+s*Z+m*f;this.n41=B*xa+y*ha+J*L+F*Ca;this.n42=B*ya+y*G+J*V+F*$;this.n43= -B*ja+y*v+J*la+F*H;this.n44=B*ta+y*T+J*Z+F*f;return this},multiplyToArray:function(b,c,e){this.multiply(b,c);e[0]=this.n11;e[1]=this.n21;e[2]=this.n31;e[3]=this.n41;e[4]=this.n12;e[5]=this.n22;e[6]=this.n32;e[7]=this.n42;e[8]=this.n13;e[9]=this.n23;e[10]=this.n33;e[11]=this.n43;e[12]=this.n14;e[13]=this.n24;e[14]=this.n34;e[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*= -b;this.n23*=b;this.n24*=b;this.n31*=b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,e=this.n13,d=this.n14,h=this.n21,i=this.n22,j=this.n23,k=this.n24,n=this.n31,p=this.n32,q=this.n33,t=this.n34,s=this.n41,m=this.n42,B=this.n43,y=this.n44;return d*j*p*s-e*k*p*s-d*i*q*s+c*k*q*s+e*i*t*s-c*j*t*s-d*j*n*m+e*k*n*m+d*h*q*m-b*k*q*m-e*h*t*m+b*j*t*m+d*i*n*B-c*k*n*B-d*h*p*B+b*k*p*B+c*h*t*B-b*i*t*B-e*i*n*y+c*j* -n*y+e*h*p*y-b*j*p*y-c*h*q*y+b*i*q*y},transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32; -b.n33=this.n33;b.n34=this.n34;b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(b){b[0]= -this.n11;b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]=this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]= -this.n34;b[c+15]=this.n44;return b},setTranslation:function(b,c,e){this.set(1,0,0,b,0,1,0,c,0,0,1,e,0,0,0,1);return this},setScale:function(b,c,e){this.set(b,0,0,0,0,c,0,0,0,0,e,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,-b,0, -0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var e=Math.cos(c),d=Math.sin(c),h=1-e,i=b.x,j=b.y,k=b.z,n=h*i,p=h*j;this.set(n*i+e,n*j-d*k,n*k+d*j,0,n*j+d*k,p*j+e,p*k-d*i,0,n*k-d*j,p*k+d*i,h*k*k+e,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= -new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var e=b.x,d=b.y,h=b.z,i=Math.cos(e),e=Math.sin(e),j=Math.cos(d),d=Math.sin(d),k=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var n= -j*k,p=j*h,q=d*k,t=d*h;this.n11=n+t*e;this.n12=q*e-p;this.n13=i*d;this.n21=i*h;this.n22=i*k;this.n23=-e;this.n31=p*e-q;this.n32=t+n*e;this.n33=i*j;break;case "ZXY":n=j*k;p=j*h;q=d*k;t=d*h;this.n11=n-t*e;this.n12=-i*h;this.n13=q+p*e;this.n21=p+q*e;this.n22=i*k;this.n23=t-n*e;this.n31=-i*d;this.n32=e;this.n33=i*j;break;case "ZYX":n=i*k;p=i*h;q=e*k;t=e*h;this.n11=j*k;this.n12=q*d-p;this.n13=n*d+t;this.n21=j*h;this.n22=t*d+n;this.n23=p*d-q;this.n31=-d;this.n32=e*j;this.n33=i*j;break;case "YZX":n=i*j;p= -i*d;q=e*j;t=e*d;this.n11=j*k;this.n12=t-n*h;this.n13=q*h+p;this.n21=h;this.n22=i*k;this.n23=-e*k;this.n31=-d*k;this.n32=p*h+q;this.n33=n-t*h;break;case "XZY":n=i*j;p=i*d;q=e*j;t=e*d;this.n11=j*k;this.n12=-h;this.n13=d*k;this.n21=n*h+t;this.n22=i*k;this.n23=p*h-q;this.n31=q*h-p;this.n32=e*k;this.n33=t*h+n;break;default:n=i*k,p=i*h,q=e*k,t=e*h,this.n11=j*k,this.n12=-j*h,this.n13=d,this.n21=p+q*d,this.n22=n-t*d,this.n23=-e*j,this.n31=t-n*d,this.n32=q+p*d,this.n33=i*j}return this},setRotationFromQuaternion:function(b){var c= -b.x,e=b.y,d=b.z,h=b.w,i=c+c,j=e+e,k=d+d,b=c*i,n=c*j;c*=k;var p=e*j;e*=k;d*=k;i*=h;j*=h;h*=k;this.n11=1-(p+d);this.n12=n-h;this.n13=c+j;this.n21=n+h;this.n22=1-(b+d);this.n23=e-i;this.n31=c-j;this.n32=e+i;this.n33=1-(b+p);return this},scale:function(b){var c=b.x,e=b.y,b=b.z;this.n11*=c;this.n12*=e;this.n13*=b;this.n21*=c;this.n22*=e;this.n23*=b;this.n31*=c;this.n32*=e;this.n33*=b;this.n41*=c;this.n42*=e;this.n43*=b;return this},compose:function(b,c,e){var d=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2; -d.identity();d.setRotationFromQuaternion(c);h.setScale(e.x,e.y,e.z);this.multiply(d,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,e){var d=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,i=THREE.Matrix4.__v3;d.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);i.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c:new THREE.Quaternion;e=e instanceof THREE.Vector3?e:new THREE.Vector3;e.x=d.length(); -e.y=h.length();e.z=i.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=e.x;d.n21/=e.x;d.n31/=e.x;d.n12/=e.y;d.n22/=e.y;d.n32/=e.y;d.n13/=e.z;d.n23/=e.z;d.n33/=e.z;c.setFromRotationMatrix(d);return[b,c,e]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var e=1/c.x,d=1/c.y,h=1/c.z;this.n11=b.n11*e;this.n21=b.n21*e;this.n31=b.n31*e;this.n12=b.n12*d;this.n22=b.n22*d;this.n32=b.n32*d;this.n13=b.n13*h;this.n23= -b.n23*h;this.n33=b.n33*h}}; -THREE.Matrix4.makeInvert=function(b,c){var e=b.n11,d=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,n=b.n23,p=b.n24,q=b.n31,t=b.n32,s=b.n33,m=b.n34,B=b.n41,y=b.n42,J=b.n43,F=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=n*m*y-p*s*y+p*t*J-k*m*J-n*t*F+k*s*F;c.n12=i*s*y-h*m*y-i*t*J+d*m*J+h*t*F-d*s*F;c.n13=h*p*y-i*n*y+i*k*J-d*p*J-h*k*F+d*n*F;c.n14=i*n*t-h*p*t-i*k*s+d*p*s+h*k*m-d*n*m;c.n21=p*s*B-n*m*B-p*q*J+j*m*J+n*q*F-j*s*F;c.n22=h*m*B-i*s*B+i*q*J-e*m*J-h*q*F+e*s*F;c.n23=i*n*B-h*p*B-i*j*J+e*p*J+h*j*F-e*n*F;c.n24= -h*p*q-i*n*q+i*j*s-e*p*s-h*j*m+e*n*m;c.n31=k*m*B-p*t*B+p*q*y-j*m*y-k*q*F+j*t*F;c.n32=i*t*B-d*m*B-i*q*y+e*m*y+d*q*F-e*t*F;c.n33=h*p*B-i*k*B+i*j*y-e*p*y-d*j*F+e*k*F;c.n34=i*k*q-d*p*q-i*j*t+e*p*t+d*j*m-e*k*m;c.n41=n*t*B-k*s*B-n*q*y+j*s*y+k*q*J-j*t*J;c.n42=d*s*B-h*t*B+h*q*y-e*s*y-d*q*J+e*t*J;c.n43=h*k*B-d*n*B-h*j*y+e*n*y+d*j*J-e*k*J;c.n44=d*n*q-h*k*q+h*j*t-e*n*t-d*j*s+e*k*s;c.multiplyScalar(1/b.determinant());return c}; -THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,e=c.m,d=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,i=b.n32*b.n21-b.n31*b.n22,j=-b.n33*b.n12+b.n32*b.n13,k=b.n33*b.n11-b.n31*b.n13,n=-b.n32*b.n11+b.n31*b.n12,p=b.n23*b.n12-b.n22*b.n13,q=-b.n23*b.n11+b.n21*b.n13,t=b.n22*b.n11-b.n21*b.n12,b=b.n11*d+b.n21*j+b.n31*p;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;e[0]=b*d;e[1]=b*h;e[2]=b*i;e[3]=b*j;e[4]=b*k;e[5]=b*n;e[6]=b*p;e[7]=b*q;e[8]=b*t;return c}; -THREE.Matrix4.makeFrustum=function(b,c,e,d,h,i){var j;j=new THREE.Matrix4;j.n11=2*h/(c-b);j.n12=0;j.n13=(c+b)/(c-b);j.n14=0;j.n21=0;j.n22=2*h/(d-e);j.n23=(d+e)/(d-e);j.n24=0;j.n31=0;j.n32=0;j.n33=-(i+h)/(i-h);j.n34=-2*i*h/(i-h);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};THREE.Matrix4.makePerspective=function(b,c,e,d){var h,b=e*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,e,d)}; -THREE.Matrix4.makeOrtho=function(b,c,e,d,h,i){var j,k,n,p;j=new THREE.Matrix4;k=c-b;n=e-d;p=i-h;j.n11=2/k;j.n12=0;j.n13=0;j.n14=-((c+b)/k);j.n21=0;j.n22=2/n;j.n23=0;j.n24=-((e+d)/n);j.n31=0;j.n32=0;j.n33=-2/p;j.n34=-((i+h)/p);j.n41=0;j.n42=0;j.n43=0;j.n44=1;return j};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; +THREE.Matrix4=function(b,c,d,f,h,i,j,k,n,m,r,o,v,w,A,F){this.set(b!==void 0?b:1,c||0,d||0,f||0,h||0,i!==void 0?i:1,j||0,k||0,n||0,m||0,r!==void 0?r:1,o||0,v||0,w||0,A||0,F!==void 0?F:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,d,f,h,i,j,k,n,m,r,o,v,w,A,F){this.n11=b;this.n12=c;this.n13=d;this.n14=f;this.n21=h;this.n22=i;this.n23=j;this.n24=k;this.n31=n;this.n32=m;this.n33=r;this.n34=o;this.n41=v;this.n42=w;this.n43=A;this.n44=F;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b, +c,d){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,i=THREE.Matrix4.__v3;i.sub(b,c).normalize();if(i.length()===0)i.z=1;f.cross(d,i).normalize();f.length()===0&&(i.x+=1.0E-4,f.cross(d,i).normalize());h.cross(i,f).normalize();this.n11=f.x;this.n12=h.x;this.n13=i.x;this.n21=f.y;this.n22=h.y;this.n23=i.y;this.n31=f.z;this.n32=h.z;this.n33=i.z;return this},multiplyVector3:function(b){var c=b.x,d=b.y,f=b.z,h=1/(this.n41*c+this.n42*d+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*d+this.n13*f+this.n14)*h; +b.y=(this.n21*c+this.n22*d+this.n23*f+this.n24)*h;b.z=(this.n31*c+this.n32*d+this.n33*f+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,d=b.y,f=b.z,h=b.w;b.x=this.n11*c+this.n12*d+this.n13*f+this.n14*h;b.y=this.n21*c+this.n22*d+this.n23*f+this.n24*h;b.z=this.n31*c+this.n32*d+this.n33*f+this.n34*h;b.w=this.n41*c+this.n42*d+this.n43*f+this.n44*h;return b},rotateAxis:function(b){var c=b.x,d=b.y,f=b.z;b.x=c*this.n11+d*this.n12+f*this.n13;b.y=c*this.n21+d*this.n22+f*this.n23;b.z=c*this.n31+ +d*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var d=b.n11,f=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,n=b.n23,m=b.n24,r=b.n31,o=b.n32,v=b.n33,w=b.n34,A=b.n41,F=b.n42,L=b.n43,H=b.n44,xa=c.n11,ya= +c.n12,ja=c.n13,sa=c.n14,ha=c.n21,O=c.n22,D=c.n23,ka=c.n24,M=c.n31,S=c.n32,la=c.n33,ia=c.n34,Ca=c.n41,aa=c.n42,J=c.n43,e=c.n44;this.n11=d*xa+f*ha+h*M+i*Ca;this.n12=d*ya+f*O+h*S+i*aa;this.n13=d*ja+f*D+h*la+i*J;this.n14=d*sa+f*ka+h*ia+i*e;this.n21=j*xa+k*ha+n*M+m*Ca;this.n22=j*ya+k*O+n*S+m*aa;this.n23=j*ja+k*D+n*la+m*J;this.n24=j*sa+k*ka+n*ia+m*e;this.n31=r*xa+o*ha+v*M+w*Ca;this.n32=r*ya+o*O+v*S+w*aa;this.n33=r*ja+o*D+v*la+w*J;this.n34=r*sa+o*ka+v*ia+w*e;this.n41=A*xa+F*ha+L*M+H*Ca;this.n42=A*ya+F*O+ +L*S+H*aa;this.n43=A*ja+F*D+L*la+H*J;this.n44=A*sa+F*ka+L*ia+H*e;return this},multiplyToArray:function(b,c,d){this.multiply(b,c);d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34;d[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*= +b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=b;this.n31*=b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,d=this.n13,f=this.n14,h=this.n21,i=this.n22,j=this.n23,k=this.n24,n=this.n31,m=this.n32,r=this.n33,o=this.n34,v=this.n41,w=this.n42,A=this.n43,F=this.n44;return f*j*m*v-d*k*m*v-f*i*r*v+c*k*r*v+d*i*o*v-c*j*o*v-f*j*n*w+d*k*n*w+f*h*r*w-b*k*r*w-d*h*o*w+b*j*o*w+f*i*n*A-c*k*n*A-f*h*m*A+b*k*m*A+c*h* +o*A-b*i*o*A-d*i*n*F+c*j*n*F+d*h*m*F-b*j*m*F-c*h*r*F+b*i*r*F},transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24; +b.n31=this.n31;b.n32=this.n32;b.n33=this.n33;b.n34=this.n34;b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44; +return this.flat},flattenToArray:function(b){b[0]=this.n11;b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]= +this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=this.n34;b[c+15]=this.n44;return b},setTranslation:function(b,c,d){this.set(1,0,0,b,0,1,0,c,0,0,1,d,0,0,0,1);return this},setScale:function(b,c,d){this.set(b,0,0,0,0,c,0,0,0,0,d,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c= +Math.cos(b),b=Math.sin(b);this.set(c,-b,0,0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var d=Math.cos(c),f=Math.sin(c),h=1-d,i=b.x,j=b.y,k=b.z,n=h*i,m=h*j;this.set(n*i+d,n*j-f*k,n*k+f*j,0,n*j+f*k,m*j+d,m*k-f*i,0,n*k-f*j,m*k+f*i,h*k*k+d,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position}, +getColumnX:function(){if(!this.columnX)this.columnX=new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var d=b.x,f=b.y,h=b.z,i=Math.cos(d),d=Math.sin(d),j=Math.cos(f), +f=Math.sin(f),k=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var n=j*k,m=j*h,r=f*k,o=f*h;this.n11=n+o*d;this.n12=r*d-m;this.n13=i*f;this.n21=i*h;this.n22=i*k;this.n23=-d;this.n31=m*d-r;this.n32=o+n*d;this.n33=i*j;break;case "ZXY":n=j*k;m=j*h;r=f*k;o=f*h;this.n11=n-o*d;this.n12=-i*h;this.n13=r+m*d;this.n21=m+r*d;this.n22=i*k;this.n23=o-n*d;this.n31=-i*f;this.n32=d;this.n33=i*j;break;case "ZYX":n=i*k;m=i*h;r=d*k;o=d*h;this.n11=j*k;this.n12=r*f-m;this.n13=n*f+o;this.n21=j*h;this.n22=o*f+n;this.n23= +m*f-r;this.n31=-f;this.n32=d*j;this.n33=i*j;break;case "YZX":n=i*j;m=i*f;r=d*j;o=d*f;this.n11=j*k;this.n12=o-n*h;this.n13=r*h+m;this.n21=h;this.n22=i*k;this.n23=-d*k;this.n31=-f*k;this.n32=m*h+r;this.n33=n-o*h;break;case "XZY":n=i*j;m=i*f;r=d*j;o=d*f;this.n11=j*k;this.n12=-h;this.n13=f*k;this.n21=n*h+o;this.n22=i*k;this.n23=m*h-r;this.n31=r*h-m;this.n32=d*k;this.n33=o*h+n;break;default:n=i*k,m=i*h,r=d*k,o=d*h,this.n11=j*k,this.n12=-j*h,this.n13=f,this.n21=m+r*f,this.n22=n-o*f,this.n23=-d*j,this.n31= +o-n*f,this.n32=r+m*f,this.n33=i*j}return this},setRotationFromQuaternion:function(b){var c=b.x,d=b.y,f=b.z,h=b.w,i=c+c,j=d+d,k=f+f,b=c*i,n=c*j;c*=k;var m=d*j;d*=k;f*=k;i*=h;j*=h;h*=k;this.n11=1-(m+f);this.n12=n-h;this.n13=c+j;this.n21=n+h;this.n22=1-(b+f);this.n23=d-i;this.n31=c-j;this.n32=d+i;this.n33=1-(b+m);return this},scale:function(b){var c=b.x,d=b.y,b=b.z;this.n11*=c;this.n12*=d;this.n13*=b;this.n21*=c;this.n22*=d;this.n23*=b;this.n31*=c;this.n32*=d;this.n33*=b;this.n41*=c;this.n42*=d;this.n43*= +b;return this},compose:function(b,c,d){var f=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2;f.identity();f.setRotationFromQuaternion(c);h.setScale(d.x,d.y,d.z);this.multiply(f,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,d){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,i=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);i.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c: +new THREE.Quaternion;d=d instanceof THREE.Vector3?d:new THREE.Vector3;d.x=f.length();d.y=h.length();d.z=i.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=d.x;f.n21/=d.x;f.n31/=d.x;f.n12/=d.y;f.n22/=d.y;f.n32/=d.y;f.n13/=d.z;f.n23/=d.z;f.n33/=d.z;c.setFromRotationMatrix(f);return[b,c,d]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var d=1/c.x,f=1/c.y,h=1/c.z;this.n11=b.n11*d;this.n21=b.n21*d;this.n31= +b.n31*d;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*h;this.n23=b.n23*h;this.n33=b.n33*h}}; +THREE.Matrix4.makeInvert=function(b,c){var d=b.n11,f=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,n=b.n23,m=b.n24,r=b.n31,o=b.n32,v=b.n33,w=b.n34,A=b.n41,F=b.n42,L=b.n43,H=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=n*w*F-m*v*F+m*o*L-k*w*L-n*o*H+k*v*H;c.n12=i*v*F-h*w*F-i*o*L+f*w*L+h*o*H-f*v*H;c.n13=h*m*F-i*n*F+i*k*L-f*m*L-h*k*H+f*n*H;c.n14=i*n*o-h*m*o-i*k*v+f*m*v+h*k*w-f*n*w;c.n21=m*v*A-n*w*A-m*r*L+j*w*L+n*r*H-j*v*H;c.n22=h*w*A-i*v*A+i*r*L-d*w*L-h*r*H+d*v*H;c.n23=i*n*A-h*m*A-i*j*L+d*m*L+h*j*H-d*n*H;c.n24= +h*m*r-i*n*r+i*j*v-d*m*v-h*j*w+d*n*w;c.n31=k*w*A-m*o*A+m*r*F-j*w*F-k*r*H+j*o*H;c.n32=i*o*A-f*w*A-i*r*F+d*w*F+f*r*H-d*o*H;c.n33=h*m*A-i*k*A+i*j*F-d*m*F-f*j*H+d*k*H;c.n34=i*k*r-f*m*r-i*j*o+d*m*o+f*j*w-d*k*w;c.n41=n*o*A-k*v*A-n*r*F+j*v*F+k*r*L-j*o*L;c.n42=f*v*A-h*o*A+h*r*F-d*v*F-f*r*L+d*o*L;c.n43=h*k*A-f*n*A-h*j*F+d*n*F+f*j*L-d*k*L;c.n44=f*n*r-h*k*r+h*j*o-d*n*o-f*j*v+d*k*v;c.multiplyScalar(1/b.determinant());return c}; +THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,d=c.m,f=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,i=b.n32*b.n21-b.n31*b.n22,j=-b.n33*b.n12+b.n32*b.n13,k=b.n33*b.n11-b.n31*b.n13,n=-b.n32*b.n11+b.n31*b.n12,m=b.n23*b.n12-b.n22*b.n13,r=-b.n23*b.n11+b.n21*b.n13,o=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*j+b.n31*m;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;d[0]=b*f;d[1]=b*h;d[2]=b*i;d[3]=b*j;d[4]=b*k;d[5]=b*n;d[6]=b*m;d[7]=b*r;d[8]=b*o;return c}; +THREE.Matrix4.makeFrustum=function(b,c,d,f,h,i){var j;j=new THREE.Matrix4;j.n11=2*h/(c-b);j.n12=0;j.n13=(c+b)/(c-b);j.n14=0;j.n21=0;j.n22=2*h/(f-d);j.n23=(f+d)/(f-d);j.n24=0;j.n31=0;j.n32=0;j.n33=-(i+h)/(i-h);j.n34=-2*i*h/(i-h);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};THREE.Matrix4.makePerspective=function(b,c,d,f){var h,b=d*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,d,f)}; +THREE.Matrix4.makeOrtho=function(b,c,d,f,h,i){var j,k,n,m;j=new THREE.Matrix4;k=c-b;n=d-f;m=i-h;j.n11=2/k;j.n12=0;j.n13=0;j.n14=-((c+b)/k);j.n21=0;j.n22=2/n;j.n23=0;j.n24=-((d+f)/n);j.n31=0;j.n32=0;j.n33=-2/m;j.n34=-((i+h)/m);j.n41=0;j.n42=0;j.n43=0;j.n44=1;return j};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3}; THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(b){if(this.children.indexOf(b)=== --1){b.parent!==void 0&&b.parent.remove(b);b.parent=this;this.children.push(b);for(var c=this;c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.addChildRecurse(b)}},remove:function(b){var c=this,e=this.children.indexOf(b);if(e!==-1){b.parent=void 0;for(this.children.splice(e,1);c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.removeChildRecurse(b)}},getChildByName:function(b,c){var e,d,h;e=0;for(d=this.children.length;e=0&&i>=0&&h>=0&&j>=0?!0:f<0&&i<0||h<0&&j<0?!1:(f<0?e=Math.max(e,f/(f-i)):i<0&&(d=Math.min(d,f/(f-i))),h<0?e=Math.max(e,h/(h-j)):j<0&&(d=Math.min(d,h/(h-j))),dH&&j.positionScreen.z0&&G.z<1))za=ya[xa]=ya[xa]||new THREE.RenderableParticle,xa++,F=za,F.x=G.x/G.w,F.y=G.y/G.w,F.z=G.z,F.rotation=P.rotation.z,F.scale.x=P.scale.x*Math.abs(F.x-(G.x+i.projectionMatrix.n11)/(G.w+i.projectionMatrix.n14)),F.scale.y=P.scale.y*Math.abs(F.y-(G.y+i.projectionMatrix.n22)/(G.w+i.projectionMatrix.n24)),F.materials=P.materials,ta.push(F);h&&ta.sort(c);return ta}}; -THREE.Quaternion=function(b,c,e,d){this.set(b||0,c||0,e||0,d!==void 0?d:1)}; -THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,d){this.x=b;this.y=c;this.z=e;this.w=d;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,e=b.x*c,d=b.y*c,h=b.z*c,b=Math.cos(d),d=Math.sin(d),c=Math.cos(-h),h=Math.sin(-h),i=Math.cos(e),e=Math.sin(e),j=b*c,k=d*h;this.w=j*i-k*e;this.x=j*e+k*i;this.y=d*c*i+b*h*e;this.z=b*h*i-d*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,d=Math.sin(e); -this.x=b.x*d;this.y=b.y*d;this.z=b.z*d;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z); +THREE.Projector=function(){function b(){var b=n[k]=n[k]||new THREE.RenderableVertex;k++;return b}function c(b,c){return c.z-b.z}function d(b,c){var d=0,f=1,e=b.z+b.w,i=c.z+c.w,h=-b.z+b.w,j=-c.z+c.w;return e>=0&&i>=0&&h>=0&&j>=0?!0:e<0&&i<0||h<0&&j<0?!1:(e<0?d=Math.max(d,e/(e-i)):i<0&&(f=Math.min(f,e/(e-i))),h<0?d=Math.max(d,h/(h-j)):j<0&&(f=Math.min(f,h/(h-j))),fJ&&j.positionScreen.z0&&O.z<1))za=ya[xa]=ya[xa]||new THREE.RenderableParticle,xa++,H=za,H.x=O.x/O.w,H.y=O.y/O.w,H.z=O.z,H.rotation=N.rotation.z,H.scale.x=N.scale.x*Math.abs(H.x-(O.x+i.projectionMatrix.n11)/(O.w+i.projectionMatrix.n14)),H.scale.y=N.scale.y*Math.abs(H.y-(O.y+i.projectionMatrix.n22)/(O.w+i.projectionMatrix.n24)),H.materials=N.materials,sa.push(H);h&&sa.sort(c);return sa}};THREE.Quaternion=function(b,c,d,f){this.set(b||0,c||0,d||0,f!==void 0?f:1)}; +THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,d,f){this.x=b;this.y=c;this.z=d;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,d=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),i=Math.cos(d),d=Math.sin(d),j=b*c,k=f*h;this.w=j*i-k*d;this.x=j*d+k*i;this.y=f*c*i+b*h*d;this.z=b*h*i-f*c*d;return this},setFromAxisAngle:function(b,c){var d=c/2,f=Math.sin(d); +this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(d);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z); this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c= -this.x,e=this.y,d=this.z,h=this.w,i=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+h*i+e*k-d*j;this.y=e*b+h*j+d*i-c*k;this.z=d*b+h*k+c*j-e*i;this.w=h*b-c*i-e*j-d*k;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,d=b.y,h=b.z,i=this.x,j=this.y,k=this.z,n=this.w,p=n*e+j*h-k*d,q=n*d+k*e-i*h,t=n*h+i*d-j*e,e=-i* -e-j*d-k*h;c.x=p*n+e*-i+q*-k-t*-j;c.y=q*n+e*-j+t*-i-p*-k;c.z=t*n+e*-k+p*-j-q*-i;return c}};THREE.Quaternion.slerp=function(b,c,e,d){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var i=Math.acos(h),j=Math.sqrt(1-h*h);if(Math.abs(j)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-d)*i)/j;d=Math.sin(d*i)/j;e.w=b.w*h+c.w*d;e.x=b.x*h+c.x*d;e.y=b.y*h+c.y*d;e.z=b.z*h+c.z*d;return e}; -THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,d,h,i){this.a=b;this.b=c;this.c=e;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=i instanceof Array?i:[i];this.centroid=new THREE.Vector3}; -THREE.Face4=function(b,c,e,d,h,i,j){this.a=b;this.b=c;this.c=e;this.d=d;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=i instanceof THREE.Color?i:new THREE.Color;this.vertexColors=i instanceof Array?i:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0}; +this.x,d=this.y,f=this.z,h=this.w,i=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+h*i+d*k-f*j;this.y=d*b+h*j+f*i-c*k;this.z=f*b+h*k+c*j-d*i;this.w=h*b-c*i-d*j-f*k;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var d=b.x,f=b.y,h=b.z,i=this.x,j=this.y,k=this.z,n=this.w,m=n*d+j*h-k*f,r=n*f+k*d-i*h,o=n*h+i*f-j*d,d=-i* +d-j*f-k*h;c.x=m*n+d*-i+r*-k-o*-j;c.y=r*n+d*-j+o*-i-m*-k;c.z=o*n+d*-k+m*-j-r*-i;return c}};THREE.Quaternion.slerp=function(b,c,d,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return d.w=b.w,d.x=b.x,d.y=b.y,d.z=b.z,d;var i=Math.acos(h),j=Math.sqrt(1-h*h);if(Math.abs(j)<0.0010)return d.w=0.5*(b.w+c.w),d.x=0.5*(b.x+c.x),d.y=0.5*(b.y+c.y),d.z=0.5*(b.z+c.z),d;h=Math.sin((1-f)*i)/j;f=Math.sin(f*i)/j;d.w=b.w*h+c.w*f;d.x=b.x*h+c.x*f;d.y=b.y*h+c.y*f;d.z=b.z*h+c.z*f;return d}; +THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,d,f,h,i){this.a=b;this.b=c;this.c=d;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=i instanceof Array?i:[i];this.centroid=new THREE.Vector3}; +THREE.Face4=function(b,c,d,f,h,i,j){this.a=b;this.b=c;this.c=d;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=i instanceof THREE.Color?i:new THREE.Color;this.vertexColors=i instanceof Array?i:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; -THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var e=0,d=this.vertices.length;e0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x], -y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.z< -this.boundingBox.z[0])this.boundingBox.z[0]=b.position.z;else if(b.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;cthis.points.length-2?i:i+1;e[3]=i>this.points.length-3?i:i+2;p=this.points[e[0]];q=this.points[e[1]]; -t=this.points[e[2]];s=this.points[e[3]];k=j*j;n=j*k;d.x=c(p.x,q.x,t.x,s.x,j,k,n);d.y=c(p.y,q.y,t.y,s.y,j,k,n);d.z=c(p.z,q.z,t.z,s.z,j,k,n);return d};this.getControlPointsArray=function(){var b,c,e=this.points.length,d=[];for(b=0;b0){this.boundingBox={x:[this.vertices[0].position.x, +this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,d=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.ythis.boundingBox.y[1])this.boundingBox.y[1]= +b.position.y;if(b.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,d=this.vertices.length;cthis.points.length-2?i:i+1;d[3]=i>this.points.length-3?i:i+2;m=this.points[d[0]];r=this.points[d[1]]; +o=this.points[d[2]];v=this.points[d[3]];k=j*j;n=j*k;f.x=c(m.x,r.x,o.x,v.x,j,k,n);f.y=c(m.y,r.y,o.y,v.y,j,k,n);f.z=c(m.z,r.z,o.z,v.z,j,k,n);return f};this.getControlPointsArray=function(){var b,c,d=this.points.length,f=[];for(b=0;b1){b=e.matrixWorldInverse;b=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(var d=1;d=this.LODs[d].visibleAtDistance)this.LODs[d-1].object3D.visible=!1, -this.LODs[d].object3D.visible=!0;else break;for(;d1){b=d.matrixWorldInverse;b=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(var f=1;f=this.LODs[f].visibleAtDistance)this.LODs[f-1].object3D.visible=!1, +this.LODs[f].object3D.visible=!0;else break;for(;f= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness * shadow ) );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec3( shadowDarkness );\n#endif\n}\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 ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\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(b){var c,e,d,h={};for(c=0;c=0)c&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglVertexBuffer),f.vertexAttribPointer(b.position,3,f.FLOAT,!1,0,0));else if(j.morphTargetBase){d=i.program.attributes;j.morphTargetBase!== --1?(f.bindBuffer(f.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[j.morphTargetBase]),f.vertexAttribPointer(d.position,3,f.FLOAT,!1,0,0)):d.position>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglVertexBuffer),f.vertexAttribPointer(d.position,3,f.FLOAT,!1,0,0));if(j.morphTargetForcedOrder.length)for(var n=0,x=j.morphTargetForcedOrder,p=j.morphTargetInfluences;nz&&(q=m,z=p[q]);f.bindBuffer(f.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[q]);f.vertexAttribPointer(d["morphTarget"+n],3,f.FLOAT,!1,0,0);j.__webglMorphTargetInfluences[n]=z;x[q]=1;z=-1;n++}}i.program.uniforms.morphTargetInfluences!==null&&f.uniform1fv(i.program.uniforms.morphTargetInfluences, -j.__webglMorphTargetInfluences)}if(c){if(h.__webglCustomAttributes)for(k in h.__webglCustomAttributes)b[k]>=0&&(d=h.__webglCustomAttributes[k],f.bindBuffer(f.ARRAY_BUFFER,d.buffer),f.vertexAttribPointer(b[k],d.size,f.FLOAT,!1,0,0));b.color>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglColorBuffer),f.vertexAttribPointer(b.color,3,f.FLOAT,!1,0,0));b.normal>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglNormalBuffer),f.vertexAttribPointer(b.normal,3,f.FLOAT,!1,0,0));b.tangent>=0&&(f.bindBuffer(f.ARRAY_BUFFER, -h.__webglTangentBuffer),f.vertexAttribPointer(b.tangent,4,f.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(f.bindBuffer(f.ARRAY_BUFFER,h.__webglUVBuffer),f.vertexAttribPointer(b.uv,2,f.FLOAT,!1,0,0),f.enableVertexAttribArray(b.uv)):f.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(f.bindBuffer(f.ARRAY_BUFFER,h.__webglUV2Buffer),f.vertexAttribPointer(b.uv2,2,f.FLOAT,!1,0,0),f.enableVertexAttribArray(b.uv2)):f.disableVertexAttribArray(b.uv2));i.skinning&&b.skinVertexA>=0&&b.skinVertexB>= -0&&b.skinIndex>=0&&b.skinWeight>=0&&(f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinVertexABuffer),f.vertexAttribPointer(b.skinVertexA,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),f.vertexAttribPointer(b.skinVertexB,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),f.vertexAttribPointer(b.skinIndex,4,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),f.vertexAttribPointer(b.skinWeight,4,f.FLOAT,!1,0,0))}j instanceof THREE.Mesh?(i.wireframe? -(f.lineWidth(i.wireframeLinewidth),c&&f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),f.drawElements(f.LINES,h.__webglLineCount,f.UNSIGNED_SHORT,0)):(c&&f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),f.drawElements(f.TRIANGLES,h.__webglFaceCount,f.UNSIGNED_SHORT,0)),H.info.render.calls++,H.info.render.vertices+=h.__webglFaceCount,H.info.render.faces+=h.__webglFaceCount/3):j instanceof THREE.Line?(j=j.type==THREE.LineStrip?f.LINE_STRIP:f.LINES,f.lineWidth(i.linewidth),f.drawArrays(j, -0,h.__webglLineCount),H.info.render.calls++):j instanceof THREE.ParticleSystem?(f.drawArrays(f.POINTS,0,h.__webglParticleCount),H.info.render.calls++):j instanceof THREE.Ribbon&&(f.drawArrays(f.TRIANGLE_STRIP,0,h.__webglVertexCount),H.info.render.calls++)}}function h(b,c,d){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=f.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=f.createBuffer();b.hasPos&&(f.bindBuffer(f.ARRAY_BUFFER,b.__webglVertexBuffer),f.bufferData(f.ARRAY_BUFFER,b.positionArray, -f.DYNAMIC_DRAW),f.enableVertexAttribArray(c.attributes.position),f.vertexAttribPointer(c.attributes.position,3,f.FLOAT,!1,0,0));if(b.hasNormal){f.bindBuffer(f.ARRAY_BUFFER,b.__webglNormalBuffer);if(d==THREE.FlatShading){var e,h,i,j,k,x,n,p,q,m,t=b.count*3;for(m=0;m=0;f--)b[f].object==c&&b.splice(f,1)}function ta(b){function c(b){var e=[];f=0;for(d=b.length;f65535&&(m[k].counter+=1,n=m[k].hash+"_"+m[k].counter,b.geometryGroups[n]==void 0&&(b.geometryGroups[n]={faces:[],materials:j,vertices:0,numMorphTargets:p})),b.geometryGroups[n].faces.push(e),b.geometryGroups[n].vertices+=i;b.geometryGroupsList=[];for(var q in b.geometryGroups)b.geometryGroups[q].id=R++,b.geometryGroupsList.push(b.geometryGroups[q])}function ha(b,c,f){b.push({buffer:c,object:f, -opaque:{list:[],count:0},transparent:{list:[],count:0}})}function G(b){if(b!=ia){switch(b){case THREE.AdditiveBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.SRC_ALPHA,f.ONE);break;case THREE.SubtractiveBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.ZERO,f.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:f.blendEquation(f.FUNC_ADD);f.blendFunc(f.ZERO,f.SRC_COLOR);break;default:f.blendEquationSeparate(f.FUNC_ADD,f.FUNC_ADD),f.blendFuncSeparate(f.SRC_ALPHA,f.ONE_MINUS_SRC_ALPHA,f.ONE,f.ONE_MINUS_SRC_ALPHA)}ia= -b}}function v(b,c,d){(d.width&d.width-1)==0&&(d.height&d.height-1)==0?(f.texParameteri(b,f.TEXTURE_WRAP_S,$(c.wrapS)),f.texParameteri(b,f.TEXTURE_WRAP_T,$(c.wrapT)),f.texParameteri(b,f.TEXTURE_MAG_FILTER,$(c.magFilter)),f.texParameteri(b,f.TEXTURE_MIN_FILTER,$(c.minFilter)),f.generateMipmap(b)):(f.texParameteri(b,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(b,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(b,f.TEXTURE_MAG_FILTER,Ca(c.magFilter)),f.texParameteri(b,f.TEXTURE_MIN_FILTER,Ca(c.minFilter)))} -function T(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=f.createTexture(),H.info.memory.textures++;f.activeTexture(f.TEXTURE0+c);f.bindTexture(f.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?f.texImage2D(f.TEXTURE_2D,0,$(b.format),b.image.width,b.image.height,0,$(b.format),f.UNSIGNED_BYTE,b.image.data):f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,b.image);v(f.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else f.activeTexture(f.TEXTURE0+c),f.bindTexture(f.TEXTURE_2D, -b.__webglTexture)}function L(b,c){f.bindRenderbuffer(f.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,c.width,c.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_STENCIL,c.width,c.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_STENCIL_ATTACHMENT,f.RENDERBUFFER,b)):f.renderbufferStorage(f.RENDERBUFFER,f.RGBA4,c.width,c.height)} -function V(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=f.createTexture();if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];f.bindTexture(f.TEXTURE_CUBE_MAP,b.__webglTexture);v(f.TEXTURE_CUBE_MAP,b,b);for(var d=0;d<6;d++){b.__webglFramebuffer[d]=f.createFramebuffer();b.__webglRenderbuffer[d]=f.createRenderbuffer();f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+ -d,0,$(b.format),b.width,b.height,0,$(b.format),$(b.type),null);var e=b,h=f.TEXTURE_CUBE_MAP_POSITIVE_X+d;f.bindFramebuffer(f.FRAMEBUFFER,b.__webglFramebuffer[d]);f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,h,e.__webglTexture,0);L(b.__webglRenderbuffer[d],b)}}else b.__webglFramebuffer=f.createFramebuffer(),b.__webglRenderbuffer=f.createRenderbuffer(),f.bindTexture(f.TEXTURE_2D,b.__webglTexture),v(f.TEXTURE_2D,b,b),f.texImage2D(f.TEXTURE_2D,0,$(b.format),b.width,b.height,0,$(b.format), -$(b.type),null),d=f.TEXTURE_2D,f.bindFramebuffer(f.FRAMEBUFFER,b.__webglFramebuffer),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,d,b.__webglTexture,0),f.bindRenderbuffer(f.RENDERBUFFER,b.__webglRenderbuffer),L(b.__webglRenderbuffer,b);c?f.bindTexture(f.TEXTURE_CUBE_MAP,null):f.bindTexture(f.TEXTURE_2D,null);f.bindRenderbuffer(f.RENDERBUFFER,null);f.bindFramebuffer(f.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,d=b.width,b=b.height,h=e=0):(c=null, -d=va,b=Ka,e=Aa,h=Ea);c!=aa&&(f.bindFramebuffer(f.FRAMEBUFFER,c),f.viewport(e,h,d,b),aa=c)}function la(b){b instanceof THREE.WebGLRenderTargetCube?(f.bindTexture(f.TEXTURE_CUBE_MAP,b.__webglTexture),f.generateMipmap(f.TEXTURE_CUBE_MAP),f.bindTexture(f.TEXTURE_CUBE_MAP,null)):(f.bindTexture(f.TEXTURE_2D,b.__webglTexture),f.generateMipmap(f.TEXTURE_2D),f.bindTexture(f.TEXTURE_2D,null))}function Z(b,c){var d;b=="fragment"?d=f.createShader(f.FRAGMENT_SHADER):b=="vertex"&&(d=f.createShader(f.VERTEX_SHADER)); -f.shaderSource(d,c);f.compileShader(d);if(!f.getShaderParameter(d,f.COMPILE_STATUS))return console.error(f.getShaderInfoLog(d)),console.error(c),null;return d}function Ca(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return f.NEAREST;default:return f.LINEAR}}function $(b){switch(b){case THREE.RepeatWrapping:return f.REPEAT;case THREE.ClampToEdgeWrapping:return f.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return f.MIRRORED_REPEAT; -case THREE.NearestFilter:return f.NEAREST;case THREE.NearestMipMapNearestFilter:return f.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return f.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return f.LINEAR;case THREE.LinearMipMapNearestFilter:return f.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return f.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return f.BYTE;case THREE.UnsignedByteType:return f.UNSIGNED_BYTE;case THREE.ShortType:return f.SHORT;case THREE.UnsignedShortType:return f.UNSIGNED_SHORT; -case THREE.IntType:return f.INT;case THREE.UnsignedShortType:return f.UNSIGNED_INT;case THREE.FloatType:return f.FLOAT;case THREE.AlphaFormat:return f.ALPHA;case THREE.RGBFormat:return f.RGB;case THREE.RGBAFormat:return f.RGBA;case THREE.LuminanceFormat:return f.LUMINANCE;case THREE.LuminanceAlphaFormat:return f.LUMINANCE_ALPHA}return 0}var H=this,f,Ia=[],Za=null,aa=null,na=-1,D=null,R=0,U=null,W=null,ia=null,P=null,za=null,Ma=null,Sa=null,Ta=null,Aa=0,Ea=0,va=0,Ka=0,X=[new THREE.Vector4,new THREE.Vector4, -new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Fa=new THREE.Matrix4,Wa=new Float32Array(16),Xa=new Float32Array(16),Ja=new THREE.Vector4,ab={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},Ga=b.canvas!==void 0?b.canvas:document.createElement("canvas"),Q=b.stencil!==void 0?b.stencil:!0,fb=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,gb=b.antialias!==void 0?b.antialias:!1,wa=b.clearColor!== -void 0?new THREE.Color(b.clearColor):new THREE.Color(0),Ba=b.clearAlpha!==void 0?b.clearAlpha:0,$a=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=Ga;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight= -this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var sa,Va=[],b=THREE.ShaderLib.depthRGBA,db=THREE.UniformsUtils.clone(b.uniforms),Ya=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:db}),bb=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:db,morphTargets:!0});Ya._shadowPass= -!0;bb._shadowPass=!0;try{if(!(f=Ga.getContext("experimental-webgl",{antialias:gb,stencil:Q,preserveDrawingBuffer:fb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+f.getParameter(f.VERSION)+" | "+f.getParameter(f.VENDOR)+" | "+f.getParameter(f.RENDERER)+" | "+f.getParameter(f.SHADING_LANGUAGE_VERSION))}catch(hb){console.error(hb)}f.clearColor(0,0,0,1);f.clearDepth(1);f.clearStencil(0);f.enable(f.DEPTH_TEST);f.depthFunc(f.LEQUAL);f.frontFace(f.CCW);f.cullFace(f.BACK); -f.enable(f.CULL_FACE);f.enable(f.BLEND);f.blendEquation(f.FUNC_ADD);f.blendFunc(f.SRC_ALPHA,f.ONE_MINUS_SRC_ALPHA);f.clearColor(wa.r,wa.g,wa.b,Ba);this.context=f;var eb=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,r={};r.vertices=new Float32Array(16);r.faces=new Uint16Array(6);Q=0;r.vertices[Q++]=-1;r.vertices[Q++]=-1;r.vertices[Q++]=0;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=-1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]=1;r.vertices[Q++]= -0;r.vertices[Q++]=-1;r.vertices[Q++]=1;r.vertices[Q++]=0;Q=r.vertices[Q++]=0;r.faces[Q++]=0;r.faces[Q++]=1;r.faces[Q++]=2;r.faces[Q++]=0;r.faces[Q++]=2;r.faces[Q++]=3;r.vertexBuffer=f.createBuffer();r.elementBuffer=f.createBuffer();f.bindBuffer(f.ARRAY_BUFFER,r.vertexBuffer);f.bufferData(f.ARRAY_BUFFER,r.vertices,f.STATIC_DRAW);f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,r.elementBuffer);f.bufferData(f.ELEMENT_ARRAY_BUFFER,r.faces,f.STATIC_DRAW);r.program=f.createProgram();f.attachShader(r.program,Z("fragment", -THREE.ShaderLib.sprite.fragmentShader));f.attachShader(r.program,Z("vertex",THREE.ShaderLib.sprite.vertexShader));f.linkProgram(r.program);r.attributes={};r.uniforms={};r.attributes.position=f.getAttribLocation(r.program,"position");r.attributes.uv=f.getAttribLocation(r.program,"uv");r.uniforms.uvOffset=f.getUniformLocation(r.program,"uvOffset");r.uniforms.uvScale=f.getUniformLocation(r.program,"uvScale");r.uniforms.rotation=f.getUniformLocation(r.program,"rotation");r.uniforms.scale=f.getUniformLocation(r.program, -"scale");r.uniforms.alignment=f.getUniformLocation(r.program,"alignment");r.uniforms.color=f.getUniformLocation(r.program,"color");r.uniforms.map=f.getUniformLocation(r.program,"map");r.uniforms.opacity=f.getUniformLocation(r.program,"opacity");r.uniforms.useScreenCoordinates=f.getUniformLocation(r.program,"useScreenCoordinates");r.uniforms.affectedByDistance=f.getUniformLocation(r.program,"affectedByDistance");r.uniforms.screenPosition=f.getUniformLocation(r.program,"screenPosition");r.uniforms.modelViewMatrix= -f.getUniformLocation(r.program,"modelViewMatrix");r.uniforms.projectionMatrix=f.getUniformLocation(r.program,"projectionMatrix");var cb=!1;this.setSize=function(b,c){Ga.width=b;Ga.height=c;this.setViewport(0,0,Ga.width,Ga.height)};this.setViewport=function(b,c,d,e){Aa=b;Ea=c;va=d;Ka=e;f.viewport(Aa,Ea,va,Ka)};this.setScissor=function(b,c,d,e){f.scissor(b,c,d,e)};this.enableScissorTest=function(b){b?f.enable(f.SCISSOR_TEST):f.disable(f.SCISSOR_TEST)};this.setClearColorHex=function(b,c){wa.setHex(b); -Ba=c;f.clearColor(wa.r,wa.g,wa.b,Ba)};this.setClearColor=function(b,c){wa.copy(b);Ba=c;f.clearColor(wa.r,wa.g,wa.b,Ba)};this.getClearColor=function(){return wa};this.getClearAlpha=function(){return Ba};this.clear=function(b,c,d){var e=0;if(b==void 0||b)e|=f.COLOR_BUFFER_BIT;if(c==void 0||c)e|=f.DEPTH_BUFFER_BIT;if(d==void 0||d)e|=f.STENCIL_BUFFER_BIT;f.clear(e)};this.getContext=function(){return f};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray, -delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];f.deleteBuffer(c.__webglVertexBuffer);f.deleteBuffer(c.__webglNormalBuffer);f.deleteBuffer(c.__webglTangentBuffer);f.deleteBuffer(c.__webglColorBuffer);f.deleteBuffer(c.__webglUVBuffer);f.deleteBuffer(c.__webglUV2Buffer);f.deleteBuffer(c.__webglSkinVertexABuffer);f.deleteBuffer(c.__webglSkinVertexBBuffer);f.deleteBuffer(c.__webglSkinIndicesBuffer); -f.deleteBuffer(c.__webglSkinWeightsBuffer);f.deleteBuffer(c.__webglFaceBuffer);f.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d=0)c&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglVertexBuffer), +e.vertexAttribPointer(b.position,3,e.FLOAT,!1,0,0));else if(j.morphTargetBase){f=i.program.attributes;j.morphTargetBase!==-1?(e.bindBuffer(e.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[j.morphTargetBase]),e.vertexAttribPointer(f.position,3,e.FLOAT,!1,0,0)):f.position>=0&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglVertexBuffer),e.vertexAttribPointer(f.position,3,e.FLOAT,!1,0,0));if(j.morphTargetForcedOrder.length){k=0;var p=j.morphTargetForcedOrder;for(s=j.morphTargetInfluences;km&&(B=n,m=s[B]);e.bindBuffer(e.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[B]);e.vertexAttribPointer(f["morphTarget"+k],3,e.FLOAT,!1,0,0);j.__webglMorphTargetInfluences[k]= +m;p[B]=1;m=-1;k++}}i.program.uniforms.morphTargetInfluences!==null&&e.uniform1fv(i.program.uniforms.morphTargetInfluences,j.__webglMorphTargetInfluences)}if(c){if(h.__webglCustomAttributesList){k=0;for(s=h.__webglCustomAttributesList.length;k=0&&(e.bindBuffer(e.ARRAY_BUFFER,f.buffer),e.vertexAttribPointer(b[f.buffer.belongsToAttribute],f.size,e.FLOAT,!1,0,0))}b.color>=0&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglColorBuffer),e.vertexAttribPointer(b.color, +3,e.FLOAT,!1,0,0));b.normal>=0&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglNormalBuffer),e.vertexAttribPointer(b.normal,3,e.FLOAT,!1,0,0));b.tangent>=0&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglTangentBuffer),e.vertexAttribPointer(b.tangent,4,e.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(e.bindBuffer(e.ARRAY_BUFFER,h.__webglUVBuffer),e.vertexAttribPointer(b.uv,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(b.uv)):e.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(e.bindBuffer(e.ARRAY_BUFFER,h.__webglUV2Buffer), +e.vertexAttribPointer(b.uv2,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(b.uv2)):e.disableVertexAttribArray(b.uv2));i.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinVertexABuffer),e.vertexAttribPointer(b.skinVertexA,4,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),e.vertexAttribPointer(b.skinVertexB,4,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),e.vertexAttribPointer(b.skinIndex, +4,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),e.vertexAttribPointer(b.skinWeight,4,e.FLOAT,!1,0,0))}j instanceof THREE.Mesh?(i.wireframe?(e.lineWidth(i.wireframeLinewidth),c&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),e.drawElements(e.LINES,h.__webglLineCount,e.UNSIGNED_SHORT,0)):(c&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),e.drawElements(e.TRIANGLES,h.__webglFaceCount,e.UNSIGNED_SHORT,0)),J.info.render.calls++,J.info.render.vertices+=h.__webglFaceCount, +J.info.render.faces+=h.__webglFaceCount/3):j instanceof THREE.Line?(j=j.type==THREE.LineStrip?e.LINE_STRIP:e.LINES,e.lineWidth(i.linewidth),e.drawArrays(j,0,h.__webglLineCount),J.info.render.calls++):j instanceof THREE.ParticleSystem?(e.drawArrays(e.POINTS,0,h.__webglParticleCount),J.info.render.calls++):j instanceof THREE.Ribbon&&(e.drawArrays(e.TRIANGLE_STRIP,0,h.__webglVertexCount),J.info.render.calls++)}}function h(b,c,d){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=e.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer= +e.createBuffer();b.hasPos&&(e.bindBuffer(e.ARRAY_BUFFER,b.__webglVertexBuffer),e.bufferData(e.ARRAY_BUFFER,b.positionArray,e.DYNAMIC_DRAW),e.enableVertexAttribArray(c.attributes.position),e.vertexAttribPointer(c.attributes.position,3,e.FLOAT,!1,0,0));if(b.hasNormal){e.bindBuffer(e.ARRAY_BUFFER,b.__webglNormalBuffer);if(d==THREE.FlatShading){var f,h,i,j,s,p,k,m,n,o,r=b.count*3;for(o=0;o=0;e--)b[e].object==c&&b.splice(e,1)}function sa(b){function c(b){var f=[];e=0;for(d=b.length;e65535&&(n[k].counter+=1,m=n[k].hash+"_"+n[k].counter,b.geometryGroups[m]==void 0&&(b.geometryGroups[m]={faces:[],materials:j,vertices:0,numMorphTargets:o})),b.geometryGroups[m].faces.push(f),b.geometryGroups[m].vertices+=i;b.geometryGroupsList=[];for(var r in b.geometryGroups)b.geometryGroups[r].id=T++,b.geometryGroupsList.push(b.geometryGroups[r])} +function ha(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function O(b){if(b!=Y){switch(b){case THREE.AdditiveBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.SRC_ALPHA,e.ONE);break;case THREE.SubtractiveBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA, +e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)}Y=b}}function D(b,c,d){(d.width&d.width-1)==0&&(d.height&d.height-1)==0?(e.texParameteri(b,e.TEXTURE_WRAP_S,aa(c.wrapS)),e.texParameteri(b,e.TEXTURE_WRAP_T,aa(c.wrapT)),e.texParameteri(b,e.TEXTURE_MAG_FILTER,aa(c.magFilter)),e.texParameteri(b,e.TEXTURE_MIN_FILTER,aa(c.minFilter)),e.generateMipmap(b)):(e.texParameteri(b,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(b,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(b,e.TEXTURE_MAG_FILTER,Ca(c.magFilter)), +e.texParameteri(b,e.TEXTURE_MIN_FILTER,Ca(c.minFilter)))}function ka(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=e.createTexture(),J.info.memory.textures++;e.activeTexture(e.TEXTURE0+c);e.bindTexture(e.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?e.texImage2D(e.TEXTURE_2D,0,aa(b.format),b.image.width,b.image.height,0,aa(b.format),e.UNSIGNED_BYTE,b.image.data):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,b.image);D(e.TEXTURE_2D,b,b.image); +b.needsUpdate=!1}else e.activeTexture(e.TEXTURE0+c),e.bindTexture(e.TEXTURE_2D,b.__webglTexture)}function M(b,c){e.bindRenderbuffer(e.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,c.width,c.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,c.width,c.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT, +e.RENDERBUFFER,b)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,c.width,c.height)}function S(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=e.createTexture();if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];e.bindTexture(e.TEXTURE_CUBE_MAP,b.__webglTexture);D(e.TEXTURE_CUBE_MAP,b,b);for(var d=0;d<6;d++){b.__webglFramebuffer[d]=e.createFramebuffer();b.__webglRenderbuffer[d]= +e.createRenderbuffer();e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,aa(b.format),b.width,b.height,0,aa(b.format),aa(b.type),null);var f=b,h=e.TEXTURE_CUBE_MAP_POSITIVE_X+d;e.bindFramebuffer(e.FRAMEBUFFER,b.__webglFramebuffer[d]);e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,h,f.__webglTexture,0);M(b.__webglRenderbuffer[d],b)}}else b.__webglFramebuffer=e.createFramebuffer(),b.__webglRenderbuffer=e.createRenderbuffer(),e.bindTexture(e.TEXTURE_2D,b.__webglTexture),D(e.TEXTURE_2D,b,b),e.texImage2D(e.TEXTURE_2D, +0,aa(b.format),b.width,b.height,0,aa(b.format),aa(b.type),null),d=e.TEXTURE_2D,e.bindFramebuffer(e.FRAMEBUFFER,b.__webglFramebuffer),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,d,b.__webglTexture,0),e.bindRenderbuffer(e.RENDERBUFFER,b.__webglRenderbuffer),M(b.__webglRenderbuffer,b);c?e.bindTexture(e.TEXTURE_CUBE_MAP,null):e.bindTexture(e.TEXTURE_2D,null);e.bindRenderbuffer(e.RENDERBUFFER,null);e.bindFramebuffer(e.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer, +d=b.width,b=b.height,h=f=0):(c=null,d=Aa,b=Ra,f=va,h=Da);c!=U&&(e.bindFramebuffer(e.FRAMEBUFFER,c),e.viewport(f,h,d,b),U=c)}function la(b){b instanceof THREE.WebGLRenderTargetCube?(e.bindTexture(e.TEXTURE_CUBE_MAP,b.__webglTexture),e.generateMipmap(e.TEXTURE_CUBE_MAP),e.bindTexture(e.TEXTURE_CUBE_MAP,null)):(e.bindTexture(e.TEXTURE_2D,b.__webglTexture),e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null))}function ia(b,c){var d;b=="fragment"?d=e.createShader(e.FRAGMENT_SHADER):b=="vertex"&& +(d=e.createShader(e.VERTEX_SHADER));e.shaderSource(d,c);e.compileShader(d);if(!e.getShaderParameter(d,e.COMPILE_STATUS))return console.error(e.getShaderInfoLog(d)),console.error(c),null;return d}function Ca(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return e.NEAREST;default:return e.LINEAR}}function aa(b){switch(b){case THREE.RepeatWrapping:return e.REPEAT;case THREE.ClampToEdgeWrapping:return e.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return e.MIRRORED_REPEAT; +case THREE.NearestFilter:return e.NEAREST;case THREE.NearestMipMapNearestFilter:return e.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return e.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return e.LINEAR;case THREE.LinearMipMapNearestFilter:return e.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return e.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return e.BYTE;case THREE.UnsignedByteType:return e.UNSIGNED_BYTE;case THREE.ShortType:return e.SHORT;case THREE.UnsignedShortType:return e.UNSIGNED_SHORT; +case THREE.IntType:return e.INT;case THREE.UnsignedShortType:return e.UNSIGNED_INT;case THREE.FloatType:return e.FLOAT;case THREE.AlphaFormat:return e.ALPHA;case THREE.RGBFormat:return e.RGB;case THREE.RGBAFormat:return e.RGBA;case THREE.LuminanceFormat:return e.LUMINANCE;case THREE.LuminanceAlphaFormat:return e.LUMINANCE_ALPHA}return 0}var J=this,e,La=[],Ya=null,U=null,W=-1,G=null,T=0,X=null,qa=null,Y=null,N=null,za=null,Ha=null,Sa=null,Ta=null,va=0,Da=0,Aa=0,Ra=0,wa=[new THREE.Vector4,new THREE.Vector4, +new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ea=new THREE.Matrix4,Va=new Float32Array(16),Wa=new Float32Array(16),Ja=new THREE.Vector4,$a={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},Ba=b.canvas!==void 0?b.canvas:document.createElement("canvas"),P=b.stencil!==void 0?b.stencil:!0,eb=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,fb=b.antialias!==void 0?b.antialias:!1,ta=b.clearColor!== +void 0?new THREE.Color(b.clearColor):new THREE.Color(0),Fa=b.clearAlpha!==void 0?b.clearAlpha:0,Za=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=Ba;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight= +this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var Z,Ua=[],b=THREE.ShaderLib.depthRGBA,cb=THREE.UniformsUtils.clone(b.uniforms),Xa=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:cb}),ab=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:cb,morphTargets:!0});Xa._shadowPass= +!0;ab._shadowPass=!0;try{if(!(e=Ba.getContext("experimental-webgl",{antialias:fb,stencil:P,preserveDrawingBuffer:eb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+e.getParameter(e.VERSION)+" | "+e.getParameter(e.VENDOR)+" | "+e.getParameter(e.RENDERER)+" | "+e.getParameter(e.SHADING_LANGUAGE_VERSION))}catch(gb){console.error(gb)}e.clearColor(0,0,0,1);e.clearDepth(1);e.clearStencil(0);e.enable(e.DEPTH_TEST);e.depthFunc(e.LEQUAL);e.frontFace(e.CCW);e.cullFace(e.BACK); +e.enable(e.CULL_FACE);e.enable(e.BLEND);e.blendEquation(e.FUNC_ADD);e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA);e.clearColor(ta.r,ta.g,ta.b,Fa);this.context=e;var db=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,u={};u.vertices=new Float32Array(16);u.faces=new Uint16Array(6);P=0;u.vertices[P++]=-1;u.vertices[P++]=-1;u.vertices[P++]=0;u.vertices[P++]=1;u.vertices[P++]=1;u.vertices[P++]=-1;u.vertices[P++]=1;u.vertices[P++]=1;u.vertices[P++]=1;u.vertices[P++]=1;u.vertices[P++]=1;u.vertices[P++]= +0;u.vertices[P++]=-1;u.vertices[P++]=1;u.vertices[P++]=0;P=u.vertices[P++]=0;u.faces[P++]=0;u.faces[P++]=1;u.faces[P++]=2;u.faces[P++]=0;u.faces[P++]=2;u.faces[P++]=3;u.vertexBuffer=e.createBuffer();u.elementBuffer=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u.vertexBuffer);e.bufferData(e.ARRAY_BUFFER,u.vertices,e.STATIC_DRAW);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,u.elementBuffer);e.bufferData(e.ELEMENT_ARRAY_BUFFER,u.faces,e.STATIC_DRAW);u.program=e.createProgram();e.attachShader(u.program,ia("fragment", +THREE.ShaderLib.sprite.fragmentShader));e.attachShader(u.program,ia("vertex",THREE.ShaderLib.sprite.vertexShader));e.linkProgram(u.program);u.attributes={};u.uniforms={};u.attributes.position=e.getAttribLocation(u.program,"position");u.attributes.uv=e.getAttribLocation(u.program,"uv");u.uniforms.uvOffset=e.getUniformLocation(u.program,"uvOffset");u.uniforms.uvScale=e.getUniformLocation(u.program,"uvScale");u.uniforms.rotation=e.getUniformLocation(u.program,"rotation");u.uniforms.scale=e.getUniformLocation(u.program, +"scale");u.uniforms.alignment=e.getUniformLocation(u.program,"alignment");u.uniforms.color=e.getUniformLocation(u.program,"color");u.uniforms.map=e.getUniformLocation(u.program,"map");u.uniforms.opacity=e.getUniformLocation(u.program,"opacity");u.uniforms.useScreenCoordinates=e.getUniformLocation(u.program,"useScreenCoordinates");u.uniforms.affectedByDistance=e.getUniformLocation(u.program,"affectedByDistance");u.uniforms.screenPosition=e.getUniformLocation(u.program,"screenPosition");u.uniforms.modelViewMatrix= +e.getUniformLocation(u.program,"modelViewMatrix");u.uniforms.projectionMatrix=e.getUniformLocation(u.program,"projectionMatrix");var bb=!1;this.setSize=function(b,c){Ba.width=b;Ba.height=c;this.setViewport(0,0,Ba.width,Ba.height)};this.setViewport=function(b,c,d,f){va=b;Da=c;Aa=d;Ra=f;e.viewport(va,Da,Aa,Ra)};this.setScissor=function(b,c,d,f){e.scissor(b,c,d,f)};this.enableScissorTest=function(b){b?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST)};this.setClearColorHex=function(b,c){ta.setHex(b); +Fa=c;e.clearColor(ta.r,ta.g,ta.b,Fa)};this.setClearColor=function(b,c){ta.copy(b);Fa=c;e.clearColor(ta.r,ta.g,ta.b,Fa)};this.getClearColor=function(){return ta};this.getClearAlpha=function(){return Fa};this.clear=function(b,c,d){var f=0;if(b==void 0||b)f|=e.COLOR_BUFFER_BIT;if(c==void 0||c)f|=e.DEPTH_BUFFER_BIT;if(d==void 0||d)f|=e.STENCIL_BUFFER_BIT;e.clear(f)};this.getContext=function(){return e};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray, +delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];e.deleteBuffer(c.__webglVertexBuffer);e.deleteBuffer(c.__webglNormalBuffer);e.deleteBuffer(c.__webglTangentBuffer);e.deleteBuffer(c.__webglColorBuffer);e.deleteBuffer(c.__webglUVBuffer);e.deleteBuffer(c.__webglUV2Buffer);e.deleteBuffer(c.__webglSkinVertexABuffer);e.deleteBuffer(c.__webglSkinVertexBBuffer);e.deleteBuffer(c.__webglSkinIndicesBuffer); +e.deleteBuffer(c.__webglSkinWeightsBuffer);e.deleteBuffer(c.__webglFaceBuffer);e.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var d=0,f=c.numMorphTargets;d=0&&f.enableVertexAttribArray(s.position);s.color>=0&&f.enableVertexAttribArray(s.color);s.normal>=0&&f.enableVertexAttribArray(s.normal);s.tangent>=0&&f.enableVertexAttribArray(s.tangent); -b.skinning&&s.skinVertexA>=0&&s.skinVertexB>=0&&s.skinIndex>=0&&s.skinWeight>=0&&(f.enableVertexAttribArray(s.skinVertexA),f.enableVertexAttribArray(s.skinVertexB),f.enableVertexAttribArray(s.skinIndex),f.enableVertexAttribArray(s.skinWeight));if(b.attributes)for(i in b.attributes)s[i]!==void 0&&s[i]>=0&&f.enableVertexAttribArray(s[i]);if(b.morphTargets)for(i=b.numSupportedMorphTargets=0;i=0&&(f.enableVertexAttribArray(s[v]),b.numSupportedMorphTargets++); -b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,d,f){V(b);this.clear(c,d,f)};this.updateShadowMap=function(b,c){y(b,c)};this.render=function(b,c,t,r){var I,v,Da,S,x,Ua,z,Qa,Ra=b.lights,M=b.fog;na=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&y(b,c);H.info.render.calls=0;H.info.render.vertices=0;H.info.render.faces=0;if(c.matrixAutoUpdate){for(x=c;x.parent;)x=x.parent;x.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Xa); -c.projectionMatrix.flattenToArray(Wa);Fa.multiply(c.projectionMatrix,c.matrixWorldInverse);p(Fa);this.initWebGLObjects(b);V(t);(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);x=b.__webglObjects.length;for(r=0;r=0;r--)if(I=b.__webglObjects[r],I.render){z=I.object;Qa=I.buffer;Da=I.opaque;i(z);for(I=0;I0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(n* -2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(n*2)}if(k.geometry.skinWeights.length&&k.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(n*4),j.__skinVertexBArray=new Float32Array(n*4),j.__skinIndexArray=new Float32Array(n*4),j.__skinWeightArray=new Float32Array(n*4);j.__faceArray=new Uint16Array(v*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0));j.__lineArray=new Uint16Array(B*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(r= -j.numMorphTargets;t=0;i--)e[i]==h&&e.splice(i,1)}else(d instanceof THREE.MarchingCubes||d.immediateRenderCallback)&&ja(e.__webglObjectsImmediate,d);d.__webglActive=!1;b.__objectsRemoved.splice(0,1)}d=0;for(e=b.__webglObjects.length;d0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglColorBuffer),f.bufferData(f.ARRAY_BUFFER,ra,v));Ca&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglNormalBuffer),f.bufferData(f.ARRAY_BUFFER,W,v));Ea&&ua.hasTangents&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglTangentBuffer),f.bufferData(f.ARRAY_BUFFER,ca,v));va&&$>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglUVBuffer),f.bufferData(f.ARRAY_BUFFER,la,v));va&&aa>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglUV2Buffer),f.bufferData(f.ARRAY_BUFFER, -na,v));Aa&&(f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,m.__webglFaceBuffer),f.bufferData(f.ELEMENT_ARRAY_BUFFER,ia,v),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,m.__webglLineBuffer),f.bufferData(f.ELEMENT_ARRAY_BUFFER,X,v));w>0&&(f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinVertexABuffer),f.bufferData(f.ARRAY_BUFFER,da,v),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinVertexBBuffer),f.bufferData(f.ARRAY_BUFFER,ea,v),f.bindBuffer(f.ARRAY_BUFFER,m.__webglSkinIndicesBuffer),f.bufferData(f.ARRAY_BUFFER,fa,v),f.bindBuffer(f.ARRAY_BUFFER, -m.__webglSkinWeightsBuffer),f.bufferData(f.ARRAY_BUFFER,ga,v));B&&(delete m.__inittedArrays,delete m.__colorArray,delete m.__normalArray,delete m.__tangentArray,delete m.__uvArray,delete m.__uv2Array,delete m.__faceArray,delete m.__vertexArray,delete m.__lineArray,delete m.__skinVertexAArray,delete m.__skinVertexBArray,delete m.__skinIndexArray,delete m.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors= -!1;ya(j)}else if(i instanceof THREE.Ribbon){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=f.DYNAMIC_DRAW;k=t=B=B=void 0;p=i.vertices;n=i.colors;q=p.length;m=n.length;r=i.__vertexArray;v=i.__colorArray;y=i.__dirtyColors;if(i.__dirtyVertices){for(B=0;B=0&&e.enableVertexAttribArray(x.position);x.color>=0&&e.enableVertexAttribArray(x.color);x.normal>=0&&e.enableVertexAttribArray(x.normal);x.tangent>=0&&e.enableVertexAttribArray(x.tangent); +b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(e.enableVertexAttribArray(x.skinVertexA),e.enableVertexAttribArray(x.skinVertexB),e.enableVertexAttribArray(x.skinIndex),e.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(i in b.attributes)x[i]!==void 0&&x[i]>=0&&e.enableVertexAttribArray(x[i]);if(b.morphTargets)for(i=b.numSupportedMorphTargets=0;i=0&&(e.enableVertexAttribArray(x[w]),b.numSupportedMorphTargets++); +b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,d,e){S(b);this.clear(c,d,e)};this.updateShadowMap=function(b,c){F(b,c)};this.render=function(b,c,o,u){var K,Ia,ra,s,p,D,B,Pa,Qa=b.lights,x=b.fog;W=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&F(b,c);J.info.render.calls=0;J.info.render.vertices=0;J.info.render.faces=0;if(c.matrixAutoUpdate){for(p=c;p.parent;)p=p.parent;p.update(void 0,!0)}b.update(void 0,!1,c);c.matrixWorldInverse.flattenToArray(Wa); +c.projectionMatrix.flattenToArray(Va);Ea.multiply(c.projectionMatrix,c.matrixWorldInverse);m(Ea);this.initWebGLObjects(b);S(o);(this.autoClear||u)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);p=b.__webglObjects.length;for(u=0;u=0;u--)if(K=b.__webglObjects[u],K.render){B=K.object;Pa=K.buffer;ra=K.opaque;i(B);for(K=0;K0||v.faceVertexUvs.length>0)j.__uvArray=new Float32Array(m* +2);if(v.faceUvs.length>1||v.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(m*2)}if(k.geometry.skinWeights.length&&k.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(m*4),j.__skinVertexBArray=new Float32Array(m*4),j.__skinIndexArray=new Float32Array(m*4),j.__skinWeightArray=new Float32Array(m*4);j.__faceArray=new Uint16Array(u*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0));j.__lineArray=new Uint16Array(w*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];v=0;for(x= +j.numMorphTargets;v=0;i--)f[i]==h&&f.splice(i,1)}else(d instanceof THREE.MarchingCubes||d.immediateRenderCallback)&&ja(f.__webglObjectsImmediate,d);d.__webglActive=!1;b.__objectsRemoved.splice(0,1)}d=0;for(f=b.__webglObjects.length;d0&&(e.bindBuffer(e.ARRAY_BUFFER,p.__webglColorBuffer),e.bufferData(e.ARRAY_BUFFER,pa,u));Aa&&(e.bindBuffer(e.ARRAY_BUFFER,p.__webglNormalBuffer),e.bufferData(e.ARRAY_BUFFER,W,u));Ca&&ua.hasTangents&&(e.bindBuffer(e.ARRAY_BUFFER,p.__webglTangentBuffer),e.bufferData(e.ARRAY_BUFFER,ca,u));va&&X>0&&(e.bindBuffer(e.ARRAY_BUFFER,p.__webglUVBuffer),e.bufferData(e.ARRAY_BUFFER,ka,u));va&&aa>0&&(e.bindBuffer(e.ARRAY_BUFFER,p.__webglUV2Buffer),e.bufferData(e.ARRAY_BUFFER, +la,u));za&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,p.__webglFaceBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,ia,u),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,p.__webglLineBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,Y,u));z>0&&(e.bindBuffer(e.ARRAY_BUFFER,p.__webglSkinVertexABuffer),e.bufferData(e.ARRAY_BUFFER,da,u),e.bindBuffer(e.ARRAY_BUFFER,p.__webglSkinVertexBBuffer),e.bufferData(e.ARRAY_BUFFER,ea,u),e.bindBuffer(e.ARRAY_BUFFER,p.__webglSkinIndicesBuffer),e.bufferData(e.ARRAY_BUFFER,fa,u),e.bindBuffer(e.ARRAY_BUFFER, +p.__webglSkinWeightsBuffer),e.bufferData(e.ARRAY_BUFFER,ga,u));w&&(delete p.__inittedArrays,delete p.__colorArray,delete p.__normalArray,delete p.__tangentArray,delete p.__uvArray,delete p.__uv2Array,delete p.__faceArray,delete p.__vertexArray,delete p.__lineArray,delete p.__skinVertexAArray,delete p.__skinVertexBArray,delete p.__skinIndexArray,delete p.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors= +!1;ya(j)}else if(i instanceof THREE.Ribbon){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=e.DYNAMIC_DRAW;k=v=w=w=void 0;n=i.vertices;m=i.colors;o=n.length;p=m.length;x=i.__vertexArray;u=i.__colorArray;E=i.__dirtyColors;if(i.__dirtyVertices){for(w=0;w= 0 ) { + attribute = geometryGroup.__webglCustomAttributesList[ i ]; - attribute = geometryGroup.__webglCustomAttributes[ a ]; + if( attributes[ attribute.buffer.belongsToAttribute ] >= 0 ) { _gl.bindBuffer( _gl.ARRAY_BUFFER, attribute.buffer ); - _gl.vertexAttribPointer( attributes[ a ], attribute.size, _gl.FLOAT, false, 0, 0 ); + _gl.vertexAttribPointer( attributes[ attribute.buffer.belongsToAttribute ], attribute.size, _gl.FLOAT, false, 0, 0 ); } @@ -3028,29 +3029,6 @@ THREE.WebGLRenderer = function ( parameters ) { } - /* if ( material.attributes ) { - - for( a in material.attributes ) { - - if( attributes[ a ] !== undefined && attributes[ a ] >= 0 ) { - - attribute = material.attributes[ a ]; - - if( attribute.buffer ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, attribute.buffer ); - _gl.vertexAttribPointer( attributes[ a ], attribute.size, _gl.FLOAT, false, 0, 0 ); - - } - - } - - } - - }*/ - - - // colors if ( attributes.color >= 0 ) { From 942a6c89c95023820ec44da3ece07ab792e8c0fb Mon Sep 17 00:00:00 2001 From: alteredq Date: Sat, 15 Oct 2011 00:57:50 +0200 Subject: [PATCH 16/33] Updated Clock to be more compatible with Timer (now uses seconds and getDelta API). Lots of code got cleaner with seconds, seems we used them before all around. Also changed examples that didn't need deltas to simple Date.now() plus some more examples cleaning, trying to get rid of obsolescence warnings. --- build/Three.js | 30 ++++----- build/custom/ThreeCanvas.js | 4 +- build/custom/ThreeDOM.js | 4 +- build/custom/ThreeExtras.js | 22 +++---- build/custom/ThreeSVG.js | 4 +- build/custom/ThreeWebGL.js | 4 +- examples/misc_camera_path.html | 4 +- examples/misc_camera_roll.html | 2 +- examples/misc_lookat.html | 2 +- examples/misc_materials_multimaterials.html | 10 ++- examples/misc_sound.html | 4 +- examples/webgl_animation_skinning.html | 11 ++-- examples/webgl_collada.html | 8 +-- examples/webgl_collisions_mesh.html | 2 +- examples/webgl_collisions_terrain.html | 8 ++- examples/webgl_custom_attributes.html | 21 +++---- .../webgl_custom_attributes_particles.html | 12 +--- .../webgl_custom_attributes_particles2.html | 13 +--- .../webgl_custom_attributes_particles3.html | 24 +++---- examples/webgl_flycamera_earth.html | 8 +-- examples/webgl_geometries.html | 26 ++++---- .../webgl_geometry_blenderexport_colors.html | 4 +- examples/webgl_geometry_dynamic.html | 6 +- examples/webgl_geometry_hierarchy.html | 10 ++- examples/webgl_geometry_hierarchy2.html | 11 ++-- examples/webgl_geometry_large_mesh.html | 36 ++++++----- examples/webgl_geometry_minecraft.html | 2 +- examples/webgl_geometry_minecraft_ao.html | 2 +- examples/webgl_geometry_shapes.html | 2 +- examples/webgl_geometry_terrain.html | 2 +- examples/webgl_geometry_terrain_fog.html | 4 +- examples/webgl_geometry_text.html | 12 ++-- examples/webgl_hdr.html | 9 ++- examples/webgl_lights_pointlights.html | 2 +- examples/webgl_lines_colors.html | 2 +- examples/webgl_lines_cubes.html | 16 +++-- examples/webgl_lines_sphere.html | 9 ++- examples/webgl_lines_splines.html | 6 +- examples/webgl_materials.html | 4 +- examples/webgl_materials_cars.html | 4 +- examples/webgl_materials_cars_anaglyph.html | 2 +- examples/webgl_materials_cars_camaro.html | 4 +- ...webgl_materials_cars_camaro_crosseyed.html | 2 +- .../webgl_materials_cars_parallaxbarrier.html | 2 +- examples/webgl_materials_cubemap.html | 2 +- ...gl_materials_cubemap_balls_reflection.html | 4 +- ...als_cubemap_balls_reflection_anaglyph.html | 4 +- ...gl_materials_cubemap_balls_refraction.html | 4 +- ...ls_cubemap_balls_refraction_crosseyed.html | 4 +- examples/webgl_materials_cubemap_dynamic.html | 2 +- .../webgl_materials_cubemap_refraction.html | 2 +- examples/webgl_materials_grass.html | 2 +- examples/webgl_materials_normalmap2.html | 2 +- examples/webgl_materials_shaders.html | 2 +- examples/webgl_materials_shaders_fresnel.html | 4 +- examples/webgl_materials_skin.html | 2 +- examples/webgl_materials_video.html | 2 +- examples/webgl_morphtargets_horse.html | 2 +- examples/webgl_particles_billboards.html | 8 +-- .../webgl_particles_billboards_colors.html | 4 +- examples/webgl_particles_dynamic.html | 20 +++--- examples/webgl_particles_random.html | 10 +-- examples/webgl_particles_shapes.html | 7 +-- examples/webgl_particles_sprites.html | 18 +++--- examples/webgl_postprocessing.html | 5 +- examples/webgl_postprocessing_dof.html | 13 ++-- examples/webgl_rtt.html | 2 +- examples/webgl_shader2.html | 6 +- examples/webgl_shader_lava.html | 10 ++- examples/webgl_shading_physical.html | 4 +- examples/webgl_shadowmap.html | 62 +++++++++---------- examples/webgl_trackballcamera_earth.html | 16 +++-- src/core/Clock.js | 10 +-- src/extras/controls/FirstPersonControls.js | 2 - src/extras/controls/FlyControls.js | 2 - src/extras/controls/PathControls.js | 2 - src/extras/controls/RollControls.js | 2 - src/objects/Bone.js | 6 +- src/objects/SkinnedMesh.js | 22 +++---- 79 files changed, 300 insertions(+), 345 deletions(-) diff --git a/build/Three.js b/build/Three.js index a00a8e89..6ceac495 100644 --- a/build/Three.js +++ b/build/Three.js @@ -1,6 +1,6 @@ // Three.js r46dev - http://github.com/mrdoob/three.js -var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Clock=function(b){this.autoStart=b!==void 0?b:!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.elapsed();this.running=!1};THREE.Clock.prototype.elapsed=function(){this.elapsedTime+=this.delta();return this.elapsedTime}; -THREE.Clock.prototype.delta=function(){var b=0;this.autoStart&&!this.running&&this.start();if(this.running){var c=Date.now(),b=c-this.oldTime;this.oldTime=c;this.elapsedTime+=b}return b};THREE.Color=function(b){b!==void 0&&this.setHex(b);return this}; +var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Clock=function(b){this.autoStart=b!==void 0?b:!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 b=0;this.autoStart&&!this.running&&this.start();if(this.running){var c=Date.now(),b=0.0010*(c-this.oldTime);this.oldTime=c;this.elapsedTime+=b}return b};THREE.Color=function(b){b!==void 0&&this.setHex(b);return this}; THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},copyGammaToLinear:function(b){this.r=b.r*b.r;this.g=b.g*b.g;this.b=b.b*b.b;return this},copyLinearToGamma:function(b){this.r=Math.sqrt(b.r);this.g=Math.sqrt(b.g);this.b=Math.sqrt(b.b);return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var f,h,k;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),h=b*6-f,b=e*(1-c),k=e*(1- c*h),c=e*(1-c*(1-h)),f){case 1:this.r=k;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=k;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=e;this.g=b;this.b=k;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0}; @@ -130,9 +130,9 @@ THREE.Mesh=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.material e}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(b){if(this.morphTargetDictionary[b]!==void 0)return this.morphTargetDictionary[b];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+b+" does not exist. Returning 0.");return 0}; THREE.Bone=function(b){THREE.Object3D.call(this);this.skin=b;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype; THREE.Bone.prototype.update=function(b,c,e){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate)b?this.skinMatrix.multiply(b,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,c=!0;var f,h=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(f=0;f=0?b:b+m;c=this.verticalAngleMap.srcRange; +this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var m=Math.PI*2,n=Math.PI/180;this.update=function(b){var c;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed*b);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed*b);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*n;this.theta=this.lon*n;b=this.phi%m;this.phi=b>=0?b:b+m;c=this.verticalAngleMap.srcRange; b=this.verticalAngleMap.dstRange;c=THREE.Math.mapLinear(this.phi,c[0],c[1],b[0],b[1]);var f=b[1]-b[0];this.phi=e((c-b[0])/f)*f+b[0];c=this.horizontalAngleMap.srcRange;b=this.horizontalAngleMap.dstRange;c=THREE.Math.mapLinear(this.theta,c[0],c[1],b[0],b[1]);f=b[1]-b[0];this.theta=e((c-b[0])/f)*f+b[0];b=this.target.position;b.x=100*Math.sin(this.phi)*Math.cos(this.theta);b.y=100*Math.cos(this.phi);b.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),e=new THREE.MeshLambertMaterial({color:65280}), c=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,b);b=new THREE.Mesh(m,e);b.position.set(0,10,0);this.animation=h(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(b)}else this.animation=h(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var b= @@ -468,15 +468,15 @@ THREE.FlyControls=function(b,c){function e(b,e){return function(){e.apply(b,argu 1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(b){switch(b.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down= 0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(b){this.domElement!==document&&this.domElement.focus();b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(b.button){case 0:this.object.moveForward= !0;break;case 2:this.object.moveBackward=!0}};this.mousemove=function(b){if(!this.dragToLook||this.mouseStatus>0){var e=this.getContainerDimensions(),c=e.size[0]/2,m=e.size[1]/2;this.moveState.yawLeft=-(b.pageX-e.offset[0]-c)/c;this.moveState.pitchDown=(b.pageY-e.offset[1]-m)/m;this.updateRotationVector()}};this.mouseup=function(b){b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(b.button){case 0:this.moveForward= -!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(b){b*=0.0010;var e=b*this.movementSpeed;b*=this.rollSpeed;this.object.translateX(this.moveVector.x*e);this.object.translateY(this.moveVector.y*e);this.object.translateZ(this.moveVector.z*e);this.tmpQuaternion.set(this.rotationVector.x*b,this.rotationVector.y*b,this.rotationVector.z*b,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion); +!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(b){var e=b*this.movementSpeed;b*=this.rollSpeed;this.object.translateX(this.moveVector.x*e);this.object.translateY(this.moveVector.y*e);this.object.translateZ(this.moveVector.z*e);this.tmpQuaternion.set(this.rotationVector.x*b,this.rotationVector.y*b,this.rotationVector.z*b,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion); this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var b=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z= -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",e(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",e(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",e(this, this.mouseup),!1);this.domElement.addEventListener("keydown",e(this,this.keydown),!1);this.domElement.addEventListener("keyup",e(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(b,c){this.object=b;this.domElement=c!==void 0?c:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Matrix4,m=!1,n=1,p=0,t=0,w=0,u=0,x=0,v=window.innerWidth/2,A=window.innerHeight/2;this.update=function(b){b*=0.0010;if(this.mouseLook){var c= -b*this.lookSpeed;this.rotateHorizontally(c*u);this.rotateVertically(c*x)}c=b*this.movementSpeed;this.object.translateZ(-c*(p>0||this.autoForward&&!(p<0)?1:p));this.object.translateX(c*t);this.object.translateY(c*w);m&&(this.roll+=this.rollSpeed*b*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y0||this.autoForward&&!(p<0)?1:p));this.object.translateX(c*t);this.object.translateY(c*w);m&&(this.roll+=this.rollSpeed*b*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y=0?a:a+g;b=this.verticalAngleMap.srcRange; +this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var g=Math.PI*2,k=Math.PI/180;this.update=function(a){var b;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed*a);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed*a);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*k;this.theta=this.lon*k;a=this.phi%g;this.phi=a>=0?a:a+g;b=this.verticalAngleMap.srcRange; a=this.verticalAngleMap.dstRange;b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var e=a[1]-a[0];this.phi=c((b-a[0])/e)*e+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);e=a[1]-a[0];this.theta=c((b-a[0])/e)*e+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}), b=new THREE.CubeGeometry(10,10,20),g=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(b,a);a=new THREE.Mesh(g,c);a.position.set(0,10,0);this.animation=f(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=f(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a= @@ -115,15 +115,15 @@ THREE.FlyControls=function(a,b){function c(a,c){return function(){c.apply(a,argu 1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(a){switch(a.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down= 0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(a.button){case 0:this.object.moveForward= !0;break;case 2:this.object.moveBackward=!0}};this.mousemove=function(a){if(!this.dragToLook||this.mouseStatus>0){var c=this.getContainerDimensions(),b=c.size[0]/2,g=c.size[1]/2;this.moveState.yawLeft=-(a.pageX-c.offset[0]-b)/b;this.moveState.pitchDown=(a.pageY-c.offset[1]-g)/g;this.updateRotationVector()}};this.mouseup=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(a.button){case 0:this.moveForward= -!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(a){a*=0.0010;var c=a*this.movementSpeed;a*=this.rollSpeed;this.object.translateX(this.moveVector.x*c);this.object.translateY(this.moveVector.y*c);this.object.translateZ(this.moveVector.z*c);this.tmpQuaternion.set(this.rotationVector.x*a,this.rotationVector.y*a,this.rotationVector.z*a,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion); +!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(a){var c=a*this.movementSpeed;a*=this.rollSpeed;this.object.translateX(this.moveVector.x*c);this.object.translateY(this.moveVector.y*c);this.object.translateZ(this.moveVector.z*c);this.tmpQuaternion.set(this.rotationVector.x*a,this.rotationVector.y*a,this.rotationVector.z*a,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion); this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z= -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this, this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(a,b){this.object=a;this.domElement=b!==void 0?b:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var c=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Matrix4,g=!1,k=1,l=0,m=0,n=0,o=0,t=0,u=window.innerWidth/2,v=window.innerHeight/2;this.update=function(a){a*=0.0010;if(this.mouseLook){var b= -a*this.lookSpeed;this.rotateHorizontally(b*o);this.rotateVertically(b*t)}b=a*this.movementSpeed;this.object.translateZ(-b*(l>0||this.autoForward&&!(l<0)?1:l));this.object.translateX(b*m);this.object.translateY(b*n);g&&(this.roll+=this.rollSpeed*a*k);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y0||this.autoForward&&!(l<0)?1:l));this.object.translateX(b*m);this.object.translateY(b*n);g&&(this.roll+=this.rollSpeed*a*k);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y b ) ? b : x ); - } - - var i, value; - function animate() { requestAnimationFrame( animate ); @@ -183,23 +175,24 @@ function render() { - var time = new Date().getTime() * 0.01; + var time = Date.now() * 0.01; - sphere.rotation.y = 0.01 * time; - sphere.rotation.z = 0.01 * time; + sphere.rotation.y = sphere.rotation.z = 0.01 * time; uniforms.amplitude.value = 2.5 * Math.sin( sphere.rotation.y * 0.125 ); THREE.ColorUtils.adjustHSV( uniforms.color.value, 0.0005, 0, 0 ); - for( i = 0; i < attributes.displacement.value.length; i++ ) { + for( var i = 0; i < attributes.displacement.value.length; i ++ ) { - attributes.displacement.value[ i ] = Math.sin( 0.1*i + time ); + attributes.displacement.value[ i ] = Math.sin( 0.1 * i + time ); noise[ i ] += 0.5 * ( 0.5 - Math.random() ); - noise[ i ] = cap( noise[ i ], -5, 5 ); + noise[ i ] = THREE.Math.clamp( noise[ i ], -5, 5 ); + attributes.displacement.value[ i ] += noise[ i ]; } + attributes.displacement.needsUpdate = true; renderer.render( scene, camera ); diff --git a/examples/webgl_custom_attributes_particles.html b/examples/webgl_custom_attributes_particles.html index a99ecfbe..9963b897 100644 --- a/examples/webgl_custom_attributes_particles.html +++ b/examples/webgl_custom_attributes_particles.html @@ -181,14 +181,6 @@ } - function cap( x, a, b ) { - - return ( x < a ) ? a : ( ( x > b ) ? b : x ); - - } - - var i, value; - function animate() { requestAnimationFrame( animate ); @@ -200,11 +192,11 @@ function render() { - var time = new Date().getTime() * 0.005; + var time = Date.now() * 0.005; sphere.rotation.z = 0.01 * time; - for( i = 0; i < attributes.size.value.length; i++ ) { + for( var i = 0; i < attributes.size.value.length; i++ ) { attributes.size.value[ i ] = 14 + 13 * Math.sin( 0.1 * i + time ); diff --git a/examples/webgl_custom_attributes_particles2.html b/examples/webgl_custom_attributes_particles2.html index d1887d10..46c34534 100644 --- a/examples/webgl_custom_attributes_particles2.html +++ b/examples/webgl_custom_attributes_particles2.html @@ -144,7 +144,6 @@ var values_size = attributes.size.value; var values_color = attributes.ca.value; - for( var v = 0; v < vertices.length; v++ ) { values_size[ v ] = 10; @@ -178,14 +177,6 @@ } - function cap( x, a, b ) { - - return ( x < a ) ? a : ( ( x > b ) ? b : x ); - - } - - var i, value; - function animate() { requestAnimationFrame( animate ); @@ -197,12 +188,12 @@ function render() { - var time = new Date().getTime() * 0.005; + var time = Date.now() * 0.005; sphere.rotation.y = 0.02 * time; sphere.rotation.z = 0.02 * time; - for( i = 0; i < attributes.size.value.length; i++ ) { + for( var i = 0; i < attributes.size.value.length; i ++ ) { if ( i < vc1 ) attributes.size.value[ i ] = 16 + 12 * Math.sin( 0.1 * i + time ); diff --git a/examples/webgl_custom_attributes_particles3.html b/examples/webgl_custom_attributes_particles3.html index 86230253..405b222d 100644 --- a/examples/webgl_custom_attributes_particles3.html +++ b/examples/webgl_custom_attributes_particles3.html @@ -137,7 +137,7 @@ var radius = 100, inner = 0.6 * radius; var geometry = new THREE.Geometry(); - for ( var i = 0; i < 100000; i++ ) { + for ( var i = 0; i < 100000; i ++ ) { vector = new THREE.Vector3( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 ); @@ -161,8 +161,9 @@ function addGeo( geo, x, y, z, ry ) { m = new THREE.Mesh( geo, dummyMaterial ); - m.rotation.y = ry; m.position.set( x, y, z ); + m.rotation.y = ry; + THREE.GeometryUtils.merge( geometry, m ); } @@ -202,7 +203,7 @@ var values_size = attributes.size.value; var values_color = attributes.ca.value; - for( var v = 0; v < vertices.length; v++ ) { + for( var v = 0; v < vertices.length; v ++ ) { values_size[ v ] = 10; values_color[ v ] = new THREE.Color( 0xffffff ); @@ -220,7 +221,7 @@ } - console.log( vertices.length ); + //console.log( vertices.length ); scene.add( object ); @@ -237,14 +238,6 @@ } - function cap( x, a, b ) { - - return ( x < a ) ? a : ( ( x > b ) ? b : x ); - - } - - var i, value; - function animate() { requestAnimationFrame( animate ); @@ -256,12 +249,11 @@ function render() { - var time = new Date().getTime() * 0.01; + var time = Date.now() * 0.01; - object.rotation.y = 0.02 * time; - object.rotation.z = 0.02 * time; + object.rotation.y = object.rotation.z = 0.02 * time; - for( i = 0; i < attributes.size.value.length; i++ ) { + for( var i = 0; i < attributes.size.value.length; i ++ ) { if ( i < vc1 ) attributes.size.value[ i ] = 26 + 32 * Math.sin( 0.1 * i + 0.6 * time ); diff --git a/examples/webgl_flycamera_earth.html b/examples/webgl_flycamera_earth.html index ad3c4c9a..b7bfb685 100644 --- a/examples/webgl_flycamera_earth.html +++ b/examples/webgl_flycamera_earth.html @@ -282,10 +282,10 @@ // rotate the planet and clouds - var delta = clock.delta(); + var delta = clock.getDelta(); - meshPlanet.rotation.y += 0.001 * rotationSpeed * delta; - meshClouds.rotation.y += 0.001 * 1.25 * rotationSpeed * delta; + meshPlanet.rotation.y += rotationSpeed * delta; + meshClouds.rotation.y += 1.25 * rotationSpeed * delta; // slow down as we approach the surface @@ -308,7 +308,7 @@ controls.update( delta ); renderer.clear(); - composer.render( 0.001 * delta ); + composer.render( delta ); }; diff --git a/examples/webgl_geometries.html b/examples/webgl_geometries.html index 2b97ec1e..613ecb84 100644 --- a/examples/webgl_geometries.html +++ b/examples/webgl_geometries.html @@ -59,26 +59,25 @@ scene.add( group ); object = new THREE.Mesh( new THREE.CubeGeometry( 100, 100, 100, 4, 4, 4 ), material ); - object.position.x = - 200; - object.position.z = 200; + object.position.set( -200, 0, 200 ); group.add( object ); object = new THREE.Mesh( new THREE.CylinderGeometry( 25, 75, 100, 40, 5 ), material ); - object.position.z = 200; + object.position.set( 0, 0, 200 ); group.add( object ); object = new THREE.Mesh( new THREE.IcosahedronGeometry( 2 ), material ); - object.position.x = 200; - object.position.z = 200; + object.position.set( 200, 0, 200 ); object.scale.x = object.scale.y = object.scale.z = 75; group.add( object ); object = new THREE.Mesh( new THREE.PlaneGeometry( 100, 100, 4, 4 ), material ); - object.position.x = - 200; + object.position.set( -200, 0, 0 ); group.add( object ); object = new THREE.Mesh( new THREE.SphereGeometry( 75, 20, 10 ), material ); + object.position.set( 0, 0, 0 ); group.add( object ); var points = []; @@ -90,21 +89,19 @@ } object = new THREE.Mesh( new THREE.LatheGeometry( points, 20 ), material ); - object.position.x = 200; + object.position.set( 200, 0, 0 ); group.add( object ); object = new THREE.Mesh( new THREE.TorusGeometry( 50, 20, 20, 20 ), material ); - object.position.x = - 200; - object.position.z = - 200; + object.position.set( -200, 0, -200 ); group.add( object ); object = new THREE.Mesh( new THREE.TorusKnotGeometry( 50, 10, 50, 20 ), material ); - object.position.z = - 200; + object.position.set( 0, 0, -200 ); group.add( object ); object = new THREE.Axes(); - object.position.x = 200; - object.position.z = - 200; + object.position.set( 200, 0, -200 ); object.scale.x = object.scale.y = object.scale.z = 0.5; group.add( object ); @@ -133,13 +130,14 @@ function render() { - var timer = new Date().getTime() * 0.0001; + var timer = Date.now() * 0.0001; camera.position.x = Math.cos( timer ) * 800; camera.position.z = Math.sin( timer ) * 800; + camera.lookAt( scene.position ); - for ( var i = 0, l = group.children.length; i < l; i++ ) { + for ( var i = 0, l = group.children.length; i < l; i ++ ) { var object = group.children[ i ]; diff --git a/examples/webgl_geometry_blenderexport_colors.html b/examples/webgl_geometry_blenderexport_colors.html index 239b7026..85ad0a2d 100644 --- a/examples/webgl_geometry_blenderexport_colors.html +++ b/examples/webgl_geometry_blenderexport_colors.html @@ -72,8 +72,8 @@ scene.add( light ); var loader = new THREE.JSONLoader(); - loader.load( { model: "obj/cubecolors/cubecolors.js", callback: createScene1 } ); - loader.load( { model: "obj/cubecolors/cube_fvc.js", callback: createScene2 } ); + loader.load( "obj/cubecolors/cubecolors.js", createScene1 ); + loader.load( "obj/cubecolors/cube_fvc.js", createScene2 ); renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.setSize( window.innerWidth, window.innerHeight ); diff --git a/examples/webgl_geometry_dynamic.html b/examples/webgl_geometry_dynamic.html index 3502ed1e..e53a4402 100644 --- a/examples/webgl_geometry_dynamic.html +++ b/examples/webgl_geometry_dynamic.html @@ -59,7 +59,7 @@ var camera, controls, scene, renderer; - var mesh, texture,geometry, material; + var mesh, texture, geometry, material; var worldWidth = 128, worldDepth = 128, worldHalfWidth = worldWidth / 2, worldHalfDepth = worldDepth / 2; @@ -139,8 +139,8 @@ function render() { - var delta = clock.delta(), - time = clock.elapsedTime * 0.01; + var delta = clock.getDelta(), + time = clock.getElapsedTime() * 10; for ( var i = 0, l = geometry.vertices.length; i < l; i ++ ) { diff --git a/examples/webgl_geometry_hierarchy.html b/examples/webgl_geometry_hierarchy.html index 33b9672c..8427c861 100644 --- a/examples/webgl_geometry_hierarchy.html +++ b/examples/webgl_geometry_hierarchy.html @@ -61,8 +61,10 @@ mesh.position.x = Math.random() * 2000 - 1000; mesh.position.y = Math.random() * 2000 - 1000; mesh.position.z = Math.random() * 2000 - 1000; + mesh.rotation.x = Math.random() * 360 * ( Math.PI / 180 ); mesh.rotation.y = Math.random() * 360 * ( Math.PI / 180 ); + mesh.matrixAutoUpdate = false; mesh.updateMatrix(); @@ -106,9 +108,11 @@ function render() { - var rx = Math.sin( new Date().getTime() * 0.0007 ) * 0.5, - ry = Math.sin( new Date().getTime() * 0.0003 ) * 0.5, - rz = Math.sin( new Date().getTime() * 0.0002 ) * 0.5; + var time = Date.now() * 0.001; + + var rx = Math.sin( time * 0.7 ) * 0.5, + ry = Math.sin( time * 0.3 ) * 0.5, + rz = Math.sin( time * 0.2 ) * 0.5; camera.position.x += ( mouseX - camera.position.x ) * .05; camera.position.y += ( - mouseY - camera.position.y ) * .05; diff --git a/examples/webgl_geometry_hierarchy2.html b/examples/webgl_geometry_hierarchy2.html index c59b1e92..209eb0de 100644 --- a/examples/webgl_geometry_hierarchy2.html +++ b/examples/webgl_geometry_hierarchy2.html @@ -44,11 +44,10 @@ container = document.createElement( 'div' ); document.body.appendChild( container ); - camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 10000 ); + camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 15000 ); camera.position.z = 500; scene = new THREE.Scene(); - scene.fog = new THREE.Fog( 0xffffff, 1, 10000 ); var geometry = new THREE.CubeGeometry( 100, 100, 100 ); var material = new THREE.MeshNormalMaterial(); @@ -179,9 +178,11 @@ function render() { - var rx = Math.sin( new Date().getTime() * 0.0007 ) * 0.2, - ry = Math.sin( new Date().getTime() * 0.0003 ) * 0.1, - rz = Math.sin( new Date().getTime() * 0.0002 ) * 0.1; + var time = Date.now() * 0.001; + + var rx = Math.sin( time * 0.7 ) * 0.2, + ry = Math.sin( time * 0.3 ) * 0.1, + rz = Math.sin( time * 0.2 ) * 0.1; camera.position.x += ( mouseX - camera.position.x ) * .05; camera.position.y += ( - mouseY - camera.position.y ) * .05; diff --git a/examples/webgl_geometry_large_mesh.html b/examples/webgl_geometry_large_mesh.html index b3908796..15ae72f7 100644 --- a/examples/webgl_geometry_large_mesh.html +++ b/examples/webgl_geometry_large_mesh.html @@ -35,10 +35,10 @@

Lucy model from Stanford 3d scanning repository (decimated with Meshlab). -

Please be patient while the mesh is loading. It may take a while, it's 2MB file. +

Please be patient while the mesh is loading. It may take a while, it's 2 MB file.
-

Best viewed in Chrome 8/9 or Firefox 4 using WebGL renderer. +

Best viewed in Chrome or Firefox using WebGL renderer.

Canvas renderer is very slow for this demo and only diffuse material works there.

Use the flag --allow-file-access-from-files if working localy in Chrome. @@ -89,14 +89,12 @@ function addMesh( geometry, scale, x, y, z, rx, ry, rz, material ) { mesh = new THREE.Mesh( geometry, material ); - mesh.scale.x = mesh.scale.y = mesh.scale.z = scale; - mesh.position.x = x; - mesh.position.y = y; - mesh.position.z = z; - mesh.rotation.x = rx; - mesh.rotation.y = ry; - mesh.rotation.z = rz; - scene.add(mesh); + + mesh.scale.set( scale, scale, scale ); + mesh.position.set( x, y, z ); + mesh.rotation.set( rx, ry, rz ); + + scene.add( mesh ); } @@ -127,27 +125,31 @@ sphere = new THREE.SphereGeometry( 100, 16, 8, 1 ); lightMesh = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( { color: 0xffaa00 } ) ); - lightMesh.scale.x = lightMesh.scale.y = lightMesh.scale.z = 0.05; + lightMesh.scale.set( 0.05, 0.05, 0.05 ); lightMesh.position = pointLight.position; scene.add( lightMesh ); if ( render_gl ) { try { + webglRenderer = new THREE.WebGLRenderer( { antialias: true } ); webglRenderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT ); webglRenderer.domElement.style.position = "relative"; container.appendChild( webglRenderer.domElement ); has_gl = 1; + } catch (e) { } } if( render_canvas ) { + canvasRenderer = new THREE.CanvasRenderer(); canvasRenderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT ); container.appendChild( canvasRenderer.domElement ); + } @@ -164,7 +166,7 @@ //loader = new THREE.JSONLoader( true ); document.body.appendChild( loader.statusDomElement ); - var s = (new Date).getTime(), + var s = Date.now(), callback = function( geometry ) { createScene( geometry, s ) }; //loader.load( { model: 'obj/lucy/Lucy100k_slim.js', callback: callback } ); @@ -185,11 +187,11 @@ log( "geometry.vertices: " + geometry.vertices.length ); log( "geometry.faces: " + geometry.faces.length ); - log( "model loaded and created in " + ((new Date).getTime() - start) + " ms" ); + log( "model loaded and created in " + ( Date.now() - start ) + " ms" ); } - function onDocumentMouseMove(event) { + function onDocumentMouseMove( event ) { mouseX = ( event.clientX - windowHalfX ); mouseY = ( event.clientY - windowHalfY ); @@ -221,15 +223,14 @@ r += 0.01; - if ( render_canvas ) canvasRenderer.render( scene, camera ); if ( render_gl && has_gl ) webglRenderer.render( scene, camera ); } - function log(text) { + function log( text ) { - var e = document.getElementById("log"); + var e = document.getElementById( "log" ); e.innerHTML = text + "
" + e.innerHTML; } @@ -263,6 +264,7 @@ canvasRenderer.domElement.style.display = render_canvas ? "block" : "none"; } + diff --git a/examples/webgl_geometry_minecraft.html b/examples/webgl_geometry_minecraft.html index 36892daf..64c198b7 100644 --- a/examples/webgl_geometry_minecraft.html +++ b/examples/webgl_geometry_minecraft.html @@ -234,7 +234,7 @@ function render() { - controls.update( clock.delta() ); + controls.update( clock.getDelta() ); renderer.render( scene, camera ); } diff --git a/examples/webgl_geometry_minecraft_ao.html b/examples/webgl_geometry_minecraft_ao.html index a5639147..49f64fbc 100644 --- a/examples/webgl_geometry_minecraft_ao.html +++ b/examples/webgl_geometry_minecraft_ao.html @@ -801,7 +801,7 @@ function render() { - controls.update( clock.delta() ); + controls.update( clock.getDelta() ); renderer.render( scene, camera ); } diff --git a/examples/webgl_geometry_shapes.html b/examples/webgl_geometry_shapes.html index a3aab6e2..273a957a 100644 --- a/examples/webgl_geometry_shapes.html +++ b/examples/webgl_geometry_shapes.html @@ -1,7 +1,7 @@ - three.js canvas - geometry - shapes + three.js webgl - geometry - shapes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/materials/MeshPhongMaterial.js b/src/materials/MeshPhongMaterial.js index 20773b0a..303c74ed 100644 --- a/src/materials/MeshPhongMaterial.js +++ b/src/materials/MeshPhongMaterial.js @@ -43,6 +43,8 @@ THREE.MeshPhongMaterial = function ( parameters ) { this.specular = parameters.specular !== undefined ? new THREE.Color( parameters.specular ) : new THREE.Color( 0x111111 ); this.shininess = parameters.shininess !== undefined ? parameters.shininess : 30; + this.metal = parameters.metal !== undefined ? parameters.metal : false; + this.map = parameters.map !== undefined ? parameters.map : null; this.lightMap = parameters.lightMap !== undefined ? parameters.lightMap : null; diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index 22b00711..288a6001 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -2744,7 +2744,8 @@ THREE.WebGLRenderer = function ( parameters ) { shadowMapWidth: this.shadowMapWidth, shadowMapHeight: this.shadowMapHeight, maxShadows: maxShadows, - alphaTest: material.alphaTest + alphaTest: material.alphaTest, + metal: material.metal }; @@ -4932,6 +4933,8 @@ THREE.WebGLRenderer = function ( parameters ) { parameters.lightMap ? "#define USE_LIGHTMAP" : "", parameters.vertexColors ? "#define USE_COLOR" : "", + parameters.metal ? "#define METAL" : "", + parameters.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", parameters.shadowMapSoft ? "#define SHADOWMAP_SOFT" : "", parameters.shadowMapSoft ? "#define SHADOWMAP_WIDTH " + parameters.shadowMapWidth.toFixed( 1 ) : "", diff --git a/src/renderers/WebGLShaders.js b/src/renderers/WebGLShaders.js index 7e0f81a3..3c80a25a 100644 --- a/src/renderers/WebGLShaders.js +++ b/src/renderers/WebGLShaders.js @@ -505,7 +505,15 @@ THREE.ShaderChunk = { "#endif", - "gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;" + "#ifdef METAL", + + "gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );", + + "#else", + + "gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;", + + "#endif", ].join("\n"), From b4f89f4b784cd834dee5b28399500d40e6f4b21b Mon Sep 17 00:00:00 2001 From: alteredq Date: Wed, 19 Oct 2011 02:11:44 +0200 Subject: [PATCH 24/33] Experimenting with Phong computed fully in fragment shader. Added new point lights test. New per-pixel Phong code is enabled by setting `perPixel` parameter in Phong material. This version is able to light single untesselated quad correctly. Also it doesn't have point lights number limitation caused by varyings, all lights pass just through uniforms. Performance wise it seems surprisingly quite similar to old version (stress test is ~6 fps faster with new version, though I guess for different use cases / GPUs it can differ). --- build/Three.js | 39 +-- build/custom/ThreeCanvas.js | 6 +- build/custom/ThreeSVG.js | 6 +- build/custom/ThreeWebGL.js | 37 +-- examples/webgl_lights_pointlights2.html | 404 ++++++++++++++++++++++++ src/materials/MeshPhongMaterial.js | 1 + src/renderers/WebGLRenderer.js | 4 +- src/renderers/WebGLShaders.js | 63 +++- 8 files changed, 501 insertions(+), 59 deletions(-) create mode 100644 examples/webgl_lights_pointlights2.html diff --git a/build/Three.js b/build/Three.js index 5ea89a4f..de3aae7e 100644 --- a/build/Three.js +++ b/build/Three.js @@ -109,9 +109,9 @@ THREE.MeshBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.col THREE.MeshLambertMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.ambient=b.ambient!==void 0?new THREE.Color(b.ambient):new THREE.Color(328965);this.map=b.map!==void 0?b.map:null;this.lightMap=b.lightMap!==void 0?b.lightMap:null;this.envMap=b.envMap!==void 0?b.envMap:null;this.combine=b.combine!==void 0?b.combine:THREE.MultiplyOperation;this.reflectivity=b.reflectivity!==void 0?b.reflectivity:1;this.refractionRatio= b.refractionRatio!==void 0?b.refractionRatio:0.98;this.fog=b.fog!==void 0?b.fog:!0;this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.wireframeLinecap=b.wireframeLinecap!==void 0?b.wireframeLinecap:"round";this.wireframeLinejoin=b.wireframeLinejoin!==void 0?b.wireframeLinejoin:"round";this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning= b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};THREE.MeshLambertMaterial.prototype=new THREE.Material;THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial; -THREE.MeshPhongMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.ambient=b.ambient!==void 0?new THREE.Color(b.ambient):new THREE.Color(328965);this.specular=b.specular!==void 0?new THREE.Color(b.specular):new THREE.Color(1118481);this.shininess=b.shininess!==void 0?b.shininess:30;this.metal=b.metal!==void 0?b.metal:!1;this.map=b.map!==void 0?b.map:null;this.lightMap=b.lightMap!==void 0?b.lightMap:null;this.envMap= -b.envMap!==void 0?b.envMap:null;this.combine=b.combine!==void 0?b.combine:THREE.MultiplyOperation;this.reflectivity=b.reflectivity!==void 0?b.reflectivity:1;this.refractionRatio=b.refractionRatio!==void 0?b.refractionRatio:0.98;this.fog=b.fog!==void 0?b.fog:!0;this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.wireframeLinecap=b.wireframeLinecap!==void 0? -b.wireframeLinecap:"round";this.wireframeLinejoin=b.wireframeLinejoin!==void 0?b.wireframeLinejoin:"round";this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};THREE.MeshPhongMaterial.prototype=new THREE.Material;THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial; +THREE.MeshPhongMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.ambient=b.ambient!==void 0?new THREE.Color(b.ambient):new THREE.Color(328965);this.specular=b.specular!==void 0?new THREE.Color(b.specular):new THREE.Color(1118481);this.shininess=b.shininess!==void 0?b.shininess:30;this.metal=b.metal!==void 0?b.metal:!1;this.perPixel=b.perPixel!==void 0?b.perPixel:!1;this.map=b.map!==void 0?b.map:null;this.lightMap= +b.lightMap!==void 0?b.lightMap:null;this.envMap=b.envMap!==void 0?b.envMap:null;this.combine=b.combine!==void 0?b.combine:THREE.MultiplyOperation;this.reflectivity=b.reflectivity!==void 0?b.reflectivity:1;this.refractionRatio=b.refractionRatio!==void 0?b.refractionRatio:0.98;this.fog=b.fog!==void 0?b.fog:!0;this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.wireframeLinecap= +b.wireframeLinecap!==void 0?b.wireframeLinecap:"round";this.wireframeLinejoin=b.wireframeLinejoin!==void 0?b.wireframeLinejoin:"round";this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};THREE.MeshPhongMaterial.prototype=new THREE.Material;THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial; THREE.MeshDepthMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1};THREE.MeshDepthMaterial.prototype=new THREE.Material;THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial; THREE.MeshNormalMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.shading=b.shading?b.shading:THREE.FlatShading;this.wireframe=b.wireframe?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth?b.wireframeLinewidth:1};THREE.MeshNormalMaterial.prototype=new THREE.Material;THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial;THREE.MeshFaceMaterial=function(){}; THREE.MeshShaderMaterial=function(b){console.warn("DEPRECATED: MeshShaderMaterial() is now ShaderMaterial().");return new THREE.ShaderMaterial(b)}; @@ -198,10 +198,11 @@ D.intersects(E))){w=0;for(G=I.meshMaterials.length;w 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", -lights_vertex:"if ( !enableLighting ) {\nvLightWeighting = vec3( 1.0 );\n} else {\nvLightWeighting = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nfloat directionalLightWeighting = max( dot( transformedNormal, normalize( lDirection.xyz ) ), 0.0 );\nvLightWeighting += directionalLightColor[ i ] * directionalLightWeighting;\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 pointLightWeighting = max( dot( transformedNormal, lVector ), 0.0 );\nvLightWeighting += pointLightColor[ i ] * pointLightWeighting * lDistance;\n}\n#endif\nvLightWeighting = vLightWeighting * diffuse + ambient * ambientLightColor;\n}", -lights_phong_pars_vertex:"#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif",lights_phong_vertex:"#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif", -lights_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 ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",lights_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\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 ++ ) {\nvec3 pointVector = normalize( vPointLight[ i ].xyz );\nvec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );\nfloat pointDistance = vPointLight[ i ].w;\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = pow( pointDotNormalHalf, shininess );\n#ifdef PHYSICALLY_BASED_SHADING\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( pointVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#else\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#endif\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * pointDistance;\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 );\nvec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = pow( dirDotNormalHalf, shininess );\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\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\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", +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 bool enableLighting;\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", +lights_lambert_vertex:"if ( !enableLighting ) {\nvLightWeighting = vec3( 1.0 );\n} else {\nvLightWeighting = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nfloat directionalLightWeighting = max( dot( transformedNormal, normalize( lDirection.xyz ) ), 0.0 );\nvLightWeighting += directionalLightColor[ i ] * directionalLightWeighting;\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 pointLightWeighting = max( dot( transformedNormal, lVector ), 0.0 );\nvLightWeighting += pointLightColor[ i ] * pointLightWeighting * lDistance;\n}\n#endif\nvLightWeighting = vLightWeighting * diffuse + ambient * ambientLightColor;\n}", +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 );\nlVector = normalize( lVector );\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\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;", +lights_phong_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\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\nvec3 pointHalfVector = normalize( lVector + viewPosition );\nfloat pointDistance = lDistance;\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointDiffuseWeight = max( dot( normal, lVector ), 0.0 );\nfloat pointSpecularWeight = pow( pointDotNormalHalf, shininess );\n#ifdef PHYSICALLY_BASED_SHADING\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( lVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#else\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#endif\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * pointDistance;\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 );\nvec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = pow( dirDotNormalHalf, shininess );\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\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\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 * viewMatrix * objectMatrix * gl_Position;\n#endif", morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\nuniform float morphTargetInfluences[ 8 ];\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\nvec3 morphed = vec3( 0.0, 0.0, 0.0 );\nmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\nmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\nmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\nmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\nmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\nmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\nmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\nmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\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",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform float shadowDarkness;\nuniform float shadowBias;\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif", @@ -217,13 +218,13 @@ vertexShader:"varying vec3 vNormal;\nvoid main() {\nvec4 mvPosition = modelViewM 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)}}]),vertexShader:["varying vec3 vLightWeighting;",THREE.ShaderChunk.map_pars_vertex, -THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_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,"vec3 transformedNormal = normalize( normalMatrix * normal );", -THREE.ShaderChunk.lights_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 vLightWeighting;",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.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,"vec3 transformedNormal = normalize( normalMatrix * normal );", +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 vLightWeighting;",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,"gl_FragColor.xyz = gl_FragColor.xyz * vLightWeighting;",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}}]),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;\nvec3 transformedNormal = normalize( normalMatrix * normal );\nvNormal = 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_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_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.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;\nvec3 transformedNormal = normalMatrix * normal;\nvNormal = 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}"}}; @@ -292,14 +293,14 @@ o.deleteBuffer(c.__webglSkinVertexBBuffer);o.deleteBuffer(c.__webglSkinIndicesBu THREE.Line)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),Q.info.memory.geometries--;else if(b instanceof THREE.ParticleSystem)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),Q.info.memory.geometries--};this.deallocateTexture=function(b){if(b.__webglInit)b.__webglInit=!1,o.deleteTexture(b.__webglTexture),Q.info.memory.textures--};this.initMaterial=function(b,c,e,f){var h,k,m,n;b instanceof THREE.MeshDepthMaterial?n="depth": b instanceof THREE.MeshNormalMaterial?n="normal":b instanceof THREE.MeshBasicMaterial?n="basic":b instanceof THREE.MeshLambertMaterial?n="lambert":b instanceof THREE.MeshPhongMaterial?n="phong":b instanceof THREE.LineBasicMaterial?n="basic":b instanceof THREE.ParticleBasicMaterial&&(n="particle_basic");if(n){var p=THREE.ShaderLib[n];b.uniforms=THREE.UniformsUtils.clone(p.uniforms);b.vertexShader=p.vertexShader;b.fragmentShader=p.fragmentShader}var t,u,v;t=v=p=0;for(u=c.length;t=0&&o.enableVertexAttribArray(x.position);x.color>=0&&o.enableVertexAttribArray(x.color);x.normal>=0&&o.enableVertexAttribArray(x.normal);x.tangent>= -0&&o.enableVertexAttribArray(x.tangent);b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(o.enableVertexAttribArray(x.skinVertexA),o.enableVertexAttribArray(x.skinVertexB),o.enableVertexAttribArray(x.skinIndex),o.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(k in b.attributes)x[k]!==void 0&&x[k]>=0&&o.enableVertexAttribArray(x[k]);if(b.morphTargets)for(k=b.numSupportedMorphTargets=0;k=0&&(o.enableVertexAttribArray(x[z]), +"",e.lightMap?"#define USE_LIGHTMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.perPixel?"#define PHONG_PER_PIXEL":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapSoft?"#define SHADOWMAP_SOFT":"",e.shadowMapSoft?"#define SHADOWMAP_WIDTH "+e.shadowMapWidth.toFixed(1):"",e.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+e.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");o.attachShader(y,J("fragment",m+t));o.attachShader(y, +J("vertex",f+u));o.linkProgram(y);o.getProgramParameter(y,o.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+o.getProgramParameter(y,o.VALIDATE_STATUS)+", gl error ["+o.getError()+"]");y.uniforms={};y.attributes={};var z,f=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(z in p)f.push(z);z=f;f=0;for(p=z.length;f=0&&o.enableVertexAttribArray(x.position);x.color>=0&&o.enableVertexAttribArray(x.color);x.normal>=0&&o.enableVertexAttribArray(x.normal); +x.tangent>=0&&o.enableVertexAttribArray(x.tangent);b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(o.enableVertexAttribArray(x.skinVertexA),o.enableVertexAttribArray(x.skinVertexB),o.enableVertexAttribArray(x.skinIndex),o.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(k in b.attributes)x[k]!==void 0&&x[k]>=0&&o.enableVertexAttribArray(x[k]);if(b.morphTargets)for(k=b.numSupportedMorphTargets=0;k=0&&(o.enableVertexAttribArray(x[z]), b.numSupportedMorphTargets++);b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,e,f){N(b);this.clear(c,e,f)};this.updateShadowMap=function(b,c){z(b,c)};this.render=function(b,c,u,U){var L,da,E,C,G,pa,B,ma,I=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&z(b,c);Q.info.render.calls=0;Q.info.render.vertices=0;Q.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0, !1,c);c.matrixWorldInverse.flattenToArray(Fa);c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);t(Ca);this.initWebGLObjects(b);N(u);(this.autoClear||U)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(U=0;U 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", -lights_vertex:"if ( !enableLighting ) {\nvLightWeighting = vec3( 1.0 );\n} else {\nvLightWeighting = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nfloat directionalLightWeighting = max( dot( transformedNormal, normalize( lDirection.xyz ) ), 0.0 );\nvLightWeighting += directionalLightColor[ i ] * directionalLightWeighting;\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 pointLightWeighting = max( dot( transformedNormal, lVector ), 0.0 );\nvLightWeighting += pointLightColor[ i ] * pointLightWeighting * lDistance;\n}\n#endif\nvLightWeighting = vLightWeighting * diffuse + ambient * ambientLightColor;\n}", -lights_phong_pars_vertex:"#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif",lights_phong_vertex:"#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif", -lights_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 ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",lights_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\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 ++ ) {\nvec3 pointVector = normalize( vPointLight[ i ].xyz );\nvec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );\nfloat pointDistance = vPointLight[ i ].w;\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = pow( pointDotNormalHalf, shininess );\n#ifdef PHYSICALLY_BASED_SHADING\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( pointVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#else\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#endif\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * pointDistance;\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 );\nvec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = pow( dirDotNormalHalf, shininess );\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\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\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", +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 bool enableLighting;\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", +lights_lambert_vertex:"if ( !enableLighting ) {\nvLightWeighting = vec3( 1.0 );\n} else {\nvLightWeighting = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nfloat directionalLightWeighting = max( dot( transformedNormal, normalize( lDirection.xyz ) ), 0.0 );\nvLightWeighting += directionalLightColor[ i ] * directionalLightWeighting;\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 pointLightWeighting = max( dot( transformedNormal, lVector ), 0.0 );\nvLightWeighting += pointLightColor[ i ] * pointLightWeighting * lDistance;\n}\n#endif\nvLightWeighting = vLightWeighting * diffuse + ambient * ambientLightColor;\n}", +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 );\nlVector = normalize( lVector );\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\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;", +lights_phong_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\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\nvec3 pointHalfVector = normalize( lVector + viewPosition );\nfloat pointDistance = lDistance;\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointDiffuseWeight = max( dot( normal, lVector ), 0.0 );\nfloat pointSpecularWeight = pow( pointDotNormalHalf, shininess );\n#ifdef PHYSICALLY_BASED_SHADING\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( lVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#else\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#endif\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * pointDistance;\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 );\nvec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = pow( dirDotNormalHalf, shininess );\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\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\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 * viewMatrix * objectMatrix * gl_Position;\n#endif", morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\nuniform float morphTargetInfluences[ 8 ];\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\nvec3 morphed = vec3( 0.0, 0.0, 0.0 );\nmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\nmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\nmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\nmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\nmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\nmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\nmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\nmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\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",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform float shadowDarkness;\nuniform float shadowBias;\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif", @@ -168,13 +169,13 @@ vertexShader:"varying vec3 vNormal;\nvoid main() {\nvec4 mvPosition = modelViewM 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)}}]),vertexShader:["varying vec3 vLightWeighting;",THREE.ShaderChunk.map_pars_vertex, -THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_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,"vec3 transformedNormal = normalize( normalMatrix * normal );", -THREE.ShaderChunk.lights_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 vLightWeighting;",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.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,"vec3 transformedNormal = normalize( normalMatrix * normal );", +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 vLightWeighting;",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,"gl_FragColor.xyz = gl_FragColor.xyz * vLightWeighting;",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}}]),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;\nvec3 transformedNormal = normalize( normalMatrix * normal );\nvNormal = 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_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_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.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;\nvec3 transformedNormal = normalMatrix * normal;\nvNormal = 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}"}}; @@ -243,13 +244,13 @@ e.deleteBuffer(c.__webglSkinVertexBBuffer);e.deleteBuffer(c.__webglSkinIndicesBu THREE.Line)b=b.geometry,e.deleteBuffer(b.__webglVertexBuffer),e.deleteBuffer(b.__webglColorBuffer),J.info.memory.geometries--;else if(b instanceof THREE.ParticleSystem)b=b.geometry,e.deleteBuffer(b.__webglVertexBuffer),e.deleteBuffer(b.__webglColorBuffer),J.info.memory.geometries--};this.deallocateTexture=function(b){if(b.__webglInit)b.__webglInit=!1,e.deleteTexture(b.__webglTexture),J.info.memory.textures--};this.initMaterial=function(b,c,d,f){var h,i,j,k;b instanceof THREE.MeshDepthMaterial?k="depth": b instanceof THREE.MeshNormalMaterial?k="normal":b instanceof THREE.MeshBasicMaterial?k="basic":b instanceof THREE.MeshLambertMaterial?k="lambert":b instanceof THREE.MeshPhongMaterial?k="phong":b instanceof THREE.LineBasicMaterial?k="basic":b instanceof THREE.ParticleBasicMaterial&&(k="particle_basic");if(k){var p=THREE.ShaderLib[k];b.uniforms=THREE.UniformsUtils.clone(p.uniforms);b.vertexShader=p.vertexShader;b.fragmentShader=p.fragmentShader}var m,n,o;m=o=p=0;for(n=c.length;m=0&&e.enableVertexAttribArray(x.position);x.color>=0&&e.enableVertexAttribArray(x.color);x.normal>=0&&e.enableVertexAttribArray(x.normal); +"",d.lightMap?"#define USE_LIGHTMAP":"",d.vertexColors?"#define USE_COLOR":"",d.metal?"#define METAL":"",d.perPixel?"#define PHONG_PER_PIXEL":"",d.shadowMapEnabled?"#define USE_SHADOWMAP":"",d.shadowMapSoft?"#define SHADOWMAP_SOFT":"",d.shadowMapSoft?"#define SHADOWMAP_WIDTH "+d.shadowMapWidth.toFixed(1):"",d.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+d.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");e.attachShader(v,ia("fragment",j+m));e.attachShader(v, +ia("vertex",f+n));e.linkProgram(v);e.getProgramParameter(v,e.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+e.getProgramParameter(v,e.VALIDATE_STATUS)+", gl error ["+e.getError()+"]");v.uniforms={};v.attributes={};var w,f=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(w in p)f.push(w);w=f;f=0;for(p=w.length;f=0&&e.enableVertexAttribArray(x.position);x.color>=0&&e.enableVertexAttribArray(x.color);x.normal>=0&&e.enableVertexAttribArray(x.normal); x.tangent>=0&&e.enableVertexAttribArray(x.tangent);b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(e.enableVertexAttribArray(x.skinVertexA),e.enableVertexAttribArray(x.skinVertexB),e.enableVertexAttribArray(x.skinIndex),e.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(i in b.attributes)x[i]!==void 0&&x[i]>=0&&e.enableVertexAttribArray(x[i]);if(b.morphTargets)for(i=b.numSupportedMorphTargets=0;i=0&&(e.enableVertexAttribArray(x[w]), b.numSupportedMorphTargets++);b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,d,e){S(b);this.clear(c,d,e)};this.updateShadowMap=function(b,c){F(b,c)};this.render=function(b,c,o,u){var K,Ia,ra,s,p,D,B,Pa,Qa=b.lights,x=b.fog;W=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&F(b,c);J.info.render.calls=0;J.info.render.vertices=0;J.info.render.faces=0;if(c.matrixAutoUpdate){for(p=c;p.parent;)p=p.parent;p.update(void 0,!0)}b.update(void 0, !1,c);c.matrixWorldInverse.flattenToArray(Wa);c.projectionMatrix.flattenToArray(Va);Ea.multiply(c.projectionMatrix,c.matrixWorldInverse);m(Ea);this.initWebGLObjects(b);S(o);(this.autoClear||u)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);p=b.__webglObjects.length;for(u=0;u + + + three.js webgl - lights - point lights + + + + + + +

+
+ three.js - point lights WebGL demo +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/materials/MeshPhongMaterial.js b/src/materials/MeshPhongMaterial.js index 303c74ed..3c32db05 100644 --- a/src/materials/MeshPhongMaterial.js +++ b/src/materials/MeshPhongMaterial.js @@ -44,6 +44,7 @@ THREE.MeshPhongMaterial = function ( parameters ) { this.shininess = parameters.shininess !== undefined ? parameters.shininess : 30; this.metal = parameters.metal !== undefined ? parameters.metal : false; + this.perPixel = parameters.perPixel !== undefined ? parameters.perPixel : false; this.map = parameters.map !== undefined ? parameters.map : null; diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index 288a6001..eab4d960 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -2745,7 +2745,8 @@ THREE.WebGLRenderer = function ( parameters ) { shadowMapHeight: this.shadowMapHeight, maxShadows: maxShadows, alphaTest: material.alphaTest, - metal: material.metal + metal: material.metal, + perPixel: material.perPixel }; @@ -4934,6 +4935,7 @@ THREE.WebGLRenderer = function ( parameters ) { parameters.vertexColors ? "#define USE_COLOR" : "", parameters.metal ? "#define METAL" : "", + parameters.perPixel ? "#define PHONG_PER_PIXEL" : "", parameters.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", parameters.shadowMapSoft ? "#define SHADOWMAP_SOFT" : "", diff --git a/src/renderers/WebGLShaders.js b/src/renderers/WebGLShaders.js index 3c80a25a..549eb502 100644 --- a/src/renderers/WebGLShaders.js +++ b/src/renderers/WebGLShaders.js @@ -253,7 +253,7 @@ THREE.ShaderChunk = { // LIGHTS LAMBERT - lights_pars_vertex: [ + lights_lambert_pars_vertex: [ "uniform vec3 ambient;", "uniform vec3 diffuse;", @@ -278,7 +278,7 @@ THREE.ShaderChunk = { ].join("\n"), - lights_vertex: [ + lights_lambert_vertex: [ "if ( !enableLighting ) {", @@ -333,12 +333,14 @@ THREE.ShaderChunk = { lights_phong_pars_vertex: [ "#if MAX_POINT_LIGHTS > 0", + "#ifndef PHONG_PER_PIXEL", "uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];", "uniform float pointLightDistance[ MAX_POINT_LIGHTS ];", "varying vec4 vPointLight[ MAX_POINT_LIGHTS ];", + "#endif", "#endif" ].join("\n"), @@ -347,6 +349,7 @@ THREE.ShaderChunk = { lights_phong_vertex: [ "#if MAX_POINT_LIGHTS > 0", + "#ifndef PHONG_PER_PIXEL", "for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {", @@ -366,10 +369,11 @@ THREE.ShaderChunk = { "}", "#endif", + "#endif" ].join("\n"), - lights_pars_fragment: [ + lights_phong_pars_fragment: [ "uniform vec3 ambientLightColor;", @@ -383,7 +387,17 @@ THREE.ShaderChunk = { "#if MAX_POINT_LIGHTS > 0", "uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];", - "varying vec4 vPointLight[ MAX_POINT_LIGHTS ];", + + "#ifdef PHONG_PER_PIXEL", + + "uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];", + "uniform float pointLightDistance[ MAX_POINT_LIGHTS ];", + + "#else", + + "varying vec4 vPointLight[ MAX_POINT_LIGHTS ];", + + "#endif", "#endif", @@ -392,7 +406,7 @@ THREE.ShaderChunk = { ].join("\n"), - lights_fragment: [ + lights_phong_fragment: [ "vec3 normal = normalize( vNormal );", "vec3 viewPosition = normalize( vViewPosition );", @@ -404,18 +418,37 @@ THREE.ShaderChunk = { "for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {", - "vec3 pointVector = normalize( vPointLight[ i ].xyz );", - "vec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );", - "float pointDistance = vPointLight[ i ].w;", + "#ifdef PHONG_PER_PIXEL", + + "vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );", + + "vec3 lVector = lPosition.xyz + vViewPosition.xyz;", + + "float lDistance = 1.0;", + + "if ( pointLightDistance[ i ] > 0.0 )", + "lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );", + + "lVector = normalize( lVector );", + + "#else", + + "vec3 lVector = normalize( vPointLight[ i ].xyz );", + "float lDistance = vPointLight[ i ].w;", + + "#endif", + + "vec3 pointHalfVector = normalize( lVector + viewPosition );", + "float pointDistance = lDistance;", "float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );", - "float pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );", + "float pointDiffuseWeight = max( dot( normal, lVector ), 0.0 );", "float pointSpecularWeight = pow( pointDotNormalHalf, shininess );", "#ifdef PHYSICALLY_BASED_SHADING", - "vec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( pointVector, pointHalfVector ), 5.0 );", + "vec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( lVector, pointHalfVector ), 5.0 );", "pointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;", "#else", @@ -1183,7 +1216,7 @@ THREE.ShaderLib = { THREE.ShaderChunk[ "map_pars_vertex" ], THREE.ShaderChunk[ "lightmap_pars_vertex" ], THREE.ShaderChunk[ "envmap_pars_vertex" ], - THREE.ShaderChunk[ "lights_pars_vertex" ], + THREE.ShaderChunk[ "lights_lambert_pars_vertex" ], THREE.ShaderChunk[ "color_pars_vertex" ], THREE.ShaderChunk[ "skinning_pars_vertex" ], THREE.ShaderChunk[ "morphtarget_pars_vertex" ], @@ -1200,7 +1233,7 @@ THREE.ShaderLib = { "vec3 transformedNormal = normalize( normalMatrix * normal );", - THREE.ShaderChunk[ "lights_vertex" ], + THREE.ShaderChunk[ "lights_lambert_vertex" ], THREE.ShaderChunk[ "skinning_vertex" ], THREE.ShaderChunk[ "morphtarget_vertex" ], THREE.ShaderChunk[ "default_vertex" ], @@ -1296,7 +1329,7 @@ THREE.ShaderLib = { "vViewPosition = -mvPosition.xyz;", - "vec3 transformedNormal = normalize( normalMatrix * normal );", + "vec3 transformedNormal = normalMatrix * normal;", "vNormal = transformedNormal;", THREE.ShaderChunk[ "lights_phong_vertex" ], @@ -1323,7 +1356,7 @@ THREE.ShaderLib = { THREE.ShaderChunk[ "lightmap_pars_fragment" ], THREE.ShaderChunk[ "envmap_pars_fragment" ], THREE.ShaderChunk[ "fog_pars_fragment" ], - THREE.ShaderChunk[ "lights_pars_fragment" ], + THREE.ShaderChunk[ "lights_phong_pars_fragment" ], THREE.ShaderChunk[ "shadowmap_pars_fragment" ], "void main() {", @@ -1333,7 +1366,7 @@ THREE.ShaderLib = { THREE.ShaderChunk[ "map_fragment" ], THREE.ShaderChunk[ "alphatest_fragment" ], - THREE.ShaderChunk[ "lights_fragment" ], + THREE.ShaderChunk[ "lights_phong_fragment" ], THREE.ShaderChunk[ "lightmap_fragment" ], THREE.ShaderChunk[ "color_fragment" ], From 32ba5a562a17a4703c9a7fa58d957e4fc54981a7 Mon Sep 17 00:00:00 2001 From: alteredq Date: Thu, 20 Oct 2011 22:26:44 +0200 Subject: [PATCH 25/33] Blender exporter seems to work fine with new Blender 2.60 ;) --- .../{2.59 => 2.60}/scripts/addons/io_mesh_threejs/__init__.py | 0 .../scripts/addons/io_mesh_threejs/export_threejs.py | 2 +- .../scripts/addons/io_mesh_threejs/import_threejs.py | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename utils/exporters/blender/{2.59 => 2.60}/scripts/addons/io_mesh_threejs/__init__.py (100%) rename utils/exporters/blender/{2.59 => 2.60}/scripts/addons/io_mesh_threejs/export_threejs.py (99%) rename utils/exporters/blender/{2.59 => 2.60}/scripts/addons/io_mesh_threejs/import_threejs.py (100%) diff --git a/utils/exporters/blender/2.59/scripts/addons/io_mesh_threejs/__init__.py b/utils/exporters/blender/2.60/scripts/addons/io_mesh_threejs/__init__.py similarity index 100% rename from utils/exporters/blender/2.59/scripts/addons/io_mesh_threejs/__init__.py rename to utils/exporters/blender/2.60/scripts/addons/io_mesh_threejs/__init__.py diff --git a/utils/exporters/blender/2.59/scripts/addons/io_mesh_threejs/export_threejs.py b/utils/exporters/blender/2.60/scripts/addons/io_mesh_threejs/export_threejs.py similarity index 99% rename from utils/exporters/blender/2.59/scripts/addons/io_mesh_threejs/export_threejs.py rename to utils/exporters/blender/2.60/scripts/addons/io_mesh_threejs/export_threejs.py index ce8eed4d..2ff9cf54 100644 --- a/utils/exporters/blender/2.59/scripts/addons/io_mesh_threejs/export_threejs.py +++ b/utils/exporters/blender/2.60/scripts/addons/io_mesh_threejs/export_threejs.py @@ -79,7 +79,7 @@ COLORS = [0xeeeeee, 0xee0000, 0x00ee00, 0x0000ee, 0xeeee00, 0x00eeee, 0xee00ee] TEMPLATE_SCENE_ASCII = """\ /* Converted from: %(fname)s * - * File generated with Blender 2.58 Exporter + * File generated with Blender 2.60 Exporter * https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender/ * * objects: %(nobjects)s diff --git a/utils/exporters/blender/2.59/scripts/addons/io_mesh_threejs/import_threejs.py b/utils/exporters/blender/2.60/scripts/addons/io_mesh_threejs/import_threejs.py similarity index 100% rename from utils/exporters/blender/2.59/scripts/addons/io_mesh_threejs/import_threejs.py rename to utils/exporters/blender/2.60/scripts/addons/io_mesh_threejs/import_threejs.py From 05b3db4dca5fca2b6dacd6782b5e166c3802f749 Mon Sep 17 00:00:00 2001 From: alteredq Date: Fri, 21 Oct 2011 03:06:06 +0200 Subject: [PATCH 26/33] Experimenting with array-less materials. Do not use for anything, this is just snapshot of a test in progress. I solved quite a few issues, but many things are still clumsy and broken. --- build/Three.js | 1258 ++++++++--------- examples/js/Car.js | 8 +- examples/js/postprocessing/BloomPass.js | 4 +- examples/js/postprocessing/DotScreenPass.js | 2 +- examples/js/postprocessing/FilmPass.js | 2 +- examples/js/postprocessing/SavePass.js | 2 +- examples/js/postprocessing/ShaderPass.js | 2 +- examples/js/postprocessing/TexturePass.js | 2 +- examples/webgl_animation_skinning.html | 2 +- .../webgl_geometry_blenderexport_colors.html | 14 +- examples/webgl_geometry_colors.html | 54 +- examples/webgl_geometry_text.html | 8 +- .../webgl_interactive_draggablecubes.html | 8 +- examples/webgl_materials2.html | 2 +- examples/webgl_materials_cars.html | 6 +- examples/webgl_materials_cars_camaro.html | 22 +- examples/webgl_materials_cubemap_dynamic.html | 165 ++- examples/webgl_materials_grass.html | 2 +- examples/webgl_materials_normalmap.html | 4 + examples/webgl_shader_lava.html | 2 +- examples/webgl_shading_physical.html | 2 +- examples/webgl_shadowmap.html | 2 + src/core/Face3.js | 6 +- src/core/Face4.js | 6 +- src/core/Geometry.js | 36 +- src/extras/GeometryUtils.js | 39 +- src/extras/geometries/CubeGeometry.js | 22 +- src/extras/loaders/BinaryLoader.js | 16 +- src/extras/loaders/JSONLoader.js | 2 +- src/extras/loaders/Loader.js | 6 +- src/objects/Line.js | 4 +- src/objects/Mesh.js | 4 +- src/objects/MorphAnimMesh.js | 4 +- src/objects/Particle.js | 4 +- src/objects/ParticleSystem.js | 4 +- src/objects/Ribbon.js | 4 +- src/objects/SkinnedMesh.js | 4 +- src/renderers/WebGLRenderer.js | 460 ++---- 38 files changed, 1103 insertions(+), 1091 deletions(-) diff --git a/build/Three.js b/build/Three.js index de3aae7e..e1d92850 100644 --- a/build/Three.js +++ b/build/Three.js @@ -1,200 +1,199 @@ // Three.js r46dev - http://github.com/mrdoob/three.js -var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Clock=function(b){this.autoStart=b!==void 0?b:!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 b=0;this.autoStart&&!this.running&&this.start();if(this.running){var c=Date.now(),b=0.0010*(c-this.oldTime);this.oldTime=c;this.elapsedTime+=b}return b};THREE.Color=function(b){b!==void 0&&this.setHex(b);return this}; -THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},copyGammaToLinear:function(b){this.r=b.r*b.r;this.g=b.g*b.g;this.b=b.b*b.b;return this},copyLinearToGamma:function(b){this.r=Math.sqrt(b.r);this.g=Math.sqrt(b.g);this.b=Math.sqrt(b.b);return this},setRGB:function(b,c,e){this.r=b;this.g=c;this.b=e;return this},setHSV:function(b,c,e){var f,h,k;if(e==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),h=b*6-f,b=e*(1-c),k=e*(1- -c*h),c=e*(1-c*(1-h)),f){case 1:this.r=k;this.g=e;this.b=b;break;case 2:this.r=b;this.g=e;this.b=c;break;case 3:this.r=b;this.g=k;this.b=e;break;case 4:this.r=c;this.g=b;this.b=e;break;case 5:this.r=e;this.g=b;this.b=k;break;case 6:case 0:this.r=e,this.g=c,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ -Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0}; -THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this}, -divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var c=this.x-b.x,b=this.y-b.y;return c*c+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)}, -equals:function(b){return b.x==this.x&&b.y==this.y}};THREE.Vector3=function(b,c,e){this.x=b||0;this.y=c||0;this.z=e||0}; -THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(b,c,e){this.x=b;this.y=c;this.z=e;return this},setX:function(b){this.x=b;return this},setY:function(b){this.y=b;return this},setZ:function(b){this.z=b;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;return this}, -addScalar:function(b){this.x+=b;this.y+=b;this.z+=b;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=b.z-c.z;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;return this},multiply:function(b,c){this.x=b.x*c.x;this.y=b.y*c.y;this.z=b.z*c.z;return this},multiplySelf:function(b){this.x*=b.x;this.y*=b.y;this.z*=b.z;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;return this},divideSelf:function(b){this.x/=b.x;this.y/=b.y;this.z/=b.z;return this}, -divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.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 this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)}, -cross:function(b,c){this.x=b.y*c.z-b.z*c.y;this.y=b.z*c.x-b.x*c.z;this.z=b.x*c.y-b.y*c.x;return this},crossSelf:function(b){return this.set(this.y*b.z-this.z*b.y,this.z*b.x-this.x*b.z,this.x*b.y-this.y*b.x)},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){return(new THREE.Vector3).sub(this,b).lengthSq()},setPositionFromMatrix:function(b){this.x=b.n14;this.y=b.n24;this.z=b.n34},setRotationFromMatrix:function(b){var c=Math.cos(this.y);this.y=Math.asin(b.n13); -Math.abs(c)>1.0E-5?(this.x=Math.atan2(-b.n23/c,b.n33/c),this.z=Math.atan2(-b.n12/c,b.n11/c)):(this.x=0,this.z=Math.atan2(b.n21,b.n22))},isZero:function(){return this.lengthSq()<1.0E-4}};THREE.Vector4=function(b,c,e,f){this.x=b||0;this.y=c||0;this.z=e||0;this.w=f!==void 0?f:1}; -THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w!==void 0?b.w:1},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;this.w=b.w+c.w;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;this.w+=b.w;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=b.z- -c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;this.w-=b.w;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;this.w*=b;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b,this.w/=b):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z+this.w*b.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())}, -normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3}; -THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,e,f=[];c=0;for(e=b.length;c0&&b>0&&k+b<1}for(var f,h=[],k=0,m=b.children.length;kb.scale.x)return[];f={distance:k,point:b.position,face:null,object:b};h.push(f)}else if(b instanceof THREE.Mesh){k=c(this.origin, -this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,p,t,w,u,x,v,A,z=b.geometry,y=z.vertices,k=0,m=z.faces.length;k0:x<0)))if(x=u.dot((new THREE.Vector3).sub(n,v))/x,v=v.addSelf(A.multiplyScalar(x)),f instanceof THREE.Face3)e(v,n,p,t)&&(f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(e(v,n,p,w)||e(v,p,t,w)))f={distance:this.origin.distanceTo(v),point:v,face:f,object:b},h.push(f)}return h}}; -THREE.Rectangle=function(){function b(){k=f-c;m=h-e}var c,e,f,h,k,m,n=!0;this.getX=function(){return c};this.getY=function(){return e};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return c};this.getTop=function(){return e};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,u){n=!1;c=k;e=m;f=w;h=u;b()};this.addPoint=function(k,m){n?(n=!1,c=k,e=m,f=k,h=m):(c=ck?f:k,h=h>m?h:m);b()};this.add3Points= -function(k,m,w,u,x,v){n?(n=!1,c=kw?k>x?k:x:w>x?w:x,h=m>u?m>v?m:v:u>v?u:v):(c=kw?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>u?m>v?m>h?m:h:v>h?v:h:u>v?u>h?u:h:v>h?v:h);b()};this.addRectangle=function(k){n?(n=!1,c=k.getLeft(),e=k.getTop(),f=k.getRight(),h=k.getBottom()):(c=ck.getRight()?f:k.getRight(),h=h> -k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){c-=k;e-=k;f+=k;h+=k;b()};this.minSelf=function(k){c=c>k.getLeft()?c:k.getLeft();e=e>k.getTop()?e:k.getTop();f=f=0&&Math.min(h,b.getBottom())-Math.max(e,b.getTop())>=0};this.empty=function(){n=!0;h=f=e=c=0;b()};this.isEmpty=function(){return n}}; -THREE.Math={clamp:function(b,c,e){return be?e:b},clampBottom:function(b,c){return b>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ +Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; +THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, +divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, +equals:function(a){return a.x==this.x&&a.y==this.y}};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.set(0,0,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 this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)}, +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){return this.set(this.y*a.z-this.z*a.y,this.z*a.x-this.x*a.z,this.x*a.y-this.y*a.x)},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this,a).lengthSq()},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13); +Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},isZero:function(){return this.lengthSq()<1.0E-4}};THREE.Vector4=function(a,b,c,e){this.x=a||0;this.y=b||0;this.z=c||0;this.w=e!==void 0?e:1}; +THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;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},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.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; +THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,e=[];b=0;for(c=a.length;b0&&a>0&&k+a<1}for(var e,f=[],k=0,h=a.children.length;ka.scale.x)return[];e={distance:k,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){k=b(this.origin, +this.direction,a.matrixWorld.getPosition());if(k==null||k>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var l,n,o,u,p,v,t,y,x=a.geometry,w=x.vertices,k=0,h=x.faces.length;k0:v<0)))if(v=p.dot((new THREE.Vector3).sub(l,t))/v,t=t.addSelf(y.multiplyScalar(v)),e instanceof THREE.Face3)c(t,l,n,o)&&(e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(t,l,n,u)||c(t,n,o,u)))e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e)}return f}}; +THREE.Rectangle=function(){function a(){k=e-b;h=f-c}var b,c,e,f,k,h,l=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return k};this.getHeight=function(){return h};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(k,h,u,p){l=!1;b=k;c=h;e=u;f=p;a()};this.addPoint=function(k,h){l?(l=!1,b=k,c=h,e=k,f=h):(b=bk?e:k,f=f>h?f:h);a()};this.add3Points= +function(k,h,u,p,v,t){l?(l=!1,b=ku?k>v?k:v:u>v?u:v,f=h>p?h>t?h:t:p>t?p:t):(b=ku?k>v?k>e?k:e:v>e?v:e:u>v?u>e?u:e:v>e?v:e,f=h>p?h>t?h>f?h:f:t>f?t:f:p>t?p>f?p:f:t>f?t:f);a()};this.addRectangle=function(k){l?(l=!1,b=k.getLeft(),c=k.getTop(),e=k.getRight(),f=k.getBottom()):(b=bk.getRight()?e:k.getRight(),f=f> +k.getBottom()?f:k.getBottom());a()};this.inflate=function(k){b-=k;c-=k;e+=k;f+=k;a()};this.minSelf=function(k){b=b>k.getLeft()?b:k.getLeft();c=c>k.getTop()?c:k.getTop();e=e=0&&Math.min(f,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){l=!0;f=e=c=b=0;a()};this.isEmpty=function(){return l}}; +THREE.Math={clamp:function(a,b,c){return ac?c:a},clampBottom:function(a,b){return a=0&&k>=0&&m>=0&&n>=0?!0:h<0&&k<0||m<0&&n<0?!1:(h<0?e=Math.max(e,h/(h-k)):k<0&&(f=Math.min(f,h/(h-k))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),fG&&m.positionScreen.z0&&K.z<1))ia=C[E]=C[E]||new THREE.RenderableParticle,E++,D=ia,D.x=K.x/K.w,D.y=K.y/K.w,D.z=K.z,D.rotation=X.rotation.z,D.scale.x=X.scale.x*Math.abs(D.x-(K.x+h.projectionMatrix.n11)/(K.w+h.projectionMatrix.n14)),D.scale.y=X.scale.y*Math.abs(D.y-(K.y+h.projectionMatrix.n22)/(K.w+h.projectionMatrix.n24)),D.materials=X.materials,I.push(D);k&&I.sort(c);return I}}; -THREE.Quaternion=function(b,c,e,f){this.set(b||0,c||0,e||0,f!==void 0?f:1)}; -THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,e,f){this.x=b;this.y=c;this.z=e;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,e=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),k=Math.cos(e),e=Math.sin(e),m=b*c,n=f*h;this.w=m*k-n*e;this.x=m*e+n*k;this.y=f*c*k+b*h*e;this.z=b*h*k-f*c*e;return this},setFromAxisAngle:function(b,c){var e=c/2,f=Math.sin(e); -this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(e);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z); -this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c= -this.x,e=this.y,f=this.z,h=this.w,k=b.x,m=b.y,n=b.z,b=b.w;this.x=c*b+h*k+e*n-f*m;this.y=e*b+h*m+f*k-c*n;this.z=f*b+h*n+c*m-e*k;this.w=h*b-c*k-e*m-f*n;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var e=b.x,f=b.y,h=b.z,k=this.x,m=this.y,n=this.z,p=this.w,t=p*e+m*h-n*f,w=p*f+n*e-k*h,u=p*h+k*f-m*e,e=-k* -e-m*f-n*h;c.x=t*p+e*-k+w*-n-u*-m;c.y=w*p+e*-m+u*-k-t*-n;c.z=u*p+e*-n+t*-m-w*-k;return c}};THREE.Quaternion.slerp=function(b,c,e,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return e.w=b.w,e.x=b.x,e.y=b.y,e.z=b.z,e;var k=Math.acos(h),m=Math.sqrt(1-h*h);if(Math.abs(m)<0.0010)return e.w=0.5*(b.w+c.w),e.x=0.5*(b.x+c.x),e.y=0.5*(b.y+c.y),e.z=0.5*(b.z+c.z),e;h=Math.sin((1-f)*k)/m;f=Math.sin(f*k)/m;e.w=b.w*h+c.w*f;e.x=b.x*h+c.x*f;e.y=b.y*h+c.y*f;e.z=b.z*h+c.z*f;return e}; -THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,e,f,h,k){this.a=b;this.b=c;this.c=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=k instanceof Array?k:[k];this.centroid=new THREE.Vector3}; -THREE.Face4=function(b,c,e,f,h,k,m){this.a=b;this.b=c;this.c=e;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=k instanceof THREE.Color?k:new THREE.Color;this.vertexColors=k instanceof Array?k:[];this.vertexTangents=[];this.materials=m instanceof Array?m:[m];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0}; -THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; -THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var e=0,f=this.vertices.length;e0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, -this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,e=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,e=this.vertices.length;cthis.points.length-2?k:k+1;e[3]=k>this.points.length-3?k:k+2;t=this.points[e[0]];w=this.points[e[1]]; -u=this.points[e[2]];x=this.points[e[3]];n=m*m;p=m*n;f.x=c(t.x,w.x,u.x,x.x,m,n,p);f.y=c(t.y,w.y,u.y,x.y,m,n,p);f.z=c(t.z,w.z,u.z,x.z,m,n,p);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;b=0&&k>=0&&h>=0&&l>=0?!0:f<0&&k<0||h<0&&l<0?!1:(f<0?b=Math.max(b,f/(f-k)):k<0&&(e=Math.min(e,f/(f-k))),h<0?b=Math.max(b,h/(h-l)):l<0&&(e=Math.min(e,h/(h-l))),em&&h.positionScreen.z0&&F.z<1))aa=z[A]=z[A]||new THREE.RenderableParticle,A++,B=aa,B.x=F.x/F.w,B.y=F.y/F.w,B.z=F.z,B.rotation=X.rotation.z,B.scale.x=X.scale.x*Math.abs(B.x-(F.x+f.projectionMatrix.n11)/(F.w+f.projectionMatrix.n14)),B.scale.y=X.scale.y*Math.abs(B.y-(F.y+f.projectionMatrix.n22)/(F.w+f.projectionMatrix.n24)),B.materials=X.materials,E.push(B);k&&E.sort(b);return E}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; +THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),k=Math.cos(c),c=Math.sin(c),h=a*b,l=e*f;this.w=h*k-l*c;this.x=h*c+l*k;this.y=e*b*k+a*f*c;this.z=a*f*k-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c); +this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;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,e=this.z,f=this.w,k=a.x,h=a.y,l=a.z,a=a.w;this.x=b*a+f*k+c*l-e*h;this.y=c*a+f*h+e*k-b*l;this.z=e*a+f*l+b*h-c*k;this.w=f*a-b*k-c*h-e*l;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,e=a.y,f=a.z,k=this.x,h=this.y,l=this.z,n=this.w,o=n*c+h*f-l*e,u=n*e+l*c-k*f,p=n*f+k*e-h*c,c=-k* +c-h*e-l*f;b.x=o*n+c*-k+u*-l-p*-h;b.y=u*n+c*-h+p*-k-o*-l;b.z=p*n+c*-l+o*-h-u*-k;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var k=Math.acos(f),h=Math.sqrt(1-f*f);if(Math.abs(h)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*k)/h;e=Math.sin(e*k)/h;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; +THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,e,f,k){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=k;this.centroid=new THREE.Vector3}; +THREE.Face4=function(a,b,c,e,f,k,h){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=k instanceof THREE.Color?k:new THREE.Color;this.vertexColors=k instanceof Array?k:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; +THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}}; +THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; +THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, +this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;bthis.points.length-2?k:k+1;c[3]=k>this.points.length-3?k:k+2;o=this.points[c[0]];u=this.points[c[1]]; +p=this.points[c[2]];v=this.points[c[3]];l=h*h;n=h*l;e.x=b(o.x,u.x,p.x,v.x,h,l,n);e.y=b(o.y,u.y,p.y,v.y,h,l,n);e.z=b(o.z,u.z,p.z,v.z,h,l,n);return e};this.getControlPointsArray=function(){var a,c,b=this.points.length,e=[];for(a=0;athis.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;b=THREE.Math.clamp(Math.floor(this.time/c),0,this.geometry.morphTargets.length-1);if(b!=this.currentKeyframe)this.morphTargetInfluences[this.lastKeyframe]= -0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[b]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=b;c=this.time%c/c;this.directionBackwards&&(c=1-c);this.morphTargetInfluences[this.currentKeyframe]=c;this.morphTargetInfluences[this.lastKeyframe]=1-c};THREE.Ribbon=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c]};THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon; -THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(b,c){c===void 0&&(c=0);for(var c=Math.abs(c),e=0;e1){b=e.matrixWorldInverse;b=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(var f=1;f=this.LODs[f].visibleAtDistance)this.LODs[f-1].object3D.visible=!1, -this.LODs[f].object3D.visible=!0;else break;for(;fthis.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;a=THREE.Math.clamp(Math.floor(this.time/b),0,this.geometry.morphTargets.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;c1){a=c.matrixWorldInverse;a=-(a.n31*this.position.x+a.n32*this.position.y+a.n33*this.position.z+a.n34);this.LODs[0].object3D.visible=!0;for(var e=1;e=this.LODs[e].visibleAtDistance)this.LODs[e-1].object3D.visible=!1, +this.LODs[e].object3D.visible=!0;else break;for(;e0&&(e(THREE.NormalBlending),c(1),h("rgba("+Math.floor(A.r*255)+","+Math.floor(A.g*255)+","+ -Math.floor(A.b*255)+","+z+")"),v.fillRect(Math.floor(U.getX()),Math.floor(U.getY()),Math.floor(U.getWidth()),Math.floor(U.getHeight()))),U.empty())};this.render=function(b,p){function t(b){var c,e,f,h=b.lights;M.setRGB(0,0,0);na.setRGB(0,0,0);ya.setRGB(0,0,0);b=0;for(c=h.length;b>1,wa=t.height>>1,m=k.scale.x*u,p=k.scale.y*x,o=m*w,n=p*wa,L.set(b.x-o,b.y-n,b.x+o,b.y+n),za.intersects(L)&&(v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(m,-p),v.translate(-w,-wa),v.drawImage(t,0,0),v.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(o=k.scale.x*u,n=k.scale.y*x,L.set(b.x-o,b.y-n,b.x+o,b.y+n),za.intersects(L)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),v.save(),v.translate(b.x,b.y),v.rotate(-k.rotation),v.scale(o,n),m.program(v), -v.restore()))}function y(b,h,k,m){c(m.opacity);e(m.blending);v.beginPath();v.moveTo(b.positionScreen.x,b.positionScreen.y);v.lineTo(h.positionScreen.x,h.positionScreen.y);v.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)v.lineWidth=G=b;b=m.linecap;if(I!=b)v.lineCap=I=b;b=m.linejoin;if(P!=b)v.lineJoin=P=b;f(m.color.getContextStyle());v.stroke();L.inflate(m.linewidth*2)}}function A(b,f,h,m,n,t,u,v,wa){k.info.render.vertices+=3;k.info.render.faces++;c(v.opacity);e(v.blending); -J=b.positionScreen.x;$=b.positionScreen.y;Z=f.positionScreen.x;Q=f.positionScreen.y;o=h.positionScreen.x;R=h.positionScreen.y;D(J,$,Z,Q,o,R);if(v instanceof THREE.MeshBasicMaterial)if(v.map)v.map.mapping instanceof THREE.UVMapping&&(qa=u.uvs[0],bb(J,$,Z,Q,o,R,qa[m].u,qa[m].v,qa[n].u,qa[n].v,qa[t].u,qa[t].v,v.map));else if(v.envMap){if(v.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=p.matrixWorldInverse,ka.copy(u.vertexNormalsWorld[0]),ra=(ka.x*b.n11+ka.y*b.n12+ka.z*b.n13)*0.5+0.5,xa= --(ka.x*b.n21+ka.y*b.n22+ka.z*b.n23)*0.5+0.5,ka.copy(u.vertexNormalsWorld[1]),Ca=(ka.x*b.n11+ka.y*b.n12+ka.z*b.n13)*0.5+0.5,Ga=-(ka.x*b.n21+ka.y*b.n22+ka.z*b.n23)*0.5+0.5,ka.copy(u.vertexNormalsWorld[2]),Fa=(ka.x*b.n11+ka.y*b.n12+ka.z*b.n13)*0.5+0.5,Da=-(ka.x*b.n21+ka.y*b.n22+ka.z*b.n23)*0.5+0.5,bb(J,$,Z,Q,o,R,ra,xa,Ca,Ga,Fa,Da,v.envMap)}else v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshLambertMaterial)v.map&&!v.wireframe&& -(v.map.mapping instanceof THREE.UVMapping&&(qa=u.uvs[0],bb(J,$,Z,Q,o,R,qa[m].u,qa[m].v,qa[n].u,qa[n].v,qa[t].u,qa[t].v,v.map)),e(THREE.SubtractiveBlending)),da?!v.wireframe&&v.shading==THREE.SmoothShading&&u.vertexNormalsWorld.length==3?(T.r=X.r=ia.r=M.r,T.g=X.g=ia.g=M.g,T.b=X.b=ia.b=M.b,w(wa,u.v1.positionWorld,u.vertexNormalsWorld[0],T),w(wa,u.v2.positionWorld,u.vertexNormalsWorld[1],X),w(wa,u.v3.positionWorld,u.vertexNormalsWorld[2],ia),T.r=Math.max(0,Math.min(v.color.r*T.r,1)),T.g=Math.max(0,Math.min(v.color.g* -T.g,1)),T.b=Math.max(0,Math.min(v.color.b*T.b,1)),X.r=Math.max(0,Math.min(v.color.r*X.r,1)),X.g=Math.max(0,Math.min(v.color.g*X.g,1)),X.b=Math.max(0,Math.min(v.color.b*X.b,1)),ia.r=Math.max(0,Math.min(v.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(v.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(v.color.b*ia.b,1)),ja.r=(X.r+ia.r)*0.5,ja.g=(X.g+ia.g)*0.5,ja.b=(X.b+ia.b)*0.5,ua=Ya(T,X,ia,ja),Ua(J,$,Z,Q,o,R,0,0,1,0,0,1,ua)):(pa.r=M.r,pa.g=M.g,pa.b=M.b,w(wa,u.centroidWorld,u.normalWorld,pa),aa.r=Math.max(0,Math.min(v.color.r* -pa.r,1)),aa.g=Math.max(0,Math.min(v.color.g*pa.g,1)),aa.b=Math.max(0,Math.min(v.color.b*pa.b,1)),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)):v.wireframe?Na(v.color,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(v.color);else if(v instanceof THREE.MeshDepthMaterial)ma=p.near,ca=p.far,T.r=T.g=T.b=1-Qa(b.positionScreen.z,ma,ca),X.r=X.g=X.b=1-Qa(f.positionScreen.z,ma,ca),ia.r=ia.g=ia.b=1-Qa(h.positionScreen.z,ma,ca),ja.r=(X.r+ia.r)*0.5,ja.g=(X.g+ -ia.g)*0.5,ja.b=(X.b+ia.b)*0.5,ua=Ya(T,X,ia,ja),Ua(J,$,Z,Q,o,R,0,0,1,0,0,1,ua);else if(v instanceof THREE.MeshNormalMaterial)aa.r=Va(u.normalWorld.x),aa.g=Va(u.normalWorld.y),aa.b=Va(u.normalWorld.z),v.wireframe?Na(aa,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):C(aa)}function E(b,f,h,m,n,t,v,u,wa){k.info.render.vertices+=4;k.info.render.faces++;c(u.opacity);e(u.blending);if(u.map||u.envMap)A(b,f,m,0,1,3,v,u,wa),A(n,h,t,1,2,3,v,u,wa);else if(J=b.positionScreen.x,$=b.positionScreen.y, -Z=f.positionScreen.x,Q=f.positionScreen.y,o=h.positionScreen.x,R=h.positionScreen.y,fa=m.positionScreen.x,ea=m.positionScreen.y,ha=n.positionScreen.x,ga=n.positionScreen.y,la=t.positionScreen.x,oa=t.positionScreen.y,u instanceof THREE.MeshBasicMaterial)Za(J,$,Z,Q,o,R,fa,ea),u.wireframe?Na(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(u.color);else if(u instanceof THREE.MeshLambertMaterial)da?!u.wireframe&&u.shading==THREE.SmoothShading&&v.vertexNormalsWorld.length==4?(T.r= -X.r=ia.r=ja.r=M.r,T.g=X.g=ia.g=ja.g=M.g,T.b=X.b=ia.b=ja.b=M.b,w(wa,v.v1.positionWorld,v.vertexNormalsWorld[0],T),w(wa,v.v2.positionWorld,v.vertexNormalsWorld[1],X),w(wa,v.v4.positionWorld,v.vertexNormalsWorld[3],ia),w(wa,v.v3.positionWorld,v.vertexNormalsWorld[2],ja),T.r=Math.max(0,Math.min(u.color.r*T.r,1)),T.g=Math.max(0,Math.min(u.color.g*T.g,1)),T.b=Math.max(0,Math.min(u.color.b*T.b,1)),X.r=Math.max(0,Math.min(u.color.r*X.r,1)),X.g=Math.max(0,Math.min(u.color.g*X.g,1)),X.b=Math.max(0,Math.min(u.color.b* -X.b,1)),ia.r=Math.max(0,Math.min(u.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(u.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(u.color.b*ia.b,1)),ja.r=Math.max(0,Math.min(u.color.r*ja.r,1)),ja.g=Math.max(0,Math.min(u.color.g*ja.g,1)),ja.b=Math.max(0,Math.min(u.color.b*ja.b,1)),ua=Ya(T,X,ia,ja),D(J,$,Z,Q,fa,ea),Ua(J,$,Z,Q,fa,ea,0,0,1,0,0,1,ua),D(ha,ga,o,R,la,oa),Ua(ha,ga,o,R,la,oa,1,0,1,1,0,1,ua)):(pa.r=M.r,pa.g=M.g,pa.b=M.b,w(wa,v.centroidWorld,v.normalWorld,pa),aa.r=Math.max(0,Math.min(u.color.r*pa.r, -1)),aa.g=Math.max(0,Math.min(u.color.g*pa.g,1)),aa.b=Math.max(0,Math.min(u.color.b*pa.b,1)),Za(J,$,Z,Q,o,R,fa,ea),u.wireframe?Na(aa,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(aa)):(Za(J,$,Z,Q,o,R,fa,ea),u.wireframe?Na(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):C(u.color));else if(u instanceof THREE.MeshNormalMaterial)aa.r=Va(v.normalWorld.x),aa.g=Va(v.normalWorld.y),aa.b=Va(v.normalWorld.z),Za(J,$,Z,Q,o,R,fa,ea),u.wireframe?Na(aa,u.wireframeLinewidth, -u.wireframeLinecap,u.wireframeLinejoin):C(aa);else if(u instanceof THREE.MeshDepthMaterial)ma=p.near,ca=p.far,T.r=T.g=T.b=1-Qa(b.positionScreen.z,ma,ca),X.r=X.g=X.b=1-Qa(f.positionScreen.z,ma,ca),ia.r=ia.g=ia.b=1-Qa(m.positionScreen.z,ma,ca),ja.r=ja.g=ja.b=1-Qa(h.positionScreen.z,ma,ca),ua=Ya(T,X,ia,ja),D(J,$,Z,Q,fa,ea),Ua(J,$,Z,Q,fa,ea,0,0,1,0,0,1,ua),D(ha,ga,o,R,la,oa),Ua(ha,ga,o,R,la,oa,1,0,1,1,0,1,ua)}function D(b,c,e,f,h,k){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(b,c); -v.closePath()}function Za(b,c,e,f,h,k,m,o){v.beginPath();v.moveTo(b,c);v.lineTo(e,f);v.lineTo(h,k);v.lineTo(m,o);v.lineTo(b,c);v.closePath()}function Na(b,c,e,h){if(G!=c)v.lineWidth=G=c;if(I!=e)v.lineCap=I=e;if(P!=h)v.lineJoin=P=h;f(b.getContextStyle());v.stroke();L.inflate(c*2)}function C(b){h(b.getContextStyle());v.fill()}function bb(b,c,e,f,k,m,o,n,p,u,t,wa,w){if(w.image.width!=0){if(w.needsUpdate==!0||sa[w.id]==void 0){var x=w.wrapS==THREE.RepeatWrapping,U=w.wrapT==THREE.RepeatWrapping;sa[w.id]= -v.createPattern(w.image,x&&U?"repeat":x&&!U?"repeat-x":!x&&U?"repeat-y":"no-repeat");w.needsUpdate=!1}h(sa[w.id]);var x=w.offset.x/w.repeat.x,U=w.offset.y/w.repeat.y,z=(w.image.width-1)*w.repeat.x,w=(w.image.height-1)*w.repeat.y,o=(o+x)*z,n=(n+U)*w,p=(p+x)*z,u=(u+U)*w,t=(t+x)*z,wa=(wa+U)*w;e-=b;f-=c;k-=b;m-=c;p-=o;u-=n;t-=o;wa-=n;x=1/(p*wa-t*u);w=(wa*e-u*k)*x;u=(wa*f-u*m)*x;e=(p*k-t*e)*x;f=(p*m-t*f)*x;b=b-w*o-e*n;c=c-u*o-f*n;v.save();v.transform(w,u,e,f,b,c);v.fill();v.restore()}}function Ua(b,c, -e,f,h,k,m,o,n,p,u,t,w){var wa,x;wa=w.width-1;x=w.height-1;m*=wa;o*=x;n*=wa;p*=x;u*=wa;t*=x;e-=b;f-=c;h-=b;k-=c;n-=m;p-=o;u-=m;t-=o;x=1/(n*t-u*p);wa=(t*e-p*h)*x;p=(t*f-p*k)*x;e=(n*h-u*e)*x;f=(n*k-u*f)*x;b=b-wa*m-e*o;c=c-p*m-f*o;v.save();v.transform(wa,p,e,f,b,c);v.clip();v.drawImage(w,0,0);v.restore()}function Ya(b,c,e,f){var h=~~(b.r*255),k=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),o=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),p=~~(e.g*255),e=~~(e.b*255),u=~~(f.r*255),t=~~(f.g*255),f=~~(f.b*255);ta[0]= -h<0?0:h>255?255:h;ta[1]=k<0?0:k>255?255:k;ta[2]=b<0?0:b>255?255:b;ta[4]=m<0?0:m>255?255:m;ta[5]=o<0?0:o>255?255:o;ta[6]=c<0?0:c>255?255:c;ta[8]=n<0?0:n>255?255:n;ta[9]=p<0?0:p>255?255:p;ta[10]=e<0?0:e>255?255:e;ta[12]=u<0?0:u>255?255:u;ta[13]=t<0?0:t>255?255:t;ta[14]=f<0?0:f>255?255:f;Ia.putImageData(Ba,0,0);Ha.drawImage(Ea,0,0);return Ka}function Qa(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Va(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Oa(b,c){var e=c.x-b.x,f=c.y-b.y,h=e*e+f*f;h!=0&&(h= -1/Math.sqrt(h),e*=h,f*=h,c.x+=e,c.y+=f,b.x-=e,b.y-=f)}var $a,cb,va,Ja,Pa,Wa,ab,Aa;this.autoClear?this.clear():v.setTransform(1,0,0,-1,u,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,p,this.sortElements);(da=b.lights.length>0)&&t(b);$a=0;for(cb=m.length;$a0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m)):k instanceof THREE.PointLight&&(Y.sub(k.position,c.centroidWorld),Y.normalize(),m=c.normalWorld.dot(Y)*k.intensity,m>0&&(e.r+=k.color.r*m,e.g+=k.color.g*m,e.b+=k.color.b*m))}function c(c,e,m,n,u,t){k.info.render.vertices+=3;k.info.render.faces++;J=f($++); -J.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");u instanceof THREE.MeshBasicMaterial?G.copy(u.color):u instanceof THREE.MeshLambertMaterial?C?(I.r=P.r,I.g=P.g,I.b=P.b,b(t,n,I),G.r=Math.max(0,Math.min(u.color.r*I.r,1)),G.g=Math.max(0,Math.min(u.color.g*I.g,1)),G.b=Math.max(0,Math.min(u.color.b*I.b,1))):G.copy(u.color):u instanceof THREE.MeshDepthMaterial?(O=1-u.__2near/(u.__farPlusNear- -n.z*u.__farMinusNear),G.setRGB(O,O,O)):u instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));u.wireframe?J.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+u.wireframeLinewidth+"; stroke-opacity: "+u.opacity+"; stroke-linecap: "+u.wireframeLinecap+"; stroke-linejoin: "+u.wireframeLinejoin):J.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+u.opacity);p.appendChild(J)}function e(c,e,m,n,u,t,v){k.info.render.vertices+= -4;k.info.render.faces++;J=f($++);J.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+n.positionScreen.x+","+n.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?G.copy(t.color):t instanceof THREE.MeshLambertMaterial?C?(I.r=P.r,I.g=P.g,I.b=P.b,b(v,u,I),G.r=Math.max(0,Math.min(t.color.r*I.r,1)),G.g=Math.max(0,Math.min(t.color.g*I.g,1)),G.b=Math.max(0,Math.min(t.color.b*I.b,1))): -G.copy(t.color):t instanceof THREE.MeshDepthMaterial?(O=1-t.__2near/(t.__farPlusNear-u.z*t.__farMinusNear),G.setRGB(O,O,O)):t instanceof THREE.MeshNormalMaterial&&G.setRGB(h(u.normalWorld.x),h(u.normalWorld.y),h(u.normalWorld.z));t.wireframe?J.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):J.setAttribute("style","fill: "+G.getContextStyle()+ -"; fill-opacity: "+t.opacity);p.appendChild(J)}function f(b){N[b]==null&&(N[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),Q==0&&N[b].setAttribute("shape-rendering","crispEdges"));return N[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,p=document.createElementNS("http://www.w3.org/2000/svg","svg"),t,w,u,x,v,A,z,y,D=new THREE.Rectangle,E=new THREE.Rectangle,C=!1,G=new THREE.Color(16777215),I=new THREE.Color(16777215),P=new THREE.Color(0), -K=new THREE.Color(0),B=new THREE.Color(0),O,Y=new THREE.Vector3,N=[],V=[],J,$,Z,Q=1;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":Q=1;break;case "low":Q=0}};this.setSize=function(b,c){t=b;w=c;u=t/2;x=w/2;p.setAttribute("viewBox",-u+" "+-x+" "+t+" "+w);p.setAttribute("width",t);p.setAttribute("height",w);D.set(-u,-x,u,x)};this.clear=function(){for(;p.childNodes.length>0;)p.removeChild(p.childNodes[0])}; -this.render=function(b,f){var h,t,w,G,N,O,I,T;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);Z=$=0;if(C=b.lights.length>0){I=b.lights;P.setRGB(0,0,0);K.setRGB(0,0,0);B.setRGB(0,0,0);h=0;for(t=I.length;h0&&(c(THREE.NormalBlending),b(1),f("rgba("+Math.floor(y.r*255)+","+Math.floor(y.g*255)+","+ +Math.floor(y.b*255)+","+x+")"),t.fillRect(Math.floor(H.getX()),Math.floor(H.getY()),Math.floor(H.getWidth()),Math.floor(H.getHeight()))),H.empty())};this.render=function(a,n){function o(a){var c,b,e,f=a.lights;Y.setRGB(0,0,0);N.setRGB(0,0,0);na.setRGB(0,0,0);a=0;for(c=f.length;a>1,wa=o.height>>1,h=k.scale.x*p,n=k.scale.y*v,m=h*u,l=n*wa,L.set(a.x-m,a.y-l,a.x+m,a.y+l),xa.intersects(L)&&(t.save(),t.translate(a.x,a.y),t.rotate(-k.rotation),t.scale(h,-n),t.translate(-u,-wa),t.drawImage(o,0,0),t.restore())}else h instanceof THREE.ParticleCanvasMaterial&&(m=k.scale.x*p,l=k.scale.y*v,L.set(a.x-m,a.y-l,a.x+m,a.y+l),xa.intersects(L)&&(e(h.color.getContextStyle()),f(h.color.getContextStyle()),t.save(),t.translate(a.x,a.y),t.rotate(-k.rotation),t.scale(m,l),h.program(t), +t.restore()))}function w(a,f,k,h){b(h.opacity);c(h.blending);t.beginPath();t.moveTo(a.positionScreen.x,a.positionScreen.y);t.lineTo(f.positionScreen.x,f.positionScreen.y);t.closePath();if(h instanceof THREE.LineBasicMaterial){a=h.linewidth;if(C!=a)t.lineWidth=C=a;a=h.linecap;if(E!=a)t.lineCap=E=a;a=h.linejoin;if(G!=a)t.lineJoin=G=a;e(h.color.getContextStyle());t.stroke();L.inflate(h.linewidth*2)}}function y(a,e,f,h,l,o,p,t,v){k.info.render.vertices+=3;k.info.render.faces++;b(t.opacity);c(t.blending); +O=a.positionScreen.x;W=a.positionScreen.y;S=e.positionScreen.x;m=e.positionScreen.y;ca=f.positionScreen.x;Q=f.positionScreen.y;B(O,W,S,m,ca,Q);if(t instanceof THREE.MeshBasicMaterial)if(t.map)t.map.mapping instanceof THREE.UVMapping&&(ma=p.uvs[0],Za(O,W,S,m,ca,Q,ma[h].u,ma[h].v,ma[l].u,ma[l].v,ma[o].u,ma[o].v,t.map));else if(t.envMap){if(t.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=n.matrixWorldInverse,va.copy(p.vertexNormalsWorld[0]),sa=(va.x*a.n11+va.y*a.n12+va.z*a.n13)*0.5+0.5, +Aa=-(va.x*a.n21+va.y*a.n22+va.z*a.n23)*0.5+0.5,va.copy(p.vertexNormalsWorld[1]),Da=(va.x*a.n11+va.y*a.n12+va.z*a.n13)*0.5+0.5,Ca=-(va.x*a.n21+va.y*a.n22+va.z*a.n23)*0.5+0.5,va.copy(p.vertexNormalsWorld[2]),Ba=(va.x*a.n11+va.y*a.n12+va.z*a.n13)*0.5+0.5,Ea=-(va.x*a.n21+va.y*a.n22+va.z*a.n23)*0.5+0.5,Za(O,W,S,m,ca,Q,sa,Aa,Da,Ca,Ba,Ea,t.envMap)}else t.wireframe?La(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):Ma(t.color);else if(t instanceof THREE.MeshLambertMaterial)t.map&&!t.wireframe&& +(t.map.mapping instanceof THREE.UVMapping&&(ma=p.uvs[0],Za(O,W,S,m,ca,Q,ma[h].u,ma[h].v,ma[l].u,ma[l].v,ma[o].u,ma[o].v,t.map)),c(THREE.SubtractiveBlending)),Z?!t.wireframe&&t.shading==THREE.SmoothShading&&p.vertexNormalsWorld.length==3?(R.r=X.r=aa.r=Y.r,R.g=X.g=aa.g=Y.g,R.b=X.b=aa.b=Y.b,u(v,p.v1.positionWorld,p.vertexNormalsWorld[0],R),u(v,p.v2.positionWorld,p.vertexNormalsWorld[1],X),u(v,p.v3.positionWorld,p.vertexNormalsWorld[2],aa),R.r=Math.max(0,Math.min(t.color.r*R.r,1)),R.g=Math.max(0,Math.min(t.color.g* +R.g,1)),R.b=Math.max(0,Math.min(t.color.b*R.b,1)),X.r=Math.max(0,Math.min(t.color.r*X.r,1)),X.g=Math.max(0,Math.min(t.color.g*X.g,1)),X.b=Math.max(0,Math.min(t.color.b*X.b,1)),aa.r=Math.max(0,Math.min(t.color.r*aa.r,1)),aa.g=Math.max(0,Math.min(t.color.g*aa.g,1)),aa.b=Math.max(0,Math.min(t.color.b*aa.b,1)),ga.r=(X.r+aa.r)*0.5,ga.g=(X.g+aa.g)*0.5,ga.b=(X.b+aa.b)*0.5,qa=Wa(R,X,aa,ga),Ta(O,W,S,m,ca,Q,0,0,1,0,0,1,qa)):(fa.r=Y.r,fa.g=Y.g,fa.b=Y.b,u(v,p.centroidWorld,p.normalWorld,fa),$.r=Math.max(0,Math.min(t.color.r* +fa.r,1)),$.g=Math.max(0,Math.min(t.color.g*fa.g,1)),$.b=Math.max(0,Math.min(t.color.b*fa.b,1)),t.wireframe?La($,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):Ma($)):t.wireframe?La(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):Ma(t.color);else if(t instanceof THREE.MeshDepthMaterial)oa=n.near,la=n.far,R.r=R.g=R.b=1-Pa(a.positionScreen.z,oa,la),X.r=X.g=X.b=1-Pa(e.positionScreen.z,oa,la),aa.r=aa.g=aa.b=1-Pa(f.positionScreen.z,oa,la),ga.r=(X.r+aa.r)*0.5,ga.g=(X.g+ +aa.g)*0.5,ga.b=(X.b+aa.b)*0.5,qa=Wa(R,X,aa,ga),Ta(O,W,S,m,ca,Q,0,0,1,0,0,1,qa);else if(t instanceof THREE.MeshNormalMaterial)$.r=Ua(p.normalWorld.x),$.g=Ua(p.normalWorld.y),$.b=Ua(p.normalWorld.z),t.wireframe?La($,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):Ma($)}function A(a,e,f,h,l,o,t,p,v){k.info.render.vertices+=4;k.info.render.faces++;b(p.opacity);c(p.blending);if(p.map||p.envMap)y(a,e,h,0,1,3,t,p,v),y(l,f,o,1,2,3,t,p,v);else if(O=a.positionScreen.x,W=a.positionScreen.y,S=e.positionScreen.x, +m=e.positionScreen.y,ca=f.positionScreen.x,Q=f.positionScreen.y,ea=h.positionScreen.x,da=h.positionScreen.y,ka=l.positionScreen.x,ia=l.positionScreen.y,ha=o.positionScreen.x,ja=o.positionScreen.y,p instanceof THREE.MeshBasicMaterial)z(O,W,S,m,ca,Q,ea,da),p.wireframe?La(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ma(p.color);else if(p instanceof THREE.MeshLambertMaterial)Z?!p.wireframe&&p.shading==THREE.SmoothShading&&t.vertexNormalsWorld.length==4?(R.r=X.r=aa.r=ga.r=Y.r,R.g= +X.g=aa.g=ga.g=Y.g,R.b=X.b=aa.b=ga.b=Y.b,u(v,t.v1.positionWorld,t.vertexNormalsWorld[0],R),u(v,t.v2.positionWorld,t.vertexNormalsWorld[1],X),u(v,t.v4.positionWorld,t.vertexNormalsWorld[3],aa),u(v,t.v3.positionWorld,t.vertexNormalsWorld[2],ga),R.r=Math.max(0,Math.min(p.color.r*R.r,1)),R.g=Math.max(0,Math.min(p.color.g*R.g,1)),R.b=Math.max(0,Math.min(p.color.b*R.b,1)),X.r=Math.max(0,Math.min(p.color.r*X.r,1)),X.g=Math.max(0,Math.min(p.color.g*X.g,1)),X.b=Math.max(0,Math.min(p.color.b*X.b,1)),aa.r=Math.max(0, +Math.min(p.color.r*aa.r,1)),aa.g=Math.max(0,Math.min(p.color.g*aa.g,1)),aa.b=Math.max(0,Math.min(p.color.b*aa.b,1)),ga.r=Math.max(0,Math.min(p.color.r*ga.r,1)),ga.g=Math.max(0,Math.min(p.color.g*ga.g,1)),ga.b=Math.max(0,Math.min(p.color.b*ga.b,1)),qa=Wa(R,X,aa,ga),B(O,W,S,m,ea,da),Ta(O,W,S,m,ea,da,0,0,1,0,0,1,qa),B(ka,ia,ca,Q,ha,ja),Ta(ka,ia,ca,Q,ha,ja,1,0,1,1,0,1,qa)):(fa.r=Y.r,fa.g=Y.g,fa.b=Y.b,u(v,t.centroidWorld,t.normalWorld,fa),$.r=Math.max(0,Math.min(p.color.r*fa.r,1)),$.g=Math.max(0,Math.min(p.color.g* +fa.g,1)),$.b=Math.max(0,Math.min(p.color.b*fa.b,1)),z(O,W,S,m,ca,Q,ea,da),p.wireframe?La($,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ma($)):(z(O,W,S,m,ca,Q,ea,da),p.wireframe?La(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ma(p.color));else if(p instanceof THREE.MeshNormalMaterial)$.r=Ua(t.normalWorld.x),$.g=Ua(t.normalWorld.y),$.b=Ua(t.normalWorld.z),z(O,W,S,m,ca,Q,ea,da),p.wireframe?La($,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ma($); +else if(p instanceof THREE.MeshDepthMaterial)oa=n.near,la=n.far,R.r=R.g=R.b=1-Pa(a.positionScreen.z,oa,la),X.r=X.g=X.b=1-Pa(e.positionScreen.z,oa,la),aa.r=aa.g=aa.b=1-Pa(h.positionScreen.z,oa,la),ga.r=ga.g=ga.b=1-Pa(f.positionScreen.z,oa,la),qa=Wa(R,X,aa,ga),B(O,W,S,m,ea,da),Ta(O,W,S,m,ea,da,0,0,1,0,0,1,qa),B(ka,ia,ca,Q,ha,ja),Ta(ka,ia,ca,Q,ha,ja,1,0,1,1,0,1,qa)}function B(a,c,b,e,f,k){t.beginPath();t.moveTo(a,c);t.lineTo(b,e);t.lineTo(f,k);t.lineTo(a,c);t.closePath()}function z(a,c,b,e,f,k,h,m){t.beginPath(); +t.moveTo(a,c);t.lineTo(b,e);t.lineTo(f,k);t.lineTo(h,m);t.lineTo(a,c);t.closePath()}function La(a,c,b,f){if(C!=c)t.lineWidth=C=c;if(E!=b)t.lineCap=E=b;if(G!=f)t.lineJoin=G=f;e(a.getContextStyle());t.stroke();L.inflate(c*2)}function Ma(a){f(a.getContextStyle());t.fill()}function Za(a,c,b,e,k,h,m,l,n,p,o,u,v){if(v.image.width!=0){if(v.needsUpdate==!0||ra[v.id]==void 0){var wa=v.wrapS==THREE.RepeatWrapping,H=v.wrapT==THREE.RepeatWrapping;ra[v.id]=t.createPattern(v.image,wa&&H?"repeat":wa&&!H?"repeat-x": +!wa&&H?"repeat-y":"no-repeat");v.needsUpdate=!1}f(ra[v.id]);var wa=v.offset.x/v.repeat.x,H=v.offset.y/v.repeat.y,x=(v.image.width-1)*v.repeat.x,v=(v.image.height-1)*v.repeat.y,m=(m+wa)*x,l=(l+H)*v,n=(n+wa)*x,p=(p+H)*v,o=(o+wa)*x,u=(u+H)*v;b-=a;e-=c;k-=a;h-=c;n-=m;p-=l;o-=m;u-=l;wa=1/(n*u-o*p);v=(u*b-p*k)*wa;p=(u*e-p*h)*wa;b=(n*k-o*b)*wa;e=(n*h-o*e)*wa;a=a-v*m-b*l;c=c-p*m-e*l;t.save();t.transform(v,p,b,e,a,c);t.fill();t.restore()}}function Ta(a,c,b,e,f,k,h,m,l,n,p,o,v){var u,wa;u=v.width-1;wa=v.height- +1;h*=u;m*=wa;l*=u;n*=wa;p*=u;o*=wa;b-=a;e-=c;f-=a;k-=c;l-=h;n-=m;p-=h;o-=m;wa=1/(l*o-p*n);u=(o*b-n*f)*wa;n=(o*e-n*k)*wa;b=(l*f-p*b)*wa;e=(l*k-p*e)*wa;a=a-u*h-b*m;c=c-n*h-e*m;t.save();t.transform(u,n,b,e,a,c);t.clip();t.drawImage(v,0,0);t.restore()}function Wa(a,c,b,e){var f=~~(a.r*255),k=~~(a.g*255),a=~~(a.b*255),h=~~(c.r*255),m=~~(c.g*255),c=~~(c.b*255),l=~~(b.r*255),n=~~(b.g*255),b=~~(b.b*255),p=~~(e.r*255),o=~~(e.g*255),e=~~(e.b*255);ta[0]=f<0?0:f>255?255:f;ta[1]=k<0?0:k>255?255:k;ta[2]=a<0?0: +a>255?255:a;ta[4]=h<0?0:h>255?255:h;ta[5]=m<0?0:m>255?255:m;ta[6]=c<0?0:c>255?255:c;ta[8]=l<0?0:l>255?255:l;ta[9]=n<0?0:n>255?255:n;ta[10]=b<0?0:b>255?255:b;ta[12]=p<0?0:p>255?255:p;ta[13]=o<0?0:o>255?255:o;ta[14]=e<0?0:e>255?255:e;Fa.putImageData(ya,0,0);U.drawImage(pa,0,0);return Ga}function Pa(a,c,b){a=(a-c)/(b-c);return a*a*(3-2*a)}function Ua(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function Na(a,c){var b=c.x-a.x,e=c.y-a.y,f=b*b+e*e;f!=0&&(f=1/Math.sqrt(f),b*=f,e*=f,c.x+=b,c.y+=e,a.x-=b,a.y-=e)}var Xa, +$a,ua,Ha,Oa,Va,Ya,za;this.autoClear?this.clear():t.setTransform(1,0,0,-1,p,v);k.info.render.vertices=0;k.info.render.faces=0;h=l.projectScene(a,n,this.sortElements);(Z=a.lights.length>0)&&o(a);Xa=0;for($a=h.length;Xa<$a;Xa++){ua=h[Xa];L.empty();if(ua instanceof THREE.RenderableParticle){F=ua;F.x*=p;F.y*=v;Ha=0;for(Oa=ua.materials.length;Ha0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h)):k instanceof THREE.PointLight&&(V.sub(k.position,c.centroidWorld),V.normalize(),h=c.normalWorld.dot(V)*k.intensity,h>0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h))}function b(c,b,h,m,l,p){k.info.render.vertices+=3;k.info.render.faces++;O=e(W++); +O.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+"z");l instanceof THREE.MeshBasicMaterial?C.copy(l.color):l instanceof THREE.MeshLambertMaterial?z?(E.r=G.r,E.g=G.g,E.b=G.b,a(p,m,E),C.r=Math.max(0,Math.min(l.color.r*E.r,1)),C.g=Math.max(0,Math.min(l.color.g*E.g,1)),C.b=Math.max(0,Math.min(l.color.b*E.b,1))):C.copy(l.color):l instanceof THREE.MeshDepthMaterial?(M=1-l.__2near/(l.__farPlusNear- +m.z*l.__farMinusNear),C.setRGB(M,M,M)):l instanceof THREE.MeshNormalMaterial&&C.setRGB(f(m.normalWorld.x),f(m.normalWorld.y),f(m.normalWorld.z));l.wireframe?O.setAttribute("style","fill: none; stroke: "+C.getContextStyle()+"; stroke-width: "+l.wireframeLinewidth+"; stroke-opacity: "+l.opacity+"; stroke-linecap: "+l.wireframeLinecap+"; stroke-linejoin: "+l.wireframeLinejoin):O.setAttribute("style","fill: "+C.getContextStyle()+"; fill-opacity: "+l.opacity);n.appendChild(O)}function c(c,b,h,m,l,p,o){k.info.render.vertices+= +4;k.info.render.faces++;O=e(W++);O.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");p instanceof THREE.MeshBasicMaterial?C.copy(p.color):p instanceof THREE.MeshLambertMaterial?z?(E.r=G.r,E.g=G.g,E.b=G.b,a(o,l,E),C.r=Math.max(0,Math.min(p.color.r*E.r,1)),C.g=Math.max(0,Math.min(p.color.g*E.g,1)),C.b=Math.max(0,Math.min(p.color.b*E.b,1))): +C.copy(p.color):p instanceof THREE.MeshDepthMaterial?(M=1-p.__2near/(p.__farPlusNear-l.z*p.__farMinusNear),C.setRGB(M,M,M)):p instanceof THREE.MeshNormalMaterial&&C.setRGB(f(l.normalWorld.x),f(l.normalWorld.y),f(l.normalWorld.z));p.wireframe?O.setAttribute("style","fill: none; stroke: "+C.getContextStyle()+"; stroke-width: "+p.wireframeLinewidth+"; stroke-opacity: "+p.opacity+"; stroke-linecap: "+p.wireframeLinecap+"; stroke-linejoin: "+p.wireframeLinejoin):O.setAttribute("style","fill: "+C.getContextStyle()+ +"; fill-opacity: "+p.opacity);n.appendChild(O)}function e(a){J[a]==null&&(J[a]=document.createElementNS("http://www.w3.org/2000/svg","path"),m==0&&J[a].setAttribute("shape-rendering","crispEdges"));return J[a]}function f(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}var k=this,h=null,l=new THREE.Projector,n=document.createElementNS("http://www.w3.org/2000/svg","svg"),o,u,p,v,t,y,x,w,B=new THREE.Rectangle,A=new THREE.Rectangle,z=!1,C=new THREE.Color(16777215),E=new THREE.Color(16777215),G=new THREE.Color(0), +F=new THREE.Color(0),I=new THREE.Color(0),M,V=new THREE.Vector3,J=[],T=[],O,W,S,m=1;this.domElement=n;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(a){switch(a){case "high":m=1;break;case "low":m=0}};this.setSize=function(a,c){o=a;u=c;p=o/2;v=u/2;n.setAttribute("viewBox",-p+" "+-v+" "+o+" "+u);n.setAttribute("width",o);n.setAttribute("height",u);B.set(-p,-v,p,v)};this.clear=function(){for(;n.childNodes.length>0;)n.removeChild(n.childNodes[0])}; +this.render=function(a,e){var f,o,u,C,M,J,E,R;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;h=l.projectScene(a,e,this.sortElements);S=W=0;if(z=a.lights.length>0){E=a.lights;G.setRGB(0,0,0);F.setRGB(0,0,0);I.setRGB(0,0,0);f=0;for(o=E.length;f= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness * shadow ) );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec3( shadowDarkness );\n#endif\n}\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 ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\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(b){var c,e,f,h={};for(c=0;c=0)c&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(b.position,3,o.FLOAT,!1,0,0));else if(m.morphTargetBase){f=k.program.attributes;m.morphTargetBase!==-1?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[m.morphTargetBase]),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0)):f.position>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(f.position, -3,o.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length){n=0;var t=m.morphTargetForcedOrder;for(p=m.morphTargetInfluences;nu&&(v=w,u=p[v]);o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[v]);o.vertexAttribPointer(f["morphTarget"+n],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[n]=u;t[v]=1;u=-1;n++}}k.program.uniforms.morphTargetInfluences!==null&&o.uniform1fv(k.program.uniforms.morphTargetInfluences,m.__webglMorphTargetInfluences)}if(c){if(h.__webglCustomAttributesList){n=0;for(p=h.__webglCustomAttributesList.length;n=0&&(o.bindBuffer(o.ARRAY_BUFFER, -f.buffer),o.vertexAttribPointer(b[f.buffer.belongsToAttribute],f.size,o.FLOAT,!1,0,0))}b.color>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglColorBuffer),o.vertexAttribPointer(b.color,3,o.FLOAT,!1,0,0));b.normal>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglNormalBuffer),o.vertexAttribPointer(b.normal,3,o.FLOAT,!1,0,0));b.tangent>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglTangentBuffer),o.vertexAttribPointer(b.tangent,4,o.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglUVBuffer), -o.vertexAttribPointer(b.uv,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv)):o.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglUV2Buffer),o.vertexAttribPointer(b.uv2,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv2)):o.disableVertexAttribArray(b.uv2));k.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinVertexABuffer),o.vertexAttribPointer(b.skinVertexA,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER, -h.__webglSkinVertexBBuffer),o.vertexAttribPointer(b.skinVertexB,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),o.vertexAttribPointer(b.skinIndex,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),o.vertexAttribPointer(b.skinWeight,4,o.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(k.wireframe?(o.lineWidth(k.wireframeLinewidth),c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),o.drawElements(o.LINES,h.__webglLineCount,o.UNSIGNED_SHORT,0)):(c&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER, -h.__webglFaceBuffer),o.drawElements(o.TRIANGLES,h.__webglFaceCount,o.UNSIGNED_SHORT,0)),Q.info.render.calls++,Q.info.render.vertices+=h.__webglFaceCount,Q.info.render.faces+=h.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?o.LINE_STRIP:o.LINES,o.lineWidth(k.linewidth),o.drawArrays(m,0,h.__webglLineCount),Q.info.render.calls++):m instanceof THREE.ParticleSystem?(o.drawArrays(o.POINTS,0,h.__webglParticleCount),Q.info.render.calls++):m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP, -0,h.__webglVertexCount),Q.info.render.calls++)}}function h(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=o.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=o.createBuffer();b.hasPos&&(o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,b.positionArray,o.DYNAMIC_DRAW),o.enableVertexAttribArray(c.attributes.position),o.vertexAttribPointer(c.attributes.position,3,o.FLOAT,!1,0,0));if(b.hasNormal){o.bindBuffer(o.ARRAY_BUFFER,b.__webglNormalBuffer);if(e== -THREE.FlatShading){var f,h,k,m,n,p,t,u,v,w,x=b.count*3;for(w=0;w=0;e--)b[e].object==c&&b.splice(e,1)}function I(b){function c(b){var h=[];e=0;for(f=b.length;e65535&&(t[o].counter+=1,p=t[o].hash+"_"+t[o].counter,b.geometryGroups[p]==void 0&&(b.geometryGroups[p]={faces:[], -materials:n,vertices:0,numMorphTargets:u})),b.geometryGroups[p].faces.push(h),b.geometryGroups[p].vertices+=m;b.geometryGroupsList=[];for(var v in b.geometryGroups)b.geometryGroups[v].id=la++,b.geometryGroupsList.push(b.geometryGroups[v])}function P(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function K(b){if(b!=T){switch(b){case THREE.AdditiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE);break;case THREE.SubtractiveBlending:o.blendEquation(o.FUNC_ADD); -o.blendFunc(o.ZERO,o.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,o.SRC_COLOR);break;default:o.blendEquationSeparate(o.FUNC_ADD,o.FUNC_ADD),o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA)}T=b}}function B(b,c,e){(e.width&e.width-1)==0&&(e.height&e.height-1)==0?(o.texParameteri(b,o.TEXTURE_WRAP_S,Z(c.wrapS)),o.texParameteri(b,o.TEXTURE_WRAP_T,Z(c.wrapT)),o.texParameteri(b,o.TEXTURE_MAG_FILTER,Z(c.magFilter)), -o.texParameteri(b,o.TEXTURE_MIN_FILTER,Z(c.minFilter)),o.generateMipmap(b)):(o.texParameteri(b,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_MAG_FILTER,$(c.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,$(c.minFilter)))}function O(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=o.createTexture(),Q.info.memory.textures++;o.activeTexture(o.TEXTURE0+c);o.bindTexture(o.TEXTURE_2D,b.__webglTexture);b instanceof -THREE.DataTexture?o.texImage2D(o.TEXTURE_2D,0,Z(b.format),b.image.width,b.image.height,0,Z(b.format),o.UNSIGNED_BYTE,b.image.data):o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,b.image);B(o.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+c),o.bindTexture(o.TEXTURE_2D,b.__webglTexture)}function Y(b,c){o.bindRenderbuffer(o.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_COMPONENT16,c.width,c.height),o.framebufferRenderbuffer(o.FRAMEBUFFER, -o.DEPTH_ATTACHMENT,o.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,c.width,c.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,b)):o.renderbufferStorage(o.RENDERBUFFER,o.RGBA4,c.width,c.height)}function N(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=o.createTexture(); -if(c){b.__webglFramebuffer=[];b.__webglRenderbuffer=[];o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture);B(o.TEXTURE_CUBE_MAP,b,b);for(var e=0;e<6;e++){b.__webglFramebuffer[e]=o.createFramebuffer();b.__webglRenderbuffer[e]=o.createRenderbuffer();o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,Z(b.format),b.width,b.height,0,Z(b.format),Z(b.type),null);var f=b,h=o.TEXTURE_CUBE_MAP_POSITIVE_X+e;o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer[e]);o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0, -h,f.__webglTexture,0);Y(b.__webglRenderbuffer[e],b)}}else b.__webglFramebuffer=o.createFramebuffer(),b.__webglRenderbuffer=o.createRenderbuffer(),o.bindTexture(o.TEXTURE_2D,b.__webglTexture),B(o.TEXTURE_2D,b,b),o.texImage2D(o.TEXTURE_2D,0,Z(b.format),b.width,b.height,0,Z(b.format),Z(b.type),null),e=o.TEXTURE_2D,o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,e,b.__webglTexture,0),o.bindRenderbuffer(o.RENDERBUFFER,b.__webglRenderbuffer), -Y(b.__webglRenderbuffer,b);c?o.bindTexture(o.TEXTURE_CUBE_MAP,null):o.bindTexture(o.TEXTURE_2D,null);o.bindRenderbuffer(o.RENDERBUFFER,null);o.bindFramebuffer(o.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,e=b.width,b=b.height,h=f=0):(c=null,e=qa,b=ra,f=ca,h=ua);c!=ea&&(o.bindFramebuffer(o.FRAMEBUFFER,c),o.viewport(f,h,e,b),ea=c)}function V(b){b instanceof THREE.WebGLRenderTargetCube?(o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture),o.generateMipmap(o.TEXTURE_CUBE_MAP), -o.bindTexture(o.TEXTURE_CUBE_MAP,null)):(o.bindTexture(o.TEXTURE_2D,b.__webglTexture),o.generateMipmap(o.TEXTURE_2D),o.bindTexture(o.TEXTURE_2D,null))}function J(b,c){var e;b=="fragment"?e=o.createShader(o.FRAGMENT_SHADER):b=="vertex"&&(e=o.createShader(o.VERTEX_SHADER));o.shaderSource(e,c);o.compileShader(e);if(!o.getShaderParameter(e,o.COMPILE_STATUS))return console.error(o.getShaderInfoLog(e)),console.error(c),null;return e}function $(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return o.NEAREST; -default:return o.LINEAR}}function Z(b){switch(b){case THREE.RepeatWrapping:return o.REPEAT;case THREE.ClampToEdgeWrapping:return o.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return o.MIRRORED_REPEAT;case THREE.NearestFilter:return o.NEAREST;case THREE.NearestMipMapNearestFilter:return o.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return o.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return o.LINEAR;case THREE.LinearMipMapNearestFilter:return o.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return o.LINEAR_MIPMAP_LINEAR; -case THREE.ByteType:return o.BYTE;case THREE.UnsignedByteType:return o.UNSIGNED_BYTE;case THREE.ShortType:return o.SHORT;case THREE.UnsignedShortType:return o.UNSIGNED_SHORT;case THREE.IntType:return o.INT;case THREE.UnsignedShortType:return o.UNSIGNED_INT;case THREE.FloatType:return o.FLOAT;case THREE.AlphaFormat:return o.ALPHA;case THREE.RGBFormat:return o.RGB;case THREE.RGBAFormat:return o.RGBA;case THREE.LuminanceFormat:return o.LUMINANCE;case THREE.LuminanceAlphaFormat:return o.LUMINANCE_ALPHA}return 0} -var Q=this,o,R=[],fa=null,ea=null,ha=-1,ga=null,la=0,oa=null,aa=null,T=null,X=null,ia=null,ja=null,sa=null,ma=null,ca=0,ua=0,qa=0,ra=0,xa=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Ga=new Float32Array(16),Fa=new Float32Array(16),Da=new THREE.Vector4,za={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},U=b.canvas!==void 0?b.canvas:document.createElement("canvas"), -L=b.stencil!==void 0?b.stencil:!0,da=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,pa=b.antialias!==void 0?b.antialias:!1,M=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),na=b.clearAlpha!==void 0?b.clearAlpha:0,ya=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=U;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear= -!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var ka,Ea=[],b=THREE.ShaderLib.depthRGBA,Ia=THREE.UniformsUtils.clone(b.uniforms),Ba=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Ia}), -ta=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:Ia,morphTargets:!0});Ba._shadowPass=!0;ta._shadowPass=!0;try{if(!(o=U.getContext("experimental-webgl",{antialias:pa,stencil:L,preserveDrawingBuffer:da})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+o.getParameter(o.VERSION)+" | "+o.getParameter(o.VENDOR)+" | "+o.getParameter(o.RENDERER)+" | "+o.getParameter(o.SHADING_LANGUAGE_VERSION))}catch(Ka){console.error(Ka)}o.clearColor(0, -0,0,1);o.clearDepth(1);o.clearStencil(0);o.enable(o.DEPTH_TEST);o.depthFunc(o.LEQUAL);o.frontFace(o.CCW);o.cullFace(o.BACK);o.enable(o.CULL_FACE);o.enable(o.BLEND);o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA);o.clearColor(M.r,M.g,M.b,na);this.context=o;var Ha=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,W={};W.vertices=new Float32Array(16);W.faces=new Uint16Array(6);L=0;W.vertices[L++]=-1;W.vertices[L++]=-1;W.vertices[L++]=0;W.vertices[L++]=1;W.vertices[L++]=1; -W.vertices[L++]=-1;W.vertices[L++]=1;W.vertices[L++]=1;W.vertices[L++]=1;W.vertices[L++]=1;W.vertices[L++]=1;W.vertices[L++]=0;W.vertices[L++]=-1;W.vertices[L++]=1;W.vertices[L++]=0;L=W.vertices[L++]=0;W.faces[L++]=0;W.faces[L++]=1;W.faces[L++]=2;W.faces[L++]=0;W.faces[L++]=2;W.faces[L++]=3;W.vertexBuffer=o.createBuffer();W.elementBuffer=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,W.vertexBuffer);o.bufferData(o.ARRAY_BUFFER,W.vertices,o.STATIC_DRAW);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,W.elementBuffer); -o.bufferData(o.ELEMENT_ARRAY_BUFFER,W.faces,o.STATIC_DRAW);W.program=o.createProgram();o.attachShader(W.program,J("fragment",THREE.ShaderLib.sprite.fragmentShader));o.attachShader(W.program,J("vertex",THREE.ShaderLib.sprite.vertexShader));o.linkProgram(W.program);W.attributes={};W.uniforms={};W.attributes.position=o.getAttribLocation(W.program,"position");W.attributes.uv=o.getAttribLocation(W.program,"uv");W.uniforms.uvOffset=o.getUniformLocation(W.program,"uvOffset");W.uniforms.uvScale=o.getUniformLocation(W.program, -"uvScale");W.uniforms.rotation=o.getUniformLocation(W.program,"rotation");W.uniforms.scale=o.getUniformLocation(W.program,"scale");W.uniforms.alignment=o.getUniformLocation(W.program,"alignment");W.uniforms.color=o.getUniformLocation(W.program,"color");W.uniforms.map=o.getUniformLocation(W.program,"map");W.uniforms.opacity=o.getUniformLocation(W.program,"opacity");W.uniforms.useScreenCoordinates=o.getUniformLocation(W.program,"useScreenCoordinates");W.uniforms.affectedByDistance=o.getUniformLocation(W.program, -"affectedByDistance");W.uniforms.screenPosition=o.getUniformLocation(W.program,"screenPosition");W.uniforms.modelViewMatrix=o.getUniformLocation(W.program,"modelViewMatrix");W.uniforms.projectionMatrix=o.getUniformLocation(W.program,"projectionMatrix");var Xa=!1;this.setSize=function(b,c){U.width=b;U.height=c;this.setViewport(0,0,U.width,U.height)};this.setViewport=function(b,c,e,f){ca=b;ua=c;qa=e;ra=f;o.viewport(ca,ua,qa,ra)};this.setScissor=function(b,c,e,f){o.scissor(b,c,e,f)};this.enableScissorTest= -function(b){b?o.enable(o.SCISSOR_TEST):o.disable(o.SCISSOR_TEST)};this.setClearColorHex=function(b,c){M.setHex(b);na=c;o.clearColor(M.r,M.g,M.b,na)};this.setClearColor=function(b,c){M.copy(b);na=c;o.clearColor(M.r,M.g,M.b,na)};this.getClearColor=function(){return M};this.getClearAlpha=function(){return na};this.clear=function(b,c,e){var f=0;if(b==void 0||b)f|=o.COLOR_BUFFER_BIT;if(c==void 0||c)f|=o.DEPTH_BUFFER_BIT;if(e==void 0||e)f|=o.STENCIL_BUFFER_BIT;o.clear(f)};this.getContext=function(){return o}; -this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];o.deleteBuffer(c.__webglVertexBuffer);o.deleteBuffer(c.__webglNormalBuffer);o.deleteBuffer(c.__webglTangentBuffer);o.deleteBuffer(c.__webglColorBuffer);o.deleteBuffer(c.__webglUVBuffer);o.deleteBuffer(c.__webglUV2Buffer);o.deleteBuffer(c.__webglSkinVertexABuffer); -o.deleteBuffer(c.__webglSkinVertexBBuffer);o.deleteBuffer(c.__webglSkinIndicesBuffer);o.deleteBuffer(c.__webglSkinWeightsBuffer);o.deleteBuffer(c.__webglFaceBuffer);o.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var e=0,f=c.numMorphTargets;e=0&&o.enableVertexAttribArray(x.position);x.color>=0&&o.enableVertexAttribArray(x.color);x.normal>=0&&o.enableVertexAttribArray(x.normal); -x.tangent>=0&&o.enableVertexAttribArray(x.tangent);b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(o.enableVertexAttribArray(x.skinVertexA),o.enableVertexAttribArray(x.skinVertexB),o.enableVertexAttribArray(x.skinIndex),o.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(k in b.attributes)x[k]!==void 0&&x[k]>=0&&o.enableVertexAttribArray(x[k]);if(b.morphTargets)for(k=b.numSupportedMorphTargets=0;k=0&&(o.enableVertexAttribArray(x[z]), -b.numSupportedMorphTargets++);b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,e,f){N(b);this.clear(c,e,f)};this.updateShadowMap=function(b,c){z(b,c)};this.render=function(b,c,u,U){var L,da,E,C,G,pa,B,ma,I=b.lights,ca=b.fog;ha=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&z(b,c);Q.info.render.calls=0;Q.info.render.vertices=0;Q.info.render.faces=0;if(c.matrixAutoUpdate){for(G=c;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0, -!1,c);c.matrixWorldInverse.flattenToArray(Fa);c.projectionMatrix.flattenToArray(Ga);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);t(Ca);this.initWebGLObjects(b);N(u);(this.autoClear||U)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(U=0;U=0;U--)if(L=b.__webglObjects[U],L.render){B=L.object;ma=L.buffer;E=L.opaque;k(B);for(L=0;L0||x.faceVertexUvs.length> -0)m.__uvArray=new Float32Array(p*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>1)m.__uv2Array=new Float32Array(p*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(p*4),m.__skinVertexBArray=new Float32Array(p*4),m.__skinIndexArray=new Float32Array(p*4),m.__skinWeightArray=new Float32Array(p*4);m.__faceArray=new Uint16Array(z*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(U*2);if(m.numMorphTargets){m.__morphTargetsArrays= -[];x=0;for(y=m.numMorphTargets;x=0;k--)f[k]==h&&f.splice(k,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&G(f.__webglObjectsImmediate,e);e.__webglActive=!1;b.__objectsRemoved.splice(0,1)}e=0;for(f=b.__webglObjects.length;e0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,ea,z));Ga&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglNormalBuffer),o.bufferData(o.ARRAY_BUFFER,ga,z));Da&&ta.hasTangents&&(o.bindBuffer(o.ARRAY_BUFFER, -t.__webglTangentBuffer),o.bufferData(o.ARRAY_BUFFER,ha,z));Ha&&ua>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglUVBuffer),o.bufferData(o.ARRAY_BUFFER,ia,z));Ha&&qa>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglUV2Buffer),o.bufferData(o.ARRAY_BUFFER,Ea,z));Ca&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,Ba,z),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,sa,z));S>0&&(o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinVertexABuffer), -o.bufferData(o.ARRAY_BUFFER,ja,z),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinVertexBBuffer),o.bufferData(o.ARRAY_BUFFER,ra,z),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinIndicesBuffer),o.bufferData(o.ARRAY_BUFFER,aa,z),o.bindBuffer(o.ARRAY_BUFFER,t.__webglSkinWeightsBuffer),o.bufferData(o.ARRAY_BUFFER,fa,z));U&&(delete t.__inittedArrays,delete t.__colorArray,delete t.__normalArray,delete t.__tangentArray,delete t.__uvArray,delete t.__uv2Array,delete t.__faceArray,delete t.__vertexArray,delete t.__lineArray, -delete t.__skinVertexAArray,delete t.__skinVertexBArray,delete t.__skinIndexArray,delete t.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;C(m)}else if(k instanceof THREE.Ribbon){h=k.geometry;if(h.__dirtyVertices||h.__dirtyColors){k=h;m=o.DYNAMIC_DRAW;n=x=U=U=void 0;u=k.vertices;p=k.colors;v=u.length;t=p.length;y=k.__vertexArray;z=k.__colorArray;L=k.__dirtyColors;if(k.__dirtyVertices){for(U= -0;U=0)b&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglVertexBuffer),m.vertexAttribPointer(a.position,3,m.FLOAT,!1,0,0));else if(h.morphTargetBase){e=k.program.attributes;h.morphTargetBase!==-1?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[h.morphTargetBase]),m.vertexAttribPointer(e.position,3,m.FLOAT,!1,0,0)):e.position>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglVertexBuffer),m.vertexAttribPointer(e.position,3,m.FLOAT,!1,0,0));if(h.morphTargetForcedOrder.length){l= +0;var p=h.morphTargetForcedOrder;for(n=h.morphTargetInfluences;lo&&(t=v,o=n[t]);m.bindBuffer(m.ARRAY_BUFFER, +f.__webglMorphTargetsBuffers[t]);m.vertexAttribPointer(e["morphTarget"+l],3,m.FLOAT,!1,0,0);h.__webglMorphTargetInfluences[l]=o;p[t]=1;o=-1;l++}}k.program.uniforms.morphTargetInfluences!==null&&m.uniform1fv(k.program.uniforms.morphTargetInfluences,h.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){l=0;for(n=f.__webglCustomAttributesList.length;l=0&&(m.bindBuffer(m.ARRAY_BUFFER,e.buffer),m.vertexAttribPointer(a[e.buffer.belongsToAttribute], +e.size,m.FLOAT,!1,0,0))}a.color>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglColorBuffer),m.vertexAttribPointer(a.color,3,m.FLOAT,!1,0,0));a.normal>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglNormalBuffer),m.vertexAttribPointer(a.normal,3,m.FLOAT,!1,0,0));a.tangent>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglTangentBuffer),m.vertexAttribPointer(a.tangent,4,m.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglUVBuffer),m.vertexAttribPointer(a.uv,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(a.uv)): +m.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglUV2Buffer),m.vertexAttribPointer(a.uv2,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(a.uv2)):m.disableVertexAttribArray(a.uv2));k.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinVertexABuffer),m.vertexAttribPointer(a.skinVertexA,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),m.vertexAttribPointer(a.skinVertexB, +4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),m.vertexAttribPointer(a.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),m.vertexAttribPointer(a.skinWeight,4,m.FLOAT,!1,0,0))}h instanceof THREE.Mesh?(k.wireframe?(m.lineWidth(k.wireframeLinewidth),b&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),m.drawElements(m.LINES,f.__webglLineCount,m.UNSIGNED_SHORT,0)):(b&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),m.drawElements(m.TRIANGLES, +f.__webglFaceCount,m.UNSIGNED_SHORT,0)),S.info.render.calls++,S.info.render.vertices+=f.__webglFaceCount,S.info.render.faces+=f.__webglFaceCount/3):h instanceof THREE.Line?(h=h.type==THREE.LineStrip?m.LINE_STRIP:m.LINES,m.lineWidth(k.linewidth),m.drawArrays(h,0,f.__webglLineCount),S.info.render.calls++):h instanceof THREE.ParticleSystem?(m.drawArrays(m.POINTS,0,f.__webglParticleCount),S.info.render.calls++):h instanceof THREE.Ribbon&&(m.drawArrays(m.TRIANGLE_STRIP,0,f.__webglVertexCount),S.info.render.calls++)}} +function f(a,c,b){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=m.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=m.createBuffer();a.hasPos&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(c.attributes.position),m.vertexAttribPointer(c.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormal){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(b==THREE.FlatShading){var e,f,k,h,l,n,p,o,t,v,u=a.count* +3;for(v=0;v=0&&(c=c.geometry.materials[materialIndex],c.transparent?p(a,c):p(f,c))):(c=b)&&(c.transparent?p(a, +c):p(f,c))}function y(a,c){return c.z-a.z}function x(a){var b,l,n,p=0,t,v,H,w,x=a.lights;na||(na=new THREE.PerspectiveCamera(S.shadowCameraFov,S.shadowMapWidth/S.shadowMapHeight,S.shadowCameraNear,S.shadowCameraFar));b=0;for(l=x.length;b=0?c.geometry.materials[a.materialIndex]:c.material;if(b.attributes)for(var e in b.attributes)if(b.attributes[e].needsUpdate)return!0; +return!1}function z(a,c){var b=a.materialIndex>=0?c.geometry.materials[a.materialIndex]:c.material;if(b.attributes)for(var e in b.attributes)b.attributes[e].needsUpdate=!1}function C(a,c){var b;for(b=a.length-1;b>=0;b--)a[b].object==c&&a.splice(b,1)}function E(a,c,b){a.push({buffer:c,object:b,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function G(a){if(a!=$){switch(a){case THREE.AdditiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE);break;case THREE.SubtractiveBlending:m.blendEquation(m.FUNC_ADD); +m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.SRC_COLOR);break;default:m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)}$=a}}function F(a,c,b){(b.width&b.width-1)==0&&(b.height&b.height-1)==0?(m.texParameteri(a,m.TEXTURE_WRAP_S,W(c.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,W(c.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,W(c.magFilter)), +m.texParameteri(a,m.TEXTURE_MIN_FILTER,W(c.minFilter)),m.generateMipmap(a)):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,O(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,O(c.minFilter)))}function I(a,c){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=m.createTexture(),S.info.memory.textures++;m.activeTexture(m.TEXTURE0+c);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);a instanceof +THREE.DataTexture?m.texImage2D(m.TEXTURE_2D,0,W(a.format),a.image.width,a.image.height,0,W(a.format),m.UNSIGNED_BYTE,a.image.data):m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,a.image);F(m.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)}function M(a,c){m.bindRenderbuffer(m.RENDERBUFFER,a);c.depthBuffer&&!c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER, +m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):c.depthBuffer&&c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,c.width,c.height)}function V(a){var c=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=m.createTexture(); +if(c){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);F(m.TEXTURE_CUBE_MAP,a,a);for(var b=0;b<6;b++){a.__webglFramebuffer[b]=m.createFramebuffer();a.__webglRenderbuffer[b]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,W(a.format),a.width,a.height,0,W(a.format),W(a.type),null);var e=a,f=m.TEXTURE_CUBE_MAP_POSITIVE_X+b;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[b]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0, +f,e.__webglTexture,0);M(a.__webglRenderbuffer[b],a)}}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),F(m.TEXTURE_2D,a,a),m.texImage2D(m.TEXTURE_2D,0,W(a.format),a.width,a.height,0,W(a.format),W(a.type),null),b=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,b,a.__webglTexture,0),m.bindRenderbuffer(m.RENDERBUFFER,a.__webglRenderbuffer), +M(a.__webglRenderbuffer,a);c?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(c=c?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,b=a.width,a=a.height,f=e=0):(c=null,b=qa,a=ma,e=oa,f=la);c!=ea&&(m.bindFramebuffer(m.FRAMEBUFFER,c),m.viewport(e,f,b,a),ea=c)}function J(a){a instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP), +m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function T(a,c){var b;a=="fragment"?b=m.createShader(m.FRAGMENT_SHADER):a=="vertex"&&(b=m.createShader(m.VERTEX_SHADER));m.shaderSource(b,c);m.compileShader(b);if(!m.getShaderParameter(b,m.COMPILE_STATUS))return console.error(m.getShaderInfoLog(b)),console.error(c),null;return b}function O(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return m.NEAREST; +default:return m.LINEAR}}function W(a){switch(a){case THREE.RepeatWrapping:return m.REPEAT;case THREE.ClampToEdgeWrapping:return m.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return m.MIRRORED_REPEAT;case THREE.NearestFilter:return m.NEAREST;case THREE.NearestMipMapNearestFilter:return m.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return m.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return m.LINEAR;case THREE.LinearMipMapNearestFilter:return m.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return m.LINEAR_MIPMAP_LINEAR; +case THREE.ByteType:return m.BYTE;case THREE.UnsignedByteType:return m.UNSIGNED_BYTE;case THREE.ShortType:return m.SHORT;case THREE.UnsignedShortType:return m.UNSIGNED_SHORT;case THREE.IntType:return m.INT;case THREE.UnsignedShortType:return m.UNSIGNED_INT;case THREE.FloatType:return m.FLOAT;case THREE.AlphaFormat:return m.ALPHA;case THREE.RGBFormat:return m.RGB;case THREE.RGBAFormat:return m.RGBA;case THREE.LuminanceFormat:return m.LUMINANCE;case THREE.LuminanceAlphaFormat:return m.LUMINANCE_ALPHA}return 0} +var S=this,m,ca=[],Q=null,ea=null,da=-1,ka=null,ia=0,ha=null,ja=null,$=null,R=null,X=null,aa=null,ga=null,ra=null,oa=0,la=0,qa=0,ma=0,sa=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Aa=new THREE.Matrix4,Da=new Float32Array(16),Ca=new Float32Array(16),Ba=new THREE.Vector4,Ea={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},xa=a.canvas!==void 0?a.canvas:document.createElement("canvas"), +H=a.stencil!==void 0?a.stencil:!0,L=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,Z=a.antialias!==void 0?a.antialias:!1,fa=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),Y=a.clearAlpha!==void 0?a.clearAlpha:0,N=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=xa;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear= +!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var na,va=[],a=THREE.ShaderLib.depthRGBA,pa=THREE.UniformsUtils.clone(a.uniforms),Fa=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:pa}), +ya=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:pa,morphTargets:!0});Fa._shadowPass=!0;ya._shadowPass=!0;try{if(!(m=xa.getContext("experimental-webgl",{antialias:Z,stencil:H,preserveDrawingBuffer:L})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+m.getParameter(m.VERSION)+" | "+m.getParameter(m.VENDOR)+" | "+m.getParameter(m.RENDERER)+" | "+m.getParameter(m.SHADING_LANGUAGE_VERSION))}catch(ta){console.error(ta)}m.clearColor(0, +0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.clearColor(fa.r,fa.g,fa.b,Y);this.context=m;var Ga=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,U={};U.vertices=new Float32Array(16);U.faces=new Uint16Array(6);H=0;U.vertices[H++]=-1;U.vertices[H++]=-1;U.vertices[H++]=0;U.vertices[H++]=1;U.vertices[H++]= +1;U.vertices[H++]=-1;U.vertices[H++]=1;U.vertices[H++]=1;U.vertices[H++]=1;U.vertices[H++]=1;U.vertices[H++]=1;U.vertices[H++]=0;U.vertices[H++]=-1;U.vertices[H++]=1;U.vertices[H++]=0;H=U.vertices[H++]=0;U.faces[H++]=0;U.faces[H++]=1;U.faces[H++]=2;U.faces[H++]=0;U.faces[H++]=2;U.faces[H++]=3;U.vertexBuffer=m.createBuffer();U.elementBuffer=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,U.vertexBuffer);m.bufferData(m.ARRAY_BUFFER,U.vertices,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,U.elementBuffer); +m.bufferData(m.ELEMENT_ARRAY_BUFFER,U.faces,m.STATIC_DRAW);U.program=m.createProgram();m.attachShader(U.program,T("fragment",THREE.ShaderLib.sprite.fragmentShader));m.attachShader(U.program,T("vertex",THREE.ShaderLib.sprite.vertexShader));m.linkProgram(U.program);U.attributes={};U.uniforms={};U.attributes.position=m.getAttribLocation(U.program,"position");U.attributes.uv=m.getAttribLocation(U.program,"uv");U.uniforms.uvOffset=m.getUniformLocation(U.program,"uvOffset");U.uniforms.uvScale=m.getUniformLocation(U.program, +"uvScale");U.uniforms.rotation=m.getUniformLocation(U.program,"rotation");U.uniforms.scale=m.getUniformLocation(U.program,"scale");U.uniforms.alignment=m.getUniformLocation(U.program,"alignment");U.uniforms.color=m.getUniformLocation(U.program,"color");U.uniforms.map=m.getUniformLocation(U.program,"map");U.uniforms.opacity=m.getUniformLocation(U.program,"opacity");U.uniforms.useScreenCoordinates=m.getUniformLocation(U.program,"useScreenCoordinates");U.uniforms.affectedByDistance=m.getUniformLocation(U.program, +"affectedByDistance");U.uniforms.screenPosition=m.getUniformLocation(U.program,"screenPosition");U.uniforms.modelViewMatrix=m.getUniformLocation(U.program,"modelViewMatrix");U.uniforms.projectionMatrix=m.getUniformLocation(U.program,"projectionMatrix");var Ia=!1;this.setSize=function(a,c){xa.width=a;xa.height=c;this.setViewport(0,0,xa.width,xa.height)};this.setViewport=function(a,c,b,e){oa=a;la=c;qa=b;ma=e;m.viewport(oa,la,qa,ma)};this.setScissor=function(a,c,b,e){m.scissor(a,c,b,e)};this.enableScissorTest= +function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColorHex=function(a,c){fa.setHex(a);Y=c;m.clearColor(fa.r,fa.g,fa.b,Y)};this.setClearColor=function(a,c){fa.copy(a);Y=c;m.clearColor(fa.r,fa.g,fa.b,Y)};this.getClearColor=function(){return fa};this.getClearAlpha=function(){return Y};this.clear=function(a,c,b){var e=0;if(a==void 0||a)e|=m.COLOR_BUFFER_BIT;if(c==void 0||c)e|=m.DEPTH_BUFFER_BIT;if(b==void 0||b)e|=m.STENCIL_BUFFER_BIT;m.clear(e)};this.getContext=function(){return m}; +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(g in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[g];m.deleteBuffer(c.__webglVertexBuffer);m.deleteBuffer(c.__webglNormalBuffer);m.deleteBuffer(c.__webglTangentBuffer);m.deleteBuffer(c.__webglColorBuffer);m.deleteBuffer(c.__webglUVBuffer);m.deleteBuffer(c.__webglUV2Buffer);m.deleteBuffer(c.__webglSkinVertexABuffer); +m.deleteBuffer(c.__webglSkinVertexBBuffer);m.deleteBuffer(c.__webglSkinIndicesBuffer);m.deleteBuffer(c.__webglSkinWeightsBuffer);m.deleteBuffer(c.__webglFaceBuffer);m.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var b=0,e=c.numMorphTargets;b=0&&m.enableVertexAttribArray(u.position);u.color>=0&&m.enableVertexAttribArray(u.color);u.normal>=0&&m.enableVertexAttribArray(u.normal); +u.tangent>=0&&m.enableVertexAttribArray(u.tangent);a.skinning&&u.skinVertexA>=0&&u.skinVertexB>=0&&u.skinIndex>=0&&u.skinWeight>=0&&(m.enableVertexAttribArray(u.skinVertexA),m.enableVertexAttribArray(u.skinVertexB),m.enableVertexAttribArray(u.skinIndex),m.enableVertexAttribArray(u.skinWeight));if(a.attributes)for(k in a.attributes)u[k]!==void 0&&u[k]>=0&&m.enableVertexAttribArray(u[k]);if(a.morphTargets)for(k=a.numSupportedMorphTargets=0;k=0&&(m.enableVertexAttribArray(u[H]), +a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,c,b,e){V(a);this.clear(c,b,e)};this.updateShadowMap=function(a,c){x(a,c)};this.render=function(a,b,p,H){var Z,L,A,z,C,fa,E,I,oa=a.lights,M=a.fog;da=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&x(a,b);S.info.render.calls=0;S.info.render.vertices=0;S.info.render.faces=0;if(b.matrixAutoUpdate){for(C=b;C.parent;)C=C.parent;C.update(void 0,!0)}a.update(void 0,!1, +b);b.matrixWorldInverse.flattenToArray(Ca);b.projectionMatrix.flattenToArray(Da);Aa.multiply(b.projectionMatrix,b.matrixWorldInverse);o(Aa);this.initWebGLObjects(a);V(p);(this.autoClear||H)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);C=a.__webglObjects.length;for(H=0;H=0;H--)if(Z=a.__webglObjects[H],Z.render){E=Z.object;I=Z.buffer;A=Z.opaque;k(E);for(Z=0;Z65535&&(u[t].counter+=1,v=u[t].hash+"_"+u[t].counter,h.geometryGroups[v]==void 0&&(h.geometryGroups[v]={faces:[],materialIndex:o,vertices:0,numMorphTargets:H})),h.geometryGroups[v].faces.push(l),h.geometryGroups[v].vertices+=p;h.geometryGroupsList=[];l=void 0;for(l in h.geometryGroups)h.geometryGroups[l].id=ia++,h.geometryGroupsList.push(h.geometryGroups[l])}for(f in k.geometryGroups)if(h=k.geometryGroups[f],!h.__webglVertexBuffer){l=h;l.__webglVertexBuffer=m.createBuffer();l.__webglNormalBuffer= +m.createBuffer();l.__webglTangentBuffer=m.createBuffer();l.__webglColorBuffer=m.createBuffer();l.__webglUVBuffer=m.createBuffer();l.__webglUV2Buffer=m.createBuffer();l.__webglSkinVertexABuffer=m.createBuffer();l.__webglSkinVertexBBuffer=m.createBuffer();l.__webglSkinIndicesBuffer=m.createBuffer();l.__webglSkinWeightsBuffer=m.createBuffer();l.__webglFaceBuffer=m.createBuffer();l.__webglLineBuffer=m.createBuffer();if(l.numMorphTargets){o=n=void 0;l.__webglMorphTargetsBuffers=[];n=0;for(o=l.numMorphTargets;n< +o;n++)l.__webglMorphTargetsBuffers.push(m.createBuffer())}S.info.memory.geometries++;for(var o=c,w=p=u=void 0,t=w=H=w=void 0,v=t=l=0,x=p=void 0,Z=void 0,p=n=H=u=void 0,H=o.geometry,x=H.faces,Z=h.faces,u=0,p=Z.length;u=0?H.materials[h.materialIndex]:o.material;p=u.map||u.lightMap||u instanceof THREE.ShaderMaterial?!0:!1;Z=u instanceof THREE.MeshBasicMaterial&&!u.envMap||u instanceof +THREE.MeshDepthMaterial?!1:u&&u.shading!=void 0&&u.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;x=u.vertexColors?u.vertexColors:!1;h.__vertexArray=new Float32Array(l*3);if(Z)h.__normalArray=new Float32Array(l*3);if(H.hasTangents)h.__tangentArray=new Float32Array(l*4);if(x)h.__colorArray=new Float32Array(l*3);if(p){if(H.faceUvs.length>0||H.faceVertexUvs.length>0)h.__uvArray=new Float32Array(l*2);if(H.faceUvs.length>1||H.faceVertexUvs.length>1)h.__uv2Array=new Float32Array(l*2)}if(o.geometry.skinWeights.length&& +o.geometry.skinIndices.length)h.__skinVertexAArray=new Float32Array(l*4),h.__skinVertexBArray=new Float32Array(l*4),h.__skinIndexArray=new Float32Array(l*4),h.__skinWeightArray=new Float32Array(l*4);h.__faceArray=new Uint16Array(t*3+(o.geometry.edgeFaces?o.geometry.edgeFaces.length*6:0));h.__lineArray=new Uint16Array(v*2);if(h.numMorphTargets){h.__morphTargetsArrays=[];H=0;for(w=h.numMorphTargets;H=0;k--)e[k]==f&&e.splice(k,1)}else(c instanceof THREE.MarchingCubes||c.immediateRenderCallback)&&C(e.__webglObjectsImmediate,c);c.__webglActive=!1;a.__objectsRemoved.splice(0, +1)}c=0;for(e=a.__webglObjects.length;c0&&(m.bindBuffer(m.ARRAY_BUFFER, +o.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,da,t));Ba&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglNormalBuffer),m.bufferData(m.ARRAY_BUFFER,sa,t));Ea&&ta.hasTangents&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglTangentBuffer),m.bufferData(m.ARRAY_BUFFER,pa,t));Ca&&T>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,va,t));Ca&&qa>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,ka,t));Da&&(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer), +m.bufferData(m.ELEMENT_ARRAY_BUFFER,ra,t),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,ya,t));P>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexABuffer),m.bufferData(m.ARRAY_BUFFER,ca,t),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexBBuffer),m.bufferData(m.ARRAY_BUFFER,ga,t),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,ea,t),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER, +$,t));v&&(delete o.__inittedArrays,delete o.__colorArray,delete o.__normalArray,delete o.__tangentArray,delete o.__uvArray,delete o.__uv2Array,delete o.__faceArray,delete o.__vertexArray,delete o.__lineArray,delete o.__skinVertexAArray,delete o.__skinVertexBArray,delete o.__skinIndexArray,delete o.__skinWeightArray)}f.__dirtyVertices=!1;f.__dirtyMorphTargets=!1;f.__dirtyElements=!1;f.__dirtyUvs=!1;f.__dirtyNormals=!1;f.__dirtyTangents=!1;f.__dirtyColors=!1;z(h,k)}else if(k instanceof THREE.Ribbon){f= +k.geometry;if(f.__dirtyVertices||f.__dirtyColors){k=f;h=m.DYNAMIC_DRAW;l=u=v=v=void 0;H=k.vertices;n=k.colors;p=H.length;o=n.length;x=k.__vertexArray;t=k.__colorArray;Z=k.__dirtyColors;if(k.__dirtyVertices){for(v=0;v1&&(e-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=e;c.s=m;c.v=k;return c}}; +THREE.ColorUtils={adjustHSV:function(a,b,c,e){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.Math.clamp(f.h+b,0,1);f.s=THREE.Math.clamp(f.s+c,0,1);f.v=THREE.Math.clamp(f.v+e,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,b){var c=a.r,e=a.g,f=a.b,k=Math.max(Math.max(c,e),f),h=Math.min(Math.min(c,e),f);if(h==k)h=c=0;else{var l=k-h,h=l/k,c=c==k?(e-f)/l:e==k?2+(f-c)/l:4+(c-e)/l;c/=6;c<0&&(c+=1);c>1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=h;b.v=k;return b}}; THREE.ColorUtils.__hsv={h:0,s:0,v:0}; -THREE.GeometryUtils={merge:function(b,c){var e,f,h=b.vertices.length,k=c instanceof THREE.Mesh?c.geometry:c,m=b.vertices,n=k.vertices,p=b.faces,t=k.faces,w=b.faceVertexUvs[0],k=k.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),e=c.matrix,f=new THREE.Matrix4,f.extractRotation(e,c.scale);for(var u=0,x=n.length;u1&&(f=1-f,h=1-h);k=1-f-h;m.copy(b);m.multiplyScalar(f);n.copy(c);n.multiplyScalar(h);m.addSelf(n);n.copy(e);n.multiplyScalar(k);m.addSelf(n);return m},randomPointInFace:function(b,c,e){var f,h,k;if(b instanceof THREE.Face3)return f=c.vertices[b.a].position,h=c.vertices[b.b].position,k=c.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,h,k);else if(b instanceof THREE.Face4){f=c.vertices[b.a].position;h=c.vertices[b.b].position;k=c.vertices[b.c].position;var c=c.vertices[b.d].position, -m;e?b._area1&&b._area2?(e=b._area1,m=b._area2):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c),b._area1=e,b._area2=m):(e=THREE.GeometryUtils.triangleArea(f,h,c),m=THREE.GeometryUtils.triangleArea(h,k,c));return THREE.GeometryUtils.random()*(e+m) -b?e(c,h-1):t[h]1&&(e=1-e,f=1-f);k=1-e-f;h.copy(a);h.multiplyScalar(e);l.copy(b);l.multiplyScalar(f);h.addSelf(l);l.copy(c);l.multiplyScalar(k);h.addSelf(l);return h},randomPointInFace:function(a,b,c){var e,f,k;if(a instanceof THREE.Face3)return e=b.vertices[a.a].position,f=b.vertices[a.b].position, +k=b.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(e,f,k);else if(a instanceof THREE.Face4){e=b.vertices[a.a].position;f=b.vertices[a.b].position;k=b.vertices[a.c].position;var b=b.vertices[a.d].position,h;c?a._area1&&a._area2?(c=a._area1,h=a._area2):(c=THREE.GeometryUtils.triangleArea(e,f,b),h=THREE.GeometryUtils.triangleArea(f,k,b),a._area1=c,a._area2=h):(c=THREE.GeometryUtils.triangleArea(e,f,b),h=THREE.GeometryUtils.triangleArea(f,k,b));return THREE.GeometryUtils.random()*(c+ +h)a?c(b,f-1):o[f] 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;", THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvViewPosition = -mvPosition.xyz;\nvNormal = normalize( normalMatrix * normal );\nvTangent = normalize( normalMatrix * tangent.xyz );\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvBinormal = normalize( vBinormal );\nvUv = uv * uRepeat + uOffset;\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#ifdef VERTEX_TEXTURES\nvec3 dv = texture2D( tDisplacement, uv ).xyz;\nfloat df = uDisplacementScale * dv.x + uDisplacementBias;\nvec4 displacedPosition = vec4( vNormal.xyz * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif", THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:1,texture:null},tFlip:{type:"f",value:-1}},vertexShader:"varying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvViewPosition = cameraPosition - mPosition.xyz;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( tFlip * wPos.x, wPos.yz ) );\n}"}}}; -THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(b){return this.getPoint(this.getUtoTmapping(b))};THREE.Curve.prototype.getPoints=function(b){b||(b=5);var c,e=[];for(c=0;c<=b;c++)e.push(this.getPoint(c/b));return e};THREE.Curve.prototype.getSpacedPoints=function(b){b||(b=5);var c,e=[];for(c=0;c<=b;c++)e.push(this.getPointAt(c/b));return e}; -THREE.Curve.prototype.getLength=function(){var b=this.getLengths();return b[b.length-1]};THREE.Curve.prototype.getLengths=function(b){b||(b=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==b+1)return this.cacheArcLengths;var c=[],e,f=this.getPoint(0),h,k=0;c.push(0);for(h=1;h<=b;h++)e=this.getPoint(h/b),k+=e.distanceTo(f),c.push(k),f=e;return this.cacheArcLengths=c}; -THREE.Curve.prototype.getUtoTmapping=function(b,c){var e=this.getLengths(),f=0,h=e.length,k;k=c?c:b*e[h-1];time=Date.now();for(var m=0,n=h-1,p;m<=n;)if(f=Math.floor(m+(n-m)/2),p=e[f]-k,p<0)m=f+1;else if(p>0)n=f-1;else{n=f;break}f=n;if(e[f]==k)return f/(h-1);m=e[f];return e=(f+(k-m)/(e[f+1]-m))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)}; -THREE.Curve.prototype.getTangent=function(b){var c=b-1.0E-4;b+=1.0E-4;c<0&&(c=0);b>1&&(b=1);var c=this.getPoint(c),b=this.getPoint(b),e=new THREE.Vector2;e.sub(b,c);return e.unit()};THREE.LineCurve=function(b,c){b instanceof THREE.Vector2?(this.v1=b,this.v2=c):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(b,c,e,f){this.constructor(new THREE.Vector2(b,c),new THREE.Vector2(e,f))};THREE.LineCurve.prototype=new THREE.Curve; -THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2;c.sub(this.v2,this.v1);c.multiplyScalar(b).addSelf(this.v1);return c};THREE.LineCurve.prototype.getPointAt=function(b){return this.getPoint(b)};THREE.LineCurve.prototype.getTangent=function(){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.normalize();return b}; -THREE.QuadraticBezierCurve=function(b,c,e){if(!(c instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),b=new THREE.Vector2(f[0],f[1]),c=new THREE.Vector2(f[2],f[3]),e=new THREE.Vector2(f[4],f[5]);this.v0=b;this.v1=c;this.v2=e};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; -THREE.QuadraticBezierCurve.prototype.getPoint=function(b){var c;c=THREE.Shape.Utils.b2(b,this.v0.x,this.v1.x,this.v2.x);b=THREE.Shape.Utils.b2(b,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(c,b)};THREE.QuadraticBezierCurve.prototype.getTangent=function(b){var c;c=THREE.Curve.Utils.tangentQuadraticBezier(b,this.v0.x,this.v1.x,this.v2.x);b=THREE.Curve.Utils.tangentQuadraticBezier(b,this.v0.y,this.v1.y,this.v2.y);c=new THREE.Vector2(c,b);c.normalize();return c}; -THREE.CubicBezierCurve=function(b,c,e,f){if(!(c instanceof THREE.Vector2))var h=Array.prototype.slice.call(arguments),b=new THREE.Vector2(h[0],h[1]),c=new THREE.Vector2(h[2],h[3]),e=new THREE.Vector2(h[4],h[5]),f=new THREE.Vector2(h[6],h[7]);this.v0=b;this.v1=c;this.v2=e;this.v3=f};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve; -THREE.CubicBezierCurve.prototype.getPoint=function(b){var c;c=THREE.Shape.Utils.b3(b,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b=THREE.Shape.Utils.b3(b,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(c,b)};THREE.CubicBezierCurve.prototype.getTangent=function(b){var c;c=THREE.Curve.Utils.tangentCubicBezier(b,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b=THREE.Curve.Utils.tangentCubicBezier(b,this.v0.y,this.v1.y,this.v2.y,this.v3.y);c=new THREE.Vector2(c,b);c.normalize();return c}; -THREE.SplineCurve=function(b){this.points=b};THREE.SplineCurve.prototype=new THREE.Curve;THREE.SplineCurve.prototype.constructor=THREE.SplineCurve; -THREE.SplineCurve.prototype.getPoint=function(b){var c=new THREE.Vector2,e=[],f=this.points,h;h=(f.length-1)*b;b=Math.floor(h);h-=b;e[0]=b==0?b:b-1;e[1]=b;e[2]=b>f.length-2?b:b+1;e[3]=b>f.length-3?b:b+2;c.x=THREE.Curve.Utils.interpolate(f[e[0]].x,f[e[1]].x,f[e[2]].x,f[e[3]].x,h);c.y=THREE.Curve.Utils.interpolate(f[e[0]].y,f[e[1]].y,f[e[2]].y,f[e[3]].y,h);return c};THREE.ArcCurve=function(b,c,e,f,h,k){this.aX=b;this.aY=c;this.aRadius=e;this.aStartAngle=f;this.aEndAngle=h;this.aClockwise=k}; -THREE.ArcCurve.prototype=new THREE.Curve;THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.ArcCurve.prototype.getPoint=function(b){var c=this.aEndAngle-this.aStartAngle;this.aClockwise||(b=1-b);b=this.aStartAngle+b*c;return new THREE.Vector2(this.aX+this.aRadius*Math.cos(b),this.aY+this.aRadius*Math.sin(b))}; -THREE.Curve.Utils={tangentQuadraticBezier:function(b,c,e,f){return 2*(1-b)*(e-c)+2*b*(f-e)},tangentCubicBezier:function(b,c,e,f,h){return-3*c*(1-b)*(1-b)+3*e*(1-b)*(1-b)-6*b*e*(1-b)+6*b*f*(1-b)-3*b*b*f+3*b*b*h},tangentSpline:function(b){return 6*b*b-6*b+(3*b*b-4*b+1)+(-6*b*b+6*b)+(3*b*b-2*b)},interpolate:function(b,c,e,f,h){var b=(e-b)*0.5,f=(f-c)*0.5,k=h*h;return(2*c-2*e+b+f)*h*k+(-3*c+3*e-2*b-f)*k+b*h+c}}; -THREE.Curve.create=function(b,c){b.prototype=new THREE.Curve;b.prototype.constructor=b;b.prototype.getPoint=c;return b};THREE.LineCurve3=THREE.Curve.create(function(b,c){this.v1=b;this.v2=c},function(b){var c=new THREE.Vector3;c.sub(v2,v1);c.multiplyScalar(b);c.addSelf(this.v1);return c}); -THREE.QuadraticBezierCurve3=THREE.Curve.create(function(b,c,e){this.v0=b;this.v1=c;this.v2=e},function(b){var c,e;c=THREE.Shape.Utils.b2(b,this.v0.x,this.v1.x,this.v2.x);e=THREE.Shape.Utils.b2(b,this.v0.y,this.v1.y,this.v2.y);b=THREE.Shape.Utils.b2(b,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(c,e,b)}); -THREE.CubicBezierCurve3=THREE.Curve.create(function(b,c,e,f){this.v0=b;this.v1=c;this.v2=e;this.v3=f},function(b){var c,e;c=THREE.Shape.Utils.b3(b,this.v0.x,this.v1.x,this.v2.x,this.v3.x);e=THREE.Shape.Utils.b3(b,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=THREE.Shape.Utils.b3(b,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(c,e,b)}); -THREE.SplineCurve3=THREE.Curve.create(function(b){this.points=b},function(b){var c=new THREE.Vector3,e=[],f=this.points,h;h=(f.length-1)*b;b=Math.floor(h);h-=b;e[0]=b==0?b:b-1;e[1]=b;e[2]=b>f.length-2?b:b+1;e[3]=b>f.length-3?b:b+2;c.x=THREE.Curve.Utils.interpolate(f[e[0]].x,f[e[1]].x,f[e[2]].x,f[e[3]].x,h);c.y=THREE.Curve.Utils.interpolate(f[e[0]].y,f[e[1]].y,f[e[2]].y,f[e[3]].y,h);c.z=THREE.Curve.Utils.interpolate(f[e[0]].z,f[e[1]].z,f[e[2]].z,f[e[3]].z,h);return c}); -THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(b){this.curves.push(b)};THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){}; -THREE.CurvePath.prototype.getPoint=function(b){for(var c=b*this.getLength(),e=this.getCurveLengths(),b=0;b=c)return c=e[b]-c,b=this.curves[b],c=1-c/b.getLength(),b.getPointAt(c);b++}return null};THREE.CurvePath.prototype.getLength=function(){var b=this.getCurveLengths();return b[b.length-1]}; -THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var b=[],c=0,e,f=this.curves.length;for(e=0;ec)c=k.x;else if(k.xe)e=k.y;else if(k.y0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b2(z,v,u,n),z=THREE.Shape.Utils.b2(z,A,x, -p),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];p=k[5];u=k[0];x=k[1];t=k[2];w=k[3];e.length>0?(m=e[e.length-1],v=m.x,A=m.y):(m=this.actions[f-1].args,v=m[m.length-2],A=m[m.length-1]);for(m=1;m<=b;m++)z=m/b,k=THREE.Shape.Utils.b3(z,v,u,t,n),z=THREE.Shape.Utils.b3(z,A,x,w,p),e.push(new THREE.Vector2(k,z));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];z=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m); -for(m=1;m<=z;m++)e.push(k.getPointAt(m/z));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];p=k[1];t=k[2];u=k[3];z=k[4];x=!!k[5];w=m[m.length-2];v=m[m.length-1];m.length==0&&(w=v=0);A=z-u;var y=b*2;for(m=1;m<=y;m++)z=m/y,x||(z=1-z),z=u+z*A,k=w+n+t*Math.cos(z),z=v+p+t*Math.sin(z),e.push(new THREE.Vector2(k,z))}c&&e.push(e[0]);return e};THREE.Path.prototype.transform=function(b,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),b)}; -THREE.Path.prototype.nltransform=function(b,c,e,f,h,k){var m=this.getPoints(),n,p,t,w,u;n=0;for(p=m.length;n=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;var z=[t[m],e[n],e[h]];u=THREE.FontUtils.Triangulate.area(z);var y=[t[m],t[k],e[n]];x=THREE.FontUtils.Triangulate.area(y);v=n;w=m;n+=1;m+=-1;n< -0&&(n+=e.length);n%=e.length;m<0&&(m+=t.length);m%=t.length;h=n-1>=0?n-1:e.length-1;k=m-1>=0?m-1:t.length-1;z=[t[m],e[n],e[h]];z=THREE.FontUtils.Triangulate.area(z);y=[t[m],t[k],e[n]];y=THREE.FontUtils.Triangulate.area(y);u+x>z+y&&(n=v,m=w,n<0&&(n+=e.length),n%=e.length,m<0&&(m+=t.length),m%=t.length,h=n-1>=0?n-1:e.length-1,k=m-1>=0?m-1:t.length-1);u=e.slice(0,n);x=e.slice(n);v=t.slice(m);w=t.slice(0,m);k=[t[m],t[k],e[n]];A.push([t[m],e[n],e[h]]);A.push(k);e=u.concat(v).concat(w).concat(x)}return{shape:e, -isolatedPts:A,allpoints:f}},triangulateShape:function(b,c){var e=THREE.Shape.Utils.removeHoles(b,c),f=e.allpoints,h=e.isolatedPts,e=THREE.FontUtils.Triangulate(e.shape,!1),k,m,n,p,t={};k=0;for(m=f.length;k0)l=e-1;else{l=e;break}e=l;if(c[e]==k)return e/(f-1);h=c[e];return c=(e+(k-h)/(c[e+1]-h))/(f-1)};THREE.Curve.prototype.getNormalVector=function(a){a=this.getTangent(a);return new THREE.Vector2(-a.y,a.x)}; +THREE.Curve.prototype.getTangent=function(a){var b=a-1.0E-4;a+=1.0E-4;b<0&&(b=0);a>1&&(a=1);var b=this.getPoint(b),a=this.getPoint(a),c=new THREE.Vector2;c.sub(a,b);return c.unit()};THREE.LineCurve=function(a,b){a instanceof THREE.Vector2?(this.v1=a,this.v2=b):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(a,b,c,e){this.constructor(new THREE.Vector2(a,b),new THREE.Vector2(c,e))};THREE.LineCurve.prototype=new THREE.Curve; +THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.multiplyScalar(a).addSelf(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(){var a=new THREE.Vector2;a.sub(this.v2,this.v1);a.normalize();return a}; +THREE.QuadraticBezierCurve=function(a,b,c){if(!(b instanceof THREE.Vector2))var e=Array.prototype.slice.call(arguments),a=new THREE.Vector2(e[0],e[1]),b=new THREE.Vector2(e[2],e[3]),c=new THREE.Vector2(e[4],e[5]);this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; +THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b}; +THREE.CubicBezierCurve=function(a,b,c,e){if(!(b instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),a=new THREE.Vector2(f[0],f[1]),b=new THREE.Vector2(f[2],f[3]),c=new THREE.Vector2(f[4],f[5]),e=new THREE.Vector2(f[6],f[7]);this.v0=a;this.v1=b;this.v2=c;this.v3=e};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve; +THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b}; +THREE.SplineCurve=function(a){this.points=a};THREE.SplineCurve.prototype=new THREE.Curve;THREE.SplineCurve.prototype.constructor=THREE.SplineCurve; +THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],e=this.points,f;f=(e.length-1)*a;a=Math.floor(f);f-=a;c[0]=a==0?a:a-1;c[1]=a;c[2]=a>e.length-2?a:a+1;c[3]=a>e.length-3?a:a+2;b.x=THREE.Curve.Utils.interpolate(e[c[0]].x,e[c[1]].x,e[c[2]].x,e[c[3]].x,f);b.y=THREE.Curve.Utils.interpolate(e[c[0]].y,e[c[1]].y,e[c[2]].y,e[c[3]].y,f);return b};THREE.ArcCurve=function(a,b,c,e,f,k){this.aX=a;this.aY=b;this.aRadius=c;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=k}; +THREE.ArcCurve.prototype=new THREE.Curve;THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.ArcCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;this.aClockwise||(a=1-a);a=this.aStartAngle+a*b;return new THREE.Vector2(this.aX+this.aRadius*Math.cos(a),this.aY+this.aRadius*Math.sin(a))}; +THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,e){return 2*(1-a)*(c-b)+2*a*(e-c)},tangentCubicBezier:function(a,b,c,e,f){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*e*(1-a)-3*a*a*e+3*a*a*f},tangentSpline:function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,e,f){var a=(c-a)*0.5,e=(e-b)*0.5,k=f*f;return(2*b-2*c+a+e)*f*k+(-3*b+3*c-2*a-e)*k+a*f+b}}; +THREE.Curve.create=function(a,b){a.prototype=new THREE.Curve;a.prototype.constructor=a;a.prototype.getPoint=b;return a};THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.sub(v2,v1);b.multiplyScalar(a);b.addSelf(this.v1);return b}); +THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b,c;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);a=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(b,c,a)}); +THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,e){this.v0=a;this.v1=b;this.v2=c;this.v3=e},function(a){var b,c;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);c=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);a=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(b,c,a)}); +THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=a},function(a){var b=new THREE.Vector3,c=[],e=this.points,f;f=(e.length-1)*a;a=Math.floor(f);f-=a;c[0]=a==0?a:a-1;c[1]=a;c[2]=a>e.length-2?a:a+1;c[3]=a>e.length-3?a:a+2;b.x=THREE.Curve.Utils.interpolate(e[c[0]].x,e[c[1]].x,e[c[2]].x,e[c[3]].x,f);b.y=THREE.Curve.Utils.interpolate(e[c[0]].y,e[c[1]].y,e[c[2]].y,e[c[3]].y,f);b.z=THREE.Curve.Utils.interpolate(e[c[0]].z,e[c[1]].z,e[c[2]].z,e[c[3]].z,f);return b}); +THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){}; +THREE.CurvePath.prototype.getPoint=function(a){for(var b=a*this.getLength(),c=this.getCurveLengths(),a=0;a=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; +THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,e=this.curves.length;for(c=0;cb)b=k.x;else if(k.xc)c=k.y;else if(k.y0?(h=c[c.length-1],t=h.x,y=h.y):(h=this.actions[e-1].args,t=h[h.length-2],y=h[h.length-1]);for(h=1;h<=a;h++)x=h/a,k=THREE.Shape.Utils.b2(x,t,p,l),x=THREE.Shape.Utils.b2(x,y,v, +n),c.push(new THREE.Vector2(k,x));break;case THREE.PathActions.BEZIER_CURVE_TO:l=k[4];n=k[5];p=k[0];v=k[1];o=k[2];u=k[3];c.length>0?(h=c[c.length-1],t=h.x,y=h.y):(h=this.actions[e-1].args,t=h[h.length-2],y=h[h.length-1]);for(h=1;h<=a;h++)x=h/a,k=THREE.Shape.Utils.b3(x,t,p,o,l),x=THREE.Shape.Utils.b3(x,y,v,u,n),c.push(new THREE.Vector2(k,x));break;case THREE.PathActions.CSPLINE_THRU:h=this.actions[e-1].args;h=[new THREE.Vector2(h[h.length-2],h[h.length-1])];x=a*k[0].length;h=h.concat(k[0]);k=new THREE.SplineCurve(h); +for(h=1;h<=x;h++)c.push(k.getPointAt(h/x));break;case THREE.PathActions.ARC:h=this.actions[e-1].args;l=k[0];n=k[1];o=k[2];p=k[3];x=k[4];v=!!k[5];u=h[h.length-2];t=h[h.length-1];h.length==0&&(u=t=0);y=x-p;var w=a*2;for(h=1;h<=w;h++)x=h/w,v||(x=1-x),x=p+x*y,k=u+l+o*Math.cos(x),x=t+n+o*Math.sin(x),c.push(new THREE.Vector2(k,x))}b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)}; +THREE.Path.prototype.nltransform=function(a,b,c,e,f,k){var h=this.getPoints(),l,n,o,u,p;l=0;for(n=h.length;l=0?l-1:c.length-1;k=h-1>=0?h-1:o.length-1;var x=[o[h],c[l],c[f]];p=THREE.FontUtils.Triangulate.area(x);var w=[o[h],o[k],c[l]];v=THREE.FontUtils.Triangulate.area(w);t=l;u=h;l+=1;h+=-1;l< +0&&(l+=c.length);l%=c.length;h<0&&(h+=o.length);h%=o.length;f=l-1>=0?l-1:c.length-1;k=h-1>=0?h-1:o.length-1;x=[o[h],c[l],c[f]];x=THREE.FontUtils.Triangulate.area(x);w=[o[h],o[k],c[l]];w=THREE.FontUtils.Triangulate.area(w);p+v>x+w&&(l=t,h=u,l<0&&(l+=c.length),l%=c.length,h<0&&(h+=o.length),h%=o.length,f=l-1>=0?l-1:c.length-1,k=h-1>=0?h-1:o.length-1);p=c.slice(0,l);v=c.slice(l);t=o.slice(h);u=o.slice(0,h);k=[o[h],o[k],c[l]];y.push([o[h],c[l],c[f]]);y.push(k);c=p.concat(t).concat(u).concat(v)}return{shape:c, +isolatedPts:y,allpoints:e}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),e=c.allpoints,f=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),k,h,l,n,o={};k=0;for(h=e.length;k1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+v),f=f<0?0:1;if(e==="pos")if(e=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= -this.getPrevKeyWith("pos",v,m.index-1).pos,this.points[1]=h,this.points[2]=k,this.points[3]=this.getNextKeyWith("pos",v,n.index+1).pos,f=f*0.33+0.33,h=this.interpolateCatmullRom(this.points,f),e.x=h[0],e.y=h[1],e.z=h[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(e),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(e=== -"rot")THREE.Quaternion.slerp(h,k,b.quaternion,f);else if(e==="scl")e=b.scale,e.x=h[0]+(k[0]-h[0])*f,e.y=h[1]+(k[1]-h[1])*f,e.z=h[2]+(k[2]-h[2])*f}}if(this.JITCompile&&w[0][t]===void 0){this.hierarchy[0].update(void 0,!0);for(v=0;vb.length-2?k:k+1;e[3]=k>b.length-3?k:k+2;k=b[e[0]];n=b[e[1]];p=b[e[2]];t=b[e[3]];e=h*h;m=h*e;f[0]=this.interpolate(k[0],n[0],p[0],t[0],h,e,m);f[1]=this.interpolate(k[1],n[1],p[1],t[1],h,e,m);f[2]=this.interpolate(k[2],n[2],p[2],t[2],h,e,m);return f}; -THREE.Animation.prototype.interpolate=function(b,c,e,f,h,k,m){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*m+(-3*(c-e)-2*b-f)*k+b*h+c};THREE.Animation.prototype.getNextKeyWith=function(b,c,e){var f=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?e=e0?e:0:e>=0?e:e+f.length;e>=0;e--)if(f[e][b]!==void 0)return f[e];return this.data.hierarchy[c].keys[f.length-1]}; -THREE.CubeCamera=function(b,c,e,f){this.heightOffset=e;this.position=new THREE.Vector3(0,e,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNX=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNY=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraNZ=new THREE.PerspectiveCamera(90,1,b,c);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position= +THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+t),e=e<0?0:1;if(c==="pos")if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=f[0]+(k[0]-f[0])*e,c.y=f[1]+(k[1]-f[1])*e,c.z=f[2]+(k[2]-f[2])*e;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= +this.getPrevKeyWith("pos",t,h.index-1).pos,this.points[1]=f,this.points[2]=k,this.points[3]=this.getNextKeyWith("pos",t,l.index+1).pos,e=e*0.33+0.33,f=this.interpolateCatmullRom(this.points,e),c.x=f[0],c.y=f[1],c.z=f[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)e=this.interpolateCatmullRom(this.points,e*1.01),this.target.set(e[0],e[1],e[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),e=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,e,0)}else if(c=== +"rot")THREE.Quaternion.slerp(f,k,a.quaternion,e);else if(c==="scl")c=a.scale,c.x=f[0]+(k[0]-f[0])*e,c.y=f[1]+(k[1]-f[1])*e,c.z=f[2]+(k[2]-f[2])*e}}if(this.JITCompile&&u[0][o]===void 0){this.hierarchy[0].update(void 0,!0);for(t=0;ta.length-2?k:k+1;c[3]=k>a.length-3?k:k+2;k=a[c[0]];l=a[c[1]];n=a[c[2]];o=a[c[3]];c=f*f;h=f*c;e[0]=this.interpolate(k[0],l[0],n[0],o[0],f,c,h);e[1]=this.interpolate(k[1],l[1],n[1],o[1],f,c,h);e[2]=this.interpolate(k[2],l[2],n[2],o[2],f,c,h);return e}; +THREE.Animation.prototype.interpolate=function(a,b,c,e,f,k,h){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*h+(-3*(b-c)-2*a-e)*k+a*f+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c0?c:0:c>=0?c:c+e.length;c>=0;c--)if(e[c][a]!==void 0)return e[c];return this.data.hierarchy[b].keys[e.length-1]}; +THREE.CubeCamera=function(a,b,c,e){this.heightOffset=c;this.position=new THREE.Vector3(0,c,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position= this.position;this.cameraNY.position=this.position;this.cameraPZ.position=this.position;this.cameraNZ.position=this.position;this.cameraPX.up.set(0,-1,0);this.cameraNX.up.set(0,-1,0);this.cameraPY.up.set(0,0,1);this.cameraNY.up.set(0,0,-1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.targetPX=new THREE.Vector3(0,0,0);this.targetNX=new THREE.Vector3(0,0,0);this.targetPY=new THREE.Vector3(0,0,0);this.targetNY=new THREE.Vector3(0,0,0);this.targetPZ=new THREE.Vector3(0,0,0);this.targetNZ= -new THREE.Vector3(0,0,0);this.renderTarget=new THREE.WebGLRenderTargetCube(f,f,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updatePosition=function(b){this.position.copy(b);this.position.y+=this.heightOffset;this.targetPX.copy(this.position);this.targetNX.copy(this.position);this.targetPY.copy(this.position);this.targetNY.copy(this.position);this.targetPZ.copy(this.position);this.targetNZ.copy(this.position);this.targetPX.x+=1;this.targetNX.x-=1;this.targetPY.y+= -1;this.targetNY.y-=1;this.targetPZ.z+=1;this.targetNZ.z-=1;this.cameraPX.lookAt(this.targetPX);this.cameraNX.lookAt(this.targetNX);this.cameraPY.lookAt(this.targetPY);this.cameraNY.lookAt(this.targetNY);this.cameraPZ.lookAt(this.targetPZ);this.cameraNZ.lookAt(this.targetNZ)};this.updateCubeMap=function(b,e){var c=this.renderTarget;c.activeCubeFace=0;b.render(e,this.cameraPX,c);c.activeCubeFace=1;b.render(e,this.cameraNX,c);c.activeCubeFace=2;b.render(e,this.cameraPY,c);c.activeCubeFace=3;b.render(e, -this.cameraNY,c);c.activeCubeFace=4;b.render(e,this.cameraPZ,c);c.activeCubeFace=5;b.render(e,this.cameraNZ,c)}};THREE.FirstPersonCamera=function(){console.warn("DEPRECATED: FirstPersonCamera() is FirstPersonControls().")};THREE.PathCamera=function(){console.warn("DEPRECATED: PathCamera() is PathControls().")};THREE.FlyCamera=function(){console.warn("DEPRECATED: FlyCamera() is FlyControls().")};THREE.RollCamera=function(){console.warn("DEPRECATED: RollCamera() is RollControls().")}; -THREE.TrackballCamera=function(){console.warn("DEPRECATED: TrackballCamera() is TrackballControls().")};THREE.CombinedCamera=function(b,c,e,f,h,k,m){THREE.Camera.call(this);this.cameraO=new THREE.OrthographicCamera(b/-2,b/2,c/2,c/-2,k,m);this.cameraP=new THREE.PerspectiveCamera(e,b/c,f,h);this.toPerspective()};THREE.CombinedCamera.prototype=new THREE.Camera;THREE.CombinedCamera.prototype.constructor=THREE.CoolCamera; -THREE.CombinedCamera.prototype.toPerspective=function(){this.near=this.cameraP.near;this.far=this.cameraP.far;this.projectionMatrix=this.cameraP.projectionMatrix};THREE.CombinedCamera.prototype.toOrthographic=function(){this.near=this.cameraO.near;this.far=this.cameraO.far;this.projectionMatrix=this.cameraO.projectionMatrix};THREE.CombinedCamera.prototype.setFov=function(b){this.cameraP.fov=b;this.cameraP.updateProjectionMatrix();this.toPerspective()}; -THREE.CombinedCamera.prototype.setLens=function(b,c){c||(c=43.25);var e=2*Math.atan(c/(b*2));e*=180/Math.PI;this.setFov(e);return e}; -THREE.FirstPersonControls=function(b,c){function e(b,e){return function(){e.apply(b,arguments)}}this.object=b;this.target=new THREE.Vector3(0,0,0);this.domElement=c!==void 0?c:document;this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor= -0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(b){this.domElement!==document&&this.domElement.focus();b.preventDefault();b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward= -!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(b){b.preventDefault();b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.onKeyDown= -function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp= -!1;break;case 70:this.moveDown=!1}};this.update=function(b){if(!this.freeze){if(this.heightSpeed){var e=THREE.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=b*e*this.heightCoef}else this.autoSpeedFactor=0;e=b*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(e+this.autoSpeedFactor));this.moveBackward&&this.object.translateZ(e);this.moveLeft&&this.object.translateX(-e);this.moveRight&&this.object.translateX(e); -this.moveUp&&this.object.translateY(e);this.moveDown&&this.object.translateY(-e);e=b*this.lookSpeed;this.activeLook||(e=0);this.lon+=this.mouseX*e;this.lookVertical&&(this.lat-=this.mouseY*e);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target,c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta)}b=1;this.constrainVertical&& -(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*e;this.lookVertical&&(this.lat-=this.mouseY*e*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);b=this.target;c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta); -this.object.lookAt(b)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",e(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",e(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",e(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",e(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",e(this,this.onKeyUp),!1)}; -THREE.PathControls=function(b,c){function e(b){if((b*=2)<1)return 0.5*b*b;return-0.5*(--b*(b-2)-1)}function f(b,e){return function(){e.apply(b,arguments)}}function h(b,e,c,f){var h={name:c,fps:0.6,length:f,hierarchy:[]},k,m=e.getControlPointsArray(),n=e.getLength(),y=m.length,D=0;k=y-1;e={parent:-1,keys:[]};e.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};e.keys[k]={time:f,pos:m[k],rot:[0,0,0,1],scl:[1,1,1]};for(k=1;k=0?b:b+m;c=this.verticalAngleMap.srcRange; -b=this.verticalAngleMap.dstRange;c=THREE.Math.mapLinear(this.phi,c[0],c[1],b[0],b[1]);var f=b[1]-b[0];this.phi=e((c-b[0])/f)*f+b[0];c=this.horizontalAngleMap.srcRange;b=this.horizontalAngleMap.dstRange;c=THREE.Math.mapLinear(this.theta,c[0],c[1],b[0],b[1]);f=b[1]-b[0];this.theta=e((c-b[0])/f)*f+b[0];b=this.target.position;b.x=100*Math.sin(this.phi)*Math.cos(this.theta);b.y=100*Math.cos(this.phi);b.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= -function(b){this.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),e=new THREE.MeshLambertMaterial({color:65280}), -c=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,b);b=new THREE.Mesh(m,e);b.position.set(0,10,0);this.animation=h(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(b)}else this.animation=h(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var b= -this.debugPath,e=this.spline,c=k(e,10),m=k(e,10),n=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(c,n);particleObj=new THREE.ParticleSystem(m,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.add(lineObj);particleObj.scale.set(1,1,1);b.add(particleObj);m=new THREE.SphereGeometry(1,16,8);n=new THREE.MeshBasicMaterial({color:65280});for(i=0;i0){var e=this.getContainerDimensions(),c=e.size[0]/2,m=e.size[1]/2;this.moveState.yawLeft=-(b.pageX-e.offset[0]-c)/c;this.moveState.pitchDown=(b.pageY-e.offset[1]-m)/m;this.updateRotationVector()}};this.mouseup=function(b){b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(b.button){case 0:this.moveForward= -!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(b){var e=b*this.movementSpeed;b*=this.rollSpeed;this.object.translateX(this.moveVector.x*e);this.object.translateY(this.moveVector.y*e);this.object.translateZ(this.moveVector.z*e);this.tmpQuaternion.set(this.rotationVector.x*b,this.rotationVector.y*b,this.rotationVector.z*b,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion); -this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var b=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z= --this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",e(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",e(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",e(this, -this.mouseup),!1);this.domElement.addEventListener("keydown",e(this,this.keydown),!1);this.domElement.addEventListener("keyup",e(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(b,c){this.object=b;this.domElement=c!==void 0?c:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Matrix4,m=!1,n=1,p=0,t=0,w=0,u=0,x=0,v=window.innerWidth/2,A=window.innerHeight/2;this.update=function(b){if(this.mouseLook){var c=b*this.lookSpeed; -this.rotateHorizontally(c*u);this.rotateVertically(c*x)}c=b*this.movementSpeed;this.object.translateZ(-c*(p>0||this.autoForward&&!(p<0)?1:p));this.object.translateX(c*t);this.object.translateY(c*w);m&&(this.roll+=this.rollSpeed*b*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y1?c.normalize():c.z=Math.sqrt(1-f*f);k.copy(this.object.position).subSelf(this.target);f=this.object.up.clone().setLength(c.y);f.addSelf(this.object.up.clone().crossSelf(k).setLength(c.x));f.addSelf(k.setLength(c.z));return f};this.rotateCamera=function(){var b=Math.acos(m.dot(n)/m.length()/n.length());if(b){var e=(new THREE.Vector3).cross(m,n).normalize(),c=new THREE.Quaternion;b*=this.rotateSpeed;c.setFromAxisAngle(e, --b);c.multiplyVector3(k);c.multiplyVector3(this.object.up);c.multiplyVector3(n);this.staticMoving?m=n:(c.setFromAxisAngle(e,b*(this.dynamicDampingFactor-1)),c.multiplyVector3(m))}};this.zoomCamera=function(){var b=1+(t.y-p.y)*this.zoomSpeed;b!==1&&b>0&&(k.multiplyScalar(b),this.staticMoving?p=t:p.y+=(t.y-p.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=u.clone().subSelf(w);if(b.lengthSq()){b.multiplyScalar(k.length()*this.panSpeed);var e=k.clone().crossSelf(this.object.up).setLength(b.x); -e.addSelf(this.object.up.clone().setLength(b.y));this.object.position.addSelf(e);this.target.addSelf(e);this.staticMoving?w=u:w.addSelf(b.sub(u,w).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;nb&&(b+=Math.PI*2),anglec=(e+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(m).addSelf(n).subSelf(b).clone()}function h(b){for(N=b.length;--N>=0;){la=N;oa=N-1;oa<0&&(oa=b.length- -1);for(var e=0,c=v+w*2,e=0;e=0;J--){$=J/w;Z=p*(1-$);$=t*Math.sin($*Math.PI/2);N=0;for(V=E.length;N=0?a:a+h;b=this.verticalAngleMap.srcRange; +a=this.verticalAngleMap.dstRange;b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var e=a[1]-a[0];this.phi=c((b-a[0])/e)*e+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);e=a[1]-a[0];this.theta=c((b-a[0])/e)*e+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= +function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}), +b=new THREE.CubeGeometry(10,10,20),h=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(b,a);a=new THREE.Mesh(h,c);a.position.set(0,10,0);this.animation=f(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=f(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a= +this.debugPath,c=this.spline,b=k(c,10),h=k(c,10),l=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(b,l);particleObj=new THREE.ParticleSystem(h,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.add(lineObj);particleObj.scale.set(1,1,1);a.add(particleObj);h=new THREE.SphereGeometry(1,16,8);l=new THREE.MeshBasicMaterial({color:65280});for(i=0;i0){var c=this.getContainerDimensions(),b=c.size[0]/2,h=c.size[1]/2;this.moveState.yawLeft=-(a.pageX-c.offset[0]-b)/b;this.moveState.pitchDown=(a.pageY-c.offset[1]-h)/h;this.updateRotationVector()}};this.mouseup=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(a.button){case 0:this.moveForward= +!1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(a){var c=a*this.movementSpeed;a*=this.rollSpeed;this.object.translateX(this.moveVector.x*c);this.object.translateY(this.moveVector.y*c);this.object.translateZ(this.moveVector.z*c);this.tmpQuaternion.set(this.rotationVector.x*a,this.rotationVector.y*a,this.rotationVector.z*a,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion); +this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z= +-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this, +this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; +THREE.RollControls=function(a,b){this.object=a;this.domElement=b!==void 0?b:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var c=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3,k=new THREE.Matrix4,h=!1,l=1,n=0,o=0,u=0,p=0,v=0,t=window.innerWidth/2,y=window.innerHeight/2;this.update=function(a){if(this.mouseLook){var b=a*this.lookSpeed; +this.rotateHorizontally(b*p);this.rotateVertically(b*v)}b=a*this.movementSpeed;this.object.translateZ(-b*(n>0||this.autoForward&&!(n<0)?1:n));this.object.translateX(b*o);this.object.translateY(b*u);h&&(this.roll+=this.rollSpeed*a*l);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y1?b.normalize():b.z=Math.sqrt(1-e*e);k.copy(this.object.position).subSelf(this.target);e=this.object.up.clone().setLength(b.y);e.addSelf(this.object.up.clone().crossSelf(k).setLength(b.x));e.addSelf(k.setLength(b.z));return e};this.rotateCamera=function(){var a=Math.acos(h.dot(l)/h.length()/l.length());if(a){var c=(new THREE.Vector3).cross(h,l).normalize(),b=new THREE.Quaternion;a*=this.rotateSpeed;b.setFromAxisAngle(c, +-a);b.multiplyVector3(k);b.multiplyVector3(this.object.up);b.multiplyVector3(l);this.staticMoving?h=l:(b.setFromAxisAngle(c,a*(this.dynamicDampingFactor-1)),b.multiplyVector3(h))}};this.zoomCamera=function(){var a=1+(o.y-n.y)*this.zoomSpeed;a!==1&&a>0&&(k.multiplyScalar(a),this.staticMoving?n=o:n.y+=(o.y-n.y)*this.dynamicDampingFactor)};this.panCamera=function(){var a=p.clone().subSelf(u);if(a.lengthSq()){a.multiplyScalar(k.length()*this.panSpeed);var c=k.clone().crossSelf(this.object.up).setLength(a.x); +c.addSelf(this.object.up.clone().setLength(a.y));this.object.position.addSelf(c);this.target.addSelf(c);this.staticMoving?u=p:u.addSelf(a.sub(p,u).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,h,0)));for(l=0;l0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-h,0)));for(l=0;la&&(a+=Math.PI*2),anglec=(c+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(l).subSelf(a).clone()}function f(a){for(J=a.length;--J>=0;){ha=J;ja=J-1;ja<0&&(ja=a.length- +1);for(var c=0,b=t+u*2,c=0;c=0;O--){W=O/u;S=n*(1-W);W=o*Math.sin(W*Math.PI/2);J=0;for(T=A.length;J0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(u,n,x)))-1);t.push(w)}c.push(t)}for(var v,A,z,h=c.length,e=0;e0)for(f=0;f1&&(v= -this.vertices[m].position.clone(),A=this.vertices[p].position.clone(),z=this.vertices[t].position.clone(),v.normalize(),A.normalize(),z.normalize(),this.faces.push(new THREE.Face3(m,p,t,[new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(A.x,A.y,A.z),new THREE.Vector3(z.x,z.y,z.z)])),this.faceVertexUvs[0].push([w,u,y]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry; +THREE.SphereGeometry=function(a,b,c){THREE.Geometry.call(this);for(var a=a||50,e,f=Math.PI,k=Math.max(3,b||8),h=Math.max(2,c||6),b=[],c=0;c0||(u=this.vertices.push(new THREE.Vertex(new THREE.Vector3(p,l,v)))-1);o.push(u)}b.push(o)}for(var t,y,x,f=b.length,c=0;c0)for(e=0;e1&&(t= +this.vertices[h].position.clone(),y=this.vertices[n].position.clone(),x=this.vertices[o].position.clone(),t.normalize(),y.normalize(),x.normalize(),this.faces.push(new THREE.Face3(h,n,o,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(x.x,x.y,x.z)])),this.faceVertexUvs[0].push([u,p,w]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry; THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry; -THREE.TextGeometry=function(b,c){var e=(new THREE.TextPath(b,c)).toShapes();c.amount=c.height!==void 0?c.height:50;if(c.bevelThickness===void 0)c.bevelThickness=10;if(c.bevelSize===void 0)c.bevelSize=8;if(c.bevelEnabled===void 0)c.bevelEnabled=!1;if(c.bend){var f=e[e.length-1].getBoundingBox().maxX;c.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(f/2,120),new THREE.Vector2(f,0))}THREE.ExtrudeGeometry.call(this,e,c)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry; +THREE.TextGeometry=function(a,b){var c=(new THREE.TextPath(a,b)).toShapes();b.amount=b.height!==void 0?b.height:50;if(b.bevelThickness===void 0)b.bevelThickness=10;if(b.bevelSize===void 0)b.bevelSize=8;if(b.bevelEnabled===void 0)b.bevelEnabled=!1;if(b.bend){var e=c[c.length-1].getBoundingBox().maxX;b.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(e/2,120),new THREE.Vector2(e,0))}THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry; THREE.TextGeometry.prototype.constructor=THREE.TextGeometry; -THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(b,c){return(new TextPath(b,c)).toShapes()},loadFace:function(b){var c=b.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][b.cssFontWeight]=this.faces[c][b.cssFontWeight]||{};this.faces[c][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[c][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var c= -this.getFace(),e=this.size/c.resolution,f=0,h=String(b).split(""),k=h.length,m=[],b=0;b0)for(t=0;t2;){if(u--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}p=t;h<=p&&(p=0);t=p+1;h<=t&&(t=0);w=t+1;h<=w&&(w=0);var x;a:{x=b;var v=p,A=t,z=w,y=h,D=m,E=void 0,C=void 0,G=void 0, -I=void 0,P=void 0,K=void 0,B=void 0,O=void 0,Y=void 0,C=x[D[v]].x,G=x[D[v]].y,I=x[D[A]].x,P=x[D[A]].y,K=x[D[z]].x,B=x[D[z]].y;if(1.0E-10>(I-C)*(B-G)-(P-G)*(K-C))x=!1;else{for(E=0;E=0&&J>=0&&Z>=0){x=!1;break a}}x= -!0}}if(x){k.push([b[m[p]],b[m[t]],b[m[w]]]);n.push([m[p],m[t],m[w]]);p=t;for(w=t+1;w0;)this.smooth(b)}; -THREE.SubdivisionModifier.prototype.smooth=function(b){function c(b,e,c,f,n,p){var t=new THREE.Face4(b,e,c,f,null,n.color,n.material);if(m.useOldVertexColors){t.vertexColors=[];for(var v,o,w,x=0;x<4;x++){w=p[x];v=new THREE.Color;v.setRGB(0,0,0);for(var y=0;y0)for(o=0;o2;){if(p--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return l;return k}n=o;f<=n&&(n=0);o=n+1;f<=o&&(o=0);u=o+1;f<=u&&(u=0);var v;a:{v=a;var t=n,y=o,x=u,w=f,B=h,A=void 0,z=void 0,C=void 0, +E=void 0,G=void 0,F=void 0,I=void 0,M=void 0,V=void 0,z=v[B[t]].x,C=v[B[t]].y,E=v[B[y]].x,G=v[B[y]].y,F=v[B[x]].x,I=v[B[x]].y;if(1.0E-10>(E-z)*(I-C)-(G-C)*(F-z))v=!1;else{for(A=0;A=0&&O>=0&&S>=0){v=!1; +break a}}v=!0}}if(v){k.push([a[h[n]],a[h[o]],a[h[u]]]);l.push([h[n],h[o],h[u]]);n=o;for(u=o+1;u0;)this.smooth(a)}; +THREE.SubdivisionModifier.prototype.smooth=function(a){function b(a,c,b,e,l,n){var o=new THREE.Face4(a,c,b,e,null,l.color,l.material);if(h.useOldVertexColors){o.vertexColors=[];for(var m,t,u,v=0;v<4;v++){u=n[v];m=new THREE.Color;m.setRGB(0,0,0);for(var w=0;w>7)-127;f|=(k&127)<<16|h<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,e){var c=w(b,e),f=w(b,e+1),k=w(b,e+2);return(w(b,e+3)<<24)+(k<<16)+(f<<8)+c}function p(b,e){var c=w(b,e);return(w(b,e+1)<<8)+c}function t(b,e){var c=w(b,e);return c>127?c-256:c}function w(b,e){return b.charCodeAt(e)&255}function u(e){var c, -f,k;c=h(b,e);f=h(b,e+P);k=h(b,e+K);e=p(b,e+B);D.faces.push(new THREE.Face3(c,f,k,null,null,D.materials[e]))}function x(e){var c,f,k,m,o,t;c=h(b,e);f=h(b,e+P);k=h(b,e+K);m=p(b,e+B);o=h(b,e+O);t=h(b,e+Y);e=h(b,e+N);m=D.materials[m];var u=G[t*3],v=G[t*3+1];t=G[t*3+2];var w=G[e*3],x=G[e*3+1],e=G[e*3+2];D.faces.push(new THREE.Face3(c,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(u,v,t),new THREE.Vector3(w,x,e)],null,m))}function v(e){var c,f,k,m;c=h(b,e);f=h(b,e+V);k=h(b,e+J);m=h(b, -e+$);e=p(b,e+Z);D.faces.push(new THREE.Face4(c,f,k,m,null,null,D.materials[e]))}function A(e){var c,f,k,m,t,u,v,w;c=h(b,e);f=h(b,e+V);k=h(b,e+J);m=h(b,e+$);t=p(b,e+Z);u=h(b,e+Q);v=h(b,e+o);w=h(b,e+R);e=h(b,e+fa);t=D.materials[t];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var U=G[w*3],L=G[w*3+1];w=G[w*3+2];var z=G[e*3],A=G[e*3+1],e=G[e*3+2];D.faces.push(new THREE.Face4(c,f,k,m,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(U,L,w),new THREE.Vector3(z,A,e)],null,t))} -function z(e){var c,f,k,m;c=h(b,e);f=h(b,e+ea);k=h(b,e+ha);e=I[c*2];m=I[c*2+1];c=I[f*2];var o=D.faceVertexUvs[0];f=I[f*2+1];var p=I[k*2];k=I[k*2+1];var t=[];t.push(new THREE.UV(e,m));t.push(new THREE.UV(c,f));t.push(new THREE.UV(p,k));o.push(t)}function y(e){var c,f,k,m,o,p;c=h(b,e);f=h(b,e+ga);k=h(b,e+la);m=h(b,e+oa);e=I[c*2];o=I[c*2+1];c=I[f*2];p=I[f*2+1];f=I[k*2];var t=D.faceVertexUvs[0];k=I[k*2+1];var u=I[m*2];m=I[m*2+1];var v=[];v.push(new THREE.UV(e,o));v.push(new THREE.UV(c,p));v.push(new THREE.UV(f, -k));v.push(new THREE.UV(u,m));t.push(v)}var D=this,E=0,C,G=[],I=[],P,K,B,O,Y,N,V,J,$,Z,Q,o,R,fa,ea,ha,ga,la,oa,aa,T,X,ia,ja,sa;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(D,f,e);C={signature:b.substr(E,8),header_bytes:w(b,E+8),vertex_coordinate_bytes:w(b,E+9),normal_coordinate_bytes:w(b,E+10),uv_coordinate_bytes:w(b,E+11),vertex_index_bytes:w(b,E+12),normal_index_bytes:w(b,E+13),uv_index_bytes:w(b,E+14),material_index_bytes:w(b,E+15),nvertices:h(b,E+16),nnormals:h(b,E+16+4),nuvs:h(b, -E+16+8),ntri_flat:h(b,E+16+12),ntri_smooth:h(b,E+16+16),ntri_flat_uv:h(b,E+16+20),ntri_smooth_uv:h(b,E+16+24),nquad_flat:h(b,E+16+28),nquad_smooth:h(b,E+16+32),nquad_flat_uv:h(b,E+16+36),nquad_smooth_uv:h(b,E+16+40)};E+=C.header_bytes;P=C.vertex_index_bytes;K=C.vertex_index_bytes*2;B=C.vertex_index_bytes*3;O=C.vertex_index_bytes*3+C.material_index_bytes;Y=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;N=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;V=C.vertex_index_bytes; -J=C.vertex_index_bytes*2;$=C.vertex_index_bytes*3;Z=C.vertex_index_bytes*4;Q=C.vertex_index_bytes*4+C.material_index_bytes;o=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;R=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;fa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;ea=C.uv_index_bytes;ha=C.uv_index_bytes*2;ga=C.uv_index_bytes;la=C.uv_index_bytes*2;oa=C.uv_index_bytes*3;e=C.vertex_index_bytes*3+C.material_index_bytes;sa=C.vertex_index_bytes* -4+C.material_index_bytes;aa=C.ntri_flat*e;T=C.ntri_smooth*(e+C.normal_index_bytes*3);X=C.ntri_flat_uv*(e+C.uv_index_bytes*3);ia=C.ntri_smooth_uv*(e+C.normal_index_bytes*3+C.uv_index_bytes*3);ja=C.nquad_flat*sa;e=C.nquad_smooth*(sa+C.normal_index_bytes*4);sa=C.nquad_flat_uv*(sa+C.uv_index_bytes*4);E+=function(e){for(var f,h,k,n=C.vertex_coordinate_bytes*3,o=e+C.nvertices*n;e=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];for(y=0;y1){o=new THREE.MeshFaceMaterial;for(j=0;j1?c[1].substr(0,e):"0";c[1].length=0,m=h.indexOf("(")>=0,n;if(k)f=h.split("."),h=f.shift(),f.shift();else if(m){n=h.split("(");h=n.shift(); -for(f=0;fe){t=p.output[o];break}m=t!==void 0?t instanceof THREE.Matrix4? -m.multiply(m,t):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);e=m;c.push({time:b,pos:[e.n14,e.n24,e.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=c}this.updateMatrix();return this};u.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b0&&(this[c.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};Y.prototype.create=function(){var b={},e=this.transparency!==void 0&&this.transparency<1,c;for(c in this)switch(c){case "ambient":case "emission":case "diffuse":case "specular":var f=this[c];if(f instanceof O)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=ma[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ga+f.init_from), -b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else c=="diffuse"?b.color=f.color.getHex():e||(b[c]=f.color.getHex());break;case "shininess":case "reflectivity":b[c]=this[c];break;case "transparency":if(e)b.transparent=!0,b.opacity=this[c],e=!0}b.shading=za;return this.material=new THREE.MeshLambertMaterial(b)};N.prototype.parse=function(b){for(var e=0;e=0,f=b.indexOf("(")>=0,h,k;if(c)e=b.split("."),b=e.shift(),k=e.shift();else if(f){h=b.split("(");b=h.shift();for(e=0;e>7)-127;e|=(h&127)<<16|f<<8;if(e==0&&l==-127)return 0;return(1-2*(k>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,l)}function f(a,c){var b=u(a,c),e=u(a,c+1),h=u(a,c+2);return(u(a,c+3)<<24)+(h<<16)+(e<<8)+b}function n(a,c){var b=u(a,c);return(u(a,c+1)<<8)+b}function o(a,c){var b=u(a,c);return b>127?b-256:b}function u(a,c){return a.charCodeAt(c)&255}function p(c){var b, +e,h;b=f(a,c);e=f(a,c+G);h=f(a,c+F);c=n(a,c+I);B.faces.push(new THREE.Face3(b,e,h,null,null,c))}function v(c){var b,e,h,k,m,o,p;b=f(a,c);e=f(a,c+G);h=f(a,c+F);k=n(a,c+I);m=f(a,c+M);o=f(a,c+V);p=f(a,c+J);var c=C[o*3],t=C[o*3+1];o=C[o*3+2];var u=C[p*3],v=C[p*3+1];p=C[p*3+2];B.faces.push(new THREE.Face3(b,e,h,[new THREE.Vector3(C[m*3],C[m*3+1],C[m*3+2]),new THREE.Vector3(c,t,o),new THREE.Vector3(u,v,p)],null,k))}function t(c){var b,e,h,k;b=f(a,c);e=f(a,c+T);h=f(a,c+O);k=f(a,c+W);c=n(a,c+S);B.faces.push(new THREE.Face4(b, +e,h,k,null,null,c))}function y(c){var b,e,h,k,o,p,t,u,v;b=f(a,c);e=f(a,c+T);h=f(a,c+O);k=f(a,c+W);o=n(a,c+S);p=f(a,c+m);t=f(a,c+ca);u=f(a,c+Q);v=f(a,c+ea);var c=C[t*3],w=C[t*3+1];t=C[t*3+2];var H=C[u*3],L=C[u*3+1];u=C[u*3+2];var Z=C[v*3],x=C[v*3+1];v=C[v*3+2];B.faces.push(new THREE.Face4(b,e,h,k,[new THREE.Vector3(C[p*3],C[p*3+1],C[p*3+2]),new THREE.Vector3(c,w,t),new THREE.Vector3(H,L,u),new THREE.Vector3(Z,x,v)],null,o))}function x(c){var b,e,h,k;b=f(a,c);e=f(a,c+da);h=f(a,c+ka);c=E[b*2];k=E[b* +2+1];b=E[e*2];var m=B.faceVertexUvs[0];e=E[e*2+1];var n=E[h*2];h=E[h*2+1];var o=[];o.push(new THREE.UV(c,k));o.push(new THREE.UV(b,e));o.push(new THREE.UV(n,h));m.push(o)}function w(c){var b,e,h,k,m,n;b=f(a,c);e=f(a,c+ia);h=f(a,c+ha);k=f(a,c+ja);c=E[b*2];m=E[b*2+1];b=E[e*2];n=E[e*2+1];e=E[h*2];var o=B.faceVertexUvs[0];h=E[h*2+1];var p=E[k*2];k=E[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(b,n));t.push(new THREE.UV(e,h));t.push(new THREE.UV(p,k));o.push(t)}var B=this,A=0,z,C=[],E= +[],G,F,I,M,V,J,T,O,W,S,m,ca,Q,ea,da,ka,ia,ha,ja,$,R,X,aa,ga,ra;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(B,e,c);z={signature:a.substr(A,8),header_bytes:u(a,A+8),vertex_coordinate_bytes:u(a,A+9),normal_coordinate_bytes:u(a,A+10),uv_coordinate_bytes:u(a,A+11),vertex_index_bytes:u(a,A+12),normal_index_bytes:u(a,A+13),uv_index_bytes:u(a,A+14),material_index_bytes:u(a,A+15),nvertices:f(a,A+16),nnormals:f(a,A+16+4),nuvs:f(a,A+16+8),ntri_flat:f(a,A+16+12),ntri_smooth:f(a,A+16+16),ntri_flat_uv:f(a, +A+16+20),ntri_smooth_uv:f(a,A+16+24),nquad_flat:f(a,A+16+28),nquad_smooth:f(a,A+16+32),nquad_flat_uv:f(a,A+16+36),nquad_smooth_uv:f(a,A+16+40)};A+=z.header_bytes;G=z.vertex_index_bytes;F=z.vertex_index_bytes*2;I=z.vertex_index_bytes*3;M=z.vertex_index_bytes*3+z.material_index_bytes;V=z.vertex_index_bytes*3+z.material_index_bytes+z.normal_index_bytes;J=z.vertex_index_bytes*3+z.material_index_bytes+z.normal_index_bytes*2;T=z.vertex_index_bytes;O=z.vertex_index_bytes*2;W=z.vertex_index_bytes*3;S=z.vertex_index_bytes* +4;m=z.vertex_index_bytes*4+z.material_index_bytes;ca=z.vertex_index_bytes*4+z.material_index_bytes+z.normal_index_bytes;Q=z.vertex_index_bytes*4+z.material_index_bytes+z.normal_index_bytes*2;ea=z.vertex_index_bytes*4+z.material_index_bytes+z.normal_index_bytes*3;da=z.uv_index_bytes;ka=z.uv_index_bytes*2;ia=z.uv_index_bytes;ha=z.uv_index_bytes*2;ja=z.uv_index_bytes*3;c=z.vertex_index_bytes*3+z.material_index_bytes;ra=z.vertex_index_bytes*4+z.material_index_bytes;$=z.ntri_flat*c;R=z.ntri_smooth*(c+ +z.normal_index_bytes*3);X=z.ntri_flat_uv*(c+z.uv_index_bytes*3);aa=z.ntri_smooth_uv*(c+z.normal_index_bytes*3+z.uv_index_bytes*3);ga=z.nquad_flat*ra;c=z.nquad_smooth*(ra+z.normal_index_bytes*4);ra=z.nquad_flat_uv*(ra+z.uv_index_bytes*4);A+=function(c){for(var e,f,k,l=z.vertex_coordinate_bytes*3,m=c+z.nvertices*l;c=0){w=m.invBindMatrices[t];n.invBindMatrix=w;n.skinningMatrix=new THREE.Matrix4;n.skinningMatrix.multiply(n.world,w);n.weights=[];for(w=0;w1){m=new THREE.MeshFaceMaterial;for(j=0;j1?b[1].substr(0,c):"0";b[1].length=0,k=f.indexOf("(")>=0,l;if(h)e=f.split("."),f=e.shift(),e.shift();else if(k){l=f.split("(");f=l.shift(); +for(e=0;ec){o=n.output[m];break}k=o!==void 0?o instanceof THREE.Matrix4? +k.multiply(k,o):k.multiply(k,l.matrix):k.multiply(k,l.matrix)}else k=k.multiply(k,l.matrix);c=k;b.push({time:a,pos:[c.n14,c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=b}this.updateMatrix();return this};p.prototype.updateMatrix=function(){this.matrix.identity();for(var a=0;a0&&(this[b.nodeName]=parseFloat(e[0].textContent))}}this.create();return this};V.prototype.create=function(){var a={},c=this.transparency!==void 0&&this.transparency<1,b;for(b in this)switch(b){case "ambient":case "emission":case "diffuse":case "specular":var e=this[b];if(e instanceof M)if(e.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(e=oa[this.effect.surface.init_from]))a.map=THREE.ImageUtils.loadTexture(Ca+e.init_from), +a.map.wrapS=THREE.RepeatWrapping,a.map.wrapT=THREE.RepeatWrapping,a.map.repeat.x=1,a.map.repeat.y=-1}else b=="diffuse"?a.color=e.color.getHex():c||(a[b]=e.color.getHex());break;case "shininess":case "reflectivity":a[b]=this[b];break;case "transparency":if(c)a.transparent=!0,a.opacity=this[b],c=!0}a.shading=xa;return this.material=new THREE.MeshLambertMaterial(a)};J.prototype.parse=function(a){for(var c=0;c=0,e=a.indexOf("(")>=0,h,f;if(b)c=a.split("."),a=c.shift(),f=c.shift();else if(e){h=a.split("(");a=h.shift();for(c=0;c1&&(Y=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(P,Y);object.name=v;object.position.set(C[0],C[1],C[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=E.visible;R.scene.add(object);R.objects[v]=object;E.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),R.scene.collisions.colliders.push(b)); -if(E.castsShadow)b=new THREE.ShadowVolume(P),R.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},R.triggers[object.name]=b)}}else C=E.position,r=E.rotation,q=E.quaternion,s=E.scale,q=0,object=new THREE.Object3D,object.name=v,object.position.set(C[0],C[1],C[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0], -s[1],s[2]),object.visible=E.visible!==void 0?E.visible:!1,R.scene.add(object),R.objects[v]=object,R.empties[v]=object,E.trigger&&E.trigger.toLowerCase()!="none"&&(b={type:E.trigger,object:E},R.triggers[object.name]=b)}function p(b){return function(c){R.geometries[b]=c;n();$-=1;e.onLoadComplete();w()}}function t(b){return function(e){R.geometries[b]=e}}function w(){e.callbackProgress({totalModels:Q,totalTextures:o,loadedModels:Q-$,loadedTextures:o-Z},R);e.onLoadProgress();$==0&&Z==0&&c(R)}var u,x, -v,A,z,y,D,E,C,G,I,P,K,B,O,Y,N,V,J,$,Z,Q,o,R;V=b.data;O=new THREE.BinaryLoader;J=new THREE.JSONLoader;Z=$=0;R={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(v in V.objects)if(E=V.objects[v],E.meshCollider){b=!0;break}if(b)R.scene.collisions=new THREE.CollisionSystem;if(V.transform){b=V.transform.position;G=V.transform.rotation;var fa=V.transform.scale;b&&R.scene.position.set(b[0],b[1],b[2]);G&&R.scene.rotation.set(G[0], -G[1],G[2]);fa&&R.scene.scale.set(fa[0],fa[1],fa[2]);(b||G||fa)&&R.scene.updateMatrix()}b=function(){Z-=1;w();e.onLoadComplete()};for(z in V.cameras)G=V.cameras[z],G.type=="perspective"?K=new THREE.PerspectiveCamera(G.fov,G.aspect,G.near,G.far):G.type=="ortho"&&(K=new THREE.OrthographicCamera(G.left,G.right,G.top,G.bottom,G.near,G.far)),C=G.position,G=G.target,K.position.set(C[0],C[1],C[2]),K.target=new THREE.Vector3(G[0],G[1],G[2]),R.cameras[z]=K;for(A in V.lights)z=V.lights[A],K=z.color!==void 0? -z.color:16777215,G=z.intensity!==void 0?z.intensity:1,z.type=="directional"?(C=z.direction,N=new THREE.DirectionalLight(K,G),N.position.set(C[0],C[1],C[2]),N.position.normalize()):z.type=="point"?(C=z.position,d=z.distance,N=new THREE.PointLight(K,G,d),N.position.set(C[0],C[1],C[2])):z.type=="ambient"&&(N=new THREE.AmbientLight(K)),R.scene.add(N),R.lights[A]=N;for(y in V.fogs)A=V.fogs[y],A.type=="linear"?B=new THREE.Fog(0,A.near,A.far):A.type=="exp2"&&(B=new THREE.FogExp2(0,A.density)),G=A.color, -B.color.setRGB(G[0],G[1],G[2]),R.fogs[y]=B;if(R.cameras&&V.defaults.camera)R.currentCamera=R.cameras[V.defaults.camera];if(R.fogs&&V.defaults.fog)R.scene.fog=R.fogs[V.defaults.fog];G=V.defaults.bgcolor;R.bgColor=new THREE.Color;R.bgColor.setRGB(G[0],G[1],G[2]);R.bgColorAlpha=V.defaults.bgalpha;for(u in V.geometries)if(y=V.geometries[u],y.type=="bin_mesh"||y.type=="ascii_mesh")$+=1,e.onLoadStart();Q=$;for(u in V.geometries)y=V.geometries[u],y.type=="cube"?(P=new THREE.CubeGeometry(y.width,y.height, -y.depth,y.segmentsWidth,y.segmentsHeight,y.segmentsDepth,null,y.flipped,y.sides),R.geometries[u]=P):y.type=="plane"?(P=new THREE.PlaneGeometry(y.width,y.height,y.segmentsWidth,y.segmentsHeight),R.geometries[u]=P):y.type=="sphere"?(P=new THREE.SphereGeometry(y.radius,y.segmentsWidth,y.segmentsHeight),R.geometries[u]=P):y.type=="cylinder"?(P=new THREE.CylinderGeometry(y.topRad,y.botRad,y.height,y.radSegs,y.heightSegs),R.geometries[u]=P):y.type=="torus"?(P=new THREE.TorusGeometry(y.radius,y.tube,y.segmentsR, -y.segmentsT),R.geometries[u]=P):y.type=="icosahedron"?(P=new THREE.IcosahedronGeometry(y.subdivisions),R.geometries[u]=P):y.type=="bin_mesh"?O.load(f(y.url,V.urlBaseType),p(u)):y.type=="ascii_mesh"?J.load(f(y.url,V.urlBaseType),p(u)):y.type=="embedded_mesh"&&(y=V.embeds[y.id])&&J.createModel(y,t(u),"");for(D in V.textures)if(u=V.textures[D],u.url instanceof Array){Z+=u.url.length;for(O=0;O1&&(V=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(G,V);object.name=t;object.position.set(z[0],z[1],z[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=A.visible;Q.scene.add(object);Q.objects[t]=object;A.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),Q.scene.collisions.colliders.push(a)); +if(A.castsShadow)a=new THREE.ShadowVolume(G),Q.scene.add(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;A.trigger&&A.trigger.toLowerCase()!="none"&&(a={type:A.trigger,object:A},Q.triggers[object.name]=a)}}else z=A.position,r=A.rotation,q=A.quaternion,s=A.scale,q=0,object=new THREE.Object3D,object.name=t,object.position.set(z[0],z[1],z[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0], +s[1],s[2]),object.visible=A.visible!==void 0?A.visible:!1,Q.scene.add(object),Q.objects[t]=object,Q.empties[t]=object,A.trigger&&A.trigger.toLowerCase()!="none"&&(a={type:A.trigger,object:A},Q.triggers[object.name]=a)}function n(a){return function(b){Q.geometries[a]=b;l();W-=1;c.onLoadComplete();u()}}function o(a){return function(c){Q.geometries[a]=c}}function u(){c.callbackProgress({totalModels:m,totalTextures:ca,loadedModels:m-W,loadedTextures:ca-S},Q);c.onLoadProgress();W==0&&S==0&&b(Q)}var p, +v,t,y,x,w,B,A,z,C,E,G,F,I,M,V,J,T,O,W,S,m,ca,Q;T=a.data;M=new THREE.BinaryLoader;O=new THREE.JSONLoader;S=W=0;Q={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(t in T.objects)if(A=T.objects[t],A.meshCollider){a=!0;break}if(a)Q.scene.collisions=new THREE.CollisionSystem;if(T.transform){a=T.transform.position;C=T.transform.rotation;var ea=T.transform.scale;a&&Q.scene.position.set(a[0],a[1],a[2]);C&&Q.scene.rotation.set(C[0], +C[1],C[2]);ea&&Q.scene.scale.set(ea[0],ea[1],ea[2]);(a||C||ea)&&Q.scene.updateMatrix()}a=function(){S-=1;u();c.onLoadComplete()};for(x in T.cameras)C=T.cameras[x],C.type=="perspective"?F=new THREE.PerspectiveCamera(C.fov,C.aspect,C.near,C.far):C.type=="ortho"&&(F=new THREE.OrthographicCamera(C.left,C.right,C.top,C.bottom,C.near,C.far)),z=C.position,C=C.target,F.position.set(z[0],z[1],z[2]),F.target=new THREE.Vector3(C[0],C[1],C[2]),Q.cameras[x]=F;for(y in T.lights)x=T.lights[y],F=x.color!==void 0? +x.color:16777215,C=x.intensity!==void 0?x.intensity:1,x.type=="directional"?(z=x.direction,J=new THREE.DirectionalLight(F,C),J.position.set(z[0],z[1],z[2]),J.position.normalize()):x.type=="point"?(z=x.position,d=x.distance,J=new THREE.PointLight(F,C,d),J.position.set(z[0],z[1],z[2])):x.type=="ambient"&&(J=new THREE.AmbientLight(F)),Q.scene.add(J),Q.lights[y]=J;for(w in T.fogs)y=T.fogs[w],y.type=="linear"?I=new THREE.Fog(0,y.near,y.far):y.type=="exp2"&&(I=new THREE.FogExp2(0,y.density)),C=y.color, +I.color.setRGB(C[0],C[1],C[2]),Q.fogs[w]=I;if(Q.cameras&&T.defaults.camera)Q.currentCamera=Q.cameras[T.defaults.camera];if(Q.fogs&&T.defaults.fog)Q.scene.fog=Q.fogs[T.defaults.fog];C=T.defaults.bgcolor;Q.bgColor=new THREE.Color;Q.bgColor.setRGB(C[0],C[1],C[2]);Q.bgColorAlpha=T.defaults.bgalpha;for(p in T.geometries)if(w=T.geometries[p],w.type=="bin_mesh"||w.type=="ascii_mesh")W+=1,c.onLoadStart();m=W;for(p in T.geometries)w=T.geometries[p],w.type=="cube"?(G=new THREE.CubeGeometry(w.width,w.height, +w.depth,w.segmentsWidth,w.segmentsHeight,w.segmentsDepth,null,w.flipped,w.sides),Q.geometries[p]=G):w.type=="plane"?(G=new THREE.PlaneGeometry(w.width,w.height,w.segmentsWidth,w.segmentsHeight),Q.geometries[p]=G):w.type=="sphere"?(G=new THREE.SphereGeometry(w.radius,w.segmentsWidth,w.segmentsHeight),Q.geometries[p]=G):w.type=="cylinder"?(G=new THREE.CylinderGeometry(w.topRad,w.botRad,w.height,w.radSegs,w.heightSegs),Q.geometries[p]=G):w.type=="torus"?(G=new THREE.TorusGeometry(w.radius,w.tube,w.segmentsR, +w.segmentsT),Q.geometries[p]=G):w.type=="icosahedron"?(G=new THREE.IcosahedronGeometry(w.subdivisions),Q.geometries[p]=G):w.type=="bin_mesh"?M.load(e(w.url,T.urlBaseType),n(p)):w.type=="ascii_mesh"?O.load(e(w.url,T.urlBaseType),n(p)):w.type=="embedded_mesh"&&(w=T.embeds[w.id])&&O.createModel(w,o(p),"");for(B in T.textures)if(p=T.textures[B],p.url instanceof Array){S+=p.url.length;for(M=0;M=57344&&(c-=2048);c++;for(var e=new Float32Array(8*c),f=1,h=0;h<8;h++){for(var k=0,m=0;m>1^-(n&1);e[8*m+h]=k}f+=c}c=b.length-f;k=new Uint16Array(c);for(h=m=0;h=this.maxCount-3&&n(this)};this.begin=function(){this.count=0; -this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(p=this.size-1);var x=Math.floor(t-n);x<1&&(x=1);t=Math.floor(t+n);t>this.size-1&&(t=this.size-1);var v=Math.floor(w-n);v<1&&(v=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size- -1);for(var A,z,y,D,E,C;u0&&(this.field[y+A]+=D)}}};this.addPlaneX=function(b,c){var h,k,m,n,p,t=this.size,w=this.yd,u=this.zd,x=this.field,v=t*Math.sqrt(b/c);v>t&&(v=t);for(h=0;h0)for(k=0;kw&&(A=w);for(k=0;k0){p=k*u;for(h=0;hsize&&(dist=size);for(m=0;m0){p=zd*m;for(k=0;k=57344&&(b-=2048);b++;for(var c=new Float32Array(8*b),e=1,f=0;f<8;f++){for(var k=0,h=0;h>1^-(l&1);c[8*h+f]=k}e+=b}b=a.length-e;k=new Uint16Array(b);for(f=h=0;f=this.maxCount-3&&l(this)};this.begin=function(){this.count=0; +this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var b=this.count*3;bthis.size-1&&(n=this.size-1);var v=Math.floor(o-l);v<1&&(v=1);o=Math.floor(o+l);o>this.size-1&&(o=this.size-1);var t=Math.floor(u-l);t<1&&(t=1);l=Math.floor(u+l);l>this.size-1&&(l=this.size- +1);for(var y,x,w,B,A,z;p0&&(this.field[w+y]+=B)}}};this.addPlaneX=function(a,b){var f,k,h,l,n,o=this.size,u=this.yd,p=this.zd,v=this.field,t=o*Math.sqrt(a/b);t>o&&(t=o);for(f=0;f0)for(k=0;ku&&(y=u);for(k=0;k0){n=k*p;for(f=0;fsize&&(dist=size);for(h=0;h0){n=zd*h;for(k=0;kk?this.hits.push(h):this.hits.unshift(h),k=f;return this.hits}; -THREE.CollisionSystem.prototype.rayCastNearest=function(b){var c=this.rayCastAll(b);if(c.length==0)return null;for(var e=0;c[e]instanceof THREE.MeshCollider;){var f=this.rayMesh(b,c[e]);if(f.distc.length)return null;return c[e]}; -THREE.CollisionSystem.prototype.rayCast=function(b,c){if(c instanceof THREE.PlaneCollider)return this.rayPlane(b,c);else if(c instanceof THREE.SphereCollider)return this.raySphere(b,c);else if(c instanceof THREE.BoxCollider)return this.rayBox(b,c);else if(c instanceof THREE.MeshCollider&&c.box)return this.rayBox(b,c.box)}; -THREE.CollisionSystem.prototype.rayMesh=function(b,c){for(var e=this.makeRayLocal(b,c.mesh),f=Number.MAX_VALUE,h,k=0;k=n*h))return Number.MAX_VALUE;m/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(m);n.addSelf(b.origin);Math.abs(k.x)> -Math.abs(k.y)?Math.abs(k.x)>Math.abs(k.z)?(b=n.y-c.y,k=e.y-c.y,h=f.y-c.y,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y):Math.abs(k.y)>Math.abs(k.z)?(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.z-c.z,e=e.z-c.z,f=f.z-c.z):(b=n.x-c.x,k=e.x-c.x,h=f.x-c.x,n=n.y-c.y,e=e.y-c.y,f=f.y-c.y);c=k*f-e*h;if(c==0)return Number.MAX_VALUE;c=1/c;f=(b*f-n*h)*c;if(!(f>=0))return Number.MAX_VALUE;c*=k*n-e*b;if(!(c>=0))return Number.MAX_VALUE;if(!(1-f-c>=0))return Number.MAX_VALUE;return m}; -THREE.CollisionSystem.prototype.makeRayLocal=function(b,c){var e=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(c.matrixWorld,e);var f=THREE.CollisionSystem.__r;f.origin.copy(b.origin);f.direction.copy(b.direction);e.multiplyVector3(f.origin);e.rotateAxis(f.direction);f.direction.normalize();return f}; -THREE.CollisionSystem.prototype.rayBox=function(b,c){var e;c.dynamic&&c.mesh&&c.mesh.matrixWorld?e=this.makeRayLocal(b,c.mesh):(e=THREE.CollisionSystem.__r,e.origin.copy(b.origin),e.direction.copy(b.direction));var f=0,h=0,k=0,m=0,n=0,p=0,t=!0;e.origin.xc.max.x&&(f=c.max.x-e.origin.x,f/=e.direction.x,t=!1,m=1);e.origin.yc.max.y&&(h=c.max.y-e.origin.y,h/=e.direction.y, -t=!1,n=1);e.origin.zc.max.z&&(k=c.max.z-e.origin.z,k/=e.direction.z,t=!1,p=1);if(t)return-1;t=0;h>f&&(t=1,f=h);k>f&&(t=2,f=k);switch(t){case 0:n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;e=e.origin.z+e.direction.z*f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(m,0,0);break;case 1:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;e=e.origin.z+e.direction.z* -f;if(ec.max.z)return Number.MAX_VALUE;c.normal.set(0,n,0);break;case 2:m=e.origin.x+e.direction.x*f;if(mc.max.x)return Number.MAX_VALUE;n=e.origin.y+e.direction.y*f;if(nc.max.y)return Number.MAX_VALUE;c.normal.set(0,0,p)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,c){var e=b.direction.dot(c.normal),f=c.point.dot(c.normal);if(e<0)e=(f-b.origin.dot(c.normal))/e;else return Number.MAX_VALUE;return e>0?e:Number.MAX_VALUE}; -THREE.CollisionSystem.prototype.raySphere=function(b,c){var e=c.center.clone().subSelf(b.origin);if(e.lengthSq=0)return Math.abs(f)-Math.sqrt(e);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4; -THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(b){b.geometry.computeBoundingBox();var c=b.geometry.boundingBox,e=new THREE.Vector3(c.x[0],c.y[0],c.z[0]),c=new THREE.Vector3(c.x[1],c.y[1],c.z[1]),e=new THREE.BoxCollider(e,c);e.mesh=b;return e};THREE.CollisionUtils.MeshAABB=function(b){var c=THREE.CollisionUtils.MeshOBB(b);c.min.addSelf(b.position);c.max.addSelf(b.position);c.dynamic=!1;return c}; -THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))}; -if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var c=this,e=this.setSize,f=this.render,h=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,m=new THREE.Matrix4,n=new THREE.Matrix4,p,t,w;h.matrixAutoUpdate=k.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},u=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),v=new THREE.PerspectiveCamera(53,1,1,1E4);v.position.z= -2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:u},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); -var A=new THREE.Scene;A.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){e.call(c,b,f);u.width=b;u.height=f;x.width=b;x.height=f};this.render=function(b,e){e.update(null,!0);if(p!==e.aspect||t!==e.near||w!==e.fov){p=e.aspect;t=e.near;w=e.fov;var D=e.projectionMatrix.clone(),E=125/30*0.5,C=E*t/125,G=t*Math.tan(w*Math.PI/360),I;m.n14=E;n.n14=-E;E=-G*p+C;I=G*p+C;D.n11=2*t/(I-E);D.n13=(I+E)/(I-E);h.projectionMatrix=D.clone();E=-G*p-C;I=G*p-C;D.n11=2*t/(I-E);D.n13= -(I+E)/(I-E);k.projectionMatrix=D.clone()}h.matrix=e.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(e.position);h.near=t;h.far=e.far;f.call(c,b,h,u,!0);k.matrix=e.matrixWorld.clone().multiplySelf(m);k.update(null,!0);k.position.copy(e.position);k.near=t;k.far=e.far;f.call(c,b,k,x,!0);f.call(c,A,v)}}; -if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var c=this,e=this.setSize,f=this.render,h,k,m=new THREE.PerspectiveCamera;m.target=new THREE.Vector3(0,0,0);var n=new THREE.PerspectiveCamera;n.target=new THREE.Vector3(0,0,0);c.separation=10;if(b&&b.separation!==void 0)c.separation=b.separation;this.setSize=function(b,f){e.call(c,b,f);h=b/2;k=f};this.render=function(b,e){this.clear();m.fov=e.fov;m.aspect=0.5*e.aspect;m.near=e.near;m.far= -e.far;m.updateProjectionMatrix();m.position.copy(e.position);m.target.copy(e.target);m.translateX(c.separation);m.lookAt(m.target);n.projectionMatrix=m.projectionMatrix;n.position.copy(e.position);n.target.copy(e.target);n.translateX(-c.separation);n.lookAt(n.target);this.setViewport(0,0,h,k);f.call(c,b,m);this.setViewport(h,0,h,k);f.call(c,b,n,!1)}}; +2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);THREE.PlaneCollider=function(a,b){this.point=a;this.normal=b};THREE.SphereCollider=function(a,b){this.center=a;this.radius=b;this.radiusSq=b*b};THREE.BoxCollider=function(a,b){this.min=a;this.max=b;this.dynamic=!0;this.normal=new THREE.Vector3}; +THREE.MeshCollider=function(a,b){this.mesh=a;this.box=b;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;THREE.CollisionSystem.prototype.merge=function(a){Array.prototype.push.apply(this.colliders,a.colliders);Array.prototype.push.apply(this.hits,a.hits)}; +THREE.CollisionSystem.prototype.rayCastAll=function(a){a.direction.normalize();this.hits.length=0;var b,c,e,f,k=0;b=0;for(c=this.colliders.length;bk?this.hits.push(f):this.hits.unshift(f),k=e;return this.hits}; +THREE.CollisionSystem.prototype.rayCastNearest=function(a){var b=this.rayCastAll(a);if(b.length==0)return null;for(var c=0;b[c]instanceof THREE.MeshCollider;){var e=this.rayMesh(a,b[c]);if(e.distb.length)return null;return b[c]}; +THREE.CollisionSystem.prototype.rayCast=function(a,b){if(b instanceof THREE.PlaneCollider)return this.rayPlane(a,b);else if(b instanceof THREE.SphereCollider)return this.raySphere(a,b);else if(b instanceof THREE.BoxCollider)return this.rayBox(a,b);else if(b instanceof THREE.MeshCollider&&b.box)return this.rayBox(a,b.box)}; +THREE.CollisionSystem.prototype.rayMesh=function(a,b){for(var c=this.makeRayLocal(a,b.mesh),e=Number.MAX_VALUE,f,k=0;k=l*f))return Number.MAX_VALUE;h/=l;l=THREE.CollisionSystem.__v3;l.copy(a.direction);l.multiplyScalar(h);l.addSelf(a.origin);Math.abs(k.x)> +Math.abs(k.y)?Math.abs(k.x)>Math.abs(k.z)?(a=l.y-b.y,k=c.y-b.y,f=e.y-b.y,l=l.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=l.x-b.x,k=c.x-b.x,f=e.x-b.x,l=l.y-b.y,c=c.y-b.y,e=e.y-b.y):Math.abs(k.y)>Math.abs(k.z)?(a=l.x-b.x,k=c.x-b.x,f=e.x-b.x,l=l.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=l.x-b.x,k=c.x-b.x,f=e.x-b.x,l=l.y-b.y,c=c.y-b.y,e=e.y-b.y);b=k*e-c*f;if(b==0)return Number.MAX_VALUE;b=1/b;e=(a*e-l*f)*b;if(!(e>=0))return Number.MAX_VALUE;b*=k*l-c*a;if(!(b>=0))return Number.MAX_VALUE;if(!(1-e-b>=0))return Number.MAX_VALUE;return h}; +THREE.CollisionSystem.prototype.makeRayLocal=function(a,b){var c=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(b.matrixWorld,c);var e=THREE.CollisionSystem.__r;e.origin.copy(a.origin);e.direction.copy(a.direction);c.multiplyVector3(e.origin);c.rotateAxis(e.direction);e.direction.normalize();return e}; +THREE.CollisionSystem.prototype.rayBox=function(a,b){var c;b.dynamic&&b.mesh&&b.mesh.matrixWorld?c=this.makeRayLocal(a,b.mesh):(c=THREE.CollisionSystem.__r,c.origin.copy(a.origin),c.direction.copy(a.direction));var e=0,f=0,k=0,h=0,l=0,n=0,o=!0;c.origin.xb.max.x&&(e=b.max.x-c.origin.x,e/=c.direction.x,o=!1,h=1);c.origin.yb.max.y&&(f=b.max.y-c.origin.y,f/=c.direction.y, +o=!1,l=1);c.origin.zb.max.z&&(k=b.max.z-c.origin.z,k/=c.direction.z,o=!1,n=1);if(o)return-1;o=0;f>e&&(o=1,e=f);k>e&&(o=2,e=k);switch(o){case 0:l=c.origin.y+c.direction.y*e;if(lb.max.y)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*e;if(cb.max.z)return Number.MAX_VALUE;b.normal.set(h,0,0);break;case 1:h=c.origin.x+c.direction.x*e;if(hb.max.x)return Number.MAX_VALUE;c=c.origin.z+c.direction.z* +e;if(cb.max.z)return Number.MAX_VALUE;b.normal.set(0,l,0);break;case 2:h=c.origin.x+c.direction.x*e;if(hb.max.x)return Number.MAX_VALUE;l=c.origin.y+c.direction.y*e;if(lb.max.y)return Number.MAX_VALUE;b.normal.set(0,0,n)}return e};THREE.CollisionSystem.prototype.rayPlane=function(a,b){var c=a.direction.dot(b.normal),e=b.point.dot(b.normal);if(c<0)c=(e-a.origin.dot(b.normal))/c;else return Number.MAX_VALUE;return c>0?c:Number.MAX_VALUE}; +THREE.CollisionSystem.prototype.raySphere=function(a,b){var c=b.center.clone().subSelf(a.origin);if(c.lengthSq=0)return Math.abs(e)-Math.sqrt(c);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4; +THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(a){a.geometry.computeBoundingBox();var b=a.geometry.boundingBox,c=new THREE.Vector3(b.x[0],b.y[0],b.z[0]),b=new THREE.Vector3(b.x[1],b.y[1],b.z[1]),c=new THREE.BoxCollider(c,b);c.mesh=a;return c};THREE.CollisionUtils.MeshAABB=function(a){var b=THREE.CollisionUtils.MeshOBB(a);b.min.addSelf(a.position);b.max.addSelf(a.position);b.dynamic=!1;return b}; +THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))}; +if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,e=this.render,f=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,h=new THREE.Matrix4,l=new THREE.Matrix4,n,o,u;f.matrixAutoUpdate=k.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},p=new THREE.WebGLRenderTarget(512,512,a),v=new THREE.WebGLRenderTarget(512,512,a),t=new THREE.PerspectiveCamera(53,1,1,1E4);t.position.z= +2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:p},mapRight:{type:"t",value:1,texture:v}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); +var y=new THREE.Scene;y.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){c.call(b,a,e);p.width=a;p.height=e;v.width=a;v.height=e};this.render=function(a,c){c.update(null,!0);if(n!==c.aspect||o!==c.near||u!==c.fov){n=c.aspect;o=c.near;u=c.fov;var B=c.projectionMatrix.clone(),A=125/30*0.5,z=A*o/125,C=o*Math.tan(u*Math.PI/360),E;h.n14=A;l.n14=-A;A=-C*n+z;E=C*n+z;B.n11=2*o/(E-A);B.n13=(E+A)/(E-A);f.projectionMatrix=B.clone();A=-C*n-z;E=C*n-z;B.n11=2*o/(E-A);B.n13= +(E+A)/(E-A);k.projectionMatrix=B.clone()}f.matrix=c.matrixWorld.clone().multiplySelf(l);f.update(null,!0);f.position.copy(c.position);f.near=o;f.far=c.far;e.call(b,a,f,p,!0);k.matrix=c.matrixWorld.clone().multiplySelf(h);k.update(null,!0);k.position.copy(c.position);k.near=o;k.far=c.far;e.call(b,a,k,v,!0);e.call(b,y,t)}}; +if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,e=this.render,f,k,h=new THREE.PerspectiveCamera;h.target=new THREE.Vector3(0,0,0);var l=new THREE.PerspectiveCamera;l.target=new THREE.Vector3(0,0,0);b.separation=10;if(a&&a.separation!==void 0)b.separation=a.separation;this.setSize=function(a,e){c.call(b,a,e);f=a/2;k=e};this.render=function(a,c){this.clear();h.fov=c.fov;h.aspect=0.5*c.aspect;h.near=c.near;h.far= +c.far;h.updateProjectionMatrix();h.position.copy(c.position);h.target.copy(c.target);h.translateX(b.separation);h.lookAt(h.target);l.projectionMatrix=h.projectionMatrix;l.position.copy(c.position);l.target.copy(c.target);l.translateX(-b.separation);l.lookAt(l.target);this.setViewport(0,0,f,k);e.call(b,a,h);this.setViewport(f,0,f,k);e.call(b,a,l,!1)}}; diff --git a/examples/js/Car.js b/examples/js/Car.js index b9ec89eb..bbaf52c6 100644 --- a/examples/js/Car.js +++ b/examples/js/Car.js @@ -106,8 +106,8 @@ THREE.Car = function () { var loader = new THREE.JSONLoader(); - loader.load( { model: bodyURL, callback: function( geometry ) { createBody( geometry ) } } ); - loader.load( { model: wheelURL, callback: function( geometry ) { createWheels( geometry ) } } ); + loader.load( bodyURL, function( geometry ) { createBody( geometry ) } ); + loader.load( wheelURL, function( geometry ) { createWheels( geometry ) } ); }; @@ -115,8 +115,8 @@ THREE.Car = function () { var loader = new THREE.BinaryLoader(); - loader.load( { model: bodyURL, callback: function( geometry ) { createBody( geometry ) } } ); - loader.load( { model: wheelURL, callback: function( geometry ) { createWheels( geometry ) } } ); + loader.load( bodyURL, function( geometry ) { createBody( geometry ) } ); + loader.load( wheelURL, function( geometry ) { createWheels( geometry ) } ); }; diff --git a/examples/js/postprocessing/BloomPass.js b/examples/js/postprocessing/BloomPass.js index ef4e5d05..ca2de01a 100644 --- a/examples/js/postprocessing/BloomPass.js +++ b/examples/js/postprocessing/BloomPass.js @@ -65,7 +65,7 @@ THREE.BloomPass.prototype = { // Render quad with blured scene into texture (convolution pass 1) - THREE.EffectComposer.quad.materials[ 0 ] = this.materialConvolution; + THREE.EffectComposer.quad.material = this.materialConvolution; this.convolutionUniforms[ "tDiffuse" ].texture = readBuffer; this.convolutionUniforms[ "uImageIncrement" ].value = THREE.BloomPass.blurX; @@ -82,7 +82,7 @@ THREE.BloomPass.prototype = { // Render original scene with superimposed blur to texture - THREE.EffectComposer.quad.materials[ 0 ] = this.materialScreen; + THREE.EffectComposer.quad.material = this.materialScreen; this.screenUniforms[ "tDiffuse" ].texture = this.renderTargetY; diff --git a/examples/js/postprocessing/DotScreenPass.js b/examples/js/postprocessing/DotScreenPass.js index e945955c..0cafe262 100644 --- a/examples/js/postprocessing/DotScreenPass.js +++ b/examples/js/postprocessing/DotScreenPass.js @@ -35,7 +35,7 @@ THREE.DotScreenPass.prototype = { this.uniforms[ "tDiffuse" ].texture = readBuffer; this.uniforms[ "tSize" ].value.set( readBuffer.width, readBuffer.height ); - THREE.EffectComposer.quad.materials[ 0 ] = this.material; + THREE.EffectComposer.quad.material = this.material; if ( this.renderToScreen ) { diff --git a/examples/js/postprocessing/FilmPass.js b/examples/js/postprocessing/FilmPass.js index 3575d2bd..3ff68843 100644 --- a/examples/js/postprocessing/FilmPass.js +++ b/examples/js/postprocessing/FilmPass.js @@ -34,7 +34,7 @@ THREE.FilmPass.prototype = { this.uniforms[ "tDiffuse" ].texture = readBuffer; this.uniforms[ "time" ].value += delta; - THREE.EffectComposer.quad.materials[ 0 ] = this.material; + THREE.EffectComposer.quad.material = this.material; if ( this.renderToScreen ) { diff --git a/examples/js/postprocessing/SavePass.js b/examples/js/postprocessing/SavePass.js index 056608c8..ea4478f5 100644 --- a/examples/js/postprocessing/SavePass.js +++ b/examples/js/postprocessing/SavePass.js @@ -43,7 +43,7 @@ THREE.SavePass.prototype = { } - THREE.EffectComposer.quad.materials[ 0 ] = this.material; + THREE.EffectComposer.quad.material = this.material; renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, this.renderTarget, this.clear ); diff --git a/examples/js/postprocessing/ShaderPass.js b/examples/js/postprocessing/ShaderPass.js index 1c173e84..13c9e755 100644 --- a/examples/js/postprocessing/ShaderPass.js +++ b/examples/js/postprocessing/ShaderPass.js @@ -34,7 +34,7 @@ THREE.ShaderPass.prototype = { } - THREE.EffectComposer.quad.materials[ 0 ] = this.material; + THREE.EffectComposer.quad.material = this.material; if ( this.renderToScreen ) { diff --git a/examples/js/postprocessing/TexturePass.js b/examples/js/postprocessing/TexturePass.js index ea5d8ac6..e0fb1383 100644 --- a/examples/js/postprocessing/TexturePass.js +++ b/examples/js/postprocessing/TexturePass.js @@ -28,7 +28,7 @@ THREE.TexturePass.prototype = { render: function ( renderer, writeBuffer, readBuffer, delta ) { - THREE.EffectComposer.quad.materials[ 0 ] = this.material; + THREE.EffectComposer.quad.material = this.material; renderer.render( THREE.EffectComposer.scene, THREE.EffectComposer.camera, readBuffer ); diff --git a/examples/webgl_animation_skinning.html b/examples/webgl_animation_skinning.html index 44819975..a9139abc 100644 --- a/examples/webgl_animation_skinning.html +++ b/examples/webgl_animation_skinning.html @@ -140,7 +140,7 @@ var material = new THREE.MeshFaceMaterial(); - var originalMaterial = geometry.materials[ 0 ][ 0 ]; + var originalMaterial = geometry.materials[ 0 ]; originalMaterial.skinning = true; originalMaterial.transparent = true; diff --git a/examples/webgl_geometry_blenderexport_colors.html b/examples/webgl_geometry_blenderexport_colors.html index 85ad0a2d..42b028ea 100644 --- a/examples/webgl_geometry_blenderexport_colors.html +++ b/examples/webgl_geometry_blenderexport_colors.html @@ -91,20 +91,24 @@ function createScene1( geometry ) { - geometry.materials[0][0].shading = THREE.FlatShading; + geometry.materials[ 0 ].shading = THREE.FlatShading; - var material = [ new THREE.MeshFaceMaterial(), new THREE.MeshLambertMaterial( { color: 0xffffff, opacity:0.9, shading:THREE.FlatShading, wireframe: true, wireframeLinewidth: 2 } ) ]; - - mesh = new THREE.Mesh( geometry, material ); + mesh = new THREE.Object3D(); mesh.position.x = 400; mesh.scale.x = mesh.scale.y = mesh.scale.z = 250; scene.add( mesh ); + var part1 = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial() ); + mesh.add( part1 ); + + var part2 = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0xffffff, opacity: 0.9, shading: THREE.FlatShading, wireframe: true, wireframeLinewidth: 2, transparent: true } ) ); + mesh.add( part2 ); + } function createScene2( geometry ) { - geometry.materials[0][0].shading = THREE.FlatShading; + geometry.materials[ 0 ].shading = THREE.FlatShading; var material = new THREE.MeshFaceMaterial(); diff --git a/examples/webgl_geometry_colors.html b/examples/webgl_geometry_colors.html index 61705265..2c77924b 100644 --- a/examples/webgl_geometry_colors.html +++ b/examples/webgl_geometry_colors.html @@ -48,7 +48,7 @@ var camera, scene, renderer; - var mesh, mesh2, mesh3, light; + var group1, group2, group3, light; var mouseX = 0, mouseY = 0; @@ -100,7 +100,7 @@ geometry2 = new THREE.IcosahedronGeometry( 1 ), geometry3 = new THREE.IcosahedronGeometry( 1 ); - for ( var i = 0; i < geometry.faces.length; i++ ) { + for ( var i = 0; i < geometry.faces.length; i ++ ) { f = geometry.faces[ i ]; f2 = geometry2.faces[ i ]; @@ -137,27 +137,45 @@ var materials = [ new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ), - new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true } ) + new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true, transparent: true } ) ]; - mesh = new THREE.Mesh( geometry, materials ); - mesh.position.x = -400; - mesh.scale.x = mesh.scale.y = mesh.scale.z = 200; - mesh.rotation.x = -1.87; - scene.add( mesh ); + group1 = new THREE.Object3D(); + group1.position.x = -400; + group1.scale.x = group1.scale.y = group1.scale.z = 200; + group1.rotation.x = -1.87; + scene.add( group1 ); - mesh2 = new THREE.Mesh( geometry2, materials ); - mesh2.position.x = 400; - mesh2.rotation.x = 0; - mesh2.scale = mesh.scale; - scene.add( mesh2 ); + var p1 = new THREE.Mesh( geometry, materials[ 0 ] ); + var p2 = new THREE.Mesh( geometry, materials[ 1 ] ); - mesh3 = new THREE.Mesh( geometry3, materials ); - mesh3.position.x = 0; - mesh3.rotation.x = 0; - mesh3.scale = mesh.scale; - scene.add( mesh3 ); + group1.add( p1 ); + group1.add( p2 ); + + group2 = new THREE.Object3D(); + group2.position.x = 400; + group2.rotation.x = 0; + group2.scale = group1.scale; + scene.add( group2 ); + + var p1 = new THREE.Mesh( geometry2, materials[ 0 ] ); + var p2 = new THREE.Mesh( geometry2, materials[ 1 ] ); + + group2.add( p1 ); + group2.add( p2 ); + + group3 = new THREE.Object3D(); + group3.position.x = 0; + group3.rotation.x = 0; + group3.scale = group1.scale; + scene.add( group3 ); + + var p1 = new THREE.Mesh( geometry3, materials[ 0 ] ); + var p2 = new THREE.Mesh( geometry3, materials[ 1 ] ); + + group3.add( p1 ); + group3.add( p2 ); renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.setSize( window.innerWidth, window.innerHeight ); diff --git a/examples/webgl_geometry_text.html b/examples/webgl_geometry_text.html index a92e3879..c6a16268 100644 --- a/examples/webgl_geometry_text.html +++ b/examples/webgl_geometry_text.html @@ -441,11 +441,13 @@ bend: bend, - material: textMaterialFront, - extrudeMaterial: textMaterialSide + material: 0, + extrudeMaterial: 1 }); + textGeo.materials = [ textMaterialFront, textMaterialSide ]; + textGeo.computeBoundingBox(); textGeo.computeVertexNormals(); @@ -460,7 +462,7 @@ var face = textGeo.faces[ i ]; - if ( face.materials[ 0 ].id == textMaterialSide.id ) { + if ( face.materialIndex == 1 ) { for ( var j = 0; j < face.vertexNormals.length; j ++ ) { diff --git a/examples/webgl_interactive_draggablecubes.html b/examples/webgl_interactive_draggablecubes.html index 384bb9b0..a3f67c98 100644 --- a/examples/webgl_interactive_draggablecubes.html +++ b/examples/webgl_interactive_draggablecubes.html @@ -56,7 +56,7 @@ var object = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: Math.random() * 0xffffff } ) ); - object.materials[ 0 ].ambient = object.materials[ 0 ].color; + object.material.ambient = object.material.color; object.position.x = Math.random() * 1000 - 500; object.position.y = Math.random() * 600 - 300; @@ -153,10 +153,10 @@ if ( INTERSECTED != intersects[ 0 ].object ) { - if ( INTERSECTED ) INTERSECTED.materials[ 0 ].color.setHex( INTERSECTED.currentHex ); + if ( INTERSECTED ) INTERSECTED.material.color.setHex( INTERSECTED.currentHex ); INTERSECTED = intersects[ 0 ].object; - INTERSECTED.currentHex = INTERSECTED.materials[ 0 ].color.getHex(); + INTERSECTED.currentHex = INTERSECTED.material.color.getHex(); plane.position.copy( INTERSECTED.position ); @@ -166,7 +166,7 @@ } else { - if ( INTERSECTED ) INTERSECTED.materials[ 0 ].color.setHex( INTERSECTED.currentHex ); + if ( INTERSECTED ) INTERSECTED.material.color.setHex( INTERSECTED.currentHex ); INTERSECTED = null; diff --git a/examples/webgl_materials2.html b/examples/webgl_materials2.html index d9a00835..c3df6ba0 100644 --- a/examples/webgl_materials2.html +++ b/examples/webgl_materials2.html @@ -227,7 +227,7 @@ pointLight = new THREE.PointLight( 0xffffff, 2, 800 ); scene.add( pointLight ); - particleLight.materials[ 0 ].color = pointLight.color; + particleLight.material.color = pointLight.color; pointLight.position = particleLight.position; // diff --git a/examples/webgl_materials_cars.html b/examples/webgl_materials_cars.html index 35644be2..87301a50 100644 --- a/examples/webgl_materials_cars.html +++ b/examples/webgl_materials_cars.html @@ -532,9 +532,9 @@ $( button_name( car, i ) ).counter = i; $( button_name( car, i ) ).addEventListener( 'click', function() { - for ( var j = 0; j < material_indices.length; j++ ) { + for ( var j = 0; j < material_indices.length; j ++ ) { - geometry.materials[ material_indices [ j ] ][ 0 ] = materials[ this.counter ][ 1 ]; + geometry.materials[ material_indices [ j ] ] = materials[ this.counter ][ 1 ]; } @@ -557,7 +557,7 @@ for ( var i in CARS[ car ].mmap ) { - geometry.materials[ i ][ 0 ] = CARS[ car ].mmap[ i ]; + geometry.materials[ i ] = CARS[ car ].mmap[ i ]; } diff --git a/examples/webgl_materials_cars_camaro.html b/examples/webgl_materials_cars_camaro.html index 12812459..d4288617 100644 --- a/examples/webgl_materials_cars_camaro.html +++ b/examples/webgl_materials_cars_camaro.html @@ -147,7 +147,7 @@ var i, src = "", parent = $( "buttons" ); - for( i = 0; i < materials.length; i++ ) { + for( i = 0; i < materials.length; i ++ ) { src += ''; @@ -158,7 +158,7 @@ for( i = 0; i < materials.length; i ++ ) { $( "m" + i ).counter = i; - $( "m" + i ).addEventListener( 'click', function() { geometry.materials[ 0 ][ 0 ] = materials[ this.counter ][ 1 ] }, false ); + $( "m" + i ).addEventListener( 'click', function() { geometry.materials[ 0 ] = materials[ this.counter ][ 1 ] }, false ); } @@ -168,15 +168,15 @@ var s = 75, m = new THREE.MeshFaceMaterial(); - geometry.materials[ 0 ][ 0 ] = materials.body[ 0 ][ 1 ]; // car body - geometry.materials[ 1 ][ 0 ] = materials.chrome; // wheels chrome - geometry.materials[ 2 ][ 0 ] = materials.chrome; // grille chrome - geometry.materials[ 3 ][ 0 ] = materials.darkchrome; // door lines - geometry.materials[ 4 ][ 0 ] = materials.glass; // windshield - geometry.materials[ 5 ][ 0 ] = materials.interior; // interior - geometry.materials[ 6 ][ 0 ] = materials.tire; // tire - geometry.materials[ 7 ][ 0 ] = materials.black; // tireling - geometry.materials[ 8 ][ 0 ] = materials.black; // behind grille + geometry.materials[ 0 ] = materials.body[ 0 ][ 1 ]; // car body + geometry.materials[ 1 ] = materials.chrome; // wheels chrome + geometry.materials[ 2 ] = materials.chrome; // grille chrome + geometry.materials[ 3 ] = materials.darkchrome; // door lines + geometry.materials[ 4 ] = materials.glass; // windshield + geometry.materials[ 5 ] = materials.interior; // interior + geometry.materials[ 6 ] = materials.tire; // tire + geometry.materials[ 7 ] = materials.black; // tireling + geometry.materials[ 8 ] = materials.black; // behind grille var mesh = new THREE.Mesh( geometry, m ); mesh.rotation.y = 1; diff --git a/examples/webgl_materials_cubemap_dynamic.html b/examples/webgl_materials_cubemap_dynamic.html index 0e089137..8d47654b 100644 --- a/examples/webgl_materials_cubemap_dynamic.html +++ b/examples/webgl_materials_cubemap_dynamic.html @@ -51,8 +51,127 @@ motion blur: b - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -817,15 +936,15 @@ var materials = car.bodyGeometry.materials; - materials[ 0 ][ 0 ] = mlib.body[ 0 ][ 1 ]; // body - materials[ 1 ][ 0 ] = mlib[ "Dark chrome" ]; // front under lights, back + materials[ 0 ] = mlib.body[ 0 ][ 1 ]; // body + materials[ 1 ] = mlib[ "Dark chrome" ]; // front under lights, back // WHEELS materials = car.wheelGeometry.materials; - materials[ 0 ][ 0 ] = mlib[ "Chrome" ]; // insides - materials[ 1 ][ 0 ] = mlib[ "Black rough" ]; // tire + materials[ 0 ] = mlib[ "Chrome" ]; // insides + materials[ 1 ] = mlib[ "Black rough" ]; // tire } @@ -844,21 +963,21 @@ var materials = car.bodyGeometry.materials; - materials[ 0 ][ 0 ] = mlib[ "Black metal" ]; // top, front center, back sides - materials[ 1 ][ 0 ] = mlib[ "Chrome" ]; // front sides - materials[ 2 ][ 0 ] = mlib[ "Chrome" ]; // engine - materials[ 3 ][ 0 ] = mlib[ "Dark chrome" ]; // small chrome things - materials[ 4 ][ 0 ] = mlib[ "Red glass" ]; // backlights - materials[ 5 ][ 0 ] = mlib[ "Orange glass" ]; // back signals - materials[ 6 ][ 0 ] = mlib[ "Black rough" ]; // bottom, interior - materials[ 7 ][ 0 ] = mlib[ "Dark glass" ]; // windshield + materials[ 0 ] = mlib[ "Black metal" ]; // top, front center, back sides + materials[ 1 ] = mlib[ "Chrome" ]; // front sides + materials[ 2 ] = mlib[ "Chrome" ]; // engine + materials[ 3 ] = mlib[ "Dark chrome" ]; // small chrome things + materials[ 4 ] = mlib[ "Red glass" ]; // backlights + materials[ 5 ] = mlib[ "Orange glass" ]; // back signals + materials[ 6 ] = mlib[ "Black rough" ]; // bottom, interior + materials[ 7 ] = mlib[ "Dark glass" ]; // windshield // WHEELS materials = car.wheelGeometry.materials; - materials[ 0 ][ 0 ] = mlib[ "Chrome" ]; // insides - materials[ 1 ][ 0 ] = mlib[ "Black rough" ]; // tire + materials[ 0 ] = mlib[ "Chrome" ]; // insides + materials[ 1 ] = mlib[ "Black rough" ]; // tire } @@ -900,16 +1019,16 @@ if ( veyron.loaded ) { - veyron.bodyGeometry.materials[ 1 ][ 0 ] = mlib[ "ChromeN" ]; - veyron.bodyGeometry.materials[ 2 ][ 0 ] = mlib[ "ChromeN" ]; + veyron.bodyGeometry.materials[ 1 ] = mlib[ "ChromeN" ]; + veyron.bodyGeometry.materials[ 2 ] = mlib[ "ChromeN" ]; - veyron.wheelGeometry.materials[ 0 ][ 0 ] = mlib[ "ChromeN" ]; + veyron.wheelGeometry.materials[ 0 ] = mlib[ "ChromeN" ]; } if ( gallardo.loaded ) { - gallardo.wheelGeometry.materials[ 0 ][ 0 ] = mlib[ "ChromeN" ]; + gallardo.wheelGeometry.materials[ 0 ] = mlib[ "ChromeN" ]; } @@ -917,16 +1036,16 @@ if ( veyron.loaded ) { - veyron.bodyGeometry.materials[ 1 ][ 0 ] = mlib[ "Chrome" ]; - veyron.bodyGeometry.materials[ 2 ][ 0 ] = mlib[ "Chrome" ]; + veyron.bodyGeometry.materials[ 1 ] = mlib[ "Chrome" ]; + veyron.bodyGeometry.materials[ 2 ] = mlib[ "Chrome" ]; - veyron.wheelGeometry.materials[ 0 ][ 0 ] = mlib[ "Chrome" ]; + veyron.wheelGeometry.materials[ 0 ] = mlib[ "Chrome" ]; } if ( gallardo.loaded ) { - gallardo.wheelGeometry.materials[ 0 ][ 0 ] = mlib[ "Chrome" ]; + gallardo.wheelGeometry.materials[ 0 ] = mlib[ "Chrome" ]; } diff --git a/examples/webgl_materials_grass.html b/examples/webgl_materials_grass.html index e5a688d4..aaa762fc 100644 --- a/examples/webgl_materials_grass.html +++ b/examples/webgl_materials_grass.html @@ -47,7 +47,7 @@ for ( var i = 0; i < 15; i ++ ) { mesh = levels[ i ] = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { map: new THREE.Texture( generateTextureLevel( bitmap ) ), transparent: true, depthTest: false } ) ); - mesh.materials[0].map.needsUpdate = true; + mesh.material.map.needsUpdate = true; mesh.rotation.x = - 90 * ( Math.PI / 180 ); mesh.position.y = i * 0.25; diff --git a/examples/webgl_materials_normalmap.html b/examples/webgl_materials_normalmap.html index d3eb547c..dd10192d 100644 --- a/examples/webgl_materials_normalmap.html +++ b/examples/webgl_materials_normalmap.html @@ -222,6 +222,8 @@ geometry.computeTangents(); + geometry.materials = [ material1 ]; + mesh1 = new THREE.Mesh( geometry, material1 ); mesh1.position.x = - scale * 12; mesh1.scale.set( scale, scale, scale ); @@ -238,6 +240,8 @@ loader.statusDomElement.style.display = "none"; + console.log( mesh1 ); + } function onDocumentMouseMove(event) { diff --git a/examples/webgl_shader_lava.html b/examples/webgl_shader_lava.html index 8fa3a7a6..58628bc5 100644 --- a/examples/webgl_shader_lava.html +++ b/examples/webgl_shader_lava.html @@ -170,7 +170,7 @@ } ); - mesh = new THREE.Mesh( new THREE.TorusGeometry( size, 0.3, 30, 30 ), [ material /*, new THREE.MeshBasicMaterial( { color: 0x000000, wireframe: true, wireframeLinewidth: 2 } ) */ ] ); + mesh = new THREE.Mesh( new THREE.TorusGeometry( size, 0.3, 30, 30 ), material ); mesh.rotation.x = 0.3; scene.add( mesh ); diff --git a/examples/webgl_shading_physical.html b/examples/webgl_shading_physical.html index 4d289a42..fabe2c7c 100644 --- a/examples/webgl_shading_physical.html +++ b/examples/webgl_shading_physical.html @@ -346,7 +346,7 @@ var tmpMesh = new THREE.Mesh( geometry, material ); - THREE.ColorUtils.adjustHSV( tmpMesh.materials[ 0 ].color, 0.1, -0.1, 0 ); + THREE.ColorUtils.adjustHSV( tmpMesh.material.color, 0.1, -0.1, 0 ); tmpMesh.position.set( x, y, z ); diff --git a/examples/webgl_shadowmap.html b/examples/webgl_shadowmap.html index e4151735..6e1b2e03 100644 --- a/examples/webgl_shadowmap.html +++ b/examples/webgl_shadowmap.html @@ -247,6 +247,8 @@ var material = new THREE.MeshLambertMaterial( { color: 0xffaa55, morphTargets: true, vertexColors: THREE.FaceColors } ); + geometry.materials[ 0 ] = material; + if ( fudgeColor ) { THREE.ColorUtils.adjustHSV( material.color, 0, 0.5 - Math.random(), 0.5 - Math.random() ); diff --git a/src/core/Face3.js b/src/core/Face3.js index d215afed..b02bf66f 100644 --- a/src/core/Face3.js +++ b/src/core/Face3.js @@ -3,9 +3,9 @@ * @author alteredq / http://alteredqualia.com/ */ -THREE.Face3 = function ( a, b, c, normal, color, materials ) { +THREE.Face3 = function ( a, b, c, normal, color, materialIndex ) { - this.a = a; + this.a = a; this.b = b; this.c = c; @@ -17,7 +17,7 @@ THREE.Face3 = function ( a, b, c, normal, color, materials ) { this.vertexTangents = []; - this.materials = materials instanceof Array ? materials : [ materials ]; + this.materialIndex = materialIndex; this.centroid = new THREE.Vector3(); diff --git a/src/core/Face4.js b/src/core/Face4.js index b5e4bc2b..ea35c1eb 100644 --- a/src/core/Face4.js +++ b/src/core/Face4.js @@ -3,9 +3,9 @@ * @author alteredq / http://alteredqualia.com/ */ -THREE.Face4 = function ( a, b, c, d, normal, color, materials ) { +THREE.Face4 = function ( a, b, c, d, normal, color, materialIndex ) { - this.a = a; + this.a = a; this.b = b; this.c = c; this.d = d; @@ -18,7 +18,7 @@ THREE.Face4 = function ( a, b, c, d, normal, color, materials ) { this.vertexTangents = []; - this.materials = materials instanceof Array ? materials : [ materials ]; + this.materialIndex = materialIndex; this.centroid = new THREE.Vector3(); diff --git a/src/core/Geometry.js b/src/core/Geometry.js index 99611277..c0cdbb44 100644 --- a/src/core/Geometry.js +++ b/src/core/Geometry.js @@ -13,6 +13,8 @@ THREE.Geometry = function () { this.vertices = []; this.colors = []; // one-to-one vertex colors, used in ParticleSystem, Line and Ribbon + this.materials = []; + this.faces = []; this.faceUvs = [[]]; @@ -435,27 +437,27 @@ THREE.Geometry.prototype = { this.boundingSphere = { radius: radius }; }, - - /* - * Checks for duplicate vertices with hashmap. + + /* + * Checks for duplicate vertices with hashmap. * Duplicated vertices are removed - * and faces' vertices are updated. + * and faces' vertices are updated. */ mergeVertices: function() { - + var verticesMap = {}; // Hashmap for looking up vertice by position coordinates (and making sure they are unique) var unique = [], changes = []; - + var v, key; - var precisionPoints = 4; // number of decimal points, eg. 4 for epsilon of 0.0001 + var precisionPoints = 4; // number of decimal points, eg. 4 for epsilon of 0.0001 var precision = Math.pow(10, precisionPoints) var i,il, face; - + for (i=0,il=this.vertices.length;i= 0 ) ? geometry.materials[ geometryGroup.materialIndex ] : object.material; - // this will not work if materials would change in run-time - // it should be refreshed every frame - // but need to do unrollGroupMaterials - // more properly without push to array - // like unrollBufferMaterials + uvType = bufferGuessUVType( material ); + normalType = bufferGuessNormalType( material ); + vertexColorType = bufferGuessVertexColorType( material ); - geometryGroup.__materials = materials; - - uvType = bufferGuessUVType( materials, geometryGroup, object ); - normalType = bufferGuessNormalType( materials, geometryGroup, object ); - vertexColorType = bufferGuessVertexColorType( materials, geometryGroup, object ); - - //console.log("uvType",uvType, "normalType",normalType, "vertexColorType",vertexColorType, object, geometryGroup, materials ); + //console.log( "uvType", uvType, "normalType", normalType, "vertexColorType", vertexColorType, object, geometryGroup, material ); geometryGroup.__vertexArray = new Float32Array( nvertices * 3 ); @@ -881,58 +865,52 @@ THREE.WebGLRenderer = function ( parameters ) { // custom attributes - for ( m = 0, ml = materials.length; m < ml; m ++ ) { + if ( material.attributes ) { - material = materials[ m ]; + if ( geometryGroup.__webglCustomAttributesList === undefined ) { - if ( material.attributes ) { + geometryGroup.__webglCustomAttributesList = []; - if ( geometryGroup.__webglCustomAttributesList === undefined ) { + } - geometryGroup.__webglCustomAttributesList = []; + for ( var a in material.attributes ) { + + // Do a shallow copy of the attribute object so different geometryGroup chunks use different + // attribute buffers which are correctly indexed in the setMeshBuffers function + + originalAttribute = material.attributes[ a ]; + + attribute = {}; + + for ( property in originalAttribute ) { + + attribute[ property ] = originalAttribute[ property ]; } - for ( a in material.attributes ) { + if( !attribute.__webglInitialized || attribute.createUniqueBuffers ) { - // Do a shallow copy of the attribute object so different geometryGroup chunks use different - // attribute buffers which are correctly indexed in the setMeshBuffers function + attribute.__webglInitialized = true; - originalAttribute = material.attributes[ a ]; + size = 1; // "f" and "i" - attribute = {}; + if( attribute.type === "v2" ) size = 2; + else if( attribute.type === "v3" ) size = 3; + else if( attribute.type === "v4" ) size = 4; + else if( attribute.type === "c" ) size = 3; - for ( property in originalAttribute ) { + attribute.size = size; + attribute.array = new Float32Array( nvertices * size ); + attribute.buffer = _gl.createBuffer(); + attribute.buffer.belongsToAttribute = a; - attribute[ property ] = originalAttribute[ property ]; - - } - - if( !attribute.__webglInitialized || attribute.createUniqueBuffers ) { - - attribute.__webglInitialized = true; - - size = 1; // "f" and "i" - - if( attribute.type === "v2" ) size = 2; - else if( attribute.type === "v3" ) size = 3; - else if( attribute.type === "v4" ) size = 4; - else if( attribute.type === "c" ) size = 3; - - attribute.size = size; - attribute.array = new Float32Array( nvertices * size ); - attribute.buffer = _gl.createBuffer(); - attribute.buffer.belongsToAttribute = a; - - originalAttribute.needsUpdate = true; - attribute.__original = originalAttribute; - - } - - geometryGroup.__webglCustomAttributesList.push( attribute ); + originalAttribute.needsUpdate = true; + attribute.__original = originalAttribute; } + geometryGroup.__webglCustomAttributesList.push( attribute ); + } } @@ -2551,6 +2529,7 @@ THREE.WebGLRenderer = function ( parameters ) { } uniforms.map.texture = material.map; + if ( material.map ) { uniforms.offsetRepeat.value.set( material.map.offset.x, material.map.offset.y, material.map.repeat.x, material.map.repeat.y ); @@ -3491,9 +3470,9 @@ THREE.WebGLRenderer = function ( parameters ) { }; - function unrollImmediateBufferMaterials( globject ) { + function unrollImmediateBufferMaterial( globject ) { - var i, l, m, ml, material, + var material, object = globject.object, opaque = globject.opaque, transparent = globject.transparent; @@ -3501,16 +3480,12 @@ THREE.WebGLRenderer = function ( parameters ) { transparent.count = 0; opaque.count = 0; - for ( m = 0, ml = object.materials.length; m < ml; m ++ ) { - - material = object.materials[ m ]; - material.transparent ? addToFixedArray( transparent, material ) : addToFixedArray( opaque, material ); - - } + material = object.material; + material.transparent ? addToFixedArray( transparent, material ) : addToFixedArray( opaque, material ); }; - function unrollBufferMaterials( globject ) { + function unrollBufferMaterial( globject ) { var i, l, m, ml, material, meshMaterial, object = globject.object, @@ -3521,26 +3496,24 @@ THREE.WebGLRenderer = function ( parameters ) { transparent.count = 0; opaque.count = 0; - for ( m = 0, ml = object.materials.length; m < ml; m ++ ) { + meshMaterial = object.material; - meshMaterial = object.materials[ m ]; + if ( meshMaterial instanceof THREE.MeshFaceMaterial ) { - if ( meshMaterial instanceof THREE.MeshFaceMaterial ) { + materialIndex = buffer.materialIndex; - for ( i = 0, l = buffer.materials.length; i < l; i ++ ) { + if ( materialIndex >= 0 ) { - material = buffer.materials[ i ]; - if ( material ) material.transparent ? addToFixedArray( transparent, material ) : addToFixedArray( opaque, material ); - - } - - } else { - - material = meshMaterial; - if ( material ) material.transparent ? addToFixedArray( transparent, material ) : addToFixedArray( opaque, material ); + material = object.geometry.materials[ materialIndex ]; + material.transparent ? addToFixedArray( transparent, material ) : addToFixedArray( opaque, material ); } + } else { + + material = meshMaterial; + if ( material ) material.transparent ? addToFixedArray( transparent, material ) : addToFixedArray( opaque, material ); + } }; @@ -3827,7 +3800,7 @@ THREE.WebGLRenderer = function ( parameters ) { setupMatrices( object, camera, true ); - unrollBufferMaterials( webglObject ); + unrollBufferMaterial( webglObject ); webglObject.render = true; @@ -3885,7 +3858,7 @@ THREE.WebGLRenderer = function ( parameters ) { setupMatrices( object, camera, true ); - unrollImmediateBufferMaterials( webglObject ); + unrollImmediateBufferMaterial( webglObject ); } @@ -4433,23 +4406,15 @@ THREE.WebGLRenderer = function ( parameters ) { }; - function areCustomAttributesDirty( geometryGroup ) { + function areCustomAttributesDirty( geometryGroup, object ) { - var a, m, ml, material, materials; + var material = ( geometryGroup.materialIndex >= 0 ) ? object.geometry.materials[ geometryGroup.materialIndex ] : object.material; - materials = geometryGroup.__materials; + if ( material.attributes ) { - for ( m = 0, ml = materials.length; m < ml; m ++ ) { + for ( var a in material.attributes ) { - material = materials[ m ]; - - if ( material.attributes ) { - - for ( a in material.attributes ) { - - if ( material.attributes[ a ].needsUpdate ) return true; - - } + if ( material.attributes[ a ].needsUpdate ) return true; } @@ -4459,23 +4424,15 @@ THREE.WebGLRenderer = function ( parameters ) { }; - function clearCustomAttributes( geometryGroup ) { + function clearCustomAttributes( geometryGroup, object ) { - var a, m, ml, material, materials; + var material = ( geometryGroup.materialIndex >= 0 ) ? object.geometry.materials[ geometryGroup.materialIndex ] : object.material; - materials = geometryGroup.__materials; + if ( material.attributes ) { - for ( m = 0, ml = materials.length; m < ml; m ++ ) { + for ( var a in material.attributes ) { - material = materials[ m ]; - - if ( material.attributes ) { - - for ( a in material.attributes ) { - - material.attributes[ a ].needsUpdate = false; - - } + material.attributes[ a ].needsUpdate = false; } @@ -4497,7 +4454,7 @@ THREE.WebGLRenderer = function ( parameters ) { geometryGroup = geometry.geometryGroupsList[ i ]; - customAttributeDirty = areCustomAttributesDirty( geometryGroup ); + customAttributeDirty = areCustomAttributesDirty( geometryGroup, object ); if ( geometry.__dirtyVertices || geometry.__dirtyMorphTargets || geometry.__dirtyElements || geometry.__dirtyUvs || geometry.__dirtyNormals || @@ -4517,7 +4474,7 @@ THREE.WebGLRenderer = function ( parameters ) { geometry.__dirtyTangents = false; geometry.__dirtyColors = false; - clearCustomAttributes( geometryGroup ); + clearCustomAttributes( geometryGroup, object ); } else if ( object instanceof THREE.Ribbon ) { @@ -4549,7 +4506,7 @@ THREE.WebGLRenderer = function ( parameters ) { geometry = object.geometry; - customAttributeDirty = areCustomAttributesDirty( geometry ); + customAttributeDirty = areCustomAttributesDirty( geometry, object ); if ( geometry.__dirtyVertices || geometry.__dirtyColors || object.sortParticles || customAttributeDirty ) { @@ -4560,7 +4517,7 @@ THREE.WebGLRenderer = function ( parameters ) { geometry.__dirtyVertices = false; geometry.__dirtyColors = false; - clearCustomAttributes( geometry ); + clearCustomAttributes( geometry, object ); }/* else if ( THREE.MarchingCubes !== undefined && object instanceof THREE.MarchingCubes ) { @@ -4634,44 +4591,17 @@ THREE.WebGLRenderer = function ( parameters ) { function sortFacesByMaterial( geometry ) { - // TODO - // Should optimize by grouping faces with ColorFill / ColorStroke materials - // which could then use vertex color attributes instead of each being - // in its separate VBO - - var i, l, f, fl, face, material, materials, vertices, mhash, ghash, hash_map = {}; + var i, l, f, fl, face, materialIndex, vertices, mhash, ghash, hash_map = {}; var numMorphTargets = geometry.morphTargets !== undefined ? geometry.morphTargets.length : 0; geometry.geometryGroups = {}; - function materialHash( material ) { - - var hash_array = []; - - for ( i = 0, l = material.length; i < l; i ++ ) { - - if ( material[ i ] == undefined ) { - - hash_array.push( "undefined" ); - - } else { - - hash_array.push( material[ i ].id ); - - } - - } - - return hash_array.join( '_' ); - - } - for ( f = 0, fl = geometry.faces.length; f < fl; f ++ ) { face = geometry.faces[ f ]; - materials = face.materials; + materialIndex = face.materialIndex; - mhash = materialHash( materials ); + mhash = ( materialIndex !== undefined ) ? materialIndex : -1; if ( hash_map[ mhash ] == undefined ) { @@ -4683,7 +4613,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( geometry.geometryGroups[ ghash ] == undefined ) { - geometry.geometryGroups[ ghash ] = { 'faces': [], 'materials': materials, 'vertices': 0, 'numMorphTargets': numMorphTargets }; + geometry.geometryGroups[ ghash ] = { 'faces': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets }; } @@ -4696,7 +4626,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( geometry.geometryGroups[ ghash ] == undefined ) { - geometry.geometryGroups[ ghash ] = { 'faces': [], 'materials': materials, 'vertices': 0, 'numMorphTargets': numMorphTargets }; + geometry.geometryGroups[ ghash ] = { 'faces': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets }; } @@ -4721,21 +4651,25 @@ THREE.WebGLRenderer = function ( parameters ) { function addBuffer( objlist, buffer, object ) { - objlist.push( { - buffer: buffer, object: object, - opaque: { list: [], count: 0 }, - transparent: { list: [], count: 0 } - } ); + objlist.push( + { + buffer: buffer, object: object, + opaque: { list: [], count: 0 }, + transparent: { list: [], count: 0 } + } + ); }; function addBufferImmediate( objlist, object ) { - objlist.push( { - object: object, - opaque: { list: [], count: 0 }, - transparent: { list: [], count: 0 } - } ); + objlist.push( + { + object: object, + opaque: { list: [], count: 0 }, + transparent: { list: [], count: 0 } + } + ); }; @@ -5652,103 +5586,11 @@ THREE.WebGLRenderer = function ( parameters ) { }; - function bufferNeedsSmoothNormals( geometryGroup, object ) { + function bufferGuessVertexColorType( material ) { - var m, ml, i, l, meshMaterial, needsSmoothNormals = false; + if ( material.vertexColors ) { - for ( m = 0, ml = object.materials.length; m < ml; m++ ) { - - meshMaterial = object.materials[ m ]; - - if ( meshMaterial instanceof THREE.MeshFaceMaterial ) { - - for ( i = 0, l = geometryGroup.materials.length; i < l; i++ ) { - - if ( materialNeedsSmoothNormals( geometryGroup.materials[ i ] ) ) { - - needsSmoothNormals = true; - break; - - } - - } - - } else { - - if ( materialNeedsSmoothNormals( meshMaterial ) ) { - - needsSmoothNormals = true; - break; - - } - - } - - if ( needsSmoothNormals ) break; - - } - - return needsSmoothNormals; - - }; - - function unrollGroupMaterials( geometryGroup, object ) { - - var m, ml, i, il, - material, meshMaterial, - materials = []; - - for ( m = 0, ml = object.materials.length; m < ml; m ++ ) { - - meshMaterial = object.materials[ m ]; - - if ( meshMaterial instanceof THREE.MeshFaceMaterial ) { - - for ( i = 0, l = geometryGroup.materials.length; i < l; i ++ ) { - - material = geometryGroup.materials[ i ]; - - if ( material ) { - - materials.push( material ); - - } - - } - - } else { - - material = meshMaterial; - - if ( material ) { - - materials.push( material ); - - } - - } - - } - - return materials; - - }; - - function bufferGuessVertexColorType( materials, geometryGroup, object ) { - - var i, m, ml = materials.length; - - // use vertexColor type from the first material in unrolled materials - - for ( i = 0; i < ml; i ++ ) { - - m = materials[ i ]; - - if ( m.vertexColors ) { - - return m.vertexColors; - - } + return material.vertexColors; } @@ -5756,49 +5598,35 @@ THREE.WebGLRenderer = function ( parameters ) { }; - function bufferGuessNormalType( materials, geometryGroup, object ) { - - var i, m, ml = materials.length; + function bufferGuessNormalType( material ) { // only MeshBasicMaterial and MeshDepthMaterial don't need normals - for ( i = 0; i < ml; i ++ ) { + if ( ( material instanceof THREE.MeshBasicMaterial && !material.envMap ) || material instanceof THREE.MeshDepthMaterial ) { - m = materials[ i ]; - - if ( ( m instanceof THREE.MeshBasicMaterial && !m.envMap ) || m instanceof THREE.MeshDepthMaterial ) continue; - - if ( materialNeedsSmoothNormals( m ) ) { - - return THREE.SmoothShading; - - } else { - - return THREE.FlatShading; - - } + return false; } - return false; + if ( materialNeedsSmoothNormals( material ) ) { + + return THREE.SmoothShading; + + } else { + + return THREE.FlatShading; + + } }; - function bufferGuessUVType( materials, geometryGroup, object ) { - - var i, m, ml = materials.length; + function bufferGuessUVType( material ) { // material must use some texture to require uvs - for ( i = 0; i < ml; i++ ) { + if ( material.map || material.lightMap || material instanceof THREE.ShaderMaterial ) { - m = materials[ i ]; - - if ( m.map || m.lightMap || m instanceof THREE.ShaderMaterial ) { - - return true; - - } + return true; } From 81b60ea2f6f56d42a7a1edeeba4baaf173d2d7dc Mon Sep 17 00:00:00 2001 From: alteredq Date: Fri, 21 Oct 2011 06:18:59 +0200 Subject: [PATCH 27/33] All WebGL examples working with array-less materials. Noticeable difference: can't anymore assign Material references to faces directly - "face.materials" became "face.materialIndex". Materials have to go to "geometry.materials" array (to which "face.materialIndex" points). This is necessary to allow run-time changing of face materials (this indirection used to be done by arrays). Some casualties: - multi-materials example, this functionality isn't possible anymore - had to simplify LOD Text examples as LODs don't handle groups (used to fake multi-materials) - multi-materials sphere in materials example can't have faces with undefined materials (this may be fixable I guess, when there'll be some real use-case) - scene format still has materials arrays, only the last material will be used (except when there are face materials, then materials from JSON will be used, as before) Other renderers and their corresponding examples were not touched yet. WebGLRenderer still needs some prettification, some things don't make sense anymore without arrays, code can be cleaned up further. --- build/Three.js | 907 +++++++++--------- build/custom/ThreeCanvas.js | 13 +- build/custom/ThreeDOM.js | 7 +- build/custom/ThreeExtras.js | 275 +++--- build/custom/ThreeSVG.js | 11 +- build/custom/ThreeWebGL.js | 523 +++++----- examples/misc_lights_test.html | 11 +- examples/misc_materials_multimaterials.html | 57 +- examples/misc_ubiquity_test.html | 29 +- examples/obj/Qrcode.js | 11 +- examples/webgl_collisions_box.html | 6 +- examples/webgl_collisions_mesh.html | 8 +- examples/webgl_collisions_normal.html | 12 +- examples/webgl_collisions_primitives.html | 10 +- examples/webgl_collisions_trigger.html | 4 +- examples/webgl_geometries.html | 23 +- .../webgl_geometry_blenderexport_colors.html | 1 + examples/webgl_geometry_colors.html | 28 +- examples/webgl_geometry_shapes.html | 2 +- examples/webgl_geometry_subdivison.html | 48 +- examples/webgl_interactive_cubes.html | 8 +- examples/webgl_lod_text.html | 5 +- examples/webgl_materials.html | 13 +- examples/webgl_materials_cars_anaglyph.html | 13 +- ...webgl_materials_cars_camaro_crosseyed.html | 24 +- .../webgl_materials_cars_parallaxbarrier.html | 6 +- examples/webgl_materials_cubemap_dynamic.html | 121 +-- examples/webgl_materials_normalmap.html | 2 - examples/webgl_materials_shaders.html | 2 +- examples/webgl_multiple_canvases_circle.html | 36 +- examples/webgl_multiple_canvases_complex.html | 56 +- examples/webgl_multiple_canvases_grid.html | 56 +- examples/webgl_objconvert_test.html | 2 +- examples/webgl_particles_shapes.html | 12 +- examples/webgl_scene_test.html | 16 +- examples/webgl_shadowmap.html | 2 +- src/extras/SceneUtils.js | 16 + src/extras/loaders/SceneLoader.js | 14 +- src/renderers/WebGLRenderer.js | 24 +- 39 files changed, 1176 insertions(+), 1238 deletions(-) diff --git a/build/Three.js b/build/Three.js index e1d92850..d3a5d12d 100644 --- a/build/Three.js +++ b/build/Three.js @@ -1,8 +1,8 @@ // Three.js r46dev - http://github.com/mrdoob/three.js var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;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.0010*(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},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var e,f,k;if(c==0)this.r=this.g=this.b=0;else switch(e=Math.floor(a*6),f=a*6-e,a=c*(1-b),k=c*(1- -b*f),b=c*(1-b*(1-f)),e){case 1:this.r=k;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=k;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=k;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ +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},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var e,f,h;if(c==0)this.r=this.g=this.b=0;else switch(e=Math.floor(a*6),f=a*6-e,a=c*(1-b),h=c*(1- +b*f),b=c*(1-b*(1-f)),e){case 1:this.r=h;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=h;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=h;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, @@ -16,39 +16,39 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,e){this.x= 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.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,e=[];b=0;for(c=a.length;b0&&a>0&&k+a<1}for(var e,f=[],k=0,h=a.children.length;ka.scale.x)return[];e={distance:k,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){k=b(this.origin, -this.direction,a.matrixWorld.getPosition());if(k==null||k>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var l,n,o,u,p,v,t,y,x=a.geometry,w=x.vertices,k=0,h=x.faces.length;k0:v<0)))if(v=p.dot((new THREE.Vector3).sub(l,t))/v,t=t.addSelf(y.multiplyScalar(v)),e instanceof THREE.Face3)c(t,l,n,o)&&(e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(t,l,n,u)||c(t,n,o,u)))e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e)}return f}}; -THREE.Rectangle=function(){function a(){k=e-b;h=f-c}var b,c,e,f,k,h,l=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return k};this.getHeight=function(){return h};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(k,h,u,p){l=!1;b=k;c=h;e=u;f=p;a()};this.addPoint=function(k,h){l?(l=!1,b=k,c=h,e=k,f=h):(b=bk?e:k,f=f>h?f:h);a()};this.add3Points= -function(k,h,u,p,v,t){l?(l=!1,b=ku?k>v?k:v:u>v?u:v,f=h>p?h>t?h:t:p>t?p:t):(b=ku?k>v?k>e?k:e:v>e?v:e:u>v?u>e?u:e:v>e?v:e,f=h>p?h>t?h>f?h:f:t>f?t:f:p>t?p>f?p:f:t>f?t:f);a()};this.addRectangle=function(k){l?(l=!1,b=k.getLeft(),c=k.getTop(),e=k.getRight(),f=k.getBottom()):(b=bk.getRight()?e:k.getRight(),f=f> +b=b.clone().subSelf(c),f=a.clone().subSelf(c),a=e.dot(e),c=e.dot(b),e=e.dot(f),k=b.dot(b),b=b.dot(f),f=1/(a*k-c*c),k=(k*e-c*b)*f,a=(a*b-c*e)*f;return k>0&&a>0&&k+a<1}for(var e,f=[],h=0,k=a.children.length;ha.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h=b(this.origin, +this.direction,a.matrixWorld.getPosition());if(h==null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var l,m,t,u,p,v,o,z,x=a.geometry,w=x.vertices,h=0,k=x.faces.length;h0:v<0)))if(v=p.dot((new THREE.Vector3).sub(l,o))/v,o=o.addSelf(z.multiplyScalar(v)),e instanceof THREE.Face3)c(o,l,m,t)&&(e={distance:this.origin.distanceTo(o),point:o,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(o,l,m,u)||c(o,m,t,u)))e={distance:this.origin.distanceTo(o),point:o,face:e,object:a},f.push(e)}return f}}; +THREE.Rectangle=function(){function a(){h=e-b;k=f-c}var b,c,e,f,h,k,l=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return k};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(k,h,u,p){l=!1;b=k;c=h;e=u;f=p;a()};this.addPoint=function(k,h){l?(l=!1,b=k,c=h,e=k,f=h):(b=bk?e:k,f=f>h?f:h);a()};this.add3Points= +function(k,h,u,p,v,o){l?(l=!1,b=ku?k>v?k:v:u>v?u:v,f=h>p?h>o?h:o:p>o?p:o):(b=ku?k>v?k>e?k:e:v>e?v:e:u>v?u>e?u:e:v>e?v:e,f=h>p?h>o?h>f?h:f:o>f?o:f:p>o?p>f?p:f:o>f?o:f);a()};this.addRectangle=function(k){l?(l=!1,b=k.getLeft(),c=k.getTop(),e=k.getRight(),f=k.getBottom()):(b=bk.getRight()?e:k.getRight(),f=f> k.getBottom()?f:k.getBottom());a()};this.inflate=function(k){b-=k;c-=k;e+=k;f+=k;a()};this.minSelf=function(k){b=b>k.getLeft()?b:k.getLeft();c=c>k.getTop()?c:k.getTop();e=e=0&&Math.min(f,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){l=!0;f=e=c=b=0;a()};this.isEmpty=function(){return l}}; THREE.Math={clamp:function(a,b,c){return ac?c:a},clampBottom:function(a,b){return a=0&&k>=0&&h>=0&&l>=0?!0:f<0&&k<0||h<0&&l<0?!1:(f<0?b=Math.max(b,f/(f-k)):k<0&&(e=Math.min(e,f/(f-k))),h<0?b=Math.max(b,h/(h-l)):l<0&&(e=Math.min(e,h/(h-l))),em&&h.positionScreen.z0&&F.z<1))aa=z[A]=z[A]||new THREE.RenderableParticle,A++,B=aa,B.x=F.x/F.w,B.y=F.y/F.w,B.z=F.z,B.rotation=X.rotation.z,B.scale.x=X.scale.x*Math.abs(B.x-(F.x+f.projectionMatrix.n11)/(F.w+f.projectionMatrix.n14)),B.scale.y=X.scale.y*Math.abs(B.y-(F.y+f.projectionMatrix.n22)/(F.w+f.projectionMatrix.n24)),B.materials=X.materials,E.push(B);k&&E.sort(b);return E}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; -THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),k=Math.cos(c),c=Math.sin(c),h=a*b,l=e*f;this.w=h*k-l*c;this.x=h*c+l*k;this.y=e*b*k+a*f*c;this.z=a*f*k-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c); +THREE.Projector=function(){function a(){var a=m[l]=m[l]||new THREE.RenderableVertex;l++;return a}function b(a,c){return c.z-a.z}function c(a,c){var b=0,e=1,f=a.z+a.w,k=c.z+c.w,h=-a.z+a.w,l=-c.z+c.w;return f>=0&&k>=0&&h>=0&&l>=0?!0:f<0&&k<0||h<0&&l<0?!1:(f<0?b=Math.max(b,f/(f-k)):k<0&&(e=Math.min(e,f/(f-k))),h<0?b=Math.max(b,h/(h-l)):l<0&&(e=Math.min(e,h/(h-l))),eE&&k.positionScreen.z0&&F.z<1))fa=A[y]=A[y]||new THREE.RenderableParticle,y++,B=fa,B.x=F.x/F.w,B.y=F.y/F.w,B.z=F.z,B.rotation=T.rotation.z,B.scale.x=T.scale.x*Math.abs(B.x-(F.x+f.projectionMatrix.n11)/(F.w+f.projectionMatrix.n14)),B.scale.y=T.scale.y*Math.abs(B.y-(F.y+f.projectionMatrix.n22)/(F.w+f.projectionMatrix.n24)),B.materials=T.materials,C.push(B);h&&C.sort(b);return C}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; +THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),h=Math.cos(c),c=Math.sin(c),k=a*b,l=e*f;this.w=k*h-l*c;this.x=k*c+l*h;this.y=e*b*h+a*f*c;this.z=a*f*h-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c); this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;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,e=this.z,f=this.w,k=a.x,h=a.y,l=a.z,a=a.w;this.x=b*a+f*k+c*l-e*h;this.y=c*a+f*h+e*k-b*l;this.z=e*a+f*l+b*h-c*k;this.w=f*a-b*k-c*h-e*l;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,e=a.y,f=a.z,k=this.x,h=this.y,l=this.z,n=this.w,o=n*c+h*f-l*e,u=n*e+l*c-k*f,p=n*f+k*e-h*c,c=-k* -c-h*e-l*f;b.x=o*n+c*-k+u*-l-p*-h;b.y=u*n+c*-h+p*-k-o*-l;b.z=p*n+c*-l+o*-h-u*-k;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var k=Math.acos(f),h=Math.sqrt(1-f*f);if(Math.abs(h)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*k)/h;e=Math.sin(e*k)/h;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; -THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,e,f,k){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=k;this.centroid=new THREE.Vector3}; -THREE.Face4=function(a,b,c,e,f,k,h){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=k instanceof THREE.Color?k:new THREE.Color;this.vertexColors=k instanceof Array?k:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; +this.x,c=this.y,e=this.z,f=this.w,h=a.x,k=a.y,l=a.z,a=a.w;this.x=b*a+f*h+c*l-e*k;this.y=c*a+f*k+e*h-b*l;this.z=e*a+f*l+b*k-c*h;this.w=f*a-b*h-c*k-e*l;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,e=a.y,f=a.z,h=this.x,k=this.y,l=this.z,m=this.w,t=m*c+k*f-l*e,u=m*e+l*c-h*f,p=m*f+h*e-k*c,c=-h* +c-k*e-l*f;b.x=t*m+c*-h+u*-l-p*-k;b.y=u*m+c*-k+p*-h-t*-l;b.z=p*m+c*-l+t*-k-u*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),k=Math.sqrt(1-f*f);if(Math.abs(k)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/k;e=Math.sin(e*h)/k;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; +THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,e,f,h){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3}; +THREE.Face4=function(a,b,c,e,f,h,k){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materialIndex=k;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}}; THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; -THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, +c.vertexNormals[1].copy(e[c.b]),c.vertexNormals[2].copy(e[c.c]),c.vertexNormals[3].copy(e[c.d]))},computeTangents:function(){function a(a,c,b,e,f,h,G){l=a.vertices[c].position;m=a.vertices[b].position;t=a.vertices[e].position;u=k[f];p=k[h];v=k[G];o=m.x-l.x;z=t.x-l.x;x=m.y-l.y;w=t.y-l.y;B=m.z-l.z;y=t.z-l.z;A=p.u-u.u;E=v.u-u.u;C=p.v-u.v;L=v.v-u.v;F=1/(A*L-E*C);H.set((L*o-C*z)*F,(L*x-C*w)*F,(L*B-C*y)*F);S.set((A*z-E*o)*F,(A*w-E*x)*F,(A*y-E*B)*F);N[c].addSelf(H);N[b].addSelf(H);N[e].addSelf(H);R[c].addSelf(S); +R[b].addSelf(S);R[e].addSelf(S)}var b,c,e,f,h,k,l,m,t,u,p,v,o,z,x,w,B,y,A,E,C,L,F,G,N=[],R=[],H=new THREE.Vector3,S=new THREE.Vector3,J=new THREE.Vector3,V=new THREE.Vector3,X=new THREE.Vector3;b=0;for(c=this.vertices.length;b0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;bthis.points.length-2?k:k+1;c[3]=k>this.points.length-3?k:k+2;o=this.points[c[0]];u=this.points[c[1]]; -p=this.points[c[2]];v=this.points[c[3]];l=h*h;n=h*l;e.x=b(o.x,u.x,p.x,v.x,h,l,n);e.y=b(o.y,u.y,p.y,v.y,h,l,n);e.z=b(o.z,u.z,p.z,v.z,h,l,n);return e};this.getControlPointsArray=function(){var a,c,b=this.points.length,e=[];for(a=0;athis.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;bthis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;t=this.points[c[0]];u=this.points[c[1]]; +p=this.points[c[2]];v=this.points[c[3]];l=k*k;m=k*l;e.x=b(t.x,u.x,p.x,v.x,k,l,m);e.y=b(t.y,u.y,p.y,v.y,k,l,m);e.z=b(t.z,u.z,p.z,v.z,k,l,m);return e};this.getControlPointsArray=function(){var a,c,b=this.points.length,e=[];for(a=0;athis.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;a=THREE.Math.clamp(Math.floor(this.time/b),0,this.geometry.morphTargets.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; @@ -151,49 +151,49 @@ THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)th THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),b!==-1&&this.__objectsAdded.splice(b,1)));for(b=0;b0&&(c(THREE.NormalBlending),b(1),f("rgba("+Math.floor(y.r*255)+","+Math.floor(y.g*255)+","+ -Math.floor(y.b*255)+","+x+")"),t.fillRect(Math.floor(H.getX()),Math.floor(H.getY()),Math.floor(H.getWidth()),Math.floor(H.getHeight()))),H.empty())};this.render=function(a,n){function o(a){var c,b,e,f=a.lights;Y.setRGB(0,0,0);N.setRGB(0,0,0);na.setRGB(0,0,0);a=0;for(c=f.length;a>1,wa=o.height>>1,h=k.scale.x*p,n=k.scale.y*v,m=h*u,l=n*wa,L.set(a.x-m,a.y-l,a.x+m,a.y+l),xa.intersects(L)&&(t.save(),t.translate(a.x,a.y),t.rotate(-k.rotation),t.scale(h,-n),t.translate(-u,-wa),t.drawImage(o,0,0),t.restore())}else h instanceof THREE.ParticleCanvasMaterial&&(m=k.scale.x*p,l=k.scale.y*v,L.set(a.x-m,a.y-l,a.x+m,a.y+l),xa.intersects(L)&&(e(h.color.getContextStyle()),f(h.color.getContextStyle()),t.save(),t.translate(a.x,a.y),t.rotate(-k.rotation),t.scale(m,l),h.program(t), -t.restore()))}function w(a,f,k,h){b(h.opacity);c(h.blending);t.beginPath();t.moveTo(a.positionScreen.x,a.positionScreen.y);t.lineTo(f.positionScreen.x,f.positionScreen.y);t.closePath();if(h instanceof THREE.LineBasicMaterial){a=h.linewidth;if(C!=a)t.lineWidth=C=a;a=h.linecap;if(E!=a)t.lineCap=E=a;a=h.linejoin;if(G!=a)t.lineJoin=G=a;e(h.color.getContextStyle());t.stroke();L.inflate(h.linewidth*2)}}function y(a,e,f,h,l,o,p,t,v){k.info.render.vertices+=3;k.info.render.faces++;b(t.opacity);c(t.blending); -O=a.positionScreen.x;W=a.positionScreen.y;S=e.positionScreen.x;m=e.positionScreen.y;ca=f.positionScreen.x;Q=f.positionScreen.y;B(O,W,S,m,ca,Q);if(t instanceof THREE.MeshBasicMaterial)if(t.map)t.map.mapping instanceof THREE.UVMapping&&(ma=p.uvs[0],Za(O,W,S,m,ca,Q,ma[h].u,ma[h].v,ma[l].u,ma[l].v,ma[o].u,ma[o].v,t.map));else if(t.envMap){if(t.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=n.matrixWorldInverse,va.copy(p.vertexNormalsWorld[0]),sa=(va.x*a.n11+va.y*a.n12+va.z*a.n13)*0.5+0.5, -Aa=-(va.x*a.n21+va.y*a.n22+va.z*a.n23)*0.5+0.5,va.copy(p.vertexNormalsWorld[1]),Da=(va.x*a.n11+va.y*a.n12+va.z*a.n13)*0.5+0.5,Ca=-(va.x*a.n21+va.y*a.n22+va.z*a.n23)*0.5+0.5,va.copy(p.vertexNormalsWorld[2]),Ba=(va.x*a.n11+va.y*a.n12+va.z*a.n13)*0.5+0.5,Ea=-(va.x*a.n21+va.y*a.n22+va.z*a.n23)*0.5+0.5,Za(O,W,S,m,ca,Q,sa,Aa,Da,Ca,Ba,Ea,t.envMap)}else t.wireframe?La(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):Ma(t.color);else if(t instanceof THREE.MeshLambertMaterial)t.map&&!t.wireframe&& -(t.map.mapping instanceof THREE.UVMapping&&(ma=p.uvs[0],Za(O,W,S,m,ca,Q,ma[h].u,ma[h].v,ma[l].u,ma[l].v,ma[o].u,ma[o].v,t.map)),c(THREE.SubtractiveBlending)),Z?!t.wireframe&&t.shading==THREE.SmoothShading&&p.vertexNormalsWorld.length==3?(R.r=X.r=aa.r=Y.r,R.g=X.g=aa.g=Y.g,R.b=X.b=aa.b=Y.b,u(v,p.v1.positionWorld,p.vertexNormalsWorld[0],R),u(v,p.v2.positionWorld,p.vertexNormalsWorld[1],X),u(v,p.v3.positionWorld,p.vertexNormalsWorld[2],aa),R.r=Math.max(0,Math.min(t.color.r*R.r,1)),R.g=Math.max(0,Math.min(t.color.g* -R.g,1)),R.b=Math.max(0,Math.min(t.color.b*R.b,1)),X.r=Math.max(0,Math.min(t.color.r*X.r,1)),X.g=Math.max(0,Math.min(t.color.g*X.g,1)),X.b=Math.max(0,Math.min(t.color.b*X.b,1)),aa.r=Math.max(0,Math.min(t.color.r*aa.r,1)),aa.g=Math.max(0,Math.min(t.color.g*aa.g,1)),aa.b=Math.max(0,Math.min(t.color.b*aa.b,1)),ga.r=(X.r+aa.r)*0.5,ga.g=(X.g+aa.g)*0.5,ga.b=(X.b+aa.b)*0.5,qa=Wa(R,X,aa,ga),Ta(O,W,S,m,ca,Q,0,0,1,0,0,1,qa)):(fa.r=Y.r,fa.g=Y.g,fa.b=Y.b,u(v,p.centroidWorld,p.normalWorld,fa),$.r=Math.max(0,Math.min(t.color.r* -fa.r,1)),$.g=Math.max(0,Math.min(t.color.g*fa.g,1)),$.b=Math.max(0,Math.min(t.color.b*fa.b,1)),t.wireframe?La($,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):Ma($)):t.wireframe?La(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):Ma(t.color);else if(t instanceof THREE.MeshDepthMaterial)oa=n.near,la=n.far,R.r=R.g=R.b=1-Pa(a.positionScreen.z,oa,la),X.r=X.g=X.b=1-Pa(e.positionScreen.z,oa,la),aa.r=aa.g=aa.b=1-Pa(f.positionScreen.z,oa,la),ga.r=(X.r+aa.r)*0.5,ga.g=(X.g+ -aa.g)*0.5,ga.b=(X.b+aa.b)*0.5,qa=Wa(R,X,aa,ga),Ta(O,W,S,m,ca,Q,0,0,1,0,0,1,qa);else if(t instanceof THREE.MeshNormalMaterial)$.r=Ua(p.normalWorld.x),$.g=Ua(p.normalWorld.y),$.b=Ua(p.normalWorld.z),t.wireframe?La($,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):Ma($)}function A(a,e,f,h,l,o,t,p,v){k.info.render.vertices+=4;k.info.render.faces++;b(p.opacity);c(p.blending);if(p.map||p.envMap)y(a,e,h,0,1,3,t,p,v),y(l,f,o,1,2,3,t,p,v);else if(O=a.positionScreen.x,W=a.positionScreen.y,S=e.positionScreen.x, -m=e.positionScreen.y,ca=f.positionScreen.x,Q=f.positionScreen.y,ea=h.positionScreen.x,da=h.positionScreen.y,ka=l.positionScreen.x,ia=l.positionScreen.y,ha=o.positionScreen.x,ja=o.positionScreen.y,p instanceof THREE.MeshBasicMaterial)z(O,W,S,m,ca,Q,ea,da),p.wireframe?La(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ma(p.color);else if(p instanceof THREE.MeshLambertMaterial)Z?!p.wireframe&&p.shading==THREE.SmoothShading&&t.vertexNormalsWorld.length==4?(R.r=X.r=aa.r=ga.r=Y.r,R.g= -X.g=aa.g=ga.g=Y.g,R.b=X.b=aa.b=ga.b=Y.b,u(v,t.v1.positionWorld,t.vertexNormalsWorld[0],R),u(v,t.v2.positionWorld,t.vertexNormalsWorld[1],X),u(v,t.v4.positionWorld,t.vertexNormalsWorld[3],aa),u(v,t.v3.positionWorld,t.vertexNormalsWorld[2],ga),R.r=Math.max(0,Math.min(p.color.r*R.r,1)),R.g=Math.max(0,Math.min(p.color.g*R.g,1)),R.b=Math.max(0,Math.min(p.color.b*R.b,1)),X.r=Math.max(0,Math.min(p.color.r*X.r,1)),X.g=Math.max(0,Math.min(p.color.g*X.g,1)),X.b=Math.max(0,Math.min(p.color.b*X.b,1)),aa.r=Math.max(0, -Math.min(p.color.r*aa.r,1)),aa.g=Math.max(0,Math.min(p.color.g*aa.g,1)),aa.b=Math.max(0,Math.min(p.color.b*aa.b,1)),ga.r=Math.max(0,Math.min(p.color.r*ga.r,1)),ga.g=Math.max(0,Math.min(p.color.g*ga.g,1)),ga.b=Math.max(0,Math.min(p.color.b*ga.b,1)),qa=Wa(R,X,aa,ga),B(O,W,S,m,ea,da),Ta(O,W,S,m,ea,da,0,0,1,0,0,1,qa),B(ka,ia,ca,Q,ha,ja),Ta(ka,ia,ca,Q,ha,ja,1,0,1,1,0,1,qa)):(fa.r=Y.r,fa.g=Y.g,fa.b=Y.b,u(v,t.centroidWorld,t.normalWorld,fa),$.r=Math.max(0,Math.min(p.color.r*fa.r,1)),$.g=Math.max(0,Math.min(p.color.g* -fa.g,1)),$.b=Math.max(0,Math.min(p.color.b*fa.b,1)),z(O,W,S,m,ca,Q,ea,da),p.wireframe?La($,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ma($)):(z(O,W,S,m,ca,Q,ea,da),p.wireframe?La(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ma(p.color));else if(p instanceof THREE.MeshNormalMaterial)$.r=Ua(t.normalWorld.x),$.g=Ua(t.normalWorld.y),$.b=Ua(t.normalWorld.z),z(O,W,S,m,ca,Q,ea,da),p.wireframe?La($,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Ma($); -else if(p instanceof THREE.MeshDepthMaterial)oa=n.near,la=n.far,R.r=R.g=R.b=1-Pa(a.positionScreen.z,oa,la),X.r=X.g=X.b=1-Pa(e.positionScreen.z,oa,la),aa.r=aa.g=aa.b=1-Pa(h.positionScreen.z,oa,la),ga.r=ga.g=ga.b=1-Pa(f.positionScreen.z,oa,la),qa=Wa(R,X,aa,ga),B(O,W,S,m,ea,da),Ta(O,W,S,m,ea,da,0,0,1,0,0,1,qa),B(ka,ia,ca,Q,ha,ja),Ta(ka,ia,ca,Q,ha,ja,1,0,1,1,0,1,qa)}function B(a,c,b,e,f,k){t.beginPath();t.moveTo(a,c);t.lineTo(b,e);t.lineTo(f,k);t.lineTo(a,c);t.closePath()}function z(a,c,b,e,f,k,h,m){t.beginPath(); -t.moveTo(a,c);t.lineTo(b,e);t.lineTo(f,k);t.lineTo(h,m);t.lineTo(a,c);t.closePath()}function La(a,c,b,f){if(C!=c)t.lineWidth=C=c;if(E!=b)t.lineCap=E=b;if(G!=f)t.lineJoin=G=f;e(a.getContextStyle());t.stroke();L.inflate(c*2)}function Ma(a){f(a.getContextStyle());t.fill()}function Za(a,c,b,e,k,h,m,l,n,p,o,u,v){if(v.image.width!=0){if(v.needsUpdate==!0||ra[v.id]==void 0){var wa=v.wrapS==THREE.RepeatWrapping,H=v.wrapT==THREE.RepeatWrapping;ra[v.id]=t.createPattern(v.image,wa&&H?"repeat":wa&&!H?"repeat-x": -!wa&&H?"repeat-y":"no-repeat");v.needsUpdate=!1}f(ra[v.id]);var wa=v.offset.x/v.repeat.x,H=v.offset.y/v.repeat.y,x=(v.image.width-1)*v.repeat.x,v=(v.image.height-1)*v.repeat.y,m=(m+wa)*x,l=(l+H)*v,n=(n+wa)*x,p=(p+H)*v,o=(o+wa)*x,u=(u+H)*v;b-=a;e-=c;k-=a;h-=c;n-=m;p-=l;o-=m;u-=l;wa=1/(n*u-o*p);v=(u*b-p*k)*wa;p=(u*e-p*h)*wa;b=(n*k-o*b)*wa;e=(n*h-o*e)*wa;a=a-v*m-b*l;c=c-p*m-e*l;t.save();t.transform(v,p,b,e,a,c);t.fill();t.restore()}}function Ta(a,c,b,e,f,k,h,m,l,n,p,o,v){var u,wa;u=v.width-1;wa=v.height- -1;h*=u;m*=wa;l*=u;n*=wa;p*=u;o*=wa;b-=a;e-=c;f-=a;k-=c;l-=h;n-=m;p-=h;o-=m;wa=1/(l*o-p*n);u=(o*b-n*f)*wa;n=(o*e-n*k)*wa;b=(l*f-p*b)*wa;e=(l*k-p*e)*wa;a=a-u*h-b*m;c=c-n*h-e*m;t.save();t.transform(u,n,b,e,a,c);t.clip();t.drawImage(v,0,0);t.restore()}function Wa(a,c,b,e){var f=~~(a.r*255),k=~~(a.g*255),a=~~(a.b*255),h=~~(c.r*255),m=~~(c.g*255),c=~~(c.b*255),l=~~(b.r*255),n=~~(b.g*255),b=~~(b.b*255),p=~~(e.r*255),o=~~(e.g*255),e=~~(e.b*255);ta[0]=f<0?0:f>255?255:f;ta[1]=k<0?0:k>255?255:k;ta[2]=a<0?0: -a>255?255:a;ta[4]=h<0?0:h>255?255:h;ta[5]=m<0?0:m>255?255:m;ta[6]=c<0?0:c>255?255:c;ta[8]=l<0?0:l>255?255:l;ta[9]=n<0?0:n>255?255:n;ta[10]=b<0?0:b>255?255:b;ta[12]=p<0?0:p>255?255:p;ta[13]=o<0?0:o>255?255:o;ta[14]=e<0?0:e>255?255:e;Fa.putImageData(ya,0,0);U.drawImage(pa,0,0);return Ga}function Pa(a,c,b){a=(a-c)/(b-c);return a*a*(3-2*a)}function Ua(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function Na(a,c){var b=c.x-a.x,e=c.y-a.y,f=b*b+e*e;f!=0&&(f=1/Math.sqrt(f),b*=f,e*=f,c.x+=b,c.y+=e,a.x-=b,a.y-=e)}var Xa, -$a,ua,Ha,Oa,Va,Ya,za;this.autoClear?this.clear():t.setTransform(1,0,0,-1,p,v);k.info.render.vertices=0;k.info.render.faces=0;h=l.projectScene(a,n,this.sortElements);(Z=a.lights.length>0)&&o(a);Xa=0;for($a=h.length;Xa<$a;Xa++){ua=h[Xa];L.empty();if(ua instanceof THREE.RenderableParticle){F=ua;F.x*=p;F.y*=v;Ha=0;for(Oa=ua.materials.length;Ha0&&(c(THREE.NormalBlending),b(1),f("rgba("+Math.floor(z.r*255)+","+Math.floor(z.g*255)+","+ +Math.floor(z.b*255)+","+x+")"),o.fillRect(Math.floor(M.getX()),Math.floor(M.getY()),Math.floor(M.getWidth()),Math.floor(M.getHeight()))),M.empty())};this.render=function(a,m){function t(a){var c,b,e,f=a.lights;K.setRGB(0,0,0);ra.setRGB(0,0,0);wa.setRGB(0,0,0);a=0;for(c=f.length;a>1,va=t.height>>1,h=k.scale.x*p,m=k.scale.y*v,n=h*u,l=m*va,Y.set(a.x-n,a.y-l,a.x+n,a.y+l),Da.intersects(Y)&&(o.save(),o.translate(a.x,a.y),o.rotate(-k.rotation),o.scale(h,-m),o.translate(-u,-va),o.drawImage(t,0,0),o.restore())}else h instanceof THREE.ParticleCanvasMaterial&&(n=k.scale.x*p,l=k.scale.y*v,Y.set(a.x-n,a.y-l,a.x+n,a.y+l),Da.intersects(Y)&&(e(h.color.getContextStyle()),f(h.color.getContextStyle()),o.save(),o.translate(a.x,a.y),o.rotate(-k.rotation),o.scale(n,l),h.program(o), +o.restore()))}function x(a,f,k,h){b(h.opacity);c(h.blending);o.beginPath();o.moveTo(a.positionScreen.x,a.positionScreen.y);o.lineTo(f.positionScreen.x,f.positionScreen.y);o.closePath();if(h instanceof THREE.LineBasicMaterial){a=h.linewidth;if(E!=a)o.lineWidth=E=a;a=h.linecap;if(C!=a)o.lineCap=C=a;a=h.linejoin;if(L!=a)o.lineJoin=L=a;e(h.color.getContextStyle());o.stroke();Y.inflate(h.linewidth*2)}}function z(a,e,f,k,l,t,p,o,v){h.info.render.vertices+=3;h.info.render.faces++;b(o.opacity);c(o.blending); +J=a.positionScreen.x;V=a.positionScreen.y;X=e.positionScreen.x;O=e.positionScreen.y;n=f.positionScreen.x;U=f.positionScreen.y;B(J,V,X,O,n,U);if(o instanceof THREE.MeshBasicMaterial)if(o.map)o.map.mapping instanceof THREE.UVMapping&&(ma=p.uvs[0],$a(J,V,X,O,n,U,ma[k].u,ma[k].v,ma[l].u,ma[l].v,ma[t].u,ma[t].v,o.map));else if(o.envMap){if(o.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=m.matrixWorldInverse,ha.copy(p.vertexNormalsWorld[0]),na=(ha.x*a.n11+ha.y*a.n12+ha.z*a.n13)*0.5+0.5,pa= +-(ha.x*a.n21+ha.y*a.n22+ha.z*a.n23)*0.5+0.5,ha.copy(p.vertexNormalsWorld[1]),Ca=(ha.x*a.n11+ha.y*a.n12+ha.z*a.n13)*0.5+0.5,Fa=-(ha.x*a.n21+ha.y*a.n22+ha.z*a.n23)*0.5+0.5,ha.copy(p.vertexNormalsWorld[2]),Ea=(ha.x*a.n11+ha.y*a.n12+ha.z*a.n13)*0.5+0.5,za=-(ha.x*a.n21+ha.y*a.n22+ha.z*a.n23)*0.5+0.5,$a(J,V,X,O,n,U,na,pa,Ca,Fa,Ea,za,o.envMap)}else o.wireframe?Ma(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):Na(o.color);else if(o instanceof THREE.MeshLambertMaterial)o.map&&!o.wireframe&& +(o.map.mapping instanceof THREE.UVMapping&&(ma=p.uvs[0],$a(J,V,X,O,n,U,ma[k].u,ma[k].v,ma[l].u,ma[l].v,ma[t].u,ma[t].v,o.map)),c(THREE.SubtractiveBlending)),ia?!o.wireframe&&o.shading==THREE.SmoothShading&&p.vertexNormalsWorld.length==3?(Q.r=T.r=fa.r=K.r,Q.g=T.g=fa.g=K.g,Q.b=T.b=fa.b=K.b,u(v,p.v1.positionWorld,p.vertexNormalsWorld[0],Q),u(v,p.v2.positionWorld,p.vertexNormalsWorld[1],T),u(v,p.v3.positionWorld,p.vertexNormalsWorld[2],fa),Q.r=Math.max(0,Math.min(o.color.r*Q.r,1)),Q.g=Math.max(0,Math.min(o.color.g* +Q.g,1)),Q.b=Math.max(0,Math.min(o.color.b*Q.b,1)),T.r=Math.max(0,Math.min(o.color.r*T.r,1)),T.g=Math.max(0,Math.min(o.color.g*T.g,1)),T.b=Math.max(0,Math.min(o.color.b*T.b,1)),fa.r=Math.max(0,Math.min(o.color.r*fa.r,1)),fa.g=Math.max(0,Math.min(o.color.g*fa.g,1)),fa.b=Math.max(0,Math.min(o.color.b*fa.b,1)),ga.r=(T.r+fa.r)*0.5,ga.g=(T.g+fa.g)*0.5,ga.b=(T.b+fa.b)*0.5,sa=Xa(Q,T,fa,ga),Ua(J,V,X,O,n,U,0,0,1,0,0,1,sa)):(ja.r=K.r,ja.g=K.g,ja.b=K.b,u(v,p.centroidWorld,p.normalWorld,ja),Z.r=Math.max(0,Math.min(o.color.r* +ja.r,1)),Z.g=Math.max(0,Math.min(o.color.g*ja.g,1)),Z.b=Math.max(0,Math.min(o.color.b*ja.b,1)),o.wireframe?Ma(Z,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):Na(Z)):o.wireframe?Ma(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):Na(o.color);else if(o instanceof THREE.MeshDepthMaterial)oa=m.near,da=m.far,Q.r=Q.g=Q.b=1-Qa(a.positionScreen.z,oa,da),T.r=T.g=T.b=1-Qa(e.positionScreen.z,oa,da),fa.r=fa.g=fa.b=1-Qa(f.positionScreen.z,oa,da),ga.r=(T.r+fa.r)*0.5,ga.g=(T.g+ +fa.g)*0.5,ga.b=(T.b+fa.b)*0.5,sa=Xa(Q,T,fa,ga),Ua(J,V,X,O,n,U,0,0,1,0,0,1,sa);else if(o instanceof THREE.MeshNormalMaterial)Z.r=Va(p.normalWorld.x),Z.g=Va(p.normalWorld.y),Z.b=Va(p.normalWorld.z),o.wireframe?Ma(Z,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):Na(Z)}function y(a,e,f,k,l,t,o,p,v){h.info.render.vertices+=4;h.info.render.faces++;b(p.opacity);c(p.blending);if(p.map||p.envMap)z(a,e,k,0,1,3,o,p,v),z(l,f,t,1,2,3,o,p,v);else if(J=a.positionScreen.x,V=a.positionScreen.y,X=e.positionScreen.x, +O=e.positionScreen.y,n=f.positionScreen.x,U=f.positionScreen.y,$=k.positionScreen.x,aa=k.positionScreen.y,ca=l.positionScreen.x,ea=l.positionScreen.y,la=t.positionScreen.x,ka=t.positionScreen.y,p instanceof THREE.MeshBasicMaterial)A(J,V,X,O,n,U,$,aa),p.wireframe?Ma(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Na(p.color);else if(p instanceof THREE.MeshLambertMaterial)ia?!p.wireframe&&p.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==4?(Q.r=T.r=fa.r=ga.r=K.r,Q.g= +T.g=fa.g=ga.g=K.g,Q.b=T.b=fa.b=ga.b=K.b,u(v,o.v1.positionWorld,o.vertexNormalsWorld[0],Q),u(v,o.v2.positionWorld,o.vertexNormalsWorld[1],T),u(v,o.v4.positionWorld,o.vertexNormalsWorld[3],fa),u(v,o.v3.positionWorld,o.vertexNormalsWorld[2],ga),Q.r=Math.max(0,Math.min(p.color.r*Q.r,1)),Q.g=Math.max(0,Math.min(p.color.g*Q.g,1)),Q.b=Math.max(0,Math.min(p.color.b*Q.b,1)),T.r=Math.max(0,Math.min(p.color.r*T.r,1)),T.g=Math.max(0,Math.min(p.color.g*T.g,1)),T.b=Math.max(0,Math.min(p.color.b*T.b,1)),fa.r=Math.max(0, +Math.min(p.color.r*fa.r,1)),fa.g=Math.max(0,Math.min(p.color.g*fa.g,1)),fa.b=Math.max(0,Math.min(p.color.b*fa.b,1)),ga.r=Math.max(0,Math.min(p.color.r*ga.r,1)),ga.g=Math.max(0,Math.min(p.color.g*ga.g,1)),ga.b=Math.max(0,Math.min(p.color.b*ga.b,1)),sa=Xa(Q,T,fa,ga),B(J,V,X,O,$,aa),Ua(J,V,X,O,$,aa,0,0,1,0,0,1,sa),B(ca,ea,n,U,la,ka),Ua(ca,ea,n,U,la,ka,1,0,1,1,0,1,sa)):(ja.r=K.r,ja.g=K.g,ja.b=K.b,u(v,o.centroidWorld,o.normalWorld,ja),Z.r=Math.max(0,Math.min(p.color.r*ja.r,1)),Z.g=Math.max(0,Math.min(p.color.g* +ja.g,1)),Z.b=Math.max(0,Math.min(p.color.b*ja.b,1)),A(J,V,X,O,n,U,$,aa),p.wireframe?Ma(Z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Na(Z)):(A(J,V,X,O,n,U,$,aa),p.wireframe?Ma(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Na(p.color));else if(p instanceof THREE.MeshNormalMaterial)Z.r=Va(o.normalWorld.x),Z.g=Va(o.normalWorld.y),Z.b=Va(o.normalWorld.z),A(J,V,X,O,n,U,$,aa),p.wireframe?Ma(Z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Na(Z);else if(p instanceof +THREE.MeshDepthMaterial)oa=m.near,da=m.far,Q.r=Q.g=Q.b=1-Qa(a.positionScreen.z,oa,da),T.r=T.g=T.b=1-Qa(e.positionScreen.z,oa,da),fa.r=fa.g=fa.b=1-Qa(k.positionScreen.z,oa,da),ga.r=ga.g=ga.b=1-Qa(f.positionScreen.z,oa,da),sa=Xa(Q,T,fa,ga),B(J,V,X,O,$,aa),Ua(J,V,X,O,$,aa,0,0,1,0,0,1,sa),B(ca,ea,n,U,la,ka),Ua(ca,ea,n,U,la,ka,1,0,1,1,0,1,sa)}function B(a,c,b,e,f,k){o.beginPath();o.moveTo(a,c);o.lineTo(b,e);o.lineTo(f,k);o.lineTo(a,c);o.closePath()}function A(a,c,b,e,f,k,h,n){o.beginPath();o.moveTo(a, +c);o.lineTo(b,e);o.lineTo(f,k);o.lineTo(h,n);o.lineTo(a,c);o.closePath()}function Ma(a,c,b,f){if(E!=c)o.lineWidth=E=c;if(C!=b)o.lineCap=C=b;if(L!=f)o.lineJoin=L=f;e(a.getContextStyle());o.stroke();Y.inflate(c*2)}function Na(a){f(a.getContextStyle());o.fill()}function $a(a,c,b,e,k,h,n,l,m,t,p,v,u){if(u.image.width!=0){if(u.needsUpdate==!0||qa[u.id]==void 0){var va=u.wrapS==THREE.RepeatWrapping,M=u.wrapT==THREE.RepeatWrapping;qa[u.id]=o.createPattern(u.image,va&&M?"repeat":va&&!M?"repeat-x":!va&&M? +"repeat-y":"no-repeat");u.needsUpdate=!1}f(qa[u.id]);var va=u.offset.x/u.repeat.x,M=u.offset.y/u.repeat.y,w=(u.image.width-1)*u.repeat.x,u=(u.image.height-1)*u.repeat.y,n=(n+va)*w,l=(l+M)*u,m=(m+va)*w,t=(t+M)*u,p=(p+va)*w,v=(v+M)*u;b-=a;e-=c;k-=a;h-=c;m-=n;t-=l;p-=n;v-=l;va=1/(m*v-p*t);u=(v*b-t*k)*va;t=(v*e-t*h)*va;b=(m*k-p*b)*va;e=(m*h-p*e)*va;a=a-u*n-b*l;c=c-t*n-e*l;o.save();o.transform(u,t,b,e,a,c);o.fill();o.restore()}}function Ua(a,c,b,e,f,k,h,n,l,m,t,p,u){var v,va;v=u.width-1;va=u.height-1; +h*=v;n*=va;l*=v;m*=va;t*=v;p*=va;b-=a;e-=c;f-=a;k-=c;l-=h;m-=n;t-=h;p-=n;va=1/(l*p-t*m);v=(p*b-m*f)*va;m=(p*e-m*k)*va;b=(l*f-t*b)*va;e=(l*k-t*e)*va;a=a-v*h-b*n;c=c-m*h-e*n;o.save();o.transform(v,m,b,e,a,c);o.clip();o.drawImage(u,0,0);o.restore()}function Xa(a,c,b,e){var f=~~(a.r*255),k=~~(a.g*255),a=~~(a.b*255),h=~~(c.r*255),n=~~(c.g*255),c=~~(c.b*255),l=~~(b.r*255),m=~~(b.g*255),b=~~(b.b*255),t=~~(e.r*255),p=~~(e.g*255),e=~~(e.b*255);Ba[0]=f<0?0:f>255?255:f;Ba[1]=k<0?0:k>255?255:k;Ba[2]=a<0?0:a> +255?255:a;Ba[4]=h<0?0:h>255?255:h;Ba[5]=n<0?0:n>255?255:n;Ba[6]=c<0?0:c>255?255:c;Ba[8]=l<0?0:l>255?255:l;Ba[9]=m<0?0:m>255?255:m;Ba[10]=b<0?0:b>255?255:b;Ba[12]=t<0?0:t>255?255:t;Ba[13]=p<0?0:p>255?255:p;Ba[14]=e<0?0:e>255?255:e;ua.putImageData(ya,0,0);Ia.drawImage(xa,0,0);return Ha}function Qa(a,c,b){a=(a-c)/(b-c);return a*a*(3-2*a)}function Va(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function Oa(a,c){var b=c.x-a.x,e=c.y-a.y,f=b*b+e*e;f!=0&&(f=1/Math.sqrt(f),b*=f,e*=f,c.x+=b,c.y+=e,a.x-=b,a.y-=e)}var Ya, +ab,ta,Ga,Pa,Wa,Za,Aa;this.autoClear?this.clear():o.setTransform(1,0,0,-1,p,v);h.info.render.vertices=0;h.info.render.faces=0;k=l.projectScene(a,m,this.sortElements);(ia=a.lights.length>0)&&t(a);Ya=0;for(ab=k.length;Ya0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h)):k instanceof THREE.PointLight&&(V.sub(k.position,c.centroidWorld),V.normalize(),h=c.normalWorld.dot(V)*k.intensity,h>0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h))}function b(c,b,h,m,l,p){k.info.render.vertices+=3;k.info.render.faces++;O=e(W++); -O.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+"z");l instanceof THREE.MeshBasicMaterial?C.copy(l.color):l instanceof THREE.MeshLambertMaterial?z?(E.r=G.r,E.g=G.g,E.b=G.b,a(p,m,E),C.r=Math.max(0,Math.min(l.color.r*E.r,1)),C.g=Math.max(0,Math.min(l.color.g*E.g,1)),C.b=Math.max(0,Math.min(l.color.b*E.b,1))):C.copy(l.color):l instanceof THREE.MeshDepthMaterial?(M=1-l.__2near/(l.__farPlusNear- -m.z*l.__farMinusNear),C.setRGB(M,M,M)):l instanceof THREE.MeshNormalMaterial&&C.setRGB(f(m.normalWorld.x),f(m.normalWorld.y),f(m.normalWorld.z));l.wireframe?O.setAttribute("style","fill: none; stroke: "+C.getContextStyle()+"; stroke-width: "+l.wireframeLinewidth+"; stroke-opacity: "+l.opacity+"; stroke-linecap: "+l.wireframeLinecap+"; stroke-linejoin: "+l.wireframeLinejoin):O.setAttribute("style","fill: "+C.getContextStyle()+"; fill-opacity: "+l.opacity);n.appendChild(O)}function c(c,b,h,m,l,p,o){k.info.render.vertices+= -4;k.info.render.faces++;O=e(W++);O.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+h.positionScreen.x+","+h.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");p instanceof THREE.MeshBasicMaterial?C.copy(p.color):p instanceof THREE.MeshLambertMaterial?z?(E.r=G.r,E.g=G.g,E.b=G.b,a(o,l,E),C.r=Math.max(0,Math.min(p.color.r*E.r,1)),C.g=Math.max(0,Math.min(p.color.g*E.g,1)),C.b=Math.max(0,Math.min(p.color.b*E.b,1))): -C.copy(p.color):p instanceof THREE.MeshDepthMaterial?(M=1-p.__2near/(p.__farPlusNear-l.z*p.__farMinusNear),C.setRGB(M,M,M)):p instanceof THREE.MeshNormalMaterial&&C.setRGB(f(l.normalWorld.x),f(l.normalWorld.y),f(l.normalWorld.z));p.wireframe?O.setAttribute("style","fill: none; stroke: "+C.getContextStyle()+"; stroke-width: "+p.wireframeLinewidth+"; stroke-opacity: "+p.opacity+"; stroke-linecap: "+p.wireframeLinecap+"; stroke-linejoin: "+p.wireframeLinejoin):O.setAttribute("style","fill: "+C.getContextStyle()+ -"; fill-opacity: "+p.opacity);n.appendChild(O)}function e(a){J[a]==null&&(J[a]=document.createElementNS("http://www.w3.org/2000/svg","path"),m==0&&J[a].setAttribute("shape-rendering","crispEdges"));return J[a]}function f(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}var k=this,h=null,l=new THREE.Projector,n=document.createElementNS("http://www.w3.org/2000/svg","svg"),o,u,p,v,t,y,x,w,B=new THREE.Rectangle,A=new THREE.Rectangle,z=!1,C=new THREE.Color(16777215),E=new THREE.Color(16777215),G=new THREE.Color(0), -F=new THREE.Color(0),I=new THREE.Color(0),M,V=new THREE.Vector3,J=[],T=[],O,W,S,m=1;this.domElement=n;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(a){switch(a){case "high":m=1;break;case "low":m=0}};this.setSize=function(a,c){o=a;u=c;p=o/2;v=u/2;n.setAttribute("viewBox",-p+" "+-v+" "+o+" "+u);n.setAttribute("width",o);n.setAttribute("height",u);B.set(-p,-v,p,v)};this.clear=function(){for(;n.childNodes.length>0;)n.removeChild(n.childNodes[0])}; -this.render=function(a,e){var f,o,u,C,M,J,E,R;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;h=l.projectScene(a,e,this.sortElements);S=W=0;if(z=a.lights.length>0){E=a.lights;G.setRGB(0,0,0);F.setRGB(0,0,0);I.setRGB(0,0,0);f=0;for(o=E.length;f0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h)):k instanceof THREE.PointLight&&(R.sub(k.position,c.centroidWorld),R.normalize(),h=c.normalWorld.dot(R)*k.intensity,h>0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h))}function b(c,b,k,l,t,p){h.info.render.vertices+=3;h.info.render.faces++;J=e(V++); +J.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?E.copy(t.color):t instanceof THREE.MeshLambertMaterial?A?(C.r=L.r,C.g=L.g,C.b=L.b,a(p,l,C),E.r=Math.max(0,Math.min(t.color.r*C.r,1)),E.g=Math.max(0,Math.min(t.color.g*C.g,1)),E.b=Math.max(0,Math.min(t.color.b*C.b,1))):E.copy(t.color):t instanceof THREE.MeshDepthMaterial?(N=1-t.__2near/(t.__farPlusNear- +l.z*t.__farMinusNear),E.setRGB(N,N,N)):t instanceof THREE.MeshNormalMaterial&&E.setRGB(f(l.normalWorld.x),f(l.normalWorld.y),f(l.normalWorld.z));t.wireframe?J.setAttribute("style","fill: none; stroke: "+E.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):J.setAttribute("style","fill: "+E.getContextStyle()+"; fill-opacity: "+t.opacity);m.appendChild(J)}function c(c,b,k,l,t,p,o){h.info.render.vertices+= +4;h.info.render.faces++;J=e(V++);J.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+" L "+l.positionScreen.x+","+l.positionScreen.y+"z");p instanceof THREE.MeshBasicMaterial?E.copy(p.color):p instanceof THREE.MeshLambertMaterial?A?(C.r=L.r,C.g=L.g,C.b=L.b,a(o,t,C),E.r=Math.max(0,Math.min(p.color.r*C.r,1)),E.g=Math.max(0,Math.min(p.color.g*C.g,1)),E.b=Math.max(0,Math.min(p.color.b*C.b,1))): +E.copy(p.color):p instanceof THREE.MeshDepthMaterial?(N=1-p.__2near/(p.__farPlusNear-t.z*p.__farMinusNear),E.setRGB(N,N,N)):p instanceof THREE.MeshNormalMaterial&&E.setRGB(f(t.normalWorld.x),f(t.normalWorld.y),f(t.normalWorld.z));p.wireframe?J.setAttribute("style","fill: none; stroke: "+E.getContextStyle()+"; stroke-width: "+p.wireframeLinewidth+"; stroke-opacity: "+p.opacity+"; stroke-linecap: "+p.wireframeLinecap+"; stroke-linejoin: "+p.wireframeLinejoin):J.setAttribute("style","fill: "+E.getContextStyle()+ +"; fill-opacity: "+p.opacity);m.appendChild(J)}function e(a){H[a]==null&&(H[a]=document.createElementNS("http://www.w3.org/2000/svg","path"),O==0&&H[a].setAttribute("shape-rendering","crispEdges"));return H[a]}function f(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}var h=this,k=null,l=new THREE.Projector,m=document.createElementNS("http://www.w3.org/2000/svg","svg"),t,u,p,v,o,z,x,w,B=new THREE.Rectangle,y=new THREE.Rectangle,A=!1,E=new THREE.Color(16777215),C=new THREE.Color(16777215),L=new THREE.Color(0), +F=new THREE.Color(0),G=new THREE.Color(0),N,R=new THREE.Vector3,H=[],S=[],J,V,X,O=1;this.domElement=m;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,c){t=a;u=c;p=t/2;v=u/2;m.setAttribute("viewBox",-p+" "+-v+" "+t+" "+u);m.setAttribute("width",t);m.setAttribute("height",u);B.set(-p,-v,p,v)};this.clear=function(){for(;m.childNodes.length>0;)m.removeChild(m.childNodes[0])}; +this.render=function(a,e){var f,t,u,E,N,H,C,Q;this.autoClear&&this.clear();h.info.render.vertices=0;h.info.render.faces=0;k=l.projectScene(a,e,this.sortElements);X=V=0;if(A=a.lights.length>0){C=a.lights;L.setRGB(0,0,0);F.setRGB(0,0,0);G.setRGB(0,0,0);f=0;for(t=C.length;f=0)b&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglVertexBuffer),m.vertexAttribPointer(a.position,3,m.FLOAT,!1,0,0));else if(h.morphTargetBase){e=k.program.attributes;h.morphTargetBase!==-1?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[h.morphTargetBase]),m.vertexAttribPointer(e.position,3,m.FLOAT,!1,0,0)):e.position>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglVertexBuffer),m.vertexAttribPointer(e.position,3,m.FLOAT,!1,0,0));if(h.morphTargetForcedOrder.length){l= -0;var p=h.morphTargetForcedOrder;for(n=h.morphTargetInfluences;lo&&(t=v,o=n[t]);m.bindBuffer(m.ARRAY_BUFFER, -f.__webglMorphTargetsBuffers[t]);m.vertexAttribPointer(e["morphTarget"+l],3,m.FLOAT,!1,0,0);h.__webglMorphTargetInfluences[l]=o;p[t]=1;o=-1;l++}}k.program.uniforms.morphTargetInfluences!==null&&m.uniform1fv(k.program.uniforms.morphTargetInfluences,h.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){l=0;for(n=f.__webglCustomAttributesList.length;l=0&&(m.bindBuffer(m.ARRAY_BUFFER,e.buffer),m.vertexAttribPointer(a[e.buffer.belongsToAttribute], -e.size,m.FLOAT,!1,0,0))}a.color>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglColorBuffer),m.vertexAttribPointer(a.color,3,m.FLOAT,!1,0,0));a.normal>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglNormalBuffer),m.vertexAttribPointer(a.normal,3,m.FLOAT,!1,0,0));a.tangent>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglTangentBuffer),m.vertexAttribPointer(a.tangent,4,m.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglUVBuffer),m.vertexAttribPointer(a.uv,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(a.uv)): -m.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglUV2Buffer),m.vertexAttribPointer(a.uv2,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(a.uv2)):m.disableVertexAttribArray(a.uv2));k.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinVertexABuffer),m.vertexAttribPointer(a.skinVertexA,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),m.vertexAttribPointer(a.skinVertexB, -4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),m.vertexAttribPointer(a.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),m.vertexAttribPointer(a.skinWeight,4,m.FLOAT,!1,0,0))}h instanceof THREE.Mesh?(k.wireframe?(m.lineWidth(k.wireframeLinewidth),b&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),m.drawElements(m.LINES,f.__webglLineCount,m.UNSIGNED_SHORT,0)):(b&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),m.drawElements(m.TRIANGLES, -f.__webglFaceCount,m.UNSIGNED_SHORT,0)),S.info.render.calls++,S.info.render.vertices+=f.__webglFaceCount,S.info.render.faces+=f.__webglFaceCount/3):h instanceof THREE.Line?(h=h.type==THREE.LineStrip?m.LINE_STRIP:m.LINES,m.lineWidth(k.linewidth),m.drawArrays(h,0,f.__webglLineCount),S.info.render.calls++):h instanceof THREE.ParticleSystem?(m.drawArrays(m.POINTS,0,f.__webglParticleCount),S.info.render.calls++):h instanceof THREE.Ribbon&&(m.drawArrays(m.TRIANGLE_STRIP,0,f.__webglVertexCount),S.info.render.calls++)}} -function f(a,c,b){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=m.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=m.createBuffer();a.hasPos&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(c.attributes.position),m.vertexAttribPointer(c.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormal){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(b==THREE.FlatShading){var e,f,k,h,l,n,p,o,t,v,u=a.count* -3;for(v=0;v=0&&(c=c.geometry.materials[materialIndex],c.transparent?p(a,c):p(f,c))):(c=b)&&(c.transparent?p(a, -c):p(f,c))}function y(a,c){return c.z-a.z}function x(a){var b,l,n,p=0,t,v,H,w,x=a.lights;na||(na=new THREE.PerspectiveCamera(S.shadowCameraFov,S.shadowMapWidth/S.shadowMapHeight,S.shadowCameraNear,S.shadowCameraFar));b=0;for(l=x.length;b=0?c.geometry.materials[a.materialIndex]:c.material;if(b.attributes)for(var e in b.attributes)if(b.attributes[e].needsUpdate)return!0; -return!1}function z(a,c){var b=a.materialIndex>=0?c.geometry.materials[a.materialIndex]:c.material;if(b.attributes)for(var e in b.attributes)b.attributes[e].needsUpdate=!1}function C(a,c){var b;for(b=a.length-1;b>=0;b--)a[b].object==c&&a.splice(b,1)}function E(a,c,b){a.push({buffer:c,object:b,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function G(a){if(a!=$){switch(a){case THREE.AdditiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE);break;case THREE.SubtractiveBlending:m.blendEquation(m.FUNC_ADD); -m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.SRC_COLOR);break;default:m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)}$=a}}function F(a,c,b){(b.width&b.width-1)==0&&(b.height&b.height-1)==0?(m.texParameteri(a,m.TEXTURE_WRAP_S,W(c.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,W(c.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,W(c.magFilter)), -m.texParameteri(a,m.TEXTURE_MIN_FILTER,W(c.minFilter)),m.generateMipmap(a)):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,O(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,O(c.minFilter)))}function I(a,c){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=m.createTexture(),S.info.memory.textures++;m.activeTexture(m.TEXTURE0+c);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);a instanceof -THREE.DataTexture?m.texImage2D(m.TEXTURE_2D,0,W(a.format),a.image.width,a.image.height,0,W(a.format),m.UNSIGNED_BYTE,a.image.data):m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,a.image);F(m.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)}function M(a,c){m.bindRenderbuffer(m.RENDERBUFFER,a);c.depthBuffer&&!c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER, -m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):c.depthBuffer&&c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,c.width,c.height)}function V(a){var c=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=m.createTexture(); -if(c){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);F(m.TEXTURE_CUBE_MAP,a,a);for(var b=0;b<6;b++){a.__webglFramebuffer[b]=m.createFramebuffer();a.__webglRenderbuffer[b]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,W(a.format),a.width,a.height,0,W(a.format),W(a.type),null);var e=a,f=m.TEXTURE_CUBE_MAP_POSITIVE_X+b;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[b]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0, -f,e.__webglTexture,0);M(a.__webglRenderbuffer[b],a)}}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),F(m.TEXTURE_2D,a,a),m.texImage2D(m.TEXTURE_2D,0,W(a.format),a.width,a.height,0,W(a.format),W(a.type),null),b=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,b,a.__webglTexture,0),m.bindRenderbuffer(m.RENDERBUFFER,a.__webglRenderbuffer), -M(a.__webglRenderbuffer,a);c?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(c=c?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,b=a.width,a=a.height,f=e=0):(c=null,b=qa,a=ma,e=oa,f=la);c!=ea&&(m.bindFramebuffer(m.FRAMEBUFFER,c),m.viewport(e,f,b,a),ea=c)}function J(a){a instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP), -m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function T(a,c){var b;a=="fragment"?b=m.createShader(m.FRAGMENT_SHADER):a=="vertex"&&(b=m.createShader(m.VERTEX_SHADER));m.shaderSource(b,c);m.compileShader(b);if(!m.getShaderParameter(b,m.COMPILE_STATUS))return console.error(m.getShaderInfoLog(b)),console.error(c),null;return b}function O(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return m.NEAREST; -default:return m.LINEAR}}function W(a){switch(a){case THREE.RepeatWrapping:return m.REPEAT;case THREE.ClampToEdgeWrapping:return m.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return m.MIRRORED_REPEAT;case THREE.NearestFilter:return m.NEAREST;case THREE.NearestMipMapNearestFilter:return m.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return m.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return m.LINEAR;case THREE.LinearMipMapNearestFilter:return m.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return m.LINEAR_MIPMAP_LINEAR; -case THREE.ByteType:return m.BYTE;case THREE.UnsignedByteType:return m.UNSIGNED_BYTE;case THREE.ShortType:return m.SHORT;case THREE.UnsignedShortType:return m.UNSIGNED_SHORT;case THREE.IntType:return m.INT;case THREE.UnsignedShortType:return m.UNSIGNED_INT;case THREE.FloatType:return m.FLOAT;case THREE.AlphaFormat:return m.ALPHA;case THREE.RGBFormat:return m.RGB;case THREE.RGBAFormat:return m.RGBA;case THREE.LuminanceFormat:return m.LUMINANCE;case THREE.LuminanceAlphaFormat:return m.LUMINANCE_ALPHA}return 0} -var S=this,m,ca=[],Q=null,ea=null,da=-1,ka=null,ia=0,ha=null,ja=null,$=null,R=null,X=null,aa=null,ga=null,ra=null,oa=0,la=0,qa=0,ma=0,sa=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Aa=new THREE.Matrix4,Da=new Float32Array(16),Ca=new Float32Array(16),Ba=new THREE.Vector4,Ea={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},xa=a.canvas!==void 0?a.canvas:document.createElement("canvas"), -H=a.stencil!==void 0?a.stencil:!0,L=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,Z=a.antialias!==void 0?a.antialias:!1,fa=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),Y=a.clearAlpha!==void 0?a.clearAlpha:0,N=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=xa;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear= -!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var na,va=[],a=THREE.ShaderLib.depthRGBA,pa=THREE.UniformsUtils.clone(a.uniforms),Fa=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:pa}), -ya=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:pa,morphTargets:!0});Fa._shadowPass=!0;ya._shadowPass=!0;try{if(!(m=xa.getContext("experimental-webgl",{antialias:Z,stencil:H,preserveDrawingBuffer:L})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+m.getParameter(m.VERSION)+" | "+m.getParameter(m.VENDOR)+" | "+m.getParameter(m.RENDERER)+" | "+m.getParameter(m.SHADING_LANGUAGE_VERSION))}catch(ta){console.error(ta)}m.clearColor(0, -0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.clearColor(fa.r,fa.g,fa.b,Y);this.context=m;var Ga=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,U={};U.vertices=new Float32Array(16);U.faces=new Uint16Array(6);H=0;U.vertices[H++]=-1;U.vertices[H++]=-1;U.vertices[H++]=0;U.vertices[H++]=1;U.vertices[H++]= -1;U.vertices[H++]=-1;U.vertices[H++]=1;U.vertices[H++]=1;U.vertices[H++]=1;U.vertices[H++]=1;U.vertices[H++]=1;U.vertices[H++]=0;U.vertices[H++]=-1;U.vertices[H++]=1;U.vertices[H++]=0;H=U.vertices[H++]=0;U.faces[H++]=0;U.faces[H++]=1;U.faces[H++]=2;U.faces[H++]=0;U.faces[H++]=2;U.faces[H++]=3;U.vertexBuffer=m.createBuffer();U.elementBuffer=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,U.vertexBuffer);m.bufferData(m.ARRAY_BUFFER,U.vertices,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,U.elementBuffer); -m.bufferData(m.ELEMENT_ARRAY_BUFFER,U.faces,m.STATIC_DRAW);U.program=m.createProgram();m.attachShader(U.program,T("fragment",THREE.ShaderLib.sprite.fragmentShader));m.attachShader(U.program,T("vertex",THREE.ShaderLib.sprite.vertexShader));m.linkProgram(U.program);U.attributes={};U.uniforms={};U.attributes.position=m.getAttribLocation(U.program,"position");U.attributes.uv=m.getAttribLocation(U.program,"uv");U.uniforms.uvOffset=m.getUniformLocation(U.program,"uvOffset");U.uniforms.uvScale=m.getUniformLocation(U.program, -"uvScale");U.uniforms.rotation=m.getUniformLocation(U.program,"rotation");U.uniforms.scale=m.getUniformLocation(U.program,"scale");U.uniforms.alignment=m.getUniformLocation(U.program,"alignment");U.uniforms.color=m.getUniformLocation(U.program,"color");U.uniforms.map=m.getUniformLocation(U.program,"map");U.uniforms.opacity=m.getUniformLocation(U.program,"opacity");U.uniforms.useScreenCoordinates=m.getUniformLocation(U.program,"useScreenCoordinates");U.uniforms.affectedByDistance=m.getUniformLocation(U.program, -"affectedByDistance");U.uniforms.screenPosition=m.getUniformLocation(U.program,"screenPosition");U.uniforms.modelViewMatrix=m.getUniformLocation(U.program,"modelViewMatrix");U.uniforms.projectionMatrix=m.getUniformLocation(U.program,"projectionMatrix");var Ia=!1;this.setSize=function(a,c){xa.width=a;xa.height=c;this.setViewport(0,0,xa.width,xa.height)};this.setViewport=function(a,c,b,e){oa=a;la=c;qa=b;ma=e;m.viewport(oa,la,qa,ma)};this.setScissor=function(a,c,b,e){m.scissor(a,c,b,e)};this.enableScissorTest= -function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColorHex=function(a,c){fa.setHex(a);Y=c;m.clearColor(fa.r,fa.g,fa.b,Y)};this.setClearColor=function(a,c){fa.copy(a);Y=c;m.clearColor(fa.r,fa.g,fa.b,Y)};this.getClearColor=function(){return fa};this.getClearAlpha=function(){return Y};this.clear=function(a,c,b){var e=0;if(a==void 0||a)e|=m.COLOR_BUFFER_BIT;if(c==void 0||c)e|=m.DEPTH_BUFFER_BIT;if(b==void 0||b)e|=m.STENCIL_BUFFER_BIT;m.clear(e)};this.getContext=function(){return m}; -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(g in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[g];m.deleteBuffer(c.__webglVertexBuffer);m.deleteBuffer(c.__webglNormalBuffer);m.deleteBuffer(c.__webglTangentBuffer);m.deleteBuffer(c.__webglColorBuffer);m.deleteBuffer(c.__webglUVBuffer);m.deleteBuffer(c.__webglUV2Buffer);m.deleteBuffer(c.__webglSkinVertexABuffer); -m.deleteBuffer(c.__webglSkinVertexBBuffer);m.deleteBuffer(c.__webglSkinIndicesBuffer);m.deleteBuffer(c.__webglSkinWeightsBuffer);m.deleteBuffer(c.__webglFaceBuffer);m.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var b=0,e=c.numMorphTargets;b=0&&m.enableVertexAttribArray(u.position);u.color>=0&&m.enableVertexAttribArray(u.color);u.normal>=0&&m.enableVertexAttribArray(u.normal); -u.tangent>=0&&m.enableVertexAttribArray(u.tangent);a.skinning&&u.skinVertexA>=0&&u.skinVertexB>=0&&u.skinIndex>=0&&u.skinWeight>=0&&(m.enableVertexAttribArray(u.skinVertexA),m.enableVertexAttribArray(u.skinVertexB),m.enableVertexAttribArray(u.skinIndex),m.enableVertexAttribArray(u.skinWeight));if(a.attributes)for(k in a.attributes)u[k]!==void 0&&u[k]>=0&&m.enableVertexAttribArray(u[k]);if(a.morphTargets)for(k=a.numSupportedMorphTargets=0;k=0&&(m.enableVertexAttribArray(u[H]), -a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,c,b,e){V(a);this.clear(c,b,e)};this.updateShadowMap=function(a,c){x(a,c)};this.render=function(a,b,p,H){var Z,L,A,z,C,fa,E,I,oa=a.lights,M=a.fog;da=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&x(a,b);S.info.render.calls=0;S.info.render.vertices=0;S.info.render.faces=0;if(b.matrixAutoUpdate){for(C=b;C.parent;)C=C.parent;C.update(void 0,!0)}a.update(void 0,!1, -b);b.matrixWorldInverse.flattenToArray(Ca);b.projectionMatrix.flattenToArray(Da);Aa.multiply(b.projectionMatrix,b.matrixWorldInverse);o(Aa);this.initWebGLObjects(a);V(p);(this.autoClear||H)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);C=a.__webglObjects.length;for(H=0;H=0;H--)if(Z=a.__webglObjects[H],Z.render){E=Z.object;I=Z.buffer;A=Z.opaque;k(E);for(Z=0;Z65535&&(u[t].counter+=1,v=u[t].hash+"_"+u[t].counter,h.geometryGroups[v]==void 0&&(h.geometryGroups[v]={faces:[],materialIndex:o,vertices:0,numMorphTargets:H})),h.geometryGroups[v].faces.push(l),h.geometryGroups[v].vertices+=p;h.geometryGroupsList=[];l=void 0;for(l in h.geometryGroups)h.geometryGroups[l].id=ia++,h.geometryGroupsList.push(h.geometryGroups[l])}for(f in k.geometryGroups)if(h=k.geometryGroups[f],!h.__webglVertexBuffer){l=h;l.__webglVertexBuffer=m.createBuffer();l.__webglNormalBuffer= -m.createBuffer();l.__webglTangentBuffer=m.createBuffer();l.__webglColorBuffer=m.createBuffer();l.__webglUVBuffer=m.createBuffer();l.__webglUV2Buffer=m.createBuffer();l.__webglSkinVertexABuffer=m.createBuffer();l.__webglSkinVertexBBuffer=m.createBuffer();l.__webglSkinIndicesBuffer=m.createBuffer();l.__webglSkinWeightsBuffer=m.createBuffer();l.__webglFaceBuffer=m.createBuffer();l.__webglLineBuffer=m.createBuffer();if(l.numMorphTargets){o=n=void 0;l.__webglMorphTargetsBuffers=[];n=0;for(o=l.numMorphTargets;n< -o;n++)l.__webglMorphTargetsBuffers.push(m.createBuffer())}S.info.memory.geometries++;for(var o=c,w=p=u=void 0,t=w=H=w=void 0,v=t=l=0,x=p=void 0,Z=void 0,p=n=H=u=void 0,H=o.geometry,x=H.faces,Z=h.faces,u=0,p=Z.length;u=0?H.materials[h.materialIndex]:o.material;p=u.map||u.lightMap||u instanceof THREE.ShaderMaterial?!0:!1;Z=u instanceof THREE.MeshBasicMaterial&&!u.envMap||u instanceof -THREE.MeshDepthMaterial?!1:u&&u.shading!=void 0&&u.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;x=u.vertexColors?u.vertexColors:!1;h.__vertexArray=new Float32Array(l*3);if(Z)h.__normalArray=new Float32Array(l*3);if(H.hasTangents)h.__tangentArray=new Float32Array(l*4);if(x)h.__colorArray=new Float32Array(l*3);if(p){if(H.faceUvs.length>0||H.faceVertexUvs.length>0)h.__uvArray=new Float32Array(l*2);if(H.faceUvs.length>1||H.faceVertexUvs.length>1)h.__uv2Array=new Float32Array(l*2)}if(o.geometry.skinWeights.length&& -o.geometry.skinIndices.length)h.__skinVertexAArray=new Float32Array(l*4),h.__skinVertexBArray=new Float32Array(l*4),h.__skinIndexArray=new Float32Array(l*4),h.__skinWeightArray=new Float32Array(l*4);h.__faceArray=new Uint16Array(t*3+(o.geometry.edgeFaces?o.geometry.edgeFaces.length*6:0));h.__lineArray=new Uint16Array(v*2);if(h.numMorphTargets){h.__morphTargetsArrays=[];H=0;for(w=h.numMorphTargets;H=0;k--)e[k]==f&&e.splice(k,1)}else(c instanceof THREE.MarchingCubes||c.immediateRenderCallback)&&C(e.__webglObjectsImmediate,c);c.__webglActive=!1;a.__objectsRemoved.splice(0, -1)}c=0;for(e=a.__webglObjects.length;c0&&(m.bindBuffer(m.ARRAY_BUFFER, -o.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,da,t));Ba&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglNormalBuffer),m.bufferData(m.ARRAY_BUFFER,sa,t));Ea&&ta.hasTangents&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglTangentBuffer),m.bufferData(m.ARRAY_BUFFER,pa,t));Ca&&T>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,va,t));Ca&&qa>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,ka,t));Da&&(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer), -m.bufferData(m.ELEMENT_ARRAY_BUFFER,ra,t),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,ya,t));P>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexABuffer),m.bufferData(m.ARRAY_BUFFER,ca,t),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexBBuffer),m.bufferData(m.ARRAY_BUFFER,ga,t),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,ea,t),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER, -$,t));v&&(delete o.__inittedArrays,delete o.__colorArray,delete o.__normalArray,delete o.__tangentArray,delete o.__uvArray,delete o.__uv2Array,delete o.__faceArray,delete o.__vertexArray,delete o.__lineArray,delete o.__skinVertexAArray,delete o.__skinVertexBArray,delete o.__skinIndexArray,delete o.__skinWeightArray)}f.__dirtyVertices=!1;f.__dirtyMorphTargets=!1;f.__dirtyElements=!1;f.__dirtyUvs=!1;f.__dirtyNormals=!1;f.__dirtyTangents=!1;f.__dirtyColors=!1;z(h,k)}else if(k instanceof THREE.Ribbon){f= -k.geometry;if(f.__dirtyVertices||f.__dirtyColors){k=f;h=m.DYNAMIC_DRAW;l=u=v=v=void 0;H=k.vertices;n=k.colors;p=H.length;o=n.length;x=k.__vertexArray;t=k.__colorArray;Z=k.__dirtyColors;if(k.__dirtyVertices){for(v=0;v=0&&(b=a.geometry.materials[c.materialIndex]);return b}function c(a,c,b){var e,f,k,h=a.vertices,l=h.length,m=a.colors,t=m.length,p=a.__vertexArray,o=a.__colorArray,u=a.__sortArray,v=a.__dirtyVertices,M=a.__dirtyColors,w=a.__webglCustomAttributesList,x;if(w){k=0;for(e=w.length;k=0)c&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglVertexBuffer),n.vertexAttribPointer(a.position,3,n.FLOAT,!1,0,0));else if(h.morphTargetBase){b=k.program.attributes;h.morphTargetBase!==-1?(n.bindBuffer(n.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[h.morphTargetBase]),n.vertexAttribPointer(b.position,3,n.FLOAT,!1,0,0)):b.position>=0&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglVertexBuffer), +n.vertexAttribPointer(b.position,3,n.FLOAT,!1,0,0));if(h.morphTargetForcedOrder.length){l=0;var p=h.morphTargetForcedOrder;for(m=h.morphTargetInfluences;lt&&(o=u,t=m[o]);n.bindBuffer(n.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[o]);n.vertexAttribPointer(b["morphTarget"+l],3,n.FLOAT,!1,0,0);h.__webglMorphTargetInfluences[l]=t;p[o]=1;t=-1;l++}}k.program.uniforms.morphTargetInfluences!==null&&n.uniform1fv(k.program.uniforms.morphTargetInfluences,h.__webglMorphTargetInfluences)}if(c){if(f.__webglCustomAttributesList){l=0;for(m=f.__webglCustomAttributesList.length;l= +0&&(n.bindBuffer(n.ARRAY_BUFFER,b.buffer),n.vertexAttribPointer(a[b.buffer.belongsToAttribute],b.size,n.FLOAT,!1,0,0))}a.color>=0&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglColorBuffer),n.vertexAttribPointer(a.color,3,n.FLOAT,!1,0,0));a.normal>=0&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglNormalBuffer),n.vertexAttribPointer(a.normal,3,n.FLOAT,!1,0,0));a.tangent>=0&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglTangentBuffer),n.vertexAttribPointer(a.tangent,4,n.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(n.bindBuffer(n.ARRAY_BUFFER, +f.__webglUVBuffer),n.vertexAttribPointer(a.uv,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(a.uv)):n.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(n.bindBuffer(n.ARRAY_BUFFER,f.__webglUV2Buffer),n.vertexAttribPointer(a.uv2,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(a.uv2)):n.disableVertexAttribArray(a.uv2));k.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglSkinVertexABuffer),n.vertexAttribPointer(a.skinVertexA,4, +n.FLOAT,!1,0,0),n.bindBuffer(n.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),n.vertexAttribPointer(a.skinVertexB,4,n.FLOAT,!1,0,0),n.bindBuffer(n.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),n.vertexAttribPointer(a.skinIndex,4,n.FLOAT,!1,0,0),n.bindBuffer(n.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),n.vertexAttribPointer(a.skinWeight,4,n.FLOAT,!1,0,0))}h instanceof THREE.Mesh?(k.wireframe?(n.lineWidth(k.wireframeLinewidth),c&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),n.drawElements(n.LINES,f.__webglLineCount, +n.UNSIGNED_SHORT,0)):(c&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),n.drawElements(n.TRIANGLES,f.__webglFaceCount,n.UNSIGNED_SHORT,0)),O.info.render.calls++,O.info.render.vertices+=f.__webglFaceCount,O.info.render.faces+=f.__webglFaceCount/3):h instanceof THREE.Line?(h=h.type==THREE.LineStrip?n.LINE_STRIP:n.LINES,n.lineWidth(k.linewidth),n.drawArrays(h,0,f.__webglLineCount),O.info.render.calls++):h instanceof THREE.ParticleSystem?(n.drawArrays(n.POINTS,0,f.__webglParticleCount),O.info.render.calls++): +h instanceof THREE.Ribbon&&(n.drawArrays(n.TRIANGLE_STRIP,0,f.__webglVertexCount),O.info.render.calls++)}}function h(a,c,b){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=n.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=n.createBuffer();a.hasPos&&(n.bindBuffer(n.ARRAY_BUFFER,a.__webglVertexBuffer),n.bufferData(n.ARRAY_BUFFER,a.positionArray,n.DYNAMIC_DRAW),n.enableVertexAttribArray(c.attributes.position),n.vertexAttribPointer(c.attributes.position,3,n.FLOAT,!1,0,0));if(a.hasNormal){n.bindBuffer(n.ARRAY_BUFFER, +a.__webglNormalBuffer);if(b==THREE.FlatShading){var e,f,k,h,l,m,p,t,o,u,v=a.count*3;for(u=0;u=0&&(c=c.geometry.materials[materialIndex], +c.transparent?v(a,c):v(f,c))):(c=b)&&(c.transparent?v(a,c):v(f,c))}function x(a,c){return c.z-a.z}function w(a){var c,b,m,t=0,o,v,x,w,M=a.lights;ha||(ha=new THREE.PerspectiveCamera(O.shadowCameraFov,O.shadowMapWidth/O.shadowMapHeight,O.shadowCameraNear,O.shadowCameraFar));c=0;for(b=M.length;c=0;b--)a[b].object==c&&a.splice(b,1)}function L(a,c,b){a.push({buffer:c,object:b,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function F(a){if(a!=Q){switch(a){case THREE.AdditiveBlending:n.blendEquation(n.FUNC_ADD);n.blendFunc(n.SRC_ALPHA,n.ONE);break;case THREE.SubtractiveBlending:n.blendEquation(n.FUNC_ADD);n.blendFunc(n.ZERO,n.ONE_MINUS_SRC_COLOR); +break;case THREE.MultiplyBlending:n.blendEquation(n.FUNC_ADD);n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA)}Q=a}}function G(a,c,b){(b.width&b.width-1)==0&&(b.height&b.height-1)==0?(n.texParameteri(a,n.TEXTURE_WRAP_S,X(c.wrapS)),n.texParameteri(a,n.TEXTURE_WRAP_T,X(c.wrapT)),n.texParameteri(a,n.TEXTURE_MAG_FILTER,X(c.magFilter)),n.texParameteri(a,n.TEXTURE_MIN_FILTER,X(c.minFilter)), +n.generateMipmap(a)):(n.texParameteri(a,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(a,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(a,n.TEXTURE_MAG_FILTER,V(c.magFilter)),n.texParameteri(a,n.TEXTURE_MIN_FILTER,V(c.minFilter)))}function N(a,c){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=n.createTexture(),O.info.memory.textures++;n.activeTexture(n.TEXTURE0+c);n.bindTexture(n.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?n.texImage2D(n.TEXTURE_2D,0,X(a.format), +a.image.width,a.image.height,0,X(a.format),n.UNSIGNED_BYTE,a.image.data):n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,a.image);G(n.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else n.activeTexture(n.TEXTURE0+c),n.bindTexture(n.TEXTURE_2D,a.__webglTexture)}function R(a,c){n.bindRenderbuffer(n.RENDERBUFFER,a);c.depthBuffer&&!c.stencilBuffer?(n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,c.width,c.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,a)): +c.depthBuffer&&c.stencilBuffer?(n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,c.width,c.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,a)):n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,c.width,c.height)}function H(a){var c=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=n.createTexture();if(c){a.__webglFramebuffer=[];a.__webglRenderbuffer= +[];n.bindTexture(n.TEXTURE_CUBE_MAP,a.__webglTexture);G(n.TEXTURE_CUBE_MAP,a,a);for(var b=0;b<6;b++){a.__webglFramebuffer[b]=n.createFramebuffer();a.__webglRenderbuffer[b]=n.createRenderbuffer();n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,X(a.format),a.width,a.height,0,X(a.format),X(a.type),null);var e=a,f=n.TEXTURE_CUBE_MAP_POSITIVE_X+b;n.bindFramebuffer(n.FRAMEBUFFER,a.__webglFramebuffer[b]);n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,f,e.__webglTexture,0);R(a.__webglRenderbuffer[b], +a)}}else a.__webglFramebuffer=n.createFramebuffer(),a.__webglRenderbuffer=n.createRenderbuffer(),n.bindTexture(n.TEXTURE_2D,a.__webglTexture),G(n.TEXTURE_2D,a,a),n.texImage2D(n.TEXTURE_2D,0,X(a.format),a.width,a.height,0,X(a.format),X(a.type),null),b=n.TEXTURE_2D,n.bindFramebuffer(n.FRAMEBUFFER,a.__webglFramebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,b,a.__webglTexture,0),n.bindRenderbuffer(n.RENDERBUFFER,a.__webglRenderbuffer),R(a.__webglRenderbuffer,a);c?n.bindTexture(n.TEXTURE_CUBE_MAP, +null):n.bindTexture(n.TEXTURE_2D,null);n.bindRenderbuffer(n.RENDERBUFFER,null);n.bindFramebuffer(n.FRAMEBUFFER,null)}a?(c=c?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,b=a.width,a=a.height,f=e=0):(c=null,b=ma,a=na,e=da,f=sa);c!=aa&&(n.bindFramebuffer(n.FRAMEBUFFER,c),n.viewport(e,f,b,a),aa=c)}function S(a){a instanceof THREE.WebGLRenderTargetCube?(n.bindTexture(n.TEXTURE_CUBE_MAP,a.__webglTexture),n.generateMipmap(n.TEXTURE_CUBE_MAP),n.bindTexture(n.TEXTURE_CUBE_MAP,null)):(n.bindTexture(n.TEXTURE_2D, +a.__webglTexture),n.generateMipmap(n.TEXTURE_2D),n.bindTexture(n.TEXTURE_2D,null))}function J(a,c){var b;a=="fragment"?b=n.createShader(n.FRAGMENT_SHADER):a=="vertex"&&(b=n.createShader(n.VERTEX_SHADER));n.shaderSource(b,c);n.compileShader(b);if(!n.getShaderParameter(b,n.COMPILE_STATUS))return console.error(n.getShaderInfoLog(b)),console.error(c),null;return b}function V(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return n.NEAREST; +default:return n.LINEAR}}function X(a){switch(a){case THREE.RepeatWrapping:return n.REPEAT;case THREE.ClampToEdgeWrapping:return n.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return n.MIRRORED_REPEAT;case THREE.NearestFilter:return n.NEAREST;case THREE.NearestMipMapNearestFilter:return n.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return n.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return n.LINEAR;case THREE.LinearMipMapNearestFilter:return n.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return n.LINEAR_MIPMAP_LINEAR; +case THREE.ByteType:return n.BYTE;case THREE.UnsignedByteType:return n.UNSIGNED_BYTE;case THREE.ShortType:return n.SHORT;case THREE.UnsignedShortType:return n.UNSIGNED_SHORT;case THREE.IntType:return n.INT;case THREE.UnsignedShortType:return n.UNSIGNED_INT;case THREE.FloatType:return n.FLOAT;case THREE.AlphaFormat:return n.ALPHA;case THREE.RGBFormat:return n.RGB;case THREE.RGBAFormat:return n.RGBA;case THREE.LuminanceFormat:return n.LUMINANCE;case THREE.LuminanceAlphaFormat:return n.LUMINANCE_ALPHA}return 0} +var O=this,n,U=[],$=null,aa=null,ca=-1,ea=null,la=0,ka=null,Z=null,Q=null,T=null,fa=null,ga=null,qa=null,oa=null,da=0,sa=0,ma=0,na=0,pa=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Fa=new Float32Array(16),Ea=new Float32Array(16),za=new THREE.Vector4,Da={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},M=a.canvas!==void 0?a.canvas:document.createElement("canvas"), +Y=a.stencil!==void 0?a.stencil:!0,ia=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,ja=a.antialias!==void 0?a.antialias:!1,K=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),ra=a.clearAlpha!==void 0?a.clearAlpha:0,wa=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=M;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear= +!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var ha,xa=[],a=THREE.ShaderLib.depthRGBA,ua=THREE.UniformsUtils.clone(a.uniforms),ya=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ua}), +Ba=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ua,morphTargets:!0});ya._shadowPass=!0;Ba._shadowPass=!0;try{if(!(n=M.getContext("experimental-webgl",{antialias:ja,stencil:Y,preserveDrawingBuffer:ia})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+n.getParameter(n.VERSION)+" | "+n.getParameter(n.VENDOR)+" | "+n.getParameter(n.RENDERER)+" | "+n.getParameter(n.SHADING_LANGUAGE_VERSION))}catch(Ha){console.error(Ha)}n.clearColor(0, +0,0,1);n.clearDepth(1);n.clearStencil(0);n.enable(n.DEPTH_TEST);n.depthFunc(n.LEQUAL);n.frontFace(n.CCW);n.cullFace(n.BACK);n.enable(n.CULL_FACE);n.enable(n.BLEND);n.blendEquation(n.FUNC_ADD);n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA);n.clearColor(K.r,K.g,K.b,ra);this.context=n;var Ia=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,W={};W.vertices=new Float32Array(16);W.faces=new Uint16Array(6);Y=0;W.vertices[Y++]=-1;W.vertices[Y++]=-1;W.vertices[Y++]=0;W.vertices[Y++]=1;W.vertices[Y++]=1; +W.vertices[Y++]=-1;W.vertices[Y++]=1;W.vertices[Y++]=1;W.vertices[Y++]=1;W.vertices[Y++]=1;W.vertices[Y++]=1;W.vertices[Y++]=0;W.vertices[Y++]=-1;W.vertices[Y++]=1;W.vertices[Y++]=0;Y=W.vertices[Y++]=0;W.faces[Y++]=0;W.faces[Y++]=1;W.faces[Y++]=2;W.faces[Y++]=0;W.faces[Y++]=2;W.faces[Y++]=3;W.vertexBuffer=n.createBuffer();W.elementBuffer=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,W.vertexBuffer);n.bufferData(n.ARRAY_BUFFER,W.vertices,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,W.elementBuffer); +n.bufferData(n.ELEMENT_ARRAY_BUFFER,W.faces,n.STATIC_DRAW);W.program=n.createProgram();n.attachShader(W.program,J("fragment",THREE.ShaderLib.sprite.fragmentShader));n.attachShader(W.program,J("vertex",THREE.ShaderLib.sprite.vertexShader));n.linkProgram(W.program);W.attributes={};W.uniforms={};W.attributes.position=n.getAttribLocation(W.program,"position");W.attributes.uv=n.getAttribLocation(W.program,"uv");W.uniforms.uvOffset=n.getUniformLocation(W.program,"uvOffset");W.uniforms.uvScale=n.getUniformLocation(W.program, +"uvScale");W.uniforms.rotation=n.getUniformLocation(W.program,"rotation");W.uniforms.scale=n.getUniformLocation(W.program,"scale");W.uniforms.alignment=n.getUniformLocation(W.program,"alignment");W.uniforms.color=n.getUniformLocation(W.program,"color");W.uniforms.map=n.getUniformLocation(W.program,"map");W.uniforms.opacity=n.getUniformLocation(W.program,"opacity");W.uniforms.useScreenCoordinates=n.getUniformLocation(W.program,"useScreenCoordinates");W.uniforms.affectedByDistance=n.getUniformLocation(W.program, +"affectedByDistance");W.uniforms.screenPosition=n.getUniformLocation(W.program,"screenPosition");W.uniforms.modelViewMatrix=n.getUniformLocation(W.program,"modelViewMatrix");W.uniforms.projectionMatrix=n.getUniformLocation(W.program,"projectionMatrix");var Ja=!1;this.setSize=function(a,c){M.width=a;M.height=c;this.setViewport(0,0,M.width,M.height)};this.setViewport=function(a,c,b,e){da=a;sa=c;ma=b;na=e;n.viewport(da,sa,ma,na)};this.setScissor=function(a,c,b,e){n.scissor(a,c,b,e)};this.enableScissorTest= +function(a){a?n.enable(n.SCISSOR_TEST):n.disable(n.SCISSOR_TEST)};this.setClearColorHex=function(a,c){K.setHex(a);ra=c;n.clearColor(K.r,K.g,K.b,ra)};this.setClearColor=function(a,c){K.copy(a);ra=c;n.clearColor(K.r,K.g,K.b,ra)};this.getClearColor=function(){return K};this.getClearAlpha=function(){return ra};this.clear=function(a,c,b){var e=0;if(a==void 0||a)e|=n.COLOR_BUFFER_BIT;if(c==void 0||c)e|=n.DEPTH_BUFFER_BIT;if(b==void 0||b)e|=n.STENCIL_BUFFER_BIT;n.clear(e)};this.getContext=function(){return n}; +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(g in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[g];n.deleteBuffer(c.__webglVertexBuffer);n.deleteBuffer(c.__webglNormalBuffer);n.deleteBuffer(c.__webglTangentBuffer);n.deleteBuffer(c.__webglColorBuffer);n.deleteBuffer(c.__webglUVBuffer);n.deleteBuffer(c.__webglUV2Buffer);n.deleteBuffer(c.__webglSkinVertexABuffer); +n.deleteBuffer(c.__webglSkinVertexBBuffer);n.deleteBuffer(c.__webglSkinIndicesBuffer);n.deleteBuffer(c.__webglSkinWeightsBuffer);n.deleteBuffer(c.__webglFaceBuffer);n.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var b=0,e=c.numMorphTargets;b=0&&n.enableVertexAttribArray(v.position);v.color>=0&&n.enableVertexAttribArray(v.color);v.normal>=0&&n.enableVertexAttribArray(v.normal); +v.tangent>=0&&n.enableVertexAttribArray(v.tangent);a.skinning&&v.skinVertexA>=0&&v.skinVertexB>=0&&v.skinIndex>=0&&v.skinWeight>=0&&(n.enableVertexAttribArray(v.skinVertexA),n.enableVertexAttribArray(v.skinVertexB),n.enableVertexAttribArray(v.skinIndex),n.enableVertexAttribArray(v.skinWeight));if(a.attributes)for(k in a.attributes)v[k]!==void 0&&v[k]>=0&&n.enableVertexAttribArray(v[k]);if(a.morphTargets)for(k=a.numSupportedMorphTargets=0;k=0&&(n.enableVertexAttribArray(v[x]), +a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,c,b,e){H(a);this.clear(c,b,e)};this.updateShadowMap=function(a,c){w(a,c)};this.render=function(a,c,b,v){var M,Y,ia,A,E,ja,C,G,oa=a.lights,N=a.fog;ca=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&w(a,c);O.info.render.calls=0;O.info.render.vertices=0;O.info.render.faces=0;if(c.matrixAutoUpdate){for(E=c;E.parent;)E=E.parent;E.update(void 0,!0)}a.update(void 0, +!1,c);c.matrixWorldInverse.flattenToArray(Ea);c.projectionMatrix.flattenToArray(Fa);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);u(Ca);this.initWebGLObjects(a);H(b);(this.autoClear||v)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);E=a.__webglObjects.length;for(v=0;v=0;v--)if(M=a.__webglObjects[v],M.render){C=M.object;G=M.buffer;ia=M.opaque;k(C);for(M=0;M65535&&(w[v].counter+=1,u=w[v].hash+"_"+w[v].counter,l.geometryGroups[u]==void 0&&(l.geometryGroups[u]={faces:[],materialIndex:o,vertices:0,numMorphTargets:M})),l.geometryGroups[u].faces.push(m),l.geometryGroups[u].vertices+=t;l.geometryGroupsList=[];m=void 0;for(m in l.geometryGroups)l.geometryGroups[m].id=la++,l.geometryGroupsList.push(l.geometryGroups[m])}for(k in h.geometryGroups)if(l=h.geometryGroups[k],!l.__webglVertexBuffer){m=l;m.__webglVertexBuffer=n.createBuffer();m.__webglNormalBuffer= +n.createBuffer();m.__webglTangentBuffer=n.createBuffer();m.__webglColorBuffer=n.createBuffer();m.__webglUVBuffer=n.createBuffer();m.__webglUV2Buffer=n.createBuffer();m.__webglSkinVertexABuffer=n.createBuffer();m.__webglSkinVertexBBuffer=n.createBuffer();m.__webglSkinIndicesBuffer=n.createBuffer();m.__webglSkinWeightsBuffer=n.createBuffer();m.__webglFaceBuffer=n.createBuffer();m.__webglLineBuffer=n.createBuffer();if(m.numMorphTargets){o=p=void 0;m.__webglMorphTargetsBuffers=[];p=0;for(o=m.numMorphTargets;p< +o;p++)m.__webglMorphTargetsBuffers.push(n.createBuffer())}O.info.memory.geometries++;for(var o=e,x=t=w=void 0,v=x=M=x=void 0,u=v=m=0,z=t=void 0,Y=void 0,t=p=M=w=void 0,M=o.geometry,z=M.faces,Y=l.faces,w=0,t=Y.length;w0||M.faceVertexUvs.length>0)l.__uvArray=new Float32Array(m*2);if(M.faceUvs.length>1||M.faceVertexUvs.length>1)l.__uv2Array=new Float32Array(m*2)}if(o.geometry.skinWeights.length&&o.geometry.skinIndices.length)l.__skinVertexAArray= +new Float32Array(m*4),l.__skinVertexBArray=new Float32Array(m*4),l.__skinIndexArray=new Float32Array(m*4),l.__skinWeightArray=new Float32Array(m*4);l.__faceArray=new Uint16Array(v*3+(o.geometry.edgeFaces?o.geometry.edgeFaces.length*6:0));l.__lineArray=new Uint16Array(u*2);if(l.numMorphTargets){l.__morphTargetsArrays=[];M=0;for(x=l.numMorphTargets;M=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&C(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e0&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglColorBuffer), +n.bufferData(n.ARRAY_BUFFER,aa,v));Ia&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglNormalBuffer),n.bufferData(n.ARRAY_BUFFER,xa,v));Ea&&ua.hasTangents&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglTangentBuffer),n.bufferData(n.ARRAY_BUFFER,ca,v));za&&sa>0&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglUVBuffer),n.bufferData(n.ARRAY_BUFFER,fa,v));za&&S>0&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglUV2Buffer),n.bufferData(n.ARRAY_BUFFER,ea,v));Fa&&(n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER, +qa,v),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,pa,v));P>0&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglSkinVertexABuffer),n.bufferData(n.ARRAY_BUFFER,ga,v),n.bindBuffer(n.ARRAY_BUFFER,o.__webglSkinVertexBBuffer),n.bufferData(n.ARRAY_BUFFER,$,v),n.bindBuffer(n.ARRAY_BUFFER,o.__webglSkinIndicesBuffer),n.bufferData(n.ARRAY_BUFFER,na,v),n.bindBuffer(n.ARRAY_BUFFER,o.__webglSkinWeightsBuffer),n.bufferData(n.ARRAY_BUFFER,Z,v));u&&(delete o.__inittedArrays,delete o.__colorArray, +delete o.__normalArray,delete o.__tangentArray,delete o.__uvArray,delete o.__uv2Array,delete o.__faceArray,delete o.__vertexArray,delete o.__lineArray,delete o.__skinVertexAArray,delete o.__skinVertexBArray,delete o.__skinIndexArray,delete o.__skinWeightArray)}k.__dirtyVertices=!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;E(l,h)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k; +l=n.DYNAMIC_DRAW;m=w=u=u=void 0;M=h.vertices;p=h.colors;t=M.length;o=p.length;z=h.__vertexArray;v=h.__colorArray;Y=h.__dirtyColors;if(h.__dirtyVertices){for(u=0;u1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=h;b.v=k;return b}}; +THREE.ColorUtils={adjustHSV:function(a,b,c,e){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.Math.clamp(f.h+b,0,1);f.s=THREE.Math.clamp(f.s+c,0,1);f.v=THREE.Math.clamp(f.v+e,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,b){var c=a.r,e=a.g,f=a.b,h=Math.max(Math.max(c,e),f),k=Math.min(Math.min(c,e),f);if(k==h)k=c=0;else{var l=h-k,k=l/h,c=c==h?(e-f)/l:e==h?2+(f-c)/l:4+(c-e)/l;c/=6;c<0&&(c+=1);c>1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=k;b.v=h;return b}}; THREE.ColorUtils.__hsv={h:0,s:0,v:0}; -THREE.GeometryUtils={merge:function(a,b){for(var c,e,f=a.vertices.length,k=b instanceof THREE.Mesh?b.geometry:b,h=a.vertices,l=k.vertices,n=a.faces,o=k.faces,u=a.faceVertexUvs[0],p=k.faceVertexUvs[0],v={},t=0;t1&&(e=1-e,f=1-f);k=1-e-f;h.copy(a);h.multiplyScalar(e);l.copy(b);l.multiplyScalar(f);h.addSelf(l);l.copy(c);l.multiplyScalar(k);h.addSelf(l);return h},randomPointInFace:function(a,b,c){var e,f,k;if(a instanceof THREE.Face3)return e=b.vertices[a.a].position,f=b.vertices[a.b].position, -k=b.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(e,f,k);else if(a instanceof THREE.Face4){e=b.vertices[a.a].position;f=b.vertices[a.b].position;k=b.vertices[a.c].position;var b=b.vertices[a.d].position,h;c?a._area1&&a._area2?(c=a._area1,h=a._area2):(c=THREE.GeometryUtils.triangleArea(e,f,b),h=THREE.GeometryUtils.triangleArea(f,k,b),a._area1=c,a._area2=h):(c=THREE.GeometryUtils.triangleArea(e,f,b),h=THREE.GeometryUtils.triangleArea(f,k,b));return THREE.GeometryUtils.random()*(c+ -h)a?c(b,f-1):o[f]1&&(e=1-e,f=1-f);h=1-e-f;k.copy(a);k.multiplyScalar(e);l.copy(b);l.multiplyScalar(f);k.addSelf(l);l.copy(c);l.multiplyScalar(h);k.addSelf(l);return k},randomPointInFace:function(a,b,c){var e,f,h;if(a instanceof THREE.Face3)return e=b.vertices[a.a].position,f=b.vertices[a.b].position, +h=b.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(e,f,h);else if(a instanceof THREE.Face4){e=b.vertices[a.a].position;f=b.vertices[a.b].position;h=b.vertices[a.c].position;var b=b.vertices[a.d].position,k;c?a._area1&&a._area2?(c=a._area1,k=a._area2):(c=THREE.GeometryUtils.triangleArea(e,f,b),k=THREE.GeometryUtils.triangleArea(f,h,b),a._area1=c,a._area2=k):(c=THREE.GeometryUtils.triangleArea(e,f,b),k=THREE.GeometryUtils.triangleArea(f,h,b));return THREE.GeometryUtils.random()*(c+ +k)a?c(b,f-1):t[f] 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#ifdef VERTEX_TEXTURES\nvec3 dv = texture2D( tDisplacement, uv ).xyz;\nfloat df = uDisplacementScale * dv.x + uDisplacementBias;\nvec4 displacedPosition = vec4( vNormal.xyz * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif", THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:1,texture:null},tFlip:{type:"f",value:-1}},vertexShader:"varying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvViewPosition = cameraPosition - mPosition.xyz;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( tFlip * wPos.x, wPos.yz ) );\n}"}}}; THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){return this.getPoint(this.getUtoTmapping(a))};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c}; -THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1)return this.cacheArcLengths;var b=[],c,e=this.getPoint(0),f,k=0;b.push(0);for(f=1;f<=a;f++)c=this.getPoint(f/a),k+=c.distanceTo(e),b.push(k),e=c;return this.cacheArcLengths=b}; -THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),e=0,f=c.length,k;k=b?b:a*c[f-1];time=Date.now();for(var h=0,l=f-1,n;h<=l;)if(e=Math.floor(h+(l-h)/2),n=c[e]-k,n<0)h=e+1;else if(n>0)l=e-1;else{l=e;break}e=l;if(c[e]==k)return e/(f-1);h=c[e];return c=(e+(k-h)/(c[e+1]-h))/(f-1)};THREE.Curve.prototype.getNormalVector=function(a){a=this.getTangent(a);return new THREE.Vector2(-a.y,a.x)}; +THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1)return this.cacheArcLengths;var b=[],c,e=this.getPoint(0),f,h=0;b.push(0);for(f=1;f<=a;f++)c=this.getPoint(f/a),h+=c.distanceTo(e),b.push(h),e=c;return this.cacheArcLengths=b}; +THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),e=0,f=c.length,h;h=b?b:a*c[f-1];time=Date.now();for(var k=0,l=f-1,m;k<=l;)if(e=Math.floor(k+(l-k)/2),m=c[e]-h,m<0)k=e+1;else if(m>0)l=e-1;else{l=e;break}e=l;if(c[e]==h)return e/(f-1);k=c[e];return c=(e+(h-k)/(c[e+1]-k))/(f-1)};THREE.Curve.prototype.getNormalVector=function(a){a=this.getTangent(a);return new THREE.Vector2(-a.y,a.x)}; THREE.Curve.prototype.getTangent=function(a){var b=a-1.0E-4;a+=1.0E-4;b<0&&(b=0);a>1&&(a=1);var b=this.getPoint(b),a=this.getPoint(a),c=new THREE.Vector2;c.sub(a,b);return c.unit()};THREE.LineCurve=function(a,b){a instanceof THREE.Vector2?(this.v1=a,this.v2=b):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(a,b,c,e){this.constructor(new THREE.Vector2(a,b),new THREE.Vector2(c,e))};THREE.LineCurve.prototype=new THREE.Curve; THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.multiplyScalar(a).addSelf(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(){var a=new THREE.Vector2;a.sub(this.v2,this.v1);a.normalize();return a}; THREE.QuadraticBezierCurve=function(a,b,c){if(!(b instanceof THREE.Vector2))var e=Array.prototype.slice.call(arguments),a=new THREE.Vector2(e[0],e[1]),b=new THREE.Vector2(e[2],e[3]),c=new THREE.Vector2(e[4],e[5]);this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; @@ -384,9 +384,9 @@ THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Ut THREE.CubicBezierCurve=function(a,b,c,e){if(!(b instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),a=new THREE.Vector2(f[0],f[1]),b=new THREE.Vector2(f[2],f[3]),c=new THREE.Vector2(f[4],f[5]),e=new THREE.Vector2(f[6],f[7]);this.v0=a;this.v1=b;this.v2=c;this.v3=e};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve; THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b}; THREE.SplineCurve=function(a){this.points=a};THREE.SplineCurve.prototype=new THREE.Curve;THREE.SplineCurve.prototype.constructor=THREE.SplineCurve; -THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],e=this.points,f;f=(e.length-1)*a;a=Math.floor(f);f-=a;c[0]=a==0?a:a-1;c[1]=a;c[2]=a>e.length-2?a:a+1;c[3]=a>e.length-3?a:a+2;b.x=THREE.Curve.Utils.interpolate(e[c[0]].x,e[c[1]].x,e[c[2]].x,e[c[3]].x,f);b.y=THREE.Curve.Utils.interpolate(e[c[0]].y,e[c[1]].y,e[c[2]].y,e[c[3]].y,f);return b};THREE.ArcCurve=function(a,b,c,e,f,k){this.aX=a;this.aY=b;this.aRadius=c;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=k}; +THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],e=this.points,f;f=(e.length-1)*a;a=Math.floor(f);f-=a;c[0]=a==0?a:a-1;c[1]=a;c[2]=a>e.length-2?a:a+1;c[3]=a>e.length-3?a:a+2;b.x=THREE.Curve.Utils.interpolate(e[c[0]].x,e[c[1]].x,e[c[2]].x,e[c[3]].x,f);b.y=THREE.Curve.Utils.interpolate(e[c[0]].y,e[c[1]].y,e[c[2]].y,e[c[3]].y,f);return b};THREE.ArcCurve=function(a,b,c,e,f,h){this.aX=a;this.aY=b;this.aRadius=c;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=h}; THREE.ArcCurve.prototype=new THREE.Curve;THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.ArcCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;this.aClockwise||(a=1-a);a=this.aStartAngle+a*b;return new THREE.Vector2(this.aX+this.aRadius*Math.cos(a),this.aY+this.aRadius*Math.sin(a))}; -THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,e){return 2*(1-a)*(c-b)+2*a*(e-c)},tangentCubicBezier:function(a,b,c,e,f){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*e*(1-a)-3*a*a*e+3*a*a*f},tangentSpline:function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,e,f){var a=(c-a)*0.5,e=(e-b)*0.5,k=f*f;return(2*b-2*c+a+e)*f*k+(-3*b+3*c-2*a-e)*k+a*f+b}}; +THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,e){return 2*(1-a)*(c-b)+2*a*(e-c)},tangentCubicBezier:function(a,b,c,e,f){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*e*(1-a)-3*a*a*e+3*a*a*f},tangentSpline:function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,e,f){var a=(c-a)*0.5,e=(e-b)*0.5,h=f*f;return(2*b-2*c+a+e)*f*h+(-3*b+3*c-2*a-e)*h+a*f+b}}; THREE.Curve.create=function(a,b){a.prototype=new THREE.Curve;a.prototype.constructor=a;a.prototype.getPoint=b;return a};THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.sub(v2,v1);b.multiplyScalar(a);b.addSelf(this.v1);return b}); THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b,c;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);a=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(b,c,a)}); THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,e){this.v0=a;this.v1=b;this.v2=c;this.v3=e},function(a){var b,c;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);c=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);a=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(b,c,a)}); @@ -394,55 +394,55 @@ THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=a},function(a){var THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){}; THREE.CurvePath.prototype.getPoint=function(a){for(var b=a*this.getLength(),c=this.getCurveLengths(),a=0;a=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,e=this.curves.length;for(c=0;cb)b=k.x;else if(k.xc)c=k.y;else if(k.yb)b=h.x;else if(h.xc)c=h.y;else if(h.y0?(h=c[c.length-1],t=h.x,y=h.y):(h=this.actions[e-1].args,t=h[h.length-2],y=h[h.length-1]);for(h=1;h<=a;h++)x=h/a,k=THREE.Shape.Utils.b2(x,t,p,l),x=THREE.Shape.Utils.b2(x,y,v, -n),c.push(new THREE.Vector2(k,x));break;case THREE.PathActions.BEZIER_CURVE_TO:l=k[4];n=k[5];p=k[0];v=k[1];o=k[2];u=k[3];c.length>0?(h=c[c.length-1],t=h.x,y=h.y):(h=this.actions[e-1].args,t=h[h.length-2],y=h[h.length-1]);for(h=1;h<=a;h++)x=h/a,k=THREE.Shape.Utils.b3(x,t,p,o,l),x=THREE.Shape.Utils.b3(x,y,v,u,n),c.push(new THREE.Vector2(k,x));break;case THREE.PathActions.CSPLINE_THRU:h=this.actions[e-1].args;h=[new THREE.Vector2(h[h.length-2],h[h.length-1])];x=a*k[0].length;h=h.concat(k[0]);k=new THREE.SplineCurve(h); -for(h=1;h<=x;h++)c.push(k.getPointAt(h/x));break;case THREE.PathActions.ARC:h=this.actions[e-1].args;l=k[0];n=k[1];o=k[2];p=k[3];x=k[4];v=!!k[5];u=h[h.length-2];t=h[h.length-1];h.length==0&&(u=t=0);y=x-p;var w=a*2;for(h=1;h<=w;h++)x=h/w,v||(x=1-x),x=p+x*y,k=u+l+o*Math.cos(x),x=t+n+o*Math.sin(x),c.push(new THREE.Vector2(k,x))}b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)}; -THREE.Path.prototype.nltransform=function(a,b,c,e,f,k){var h=this.getPoints(),l,n,o,u,p;l=0;for(n=h.length;l0?(k=c[c.length-1],o=k.x,z=k.y):(k=this.actions[e-1].args,o=k[k.length-2],z=k[k.length-1]);for(k=1;k<=a;k++)x=k/a,h=THREE.Shape.Utils.b2(x,o,p,l),x=THREE.Shape.Utils.b2(x,z,v, +m),c.push(new THREE.Vector2(h,x));break;case THREE.PathActions.BEZIER_CURVE_TO:l=h[4];m=h[5];p=h[0];v=h[1];t=h[2];u=h[3];c.length>0?(k=c[c.length-1],o=k.x,z=k.y):(k=this.actions[e-1].args,o=k[k.length-2],z=k[k.length-1]);for(k=1;k<=a;k++)x=k/a,h=THREE.Shape.Utils.b3(x,o,p,t,l),x=THREE.Shape.Utils.b3(x,z,v,u,m),c.push(new THREE.Vector2(h,x));break;case THREE.PathActions.CSPLINE_THRU:k=this.actions[e-1].args;k=[new THREE.Vector2(k[k.length-2],k[k.length-1])];x=a*h[0].length;k=k.concat(h[0]);h=new THREE.SplineCurve(k); +for(k=1;k<=x;k++)c.push(h.getPointAt(k/x));break;case THREE.PathActions.ARC:k=this.actions[e-1].args;l=h[0];m=h[1];t=h[2];p=h[3];x=h[4];v=!!h[5];u=k[k.length-2];o=k[k.length-1];k.length==0&&(u=o=0);z=x-p;var w=a*2;for(k=1;k<=w;k++)x=k/w,v||(x=1-x),x=p+x*z,h=u+l+t*Math.cos(x),x=o+m+t*Math.sin(x),c.push(new THREE.Vector2(h,x))}b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)}; +THREE.Path.prototype.nltransform=function(a,b,c,e,f,h){var k=this.getPoints(),l,m,t,u,p;l=0;for(m=k.length;l=0?l-1:c.length-1;k=h-1>=0?h-1:o.length-1;var x=[o[h],c[l],c[f]];p=THREE.FontUtils.Triangulate.area(x);var w=[o[h],o[k],c[l]];v=THREE.FontUtils.Triangulate.area(w);t=l;u=h;l+=1;h+=-1;l< -0&&(l+=c.length);l%=c.length;h<0&&(h+=o.length);h%=o.length;f=l-1>=0?l-1:c.length-1;k=h-1>=0?h-1:o.length-1;x=[o[h],c[l],c[f]];x=THREE.FontUtils.Triangulate.area(x);w=[o[h],o[k],c[l]];w=THREE.FontUtils.Triangulate.area(w);p+v>x+w&&(l=t,h=u,l<0&&(l+=c.length),l%=c.length,h<0&&(h+=o.length),h%=o.length,f=l-1>=0?l-1:c.length-1,k=h-1>=0?h-1:o.length-1);p=c.slice(0,l);v=c.slice(l);t=o.slice(h);u=o.slice(0,h);k=[o[h],o[k],c[l]];y.push([o[h],c[l],c[f]]);y.push(k);c=p.concat(t).concat(u).concat(v)}return{shape:c, -isolatedPts:y,allpoints:e}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),e=c.allpoints,f=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),k,h,l,n,o={};k=0;for(h=e.length;k=0?l-1:c.length-1;h=k-1>=0?k-1:t.length-1;var x=[t[k],c[l],c[f]];p=THREE.FontUtils.Triangulate.area(x);var w=[t[k],t[h],c[l]];v=THREE.FontUtils.Triangulate.area(w);o=l;u=k;l+=1;k+=-1;l< +0&&(l+=c.length);l%=c.length;k<0&&(k+=t.length);k%=t.length;f=l-1>=0?l-1:c.length-1;h=k-1>=0?k-1:t.length-1;x=[t[k],c[l],c[f]];x=THREE.FontUtils.Triangulate.area(x);w=[t[k],t[h],c[l]];w=THREE.FontUtils.Triangulate.area(w);p+v>x+w&&(l=o,k=u,l<0&&(l+=c.length),l%=c.length,k<0&&(k+=t.length),k%=t.length,f=l-1>=0?l-1:c.length-1,h=k-1>=0?k-1:t.length-1);p=c.slice(0,l);v=c.slice(l);o=t.slice(k);u=t.slice(0,k);h=[t[k],t[h],c[l]];z.push([t[k],c[l],c[f]]);z.push(h);c=p.concat(o).concat(u).concat(v)}return{shape:c, +isolatedPts:z,allpoints:e}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),e=c.allpoints,f=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),h,k,l,m,t={};h=0;for(k=e.length;h1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+t),e=e<0?0:1;if(c==="pos")if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=f[0]+(k[0]-f[0])*e,c.y=f[1]+(k[1]-f[1])*e,c.z=f[2]+(k[2]-f[2])*e;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= -this.getPrevKeyWith("pos",t,h.index-1).pos,this.points[1]=f,this.points[2]=k,this.points[3]=this.getNextKeyWith("pos",t,l.index+1).pos,e=e*0.33+0.33,f=this.interpolateCatmullRom(this.points,e),c.x=f[0],c.y=f[1],c.z=f[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)e=this.interpolateCatmullRom(this.points,e*1.01),this.target.set(e[0],e[1],e[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),e=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,e,0)}else if(c=== -"rot")THREE.Quaternion.slerp(f,k,a.quaternion,e);else if(c==="scl")c=a.scale,c.x=f[0]+(k[0]-f[0])*e,c.y=f[1]+(k[1]-f[1])*e,c.z=f[2]+(k[2]-f[2])*e}}if(this.JITCompile&&u[0][o]===void 0){this.hierarchy[0].update(void 0,!0);for(t=0;ta.length-2?k:k+1;c[3]=k>a.length-3?k:k+2;k=a[c[0]];l=a[c[1]];n=a[c[2]];o=a[c[3]];c=f*f;h=f*c;e[0]=this.interpolate(k[0],l[0],n[0],o[0],f,c,h);e[1]=this.interpolate(k[1],l[1],n[1],o[1],f,c,h);e[2]=this.interpolate(k[2],l[2],n[2],o[2],f,c,h);return e}; -THREE.Animation.prototype.interpolate=function(a,b,c,e,f,k,h){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*h+(-3*(b-c)-2*a-e)*k+a*f+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+o),e=e<0?0:1;if(c==="pos")if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=f[0]+(h[0]-f[0])*e,c.y=f[1]+(h[1]-f[1])*e,c.z=f[2]+(h[2]-f[2])*e;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= +this.getPrevKeyWith("pos",o,k.index-1).pos,this.points[1]=f,this.points[2]=h,this.points[3]=this.getNextKeyWith("pos",o,l.index+1).pos,e=e*0.33+0.33,f=this.interpolateCatmullRom(this.points,e),c.x=f[0],c.y=f[1],c.z=f[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)e=this.interpolateCatmullRom(this.points,e*1.01),this.target.set(e[0],e[1],e[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),e=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,e,0)}else if(c=== +"rot")THREE.Quaternion.slerp(f,h,a.quaternion,e);else if(c==="scl")c=a.scale,c.x=f[0]+(h[0]-f[0])*e,c.y=f[1]+(h[1]-f[1])*e,c.z=f[2]+(h[2]-f[2])*e}}if(this.JITCompile&&u[0][t]===void 0){this.hierarchy[0].update(void 0,!0);for(o=0;oa.length-2?h:h+1;c[3]=h>a.length-3?h:h+2;h=a[c[0]];l=a[c[1]];m=a[c[2]];t=a[c[3]];c=f*f;k=f*c;e[0]=this.interpolate(h[0],l[0],m[0],t[0],f,c,k);e[1]=this.interpolate(h[1],l[1],m[1],t[1],f,c,k);e[2]=this.interpolate(h[2],l[2],m[2],t[2],f,c,k);return e}; +THREE.Animation.prototype.interpolate=function(a,b,c,e,f,h,k){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*k+(-3*(b-c)-2*a-e)*h+a*f+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c0?c:0:c>=0?c:c+e.length;c>=0;c--)if(e[c][a]!==void 0)return e[c];return this.data.hierarchy[b].keys[e.length-1]}; THREE.CubeCamera=function(a,b,c,e){this.heightOffset=c;this.position=new THREE.Vector3(0,c,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position= this.position;this.cameraNY.position=this.position;this.cameraPZ.position=this.position;this.cameraNZ.position=this.position;this.cameraPX.up.set(0,-1,0);this.cameraNX.up.set(0,-1,0);this.cameraPY.up.set(0,0,1);this.cameraNY.up.set(0,0,-1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.targetPX=new THREE.Vector3(0,0,0);this.targetNX=new THREE.Vector3(0,0,0);this.targetPY=new THREE.Vector3(0,0,0);this.targetNY=new THREE.Vector3(0,0,0);this.targetPZ=new THREE.Vector3(0,0,0);this.targetNZ= new THREE.Vector3(0,0,0);this.renderTarget=new THREE.WebGLRenderTargetCube(e,e,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updatePosition=function(a){this.position.copy(a);this.position.y+=this.heightOffset;this.targetPX.copy(this.position);this.targetNX.copy(this.position);this.targetPY.copy(this.position);this.targetNY.copy(this.position);this.targetPZ.copy(this.position);this.targetNZ.copy(this.position);this.targetPX.x+=1;this.targetNX.x-=1;this.targetPY.y+= 1;this.targetNY.y-=1;this.targetPZ.z+=1;this.targetNZ.z-=1;this.cameraPX.lookAt(this.targetPX);this.cameraNX.lookAt(this.targetNX);this.cameraPY.lookAt(this.targetPY);this.cameraNY.lookAt(this.targetNY);this.cameraPZ.lookAt(this.targetPZ);this.cameraNZ.lookAt(this.targetNZ)};this.updateCubeMap=function(a,c){var b=this.renderTarget;b.activeCubeFace=0;a.render(c,this.cameraPX,b);b.activeCubeFace=1;a.render(c,this.cameraNX,b);b.activeCubeFace=2;a.render(c,this.cameraPY,b);b.activeCubeFace=3;a.render(c, this.cameraNY,b);b.activeCubeFace=4;a.render(c,this.cameraPZ,b);b.activeCubeFace=5;a.render(c,this.cameraNZ,b)}};THREE.FirstPersonCamera=function(){console.warn("DEPRECATED: FirstPersonCamera() is FirstPersonControls().")};THREE.PathCamera=function(){console.warn("DEPRECATED: PathCamera() is PathControls().")};THREE.FlyCamera=function(){console.warn("DEPRECATED: FlyCamera() is FlyControls().")};THREE.RollCamera=function(){console.warn("DEPRECATED: RollCamera() is RollControls().")}; -THREE.TrackballCamera=function(){console.warn("DEPRECATED: TrackballCamera() is TrackballControls().")};THREE.CombinedCamera=function(a,b,c,e,f,k,h){THREE.Camera.call(this);this.cameraO=new THREE.OrthographicCamera(a/-2,a/2,b/2,b/-2,k,h);this.cameraP=new THREE.PerspectiveCamera(c,a/b,e,f);this.toPerspective()};THREE.CombinedCamera.prototype=new THREE.Camera;THREE.CombinedCamera.prototype.constructor=THREE.CoolCamera; +THREE.TrackballCamera=function(){console.warn("DEPRECATED: TrackballCamera() is TrackballControls().")};THREE.CombinedCamera=function(a,b,c,e,f,h,k){THREE.Camera.call(this);this.cameraO=new THREE.OrthographicCamera(a/-2,a/2,b/2,b/-2,h,k);this.cameraP=new THREE.PerspectiveCamera(c,a/b,e,f);this.toPerspective()};THREE.CombinedCamera.prototype=new THREE.Camera;THREE.CombinedCamera.prototype.constructor=THREE.CoolCamera; THREE.CombinedCamera.prototype.toPerspective=function(){this.near=this.cameraP.near;this.far=this.cameraP.far;this.projectionMatrix=this.cameraP.projectionMatrix};THREE.CombinedCamera.prototype.toOrthographic=function(){this.near=this.cameraO.near;this.far=this.cameraO.far;this.projectionMatrix=this.cameraO.projectionMatrix};THREE.CombinedCamera.prototype.setFov=function(a){this.cameraP.fov=a;this.cameraP.updateProjectionMatrix();this.toPerspective()}; THREE.CombinedCamera.prototype.setLens=function(a,b){b||(b=43.25);var c=2*Math.atan(b/(a*2));c*=180/Math.PI;this.setFov(c);return c}; THREE.FirstPersonControls=function(a,b){function c(a,c){return function(){c.apply(a,arguments)}}this.object=a;this.target=new THREE.Vector3(0,0,0);this.domElement=b!==void 0?b:document;this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=this.autoSpeedFactor= @@ -454,217 +454,216 @@ this.moveUp&&this.object.translateY(c);this.moveDown&&this.object.translateY(-c) (a=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c*a);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);a=this.target;b=this.object.position;a.x=b.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=b.y+100*Math.cos(this.phi);a.z=b.z+100*Math.sin(this.phi)*Math.sin(this.theta); this.object.lookAt(a)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)}; THREE.PathControls=function(a,b){function c(a){if((a*=2)<1)return 0.5*a*a;return-0.5*(--a*(a-2)-1)}function e(a,c){return function(){c.apply(a,arguments)}}function f(a,c,b,e){var k={name:b,fps:0.6,length:e,hierarchy:[]},h,f=c.getControlPointsArray(),l=c.getLength(),w=f.length,B=0;h=w-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:f[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[h]={time:e,pos:f[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h=0?a:a+h;b=this.verticalAngleMap.srcRange; +this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var k=Math.PI*2,l=Math.PI/180;this.update=function(a){var b;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed*a);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed*a);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*l;this.theta=this.lon*l;a=this.phi%k;this.phi=a>=0?a:a+k;b=this.verticalAngleMap.srcRange; a=this.verticalAngleMap.dstRange;b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var e=a[1]-a[0];this.phi=c((b-a[0])/e)*e+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);e=a[1]-a[0];this.theta=c((b-a[0])/e)*e+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove= function(a){this.domElement===document?(this.mouseX=a.pageX-this.viewHalfX,this.mouseY=a.pageY-this.viewHalfY):(this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}), -b=new THREE.CubeGeometry(10,10,20),h=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(b,a);a=new THREE.Mesh(h,c);a.position.set(0,10,0);this.animation=f(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else this.animation=f(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var a= -this.debugPath,c=this.spline,b=k(c,10),h=k(c,10),l=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(b,l);particleObj=new THREE.ParticleSystem(h,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);a.add(lineObj);particleObj.scale.set(1,1,1);a.add(particleObj);h=new THREE.SphereGeometry(1,16,8);l=new THREE.MeshBasicMaterial({color:65280});for(i=0;i0){var c=this.getContainerDimensions(),b=c.size[0]/2,h=c.size[1]/2;this.moveState.yawLeft=-(a.pageX-c.offset[0]-b)/b;this.moveState.pitchDown=(a.pageY-c.offset[1]-h)/h;this.updateRotationVector()}};this.mouseup=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(a.button){case 0:this.moveForward= +!0;break;case 2:this.object.moveBackward=!0}};this.mousemove=function(a){if(!this.dragToLook||this.mouseStatus>0){var c=this.getContainerDimensions(),b=c.size[0]/2,k=c.size[1]/2;this.moveState.yawLeft=-(a.pageX-c.offset[0]-b)/b;this.moveState.pitchDown=(a.pageY-c.offset[1]-k)/k;this.updateRotationVector()}};this.mouseup=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(a.button){case 0:this.moveForward= !1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(a){var c=a*this.movementSpeed;a*=this.rollSpeed;this.object.translateX(this.moveVector.x*c);this.object.translateY(this.moveVector.y*c);this.object.translateZ(this.moveVector.z*c);this.tmpQuaternion.set(this.rotationVector.x*a,this.rotationVector.y*a,this.rotationVector.z*a,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion); this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z= -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this, this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(a,b){this.object=a;this.domElement=b!==void 0?b:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var c=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3,k=new THREE.Matrix4,h=!1,l=1,n=0,o=0,u=0,p=0,v=0,t=window.innerWidth/2,y=window.innerHeight/2;this.update=function(a){if(this.mouseLook){var b=a*this.lookSpeed; -this.rotateHorizontally(b*p);this.rotateVertically(b*v)}b=a*this.movementSpeed;this.object.translateZ(-b*(n>0||this.autoForward&&!(n<0)?1:n));this.object.translateX(b*o);this.object.translateY(b*u);h&&(this.roll+=this.rollSpeed*a*l);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y0||this.autoForward&&!(m<0)?1:m));this.object.translateX(b*t);this.object.translateY(b*u);k&&(this.roll+=this.rollSpeed*a*l);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y1?b.normalize():b.z=Math.sqrt(1-e*e);k.copy(this.object.position).subSelf(this.target);e=this.object.up.clone().setLength(b.y);e.addSelf(this.object.up.clone().crossSelf(k).setLength(b.x));e.addSelf(k.setLength(b.z));return e};this.rotateCamera=function(){var a=Math.acos(h.dot(l)/h.length()/l.length());if(a){var c=(new THREE.Vector3).cross(h,l).normalize(),b=new THREE.Quaternion;a*=this.rotateSpeed;b.setFromAxisAngle(c, --a);b.multiplyVector3(k);b.multiplyVector3(this.object.up);b.multiplyVector3(l);this.staticMoving?h=l:(b.setFromAxisAngle(c,a*(this.dynamicDampingFactor-1)),b.multiplyVector3(h))}};this.zoomCamera=function(){var a=1+(o.y-n.y)*this.zoomSpeed;a!==1&&a>0&&(k.multiplyScalar(a),this.staticMoving?n=o:n.y+=(o.y-n.y)*this.dynamicDampingFactor)};this.panCamera=function(){var a=p.clone().subSelf(u);if(a.lengthSq()){a.multiplyScalar(k.length()*this.panSpeed);var c=k.clone().crossSelf(this.object.up).setLength(a.x); -c.addSelf(this.object.up.clone().setLength(a.y));this.object.position.addSelf(c);this.target.addSelf(c);this.staticMoving?u=p:u.addSelf(a.sub(p,u).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),k.lengthSq()1?b.normalize():b.z=Math.sqrt(1-e*e);h.copy(this.object.position).subSelf(this.target);e=this.object.up.clone().setLength(b.y);e.addSelf(this.object.up.clone().crossSelf(h).setLength(b.x));e.addSelf(h.setLength(b.z));return e};this.rotateCamera=function(){var a=Math.acos(k.dot(l)/k.length()/l.length());if(a){var c=(new THREE.Vector3).cross(k,l).normalize(),b=new THREE.Quaternion;a*=this.rotateSpeed;b.setFromAxisAngle(c, +-a);b.multiplyVector3(h);b.multiplyVector3(this.object.up);b.multiplyVector3(l);this.staticMoving?k=l:(b.setFromAxisAngle(c,a*(this.dynamicDampingFactor-1)),b.multiplyVector3(k))}};this.zoomCamera=function(){var a=1+(t.y-m.y)*this.zoomSpeed;a!==1&&a>0&&(h.multiplyScalar(a),this.staticMoving?m=t:m.y+=(t.y-m.y)*this.dynamicDampingFactor)};this.panCamera=function(){var a=p.clone().subSelf(u);if(a.lengthSq()){a.multiplyScalar(h.length()*this.panSpeed);var c=h.clone().crossSelf(this.object.up).setLength(a.x); +c.addSelf(this.object.up.clone().setLength(a.y));this.object.position.addSelf(c);this.target.addSelf(c);this.staticMoving?u=p:u.addSelf(a.sub(p,u).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),h.lengthSq()0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,h,0)));for(l=0;l0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-h,0)));for(l=0;l0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,k,0)));for(l=0;l0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-k,0)));for(l=0;la&&(a+=Math.PI*2),anglec=(c+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(l).subSelf(a).clone()}function f(a){for(J=a.length;--J>=0;){ha=J;ja=J-1;ja<0&&(ja=a.length- -1);for(var c=0,b=t+u*2,c=0;c=0;O--){W=O/u;S=n*(1-W);W=o*Math.sin(W*Math.PI/2);J=0;for(T=A.length;Ja&&(a+=Math.PI*2),anglec=(c+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(l).subSelf(a).clone()}function f(a){for(H=a.length;--H>=0;){la=H;ka=H-1;ka<0&&(ka=a.length- +1);for(var c=0,b=o+u*2,c=0;c=0;J--){V=J/u;X=m*(1-V);V=t*Math.sin(V*Math.PI/2);H=0;for(S=y.length;H0||(u=this.vertices.push(new THREE.Vertex(new THREE.Vector3(p,l,v)))-1);o.push(u)}b.push(o)}for(var t,y,x,f=b.length,c=0;c0)for(e=0;e1&&(t= -this.vertices[h].position.clone(),y=this.vertices[n].position.clone(),x=this.vertices[o].position.clone(),t.normalize(),y.normalize(),x.normalize(),this.faces.push(new THREE.Face3(h,n,o,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(x.x,x.y,x.z)])),this.faceVertexUvs[0].push([u,p,w]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry; +THREE.SphereGeometry=function(a,b,c){THREE.Geometry.call(this);for(var a=a||50,e,f=Math.PI,h=Math.max(3,b||8),k=Math.max(2,c||6),b=[],c=0;c0||(u=this.vertices.push(new THREE.Vertex(new THREE.Vector3(p,l,v)))-1);t.push(u)}b.push(t)}for(var o,z,x,f=b.length,c=0;c0)for(e=0;e1&&(o= +this.vertices[k].position.clone(),z=this.vertices[m].position.clone(),x=this.vertices[t].position.clone(),o.normalize(),z.normalize(),x.normalize(),this.faces.push(new THREE.Face3(k,m,t,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(x.x,x.y,x.z)])),this.faceVertexUvs[0].push([u,p,w]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry; THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry; THREE.TextGeometry=function(a,b){var c=(new THREE.TextPath(a,b)).toShapes();b.amount=b.height!==void 0?b.height:50;if(b.bevelThickness===void 0)b.bevelThickness=10;if(b.bevelSize===void 0)b.bevelSize=8;if(b.bevelEnabled===void 0)b.bevelEnabled=!1;if(b.bend){var e=c[c.length-1].getBoundingBox().maxX;b.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(e/2,120),new THREE.Vector2(e,0))}THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry; THREE.TextGeometry.prototype.constructor=THREE.TextGeometry; THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(a,b){return(new TextPath(a,b)).toShapes()},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){for(var b= -this.getFace(),c=this.size/b.resolution,e=0,f=String(a).split(""),k=f.length,h=[],a=0;a0)for(o=0;o2;){if(p--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return l;return k}n=o;f<=n&&(n=0);o=n+1;f<=o&&(o=0);u=o+1;f<=u&&(u=0);var v;a:{v=a;var t=n,y=o,x=u,w=f,B=h,A=void 0,z=void 0,C=void 0, -E=void 0,G=void 0,F=void 0,I=void 0,M=void 0,V=void 0,z=v[B[t]].x,C=v[B[t]].y,E=v[B[y]].x,G=v[B[y]].y,F=v[B[x]].x,I=v[B[x]].y;if(1.0E-10>(E-z)*(I-C)-(G-C)*(F-z))v=!1;else{for(A=0;A=0&&O>=0&&S>=0){v=!1; -break a}}v=!0}}if(v){k.push([a[h[n]],a[h[o]],a[h[u]]]);l.push([h[n],h[o],h[u]]);n=o;for(u=o+1;u0)for(t=0;t2;){if(p--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return l;return h}m=t;f<=m&&(m=0);t=m+1;f<=t&&(t=0);u=t+1;f<=u&&(u=0);var v;a:{v=a;var o=m,z=t,x=u,w=f,B=k,y=void 0,A=void 0,E=void 0, +C=void 0,L=void 0,F=void 0,G=void 0,N=void 0,R=void 0,A=v[B[o]].x,E=v[B[o]].y,C=v[B[z]].x,L=v[B[z]].y,F=v[B[x]].x,G=v[B[x]].y;if(1.0E-10>(C-A)*(G-E)-(L-E)*(F-A))v=!1;else{for(y=0;y=0&&J>=0&&X>=0){v=!1;break a}}v= +!0}}if(v){h.push([a[k[m]],a[k[t]],a[k[u]]]);l.push([k[m],k[t],k[u]]);m=t;for(u=t+1;u0;)this.smooth(a)}; -THREE.SubdivisionModifier.prototype.smooth=function(a){function b(a,c,b,e,l,n){var o=new THREE.Face4(a,c,b,e,null,l.color,l.material);if(h.useOldVertexColors){o.vertexColors=[];for(var m,t,u,v=0;v<4;v++){u=n[v];m=new THREE.Color;m.setRGB(0,0,0);for(var w=0;w>7)-127;e|=(h&127)<<16|f<<8;if(e==0&&l==-127)return 0;return(1-2*(k>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,l)}function f(a,c){var b=u(a,c),e=u(a,c+1),h=u(a,c+2);return(u(a,c+3)<<24)+(h<<16)+(e<<8)+b}function n(a,c){var b=u(a,c);return(u(a,c+1)<<8)+b}function o(a,c){var b=u(a,c);return b>127?b-256:b}function u(a,c){return a.charCodeAt(c)&255}function p(c){var b, -e,h;b=f(a,c);e=f(a,c+G);h=f(a,c+F);c=n(a,c+I);B.faces.push(new THREE.Face3(b,e,h,null,null,c))}function v(c){var b,e,h,k,m,o,p;b=f(a,c);e=f(a,c+G);h=f(a,c+F);k=n(a,c+I);m=f(a,c+M);o=f(a,c+V);p=f(a,c+J);var c=C[o*3],t=C[o*3+1];o=C[o*3+2];var u=C[p*3],v=C[p*3+1];p=C[p*3+2];B.faces.push(new THREE.Face3(b,e,h,[new THREE.Vector3(C[m*3],C[m*3+1],C[m*3+2]),new THREE.Vector3(c,t,o),new THREE.Vector3(u,v,p)],null,k))}function t(c){var b,e,h,k;b=f(a,c);e=f(a,c+T);h=f(a,c+O);k=f(a,c+W);c=n(a,c+S);B.faces.push(new THREE.Face4(b, -e,h,k,null,null,c))}function y(c){var b,e,h,k,o,p,t,u,v;b=f(a,c);e=f(a,c+T);h=f(a,c+O);k=f(a,c+W);o=n(a,c+S);p=f(a,c+m);t=f(a,c+ca);u=f(a,c+Q);v=f(a,c+ea);var c=C[t*3],w=C[t*3+1];t=C[t*3+2];var H=C[u*3],L=C[u*3+1];u=C[u*3+2];var Z=C[v*3],x=C[v*3+1];v=C[v*3+2];B.faces.push(new THREE.Face4(b,e,h,k,[new THREE.Vector3(C[p*3],C[p*3+1],C[p*3+2]),new THREE.Vector3(c,w,t),new THREE.Vector3(H,L,u),new THREE.Vector3(Z,x,v)],null,o))}function x(c){var b,e,h,k;b=f(a,c);e=f(a,c+da);h=f(a,c+ka);c=E[b*2];k=E[b* -2+1];b=E[e*2];var m=B.faceVertexUvs[0];e=E[e*2+1];var n=E[h*2];h=E[h*2+1];var o=[];o.push(new THREE.UV(c,k));o.push(new THREE.UV(b,e));o.push(new THREE.UV(n,h));m.push(o)}function w(c){var b,e,h,k,m,n;b=f(a,c);e=f(a,c+ia);h=f(a,c+ha);k=f(a,c+ja);c=E[b*2];m=E[b*2+1];b=E[e*2];n=E[e*2+1];e=E[h*2];var o=B.faceVertexUvs[0];h=E[h*2+1];var p=E[k*2];k=E[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(b,n));t.push(new THREE.UV(e,h));t.push(new THREE.UV(p,k));o.push(t)}var B=this,A=0,z,C=[],E= -[],G,F,I,M,V,J,T,O,W,S,m,ca,Q,ea,da,ka,ia,ha,ja,$,R,X,aa,ga,ra;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(B,e,c);z={signature:a.substr(A,8),header_bytes:u(a,A+8),vertex_coordinate_bytes:u(a,A+9),normal_coordinate_bytes:u(a,A+10),uv_coordinate_bytes:u(a,A+11),vertex_index_bytes:u(a,A+12),normal_index_bytes:u(a,A+13),uv_index_bytes:u(a,A+14),material_index_bytes:u(a,A+15),nvertices:f(a,A+16),nnormals:f(a,A+16+4),nuvs:f(a,A+16+8),ntri_flat:f(a,A+16+12),ntri_smooth:f(a,A+16+16),ntri_flat_uv:f(a, -A+16+20),ntri_smooth_uv:f(a,A+16+24),nquad_flat:f(a,A+16+28),nquad_smooth:f(a,A+16+32),nquad_flat_uv:f(a,A+16+36),nquad_smooth_uv:f(a,A+16+40)};A+=z.header_bytes;G=z.vertex_index_bytes;F=z.vertex_index_bytes*2;I=z.vertex_index_bytes*3;M=z.vertex_index_bytes*3+z.material_index_bytes;V=z.vertex_index_bytes*3+z.material_index_bytes+z.normal_index_bytes;J=z.vertex_index_bytes*3+z.material_index_bytes+z.normal_index_bytes*2;T=z.vertex_index_bytes;O=z.vertex_index_bytes*2;W=z.vertex_index_bytes*3;S=z.vertex_index_bytes* -4;m=z.vertex_index_bytes*4+z.material_index_bytes;ca=z.vertex_index_bytes*4+z.material_index_bytes+z.normal_index_bytes;Q=z.vertex_index_bytes*4+z.material_index_bytes+z.normal_index_bytes*2;ea=z.vertex_index_bytes*4+z.material_index_bytes+z.normal_index_bytes*3;da=z.uv_index_bytes;ka=z.uv_index_bytes*2;ia=z.uv_index_bytes;ha=z.uv_index_bytes*2;ja=z.uv_index_bytes*3;c=z.vertex_index_bytes*3+z.material_index_bytes;ra=z.vertex_index_bytes*4+z.material_index_bytes;$=z.ntri_flat*c;R=z.ntri_smooth*(c+ -z.normal_index_bytes*3);X=z.ntri_flat_uv*(c+z.uv_index_bytes*3);aa=z.ntri_smooth_uv*(c+z.normal_index_bytes*3+z.uv_index_bytes*3);ga=z.nquad_flat*ra;c=z.nquad_smooth*(ra+z.normal_index_bytes*4);ra=z.nquad_flat_uv*(ra+z.uv_index_bytes*4);A+=function(c){for(var e,f,k,l=z.vertex_coordinate_bytes*3,m=c+z.nvertices*l;c=0){w=m.invBindMatrices[t];n.invBindMatrix=w;n.skinningMatrix=new THREE.Matrix4;n.skinningMatrix.multiply(n.world,w);n.weights=[];for(w=0;w1){m=new THREE.MeshFaceMaterial;for(j=0;j1?b[1].substr(0,c):"0";b[1].length>7)-127;e|=(h&127)<<16|f<<8;if(e==0&&l==-127)return 0;return(1-2*(k>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,l)}function f(a,c){var b=u(a,c),e=u(a,c+1),h=u(a,c+2);return(u(a,c+3)<<24)+(h<<16)+(e<<8)+b}function m(a,c){var b=u(a,c);return(u(a,c+1)<<8)+b}function t(a,c){var b=u(a,c);return b>127?b-256:b}function u(a,c){return a.charCodeAt(c)&255}function p(c){var b, +e,h;b=f(a,c);e=f(a,c+L);h=f(a,c+F);c=m(a,c+G);B.faces.push(new THREE.Face3(b,e,h,null,null,c))}function v(c){var b,e,h,k,n,o,p;b=f(a,c);e=f(a,c+L);h=f(a,c+F);k=m(a,c+G);n=f(a,c+N);o=f(a,c+R);p=f(a,c+H);var c=E[o*3],t=E[o*3+1];o=E[o*3+2];var u=E[p*3],v=E[p*3+1];p=E[p*3+2];B.faces.push(new THREE.Face3(b,e,h,[new THREE.Vector3(E[n*3],E[n*3+1],E[n*3+2]),new THREE.Vector3(c,t,o),new THREE.Vector3(u,v,p)],null,k))}function o(c){var b,e,h,k;b=f(a,c);e=f(a,c+S);h=f(a,c+J);k=f(a,c+V);c=m(a,c+X);B.faces.push(new THREE.Face4(b, +e,h,k,null,null,c))}function z(c){var b,e,h,k,o,p,t,u,v;b=f(a,c);e=f(a,c+S);h=f(a,c+J);k=f(a,c+V);o=m(a,c+X);p=f(a,c+O);t=f(a,c+n);u=f(a,c+U);v=f(a,c+$);var c=E[t*3],w=E[t*3+1];t=E[t*3+2];var M=E[u*3],x=E[u*3+1];u=E[u*3+2];var ia=E[v*3],y=E[v*3+1];v=E[v*3+2];B.faces.push(new THREE.Face4(b,e,h,k,[new THREE.Vector3(E[p*3],E[p*3+1],E[p*3+2]),new THREE.Vector3(c,w,t),new THREE.Vector3(M,x,u),new THREE.Vector3(ia,y,v)],null,o))}function x(c){var b,e,h,k;b=f(a,c);e=f(a,c+aa);h=f(a,c+ca);c=C[b*2];k=C[b* +2+1];b=C[e*2];var m=B.faceVertexUvs[0];e=C[e*2+1];var n=C[h*2];h=C[h*2+1];var o=[];o.push(new THREE.UV(c,k));o.push(new THREE.UV(b,e));o.push(new THREE.UV(n,h));m.push(o)}function w(c){var b,e,h,k,m,n;b=f(a,c);e=f(a,c+ea);h=f(a,c+la);k=f(a,c+ka);c=C[b*2];m=C[b*2+1];b=C[e*2];n=C[e*2+1];e=C[h*2];var o=B.faceVertexUvs[0];h=C[h*2+1];var p=C[k*2];k=C[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(b,n));t.push(new THREE.UV(e,h));t.push(new THREE.UV(p,k));o.push(t)}var B=this,y=0,A,E=[],C= +[],L,F,G,N,R,H,S,J,V,X,O,n,U,$,aa,ca,ea,la,ka,Z,Q,T,fa,ga,qa;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(B,e,c);A={signature:a.substr(y,8),header_bytes:u(a,y+8),vertex_coordinate_bytes:u(a,y+9),normal_coordinate_bytes:u(a,y+10),uv_coordinate_bytes:u(a,y+11),vertex_index_bytes:u(a,y+12),normal_index_bytes:u(a,y+13),uv_index_bytes:u(a,y+14),material_index_bytes:u(a,y+15),nvertices:f(a,y+16),nnormals:f(a,y+16+4),nuvs:f(a,y+16+8),ntri_flat:f(a,y+16+12),ntri_smooth:f(a,y+16+16),ntri_flat_uv:f(a, +y+16+20),ntri_smooth_uv:f(a,y+16+24),nquad_flat:f(a,y+16+28),nquad_smooth:f(a,y+16+32),nquad_flat_uv:f(a,y+16+36),nquad_smooth_uv:f(a,y+16+40)};y+=A.header_bytes;L=A.vertex_index_bytes;F=A.vertex_index_bytes*2;G=A.vertex_index_bytes*3;N=A.vertex_index_bytes*3+A.material_index_bytes;R=A.vertex_index_bytes*3+A.material_index_bytes+A.normal_index_bytes;H=A.vertex_index_bytes*3+A.material_index_bytes+A.normal_index_bytes*2;S=A.vertex_index_bytes;J=A.vertex_index_bytes*2;V=A.vertex_index_bytes*3;X=A.vertex_index_bytes* +4;O=A.vertex_index_bytes*4+A.material_index_bytes;n=A.vertex_index_bytes*4+A.material_index_bytes+A.normal_index_bytes;U=A.vertex_index_bytes*4+A.material_index_bytes+A.normal_index_bytes*2;$=A.vertex_index_bytes*4+A.material_index_bytes+A.normal_index_bytes*3;aa=A.uv_index_bytes;ca=A.uv_index_bytes*2;ea=A.uv_index_bytes;la=A.uv_index_bytes*2;ka=A.uv_index_bytes*3;c=A.vertex_index_bytes*3+A.material_index_bytes;qa=A.vertex_index_bytes*4+A.material_index_bytes;Z=A.ntri_flat*c;Q=A.ntri_smooth*(c+A.normal_index_bytes* +3);T=A.ntri_flat_uv*(c+A.uv_index_bytes*3);fa=A.ntri_smooth_uv*(c+A.normal_index_bytes*3+A.uv_index_bytes*3);ga=A.nquad_flat*qa;c=A.nquad_smooth*(qa+A.normal_index_bytes*4);qa=A.nquad_flat_uv*(qa+A.uv_index_bytes*4);y+=function(c){for(var e,h,f,l=A.vertex_coordinate_bytes*3,m=c+A.nvertices*l;c=0){w=m.invBindMatrices[t];n.invBindMatrix=w;n.skinningMatrix=new THREE.Matrix4;n.skinningMatrix.multiply(n.world,w);n.weights=[];for(w=0;w1){m=new THREE.MeshFaceMaterial;for(j=0;j1?b[1].substr(0,c):"0";b[1].length=0,k=f.indexOf("(")>=0,l;if(h)e=f.split("."),f=e.shift(),e.shift();else if(k){l=f.split("(");f=l.shift(); -for(e=0;e=0,k=h.indexOf("(")>=0,l;if(f)e=h.split("."),h=e.shift(),e.shift();else if(k){l=h.split("(");h=l.shift(); +for(e=0;ec){o=n.output[m];break}k=o!==void 0?o instanceof THREE.Matrix4? -k.multiply(k,o):k.multiply(k,l.matrix):k.multiply(k,l.matrix)}else k=k.multiply(k,l.matrix);c=k;b.push({time:a,pos:[c.n14,c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=b}this.updateMatrix();return this};p.prototype.updateMatrix=function(){this.matrix.identity();for(var a=0;a0&&(this[b.nodeName]=parseFloat(e[0].textContent))}}this.create();return this};V.prototype.create=function(){var a={},c=this.transparency!==void 0&&this.transparency<1,b;for(b in this)switch(b){case "ambient":case "emission":case "diffuse":case "specular":var e=this[b];if(e instanceof M)if(e.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(e=oa[this.effect.surface.init_from]))a.map=THREE.ImageUtils.loadTexture(Ca+e.init_from), -a.map.wrapS=THREE.RepeatWrapping,a.map.wrapT=THREE.RepeatWrapping,a.map.repeat.x=1,a.map.repeat.y=-1}else b=="diffuse"?a.color=e.color.getHex():c||(a[b]=e.color.getHex());break;case "shininess":case "reflectivity":a[b]=this[b];break;case "transparency":if(c)a.transparent=!0,a.opacity=this[b],c=!0}a.shading=xa;return this.material=new THREE.MeshLambertMaterial(a)};J.prototype.parse=function(a){for(var c=0;c=0,e=a.indexOf("(")>=0,h,f;if(b)c=a.split("."),a=c.shift(),f=c.shift();else if(e){h=a.split("(");a=h.shift();for(c=0;cc){t=n.output[m];break}k=t!==void 0?t instanceof THREE.Matrix4?k.multiply(k,t):k.multiply(k,l.matrix):k.multiply(k,l.matrix)}else k=k.multiply(k,l.matrix);c=k;b.push({time:a,pos:[c.n14, +c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=b}this.updateMatrix();return this};p.prototype.updateMatrix=function(){this.matrix.identity();for(var a=0;a0&&(this[b.nodeName]=parseFloat(e[0].textContent))}}this.create();return this};R.prototype.create=function(){var a= +{},c=this.transparency!==void 0&&this.transparency<1,b;for(b in this)switch(b){case "ambient":case "emission":case "diffuse":case "specular":var e=this[b];if(e instanceof N)if(e.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(e=oa[this.effect.surface.init_from]))a.map=THREE.ImageUtils.loadTexture(Fa+e.init_from),a.map.wrapS=THREE.RepeatWrapping,a.map.wrapT=THREE.RepeatWrapping,a.map.repeat.x=1,a.map.repeat.y=-1}else b=="diffuse"?a.color= +e.color.getHex():c||(a[b]=e.color.getHex());break;case "shininess":case "reflectivity":a[b]=this[b];break;case "transparency":if(c)a.transparent=!0,a.opacity=this[b],c=!0}a.shading=Da;return this.material=new THREE.MeshLambertMaterial(a)};H.prototype.parse=function(a){for(var c=0;c=0,e=a.indexOf("(")>=0,h,f;if(b)c=a.split("."),a=c.shift(),f=c.shift();else if(e){h=a.split("(");a=h.shift();for(c=0;c1&&(V=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(G,V);object.name=t;object.position.set(z[0],z[1],z[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=A.visible;Q.scene.add(object);Q.objects[t]=object;A.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),Q.scene.collisions.colliders.push(a)); -if(A.castsShadow)a=new THREE.ShadowVolume(G),Q.scene.add(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;A.trigger&&A.trigger.toLowerCase()!="none"&&(a={type:A.trigger,object:A},Q.triggers[object.name]=a)}}else z=A.position,r=A.rotation,q=A.quaternion,s=A.scale,q=0,object=new THREE.Object3D,object.name=t,object.position.set(z[0],z[1],z[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0], -s[1],s[2]),object.visible=A.visible!==void 0?A.visible:!1,Q.scene.add(object),Q.objects[t]=object,Q.empties[t]=object,A.trigger&&A.trigger.toLowerCase()!="none"&&(a={type:A.trigger,object:A},Q.triggers[object.name]=a)}function n(a){return function(b){Q.geometries[a]=b;l();W-=1;c.onLoadComplete();u()}}function o(a){return function(c){Q.geometries[a]=c}}function u(){c.callbackProgress({totalModels:m,totalTextures:ca,loadedModels:m-W,loadedTextures:ca-S},Q);c.onLoadProgress();W==0&&S==0&&b(Q)}var p, -v,t,y,x,w,B,A,z,C,E,G,F,I,M,V,J,T,O,W,S,m,ca,Q;T=a.data;M=new THREE.BinaryLoader;O=new THREE.JSONLoader;S=W=0;Q={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(t in T.objects)if(A=T.objects[t],A.meshCollider){a=!0;break}if(a)Q.scene.collisions=new THREE.CollisionSystem;if(T.transform){a=T.transform.position;C=T.transform.rotation;var ea=T.transform.scale;a&&Q.scene.position.set(a[0],a[1],a[2]);C&&Q.scene.rotation.set(C[0], -C[1],C[2]);ea&&Q.scene.scale.set(ea[0],ea[1],ea[2]);(a||C||ea)&&Q.scene.updateMatrix()}a=function(){S-=1;u();c.onLoadComplete()};for(x in T.cameras)C=T.cameras[x],C.type=="perspective"?F=new THREE.PerspectiveCamera(C.fov,C.aspect,C.near,C.far):C.type=="ortho"&&(F=new THREE.OrthographicCamera(C.left,C.right,C.top,C.bottom,C.near,C.far)),z=C.position,C=C.target,F.position.set(z[0],z[1],z[2]),F.target=new THREE.Vector3(C[0],C[1],C[2]),Q.cameras[x]=F;for(y in T.lights)x=T.lights[y],F=x.color!==void 0? -x.color:16777215,C=x.intensity!==void 0?x.intensity:1,x.type=="directional"?(z=x.direction,J=new THREE.DirectionalLight(F,C),J.position.set(z[0],z[1],z[2]),J.position.normalize()):x.type=="point"?(z=x.position,d=x.distance,J=new THREE.PointLight(F,C,d),J.position.set(z[0],z[1],z[2])):x.type=="ambient"&&(J=new THREE.AmbientLight(F)),Q.scene.add(J),Q.lights[y]=J;for(w in T.fogs)y=T.fogs[w],y.type=="linear"?I=new THREE.Fog(0,y.near,y.far):y.type=="exp2"&&(I=new THREE.FogExp2(0,y.density)),C=y.color, -I.color.setRGB(C[0],C[1],C[2]),Q.fogs[w]=I;if(Q.cameras&&T.defaults.camera)Q.currentCamera=Q.cameras[T.defaults.camera];if(Q.fogs&&T.defaults.fog)Q.scene.fog=Q.fogs[T.defaults.fog];C=T.defaults.bgcolor;Q.bgColor=new THREE.Color;Q.bgColor.setRGB(C[0],C[1],C[2]);Q.bgColorAlpha=T.defaults.bgalpha;for(p in T.geometries)if(w=T.geometries[p],w.type=="bin_mesh"||w.type=="ascii_mesh")W+=1,c.onLoadStart();m=W;for(p in T.geometries)w=T.geometries[p],w.type=="cube"?(G=new THREE.CubeGeometry(w.width,w.height, -w.depth,w.segmentsWidth,w.segmentsHeight,w.segmentsDepth,null,w.flipped,w.sides),Q.geometries[p]=G):w.type=="plane"?(G=new THREE.PlaneGeometry(w.width,w.height,w.segmentsWidth,w.segmentsHeight),Q.geometries[p]=G):w.type=="sphere"?(G=new THREE.SphereGeometry(w.radius,w.segmentsWidth,w.segmentsHeight),Q.geometries[p]=G):w.type=="cylinder"?(G=new THREE.CylinderGeometry(w.topRad,w.botRad,w.height,w.radSegs,w.heightSegs),Q.geometries[p]=G):w.type=="torus"?(G=new THREE.TorusGeometry(w.radius,w.tube,w.segmentsR, -w.segmentsT),Q.geometries[p]=G):w.type=="icosahedron"?(G=new THREE.IcosahedronGeometry(w.subdivisions),Q.geometries[p]=G):w.type=="bin_mesh"?M.load(e(w.url,T.urlBaseType),n(p)):w.type=="ascii_mesh"?O.load(e(w.url,T.urlBaseType),n(p)):w.type=="embedded_mesh"&&(w=T.embeds[w.id])&&O.createModel(w,o(p),"");for(B in T.textures)if(p=T.textures[B],p.url instanceof Array){S+=p.url.length;for(M=0;M=57344&&(b-=2048);b++;for(var c=new Float32Array(8*b),e=1,f=0;f<8;f++){for(var k=0,h=0;h>1^-(l&1);c[8*h+f]=k}e+=b}b=a.length-e;k=new Uint16Array(b);for(f=h=0;f1&&(R=new THREE.MeshFaceMaterial);object=new THREE.Mesh(L,R);object.name=o;object.position.set(A[0],A[1],A[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=y.visible;U.scene.add(object);U.objects[o]=object;y.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),U.scene.collisions.colliders.push(a));if(y.castsShadow)a= +new THREE.ShadowVolume(L),U.scene.add(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;y.trigger&&y.trigger.toLowerCase()!="none"&&(a={type:y.trigger,object:y},U.triggers[object.name]=a)}}else A=y.position,r=y.rotation,q=y.quaternion,s=y.scale,q=0,object=new THREE.Object3D,object.name=o,object.position.set(A[0],A[1],A[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],s[1],s[2]),object.visible= +y.visible!==void 0?y.visible:!1,U.scene.add(object),U.objects[o]=object,U.empties[o]=object,y.trigger&&y.trigger.toLowerCase()!="none"&&(a={type:y.trigger,object:y},U.triggers[object.name]=a)}function m(a){return function(b){U.geometries[a]=b;l();V-=1;c.onLoadComplete();u()}}function t(a){return function(c){U.geometries[a]=c}}function u(){c.callbackProgress({totalModels:O,totalTextures:n,loadedModels:O-V,loadedTextures:n-X},U);c.onLoadProgress();V==0&&X==0&&b(U)}var p,v,o,z,x,w,B,y,A,E,C,L,F,G,N, +R,H,S,J,V,X,O,n,U;S=a.data;N=new THREE.BinaryLoader;J=new THREE.JSONLoader;X=V=0;U={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(o in S.objects)if(y=S.objects[o],y.meshCollider){a=!0;break}if(a)U.scene.collisions=new THREE.CollisionSystem;if(S.transform){a=S.transform.position;E=S.transform.rotation;var $=S.transform.scale;a&&U.scene.position.set(a[0],a[1],a[2]);E&&U.scene.rotation.set(E[0],E[1],E[2]);$&&U.scene.scale.set($[0], +$[1],$[2]);(a||E||$)&&U.scene.updateMatrix()}a=function(){X-=1;u();c.onLoadComplete()};for(x in S.cameras)E=S.cameras[x],E.type=="perspective"?F=new THREE.PerspectiveCamera(E.fov,E.aspect,E.near,E.far):E.type=="ortho"&&(F=new THREE.OrthographicCamera(E.left,E.right,E.top,E.bottom,E.near,E.far)),A=E.position,E=E.target,F.position.set(A[0],A[1],A[2]),F.target=new THREE.Vector3(E[0],E[1],E[2]),U.cameras[x]=F;for(z in S.lights)x=S.lights[z],F=x.color!==void 0?x.color:16777215,E=x.intensity!==void 0?x.intensity: +1,x.type=="directional"?(A=x.direction,H=new THREE.DirectionalLight(F,E),H.position.set(A[0],A[1],A[2]),H.position.normalize()):x.type=="point"?(A=x.position,d=x.distance,H=new THREE.PointLight(F,E,d),H.position.set(A[0],A[1],A[2])):x.type=="ambient"&&(H=new THREE.AmbientLight(F)),U.scene.add(H),U.lights[z]=H;for(w in S.fogs)z=S.fogs[w],z.type=="linear"?G=new THREE.Fog(0,z.near,z.far):z.type=="exp2"&&(G=new THREE.FogExp2(0,z.density)),E=z.color,G.color.setRGB(E[0],E[1],E[2]),U.fogs[w]=G;if(U.cameras&& +S.defaults.camera)U.currentCamera=U.cameras[S.defaults.camera];if(U.fogs&&S.defaults.fog)U.scene.fog=U.fogs[S.defaults.fog];E=S.defaults.bgcolor;U.bgColor=new THREE.Color;U.bgColor.setRGB(E[0],E[1],E[2]);U.bgColorAlpha=S.defaults.bgalpha;for(p in S.geometries)if(w=S.geometries[p],w.type=="bin_mesh"||w.type=="ascii_mesh")V+=1,c.onLoadStart();O=V;for(p in S.geometries)w=S.geometries[p],w.type=="cube"?(L=new THREE.CubeGeometry(w.width,w.height,w.depth,w.segmentsWidth,w.segmentsHeight,w.segmentsDepth, +null,w.flipped,w.sides),U.geometries[p]=L):w.type=="plane"?(L=new THREE.PlaneGeometry(w.width,w.height,w.segmentsWidth,w.segmentsHeight),U.geometries[p]=L):w.type=="sphere"?(L=new THREE.SphereGeometry(w.radius,w.segmentsWidth,w.segmentsHeight),U.geometries[p]=L):w.type=="cylinder"?(L=new THREE.CylinderGeometry(w.topRad,w.botRad,w.height,w.radSegs,w.heightSegs),U.geometries[p]=L):w.type=="torus"?(L=new THREE.TorusGeometry(w.radius,w.tube,w.segmentsR,w.segmentsT),U.geometries[p]=L):w.type=="icosahedron"? +(L=new THREE.IcosahedronGeometry(w.subdivisions),U.geometries[p]=L):w.type=="bin_mesh"?N.load(e(w.url,S.urlBaseType),m(p)):w.type=="ascii_mesh"?J.load(e(w.url,S.urlBaseType),m(p)):w.type=="embedded_mesh"&&(w=S.embeds[w.id])&&J.createModel(w,t(p),"");for(B in S.textures)if(p=S.textures[B],p.url instanceof Array){X+=p.url.length;for(N=0;N=57344&&(b-=2048);b++;for(var c=new Float32Array(8*b),e=1,f=0;f<8;f++){for(var h=0,k=0;k>1^-(l&1);c[8*k+f]=h}e+=b}b=a.length-e;h=new Uint16Array(b);for(f=k=0;f=this.maxCount-3&&l(this)};this.begin=function(){this.count=0; -this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var b=this.count*3;bthis.size-1&&(n=this.size-1);var v=Math.floor(o-l);v<1&&(v=1);o=Math.floor(o+l);o>this.size-1&&(o=this.size-1);var t=Math.floor(u-l);t<1&&(t=1);l=Math.floor(u+l);l>this.size-1&&(l=this.size- -1);for(var y,x,w,B,A,z;p0&&(this.field[w+y]+=B)}}};this.addPlaneX=function(a,b){var f,k,h,l,n,o=this.size,u=this.yd,p=this.zd,v=this.field,t=o*Math.sqrt(a/b);t>o&&(t=o);for(f=0;f0)for(k=0;ku&&(y=u);for(k=0;k0){n=k*p;for(f=0;fsize&&(dist=size);for(h=0;h0){n=zd*h;for(k=0;k=this.maxCount-3&&l(this)};this.begin=function(){this.count=0; +this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var b=this.count*3;bthis.size-1&&(m=this.size-1);var v=Math.floor(t-l);v<1&&(v=1);t=Math.floor(t+l);t>this.size-1&&(t=this.size-1);var o=Math.floor(u-l);o<1&&(o=1);l=Math.floor(u+l);l>this.size-1&&(l=this.size- +1);for(var z,x,w,B,y,A;p0&&(this.field[w+z]+=B)}}};this.addPlaneX=function(a,b){var f,h,k,l,m,t=this.size,u=this.yd,p=this.zd,v=this.field,o=t*Math.sqrt(a/b);o>t&&(o=t);for(f=0;f0)for(h=0;hu&&(z=u);for(h=0;h0){m=h*p;for(f=0;fsize&&(dist=size);for(k=0;k0){m=zd*k;for(h=0;hk?this.hits.push(f):this.hits.unshift(f),k=e;return this.hits}; +THREE.CollisionSystem.prototype.rayCastAll=function(a){a.direction.normalize();this.hits.length=0;var b,c,e,f,h=0;b=0;for(c=this.colliders.length;bh?this.hits.push(f):this.hits.unshift(f),h=e;return this.hits}; THREE.CollisionSystem.prototype.rayCastNearest=function(a){var b=this.rayCastAll(a);if(b.length==0)return null;for(var c=0;b[c]instanceof THREE.MeshCollider;){var e=this.rayMesh(a,b[c]);if(e.distb.length)return null;return b[c]}; THREE.CollisionSystem.prototype.rayCast=function(a,b){if(b instanceof THREE.PlaneCollider)return this.rayPlane(a,b);else if(b instanceof THREE.SphereCollider)return this.raySphere(a,b);else if(b instanceof THREE.BoxCollider)return this.rayBox(a,b);else if(b instanceof THREE.MeshCollider&&b.box)return this.rayBox(a,b.box)}; -THREE.CollisionSystem.prototype.rayMesh=function(a,b){for(var c=this.makeRayLocal(a,b.mesh),e=Number.MAX_VALUE,f,k=0;k=l*f))return Number.MAX_VALUE;h/=l;l=THREE.CollisionSystem.__v3;l.copy(a.direction);l.multiplyScalar(h);l.addSelf(a.origin);Math.abs(k.x)> -Math.abs(k.y)?Math.abs(k.x)>Math.abs(k.z)?(a=l.y-b.y,k=c.y-b.y,f=e.y-b.y,l=l.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=l.x-b.x,k=c.x-b.x,f=e.x-b.x,l=l.y-b.y,c=c.y-b.y,e=e.y-b.y):Math.abs(k.y)>Math.abs(k.z)?(a=l.x-b.x,k=c.x-b.x,f=e.x-b.x,l=l.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=l.x-b.x,k=c.x-b.x,f=e.x-b.x,l=l.y-b.y,c=c.y-b.y,e=e.y-b.y);b=k*e-c*f;if(b==0)return Number.MAX_VALUE;b=1/b;e=(a*e-l*f)*b;if(!(e>=0))return Number.MAX_VALUE;b*=k*l-c*a;if(!(b>=0))return Number.MAX_VALUE;if(!(1-e-b>=0))return Number.MAX_VALUE;return h}; +THREE.CollisionSystem.prototype.rayMesh=function(a,b){for(var c=this.makeRayLocal(a,b.mesh),e=Number.MAX_VALUE,f,h=0;h=l*f))return Number.MAX_VALUE;k/=l;l=THREE.CollisionSystem.__v3;l.copy(a.direction);l.multiplyScalar(k);l.addSelf(a.origin);Math.abs(h.x)> +Math.abs(h.y)?Math.abs(h.x)>Math.abs(h.z)?(a=l.y-b.y,h=c.y-b.y,f=e.y-b.y,l=l.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=l.x-b.x,h=c.x-b.x,f=e.x-b.x,l=l.y-b.y,c=c.y-b.y,e=e.y-b.y):Math.abs(h.y)>Math.abs(h.z)?(a=l.x-b.x,h=c.x-b.x,f=e.x-b.x,l=l.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=l.x-b.x,h=c.x-b.x,f=e.x-b.x,l=l.y-b.y,c=c.y-b.y,e=e.y-b.y);b=h*e-c*f;if(b==0)return Number.MAX_VALUE;b=1/b;e=(a*e-l*f)*b;if(!(e>=0))return Number.MAX_VALUE;b*=h*l-c*a;if(!(b>=0))return Number.MAX_VALUE;if(!(1-e-b>=0))return Number.MAX_VALUE;return k}; THREE.CollisionSystem.prototype.makeRayLocal=function(a,b){var c=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(b.matrixWorld,c);var e=THREE.CollisionSystem.__r;e.origin.copy(a.origin);e.direction.copy(a.direction);c.multiplyVector3(e.origin);c.rotateAxis(e.direction);e.direction.normalize();return e}; -THREE.CollisionSystem.prototype.rayBox=function(a,b){var c;b.dynamic&&b.mesh&&b.mesh.matrixWorld?c=this.makeRayLocal(a,b.mesh):(c=THREE.CollisionSystem.__r,c.origin.copy(a.origin),c.direction.copy(a.direction));var e=0,f=0,k=0,h=0,l=0,n=0,o=!0;c.origin.xb.max.x&&(e=b.max.x-c.origin.x,e/=c.direction.x,o=!1,h=1);c.origin.yb.max.y&&(f=b.max.y-c.origin.y,f/=c.direction.y, -o=!1,l=1);c.origin.zb.max.z&&(k=b.max.z-c.origin.z,k/=c.direction.z,o=!1,n=1);if(o)return-1;o=0;f>e&&(o=1,e=f);k>e&&(o=2,e=k);switch(o){case 0:l=c.origin.y+c.direction.y*e;if(lb.max.y)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*e;if(cb.max.z)return Number.MAX_VALUE;b.normal.set(h,0,0);break;case 1:h=c.origin.x+c.direction.x*e;if(hb.max.x)return Number.MAX_VALUE;c=c.origin.z+c.direction.z* -e;if(cb.max.z)return Number.MAX_VALUE;b.normal.set(0,l,0);break;case 2:h=c.origin.x+c.direction.x*e;if(hb.max.x)return Number.MAX_VALUE;l=c.origin.y+c.direction.y*e;if(lb.max.y)return Number.MAX_VALUE;b.normal.set(0,0,n)}return e};THREE.CollisionSystem.prototype.rayPlane=function(a,b){var c=a.direction.dot(b.normal),e=b.point.dot(b.normal);if(c<0)c=(e-a.origin.dot(b.normal))/c;else return Number.MAX_VALUE;return c>0?c:Number.MAX_VALUE}; +THREE.CollisionSystem.prototype.rayBox=function(a,b){var c;b.dynamic&&b.mesh&&b.mesh.matrixWorld?c=this.makeRayLocal(a,b.mesh):(c=THREE.CollisionSystem.__r,c.origin.copy(a.origin),c.direction.copy(a.direction));var e=0,f=0,h=0,k=0,l=0,m=0,t=!0;c.origin.xb.max.x&&(e=b.max.x-c.origin.x,e/=c.direction.x,t=!1,k=1);c.origin.yb.max.y&&(f=b.max.y-c.origin.y,f/=c.direction.y, +t=!1,l=1);c.origin.zb.max.z&&(h=b.max.z-c.origin.z,h/=c.direction.z,t=!1,m=1);if(t)return-1;t=0;f>e&&(t=1,e=f);h>e&&(t=2,e=h);switch(t){case 0:l=c.origin.y+c.direction.y*e;if(lb.max.y)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*e;if(cb.max.z)return Number.MAX_VALUE;b.normal.set(k,0,0);break;case 1:k=c.origin.x+c.direction.x*e;if(kb.max.x)return Number.MAX_VALUE;c=c.origin.z+c.direction.z* +e;if(cb.max.z)return Number.MAX_VALUE;b.normal.set(0,l,0);break;case 2:k=c.origin.x+c.direction.x*e;if(kb.max.x)return Number.MAX_VALUE;l=c.origin.y+c.direction.y*e;if(lb.max.y)return Number.MAX_VALUE;b.normal.set(0,0,m)}return e};THREE.CollisionSystem.prototype.rayPlane=function(a,b){var c=a.direction.dot(b.normal),e=b.point.dot(b.normal);if(c<0)c=(e-a.origin.dot(b.normal))/c;else return Number.MAX_VALUE;return c>0?c:Number.MAX_VALUE}; THREE.CollisionSystem.prototype.raySphere=function(a,b){var c=b.center.clone().subSelf(a.origin);if(c.lengthSq=0)return Math.abs(e)-Math.sqrt(c);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4; THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(a){a.geometry.computeBoundingBox();var b=a.geometry.boundingBox,c=new THREE.Vector3(b.x[0],b.y[0],b.z[0]),b=new THREE.Vector3(b.x[1],b.y[1],b.z[1]),c=new THREE.BoxCollider(c,b);c.mesh=a;return c};THREE.CollisionUtils.MeshAABB=function(a){var b=THREE.CollisionUtils.MeshOBB(a);b.min.addSelf(a.position);b.max.addSelf(a.position);b.dynamic=!1;return b}; THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))}; -if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,e=this.render,f=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,h=new THREE.Matrix4,l=new THREE.Matrix4,n,o,u;f.matrixAutoUpdate=k.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},p=new THREE.WebGLRenderTarget(512,512,a),v=new THREE.WebGLRenderTarget(512,512,a),t=new THREE.PerspectiveCamera(53,1,1,1E4);t.position.z= +if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,e=this.render,f=new THREE.PerspectiveCamera,h=new THREE.PerspectiveCamera,k=new THREE.Matrix4,l=new THREE.Matrix4,m,t,u;f.matrixAutoUpdate=h.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},p=new THREE.WebGLRenderTarget(512,512,a),v=new THREE.WebGLRenderTarget(512,512,a),o=new THREE.PerspectiveCamera(53,1,1,1E4);o.position.z= 2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:p},mapRight:{type:"t",value:1,texture:v}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); -var y=new THREE.Scene;y.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){c.call(b,a,e);p.width=a;p.height=e;v.width=a;v.height=e};this.render=function(a,c){c.update(null,!0);if(n!==c.aspect||o!==c.near||u!==c.fov){n=c.aspect;o=c.near;u=c.fov;var B=c.projectionMatrix.clone(),A=125/30*0.5,z=A*o/125,C=o*Math.tan(u*Math.PI/360),E;h.n14=A;l.n14=-A;A=-C*n+z;E=C*n+z;B.n11=2*o/(E-A);B.n13=(E+A)/(E-A);f.projectionMatrix=B.clone();A=-C*n-z;E=C*n-z;B.n11=2*o/(E-A);B.n13= -(E+A)/(E-A);k.projectionMatrix=B.clone()}f.matrix=c.matrixWorld.clone().multiplySelf(l);f.update(null,!0);f.position.copy(c.position);f.near=o;f.far=c.far;e.call(b,a,f,p,!0);k.matrix=c.matrixWorld.clone().multiplySelf(h);k.update(null,!0);k.position.copy(c.position);k.near=o;k.far=c.far;e.call(b,a,k,v,!0);e.call(b,y,t)}}; -if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,e=this.render,f,k,h=new THREE.PerspectiveCamera;h.target=new THREE.Vector3(0,0,0);var l=new THREE.PerspectiveCamera;l.target=new THREE.Vector3(0,0,0);b.separation=10;if(a&&a.separation!==void 0)b.separation=a.separation;this.setSize=function(a,e){c.call(b,a,e);f=a/2;k=e};this.render=function(a,c){this.clear();h.fov=c.fov;h.aspect=0.5*c.aspect;h.near=c.near;h.far= -c.far;h.updateProjectionMatrix();h.position.copy(c.position);h.target.copy(c.target);h.translateX(b.separation);h.lookAt(h.target);l.projectionMatrix=h.projectionMatrix;l.position.copy(c.position);l.target.copy(c.target);l.translateX(-b.separation);l.lookAt(l.target);this.setViewport(0,0,f,k);e.call(b,a,h);this.setViewport(f,0,f,k);e.call(b,a,l,!1)}}; +var z=new THREE.Scene;z.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){c.call(b,a,e);p.width=a;p.height=e;v.width=a;v.height=e};this.render=function(a,c){c.update(null,!0);if(m!==c.aspect||t!==c.near||u!==c.fov){m=c.aspect;t=c.near;u=c.fov;var B=c.projectionMatrix.clone(),y=125/30*0.5,A=y*t/125,E=t*Math.tan(u*Math.PI/360),C;k.n14=y;l.n14=-y;y=-E*m+A;C=E*m+A;B.n11=2*t/(C-y);B.n13=(C+y)/(C-y);f.projectionMatrix=B.clone();y=-E*m-A;C=E*m-A;B.n11=2*t/(C-y);B.n13= +(C+y)/(C-y);h.projectionMatrix=B.clone()}f.matrix=c.matrixWorld.clone().multiplySelf(l);f.update(null,!0);f.position.copy(c.position);f.near=t;f.far=c.far;e.call(b,a,f,p,!0);h.matrix=c.matrixWorld.clone().multiplySelf(k);h.update(null,!0);h.position.copy(c.position);h.near=t;h.far=c.far;e.call(b,a,h,v,!0);e.call(b,z,o)}}; +if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,e=this.render,f,h,k=new THREE.PerspectiveCamera;k.target=new THREE.Vector3(0,0,0);var l=new THREE.PerspectiveCamera;l.target=new THREE.Vector3(0,0,0);b.separation=10;if(a&&a.separation!==void 0)b.separation=a.separation;this.setSize=function(a,e){c.call(b,a,e);f=a/2;h=e};this.render=function(a,c){this.clear();k.fov=c.fov;k.aspect=0.5*c.aspect;k.near=c.near;k.far= +c.far;k.updateProjectionMatrix();k.position.copy(c.position);k.target.copy(c.target);k.translateX(b.separation);k.lookAt(k.target);l.projectionMatrix=k.projectionMatrix;l.position.copy(c.position);l.target.copy(c.target);l.translateX(-b.separation);l.lookAt(l.target);this.setViewport(0,0,f,h);e.call(b,a,k);this.setViewport(f,0,f,h);e.call(b,a,l,!1)}}; diff --git a/build/custom/ThreeCanvas.js b/build/custom/ThreeCanvas.js index a28800c6..cbb96193 100644 --- a/build/custom/ThreeCanvas.js +++ b/build/custom/ThreeCanvas.js @@ -70,9 +70,10 @@ this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRo 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,e=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+f*e+c*h-d*g;this.y=c*a+f*g+d*e-b*h;this.z=d*a+f*h+b*g-c*e;this.w=f*a-b*e-c*g-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,f=a.z,e=this.x,g=this.y,h=this.z,m=this.w,k=m*c+g*f-h*d,l=m*d+h*c-e*f,i=m*f+e*d-g*c,c=-e* c-g*d-h*f;b.x=k*m+c*-e+l*-h-i*-g;b.y=l*m+c*-g+i*-e-k*-h;b.z=i*m+c*-h+k*-g-l*-e;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;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var e=Math.acos(f),g=Math.sqrt(1-f*f);if(Math.abs(g)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-d)*e)/g;d=Math.sin(d*e)/g;c.w=a.w*f+b.w*d;c.x=a.x*f+b.x*d;c.y=a.y*f+b.y*d;c.z=a.z*f+b.z*d;return c}; -THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,f,e){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.materials=e instanceof Array?e:[e];this.centroid=new THREE.Vector3}; -THREE.Face4=function(a,b,c,d,f,e,g){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=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; -THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; +THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,f,e){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=e;this.centroid=new THREE.Vector3}; +THREE.Face4=function(a,b,c,d,f,e,g){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=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; +THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}}; +THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,d=this.vertices.length;c=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c}; -THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3}; -THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=f instanceof Array?f:[f];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; +THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3}; +THREE.Face4=function(a,b,c,d,e,g,f){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}}; THREE.Camera=function(){if(arguments.length)return console.warn("DEPRECATED: Camera() is now PerspectiveCamera() or OrthographicCamera()."),new THREE.PerspectiveCamera(arguments[0],arguments[1],arguments[2],arguments[3]);THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera; THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)}; @@ -80,8 +80,7 @@ THREE.OrthographicCamera=function(a,b,c,d,e,g){THREE.Camera.call(this);this.left 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:43.25)/(a*2));this.fov*=180/Math.PI;this.updateProjectionMatrix()}; THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=g;this.updateProjectionMatrix()}; THREE.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.ParticleDOMMaterial=function(a){THREE.Material.call(this);this.domElement=a};THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone; -THREE.Bone.prototype.supr=THREE.Object3D.prototype; +this.far)};THREE.ParticleDOMMaterial=function(a){THREE.Material.call(this);this.domElement=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.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype; THREE.Bone.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;var d,e=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(d=0;d1&&(b-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=b;c.s=g;c.v=h;return c}}; THREE.ColorUtils.__hsv={h:0,s:0,v:0}; -THREE.GeometryUtils={merge:function(a,c){var b,e,f=a.vertices.length,h=c instanceof THREE.Mesh?c.geometry:c,g=a.vertices,k=h.vertices,l=a.faces,m=h.faces,n=a.faceVertexUvs[0],h=h.faceVertexUvs[0];if(c instanceof THREE.Mesh)c.matrixAutoUpdate&&c.updateMatrix(),b=c.matrix,e=new THREE.Matrix4,e.extractRotation(b,c.scale);for(var o=0,t=k.length;o1&&(e=1-e,f=1-f);h=1-e-f;g.copy(a);g.multiplyScalar(e);k.copy(c);k.multiplyScalar(f);g.addSelf(k);k.copy(b);k.multiplyScalar(h);g.addSelf(k);return g},randomPointInFace:function(a,c,b){var e,f,h;if(a instanceof THREE.Face3)return e=c.vertices[a.a].position,f=c.vertices[a.b].position,h=c.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(e,f,h);else if(a instanceof THREE.Face4){e=c.vertices[a.a].position;f=c.vertices[a.b].position;h=c.vertices[a.c].position;var c=c.vertices[a.d].position, -g;b?a._area1&&a._area2?(b=a._area1,g=a._area2):(b=THREE.GeometryUtils.triangleArea(e,f,c),g=THREE.GeometryUtils.triangleArea(f,h,c),a._area1=b,a._area2=g):(b=THREE.GeometryUtils.triangleArea(e,f,c),g=THREE.GeometryUtils.triangleArea(f,h,c));return THREE.GeometryUtils.random()*(b+g) -a?b(e,g-1):m[g]1&&(e=1-e,f=1-f);h=1-e-f;g.copy(a);g.multiplyScalar(e);k.copy(c);k.multiplyScalar(f);g.addSelf(k);k.copy(b);k.multiplyScalar(h);g.addSelf(k);return g},randomPointInFace:function(a,c,b){var e,f,h;if(a instanceof THREE.Face3)return e=c.vertices[a.a].position,f=c.vertices[a.b].position, +h=c.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(e,f,h);else if(a instanceof THREE.Face4){e=c.vertices[a.a].position;f=c.vertices[a.b].position;h=c.vertices[a.c].position;var c=c.vertices[a.d].position,g;b?a._area1&&a._area2?(b=a._area1,g=a._area2):(b=THREE.GeometryUtils.triangleArea(e,f,c),g=THREE.GeometryUtils.triangleArea(f,h,c),a._area1=b,a._area2=g):(b=THREE.GeometryUtils.triangleArea(e,f,c),g=THREE.GeometryUtils.triangleArea(f,h,c));return THREE.GeometryUtils.random()*(b+ +g)a?b(e,g-1):m[g]0?(g=b[b.length-1],u=g.x,v=g.y):(g=this.actions[e-1].args,u=g[g.length-2],v=g[g.length-1]);for(g=1;g<=a;g++)y=g/a,h=THREE.Shape.Utils.b2(y,u,o,k),y=THREE.Shape.Utils.b2(y,v,t, -l),b.push(new THREE.Vector2(h,y));break;case THREE.PathActions.BEZIER_CURVE_TO:k=h[4];l=h[5];o=h[0];t=h[1];m=h[2];n=h[3];b.length>0?(g=b[b.length-1],u=g.x,v=g.y):(g=this.actions[e-1].args,u=g[g.length-2],v=g[g.length-1]);for(g=1;g<=a;g++)y=g/a,h=THREE.Shape.Utils.b3(y,u,o,m,k),y=THREE.Shape.Utils.b3(y,v,t,n,l),b.push(new THREE.Vector2(h,y));break;case THREE.PathActions.CSPLINE_THRU:g=this.actions[e-1].args;g=[new THREE.Vector2(g[g.length-2],g[g.length-1])];y=a*h[0].length;g=g.concat(h[0]);h=new THREE.SplineCurve(g); -for(g=1;g<=y;g++)b.push(h.getPointAt(g/y));break;case THREE.PathActions.ARC:g=this.actions[e-1].args;k=h[0];l=h[1];m=h[2];o=h[3];y=h[4];t=!!h[5];n=g[g.length-2];u=g[g.length-1];g.length==0&&(n=u=0);v=y-o;var p=a*2;for(g=1;g<=p;g++)y=g/p,t||(y=1-y),y=o+y*v,h=n+k+m*Math.cos(y),y=u+l+m*Math.sin(y),b.push(new THREE.Vector2(h,y))}c&&b.push(b[0]);return b};THREE.Path.prototype.transform=function(a,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),a)}; +THREE.Path.prototype.getPoints=function(a,c){var a=a||12,b=[],e,f,h,g,k,l,m,n,o,u,t,z,v;e=0;for(f=this.actions.length;e0?(g=b[b.length-1],t=g.x,z=g.y):(g=this.actions[e-1].args,t=g[g.length-2],z=g[g.length-1]);for(g=1;g<=a;g++)v=g/a,h=THREE.Shape.Utils.b2(v,t,o,k),v=THREE.Shape.Utils.b2(v,z,u, +l),b.push(new THREE.Vector2(h,v));break;case THREE.PathActions.BEZIER_CURVE_TO:k=h[4];l=h[5];o=h[0];u=h[1];m=h[2];n=h[3];b.length>0?(g=b[b.length-1],t=g.x,z=g.y):(g=this.actions[e-1].args,t=g[g.length-2],z=g[g.length-1]);for(g=1;g<=a;g++)v=g/a,h=THREE.Shape.Utils.b3(v,t,o,m,k),v=THREE.Shape.Utils.b3(v,z,u,n,l),b.push(new THREE.Vector2(h,v));break;case THREE.PathActions.CSPLINE_THRU:g=this.actions[e-1].args;g=[new THREE.Vector2(g[g.length-2],g[g.length-1])];v=a*h[0].length;g=g.concat(h[0]);h=new THREE.SplineCurve(g); +for(g=1;g<=v;g++)b.push(h.getPointAt(g/v));break;case THREE.PathActions.ARC:g=this.actions[e-1].args;k=h[0];l=h[1];m=h[2];o=h[3];v=h[4];u=!!h[5];n=g[g.length-2];t=g[g.length-1];g.length==0&&(n=t=0);z=v-o;var p=a*2;for(g=1;g<=p;g++)v=g/p,u||(v=1-v),v=o+v*z,h=n+k+m*Math.cos(v),v=t+l+m*Math.sin(v),b.push(new THREE.Vector2(h,v))}c&&b.push(b[0]);return b};THREE.Path.prototype.transform=function(a,c){this.getBoundingBox();return this.getWrapPoints(this.getPoints(c),a)}; THREE.Path.prototype.nltransform=function(a,c,b,e,f,h){var g=this.getPoints(),k,l,m,n,o;k=0;for(l=g.length;k=0?k-1:b.length-1;h=g-1>=0?g-1:m.length-1;var y=[m[g],b[k],b[f]];o=THREE.FontUtils.Triangulate.area(y);var p=[m[g],m[h],b[k]];t=THREE.FontUtils.Triangulate.area(p);u=k;n=g;k+=1;g+=-1;k< -0&&(k+=b.length);k%=b.length;g<0&&(g+=m.length);g%=m.length;f=k-1>=0?k-1:b.length-1;h=g-1>=0?g-1:m.length-1;y=[m[g],b[k],b[f]];y=THREE.FontUtils.Triangulate.area(y);p=[m[g],m[h],b[k]];p=THREE.FontUtils.Triangulate.area(p);o+t>y+p&&(k=u,g=n,k<0&&(k+=b.length),k%=b.length,g<0&&(g+=m.length),g%=m.length,f=k-1>=0?k-1:b.length-1,h=g-1>=0?g-1:m.length-1);o=b.slice(0,k);t=b.slice(k);u=m.slice(g);n=m.slice(0,g);h=[m[g],m[h],b[k]];v.push([m[g],b[k],b[f]]);v.push(h);b=o.concat(u).concat(n).concat(t)}return{shape:b, -isolatedPts:v,allpoints:e}},triangulateShape:function(a,c){var b=THREE.Shape.Utils.removeHoles(a,c),e=b.allpoints,f=b.isolatedPts,b=THREE.FontUtils.Triangulate(b.shape,!1),h,g,k,l,m={};h=0;for(g=e.length;h=0?k-1:b.length-1;h=g-1>=0?g-1:m.length-1;var v=[m[g],b[k],b[f]];o=THREE.FontUtils.Triangulate.area(v);var p=[m[g],m[h],b[k]];u=THREE.FontUtils.Triangulate.area(p);t=k;n=g;k+=1;g+=-1;k< +0&&(k+=b.length);k%=b.length;g<0&&(g+=m.length);g%=m.length;f=k-1>=0?k-1:b.length-1;h=g-1>=0?g-1:m.length-1;v=[m[g],b[k],b[f]];v=THREE.FontUtils.Triangulate.area(v);p=[m[g],m[h],b[k]];p=THREE.FontUtils.Triangulate.area(p);o+u>v+p&&(k=t,g=n,k<0&&(k+=b.length),k%=b.length,g<0&&(g+=m.length),g%=m.length,f=k-1>=0?k-1:b.length-1,h=g-1>=0?g-1:m.length-1);o=b.slice(0,k);u=b.slice(k);t=m.slice(g);n=m.slice(0,g);h=[m[g],m[h],b[k]];z.push([m[g],b[k],b[f]]);z.push(h);b=o.concat(t).concat(n).concat(u)}return{shape:b, +isolatedPts:z,allpoints:e}},triangulateShape:function(a,c){var b=THREE.Shape.Utils.removeHoles(a,c),e=b.allpoints,f=b.isolatedPts,b=THREE.FontUtils.Triangulate(b.shape,!1),h,g,k,l,m={};h=0;for(g=e.length;h1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+u),e=e<0?0:1;if(b==="pos")if(b=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)b.x=f[0]+(h[0]-f[0])*e,b.y=f[1]+(h[1]-f[1])*e,b.z=f[2]+(h[2]-f[2])*e;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= -this.getPrevKeyWith("pos",u,g.index-1).pos,this.points[1]=f,this.points[2]=h,this.points[3]=this.getNextKeyWith("pos",u,k.index+1).pos,e=e*0.33+0.33,f=this.interpolateCatmullRom(this.points,e),b.x=f[0],b.y=f[1],b.z=f[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)e=this.interpolateCatmullRom(this.points,e*1.01),this.target.set(e[0],e[1],e[2]),this.target.subSelf(b),this.target.y=0,this.target.normalize(),e=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,e,0)}else if(b=== -"rot")THREE.Quaternion.slerp(f,h,a.quaternion,e);else if(b==="scl")b=a.scale,b.x=f[0]+(h[0]-f[0])*e,b.y=f[1]+(h[1]-f[1])*e,b.z=f[2]+(h[2]-f[2])*e}}if(this.JITCompile&&n[0][m]===void 0){this.hierarchy[0].update(void 0,!0);for(u=0;u1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+t),e=e<0?0:1;if(b==="pos")if(b=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)b.x=f[0]+(h[0]-f[0])*e,b.y=f[1]+(h[1]-f[1])*e,b.z=f[2]+(h[2]-f[2])*e;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= +this.getPrevKeyWith("pos",t,g.index-1).pos,this.points[1]=f,this.points[2]=h,this.points[3]=this.getNextKeyWith("pos",t,k.index+1).pos,e=e*0.33+0.33,f=this.interpolateCatmullRom(this.points,e),b.x=f[0],b.y=f[1],b.z=f[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)e=this.interpolateCatmullRom(this.points,e*1.01),this.target.set(e[0],e[1],e[2]),this.target.subSelf(b),this.target.y=0,this.target.normalize(),e=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,e,0)}else if(b=== +"rot")THREE.Quaternion.slerp(f,h,a.quaternion,e);else if(b==="scl")b=a.scale,b.x=f[0]+(h[0]-f[0])*e,b.y=f[1]+(h[1]-f[1])*e,b.z=f[2]+(h[2]-f[2])*e}}if(this.JITCompile&&n[0][m]===void 0){this.hierarchy[0].update(void 0,!0);for(t=0;ta.length-2?h:h+1;b[3]=h>a.length-3?h:h+2;h=a[b[0]];k=a[b[1]];l=a[b[2]];m=a[b[3]];b=f*f;g=f*b;e[0]=this.interpolate(h[0],k[0],l[0],m[0],f,b,g);e[1]=this.interpolate(h[1],k[1],l[1],m[1],f,b,g);e[2]=this.interpolate(h[2],k[2],l[2],m[2],f,b,g);return e}; THREE.Animation.prototype.interpolate=function(a,c,b,e,f,h,g){a=(b-a)*0.5;e=(e-c)*0.5;return(2*(c-b)+a+e)*g+(-3*(c-b)-2*a-e)*h+a*f+c};THREE.Animation.prototype.getNextKeyWith=function(a,c,b){var e=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?b=b0?b:0:b>=0?b:b+e.length;b>=0;b--)if(e[b][a]!==void 0)return e[b];return this.data.hierarchy[c].keys[e.length-1]}; @@ -101,7 +101,7 @@ function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!0;break;case 37: this.moveUp&&this.object.translateY(b);this.moveDown&&this.object.translateY(-b);b=a*this.lookSpeed;this.activeLook||(b=0);this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var a=this.target,c=this.object.position;a.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=c.y+100*Math.cos(this.phi);a.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta)}a=1;this.constrainVertical&& (a=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b*a);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);a=this.target;c=this.object.position;a.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=c.y+100*Math.cos(this.phi);a.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta); this.object.lookAt(a)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",b(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",b(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",b(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",b(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",b(this,this.onKeyUp),!1)}; -THREE.PathControls=function(a,c){function b(a){if((a*=2)<1)return 0.5*a*a;return-0.5*(--a*(a-2)-1)}function e(a,b){return function(){b.apply(a,arguments)}}function f(a,b,e,c){var g={name:e,fps:0.6,length:c,hierarchy:[]},h,f=b.getControlPointsArray(),k=b.getLength(),p=f.length,z=0;h=p-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:f[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[h]={time:c,pos:f[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h=0?a:a+g;e=this.verticalAngleMap.srcRange; @@ -119,12 +119,12 @@ THREE.FlyControls=function(a,c){function b(a,b){return function(){b.apply(a,argu this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z= -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",b(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",b(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",b(this, this.mouseup),!1);this.domElement.addEventListener("keydown",b(this,this.keydown),!1);this.domElement.addEventListener("keyup",b(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(a,c){this.object=a;this.domElement=c!==void 0?c:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var b=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Matrix4,g=!1,k=1,l=0,m=0,n=0,o=0,t=0,u=window.innerWidth/2,v=window.innerHeight/2;this.update=function(a){if(this.mouseLook){var c=a*this.lookSpeed; -this.rotateHorizontally(c*o);this.rotateVertically(c*t)}c=a*this.movementSpeed;this.object.translateZ(-c*(l>0||this.autoForward&&!(l<0)?1:l));this.object.translateX(c*m);this.object.translateY(c*n);g&&(this.roll+=this.rollSpeed*a*k);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y0||this.autoForward&&!(l<0)?1:l));this.object.translateX(c*m);this.object.translateY(c*n);g&&(this.roll+=this.rollSpeed*a*k);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,g,0)));for(k=0;k0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-g,0)));for(k=0;k0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,g,0)));for(k=0;k0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-g,0)));for(k=0;ka&&(a+=Math.PI*2),anglec=(b+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(k).subSelf(a).clone()}function f(a){for(C=a.length;--C>=0;){R=C;S=C-1;S<0&&(S=a.length- -1);for(var b=0,c=u+n*2,b=0;ba&&(a+=Math.PI*2),anglec=(b+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(k).subSelf(a).clone()}function f(a){for(C=a.length;--C>=0;){S=C;T=C-1;T<0&&(T=a.length- +1);for(var b=0,c=t+n*2,b=0;b=0;J--){M=J/n;N=l*(1-M);M=m*Math.sin(M*Math.PI/2);C=0;for(F=x.length;C=0;J--){M=J/n;N=l*(1-M);M=m*Math.sin(M*Math.PI/2);C=0;for(F=x.length;C0||(n=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,k,t)))-1);m.push(n)}c.push(m)}for(var u,v,y,f=c.length,b=0;b0)for(e=0;e1&&(u= -this.vertices[g].position.clone(),v=this.vertices[l].position.clone(),y=this.vertices[m].position.clone(),u.normalize(),v.normalize(),y.normalize(),this.faces.push(new THREE.Face3(g,l,m,[new THREE.Vector3(u.x,u.y,u.z),new THREE.Vector3(v.x,v.y,v.z),new THREE.Vector3(y.x,y.y,y.z)])),this.faceVertexUvs[0].push([n,o,p]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry; +THREE.SphereGeometry=function(a,c,b){THREE.Geometry.call(this);for(var a=a||50,e,f=Math.PI,h=Math.max(3,c||8),g=Math.max(2,b||6),c=[],b=0;b0||(n=this.vertices.push(new THREE.Vertex(new THREE.Vector3(o,k,u)))-1);m.push(n)}c.push(m)}for(var t,z,v,f=c.length,b=0;b0)for(e=0;e1&&(t= +this.vertices[g].position.clone(),z=this.vertices[l].position.clone(),v=this.vertices[m].position.clone(),t.normalize(),z.normalize(),v.normalize(),this.faces.push(new THREE.Face3(g,l,m,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(v.x,v.y,v.z)])),this.faceVertexUvs[0].push([n,o,p]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry; THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry; THREE.TextGeometry=function(a,c){var b=(new THREE.TextPath(a,c)).toShapes();c.amount=c.height!==void 0?c.height:50;if(c.bevelThickness===void 0)c.bevelThickness=10;if(c.bevelSize===void 0)c.bevelSize=8;if(c.bevelEnabled===void 0)c.bevelEnabled=!1;if(c.bend){var e=b[b.length-1].getBoundingBox().maxX;c.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(e/2,120),new THREE.Vector2(e,0))}THREE.ExtrudeGeometry.call(this,b,c)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry; THREE.TextGeometry.prototype.constructor=THREE.TextGeometry; THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(a,c){return(new TextPath(a,c)).toShapes()},loadFace:function(a){var c=a.familyName.toLowerCase();this.faces[c]=this.faces[c]||{};this.faces[c][a.cssFontWeight]=this.faces[c][a.cssFontWeight]||{};this.faces[c][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[c][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){for(var c= -this.getFace(),b=this.size/c.resolution,e=0,f=String(a).split(""),h=f.length,g=[],a=0;a0)for(m=0;m2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return k;return h}l=m;f<=l&&(l=0);m=l+1;f<=m&&(m=0);n=m+1;f<=n&&(n=0);var t;a:{t=a;var u=l,v=m,y=n,p=f,z=g,x=void 0,w=void 0,A=void 0, -D=void 0,B=void 0,E=void 0,I=void 0,G=void 0,K=void 0,w=t[z[u]].x,A=t[z[u]].y,D=t[z[v]].x,B=t[z[v]].y,E=t[z[y]].x,I=t[z[y]].y;if(1.0E-10>(D-w)*(I-A)-(B-A)*(E-w))t=!1;else{for(x=0;x=0&&J>=0&&N>=0){t=!1;break a}}t=!0}}if(t){h.push([a[g[l]], +this.getFace(),b=this.size/c.resolution,e=0,f=String(a).split(""),h=f.length,g=[],a=0;a0)for(m=0;m2;){if(o--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return k;return h}l=m;f<=l&&(l=0);m=l+1;f<=m&&(m=0);n=m+1;f<=n&&(n=0);var u;a:{u=a;var t=l,z=m,v=n,p=f,y=g,x=void 0,w=void 0,A=void 0, +D=void 0,B=void 0,E=void 0,I=void 0,G=void 0,L=void 0,w=u[y[t]].x,A=u[y[t]].y,D=u[y[z]].x,B=u[y[z]].y,E=u[y[v]].x,I=u[y[v]].y;if(1.0E-10>(D-w)*(I-A)-(B-A)*(E-w))u=!1;else{for(x=0;x=0&&J>=0&&N>=0){u=!1;break a}}u=!0}}if(u){h.push([a[g[l]], a[g[m]],a[g[n]]]);k.push([g[l],g[m],g[n]]);l=m;for(n=m+1;n0;)this.smooth(a)}; -THREE.SubdivisionModifier.prototype.smooth=function(a){function c(a,b,c,e,k,l){var m=new THREE.Face4(a,b,c,e,null,k.color,k.material);if(g.useOldVertexColors){m.vertexColors=[];for(var n,p,u,t=0;t<4;t++){u=l[t];n=new THREE.Color;n.setRGB(0,0,0);for(var v=0;v>7)-127;e|=(f&127)<<16|g<<8;if(e==0&&k==-127)return 0;return(1-2*(h>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,k)}function f(a,b){var c=n(a,b),e=n(a,b+1),g=n(a,b+2);return(n(a,b+3)<<24)+(g<<16)+(e<<8)+c}function l(a,b){var c=n(a,b);return(n(a,b+1)<<8)+c}function m(a,b){var c=n(a,b);return c>127?c-256:c}function n(a,b){return a.charCodeAt(b)&255}function o(b){var c, -e,g;c=f(a,b);e=f(a,b+B);g=f(a,b+E);b=l(a,b+I);z.faces.push(new THREE.Face3(c,e,g,null,null,z.materials[b]))}function t(b){var c,e,g,h,m,o;c=f(a,b);e=f(a,b+B);g=f(a,b+E);h=l(a,b+I);m=f(a,b+G);o=f(a,b+K);b=f(a,b+C);h=z.materials[h];var n=A[o*3],p=A[o*3+1];o=A[o*3+2];var t=A[b*3],u=A[b*3+1],b=A[b*3+2];z.faces.push(new THREE.Face3(c,e,g,[new THREE.Vector3(A[m*3],A[m*3+1],A[m*3+2]),new THREE.Vector3(n,p,o),new THREE.Vector3(t,u,b)],null,h))}function u(b){var c,e,g,h;c=f(a,b);e=f(a,b+F);g=f(a,b+J);h=f(a, -b+M);b=l(a,b+N);z.faces.push(new THREE.Face4(c,e,g,h,null,null,z.materials[b]))}function v(b){var c,e,g,h,m,o,n,p;c=f(a,b);e=f(a,b+F);g=f(a,b+J);h=f(a,b+M);m=l(a,b+N);o=f(a,b+L);n=f(a,b+O);p=f(a,b+H);b=f(a,b+Q);m=z.materials[m];var t=A[n*3],u=A[n*3+1];n=A[n*3+2];var la=A[p*3],ma=A[p*3+1];p=A[p*3+2];var na=A[b*3],v=A[b*3+1],b=A[b*3+2];z.faces.push(new THREE.Face4(c,e,g,h,[new THREE.Vector3(A[o*3],A[o*3+1],A[o*3+2]),new THREE.Vector3(t,u,n),new THREE.Vector3(la,ma,p),new THREE.Vector3(na,v,b)],null, -m))}function y(b){var c,e,g,h;c=f(a,b);e=f(a,b+P);g=f(a,b+T);b=D[c*2];h=D[c*2+1];c=D[e*2];var l=z.faceVertexUvs[0];e=D[e*2+1];var m=D[g*2];g=D[g*2+1];var o=[];o.push(new THREE.UV(b,h));o.push(new THREE.UV(c,e));o.push(new THREE.UV(m,g));l.push(o)}function p(b){var c,e,g,h,l,m;c=f(a,b);e=f(a,b+X);g=f(a,b+R);h=f(a,b+S);b=D[c*2];l=D[c*2+1];c=D[e*2];m=D[e*2+1];e=D[g*2];var o=z.faceVertexUvs[0];g=D[g*2+1];var n=D[h*2];h=D[h*2+1];var p=[];p.push(new THREE.UV(b,l));p.push(new THREE.UV(c,m));p.push(new THREE.UV(e, -g));p.push(new THREE.UV(n,h));o.push(p)}var z=this,x=0,w,A=[],D=[],B,E,I,G,K,C,F,J,M,N,L,O,H,Q,P,T,X,R,S,W,U,Z,Y,$,V;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(z,e,b);w={signature:a.substr(x,8),header_bytes:n(a,x+8),vertex_coordinate_bytes:n(a,x+9),normal_coordinate_bytes:n(a,x+10),uv_coordinate_bytes:n(a,x+11),vertex_index_bytes:n(a,x+12),normal_index_bytes:n(a,x+13),uv_index_bytes:n(a,x+14),material_index_bytes:n(a,x+15),nvertices:f(a,x+16),nnormals:f(a,x+16+4),nuvs:f(a,x+16+ -8),ntri_flat:f(a,x+16+12),ntri_smooth:f(a,x+16+16),ntri_flat_uv:f(a,x+16+20),ntri_smooth_uv:f(a,x+16+24),nquad_flat:f(a,x+16+28),nquad_smooth:f(a,x+16+32),nquad_flat_uv:f(a,x+16+36),nquad_smooth_uv:f(a,x+16+40)};x+=w.header_bytes;B=w.vertex_index_bytes;E=w.vertex_index_bytes*2;I=w.vertex_index_bytes*3;G=w.vertex_index_bytes*3+w.material_index_bytes;K=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes;C=w.vertex_index_bytes*3+w.material_index_bytes+w.normal_index_bytes*2;F=w.vertex_index_bytes; -J=w.vertex_index_bytes*2;M=w.vertex_index_bytes*3;N=w.vertex_index_bytes*4;L=w.vertex_index_bytes*4+w.material_index_bytes;O=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes;H=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*2;Q=w.vertex_index_bytes*4+w.material_index_bytes+w.normal_index_bytes*3;P=w.uv_index_bytes;T=w.uv_index_bytes*2;X=w.uv_index_bytes;R=w.uv_index_bytes*2;S=w.uv_index_bytes*3;b=w.vertex_index_bytes*3+w.material_index_bytes;V=w.vertex_index_bytes* -4+w.material_index_bytes;W=w.ntri_flat*b;U=w.ntri_smooth*(b+w.normal_index_bytes*3);Z=w.ntri_flat_uv*(b+w.uv_index_bytes*3);Y=w.ntri_smooth_uv*(b+w.normal_index_bytes*3+w.uv_index_bytes*3);$=w.nquad_flat*V;b=w.nquad_smooth*(V+w.normal_index_bytes*4);V=w.nquad_flat_uv*(V+w.uv_index_bytes*4);x+=function(b){for(var e,h,f,k=w.vertex_coordinate_bytes*3,l=b+w.nvertices*k;b=0){v=l.invBindMatrices[p];m.invBindMatrix=v;m.skinningMatrix=new THREE.Matrix4;m.skinningMatrix.multiply(m.world,v);m.weights=[];for(v=0;v=0){v=l.invBindMatrices[p];m.invBindMatrix=v;m.skinningMatrix=new THREE.Matrix4;m.skinningMatrix.multiply(m.world,v);m.weights=[];for(v=0;v1){l=new THREE.MeshFaceMaterial;for(j=0;j1?c[1].substr(0,b):"0";c[1].length1){l=new THREE.MeshFaceMaterial;for(j=0;j1?c[1].substr(0,b):"0";c[1].length=0,h=g.indexOf("(")>=0,k;if(f)e=g.split("."),g=e.shift(),e.shift();else if(h){k=g.split("(");g=k.shift();for(e=0;eb){n=m.output[l];break}h=n!==void 0?n instanceof THREE.Matrix4?h.multiply(h,n):h.multiply(h,k.matrix):h.multiply(h,k.matrix)}else h=h.multiply(h,k.matrix);b=h;c.push({time:a,pos:[b.n14,b.n24,b.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=c}this.updateMatrix(); -return this};o.prototype.updateMatrix=function(){this.matrix.identity();for(var a=0;a0&&(this[c.nodeName]=parseFloat(e[0].textContent))}}this.create();return this};K.prototype.create=function(){var a={},b=this.transparency!== +null};G.prototype.isTexture=function(){return this.texture!=null};G.prototype.parse=function(a){for(var b=0;b0&&(this[c.nodeName]=parseFloat(e[0].textContent))}}this.create();return this};L.prototype.create=function(){var a={},b=this.transparency!== void 0&&this.transparency<1,c;for(c in this)switch(c){case "ambient":case "emission":case "diffuse":case "specular":var e=this[c];if(e instanceof G)if(e.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(e=fa[this.effect.surface.init_from]))a.map=THREE.ImageUtils.loadTexture(ja+e.init_from),a.map.wrapS=THREE.RepeatWrapping,a.map.wrapT=THREE.RepeatWrapping,a.map.repeat.x=1,a.map.repeat.y=-1}else c=="diffuse"?a.color=e.color.getHex():b||(a[c]= e.color.getHex());break;case "shininess":case "reflectivity":a[c]=this[c];break;case "transparency":if(b)a.transparent=!0,a.opacity=this[c],b=!0}a.shading=ka;return this.material=new THREE.MeshLambertMaterial(a)};C.prototype.parse=function(a){for(var b=0;b=0,e=a.indexOf("(")>=0,g,f;if(c)b=a.split("."),a=b.shift(),f=b.shift();else if(e){g=a.split("(");a=g.shift();for(b=0;b=0,e=a.indexOf("(")>=0,g,f;if(c)b=a.split("."),a=b.shift(),f=b.shift();else if(e){g=a.split("(");a=g.shift();for(b=0;b1&&(K=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(B,K);object.name=u;object.position.set(w[0],w[1],w[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=x.visible;H.scene.add(object);H.objects[u]=object;x.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),H.scene.collisions.colliders.push(a)); -if(x.castsShadow)a=new THREE.ShadowVolume(B),H.scene.add(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;x.trigger&&x.trigger.toLowerCase()!="none"&&(a={type:x.trigger,object:x},H.triggers[object.name]=a)}}else w=x.position,r=x.rotation,q=x.quaternion,s=x.scale,q=0,object=new THREE.Object3D,object.name=u,object.position.set(w[0],w[1],w[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0], -s[1],s[2]),object.visible=x.visible!==void 0?x.visible:!1,H.scene.add(object),H.objects[u]=object,H.empties[u]=object,x.trigger&&x.trigger.toLowerCase()!="none"&&(a={type:x.trigger,object:x},H.triggers[object.name]=a)}function l(a){return function(c){H.geometries[a]=c;k();M-=1;b.onLoadComplete();n()}}function m(a){return function(b){H.geometries[a]=b}}function n(){b.callbackProgress({totalModels:L,totalTextures:O,loadedModels:L-M,loadedTextures:O-N},H);b.onLoadProgress();M==0&&N==0&&c(H)}var o,t, -u,v,y,p,z,x,w,A,D,B,E,I,G,K,C,F,J,M,N,L,O,H;F=a.data;G=new THREE.BinaryLoader;J=new THREE.JSONLoader;N=M=0;H={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(u in F.objects)if(x=F.objects[u],x.meshCollider){a=!0;break}if(a)H.scene.collisions=new THREE.CollisionSystem;if(F.transform){a=F.transform.position;A=F.transform.rotation;var Q=F.transform.scale;a&&H.scene.position.set(a[0],a[1],a[2]);A&&H.scene.rotation.set(A[0], -A[1],A[2]);Q&&H.scene.scale.set(Q[0],Q[1],Q[2]);(a||A||Q)&&H.scene.updateMatrix()}a=function(){N-=1;n();b.onLoadComplete()};for(y in F.cameras)A=F.cameras[y],A.type=="perspective"?E=new THREE.PerspectiveCamera(A.fov,A.aspect,A.near,A.far):A.type=="ortho"&&(E=new THREE.OrthographicCamera(A.left,A.right,A.top,A.bottom,A.near,A.far)),w=A.position,A=A.target,E.position.set(w[0],w[1],w[2]),E.target=new THREE.Vector3(A[0],A[1],A[2]),H.cameras[y]=E;for(v in F.lights)y=F.lights[v],E=y.color!==void 0?y.color: -16777215,A=y.intensity!==void 0?y.intensity:1,y.type=="directional"?(w=y.direction,C=new THREE.DirectionalLight(E,A),C.position.set(w[0],w[1],w[2]),C.position.normalize()):y.type=="point"?(w=y.position,d=y.distance,C=new THREE.PointLight(E,A,d),C.position.set(w[0],w[1],w[2])):y.type=="ambient"&&(C=new THREE.AmbientLight(E)),H.scene.add(C),H.lights[v]=C;for(p in F.fogs)v=F.fogs[p],v.type=="linear"?I=new THREE.Fog(0,v.near,v.far):v.type=="exp2"&&(I=new THREE.FogExp2(0,v.density)),A=v.color,I.color.setRGB(A[0], -A[1],A[2]),H.fogs[p]=I;if(H.cameras&&F.defaults.camera)H.currentCamera=H.cameras[F.defaults.camera];if(H.fogs&&F.defaults.fog)H.scene.fog=H.fogs[F.defaults.fog];A=F.defaults.bgcolor;H.bgColor=new THREE.Color;H.bgColor.setRGB(A[0],A[1],A[2]);H.bgColorAlpha=F.defaults.bgalpha;for(o in F.geometries)if(p=F.geometries[o],p.type=="bin_mesh"||p.type=="ascii_mesh")M+=1,b.onLoadStart();L=M;for(o in F.geometries)p=F.geometries[o],p.type=="cube"?(B=new THREE.CubeGeometry(p.width,p.height,p.depth,p.segmentsWidth, -p.segmentsHeight,p.segmentsDepth,null,p.flipped,p.sides),H.geometries[o]=B):p.type=="plane"?(B=new THREE.PlaneGeometry(p.width,p.height,p.segmentsWidth,p.segmentsHeight),H.geometries[o]=B):p.type=="sphere"?(B=new THREE.SphereGeometry(p.radius,p.segmentsWidth,p.segmentsHeight),H.geometries[o]=B):p.type=="cylinder"?(B=new THREE.CylinderGeometry(p.topRad,p.botRad,p.height,p.radSegs,p.heightSegs),H.geometries[o]=B):p.type=="torus"?(B=new THREE.TorusGeometry(p.radius,p.tube,p.segmentsR,p.segmentsT),H.geometries[o]= -B):p.type=="icosahedron"?(B=new THREE.IcosahedronGeometry(p.subdivisions),H.geometries[o]=B):p.type=="bin_mesh"?G.load(e(p.url,F.urlBaseType),l(o)):p.type=="ascii_mesh"?J.load(e(p.url,F.urlBaseType),l(o)):p.type=="embedded_mesh"&&(p=F.embeds[p.id])&&J.createModel(p,m(o),"");for(z in F.textures)if(o=F.textures[z],o.url instanceof Array){N+=o.url.length;for(G=0;G1&&(L=new THREE.MeshFaceMaterial);object=new THREE.Mesh(B,L);object.name=t;object.position.set(w[0],w[1],w[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=x.visible;H.scene.add(object);H.objects[t]=object;x.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),H.scene.collisions.colliders.push(a));if(x.castsShadow)a= +new THREE.ShadowVolume(B),H.scene.add(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;x.trigger&&x.trigger.toLowerCase()!="none"&&(a={type:x.trigger,object:x},H.triggers[object.name]=a)}}else w=x.position,r=x.rotation,q=x.quaternion,s=x.scale,q=0,object=new THREE.Object3D,object.name=t,object.position.set(w[0],w[1],w[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],s[1],s[2]),object.visible= +x.visible!==void 0?x.visible:!1,H.scene.add(object),H.objects[t]=object,H.empties[t]=object,x.trigger&&x.trigger.toLowerCase()!="none"&&(a={type:x.trigger,object:x},H.triggers[object.name]=a)}function l(a){return function(c){H.geometries[a]=c;k();M-=1;b.onLoadComplete();n()}}function m(a){return function(b){H.geometries[a]=b}}function n(){b.callbackProgress({totalModels:K,totalTextures:P,loadedModels:K-M,loadedTextures:P-N},H);b.onLoadProgress();M==0&&N==0&&c(H)}var o,u,t,z,v,p,y,x,w,A,D,B,E,I,G, +L,C,F,J,M,N,K,P,H;F=a.data;G=new THREE.BinaryLoader;J=new THREE.JSONLoader;N=M=0;H={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(t in F.objects)if(x=F.objects[t],x.meshCollider){a=!0;break}if(a)H.scene.collisions=new THREE.CollisionSystem;if(F.transform){a=F.transform.position;A=F.transform.rotation;var Q=F.transform.scale;a&&H.scene.position.set(a[0],a[1],a[2]);A&&H.scene.rotation.set(A[0],A[1],A[2]);Q&&H.scene.scale.set(Q[0], +Q[1],Q[2]);(a||A||Q)&&H.scene.updateMatrix()}a=function(){N-=1;n();b.onLoadComplete()};for(v in F.cameras)A=F.cameras[v],A.type=="perspective"?E=new THREE.PerspectiveCamera(A.fov,A.aspect,A.near,A.far):A.type=="ortho"&&(E=new THREE.OrthographicCamera(A.left,A.right,A.top,A.bottom,A.near,A.far)),w=A.position,A=A.target,E.position.set(w[0],w[1],w[2]),E.target=new THREE.Vector3(A[0],A[1],A[2]),H.cameras[v]=E;for(z in F.lights)v=F.lights[z],E=v.color!==void 0?v.color:16777215,A=v.intensity!==void 0?v.intensity: +1,v.type=="directional"?(w=v.direction,C=new THREE.DirectionalLight(E,A),C.position.set(w[0],w[1],w[2]),C.position.normalize()):v.type=="point"?(w=v.position,d=v.distance,C=new THREE.PointLight(E,A,d),C.position.set(w[0],w[1],w[2])):v.type=="ambient"&&(C=new THREE.AmbientLight(E)),H.scene.add(C),H.lights[z]=C;for(p in F.fogs)z=F.fogs[p],z.type=="linear"?I=new THREE.Fog(0,z.near,z.far):z.type=="exp2"&&(I=new THREE.FogExp2(0,z.density)),A=z.color,I.color.setRGB(A[0],A[1],A[2]),H.fogs[p]=I;if(H.cameras&& +F.defaults.camera)H.currentCamera=H.cameras[F.defaults.camera];if(H.fogs&&F.defaults.fog)H.scene.fog=H.fogs[F.defaults.fog];A=F.defaults.bgcolor;H.bgColor=new THREE.Color;H.bgColor.setRGB(A[0],A[1],A[2]);H.bgColorAlpha=F.defaults.bgalpha;for(o in F.geometries)if(p=F.geometries[o],p.type=="bin_mesh"||p.type=="ascii_mesh")M+=1,b.onLoadStart();K=M;for(o in F.geometries)p=F.geometries[o],p.type=="cube"?(B=new THREE.CubeGeometry(p.width,p.height,p.depth,p.segmentsWidth,p.segmentsHeight,p.segmentsDepth, +null,p.flipped,p.sides),H.geometries[o]=B):p.type=="plane"?(B=new THREE.PlaneGeometry(p.width,p.height,p.segmentsWidth,p.segmentsHeight),H.geometries[o]=B):p.type=="sphere"?(B=new THREE.SphereGeometry(p.radius,p.segmentsWidth,p.segmentsHeight),H.geometries[o]=B):p.type=="cylinder"?(B=new THREE.CylinderGeometry(p.topRad,p.botRad,p.height,p.radSegs,p.heightSegs),H.geometries[o]=B):p.type=="torus"?(B=new THREE.TorusGeometry(p.radius,p.tube,p.segmentsR,p.segmentsT),H.geometries[o]=B):p.type=="icosahedron"? +(B=new THREE.IcosahedronGeometry(p.subdivisions),H.geometries[o]=B):p.type=="bin_mesh"?G.load(e(p.url,F.urlBaseType),l(o)):p.type=="ascii_mesh"?J.load(e(p.url,F.urlBaseType),l(o)):p.type=="embedded_mesh"&&(p=F.embeds[p.id])&&J.createModel(p,m(o),"");for(y in F.textures)if(o=F.textures[y],o.url instanceof Array){N+=o.url.length;for(G=0;G=57344&&(c-=2048);c++;for(var b=new Float32Array(8*c),e=1,f=0;f<8;f++){for(var h=0,g=0;g>1^-(k&1);b[8*g+f]=h}e+=c}c=a.length-e;h=new Uint16Array(c);for(f=g=0;f=this.maxCount-3&&k(this)};this.begin=function(){this.count=0; -this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(l=this.size-1);var t=Math.floor(m-k);t<1&&(t=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var u=Math.floor(n-k);u<1&&(u=1);k=Math.floor(n+k);k>this.size-1&&(k=this.size- -1);for(var v,y,p,z,x,w;o0&&(this.field[p+v]+=z)}}};this.addPlaneX=function(a,c){var f,h,g,k,l,m=this.size,n=this.yd,o=this.zd,t=this.field,u=m*Math.sqrt(a/c);u>m&&(u=m);for(f=0;f0)for(h=0;hn&&(v=n);for(h=0;h0){l=h*o;for(f=0;fsize&&(dist=size);for(g=0;g0){l=zd*g;for(h=0;hthis.size-1&&(l=this.size-1);var u=Math.floor(m-k);u<1&&(u=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var t=Math.floor(n-k);t<1&&(t=1);k=Math.floor(n+k);k>this.size-1&&(k=this.size- +1);for(var z,v,p,y,x,w;o0&&(this.field[p+z]+=y)}}};this.addPlaneX=function(a,c){var f,h,g,k,l,m=this.size,n=this.yd,o=this.zd,u=this.field,t=m*Math.sqrt(a/c);t>m&&(t=m);for(f=0;f0)for(h=0;hn&&(z=n);for(h=0;h0){l=h*o;for(f=0;fsize&&(dist=size);for(g=0;g0){l=zd*g;for(h=0;hc.max.z)return Number.MAX_VALUE;c.normal.set(0,k,0);break;case THREE.CollisionSystem.prototype.raySphere=function(a,c){var b=c.center.clone().subSelf(a.origin);if(b.lengthSq=0)return Math.abs(e)-Math.sqrt(b);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4; THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(a){a.geometry.computeBoundingBox();var c=a.geometry.boundingBox,b=new THREE.Vector3(c.x[0],c.y[0],c.z[0]),c=new THREE.Vector3(c.x[1],c.y[1],c.z[1]),b=new THREE.BoxCollider(b,c);b.mesh=a;return b};THREE.CollisionUtils.MeshAABB=function(a){var c=THREE.CollisionUtils.MeshOBB(a);c.min.addSelf(a.position);c.max.addSelf(a.position);c.dynamic=!1;return c}; THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))}; -if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var c=this,b=this.setSize,e=this.render,f=new THREE.PerspectiveCamera,h=new THREE.PerspectiveCamera,g=new THREE.Matrix4,k=new THREE.Matrix4,l,m,n;f.matrixAutoUpdate=h.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},o=new THREE.WebGLRenderTarget(512,512,a),t=new THREE.WebGLRenderTarget(512,512,a),u=new THREE.PerspectiveCamera(53,1,1,1E4);u.position.z= -2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:o},mapRight:{type:"t",value:1,texture:t}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); -var v=new THREE.Scene;v.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){b.call(c,a,e);o.width=a;o.height=e;t.width=a;t.height=e};this.render=function(a,b){b.update(null,!0);if(l!==b.aspect||m!==b.near||n!==b.fov){l=b.aspect;m=b.near;n=b.fov;var z=b.projectionMatrix.clone(),x=125/30*0.5,w=x*m/125,A=m*Math.tan(n*Math.PI/360),D;g.n14=x;k.n14=-x;x=-A*l+w;D=A*l+w;z.n11=2*m/(D-x);z.n13=(D+x)/(D-x);f.projectionMatrix=z.clone();x=-A*l-w;D=A*l-w;z.n11=2*m/(D-x);z.n13= -(D+x)/(D-x);h.projectionMatrix=z.clone()}f.matrix=b.matrixWorld.clone().multiplySelf(k);f.update(null,!0);f.position.copy(b.position);f.near=m;f.far=b.far;e.call(c,a,f,o,!0);h.matrix=b.matrixWorld.clone().multiplySelf(g);h.update(null,!0);h.position.copy(b.position);h.near=m;h.far=b.far;e.call(c,a,h,t,!0);e.call(c,v,u)}}; +if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var c=this,b=this.setSize,e=this.render,f=new THREE.PerspectiveCamera,h=new THREE.PerspectiveCamera,g=new THREE.Matrix4,k=new THREE.Matrix4,l,m,n;f.matrixAutoUpdate=h.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},o=new THREE.WebGLRenderTarget(512,512,a),u=new THREE.WebGLRenderTarget(512,512,a),t=new THREE.PerspectiveCamera(53,1,1,1E4);t.position.z= +2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:o},mapRight:{type:"t",value:1,texture:u}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); +var z=new THREE.Scene;z.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){b.call(c,a,e);o.width=a;o.height=e;u.width=a;u.height=e};this.render=function(a,b){b.update(null,!0);if(l!==b.aspect||m!==b.near||n!==b.fov){l=b.aspect;m=b.near;n=b.fov;var y=b.projectionMatrix.clone(),x=125/30*0.5,w=x*m/125,A=m*Math.tan(n*Math.PI/360),D;g.n14=x;k.n14=-x;x=-A*l+w;D=A*l+w;y.n11=2*m/(D-x);y.n13=(D+x)/(D-x);f.projectionMatrix=y.clone();x=-A*l-w;D=A*l-w;y.n11=2*m/(D-x);y.n13= +(D+x)/(D-x);h.projectionMatrix=y.clone()}f.matrix=b.matrixWorld.clone().multiplySelf(k);f.update(null,!0);f.position.copy(b.position);f.near=m;f.far=b.far;e.call(c,a,f,o,!0);h.matrix=b.matrixWorld.clone().multiplySelf(g);h.update(null,!0);h.position.copy(b.position);h.near=m;h.far=b.far;e.call(c,a,h,u,!0);e.call(c,z,t)}}; if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var c=this,b=this.setSize,e=this.render,f,h,g=new THREE.PerspectiveCamera;g.target=new THREE.Vector3(0,0,0);var k=new THREE.PerspectiveCamera;k.target=new THREE.Vector3(0,0,0);c.separation=10;if(a&&a.separation!==void 0)c.separation=a.separation;this.setSize=function(a,e){b.call(c,a,e);f=a/2;h=e};this.render=function(a,b){this.clear();g.fov=b.fov;g.aspect=0.5*b.aspect;g.near=b.near;g.far= b.far;g.updateProjectionMatrix();g.position.copy(b.position);g.target.copy(b.target);g.translateX(c.separation);g.lookAt(g.target);k.projectionMatrix=g.projectionMatrix;k.position.copy(b.position);k.target.copy(b.target);k.translateX(-c.separation);k.lookAt(k.target);this.setViewport(0,0,f,h);e.call(c,a,g);this.setViewport(f,0,f,h);e.call(c,a,k,!1)}}; diff --git a/build/custom/ThreeSVG.js b/build/custom/ThreeSVG.js index 4c04042e..d94dc0a7 100644 --- a/build/custom/ThreeSVG.js +++ b/build/custom/ThreeSVG.js @@ -70,9 +70,10 @@ this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRo 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,e=a.x,g=a.y,i=a.z,a=a.w;this.x=b*a+f*e+c*i-d*g;this.y=c*a+f*g+d*e-b*i;this.z=d*a+f*i+b*g-c*e;this.w=f*a-b*e-c*g-d*i;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,f=a.z,e=this.x,g=this.y,i=this.z,k=this.w,h=k*c+g*f-i*d,j=k*d+i*c-e*f,m=k*f+e*d-g*c,c=-e* c-g*d-i*f;b.x=h*k+c*-e+j*-i-m*-g;b.y=j*k+c*-g+m*-e-h*-i;b.z=m*k+c*-i+h*-g-j*-e;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;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var e=Math.acos(f),g=Math.sqrt(1-f*f);if(Math.abs(g)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-d)*e)/g;d=Math.sin(d*e)/g;c.w=a.w*f+b.w*d;c.x=a.x*f+b.x*d;c.y=a.y*f+b.y*d;c.z=a.z*f+b.z*d;return c}; -THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,f,e){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.materials=e instanceof Array?e:[e];this.centroid=new THREE.Vector3}; -THREE.Face4=function(a,b,c,d,f,e,g){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=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; -THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; +THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,f,e){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=e;this.centroid=new THREE.Vector3}; +THREE.Face4=function(a,b,c,d,f,e,g){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=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; +THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}}; +THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,d=this.vertices.length;c>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ -Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(b,c){this.x=b||0;this.y=c||0}; -THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,c){this.x=b;this.y=c;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this}, -divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var c=this.x-b.x,b=this.y-b.y;return c*c+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)}, -equals:function(b){return b.x==this.x&&b.y==this.y}};THREE.Vector3=function(b,c,d){this.x=b||0;this.y=c||0;this.z=d||0}; -THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(b,c,d){this.x=b;this.y=c;this.z=d;return this},setX:function(b){this.x=b;return this},setY:function(b){this.y=b;return this},setZ:function(b){this.z=b;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;return this}, -addScalar:function(b){this.x+=b;this.y+=b;this.z+=b;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=b.z-c.z;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;return this},multiply:function(b,c){this.x=b.x*c.x;this.y=b.y*c.y;this.z=b.z*c.z;return this},multiplySelf:function(b){this.x*=b.x;this.y*=b.y;this.z*=b.z;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;return this},divideSelf:function(b){this.x/=b.x;this.y/=b.y;this.z/=b.z;return this}, -divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.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 this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)}, -cross:function(b,c){this.x=b.y*c.z-b.z*c.y;this.y=b.z*c.x-b.x*c.z;this.z=b.x*c.y-b.y*c.x;return this},crossSelf:function(b){return this.set(this.y*b.z-this.z*b.y,this.z*b.x-this.x*b.z,this.x*b.y-this.y*b.x)},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){return(new THREE.Vector3).sub(this,b).lengthSq()},setPositionFromMatrix:function(b){this.x=b.n14;this.y=b.n24;this.z=b.n34},setRotationFromMatrix:function(b){var c=Math.cos(this.y);this.y=Math.asin(b.n13); -Math.abs(c)>1.0E-5?(this.x=Math.atan2(-b.n23/c,b.n33/c),this.z=Math.atan2(-b.n12/c,b.n11/c)):(this.x=0,this.z=Math.atan2(b.n21,b.n22))},isZero:function(){return this.lengthSq()<1.0E-4}};THREE.Vector4=function(b,c,d,f){this.x=b||0;this.y=c||0;this.z=d||0;this.w=f!==void 0?f:1}; -THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,c,d,f){this.x=b;this.y=c;this.z=d;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w!==void 0?b.w:1},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add:function(b,c){this.x=b.x+c.x;this.y=b.y+c.y;this.z=b.z+c.z;this.w=b.w+c.w;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;this.w+=b.w;return this},sub:function(b,c){this.x=b.x-c.x;this.y=b.y-c.y;this.z=b.z- -c.z;this.w=b.w-c.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;this.w-=b.w;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;this.w*=b;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b,this.w/=b):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z+this.w*b.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())}, -normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,c){this.x+=(b.x-this.x)*c;this.y+=(b.y-this.y)*c;this.z+=(b.z-this.z)*c;this.w+=(b.w-this.w)*c;return this}};THREE.Ray=function(b,c){this.origin=b||new THREE.Vector3;this.direction=c||new THREE.Vector3}; -THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var c,d,f=[];c=0;for(d=b.length;c0&&b>0&&i+b<1}for(var f,h=[],i=0,j=b.children.length;ib.scale.x)return[];f={distance:i,point:b.position,face:null,object:b};h.push(f)}else if(b instanceof THREE.Mesh){i=c(this.origin, -this.direction,b.matrixWorld.getPosition());if(i==null||i>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var k,n,m,r,o,v,w,A,F=b.geometry,L=F.vertices,i=0,j=F.faces.length;i0:v<0)))if(v=o.dot((new THREE.Vector3).sub(k,w))/v,w=w.addSelf(A.multiplyScalar(v)),f instanceof THREE.Face3)d(w,k,n,m)&&(f={distance:this.origin.distanceTo(w),point:w,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(d(w,k,n,r)||d(w,n,m,r)))f={distance:this.origin.distanceTo(w),point:w,face:f,object:b},h.push(f)}return h}}; -THREE.Rectangle=function(){function b(){i=f-c;j=h-d}var c,d,f,h,i,j,k=!0;this.getX=function(){return c};this.getY=function(){return d};this.getWidth=function(){return i};this.getHeight=function(){return j};this.getLeft=function(){return c};this.getTop=function(){return d};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(i,j,r,o){k=!1;c=i;d=j;f=r;h=o;b()};this.addPoint=function(i,j){k?(k=!1,c=i,d=j,f=i,h=j):(c=ci?f:i,h=h>j?h:j);b()};this.add3Points= -function(i,j,r,o,v,w){k?(k=!1,c=ir?i>v?i:v:r>v?r:v,h=j>o?j>w?j:w:o>w?o:w):(c=ir?i>v?i>f?i:f:v>f?v:f:r>v?r>f?r:f:v>f?v:f,h=j>o?j>w?j>h?j:h:w>h?w:h:o>w?o>h?o:h:w>h?w:h);b()};this.addRectangle=function(i){k?(k=!1,c=i.getLeft(),d=i.getTop(),f=i.getRight(),h=i.getBottom()):(c=ci.getRight()?f:i.getRight(),h=h> -i.getBottom()?h:i.getBottom());b()};this.inflate=function(i){c-=i;d-=i;f+=i;h+=i;b()};this.minSelf=function(i){c=c>i.getLeft()?c:i.getLeft();d=d>i.getTop()?d:i.getTop();f=f=0&&Math.min(h,b.getBottom())-Math.max(d,b.getTop())>=0};this.empty=function(){k=!0;h=f=d=c=0;b()};this.isEmpty=function(){return k}};THREE.Matrix3=function(){this.m=[]}; -THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,c=this.m;b=c[1];c[1]=c[3];c[3]=b;b=c[2];c[2]=c[6];c[6]=b;b=c[5];c[5]=c[7];c[7]=b;return this},transposeIntoArray:function(b){var c=this.m;b[0]=c[0];b[1]=c[3];b[2]=c[6];b[3]=c[1];b[4]=c[4];b[5]=c[7];b[6]=c[2];b[7]=c[5];b[8]=c[8];return this}}; -THREE.Matrix4=function(b,c,d,f,h,i,j,k,n,m,r,o,v,w,A,F){this.set(b!==void 0?b:1,c||0,d||0,f||0,h||0,i!==void 0?i:1,j||0,k||0,n||0,m||0,r!==void 0?r:1,o||0,v||0,w||0,A||0,F!==void 0?F:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,c,d,f,h,i,j,k,n,m,r,o,v,w,A,F){this.n11=b;this.n12=c;this.n13=d;this.n14=f;this.n21=h;this.n22=i;this.n23=j;this.n24=k;this.n31=n;this.n32=m;this.n33=r;this.n34=o;this.n41=v;this.n42=w;this.n43=A;this.n44=F;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b, -c,d){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,i=THREE.Matrix4.__v3;i.sub(b,c).normalize();if(i.length()===0)i.z=1;f.cross(d,i).normalize();f.length()===0&&(i.x+=1.0E-4,f.cross(d,i).normalize());h.cross(i,f).normalize();this.n11=f.x;this.n12=h.x;this.n13=i.x;this.n21=f.y;this.n22=h.y;this.n23=i.y;this.n31=f.z;this.n32=h.z;this.n33=i.z;return this},multiplyVector3:function(b){var c=b.x,d=b.y,f=b.z,h=1/(this.n41*c+this.n42*d+this.n43*f+this.n44);b.x=(this.n11*c+this.n12*d+this.n13*f+this.n14)*h; -b.y=(this.n21*c+this.n22*d+this.n23*f+this.n24)*h;b.z=(this.n31*c+this.n32*d+this.n33*f+this.n34)*h;return b},multiplyVector4:function(b){var c=b.x,d=b.y,f=b.z,h=b.w;b.x=this.n11*c+this.n12*d+this.n13*f+this.n14*h;b.y=this.n21*c+this.n22*d+this.n23*f+this.n24*h;b.z=this.n31*c+this.n32*d+this.n33*f+this.n34*h;b.w=this.n41*c+this.n42*d+this.n43*f+this.n44*h;return b},rotateAxis:function(b){var c=b.x,d=b.y,f=b.z;b.x=c*this.n11+d*this.n12+f*this.n13;b.y=c*this.n21+d*this.n22+f*this.n23;b.z=c*this.n31+ -d*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var c=new THREE.Vector4;c.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;c.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;c.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;c.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return c},multiply:function(b,c){var d=b.n11,f=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,n=b.n23,m=b.n24,r=b.n31,o=b.n32,v=b.n33,w=b.n34,A=b.n41,F=b.n42,L=b.n43,H=b.n44,xa=c.n11,ya= -c.n12,ja=c.n13,sa=c.n14,ha=c.n21,O=c.n22,D=c.n23,ka=c.n24,M=c.n31,S=c.n32,la=c.n33,ia=c.n34,Ca=c.n41,aa=c.n42,J=c.n43,e=c.n44;this.n11=d*xa+f*ha+h*M+i*Ca;this.n12=d*ya+f*O+h*S+i*aa;this.n13=d*ja+f*D+h*la+i*J;this.n14=d*sa+f*ka+h*ia+i*e;this.n21=j*xa+k*ha+n*M+m*Ca;this.n22=j*ya+k*O+n*S+m*aa;this.n23=j*ja+k*D+n*la+m*J;this.n24=j*sa+k*ka+n*ia+m*e;this.n31=r*xa+o*ha+v*M+w*Ca;this.n32=r*ya+o*O+v*S+w*aa;this.n33=r*ja+o*D+v*la+w*J;this.n34=r*sa+o*ka+v*ia+w*e;this.n41=A*xa+F*ha+L*M+H*Ca;this.n42=A*ya+F*O+ -L*S+H*aa;this.n43=A*ja+F*D+L*la+H*J;this.n44=A*sa+F*ka+L*ia+H*e;return this},multiplyToArray:function(b,c,d){this.multiply(b,c);d[0]=this.n11;d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34;d[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*= -b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=b;this.n31*=b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,c=this.n12,d=this.n13,f=this.n14,h=this.n21,i=this.n22,j=this.n23,k=this.n24,n=this.n31,m=this.n32,r=this.n33,o=this.n34,v=this.n41,w=this.n42,A=this.n43,F=this.n44;return f*j*m*v-d*k*m*v-f*i*r*v+c*k*r*v+d*i*o*v-c*j*o*v-f*j*n*w+d*k*n*w+f*h*r*w-b*k*r*w-d*h*o*w+b*j*o*w+f*i*n*A-c*k*n*A-f*h*m*A+b*k*m*A+c*h* -o*A-b*i*o*A-d*i*n*F+c*j*n*F+d*h*m*F-b*j*m*F-c*h*r*F+b*i*r*F},transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24; -b.n31=this.n31;b.n32=this.n32;b.n33=this.n33;b.n34=this.n34;b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44; -return this.flat},flattenToArray:function(b){b[0]=this.n11;b[1]=this.n21;b[2]=this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return b},flattenToArrayOffset:function(b,c){b[c]=this.n11;b[c+1]=this.n21;b[c+2]=this.n31;b[c+3]=this.n41;b[c+4]=this.n12;b[c+5]=this.n22;b[c+6]=this.n32;b[c+7]=this.n42;b[c+8]=this.n13;b[c+9]=this.n23;b[c+10]=this.n33;b[c+11]= -this.n43;b[c+12]=this.n14;b[c+13]=this.n24;b[c+14]=this.n34;b[c+15]=this.n44;return b},setTranslation:function(b,c,d){this.set(1,0,0,b,0,1,0,c,0,0,1,d,0,0,0,1);return this},setScale:function(b,c,d){this.set(b,0,0,0,0,c,0,0,0,0,d,0,0,0,0,1);return this},setRotationX:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,c,-b,0,0,b,c,0,0,0,0,1);return this},setRotationY:function(b){var c=Math.cos(b),b=Math.sin(b);this.set(c,0,b,0,0,1,0,0,-b,0,c,0,0,0,0,1);return this},setRotationZ:function(b){var c= -Math.cos(b),b=Math.sin(b);this.set(c,-b,0,0,b,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,c){var d=Math.cos(c),f=Math.sin(c),h=1-d,i=b.x,j=b.y,k=b.z,n=h*i,m=h*j;this.set(n*i+d,n*j-f*k,n*k+f*j,0,n*j+f*k,m*j+d,m*k-f*i,0,n*k-f*j,m*k+f*i,h*k*k+d,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position}, -getColumnX:function(){if(!this.columnX)this.columnX=new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,c){var d=b.x,f=b.y,h=b.z,i=Math.cos(d),d=Math.sin(d),j=Math.cos(f), -f=Math.sin(f),k=Math.cos(h),h=Math.sin(h);switch(c){case "YXZ":var n=j*k,m=j*h,r=f*k,o=f*h;this.n11=n+o*d;this.n12=r*d-m;this.n13=i*f;this.n21=i*h;this.n22=i*k;this.n23=-d;this.n31=m*d-r;this.n32=o+n*d;this.n33=i*j;break;case "ZXY":n=j*k;m=j*h;r=f*k;o=f*h;this.n11=n-o*d;this.n12=-i*h;this.n13=r+m*d;this.n21=m+r*d;this.n22=i*k;this.n23=o-n*d;this.n31=-i*f;this.n32=d;this.n33=i*j;break;case "ZYX":n=i*k;m=i*h;r=d*k;o=d*h;this.n11=j*k;this.n12=r*f-m;this.n13=n*f+o;this.n21=j*h;this.n22=o*f+n;this.n23= -m*f-r;this.n31=-f;this.n32=d*j;this.n33=i*j;break;case "YZX":n=i*j;m=i*f;r=d*j;o=d*f;this.n11=j*k;this.n12=o-n*h;this.n13=r*h+m;this.n21=h;this.n22=i*k;this.n23=-d*k;this.n31=-f*k;this.n32=m*h+r;this.n33=n-o*h;break;case "XZY":n=i*j;m=i*f;r=d*j;o=d*f;this.n11=j*k;this.n12=-h;this.n13=f*k;this.n21=n*h+o;this.n22=i*k;this.n23=m*h-r;this.n31=r*h-m;this.n32=d*k;this.n33=o*h+n;break;default:n=i*k,m=i*h,r=d*k,o=d*h,this.n11=j*k,this.n12=-j*h,this.n13=f,this.n21=m+r*f,this.n22=n-o*f,this.n23=-d*j,this.n31= -o-n*f,this.n32=r+m*f,this.n33=i*j}return this},setRotationFromQuaternion:function(b){var c=b.x,d=b.y,f=b.z,h=b.w,i=c+c,j=d+d,k=f+f,b=c*i,n=c*j;c*=k;var m=d*j;d*=k;f*=k;i*=h;j*=h;h*=k;this.n11=1-(m+f);this.n12=n-h;this.n13=c+j;this.n21=n+h;this.n22=1-(b+f);this.n23=d-i;this.n31=c-j;this.n32=d+i;this.n33=1-(b+m);return this},scale:function(b){var c=b.x,d=b.y,b=b.z;this.n11*=c;this.n12*=d;this.n13*=b;this.n21*=c;this.n22*=d;this.n23*=b;this.n31*=c;this.n32*=d;this.n33*=b;this.n41*=c;this.n42*=d;this.n43*= -b;return this},compose:function(b,c,d){var f=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2;f.identity();f.setRotationFromQuaternion(c);h.setScale(d.x,d.y,d.z);this.multiply(f,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,c,d){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,i=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);i.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;c=c instanceof THREE.Quaternion?c: -new THREE.Quaternion;d=d instanceof THREE.Vector3?d:new THREE.Vector3;d.x=f.length();d.y=h.length();d.z=i.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=d.x;f.n21/=d.x;f.n31/=d.x;f.n12/=d.y;f.n22/=d.y;f.n32/=d.y;f.n13/=d.z;f.n23/=d.z;f.n33/=d.z;c.setFromRotationMatrix(f);return[b,c,d]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,c){var d=1/c.x,f=1/c.y,h=1/c.z;this.n11=b.n11*d;this.n21=b.n21*d;this.n31= -b.n31*d;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*h;this.n23=b.n23*h;this.n33=b.n33*h}}; -THREE.Matrix4.makeInvert=function(b,c){var d=b.n11,f=b.n12,h=b.n13,i=b.n14,j=b.n21,k=b.n22,n=b.n23,m=b.n24,r=b.n31,o=b.n32,v=b.n33,w=b.n34,A=b.n41,F=b.n42,L=b.n43,H=b.n44;c===void 0&&(c=new THREE.Matrix4);c.n11=n*w*F-m*v*F+m*o*L-k*w*L-n*o*H+k*v*H;c.n12=i*v*F-h*w*F-i*o*L+f*w*L+h*o*H-f*v*H;c.n13=h*m*F-i*n*F+i*k*L-f*m*L-h*k*H+f*n*H;c.n14=i*n*o-h*m*o-i*k*v+f*m*v+h*k*w-f*n*w;c.n21=m*v*A-n*w*A-m*r*L+j*w*L+n*r*H-j*v*H;c.n22=h*w*A-i*v*A+i*r*L-d*w*L-h*r*H+d*v*H;c.n23=i*n*A-h*m*A-i*j*L+d*m*L+h*j*H-d*n*H;c.n24= -h*m*r-i*n*r+i*j*v-d*m*v-h*j*w+d*n*w;c.n31=k*w*A-m*o*A+m*r*F-j*w*F-k*r*H+j*o*H;c.n32=i*o*A-f*w*A-i*r*F+d*w*F+f*r*H-d*o*H;c.n33=h*m*A-i*k*A+i*j*F-d*m*F-f*j*H+d*k*H;c.n34=i*k*r-f*m*r-i*j*o+d*m*o+f*j*w-d*k*w;c.n41=n*o*A-k*v*A-n*r*F+j*v*F+k*r*L-j*o*L;c.n42=f*v*A-h*o*A+h*r*F-d*v*F-f*r*L+d*o*L;c.n43=h*k*A-f*n*A-h*j*F+d*n*F+f*j*L-d*k*L;c.n44=f*n*r-h*k*r+h*j*o-d*n*o-f*j*v+d*k*v;c.multiplyScalar(1/b.determinant());return c}; -THREE.Matrix4.makeInvert3x3=function(b){var c=b.m33,d=c.m,f=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,i=b.n32*b.n21-b.n31*b.n22,j=-b.n33*b.n12+b.n32*b.n13,k=b.n33*b.n11-b.n31*b.n13,n=-b.n32*b.n11+b.n31*b.n12,m=b.n23*b.n12-b.n22*b.n13,r=-b.n23*b.n11+b.n21*b.n13,o=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*j+b.n31*m;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;d[0]=b*f;d[1]=b*h;d[2]=b*i;d[3]=b*j;d[4]=b*k;d[5]=b*n;d[6]=b*m;d[7]=b*r;d[8]=b*o;return c}; -THREE.Matrix4.makeFrustum=function(b,c,d,f,h,i){var j;j=new THREE.Matrix4;j.n11=2*h/(c-b);j.n12=0;j.n13=(c+b)/(c-b);j.n14=0;j.n21=0;j.n22=2*h/(f-d);j.n23=(f+d)/(f-d);j.n24=0;j.n31=0;j.n32=0;j.n33=-(i+h)/(i-h);j.n34=-2*i*h/(i-h);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};THREE.Matrix4.makePerspective=function(b,c,d,f){var h,b=d*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*c,b*c,h,b,d,f)}; -THREE.Matrix4.makeOrtho=function(b,c,d,f,h,i){var j,k,n,m;j=new THREE.Matrix4;k=c-b;n=d-f;m=i-h;j.n11=2/k;j.n12=0;j.n13=0;j.n14=-((c+b)/k);j.n21=0;j.n22=2/n;j.n23=0;j.n24=-((d+f)/n);j.n31=0;j.n32=0;j.n33=-2/m;j.n34=-((i+h)/m);j.n41=0;j.n42=0;j.n43=0;j.n44=1;return j};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; +var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this}; +THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},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},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var e,f,h;if(c==0)this.r=this.g=this.b=0;else switch(e=Math.floor(a*6),f=a*6-e,a=c*(1-b),h=c*(1- +b*f),b=c*(1-b*(1-f)),e){case 1:this.r=h;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=h;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=h;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ +Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; +THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, +divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, +equals:function(a){return a.x==this.x&&a.y==this.y}};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.set(0,0,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 this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)}, +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){return this.set(this.y*a.z-this.z*a.y,this.z*a.x-this.x*a.z,this.x*a.y-this.y*a.x)},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this,a).lengthSq()},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);this.y=Math.asin(a.n13); +Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},isZero:function(){return this.lengthSq()<1.0E-4}};THREE.Vector4=function(a,b,c,e){this.x=a||0;this.y=b||0;this.z=c||0;this.w=e!==void 0?e:1}; +THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;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},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.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; +THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,e=[];b=0;for(c=a.length;b0&&a>0&&h+a<1}for(var e,f=[],h=0,i=a.children.length;ha.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h=b(this.origin, +this.direction,a.matrixWorld.getPosition());if(h==null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var j,n,k,l,p,m,s,B,A=a.geometry,H=A.vertices,h=0,i=A.faces.length;h0:m<0)))if(m=p.dot((new THREE.Vector3).sub(j,s))/m,s=s.addSelf(B.multiplyScalar(m)),e instanceof THREE.Face3)c(s,j,n,k)&&(e={distance:this.origin.distanceTo(s),point:s,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(s,j,n,l)||c(s,n,k,l)))e={distance:this.origin.distanceTo(s),point:s,face:e,object:a},f.push(e)}return f}}; +THREE.Rectangle=function(){function a(){h=e-b;i=f-c}var b,c,e,f,h,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(h,i,l,p){j=!1;b=h;c=i;e=l;f=p;a()};this.addPoint=function(h,i){j?(j=!1,b=h,c=i,e=h,f=i):(b=bh?e:h,f=f>i?f:i);a()};this.add3Points= +function(h,i,l,p,m,s){j?(j=!1,b=hl?h>m?h:m:l>m?l:m,f=i>p?i>s?i:s:p>s?p:s):(b=hl?h>m?h>e?h:e:m>e?m:e:l>m?l>e?l:e:m>e?m:e,f=i>p?i>s?i>f?i:f:s>f?s:f:p>s?p>f?p:f:s>f?s:f);a()};this.addRectangle=function(h){j?(j=!1,b=h.getLeft(),c=h.getTop(),e=h.getRight(),f=h.getBottom()):(b=bh.getRight()?e:h.getRight(),f=f> +h.getBottom()?f:h.getBottom());a()};this.inflate=function(h){b-=h;c-=h;e+=h;f+=h;a()};this.minSelf=function(h){b=b>h.getLeft()?b:h.getLeft();c=c>h.getTop()?c:h.getTop();e=e=0&&Math.min(f,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){j=!0;f=e=c=b=0;a()};this.isEmpty=function(){return j}};THREE.Matrix3=function(){this.m=[]}; +THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}}; +THREE.Matrix4=function(a,b,c,e,f,h,i,j,n,k,l,p,m,s,B,A){this.set(a!==void 0?a:1,b||0,c||0,e||0,f||0,h!==void 0?h:1,i||0,j||0,n||0,k||0,l!==void 0?l:1,p||0,m||0,s||0,B||0,A!==void 0?A:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,f,h,i,j,n,k,l,p,m,s,B,A){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=h;this.n23=i;this.n24=j;this.n31=n;this.n32=k;this.n33=l;this.n34=p;this.n41=m;this.n42=s;this.n43=B;this.n44=A;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a, +b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;h.sub(a,b).normalize();if(h.length()===0)h.z=1;e.cross(c,h).normalize();e.length()===0&&(h.x+=1.0E-4,e.cross(c,h).normalize());f.cross(h,e).normalize();this.n11=e.x;this.n12=f.x;this.n13=h.x;this.n21=e.y;this.n22=f.y;this.n23=h.y;this.n31=e.z;this.n32=f.z;this.n33=h.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,e=a.z,f=1/(this.n41*b+this.n42*c+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*e+this.n14)*f; +a.y=(this.n21*b+this.n22*c+this.n23*e+this.n24)*f;a.z=(this.n31*b+this.n32*c+this.n33*e+this.n34)*f;return a},multiplyVector4:function(a){var b=a.x,c=a.y,e=a.z,f=a.w;a.x=this.n11*b+this.n12*c+this.n13*e+this.n14*f;a.y=this.n21*b+this.n22*c+this.n23*e+this.n24*f;a.z=this.n31*b+this.n32*c+this.n33*e+this.n34*f;a.w=this.n41*b+this.n42*c+this.n43*e+this.n44*f;return a},rotateAxis:function(a){var b=a.x,c=a.y,e=a.z;a.x=b*this.n11+c*this.n12+e*this.n13;a.y=b*this.n21+c*this.n22+e*this.n23;a.z=b*this.n31+ +c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,n=a.n23,k=a.n24,l=a.n31,p=a.n32,m=a.n33,s=a.n34,B=a.n41,A=a.n42,H=a.n43,C=a.n44,Q=b.n11,wa=b.n12, +ja=b.n13,qa=b.n14,ha=b.n21,L=b.n22,z=b.n23,R=b.n24,M=b.n31,T=b.n32,ka=b.n33,Z=b.n34,Aa=b.n41,$=b.n42,F=b.n43,d=b.n44;this.n11=c*Q+e*ha+f*M+h*Aa;this.n12=c*wa+e*L+f*T+h*$;this.n13=c*ja+e*z+f*ka+h*F;this.n14=c*qa+e*R+f*Z+h*d;this.n21=i*Q+j*ha+n*M+k*Aa;this.n22=i*wa+j*L+n*T+k*$;this.n23=i*ja+j*z+n*ka+k*F;this.n24=i*qa+j*R+n*Z+k*d;this.n31=l*Q+p*ha+m*M+s*Aa;this.n32=l*wa+p*L+m*T+s*$;this.n33=l*ja+p*z+m*ka+s*F;this.n34=l*qa+p*R+m*Z+s*d;this.n41=B*Q+A*ha+H*M+C*Aa;this.n42=B*wa+A*L+H*T+C*$;this.n43=B*ja+ +A*z+H*ka+C*F;this.n44=B*qa+A*R+H*Z+C*d;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*= +a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,f=this.n21,h=this.n22,i=this.n23,j=this.n24,n=this.n31,k=this.n32,l=this.n33,p=this.n34,m=this.n41,s=this.n42,B=this.n43,A=this.n44;return e*i*k*m-c*j*k*m-e*h*l*m+b*j*l*m+c*h*p*m-b*i*p*m-e*i*n*s+c*j*n*s+e*f*l*s-a*j*l*s-c*f*p*s+a*i*p*s+e*h*n*B-b*j*n*B-e*f*k*B+a*j*k*B+b*f*p*B-a*h*p*B-c*h*n*A+b*i* +n*A+c*f*k*A-a*i*k*A-b*f*l*A+a*h*l*A},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32; +a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]= +this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]= +this.n34;a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0, +0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),e=Math.sin(b),f=1-c,h=a.x,i=a.y,j=a.z,n=f*h,k=f*i;this.set(n*h+c,n*i-e*j,n*j+e*i,0,n*i+e*j,k*i+c,k*j-e*h,0,n*j-e*i,k*j+e*h,f*j*j+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= +new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,e=a.y,f=a.z,h=Math.cos(c),c=Math.sin(c),i=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var n= +i*j,k=i*f,l=e*j,p=e*f;this.n11=n+p*c;this.n12=l*c-k;this.n13=h*e;this.n21=h*f;this.n22=h*j;this.n23=-c;this.n31=k*c-l;this.n32=p+n*c;this.n33=h*i;break;case "ZXY":n=i*j;k=i*f;l=e*j;p=e*f;this.n11=n-p*c;this.n12=-h*f;this.n13=l+k*c;this.n21=k+l*c;this.n22=h*j;this.n23=p-n*c;this.n31=-h*e;this.n32=c;this.n33=h*i;break;case "ZYX":n=h*j;k=h*f;l=c*j;p=c*f;this.n11=i*j;this.n12=l*e-k;this.n13=n*e+p;this.n21=i*f;this.n22=p*e+n;this.n23=k*e-l;this.n31=-e;this.n32=c*i;this.n33=h*i;break;case "YZX":n=h*i;k= +h*e;l=c*i;p=c*e;this.n11=i*j;this.n12=p-n*f;this.n13=l*f+k;this.n21=f;this.n22=h*j;this.n23=-c*j;this.n31=-e*j;this.n32=k*f+l;this.n33=n-p*f;break;case "XZY":n=h*i;k=h*e;l=c*i;p=c*e;this.n11=i*j;this.n12=-f;this.n13=e*j;this.n21=n*f+p;this.n22=h*j;this.n23=k*f-l;this.n31=l*f-k;this.n32=c*j;this.n33=p*f+n;break;default:n=h*j,k=h*f,l=c*j,p=c*f,this.n11=i*j,this.n12=-i*f,this.n13=e,this.n21=k+l*e,this.n22=n-p*e,this.n23=-c*i,this.n31=p-n*e,this.n32=l+k*e,this.n33=h*i}return this},setRotationFromQuaternion:function(a){var b= +a.x,c=a.y,e=a.z,f=a.w,h=b+b,i=c+c,j=e+e,a=b*h,n=b*i;b*=j;var k=c*i;c*=j;e*=j;h*=f;i*=f;f*=j;this.n11=1-(k+e);this.n12=n-f;this.n13=b+i;this.n21=n+f;this.n22=1-(a+e);this.n23=c-h;this.n31=b-i;this.n32=c+h;this.n33=1-(a+k);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=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 e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2; +e.identity();e.setRotationFromQuaternion(b);f.setScale(c.x,c.y,c.z);this.multiply(e,f);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;e.set(this.n11,this.n21,this.n31);f.set(this.n12,this.n22,this.n32);h.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=e.length(); +c.y=f.length();c.z=h.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;e=THREE.Matrix4.__m1;e.copy(this);e.n11/=c.x;e.n21/=c.x;e.n31/=c.x;e.n12/=c.y;e.n22/=c.y;e.n32/=c.y;e.n13/=c.z;e.n23/=c.z;e.n33/=c.z;b.setFromRotationMatrix(e);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,e=1/b.y,f=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*e;this.n22=a.n22*e;this.n32=a.n32*e;this.n13=a.n13*f;this.n23= +a.n23*f;this.n33=a.n33*f}}; +THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,n=a.n23,k=a.n24,l=a.n31,p=a.n32,m=a.n33,s=a.n34,B=a.n41,A=a.n42,H=a.n43,C=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=n*s*A-k*m*A+k*p*H-j*s*H-n*p*C+j*m*C;b.n12=h*m*A-f*s*A-h*p*H+e*s*H+f*p*C-e*m*C;b.n13=f*k*A-h*n*A+h*j*H-e*k*H-f*j*C+e*n*C;b.n14=h*n*p-f*k*p-h*j*m+e*k*m+f*j*s-e*n*s;b.n21=k*m*B-n*s*B-k*l*H+i*s*H+n*l*C-i*m*C;b.n22=f*s*B-h*m*B+h*l*H-c*s*H-f*l*C+c*m*C;b.n23=h*n*B-f*k*B-h*i*H+c*k*H+f*i*C-c*n*C;b.n24= +f*k*l-h*n*l+h*i*m-c*k*m-f*i*s+c*n*s;b.n31=j*s*B-k*p*B+k*l*A-i*s*A-j*l*C+i*p*C;b.n32=h*p*B-e*s*B-h*l*A+c*s*A+e*l*C-c*p*C;b.n33=f*k*B-h*j*B+h*i*A-c*k*A-e*i*C+c*j*C;b.n34=h*j*l-e*k*l-h*i*p+c*k*p+e*i*s-c*j*s;b.n41=n*p*B-j*m*B-n*l*A+i*m*A+j*l*H-i*p*H;b.n42=e*m*B-f*p*B+f*l*A-c*m*A-e*l*H+c*p*H;b.n43=f*j*B-e*n*B-f*i*A+c*n*A+e*i*H-c*j*H;b.n44=e*n*l-f*j*l+f*i*p-c*n*p-e*i*m+c*j*m;b.multiplyScalar(1/a.determinant());return b}; +THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,n=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,l=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*k;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*n;c[6]=a*k;c[7]=a*l;c[8]=a*p;return b}; +THREE.Matrix4.makeFrustum=function(a,b,c,e,f,h){var i;i=new THREE.Matrix4;i.n11=2*f/(b-a);i.n12=0;i.n13=(b+a)/(b-a);i.n14=0;i.n21=0;i.n22=2*f/(e-c);i.n23=(e+c)/(e-c);i.n24=0;i.n31=0;i.n32=0;i.n33=-(h+f)/(h-f);i.n34=-2*h*f/(h-f);i.n41=0;i.n42=0;i.n43=-1;i.n44=0;return i};THREE.Matrix4.makePerspective=function(a,b,c,e){var f,a=c*Math.tan(a*Math.PI/360);f=-a;return THREE.Matrix4.makeFrustum(f*b,a*b,f,a,c,e)}; +THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var i,j,n,k;i=new THREE.Matrix4;j=b-a;n=c-e;k=h-f;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/n;i.n23=0;i.n24=-((c+e)/n);i.n31=0;i.n32=0;i.n33=-2/k;i.n34=-((h+f)/k);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3}; -THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(b){if(this.children.indexOf(b)=== --1){b.parent!==void 0&&b.parent.remove(b);b.parent=this;this.children.push(b);for(var c=this;c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.addChildRecurse(b)}},remove:function(b){var c=this,d=this.children.indexOf(b);if(d!==-1){b.parent=void 0;for(this.children.splice(d,1);c.parent!==void 0;)c=c.parent;c!==void 0&&c instanceof THREE.Scene&&c.removeChildRecurse(b)}},getChildByName:function(b,c){var d,f,h;d=0;for(f=this.children.length;d=0&&i>=0&&h>=0&&j>=0?!0:e<0&&i<0||h<0&&j<0?!1:(e<0?d=Math.max(d,e/(e-i)):i<0&&(f=Math.min(f,e/(e-i))),h<0?d=Math.max(d,h/(h-j)):j<0&&(f=Math.min(f,h/(h-j))),fJ&&j.positionScreen.z0&&O.z<1))za=ya[xa]=ya[xa]||new THREE.RenderableParticle,xa++,H=za,H.x=O.x/O.w,H.y=O.y/O.w,H.z=O.z,H.rotation=N.rotation.z,H.scale.x=N.scale.x*Math.abs(H.x-(O.x+i.projectionMatrix.n11)/(O.w+i.projectionMatrix.n14)),H.scale.y=N.scale.y*Math.abs(H.y-(O.y+i.projectionMatrix.n22)/(O.w+i.projectionMatrix.n24)),H.materials=N.materials,sa.push(H);h&&sa.sort(c);return sa}};THREE.Quaternion=function(b,c,d,f){this.set(b||0,c||0,d||0,f!==void 0?f:1)}; -THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,c,d,f){this.x=b;this.y=c;this.z=d;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var c=Math.PI/360,d=b.x*c,f=b.y*c,h=b.z*c,b=Math.cos(f),f=Math.sin(f),c=Math.cos(-h),h=Math.sin(-h),i=Math.cos(d),d=Math.sin(d),j=b*c,k=f*h;this.w=j*i-k*d;this.x=j*d+k*i;this.y=f*c*i+b*h*d;this.z=b*h*i-f*c*d;return this},setFromAxisAngle:function(b,c){var d=c/2,f=Math.sin(d); -this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(d);return this},setFromRotationMatrix:function(b){var c=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,c+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,c+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,c-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,c-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z); -this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var c= -this.x,d=this.y,f=this.z,h=this.w,i=b.x,j=b.y,k=b.z,b=b.w;this.x=c*b+h*i+d*k-f*j;this.y=d*b+h*j+f*i-c*k;this.z=f*b+h*k+c*j-d*i;this.w=h*b-c*i-d*j-f*k;return this},multiply:function(b,c){this.x=b.x*c.w+b.y*c.z-b.z*c.y+b.w*c.x;this.y=-b.x*c.z+b.y*c.w+b.z*c.x+b.w*c.y;this.z=b.x*c.y-b.y*c.x+b.z*c.w+b.w*c.z;this.w=-b.x*c.x-b.y*c.y-b.z*c.z+b.w*c.w;return this},multiplyVector3:function(b,c){c||(c=b);var d=b.x,f=b.y,h=b.z,i=this.x,j=this.y,k=this.z,n=this.w,m=n*d+j*h-k*f,r=n*f+k*d-i*h,o=n*h+i*f-j*d,d=-i* -d-j*f-k*h;c.x=m*n+d*-i+r*-k-o*-j;c.y=r*n+d*-j+o*-i-m*-k;c.z=o*n+d*-k+m*-j-r*-i;return c}};THREE.Quaternion.slerp=function(b,c,d,f){var h=b.w*c.w+b.x*c.x+b.y*c.y+b.z*c.z;if(Math.abs(h)>=1)return d.w=b.w,d.x=b.x,d.y=b.y,d.z=b.z,d;var i=Math.acos(h),j=Math.sqrt(1-h*h);if(Math.abs(j)<0.0010)return d.w=0.5*(b.w+c.w),d.x=0.5*(b.x+c.x),d.y=0.5*(b.y+c.y),d.z=0.5*(b.z+c.z),d;h=Math.sin((1-f)*i)/j;f=Math.sin(f*i)/j;d.w=b.w*h+c.w*f;d.x=b.x*h+c.x*f;d.y=b.y*h+c.y*f;d.z=b.z*h+c.z*f;return d}; -THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,c,d,f,h,i){this.a=b;this.b=c;this.c=d;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=i instanceof Array?i:[i];this.centroid=new THREE.Vector3}; -THREE.Face4=function(b,c,d,f,h,i,j){this.a=b;this.b=c;this.c=d;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=i instanceof THREE.Color?i:new THREE.Color;this.vertexColors=i instanceof Array?i:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(b,c){this.u=b||0;this.v=c||0}; -THREE.UV.prototype={constructor:THREE.UV,set:function(b,c){this.u=b;this.v=c;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; -THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var c=new THREE.Matrix4;c.extractRotation(b,new THREE.Vector3(1,1,1));for(var d=0,f=this.vertices.length;d0){this.boundingBox={x:[this.vertices[0].position.x, -this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,d=this.vertices.length;cthis.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.ythis.boundingBox.y[1])this.boundingBox.y[1]= -b.position.y;if(b.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,c=0,d=this.vertices.length;cthis.points.length-2?i:i+1;d[3]=i>this.points.length-3?i:i+2;m=this.points[d[0]];r=this.points[d[1]]; -o=this.points[d[2]];v=this.points[d[3]];k=j*j;n=j*k;f.x=c(m.x,r.x,o.x,v.x,j,k,n);f.y=c(m.y,r.y,o.y,v.y,j,k,n);f.z=c(m.z,r.z,o.z,v.z,j,k,n);return f};this.getControlPointsArray=function(){var b,c,d=this.points.length,f=[];for(b=0;b=0&&h>=0&&f>=0&&i>=0?!0:d<0&&h<0||f<0&&i<0?!1:(d<0?c=Math.max(c,d/(d-h)):h<0&&(e=Math.min(e,d/(d-h))),f<0?c=Math.max(c,f/(f-i)):i<0&&(e=Math.min(e,f/(f-i))),eF&&i.positionScreen.z0&&L.z<1))xa=wa[Q]=wa[Q]||new THREE.RenderableParticle,Q++,C=xa,C.x=L.x/L.w,C.y=L.y/L.w,C.z=L.z,C.rotation=S.rotation.z,C.scale.x=S.scale.x*Math.abs(C.x-(L.x+h.projectionMatrix.n11)/(L.w+h.projectionMatrix.n14)),C.scale.y=S.scale.y*Math.abs(C.y-(L.y+h.projectionMatrix.n22)/(L.w+h.projectionMatrix.n24)),C.materials=S.materials,qa.push(C);f&&qa.sort(b);return qa}}; +THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; +THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),h=Math.cos(c),c=Math.sin(c),i=a*b,j=e*f;this.w=i*h-j*c;this.x=i*c+j*h;this.y=e*b*h+a*f*c;this.z=a*f*h-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c); +this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;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,e=this.z,f=this.w,h=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+f*h+c*j-e*i;this.y=c*a+f*i+e*h-b*j;this.z=e*a+f*j+b*i-c*h;this.w=f*a-b*h-c*i-e*j;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,h=this.x,i=this.y,j=this.z,n=this.w,k=n*c+i*f-j*e,l=n*e+j*c-h*f,p=n*f+h*e-i*c,c=-h* +c-i*e-j*f;b.x=k*n+c*-h+l*-j-p*-i;b.y=l*n+c*-i+p*-h-k*-j;b.z=p*n+c*-j+k*-i-l*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),i=Math.sqrt(1-f*f);if(Math.abs(i)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/i;e=Math.sin(e*h)/i;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; +THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,e,f,h){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3}; +THREE.Face4=function(a,b,c,e,f,h,i){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materialIndex=i;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; +THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}}; +THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; +THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x], +y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z< +this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;bthis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;k=this.points[c[0]];l=this.points[c[1]]; +p=this.points[c[2]];m=this.points[c[3]];j=i*i;n=i*j;e.x=b(k.x,l.x,p.x,m.x,i,j,n);e.y=b(k.y,l.y,p.y,m.y,i,j,n);e.z=b(k.z,l.z,p.z,m.z,i,j,n);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;a1){b=d.matrixWorldInverse;b=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(var f=1;f=this.LODs[f].visibleAtDistance)this.LODs[f-1].object3D.visible=!1, -this.LODs[f].object3D.visible=!0;else break;for(;f1){a=c.matrixWorldInverse;a=-(a.n31*this.position.x+a.n32*this.position.y+a.n33*this.position.z+a.n34);this.LODs[0].object3D.visible=!0;for(var e=1;e=this.LODs[e].visibleAtDistance)this.LODs[e-1].object3D.visible=!1, +this.LODs[e].object3D.visible=!0;else break;for(;e= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness * shadow ) );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec3( shadowDarkness );\n#endif\n}\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 ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\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(b){var c,d,f,h={};for(c=0;c=0)c&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglVertexBuffer),e.vertexAttribPointer(b.position,3,e.FLOAT,!1,0,0));else if(j.morphTargetBase){f=i.program.attributes;j.morphTargetBase!==-1?(e.bindBuffer(e.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[j.morphTargetBase]),e.vertexAttribPointer(f.position,3,e.FLOAT,!1,0,0)):f.position>=0&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglVertexBuffer),e.vertexAttribPointer(f.position,3,e.FLOAT,!1,0,0));if(j.morphTargetForcedOrder.length){k= -0;var p=j.morphTargetForcedOrder;for(s=j.morphTargetInfluences;km&&(B=n,m=s[B]);e.bindBuffer(e.ARRAY_BUFFER, -h.__webglMorphTargetsBuffers[B]);e.vertexAttribPointer(f["morphTarget"+k],3,e.FLOAT,!1,0,0);j.__webglMorphTargetInfluences[k]=m;p[B]=1;m=-1;k++}}i.program.uniforms.morphTargetInfluences!==null&&e.uniform1fv(i.program.uniforms.morphTargetInfluences,j.__webglMorphTargetInfluences)}if(c){if(h.__webglCustomAttributesList){k=0;for(s=h.__webglCustomAttributesList.length;k=0&&(e.bindBuffer(e.ARRAY_BUFFER,f.buffer),e.vertexAttribPointer(b[f.buffer.belongsToAttribute], -f.size,e.FLOAT,!1,0,0))}b.color>=0&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglColorBuffer),e.vertexAttribPointer(b.color,3,e.FLOAT,!1,0,0));b.normal>=0&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglNormalBuffer),e.vertexAttribPointer(b.normal,3,e.FLOAT,!1,0,0));b.tangent>=0&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglTangentBuffer),e.vertexAttribPointer(b.tangent,4,e.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(e.bindBuffer(e.ARRAY_BUFFER,h.__webglUVBuffer),e.vertexAttribPointer(b.uv,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(b.uv)): -e.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(e.bindBuffer(e.ARRAY_BUFFER,h.__webglUV2Buffer),e.vertexAttribPointer(b.uv2,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(b.uv2)):e.disableVertexAttribArray(b.uv2));i.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinVertexABuffer),e.vertexAttribPointer(b.skinVertexA,4,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),e.vertexAttribPointer(b.skinVertexB, -4,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),e.vertexAttribPointer(b.skinIndex,4,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),e.vertexAttribPointer(b.skinWeight,4,e.FLOAT,!1,0,0))}j instanceof THREE.Mesh?(i.wireframe?(e.lineWidth(i.wireframeLinewidth),c&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),e.drawElements(e.LINES,h.__webglLineCount,e.UNSIGNED_SHORT,0)):(c&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),e.drawElements(e.TRIANGLES, -h.__webglFaceCount,e.UNSIGNED_SHORT,0)),J.info.render.calls++,J.info.render.vertices+=h.__webglFaceCount,J.info.render.faces+=h.__webglFaceCount/3):j instanceof THREE.Line?(j=j.type==THREE.LineStrip?e.LINE_STRIP:e.LINES,e.lineWidth(i.linewidth),e.drawArrays(j,0,h.__webglLineCount),J.info.render.calls++):j instanceof THREE.ParticleSystem?(e.drawArrays(e.POINTS,0,h.__webglParticleCount),J.info.render.calls++):j instanceof THREE.Ribbon&&(e.drawArrays(e.TRIANGLE_STRIP,0,h.__webglVertexCount),J.info.render.calls++)}} -function h(b,c,d){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=e.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=e.createBuffer();b.hasPos&&(e.bindBuffer(e.ARRAY_BUFFER,b.__webglVertexBuffer),e.bufferData(e.ARRAY_BUFFER,b.positionArray,e.DYNAMIC_DRAW),e.enableVertexAttribArray(c.attributes.position),e.vertexAttribPointer(c.attributes.position,3,e.FLOAT,!1,0,0));if(b.hasNormal){e.bindBuffer(e.ARRAY_BUFFER,b.__webglNormalBuffer);if(d==THREE.FlatShading){var f,h,i,j,s,p,k,m,n,o,r=b.count* -3;for(o=0;o=0;e--)b[e].object==c&&b.splice(e,1)}function sa(b){function c(b){var f=[];e=0;for(d=b.length;e65535&&(n[k].counter+=1,m=n[k].hash+"_"+n[k].counter,b.geometryGroups[m]==void 0&&(b.geometryGroups[m]={faces:[],materials:j,vertices:0,numMorphTargets:o})), -b.geometryGroups[m].faces.push(f),b.geometryGroups[m].vertices+=i;b.geometryGroupsList=[];for(var r in b.geometryGroups)b.geometryGroups[r].id=T++,b.geometryGroupsList.push(b.geometryGroups[r])}function ha(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function O(b){if(b!=Y){switch(b){case THREE.AdditiveBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.SRC_ALPHA,e.ONE);break;case THREE.SubtractiveBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR); -break;case THREE.MultiplyBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)}Y=b}}function D(b,c,d){(d.width&d.width-1)==0&&(d.height&d.height-1)==0?(e.texParameteri(b,e.TEXTURE_WRAP_S,aa(c.wrapS)),e.texParameteri(b,e.TEXTURE_WRAP_T,aa(c.wrapT)),e.texParameteri(b,e.TEXTURE_MAG_FILTER,aa(c.magFilter)),e.texParameteri(b,e.TEXTURE_MIN_FILTER, -aa(c.minFilter)),e.generateMipmap(b)):(e.texParameteri(b,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(b,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(b,e.TEXTURE_MAG_FILTER,Ca(c.magFilter)),e.texParameteri(b,e.TEXTURE_MIN_FILTER,Ca(c.minFilter)))}function ka(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=e.createTexture(),J.info.memory.textures++;e.activeTexture(e.TEXTURE0+c);e.bindTexture(e.TEXTURE_2D,b.__webglTexture);b instanceof THREE.DataTexture?e.texImage2D(e.TEXTURE_2D, -0,aa(b.format),b.image.width,b.image.height,0,aa(b.format),e.UNSIGNED_BYTE,b.image.data):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,b.image);D(e.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else e.activeTexture(e.TEXTURE0+c),e.bindTexture(e.TEXTURE_2D,b.__webglTexture)}function M(b,c){e.bindRenderbuffer(e.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,c.width,c.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER, -b)):c.depthBuffer&&c.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,c.width,c.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,b)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,c.width,c.height)}function S(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;b.__webglTexture=e.createTexture();if(c){b.__webglFramebuffer=[]; -b.__webglRenderbuffer=[];e.bindTexture(e.TEXTURE_CUBE_MAP,b.__webglTexture);D(e.TEXTURE_CUBE_MAP,b,b);for(var d=0;d<6;d++){b.__webglFramebuffer[d]=e.createFramebuffer();b.__webglRenderbuffer[d]=e.createRenderbuffer();e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,aa(b.format),b.width,b.height,0,aa(b.format),aa(b.type),null);var f=b,h=e.TEXTURE_CUBE_MAP_POSITIVE_X+d;e.bindFramebuffer(e.FRAMEBUFFER,b.__webglFramebuffer[d]);e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,h,f.__webglTexture, -0);M(b.__webglRenderbuffer[d],b)}}else b.__webglFramebuffer=e.createFramebuffer(),b.__webglRenderbuffer=e.createRenderbuffer(),e.bindTexture(e.TEXTURE_2D,b.__webglTexture),D(e.TEXTURE_2D,b,b),e.texImage2D(e.TEXTURE_2D,0,aa(b.format),b.width,b.height,0,aa(b.format),aa(b.type),null),d=e.TEXTURE_2D,e.bindFramebuffer(e.FRAMEBUFFER,b.__webglFramebuffer),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,d,b.__webglTexture,0),e.bindRenderbuffer(e.RENDERBUFFER,b.__webglRenderbuffer),M(b.__webglRenderbuffer, -b);c?e.bindTexture(e.TEXTURE_CUBE_MAP,null):e.bindTexture(e.TEXTURE_2D,null);e.bindRenderbuffer(e.RENDERBUFFER,null);e.bindFramebuffer(e.FRAMEBUFFER,null)}b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,d=b.width,b=b.height,h=f=0):(c=null,d=Aa,b=Ra,f=va,h=Da);c!=U&&(e.bindFramebuffer(e.FRAMEBUFFER,c),e.viewport(f,h,d,b),U=c)}function la(b){b instanceof THREE.WebGLRenderTargetCube?(e.bindTexture(e.TEXTURE_CUBE_MAP,b.__webglTexture),e.generateMipmap(e.TEXTURE_CUBE_MAP),e.bindTexture(e.TEXTURE_CUBE_MAP, -null)):(e.bindTexture(e.TEXTURE_2D,b.__webglTexture),e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null))}function ia(b,c){var d;b=="fragment"?d=e.createShader(e.FRAGMENT_SHADER):b=="vertex"&&(d=e.createShader(e.VERTEX_SHADER));e.shaderSource(d,c);e.compileShader(d);if(!e.getShaderParameter(d,e.COMPILE_STATUS))return console.error(e.getShaderInfoLog(d)),console.error(c),null;return d}function Ca(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return e.NEAREST; -default:return e.LINEAR}}function aa(b){switch(b){case THREE.RepeatWrapping:return e.REPEAT;case THREE.ClampToEdgeWrapping:return e.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return e.MIRRORED_REPEAT;case THREE.NearestFilter:return e.NEAREST;case THREE.NearestMipMapNearestFilter:return e.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return e.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return e.LINEAR;case THREE.LinearMipMapNearestFilter:return e.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return e.LINEAR_MIPMAP_LINEAR; -case THREE.ByteType:return e.BYTE;case THREE.UnsignedByteType:return e.UNSIGNED_BYTE;case THREE.ShortType:return e.SHORT;case THREE.UnsignedShortType:return e.UNSIGNED_SHORT;case THREE.IntType:return e.INT;case THREE.UnsignedShortType:return e.UNSIGNED_INT;case THREE.FloatType:return e.FLOAT;case THREE.AlphaFormat:return e.ALPHA;case THREE.RGBFormat:return e.RGB;case THREE.RGBAFormat:return e.RGBA;case THREE.LuminanceFormat:return e.LUMINANCE;case THREE.LuminanceAlphaFormat:return e.LUMINANCE_ALPHA}return 0} -var J=this,e,La=[],Ya=null,U=null,W=-1,G=null,T=0,X=null,qa=null,Y=null,N=null,za=null,Ha=null,Sa=null,Ta=null,va=0,Da=0,Aa=0,Ra=0,wa=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ea=new THREE.Matrix4,Va=new Float32Array(16),Wa=new Float32Array(16),Ja=new THREE.Vector4,$a={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},Ba=b.canvas!==void 0?b.canvas:document.createElement("canvas"), -P=b.stencil!==void 0?b.stencil:!0,eb=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,fb=b.antialias!==void 0?b.antialias:!1,ta=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),Fa=b.clearAlpha!==void 0?b.clearAlpha:0,Za=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=Ba;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor= -this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var Z,Ua=[],b=THREE.ShaderLib.depthRGBA,cb=THREE.UniformsUtils.clone(b.uniforms),Xa=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader, -uniforms:cb}),ab=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:cb,morphTargets:!0});Xa._shadowPass=!0;ab._shadowPass=!0;try{if(!(e=Ba.getContext("experimental-webgl",{antialias:fb,stencil:P,preserveDrawingBuffer:eb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+e.getParameter(e.VERSION)+" | "+e.getParameter(e.VENDOR)+" | "+e.getParameter(e.RENDERER)+" | "+e.getParameter(e.SHADING_LANGUAGE_VERSION))}catch(gb){console.error(gb)}e.clearColor(0, -0,0,1);e.clearDepth(1);e.clearStencil(0);e.enable(e.DEPTH_TEST);e.depthFunc(e.LEQUAL);e.frontFace(e.CCW);e.cullFace(e.BACK);e.enable(e.CULL_FACE);e.enable(e.BLEND);e.blendEquation(e.FUNC_ADD);e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA);e.clearColor(ta.r,ta.g,ta.b,Fa);this.context=e;var db=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,u={};u.vertices=new Float32Array(16);u.faces=new Uint16Array(6);P=0;u.vertices[P++]=-1;u.vertices[P++]=-1;u.vertices[P++]=0;u.vertices[P++]=1;u.vertices[P++]= -1;u.vertices[P++]=-1;u.vertices[P++]=1;u.vertices[P++]=1;u.vertices[P++]=1;u.vertices[P++]=1;u.vertices[P++]=1;u.vertices[P++]=0;u.vertices[P++]=-1;u.vertices[P++]=1;u.vertices[P++]=0;P=u.vertices[P++]=0;u.faces[P++]=0;u.faces[P++]=1;u.faces[P++]=2;u.faces[P++]=0;u.faces[P++]=2;u.faces[P++]=3;u.vertexBuffer=e.createBuffer();u.elementBuffer=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u.vertexBuffer);e.bufferData(e.ARRAY_BUFFER,u.vertices,e.STATIC_DRAW);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,u.elementBuffer); -e.bufferData(e.ELEMENT_ARRAY_BUFFER,u.faces,e.STATIC_DRAW);u.program=e.createProgram();e.attachShader(u.program,ia("fragment",THREE.ShaderLib.sprite.fragmentShader));e.attachShader(u.program,ia("vertex",THREE.ShaderLib.sprite.vertexShader));e.linkProgram(u.program);u.attributes={};u.uniforms={};u.attributes.position=e.getAttribLocation(u.program,"position");u.attributes.uv=e.getAttribLocation(u.program,"uv");u.uniforms.uvOffset=e.getUniformLocation(u.program,"uvOffset");u.uniforms.uvScale=e.getUniformLocation(u.program, -"uvScale");u.uniforms.rotation=e.getUniformLocation(u.program,"rotation");u.uniforms.scale=e.getUniformLocation(u.program,"scale");u.uniforms.alignment=e.getUniformLocation(u.program,"alignment");u.uniforms.color=e.getUniformLocation(u.program,"color");u.uniforms.map=e.getUniformLocation(u.program,"map");u.uniforms.opacity=e.getUniformLocation(u.program,"opacity");u.uniforms.useScreenCoordinates=e.getUniformLocation(u.program,"useScreenCoordinates");u.uniforms.affectedByDistance=e.getUniformLocation(u.program, -"affectedByDistance");u.uniforms.screenPosition=e.getUniformLocation(u.program,"screenPosition");u.uniforms.modelViewMatrix=e.getUniformLocation(u.program,"modelViewMatrix");u.uniforms.projectionMatrix=e.getUniformLocation(u.program,"projectionMatrix");var bb=!1;this.setSize=function(b,c){Ba.width=b;Ba.height=c;this.setViewport(0,0,Ba.width,Ba.height)};this.setViewport=function(b,c,d,f){va=b;Da=c;Aa=d;Ra=f;e.viewport(va,Da,Aa,Ra)};this.setScissor=function(b,c,d,f){e.scissor(b,c,d,f)};this.enableScissorTest= -function(b){b?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST)};this.setClearColorHex=function(b,c){ta.setHex(b);Fa=c;e.clearColor(ta.r,ta.g,ta.b,Fa)};this.setClearColor=function(b,c){ta.copy(b);Fa=c;e.clearColor(ta.r,ta.g,ta.b,Fa)};this.getClearColor=function(){return ta};this.getClearAlpha=function(){return Fa};this.clear=function(b,c,d){var f=0;if(b==void 0||b)f|=e.COLOR_BUFFER_BIT;if(c==void 0||c)f|=e.DEPTH_BUFFER_BIT;if(d==void 0||d)f|=e.STENCIL_BUFFER_BIT;e.clear(f)};this.getContext=function(){return e}; -this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];e.deleteBuffer(c.__webglVertexBuffer);e.deleteBuffer(c.__webglNormalBuffer);e.deleteBuffer(c.__webglTangentBuffer);e.deleteBuffer(c.__webglColorBuffer);e.deleteBuffer(c.__webglUVBuffer);e.deleteBuffer(c.__webglUV2Buffer);e.deleteBuffer(c.__webglSkinVertexABuffer); -e.deleteBuffer(c.__webglSkinVertexBBuffer);e.deleteBuffer(c.__webglSkinIndicesBuffer);e.deleteBuffer(c.__webglSkinWeightsBuffer);e.deleteBuffer(c.__webglFaceBuffer);e.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var d=0,f=c.numMorphTargets;d=0&&e.enableVertexAttribArray(x.position);x.color>=0&&e.enableVertexAttribArray(x.color);x.normal>=0&&e.enableVertexAttribArray(x.normal); -x.tangent>=0&&e.enableVertexAttribArray(x.tangent);b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(e.enableVertexAttribArray(x.skinVertexA),e.enableVertexAttribArray(x.skinVertexB),e.enableVertexAttribArray(x.skinIndex),e.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(i in b.attributes)x[i]!==void 0&&x[i]>=0&&e.enableVertexAttribArray(x[i]);if(b.morphTargets)for(i=b.numSupportedMorphTargets=0;i=0&&(e.enableVertexAttribArray(x[w]), -b.numSupportedMorphTargets++);b.uniformsList=[];for(h in b.uniforms)b.uniformsList.push([b.uniforms[h],h])};this.clearTarget=function(b,c,d,e){S(b);this.clear(c,d,e)};this.updateShadowMap=function(b,c){F(b,c)};this.render=function(b,c,o,u){var K,Ia,ra,s,p,D,B,Pa,Qa=b.lights,x=b.fog;W=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&F(b,c);J.info.render.calls=0;J.info.render.vertices=0;J.info.render.faces=0;if(c.matrixAutoUpdate){for(p=c;p.parent;)p=p.parent;p.update(void 0,!0)}b.update(void 0, -!1,c);c.matrixWorldInverse.flattenToArray(Wa);c.projectionMatrix.flattenToArray(Va);Ea.multiply(c.projectionMatrix,c.matrixWorldInverse);m(Ea);this.initWebGLObjects(b);S(o);(this.autoClear||u)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);p=b.__webglObjects.length;for(u=0;u=0;u--)if(K=b.__webglObjects[u],K.render){B=K.object;Pa=K.buffer;ra=K.opaque;i(B);for(K=0;K0||v.faceVertexUvs.length>0)j.__uvArray=new Float32Array(m*2);if(v.faceUvs.length>1||v.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(m*2)}if(k.geometry.skinWeights.length&&k.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(m*4),j.__skinVertexBArray=new Float32Array(m*4),j.__skinIndexArray=new Float32Array(m*4),j.__skinWeightArray=new Float32Array(m*4);j.__faceArray=new Uint16Array(u*3+(k.geometry.edgeFaces?k.geometry.edgeFaces.length*6:0));j.__lineArray= -new Uint16Array(w*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];v=0;for(x=j.numMorphTargets;v=0;i--)f[i]==h&&f.splice(i,1)}else(d instanceof THREE.MarchingCubes||d.immediateRenderCallback)&&ja(f.__webglObjectsImmediate,d);d.__webglActive=!1;b.__objectsRemoved.splice(0,1)}d=0;for(f=b.__webglObjects.length;d0&&(e.bindBuffer(e.ARRAY_BUFFER,p.__webglColorBuffer),e.bufferData(e.ARRAY_BUFFER,pa,u));Aa&&(e.bindBuffer(e.ARRAY_BUFFER,p.__webglNormalBuffer),e.bufferData(e.ARRAY_BUFFER,W,u));Ca&&ua.hasTangents&&(e.bindBuffer(e.ARRAY_BUFFER,p.__webglTangentBuffer),e.bufferData(e.ARRAY_BUFFER,ca,u));va&&X>0&&(e.bindBuffer(e.ARRAY_BUFFER, -p.__webglUVBuffer),e.bufferData(e.ARRAY_BUFFER,ka,u));va&&aa>0&&(e.bindBuffer(e.ARRAY_BUFFER,p.__webglUV2Buffer),e.bufferData(e.ARRAY_BUFFER,la,u));za&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,p.__webglFaceBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,ia,u),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,p.__webglLineBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,Y,u));z>0&&(e.bindBuffer(e.ARRAY_BUFFER,p.__webglSkinVertexABuffer),e.bufferData(e.ARRAY_BUFFER,da,u),e.bindBuffer(e.ARRAY_BUFFER,p.__webglSkinVertexBBuffer), -e.bufferData(e.ARRAY_BUFFER,ea,u),e.bindBuffer(e.ARRAY_BUFFER,p.__webglSkinIndicesBuffer),e.bufferData(e.ARRAY_BUFFER,fa,u),e.bindBuffer(e.ARRAY_BUFFER,p.__webglSkinWeightsBuffer),e.bufferData(e.ARRAY_BUFFER,ga,u));w&&(delete p.__inittedArrays,delete p.__colorArray,delete p.__normalArray,delete p.__tangentArray,delete p.__uvArray,delete p.__uv2Array,delete p.__faceArray,delete p.__vertexArray,delete p.__lineArray,delete p.__skinVertexAArray,delete p.__skinVertexBArray,delete p.__skinIndexArray,delete p.__skinWeightArray)}h.__dirtyVertices= -!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;ya(j)}else if(i instanceof THREE.Ribbon){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=e.DYNAMIC_DRAW;k=v=w=w=void 0;n=i.vertices;m=i.colors;o=n.length;p=m.length;x=i.__vertexArray;u=i.__colorArray;E=i.__dirtyColors;if(i.__dirtyVertices){for(w=0;w=0&&(b=a.geometry.materials[d.materialIndex]);return b}function c(a,b,c){var e,h,f,i=a.vertices,r=i.length,J=a.colors,j=J.length,t=a.__vertexArray,k=a.__colorArray,n=a.__sortArray,v=a.__dirtyVertices,l=a.__dirtyColors,p=a.__webglCustomAttributesList,m;if(p){f=0;for(e=p.length;f=0)b&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),d.vertexAttribPointer(a.position,3,d.FLOAT,!1,0,0));else if(i.morphTargetBase){c=h.program.attributes;i.morphTargetBase!==-1?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[i.morphTargetBase]),d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0)):c.position>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer), +d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var k=i.morphTargetForcedOrder;for(r=i.morphTargetInfluences;jn&&(t=m,n=r[t]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[t]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=n;k[t]=1;n=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(r=f.__webglCustomAttributesList.length;j= +0&&(d.bindBuffer(d.ARRAY_BUFFER,c.buffer),d.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,d.FLOAT,!1,0,0))}a.color>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglColorBuffer),d.vertexAttribPointer(a.color,3,d.FLOAT,!1,0,0));a.normal>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglNormalBuffer),d.vertexAttribPointer(a.normal,3,d.FLOAT,!1,0,0));a.tangent>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglTangentBuffer),d.vertexAttribPointer(a.tangent,4,d.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(d.bindBuffer(d.ARRAY_BUFFER, +f.__webglUVBuffer),d.vertexAttribPointer(a.uv,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv)):d.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglUV2Buffer),d.vertexAttribPointer(a.uv2,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv2)):d.disableVertexAttribArray(a.uv2));h.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexABuffer),d.vertexAttribPointer(a.skinVertexA,4, +d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),d.vertexAttribPointer(a.skinVertexB,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),d.vertexAttribPointer(a.skinIndex,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),d.vertexAttribPointer(a.skinWeight,4,d.FLOAT,!1,0,0))}i instanceof THREE.Mesh?(h.wireframe?(d.lineWidth(h.wireframeLinewidth),b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),d.drawElements(d.LINES,f.__webglLineCount, +d.UNSIGNED_SHORT,0)):(b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),d.drawElements(d.TRIANGLES,f.__webglFaceCount,d.UNSIGNED_SHORT,0)),F.info.render.calls++,F.info.render.vertices+=f.__webglFaceCount,F.info.render.faces+=f.__webglFaceCount/3):i instanceof THREE.Line?(i=i.type==THREE.LineStrip?d.LINE_STRIP:d.LINES,d.lineWidth(h.linewidth),d.drawArrays(i,0,f.__webglLineCount),F.info.render.calls++):i instanceof THREE.ParticleSystem?(d.drawArrays(d.POINTS,0,f.__webglParticleCount),F.info.render.calls++): +i instanceof THREE.Ribbon&&(d.drawArrays(d.TRIANGLE_STRIP,0,f.__webglVertexCount),F.info.render.calls++)}}function h(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=d.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=d.createBuffer();a.hasPos&&(d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,a.positionArray,d.DYNAMIC_DRAW),d.enableVertexAttribArray(b.attributes.position),d.vertexAttribPointer(b.attributes.position,3,d.FLOAT,!1,0,0));if(a.hasNormal){d.bindBuffer(d.ARRAY_BUFFER, +a.__webglNormalBuffer);if(c==THREE.FlatShading){var e,f,h,i,j,k,n,t,m,l,p=a.count*3;for(l=0;l=0&&(b=b.geometry.materials[materialIndex], +b.transparent?m(a,b):m(e,b))):(b=d)&&(b.transparent?m(a,b):m(e,b))}function A(a,b){return b.z-a.z}function H(a){var b,c,k,G=0,n,m,r,J,W=a.lights;sa||(sa=new THREE.PerspectiveCamera(F.shadowCameraFov,F.shadowMapWidth/F.shadowMapHeight,F.shadowCameraNear,F.shadowCameraFar));b=0;for(c=W.length;b=0;d--)a[d].object==b&&a.splice(d,1)}function ha(a,b,d){a.push({buffer:b,object:d,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function L(a){if(a!=ia){switch(a){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE);break;case THREE.SubtractiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.ONE_MINUS_SRC_COLOR); +break;case THREE.MultiplyBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.SRC_COLOR);break;default:d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}ia=a}}function z(a,b,c){(c.width&c.width-1)==0&&(c.height&c.height-1)==0?(d.texParameteri(a,d.TEXTURE_WRAP_S,$(b.wrapS)),d.texParameteri(a,d.TEXTURE_WRAP_T,$(b.wrapT)),d.texParameteri(a,d.TEXTURE_MAG_FILTER,$(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,$(b.minFilter)), +d.generateMipmap(a)):(d.texParameteri(a,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_MAG_FILTER,Aa(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,Aa(b.minFilter)))}function R(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=d.createTexture(),F.info.memory.textures++;d.activeTexture(d.TEXTURE0+b);d.bindTexture(d.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?d.texImage2D(d.TEXTURE_2D,0, +$(a.format),a.image.width,a.image.height,0,$(a.format),d.UNSIGNED_BYTE,a.image.data):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,a.image);z(d.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+b),d.bindTexture(d.TEXTURE_2D,a.__webglTexture)}function M(a,b){d.bindRenderbuffer(d.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER, +a)):b.depthBuffer&&b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,a)):d.renderbufferStorage(d.RENDERBUFFER,d.RGBA4,b.width,b.height)}function T(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=d.createTexture();if(b){a.__webglFramebuffer=[]; +a.__webglRenderbuffer=[];d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture);z(d.TEXTURE_CUBE_MAP,a,a);for(var c=0;c<6;c++){a.__webglFramebuffer[c]=d.createFramebuffer();a.__webglRenderbuffer[c]=d.createRenderbuffer();d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,$(a.format),a.width,a.height,0,$(a.format),$(a.type),null);var e=a,f=d.TEXTURE_CUBE_MAP_POSITIVE_X+c;d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer[c]);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,f,e.__webglTexture,0); +M(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=d.createFramebuffer(),a.__webglRenderbuffer=d.createRenderbuffer(),d.bindTexture(d.TEXTURE_2D,a.__webglTexture),z(d.TEXTURE_2D,a,a),d.texImage2D(d.TEXTURE_2D,0,$(a.format),a.width,a.height,0,$(a.format),$(a.type),null),c=d.TEXTURE_2D,d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,c,a.__webglTexture,0),d.bindRenderbuffer(d.RENDERBUFFER,a.__webglRenderbuffer),M(a.__webglRenderbuffer, +a);b?d.bindTexture(d.TEXTURE_CUBE_MAP,null):d.bindTexture(d.TEXTURE_2D,null);d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=e=0):(b=null,c=ua,a=Ia,e=ya,f=Ba);b!=aa&&(d.bindFramebuffer(d.FRAMEBUFFER,b),d.viewport(e,f,c,a),aa=b)}function ka(a){a instanceof THREE.WebGLRenderTargetCube?(d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture),d.generateMipmap(d.TEXTURE_CUBE_MAP),d.bindTexture(d.TEXTURE_CUBE_MAP, +null)):(d.bindTexture(d.TEXTURE_2D,a.__webglTexture),d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null))}function Z(a,b){var c;a=="fragment"?c=d.createShader(d.FRAGMENT_SHADER):a=="vertex"&&(c=d.createShader(d.VERTEX_SHADER));d.shaderSource(c,b);d.compileShader(c);if(!d.getShaderParameter(c,d.COMPILE_STATUS))return console.error(d.getShaderInfoLog(c)),console.error(b),null;return c}function Aa(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST; +default:return d.LINEAR}}function $(a){switch(a){case THREE.RepeatWrapping:return d.REPEAT;case THREE.ClampToEdgeWrapping:return d.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return d.MIRRORED_REPEAT;case THREE.NearestFilter:return d.NEAREST;case THREE.NearestMipMapNearestFilter:return d.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return d.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return d.LINEAR;case THREE.LinearMipMapNearestFilter:return d.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return d.LINEAR_MIPMAP_LINEAR; +case THREE.ByteType:return d.BYTE;case THREE.UnsignedByteType:return d.UNSIGNED_BYTE;case THREE.ShortType:return d.SHORT;case THREE.UnsignedShortType:return d.UNSIGNED_SHORT;case THREE.IntType:return d.INT;case THREE.UnsignedShortType:return d.UNSIGNED_INT;case THREE.FloatType:return d.FLOAT;case THREE.AlphaFormat:return d.ALPHA;case THREE.RGBFormat:return d.RGB;case THREE.RGBAFormat:return d.RGBA;case THREE.LuminanceFormat:return d.LUMINANCE;case THREE.LuminanceAlphaFormat:return d.LUMINANCE_ALPHA}return 0} +var F=this,d,Fa=[],Va=null,aa=null,ma=-1,E=null,ra=0,N=null,V=null,ia=null,S=null,xa=null,Ka=null,Pa=null,Qa=null,ya=0,Ba=0,ua=0,Ia=0,X=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Sa=new Float32Array(16),Ta=new Float32Array(16),Ha=new THREE.Vector4,Xa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},Da=a.canvas!==void 0?a.canvas:document.createElement("canvas"), +K=a.stencil!==void 0?a.stencil:!0,bb=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,cb=a.antialias!==void 0?a.antialias:!1,va=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),za=a.clearAlpha!==void 0?a.clearAlpha:0,Wa=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=Da;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor= +this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var sa,Ra=[],a=THREE.ShaderLib.depthRGBA,$a=THREE.UniformsUtils.clone(a.uniforms),Ua=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader, +uniforms:$a}),Ya=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:$a,morphTargets:!0});Ua._shadowPass=!0;Ya._shadowPass=!0;try{if(!(d=Da.getContext("experimental-webgl",{antialias:cb,stencil:K,preserveDrawingBuffer:bb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+d.getParameter(d.VERSION)+" | "+d.getParameter(d.VENDOR)+" | "+d.getParameter(d.RENDERER)+" | "+d.getParameter(d.SHADING_LANGUAGE_VERSION))}catch(db){console.error(db)}d.clearColor(0, +0,0,1);d.clearDepth(1);d.clearStencil(0);d.enable(d.DEPTH_TEST);d.depthFunc(d.LEQUAL);d.frontFace(d.CCW);d.cullFace(d.BACK);d.enable(d.CULL_FACE);d.enable(d.BLEND);d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);d.clearColor(va.r,va.g,va.b,za);this.context=d;var ab=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,u={};u.vertices=new Float32Array(16);u.faces=new Uint16Array(6);K=0;u.vertices[K++]=-1;u.vertices[K++]=-1;u.vertices[K++]=0;u.vertices[K++]=1;u.vertices[K++]= +1;u.vertices[K++]=-1;u.vertices[K++]=1;u.vertices[K++]=1;u.vertices[K++]=1;u.vertices[K++]=1;u.vertices[K++]=1;u.vertices[K++]=0;u.vertices[K++]=-1;u.vertices[K++]=1;u.vertices[K++]=0;K=u.vertices[K++]=0;u.faces[K++]=0;u.faces[K++]=1;u.faces[K++]=2;u.faces[K++]=0;u.faces[K++]=2;u.faces[K++]=3;u.vertexBuffer=d.createBuffer();u.elementBuffer=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,u.vertexBuffer);d.bufferData(d.ARRAY_BUFFER,u.vertices,d.STATIC_DRAW);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,u.elementBuffer); +d.bufferData(d.ELEMENT_ARRAY_BUFFER,u.faces,d.STATIC_DRAW);u.program=d.createProgram();d.attachShader(u.program,Z("fragment",THREE.ShaderLib.sprite.fragmentShader));d.attachShader(u.program,Z("vertex",THREE.ShaderLib.sprite.vertexShader));d.linkProgram(u.program);u.attributes={};u.uniforms={};u.attributes.position=d.getAttribLocation(u.program,"position");u.attributes.uv=d.getAttribLocation(u.program,"uv");u.uniforms.uvOffset=d.getUniformLocation(u.program,"uvOffset");u.uniforms.uvScale=d.getUniformLocation(u.program, +"uvScale");u.uniforms.rotation=d.getUniformLocation(u.program,"rotation");u.uniforms.scale=d.getUniformLocation(u.program,"scale");u.uniforms.alignment=d.getUniformLocation(u.program,"alignment");u.uniforms.color=d.getUniformLocation(u.program,"color");u.uniforms.map=d.getUniformLocation(u.program,"map");u.uniforms.opacity=d.getUniformLocation(u.program,"opacity");u.uniforms.useScreenCoordinates=d.getUniformLocation(u.program,"useScreenCoordinates");u.uniforms.affectedByDistance=d.getUniformLocation(u.program, +"affectedByDistance");u.uniforms.screenPosition=d.getUniformLocation(u.program,"screenPosition");u.uniforms.modelViewMatrix=d.getUniformLocation(u.program,"modelViewMatrix");u.uniforms.projectionMatrix=d.getUniformLocation(u.program,"projectionMatrix");var Za=!1;this.setSize=function(a,b){Da.width=a;Da.height=b;this.setViewport(0,0,Da.width,Da.height)};this.setViewport=function(a,b,c,e){ya=a;Ba=b;ua=c;Ia=e;d.viewport(ya,Ba,ua,Ia)};this.setScissor=function(a,b,c,e){d.scissor(a,b,c,e)};this.enableScissorTest= +function(a){a?d.enable(d.SCISSOR_TEST):d.disable(d.SCISSOR_TEST)};this.setClearColorHex=function(a,b){va.setHex(a);za=b;d.clearColor(va.r,va.g,va.b,za)};this.setClearColor=function(a,b){va.copy(a);za=b;d.clearColor(va.r,va.g,va.b,za)};this.getClearColor=function(){return va};this.getClearAlpha=function(){return za};this.clear=function(a,b,c){var e=0;if(a==void 0||a)e|=d.COLOR_BUFFER_BIT;if(b==void 0||b)e|=d.DEPTH_BUFFER_BIT;if(c==void 0||c)e|=d.STENCIL_BUFFER_BIT;d.clear(e)};this.getContext=function(){return d}; +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(g in a.geometry.geometryGroups){var b=a.geometry.geometryGroups[g];d.deleteBuffer(b.__webglVertexBuffer);d.deleteBuffer(b.__webglNormalBuffer);d.deleteBuffer(b.__webglTangentBuffer);d.deleteBuffer(b.__webglColorBuffer);d.deleteBuffer(b.__webglUVBuffer);d.deleteBuffer(b.__webglUV2Buffer);d.deleteBuffer(b.__webglSkinVertexABuffer); +d.deleteBuffer(b.__webglSkinVertexBBuffer);d.deleteBuffer(b.__webglSkinIndicesBuffer);d.deleteBuffer(b.__webglSkinWeightsBuffer);d.deleteBuffer(b.__webglFaceBuffer);d.deleteBuffer(b.__webglLineBuffer);if(b.numMorphTargets)for(var c=0,e=b.numMorphTargets;c=0&&d.enableVertexAttribArray(v.position);v.color>=0&&d.enableVertexAttribArray(v.color);v.normal>=0&&d.enableVertexAttribArray(v.normal); +v.tangent>=0&&d.enableVertexAttribArray(v.tangent);a.skinning&&v.skinVertexA>=0&&v.skinVertexB>=0&&v.skinIndex>=0&&v.skinWeight>=0&&(d.enableVertexAttribArray(v.skinVertexA),d.enableVertexAttribArray(v.skinVertexB),d.enableVertexAttribArray(v.skinIndex),d.enableVertexAttribArray(v.skinWeight));if(a.attributes)for(h in a.attributes)v[h]!==void 0&&v[h]>=0&&d.enableVertexAttribArray(v[h]);if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h=0&&(d.enableVertexAttribArray(v[u]), +a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,b,c,d){T(a);this.clear(b,c,d)};this.updateShadowMap=function(a,b){H(a,b)};this.render=function(a,b,c,m){var G,Ga,u,r,J,W,t,z,Oa=a.lights,v=a.fog;ma=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&H(a,b);F.info.render.calls=0;F.info.render.vertices=0;F.info.render.faces=0;if(b.matrixAutoUpdate){for(J=b;J.parent;)J=J.parent;J.update(void 0,!0)}a.update(void 0,!1, +b);b.matrixWorldInverse.flattenToArray(Ta);b.projectionMatrix.flattenToArray(Sa);Ca.multiply(b.projectionMatrix,b.matrixWorldInverse);l(Ca);this.initWebGLObjects(a);T(c);(this.autoClear||m)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);J=a.__webglObjects.length;for(m=0;m=0;m--)if(G=a.__webglObjects[m],G.render){t=G.object;z=G.buffer;u=G.opaque;i(t);for(G=0;G65535&&(s[t].counter+=1,p=s[t].hash+"_"+s[t].counter,j.geometryGroups[p]==void 0&&(j.geometryGroups[p]={faces:[],materialIndex:l,vertices:0,numMorphTargets:v})),j.geometryGroups[p].faces.push(k),j.geometryGroups[p].vertices+=n;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=ra++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer= +d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=d.createBuffer();k.__webglUVBuffer=d.createBuffer();k.__webglUV2Buffer=d.createBuffer();k.__webglSkinVertexABuffer=d.createBuffer();k.__webglSkinVertexBBuffer=d.createBuffer();k.__webglSkinIndicesBuffer=d.createBuffer();k.__webglSkinWeightsBuffer=d.createBuffer();k.__webglFaceBuffer=d.createBuffer();k.__webglLineBuffer=d.createBuffer();if(k.numMorphTargets){l=m=void 0;k.__webglMorphTargetsBuffers=[];m=0;for(l=k.numMorphTargets;m< +l;m++)k.__webglMorphTargetsBuffers.push(d.createBuffer())}F.info.memory.geometries++;for(var l=e,u=n=s=void 0,t=u=v=u=void 0,p=t=k=0,z=n=void 0,B=void 0,n=m=v=s=void 0,v=l.geometry,z=v.faces,B=j.faces,s=0,n=B.length;s0||v.faceVertexUvs.length>0)j.__uvArray=new Float32Array(k*2);if(v.faceUvs.length>1||v.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(k*2)}if(l.geometry.skinWeights.length&&l.geometry.skinIndices.length)j.__skinVertexAArray= +new Float32Array(k*4),j.__skinVertexBArray=new Float32Array(k*4),j.__skinIndexArray=new Float32Array(k*4),j.__skinWeightArray=new Float32Array(k*4);j.__faceArray=new Uint16Array(t*3+(l.geometry.edgeFaces?l.geometry.edgeFaces.length*6:0));j.__lineArray=new Uint16Array(p*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];v=0;for(u=j.numMorphTargets;v=0;i--)f[i]==h&&f.splice(i,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&qa(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e< +f;e++)if(i=a.__webglObjects[e].object,l=j=h=void 0,i instanceof THREE.Mesh){h=i.geometry;k=0;for(m=h.geometryGroupsList.length;k0&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,pa,t));Aa&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER, +V,t));Ba&&ta.hasTangents&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglTangentBuffer),d.bufferData(d.ARRAY_BUFFER,ca,t));ua&&$>0&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglUVBuffer),d.bufferData(d.ARRAY_BUFFER,ka,t));ua&&aa>0&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglUV2Buffer),d.bufferData(d.ARRAY_BUFFER,ma,t));ya&&(d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,l.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,ia,t),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,l.__webglLineBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,X,t)); +x>0&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglSkinVertexABuffer),d.bufferData(d.ARRAY_BUFFER,da,t),d.bindBuffer(d.ARRAY_BUFFER,l.__webglSkinVertexBBuffer),d.bufferData(d.ARRAY_BUFFER,ea,t),d.bindBuffer(d.ARRAY_BUFFER,l.__webglSkinIndicesBuffer),d.bufferData(d.ARRAY_BUFFER,fa,t),d.bindBuffer(d.ARRAY_BUFFER,l.__webglSkinWeightsBuffer),d.bufferData(d.ARRAY_BUFFER,ga,t));p&&(delete l.__inittedArrays,delete l.__colorArray,delete l.__normalArray,delete l.__tangentArray,delete l.__uvArray,delete l.__uv2Array, +delete l.__faceArray,delete l.__vertexArray,delete l.__lineArray,delete l.__skinVertexAArray,delete l.__skinVertexBArray,delete l.__skinIndexArray,delete l.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;ja(j,i)}else if(i instanceof THREE.Ribbon){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=s=p=p=void 0;v=i.vertices;m=i.colors;n=v.length;l=m.length;z=i.__vertexArray; +t=i.__colorArray;B=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p= 0 ) { diff --git a/examples/webgl_geometries.html b/examples/webgl_geometries.html index 8530e2b5..73eae3a4 100644 --- a/examples/webgl_geometries.html +++ b/examples/webgl_geometries.html @@ -42,15 +42,15 @@ scene = new THREE.Scene(); - var light, object, material; + var light, object, materials; scene.add( new THREE.AmbientLight( 0x404040 ) ); - light = new THREE.DirectionalLight( 0xffffff, 1 ); + light = new THREE.DirectionalLight( 0xffffff ); light.position.z = 1; scene.add( light ); - material = [ + materials = [ new THREE.MeshLambertMaterial( { ambient: 0xbbbbbb, map: THREE.ImageUtils.loadTexture( 'textures/UV.jpg' ) } ), new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true, transparent: true, opacity: 0.1 } ) ]; @@ -58,25 +58,24 @@ group = new THREE.Object3D(); scene.add( group ); - object = new THREE.Mesh( new THREE.CubeGeometry( 100, 100, 100, 4, 4, 4 ), material ); + object = THREE.SceneUtils.createMultiMaterialObject( new THREE.CubeGeometry( 100, 100, 100, 4, 4, 4 ), materials ); object.position.set( -200, 0, 200 ); group.add( object ); - - object = new THREE.Mesh( new THREE.CylinderGeometry( 25, 75, 100, 40, 5 ), material ); + object = THREE.SceneUtils.createMultiMaterialObject( new THREE.CylinderGeometry( 25, 75, 100, 40, 5 ), materials ); object.position.set( 0, 0, 200 ); group.add( object ); - object = new THREE.Mesh( new THREE.IcosahedronGeometry( 2 ), material ); + object = THREE.SceneUtils.createMultiMaterialObject( new THREE.IcosahedronGeometry( 2 ), materials ); object.position.set( 200, 0, 200 ); object.scale.x = object.scale.y = object.scale.z = 75; group.add( object ); - object = new THREE.Mesh( new THREE.PlaneGeometry( 100, 100, 4, 4 ), material ); + object = THREE.SceneUtils.createMultiMaterialObject( new THREE.PlaneGeometry( 100, 100, 4, 4 ), materials ); object.position.set( -200, 0, 0 ); group.add( object ); - object = new THREE.Mesh( new THREE.SphereGeometry( 75, 20, 10 ), material ); + object = THREE.SceneUtils.createMultiMaterialObject( new THREE.SphereGeometry( 75, 20, 10 ), materials ); object.position.set( 0, 0, 0 ); group.add( object ); @@ -88,15 +87,15 @@ } - object = new THREE.Mesh( new THREE.LatheGeometry( points, 20 ), material ); + object = THREE.SceneUtils.createMultiMaterialObject( new THREE.LatheGeometry( points, 20 ), materials ); object.position.set( 200, 0, 0 ); group.add( object ); - object = new THREE.Mesh( new THREE.TorusGeometry( 50, 20, 20, 20 ), material ); + object = THREE.SceneUtils.createMultiMaterialObject( new THREE.TorusGeometry( 50, 20, 20, 20 ), materials ); object.position.set( -200, 0, -200 ); group.add( object ); - object = new THREE.Mesh( new THREE.TorusKnotGeometry( 50, 10, 50, 20 ), material ); + object = THREE.SceneUtils.createMultiMaterialObject( new THREE.TorusKnotGeometry( 50, 10, 50, 20 ), materials ); object.position.set( 0, 0, -200 ); group.add( object ); diff --git a/examples/webgl_geometry_blenderexport_colors.html b/examples/webgl_geometry_blenderexport_colors.html index 42b028ea..d18bae0e 100644 --- a/examples/webgl_geometry_blenderexport_colors.html +++ b/examples/webgl_geometry_blenderexport_colors.html @@ -72,6 +72,7 @@ scene.add( light ); var loader = new THREE.JSONLoader(); + loader.load( "obj/cubecolors/cubecolors.js", createScene1 ); loader.load( "obj/cubecolors/cube_fvc.js", createScene2 ); diff --git a/examples/webgl_geometry_colors.html b/examples/webgl_geometry_colors.html index 2c77924b..4fa2197f 100644 --- a/examples/webgl_geometry_colors.html +++ b/examples/webgl_geometry_colors.html @@ -48,7 +48,7 @@ var camera, scene, renderer; - var group1, group2, group3, light; + var mesh, group1, group2, group3, light; var mouseX = 0, mouseY = 0; @@ -141,42 +141,24 @@ ]; - group1 = new THREE.Object3D(); + group1 = THREE.SceneUtils.createMultiMaterialObject( geometry, materials ); group1.position.x = -400; - group1.scale.x = group1.scale.y = group1.scale.z = 200; group1.rotation.x = -1.87; + group1.scale.set( 200, 200, 200 ); scene.add( group1 ); - var p1 = new THREE.Mesh( geometry, materials[ 0 ] ); - var p2 = new THREE.Mesh( geometry, materials[ 1 ] ); - - group1.add( p1 ); - group1.add( p2 ); - - group2 = new THREE.Object3D(); + group2 = THREE.SceneUtils.createMultiMaterialObject( geometry2, materials ); group2.position.x = 400; group2.rotation.x = 0; group2.scale = group1.scale; scene.add( group2 ); - var p1 = new THREE.Mesh( geometry2, materials[ 0 ] ); - var p2 = new THREE.Mesh( geometry2, materials[ 1 ] ); - - group2.add( p1 ); - group2.add( p2 ); - - group3 = new THREE.Object3D(); + group3 = THREE.SceneUtils.createMultiMaterialObject( geometry3, materials ); group3.position.x = 0; group3.rotation.x = 0; group3.scale = group1.scale; scene.add( group3 ); - var p1 = new THREE.Mesh( geometry3, materials[ 0 ] ); - var p2 = new THREE.Mesh( geometry3, materials[ 1 ] ); - - group3.add( p1 ); - group3.add( p2 ); - renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.setSize( window.innerWidth, window.innerHeight ); diff --git a/examples/webgl_geometry_shapes.html b/examples/webgl_geometry_shapes.html index 273a957a..2b63cbd2 100644 --- a/examples/webgl_geometry_shapes.html +++ b/examples/webgl_geometry_shapes.html @@ -74,7 +74,7 @@ // 3d shape - var mesh = new THREE.Mesh( geometry, [ new THREE.MeshLambertMaterial( { color: color } ), new THREE.MeshBasicMaterial( { color: 0x000000, wireframe: true } ) ] ); + var mesh = THREE.SceneUtils.createMultiMaterialObject( geometry, [ new THREE.MeshLambertMaterial( { color: color } ), new THREE.MeshBasicMaterial( { color: 0x000000, wireframe: true, transparent: true } ) ] ); mesh.position.set( x, y, z - 75 ); mesh.rotation.set( rx, ry, rz ); mesh.scale.set( s, s, s ); diff --git a/examples/webgl_geometry_subdivison.html b/examples/webgl_geometry_subdivison.html index ebf4aae2..ba2caa10 100644 --- a/examples/webgl_geometry_subdivison.html +++ b/examples/webgl_geometry_subdivison.html @@ -190,57 +190,57 @@ group = new THREE.Object3D(); - group.add( new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 0xfefefe, wireframe: true, opacity:0.5 } ) ) ); + group.add( new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: 0xfefefe, wireframe: true, opacity: 0.5 } ) ) ); scene.add( group ); var debugNewPoints = false; var debugOldPoints = false; - + // Debug new Points - + if (debugNewPoints) { var PI2 = Math.PI * 2; var program = function ( context ) { - + context.beginPath(); context.arc( 0, 0, 1, 0, PI2, true ); context.closePath(); context.fill(); - + } - + for ( var i = 0; i < smooth.vertices.length; i++ ) { - + particle = new THREE.Particle( new THREE.ParticleCanvasMaterial( { color: Math.random() * 0x808008 + 0x808080, program: program } ) ); particle.position = smooth.vertices[i].position; var pos = smooth.vertices.position particle.scale.x = particle.scale.y = 5; group.add( particle ); } - + } - - + + //Debug original points - + if (debugOldPoints) { - + var drawText = function(i) { - + return function ( context ) { - + context.beginPath(); context.scale(0.1,-0.1); - + context.fillText(i, 0,0); - + }; - + } - + for ( var i = 0; i < geometry.vertices.length; i++ ) { - + particle = new THREE.Particle( new THREE.ParticleCanvasMaterial( { color: Math.random() * 0x808008 + 0x808080, program: drawText(i) } ) ); particle.position = smooth.vertices[i].position; var pos = geometry.vertices.position @@ -248,21 +248,21 @@ group.add( particle ); } } - + var meshmaterials = [ // new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true } ) new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ), - new THREE.MeshBasicMaterial( { color: 0x405040, wireframe:true, opacity:0.8 } ) + new THREE.MeshBasicMaterial( { color: 0x405040, wireframe: true, opacity: 0.8, transparent: true } ) ]; // new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ), // new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true } ) - // new THREE.MeshFaceMaterial() + // new THREE.MeshFaceMaterial() // new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading } ); // new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.SmoothShading } ); - cube = new THREE.Mesh( smooth, meshmaterials ); + cube = THREE.SceneUtils.createMultiMaterialObject( smooth, meshmaterials ); var toscale = params.scale ? params.scale : 1; @@ -300,7 +300,7 @@ addStuff(); - renderer = new THREE.WebGLRenderer(); // WebGLRenderer CanvasRenderer + renderer = new THREE.WebGLRenderer( { antialias: true } ); // WebGLRenderer CanvasRenderer renderer.setSize( window.innerWidth, window.innerHeight ); container.appendChild( renderer.domElement ); diff --git a/examples/webgl_interactive_cubes.html b/examples/webgl_interactive_cubes.html index 85e26a30..e59fc1fc 100644 --- a/examples/webgl_interactive_cubes.html +++ b/examples/webgl_interactive_cubes.html @@ -143,17 +143,17 @@ if ( INTERSECTED != intersects[ 0 ].object ) { - if ( INTERSECTED ) INTERSECTED.materials[ 0 ].color.setHex( INTERSECTED.currentHex ); + if ( INTERSECTED ) INTERSECTED.material.color.setHex( INTERSECTED.currentHex ); INTERSECTED = intersects[ 0 ].object; - INTERSECTED.currentHex = INTERSECTED.materials[ 0 ].color.getHex(); - INTERSECTED.materials[ 0 ].color.setHex( 0xff0000 ); + INTERSECTED.currentHex = INTERSECTED.material.color.getHex(); + INTERSECTED.material.color.setHex( 0xff0000 ); } } else { - if ( INTERSECTED ) INTERSECTED.materials[ 0 ].color.setHex( INTERSECTED.currentHex ); + if ( INTERSECTED ) INTERSECTED.material.color.setHex( INTERSECTED.currentHex ); INTERSECTED = null; diff --git a/examples/webgl_lod_text.html b/examples/webgl_lod_text.html index d335d94b..1bb672b0 100644 --- a/examples/webgl_lod_text.html +++ b/examples/webgl_lod_text.html @@ -85,7 +85,7 @@ light.position.set( 0, 0, 1 ).normalize(); scene.add( light ); - var wireMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, opacity: 0.5, wireframe: true } ); + var wireMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, opacity: 0.5, wireframe: true, transparent: true } ); function getOptionsWithSegments( x, b, bevel ) { @@ -109,6 +109,7 @@ var theText = "&"; // Try $ :) // we could use TextPath and ExtrudeGeometry if we wish to optimize stuff futher + var geometry = [ [ new THREE.TextGeometry( theText, getOptionsWithSegments(8, 6, true)), @@ -132,7 +133,7 @@ for ( i = 0; i < geometry.length; i++ ) { - mesh = new THREE.Mesh( geometry[ i ][ 0 ], geometry[ i ][ 2 ] ); + mesh = new THREE.Mesh( geometry[ i ][ 0 ], geometry[ i ][ 2 ][ 1 ] ); mesh.scale.set( 1.5, 1.5, 1.5 ); mesh.updateMatrix(); mesh.matrixAutoUpdate = false; diff --git a/examples/webgl_materials.html b/examples/webgl_materials.html index 279f74ab..d5ec331e 100644 --- a/examples/webgl_materials.html +++ b/examples/webgl_materials.html @@ -92,10 +92,21 @@ for ( var i = 0, l = geometry_pieces.faces.length; i < l; i ++ ) { var face = geometry_pieces.faces[ i ]; - if ( Math.random() > 0.7 ) face.materials = [ materials[ Math.floor( Math.random() * materials.length ) ] ]; + + if ( Math.random() > 0.7 ) { + + face.materialIndex = Math.floor( Math.random() * materials.length ); + + } else { + + face.materialIndex = 0; + + } } + geometry_pieces.materials = materials; + materials.push( new THREE.MeshFaceMaterial() ); objects = []; diff --git a/examples/webgl_materials_cars_anaglyph.html b/examples/webgl_materials_cars_anaglyph.html index 74c7106e..91135ceb 100644 --- a/examples/webgl_materials_cars_anaglyph.html +++ b/examples/webgl_materials_cars_anaglyph.html @@ -503,7 +503,7 @@ var buttons, i, src = ""; - for( i = 0; i < materials.length; i++ ) { + for( i = 0; i < materials.length; i ++ ) { src += ' '; @@ -520,14 +520,14 @@ function attachButtonMaterials( materials, geometry, material_indices, car ) { - for( var i = 0; i < materials.length; i++ ) { + for( var i = 0; i < materials.length; i ++ ) { $( button_name( car, i ) ).counter = i; $( button_name( car, i ) ).addEventListener( 'click', function() { - for ( var j = 0; j < material_indices.length; j++ ) { + for ( var j = 0; j < material_indices.length; j ++ ) { - geometry.materials[ material_indices [ j ] ][ 0 ] = materials[ this.counter ][ 1 ]; + geometry.materials[ material_indices [ j ] ] = materials[ this.counter ][ 1 ]; } @@ -550,15 +550,18 @@ for( var i in CARS[ car ].mmap ) { - geometry.materials[ i ][ 0 ] = CARS[ car ].mmap[ i ]; + geometry.materials[ i ] = CARS[ car ].mmap[ i ]; } var mesh = new THREE.Mesh( geometry, m ); + mesh.rotation.x = r[ 0 ]; mesh.rotation.y = r[ 1 ]; mesh.rotation.z = r[ 2 ]; + mesh.scale.x = mesh.scale.y = mesh.scale.z = s; + scene.add( mesh ); CARS[ car ].object = mesh; diff --git a/examples/webgl_materials_cars_camaro_crosseyed.html b/examples/webgl_materials_cars_camaro_crosseyed.html index 6e307c8f..8980681c 100644 --- a/examples/webgl_materials_cars_camaro_crosseyed.html +++ b/examples/webgl_materials_cars_camaro_crosseyed.html @@ -154,7 +154,7 @@ var i, src = "", parent = $( "buttons" ); - for( i = 0; i < materials.length; i++ ) { + for( i = 0; i < materials.length; i ++ ) { src += ''; @@ -162,10 +162,10 @@ parent.innerHTML = src; - for( i = 0; i < materials.length; i++ ) { + for( i = 0; i < materials.length; i ++ ) { $( "m" + i ).counter = i; - $( "m" + i ).addEventListener( 'click', function() { geometry.materials[ 0 ][ 0 ] = materials[ this.counter ][ 1 ] }, false ); + $( "m" + i ).addEventListener( 'click', function() { geometry.materials[ 0 ] = materials[ this.counter ][ 1 ] }, false ); } @@ -175,15 +175,15 @@ var s = 75, m = new THREE.MeshFaceMaterial(); - geometry.materials[ 0 ][ 0 ] = materials.body[ 0 ][ 1 ]; // car body - geometry.materials[ 1 ][ 0 ] = materials.chrome; // wheels chrome - geometry.materials[ 2 ][ 0 ] = materials.chrome; // grille chrome - geometry.materials[ 3 ][ 0 ] = materials.darkchrome; // door lines - geometry.materials[ 4 ][ 0 ] = materials.glass; // windshield - geometry.materials[ 5 ][ 0 ] = materials.interior; // interior - geometry.materials[ 6 ][ 0 ] = materials.tire; // tire - geometry.materials[ 7 ][ 0 ] = materials.black; // tireling - geometry.materials[ 8 ][ 0 ] = materials.black; // behind grille + geometry.materials[ 0 ] = materials.body[ 0 ][ 1 ]; // car body + geometry.materials[ 1 ] = materials.chrome; // wheels chrome + geometry.materials[ 2 ] = materials.chrome; // grille chrome + geometry.materials[ 3 ] = materials.darkchrome; // door lines + geometry.materials[ 4 ] = materials.glass; // windshield + geometry.materials[ 5 ] = materials.interior; // interior + geometry.materials[ 6 ] = materials.tire; // tire + geometry.materials[ 7 ] = materials.black; // tireling + geometry.materials[ 8 ] = materials.black; // behind grille var mesh = new THREE.Mesh( geometry, m ); mesh.rotation.y = 1; diff --git a/examples/webgl_materials_cars_parallaxbarrier.html b/examples/webgl_materials_cars_parallaxbarrier.html index 686ddc49..d3e5b258 100644 --- a/examples/webgl_materials_cars_parallaxbarrier.html +++ b/examples/webgl_materials_cars_parallaxbarrier.html @@ -526,9 +526,9 @@ $( button_name( car, i ) ).counter = i; $( button_name( car, i ) ).addEventListener( 'click', function() { - for ( var j = 0; j < material_indices.length; j++ ) { + for ( var j = 0; j < material_indices.length; j ++ ) { - geometry.materials[ material_indices [ j ] ][ 0 ] = materials[ this.counter ][ 1 ]; + geometry.materials[ material_indices [ j ] ] = materials[ this.counter ][ 1 ]; } @@ -551,7 +551,7 @@ for( var i in CARS[ car ].mmap ) { - geometry.materials[ i ][ 0 ] = CARS[ car ].mmap[ i ]; + geometry.materials[ i ] = CARS[ car ].mmap[ i ]; } diff --git a/examples/webgl_materials_cubemap_dynamic.html b/examples/webgl_materials_cubemap_dynamic.html index 8d47654b..00a3c517 100644 --- a/examples/webgl_materials_cubemap_dynamic.html +++ b/examples/webgl_materials_cubemap_dynamic.html @@ -51,127 +51,8 @@ motion blur: b - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/webgl_materials_normalmap.html b/examples/webgl_materials_normalmap.html index dd10192d..642ef8fc 100644 --- a/examples/webgl_materials_normalmap.html +++ b/examples/webgl_materials_normalmap.html @@ -222,8 +222,6 @@ geometry.computeTangents(); - geometry.materials = [ material1 ]; - mesh1 = new THREE.Mesh( geometry, material1 ); mesh1.position.x = - scale * 12; mesh1.scale.set( scale, scale, scale ); diff --git a/examples/webgl_materials_shaders.html b/examples/webgl_materials_shaders.html index 52b07028..8e6ab7d3 100644 --- a/examples/webgl_materials_shaders.html +++ b/examples/webgl_materials_shaders.html @@ -64,7 +64,7 @@ var windowHalfX = window.innerWidth / 2; var windowHalfY = window.innerHeight / 2; - var render_canvas = 1, render_gl = 1; + var render_canvas = 0, render_gl = 1; var has_gl = 0; var bcanvas = document.getElementById( "rcanvas" ); diff --git a/examples/webgl_multiple_canvases_circle.html b/examples/webgl_multiple_canvases_circle.html index f1f0389a..2b27aa34 100644 --- a/examples/webgl_multiple_canvases_circle.html +++ b/examples/webgl_multiple_canvases_circle.html @@ -33,7 +33,7 @@ -moz-transform-style: preserve-3d; transform-style: preserve-3d; } - + #shape { position: relative; top: 160px; @@ -47,7 +47,7 @@ transform: translateZ(-0px); transform-style: preserve-3d; } - + .ring { position: absolute; height: 300px; @@ -111,7 +111,7 @@ background-color: rgba(0,0,0,0.3); width: 50%; } - + @@ -127,7 +127,7 @@ - +
three.js webgl - multiple canvases - circle
@@ -157,7 +157,7 @@ } var rot = degToRad(30); - + var fudge = 0.45; // I don't know why this is needed :-( apps.push( new App( 'container1', rot * -2 * fudge ) ); @@ -219,12 +219,14 @@ var shadowMaterial = new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( 'textures/shadow.png' ) } ); var shadowGeo = new THREE.PlaneGeometry( 300, 300, 1, 1 ); - for ( var i = 0; i < noof_balls; i++ ) { // create shadows + for ( var i = 0; i < noof_balls; i ++ ) { // create shadows + var mesh = new THREE.Mesh( shadowGeo, shadowMaterial ); mesh.position.y = - 250; mesh.position.x = - (noof_balls - 1) /2 *400 + i * 400; mesh.rotation.x = - 90 * Math.PI / 180; scene.add( mesh ); + } var faceIndices = [ 'a', 'b', 'c', 'd' ]; @@ -233,13 +235,13 @@ geometry1 = new THREE.IcosahedronGeometry( 1 ); - for ( var i = 0; i < geometry1.faces.length; i++ ) { + for ( var i = 0; i < geometry1.faces.length; i ++ ) { f1 = geometry1.faces[ i ]; n = ( f1 instanceof THREE.Face3 ) ? 3 : 4; - for( var j = 0; j < n; j++ ) { + for( var j = 0; j < n; j ++ ) { vertexIndex = f1[ faceIndices[ j ] ]; @@ -253,20 +255,28 @@ color = new THREE.Color( 0xffffff ); color.setHSV( 0.0, ( p.y + 1 ) / 2, 1.0 ); } + } var materials = [ + new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ), new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true } ) + ]; - for ( var i = 0; i < noof_balls; i++ ) { // create balls - var mesh = new THREE.Mesh( geometry1, materials ); + var scaleMatrix = new THREE.Matrix4().setScale( 200, 200, 200 ); + geometry1.applyMatrix( scaleMatrix ); + + for ( var i = 0; i < noof_balls; i ++ ) { // create balls + + var mesh = THREE.SceneUtils.createMultiMaterialObject( geometry1, materials ); + mesh.position.x = - (noof_balls - 1) /2 *400 + i *400; - mesh.scale.x = mesh.scale.y = mesh.scale.z = 200; mesh.rotation.x = i * 0.5; scene.add( mesh ); + } renderer = new THREE.WebGLRenderer( { antialias: true } ); @@ -284,7 +294,7 @@ } function onDocumentMouseWheel (event ) { - + var delta = 0; if (event.wheelDelta) { delta = event.wheelDelta / 120; @@ -306,7 +316,7 @@ }; function render() { - + virtualCamera.position.x = -mouseX * 4; virtualCamera.position.y = -mouseY * 4; virtualCamera.position.z = cameraZ; diff --git a/examples/webgl_multiple_canvases_complex.html b/examples/webgl_multiple_canvases_complex.html index 79efd67d..a99c2509 100755 --- a/examples/webgl_multiple_canvases_complex.html +++ b/examples/webgl_multiple_canvases_complex.html @@ -108,7 +108,7 @@ var camera, scene, renderer; - var mesh, mesh2, mesh3, light; + var mesh, group1, group2, group3, light; var mouseX = 0, mouseY = 0; @@ -153,30 +153,30 @@ var faceIndices = [ 'a', 'b', 'c', 'd' ]; - var color, f, f2, f3, p, n, vertexIndex, + var color, f1, f2, f3, p, n, vertexIndex, - geometry = new THREE.IcosahedronGeometry( 1 ), + geometry1 = new THREE.IcosahedronGeometry( 1 ), geometry2 = new THREE.IcosahedronGeometry( 1 ), geometry3 = new THREE.IcosahedronGeometry( 1 ); - for ( var i = 0; i < geometry.faces.length; i++ ) { + for ( var i = 0; i < geometry1.faces.length; i ++ ) { - f = geometry.faces[ i ]; + f1 = geometry1.faces[ i ]; f2 = geometry2.faces[ i ]; f3 = geometry3.faces[ i ]; - n = ( f instanceof THREE.Face3 ) ? 3 : 4; + n = ( f1 instanceof THREE.Face3 ) ? 3 : 4; - for( var j = 0; j < n; j++ ) { + for( var j = 0; j < n; j ++ ) { - vertexIndex = f[ faceIndices[ j ] ]; + vertexIndex = f1[ faceIndices[ j ] ]; - p = geometry.vertices[ vertexIndex ].position; + p = geometry1.vertices[ vertexIndex ].position; color = new THREE.Color( 0xffffff ); color.setHSV( ( p.y + 1 ) / 2, 1.0, 1.0 ); - f.vertexColors[ j ] = color; + f1.vertexColors[ j ] = color; color = new THREE.Color( 0xffffff ); color.setHSV( 0.0, ( p.y + 1 ) / 2, 1.0 ); @@ -184,7 +184,7 @@ f2.vertexColors[ j ] = color; color = new THREE.Color( 0xffffff ); - color.setHSV( 0.125 * vertexIndex/geometry.vertices.length, 1.0, 1.0 ); + color.setHSV( 0.125 * vertexIndex / geometry1.vertices.length, 1.0, 1.0 ); f3.vertexColors[ j ] = color; @@ -196,27 +196,29 @@ var materials = [ new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ), - new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true } ) + new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true, transparent: true } ) ]; - mesh = new THREE.Mesh( geometry, materials ); - mesh.position.x = -400; - mesh.scale.x = mesh.scale.y = mesh.scale.z = 200; - mesh.rotation.x = -1.87; - scene.add( mesh ); + var scaleMatrix = new THREE.Matrix4().setScale( 200, 200, 200 ); + geometry1.applyMatrix( scaleMatrix ); + geometry2.applyMatrix( scaleMatrix ); + geometry3.applyMatrix( scaleMatrix ); - mesh2 = new THREE.Mesh( geometry2, materials ); - mesh2.position.x = 400; - mesh2.rotation.x = 0; - mesh2.scale = mesh.scale; - scene.add( mesh2 ); + group1 = THREE.SceneUtils.createMultiMaterialObject( geometry1, materials ); + group1.position.x = -400; + group1.rotation.x = -1.87; + scene.add( group1 ); - mesh3 = new THREE.Mesh( geometry3, materials ); - mesh3.position.x = 0; - mesh3.rotation.x = 0; - mesh3.scale = mesh.scale; - scene.add( mesh3 ); + group2 = THREE.SceneUtils.createMultiMaterialObject( geometry2, materials ); + group2.position.x = 400; + group2.rotation.x = 0; + scene.add( group2 ); + + group3 = THREE.SceneUtils.createMultiMaterialObject( geometry3, materials ); + group3.position.x = 0; + group3.rotation.x = 0; + scene.add( group3 ); renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.setSize( container.clientWidth, container.clientHeight ); diff --git a/examples/webgl_multiple_canvases_grid.html b/examples/webgl_multiple_canvases_grid.html index bb6b7a49..833389a7 100755 --- a/examples/webgl_multiple_canvases_grid.html +++ b/examples/webgl_multiple_canvases_grid.html @@ -124,7 +124,7 @@ var camera, scene, renderer; - var mesh, mesh2, mesh3, light; + var mesh, group1, group2, group3, light; var mouseX = 0, mouseY = 0; @@ -169,30 +169,30 @@ var faceIndices = [ 'a', 'b', 'c', 'd' ]; - var color, f, f2, f3, p, n, vertexIndex, + var color, f1, f2, f3, p, n, vertexIndex, - geometry = new THREE.IcosahedronGeometry( 1 ), + geometry1 = new THREE.IcosahedronGeometry( 1 ), geometry2 = new THREE.IcosahedronGeometry( 1 ), geometry3 = new THREE.IcosahedronGeometry( 1 ); - for ( var i = 0; i < geometry.faces.length; i++ ) { + for ( var i = 0; i < geometry1.faces.length; i ++ ) { - f = geometry.faces[ i ]; + f1 = geometry1.faces[ i ]; f2 = geometry2.faces[ i ]; f3 = geometry3.faces[ i ]; - n = ( f instanceof THREE.Face3 ) ? 3 : 4; + n = ( f1 instanceof THREE.Face3 ) ? 3 : 4; - for( var j = 0; j < n; j++ ) { + for( var j = 0; j < n; j ++ ) { - vertexIndex = f[ faceIndices[ j ] ]; + vertexIndex = f1[ faceIndices[ j ] ]; - p = geometry.vertices[ vertexIndex ].position; + p = geometry1.vertices[ vertexIndex ].position; color = new THREE.Color( 0xffffff ); color.setHSV( ( p.y + 1 ) / 2, 1.0, 1.0 ); - f.vertexColors[ j ] = color; + f1.vertexColors[ j ] = color; color = new THREE.Color( 0xffffff ); color.setHSV( 0.0, ( p.y + 1 ) / 2, 1.0 ); @@ -200,7 +200,7 @@ f2.vertexColors[ j ] = color; color = new THREE.Color( 0xffffff ); - color.setHSV( 0.125 * vertexIndex/geometry.vertices.length, 1.0, 1.0 ); + color.setHSV( 0.125 * vertexIndex / geometry1.vertices.length, 1.0, 1.0 ); f3.vertexColors[ j ] = color; @@ -212,27 +212,29 @@ var materials = [ new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ), - new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true } ) + new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true, transparent: true } ) ]; - mesh = new THREE.Mesh( geometry, materials ); - mesh.position.x = -400; - mesh.scale.x = mesh.scale.y = mesh.scale.z = 200; - mesh.rotation.x = -1.87; - scene.add( mesh ); + var scaleMatrix = new THREE.Matrix4().setScale( 200, 200, 200 ); + geometry1.applyMatrix( scaleMatrix ); + geometry2.applyMatrix( scaleMatrix ); + geometry3.applyMatrix( scaleMatrix ); - mesh2 = new THREE.Mesh( geometry2, materials ); - mesh2.position.x = 400; - mesh2.rotation.x = 0; - mesh2.scale = mesh.scale; - scene.add( mesh2 ); + group1 = THREE.SceneUtils.createMultiMaterialObject( geometry1, materials ); + group1.position.x = -400; + group1.rotation.x = -1.87; + scene.add( group1 ); - mesh3 = new THREE.Mesh( geometry3, materials ); - mesh3.position.x = 0; - mesh3.rotation.x = 0; - mesh3.scale = mesh.scale; - scene.add( mesh3 ); + group2 = THREE.SceneUtils.createMultiMaterialObject( geometry2, materials ); + group2.position.x = 400; + group2.rotation.x = 0; + scene.add( group2 ); + + group3 = THREE.SceneUtils.createMultiMaterialObject( geometry3, materials ); + group3.position.x = 0; + group3.rotation.x = 0; + scene.add( group3 ); renderer = new THREE.WebGLRenderer( { antialias: true } ); renderer.setSize( container.clientWidth, container.clientHeight ); diff --git a/examples/webgl_objconvert_test.html b/examples/webgl_objconvert_test.html index 8f4c5708..8f59ee2d 100644 --- a/examples/webgl_objconvert_test.html +++ b/examples/webgl_objconvert_test.html @@ -59,7 +59,7 @@ var windowHalfX = window.innerWidth / 2; var windowHalfY = window.innerHeight / 2; - var render_canvas = 1, render_gl = 1; + var render_canvas = 0, render_gl = 1; var has_gl = 0; var bcanvas = document.getElementById( "rcanvas" ); diff --git a/examples/webgl_particles_shapes.html b/examples/webgl_particles_shapes.html index 00704dd2..ab6acfd6 100644 --- a/examples/webgl_particles_shapes.html +++ b/examples/webgl_particles_shapes.html @@ -163,11 +163,13 @@ bevelThickness: 2, bevelSize: 2, - material: textMaterialFront, - extrudeMaterial: textMaterialSide + material: 0, + extrudeMaterial: 1 }); + text3d.materials = [ textMaterialFront, textMaterialSide ]; + text3d.computeVertexNormals(); text3d.computeBoundingBox(); @@ -186,8 +188,8 @@ text.rotation.y = Math.PI * 2; parent = new THREE.Object3D(); - parent.addChild( text ); - scene.addObject( parent ); + parent.add( text ); + scene.add( parent ); ///// Create particle objects for Three.js @@ -353,7 +355,7 @@ } - parent.addChild( particleCloud ); + parent.add( particleCloud ); particleCloud.y = 800; diff --git a/examples/webgl_scene_test.html b/examples/webgl_scene_test.html index 87cbf21c..faf550f8 100644 --- a/examples/webgl_scene_test.html +++ b/examples/webgl_scene_test.html @@ -281,14 +281,14 @@ var mat_veyron = result.geometries[ "veyron" ].materials; - mat_veyron[ 0 ][ 0 ] = result.materials[ "interior" ]; - mat_veyron[ 1 ][ 0 ] = result.materials[ "chrome" ]; - mat_veyron[ 2 ][ 0 ] = result.materials[ "darkerchrome" ]; - mat_veyron[ 3 ][ 0 ] = result.materials[ "glass" ]; - mat_veyron[ 4 ][ 0 ] = result.materials[ "chrome" ]; - mat_veyron[ 5 ][ 0 ] = result.materials[ "chrome" ]; - mat_veyron[ 6 ][ 0 ] = result.materials[ "backlights" ]; - mat_veyron[ 7 ][ 0 ] = result.materials[ "backsignals" ]; + mat_veyron[ 0 ] = result.materials[ "interior" ]; + mat_veyron[ 1 ] = result.materials[ "chrome" ]; + mat_veyron[ 2 ] = result.materials[ "darkerchrome" ]; + mat_veyron[ 3 ] = result.materials[ "glass" ]; + mat_veyron[ 4 ] = result.materials[ "chrome" ]; + mat_veyron[ 5 ] = result.materials[ "chrome" ]; + mat_veyron[ 6 ] = result.materials[ "backlights" ]; + mat_veyron[ 7 ] = result.materials[ "backsignals" ]; $( "message" ).style.display = "none"; $( "progressbar" ).style.display = "none"; diff --git a/examples/webgl_shadowmap.html b/examples/webgl_shadowmap.html index 6e1b2e03..8aade07b 100644 --- a/examples/webgl_shadowmap.html +++ b/examples/webgl_shadowmap.html @@ -247,7 +247,7 @@ var material = new THREE.MeshLambertMaterial( { color: 0xffaa55, morphTargets: true, vertexColors: THREE.FaceColors } ); - geometry.materials[ 0 ] = material; + //geometry.materials[ 0 ] = material; if ( fudgeColor ) { diff --git a/src/extras/SceneUtils.js b/src/extras/SceneUtils.js index 2c61dc3d..a82e8c15 100644 --- a/src/extras/SceneUtils.js +++ b/src/extras/SceneUtils.js @@ -24,6 +24,22 @@ THREE.SceneUtils = { } + }, + + createMultiMaterialObject : function ( geometry, materials ) { + + var i, il = materials.length, + group = new THREE.Object3D(); + + for ( i = 0; i < il; i ++ ) { + + var object = new THREE.Mesh( geometry, materials[ i ] ); + group.add( object ); + + } + + return group; + } }; diff --git a/src/extras/loaders/SceneLoader.js b/src/extras/loaders/SceneLoader.js index af9d7a7f..3792a53e 100644 --- a/src/extras/loaders/SceneLoader.js +++ b/src/extras/loaders/SceneLoader.js @@ -134,12 +134,14 @@ THREE.SceneLoader.prototype = { var hasNormals = false; - materials = []; - for( i = 0; i < o.materials.length; i++ ) { + // not anymore support for multiple materials + // shouldn't really be array - materials[ i ] = result.materials[ o.materials[i] ]; + for( i = 0; i < o.materials.length; i ++ ) { - hasNormals = materials[ i ] instanceof THREE.ShaderMaterial; + materials = result.materials[ o.materials[ i ] ]; + + hasNormals = materials instanceof THREE.ShaderMaterial; } @@ -160,7 +162,7 @@ THREE.SceneLoader.prototype = { if ( materials.length == 0 ) { - materials[ 0 ] = new THREE.MeshFaceMaterial(); + materials = new THREE.MeshFaceMaterial(); } @@ -169,7 +171,7 @@ THREE.SceneLoader.prototype = { if ( materials.length > 1 ) { - materials = [ new THREE.MeshFaceMaterial() ]; + materials = new THREE.MeshFaceMaterial(); } diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index 8c3406fc..fa5283c6 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -748,6 +748,24 @@ THREE.WebGLRenderer = function ( parameters ) { }; + function getBufferMaterial( object, geometryGroup ) { + + var material; + + if ( object.material && ! ( object.material instanceof THREE.MeshFaceMaterial ) ) { + + material = object.material; + + } else if ( geometryGroup.materialIndex >= 0 ) { + + material = object.geometry.materials[ geometryGroup.materialIndex ]; + + } + + return material; + + }; + function initMeshBuffers ( geometryGroup, object ) { var f, fl, fi, face, @@ -785,7 +803,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - material = ( geometryGroup.materialIndex >= 0 ) ? geometry.materials[ geometryGroup.materialIndex ] : object.material; + material = getBufferMaterial( object, geometryGroup ); uvType = bufferGuessUVType( material ); normalType = bufferGuessNormalType( material ); @@ -4408,7 +4426,7 @@ THREE.WebGLRenderer = function ( parameters ) { function areCustomAttributesDirty( geometryGroup, object ) { - var material = ( geometryGroup.materialIndex >= 0 ) ? object.geometry.materials[ geometryGroup.materialIndex ] : object.material; + var material = getBufferMaterial( object, geometryGroup ); if ( material.attributes ) { @@ -4426,7 +4444,7 @@ THREE.WebGLRenderer = function ( parameters ) { function clearCustomAttributes( geometryGroup, object ) { - var material = ( geometryGroup.materialIndex >= 0 ) ? object.geometry.materials[ geometryGroup.materialIndex ] : object.material; + var material = getBufferMaterial( object, geometryGroup ); if ( material.attributes ) { From b0aae55ed8a398dc963223dc13cc2b0dc4713bc8 Mon Sep 17 00:00:00 2001 From: alteredq Date: Fri, 21 Oct 2011 11:17:05 +0200 Subject: [PATCH 28/33] Cleaned up a bit buffers handling in WebGLRenderer. --- build/Three.js | 788 ++++++++++++++++----------------- build/custom/ThreeWebGL.js | 303 +++++++------ src/renderers/WebGLRenderer.js | 173 ++++---- 3 files changed, 636 insertions(+), 628 deletions(-) diff --git a/build/Three.js b/build/Three.js index d3a5d12d..77cd17fe 100644 --- a/build/Three.js +++ b/build/Three.js @@ -17,38 +17,38 @@ b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,e=[];b=0;for(c=a.length;b0&&a>0&&k+a<1}for(var e,f=[],h=0,k=a.children.length;ha.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h=b(this.origin, -this.direction,a.matrixWorld.getPosition());if(h==null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var l,m,t,u,p,v,o,z,x=a.geometry,w=x.vertices,h=0,k=x.faces.length;h0:v<0)))if(v=p.dot((new THREE.Vector3).sub(l,o))/v,o=o.addSelf(z.multiplyScalar(v)),e instanceof THREE.Face3)c(o,l,m,t)&&(e={distance:this.origin.distanceTo(o),point:o,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(o,l,m,u)||c(o,m,t,u)))e={distance:this.origin.distanceTo(o),point:o,face:e,object:a},f.push(e)}return f}}; -THREE.Rectangle=function(){function a(){h=e-b;k=f-c}var b,c,e,f,h,k,l=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return k};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(k,h,u,p){l=!1;b=k;c=h;e=u;f=p;a()};this.addPoint=function(k,h){l?(l=!1,b=k,c=h,e=k,f=h):(b=bk?e:k,f=f>h?f:h);a()};this.add3Points= -function(k,h,u,p,v,o){l?(l=!1,b=ku?k>v?k:v:u>v?u:v,f=h>p?h>o?h:o:p>o?p:o):(b=ku?k>v?k>e?k:e:v>e?v:e:u>v?u>e?u:e:v>e?v:e,f=h>p?h>o?h>f?h:f:o>f?o:f:p>o?p>f?p:f:o>f?o:f);a()};this.addRectangle=function(k){l?(l=!1,b=k.getLeft(),c=k.getTop(),e=k.getRight(),f=k.getBottom()):(b=bk.getRight()?e:k.getRight(),f=f> +this.direction,a.matrixWorld.getPosition());if(h==null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var l,n,p,u,t,v,o,y,x=a.geometry,w=x.vertices,h=0,k=x.faces.length;h0:v<0)))if(v=t.dot((new THREE.Vector3).sub(l,o))/v,o=o.addSelf(y.multiplyScalar(v)),e instanceof THREE.Face3)c(o,l,n,p)&&(e={distance:this.origin.distanceTo(o),point:o,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(o,l,n,u)||c(o,n,p,u)))e={distance:this.origin.distanceTo(o),point:o,face:e,object:a},f.push(e)}return f}}; +THREE.Rectangle=function(){function a(){h=e-b;k=f-c}var b,c,e,f,h,k,l=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return k};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(k,h,u,t){l=!1;b=k;c=h;e=u;f=t;a()};this.addPoint=function(k,h){l?(l=!1,b=k,c=h,e=k,f=h):(b=bk?e:k,f=f>h?f:h);a()};this.add3Points= +function(k,h,u,t,v,o){l?(l=!1,b=ku?k>v?k:v:u>v?u:v,f=h>t?h>o?h:o:t>o?t:o):(b=ku?k>v?k>e?k:e:v>e?v:e:u>v?u>e?u:e:v>e?v:e,f=h>t?h>o?h>f?h:f:o>f?o:f:t>o?t>f?t:f:o>f?o:f);a()};this.addRectangle=function(k){l?(l=!1,b=k.getLeft(),c=k.getTop(),e=k.getRight(),f=k.getBottom()):(b=bk.getRight()?e:k.getRight(),f=f> k.getBottom()?f:k.getBottom());a()};this.inflate=function(k){b-=k;c-=k;e+=k;f+=k;a()};this.minSelf=function(k){b=b>k.getLeft()?b:k.getLeft();c=c>k.getTop()?c:k.getTop();e=e=0&&Math.min(f,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){l=!0;f=e=c=b=0;a()};this.isEmpty=function(){return l}}; THREE.Math={clamp:function(a,b,c){return ac?c:a},clampBottom:function(a,b){return a=0&&k>=0&&h>=0&&l>=0?!0:f<0&&k<0||h<0&&l<0?!1:(f<0?b=Math.max(b,f/(f-k)):k<0&&(e=Math.min(e,f/(f-k))),h<0?b=Math.max(b,h/(h-l)):l<0&&(e=Math.min(e,h/(h-l))),eE&&k.positionScreen.z0&&F.z<1))fa=A[y]=A[y]||new THREE.RenderableParticle,y++,B=fa,B.x=F.x/F.w,B.y=F.y/F.w,B.z=F.z,B.rotation=T.rotation.z,B.scale.x=T.scale.x*Math.abs(B.x-(F.x+f.projectionMatrix.n11)/(F.w+f.projectionMatrix.n14)),B.scale.y=T.scale.y*Math.abs(B.y-(F.y+f.projectionMatrix.n22)/(F.w+f.projectionMatrix.n24)),B.materials=T.materials,C.push(B);h&&C.sort(b);return C}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; +THREE.Projector=function(){function a(){var a=n[l]=n[l]||new THREE.RenderableVertex;l++;return a}function b(a,c){return c.z-a.z}function c(a,c){var b=0,e=1,f=a.z+a.w,k=c.z+c.w,h=-a.z+a.w,l=-c.z+c.w;return f>=0&&k>=0&&h>=0&&l>=0?!0:f<0&&k<0||h<0&&l<0?!1:(f<0?b=Math.max(b,f/(f-k)):k<0&&(e=Math.min(e,f/(f-k))),h<0?b=Math.max(b,h/(h-l)):l<0&&(e=Math.min(e,h/(h-l))),em&&k.positionScreen.z0&&M.z<1))X=C[z]=C[z]||new THREE.RenderableParticle,z++,A=X,A.x=M.x/M.w,A.y=M.y/M.w,A.z=M.z,A.rotation=Y.rotation.z,A.scale.x=Y.scale.x*Math.abs(A.x-(M.x+f.projectionMatrix.n11)/(M.w+f.projectionMatrix.n14)),A.scale.y=Y.scale.y*Math.abs(A.y-(M.y+f.projectionMatrix.n22)/(M.w+f.projectionMatrix.n24)),A.materials=Y.materials,K.push(A);h&&K.sort(b);return K}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),h=Math.cos(c),c=Math.sin(c),k=a*b,l=e*f;this.w=k*h-l*c;this.x=k*c+l*h;this.y=e*b*h+a*f*c;this.z=a*f*h-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c); this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;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,e=this.z,f=this.w,h=a.x,k=a.y,l=a.z,a=a.w;this.x=b*a+f*h+c*l-e*k;this.y=c*a+f*k+e*h-b*l;this.z=e*a+f*l+b*k-c*h;this.w=f*a-b*h-c*k-e*l;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,e=a.y,f=a.z,h=this.x,k=this.y,l=this.z,m=this.w,t=m*c+k*f-l*e,u=m*e+l*c-h*f,p=m*f+h*e-k*c,c=-h* -c-k*e-l*f;b.x=t*m+c*-h+u*-l-p*-k;b.y=u*m+c*-k+p*-h-t*-l;b.z=p*m+c*-l+t*-k-u*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),k=Math.sqrt(1-f*f);if(Math.abs(k)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/k;e=Math.sin(e*h)/k;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; +this.x,c=this.y,e=this.z,f=this.w,h=a.x,k=a.y,l=a.z,a=a.w;this.x=b*a+f*h+c*l-e*k;this.y=c*a+f*k+e*h-b*l;this.z=e*a+f*l+b*k-c*h;this.w=f*a-b*h-c*k-e*l;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,e=a.y,f=a.z,h=this.x,k=this.y,l=this.z,n=this.w,p=n*c+k*f-l*e,u=n*e+l*c-h*f,t=n*f+h*e-k*c,c=-h* +c-k*e-l*f;b.x=p*n+c*-h+u*-l-t*-k;b.y=u*n+c*-k+t*-h-p*-l;b.z=t*n+c*-l+p*-k-u*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),k=Math.sqrt(1-f*f);if(Math.abs(k)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/k;e=Math.sin(e*h)/k;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,e,f,h){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3}; THREE.Face4=function(a,b,c,e,f,h,k){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materialIndex=k;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}}; THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, +c.vertexNormals[1].copy(e[c.b]),c.vertexNormals[2].copy(e[c.c]),c.vertexNormals[3].copy(e[c.d]))},computeTangents:function(){function a(a,c,b,e,f,h,m){l=a.vertices[c].position;n=a.vertices[b].position;p=a.vertices[e].position;u=k[f];t=k[h];v=k[m];o=n.x-l.x;y=p.x-l.x;x=n.y-l.y;w=p.y-l.y;A=n.z-l.z;z=p.z-l.z;C=t.u-u.u;B=v.u-u.u;K=t.v-u.v;F=v.v-u.v;M=1/(C*F-B*K);H.set((F*o-K*y)*M,(F*x-K*w)*M,(F*A-K*z)*M);P.set((C*y-B*o)*M,(C*w-B*x)*M,(C*z-B*A)*M);O[c].addSelf(H);O[b].addSelf(H);O[e].addSelf(H);V[c].addSelf(P); +V[b].addSelf(P);V[e].addSelf(P)}var b,c,e,f,h,k,l,n,p,u,t,v,o,y,x,w,A,z,C,B,K,F,M,E,O=[],V=[],H=new THREE.Vector3,P=new THREE.Vector3,L=new THREE.Vector3,T=new THREE.Vector3,S=new THREE.Vector3;b=0;for(c=this.vertices.length;b0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;bthis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;t=this.points[c[0]];u=this.points[c[1]]; -p=this.points[c[2]];v=this.points[c[3]];l=k*k;m=k*l;e.x=b(t.x,u.x,p.x,v.x,k,l,m);e.y=b(t.y,u.y,p.y,v.y,k,l,m);e.z=b(t.z,u.z,p.z,v.z,k,l,m);return e};this.getControlPointsArray=function(){var a,c,b=this.points.length,e=[];for(a=0;athis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;p=this.points[c[0]];u=this.points[c[1]]; +t=this.points[c[2]];v=this.points[c[3]];l=k*k;n=k*l;e.x=b(p.x,u.x,t.x,v.x,k,l,n);e.y=b(p.y,u.y,t.y,v.y,k,l,n);e.z=b(p.z,u.z,t.z,v.z,k,l,n);return e};this.getControlPointsArray=function(){var a,c,b=this.points.length,e=[];for(a=0;a0&&(c(THREE.NormalBlending),b(1),f("rgba("+Math.floor(z.r*255)+","+Math.floor(z.g*255)+","+ -Math.floor(z.b*255)+","+x+")"),o.fillRect(Math.floor(M.getX()),Math.floor(M.getY()),Math.floor(M.getWidth()),Math.floor(M.getHeight()))),M.empty())};this.render=function(a,m){function t(a){var c,b,e,f=a.lights;K.setRGB(0,0,0);ra.setRGB(0,0,0);wa.setRGB(0,0,0);a=0;for(c=f.length;a>1,va=t.height>>1,h=k.scale.x*p,m=k.scale.y*v,n=h*u,l=m*va,Y.set(a.x-n,a.y-l,a.x+n,a.y+l),Da.intersects(Y)&&(o.save(),o.translate(a.x,a.y),o.rotate(-k.rotation),o.scale(h,-m),o.translate(-u,-va),o.drawImage(t,0,0),o.restore())}else h instanceof THREE.ParticleCanvasMaterial&&(n=k.scale.x*p,l=k.scale.y*v,Y.set(a.x-n,a.y-l,a.x+n,a.y+l),Da.intersects(Y)&&(e(h.color.getContextStyle()),f(h.color.getContextStyle()),o.save(),o.translate(a.x,a.y),o.rotate(-k.rotation),o.scale(n,l),h.program(o), -o.restore()))}function x(a,f,k,h){b(h.opacity);c(h.blending);o.beginPath();o.moveTo(a.positionScreen.x,a.positionScreen.y);o.lineTo(f.positionScreen.x,f.positionScreen.y);o.closePath();if(h instanceof THREE.LineBasicMaterial){a=h.linewidth;if(E!=a)o.lineWidth=E=a;a=h.linecap;if(C!=a)o.lineCap=C=a;a=h.linejoin;if(L!=a)o.lineJoin=L=a;e(h.color.getContextStyle());o.stroke();Y.inflate(h.linewidth*2)}}function z(a,e,f,k,l,t,p,o,v){h.info.render.vertices+=3;h.info.render.faces++;b(o.opacity);c(o.blending); -J=a.positionScreen.x;V=a.positionScreen.y;X=e.positionScreen.x;O=e.positionScreen.y;n=f.positionScreen.x;U=f.positionScreen.y;B(J,V,X,O,n,U);if(o instanceof THREE.MeshBasicMaterial)if(o.map)o.map.mapping instanceof THREE.UVMapping&&(ma=p.uvs[0],$a(J,V,X,O,n,U,ma[k].u,ma[k].v,ma[l].u,ma[l].v,ma[t].u,ma[t].v,o.map));else if(o.envMap){if(o.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=m.matrixWorldInverse,ha.copy(p.vertexNormalsWorld[0]),na=(ha.x*a.n11+ha.y*a.n12+ha.z*a.n13)*0.5+0.5,pa= --(ha.x*a.n21+ha.y*a.n22+ha.z*a.n23)*0.5+0.5,ha.copy(p.vertexNormalsWorld[1]),Ca=(ha.x*a.n11+ha.y*a.n12+ha.z*a.n13)*0.5+0.5,Fa=-(ha.x*a.n21+ha.y*a.n22+ha.z*a.n23)*0.5+0.5,ha.copy(p.vertexNormalsWorld[2]),Ea=(ha.x*a.n11+ha.y*a.n12+ha.z*a.n13)*0.5+0.5,za=-(ha.x*a.n21+ha.y*a.n22+ha.z*a.n23)*0.5+0.5,$a(J,V,X,O,n,U,na,pa,Ca,Fa,Ea,za,o.envMap)}else o.wireframe?Ma(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):Na(o.color);else if(o instanceof THREE.MeshLambertMaterial)o.map&&!o.wireframe&& -(o.map.mapping instanceof THREE.UVMapping&&(ma=p.uvs[0],$a(J,V,X,O,n,U,ma[k].u,ma[k].v,ma[l].u,ma[l].v,ma[t].u,ma[t].v,o.map)),c(THREE.SubtractiveBlending)),ia?!o.wireframe&&o.shading==THREE.SmoothShading&&p.vertexNormalsWorld.length==3?(Q.r=T.r=fa.r=K.r,Q.g=T.g=fa.g=K.g,Q.b=T.b=fa.b=K.b,u(v,p.v1.positionWorld,p.vertexNormalsWorld[0],Q),u(v,p.v2.positionWorld,p.vertexNormalsWorld[1],T),u(v,p.v3.positionWorld,p.vertexNormalsWorld[2],fa),Q.r=Math.max(0,Math.min(o.color.r*Q.r,1)),Q.g=Math.max(0,Math.min(o.color.g* -Q.g,1)),Q.b=Math.max(0,Math.min(o.color.b*Q.b,1)),T.r=Math.max(0,Math.min(o.color.r*T.r,1)),T.g=Math.max(0,Math.min(o.color.g*T.g,1)),T.b=Math.max(0,Math.min(o.color.b*T.b,1)),fa.r=Math.max(0,Math.min(o.color.r*fa.r,1)),fa.g=Math.max(0,Math.min(o.color.g*fa.g,1)),fa.b=Math.max(0,Math.min(o.color.b*fa.b,1)),ga.r=(T.r+fa.r)*0.5,ga.g=(T.g+fa.g)*0.5,ga.b=(T.b+fa.b)*0.5,sa=Xa(Q,T,fa,ga),Ua(J,V,X,O,n,U,0,0,1,0,0,1,sa)):(ja.r=K.r,ja.g=K.g,ja.b=K.b,u(v,p.centroidWorld,p.normalWorld,ja),Z.r=Math.max(0,Math.min(o.color.r* -ja.r,1)),Z.g=Math.max(0,Math.min(o.color.g*ja.g,1)),Z.b=Math.max(0,Math.min(o.color.b*ja.b,1)),o.wireframe?Ma(Z,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):Na(Z)):o.wireframe?Ma(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):Na(o.color);else if(o instanceof THREE.MeshDepthMaterial)oa=m.near,da=m.far,Q.r=Q.g=Q.b=1-Qa(a.positionScreen.z,oa,da),T.r=T.g=T.b=1-Qa(e.positionScreen.z,oa,da),fa.r=fa.g=fa.b=1-Qa(f.positionScreen.z,oa,da),ga.r=(T.r+fa.r)*0.5,ga.g=(T.g+ -fa.g)*0.5,ga.b=(T.b+fa.b)*0.5,sa=Xa(Q,T,fa,ga),Ua(J,V,X,O,n,U,0,0,1,0,0,1,sa);else if(o instanceof THREE.MeshNormalMaterial)Z.r=Va(p.normalWorld.x),Z.g=Va(p.normalWorld.y),Z.b=Va(p.normalWorld.z),o.wireframe?Ma(Z,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):Na(Z)}function y(a,e,f,k,l,t,o,p,v){h.info.render.vertices+=4;h.info.render.faces++;b(p.opacity);c(p.blending);if(p.map||p.envMap)z(a,e,k,0,1,3,o,p,v),z(l,f,t,1,2,3,o,p,v);else if(J=a.positionScreen.x,V=a.positionScreen.y,X=e.positionScreen.x, -O=e.positionScreen.y,n=f.positionScreen.x,U=f.positionScreen.y,$=k.positionScreen.x,aa=k.positionScreen.y,ca=l.positionScreen.x,ea=l.positionScreen.y,la=t.positionScreen.x,ka=t.positionScreen.y,p instanceof THREE.MeshBasicMaterial)A(J,V,X,O,n,U,$,aa),p.wireframe?Ma(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Na(p.color);else if(p instanceof THREE.MeshLambertMaterial)ia?!p.wireframe&&p.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==4?(Q.r=T.r=fa.r=ga.r=K.r,Q.g= -T.g=fa.g=ga.g=K.g,Q.b=T.b=fa.b=ga.b=K.b,u(v,o.v1.positionWorld,o.vertexNormalsWorld[0],Q),u(v,o.v2.positionWorld,o.vertexNormalsWorld[1],T),u(v,o.v4.positionWorld,o.vertexNormalsWorld[3],fa),u(v,o.v3.positionWorld,o.vertexNormalsWorld[2],ga),Q.r=Math.max(0,Math.min(p.color.r*Q.r,1)),Q.g=Math.max(0,Math.min(p.color.g*Q.g,1)),Q.b=Math.max(0,Math.min(p.color.b*Q.b,1)),T.r=Math.max(0,Math.min(p.color.r*T.r,1)),T.g=Math.max(0,Math.min(p.color.g*T.g,1)),T.b=Math.max(0,Math.min(p.color.b*T.b,1)),fa.r=Math.max(0, -Math.min(p.color.r*fa.r,1)),fa.g=Math.max(0,Math.min(p.color.g*fa.g,1)),fa.b=Math.max(0,Math.min(p.color.b*fa.b,1)),ga.r=Math.max(0,Math.min(p.color.r*ga.r,1)),ga.g=Math.max(0,Math.min(p.color.g*ga.g,1)),ga.b=Math.max(0,Math.min(p.color.b*ga.b,1)),sa=Xa(Q,T,fa,ga),B(J,V,X,O,$,aa),Ua(J,V,X,O,$,aa,0,0,1,0,0,1,sa),B(ca,ea,n,U,la,ka),Ua(ca,ea,n,U,la,ka,1,0,1,1,0,1,sa)):(ja.r=K.r,ja.g=K.g,ja.b=K.b,u(v,o.centroidWorld,o.normalWorld,ja),Z.r=Math.max(0,Math.min(p.color.r*ja.r,1)),Z.g=Math.max(0,Math.min(p.color.g* -ja.g,1)),Z.b=Math.max(0,Math.min(p.color.b*ja.b,1)),A(J,V,X,O,n,U,$,aa),p.wireframe?Ma(Z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Na(Z)):(A(J,V,X,O,n,U,$,aa),p.wireframe?Ma(p.color,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Na(p.color));else if(p instanceof THREE.MeshNormalMaterial)Z.r=Va(o.normalWorld.x),Z.g=Va(o.normalWorld.y),Z.b=Va(o.normalWorld.z),A(J,V,X,O,n,U,$,aa),p.wireframe?Ma(Z,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):Na(Z);else if(p instanceof -THREE.MeshDepthMaterial)oa=m.near,da=m.far,Q.r=Q.g=Q.b=1-Qa(a.positionScreen.z,oa,da),T.r=T.g=T.b=1-Qa(e.positionScreen.z,oa,da),fa.r=fa.g=fa.b=1-Qa(k.positionScreen.z,oa,da),ga.r=ga.g=ga.b=1-Qa(f.positionScreen.z,oa,da),sa=Xa(Q,T,fa,ga),B(J,V,X,O,$,aa),Ua(J,V,X,O,$,aa,0,0,1,0,0,1,sa),B(ca,ea,n,U,la,ka),Ua(ca,ea,n,U,la,ka,1,0,1,1,0,1,sa)}function B(a,c,b,e,f,k){o.beginPath();o.moveTo(a,c);o.lineTo(b,e);o.lineTo(f,k);o.lineTo(a,c);o.closePath()}function A(a,c,b,e,f,k,h,n){o.beginPath();o.moveTo(a, -c);o.lineTo(b,e);o.lineTo(f,k);o.lineTo(h,n);o.lineTo(a,c);o.closePath()}function Ma(a,c,b,f){if(E!=c)o.lineWidth=E=c;if(C!=b)o.lineCap=C=b;if(L!=f)o.lineJoin=L=f;e(a.getContextStyle());o.stroke();Y.inflate(c*2)}function Na(a){f(a.getContextStyle());o.fill()}function $a(a,c,b,e,k,h,n,l,m,t,p,v,u){if(u.image.width!=0){if(u.needsUpdate==!0||qa[u.id]==void 0){var va=u.wrapS==THREE.RepeatWrapping,M=u.wrapT==THREE.RepeatWrapping;qa[u.id]=o.createPattern(u.image,va&&M?"repeat":va&&!M?"repeat-x":!va&&M? -"repeat-y":"no-repeat");u.needsUpdate=!1}f(qa[u.id]);var va=u.offset.x/u.repeat.x,M=u.offset.y/u.repeat.y,w=(u.image.width-1)*u.repeat.x,u=(u.image.height-1)*u.repeat.y,n=(n+va)*w,l=(l+M)*u,m=(m+va)*w,t=(t+M)*u,p=(p+va)*w,v=(v+M)*u;b-=a;e-=c;k-=a;h-=c;m-=n;t-=l;p-=n;v-=l;va=1/(m*v-p*t);u=(v*b-t*k)*va;t=(v*e-t*h)*va;b=(m*k-p*b)*va;e=(m*h-p*e)*va;a=a-u*n-b*l;c=c-t*n-e*l;o.save();o.transform(u,t,b,e,a,c);o.fill();o.restore()}}function Ua(a,c,b,e,f,k,h,n,l,m,t,p,u){var v,va;v=u.width-1;va=u.height-1; -h*=v;n*=va;l*=v;m*=va;t*=v;p*=va;b-=a;e-=c;f-=a;k-=c;l-=h;m-=n;t-=h;p-=n;va=1/(l*p-t*m);v=(p*b-m*f)*va;m=(p*e-m*k)*va;b=(l*f-t*b)*va;e=(l*k-t*e)*va;a=a-v*h-b*n;c=c-m*h-e*n;o.save();o.transform(v,m,b,e,a,c);o.clip();o.drawImage(u,0,0);o.restore()}function Xa(a,c,b,e){var f=~~(a.r*255),k=~~(a.g*255),a=~~(a.b*255),h=~~(c.r*255),n=~~(c.g*255),c=~~(c.b*255),l=~~(b.r*255),m=~~(b.g*255),b=~~(b.b*255),t=~~(e.r*255),p=~~(e.g*255),e=~~(e.b*255);Ba[0]=f<0?0:f>255?255:f;Ba[1]=k<0?0:k>255?255:k;Ba[2]=a<0?0:a> -255?255:a;Ba[4]=h<0?0:h>255?255:h;Ba[5]=n<0?0:n>255?255:n;Ba[6]=c<0?0:c>255?255:c;Ba[8]=l<0?0:l>255?255:l;Ba[9]=m<0?0:m>255?255:m;Ba[10]=b<0?0:b>255?255:b;Ba[12]=t<0?0:t>255?255:t;Ba[13]=p<0?0:p>255?255:p;Ba[14]=e<0?0:e>255?255:e;ua.putImageData(ya,0,0);Ia.drawImage(xa,0,0);return Ha}function Qa(a,c,b){a=(a-c)/(b-c);return a*a*(3-2*a)}function Va(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function Oa(a,c){var b=c.x-a.x,e=c.y-a.y,f=b*b+e*e;f!=0&&(f=1/Math.sqrt(f),b*=f,e*=f,c.x+=b,c.y+=e,a.x-=b,a.y-=e)}var Ya, -ab,ta,Ga,Pa,Wa,Za,Aa;this.autoClear?this.clear():o.setTransform(1,0,0,-1,p,v);h.info.render.vertices=0;h.info.render.faces=0;k=l.projectScene(a,m,this.sortElements);(ia=a.lights.length>0)&&t(a);Ya=0;for(ab=k.length;Ya0&&(c(THREE.NormalBlending),b(1),f("rgba("+Math.floor(y.r*255)+","+Math.floor(y.g*255)+","+ +Math.floor(y.b*255)+","+x+")"),o.fillRect(Math.floor(G.getX()),Math.floor(G.getY()),Math.floor(G.getWidth()),Math.floor(G.getHeight()))),G.empty())};this.render=function(a,n){function p(a){var c,b,e,f=a.lights;N.setRGB(0,0,0);ta.setRGB(0,0,0);pa.setRGB(0,0,0);a=0;for(c=f.length;a>1,wa=p.height>>1,h=k.scale.x*t,n=k.scale.y*v,m=h*u,l=n*wa,$.set(a.x-m,a.y-l,a.x+m,a.y+l),xa.intersects($)&&(o.save(),o.translate(a.x,a.y),o.rotate(-k.rotation),o.scale(h,-n),o.translate(-u,-wa),o.drawImage(p,0,0),o.restore())}else h instanceof THREE.ParticleCanvasMaterial&&(m=k.scale.x*t,l=k.scale.y*v,$.set(a.x-m,a.y-l,a.x+m,a.y+l),xa.intersects($)&&(e(h.color.getContextStyle()),f(h.color.getContextStyle()),o.save(),o.translate(a.x,a.y),o.rotate(-k.rotation),o.scale(m,l),h.program(o), +o.restore()))}function w(a,f,k,h){b(h.opacity);c(h.blending);o.beginPath();o.moveTo(a.positionScreen.x,a.positionScreen.y);o.lineTo(f.positionScreen.x,f.positionScreen.y);o.closePath();if(h instanceof THREE.LineBasicMaterial){a=h.linewidth;if(B!=a)o.lineWidth=B=a;a=h.linecap;if(K!=a)o.lineCap=K=a;a=h.linejoin;if(F!=a)o.lineJoin=F=a;e(h.color.getContextStyle());o.stroke();$.inflate(h.linewidth*2)}}function y(a,e,f,k,l,p,t,o,v){h.info.render.vertices+=3;h.info.render.faces++;b(o.opacity);c(o.blending); +L=a.positionScreen.x;T=a.positionScreen.y;S=e.positionScreen.x;m=e.positionScreen.y;aa=f.positionScreen.x;U=f.positionScreen.y;A(L,T,S,m,aa,U);if(o instanceof THREE.MeshBasicMaterial)if(o.map)o.map.mapping instanceof THREE.UVMapping&&(la=t.uvs[0],$a(L,T,S,m,aa,U,la[k].u,la[k].v,la[l].u,la[l].v,la[p].u,la[p].v,o.map));else if(o.envMap){if(o.envMap.mapping instanceof THREE.SphericalReflectionMapping)a=n.matrixWorldInverse,ka.copy(t.vertexNormalsWorld[0]),ua=(ka.x*a.n11+ka.y*a.n12+ka.z*a.n13)*0.5+0.5, +sa=-(ka.x*a.n21+ka.y*a.n22+ka.z*a.n23)*0.5+0.5,ka.copy(t.vertexNormalsWorld[1]),Da=(ka.x*a.n11+ka.y*a.n12+ka.z*a.n13)*0.5+0.5,Ea=-(ka.x*a.n21+ka.y*a.n22+ka.z*a.n23)*0.5+0.5,ka.copy(t.vertexNormalsWorld[2]),za=(ka.x*a.n11+ka.y*a.n12+ka.z*a.n13)*0.5+0.5,Fa=-(ka.x*a.n21+ka.y*a.n22+ka.z*a.n23)*0.5+0.5,$a(L,T,S,m,aa,U,ua,sa,Da,Ea,za,Fa,o.envMap)}else o.wireframe?Ka(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):La(o.color);else if(o instanceof THREE.MeshLambertMaterial)o.map&&!o.wireframe&& +(o.map.mapping instanceof THREE.UVMapping&&(la=t.uvs[0],$a(L,T,S,m,aa,U,la[k].u,la[k].v,la[l].u,la[l].v,la[p].u,la[p].v,o.map)),c(THREE.SubtractiveBlending)),ma?!o.wireframe&&o.shading==THREE.SmoothShading&&t.vertexNormalsWorld.length==3?(R.r=Y.r=X.r=N.r,R.g=Y.g=X.g=N.g,R.b=Y.b=X.b=N.b,u(v,t.v1.positionWorld,t.vertexNormalsWorld[0],R),u(v,t.v2.positionWorld,t.vertexNormalsWorld[1],Y),u(v,t.v3.positionWorld,t.vertexNormalsWorld[2],X),R.r=Math.max(0,Math.min(o.color.r*R.r,1)),R.g=Math.max(0,Math.min(o.color.g* +R.g,1)),R.b=Math.max(0,Math.min(o.color.b*R.b,1)),Y.r=Math.max(0,Math.min(o.color.r*Y.r,1)),Y.g=Math.max(0,Math.min(o.color.g*Y.g,1)),Y.b=Math.max(0,Math.min(o.color.b*Y.b,1)),X.r=Math.max(0,Math.min(o.color.r*X.r,1)),X.g=Math.max(0,Math.min(o.color.g*X.g,1)),X.b=Math.max(0,Math.min(o.color.b*X.b,1)),ga.r=(Y.r+X.r)*0.5,ga.g=(Y.g+X.g)*0.5,ga.b=(Y.b+X.b)*0.5,qa=Xa(R,Y,X,ga),Ua(L,T,S,m,aa,U,0,0,1,0,0,1,qa)):(I.r=N.r,I.g=N.g,I.b=N.b,u(v,t.centroidWorld,t.normalWorld,I),Z.r=Math.max(0,Math.min(o.color.r* +I.r,1)),Z.g=Math.max(0,Math.min(o.color.g*I.g,1)),Z.b=Math.max(0,Math.min(o.color.b*I.b,1)),o.wireframe?Ka(Z,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):La(Z)):o.wireframe?Ka(o.color,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):La(o.color);else if(o instanceof THREE.MeshDepthMaterial)na=n.near,fa=n.far,R.r=R.g=R.b=1-Oa(a.positionScreen.z,na,fa),Y.r=Y.g=Y.b=1-Oa(e.positionScreen.z,na,fa),X.r=X.g=X.b=1-Oa(f.positionScreen.z,na,fa),ga.r=(Y.r+X.r)*0.5,ga.g=(Y.g+X.g)*0.5, +ga.b=(Y.b+X.b)*0.5,qa=Xa(R,Y,X,ga),Ua(L,T,S,m,aa,U,0,0,1,0,0,1,qa);else if(o instanceof THREE.MeshNormalMaterial)Z.r=Va(t.normalWorld.x),Z.g=Va(t.normalWorld.y),Z.b=Va(t.normalWorld.z),o.wireframe?Ka(Z,o.wireframeLinewidth,o.wireframeLinecap,o.wireframeLinejoin):La(Z)}function z(a,e,f,k,l,p,o,t,v){h.info.render.vertices+=4;h.info.render.faces++;b(t.opacity);c(t.blending);if(t.map||t.envMap)y(a,e,k,0,1,3,o,t,v),y(l,f,p,1,2,3,o,t,v);else if(L=a.positionScreen.x,T=a.positionScreen.y,S=e.positionScreen.x, +m=e.positionScreen.y,aa=f.positionScreen.x,U=f.positionScreen.y,ea=k.positionScreen.x,da=k.positionScreen.y,ia=l.positionScreen.x,ha=l.positionScreen.y,ja=p.positionScreen.x,ca=p.positionScreen.y,t instanceof THREE.MeshBasicMaterial)C(L,T,S,m,aa,U,ea,da),t.wireframe?Ka(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(t.color);else if(t instanceof THREE.MeshLambertMaterial)ma?!t.wireframe&&t.shading==THREE.SmoothShading&&o.vertexNormalsWorld.length==4?(R.r=Y.r=X.r=ga.r=N.r,R.g= +Y.g=X.g=ga.g=N.g,R.b=Y.b=X.b=ga.b=N.b,u(v,o.v1.positionWorld,o.vertexNormalsWorld[0],R),u(v,o.v2.positionWorld,o.vertexNormalsWorld[1],Y),u(v,o.v4.positionWorld,o.vertexNormalsWorld[3],X),u(v,o.v3.positionWorld,o.vertexNormalsWorld[2],ga),R.r=Math.max(0,Math.min(t.color.r*R.r,1)),R.g=Math.max(0,Math.min(t.color.g*R.g,1)),R.b=Math.max(0,Math.min(t.color.b*R.b,1)),Y.r=Math.max(0,Math.min(t.color.r*Y.r,1)),Y.g=Math.max(0,Math.min(t.color.g*Y.g,1)),Y.b=Math.max(0,Math.min(t.color.b*Y.b,1)),X.r=Math.max(0, +Math.min(t.color.r*X.r,1)),X.g=Math.max(0,Math.min(t.color.g*X.g,1)),X.b=Math.max(0,Math.min(t.color.b*X.b,1)),ga.r=Math.max(0,Math.min(t.color.r*ga.r,1)),ga.g=Math.max(0,Math.min(t.color.g*ga.g,1)),ga.b=Math.max(0,Math.min(t.color.b*ga.b,1)),qa=Xa(R,Y,X,ga),A(L,T,S,m,ea,da),Ua(L,T,S,m,ea,da,0,0,1,0,0,1,qa),A(ia,ha,aa,U,ja,ca),Ua(ia,ha,aa,U,ja,ca,1,0,1,1,0,1,qa)):(I.r=N.r,I.g=N.g,I.b=N.b,u(v,o.centroidWorld,o.normalWorld,I),Z.r=Math.max(0,Math.min(t.color.r*I.r,1)),Z.g=Math.max(0,Math.min(t.color.g* +I.g,1)),Z.b=Math.max(0,Math.min(t.color.b*I.b,1)),C(L,T,S,m,aa,U,ea,da),t.wireframe?Ka(Z,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(Z)):(C(L,T,S,m,aa,U,ea,da),t.wireframe?Ka(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(t.color));else if(t instanceof THREE.MeshNormalMaterial)Z.r=Va(o.normalWorld.x),Z.g=Va(o.normalWorld.y),Z.b=Va(o.normalWorld.z),C(L,T,S,m,aa,U,ea,da),t.wireframe?Ka(Z,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):La(Z); +else if(t instanceof THREE.MeshDepthMaterial)na=n.near,fa=n.far,R.r=R.g=R.b=1-Oa(a.positionScreen.z,na,fa),Y.r=Y.g=Y.b=1-Oa(e.positionScreen.z,na,fa),X.r=X.g=X.b=1-Oa(k.positionScreen.z,na,fa),ga.r=ga.g=ga.b=1-Oa(f.positionScreen.z,na,fa),qa=Xa(R,Y,X,ga),A(L,T,S,m,ea,da),Ua(L,T,S,m,ea,da,0,0,1,0,0,1,qa),A(ia,ha,aa,U,ja,ca),Ua(ia,ha,aa,U,ja,ca,1,0,1,1,0,1,qa)}function A(a,c,b,e,f,k){o.beginPath();o.moveTo(a,c);o.lineTo(b,e);o.lineTo(f,k);o.lineTo(a,c);o.closePath()}function C(a,c,b,e,f,k,h,m){o.beginPath(); +o.moveTo(a,c);o.lineTo(b,e);o.lineTo(f,k);o.lineTo(h,m);o.lineTo(a,c);o.closePath()}function Ka(a,c,b,f){if(B!=c)o.lineWidth=B=c;if(K!=b)o.lineCap=K=b;if(F!=f)o.lineJoin=F=f;e(a.getContextStyle());o.stroke();$.inflate(c*2)}function La(a){f(a.getContextStyle());o.fill()}function $a(a,c,b,e,k,h,m,l,n,p,t,u,v){if(v.image.width!=0){if(v.needsUpdate==!0||oa[v.id]==void 0){var wa=v.wrapS==THREE.RepeatWrapping,G=v.wrapT==THREE.RepeatWrapping;oa[v.id]=o.createPattern(v.image,wa&&G?"repeat":wa&&!G?"repeat-x": +!wa&&G?"repeat-y":"no-repeat");v.needsUpdate=!1}f(oa[v.id]);var wa=v.offset.x/v.repeat.x,G=v.offset.y/v.repeat.y,x=(v.image.width-1)*v.repeat.x,v=(v.image.height-1)*v.repeat.y,m=(m+wa)*x,l=(l+G)*v,n=(n+wa)*x,p=(p+G)*v,t=(t+wa)*x,u=(u+G)*v;b-=a;e-=c;k-=a;h-=c;n-=m;p-=l;t-=m;u-=l;wa=1/(n*u-t*p);v=(u*b-p*k)*wa;p=(u*e-p*h)*wa;b=(n*k-t*b)*wa;e=(n*h-t*e)*wa;a=a-v*m-b*l;c=c-p*m-e*l;o.save();o.transform(v,p,b,e,a,c);o.fill();o.restore()}}function Ua(a,c,b,e,f,k,h,m,l,n,p,t,v){var u,wa;u=v.width-1;wa=v.height- +1;h*=u;m*=wa;l*=u;n*=wa;p*=u;t*=wa;b-=a;e-=c;f-=a;k-=c;l-=h;n-=m;p-=h;t-=m;wa=1/(l*t-p*n);u=(t*b-n*f)*wa;n=(t*e-n*k)*wa;b=(l*f-p*b)*wa;e=(l*k-p*e)*wa;a=a-u*h-b*m;c=c-n*h-e*m;o.save();o.transform(u,n,b,e,a,c);o.clip();o.drawImage(v,0,0);o.restore()}function Xa(a,c,b,e){var f=~~(a.r*255),k=~~(a.g*255),a=~~(a.b*255),h=~~(c.r*255),m=~~(c.g*255),c=~~(c.b*255),l=~~(b.r*255),n=~~(b.g*255),b=~~(b.b*255),p=~~(e.r*255),t=~~(e.g*255),e=~~(e.b*255);Ba[0]=f<0?0:f>255?255:f;Ba[1]=k<0?0:k>255?255:k;Ba[2]=a<0?0: +a>255?255:a;Ba[4]=h<0?0:h>255?255:h;Ba[5]=m<0?0:m>255?255:m;Ba[6]=c<0?0:c>255?255:c;Ba[8]=l<0?0:l>255?255:l;Ba[9]=n<0?0:n>255?255:n;Ba[10]=b<0?0:b>255?255:b;Ba[12]=p<0?0:p>255?255:p;Ba[13]=t<0?0:t>255?255:t;Ba[14]=e<0?0:e>255?255:e;va.putImageData(Ca,0,0);W.drawImage(ya,0,0);return Ga}function Oa(a,c,b){a=(a-c)/(b-c);return a*a*(3-2*a)}function Va(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function Ma(a,c){var b=c.x-a.x,e=c.y-a.y,f=b*b+e*e;f!=0&&(f=1/Math.sqrt(f),b*=f,e*=f,c.x+=b,c.y+=e,a.x-=b,a.y-=e)}var Ya, +ab,ra,Ha,Na,Wa,Za,Aa;this.autoClear?this.clear():o.setTransform(1,0,0,-1,t,v);h.info.render.vertices=0;h.info.render.faces=0;k=l.projectScene(a,n,this.sortElements);(ma=a.lights.length>0)&&p(a);Ya=0;for(ab=k.length;Ya0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h)):k instanceof THREE.PointLight&&(R.sub(k.position,c.centroidWorld),R.normalize(),h=c.normalWorld.dot(R)*k.intensity,h>0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h))}function b(c,b,k,l,t,p){h.info.render.vertices+=3;h.info.render.faces++;J=e(V++); -J.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?E.copy(t.color):t instanceof THREE.MeshLambertMaterial?A?(C.r=L.r,C.g=L.g,C.b=L.b,a(p,l,C),E.r=Math.max(0,Math.min(t.color.r*C.r,1)),E.g=Math.max(0,Math.min(t.color.g*C.g,1)),E.b=Math.max(0,Math.min(t.color.b*C.b,1))):E.copy(t.color):t instanceof THREE.MeshDepthMaterial?(N=1-t.__2near/(t.__farPlusNear- -l.z*t.__farMinusNear),E.setRGB(N,N,N)):t instanceof THREE.MeshNormalMaterial&&E.setRGB(f(l.normalWorld.x),f(l.normalWorld.y),f(l.normalWorld.z));t.wireframe?J.setAttribute("style","fill: none; stroke: "+E.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):J.setAttribute("style","fill: "+E.getContextStyle()+"; fill-opacity: "+t.opacity);m.appendChild(J)}function c(c,b,k,l,t,p,o){h.info.render.vertices+= -4;h.info.render.faces++;J=e(V++);J.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+" L "+l.positionScreen.x+","+l.positionScreen.y+"z");p instanceof THREE.MeshBasicMaterial?E.copy(p.color):p instanceof THREE.MeshLambertMaterial?A?(C.r=L.r,C.g=L.g,C.b=L.b,a(o,t,C),E.r=Math.max(0,Math.min(p.color.r*C.r,1)),E.g=Math.max(0,Math.min(p.color.g*C.g,1)),E.b=Math.max(0,Math.min(p.color.b*C.b,1))): -E.copy(p.color):p instanceof THREE.MeshDepthMaterial?(N=1-p.__2near/(p.__farPlusNear-t.z*p.__farMinusNear),E.setRGB(N,N,N)):p instanceof THREE.MeshNormalMaterial&&E.setRGB(f(t.normalWorld.x),f(t.normalWorld.y),f(t.normalWorld.z));p.wireframe?J.setAttribute("style","fill: none; stroke: "+E.getContextStyle()+"; stroke-width: "+p.wireframeLinewidth+"; stroke-opacity: "+p.opacity+"; stroke-linecap: "+p.wireframeLinecap+"; stroke-linejoin: "+p.wireframeLinejoin):J.setAttribute("style","fill: "+E.getContextStyle()+ -"; fill-opacity: "+p.opacity);m.appendChild(J)}function e(a){H[a]==null&&(H[a]=document.createElementNS("http://www.w3.org/2000/svg","path"),O==0&&H[a].setAttribute("shape-rendering","crispEdges"));return H[a]}function f(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}var h=this,k=null,l=new THREE.Projector,m=document.createElementNS("http://www.w3.org/2000/svg","svg"),t,u,p,v,o,z,x,w,B=new THREE.Rectangle,y=new THREE.Rectangle,A=!1,E=new THREE.Color(16777215),C=new THREE.Color(16777215),L=new THREE.Color(0), -F=new THREE.Color(0),G=new THREE.Color(0),N,R=new THREE.Vector3,H=[],S=[],J,V,X,O=1;this.domElement=m;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,c){t=a;u=c;p=t/2;v=u/2;m.setAttribute("viewBox",-p+" "+-v+" "+t+" "+u);m.setAttribute("width",t);m.setAttribute("height",u);B.set(-p,-v,p,v)};this.clear=function(){for(;m.childNodes.length>0;)m.removeChild(m.childNodes[0])}; -this.render=function(a,e){var f,t,u,E,N,H,C,Q;this.autoClear&&this.clear();h.info.render.vertices=0;h.info.render.faces=0;k=l.projectScene(a,e,this.sortElements);X=V=0;if(A=a.lights.length>0){C=a.lights;L.setRGB(0,0,0);F.setRGB(0,0,0);G.setRGB(0,0,0);f=0;for(t=C.length;f0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h)):k instanceof THREE.PointLight&&(V.sub(k.position,c.centroidWorld),V.normalize(),h=c.normalWorld.dot(V)*k.intensity,h>0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h))}function b(c,b,k,m,l,p){h.info.render.vertices+=3;h.info.render.faces++;L=e(T++); +L.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");l instanceof THREE.MeshBasicMaterial?B.copy(l.color):l instanceof THREE.MeshLambertMaterial?C?(K.r=F.r,K.g=F.g,K.b=F.b,a(p,m,K),B.r=Math.max(0,Math.min(l.color.r*K.r,1)),B.g=Math.max(0,Math.min(l.color.g*K.g,1)),B.b=Math.max(0,Math.min(l.color.b*K.b,1))):B.copy(l.color):l instanceof THREE.MeshDepthMaterial?(O=1-l.__2near/(l.__farPlusNear- +m.z*l.__farMinusNear),B.setRGB(O,O,O)):l instanceof THREE.MeshNormalMaterial&&B.setRGB(f(m.normalWorld.x),f(m.normalWorld.y),f(m.normalWorld.z));l.wireframe?L.setAttribute("style","fill: none; stroke: "+B.getContextStyle()+"; stroke-width: "+l.wireframeLinewidth+"; stroke-opacity: "+l.opacity+"; stroke-linecap: "+l.wireframeLinecap+"; stroke-linejoin: "+l.wireframeLinejoin):L.setAttribute("style","fill: "+B.getContextStyle()+"; fill-opacity: "+l.opacity);n.appendChild(L)}function c(c,b,k,m,l,p,t){h.info.render.vertices+= +4;h.info.render.faces++;L=e(T++);L.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");p instanceof THREE.MeshBasicMaterial?B.copy(p.color):p instanceof THREE.MeshLambertMaterial?C?(K.r=F.r,K.g=F.g,K.b=F.b,a(t,l,K),B.r=Math.max(0,Math.min(p.color.r*K.r,1)),B.g=Math.max(0,Math.min(p.color.g*K.g,1)),B.b=Math.max(0,Math.min(p.color.b*K.b,1))): +B.copy(p.color):p instanceof THREE.MeshDepthMaterial?(O=1-p.__2near/(p.__farPlusNear-l.z*p.__farMinusNear),B.setRGB(O,O,O)):p instanceof THREE.MeshNormalMaterial&&B.setRGB(f(l.normalWorld.x),f(l.normalWorld.y),f(l.normalWorld.z));p.wireframe?L.setAttribute("style","fill: none; stroke: "+B.getContextStyle()+"; stroke-width: "+p.wireframeLinewidth+"; stroke-opacity: "+p.opacity+"; stroke-linecap: "+p.wireframeLinecap+"; stroke-linejoin: "+p.wireframeLinejoin):L.setAttribute("style","fill: "+B.getContextStyle()+ +"; fill-opacity: "+p.opacity);n.appendChild(L)}function e(a){H[a]==null&&(H[a]=document.createElementNS("http://www.w3.org/2000/svg","path"),m==0&&H[a].setAttribute("shape-rendering","crispEdges"));return H[a]}function f(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}var h=this,k=null,l=new THREE.Projector,n=document.createElementNS("http://www.w3.org/2000/svg","svg"),p,u,t,v,o,y,x,w,A=new THREE.Rectangle,z=new THREE.Rectangle,C=!1,B=new THREE.Color(16777215),K=new THREE.Color(16777215),F=new THREE.Color(0), +M=new THREE.Color(0),E=new THREE.Color(0),O,V=new THREE.Vector3,H=[],P=[],L,T,S,m=1;this.domElement=n;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(a){switch(a){case "high":m=1;break;case "low":m=0}};this.setSize=function(a,c){p=a;u=c;t=p/2;v=u/2;n.setAttribute("viewBox",-t+" "+-v+" "+p+" "+u);n.setAttribute("width",p);n.setAttribute("height",u);A.set(-t,-v,t,v)};this.clear=function(){for(;n.childNodes.length>0;)n.removeChild(n.childNodes[0])}; +this.render=function(a,e){var f,p,u,B,O,H,K,R;this.autoClear&&this.clear();h.info.render.vertices=0;h.info.render.faces=0;k=l.projectScene(a,e,this.sortElements);S=T=0;if(C=a.lights.length>0){K=a.lights;F.setRGB(0,0,0);M.setRGB(0,0,0);E.setRGB(0,0,0);f=0;for(p=K.length;f=0&&(b=a.geometry.materials[c.materialIndex]);return b}function c(a,c,b){var e,f,k,h=a.vertices,l=h.length,m=a.colors,t=m.length,p=a.__vertexArray,o=a.__colorArray,u=a.__sortArray,v=a.__dirtyVertices,M=a.__dirtyColors,w=a.__webglCustomAttributesList,x;if(w){k=0;for(e=w.length;k=0)c&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglVertexBuffer),n.vertexAttribPointer(a.position,3,n.FLOAT,!1,0,0));else if(h.morphTargetBase){b=k.program.attributes;h.morphTargetBase!==-1?(n.bindBuffer(n.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[h.morphTargetBase]),n.vertexAttribPointer(b.position,3,n.FLOAT,!1,0,0)):b.position>=0&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglVertexBuffer), -n.vertexAttribPointer(b.position,3,n.FLOAT,!1,0,0));if(h.morphTargetForcedOrder.length){l=0;var p=h.morphTargetForcedOrder;for(m=h.morphTargetInfluences;lt&&(o=u,t=m[o]);n.bindBuffer(n.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[o]);n.vertexAttribPointer(b["morphTarget"+l],3,n.FLOAT,!1,0,0);h.__webglMorphTargetInfluences[l]=t;p[o]=1;t=-1;l++}}k.program.uniforms.morphTargetInfluences!==null&&n.uniform1fv(k.program.uniforms.morphTargetInfluences,h.__webglMorphTargetInfluences)}if(c){if(f.__webglCustomAttributesList){l=0;for(m=f.__webglCustomAttributesList.length;l= -0&&(n.bindBuffer(n.ARRAY_BUFFER,b.buffer),n.vertexAttribPointer(a[b.buffer.belongsToAttribute],b.size,n.FLOAT,!1,0,0))}a.color>=0&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglColorBuffer),n.vertexAttribPointer(a.color,3,n.FLOAT,!1,0,0));a.normal>=0&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglNormalBuffer),n.vertexAttribPointer(a.normal,3,n.FLOAT,!1,0,0));a.tangent>=0&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglTangentBuffer),n.vertexAttribPointer(a.tangent,4,n.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(n.bindBuffer(n.ARRAY_BUFFER, -f.__webglUVBuffer),n.vertexAttribPointer(a.uv,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(a.uv)):n.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(n.bindBuffer(n.ARRAY_BUFFER,f.__webglUV2Buffer),n.vertexAttribPointer(a.uv2,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(a.uv2)):n.disableVertexAttribArray(a.uv2));k.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(n.bindBuffer(n.ARRAY_BUFFER,f.__webglSkinVertexABuffer),n.vertexAttribPointer(a.skinVertexA,4, -n.FLOAT,!1,0,0),n.bindBuffer(n.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),n.vertexAttribPointer(a.skinVertexB,4,n.FLOAT,!1,0,0),n.bindBuffer(n.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),n.vertexAttribPointer(a.skinIndex,4,n.FLOAT,!1,0,0),n.bindBuffer(n.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),n.vertexAttribPointer(a.skinWeight,4,n.FLOAT,!1,0,0))}h instanceof THREE.Mesh?(k.wireframe?(n.lineWidth(k.wireframeLinewidth),c&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),n.drawElements(n.LINES,f.__webglLineCount, -n.UNSIGNED_SHORT,0)):(c&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),n.drawElements(n.TRIANGLES,f.__webglFaceCount,n.UNSIGNED_SHORT,0)),O.info.render.calls++,O.info.render.vertices+=f.__webglFaceCount,O.info.render.faces+=f.__webglFaceCount/3):h instanceof THREE.Line?(h=h.type==THREE.LineStrip?n.LINE_STRIP:n.LINES,n.lineWidth(k.linewidth),n.drawArrays(h,0,f.__webglLineCount),O.info.render.calls++):h instanceof THREE.ParticleSystem?(n.drawArrays(n.POINTS,0,f.__webglParticleCount),O.info.render.calls++): -h instanceof THREE.Ribbon&&(n.drawArrays(n.TRIANGLE_STRIP,0,f.__webglVertexCount),O.info.render.calls++)}}function h(a,c,b){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=n.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=n.createBuffer();a.hasPos&&(n.bindBuffer(n.ARRAY_BUFFER,a.__webglVertexBuffer),n.bufferData(n.ARRAY_BUFFER,a.positionArray,n.DYNAMIC_DRAW),n.enableVertexAttribArray(c.attributes.position),n.vertexAttribPointer(c.attributes.position,3,n.FLOAT,!1,0,0));if(a.hasNormal){n.bindBuffer(n.ARRAY_BUFFER, -a.__webglNormalBuffer);if(b==THREE.FlatShading){var e,f,k,h,l,m,p,t,o,u,v=a.count*3;for(u=0;u=0&&(c=c.geometry.materials[materialIndex], -c.transparent?v(a,c):v(f,c))):(c=b)&&(c.transparent?v(a,c):v(f,c))}function x(a,c){return c.z-a.z}function w(a){var c,b,m,t=0,o,v,x,w,M=a.lights;ha||(ha=new THREE.PerspectiveCamera(O.shadowCameraFov,O.shadowMapWidth/O.shadowMapHeight,O.shadowCameraNear,O.shadowCameraFar));c=0;for(b=M.length;c=0;b--)a[b].object==c&&a.splice(b,1)}function L(a,c,b){a.push({buffer:c,object:b,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function F(a){if(a!=Q){switch(a){case THREE.AdditiveBlending:n.blendEquation(n.FUNC_ADD);n.blendFunc(n.SRC_ALPHA,n.ONE);break;case THREE.SubtractiveBlending:n.blendEquation(n.FUNC_ADD);n.blendFunc(n.ZERO,n.ONE_MINUS_SRC_COLOR); -break;case THREE.MultiplyBlending:n.blendEquation(n.FUNC_ADD);n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA)}Q=a}}function G(a,c,b){(b.width&b.width-1)==0&&(b.height&b.height-1)==0?(n.texParameteri(a,n.TEXTURE_WRAP_S,X(c.wrapS)),n.texParameteri(a,n.TEXTURE_WRAP_T,X(c.wrapT)),n.texParameteri(a,n.TEXTURE_MAG_FILTER,X(c.magFilter)),n.texParameteri(a,n.TEXTURE_MIN_FILTER,X(c.minFilter)), -n.generateMipmap(a)):(n.texParameteri(a,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(a,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(a,n.TEXTURE_MAG_FILTER,V(c.magFilter)),n.texParameteri(a,n.TEXTURE_MIN_FILTER,V(c.minFilter)))}function N(a,c){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=n.createTexture(),O.info.memory.textures++;n.activeTexture(n.TEXTURE0+c);n.bindTexture(n.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?n.texImage2D(n.TEXTURE_2D,0,X(a.format), -a.image.width,a.image.height,0,X(a.format),n.UNSIGNED_BYTE,a.image.data):n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,a.image);G(n.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else n.activeTexture(n.TEXTURE0+c),n.bindTexture(n.TEXTURE_2D,a.__webglTexture)}function R(a,c){n.bindRenderbuffer(n.RENDERBUFFER,a);c.depthBuffer&&!c.stencilBuffer?(n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,c.width,c.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,a)): -c.depthBuffer&&c.stencilBuffer?(n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,c.width,c.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,a)):n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,c.width,c.height)}function H(a){var c=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=n.createTexture();if(c){a.__webglFramebuffer=[];a.__webglRenderbuffer= -[];n.bindTexture(n.TEXTURE_CUBE_MAP,a.__webglTexture);G(n.TEXTURE_CUBE_MAP,a,a);for(var b=0;b<6;b++){a.__webglFramebuffer[b]=n.createFramebuffer();a.__webglRenderbuffer[b]=n.createRenderbuffer();n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,X(a.format),a.width,a.height,0,X(a.format),X(a.type),null);var e=a,f=n.TEXTURE_CUBE_MAP_POSITIVE_X+b;n.bindFramebuffer(n.FRAMEBUFFER,a.__webglFramebuffer[b]);n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,f,e.__webglTexture,0);R(a.__webglRenderbuffer[b], -a)}}else a.__webglFramebuffer=n.createFramebuffer(),a.__webglRenderbuffer=n.createRenderbuffer(),n.bindTexture(n.TEXTURE_2D,a.__webglTexture),G(n.TEXTURE_2D,a,a),n.texImage2D(n.TEXTURE_2D,0,X(a.format),a.width,a.height,0,X(a.format),X(a.type),null),b=n.TEXTURE_2D,n.bindFramebuffer(n.FRAMEBUFFER,a.__webglFramebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,b,a.__webglTexture,0),n.bindRenderbuffer(n.RENDERBUFFER,a.__webglRenderbuffer),R(a.__webglRenderbuffer,a);c?n.bindTexture(n.TEXTURE_CUBE_MAP, -null):n.bindTexture(n.TEXTURE_2D,null);n.bindRenderbuffer(n.RENDERBUFFER,null);n.bindFramebuffer(n.FRAMEBUFFER,null)}a?(c=c?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,b=a.width,a=a.height,f=e=0):(c=null,b=ma,a=na,e=da,f=sa);c!=aa&&(n.bindFramebuffer(n.FRAMEBUFFER,c),n.viewport(e,f,b,a),aa=c)}function S(a){a instanceof THREE.WebGLRenderTargetCube?(n.bindTexture(n.TEXTURE_CUBE_MAP,a.__webglTexture),n.generateMipmap(n.TEXTURE_CUBE_MAP),n.bindTexture(n.TEXTURE_CUBE_MAP,null)):(n.bindTexture(n.TEXTURE_2D, -a.__webglTexture),n.generateMipmap(n.TEXTURE_2D),n.bindTexture(n.TEXTURE_2D,null))}function J(a,c){var b;a=="fragment"?b=n.createShader(n.FRAGMENT_SHADER):a=="vertex"&&(b=n.createShader(n.VERTEX_SHADER));n.shaderSource(b,c);n.compileShader(b);if(!n.getShaderParameter(b,n.COMPILE_STATUS))return console.error(n.getShaderInfoLog(b)),console.error(c),null;return b}function V(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return n.NEAREST; -default:return n.LINEAR}}function X(a){switch(a){case THREE.RepeatWrapping:return n.REPEAT;case THREE.ClampToEdgeWrapping:return n.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return n.MIRRORED_REPEAT;case THREE.NearestFilter:return n.NEAREST;case THREE.NearestMipMapNearestFilter:return n.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return n.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return n.LINEAR;case THREE.LinearMipMapNearestFilter:return n.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return n.LINEAR_MIPMAP_LINEAR; -case THREE.ByteType:return n.BYTE;case THREE.UnsignedByteType:return n.UNSIGNED_BYTE;case THREE.ShortType:return n.SHORT;case THREE.UnsignedShortType:return n.UNSIGNED_SHORT;case THREE.IntType:return n.INT;case THREE.UnsignedShortType:return n.UNSIGNED_INT;case THREE.FloatType:return n.FLOAT;case THREE.AlphaFormat:return n.ALPHA;case THREE.RGBFormat:return n.RGB;case THREE.RGBAFormat:return n.RGBA;case THREE.LuminanceFormat:return n.LUMINANCE;case THREE.LuminanceAlphaFormat:return n.LUMINANCE_ALPHA}return 0} -var O=this,n,U=[],$=null,aa=null,ca=-1,ea=null,la=0,ka=null,Z=null,Q=null,T=null,fa=null,ga=null,qa=null,oa=null,da=0,sa=0,ma=0,na=0,pa=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Fa=new Float32Array(16),Ea=new Float32Array(16),za=new THREE.Vector4,Da={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},M=a.canvas!==void 0?a.canvas:document.createElement("canvas"), -Y=a.stencil!==void 0?a.stencil:!0,ia=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,ja=a.antialias!==void 0?a.antialias:!1,K=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),ra=a.clearAlpha!==void 0?a.clearAlpha:0,wa=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=M;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear= -!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var ha,xa=[],a=THREE.ShaderLib.depthRGBA,ua=THREE.UniformsUtils.clone(a.uniforms),ya=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ua}), -Ba=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ua,morphTargets:!0});ya._shadowPass=!0;Ba._shadowPass=!0;try{if(!(n=M.getContext("experimental-webgl",{antialias:ja,stencil:Y,preserveDrawingBuffer:ia})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+n.getParameter(n.VERSION)+" | "+n.getParameter(n.VENDOR)+" | "+n.getParameter(n.RENDERER)+" | "+n.getParameter(n.SHADING_LANGUAGE_VERSION))}catch(Ha){console.error(Ha)}n.clearColor(0, -0,0,1);n.clearDepth(1);n.clearStencil(0);n.enable(n.DEPTH_TEST);n.depthFunc(n.LEQUAL);n.frontFace(n.CCW);n.cullFace(n.BACK);n.enable(n.CULL_FACE);n.enable(n.BLEND);n.blendEquation(n.FUNC_ADD);n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA);n.clearColor(K.r,K.g,K.b,ra);this.context=n;var Ia=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,W={};W.vertices=new Float32Array(16);W.faces=new Uint16Array(6);Y=0;W.vertices[Y++]=-1;W.vertices[Y++]=-1;W.vertices[Y++]=0;W.vertices[Y++]=1;W.vertices[Y++]=1; -W.vertices[Y++]=-1;W.vertices[Y++]=1;W.vertices[Y++]=1;W.vertices[Y++]=1;W.vertices[Y++]=1;W.vertices[Y++]=1;W.vertices[Y++]=0;W.vertices[Y++]=-1;W.vertices[Y++]=1;W.vertices[Y++]=0;Y=W.vertices[Y++]=0;W.faces[Y++]=0;W.faces[Y++]=1;W.faces[Y++]=2;W.faces[Y++]=0;W.faces[Y++]=2;W.faces[Y++]=3;W.vertexBuffer=n.createBuffer();W.elementBuffer=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,W.vertexBuffer);n.bufferData(n.ARRAY_BUFFER,W.vertices,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,W.elementBuffer); -n.bufferData(n.ELEMENT_ARRAY_BUFFER,W.faces,n.STATIC_DRAW);W.program=n.createProgram();n.attachShader(W.program,J("fragment",THREE.ShaderLib.sprite.fragmentShader));n.attachShader(W.program,J("vertex",THREE.ShaderLib.sprite.vertexShader));n.linkProgram(W.program);W.attributes={};W.uniforms={};W.attributes.position=n.getAttribLocation(W.program,"position");W.attributes.uv=n.getAttribLocation(W.program,"uv");W.uniforms.uvOffset=n.getUniformLocation(W.program,"uvOffset");W.uniforms.uvScale=n.getUniformLocation(W.program, -"uvScale");W.uniforms.rotation=n.getUniformLocation(W.program,"rotation");W.uniforms.scale=n.getUniformLocation(W.program,"scale");W.uniforms.alignment=n.getUniformLocation(W.program,"alignment");W.uniforms.color=n.getUniformLocation(W.program,"color");W.uniforms.map=n.getUniformLocation(W.program,"map");W.uniforms.opacity=n.getUniformLocation(W.program,"opacity");W.uniforms.useScreenCoordinates=n.getUniformLocation(W.program,"useScreenCoordinates");W.uniforms.affectedByDistance=n.getUniformLocation(W.program, -"affectedByDistance");W.uniforms.screenPosition=n.getUniformLocation(W.program,"screenPosition");W.uniforms.modelViewMatrix=n.getUniformLocation(W.program,"modelViewMatrix");W.uniforms.projectionMatrix=n.getUniformLocation(W.program,"projectionMatrix");var Ja=!1;this.setSize=function(a,c){M.width=a;M.height=c;this.setViewport(0,0,M.width,M.height)};this.setViewport=function(a,c,b,e){da=a;sa=c;ma=b;na=e;n.viewport(da,sa,ma,na)};this.setScissor=function(a,c,b,e){n.scissor(a,c,b,e)};this.enableScissorTest= -function(a){a?n.enable(n.SCISSOR_TEST):n.disable(n.SCISSOR_TEST)};this.setClearColorHex=function(a,c){K.setHex(a);ra=c;n.clearColor(K.r,K.g,K.b,ra)};this.setClearColor=function(a,c){K.copy(a);ra=c;n.clearColor(K.r,K.g,K.b,ra)};this.getClearColor=function(){return K};this.getClearAlpha=function(){return ra};this.clear=function(a,c,b){var e=0;if(a==void 0||a)e|=n.COLOR_BUFFER_BIT;if(c==void 0||c)e|=n.DEPTH_BUFFER_BIT;if(b==void 0||b)e|=n.STENCIL_BUFFER_BIT;n.clear(e)};this.getContext=function(){return n}; -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(g in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[g];n.deleteBuffer(c.__webglVertexBuffer);n.deleteBuffer(c.__webglNormalBuffer);n.deleteBuffer(c.__webglTangentBuffer);n.deleteBuffer(c.__webglColorBuffer);n.deleteBuffer(c.__webglUVBuffer);n.deleteBuffer(c.__webglUV2Buffer);n.deleteBuffer(c.__webglSkinVertexABuffer); -n.deleteBuffer(c.__webglSkinVertexBBuffer);n.deleteBuffer(c.__webglSkinIndicesBuffer);n.deleteBuffer(c.__webglSkinWeightsBuffer);n.deleteBuffer(c.__webglFaceBuffer);n.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var b=0,e=c.numMorphTargets;b=0&&(b=a.geometry.materials[c.materialIndex]);return b}function c(a,c,b){var e,f,k,h=a.vertices,l=h.length,n=a.colors,p=n.length,t=a.__vertexArray,o=a.__colorArray,u=a.__sortArray,v=a.__dirtyVertices,G=a.__dirtyColors,x=a.__webglCustomAttributesList,w;if(x){k=0;for(e=x.length;k=0)c&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglVertexBuffer),m.vertexAttribPointer(a.position,3,m.FLOAT,!1,0,0));else if(h.morphTargetBase){b=k.program.attributes;h.morphTargetBase!==-1?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[h.morphTargetBase]),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0)):b.position>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglVertexBuffer), +m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));if(h.morphTargetForcedOrder.length){l=0;var p=h.morphTargetForcedOrder;for(n=h.morphTargetInfluences;lt&&(o=v,t=n[o]);m.bindBuffer(m.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[o]);m.vertexAttribPointer(b["morphTarget"+l],3,m.FLOAT,!1,0,0);h.__webglMorphTargetInfluences[l]=t;p[o]=1;t=-1;l++}}k.program.uniforms.morphTargetInfluences!==null&&m.uniform1fv(k.program.uniforms.morphTargetInfluences,h.__webglMorphTargetInfluences)}if(c){if(f.__webglCustomAttributesList){l=0;for(n=f.__webglCustomAttributesList.length;l= +0&&(m.bindBuffer(m.ARRAY_BUFFER,b.buffer),m.vertexAttribPointer(a[b.buffer.belongsToAttribute],b.size,m.FLOAT,!1,0,0))}a.color>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglColorBuffer),m.vertexAttribPointer(a.color,3,m.FLOAT,!1,0,0));a.normal>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglNormalBuffer),m.vertexAttribPointer(a.normal,3,m.FLOAT,!1,0,0));a.tangent>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglTangentBuffer),m.vertexAttribPointer(a.tangent,4,m.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(m.bindBuffer(m.ARRAY_BUFFER, +f.__webglUVBuffer),m.vertexAttribPointer(a.uv,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(a.uv)):m.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglUV2Buffer),m.vertexAttribPointer(a.uv2,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(a.uv2)):m.disableVertexAttribArray(a.uv2));k.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinVertexABuffer),m.vertexAttribPointer(a.skinVertexA,4, +m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),m.vertexAttribPointer(a.skinVertexB,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),m.vertexAttribPointer(a.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),m.vertexAttribPointer(a.skinWeight,4,m.FLOAT,!1,0,0))}h instanceof THREE.Mesh?(k.wireframe?(m.lineWidth(k.wireframeLinewidth),c&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),m.drawElements(m.LINES,f.__webglLineCount, +m.UNSIGNED_SHORT,0)):(c&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),m.drawElements(m.TRIANGLES,f.__webglFaceCount,m.UNSIGNED_SHORT,0)),S.info.render.calls++,S.info.render.vertices+=f.__webglFaceCount,S.info.render.faces+=f.__webglFaceCount/3):h instanceof THREE.Line?(h=h.type==THREE.LineStrip?m.LINE_STRIP:m.LINES,m.lineWidth(k.linewidth),m.drawArrays(h,0,f.__webglLineCount),S.info.render.calls++):h instanceof THREE.ParticleSystem?(m.drawArrays(m.POINTS,0,f.__webglParticleCount),S.info.render.calls++): +h instanceof THREE.Ribbon&&(m.drawArrays(m.TRIANGLE_STRIP,0,f.__webglVertexCount),S.info.render.calls++)}}function h(a,c,b){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=m.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=m.createBuffer();a.hasPos&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(c.attributes.position),m.vertexAttribPointer(c.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormal){m.bindBuffer(m.ARRAY_BUFFER, +a.__webglNormalBuffer);if(b==THREE.FlatShading){var e,f,k,h,l,n,p,t,o,v,u=a.count*3;for(v=0;v=0)c=c.geometry.materials[b],c.transparent?(a.transparent=c,a.opaque=null):(a.opaque=c,a.transparent=null)}else if(c=e)c.transparent?(a.transparent= +c,a.opaque=null):(a.opaque=c,a.transparent=null)}function y(a,c){return c.z-a.z}function x(a){var c,b,n,p=0,o,v,G,w,x=a.lights;pa||(pa=new THREE.PerspectiveCamera(S.shadowCameraFov,S.shadowMapWidth/S.shadowMapHeight,S.shadowCameraNear,S.shadowCameraFar));c=0;for(b=x.length;c=0;b--)a[b].object==c&&a.splice(b,1)}function K(a,c,b){a.push({buffer:c,object:b,opaque:null,transparent:null})}function F(a){if(a!=Z){switch(a){case THREE.AdditiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE);break;case THREE.SubtractiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:m.blendEquation(m.FUNC_ADD); +m.blendFunc(m.ZERO,m.SRC_COLOR);break;default:m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)}Z=a}}function M(a,c,b){(b.width&b.width-1)==0&&(b.height&b.height-1)==0?(m.texParameteri(a,m.TEXTURE_WRAP_S,T(c.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,T(c.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,T(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,T(c.minFilter)),m.generateMipmap(a)):(m.texParameteri(a,m.TEXTURE_WRAP_S, +m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,L(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,L(c.minFilter)))}function E(a,c){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=m.createTexture(),S.info.memory.textures++;m.activeTexture(m.TEXTURE0+c);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.image.width,a.image.height,0,T(a.format),m.UNSIGNED_BYTE, +a.image.data):m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,a.image);M(m.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)}function O(a,c){m.bindRenderbuffer(m.RENDERBUFFER,a);c.depthBuffer&&!c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):c.depthBuffer&&c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER, +m.DEPTH_STENCIL,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,c.width,c.height)}function V(a){var c=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=m.createTexture();if(c){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture); +M(m.TEXTURE_CUBE_MAP,a,a);for(var b=0;b<6;b++){a.__webglFramebuffer[b]=m.createFramebuffer();a.__webglRenderbuffer[b]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null);var e=a,f=m.TEXTURE_CUBE_MAP_POSITIVE_X+b;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[b]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,f,e.__webglTexture,0);O(a.__webglRenderbuffer[b],a)}}else a.__webglFramebuffer=m.createFramebuffer(), +a.__webglRenderbuffer=m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),M(m.TEXTURE_2D,a,a),m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null),b=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,b,a.__webglTexture,0),m.bindRenderbuffer(m.RENDERBUFFER,a.__webglRenderbuffer),O(a.__webglRenderbuffer,a);c?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null); +m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(c=c?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,b=a.width,a=a.height,f=e=0):(c=null,b=qa,a=la,e=na,f=fa);c!=ea&&(m.bindFramebuffer(m.FRAMEBUFFER,c),m.viewport(e,f,b,a),ea=c)}function H(a){a instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture), +m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function P(a,c){var b;a=="fragment"?b=m.createShader(m.FRAGMENT_SHADER):a=="vertex"&&(b=m.createShader(m.VERTEX_SHADER));m.shaderSource(b,c);m.compileShader(b);if(!m.getShaderParameter(b,m.COMPILE_STATUS))return console.error(m.getShaderInfoLog(b)),console.error(c),null;return b}function L(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return m.NEAREST;default:return m.LINEAR}} +function T(a){switch(a){case THREE.RepeatWrapping:return m.REPEAT;case THREE.ClampToEdgeWrapping:return m.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return m.MIRRORED_REPEAT;case THREE.NearestFilter:return m.NEAREST;case THREE.NearestMipMapNearestFilter:return m.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return m.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return m.LINEAR;case THREE.LinearMipMapNearestFilter:return m.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return m.LINEAR_MIPMAP_LINEAR; +case THREE.ByteType:return m.BYTE;case THREE.UnsignedByteType:return m.UNSIGNED_BYTE;case THREE.ShortType:return m.SHORT;case THREE.UnsignedShortType:return m.UNSIGNED_SHORT;case THREE.IntType:return m.INT;case THREE.UnsignedShortType:return m.UNSIGNED_INT;case THREE.FloatType:return m.FLOAT;case THREE.AlphaFormat:return m.ALPHA;case THREE.RGBFormat:return m.RGB;case THREE.RGBAFormat:return m.RGBA;case THREE.LuminanceFormat:return m.LUMINANCE;case THREE.LuminanceAlphaFormat:return m.LUMINANCE_ALPHA}return 0} +var S=this,m,aa=[],U=null,ea=null,da=-1,ia=null,ha=0,ja=null,ca=null,Z=null,R=null,Y=null,X=null,ga=null,oa=null,na=0,fa=0,qa=0,la=0,ua=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],sa=new THREE.Matrix4,Da=new Float32Array(16),Ea=new Float32Array(16),za=new THREE.Vector4,Fa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},xa=a.canvas!==void 0?a.canvas:document.createElement("canvas"), +G=a.stencil!==void 0?a.stencil:!0,$=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,ma=a.antialias!==void 0?a.antialias:!1,I=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),N=a.clearAlpha!==void 0?a.clearAlpha:0,ta=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=xa;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear= +!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var pa,ka=[],a=THREE.ShaderLib.depthRGBA,ya=THREE.UniformsUtils.clone(a.uniforms),va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya}), +Ca=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya,morphTargets:!0});va._shadowPass=!0;Ca._shadowPass=!0;try{if(!(m=xa.getContext("experimental-webgl",{antialias:ma,stencil:G,preserveDrawingBuffer:$})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+m.getParameter(m.VERSION)+" | "+m.getParameter(m.VENDOR)+" | "+m.getParameter(m.RENDERER)+" | "+m.getParameter(m.SHADING_LANGUAGE_VERSION))}catch(Ba){console.error(Ba)}m.clearColor(0, +0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.clearColor(I.r,I.g,I.b,N);this.context=m;var Ga=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,W={};W.vertices=new Float32Array(16);W.faces=new Uint16Array(6);G=0;W.vertices[G++]=-1;W.vertices[G++]=-1;W.vertices[G++]=0;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]= +-1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=0;W.vertices[G++]=-1;W.vertices[G++]=1;W.vertices[G++]=0;G=W.vertices[G++]=0;W.faces[G++]=0;W.faces[G++]=1;W.faces[G++]=2;W.faces[G++]=0;W.faces[G++]=2;W.faces[G++]=3;W.vertexBuffer=m.createBuffer();W.elementBuffer=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,W.vertexBuffer);m.bufferData(m.ARRAY_BUFFER,W.vertices,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,W.elementBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER, +W.faces,m.STATIC_DRAW);W.program=m.createProgram();m.attachShader(W.program,P("fragment",THREE.ShaderLib.sprite.fragmentShader));m.attachShader(W.program,P("vertex",THREE.ShaderLib.sprite.vertexShader));m.linkProgram(W.program);W.attributes={};W.uniforms={};W.attributes.position=m.getAttribLocation(W.program,"position");W.attributes.uv=m.getAttribLocation(W.program,"uv");W.uniforms.uvOffset=m.getUniformLocation(W.program,"uvOffset");W.uniforms.uvScale=m.getUniformLocation(W.program,"uvScale");W.uniforms.rotation= +m.getUniformLocation(W.program,"rotation");W.uniforms.scale=m.getUniformLocation(W.program,"scale");W.uniforms.alignment=m.getUniformLocation(W.program,"alignment");W.uniforms.color=m.getUniformLocation(W.program,"color");W.uniforms.map=m.getUniformLocation(W.program,"map");W.uniforms.opacity=m.getUniformLocation(W.program,"opacity");W.uniforms.useScreenCoordinates=m.getUniformLocation(W.program,"useScreenCoordinates");W.uniforms.affectedByDistance=m.getUniformLocation(W.program,"affectedByDistance"); +W.uniforms.screenPosition=m.getUniformLocation(W.program,"screenPosition");W.uniforms.modelViewMatrix=m.getUniformLocation(W.program,"modelViewMatrix");W.uniforms.projectionMatrix=m.getUniformLocation(W.program,"projectionMatrix");var Ta=!1;this.setSize=function(a,c){xa.width=a;xa.height=c;this.setViewport(0,0,xa.width,xa.height)};this.setViewport=function(a,c,b,e){na=a;fa=c;qa=b;la=e;m.viewport(na,fa,qa,la)};this.setScissor=function(a,c,b,e){m.scissor(a,c,b,e)};this.enableScissorTest=function(a){a? +m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColorHex=function(a,c){I.setHex(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.setClearColor=function(a,c){I.copy(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.getClearColor=function(){return I};this.getClearAlpha=function(){return N};this.clear=function(a,c,b){var e=0;if(a==void 0||a)e|=m.COLOR_BUFFER_BIT;if(c==void 0||c)e|=m.DEPTH_BUFFER_BIT;if(b==void 0||b)e|=m.STENCIL_BUFFER_BIT;m.clear(e)};this.getContext=function(){return m};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(g in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[g];m.deleteBuffer(c.__webglVertexBuffer);m.deleteBuffer(c.__webglNormalBuffer);m.deleteBuffer(c.__webglTangentBuffer);m.deleteBuffer(c.__webglColorBuffer);m.deleteBuffer(c.__webglUVBuffer);m.deleteBuffer(c.__webglUV2Buffer);m.deleteBuffer(c.__webglSkinVertexABuffer); +m.deleteBuffer(c.__webglSkinVertexBBuffer);m.deleteBuffer(c.__webglSkinIndicesBuffer);m.deleteBuffer(c.__webglSkinWeightsBuffer);m.deleteBuffer(c.__webglFaceBuffer);m.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var b=0,e=c.numMorphTargets;b=0&&n.enableVertexAttribArray(v.position);v.color>=0&&n.enableVertexAttribArray(v.color);v.normal>=0&&n.enableVertexAttribArray(v.normal); -v.tangent>=0&&n.enableVertexAttribArray(v.tangent);a.skinning&&v.skinVertexA>=0&&v.skinVertexB>=0&&v.skinIndex>=0&&v.skinWeight>=0&&(n.enableVertexAttribArray(v.skinVertexA),n.enableVertexAttribArray(v.skinVertexB),n.enableVertexAttribArray(v.skinIndex),n.enableVertexAttribArray(v.skinWeight));if(a.attributes)for(k in a.attributes)v[k]!==void 0&&v[k]>=0&&n.enableVertexAttribArray(v[k]);if(a.morphTargets)for(k=a.numSupportedMorphTargets=0;k=0&&(n.enableVertexAttribArray(v[x]), -a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,c,b,e){H(a);this.clear(c,b,e)};this.updateShadowMap=function(a,c){w(a,c)};this.render=function(a,c,b,v){var M,Y,ia,A,E,ja,C,G,oa=a.lights,N=a.fog;ca=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&w(a,c);O.info.render.calls=0;O.info.render.vertices=0;O.info.render.faces=0;if(c.matrixAutoUpdate){for(E=c;E.parent;)E=E.parent;E.update(void 0,!0)}a.update(void 0, -!1,c);c.matrixWorldInverse.flattenToArray(Ea);c.projectionMatrix.flattenToArray(Fa);Ca.multiply(c.projectionMatrix,c.matrixWorldInverse);u(Ca);this.initWebGLObjects(a);H(b);(this.autoClear||v)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);E=a.__webglObjects.length;for(v=0;v=0;v--)if(M=a.__webglObjects[v],M.render){C=M.object;G=M.buffer;ia=M.opaque;k(C);for(M=0;M65535&&(w[v].counter+=1,u=w[v].hash+"_"+w[v].counter,l.geometryGroups[u]==void 0&&(l.geometryGroups[u]={faces:[],materialIndex:o,vertices:0,numMorphTargets:M})),l.geometryGroups[u].faces.push(m),l.geometryGroups[u].vertices+=t;l.geometryGroupsList=[];m=void 0;for(m in l.geometryGroups)l.geometryGroups[m].id=la++,l.geometryGroupsList.push(l.geometryGroups[m])}for(k in h.geometryGroups)if(l=h.geometryGroups[k],!l.__webglVertexBuffer){m=l;m.__webglVertexBuffer=n.createBuffer();m.__webglNormalBuffer= -n.createBuffer();m.__webglTangentBuffer=n.createBuffer();m.__webglColorBuffer=n.createBuffer();m.__webglUVBuffer=n.createBuffer();m.__webglUV2Buffer=n.createBuffer();m.__webglSkinVertexABuffer=n.createBuffer();m.__webglSkinVertexBBuffer=n.createBuffer();m.__webglSkinIndicesBuffer=n.createBuffer();m.__webglSkinWeightsBuffer=n.createBuffer();m.__webglFaceBuffer=n.createBuffer();m.__webglLineBuffer=n.createBuffer();if(m.numMorphTargets){o=p=void 0;m.__webglMorphTargetsBuffers=[];p=0;for(o=m.numMorphTargets;p< -o;p++)m.__webglMorphTargetsBuffers.push(n.createBuffer())}O.info.memory.geometries++;for(var o=e,x=t=w=void 0,v=x=M=x=void 0,u=v=m=0,z=t=void 0,Y=void 0,t=p=M=w=void 0,M=o.geometry,z=M.faces,Y=l.faces,w=0,t=Y.length;w0||M.faceVertexUvs.length>0)l.__uvArray=new Float32Array(m*2);if(M.faceUvs.length>1||M.faceVertexUvs.length>1)l.__uv2Array=new Float32Array(m*2)}if(o.geometry.skinWeights.length&&o.geometry.skinIndices.length)l.__skinVertexAArray= -new Float32Array(m*4),l.__skinVertexBArray=new Float32Array(m*4),l.__skinIndexArray=new Float32Array(m*4),l.__skinWeightArray=new Float32Array(m*4);l.__faceArray=new Uint16Array(v*3+(o.geometry.edgeFaces?o.geometry.edgeFaces.length*6:0));l.__lineArray=new Uint16Array(u*2);if(l.numMorphTargets){l.__morphTargetsArrays=[];M=0;for(x=l.numMorphTargets;M=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&C(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e0&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglColorBuffer), -n.bufferData(n.ARRAY_BUFFER,aa,v));Ia&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglNormalBuffer),n.bufferData(n.ARRAY_BUFFER,xa,v));Ea&&ua.hasTangents&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglTangentBuffer),n.bufferData(n.ARRAY_BUFFER,ca,v));za&&sa>0&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglUVBuffer),n.bufferData(n.ARRAY_BUFFER,fa,v));za&&S>0&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglUV2Buffer),n.bufferData(n.ARRAY_BUFFER,ea,v));Fa&&(n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER, -qa,v),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,pa,v));P>0&&(n.bindBuffer(n.ARRAY_BUFFER,o.__webglSkinVertexABuffer),n.bufferData(n.ARRAY_BUFFER,ga,v),n.bindBuffer(n.ARRAY_BUFFER,o.__webglSkinVertexBBuffer),n.bufferData(n.ARRAY_BUFFER,$,v),n.bindBuffer(n.ARRAY_BUFFER,o.__webglSkinIndicesBuffer),n.bufferData(n.ARRAY_BUFFER,na,v),n.bindBuffer(n.ARRAY_BUFFER,o.__webglSkinWeightsBuffer),n.bufferData(n.ARRAY_BUFFER,Z,v));u&&(delete o.__inittedArrays,delete o.__colorArray, -delete o.__normalArray,delete o.__tangentArray,delete o.__uvArray,delete o.__uv2Array,delete o.__faceArray,delete o.__vertexArray,delete o.__lineArray,delete o.__skinVertexAArray,delete o.__skinVertexBArray,delete o.__skinIndexArray,delete o.__skinWeightArray)}k.__dirtyVertices=!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;E(l,h)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k; -l=n.DYNAMIC_DRAW;m=w=u=u=void 0;M=h.vertices;p=h.colors;t=M.length;o=p.length;z=h.__vertexArray;v=h.__colorArray;Y=h.__dirtyColors;if(h.__dirtyVertices){for(u=0;u=0&&m.enableVertexAttribArray(u.position);u.color>=0&&m.enableVertexAttribArray(u.color);u.normal>=0&&m.enableVertexAttribArray(u.normal); +u.tangent>=0&&m.enableVertexAttribArray(u.tangent);a.skinning&&u.skinVertexA>=0&&u.skinVertexB>=0&&u.skinIndex>=0&&u.skinWeight>=0&&(m.enableVertexAttribArray(u.skinVertexA),m.enableVertexAttribArray(u.skinVertexB),m.enableVertexAttribArray(u.skinIndex),m.enableVertexAttribArray(u.skinWeight));if(a.attributes)for(k in a.attributes)u[k]!==void 0&&u[k]>=0&&m.enableVertexAttribArray(u[k]);if(a.morphTargets)for(k=a.numSupportedMorphTargets=0;k=0&&(m.enableVertexAttribArray(u[G]), +a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,c,b,e){V(a);this.clear(c,b,e)};this.updateShadowMap=function(a,c){x(a,c)};this.render=function(a,c,b,G){var ma,$,z,C,B,I,K,E=a.lights,na=a.fog;da=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&x(a,c);S.info.render.calls=0;S.info.render.vertices=0;S.info.render.faces=0;if(c.matrixAutoUpdate){for(z=c;z.parent;)z=z.parent;z.update(void 0,!0)}a.update(void 0,!1, +c);c.matrixWorldInverse.flattenToArray(Ea);c.projectionMatrix.flattenToArray(Da);sa.multiply(c.projectionMatrix,c.matrixWorldInverse);u(sa);this.initWebGLObjects(a);V(b);(this.autoClear||G)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);z=a.__webglObjects.length;for(G=0;G=0;G--)if(B=a.__webglObjects[G],B.render&&(I=B.object,K=B.buffer,$=B.opaque))k(I),l($.depthTest),n($.depthWrite),p($.polygonOffset,$.polygonOffsetFactor,$.polygonOffsetUnits),f(c,E,na,$,K, +I);for(G=0;G65535&&(G[v].counter+=1,u=G[v].hash+"_"+G[v].counter,l.geometryGroups[u]==void 0&&(l.geometryGroups[u]= +{faces:[],materialIndex:o,vertices:0,numMorphTargets:w})),l.geometryGroups[u].faces.push(n),l.geometryGroups[u].vertices+=t;l.geometryGroupsList=[];n=void 0;for(n in l.geometryGroups)l.geometryGroups[n].id=ha++,l.geometryGroupsList.push(l.geometryGroups[n])}for(k in h.geometryGroups)if(l=h.geometryGroups[k],!l.__webglVertexBuffer){n=l;n.__webglVertexBuffer=m.createBuffer();n.__webglNormalBuffer=m.createBuffer();n.__webglTangentBuffer=m.createBuffer();n.__webglColorBuffer=m.createBuffer();n.__webglUVBuffer= +m.createBuffer();n.__webglUV2Buffer=m.createBuffer();n.__webglSkinVertexABuffer=m.createBuffer();n.__webglSkinVertexBBuffer=m.createBuffer();n.__webglSkinIndicesBuffer=m.createBuffer();n.__webglSkinWeightsBuffer=m.createBuffer();n.__webglFaceBuffer=m.createBuffer();n.__webglLineBuffer=m.createBuffer();if(n.numMorphTargets){o=p=void 0;n.__webglMorphTargetsBuffers=[];p=0;for(o=n.numMorphTargets;p0||w.faceVertexUvs.length>0)l.__uvArray=new Float32Array(n*2);if(w.faceUvs.length>1||w.faceVertexUvs.length>1)l.__uv2Array=new Float32Array(n*2)}if(o.geometry.skinWeights.length&&o.geometry.skinIndices.length)l.__skinVertexAArray=new Float32Array(n*4),l.__skinVertexBArray=new Float32Array(n* +4),l.__skinIndexArray=new Float32Array(n*4),l.__skinWeightArray=new Float32Array(n*4);l.__faceArray=new Uint16Array(v*3);l.__lineArray=new Uint16Array(u*2);if(l.numMorphTargets){l.__morphTargetsArrays=[];w=0;for(x=l.numMorphTargets;w=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&B(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,da,v));Fa&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglNormalBuffer),m.bufferData(m.ARRAY_BUFFER,ya,v));xa&&sa.hasTangents&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglTangentBuffer),m.bufferData(m.ARRAY_BUFFER,aa,v));za&&qa>0&&(m.bindBuffer(m.ARRAY_BUFFER, +o.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,ia,v));za&&Y>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,ua,v));Ea&&(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,Ca,v),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,va,v));Q>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexABuffer),m.bufferData(m.ARRAY_BUFFER,ga,v),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexBBuffer), +m.bufferData(m.ARRAY_BUFFER,ea,v),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Z,v),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,ca,v));u&&(delete o.__inittedArrays,delete o.__colorArray,delete o.__normalArray,delete o.__tangentArray,delete o.__uvArray,delete o.__uv2Array,delete o.__faceArray,delete o.__vertexArray,delete o.__lineArray,delete o.__skinVertexAArray,delete o.__skinVertexBArray,delete o.__skinIndexArray,delete o.__skinWeightArray)}k.__dirtyVertices= +!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(l,h)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;l=m.DYNAMIC_DRAW;n=G=u=u=void 0;w=h.vertices;p=h.colors;t=w.length;o=p.length;y=h.__vertexArray;v=h.__colorArray;ma=h.__dirtyColors;if(h.__dirtyVertices){for(u=0;u1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=k;b.v=h;return b}}; THREE.ColorUtils.__hsv={h:0,s:0,v:0}; -THREE.GeometryUtils={merge:function(a,b){for(var c,e,f=a.vertices.length,h=b instanceof THREE.Mesh?b.geometry:b,k=a.vertices,l=h.vertices,m=a.faces,t=h.faces,u=a.faceVertexUvs[0],p=h.faceVertexUvs[0],v={},o=0;o1&&(e=1-e,f=1-f);h=1-e-f;k.copy(a);k.multiplyScalar(e);l.copy(b);l.multiplyScalar(f);k.addSelf(l);l.copy(c);l.multiplyScalar(h);k.addSelf(l);return k},randomPointInFace:function(a,b,c){var e,f,h;if(a instanceof THREE.Face3)return e=b.vertices[a.a].position,f=b.vertices[a.b].position, +THREE.GeometryUtils={merge:function(a,b){for(var c,e,f=a.vertices.length,h=b instanceof THREE.Mesh?b.geometry:b,k=a.vertices,l=h.vertices,n=a.faces,p=h.faces,u=a.faceVertexUvs[0],t=h.faceVertexUvs[0],v={},o=0;o1&&(e=1-e,f=1-f);h=1-e-f;k.copy(a);k.multiplyScalar(e);l.copy(b);l.multiplyScalar(f);k.addSelf(l);l.copy(c);l.multiplyScalar(h);k.addSelf(l);return k},randomPointInFace:function(a,b,c){var e,f,h;if(a instanceof THREE.Face3)return e=b.vertices[a.a].position,f=b.vertices[a.b].position, h=b.vertices[a.c].position,THREE.GeometryUtils.randomPointInTriangle(e,f,h);else if(a instanceof THREE.Face4){e=b.vertices[a.a].position;f=b.vertices[a.b].position;h=b.vertices[a.c].position;var b=b.vertices[a.d].position,k;c?a._area1&&a._area2?(c=a._area1,k=a._area2):(c=THREE.GeometryUtils.triangleArea(e,f,b),k=THREE.GeometryUtils.triangleArea(f,h,b),a._area1=c,a._area2=k):(c=THREE.GeometryUtils.triangleArea(e,f,b),k=THREE.GeometryUtils.triangleArea(f,h,b));return THREE.GeometryUtils.random()*(c+ -k)a?c(b,f-1):t[f]a?c(b,f-1):p[f]0)l=e-1;else{l=e;break}e=l;if(c[e]==h)return e/(f-1);k=c[e];return c=(e+(h-k)/(c[e+1]-k))/(f-1)};THREE.Curve.prototype.getNormalVector=function(a){a=this.getTangent(a);return new THREE.Vector2(-a.y,a.x)}; +THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),e=0,f=c.length,h;h=b?b:a*c[f-1];time=Date.now();for(var k=0,l=f-1,n;k<=l;)if(e=Math.floor(k+(l-k)/2),n=c[e]-h,n<0)k=e+1;else if(n>0)l=e-1;else{l=e;break}e=l;if(c[e]==h)return e/(f-1);k=c[e];return c=(e+(h-k)/(c[e+1]-k))/(f-1)};THREE.Curve.prototype.getNormalVector=function(a){a=this.getTangent(a);return new THREE.Vector2(-a.y,a.x)}; THREE.Curve.prototype.getTangent=function(a){var b=a-1.0E-4;a+=1.0E-4;b<0&&(b=0);a>1&&(a=1);var b=this.getPoint(b),a=this.getPoint(a),c=new THREE.Vector2;c.sub(a,b);return c.unit()};THREE.LineCurve=function(a,b){a instanceof THREE.Vector2?(this.v1=a,this.v2=b):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(a,b,c,e){this.constructor(new THREE.Vector2(a,b),new THREE.Vector2(c,e))};THREE.LineCurve.prototype=new THREE.Curve; THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.multiplyScalar(a).addSelf(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(){var a=new THREE.Vector2;a.sub(this.v2,this.v1);a.normalize();return a}; THREE.QuadraticBezierCurve=function(a,b,c){if(!(b instanceof THREE.Vector2))var e=Array.prototype.slice.call(arguments),a=new THREE.Vector2(e[0],e[1]),b=new THREE.Vector2(e[2],e[3]),c=new THREE.Vector2(e[4],e[5]);this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; @@ -394,47 +393,47 @@ THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=a},function(a){var THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){}; THREE.CurvePath.prototype.getPoint=function(a){for(var b=a*this.getLength(),c=this.getCurveLengths(),a=0;a=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,e=this.curves.length;for(c=0;cb)b=h.x;else if(h.xc)c=h.y;else if(h.yb)b=h.x;else if(h.xc)c=h.y;else if(h.y0?(k=c[c.length-1],o=k.x,z=k.y):(k=this.actions[e-1].args,o=k[k.length-2],z=k[k.length-1]);for(k=1;k<=a;k++)x=k/a,h=THREE.Shape.Utils.b2(x,o,p,l),x=THREE.Shape.Utils.b2(x,z,v, -m),c.push(new THREE.Vector2(h,x));break;case THREE.PathActions.BEZIER_CURVE_TO:l=h[4];m=h[5];p=h[0];v=h[1];t=h[2];u=h[3];c.length>0?(k=c[c.length-1],o=k.x,z=k.y):(k=this.actions[e-1].args,o=k[k.length-2],z=k[k.length-1]);for(k=1;k<=a;k++)x=k/a,h=THREE.Shape.Utils.b3(x,o,p,t,l),x=THREE.Shape.Utils.b3(x,z,v,u,m),c.push(new THREE.Vector2(h,x));break;case THREE.PathActions.CSPLINE_THRU:k=this.actions[e-1].args;k=[new THREE.Vector2(k[k.length-2],k[k.length-1])];x=a*h[0].length;k=k.concat(h[0]);h=new THREE.SplineCurve(k); -for(k=1;k<=x;k++)c.push(h.getPointAt(k/x));break;case THREE.PathActions.ARC:k=this.actions[e-1].args;l=h[0];m=h[1];t=h[2];p=h[3];x=h[4];v=!!h[5];u=k[k.length-2];o=k[k.length-1];k.length==0&&(u=o=0);z=x-p;var w=a*2;for(k=1;k<=w;k++)x=k/w,v||(x=1-x),x=p+x*z,h=u+l+t*Math.cos(x),x=o+m+t*Math.sin(x),c.push(new THREE.Vector2(h,x))}b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)}; -THREE.Path.prototype.nltransform=function(a,b,c,e,f,h){var k=this.getPoints(),l,m,t,u,p;l=0;for(m=k.length;l0?(k=c[c.length-1],o=k.x,y=k.y):(k=this.actions[e-1].args,o=k[k.length-2],y=k[k.length-1]);for(k=1;k<=a;k++)x=k/a,h=THREE.Shape.Utils.b2(x,o,t,l),x=THREE.Shape.Utils.b2(x,y,v, +n),c.push(new THREE.Vector2(h,x));break;case THREE.PathActions.BEZIER_CURVE_TO:l=h[4];n=h[5];t=h[0];v=h[1];p=h[2];u=h[3];c.length>0?(k=c[c.length-1],o=k.x,y=k.y):(k=this.actions[e-1].args,o=k[k.length-2],y=k[k.length-1]);for(k=1;k<=a;k++)x=k/a,h=THREE.Shape.Utils.b3(x,o,t,p,l),x=THREE.Shape.Utils.b3(x,y,v,u,n),c.push(new THREE.Vector2(h,x));break;case THREE.PathActions.CSPLINE_THRU:k=this.actions[e-1].args;k=[new THREE.Vector2(k[k.length-2],k[k.length-1])];x=a*h[0].length;k=k.concat(h[0]);h=new THREE.SplineCurve(k); +for(k=1;k<=x;k++)c.push(h.getPointAt(k/x));break;case THREE.PathActions.ARC:k=this.actions[e-1].args;l=h[0];n=h[1];p=h[2];t=h[3];x=h[4];v=!!h[5];u=k[k.length-2];o=k[k.length-1];k.length==0&&(u=o=0);y=x-t;var w=a*2;for(k=1;k<=w;k++)x=k/w,v||(x=1-x),x=t+x*y,h=u+l+p*Math.cos(x),x=o+n+p*Math.sin(x),c.push(new THREE.Vector2(h,x))}b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)}; +THREE.Path.prototype.nltransform=function(a,b,c,e,f,h){var k=this.getPoints(),l,n,p,u,t;l=0;for(n=k.length;l=0?l-1:c.length-1;h=k-1>=0?k-1:t.length-1;var x=[t[k],c[l],c[f]];p=THREE.FontUtils.Triangulate.area(x);var w=[t[k],t[h],c[l]];v=THREE.FontUtils.Triangulate.area(w);o=l;u=k;l+=1;k+=-1;l< -0&&(l+=c.length);l%=c.length;k<0&&(k+=t.length);k%=t.length;f=l-1>=0?l-1:c.length-1;h=k-1>=0?k-1:t.length-1;x=[t[k],c[l],c[f]];x=THREE.FontUtils.Triangulate.area(x);w=[t[k],t[h],c[l]];w=THREE.FontUtils.Triangulate.area(w);p+v>x+w&&(l=o,k=u,l<0&&(l+=c.length),l%=c.length,k<0&&(k+=t.length),k%=t.length,f=l-1>=0?l-1:c.length-1,h=k-1>=0?k-1:t.length-1);p=c.slice(0,l);v=c.slice(l);o=t.slice(k);u=t.slice(0,k);h=[t[k],t[h],c[l]];z.push([t[k],c[l],c[f]]);z.push(h);c=p.concat(o).concat(u).concat(v)}return{shape:c, -isolatedPts:z,allpoints:e}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),e=c.allpoints,f=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),h,k,l,m,t={};h=0;for(k=e.length;h=0?l-1:c.length-1;h=k-1>=0?k-1:p.length-1;var x=[p[k],c[l],c[f]];t=THREE.FontUtils.Triangulate.area(x);var w=[p[k],p[h],c[l]];v=THREE.FontUtils.Triangulate.area(w);o=l;u=k;l+=1;k+=-1;l< +0&&(l+=c.length);l%=c.length;k<0&&(k+=p.length);k%=p.length;f=l-1>=0?l-1:c.length-1;h=k-1>=0?k-1:p.length-1;x=[p[k],c[l],c[f]];x=THREE.FontUtils.Triangulate.area(x);w=[p[k],p[h],c[l]];w=THREE.FontUtils.Triangulate.area(w);t+v>x+w&&(l=o,k=u,l<0&&(l+=c.length),l%=c.length,k<0&&(k+=p.length),k%=p.length,f=l-1>=0?l-1:c.length-1,h=k-1>=0?k-1:p.length-1);t=c.slice(0,l);v=c.slice(l);o=p.slice(k);u=p.slice(0,k);h=[p[k],p[h],c[l]];y.push([p[k],c[l],c[f]]);y.push(h);c=t.concat(o).concat(u).concat(v)}return{shape:c, +isolatedPts:y,allpoints:e}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),e=c.allpoints,f=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),h,k,l,n,p={};h=0;for(k=e.length;h1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+o),e=e<0?0:1;if(c==="pos")if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=f[0]+(h[0]-f[0])*e,c.y=f[1]+(h[1]-f[1])*e,c.z=f[2]+(h[2]-f[2])*e;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= +THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,e,f,h,k,l,n,p,u=this.data.JIT.hierarchy,t,v;this.currentTime+=a*this.timeScale;v=this.currentTime;t=this.currentTime%=this.data.length;p=parseInt(Math.min(t*this.data.fps,this.data.length*this.data.fps),10);for(var o=0,y=this.hierarchy.length;o1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+o),e=e<0?0:1;if(c==="pos")if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=f[0]+(h[0]-f[0])*e,c.y=f[1]+(h[1]-f[1])*e,c.z=f[2]+(h[2]-f[2])*e;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= this.getPrevKeyWith("pos",o,k.index-1).pos,this.points[1]=f,this.points[2]=h,this.points[3]=this.getNextKeyWith("pos",o,l.index+1).pos,e=e*0.33+0.33,f=this.interpolateCatmullRom(this.points,e),c.x=f[0],c.y=f[1],c.z=f[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)e=this.interpolateCatmullRom(this.points,e*1.01),this.target.set(e[0],e[1],e[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),e=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,e,0)}else if(c=== -"rot")THREE.Quaternion.slerp(f,h,a.quaternion,e);else if(c==="scl")c=a.scale,c.x=f[0]+(h[0]-f[0])*e,c.y=f[1]+(h[1]-f[1])*e,c.z=f[2]+(h[2]-f[2])*e}}if(this.JITCompile&&u[0][t]===void 0){this.hierarchy[0].update(void 0,!0);for(o=0;oa.length-2?h:h+1;c[3]=h>a.length-3?h:h+2;h=a[c[0]];l=a[c[1]];m=a[c[2]];t=a[c[3]];c=f*f;k=f*c;e[0]=this.interpolate(h[0],l[0],m[0],t[0],f,c,k);e[1]=this.interpolate(h[1],l[1],m[1],t[1],f,c,k);e[2]=this.interpolate(h[2],l[2],m[2],t[2],f,c,k);return e}; +"rot")THREE.Quaternion.slerp(f,h,a.quaternion,e);else if(c==="scl")c=a.scale,c.x=f[0]+(h[0]-f[0])*e,c.y=f[1]+(h[1]-f[1])*e,c.z=f[2]+(h[2]-f[2])*e}}if(this.JITCompile&&u[0][p]===void 0){this.hierarchy[0].update(void 0,!0);for(o=0;oa.length-2?h:h+1;c[3]=h>a.length-3?h:h+2;h=a[c[0]];l=a[c[1]];n=a[c[2]];p=a[c[3]];c=f*f;k=f*c;e[0]=this.interpolate(h[0],l[0],n[0],p[0],f,c,k);e[1]=this.interpolate(h[1],l[1],n[1],p[1],f,c,k);e[2]=this.interpolate(h[2],l[2],n[2],p[2],f,c,k);return e}; THREE.Animation.prototype.interpolate=function(a,b,c,e,f,h,k){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*k+(-3*(b-c)-2*a-e)*h+a*f+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c0?c:0:c>=0?c:c+e.length;c>=0;c--)if(e[c][a]!==void 0)return e[c];return this.data.hierarchy[b].keys[e.length-1]}; THREE.CubeCamera=function(a,b,c,e){this.heightOffset=c;this.position=new THREE.Vector3(0,c,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position= @@ -453,7 +452,7 @@ function(a){switch(a.keyCode){case 38:case 87:this.moveForward=!0;break;case 37: this.moveUp&&this.object.translateY(c);this.moveDown&&this.object.translateY(-c);c=a*this.lookSpeed;this.activeLook||(c=0);this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var a=this.target,b=this.object.position;a.x=b.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=b.y+100*Math.cos(this.phi);a.z=b.z+100*Math.sin(this.phi)*Math.sin(this.theta)}a=1;this.constrainVertical&& (a=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c*a);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);a=this.target;b=this.object.position;a.x=b.x+100*Math.sin(this.phi)*Math.cos(this.theta);a.y=b.y+100*Math.cos(this.phi);a.z=b.z+100*Math.sin(this.phi)*Math.sin(this.theta); this.object.lookAt(a)};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},!1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)}; -THREE.PathControls=function(a,b){function c(a){if((a*=2)<1)return 0.5*a*a;return-0.5*(--a*(a-2)-1)}function e(a,c){return function(){c.apply(a,arguments)}}function f(a,c,b,e){var k={name:b,fps:0.6,length:e,hierarchy:[]},h,f=c.getControlPointsArray(),l=c.getLength(),w=f.length,B=0;h=w-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:f[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[h]={time:e,pos:f[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h=0?a:a+k;b=this.verticalAngleMap.srcRange; @@ -471,199 +470,200 @@ THREE.FlyControls=function(a,b){function c(a,c){return function(){c.apply(a,argu this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z= -this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this, this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(a,b){this.object=a;this.domElement=b!==void 0?b:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var c=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Matrix4,k=!1,l=1,m=0,t=0,u=0,p=0,v=0,o=window.innerWidth/2,z=window.innerHeight/2;this.update=function(a){if(this.mouseLook){var b=a*this.lookSpeed; -this.rotateHorizontally(b*p);this.rotateVertically(b*v)}b=a*this.movementSpeed;this.object.translateZ(-b*(m>0||this.autoForward&&!(m<0)?1:m));this.object.translateX(b*t);this.object.translateY(b*u);k&&(this.roll+=this.rollSpeed*a*l);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y0||this.autoForward&&!(n<0)?1:n));this.object.translateX(b*p);this.object.translateY(b*u);k&&(this.roll+=this.rollSpeed*a*l);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();else if(this.forward.y1?b.normalize():b.z=Math.sqrt(1-e*e);h.copy(this.object.position).subSelf(this.target);e=this.object.up.clone().setLength(b.y);e.addSelf(this.object.up.clone().crossSelf(h).setLength(b.x));e.addSelf(h.setLength(b.z));return e};this.rotateCamera=function(){var a=Math.acos(k.dot(l)/k.length()/l.length());if(a){var c=(new THREE.Vector3).cross(k,l).normalize(),b=new THREE.Quaternion;a*=this.rotateSpeed;b.setFromAxisAngle(c, --a);b.multiplyVector3(h);b.multiplyVector3(this.object.up);b.multiplyVector3(l);this.staticMoving?k=l:(b.setFromAxisAngle(c,a*(this.dynamicDampingFactor-1)),b.multiplyVector3(k))}};this.zoomCamera=function(){var a=1+(t.y-m.y)*this.zoomSpeed;a!==1&&a>0&&(h.multiplyScalar(a),this.staticMoving?m=t:m.y+=(t.y-m.y)*this.dynamicDampingFactor)};this.panCamera=function(){var a=p.clone().subSelf(u);if(a.lengthSq()){a.multiplyScalar(h.length()*this.panSpeed);var c=h.clone().crossSelf(this.object.up).setLength(a.x); -c.addSelf(this.object.up.clone().setLength(a.y));this.object.position.addSelf(c);this.target.addSelf(c);this.staticMoving?u=p:u.addSelf(a.sub(p,u).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),h.lengthSq()0&&(h.multiplyScalar(a),this.staticMoving?n=p:n.y+=(p.y-n.y)*this.dynamicDampingFactor)};this.panCamera=function(){var a=t.clone().subSelf(u);if(a.lengthSq()){a.multiplyScalar(h.length()*this.panSpeed);var c=h.clone().crossSelf(this.object.up).setLength(a.x); +c.addSelf(this.object.up.clone().setLength(a.y));this.object.position.addSelf(c);this.target.addSelf(c);this.staticMoving?u=t:u.addSelf(a.sub(t,u).multiplyScalar(this.dynamicDampingFactor))}};this.checkDistances=function(){if(!this.noZoom||!this.noPan)this.object.position.lengthSq()>this.maxDistance*this.maxDistance&&this.object.position.setLength(this.maxDistance),h.lengthSq()0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,k,0)));for(l=0;l0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-k,0)));for(l=0;l0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,k,0)));for(l=0;l0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-k,0)));for(l=0;la&&(a+=Math.PI*2),anglec=(c+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(l).subSelf(a).clone()}function f(a){for(H=a.length;--H>=0;){la=H;ka=H-1;ka<0&&(ka=a.length- -1);for(var c=0,b=o+u*2,c=0;c=0;J--){V=J/u;X=m*(1-V);V=t*Math.sin(V*Math.PI/2);H=0;for(S=y.length;Ha&&(a+=Math.PI*2),anglec=(c+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(l).subSelf(a).clone()}function f(a){for(H=a.length;--H>=0;){ja=H;ca=H-1;ca<0&&(ca=a.length- +1);for(var c=0,b=o+u*2,c=0;c=0;L--){T=L/u;S=n*(1-T);T=p*Math.sin(T*Math.PI/2);H=0;for(P=z.length;H0||(u=this.vertices.push(new THREE.Vertex(new THREE.Vector3(p,l,v)))-1);t.push(u)}b.push(t)}for(var o,z,x,f=b.length,c=0;c0)for(e=0;e1&&(o= -this.vertices[k].position.clone(),z=this.vertices[m].position.clone(),x=this.vertices[t].position.clone(),o.normalize(),z.normalize(),x.normalize(),this.faces.push(new THREE.Face3(k,m,t,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(x.x,x.y,x.z)])),this.faceVertexUvs[0].push([u,p,w]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry; +THREE.SphereGeometry=function(a,b,c){THREE.Geometry.call(this);for(var a=a||50,e,f=Math.PI,h=Math.max(3,b||8),k=Math.max(2,c||6),b=[],c=0;c0||(u=this.vertices.push(new THREE.Vertex(new THREE.Vector3(t,l,v)))-1);p.push(u)}b.push(p)}for(var o,y,x,f=b.length,c=0;c0)for(e=0;e1&&(o= +this.vertices[k].position.clone(),y=this.vertices[n].position.clone(),x=this.vertices[p].position.clone(),o.normalize(),y.normalize(),x.normalize(),this.faces.push(new THREE.Face3(k,n,p,[new THREE.Vector3(o.x,o.y,o.z),new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(x.x,x.y,x.z)])),this.faceVertexUvs[0].push([u,t,w]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};THREE.SphereGeometry.prototype=new THREE.Geometry; THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry; THREE.TextGeometry=function(a,b){var c=(new THREE.TextPath(a,b)).toShapes();b.amount=b.height!==void 0?b.height:50;if(b.bevelThickness===void 0)b.bevelThickness=10;if(b.bevelSize===void 0)b.bevelSize=8;if(b.bevelEnabled===void 0)b.bevelEnabled=!1;if(b.bend){var e=c[c.length-1].getBoundingBox().maxX;b.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(e/2,120),new THREE.Vector2(e,0))}THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry; THREE.TextGeometry.prototype.constructor=THREE.TextGeometry; THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(a,b){return(new TextPath(a,b)).toShapes()},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){for(var b= -this.getFace(),c=this.size/b.resolution,e=0,f=String(a).split(""),h=f.length,k=[],a=0;a0)for(t=0;t2;){if(p--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return l;return h}m=t;f<=m&&(m=0);t=m+1;f<=t&&(t=0);u=t+1;f<=u&&(u=0);var v;a:{v=a;var o=m,z=t,x=u,w=f,B=k,y=void 0,A=void 0,E=void 0, -C=void 0,L=void 0,F=void 0,G=void 0,N=void 0,R=void 0,A=v[B[o]].x,E=v[B[o]].y,C=v[B[z]].x,L=v[B[z]].y,F=v[B[x]].x,G=v[B[x]].y;if(1.0E-10>(C-A)*(G-E)-(L-E)*(F-A))v=!1;else{for(y=0;y=0&&J>=0&&X>=0){v=!1;break a}}v= -!0}}if(v){h.push([a[k[m]],a[k[t]],a[k[u]]]);l.push([k[m],k[t],k[u]]);m=t;for(u=t+1;u0)for(p=0;p2;){if(t--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return l;return h}n=p;f<=n&&(n=0);p=n+1;f<=p&&(p=0);u=p+1;f<=u&&(u=0);var v;a:{v=a;var o=n,y=p,x=u,w=f,A=k,z=void 0,C=void 0,B=void 0, +K=void 0,F=void 0,M=void 0,E=void 0,O=void 0,V=void 0,C=v[A[o]].x,B=v[A[o]].y,K=v[A[y]].x,F=v[A[y]].y,M=v[A[x]].x,E=v[A[x]].y;if(1.0E-10>(K-C)*(E-B)-(F-B)*(M-C))v=!1;else{for(z=0;z=0&&L>=0&&S>=0){v=!1; +break a}}v=!0}}if(v){h.push([a[k[n]],a[k[p]],a[k[u]]]);l.push([k[n],k[p],k[u]]);n=p;for(u=p+1;u0;)this.smooth(a)}; -THREE.SubdivisionModifier.prototype.smooth=function(a){function b(a,c,b,e,l,m){var o=new THREE.Face4(a,c,b,e,null,l.color,l.material);if(k.useOldVertexColors){o.vertexColors=[];for(var t,n,u,v=0;v<4;v++){u=m[v];t=new THREE.Color;t.setRGB(0,0,0);for(var w=0;w>7)-127;e|=(h&127)<<16|f<<8;if(e==0&&l==-127)return 0;return(1-2*(k>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,l)}function f(a,c){var b=u(a,c),e=u(a,c+1),h=u(a,c+2);return(u(a,c+3)<<24)+(h<<16)+(e<<8)+b}function m(a,c){var b=u(a,c);return(u(a,c+1)<<8)+b}function t(a,c){var b=u(a,c);return b>127?b-256:b}function u(a,c){return a.charCodeAt(c)&255}function p(c){var b, -e,h;b=f(a,c);e=f(a,c+L);h=f(a,c+F);c=m(a,c+G);B.faces.push(new THREE.Face3(b,e,h,null,null,c))}function v(c){var b,e,h,k,n,o,p;b=f(a,c);e=f(a,c+L);h=f(a,c+F);k=m(a,c+G);n=f(a,c+N);o=f(a,c+R);p=f(a,c+H);var c=E[o*3],t=E[o*3+1];o=E[o*3+2];var u=E[p*3],v=E[p*3+1];p=E[p*3+2];B.faces.push(new THREE.Face3(b,e,h,[new THREE.Vector3(E[n*3],E[n*3+1],E[n*3+2]),new THREE.Vector3(c,t,o),new THREE.Vector3(u,v,p)],null,k))}function o(c){var b,e,h,k;b=f(a,c);e=f(a,c+S);h=f(a,c+J);k=f(a,c+V);c=m(a,c+X);B.faces.push(new THREE.Face4(b, -e,h,k,null,null,c))}function z(c){var b,e,h,k,o,p,t,u,v;b=f(a,c);e=f(a,c+S);h=f(a,c+J);k=f(a,c+V);o=m(a,c+X);p=f(a,c+O);t=f(a,c+n);u=f(a,c+U);v=f(a,c+$);var c=E[t*3],w=E[t*3+1];t=E[t*3+2];var M=E[u*3],x=E[u*3+1];u=E[u*3+2];var ia=E[v*3],y=E[v*3+1];v=E[v*3+2];B.faces.push(new THREE.Face4(b,e,h,k,[new THREE.Vector3(E[p*3],E[p*3+1],E[p*3+2]),new THREE.Vector3(c,w,t),new THREE.Vector3(M,x,u),new THREE.Vector3(ia,y,v)],null,o))}function x(c){var b,e,h,k;b=f(a,c);e=f(a,c+aa);h=f(a,c+ca);c=C[b*2];k=C[b* -2+1];b=C[e*2];var m=B.faceVertexUvs[0];e=C[e*2+1];var n=C[h*2];h=C[h*2+1];var o=[];o.push(new THREE.UV(c,k));o.push(new THREE.UV(b,e));o.push(new THREE.UV(n,h));m.push(o)}function w(c){var b,e,h,k,m,n;b=f(a,c);e=f(a,c+ea);h=f(a,c+la);k=f(a,c+ka);c=C[b*2];m=C[b*2+1];b=C[e*2];n=C[e*2+1];e=C[h*2];var o=B.faceVertexUvs[0];h=C[h*2+1];var p=C[k*2];k=C[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(b,n));t.push(new THREE.UV(e,h));t.push(new THREE.UV(p,k));o.push(t)}var B=this,y=0,A,E=[],C= -[],L,F,G,N,R,H,S,J,V,X,O,n,U,$,aa,ca,ea,la,ka,Z,Q,T,fa,ga,qa;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(B,e,c);A={signature:a.substr(y,8),header_bytes:u(a,y+8),vertex_coordinate_bytes:u(a,y+9),normal_coordinate_bytes:u(a,y+10),uv_coordinate_bytes:u(a,y+11),vertex_index_bytes:u(a,y+12),normal_index_bytes:u(a,y+13),uv_index_bytes:u(a,y+14),material_index_bytes:u(a,y+15),nvertices:f(a,y+16),nnormals:f(a,y+16+4),nuvs:f(a,y+16+8),ntri_flat:f(a,y+16+12),ntri_smooth:f(a,y+16+16),ntri_flat_uv:f(a, -y+16+20),ntri_smooth_uv:f(a,y+16+24),nquad_flat:f(a,y+16+28),nquad_smooth:f(a,y+16+32),nquad_flat_uv:f(a,y+16+36),nquad_smooth_uv:f(a,y+16+40)};y+=A.header_bytes;L=A.vertex_index_bytes;F=A.vertex_index_bytes*2;G=A.vertex_index_bytes*3;N=A.vertex_index_bytes*3+A.material_index_bytes;R=A.vertex_index_bytes*3+A.material_index_bytes+A.normal_index_bytes;H=A.vertex_index_bytes*3+A.material_index_bytes+A.normal_index_bytes*2;S=A.vertex_index_bytes;J=A.vertex_index_bytes*2;V=A.vertex_index_bytes*3;X=A.vertex_index_bytes* -4;O=A.vertex_index_bytes*4+A.material_index_bytes;n=A.vertex_index_bytes*4+A.material_index_bytes+A.normal_index_bytes;U=A.vertex_index_bytes*4+A.material_index_bytes+A.normal_index_bytes*2;$=A.vertex_index_bytes*4+A.material_index_bytes+A.normal_index_bytes*3;aa=A.uv_index_bytes;ca=A.uv_index_bytes*2;ea=A.uv_index_bytes;la=A.uv_index_bytes*2;ka=A.uv_index_bytes*3;c=A.vertex_index_bytes*3+A.material_index_bytes;qa=A.vertex_index_bytes*4+A.material_index_bytes;Z=A.ntri_flat*c;Q=A.ntri_smooth*(c+A.normal_index_bytes* -3);T=A.ntri_flat_uv*(c+A.uv_index_bytes*3);fa=A.ntri_smooth_uv*(c+A.normal_index_bytes*3+A.uv_index_bytes*3);ga=A.nquad_flat*qa;c=A.nquad_smooth*(qa+A.normal_index_bytes*4);qa=A.nquad_flat_uv*(qa+A.uv_index_bytes*4);y+=function(c){for(var e,h,f,l=A.vertex_coordinate_bytes*3,m=c+A.nvertices*l;c>7)-127;e|=(h&127)<<16|f<<8;if(e==0&&l==-127)return 0;return(1-2*(k>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,l)}function f(a,c){var b=u(a,c),e=u(a,c+1),h=u(a,c+2);return(u(a,c+3)<<24)+(h<<16)+(e<<8)+b}function n(a,c){var b=u(a,c);return(u(a,c+1)<<8)+b}function p(a,c){var b=u(a,c);return b>127?b-256:b}function u(a,c){return a.charCodeAt(c)&255}function t(c){var b, +e,h;b=f(a,c);e=f(a,c+F);h=f(a,c+M);c=n(a,c+E);A.faces.push(new THREE.Face3(b,e,h,null,null,c))}function v(c){var b,e,h,k,m,o,p;b=f(a,c);e=f(a,c+F);h=f(a,c+M);k=n(a,c+E);m=f(a,c+O);o=f(a,c+V);p=f(a,c+H);var c=B[o*3],t=B[o*3+1];o=B[o*3+2];var u=B[p*3],v=B[p*3+1];p=B[p*3+2];A.faces.push(new THREE.Face3(b,e,h,[new THREE.Vector3(B[m*3],B[m*3+1],B[m*3+2]),new THREE.Vector3(c,t,o),new THREE.Vector3(u,v,p)],null,k))}function o(c){var b,e,h,k;b=f(a,c);e=f(a,c+P);h=f(a,c+L);k=f(a,c+T);c=n(a,c+S);A.faces.push(new THREE.Face4(b, +e,h,k,null,null,c))}function y(c){var b,e,h,k,o,p,t,u,v;b=f(a,c);e=f(a,c+P);h=f(a,c+L);k=f(a,c+T);o=n(a,c+S);p=f(a,c+m);t=f(a,c+aa);u=f(a,c+U);v=f(a,c+ea);var c=B[t*3],w=B[t*3+1];t=B[t*3+2];var G=B[u*3],x=B[u*3+1];u=B[u*3+2];var ma=B[v*3],I=B[v*3+1];v=B[v*3+2];A.faces.push(new THREE.Face4(b,e,h,k,[new THREE.Vector3(B[p*3],B[p*3+1],B[p*3+2]),new THREE.Vector3(c,w,t),new THREE.Vector3(G,x,u),new THREE.Vector3(ma,I,v)],null,o))}function x(c){var b,e,h,k;b=f(a,c);e=f(a,c+da);h=f(a,c+ia);c=K[b*2];k=K[b* +2+1];b=K[e*2];var m=A.faceVertexUvs[0];e=K[e*2+1];var n=K[h*2];h=K[h*2+1];var o=[];o.push(new THREE.UV(c,k));o.push(new THREE.UV(b,e));o.push(new THREE.UV(n,h));m.push(o)}function w(c){var b,e,h,k,m,n;b=f(a,c);e=f(a,c+ha);h=f(a,c+ja);k=f(a,c+ca);c=K[b*2];m=K[b*2+1];b=K[e*2];n=K[e*2+1];e=K[h*2];var o=A.faceVertexUvs[0];h=K[h*2+1];var p=K[k*2];k=K[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(b,n));t.push(new THREE.UV(e,h));t.push(new THREE.UV(p,k));o.push(t)}var A=this,z=0,C,B=[],K= +[],F,M,E,O,V,H,P,L,T,S,m,aa,U,ea,da,ia,ha,ja,ca,Z,R,Y,X,ga,oa;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(A,e,c);C={signature:a.substr(z,8),header_bytes:u(a,z+8),vertex_coordinate_bytes:u(a,z+9),normal_coordinate_bytes:u(a,z+10),uv_coordinate_bytes:u(a,z+11),vertex_index_bytes:u(a,z+12),normal_index_bytes:u(a,z+13),uv_index_bytes:u(a,z+14),material_index_bytes:u(a,z+15),nvertices:f(a,z+16),nnormals:f(a,z+16+4),nuvs:f(a,z+16+8),ntri_flat:f(a,z+16+12),ntri_smooth:f(a,z+16+16),ntri_flat_uv:f(a, +z+16+20),ntri_smooth_uv:f(a,z+16+24),nquad_flat:f(a,z+16+28),nquad_smooth:f(a,z+16+32),nquad_flat_uv:f(a,z+16+36),nquad_smooth_uv:f(a,z+16+40)};z+=C.header_bytes;F=C.vertex_index_bytes;M=C.vertex_index_bytes*2;E=C.vertex_index_bytes*3;O=C.vertex_index_bytes*3+C.material_index_bytes;V=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;H=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;P=C.vertex_index_bytes;L=C.vertex_index_bytes*2;T=C.vertex_index_bytes*3;S=C.vertex_index_bytes* +4;m=C.vertex_index_bytes*4+C.material_index_bytes;aa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;U=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;ea=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;da=C.uv_index_bytes;ia=C.uv_index_bytes*2;ha=C.uv_index_bytes;ja=C.uv_index_bytes*2;ca=C.uv_index_bytes*3;c=C.vertex_index_bytes*3+C.material_index_bytes;oa=C.vertex_index_bytes*4+C.material_index_bytes;Z=C.ntri_flat*c;R=C.ntri_smooth*(c+ +C.normal_index_bytes*3);Y=C.ntri_flat_uv*(c+C.uv_index_bytes*3);X=C.ntri_smooth_uv*(c+C.normal_index_bytes*3+C.uv_index_bytes*3);ga=C.nquad_flat*oa;c=C.nquad_smooth*(oa+C.normal_index_bytes*4);oa=C.nquad_flat_uv*(oa+C.uv_index_bytes*4);z+=function(c){for(var e,h,f,l=C.vertex_coordinate_bytes*3,m=c+C.nvertices*l;c=0){w=m.invBindMatrices[t];n.invBindMatrix=w;n.skinningMatrix=new THREE.Matrix4;n.skinningMatrix.multiply(n.world,w);n.weights=[];for(w=0;w1){m=new THREE.MeshFaceMaterial;for(j=0;j1?b[1].substr(0,c):"0";b[1].length1){m=new THREE.MeshFaceMaterial;for(j=0;j1?b[1].substr(0,c):"0";b[1].length=0,k=h.indexOf("(")>=0,l;if(f)e=h.split("."),h=e.shift(),e.shift();else if(k){l=h.split("(");h=l.shift(); -for(e=0;ec){t=n.output[m];break}k=t!==void 0?t instanceof THREE.Matrix4?k.multiply(k,t):k.multiply(k,l.matrix):k.multiply(k,l.matrix)}else k=k.multiply(k,l.matrix);c=k;b.push({time:a,pos:[c.n14, -c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=b}this.updateMatrix();return this};p.prototype.updateMatrix=function(){this.matrix.identity();for(var a=0;a0&&(this[b.nodeName]=parseFloat(e[0].textContent))}}this.create();return this};R.prototype.create=function(){var a= -{},c=this.transparency!==void 0&&this.transparency<1,b;for(b in this)switch(b){case "ambient":case "emission":case "diffuse":case "specular":var e=this[b];if(e instanceof N)if(e.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(e=oa[this.effect.surface.init_from]))a.map=THREE.ImageUtils.loadTexture(Fa+e.init_from),a.map.wrapS=THREE.RepeatWrapping,a.map.wrapT=THREE.RepeatWrapping,a.map.repeat.x=1,a.map.repeat.y=-1}else b=="diffuse"?a.color= -e.color.getHex():c||(a[b]=e.color.getHex());break;case "shininess":case "reflectivity":a[b]=this[b];break;case "transparency":if(c)a.transparent=!0,a.opacity=this[b],c=!0}a.shading=Da;return this.material=new THREE.MeshLambertMaterial(a)};H.prototype.parse=function(a){for(var c=0;c=0,e=a.indexOf("(")>=0,h,f;if(b)c=a.split("."),a=c.shift(),f=c.shift();else if(e){h=a.split("(");a=h.shift();for(c=0;c=0,k=h.indexOf("(")>=0,l;if(f)e=h.split("."),h=e.shift(),e.shift();else if(k){l=h.split("(");h=l.shift(); +for(e=0;ec){p=n.output[m];break}k=p!==void 0?p instanceof THREE.Matrix4? +k.multiply(k,p):k.multiply(k,l.matrix):k.multiply(k,l.matrix)}else k=k.multiply(k,l.matrix);c=k;b.push({time:a,pos:[c.n14,c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=b}this.updateMatrix();return this};t.prototype.updateMatrix=function(){this.matrix.identity();for(var a=0;a0&&(this[b.nodeName]=parseFloat(e[0].textContent))}}this.create();return this};V.prototype.create=function(){var a={},c=this.transparency!==void 0&&this.transparency<1,b;for(b in this)switch(b){case "ambient":case "emission":case "diffuse":case "specular":var e=this[b];if(e instanceof O)if(e.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(e=na[this.effect.surface.init_from]))a.map=THREE.ImageUtils.loadTexture(Ea+e.init_from), +a.map.wrapS=THREE.RepeatWrapping,a.map.wrapT=THREE.RepeatWrapping,a.map.repeat.x=1,a.map.repeat.y=-1}else b=="diffuse"?a.color=e.color.getHex():c||(a[b]=e.color.getHex());break;case "shininess":case "reflectivity":a[b]=this[b];break;case "transparency":if(c)a.transparent=!0,a.opacity=this[b],c=!0}a.shading=xa;return this.material=new THREE.MeshLambertMaterial(a)};H.prototype.parse=function(a){for(var c=0;c=0,e=a.indexOf("(")>=0,h,f;if(b)c=a.split("."),a=c.shift(),f=c.shift();else if(e){h=a.split("(");a=h.shift();for(c=0;c1&&(R=new THREE.MeshFaceMaterial);object=new THREE.Mesh(L,R);object.name=o;object.position.set(A[0],A[1],A[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=y.visible;U.scene.add(object);U.objects[o]=object;y.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),U.scene.collisions.colliders.push(a));if(y.castsShadow)a= -new THREE.ShadowVolume(L),U.scene.add(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;y.trigger&&y.trigger.toLowerCase()!="none"&&(a={type:y.trigger,object:y},U.triggers[object.name]=a)}}else A=y.position,r=y.rotation,q=y.quaternion,s=y.scale,q=0,object=new THREE.Object3D,object.name=o,object.position.set(A[0],A[1],A[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],s[1],s[2]),object.visible= -y.visible!==void 0?y.visible:!1,U.scene.add(object),U.objects[o]=object,U.empties[o]=object,y.trigger&&y.trigger.toLowerCase()!="none"&&(a={type:y.trigger,object:y},U.triggers[object.name]=a)}function m(a){return function(b){U.geometries[a]=b;l();V-=1;c.onLoadComplete();u()}}function t(a){return function(c){U.geometries[a]=c}}function u(){c.callbackProgress({totalModels:O,totalTextures:n,loadedModels:O-V,loadedTextures:n-X},U);c.onLoadProgress();V==0&&X==0&&b(U)}var p,v,o,z,x,w,B,y,A,E,C,L,F,G,N, -R,H,S,J,V,X,O,n,U;S=a.data;N=new THREE.BinaryLoader;J=new THREE.JSONLoader;X=V=0;U={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(o in S.objects)if(y=S.objects[o],y.meshCollider){a=!0;break}if(a)U.scene.collisions=new THREE.CollisionSystem;if(S.transform){a=S.transform.position;E=S.transform.rotation;var $=S.transform.scale;a&&U.scene.position.set(a[0],a[1],a[2]);E&&U.scene.rotation.set(E[0],E[1],E[2]);$&&U.scene.scale.set($[0], -$[1],$[2]);(a||E||$)&&U.scene.updateMatrix()}a=function(){X-=1;u();c.onLoadComplete()};for(x in S.cameras)E=S.cameras[x],E.type=="perspective"?F=new THREE.PerspectiveCamera(E.fov,E.aspect,E.near,E.far):E.type=="ortho"&&(F=new THREE.OrthographicCamera(E.left,E.right,E.top,E.bottom,E.near,E.far)),A=E.position,E=E.target,F.position.set(A[0],A[1],A[2]),F.target=new THREE.Vector3(E[0],E[1],E[2]),U.cameras[x]=F;for(z in S.lights)x=S.lights[z],F=x.color!==void 0?x.color:16777215,E=x.intensity!==void 0?x.intensity: -1,x.type=="directional"?(A=x.direction,H=new THREE.DirectionalLight(F,E),H.position.set(A[0],A[1],A[2]),H.position.normalize()):x.type=="point"?(A=x.position,d=x.distance,H=new THREE.PointLight(F,E,d),H.position.set(A[0],A[1],A[2])):x.type=="ambient"&&(H=new THREE.AmbientLight(F)),U.scene.add(H),U.lights[z]=H;for(w in S.fogs)z=S.fogs[w],z.type=="linear"?G=new THREE.Fog(0,z.near,z.far):z.type=="exp2"&&(G=new THREE.FogExp2(0,z.density)),E=z.color,G.color.setRGB(E[0],E[1],E[2]),U.fogs[w]=G;if(U.cameras&& -S.defaults.camera)U.currentCamera=U.cameras[S.defaults.camera];if(U.fogs&&S.defaults.fog)U.scene.fog=U.fogs[S.defaults.fog];E=S.defaults.bgcolor;U.bgColor=new THREE.Color;U.bgColor.setRGB(E[0],E[1],E[2]);U.bgColorAlpha=S.defaults.bgalpha;for(p in S.geometries)if(w=S.geometries[p],w.type=="bin_mesh"||w.type=="ascii_mesh")V+=1,c.onLoadStart();O=V;for(p in S.geometries)w=S.geometries[p],w.type=="cube"?(L=new THREE.CubeGeometry(w.width,w.height,w.depth,w.segmentsWidth,w.segmentsHeight,w.segmentsDepth, -null,w.flipped,w.sides),U.geometries[p]=L):w.type=="plane"?(L=new THREE.PlaneGeometry(w.width,w.height,w.segmentsWidth,w.segmentsHeight),U.geometries[p]=L):w.type=="sphere"?(L=new THREE.SphereGeometry(w.radius,w.segmentsWidth,w.segmentsHeight),U.geometries[p]=L):w.type=="cylinder"?(L=new THREE.CylinderGeometry(w.topRad,w.botRad,w.height,w.radSegs,w.heightSegs),U.geometries[p]=L):w.type=="torus"?(L=new THREE.TorusGeometry(w.radius,w.tube,w.segmentsR,w.segmentsT),U.geometries[p]=L):w.type=="icosahedron"? -(L=new THREE.IcosahedronGeometry(w.subdivisions),U.geometries[p]=L):w.type=="bin_mesh"?N.load(e(w.url,S.urlBaseType),m(p)):w.type=="ascii_mesh"?J.load(e(w.url,S.urlBaseType),m(p)):w.type=="embedded_mesh"&&(w=S.embeds[w.id])&&J.createModel(w,t(p),"");for(B in S.textures)if(p=S.textures[B],p.url instanceof Array){X+=p.url.length;for(N=0;N1&&(V=new THREE.MeshFaceMaterial);object=new THREE.Mesh(F,V);object.name=o;object.position.set(C[0],C[1],C[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=z.visible;U.scene.add(object);U.objects[o]=object;z.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),U.scene.collisions.colliders.push(a));if(z.castsShadow)a= +new THREE.ShadowVolume(F),U.scene.add(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;z.trigger&&z.trigger.toLowerCase()!="none"&&(a={type:z.trigger,object:z},U.triggers[object.name]=a)}}else C=z.position,r=z.rotation,q=z.quaternion,s=z.scale,q=0,object=new THREE.Object3D,object.name=o,object.position.set(C[0],C[1],C[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],s[1],s[2]),object.visible= +z.visible!==void 0?z.visible:!1,U.scene.add(object),U.objects[o]=object,U.empties[o]=object,z.trigger&&z.trigger.toLowerCase()!="none"&&(a={type:z.trigger,object:z},U.triggers[object.name]=a)}function n(a){return function(b){U.geometries[a]=b;l();T-=1;c.onLoadComplete();u()}}function p(a){return function(c){U.geometries[a]=c}}function u(){c.callbackProgress({totalModels:m,totalTextures:aa,loadedModels:m-T,loadedTextures:aa-S},U);c.onLoadProgress();T==0&&S==0&&b(U)}var t,v,o,y,x,w,A,z,C,B,K,F,M,E, +O,V,H,P,L,T,S,m,aa,U;P=a.data;O=new THREE.BinaryLoader;L=new THREE.JSONLoader;S=T=0;U={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(o in P.objects)if(z=P.objects[o],z.meshCollider){a=!0;break}if(a)U.scene.collisions=new THREE.CollisionSystem;if(P.transform){a=P.transform.position;B=P.transform.rotation;var ea=P.transform.scale;a&&U.scene.position.set(a[0],a[1],a[2]);B&&U.scene.rotation.set(B[0],B[1],B[2]);ea&& +U.scene.scale.set(ea[0],ea[1],ea[2]);(a||B||ea)&&U.scene.updateMatrix()}a=function(){S-=1;u();c.onLoadComplete()};for(x in P.cameras)B=P.cameras[x],B.type=="perspective"?M=new THREE.PerspectiveCamera(B.fov,B.aspect,B.near,B.far):B.type=="ortho"&&(M=new THREE.OrthographicCamera(B.left,B.right,B.top,B.bottom,B.near,B.far)),C=B.position,B=B.target,M.position.set(C[0],C[1],C[2]),M.target=new THREE.Vector3(B[0],B[1],B[2]),U.cameras[x]=M;for(y in P.lights)x=P.lights[y],M=x.color!==void 0?x.color:16777215, +B=x.intensity!==void 0?x.intensity:1,x.type=="directional"?(C=x.direction,H=new THREE.DirectionalLight(M,B),H.position.set(C[0],C[1],C[2]),H.position.normalize()):x.type=="point"?(C=x.position,d=x.distance,H=new THREE.PointLight(M,B,d),H.position.set(C[0],C[1],C[2])):x.type=="ambient"&&(H=new THREE.AmbientLight(M)),U.scene.add(H),U.lights[y]=H;for(w in P.fogs)y=P.fogs[w],y.type=="linear"?E=new THREE.Fog(0,y.near,y.far):y.type=="exp2"&&(E=new THREE.FogExp2(0,y.density)),B=y.color,E.color.setRGB(B[0], +B[1],B[2]),U.fogs[w]=E;if(U.cameras&&P.defaults.camera)U.currentCamera=U.cameras[P.defaults.camera];if(U.fogs&&P.defaults.fog)U.scene.fog=U.fogs[P.defaults.fog];B=P.defaults.bgcolor;U.bgColor=new THREE.Color;U.bgColor.setRGB(B[0],B[1],B[2]);U.bgColorAlpha=P.defaults.bgalpha;for(t in P.geometries)if(w=P.geometries[t],w.type=="bin_mesh"||w.type=="ascii_mesh")T+=1,c.onLoadStart();m=T;for(t in P.geometries)w=P.geometries[t],w.type=="cube"?(F=new THREE.CubeGeometry(w.width,w.height,w.depth,w.segmentsWidth, +w.segmentsHeight,w.segmentsDepth,null,w.flipped,w.sides),U.geometries[t]=F):w.type=="plane"?(F=new THREE.PlaneGeometry(w.width,w.height,w.segmentsWidth,w.segmentsHeight),U.geometries[t]=F):w.type=="sphere"?(F=new THREE.SphereGeometry(w.radius,w.segmentsWidth,w.segmentsHeight),U.geometries[t]=F):w.type=="cylinder"?(F=new THREE.CylinderGeometry(w.topRad,w.botRad,w.height,w.radSegs,w.heightSegs),U.geometries[t]=F):w.type=="torus"?(F=new THREE.TorusGeometry(w.radius,w.tube,w.segmentsR,w.segmentsT),U.geometries[t]= +F):w.type=="icosahedron"?(F=new THREE.IcosahedronGeometry(w.subdivisions),U.geometries[t]=F):w.type=="bin_mesh"?O.load(e(w.url,P.urlBaseType),n(t)):w.type=="ascii_mesh"?L.load(e(w.url,P.urlBaseType),n(t)):w.type=="embedded_mesh"&&(w=P.embeds[w.id])&&L.createModel(w,p(t),"");for(A in P.textures)if(t=P.textures[A],t.url instanceof Array){S+=t.url.length;for(O=0;O=57344&&(b-=2048);b++;for(var c=new Float32Array(8*b),e=1,f=0;f<8;f++){for(var h=0,k=0;k>1^-(l&1);c[8*k+f]=h}e+=b}b=a.length-e;h=new Uint16Array(b);for(f=k=0;f=this.maxCount-3&&l(this)};this.begin=function(){this.count=0; -this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var b=this.count*3;bthis.size-1&&(m=this.size-1);var v=Math.floor(t-l);v<1&&(v=1);t=Math.floor(t+l);t>this.size-1&&(t=this.size-1);var o=Math.floor(u-l);o<1&&(o=1);l=Math.floor(u+l);l>this.size-1&&(l=this.size- -1);for(var z,x,w,B,y,A;p0&&(this.field[w+z]+=B)}}};this.addPlaneX=function(a,b){var f,h,k,l,m,t=this.size,u=this.yd,p=this.zd,v=this.field,o=t*Math.sqrt(a/b);o>t&&(o=t);for(f=0;f0)for(h=0;hu&&(z=u);for(h=0;h0){m=h*p;for(f=0;fsize&&(dist=size);for(k=0;k0){m=zd*k;for(h=0;h=this.maxCount-3&&l(this)};this.begin=function(){this.count=0; +this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var b=this.count*3;bthis.size-1&&(n=this.size-1);var v=Math.floor(p-l);v<1&&(v=1);p=Math.floor(p+l);p>this.size-1&&(p=this.size-1);var o=Math.floor(u-l);o<1&&(o=1);l=Math.floor(u+l);l>this.size-1&&(l=this.size- +1);for(var y,x,w,A,z,C;t0&&(this.field[w+y]+=A)}}};this.addPlaneX=function(a,b){var f,h,k,l,n,p=this.size,u=this.yd,t=this.zd,v=this.field,o=p*Math.sqrt(a/b);o>p&&(o=p);for(f=0;f0)for(h=0;hu&&(y=u);for(h=0;h0){n=h*t;for(f=0;fsize&&(dist=size);for(k=0;k0){n=zd*k;for(h=0;hh?this.hits.push(f):this.hits.unshift(f),h=e;return this.hits}; THREE.CollisionSystem.prototype.rayCastNearest=function(a){var b=this.rayCastAll(a);if(b.length==0)return null;for(var c=0;b[c]instanceof THREE.MeshCollider;){var e=this.rayMesh(a,b[c]);if(e.distb.length)return null;return b[c]}; THREE.CollisionSystem.prototype.rayCast=function(a,b){if(b instanceof THREE.PlaneCollider)return this.rayPlane(a,b);else if(b instanceof THREE.SphereCollider)return this.raySphere(a,b);else if(b instanceof THREE.BoxCollider)return this.rayBox(a,b);else if(b instanceof THREE.MeshCollider&&b.box)return this.rayBox(a,b.box)}; -THREE.CollisionSystem.prototype.rayMesh=function(a,b){for(var c=this.makeRayLocal(a,b.mesh),e=Number.MAX_VALUE,f,h=0;h=l*f))return Number.MAX_VALUE;k/=l;l=THREE.CollisionSystem.__v3;l.copy(a.direction);l.multiplyScalar(k);l.addSelf(a.origin);Math.abs(h.x)> +THREE.CollisionSystem.prototype.rayMesh=function(a,b){for(var c=this.makeRayLocal(a,b.mesh),e=Number.MAX_VALUE,f,h=0;h=l*f))return Number.MAX_VALUE;k/=l;l=THREE.CollisionSystem.__v3;l.copy(a.direction);l.multiplyScalar(k);l.addSelf(a.origin);Math.abs(h.x)> Math.abs(h.y)?Math.abs(h.x)>Math.abs(h.z)?(a=l.y-b.y,h=c.y-b.y,f=e.y-b.y,l=l.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=l.x-b.x,h=c.x-b.x,f=e.x-b.x,l=l.y-b.y,c=c.y-b.y,e=e.y-b.y):Math.abs(h.y)>Math.abs(h.z)?(a=l.x-b.x,h=c.x-b.x,f=e.x-b.x,l=l.z-b.z,c=c.z-b.z,e=e.z-b.z):(a=l.x-b.x,h=c.x-b.x,f=e.x-b.x,l=l.y-b.y,c=c.y-b.y,e=e.y-b.y);b=h*e-c*f;if(b==0)return Number.MAX_VALUE;b=1/b;e=(a*e-l*f)*b;if(!(e>=0))return Number.MAX_VALUE;b*=h*l-c*a;if(!(b>=0))return Number.MAX_VALUE;if(!(1-e-b>=0))return Number.MAX_VALUE;return k}; THREE.CollisionSystem.prototype.makeRayLocal=function(a,b){var c=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(b.matrixWorld,c);var e=THREE.CollisionSystem.__r;e.origin.copy(a.origin);e.direction.copy(a.direction);c.multiplyVector3(e.origin);c.rotateAxis(e.direction);e.direction.normalize();return e}; -THREE.CollisionSystem.prototype.rayBox=function(a,b){var c;b.dynamic&&b.mesh&&b.mesh.matrixWorld?c=this.makeRayLocal(a,b.mesh):(c=THREE.CollisionSystem.__r,c.origin.copy(a.origin),c.direction.copy(a.direction));var e=0,f=0,h=0,k=0,l=0,m=0,t=!0;c.origin.xb.max.x&&(e=b.max.x-c.origin.x,e/=c.direction.x,t=!1,k=1);c.origin.yb.max.y&&(f=b.max.y-c.origin.y,f/=c.direction.y, -t=!1,l=1);c.origin.zb.max.z&&(h=b.max.z-c.origin.z,h/=c.direction.z,t=!1,m=1);if(t)return-1;t=0;f>e&&(t=1,e=f);h>e&&(t=2,e=h);switch(t){case 0:l=c.origin.y+c.direction.y*e;if(lb.max.y)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*e;if(cb.max.z)return Number.MAX_VALUE;b.normal.set(k,0,0);break;case 1:k=c.origin.x+c.direction.x*e;if(kb.max.x)return Number.MAX_VALUE;c=c.origin.z+c.direction.z* -e;if(cb.max.z)return Number.MAX_VALUE;b.normal.set(0,l,0);break;case 2:k=c.origin.x+c.direction.x*e;if(kb.max.x)return Number.MAX_VALUE;l=c.origin.y+c.direction.y*e;if(lb.max.y)return Number.MAX_VALUE;b.normal.set(0,0,m)}return e};THREE.CollisionSystem.prototype.rayPlane=function(a,b){var c=a.direction.dot(b.normal),e=b.point.dot(b.normal);if(c<0)c=(e-a.origin.dot(b.normal))/c;else return Number.MAX_VALUE;return c>0?c:Number.MAX_VALUE}; +THREE.CollisionSystem.prototype.rayBox=function(a,b){var c;b.dynamic&&b.mesh&&b.mesh.matrixWorld?c=this.makeRayLocal(a,b.mesh):(c=THREE.CollisionSystem.__r,c.origin.copy(a.origin),c.direction.copy(a.direction));var e=0,f=0,h=0,k=0,l=0,n=0,p=!0;c.origin.xb.max.x&&(e=b.max.x-c.origin.x,e/=c.direction.x,p=!1,k=1);c.origin.yb.max.y&&(f=b.max.y-c.origin.y,f/=c.direction.y, +p=!1,l=1);c.origin.zb.max.z&&(h=b.max.z-c.origin.z,h/=c.direction.z,p=!1,n=1);if(p)return-1;p=0;f>e&&(p=1,e=f);h>e&&(p=2,e=h);switch(p){case 0:l=c.origin.y+c.direction.y*e;if(lb.max.y)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*e;if(cb.max.z)return Number.MAX_VALUE;b.normal.set(k,0,0);break;case 1:k=c.origin.x+c.direction.x*e;if(kb.max.x)return Number.MAX_VALUE;c=c.origin.z+c.direction.z* +e;if(cb.max.z)return Number.MAX_VALUE;b.normal.set(0,l,0);break;case 2:k=c.origin.x+c.direction.x*e;if(kb.max.x)return Number.MAX_VALUE;l=c.origin.y+c.direction.y*e;if(lb.max.y)return Number.MAX_VALUE;b.normal.set(0,0,n)}return e};THREE.CollisionSystem.prototype.rayPlane=function(a,b){var c=a.direction.dot(b.normal),e=b.point.dot(b.normal);if(c<0)c=(e-a.origin.dot(b.normal))/c;else return Number.MAX_VALUE;return c>0?c:Number.MAX_VALUE}; THREE.CollisionSystem.prototype.raySphere=function(a,b){var c=b.center.clone().subSelf(a.origin);if(c.lengthSq=0)return Math.abs(e)-Math.sqrt(c);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4; THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(a){a.geometry.computeBoundingBox();var b=a.geometry.boundingBox,c=new THREE.Vector3(b.x[0],b.y[0],b.z[0]),b=new THREE.Vector3(b.x[1],b.y[1],b.z[1]),c=new THREE.BoxCollider(c,b);c.mesh=a;return c};THREE.CollisionUtils.MeshAABB=function(a){var b=THREE.CollisionUtils.MeshOBB(a);b.min.addSelf(a.position);b.max.addSelf(a.position);b.dynamic=!1;return b}; THREE.CollisionUtils.MeshColliderWBox=function(a){return new THREE.MeshCollider(a,THREE.CollisionUtils.MeshOBB(a))}; -if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,e=this.render,f=new THREE.PerspectiveCamera,h=new THREE.PerspectiveCamera,k=new THREE.Matrix4,l=new THREE.Matrix4,m,t,u;f.matrixAutoUpdate=h.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},p=new THREE.WebGLRenderTarget(512,512,a),v=new THREE.WebGLRenderTarget(512,512,a),o=new THREE.PerspectiveCamera(53,1,1,1E4);o.position.z= -2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:p},mapRight:{type:"t",value:1,texture:v}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); -var z=new THREE.Scene;z.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){c.call(b,a,e);p.width=a;p.height=e;v.width=a;v.height=e};this.render=function(a,c){c.update(null,!0);if(m!==c.aspect||t!==c.near||u!==c.fov){m=c.aspect;t=c.near;u=c.fov;var B=c.projectionMatrix.clone(),y=125/30*0.5,A=y*t/125,E=t*Math.tan(u*Math.PI/360),C;k.n14=y;l.n14=-y;y=-E*m+A;C=E*m+A;B.n11=2*t/(C-y);B.n13=(C+y)/(C-y);f.projectionMatrix=B.clone();y=-E*m-A;C=E*m-A;B.n11=2*t/(C-y);B.n13= -(C+y)/(C-y);h.projectionMatrix=B.clone()}f.matrix=c.matrixWorld.clone().multiplySelf(l);f.update(null,!0);f.position.copy(c.position);f.near=t;f.far=c.far;e.call(b,a,f,p,!0);h.matrix=c.matrixWorld.clone().multiplySelf(k);h.update(null,!0);h.position.copy(c.position);h.near=t;h.far=c.far;e.call(b,a,h,v,!0);e.call(b,z,o)}}; +if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);var b=this,c=this.setSize,e=this.render,f=new THREE.PerspectiveCamera,h=new THREE.PerspectiveCamera,k=new THREE.Matrix4,l=new THREE.Matrix4,n,p,u;f.matrixAutoUpdate=h.matrixAutoUpdate=!1;var a={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},t=new THREE.WebGLRenderTarget(512,512,a),v=new THREE.WebGLRenderTarget(512,512,a),o=new THREE.PerspectiveCamera(53,1,1,1E4);o.position.z= +2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:t},mapRight:{type:"t",value:1,texture:v}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"}); +var y=new THREE.Scene;y.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(a,e){c.call(b,a,e);t.width=a;t.height=e;v.width=a;v.height=e};this.render=function(a,c){c.update(null,!0);if(n!==c.aspect||p!==c.near||u!==c.fov){n=c.aspect;p=c.near;u=c.fov;var A=c.projectionMatrix.clone(),z=125/30*0.5,C=z*p/125,B=p*Math.tan(u*Math.PI/360),K;k.n14=z;l.n14=-z;z=-B*n+C;K=B*n+C;A.n11=2*p/(K-z);A.n13=(K+z)/(K-z);f.projectionMatrix=A.clone();z=-B*n-C;K=B*n-C;A.n11=2*p/(K-z);A.n13= +(K+z)/(K-z);h.projectionMatrix=A.clone()}f.matrix=c.matrixWorld.clone().multiplySelf(l);f.update(null,!0);f.position.copy(c.position);f.near=p;f.far=c.far;e.call(b,a,f,t,!0);h.matrix=c.matrixWorld.clone().multiplySelf(k);h.update(null,!0);h.position.copy(c.position);h.near=p;h.far=c.far;e.call(b,a,h,v,!0);e.call(b,y,o)}}; if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(a){THREE.WebGLRenderer.call(this,a);this.autoClear=!1;var b=this,c=this.setSize,e=this.render,f,h,k=new THREE.PerspectiveCamera;k.target=new THREE.Vector3(0,0,0);var l=new THREE.PerspectiveCamera;l.target=new THREE.Vector3(0,0,0);b.separation=10;if(a&&a.separation!==void 0)b.separation=a.separation;this.setSize=function(a,e){c.call(b,a,e);f=a/2;h=e};this.render=function(a,c){this.clear();k.fov=c.fov;k.aspect=0.5*c.aspect;k.near=c.near;k.far= c.far;k.updateProjectionMatrix();k.position.copy(c.position);k.target.copy(c.target);k.translateX(b.separation);k.lookAt(k.target);l.projectionMatrix=k.projectionMatrix;l.position.copy(c.position);l.target.copy(c.target);l.translateX(-b.separation);l.lookAt(l.target);this.setViewport(0,0,f,h);e.call(b,a,k);this.setViewport(f,0,f,h);e.call(b,a,l,!1)}}; diff --git a/build/custom/ThreeWebGL.js b/build/custom/ThreeWebGL.js index 104f39c8..9de8ac31 100644 --- a/build/custom/ThreeWebGL.js +++ b/build/custom/ThreeWebGL.js @@ -16,37 +16,37 @@ b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,e=[];b=0;for(c=a.length;b0&&a>0&&h+a<1}for(var e,f=[],h=0,i=a.children.length;ha.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h=b(this.origin, -this.direction,a.matrixWorld.getPosition());if(h==null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var j,n,k,l,p,m,s,B,A=a.geometry,H=A.vertices,h=0,i=A.faces.length;h0:m<0)))if(m=p.dot((new THREE.Vector3).sub(j,s))/m,s=s.addSelf(B.multiplyScalar(m)),e instanceof THREE.Face3)c(s,j,n,k)&&(e={distance:this.origin.distanceTo(s),point:s,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(s,j,n,l)||c(s,n,k,l)))e={distance:this.origin.distanceTo(s),point:s,face:e,object:a},f.push(e)}return f}}; -THREE.Rectangle=function(){function a(){h=e-b;i=f-c}var b,c,e,f,h,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(h,i,l,p){j=!1;b=h;c=i;e=l;f=p;a()};this.addPoint=function(h,i){j?(j=!1,b=h,c=i,e=h,f=i):(b=bh?e:h,f=f>i?f:i);a()};this.add3Points= -function(h,i,l,p,m,s){j?(j=!1,b=hl?h>m?h:m:l>m?l:m,f=i>p?i>s?i:s:p>s?p:s):(b=hl?h>m?h>e?h:e:m>e?m:e:l>m?l>e?l:e:m>e?m:e,f=i>p?i>s?i>f?i:f:s>f?s:f:p>s?p>f?p:f:s>f?s:f);a()};this.addRectangle=function(h){j?(j=!1,b=h.getLeft(),c=h.getTop(),e=h.getRight(),f=h.getBottom()):(b=bh.getRight()?e:h.getRight(),f=f> +this.direction,a.matrixWorld.getPosition());if(h==null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var j,m,k,o,p,l,t,A,C=a.geometry,E=C.vertices,h=0,i=C.faces.length;h0:l<0)))if(l=p.dot((new THREE.Vector3).sub(j,t))/l,t=t.addSelf(A.multiplyScalar(l)),e instanceof THREE.Face3)c(t,j,m,k)&&(e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(t,j,m,o)||c(t,m,k,o)))e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e)}return f}}; +THREE.Rectangle=function(){function a(){h=e-b;i=f-c}var b,c,e,f,h,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(h,i,o,p){j=!1;b=h;c=i;e=o;f=p;a()};this.addPoint=function(h,i){j?(j=!1,b=h,c=i,e=h,f=i):(b=bh?e:h,f=f>i?f:i);a()};this.add3Points= +function(h,i,o,p,l,t){j?(j=!1,b=ho?h>l?h:l:o>l?o:l,f=i>p?i>t?i:t:p>t?p:t):(b=ho?h>l?h>e?h:e:l>e?l:e:o>l?o>e?o:e:l>e?l:e,f=i>p?i>t?i>f?i:f:t>f?t:f:p>t?p>f?p:f:t>f?t:f);a()};this.addRectangle=function(h){j?(j=!1,b=h.getLeft(),c=h.getTop(),e=h.getRight(),f=h.getBottom()):(b=bh.getRight()?e:h.getRight(),f=f> h.getBottom()?f:h.getBottom());a()};this.inflate=function(h){b-=h;c-=h;e+=h;f+=h;a()};this.minSelf=function(h){b=b>h.getLeft()?b:h.getLeft();c=c>h.getTop()?c:h.getTop();e=e=0&&Math.min(f,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){j=!0;f=e=c=b=0;a()};this.isEmpty=function(){return j}};THREE.Matrix3=function(){this.m=[]}; THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}}; -THREE.Matrix4=function(a,b,c,e,f,h,i,j,n,k,l,p,m,s,B,A){this.set(a!==void 0?a:1,b||0,c||0,e||0,f||0,h!==void 0?h:1,i||0,j||0,n||0,k||0,l!==void 0?l:1,p||0,m||0,s||0,B||0,A!==void 0?A:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,f,h,i,j,n,k,l,p,m,s,B,A){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=h;this.n23=i;this.n24=j;this.n31=n;this.n32=k;this.n33=l;this.n34=p;this.n41=m;this.n42=s;this.n43=B;this.n44=A;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a, +THREE.Matrix4=function(a,b,c,e,f,h,i,j,m,k,o,p,l,t,A,C){this.set(a!==void 0?a:1,b||0,c||0,e||0,f||0,h!==void 0?h:1,i||0,j||0,m||0,k||0,o!==void 0?o:1,p||0,l||0,t||0,A||0,C!==void 0?C:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,f,h,i,j,m,k,o,p,l,t,A,C){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=h;this.n23=i;this.n24=j;this.n31=m;this.n32=k;this.n33=o;this.n34=p;this.n41=l;this.n42=t;this.n43=A;this.n44=C;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a, b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;h.sub(a,b).normalize();if(h.length()===0)h.z=1;e.cross(c,h).normalize();e.length()===0&&(h.x+=1.0E-4,e.cross(c,h).normalize());f.cross(h,e).normalize();this.n11=e.x;this.n12=f.x;this.n13=h.x;this.n21=e.y;this.n22=f.y;this.n23=h.y;this.n31=e.z;this.n32=f.z;this.n33=h.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,e=a.z,f=1/(this.n41*b+this.n42*c+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*e+this.n14)*f; a.y=(this.n21*b+this.n22*c+this.n23*e+this.n24)*f;a.z=(this.n31*b+this.n32*c+this.n33*e+this.n34)*f;return a},multiplyVector4:function(a){var b=a.x,c=a.y,e=a.z,f=a.w;a.x=this.n11*b+this.n12*c+this.n13*e+this.n14*f;a.y=this.n21*b+this.n22*c+this.n23*e+this.n24*f;a.z=this.n31*b+this.n32*c+this.n33*e+this.n34*f;a.w=this.n41*b+this.n42*c+this.n43*e+this.n44*f;return a},rotateAxis:function(a){var b=a.x,c=a.y,e=a.z;a.x=b*this.n11+c*this.n12+e*this.n13;a.y=b*this.n21+c*this.n22+e*this.n23;a.z=b*this.n31+ -c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,n=a.n23,k=a.n24,l=a.n31,p=a.n32,m=a.n33,s=a.n34,B=a.n41,A=a.n42,H=a.n43,C=a.n44,Q=b.n11,wa=b.n12, -ja=b.n13,qa=b.n14,ha=b.n21,L=b.n22,z=b.n23,R=b.n24,M=b.n31,T=b.n32,ka=b.n33,Z=b.n34,Aa=b.n41,$=b.n42,F=b.n43,d=b.n44;this.n11=c*Q+e*ha+f*M+h*Aa;this.n12=c*wa+e*L+f*T+h*$;this.n13=c*ja+e*z+f*ka+h*F;this.n14=c*qa+e*R+f*Z+h*d;this.n21=i*Q+j*ha+n*M+k*Aa;this.n22=i*wa+j*L+n*T+k*$;this.n23=i*ja+j*z+n*ka+k*F;this.n24=i*qa+j*R+n*Z+k*d;this.n31=l*Q+p*ha+m*M+s*Aa;this.n32=l*wa+p*L+m*T+s*$;this.n33=l*ja+p*z+m*ka+s*F;this.n34=l*qa+p*R+m*Z+s*d;this.n41=B*Q+A*ha+H*M+C*Aa;this.n42=B*wa+A*L+H*T+C*$;this.n43=B*ja+ -A*z+H*ka+C*F;this.n44=B*qa+A*R+H*Z+C*d;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*= -a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,f=this.n21,h=this.n22,i=this.n23,j=this.n24,n=this.n31,k=this.n32,l=this.n33,p=this.n34,m=this.n41,s=this.n42,B=this.n43,A=this.n44;return e*i*k*m-c*j*k*m-e*h*l*m+b*j*l*m+c*h*p*m-b*i*p*m-e*i*n*s+c*j*n*s+e*f*l*s-a*j*l*s-c*f*p*s+a*i*p*s+e*h*n*B-b*j*n*B-e*f*k*B+a*j*k*B+b*f*p*B-a*h*p*B-c*h*n*A+b*i* -n*A+c*f*k*A-a*i*k*A-b*f*l*A+a*h*l*A},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32; +c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,m=a.n23,k=a.n24,o=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44,va=b.n11,wa= +b.n12,pa=b.n13,qa=b.n14,N=b.n21,F=b.n22,z=b.n23,W=b.n24,U=b.n31,ja=b.n32,$=b.n33,xa=b.n34,Q=b.n41,G=b.n42,d=b.n43,ta=b.n44;this.n11=c*va+e*N+f*U+h*Q;this.n12=c*wa+e*F+f*ja+h*G;this.n13=c*pa+e*z+f*$+h*d;this.n14=c*qa+e*W+f*xa+h*ta;this.n21=i*va+j*N+m*U+k*Q;this.n22=i*wa+j*F+m*ja+k*G;this.n23=i*pa+j*z+m*$+k*d;this.n24=i*qa+j*W+m*xa+k*ta;this.n31=o*va+p*N+l*U+t*Q;this.n32=o*wa+p*F+l*ja+t*G;this.n33=o*pa+p*z+l*$+t*d;this.n34=o*qa+p*W+l*xa+t*ta;this.n41=A*va+C*N+E*U+B*Q;this.n42=A*wa+C*F+E*ja+B*G;this.n43= +A*pa+C*z+E*$+B*d;this.n44=A*qa+C*W+E*xa+B*ta;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*= +a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,f=this.n21,h=this.n22,i=this.n23,j=this.n24,m=this.n31,k=this.n32,o=this.n33,p=this.n34,l=this.n41,t=this.n42,A=this.n43,C=this.n44;return e*i*k*l-c*j*k*l-e*h*o*l+b*j*o*l+c*h*p*l-b*i*p*l-e*i*m*t+c*j*m*t+e*f*o*t-a*j*o*t-c*f*p*t+a*i*p*t+e*h*m*A-b*j*m*A-e*f*k*A+a*j*k*A+b*f*p*A-a*h*p*A-c*h*m*C+b*i* +m*C+c*f*k*C-a*i*k*C-b*f*o*C+a*h*o*C},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32; a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]= this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]= this.n34;a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0, -0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),e=Math.sin(b),f=1-c,h=a.x,i=a.y,j=a.z,n=f*h,k=f*i;this.set(n*h+c,n*i-e*j,n*j+e*i,0,n*i+e*j,k*i+c,k*j-e*h,0,n*j-e*i,k*j+e*h,f*j*j+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= -new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,e=a.y,f=a.z,h=Math.cos(c),c=Math.sin(c),i=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var n= -i*j,k=i*f,l=e*j,p=e*f;this.n11=n+p*c;this.n12=l*c-k;this.n13=h*e;this.n21=h*f;this.n22=h*j;this.n23=-c;this.n31=k*c-l;this.n32=p+n*c;this.n33=h*i;break;case "ZXY":n=i*j;k=i*f;l=e*j;p=e*f;this.n11=n-p*c;this.n12=-h*f;this.n13=l+k*c;this.n21=k+l*c;this.n22=h*j;this.n23=p-n*c;this.n31=-h*e;this.n32=c;this.n33=h*i;break;case "ZYX":n=h*j;k=h*f;l=c*j;p=c*f;this.n11=i*j;this.n12=l*e-k;this.n13=n*e+p;this.n21=i*f;this.n22=p*e+n;this.n23=k*e-l;this.n31=-e;this.n32=c*i;this.n33=h*i;break;case "YZX":n=h*i;k= -h*e;l=c*i;p=c*e;this.n11=i*j;this.n12=p-n*f;this.n13=l*f+k;this.n21=f;this.n22=h*j;this.n23=-c*j;this.n31=-e*j;this.n32=k*f+l;this.n33=n-p*f;break;case "XZY":n=h*i;k=h*e;l=c*i;p=c*e;this.n11=i*j;this.n12=-f;this.n13=e*j;this.n21=n*f+p;this.n22=h*j;this.n23=k*f-l;this.n31=l*f-k;this.n32=c*j;this.n33=p*f+n;break;default:n=h*j,k=h*f,l=c*j,p=c*f,this.n11=i*j,this.n12=-i*f,this.n13=e,this.n21=k+l*e,this.n22=n-p*e,this.n23=-c*i,this.n31=p-n*e,this.n32=l+k*e,this.n33=h*i}return this},setRotationFromQuaternion:function(a){var b= -a.x,c=a.y,e=a.z,f=a.w,h=b+b,i=c+c,j=e+e,a=b*h,n=b*i;b*=j;var k=c*i;c*=j;e*=j;h*=f;i*=f;f*=j;this.n11=1-(k+e);this.n12=n-f;this.n13=b+i;this.n21=n+f;this.n22=1-(a+e);this.n23=c-h;this.n31=b-i;this.n32=c+h;this.n33=1-(a+k);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=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 e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2; +0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),e=Math.sin(b),f=1-c,h=a.x,i=a.y,j=a.z,m=f*h,k=f*i;this.set(m*h+c,m*i-e*j,m*j+e*i,0,m*i+e*j,k*i+c,k*j-e*h,0,m*j-e*i,k*j+e*h,f*j*j+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= +new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,e=a.y,f=a.z,h=Math.cos(c),c=Math.sin(c),i=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var m= +i*j,k=i*f,o=e*j,p=e*f;this.n11=m+p*c;this.n12=o*c-k;this.n13=h*e;this.n21=h*f;this.n22=h*j;this.n23=-c;this.n31=k*c-o;this.n32=p+m*c;this.n33=h*i;break;case "ZXY":m=i*j;k=i*f;o=e*j;p=e*f;this.n11=m-p*c;this.n12=-h*f;this.n13=o+k*c;this.n21=k+o*c;this.n22=h*j;this.n23=p-m*c;this.n31=-h*e;this.n32=c;this.n33=h*i;break;case "ZYX":m=h*j;k=h*f;o=c*j;p=c*f;this.n11=i*j;this.n12=o*e-k;this.n13=m*e+p;this.n21=i*f;this.n22=p*e+m;this.n23=k*e-o;this.n31=-e;this.n32=c*i;this.n33=h*i;break;case "YZX":m=h*i;k= +h*e;o=c*i;p=c*e;this.n11=i*j;this.n12=p-m*f;this.n13=o*f+k;this.n21=f;this.n22=h*j;this.n23=-c*j;this.n31=-e*j;this.n32=k*f+o;this.n33=m-p*f;break;case "XZY":m=h*i;k=h*e;o=c*i;p=c*e;this.n11=i*j;this.n12=-f;this.n13=e*j;this.n21=m*f+p;this.n22=h*j;this.n23=k*f-o;this.n31=o*f-k;this.n32=c*j;this.n33=p*f+m;break;default:m=h*j,k=h*f,o=c*j,p=c*f,this.n11=i*j,this.n12=-i*f,this.n13=e,this.n21=k+o*e,this.n22=m-p*e,this.n23=-c*i,this.n31=p-m*e,this.n32=o+k*e,this.n33=h*i}return this},setRotationFromQuaternion:function(a){var b= +a.x,c=a.y,e=a.z,f=a.w,h=b+b,i=c+c,j=e+e,a=b*h,m=b*i;b*=j;var k=c*i;c*=j;e*=j;h*=f;i*=f;f*=j;this.n11=1-(k+e);this.n12=m-f;this.n13=b+i;this.n21=m+f;this.n22=1-(a+e);this.n23=c-h;this.n31=b-i;this.n32=c+h;this.n33=1-(a+k);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=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 e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2; e.identity();e.setRotationFromQuaternion(b);f.setScale(c.x,c.y,c.z);this.multiply(e,f);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;e.set(this.n11,this.n21,this.n31);f.set(this.n12,this.n22,this.n32);h.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=e.length(); c.y=f.length();c.z=h.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;e=THREE.Matrix4.__m1;e.copy(this);e.n11/=c.x;e.n21/=c.x;e.n31/=c.x;e.n12/=c.y;e.n22/=c.y;e.n32/=c.y;e.n13/=c.z;e.n23/=c.z;e.n33/=c.z;b.setFromRotationMatrix(e);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,e=1/b.y,f=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*e;this.n22=a.n22*e;this.n32=a.n32*e;this.n13=a.n13*f;this.n23= a.n23*f;this.n33=a.n33*f}}; -THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,n=a.n23,k=a.n24,l=a.n31,p=a.n32,m=a.n33,s=a.n34,B=a.n41,A=a.n42,H=a.n43,C=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=n*s*A-k*m*A+k*p*H-j*s*H-n*p*C+j*m*C;b.n12=h*m*A-f*s*A-h*p*H+e*s*H+f*p*C-e*m*C;b.n13=f*k*A-h*n*A+h*j*H-e*k*H-f*j*C+e*n*C;b.n14=h*n*p-f*k*p-h*j*m+e*k*m+f*j*s-e*n*s;b.n21=k*m*B-n*s*B-k*l*H+i*s*H+n*l*C-i*m*C;b.n22=f*s*B-h*m*B+h*l*H-c*s*H-f*l*C+c*m*C;b.n23=h*n*B-f*k*B-h*i*H+c*k*H+f*i*C-c*n*C;b.n24= -f*k*l-h*n*l+h*i*m-c*k*m-f*i*s+c*n*s;b.n31=j*s*B-k*p*B+k*l*A-i*s*A-j*l*C+i*p*C;b.n32=h*p*B-e*s*B-h*l*A+c*s*A+e*l*C-c*p*C;b.n33=f*k*B-h*j*B+h*i*A-c*k*A-e*i*C+c*j*C;b.n34=h*j*l-e*k*l-h*i*p+c*k*p+e*i*s-c*j*s;b.n41=n*p*B-j*m*B-n*l*A+i*m*A+j*l*H-i*p*H;b.n42=e*m*B-f*p*B+f*l*A-c*m*A-e*l*H+c*p*H;b.n43=f*j*B-e*n*B-f*i*A+c*n*A+e*i*H-c*j*H;b.n44=e*n*l-f*j*l+f*i*p-c*n*p-e*i*m+c*j*m;b.multiplyScalar(1/a.determinant());return b}; -THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,n=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,l=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*k;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*n;c[6]=a*k;c[7]=a*l;c[8]=a*p;return b}; +THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,m=a.n23,k=a.n24,o=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=m*t*C-k*l*C+k*p*E-j*t*E-m*p*B+j*l*B;b.n12=h*l*C-f*t*C-h*p*E+e*t*E+f*p*B-e*l*B;b.n13=f*k*C-h*m*C+h*j*E-e*k*E-f*j*B+e*m*B;b.n14=h*m*p-f*k*p-h*j*l+e*k*l+f*j*t-e*m*t;b.n21=k*l*A-m*t*A-k*o*E+i*t*E+m*o*B-i*l*B;b.n22=f*t*A-h*l*A+h*o*E-c*t*E-f*o*B+c*l*B;b.n23=h*m*A-f*k*A-h*i*E+c*k*E+f*i*B-c*m*B;b.n24= +f*k*o-h*m*o+h*i*l-c*k*l-f*i*t+c*m*t;b.n31=j*t*A-k*p*A+k*o*C-i*t*C-j*o*B+i*p*B;b.n32=h*p*A-e*t*A-h*o*C+c*t*C+e*o*B-c*p*B;b.n33=f*k*A-h*j*A+h*i*C-c*k*C-e*i*B+c*j*B;b.n34=h*j*o-e*k*o-h*i*p+c*k*p+e*i*t-c*j*t;b.n41=m*p*A-j*l*A-m*o*C+i*l*C+j*o*E-i*p*E;b.n42=e*l*A-f*p*A+f*o*C-c*l*C-e*o*E+c*p*E;b.n43=f*j*A-e*m*A-f*i*C+c*m*C+e*i*E-c*j*E;b.n44=e*m*o-f*j*o+f*i*p-c*m*p-e*i*l+c*j*l;b.multiplyScalar(1/a.determinant());return b}; +THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,m=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,o=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*k;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*m;c[6]=a*k;c[7]=a*o;c[8]=a*p;return b}; THREE.Matrix4.makeFrustum=function(a,b,c,e,f,h){var i;i=new THREE.Matrix4;i.n11=2*f/(b-a);i.n12=0;i.n13=(b+a)/(b-a);i.n14=0;i.n21=0;i.n22=2*f/(e-c);i.n23=(e+c)/(e-c);i.n24=0;i.n31=0;i.n32=0;i.n33=-(h+f)/(h-f);i.n34=-2*h*f/(h-f);i.n41=0;i.n42=0;i.n43=-1;i.n44=0;return i};THREE.Matrix4.makePerspective=function(a,b,c,e){var f,a=c*Math.tan(a*Math.PI/360);f=-a;return THREE.Matrix4.makeFrustum(f*b,a*b,f,a,c,e)}; -THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var i,j,n,k;i=new THREE.Matrix4;j=b-a;n=c-e;k=h-f;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/n;i.n23=0;i.n24=-((c+e)/n);i.n31=0;i.n32=0;i.n33=-2/k;i.n34=-((h+f)/k);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; +THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var i,j,m,k;i=new THREE.Matrix4;j=b-a;m=c-e;k=h-f;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/m;i.n23=0;i.n24=-((c+e)/m);i.n31=0;i.n32=0;i.n33=-2/k;i.n34=-((h+f)/k);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3}; THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)=== @@ -54,41 +54,40 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){thi 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},update:function(a,b,c){this.matrixAutoUpdate&& this.updateMatrix();if(this.matrixWorldNeedsUpdate||b)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,b=!0;for(var a=0,e=this.children.length;a=0&&h>=0&&f>=0&&i>=0?!0:d<0&&h<0||f<0&&i<0?!1:(d<0?c=Math.max(c,d/(d-h)):h<0&&(e=Math.min(e,d/(d-h))),f<0?c=Math.max(c,f/(f-i)):i<0&&(e=Math.min(e,f/(f-i))),eF&&i.positionScreen.z0&&L.z<1))xa=wa[Q]=wa[Q]||new THREE.RenderableParticle,Q++,C=xa,C.x=L.x/L.w,C.y=L.y/L.w,C.z=L.z,C.rotation=S.rotation.z,C.scale.x=S.scale.x*Math.abs(C.x-(L.x+h.projectionMatrix.n11)/(L.w+h.projectionMatrix.n14)),C.scale.y=S.scale.y*Math.abs(C.y-(L.y+h.projectionMatrix.n22)/(L.w+h.projectionMatrix.n24)),C.materials=S.materials,qa.push(C);f&&qa.sort(b);return qa}}; -THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; +THREE.Projector=function(){function a(){var a=m[j]=m[j]||new THREE.RenderableVertex;j++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,h=b.z+b.w,f=-a.z+a.w,i=-b.z+b.w;return e>=0&&h>=0&&f>=0&&i>=0?!0:e<0&&h<0||f<0&&i<0?!1:(e<0?c=Math.max(c,e/(e-h)):h<0&&(d=Math.min(d,e/(e-h))),f<0?c=Math.max(c,f/(f-i)):i<0&&(d=Math.min(d,f/(f-i))),dd&&i.positionScreen.z0&&F.z<1))za=wa[va]=wa[va]||new THREE.RenderableParticle,va++,B=za,B.x=F.x/F.w,B.y=F.y/F.w,B.z=F.z,B.rotation=O.rotation.z,B.scale.x=O.scale.x*Math.abs(B.x-(F.x+h.projectionMatrix.n11)/(F.w+h.projectionMatrix.n14)),B.scale.y=O.scale.y*Math.abs(B.y-(F.y+h.projectionMatrix.n22)/(F.w+h.projectionMatrix.n24)),B.materials=O.materials,qa.push(B);f&&qa.sort(b);return qa}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),h=Math.cos(c),c=Math.sin(c),i=a*b,j=e*f;this.w=i*h-j*c;this.x=i*c+j*h;this.y=e*b*h+a*f*c;this.z=a*f*h-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c); this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;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,e=this.z,f=this.w,h=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+f*h+c*j-e*i;this.y=c*a+f*i+e*h-b*j;this.z=e*a+f*j+b*i-c*h;this.w=f*a-b*h-c*i-e*j;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,h=this.x,i=this.y,j=this.z,n=this.w,k=n*c+i*f-j*e,l=n*e+j*c-h*f,p=n*f+h*e-i*c,c=-h* -c-i*e-j*f;b.x=k*n+c*-h+l*-j-p*-i;b.y=l*n+c*-i+p*-h-k*-j;b.z=p*n+c*-j+k*-i-l*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),i=Math.sqrt(1-f*f);if(Math.abs(i)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/i;e=Math.sin(e*h)/i;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; +this.x,c=this.y,e=this.z,f=this.w,h=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+f*h+c*j-e*i;this.y=c*a+f*i+e*h-b*j;this.z=e*a+f*j+b*i-c*h;this.w=f*a-b*h-c*i-e*j;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,h=this.x,i=this.y,j=this.z,m=this.w,k=m*c+i*f-j*e,o=m*e+j*c-h*f,p=m*f+h*e-i*c,c=-h* +c-i*e-j*f;b.x=k*m+c*-h+o*-j-p*-i;b.y=o*m+c*-i+p*-h-k*-j;b.z=p*m+c*-j+k*-i-o*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),i=Math.sqrt(1-f*f);if(Math.abs(i)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/i;e=Math.sin(e*h)/i;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,e,f,h){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3}; THREE.Face4=function(a,b,c,e,f,h,i){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materialIndex=i;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}}; THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x], +c.vertexNormals[1].copy(e[c.b]),c.vertexNormals[2].copy(e[c.c]),c.vertexNormals[3].copy(e[c.d]))},computeTangents:function(){function a(a,d,b,c,e,h,f){j=a.vertices[d].position;m=a.vertices[b].position;k=a.vertices[c].position;o=i[e];p=i[h];l=i[f];t=m.x-j.x;A=k.x-j.x;C=m.y-j.y;E=k.y-j.y;B=m.z-j.z;va=k.z-j.z;wa=p.u-o.u;pa=l.u-o.u;qa=p.v-o.v;N=l.v-o.v;F=1/(wa*N-pa*qa);ja.set((N*t-qa*A)*F,(N*C-qa*E)*F,(N*B-qa*va)*F);$.set((wa*A-pa*t)*F,(wa*E-pa*C)*F,(wa*va-pa*B)*F);W[d].addSelf(ja);W[b].addSelf(ja);W[c].addSelf(ja); +U[d].addSelf($);U[b].addSelf($);U[c].addSelf($)}var b,c,e,f,h,i,j,m,k,o,p,l,t,A,C,E,B,va,wa,pa,qa,N,F,z,W=[],U=[],ja=new THREE.Vector3,$=new THREE.Vector3,xa=new THREE.Vector3,Q=new THREE.Vector3,G=new THREE.Vector3;b=0;for(c=this.vertices.length;b0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x], y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z< this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;bthis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;k=this.points[c[0]];l=this.points[c[1]]; -p=this.points[c[2]];m=this.points[c[3]];j=i*i;n=i*j;e.x=b(k.x,l.x,p.x,m.x,i,j,n);e.y=b(k.y,l.y,p.y,m.y,i,j,n);e.z=b(k.z,l.z,p.z,m.z,i,j,n);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;athis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;k=this.points[c[0]];o=this.points[c[1]]; +p=this.points[c[2]];l=this.points[c[3]];j=i*i;m=i*j;e.x=b(k.x,o.x,p.x,l.x,i,j,m);e.y=b(k.y,o.y,p.y,l.y,i,j,m);e.z=b(k.z,o.z,p.z,l.z,i,j,m);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;a=0&&(b=a.geometry.materials[d.materialIndex]);return b}function c(a,b,c){var e,h,f,i=a.vertices,r=i.length,J=a.colors,j=J.length,t=a.__vertexArray,k=a.__colorArray,n=a.__sortArray,v=a.__dirtyVertices,l=a.__dirtyColors,p=a.__webglCustomAttributesList,m;if(p){f=0;for(e=p.length;f=0)b&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),d.vertexAttribPointer(a.position,3,d.FLOAT,!1,0,0));else if(i.morphTargetBase){c=h.program.attributes;i.morphTargetBase!==-1?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[i.morphTargetBase]),d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0)):c.position>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer), -d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var k=i.morphTargetForcedOrder;for(r=i.morphTargetInfluences;jn&&(t=m,n=r[t]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[t]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=n;k[t]=1;n=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(r=f.__webglCustomAttributesList.length;j= +THREE.WebGLRenderer=function(a){function b(a,d){var b;a.material&&!(a.material instanceof THREE.MeshFaceMaterial)?b=a.material:d.materialIndex>=0&&(b=a.geometry.materials[d.materialIndex]);return b}function c(a,b,c){var e,h,f,i=a.vertices,u=i.length,v=a.colors,q=v.length,j=a.__vertexArray,k=a.__colorArray,m=a.__sortArray,P=a.__dirtyVertices,o=a.__dirtyColors,p=a.__webglCustomAttributesList,l;if(p){f=0;for(e=p.length;f=0)b&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),d.vertexAttribPointer(a.position,3,d.FLOAT,!1,0,0));else if(i.morphTargetBase){c=h.program.attributes;i.morphTargetBase!==-1?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[i.morphTargetBase]),d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0)):c.position>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer), +d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var v=i.morphTargetForcedOrder;for(u=i.morphTargetInfluences;jq&&(k=m,q=u[k]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[k]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=q;v[k]=1;q=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(u=f.__webglCustomAttributesList.length;j= 0&&(d.bindBuffer(d.ARRAY_BUFFER,c.buffer),d.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,d.FLOAT,!1,0,0))}a.color>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglColorBuffer),d.vertexAttribPointer(a.color,3,d.FLOAT,!1,0,0));a.normal>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglNormalBuffer),d.vertexAttribPointer(a.normal,3,d.FLOAT,!1,0,0));a.tangent>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglTangentBuffer),d.vertexAttribPointer(a.tangent,4,d.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(d.bindBuffer(d.ARRAY_BUFFER, f.__webglUVBuffer),d.vertexAttribPointer(a.uv,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv)):d.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglUV2Buffer),d.vertexAttribPointer(a.uv2,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv2)):d.disableVertexAttribArray(a.uv2));h.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexABuffer),d.vertexAttribPointer(a.skinVertexA,4, d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),d.vertexAttribPointer(a.skinVertexB,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),d.vertexAttribPointer(a.skinIndex,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),d.vertexAttribPointer(a.skinWeight,4,d.FLOAT,!1,0,0))}i instanceof THREE.Mesh?(h.wireframe?(d.lineWidth(h.wireframeLinewidth),b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),d.drawElements(d.LINES,f.__webglLineCount, -d.UNSIGNED_SHORT,0)):(b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),d.drawElements(d.TRIANGLES,f.__webglFaceCount,d.UNSIGNED_SHORT,0)),F.info.render.calls++,F.info.render.vertices+=f.__webglFaceCount,F.info.render.faces+=f.__webglFaceCount/3):i instanceof THREE.Line?(i=i.type==THREE.LineStrip?d.LINE_STRIP:d.LINES,d.lineWidth(h.linewidth),d.drawArrays(i,0,f.__webglLineCount),F.info.render.calls++):i instanceof THREE.ParticleSystem?(d.drawArrays(d.POINTS,0,f.__webglParticleCount),F.info.render.calls++): -i instanceof THREE.Ribbon&&(d.drawArrays(d.TRIANGLE_STRIP,0,f.__webglVertexCount),F.info.render.calls++)}}function h(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=d.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=d.createBuffer();a.hasPos&&(d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,a.positionArray,d.DYNAMIC_DRAW),d.enableVertexAttribArray(b.attributes.position),d.vertexAttribPointer(b.attributes.position,3,d.FLOAT,!1,0,0));if(a.hasNormal){d.bindBuffer(d.ARRAY_BUFFER, -a.__webglNormalBuffer);if(c==THREE.FlatShading){var e,f,h,i,j,k,n,t,m,l,p=a.count*3;for(l=0;l=0&&(b=b.geometry.materials[materialIndex], -b.transparent?m(a,b):m(e,b))):(b=d)&&(b.transparent?m(a,b):m(e,b))}function A(a,b){return b.z-a.z}function H(a){var b,c,k,G=0,n,m,r,J,W=a.lights;sa||(sa=new THREE.PerspectiveCamera(F.shadowCameraFov,F.shadowMapWidth/F.shadowMapHeight,F.shadowCameraNear,F.shadowCameraFar));b=0;for(c=W.length;b=0;d--)a[d].object==b&&a.splice(d,1)}function ha(a,b,d){a.push({buffer:b,object:d,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function L(a){if(a!=ia){switch(a){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE);break;case THREE.SubtractiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.ONE_MINUS_SRC_COLOR); -break;case THREE.MultiplyBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.SRC_COLOR);break;default:d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}ia=a}}function z(a,b,c){(c.width&c.width-1)==0&&(c.height&c.height-1)==0?(d.texParameteri(a,d.TEXTURE_WRAP_S,$(b.wrapS)),d.texParameteri(a,d.TEXTURE_WRAP_T,$(b.wrapT)),d.texParameteri(a,d.TEXTURE_MAG_FILTER,$(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,$(b.minFilter)), -d.generateMipmap(a)):(d.texParameteri(a,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_MAG_FILTER,Aa(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,Aa(b.minFilter)))}function R(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=d.createTexture(),F.info.memory.textures++;d.activeTexture(d.TEXTURE0+b);d.bindTexture(d.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?d.texImage2D(d.TEXTURE_2D,0, -$(a.format),a.image.width,a.image.height,0,$(a.format),d.UNSIGNED_BYTE,a.image.data):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,a.image);z(d.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+b),d.bindTexture(d.TEXTURE_2D,a.__webglTexture)}function M(a,b){d.bindRenderbuffer(d.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER, -a)):b.depthBuffer&&b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,a)):d.renderbufferStorage(d.RENDERBUFFER,d.RGBA4,b.width,b.height)}function T(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=d.createTexture();if(b){a.__webglFramebuffer=[]; -a.__webglRenderbuffer=[];d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture);z(d.TEXTURE_CUBE_MAP,a,a);for(var c=0;c<6;c++){a.__webglFramebuffer[c]=d.createFramebuffer();a.__webglRenderbuffer[c]=d.createRenderbuffer();d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,$(a.format),a.width,a.height,0,$(a.format),$(a.type),null);var e=a,f=d.TEXTURE_CUBE_MAP_POSITIVE_X+c;d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer[c]);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,f,e.__webglTexture,0); -M(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=d.createFramebuffer(),a.__webglRenderbuffer=d.createRenderbuffer(),d.bindTexture(d.TEXTURE_2D,a.__webglTexture),z(d.TEXTURE_2D,a,a),d.texImage2D(d.TEXTURE_2D,0,$(a.format),a.width,a.height,0,$(a.format),$(a.type),null),c=d.TEXTURE_2D,d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,c,a.__webglTexture,0),d.bindRenderbuffer(d.RENDERBUFFER,a.__webglRenderbuffer),M(a.__webglRenderbuffer, -a);b?d.bindTexture(d.TEXTURE_CUBE_MAP,null):d.bindTexture(d.TEXTURE_2D,null);d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=e=0):(b=null,c=ua,a=Ia,e=ya,f=Ba);b!=aa&&(d.bindFramebuffer(d.FRAMEBUFFER,b),d.viewport(e,f,c,a),aa=b)}function ka(a){a instanceof THREE.WebGLRenderTargetCube?(d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture),d.generateMipmap(d.TEXTURE_CUBE_MAP),d.bindTexture(d.TEXTURE_CUBE_MAP, -null)):(d.bindTexture(d.TEXTURE_2D,a.__webglTexture),d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null))}function Z(a,b){var c;a=="fragment"?c=d.createShader(d.FRAGMENT_SHADER):a=="vertex"&&(c=d.createShader(d.VERTEX_SHADER));d.shaderSource(c,b);d.compileShader(c);if(!d.getShaderParameter(c,d.COMPILE_STATUS))return console.error(d.getShaderInfoLog(c)),console.error(b),null;return c}function Aa(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST; -default:return d.LINEAR}}function $(a){switch(a){case THREE.RepeatWrapping:return d.REPEAT;case THREE.ClampToEdgeWrapping:return d.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return d.MIRRORED_REPEAT;case THREE.NearestFilter:return d.NEAREST;case THREE.NearestMipMapNearestFilter:return d.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return d.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return d.LINEAR;case THREE.LinearMipMapNearestFilter:return d.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return d.LINEAR_MIPMAP_LINEAR; +d.UNSIGNED_SHORT,0)):(b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),d.drawElements(d.TRIANGLES,f.__webglFaceCount,d.UNSIGNED_SHORT,0)),G.info.render.calls++,G.info.render.vertices+=f.__webglFaceCount,G.info.render.faces+=f.__webglFaceCount/3):i instanceof THREE.Line?(i=i.type==THREE.LineStrip?d.LINE_STRIP:d.LINES,d.lineWidth(h.linewidth),d.drawArrays(i,0,f.__webglLineCount),G.info.render.calls++):i instanceof THREE.ParticleSystem?(d.drawArrays(d.POINTS,0,f.__webglParticleCount),G.info.render.calls++): +i instanceof THREE.Ribbon&&(d.drawArrays(d.TRIANGLE_STRIP,0,f.__webglVertexCount),G.info.render.calls++)}}function h(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=d.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=d.createBuffer();a.hasPos&&(d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,a.positionArray,d.DYNAMIC_DRAW),d.enableVertexAttribArray(b.attributes.position),d.vertexAttribPointer(b.attributes.position,3,d.FLOAT,!1,0,0));if(a.hasNormal){d.bindBuffer(d.ARRAY_BUFFER, +a.__webglNormalBuffer);if(c==THREE.FlatShading){var e,f,h,i,j,v,k,m,p,o,l=a.count*3;for(o=0;o=0)b=b.geometry.materials[d],b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}else if(b=c)b.transparent?(a.transparent= +b,a.opaque=null):(a.opaque=b,a.transparent=null)}function A(a,b){return b.z-a.z}function C(a){var b,c,k,m=0,K,l,u,v,q=a.lights;ra||(ra=new THREE.PerspectiveCamera(G.shadowCameraFov,G.shadowMapWidth/G.shadowMapHeight,G.shadowCameraNear,G.shadowCameraFar));b=0;for(c=q.length;b=0;d--)a[d].object==b&&a.splice(d,1)}function qa(a,b,d){a.push({buffer:b,object:d,opaque:null,transparent:null})}function N(a){if(a!=ka){switch(a){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE);break;case THREE.SubtractiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.ONE_MINUS_SRC_COLOR);break; +case THREE.MultiplyBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.SRC_COLOR);break;default:d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}ka=a}}function F(a,b,c){(c.width&c.width-1)==0&&(c.height&c.height-1)==0?(d.texParameteri(a,d.TEXTURE_WRAP_S,Q(b.wrapS)),d.texParameteri(a,d.TEXTURE_WRAP_T,Q(b.wrapT)),d.texParameteri(a,d.TEXTURE_MAG_FILTER,Q(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,Q(b.minFilter)), +d.generateMipmap(a)):(d.texParameteri(a,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_MAG_FILTER,xa(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,xa(b.minFilter)))}function z(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=d.createTexture(),G.info.memory.textures++;d.activeTexture(d.TEXTURE0+b);d.bindTexture(d.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?d.texImage2D(d.TEXTURE_2D,0, +Q(a.format),a.image.width,a.image.height,0,Q(a.format),d.UNSIGNED_BYTE,a.image.data):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,a.image);F(d.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+b),d.bindTexture(d.TEXTURE_2D,a.__webglTexture)}function W(a,b){d.bindRenderbuffer(d.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER, +a)):b.depthBuffer&&b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,a)):d.renderbufferStorage(d.RENDERBUFFER,d.RGBA4,b.width,b.height)}function U(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=d.createTexture();if(b){a.__webglFramebuffer=[]; +a.__webglRenderbuffer=[];d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture);F(d.TEXTURE_CUBE_MAP,a,a);for(var c=0;c<6;c++){a.__webglFramebuffer[c]=d.createFramebuffer();a.__webglRenderbuffer[c]=d.createRenderbuffer();d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null);var e=a,f=d.TEXTURE_CUBE_MAP_POSITIVE_X+c;d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer[c]);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,f,e.__webglTexture,0); +W(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=d.createFramebuffer(),a.__webglRenderbuffer=d.createRenderbuffer(),d.bindTexture(d.TEXTURE_2D,a.__webglTexture),F(d.TEXTURE_2D,a,a),d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null),c=d.TEXTURE_2D,d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,c,a.__webglTexture,0),d.bindRenderbuffer(d.RENDERBUFFER,a.__webglRenderbuffer),W(a.__webglRenderbuffer, +a);b?d.bindTexture(d.TEXTURE_CUBE_MAP,null):d.bindTexture(d.TEXTURE_2D,null);d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=e=0):(b=null,c=Ca,a=ya,e=Ha,f=Aa);b!=ua&&(d.bindFramebuffer(d.FRAMEBUFFER,b),d.viewport(e,f,c,a),ua=b)}function ja(a){a instanceof THREE.WebGLRenderTargetCube?(d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture),d.generateMipmap(d.TEXTURE_CUBE_MAP),d.bindTexture(d.TEXTURE_CUBE_MAP, +null)):(d.bindTexture(d.TEXTURE_2D,a.__webglTexture),d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null))}function $(a,b){var c;a=="fragment"?c=d.createShader(d.FRAGMENT_SHADER):a=="vertex"&&(c=d.createShader(d.VERTEX_SHADER));d.shaderSource(c,b);d.compileShader(c);if(!d.getShaderParameter(c,d.COMPILE_STATUS))return console.error(d.getShaderInfoLog(c)),console.error(b),null;return c}function xa(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST; +default:return d.LINEAR}}function Q(a){switch(a){case THREE.RepeatWrapping:return d.REPEAT;case THREE.ClampToEdgeWrapping:return d.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return d.MIRRORED_REPEAT;case THREE.NearestFilter:return d.NEAREST;case THREE.NearestMipMapNearestFilter:return d.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return d.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return d.LINEAR;case THREE.LinearMipMapNearestFilter:return d.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return d.LINEAR_MIPMAP_LINEAR; case THREE.ByteType:return d.BYTE;case THREE.UnsignedByteType:return d.UNSIGNED_BYTE;case THREE.ShortType:return d.SHORT;case THREE.UnsignedShortType:return d.UNSIGNED_SHORT;case THREE.IntType:return d.INT;case THREE.UnsignedShortType:return d.UNSIGNED_INT;case THREE.FloatType:return d.FLOAT;case THREE.AlphaFormat:return d.ALPHA;case THREE.RGBFormat:return d.RGB;case THREE.RGBAFormat:return d.RGBA;case THREE.LuminanceFormat:return d.LUMINANCE;case THREE.LuminanceAlphaFormat:return d.LUMINANCE_ALPHA}return 0} -var F=this,d,Fa=[],Va=null,aa=null,ma=-1,E=null,ra=0,N=null,V=null,ia=null,S=null,xa=null,Ka=null,Pa=null,Qa=null,ya=0,Ba=0,ua=0,Ia=0,X=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Sa=new Float32Array(16),Ta=new Float32Array(16),Ha=new THREE.Vector4,Xa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},Da=a.canvas!==void 0?a.canvas:document.createElement("canvas"), -K=a.stencil!==void 0?a.stencil:!0,bb=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,cb=a.antialias!==void 0?a.antialias:!1,va=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),za=a.clearAlpha!==void 0?a.clearAlpha:0,Wa=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=Da;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor= -this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var sa,Ra=[],a=THREE.ShaderLib.depthRGBA,$a=THREE.UniformsUtils.clone(a.uniforms),Ua=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader, -uniforms:$a}),Ya=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:$a,morphTargets:!0});Ua._shadowPass=!0;Ya._shadowPass=!0;try{if(!(d=Da.getContext("experimental-webgl",{antialias:cb,stencil:K,preserveDrawingBuffer:bb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+d.getParameter(d.VERSION)+" | "+d.getParameter(d.VENDOR)+" | "+d.getParameter(d.RENDERER)+" | "+d.getParameter(d.SHADING_LANGUAGE_VERSION))}catch(db){console.error(db)}d.clearColor(0, -0,0,1);d.clearDepth(1);d.clearStencil(0);d.enable(d.DEPTH_TEST);d.depthFunc(d.LEQUAL);d.frontFace(d.CCW);d.cullFace(d.BACK);d.enable(d.CULL_FACE);d.enable(d.BLEND);d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);d.clearColor(va.r,va.g,va.b,za);this.context=d;var ab=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,u={};u.vertices=new Float32Array(16);u.faces=new Uint16Array(6);K=0;u.vertices[K++]=-1;u.vertices[K++]=-1;u.vertices[K++]=0;u.vertices[K++]=1;u.vertices[K++]= -1;u.vertices[K++]=-1;u.vertices[K++]=1;u.vertices[K++]=1;u.vertices[K++]=1;u.vertices[K++]=1;u.vertices[K++]=1;u.vertices[K++]=0;u.vertices[K++]=-1;u.vertices[K++]=1;u.vertices[K++]=0;K=u.vertices[K++]=0;u.faces[K++]=0;u.faces[K++]=1;u.faces[K++]=2;u.faces[K++]=0;u.faces[K++]=2;u.faces[K++]=3;u.vertexBuffer=d.createBuffer();u.elementBuffer=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,u.vertexBuffer);d.bufferData(d.ARRAY_BUFFER,u.vertices,d.STATIC_DRAW);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,u.elementBuffer); -d.bufferData(d.ELEMENT_ARRAY_BUFFER,u.faces,d.STATIC_DRAW);u.program=d.createProgram();d.attachShader(u.program,Z("fragment",THREE.ShaderLib.sprite.fragmentShader));d.attachShader(u.program,Z("vertex",THREE.ShaderLib.sprite.vertexShader));d.linkProgram(u.program);u.attributes={};u.uniforms={};u.attributes.position=d.getAttribLocation(u.program,"position");u.attributes.uv=d.getAttribLocation(u.program,"uv");u.uniforms.uvOffset=d.getUniformLocation(u.program,"uvOffset");u.uniforms.uvScale=d.getUniformLocation(u.program, -"uvScale");u.uniforms.rotation=d.getUniformLocation(u.program,"rotation");u.uniforms.scale=d.getUniformLocation(u.program,"scale");u.uniforms.alignment=d.getUniformLocation(u.program,"alignment");u.uniforms.color=d.getUniformLocation(u.program,"color");u.uniforms.map=d.getUniformLocation(u.program,"map");u.uniforms.opacity=d.getUniformLocation(u.program,"opacity");u.uniforms.useScreenCoordinates=d.getUniformLocation(u.program,"useScreenCoordinates");u.uniforms.affectedByDistance=d.getUniformLocation(u.program, -"affectedByDistance");u.uniforms.screenPosition=d.getUniformLocation(u.program,"screenPosition");u.uniforms.modelViewMatrix=d.getUniformLocation(u.program,"modelViewMatrix");u.uniforms.projectionMatrix=d.getUniformLocation(u.program,"projectionMatrix");var Za=!1;this.setSize=function(a,b){Da.width=a;Da.height=b;this.setViewport(0,0,Da.width,Da.height)};this.setViewport=function(a,b,c,e){ya=a;Ba=b;ua=c;Ia=e;d.viewport(ya,Ba,ua,Ia)};this.setScissor=function(a,b,c,e){d.scissor(a,b,c,e)};this.enableScissorTest= -function(a){a?d.enable(d.SCISSOR_TEST):d.disable(d.SCISSOR_TEST)};this.setClearColorHex=function(a,b){va.setHex(a);za=b;d.clearColor(va.r,va.g,va.b,za)};this.setClearColor=function(a,b){va.copy(a);za=b;d.clearColor(va.r,va.g,va.b,za)};this.getClearColor=function(){return va};this.getClearAlpha=function(){return za};this.clear=function(a,b,c){var e=0;if(a==void 0||a)e|=d.COLOR_BUFFER_BIT;if(b==void 0||b)e|=d.DEPTH_BUFFER_BIT;if(c==void 0||c)e|=d.STENCIL_BUFFER_BIT;d.clear(e)};this.getContext=function(){return d}; +var G=this,d,ta=[],Wa=null,ua=null,J=-1,R=null,S=0,T=null,X=null,ka=null,aa=null,O=null,za=null,La=null,Ra=null,Ha=0,Aa=0,Ca=0,ya=0,ha=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Da=new THREE.Matrix4,Ta=new Float32Array(16),Ua=new Float32Array(16),Ja=new THREE.Vector4,Ya={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},Ba=a.canvas!==void 0?a.canvas:document.createElement("canvas"), +I=a.stencil!==void 0?a.stencil:!0,cb=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,db=a.antialias!==void 0?a.antialias:!1,Y=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),Fa=a.clearAlpha!==void 0?a.clearAlpha:0,Xa=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=Ba;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear= +!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var ra,Sa=[],a=THREE.ShaderLib.depthRGBA,ab=THREE.UniformsUtils.clone(a.uniforms),Va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ab}), +Za=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ab,morphTargets:!0});Va._shadowPass=!0;Za._shadowPass=!0;try{if(!(d=Ba.getContext("experimental-webgl",{antialias:db,stencil:I,preserveDrawingBuffer:cb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+d.getParameter(d.VERSION)+" | "+d.getParameter(d.VENDOR)+" | "+d.getParameter(d.RENDERER)+" | "+d.getParameter(d.SHADING_LANGUAGE_VERSION))}catch(eb){console.error(eb)}d.clearColor(0, +0,0,1);d.clearDepth(1);d.clearStencil(0);d.enable(d.DEPTH_TEST);d.depthFunc(d.LEQUAL);d.frontFace(d.CCW);d.cullFace(d.BACK);d.enable(d.CULL_FACE);d.enable(d.BLEND);d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);d.clearColor(Y.r,Y.g,Y.b,Fa);this.context=d;var bb=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,r={};r.vertices=new Float32Array(16);r.faces=new Uint16Array(6);I=0;r.vertices[I++]=-1;r.vertices[I++]=-1;r.vertices[I++]=0;r.vertices[I++]=1;r.vertices[I++]=1; +r.vertices[I++]=-1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=0;r.vertices[I++]=-1;r.vertices[I++]=1;r.vertices[I++]=0;I=r.vertices[I++]=0;r.faces[I++]=0;r.faces[I++]=1;r.faces[I++]=2;r.faces[I++]=0;r.faces[I++]=2;r.faces[I++]=3;r.vertexBuffer=d.createBuffer();r.elementBuffer=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,r.vertexBuffer);d.bufferData(d.ARRAY_BUFFER,r.vertices,d.STATIC_DRAW);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,r.elementBuffer); +d.bufferData(d.ELEMENT_ARRAY_BUFFER,r.faces,d.STATIC_DRAW);r.program=d.createProgram();d.attachShader(r.program,$("fragment",THREE.ShaderLib.sprite.fragmentShader));d.attachShader(r.program,$("vertex",THREE.ShaderLib.sprite.vertexShader));d.linkProgram(r.program);r.attributes={};r.uniforms={};r.attributes.position=d.getAttribLocation(r.program,"position");r.attributes.uv=d.getAttribLocation(r.program,"uv");r.uniforms.uvOffset=d.getUniformLocation(r.program,"uvOffset");r.uniforms.uvScale=d.getUniformLocation(r.program, +"uvScale");r.uniforms.rotation=d.getUniformLocation(r.program,"rotation");r.uniforms.scale=d.getUniformLocation(r.program,"scale");r.uniforms.alignment=d.getUniformLocation(r.program,"alignment");r.uniforms.color=d.getUniformLocation(r.program,"color");r.uniforms.map=d.getUniformLocation(r.program,"map");r.uniforms.opacity=d.getUniformLocation(r.program,"opacity");r.uniforms.useScreenCoordinates=d.getUniformLocation(r.program,"useScreenCoordinates");r.uniforms.affectedByDistance=d.getUniformLocation(r.program, +"affectedByDistance");r.uniforms.screenPosition=d.getUniformLocation(r.program,"screenPosition");r.uniforms.modelViewMatrix=d.getUniformLocation(r.program,"modelViewMatrix");r.uniforms.projectionMatrix=d.getUniformLocation(r.program,"projectionMatrix");var $a=!1;this.setSize=function(a,b){Ba.width=a;Ba.height=b;this.setViewport(0,0,Ba.width,Ba.height)};this.setViewport=function(a,b,c,e){Ha=a;Aa=b;Ca=c;ya=e;d.viewport(Ha,Aa,Ca,ya)};this.setScissor=function(a,b,c,e){d.scissor(a,b,c,e)};this.enableScissorTest= +function(a){a?d.enable(d.SCISSOR_TEST):d.disable(d.SCISSOR_TEST)};this.setClearColorHex=function(a,b){Y.setHex(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.setClearColor=function(a,b){Y.copy(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.getClearColor=function(){return Y};this.getClearAlpha=function(){return Fa};this.clear=function(a,b,c){var e=0;if(a==void 0||a)e|=d.COLOR_BUFFER_BIT;if(b==void 0||b)e|=d.DEPTH_BUFFER_BIT;if(c==void 0||c)e|=d.STENCIL_BUFFER_BIT;d.clear(e)};this.getContext=function(){return d}; 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(g in a.geometry.geometryGroups){var b=a.geometry.geometryGroups[g];d.deleteBuffer(b.__webglVertexBuffer);d.deleteBuffer(b.__webglNormalBuffer);d.deleteBuffer(b.__webglTangentBuffer);d.deleteBuffer(b.__webglColorBuffer);d.deleteBuffer(b.__webglUVBuffer);d.deleteBuffer(b.__webglUV2Buffer);d.deleteBuffer(b.__webglSkinVertexABuffer); -d.deleteBuffer(b.__webglSkinVertexBBuffer);d.deleteBuffer(b.__webglSkinIndicesBuffer);d.deleteBuffer(b.__webglSkinWeightsBuffer);d.deleteBuffer(b.__webglFaceBuffer);d.deleteBuffer(b.__webglLineBuffer);if(b.numMorphTargets)for(var c=0,e=b.numMorphTargets;c=0&&d.enableVertexAttribArray(v.position);v.color>=0&&d.enableVertexAttribArray(v.color);v.normal>=0&&d.enableVertexAttribArray(v.normal); -v.tangent>=0&&d.enableVertexAttribArray(v.tangent);a.skinning&&v.skinVertexA>=0&&v.skinVertexB>=0&&v.skinIndex>=0&&v.skinWeight>=0&&(d.enableVertexAttribArray(v.skinVertexA),d.enableVertexAttribArray(v.skinVertexB),d.enableVertexAttribArray(v.skinIndex),d.enableVertexAttribArray(v.skinWeight));if(a.attributes)for(h in a.attributes)v[h]!==void 0&&v[h]>=0&&d.enableVertexAttribArray(v[h]);if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h=0&&(d.enableVertexAttribArray(v[u]), -a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,b,c,d){T(a);this.clear(b,c,d)};this.updateShadowMap=function(a,b){H(a,b)};this.render=function(a,b,c,m){var G,Ga,u,r,J,W,t,z,Oa=a.lights,v=a.fog;ma=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&H(a,b);F.info.render.calls=0;F.info.render.vertices=0;F.info.render.faces=0;if(b.matrixAutoUpdate){for(J=b;J.parent;)J=J.parent;J.update(void 0,!0)}a.update(void 0,!1, -b);b.matrixWorldInverse.flattenToArray(Ta);b.projectionMatrix.flattenToArray(Sa);Ca.multiply(b.projectionMatrix,b.matrixWorldInverse);l(Ca);this.initWebGLObjects(a);T(c);(this.autoClear||m)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);J=a.__webglObjects.length;for(m=0;m=0;m--)if(G=a.__webglObjects[m],G.render){t=G.object;z=G.buffer;u=G.opaque;i(t);for(G=0;G65535&&(s[t].counter+=1,p=s[t].hash+"_"+s[t].counter,j.geometryGroups[p]==void 0&&(j.geometryGroups[p]={faces:[],materialIndex:l,vertices:0,numMorphTargets:v})),j.geometryGroups[p].faces.push(k),j.geometryGroups[p].vertices+=n;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=ra++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer= -d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=d.createBuffer();k.__webglUVBuffer=d.createBuffer();k.__webglUV2Buffer=d.createBuffer();k.__webglSkinVertexABuffer=d.createBuffer();k.__webglSkinVertexBBuffer=d.createBuffer();k.__webglSkinIndicesBuffer=d.createBuffer();k.__webglSkinWeightsBuffer=d.createBuffer();k.__webglFaceBuffer=d.createBuffer();k.__webglLineBuffer=d.createBuffer();if(k.numMorphTargets){l=m=void 0;k.__webglMorphTargetsBuffers=[];m=0;for(l=k.numMorphTargets;m< -l;m++)k.__webglMorphTargetsBuffers.push(d.createBuffer())}F.info.memory.geometries++;for(var l=e,u=n=s=void 0,t=u=v=u=void 0,p=t=k=0,z=n=void 0,B=void 0,n=m=v=s=void 0,v=l.geometry,z=v.faces,B=j.faces,s=0,n=B.length;s0||v.faceVertexUvs.length>0)j.__uvArray=new Float32Array(k*2);if(v.faceUvs.length>1||v.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(k*2)}if(l.geometry.skinWeights.length&&l.geometry.skinIndices.length)j.__skinVertexAArray= -new Float32Array(k*4),j.__skinVertexBArray=new Float32Array(k*4),j.__skinIndexArray=new Float32Array(k*4),j.__skinWeightArray=new Float32Array(k*4);j.__faceArray=new Uint16Array(t*3+(l.geometry.edgeFaces?l.geometry.edgeFaces.length*6:0));j.__lineArray=new Uint16Array(p*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];v=0;for(u=j.numMorphTargets;v=0;i--)f[i]==h&&f.splice(i,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&qa(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e< -f;e++)if(i=a.__webglObjects[e].object,l=j=h=void 0,i instanceof THREE.Mesh){h=i.geometry;k=0;for(m=h.geometryGroupsList.length;k0&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,pa,t));Aa&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER, -V,t));Ba&&ta.hasTangents&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglTangentBuffer),d.bufferData(d.ARRAY_BUFFER,ca,t));ua&&$>0&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglUVBuffer),d.bufferData(d.ARRAY_BUFFER,ka,t));ua&&aa>0&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglUV2Buffer),d.bufferData(d.ARRAY_BUFFER,ma,t));ya&&(d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,l.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,ia,t),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,l.__webglLineBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,X,t)); -x>0&&(d.bindBuffer(d.ARRAY_BUFFER,l.__webglSkinVertexABuffer),d.bufferData(d.ARRAY_BUFFER,da,t),d.bindBuffer(d.ARRAY_BUFFER,l.__webglSkinVertexBBuffer),d.bufferData(d.ARRAY_BUFFER,ea,t),d.bindBuffer(d.ARRAY_BUFFER,l.__webglSkinIndicesBuffer),d.bufferData(d.ARRAY_BUFFER,fa,t),d.bindBuffer(d.ARRAY_BUFFER,l.__webglSkinWeightsBuffer),d.bufferData(d.ARRAY_BUFFER,ga,t));p&&(delete l.__inittedArrays,delete l.__colorArray,delete l.__normalArray,delete l.__tangentArray,delete l.__uvArray,delete l.__uv2Array, -delete l.__faceArray,delete l.__vertexArray,delete l.__lineArray,delete l.__skinVertexAArray,delete l.__skinVertexBArray,delete l.__skinIndexArray,delete l.__skinWeightArray)}h.__dirtyVertices=!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;ja(j,i)}else if(i instanceof THREE.Ribbon){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=s=p=p=void 0;v=i.vertices;m=i.colors;n=v.length;l=m.length;z=i.__vertexArray; -t=i.__colorArray;B=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p=0&&d.enableVertexAttribArray(l.position);l.color>=0&&d.enableVertexAttribArray(l.color);l.normal>=0&&d.enableVertexAttribArray(l.normal); +l.tangent>=0&&d.enableVertexAttribArray(l.tangent);a.skinning&&l.skinVertexA>=0&&l.skinVertexB>=0&&l.skinIndex>=0&&l.skinWeight>=0&&(d.enableVertexAttribArray(l.skinVertexA),d.enableVertexAttribArray(l.skinVertexB),d.enableVertexAttribArray(l.skinIndex),d.enableVertexAttribArray(l.skinWeight));if(a.attributes)for(h in a.attributes)l[h]!==void 0&&l[h]>=0&&d.enableVertexAttribArray(l[h]);if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h=0&&(d.enableVertexAttribArray(l[r]), +a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,b,c,d){U(a);this.clear(b,c,d)};this.updateShadowMap=function(a,b){C(a,b)};this.render=function(a,b,c,r){var Ia,K,Ea,u,v,q,z,Pa=a.lights,Qa=a.fog;J=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&C(a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;if(b.matrixAutoUpdate){for(Ea=b;Ea.parent;)Ea=Ea.parent;Ea.update(void 0,!0)}a.update(void 0, +!1,b);b.matrixWorldInverse.flattenToArray(Ua);b.projectionMatrix.flattenToArray(Ta);Da.multiply(b.projectionMatrix,b.matrixWorldInverse);o(Da);this.initWebGLObjects(a);U(c);(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);Ea=a.__webglObjects.length;for(r=0;r=0;r--)if(v=a.__webglObjects[r],v.render&&(q=v.object,z=v.buffer,K=v.opaque))i(q),j(K.depthTest),m(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),f(b,Pa,Qa, +K,z,q);for(r=0;r65535&&(r[l].counter+=1,p=r[l].hash+"_"+r[l].counter,j.geometryGroups[p]==void 0&&(j.geometryGroups[p]= +{faces:[],materialIndex:q,vertices:0,numMorphTargets:t})),j.geometryGroups[p].faces.push(k),j.geometryGroups[p].vertices+=o;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=S++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer=d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=d.createBuffer();k.__webglUVBuffer= +d.createBuffer();k.__webglUV2Buffer=d.createBuffer();k.__webglSkinVertexABuffer=d.createBuffer();k.__webglSkinVertexBBuffer=d.createBuffer();k.__webglSkinIndicesBuffer=d.createBuffer();k.__webglSkinWeightsBuffer=d.createBuffer();k.__webglFaceBuffer=d.createBuffer();k.__webglLineBuffer=d.createBuffer();if(k.numMorphTargets){q=m=void 0;k.__webglMorphTargetsBuffers=[];m=0;for(q=k.numMorphTargets;m0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(k*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(k*2)}if(q.geometry.skinWeights.length&&q.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(k*4),j.__skinVertexBArray=new Float32Array(k*4), +j.__skinIndexArray=new Float32Array(k*4),j.__skinWeightArray=new Float32Array(k*4);j.__faceArray=new Uint16Array(l*3);j.__lineArray=new Uint16Array(p*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(z=j.numMorphTargets;t=0;i--)f[i]==h&&f.splice(i,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&pa(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,oa,l));za&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER,W,l));Aa&&sa.hasTangents&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglTangentBuffer),d.bufferData(d.ARRAY_BUFFER,ca,l));ta&&X>0&&(d.bindBuffer(d.ARRAY_BUFFER, +q.__webglUVBuffer),d.bufferData(d.ARRAY_BUFFER,ja,l));ta&&$>0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglUV2Buffer),d.bufferData(d.ARRAY_BUFFER,ka,l));ya&&(d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,ha,l),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webglLineBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,Y,l));x>0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinVertexABuffer),d.bufferData(d.ARRAY_BUFFER,da,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinVertexBBuffer), +d.bufferData(d.ARRAY_BUFFER,ea,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinIndicesBuffer),d.bufferData(d.ARRAY_BUFFER,fa,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinWeightsBuffer),d.bufferData(d.ARRAY_BUFFER,ga,l));p&&(delete q.__inittedArrays,delete q.__colorArray,delete q.__normalArray,delete q.__tangentArray,delete q.__uvArray,delete q.__uv2Array,delete q.__faceArray,delete q.__vertexArray,delete q.__lineArray,delete q.__skinVertexAArray,delete q.__skinVertexBArray,delete q.__skinIndexArray,delete q.__skinWeightArray)}h.__dirtyVertices= +!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;wa(j,i)}else if(i instanceof THREE.Ribbon){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=r=p=p=void 0;t=i.vertices;m=i.colors;o=t.length;q=m.length;A=i.__vertexArray;l=i.__colorArray;C=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p= 0 ) { material = object.geometry.materials[ materialIndex ]; - material.transparent ? addToFixedArray( transparent, material ) : addToFixedArray( opaque, material ); + + if ( material.transparent ) { + + globject.transparent = material; + globject.opaque = null; + + } else { + + globject.opaque = material; + globject.transparent = null; + + } } } else { material = meshMaterial; - if ( material ) material.transparent ? addToFixedArray( transparent, material ) : addToFixedArray( opaque, material ); + + if ( material ) { + + if ( material.transparent ) { + + globject.transparent = material; + globject.opaque = null; + + } else { + + globject.opaque = material; + globject.transparent = null; + + } + + } } @@ -3754,7 +3779,7 @@ THREE.WebGLRenderer = function ( parameters ) { this.render = function( scene, camera, renderTarget, forceClear ) { - var i, program, opaque, transparent, material, + var i, program, material, o, ol, oil, webglObject, object, buffer, lights = scene.lights, fog = scene.fog; @@ -3946,20 +3971,16 @@ THREE.WebGLRenderer = function ( parameters ) { object = webglObject.object; buffer = webglObject.buffer; - opaque = webglObject.opaque; + material = webglObject.opaque; + + if ( ! material ) continue; setObjectFaces( object ); - for ( i = 0; i < opaque.count; i ++ ) { - - material = opaque.list[ i ]; - - setDepthTest( material.depthTest ); - setDepthWrite( material.depthWrite ); - setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); - renderBuffer( camera, lights, fog, material, buffer, object ); - - } + setDepthTest( material.depthTest ); + setDepthWrite( material.depthWrite ); + setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); + renderBuffer( camera, lights, fog, material, buffer, object ); } @@ -3967,7 +3988,7 @@ THREE.WebGLRenderer = function ( parameters ) { // opaque pass (immediate simulator) - for ( o = 0; o < oil; o++ ) { + for ( o = 0; o < oil; o ++ ) { webglObject = scene.__webglObjectsImmediate[ o ]; object = webglObject.object; @@ -3976,29 +3997,25 @@ THREE.WebGLRenderer = function ( parameters ) { _currentGeometryGroupHash = -1; - opaque = webglObject.opaque; + material = webglObject.opaque; + + if ( ! material ) continue; setObjectFaces( object ); - for( i = 0; i < opaque.count; i++ ) { + setDepthTest( material.depthTest ); + setDepthWrite( material.depthWrite ); + setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); - material = opaque.list[ i ]; + program = setProgram( camera, lights, fog, material, object ); - setDepthTest( material.depthTest ); - setDepthWrite( material.depthWrite ); - setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); + if ( object.immediateRenderCallback ) { - program = setProgram( camera, lights, fog, material, object ); + object.immediateRenderCallback( program, _gl, _frustum ); - if ( object.immediateRenderCallback ) { + } else { - object.immediateRenderCallback( program, _gl, _frustum ); - - } else { - - object.render( function( object ) { renderBufferImmediate( object, program, material.shading ); } ); - - } + object.render( function( object ) { renderBufferImmediate( object, program, material.shading ); } ); } @@ -4017,22 +4034,18 @@ THREE.WebGLRenderer = function ( parameters ) { object = webglObject.object; buffer = webglObject.buffer; - transparent = webglObject.transparent; + material = webglObject.transparent; + + if ( ! material ) continue; setObjectFaces( object ); - for ( i = 0; i < transparent.count; i ++ ) { + setBlending( material.blending ); + setDepthTest( material.depthTest ); + setDepthWrite( material.depthWrite ); + setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); - material = transparent.list[ i ]; - - setBlending( material.blending ); - setDepthTest( material.depthTest ); - setDepthWrite( material.depthWrite ); - setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); - - renderBuffer( camera, lights, fog, material, buffer, object ); - - } + renderBuffer( camera, lights, fog, material, buffer, object ); } @@ -4040,7 +4053,7 @@ THREE.WebGLRenderer = function ( parameters ) { // transparent pass (immediate simulator) - for ( o = 0; o < oil; o++ ) { + for ( o = 0; o < oil; o ++ ) { webglObject = scene.__webglObjectsImmediate[ o ]; object = webglObject.object; @@ -4049,30 +4062,26 @@ THREE.WebGLRenderer = function ( parameters ) { _currentGeometryGroupHash = -1; - transparent = webglObject.transparent; + material = webglObject.transparent; + + if ( ! material ) continue; setObjectFaces( object ); - for ( i = 0; i < transparent.count; i ++ ) { + setBlending( material.blending ); + setDepthTest( material.depthTest ); + setDepthWrite( material.depthWrite ); + setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); - material = transparent.list[ i ]; + program = setProgram( camera, lights, fog, material, object ); - setBlending( material.blending ); - setDepthTest( material.depthTest ); - setDepthWrite( material.depthWrite ); - setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); + if ( object.immediateRenderCallback ) { - program = setProgram( camera, lights, fog, material, object ); + object.immediateRenderCallback( program, _gl, _frustum ); - if ( object.immediateRenderCallback ) { + } else { - object.immediateRenderCallback( program, _gl, _frustum ); - - } else { - - object.render( function( object ) { renderBufferImmediate( object, program, material.shading ); } ); - - } + object.render( function( object ) { renderBufferImmediate( object, program, material.shading ); } ); } @@ -4671,9 +4680,10 @@ THREE.WebGLRenderer = function ( parameters ) { objlist.push( { - buffer: buffer, object: object, - opaque: { list: [], count: 0 }, - transparent: { list: [], count: 0 } + buffer: buffer, + object: object, + opaque: null, + transparent: null } ); @@ -4684,8 +4694,8 @@ THREE.WebGLRenderer = function ( parameters ) { objlist.push( { object: object, - opaque: { list: [], count: 0 }, - transparent: { list: [], count: 0 } + opaque: null, + transparent: null } ); @@ -5754,4 +5764,3 @@ THREE.WebGLRenderer = function ( parameters ) { } */ }; - From b410a7804a20df937831272ceebd398cfec3e6b8 Mon Sep 17 00:00:00 2001 From: alteredq Date: Fri, 21 Oct 2011 13:05:07 +0200 Subject: [PATCH 29/33] Small change in setObjectFaces. These little buggers were costing 3.35% of the total time in performance test. --- build/Three.js | 2 +- build/custom/ThreeWebGL.js | 2 +- src/renderers/WebGLRenderer.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/Three.js b/build/Three.js index 77cd17fe..bb28b021 100644 --- a/build/Three.js +++ b/build/Three.js @@ -253,7 +253,7 @@ m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),m.vertex m.UNSIGNED_SHORT,0)):(c&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),m.drawElements(m.TRIANGLES,f.__webglFaceCount,m.UNSIGNED_SHORT,0)),S.info.render.calls++,S.info.render.vertices+=f.__webglFaceCount,S.info.render.faces+=f.__webglFaceCount/3):h instanceof THREE.Line?(h=h.type==THREE.LineStrip?m.LINE_STRIP:m.LINES,m.lineWidth(k.linewidth),m.drawArrays(h,0,f.__webglLineCount),S.info.render.calls++):h instanceof THREE.ParticleSystem?(m.drawArrays(m.POINTS,0,f.__webglParticleCount),S.info.render.calls++): h instanceof THREE.Ribbon&&(m.drawArrays(m.TRIANGLE_STRIP,0,f.__webglVertexCount),S.info.render.calls++)}}function h(a,c,b){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=m.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=m.createBuffer();a.hasPos&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(c.attributes.position),m.vertexAttribPointer(c.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormal){m.bindBuffer(m.ARRAY_BUFFER, a.__webglNormalBuffer);if(b==THREE.FlatShading){var e,f,k,h,l,n,p,t,o,v,u=a.count*3;for(v=0;v=0)c=c.geometry.materials[b],c.transparent?(a.transparent=c,a.opaque=null):(a.opaque=c,a.transparent=null)}else if(c=e)c.transparent?(a.transparent= c,a.opaque=null):(a.opaque=c,a.transparent=null)}function y(a,c){return c.z-a.z}function x(a){var c,b,n,p=0,o,v,G,w,x=a.lights;pa||(pa=new THREE.PerspectiveCamera(S.shadowCameraFov,S.shadowMapWidth/S.shadowMapHeight,S.shadowCameraNear,S.shadowCameraFar));c=0;for(b=x.length;c=0)b=b.geometry.materials[d],b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}else if(b=c)b.transparent?(a.transparent= b,a.opaque=null):(a.opaque=b,a.transparent=null)}function A(a,b){return b.z-a.z}function C(a){var b,c,k,m=0,K,l,u,v,q=a.lights;ra||(ra=new THREE.PerspectiveCamera(G.shadowCameraFov,G.shadowMapWidth/G.shadowMapHeight,G.shadowCameraNear,G.shadowCameraFar));b=0;for(c=q.length;b Date: Fri, 21 Oct 2011 13:42:28 +0200 Subject: [PATCH 30/33] More strict equality checking. Just for the sake of consistency, when object properties are not involved performance difference is negligible. --- build/Three.js | 130 ++++++++++++++++----------------- build/custom/ThreeWebGL.js | 56 +++++++------- src/renderers/WebGLRenderer.js | 102 +++++++++++++------------- 3 files changed, 144 insertions(+), 144 deletions(-) diff --git a/build/Three.js b/build/Three.js index bb28b021..9698b974 100644 --- a/build/Three.js +++ b/build/Three.js @@ -232,67 +232,67 @@ l;e++)f=h[e].position,za.copy(f),sa.multiplyVector3(za),u[e]=[za.z,e];u.sort(fun l.value[index];l.size===2?(l.array[h]=w.x,l.array[h+1]=w.y):l.size===3?l.type==="c"?(l.array[h]=w.r,l.array[h+1]=w.g,l.array[h+2]=w.b):(l.array[h]=w.x,l.array[h+1]=w.y,l.array[h+2]=w.z):(l.array[h]=w.x,l.array[h+1]=w.y,l.array[h+2]=w.z,l.array[h+3]=w.w)}l.offset+=l.size}}}}else{if(v)for(e=0;e=0)c&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglVertexBuffer),m.vertexAttribPointer(a.position,3,m.FLOAT,!1,0,0));else if(h.morphTargetBase){b=k.program.attributes;h.morphTargetBase!==-1?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[h.morphTargetBase]),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0)):b.position>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglVertexBuffer), -m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));if(h.morphTargetForcedOrder.length){l=0;var p=h.morphTargetForcedOrder;for(n=h.morphTargetInfluences;lt&&(o=v,t=n[o]);m.bindBuffer(m.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[o]);m.vertexAttribPointer(b["morphTarget"+l],3,m.FLOAT,!1,0,0);h.__webglMorphTargetInfluences[l]=t;p[o]=1;t=-1;l++}}k.program.uniforms.morphTargetInfluences!==null&&m.uniform1fv(k.program.uniforms.morphTargetInfluences,h.__webglMorphTargetInfluences)}if(c){if(f.__webglCustomAttributesList){l=0;for(n=f.__webglCustomAttributesList.length;l= -0&&(m.bindBuffer(m.ARRAY_BUFFER,b.buffer),m.vertexAttribPointer(a[b.buffer.belongsToAttribute],b.size,m.FLOAT,!1,0,0))}a.color>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglColorBuffer),m.vertexAttribPointer(a.color,3,m.FLOAT,!1,0,0));a.normal>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglNormalBuffer),m.vertexAttribPointer(a.normal,3,m.FLOAT,!1,0,0));a.tangent>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglTangentBuffer),m.vertexAttribPointer(a.tangent,4,m.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(m.bindBuffer(m.ARRAY_BUFFER, -f.__webglUVBuffer),m.vertexAttribPointer(a.uv,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(a.uv)):m.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglUV2Buffer),m.vertexAttribPointer(a.uv2,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(a.uv2)):m.disableVertexAttribArray(a.uv2));k.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinVertexABuffer),m.vertexAttribPointer(a.skinVertexA,4, -m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),m.vertexAttribPointer(a.skinVertexB,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),m.vertexAttribPointer(a.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),m.vertexAttribPointer(a.skinWeight,4,m.FLOAT,!1,0,0))}h instanceof THREE.Mesh?(k.wireframe?(m.lineWidth(k.wireframeLinewidth),c&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),m.drawElements(m.LINES,f.__webglLineCount, -m.UNSIGNED_SHORT,0)):(c&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),m.drawElements(m.TRIANGLES,f.__webglFaceCount,m.UNSIGNED_SHORT,0)),S.info.render.calls++,S.info.render.vertices+=f.__webglFaceCount,S.info.render.faces+=f.__webglFaceCount/3):h instanceof THREE.Line?(h=h.type==THREE.LineStrip?m.LINE_STRIP:m.LINES,m.lineWidth(k.linewidth),m.drawArrays(h,0,f.__webglLineCount),S.info.render.calls++):h instanceof THREE.ParticleSystem?(m.drawArrays(m.POINTS,0,f.__webglParticleCount),S.info.render.calls++): -h instanceof THREE.Ribbon&&(m.drawArrays(m.TRIANGLE_STRIP,0,f.__webglVertexCount),S.info.render.calls++)}}function h(a,c,b){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=m.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=m.createBuffer();a.hasPos&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),m.enableVertexAttribArray(c.attributes.position),m.vertexAttribPointer(c.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormal){m.bindBuffer(m.ARRAY_BUFFER, -a.__webglNormalBuffer);if(b==THREE.FlatShading){var e,f,k,h,l,n,p,t,o,v,u=a.count*3;for(v=0;v=0)c=c.geometry.materials[b],c.transparent?(a.transparent=c,a.opaque=null):(a.opaque=c,a.transparent=null)}else if(c=e)c.transparent?(a.transparent= -c,a.opaque=null):(a.opaque=c,a.transparent=null)}function y(a,c){return c.z-a.z}function x(a){var c,b,n,p=0,o,v,G,w,x=a.lights;pa||(pa=new THREE.PerspectiveCamera(S.shadowCameraFov,S.shadowMapWidth/S.shadowMapHeight,S.shadowCameraNear,S.shadowCameraFar));c=0;for(b=x.length;c=0;b--)a[b].object==c&&a.splice(b,1)}function K(a,c,b){a.push({buffer:c,object:b,opaque:null,transparent:null})}function F(a){if(a!=Z){switch(a){case THREE.AdditiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE);break;case THREE.SubtractiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:m.blendEquation(m.FUNC_ADD); -m.blendFunc(m.ZERO,m.SRC_COLOR);break;default:m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)}Z=a}}function M(a,c,b){(b.width&b.width-1)==0&&(b.height&b.height-1)==0?(m.texParameteri(a,m.TEXTURE_WRAP_S,T(c.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,T(c.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,T(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,T(c.minFilter)),m.generateMipmap(a)):(m.texParameteri(a,m.TEXTURE_WRAP_S, -m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,L(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,L(c.minFilter)))}function E(a,c){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=m.createTexture(),S.info.memory.textures++;m.activeTexture(m.TEXTURE0+c);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.image.width,a.image.height,0,T(a.format),m.UNSIGNED_BYTE, -a.image.data):m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,a.image);M(m.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)}function O(a,c){m.bindRenderbuffer(m.RENDERBUFFER,a);c.depthBuffer&&!c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):c.depthBuffer&&c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER, -m.DEPTH_STENCIL,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,c.width,c.height)}function V(a){var c=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=m.createTexture();if(c){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture); -M(m.TEXTURE_CUBE_MAP,a,a);for(var b=0;b<6;b++){a.__webglFramebuffer[b]=m.createFramebuffer();a.__webglRenderbuffer[b]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null);var e=a,f=m.TEXTURE_CUBE_MAP_POSITIVE_X+b;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[b]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,f,e.__webglTexture,0);O(a.__webglRenderbuffer[b],a)}}else a.__webglFramebuffer=m.createFramebuffer(), -a.__webglRenderbuffer=m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),M(m.TEXTURE_2D,a,a),m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null),b=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,b,a.__webglTexture,0),m.bindRenderbuffer(m.RENDERBUFFER,a.__webglRenderbuffer),O(a.__webglRenderbuffer,a);c?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null); -m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(c=c?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,b=a.width,a=a.height,f=e=0):(c=null,b=qa,a=la,e=na,f=fa);c!=ea&&(m.bindFramebuffer(m.FRAMEBUFFER,c),m.viewport(e,f,b,a),ea=c)}function H(a){a instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture), -m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function P(a,c){var b;a=="fragment"?b=m.createShader(m.FRAGMENT_SHADER):a=="vertex"&&(b=m.createShader(m.VERTEX_SHADER));m.shaderSource(b,c);m.compileShader(b);if(!m.getShaderParameter(b,m.COMPILE_STATUS))return console.error(m.getShaderInfoLog(b)),console.error(c),null;return b}function L(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return m.NEAREST;default:return m.LINEAR}} -function T(a){switch(a){case THREE.RepeatWrapping:return m.REPEAT;case THREE.ClampToEdgeWrapping:return m.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return m.MIRRORED_REPEAT;case THREE.NearestFilter:return m.NEAREST;case THREE.NearestMipMapNearestFilter:return m.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return m.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return m.LINEAR;case THREE.LinearMipMapNearestFilter:return m.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return m.LINEAR_MIPMAP_LINEAR; -case THREE.ByteType:return m.BYTE;case THREE.UnsignedByteType:return m.UNSIGNED_BYTE;case THREE.ShortType:return m.SHORT;case THREE.UnsignedShortType:return m.UNSIGNED_SHORT;case THREE.IntType:return m.INT;case THREE.UnsignedShortType:return m.UNSIGNED_INT;case THREE.FloatType:return m.FLOAT;case THREE.AlphaFormat:return m.ALPHA;case THREE.RGBFormat:return m.RGB;case THREE.RGBAFormat:return m.RGBA;case THREE.LuminanceFormat:return m.LUMINANCE;case THREE.LuminanceAlphaFormat:return m.LUMINANCE_ALPHA}return 0} -var S=this,m,aa=[],U=null,ea=null,da=-1,ia=null,ha=0,ja=null,ca=null,Z=null,R=null,Y=null,X=null,ga=null,oa=null,na=0,fa=0,qa=0,la=0,ua=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],sa=new THREE.Matrix4,Da=new Float32Array(16),Ea=new Float32Array(16),za=new THREE.Vector4,Fa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},xa=a.canvas!==void 0?a.canvas:document.createElement("canvas"), -G=a.stencil!==void 0?a.stencil:!0,$=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,ma=a.antialias!==void 0?a.antialias:!1,I=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),N=a.clearAlpha!==void 0?a.clearAlpha:0,ta=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=xa;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear= -!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var pa,ka=[],a=THREE.ShaderLib.depthRGBA,ya=THREE.UniformsUtils.clone(a.uniforms),va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya}), -Ca=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya,morphTargets:!0});va._shadowPass=!0;Ca._shadowPass=!0;try{if(!(m=xa.getContext("experimental-webgl",{antialias:ma,stencil:G,preserveDrawingBuffer:$})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+m.getParameter(m.VERSION)+" | "+m.getParameter(m.VENDOR)+" | "+m.getParameter(m.RENDERER)+" | "+m.getParameter(m.SHADING_LANGUAGE_VERSION))}catch(Ba){console.error(Ba)}m.clearColor(0, -0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.clearColor(I.r,I.g,I.b,N);this.context=m;var Ga=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,W={};W.vertices=new Float32Array(16);W.faces=new Uint16Array(6);G=0;W.vertices[G++]=-1;W.vertices[G++]=-1;W.vertices[G++]=0;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]= --1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=0;W.vertices[G++]=-1;W.vertices[G++]=1;W.vertices[G++]=0;G=W.vertices[G++]=0;W.faces[G++]=0;W.faces[G++]=1;W.faces[G++]=2;W.faces[G++]=0;W.faces[G++]=2;W.faces[G++]=3;W.vertexBuffer=m.createBuffer();W.elementBuffer=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,W.vertexBuffer);m.bufferData(m.ARRAY_BUFFER,W.vertices,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,W.elementBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER, -W.faces,m.STATIC_DRAW);W.program=m.createProgram();m.attachShader(W.program,P("fragment",THREE.ShaderLib.sprite.fragmentShader));m.attachShader(W.program,P("vertex",THREE.ShaderLib.sprite.vertexShader));m.linkProgram(W.program);W.attributes={};W.uniforms={};W.attributes.position=m.getAttribLocation(W.program,"position");W.attributes.uv=m.getAttribLocation(W.program,"uv");W.uniforms.uvOffset=m.getUniformLocation(W.program,"uvOffset");W.uniforms.uvScale=m.getUniformLocation(W.program,"uvScale");W.uniforms.rotation= -m.getUniformLocation(W.program,"rotation");W.uniforms.scale=m.getUniformLocation(W.program,"scale");W.uniforms.alignment=m.getUniformLocation(W.program,"alignment");W.uniforms.color=m.getUniformLocation(W.program,"color");W.uniforms.map=m.getUniformLocation(W.program,"map");W.uniforms.opacity=m.getUniformLocation(W.program,"opacity");W.uniforms.useScreenCoordinates=m.getUniformLocation(W.program,"useScreenCoordinates");W.uniforms.affectedByDistance=m.getUniformLocation(W.program,"affectedByDistance"); -W.uniforms.screenPosition=m.getUniformLocation(W.program,"screenPosition");W.uniforms.modelViewMatrix=m.getUniformLocation(W.program,"modelViewMatrix");W.uniforms.projectionMatrix=m.getUniformLocation(W.program,"projectionMatrix");var Ta=!1;this.setSize=function(a,c){xa.width=a;xa.height=c;this.setViewport(0,0,xa.width,xa.height)};this.setViewport=function(a,c,b,e){na=a;fa=c;qa=b;la=e;m.viewport(na,fa,qa,la)};this.setScissor=function(a,c,b,e){m.scissor(a,c,b,e)};this.enableScissorTest=function(a){a? -m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColorHex=function(a,c){I.setHex(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.setClearColor=function(a,c){I.copy(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.getClearColor=function(){return I};this.getClearAlpha=function(){return N};this.clear=function(a,c,b){var e=0;if(a==void 0||a)e|=m.COLOR_BUFFER_BIT;if(c==void 0||c)e|=m.DEPTH_BUFFER_BIT;if(b==void 0||b)e|=m.STENCIL_BUFFER_BIT;m.clear(e)};this.getContext=function(){return m};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(g in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[g];m.deleteBuffer(c.__webglVertexBuffer);m.deleteBuffer(c.__webglNormalBuffer);m.deleteBuffer(c.__webglTangentBuffer);m.deleteBuffer(c.__webglColorBuffer);m.deleteBuffer(c.__webglUVBuffer);m.deleteBuffer(c.__webglUV2Buffer);m.deleteBuffer(c.__webglSkinVertexABuffer); -m.deleteBuffer(c.__webglSkinVertexBBuffer);m.deleteBuffer(c.__webglSkinIndicesBuffer);m.deleteBuffer(c.__webglSkinWeightsBuffer);m.deleteBuffer(c.__webglFaceBuffer);m.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var b=0,e=c.numMorphTargets;b=0)c&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglVertexBuffer),m.vertexAttribPointer(a.position,3,m.FLOAT,!1,0,0));else if(h.morphTargetBase){b=k.program.attributes;h.morphTargetBase!==-1?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[h.morphTargetBase]),m.vertexAttribPointer(b.position, +3,m.FLOAT,!1,0,0)):b.position>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglVertexBuffer),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));if(h.morphTargetForcedOrder.length){l=0;var p=h.morphTargetForcedOrder;for(n=h.morphTargetInfluences;lt&&(o=v,t=n[o]);m.bindBuffer(m.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[o]);m.vertexAttribPointer(b["morphTarget"+l],3,m.FLOAT,!1,0,0);h.__webglMorphTargetInfluences[l]=t;p[o]=1;t=-1;l++}}k.program.uniforms.morphTargetInfluences!==null&&m.uniform1fv(k.program.uniforms.morphTargetInfluences,h.__webglMorphTargetInfluences)}if(c){if(f.__webglCustomAttributesList){l=0;for(n= +f.__webglCustomAttributesList.length;l=0&&(m.bindBuffer(m.ARRAY_BUFFER,b.buffer),m.vertexAttribPointer(a[b.buffer.belongsToAttribute],b.size,m.FLOAT,!1,0,0))}a.color>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglColorBuffer),m.vertexAttribPointer(a.color,3,m.FLOAT,!1,0,0));a.normal>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglNormalBuffer),m.vertexAttribPointer(a.normal,3,m.FLOAT,!1,0,0));a.tangent>=0&&(m.bindBuffer(m.ARRAY_BUFFER, +f.__webglTangentBuffer),m.vertexAttribPointer(a.tangent,4,m.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglUVBuffer),m.vertexAttribPointer(a.uv,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(a.uv)):m.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(m.bindBuffer(m.ARRAY_BUFFER,f.__webglUV2Buffer),m.vertexAttribPointer(a.uv2,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(a.uv2)):m.disableVertexAttribArray(a.uv2));k.skinning&&a.skinVertexA>=0&&a.skinVertexB>= +0&&a.skinIndex>=0&&a.skinWeight>=0&&(m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinVertexABuffer),m.vertexAttribPointer(a.skinVertexA,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),m.vertexAttribPointer(a.skinVertexB,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),m.vertexAttribPointer(a.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),m.vertexAttribPointer(a.skinWeight,4,m.FLOAT,!1,0,0))}h instanceof THREE.Mesh?(k.wireframe? +(m.lineWidth(k.wireframeLinewidth),c&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),m.drawElements(m.LINES,f.__webglLineCount,m.UNSIGNED_SHORT,0)):(c&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),m.drawElements(m.TRIANGLES,f.__webglFaceCount,m.UNSIGNED_SHORT,0)),S.info.render.calls++,S.info.render.vertices+=f.__webglFaceCount,S.info.render.faces+=f.__webglFaceCount/3):h instanceof THREE.Line?(h=h.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,m.lineWidth(k.linewidth),m.drawArrays(h, +0,f.__webglLineCount),S.info.render.calls++):h instanceof THREE.ParticleSystem?(m.drawArrays(m.POINTS,0,f.__webglParticleCount),S.info.render.calls++):h instanceof THREE.Ribbon&&(m.drawArrays(m.TRIANGLE_STRIP,0,f.__webglVertexCount),S.info.render.calls++)}}function h(a,c,b){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=m.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=m.createBuffer();a.hasPos&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray, +m.DYNAMIC_DRAW),m.enableVertexAttribArray(c.attributes.position),m.vertexAttribPointer(c.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormal){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(b===THREE.FlatShading){var e,f,k,h,l,n,p,t,o,v,u=a.count*3;for(v=0;v=0)c=c.geometry.materials[b],c.transparent?(a.transparent=c,a.opaque=null):(a.opaque=c,a.transparent=null)}else if(c=e)c.transparent?(a.transparent=c,a.opaque=null):(a.opaque=c,a.transparent=null)}function y(a,c){return c.z-a.z}function x(a){var c,b,n,p=0,o,v,G,w,x=a.lights;pa||(pa=new THREE.PerspectiveCamera(S.shadowCameraFov,S.shadowMapWidth/S.shadowMapHeight,S.shadowCameraNear,S.shadowCameraFar));c=0;for(b=x.length;c=0;b--)a[b].object===c&&a.splice(b,1)}function K(a,c,b){a.push({buffer:c,object:b,opaque:null,transparent:null})} +function F(a){if(a!==Z){switch(a){case THREE.AdditiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE);break;case THREE.SubtractiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.SRC_COLOR);break;default:m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)}Z=a}}function M(a,c,b){(b.width&b.width- +1)===0&&(b.height&b.height-1)===0?(m.texParameteri(a,m.TEXTURE_WRAP_S,T(c.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,T(c.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,T(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,T(c.minFilter)),m.generateMipmap(a)):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,L(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,L(c.minFilter)))}function E(a,c){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit= +!0,a.__webglTexture=m.createTexture(),S.info.memory.textures++;m.activeTexture(m.TEXTURE0+c);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.image.width,a.image.height,0,T(a.format),m.UNSIGNED_BYTE,a.image.data):m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,a.image);M(m.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)}function O(a,c){m.bindRenderbuffer(m.RENDERBUFFER, +a);c.depthBuffer&&!c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):c.depthBuffer&&c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,c.width,c.height)}function V(a){var c=a instanceof THREE.WebGLRenderTargetCube; +if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=m.createTexture();if(c){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);M(m.TEXTURE_CUBE_MAP,a,a);for(var b=0;b<6;b++){a.__webglFramebuffer[b]=m.createFramebuffer();a.__webglRenderbuffer[b]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type), +null);var e=a,f=m.TEXTURE_CUBE_MAP_POSITIVE_X+b;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[b]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,f,e.__webglTexture,0);O(a.__webglRenderbuffer[b],a)}}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),M(m.TEXTURE_2D,a,a),m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null),b=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER, +a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,b,a.__webglTexture,0),m.bindRenderbuffer(m.RENDERBUFFER,a.__webglRenderbuffer),O(a.__webglRenderbuffer,a);c?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(c=c?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,b=a.width,a=a.height,f=e=0):(c=null,b=qa,a=la,e=na,f=fa);c!==ea&&(m.bindFramebuffer(m.FRAMEBUFFER, +c),m.viewport(e,f,b,a),ea=c)}function H(a){a instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function P(a,c){var b;a==="fragment"?b=m.createShader(m.FRAGMENT_SHADER):a==="vertex"&&(b=m.createShader(m.VERTEX_SHADER));m.shaderSource(b,c);m.compileShader(b);if(!m.getShaderParameter(b, +m.COMPILE_STATUS))return console.error(m.getShaderInfoLog(b)),console.error(c),null;return b}function L(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return m.NEAREST;default:return m.LINEAR}}function T(a){switch(a){case THREE.RepeatWrapping:return m.REPEAT;case THREE.ClampToEdgeWrapping:return m.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return m.MIRRORED_REPEAT;case THREE.NearestFilter:return m.NEAREST;case THREE.NearestMipMapNearestFilter:return m.NEAREST_MIPMAP_NEAREST; +case THREE.NearestMipMapLinearFilter:return m.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return m.LINEAR;case THREE.LinearMipMapNearestFilter:return m.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return m.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return m.BYTE;case THREE.UnsignedByteType:return m.UNSIGNED_BYTE;case THREE.ShortType:return m.SHORT;case THREE.UnsignedShortType:return m.UNSIGNED_SHORT;case THREE.IntType:return m.INT;case THREE.UnsignedShortType:return m.UNSIGNED_INT;case THREE.FloatType:return m.FLOAT; +case THREE.AlphaFormat:return m.ALPHA;case THREE.RGBFormat:return m.RGB;case THREE.RGBAFormat:return m.RGBA;case THREE.LuminanceFormat:return m.LUMINANCE;case THREE.LuminanceAlphaFormat:return m.LUMINANCE_ALPHA}return 0}var S=this,m,aa=[],U=null,ea=null,da=-1,ia=null,ha=0,ja=null,ca=null,Z=null,R=null,Y=null,X=null,ga=null,oa=null,na=0,fa=0,qa=0,la=0,ua=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],sa=new THREE.Matrix4,Da=new Float32Array(16), +Ea=new Float32Array(16),za=new THREE.Vector4,Fa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},xa=a.canvas!==void 0?a.canvas:document.createElement("canvas"),G=a.stencil!==void 0?a.stencil:!0,$=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,ma=a.antialias!==void 0?a.antialias:!1,I=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),N=a.clearAlpha!==void 0?a.clearAlpha:0,ta=a.maxLights!==void 0? +a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=xa;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled= +!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var pa,ka=[],a=THREE.ShaderLib.depthRGBA,ya=THREE.UniformsUtils.clone(a.uniforms),va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya}),Ca=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya,morphTargets:!0});va._shadowPass=!0;Ca._shadowPass=!0;try{if(!(m=xa.getContext("experimental-webgl",{antialias:ma,stencil:G,preserveDrawingBuffer:$})))throw"Error creating WebGL context."; +console.log(navigator.userAgent+" | "+m.getParameter(m.VERSION)+" | "+m.getParameter(m.VENDOR)+" | "+m.getParameter(m.RENDERER)+" | "+m.getParameter(m.SHADING_LANGUAGE_VERSION))}catch(Ba){console.error(Ba)}m.clearColor(0,0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.clearColor(I.r,I.g,I.b,N);this.context= +m;var Ga=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,W={};W.vertices=new Float32Array(16);W.faces=new Uint16Array(6);G=0;W.vertices[G++]=-1;W.vertices[G++]=-1;W.vertices[G++]=0;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=-1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=0;W.vertices[G++]=-1;W.vertices[G++]=1;W.vertices[G++]=0;G=W.vertices[G++]=0;W.faces[G++]=0;W.faces[G++]=1;W.faces[G++]=2;W.faces[G++]=0;W.faces[G++]=2;W.faces[G++]= +3;W.vertexBuffer=m.createBuffer();W.elementBuffer=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,W.vertexBuffer);m.bufferData(m.ARRAY_BUFFER,W.vertices,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,W.elementBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,W.faces,m.STATIC_DRAW);W.program=m.createProgram();m.attachShader(W.program,P("fragment",THREE.ShaderLib.sprite.fragmentShader));m.attachShader(W.program,P("vertex",THREE.ShaderLib.sprite.vertexShader));m.linkProgram(W.program);W.attributes={};W.uniforms= +{};W.attributes.position=m.getAttribLocation(W.program,"position");W.attributes.uv=m.getAttribLocation(W.program,"uv");W.uniforms.uvOffset=m.getUniformLocation(W.program,"uvOffset");W.uniforms.uvScale=m.getUniformLocation(W.program,"uvScale");W.uniforms.rotation=m.getUniformLocation(W.program,"rotation");W.uniforms.scale=m.getUniformLocation(W.program,"scale");W.uniforms.alignment=m.getUniformLocation(W.program,"alignment");W.uniforms.color=m.getUniformLocation(W.program,"color");W.uniforms.map=m.getUniformLocation(W.program, +"map");W.uniforms.opacity=m.getUniformLocation(W.program,"opacity");W.uniforms.useScreenCoordinates=m.getUniformLocation(W.program,"useScreenCoordinates");W.uniforms.affectedByDistance=m.getUniformLocation(W.program,"affectedByDistance");W.uniforms.screenPosition=m.getUniformLocation(W.program,"screenPosition");W.uniforms.modelViewMatrix=m.getUniformLocation(W.program,"modelViewMatrix");W.uniforms.projectionMatrix=m.getUniformLocation(W.program,"projectionMatrix");var Ta=!1;this.setSize=function(a, +c){xa.width=a;xa.height=c;this.setViewport(0,0,xa.width,xa.height)};this.setViewport=function(a,c,b,e){na=a;fa=c;qa=b;la=e;m.viewport(na,fa,qa,la)};this.setScissor=function(a,c,b,e){m.scissor(a,c,b,e)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColorHex=function(a,c){I.setHex(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.setClearColor=function(a,c){I.copy(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.getClearColor=function(){return I};this.getClearAlpha= +function(){return N};this.clear=function(a,c,b){var e=0;if(a===void 0||a)e|=m.COLOR_BUFFER_BIT;if(c===void 0||c)e|=m.DEPTH_BUFFER_BIT;if(b===void 0||b)e|=m.STENCIL_BUFFER_BIT;m.clear(e)};this.getContext=function(){return m};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(g in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[g]; +m.deleteBuffer(c.__webglVertexBuffer);m.deleteBuffer(c.__webglNormalBuffer);m.deleteBuffer(c.__webglTangentBuffer);m.deleteBuffer(c.__webglColorBuffer);m.deleteBuffer(c.__webglUVBuffer);m.deleteBuffer(c.__webglUV2Buffer);m.deleteBuffer(c.__webglSkinVertexABuffer);m.deleteBuffer(c.__webglSkinVertexBBuffer);m.deleteBuffer(c.__webglSkinIndicesBuffer);m.deleteBuffer(c.__webglSkinWeightsBuffer);m.deleteBuffer(c.__webglFaceBuffer);m.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var b=0,e=c.numMorphTargets;b< +e;b++)m.deleteBuffer(c.__webglMorphTargetsBuffers[b]);S.info.memory.geometries--}else if(a instanceof THREE.Ribbon)a=a.geometry,m.deleteBuffer(a.__webglVertexBuffer),m.deleteBuffer(a.__webglColorBuffer),S.info.memory.geometries--;else if(a instanceof THREE.Line)a=a.geometry,m.deleteBuffer(a.__webglVertexBuffer),m.deleteBuffer(a.__webglColorBuffer),S.info.memory.geometries--;else if(a instanceof THREE.ParticleSystem)a=a.geometry,m.deleteBuffer(a.__webglVertexBuffer),m.deleteBuffer(a.__webglColorBuffer), +S.info.memory.geometries--};this.deallocateTexture=function(a){if(a.__webglInit)a.__webglInit=!1,m.deleteTexture(a.__webglTexture),S.info.memory.textures--};this.initMaterial=function(a,c,b,e){var f,k,h,l;a instanceof THREE.MeshDepthMaterial?l="depth":a instanceof THREE.MeshNormalMaterial?l="normal":a instanceof THREE.MeshBasicMaterial?l="basic":a instanceof THREE.MeshLambertMaterial?l="lambert":a instanceof THREE.MeshPhongMaterial?l="phong":a instanceof THREE.LineBasicMaterial?l="basic":a instanceof +THREE.ParticleBasicMaterial&&(l="particle_basic");if(l){var n=THREE.ShaderLib[l];a.uniforms=THREE.UniformsUtils.clone(n.uniforms);a.vertexShader=n.vertexShader;a.fragmentShader=n.fragmentShader}var p,t,o;p=o=n=0;for(t=c.length;p=0;G--)if(B=a.__webglObjects[G],B.render&&(I=B.object,K=B.buffer,$=B.opaque))k(I),l($.depthTest),n($.depthWrite),p($.polygonOffset,$.polygonOffsetFactor,$.polygonOffsetUnits),f(c,E,na,$,K, I);for(G=0;G65535&&(G[v].counter+=1,u=G[v].hash+"_"+G[v].counter,l.geometryGroups[u]==void 0&&(l.geometryGroups[u]= +[],a.__webglObjectsImmediate=[],a.__webglSprites=[];for(;a.__objectsAdded.length;){var e=a.__objectsAdded[0],f=a,k=void 0,h=void 0,l=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){h=e.geometry;if(h.geometryGroups===void 0){var l=h,n=void 0,p=void 0,t=void 0,o=void 0, +v=t=void 0,u=void 0,G={},w=l.morphTargets!==void 0?l.morphTargets.length:0;l.geometryGroups={};n=0;for(p=l.faces.length;n65535&&(G[v].counter+=1,u=G[v].hash+"_"+G[v].counter,l.geometryGroups[u]===void 0&&(l.geometryGroups[u]= {faces:[],materialIndex:o,vertices:0,numMorphTargets:w})),l.geometryGroups[u].faces.push(n),l.geometryGroups[u].vertices+=t;l.geometryGroupsList=[];n=void 0;for(n in l.geometryGroups)l.geometryGroups[n].id=ha++,l.geometryGroupsList.push(l.geometryGroups[n])}for(k in h.geometryGroups)if(l=h.geometryGroups[k],!l.__webglVertexBuffer){n=l;n.__webglVertexBuffer=m.createBuffer();n.__webglNormalBuffer=m.createBuffer();n.__webglTangentBuffer=m.createBuffer();n.__webglColorBuffer=m.createBuffer();n.__webglUVBuffer= m.createBuffer();n.__webglUV2Buffer=m.createBuffer();n.__webglSkinVertexABuffer=m.createBuffer();n.__webglSkinVertexBBuffer=m.createBuffer();n.__webglSkinIndicesBuffer=m.createBuffer();n.__webglSkinWeightsBuffer=m.createBuffer();n.__webglFaceBuffer=m.createBuffer();n.__webglLineBuffer=m.createBuffer();if(n.numMorphTargets){o=p=void 0;n.__webglMorphTargetsBuffers=[];p=0;for(o=n.numMorphTargets;p0||w.faceVertexUvs.length>0)l.__uvArray=new Float32Array(n*2);if(w.faceUvs.length>1||w.faceVertexUvs.length>1)l.__uv2Array=new Float32Array(n*2)}if(o.geometry.skinWeights.length&&o.geometry.skinIndices.length)l.__skinVertexAArray=new Float32Array(n*4),l.__skinVertexBArray=new Float32Array(n* -4),l.__skinIndexArray=new Float32Array(n*4),l.__skinWeightArray=new Float32Array(n*4);l.__faceArray=new Uint16Array(v*3);l.__lineArray=new Uint16Array(u*2);if(l.numMorphTargets){l.__morphTargetsArrays=[];w=0;for(x=l.numMorphTargets;w=0;h--)f[h]==k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&B(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e=0;h--)f[h]===k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&B(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,da,v));Fa&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglNormalBuffer),m.bufferData(m.ARRAY_BUFFER,ya,v));xa&&sa.hasTangents&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglTangentBuffer),m.bufferData(m.ARRAY_BUFFER,aa,v));za&&qa>0&&(m.bindBuffer(m.ARRAY_BUFFER, o.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,ia,v));za&&Y>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,ua,v));Ea&&(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,Ca,v),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,va,v));Q>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexABuffer),m.bufferData(m.ARRAY_BUFFER,ga,v),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexBBuffer), @@ -342,7 +342,7 @@ m.bufferData(m.ARRAY_BUFFER,ea,v),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinIndic !1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(l,h)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;l=m.DYNAMIC_DRAW;n=G=u=u=void 0;w=h.vertices;p=h.colors;t=w.length;o=p.length;y=h.__vertexArray;v=h.__colorArray;ma=h.__dirtyColors;if(h.__dirtyVertices){for(u=0;u=0)b&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),d.vertexAttribPointer(a.position,3,d.FLOAT,!1,0,0));else if(i.morphTargetBase){c=h.program.attributes;i.morphTargetBase!==-1?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[i.morphTargetBase]),d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0)):c.position>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer), +d.uniformMatrix4fv(i.viewMatrix,!1,Ua);e.skinning&&(d.uniformMatrix4fv(i.cameraInverseMatrix,!1,Ua),d.uniformMatrix4fv(i.boneGlobalMatrices,!1,h.boneMatrices))}d.uniformMatrix4fv(i.modelViewMatrix,!1,h._modelViewMatrixArray);i.normalMatrix&&d.uniformMatrix3fv(i.normalMatrix,!1,h._normalMatrixArray);(e instanceof THREE.ShaderMaterial||e.envMap||e.skinning||h.receiveShadow)&&i.objectMatrix!==null&&d.uniformMatrix4fv(i.objectMatrix,!1,h._objectMatrixArray);return f}function f(a,b,c,h,f,i){if(h.opacity!== +0){var j,u,c=e(a,b,c,h,i),a=c.attributes,b=!1,c=f.id*16777215+c.id*2+(h.wireframe?1:0);c!==R&&(R=c,b=!0);if(!h.morphTargets&&a.position>=0)b&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),d.vertexAttribPointer(a.position,3,d.FLOAT,!1,0,0));else if(i.morphTargetBase){c=h.program.attributes;i.morphTargetBase!==-1?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[i.morphTargetBase]),d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0)):c.position>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer), d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var v=i.morphTargetForcedOrder;for(u=i.morphTargetInfluences;jq&&(k=m,q=u[k]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[k]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=q;v[k]=1;q=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(u=f.__webglCustomAttributesList.length;j= 0&&(d.bindBuffer(d.ARRAY_BUFFER,c.buffer),d.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,d.FLOAT,!1,0,0))}a.color>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglColorBuffer),d.vertexAttribPointer(a.color,3,d.FLOAT,!1,0,0));a.normal>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglNormalBuffer),d.vertexAttribPointer(a.normal,3,d.FLOAT,!1,0,0));a.tangent>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglTangentBuffer),d.vertexAttribPointer(a.tangent,4,d.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(d.bindBuffer(d.ARRAY_BUFFER, f.__webglUVBuffer),d.vertexAttribPointer(a.uv,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv)):d.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglUV2Buffer),d.vertexAttribPointer(a.uv2,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv2)):d.disableVertexAttribArray(a.uv2));h.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexABuffer),d.vertexAttribPointer(a.skinVertexA,4, d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),d.vertexAttribPointer(a.skinVertexB,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),d.vertexAttribPointer(a.skinIndex,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),d.vertexAttribPointer(a.skinWeight,4,d.FLOAT,!1,0,0))}i instanceof THREE.Mesh?(h.wireframe?(d.lineWidth(h.wireframeLinewidth),b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),d.drawElements(d.LINES,f.__webglLineCount, -d.UNSIGNED_SHORT,0)):(b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),d.drawElements(d.TRIANGLES,f.__webglFaceCount,d.UNSIGNED_SHORT,0)),G.info.render.calls++,G.info.render.vertices+=f.__webglFaceCount,G.info.render.faces+=f.__webglFaceCount/3):i instanceof THREE.Line?(i=i.type==THREE.LineStrip?d.LINE_STRIP:d.LINES,d.lineWidth(h.linewidth),d.drawArrays(i,0,f.__webglLineCount),G.info.render.calls++):i instanceof THREE.ParticleSystem?(d.drawArrays(d.POINTS,0,f.__webglParticleCount),G.info.render.calls++): +d.UNSIGNED_SHORT,0)):(b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),d.drawElements(d.TRIANGLES,f.__webglFaceCount,d.UNSIGNED_SHORT,0)),G.info.render.calls++,G.info.render.vertices+=f.__webglFaceCount,G.info.render.faces+=f.__webglFaceCount/3):i instanceof THREE.Line?(i=i.type===THREE.LineStrip?d.LINE_STRIP:d.LINES,d.lineWidth(h.linewidth),d.drawArrays(i,0,f.__webglLineCount),G.info.render.calls++):i instanceof THREE.ParticleSystem?(d.drawArrays(d.POINTS,0,f.__webglParticleCount),G.info.render.calls++): i instanceof THREE.Ribbon&&(d.drawArrays(d.TRIANGLE_STRIP,0,f.__webglVertexCount),G.info.render.calls++)}}function h(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=d.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=d.createBuffer();a.hasPos&&(d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,a.positionArray,d.DYNAMIC_DRAW),d.enableVertexAttribArray(b.attributes.position),d.vertexAttribPointer(b.attributes.position,3,d.FLOAT,!1,0,0));if(a.hasNormal){d.bindBuffer(d.ARRAY_BUFFER, -a.__webglNormalBuffer);if(c==THREE.FlatShading){var e,f,h,i,j,v,k,m,p,o,l=a.count*3;for(o=0;o=0)b=b.geometry.materials[d],b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}else if(b=c)b.transparent?(a.transparent= b,a.opaque=null):(a.opaque=b,a.transparent=null)}function A(a,b){return b.z-a.z}function C(a){var b,c,k,m=0,K,l,u,v,q=a.lights;ra||(ra=new THREE.PerspectiveCamera(G.shadowCameraFov,G.shadowMapWidth/G.shadowMapHeight,G.shadowCameraNear,G.shadowCameraFar));b=0;for(c=q.length;b=0;d--)a[d].object==b&&a.splice(d,1)}function qa(a,b,d){a.push({buffer:b,object:d,opaque:null,transparent:null})}function N(a){if(a!=ka){switch(a){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE);break;case THREE.SubtractiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.ONE_MINUS_SRC_COLOR);break; -case THREE.MultiplyBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.SRC_COLOR);break;default:d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}ka=a}}function F(a,b,c){(c.width&c.width-1)==0&&(c.height&c.height-1)==0?(d.texParameteri(a,d.TEXTURE_WRAP_S,Q(b.wrapS)),d.texParameteri(a,d.TEXTURE_WRAP_T,Q(b.wrapT)),d.texParameteri(a,d.TEXTURE_MAG_FILTER,Q(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,Q(b.minFilter)), +return!1}function wa(a,d){var c=b(d,a);if(c.attributes)for(var e in c.attributes)c.attributes[e].needsUpdate=!1}function pa(a,b){var d;for(d=a.length-1;d>=0;d--)a[d].object===b&&a.splice(d,1)}function qa(a,b,d){a.push({buffer:b,object:d,opaque:null,transparent:null})}function N(a){if(a!==ka){switch(a){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE);break;case THREE.SubtractiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.ONE_MINUS_SRC_COLOR);break; +case THREE.MultiplyBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.SRC_COLOR);break;default:d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}ka=a}}function F(a,b,c){(c.width&c.width-1)===0&&(c.height&c.height-1)===0?(d.texParameteri(a,d.TEXTURE_WRAP_S,Q(b.wrapS)),d.texParameteri(a,d.TEXTURE_WRAP_T,Q(b.wrapT)),d.texParameteri(a,d.TEXTURE_MAG_FILTER,Q(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,Q(b.minFilter)), d.generateMipmap(a)):(d.texParameteri(a,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_MAG_FILTER,xa(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,xa(b.minFilter)))}function z(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=d.createTexture(),G.info.memory.textures++;d.activeTexture(d.TEXTURE0+b);d.bindTexture(d.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?d.texImage2D(d.TEXTURE_2D,0, Q(a.format),a.image.width,a.image.height,0,Q(a.format),d.UNSIGNED_BYTE,a.image.data):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,a.image);F(d.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+b),d.bindTexture(d.TEXTURE_2D,a.__webglTexture)}function W(a,b){d.bindRenderbuffer(d.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER, a)):b.depthBuffer&&b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,a)):d.renderbufferStorage(d.RENDERBUFFER,d.RGBA4,b.width,b.height)}function U(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=d.createTexture();if(b){a.__webglFramebuffer=[]; a.__webglRenderbuffer=[];d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture);F(d.TEXTURE_CUBE_MAP,a,a);for(var c=0;c<6;c++){a.__webglFramebuffer[c]=d.createFramebuffer();a.__webglRenderbuffer[c]=d.createRenderbuffer();d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null);var e=a,f=d.TEXTURE_CUBE_MAP_POSITIVE_X+c;d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer[c]);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,f,e.__webglTexture,0); W(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=d.createFramebuffer(),a.__webglRenderbuffer=d.createRenderbuffer(),d.bindTexture(d.TEXTURE_2D,a.__webglTexture),F(d.TEXTURE_2D,a,a),d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null),c=d.TEXTURE_2D,d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,c,a.__webglTexture,0),d.bindRenderbuffer(d.RENDERBUFFER,a.__webglRenderbuffer),W(a.__webglRenderbuffer, -a);b?d.bindTexture(d.TEXTURE_CUBE_MAP,null):d.bindTexture(d.TEXTURE_2D,null);d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=e=0):(b=null,c=Ca,a=ya,e=Ha,f=Aa);b!=ua&&(d.bindFramebuffer(d.FRAMEBUFFER,b),d.viewport(e,f,c,a),ua=b)}function ja(a){a instanceof THREE.WebGLRenderTargetCube?(d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture),d.generateMipmap(d.TEXTURE_CUBE_MAP),d.bindTexture(d.TEXTURE_CUBE_MAP, -null)):(d.bindTexture(d.TEXTURE_2D,a.__webglTexture),d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null))}function $(a,b){var c;a=="fragment"?c=d.createShader(d.FRAGMENT_SHADER):a=="vertex"&&(c=d.createShader(d.VERTEX_SHADER));d.shaderSource(c,b);d.compileShader(c);if(!d.getShaderParameter(c,d.COMPILE_STATUS))return console.error(d.getShaderInfoLog(c)),console.error(b),null;return c}function xa(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST; +a);b?d.bindTexture(d.TEXTURE_CUBE_MAP,null):d.bindTexture(d.TEXTURE_2D,null);d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=e=0):(b=null,c=Ca,a=ya,e=Ha,f=Aa);b!==ua&&(d.bindFramebuffer(d.FRAMEBUFFER,b),d.viewport(e,f,c,a),ua=b)}function ja(a){a instanceof THREE.WebGLRenderTargetCube?(d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture),d.generateMipmap(d.TEXTURE_CUBE_MAP),d.bindTexture(d.TEXTURE_CUBE_MAP, +null)):(d.bindTexture(d.TEXTURE_2D,a.__webglTexture),d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null))}function $(a,b){var c;a==="fragment"?c=d.createShader(d.FRAGMENT_SHADER):a==="vertex"&&(c=d.createShader(d.VERTEX_SHADER));d.shaderSource(c,b);d.compileShader(c);if(!d.getShaderParameter(c,d.COMPILE_STATUS))return console.error(d.getShaderInfoLog(c)),console.error(b),null;return c}function xa(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST; default:return d.LINEAR}}function Q(a){switch(a){case THREE.RepeatWrapping:return d.REPEAT;case THREE.ClampToEdgeWrapping:return d.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return d.MIRRORED_REPEAT;case THREE.NearestFilter:return d.NEAREST;case THREE.NearestMipMapNearestFilter:return d.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return d.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return d.LINEAR;case THREE.LinearMipMapNearestFilter:return d.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return d.LINEAR_MIPMAP_LINEAR; case THREE.ByteType:return d.BYTE;case THREE.UnsignedByteType:return d.UNSIGNED_BYTE;case THREE.ShortType:return d.SHORT;case THREE.UnsignedShortType:return d.UNSIGNED_SHORT;case THREE.IntType:return d.INT;case THREE.UnsignedShortType:return d.UNSIGNED_INT;case THREE.FloatType:return d.FLOAT;case THREE.AlphaFormat:return d.ALPHA;case THREE.RGBFormat:return d.RGB;case THREE.RGBAFormat:return d.RGBA;case THREE.LuminanceFormat:return d.LUMINANCE;case THREE.LuminanceAlphaFormat:return d.LUMINANCE_ALPHA}return 0} var G=this,d,ta=[],Wa=null,ua=null,J=-1,R=null,S=0,T=null,X=null,ka=null,aa=null,O=null,za=null,La=null,Ra=null,Ha=0,Aa=0,Ca=0,ya=0,ha=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Da=new THREE.Matrix4,Ta=new Float32Array(16),Ua=new Float32Array(16),Ja=new THREE.Vector4,Ya={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},Ba=a.canvas!==void 0?a.canvas:document.createElement("canvas"), @@ -236,14 +236,14 @@ r.vertices[I++]=-1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.verti d.bufferData(d.ELEMENT_ARRAY_BUFFER,r.faces,d.STATIC_DRAW);r.program=d.createProgram();d.attachShader(r.program,$("fragment",THREE.ShaderLib.sprite.fragmentShader));d.attachShader(r.program,$("vertex",THREE.ShaderLib.sprite.vertexShader));d.linkProgram(r.program);r.attributes={};r.uniforms={};r.attributes.position=d.getAttribLocation(r.program,"position");r.attributes.uv=d.getAttribLocation(r.program,"uv");r.uniforms.uvOffset=d.getUniformLocation(r.program,"uvOffset");r.uniforms.uvScale=d.getUniformLocation(r.program, "uvScale");r.uniforms.rotation=d.getUniformLocation(r.program,"rotation");r.uniforms.scale=d.getUniformLocation(r.program,"scale");r.uniforms.alignment=d.getUniformLocation(r.program,"alignment");r.uniforms.color=d.getUniformLocation(r.program,"color");r.uniforms.map=d.getUniformLocation(r.program,"map");r.uniforms.opacity=d.getUniformLocation(r.program,"opacity");r.uniforms.useScreenCoordinates=d.getUniformLocation(r.program,"useScreenCoordinates");r.uniforms.affectedByDistance=d.getUniformLocation(r.program, "affectedByDistance");r.uniforms.screenPosition=d.getUniformLocation(r.program,"screenPosition");r.uniforms.modelViewMatrix=d.getUniformLocation(r.program,"modelViewMatrix");r.uniforms.projectionMatrix=d.getUniformLocation(r.program,"projectionMatrix");var $a=!1;this.setSize=function(a,b){Ba.width=a;Ba.height=b;this.setViewport(0,0,Ba.width,Ba.height)};this.setViewport=function(a,b,c,e){Ha=a;Aa=b;Ca=c;ya=e;d.viewport(Ha,Aa,Ca,ya)};this.setScissor=function(a,b,c,e){d.scissor(a,b,c,e)};this.enableScissorTest= -function(a){a?d.enable(d.SCISSOR_TEST):d.disable(d.SCISSOR_TEST)};this.setClearColorHex=function(a,b){Y.setHex(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.setClearColor=function(a,b){Y.copy(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.getClearColor=function(){return Y};this.getClearAlpha=function(){return Fa};this.clear=function(a,b,c){var e=0;if(a==void 0||a)e|=d.COLOR_BUFFER_BIT;if(b==void 0||b)e|=d.DEPTH_BUFFER_BIT;if(c==void 0||c)e|=d.STENCIL_BUFFER_BIT;d.clear(e)};this.getContext=function(){return d}; +function(a){a?d.enable(d.SCISSOR_TEST):d.disable(d.SCISSOR_TEST)};this.setClearColorHex=function(a,b){Y.setHex(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.setClearColor=function(a,b){Y.copy(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.getClearColor=function(){return Y};this.getClearAlpha=function(){return Fa};this.clear=function(a,b,c){var e=0;if(a===void 0||a)e|=d.COLOR_BUFFER_BIT;if(b===void 0||b)e|=d.DEPTH_BUFFER_BIT;if(c===void 0||c)e|=d.STENCIL_BUFFER_BIT;d.clear(e)};this.getContext=function(){return d}; 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(g in a.geometry.geometryGroups){var b=a.geometry.geometryGroups[g];d.deleteBuffer(b.__webglVertexBuffer);d.deleteBuffer(b.__webglNormalBuffer);d.deleteBuffer(b.__webglTangentBuffer);d.deleteBuffer(b.__webglColorBuffer);d.deleteBuffer(b.__webglUVBuffer);d.deleteBuffer(b.__webglUV2Buffer);d.deleteBuffer(b.__webglSkinVertexABuffer); d.deleteBuffer(b.__webglSkinVertexBBuffer);d.deleteBuffer(b.__webglSkinIndicesBuffer);d.deleteBuffer(b.__webglSkinWeightsBuffer);d.deleteBuffer(b.__webglFaceBuffer);d.deleteBuffer(b.__webglLineBuffer);if(b.numMorphTargets)for(var c=0,e=b.numMorphTargets;c=0;r--)if(v=a.__webglObjects[r],v.render&&(q=v.object,z=v.buffer,K=v.opaque))i(q),j(K.depthTest),m(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),f(b,Pa,Qa, K,z,q);for(r=0;r65535&&(r[l].counter+=1,p=r[l].hash+"_"+r[l].counter,j.geometryGroups[p]==void 0&&(j.geometryGroups[p]= +[],a.__webglObjectsImmediate=[],a.__webglSprites=[];for(;a.__objectsAdded.length;){var e=a.__objectsAdded[0],f=a,h=void 0,i=void 0,j=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){i=e.geometry;if(i.geometryGroups===void 0){var j=i,k=void 0,m=void 0,o=void 0,q=void 0, +l=o=void 0,p=void 0,r={},t=j.morphTargets!==void 0?j.morphTargets.length:0;j.geometryGroups={};k=0;for(m=j.faces.length;k65535&&(r[l].counter+=1,p=r[l].hash+"_"+r[l].counter,j.geometryGroups[p]===void 0&&(j.geometryGroups[p]= {faces:[],materialIndex:q,vertices:0,numMorphTargets:t})),j.geometryGroups[p].faces.push(k),j.geometryGroups[p].vertices+=o;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=S++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer=d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=d.createBuffer();k.__webglUVBuffer= d.createBuffer();k.__webglUV2Buffer=d.createBuffer();k.__webglSkinVertexABuffer=d.createBuffer();k.__webglSkinVertexBBuffer=d.createBuffer();k.__webglSkinIndicesBuffer=d.createBuffer();k.__webglSkinWeightsBuffer=d.createBuffer();k.__webglFaceBuffer=d.createBuffer();k.__webglLineBuffer=d.createBuffer();if(k.numMorphTargets){q=m=void 0;k.__webglMorphTargetsBuffers=[];m=0;for(q=k.numMorphTargets;m0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(k*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(k*2)}if(q.geometry.skinWeights.length&&q.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(k*4),j.__skinVertexBArray=new Float32Array(k*4), -j.__skinIndexArray=new Float32Array(k*4),j.__skinWeightArray=new Float32Array(k*4);j.__faceArray=new Uint16Array(l*3);j.__lineArray=new Uint16Array(p*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(z=j.numMorphTargets;t=0;i--)f[i]==h&&f.splice(i,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&pa(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e=0;i--)f[i]===h&&f.splice(i,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&pa(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,oa,l));za&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER,W,l));Aa&&sa.hasTangents&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglTangentBuffer),d.bufferData(d.ARRAY_BUFFER,ca,l));ta&&X>0&&(d.bindBuffer(d.ARRAY_BUFFER, q.__webglUVBuffer),d.bufferData(d.ARRAY_BUFFER,ja,l));ta&&$>0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglUV2Buffer),d.bufferData(d.ARRAY_BUFFER,ka,l));ya&&(d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,ha,l),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webglLineBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,Y,l));x>0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinVertexABuffer),d.bufferData(d.ARRAY_BUFFER,da,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinVertexBBuffer), d.bufferData(d.ARRAY_BUFFER,ea,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinIndicesBuffer),d.bufferData(d.ARRAY_BUFFER,fa,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinWeightsBuffer),d.bufferData(d.ARRAY_BUFFER,ga,l));p&&(delete q.__inittedArrays,delete q.__colorArray,delete q.__normalArray,delete q.__tangentArray,delete q.__uvArray,delete q.__uv2Array,delete q.__faceArray,delete q.__vertexArray,delete q.__lineArray,delete q.__skinVertexAArray,delete q.__skinVertexBArray,delete q.__skinIndexArray,delete q.__skinWeightArray)}h.__dirtyVertices= !1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;wa(j,i)}else if(i instanceof THREE.Ribbon){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=r=p=p=void 0;t=i.vertices;m=i.colors;o=t.length;q=m.length;A=i.__vertexArray;l=i.__colorArray;C=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p= 0; o -- ) { - if ( objlist[ o ].object == object ) { + if ( objlist[ o ].object === object ) { objlist.splice( o, 1 ); @@ -4583,7 +4583,7 @@ THREE.WebGLRenderer = function ( parameters ) { for ( o = objlist.length - 1; o >= 0; o -- ) { - if ( objlist[ o ] == object ) { + if ( objlist[ o ] === object ) { objlist.splice( o, 1 ); @@ -4630,7 +4630,7 @@ THREE.WebGLRenderer = function ( parameters ) { mhash = ( materialIndex !== undefined ) ? materialIndex : -1; - if ( hash_map[ mhash ] == undefined ) { + if ( hash_map[ mhash ] === undefined ) { hash_map[ mhash ] = { 'hash': mhash, 'counter': 0 }; @@ -4638,7 +4638,7 @@ THREE.WebGLRenderer = function ( parameters ) { ghash = hash_map[ mhash ].hash + '_' + hash_map[ mhash ].counter; - if ( geometry.geometryGroups[ ghash ] == undefined ) { + if ( geometry.geometryGroups[ ghash ] === undefined ) { geometry.geometryGroups[ ghash ] = { 'faces': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets }; @@ -4651,7 +4651,7 @@ THREE.WebGLRenderer = function ( parameters ) { hash_map[ mhash ].counter += 1; ghash = hash_map[ mhash ].hash + '_' + hash_map[ mhash ].counter; - if ( geometry.geometryGroups[ ghash ] == undefined ) { + if ( geometry.geometryGroups[ ghash ] === undefined ) { geometry.geometryGroups[ ghash ] = { 'faces': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets }; @@ -4705,7 +4705,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( cullFace ) { - if ( !frontFace || frontFace == "ccw" ) { + if ( !frontFace || frontFace === "ccw" ) { _gl.frontFace( _gl.CCW ); @@ -4715,11 +4715,11 @@ THREE.WebGLRenderer = function ( parameters ) { } - if( cullFace == "back" ) { + if( cullFace === "back" ) { _gl.cullFace( _gl.BACK ); - } else if( cullFace == "front" ) { + } else if( cullFace === "front" ) { _gl.cullFace( _gl.FRONT ); @@ -4782,7 +4782,7 @@ THREE.WebGLRenderer = function ( parameters ) { for ( p = 0, pl = _programs.length; p < pl; p ++ ) { - if ( _programs[ p ].code == code ) { + if ( _programs[ p ].code === code ) { // console.log( "Code already compiled." /*: \n\n" + code*/ ); @@ -5015,55 +5015,55 @@ THREE.WebGLRenderer = function ( parameters ) { // single integer - if( type == "i" ) { + if( type === "i" ) { _gl.uniform1i( location, value ); // single float - } else if( type == "f" ) { + } else if( type === "f" ) { _gl.uniform1f( location, value ); // single THREE.Vector2 - } else if( type == "v2" ) { + } else if( type === "v2" ) { _gl.uniform2f( location, value.x, value.y ); // single THREE.Vector3 - } else if( type == "v3" ) { + } else if( type === "v3" ) { _gl.uniform3f( location, value.x, value.y, value.z ); // single THREE.Vector4 - } else if( type == "v4" ) { + } else if( type === "v4" ) { _gl.uniform4f( location, value.x, value.y, value.z, value.w ); // single THREE.Color - } else if( type == "c" ) { + } else if( type === "c" ) { _gl.uniform3f( location, value.r, value.g, value.b ); // flat array of floats (JS or typed array) - } else if( type == "fv1" ) { + } else if( type === "fv1" ) { _gl.uniform1fv( location, value ); // flat array of floats with 3 x N size (JS or typed array) - } else if( type == "fv" ) { + } else if( type === "fv" ) { _gl.uniform3fv( location, value ); // array of THREE.Vector3 - } else if( type == "v3v" ) { + } else if( type === "v3v" ) { if ( ! uniform._array ) { @@ -5085,7 +5085,7 @@ THREE.WebGLRenderer = function ( parameters ) { // single THREE.Matrix4 - } else if( type == "m4" ) { + } else if( type === "m4" ) { if ( ! uniform._array ) { @@ -5098,7 +5098,7 @@ THREE.WebGLRenderer = function ( parameters ) { // array of THREE.Matrix4 - } else if( type == "m4v" ) { + } else if( type === "m4v" ) { if ( ! uniform._array ) { @@ -5117,7 +5117,7 @@ THREE.WebGLRenderer = function ( parameters ) { // single THREE.Texture (2d or cube) - } else if( type == "t" ) { + } else if( type === "t" ) { _gl.uniform1i( location, value ); @@ -5125,7 +5125,7 @@ THREE.WebGLRenderer = function ( parameters ) { if ( !texture ) continue; - if ( texture.image instanceof Array && texture.image.length == 6 ) { + if ( texture.image instanceof Array && texture.image.length === 6 ) { setCubeTexture( texture, value ); @@ -5141,7 +5141,7 @@ THREE.WebGLRenderer = function ( parameters ) { // array of THREE.Texture (2d) - } else if( type == "tv" ) { + } else if( type === "tv" ) { if ( ! uniform._array ) { @@ -5175,7 +5175,7 @@ THREE.WebGLRenderer = function ( parameters ) { function setBlending( blending ) { - if ( blending != _oldBlending ) { + if ( blending !== _oldBlending ) { switch ( blending ) { @@ -5284,7 +5284,7 @@ THREE.WebGLRenderer = function ( parameters ) { function setCubeTexture( texture, slot ) { - if ( texture.image.length == 6 ) { + if ( texture.image.length === 6 ) { if ( texture.needsUpdate ) { @@ -5461,7 +5461,7 @@ THREE.WebGLRenderer = function ( parameters ) { } - if ( framebuffer != _currentFramebuffer ) { + if ( framebuffer !== _currentFramebuffer ) { _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); _gl.viewport( vx, vy, width, height ); @@ -5520,11 +5520,11 @@ THREE.WebGLRenderer = function ( parameters ) { var shader; - if ( type == "fragment" ) { + if ( type === "fragment" ) { shader = _gl.createShader( _gl.FRAGMENT_SHADER ); - } else if ( type == "vertex" ) { + } else if ( type === "vertex" ) { shader = _gl.createShader( _gl.VERTEX_SHADER ); @@ -5604,13 +5604,13 @@ THREE.WebGLRenderer = function ( parameters ) { function isPowerOfTwo( value ) { - return ( value & ( value - 1 ) ) == 0; + return ( value & ( value - 1 ) ) === 0; }; function materialNeedsSmoothNormals( material ) { - return material && material.shading != undefined && material.shading == THREE.SmoothShading; + return material && material.shading !== undefined && material.shading === THREE.SmoothShading; }; From 965b199de27958b5178836ee8eb15f6326b53c3a Mon Sep 17 00:00:00 2001 From: alteredq Date: Fri, 21 Oct 2011 14:13:44 +0200 Subject: [PATCH 31/33] And some more strict equality checking. --- build/Three.js | 59 +++++----- build/custom/ThreeCanvas.js | 16 +-- build/custom/ThreeDOM.js | 12 +- build/custom/ThreeExtras.js | 43 +++---- build/custom/ThreeSVG.js | 16 +-- build/custom/ThreeWebGL.js | 18 +-- examples/js/Car.js | 2 +- src/core/Color.js | 2 +- src/core/Geometry.js | 47 +++++--- src/core/Matrix4.js | 3 +- src/core/Quaternion.js | 20 ++-- src/core/Ray.js | 4 +- src/core/Spline.js | 2 +- src/core/Vector2.js | 2 +- src/extras/ColorUtils.js | 6 +- src/extras/ImageUtils.js | 4 +- src/extras/animation/Animation.js | 144 +++++++++++------------ src/extras/geometries/CubeGeometry.js | 6 +- src/extras/geometries/ExtrudeGeometry.js | 14 +-- src/extras/objects/MarchingCubes.js | 62 +++++----- 20 files changed, 247 insertions(+), 235 deletions(-) diff --git a/build/Three.js b/build/Three.js index 9698b974..7d8ff314 100644 --- a/build/Three.js +++ b/build/Three.js @@ -1,12 +1,12 @@ // Three.js r46dev - http://github.com/mrdoob/three.js var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;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.0010*(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},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var e,f,h;if(c==0)this.r=this.g=this.b=0;else switch(e=Math.floor(a*6),f=a*6-e,a=c*(1-b),h=c*(1- +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},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var e,f,h;if(c===0)this.r=this.g=this.b=0;else switch(e=Math.floor(a*6),f=a*6-e,a=c*(1-b),h=c*(1- b*f),b=c*(1-b*(1-f)),e){case 1:this.r=h;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=h;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=h;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, -equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; +equals:function(a){return a.x===this.x&&a.y===this.y}};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.set(0,0,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 this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)}, @@ -16,8 +16,8 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,e){this.x= 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.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,e=[];b=0;for(c=a.length;b0&&a>0&&k+a<1}for(var e,f=[],h=0,k=a.children.length;ha.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h=b(this.origin, -this.direction,a.matrixWorld.getPosition());if(h==null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var l,n,p,u,t,v,o,y,x=a.geometry,w=x.vertices,h=0,k=x.faces.length;h0&&a>0&&k+a<1}for(var e,f=[],h=0,k=a.children.length;ha.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h= +b(this.origin,this.direction,a.matrixWorld.getPosition());if(h===null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var l,n,p,u,t,v,o,y,x=a.geometry,w=x.vertices,h=0,k=x.faces.length;h0:v<0)))if(v=t.dot((new THREE.Vector3).sub(l,o))/v,o=o.addSelf(y.multiplyScalar(v)),e instanceof THREE.Face3)c(o,l,n,p)&&(e={distance:this.origin.distanceTo(o),point:o,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(o,l,n,u)||c(o,n,p,u)))e={distance:this.origin.distanceTo(o),point:o,face:e,object:a},f.push(e)}return f}}; THREE.Rectangle=function(){function a(){h=e-b;k=f-c}var b,c,e,f,h,k,l=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return k};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(k,h,u,t){l=!1;b=k;c=h;e=u;f=t;a()};this.addPoint=function(k,h){l?(l=!1,b=k,c=h,e=k,f=h):(b=bk?e:k,f=f>h?f:h);a()};this.add3Points= function(k,h,u,t,v,o){l?(l=!1,b=ku?k>v?k:v:u>v?u:v,f=h>t?h>o?h:o:t>o?t:o):(b=ku?k>v?k>e?k:e:v>e?v:e:u>v?u>e?u:e:v>e?v:e,f=h>t?h>o?h>f?h:f:o>f?o:f:t>o?t>f?t:f:o>f?o:f);a()};this.addRectangle=function(k){l?(l=!1,b=k.getLeft(),c=k.getTop(),e=k.getRight(),f=k.getBottom()):(b=bk.getRight()?e:k.getRight(),f=f> @@ -46,7 +46,7 @@ c.y=f.length();c.z=h.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;e=THREE.Mat a.n23*f;this.n33=a.n33*f}}; THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,k=a.n21,l=a.n22,n=a.n23,p=a.n24,u=a.n31,t=a.n32,v=a.n33,o=a.n34,y=a.n41,x=a.n42,w=a.n43,A=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=n*o*x-p*v*x+p*t*w-l*o*w-n*t*A+l*v*A;b.n12=h*v*x-f*o*x-h*t*w+e*o*w+f*t*A-e*v*A;b.n13=f*p*x-h*n*x+h*l*w-e*p*w-f*l*A+e*n*A;b.n14=h*n*t-f*p*t-h*l*v+e*p*v+f*l*o-e*n*o;b.n21=p*v*y-n*o*y-p*u*w+k*o*w+n*u*A-k*v*A;b.n22=f*o*y-h*v*y+h*u*w-c*o*w-f*u*A+c*v*A;b.n23=h*n*y-f*p*y-h*k*w+c*p*w+f*k*A-c*n*A;b.n24= f*p*u-h*n*u+h*k*v-c*p*v-f*k*o+c*n*o;b.n31=l*o*y-p*t*y+p*u*x-k*o*x-l*u*A+k*t*A;b.n32=h*t*y-e*o*y-h*u*x+c*o*x+e*u*A-c*t*A;b.n33=f*p*y-h*l*y+h*k*x-c*p*x-e*k*A+c*l*A;b.n34=h*l*u-e*p*u-h*k*t+c*p*t+e*k*o-c*l*o;b.n41=n*t*y-l*v*y-n*u*x+k*v*x+l*u*w-k*t*w;b.n42=e*v*y-f*t*y+f*u*x-c*v*x-e*u*w+c*t*w;b.n43=f*l*y-e*n*y-f*k*x+c*n*x+e*k*w-c*l*w;b.n44=e*n*u-f*l*u+f*k*t-c*n*t-e*k*v+c*l*v;b.multiplyScalar(1/a.determinant());return b}; -THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,k=-a.n33*a.n12+a.n32*a.n13,l=a.n33*a.n11-a.n31*a.n13,n=-a.n32*a.n11+a.n31*a.n12,p=a.n23*a.n12-a.n22*a.n13,u=-a.n23*a.n11+a.n21*a.n13,t=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*k+a.n31*p;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*k;c[4]=a*l;c[5]=a*n;c[6]=a*p;c[7]=a*u;c[8]=a*t;return b}; +THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,k=-a.n33*a.n12+a.n32*a.n13,l=a.n33*a.n11-a.n31*a.n13,n=-a.n32*a.n11+a.n31*a.n12,p=a.n23*a.n12-a.n22*a.n13,u=-a.n23*a.n11+a.n21*a.n13,t=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*k+a.n31*p;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*k;c[4]=a*l;c[5]=a*n;c[6]=a*p;c[7]=a*u;c[8]=a*t;return b}; THREE.Matrix4.makeFrustum=function(a,b,c,e,f,h){var k;k=new THREE.Matrix4;k.n11=2*f/(b-a);k.n12=0;k.n13=(b+a)/(b-a);k.n14=0;k.n21=0;k.n22=2*f/(e-c);k.n23=(e+c)/(e-c);k.n24=0;k.n31=0;k.n32=0;k.n33=-(h+f)/(h-f);k.n34=-2*h*f/(h-f);k.n41=0;k.n42=0;k.n43=-1;k.n44=0;return k};THREE.Matrix4.makePerspective=function(a,b,c,e){var f,a=c*Math.tan(a*Math.PI/360);f=-a;return THREE.Matrix4.makeFrustum(f*b,a*b,f,a,c,e)}; THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var k,l,n,p;k=new THREE.Matrix4;l=b-a;n=c-e;p=h-f;k.n11=2/l;k.n12=0;k.n13=0;k.n14=-((b+a)/l);k.n21=0;k.n22=2/n;k.n23=0;k.n24=-((c+e)/n);k.n31=0;k.n32=0;k.n33=-2/p;k.n34=-((h+f)/p);k.n41=0;k.n42=0;k.n43=0;k.n44=1;return k};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= @@ -69,7 +69,7 @@ O.multiplyVector4(ha.positionScreen);ea=1;for(da=ia.length;ea0&&M.z<1))X=C[z]=C[z]||new THREE.RenderableParticle,z++,A=X,A.x=M.x/M.w,A.y=M.y/M.w,A.z=M.z,A.rotation=Y.rotation.z,A.scale.x=Y.scale.x*Math.abs(A.x-(M.x+f.projectionMatrix.n11)/(M.w+f.projectionMatrix.n14)),A.scale.y=Y.scale.y*Math.abs(A.y-(M.y+f.projectionMatrix.n22)/(M.w+f.projectionMatrix.n24)),A.materials=Y.materials,K.push(A);h&&K.sort(b);return K}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),h=Math.cos(c),c=Math.sin(c),k=a*b,l=e*f;this.w=k*h-l*c;this.x=k*c+l*h;this.y=e*b*h+a*f*c;this.z=a*f*h-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c); this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;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.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,e=this.z,f=this.w,h=a.x,k=a.y,l=a.z,a=a.w;this.x=b*a+f*h+c*l-e*k;this.y=c*a+f*k+e*h-b*l;this.z=e*a+f*l+b*k-c*h;this.w=f*a-b*h-c*k-e*l;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,e=a.y,f=a.z,h=this.x,k=this.y,l=this.z,n=this.w,p=n*c+k*f-l*e,u=n*e+l*c-h*f,t=n*f+h*e-k*c,c=-h* c-k*e-l*f;b.x=p*n+c*-h+u*-l-t*-k;b.y=u*n+c*-k+t*-h-p*-l;b.z=t*n+c*-l+p*-k-u*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),k=Math.sqrt(1-f*f);if(Math.abs(k)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/k;e=Math.sin(e*h)/k;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,e,f,h){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3}; @@ -78,7 +78,7 @@ THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;ret THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;bthis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;p=this.points[c[0]];u=this.points[c[1]]; +c[h]=b.length-1):c[h]=c[a[e]];h=0;for(k=this.faces.length;hthis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;p=this.points[c[0]];u=this.points[c[1]]; t=this.points[c[2]];v=this.points[c[3]];l=k*k;n=k*l;e.x=b(p.x,u.x,t.x,v.x,k,l,n);e.y=b(p.y,u.y,t.y,v.y,k,l,n);e.z=b(p.z,u.z,t.z,v.z,k,l,n);return e};this.getControlPointsArray=function(){var a,c,b=this.points.length,e=[];for(a=0;a1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=k;b.v=h;return b}}; +THREE.ColorUtils={adjustHSV:function(a,b,c,e){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.Math.clamp(f.h+b,0,1);f.s=THREE.Math.clamp(f.s+c,0,1);f.v=THREE.Math.clamp(f.v+e,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,b){var c=a.r,e=a.g,f=a.b,h=Math.max(Math.max(c,e),f),k=Math.min(Math.min(c,e),f);if(k===h)k=c=0;else{var l=h-k,k=l/h,c=c===h?(e-f)/l:e===h?2+(f-c)/l:4+(c-e)/l;c/=6;c<0&&(c+=1);c>1&&(c-=1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=k;b.v=h;return b}}; THREE.ColorUtils.__hsv={h:0,s:0,v:0}; THREE.GeometryUtils={merge:function(a,b){for(var c,e,f=a.vertices.length,h=b instanceof THREE.Mesh?b.geometry:b,k=a.vertices,l=h.vertices,n=a.faces,p=h.faces,u=a.faceVertexUvs[0],t=h.faceVertexUvs[0],v={},o=0;oa?c(b,f-1):p[f]1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+o),e=e<0?0:1;if(c==="pos")if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=f[0]+(h[0]-f[0])*e,c.y=f[1]+(h[1]-f[1])*e,c.z=f[2]+(h[2]-f[2])*e;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= this.getPrevKeyWith("pos",o,k.index-1).pos,this.points[1]=f,this.points[2]=h,this.points[3]=this.getNextKeyWith("pos",o,l.index+1).pos,e=e*0.33+0.33,f=this.interpolateCatmullRom(this.points,e),c.x=f[0],c.y=f[1],c.z=f[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)e=this.interpolateCatmullRom(this.points,e*1.01),this.target.set(e[0],e[1],e[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),e=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,e,0)}else if(c=== "rot")THREE.Quaternion.slerp(f,h,a.quaternion,e);else if(c==="scl")c=a.scale,c.x=f[0]+(h[0]-f[0])*e,c.y=f[1]+(h[1]-f[1])*e,c.z=f[2]+(h[2]-f[2])*e}}if(this.JITCompile&&u[0][p]===void 0){this.hierarchy[0].update(void 0,!0);for(o=0;oa.length-2?h:h+1;c[3]=h>a.length-3?h:h+2;h=a[c[0]];l=a[c[1]];n=a[c[2]];p=a[c[3]];c=f*f;k=f*c;e[0]=this.interpolate(h[0],l[0],n[0],p[0],f,c,k);e[1]=this.interpolate(h[1],l[1],n[1],p[1],f,c,k);e[2]=this.interpolate(h[2],l[2],n[2],p[2],f,c,k);return e}; +THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],e=[],f,h,k,l,n,p;f=(a.length-1)*b;h=Math.floor(f);f-=h;c[0]=h===0?h:h-1;c[1]=h;c[2]=h>a.length-2?h:h+1;c[3]=h>a.length-3?h:h+2;h=a[c[0]];l=a[c[1]];n=a[c[2]];p=a[c[3]];c=f*f;k=f*c;e[0]=this.interpolate(h[0],l[0],n[0],p[0],f,c,k);e[1]=this.interpolate(h[1],l[1],n[1],p[1],f,c,k);e[2]=this.interpolate(h[2],l[2],n[2],p[2],f,c,k);return e}; THREE.Animation.prototype.interpolate=function(a,b,c,e,f,h,k){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*k+(-3*(b-c)-2*a-e)*h+a*f+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c0?c:0:c>=0?c:c+e.length;c>=0;c--)if(e[c][a]!==void 0)return e[c];return this.data.hierarchy[b].keys[e.length-1]}; THREE.CubeCamera=function(a,b,c,e){this.heightOffset=c;this.position=new THREE.Vector3(0,c,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNX=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNY=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraNZ=new THREE.PerspectiveCamera(90,1,a,b);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position= @@ -486,22 +486,22 @@ this.rotateCamera();this.noZoom||this.zoomCamera();this.noPan||this.panCamera(); (f===this.STATE.ROTATE?l=this.getMouseProjectionOnBall(a.clientX,a.clientY):f===this.STATE.ZOOM&&!this.noZoom?p=this.getMouseOnScreen(a.clientX,a.clientY):f===this.STATE.PAN&&!this.noPan&&(t=this.getMouseOnScreen(a.clientX,a.clientY)))}),!1);this.domElement.addEventListener("mousedown",c(this,function(a){a.preventDefault();a.stopPropagation();if(f===this.STATE.NONE)f=a.button,f===this.STATE.ROTATE?k=l=this.getMouseProjectionOnBall(a.clientX,a.clientY):f===this.STATE.ZOOM&&!this.noZoom?n=p=this.getMouseOnScreen(a.clientX, a.clientY):this.noPan||(u=t=this.getMouseOnScreen(a.clientX,a.clientY))}),!1);this.domElement.addEventListener("mouseup",c(this,function(a){a.preventDefault();a.stopPropagation();f=this.STATE.NONE}),!1);window.addEventListener("keydown",c(this,function(a){if(f===this.STATE.NONE){if(a.keyCode===this.keys[this.STATE.ROTATE])f=this.STATE.ROTATE;else if(a.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)f=this.STATE.ZOOM;else if(a.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)f=this.STATE.PAN;f!== this.STATE.NONE&&(e=!0)}}),!1);window.addEventListener("keyup",c(this,function(){if(f!==this.STATE.NONE)f=this.STATE.NONE}),!1)};THREE.TrackballControls.prototype.STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2}; -THREE.CubeGeometry=function(a,b,c,e,f,h,k,l){function n(a,c,b,k,l,n,o,t){var u,v,w=e||1,x=f||1,m=l/2,y=n/2,A=p.vertices.length;if(a=="x"&&c=="y"||a=="y"&&c=="x")u="z";else if(a=="x"&&c=="z"||a=="z"&&c=="x")u="y",x=h||1;else if(a=="z"&&c=="y"||a=="y"&&c=="z")u="x",w=h||1;var z=w+1,C=x+1;l/=w;var ia=n/x;for(v=0;v0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,k,0)));for(l=0;l0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-k,0)));for(l=0;la&&(a+=Math.PI*2),anglec=(c+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(l).subSelf(a).clone()}function f(a){for(H=a.length;--H>=0;){ja=H;ca=H-1;ca<0&&(ca=a.length- +l.copy(c).addSelf(h);m.copy(b).addSelf(f);h=e.dot(f);f=m.subSelf(l).dot(f);h===0&&(console.log("Either infinite or no solutions!"),f===0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));f/=h;if(f<0)return c=Math.atan2(c.y-a.y,c.x-a.x),a=Math.atan2(b.y-a.y,b.x-a.x),c>a&&(a+=Math.PI*2),anglec=(c+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(l).subSelf(a).clone()}function f(a){for(H=a.length;--H>=0;){ja=H;ca=H-1;ca<0&&(ca=a.length- 1);for(var c=0,b=o+u*2,c=0;c=0;L--){T=L/u;S=n*(1-T);T=p*Math.sin(T*Math.PI/2);H=0;for(P=z.length;H=0;L--){T=L/u;S=n*(1-T);T=p*Math.sin(T*Math.PI/2);H=0;for(P=z.length;H=this.maxCount-3&&l(this)};this.begin=function(){this.count=0; -this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var b=this.count*3;bthis.size-1&&(n=this.size-1);var v=Math.floor(p-l);v<1&&(v=1);p=Math.floor(p+l);p>this.size-1&&(p=this.size-1);var o=Math.floor(u-l);o<1&&(o=1);l=Math.floor(u+l);l>this.size-1&&(l=this.size- -1);for(var y,x,w,A,z,C;t0&&(this.field[w+y]+=A)}}};this.addPlaneX=function(a,b){var f,h,k,l,n,p=this.size,u=this.yd,t=this.zd,v=this.field,o=p*Math.sqrt(a/b);o>p&&(o=p);for(f=0;f0)for(h=0;hu&&(y=u);for(h=0;h0){n=h*t;for(f=0;fsize&&(dist=size);for(k=0;k0){n=zd*k;for(h=0;h=this.maxCount-3&&l(this)};this.begin= +function(){this.count=0;this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!==0){for(var b=this.count*3;bthis.size-1&&(n=this.size-1);var v=Math.floor(p-l);v<1&&(v=1);p=Math.floor(p+l);p>this.size-1&&(p=this.size-1);var o=Math.floor(u-l);o<1&&(o=1);l=Math.floor(u+l); +l>this.size-1&&(l=this.size-1);for(var y,x,w,A,z,C;t0&&(this.field[w+y]+=A)}}};this.addPlaneX=function(a,b){var f,h,k,l,n,p=this.size,u=this.yd,t=this.zd,v=this.field,o=p*Math.sqrt(a/b);o>p&&(o=p);for(f=0;f0)for(h=0;hu&&(y=u);for(h=0;h0){n=h*t;for(f=0;fsize&&(dist=size);for(k=0;k0){n=zd*k;for(h=0;h>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, -equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; +equals:function(a){return a.x===this.x&&a.y===this.y}};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.set(0,0,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 this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)}, @@ -15,8 +15,8 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x= 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.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d=[];b=0;for(c=a.length;b0&&a>0&&e+a<1}for(var d,f=[],e=0,g=a.children.length;ea.scale.x)return[];d={distance:e,point:a.position,face:null,object:a};f.push(d)}else if(a instanceof THREE.Mesh){e=b(this.origin, -this.direction,a.matrixWorld.getPosition());if(e==null||e>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var h,m,k,l,i,n,j,r,t=a.geometry,w=t.vertices,e=0,g=t.faces.length;e0&&a>0&&e+a<1}for(var d,f=[],e=0,g=a.children.length;ea.scale.x)return[];d={distance:e,point:a.position,face:null,object:a};f.push(d)}else if(a instanceof THREE.Mesh){e= +b(this.origin,this.direction,a.matrixWorld.getPosition());if(e===null||e>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var h,m,k,l,i,n,j,r,t=a.geometry,w=t.vertices,e=0,g=t.faces.length;e0:n<0)))if(n=i.dot((new THREE.Vector3).sub(h,j))/n,j=j.addSelf(r.multiplyScalar(n)),d instanceof THREE.Face3)c(j,h,m,k)&&(d={distance:this.origin.distanceTo(j),point:j,face:d,object:a},f.push(d));else if(d instanceof THREE.Face4&&(c(j,h,m,l)||c(j,m,k,l)))d={distance:this.origin.distanceTo(j),point:j,face:d,object:a},f.push(d)}return f}}; THREE.Rectangle=function(){function a(){e=d-b;g=f-c}var b,c,d,f,e,g,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return e};this.getHeight=function(){return g};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return f};this.set=function(e,g,l,i){h=!1;b=e;c=g;d=l;f=i;a()};this.addPoint=function(e,g){h?(h=!1,b=e,c=g,d=e,f=g):(b=be?d:e,f=f>g?f:g);a()};this.add3Points= function(e,g,l,i,n,j){h?(h=!1,b=el?e>n?e:n:l>n?l:n,f=g>i?g>j?g:j:i>j?i:j):(b=el?e>n?e>d?e:d:n>d?n:d:l>n?l>d?l:d:n>d?n:d,f=g>i?g>j?g>f?g:f:j>f?j:f:i>j?i>f?i:f:j>f?j:f);a()};this.addRectangle=function(e){h?(h=!1,b=e.getLeft(),c=e.getTop(),d=e.getRight(),f=e.getBottom()):(b=be.getRight()?d:e.getRight(),f=f> @@ -44,7 +44,7 @@ c.y=f.length();c.z=e.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Mat a.n23*f;this.n33=a.n33*f}}; THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,d=a.n12,f=a.n13,e=a.n14,g=a.n21,h=a.n22,m=a.n23,k=a.n24,l=a.n31,i=a.n32,n=a.n33,j=a.n34,r=a.n41,t=a.n42,w=a.n43,u=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=m*j*t-k*n*t+k*i*w-h*j*w-m*i*u+h*n*u;b.n12=e*n*t-f*j*t-e*i*w+d*j*w+f*i*u-d*n*u;b.n13=f*k*t-e*m*t+e*h*w-d*k*w-f*h*u+d*m*u;b.n14=e*m*i-f*k*i-e*h*n+d*k*n+f*h*j-d*m*j;b.n21=k*n*r-m*j*r-k*l*w+g*j*w+m*l*u-g*n*u;b.n22=f*j*r-e*n*r+e*l*w-c*j*w-f*l*u+c*n*u;b.n23=e*m*r-f*k*r-e*g*w+c*k*w+f*g*u-c*m*u;b.n24= f*k*l-e*m*l+e*g*n-c*k*n-f*g*j+c*m*j;b.n31=h*j*r-k*i*r+k*l*t-g*j*t-h*l*u+g*i*u;b.n32=e*i*r-d*j*r-e*l*t+c*j*t+d*l*u-c*i*u;b.n33=f*k*r-e*h*r+e*g*t-c*k*t-d*g*u+c*h*u;b.n34=e*h*l-d*k*l-e*g*i+c*k*i+d*g*j-c*h*j;b.n41=m*i*r-h*n*r-m*l*t+g*n*t+h*l*w-g*i*w;b.n42=d*n*r-f*i*r+f*l*t-c*n*t-d*l*w+c*i*w;b.n43=f*h*r-d*m*r-f*g*t+c*m*t+d*g*w-c*h*w;b.n44=d*m*l-f*h*l+f*g*i-c*m*i-d*g*n+c*h*n;b.multiplyScalar(1/a.determinant());return b}; -THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,e=a.n32*a.n21-a.n31*a.n22,g=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,m=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,l=-a.n23*a.n11+a.n21*a.n13,i=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*g+a.n31*k;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*f;c[2]=a*e;c[3]=a*g;c[4]=a*h;c[5]=a*m;c[6]=a*k;c[7]=a*l;c[8]=a*i;return b}; +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,e=a.n32*a.n21-a.n31*a.n22,g=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,m=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,l=-a.n23*a.n11+a.n21*a.n13,i=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*g+a.n31*k;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*f;c[2]=a*e;c[3]=a*g;c[4]=a*h;c[5]=a*m;c[6]=a*k;c[7]=a*l;c[8]=a*i;return b}; THREE.Matrix4.makeFrustum=function(a,b,c,d,f,e){var g;g=new THREE.Matrix4;g.n11=2*f/(b-a);g.n12=0;g.n13=(b+a)/(b-a);g.n14=0;g.n21=0;g.n22=2*f/(d-c);g.n23=(d+c)/(d-c);g.n24=0;g.n31=0;g.n32=0;g.n33=-(e+f)/(e-f);g.n34=-2*e*f/(e-f);g.n41=0;g.n42=0;g.n43=-1;g.n44=0;return g};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,e){var g,h,m,k;g=new THREE.Matrix4;h=b-a;m=c-d;k=e-f;g.n11=2/h;g.n12=0;g.n13=0;g.n14=-((b+a)/h);g.n21=0;g.n22=2/m;g.n23=0;g.n24=-((c+d)/m);g.n31=0;g.n32=0;g.n33=-2/k;g.n34=-((e+f)/k);g.n41=0;g.n42=0;g.n43=0;g.n44=1;return g};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= @@ -67,7 +67,7 @@ C.multiplyVector4(y.positionScreen),L=m[h-2],T.copy(y.positionScreen),U.copy(L.p v,u.x=s.x/s.w,u.y=s.y/s.w,u.z=s.z,u.rotation=q.rotation.z,u.scale.x=q.scale.x*Math.abs(u.x-(s.x+e.projectionMatrix.n11)/(s.w+e.projectionMatrix.n14)),u.scale.y=q.scale.y*Math.abs(u.y-(s.y+e.projectionMatrix.n22)/(s.w+e.projectionMatrix.n24)),u.materials=q.materials,N.push(u);f&&N.sort(b);return N}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==void 0?d:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,f=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-f),f=Math.sin(-f),e=Math.cos(c),c=Math.sin(c),g=a*b,h=d*f;this.w=g*e-h*c;this.x=g*c+h*e;this.y=d*b*e+a*f*c;this.z=a*f*e-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.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,e=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+f*e+c*h-d*g;this.y=c*a+f*g+d*e-b*h;this.z=d*a+f*h+b*g-c*e;this.w=f*a-b*e-c*g-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,f=a.z,e=this.x,g=this.y,h=this.z,m=this.w,k=m*c+g*f-h*d,l=m*d+h*c-e*f,i=m*f+e*d-g*c,c=-e* c-g*d-h*f;b.x=k*m+c*-e+l*-h-i*-g;b.y=l*m+c*-g+i*-e-k*-h;b.z=i*m+c*-h+k*-g-l*-e;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;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var e=Math.acos(f),g=Math.sqrt(1-f*f);if(Math.abs(g)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-d)*e)/g;d=Math.sin(d*e)/g;c.w=a.w*f+b.w*d;c.x=a.x*f+b.x*d;c.y=a.y*f+b.y*d;c.z=a.z*f+b.z*d;return c}; THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,f,e){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=e;this.centroid=new THREE.Vector3}; @@ -76,7 +76,7 @@ THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;ret THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,d=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, -equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; +equals:function(a){return a.x===this.x&&a.y===this.y}};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.set(0,0,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 this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)}, @@ -15,8 +15,8 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x= 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.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d=[];b=0;for(c=a.length;b0&&a>0&&f+a<1}for(var d,e=[],g=0,f=a.children.length;ga.scale.x)return[];d={distance:g,point:a.position,face:null,object:a};e.push(d)}else if(a instanceof THREE.Mesh){g=b(this.origin, -this.direction,a.matrixWorld.getPosition());if(g==null||g>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return e;for(var h,k,i,j,l,n,m,p,q=a.geometry,s=q.vertices,g=0,f=q.faces.length;g0&&a>0&&f+a<1}for(var d,e=[],g=0,f=a.children.length;ga.scale.x)return[];d={distance:g,point:a.position,face:null,object:a};e.push(d)}else if(a instanceof THREE.Mesh){g= +b(this.origin,this.direction,a.matrixWorld.getPosition());if(g===null||g>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return e;for(var h,k,i,j,l,n,m,p,q=a.geometry,s=q.vertices,g=0,f=q.faces.length;g0:n<0)))if(n=l.dot((new THREE.Vector3).sub(h,m))/n,m=m.addSelf(p.multiplyScalar(n)),d instanceof THREE.Face3)c(m,h,k,i)&&(d={distance:this.origin.distanceTo(m),point:m,face:d,object:a},e.push(d));else if(d instanceof THREE.Face4&&(c(m,h,k,j)||c(m,k,i,j)))d={distance:this.origin.distanceTo(m),point:m,face:d,object:a},e.push(d)}return e}}; THREE.Rectangle=function(){function a(){g=d-b;f=e-c}var b,c,d,e,g,f,h=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return f};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return e};this.set=function(f,g,j,l){h=!1;b=f;c=g;d=j;e=l;a()};this.addPoint=function(f,g){h?(h=!1,b=f,c=g,d=f,e=g):(b=bf?d:f,e=e>g?e:g);a()};this.add3Points= function(f,g,j,l,n,m){h?(h=!1,b=fj?f>n?f:n:j>n?j:n,e=g>l?g>m?g:m:l>m?l:m):(b=fj?f>n?f>d?f:d:n>d?n:d:j>n?j>d?j:d:n>d?n:d,e=g>l?g>m?g>e?g:e:m>e?m:e:l>m?l>e?l:e:m>e?m:e);a()};this.addRectangle=function(f){h?(h=!1,b=f.getLeft(),c=f.getTop(),d=f.getRight(),e=f.getBottom()):(b=bf.getRight()?d:f.getRight(),e=e> @@ -44,7 +44,7 @@ c.y=e.length();c.z=g.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Mat a.n23*e;this.n33=a.n33*e}}; THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,d=a.n12,e=a.n13,g=a.n14,f=a.n21,h=a.n22,k=a.n23,i=a.n24,j=a.n31,l=a.n32,n=a.n33,m=a.n34,p=a.n41,q=a.n42,s=a.n43,r=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=k*m*q-i*n*q+i*l*s-h*m*s-k*l*r+h*n*r;b.n12=g*n*q-e*m*q-g*l*s+d*m*s+e*l*r-d*n*r;b.n13=e*i*q-g*k*q+g*h*s-d*i*s-e*h*r+d*k*r;b.n14=g*k*l-e*i*l-g*h*n+d*i*n+e*h*m-d*k*m;b.n21=i*n*p-k*m*p-i*j*s+f*m*s+k*j*r-f*n*r;b.n22=e*m*p-g*n*p+g*j*s-c*m*s-e*j*r+c*n*r;b.n23=g*k*p-e*i*p-g*f*s+c*i*s+e*f*r-c*k*r;b.n24= e*i*j-g*k*j+g*f*n-c*i*n-e*f*m+c*k*m;b.n31=h*m*p-i*l*p+i*j*q-f*m*q-h*j*r+f*l*r;b.n32=g*l*p-d*m*p-g*j*q+c*m*q+d*j*r-c*l*r;b.n33=e*i*p-g*h*p+g*f*q-c*i*q-d*f*r+c*h*r;b.n34=g*h*j-d*i*j-g*f*l+c*i*l+d*f*m-c*h*m;b.n41=k*l*p-h*n*p-k*j*q+f*n*q+h*j*s-f*l*s;b.n42=d*n*p-e*l*p+e*j*q-c*n*q-d*j*s+c*l*s;b.n43=e*h*p-d*k*p-e*f*q+c*k*q+d*f*s-c*h*s;b.n44=d*k*j-e*h*j+e*f*l-c*k*l-d*f*n+c*h*n;b.multiplyScalar(1/a.determinant());return b}; -THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,k=-a.n32*a.n11+a.n31*a.n12,i=a.n23*a.n12-a.n22*a.n13,j=-a.n23*a.n11+a.n21*a.n13,l=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*i;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*g;c[3]=a*f;c[4]=a*h;c[5]=a*k;c[6]=a*i;c[7]=a*j;c[8]=a*l;return b}; +THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,e=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,f=-a.n33*a.n12+a.n32*a.n13,h=a.n33*a.n11-a.n31*a.n13,k=-a.n32*a.n11+a.n31*a.n12,i=a.n23*a.n12-a.n22*a.n13,j=-a.n23*a.n11+a.n21*a.n13,l=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*f+a.n31*i;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*e;c[2]=a*g;c[3]=a*f;c[4]=a*h;c[5]=a*k;c[6]=a*i;c[7]=a*j;c[8]=a*l;return b}; THREE.Matrix4.makeFrustum=function(a,b,c,d,e,g){var f;f=new THREE.Matrix4;f.n11=2*e/(b-a);f.n12=0;f.n13=(b+a)/(b-a);f.n14=0;f.n21=0;f.n22=2*e/(d-c);f.n23=(d+c)/(d-c);f.n24=0;f.n31=0;f.n32=0;f.n33=-(g+e)/(g-e);f.n34=-2*g*e/(g-e);f.n41=0;f.n42=0;f.n43=-1;f.n44=0;return f};THREE.Matrix4.makePerspective=function(a,b,c,d){var e,a=c*Math.tan(a*Math.PI/360);e=-a;return THREE.Matrix4.makeFrustum(e*b,a*b,e,a,c,d)}; THREE.Matrix4.makeOrtho=function(a,b,c,d,e,g){var f,h,k,i;f=new THREE.Matrix4;h=b-a;k=c-d;i=g-e;f.n11=2/h;f.n12=0;f.n13=0;f.n14=-((b+a)/h);f.n21=0;f.n22=2/k;f.n23=0;f.n24=-((c+d)/k);f.n31=0;f.n32=0;f.n33=-2/i;f.n34=-((g+e)/i);f.n41=0;f.n42=0;f.n43=0;f.n44=1;return f};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= @@ -67,7 +67,7 @@ K.multiplyVector4(t.positionScreen),y=k[h-2],E.copy(t.positionScreen),F.copy(y.p L,r.x=v.x/v.w,r.y=v.y/v.w,r.z=v.z,r.rotation=u.rotation.z,r.scale.x=u.scale.x*Math.abs(r.x-(v.x+e.projectionMatrix.n11)/(v.w+e.projectionMatrix.n14)),r.scale.y=u.scale.y*Math.abs(r.y-(v.y+e.projectionMatrix.n22)/(v.w+e.projectionMatrix.n24)),r.materials=u.materials,D.push(r);g&&D.sort(b);return D}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==void 0?d:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),g=Math.cos(c),c=Math.sin(c),f=a*b,h=d*e;this.w=f*g-h*c;this.x=f*c+h*g;this.y=d*b*g+a*e*c;this.z=a*e*g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c); 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.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a===0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b= this.x,c=this.y,d=this.z,e=this.w,g=a.x,f=a.y,h=a.z,a=a.w;this.x=b*a+e*g+c*h-d*f;this.y=c*a+e*f+d*g-b*h;this.z=d*a+e*h+b*f-c*g;this.w=e*a-b*g-c*f-d*h;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,g=this.x,f=this.y,h=this.z,k=this.w,i=k*c+f*e-h*d,j=k*d+h*c-g*e,l=k*e+g*d-f*c,c=-g* c-f*d-h*e;b.x=i*k+c*-g+j*-h-l*-f;b.y=j*k+c*-f+l*-g-i*-h;b.z=l*k+c*-h+i*-f-j*-g;return b}};THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(e)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(e),f=Math.sqrt(1-e*e);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;e=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*e+b.w*d;c.x=a.x*e+b.x*d;c.y=a.y*e+b.y*d;c.z=a.z*e+b.z*d;return c}; THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3}; diff --git a/build/custom/ThreeExtras.js b/build/custom/ThreeExtras.js index ab9b7c91..dd34d7b3 100644 --- a/build/custom/ThreeExtras.js +++ b/build/custom/ThreeExtras.js @@ -1,5 +1,5 @@ // ThreeExtras.js r46dev - http://github.com/mrdoob/three.js -THREE.ColorUtils={adjustHSV:function(a,c,b,e){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.Math.clamp(f.h+c,0,1);f.s=THREE.Math.clamp(f.s+b,0,1);f.v=THREE.Math.clamp(f.v+e,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,c){var b=a.r,e=a.g,f=a.b,h=Math.max(Math.max(b,e),f),g=Math.min(Math.min(b,e),f);if(g==h)g=b=0;else{var k=h-g,g=k/h,b=b==h?(e-f)/k:e==h?2+(f-b)/k:4+(b-e)/k;b/=6;b<0&&(b+=1);b>1&&(b-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=b;c.s=g;c.v=h;return c}}; +THREE.ColorUtils={adjustHSV:function(a,c,b,e){var f=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,f);f.h=THREE.Math.clamp(f.h+c,0,1);f.s=THREE.Math.clamp(f.s+b,0,1);f.v=THREE.Math.clamp(f.v+e,0,1);a.setHSV(f.h,f.s,f.v)},rgbToHsv:function(a,c){var b=a.r,e=a.g,f=a.b,h=Math.max(Math.max(b,e),f),g=Math.min(Math.min(b,e),f);if(g===h)g=b=0;else{var k=h-g,g=k/h,b=b===h?(e-f)/k:e===h?2+(f-b)/k:4+(b-e)/k;b/=6;b<0&&(b+=1);b>1&&(b-=1)}c===void 0&&(c={h:0,s:0,v:0});c.h=b;c.s=g;c.v=h;return c}}; THREE.ColorUtils.__hsv={h:0,s:0,v:0}; THREE.GeometryUtils={merge:function(a,c){for(var b,e,f=a.vertices.length,h=c instanceof THREE.Mesh?c.geometry:c,g=a.vertices,k=h.vertices,l=a.faces,m=h.faces,n=a.faceVertexUvs[0],o=h.faceVertexUvs[0],u={},t=0;ta?b(e,g-1):m[g]1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+t),e=e<0?0:1;if(b==="pos")if(b=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)b.x=f[0]+(h[0]-f[0])*e,b.y=f[1]+(h[1]-f[1])*e,b.z=f[2]+(h[2]-f[2])*e;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]= this.getPrevKeyWith("pos",t,g.index-1).pos,this.points[1]=f,this.points[2]=h,this.points[3]=this.getNextKeyWith("pos",t,k.index+1).pos,e=e*0.33+0.33,f=this.interpolateCatmullRom(this.points,e),b.x=f[0],b.y=f[1],b.z=f[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)e=this.interpolateCatmullRom(this.points,e*1.01),this.target.set(e[0],e[1],e[2]),this.target.subSelf(b),this.target.y=0,this.target.normalize(),e=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,e,0)}else if(b=== "rot")THREE.Quaternion.slerp(f,h,a.quaternion,e);else if(b==="scl")b=a.scale,b.x=f[0]+(h[0]-f[0])*e,b.y=f[1]+(h[1]-f[1])*e,b.z=f[2]+(h[2]-f[2])*e}}if(this.JITCompile&&n[0][m]===void 0){this.hierarchy[0].update(void 0,!0);for(t=0;ta.length-2?h:h+1;b[3]=h>a.length-3?h:h+2;h=a[b[0]];k=a[b[1]];l=a[b[2]];m=a[b[3]];b=f*f;g=f*b;e[0]=this.interpolate(h[0],k[0],l[0],m[0],f,b,g);e[1]=this.interpolate(h[1],k[1],l[1],m[1],f,b,g);e[2]=this.interpolate(h[2],k[2],l[2],m[2],f,b,g);return e}; +THREE.Animation.prototype.interpolateCatmullRom=function(a,c){var b=[],e=[],f,h,g,k,l,m;f=(a.length-1)*c;h=Math.floor(f);f-=h;b[0]=h===0?h:h-1;b[1]=h;b[2]=h>a.length-2?h:h+1;b[3]=h>a.length-3?h:h+2;h=a[b[0]];k=a[b[1]];l=a[b[2]];m=a[b[3]];b=f*f;g=f*b;e[0]=this.interpolate(h[0],k[0],l[0],m[0],f,b,g);e[1]=this.interpolate(h[1],k[1],l[1],m[1],f,b,g);e[2]=this.interpolate(h[2],k[2],l[2],m[2],f,b,g);return e}; THREE.Animation.prototype.interpolate=function(a,c,b,e,f,h,g){a=(b-a)*0.5;e=(e-c)*0.5;return(2*(c-b)+a+e)*g+(-3*(c-b)-2*a-e)*h+a*f+c};THREE.Animation.prototype.getNextKeyWith=function(a,c,b){var e=this.data.hierarchy[c].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?b=b0?b:0:b>=0?b:b+e.length;b>=0;b--)if(e[b][a]!==void 0)return e[b];return this.data.hierarchy[c].keys[e.length-1]}; THREE.CubeCamera=function(a,c,b,e){this.heightOffset=b;this.position=new THREE.Vector3(0,b,0);this.cameraPX=new THREE.PerspectiveCamera(90,1,a,c);this.cameraNX=new THREE.PerspectiveCamera(90,1,a,c);this.cameraPY=new THREE.PerspectiveCamera(90,1,a,c);this.cameraNY=new THREE.PerspectiveCamera(90,1,a,c);this.cameraPZ=new THREE.PerspectiveCamera(90,1,a,c);this.cameraNZ=new THREE.PerspectiveCamera(90,1,a,c);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position= @@ -135,22 +135,22 @@ this.rotateCamera();this.noZoom||this.zoomCamera();this.noPan||this.panCamera(); (f===this.STATE.ROTATE?k=this.getMouseProjectionOnBall(a.clientX,a.clientY):f===this.STATE.ZOOM&&!this.noZoom?m=this.getMouseOnScreen(a.clientX,a.clientY):f===this.STATE.PAN&&!this.noPan&&(o=this.getMouseOnScreen(a.clientX,a.clientY)))}),!1);this.domElement.addEventListener("mousedown",b(this,function(a){a.preventDefault();a.stopPropagation();if(f===this.STATE.NONE)f=a.button,f===this.STATE.ROTATE?g=k=this.getMouseProjectionOnBall(a.clientX,a.clientY):f===this.STATE.ZOOM&&!this.noZoom?l=m=this.getMouseOnScreen(a.clientX, a.clientY):this.noPan||(n=o=this.getMouseOnScreen(a.clientX,a.clientY))}),!1);this.domElement.addEventListener("mouseup",b(this,function(a){a.preventDefault();a.stopPropagation();f=this.STATE.NONE}),!1);window.addEventListener("keydown",b(this,function(a){if(f===this.STATE.NONE){if(a.keyCode===this.keys[this.STATE.ROTATE])f=this.STATE.ROTATE;else if(a.keyCode===this.keys[this.STATE.ZOOM]&&!this.noZoom)f=this.STATE.ZOOM;else if(a.keyCode===this.keys[this.STATE.PAN]&&!this.noPan)f=this.STATE.PAN;f!== this.STATE.NONE&&(e=!0)}}),!1);window.addEventListener("keyup",b(this,function(){if(f!==this.STATE.NONE)f=this.STATE.NONE}),!1)};THREE.TrackballControls.prototype.STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2}; -THREE.CubeGeometry=function(a,c,b,e,f,h,g,k){function l(a,b,c,g,k,l,o,n){var p,t,u=e||1,v=f||1,z=k/2,x=l/2,w=m.vertices.length;if(a=="x"&&b=="y"||a=="y"&&b=="x")p="z";else if(a=="x"&&b=="z"||a=="z"&&b=="x")p="y",v=h||1;else if(a=="z"&&b=="y"||a=="y"&&b=="z")p="x",u=h||1;var y=u+1,O=v+1;k/=u;var R=l/v;for(t=0;t0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,g,0)));for(k=0;k0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-g,0)));for(k=0;ka&&(a+=Math.PI*2),anglec=(b+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(k).subSelf(a).clone()}function f(a){for(C=a.length;--C>=0;){S=C;T=C-1;T<0&&(T=a.length- +k.copy(b).addSelf(h);l.copy(c).addSelf(f);h=e.dot(f);f=l.subSelf(k).dot(f);h===0&&(console.log("Either infinite or no solutions!"),f===0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));f/=h;if(f<0)return b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=Math.PI*2),anglec=(b+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(k).subSelf(a).clone()}function f(a){for(C=a.length;--C>=0;){S=C;T=C-1;T<0&&(T=a.length- 1);for(var b=0,c=t+n*2,b=0;b=0;J--){M=J/n;N=l*(1-M);M=m*Math.sin(M*Math.PI/2);C=0;for(F=x.length;C=0;J--){M=J/n;N=l*(1-M);M=m*Math.sin(M*Math.PI/2);C=0;for(F=x.length;C=this.maxCount-3&&k(this)};this.begin=function(){this.count=0; -this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!=0){for(var c=this.count*3;cthis.size-1&&(l=this.size-1);var u=Math.floor(m-k);u<1&&(u=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var t=Math.floor(n-k);t<1&&(t=1);k=Math.floor(n+k);k>this.size-1&&(k=this.size- -1);for(var z,v,p,y,x,w;o0&&(this.field[p+z]+=y)}}};this.addPlaneX=function(a,c){var f,h,g,k,l,m=this.size,n=this.yd,o=this.zd,u=this.field,t=m*Math.sqrt(a/c);t>m&&(t=m);for(f=0;f0)for(h=0;hn&&(z=n);for(h=0;h0){l=h*o;for(f=0;fsize&&(dist=size);for(g=0;g0){l=zd*g;for(h=0;h=this.maxCount-3&&k(this)};this.begin= +function(){this.count=0;this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!==0){for(var c=this.count*3;cthis.size-1&&(l=this.size-1);var u=Math.floor(m-k);u<1&&(u=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var t=Math.floor(n-k);t<1&&(t=1);k=Math.floor(n+k); +k>this.size-1&&(k=this.size-1);for(var z,v,p,y,x,w;o0&&(this.field[p+z]+=y)}}};this.addPlaneX=function(a,c){var f,h,g,k,l,m=this.size,n=this.yd,o=this.zd,u=this.field,t=m*Math.sqrt(a/c);t>m&&(t=m);for(f=0;f0)for(h=0;hn&&(z=n);for(h=0;h0){l=h*o;for(f=0;fsize&&(dist=size);for(g=0;g0){l=zd*g;for(h=0;h>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, -equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; +equals:function(a){return a.x===this.x&&a.y===this.y}};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.set(0,0,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 this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)}, @@ -15,8 +15,8 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x= 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.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,d=[];b=0;for(c=a.length;b0&&a>0&&e+a<1}for(var d,f=[],e=0,g=a.children.length;ea.scale.x)return[];d={distance:e,point:a.position,face:null,object:a};f.push(d)}else if(a instanceof THREE.Mesh){e=b(this.origin, -this.direction,a.matrixWorld.getPosition());if(e==null||e>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var i,k,h,j,m,n,l,p,q=a.geometry,v=q.vertices,e=0,g=q.faces.length;e0&&a>0&&e+a<1}for(var d,f=[],e=0,g=a.children.length;ea.scale.x)return[];d={distance:e,point:a.position,face:null,object:a};f.push(d)}else if(a instanceof THREE.Mesh){e= +b(this.origin,this.direction,a.matrixWorld.getPosition());if(e===null||e>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var i,k,h,j,m,n,l,p,q=a.geometry,v=q.vertices,e=0,g=q.faces.length;e0:n<0)))if(n=m.dot((new THREE.Vector3).sub(i,l))/n,l=l.addSelf(p.multiplyScalar(n)),d instanceof THREE.Face3)c(l,i,k,h)&&(d={distance:this.origin.distanceTo(l),point:l,face:d,object:a},f.push(d));else if(d instanceof THREE.Face4&&(c(l,i,k,j)||c(l,k,h,j)))d={distance:this.origin.distanceTo(l),point:l,face:d,object:a},f.push(d)}return f}}; THREE.Rectangle=function(){function a(){e=d-b;g=f-c}var b,c,d,f,e,g,i=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return e};this.getHeight=function(){return g};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return f};this.set=function(e,g,j,m){i=!1;b=e;c=g;d=j;f=m;a()};this.addPoint=function(e,g){i?(i=!1,b=e,c=g,d=e,f=g):(b=be?d:e,f=f>g?f:g);a()};this.add3Points= function(e,g,j,m,n,l){i?(i=!1,b=ej?e>n?e:n:j>n?j:n,f=g>m?g>l?g:l:m>l?m:l):(b=ej?e>n?e>d?e:d:n>d?n:d:j>n?j>d?j:d:n>d?n:d,f=g>m?g>l?g>f?g:f:l>f?l:f:m>l?m>f?m:f:l>f?l:f);a()};this.addRectangle=function(e){i?(i=!1,b=e.getLeft(),c=e.getTop(),d=e.getRight(),f=e.getBottom()):(b=be.getRight()?d:e.getRight(),f=f> @@ -44,7 +44,7 @@ c.y=f.length();c.z=e.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Mat a.n23*f;this.n33=a.n33*f}}; THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,d=a.n12,f=a.n13,e=a.n14,g=a.n21,i=a.n22,k=a.n23,h=a.n24,j=a.n31,m=a.n32,n=a.n33,l=a.n34,p=a.n41,q=a.n42,v=a.n43,u=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=k*l*q-h*n*q+h*m*v-i*l*v-k*m*u+i*n*u;b.n12=e*n*q-f*l*q-e*m*v+d*l*v+f*m*u-d*n*u;b.n13=f*h*q-e*k*q+e*i*v-d*h*v-f*i*u+d*k*u;b.n14=e*k*m-f*h*m-e*i*n+d*h*n+f*i*l-d*k*l;b.n21=h*n*p-k*l*p-h*j*v+g*l*v+k*j*u-g*n*u;b.n22=f*l*p-e*n*p+e*j*v-c*l*v-f*j*u+c*n*u;b.n23=e*k*p-f*h*p-e*g*v+c*h*v+f*g*u-c*k*u;b.n24= f*h*j-e*k*j+e*g*n-c*h*n-f*g*l+c*k*l;b.n31=i*l*p-h*m*p+h*j*q-g*l*q-i*j*u+g*m*u;b.n32=e*m*p-d*l*p-e*j*q+c*l*q+d*j*u-c*m*u;b.n33=f*h*p-e*i*p+e*g*q-c*h*q-d*g*u+c*i*u;b.n34=e*i*j-d*h*j-e*g*m+c*h*m+d*g*l-c*i*l;b.n41=k*m*p-i*n*p-k*j*q+g*n*q+i*j*v-g*m*v;b.n42=d*n*p-f*m*p+f*j*q-c*n*q-d*j*v+c*m*v;b.n43=f*i*p-d*k*p-f*g*q+c*k*q+d*g*v-c*i*v;b.n44=d*k*j-f*i*j+f*g*m-c*k*m-d*g*n+c*i*n;b.multiplyScalar(1/a.determinant());return b}; -THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,e=a.n32*a.n21-a.n31*a.n22,g=-a.n33*a.n12+a.n32*a.n13,i=a.n33*a.n11-a.n31*a.n13,k=-a.n32*a.n11+a.n31*a.n12,h=a.n23*a.n12-a.n22*a.n13,j=-a.n23*a.n11+a.n21*a.n13,m=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*g+a.n31*h;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*f;c[2]=a*e;c[3]=a*g;c[4]=a*i;c[5]=a*k;c[6]=a*h;c[7]=a*j;c[8]=a*m;return b}; +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,e=a.n32*a.n21-a.n31*a.n22,g=-a.n33*a.n12+a.n32*a.n13,i=a.n33*a.n11-a.n31*a.n13,k=-a.n32*a.n11+a.n31*a.n12,h=a.n23*a.n12-a.n22*a.n13,j=-a.n23*a.n11+a.n21*a.n13,m=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*g+a.n31*h;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*f;c[2]=a*e;c[3]=a*g;c[4]=a*i;c[5]=a*k;c[6]=a*h;c[7]=a*j;c[8]=a*m;return b}; THREE.Matrix4.makeFrustum=function(a,b,c,d,f,e){var g;g=new THREE.Matrix4;g.n11=2*f/(b-a);g.n12=0;g.n13=(b+a)/(b-a);g.n14=0;g.n21=0;g.n22=2*f/(d-c);g.n23=(d+c)/(d-c);g.n24=0;g.n31=0;g.n32=0;g.n33=-(e+f)/(e-f);g.n34=-2*e*f/(e-f);g.n41=0;g.n42=0;g.n43=-1;g.n44=0;return g};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,e){var g,i,k,h;g=new THREE.Matrix4;i=b-a;k=c-d;h=e-f;g.n11=2/i;g.n12=0;g.n13=0;g.n14=-((b+a)/i);g.n21=0;g.n22=2/k;g.n23=0;g.n24=-((c+d)/k);g.n31=0;g.n32=0;g.n33=-2/h;g.n34=-((e+f)/h);g.n41=0;g.n42=0;g.n43=0;g.n44=1;return g};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= @@ -67,7 +67,7 @@ E.multiplyVector4(r.positionScreen),J=k[i-2],F.copy(r.positionScreen),G.copy(J.p Q,u.x=y.x/y.w,u.y=y.y/y.w,u.z=y.z,u.rotation=B.rotation.z,u.scale.x=B.scale.x*Math.abs(u.x-(y.x+e.projectionMatrix.n11)/(y.w+e.projectionMatrix.n14)),u.scale.y=B.scale.y*Math.abs(u.y-(y.y+e.projectionMatrix.n22)/(y.w+e.projectionMatrix.n24)),u.materials=B.materials,w.push(u);f&&w.sort(b);return w}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==void 0?d:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,f=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-f),f=Math.sin(-f),e=Math.cos(c),c=Math.sin(c),g=a*b,i=d*f;this.w=g*e-i*c;this.x=g*c+i*e;this.y=d*b*e+a*f*c;this.z=a*f*e-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.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,e=a.x,g=a.y,i=a.z,a=a.w;this.x=b*a+f*e+c*i-d*g;this.y=c*a+f*g+d*e-b*i;this.z=d*a+f*i+b*g-c*e;this.w=f*a-b*e-c*g-d*i;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,f=a.z,e=this.x,g=this.y,i=this.z,k=this.w,h=k*c+g*f-i*d,j=k*d+i*c-e*f,m=k*f+e*d-g*c,c=-e* c-g*d-i*f;b.x=h*k+c*-e+j*-i-m*-g;b.y=j*k+c*-g+m*-e-h*-i;b.z=m*k+c*-i+h*-g-j*-e;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;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var e=Math.acos(f),g=Math.sqrt(1-f*f);if(Math.abs(g)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-d)*e)/g;d=Math.sin(d*e)/g;c.w=a.w*f+b.w*d;c.x=a.x*f+b.x*d;c.y=a.y*f+b.y*d;c.z=a.z*f+b.z*d;return c}; THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,d,f,e){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=e;this.centroid=new THREE.Vector3}; @@ -76,7 +76,7 @@ THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;ret THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,d=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+ Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, -equals:function(a){return a.x==this.x&&a.y==this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; +equals:function(a){return a.x===this.x&&a.y===this.y}};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.set(0,0,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 this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)}, @@ -15,8 +15,8 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,e){this.x= 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.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,e=[];b=0;for(c=a.length;b0&&a>0&&h+a<1}for(var e,f=[],h=0,i=a.children.length;ha.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h=b(this.origin, -this.direction,a.matrixWorld.getPosition());if(h==null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var j,m,k,o,p,l,t,A,C=a.geometry,E=C.vertices,h=0,i=C.faces.length;h0&&a>0&&h+a<1}for(var e,f=[],h=0,i=a.children.length;ha.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h= +b(this.origin,this.direction,a.matrixWorld.getPosition());if(h===null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var j,m,k,o,p,l,t,A,C=a.geometry,E=C.vertices,h=0,i=C.faces.length;h0:l<0)))if(l=p.dot((new THREE.Vector3).sub(j,t))/l,t=t.addSelf(A.multiplyScalar(l)),e instanceof THREE.Face3)c(t,j,m,k)&&(e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(t,j,m,o)||c(t,m,k,o)))e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e)}return f}}; THREE.Rectangle=function(){function a(){h=e-b;i=f-c}var b,c,e,f,h,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(h,i,o,p){j=!1;b=h;c=i;e=o;f=p;a()};this.addPoint=function(h,i){j?(j=!1,b=h,c=i,e=h,f=i):(b=bh?e:h,f=f>i?f:i);a()};this.add3Points= function(h,i,o,p,l,t){j?(j=!1,b=ho?h>l?h:l:o>l?o:l,f=i>p?i>t?i:t:p>t?p:t):(b=ho?h>l?h>e?h:e:l>e?l:e:o>l?o>e?o:e:l>e?l:e,f=i>p?i>t?i>f?i:f:t>f?t:f:p>t?p>f?p:f:t>f?t:f);a()};this.addRectangle=function(h){j?(j=!1,b=h.getLeft(),c=h.getTop(),e=h.getRight(),f=h.getBottom()):(b=bh.getRight()?e:h.getRight(),f=f> @@ -44,7 +44,7 @@ c.y=f.length();c.z=h.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;e=THREE.Mat a.n23*f;this.n33=a.n33*f}}; THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,m=a.n23,k=a.n24,o=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=m*t*C-k*l*C+k*p*E-j*t*E-m*p*B+j*l*B;b.n12=h*l*C-f*t*C-h*p*E+e*t*E+f*p*B-e*l*B;b.n13=f*k*C-h*m*C+h*j*E-e*k*E-f*j*B+e*m*B;b.n14=h*m*p-f*k*p-h*j*l+e*k*l+f*j*t-e*m*t;b.n21=k*l*A-m*t*A-k*o*E+i*t*E+m*o*B-i*l*B;b.n22=f*t*A-h*l*A+h*o*E-c*t*E-f*o*B+c*l*B;b.n23=h*m*A-f*k*A-h*i*E+c*k*E+f*i*B-c*m*B;b.n24= f*k*o-h*m*o+h*i*l-c*k*l-f*i*t+c*m*t;b.n31=j*t*A-k*p*A+k*o*C-i*t*C-j*o*B+i*p*B;b.n32=h*p*A-e*t*A-h*o*C+c*t*C+e*o*B-c*p*B;b.n33=f*k*A-h*j*A+h*i*C-c*k*C-e*i*B+c*j*B;b.n34=h*j*o-e*k*o-h*i*p+c*k*p+e*i*t-c*j*t;b.n41=m*p*A-j*l*A-m*o*C+i*l*C+j*o*E-i*p*E;b.n42=e*l*A-f*p*A+f*o*C-c*l*C-e*o*E+c*p*E;b.n43=f*j*A-e*m*A-f*i*C+c*m*C+e*i*E-c*j*E;b.n44=e*m*o-f*j*o+f*i*p-c*m*p-e*i*l+c*j*l;b.multiplyScalar(1/a.determinant());return b}; -THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,m=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,o=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*k;a==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*m;c[6]=a*k;c[7]=a*o;c[8]=a*p;return b}; +THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,m=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,o=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*k;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*m;c[6]=a*k;c[7]=a*o;c[8]=a*p;return b}; THREE.Matrix4.makeFrustum=function(a,b,c,e,f,h){var i;i=new THREE.Matrix4;i.n11=2*f/(b-a);i.n12=0;i.n13=(b+a)/(b-a);i.n14=0;i.n21=0;i.n22=2*f/(e-c);i.n23=(e+c)/(e-c);i.n24=0;i.n31=0;i.n32=0;i.n33=-(h+f)/(h-f);i.n34=-2*h*f/(h-f);i.n41=0;i.n42=0;i.n43=-1;i.n44=0;return i};THREE.Matrix4.makePerspective=function(a,b,c,e){var f,a=c*Math.tan(a*Math.PI/360);f=-a;return THREE.Matrix4.makeFrustum(f*b,a*b,f,a,c,e)}; THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var i,j,m,k;i=new THREE.Matrix4;j=b-a;m=c-e;k=h-f;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/m;i.n23=0;i.n24=-((c+e)/m);i.n31=0;i.n32=0;i.n33=-2/k;i.n34=-((h+f)/k);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= @@ -67,7 +67,7 @@ W.multiplyVector4(S.positionScreen);ua=1;for(J=R.length;ua0&&F.z<1))za=wa[va]=wa[va]||new THREE.RenderableParticle,va++,B=za,B.x=F.x/F.w,B.y=F.y/F.w,B.z=F.z,B.rotation=O.rotation.z,B.scale.x=O.scale.x*Math.abs(B.x-(F.x+h.projectionMatrix.n11)/(F.w+h.projectionMatrix.n14)),B.scale.y=O.scale.y*Math.abs(B.y-(F.y+h.projectionMatrix.n22)/(F.w+h.projectionMatrix.n24)),B.materials=O.materials,qa.push(B);f&&qa.sort(b);return qa}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),h=Math.cos(c),c=Math.sin(c),i=a*b,j=e*f;this.w=i*h-j*c;this.x=i*c+j*h;this.y=e*b*h+a*f*c;this.z=a*f*h-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c); this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;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.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,e=this.z,f=this.w,h=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+f*h+c*j-e*i;this.y=c*a+f*i+e*h-b*j;this.z=e*a+f*j+b*i-c*h;this.w=f*a-b*h-c*i-e*j;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,h=this.x,i=this.y,j=this.z,m=this.w,k=m*c+i*f-j*e,o=m*e+j*c-h*f,p=m*f+h*e-i*c,c=-h* c-i*e-j*f;b.x=k*m+c*-h+o*-j-p*-i;b.y=o*m+c*-i+p*-h-k*-j;b.z=p*m+c*-j+k*-i-o*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),i=Math.sqrt(1-f*f);if(Math.abs(i)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/i;e=Math.sin(e*h)/i;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,e,f,h){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3}; @@ -76,7 +76,7 @@ THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;ret THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x], y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z< this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;bthis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;k=this.points[c[0]];o=this.points[c[1]]; +a[e]===void 0?(a[e]=h,b.push(this.vertices[h]),c[h]=b.length-1):c[h]=c[a[e]];h=0;for(i=this.faces.length;hthis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;k=this.points[c[0]];o=this.points[c[1]]; p=this.points[c[2]];l=this.points[c[3]];j=i*i;m=i*j;e.x=b(k.x,o.x,p.x,l.x,i,j,m);e.y=b(k.y,o.y,p.y,l.y,i,j,m);e.z=b(k.z,o.z,p.z,l.z,i,j,m);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;a object.scale.x ) { + if ( distance === null || distance > object.scale.x ) { return []; @@ -73,7 +73,7 @@ THREE.Ray.prototype = { var distance = distanceFromIntersection( this.origin, this.direction, object.matrixWorld.getPosition() ); - if ( distance == null || distance > object.geometry.boundingSphere.radius * Math.max( object.scale.x, Math.max( object.scale.y, object.scale.z ) ) ) { + if ( distance === null || distance > object.geometry.boundingSphere.radius * Math.max( object.scale.x, Math.max( object.scale.y, object.scale.z ) ) ) { return intersects; diff --git a/src/core/Spline.js b/src/core/Spline.js index 3365e617..0461e2b6 100644 --- a/src/core/Spline.js +++ b/src/core/Spline.js @@ -32,7 +32,7 @@ THREE.Spline = function ( points ) { intPoint = Math.floor( point ); weight = point - intPoint; - c[ 0 ] = intPoint == 0 ? intPoint : intPoint - 1; + c[ 0 ] = intPoint === 0 ? intPoint : intPoint - 1; c[ 1 ] = intPoint; c[ 2 ] = intPoint > this.points.length - 2 ? intPoint : intPoint + 1; c[ 3 ] = intPoint > this.points.length - 3 ? intPoint : intPoint + 2; diff --git a/src/core/Vector2.js b/src/core/Vector2.js index acf3a8b4..29a03afa 100644 --- a/src/core/Vector2.js +++ b/src/core/Vector2.js @@ -156,7 +156,7 @@ THREE.Vector2.prototype = { equals: function( v ) { - return ( ( v.x == this.x ) && ( v.y == this.y ) ); + return ( ( v.x === this.x ) && ( v.y === this.y ) ); } diff --git a/src/extras/ColorUtils.js b/src/extras/ColorUtils.js index 242497ca..7ec6208b 100644 --- a/src/extras/ColorUtils.js +++ b/src/extras/ColorUtils.js @@ -33,7 +33,7 @@ THREE.ColorUtils = { var saturation; var value = max; - if ( min == max ) { + if ( min === max ) { hue = 0; saturation = 0; @@ -43,11 +43,11 @@ THREE.ColorUtils = { var delta = ( max - min ); saturation = delta / max; - if ( r == max ) { + if ( r === max ) { hue = ( g - b ) / delta; - } else if ( g == max ) { + } else if ( g === max ) { hue = 2 + ( ( b - r ) / delta ); diff --git a/src/extras/ImageUtils.js b/src/extras/ImageUtils.js index 04da8a22..d1664532 100644 --- a/src/extras/ImageUtils.js +++ b/src/extras/ImageUtils.js @@ -28,8 +28,8 @@ THREE.ImageUtils = { images[ i ] = new Image(); images[ i ].onload = function () { - images.loadCount += 1; - if ( images.loadCount == 6 ) texture.needsUpdate = true; + images.loadCount += 1; + if ( images.loadCount === 6 ) texture.needsUpdate = true; if ( callback ) callback( this ); }; diff --git a/src/extras/animation/Animation.js b/src/extras/animation/Animation.js index 16f456bb..daaa4440 100644 --- a/src/extras/animation/Animation.js +++ b/src/extras/animation/Animation.js @@ -37,17 +37,17 @@ THREE.Animation.prototype.play = function( loop, startTimeMS ) { var h, hl = this.hierarchy.length, object; - + for ( h = 0; h < hl; h++ ) { object = this.hierarchy[ h ]; - + if ( this.interpolationType !== THREE.AnimationHandler.CATMULLROM_FORWARD ) { object.useQuaternion = true; } - + object.matrixAutoUpdate = true; if ( object.animationCache === undefined ) { @@ -89,15 +89,15 @@ THREE.Animation.prototype.play = function( loop, startTimeMS ) { THREE.Animation.prototype.pause = function() { if( this.isPaused ) { - + THREE.AnimationHandler.addToUpdate( this ); - + } else { - + THREE.AnimationHandler.removeFromUpdate( this ); - + } - + this.isPaused = !this.isPaused; }; @@ -110,31 +110,31 @@ THREE.Animation.prototype.stop = function() { this.isPlaying = false; this.isPaused = false; THREE.AnimationHandler.removeFromUpdate( this ); - - + + // reset JIT matrix and remove cache - + for ( var h = 0; h < this.hierarchy.length; h++ ) { - + if ( this.hierarchy[ h ].animationCache !== undefined ) { - + if( this.hierarchy[ h ] instanceof THREE.Bone ) { - + this.hierarchy[ h ].skinMatrix = this.hierarchy[ h ].animationCache.originalMatrix; - + } else { - + this.hierarchy[ h ].matrix = this.hierarchy[ h ].animationCache.originalMatrix; } - - + + delete this.hierarchy[ h ].animationCache; } } - + }; @@ -161,10 +161,10 @@ THREE.Animation.prototype.update = function( deltaTimeMS ) { var JIThierarchy = this.data.JIT.hierarchy; var currentTime, unloopedCurrentTime; var currentPoint, forwardPoint, angle; - + // update - + this.currentTime += deltaTimeMS * this.timeScale; unloopedCurrentTime = this.currentTime; @@ -178,43 +178,43 @@ THREE.Animation.prototype.update = function( deltaTimeMS ) { object = this.hierarchy[ h ]; animationCache = object.animationCache; - + // use JIT? - + if ( this.JITCompile && JIThierarchy[ h ][ frame ] !== undefined ) { if( object instanceof THREE.Bone ) { - + object.skinMatrix = JIThierarchy[ h ][ frame ]; - + object.matrixAutoUpdate = false; object.matrixWorldNeedsUpdate = false; } else { - + object.matrix = JIThierarchy[ h ][ frame ]; - + object.matrixAutoUpdate = false; object.matrixWorldNeedsUpdate = true; } - + // use interpolation - + } else { // make sure so original matrix and not JIT matrix is set if ( this.JITCompile ) { - + if( object instanceof THREE.Bone ) { - + object.skinMatrix = object.animationCache.originalMatrix; - + } else { - + object.matrix = object.animationCache.originalMatrix; - + } } @@ -244,10 +244,10 @@ THREE.Animation.prototype.update = function( deltaTimeMS ) { nextKey = this.getNextKeyWith( type, h, 1 ); while( nextKey.time < currentTime ) { - + prevKey = nextKey; nextKey = this.getNextKeyWith( type, h, nextKey.index + 1 ); - + } } else { @@ -286,7 +286,7 @@ THREE.Animation.prototype.update = function( deltaTimeMS ) { if ( scale < 0 || scale > 1 ) { - console.log( "THREE.Animation.update: Warning! Scale out of bounds:" + scale + " on bone " + h ); + console.log( "THREE.Animation.update: Warning! Scale out of bounds:" + scale + " on bone " + h ); scale = scale < 0 ? 0 : 1; } @@ -295,17 +295,17 @@ THREE.Animation.prototype.update = function( deltaTimeMS ) { if ( type === "pos" ) { - vector = object.position; + vector = object.position; if( this.interpolationType === THREE.AnimationHandler.LINEAR ) { - + vector.x = prevXYZ[ 0 ] + ( nextXYZ[ 0 ] - prevXYZ[ 0 ] ) * scale; vector.y = prevXYZ[ 1 ] + ( nextXYZ[ 1 ] - prevXYZ[ 1 ] ) * scale; vector.z = prevXYZ[ 2 ] + ( nextXYZ[ 2 ] - prevXYZ[ 2 ] ) * scale; } else if ( this.interpolationType === THREE.AnimationHandler.CATMULLROM || - this.interpolationType === THREE.AnimationHandler.CATMULLROM_FORWARD ) { - + this.interpolationType === THREE.AnimationHandler.CATMULLROM_FORWARD ) { + this.points[ 0 ] = this.getPrevKeyWith( "pos", h, prevKey.index - 1 )[ "pos" ]; this.points[ 1 ] = prevXYZ; this.points[ 2 ] = nextXYZ; @@ -314,23 +314,23 @@ THREE.Animation.prototype.update = function( deltaTimeMS ) { scale = scale * 0.33 + 0.33; currentPoint = this.interpolateCatmullRom( this.points, scale ); - + vector.x = currentPoint[ 0 ]; vector.y = currentPoint[ 1 ]; vector.z = currentPoint[ 2 ]; - + if( this.interpolationType === THREE.AnimationHandler.CATMULLROM_FORWARD ) { - - forwardPoint = this.interpolateCatmullRom( this.points, scale * 1.01 ); - + + forwardPoint = this.interpolateCatmullRom( this.points, scale * 1.01 ); + this.target.set( forwardPoint[ 0 ], forwardPoint[ 1 ], forwardPoint[ 2 ] ); this.target.subSelf( vector ); this.target.y = 0; this.target.normalize(); - + angle = Math.atan2( this.target.x, this.target.z ); object.rotation.set( 0, angle, 0 ); - + } } @@ -342,7 +342,7 @@ THREE.Animation.prototype.update = function( deltaTimeMS ) { } else if( type === "scl" ) { vector = object.scale; - + vector.x = prevXYZ[ 0 ] + ( nextXYZ[ 0 ] - prevXYZ[ 0 ] ) * scale; vector.y = prevXYZ[ 1 ] + ( nextXYZ[ 1 ] - prevXYZ[ 1 ] ) * scale; vector.z = prevXYZ[ 2 ] + ( nextXYZ[ 2 ] - prevXYZ[ 2 ] ) * scale; @@ -358,25 +358,25 @@ THREE.Animation.prototype.update = function( deltaTimeMS ) { // update JIT? if ( this.JITCompile ) { - + if ( JIThierarchy[ 0 ][ frame ] === undefined ) { - + this.hierarchy[ 0 ].update( undefined, true ); - + for ( var h = 0; h < this.hierarchy.length; h++ ) { - + if( this.hierarchy[ h ] instanceof THREE.Bone ) { - + JIThierarchy[ h ][ frame ] = this.hierarchy[ h ].skinMatrix.clone(); - + } else { - + JIThierarchy[ h ][ frame ] = this.hierarchy[ h ].matrix.clone(); - + } - + } - + } } @@ -384,18 +384,18 @@ THREE.Animation.prototype.update = function( deltaTimeMS ) { }; // Catmull-Rom spline - + THREE.Animation.prototype.interpolateCatmullRom = function ( points, scale ) { var c = [], v3 = [], point, intPoint, weight, w2, w3, pa, pb, pc, pd; - + point = ( points.length - 1 ) * scale; intPoint = Math.floor( point ); weight = point - intPoint; - c[ 0 ] = intPoint == 0 ? intPoint : intPoint - 1; + c[ 0 ] = intPoint === 0 ? intPoint : intPoint - 1; c[ 1 ] = intPoint; c[ 2 ] = intPoint > points.length - 2 ? intPoint : intPoint + 1; c[ 3 ] = intPoint > points.length - 3 ? intPoint : intPoint + 2; @@ -407,11 +407,11 @@ THREE.Animation.prototype.interpolateCatmullRom = function ( points, scale ) { w2 = weight * weight; w3 = weight * w2; - + v3[ 0 ] = this.interpolate( pa[ 0 ], pb[ 0 ], pc[ 0 ], pd[ 0 ], weight, w2, w3 ); v3[ 1 ] = this.interpolate( pa[ 1 ], pb[ 1 ], pc[ 1 ], pd[ 1 ], weight, w2, w3 ); v3[ 2 ] = this.interpolate( pa[ 2 ], pb[ 2 ], pc[ 2 ], pd[ 2 ], weight, w2, w3 ); - + return v3; }; @@ -430,16 +430,16 @@ THREE.Animation.prototype.interpolate = function( p0, p1, p2, p3, t, t2, t3 ) { // Get next key with THREE.Animation.prototype.getNextKeyWith = function( type, h, key ) { - + var keys = this.data.hierarchy[ h ].keys; - + if ( this.interpolationType === THREE.AnimationHandler.CATMULLROM || this.interpolationType === THREE.AnimationHandler.CATMULLROM_FORWARD ) { - + key = key < keys.length - 1 ? key : keys.length - 1; } else { - + key = key % keys.length; } @@ -461,16 +461,16 @@ THREE.Animation.prototype.getNextKeyWith = function( type, h, key ) { // Get previous key with THREE.Animation.prototype.getPrevKeyWith = function( type, h, key ) { - + var keys = this.data.hierarchy[ h ].keys; - + if ( this.interpolationType === THREE.AnimationHandler.CATMULLROM || this.interpolationType === THREE.AnimationHandler.CATMULLROM_FORWARD ) { - + key = key > 0 ? key : 0; } else { - + key = key >= 0 ? key : key + keys.length; } diff --git a/src/extras/geometries/CubeGeometry.js b/src/extras/geometries/CubeGeometry.js index 4228c15a..bea0958c 100644 --- a/src/extras/geometries/CubeGeometry.js +++ b/src/extras/geometries/CubeGeometry.js @@ -74,16 +74,16 @@ THREE.CubeGeometry = function ( width, height, depth, segmentsWidth, segmentsHei height_half = height / 2, offset = scope.vertices.length; - if ( ( u == 'x' && v == 'y' ) || ( u == 'y' && v == 'x' ) ) { + if ( ( u === 'x' && v === 'y' ) || ( u === 'y' && v === 'x' ) ) { w = 'z'; - } else if ( ( u == 'x' && v == 'z' ) || ( u == 'z' && v == 'x' ) ) { + } else if ( ( u === 'x' && v === 'z' ) || ( u === 'z' && v === 'x' ) ) { w = 'y'; gridY = segmentsDepth || 1; - } else if ( ( u == 'z' && v == 'y' ) || ( u == 'y' && v == 'z' ) ) { + } else if ( ( u === 'z' && v === 'y' ) || ( u === 'y' && v === 'z' ) ) { w = 'x'; gridX = segmentsDepth || 1; diff --git a/src/extras/geometries/ExtrudeGeometry.js b/src/extras/geometries/ExtrudeGeometry.js index 6a5e60e8..6dab4e5a 100644 --- a/src/extras/geometries/ExtrudeGeometry.js +++ b/src/extras/geometries/ExtrudeGeometry.js @@ -30,7 +30,7 @@ THREE.ExtrudeGeometry = function( shapes, options ) { - if( typeof( shapes ) == "undefined" ) { + if( typeof( shapes ) === "undefined" ) { shapes = []; return; @@ -312,11 +312,11 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) { // We should not reach these conditions - if ( v_dot_w_hat == 0 ) { + if ( v_dot_w_hat === 0 ) { console.log( "Either infinite or no solutions!" ); - if ( q_sub_p_dot_w_hat == 0 ) { + if ( q_sub_p_dot_w_hat === 0 ) { console.log( "Its finite solutions." ); @@ -348,8 +348,8 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) { for ( i = 0, il = contour.length, j = il-1, k = i + 1; i < il; i++, j++, k++ ) { - if ( j == il ) j = 0; - if ( k == il ) k = 0; + if ( j === il ) j = 0; + if ( k === il ) k = 0; // (j)---(i)---(k) // console.log('i,j,k', i, j , k) @@ -372,8 +372,8 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) { for ( i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i++, j++, k++ ) { - if ( j == il ) j = 0; - if ( k == il ) k = 0; + if ( j === il ) j = 0; + if ( k === il ) k = 0; // (j)---(i)---(k) oneHoleMovements[ i ]= getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] ); diff --git a/src/extras/objects/MarchingCubes.js b/src/extras/objects/MarchingCubes.js index f7942a6b..143cea07 100644 --- a/src/extras/objects/MarchingCubes.js +++ b/src/extras/objects/MarchingCubes.js @@ -54,7 +54,7 @@ THREE.MarchingCubes = function ( resolution, materials ) { this.hasNormal = false; this.positionArray = new Float32Array( this.maxCount * 3 ); - this.normalArray = new Float32Array( this.maxCount * 3 ); + this.normalArray = new Float32Array( this.maxCount * 3 ); }; @@ -117,7 +117,7 @@ THREE.MarchingCubes = function ( resolution, materials ) { var q3 = q * 3; - if ( this.normal_cache [ q3 ] == 0.0 ) { + if ( this.normal_cache [ q3 ] === 0.0 ) { this.normal_cache[ q3 ] = this.field[ q - 1 ] - this.field[ q + 1 ]; this.normal_cache[ q3 + 1 ] = this.field[ q - this.yd ] - this.field[ q + this.yd ]; @@ -163,16 +163,16 @@ THREE.MarchingCubes = function ( resolution, materials ) { // if cube is entirely in/out of the surface - bail, nothing to draw var bits = THREE.edgeTable[ cubeindex ]; - if ( bits == 0 ) return 0; + if ( bits === 0 ) return 0; var d = this.delta, - fx2 = fx + d, - fy2 = fy + d, + fx2 = fx + d, + fy2 = fy + d, fz2 = fz + d; // top of the cube - if ( bits & 1 ) { + if ( bits & 1 ) { this.compNorm( q ); this.compNorm( q1 ); @@ -180,23 +180,23 @@ THREE.MarchingCubes = function ( resolution, materials ) { }; - if ( bits & 2 ) { + if ( bits & 2 ) { - this.compNorm( q1 ); - this.compNorm( q1y ); + this.compNorm( q1 ); + this.compNorm( q1y ); this.VIntY( q1 * 3, this.vlist, this.nlist, 3, isol, fx2, fy, fz, field1, field3 ); }; - if ( bits & 4 ) { + if ( bits & 4 ) { - this.compNorm( qy ); - this.compNorm( q1y ); - this.VIntX( qy * 3, this.vlist, this.nlist, 6, isol, fx, fy2, fz, field2, field3 ); + this.compNorm( qy ); + this.compNorm( q1y ); + this.VIntX( qy * 3, this.vlist, this.nlist, 6, isol, fx, fy2, fz, field2, field3 ); }; - if ( bits & 8 ) { + if ( bits & 8 ) { this.compNorm( q ); this.compNorm( qy ); @@ -206,19 +206,19 @@ THREE.MarchingCubes = function ( resolution, materials ) { // bottom of the cube - if ( bits & 16 ) { + if ( bits & 16 ) { this.compNorm( qz ); this.compNorm( q1z ); - this.VIntX( qz * 3, this.vlist, this.nlist, 12, isol, fx, fy, fz2, field4, field5 ); + this.VIntX( qz * 3, this.vlist, this.nlist, 12, isol, fx, fy, fz2, field4, field5 ); }; - if ( bits & 32 ) { + if ( bits & 32 ) { - this.compNorm( q1z ); - this.compNorm( q1yz ); - this.VIntY( q1z * 3, this.vlist, this.nlist, 15, isol, fx2, fy, fz2, field5, field7 ); + this.compNorm( q1z ); + this.compNorm( q1yz ); + this.VIntY( q1z * 3, this.vlist, this.nlist, 15, isol, fx2, fy, fz2, field5, field7 ); }; @@ -226,7 +226,7 @@ THREE.MarchingCubes = function ( resolution, materials ) { this.compNorm( qyz ); this.compNorm( q1yz ); - this.VIntX( qyz * 3, this.vlist, this.nlist, 18, isol, fx, fy2, fz2, field6, field7 ); + this.VIntX( qyz * 3, this.vlist, this.nlist, 18, isol, fx, fy2, fz2, field6, field7 ); }; @@ -234,7 +234,7 @@ THREE.MarchingCubes = function ( resolution, materials ) { this.compNorm( qz ); this.compNorm( qyz ); - this.VIntY( qz * 3, this.vlist, this.nlist, 21, isol, fx, fy, fz2, field4, field6 ); + this.VIntY( qz * 3, this.vlist, this.nlist, 21, isol, fx, fy, fz2, field4, field6 ); }; @@ -252,7 +252,7 @@ THREE.MarchingCubes = function ( resolution, materials ) { this.compNorm( q1 ); this.compNorm( q1z ); - this.VIntZ( q1 * 3, this.vlist, this.nlist, 27, isol, fx2, fy, fz, field1, field5 ); + this.VIntZ( q1 * 3, this.vlist, this.nlist, 27, isol, fx2, fy, fz, field1, field5 ); }; @@ -260,15 +260,15 @@ THREE.MarchingCubes = function ( resolution, materials ) { this.compNorm( q1y ); this.compNorm( q1yz ); - this.VIntZ( q1y * 3, this.vlist, this.nlist, 30, isol, fx2, fy2, fz, field3, field7 ); + this.VIntZ( q1y * 3, this.vlist, this.nlist, 30, isol, fx2, fy2, fz, field3, field7 ); }; - if ( bits & 2048 ) { + if ( bits & 2048 ) { this.compNorm( qy ); this.compNorm( qyz ); - this.VIntZ( qy * 3, this.vlist, this.nlist, 33, isol, fx, fy2, fz, field2, field6 ); + this.VIntZ( qy * 3, this.vlist, this.nlist, 33, isol, fx, fy2, fz, field2, field6 ); }; @@ -319,15 +319,15 @@ THREE.MarchingCubes = function ( resolution, materials ) { this.positionArray[ c + 7 ] = pos[ o3 + 1 ]; this.positionArray[ c + 8 ] = pos[ o3 + 2 ]; - this.normalArray[ c ] = norm[ o1 ]; + this.normalArray[ c ] = norm[ o1 ]; this.normalArray[ c + 1 ] = norm[ o1 + 1 ]; this.normalArray[ c + 2 ] = norm[ o1 + 2 ]; - this.normalArray[ c + 3 ] = norm[ o2 ]; + this.normalArray[ c + 3 ] = norm[ o2 ]; this.normalArray[ c + 4 ] = norm[ o2 + 1 ]; this.normalArray[ c + 5 ] = norm[ o2 + 2 ]; - this.normalArray[ c + 6 ] = norm[ o3 ]; + this.normalArray[ c + 6 ] = norm[ o3 ]; this.normalArray[ c + 7 ] = norm[ o3 + 1 ]; this.normalArray[ c + 8 ] = norm[ o3 + 2 ]; @@ -354,7 +354,7 @@ THREE.MarchingCubes = function ( resolution, materials ) { this.end = function( render_callback ) { - if ( this.count == 0 ) + if ( this.count === 0 ) return; for ( var i = this.count * 3; i < this.positionArray.length; i++ ) @@ -602,7 +602,7 @@ THREE.MarchingCubes = function ( resolution, materials ) { var geo_callback = function( object ) { - var i, x, y, z, vertex, position, normal, + var i, x, y, z, vertex, position, normal, face, a, b, c, na, nb, nc; From 103154d2935c3b8369bf0ac98c61b4fc25801d7b Mon Sep 17 00:00:00 2001 From: alteredq Date: Fri, 21 Oct 2011 16:25:26 +0200 Subject: [PATCH 32/33] Removing some cruft in WebGLRenderer. --- build/Three.js | 118 +++++++++--------- build/custom/ThreeWebGL.js | 222 ++++++++++++++++----------------- src/renderers/WebGLRenderer.js | 121 +++++++----------- 3 files changed, 215 insertions(+), 246 deletions(-) diff --git a/build/Three.js b/build/Three.js index 7d8ff314..3545abc7 100644 --- a/build/Three.js +++ b/build/Three.js @@ -227,8 +227,8 @@ THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.lights_phong_fragment,THR 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,c){var b;a.material&&!(a.material instanceof THREE.MeshFaceMaterial)?b=a.material:c.materialIndex>=0&&(b=a.geometry.materials[c.materialIndex]);return b}function c(a,c,b){var e,f,k,h=a.vertices,l=h.length,n=a.colors,p=n.length,t=a.__vertexArray,o=a.__colorArray,u=a.__sortArray,v=a.__dirtyVertices,G=a.__dirtyColors,x=a.__webglCustomAttributesList,w;if(x){k=0;for(e=x.length;k=0)return a.geometry.materials[c.materialIndex]}function c(a,c,b){var e,f,k,h=a.vertices,l=h.length,n=a.colors,p=n.length,t=a.__vertexArray,o=a.__colorArray,u=a.__sortArray,v=a.__dirtyVertices,G=a.__dirtyColors,x=a.__webglCustomAttributesList,w;if(x){k=0;for(e=x.length;k=0;b--)a[b].object===c&&a.splice(b,1)}function K(a,c,b){a.push({buffer:c,object:b,opaque:null,transparent:null})} -function F(a){if(a!==Z){switch(a){case THREE.AdditiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE);break;case THREE.SubtractiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.SRC_COLOR);break;default:m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)}Z=a}}function M(a,c,b){(b.width&b.width- -1)===0&&(b.height&b.height-1)===0?(m.texParameteri(a,m.TEXTURE_WRAP_S,T(c.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,T(c.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,T(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,T(c.minFilter)),m.generateMipmap(a)):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,L(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,L(c.minFilter)))}function E(a,c){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit= -!0,a.__webglTexture=m.createTexture(),S.info.memory.textures++;m.activeTexture(m.TEXTURE0+c);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.image.width,a.image.height,0,T(a.format),m.UNSIGNED_BYTE,a.image.data):m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,a.image);M(m.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)}function O(a,c){m.bindRenderbuffer(m.RENDERBUFFER, -a);c.depthBuffer&&!c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):c.depthBuffer&&c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,c.width,c.height)}function V(a){var c=a instanceof THREE.WebGLRenderTargetCube; -if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=m.createTexture();if(c){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);M(m.TEXTURE_CUBE_MAP,a,a);for(var b=0;b<6;b++){a.__webglFramebuffer[b]=m.createFramebuffer();a.__webglRenderbuffer[b]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type), -null);var e=a,f=m.TEXTURE_CUBE_MAP_POSITIVE_X+b;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[b]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,f,e.__webglTexture,0);O(a.__webglRenderbuffer[b],a)}}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),M(m.TEXTURE_2D,a,a),m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null),b=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER, -a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,b,a.__webglTexture,0),m.bindRenderbuffer(m.RENDERBUFFER,a.__webglRenderbuffer),O(a.__webglRenderbuffer,a);c?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(c=c?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,b=a.width,a=a.height,f=e=0):(c=null,b=qa,a=la,e=na,f=fa);c!==ea&&(m.bindFramebuffer(m.FRAMEBUFFER, -c),m.viewport(e,f,b,a),ea=c)}function H(a){a instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function P(a,c){var b;a==="fragment"?b=m.createShader(m.FRAGMENT_SHADER):a==="vertex"&&(b=m.createShader(m.VERTEX_SHADER));m.shaderSource(b,c);m.compileShader(b);if(!m.getShaderParameter(b, -m.COMPILE_STATUS))return console.error(m.getShaderInfoLog(b)),console.error(c),null;return b}function L(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return m.NEAREST;default:return m.LINEAR}}function T(a){switch(a){case THREE.RepeatWrapping:return m.REPEAT;case THREE.ClampToEdgeWrapping:return m.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return m.MIRRORED_REPEAT;case THREE.NearestFilter:return m.NEAREST;case THREE.NearestMipMapNearestFilter:return m.NEAREST_MIPMAP_NEAREST; -case THREE.NearestMipMapLinearFilter:return m.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return m.LINEAR;case THREE.LinearMipMapNearestFilter:return m.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return m.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return m.BYTE;case THREE.UnsignedByteType:return m.UNSIGNED_BYTE;case THREE.ShortType:return m.SHORT;case THREE.UnsignedShortType:return m.UNSIGNED_SHORT;case THREE.IntType:return m.INT;case THREE.UnsignedShortType:return m.UNSIGNED_INT;case THREE.FloatType:return m.FLOAT; -case THREE.AlphaFormat:return m.ALPHA;case THREE.RGBFormat:return m.RGB;case THREE.RGBAFormat:return m.RGBA;case THREE.LuminanceFormat:return m.LUMINANCE;case THREE.LuminanceAlphaFormat:return m.LUMINANCE_ALPHA}return 0}var S=this,m,aa=[],U=null,ea=null,da=-1,ia=null,ha=0,ja=null,ca=null,Z=null,R=null,Y=null,X=null,ga=null,oa=null,na=0,fa=0,qa=0,la=0,ua=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],sa=new THREE.Matrix4,Da=new Float32Array(16), -Ea=new Float32Array(16),za=new THREE.Vector4,Fa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},xa=a.canvas!==void 0?a.canvas:document.createElement("canvas"),G=a.stencil!==void 0?a.stencil:!0,$=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,ma=a.antialias!==void 0?a.antialias:!1,I=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),N=a.clearAlpha!==void 0?a.clearAlpha:0,ta=a.maxLights!==void 0? -a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=xa;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled= -!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var pa,ka=[],a=THREE.ShaderLib.depthRGBA,ya=THREE.UniformsUtils.clone(a.uniforms),va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya}),Ca=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya,morphTargets:!0});va._shadowPass=!0;Ca._shadowPass=!0;try{if(!(m=xa.getContext("experimental-webgl",{antialias:ma,stencil:G,preserveDrawingBuffer:$})))throw"Error creating WebGL context."; -console.log(navigator.userAgent+" | "+m.getParameter(m.VERSION)+" | "+m.getParameter(m.VENDOR)+" | "+m.getParameter(m.RENDERER)+" | "+m.getParameter(m.SHADING_LANGUAGE_VERSION))}catch(Ba){console.error(Ba)}m.clearColor(0,0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.clearColor(I.r,I.g,I.b,N);this.context= -m;var Ga=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,W={};W.vertices=new Float32Array(16);W.faces=new Uint16Array(6);G=0;W.vertices[G++]=-1;W.vertices[G++]=-1;W.vertices[G++]=0;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=-1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=0;W.vertices[G++]=-1;W.vertices[G++]=1;W.vertices[G++]=0;G=W.vertices[G++]=0;W.faces[G++]=0;W.faces[G++]=1;W.faces[G++]=2;W.faces[G++]=0;W.faces[G++]=2;W.faces[G++]= -3;W.vertexBuffer=m.createBuffer();W.elementBuffer=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,W.vertexBuffer);m.bufferData(m.ARRAY_BUFFER,W.vertices,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,W.elementBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,W.faces,m.STATIC_DRAW);W.program=m.createProgram();m.attachShader(W.program,P("fragment",THREE.ShaderLib.sprite.fragmentShader));m.attachShader(W.program,P("vertex",THREE.ShaderLib.sprite.vertexShader));m.linkProgram(W.program);W.attributes={};W.uniforms= -{};W.attributes.position=m.getAttribLocation(W.program,"position");W.attributes.uv=m.getAttribLocation(W.program,"uv");W.uniforms.uvOffset=m.getUniformLocation(W.program,"uvOffset");W.uniforms.uvScale=m.getUniformLocation(W.program,"uvScale");W.uniforms.rotation=m.getUniformLocation(W.program,"rotation");W.uniforms.scale=m.getUniformLocation(W.program,"scale");W.uniforms.alignment=m.getUniformLocation(W.program,"alignment");W.uniforms.color=m.getUniformLocation(W.program,"color");W.uniforms.map=m.getUniformLocation(W.program, -"map");W.uniforms.opacity=m.getUniformLocation(W.program,"opacity");W.uniforms.useScreenCoordinates=m.getUniformLocation(W.program,"useScreenCoordinates");W.uniforms.affectedByDistance=m.getUniformLocation(W.program,"affectedByDistance");W.uniforms.screenPosition=m.getUniformLocation(W.program,"screenPosition");W.uniforms.modelViewMatrix=m.getUniformLocation(W.program,"modelViewMatrix");W.uniforms.projectionMatrix=m.getUniformLocation(W.program,"projectionMatrix");var Ta=!1;this.setSize=function(a, -c){xa.width=a;xa.height=c;this.setViewport(0,0,xa.width,xa.height)};this.setViewport=function(a,c,b,e){na=a;fa=c;qa=b;la=e;m.viewport(na,fa,qa,la)};this.setScissor=function(a,c,b,e){m.scissor(a,c,b,e)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColorHex=function(a,c){I.setHex(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.setClearColor=function(a,c){I.copy(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.getClearColor=function(){return I};this.getClearAlpha= -function(){return N};this.clear=function(a,c,b){var e=0;if(a===void 0||a)e|=m.COLOR_BUFFER_BIT;if(c===void 0||c)e|=m.DEPTH_BUFFER_BIT;if(b===void 0||b)e|=m.STENCIL_BUFFER_BIT;m.clear(e)};this.getContext=function(){return m};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(g in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[g]; -m.deleteBuffer(c.__webglVertexBuffer);m.deleteBuffer(c.__webglNormalBuffer);m.deleteBuffer(c.__webglTangentBuffer);m.deleteBuffer(c.__webglColorBuffer);m.deleteBuffer(c.__webglUVBuffer);m.deleteBuffer(c.__webglUV2Buffer);m.deleteBuffer(c.__webglSkinVertexABuffer);m.deleteBuffer(c.__webglSkinVertexBBuffer);m.deleteBuffer(c.__webglSkinIndicesBuffer);m.deleteBuffer(c.__webglSkinWeightsBuffer);m.deleteBuffer(c.__webglFaceBuffer);m.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var b=0,e=c.numMorphTargets;b< -e;b++)m.deleteBuffer(c.__webglMorphTargetsBuffers[b]);S.info.memory.geometries--}else if(a instanceof THREE.Ribbon)a=a.geometry,m.deleteBuffer(a.__webglVertexBuffer),m.deleteBuffer(a.__webglColorBuffer),S.info.memory.geometries--;else if(a instanceof THREE.Line)a=a.geometry,m.deleteBuffer(a.__webglVertexBuffer),m.deleteBuffer(a.__webglColorBuffer),S.info.memory.geometries--;else if(a instanceof THREE.ParticleSystem)a=a.geometry,m.deleteBuffer(a.__webglVertexBuffer),m.deleteBuffer(a.__webglColorBuffer), -S.info.memory.geometries--};this.deallocateTexture=function(a){if(a.__webglInit)a.__webglInit=!1,m.deleteTexture(a.__webglTexture),S.info.memory.textures--};this.initMaterial=function(a,c,b,e){var f,k,h,l;a instanceof THREE.MeshDepthMaterial?l="depth":a instanceof THREE.MeshNormalMaterial?l="normal":a instanceof THREE.MeshBasicMaterial?l="basic":a instanceof THREE.MeshLambertMaterial?l="lambert":a instanceof THREE.MeshPhongMaterial?l="phong":a instanceof THREE.LineBasicMaterial?l="basic":a instanceof -THREE.ParticleBasicMaterial&&(l="particle_basic");if(l){var n=THREE.ShaderLib[l];a.uniforms=THREE.UniformsUtils.clone(n.uniforms);a.vertexShader=n.vertexShader;a.fragmentShader=n.fragmentShader}var p,t,o;p=o=n=0;for(t=c.length;p=0;b--)a[b].object===c&&a.splice(b,1)}function K(a,c,b){a.push({buffer:c,object:b,opaque:null,transparent:null})}function F(a){if(a!==Z){switch(a){case THREE.AdditiveBlending:m.blendEquation(m.FUNC_ADD); +m.blendFunc(m.SRC_ALPHA,m.ONE);break;case THREE.SubtractiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.SRC_COLOR);break;default:m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)}Z=a}}function M(a,c,b){(b.width&b.width-1)===0&&(b.height&b.height-1)===0?(m.texParameteri(a,m.TEXTURE_WRAP_S,T(c.wrapS)),m.texParameteri(a, +m.TEXTURE_WRAP_T,T(c.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,T(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,T(c.minFilter)),m.generateMipmap(a)):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,L(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,L(c.minFilter)))}function E(a,c){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=m.createTexture(),S.info.memory.textures++; +m.activeTexture(m.TEXTURE0+c);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.image.width,a.image.height,0,T(a.format),m.UNSIGNED_BYTE,a.image.data):m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,a.image);M(m.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)}function O(a,c){m.bindRenderbuffer(m.RENDERBUFFER,a);c.depthBuffer&&!c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER, +m.DEPTH_COMPONENT16,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):c.depthBuffer&&c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,c.width,c.height)}function V(a){var c=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0; +if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=m.createTexture();if(c){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);M(m.TEXTURE_CUBE_MAP,a,a);for(var b=0;b<6;b++){a.__webglFramebuffer[b]=m.createFramebuffer();a.__webglRenderbuffer[b]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null);var e=a,f=m.TEXTURE_CUBE_MAP_POSITIVE_X+b;m.bindFramebuffer(m.FRAMEBUFFER, +a.__webglFramebuffer[b]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,f,e.__webglTexture,0);O(a.__webglRenderbuffer[b],a)}}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),M(m.TEXTURE_2D,a,a),m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null),b=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0, +b,a.__webglTexture,0),m.bindRenderbuffer(m.RENDERBUFFER,a.__webglRenderbuffer),O(a.__webglRenderbuffer,a);c?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(c=c?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,b=a.width,a=a.height,f=e=0):(c=null,b=qa,a=la,e=na,f=fa);c!==ea&&(m.bindFramebuffer(m.FRAMEBUFFER,c),m.viewport(e,f,b,a),ea=c)}function H(a){a instanceof THREE.WebGLRenderTargetCube? +(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function P(a,c){var b;a==="fragment"?b=m.createShader(m.FRAGMENT_SHADER):a==="vertex"&&(b=m.createShader(m.VERTEX_SHADER));m.shaderSource(b,c);m.compileShader(b);if(!m.getShaderParameter(b,m.COMPILE_STATUS))return console.error(m.getShaderInfoLog(b)),console.error(c), +null;return b}function L(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return m.NEAREST;default:return m.LINEAR}}function T(a){switch(a){case THREE.RepeatWrapping:return m.REPEAT;case THREE.ClampToEdgeWrapping:return m.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return m.MIRRORED_REPEAT;case THREE.NearestFilter:return m.NEAREST;case THREE.NearestMipMapNearestFilter:return m.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return m.NEAREST_MIPMAP_LINEAR; +case THREE.LinearFilter:return m.LINEAR;case THREE.LinearMipMapNearestFilter:return m.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return m.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return m.BYTE;case THREE.UnsignedByteType:return m.UNSIGNED_BYTE;case THREE.ShortType:return m.SHORT;case THREE.UnsignedShortType:return m.UNSIGNED_SHORT;case THREE.IntType:return m.INT;case THREE.UnsignedShortType:return m.UNSIGNED_INT;case THREE.FloatType:return m.FLOAT;case THREE.AlphaFormat:return m.ALPHA; +case THREE.RGBFormat:return m.RGB;case THREE.RGBAFormat:return m.RGBA;case THREE.LuminanceFormat:return m.LUMINANCE;case THREE.LuminanceAlphaFormat:return m.LUMINANCE_ALPHA}return 0}var S=this,m,aa=[],U=null,ea=null,da=-1,ia=null,ha=0,ja=null,ca=null,Z=null,R=null,Y=null,X=null,ga=null,oa=null,na=0,fa=0,qa=0,la=0,ua=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],sa=new THREE.Matrix4,Da=new Float32Array(16),Ea=new Float32Array(16),za=new THREE.Vector4, +Fa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},xa=a.canvas!==void 0?a.canvas:document.createElement("canvas"),G=a.stencil!==void 0?a.stencil:!0,$=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,ma=a.antialias!==void 0?a.antialias:!1,I=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),N=a.clearAlpha!==void 0?a.clearAlpha:0,ta=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0, +geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=xa;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate= +!0;var pa,ka=[],a=THREE.ShaderLib.depthRGBA,ya=THREE.UniformsUtils.clone(a.uniforms),va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya}),Ca=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya,morphTargets:!0});va._shadowPass=!0;Ca._shadowPass=!0;try{if(!(m=xa.getContext("experimental-webgl",{antialias:ma,stencil:G,preserveDrawingBuffer:$})))throw"Error creating WebGL context.";console.log(navigator.userAgent+ +" | "+m.getParameter(m.VERSION)+" | "+m.getParameter(m.VENDOR)+" | "+m.getParameter(m.RENDERER)+" | "+m.getParameter(m.SHADING_LANGUAGE_VERSION))}catch(Ba){console.error(Ba)}m.clearColor(0,0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.clearColor(I.r,I.g,I.b,N);this.context=m;var Ga=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS)> +0,W={};W.vertices=new Float32Array(16);W.faces=new Uint16Array(6);G=0;W.vertices[G++]=-1;W.vertices[G++]=-1;W.vertices[G++]=0;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=-1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=0;W.vertices[G++]=-1;W.vertices[G++]=1;W.vertices[G++]=0;G=W.vertices[G++]=0;W.faces[G++]=0;W.faces[G++]=1;W.faces[G++]=2;W.faces[G++]=0;W.faces[G++]=2;W.faces[G++]=3;W.vertexBuffer=m.createBuffer();W.elementBuffer= +m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,W.vertexBuffer);m.bufferData(m.ARRAY_BUFFER,W.vertices,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,W.elementBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,W.faces,m.STATIC_DRAW);W.program=m.createProgram();m.attachShader(W.program,P("fragment",THREE.ShaderLib.sprite.fragmentShader));m.attachShader(W.program,P("vertex",THREE.ShaderLib.sprite.vertexShader));m.linkProgram(W.program);W.attributes={};W.uniforms={};W.attributes.position=m.getAttribLocation(W.program, +"position");W.attributes.uv=m.getAttribLocation(W.program,"uv");W.uniforms.uvOffset=m.getUniformLocation(W.program,"uvOffset");W.uniforms.uvScale=m.getUniformLocation(W.program,"uvScale");W.uniforms.rotation=m.getUniformLocation(W.program,"rotation");W.uniforms.scale=m.getUniformLocation(W.program,"scale");W.uniforms.alignment=m.getUniformLocation(W.program,"alignment");W.uniforms.color=m.getUniformLocation(W.program,"color");W.uniforms.map=m.getUniformLocation(W.program,"map");W.uniforms.opacity= +m.getUniformLocation(W.program,"opacity");W.uniforms.useScreenCoordinates=m.getUniformLocation(W.program,"useScreenCoordinates");W.uniforms.affectedByDistance=m.getUniformLocation(W.program,"affectedByDistance");W.uniforms.screenPosition=m.getUniformLocation(W.program,"screenPosition");W.uniforms.modelViewMatrix=m.getUniformLocation(W.program,"modelViewMatrix");W.uniforms.projectionMatrix=m.getUniformLocation(W.program,"projectionMatrix");var Ta=!1;this.setSize=function(a,c){xa.width=a;xa.height= +c;this.setViewport(0,0,xa.width,xa.height)};this.setViewport=function(a,c,b,e){na=a;fa=c;qa=b;la=e;m.viewport(na,fa,qa,la)};this.setScissor=function(a,c,b,e){m.scissor(a,c,b,e)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColorHex=function(a,c){I.setHex(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.setClearColor=function(a,c){I.copy(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.getClearColor=function(){return I};this.getClearAlpha=function(){return N}; +this.clear=function(a,c,b){var e=0;if(a===void 0||a)e|=m.COLOR_BUFFER_BIT;if(c===void 0||c)e|=m.DEPTH_BUFFER_BIT;if(b===void 0||b)e|=m.STENCIL_BUFFER_BIT;m.clear(e)};this.getContext=function(){return m};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(g in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[g];m.deleteBuffer(c.__webglVertexBuffer); +m.deleteBuffer(c.__webglNormalBuffer);m.deleteBuffer(c.__webglTangentBuffer);m.deleteBuffer(c.__webglColorBuffer);m.deleteBuffer(c.__webglUVBuffer);m.deleteBuffer(c.__webglUV2Buffer);m.deleteBuffer(c.__webglSkinVertexABuffer);m.deleteBuffer(c.__webglSkinVertexBBuffer);m.deleteBuffer(c.__webglSkinIndicesBuffer);m.deleteBuffer(c.__webglSkinWeightsBuffer);m.deleteBuffer(c.__webglFaceBuffer);m.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var b=0,e=c.numMorphTargets;b65535&&(G[v].counter+=1,u=G[v].hash+"_"+G[v].counter,l.geometryGroups[u]===void 0&&(l.geometryGroups[u]= -{faces:[],materialIndex:o,vertices:0,numMorphTargets:w})),l.geometryGroups[u].faces.push(n),l.geometryGroups[u].vertices+=t;l.geometryGroupsList=[];n=void 0;for(n in l.geometryGroups)l.geometryGroups[n].id=ha++,l.geometryGroupsList.push(l.geometryGroups[n])}for(k in h.geometryGroups)if(l=h.geometryGroups[k],!l.__webglVertexBuffer){n=l;n.__webglVertexBuffer=m.createBuffer();n.__webglNormalBuffer=m.createBuffer();n.__webglTangentBuffer=m.createBuffer();n.__webglColorBuffer=m.createBuffer();n.__webglUVBuffer= +v=t=void 0,u=void 0,G={},w=l.morphTargets.length;l.geometryGroups={};n=0;for(p=l.faces.length;n65535&&(G[v].counter+=1,u=G[v].hash+"_"+G[v].counter,l.geometryGroups[u]===void 0&&(l.geometryGroups[u]={faces:[], +materialIndex:o,vertices:0,numMorphTargets:w})),l.geometryGroups[u].faces.push(n),l.geometryGroups[u].vertices+=t;l.geometryGroupsList=[];n=void 0;for(n in l.geometryGroups)l.geometryGroups[n].id=ha++,l.geometryGroupsList.push(l.geometryGroups[n])}for(k in h.geometryGroups)if(l=h.geometryGroups[k],!l.__webglVertexBuffer){n=l;n.__webglVertexBuffer=m.createBuffer();n.__webglNormalBuffer=m.createBuffer();n.__webglTangentBuffer=m.createBuffer();n.__webglColorBuffer=m.createBuffer();n.__webglUVBuffer= m.createBuffer();n.__webglUV2Buffer=m.createBuffer();n.__webglSkinVertexABuffer=m.createBuffer();n.__webglSkinVertexBBuffer=m.createBuffer();n.__webglSkinIndicesBuffer=m.createBuffer();n.__webglSkinWeightsBuffer=m.createBuffer();n.__webglFaceBuffer=m.createBuffer();n.__webglLineBuffer=m.createBuffer();if(n.numMorphTargets){o=p=void 0;n.__webglMorphTargetsBuffers=[];p=0;for(o=n.numMorphTargets;p0||w.faceVertexUvs.length>0)l.__uvArray=new Float32Array(n*2);if(w.faceUvs.length>1||w.faceVertexUvs.length>1)l.__uv2Array=new Float32Array(n*2)}if(o.geometry.skinWeights.length&&o.geometry.skinIndices.length)l.__skinVertexAArray=new Float32Array(n*4),l.__skinVertexBArray=new Float32Array(n* @@ -317,32 +317,32 @@ l.__webglColorBuffer=m.createBuffer(),S.info.memory.geometries++,l=h,n=l.vertice 3);l.__sortArray=[];l.__webglParticleCount=n;p=p.material;if(p.attributes){if(l.__webglCustomAttributesList===void 0)l.__webglCustomAttributesList=[];o=void 0;for(o in p.attributes){originalAttribute=p.attributes[o];attribute={};for(property in originalAttribute)attribute[property]=originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=!0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=4: attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(n*size),attribute.buffer=m.createBuffer(),attribute.buffer.belongsToAttribute=o,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;l.__webglCustomAttributesList.push(attribute)}}h.__dirtyVertices=!0;h.__dirtyColors=!0}if(!e.__webglActive){if(e instanceof THREE.Mesh)for(k in h=e.geometry,h.geometryGroups)l=h.geometryGroups[k],K(f.__webglObjects,l,e);else e instanceof THREE.Ribbon||e instanceof THREE.Line|| e instanceof THREE.ParticleSystem?(h=e.geometry,K(f.__webglObjects,h,e)):THREE.MarchingCubes!==void 0&&e instanceof THREE.MarchingCubes||e.immediateRenderCallback?f.__webglObjectsImmediate.push({object:e,opaque:null,transparent:null}):e instanceof THREE.Sprite&&f.__webglSprites.push(e);e.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;){e=a.__objectsRemoved[0];f=a;if(e instanceof THREE.Mesh||e instanceof THREE.ParticleSystem||e instanceof THREE.Ribbon||e instanceof THREE.Line)B(f.__webglObjects, -e);else if(e instanceof THREE.Sprite){f=f.__webglSprites;k=e;h=void 0;for(h=f.length-1;h>=0;h--)f[h]===k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&B(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,da,v));Fa&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglNormalBuffer),m.bufferData(m.ARRAY_BUFFER,ya,v));xa&&sa.hasTangents&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglTangentBuffer),m.bufferData(m.ARRAY_BUFFER,aa,v));za&&qa>0&&(m.bindBuffer(m.ARRAY_BUFFER, -o.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,ia,v));za&&Y>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,ua,v));Ea&&(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,Ca,v),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,va,v));Q>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexABuffer),m.bufferData(m.ARRAY_BUFFER,ga,v),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexBBuffer), -m.bufferData(m.ARRAY_BUFFER,ea,v),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Z,v),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,ca,v));u&&(delete o.__inittedArrays,delete o.__colorArray,delete o.__normalArray,delete o.__tangentArray,delete o.__uvArray,delete o.__uv2Array,delete o.__faceArray,delete o.__vertexArray,delete o.__lineArray,delete o.__skinVertexAArray,delete o.__skinVertexBArray,delete o.__skinIndexArray,delete o.__skinWeightArray)}k.__dirtyVertices= -!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1;C(l,h)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;l=m.DYNAMIC_DRAW;n=G=u=u=void 0;w=h.vertices;p=h.colors;t=w.length;o=p.length;y=h.__vertexArray;v=h.__colorArray;ma=h.__dirtyColors;if(h.__dirtyVertices){for(u=0;u=0;h--)f[h]===k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&B(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,da,v));Fa&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglNormalBuffer),m.bufferData(m.ARRAY_BUFFER,ya,v));xa&&sa.hasTangents&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglTangentBuffer),m.bufferData(m.ARRAY_BUFFER,aa, +v));za&&qa>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,ia,v));za&&Y>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,ua,v));Ea&&(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,Ca,v),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,va,v));Q>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexABuffer),m.bufferData(m.ARRAY_BUFFER,ga,v),m.bindBuffer(m.ARRAY_BUFFER, +o.__webglSkinVertexBBuffer),m.bufferData(m.ARRAY_BUFFER,ea,v),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Z,v),m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,ca,v));u&&(delete o.__inittedArrays,delete o.__colorArray,delete o.__normalArray,delete o.__tangentArray,delete o.__uvArray,delete o.__uv2Array,delete o.__faceArray,delete o.__vertexArray,delete o.__lineArray,delete o.__skinVertexAArray,delete o.__skinVertexBArray,delete o.__skinIndexArray, +delete o.__skinWeightArray)}k.__dirtyVertices=!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyColors=!1;k.__dirtyTangents=!1;l.attributes&&C(l)}else if(h instanceof THREE.Ribbon){if(k.__dirtyVertices||k.__dirtyColors){h=k;l=m.DYNAMIC_DRAW;n=G=u=u=void 0;w=h.vertices;p=h.colors;t=w.length;o=p.length;y=h.__vertexArray;v=h.__colorArray;ma=h.__dirtyColors;if(h.__dirtyVertices){for(u=0;u0&&a>0&&h+a<1}for(var e,f=[],h=0,i=a.children.length;ha.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h= -b(this.origin,this.direction,a.matrixWorld.getPosition());if(h===null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var j,m,k,o,p,l,t,A,C=a.geometry,E=C.vertices,h=0,i=C.faces.length;h0:l<0)))if(l=p.dot((new THREE.Vector3).sub(j,t))/l,t=t.addSelf(A.multiplyScalar(l)),e instanceof THREE.Face3)c(t,j,m,k)&&(e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(t,j,m,o)||c(t,m,k,o)))e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e)}return f}}; -THREE.Rectangle=function(){function a(){h=e-b;i=f-c}var b,c,e,f,h,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(h,i,o,p){j=!1;b=h;c=i;e=o;f=p;a()};this.addPoint=function(h,i){j?(j=!1,b=h,c=i,e=h,f=i):(b=bh?e:h,f=f>i?f:i);a()};this.add3Points= -function(h,i,o,p,l,t){j?(j=!1,b=ho?h>l?h:l:o>l?o:l,f=i>p?i>t?i:t:p>t?p:t):(b=ho?h>l?h>e?h:e:l>e?l:e:o>l?o>e?o:e:l>e?l:e,f=i>p?i>t?i>f?i:f:t>f?t:f:p>t?p>f?p:f:t>f?t:f);a()};this.addRectangle=function(h){j?(j=!1,b=h.getLeft(),c=h.getTop(),e=h.getRight(),f=h.getBottom()):(b=bh.getRight()?e:h.getRight(),f=f> +b(this.origin,this.direction,a.matrixWorld.getPosition());if(h===null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var j,o,k,m,p,l,t,A,C=a.geometry,E=C.vertices,h=0,i=C.faces.length;h0:l<0)))if(l=p.dot((new THREE.Vector3).sub(j,t))/l,t=t.addSelf(A.multiplyScalar(l)),e instanceof THREE.Face3)c(t,j,o,k)&&(e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(t,j,o,m)||c(t,o,k,m)))e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e)}return f}}; +THREE.Rectangle=function(){function a(){h=e-b;i=f-c}var b,c,e,f,h,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(h,i,m,p){j=!1;b=h;c=i;e=m;f=p;a()};this.addPoint=function(h,i){j?(j=!1,b=h,c=i,e=h,f=i):(b=bh?e:h,f=f>i?f:i);a()};this.add3Points= +function(h,i,m,p,l,t){j?(j=!1,b=hm?h>l?h:l:m>l?m:l,f=i>p?i>t?i:t:p>t?p:t):(b=hm?h>l?h>e?h:e:l>e?l:e:m>l?m>e?m:e:l>e?l:e,f=i>p?i>t?i>f?i:f:t>f?t:f:p>t?p>f?p:f:t>f?t:f);a()};this.addRectangle=function(h){j?(j=!1,b=h.getLeft(),c=h.getTop(),e=h.getRight(),f=h.getBottom()):(b=bh.getRight()?e:h.getRight(),f=f> h.getBottom()?f:h.getBottom());a()};this.inflate=function(h){b-=h;c-=h;e+=h;f+=h;a()};this.minSelf=function(h){b=b>h.getLeft()?b:h.getLeft();c=c>h.getTop()?c:h.getTop();e=e=0&&Math.min(f,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){j=!0;f=e=c=b=0;a()};this.isEmpty=function(){return j}};THREE.Matrix3=function(){this.m=[]}; THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}}; -THREE.Matrix4=function(a,b,c,e,f,h,i,j,m,k,o,p,l,t,A,C){this.set(a!==void 0?a:1,b||0,c||0,e||0,f||0,h!==void 0?h:1,i||0,j||0,m||0,k||0,o!==void 0?o:1,p||0,l||0,t||0,A||0,C!==void 0?C:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,f,h,i,j,m,k,o,p,l,t,A,C){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=h;this.n23=i;this.n24=j;this.n31=m;this.n32=k;this.n33=o;this.n34=p;this.n41=l;this.n42=t;this.n43=A;this.n44=C;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, +THREE.Matrix4=function(a,b,c,e,f,h,i,j,o,k,m,p,l,t,A,C){this.set(a!==void 0?a:1,b||0,c||0,e||0,f||0,h!==void 0?h:1,i||0,j||0,o||0,k||0,m!==void 0?m:1,p||0,l||0,t||0,A||0,C!==void 0?C:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,f,h,i,j,o,k,m,p,l,t,A,C){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=h;this.n23=i;this.n24=j;this.n31=o;this.n32=k;this.n33=m;this.n34=p;this.n41=l;this.n42=t;this.n43=A;this.n44=C;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a, b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;h.sub(a,b).normalize();if(h.length()===0)h.z=1;e.cross(c,h).normalize();e.length()===0&&(h.x+=1.0E-4,e.cross(c,h).normalize());f.cross(h,e).normalize();this.n11=e.x;this.n12=f.x;this.n13=h.x;this.n21=e.y;this.n22=f.y;this.n23=h.y;this.n31=e.z;this.n32=f.z;this.n33=h.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,e=a.z,f=1/(this.n41*b+this.n42*c+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*e+this.n14)*f; a.y=(this.n21*b+this.n22*c+this.n23*e+this.n24)*f;a.z=(this.n31*b+this.n32*c+this.n33*e+this.n34)*f;return a},multiplyVector4:function(a){var b=a.x,c=a.y,e=a.z,f=a.w;a.x=this.n11*b+this.n12*c+this.n13*e+this.n14*f;a.y=this.n21*b+this.n22*c+this.n23*e+this.n24*f;a.z=this.n31*b+this.n32*c+this.n33*e+this.n34*f;a.w=this.n41*b+this.n42*c+this.n43*e+this.n44*f;return a},rotateAxis:function(a){var b=a.x,c=a.y,e=a.z;a.x=b*this.n11+c*this.n12+e*this.n13;a.y=b*this.n21+c*this.n22+e*this.n23;a.z=b*this.n31+ -c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,m=a.n23,k=a.n24,o=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44,va=b.n11,wa= -b.n12,pa=b.n13,qa=b.n14,N=b.n21,F=b.n22,z=b.n23,W=b.n24,U=b.n31,ja=b.n32,$=b.n33,xa=b.n34,Q=b.n41,G=b.n42,d=b.n43,ta=b.n44;this.n11=c*va+e*N+f*U+h*Q;this.n12=c*wa+e*F+f*ja+h*G;this.n13=c*pa+e*z+f*$+h*d;this.n14=c*qa+e*W+f*xa+h*ta;this.n21=i*va+j*N+m*U+k*Q;this.n22=i*wa+j*F+m*ja+k*G;this.n23=i*pa+j*z+m*$+k*d;this.n24=i*qa+j*W+m*xa+k*ta;this.n31=o*va+p*N+l*U+t*Q;this.n32=o*wa+p*F+l*ja+t*G;this.n33=o*pa+p*z+l*$+t*d;this.n34=o*qa+p*W+l*xa+t*ta;this.n41=A*va+C*N+E*U+B*Q;this.n42=A*wa+C*F+E*ja+B*G;this.n43= +c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,o=a.n23,k=a.n24,m=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44,va=b.n11,wa= +b.n12,pa=b.n13,qa=b.n14,N=b.n21,F=b.n22,z=b.n23,W=b.n24,U=b.n31,ja=b.n32,$=b.n33,xa=b.n34,Q=b.n41,G=b.n42,d=b.n43,ta=b.n44;this.n11=c*va+e*N+f*U+h*Q;this.n12=c*wa+e*F+f*ja+h*G;this.n13=c*pa+e*z+f*$+h*d;this.n14=c*qa+e*W+f*xa+h*ta;this.n21=i*va+j*N+o*U+k*Q;this.n22=i*wa+j*F+o*ja+k*G;this.n23=i*pa+j*z+o*$+k*d;this.n24=i*qa+j*W+o*xa+k*ta;this.n31=m*va+p*N+l*U+t*Q;this.n32=m*wa+p*F+l*ja+t*G;this.n33=m*pa+p*z+l*$+t*d;this.n34=m*qa+p*W+l*xa+t*ta;this.n41=A*va+C*N+E*U+B*Q;this.n42=A*wa+C*F+E*ja+B*G;this.n43= A*pa+C*z+E*$+B*d;this.n44=A*qa+C*W+E*xa+B*ta;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*= -a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,f=this.n21,h=this.n22,i=this.n23,j=this.n24,m=this.n31,k=this.n32,o=this.n33,p=this.n34,l=this.n41,t=this.n42,A=this.n43,C=this.n44;return e*i*k*l-c*j*k*l-e*h*o*l+b*j*o*l+c*h*p*l-b*i*p*l-e*i*m*t+c*j*m*t+e*f*o*t-a*j*o*t-c*f*p*t+a*i*p*t+e*h*m*A-b*j*m*A-e*f*k*A+a*j*k*A+b*f*p*A-a*h*p*A-c*h*m*C+b*i* -m*C+c*f*k*C-a*i*k*C-b*f*o*C+a*h*o*C},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32; +a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,f=this.n21,h=this.n22,i=this.n23,j=this.n24,o=this.n31,k=this.n32,m=this.n33,p=this.n34,l=this.n41,t=this.n42,A=this.n43,C=this.n44;return e*i*k*l-c*j*k*l-e*h*m*l+b*j*m*l+c*h*p*l-b*i*p*l-e*i*o*t+c*j*o*t+e*f*m*t-a*j*m*t-c*f*p*t+a*i*p*t+e*h*o*A-b*j*o*A-e*f*k*A+a*j*k*A+b*f*p*A-a*h*p*A-c*h*o*C+b*i* +o*C+c*f*k*C-a*i*k*C-b*f*m*C+a*h*m*C},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32; a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]= this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]= this.n34;a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0, -0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),e=Math.sin(b),f=1-c,h=a.x,i=a.y,j=a.z,m=f*h,k=f*i;this.set(m*h+c,m*i-e*j,m*j+e*i,0,m*i+e*j,k*i+c,k*j-e*h,0,m*j-e*i,k*j+e*h,f*j*j+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= -new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,e=a.y,f=a.z,h=Math.cos(c),c=Math.sin(c),i=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var m= -i*j,k=i*f,o=e*j,p=e*f;this.n11=m+p*c;this.n12=o*c-k;this.n13=h*e;this.n21=h*f;this.n22=h*j;this.n23=-c;this.n31=k*c-o;this.n32=p+m*c;this.n33=h*i;break;case "ZXY":m=i*j;k=i*f;o=e*j;p=e*f;this.n11=m-p*c;this.n12=-h*f;this.n13=o+k*c;this.n21=k+o*c;this.n22=h*j;this.n23=p-m*c;this.n31=-h*e;this.n32=c;this.n33=h*i;break;case "ZYX":m=h*j;k=h*f;o=c*j;p=c*f;this.n11=i*j;this.n12=o*e-k;this.n13=m*e+p;this.n21=i*f;this.n22=p*e+m;this.n23=k*e-o;this.n31=-e;this.n32=c*i;this.n33=h*i;break;case "YZX":m=h*i;k= -h*e;o=c*i;p=c*e;this.n11=i*j;this.n12=p-m*f;this.n13=o*f+k;this.n21=f;this.n22=h*j;this.n23=-c*j;this.n31=-e*j;this.n32=k*f+o;this.n33=m-p*f;break;case "XZY":m=h*i;k=h*e;o=c*i;p=c*e;this.n11=i*j;this.n12=-f;this.n13=e*j;this.n21=m*f+p;this.n22=h*j;this.n23=k*f-o;this.n31=o*f-k;this.n32=c*j;this.n33=p*f+m;break;default:m=h*j,k=h*f,o=c*j,p=c*f,this.n11=i*j,this.n12=-i*f,this.n13=e,this.n21=k+o*e,this.n22=m-p*e,this.n23=-c*i,this.n31=p-m*e,this.n32=o+k*e,this.n33=h*i}return this},setRotationFromQuaternion:function(a){var b= -a.x,c=a.y,e=a.z,f=a.w,h=b+b,i=c+c,j=e+e,a=b*h,m=b*i;b*=j;var k=c*i;c*=j;e*=j;h*=f;i*=f;f*=j;this.n11=1-(k+e);this.n12=m-f;this.n13=b+i;this.n21=m+f;this.n22=1-(a+e);this.n23=c-h;this.n31=b-i;this.n32=c+h;this.n33=1-(a+k);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=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 e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2; +0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),e=Math.sin(b),f=1-c,h=a.x,i=a.y,j=a.z,o=f*h,k=f*i;this.set(o*h+c,o*i-e*j,o*j+e*i,0,o*i+e*j,k*i+c,k*j-e*h,0,o*j-e*i,k*j+e*h,f*j*j+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= +new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,e=a.y,f=a.z,h=Math.cos(c),c=Math.sin(c),i=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var o= +i*j,k=i*f,m=e*j,p=e*f;this.n11=o+p*c;this.n12=m*c-k;this.n13=h*e;this.n21=h*f;this.n22=h*j;this.n23=-c;this.n31=k*c-m;this.n32=p+o*c;this.n33=h*i;break;case "ZXY":o=i*j;k=i*f;m=e*j;p=e*f;this.n11=o-p*c;this.n12=-h*f;this.n13=m+k*c;this.n21=k+m*c;this.n22=h*j;this.n23=p-o*c;this.n31=-h*e;this.n32=c;this.n33=h*i;break;case "ZYX":o=h*j;k=h*f;m=c*j;p=c*f;this.n11=i*j;this.n12=m*e-k;this.n13=o*e+p;this.n21=i*f;this.n22=p*e+o;this.n23=k*e-m;this.n31=-e;this.n32=c*i;this.n33=h*i;break;case "YZX":o=h*i;k= +h*e;m=c*i;p=c*e;this.n11=i*j;this.n12=p-o*f;this.n13=m*f+k;this.n21=f;this.n22=h*j;this.n23=-c*j;this.n31=-e*j;this.n32=k*f+m;this.n33=o-p*f;break;case "XZY":o=h*i;k=h*e;m=c*i;p=c*e;this.n11=i*j;this.n12=-f;this.n13=e*j;this.n21=o*f+p;this.n22=h*j;this.n23=k*f-m;this.n31=m*f-k;this.n32=c*j;this.n33=p*f+o;break;default:o=h*j,k=h*f,m=c*j,p=c*f,this.n11=i*j,this.n12=-i*f,this.n13=e,this.n21=k+m*e,this.n22=o-p*e,this.n23=-c*i,this.n31=p-o*e,this.n32=m+k*e,this.n33=h*i}return this},setRotationFromQuaternion:function(a){var b= +a.x,c=a.y,e=a.z,f=a.w,h=b+b,i=c+c,j=e+e,a=b*h,o=b*i;b*=j;var k=c*i;c*=j;e*=j;h*=f;i*=f;f*=j;this.n11=1-(k+e);this.n12=o-f;this.n13=b+i;this.n21=o+f;this.n22=1-(a+e);this.n23=c-h;this.n31=b-i;this.n32=c+h;this.n33=1-(a+k);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=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 e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2; e.identity();e.setRotationFromQuaternion(b);f.setScale(c.x,c.y,c.z);this.multiply(e,f);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;e.set(this.n11,this.n21,this.n31);f.set(this.n12,this.n22,this.n32);h.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=e.length(); c.y=f.length();c.z=h.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;e=THREE.Matrix4.__m1;e.copy(this);e.n11/=c.x;e.n21/=c.x;e.n31/=c.x;e.n12/=c.y;e.n22/=c.y;e.n32/=c.y;e.n13/=c.z;e.n23/=c.z;e.n33/=c.z;b.setFromRotationMatrix(e);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,e=1/b.y,f=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*e;this.n22=a.n22*e;this.n32=a.n32*e;this.n13=a.n13*f;this.n23= a.n23*f;this.n33=a.n33*f}}; -THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,m=a.n23,k=a.n24,o=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=m*t*C-k*l*C+k*p*E-j*t*E-m*p*B+j*l*B;b.n12=h*l*C-f*t*C-h*p*E+e*t*E+f*p*B-e*l*B;b.n13=f*k*C-h*m*C+h*j*E-e*k*E-f*j*B+e*m*B;b.n14=h*m*p-f*k*p-h*j*l+e*k*l+f*j*t-e*m*t;b.n21=k*l*A-m*t*A-k*o*E+i*t*E+m*o*B-i*l*B;b.n22=f*t*A-h*l*A+h*o*E-c*t*E-f*o*B+c*l*B;b.n23=h*m*A-f*k*A-h*i*E+c*k*E+f*i*B-c*m*B;b.n24= -f*k*o-h*m*o+h*i*l-c*k*l-f*i*t+c*m*t;b.n31=j*t*A-k*p*A+k*o*C-i*t*C-j*o*B+i*p*B;b.n32=h*p*A-e*t*A-h*o*C+c*t*C+e*o*B-c*p*B;b.n33=f*k*A-h*j*A+h*i*C-c*k*C-e*i*B+c*j*B;b.n34=h*j*o-e*k*o-h*i*p+c*k*p+e*i*t-c*j*t;b.n41=m*p*A-j*l*A-m*o*C+i*l*C+j*o*E-i*p*E;b.n42=e*l*A-f*p*A+f*o*C-c*l*C-e*o*E+c*p*E;b.n43=f*j*A-e*m*A-f*i*C+c*m*C+e*i*E-c*j*E;b.n44=e*m*o-f*j*o+f*i*p-c*m*p-e*i*l+c*j*l;b.multiplyScalar(1/a.determinant());return b}; -THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,m=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,o=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*k;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*m;c[6]=a*k;c[7]=a*o;c[8]=a*p;return b}; +THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,o=a.n23,k=a.n24,m=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=o*t*C-k*l*C+k*p*E-j*t*E-o*p*B+j*l*B;b.n12=h*l*C-f*t*C-h*p*E+e*t*E+f*p*B-e*l*B;b.n13=f*k*C-h*o*C+h*j*E-e*k*E-f*j*B+e*o*B;b.n14=h*o*p-f*k*p-h*j*l+e*k*l+f*j*t-e*o*t;b.n21=k*l*A-o*t*A-k*m*E+i*t*E+o*m*B-i*l*B;b.n22=f*t*A-h*l*A+h*m*E-c*t*E-f*m*B+c*l*B;b.n23=h*o*A-f*k*A-h*i*E+c*k*E+f*i*B-c*o*B;b.n24= +f*k*m-h*o*m+h*i*l-c*k*l-f*i*t+c*o*t;b.n31=j*t*A-k*p*A+k*m*C-i*t*C-j*m*B+i*p*B;b.n32=h*p*A-e*t*A-h*m*C+c*t*C+e*m*B-c*p*B;b.n33=f*k*A-h*j*A+h*i*C-c*k*C-e*i*B+c*j*B;b.n34=h*j*m-e*k*m-h*i*p+c*k*p+e*i*t-c*j*t;b.n41=o*p*A-j*l*A-o*m*C+i*l*C+j*m*E-i*p*E;b.n42=e*l*A-f*p*A+f*m*C-c*l*C-e*m*E+c*p*E;b.n43=f*j*A-e*o*A-f*i*C+c*o*C+e*i*E-c*j*E;b.n44=e*o*m-f*j*m+f*i*p-c*o*p-e*i*l+c*j*l;b.multiplyScalar(1/a.determinant());return b}; +THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,o=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,m=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*k;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*o;c[6]=a*k;c[7]=a*m;c[8]=a*p;return b}; THREE.Matrix4.makeFrustum=function(a,b,c,e,f,h){var i;i=new THREE.Matrix4;i.n11=2*f/(b-a);i.n12=0;i.n13=(b+a)/(b-a);i.n14=0;i.n21=0;i.n22=2*f/(e-c);i.n23=(e+c)/(e-c);i.n24=0;i.n31=0;i.n32=0;i.n33=-(h+f)/(h-f);i.n34=-2*h*f/(h-f);i.n41=0;i.n42=0;i.n43=-1;i.n44=0;return i};THREE.Matrix4.makePerspective=function(a,b,c,e){var f,a=c*Math.tan(a*Math.PI/360);f=-a;return THREE.Matrix4.makeFrustum(f*b,a*b,f,a,c,e)}; -THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var i,j,m,k;i=new THREE.Matrix4;j=b-a;m=c-e;k=h-f;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/m;i.n23=0;i.n24=-((c+e)/m);i.n31=0;i.n32=0;i.n33=-2/k;i.n34=-((h+f)/k);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; +THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var i,j,o,k;i=new THREE.Matrix4;j=b-a;o=c-e;k=h-f;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/o;i.n23=0;i.n24=-((c+e)/o);i.n31=0;i.n32=0;i.n33=-2/k;i.n34=-((h+f)/k);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3}; THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)=== @@ -54,40 +54,40 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){thi 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},update:function(a,b,c){this.matrixAutoUpdate&& this.updateMatrix();if(this.matrixWorldNeedsUpdate||b)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,b=!0;for(var a=0,e=this.children.length;a=0&&h>=0&&f>=0&&i>=0?!0:e<0&&h<0||f<0&&i<0?!1:(e<0?c=Math.max(c,e/(e-h)):h<0&&(d=Math.min(d,e/(e-h))),f<0?c=Math.max(c,f/(f-i)):i<0&&(d=Math.min(d,f/(f-i))),d=0&&h>=0&&f>=0&&i>=0?!0:e<0&&h<0||f<0&&i<0?!1:(e<0?c=Math.max(c,e/(e-h)):h<0&&(d=Math.min(d,e/(e-h))),f<0?c=Math.max(c,f/(f-i)):i<0&&(d=Math.min(d,f/(f-i))),dd&&i.positionScreen.zd&&i.positionScreen.z0&&F.z<1))za=wa[va]=wa[va]||new THREE.RenderableParticle,va++,B=za,B.x=F.x/F.w,B.y=F.y/F.w,B.z=F.z,B.rotation=O.rotation.z,B.scale.x=O.scale.x*Math.abs(B.x-(F.x+h.projectionMatrix.n11)/(F.w+h.projectionMatrix.n14)),B.scale.y=O.scale.y*Math.abs(B.y-(F.y+h.projectionMatrix.n22)/(F.w+h.projectionMatrix.n24)),B.materials=O.materials,qa.push(B);f&&qa.sort(b);return qa}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),h=Math.cos(c),c=Math.sin(c),i=a*b,j=e*f;this.w=i*h-j*c;this.x=i*c+j*h;this.y=e*b*h+a*f*c;this.z=a*f*h-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c); this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;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,e=this.z,f=this.w,h=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+f*h+c*j-e*i;this.y=c*a+f*i+e*h-b*j;this.z=e*a+f*j+b*i-c*h;this.w=f*a-b*h-c*i-e*j;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,h=this.x,i=this.y,j=this.z,m=this.w,k=m*c+i*f-j*e,o=m*e+j*c-h*f,p=m*f+h*e-i*c,c=-h* -c-i*e-j*f;b.x=k*m+c*-h+o*-j-p*-i;b.y=o*m+c*-i+p*-h-k*-j;b.z=p*m+c*-j+k*-i-o*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),i=Math.sqrt(1-f*f);if(Math.abs(i)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/i;e=Math.sin(e*h)/i;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; +this.x,c=this.y,e=this.z,f=this.w,h=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+f*h+c*j-e*i;this.y=c*a+f*i+e*h-b*j;this.z=e*a+f*j+b*i-c*h;this.w=f*a-b*h-c*i-e*j;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,h=this.x,i=this.y,j=this.z,o=this.w,k=o*c+i*f-j*e,m=o*e+j*c-h*f,p=o*f+h*e-i*c,c=-h* +c-i*e-j*f;b.x=k*o+c*-h+m*-j-p*-i;b.y=m*o+c*-i+p*-h-k*-j;b.z=p*o+c*-j+k*-i-m*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),i=Math.sqrt(1-f*f);if(Math.abs(i)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/i;e=Math.sin(e*h)/i;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,e,f,h){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3}; THREE.Face4=function(a,b,c,e,f,h,i){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materialIndex=i;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}}; THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x], y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z< this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;bthis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;k=this.points[c[0]];o=this.points[c[1]]; -p=this.points[c[2]];l=this.points[c[3]];j=i*i;m=i*j;e.x=b(k.x,o.x,p.x,l.x,i,j,m);e.y=b(k.y,o.y,p.y,l.y,i,j,m);e.z=b(k.z,o.z,p.z,l.z,i,j,m);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;athis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;k=this.points[c[0]];m=this.points[c[1]]; +p=this.points[c[2]];l=this.points[c[3]];j=i*i;o=i*j;e.x=b(k.x,m.x,p.x,l.x,i,j,o);e.y=b(k.y,m.y,p.y,l.y,i,j,o);e.z=b(k.z,m.z,p.z,l.z,i,j,o);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;a=0&&(b=a.geometry.materials[d.materialIndex]);return b}function c(a,b,c){var e,h,f,i=a.vertices,u=i.length,v=a.colors,q=v.length,j=a.__vertexArray,k=a.__colorArray,m=a.__sortArray,P=a.__dirtyVertices,o=a.__dirtyColors,p=a.__webglCustomAttributesList,l;if(p){f=0;for(e=p.length;f=0)return a.geometry.materials[d.materialIndex]}function c(a,b,c){var e,h,f,i=a.vertices,u=i.length,v=a.colors,r=v.length,j=a.__vertexArray,k=a.__colorArray,o=a.__sortArray,P=a.__dirtyVertices,m=a.__dirtyColors,p=a.__webglCustomAttributesList,l;if(p){f=0;for(e=p.length;f=0)b&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),d.vertexAttribPointer(a.position,3,d.FLOAT,!1,0,0));else if(i.morphTargetBase){c=h.program.attributes;i.morphTargetBase!==-1?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[i.morphTargetBase]),d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0)):c.position>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer), -d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var v=i.morphTargetForcedOrder;for(u=i.morphTargetInfluences;jq&&(k=m,q=u[k]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[k]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=q;v[k]=1;q=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(u=f.__webglCustomAttributesList.length;j= +d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var v=i.morphTargetForcedOrder;for(u=i.morphTargetInfluences;jk&&(o=p,k=u[o]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[o]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=k;v[o]=1;k=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(u=f.__webglCustomAttributesList.length;j= 0&&(d.bindBuffer(d.ARRAY_BUFFER,c.buffer),d.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,d.FLOAT,!1,0,0))}a.color>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglColorBuffer),d.vertexAttribPointer(a.color,3,d.FLOAT,!1,0,0));a.normal>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglNormalBuffer),d.vertexAttribPointer(a.normal,3,d.FLOAT,!1,0,0));a.tangent>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglTangentBuffer),d.vertexAttribPointer(a.tangent,4,d.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(d.bindBuffer(d.ARRAY_BUFFER, f.__webglUVBuffer),d.vertexAttribPointer(a.uv,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv)):d.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglUV2Buffer),d.vertexAttribPointer(a.uv2,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv2)):d.disableVertexAttribArray(a.uv2));h.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexABuffer),d.vertexAttribPointer(a.skinVertexA,4, d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),d.vertexAttribPointer(a.skinVertexB,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),d.vertexAttribPointer(a.skinIndex,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),d.vertexAttribPointer(a.skinWeight,4,d.FLOAT,!1,0,0))}i instanceof THREE.Mesh?(h.wireframe?(d.lineWidth(h.wireframeLinewidth),b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),d.drawElements(d.LINES,f.__webglLineCount, d.UNSIGNED_SHORT,0)):(b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),d.drawElements(d.TRIANGLES,f.__webglFaceCount,d.UNSIGNED_SHORT,0)),G.info.render.calls++,G.info.render.vertices+=f.__webglFaceCount,G.info.render.faces+=f.__webglFaceCount/3):i instanceof THREE.Line?(i=i.type===THREE.LineStrip?d.LINE_STRIP:d.LINES,d.lineWidth(h.linewidth),d.drawArrays(i,0,f.__webglLineCount),G.info.render.calls++):i instanceof THREE.ParticleSystem?(d.drawArrays(d.POINTS,0,f.__webglParticleCount),G.info.render.calls++): i instanceof THREE.Ribbon&&(d.drawArrays(d.TRIANGLE_STRIP,0,f.__webglVertexCount),G.info.render.calls++)}}function h(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=d.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=d.createBuffer();a.hasPos&&(d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,a.positionArray,d.DYNAMIC_DRAW),d.enableVertexAttribArray(b.attributes.position),d.vertexAttribPointer(b.attributes.position,3,d.FLOAT,!1,0,0));if(a.hasNormal){d.bindBuffer(d.ARRAY_BUFFER, -a.__webglNormalBuffer);if(c===THREE.FlatShading){var e,f,h,i,j,v,k,m,p,o,l=a.count*3;for(o=0;o=0)b=b.geometry.materials[d],b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}else if(b=c)b.transparent?(a.transparent= -b,a.opaque=null):(a.opaque=b,a.transparent=null)}function A(a,b){return b.z-a.z}function C(a){var b,c,k,m=0,K,l,u,v,q=a.lights;ra||(ra=new THREE.PerspectiveCamera(G.shadowCameraFov,G.shadowMapWidth/G.shadowMapHeight,G.shadowCameraNear,G.shadowCameraFar));b=0;for(c=q.length;b=0;d--)a[d].object===b&&a.splice(d,1)}function qa(a,b,d){a.push({buffer:b,object:d,opaque:null,transparent:null})}function N(a){if(a!==ka){switch(a){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE);break;case THREE.SubtractiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.ONE_MINUS_SRC_COLOR);break; -case THREE.MultiplyBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.SRC_COLOR);break;default:d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}ka=a}}function F(a,b,c){(c.width&c.width-1)===0&&(c.height&c.height-1)===0?(d.texParameteri(a,d.TEXTURE_WRAP_S,Q(b.wrapS)),d.texParameteri(a,d.TEXTURE_WRAP_T,Q(b.wrapT)),d.texParameteri(a,d.TEXTURE_MAG_FILTER,Q(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,Q(b.minFilter)), -d.generateMipmap(a)):(d.texParameteri(a,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_MAG_FILTER,xa(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,xa(b.minFilter)))}function z(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=d.createTexture(),G.info.memory.textures++;d.activeTexture(d.TEXTURE0+b);d.bindTexture(d.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?d.texImage2D(d.TEXTURE_2D,0, -Q(a.format),a.image.width,a.image.height,0,Q(a.format),d.UNSIGNED_BYTE,a.image.data):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,a.image);F(d.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+b),d.bindTexture(d.TEXTURE_2D,a.__webglTexture)}function W(a,b){d.bindRenderbuffer(d.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER, -a)):b.depthBuffer&&b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,a)):d.renderbufferStorage(d.RENDERBUFFER,d.RGBA4,b.width,b.height)}function U(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=d.createTexture();if(b){a.__webglFramebuffer=[]; -a.__webglRenderbuffer=[];d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture);F(d.TEXTURE_CUBE_MAP,a,a);for(var c=0;c<6;c++){a.__webglFramebuffer[c]=d.createFramebuffer();a.__webglRenderbuffer[c]=d.createRenderbuffer();d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null);var e=a,f=d.TEXTURE_CUBE_MAP_POSITIVE_X+c;d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer[c]);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,f,e.__webglTexture,0); -W(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=d.createFramebuffer(),a.__webglRenderbuffer=d.createRenderbuffer(),d.bindTexture(d.TEXTURE_2D,a.__webglTexture),F(d.TEXTURE_2D,a,a),d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null),c=d.TEXTURE_2D,d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,c,a.__webglTexture,0),d.bindRenderbuffer(d.RENDERBUFFER,a.__webglRenderbuffer),W(a.__webglRenderbuffer, -a);b?d.bindTexture(d.TEXTURE_CUBE_MAP,null):d.bindTexture(d.TEXTURE_2D,null);d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=e=0):(b=null,c=Ca,a=ya,e=Ha,f=Aa);b!==ua&&(d.bindFramebuffer(d.FRAMEBUFFER,b),d.viewport(e,f,c,a),ua=b)}function ja(a){a instanceof THREE.WebGLRenderTargetCube?(d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture),d.generateMipmap(d.TEXTURE_CUBE_MAP),d.bindTexture(d.TEXTURE_CUBE_MAP, -null)):(d.bindTexture(d.TEXTURE_2D,a.__webglTexture),d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null))}function $(a,b){var c;a==="fragment"?c=d.createShader(d.FRAGMENT_SHADER):a==="vertex"&&(c=d.createShader(d.VERTEX_SHADER));d.shaderSource(c,b);d.compileShader(c);if(!d.getShaderParameter(c,d.COMPILE_STATUS))return console.error(d.getShaderInfoLog(c)),console.error(b),null;return c}function xa(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST; -default:return d.LINEAR}}function Q(a){switch(a){case THREE.RepeatWrapping:return d.REPEAT;case THREE.ClampToEdgeWrapping:return d.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return d.MIRRORED_REPEAT;case THREE.NearestFilter:return d.NEAREST;case THREE.NearestMipMapNearestFilter:return d.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return d.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return d.LINEAR;case THREE.LinearMipMapNearestFilter:return d.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return d.LINEAR_MIPMAP_LINEAR; +f.mergeWith3D&&!m?(d.enable(d.DEPTH_TEST),m=!0):!f.mergeWith3D&&m&&(d.disable(d.DEPTH_TEST),m=!1),N(f.blending),z(f.map,0),d.drawElements(d.TRIANGLES,6,d.UNSIGNED_SHORT,0));d.enable(d.CULL_FACE);d.enable(d.DEPTH_TEST);d.depthMask(O)}function B(a,b,d){a._modelViewMatrix.multiplyToArray(b.matrixWorldInverse,a.matrixWorld,a._modelViewMatrixArray);d&&THREE.Matrix4.makeInvert3x3(a._modelViewMatrix).transposeIntoArray(a._normalMatrixArray)}function va(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0; +return!1}function wa(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function pa(a,b){for(var d=a.length-1;d>=0;d--)a[d].object===b&&a.splice(d,1)}function qa(a,b,d){a.push({buffer:b,object:d,opaque:null,transparent:null})}function N(a){if(a!==ka){switch(a){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE);break;case THREE.SubtractiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:d.blendEquation(d.FUNC_ADD); +d.blendFunc(d.ZERO,d.SRC_COLOR);break;default:d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}ka=a}}function F(a,b,c){(c.width&c.width-1)===0&&(c.height&c.height-1)===0?(d.texParameteri(a,d.TEXTURE_WRAP_S,Q(b.wrapS)),d.texParameteri(a,d.TEXTURE_WRAP_T,Q(b.wrapT)),d.texParameteri(a,d.TEXTURE_MAG_FILTER,Q(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,Q(b.minFilter)),d.generateMipmap(a)):(d.texParameteri(a,d.TEXTURE_WRAP_S, +d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_MAG_FILTER,xa(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,xa(b.minFilter)))}function z(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=d.createTexture(),G.info.memory.textures++;d.activeTexture(d.TEXTURE0+b);d.bindTexture(d.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.image.width,a.image.height,0,Q(a.format),d.UNSIGNED_BYTE, +a.image.data):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,a.image);F(d.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+b),d.bindTexture(d.TEXTURE_2D,a.__webglTexture)}function W(a,b){d.bindRenderbuffer(d.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER, +d.DEPTH_STENCIL,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,a)):d.renderbufferStorage(d.RENDERBUFFER,d.RGBA4,b.width,b.height)}function U(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=d.createTexture();if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture); +F(d.TEXTURE_CUBE_MAP,a,a);for(var c=0;c<6;c++){a.__webglFramebuffer[c]=d.createFramebuffer();a.__webglRenderbuffer[c]=d.createRenderbuffer();d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null);var e=a,f=d.TEXTURE_CUBE_MAP_POSITIVE_X+c;d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer[c]);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,f,e.__webglTexture,0);W(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=d.createFramebuffer(), +a.__webglRenderbuffer=d.createRenderbuffer(),d.bindTexture(d.TEXTURE_2D,a.__webglTexture),F(d.TEXTURE_2D,a,a),d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null),c=d.TEXTURE_2D,d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,c,a.__webglTexture,0),d.bindRenderbuffer(d.RENDERBUFFER,a.__webglRenderbuffer),W(a.__webglRenderbuffer,a);b?d.bindTexture(d.TEXTURE_CUBE_MAP,null):d.bindTexture(d.TEXTURE_2D,null); +d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=e=0):(b=null,c=Ca,a=ya,e=Ha,f=Aa);b!==ua&&(d.bindFramebuffer(d.FRAMEBUFFER,b),d.viewport(e,f,c,a),ua=b)}function ja(a){a instanceof THREE.WebGLRenderTargetCube?(d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture),d.generateMipmap(d.TEXTURE_CUBE_MAP),d.bindTexture(d.TEXTURE_CUBE_MAP,null)):(d.bindTexture(d.TEXTURE_2D,a.__webglTexture), +d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null))}function $(a,b){var c;a==="fragment"?c=d.createShader(d.FRAGMENT_SHADER):a==="vertex"&&(c=d.createShader(d.VERTEX_SHADER));d.shaderSource(c,b);d.compileShader(c);if(!d.getShaderParameter(c,d.COMPILE_STATUS))return console.error(d.getShaderInfoLog(c)),console.error(b),null;return c}function xa(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST;default:return d.LINEAR}} +function Q(a){switch(a){case THREE.RepeatWrapping:return d.REPEAT;case THREE.ClampToEdgeWrapping:return d.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return d.MIRRORED_REPEAT;case THREE.NearestFilter:return d.NEAREST;case THREE.NearestMipMapNearestFilter:return d.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return d.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return d.LINEAR;case THREE.LinearMipMapNearestFilter:return d.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return d.LINEAR_MIPMAP_LINEAR; case THREE.ByteType:return d.BYTE;case THREE.UnsignedByteType:return d.UNSIGNED_BYTE;case THREE.ShortType:return d.SHORT;case THREE.UnsignedShortType:return d.UNSIGNED_SHORT;case THREE.IntType:return d.INT;case THREE.UnsignedShortType:return d.UNSIGNED_INT;case THREE.FloatType:return d.FLOAT;case THREE.AlphaFormat:return d.ALPHA;case THREE.RGBFormat:return d.RGB;case THREE.RGBAFormat:return d.RGBA;case THREE.LuminanceFormat:return d.LUMINANCE;case THREE.LuminanceAlphaFormat:return d.LUMINANCE_ALPHA}return 0} var G=this,d,ta=[],Wa=null,ua=null,J=-1,R=null,S=0,T=null,X=null,ka=null,aa=null,O=null,za=null,La=null,Ra=null,Ha=0,Aa=0,Ca=0,ya=0,ha=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Da=new THREE.Matrix4,Ta=new Float32Array(16),Ua=new Float32Array(16),Ja=new THREE.Vector4,Ya={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},Ba=a.canvas!==void 0?a.canvas:document.createElement("canvas"), I=a.stencil!==void 0?a.stencil:!0,cb=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,db=a.antialias!==void 0?a.antialias:!1,Y=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),Fa=a.clearAlpha!==void 0?a.clearAlpha:0,Xa=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=Ba;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear= !0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var ra,Sa=[],a=THREE.ShaderLib.depthRGBA,ab=THREE.UniformsUtils.clone(a.uniforms),Va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ab}), Za=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ab,morphTargets:!0});Va._shadowPass=!0;Za._shadowPass=!0;try{if(!(d=Ba.getContext("experimental-webgl",{antialias:db,stencil:I,preserveDrawingBuffer:cb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+d.getParameter(d.VERSION)+" | "+d.getParameter(d.VENDOR)+" | "+d.getParameter(d.RENDERER)+" | "+d.getParameter(d.SHADING_LANGUAGE_VERSION))}catch(eb){console.error(eb)}d.clearColor(0, -0,0,1);d.clearDepth(1);d.clearStencil(0);d.enable(d.DEPTH_TEST);d.depthFunc(d.LEQUAL);d.frontFace(d.CCW);d.cullFace(d.BACK);d.enable(d.CULL_FACE);d.enable(d.BLEND);d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);d.clearColor(Y.r,Y.g,Y.b,Fa);this.context=d;var bb=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,r={};r.vertices=new Float32Array(16);r.faces=new Uint16Array(6);I=0;r.vertices[I++]=-1;r.vertices[I++]=-1;r.vertices[I++]=0;r.vertices[I++]=1;r.vertices[I++]=1; -r.vertices[I++]=-1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=0;r.vertices[I++]=-1;r.vertices[I++]=1;r.vertices[I++]=0;I=r.vertices[I++]=0;r.faces[I++]=0;r.faces[I++]=1;r.faces[I++]=2;r.faces[I++]=0;r.faces[I++]=2;r.faces[I++]=3;r.vertexBuffer=d.createBuffer();r.elementBuffer=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,r.vertexBuffer);d.bufferData(d.ARRAY_BUFFER,r.vertices,d.STATIC_DRAW);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,r.elementBuffer); -d.bufferData(d.ELEMENT_ARRAY_BUFFER,r.faces,d.STATIC_DRAW);r.program=d.createProgram();d.attachShader(r.program,$("fragment",THREE.ShaderLib.sprite.fragmentShader));d.attachShader(r.program,$("vertex",THREE.ShaderLib.sprite.vertexShader));d.linkProgram(r.program);r.attributes={};r.uniforms={};r.attributes.position=d.getAttribLocation(r.program,"position");r.attributes.uv=d.getAttribLocation(r.program,"uv");r.uniforms.uvOffset=d.getUniformLocation(r.program,"uvOffset");r.uniforms.uvScale=d.getUniformLocation(r.program, -"uvScale");r.uniforms.rotation=d.getUniformLocation(r.program,"rotation");r.uniforms.scale=d.getUniformLocation(r.program,"scale");r.uniforms.alignment=d.getUniformLocation(r.program,"alignment");r.uniforms.color=d.getUniformLocation(r.program,"color");r.uniforms.map=d.getUniformLocation(r.program,"map");r.uniforms.opacity=d.getUniformLocation(r.program,"opacity");r.uniforms.useScreenCoordinates=d.getUniformLocation(r.program,"useScreenCoordinates");r.uniforms.affectedByDistance=d.getUniformLocation(r.program, -"affectedByDistance");r.uniforms.screenPosition=d.getUniformLocation(r.program,"screenPosition");r.uniforms.modelViewMatrix=d.getUniformLocation(r.program,"modelViewMatrix");r.uniforms.projectionMatrix=d.getUniformLocation(r.program,"projectionMatrix");var $a=!1;this.setSize=function(a,b){Ba.width=a;Ba.height=b;this.setViewport(0,0,Ba.width,Ba.height)};this.setViewport=function(a,b,c,e){Ha=a;Aa=b;Ca=c;ya=e;d.viewport(Ha,Aa,Ca,ya)};this.setScissor=function(a,b,c,e){d.scissor(a,b,c,e)};this.enableScissorTest= +0,0,1);d.clearDepth(1);d.clearStencil(0);d.enable(d.DEPTH_TEST);d.depthFunc(d.LEQUAL);d.frontFace(d.CCW);d.cullFace(d.BACK);d.enable(d.CULL_FACE);d.enable(d.BLEND);d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);d.clearColor(Y.r,Y.g,Y.b,Fa);this.context=d;var bb=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,q={};q.vertices=new Float32Array(16);q.faces=new Uint16Array(6);I=0;q.vertices[I++]=-1;q.vertices[I++]=-1;q.vertices[I++]=0;q.vertices[I++]=1;q.vertices[I++]=1; +q.vertices[I++]=-1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=0;q.vertices[I++]=-1;q.vertices[I++]=1;q.vertices[I++]=0;I=q.vertices[I++]=0;q.faces[I++]=0;q.faces[I++]=1;q.faces[I++]=2;q.faces[I++]=0;q.faces[I++]=2;q.faces[I++]=3;q.vertexBuffer=d.createBuffer();q.elementBuffer=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,q.vertexBuffer);d.bufferData(d.ARRAY_BUFFER,q.vertices,d.STATIC_DRAW);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.elementBuffer); +d.bufferData(d.ELEMENT_ARRAY_BUFFER,q.faces,d.STATIC_DRAW);q.program=d.createProgram();d.attachShader(q.program,$("fragment",THREE.ShaderLib.sprite.fragmentShader));d.attachShader(q.program,$("vertex",THREE.ShaderLib.sprite.vertexShader));d.linkProgram(q.program);q.attributes={};q.uniforms={};q.attributes.position=d.getAttribLocation(q.program,"position");q.attributes.uv=d.getAttribLocation(q.program,"uv");q.uniforms.uvOffset=d.getUniformLocation(q.program,"uvOffset");q.uniforms.uvScale=d.getUniformLocation(q.program, +"uvScale");q.uniforms.rotation=d.getUniformLocation(q.program,"rotation");q.uniforms.scale=d.getUniformLocation(q.program,"scale");q.uniforms.alignment=d.getUniformLocation(q.program,"alignment");q.uniforms.color=d.getUniformLocation(q.program,"color");q.uniforms.map=d.getUniformLocation(q.program,"map");q.uniforms.opacity=d.getUniformLocation(q.program,"opacity");q.uniforms.useScreenCoordinates=d.getUniformLocation(q.program,"useScreenCoordinates");q.uniforms.affectedByDistance=d.getUniformLocation(q.program, +"affectedByDistance");q.uniforms.screenPosition=d.getUniformLocation(q.program,"screenPosition");q.uniforms.modelViewMatrix=d.getUniformLocation(q.program,"modelViewMatrix");q.uniforms.projectionMatrix=d.getUniformLocation(q.program,"projectionMatrix");var $a=!1;this.setSize=function(a,b){Ba.width=a;Ba.height=b;this.setViewport(0,0,Ba.width,Ba.height)};this.setViewport=function(a,b,c,e){Ha=a;Aa=b;Ca=c;ya=e;d.viewport(Ha,Aa,Ca,ya)};this.setScissor=function(a,b,c,e){d.scissor(a,b,c,e)};this.enableScissorTest= function(a){a?d.enable(d.SCISSOR_TEST):d.disable(d.SCISSOR_TEST)};this.setClearColorHex=function(a,b){Y.setHex(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.setClearColor=function(a,b){Y.copy(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.getClearColor=function(){return Y};this.getClearAlpha=function(){return Fa};this.clear=function(a,b,c){var e=0;if(a===void 0||a)e|=d.COLOR_BUFFER_BIT;if(b===void 0||b)e|=d.DEPTH_BUFFER_BIT;if(c===void 0||c)e|=d.STENCIL_BUFFER_BIT;d.clear(e)};this.getContext=function(){return d}; 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(g in a.geometry.geometryGroups){var b=a.geometry.geometryGroups[g];d.deleteBuffer(b.__webglVertexBuffer);d.deleteBuffer(b.__webglNormalBuffer);d.deleteBuffer(b.__webglTangentBuffer);d.deleteBuffer(b.__webglColorBuffer);d.deleteBuffer(b.__webglUVBuffer);d.deleteBuffer(b.__webglUV2Buffer);d.deleteBuffer(b.__webglSkinVertexABuffer); d.deleteBuffer(b.__webglSkinVertexBBuffer);d.deleteBuffer(b.__webglSkinIndicesBuffer);d.deleteBuffer(b.__webglSkinWeightsBuffer);d.deleteBuffer(b.__webglFaceBuffer);d.deleteBuffer(b.__webglLineBuffer);if(b.numMorphTargets)for(var c=0,e=b.numMorphTargets;c=0&&d.enableVertexAttribArray(l.position);l.color>=0&&d.enableVertexAttribArray(l.color);l.normal>=0&&d.enableVertexAttribArray(l.normal); -l.tangent>=0&&d.enableVertexAttribArray(l.tangent);a.skinning&&l.skinVertexA>=0&&l.skinVertexB>=0&&l.skinIndex>=0&&l.skinWeight>=0&&(d.enableVertexAttribArray(l.skinVertexA),d.enableVertexAttribArray(l.skinVertexB),d.enableVertexAttribArray(l.skinIndex),d.enableVertexAttribArray(l.skinWeight));if(a.attributes)for(h in a.attributes)l[h]!==void 0&&l[h]>=0&&d.enableVertexAttribArray(l[h]);if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h=0&&(d.enableVertexAttribArray(l[r]), -a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,b,c,d){U(a);this.clear(b,c,d)};this.updateShadowMap=function(a,b){C(a,b)};this.render=function(a,b,c,r){var Ia,K,Ea,u,v,q,z,Pa=a.lights,Qa=a.fog;J=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&C(a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;if(b.matrixAutoUpdate){for(Ea=b;Ea.parent;)Ea=Ea.parent;Ea.update(void 0,!0)}a.update(void 0, -!1,b);b.matrixWorldInverse.flattenToArray(Ua);b.projectionMatrix.flattenToArray(Ta);Da.multiply(b.projectionMatrix,b.matrixWorldInverse);o(Da);this.initWebGLObjects(a);U(c);(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);Ea=a.__webglObjects.length;for(r=0;r=0;r--)if(v=a.__webglObjects[r],v.render&&(q=v.object,z=v.buffer,K=v.opaque))i(q),j(K.depthTest),m(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),f(b,Pa,Qa, -K,z,q);for(r=0;r65535&&(r[l].counter+=1,p=r[l].hash+"_"+r[l].counter,j.geometryGroups[p]===void 0&&(j.geometryGroups[p]= -{faces:[],materialIndex:q,vertices:0,numMorphTargets:t})),j.geometryGroups[p].faces.push(k),j.geometryGroups[p].vertices+=o;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=S++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer=d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=d.createBuffer();k.__webglUVBuffer= -d.createBuffer();k.__webglUV2Buffer=d.createBuffer();k.__webglSkinVertexABuffer=d.createBuffer();k.__webglSkinVertexBBuffer=d.createBuffer();k.__webglSkinIndicesBuffer=d.createBuffer();k.__webglSkinWeightsBuffer=d.createBuffer();k.__webglFaceBuffer=d.createBuffer();k.__webglLineBuffer=d.createBuffer();if(k.numMorphTargets){q=m=void 0;k.__webglMorphTargetsBuffers=[];m=0;for(q=k.numMorphTargets;m0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(k*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(k*2)}if(q.geometry.skinWeights.length&&q.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(k*4),j.__skinVertexBArray=new Float32Array(k*4), -j.__skinIndexArray=new Float32Array(k*4),j.__skinWeightArray=new Float32Array(k*4);j.__faceArray=new Uint16Array(l*3);j.__lineArray=new Uint16Array(p*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(z=j.numMorphTargets;t=0&&d.enableVertexAttribArray(l.position);l.color>=0&&d.enableVertexAttribArray(l.color);l.normal>=0&&d.enableVertexAttribArray(l.normal); +l.tangent>=0&&d.enableVertexAttribArray(l.tangent);a.skinning&&l.skinVertexA>=0&&l.skinVertexB>=0&&l.skinIndex>=0&&l.skinWeight>=0&&(d.enableVertexAttribArray(l.skinVertexA),d.enableVertexAttribArray(l.skinVertexB),d.enableVertexAttribArray(l.skinIndex),d.enableVertexAttribArray(l.skinWeight));if(a.attributes)for(h in a.attributes)l[h]!==void 0&&l[h]>=0&&d.enableVertexAttribArray(l[h]);if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h=0&&(d.enableVertexAttribArray(l[q]), +a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,b,c,d){U(a);this.clear(b,c,d)};this.updateShadowMap=function(a,b){C(a,b)};this.render=function(a,b,c,q){var Ia,K,Ea,u,v,r,z,Pa=a.lights,Qa=a.fog;J=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&C(a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;if(b.matrixAutoUpdate){for(Ea=b;Ea.parent;)Ea=Ea.parent;Ea.update(void 0,!0)}a.update(void 0, +!1,b);b.matrixWorldInverse.flattenToArray(Ua);b.projectionMatrix.flattenToArray(Ta);Da.multiply(b.projectionMatrix,b.matrixWorldInverse);m(Da);this.initWebGLObjects(a);U(c);(this.autoClear||q)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);Ea=a.__webglObjects.length;for(q=0;q=0;q--)if(v=a.__webglObjects[q],v.render&&(r=v.object,z=v.buffer,K=v.opaque))i(r),j(K.depthTest),o(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),f(b,Pa,Qa, +K,z,r);for(q=0;q65535&&(q[l].counter+=1,p=q[l].hash+"_"+q[l].counter,j.geometryGroups[p]===void 0&&(j.geometryGroups[p]={faces:[], +materialIndex:r,vertices:0,numMorphTargets:t})),j.geometryGroups[p].faces.push(k),j.geometryGroups[p].vertices+=m;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=S++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer=d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=d.createBuffer();k.__webglUVBuffer=d.createBuffer(); +k.__webglUV2Buffer=d.createBuffer();k.__webglSkinVertexABuffer=d.createBuffer();k.__webglSkinVertexBBuffer=d.createBuffer();k.__webglSkinIndicesBuffer=d.createBuffer();k.__webglSkinWeightsBuffer=d.createBuffer();k.__webglFaceBuffer=d.createBuffer();k.__webglLineBuffer=d.createBuffer();if(k.numMorphTargets){r=o=void 0;k.__webglMorphTargetsBuffers=[];o=0;for(r=k.numMorphTargets;o0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(k*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(k*2)}if(r.geometry.skinWeights.length&&r.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(k*4),j.__skinVertexBArray=new Float32Array(k*4),j.__skinIndexArray= +new Float32Array(k*4),j.__skinWeightArray=new Float32Array(k*4);j.__faceArray=new Uint16Array(l*3);j.__lineArray=new Uint16Array(p*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(z=j.numMorphTargets;t=0;i--)f[i]===h&&f.splice(i,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&pa(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e=0;i--)f[i]===h&&f.splice(i,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&pa(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,oa,l));za&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER,W,l));Aa&&sa.hasTangents&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglTangentBuffer),d.bufferData(d.ARRAY_BUFFER,ca,l));ta&&X>0&&(d.bindBuffer(d.ARRAY_BUFFER, -q.__webglUVBuffer),d.bufferData(d.ARRAY_BUFFER,ja,l));ta&&$>0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglUV2Buffer),d.bufferData(d.ARRAY_BUFFER,ka,l));ya&&(d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,ha,l),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webglLineBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,Y,l));x>0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinVertexABuffer),d.bufferData(d.ARRAY_BUFFER,da,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinVertexBBuffer), -d.bufferData(d.ARRAY_BUFFER,ea,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinIndicesBuffer),d.bufferData(d.ARRAY_BUFFER,fa,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinWeightsBuffer),d.bufferData(d.ARRAY_BUFFER,ga,l));p&&(delete q.__inittedArrays,delete q.__colorArray,delete q.__normalArray,delete q.__tangentArray,delete q.__uvArray,delete q.__uv2Array,delete q.__faceArray,delete q.__vertexArray,delete q.__lineArray,delete q.__skinVertexAArray,delete q.__skinVertexBArray,delete q.__skinIndexArray,delete q.__skinWeightArray)}h.__dirtyVertices= -!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;wa(j,i)}else if(i instanceof THREE.Ribbon){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=r=p=p=void 0;t=i.vertices;m=i.colors;o=t.length;q=m.length;A=i.__vertexArray;l=i.__colorArray;C=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p0&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,oa,l));za&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER,W,l));Aa&&sa.hasTangents&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglTangentBuffer),d.bufferData(d.ARRAY_BUFFER,ca,l));ta&&X>0&&(d.bindBuffer(d.ARRAY_BUFFER, +r.__webglUVBuffer),d.bufferData(d.ARRAY_BUFFER,ja,l));ta&&$>0&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglUV2Buffer),d.bufferData(d.ARRAY_BUFFER,ka,l));ya&&(d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,r.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,ha,l),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,r.__webglLineBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,Y,l));x>0&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinVertexABuffer),d.bufferData(d.ARRAY_BUFFER,da,l),d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinVertexBBuffer), +d.bufferData(d.ARRAY_BUFFER,ea,l),d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinIndicesBuffer),d.bufferData(d.ARRAY_BUFFER,fa,l),d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinWeightsBuffer),d.bufferData(d.ARRAY_BUFFER,ga,l));p&&(delete r.__inittedArrays,delete r.__colorArray,delete r.__normalArray,delete r.__tangentArray,delete r.__uvArray,delete r.__uv2Array,delete r.__faceArray,delete r.__vertexArray,delete r.__lineArray,delete r.__skinVertexAArray,delete r.__skinVertexBArray,delete r.__skinIndexArray,delete r.__skinWeightArray)}h.__dirtyVertices= +!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyColors=!1;h.__dirtyTangents=!1;j.attributes&&wa(j)}else if(i instanceof THREE.Ribbon){if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=q=p=p=void 0;t=i.vertices;o=i.colors;m=t.length;r=o.length;A=i.__vertexArray;l=i.__colorArray;C=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p= 0 ) { - material = object.geometry.materials[ geometryGroup.materialIndex ]; + return object.geometry.materials[ geometryGroup.materialIndex ]; } - return material; - }; function initMeshBuffers ( geometryGroup, object ) { @@ -4293,7 +4289,7 @@ THREE.WebGLRenderer = function ( parameters ) { for ( var o = 0, ol = scene.__webglObjects.length; o < ol; o ++ ) { - updateObject( scene.__webglObjects[ o ].object, scene ); + updateObject( scene.__webglObjects[ o ].object ); } @@ -4433,17 +4429,11 @@ THREE.WebGLRenderer = function ( parameters ) { }; - function areCustomAttributesDirty( geometryGroup, object ) { + function areCustomAttributesDirty( material ) { - var material = getBufferMaterial( object, geometryGroup ); + for ( var a in material.attributes ) { - if ( material.attributes ) { - - for ( var a in material.attributes ) { - - if ( material.attributes[ a ].needsUpdate ) return true; - - } + if ( material.attributes[ a ].needsUpdate ) return true; } @@ -4451,41 +4441,36 @@ THREE.WebGLRenderer = function ( parameters ) { }; - function clearCustomAttributes( geometryGroup, object ) { + function clearCustomAttributes( material ) { - var material = getBufferMaterial( object, geometryGroup ); + for ( var a in material.attributes ) { - if ( material.attributes ) { - - for ( var a in material.attributes ) { - - material.attributes[ a ].needsUpdate = false; - - } + material.attributes[ a ].needsUpdate = false; } }; - function updateObject( object, scene ) { + function updateObject( object ) { - var g, geometry, geometryGroup, a, customAttributeDirty; + var geometry = object.geometry, + geometryGroup, customAttributesDirty, material; if ( object instanceof THREE.Mesh ) { - geometry = object.geometry; - // check all geometry groups for( var i = 0, il = geometry.geometryGroupsList.length; i < il; i ++ ) { geometryGroup = geometry.geometryGroupsList[ i ]; - customAttributeDirty = areCustomAttributesDirty( geometryGroup, object ); + material = getBufferMaterial( object, geometryGroup ); + + customAttributesDirty = material.attributes && areCustomAttributesDirty( material ); if ( geometry.__dirtyVertices || geometry.__dirtyMorphTargets || geometry.__dirtyElements || geometry.__dirtyUvs || geometry.__dirtyNormals || - geometry.__dirtyColors || geometry.__dirtyTangents || customAttributeDirty ) { + geometry.__dirtyColors || geometry.__dirtyTangents || customAttributesDirty ) { setMeshBuffers( geometryGroup, object, _gl.DYNAMIC_DRAW, !geometry.dynamic ); @@ -4498,16 +4483,14 @@ THREE.WebGLRenderer = function ( parameters ) { geometry.__dirtyElements = false; geometry.__dirtyUvs = false; geometry.__dirtyNormals = false; - geometry.__dirtyTangents = false; geometry.__dirtyColors = false; + geometry.__dirtyTangents = false; - clearCustomAttributes( geometryGroup, object ); + material.attributes && clearCustomAttributes( material ); } else if ( object instanceof THREE.Ribbon ) { - geometry = object.geometry; - - if( geometry.__dirtyVertices || geometry.__dirtyColors ) { + if ( geometry.__dirtyVertices || geometry.__dirtyColors ) { setRibbonBuffers( geometry, _gl.DYNAMIC_DRAW ); @@ -4518,9 +4501,7 @@ THREE.WebGLRenderer = function ( parameters ) { } else if ( object instanceof THREE.Line ) { - geometry = object.geometry; - - if( geometry.__dirtyVertices || geometry.__dirtyColors ) { + if ( geometry.__dirtyVertices || geometry.__dirtyColors ) { setLineBuffers( geometry, _gl.DYNAMIC_DRAW ); @@ -4531,11 +4512,11 @@ THREE.WebGLRenderer = function ( parameters ) { } else if ( object instanceof THREE.ParticleSystem ) { - geometry = object.geometry; + material = getBufferMaterial( object, geometryGroup ); - customAttributeDirty = areCustomAttributesDirty( geometry, object ); + customAttributesDirty = material.attributes && areCustomAttributesDirty( material ); - if ( geometry.__dirtyVertices || geometry.__dirtyColors || object.sortParticles || customAttributeDirty ) { + if ( geometry.__dirtyVertices || geometry.__dirtyColors || object.sortParticles || customAttributesDirty ) { setParticleBuffers( geometry, _gl.DYNAMIC_DRAW, object ); @@ -4544,28 +4525,15 @@ THREE.WebGLRenderer = function ( parameters ) { geometry.__dirtyVertices = false; geometry.__dirtyColors = false; - clearCustomAttributes( geometry, object ); - - }/* else if ( THREE.MarchingCubes !== undefined && object instanceof THREE.MarchingCubes ) { - - // it updates itself in render callback + material.attributes && clearCustomAttributes( material ); } - */ - - /* - delete geometry.vertices; - delete geometry.faces; - delete geometryGroup.faces; - */ }; function removeInstances( objlist, object ) { - var o, ol; - - for ( o = objlist.length - 1; o >= 0; o -- ) { + for ( var o = objlist.length - 1; o >= 0; o -- ) { if ( objlist[ o ].object === object ) { @@ -4579,9 +4547,7 @@ THREE.WebGLRenderer = function ( parameters ) { function removeInstancesDirect( objlist, object ) { - var o, ol; - - for ( o = objlist.length - 1; o >= 0; o -- ) { + for ( var o = objlist.length - 1; o >= 0; o -- ) { if ( objlist[ o ] === object ) { @@ -4618,8 +4584,11 @@ THREE.WebGLRenderer = function ( parameters ) { function sortFacesByMaterial( geometry ) { - var i, l, f, fl, face, materialIndex, vertices, mhash, ghash, hash_map = {}; - var numMorphTargets = geometry.morphTargets !== undefined ? geometry.morphTargets.length : 0; + var f, fl, face, materialIndex, vertices, + materialHash, groupHash, + hash_map = {}; + + var numMorphTargets = geometry.morphTargets.length; geometry.geometryGroups = {}; @@ -4628,39 +4597,39 @@ THREE.WebGLRenderer = function ( parameters ) { face = geometry.faces[ f ]; materialIndex = face.materialIndex; - mhash = ( materialIndex !== undefined ) ? materialIndex : -1; + materialHash = ( materialIndex !== undefined ) ? materialIndex : -1; - if ( hash_map[ mhash ] === undefined ) { + if ( hash_map[ materialHash ] === undefined ) { - hash_map[ mhash ] = { 'hash': mhash, 'counter': 0 }; + hash_map[ materialHash ] = { 'hash': materialHash, 'counter': 0 }; } - ghash = hash_map[ mhash ].hash + '_' + hash_map[ mhash ].counter; + groupHash = hash_map[ materialHash ].hash + '_' + hash_map[ materialHash ].counter; - if ( geometry.geometryGroups[ ghash ] === undefined ) { + if ( geometry.geometryGroups[ groupHash ] === undefined ) { - geometry.geometryGroups[ ghash ] = { 'faces': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets }; + geometry.geometryGroups[ groupHash ] = { 'faces': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets }; } vertices = face instanceof THREE.Face3 ? 3 : 4; - if ( geometry.geometryGroups[ ghash ].vertices + vertices > 65535 ) { + if ( geometry.geometryGroups[ groupHash ].vertices + vertices > 65535 ) { - hash_map[ mhash ].counter += 1; - ghash = hash_map[ mhash ].hash + '_' + hash_map[ mhash ].counter; + hash_map[ materialHash ].counter += 1; + groupHash = hash_map[ materialHash ].hash + '_' + hash_map[ materialHash ].counter; - if ( geometry.geometryGroups[ ghash ] === undefined ) { + if ( geometry.geometryGroups[ groupHash ] === undefined ) { - geometry.geometryGroups[ ghash ] = { 'faces': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets }; + geometry.geometryGroups[ groupHash ] = { 'faces': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets }; } } - geometry.geometryGroups[ ghash ].faces.push( f ); - geometry.geometryGroups[ ghash ].vertices += vertices; + geometry.geometryGroups[ groupHash ].faces.push( f ); + geometry.geometryGroups[ groupHash ].vertices += vertices; } @@ -5259,7 +5228,7 @@ THREE.WebGLRenderer = function ( parameters ) { _gl.activeTexture( _gl.TEXTURE0 + slot ); _gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture ); - if ( texture instanceof THREE.DataTexture) { + if ( texture instanceof THREE.DataTexture ) { _gl.texImage2D( _gl.TEXTURE_2D, 0, paramThreeToGL( texture.format ), texture.image.width, texture.image.height, 0, paramThreeToGL( texture.format ), _gl.UNSIGNED_BYTE, texture.image.data ); From 5edfb1269734c93f8b6291747298715b102362b1 Mon Sep 17 00:00:00 2001 From: alteredq Date: Fri, 21 Oct 2011 18:12:05 +0200 Subject: [PATCH 33/33] Added "autoUpdateObjects" flag to WebGLRenderer. This is to be able to skip redundant updates in multipass rendering (like for shadow maps or dynamic cube maps). Also reshuffled initWebGLObjects calls to have just a single update in a basic scenario of shadow map pass followed by scene render. Still need to solve somehow potential redundant updates in EffectComposer (which can mix multiple scenes). --- build/Three.js | 192 +++++++-------- build/custom/ThreeWebGL.js | 232 +++++++++--------- examples/webgl_materials_cubemap_dynamic.html | 4 + examples/webgl_particles_dynamic.html | 8 +- examples/webgl_shading_physical.html | 6 +- src/renderers/WebGLRenderer.js | 12 +- 6 files changed, 231 insertions(+), 223 deletions(-) diff --git a/build/Three.js b/build/Three.js index 3545abc7..77871f2d 100644 --- a/build/Three.js +++ b/build/Three.js @@ -29,7 +29,7 @@ THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,f,h,k,l, b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;h.sub(a,b).normalize();if(h.length()===0)h.z=1;e.cross(c,h).normalize();e.length()===0&&(h.x+=1.0E-4,e.cross(c,h).normalize());f.cross(h,e).normalize();this.n11=e.x;this.n12=f.x;this.n13=h.x;this.n21=e.y;this.n22=f.y;this.n23=h.y;this.n31=e.z;this.n32=f.z;this.n33=h.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,e=a.z,f=1/(this.n41*b+this.n42*c+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*e+this.n14)*f; a.y=(this.n21*b+this.n22*c+this.n23*e+this.n24)*f;a.z=(this.n31*b+this.n32*c+this.n33*e+this.n34)*f;return a},multiplyVector4:function(a){var b=a.x,c=a.y,e=a.z,f=a.w;a.x=this.n11*b+this.n12*c+this.n13*e+this.n14*f;a.y=this.n21*b+this.n22*c+this.n23*e+this.n24*f;a.z=this.n31*b+this.n32*c+this.n33*e+this.n34*f;a.w=this.n41*b+this.n42*c+this.n43*e+this.n44*f;return a},rotateAxis:function(a){var b=a.x,c=a.y,e=a.z;a.x=b*this.n11+c*this.n12+e*this.n13;a.y=b*this.n21+c*this.n22+e*this.n23;a.z=b*this.n31+ c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,k=a.n21,l=a.n22,n=a.n23,p=a.n24,u=a.n31,t=a.n32,v=a.n33,o=a.n34,y=a.n41,x=a.n42,w=a.n43,A=a.n44,z=b.n11,C=b.n12, -B=b.n13,K=b.n14,F=b.n21,M=b.n22,E=b.n23,O=b.n24,V=b.n31,H=b.n32,P=b.n33,L=b.n34,T=b.n41,S=b.n42,m=b.n43,aa=b.n44;this.n11=c*z+e*F+f*V+h*T;this.n12=c*C+e*M+f*H+h*S;this.n13=c*B+e*E+f*P+h*m;this.n14=c*K+e*O+f*L+h*aa;this.n21=k*z+l*F+n*V+p*T;this.n22=k*C+l*M+n*H+p*S;this.n23=k*B+l*E+n*P+p*m;this.n24=k*K+l*O+n*L+p*aa;this.n31=u*z+t*F+v*V+o*T;this.n32=u*C+t*M+v*H+o*S;this.n33=u*B+t*E+v*P+o*m;this.n34=u*K+t*O+v*L+o*aa;this.n41=y*z+x*F+w*V+A*T;this.n42=y*C+x*M+w*H+A*S;this.n43=y*B+x*E+w*P+A*m;this.n44=y* +B=b.n13,K=b.n14,F=b.n21,M=b.n22,E=b.n23,O=b.n24,V=b.n31,I=b.n32,P=b.n33,L=b.n34,T=b.n41,S=b.n42,m=b.n43,aa=b.n44;this.n11=c*z+e*F+f*V+h*T;this.n12=c*C+e*M+f*I+h*S;this.n13=c*B+e*E+f*P+h*m;this.n14=c*K+e*O+f*L+h*aa;this.n21=k*z+l*F+n*V+p*T;this.n22=k*C+l*M+n*I+p*S;this.n23=k*B+l*E+n*P+p*m;this.n24=k*K+l*O+n*L+p*aa;this.n31=u*z+t*F+v*V+o*T;this.n32=u*C+t*M+v*I+o*S;this.n33=u*B+t*E+v*P+o*m;this.n34=u*K+t*O+v*L+o*aa;this.n41=y*z+x*F+w*V+A*T;this.n42=y*C+x*M+w*I+A*S;this.n43=y*B+x*E+w*P+A*m;this.n44=y* K+x*O+w*L+A*aa;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*= a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,f=this.n21,h=this.n22,k=this.n23,l=this.n24,n=this.n31,p=this.n32,u=this.n33,t=this.n34,v=this.n41,o=this.n42,y=this.n43,x=this.n44;return e*k*p*v-c*l*p*v-e*h*u*v+b*l*u*v+c*h*t*v-b*k*t*v-e*k*n*o+c*l*n*o+e*f*u*o-a*l*u*o-c*f*t*o+a*k*t*o+e*h*n*y-b*l*n*y-e*f*p*y+a*l*p*y+b*f*t*y-a*h*t*y-c*h*n*x+b*k*n*x+c*f*p*x-a*k*p*x-b*f* u*x+a*h*u*x},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34= @@ -57,7 +57,7 @@ a)return f;if(b&&(f=f.getChildByName(a,b),f!==void 0))return f}},updateMatrix:fu this.updateMatrix();if(this.matrixWorldNeedsUpdate||b)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,b=!0;for(var a=0,e=this.children.length;a=0&&k>=0&&h>=0&&l>=0?!0:f<0&&k<0||h<0&&l<0?!1:(f<0?b=Math.max(b,f/(f-k)):k<0&&(e=Math.min(e,f/(f-k))),h<0?b=Math.max(b,h/(h-l)):l<0&&(e=Math.min(e,h/(h-l))),e0&&M.z<1))X=C[z]=C[z]||new THREE.RenderableParticle,z++,A=X,A.x=M.x/M.w,A.y=M.y/M.w,A.z=M.z,A.rotation=Y.rotation.z,A.scale.x=Y.scale.x*Math.abs(A.x-(M.x+f.projectionMatrix.n11)/(M.w+f.projectionMatrix.n14)),A.scale.y=Y.scale.y*Math.abs(A.y-(M.y+f.projectionMatrix.n22)/(M.w+f.projectionMatrix.n24)),A.materials=Y.materials,K.push(A);h&&K.sort(b);return K}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),h=Math.cos(c),c=Math.sin(c),k=a*b,l=e*f;this.w=k*h-l*c;this.x=k*c+l*h;this.y=e*b*h+a*f*c;this.z=a*f*h-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c); this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;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); @@ -81,8 +81,8 @@ b;a++)c=this.faces[a],c.centroid.set(0,0,0),c instanceof THREE.Face3?(c.centroid c,e,f,h,k,l=new THREE.Vector3,n=new THREE.Vector3;e=0;for(f=this.faces.length;e0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y, this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.zthis.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b0&&(c(THREE.NormalBlending),b(1),f("rgba("+Math.floor(y.r*255)+","+Math.floor(y.g*255)+","+ Math.floor(y.b*255)+","+x+")"),o.fillRect(Math.floor(G.getX()),Math.floor(G.getY()),Math.floor(G.getWidth()),Math.floor(G.getHeight()))),G.empty())};this.render=function(a,n){function p(a){var c,b,e,f=a.lights;N.setRGB(0,0,0);ta.setRGB(0,0,0);pa.setRGB(0,0,0);a=0;for(c=f.length;a255?255:a;Ba[4]=h<0?0:h>255?255:h;Ba[5]=m<0?0:m>255?255:m;Ba[6]=c<0?0:c>255?25 ab,ra,Ha,Na,Wa,Za,Aa;this.autoClear?this.clear():o.setTransform(1,0,0,-1,t,v);h.info.render.vertices=0;h.info.render.faces=0;k=l.projectScene(a,n,this.sortElements);(ma=a.lights.length>0)&&p(a);Ya=0;for(ab=k.length;Ya0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h)):k instanceof THREE.PointLight&&(V.sub(k.position,c.centroidWorld),V.normalize(),h=c.normalWorld.dot(V)*k.intensity,h>0&&(b.r+=k.color.r*h,b.g+=k.color.g*h,b.b+=k.color.b*h))}function b(c,b,k,m,l,p){h.info.render.vertices+=3;h.info.render.faces++;L=e(T++); L.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+"z");l instanceof THREE.MeshBasicMaterial?B.copy(l.color):l instanceof THREE.MeshLambertMaterial?C?(K.r=F.r,K.g=F.g,K.b=F.b,a(p,m,K),B.r=Math.max(0,Math.min(l.color.r*K.r,1)),B.g=Math.max(0,Math.min(l.color.g*K.g,1)),B.b=Math.max(0,Math.min(l.color.b*K.b,1))):B.copy(l.color):l instanceof THREE.MeshDepthMaterial?(O=1-l.__2near/(l.__farPlusNear- m.z*l.__farMinusNear),B.setRGB(O,O,O)):l instanceof THREE.MeshNormalMaterial&&B.setRGB(f(m.normalWorld.x),f(m.normalWorld.y),f(m.normalWorld.z));l.wireframe?L.setAttribute("style","fill: none; stroke: "+B.getContextStyle()+"; stroke-width: "+l.wireframeLinewidth+"; stroke-opacity: "+l.opacity+"; stroke-linecap: "+l.wireframeLinecap+"; stroke-linejoin: "+l.wireframeLinejoin):L.setAttribute("style","fill: "+B.getContextStyle()+"; fill-opacity: "+l.opacity);n.appendChild(L)}function c(c,b,k,m,l,p,t){h.info.render.vertices+= 4;h.info.render.faces++;L=e(T++);L.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+b.positionScreen.x+" "+b.positionScreen.y+" L "+k.positionScreen.x+","+k.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");p instanceof THREE.MeshBasicMaterial?B.copy(p.color):p instanceof THREE.MeshLambertMaterial?C?(K.r=F.r,K.g=F.g,K.b=F.b,a(t,l,K),B.r=Math.max(0,Math.min(p.color.r*K.r,1)),B.g=Math.max(0,Math.min(p.color.g*K.g,1)),B.b=Math.max(0,Math.min(p.color.b*K.b,1))): B.copy(p.color):p instanceof THREE.MeshDepthMaterial?(O=1-p.__2near/(p.__farPlusNear-l.z*p.__farMinusNear),B.setRGB(O,O,O)):p instanceof THREE.MeshNormalMaterial&&B.setRGB(f(l.normalWorld.x),f(l.normalWorld.y),f(l.normalWorld.z));p.wireframe?L.setAttribute("style","fill: none; stroke: "+B.getContextStyle()+"; stroke-width: "+p.wireframeLinewidth+"; stroke-opacity: "+p.opacity+"; stroke-linecap: "+p.wireframeLinecap+"; stroke-linejoin: "+p.wireframeLinejoin):L.setAttribute("style","fill: "+B.getContextStyle()+ -"; fill-opacity: "+p.opacity);n.appendChild(L)}function e(a){H[a]==null&&(H[a]=document.createElementNS("http://www.w3.org/2000/svg","path"),m==0&&H[a].setAttribute("shape-rendering","crispEdges"));return H[a]}function f(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}var h=this,k=null,l=new THREE.Projector,n=document.createElementNS("http://www.w3.org/2000/svg","svg"),p,u,t,v,o,y,x,w,A=new THREE.Rectangle,z=new THREE.Rectangle,C=!1,B=new THREE.Color(16777215),K=new THREE.Color(16777215),F=new THREE.Color(0), -M=new THREE.Color(0),E=new THREE.Color(0),O,V=new THREE.Vector3,H=[],P=[],L,T,S,m=1;this.domElement=n;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(a){switch(a){case "high":m=1;break;case "low":m=0}};this.setSize=function(a,c){p=a;u=c;t=p/2;v=u/2;n.setAttribute("viewBox",-t+" "+-v+" "+p+" "+u);n.setAttribute("width",p);n.setAttribute("height",u);A.set(-t,-v,t,v)};this.clear=function(){for(;n.childNodes.length>0;)n.removeChild(n.childNodes[0])}; -this.render=function(a,e){var f,p,u,B,O,H,K,R;this.autoClear&&this.clear();h.info.render.vertices=0;h.info.render.faces=0;k=l.projectScene(a,e,this.sortElements);S=T=0;if(C=a.lights.length>0){K=a.lights;F.setRGB(0,0,0);M.setRGB(0,0,0);E.setRGB(0,0,0);f=0;for(p=K.length;f1?1:a}var h=this,k=null,l=new THREE.Projector,n=document.createElementNS("http://www.w3.org/2000/svg","svg"),p,u,t,v,o,y,x,w,A=new THREE.Rectangle,z=new THREE.Rectangle,C=!1,B=new THREE.Color(16777215),K=new THREE.Color(16777215),F=new THREE.Color(0), +M=new THREE.Color(0),E=new THREE.Color(0),O,V=new THREE.Vector3,I=[],P=[],L,T,S,m=1;this.domElement=n;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(a){switch(a){case "high":m=1;break;case "low":m=0}};this.setSize=function(a,c){p=a;u=c;t=p/2;v=u/2;n.setAttribute("viewBox",-t+" "+-v+" "+p+" "+u);n.setAttribute("width",p);n.setAttribute("height",u);A.set(-t,-v,t,v)};this.clear=function(){for(;n.childNodes.length>0;)n.removeChild(n.childNodes[0])}; +this.render=function(a,e){var f,p,u,B,O,I,K,R;this.autoClear&&this.clear();h.info.render.vertices=0;h.info.render.faces=0;k=l.projectScene(a,e,this.sortElements);S=T=0;if(C=a.lights.length>0){K=a.lights;F.setRGB(0,0,0);M.setRGB(0,0,0);E.setRGB(0,0,0);f=0;for(p=K.length;f=0)c=c.geometry.materials[b],c.transparent?(a.transparent=c,a.opaque=null):(a.opaque=c,a.transparent=null)}else if(c=e)c.transparent?(a.transparent=c,a.opaque=null):(a.opaque=c,a.transparent=null)}function y(a,c){return c.z-a.z}function x(a){var c,b,n,p=0,o,v,G,w,x=a.lights;pa||(pa=new THREE.PerspectiveCamera(S.shadowCameraFov,S.shadowMapWidth/S.shadowMapHeight,S.shadowCameraNear,S.shadowCameraFar));c=0;for(b=x.length;c=0;b--)a[b].object===c&&a.splice(b,1)}function K(a,c,b){a.push({buffer:c,object:b,opaque:null,transparent:null})}function F(a){if(a!==Z){switch(a){case THREE.AdditiveBlending:m.blendEquation(m.FUNC_ADD); -m.blendFunc(m.SRC_ALPHA,m.ONE);break;case THREE.SubtractiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.SRC_COLOR);break;default:m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)}Z=a}}function M(a,c,b){(b.width&b.width-1)===0&&(b.height&b.height-1)===0?(m.texParameteri(a,m.TEXTURE_WRAP_S,T(c.wrapS)),m.texParameteri(a, -m.TEXTURE_WRAP_T,T(c.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,T(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,T(c.minFilter)),m.generateMipmap(a)):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,L(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,L(c.minFilter)))}function E(a,c){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=m.createTexture(),S.info.memory.textures++; -m.activeTexture(m.TEXTURE0+c);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.image.width,a.image.height,0,T(a.format),m.UNSIGNED_BYTE,a.image.data):m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,a.image);M(m.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)}function O(a,c){m.bindRenderbuffer(m.RENDERBUFFER,a);c.depthBuffer&&!c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER, -m.DEPTH_COMPONENT16,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):c.depthBuffer&&c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,c.width,c.height)}function V(a){var c=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0; -if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=m.createTexture();if(c){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);M(m.TEXTURE_CUBE_MAP,a,a);for(var b=0;b<6;b++){a.__webglFramebuffer[b]=m.createFramebuffer();a.__webglRenderbuffer[b]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null);var e=a,f=m.TEXTURE_CUBE_MAP_POSITIVE_X+b;m.bindFramebuffer(m.FRAMEBUFFER, -a.__webglFramebuffer[b]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,f,e.__webglTexture,0);O(a.__webglRenderbuffer[b],a)}}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),M(m.TEXTURE_2D,a,a),m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null),b=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0, -b,a.__webglTexture,0),m.bindRenderbuffer(m.RENDERBUFFER,a.__webglRenderbuffer),O(a.__webglRenderbuffer,a);c?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(c=c?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,b=a.width,a=a.height,f=e=0):(c=null,b=qa,a=la,e=na,f=fa);c!==ea&&(m.bindFramebuffer(m.FRAMEBUFFER,c),m.viewport(e,f,b,a),ea=c)}function H(a){a instanceof THREE.WebGLRenderTargetCube? -(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function P(a,c){var b;a==="fragment"?b=m.createShader(m.FRAGMENT_SHADER):a==="vertex"&&(b=m.createShader(m.VERTEX_SHADER));m.shaderSource(b,c);m.compileShader(b);if(!m.getShaderParameter(b,m.COMPILE_STATUS))return console.error(m.getShaderInfoLog(b)),console.error(c), -null;return b}function L(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return m.NEAREST;default:return m.LINEAR}}function T(a){switch(a){case THREE.RepeatWrapping:return m.REPEAT;case THREE.ClampToEdgeWrapping:return m.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return m.MIRRORED_REPEAT;case THREE.NearestFilter:return m.NEAREST;case THREE.NearestMipMapNearestFilter:return m.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return m.NEAREST_MIPMAP_LINEAR; -case THREE.LinearFilter:return m.LINEAR;case THREE.LinearMipMapNearestFilter:return m.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return m.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return m.BYTE;case THREE.UnsignedByteType:return m.UNSIGNED_BYTE;case THREE.ShortType:return m.SHORT;case THREE.UnsignedShortType:return m.UNSIGNED_SHORT;case THREE.IntType:return m.INT;case THREE.UnsignedShortType:return m.UNSIGNED_INT;case THREE.FloatType:return m.FLOAT;case THREE.AlphaFormat:return m.ALPHA; -case THREE.RGBFormat:return m.RGB;case THREE.RGBAFormat:return m.RGBA;case THREE.LuminanceFormat:return m.LUMINANCE;case THREE.LuminanceAlphaFormat:return m.LUMINANCE_ALPHA}return 0}var S=this,m,aa=[],U=null,ea=null,da=-1,ia=null,ha=0,ja=null,ca=null,Z=null,R=null,Y=null,X=null,ga=null,oa=null,na=0,fa=0,qa=0,la=0,ua=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],sa=new THREE.Matrix4,Da=new Float32Array(16),Ea=new Float32Array(16),za=new THREE.Vector4, -Fa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},xa=a.canvas!==void 0?a.canvas:document.createElement("canvas"),G=a.stencil!==void 0?a.stencil:!0,$=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,ma=a.antialias!==void 0?a.antialias:!1,I=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),N=a.clearAlpha!==void 0?a.clearAlpha:0,ta=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0, -geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=xa;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate= -!0;var pa,ka=[],a=THREE.ShaderLib.depthRGBA,ya=THREE.UniformsUtils.clone(a.uniforms),va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya}),Ca=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya,morphTargets:!0});va._shadowPass=!0;Ca._shadowPass=!0;try{if(!(m=xa.getContext("experimental-webgl",{antialias:ma,stencil:G,preserveDrawingBuffer:$})))throw"Error creating WebGL context.";console.log(navigator.userAgent+ -" | "+m.getParameter(m.VERSION)+" | "+m.getParameter(m.VENDOR)+" | "+m.getParameter(m.RENDERER)+" | "+m.getParameter(m.SHADING_LANGUAGE_VERSION))}catch(Ba){console.error(Ba)}m.clearColor(0,0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.clearColor(I.r,I.g,I.b,N);this.context=m;var Ga=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS)> -0,W={};W.vertices=new Float32Array(16);W.faces=new Uint16Array(6);G=0;W.vertices[G++]=-1;W.vertices[G++]=-1;W.vertices[G++]=0;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=-1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=0;W.vertices[G++]=-1;W.vertices[G++]=1;W.vertices[G++]=0;G=W.vertices[G++]=0;W.faces[G++]=0;W.faces[G++]=1;W.faces[G++]=2;W.faces[G++]=0;W.faces[G++]=2;W.faces[G++]=3;W.vertexBuffer=m.createBuffer();W.elementBuffer= -m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,W.vertexBuffer);m.bufferData(m.ARRAY_BUFFER,W.vertices,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,W.elementBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,W.faces,m.STATIC_DRAW);W.program=m.createProgram();m.attachShader(W.program,P("fragment",THREE.ShaderLib.sprite.fragmentShader));m.attachShader(W.program,P("vertex",THREE.ShaderLib.sprite.vertexShader));m.linkProgram(W.program);W.attributes={};W.uniforms={};W.attributes.position=m.getAttribLocation(W.program, -"position");W.attributes.uv=m.getAttribLocation(W.program,"uv");W.uniforms.uvOffset=m.getUniformLocation(W.program,"uvOffset");W.uniforms.uvScale=m.getUniformLocation(W.program,"uvScale");W.uniforms.rotation=m.getUniformLocation(W.program,"rotation");W.uniforms.scale=m.getUniformLocation(W.program,"scale");W.uniforms.alignment=m.getUniformLocation(W.program,"alignment");W.uniforms.color=m.getUniformLocation(W.program,"color");W.uniforms.map=m.getUniformLocation(W.program,"map");W.uniforms.opacity= -m.getUniformLocation(W.program,"opacity");W.uniforms.useScreenCoordinates=m.getUniformLocation(W.program,"useScreenCoordinates");W.uniforms.affectedByDistance=m.getUniformLocation(W.program,"affectedByDistance");W.uniforms.screenPosition=m.getUniformLocation(W.program,"screenPosition");W.uniforms.modelViewMatrix=m.getUniformLocation(W.program,"modelViewMatrix");W.uniforms.projectionMatrix=m.getUniformLocation(W.program,"projectionMatrix");var Ta=!1;this.setSize=function(a,c){xa.width=a;xa.height= -c;this.setViewport(0,0,xa.width,xa.height)};this.setViewport=function(a,c,b,e){na=a;fa=c;qa=b;la=e;m.viewport(na,fa,qa,la)};this.setScissor=function(a,c,b,e){m.scissor(a,c,b,e)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColorHex=function(a,c){I.setHex(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.setClearColor=function(a,c){I.copy(a);N=c;m.clearColor(I.r,I.g,I.b,N)};this.getClearColor=function(){return I};this.getClearAlpha=function(){return N}; -this.clear=function(a,c,b){var e=0;if(a===void 0||a)e|=m.COLOR_BUFFER_BIT;if(c===void 0||c)e|=m.DEPTH_BUFFER_BIT;if(b===void 0||b)e|=m.STENCIL_BUFFER_BIT;m.clear(e)};this.getContext=function(){return m};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(g in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[g];m.deleteBuffer(c.__webglVertexBuffer); -m.deleteBuffer(c.__webglNormalBuffer);m.deleteBuffer(c.__webglTangentBuffer);m.deleteBuffer(c.__webglColorBuffer);m.deleteBuffer(c.__webglUVBuffer);m.deleteBuffer(c.__webglUV2Buffer);m.deleteBuffer(c.__webglSkinVertexABuffer);m.deleteBuffer(c.__webglSkinVertexBBuffer);m.deleteBuffer(c.__webglSkinIndicesBuffer);m.deleteBuffer(c.__webglSkinWeightsBuffer);m.deleteBuffer(c.__webglFaceBuffer);m.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var b=0,e=c.numMorphTargets;b=0;b--)a[b].object===c&&a.splice(b,1)}function K(a,c,b){a.push({buffer:c,object:b,opaque:null,transparent:null})}function F(a){if(a!==Z){switch(a){case THREE.AdditiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE);break;case THREE.SubtractiveBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO, +m.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:m.blendEquation(m.FUNC_ADD);m.blendFunc(m.ZERO,m.SRC_COLOR);break;default:m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)}Z=a}}function M(a,c,b){(b.width&b.width-1)===0&&(b.height&b.height-1)===0?(m.texParameteri(a,m.TEXTURE_WRAP_S,T(c.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,T(c.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,T(c.magFilter)),m.texParameteri(a, +m.TEXTURE_MIN_FILTER,T(c.minFilter)),m.generateMipmap(a)):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,L(c.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,L(c.minFilter)))}function E(a,c){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=m.createTexture(),S.info.memory.textures++;m.activeTexture(m.TEXTURE0+c);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture? +m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.image.width,a.image.height,0,T(a.format),m.UNSIGNED_BYTE,a.image.data):m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,a.image);M(m.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else m.activeTexture(m.TEXTURE0+c),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)}function O(a,c){m.bindRenderbuffer(m.RENDERBUFFER,a);c.depthBuffer&&!c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER, +m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):c.depthBuffer&&c.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,c.width,c.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,c.width,c.height)}function V(a){var c=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=m.createTexture(); +if(c){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);M(m.TEXTURE_CUBE_MAP,a,a);for(var b=0;b<6;b++){a.__webglFramebuffer[b]=m.createFramebuffer();a.__webglRenderbuffer[b]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null);var e=a,f=m.TEXTURE_CUBE_MAP_POSITIVE_X+b;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[b]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0, +f,e.__webglTexture,0);O(a.__webglRenderbuffer[b],a)}}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),M(m.TEXTURE_2D,a,a),m.texImage2D(m.TEXTURE_2D,0,T(a.format),a.width,a.height,0,T(a.format),T(a.type),null),b=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,b,a.__webglTexture,0),m.bindRenderbuffer(m.RENDERBUFFER,a.__webglRenderbuffer), +O(a.__webglRenderbuffer,a);c?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(c=c?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,b=a.width,a=a.height,f=e=0):(c=null,b=qa,a=la,e=na,f=fa);c!==ea&&(m.bindFramebuffer(m.FRAMEBUFFER,c),m.viewport(e,f,b,a),ea=c)}function I(a){a instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP), +m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function P(a,c){var b;a==="fragment"?b=m.createShader(m.FRAGMENT_SHADER):a==="vertex"&&(b=m.createShader(m.VERTEX_SHADER));m.shaderSource(b,c);m.compileShader(b);if(!m.getShaderParameter(b,m.COMPILE_STATUS))return console.error(m.getShaderInfoLog(b)),console.error(c),null;return b}function L(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return m.NEAREST; +default:return m.LINEAR}}function T(a){switch(a){case THREE.RepeatWrapping:return m.REPEAT;case THREE.ClampToEdgeWrapping:return m.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return m.MIRRORED_REPEAT;case THREE.NearestFilter:return m.NEAREST;case THREE.NearestMipMapNearestFilter:return m.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return m.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return m.LINEAR;case THREE.LinearMipMapNearestFilter:return m.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return m.LINEAR_MIPMAP_LINEAR; +case THREE.ByteType:return m.BYTE;case THREE.UnsignedByteType:return m.UNSIGNED_BYTE;case THREE.ShortType:return m.SHORT;case THREE.UnsignedShortType:return m.UNSIGNED_SHORT;case THREE.IntType:return m.INT;case THREE.UnsignedShortType:return m.UNSIGNED_INT;case THREE.FloatType:return m.FLOAT;case THREE.AlphaFormat:return m.ALPHA;case THREE.RGBFormat:return m.RGB;case THREE.RGBAFormat:return m.RGBA;case THREE.LuminanceFormat:return m.LUMINANCE;case THREE.LuminanceAlphaFormat:return m.LUMINANCE_ALPHA}return 0} +var S=this,m,aa=[],U=null,ea=null,da=-1,ia=null,ha=0,ja=null,ca=null,Z=null,R=null,Y=null,X=null,ga=null,oa=null,na=0,fa=0,qa=0,la=0,ua=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],sa=new THREE.Matrix4,Da=new Float32Array(16),Ea=new Float32Array(16),za=new THREE.Vector4,Fa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},xa=a.canvas!==void 0?a.canvas:document.createElement("canvas"), +G=a.stencil!==void 0?a.stencil:!0,$=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,ma=a.antialias!==void 0?a.antialias:!1,H=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),N=a.clearAlpha!==void 0?a.clearAlpha:0,ta=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=xa;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth= +this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var pa,ka=[],a=THREE.ShaderLib.depthRGBA,ya=THREE.UniformsUtils.clone(a.uniforms),va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader, +vertexShader:a.vertexShader,uniforms:ya}),Ca=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ya,morphTargets:!0});va._shadowPass=!0;Ca._shadowPass=!0;try{if(!(m=xa.getContext("experimental-webgl",{antialias:ma,stencil:G,preserveDrawingBuffer:$})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+m.getParameter(m.VERSION)+" | "+m.getParameter(m.VENDOR)+" | "+m.getParameter(m.RENDERER)+" | "+m.getParameter(m.SHADING_LANGUAGE_VERSION))}catch(Ba){console.error(Ba)}m.clearColor(0, +0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.clearColor(H.r,H.g,H.b,N);this.context=m;var Ga=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,W={};W.vertices=new Float32Array(16);W.faces=new Uint16Array(6);G=0;W.vertices[G++]=-1;W.vertices[G++]=-1;W.vertices[G++]=0;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]= +-1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=1;W.vertices[G++]=0;W.vertices[G++]=-1;W.vertices[G++]=1;W.vertices[G++]=0;G=W.vertices[G++]=0;W.faces[G++]=0;W.faces[G++]=1;W.faces[G++]=2;W.faces[G++]=0;W.faces[G++]=2;W.faces[G++]=3;W.vertexBuffer=m.createBuffer();W.elementBuffer=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,W.vertexBuffer);m.bufferData(m.ARRAY_BUFFER,W.vertices,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,W.elementBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER, +W.faces,m.STATIC_DRAW);W.program=m.createProgram();m.attachShader(W.program,P("fragment",THREE.ShaderLib.sprite.fragmentShader));m.attachShader(W.program,P("vertex",THREE.ShaderLib.sprite.vertexShader));m.linkProgram(W.program);W.attributes={};W.uniforms={};W.attributes.position=m.getAttribLocation(W.program,"position");W.attributes.uv=m.getAttribLocation(W.program,"uv");W.uniforms.uvOffset=m.getUniformLocation(W.program,"uvOffset");W.uniforms.uvScale=m.getUniformLocation(W.program,"uvScale");W.uniforms.rotation= +m.getUniformLocation(W.program,"rotation");W.uniforms.scale=m.getUniformLocation(W.program,"scale");W.uniforms.alignment=m.getUniformLocation(W.program,"alignment");W.uniforms.color=m.getUniformLocation(W.program,"color");W.uniforms.map=m.getUniformLocation(W.program,"map");W.uniforms.opacity=m.getUniformLocation(W.program,"opacity");W.uniforms.useScreenCoordinates=m.getUniformLocation(W.program,"useScreenCoordinates");W.uniforms.affectedByDistance=m.getUniformLocation(W.program,"affectedByDistance"); +W.uniforms.screenPosition=m.getUniformLocation(W.program,"screenPosition");W.uniforms.modelViewMatrix=m.getUniformLocation(W.program,"modelViewMatrix");W.uniforms.projectionMatrix=m.getUniformLocation(W.program,"projectionMatrix");var Ta=!1;this.setSize=function(a,c){xa.width=a;xa.height=c;this.setViewport(0,0,xa.width,xa.height)};this.setViewport=function(a,c,b,e){na=a;fa=c;qa=b;la=e;m.viewport(na,fa,qa,la)};this.setScissor=function(a,c,b,e){m.scissor(a,c,b,e)};this.enableScissorTest=function(a){a? +m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColorHex=function(a,c){H.setHex(a);N=c;m.clearColor(H.r,H.g,H.b,N)};this.setClearColor=function(a,c){H.copy(a);N=c;m.clearColor(H.r,H.g,H.b,N)};this.getClearColor=function(){return H};this.getClearAlpha=function(){return N};this.clear=function(a,c,b){var e=0;if(a===void 0||a)e|=m.COLOR_BUFFER_BIT;if(c===void 0||c)e|=m.DEPTH_BUFFER_BIT;if(b===void 0||b)e|=m.STENCIL_BUFFER_BIT;m.clear(e)};this.getContext=function(){return m};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(g in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[g];m.deleteBuffer(c.__webglVertexBuffer);m.deleteBuffer(c.__webglNormalBuffer);m.deleteBuffer(c.__webglTangentBuffer);m.deleteBuffer(c.__webglColorBuffer);m.deleteBuffer(c.__webglUVBuffer);m.deleteBuffer(c.__webglUV2Buffer);m.deleteBuffer(c.__webglSkinVertexABuffer); +m.deleteBuffer(c.__webglSkinVertexBBuffer);m.deleteBuffer(c.__webglSkinIndicesBuffer);m.deleteBuffer(c.__webglSkinWeightsBuffer);m.deleteBuffer(c.__webglFaceBuffer);m.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var b=0,e=c.numMorphTargets;b=0&&m.enableVertexAttribArray(u.position);u.color>=0&&m.enableVertexAttribArray(u.color);u.normal>=0&&m.enableVertexAttribArray(u.normal); u.tangent>=0&&m.enableVertexAttribArray(u.tangent);a.skinning&&u.skinVertexA>=0&&u.skinVertexB>=0&&u.skinIndex>=0&&u.skinWeight>=0&&(m.enableVertexAttribArray(u.skinVertexA),m.enableVertexAttribArray(u.skinVertexB),m.enableVertexAttribArray(u.skinIndex),m.enableVertexAttribArray(u.skinWeight));if(a.attributes)for(k in a.attributes)u[k]!==void 0&&u[k]>=0&&m.enableVertexAttribArray(u[k]);if(a.morphTargets)for(k=a.numSupportedMorphTargets=0;k=0&&(m.enableVertexAttribArray(u[G]), -a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,c,b,e){V(a);this.clear(c,b,e)};this.updateShadowMap=function(a,c){x(a,c)};this.render=function(a,c,b,G){var ma,$,z,C,B,I,K,E=a.lights,na=a.fog;da=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&x(a,c);S.info.render.calls=0;S.info.render.vertices=0;S.info.render.faces=0;if(c.matrixAutoUpdate){for(z=c;z.parent;)z=z.parent;z.update(void 0,!0)}a.update(void 0,!1, -c);c.matrixWorldInverse.flattenToArray(Ea);c.projectionMatrix.flattenToArray(Da);sa.multiply(c.projectionMatrix,c.matrixWorldInverse);u(sa);this.initWebGLObjects(a);V(b);(this.autoClear||G)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);z=a.__webglObjects.length;for(G=0;G=0;G--)if(B=a.__webglObjects[G],B.render&&(I=B.object,K=B.buffer,$=B.opaque))k(I),l($.depthTest),n($.depthWrite),p($.polygonOffset,$.polygonOffsetFactor,$.polygonOffsetUnits),f(c,E,na,$,K, -I);for(G=0;G=0;G--)if(B=a.__webglObjects[G],B.render&&(H=B.object,K=B.buffer,$=B.opaque))k(H),l($.depthTest),n($.depthWrite),p($.polygonOffset,$.polygonOffsetFactor,$.polygonOffsetUnits), +f(c,E,na,$,K,H);for(G=0;G65535&&(G[v].counter+=1,u=G[v].hash+"_"+G[v].counter,l.geometryGroups[u]===void 0&&(l.geometryGroups[u]={faces:[], materialIndex:o,vertices:0,numMorphTargets:w})),l.geometryGroups[u].faces.push(n),l.geometryGroups[u].vertices+=t;l.geometryGroupsList=[];n=void 0;for(n in l.geometryGroups)l.geometryGroups[n].id=ha++,l.geometryGroupsList.push(l.geometryGroups[n])}for(k in h.geometryGroups)if(l=h.geometryGroups[k],!l.__webglVertexBuffer){n=l;n.__webglVertexBuffer=m.createBuffer();n.__webglNormalBuffer=m.createBuffer();n.__webglTangentBuffer=m.createBuffer();n.__webglColorBuffer=m.createBuffer();n.__webglUVBuffer= @@ -318,23 +318,23 @@ l.__webglColorBuffer=m.createBuffer(),S.info.memory.geometries++,l=h,n=l.vertice attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(n*size),attribute.buffer=m.createBuffer(),attribute.buffer.belongsToAttribute=o,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;l.__webglCustomAttributesList.push(attribute)}}h.__dirtyVertices=!0;h.__dirtyColors=!0}if(!e.__webglActive){if(e instanceof THREE.Mesh)for(k in h=e.geometry,h.geometryGroups)l=h.geometryGroups[k],K(f.__webglObjects,l,e);else e instanceof THREE.Ribbon||e instanceof THREE.Line|| e instanceof THREE.ParticleSystem?(h=e.geometry,K(f.__webglObjects,h,e)):THREE.MarchingCubes!==void 0&&e instanceof THREE.MarchingCubes||e.immediateRenderCallback?f.__webglObjectsImmediate.push({object:e,opaque:null,transparent:null}):e instanceof THREE.Sprite&&f.__webglSprites.push(e);e.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;){e=a.__objectsRemoved[0];f=a;if(e instanceof THREE.Mesh||e instanceof THREE.ParticleSystem||e instanceof THREE.Ribbon||e instanceof THREE.Line)B(f.__webglObjects, e);else if(e instanceof THREE.Sprite){f=f.__webglSprites;k=e;for(h=f.length-1;h>=0;h--)f[h]===k&&f.splice(h,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&B(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,da,v));Fa&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglNormalBuffer),m.bufferData(m.ARRAY_BUFFER,ya,v));xa&&sa.hasTangents&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglTangentBuffer),m.bufferData(m.ARRAY_BUFFER,aa, v));za&&qa>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,ia,v));za&&Y>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,ua,v));Ea&&(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,Ca,v),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,va,v));Q>0&&(m.bindBuffer(m.ARRAY_BUFFER,o.__webglSkinVertexABuffer),m.bufferData(m.ARRAY_BUFFER,ga,v),m.bindBuffer(m.ARRAY_BUFFER, @@ -495,13 +495,13 @@ this.vertices[c].position.clone().setY(0).normalize(),x=this.vertices[t].positio B=new THREE.UV(C.u,1),this.faces.push(new THREE.Face3(c,t,v,[y,x,w])),this.faceVertexUvs[0].push([z,C,B])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry; THREE.ExtrudeGeometry=function(a,b){if(typeof a!=="undefined"){THREE.Geometry.call(this);var a=a instanceof Array?a:[a],c,e=a.length,f;this.shapebb=a[e-1].getBoundingBox();for(c=0;ca&&(a+=Math.PI*2),anglec=(c+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(l).subSelf(a).clone()}function f(a){for(H=a.length;--H>=0;){ja=H;ca=H-1;ca<0&&(ca=a.length- +l.copy(c).addSelf(h);m.copy(b).addSelf(f);h=e.dot(f);f=m.subSelf(l).dot(f);h===0&&(console.log("Either infinite or no solutions!"),f===0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));f/=h;if(f<0)return c=Math.atan2(c.y-a.y,c.x-a.x),a=Math.atan2(b.y-a.y,b.x-a.x),c>a&&(a+=Math.PI*2),anglec=(c+a)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return e.multiplyScalar(f).addSelf(l).subSelf(a).clone()}function f(a){for(I=a.length;--I>=0;){ja=I;ca=I-1;ca<0&&(ca=a.length- 1);for(var c=0,b=o+u*2,c=0;c=0;L--){T=L/u;S=n*(1-T);T=p*Math.sin(T*Math.PI/2);H=0;for(P=z.length;H=0;L--){T=L/u;S=n*(1-T);T=p*Math.sin(T*Math.PI/2);I=0;for(P=z.length;I0)for(p=0;p2;){if(t--<=0){console.log("Warning, unable to triangulate polygon!");if(e)return l;return h}n=p;f<=n&&(n=0);p=n+1;f<=p&&(p=0);u=p+1;f<=u&&(u=0);var v;a:{v=a;var o=n,y=p,x=u,w=f,A=k,z=void 0,C=void 0,B=void 0, -K=void 0,F=void 0,M=void 0,E=void 0,O=void 0,V=void 0,C=v[A[o]].x,B=v[A[o]].y,K=v[A[y]].x,F=v[A[y]].y,M=v[A[x]].x,E=v[A[x]].y;if(1.0E-10>(K-C)*(E-B)-(F-B)*(M-C))v=!1;else{for(z=0;z=0&&L>=0&&S>=0){v=!1; +K=void 0,F=void 0,M=void 0,E=void 0,O=void 0,V=void 0,C=v[A[o]].x,B=v[A[o]].y,K=v[A[y]].x,F=v[A[y]].y,M=v[A[x]].x,E=v[A[x]].y;if(1.0E-10>(K-C)*(E-B)-(F-B)*(M-C))v=!1;else{for(z=0;z=0&&L>=0&&S>=0){v=!1; break a}}v=!0}}if(v){h.push([a[k[n]],a[k[p]],a[k[u]]]);l.push([k[n],k[p],k[u]]);n=p;for(u=p+1;u>7)-127;e|=(h&127)<<16|f<<8;if(e==0&&l==-127)return 0;return(1-2*(k>>7))*(1+e*Math.pow(2,-23))*Math.pow(2,l)}function f(a,c){var b=u(a,c),e=u(a,c+1),h=u(a,c+2);return(u(a,c+3)<<24)+(h<<16)+(e<<8)+b}function n(a,c){var b=u(a,c);return(u(a,c+1)<<8)+b}function p(a,c){var b=u(a,c);return b>127?b-256:b}function u(a,c){return a.charCodeAt(c)&255}function t(c){var b, -e,h;b=f(a,c);e=f(a,c+F);h=f(a,c+M);c=n(a,c+E);A.faces.push(new THREE.Face3(b,e,h,null,null,c))}function v(c){var b,e,h,k,m,o,p;b=f(a,c);e=f(a,c+F);h=f(a,c+M);k=n(a,c+E);m=f(a,c+O);o=f(a,c+V);p=f(a,c+H);var c=B[o*3],t=B[o*3+1];o=B[o*3+2];var u=B[p*3],v=B[p*3+1];p=B[p*3+2];A.faces.push(new THREE.Face3(b,e,h,[new THREE.Vector3(B[m*3],B[m*3+1],B[m*3+2]),new THREE.Vector3(c,t,o),new THREE.Vector3(u,v,p)],null,k))}function o(c){var b,e,h,k;b=f(a,c);e=f(a,c+P);h=f(a,c+L);k=f(a,c+T);c=n(a,c+S);A.faces.push(new THREE.Face4(b, -e,h,k,null,null,c))}function y(c){var b,e,h,k,o,p,t,u,v;b=f(a,c);e=f(a,c+P);h=f(a,c+L);k=f(a,c+T);o=n(a,c+S);p=f(a,c+m);t=f(a,c+aa);u=f(a,c+U);v=f(a,c+ea);var c=B[t*3],w=B[t*3+1];t=B[t*3+2];var G=B[u*3],x=B[u*3+1];u=B[u*3+2];var ma=B[v*3],I=B[v*3+1];v=B[v*3+2];A.faces.push(new THREE.Face4(b,e,h,k,[new THREE.Vector3(B[p*3],B[p*3+1],B[p*3+2]),new THREE.Vector3(c,w,t),new THREE.Vector3(G,x,u),new THREE.Vector3(ma,I,v)],null,o))}function x(c){var b,e,h,k;b=f(a,c);e=f(a,c+da);h=f(a,c+ia);c=K[b*2];k=K[b* +e,h;b=f(a,c);e=f(a,c+F);h=f(a,c+M);c=n(a,c+E);A.faces.push(new THREE.Face3(b,e,h,null,null,c))}function v(c){var b,e,h,k,m,o,p;b=f(a,c);e=f(a,c+F);h=f(a,c+M);k=n(a,c+E);m=f(a,c+O);o=f(a,c+V);p=f(a,c+I);var c=B[o*3],t=B[o*3+1];o=B[o*3+2];var u=B[p*3],v=B[p*3+1];p=B[p*3+2];A.faces.push(new THREE.Face3(b,e,h,[new THREE.Vector3(B[m*3],B[m*3+1],B[m*3+2]),new THREE.Vector3(c,t,o),new THREE.Vector3(u,v,p)],null,k))}function o(c){var b,e,h,k;b=f(a,c);e=f(a,c+P);h=f(a,c+L);k=f(a,c+T);c=n(a,c+S);A.faces.push(new THREE.Face4(b, +e,h,k,null,null,c))}function y(c){var b,e,h,k,o,p,t,u,v;b=f(a,c);e=f(a,c+P);h=f(a,c+L);k=f(a,c+T);o=n(a,c+S);p=f(a,c+m);t=f(a,c+aa);u=f(a,c+U);v=f(a,c+ea);var c=B[t*3],w=B[t*3+1];t=B[t*3+2];var G=B[u*3],x=B[u*3+1];u=B[u*3+2];var ma=B[v*3],H=B[v*3+1];v=B[v*3+2];A.faces.push(new THREE.Face4(b,e,h,k,[new THREE.Vector3(B[p*3],B[p*3+1],B[p*3+2]),new THREE.Vector3(c,w,t),new THREE.Vector3(G,x,u),new THREE.Vector3(ma,H,v)],null,o))}function x(c){var b,e,h,k;b=f(a,c);e=f(a,c+da);h=f(a,c+ia);c=K[b*2];k=K[b* 2+1];b=K[e*2];var m=A.faceVertexUvs[0];e=K[e*2+1];var n=K[h*2];h=K[h*2+1];var o=[];o.push(new THREE.UV(c,k));o.push(new THREE.UV(b,e));o.push(new THREE.UV(n,h));m.push(o)}function w(c){var b,e,h,k,m,n;b=f(a,c);e=f(a,c+ha);h=f(a,c+ja);k=f(a,c+ca);c=K[b*2];m=K[b*2+1];b=K[e*2];n=K[e*2+1];e=K[h*2];var o=A.faceVertexUvs[0];h=K[h*2+1];var p=K[k*2];k=K[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(b,n));t.push(new THREE.UV(e,h));t.push(new THREE.UV(p,k));o.push(t)}var A=this,z=0,C,B=[],K= -[],F,M,E,O,V,H,P,L,T,S,m,aa,U,ea,da,ia,ha,ja,ca,Z,R,Y,X,ga,oa;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(A,e,c);C={signature:a.substr(z,8),header_bytes:u(a,z+8),vertex_coordinate_bytes:u(a,z+9),normal_coordinate_bytes:u(a,z+10),uv_coordinate_bytes:u(a,z+11),vertex_index_bytes:u(a,z+12),normal_index_bytes:u(a,z+13),uv_index_bytes:u(a,z+14),material_index_bytes:u(a,z+15),nvertices:f(a,z+16),nnormals:f(a,z+16+4),nuvs:f(a,z+16+8),ntri_flat:f(a,z+16+12),ntri_smooth:f(a,z+16+16),ntri_flat_uv:f(a, -z+16+20),ntri_smooth_uv:f(a,z+16+24),nquad_flat:f(a,z+16+28),nquad_smooth:f(a,z+16+32),nquad_flat_uv:f(a,z+16+36),nquad_smooth_uv:f(a,z+16+40)};z+=C.header_bytes;F=C.vertex_index_bytes;M=C.vertex_index_bytes*2;E=C.vertex_index_bytes*3;O=C.vertex_index_bytes*3+C.material_index_bytes;V=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;H=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;P=C.vertex_index_bytes;L=C.vertex_index_bytes*2;T=C.vertex_index_bytes*3;S=C.vertex_index_bytes* +[],F,M,E,O,V,I,P,L,T,S,m,aa,U,ea,da,ia,ha,ja,ca,Z,R,Y,X,ga,oa;THREE.Geometry.call(this);THREE.Loader.prototype.initMaterials(A,e,c);C={signature:a.substr(z,8),header_bytes:u(a,z+8),vertex_coordinate_bytes:u(a,z+9),normal_coordinate_bytes:u(a,z+10),uv_coordinate_bytes:u(a,z+11),vertex_index_bytes:u(a,z+12),normal_index_bytes:u(a,z+13),uv_index_bytes:u(a,z+14),material_index_bytes:u(a,z+15),nvertices:f(a,z+16),nnormals:f(a,z+16+4),nuvs:f(a,z+16+8),ntri_flat:f(a,z+16+12),ntri_smooth:f(a,z+16+16),ntri_flat_uv:f(a, +z+16+20),ntri_smooth_uv:f(a,z+16+24),nquad_flat:f(a,z+16+28),nquad_smooth:f(a,z+16+32),nquad_flat_uv:f(a,z+16+36),nquad_smooth_uv:f(a,z+16+40)};z+=C.header_bytes;F=C.vertex_index_bytes;M=C.vertex_index_bytes*2;E=C.vertex_index_bytes*3;O=C.vertex_index_bytes*3+C.material_index_bytes;V=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes;I=C.vertex_index_bytes*3+C.material_index_bytes+C.normal_index_bytes*2;P=C.vertex_index_bytes;L=C.vertex_index_bytes*2;T=C.vertex_index_bytes*3;S=C.vertex_index_bytes* 4;m=C.vertex_index_bytes*4+C.material_index_bytes;aa=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes;U=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*2;ea=C.vertex_index_bytes*4+C.material_index_bytes+C.normal_index_bytes*3;da=C.uv_index_bytes;ia=C.uv_index_bytes*2;ha=C.uv_index_bytes;ja=C.uv_index_bytes*2;ca=C.uv_index_bytes*3;c=C.vertex_index_bytes*3+C.material_index_bytes;oa=C.vertex_index_bytes*4+C.material_index_bytes;Z=C.ntri_flat*c;R=C.ntri_smooth*(c+ C.normal_index_bytes*3);Y=C.ntri_flat_uv*(c+C.uv_index_bytes*3);X=C.ntri_smooth_uv*(c+C.normal_index_bytes*3+C.uv_index_bytes*3);ga=C.nquad_flat*oa;c=C.nquad_smooth*(oa+C.normal_index_bytes*4);oa=C.nquad_flat_uv*(oa+C.uv_index_bytes*4);z+=function(c){for(var e,h,f,l=C.vertex_coordinate_bytes*3,m=c+C.nvertices*l;c1?b[1].substr(0,c):"0";b[1].length0&&(this[b.nodeName]=parseFloat(e[0].textContent))}}this.create();return this};V.prototype.create=function(){var a={},c=this.transparency!==void 0&&this.transparency<1,b;for(b in this)switch(b){case "ambient":case "emission":case "diffuse":case "specular":var e=this[b];if(e instanceof O)if(e.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(e=na[this.effect.surface.init_from]))a.map=THREE.ImageUtils.loadTexture(Ea+e.init_from), -a.map.wrapS=THREE.RepeatWrapping,a.map.wrapT=THREE.RepeatWrapping,a.map.repeat.x=1,a.map.repeat.y=-1}else b=="diffuse"?a.color=e.color.getHex():c||(a[b]=e.color.getHex());break;case "shininess":case "reflectivity":a[b]=this[b];break;case "transparency":if(c)a.transparent=!0,a.opacity=this[b],c=!0}a.shading=xa;return this.material=new THREE.MeshLambertMaterial(a)};H.prototype.parse=function(a){for(var c=0;c=0,e=a.indexOf("(")>=0,h,f;if(b)c=a.split("."),a=c.shift(),f=c.shift();else if(e){h=a.split("(");a=h.shift();for(c=0;c1&&(V=new THREE.MeshFaceMaterial);object=new THREE.Mesh(F,V);object.name=o;object.position.set(C[0],C[1],C[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=z.visible;U.scene.add(object);U.objects[o]=object;z.meshCollider&&(a=THREE.CollisionUtils.MeshColliderWBox(object),U.scene.collisions.colliders.push(a));if(z.castsShadow)a= new THREE.ShadowVolume(F),U.scene.add(a),a.position=object.position,a.rotation=object.rotation,a.scale=object.scale;z.trigger&&z.trigger.toLowerCase()!="none"&&(a={type:z.trigger,object:z},U.triggers[object.name]=a)}}else C=z.position,r=z.rotation,q=z.quaternion,s=z.scale,q=0,object=new THREE.Object3D,object.name=o,object.position.set(C[0],C[1],C[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],s[1],s[2]),object.visible= z.visible!==void 0?z.visible:!1,U.scene.add(object),U.objects[o]=object,U.empties[o]=object,z.trigger&&z.trigger.toLowerCase()!="none"&&(a={type:z.trigger,object:z},U.triggers[object.name]=a)}function n(a){return function(b){U.geometries[a]=b;l();T-=1;c.onLoadComplete();u()}}function p(a){return function(c){U.geometries[a]=c}}function u(){c.callbackProgress({totalModels:m,totalTextures:aa,loadedModels:m-T,loadedTextures:aa-S},U);c.onLoadProgress();T==0&&S==0&&b(U)}var t,v,o,y,x,w,A,z,C,B,K,F,M,E, -O,V,H,P,L,T,S,m,aa,U;P=a.data;O=new THREE.BinaryLoader;L=new THREE.JSONLoader;S=T=0;U={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(o in P.objects)if(z=P.objects[o],z.meshCollider){a=!0;break}if(a)U.scene.collisions=new THREE.CollisionSystem;if(P.transform){a=P.transform.position;B=P.transform.rotation;var ea=P.transform.scale;a&&U.scene.position.set(a[0],a[1],a[2]);B&&U.scene.rotation.set(B[0],B[1],B[2]);ea&& +O,V,I,P,L,T,S,m,aa,U;P=a.data;O=new THREE.BinaryLoader;L=new THREE.JSONLoader;S=T=0;U={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};a=!1;for(o in P.objects)if(z=P.objects[o],z.meshCollider){a=!0;break}if(a)U.scene.collisions=new THREE.CollisionSystem;if(P.transform){a=P.transform.position;B=P.transform.rotation;var ea=P.transform.scale;a&&U.scene.position.set(a[0],a[1],a[2]);B&&U.scene.rotation.set(B[0],B[1],B[2]);ea&& U.scene.scale.set(ea[0],ea[1],ea[2]);(a||B||ea)&&U.scene.updateMatrix()}a=function(){S-=1;u();c.onLoadComplete()};for(x in P.cameras)B=P.cameras[x],B.type=="perspective"?M=new THREE.PerspectiveCamera(B.fov,B.aspect,B.near,B.far):B.type=="ortho"&&(M=new THREE.OrthographicCamera(B.left,B.right,B.top,B.bottom,B.near,B.far)),C=B.position,B=B.target,M.position.set(C[0],C[1],C[2]),M.target=new THREE.Vector3(B[0],B[1],B[2]),U.cameras[x]=M;for(y in P.lights)x=P.lights[y],M=x.color!==void 0?x.color:16777215, -B=x.intensity!==void 0?x.intensity:1,x.type=="directional"?(C=x.direction,H=new THREE.DirectionalLight(M,B),H.position.set(C[0],C[1],C[2]),H.position.normalize()):x.type=="point"?(C=x.position,d=x.distance,H=new THREE.PointLight(M,B,d),H.position.set(C[0],C[1],C[2])):x.type=="ambient"&&(H=new THREE.AmbientLight(M)),U.scene.add(H),U.lights[y]=H;for(w in P.fogs)y=P.fogs[w],y.type=="linear"?E=new THREE.Fog(0,y.near,y.far):y.type=="exp2"&&(E=new THREE.FogExp2(0,y.density)),B=y.color,E.color.setRGB(B[0], +B=x.intensity!==void 0?x.intensity:1,x.type=="directional"?(C=x.direction,I=new THREE.DirectionalLight(M,B),I.position.set(C[0],C[1],C[2]),I.position.normalize()):x.type=="point"?(C=x.position,d=x.distance,I=new THREE.PointLight(M,B,d),I.position.set(C[0],C[1],C[2])):x.type=="ambient"&&(I=new THREE.AmbientLight(M)),U.scene.add(I),U.lights[y]=I;for(w in P.fogs)y=P.fogs[w],y.type=="linear"?E=new THREE.Fog(0,y.near,y.far):y.type=="exp2"&&(E=new THREE.FogExp2(0,y.density)),B=y.color,E.color.setRGB(B[0], B[1],B[2]),U.fogs[w]=E;if(U.cameras&&P.defaults.camera)U.currentCamera=U.cameras[P.defaults.camera];if(U.fogs&&P.defaults.fog)U.scene.fog=U.fogs[P.defaults.fog];B=P.defaults.bgcolor;U.bgColor=new THREE.Color;U.bgColor.setRGB(B[0],B[1],B[2]);U.bgColorAlpha=P.defaults.bgalpha;for(t in P.geometries)if(w=P.geometries[t],w.type=="bin_mesh"||w.type=="ascii_mesh")T+=1,c.onLoadStart();m=T;for(t in P.geometries)w=P.geometries[t],w.type=="cube"?(F=new THREE.CubeGeometry(w.width,w.height,w.depth,w.segmentsWidth, w.segmentsHeight,w.segmentsDepth,null,w.flipped,w.sides),U.geometries[t]=F):w.type=="plane"?(F=new THREE.PlaneGeometry(w.width,w.height,w.segmentsWidth,w.segmentsHeight),U.geometries[t]=F):w.type=="sphere"?(F=new THREE.SphereGeometry(w.radius,w.segmentsWidth,w.segmentsHeight),U.geometries[t]=F):w.type=="cylinder"?(F=new THREE.CylinderGeometry(w.topRad,w.botRad,w.height,w.radSegs,w.heightSegs),U.geometries[t]=F):w.type=="torus"?(F=new THREE.TorusGeometry(w.radius,w.tube,w.segmentsR,w.segmentsT),U.geometries[t]= F):w.type=="icosahedron"?(F=new THREE.IcosahedronGeometry(w.subdivisions),U.geometries[t]=F):w.type=="bin_mesh"?O.load(e(w.url,P.urlBaseType),n(t)):w.type=="ascii_mesh"?L.load(e(w.url,P.urlBaseType),n(t)):w.type=="embedded_mesh"&&(w=P.embeds[w.id])&&L.createModel(w,p(t),"");for(A in P.textures)if(t=P.textures[A],t.url instanceof Array){S+=t.url.length;for(O=0;O=57344&&(b-=2048);b++;for(var c=new Float32Array(8*b),e=1,f=0;f<8;f++){for(var h=0,k=0;k>1^-(l&1);c[8*k+f]=h}e+=b}b=a.length-e;h=new Uint16Array(b);for(f=k=0;f=this.maxCount-3&&l(this)};this.begin= function(){this.count=0;this.hasNormal=this.hasPos=!1};this.end=function(a){if(this.count!==0){for(var b=this.count*3;bthis.size-1&&(n=this.size-1);var v=Math.floor(p-l);v<1&&(v=1);p=Math.floor(p+l);p>this.size-1&&(p=this.size-1);var o=Math.floor(u-l);o<1&&(o=1);l=Math.floor(u+l); l>this.size-1&&(l=this.size-1);for(var y,x,w,A,z,C;t0&&(this.field[w+y]+=A)}}};this.addPlaneX=function(a,b){var f,h,k,l,n,p=this.size,u=this.yd,t=this.zd,v=this.field,o=p*Math.sqrt(a/b);o>p&&(o=p);for(f=0;f0)for(h=0;h0&&a>0&&h+a<1}for(var e,f=[],h=0,i=a.children.length;ha.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h= -b(this.origin,this.direction,a.matrixWorld.getPosition());if(h===null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var j,o,k,m,p,l,t,A,C=a.geometry,E=C.vertices,h=0,i=C.faces.length;h0:l<0)))if(l=p.dot((new THREE.Vector3).sub(j,t))/l,t=t.addSelf(A.multiplyScalar(l)),e instanceof THREE.Face3)c(t,j,o,k)&&(e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(t,j,o,m)||c(t,o,k,m)))e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e)}return f}}; -THREE.Rectangle=function(){function a(){h=e-b;i=f-c}var b,c,e,f,h,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(h,i,m,p){j=!1;b=h;c=i;e=m;f=p;a()};this.addPoint=function(h,i){j?(j=!1,b=h,c=i,e=h,f=i):(b=bh?e:h,f=f>i?f:i);a()};this.add3Points= -function(h,i,m,p,l,t){j?(j=!1,b=hm?h>l?h:l:m>l?m:l,f=i>p?i>t?i:t:p>t?p:t):(b=hm?h>l?h>e?h:e:l>e?l:e:m>l?m>e?m:e:l>e?l:e,f=i>p?i>t?i>f?i:f:t>f?t:f:p>t?p>f?p:f:t>f?t:f);a()};this.addRectangle=function(h){j?(j=!1,b=h.getLeft(),c=h.getTop(),e=h.getRight(),f=h.getBottom()):(b=bh.getRight()?e:h.getRight(),f=f> +b(this.origin,this.direction,a.matrixWorld.getPosition());if(h===null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var j,m,k,o,p,l,t,A,C=a.geometry,E=C.vertices,h=0,i=C.faces.length;h0:l<0)))if(l=p.dot((new THREE.Vector3).sub(j,t))/l,t=t.addSelf(A.multiplyScalar(l)),e instanceof THREE.Face3)c(t,j,m,k)&&(e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(t,j,m,o)||c(t,m,k,o)))e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e)}return f}}; +THREE.Rectangle=function(){function a(){h=e-b;i=f-c}var b,c,e,f,h,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(h,i,o,p){j=!1;b=h;c=i;e=o;f=p;a()};this.addPoint=function(h,i){j?(j=!1,b=h,c=i,e=h,f=i):(b=bh?e:h,f=f>i?f:i);a()};this.add3Points= +function(h,i,o,p,l,t){j?(j=!1,b=ho?h>l?h:l:o>l?o:l,f=i>p?i>t?i:t:p>t?p:t):(b=ho?h>l?h>e?h:e:l>e?l:e:o>l?o>e?o:e:l>e?l:e,f=i>p?i>t?i>f?i:f:t>f?t:f:p>t?p>f?p:f:t>f?t:f);a()};this.addRectangle=function(h){j?(j=!1,b=h.getLeft(),c=h.getTop(),e=h.getRight(),f=h.getBottom()):(b=bh.getRight()?e:h.getRight(),f=f> h.getBottom()?f:h.getBottom());a()};this.inflate=function(h){b-=h;c-=h;e+=h;f+=h;a()};this.minSelf=function(h){b=b>h.getLeft()?b:h.getLeft();c=c>h.getTop()?c:h.getTop();e=e=0&&Math.min(f,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){j=!0;f=e=c=b=0;a()};this.isEmpty=function(){return j}};THREE.Matrix3=function(){this.m=[]}; THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}}; -THREE.Matrix4=function(a,b,c,e,f,h,i,j,o,k,m,p,l,t,A,C){this.set(a!==void 0?a:1,b||0,c||0,e||0,f||0,h!==void 0?h:1,i||0,j||0,o||0,k||0,m!==void 0?m:1,p||0,l||0,t||0,A||0,C!==void 0?C:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; -THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,f,h,i,j,o,k,m,p,l,t,A,C){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=h;this.n23=i;this.n24=j;this.n31=o;this.n32=k;this.n33=m;this.n34=p;this.n41=l;this.n42=t;this.n43=A;this.n44=C;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, +THREE.Matrix4=function(a,b,c,e,f,h,i,j,m,k,o,p,l,t,A,C){this.set(a!==void 0?a:1,b||0,c||0,e||0,f||0,h!==void 0?h:1,i||0,j||0,m||0,k||0,o!==void 0?o:1,p||0,l||0,t||0,A||0,C!==void 0?C:1);this.flat=Array(16);this.m33=new THREE.Matrix3}; +THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,f,h,i,j,m,k,o,p,l,t,A,C){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=h;this.n23=i;this.n24=j;this.n31=m;this.n32=k;this.n33=o;this.n34=p;this.n41=l;this.n42=t;this.n43=A;this.n44=C;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a, b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;h.sub(a,b).normalize();if(h.length()===0)h.z=1;e.cross(c,h).normalize();e.length()===0&&(h.x+=1.0E-4,e.cross(c,h).normalize());f.cross(h,e).normalize();this.n11=e.x;this.n12=f.x;this.n13=h.x;this.n21=e.y;this.n22=f.y;this.n23=h.y;this.n31=e.z;this.n32=f.z;this.n33=h.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,e=a.z,f=1/(this.n41*b+this.n42*c+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*e+this.n14)*f; a.y=(this.n21*b+this.n22*c+this.n23*e+this.n24)*f;a.z=(this.n31*b+this.n32*c+this.n33*e+this.n34)*f;return a},multiplyVector4:function(a){var b=a.x,c=a.y,e=a.z,f=a.w;a.x=this.n11*b+this.n12*c+this.n13*e+this.n14*f;a.y=this.n21*b+this.n22*c+this.n23*e+this.n24*f;a.z=this.n31*b+this.n32*c+this.n33*e+this.n34*f;a.w=this.n41*b+this.n42*c+this.n43*e+this.n44*f;return a},rotateAxis:function(a){var b=a.x,c=a.y,e=a.z;a.x=b*this.n11+c*this.n12+e*this.n13;a.y=b*this.n21+c*this.n22+e*this.n23;a.z=b*this.n31+ -c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,o=a.n23,k=a.n24,m=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44,va=b.n11,wa= -b.n12,pa=b.n13,qa=b.n14,N=b.n21,F=b.n22,z=b.n23,W=b.n24,U=b.n31,ja=b.n32,$=b.n33,xa=b.n34,Q=b.n41,G=b.n42,d=b.n43,ta=b.n44;this.n11=c*va+e*N+f*U+h*Q;this.n12=c*wa+e*F+f*ja+h*G;this.n13=c*pa+e*z+f*$+h*d;this.n14=c*qa+e*W+f*xa+h*ta;this.n21=i*va+j*N+o*U+k*Q;this.n22=i*wa+j*F+o*ja+k*G;this.n23=i*pa+j*z+o*$+k*d;this.n24=i*qa+j*W+o*xa+k*ta;this.n31=m*va+p*N+l*U+t*Q;this.n32=m*wa+p*F+l*ja+t*G;this.n33=m*pa+p*z+l*$+t*d;this.n34=m*qa+p*W+l*xa+t*ta;this.n41=A*va+C*N+E*U+B*Q;this.n42=A*wa+C*F+E*ja+B*G;this.n43= +c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,m=a.n23,k=a.n24,o=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44,va=b.n11,wa= +b.n12,pa=b.n13,qa=b.n14,N=b.n21,F=b.n22,z=b.n23,W=b.n24,U=b.n31,ja=b.n32,$=b.n33,xa=b.n34,Q=b.n41,G=b.n42,d=b.n43,ta=b.n44;this.n11=c*va+e*N+f*U+h*Q;this.n12=c*wa+e*F+f*ja+h*G;this.n13=c*pa+e*z+f*$+h*d;this.n14=c*qa+e*W+f*xa+h*ta;this.n21=i*va+j*N+m*U+k*Q;this.n22=i*wa+j*F+m*ja+k*G;this.n23=i*pa+j*z+m*$+k*d;this.n24=i*qa+j*W+m*xa+k*ta;this.n31=o*va+p*N+l*U+t*Q;this.n32=o*wa+p*F+l*ja+t*G;this.n33=o*pa+p*z+l*$+t*d;this.n34=o*qa+p*W+l*xa+t*ta;this.n41=A*va+C*N+E*U+B*Q;this.n42=A*wa+C*F+E*ja+B*G;this.n43= A*pa+C*z+E*$+B*d;this.n44=A*qa+C*W+E*xa+B*ta;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*= -a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,f=this.n21,h=this.n22,i=this.n23,j=this.n24,o=this.n31,k=this.n32,m=this.n33,p=this.n34,l=this.n41,t=this.n42,A=this.n43,C=this.n44;return e*i*k*l-c*j*k*l-e*h*m*l+b*j*m*l+c*h*p*l-b*i*p*l-e*i*o*t+c*j*o*t+e*f*m*t-a*j*m*t-c*f*p*t+a*i*p*t+e*h*o*A-b*j*o*A-e*f*k*A+a*j*k*A+b*f*p*A-a*h*p*A-c*h*o*C+b*i* -o*C+c*f*k*C-a*i*k*C-b*f*m*C+a*h*m*C},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32; +a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,f=this.n21,h=this.n22,i=this.n23,j=this.n24,m=this.n31,k=this.n32,o=this.n33,p=this.n34,l=this.n41,t=this.n42,A=this.n43,C=this.n44;return e*i*k*l-c*j*k*l-e*h*o*l+b*j*o*l+c*h*p*l-b*i*p*l-e*i*m*t+c*j*m*t+e*f*o*t-a*j*o*t-c*f*p*t+a*i*p*t+e*h*m*A-b*j*m*A-e*f*k*A+a*j*k*A+b*f*p*A-a*h*p*A-c*h*m*C+b*i* +m*C+c*f*k*C-a*i*k*C-b*f*o*C+a*h*o*C},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32; a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]= this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]= this.n34;a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0, -0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),e=Math.sin(b),f=1-c,h=a.x,i=a.y,j=a.z,o=f*h,k=f*i;this.set(o*h+c,o*i-e*j,o*j+e*i,0,o*i+e*j,k*i+c,k*j-e*h,0,o*j-e*i,k*j+e*h,f*j*j+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= -new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,e=a.y,f=a.z,h=Math.cos(c),c=Math.sin(c),i=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var o= -i*j,k=i*f,m=e*j,p=e*f;this.n11=o+p*c;this.n12=m*c-k;this.n13=h*e;this.n21=h*f;this.n22=h*j;this.n23=-c;this.n31=k*c-m;this.n32=p+o*c;this.n33=h*i;break;case "ZXY":o=i*j;k=i*f;m=e*j;p=e*f;this.n11=o-p*c;this.n12=-h*f;this.n13=m+k*c;this.n21=k+m*c;this.n22=h*j;this.n23=p-o*c;this.n31=-h*e;this.n32=c;this.n33=h*i;break;case "ZYX":o=h*j;k=h*f;m=c*j;p=c*f;this.n11=i*j;this.n12=m*e-k;this.n13=o*e+p;this.n21=i*f;this.n22=p*e+o;this.n23=k*e-m;this.n31=-e;this.n32=c*i;this.n33=h*i;break;case "YZX":o=h*i;k= -h*e;m=c*i;p=c*e;this.n11=i*j;this.n12=p-o*f;this.n13=m*f+k;this.n21=f;this.n22=h*j;this.n23=-c*j;this.n31=-e*j;this.n32=k*f+m;this.n33=o-p*f;break;case "XZY":o=h*i;k=h*e;m=c*i;p=c*e;this.n11=i*j;this.n12=-f;this.n13=e*j;this.n21=o*f+p;this.n22=h*j;this.n23=k*f-m;this.n31=m*f-k;this.n32=c*j;this.n33=p*f+o;break;default:o=h*j,k=h*f,m=c*j,p=c*f,this.n11=i*j,this.n12=-i*f,this.n13=e,this.n21=k+m*e,this.n22=o-p*e,this.n23=-c*i,this.n31=p-o*e,this.n32=m+k*e,this.n33=h*i}return this},setRotationFromQuaternion:function(a){var b= -a.x,c=a.y,e=a.z,f=a.w,h=b+b,i=c+c,j=e+e,a=b*h,o=b*i;b*=j;var k=c*i;c*=j;e*=j;h*=f;i*=f;f*=j;this.n11=1-(k+e);this.n12=o-f;this.n13=b+i;this.n21=o+f;this.n22=1-(a+e);this.n23=c-h;this.n31=b-i;this.n32=c+h;this.n33=1-(a+k);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=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 e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2; +0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),e=Math.sin(b),f=1-c,h=a.x,i=a.y,j=a.z,m=f*h,k=f*i;this.set(m*h+c,m*i-e*j,m*j+e*i,0,m*i+e*j,k*i+c,k*j-e*h,0,m*j-e*i,k*j+e*h,f*j*j+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX= +new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,e=a.y,f=a.z,h=Math.cos(c),c=Math.sin(c),i=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var m= +i*j,k=i*f,o=e*j,p=e*f;this.n11=m+p*c;this.n12=o*c-k;this.n13=h*e;this.n21=h*f;this.n22=h*j;this.n23=-c;this.n31=k*c-o;this.n32=p+m*c;this.n33=h*i;break;case "ZXY":m=i*j;k=i*f;o=e*j;p=e*f;this.n11=m-p*c;this.n12=-h*f;this.n13=o+k*c;this.n21=k+o*c;this.n22=h*j;this.n23=p-m*c;this.n31=-h*e;this.n32=c;this.n33=h*i;break;case "ZYX":m=h*j;k=h*f;o=c*j;p=c*f;this.n11=i*j;this.n12=o*e-k;this.n13=m*e+p;this.n21=i*f;this.n22=p*e+m;this.n23=k*e-o;this.n31=-e;this.n32=c*i;this.n33=h*i;break;case "YZX":m=h*i;k= +h*e;o=c*i;p=c*e;this.n11=i*j;this.n12=p-m*f;this.n13=o*f+k;this.n21=f;this.n22=h*j;this.n23=-c*j;this.n31=-e*j;this.n32=k*f+o;this.n33=m-p*f;break;case "XZY":m=h*i;k=h*e;o=c*i;p=c*e;this.n11=i*j;this.n12=-f;this.n13=e*j;this.n21=m*f+p;this.n22=h*j;this.n23=k*f-o;this.n31=o*f-k;this.n32=c*j;this.n33=p*f+m;break;default:m=h*j,k=h*f,o=c*j,p=c*f,this.n11=i*j,this.n12=-i*f,this.n13=e,this.n21=k+o*e,this.n22=m-p*e,this.n23=-c*i,this.n31=p-m*e,this.n32=o+k*e,this.n33=h*i}return this},setRotationFromQuaternion:function(a){var b= +a.x,c=a.y,e=a.z,f=a.w,h=b+b,i=c+c,j=e+e,a=b*h,m=b*i;b*=j;var k=c*i;c*=j;e*=j;h*=f;i*=f;f*=j;this.n11=1-(k+e);this.n12=m-f;this.n13=b+i;this.n21=m+f;this.n22=1-(a+e);this.n23=c-h;this.n31=b-i;this.n32=c+h;this.n33=1-(a+k);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=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 e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2; e.identity();e.setRotationFromQuaternion(b);f.setScale(c.x,c.y,c.z);this.multiply(e,f);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;e.set(this.n11,this.n21,this.n31);f.set(this.n12,this.n22,this.n32);h.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=e.length(); c.y=f.length();c.z=h.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;e=THREE.Matrix4.__m1;e.copy(this);e.n11/=c.x;e.n21/=c.x;e.n31/=c.x;e.n12/=c.y;e.n22/=c.y;e.n32/=c.y;e.n13/=c.z;e.n23/=c.z;e.n33/=c.z;b.setFromRotationMatrix(e);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,e=1/b.y,f=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*e;this.n22=a.n22*e;this.n32=a.n32*e;this.n13=a.n13*f;this.n23= a.n23*f;this.n33=a.n33*f}}; -THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,o=a.n23,k=a.n24,m=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=o*t*C-k*l*C+k*p*E-j*t*E-o*p*B+j*l*B;b.n12=h*l*C-f*t*C-h*p*E+e*t*E+f*p*B-e*l*B;b.n13=f*k*C-h*o*C+h*j*E-e*k*E-f*j*B+e*o*B;b.n14=h*o*p-f*k*p-h*j*l+e*k*l+f*j*t-e*o*t;b.n21=k*l*A-o*t*A-k*m*E+i*t*E+o*m*B-i*l*B;b.n22=f*t*A-h*l*A+h*m*E-c*t*E-f*m*B+c*l*B;b.n23=h*o*A-f*k*A-h*i*E+c*k*E+f*i*B-c*o*B;b.n24= -f*k*m-h*o*m+h*i*l-c*k*l-f*i*t+c*o*t;b.n31=j*t*A-k*p*A+k*m*C-i*t*C-j*m*B+i*p*B;b.n32=h*p*A-e*t*A-h*m*C+c*t*C+e*m*B-c*p*B;b.n33=f*k*A-h*j*A+h*i*C-c*k*C-e*i*B+c*j*B;b.n34=h*j*m-e*k*m-h*i*p+c*k*p+e*i*t-c*j*t;b.n41=o*p*A-j*l*A-o*m*C+i*l*C+j*m*E-i*p*E;b.n42=e*l*A-f*p*A+f*m*C-c*l*C-e*m*E+c*p*E;b.n43=f*j*A-e*o*A-f*i*C+c*o*C+e*i*E-c*j*E;b.n44=e*o*m-f*j*m+f*i*p-c*o*p-e*i*l+c*j*l;b.multiplyScalar(1/a.determinant());return b}; -THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,o=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,m=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*k;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*o;c[6]=a*k;c[7]=a*m;c[8]=a*p;return b}; +THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,m=a.n23,k=a.n24,o=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=m*t*C-k*l*C+k*p*E-j*t*E-m*p*B+j*l*B;b.n12=h*l*C-f*t*C-h*p*E+e*t*E+f*p*B-e*l*B;b.n13=f*k*C-h*m*C+h*j*E-e*k*E-f*j*B+e*m*B;b.n14=h*m*p-f*k*p-h*j*l+e*k*l+f*j*t-e*m*t;b.n21=k*l*A-m*t*A-k*o*E+i*t*E+m*o*B-i*l*B;b.n22=f*t*A-h*l*A+h*o*E-c*t*E-f*o*B+c*l*B;b.n23=h*m*A-f*k*A-h*i*E+c*k*E+f*i*B-c*m*B;b.n24= +f*k*o-h*m*o+h*i*l-c*k*l-f*i*t+c*m*t;b.n31=j*t*A-k*p*A+k*o*C-i*t*C-j*o*B+i*p*B;b.n32=h*p*A-e*t*A-h*o*C+c*t*C+e*o*B-c*p*B;b.n33=f*k*A-h*j*A+h*i*C-c*k*C-e*i*B+c*j*B;b.n34=h*j*o-e*k*o-h*i*p+c*k*p+e*i*t-c*j*t;b.n41=m*p*A-j*l*A-m*o*C+i*l*C+j*o*E-i*p*E;b.n42=e*l*A-f*p*A+f*o*C-c*l*C-e*o*E+c*p*E;b.n43=f*j*A-e*m*A-f*i*C+c*m*C+e*i*E-c*j*E;b.n44=e*m*o-f*j*o+f*i*p-c*m*p-e*i*l+c*j*l;b.multiplyScalar(1/a.determinant());return b}; +THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,m=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,o=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*k;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*m;c[6]=a*k;c[7]=a*o;c[8]=a*p;return b}; THREE.Matrix4.makeFrustum=function(a,b,c,e,f,h){var i;i=new THREE.Matrix4;i.n11=2*f/(b-a);i.n12=0;i.n13=(b+a)/(b-a);i.n14=0;i.n21=0;i.n22=2*f/(e-c);i.n23=(e+c)/(e-c);i.n24=0;i.n31=0;i.n32=0;i.n33=-(h+f)/(h-f);i.n34=-2*h*f/(h-f);i.n41=0;i.n42=0;i.n43=-1;i.n44=0;return i};THREE.Matrix4.makePerspective=function(a,b,c,e){var f,a=c*Math.tan(a*Math.PI/360);f=-a;return THREE.Matrix4.makeFrustum(f*b,a*b,f,a,c,e)}; -THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var i,j,o,k;i=new THREE.Matrix4;j=b-a;o=c-e;k=h-f;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/o;i.n23=0;i.n24=-((c+e)/o);i.n31=0;i.n32=0;i.n33=-2/k;i.n34=-((h+f)/k);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; +THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var i,j,m,k;i=new THREE.Matrix4;j=b-a;m=c-e;k=h-f;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/m;i.n23=0;i.n24=-((c+e)/m);i.n31=0;i.n32=0;i.n33=-2/k;i.n34=-((h+f)/k);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4; THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3}; THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)=== @@ -54,40 +54,40 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){thi 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},update:function(a,b,c){this.matrixAutoUpdate&& this.updateMatrix();if(this.matrixWorldNeedsUpdate||b)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,b=!0;for(var a=0,e=this.children.length;a=0&&h>=0&&f>=0&&i>=0?!0:e<0&&h<0||f<0&&i<0?!1:(e<0?c=Math.max(c,e/(e-h)):h<0&&(d=Math.min(d,e/(e-h))),f<0?c=Math.max(c,f/(f-i)):i<0&&(d=Math.min(d,f/(f-i))),d=0&&h>=0&&f>=0&&i>=0?!0:e<0&&h<0||f<0&&i<0?!1:(e<0?c=Math.max(c,e/(e-h)):h<0&&(d=Math.min(d,e/(e-h))),f<0?c=Math.max(c,f/(f-i)):i<0&&(d=Math.min(d,f/(f-i))),dd&&i.positionScreen.zd&&i.positionScreen.z0&&F.z<1))za=wa[va]=wa[va]||new THREE.RenderableParticle,va++,B=za,B.x=F.x/F.w,B.y=F.y/F.w,B.z=F.z,B.rotation=O.rotation.z,B.scale.x=O.scale.x*Math.abs(B.x-(F.x+h.projectionMatrix.n11)/(F.w+h.projectionMatrix.n14)),B.scale.y=O.scale.y*Math.abs(B.y-(F.y+h.projectionMatrix.n22)/(F.w+h.projectionMatrix.n24)),B.materials=O.materials,qa.push(B);f&&qa.sort(b);return qa}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)}; THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),h=Math.cos(c),c=Math.sin(c),i=a*b,j=e*f;this.w=i*h-j*c;this.x=i*c+j*h;this.y=e*b*h+a*f*c;this.z=a*f*h-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c); this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;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,e=this.z,f=this.w,h=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+f*h+c*j-e*i;this.y=c*a+f*i+e*h-b*j;this.z=e*a+f*j+b*i-c*h;this.w=f*a-b*h-c*i-e*j;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,h=this.x,i=this.y,j=this.z,o=this.w,k=o*c+i*f-j*e,m=o*e+j*c-h*f,p=o*f+h*e-i*c,c=-h* -c-i*e-j*f;b.x=k*o+c*-h+m*-j-p*-i;b.y=m*o+c*-i+p*-h-k*-j;b.z=p*o+c*-j+k*-i-m*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),i=Math.sqrt(1-f*f);if(Math.abs(i)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/i;e=Math.sin(e*h)/i;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; +this.x,c=this.y,e=this.z,f=this.w,h=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+f*h+c*j-e*i;this.y=c*a+f*i+e*h-b*j;this.z=e*a+f*j+b*i-c*h;this.w=f*a-b*h-c*i-e*j;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,h=this.x,i=this.y,j=this.z,m=this.w,k=m*c+i*f-j*e,o=m*e+j*c-h*f,p=m*f+h*e-i*c,c=-h* +c-i*e-j*f;b.x=k*m+c*-h+o*-j-p*-i;b.y=o*m+c*-i+p*-h-k*-j;b.z=p*m+c*-j+k*-i-o*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),i=Math.sqrt(1-f*f);if(Math.abs(i)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/i;e=Math.sin(e*h)/i;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c}; THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,e,f,h){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3}; THREE.Face4=function(a,b,c,e,f,h,i){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materialIndex=i;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}}; THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1}; THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x], y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z< this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;bthis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;k=this.points[c[0]];m=this.points[c[1]]; -p=this.points[c[2]];l=this.points[c[3]];j=i*i;o=i*j;e.x=b(k.x,m.x,p.x,l.x,i,j,o);e.y=b(k.y,m.y,p.y,l.y,i,j,o);e.z=b(k.z,m.z,p.z,l.z,i,j,o);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;athis.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;k=this.points[c[0]];o=this.points[c[1]]; +p=this.points[c[2]];l=this.points[c[3]];j=i*i;m=i*j;e.x=b(k.x,o.x,p.x,l.x,i,j,m);e.y=b(k.y,o.y,p.y,l.y,i,j,m);e.z=b(k.z,o.z,p.z,l.z,i,j,m);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;a=0)return a.geometry.materials[d.materialIndex]}function c(a,b,c){var e,h,f,i=a.vertices,u=i.length,v=a.colors,r=v.length,j=a.__vertexArray,k=a.__colorArray,o=a.__sortArray,P=a.__dirtyVertices,m=a.__dirtyColors,p=a.__webglCustomAttributesList,l;if(p){f=0;for(e=p.length;f=0)return a.geometry.materials[d.materialIndex]}function c(a,b,c){var e,h,f,i=a.vertices,u=i.length,v=a.colors,q=v.length,j=a.__vertexArray,k=a.__colorArray,m=a.__sortArray,P=a.__dirtyVertices,o=a.__dirtyColors,p=a.__webglCustomAttributesList,l;if(p){f=0;for(e=p.length;f=0)b&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),d.vertexAttribPointer(a.position,3,d.FLOAT,!1,0,0));else if(i.morphTargetBase){c=h.program.attributes;i.morphTargetBase!==-1?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[i.morphTargetBase]),d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0)):c.position>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer), -d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var v=i.morphTargetForcedOrder;for(u=i.morphTargetInfluences;jk&&(o=p,k=u[o]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[o]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=k;v[o]=1;k=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(u=f.__webglCustomAttributesList.length;j= +d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var v=i.morphTargetForcedOrder;for(u=i.morphTargetInfluences;jq&&(k=m,q=u[k]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[k]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=q;v[k]=1;q=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(u=f.__webglCustomAttributesList.length;j= 0&&(d.bindBuffer(d.ARRAY_BUFFER,c.buffer),d.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,d.FLOAT,!1,0,0))}a.color>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglColorBuffer),d.vertexAttribPointer(a.color,3,d.FLOAT,!1,0,0));a.normal>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglNormalBuffer),d.vertexAttribPointer(a.normal,3,d.FLOAT,!1,0,0));a.tangent>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglTangentBuffer),d.vertexAttribPointer(a.tangent,4,d.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(d.bindBuffer(d.ARRAY_BUFFER, f.__webglUVBuffer),d.vertexAttribPointer(a.uv,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv)):d.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglUV2Buffer),d.vertexAttribPointer(a.uv2,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv2)):d.disableVertexAttribArray(a.uv2));h.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexABuffer),d.vertexAttribPointer(a.skinVertexA,4, d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),d.vertexAttribPointer(a.skinVertexB,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),d.vertexAttribPointer(a.skinIndex,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),d.vertexAttribPointer(a.skinWeight,4,d.FLOAT,!1,0,0))}i instanceof THREE.Mesh?(h.wireframe?(d.lineWidth(h.wireframeLinewidth),b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),d.drawElements(d.LINES,f.__webglLineCount, d.UNSIGNED_SHORT,0)):(b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),d.drawElements(d.TRIANGLES,f.__webglFaceCount,d.UNSIGNED_SHORT,0)),G.info.render.calls++,G.info.render.vertices+=f.__webglFaceCount,G.info.render.faces+=f.__webglFaceCount/3):i instanceof THREE.Line?(i=i.type===THREE.LineStrip?d.LINE_STRIP:d.LINES,d.lineWidth(h.linewidth),d.drawArrays(i,0,f.__webglLineCount),G.info.render.calls++):i instanceof THREE.ParticleSystem?(d.drawArrays(d.POINTS,0,f.__webglParticleCount),G.info.render.calls++): i instanceof THREE.Ribbon&&(d.drawArrays(d.TRIANGLE_STRIP,0,f.__webglVertexCount),G.info.render.calls++)}}function h(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=d.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=d.createBuffer();a.hasPos&&(d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,a.positionArray,d.DYNAMIC_DRAW),d.enableVertexAttribArray(b.attributes.position),d.vertexAttribPointer(b.attributes.position,3,d.FLOAT,!1,0,0));if(a.hasNormal){d.bindBuffer(d.ARRAY_BUFFER, -a.__webglNormalBuffer);if(c===THREE.FlatShading){var e,f,h,i,j,v,k,o,p,m,l=a.count*3;for(m=0;m=0)b=b.geometry.materials[d],b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}else if(b=c)b.transparent?(a.transparent= -b,a.opaque=null):(a.opaque=b,a.transparent=null)}function A(a,b){return b.z-a.z}function C(a){var b,c,k,o=0,K,l,u,v,r=a.lights;ra||(ra=new THREE.PerspectiveCamera(G.shadowCameraFov,G.shadowMapWidth/G.shadowMapHeight,G.shadowCameraNear,G.shadowCameraFar));b=0;for(c=r.length;b=0;d--)a[d].object===b&&a.splice(d,1)}function qa(a,b,d){a.push({buffer:b,object:d,opaque:null,transparent:null})}function N(a){if(a!==ka){switch(a){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE);break;case THREE.SubtractiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:d.blendEquation(d.FUNC_ADD); -d.blendFunc(d.ZERO,d.SRC_COLOR);break;default:d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}ka=a}}function F(a,b,c){(c.width&c.width-1)===0&&(c.height&c.height-1)===0?(d.texParameteri(a,d.TEXTURE_WRAP_S,Q(b.wrapS)),d.texParameteri(a,d.TEXTURE_WRAP_T,Q(b.wrapT)),d.texParameteri(a,d.TEXTURE_MAG_FILTER,Q(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,Q(b.minFilter)),d.generateMipmap(a)):(d.texParameteri(a,d.TEXTURE_WRAP_S, -d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_MAG_FILTER,xa(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,xa(b.minFilter)))}function z(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=d.createTexture(),G.info.memory.textures++;d.activeTexture(d.TEXTURE0+b);d.bindTexture(d.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.image.width,a.image.height,0,Q(a.format),d.UNSIGNED_BYTE, -a.image.data):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,a.image);F(d.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+b),d.bindTexture(d.TEXTURE_2D,a.__webglTexture)}function W(a,b){d.bindRenderbuffer(d.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER, -d.DEPTH_STENCIL,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,a)):d.renderbufferStorage(d.RENDERBUFFER,d.RGBA4,b.width,b.height)}function U(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=d.createTexture();if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture); -F(d.TEXTURE_CUBE_MAP,a,a);for(var c=0;c<6;c++){a.__webglFramebuffer[c]=d.createFramebuffer();a.__webglRenderbuffer[c]=d.createRenderbuffer();d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null);var e=a,f=d.TEXTURE_CUBE_MAP_POSITIVE_X+c;d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer[c]);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,f,e.__webglTexture,0);W(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=d.createFramebuffer(), -a.__webglRenderbuffer=d.createRenderbuffer(),d.bindTexture(d.TEXTURE_2D,a.__webglTexture),F(d.TEXTURE_2D,a,a),d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null),c=d.TEXTURE_2D,d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,c,a.__webglTexture,0),d.bindRenderbuffer(d.RENDERBUFFER,a.__webglRenderbuffer),W(a.__webglRenderbuffer,a);b?d.bindTexture(d.TEXTURE_CUBE_MAP,null):d.bindTexture(d.TEXTURE_2D,null); -d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=e=0):(b=null,c=Ca,a=ya,e=Ha,f=Aa);b!==ua&&(d.bindFramebuffer(d.FRAMEBUFFER,b),d.viewport(e,f,c,a),ua=b)}function ja(a){a instanceof THREE.WebGLRenderTargetCube?(d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture),d.generateMipmap(d.TEXTURE_CUBE_MAP),d.bindTexture(d.TEXTURE_CUBE_MAP,null)):(d.bindTexture(d.TEXTURE_2D,a.__webglTexture), -d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null))}function $(a,b){var c;a==="fragment"?c=d.createShader(d.FRAGMENT_SHADER):a==="vertex"&&(c=d.createShader(d.VERTEX_SHADER));d.shaderSource(c,b);d.compileShader(c);if(!d.getShaderParameter(c,d.COMPILE_STATUS))return console.error(d.getShaderInfoLog(c)),console.error(b),null;return c}function xa(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST;default:return d.LINEAR}} -function Q(a){switch(a){case THREE.RepeatWrapping:return d.REPEAT;case THREE.ClampToEdgeWrapping:return d.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return d.MIRRORED_REPEAT;case THREE.NearestFilter:return d.NEAREST;case THREE.NearestMipMapNearestFilter:return d.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return d.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return d.LINEAR;case THREE.LinearMipMapNearestFilter:return d.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return d.LINEAR_MIPMAP_LINEAR; -case THREE.ByteType:return d.BYTE;case THREE.UnsignedByteType:return d.UNSIGNED_BYTE;case THREE.ShortType:return d.SHORT;case THREE.UnsignedShortType:return d.UNSIGNED_SHORT;case THREE.IntType:return d.INT;case THREE.UnsignedShortType:return d.UNSIGNED_INT;case THREE.FloatType:return d.FLOAT;case THREE.AlphaFormat:return d.ALPHA;case THREE.RGBFormat:return d.RGB;case THREE.RGBAFormat:return d.RGBA;case THREE.LuminanceFormat:return d.LUMINANCE;case THREE.LuminanceAlphaFormat:return d.LUMINANCE_ALPHA}return 0} -var G=this,d,ta=[],Wa=null,ua=null,J=-1,R=null,S=0,T=null,X=null,ka=null,aa=null,O=null,za=null,La=null,Ra=null,Ha=0,Aa=0,Ca=0,ya=0,ha=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Da=new THREE.Matrix4,Ta=new Float32Array(16),Ua=new Float32Array(16),Ja=new THREE.Vector4,Ya={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},Ba=a.canvas!==void 0?a.canvas:document.createElement("canvas"), -I=a.stencil!==void 0?a.stencil:!0,cb=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,db=a.antialias!==void 0?a.antialias:!1,Y=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),Fa=a.clearAlpha!==void 0?a.clearAlpha:0,Xa=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=Ba;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear= -!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var ra,Sa=[],a=THREE.ShaderLib.depthRGBA,ab=THREE.UniformsUtils.clone(a.uniforms),Va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ab}), -Za=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ab,morphTargets:!0});Va._shadowPass=!0;Za._shadowPass=!0;try{if(!(d=Ba.getContext("experimental-webgl",{antialias:db,stencil:I,preserveDrawingBuffer:cb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+d.getParameter(d.VERSION)+" | "+d.getParameter(d.VENDOR)+" | "+d.getParameter(d.RENDERER)+" | "+d.getParameter(d.SHADING_LANGUAGE_VERSION))}catch(eb){console.error(eb)}d.clearColor(0, -0,0,1);d.clearDepth(1);d.clearStencil(0);d.enable(d.DEPTH_TEST);d.depthFunc(d.LEQUAL);d.frontFace(d.CCW);d.cullFace(d.BACK);d.enable(d.CULL_FACE);d.enable(d.BLEND);d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);d.clearColor(Y.r,Y.g,Y.b,Fa);this.context=d;var bb=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,q={};q.vertices=new Float32Array(16);q.faces=new Uint16Array(6);I=0;q.vertices[I++]=-1;q.vertices[I++]=-1;q.vertices[I++]=0;q.vertices[I++]=1;q.vertices[I++]=1; -q.vertices[I++]=-1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=0;q.vertices[I++]=-1;q.vertices[I++]=1;q.vertices[I++]=0;I=q.vertices[I++]=0;q.faces[I++]=0;q.faces[I++]=1;q.faces[I++]=2;q.faces[I++]=0;q.faces[I++]=2;q.faces[I++]=3;q.vertexBuffer=d.createBuffer();q.elementBuffer=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,q.vertexBuffer);d.bufferData(d.ARRAY_BUFFER,q.vertices,d.STATIC_DRAW);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.elementBuffer); -d.bufferData(d.ELEMENT_ARRAY_BUFFER,q.faces,d.STATIC_DRAW);q.program=d.createProgram();d.attachShader(q.program,$("fragment",THREE.ShaderLib.sprite.fragmentShader));d.attachShader(q.program,$("vertex",THREE.ShaderLib.sprite.vertexShader));d.linkProgram(q.program);q.attributes={};q.uniforms={};q.attributes.position=d.getAttribLocation(q.program,"position");q.attributes.uv=d.getAttribLocation(q.program,"uv");q.uniforms.uvOffset=d.getUniformLocation(q.program,"uvOffset");q.uniforms.uvScale=d.getUniformLocation(q.program, -"uvScale");q.uniforms.rotation=d.getUniformLocation(q.program,"rotation");q.uniforms.scale=d.getUniformLocation(q.program,"scale");q.uniforms.alignment=d.getUniformLocation(q.program,"alignment");q.uniforms.color=d.getUniformLocation(q.program,"color");q.uniforms.map=d.getUniformLocation(q.program,"map");q.uniforms.opacity=d.getUniformLocation(q.program,"opacity");q.uniforms.useScreenCoordinates=d.getUniformLocation(q.program,"useScreenCoordinates");q.uniforms.affectedByDistance=d.getUniformLocation(q.program, -"affectedByDistance");q.uniforms.screenPosition=d.getUniformLocation(q.program,"screenPosition");q.uniforms.modelViewMatrix=d.getUniformLocation(q.program,"modelViewMatrix");q.uniforms.projectionMatrix=d.getUniformLocation(q.program,"projectionMatrix");var $a=!1;this.setSize=function(a,b){Ba.width=a;Ba.height=b;this.setViewport(0,0,Ba.width,Ba.height)};this.setViewport=function(a,b,c,e){Ha=a;Aa=b;Ca=c;ya=e;d.viewport(Ha,Aa,Ca,ya)};this.setScissor=function(a,b,c,e){d.scissor(a,b,c,e)};this.enableScissorTest= +b,a.opaque=null):(a.opaque=b,a.transparent=null)}function A(a,b){return b.z-a.z}function C(a){var b,c,k,m=0,K,l,u,v,q=a.lights;ra||(ra=new THREE.PerspectiveCamera(G.shadowCameraFov,G.shadowMapWidth/G.shadowMapHeight,G.shadowCameraNear,G.shadowCameraFar));b=0;for(c=q.length;b=0;d--)a[d].object===b&&a.splice(d,1)}function qa(a,b,d){a.push({buffer:b,object:d,opaque:null,transparent:null})}function N(a){if(a!==ka){switch(a){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE);break;case THREE.SubtractiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.SRC_COLOR);break;default:d.blendEquationSeparate(d.FUNC_ADD, +d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}ka=a}}function F(a,b,c){(c.width&c.width-1)===0&&(c.height&c.height-1)===0?(d.texParameteri(a,d.TEXTURE_WRAP_S,Q(b.wrapS)),d.texParameteri(a,d.TEXTURE_WRAP_T,Q(b.wrapT)),d.texParameteri(a,d.TEXTURE_MAG_FILTER,Q(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,Q(b.minFilter)),d.generateMipmap(a)):(d.texParameteri(a,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE), +d.texParameteri(a,d.TEXTURE_MAG_FILTER,xa(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,xa(b.minFilter)))}function z(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=d.createTexture(),G.info.memory.textures++;d.activeTexture(d.TEXTURE0+b);d.bindTexture(d.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.image.width,a.image.height,0,Q(a.format),d.UNSIGNED_BYTE,a.image.data):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA, +d.UNSIGNED_BYTE,a.image);F(d.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+b),d.bindTexture(d.TEXTURE_2D,a.__webglTexture)}function W(a,b){d.bindRenderbuffer(d.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER, +d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,a)):d.renderbufferStorage(d.RENDERBUFFER,d.RGBA4,b.width,b.height)}function U(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=d.createTexture();if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture);F(d.TEXTURE_CUBE_MAP,a,a);for(var c=0;c<6;c++){a.__webglFramebuffer[c]= +d.createFramebuffer();a.__webglRenderbuffer[c]=d.createRenderbuffer();d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null);var e=a,f=d.TEXTURE_CUBE_MAP_POSITIVE_X+c;d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer[c]);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,f,e.__webglTexture,0);W(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=d.createFramebuffer(),a.__webglRenderbuffer=d.createRenderbuffer(),d.bindTexture(d.TEXTURE_2D, +a.__webglTexture),F(d.TEXTURE_2D,a,a),d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null),c=d.TEXTURE_2D,d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,c,a.__webglTexture,0),d.bindRenderbuffer(d.RENDERBUFFER,a.__webglRenderbuffer),W(a.__webglRenderbuffer,a);b?d.bindTexture(d.TEXTURE_CUBE_MAP,null):d.bindTexture(d.TEXTURE_2D,null);d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER, +null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=e=0):(b=null,c=Ca,a=ya,e=Ha,f=Aa);b!==ua&&(d.bindFramebuffer(d.FRAMEBUFFER,b),d.viewport(e,f,c,a),ua=b)}function ja(a){a instanceof THREE.WebGLRenderTargetCube?(d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture),d.generateMipmap(d.TEXTURE_CUBE_MAP),d.bindTexture(d.TEXTURE_CUBE_MAP,null)):(d.bindTexture(d.TEXTURE_2D,a.__webglTexture),d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null))}function $(a, +b){var c;a==="fragment"?c=d.createShader(d.FRAGMENT_SHADER):a==="vertex"&&(c=d.createShader(d.VERTEX_SHADER));d.shaderSource(c,b);d.compileShader(c);if(!d.getShaderParameter(c,d.COMPILE_STATUS))return console.error(d.getShaderInfoLog(c)),console.error(b),null;return c}function xa(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST;default:return d.LINEAR}}function Q(a){switch(a){case THREE.RepeatWrapping:return d.REPEAT; +case THREE.ClampToEdgeWrapping:return d.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return d.MIRRORED_REPEAT;case THREE.NearestFilter:return d.NEAREST;case THREE.NearestMipMapNearestFilter:return d.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return d.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return d.LINEAR;case THREE.LinearMipMapNearestFilter:return d.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return d.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return d.BYTE; +case THREE.UnsignedByteType:return d.UNSIGNED_BYTE;case THREE.ShortType:return d.SHORT;case THREE.UnsignedShortType:return d.UNSIGNED_SHORT;case THREE.IntType:return d.INT;case THREE.UnsignedShortType:return d.UNSIGNED_INT;case THREE.FloatType:return d.FLOAT;case THREE.AlphaFormat:return d.ALPHA;case THREE.RGBFormat:return d.RGB;case THREE.RGBAFormat:return d.RGBA;case THREE.LuminanceFormat:return d.LUMINANCE;case THREE.LuminanceAlphaFormat:return d.LUMINANCE_ALPHA}return 0}var G=this,d,ta=[],Wa= +null,ua=null,J=-1,R=null,S=0,T=null,X=null,ka=null,aa=null,O=null,za=null,La=null,Ra=null,Ha=0,Aa=0,Ca=0,ya=0,ha=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Da=new THREE.Matrix4,Ta=new Float32Array(16),Ua=new Float32Array(16),Ja=new THREE.Vector4,Ya={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},Ba=a.canvas!==void 0?a.canvas:document.createElement("canvas"), +I=a.stencil!==void 0?a.stencil:!0,cb=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,db=a.antialias!==void 0?a.antialias:!1,Y=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),Fa=a.clearAlpha!==void 0?a.clearAlpha:0,Xa=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=Ba;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth= +this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var ra,Sa=[],a=THREE.ShaderLib.depthRGBA,ab=THREE.UniformsUtils.clone(a.uniforms),Va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader, +vertexShader:a.vertexShader,uniforms:ab}),Za=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ab,morphTargets:!0});Va._shadowPass=!0;Za._shadowPass=!0;try{if(!(d=Ba.getContext("experimental-webgl",{antialias:db,stencil:I,preserveDrawingBuffer:cb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+d.getParameter(d.VERSION)+" | "+d.getParameter(d.VENDOR)+" | "+d.getParameter(d.RENDERER)+" | "+d.getParameter(d.SHADING_LANGUAGE_VERSION))}catch(eb){console.error(eb)}d.clearColor(0, +0,0,1);d.clearDepth(1);d.clearStencil(0);d.enable(d.DEPTH_TEST);d.depthFunc(d.LEQUAL);d.frontFace(d.CCW);d.cullFace(d.BACK);d.enable(d.CULL_FACE);d.enable(d.BLEND);d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);d.clearColor(Y.r,Y.g,Y.b,Fa);this.context=d;var bb=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,r={};r.vertices=new Float32Array(16);r.faces=new Uint16Array(6);I=0;r.vertices[I++]=-1;r.vertices[I++]=-1;r.vertices[I++]=0;r.vertices[I++]=1;r.vertices[I++]=1; +r.vertices[I++]=-1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=0;r.vertices[I++]=-1;r.vertices[I++]=1;r.vertices[I++]=0;I=r.vertices[I++]=0;r.faces[I++]=0;r.faces[I++]=1;r.faces[I++]=2;r.faces[I++]=0;r.faces[I++]=2;r.faces[I++]=3;r.vertexBuffer=d.createBuffer();r.elementBuffer=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,r.vertexBuffer);d.bufferData(d.ARRAY_BUFFER,r.vertices,d.STATIC_DRAW);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,r.elementBuffer); +d.bufferData(d.ELEMENT_ARRAY_BUFFER,r.faces,d.STATIC_DRAW);r.program=d.createProgram();d.attachShader(r.program,$("fragment",THREE.ShaderLib.sprite.fragmentShader));d.attachShader(r.program,$("vertex",THREE.ShaderLib.sprite.vertexShader));d.linkProgram(r.program);r.attributes={};r.uniforms={};r.attributes.position=d.getAttribLocation(r.program,"position");r.attributes.uv=d.getAttribLocation(r.program,"uv");r.uniforms.uvOffset=d.getUniformLocation(r.program,"uvOffset");r.uniforms.uvScale=d.getUniformLocation(r.program, +"uvScale");r.uniforms.rotation=d.getUniformLocation(r.program,"rotation");r.uniforms.scale=d.getUniformLocation(r.program,"scale");r.uniforms.alignment=d.getUniformLocation(r.program,"alignment");r.uniforms.color=d.getUniformLocation(r.program,"color");r.uniforms.map=d.getUniformLocation(r.program,"map");r.uniforms.opacity=d.getUniformLocation(r.program,"opacity");r.uniforms.useScreenCoordinates=d.getUniformLocation(r.program,"useScreenCoordinates");r.uniforms.affectedByDistance=d.getUniformLocation(r.program, +"affectedByDistance");r.uniforms.screenPosition=d.getUniformLocation(r.program,"screenPosition");r.uniforms.modelViewMatrix=d.getUniformLocation(r.program,"modelViewMatrix");r.uniforms.projectionMatrix=d.getUniformLocation(r.program,"projectionMatrix");var $a=!1;this.setSize=function(a,b){Ba.width=a;Ba.height=b;this.setViewport(0,0,Ba.width,Ba.height)};this.setViewport=function(a,b,c,e){Ha=a;Aa=b;Ca=c;ya=e;d.viewport(Ha,Aa,Ca,ya)};this.setScissor=function(a,b,c,e){d.scissor(a,b,c,e)};this.enableScissorTest= function(a){a?d.enable(d.SCISSOR_TEST):d.disable(d.SCISSOR_TEST)};this.setClearColorHex=function(a,b){Y.setHex(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.setClearColor=function(a,b){Y.copy(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.getClearColor=function(){return Y};this.getClearAlpha=function(){return Fa};this.clear=function(a,b,c){var e=0;if(a===void 0||a)e|=d.COLOR_BUFFER_BIT;if(b===void 0||b)e|=d.DEPTH_BUFFER_BIT;if(c===void 0||c)e|=d.STENCIL_BUFFER_BIT;d.clear(e)};this.getContext=function(){return d}; 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(g in a.geometry.geometryGroups){var b=a.geometry.geometryGroups[g];d.deleteBuffer(b.__webglVertexBuffer);d.deleteBuffer(b.__webglNormalBuffer);d.deleteBuffer(b.__webglTangentBuffer);d.deleteBuffer(b.__webglColorBuffer);d.deleteBuffer(b.__webglUVBuffer);d.deleteBuffer(b.__webglUV2Buffer);d.deleteBuffer(b.__webglSkinVertexABuffer); d.deleteBuffer(b.__webglSkinVertexBBuffer);d.deleteBuffer(b.__webglSkinIndicesBuffer);d.deleteBuffer(b.__webglSkinWeightsBuffer);d.deleteBuffer(b.__webglFaceBuffer);d.deleteBuffer(b.__webglLineBuffer);if(b.numMorphTargets)for(var c=0,e=b.numMorphTargets;c=0&&d.enableVertexAttribArray(l.position);l.color>=0&&d.enableVertexAttribArray(l.color);l.normal>=0&&d.enableVertexAttribArray(l.normal); -l.tangent>=0&&d.enableVertexAttribArray(l.tangent);a.skinning&&l.skinVertexA>=0&&l.skinVertexB>=0&&l.skinIndex>=0&&l.skinWeight>=0&&(d.enableVertexAttribArray(l.skinVertexA),d.enableVertexAttribArray(l.skinVertexB),d.enableVertexAttribArray(l.skinIndex),d.enableVertexAttribArray(l.skinWeight));if(a.attributes)for(h in a.attributes)l[h]!==void 0&&l[h]>=0&&d.enableVertexAttribArray(l[h]);if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h=0&&(d.enableVertexAttribArray(l[q]), -a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,b,c,d){U(a);this.clear(b,c,d)};this.updateShadowMap=function(a,b){C(a,b)};this.render=function(a,b,c,q){var Ia,K,Ea,u,v,r,z,Pa=a.lights,Qa=a.fog;J=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&C(a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;if(b.matrixAutoUpdate){for(Ea=b;Ea.parent;)Ea=Ea.parent;Ea.update(void 0,!0)}a.update(void 0, -!1,b);b.matrixWorldInverse.flattenToArray(Ua);b.projectionMatrix.flattenToArray(Ta);Da.multiply(b.projectionMatrix,b.matrixWorldInverse);m(Da);this.initWebGLObjects(a);U(c);(this.autoClear||q)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);Ea=a.__webglObjects.length;for(q=0;q=0;q--)if(v=a.__webglObjects[q],v.render&&(r=v.object,z=v.buffer,K=v.opaque))i(r),j(K.depthTest),o(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),f(b,Pa,Qa, -K,z,r);for(q=0;q65535&&(q[l].counter+=1,p=q[l].hash+"_"+q[l].counter,j.geometryGroups[p]===void 0&&(j.geometryGroups[p]={faces:[], -materialIndex:r,vertices:0,numMorphTargets:t})),j.geometryGroups[p].faces.push(k),j.geometryGroups[p].vertices+=m;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=S++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer=d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=d.createBuffer();k.__webglUVBuffer=d.createBuffer(); -k.__webglUV2Buffer=d.createBuffer();k.__webglSkinVertexABuffer=d.createBuffer();k.__webglSkinVertexBBuffer=d.createBuffer();k.__webglSkinIndicesBuffer=d.createBuffer();k.__webglSkinWeightsBuffer=d.createBuffer();k.__webglFaceBuffer=d.createBuffer();k.__webglLineBuffer=d.createBuffer();if(k.numMorphTargets){r=o=void 0;k.__webglMorphTargetsBuffers=[];o=0;for(r=k.numMorphTargets;o0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(k*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(k*2)}if(r.geometry.skinWeights.length&&r.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(k*4),j.__skinVertexBArray=new Float32Array(k*4),j.__skinIndexArray= -new Float32Array(k*4),j.__skinWeightArray=new Float32Array(k*4);j.__faceArray=new Uint16Array(l*3);j.__lineArray=new Uint16Array(p*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(z=j.numMorphTargets;t=0&&d.enableVertexAttribArray(l.position);l.color>=0&&d.enableVertexAttribArray(l.color);l.normal>=0&&d.enableVertexAttribArray(l.normal); +l.tangent>=0&&d.enableVertexAttribArray(l.tangent);a.skinning&&l.skinVertexA>=0&&l.skinVertexB>=0&&l.skinIndex>=0&&l.skinWeight>=0&&(d.enableVertexAttribArray(l.skinVertexA),d.enableVertexAttribArray(l.skinVertexB),d.enableVertexAttribArray(l.skinIndex),d.enableVertexAttribArray(l.skinWeight));if(a.attributes)for(h in a.attributes)l[h]!==void 0&&l[h]>=0&&d.enableVertexAttribArray(l[h]);if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h=0&&(d.enableVertexAttribArray(l[r]), +a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,b,c,d){U(a);this.clear(b,c,d)};this.updateShadowMap=function(a,b){C(a,b)};this.render=function(a,b,c,r){var Ia,K,Ea,u,v,q,z,Pa=a.lights,Qa=a.fog;J=-1;this.autoUpdateObjects&&this.initWebGLObjects(a);this.shadowMapEnabled&&this.shadowMapAutoUpdate&&C(a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;if(b.matrixAutoUpdate){for(Ea=b;Ea.parent;)Ea= +Ea.parent;Ea.update(void 0,!0)}a.update(void 0,!1,b);b.matrixWorldInverse.flattenToArray(Ua);b.projectionMatrix.flattenToArray(Ta);Da.multiply(b.projectionMatrix,b.matrixWorldInverse);o(Da);U(c);(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);Ea=a.__webglObjects.length;for(r=0;r=0;r--)if(v=a.__webglObjects[r],v.render&&(q=v.object,z=v.buffer,K=v.opaque))i(q),j(K.depthTest),m(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits), +f(b,Pa,Qa,K,z,q);for(r=0;r65535&&(r[l].counter+=1,p=r[l].hash+"_"+r[l].counter,j.geometryGroups[p]===void 0&&(j.geometryGroups[p]={faces:[], +materialIndex:q,vertices:0,numMorphTargets:t})),j.geometryGroups[p].faces.push(k),j.geometryGroups[p].vertices+=o;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=S++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer=d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=d.createBuffer();k.__webglUVBuffer=d.createBuffer(); +k.__webglUV2Buffer=d.createBuffer();k.__webglSkinVertexABuffer=d.createBuffer();k.__webglSkinVertexBBuffer=d.createBuffer();k.__webglSkinIndicesBuffer=d.createBuffer();k.__webglSkinWeightsBuffer=d.createBuffer();k.__webglFaceBuffer=d.createBuffer();k.__webglLineBuffer=d.createBuffer();if(k.numMorphTargets){q=m=void 0;k.__webglMorphTargetsBuffers=[];m=0;for(q=k.numMorphTargets;m0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(k*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(k*2)}if(q.geometry.skinWeights.length&&q.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(k*4),j.__skinVertexBArray=new Float32Array(k*4),j.__skinIndexArray= +new Float32Array(k*4),j.__skinWeightArray=new Float32Array(k*4);j.__faceArray=new Uint16Array(l*3);j.__lineArray=new Uint16Array(p*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(z=j.numMorphTargets;t=0;i--)f[i]===h&&f.splice(i,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&pa(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e=0;i--)f[i]===h&&f.splice(i,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&pa(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e0&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,oa,l));za&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER,W,l));Aa&&sa.hasTangents&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglTangentBuffer),d.bufferData(d.ARRAY_BUFFER,ca,l));ta&&X>0&&(d.bindBuffer(d.ARRAY_BUFFER, -r.__webglUVBuffer),d.bufferData(d.ARRAY_BUFFER,ja,l));ta&&$>0&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglUV2Buffer),d.bufferData(d.ARRAY_BUFFER,ka,l));ya&&(d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,r.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,ha,l),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,r.__webglLineBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,Y,l));x>0&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinVertexABuffer),d.bufferData(d.ARRAY_BUFFER,da,l),d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinVertexBBuffer), -d.bufferData(d.ARRAY_BUFFER,ea,l),d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinIndicesBuffer),d.bufferData(d.ARRAY_BUFFER,fa,l),d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinWeightsBuffer),d.bufferData(d.ARRAY_BUFFER,ga,l));p&&(delete r.__inittedArrays,delete r.__colorArray,delete r.__normalArray,delete r.__tangentArray,delete r.__uvArray,delete r.__uv2Array,delete r.__faceArray,delete r.__vertexArray,delete r.__lineArray,delete r.__skinVertexAArray,delete r.__skinVertexBArray,delete r.__skinIndexArray,delete r.__skinWeightArray)}h.__dirtyVertices= -!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyColors=!1;h.__dirtyTangents=!1;j.attributes&&wa(j)}else if(i instanceof THREE.Ribbon){if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=q=p=p=void 0;t=i.vertices;o=i.colors;m=t.length;r=o.length;A=i.__vertexArray;l=i.__colorArray;C=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,oa,l));za&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER,W,l));Aa&&sa.hasTangents&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglTangentBuffer),d.bufferData(d.ARRAY_BUFFER,ca,l));ta&&X>0&&(d.bindBuffer(d.ARRAY_BUFFER, +q.__webglUVBuffer),d.bufferData(d.ARRAY_BUFFER,ja,l));ta&&$>0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglUV2Buffer),d.bufferData(d.ARRAY_BUFFER,ka,l));ya&&(d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,ha,l),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webglLineBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,Y,l));x>0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinVertexABuffer),d.bufferData(d.ARRAY_BUFFER,da,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinVertexBBuffer), +d.bufferData(d.ARRAY_BUFFER,ea,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinIndicesBuffer),d.bufferData(d.ARRAY_BUFFER,fa,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinWeightsBuffer),d.bufferData(d.ARRAY_BUFFER,ga,l));p&&(delete q.__inittedArrays,delete q.__colorArray,delete q.__normalArray,delete q.__tangentArray,delete q.__uvArray,delete q.__uv2Array,delete q.__faceArray,delete q.__vertexArray,delete q.__lineArray,delete q.__skinVertexAArray,delete q.__skinVertexBArray,delete q.__skinIndexArray,delete q.__skinWeightArray)}h.__dirtyVertices= +!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyColors=!1;h.__dirtyTangents=!1;j.attributes&&wa(j)}else if(i instanceof THREE.Ribbon){if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=r=p=p=void 0;t=i.vertices;m=i.colors;o=t.length;q=m.length;A=i.__vertexArray;l=i.__colorArray;C=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p