|
@@ -12,21 +12,21 @@ this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setPosit
|
|
1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,e){this.set(a||0,b||0,c||0,e||1)};
|
|
1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,e){this.set(a||0,b||0,c||0,e||1)};
|
|
THREE.Vector4.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z,a.w+b.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z,a.w-b.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x*
|
|
THREE.Vector4.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z,a.w+b.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z,a.w-b.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x*
|
|
a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,b){this.set(this.x+(a.x-this.x)*b,this.y+(a.y-this.y)*b,this.z+(a.z-this.z)*b,this.w+(a.w-this.w)*b)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
|
|
a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,b){this.set(this.x+(a.x-this.x)*b,this.y+(a.y-this.y)*b,this.z+(a.z-this.z)*b,this.w+(a.w-this.w)*b)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
|
|
-THREE.Ray.prototype={intersectScene:function(a){var b,c,e=a.objects,f=[];a=0;for(b=e.length;a<b;a++){c=e[a];c instanceof THREE.Mesh&&(f=f.concat(this.intersectObject(c)))}f.sort(function(i,j){return i.distance-j.distance});return f},intersectObject:function(a){function b(N,O,ja,R){R=R.clone().subSelf(O);ja=ja.clone().subSelf(O);var B=N.clone().subSelf(O);N=R.dot(R);O=R.dot(ja);R=R.dot(B);var la=ja.dot(ja);ja=ja.dot(B);B=1/(N*la-O*O);la=(la*R-O*ja)*B;N=(N*ja-O*R)*B;return la>0&&N>0&&la+N<1}var c,e,
|
|
|
|
-f,i,j,p,n,s,z,A,D,y=a.geometry,K=y.vertices,I=[];c=0;for(e=y.faces.length;c<e;c++){f=y.faces[c];A=this.origin.clone();D=this.direction.clone();n=a.matrixWorld;i=n.multiplyVector3(K[f.a].position.clone());j=n.multiplyVector3(K[f.b].position.clone());p=n.multiplyVector3(K[f.c].position.clone());n=f instanceof THREE.Face4?n.multiplyVector3(K[f.d].position.clone()):null;s=a.matrixRotationWorld.multiplyVector3(f.normal.clone());z=D.dot(s);if(z<0){s=s.dot((new THREE.Vector3).sub(i,A))/z;A=A.addSelf(D.multiplyScalar(s));
|
|
|
|
-if(f instanceof THREE.Face3){if(b(A,i,j,p)){f={distance:this.origin.distanceTo(A),point:A,face:f,object:a};I.push(f)}}else if(f instanceof THREE.Face4&&(b(A,i,j,n)||b(A,j,p,n))){f={distance:this.origin.distanceTo(A),point:A,face:f,object:a};I.push(f)}}}return I}};
|
|
|
|
-THREE.Rectangle=function(){function a(){i=e-b;j=f-c}var b,c,e,f,i,j,p=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return i};this.getHeight=function(){return j};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(n,s,z,A){p=!1;b=n;c=s;e=z;f=A;a()};this.addPoint=function(n,s){if(p){p=!1;b=n;c=s;e=n;f=s}else{b=b<n?b:n;c=c<s?c:s;e=e>n?e:n;f=f>s?f:s}a()};
|
|
|
|
-this.add3Points=function(n,s,z,A,D,y){if(p){p=!1;b=n<z?n<D?n:D:z<D?z:D;c=s<A?s<y?s:y:A<y?A:y;e=n>z?n>D?n:D:z>D?z:D;f=s>A?s>y?s:y:A>y?A:y}else{b=n<z?n<D?n<b?n:b:D<b?D:b:z<D?z<b?z:b:D<b?D:b;c=s<A?s<y?s<c?s:c:y<c?y:c:A<y?A<c?A:c:y<c?y:c;e=n>z?n>D?n>e?n:e:D>e?D:e:z>D?z>e?z:e:D>e?D:e;f=s>A?s>y?s>f?s:f:y>f?y:f:A>y?A>f?A:f:y>f?y:f}a()};this.addRectangle=function(n){if(p){p=!1;b=n.getLeft();c=n.getTop();e=n.getRight();f=n.getBottom()}else{b=b<n.getLeft()?b:n.getLeft();c=c<n.getTop()?c:n.getTop();e=e>n.getRight()?
|
|
|
|
|
|
+THREE.Ray.prototype={intersectScene:function(a){var b,c,e=a.objects,f=[];a=0;for(b=e.length;a<b;a++){c=e[a];c instanceof THREE.Mesh&&(f=f.concat(this.intersectObject(c)))}f.sort(function(i,j){return i.distance-j.distance});return f},intersectObject:function(a){function b(O,L,ha,ma){ma=ma.clone().subSelf(L);ha=ha.clone().subSelf(L);var pa=O.clone().subSelf(L);O=ma.dot(ma);L=ma.dot(ha);ma=ma.dot(pa);var R=ha.dot(ha);ha=ha.dot(pa);pa=1/(O*R-L*L);R=(R*ma-L*ha)*pa;O=(O*ha-L*ma)*pa;return R>0&&O>0&&R+O<
|
|
|
|
+1}var c,e,f,i,j,p,n,s,y,A,D,z=a.geometry,J=z.vertices,K=[];c=0;for(e=z.faces.length;c<e;c++){f=z.faces[c];A=this.origin.clone();D=this.direction.clone();n=a.matrixWorld;i=n.multiplyVector3(J[f.a].position.clone());j=n.multiplyVector3(J[f.b].position.clone());p=n.multiplyVector3(J[f.c].position.clone());n=f instanceof THREE.Face4?n.multiplyVector3(J[f.d].position.clone()):null;s=a.matrixRotationWorld.multiplyVector3(f.normal.clone());y=D.dot(s);if(y<0){s=s.dot((new THREE.Vector3).sub(i,A))/y;A=A.addSelf(D.multiplyScalar(s));
|
|
|
|
+if(f instanceof THREE.Face3){if(b(A,i,j,p)){f={distance:this.origin.distanceTo(A),point:A,face:f,object:a};K.push(f)}}else if(f instanceof THREE.Face4&&(b(A,i,j,n)||b(A,j,p,n))){f={distance:this.origin.distanceTo(A),point:A,face:f,object:a};K.push(f)}}}return K}};
|
|
|
|
+THREE.Rectangle=function(){function a(){i=e-b;j=f-c}var b,c,e,f,i,j,p=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return i};this.getHeight=function(){return j};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(n,s,y,A){p=!1;b=n;c=s;e=y;f=A;a()};this.addPoint=function(n,s){if(p){p=!1;b=n;c=s;e=n;f=s}else{b=b<n?b:n;c=c<s?c:s;e=e>n?e:n;f=f>s?f:s}a()};
|
|
|
|
+this.add3Points=function(n,s,y,A,D,z){if(p){p=!1;b=n<y?n<D?n:D:y<D?y:D;c=s<A?s<z?s:z:A<z?A:z;e=n>y?n>D?n:D:y>D?y:D;f=s>A?s>z?s:z:A>z?A:z}else{b=n<y?n<D?n<b?n:b:D<b?D:b:y<D?y<b?y:b:D<b?D:b;c=s<A?s<z?s<c?s:c:z<c?z:c:A<z?A<c?A:c:z<c?z:c;e=n>y?n>D?n>e?n:e:D>e?D:e:y>D?y>e?y:e:D>e?D:e;f=s>A?s>z?s>f?s:f:z>f?z:f:A>z?A>f?A:f:z>f?z:f}a()};this.addRectangle=function(n){if(p){p=!1;b=n.getLeft();c=n.getTop();e=n.getRight();f=n.getBottom()}else{b=b<n.getLeft()?b:n.getLeft();c=c<n.getTop()?c:n.getTop();e=e>n.getRight()?
|
|
e:n.getRight();f=f>n.getBottom()?f:n.getBottom()}a()};this.inflate=function(n){b-=n;c-=n;e+=n;f+=n;a()};this.minSelf=function(n){b=b>n.getLeft()?b:n.getLeft();c=c>n.getTop()?c:n.getTop();e=e<n.getRight()?e:n.getRight();f=f<n.getBottom()?f:n.getBottom();a()};this.instersects=function(n){return Math.min(e,n.getRight())-Math.max(b,n.getLeft())>=0&&Math.min(f,n.getBottom())-Math.max(c,n.getTop())>=0};this.empty=function(){p=!0;f=e=c=b=0;a()};this.isEmpty=function(){return p}};
|
|
e:n.getRight();f=f>n.getBottom()?f:n.getBottom()}a()};this.inflate=function(n){b-=n;c-=n;e+=n;f+=n;a()};this.minSelf=function(n){b=b>n.getLeft()?b:n.getLeft();c=c>n.getTop()?c:n.getTop();e=e<n.getRight()?e:n.getRight();f=f<n.getBottom()?f:n.getBottom();a()};this.instersects=function(n){return Math.min(e,n.getRight())-Math.max(b,n.getLeft())>=0&&Math.min(f,n.getBottom())-Math.max(c,n.getTop())>=0};this.empty=function(){p=!0;f=e=c=b=0;a()};this.isEmpty=function(){return p}};
|
|
THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};
|
|
THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};
|
|
-THREE.Matrix4=function(a,b,c,e,f,i,j,p,n,s,z,A,D,y,K,I){this.set(a||1,b||0,c||0,e||0,f||0,i||1,j||0,p||0,n||0,s||0,z||1,A||0,D||0,y||0,K||0,I||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
|
|
|
|
-THREE.Matrix4.prototype={set:function(a,b,c,e,f,i,j,p,n,s,z,A,D,y,K,I){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=i;this.n23=j;this.n24=p;this.n31=n;this.n32=s;this.n33=z;this.n34=A;this.n41=D;this.n42=y;this.n43=K;this.n44=I;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,
|
|
|
|
|
|
+THREE.Matrix4=function(a,b,c,e,f,i,j,p,n,s,y,A,D,z,J,K){this.set(a||1,b||0,c||0,e||0,f||0,i||1,j||0,p||0,n||0,s||0,y||1,A||0,D||0,z||0,J||0,K||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
|
|
|
|
+THREE.Matrix4.prototype={set:function(a,b,c,e,f,i,j,p,n,s,y,A,D,z,J,K){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=i;this.n23=j;this.n24=p;this.n31=n;this.n32=s;this.n33=y;this.n34=A;this.n41=D;this.n42=z;this.n43=J;this.n44=K;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,i=THREE.Matrix4.__v3;i.sub(a,b).normalize();if(i.length()===0)i.z=1;e.cross(c,i).normalize();if(e.length()===0){i.x+=1.0E-4;e.cross(c,i).normalize()}f.cross(i,e).normalize();this.n11=e.x;this.n12=f.x;this.n13=i.x;this.n21=e.y;this.n22=f.y;this.n23=i.y;this.n31=e.z;this.n32=f.z;this.n33=i.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*
|
|
f=THREE.Matrix4.__v2,i=THREE.Matrix4.__v3;i.sub(a,b).normalize();if(i.length()===0)i.z=1;e.cross(c,i).normalize();if(e.length()===0){i.x+=1.0E-4;e.cross(c,i).normalize()}f.cross(i,e).normalize();this.n11=e.x;this.n12=f.x;this.n13=i.x;this.n21=e.y;this.n22=f.y;this.n23=i.y;this.n31=e.z;this.n32=f.z;this.n33=i.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();
|
|
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,i=a.n14,j=a.n21,p=a.n22,n=a.n23,s=a.n24,z=a.n31,A=a.n32,D=a.n33,y=a.n34,K=a.n41,I=a.n42,N=a.n43,O=a.n44,ja=b.n11,R=b.n12,B=b.n13,la=b.n14,T=b.n21,ma=b.n22,
|
|
|
|
-d=b.n23,P=b.n24,M=b.n31,ya=b.n32,ka=b.n33,na=b.n34;this.n11=c*ja+e*T+f*M;this.n12=c*R+e*ma+f*ya;this.n13=c*B+e*d+f*ka;this.n14=c*la+e*P+f*na+i;this.n21=j*ja+p*T+n*M;this.n22=j*R+p*ma+n*ya;this.n23=j*B+p*d+n*ka;this.n24=j*la+p*P+n*na+s;this.n31=z*ja+A*T+D*M;this.n32=z*R+A*ma+D*ya;this.n33=z*B+A*d+D*ka;this.n34=z*la+A*P+D*na+y;this.n41=K*ja+I*T+N*M;this.n42=K*R+I*ma+N*ya;this.n43=K*B+I*d+N*ka;this.n44=K*la+I*P+N*na+O;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,i=this.n22,j=this.n23,p=this.n24,n=this.n31,s=this.n32,z=this.n33,A=this.n34,D=this.n41,y=this.n42,K=this.n43,I=this.n44;return e*j*s*D-c*p*s*D-e*i*z*D+b*p*z*D+c*i*A*D-b*j*A*D-e*j*n*y+c*p*n*y+e*f*z*y-a*p*z*y-c*f*A*y+a*j*A*y+e*i*n*K-b*p*n*K-e*f*s*K+a*p*s*K+b*f*A*K-a*i*A*K-c*i*n*I+b*j*n*I+c*f*s*I-a*j*s*I-b*f*z*I+a*i*z*I},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=
|
|
|
|
|
|
+return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,i=a.n14,j=a.n21,p=a.n22,n=a.n23,s=a.n24,y=a.n31,A=a.n32,D=a.n33,z=a.n34,J=a.n41,K=a.n42,O=a.n43,L=a.n44,ha=b.n11,ma=b.n12,pa=b.n13,R=b.n14,B=b.n21,sa=b.n22,
|
|
|
|
+d=b.n23,Da=b.n24,Aa=b.n31,Q=b.n32,N=b.n33,ta=b.n34;this.n11=c*ha+e*B+f*Aa;this.n12=c*ma+e*sa+f*Q;this.n13=c*pa+e*d+f*N;this.n14=c*R+e*Da+f*ta+i;this.n21=j*ha+p*B+n*Aa;this.n22=j*ma+p*sa+n*Q;this.n23=j*pa+p*d+n*N;this.n24=j*R+p*Da+n*ta+s;this.n31=y*ha+A*B+D*Aa;this.n32=y*ma+A*sa+D*Q;this.n33=y*pa+A*d+D*N;this.n34=y*R+A*Da+D*ta+z;this.n41=J*ha+K*B+O*Aa;this.n42=J*ma+K*sa+O*Q;this.n43=J*pa+K*d+O*N;this.n44=J*R+K*Da+O*ta+L;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,i=this.n22,j=this.n23,p=this.n24,n=this.n31,s=this.n32,y=this.n33,A=this.n34,D=this.n41,z=this.n42,J=this.n43,K=this.n44;return e*j*s*D-c*p*s*D-e*i*y*D+b*p*y*D+c*i*A*D-b*j*A*D-e*j*n*z+c*p*n*z+e*f*y*z-a*p*y*z-c*f*A*z+a*j*A*z+e*i*n*J-b*p*n*J-e*f*s*J+a*p*s*J+b*f*A*J-a*i*A*J-c*i*n*K+b*j*n*K+c*f*s*K-a*j*s*K-b*f*y*K+a*i*y*K},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.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;
|
|
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,
|
|
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,
|
|
@@ -34,9 +34,9 @@ a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=t
|
|
1-c,i=a.x,j=a.y,p=a.z,n=f*i,s=f*j;this.set(n*i+c,n*j-e*p,n*p+e*j,0,n*j+e*p,s*j+c,s*p-e*i,0,n*p-e*j,s*p+e*i,f*p*p+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},setRotationFromEuler:function(a){var b=a.x,c=a.y,e=a.z;a=Math.cos(b);b=Math.sin(b);var f=Math.cos(c);c=Math.sin(c);var i=Math.cos(e);e=Math.sin(e);var j=a*c,p=b*c;this.n11=f*i;this.n12=-f*e;this.n13=c;this.n21=p*i+a*e;this.n22=-p*e+a*i;this.n23=-b*f;this.n31=-j*i+b*e;this.n32=j*e+b*i;this.n33=
|
|
1-c,i=a.x,j=a.y,p=a.z,n=f*i,s=f*j;this.set(n*i+c,n*j-e*p,n*p+e*j,0,n*j+e*p,s*j+c,s*p-e*i,0,n*p-e*j,s*p+e*i,f*p*p+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},setRotationFromEuler:function(a){var b=a.x,c=a.y,e=a.z;a=Math.cos(b);b=Math.sin(b);var f=Math.cos(c);c=Math.sin(c);var i=Math.cos(e);e=Math.sin(e);var j=a*c,p=b*c;this.n11=f*i;this.n12=-f*e;this.n13=c;this.n21=p*i+a*e;this.n22=-p*e+a*i;this.n23=-b*f;this.n31=-j*i+b*e;this.n32=j*e+b*i;this.n33=
|
|
a*f;return this},setRotationFromQuaternion:function(a){var b=a.x,c=a.y,e=a.z,f=a.w,i=b+b,j=c+c,p=e+e;a=b*i;var n=b*j;b*=p;var s=c*j;c*=p;e*=p;i*=f;j*=f;f*=p;this.n11=1-(s+e);this.n12=n-f;this.n13=b+j;this.n21=n+f;this.n22=1-(a+e);this.n23=c-i;this.n31=b-j;this.n32=c+i;this.n33=1-(a+s);return this},scale:function(a){var b=a.x,c=a.y;a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},extractPosition:function(a){this.n14=
|
|
a*f;return this},setRotationFromQuaternion:function(a){var b=a.x,c=a.y,e=a.z,f=a.w,i=b+b,j=c+c,p=e+e;a=b*i;var n=b*j;b*=p;var s=c*j;c*=p;e*=p;i*=f;j*=f;f*=p;this.n11=1-(s+e);this.n12=n-f;this.n13=b+j;this.n21=n+f;this.n22=1-(a+e);this.n23=c-i;this.n31=b-j;this.n32=c+i;this.n33=1-(a+s);return this},scale:function(a){var b=a.x,c=a.y;a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},extractPosition:function(a){this.n14=
|
|
a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,e=1/b.y,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}};
|
|
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,i=a.n14,j=a.n21,p=a.n22,n=a.n23,s=a.n24,z=a.n31,A=a.n32,D=a.n33,y=a.n34,K=a.n41,I=a.n42,N=a.n43,O=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=n*y*I-s*D*I+s*A*N-p*y*N-n*A*O+p*D*O;b.n12=i*D*I-f*y*I-i*A*N+e*y*N+f*A*O-e*D*O;b.n13=f*s*I-i*n*I+i*p*N-e*s*N-f*p*O+e*n*O;b.n14=i*n*A-f*s*A-i*p*D+e*s*D+f*p*y-e*n*y;b.n21=s*D*K-n*y*K-s*z*N+j*y*N+n*z*O-j*D*O;b.n22=f*y*K-i*D*K+i*z*N-c*y*N-f*z*O+c*D*O;b.n23=i*n*K-f*s*K-i*j*N+c*s*N+f*j*O-c*n*O;
|
|
|
|
-b.n24=f*s*z-i*n*z+i*j*D-c*s*D-f*j*y+c*n*y;b.n31=p*y*K-s*A*K+s*z*I-j*y*I-p*z*O+j*A*O;b.n32=i*A*K-e*y*K-i*z*I+c*y*I+e*z*O-c*A*O;b.n33=f*s*K-i*p*K+i*j*I-c*s*I-e*j*O+c*p*O;b.n34=i*p*z-e*s*z-i*j*A+c*s*A+e*j*y-c*p*y;b.n41=n*A*K-p*D*K-n*z*I+j*D*I+p*z*N-j*A*N;b.n42=e*D*K-f*A*K+f*z*I-c*D*I-e*z*N+c*A*N;b.n43=f*p*K-e*n*K-f*j*I+c*n*I+e*j*N-c*p*N;b.n44=e*n*z-f*p*z+f*j*A-c*n*A-e*j*D+c*p*D;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,i=a.n32*a.n21-a.n31*a.n22,j=-a.n33*a.n12+a.n32*a.n13,p=a.n33*a.n11-a.n31*a.n13,n=-a.n32*a.n11+a.n31*a.n12,s=a.n23*a.n12-a.n22*a.n13,z=-a.n23*a.n11+a.n21*a.n13,A=a.n22*a.n11-a.n21*a.n12;a=a.n11*e+a.n21*j+a.n31*s;if(a==0)throw"matrix not invertible";a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*i;c[3]=a*j;c[4]=a*p;c[5]=a*n;c[6]=a*s;c[7]=a*z;c[8]=a*A;return b};
|
|
|
|
|
|
+THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,i=a.n14,j=a.n21,p=a.n22,n=a.n23,s=a.n24,y=a.n31,A=a.n32,D=a.n33,z=a.n34,J=a.n41,K=a.n42,O=a.n43,L=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=n*z*K-s*D*K+s*A*O-p*z*O-n*A*L+p*D*L;b.n12=i*D*K-f*z*K-i*A*O+e*z*O+f*A*L-e*D*L;b.n13=f*s*K-i*n*K+i*p*O-e*s*O-f*p*L+e*n*L;b.n14=i*n*A-f*s*A-i*p*D+e*s*D+f*p*z-e*n*z;b.n21=s*D*J-n*z*J-s*y*O+j*z*O+n*y*L-j*D*L;b.n22=f*z*J-i*D*J+i*y*O-c*z*O-f*y*L+c*D*L;b.n23=i*n*J-f*s*J-i*j*O+c*s*O+f*j*L-c*n*L;
|
|
|
|
+b.n24=f*s*y-i*n*y+i*j*D-c*s*D-f*j*z+c*n*z;b.n31=p*z*J-s*A*J+s*y*K-j*z*K-p*y*L+j*A*L;b.n32=i*A*J-e*z*J-i*y*K+c*z*K+e*y*L-c*A*L;b.n33=f*s*J-i*p*J+i*j*K-c*s*K-e*j*L+c*p*L;b.n34=i*p*y-e*s*y-i*j*A+c*s*A+e*j*z-c*p*z;b.n41=n*A*J-p*D*J-n*y*K+j*D*K+p*y*O-j*A*O;b.n42=e*D*J-f*A*J+f*y*K-c*D*K-e*y*O+c*A*O;b.n43=f*p*J-e*n*J-f*j*K+c*n*K+e*j*O-c*p*O;b.n44=e*n*y-f*p*y+f*j*A-c*n*A-e*j*D+c*p*D;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,i=a.n32*a.n21-a.n31*a.n22,j=-a.n33*a.n12+a.n32*a.n13,p=a.n33*a.n11-a.n31*a.n13,n=-a.n32*a.n11+a.n31*a.n12,s=a.n23*a.n12-a.n22*a.n13,y=-a.n23*a.n11+a.n21*a.n13,A=a.n22*a.n11-a.n21*a.n12;a=a.n11*e+a.n21*j+a.n31*s;if(a==0)throw"matrix not invertible";a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*i;c[3]=a*j;c[4]=a*p;c[5]=a*n;c[6]=a*s;c[7]=a*y;c[8]=a*A;return b};
|
|
THREE.Matrix4.makeFrustum=function(a,b,c,e,f,i){var j;j=new THREE.Matrix4;j.n11=2*f/(b-a);j.n12=0;j.n13=(b+a)/(b-a);j.n14=0;j.n21=0;j.n22=2*f/(e-c);j.n23=(e+c)/(e-c);j.n24=0;j.n31=0;j.n32=0;j.n33=-(i+f)/(i-f);j.n34=-2*i*f/(i-f);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};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.makeFrustum=function(a,b,c,e,f,i){var j;j=new THREE.Matrix4;j.n11=2*f/(b-a);j.n12=0;j.n13=(b+a)/(b-a);j.n14=0;j.n21=0;j.n22=2*f/(e-c);j.n23=(e+c)/(e-c);j.n24=0;j.n31=0;j.n32=0;j.n33=-(i+f)/(i-f);j.n34=-2*i*f/(i-f);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};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,i){var j,p,n,s;j=new THREE.Matrix4;p=b-a;n=c-e;s=i-f;j.n11=2/p;j.n12=0;j.n13=0;j.n14=-((b+a)/p);j.n21=0;j.n22=2/n;j.n23=0;j.n24=-((c+e)/n);j.n31=0;j.n32=0;j.n33=-2/s;j.n34=-((i+f)/s);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.makeOrtho=function(a,b,c,e,f,i){var j,p,n,s;j=new THREE.Matrix4;p=b-a;n=c-e;s=i-f;j.n11=2/p;j.n12=0;j.n13=0;j.n14=-((b+a)/p);j.n21=0;j.n22=2/n;j.n23=0;j.n24=-((c+e)/n);j.n31=0;j.n32=0;j.n33=-2/s;j.n34=-((i+f)/s);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.Object3D=function(){this.parent=undefined;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=
|
|
THREE.Object3D=function(){this.parent=undefined;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=
|
|
@@ -47,8 +47,8 @@ undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b
|
|
b,c)}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==undefined?e:1)};
|
|
b,c)}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==undefined?e:1)};
|
|
THREE.Quaternion.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b;a=Math.cos(e);e=Math.sin(e);b=Math.cos(-f);f=Math.sin(-f);var i=Math.cos(c);c=Math.sin(c);var j=a*b,p=e*f;this.w=j*i-p*c;this.x=j*c+p*i;this.y=e*b*i+a*f*c;this.z=a*f*i-e*b*c;return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=
|
|
THREE.Quaternion.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b;a=Math.cos(e);e=Math.sin(e);b=Math.cos(-f);f=Math.sin(-f);var i=Math.cos(c);c=Math.sin(c);var j=a*b,p=e*f;this.w=j*i-p*c;this.x=j*c+p*i;this.y=e*b*i+a*f*c;this.z=a*f*i-e*b*c;return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=
|
|
-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a==0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x*=a;this.y*=a;this.z*=a;this.w*=a}return this},multiplySelf:function(a){var b=this.x,c=this.y,e=this.z,f=this.w,i=a.x,j=a.y,p=a.z;a=a.w;this.x=b*a+f*i+c*p-e*j;this.y=c*a+f*j+e*i-b*p;this.z=e*a+f*p+b*j-c*i;this.w=f*a-b*i-c*j-e*p;return this},
|
|
-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a==0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x*=a;this.y*=a;this.z*=a;this.w*=a}return this},multiplySelf:function(a){var b=this.x,c=this.y,e=this.z,f=this.w,i=a.x,j=a.y,p=a.z;a=a.w;this.x=b*a+f*i+c*p-e*j;this.y=c*a+f*j+e*i-b*p;this.z=e*a+f*p+b*j-c*i;this.w=f*a-b*i-c*j-e*p;return this},
|
|
-multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,i=this.x,j=this.y,p=this.z,n=this.w,s=n*c+j*f-p*e,z=n*e+p*c-i*f,A=n*f+i*e-j*c;c=-i*c-j*e-p*f;b.x=s*n+c*-i+z*-p-A*-j;b.y=z*n+c*-j+A*-i-s*-p;b.z=A*n+c*-p+s*-j-z*-i;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){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var i=Math.acos(f),j=Math.sqrt(1-f*f);if(Math.abs(j)<0.0010){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}f=Math.sin((1-e)*i)/j;e=Math.sin(e*i)/j;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};
|
|
|
|
|
|
+multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,i=this.x,j=this.y,p=this.z,n=this.w,s=n*c+j*f-p*e,y=n*e+p*c-i*f,A=n*f+i*e-j*c;c=-i*c-j*e-p*f;b.x=s*n+c*-i+y*-p-A*-j;b.y=y*n+c*-j+A*-i-s*-p;b.z=A*n+c*-p+s*-j-y*-i;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){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var i=Math.acos(f),j=Math.sqrt(1-f*f);if(Math.abs(j)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}f=Math.sin((1-e)*i)/j;e=Math.sin(e*i)/j;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,i){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.materials=i instanceof Array?i:[i];this.centroid=new THREE.Vector3};
|
|
THREE.Face3=function(a,b,c,e,f,i){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.materials=i instanceof Array?i:[i];this.centroid=new THREE.Vector3};
|
|
THREE.Face4=function(a,b,c,e,f,i,j){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=i instanceof THREE.Color?i:new THREE.Color;this.vertexColors=i instanceof Array?i:[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};
|
|
THREE.Face4=function(a,b,c,e,f,i,j){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=i instanceof THREE.Color?i:new THREE.Color;this.vertexColors=i instanceof Array?i:[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.set(a||0,b||0)};THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};
|
|
THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
|
|
THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
|
|
@@ -56,26 +56,26 @@ THREE.Geometry.prototype={computeCentroids:function(){var a,b,c;a=0;for(b=this.f
|
|
c.centroid.addSelf(this.vertices[c.d].position);c.centroid.divideScalar(4)}}},computeFaceNormals:function(a){var b,c,e,f,i,j,p=new THREE.Vector3,n=new THREE.Vector3;e=0;for(f=this.faces.length;e<f;e++){i=this.faces[e];if(a&&i.vertexNormals.length){p.set(0,0,0);b=0;for(c=i.vertexNormals.length;b<c;b++)p.addSelf(i.vertexNormals[b]);p.divideScalar(3)}else{b=this.vertices[i.a];c=this.vertices[i.b];j=this.vertices[i.c];p.sub(j.position,c.position);n.sub(b.position,c.position);p.crossSelf(n)}p.isZero()||
|
|
c.centroid.addSelf(this.vertices[c.d].position);c.centroid.divideScalar(4)}}},computeFaceNormals:function(a){var b,c,e,f,i,j,p=new THREE.Vector3,n=new THREE.Vector3;e=0;for(f=this.faces.length;e<f;e++){i=this.faces[e];if(a&&i.vertexNormals.length){p.set(0,0,0);b=0;for(c=i.vertexNormals.length;b<c;b++)p.addSelf(i.vertexNormals[b]);p.divideScalar(3)}else{b=this.vertices[i.a];c=this.vertices[i.b];j=this.vertices[i.c];p.sub(j.position,c.position);n.sub(b.position,c.position);p.crossSelf(n)}p.isZero()||
|
|
p.normalize();i.normal.copy(p)}},computeVertexNormals:function(){var a,b,c,e;if(this.__tmpVertices==undefined){e=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)e[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];if(c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}}else{e=
|
|
p.normalize();i.normal.copy(p)}},computeVertexNormals:function(){var a,b,c,e;if(this.__tmpVertices==undefined){e=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)e[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];if(c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}}else{e=
|
|
this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)e[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];if(c instanceof THREE.Face3){e[c.a].addSelf(c.normal);e[c.b].addSelf(c.normal);e[c.c].addSelf(c.normal)}else if(c instanceof THREE.Face4){e[c.a].addSelf(c.normal);e[c.b].addSelf(c.normal);e[c.c].addSelf(c.normal);e[c.d].addSelf(c.normal)}}a=0;for(b=this.vertices.length;a<b;a++)e[a].normalize();a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];if(c instanceof THREE.Face3){c.vertexNormals[0].copy(e[c.a]);
|
|
this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)e[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];if(c instanceof THREE.Face3){e[c.a].addSelf(c.normal);e[c.b].addSelf(c.normal);e[c.c].addSelf(c.normal)}else if(c instanceof THREE.Face4){e[c.a].addSelf(c.normal);e[c.b].addSelf(c.normal);e[c.c].addSelf(c.normal);e[c.d].addSelf(c.normal)}}a=0;for(b=this.vertices.length;a<b;a++)e[a].normalize();a=0;for(b=this.faces.length;a<b;a++){c=this.faces[a];if(c instanceof THREE.Face3){c.vertexNormals[0].copy(e[c.a]);
|
|
-c.vertexNormals[1].copy(e[c.b]);c.vertexNormals[2].copy(e[c.c])}else if(c instanceof THREE.Face4){c.vertexNormals[0].copy(e[c.a]);c.vertexNormals[1].copy(e[c.b]);c.vertexNormals[2].copy(e[c.c]);c.vertexNormals[3].copy(e[c.d])}}},computeTangents:function(){function a(na,oa,U,ha,wa,pa,X){i=na.vertices[oa].position;j=na.vertices[U].position;p=na.vertices[ha].position;n=f[wa];s=f[pa];z=f[X];A=j.x-i.x;D=p.x-i.x;y=j.y-i.y;K=p.y-i.y;I=j.z-i.z;N=p.z-i.z;O=s.u-n.u;ja=z.u-n.u;R=s.v-n.v;B=z.v-n.v;la=1/(O*B-
|
|
|
|
-ja*R);d.set((B*A-R*D)*la,(B*y-R*K)*la,(B*I-R*N)*la);P.set((O*D-ja*A)*la,(O*K-ja*y)*la,(O*N-ja*I)*la);T[oa].addSelf(d);T[U].addSelf(d);T[ha].addSelf(d);ma[oa].addSelf(P);ma[U].addSelf(P);ma[ha].addSelf(P)}var b,c,e,f,i,j,p,n,s,z,A,D,y,K,I,N,O,ja,R,B,la,T=[],ma=[],d=new THREE.Vector3,P=new THREE.Vector3,M=new THREE.Vector3,ya=new THREE.Vector3,ka=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++){T[b]=new THREE.Vector3;ma[b]=new THREE.Vector3}b=0;for(c=this.faces.length;b<c;b++){e=this.faces[b];
|
|
|
|
-f=this.faceVertexUvs[b][0];if(e instanceof THREE.Face3){a(this,e.a,e.b,e.c,0,1,2);this.vertices[e.a].normal.copy(e.vertexNormals[0]);this.vertices[e.b].normal.copy(e.vertexNormals[1]);this.vertices[e.c].normal.copy(e.vertexNormals[2])}else if(e instanceof THREE.Face4){a(this,e.a,e.b,e.c,0,1,2);a(this,e.a,e.b,e.d,0,1,3);this.vertices[e.a].normal.copy(e.vertexNormals[0]);this.vertices[e.b].normal.copy(e.vertexNormals[1]);this.vertices[e.c].normal.copy(e.vertexNormals[2]);this.vertices[e.d].normal.copy(e.vertexNormals[3])}}b=
|
|
|
|
-0;for(c=this.vertices.length;b<c;b++){ka.copy(this.vertices[b].normal);e=T[b];M.copy(e);M.subSelf(ka.multiplyScalar(ka.dot(e))).normalize();ya.cross(this.vertices[b].normal,e);e=ya.dot(ma[b]);e=e<0?-1:1;this.vertices[b].tangent.set(M.x,M.y,M.z,e)}this.hasTangents=!0},computeBoundingBox:function(){var a;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};
|
|
|
|
|
|
+c.vertexNormals[1].copy(e[c.b]);c.vertexNormals[2].copy(e[c.c])}else if(c instanceof THREE.Face4){c.vertexNormals[0].copy(e[c.a]);c.vertexNormals[1].copy(e[c.b]);c.vertexNormals[2].copy(e[c.c]);c.vertexNormals[3].copy(e[c.d])}}},computeTangents:function(){function a(ta,ua,Ba,ia,V,ja,ka){i=ta.vertices[ua].position;j=ta.vertices[Ba].position;p=ta.vertices[ia].position;n=f[V];s=f[ja];y=f[ka];A=j.x-i.x;D=p.x-i.x;z=j.y-i.y;J=p.y-i.y;K=j.z-i.z;O=p.z-i.z;L=s.u-n.u;ha=y.u-n.u;ma=s.v-n.v;pa=y.v-n.v;R=1/(L*
|
|
|
|
+pa-ha*ma);d.set((pa*A-ma*D)*R,(pa*z-ma*J)*R,(pa*K-ma*O)*R);Da.set((L*D-ha*A)*R,(L*J-ha*z)*R,(L*O-ha*K)*R);B[ua].addSelf(d);B[Ba].addSelf(d);B[ia].addSelf(d);sa[ua].addSelf(Da);sa[Ba].addSelf(Da);sa[ia].addSelf(Da)}var b,c,e,f,i,j,p,n,s,y,A,D,z,J,K,O,L,ha,ma,pa,R,B=[],sa=[],d=new THREE.Vector3,Da=new THREE.Vector3,Aa=new THREE.Vector3,Q=new THREE.Vector3,N=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++){B[b]=new THREE.Vector3;sa[b]=new THREE.Vector3}b=0;for(c=this.faces.length;b<c;b++){e=
|
|
|
|
+this.faces[b];f=this.faceVertexUvs[b][0];if(e instanceof THREE.Face3){a(this,e.a,e.b,e.c,0,1,2);this.vertices[e.a].normal.copy(e.vertexNormals[0]);this.vertices[e.b].normal.copy(e.vertexNormals[1]);this.vertices[e.c].normal.copy(e.vertexNormals[2])}else if(e instanceof THREE.Face4){a(this,e.a,e.b,e.c,0,1,2);a(this,e.a,e.b,e.d,0,1,3);this.vertices[e.a].normal.copy(e.vertexNormals[0]);this.vertices[e.b].normal.copy(e.vertexNormals[1]);this.vertices[e.c].normal.copy(e.vertexNormals[2]);this.vertices[e.d].normal.copy(e.vertexNormals[3])}}b=
|
|
|
|
+0;for(c=this.vertices.length;b<c;b++){N.copy(this.vertices[b].normal);e=B[b];Aa.copy(e);Aa.subSelf(N.multiplyScalar(N.dot(e))).normalize();Q.cross(this.vertices[b].normal,e);e=Q.dot(sa[b]);e=e<0?-1:1;this.vertices[b].tangent.set(Aa.x,Aa.y,Aa.z,e)}this.hasTangents=!0},computeBoundingBox:function(){var a;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};
|
|
for(var b=1,c=this.vertices.length;b<c;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=
|
|
for(var b=1,c=this.vertices.length;b<c;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=
|
|
a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}}};THREE.GeometryIdCounter=0;
|
|
a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}}};THREE.GeometryIdCounter=0;
|
|
THREE.AnimationHandler=function(){var a=[],b={},c={};c.update=function(f){for(var i=0;i<a.length;i++)a[i].update(f)};c.addToUpdate=function(f){a.indexOf(f)===-1&&a.push(f)};c.removeFromUpdate=function(f){f=a.indexOf(f);f!==-1&&a.splice(f,1)};c.add=function(f){b[f.name]!==undefined&&console.log("THREE.AnimationHandler.add: Warning! "+f.name+" already exists in library. Overwriting.");b[f.name]=f;if(f.initialized!==!0){for(var i=0;i<f.hierarchy.length;i++){for(var j=0;j<f.hierarchy[i].keys.length;j++){if(f.hierarchy[i].keys[j].time<
|
|
THREE.AnimationHandler=function(){var a=[],b={},c={};c.update=function(f){for(var i=0;i<a.length;i++)a[i].update(f)};c.addToUpdate=function(f){a.indexOf(f)===-1&&a.push(f)};c.removeFromUpdate=function(f){f=a.indexOf(f);f!==-1&&a.splice(f,1)};c.add=function(f){b[f.name]!==undefined&&console.log("THREE.AnimationHandler.add: Warning! "+f.name+" already exists in library. Overwriting.");b[f.name]=f;if(f.initialized!==!0){for(var i=0;i<f.hierarchy.length;i++){for(var j=0;j<f.hierarchy[i].keys.length;j++){if(f.hierarchy[i].keys[j].time<
|
|
-0)f.hierarchy[i].keys[j].time=0;if(f.hierarchy[i].keys[j].rot!==undefined&&!(f.hierarchy[i].keys[j].rot instanceof THREE.Quaternion)){var p=f.hierarchy[i].keys[j].rot;f.hierarchy[i].keys[j].rot=new THREE.Quaternion(p[0],p[1],p[2],p[3])}}if(f.hierarchy[i].keys[0].morphTargets!==undefined){p={};for(j=0;j<f.hierarchy[i].keys.length;j++)for(var n=0;n<f.hierarchy[i].keys[j].morphTargets.length;n++){var s=f.hierarchy[i].keys[j].morphTargets[n];p[s]=-1}f.hierarchy[i].usedMorphTargets=p;for(j=0;j<f.hierarchy[i].keys.length;j++){var z=
|
|
|
|
-{};for(s in p){for(n=0;n<f.hierarchy[i].keys[j].morphTargets.length;n++)if(f.hierarchy[i].keys[j].morphTargets[n]===s){z[s]=f.hierarchy[i].keys[j].morphTargetsInfluences[n];break}n===f.hierarchy[i].keys[j].morphTargets.length&&(z[s]=0)}f.hierarchy[i].keys[j].morphTargetsInfluences=z}}for(j=1;j<f.hierarchy[i].keys.length;j++)if(f.hierarchy[i].keys[j].time===f.hierarchy[i].keys[j-1].time){f.hierarchy[i].keys.splice(j,1);j--}for(j=1;j<f.hierarchy[i].keys.length;j++)f.hierarchy[i].keys[j].index=j}j=parseInt(f.length*
|
|
|
|
|
|
+0)f.hierarchy[i].keys[j].time=0;if(f.hierarchy[i].keys[j].rot!==undefined&&!(f.hierarchy[i].keys[j].rot instanceof THREE.Quaternion)){var p=f.hierarchy[i].keys[j].rot;f.hierarchy[i].keys[j].rot=new THREE.Quaternion(p[0],p[1],p[2],p[3])}}if(f.hierarchy[i].keys[0].morphTargets!==undefined){p={};for(j=0;j<f.hierarchy[i].keys.length;j++)for(var n=0;n<f.hierarchy[i].keys[j].morphTargets.length;n++){var s=f.hierarchy[i].keys[j].morphTargets[n];p[s]=-1}f.hierarchy[i].usedMorphTargets=p;for(j=0;j<f.hierarchy[i].keys.length;j++){var y=
|
|
|
|
+{};for(s in p){for(n=0;n<f.hierarchy[i].keys[j].morphTargets.length;n++)if(f.hierarchy[i].keys[j].morphTargets[n]===s){y[s]=f.hierarchy[i].keys[j].morphTargetsInfluences[n];break}n===f.hierarchy[i].keys[j].morphTargets.length&&(y[s]=0)}f.hierarchy[i].keys[j].morphTargetsInfluences=y}}for(j=1;j<f.hierarchy[i].keys.length;j++)if(f.hierarchy[i].keys[j].time===f.hierarchy[i].keys[j-1].time){f.hierarchy[i].keys.splice(j,1);j--}for(j=1;j<f.hierarchy[i].keys.length;j++)f.hierarchy[i].keys[j].index=j}j=parseInt(f.length*
|
|
f.fps,10);f.JIT={};f.JIT.hierarchy=[];for(i=0;i<f.hierarchy.length;i++)f.JIT.hierarchy.push(Array(j));f.initialized=!0}};c.get=function(f){if(typeof f==="string")if(b[f])return b[f];else{console.log("THREE.AnimationHandler.get: Couldn't find animation "+f);return null}};c.parse=function(f){var i=[];if(f instanceof THREE.SkinnedMesh)for(var j=0;j<f.bones.length;j++)i.push(f.bones[j]);else e(f,i);return i};var e=function(f,i){i.push(f);for(var j=0;j<f.children.length;j++)e(f.children[j],i)};c.LINEAR=
|
|
f.fps,10);f.JIT={};f.JIT.hierarchy=[];for(i=0;i<f.hierarchy.length;i++)f.JIT.hierarchy.push(Array(j));f.initialized=!0}};c.get=function(f){if(typeof f==="string")if(b[f])return b[f];else{console.log("THREE.AnimationHandler.get: Couldn't find animation "+f);return null}};c.parse=function(f){var i=[];if(f instanceof THREE.SkinnedMesh)for(var j=0;j<f.bones.length;j++)i.push(f.bones[j]);else e(f,i);return i};var e=function(f,i){i.push(f);for(var j=0;j<f.children.length;j++)e(f.children[j],i)};c.LINEAR=
|
|
0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(a,b,c,e){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.isPaused=!0;this.loop=!0;this.interpolationType=c!==undefined?c:THREE.AnimationHandler.LINEAR;this.JITCompile=e!==undefined?e:!0;this.points=[];this.target=new THREE.Vector3};
|
|
0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation=function(a,b,c,e){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.isPaused=!0;this.loop=!0;this.interpolationType=c!==undefined?c:THREE.AnimationHandler.LINEAR;this.JITCompile=e!==undefined?e:!0;this.points=[];this.target=new THREE.Vector3};
|
|
THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=a!==undefined?a:!0;this.currentTime=b!==undefined?b:0;var c,e=this.hierarchy.length,f;for(c=0;c<e;c++){f=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)f.useQuaternion=!0;f.matrixAutoUpdate=!0;if(f.animationCache===undefined){f.animationCache={};f.animationCache.prevKey={pos:0,rot:0,scl:0};f.animationCache.nextKey={pos:0,rot:0,scl:0};f.animationCache.originalMatrix=
|
|
THREE.Animation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=a!==undefined?a:!0;this.currentTime=b!==undefined?b:0;var c,e=this.hierarchy.length,f;for(c=0;c<e;c++){f=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)f.useQuaternion=!0;f.matrixAutoUpdate=!0;if(f.animationCache===undefined){f.animationCache={};f.animationCache.prevKey={pos:0,rot:0,scl:0};f.animationCache.nextKey={pos:0,rot:0,scl:0};f.animationCache.originalMatrix=
|
|
f instanceof THREE.Bone?f.skinMatrix:f.matrix}var i=f.animationCache.prevKey;f=f.animationCache.nextKey;i.pos=this.data.hierarchy[c].keys[0];i.rot=this.data.hierarchy[c].keys[0];i.scl=this.data.hierarchy[c].keys[0];f.pos=this.getNextKeyWith("pos",c,1);f.rot=this.getNextKeyWith("rot",c,1);f.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
|
|
f instanceof THREE.Bone?f.skinMatrix:f.matrix}var i=f.animationCache.prevKey;f=f.animationCache.nextKey;i.pos=this.data.hierarchy[c].keys[0];i.rot=this.data.hierarchy[c].keys[0];i.scl=this.data.hierarchy[c].keys[0];f.pos=this.getNextKeyWith("pos",c,1);f.rot=this.getNextKeyWith("rot",c,1);f.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
|
|
THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
|
|
THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
|
|
THREE.Animation.prototype.stop=function(){this.isPlaying=!1;this.isPaused=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(this.hierarchy[a].animationCache!==undefined){if(this.hierarchy[a]instanceof THREE.Bone)this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix;else this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix;delete this.hierarchy[a].animationCache}};
|
|
THREE.Animation.prototype.stop=function(){this.isPlaying=!1;this.isPaused=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(this.hierarchy[a].animationCache!==undefined){if(this.hierarchy[a]instanceof THREE.Bone)this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix;else this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix;delete this.hierarchy[a].animationCache}};
|
|
-THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,e,f,i,j,p,n,s,z=this.data.JIT.hierarchy,A,D;this.currentTime+=a*this.timeScale;D=this.currentTime;A=this.currentTime%=this.data.length;s=parseInt(Math.min(A*this.data.fps,this.data.length*this.data.fps),10);for(var y=0,K=this.hierarchy.length;y<K;y++){a=this.hierarchy[y];n=a.animationCache;if(this.JITCompile&&z[y][s]!==undefined)if(a instanceof THREE.Bone){a.skinMatrix=z[y][s];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=
|
|
|
|
-!1}else{a.matrix=z[y][s];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=!0}else{if(this.JITCompile)if(a instanceof THREE.Bone)a.skinMatrix=a.animationCache.originalMatrix;else a.matrix=a.animationCache.originalMatrix;for(var I=0;I<3;I++){c=b[I];j=n.prevKey[c];p=n.nextKey[c];if(p.time<=D){if(A<D)if(this.loop){j=this.data.hierarchy[y].keys[0];for(p=this.getNextKeyWith(c,y,1);p.time<A;){j=p;p=this.getNextKeyWith(c,y,p.index+1)}}else{this.stop();return}else{do{j=p;p=this.getNextKeyWith(c,y,p.index+1)}while(p.time<
|
|
|
|
-A)}n.prevKey[c]=j;n.nextKey[c]=p}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;e=(A-j.time)/(p.time-j.time);f=j[c];i=p[c];if(e<0||e>1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+y);e=e<0?0:1}if(c==="pos"){c=a.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){c.x=f[0]+(i[0]-f[0])*e;c.y=f[1]+(i[1]-f[1])*e;c.z=f[2]+(i[2]-f[2])*e}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=
|
|
|
|
-this.getPrevKeyWith("pos",y,j.index-1).pos;this.points[1]=f;this.points[2]=i;this.points[3]=this.getNextKeyWith("pos",y,p.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];if(this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){e=this.interpolateCatmullRom(this.points,e*1.01);this.target.set(e[0],e[1],e[2]);this.target.subSelf(c);this.target.y=0;this.target.normalize();e=Math.atan2(this.target.x,this.target.z);a.rotation.set(0,e,0)}}}else if(c===
|
|
|
|
-"rot")THREE.Quaternion.slerp(f,i,a.quaternion,e);else if(c==="scl"){c=a.scale;c.x=f[0]+(i[0]-f[0])*e;c.y=f[1]+(i[1]-f[1])*e;c.z=f[2]+(i[2]-f[2])*e}}}}if(this.JITCompile&&z[0][s]===undefined){this.hierarchy[0].update(undefined,!0);for(y=0;y<this.hierarchy.length;y++)z[y][s]=this.hierarchy[y]instanceof THREE.Bone?this.hierarchy[y].skinMatrix.clone():this.hierarchy[y].matrix.clone()}}};
|
|
|
|
|
|
+THREE.Animation.prototype.update=function(a){if(this.isPlaying){var b=["pos","rot","scl"],c,e,f,i,j,p,n,s,y=this.data.JIT.hierarchy,A,D;this.currentTime+=a*this.timeScale;D=this.currentTime;A=this.currentTime%=this.data.length;s=parseInt(Math.min(A*this.data.fps,this.data.length*this.data.fps),10);for(var z=0,J=this.hierarchy.length;z<J;z++){a=this.hierarchy[z];n=a.animationCache;if(this.JITCompile&&y[z][s]!==undefined)if(a instanceof THREE.Bone){a.skinMatrix=y[z][s];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=
|
|
|
|
+!1}else{a.matrix=y[z][s];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=!0}else{if(this.JITCompile)if(a instanceof THREE.Bone)a.skinMatrix=a.animationCache.originalMatrix;else a.matrix=a.animationCache.originalMatrix;for(var K=0;K<3;K++){c=b[K];j=n.prevKey[c];p=n.nextKey[c];if(p.time<=D){if(A<D)if(this.loop){j=this.data.hierarchy[z].keys[0];for(p=this.getNextKeyWith(c,z,1);p.time<A;){j=p;p=this.getNextKeyWith(c,z,p.index+1)}}else{this.stop();return}else{do{j=p;p=this.getNextKeyWith(c,z,p.index+1)}while(p.time<
|
|
|
|
+A)}n.prevKey[c]=j;n.nextKey[c]=p}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;e=(A-j.time)/(p.time-j.time);f=j[c];i=p[c];if(e<0||e>1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+e+" on bone "+z);e=e<0?0:1}if(c==="pos"){c=a.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){c.x=f[0]+(i[0]-f[0])*e;c.y=f[1]+(i[1]-f[1])*e;c.z=f[2]+(i[2]-f[2])*e}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=
|
|
|
|
+this.getPrevKeyWith("pos",z,j.index-1).pos;this.points[1]=f;this.points[2]=i;this.points[3]=this.getNextKeyWith("pos",z,p.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];if(this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){e=this.interpolateCatmullRom(this.points,e*1.01);this.target.set(e[0],e[1],e[2]);this.target.subSelf(c);this.target.y=0;this.target.normalize();e=Math.atan2(this.target.x,this.target.z);a.rotation.set(0,e,0)}}}else if(c===
|
|
|
|
+"rot")THREE.Quaternion.slerp(f,i,a.quaternion,e);else if(c==="scl"){c=a.scale;c.x=f[0]+(i[0]-f[0])*e;c.y=f[1]+(i[1]-f[1])*e;c.z=f[2]+(i[2]-f[2])*e}}}}if(this.JITCompile&&y[0][s]===undefined){this.hierarchy[0].update(undefined,!0);for(z=0;z<this.hierarchy.length;z++)y[z][s]=this.hierarchy[z]instanceof THREE.Bone?this.hierarchy[z].skinMatrix.clone():this.hierarchy[z].matrix.clone()}}};
|
|
THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],e=[],f,i,j,p,n,s;f=(a.length-1)*b;i=Math.floor(f);f-=i;c[0]=i==0?i:i-1;c[1]=i;c[2]=i>a.length-2?i:i+1;c[3]=i>a.length-3?i:i+2;i=a[c[0]];p=a[c[1]];n=a[c[2]];s=a[c[3]];c=f*f;j=f*c;e[0]=this.interpolate(i[0],p[0],n[0],s[0],f,c,j);e[1]=this.interpolate(i[1],p[1],n[1],s[1],f,c,j);e[2]=this.interpolate(i[2],p[2],n[2],s[2],f,c,j);return e};
|
|
THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],e=[],f,i,j,p,n,s;f=(a.length-1)*b;i=Math.floor(f);f-=i;c[0]=i==0?i:i-1;c[1]=i;c[2]=i>a.length-2?i:i+1;c[3]=i>a.length-3?i:i+2;i=a[c[0]];p=a[c[1]];n=a[c[2]];s=a[c[3]];c=f*f;j=f*c;e[0]=this.interpolate(i[0],p[0],n[0],s[0],f,c,j);e[1]=this.interpolate(i[1],p[1],n[1],s[1],f,c,j);e[2]=this.interpolate(i[2],p[2],n[2],s[2],f,c,j);return e};
|
|
THREE.Animation.prototype.interpolate=function(a,b,c,e,f,i,j){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*j+(-3*(b-c)-2*a-e)*i+a*f+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)c=c<e.length-1?c:e.length-1;else c%=e.length;for(;c<e.length;c++)if(e[c][a]!==undefined)return e[c];return this.data.hierarchy[b].keys[0]};
|
|
THREE.Animation.prototype.interpolate=function(a,b,c,e,f,i,j){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*j+(-3*(b-c)-2*a-e)*i+a*f+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)c=c<e.length-1?c:e.length-1;else c%=e.length;for(;c<e.length;c++)if(e[c][a]!==undefined)return e[c];return this.data.hierarchy[b].keys[0]};
|
|
THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+e.length;c>=0;c--)if(e[c][a]!==undefined)return e[c];return this.data.hierarchy[b].keys[e.length-1]};
|
|
THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){var e=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+e.length;c>=0;c--)if(e[c][a]!==undefined)return e[c];return this.data.hierarchy[b].keys[e.length-1]};
|
|
@@ -139,16 +139,17 @@ THREE.LOD.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(b|=this.updat
|
|
THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1){this.objects.push(a);this.__objectsAdded.push(a)}for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
|
|
THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1){this.objects.push(a);this.__objectsAdded.push(a)}for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
|
|
THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else if(a instanceof THREE.Sound){b=this.sounds.indexOf(a);b!==-1&&this.sounds.splice(b,1)}else if(!(a instanceof THREE.Camera)){b=this.objects.indexOf(a);if(b!==-1){this.objects.splice(b,1);this.__objectsRemoved.push(a)}}for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};
|
|
THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else if(a instanceof THREE.Sound){b=this.sounds.indexOf(a);b!==-1&&this.sounds.splice(b,1)}else if(!(a instanceof THREE.Camera)){b=this.objects.indexOf(a);if(b!==-1){this.objects.splice(b,1);this.__objectsRemoved.push(a)}}for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};
|
|
THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(a,b,c){this.color=new THREE.Color(a);this.near=b||1;this.far=c||1E3};THREE.FogExp2=function(a,b){this.color=new THREE.Color(a);this.density=b!==undefined?b:2.5E-4};
|
|
THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(a,b,c){this.color=new THREE.Color(a);this.near=b||1;this.far=c||1E3};THREE.FogExp2=function(a,b){this.color=new THREE.Color(a);this.density=b!==undefined?b:2.5E-4};
|
|
-THREE.Projector=function(){function a(){var P=n[p]=n[p]||new THREE.RenderableVertex;p++;return P}function b(P,M){return M.z-P.z}function c(P,M){var ya=0,ka=1,na=P.z+P.w,oa=M.z+M.w,U=-P.z+P.w,ha=-M.z+M.w;if(na>=0&&oa>=0&&U>=0&&ha>=0)return!0;else if(na<0&&oa<0||U<0&&ha<0)return!1;else{if(na<0)ya=Math.max(ya,na/(na-oa));else oa<0&&(ka=Math.min(ka,na/(na-oa)));if(U<0)ya=Math.max(ya,U/(U-ha));else ha<0&&(ka=Math.min(ka,U/(U-ha)));if(ka<ya)return!1;else{P.lerpSelf(M,ya);M.lerpSelf(P,1-ka);return!0}}}var e,
|
|
|
|
-f,i=[],j,p,n=[],s,z,A=[],D,y,K=[],I,N,O=[],ja=new THREE.Vector4,R=new THREE.Vector4,B=new THREE.Matrix4,la=new THREE.Matrix4,T=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],ma=new THREE.Vector4,d=new THREE.Vector4;this.projectVector=function(P,M){B.multiply(M.projectionMatrix,M.matrixWorldInverse);B.multiplyVector3(P);return P};this.unprojectVector=function(P,M){B.multiply(THREE.Matrix4.makeInvert(M.projectionMatrix),M.matrixWorld);B.multiplyVector3(P);
|
|
|
|
-return P};this.projectObjects=function(P,M,ya){M=[];var ka,na,oa;f=0;na=P.objects;P=0;for(ka=na.length;P<ka;P++){oa=na[P];var U;if(!(U=!oa.visible))if(U=oa instanceof THREE.Mesh){a:{U=void 0;for(var ha=oa.matrixWorld,wa=-oa.geometry.boundingSphere.radius*Math.max(oa.scale.x,Math.max(oa.scale.y,oa.scale.z)),pa=0;pa<6;pa++){U=T[pa].x*ha.n14+T[pa].y*ha.n24+T[pa].z*ha.n34+T[pa].w;if(U<=wa){U=!1;break a}}U=!0}U=!U}if(!U){U=i[f]=i[f]||new THREE.RenderableObject;f++;e=U;ja.copy(oa.position);B.multiplyVector3(ja);
|
|
|
|
-e.object=oa;e.z=ja.z;M.push(e)}}ya&&M.sort(b);return M};this.projectScene=function(P,M,ya){var ka=[],na=M.near,oa=M.far,U,ha,wa,pa,X,ra,Aa,Ma,Ga,ia,Ka,Ta,Wa,Xa,g,m,o;N=y=z=0;M.matrixAutoUpdate&&M.updateMatrix();P.update(undefined,!1,M);B.multiply(M.projectionMatrix,M.matrixWorldInverse);T[0].set(B.n41-B.n11,B.n42-B.n12,B.n43-B.n13,B.n44-B.n14);T[1].set(B.n41+B.n11,B.n42+B.n12,B.n43+B.n13,B.n44+B.n14);T[2].set(B.n41+B.n21,B.n42+B.n22,B.n43+B.n23,B.n44+B.n24);T[3].set(B.n41-B.n21,B.n42-B.n22,B.n43-
|
|
|
|
-B.n23,B.n44-B.n24);T[4].set(B.n41-B.n31,B.n42-B.n32,B.n43-B.n33,B.n44-B.n34);T[5].set(B.n41+B.n31,B.n42+B.n32,B.n43+B.n33,B.n44+B.n34);for(U=0;U<6;U++){Ga=T[U];Ga.divideScalar(Math.sqrt(Ga.x*Ga.x+Ga.y*Ga.y+Ga.z*Ga.z))}Ga=this.projectObjects(P,M,!0);P=0;for(U=Ga.length;P<U;P++){ia=Ga[P].object;if(ia.visible){Ka=ia.matrixWorld;Ta=ia.matrixRotationWorld;Wa=ia.materials;Xa=ia.overdraw;p=0;if(ia instanceof THREE.Mesh){g=ia.geometry;pa=g.vertices;m=g.faces;g=g.faceVertexUvs;ha=0;for(wa=pa.length;ha<wa;ha++){j=
|
|
|
|
-a();j.positionWorld.copy(pa[ha].position);Ka.multiplyVector3(j.positionWorld);j.positionScreen.copy(j.positionWorld);B.multiplyVector4(j.positionScreen);j.positionScreen.x/=j.positionScreen.w;j.positionScreen.y/=j.positionScreen.w;j.visible=j.positionScreen.z>na&&j.positionScreen.z<oa}pa=0;for(ha=m.length;pa<ha;pa++){wa=m[pa];if(wa instanceof THREE.Face3){X=n[wa.a];ra=n[wa.b];Aa=n[wa.c];if(X.visible&&ra.visible&&Aa.visible&&(ia.doubleSided||ia.flipSided!=(Aa.positionScreen.x-X.positionScreen.x)*(ra.positionScreen.y-
|
|
|
|
-X.positionScreen.y)-(Aa.positionScreen.y-X.positionScreen.y)*(ra.positionScreen.x-X.positionScreen.x)<0)){Ma=A[z]=A[z]||new THREE.RenderableFace3;z++;s=Ma;s.v1.copy(X);s.v2.copy(ra);s.v3.copy(Aa);s.normalWorld.copy(wa.normal);Ta.multiplyVector3(s.normalWorld);s.centroidWorld.copy(wa.centroid);Ka.multiplyVector3(s.centroidWorld);s.centroidScreen.copy(s.centroidWorld);B.multiplyVector3(s.centroidScreen);Aa=wa.vertexNormals;X=0;for(ra=Aa.length;X<ra;X++){Ma=s.vertexNormalsWorld[X];Ma.copy(Aa[X]);Ta.multiplyVector3(Ma)}X=
|
|
|
|
-0;for(ra=g.length;X<ra;X++)if(o=g[X][pa]){Aa=0;for(Ma=o.length;Aa<Ma;Aa++)s.uvs[X][Aa]=o[Aa]}s.meshMaterials=Wa;s.faceMaterials=wa.materials;s.overdraw=Xa;s.z=s.centroidScreen.z;ka.push(s)}}}}else if(ia instanceof THREE.Line){la.multiply(B,Ka);pa=ia.geometry.vertices;X=a();X.positionScreen.copy(pa[0].position);la.multiplyVector4(X.positionScreen);ha=1;for(wa=pa.length;ha<wa;ha++){X=a();X.positionScreen.copy(pa[ha].position);la.multiplyVector4(X.positionScreen);ra=n[p-2];ma.copy(X.positionScreen);
|
|
|
|
-d.copy(ra.positionScreen);if(c(ma,d)){ma.multiplyScalar(1/ma.w);d.multiplyScalar(1/d.w);Ka=K[y]=K[y]||new THREE.RenderableLine;y++;D=Ka;D.v1.positionScreen.copy(ma);D.v2.positionScreen.copy(d);D.z=Math.max(ma.z,d.z);D.materials=ia.materials;ka.push(D)}}}else if(ia instanceof THREE.Particle){R.set(ia.position.x,ia.position.y,ia.position.z,1);B.multiplyVector4(R);R.z/=R.w;if(R.z>0&&R.z<1){Ka=O[N]=O[N]||new THREE.RenderableParticle;N++;I=Ka;I.x=R.x/R.w;I.y=R.y/R.w;I.z=R.z;I.rotation=ia.rotation.z;I.scale.x=
|
|
|
|
-ia.scale.x*Math.abs(I.x-(R.x+M.projectionMatrix.n11)/(R.w+M.projectionMatrix.n14));I.scale.y=ia.scale.y*Math.abs(I.y-(R.y+M.projectionMatrix.n22)/(R.w+M.projectionMatrix.n24));I.materials=ia.materials;ka.push(I)}}}}ya&&ka.sort(b);return ka}};
|
|
|
|
|
|
+THREE.Projector=function(){function a(){var Q=n[p]=n[p]||new THREE.RenderableVertex;p++;return Q}function b(Q,N){return N.z-Q.z}function c(Q,N){var ta=0,ua=1,Ba=Q.z+Q.w,ia=N.z+N.w,V=-Q.z+Q.w,ja=-N.z+N.w;if(Ba>=0&&ia>=0&&V>=0&&ja>=0)return!0;else if(Ba<0&&ia<0||V<0&&ja<0)return!1;else{if(Ba<0)ta=Math.max(ta,Ba/(Ba-ia));else ia<0&&(ua=Math.min(ua,Ba/(Ba-ia)));if(V<0)ta=Math.max(ta,V/(V-ja));else ja<0&&(ua=Math.min(ua,V/(V-ja)));if(ua<ta)return!1;else{Q.lerpSelf(N,ta);N.lerpSelf(Q,1-ua);return!0}}}var e,
|
|
|
|
+f,i=[],j,p,n=[],s,y,A=[],D,z=[],J,K,O=[],L,ha,ma=[],pa=new THREE.Vector4,R=new THREE.Vector4,B=new THREE.Matrix4,sa=new THREE.Matrix4,d=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Da=new THREE.Vector4,Aa=new THREE.Vector4;this.projectVector=function(Q,N){B.multiply(N.projectionMatrix,N.matrixWorldInverse);B.multiplyVector3(Q);return Q};this.unprojectVector=function(Q,N){B.multiply(N.matrixWorld,THREE.Matrix4.makeInvert(N.projectionMatrix));
|
|
|
|
+B.multiplyVector3(Q);return Q};this.projectObjects=function(Q,N,ta){N=[];var ua,Ba,ia;f=0;Ba=Q.objects;Q=0;for(ua=Ba.length;Q<ua;Q++){ia=Ba[Q];var V;if(!(V=!ia.visible))if(V=ia instanceof THREE.Mesh){a:{V=void 0;for(var ja=ia.matrixWorld,ka=-ia.geometry.boundingSphere.radius*Math.max(ia.scale.x,Math.max(ia.scale.y,ia.scale.z)),X=0;X<6;X++){V=d[X].x*ja.n14+d[X].y*ja.n24+d[X].z*ja.n34+d[X].w;if(V<=ka){V=!1;break a}}V=!0}V=!V}if(!V){V=i[f]=i[f]||new THREE.RenderableObject;f++;e=V;pa.copy(ia.position);
|
|
|
|
+B.multiplyVector3(pa);e.object=ia;e.z=pa.z;N.push(e)}}ta&&N.sort(b);return N};this.projectScene=function(Q,N,ta){var ua=[],Ba=N.near,ia=N.far,V,ja,ka,X,S,xa,na,ya,Ka,la,Na,Va,g,m,o,h,k;ha=K=D=y=0;N.matrixAutoUpdate&&N.updateMatrix();Q.update(undefined,!1,N);B.multiply(N.projectionMatrix,N.matrixWorldInverse);d[0].set(B.n41-B.n11,B.n42-B.n12,B.n43-B.n13,B.n44-B.n14);d[1].set(B.n41+B.n11,B.n42+B.n12,B.n43+B.n13,B.n44+B.n14);d[2].set(B.n41+B.n21,B.n42+B.n22,B.n43+B.n23,B.n44+B.n24);d[3].set(B.n41-B.n21,
|
|
|
|
+B.n42-B.n22,B.n43-B.n23,B.n44-B.n24);d[4].set(B.n41-B.n31,B.n42-B.n32,B.n43-B.n33,B.n44-B.n34);d[5].set(B.n41+B.n31,B.n42+B.n32,B.n43+B.n33,B.n44+B.n34);for(V=0;V<6;V++){Ka=d[V];Ka.divideScalar(Math.sqrt(Ka.x*Ka.x+Ka.y*Ka.y+Ka.z*Ka.z))}Ka=this.projectObjects(Q,N,!0);Q=0;for(V=Ka.length;Q<V;Q++){la=Ka[Q].object;if(la.visible){Na=la.matrixWorld;Va=la.matrixRotationWorld;g=la.materials;m=la.overdraw;p=0;if(la instanceof THREE.Mesh){o=la.geometry;X=o.vertices;h=o.faces;o=o.faceVertexUvs;ja=0;for(ka=X.length;ja<
|
|
|
|
+ka;ja++){j=a();j.positionWorld.copy(X[ja].position);Na.multiplyVector3(j.positionWorld);j.positionScreen.copy(j.positionWorld);B.multiplyVector4(j.positionScreen);j.positionScreen.x/=j.positionScreen.w;j.positionScreen.y/=j.positionScreen.w;j.visible=j.positionScreen.z>Ba&&j.positionScreen.z<ia}X=0;for(ja=h.length;X<ja;X++){ka=h[X];if(ka instanceof THREE.Face3){S=n[ka.a];xa=n[ka.b];na=n[ka.c];if(S.visible&&xa.visible&&na.visible&&(la.doubleSided||la.flipSided!=(na.positionScreen.x-S.positionScreen.x)*
|
|
|
|
+(xa.positionScreen.y-S.positionScreen.y)-(na.positionScreen.y-S.positionScreen.y)*(xa.positionScreen.x-S.positionScreen.x)<0)){ya=A[y]=A[y]||new THREE.RenderableFace3;y++;s=ya;s.v1.copy(S);s.v2.copy(xa);s.v3.copy(na)}else continue}else if(ka instanceof THREE.Face4){S=n[ka.a];xa=n[ka.b];na=n[ka.c];ya=n[ka.d];if(S.visible&&xa.visible&&na.visible&&ya.visible&&(la.doubleSided||la.flipSided!=((ya.positionScreen.x-S.positionScreen.x)*(xa.positionScreen.y-S.positionScreen.y)-(ya.positionScreen.y-S.positionScreen.y)*
|
|
|
|
+(xa.positionScreen.x-S.positionScreen.x)<0||(xa.positionScreen.x-na.positionScreen.x)*(ya.positionScreen.y-na.positionScreen.y)-(xa.positionScreen.y-na.positionScreen.y)*(ya.positionScreen.x-na.positionScreen.x)<0))){k=z[D]=z[D]||new THREE.RenderableFace4;D++;s=k;s.v1.copy(S);s.v2.copy(xa);s.v3.copy(na);s.v4.copy(ya)}else continue}s.normalWorld.copy(ka.normal);Va.multiplyVector3(s.normalWorld);s.centroidWorld.copy(ka.centroid);Na.multiplyVector3(s.centroidWorld);s.centroidScreen.copy(s.centroidWorld);
|
|
|
|
+B.multiplyVector3(s.centroidScreen);na=ka.vertexNormals;S=0;for(xa=na.length;S<xa;S++){ya=s.vertexNormalsWorld[S];ya.copy(na[S]);Va.multiplyVector3(ya)}S=0;for(xa=o.length;S<xa;S++)if(k=o[S][X]){na=0;for(ya=k.length;na<ya;na++)s.uvs[S][na]=k[na]}s.meshMaterials=g;s.faceMaterials=ka.materials;s.overdraw=m;s.z=s.centroidScreen.z;ua.push(s)}}else if(la instanceof THREE.Line){sa.multiply(B,Na);X=la.geometry.vertices;S=a();S.positionScreen.copy(X[0].position);sa.multiplyVector4(S.positionScreen);ja=1;
|
|
|
|
+for(ka=X.length;ja<ka;ja++){S=a();S.positionScreen.copy(X[ja].position);sa.multiplyVector4(S.positionScreen);xa=n[p-2];Da.copy(S.positionScreen);Aa.copy(xa.positionScreen);if(c(Da,Aa)){Da.multiplyScalar(1/Da.w);Aa.multiplyScalar(1/Aa.w);Na=O[K]=O[K]||new THREE.RenderableLine;K++;J=Na;J.v1.positionScreen.copy(Da);J.v2.positionScreen.copy(Aa);J.z=Math.max(Da.z,Aa.z);J.materials=la.materials;ua.push(J)}}}else if(la instanceof THREE.Particle){R.set(la.position.x,la.position.y,la.position.z,1);B.multiplyVector4(R);
|
|
|
|
+R.z/=R.w;if(R.z>0&&R.z<1){Na=ma[ha]=ma[ha]||new THREE.RenderableParticle;ha++;L=Na;L.x=R.x/R.w;L.y=R.y/R.w;L.z=R.z;L.rotation=la.rotation.z;L.scale.x=la.scale.x*Math.abs(L.x-(R.x+N.projectionMatrix.n11)/(R.w+N.projectionMatrix.n14));L.scale.y=la.scale.y*Math.abs(L.y-(R.y+N.projectionMatrix.n22)/(R.w+N.projectionMatrix.n24));L.materials=la.materials;ua.push(L)}}}}ta&&ua.sort(b);return ua}};
|
|
THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(a,b,c){c&&a.update(undefined,!1,b);c=a.sounds;var e,f=c.length;for(e=0;e<f;e++){a=c[e];this.soundPosition.set(a.matrixWorld.n14,a.matrixWorld.n24,a.matrixWorld.n34);this.soundPosition.subSelf(b.position);if(a.isPlaying&&a.isLoaded){a.isAddedToDOM||a.addToDOM(this.domElement);a.calculateVolumeAndPan(this.soundPosition)}}}};
|
|
THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(a,b,c){c&&a.update(undefined,!1,b);c=a.sounds;var e,f=c.length;for(e=0;e<f;e++){a=c[e];this.soundPosition.set(a.matrixWorld.n14,a.matrixWorld.n24,a.matrixWorld.n34);this.soundPosition.subSelf(b.position);if(a.isPlaying&&a.isLoaded){a.isAddedToDOM||a.addToDOM(this.domElement);a.calculateVolumeAndPan(this.soundPosition)}}}};
|
|
THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
|
|
THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
|
|
envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform int combine;\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",
|
|
envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform int combine;\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",
|
|
@@ -174,79 +175,79 @@ THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.
|
|
vertexShader:["#define PHONG\nvarying vec3 vLightWeighting;\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",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,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,
|
|
vertexShader:["#define PHONG\nvarying vec3 vLightWeighting;\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",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,"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 = cameraPosition - mPosition.xyz;\nvec3 transformedNormal = normalize( normalMatrix * normal );\nvNormal = transformedNormal;",THREE.ShaderChunk.lights_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsLib.particle,fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",
|
|
THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,"#ifndef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\n#endif\nvViewPosition = cameraPosition - mPosition.xyz;\nvec3 transformedNormal = normalize( normalMatrix * normal );\nvNormal = transformedNormal;",THREE.ShaderChunk.lights_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsLib.particle,fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",
|
|
THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_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;\n}"].join("\n")}};
|
|
THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_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;\n}"].join("\n")}};
|
|
-THREE.WebGLRenderer=function(a){function b(g,m,o){var h,k,t,q=g.vertices,r=q.length,E=g.colors,x=E.length,v=g.__vertexArray,L=g.__colorArray,V=g.__sortArray,H=g.__dirtyVertices,Q=g.__dirtyColors;if(o.sortParticles){Aa.multiplySelf(o.matrixWorld);for(h=0;h<r;h++){k=q[h].position;ia.copy(k);Aa.multiplyVector3(ia);V[h]=[ia.z,h]}V.sort(function(J,Y){return Y[0]-J[0]});for(h=0;h<r;h++){k=q[V[h][1]].position;t=h*3;v[t]=k.x;v[t+1]=k.y;v[t+2]=k.z}for(h=0;h<x;h++){t=h*3;color=E[V[h][1]];L[t]=color.r;L[t+1]=
|
|
|
|
-color.g;L[t+2]=color.b}}else{if(H)for(h=0;h<r;h++){k=q[h].position;t=h*3;v[t]=k.x;v[t+1]=k.y;v[t+2]=k.z}if(Q)for(h=0;h<x;h++){color=E[h];t=h*3;L[t]=color.r;L[t+1]=color.g;L[t+2]=color.b}}if(H||o.sortParticles){d.bindBuffer(d.ARRAY_BUFFER,g.__webGLVertexBuffer);d.bufferData(d.ARRAY_BUFFER,v,m)}if(Q||o.sortParticles){d.bindBuffer(d.ARRAY_BUFFER,g.__webGLColorBuffer);d.bufferData(d.ARRAY_BUFFER,L,m)}}function c(g,m){g.fragmentShader=m.fragmentShader;g.vertexShader=m.vertexShader;g.uniforms=Uniforms.clone(m.uniforms)}
|
|
|
|
-function e(g,m,o,h,k){h.program||ya.initMaterial(h,m,o,k);var t=h.program,q=t.uniforms,r=h.uniforms;if(t!=P){d.useProgram(t);P=t}d.uniformMatrix4fv(q.projectionMatrix,!1,Ma);if(o&&(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial||h instanceof THREE.LineBasicMaterial||h instanceof THREE.ParticleBasicMaterial)){r.fogColor.value.setHex(o.color.hex);if(o instanceof THREE.Fog){r.fogNear.value=o.near;r.fogFar.value=o.far}else if(o instanceof
|
|
|
|
-THREE.FogExp2)r.fogDensity.value=o.density}if(h instanceof THREE.MeshPhongMaterial||h instanceof THREE.MeshLambertMaterial||h.lights){var E,x,v=0,L=0,V=0,H,Q,J,Y=Ka,Ca=Y.directional.colors,S=Y.directional.positions,Z=Y.point.colors,w=Y.point.positions,xa=0,W=0;o=x=x=0;for(E=m.length;o<E;o++){x=m[o];H=x.color;Q=x.position;J=x.intensity;if(x instanceof THREE.AmbientLight){v+=H.r;L+=H.g;V+=H.b}else if(x instanceof THREE.DirectionalLight){x=xa*3;Ca[x]=H.r*J;Ca[x+1]=H.g*J;Ca[x+2]=H.b*J;S[x]=Q.x;S[x+1]=
|
|
|
|
-Q.y;S[x+2]=Q.z;xa+=1}else if(x instanceof THREE.PointLight){x=W*3;Z[x]=H.r*J;Z[x+1]=H.g*J;Z[x+2]=H.b*J;w[x]=Q.x;w[x+1]=Q.y;w[x+2]=Q.z;W+=1}}for(o=xa*3;o<Ca.length;o++)Ca[o]=0;for(o=W*3;o<Z.length;o++)Z[o]=0;Y.point.length=W;Y.directional.length=xa;Y.ambient[0]=v;Y.ambient[1]=L;Y.ambient[2]=V;m=Ka;r.enableLighting.value=m.directional.length+m.point.length;r.ambientLightColor.value=m.ambient;r.directionalLightColor.value=m.directional.colors;r.directionalLightDirection.value=m.directional.positions;
|
|
|
|
|
|
+THREE.WebGLRenderer=function(a){function b(g,m,o){var h,k,t,q=g.vertices,r=q.length,E=g.colors,x=E.length,v=g.__vertexArray,M=g.__colorArray,U=g.__sortArray,H=g.__dirtyVertices,P=g.__dirtyColors;if(o.sortParticles){S.multiplySelf(o.matrixWorld);for(h=0;h<r;h++){k=q[h].position;ya.copy(k);S.multiplyVector3(ya);U[h]=[ya.z,h]}U.sort(function(I,Y){return Y[0]-I[0]});for(h=0;h<r;h++){k=q[U[h][1]].position;t=h*3;v[t]=k.x;v[t+1]=k.y;v[t+2]=k.z}for(h=0;h<x;h++){t=h*3;color=E[U[h][1]];M[t]=color.r;M[t+1]=
|
|
|
|
+color.g;M[t+2]=color.b}}else{if(H)for(h=0;h<r;h++){k=q[h].position;t=h*3;v[t]=k.x;v[t+1]=k.y;v[t+2]=k.z}if(P)for(h=0;h<x;h++){color=E[h];t=h*3;M[t]=color.r;M[t+1]=color.g;M[t+2]=color.b}}if(H||o.sortParticles){d.bindBuffer(d.ARRAY_BUFFER,g.__webGLVertexBuffer);d.bufferData(d.ARRAY_BUFFER,v,m)}if(P||o.sortParticles){d.bindBuffer(d.ARRAY_BUFFER,g.__webGLColorBuffer);d.bufferData(d.ARRAY_BUFFER,M,m)}}function c(g,m){g.fragmentShader=m.fragmentShader;g.vertexShader=m.vertexShader;g.uniforms=Uniforms.clone(m.uniforms)}
|
|
|
|
+function e(g,m,o,h,k){h.program||Q.initMaterial(h,m,o,k);var t=h.program,q=t.uniforms,r=h.uniforms;if(t!=Da){d.useProgram(t);Da=t}d.uniformMatrix4fv(q.projectionMatrix,!1,xa);if(o&&(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial||h instanceof THREE.LineBasicMaterial||h instanceof THREE.ParticleBasicMaterial)){r.fogColor.value.setHex(o.color.hex);if(o instanceof THREE.Fog){r.fogNear.value=o.near;r.fogFar.value=o.far}else if(o instanceof
|
|
|
|
+THREE.FogExp2)r.fogDensity.value=o.density}if(h instanceof THREE.MeshPhongMaterial||h instanceof THREE.MeshLambertMaterial||h.lights){var E,x,v=0,M=0,U=0,H,P,I,Y=Ka,Fa=Y.directional.colors,T=Y.directional.positions,Z=Y.point.colors,w=Y.point.positions,za=0,W=0;o=x=x=0;for(E=m.length;o<E;o++){x=m[o];H=x.color;P=x.position;I=x.intensity;if(x instanceof THREE.AmbientLight){v+=H.r;M+=H.g;U+=H.b}else if(x instanceof THREE.DirectionalLight){x=za*3;Fa[x]=H.r*I;Fa[x+1]=H.g*I;Fa[x+2]=H.b*I;T[x]=P.x;T[x+1]=
|
|
|
|
+P.y;T[x+2]=P.z;za+=1}else if(x instanceof THREE.PointLight){x=W*3;Z[x]=H.r*I;Z[x+1]=H.g*I;Z[x+2]=H.b*I;w[x]=P.x;w[x+1]=P.y;w[x+2]=P.z;W+=1}}for(o=za*3;o<Fa.length;o++)Fa[o]=0;for(o=W*3;o<Z.length;o++)Z[o]=0;Y.point.length=W;Y.directional.length=za;Y.ambient[0]=v;Y.ambient[1]=M;Y.ambient[2]=U;m=Ka;r.enableLighting.value=m.directional.length+m.point.length;r.ambientLightColor.value=m.ambient;r.directionalLightColor.value=m.directional.colors;r.directionalLightDirection.value=m.directional.positions;
|
|
r.pointLightColor.value=m.point.colors;r.pointLightPosition.value=m.point.positions}if(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial){r.diffuse.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);r.opacity.value=h.opacity;r.map.texture=h.map;r.lightMap.texture=h.lightMap;r.envMap.texture=h.envMap;r.reflectivity.value=h.reflectivity;r.refractionRatio.value=h.refractionRatio;r.combine.value=h.combine;r.useRefract.value=
|
|
r.pointLightColor.value=m.point.colors;r.pointLightPosition.value=m.point.positions}if(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial){r.diffuse.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);r.opacity.value=h.opacity;r.map.texture=h.map;r.lightMap.texture=h.lightMap;r.envMap.texture=h.envMap;r.reflectivity.value=h.reflectivity;r.refractionRatio.value=h.refractionRatio;r.combine.value=h.combine;r.useRefract.value=
|
|
-h.envMap&&h.envMap.mapping instanceof THREE.CubeRefractionMapping}if(h instanceof THREE.LineBasicMaterial){r.diffuse.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);r.opacity.value=h.opacity}else if(h instanceof THREE.ParticleBasicMaterial){r.psColor.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);r.opacity.value=h.opacity;r.size.value=h.size;r.scale.value=ma.height/2;r.map.texture=h.map}else if(h instanceof THREE.MeshPhongMaterial){r.ambient.value.setRGB(h.ambient.r,
|
|
|
|
-h.ambient.g,h.ambient.b);r.specular.value.setRGB(h.specular.r,h.specular.g,h.specular.b);r.shininess.value=h.shininess}else if(h instanceof THREE.MeshDepthMaterial){r.mNear.value=g.near;r.mFar.value=g.far;r.opacity.value=h.opacity}else if(h instanceof THREE.MeshNormalMaterial)r.opacity.value=h.opacity;for(var Da in r)if(v=t.uniforms[Da]){o=r[Da];E=o.type;m=o.value;if(E=="i")d.uniform1i(v,m);else if(E=="f")d.uniform1f(v,m);else if(E=="fv1")d.uniform1fv(v,m);else if(E=="fv")d.uniform3fv(v,m);else if(E==
|
|
|
|
|
|
+h.envMap&&h.envMap.mapping instanceof THREE.CubeRefractionMapping}if(h instanceof THREE.LineBasicMaterial){r.diffuse.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);r.opacity.value=h.opacity}else if(h instanceof THREE.ParticleBasicMaterial){r.psColor.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);r.opacity.value=h.opacity;r.size.value=h.size;r.scale.value=sa.height/2;r.map.texture=h.map}else if(h instanceof THREE.MeshPhongMaterial){r.ambient.value.setRGB(h.ambient.r,
|
|
|
|
+h.ambient.g,h.ambient.b);r.specular.value.setRGB(h.specular.r,h.specular.g,h.specular.b);r.shininess.value=h.shininess}else if(h instanceof THREE.MeshDepthMaterial){r.mNear.value=g.near;r.mFar.value=g.far;r.opacity.value=h.opacity}else if(h instanceof THREE.MeshNormalMaterial)r.opacity.value=h.opacity;for(var Ga in r)if(v=t.uniforms[Ga]){o=r[Ga];E=o.type;m=o.value;if(E=="i")d.uniform1i(v,m);else if(E=="f")d.uniform1f(v,m);else if(E=="fv1")d.uniform1fv(v,m);else if(E=="fv")d.uniform3fv(v,m);else if(E==
|
|
"v2")d.uniform2f(v,m.x,m.y);else if(E=="v3")d.uniform3f(v,m.x,m.y,m.z);else if(E=="c")d.uniform3f(v,m.r,m.g,m.b);else if(E=="t"){d.uniform1i(v,m);if(o=o.texture)if(o.image instanceof Array&&o.image.length==6){if(o.image.length==6){if(o.needsUpdate){if(o.__wasSetOnce){d.bindTexture(d.TEXTURE_CUBE_MAP,o.image.__webGLTextureCube);for(E=0;E<6;++E)d.texSubImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+E,0,0,0,d.RGBA,d.UNSIGNED_BYTE,o.image[E])}else{o.image.__webGLTextureCube=d.createTexture();d.bindTexture(d.TEXTURE_CUBE_MAP,
|
|
"v2")d.uniform2f(v,m.x,m.y);else if(E=="v3")d.uniform3f(v,m.x,m.y,m.z);else if(E=="c")d.uniform3f(v,m.r,m.g,m.b);else if(E=="t"){d.uniform1i(v,m);if(o=o.texture)if(o.image instanceof Array&&o.image.length==6){if(o.image.length==6){if(o.needsUpdate){if(o.__wasSetOnce){d.bindTexture(d.TEXTURE_CUBE_MAP,o.image.__webGLTextureCube);for(E=0;E<6;++E)d.texSubImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+E,0,0,0,d.RGBA,d.UNSIGNED_BYTE,o.image[E])}else{o.image.__webGLTextureCube=d.createTexture();d.bindTexture(d.TEXTURE_CUBE_MAP,
|
|
-o.image.__webGLTextureCube);for(E=0;E<6;++E)d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+E,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,o.image[E]);o.__wasSetOnce=!0}ja(d.TEXTURE_CUBE_MAP,o,o.image[0]);d.bindTexture(d.TEXTURE_CUBE_MAP,null);o.needsUpdate=!1}d.activeTexture(d.TEXTURE0+m);d.bindTexture(d.TEXTURE_CUBE_MAP,o.image.__webGLTextureCube)}}else{if(o.needsUpdate){if(o.__wasSetOnce){d.bindTexture(d.TEXTURE_2D,o.__webGLTexture);d.texSubImage2D(d.TEXTURE_2D,0,0,0,d.RGBA,d.UNSIGNED_BYTE,o.image)}else{o.__webGLTexture=
|
|
|
|
-d.createTexture();d.bindTexture(d.TEXTURE_2D,o.__webGLTexture);d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,o.image);o.__wasSetOnce=!0}ja(d.TEXTURE_2D,o,o.image);d.bindTexture(d.TEXTURE_2D,null);o.needsUpdate=!1}d.activeTexture(d.TEXTURE0+m);d.bindTexture(d.TEXTURE_2D,o.__webGLTexture)}}}d.uniformMatrix4fv(q.modelViewMatrix,!1,k._modelViewMatrixArray);d.uniformMatrix3fv(q.normalMatrix,!1,k._normalMatrixArray);(h instanceof THREE.MeshShaderMaterial||h instanceof THREE.MeshPhongMaterial||
|
|
|
|
-h.envMap)&&d.uniform3f(q.cameraPosition,g.position.x,g.position.y,g.position.z);(h instanceof THREE.MeshShaderMaterial||h.envMap||h.skinning)&&d.uniformMatrix4fv(q.objectMatrix,!1,k._objectMatrixArray);(h instanceof THREE.MeshPhongMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshShaderMaterial||h.skinning)&&d.uniformMatrix4fv(q.viewMatrix,!1,Ga);if(h.skinning){d.uniformMatrix4fv(q.cameraInverseMatrix,!1,Ga);d.uniformMatrix4fv(q.boneGlobalMatrices,!1,k.boneMatrices)}return t}
|
|
|
|
|
|
+o.image.__webGLTextureCube);for(E=0;E<6;++E)d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+E,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,o.image[E]);o.__wasSetOnce=!0}ha(d.TEXTURE_CUBE_MAP,o,o.image[0]);d.bindTexture(d.TEXTURE_CUBE_MAP,null);o.needsUpdate=!1}d.activeTexture(d.TEXTURE0+m);d.bindTexture(d.TEXTURE_CUBE_MAP,o.image.__webGLTextureCube)}}else{if(o.needsUpdate){if(o.__wasSetOnce){d.bindTexture(d.TEXTURE_2D,o.__webGLTexture);d.texSubImage2D(d.TEXTURE_2D,0,0,0,d.RGBA,d.UNSIGNED_BYTE,o.image)}else{o.__webGLTexture=
|
|
|
|
+d.createTexture();d.bindTexture(d.TEXTURE_2D,o.__webGLTexture);d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,o.image);o.__wasSetOnce=!0}ha(d.TEXTURE_2D,o,o.image);d.bindTexture(d.TEXTURE_2D,null);o.needsUpdate=!1}d.activeTexture(d.TEXTURE0+m);d.bindTexture(d.TEXTURE_2D,o.__webGLTexture)}}}d.uniformMatrix4fv(q.modelViewMatrix,!1,k._modelViewMatrixArray);d.uniformMatrix3fv(q.normalMatrix,!1,k._normalMatrixArray);(h instanceof THREE.MeshShaderMaterial||h instanceof THREE.MeshPhongMaterial||
|
|
|
|
+h.envMap)&&d.uniform3f(q.cameraPosition,g.position.x,g.position.y,g.position.z);(h instanceof THREE.MeshShaderMaterial||h.envMap||h.skinning)&&d.uniformMatrix4fv(q.objectMatrix,!1,k._objectMatrixArray);(h instanceof THREE.MeshPhongMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshShaderMaterial||h.skinning)&&d.uniformMatrix4fv(q.viewMatrix,!1,na);if(h.skinning){d.uniformMatrix4fv(q.cameraInverseMatrix,!1,na);d.uniformMatrix4fv(q.boneGlobalMatrices,!1,k.boneMatrices)}return t}
|
|
function f(g,m,o,h,k,t){if(h.opacity!=0){g=e(g,m,o,h,t).attributes;if(h.morphTargets){m=h.program.attributes;t.morphTargetBase!==-1?d.bindBuffer(d.ARRAY_BUFFER,k.__webGLMorphTargetsBuffers[t.morphTargetBase]):d.bindBuffer(d.ARRAY_BUFFER,k.__webGLVertexBuffer);d.vertexAttribPointer(m.position,3,d.FLOAT,!1,0,0);if(t.morphTargetForcedOrder.length){o=0;for(var q=t.morphTargetForcedOrder,r=t.morphTargetInfluences;o<h.numSupportedMorphTargets&&o<q.length;){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLMorphTargetsBuffers[q[o]]);
|
|
function f(g,m,o,h,k,t){if(h.opacity!=0){g=e(g,m,o,h,t).attributes;if(h.morphTargets){m=h.program.attributes;t.morphTargetBase!==-1?d.bindBuffer(d.ARRAY_BUFFER,k.__webGLMorphTargetsBuffers[t.morphTargetBase]):d.bindBuffer(d.ARRAY_BUFFER,k.__webGLVertexBuffer);d.vertexAttribPointer(m.position,3,d.FLOAT,!1,0,0);if(t.morphTargetForcedOrder.length){o=0;for(var q=t.morphTargetForcedOrder,r=t.morphTargetInfluences;o<h.numSupportedMorphTargets&&o<q.length;){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLMorphTargetsBuffers[q[o]]);
|
|
-d.vertexAttribPointer(m["morphTarget"+o],3,d.FLOAT,!1,0,0);t.__webGLMorphTargetInfluences[o]=r[q[o]];o++}}else{q=[];var E=-1,x=0;r=t.morphTargetInfluences;var v,L=r.length;o=0;for(t.morphTargetBase!==-1&&(q[t.morphTargetBase]=!0);o<h.numSupportedMorphTargets;){for(v=0;v<L;v++)if(!q[v]&&r[v]>E){x=v;E=r[x]}d.bindBuffer(d.ARRAY_BUFFER,k.__webGLMorphTargetsBuffers[x]);d.vertexAttribPointer(m["morphTarget"+o],3,d.FLOAT,!1,0,0);t.__webGLMorphTargetInfluences[o]=E;q[x]=1;E=-1;o++}}d.uniform1fv(h.program.uniforms.morphTargetInfluences,
|
|
|
|
|
|
+d.vertexAttribPointer(m["morphTarget"+o],3,d.FLOAT,!1,0,0);t.__webGLMorphTargetInfluences[o]=r[q[o]];o++}}else{q=[];var E=-1,x=0;r=t.morphTargetInfluences;var v,M=r.length;o=0;for(t.morphTargetBase!==-1&&(q[t.morphTargetBase]=!0);o<h.numSupportedMorphTargets;){for(v=0;v<M;v++)if(!q[v]&&r[v]>E){x=v;E=r[x]}d.bindBuffer(d.ARRAY_BUFFER,k.__webGLMorphTargetsBuffers[x]);d.vertexAttribPointer(m["morphTarget"+o],3,d.FLOAT,!1,0,0);t.__webGLMorphTargetInfluences[o]=E;q[x]=1;E=-1;o++}}d.uniform1fv(h.program.uniforms.morphTargetInfluences,
|
|
t.__webGLMorphTargetInfluences)}else{d.bindBuffer(d.ARRAY_BUFFER,k.__webGLVertexBuffer);d.vertexAttribPointer(g.position,3,d.FLOAT,!1,0,0)}if(g.color>=0){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLColorBuffer);d.vertexAttribPointer(g.color,3,d.FLOAT,!1,0,0)}if(g.normal>=0){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLNormalBuffer);d.vertexAttribPointer(g.normal,3,d.FLOAT,!1,0,0)}if(g.tangent>=0){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLTangentBuffer);d.vertexAttribPointer(g.tangent,4,d.FLOAT,!1,0,0)}if(g.uv>=0)if(k.__webGLUVBuffer){d.bindBuffer(d.ARRAY_BUFFER,
|
|
t.__webGLMorphTargetInfluences)}else{d.bindBuffer(d.ARRAY_BUFFER,k.__webGLVertexBuffer);d.vertexAttribPointer(g.position,3,d.FLOAT,!1,0,0)}if(g.color>=0){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLColorBuffer);d.vertexAttribPointer(g.color,3,d.FLOAT,!1,0,0)}if(g.normal>=0){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLNormalBuffer);d.vertexAttribPointer(g.normal,3,d.FLOAT,!1,0,0)}if(g.tangent>=0){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLTangentBuffer);d.vertexAttribPointer(g.tangent,4,d.FLOAT,!1,0,0)}if(g.uv>=0)if(k.__webGLUVBuffer){d.bindBuffer(d.ARRAY_BUFFER,
|
|
k.__webGLUVBuffer);d.vertexAttribPointer(g.uv,2,d.FLOAT,!1,0,0);d.enableVertexAttribArray(g.uv)}else d.disableVertexAttribArray(g.uv);if(g.uv2>=0)if(k.__webGLUV2Buffer){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLUV2Buffer);d.vertexAttribPointer(g.uv2,2,d.FLOAT,!1,0,0);d.enableVertexAttribArray(g.uv2)}else d.disableVertexAttribArray(g.uv2);if(h.skinning&&g.skinVertexA>=0&&g.skinVertexB>=0&&g.skinIndex>=0&&g.skinWeight>=0){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLSkinVertexABuffer);d.vertexAttribPointer(g.skinVertexA,
|
|
k.__webGLUVBuffer);d.vertexAttribPointer(g.uv,2,d.FLOAT,!1,0,0);d.enableVertexAttribArray(g.uv)}else d.disableVertexAttribArray(g.uv);if(g.uv2>=0)if(k.__webGLUV2Buffer){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLUV2Buffer);d.vertexAttribPointer(g.uv2,2,d.FLOAT,!1,0,0);d.enableVertexAttribArray(g.uv2)}else d.disableVertexAttribArray(g.uv2);if(h.skinning&&g.skinVertexA>=0&&g.skinVertexB>=0&&g.skinIndex>=0&&g.skinWeight>=0){d.bindBuffer(d.ARRAY_BUFFER,k.__webGLSkinVertexABuffer);d.vertexAttribPointer(g.skinVertexA,
|
|
4,d.FLOAT,!1,0,0);d.bindBuffer(d.ARRAY_BUFFER,k.__webGLSkinVertexBBuffer);d.vertexAttribPointer(g.skinVertexB,4,d.FLOAT,!1,0,0);d.bindBuffer(d.ARRAY_BUFFER,k.__webGLSkinIndicesBuffer);d.vertexAttribPointer(g.skinIndex,4,d.FLOAT,!1,0,0);d.bindBuffer(d.ARRAY_BUFFER,k.__webGLSkinWeightsBuffer);d.vertexAttribPointer(g.skinWeight,4,d.FLOAT,!1,0,0)}if(t instanceof THREE.Mesh)if(h.wireframe){d.lineWidth(h.wireframeLinewidth);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,k.__webGLLineBuffer);d.drawElements(d.LINES,
|
|
4,d.FLOAT,!1,0,0);d.bindBuffer(d.ARRAY_BUFFER,k.__webGLSkinVertexBBuffer);d.vertexAttribPointer(g.skinVertexB,4,d.FLOAT,!1,0,0);d.bindBuffer(d.ARRAY_BUFFER,k.__webGLSkinIndicesBuffer);d.vertexAttribPointer(g.skinIndex,4,d.FLOAT,!1,0,0);d.bindBuffer(d.ARRAY_BUFFER,k.__webGLSkinWeightsBuffer);d.vertexAttribPointer(g.skinWeight,4,d.FLOAT,!1,0,0)}if(t instanceof THREE.Mesh)if(h.wireframe){d.lineWidth(h.wireframeLinewidth);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,k.__webGLLineBuffer);d.drawElements(d.LINES,
|
|
k.__webGLLineCount,d.UNSIGNED_SHORT,0)}else{d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,k.__webGLFaceBuffer);d.drawElements(d.TRIANGLES,k.__webGLFaceCount,d.UNSIGNED_SHORT,0)}else if(t instanceof THREE.Line){t=t.type==THREE.LineStrip?d.LINE_STRIP:d.LINES;d.lineWidth(h.linewidth);d.drawArrays(t,0,k.__webGLLineCount)}else if(t instanceof THREE.ParticleSystem)d.drawArrays(d.POINTS,0,k.__webGLParticleCount);else t instanceof THREE.Ribbon&&d.drawArrays(d.TRIANGLE_STRIP,0,k.__webGLVertexCount)}}function i(g,m){if(!g.__webGLVertexBuffer)g.__webGLVertexBuffer=
|
|
k.__webGLLineCount,d.UNSIGNED_SHORT,0)}else{d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,k.__webGLFaceBuffer);d.drawElements(d.TRIANGLES,k.__webGLFaceCount,d.UNSIGNED_SHORT,0)}else if(t instanceof THREE.Line){t=t.type==THREE.LineStrip?d.LINE_STRIP:d.LINES;d.lineWidth(h.linewidth);d.drawArrays(t,0,k.__webGLLineCount)}else if(t instanceof THREE.ParticleSystem)d.drawArrays(d.POINTS,0,k.__webGLParticleCount);else t instanceof THREE.Ribbon&&d.drawArrays(d.TRIANGLE_STRIP,0,k.__webGLVertexCount)}}function i(g,m){if(!g.__webGLVertexBuffer)g.__webGLVertexBuffer=
|
|
d.createBuffer();if(!g.__webGLNormalBuffer)g.__webGLNormalBuffer=d.createBuffer();if(g.hasPos){d.bindBuffer(d.ARRAY_BUFFER,g.__webGLVertexBuffer);d.bufferData(d.ARRAY_BUFFER,g.positionArray,d.DYNAMIC_DRAW);d.enableVertexAttribArray(m.attributes.position);d.vertexAttribPointer(m.attributes.position,3,d.FLOAT,!1,0,0)}if(g.hasNormal){d.bindBuffer(d.ARRAY_BUFFER,g.__webGLNormalBuffer);d.bufferData(d.ARRAY_BUFFER,g.normalArray,d.DYNAMIC_DRAW);d.enableVertexAttribArray(m.attributes.normal);d.vertexAttribPointer(m.attributes.normal,
|
|
d.createBuffer();if(!g.__webGLNormalBuffer)g.__webGLNormalBuffer=d.createBuffer();if(g.hasPos){d.bindBuffer(d.ARRAY_BUFFER,g.__webGLVertexBuffer);d.bufferData(d.ARRAY_BUFFER,g.positionArray,d.DYNAMIC_DRAW);d.enableVertexAttribArray(m.attributes.position);d.vertexAttribPointer(m.attributes.position,3,d.FLOAT,!1,0,0)}if(g.hasNormal){d.bindBuffer(d.ARRAY_BUFFER,g.__webGLNormalBuffer);d.bufferData(d.ARRAY_BUFFER,g.normalArray,d.DYNAMIC_DRAW);d.enableVertexAttribArray(m.attributes.normal);d.vertexAttribPointer(m.attributes.normal,
|
|
-3,d.FLOAT,!1,0,0)}d.drawArrays(d.TRIANGLES,0,g.count);g.count=0}function j(g){if(ka!=g.doubleSided){g.doubleSided?d.disable(d.CULL_FACE):d.enable(d.CULL_FACE);ka=g.doubleSided}if(na!=g.flipSided){g.flipSided?d.frontFace(d.CW):d.frontFace(d.CCW);na=g.flipSided}}function p(g){if(U!=g){g?d.enable(d.DEPTH_TEST):d.disable(d.DEPTH_TEST);U=g}}function n(g){ra[0].set(g.n41-g.n11,g.n42-g.n12,g.n43-g.n13,g.n44-g.n14);ra[1].set(g.n41+g.n11,g.n42+g.n12,g.n43+g.n13,g.n44+g.n14);ra[2].set(g.n41+g.n21,g.n42+g.n22,
|
|
|
|
-g.n43+g.n23,g.n44+g.n24);ra[3].set(g.n41-g.n21,g.n42-g.n22,g.n43-g.n23,g.n44-g.n24);ra[4].set(g.n41-g.n31,g.n42-g.n32,g.n43-g.n33,g.n44-g.n34);ra[5].set(g.n41+g.n31,g.n42+g.n32,g.n43+g.n33,g.n44+g.n34);var m;for(g=0;g<6;g++){m=ra[g];m.divideScalar(Math.sqrt(m.x*m.x+m.y*m.y+m.z*m.z))}}function s(g){for(var m=g.matrixWorld,o=-g.geometry.boundingSphere.radius*Math.max(g.scale.x,Math.max(g.scale.y,g.scale.z)),h=0;h<6;h++){g=ra[h].x*m.n14+ra[h].y*m.n24+ra[h].z*m.n34+ra[h].w;if(g<=o)return!1}return!0}function z(g,
|
|
|
|
-m){g.list[g.count]=m;g.count+=1}function A(g){var m,o,h=g.object,k=g.opaque,t=g.transparent;t.count=0;g=k.count=0;for(m=h.materials.length;g<m;g++){o=h.materials[g];o.opacity&&o.opacity<1||o.blending!=THREE.NormalBlending?z(t,o):z(k,o)}}function D(g){var m,o,h,k,t=g.object,q=g.buffer,r=g.opaque,E=g.transparent;E.count=0;g=r.count=0;for(h=t.materials.length;g<h;g++){m=t.materials[g];if(m instanceof THREE.MeshFaceMaterial){m=0;for(o=q.materials.length;m<o;m++)(k=q.materials[m])&&(k.opacity&&k.opacity<
|
|
|
|
-1||k.blending!=THREE.NormalBlending?z(E,k):z(r,k))}else{k=m;k.opacity&&k.opacity<1||k.blending!=THREE.NormalBlending?z(E,k):z(r,k)}}}function y(g,m){return m.z-g.z}function K(g,m){g._modelViewMatrix.multiplyToArray(m.matrixWorldInverse,g.matrixWorld,g._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(g._modelViewMatrix).transposeIntoArray(g._normalMatrixArray)}function I(g){function m(V){var H=[];o=0;for(h=V.length;o<h;o++)V[o]==undefined?H.push("undefined"):H.push(V[o].id);return H.join("_")}var o,
|
|
|
|
-h,k,t,q,r,E,x,v={},L=g.morphTargets!==undefined?g.morphTargets.length:0;g.geometryGroups={};k=0;for(t=g.faces.length;k<t;k++){q=g.faces[k];r=q.materials;E=m(r);v[E]==undefined&&(v[E]={hash:E,counter:0});x=v[E].hash+"_"+v[E].counter;g.geometryGroups[x]==undefined&&(g.geometryGroups[x]={faces:[],materials:r,vertices:0,numMorphTargets:L});q=q instanceof THREE.Face3?3:4;if(g.geometryGroups[x].vertices+q>65535){v[E].counter+=1;x=v[E].hash+"_"+v[E].counter;g.geometryGroups[x]==undefined&&(g.geometryGroups[x]=
|
|
|
|
-{faces:[],materials:r,vertices:0,numMorphTargets:L})}g.geometryGroups[x].faces.push(k);g.geometryGroups[x].vertices+=q}}function N(g,m,o){g.push({buffer:m,object:o,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function O(g){if(g!=oa){switch(g){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ONE,d.ONE);break;case THREE.SubtractiveBlending:d.blendFunc(d.DST_COLOR,d.ZERO);break;case THREE.BillboardBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);
|
|
|
|
-break;case THREE.ReverseSubtractiveBlending:d.blendEquation(d.FUNC_REVERSE_SUBTRACT);d.blendFunc(d.ONE,d.ONE);break;default:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ONE,d.ONE_MINUS_SRC_ALPHA)}oa=g}}function ja(g,m,o){if((o.width&o.width-1)==0&&(o.height&o.height-1)==0){d.texParameteri(g,d.TEXTURE_WRAP_S,T(m.wrapS));d.texParameteri(g,d.TEXTURE_WRAP_T,T(m.wrapT));d.texParameteri(g,d.TEXTURE_MAG_FILTER,T(m.magFilter));d.texParameteri(g,d.TEXTURE_MIN_FILTER,T(m.minFilter));d.generateMipmap(g)}else{d.texParameteri(g,
|
|
|
|
-d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE);d.texParameteri(g,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE);d.texParameteri(g,d.TEXTURE_MAG_FILTER,la(m.magFilter));d.texParameteri(g,d.TEXTURE_MIN_FILTER,la(m.minFilter))}}function R(g){if(g&&!g.__webGLFramebuffer){g.__webGLFramebuffer=d.createFramebuffer();g.__webGLRenderbuffer=d.createRenderbuffer();g.__webGLTexture=d.createTexture();d.bindRenderbuffer(d.RENDERBUFFER,g.__webGLRenderbuffer);d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,g.width,g.height);d.bindTexture(d.TEXTURE_2D,
|
|
|
|
-g.__webGLTexture);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,T(g.wrapS));d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,T(g.wrapT));d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,T(g.magFilter));d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,T(g.minFilter));d.texImage2D(d.TEXTURE_2D,0,T(g.format),g.width,g.height,0,T(g.format),T(g.type),null);d.bindFramebuffer(d.FRAMEBUFFER,g.__webGLFramebuffer);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,g.__webGLTexture,0);d.framebufferRenderbuffer(d.FRAMEBUFFER,
|
|
|
|
-d.DEPTH_ATTACHMENT,d.RENDERBUFFER,g.__webGLRenderbuffer);d.bindTexture(d.TEXTURE_2D,null);d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}var m,o;if(g){m=g.__webGLFramebuffer;o=g.width;g=g.height}else{m=null;o=pa;g=X}if(m!=M){d.bindFramebuffer(d.FRAMEBUFFER,m);d.viewport(ha,wa,o,g);M=m}}function B(g,m){var o;if(g=="fragment")o=d.createShader(d.FRAGMENT_SHADER);else g=="vertex"&&(o=d.createShader(d.VERTEX_SHADER));d.shaderSource(o,m);d.compileShader(o);if(!d.getShaderParameter(o,
|
|
|
|
-d.COMPILE_STATUS)){console.error(d.getShaderInfoLog(o));console.error(m);return null}return o}function la(g){switch(g){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST;case THREE.LinearFilter:case THREE.LinearMipMapNearestFilter:case THREE.LinearMipMapLinearFilter:return d.LINEAR}}function T(g){switch(g){case THREE.RepeatWrapping:return d.REPEAT;case THREE.ClampToEdgeWrapping:return d.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return d.MIRRORED_REPEAT;
|
|
|
|
|
|
+3,d.FLOAT,!1,0,0)}d.drawArrays(d.TRIANGLES,0,g.count);g.count=0}function j(g){if(N!=g.doubleSided){g.doubleSided?d.disable(d.CULL_FACE):d.enable(d.CULL_FACE);N=g.doubleSided}if(ta!=g.flipSided){g.flipSided?d.frontFace(d.CW):d.frontFace(d.CCW);ta=g.flipSided}}function p(g){if(Ba!=g){g?d.enable(d.DEPTH_TEST):d.disable(d.DEPTH_TEST);Ba=g}}function n(g){X[0].set(g.n41-g.n11,g.n42-g.n12,g.n43-g.n13,g.n44-g.n14);X[1].set(g.n41+g.n11,g.n42+g.n12,g.n43+g.n13,g.n44+g.n14);X[2].set(g.n41+g.n21,g.n42+g.n22,
|
|
|
|
+g.n43+g.n23,g.n44+g.n24);X[3].set(g.n41-g.n21,g.n42-g.n22,g.n43-g.n23,g.n44-g.n24);X[4].set(g.n41-g.n31,g.n42-g.n32,g.n43-g.n33,g.n44-g.n34);X[5].set(g.n41+g.n31,g.n42+g.n32,g.n43+g.n33,g.n44+g.n34);var m;for(g=0;g<6;g++){m=X[g];m.divideScalar(Math.sqrt(m.x*m.x+m.y*m.y+m.z*m.z))}}function s(g){for(var m=g.matrixWorld,o=-g.geometry.boundingSphere.radius*Math.max(g.scale.x,Math.max(g.scale.y,g.scale.z)),h=0;h<6;h++){g=X[h].x*m.n14+X[h].y*m.n24+X[h].z*m.n34+X[h].w;if(g<=o)return!1}return!0}function y(g,
|
|
|
|
+m){g.list[g.count]=m;g.count+=1}function A(g){var m,o,h=g.object,k=g.opaque,t=g.transparent;t.count=0;g=k.count=0;for(m=h.materials.length;g<m;g++){o=h.materials[g];o.opacity&&o.opacity<1||o.blending!=THREE.NormalBlending?y(t,o):y(k,o)}}function D(g){var m,o,h,k,t=g.object,q=g.buffer,r=g.opaque,E=g.transparent;E.count=0;g=r.count=0;for(h=t.materials.length;g<h;g++){m=t.materials[g];if(m instanceof THREE.MeshFaceMaterial){m=0;for(o=q.materials.length;m<o;m++)(k=q.materials[m])&&(k.opacity&&k.opacity<
|
|
|
|
+1||k.blending!=THREE.NormalBlending?y(E,k):y(r,k))}else{k=m;k.opacity&&k.opacity<1||k.blending!=THREE.NormalBlending?y(E,k):y(r,k)}}}function z(g,m){return m.z-g.z}function J(g,m){g._modelViewMatrix.multiplyToArray(m.matrixWorldInverse,g.matrixWorld,g._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(g._modelViewMatrix).transposeIntoArray(g._normalMatrixArray)}function K(g){function m(U){var H=[];o=0;for(h=U.length;o<h;o++)U[o]==undefined?H.push("undefined"):H.push(U[o].id);return H.join("_")}var o,
|
|
|
|
+h,k,t,q,r,E,x,v={},M=g.morphTargets!==undefined?g.morphTargets.length:0;g.geometryGroups={};k=0;for(t=g.faces.length;k<t;k++){q=g.faces[k];r=q.materials;E=m(r);v[E]==undefined&&(v[E]={hash:E,counter:0});x=v[E].hash+"_"+v[E].counter;g.geometryGroups[x]==undefined&&(g.geometryGroups[x]={faces:[],materials:r,vertices:0,numMorphTargets:M});q=q instanceof THREE.Face3?3:4;if(g.geometryGroups[x].vertices+q>65535){v[E].counter+=1;x=v[E].hash+"_"+v[E].counter;g.geometryGroups[x]==undefined&&(g.geometryGroups[x]=
|
|
|
|
+{faces:[],materials:r,vertices:0,numMorphTargets:M})}g.geometryGroups[x].faces.push(k);g.geometryGroups[x].vertices+=q}}function O(g,m,o){g.push({buffer:m,object:o,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function L(g){if(g!=ua){switch(g){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ONE,d.ONE);break;case THREE.SubtractiveBlending:d.blendFunc(d.DST_COLOR,d.ZERO);break;case THREE.BillboardBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);
|
|
|
|
+break;case THREE.ReverseSubtractiveBlending:d.blendEquation(d.FUNC_REVERSE_SUBTRACT);d.blendFunc(d.ONE,d.ONE);break;default:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ONE,d.ONE_MINUS_SRC_ALPHA)}ua=g}}function ha(g,m,o){if((o.width&o.width-1)==0&&(o.height&o.height-1)==0){d.texParameteri(g,d.TEXTURE_WRAP_S,B(m.wrapS));d.texParameteri(g,d.TEXTURE_WRAP_T,B(m.wrapT));d.texParameteri(g,d.TEXTURE_MAG_FILTER,B(m.magFilter));d.texParameteri(g,d.TEXTURE_MIN_FILTER,B(m.minFilter));d.generateMipmap(g)}else{d.texParameteri(g,
|
|
|
|
+d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE);d.texParameteri(g,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE);d.texParameteri(g,d.TEXTURE_MAG_FILTER,R(m.magFilter));d.texParameteri(g,d.TEXTURE_MIN_FILTER,R(m.minFilter))}}function ma(g){if(g&&!g.__webGLFramebuffer){g.__webGLFramebuffer=d.createFramebuffer();g.__webGLRenderbuffer=d.createRenderbuffer();g.__webGLTexture=d.createTexture();d.bindRenderbuffer(d.RENDERBUFFER,g.__webGLRenderbuffer);d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,g.width,g.height);d.bindTexture(d.TEXTURE_2D,
|
|
|
|
+g.__webGLTexture);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,B(g.wrapS));d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,B(g.wrapT));d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,B(g.magFilter));d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,B(g.minFilter));d.texImage2D(d.TEXTURE_2D,0,B(g.format),g.width,g.height,0,B(g.format),B(g.type),null);d.bindFramebuffer(d.FRAMEBUFFER,g.__webGLFramebuffer);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,g.__webGLTexture,0);d.framebufferRenderbuffer(d.FRAMEBUFFER,
|
|
|
|
+d.DEPTH_ATTACHMENT,d.RENDERBUFFER,g.__webGLRenderbuffer);d.bindTexture(d.TEXTURE_2D,null);d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}var m,o;if(g){m=g.__webGLFramebuffer;o=g.width;g=g.height}else{m=null;o=ja;g=ka}if(m!=Aa){d.bindFramebuffer(d.FRAMEBUFFER,m);d.viewport(ia,V,o,g);Aa=m}}function pa(g,m){var o;if(g=="fragment")o=d.createShader(d.FRAGMENT_SHADER);else g=="vertex"&&(o=d.createShader(d.VERTEX_SHADER));d.shaderSource(o,m);d.compileShader(o);if(!d.getShaderParameter(o,
|
|
|
|
+d.COMPILE_STATUS)){console.error(d.getShaderInfoLog(o));console.error(m);return null}return o}function R(g){switch(g){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST;case THREE.LinearFilter:case THREE.LinearMipMapNearestFilter:case THREE.LinearMipMapLinearFilter:return d.LINEAR}}function B(g){switch(g){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.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 ma=document.createElement("canvas"),d,P=null,M=null,ya=this,ka=null,na=null,oa=null,U=null,ha=0,wa=0,pa=0,X=0,ra=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,
|
|
|
|
-new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Aa=new THREE.Matrix4,Ma=new Float32Array(16),Ga=new Float32Array(16),ia=new THREE.Vector4,Ka={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[]}},Ta=!0,Wa=new THREE.Color(0),Xa=0;if(a){if(a.antialias!==undefined)Ta=a.antialias;a.clearColor!==undefined&&Wa.setHex(a.clearColor);if(a.clearAlpha!==undefined)Xa=a.clearAlpha}this.maxMorphTargets=8;this.domElement=ma;this.autoClear=!0;this.sortObjects=
|
|
|
|
-!0;(function(g,m,o){try{if(!(d=ma.getContext("experimental-webgl",{antialias:g})))throw"Error creating WebGL context.";}catch(h){console.error(h)}d.clearColor(0,0,0,1);d.clearDepth(1);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.blendFunc(d.ONE,d.ONE_MINUS_SRC_ALPHA);d.clearColor(m.r,m.g,m.b,o);_cullEnabled=!0})(Ta,Wa,Xa);this.context=d;this.setSize=function(g,m){ma.width=g;ma.height=m;this.setViewport(0,0,ma.width,ma.height)};
|
|
|
|
-this.setViewport=function(g,m,o,h){ha=g;wa=m;pa=o;X=h;d.viewport(ha,wa,pa,X)};this.setScissor=function(g,m,o,h){d.scissor(g,m,o,h)};this.enableScissorTest=function(g){g?d.enable(d.SCISSOR_TEST):d.disable(d.SCISSOR_TEST)};this.enableDepthBufferWrite=function(g){d.depthMask(g)};this.setClearColorHex=function(g,m){var o=new THREE.Color(g);d.clearColor(o.r,o.g,o.b,m)};this.setClearColor=function(g,m){d.clearColor(g.r,g.g,g.b,m)};this.clear=function(){d.clear(d.COLOR_BUFFER_BIT|d.DEPTH_BUFFER_BIT)};this.initMaterial=
|
|
|
|
|
|
+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 sa=document.createElement("canvas"),d,Da=null,Aa=null,Q=this,N=null,ta=null,ua=null,Ba=null,ia=0,V=0,ja=0,ka=0,X=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,
|
|
|
|
+new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],S=new THREE.Matrix4,xa=new Float32Array(16),na=new Float32Array(16),ya=new THREE.Vector4,Ka={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[]}},la=!0,Na=new THREE.Color(0),Va=0;if(a){if(a.antialias!==undefined)la=a.antialias;a.clearColor!==undefined&&Na.setHex(a.clearColor);if(a.clearAlpha!==undefined)Va=a.clearAlpha}this.maxMorphTargets=8;this.domElement=sa;this.autoClear=!0;this.sortObjects=
|
|
|
|
+!0;(function(g,m,o){try{if(!(d=sa.getContext("experimental-webgl",{antialias:g})))throw"Error creating WebGL context.";}catch(h){console.error(h)}d.clearColor(0,0,0,1);d.clearDepth(1);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.blendFunc(d.ONE,d.ONE_MINUS_SRC_ALPHA);d.clearColor(m.r,m.g,m.b,o);_cullEnabled=!0})(la,Na,Va);this.context=d;this.setSize=function(g,m){sa.width=g;sa.height=m;this.setViewport(0,0,sa.width,sa.height)};
|
|
|
|
+this.setViewport=function(g,m,o,h){ia=g;V=m;ja=o;ka=h;d.viewport(ia,V,ja,ka)};this.setScissor=function(g,m,o,h){d.scissor(g,m,o,h)};this.enableScissorTest=function(g){g?d.enable(d.SCISSOR_TEST):d.disable(d.SCISSOR_TEST)};this.enableDepthBufferWrite=function(g){d.depthMask(g)};this.setClearColorHex=function(g,m){var o=new THREE.Color(g);d.clearColor(o.r,o.g,o.b,m)};this.setClearColor=function(g,m){d.clearColor(g.r,g.g,g.b,m)};this.clear=function(){d.clear(d.COLOR_BUFFER_BIT|d.DEPTH_BUFFER_BIT)};this.initMaterial=
|
|
function(g,m,o,h){var k,t,q;if(g instanceof THREE.MeshDepthMaterial)c(g,THREE.ShaderLib.depth);else if(g instanceof THREE.MeshNormalMaterial)c(g,THREE.ShaderLib.normal);else if(g instanceof THREE.MeshBasicMaterial)c(g,THREE.ShaderLib.basic);else if(g instanceof THREE.MeshLambertMaterial)c(g,THREE.ShaderLib.lambert);else if(g instanceof THREE.MeshPhongMaterial)c(g,THREE.ShaderLib.phong);else if(g instanceof THREE.LineBasicMaterial)c(g,THREE.ShaderLib.basic);else g instanceof THREE.ParticleBasicMaterial&&
|
|
function(g,m,o,h){var k,t,q;if(g instanceof THREE.MeshDepthMaterial)c(g,THREE.ShaderLib.depth);else if(g instanceof THREE.MeshNormalMaterial)c(g,THREE.ShaderLib.normal);else if(g instanceof THREE.MeshBasicMaterial)c(g,THREE.ShaderLib.basic);else if(g instanceof THREE.MeshLambertMaterial)c(g,THREE.ShaderLib.lambert);else if(g instanceof THREE.MeshPhongMaterial)c(g,THREE.ShaderLib.phong);else if(g instanceof THREE.LineBasicMaterial)c(g,THREE.ShaderLib.basic);else g instanceof THREE.ParticleBasicMaterial&&
|
|
c(g,THREE.ShaderLib.particle_basic);var r,E,x,v;q=x=v=0;for(r=m.length;q<r;q++){E=m[q];E instanceof THREE.DirectionalLight&&x++;E instanceof THREE.PointLight&&v++}if(v+x<=4)m=x;else{m=Math.ceil(4*x/(v+x));v=4-m}q={directional:m,point:v};r=50;if(h!==undefined&&h instanceof THREE.SkinnedMesh)r=h.bones.length;v=g.fragmentShader;m=g.vertexShader;r={fog:o,map:g.map,envMap:g.envMap,lightMap:g.lightMap,vertexColors:g.vertexColors,sizeAttenuation:g.sizeAttenuation,skinning:g.skinning,morphTargets:g.morphTargets,
|
|
c(g,THREE.ShaderLib.particle_basic);var r,E,x,v;q=x=v=0;for(r=m.length;q<r;q++){E=m[q];E instanceof THREE.DirectionalLight&&x++;E instanceof THREE.PointLight&&v++}if(v+x<=4)m=x;else{m=Math.ceil(4*x/(v+x));v=4-m}q={directional:m,point:v};r=50;if(h!==undefined&&h instanceof THREE.SkinnedMesh)r=h.bones.length;v=g.fragmentShader;m=g.vertexShader;r={fog:o,map:g.map,envMap:g.envMap,lightMap:g.lightMap,vertexColors:g.vertexColors,sizeAttenuation:g.sizeAttenuation,skinning:g.skinning,morphTargets:g.morphTargets,
|
|
maxDirLights:q.directional,maxPointLights:q.point,maxBones:r};o=d.createProgram();q=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+r.maxDirLights,"#define MAX_POINT_LIGHTS "+r.maxPointLights,r.fog?"#define USE_FOG":"",r.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.lightMap?"#define USE_LIGHTMAP":"",r.vertexColors?"#define USE_COLOR":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");
|
|
maxDirLights:q.directional,maxPointLights:q.point,maxBones:r};o=d.createProgram();q=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+r.maxDirLights,"#define MAX_POINT_LIGHTS "+r.maxPointLights,r.fog?"#define USE_FOG":"",r.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.lightMap?"#define USE_LIGHTMAP":"",r.vertexColors?"#define USE_COLOR":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");
|
|
r=[d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+r.maxDirLights,"#define MAX_POINT_LIGHTS "+r.maxPointLights,"#define MAX_BONES "+r.maxBones,r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.lightMap?"#define USE_LIGHTMAP":"",r.vertexColors?"#define USE_COLOR":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n"].join("\n");
|
|
r=[d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+r.maxDirLights,"#define MAX_POINT_LIGHTS "+r.maxPointLights,"#define MAX_BONES "+r.maxBones,r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.lightMap?"#define USE_LIGHTMAP":"",r.vertexColors?"#define USE_COLOR":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n"].join("\n");
|
|
-d.attachShader(o,B("fragment",q+v));d.attachShader(o,B("vertex",r+m));d.linkProgram(o);d.getProgramParameter(o,d.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+d.getProgramParameter(o,d.VALIDATE_STATUS)+", gl error ["+d.getError()+"]");o.uniforms={};o.attributes={};g.program=o;o=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(k in g.uniforms)o.push(k);
|
|
|
|
|
|
+d.attachShader(o,pa("fragment",q+v));d.attachShader(o,pa("vertex",r+m));d.linkProgram(o);d.getProgramParameter(o,d.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+d.getProgramParameter(o,d.VALIDATE_STATUS)+", gl error ["+d.getError()+"]");o.uniforms={};o.attributes={};g.program=o;o=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(k in g.uniforms)o.push(k);
|
|
k=g.program;v=0;for(m=o.length;v<m;v++){q=o[v];k.uniforms[q]=d.getUniformLocation(k,q)}o=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(k=0;k<this.maxMorphTargets;k++)o.push("morphTarget"+k);for(t in g.attributes)o.push(t);t=g.program;k=o;o=0;for(v=k.length;o<v;o++){m=k[o];t.attributes[m]=d.getAttribLocation(t,m)}t=g.program.attributes;d.enableVertexAttribArray(t.position);t.color>=0&&d.enableVertexAttribArray(t.color);t.normal>=0&&d.enableVertexAttribArray(t.normal);
|
|
k=g.program;v=0;for(m=o.length;v<m;v++){q=o[v];k.uniforms[q]=d.getUniformLocation(k,q)}o=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(k=0;k<this.maxMorphTargets;k++)o.push("morphTarget"+k);for(t in g.attributes)o.push(t);t=g.program;k=o;o=0;for(v=k.length;o<v;o++){m=k[o];t.attributes[m]=d.getAttribLocation(t,m)}t=g.program.attributes;d.enableVertexAttribArray(t.position);t.color>=0&&d.enableVertexAttribArray(t.color);t.normal>=0&&d.enableVertexAttribArray(t.normal);
|
|
t.tangent>=0&&d.enableVertexAttribArray(t.tangent);if(g.skinning&&t.skinVertexA>=0&&t.skinVertexB>=0&&t.skinIndex>=0&&t.skinWeight>=0){d.enableVertexAttribArray(t.skinVertexA);d.enableVertexAttribArray(t.skinVertexB);d.enableVertexAttribArray(t.skinIndex);d.enableVertexAttribArray(t.skinWeight)}if(g.morphTargets){g.numSupportedMorphTargets=0;if(t.morphTarget0>=0){d.enableVertexAttribArray(t.morphTarget0);g.numSupportedMorphTargets++}if(t.morphTarget1>=0){d.enableVertexAttribArray(t.morphTarget1);
|
|
t.tangent>=0&&d.enableVertexAttribArray(t.tangent);if(g.skinning&&t.skinVertexA>=0&&t.skinVertexB>=0&&t.skinIndex>=0&&t.skinWeight>=0){d.enableVertexAttribArray(t.skinVertexA);d.enableVertexAttribArray(t.skinVertexB);d.enableVertexAttribArray(t.skinIndex);d.enableVertexAttribArray(t.skinWeight)}if(g.morphTargets){g.numSupportedMorphTargets=0;if(t.morphTarget0>=0){d.enableVertexAttribArray(t.morphTarget0);g.numSupportedMorphTargets++}if(t.morphTarget1>=0){d.enableVertexAttribArray(t.morphTarget1);
|
|
g.numSupportedMorphTargets++}if(t.morphTarget2>=0){d.enableVertexAttribArray(t.morphTarget2);g.numSupportedMorphTargets++}if(t.morphTarget3>=0){d.enableVertexAttribArray(t.morphTarget3);g.numSupportedMorphTargets++}if(t.morphTarget4>=0){d.enableVertexAttribArray(t.morphTarget4);g.numSupportedMorphTargets++}if(t.morphTarget5>=0){d.enableVertexAttribArray(t.morphTarget5);g.numSupportedMorphTargets++}if(t.morphTarget6>=0){d.enableVertexAttribArray(t.morphTarget6);g.numSupportedMorphTargets++}if(t.morphTarget7>=
|
|
g.numSupportedMorphTargets++}if(t.morphTarget2>=0){d.enableVertexAttribArray(t.morphTarget2);g.numSupportedMorphTargets++}if(t.morphTarget3>=0){d.enableVertexAttribArray(t.morphTarget3);g.numSupportedMorphTargets++}if(t.morphTarget4>=0){d.enableVertexAttribArray(t.morphTarget4);g.numSupportedMorphTargets++}if(t.morphTarget5>=0){d.enableVertexAttribArray(t.morphTarget5);g.numSupportedMorphTargets++}if(t.morphTarget6>=0){d.enableVertexAttribArray(t.morphTarget6);g.numSupportedMorphTargets++}if(t.morphTarget7>=
|
|
-0){d.enableVertexAttribArray(t.morphTarget7);g.numSupportedMorphTargets++}h.__webGLMorphTargetInfluences=new Float32Array(this.maxMorphTargets);for(k=0;k<this.maxMorphTargets;k++)h.__webGLMorphTargetInfluences[k]=0}};this.render=function(g,m,o,h){var k,t,q,r,E,x,v,L,V=g.lights,H=g.fog;m.matrixAutoUpdate&&m.updateMatrix();g.update(undefined,!1,m);m.matrixWorldInverse.flattenToArray(Ga);m.projectionMatrix.flattenToArray(Ma);Aa.multiply(m.projectionMatrix,m.matrixWorldInverse);n(Aa);this.initWebGLObjects(g);
|
|
|
|
-R(o);(this.autoClear||h)&&this.clear();E=g.__webglObjects.length;for(h=0;h<E;h++){k=g.__webglObjects[h];v=k.object;if(v.visible)if(!(v instanceof THREE.Mesh)||s(v)){v.matrixWorld.flattenToArray(v._objectMatrixArray);K(v,m);D(k);k.render=!0;if(this.sortObjects){ia.copy(v.position);Aa.multiplyVector3(ia);k.z=ia.z}}else k.render=!1;else k.render=!1}this.sortObjects&&g.__webglObjects.sort(y);x=g.__webglObjectsImmediate.length;for(h=0;h<x;h++){k=g.__webglObjectsImmediate[h];v=k.object;if(v.visible){v.matrixAutoUpdate&&
|
|
|
|
-v.matrixWorld.flattenToArray(v._objectMatrixArray);K(v,m);A(k)}}O(THREE.NormalBlending);for(h=0;h<E;h++){k=g.__webglObjects[h];if(k.render){v=k.object;L=k.buffer;q=k.opaque;j(v);for(k=0;k<q.count;k++){r=q.list[k];p(r.depthTest);f(m,V,H,r,L,v)}}}for(h=0;h<x;h++){k=g.__webglObjectsImmediate[h];v=k.object;if(v.visible){q=k.opaque;j(v);for(k=0;k<q.count;k++){r=q.list[k];p(r.depthTest);t=e(m,V,H,r,v);v.render(function(Q){i(Q,t)})}}}for(h=0;h<E;h++){k=g.__webglObjects[h];if(k.render){v=k.object;L=k.buffer;
|
|
|
|
-q=k.transparent;j(v);for(k=0;k<q.count;k++){r=q.list[k];O(r.blending);p(r.depthTest);f(m,V,H,r,L,v)}}}for(h=0;h<x;h++){k=g.__webglObjectsImmediate[h];v=k.object;if(v.visible){q=k.transparent;j(v);for(k=0;k<q.count;k++){r=q.list[k];O(r.blending);p(r.depthTest);t=e(m,V,H,r,v);v.render(function(Q){i(Q,t)})}}}if(o&&o.minFilter!==THREE.NearestFilter&&o.minFilter!==THREE.LinearFilter){d.bindTexture(d.TEXTURE_2D,o.__webGLTexture);d.generateMipmap(d.TEXTURE_2D);d.bindTexture(d.TEXTURE_2D,null)}};this.initWebGLObjects=
|
|
|
|
-function(g){if(!g.__webglObjects){g.__webglObjects=[];g.__webglObjectsImmediate=[]}for(;g.__objectsAdded.length;){var m=g.__objectsAdded[0],o=g,h=void 0,k=void 0,t=void 0;if(m._modelViewMatrix==undefined){m._modelViewMatrix=new THREE.Matrix4;m._normalMatrixArray=new Float32Array(9);m._modelViewMatrixArray=new Float32Array(16);m._objectMatrixArray=new Float32Array(16);m.matrixWorld.flattenToArray(m._objectMatrixArray)}if(m instanceof THREE.Mesh){k=m.geometry;k.geometryGroups==undefined&&I(k);for(h in k.geometryGroups){t=
|
|
|
|
|
|
+0){d.enableVertexAttribArray(t.morphTarget7);g.numSupportedMorphTargets++}h.__webGLMorphTargetInfluences=new Float32Array(this.maxMorphTargets);for(k=0;k<this.maxMorphTargets;k++)h.__webGLMorphTargetInfluences[k]=0}};this.render=function(g,m,o,h){var k,t,q,r,E,x,v,M,U=g.lights,H=g.fog;m.matrixAutoUpdate&&m.updateMatrix();g.update(undefined,!1,m);m.matrixWorldInverse.flattenToArray(na);m.projectionMatrix.flattenToArray(xa);S.multiply(m.projectionMatrix,m.matrixWorldInverse);n(S);this.initWebGLObjects(g);
|
|
|
|
+ma(o);(this.autoClear||h)&&this.clear();E=g.__webglObjects.length;for(h=0;h<E;h++){k=g.__webglObjects[h];v=k.object;if(v.visible)if(!(v instanceof THREE.Mesh)||s(v)){v.matrixWorld.flattenToArray(v._objectMatrixArray);J(v,m);D(k);k.render=!0;if(this.sortObjects){ya.copy(v.position);S.multiplyVector3(ya);k.z=ya.z}}else k.render=!1;else k.render=!1}this.sortObjects&&g.__webglObjects.sort(z);x=g.__webglObjectsImmediate.length;for(h=0;h<x;h++){k=g.__webglObjectsImmediate[h];v=k.object;if(v.visible){v.matrixAutoUpdate&&
|
|
|
|
+v.matrixWorld.flattenToArray(v._objectMatrixArray);J(v,m);A(k)}}L(THREE.NormalBlending);for(h=0;h<E;h++){k=g.__webglObjects[h];if(k.render){v=k.object;M=k.buffer;q=k.opaque;j(v);for(k=0;k<q.count;k++){r=q.list[k];p(r.depthTest);f(m,U,H,r,M,v)}}}for(h=0;h<x;h++){k=g.__webglObjectsImmediate[h];v=k.object;if(v.visible){q=k.opaque;j(v);for(k=0;k<q.count;k++){r=q.list[k];p(r.depthTest);t=e(m,U,H,r,v);v.render(function(P){i(P,t)})}}}for(h=0;h<E;h++){k=g.__webglObjects[h];if(k.render){v=k.object;M=k.buffer;
|
|
|
|
+q=k.transparent;j(v);for(k=0;k<q.count;k++){r=q.list[k];L(r.blending);p(r.depthTest);f(m,U,H,r,M,v)}}}for(h=0;h<x;h++){k=g.__webglObjectsImmediate[h];v=k.object;if(v.visible){q=k.transparent;j(v);for(k=0;k<q.count;k++){r=q.list[k];L(r.blending);p(r.depthTest);t=e(m,U,H,r,v);v.render(function(P){i(P,t)})}}}if(o&&o.minFilter!==THREE.NearestFilter&&o.minFilter!==THREE.LinearFilter){d.bindTexture(d.TEXTURE_2D,o.__webGLTexture);d.generateMipmap(d.TEXTURE_2D);d.bindTexture(d.TEXTURE_2D,null)}};this.initWebGLObjects=
|
|
|
|
+function(g){if(!g.__webglObjects){g.__webglObjects=[];g.__webglObjectsImmediate=[]}for(;g.__objectsAdded.length;){var m=g.__objectsAdded[0],o=g,h=void 0,k=void 0,t=void 0;if(m._modelViewMatrix==undefined){m._modelViewMatrix=new THREE.Matrix4;m._normalMatrixArray=new Float32Array(9);m._modelViewMatrixArray=new Float32Array(16);m._objectMatrixArray=new Float32Array(16);m.matrixWorld.flattenToArray(m._objectMatrixArray)}if(m instanceof THREE.Mesh){k=m.geometry;k.geometryGroups==undefined&&K(k);for(h in k.geometryGroups){t=
|
|
k.geometryGroups[h];if(!t.__webGLVertexBuffer){var q=t;q.__webGLVertexBuffer=d.createBuffer();q.__webGLNormalBuffer=d.createBuffer();q.__webGLTangentBuffer=d.createBuffer();q.__webGLColorBuffer=d.createBuffer();q.__webGLUVBuffer=d.createBuffer();q.__webGLUV2Buffer=d.createBuffer();q.__webGLSkinVertexABuffer=d.createBuffer();q.__webGLSkinVertexBBuffer=d.createBuffer();q.__webGLSkinIndicesBuffer=d.createBuffer();q.__webGLSkinWeightsBuffer=d.createBuffer();q.__webGLFaceBuffer=d.createBuffer();q.__webGLLineBuffer=
|
|
k.geometryGroups[h];if(!t.__webGLVertexBuffer){var q=t;q.__webGLVertexBuffer=d.createBuffer();q.__webGLNormalBuffer=d.createBuffer();q.__webGLTangentBuffer=d.createBuffer();q.__webGLColorBuffer=d.createBuffer();q.__webGLUVBuffer=d.createBuffer();q.__webGLUV2Buffer=d.createBuffer();q.__webGLSkinVertexABuffer=d.createBuffer();q.__webGLSkinVertexBBuffer=d.createBuffer();q.__webGLSkinIndicesBuffer=d.createBuffer();q.__webGLSkinWeightsBuffer=d.createBuffer();q.__webGLFaceBuffer=d.createBuffer();q.__webGLLineBuffer=
|
|
-d.createBuffer();if(q.numMorphTargets){var r=void 0,E=void 0;q.__webGLMorphTargetsBuffers=[];r=0;for(E=q.numMorphTargets;r<E;r++)q.__webGLMorphTargetsBuffers.push(d.createBuffer())}q=t;var x=m,v=void 0,L=void 0,V=E=r=0;v=void 0;L=void 0;var H=void 0;L=void 0;var Q=x.geometry;H=Q.faces;var J=q.faces;v=0;for(L=J.length;v<L;v++){fi=J[v];face=H[fi];if(face instanceof THREE.Face3){r+=3;E+=1;V+=3}else if(face instanceof THREE.Face4){r+=4;E+=2;V+=4}}v=q;L=x;H=void 0;J=void 0;var Y=void 0,Ca=void 0;Y=void 0;
|
|
|
|
-var S=[];H=0;for(J=L.materials.length;H<J;H++){Y=L.materials[H];if(Y instanceof THREE.MeshFaceMaterial){Y=0;for(l=v.materials.length;Y<l;Y++)(Ca=v.materials[Y])&&S.push(Ca)}else(Ca=Y)&&S.push(Ca)}L=S;a:{v=void 0;H=void 0;J=L.length;for(v=0;v<J;v++){H=L[v];if(H.map||H.lightMap||H instanceof THREE.MeshShaderMaterial){v=!0;break a}}v=!1}a:{H=void 0;J=void 0;S=L.length;for(H=0;H<S;H++){J=L[H];if(!(J instanceof THREE.MeshBasicMaterial&&!J.envMap||J instanceof THREE.MeshDepthMaterial)){H=J&&J.shading!=
|
|
|
|
-undefined&&J.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}}H=!1}a:{J=void 0;S=void 0;Y=L.length;for(J=0;J<Y;J++){S=L[J];if(S.vertexColors){L=S.vertexColors;break a}}L=!1}q.__vertexArray=new Float32Array(r*3);if(H)q.__normalArray=new Float32Array(r*3);if(Q.hasTangents)q.__tangentArray=new Float32Array(r*4);if(L)q.__colorArray=new Float32Array(r*3);if(v){if(Q.faceUvs.length>0||Q.faceVertexUvs.length>0)q.__uvArray=new Float32Array(r*2);if(Q.faceUvs.length>1||Q.faceVertexUvs.length>
|
|
|
|
-1)q.__uv2Array=new Float32Array(r*2)}if(x.geometry.skinWeights.length&&x.geometry.skinIndices.length){q.__skinVertexAArray=new Float32Array(r*4);q.__skinVertexBArray=new Float32Array(r*4);q.__skinIndexArray=new Float32Array(r*4);q.__skinWeightArray=new Float32Array(r*4)}q.__faceArray=new Uint16Array(E*3);q.__lineArray=new Uint16Array(V*2);if(q.numMorphTargets){x=void 0;Q=void 0;q.__morphTargetsArrays=[];x=0;for(Q=q.numMorphTargets;x<Q;x++)q.__morphTargetsArrays.push(new Float32Array(r*3))}q.__needsSmoothNormals=
|
|
|
|
-H==THREE.SmoothShading;q.__uvType=v;q.__vertexColorType=L;q.__normalType=H;q.__webGLFaceCount=E*3;q.__webGLLineCount=V*2;k.__dirtyVertices=!0;k.__dirtyMorphTargets=!0;k.__dirtyElements=!0;k.__dirtyUvs=!0;k.__dirtyNormals=!0;k.__dirtyTangents=!0;k.__dirtyColors=!0}N(o.__webglObjects,t,m)}}else if(m instanceof THREE.Ribbon){k=m.geometry;if(!k.__webGLVertexBuffer){h=k;h.__webGLVertexBuffer=d.createBuffer();h.__webGLColorBuffer=d.createBuffer();h=k;t=h.vertices.length;h.__vertexArray=new Float32Array(t*
|
|
|
|
-3);h.__colorArray=new Float32Array(t*3);h.__webGLVertexCount=t;k.__dirtyVertices=!0;k.__dirtyColors=!0}N(o.__webglObjects,k,m)}else if(m instanceof THREE.Line){k=m.geometry;if(!k.__webGLVertexBuffer){h=k;h.__webGLVertexBuffer=d.createBuffer();h.__webGLColorBuffer=d.createBuffer();h=k;t=h.vertices.length;h.__vertexArray=new Float32Array(t*3);h.__colorArray=new Float32Array(t*3);h.__webGLLineCount=t;k.__dirtyVertices=!0;k.__dirtyColors=!0}N(o.__webglObjects,k,m)}else if(m instanceof THREE.ParticleSystem){k=
|
|
|
|
-m.geometry;if(!k.__webGLVertexBuffer){h=k;h.__webGLVertexBuffer=d.createBuffer();h.__webGLColorBuffer=d.createBuffer();h=k;t=h.vertices.length;h.__vertexArray=new Float32Array(t*3);h.__colorArray=new Float32Array(t*3);h.__sortArray=[];h.__webGLParticleCount=t;k.__dirtyVertices=!0;k.__dirtyColors=!0}N(o.__webglObjects,k,m)}else THREE.MarchingCubes!==undefined&&m instanceof THREE.MarchingCubes&&o.__webglObjectsImmediate.push({object:m,opaque:{list:[],count:0},transparent:{list:[],count:0}});g.__objectsAdded.splice(0,
|
|
|
|
|
|
+d.createBuffer();if(q.numMorphTargets){var r=void 0,E=void 0;q.__webGLMorphTargetsBuffers=[];r=0;for(E=q.numMorphTargets;r<E;r++)q.__webGLMorphTargetsBuffers.push(d.createBuffer())}q=t;var x=m,v=void 0,M=void 0,U=E=r=0;v=void 0;M=void 0;var H=void 0;M=void 0;var P=x.geometry;H=P.faces;var I=q.faces;v=0;for(M=I.length;v<M;v++){fi=I[v];face=H[fi];if(face instanceof THREE.Face3){r+=3;E+=1;U+=3}else if(face instanceof THREE.Face4){r+=4;E+=2;U+=4}}v=q;M=x;H=void 0;I=void 0;var Y=void 0,Fa=void 0;Y=void 0;
|
|
|
|
+var T=[];H=0;for(I=M.materials.length;H<I;H++){Y=M.materials[H];if(Y instanceof THREE.MeshFaceMaterial){Y=0;for(l=v.materials.length;Y<l;Y++)(Fa=v.materials[Y])&&T.push(Fa)}else(Fa=Y)&&T.push(Fa)}M=T;a:{v=void 0;H=void 0;I=M.length;for(v=0;v<I;v++){H=M[v];if(H.map||H.lightMap||H instanceof THREE.MeshShaderMaterial){v=!0;break a}}v=!1}a:{H=void 0;I=void 0;T=M.length;for(H=0;H<T;H++){I=M[H];if(!(I instanceof THREE.MeshBasicMaterial&&!I.envMap||I instanceof THREE.MeshDepthMaterial)){H=I&&I.shading!=
|
|
|
|
+undefined&&I.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}}H=!1}a:{I=void 0;T=void 0;Y=M.length;for(I=0;I<Y;I++){T=M[I];if(T.vertexColors){M=T.vertexColors;break a}}M=!1}q.__vertexArray=new Float32Array(r*3);if(H)q.__normalArray=new Float32Array(r*3);if(P.hasTangents)q.__tangentArray=new Float32Array(r*4);if(M)q.__colorArray=new Float32Array(r*3);if(v){if(P.faceUvs.length>0||P.faceVertexUvs.length>0)q.__uvArray=new Float32Array(r*2);if(P.faceUvs.length>1||P.faceVertexUvs.length>
|
|
|
|
+1)q.__uv2Array=new Float32Array(r*2)}if(x.geometry.skinWeights.length&&x.geometry.skinIndices.length){q.__skinVertexAArray=new Float32Array(r*4);q.__skinVertexBArray=new Float32Array(r*4);q.__skinIndexArray=new Float32Array(r*4);q.__skinWeightArray=new Float32Array(r*4)}q.__faceArray=new Uint16Array(E*3);q.__lineArray=new Uint16Array(U*2);if(q.numMorphTargets){x=void 0;P=void 0;q.__morphTargetsArrays=[];x=0;for(P=q.numMorphTargets;x<P;x++)q.__morphTargetsArrays.push(new Float32Array(r*3))}q.__needsSmoothNormals=
|
|
|
|
+H==THREE.SmoothShading;q.__uvType=v;q.__vertexColorType=M;q.__normalType=H;q.__webGLFaceCount=E*3;q.__webGLLineCount=U*2;k.__dirtyVertices=!0;k.__dirtyMorphTargets=!0;k.__dirtyElements=!0;k.__dirtyUvs=!0;k.__dirtyNormals=!0;k.__dirtyTangents=!0;k.__dirtyColors=!0}O(o.__webglObjects,t,m)}}else if(m instanceof THREE.Ribbon){k=m.geometry;if(!k.__webGLVertexBuffer){h=k;h.__webGLVertexBuffer=d.createBuffer();h.__webGLColorBuffer=d.createBuffer();h=k;t=h.vertices.length;h.__vertexArray=new Float32Array(t*
|
|
|
|
+3);h.__colorArray=new Float32Array(t*3);h.__webGLVertexCount=t;k.__dirtyVertices=!0;k.__dirtyColors=!0}O(o.__webglObjects,k,m)}else if(m instanceof THREE.Line){k=m.geometry;if(!k.__webGLVertexBuffer){h=k;h.__webGLVertexBuffer=d.createBuffer();h.__webGLColorBuffer=d.createBuffer();h=k;t=h.vertices.length;h.__vertexArray=new Float32Array(t*3);h.__colorArray=new Float32Array(t*3);h.__webGLLineCount=t;k.__dirtyVertices=!0;k.__dirtyColors=!0}O(o.__webglObjects,k,m)}else if(m instanceof THREE.ParticleSystem){k=
|
|
|
|
+m.geometry;if(!k.__webGLVertexBuffer){h=k;h.__webGLVertexBuffer=d.createBuffer();h.__webGLColorBuffer=d.createBuffer();h=k;t=h.vertices.length;h.__vertexArray=new Float32Array(t*3);h.__colorArray=new Float32Array(t*3);h.__sortArray=[];h.__webGLParticleCount=t;k.__dirtyVertices=!0;k.__dirtyColors=!0}O(o.__webglObjects,k,m)}else THREE.MarchingCubes!==undefined&&m instanceof THREE.MarchingCubes&&o.__webglObjectsImmediate.push({object:m,opaque:{list:[],count:0},transparent:{list:[],count:0}});g.__objectsAdded.splice(0,
|
|
1)}for(;g.__objectsRemoved.length;){m=g.__objectsRemoved[0];o=g;k=void 0;h=void 0;for(k=o.__webglObjects.length-1;k>=0;k--){h=o.__webglObjects[k].object;m==h&&o.__webglObjects.splice(k,1)}g.__objectsRemoved.splice(0,1)}m=0;for(o=g.__webglObjects.length;m<o;m++){h=g.__webglObjects[m].object;t=void 0;k=void 0;q=void 0;if(h instanceof THREE.Mesh){k=h.geometry;for(t in k.geometryGroups){q=k.geometryGroups[t];if(k.__dirtyVertices||k.__dirtyMorphTargets||k.__dirtyElements||k.__dirtyUvs||k.__dirtyNormals||
|
|
1)}for(;g.__objectsRemoved.length;){m=g.__objectsRemoved[0];o=g;k=void 0;h=void 0;for(k=o.__webglObjects.length-1;k>=0;k--){h=o.__webglObjects[k].object;m==h&&o.__webglObjects.splice(k,1)}g.__objectsRemoved.splice(0,1)}m=0;for(o=g.__webglObjects.length;m<o;m++){h=g.__webglObjects[m].object;t=void 0;k=void 0;q=void 0;if(h instanceof THREE.Mesh){k=h.geometry;for(t in k.geometryGroups){q=k.geometryGroups[t];if(k.__dirtyVertices||k.__dirtyMorphTargets||k.__dirtyElements||k.__dirtyUvs||k.__dirtyNormals||
|
|
-k.__dirtyColors||k.__dirtyTangents){r=d.DYNAMIC_DRAW;E=void 0;V=void 0;var Z=void 0,w=void 0;Z=void 0;var xa=void 0,W=void 0,Da=void 0;x=void 0;Q=void 0;v=void 0;L=void 0;H=void 0;var C=void 0,F=void 0,G=void 0,$=void 0;W=void 0;Da=void 0;C=void 0;w=void 0;C=void 0;F=void 0;G=void 0;W=void 0;C=void 0;F=void 0;G=void 0;$=void 0;C=void 0;F=void 0;G=void 0;$=void 0;C=void 0;F=void 0;G=void 0;$=void 0;C=void 0;F=void 0;G=void 0;$=void 0;w=void 0;xa=void 0;Z=void 0;Z=void 0;var za=void 0,Ua=void 0,sa=
|
|
|
|
-void 0,La=Ca=Y=S=J=0,Ea=0,aa=0,Fa=0,qa=0,u=0,ta=0,ua=q.__vertexArray,Ya=q.__uvArray,Za=q.__uv2Array,Ja=q.__normalArray,ca=q.__tangentArray,va=q.__colorArray,da=q.__skinVertexAArray,ea=q.__skinVertexBArray,fa=q.__skinIndexArray,ga=q.__skinWeightArray,$a=q.__morphTargetsArrays,Na=q.__faceArray,Ha=q.__lineArray,gb=q.__needsSmoothNormals;Q=q.__vertexColorType;x=q.__uvType;v=q.__normalType;var Ba=h.geometry,ab=Ba.__dirtyVertices,bb=Ba.__dirtyElements,Va=Ba.__dirtyUvs,cb=Ba.__dirtyNormals,db=Ba.__dirtyTangents,
|
|
|
|
-eb=Ba.__dirtyColors,fb=Ba.__dirtyMorphTargets,Ia=Ba.vertices,hb=q.faces,kb=Ba.faces,ib=Ba.faceVertexUvs[0],jb=Ba.faceVertexUvs[1],Qa=Ba.skinVerticesA,Ra=Ba.skinVerticesB,Sa=Ba.skinIndices,Pa=Ba.skinWeights,Oa=Ba.morphTargets;E=0;for(V=hb.length;E<V;E++){Z=hb[E];w=kb[Z];ib&&(L=ib[Z]);jb&&(H=jb[Z]);Z=w.vertexNormals;xa=w.normal;W=w.vertexColors;Da=w.color;if(w instanceof THREE.Face3){if(ab){C=Ia[w.a].position;F=Ia[w.b].position;G=Ia[w.c].position;ua[S]=C.x;ua[S+1]=C.y;ua[S+2]=C.z;ua[S+3]=F.x;ua[S+4]=
|
|
|
|
-F.y;ua[S+5]=F.z;ua[S+6]=G.x;ua[S+7]=G.y;ua[S+8]=G.z;S+=9}if(fb){za=0;for(Ua=Oa.length;za<Ua;za++){C=Oa[za].vertices[w.a].position;F=Oa[za].vertices[w.b].position;G=Oa[za].vertices[w.c].position;sa=$a[za];sa[ta+0]=C.x;sa[ta+1]=C.y;sa[ta+2]=C.z;sa[ta+3]=F.x;sa[ta+4]=F.y;sa[ta+5]=F.z;sa[ta+6]=G.x;sa[ta+7]=G.y;sa[ta+8]=G.z}ta+=9}if(Pa.length){C=Pa[w.a];F=Pa[w.b];G=Pa[w.c];ga[u]=C.x;ga[u+1]=C.y;ga[u+2]=C.z;ga[u+3]=C.w;ga[u+4]=F.x;ga[u+5]=F.y;ga[u+6]=F.z;ga[u+7]=F.w;ga[u+8]=G.x;ga[u+9]=G.y;ga[u+10]=G.z;
|
|
|
|
-ga[u+11]=G.w;C=Sa[w.a];F=Sa[w.b];G=Sa[w.c];fa[u]=C.x;fa[u+1]=C.y;fa[u+2]=C.z;fa[u+3]=C.w;fa[u+4]=F.x;fa[u+5]=F.y;fa[u+6]=F.z;fa[u+7]=F.w;fa[u+8]=G.x;fa[u+9]=G.y;fa[u+10]=G.z;fa[u+11]=G.w;C=Qa[w.a];F=Qa[w.b];G=Qa[w.c];da[u]=C.x;da[u+1]=C.y;da[u+2]=C.z;da[u+3]=1;da[u+4]=F.x;da[u+5]=F.y;da[u+6]=F.z;da[u+7]=1;da[u+8]=G.x;da[u+9]=G.y;da[u+10]=G.z;da[u+11]=1;C=Ra[w.a];F=Ra[w.b];G=Ra[w.c];ea[u]=C.x;ea[u+1]=C.y;ea[u+2]=C.z;ea[u+3]=1;ea[u+4]=F.x;ea[u+5]=F.y;ea[u+6]=F.z;ea[u+7]=1;ea[u+8]=G.x;ea[u+9]=G.y;ea[u+
|
|
|
|
-10]=G.z;ea[u+11]=1;u+=12}if(eb&&Q){if(W.length==3&&Q==THREE.VertexColors){C=W[0];F=W[1];G=W[2]}else G=F=C=Da;va[qa]=C.r;va[qa+1]=C.g;va[qa+2]=C.b;va[qa+3]=F.r;va[qa+4]=F.g;va[qa+5]=F.b;va[qa+6]=G.r;va[qa+7]=G.g;va[qa+8]=G.b;qa+=9}if(db&&Ba.hasTangents){W=Ia[w.a].tangent;Da=Ia[w.b].tangent;C=Ia[w.c].tangent;ca[aa]=W.x;ca[aa+1]=W.y;ca[aa+2]=W.z;ca[aa+3]=W.w;ca[aa+4]=Da.x;ca[aa+5]=Da.y;ca[aa+6]=Da.z;ca[aa+7]=Da.w;ca[aa+8]=C.x;ca[aa+9]=C.y;ca[aa+10]=C.z;ca[aa+11]=C.w;aa+=12}if(cb&&v)if(Z.length==3&&gb)for(w=
|
|
|
|
-0;w<3;w++){xa=Z[w];Ja[Ea]=xa.x;Ja[Ea+1]=xa.y;Ja[Ea+2]=xa.z;Ea+=3}else for(w=0;w<3;w++){Ja[Ea]=xa.x;Ja[Ea+1]=xa.y;Ja[Ea+2]=xa.z;Ea+=3}if(Va&&L!==undefined&&x)for(w=0;w<3;w++){Z=L[w];Ya[Y]=Z.u;Ya[Y+1]=Z.v;Y+=2}if(Va&&H!==undefined&&x)for(w=0;w<3;w++){Z=H[w];Za[Ca]=Z.u;Za[Ca+1]=Z.v;Ca+=2}if(bb){Na[La]=J;Na[La+1]=J+1;Na[La+2]=J+2;La+=3;Ha[Fa]=J;Ha[Fa+1]=J+1;Ha[Fa+2]=J;Ha[Fa+3]=J+2;Ha[Fa+4]=J+1;Ha[Fa+5]=J+2;Fa+=6;J+=3}}else if(w instanceof THREE.Face4){if(ab){C=Ia[w.a].position;F=Ia[w.b].position;G=Ia[w.c].position;
|
|
|
|
-$=Ia[w.d].position;ua[S]=C.x;ua[S+1]=C.y;ua[S+2]=C.z;ua[S+3]=F.x;ua[S+4]=F.y;ua[S+5]=F.z;ua[S+6]=G.x;ua[S+7]=G.y;ua[S+8]=G.z;ua[S+9]=$.x;ua[S+10]=$.y;ua[S+11]=$.z;S+=12}if(fb){za=0;for(Ua=Oa.length;za<Ua;za++){C=Oa[za].vertices[w.a].position;F=Oa[za].vertices[w.b].position;G=Oa[za].vertices[w.c].position;$=Oa[za].vertices[w.d].position;sa=$a[za];sa[ta+0]=C.x;sa[ta+1]=C.y;sa[ta+2]=C.z;sa[ta+3]=F.x;sa[ta+4]=F.y;sa[ta+5]=F.z;sa[ta+6]=G.x;sa[ta+7]=G.y;sa[ta+8]=G.z;sa[ta+9]=$.x;sa[ta+10]=$.y;sa[ta+11]=
|
|
|
|
-$.z}ta+=12}if(Pa.length){C=Pa[w.a];F=Pa[w.b];G=Pa[w.c];$=Pa[w.d];ga[u]=C.x;ga[u+1]=C.y;ga[u+2]=C.z;ga[u+3]=C.w;ga[u+4]=F.x;ga[u+5]=F.y;ga[u+6]=F.z;ga[u+7]=F.w;ga[u+8]=G.x;ga[u+9]=G.y;ga[u+10]=G.z;ga[u+11]=G.w;ga[u+12]=$.x;ga[u+13]=$.y;ga[u+14]=$.z;ga[u+15]=$.w;C=Sa[w.a];F=Sa[w.b];G=Sa[w.c];$=Sa[w.d];fa[u]=C.x;fa[u+1]=C.y;fa[u+2]=C.z;fa[u+3]=C.w;fa[u+4]=F.x;fa[u+5]=F.y;fa[u+6]=F.z;fa[u+7]=F.w;fa[u+8]=G.x;fa[u+9]=G.y;fa[u+10]=G.z;fa[u+11]=G.w;fa[u+12]=$.x;fa[u+13]=$.y;fa[u+14]=$.z;fa[u+15]=$.w;C=Qa[w.a];
|
|
|
|
-F=Qa[w.b];G=Qa[w.c];$=Qa[w.d];da[u]=C.x;da[u+1]=C.y;da[u+2]=C.z;da[u+3]=1;da[u+4]=F.x;da[u+5]=F.y;da[u+6]=F.z;da[u+7]=1;da[u+8]=G.x;da[u+9]=G.y;da[u+10]=G.z;da[u+11]=1;da[u+12]=$.x;da[u+13]=$.y;da[u+14]=$.z;da[u+15]=1;C=Ra[w.a];F=Ra[w.b];G=Ra[w.c];$=Ra[w.d];ea[u]=C.x;ea[u+1]=C.y;ea[u+2]=C.z;ea[u+3]=1;ea[u+4]=F.x;ea[u+5]=F.y;ea[u+6]=F.z;ea[u+7]=1;ea[u+8]=G.x;ea[u+9]=G.y;ea[u+10]=G.z;ea[u+11]=1;ea[u+12]=$.x;ea[u+13]=$.y;ea[u+14]=$.z;ea[u+15]=1;u+=16}if(eb&&Q){if(W.length==4&&Q==THREE.VertexColors){C=
|
|
|
|
-W[0];F=W[1];G=W[2];W=W[3]}else W=G=F=C=Da;va[qa]=C.r;va[qa+1]=C.g;va[qa+2]=C.b;va[qa+3]=F.r;va[qa+4]=F.g;va[qa+5]=F.b;va[qa+6]=G.r;va[qa+7]=G.g;va[qa+8]=G.b;va[qa+9]=W.r;va[qa+10]=W.g;va[qa+11]=W.b;qa+=12}if(db&&Ba.hasTangents){W=Ia[w.a].tangent;Da=Ia[w.b].tangent;C=Ia[w.c].tangent;w=Ia[w.d].tangent;ca[aa]=W.x;ca[aa+1]=W.y;ca[aa+2]=W.z;ca[aa+3]=W.w;ca[aa+4]=Da.x;ca[aa+5]=Da.y;ca[aa+6]=Da.z;ca[aa+7]=Da.w;ca[aa+8]=C.x;ca[aa+9]=C.y;ca[aa+10]=C.z;ca[aa+11]=C.w;ca[aa+12]=w.x;ca[aa+13]=w.y;ca[aa+14]=w.z;
|
|
|
|
-ca[aa+15]=w.w;aa+=16}if(cb&&v)if(Z.length==4&&gb)for(w=0;w<4;w++){xa=Z[w];Ja[Ea]=xa.x;Ja[Ea+1]=xa.y;Ja[Ea+2]=xa.z;Ea+=3}else for(w=0;w<4;w++){Ja[Ea]=xa.x;Ja[Ea+1]=xa.y;Ja[Ea+2]=xa.z;Ea+=3}if(Va&&L!==undefined&&x)for(w=0;w<4;w++){Z=L[w];Ya[Y]=Z.u;Ya[Y+1]=Z.v;Y+=2}if(Va&&H!==undefined&&x)for(w=0;w<4;w++){Z=H[w];Za[Ca]=Z.u;Za[Ca+1]=Z.v;Ca+=2}if(bb){Na[La]=J;Na[La+1]=J+1;Na[La+2]=J+2;Na[La+3]=J;Na[La+4]=J+2;Na[La+5]=J+3;La+=6;Ha[Fa]=J;Ha[Fa+1]=J+1;Ha[Fa+2]=J;Ha[Fa+3]=J+3;Ha[Fa+4]=J+1;Ha[Fa+5]=J+2;Ha[Fa+
|
|
|
|
-6]=J+2;Ha[Fa+7]=J+3;Fa+=8;J+=4}}}if(ab){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLVertexBuffer);d.bufferData(d.ARRAY_BUFFER,ua,r)}if(fb){za=0;for(Ua=Oa.length;za<Ua;za++){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLMorphTargetsBuffers[za]);d.bufferData(d.ARRAY_BUFFER,$a[za],r)}}if(eb&&qa>0){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLColorBuffer);d.bufferData(d.ARRAY_BUFFER,va,r)}if(cb){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLNormalBuffer);d.bufferData(d.ARRAY_BUFFER,Ja,r)}if(db&&Ba.hasTangents){d.bindBuffer(d.ARRAY_BUFFER,
|
|
|
|
-q.__webGLTangentBuffer);d.bufferData(d.ARRAY_BUFFER,ca,r)}if(Va&&Y>0){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLUVBuffer);d.bufferData(d.ARRAY_BUFFER,Ya,r)}if(Va&&Ca>0){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLUV2Buffer);d.bufferData(d.ARRAY_BUFFER,Za,r)}if(bb){d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webGLFaceBuffer);d.bufferData(d.ELEMENT_ARRAY_BUFFER,Na,r);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webGLLineBuffer);d.bufferData(d.ELEMENT_ARRAY_BUFFER,Ha,r)}if(u>0){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLSkinVertexABuffer);
|
|
|
|
|
|
+k.__dirtyColors||k.__dirtyTangents){r=d.DYNAMIC_DRAW;E=void 0;U=void 0;var Z=void 0,w=void 0;Z=void 0;var za=void 0,W=void 0,Ga=void 0;x=void 0;P=void 0;v=void 0;M=void 0;H=void 0;var C=void 0,F=void 0,G=void 0,$=void 0;W=void 0;Ga=void 0;C=void 0;w=void 0;C=void 0;F=void 0;G=void 0;W=void 0;C=void 0;F=void 0;G=void 0;$=void 0;C=void 0;F=void 0;G=void 0;$=void 0;C=void 0;F=void 0;G=void 0;$=void 0;C=void 0;F=void 0;G=void 0;$=void 0;w=void 0;za=void 0;Z=void 0;Z=void 0;var Ca=void 0,Wa=void 0,qa=
|
|
|
|
+void 0,Oa=Fa=Y=T=I=0,Ha=0,aa=0,Ia=0,oa=0,u=0,ra=0,va=q.__vertexArray,Ya=q.__uvArray,Za=q.__uv2Array,Ma=q.__normalArray,ca=q.__tangentArray,wa=q.__colorArray,da=q.__skinVertexAArray,ea=q.__skinVertexBArray,fa=q.__skinIndexArray,ga=q.__skinWeightArray,$a=q.__morphTargetsArrays,Pa=q.__faceArray,Ja=q.__lineArray,gb=q.__needsSmoothNormals;P=q.__vertexColorType;x=q.__uvType;v=q.__normalType;var Ea=h.geometry,ab=Ea.__dirtyVertices,bb=Ea.__dirtyElements,Xa=Ea.__dirtyUvs,cb=Ea.__dirtyNormals,db=Ea.__dirtyTangents,
|
|
|
|
+eb=Ea.__dirtyColors,fb=Ea.__dirtyMorphTargets,La=Ea.vertices,hb=q.faces,kb=Ea.faces,ib=Ea.faceVertexUvs[0],jb=Ea.faceVertexUvs[1],Sa=Ea.skinVerticesA,Ta=Ea.skinVerticesB,Ua=Ea.skinIndices,Ra=Ea.skinWeights,Qa=Ea.morphTargets;E=0;for(U=hb.length;E<U;E++){Z=hb[E];w=kb[Z];ib&&(M=ib[Z]);jb&&(H=jb[Z]);Z=w.vertexNormals;za=w.normal;W=w.vertexColors;Ga=w.color;if(w instanceof THREE.Face3){if(ab){C=La[w.a].position;F=La[w.b].position;G=La[w.c].position;va[T]=C.x;va[T+1]=C.y;va[T+2]=C.z;va[T+3]=F.x;va[T+4]=
|
|
|
|
+F.y;va[T+5]=F.z;va[T+6]=G.x;va[T+7]=G.y;va[T+8]=G.z;T+=9}if(fb){Ca=0;for(Wa=Qa.length;Ca<Wa;Ca++){C=Qa[Ca].vertices[w.a].position;F=Qa[Ca].vertices[w.b].position;G=Qa[Ca].vertices[w.c].position;qa=$a[Ca];qa[ra+0]=C.x;qa[ra+1]=C.y;qa[ra+2]=C.z;qa[ra+3]=F.x;qa[ra+4]=F.y;qa[ra+5]=F.z;qa[ra+6]=G.x;qa[ra+7]=G.y;qa[ra+8]=G.z}ra+=9}if(Ra.length){C=Ra[w.a];F=Ra[w.b];G=Ra[w.c];ga[u]=C.x;ga[u+1]=C.y;ga[u+2]=C.z;ga[u+3]=C.w;ga[u+4]=F.x;ga[u+5]=F.y;ga[u+6]=F.z;ga[u+7]=F.w;ga[u+8]=G.x;ga[u+9]=G.y;ga[u+10]=G.z;
|
|
|
|
+ga[u+11]=G.w;C=Ua[w.a];F=Ua[w.b];G=Ua[w.c];fa[u]=C.x;fa[u+1]=C.y;fa[u+2]=C.z;fa[u+3]=C.w;fa[u+4]=F.x;fa[u+5]=F.y;fa[u+6]=F.z;fa[u+7]=F.w;fa[u+8]=G.x;fa[u+9]=G.y;fa[u+10]=G.z;fa[u+11]=G.w;C=Sa[w.a];F=Sa[w.b];G=Sa[w.c];da[u]=C.x;da[u+1]=C.y;da[u+2]=C.z;da[u+3]=1;da[u+4]=F.x;da[u+5]=F.y;da[u+6]=F.z;da[u+7]=1;da[u+8]=G.x;da[u+9]=G.y;da[u+10]=G.z;da[u+11]=1;C=Ta[w.a];F=Ta[w.b];G=Ta[w.c];ea[u]=C.x;ea[u+1]=C.y;ea[u+2]=C.z;ea[u+3]=1;ea[u+4]=F.x;ea[u+5]=F.y;ea[u+6]=F.z;ea[u+7]=1;ea[u+8]=G.x;ea[u+9]=G.y;ea[u+
|
|
|
|
+10]=G.z;ea[u+11]=1;u+=12}if(eb&&P){if(W.length==3&&P==THREE.VertexColors){C=W[0];F=W[1];G=W[2]}else G=F=C=Ga;wa[oa]=C.r;wa[oa+1]=C.g;wa[oa+2]=C.b;wa[oa+3]=F.r;wa[oa+4]=F.g;wa[oa+5]=F.b;wa[oa+6]=G.r;wa[oa+7]=G.g;wa[oa+8]=G.b;oa+=9}if(db&&Ea.hasTangents){W=La[w.a].tangent;Ga=La[w.b].tangent;C=La[w.c].tangent;ca[aa]=W.x;ca[aa+1]=W.y;ca[aa+2]=W.z;ca[aa+3]=W.w;ca[aa+4]=Ga.x;ca[aa+5]=Ga.y;ca[aa+6]=Ga.z;ca[aa+7]=Ga.w;ca[aa+8]=C.x;ca[aa+9]=C.y;ca[aa+10]=C.z;ca[aa+11]=C.w;aa+=12}if(cb&&v)if(Z.length==3&&gb)for(w=
|
|
|
|
+0;w<3;w++){za=Z[w];Ma[Ha]=za.x;Ma[Ha+1]=za.y;Ma[Ha+2]=za.z;Ha+=3}else for(w=0;w<3;w++){Ma[Ha]=za.x;Ma[Ha+1]=za.y;Ma[Ha+2]=za.z;Ha+=3}if(Xa&&M!==undefined&&x)for(w=0;w<3;w++){Z=M[w];Ya[Y]=Z.u;Ya[Y+1]=Z.v;Y+=2}if(Xa&&H!==undefined&&x)for(w=0;w<3;w++){Z=H[w];Za[Fa]=Z.u;Za[Fa+1]=Z.v;Fa+=2}if(bb){Pa[Oa]=I;Pa[Oa+1]=I+1;Pa[Oa+2]=I+2;Oa+=3;Ja[Ia]=I;Ja[Ia+1]=I+1;Ja[Ia+2]=I;Ja[Ia+3]=I+2;Ja[Ia+4]=I+1;Ja[Ia+5]=I+2;Ia+=6;I+=3}}else if(w instanceof THREE.Face4){if(ab){C=La[w.a].position;F=La[w.b].position;G=La[w.c].position;
|
|
|
|
+$=La[w.d].position;va[T]=C.x;va[T+1]=C.y;va[T+2]=C.z;va[T+3]=F.x;va[T+4]=F.y;va[T+5]=F.z;va[T+6]=G.x;va[T+7]=G.y;va[T+8]=G.z;va[T+9]=$.x;va[T+10]=$.y;va[T+11]=$.z;T+=12}if(fb){Ca=0;for(Wa=Qa.length;Ca<Wa;Ca++){C=Qa[Ca].vertices[w.a].position;F=Qa[Ca].vertices[w.b].position;G=Qa[Ca].vertices[w.c].position;$=Qa[Ca].vertices[w.d].position;qa=$a[Ca];qa[ra+0]=C.x;qa[ra+1]=C.y;qa[ra+2]=C.z;qa[ra+3]=F.x;qa[ra+4]=F.y;qa[ra+5]=F.z;qa[ra+6]=G.x;qa[ra+7]=G.y;qa[ra+8]=G.z;qa[ra+9]=$.x;qa[ra+10]=$.y;qa[ra+11]=
|
|
|
|
+$.z}ra+=12}if(Ra.length){C=Ra[w.a];F=Ra[w.b];G=Ra[w.c];$=Ra[w.d];ga[u]=C.x;ga[u+1]=C.y;ga[u+2]=C.z;ga[u+3]=C.w;ga[u+4]=F.x;ga[u+5]=F.y;ga[u+6]=F.z;ga[u+7]=F.w;ga[u+8]=G.x;ga[u+9]=G.y;ga[u+10]=G.z;ga[u+11]=G.w;ga[u+12]=$.x;ga[u+13]=$.y;ga[u+14]=$.z;ga[u+15]=$.w;C=Ua[w.a];F=Ua[w.b];G=Ua[w.c];$=Ua[w.d];fa[u]=C.x;fa[u+1]=C.y;fa[u+2]=C.z;fa[u+3]=C.w;fa[u+4]=F.x;fa[u+5]=F.y;fa[u+6]=F.z;fa[u+7]=F.w;fa[u+8]=G.x;fa[u+9]=G.y;fa[u+10]=G.z;fa[u+11]=G.w;fa[u+12]=$.x;fa[u+13]=$.y;fa[u+14]=$.z;fa[u+15]=$.w;C=Sa[w.a];
|
|
|
|
+F=Sa[w.b];G=Sa[w.c];$=Sa[w.d];da[u]=C.x;da[u+1]=C.y;da[u+2]=C.z;da[u+3]=1;da[u+4]=F.x;da[u+5]=F.y;da[u+6]=F.z;da[u+7]=1;da[u+8]=G.x;da[u+9]=G.y;da[u+10]=G.z;da[u+11]=1;da[u+12]=$.x;da[u+13]=$.y;da[u+14]=$.z;da[u+15]=1;C=Ta[w.a];F=Ta[w.b];G=Ta[w.c];$=Ta[w.d];ea[u]=C.x;ea[u+1]=C.y;ea[u+2]=C.z;ea[u+3]=1;ea[u+4]=F.x;ea[u+5]=F.y;ea[u+6]=F.z;ea[u+7]=1;ea[u+8]=G.x;ea[u+9]=G.y;ea[u+10]=G.z;ea[u+11]=1;ea[u+12]=$.x;ea[u+13]=$.y;ea[u+14]=$.z;ea[u+15]=1;u+=16}if(eb&&P){if(W.length==4&&P==THREE.VertexColors){C=
|
|
|
|
+W[0];F=W[1];G=W[2];W=W[3]}else W=G=F=C=Ga;wa[oa]=C.r;wa[oa+1]=C.g;wa[oa+2]=C.b;wa[oa+3]=F.r;wa[oa+4]=F.g;wa[oa+5]=F.b;wa[oa+6]=G.r;wa[oa+7]=G.g;wa[oa+8]=G.b;wa[oa+9]=W.r;wa[oa+10]=W.g;wa[oa+11]=W.b;oa+=12}if(db&&Ea.hasTangents){W=La[w.a].tangent;Ga=La[w.b].tangent;C=La[w.c].tangent;w=La[w.d].tangent;ca[aa]=W.x;ca[aa+1]=W.y;ca[aa+2]=W.z;ca[aa+3]=W.w;ca[aa+4]=Ga.x;ca[aa+5]=Ga.y;ca[aa+6]=Ga.z;ca[aa+7]=Ga.w;ca[aa+8]=C.x;ca[aa+9]=C.y;ca[aa+10]=C.z;ca[aa+11]=C.w;ca[aa+12]=w.x;ca[aa+13]=w.y;ca[aa+14]=w.z;
|
|
|
|
+ca[aa+15]=w.w;aa+=16}if(cb&&v)if(Z.length==4&&gb)for(w=0;w<4;w++){za=Z[w];Ma[Ha]=za.x;Ma[Ha+1]=za.y;Ma[Ha+2]=za.z;Ha+=3}else for(w=0;w<4;w++){Ma[Ha]=za.x;Ma[Ha+1]=za.y;Ma[Ha+2]=za.z;Ha+=3}if(Xa&&M!==undefined&&x)for(w=0;w<4;w++){Z=M[w];Ya[Y]=Z.u;Ya[Y+1]=Z.v;Y+=2}if(Xa&&H!==undefined&&x)for(w=0;w<4;w++){Z=H[w];Za[Fa]=Z.u;Za[Fa+1]=Z.v;Fa+=2}if(bb){Pa[Oa]=I;Pa[Oa+1]=I+1;Pa[Oa+2]=I+2;Pa[Oa+3]=I;Pa[Oa+4]=I+2;Pa[Oa+5]=I+3;Oa+=6;Ja[Ia]=I;Ja[Ia+1]=I+1;Ja[Ia+2]=I;Ja[Ia+3]=I+3;Ja[Ia+4]=I+1;Ja[Ia+5]=I+2;Ja[Ia+
|
|
|
|
+6]=I+2;Ja[Ia+7]=I+3;Ia+=8;I+=4}}}if(ab){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLVertexBuffer);d.bufferData(d.ARRAY_BUFFER,va,r)}if(fb){Ca=0;for(Wa=Qa.length;Ca<Wa;Ca++){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLMorphTargetsBuffers[Ca]);d.bufferData(d.ARRAY_BUFFER,$a[Ca],r)}}if(eb&&oa>0){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLColorBuffer);d.bufferData(d.ARRAY_BUFFER,wa,r)}if(cb){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLNormalBuffer);d.bufferData(d.ARRAY_BUFFER,Ma,r)}if(db&&Ea.hasTangents){d.bindBuffer(d.ARRAY_BUFFER,
|
|
|
|
+q.__webGLTangentBuffer);d.bufferData(d.ARRAY_BUFFER,ca,r)}if(Xa&&Y>0){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLUVBuffer);d.bufferData(d.ARRAY_BUFFER,Ya,r)}if(Xa&&Fa>0){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLUV2Buffer);d.bufferData(d.ARRAY_BUFFER,Za,r)}if(bb){d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webGLFaceBuffer);d.bufferData(d.ELEMENT_ARRAY_BUFFER,Pa,r);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webGLLineBuffer);d.bufferData(d.ELEMENT_ARRAY_BUFFER,Ja,r)}if(u>0){d.bindBuffer(d.ARRAY_BUFFER,q.__webGLSkinVertexABuffer);
|
|
d.bufferData(d.ARRAY_BUFFER,da,r);d.bindBuffer(d.ARRAY_BUFFER,q.__webGLSkinVertexBBuffer);d.bufferData(d.ARRAY_BUFFER,ea,r);d.bindBuffer(d.ARRAY_BUFFER,q.__webGLSkinIndicesBuffer);d.bufferData(d.ARRAY_BUFFER,fa,r);d.bindBuffer(d.ARRAY_BUFFER,q.__webGLSkinWeightsBuffer);d.bufferData(d.ARRAY_BUFFER,ga,r)}}}k.__dirtyVertices=!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||
|
|
d.bufferData(d.ARRAY_BUFFER,da,r);d.bindBuffer(d.ARRAY_BUFFER,q.__webGLSkinVertexBBuffer);d.bufferData(d.ARRAY_BUFFER,ea,r);d.bindBuffer(d.ARRAY_BUFFER,q.__webGLSkinIndicesBuffer);d.bufferData(d.ARRAY_BUFFER,fa,r);d.bindBuffer(d.ARRAY_BUFFER,q.__webGLSkinWeightsBuffer);d.bufferData(d.ARRAY_BUFFER,ga,r)}}}k.__dirtyVertices=!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=!1;k.__dirtyTangents=!1;k.__dirtyColors=!1}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||
|
|
-k.__dirtyColors){h=k;t=d.DYNAMIC_DRAW;x=void 0;x=void 0;Q=void 0;q=void 0;v=h.vertices;r=h.colors;L=v.length;E=r.length;H=h.__vertexArray;V=h.__colorArray;J=h.__dirtyColors;if(h.__dirtyVertices){for(x=0;x<L;x++){Q=v[x].position;q=x*3;H[q]=Q.x;H[q+1]=Q.y;H[q+2]=Q.z}d.bindBuffer(d.ARRAY_BUFFER,h.__webGLVertexBuffer);d.bufferData(d.ARRAY_BUFFER,H,t)}if(J){for(x=0;x<E;x++){color=r[x];q=x*3;V[q]=color.r;V[q+1]=color.g;V[q+2]=color.b}d.bindBuffer(d.ARRAY_BUFFER,h.__webGLColorBuffer);d.bufferData(d.ARRAY_BUFFER,
|
|
|
|
-V,t)}}k.__dirtyVertices=!1;k.__dirtyColors=!1}else if(h instanceof THREE.Line){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;t=d.DYNAMIC_DRAW;x=void 0;x=void 0;Q=void 0;q=void 0;v=h.vertices;r=h.colors;L=v.length;E=r.length;H=h.__vertexArray;V=h.__colorArray;J=h.__dirtyColors;if(h.__dirtyVertices){for(x=0;x<L;x++){Q=v[x].position;q=x*3;H[q]=Q.x;H[q+1]=Q.y;H[q+2]=Q.z}d.bindBuffer(d.ARRAY_BUFFER,h.__webGLVertexBuffer);d.bufferData(d.ARRAY_BUFFER,H,t)}if(J){for(x=0;x<E;x++){color=r[x];q=x*
|
|
|
|
-3;V[q]=color.r;V[q+1]=color.g;V[q+2]=color.b}d.bindBuffer(d.ARRAY_BUFFER,h.__webGLColorBuffer);d.bufferData(d.ARRAY_BUFFER,V,t)}}k.__dirtyVertices=!1;k.__dirtyColors=!1}else if(h instanceof THREE.ParticleSystem){k=h.geometry;(k.__dirtyVertices||k.__dirtyColors||h.sortParticles)&&b(k,d.DYNAMIC_DRAW,h);k.__dirtyVertices=!1;k.__dirtyColors=!1}}};this.setFaceCulling=function(g,m){if(g){!m||m=="ccw"?d.frontFace(d.CCW):d.frontFace(d.CW);if(g=="back")d.cullFace(d.BACK);else g=="front"?d.cullFace(d.FRONT):
|
|
|
|
|
|
+k.__dirtyColors){h=k;t=d.DYNAMIC_DRAW;x=void 0;x=void 0;P=void 0;q=void 0;v=h.vertices;r=h.colors;M=v.length;E=r.length;H=h.__vertexArray;U=h.__colorArray;I=h.__dirtyColors;if(h.__dirtyVertices){for(x=0;x<M;x++){P=v[x].position;q=x*3;H[q]=P.x;H[q+1]=P.y;H[q+2]=P.z}d.bindBuffer(d.ARRAY_BUFFER,h.__webGLVertexBuffer);d.bufferData(d.ARRAY_BUFFER,H,t)}if(I){for(x=0;x<E;x++){color=r[x];q=x*3;U[q]=color.r;U[q+1]=color.g;U[q+2]=color.b}d.bindBuffer(d.ARRAY_BUFFER,h.__webGLColorBuffer);d.bufferData(d.ARRAY_BUFFER,
|
|
|
|
+U,t)}}k.__dirtyVertices=!1;k.__dirtyColors=!1}else if(h instanceof THREE.Line){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;t=d.DYNAMIC_DRAW;x=void 0;x=void 0;P=void 0;q=void 0;v=h.vertices;r=h.colors;M=v.length;E=r.length;H=h.__vertexArray;U=h.__colorArray;I=h.__dirtyColors;if(h.__dirtyVertices){for(x=0;x<M;x++){P=v[x].position;q=x*3;H[q]=P.x;H[q+1]=P.y;H[q+2]=P.z}d.bindBuffer(d.ARRAY_BUFFER,h.__webGLVertexBuffer);d.bufferData(d.ARRAY_BUFFER,H,t)}if(I){for(x=0;x<E;x++){color=r[x];q=x*
|
|
|
|
+3;U[q]=color.r;U[q+1]=color.g;U[q+2]=color.b}d.bindBuffer(d.ARRAY_BUFFER,h.__webGLColorBuffer);d.bufferData(d.ARRAY_BUFFER,U,t)}}k.__dirtyVertices=!1;k.__dirtyColors=!1}else if(h instanceof THREE.ParticleSystem){k=h.geometry;(k.__dirtyVertices||k.__dirtyColors||h.sortParticles)&&b(k,d.DYNAMIC_DRAW,h);k.__dirtyVertices=!1;k.__dirtyColors=!1}}};this.setFaceCulling=function(g,m){if(g){!m||m=="ccw"?d.frontFace(d.CCW):d.frontFace(d.CW);if(g=="back")d.cullFace(d.BACK);else g=="front"?d.cullFace(d.FRONT):
|
|
d.cullFace(d.FRONT_AND_BACK);d.enable(d.CULL_FACE)}else d.disable(d.CULL_FACE)};this.supportsVertexTextures=function(){return d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0}};
|
|
d.cullFace(d.FRONT_AND_BACK);d.enable(d.CULL_FACE)}else d.disable(d.CULL_FACE)};this.supportsVertexTextures=function(){return d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0}};
|