|
@@ -16,37 +16,37 @@ b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this
|
|
|
normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3};
|
|
|
THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(a){return this.intersectObjects(a.objects)},intersectObjects:function(a){var b,c,e=[];b=0;for(c=a.length;b<c;b++)Array.prototype.push.apply(e,this.intersectObject(a[b]));e.sort(function(a,b){return a.distance-b.distance});return e},intersectObject:function(a){function b(a,b,c){var e;e=c.clone().subSelf(a).dot(b);if(e<=0)return null;a=a.clone().addSelf(b.clone().multiplyScalar(e));return c.distanceTo(a)}function c(a,b,c,e){var e=e.clone().subSelf(b),
|
|
|
c=c.clone().subSelf(b),f=a.clone().subSelf(b),a=e.dot(e),b=e.dot(c),e=e.dot(f),h=c.dot(c),c=c.dot(f),f=1/(a*h-b*b),h=(h*e-b*c)*f,a=(a*c-b*e)*f;return h>0&&a>0&&h+a<1}for(var e,f=[],h=0,i=a.children.length;h<i;h++)Array.prototype.push.apply(f,this.intersectObject(a.children[h]));if(a instanceof THREE.Particle){h=b(this.origin,this.direction,a.matrixWorld.getPosition());if(h===null||h>a.scale.x)return[];e={distance:h,point:a.position,face:null,object:a};f.push(e)}else if(a instanceof THREE.Mesh){h=
|
|
|
-b(this.origin,this.direction,a.matrixWorld.getPosition());if(h===null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var j,m,k,o,p,l,t,A,C=a.geometry,E=C.vertices,h=0,i=C.faces.length;h<i;h++)if(e=C.faces[h],t=this.origin.clone(),A=this.direction.clone(),o=a.matrixWorld,j=o.multiplyVector3(e.centroid.clone()).subSelf(t),l=j.dot(A),!(l<=0)&&(j=o.multiplyVector3(E[e.a].position.clone()),m=o.multiplyVector3(E[e.b].position.clone()),k=o.multiplyVector3(E[e.c].position.clone()),
|
|
|
-o=e instanceof THREE.Face4?o.multiplyVector3(E[e.d].position.clone()):null,p=a.matrixRotationWorld.multiplyVector3(e.normal.clone()),l=A.dot(p),a.doubleSided||(a.flipSided?l>0:l<0)))if(l=p.dot((new THREE.Vector3).sub(j,t))/l,t=t.addSelf(A.multiplyScalar(l)),e instanceof THREE.Face3)c(t,j,m,k)&&(e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(t,j,m,o)||c(t,m,k,o)))e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e)}return f}};
|
|
|
-THREE.Rectangle=function(){function a(){h=e-b;i=f-c}var b,c,e,f,h,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(h,i,o,p){j=!1;b=h;c=i;e=o;f=p;a()};this.addPoint=function(h,i){j?(j=!1,b=h,c=i,e=h,f=i):(b=b<h?b:h,c=c<i?c:i,e=e>h?e:h,f=f>i?f:i);a()};this.add3Points=
|
|
|
-function(h,i,o,p,l,t){j?(j=!1,b=h<o?h<l?h:l:o<l?o:l,c=i<p?i<t?i:t:p<t?p:t,e=h>o?h>l?h:l:o>l?o:l,f=i>p?i>t?i:t:p>t?p:t):(b=h<o?h<l?h<b?h:b:l<b?l:b:o<l?o<b?o:b:l<b?l:b,c=i<p?i<t?i<c?i:c:t<c?t:c:p<t?p<c?p:c:t<c?t:c,e=h>o?h>l?h>e?h:e:l>e?l:e:o>l?o>e?o:e:l>e?l:e,f=i>p?i>t?i>f?i:f:t>f?t:f:p>t?p>f?p:f:t>f?t:f);a()};this.addRectangle=function(h){j?(j=!1,b=h.getLeft(),c=h.getTop(),e=h.getRight(),f=h.getBottom()):(b=b<h.getLeft()?b:h.getLeft(),c=c<h.getTop()?c:h.getTop(),e=e>h.getRight()?e:h.getRight(),f=f>
|
|
|
+b(this.origin,this.direction,a.matrixWorld.getPosition());if(h===null||h>a.geometry.boundingSphere.radius*Math.max(a.scale.x,Math.max(a.scale.y,a.scale.z)))return f;for(var j,o,k,m,p,l,t,A,C=a.geometry,E=C.vertices,h=0,i=C.faces.length;h<i;h++)if(e=C.faces[h],t=this.origin.clone(),A=this.direction.clone(),m=a.matrixWorld,j=m.multiplyVector3(e.centroid.clone()).subSelf(t),l=j.dot(A),!(l<=0)&&(j=m.multiplyVector3(E[e.a].position.clone()),o=m.multiplyVector3(E[e.b].position.clone()),k=m.multiplyVector3(E[e.c].position.clone()),
|
|
|
+m=e instanceof THREE.Face4?m.multiplyVector3(E[e.d].position.clone()):null,p=a.matrixRotationWorld.multiplyVector3(e.normal.clone()),l=A.dot(p),a.doubleSided||(a.flipSided?l>0:l<0)))if(l=p.dot((new THREE.Vector3).sub(j,t))/l,t=t.addSelf(A.multiplyScalar(l)),e instanceof THREE.Face3)c(t,j,o,k)&&(e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e));else if(e instanceof THREE.Face4&&(c(t,j,o,m)||c(t,o,k,m)))e={distance:this.origin.distanceTo(t),point:t,face:e,object:a},f.push(e)}return f}};
|
|
|
+THREE.Rectangle=function(){function a(){h=e-b;i=f-c}var b,c,e,f,h,i,j=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return h};this.getHeight=function(){return i};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return e};this.getBottom=function(){return f};this.set=function(h,i,m,p){j=!1;b=h;c=i;e=m;f=p;a()};this.addPoint=function(h,i){j?(j=!1,b=h,c=i,e=h,f=i):(b=b<h?b:h,c=c<i?c:i,e=e>h?e:h,f=f>i?f:i);a()};this.add3Points=
|
|
|
+function(h,i,m,p,l,t){j?(j=!1,b=h<m?h<l?h:l:m<l?m:l,c=i<p?i<t?i:t:p<t?p:t,e=h>m?h>l?h:l:m>l?m:l,f=i>p?i>t?i:t:p>t?p:t):(b=h<m?h<l?h<b?h:b:l<b?l:b:m<l?m<b?m:b:l<b?l:b,c=i<p?i<t?i<c?i:c:t<c?t:c:p<t?p<c?p:c:t<c?t:c,e=h>m?h>l?h>e?h:e:l>e?l:e:m>l?m>e?m:e:l>e?l:e,f=i>p?i>t?i>f?i:f:t>f?t:f:p>t?p>f?p:f:t>f?t:f);a()};this.addRectangle=function(h){j?(j=!1,b=h.getLeft(),c=h.getTop(),e=h.getRight(),f=h.getBottom()):(b=b<h.getLeft()?b:h.getLeft(),c=c<h.getTop()?c:h.getTop(),e=e>h.getRight()?e:h.getRight(),f=f>
|
|
|
h.getBottom()?f:h.getBottom());a()};this.inflate=function(h){b-=h;c-=h;e+=h;f+=h;a()};this.minSelf=function(h){b=b>h.getLeft()?b:h.getLeft();c=c>h.getTop()?c:h.getTop();e=e<h.getRight()?e:h.getRight();f=f<h.getBottom()?f:h.getBottom();a()};this.intersects=function(a){return Math.min(e,a.getRight())-Math.max(b,a.getLeft())>=0&&Math.min(f,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){j=!0;f=e=c=b=0;a()};this.isEmpty=function(){return j}};THREE.Matrix3=function(){this.m=[]};
|
|
|
THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};
|
|
|
-THREE.Matrix4=function(a,b,c,e,f,h,i,j,m,k,o,p,l,t,A,C){this.set(a!==void 0?a:1,b||0,c||0,e||0,f||0,h!==void 0?h:1,i||0,j||0,m||0,k||0,o!==void 0?o:1,p||0,l||0,t||0,A||0,C!==void 0?C:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
|
|
|
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,f,h,i,j,m,k,o,p,l,t,A,C){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=h;this.n23=i;this.n24=j;this.n31=m;this.n32=k;this.n33=o;this.n34=p;this.n41=l;this.n42=t;this.n43=A;this.n44=C;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
|
|
|
+THREE.Matrix4=function(a,b,c,e,f,h,i,j,o,k,m,p,l,t,A,C){this.set(a!==void 0?a:1,b||0,c||0,e||0,f||0,h!==void 0?h:1,i||0,j||0,o||0,k||0,m!==void 0?m:1,p||0,l||0,t||0,A||0,C!==void 0?C:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
|
|
|
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,e,f,h,i,j,o,k,m,p,l,t,A,C){this.n11=a;this.n12=b;this.n13=c;this.n14=e;this.n21=f;this.n22=h;this.n23=i;this.n24=j;this.n31=o;this.n32=k;this.n33=m;this.n34=p;this.n41=l;this.n42=t;this.n43=A;this.n44=C;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,
|
|
|
b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;h.sub(a,b).normalize();if(h.length()===0)h.z=1;e.cross(c,h).normalize();e.length()===0&&(h.x+=1.0E-4,e.cross(c,h).normalize());f.cross(h,e).normalize();this.n11=e.x;this.n12=f.x;this.n13=h.x;this.n21=e.y;this.n22=f.y;this.n23=h.y;this.n31=e.z;this.n32=f.z;this.n33=h.z;return this},multiplyVector3:function(a){var b=a.x,c=a.y,e=a.z,f=1/(this.n41*b+this.n42*c+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*e+this.n14)*f;
|
|
|
a.y=(this.n21*b+this.n22*c+this.n23*e+this.n24)*f;a.z=(this.n31*b+this.n32*c+this.n33*e+this.n34)*f;return a},multiplyVector4:function(a){var b=a.x,c=a.y,e=a.z,f=a.w;a.x=this.n11*b+this.n12*c+this.n13*e+this.n14*f;a.y=this.n21*b+this.n22*c+this.n23*e+this.n24*f;a.z=this.n31*b+this.n32*c+this.n33*e+this.n34*f;a.w=this.n41*b+this.n42*c+this.n43*e+this.n44*f;return a},rotateAxis:function(a){var b=a.x,c=a.y,e=a.z;a.x=b*this.n11+c*this.n12+e*this.n13;a.y=b*this.n21+c*this.n22+e*this.n23;a.z=b*this.n31+
|
|
|
-c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,m=a.n23,k=a.n24,o=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44,va=b.n11,wa=
|
|
|
-b.n12,pa=b.n13,qa=b.n14,N=b.n21,F=b.n22,z=b.n23,W=b.n24,U=b.n31,ja=b.n32,$=b.n33,xa=b.n34,Q=b.n41,G=b.n42,d=b.n43,ta=b.n44;this.n11=c*va+e*N+f*U+h*Q;this.n12=c*wa+e*F+f*ja+h*G;this.n13=c*pa+e*z+f*$+h*d;this.n14=c*qa+e*W+f*xa+h*ta;this.n21=i*va+j*N+m*U+k*Q;this.n22=i*wa+j*F+m*ja+k*G;this.n23=i*pa+j*z+m*$+k*d;this.n24=i*qa+j*W+m*xa+k*ta;this.n31=o*va+p*N+l*U+t*Q;this.n32=o*wa+p*F+l*ja+t*G;this.n33=o*pa+p*z+l*$+t*d;this.n34=o*qa+p*W+l*xa+t*ta;this.n41=A*va+C*N+E*U+B*Q;this.n42=A*wa+C*F+E*ja+B*G;this.n43=
|
|
|
+c*this.n32+e*this.n33;a.normalize();return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,o=a.n23,k=a.n24,m=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44,va=b.n11,wa=
|
|
|
+b.n12,pa=b.n13,qa=b.n14,N=b.n21,F=b.n22,z=b.n23,W=b.n24,U=b.n31,ja=b.n32,$=b.n33,xa=b.n34,Q=b.n41,G=b.n42,d=b.n43,ta=b.n44;this.n11=c*va+e*N+f*U+h*Q;this.n12=c*wa+e*F+f*ja+h*G;this.n13=c*pa+e*z+f*$+h*d;this.n14=c*qa+e*W+f*xa+h*ta;this.n21=i*va+j*N+o*U+k*Q;this.n22=i*wa+j*F+o*ja+k*G;this.n23=i*pa+j*z+o*$+k*d;this.n24=i*qa+j*W+o*xa+k*ta;this.n31=m*va+p*N+l*U+t*Q;this.n32=m*wa+p*F+l*ja+t*G;this.n33=m*pa+p*z+l*$+t*d;this.n34=m*qa+p*W+l*xa+t*ta;this.n41=A*va+C*N+E*U+B*Q;this.n42=A*wa+C*F+E*ja+B*G;this.n43=
|
|
|
A*pa+C*z+E*$+B*d;this.n44=A*qa+C*W+E*xa+B*ta;return this},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=
|
|
|
-a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,f=this.n21,h=this.n22,i=this.n23,j=this.n24,m=this.n31,k=this.n32,o=this.n33,p=this.n34,l=this.n41,t=this.n42,A=this.n43,C=this.n44;return e*i*k*l-c*j*k*l-e*h*o*l+b*j*o*l+c*h*p*l-b*i*p*l-e*i*m*t+c*j*m*t+e*f*o*t-a*j*o*t-c*f*p*t+a*i*p*t+e*h*m*A-b*j*m*A-e*f*k*A+a*j*k*A+b*f*p*A-a*h*p*A-c*h*m*C+b*i*
|
|
|
-m*C+c*f*k*C-a*i*k*C-b*f*o*C+a*h*o*C},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;
|
|
|
+a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,e=this.n14,f=this.n21,h=this.n22,i=this.n23,j=this.n24,o=this.n31,k=this.n32,m=this.n33,p=this.n34,l=this.n41,t=this.n42,A=this.n43,C=this.n44;return e*i*k*l-c*j*k*l-e*h*m*l+b*j*m*l+c*h*p*l-b*i*p*l-e*i*o*t+c*j*o*t+e*f*m*t-a*j*m*t-c*f*p*t+a*i*p*t+e*h*o*A-b*j*o*A-e*f*k*A+a*j*k*A+b*f*p*A-a*h*p*A-c*h*o*C+b*i*
|
|
|
+o*C+c*f*k*C-a*i*k*C-b*f*m*C+a*h*m*C},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;
|
|
|
a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=
|
|
|
this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=
|
|
|
this.n34;a[b+15]=this.n44;return a},setTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,
|
|
|
-0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),e=Math.sin(b),f=1-c,h=a.x,i=a.y,j=a.z,m=f*h,k=f*i;this.set(m*h+c,m*i-e*j,m*j+e*i,0,m*i+e*j,k*i+c,k*j-e*h,0,m*j-e*i,k*j+e*h,f*j*j+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
|
|
|
-new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,e=a.y,f=a.z,h=Math.cos(c),c=Math.sin(c),i=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var m=
|
|
|
-i*j,k=i*f,o=e*j,p=e*f;this.n11=m+p*c;this.n12=o*c-k;this.n13=h*e;this.n21=h*f;this.n22=h*j;this.n23=-c;this.n31=k*c-o;this.n32=p+m*c;this.n33=h*i;break;case "ZXY":m=i*j;k=i*f;o=e*j;p=e*f;this.n11=m-p*c;this.n12=-h*f;this.n13=o+k*c;this.n21=k+o*c;this.n22=h*j;this.n23=p-m*c;this.n31=-h*e;this.n32=c;this.n33=h*i;break;case "ZYX":m=h*j;k=h*f;o=c*j;p=c*f;this.n11=i*j;this.n12=o*e-k;this.n13=m*e+p;this.n21=i*f;this.n22=p*e+m;this.n23=k*e-o;this.n31=-e;this.n32=c*i;this.n33=h*i;break;case "YZX":m=h*i;k=
|
|
|
-h*e;o=c*i;p=c*e;this.n11=i*j;this.n12=p-m*f;this.n13=o*f+k;this.n21=f;this.n22=h*j;this.n23=-c*j;this.n31=-e*j;this.n32=k*f+o;this.n33=m-p*f;break;case "XZY":m=h*i;k=h*e;o=c*i;p=c*e;this.n11=i*j;this.n12=-f;this.n13=e*j;this.n21=m*f+p;this.n22=h*j;this.n23=k*f-o;this.n31=o*f-k;this.n32=c*j;this.n33=p*f+m;break;default:m=h*j,k=h*f,o=c*j,p=c*f,this.n11=i*j,this.n12=-i*f,this.n13=e,this.n21=k+o*e,this.n22=m-p*e,this.n23=-c*i,this.n31=p-m*e,this.n32=o+k*e,this.n33=h*i}return this},setRotationFromQuaternion:function(a){var b=
|
|
|
-a.x,c=a.y,e=a.z,f=a.w,h=b+b,i=c+c,j=e+e,a=b*h,m=b*i;b*=j;var k=c*i;c*=j;e*=j;h*=f;i*=f;f*=j;this.n11=1-(k+e);this.n12=m-f;this.n13=b+i;this.n21=m+f;this.n22=1-(a+e);this.n23=c-h;this.n31=b-i;this.n32=c+h;this.n33=1-(a+k);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2;
|
|
|
+0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,b){var c=Math.cos(b),e=Math.sin(b),f=1-c,h=a.x,i=a.y,j=a.z,o=f*h,k=f*i;this.set(o*h+c,o*i-e*j,o*j+e*i,0,o*i+e*j,k*i+c,k*j-e*h,0,o*j-e*i,k*j+e*h,f*j*j+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
|
|
|
+new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(a,b){var c=a.x,e=a.y,f=a.z,h=Math.cos(c),c=Math.sin(c),i=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var o=
|
|
|
+i*j,k=i*f,m=e*j,p=e*f;this.n11=o+p*c;this.n12=m*c-k;this.n13=h*e;this.n21=h*f;this.n22=h*j;this.n23=-c;this.n31=k*c-m;this.n32=p+o*c;this.n33=h*i;break;case "ZXY":o=i*j;k=i*f;m=e*j;p=e*f;this.n11=o-p*c;this.n12=-h*f;this.n13=m+k*c;this.n21=k+m*c;this.n22=h*j;this.n23=p-o*c;this.n31=-h*e;this.n32=c;this.n33=h*i;break;case "ZYX":o=h*j;k=h*f;m=c*j;p=c*f;this.n11=i*j;this.n12=m*e-k;this.n13=o*e+p;this.n21=i*f;this.n22=p*e+o;this.n23=k*e-m;this.n31=-e;this.n32=c*i;this.n33=h*i;break;case "YZX":o=h*i;k=
|
|
|
+h*e;m=c*i;p=c*e;this.n11=i*j;this.n12=p-o*f;this.n13=m*f+k;this.n21=f;this.n22=h*j;this.n23=-c*j;this.n31=-e*j;this.n32=k*f+m;this.n33=o-p*f;break;case "XZY":o=h*i;k=h*e;m=c*i;p=c*e;this.n11=i*j;this.n12=-f;this.n13=e*j;this.n21=o*f+p;this.n22=h*j;this.n23=k*f-m;this.n31=m*f-k;this.n32=c*j;this.n33=p*f+o;break;default:o=h*j,k=h*f,m=c*j,p=c*f,this.n11=i*j,this.n12=-i*f,this.n13=e,this.n21=k+m*e,this.n22=o-p*e,this.n23=-c*i,this.n31=p-o*e,this.n32=m+k*e,this.n33=h*i}return this},setRotationFromQuaternion:function(a){var b=
|
|
|
+a.x,c=a.y,e=a.z,f=a.w,h=b+b,i=c+c,j=e+e,a=b*h,o=b*i;b*=j;var k=c*i;c*=j;e*=j;h*=f;i*=f;f*=j;this.n11=1-(k+e);this.n12=o-f;this.n13=b+i;this.n21=o+f;this.n22=1-(a+e);this.n23=c-h;this.n31=b-i;this.n32=c+h;this.n33=1-(a+k);return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2;
|
|
|
e.identity();e.setRotationFromQuaternion(b);f.setScale(c.x,c.y,c.z);this.multiply(e,f);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,h=THREE.Matrix4.__v3;e.set(this.n11,this.n21,this.n31);f.set(this.n12,this.n22,this.n32);h.set(this.n13,this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=e.length();
|
|
|
c.y=f.length();c.z=h.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;e=THREE.Matrix4.__m1;e.copy(this);e.n11/=c.x;e.n21/=c.x;e.n31/=c.x;e.n12/=c.y;e.n22/=c.y;e.n32/=c.y;e.n13/=c.z;e.n23/=c.z;e.n33/=c.z;b.setFromRotationMatrix(e);return[a,b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var c=1/b.x,e=1/b.y,f=1/b.z;this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*e;this.n22=a.n22*e;this.n32=a.n32*e;this.n13=a.n13*f;this.n23=
|
|
|
a.n23*f;this.n33=a.n33*f}};
|
|
|
-THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,m=a.n23,k=a.n24,o=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=m*t*C-k*l*C+k*p*E-j*t*E-m*p*B+j*l*B;b.n12=h*l*C-f*t*C-h*p*E+e*t*E+f*p*B-e*l*B;b.n13=f*k*C-h*m*C+h*j*E-e*k*E-f*j*B+e*m*B;b.n14=h*m*p-f*k*p-h*j*l+e*k*l+f*j*t-e*m*t;b.n21=k*l*A-m*t*A-k*o*E+i*t*E+m*o*B-i*l*B;b.n22=f*t*A-h*l*A+h*o*E-c*t*E-f*o*B+c*l*B;b.n23=h*m*A-f*k*A-h*i*E+c*k*E+f*i*B-c*m*B;b.n24=
|
|
|
-f*k*o-h*m*o+h*i*l-c*k*l-f*i*t+c*m*t;b.n31=j*t*A-k*p*A+k*o*C-i*t*C-j*o*B+i*p*B;b.n32=h*p*A-e*t*A-h*o*C+c*t*C+e*o*B-c*p*B;b.n33=f*k*A-h*j*A+h*i*C-c*k*C-e*i*B+c*j*B;b.n34=h*j*o-e*k*o-h*i*p+c*k*p+e*i*t-c*j*t;b.n41=m*p*A-j*l*A-m*o*C+i*l*C+j*o*E-i*p*E;b.n42=e*l*A-f*p*A+f*o*C-c*l*C-e*o*E+c*p*E;b.n43=f*j*A-e*m*A-f*i*C+c*m*C+e*i*E-c*j*E;b.n44=e*m*o-f*j*o+f*i*p-c*m*p-e*i*l+c*j*l;b.multiplyScalar(1/a.determinant());return b};
|
|
|
-THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,m=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,o=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*k;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*m;c[6]=a*k;c[7]=a*o;c[8]=a*p;return b};
|
|
|
+THREE.Matrix4.makeInvert=function(a,b){var c=a.n11,e=a.n12,f=a.n13,h=a.n14,i=a.n21,j=a.n22,o=a.n23,k=a.n24,m=a.n31,p=a.n32,l=a.n33,t=a.n34,A=a.n41,C=a.n42,E=a.n43,B=a.n44;b===void 0&&(b=new THREE.Matrix4);b.n11=o*t*C-k*l*C+k*p*E-j*t*E-o*p*B+j*l*B;b.n12=h*l*C-f*t*C-h*p*E+e*t*E+f*p*B-e*l*B;b.n13=f*k*C-h*o*C+h*j*E-e*k*E-f*j*B+e*o*B;b.n14=h*o*p-f*k*p-h*j*l+e*k*l+f*j*t-e*o*t;b.n21=k*l*A-o*t*A-k*m*E+i*t*E+o*m*B-i*l*B;b.n22=f*t*A-h*l*A+h*m*E-c*t*E-f*m*B+c*l*B;b.n23=h*o*A-f*k*A-h*i*E+c*k*E+f*i*B-c*o*B;b.n24=
|
|
|
+f*k*m-h*o*m+h*i*l-c*k*l-f*i*t+c*o*t;b.n31=j*t*A-k*p*A+k*m*C-i*t*C-j*m*B+i*p*B;b.n32=h*p*A-e*t*A-h*m*C+c*t*C+e*m*B-c*p*B;b.n33=f*k*A-h*j*A+h*i*C-c*k*C-e*i*B+c*j*B;b.n34=h*j*m-e*k*m-h*i*p+c*k*p+e*i*t-c*j*t;b.n41=o*p*A-j*l*A-o*m*C+i*l*C+j*m*E-i*p*E;b.n42=e*l*A-f*p*A+f*m*C-c*l*C-e*m*E+c*p*E;b.n43=f*j*A-e*o*A-f*i*C+c*o*C+e*i*E-c*j*E;b.n44=e*o*m-f*j*m+f*i*p-c*o*p-e*i*l+c*j*l;b.multiplyScalar(1/a.determinant());return b};
|
|
|
+THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,e=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,h=a.n32*a.n21-a.n31*a.n22,i=-a.n33*a.n12+a.n32*a.n13,j=a.n33*a.n11-a.n31*a.n13,o=-a.n32*a.n11+a.n31*a.n12,k=a.n23*a.n12-a.n22*a.n13,m=-a.n23*a.n11+a.n21*a.n13,p=a.n22*a.n11-a.n21*a.n12,a=a.n11*e+a.n21*i+a.n31*k;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*e;c[1]=a*f;c[2]=a*h;c[3]=a*i;c[4]=a*j;c[5]=a*o;c[6]=a*k;c[7]=a*m;c[8]=a*p;return b};
|
|
|
THREE.Matrix4.makeFrustum=function(a,b,c,e,f,h){var i;i=new THREE.Matrix4;i.n11=2*f/(b-a);i.n12=0;i.n13=(b+a)/(b-a);i.n14=0;i.n21=0;i.n22=2*f/(e-c);i.n23=(e+c)/(e-c);i.n24=0;i.n31=0;i.n32=0;i.n33=-(h+f)/(h-f);i.n34=-2*h*f/(h-f);i.n41=0;i.n42=0;i.n43=-1;i.n44=0;return i};THREE.Matrix4.makePerspective=function(a,b,c,e){var f,a=c*Math.tan(a*Math.PI/360);f=-a;return THREE.Matrix4.makeFrustum(f*b,a*b,f,a,c,e)};
|
|
|
-THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var i,j,m,k;i=new THREE.Matrix4;j=b-a;m=c-e;k=h-f;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/m;i.n23=0;i.n24=-((c+e)/m);i.n31=0;i.n32=0;i.n33=-2/k;i.n34=-((h+f)/k);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
|
|
|
+THREE.Matrix4.makeOrtho=function(a,b,c,e,f,h){var i,j,o,k;i=new THREE.Matrix4;j=b-a;o=c-e;k=h-f;i.n11=2/j;i.n12=0;i.n13=0;i.n14=-((b+a)/j);i.n21=0;i.n22=2/o;i.n23=0;i.n24=-((c+e)/o);i.n31=0;i.n32=0;i.n33=-2/k;i.n34=-((h+f)/k);i.n41=0;i.n42=0;i.n43=0;i.n44=1;return i};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
|
|
|
THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
|
|
|
!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
|
|
|
THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)===
|
|
@@ -54,40 +54,40 @@ THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(a,b){thi
|
|
|
a)return f;if(b&&(f=f.getChildByName(a,b),f!==void 0))return f}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},update:function(a,b,c){this.matrixAutoUpdate&&
|
|
|
this.updateMatrix();if(this.matrixWorldNeedsUpdate||b)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,b=!0;for(var a=0,e=this.children.length;a<e;a++)this.children[a].update(this.matrixWorld,b,c)},addChild:function(a){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");this.add(a)},removeChild:function(a){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");
|
|
|
this.remove(a)}};THREE.Object3DCount=0;
|
|
|
-THREE.Projector=function(){function a(){var a=m[j]=m[j]||new THREE.RenderableVertex;j++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,h=b.z+b.w,f=-a.z+a.w,i=-b.z+b.w;return e>=0&&h>=0&&f>=0&&i>=0?!0:e<0&&h<0||f<0&&i<0?!1:(e<0?c=Math.max(c,e/(e-h)):h<0&&(d=Math.min(d,e/(e-h))),f<0?c=Math.max(c,f/(f-i)):i<0&&(d=Math.min(d,f/(f-i))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var e,f,h=[],i,j,m=[],k,o,p=[],l,t=[],A,C,E=[],B,va,wa=[],pa=[],qa=[],N=new THREE.Vector4,
|
|
|
+THREE.Projector=function(){function a(){var a=o[j]=o[j]||new THREE.RenderableVertex;j++;return a}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,h=b.z+b.w,f=-a.z+a.w,i=-b.z+b.w;return e>=0&&h>=0&&f>=0&&i>=0?!0:e<0&&h<0||f<0&&i<0?!1:(e<0?c=Math.max(c,e/(e-h)):h<0&&(d=Math.min(d,e/(e-h))),f<0?c=Math.max(c,f/(f-i)):i<0&&(d=Math.min(d,f/(f-i))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var e,f,h=[],i,j,o=[],k,m,p=[],l,t=[],A,C,E=[],B,va,wa=[],pa=[],qa=[],N=new THREE.Vector4,
|
|
|
F=new THREE.Vector4,z=new THREE.Matrix4,W=new THREE.Matrix4,U=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],ja=new THREE.Vector4,$=new THREE.Vector4;this.projectVector=function(a,b){z.multiply(b.projectionMatrix,b.matrixWorldInverse);z.multiplyVector3(a);return a};this.unprojectVector=function(a,b){z.multiply(b.matrixWorld,THREE.Matrix4.makeInvert(b.projectionMatrix));z.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;
|
|
|
-a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectObjects=function(a,c,i){var d,j;f=pa.length=0;d=a.objects;a=0;for(c=d.length;a<c;a++){j=d[a];var k;if(!(k=!j.visible))if(k=j instanceof THREE.Mesh)if(k=j.frustumCulled){a:{k=void 0;for(var m=j.matrixWorld,t=-j.geometry.boundingSphere.radius*Math.max(j.scale.x,Math.max(j.scale.y,j.scale.z)),o=0;o<6;o++)if(k=U[o].x*m.n14+U[o].y*m.n24+U[o].z*m.n34+
|
|
|
-U[o].w,k<=t){k=!1;break a}k=!0}k=!k}if(!k)k=h[f]=h[f]||new THREE.RenderableObject,f++,e=k,N.copy(j.position),z.multiplyVector3(N),e.object=j,e.z=N.z,pa.push(e)}i&&pa.sort(b);return pa};this.projectScene=function(e,h,f){var d=h.near,pa=h.far,N,ua,J,R,S,T,X,ka,aa,O,za,La,Ra,Ha,Aa,Ca,ya;va=C=l=o=qa.length=0;h.matrixAutoUpdate&&h.update(void 0,!0);e.update(void 0,!1,h);z.multiply(h.projectionMatrix,h.matrixWorldInverse);U[0].set(z.n41-z.n11,z.n42-z.n12,z.n43-z.n13,z.n44-z.n14);U[1].set(z.n41+z.n11,z.n42+
|
|
|
+a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectObjects=function(a,c,i){var d,j;f=pa.length=0;d=a.objects;a=0;for(c=d.length;a<c;a++){j=d[a];var k;if(!(k=!j.visible))if(k=j instanceof THREE.Mesh)if(k=j.frustumCulled){a:{k=void 0;for(var o=j.matrixWorld,t=-j.geometry.boundingSphere.radius*Math.max(j.scale.x,Math.max(j.scale.y,j.scale.z)),m=0;m<6;m++)if(k=U[m].x*o.n14+U[m].y*o.n24+U[m].z*o.n34+
|
|
|
+U[m].w,k<=t){k=!1;break a}k=!0}k=!k}if(!k)k=h[f]=h[f]||new THREE.RenderableObject,f++,e=k,N.copy(j.position),z.multiplyVector3(N),e.object=j,e.z=N.z,pa.push(e)}i&&pa.sort(b);return pa};this.projectScene=function(e,h,f){var d=h.near,pa=h.far,N,ua,J,R,S,T,X,ka,aa,O,za,La,Ra,Ha,Aa,Ca,ya;va=C=l=m=qa.length=0;h.matrixAutoUpdate&&h.update(void 0,!0);e.update(void 0,!1,h);z.multiply(h.projectionMatrix,h.matrixWorldInverse);U[0].set(z.n41-z.n11,z.n42-z.n12,z.n43-z.n13,z.n44-z.n14);U[1].set(z.n41+z.n11,z.n42+
|
|
|
z.n12,z.n43+z.n13,z.n44+z.n14);U[2].set(z.n41+z.n21,z.n42+z.n22,z.n43+z.n23,z.n44+z.n24);U[3].set(z.n41-z.n21,z.n42-z.n22,z.n43-z.n23,z.n44-z.n24);U[4].set(z.n41-z.n31,z.n42-z.n32,z.n43-z.n33,z.n44-z.n34);U[5].set(z.n41+z.n31,z.n42+z.n32,z.n43+z.n33,z.n44+z.n34);for(N=0;N<6;N++)aa=U[N],aa.divideScalar(Math.sqrt(aa.x*aa.x+aa.y*aa.y+aa.z*aa.z));aa=this.projectObjects(e,h,!0);e=0;for(N=aa.length;e<N;e++)if(O=aa[e].object,O.visible)if(za=O.matrixWorld,La=O.matrixRotationWorld,Ra=O.materials,Ha=O.overdraw,
|
|
|
-j=0,O instanceof THREE.Mesh){Aa=O.geometry;R=Aa.vertices;Ca=Aa.faces;Aa=Aa.faceVertexUvs;ua=0;for(J=R.length;ua<J;ua++)i=a(),i.positionWorld.copy(R[ua].position),za.multiplyVector3(i.positionWorld),i.positionScreen.copy(i.positionWorld),z.multiplyVector4(i.positionScreen),i.positionScreen.x/=i.positionScreen.w,i.positionScreen.y/=i.positionScreen.w,i.visible=i.positionScreen.z>d&&i.positionScreen.z<pa;R=0;for(ua=Ca.length;R<ua;R++){J=Ca[R];if(J instanceof THREE.Face3)if(S=m[J.a],T=m[J.b],X=m[J.c],
|
|
|
-S.visible&&T.visible&&X.visible&&(O.doubleSided||O.flipSided!=(X.positionScreen.x-S.positionScreen.x)*(T.positionScreen.y-S.positionScreen.y)-(X.positionScreen.y-S.positionScreen.y)*(T.positionScreen.x-S.positionScreen.x)<0))ka=p[o]=p[o]||new THREE.RenderableFace3,o++,k=ka,k.v1.copy(S),k.v2.copy(T),k.v3.copy(X);else continue;else if(J instanceof THREE.Face4)if(S=m[J.a],T=m[J.b],X=m[J.c],ka=m[J.d],S.visible&&T.visible&&X.visible&&ka.visible&&(O.doubleSided||O.flipSided!=((ka.positionScreen.x-S.positionScreen.x)*
|
|
|
+j=0,O instanceof THREE.Mesh){Aa=O.geometry;R=Aa.vertices;Ca=Aa.faces;Aa=Aa.faceVertexUvs;ua=0;for(J=R.length;ua<J;ua++)i=a(),i.positionWorld.copy(R[ua].position),za.multiplyVector3(i.positionWorld),i.positionScreen.copy(i.positionWorld),z.multiplyVector4(i.positionScreen),i.positionScreen.x/=i.positionScreen.w,i.positionScreen.y/=i.positionScreen.w,i.visible=i.positionScreen.z>d&&i.positionScreen.z<pa;R=0;for(ua=Ca.length;R<ua;R++){J=Ca[R];if(J instanceof THREE.Face3)if(S=o[J.a],T=o[J.b],X=o[J.c],
|
|
|
+S.visible&&T.visible&&X.visible&&(O.doubleSided||O.flipSided!=(X.positionScreen.x-S.positionScreen.x)*(T.positionScreen.y-S.positionScreen.y)-(X.positionScreen.y-S.positionScreen.y)*(T.positionScreen.x-S.positionScreen.x)<0))ka=p[m]=p[m]||new THREE.RenderableFace3,m++,k=ka,k.v1.copy(S),k.v2.copy(T),k.v3.copy(X);else continue;else if(J instanceof THREE.Face4)if(S=o[J.a],T=o[J.b],X=o[J.c],ka=o[J.d],S.visible&&T.visible&&X.visible&&ka.visible&&(O.doubleSided||O.flipSided!=((ka.positionScreen.x-S.positionScreen.x)*
|
|
|
(T.positionScreen.y-S.positionScreen.y)-(ka.positionScreen.y-S.positionScreen.y)*(T.positionScreen.x-S.positionScreen.x)<0||(T.positionScreen.x-X.positionScreen.x)*(ka.positionScreen.y-X.positionScreen.y)-(T.positionScreen.y-X.positionScreen.y)*(ka.positionScreen.x-X.positionScreen.x)<0)))ya=t[l]=t[l]||new THREE.RenderableFace4,l++,k=ya,k.v1.copy(S),k.v2.copy(T),k.v3.copy(X),k.v4.copy(ka);else continue;k.normalWorld.copy(J.normal);La.multiplyVector3(k.normalWorld);k.centroidWorld.copy(J.centroid);
|
|
|
za.multiplyVector3(k.centroidWorld);k.centroidScreen.copy(k.centroidWorld);z.multiplyVector3(k.centroidScreen);X=J.vertexNormals;S=0;for(T=X.length;S<T;S++)ka=k.vertexNormalsWorld[S],ka.copy(X[S]),La.multiplyVector3(ka);S=0;for(T=Aa.length;S<T;S++)if(ya=Aa[S][R]){X=0;for(ka=ya.length;X<ka;X++)k.uvs[S][X]=ya[X]}k.meshMaterials=Ra;k.faceMaterials=J.materials;k.overdraw=Ha;k.z=k.centroidScreen.z;qa.push(k)}}else if(O instanceof THREE.Line){W.multiply(z,za);R=O.geometry.vertices;S=a();S.positionScreen.copy(R[0].position);
|
|
|
-W.multiplyVector4(S.positionScreen);ua=1;for(J=R.length;ua<J;ua++)if(S=a(),S.positionScreen.copy(R[ua].position),W.multiplyVector4(S.positionScreen),T=m[j-2],ja.copy(S.positionScreen),$.copy(T.positionScreen),c(ja,$))ja.multiplyScalar(1/ja.w),$.multiplyScalar(1/$.w),za=E[C]=E[C]||new THREE.RenderableLine,C++,A=za,A.v1.positionScreen.copy(ja),A.v2.positionScreen.copy($),A.z=Math.max(ja.z,$.z),A.materials=O.materials,qa.push(A)}else if(O instanceof THREE.Particle&&(F.set(O.matrixWorld.n14,O.matrixWorld.n24,
|
|
|
+W.multiplyVector4(S.positionScreen);ua=1;for(J=R.length;ua<J;ua++)if(S=a(),S.positionScreen.copy(R[ua].position),W.multiplyVector4(S.positionScreen),T=o[j-2],ja.copy(S.positionScreen),$.copy(T.positionScreen),c(ja,$))ja.multiplyScalar(1/ja.w),$.multiplyScalar(1/$.w),za=E[C]=E[C]||new THREE.RenderableLine,C++,A=za,A.v1.positionScreen.copy(ja),A.v2.positionScreen.copy($),A.z=Math.max(ja.z,$.z),A.materials=O.materials,qa.push(A)}else if(O instanceof THREE.Particle&&(F.set(O.matrixWorld.n14,O.matrixWorld.n24,
|
|
|
O.matrixWorld.n34,1),z.multiplyVector4(F),F.z/=F.w,F.z>0&&F.z<1))za=wa[va]=wa[va]||new THREE.RenderableParticle,va++,B=za,B.x=F.x/F.w,B.y=F.y/F.w,B.z=F.z,B.rotation=O.rotation.z,B.scale.x=O.scale.x*Math.abs(B.x-(F.x+h.projectionMatrix.n11)/(F.w+h.projectionMatrix.n14)),B.scale.y=O.scale.y*Math.abs(B.y-(F.y+h.projectionMatrix.n22)/(F.w+h.projectionMatrix.n24)),B.materials=O.materials,qa.push(B);f&&qa.sort(b);return qa}};THREE.Quaternion=function(a,b,c,e){this.set(a||0,b||0,c||0,e!==void 0?e:1)};
|
|
|
THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,e=a.y*b,f=a.z*b,a=Math.cos(e),e=Math.sin(e),b=Math.cos(-f),f=Math.sin(-f),h=Math.cos(c),c=Math.sin(c),i=a*b,j=e*f;this.w=i*h-j*c;this.x=i*c+j*h;this.y=e*b*h+a*f*c;this.z=a*f*h-e*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,e=Math.sin(c);
|
|
|
this.x=a.x*e;this.y=a.y*e;this.z=a.z*e;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
|
|
|
this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a===0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=
|
|
|
-this.x,c=this.y,e=this.z,f=this.w,h=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+f*h+c*j-e*i;this.y=c*a+f*i+e*h-b*j;this.z=e*a+f*j+b*i-c*h;this.w=f*a-b*h-c*i-e*j;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,h=this.x,i=this.y,j=this.z,m=this.w,k=m*c+i*f-j*e,o=m*e+j*c-h*f,p=m*f+h*e-i*c,c=-h*
|
|
|
-c-i*e-j*f;b.x=k*m+c*-h+o*-j-p*-i;b.y=o*m+c*-i+p*-h-k*-j;b.z=p*m+c*-j+k*-i-o*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),i=Math.sqrt(1-f*f);if(Math.abs(i)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/i;e=Math.sin(e*h)/i;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c};
|
|
|
+this.x,c=this.y,e=this.z,f=this.w,h=a.x,i=a.y,j=a.z,a=a.w;this.x=b*a+f*h+c*j-e*i;this.y=c*a+f*i+e*h-b*j;this.z=e*a+f*j+b*i-c*h;this.w=f*a-b*h-c*i-e*j;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,e=a.y,f=a.z,h=this.x,i=this.y,j=this.z,o=this.w,k=o*c+i*f-j*e,m=o*e+j*c-h*f,p=o*f+h*e-i*c,c=-h*
|
|
|
+c-i*e-j*f;b.x=k*o+c*-h+m*-j-p*-i;b.y=m*o+c*-i+p*-h-k*-j;b.z=p*o+c*-j+k*-i-m*-h;return b}};THREE.Quaternion.slerp=function(a,b,c,e){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var h=Math.acos(f),i=Math.sqrt(1-f*f);if(Math.abs(i)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;f=Math.sin((1-e)*h)/i;e=Math.sin(e*h)/i;c.w=a.w*f+b.w*e;c.x=a.x*f+b.x*e;c.y=a.y*f+b.y*e;c.z=a.z*f+b.z*e;return c};
|
|
|
THREE.Vertex=function(a){this.position=a||new THREE.Vector3};THREE.Face3=function(a,b,c,e,f,h){this.a=a;this.b=b;this.c=c;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3};
|
|
|
THREE.Face4=function(a,b,c,e,f,h,i){this.a=a;this.b=b;this.c=c;this.d=e;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materialIndex=i;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
|
|
|
THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
|
|
|
THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
|
|
|
THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,e=this.vertices.length;c<e;c++)a.multiplyVector3(this.vertices[c].position);c=0;for(e=this.faces.length;c<e;c++){var f=this.faces[c];b.multiplyVector3(f.normal);for(var h=0,i=f.vertexNormals.length;h<i;h++)b.multiplyVector3(f.vertexNormals[h]);a.multiplyVector3(f.centroid)}},computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;a<
|
|
|
b;a++)c=this.faces[a],c.centroid.set(0,0,0),c instanceof THREE.Face3?(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.divideScalar(3)):c instanceof THREE.Face4&&(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.addSelf(this.vertices[c.d].position),c.centroid.divideScalar(4))},computeFaceNormals:function(a){var b,
|
|
|
-c,e,f,h,i,j=new THREE.Vector3,m=new THREE.Vector3;e=0;for(f=this.faces.length;e<f;e++){h=this.faces[e];if(a&&h.vertexNormals.length){j.set(0,0,0);b=0;for(c=h.vertexNormals.length;b<c;b++)j.addSelf(h.vertexNormals[b]);j.divideScalar(3)}else b=this.vertices[h.a],c=this.vertices[h.b],i=this.vertices[h.c],j.sub(i.position,c.position),m.sub(b.position,c.position),j.crossSelf(m);j.isZero()||j.normalize();h.normal.copy(j)}},computeVertexNormals:function(){var a,b,c,e;if(this.__tmpVertices===void 0){e=this.__tmpVertices=
|
|
|
+c,e,f,h,i,j=new THREE.Vector3,o=new THREE.Vector3;e=0;for(f=this.faces.length;e<f;e++){h=this.faces[e];if(a&&h.vertexNormals.length){j.set(0,0,0);b=0;for(c=h.vertexNormals.length;b<c;b++)j.addSelf(h.vertexNormals[b]);j.divideScalar(3)}else b=this.vertices[h.a],c=this.vertices[h.b],i=this.vertices[h.c],j.sub(i.position,c.position),o.sub(b.position,c.position),j.crossSelf(o);j.isZero()||j.normalize();h.normal.copy(j)}},computeVertexNormals:function(){var a,b,c,e;if(this.__tmpVertices===void 0){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++)if(c=this.faces[a],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{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],c instanceof
|
|
|
THREE.Face3?(e[c.a].addSelf(c.normal),e[c.b].addSelf(c.normal),e[c.c].addSelf(c.normal)):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],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])):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(a,d,b,c,e,h,f){j=a.vertices[d].position;m=a.vertices[b].position;k=a.vertices[c].position;o=i[e];p=i[h];l=i[f];t=m.x-j.x;A=k.x-j.x;C=m.y-j.y;E=k.y-j.y;B=m.z-j.z;va=k.z-j.z;wa=p.u-o.u;pa=l.u-o.u;qa=p.v-o.v;N=l.v-o.v;F=1/(wa*N-pa*qa);ja.set((N*t-qa*A)*F,(N*C-qa*E)*F,(N*B-qa*va)*F);$.set((wa*A-pa*t)*F,(wa*E-pa*C)*F,(wa*va-pa*B)*F);W[d].addSelf(ja);W[b].addSelf(ja);W[c].addSelf(ja);
|
|
|
-U[d].addSelf($);U[b].addSelf($);U[c].addSelf($)}var b,c,e,f,h,i,j,m,k,o,p,l,t,A,C,E,B,va,wa,pa,qa,N,F,z,W=[],U=[],ja=new THREE.Vector3,$=new THREE.Vector3,xa=new THREE.Vector3,Q=new THREE.Vector3,G=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)W[b]=new THREE.Vector3,U[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)h=this.faces[b],i=this.faceVertexUvs[0][b],h instanceof THREE.Face3?a(this,h.a,h.b,h.c,0,1,2):h instanceof THREE.Face4&&(a(this,h.a,h.b,h.c,0,1,2),a(this,h.a,h.b,h.d,
|
|
|
+c.vertexNormals[1].copy(e[c.b]),c.vertexNormals[2].copy(e[c.c]),c.vertexNormals[3].copy(e[c.d]))},computeTangents:function(){function a(a,d,b,c,e,h,f){j=a.vertices[d].position;o=a.vertices[b].position;k=a.vertices[c].position;m=i[e];p=i[h];l=i[f];t=o.x-j.x;A=k.x-j.x;C=o.y-j.y;E=k.y-j.y;B=o.z-j.z;va=k.z-j.z;wa=p.u-m.u;pa=l.u-m.u;qa=p.v-m.v;N=l.v-m.v;F=1/(wa*N-pa*qa);ja.set((N*t-qa*A)*F,(N*C-qa*E)*F,(N*B-qa*va)*F);$.set((wa*A-pa*t)*F,(wa*E-pa*C)*F,(wa*va-pa*B)*F);W[d].addSelf(ja);W[b].addSelf(ja);W[c].addSelf(ja);
|
|
|
+U[d].addSelf($);U[b].addSelf($);U[c].addSelf($)}var b,c,e,f,h,i,j,o,k,m,p,l,t,A,C,E,B,va,wa,pa,qa,N,F,z,W=[],U=[],ja=new THREE.Vector3,$=new THREE.Vector3,xa=new THREE.Vector3,Q=new THREE.Vector3,G=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)W[b]=new THREE.Vector3,U[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)h=this.faces[b],i=this.faceVertexUvs[0][b],h instanceof THREE.Face3?a(this,h.a,h.b,h.c,0,1,2):h instanceof THREE.Face4&&(a(this,h.a,h.b,h.c,0,1,2),a(this,h.a,h.b,h.d,
|
|
|
0,1,3));var d=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){h=this.faces[b];for(e=0;e<h.vertexNormals.length;e++)G.copy(h.vertexNormals[e]),f=h[d[e]],z=W[f],xa.copy(z),xa.subSelf(G.multiplyScalar(G.dot(z))).normalize(),Q.cross(h.vertexNormals[e],z),f=Q.dot(U[f]),f=f<0?-1:1,h.vertexTangents[e]=new THREE.Vector4(xa.x,xa.y,xa.z,f)}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]=a.position.z}}},computeBoundingSphere:function(){for(var a=0,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},mergeVertices:function(){var a={},b=[],c=[],e,f=Math.pow(10,4),h,i;h=0;for(i=this.vertices.length;h<i;h++)e=this.vertices[h].position,e=[Math.round(e.x*f),Math.round(e.y*f),Math.round(e.z*f)].join("_"),
|
|
|
a[e]===void 0?(a[e]=h,b.push(this.vertices[h]),c[h]=b.length-1):c[h]=c[a[e]];h=0;for(i=this.faces.length;h<i;h++)if(a=this.faces[h],a instanceof THREE.Face3)a.a=c[a.a],a.b=c[a.b],a.c=c[a.c];else if(a instanceof THREE.Face4)a.a=c[a.a],a.b=c[a.b],a.c=c[a.c],a.d=c[a.d];this.vertices=b}};THREE.GeometryCount=0;
|
|
|
-THREE.Spline=function(a){function b(a,b,c,e,h,f,i){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*i+(-3*(b-c)-2*a-e)*f+a*h+b}this.points=a;var c=[],e={x:0,y:0,z:0},f,h,i,j,m,k,o,p,l;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){f=(this.points.length-1)*a;h=Math.floor(f);i=f-h;c[0]=h===0?h:h-1;c[1]=h;c[2]=h>this.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;k=this.points[c[0]];o=this.points[c[1]];
|
|
|
-p=this.points[c[2]];l=this.points[c[3]];j=i*i;m=i*j;e.x=b(k.x,o.x,p.x,l.x,i,j,m);e.y=b(k.y,o.y,p.y,l.y,i,j,m);e.z=b(k.z,o.z,p.z,l.z,i,j,m);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;a<c;a++)b=this.points[a],e[a]=[b.x,b.y,b.z];return e};this.getLength=function(a){var b,c,e=b=b=0,h=new THREE.Vector3,f=new THREE.Vector3,i=[],j=0;i[0]=0;a||(a=100);c=this.points.length*a;h.copy(this.points[0]);for(a=1;a<c;a++)b=a/c,position=this.getPoint(b),f.copy(position),
|
|
|
-j+=f.distanceTo(h),h.copy(position),b*=this.points.length-1,b=Math.floor(b),b!=e&&(i[b]=j,e=b);i[i.length]=j;return{chunks:i,total:j}};this.reparametrizeByArcLength=function(a){var b,c,e,h,f,i,j=[],k=new THREE.Vector3,m=this.getLength();j.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=m.chunks[b]-m.chunks[b-1];i=Math.ceil(a*c/m.total);h=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<i-1;c++)e=h+c*(1/i)*(f-h),position=this.getPoint(e),j.push(k.copy(position).clone());
|
|
|
+THREE.Spline=function(a){function b(a,b,c,e,h,f,i){a=(c-a)*0.5;e=(e-b)*0.5;return(2*(b-c)+a+e)*i+(-3*(b-c)-2*a-e)*f+a*h+b}this.points=a;var c=[],e={x:0,y:0,z:0},f,h,i,j,o,k,m,p,l;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){f=(this.points.length-1)*a;h=Math.floor(f);i=f-h;c[0]=h===0?h:h-1;c[1]=h;c[2]=h>this.points.length-2?h:h+1;c[3]=h>this.points.length-3?h:h+2;k=this.points[c[0]];m=this.points[c[1]];
|
|
|
+p=this.points[c[2]];l=this.points[c[3]];j=i*i;o=i*j;e.x=b(k.x,m.x,p.x,l.x,i,j,o);e.y=b(k.y,m.y,p.y,l.y,i,j,o);e.z=b(k.z,m.z,p.z,l.z,i,j,o);return e};this.getControlPointsArray=function(){var a,b,c=this.points.length,e=[];for(a=0;a<c;a++)b=this.points[a],e[a]=[b.x,b.y,b.z];return e};this.getLength=function(a){var b,c,e=b=b=0,h=new THREE.Vector3,f=new THREE.Vector3,i=[],j=0;i[0]=0;a||(a=100);c=this.points.length*a;h.copy(this.points[0]);for(a=1;a<c;a++)b=a/c,position=this.getPoint(b),f.copy(position),
|
|
|
+j+=f.distanceTo(h),h.copy(position),b*=this.points.length-1,b=Math.floor(b),b!=e&&(i[b]=j,e=b);i[i.length]=j;return{chunks:i,total:j}};this.reparametrizeByArcLength=function(a){var b,c,e,h,f,i,j=[],k=new THREE.Vector3,o=this.getLength();j.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=o.chunks[b]-o.chunks[b-1];i=Math.ceil(a*c/o.total);h=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<i-1;c++)e=h+c*(1/i)*(f-h),position=this.getPoint(e),j.push(k.copy(position).clone());
|
|
|
j.push(k.copy(this.points[b]).clone())}this.points=j}};THREE.Edge=function(a,b,c,e){this.vertices=[a,b];this.vertexIndices=[c,e];this.faces=[];this.faceIndices=[]};THREE.Camera=function(){if(arguments.length)return console.warn("DEPRECATED: Camera() is now PerspectiveCamera() or OrthographicCamera()."),new THREE.PerspectiveCamera(arguments[0],arguments[1],arguments[2],arguments[3]);THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};
|
|
|
THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};
|
|
|
THREE.Camera.prototype.update=function(a,b,c){this.matrixAutoUpdate&&this.updateMatrix();if(b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0,THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};
|
|
@@ -119,7 +119,7 @@ void 0?a.fog:!1;this.lights=a.lights!==void 0?a.lights:!1;this.vertexColors=a.ve
|
|
|
THREE.Texture=function(a,b,c,e,f,h){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=e!==void 0?e:THREE.ClampToEdgeWrapping;this.magFilter=f!==void 0?f:THREE.LinearFilter;this.minFilter=h!==void 0?h:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
|
|
|
THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
|
|
|
THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;
|
|
|
-THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(a,b,c,e,f,h,i,j,m){THREE.Texture.call(this,null,f,h,i,j,m);this.image={data:a,width:b,height:c};this.format=e!==void 0?e:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
|
|
|
+THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(a,b,c,e,f,h,i,j,o){THREE.Texture.call(this,null,f,h,i,j,o);this.image={data:a,width:b,height:c};this.format=e!==void 0?e:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
|
|
|
THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};THREE.Particle=function(a){THREE.Object3D.call(this);this.material=a};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;THREE.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.sortParticles=!1};
|
|
|
THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.type=c!=void 0?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
|
|
|
THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=a.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[c].name]=
|
|
@@ -179,107 +179,107 @@ THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.lights_phong_fragment,THR
|
|
|
THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,
|
|
|
THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,
|
|
|
THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};
|
|
|
-THREE.WebGLRenderer=function(a){function b(a,d){var b;a.material&&!(a.material instanceof THREE.MeshFaceMaterial)?b=a.material:d.materialIndex>=0&&(b=a.geometry.materials[d.materialIndex]);return b}function c(a,b,c){var e,h,f,i=a.vertices,u=i.length,v=a.colors,q=v.length,j=a.__vertexArray,k=a.__colorArray,m=a.__sortArray,P=a.__dirtyVertices,o=a.__dirtyColors,p=a.__webglCustomAttributesList,l;if(p){f=0;for(e=p.length;f<e;f++)p[f].offset=0}if(c.sortParticles){Da.multiplySelf(c.matrixWorld);for(e=0;e<
|
|
|
-u;e++)h=i[e].position,Ja.copy(h),Da.multiplyVector3(Ja),m[e]=[Ja.z,e];m.sort(function(a,d){return d[0]-a[0]});for(e=0;e<u;e++)h=i[m[e][1]].position,f=e*3,j[f]=h.x,j[f+1]=h.y,j[f+2]=h.z;for(e=0;e<q;e++)f=e*3,color=v[m[e][1]],k[f]=color.r,k[f+1]=color.g,k[f+2]=color.b;if(p){f=0;for(e=p.length;f<e;f++){u=p[f];q=u.value.length;for(v=0;v<q;v++){index=m[v][1];i=u.offset;if(u.size===1){if(u.boundTo===void 0||u.boundTo==="vertices")u.array[i]=u.value[index]}else{if(u.boundTo===void 0||u.boundTo==="vertices")l=
|
|
|
-u.value[index];u.size===2?(u.array[i]=l.x,u.array[i+1]=l.y):u.size===3?u.type==="c"?(u.array[i]=l.r,u.array[i+1]=l.g,u.array[i+2]=l.b):(u.array[i]=l.x,u.array[i+1]=l.y,u.array[i+2]=l.z):(u.array[i]=l.x,u.array[i+1]=l.y,u.array[i+2]=l.z,u.array[i+3]=l.w)}u.offset+=u.size}}}}else{if(P)for(e=0;e<u;e++)h=i[e].position,f=e*3,j[f]=h.x,j[f+1]=h.y,j[f+2]=h.z;if(o)for(e=0;e<q;e++)color=v[e],f=e*3,k[f]=color.r,k[f+1]=color.g,k[f+2]=color.b;if(p){f=0;for(e=p.length;f<e;f++)if(u=p[f],u.__original.needsUpdate){q=
|
|
|
-u.value.length;for(v=0;v<q;v++){i=u.offset;if(u.size===1){if(u.boundTo===void 0||u.boundTo==="vertices")u.array[i]=u.value[v]}else{if(u.boundTo===void 0||u.boundTo==="vertices")l=u.value[v];u.size===2?(u.array[i]=l.x,u.array[i+1]=l.y):u.size===3?u.type==="c"?(u.array[i]=l.r,u.array[i+1]=l.g,u.array[i+2]=l.b):(u.array[i]=l.x,u.array[i+1]=l.y,u.array[i+2]=l.z):(u.array[i]=l.x,u.array[i+1]=l.y,u.array[i+2]=l.z,u.array[i+3]=l.w)}u.offset+=u.size}}}}if(P||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),
|
|
|
-d.bufferData(d.ARRAY_BUFFER,j,b);if(o||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,a.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,k,b);if(p){f=0;for(e=p.length;f<e;f++)if(u=p[f],u.__original.needsUpdate||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,u.buffer),d.bufferData(d.ARRAY_BUFFER,u.array,b)}}function e(a,b,c,e,h){e.program||G.initMaterial(e,b,c,h);if(e.morphTargets&&!h.__webglMorphTargetInfluences){h.__webglMorphTargetInfluences=new Float32Array(G.maxMorphTargets);for(var f=0,i=G.maxMorphTargets;f<
|
|
|
-i;f++)h.__webglMorphTargetInfluences[f]=0}var u=!1,f=e.program,i=f.uniforms,v=e.uniforms;f!==Wa&&(d.useProgram(f),Wa=f,u=!0);if(e.id!==J)J=e.id,u=!0;if(u){d.uniformMatrix4fv(i.projectionMatrix,!1,Ta);if(c&&e.fog)if(v.fogColor.value=c.color,c instanceof THREE.Fog)v.fogNear.value=c.near,v.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)v.fogDensity.value=c.density;if(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e.lights){for(var q,j,k=0,m=0,P=0,o,p,l,t=Ya,y=t.directional.colors,
|
|
|
-r=t.directional.positions,A=t.point.colors,C=t.point.positions,B=t.point.distances,E=0,H=0,c=q=l=0,u=b.length;c<u;c++)if(q=b[c],j=q.color,o=q.position,p=q.intensity,l=q.distance,q instanceof THREE.AmbientLight)G.gammaInput?(k+=j.r*j.r,m+=j.g*j.g,P+=j.b*j.b):(k+=j.r,m+=j.g,P+=j.b);else if(q instanceof THREE.DirectionalLight)l=E*3,G.gammaInput?(y[l]=j.r*j.r*p*p,y[l+1]=j.g*j.g*p*p,y[l+2]=j.b*j.b*p*p):(y[l]=j.r*p,y[l+1]=j.g*p,y[l+2]=j.b*p),r[l]=o.x,r[l+1]=o.y,r[l+2]=o.z,E+=1;else if(q instanceof THREE.SpotLight)l=
|
|
|
-E*3,G.gammaInput?(y[l]=j.r*j.r*p*p,y[l+1]=j.g*j.g*p*p,y[l+2]=j.b*j.b*p*p):(y[l]=j.r*p,y[l+1]=j.g*p,y[l+2]=j.b*p),j=1/o.length(),r[l]=o.x*j,r[l+1]=o.y*j,r[l+2]=o.z*j,E+=1;else if(q instanceof THREE.PointLight)q=H*3,G.gammaInput?(A[q]=j.r*j.r*p*p,A[q+1]=j.g*j.g*p*p,A[q+2]=j.b*j.b*p*p):(A[q]=j.r*p,A[q+1]=j.g*p,A[q+2]=j.b*p),C[q]=o.x,C[q+1]=o.y,C[q+2]=o.z,B[H]=l,H+=1;c=E*3;for(u=y.length;c<u;c++)y[c]=0;c=H*3;for(u=A.length;c<u;c++)A[c]=0;t.point.length=H;t.directional.length=E;t.ambient[0]=k;t.ambient[1]=
|
|
|
-m;t.ambient[2]=P;b=Ya;v.enableLighting.value=b.directional.length+b.point.length;v.ambientLightColor.value=b.ambient;v.directionalLightColor.value=b.directional.colors;v.directionalLightDirection.value=b.directional.positions;v.pointLightColor.value=b.point.colors;v.pointLightPosition.value=b.point.positions;v.pointLightDistance.value=b.point.distances}if(e instanceof THREE.MeshBasicMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.MeshPhongMaterial)v.opacity.value=e.opacity,G.gammaInput?
|
|
|
+THREE.WebGLRenderer=function(a){function b(a,d){if(a.material&&!(a.material instanceof THREE.MeshFaceMaterial))return a.material;else if(d.materialIndex>=0)return a.geometry.materials[d.materialIndex]}function c(a,b,c){var e,h,f,i=a.vertices,u=i.length,v=a.colors,r=v.length,j=a.__vertexArray,k=a.__colorArray,o=a.__sortArray,P=a.__dirtyVertices,m=a.__dirtyColors,p=a.__webglCustomAttributesList,l;if(p){f=0;for(e=p.length;f<e;f++)p[f].offset=0}if(c.sortParticles){Da.multiplySelf(c.matrixWorld);for(e=
|
|
|
+0;e<u;e++)h=i[e].position,Ja.copy(h),Da.multiplyVector3(Ja),o[e]=[Ja.z,e];o.sort(function(a,d){return d[0]-a[0]});for(e=0;e<u;e++)h=i[o[e][1]].position,f=e*3,j[f]=h.x,j[f+1]=h.y,j[f+2]=h.z;for(e=0;e<r;e++)f=e*3,color=v[o[e][1]],k[f]=color.r,k[f+1]=color.g,k[f+2]=color.b;if(p){f=0;for(e=p.length;f<e;f++){u=p[f];r=u.value.length;for(v=0;v<r;v++){index=o[v][1];i=u.offset;if(u.size===1){if(u.boundTo===void 0||u.boundTo==="vertices")u.array[i]=u.value[index]}else{if(u.boundTo===void 0||u.boundTo==="vertices")l=
|
|
|
+u.value[index];u.size===2?(u.array[i]=l.x,u.array[i+1]=l.y):u.size===3?u.type==="c"?(u.array[i]=l.r,u.array[i+1]=l.g,u.array[i+2]=l.b):(u.array[i]=l.x,u.array[i+1]=l.y,u.array[i+2]=l.z):(u.array[i]=l.x,u.array[i+1]=l.y,u.array[i+2]=l.z,u.array[i+3]=l.w)}u.offset+=u.size}}}}else{if(P)for(e=0;e<u;e++)h=i[e].position,f=e*3,j[f]=h.x,j[f+1]=h.y,j[f+2]=h.z;if(m)for(e=0;e<r;e++)color=v[e],f=e*3,k[f]=color.r,k[f+1]=color.g,k[f+2]=color.b;if(p){f=0;for(e=p.length;f<e;f++)if(u=p[f],u.__original.needsUpdate){r=
|
|
|
+u.value.length;for(v=0;v<r;v++){i=u.offset;if(u.size===1){if(u.boundTo===void 0||u.boundTo==="vertices")u.array[i]=u.value[v]}else{if(u.boundTo===void 0||u.boundTo==="vertices")l=u.value[v];u.size===2?(u.array[i]=l.x,u.array[i+1]=l.y):u.size===3?u.type==="c"?(u.array[i]=l.r,u.array[i+1]=l.g,u.array[i+2]=l.b):(u.array[i]=l.x,u.array[i+1]=l.y,u.array[i+2]=l.z):(u.array[i]=l.x,u.array[i+1]=l.y,u.array[i+2]=l.z,u.array[i+3]=l.w)}u.offset+=u.size}}}}if(P||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),
|
|
|
+d.bufferData(d.ARRAY_BUFFER,j,b);if(m||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,a.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,k,b);if(p){f=0;for(e=p.length;f<e;f++)if(u=p[f],u.__original.needsUpdate||c.sortParticles)d.bindBuffer(d.ARRAY_BUFFER,u.buffer),d.bufferData(d.ARRAY_BUFFER,u.array,b)}}function e(a,b,c,e,h){e.program||G.initMaterial(e,b,c,h);if(e.morphTargets&&!h.__webglMorphTargetInfluences){h.__webglMorphTargetInfluences=new Float32Array(G.maxMorphTargets);for(var f=0,i=G.maxMorphTargets;f<
|
|
|
+i;f++)h.__webglMorphTargetInfluences[f]=0}var u=!1,f=e.program,i=f.uniforms,v=e.uniforms;f!==Wa&&(d.useProgram(f),Wa=f,u=!0);if(e.id!==J)J=e.id,u=!0;if(u){d.uniformMatrix4fv(i.projectionMatrix,!1,Ta);if(c&&e.fog)if(v.fogColor.value=c.color,c instanceof THREE.Fog)v.fogNear.value=c.near,v.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)v.fogDensity.value=c.density;if(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e.lights){for(var r,j,k=0,o=0,P=0,m,p,l,t=Ya,y=t.directional.colors,
|
|
|
+q=t.directional.positions,A=t.point.colors,C=t.point.positions,B=t.point.distances,E=0,H=0,c=r=l=0,u=b.length;c<u;c++)if(r=b[c],j=r.color,m=r.position,p=r.intensity,l=r.distance,r instanceof THREE.AmbientLight)G.gammaInput?(k+=j.r*j.r,o+=j.g*j.g,P+=j.b*j.b):(k+=j.r,o+=j.g,P+=j.b);else if(r instanceof THREE.DirectionalLight)l=E*3,G.gammaInput?(y[l]=j.r*j.r*p*p,y[l+1]=j.g*j.g*p*p,y[l+2]=j.b*j.b*p*p):(y[l]=j.r*p,y[l+1]=j.g*p,y[l+2]=j.b*p),q[l]=m.x,q[l+1]=m.y,q[l+2]=m.z,E+=1;else if(r instanceof THREE.SpotLight)l=
|
|
|
+E*3,G.gammaInput?(y[l]=j.r*j.r*p*p,y[l+1]=j.g*j.g*p*p,y[l+2]=j.b*j.b*p*p):(y[l]=j.r*p,y[l+1]=j.g*p,y[l+2]=j.b*p),j=1/m.length(),q[l]=m.x*j,q[l+1]=m.y*j,q[l+2]=m.z*j,E+=1;else if(r instanceof THREE.PointLight)r=H*3,G.gammaInput?(A[r]=j.r*j.r*p*p,A[r+1]=j.g*j.g*p*p,A[r+2]=j.b*j.b*p*p):(A[r]=j.r*p,A[r+1]=j.g*p,A[r+2]=j.b*p),C[r]=m.x,C[r+1]=m.y,C[r+2]=m.z,B[H]=l,H+=1;c=E*3;for(u=y.length;c<u;c++)y[c]=0;c=H*3;for(u=A.length;c<u;c++)A[c]=0;t.point.length=H;t.directional.length=E;t.ambient[0]=k;t.ambient[1]=
|
|
|
+o;t.ambient[2]=P;b=Ya;v.enableLighting.value=b.directional.length+b.point.length;v.ambientLightColor.value=b.ambient;v.directionalLightColor.value=b.directional.colors;v.directionalLightDirection.value=b.directional.positions;v.pointLightColor.value=b.point.colors;v.pointLightPosition.value=b.point.positions;v.pointLightDistance.value=b.point.distances}if(e instanceof THREE.MeshBasicMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.MeshPhongMaterial)v.opacity.value=e.opacity,G.gammaInput?
|
|
|
v.diffuse.value.copyGammaToLinear(e.color):v.diffuse.value=e.color,(v.map.texture=e.map)&&v.offsetRepeat.value.set(e.map.offset.x,e.map.offset.y,e.map.repeat.x,e.map.repeat.y),v.lightMap.texture=e.lightMap,v.envMap.texture=e.envMap,v.flipEnvMap.value=e.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,v.reflectivity.value=e.reflectivity,v.refractionRatio.value=e.refractionRatio,v.combine.value=e.combine,v.useRefract.value=e.envMap&&e.envMap.mapping instanceof THREE.CubeRefractionMapping;if(e instanceof
|
|
|
THREE.LineBasicMaterial)v.diffuse.value=e.color,v.opacity.value=e.opacity;else if(e instanceof THREE.ParticleBasicMaterial)v.psColor.value=e.color,v.opacity.value=e.opacity,v.size.value=e.size,v.scale.value=Ba.height/2,v.map.texture=e.map;else if(e instanceof THREE.MeshPhongMaterial)v.shininess.value=e.shininess,G.gammaInput?(v.ambient.value.copyGammaToLinear(e.ambient),v.specular.value.copyGammaToLinear(e.specular)):(v.ambient.value=e.ambient,v.specular.value=e.specular);else if(e instanceof THREE.MeshLambertMaterial)G.gammaInput?
|
|
|
v.ambient.value.copyGammaToLinear(e.ambient):v.ambient.value=e.ambient;else if(e instanceof THREE.MeshDepthMaterial)v.mNear.value=a.near,v.mFar.value=a.far,v.opacity.value=e.opacity;else if(e instanceof THREE.MeshNormalMaterial)v.opacity.value=e.opacity;if(h.receiveShadow&&!e._shadowPass&&v.shadowMatrix){for(b=0;b<Sa.length;b++)v.shadowMatrix.value[b]=Sa[b],v.shadowMap.texture[b]=G.shadowMap[b];v.shadowDarkness.value=G.shadowMapDarkness;v.shadowBias.value=G.shadowMapBias}b=e.uniformsList;v=0;for(c=
|
|
|
-b.length;v<c;v++)if(m=f.uniforms[b[v][1]])if(k=b[v][0],P=k.type,u=k.value,P==="i")d.uniform1i(m,u);else if(P==="f")d.uniform1f(m,u);else if(P==="v2")d.uniform2f(m,u.x,u.y);else if(P==="v3")d.uniform3f(m,u.x,u.y,u.z);else if(P==="v4")d.uniform4f(m,u.x,u.y,u.z,u.w);else if(P==="c")d.uniform3f(m,u.r,u.g,u.b);else if(P==="fv1")d.uniform1fv(m,u);else if(P==="fv")d.uniform3fv(m,u);else if(P==="v3v"){if(!k._array)k._array=new Float32Array(3*u.length);P=0;for(o=u.length;P<o;P++)t=P*3,k._array[t]=u[P].x,k._array[t+
|
|
|
-1]=u[P].y,k._array[t+2]=u[P].z;d.uniform3fv(m,k._array)}else if(P==="m4"){if(!k._array)k._array=new Float32Array(16);u.flattenToArray(k._array);d.uniformMatrix4fv(m,!1,k._array)}else if(P==="m4v"){if(!k._array)k._array=new Float32Array(16*u.length);P=0;for(o=u.length;P<o;P++)u[P].flattenToArrayOffset(k._array,P*16);d.uniformMatrix4fv(m,!1,k._array)}else if(P==="t"){if(d.uniform1i(m,u),m=k.texture)if(m.image instanceof Array&&m.image.length===6){if(k=m,k.image.length===6)if(k.needsUpdate){if(!k.image.__webglTextureCube)k.image.__webglTextureCube=
|
|
|
-d.createTexture();d.activeTexture(d.TEXTURE0+u);d.bindTexture(d.TEXTURE_CUBE_MAP,k.image.__webglTextureCube);for(u=0;u<6;u++)d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+u,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,k.image[u]);F(d.TEXTURE_CUBE_MAP,k,k.image[0]);k.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+u),d.bindTexture(d.TEXTURE_CUBE_MAP,k.image.__webglTextureCube)}else m instanceof THREE.WebGLRenderTargetCube?(k=m,d.activeTexture(d.TEXTURE0+u),d.bindTexture(d.TEXTURE_CUBE_MAP,k.__webglTexture)):z(m,u)}else if(P===
|
|
|
-"tv"){if(!k._array){k._array=[];P=0;for(o=k.texture.length;P<o;P++)k._array[P]=u+P}d.uniform1iv(m,k._array);P=0;for(o=k.texture.length;P<o;P++)(m=k.texture[P])&&z(m,k._array[P])}(e instanceof THREE.ShaderMaterial||e instanceof THREE.MeshPhongMaterial||e.envMap)&&i.cameraPosition!==null&&d.uniform3f(i.cameraPosition,a.position.x,a.position.y,a.position.z);(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.ShaderMaterial||e.skinning)&&i.viewMatrix!==null&&
|
|
|
+b.length;v<c;v++)if(o=f.uniforms[b[v][1]])if(k=b[v][0],P=k.type,u=k.value,P==="i")d.uniform1i(o,u);else if(P==="f")d.uniform1f(o,u);else if(P==="v2")d.uniform2f(o,u.x,u.y);else if(P==="v3")d.uniform3f(o,u.x,u.y,u.z);else if(P==="v4")d.uniform4f(o,u.x,u.y,u.z,u.w);else if(P==="c")d.uniform3f(o,u.r,u.g,u.b);else if(P==="fv1")d.uniform1fv(o,u);else if(P==="fv")d.uniform3fv(o,u);else if(P==="v3v"){if(!k._array)k._array=new Float32Array(3*u.length);P=0;for(m=u.length;P<m;P++)t=P*3,k._array[t]=u[P].x,k._array[t+
|
|
|
+1]=u[P].y,k._array[t+2]=u[P].z;d.uniform3fv(o,k._array)}else if(P==="m4"){if(!k._array)k._array=new Float32Array(16);u.flattenToArray(k._array);d.uniformMatrix4fv(o,!1,k._array)}else if(P==="m4v"){if(!k._array)k._array=new Float32Array(16*u.length);P=0;for(m=u.length;P<m;P++)u[P].flattenToArrayOffset(k._array,P*16);d.uniformMatrix4fv(o,!1,k._array)}else if(P==="t"){if(d.uniform1i(o,u),o=k.texture)if(o.image instanceof Array&&o.image.length===6){if(k=o,k.image.length===6)if(k.needsUpdate){if(!k.image.__webglTextureCube)k.image.__webglTextureCube=
|
|
|
+d.createTexture();d.activeTexture(d.TEXTURE0+u);d.bindTexture(d.TEXTURE_CUBE_MAP,k.image.__webglTextureCube);for(u=0;u<6;u++)d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+u,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,k.image[u]);F(d.TEXTURE_CUBE_MAP,k,k.image[0]);k.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+u),d.bindTexture(d.TEXTURE_CUBE_MAP,k.image.__webglTextureCube)}else o instanceof THREE.WebGLRenderTargetCube?(k=o,d.activeTexture(d.TEXTURE0+u),d.bindTexture(d.TEXTURE_CUBE_MAP,k.__webglTexture)):z(o,u)}else if(P===
|
|
|
+"tv"){if(!k._array){k._array=[];P=0;for(m=k.texture.length;P<m;P++)k._array[P]=u+P}d.uniform1iv(o,k._array);P=0;for(m=k.texture.length;P<m;P++)(o=k.texture[P])&&z(o,k._array[P])}(e instanceof THREE.ShaderMaterial||e instanceof THREE.MeshPhongMaterial||e.envMap)&&i.cameraPosition!==null&&d.uniform3f(i.cameraPosition,a.position.x,a.position.y,a.position.z);(e instanceof THREE.MeshPhongMaterial||e instanceof THREE.MeshLambertMaterial||e instanceof THREE.ShaderMaterial||e.skinning)&&i.viewMatrix!==null&&
|
|
|
d.uniformMatrix4fv(i.viewMatrix,!1,Ua);e.skinning&&(d.uniformMatrix4fv(i.cameraInverseMatrix,!1,Ua),d.uniformMatrix4fv(i.boneGlobalMatrices,!1,h.boneMatrices))}d.uniformMatrix4fv(i.modelViewMatrix,!1,h._modelViewMatrixArray);i.normalMatrix&&d.uniformMatrix3fv(i.normalMatrix,!1,h._normalMatrixArray);(e instanceof THREE.ShaderMaterial||e.envMap||e.skinning||h.receiveShadow)&&i.objectMatrix!==null&&d.uniformMatrix4fv(i.objectMatrix,!1,h._objectMatrixArray);return f}function f(a,b,c,h,f,i){if(h.opacity!==
|
|
|
0){var j,u,c=e(a,b,c,h,i),a=c.attributes,b=!1,c=f.id*16777215+c.id*2+(h.wireframe?1:0);c!==R&&(R=c,b=!0);if(!h.morphTargets&&a.position>=0)b&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),d.vertexAttribPointer(a.position,3,d.FLOAT,!1,0,0));else if(i.morphTargetBase){c=h.program.attributes;i.morphTargetBase!==-1?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[i.morphTargetBase]),d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0)):c.position>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglVertexBuffer),
|
|
|
-d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var v=i.morphTargetForcedOrder;for(u=i.morphTargetInfluences;j<h.numSupportedMorphTargets&&j<v.length;)d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[v[j]]),d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0),i.__webglMorphTargetInfluences[j]=u[v[j]],j++}else{var v=[],q=-1,k=0;u=i.morphTargetInfluences;var m,p=u.length;j=0;for(i.morphTargetBase!==-1&&(v[i.morphTargetBase]=!0);j<h.numSupportedMorphTargets;){for(m=
|
|
|
-0;m<p;m++)!v[m]&&u[m]>q&&(k=m,q=u[k]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[k]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=q;v[k]=1;q=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(u=f.__webglCustomAttributesList.length;j<u;j++)c=f.__webglCustomAttributesList[j],a[c.buffer.belongsToAttribute]>=
|
|
|
+d.vertexAttribPointer(c.position,3,d.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length){j=0;var v=i.morphTargetForcedOrder;for(u=i.morphTargetInfluences;j<h.numSupportedMorphTargets&&j<v.length;)d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[v[j]]),d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0),i.__webglMorphTargetInfluences[j]=u[v[j]],j++}else{var v=[],k=-1,o=0;u=i.morphTargetInfluences;var p,m=u.length;j=0;for(i.morphTargetBase!==-1&&(v[i.morphTargetBase]=!0);j<h.numSupportedMorphTargets;){for(p=
|
|
|
+0;p<m;p++)!v[p]&&u[p]>k&&(o=p,k=u[o]);d.bindBuffer(d.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[o]);d.vertexAttribPointer(c["morphTarget"+j],3,d.FLOAT,!1,0,0);i.__webglMorphTargetInfluences[j]=k;v[o]=1;k=-1;j++}}h.program.uniforms.morphTargetInfluences!==null&&d.uniform1fv(h.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}if(b){if(f.__webglCustomAttributesList){j=0;for(u=f.__webglCustomAttributesList.length;j<u;j++)c=f.__webglCustomAttributesList[j],a[c.buffer.belongsToAttribute]>=
|
|
|
0&&(d.bindBuffer(d.ARRAY_BUFFER,c.buffer),d.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,d.FLOAT,!1,0,0))}a.color>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglColorBuffer),d.vertexAttribPointer(a.color,3,d.FLOAT,!1,0,0));a.normal>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglNormalBuffer),d.vertexAttribPointer(a.normal,3,d.FLOAT,!1,0,0));a.tangent>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglTangentBuffer),d.vertexAttribPointer(a.tangent,4,d.FLOAT,!1,0,0));a.uv>=0&&(f.__webglUVBuffer?(d.bindBuffer(d.ARRAY_BUFFER,
|
|
|
f.__webglUVBuffer),d.vertexAttribPointer(a.uv,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv)):d.disableVertexAttribArray(a.uv));a.uv2>=0&&(f.__webglUV2Buffer?(d.bindBuffer(d.ARRAY_BUFFER,f.__webglUV2Buffer),d.vertexAttribPointer(a.uv2,2,d.FLOAT,!1,0,0),d.enableVertexAttribArray(a.uv2)):d.disableVertexAttribArray(a.uv2));h.skinning&&a.skinVertexA>=0&&a.skinVertexB>=0&&a.skinIndex>=0&&a.skinWeight>=0&&(d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexABuffer),d.vertexAttribPointer(a.skinVertexA,4,
|
|
|
d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),d.vertexAttribPointer(a.skinVertexB,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),d.vertexAttribPointer(a.skinIndex,4,d.FLOAT,!1,0,0),d.bindBuffer(d.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),d.vertexAttribPointer(a.skinWeight,4,d.FLOAT,!1,0,0))}i instanceof THREE.Mesh?(h.wireframe?(d.lineWidth(h.wireframeLinewidth),b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),d.drawElements(d.LINES,f.__webglLineCount,
|
|
|
d.UNSIGNED_SHORT,0)):(b&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),d.drawElements(d.TRIANGLES,f.__webglFaceCount,d.UNSIGNED_SHORT,0)),G.info.render.calls++,G.info.render.vertices+=f.__webglFaceCount,G.info.render.faces+=f.__webglFaceCount/3):i instanceof THREE.Line?(i=i.type===THREE.LineStrip?d.LINE_STRIP:d.LINES,d.lineWidth(h.linewidth),d.drawArrays(i,0,f.__webglLineCount),G.info.render.calls++):i instanceof THREE.ParticleSystem?(d.drawArrays(d.POINTS,0,f.__webglParticleCount),G.info.render.calls++):
|
|
|
i instanceof THREE.Ribbon&&(d.drawArrays(d.TRIANGLE_STRIP,0,f.__webglVertexCount),G.info.render.calls++)}}function h(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=d.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=d.createBuffer();a.hasPos&&(d.bindBuffer(d.ARRAY_BUFFER,a.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,a.positionArray,d.DYNAMIC_DRAW),d.enableVertexAttribArray(b.attributes.position),d.vertexAttribPointer(b.attributes.position,3,d.FLOAT,!1,0,0));if(a.hasNormal){d.bindBuffer(d.ARRAY_BUFFER,
|
|
|
-a.__webglNormalBuffer);if(c===THREE.FlatShading){var e,f,h,i,j,v,k,m,p,o,l=a.count*3;for(o=0;o<l;o+=9)c=a.normalArray,e=c[o],f=c[o+1],h=c[o+2],i=c[o+3],v=c[o+4],m=c[o+5],j=c[o+6],k=c[o+7],p=c[o+8],e=(e+i+j)/3,f=(f+v+k)/3,h=(h+m+p)/3,c[o]=e,c[o+1]=f,c[o+2]=h,c[o+3]=e,c[o+4]=f,c[o+5]=h,c[o+6]=e,c[o+7]=f,c[o+8]=h}d.bufferData(d.ARRAY_BUFFER,a.normalArray,d.DYNAMIC_DRAW);d.enableVertexAttribArray(b.attributes.normal);d.vertexAttribPointer(b.attributes.normal,3,d.FLOAT,!1,0,0)}d.drawArrays(d.TRIANGLES,
|
|
|
-0,a.count);a.count=0}function i(a){if(T!==a.doubleSided)a.doubleSided?d.disable(d.CULL_FACE):d.enable(d.CULL_FACE),T=a.doubleSided;if(X!==a.flipSided)a.flipSided?d.frontFace(d.CW):d.frontFace(d.CCW),X=a.flipSided}function j(a){aa!==a&&(a?d.enable(d.DEPTH_TEST):d.disable(d.DEPTH_TEST),aa=a)}function m(a){O!==a&&(d.depthMask(a),O=a)}function k(a,b,c){za!==a&&(a?d.enable(d.POLYGON_OFFSET_FILL):d.disable(d.POLYGON_OFFSET_FILL),za=a);if(a&&(La!==b||Ra!==c))d.polygonOffset(b,c),La=b,Ra=c}function o(a){ha[0].set(a.n41-
|
|
|
+a.__webglNormalBuffer);if(c===THREE.FlatShading){var e,f,h,i,j,v,k,o,p,m,l=a.count*3;for(m=0;m<l;m+=9)c=a.normalArray,e=c[m],f=c[m+1],h=c[m+2],i=c[m+3],v=c[m+4],o=c[m+5],j=c[m+6],k=c[m+7],p=c[m+8],e=(e+i+j)/3,f=(f+v+k)/3,h=(h+o+p)/3,c[m]=e,c[m+1]=f,c[m+2]=h,c[m+3]=e,c[m+4]=f,c[m+5]=h,c[m+6]=e,c[m+7]=f,c[m+8]=h}d.bufferData(d.ARRAY_BUFFER,a.normalArray,d.DYNAMIC_DRAW);d.enableVertexAttribArray(b.attributes.normal);d.vertexAttribPointer(b.attributes.normal,3,d.FLOAT,!1,0,0)}d.drawArrays(d.TRIANGLES,
|
|
|
+0,a.count);a.count=0}function i(a){if(T!==a.doubleSided)a.doubleSided?d.disable(d.CULL_FACE):d.enable(d.CULL_FACE),T=a.doubleSided;if(X!==a.flipSided)a.flipSided?d.frontFace(d.CW):d.frontFace(d.CCW),X=a.flipSided}function j(a){aa!==a&&(a?d.enable(d.DEPTH_TEST):d.disable(d.DEPTH_TEST),aa=a)}function o(a){O!==a&&(d.depthMask(a),O=a)}function k(a,b,c){za!==a&&(a?d.enable(d.POLYGON_OFFSET_FILL):d.disable(d.POLYGON_OFFSET_FILL),za=a);if(a&&(La!==b||Ra!==c))d.polygonOffset(b,c),La=b,Ra=c}function m(a){ha[0].set(a.n41-
|
|
|
a.n11,a.n42-a.n12,a.n43-a.n13,a.n44-a.n14);ha[1].set(a.n41+a.n11,a.n42+a.n12,a.n43+a.n13,a.n44+a.n14);ha[2].set(a.n41+a.n21,a.n42+a.n22,a.n43+a.n23,a.n44+a.n24);ha[3].set(a.n41-a.n21,a.n42-a.n22,a.n43-a.n23,a.n44-a.n24);ha[4].set(a.n41-a.n31,a.n42-a.n32,a.n43-a.n33,a.n44-a.n34);ha[5].set(a.n41+a.n31,a.n42+a.n32,a.n43+a.n33,a.n44+a.n34);for(var b,a=0;a<6;a++)b=ha[a],b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}function p(a){for(var b=a.matrixWorld,d=-a.geometry.boundingSphere.radius*Math.max(a.scale.x,
|
|
|
Math.max(a.scale.y,a.scale.z)),c=0;c<6;c++)if(a=ha[c].x*b.n14+ha[c].y*b.n24+ha[c].z*b.n34+ha[c].w,a<=d)return!1;return!0}function l(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function t(a){var b=a.object,d=a.buffer,c;c=b.material;if(c instanceof THREE.MeshFaceMaterial){if(d=d.materialIndex,d>=0)b=b.geometry.materials[d],b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}else if(b=c)b.transparent?(a.transparent=
|
|
|
-b,a.opaque=null):(a.opaque=b,a.transparent=null)}function A(a,b){return b.z-a.z}function C(a){var b,c,k,m=0,K,l,u,v,q=a.lights;ra||(ra=new THREE.PerspectiveCamera(G.shadowCameraFov,G.shadowMapWidth/G.shadowMapHeight,G.shadowCameraNear,G.shadowCameraFar));b=0;for(c=q.length;b<c;b++)if(k=q[b],k instanceof THREE.SpotLight&&k.castShadow){J=-1;G.shadowMap[m]||(G.shadowMap[m]=new THREE.WebGLRenderTarget(G.shadowMapWidth,G.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));
|
|
|
-Sa[m]||(Sa[m]=new THREE.Matrix4);K=G.shadowMap[m];l=Sa[m];ra.position.copy(k.position);ra.lookAt(k.target.position);ra.update(void 0,!0);a.update(void 0,!1,ra);l.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);l.multiplySelf(ra.projectionMatrix);l.multiplySelf(ra.matrixWorldInverse);ra.matrixWorldInverse.flattenToArray(Ua);ra.projectionMatrix.flattenToArray(Ta);Da.multiply(ra.projectionMatrix,ra.matrixWorldInverse);o(Da);G.initWebGLObjects(a);U(K);d.clearColor(1,1,1,1);G.clear();d.clearColor(Y.r,
|
|
|
-Y.g,Y.b,Fa);l=a.__webglObjects.length;k=a.__webglObjectsImmediate.length;for(K=0;K<l;K++)u=a.__webglObjects[K],v=u.object,v.visible&&v.castShadow?!(v instanceof THREE.Mesh)||!v.frustumCulled||p(v)?(v.matrixWorld.flattenToArray(v._objectMatrixArray),B(v,ra,!1),u.render=!0):u.render=!1:u.render=!1;j(!0);N(THREE.NormalBlending);for(K=0;K<l;K++)if(u=a.__webglObjects[K],u.render)v=u.object,buffer=u.buffer,i(v),u=v.customDepthMaterial?v.customDepthMaterial:v.geometry.morphTargets.length?Za:Va,f(ra,q,null,
|
|
|
-u,buffer,v);for(K=0;K<k;K++)u=a.__webglObjectsImmediate[K],v=u.object,v.visible&&v.castShadow&&(v.matrixAutoUpdate&&v.matrixWorld.flattenToArray(v._objectMatrixArray),R=-1,B(v,ra,!1),i(v),program=e(ra,q,null,Va,v),v.immediateRenderCallback?v.immediateRenderCallback(program,d,ha):v.render(function(a){h(a,program,Va.shading)}));m++}}function E(a,b){var c,e,f;c=r.attributes;var h=r.uniforms,i=ya/Ca,j,k=[],q=Ca*0.5,m=ya*0.5,o=!0;d.useProgram(r.program);Wa=r.program;R=aa=ka=-1;$a||(d.enableVertexAttribArray(r.attributes.position),
|
|
|
-d.enableVertexAttribArray(r.attributes.uv),$a=!0);d.disable(d.CULL_FACE);d.enable(d.BLEND);d.depthMask(!0);d.bindBuffer(d.ARRAY_BUFFER,r.vertexBuffer);d.vertexAttribPointer(c.position,2,d.FLOAT,!1,16,0);d.vertexAttribPointer(c.uv,2,d.FLOAT,!1,16,8);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,r.elementBuffer);d.uniformMatrix4fv(h.projectionMatrix,!1,Ta);d.activeTexture(d.TEXTURE0);d.uniform1i(h.map,0);c=0;for(e=a.__webglSprites.length;c<e;c++)if(f=a.__webglSprites[c],f.visible&&f.opacity!==0)f.useScreenCoordinates?
|
|
|
-f.z=-f.position.z:(f._modelViewMatrix.multiplyToArray(b.matrixWorldInverse,f.matrixWorld,f._modelViewMatrixArray),f.z=-f._modelViewMatrix.n34);a.__webglSprites.sort(A);c=0;for(e=a.__webglSprites.length;c<e;c++)f=a.__webglSprites[c],f.visible&&f.opacity!==0&&f.map&&f.map.image&&f.map.image.width&&(f.useScreenCoordinates?(d.uniform1i(h.useScreenCoordinates,1),d.uniform3f(h.screenPosition,(f.position.x-q)/q,(m-f.position.y)/m,Math.max(0,Math.min(1,f.position.z)))):(d.uniform1i(h.useScreenCoordinates,
|
|
|
+b,a.opaque=null):(a.opaque=b,a.transparent=null)}function A(a,b){return b.z-a.z}function C(a){var b,c,k,o=0,K,l,u,v,r=a.lights;ra||(ra=new THREE.PerspectiveCamera(G.shadowCameraFov,G.shadowMapWidth/G.shadowMapHeight,G.shadowCameraNear,G.shadowCameraFar));b=0;for(c=r.length;b<c;b++)if(k=r[b],k instanceof THREE.SpotLight&&k.castShadow){J=-1;G.shadowMap[o]||(G.shadowMap[o]=new THREE.WebGLRenderTarget(G.shadowMapWidth,G.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));
|
|
|
+Sa[o]||(Sa[o]=new THREE.Matrix4);K=G.shadowMap[o];l=Sa[o];ra.position.copy(k.position);ra.lookAt(k.target.position);ra.update(void 0,!0);a.update(void 0,!1,ra);l.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);l.multiplySelf(ra.projectionMatrix);l.multiplySelf(ra.matrixWorldInverse);ra.matrixWorldInverse.flattenToArray(Ua);ra.projectionMatrix.flattenToArray(Ta);Da.multiply(ra.projectionMatrix,ra.matrixWorldInverse);m(Da);G.initWebGLObjects(a);U(K);d.clearColor(1,1,1,1);G.clear();d.clearColor(Y.r,
|
|
|
+Y.g,Y.b,Fa);l=a.__webglObjects.length;k=a.__webglObjectsImmediate.length;for(K=0;K<l;K++)u=a.__webglObjects[K],v=u.object,v.visible&&v.castShadow?!(v instanceof THREE.Mesh)||!v.frustumCulled||p(v)?(v.matrixWorld.flattenToArray(v._objectMatrixArray),B(v,ra,!1),u.render=!0):u.render=!1:u.render=!1;j(!0);N(THREE.NormalBlending);for(K=0;K<l;K++)if(u=a.__webglObjects[K],u.render)v=u.object,buffer=u.buffer,i(v),u=v.customDepthMaterial?v.customDepthMaterial:v.geometry.morphTargets.length?Za:Va,f(ra,r,null,
|
|
|
+u,buffer,v);for(K=0;K<k;K++)u=a.__webglObjectsImmediate[K],v=u.object,v.visible&&v.castShadow&&(v.matrixAutoUpdate&&v.matrixWorld.flattenToArray(v._objectMatrixArray),R=-1,B(v,ra,!1),i(v),program=e(ra,r,null,Va,v),v.immediateRenderCallback?v.immediateRenderCallback(program,d,ha):v.render(function(a){h(a,program,Va.shading)}));o++}}function E(a,b){var c,e,f;c=q.attributes;var h=q.uniforms,i=ya/Ca,j,k=[],r=Ca*0.5,o=ya*0.5,m=!0;d.useProgram(q.program);Wa=q.program;R=aa=ka=-1;$a||(d.enableVertexAttribArray(q.attributes.position),
|
|
|
+d.enableVertexAttribArray(q.attributes.uv),$a=!0);d.disable(d.CULL_FACE);d.enable(d.BLEND);d.depthMask(!0);d.bindBuffer(d.ARRAY_BUFFER,q.vertexBuffer);d.vertexAttribPointer(c.position,2,d.FLOAT,!1,16,0);d.vertexAttribPointer(c.uv,2,d.FLOAT,!1,16,8);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.elementBuffer);d.uniformMatrix4fv(h.projectionMatrix,!1,Ta);d.activeTexture(d.TEXTURE0);d.uniform1i(h.map,0);c=0;for(e=a.__webglSprites.length;c<e;c++)if(f=a.__webglSprites[c],f.visible&&f.opacity!==0)f.useScreenCoordinates?
|
|
|
+f.z=-f.position.z:(f._modelViewMatrix.multiplyToArray(b.matrixWorldInverse,f.matrixWorld,f._modelViewMatrixArray),f.z=-f._modelViewMatrix.n34);a.__webglSprites.sort(A);c=0;for(e=a.__webglSprites.length;c<e;c++)f=a.__webglSprites[c],f.visible&&f.opacity!==0&&f.map&&f.map.image&&f.map.image.width&&(f.useScreenCoordinates?(d.uniform1i(h.useScreenCoordinates,1),d.uniform3f(h.screenPosition,(f.position.x-r)/r,(o-f.position.y)/o,Math.max(0,Math.min(1,f.position.z)))):(d.uniform1i(h.useScreenCoordinates,
|
|
|
0),d.uniform1i(h.affectedByDistance,f.affectedByDistance?1:0),d.uniformMatrix4fv(h.modelViewMatrix,!1,f._modelViewMatrixArray)),j=f.map.image.width/(f.scaleByViewport?ya:1),k[0]=j*i*f.scale.x,k[1]=j*f.scale.y,d.uniform2f(h.uvScale,f.uvScale.x,f.uvScale.y),d.uniform2f(h.uvOffset,f.uvOffset.x,f.uvOffset.y),d.uniform2f(h.alignment,f.alignment.x,f.alignment.y),d.uniform1f(h.opacity,f.opacity),d.uniform3f(h.color,f.color.r,f.color.g,f.color.b),d.uniform1f(h.rotation,f.rotation),d.uniform2fv(h.scale,k),
|
|
|
-f.mergeWith3D&&!o?(d.enable(d.DEPTH_TEST),o=!0):!f.mergeWith3D&&o&&(d.disable(d.DEPTH_TEST),o=!1),N(f.blending),z(f.map,0),d.drawElements(d.TRIANGLES,6,d.UNSIGNED_SHORT,0));d.enable(d.CULL_FACE);d.enable(d.DEPTH_TEST);d.depthMask(O)}function B(a,b,d){a._modelViewMatrix.multiplyToArray(b.matrixWorldInverse,a.matrixWorld,a._modelViewMatrixArray);d&&THREE.Matrix4.makeInvert3x3(a._modelViewMatrix).transposeIntoArray(a._normalMatrixArray)}function va(a,d){var c=b(d,a);if(c.attributes)for(var e in c.attributes)if(c.attributes[e].needsUpdate)return!0;
|
|
|
-return!1}function wa(a,d){var c=b(d,a);if(c.attributes)for(var e in c.attributes)c.attributes[e].needsUpdate=!1}function pa(a,b){var d;for(d=a.length-1;d>=0;d--)a[d].object===b&&a.splice(d,1)}function qa(a,b,d){a.push({buffer:b,object:d,opaque:null,transparent:null})}function N(a){if(a!==ka){switch(a){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE);break;case THREE.SubtractiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.ONE_MINUS_SRC_COLOR);break;
|
|
|
-case THREE.MultiplyBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.SRC_COLOR);break;default:d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}ka=a}}function F(a,b,c){(c.width&c.width-1)===0&&(c.height&c.height-1)===0?(d.texParameteri(a,d.TEXTURE_WRAP_S,Q(b.wrapS)),d.texParameteri(a,d.TEXTURE_WRAP_T,Q(b.wrapT)),d.texParameteri(a,d.TEXTURE_MAG_FILTER,Q(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,Q(b.minFilter)),
|
|
|
-d.generateMipmap(a)):(d.texParameteri(a,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_MAG_FILTER,xa(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,xa(b.minFilter)))}function z(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=d.createTexture(),G.info.memory.textures++;d.activeTexture(d.TEXTURE0+b);d.bindTexture(d.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?d.texImage2D(d.TEXTURE_2D,0,
|
|
|
-Q(a.format),a.image.width,a.image.height,0,Q(a.format),d.UNSIGNED_BYTE,a.image.data):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,a.image);F(d.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+b),d.bindTexture(d.TEXTURE_2D,a.__webglTexture)}function W(a,b){d.bindRenderbuffer(d.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,
|
|
|
-a)):b.depthBuffer&&b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,a)):d.renderbufferStorage(d.RENDERBUFFER,d.RGBA4,b.width,b.height)}function U(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=d.createTexture();if(b){a.__webglFramebuffer=[];
|
|
|
-a.__webglRenderbuffer=[];d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture);F(d.TEXTURE_CUBE_MAP,a,a);for(var c=0;c<6;c++){a.__webglFramebuffer[c]=d.createFramebuffer();a.__webglRenderbuffer[c]=d.createRenderbuffer();d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null);var e=a,f=d.TEXTURE_CUBE_MAP_POSITIVE_X+c;d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer[c]);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,f,e.__webglTexture,0);
|
|
|
-W(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=d.createFramebuffer(),a.__webglRenderbuffer=d.createRenderbuffer(),d.bindTexture(d.TEXTURE_2D,a.__webglTexture),F(d.TEXTURE_2D,a,a),d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null),c=d.TEXTURE_2D,d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,c,a.__webglTexture,0),d.bindRenderbuffer(d.RENDERBUFFER,a.__webglRenderbuffer),W(a.__webglRenderbuffer,
|
|
|
-a);b?d.bindTexture(d.TEXTURE_CUBE_MAP,null):d.bindTexture(d.TEXTURE_2D,null);d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=e=0):(b=null,c=Ca,a=ya,e=Ha,f=Aa);b!==ua&&(d.bindFramebuffer(d.FRAMEBUFFER,b),d.viewport(e,f,c,a),ua=b)}function ja(a){a instanceof THREE.WebGLRenderTargetCube?(d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture),d.generateMipmap(d.TEXTURE_CUBE_MAP),d.bindTexture(d.TEXTURE_CUBE_MAP,
|
|
|
-null)):(d.bindTexture(d.TEXTURE_2D,a.__webglTexture),d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null))}function $(a,b){var c;a==="fragment"?c=d.createShader(d.FRAGMENT_SHADER):a==="vertex"&&(c=d.createShader(d.VERTEX_SHADER));d.shaderSource(c,b);d.compileShader(c);if(!d.getShaderParameter(c,d.COMPILE_STATUS))return console.error(d.getShaderInfoLog(c)),console.error(b),null;return c}function xa(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST;
|
|
|
-default:return d.LINEAR}}function Q(a){switch(a){case THREE.RepeatWrapping:return d.REPEAT;case THREE.ClampToEdgeWrapping:return d.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return d.MIRRORED_REPEAT;case THREE.NearestFilter:return d.NEAREST;case THREE.NearestMipMapNearestFilter:return d.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return d.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return d.LINEAR;case THREE.LinearMipMapNearestFilter:return d.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return d.LINEAR_MIPMAP_LINEAR;
|
|
|
+f.mergeWith3D&&!m?(d.enable(d.DEPTH_TEST),m=!0):!f.mergeWith3D&&m&&(d.disable(d.DEPTH_TEST),m=!1),N(f.blending),z(f.map,0),d.drawElements(d.TRIANGLES,6,d.UNSIGNED_SHORT,0));d.enable(d.CULL_FACE);d.enable(d.DEPTH_TEST);d.depthMask(O)}function B(a,b,d){a._modelViewMatrix.multiplyToArray(b.matrixWorldInverse,a.matrixWorld,a._modelViewMatrixArray);d&&THREE.Matrix4.makeInvert3x3(a._modelViewMatrix).transposeIntoArray(a._normalMatrixArray)}function va(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;
|
|
|
+return!1}function wa(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function pa(a,b){for(var d=a.length-1;d>=0;d--)a[d].object===b&&a.splice(d,1)}function qa(a,b,d){a.push({buffer:b,object:d,opaque:null,transparent:null})}function N(a){if(a!==ka){switch(a){case THREE.AdditiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE);break;case THREE.SubtractiveBlending:d.blendEquation(d.FUNC_ADD);d.blendFunc(d.ZERO,d.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:d.blendEquation(d.FUNC_ADD);
|
|
|
+d.blendFunc(d.ZERO,d.SRC_COLOR);break;default:d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}ka=a}}function F(a,b,c){(c.width&c.width-1)===0&&(c.height&c.height-1)===0?(d.texParameteri(a,d.TEXTURE_WRAP_S,Q(b.wrapS)),d.texParameteri(a,d.TEXTURE_WRAP_T,Q(b.wrapT)),d.texParameteri(a,d.TEXTURE_MAG_FILTER,Q(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,Q(b.minFilter)),d.generateMipmap(a)):(d.texParameteri(a,d.TEXTURE_WRAP_S,
|
|
|
+d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(a,d.TEXTURE_MAG_FILTER,xa(b.magFilter)),d.texParameteri(a,d.TEXTURE_MIN_FILTER,xa(b.minFilter)))}function z(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=d.createTexture(),G.info.memory.textures++;d.activeTexture(d.TEXTURE0+b);d.bindTexture(d.TEXTURE_2D,a.__webglTexture);a instanceof THREE.DataTexture?d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.image.width,a.image.height,0,Q(a.format),d.UNSIGNED_BYTE,
|
|
|
+a.image.data):d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,a.image);F(d.TEXTURE_2D,a,a.image);a.needsUpdate=!1}else d.activeTexture(d.TEXTURE0+b),d.bindTexture(d.TEXTURE_2D,a.__webglTexture)}function W(a,b){d.bindRenderbuffer(d.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(d.renderbufferStorage(d.RENDERBUFFER,
|
|
|
+d.DEPTH_STENCIL,b.width,b.height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,a)):d.renderbufferStorage(d.RENDERBUFFER,d.RGBA4,b.width,b.height)}function U(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=d.createTexture();if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture);
|
|
|
+F(d.TEXTURE_CUBE_MAP,a,a);for(var c=0;c<6;c++){a.__webglFramebuffer[c]=d.createFramebuffer();a.__webglRenderbuffer[c]=d.createRenderbuffer();d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null);var e=a,f=d.TEXTURE_CUBE_MAP_POSITIVE_X+c;d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer[c]);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,f,e.__webglTexture,0);W(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=d.createFramebuffer(),
|
|
|
+a.__webglRenderbuffer=d.createRenderbuffer(),d.bindTexture(d.TEXTURE_2D,a.__webglTexture),F(d.TEXTURE_2D,a,a),d.texImage2D(d.TEXTURE_2D,0,Q(a.format),a.width,a.height,0,Q(a.format),Q(a.type),null),c=d.TEXTURE_2D,d.bindFramebuffer(d.FRAMEBUFFER,a.__webglFramebuffer),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,c,a.__webglTexture,0),d.bindRenderbuffer(d.RENDERBUFFER,a.__webglRenderbuffer),W(a.__webglRenderbuffer,a);b?d.bindTexture(d.TEXTURE_CUBE_MAP,null):d.bindTexture(d.TEXTURE_2D,null);
|
|
|
+d.bindRenderbuffer(d.RENDERBUFFER,null);d.bindFramebuffer(d.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=e=0):(b=null,c=Ca,a=ya,e=Ha,f=Aa);b!==ua&&(d.bindFramebuffer(d.FRAMEBUFFER,b),d.viewport(e,f,c,a),ua=b)}function ja(a){a instanceof THREE.WebGLRenderTargetCube?(d.bindTexture(d.TEXTURE_CUBE_MAP,a.__webglTexture),d.generateMipmap(d.TEXTURE_CUBE_MAP),d.bindTexture(d.TEXTURE_CUBE_MAP,null)):(d.bindTexture(d.TEXTURE_2D,a.__webglTexture),
|
|
|
+d.generateMipmap(d.TEXTURE_2D),d.bindTexture(d.TEXTURE_2D,null))}function $(a,b){var c;a==="fragment"?c=d.createShader(d.FRAGMENT_SHADER):a==="vertex"&&(c=d.createShader(d.VERTEX_SHADER));d.shaderSource(c,b);d.compileShader(c);if(!d.getShaderParameter(c,d.COMPILE_STATUS))return console.error(d.getShaderInfoLog(c)),console.error(b),null;return c}function xa(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return d.NEAREST;default:return d.LINEAR}}
|
|
|
+function Q(a){switch(a){case THREE.RepeatWrapping:return d.REPEAT;case THREE.ClampToEdgeWrapping:return d.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return d.MIRRORED_REPEAT;case THREE.NearestFilter:return d.NEAREST;case THREE.NearestMipMapNearestFilter:return d.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return d.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return d.LINEAR;case THREE.LinearMipMapNearestFilter:return d.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return d.LINEAR_MIPMAP_LINEAR;
|
|
|
case THREE.ByteType:return d.BYTE;case THREE.UnsignedByteType:return d.UNSIGNED_BYTE;case THREE.ShortType:return d.SHORT;case THREE.UnsignedShortType:return d.UNSIGNED_SHORT;case THREE.IntType:return d.INT;case THREE.UnsignedShortType:return d.UNSIGNED_INT;case THREE.FloatType:return d.FLOAT;case THREE.AlphaFormat:return d.ALPHA;case THREE.RGBFormat:return d.RGB;case THREE.RGBAFormat:return d.RGBA;case THREE.LuminanceFormat:return d.LUMINANCE;case THREE.LuminanceAlphaFormat:return d.LUMINANCE_ALPHA}return 0}
|
|
|
var G=this,d,ta=[],Wa=null,ua=null,J=-1,R=null,S=0,T=null,X=null,ka=null,aa=null,O=null,za=null,La=null,Ra=null,Ha=0,Aa=0,Ca=0,ya=0,ha=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Da=new THREE.Matrix4,Ta=new Float32Array(16),Ua=new Float32Array(16),Ja=new THREE.Vector4,Ya={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},a=a||{},Ba=a.canvas!==void 0?a.canvas:document.createElement("canvas"),
|
|
|
I=a.stencil!==void 0?a.stencil:!0,cb=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,db=a.antialias!==void 0?a.antialias:!1,Y=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),Fa=a.clearAlpha!==void 0?a.clearAlpha:0,Xa=a.maxLights!==void 0?a.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=Ba;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=
|
|
|
!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;var ra,Sa=[],a=THREE.ShaderLib.depthRGBA,ab=THREE.UniformsUtils.clone(a.uniforms),Va=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ab}),
|
|
|
Za=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:ab,morphTargets:!0});Va._shadowPass=!0;Za._shadowPass=!0;try{if(!(d=Ba.getContext("experimental-webgl",{antialias:db,stencil:I,preserveDrawingBuffer:cb})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+d.getParameter(d.VERSION)+" | "+d.getParameter(d.VENDOR)+" | "+d.getParameter(d.RENDERER)+" | "+d.getParameter(d.SHADING_LANGUAGE_VERSION))}catch(eb){console.error(eb)}d.clearColor(0,
|
|
|
-0,0,1);d.clearDepth(1);d.clearStencil(0);d.enable(d.DEPTH_TEST);d.depthFunc(d.LEQUAL);d.frontFace(d.CCW);d.cullFace(d.BACK);d.enable(d.CULL_FACE);d.enable(d.BLEND);d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);d.clearColor(Y.r,Y.g,Y.b,Fa);this.context=d;var bb=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,r={};r.vertices=new Float32Array(16);r.faces=new Uint16Array(6);I=0;r.vertices[I++]=-1;r.vertices[I++]=-1;r.vertices[I++]=0;r.vertices[I++]=1;r.vertices[I++]=1;
|
|
|
-r.vertices[I++]=-1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=1;r.vertices[I++]=0;r.vertices[I++]=-1;r.vertices[I++]=1;r.vertices[I++]=0;I=r.vertices[I++]=0;r.faces[I++]=0;r.faces[I++]=1;r.faces[I++]=2;r.faces[I++]=0;r.faces[I++]=2;r.faces[I++]=3;r.vertexBuffer=d.createBuffer();r.elementBuffer=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,r.vertexBuffer);d.bufferData(d.ARRAY_BUFFER,r.vertices,d.STATIC_DRAW);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,r.elementBuffer);
|
|
|
-d.bufferData(d.ELEMENT_ARRAY_BUFFER,r.faces,d.STATIC_DRAW);r.program=d.createProgram();d.attachShader(r.program,$("fragment",THREE.ShaderLib.sprite.fragmentShader));d.attachShader(r.program,$("vertex",THREE.ShaderLib.sprite.vertexShader));d.linkProgram(r.program);r.attributes={};r.uniforms={};r.attributes.position=d.getAttribLocation(r.program,"position");r.attributes.uv=d.getAttribLocation(r.program,"uv");r.uniforms.uvOffset=d.getUniformLocation(r.program,"uvOffset");r.uniforms.uvScale=d.getUniformLocation(r.program,
|
|
|
-"uvScale");r.uniforms.rotation=d.getUniformLocation(r.program,"rotation");r.uniforms.scale=d.getUniformLocation(r.program,"scale");r.uniforms.alignment=d.getUniformLocation(r.program,"alignment");r.uniforms.color=d.getUniformLocation(r.program,"color");r.uniforms.map=d.getUniformLocation(r.program,"map");r.uniforms.opacity=d.getUniformLocation(r.program,"opacity");r.uniforms.useScreenCoordinates=d.getUniformLocation(r.program,"useScreenCoordinates");r.uniforms.affectedByDistance=d.getUniformLocation(r.program,
|
|
|
-"affectedByDistance");r.uniforms.screenPosition=d.getUniformLocation(r.program,"screenPosition");r.uniforms.modelViewMatrix=d.getUniformLocation(r.program,"modelViewMatrix");r.uniforms.projectionMatrix=d.getUniformLocation(r.program,"projectionMatrix");var $a=!1;this.setSize=function(a,b){Ba.width=a;Ba.height=b;this.setViewport(0,0,Ba.width,Ba.height)};this.setViewport=function(a,b,c,e){Ha=a;Aa=b;Ca=c;ya=e;d.viewport(Ha,Aa,Ca,ya)};this.setScissor=function(a,b,c,e){d.scissor(a,b,c,e)};this.enableScissorTest=
|
|
|
+0,0,1);d.clearDepth(1);d.clearStencil(0);d.enable(d.DEPTH_TEST);d.depthFunc(d.LEQUAL);d.frontFace(d.CCW);d.cullFace(d.BACK);d.enable(d.CULL_FACE);d.enable(d.BLEND);d.blendEquation(d.FUNC_ADD);d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA);d.clearColor(Y.r,Y.g,Y.b,Fa);this.context=d;var bb=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,q={};q.vertices=new Float32Array(16);q.faces=new Uint16Array(6);I=0;q.vertices[I++]=-1;q.vertices[I++]=-1;q.vertices[I++]=0;q.vertices[I++]=1;q.vertices[I++]=1;
|
|
|
+q.vertices[I++]=-1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=1;q.vertices[I++]=0;q.vertices[I++]=-1;q.vertices[I++]=1;q.vertices[I++]=0;I=q.vertices[I++]=0;q.faces[I++]=0;q.faces[I++]=1;q.faces[I++]=2;q.faces[I++]=0;q.faces[I++]=2;q.faces[I++]=3;q.vertexBuffer=d.createBuffer();q.elementBuffer=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,q.vertexBuffer);d.bufferData(d.ARRAY_BUFFER,q.vertices,d.STATIC_DRAW);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.elementBuffer);
|
|
|
+d.bufferData(d.ELEMENT_ARRAY_BUFFER,q.faces,d.STATIC_DRAW);q.program=d.createProgram();d.attachShader(q.program,$("fragment",THREE.ShaderLib.sprite.fragmentShader));d.attachShader(q.program,$("vertex",THREE.ShaderLib.sprite.vertexShader));d.linkProgram(q.program);q.attributes={};q.uniforms={};q.attributes.position=d.getAttribLocation(q.program,"position");q.attributes.uv=d.getAttribLocation(q.program,"uv");q.uniforms.uvOffset=d.getUniformLocation(q.program,"uvOffset");q.uniforms.uvScale=d.getUniformLocation(q.program,
|
|
|
+"uvScale");q.uniforms.rotation=d.getUniformLocation(q.program,"rotation");q.uniforms.scale=d.getUniformLocation(q.program,"scale");q.uniforms.alignment=d.getUniformLocation(q.program,"alignment");q.uniforms.color=d.getUniformLocation(q.program,"color");q.uniforms.map=d.getUniformLocation(q.program,"map");q.uniforms.opacity=d.getUniformLocation(q.program,"opacity");q.uniforms.useScreenCoordinates=d.getUniformLocation(q.program,"useScreenCoordinates");q.uniforms.affectedByDistance=d.getUniformLocation(q.program,
|
|
|
+"affectedByDistance");q.uniforms.screenPosition=d.getUniformLocation(q.program,"screenPosition");q.uniforms.modelViewMatrix=d.getUniformLocation(q.program,"modelViewMatrix");q.uniforms.projectionMatrix=d.getUniformLocation(q.program,"projectionMatrix");var $a=!1;this.setSize=function(a,b){Ba.width=a;Ba.height=b;this.setViewport(0,0,Ba.width,Ba.height)};this.setViewport=function(a,b,c,e){Ha=a;Aa=b;Ca=c;ya=e;d.viewport(Ha,Aa,Ca,ya)};this.setScissor=function(a,b,c,e){d.scissor(a,b,c,e)};this.enableScissorTest=
|
|
|
function(a){a?d.enable(d.SCISSOR_TEST):d.disable(d.SCISSOR_TEST)};this.setClearColorHex=function(a,b){Y.setHex(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.setClearColor=function(a,b){Y.copy(a);Fa=b;d.clearColor(Y.r,Y.g,Y.b,Fa)};this.getClearColor=function(){return Y};this.getClearAlpha=function(){return Fa};this.clear=function(a,b,c){var e=0;if(a===void 0||a)e|=d.COLOR_BUFFER_BIT;if(b===void 0||b)e|=d.DEPTH_BUFFER_BIT;if(c===void 0||c)e|=d.STENCIL_BUFFER_BIT;d.clear(e)};this.getContext=function(){return d};
|
|
|
this.deallocateObject=function(a){if(a.__webglInit)if(a.__webglInit=!1,delete a._modelViewMatrix,delete a._normalMatrixArray,delete a._modelViewMatrixArray,delete a._objectMatrixArray,a instanceof THREE.Mesh)for(g in a.geometry.geometryGroups){var b=a.geometry.geometryGroups[g];d.deleteBuffer(b.__webglVertexBuffer);d.deleteBuffer(b.__webglNormalBuffer);d.deleteBuffer(b.__webglTangentBuffer);d.deleteBuffer(b.__webglColorBuffer);d.deleteBuffer(b.__webglUVBuffer);d.deleteBuffer(b.__webglUV2Buffer);d.deleteBuffer(b.__webglSkinVertexABuffer);
|
|
|
d.deleteBuffer(b.__webglSkinVertexBBuffer);d.deleteBuffer(b.__webglSkinIndicesBuffer);d.deleteBuffer(b.__webglSkinWeightsBuffer);d.deleteBuffer(b.__webglFaceBuffer);d.deleteBuffer(b.__webglLineBuffer);if(b.numMorphTargets)for(var c=0,e=b.numMorphTargets;c<e;c++)d.deleteBuffer(b.__webglMorphTargetsBuffers[c]);G.info.memory.geometries--}else if(a instanceof THREE.Ribbon)a=a.geometry,d.deleteBuffer(a.__webglVertexBuffer),d.deleteBuffer(a.__webglColorBuffer),G.info.memory.geometries--;else if(a instanceof
|
|
|
THREE.Line)a=a.geometry,d.deleteBuffer(a.__webglVertexBuffer),d.deleteBuffer(a.__webglColorBuffer),G.info.memory.geometries--;else if(a instanceof THREE.ParticleSystem)a=a.geometry,d.deleteBuffer(a.__webglVertexBuffer),d.deleteBuffer(a.__webglColorBuffer),G.info.memory.geometries--};this.deallocateTexture=function(a){if(a.__webglInit)a.__webglInit=!1,d.deleteTexture(a.__webglTexture),G.info.memory.textures--};this.initMaterial=function(a,b,c,e){var f,h,i,j;a instanceof THREE.MeshDepthMaterial?j="depth":
|
|
|
-a instanceof THREE.MeshNormalMaterial?j="normal":a instanceof THREE.MeshBasicMaterial?j="basic":a instanceof THREE.MeshLambertMaterial?j="lambert":a instanceof THREE.MeshPhongMaterial?j="phong":a instanceof THREE.LineBasicMaterial?j="basic":a instanceof THREE.ParticleBasicMaterial&&(j="particle_basic");if(j){var k=THREE.ShaderLib[j];a.uniforms=THREE.UniformsUtils.clone(k.uniforms);a.vertexShader=k.vertexShader;a.fragmentShader=k.fragmentShader}var q,m,o;q=o=k=0;for(m=b.length;q<m;q++)i=b[q],i instanceof
|
|
|
-THREE.SpotLight&&o++,i instanceof THREE.DirectionalLight&&o++,i instanceof THREE.PointLight&&k++;k+o<=Xa?q=o:(q=Math.ceil(Xa*o/(k+o)),k=Xa-q);i={directional:q,point:k};k=o=0;for(q=b.length;k<q;k++)m=b[k],m instanceof THREE.SpotLight&&m.castShadow&&o++;var p=50;if(e!==void 0&&e instanceof THREE.SkinnedMesh)p=e.bones.length;var l;a:{q=a.fragmentShader;m=a.vertexShader;var k=a.uniforms,b=a.attributes,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,
|
|
|
-sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,morphTargets:a.morphTargets,maxMorphTargets:this.maxMorphTargets,maxDirLights:i.directional,maxPointLights:i.point,maxBones:p,shadowMapEnabled:this.shadowMapEnabled&&e.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:o,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel},t,e=[];j?e.push(j):(e.push(q),e.push(m));for(t in c)e.push(t),e.push(c[t]);j=e.join();t=0;
|
|
|
+a instanceof THREE.MeshNormalMaterial?j="normal":a instanceof THREE.MeshBasicMaterial?j="basic":a instanceof THREE.MeshLambertMaterial?j="lambert":a instanceof THREE.MeshPhongMaterial?j="phong":a instanceof THREE.LineBasicMaterial?j="basic":a instanceof THREE.ParticleBasicMaterial&&(j="particle_basic");if(j){var k=THREE.ShaderLib[j];a.uniforms=THREE.UniformsUtils.clone(k.uniforms);a.vertexShader=k.vertexShader;a.fragmentShader=k.fragmentShader}var r,o,m;r=m=k=0;for(o=b.length;r<o;r++)i=b[r],i instanceof
|
|
|
+THREE.SpotLight&&m++,i instanceof THREE.DirectionalLight&&m++,i instanceof THREE.PointLight&&k++;k+m<=Xa?r=m:(r=Math.ceil(Xa*m/(k+m)),k=Xa-r);i={directional:r,point:k};k=m=0;for(r=b.length;k<r;k++)o=b[k],o instanceof THREE.SpotLight&&o.castShadow&&m++;var p=50;if(e!==void 0&&e instanceof THREE.SkinnedMesh)p=e.bones.length;var l;a:{r=a.fragmentShader;o=a.vertexShader;var k=a.uniforms,b=a.attributes,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,
|
|
|
+sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,morphTargets:a.morphTargets,maxMorphTargets:this.maxMorphTargets,maxDirLights:i.directional,maxPointLights:i.point,maxBones:p,shadowMapEnabled:this.shadowMapEnabled&&e.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:m,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel},t,e=[];j?e.push(j):(e.push(r),e.push(o));for(t in c)e.push(t),e.push(c[t]);j=e.join();t=0;
|
|
|
for(e=ta.length;t<e;t++)if(ta[t].code===j){l=ta[t].program;break a}t=d.createProgram();e=[bb?"#define VERTEX_TEXTURES":"",G.gammaInput?"#define GAMMA_INPUT":"",G.gammaOutput?"#define GAMMA_OUTPUT":"",G.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":
|
|
|
"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.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 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
|
|
|
i=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",G.gammaInput?"#define GAMMA_INPUT":"",G.gammaOutput?"#define GAMMA_OUTPUT":"",G.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":
|
|
|
-"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapSoft?"#define SHADOWMAP_WIDTH "+c.shadowMapWidth.toFixed(1):"",c.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+c.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");d.attachShader(t,$("fragment",i+q));d.attachShader(t,
|
|
|
-$("vertex",e+m));d.linkProgram(t);d.getProgramParameter(t,d.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+d.getProgramParameter(t,d.VALIDATE_STATUS)+", gl error ["+d.getError()+"]");t.uniforms={};t.attributes={};var r,e=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(r in k)e.push(r);r=e;e=0;for(k=r.length;e<k;e++)q=r[e],t.uniforms[q]=d.getUniformLocation(t,
|
|
|
-q);e=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(r=0;r<c.maxMorphTargets;r++)e.push("morphTarget"+r);for(l in b)e.push(l);l=e;r=0;for(b=l.length;r<b;r++)c=l[r],t.attributes[c]=d.getAttribLocation(t,c);t.id=ta.length;ta.push({program:t,code:j});G.info.memory.programs=ta.length;l=t}a.program=l;l=a.program.attributes;l.position>=0&&d.enableVertexAttribArray(l.position);l.color>=0&&d.enableVertexAttribArray(l.color);l.normal>=0&&d.enableVertexAttribArray(l.normal);
|
|
|
-l.tangent>=0&&d.enableVertexAttribArray(l.tangent);a.skinning&&l.skinVertexA>=0&&l.skinVertexB>=0&&l.skinIndex>=0&&l.skinWeight>=0&&(d.enableVertexAttribArray(l.skinVertexA),d.enableVertexAttribArray(l.skinVertexB),d.enableVertexAttribArray(l.skinIndex),d.enableVertexAttribArray(l.skinWeight));if(a.attributes)for(h in a.attributes)l[h]!==void 0&&l[h]>=0&&d.enableVertexAttribArray(l[h]);if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h<this.maxMorphTargets;h++)r="morphTarget"+h,l[r]>=0&&(d.enableVertexAttribArray(l[r]),
|
|
|
-a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,b,c,d){U(a);this.clear(b,c,d)};this.updateShadowMap=function(a,b){C(a,b)};this.render=function(a,b,c,r){var Ia,K,Ea,u,v,q,z,Pa=a.lights,Qa=a.fog;J=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&C(a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;if(b.matrixAutoUpdate){for(Ea=b;Ea.parent;)Ea=Ea.parent;Ea.update(void 0,!0)}a.update(void 0,
|
|
|
-!1,b);b.matrixWorldInverse.flattenToArray(Ua);b.projectionMatrix.flattenToArray(Ta);Da.multiply(b.projectionMatrix,b.matrixWorldInverse);o(Da);this.initWebGLObjects(a);U(c);(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);Ea=a.__webglObjects.length;for(r=0;r<Ea;r++)if(v=a.__webglObjects[r],q=v.object,q.visible)if(!(q instanceof THREE.Mesh)||!q.frustumCulled||p(q)){if(q.matrixWorld.flattenToArray(q._objectMatrixArray),B(q,b,!0),t(v),v.render=!0,this.sortObjects)v.object.renderDepth?
|
|
|
-v.z=v.object.renderDepth:(Ja.copy(q.position),Da.multiplyVector3(Ja),v.z=Ja.z)}else v.render=!1;else v.render=!1;this.sortObjects&&a.__webglObjects.sort(A);u=a.__webglObjectsImmediate.length;for(r=0;r<u;r++)v=a.__webglObjectsImmediate[r],q=v.object,q.visible&&(q.matrixAutoUpdate&&q.matrixWorld.flattenToArray(q._objectMatrixArray),B(q,b,!0),l(v));if(a.overrideMaterial){j(a.overrideMaterial.depthTest);N(a.overrideMaterial.blending);for(r=0;r<Ea;r++)if(v=a.__webglObjects[r],v.render)q=v.object,z=v.buffer,
|
|
|
-i(q),f(b,Pa,Qa,a.overrideMaterial,z,q);for(r=0;r<u;r++)v=a.__webglObjectsImmediate[r],q=v.object,q.visible&&(R=-1,i(q),Ia=e(b,Pa,Qa,a.overrideMaterial,q),q.immediateRenderCallback?q.immediateRenderCallback(Ia,d,ha):q.render(function(b){h(b,Ia,a.overrideMaterial.shading)}))}else{N(THREE.NormalBlending);for(r=Ea-1;r>=0;r--)if(v=a.__webglObjects[r],v.render&&(q=v.object,z=v.buffer,K=v.opaque))i(q),j(K.depthTest),m(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),f(b,Pa,Qa,
|
|
|
-K,z,q);for(r=0;r<u;r++)if(v=a.__webglObjectsImmediate[r],q=v.object,q.visible&&(R=-1,K=v.opaque))i(q),j(K.depthTest),m(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),Ia=e(b,Pa,Qa,K,q),q.immediateRenderCallback?q.immediateRenderCallback(Ia,d,ha):q.render(function(a){h(a,Ia,K.shading)});for(r=0;r<Ea;r++)if(v=a.__webglObjects[r],v.render&&(q=v.object,z=v.buffer,K=v.transparent))i(q),N(K.blending),j(K.depthTest),m(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),
|
|
|
-f(b,Pa,Qa,K,z,q);for(r=0;r<u;r++)if(v=a.__webglObjectsImmediate[r],q=v.object,q.visible&&(R=-1,K=v.transparent))i(q),N(K.blending),j(K.depthTest),m(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),Ia=e(b,Pa,Qa,K,q),q.immediateRenderCallback?q.immediateRenderCallback(Ia,d,ha):q.render(function(a){h(a,Ia,K.shading)})}a.__webglSprites.length&&E(a,b);c&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&ja(c)};this.initWebGLObjects=function(a){if(!a.__webglObjects)a.__webglObjects=
|
|
|
-[],a.__webglObjectsImmediate=[],a.__webglSprites=[];for(;a.__objectsAdded.length;){var e=a.__objectsAdded[0],f=a,h=void 0,i=void 0,j=void 0;if(!e.__webglInit)if(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrixArray=new Float32Array(9),e._modelViewMatrixArray=new Float32Array(16),e._objectMatrixArray=new Float32Array(16),e.matrixWorld.flattenToArray(e._objectMatrixArray),e instanceof THREE.Mesh){i=e.geometry;if(i.geometryGroups===void 0){var j=i,k=void 0,m=void 0,o=void 0,q=void 0,
|
|
|
-l=o=void 0,p=void 0,r={},t=j.morphTargets!==void 0?j.morphTargets.length:0;j.geometryGroups={};k=0;for(m=j.faces.length;k<m;k++)o=j.faces[k],q=o.materialIndex,l=q!==void 0?q:-1,r[l]===void 0&&(r[l]={hash:l,counter:0}),p=r[l].hash+"_"+r[l].counter,j.geometryGroups[p]===void 0&&(j.geometryGroups[p]={faces:[],materialIndex:q,vertices:0,numMorphTargets:t}),o=o instanceof THREE.Face3?3:4,j.geometryGroups[p].vertices+o>65535&&(r[l].counter+=1,p=r[l].hash+"_"+r[l].counter,j.geometryGroups[p]===void 0&&(j.geometryGroups[p]=
|
|
|
-{faces:[],materialIndex:q,vertices:0,numMorphTargets:t})),j.geometryGroups[p].faces.push(k),j.geometryGroups[p].vertices+=o;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=S++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer=d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=d.createBuffer();k.__webglUVBuffer=
|
|
|
-d.createBuffer();k.__webglUV2Buffer=d.createBuffer();k.__webglSkinVertexABuffer=d.createBuffer();k.__webglSkinVertexBBuffer=d.createBuffer();k.__webglSkinIndicesBuffer=d.createBuffer();k.__webglSkinWeightsBuffer=d.createBuffer();k.__webglFaceBuffer=d.createBuffer();k.__webglLineBuffer=d.createBuffer();if(k.numMorphTargets){q=m=void 0;k.__webglMorphTargetsBuffers=[];m=0;for(q=k.numMorphTargets;m<q;m++)k.__webglMorphTargetsBuffers.push(d.createBuffer())}G.info.memory.geometries++;for(var q=e,z=o=r=
|
|
|
-void 0,l=z=t=z=void 0,p=l=k=0,A=o=void 0,C=void 0,o=m=t=r=void 0,t=q.geometry,A=t.faces,C=j.faces,r=0,o=C.length;r<o;r++)z=C[r],z=A[z],z instanceof THREE.Face3?(k+=3,l+=1,p+=3):z instanceof THREE.Face4&&(k+=4,l+=2,p+=4);r=b(q,j);o=r.map||r.lightMap||r instanceof THREE.ShaderMaterial?!0:!1;C=r instanceof THREE.MeshBasicMaterial&&!r.envMap||r instanceof THREE.MeshDepthMaterial?!1:r&&r.shading!==void 0&&r.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;A=r.vertexColors?r.vertexColors:
|
|
|
-!1;j.__vertexArray=new Float32Array(k*3);if(C)j.__normalArray=new Float32Array(k*3);if(t.hasTangents)j.__tangentArray=new Float32Array(k*4);if(A)j.__colorArray=new Float32Array(k*3);if(o){if(t.faceUvs.length>0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(k*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(k*2)}if(q.geometry.skinWeights.length&&q.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(k*4),j.__skinVertexBArray=new Float32Array(k*4),
|
|
|
-j.__skinIndexArray=new Float32Array(k*4),j.__skinWeightArray=new Float32Array(k*4);j.__faceArray=new Uint16Array(l*3);j.__lineArray=new Uint16Array(p*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(z=j.numMorphTargets;t<z;t++)j.__morphTargetsArrays.push(new Float32Array(k*3))}j.__needsSmoothNormals=C===THREE.SmoothShading;j.__uvType=o;j.__vertexColorType=A;j.__normalType=C;j.__webglFaceCount=l*3;j.__webglLineCount=p*2;if(r.attributes){if(j.__webglCustomAttributesList===void 0)j.__webglCustomAttributesList=
|
|
|
-[];q=void 0;for(q in r.attributes){o=r.attributes[q];t={};for(m in o)t[m]=o[m];if(!t.__webglInitialized||t.createUniqueBuffers)t.__webglInitialized=!0,l=1,t.type==="v2"?l=2:t.type==="v3"?l=3:t.type==="v4"?l=4:t.type==="c"&&(l=3),t.size=l,t.array=new Float32Array(k*l),t.buffer=d.createBuffer(),t.buffer.belongsToAttribute=q,o.needsUpdate=!0,t.__original=o;j.__webglCustomAttributesList.push(t)}}j.__inittedArrays=!0;i.__dirtyVertices=!0;i.__dirtyMorphTargets=!0;i.__dirtyElements=!0;i.__dirtyUvs=!0;i.__dirtyNormals=
|
|
|
+"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapSoft?"#define SHADOWMAP_WIDTH "+c.shadowMapWidth.toFixed(1):"",c.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+c.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");d.attachShader(t,$("fragment",i+r));d.attachShader(t,
|
|
|
+$("vertex",e+o));d.linkProgram(t);d.getProgramParameter(t,d.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+d.getProgramParameter(t,d.VALIDATE_STATUS)+", gl error ["+d.getError()+"]");t.uniforms={};t.attributes={};var q,e=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(q in k)e.push(q);q=e;e=0;for(k=q.length;e<k;e++)r=q[e],t.uniforms[r]=d.getUniformLocation(t,
|
|
|
+r);e=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(q=0;q<c.maxMorphTargets;q++)e.push("morphTarget"+q);for(l in b)e.push(l);l=e;q=0;for(b=l.length;q<b;q++)c=l[q],t.attributes[c]=d.getAttribLocation(t,c);t.id=ta.length;ta.push({program:t,code:j});G.info.memory.programs=ta.length;l=t}a.program=l;l=a.program.attributes;l.position>=0&&d.enableVertexAttribArray(l.position);l.color>=0&&d.enableVertexAttribArray(l.color);l.normal>=0&&d.enableVertexAttribArray(l.normal);
|
|
|
+l.tangent>=0&&d.enableVertexAttribArray(l.tangent);a.skinning&&l.skinVertexA>=0&&l.skinVertexB>=0&&l.skinIndex>=0&&l.skinWeight>=0&&(d.enableVertexAttribArray(l.skinVertexA),d.enableVertexAttribArray(l.skinVertexB),d.enableVertexAttribArray(l.skinIndex),d.enableVertexAttribArray(l.skinWeight));if(a.attributes)for(h in a.attributes)l[h]!==void 0&&l[h]>=0&&d.enableVertexAttribArray(l[h]);if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h<this.maxMorphTargets;h++)q="morphTarget"+h,l[q]>=0&&(d.enableVertexAttribArray(l[q]),
|
|
|
+a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.clearTarget=function(a,b,c,d){U(a);this.clear(b,c,d)};this.updateShadowMap=function(a,b){C(a,b)};this.render=function(a,b,c,q){var Ia,K,Ea,u,v,r,z,Pa=a.lights,Qa=a.fog;J=-1;this.shadowMapEnabled&&this.shadowMapAutoUpdate&&C(a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;if(b.matrixAutoUpdate){for(Ea=b;Ea.parent;)Ea=Ea.parent;Ea.update(void 0,!0)}a.update(void 0,
|
|
|
+!1,b);b.matrixWorldInverse.flattenToArray(Ua);b.projectionMatrix.flattenToArray(Ta);Da.multiply(b.projectionMatrix,b.matrixWorldInverse);m(Da);this.initWebGLObjects(a);U(c);(this.autoClear||q)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);Ea=a.__webglObjects.length;for(q=0;q<Ea;q++)if(v=a.__webglObjects[q],r=v.object,r.visible)if(!(r instanceof THREE.Mesh)||!r.frustumCulled||p(r)){if(r.matrixWorld.flattenToArray(r._objectMatrixArray),B(r,b,!0),t(v),v.render=!0,this.sortObjects)v.object.renderDepth?
|
|
|
+v.z=v.object.renderDepth:(Ja.copy(r.position),Da.multiplyVector3(Ja),v.z=Ja.z)}else v.render=!1;else v.render=!1;this.sortObjects&&a.__webglObjects.sort(A);u=a.__webglObjectsImmediate.length;for(q=0;q<u;q++)v=a.__webglObjectsImmediate[q],r=v.object,r.visible&&(r.matrixAutoUpdate&&r.matrixWorld.flattenToArray(r._objectMatrixArray),B(r,b,!0),l(v));if(a.overrideMaterial){j(a.overrideMaterial.depthTest);N(a.overrideMaterial.blending);for(q=0;q<Ea;q++)if(v=a.__webglObjects[q],v.render)r=v.object,z=v.buffer,
|
|
|
+i(r),f(b,Pa,Qa,a.overrideMaterial,z,r);for(q=0;q<u;q++)v=a.__webglObjectsImmediate[q],r=v.object,r.visible&&(R=-1,i(r),Ia=e(b,Pa,Qa,a.overrideMaterial,r),r.immediateRenderCallback?r.immediateRenderCallback(Ia,d,ha):r.render(function(b){h(b,Ia,a.overrideMaterial.shading)}))}else{N(THREE.NormalBlending);for(q=Ea-1;q>=0;q--)if(v=a.__webglObjects[q],v.render&&(r=v.object,z=v.buffer,K=v.opaque))i(r),j(K.depthTest),o(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),f(b,Pa,Qa,
|
|
|
+K,z,r);for(q=0;q<u;q++)if(v=a.__webglObjectsImmediate[q],r=v.object,r.visible&&(R=-1,K=v.opaque))i(r),j(K.depthTest),o(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),Ia=e(b,Pa,Qa,K,r),r.immediateRenderCallback?r.immediateRenderCallback(Ia,d,ha):r.render(function(a){h(a,Ia,K.shading)});for(q=0;q<Ea;q++)if(v=a.__webglObjects[q],v.render&&(r=v.object,z=v.buffer,K=v.transparent))i(r),N(K.blending),j(K.depthTest),o(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),
|
|
|
+f(b,Pa,Qa,K,z,r);for(q=0;q<u;q++)if(v=a.__webglObjectsImmediate[q],r=v.object,r.visible&&(R=-1,K=v.transparent))i(r),N(K.blending),j(K.depthTest),o(K.depthWrite),k(K.polygonOffset,K.polygonOffsetFactor,K.polygonOffsetUnits),Ia=e(b,Pa,Qa,K,r),r.immediateRenderCallback?r.immediateRenderCallback(Ia,d,ha):r.render(function(a){h(a,Ia,K.shading)})}a.__webglSprites.length&&E(a,b);c&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&ja(c)};this.initWebGLObjects=function(a){if(!a.__webglObjects)a.__webglObjects=
|
|
|
+[],a.__webglObjectsImmediate=[],a.__webglSprites=[];for(;a.__objectsAdded.length;){var e=a.__objectsAdded[0],f=a,h=void 0,i=void 0,j=void 0;if(!e.__webglInit)if(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrixArray=new Float32Array(9),e._modelViewMatrixArray=new Float32Array(16),e._objectMatrixArray=new Float32Array(16),e.matrixWorld.flattenToArray(e._objectMatrixArray),e instanceof THREE.Mesh){i=e.geometry;if(i.geometryGroups===void 0){var j=i,k=void 0,o=void 0,m=void 0,r=void 0,
|
|
|
+l=m=void 0,p=void 0,q={},t=j.morphTargets.length;j.geometryGroups={};k=0;for(o=j.faces.length;k<o;k++)m=j.faces[k],r=m.materialIndex,l=r!==void 0?r:-1,q[l]===void 0&&(q[l]={hash:l,counter:0}),p=q[l].hash+"_"+q[l].counter,j.geometryGroups[p]===void 0&&(j.geometryGroups[p]={faces:[],materialIndex:r,vertices:0,numMorphTargets:t}),m=m instanceof THREE.Face3?3:4,j.geometryGroups[p].vertices+m>65535&&(q[l].counter+=1,p=q[l].hash+"_"+q[l].counter,j.geometryGroups[p]===void 0&&(j.geometryGroups[p]={faces:[],
|
|
|
+materialIndex:r,vertices:0,numMorphTargets:t})),j.geometryGroups[p].faces.push(k),j.geometryGroups[p].vertices+=m;j.geometryGroupsList=[];k=void 0;for(k in j.geometryGroups)j.geometryGroups[k].id=S++,j.geometryGroupsList.push(j.geometryGroups[k])}for(h in i.geometryGroups)if(j=i.geometryGroups[h],!j.__webglVertexBuffer){k=j;k.__webglVertexBuffer=d.createBuffer();k.__webglNormalBuffer=d.createBuffer();k.__webglTangentBuffer=d.createBuffer();k.__webglColorBuffer=d.createBuffer();k.__webglUVBuffer=d.createBuffer();
|
|
|
+k.__webglUV2Buffer=d.createBuffer();k.__webglSkinVertexABuffer=d.createBuffer();k.__webglSkinVertexBBuffer=d.createBuffer();k.__webglSkinIndicesBuffer=d.createBuffer();k.__webglSkinWeightsBuffer=d.createBuffer();k.__webglFaceBuffer=d.createBuffer();k.__webglLineBuffer=d.createBuffer();if(k.numMorphTargets){r=o=void 0;k.__webglMorphTargetsBuffers=[];o=0;for(r=k.numMorphTargets;o<r;o++)k.__webglMorphTargetsBuffers.push(d.createBuffer())}G.info.memory.geometries++;for(var r=e,z=m=q=void 0,l=z=t=z=void 0,
|
|
|
+p=l=k=0,A=m=void 0,C=void 0,m=o=t=q=void 0,t=r.geometry,A=t.faces,C=j.faces,q=0,m=C.length;q<m;q++)z=C[q],z=A[z],z instanceof THREE.Face3?(k+=3,l+=1,p+=3):z instanceof THREE.Face4&&(k+=4,l+=2,p+=4);q=b(r,j);m=q.map||q.lightMap||q instanceof THREE.ShaderMaterial?!0:!1;C=q instanceof THREE.MeshBasicMaterial&&!q.envMap||q instanceof THREE.MeshDepthMaterial?!1:q&&q.shading!==void 0&&q.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;A=q.vertexColors?q.vertexColors:!1;j.__vertexArray=
|
|
|
+new Float32Array(k*3);if(C)j.__normalArray=new Float32Array(k*3);if(t.hasTangents)j.__tangentArray=new Float32Array(k*4);if(A)j.__colorArray=new Float32Array(k*3);if(m){if(t.faceUvs.length>0||t.faceVertexUvs.length>0)j.__uvArray=new Float32Array(k*2);if(t.faceUvs.length>1||t.faceVertexUvs.length>1)j.__uv2Array=new Float32Array(k*2)}if(r.geometry.skinWeights.length&&r.geometry.skinIndices.length)j.__skinVertexAArray=new Float32Array(k*4),j.__skinVertexBArray=new Float32Array(k*4),j.__skinIndexArray=
|
|
|
+new Float32Array(k*4),j.__skinWeightArray=new Float32Array(k*4);j.__faceArray=new Uint16Array(l*3);j.__lineArray=new Uint16Array(p*2);if(j.numMorphTargets){j.__morphTargetsArrays=[];t=0;for(z=j.numMorphTargets;t<z;t++)j.__morphTargetsArrays.push(new Float32Array(k*3))}j.__needsSmoothNormals=C===THREE.SmoothShading;j.__uvType=m;j.__vertexColorType=A;j.__normalType=C;j.__webglFaceCount=l*3;j.__webglLineCount=p*2;if(q.attributes){if(j.__webglCustomAttributesList===void 0)j.__webglCustomAttributesList=
|
|
|
+[];r=void 0;for(r in q.attributes){m=q.attributes[r];t={};for(o in m)t[o]=m[o];if(!t.__webglInitialized||t.createUniqueBuffers)t.__webglInitialized=!0,l=1,t.type==="v2"?l=2:t.type==="v3"?l=3:t.type==="v4"?l=4:t.type==="c"&&(l=3),t.size=l,t.array=new Float32Array(k*l),t.buffer=d.createBuffer(),t.buffer.belongsToAttribute=r,m.needsUpdate=!0,t.__original=m;j.__webglCustomAttributesList.push(t)}}j.__inittedArrays=!0;i.__dirtyVertices=!0;i.__dirtyMorphTargets=!0;i.__dirtyElements=!0;i.__dirtyUvs=!0;i.__dirtyNormals=
|
|
|
!0;i.__dirtyTangents=!0;i.__dirtyColors=!0}}else if(e instanceof THREE.Ribbon){if(i=e.geometry,!i.__webglVertexBuffer)j=i,j.__webglVertexBuffer=d.createBuffer(),j.__webglColorBuffer=d.createBuffer(),G.info.memory.geometries++,j=i,k=j.vertices.length,j.__vertexArray=new Float32Array(k*3),j.__colorArray=new Float32Array(k*3),j.__webglVertexCount=k,i.__dirtyVertices=!0,i.__dirtyColors=!0}else if(e instanceof THREE.Line){if(i=e.geometry,!i.__webglVertexBuffer)j=i,j.__webglVertexBuffer=d.createBuffer(),
|
|
|
-j.__webglColorBuffer=d.createBuffer(),G.info.memory.geometries++,j=i,k=j.vertices.length,j.__vertexArray=new Float32Array(k*3),j.__colorArray=new Float32Array(k*3),j.__webglLineCount=k,i.__dirtyVertices=!0,i.__dirtyColors=!0}else if(e instanceof THREE.ParticleSystem&&(i=e.geometry,!i.__webglVertexBuffer)){j=i;j.__webglVertexBuffer=d.createBuffer();j.__webglColorBuffer=d.createBuffer();G.info.geometries++;j=i;m=e;k=j.vertices.length;j.__vertexArray=new Float32Array(k*3);j.__colorArray=new Float32Array(k*
|
|
|
-3);j.__sortArray=[];j.__webglParticleCount=k;m=m.material;if(m.attributes){if(j.__webglCustomAttributesList===void 0)j.__webglCustomAttributesList=[];q=void 0;for(q in m.attributes){originalAttribute=m.attributes[q];attribute={};for(property in originalAttribute)attribute[property]=originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=!0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=4:
|
|
|
-attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(k*size),attribute.buffer=d.createBuffer(),attribute.buffer.belongsToAttribute=q,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;j.__webglCustomAttributesList.push(attribute)}}i.__dirtyVertices=!0;i.__dirtyColors=!0}if(!e.__webglActive){if(e instanceof THREE.Mesh)for(h in i=e.geometry,i.geometryGroups)j=i.geometryGroups[h],qa(f.__webglObjects,j,e);else e instanceof THREE.Ribbon||e instanceof
|
|
|
+j.__webglColorBuffer=d.createBuffer(),G.info.memory.geometries++,j=i,k=j.vertices.length,j.__vertexArray=new Float32Array(k*3),j.__colorArray=new Float32Array(k*3),j.__webglLineCount=k,i.__dirtyVertices=!0,i.__dirtyColors=!0}else if(e instanceof THREE.ParticleSystem&&(i=e.geometry,!i.__webglVertexBuffer)){j=i;j.__webglVertexBuffer=d.createBuffer();j.__webglColorBuffer=d.createBuffer();G.info.geometries++;j=i;o=e;k=j.vertices.length;j.__vertexArray=new Float32Array(k*3);j.__colorArray=new Float32Array(k*
|
|
|
+3);j.__sortArray=[];j.__webglParticleCount=k;o=o.material;if(o.attributes){if(j.__webglCustomAttributesList===void 0)j.__webglCustomAttributesList=[];r=void 0;for(r in o.attributes){originalAttribute=o.attributes[r];attribute={};for(property in originalAttribute)attribute[property]=originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=!0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=4:
|
|
|
+attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(k*size),attribute.buffer=d.createBuffer(),attribute.buffer.belongsToAttribute=r,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;j.__webglCustomAttributesList.push(attribute)}}i.__dirtyVertices=!0;i.__dirtyColors=!0}if(!e.__webglActive){if(e instanceof THREE.Mesh)for(h in i=e.geometry,i.geometryGroups)j=i.geometryGroups[h],qa(f.__webglObjects,j,e);else e instanceof THREE.Ribbon||e instanceof
|
|
|
THREE.Line||e instanceof THREE.ParticleSystem?(i=e.geometry,qa(f.__webglObjects,i,e)):THREE.MarchingCubes!==void 0&&e instanceof THREE.MarchingCubes||e.immediateRenderCallback?f.__webglObjectsImmediate.push({object:e,opaque:null,transparent:null}):e instanceof THREE.Sprite&&f.__webglSprites.push(e);e.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;){e=a.__objectsRemoved[0];f=a;if(e instanceof THREE.Mesh||e instanceof THREE.ParticleSystem||e instanceof THREE.Ribbon||e instanceof
|
|
|
-THREE.Line)pa(f.__webglObjects,e);else if(e instanceof THREE.Sprite){f=f.__webglSprites;h=e;i=void 0;for(i=f.length-1;i>=0;i--)f[i]===h&&f.splice(i,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&pa(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e<f;e++)if(i=a.__webglObjects[e].object,q=j=h=void 0,i instanceof THREE.Mesh){h=i.geometry;k=0;for(m=h.geometryGroupsList.length;k<m;k++)if(j=h.geometryGroupsList[k],q=
|
|
|
-va(j,i),h.__dirtyVertices||h.__dirtyMorphTargets||h.__dirtyElements||h.__dirtyUvs||h.__dirtyNormals||h.__dirtyColors||h.__dirtyTangents||q)if(q=j,l=d.DYNAMIC_DRAW,p=!h.dynamic,q.__inittedArrays){var B=t=r=void 0,y=void 0,E=B=void 0,F=void 0,N=void 0,O=void 0,U=z=C=A=o=void 0,H=void 0,L=void 0,M=void 0,I=void 0,w=y=O=y=N=F=void 0,D=void 0,s=D=w=F=void 0,n=void 0,s=D=w=B=B=E=D=w=y=s=D=w=n=s=D=w=n=s=D=w=void 0,ia=0,J=0,X=0,$=0,T=0,Q=0,Z=0,R=0,la=0,x=0,ma=0,V=s=0,V=void 0,na=q.__vertexArray,ja=q.__uvArray,
|
|
|
-ka=q.__uv2Array,W=q.__normalArray,ca=q.__tangentArray,oa=q.__colorArray,da=q.__skinVertexAArray,ea=q.__skinVertexBArray,fa=q.__skinIndexArray,ga=q.__skinWeightArray,ra=q.__morphTargetsArrays,aa=q.__webglCustomAttributesList,n=void 0,ha=q.__faceArray,Y=q.__lineArray,xa=q.__needsSmoothNormals,A=q.__vertexColorType,o=q.__uvType,C=q.__normalType,sa=i.geometry,ua=sa.__dirtyVertices,ya=sa.__dirtyElements,ta=sa.__dirtyUvs,za=sa.__dirtyNormals,Aa=sa.__dirtyTangents,Ca=sa.__dirtyColors,Da=sa.__dirtyMorphTargets,
|
|
|
-Ba=sa.vertices,Fa=q.faces,La=sa.faces,Ha=sa.faceVertexUvs[0],Ja=sa.faceVertexUvs[1],Ma=sa.skinVerticesA,Na=sa.skinVerticesB,Oa=sa.skinIndices,Ka=sa.skinWeights,Ga=sa.morphTargets;if(aa){w=0;for(D=aa.length;w<D;w++)aa[w].offset=0,aa[w].offsetSrc=0}r=0;for(t=Fa.length;r<t;r++)if(B=Fa[r],y=La[B],Ha&&(z=Ha[B]),Ja&&(U=Ja[B]),B=y.vertexNormals,E=y.normal,F=y.vertexColors,N=y.color,O=y.vertexTangents,y instanceof THREE.Face3){if(ua)H=Ba[y.a].position,L=Ba[y.b].position,M=Ba[y.c].position,na[J]=H.x,na[J+
|
|
|
+THREE.Line)pa(f.__webglObjects,e);else if(e instanceof THREE.Sprite){f=f.__webglSprites;h=e;for(i=f.length-1;i>=0;i--)f[i]===h&&f.splice(i,1)}else(e instanceof THREE.MarchingCubes||e.immediateRenderCallback)&&pa(f.__webglObjectsImmediate,e);e.__webglActive=!1;a.__objectsRemoved.splice(0,1)}e=0;for(f=a.__webglObjects.length;e<f;e++)if(i=a.__webglObjects[e].object,h=i.geometry,j=l=r=void 0,i instanceof THREE.Mesh){k=0;for(o=h.geometryGroupsList.length;k<o;k++)if(r=h.geometryGroupsList[k],j=b(i,r),l=
|
|
|
+j.attributes&&va(j),h.__dirtyVertices||h.__dirtyMorphTargets||h.__dirtyElements||h.__dirtyUvs||h.__dirtyNormals||h.__dirtyColors||h.__dirtyTangents||l)if(l=d.DYNAMIC_DRAW,p=!h.dynamic,r.__inittedArrays){var B=t=q=void 0,y=void 0,E=B=void 0,F=void 0,N=void 0,O=void 0,U=z=C=A=m=void 0,H=void 0,L=void 0,M=void 0,I=void 0,w=y=O=y=N=F=void 0,D=void 0,s=D=w=F=void 0,n=void 0,s=D=w=B=B=E=D=w=y=s=D=w=n=s=D=w=n=s=D=w=void 0,ia=0,J=0,X=0,$=0,T=0,Q=0,Z=0,R=0,la=0,x=0,ma=0,V=s=0,V=void 0,na=r.__vertexArray,ja=
|
|
|
+r.__uvArray,ka=r.__uv2Array,W=r.__normalArray,ca=r.__tangentArray,oa=r.__colorArray,da=r.__skinVertexAArray,ea=r.__skinVertexBArray,fa=r.__skinIndexArray,ga=r.__skinWeightArray,ra=r.__morphTargetsArrays,aa=r.__webglCustomAttributesList,n=void 0,ha=r.__faceArray,Y=r.__lineArray,xa=r.__needsSmoothNormals,A=r.__vertexColorType,m=r.__uvType,C=r.__normalType,sa=i.geometry,ua=sa.__dirtyVertices,ya=sa.__dirtyElements,ta=sa.__dirtyUvs,za=sa.__dirtyNormals,Aa=sa.__dirtyTangents,Ca=sa.__dirtyColors,Da=sa.__dirtyMorphTargets,
|
|
|
+Ba=sa.vertices,Fa=r.faces,La=sa.faces,Ha=sa.faceVertexUvs[0],Ja=sa.faceVertexUvs[1],Ma=sa.skinVerticesA,Na=sa.skinVerticesB,Oa=sa.skinIndices,Ka=sa.skinWeights,Ga=sa.morphTargets;if(aa){w=0;for(D=aa.length;w<D;w++)aa[w].offset=0,aa[w].offsetSrc=0}q=0;for(t=Fa.length;q<t;q++)if(B=Fa[q],y=La[B],Ha&&(z=Ha[B]),Ja&&(U=Ja[B]),B=y.vertexNormals,E=y.normal,F=y.vertexColors,N=y.color,O=y.vertexTangents,y instanceof THREE.Face3){if(ua)H=Ba[y.a].position,L=Ba[y.b].position,M=Ba[y.c].position,na[J]=H.x,na[J+
|
|
|
1]=H.y,na[J+2]=H.z,na[J+3]=L.x,na[J+4]=L.y,na[J+5]=L.z,na[J+6]=M.x,na[J+7]=M.y,na[J+8]=M.z,J+=9;if(aa){w=0;for(D=aa.length;w<D;w++)if(n=aa[w],n.__original.needsUpdate)s=n.offset,V=n.offsetSrc,n.size===1?(n.boundTo===void 0||n.boundTo==="vertices"?(n.array[s]=n.value[y.a],n.array[s+1]=n.value[y.b],n.array[s+2]=n.value[y.c]):n.boundTo==="faces"?(V=n.value[V],n.array[s]=V,n.array[s+1]=V,n.array[s+2]=V,n.offsetSrc++):n.boundTo==="faceVertices"&&(n.array[s]=n.value[V],n.array[s+1]=n.value[V+1],n.array[s+
|
|
|
2]=n.value[V+2],n.offsetSrc+=3),n.offset+=3):(n.boundTo===void 0||n.boundTo==="vertices"?(H=n.value[y.a],L=n.value[y.b],M=n.value[y.c]):n.boundTo==="faces"?(M=L=H=V=n.value[V],n.offsetSrc++):n.boundTo==="faceVertices"&&(H=n.value[V],L=n.value[V+1],M=n.value[V+2],n.offsetSrc+=3),n.size===2?(n.array[s]=H.x,n.array[s+1]=H.y,n.array[s+2]=L.x,n.array[s+3]=L.y,n.array[s+4]=M.x,n.array[s+5]=M.y,n.offset+=6):n.size===3?(n.type==="c"?(n.array[s]=H.r,n.array[s+1]=H.g,n.array[s+2]=H.b,n.array[s+3]=L.r,n.array[s+
|
|
|
4]=L.g,n.array[s+5]=L.b,n.array[s+6]=M.r,n.array[s+7]=M.g,n.array[s+8]=M.b):(n.array[s]=H.x,n.array[s+1]=H.y,n.array[s+2]=H.z,n.array[s+3]=L.x,n.array[s+4]=L.y,n.array[s+5]=L.z,n.array[s+6]=M.x,n.array[s+7]=M.y,n.array[s+8]=M.z),n.offset+=9):(n.array[s]=H.x,n.array[s+1]=H.y,n.array[s+2]=H.z,n.array[s+3]=H.w,n.array[s+4]=L.x,n.array[s+5]=L.y,n.array[s+6]=L.z,n.array[s+7]=L.w,n.array[s+8]=M.x,n.array[s+9]=M.y,n.array[s+10]=M.z,n.array[s+11]=M.w,n.offset+=12))}if(Da){w=0;for(D=Ga.length;w<D;w++)H=Ga[w].vertices[y.a].position,
|
|
|
L=Ga[w].vertices[y.b].position,M=Ga[w].vertices[y.c].position,s=ra[w],s[ma]=H.x,s[ma+1]=H.y,s[ma+2]=H.z,s[ma+3]=L.x,s[ma+4]=L.y,s[ma+5]=L.z,s[ma+6]=M.x,s[ma+7]=M.y,s[ma+8]=M.z;ma+=9}if(Ka.length)w=Ka[y.a],D=Ka[y.b],s=Ka[y.c],ga[x]=w.x,ga[x+1]=w.y,ga[x+2]=w.z,ga[x+3]=w.w,ga[x+4]=D.x,ga[x+5]=D.y,ga[x+6]=D.z,ga[x+7]=D.w,ga[x+8]=s.x,ga[x+9]=s.y,ga[x+10]=s.z,ga[x+11]=s.w,w=Oa[y.a],D=Oa[y.b],s=Oa[y.c],fa[x]=w.x,fa[x+1]=w.y,fa[x+2]=w.z,fa[x+3]=w.w,fa[x+4]=D.x,fa[x+5]=D.y,fa[x+6]=D.z,fa[x+7]=D.w,fa[x+8]=
|
|
|
s.x,fa[x+9]=s.y,fa[x+10]=s.z,fa[x+11]=s.w,w=Ma[y.a],D=Ma[y.b],s=Ma[y.c],da[x]=w.x,da[x+1]=w.y,da[x+2]=w.z,da[x+3]=1,da[x+4]=D.x,da[x+5]=D.y,da[x+6]=D.z,da[x+7]=1,da[x+8]=s.x,da[x+9]=s.y,da[x+10]=s.z,da[x+11]=1,w=Na[y.a],D=Na[y.b],s=Na[y.c],ea[x]=w.x,ea[x+1]=w.y,ea[x+2]=w.z,ea[x+3]=1,ea[x+4]=D.x,ea[x+5]=D.y,ea[x+6]=D.z,ea[x+7]=1,ea[x+8]=s.x,ea[x+9]=s.y,ea[x+10]=s.z,ea[x+11]=1,x+=12;if(Ca&&A)F.length===3&&A===THREE.VertexColors?(y=F[0],w=F[1],D=F[2]):D=w=y=N,oa[la]=y.r,oa[la+1]=y.g,oa[la+2]=y.b,oa[la+
|
|
|
-3]=w.r,oa[la+4]=w.g,oa[la+5]=w.b,oa[la+6]=D.r,oa[la+7]=D.g,oa[la+8]=D.b,la+=9;if(Aa&&sa.hasTangents)F=O[0],N=O[1],y=O[2],ca[Z]=F.x,ca[Z+1]=F.y,ca[Z+2]=F.z,ca[Z+3]=F.w,ca[Z+4]=N.x,ca[Z+5]=N.y,ca[Z+6]=N.z,ca[Z+7]=N.w,ca[Z+8]=y.x,ca[Z+9]=y.y,ca[Z+10]=y.z,ca[Z+11]=y.w,Z+=12;if(za&&C)if(B.length===3&&xa)for(w=0;w<3;w++)E=B[w],W[Q]=E.x,W[Q+1]=E.y,W[Q+2]=E.z,Q+=3;else for(w=0;w<3;w++)W[Q]=E.x,W[Q+1]=E.y,W[Q+2]=E.z,Q+=3;if(ta&&z!==void 0&&o)for(w=0;w<3;w++)B=z[w],ja[X]=B.u,ja[X+1]=B.v,X+=2;if(ta&&U!==void 0&&
|
|
|
-o)for(w=0;w<3;w++)B=U[w],ka[$]=B.u,ka[$+1]=B.v,$+=2;ya&&(ha[T]=ia,ha[T+1]=ia+1,ha[T+2]=ia+2,T+=3,Y[R]=ia,Y[R+1]=ia+1,Y[R+2]=ia,Y[R+3]=ia+2,Y[R+4]=ia+1,Y[R+5]=ia+2,R+=6,ia+=3)}else if(y instanceof THREE.Face4){if(ua)H=Ba[y.a].position,L=Ba[y.b].position,M=Ba[y.c].position,I=Ba[y.d].position,na[J]=H.x,na[J+1]=H.y,na[J+2]=H.z,na[J+3]=L.x,na[J+4]=L.y,na[J+5]=L.z,na[J+6]=M.x,na[J+7]=M.y,na[J+8]=M.z,na[J+9]=I.x,na[J+10]=I.y,na[J+11]=I.z,J+=12;if(aa){w=0;for(D=aa.length;w<D;w++)if(n=aa[w],n.__original.needsUpdate)s=
|
|
|
+3]=w.r,oa[la+4]=w.g,oa[la+5]=w.b,oa[la+6]=D.r,oa[la+7]=D.g,oa[la+8]=D.b,la+=9;if(Aa&&sa.hasTangents)F=O[0],N=O[1],y=O[2],ca[Z]=F.x,ca[Z+1]=F.y,ca[Z+2]=F.z,ca[Z+3]=F.w,ca[Z+4]=N.x,ca[Z+5]=N.y,ca[Z+6]=N.z,ca[Z+7]=N.w,ca[Z+8]=y.x,ca[Z+9]=y.y,ca[Z+10]=y.z,ca[Z+11]=y.w,Z+=12;if(za&&C)if(B.length===3&&xa)for(w=0;w<3;w++)E=B[w],W[Q]=E.x,W[Q+1]=E.y,W[Q+2]=E.z,Q+=3;else for(w=0;w<3;w++)W[Q]=E.x,W[Q+1]=E.y,W[Q+2]=E.z,Q+=3;if(ta&&z!==void 0&&m)for(w=0;w<3;w++)B=z[w],ja[X]=B.u,ja[X+1]=B.v,X+=2;if(ta&&U!==void 0&&
|
|
|
+m)for(w=0;w<3;w++)B=U[w],ka[$]=B.u,ka[$+1]=B.v,$+=2;ya&&(ha[T]=ia,ha[T+1]=ia+1,ha[T+2]=ia+2,T+=3,Y[R]=ia,Y[R+1]=ia+1,Y[R+2]=ia,Y[R+3]=ia+2,Y[R+4]=ia+1,Y[R+5]=ia+2,R+=6,ia+=3)}else if(y instanceof THREE.Face4){if(ua)H=Ba[y.a].position,L=Ba[y.b].position,M=Ba[y.c].position,I=Ba[y.d].position,na[J]=H.x,na[J+1]=H.y,na[J+2]=H.z,na[J+3]=L.x,na[J+4]=L.y,na[J+5]=L.z,na[J+6]=M.x,na[J+7]=M.y,na[J+8]=M.z,na[J+9]=I.x,na[J+10]=I.y,na[J+11]=I.z,J+=12;if(aa){w=0;for(D=aa.length;w<D;w++)if(n=aa[w],n.__original.needsUpdate)s=
|
|
|
n.offset,V=n.offsetSrc,n.size===1?(n.boundTo===void 0||n.boundTo==="vertices"?(n.array[s]=n.value[y.a],n.array[s+1]=n.value[y.b],n.array[s+2]=n.value[y.c],n.array[s+3]=n.value[y.d]):n.boundTo==="faces"?(V=n.value[V],n.array[s]=V,n.array[s+1]=V,n.array[s+2]=V,n.array[s+3]=V,n.offsetSrc++):n.boundTo==="faceVertices"&&(n.array[s]=n.value[V],n.array[s+1]=n.value[V+1],n.array[s+2]=n.value[V+2],n.array[s+3]=n.value[V+3],n.offsetSrc+=4),n.offset+=4):(n.boundTo===void 0||n.boundTo==="vertices"?(H=n.value[y.a],
|
|
|
L=n.value[y.b],M=n.value[y.c],I=n.value[y.d]):n.boundTo==="faces"?(I=M=L=H=V=n.value[V],n.offsetSrc++):n.boundTo==="faceVertices"&&(H=n.value[V],L=n.value[V+1],M=n.value[V+2],I=n.value[V+3],n.offsetSrc+=4),n.size===2?(n.array[s]=H.x,n.array[s+1]=H.y,n.array[s+2]=L.x,n.array[s+3]=L.y,n.array[s+4]=M.x,n.array[s+5]=M.y,n.array[s+6]=I.x,n.array[s+7]=I.y,n.offset+=8):n.size===3?(n.type==="c"?(n.array[s]=H.r,n.array[s+1]=H.g,n.array[s+2]=H.b,n.array[s+3]=L.r,n.array[s+4]=L.g,n.array[s+5]=L.b,n.array[s+
|
|
|
6]=M.r,n.array[s+7]=M.g,n.array[s+8]=M.b,n.array[s+9]=I.r,n.array[s+10]=I.g,n.array[s+11]=I.b):(n.array[s]=H.x,n.array[s+1]=H.y,n.array[s+2]=H.z,n.array[s+3]=L.x,n.array[s+4]=L.y,n.array[s+5]=L.z,n.array[s+6]=M.x,n.array[s+7]=M.y,n.array[s+8]=M.z,n.array[s+9]=I.x,n.array[s+10]=I.y,n.array[s+11]=I.z),n.offset+=12):(n.array[s]=H.x,n.array[s+1]=H.y,n.array[s+2]=H.z,n.array[s+3]=H.w,n.array[s+4]=L.x,n.array[s+5]=L.y,n.array[s+6]=L.z,n.array[s+7]=L.w,n.array[s+8]=M.x,n.array[s+9]=M.y,n.array[s+10]=M.z,
|
|
@@ -287,14 +287,14 @@ n.array[s+11]=M.w,n.array[s+12]=I.x,n.array[s+13]=I.y,n.array[s+14]=I.z,n.array[
|
|
|
2]=w.z,ga[x+3]=w.w,ga[x+4]=D.x,ga[x+5]=D.y,ga[x+6]=D.z,ga[x+7]=D.w,ga[x+8]=s.x,ga[x+9]=s.y,ga[x+10]=s.z,ga[x+11]=s.w,ga[x+12]=n.x,ga[x+13]=n.y,ga[x+14]=n.z,ga[x+15]=n.w,w=Oa[y.a],D=Oa[y.b],s=Oa[y.c],n=Oa[y.d],fa[x]=w.x,fa[x+1]=w.y,fa[x+2]=w.z,fa[x+3]=w.w,fa[x+4]=D.x,fa[x+5]=D.y,fa[x+6]=D.z,fa[x+7]=D.w,fa[x+8]=s.x,fa[x+9]=s.y,fa[x+10]=s.z,fa[x+11]=s.w,fa[x+12]=n.x,fa[x+13]=n.y,fa[x+14]=n.z,fa[x+15]=n.w,w=Ma[y.a],D=Ma[y.b],s=Ma[y.c],n=Ma[y.d],da[x]=w.x,da[x+1]=w.y,da[x+2]=w.z,da[x+3]=1,da[x+4]=D.x,
|
|
|
da[x+5]=D.y,da[x+6]=D.z,da[x+7]=1,da[x+8]=s.x,da[x+9]=s.y,da[x+10]=s.z,da[x+11]=1,da[x+12]=n.x,da[x+13]=n.y,da[x+14]=n.z,da[x+15]=1,w=Na[y.a],D=Na[y.b],s=Na[y.c],y=Na[y.d],ea[x]=w.x,ea[x+1]=w.y,ea[x+2]=w.z,ea[x+3]=1,ea[x+4]=D.x,ea[x+5]=D.y,ea[x+6]=D.z,ea[x+7]=1,ea[x+8]=s.x,ea[x+9]=s.y,ea[x+10]=s.z,ea[x+11]=1,ea[x+12]=y.x,ea[x+13]=y.y,ea[x+14]=y.z,ea[x+15]=1,x+=16;if(Ca&&A)F.length===4&&A===THREE.VertexColors?(y=F[0],w=F[1],D=F[2],F=F[3]):F=D=w=y=N,oa[la]=y.r,oa[la+1]=y.g,oa[la+2]=y.b,oa[la+3]=w.r,
|
|
|
oa[la+4]=w.g,oa[la+5]=w.b,oa[la+6]=D.r,oa[la+7]=D.g,oa[la+8]=D.b,oa[la+9]=F.r,oa[la+10]=F.g,oa[la+11]=F.b,la+=12;if(Aa&&sa.hasTangents)F=O[0],N=O[1],y=O[2],O=O[3],ca[Z]=F.x,ca[Z+1]=F.y,ca[Z+2]=F.z,ca[Z+3]=F.w,ca[Z+4]=N.x,ca[Z+5]=N.y,ca[Z+6]=N.z,ca[Z+7]=N.w,ca[Z+8]=y.x,ca[Z+9]=y.y,ca[Z+10]=y.z,ca[Z+11]=y.w,ca[Z+12]=O.x,ca[Z+13]=O.y,ca[Z+14]=O.z,ca[Z+15]=O.w,Z+=16;if(za&&C)if(B.length===4&&xa)for(w=0;w<4;w++)E=B[w],W[Q]=E.x,W[Q+1]=E.y,W[Q+2]=E.z,Q+=3;else for(w=0;w<4;w++)W[Q]=E.x,W[Q+1]=E.y,W[Q+2]=
|
|
|
-E.z,Q+=3;if(ta&&z!==void 0&&o)for(w=0;w<4;w++)B=z[w],ja[X]=B.u,ja[X+1]=B.v,X+=2;if(ta&&U!==void 0&&o)for(w=0;w<4;w++)B=U[w],ka[$]=B.u,ka[$+1]=B.v,$+=2;ya&&(ha[T]=ia,ha[T+1]=ia+1,ha[T+2]=ia+3,ha[T+3]=ia+1,ha[T+4]=ia+2,ha[T+5]=ia+3,T+=6,Y[R]=ia,Y[R+1]=ia+1,Y[R+2]=ia,Y[R+3]=ia+3,Y[R+4]=ia+1,Y[R+5]=ia+2,Y[R+6]=ia+2,Y[R+7]=ia+3,R+=8,ia+=4)}ua&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,na,l));if(aa){w=0;for(D=aa.length;w<D;w++)n=aa[w],n.__original.needsUpdate&&(d.bindBuffer(d.ARRAY_BUFFER,
|
|
|
-n.buffer),d.bufferData(d.ARRAY_BUFFER,n.array,l))}if(Da){w=0;for(D=Ga.length;w<D;w++)d.bindBuffer(d.ARRAY_BUFFER,q.__webglMorphTargetsBuffers[w]),d.bufferData(d.ARRAY_BUFFER,ra[w],l)}Ca&&la>0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,oa,l));za&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER,W,l));Aa&&sa.hasTangents&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglTangentBuffer),d.bufferData(d.ARRAY_BUFFER,ca,l));ta&&X>0&&(d.bindBuffer(d.ARRAY_BUFFER,
|
|
|
-q.__webglUVBuffer),d.bufferData(d.ARRAY_BUFFER,ja,l));ta&&$>0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglUV2Buffer),d.bufferData(d.ARRAY_BUFFER,ka,l));ya&&(d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,ha,l),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,q.__webglLineBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,Y,l));x>0&&(d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinVertexABuffer),d.bufferData(d.ARRAY_BUFFER,da,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinVertexBBuffer),
|
|
|
-d.bufferData(d.ARRAY_BUFFER,ea,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinIndicesBuffer),d.bufferData(d.ARRAY_BUFFER,fa,l),d.bindBuffer(d.ARRAY_BUFFER,q.__webglSkinWeightsBuffer),d.bufferData(d.ARRAY_BUFFER,ga,l));p&&(delete q.__inittedArrays,delete q.__colorArray,delete q.__normalArray,delete q.__tangentArray,delete q.__uvArray,delete q.__uv2Array,delete q.__faceArray,delete q.__vertexArray,delete q.__lineArray,delete q.__skinVertexAArray,delete q.__skinVertexBArray,delete q.__skinIndexArray,delete q.__skinWeightArray)}h.__dirtyVertices=
|
|
|
-!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyTangents=!1;h.__dirtyColors=!1;wa(j,i)}else if(i instanceof THREE.Ribbon){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=r=p=p=void 0;t=i.vertices;m=i.colors;o=t.length;q=m.length;A=i.__vertexArray;l=i.__colorArray;C=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p<o;p++)r=t[p].position,k=p*3,A[k]=r.x,A[k+1]=r.y,A[k+2]=r.z;d.bindBuffer(d.ARRAY_BUFFER,i.__webglVertexBuffer);d.bufferData(d.ARRAY_BUFFER,
|
|
|
-A,j)}if(C){for(p=0;p<q;p++)color=m[p],k=p*3,l[k]=color.r,l[k+1]=color.g,l[k+2]=color.b;d.bindBuffer(d.ARRAY_BUFFER,i.__webglColorBuffer);d.bufferData(d.ARRAY_BUFFER,l,j)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(i instanceof THREE.Line){h=i.geometry;if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=r=p=p=void 0;t=i.vertices;m=i.colors;o=t.length;q=m.length;A=i.__vertexArray;l=i.__colorArray;C=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p<o;p++)r=t[p].position,k=p*3,A[k]=r.x,A[k+
|
|
|
-1]=r.y,A[k+2]=r.z;d.bindBuffer(d.ARRAY_BUFFER,i.__webglVertexBuffer);d.bufferData(d.ARRAY_BUFFER,A,j)}if(C){for(p=0;p<q;p++)color=m[p],k=p*3,l[k]=color.r,l[k+1]=color.g,l[k+2]=color.b;d.bindBuffer(d.ARRAY_BUFFER,i.__webglColorBuffer);d.bufferData(d.ARRAY_BUFFER,l,j)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(i instanceof THREE.ParticleSystem)h=i.geometry,q=va(h,i),(h.__dirtyVertices||h.__dirtyColors||i.sortParticles||q)&&c(h,d.DYNAMIC_DRAW,i),h.__dirtyVertices=!1,h.__dirtyColors=!1,wa(h,i)};
|
|
|
-this.setFaceCulling=function(a,b){a?(!b||b==="ccw"?d.frontFace(d.CCW):d.frontFace(d.CW),a==="back"?d.cullFace(d.BACK):a==="front"?d.cullFace(d.FRONT):d.cullFace(d.FRONT_AND_BACK),d.enable(d.CULL_FACE)):d.disable(d.CULL_FACE)};this.supportsVertexTextures=function(){return bb}};
|
|
|
+E.z,Q+=3;if(ta&&z!==void 0&&m)for(w=0;w<4;w++)B=z[w],ja[X]=B.u,ja[X+1]=B.v,X+=2;if(ta&&U!==void 0&&m)for(w=0;w<4;w++)B=U[w],ka[$]=B.u,ka[$+1]=B.v,$+=2;ya&&(ha[T]=ia,ha[T+1]=ia+1,ha[T+2]=ia+3,ha[T+3]=ia+1,ha[T+4]=ia+2,ha[T+5]=ia+3,T+=6,Y[R]=ia,Y[R+1]=ia+1,Y[R+2]=ia,Y[R+3]=ia+3,Y[R+4]=ia+1,Y[R+5]=ia+2,Y[R+6]=ia+2,Y[R+7]=ia+3,R+=8,ia+=4)}ua&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,na,l));if(aa){w=0;for(D=aa.length;w<D;w++)n=aa[w],n.__original.needsUpdate&&(d.bindBuffer(d.ARRAY_BUFFER,
|
|
|
+n.buffer),d.bufferData(d.ARRAY_BUFFER,n.array,l))}if(Da){w=0;for(D=Ga.length;w<D;w++)d.bindBuffer(d.ARRAY_BUFFER,r.__webglMorphTargetsBuffers[w]),d.bufferData(d.ARRAY_BUFFER,ra[w],l)}Ca&&la>0&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,oa,l));za&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER,W,l));Aa&&sa.hasTangents&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglTangentBuffer),d.bufferData(d.ARRAY_BUFFER,ca,l));ta&&X>0&&(d.bindBuffer(d.ARRAY_BUFFER,
|
|
|
+r.__webglUVBuffer),d.bufferData(d.ARRAY_BUFFER,ja,l));ta&&$>0&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglUV2Buffer),d.bufferData(d.ARRAY_BUFFER,ka,l));ya&&(d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,r.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,ha,l),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,r.__webglLineBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,Y,l));x>0&&(d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinVertexABuffer),d.bufferData(d.ARRAY_BUFFER,da,l),d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinVertexBBuffer),
|
|
|
+d.bufferData(d.ARRAY_BUFFER,ea,l),d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinIndicesBuffer),d.bufferData(d.ARRAY_BUFFER,fa,l),d.bindBuffer(d.ARRAY_BUFFER,r.__webglSkinWeightsBuffer),d.bufferData(d.ARRAY_BUFFER,ga,l));p&&(delete r.__inittedArrays,delete r.__colorArray,delete r.__normalArray,delete r.__tangentArray,delete r.__uvArray,delete r.__uv2Array,delete r.__faceArray,delete r.__vertexArray,delete r.__lineArray,delete r.__skinVertexAArray,delete r.__skinVertexBArray,delete r.__skinIndexArray,delete r.__skinWeightArray)}h.__dirtyVertices=
|
|
|
+!1;h.__dirtyMorphTargets=!1;h.__dirtyElements=!1;h.__dirtyUvs=!1;h.__dirtyNormals=!1;h.__dirtyColors=!1;h.__dirtyTangents=!1;j.attributes&&wa(j)}else if(i instanceof THREE.Ribbon){if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=q=p=p=void 0;t=i.vertices;o=i.colors;m=t.length;r=o.length;A=i.__vertexArray;l=i.__colorArray;C=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p<m;p++)q=t[p].position,k=p*3,A[k]=q.x,A[k+1]=q.y,A[k+2]=q.z;d.bindBuffer(d.ARRAY_BUFFER,i.__webglVertexBuffer);d.bufferData(d.ARRAY_BUFFER,
|
|
|
+A,j)}if(C){for(p=0;p<r;p++)color=o[p],k=p*3,l[k]=color.r,l[k+1]=color.g,l[k+2]=color.b;d.bindBuffer(d.ARRAY_BUFFER,i.__webglColorBuffer);d.bufferData(d.ARRAY_BUFFER,l,j)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(i instanceof THREE.Line){if(h.__dirtyVertices||h.__dirtyColors){i=h;j=d.DYNAMIC_DRAW;k=q=p=p=void 0;t=i.vertices;o=i.colors;m=t.length;r=o.length;A=i.__vertexArray;l=i.__colorArray;C=i.__dirtyColors;if(i.__dirtyVertices){for(p=0;p<m;p++)q=t[p].position,k=p*3,A[k]=q.x,A[k+1]=q.y,A[k+
|
|
|
+2]=q.z;d.bindBuffer(d.ARRAY_BUFFER,i.__webglVertexBuffer);d.bufferData(d.ARRAY_BUFFER,A,j)}if(C){for(p=0;p<r;p++)color=o[p],k=p*3,l[k]=color.r,l[k+1]=color.g,l[k+2]=color.b;d.bindBuffer(d.ARRAY_BUFFER,i.__webglColorBuffer);d.bufferData(d.ARRAY_BUFFER,l,j)}}h.__dirtyVertices=!1;h.__dirtyColors=!1}else if(i instanceof THREE.ParticleSystem)j=b(i,r),l=j.attributes&&va(j),(h.__dirtyVertices||h.__dirtyColors||i.sortParticles||l)&&c(h,d.DYNAMIC_DRAW,i),h.__dirtyVertices=!1,h.__dirtyColors=!1,j.attributes&&
|
|
|
+wa(j)};this.setFaceCulling=function(a,b){a?(!b||b==="ccw"?d.frontFace(d.CCW):d.frontFace(d.CW),a==="back"?d.cullFace(d.BACK):a==="front"?d.cullFace(d.FRONT):d.cullFace(d.FRONT_AND_BACK),d.enable(d.CULL_FACE)):d.disable(d.CULL_FACE)};this.supportsVertexTextures=function(){return bb}};
|
|
|
THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=c.wrapS!==void 0?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=c.wrapT!==void 0?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=c.magFilter!==void 0?c.magFilter:THREE.LinearFilter;this.minFilter=c.minFilter!==void 0?c.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=c.format!==void 0?c.format:THREE.RGBAFormat;this.type=c.type!==void 0?c.type:
|
|
|
THREE.UnsignedByteType;this.depthBuffer=c.depthBuffer!==void 0?c.depthBuffer:!0;this.stencilBuffer=c.stencilBuffer!==void 0?c.stencilBuffer:!0};
|
|
|
THREE.WebGLRenderTarget.prototype.clone=function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;return a};THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};
|