|
@@ -101,20 +101,20 @@ b[5]*=a;b[8]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c
|
|
if(0===c){if(b)throw Error("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},transpose:function(){var a,b=this.elements;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},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+
|
|
if(0===c){if(b)throw Error("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},transpose:function(){var a,b=this.elements;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},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+
|
|
6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;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},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]}};
|
|
6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;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},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]}};
|
|
THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")};
|
|
THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")};
|
|
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,l,k,m,p,n,q,r,t){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=f;v[9]=g;v[13]=h;v[2]=l;v[6]=k;v[10]=m;v[14]=p;v[3]=n;v[7]=q;v[11]=r;v[15]=t;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)},copy:function(a){this.elements.set(a.elements);return this},copyPosition:function(a){var b=this.elements;a=a.elements;
|
|
|
|
|
|
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,l,k,m,p,n,q,r,u){var w=this.elements;w[0]=a;w[4]=b;w[8]=c;w[12]=d;w[1]=e;w[5]=f;w[9]=g;w[13]=h;w[2]=l;w[6]=k;w[10]=m;w[14]=p;w[3]=n;w[7]=q;w[11]=r;w[15]=u;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)},copy:function(a){this.elements.set(a.elements);return this},copyPosition:function(a){var b=this.elements;a=a.elements;
|
|
b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){var d=this.elements;a.set(d[0],d[1],d[2]);b.set(d[4],d[5],d[6]);c.set(d[8],d[9],d[10]);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),f=1/a.set(b[8],b[9],b[10]).length();
|
|
b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){var d=this.elements;a.set(d[0],d[1],d[2]);b.set(d[4],d[5],d[6]);c.set(d[8],d[9],d[10]);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),f=1/a.set(b[8],b[9],b[10]).length();
|
|
c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){!1===a instanceof THREE.Euler&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=f*h;var l=f*e,k=c*h,m=c*e;b[0]=g*h;b[4]=-g*e;b[8]=
|
|
c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){!1===a instanceof THREE.Euler&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=f*h;var l=f*e,k=c*h,m=c*e;b[0]=g*h;b[4]=-g*e;b[8]=
|
|
d;b[1]=l+k*d;b[5]=a-m*d;b[9]=-c*g;b[2]=m-a*d;b[6]=k+l*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,l=g*e,k=d*h,m=d*e,b[0]=a+m*c,b[4]=k*c-l,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=l*c-k,b[6]=m+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,l=g*e,k=d*h,m=d*e,b[0]=a-m*c,b[4]=-f*e,b[8]=k+l*c,b[1]=l+k*c,b[5]=f*h,b[9]=m-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,l=f*e,k=c*h,m=c*e,b[0]=g*h,b[4]=k*d-l,b[8]=a*d+m,b[1]=g*e,b[5]=m*d+a,b[9]=l*d-k,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,l=f*d,k=c*g,m=
|
|
d;b[1]=l+k*d;b[5]=a-m*d;b[9]=-c*g;b[2]=m-a*d;b[6]=k+l*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,l=g*e,k=d*h,m=d*e,b[0]=a+m*c,b[4]=k*c-l,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=l*c-k,b[6]=m+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,l=g*e,k=d*h,m=d*e,b[0]=a-m*c,b[4]=-f*e,b[8]=k+l*c,b[1]=l+k*c,b[5]=f*h,b[9]=m-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,l=f*e,k=c*h,m=c*e,b[0]=g*h,b[4]=k*d-l,b[8]=a*d+m,b[1]=g*e,b[5]=m*d+a,b[9]=l*d-k,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,l=f*d,k=c*g,m=
|
|
c*d,b[0]=g*h,b[4]=m-a*e,b[8]=k*e+l,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+k,b[10]=a-m*e):"XZY"===a.order&&(a=f*g,l=f*d,k=c*g,m=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+m,b[5]=f*h,b[9]=l*e-k,b[2]=k*e-l,b[6]=c*h,b[10]=m*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,l=e+e;a=c*g;var k=c*h,c=c*l,m=d*h,d=d*l,e=e*l,g=f*g,h=f*h,f=f*l;b[0]=1-(m+e);b[4]=k-f;b[8]=c+h;b[1]=k+f;b[5]=1-(a+
|
|
c*d,b[0]=g*h,b[4]=m-a*e,b[8]=k*e+l,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+k,b[10]=a-m*e):"XZY"===a.order&&(a=f*g,l=f*d,k=c*g,m=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+m,b[5]=f*h,b[9]=l*e-k,b[2]=k*e-l,b[6]=c*h,b[10]=m*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,l=e+e;a=c*g;var k=c*h,c=c*l,m=d*h,d=d*l,e=e*l,g=f*g,h=f*h,f=f*l;b[0]=1-(m+e);b[4]=k-f;b[8]=c+h;b[1]=k+f;b[5]=1-(a+
|
|
e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+m);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,f){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var g=this.elements;c.subVectors(d,e).normalize();0===c.lengthSq()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.lengthSq()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=
|
|
e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+m);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,f){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var g=this.elements;c.subVectors(d,e).normalize();0===c.lengthSq()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.lengthSq()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=
|
|
-c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],l=c[12],k=c[1],m=c[5],p=c[9],n=c[13],q=c[2],r=c[6],t=c[10],v=c[14],u=c[3],w=c[7],F=c[11],c=c[15],x=d[0],A=d[4],z=d[8],B=d[12],y=d[1],H=d[5],D=
|
|
|
|
-d[9],E=d[13],Q=d[2],M=d[6],N=d[10],G=d[14],J=d[3],K=d[7],O=d[11],d=d[15];e[0]=f*x+g*y+h*Q+l*J;e[4]=f*A+g*H+h*M+l*K;e[8]=f*z+g*D+h*N+l*O;e[12]=f*B+g*E+h*G+l*d;e[1]=k*x+m*y+p*Q+n*J;e[5]=k*A+m*H+p*M+n*K;e[9]=k*z+m*D+p*N+n*O;e[13]=k*B+m*E+p*G+n*d;e[2]=q*x+r*y+t*Q+v*J;e[6]=q*A+r*H+t*M+v*K;e[10]=q*z+r*D+t*N+v*O;e[14]=q*B+r*E+t*G+v*d;e[3]=u*x+w*y+F*Q+c*J;e[7]=u*A+w*H+F*M+c*K;e[11]=u*z+w*D+F*N+c*O;e[15]=u*B+w*E+F*G+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,
|
|
|
|
|
|
+c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],l=c[12],k=c[1],m=c[5],p=c[9],n=c[13],q=c[2],r=c[6],u=c[10],w=c[14],t=c[3],v=c[7],F=c[11],c=c[15],x=d[0],A=d[4],z=d[8],B=d[12],y=d[1],H=d[5],D=
|
|
|
|
+d[9],E=d[13],Q=d[2],M=d[6],N=d[10],G=d[14],J=d[3],K=d[7],O=d[11],d=d[15];e[0]=f*x+g*y+h*Q+l*J;e[4]=f*A+g*H+h*M+l*K;e[8]=f*z+g*D+h*N+l*O;e[12]=f*B+g*E+h*G+l*d;e[1]=k*x+m*y+p*Q+n*J;e[5]=k*A+m*H+p*M+n*K;e[9]=k*z+m*D+p*N+n*O;e[13]=k*B+m*E+p*G+n*d;e[2]=q*x+r*y+u*Q+w*J;e[6]=q*A+r*H+u*M+w*K;e[10]=q*z+r*D+u*N+w*O;e[14]=q*B+r*E+u*G+w*d;e[3]=t*x+v*y+F*Q+c*J;e[7]=t*A+v*H+F*M+c*K;e[11]=t*z+v*D+F*N+c*O;e[15]=t*B+v*E+F*G+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,
|
|
b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===
|
|
b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===
|
|
d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,a.y,a.z);return b}}(),determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],l=a[13],k=a[2],m=a[6],p=a[10],n=a[14];
|
|
d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,a.y,a.z);return b}}(),determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],l=a[13],k=a[2],m=a[6],p=a[10],n=a[14];
|
|
return a[3]*(+e*h*m-d*l*m-e*g*p+c*l*p+d*g*n-c*h*n)+a[7]*(+b*h*n-b*l*p+e*f*p-d*f*n+d*l*k-e*h*k)+a[11]*(+b*l*m-b*g*n-e*f*m+c*f*n+e*g*k-c*l*k)+a[15]*(-d*g*k-b*h*m+b*g*p+d*f*m-c*f*p+c*h*k)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=
|
|
return a[3]*(+e*h*m-d*l*m-e*g*p+c*l*p+d*g*n-c*h*n)+a[7]*(+b*h*n-b*l*p+e*f*p-d*f*n+d*l*k-e*h*k)+a[11]*(+b*l*m-b*g*n-e*f*m+c*f*n+e*g*k-c*l*k)+a[15]*(-d*g*k-b*h*m+b*g*p+d*f*m-c*f*p+c*h*k)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=
|
|
c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a;return function(){void 0===a&&(a=new THREE.Vector3);console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,
|
|
c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a;return function(){void 0===a&&(a=new THREE.Vector3);console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,
|
|
-b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],l=d[1],k=d[5],m=d[9],p=d[13],n=d[2],q=d[6],r=d[10],t=d[14],v=d[3],u=d[7],w=d[11],d=d[15];c[0]=m*t*u-p*r*u+p*q*w-k*t*w-m*q*d+k*r*d;c[4]=h*r*u-g*t*u-h*q*w+f*t*w+g*q*d-f*r*d;c[8]=g*p*u-h*m*u+h*k*w-f*p*w-g*k*d+f*m*d;c[12]=h*m*q-g*p*q-h*k*r+f*p*r+g*k*t-f*m*t;c[1]=p*r*v-m*t*v-p*n*w+l*t*w+m*n*d-l*r*d;c[5]=g*t*v-h*r*v+h*n*w-e*t*w-g*n*d+e*r*d;c[9]=h*m*v-g*p*v-h*l*w+e*p*w+g*l*d-e*m*d;c[13]=g*p*n-h*m*n+h*l*r-e*p*r-g*l*t+e*m*t;c[2]=k*t*v-p*q*v+
|
|
|
|
-p*n*u-l*t*u-k*n*d+l*q*d;c[6]=h*q*v-f*t*v-h*n*u+e*t*u+f*n*d-e*q*d;c[10]=f*p*v-h*k*v+h*l*u-e*p*u-f*l*d+e*k*d;c[14]=h*k*n-f*p*n-h*l*q+e*p*q+f*l*t-e*k*t;c[3]=m*q*v-k*r*v-m*n*u+l*r*u+k*n*w-l*q*w;c[7]=f*r*v-g*q*v+g*n*u-e*r*u-f*n*w+e*q*w;c[11]=g*k*v-f*m*v-g*l*u+e*m*u+f*l*w-e*k*w;c[15]=f*m*n-g*k*n+g*l*q-e*m*q-f*l*r+e*k*r;c=e*c[0]+l*c[4]+n*c[8]+v*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
|
|
|
|
|
|
+b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],l=d[1],k=d[5],m=d[9],p=d[13],n=d[2],q=d[6],r=d[10],u=d[14],w=d[3],t=d[7],v=d[11],d=d[15];c[0]=m*u*t-p*r*t+p*q*v-k*u*v-m*q*d+k*r*d;c[4]=h*r*t-g*u*t-h*q*v+f*u*v+g*q*d-f*r*d;c[8]=g*p*t-h*m*t+h*k*v-f*p*v-g*k*d+f*m*d;c[12]=h*m*q-g*p*q-h*k*r+f*p*r+g*k*u-f*m*u;c[1]=p*r*w-m*u*w-p*n*v+l*u*v+m*n*d-l*r*d;c[5]=g*u*w-h*r*w+h*n*v-e*u*v-g*n*d+e*r*d;c[9]=h*m*w-g*p*w-h*l*v+e*p*v+g*l*d-e*m*d;c[13]=g*p*n-h*m*n+h*l*r-e*p*r-g*l*u+e*m*u;c[2]=k*u*w-p*q*w+
|
|
|
|
+p*n*t-l*u*t-k*n*d+l*q*d;c[6]=h*q*w-f*u*w-h*n*t+e*u*t+f*n*d-e*q*d;c[10]=f*p*w-h*k*w+h*l*t-e*p*t-f*l*d+e*k*d;c[14]=h*k*n-f*p*n-h*l*q+e*p*q+f*l*u-e*k*u;c[3]=m*q*w-k*r*w-m*n*t+l*r*t+k*n*v-l*q*v;c[7]=f*r*w-g*q*w+g*n*t-e*r*t-f*n*v+e*q*v;c[11]=g*k*w-f*m*w-g*l*t+e*m*t+f*l*v-e*k*v;c[15]=f*m*n-g*k*n+g*l*q-e*m*q-f*l*r+e*k*r;c=e*c[0]+l*c[4]+n*c[8]+w*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
|
|
this.identity();return this}this.multiplyScalar(1/c);return this},scale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10]))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=
|
|
this.identity();return this}this.multiplyScalar(1/c);return this},scale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10]))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX: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},makeRotationY: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},makeRotationZ: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},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,l=e*f,k=e*g;this.set(l*f+c,l*g-d*h,l*h+d*g,0,l*g+d*h,k*g+c,k*h-d*f,0,l*h-d*g,k*h+d*f,e*h*h+c,0,0,0,0,1);
|
|
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},makeRotationY: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},makeRotationZ: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},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,l=e*f,k=e*g;this.set(l*f+c,l*g-d*h,l*h+d*g,0,l*g+d*h,k*g+c,k*h-d*f,0,l*h-d*g,k*h+d*f,e*h*h+c,0,0,0,0,1);
|
|
return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},compose:function(a,b,c){this.makeRotationFromQuaternion(b);this.scale(c);this.setPosition(a);return this},decompose:function(){var a,b;return function(c,d,e){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Matrix4);var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),l=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.elements.set(this.elements);
|
|
return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},compose:function(a,b,c){this.makeRotationFromQuaternion(b);this.scale(c);this.setPosition(a);return this},decompose:function(){var a,b;return function(c,d,e){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Matrix4);var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),l=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.elements.set(this.elements);
|
|
@@ -134,8 +134,8 @@ THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.c
|
|
empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(this.center.dot(a.normal)-a.constant)<=this.radius},clampPoint:function(a,b){var c=
|
|
empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(this.center.dot(a.normal)-a.constant)<=this.radius},clampPoint:function(a,b){var c=
|
|
this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&
|
|
this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&
|
|
a.radius===this.radius}};THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};
|
|
a.radius===this.radius}};THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};
|
|
-THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],k=c[7],m=c[8],p=c[9],n=c[10],q=c[11],r=c[12],t=c[13],v=c[14],
|
|
|
|
-c=c[15];b[0].setComponents(f-a,k-g,q-m,c-r).normalize();b[1].setComponents(f+a,k+g,q+m,c+r).normalize();b[2].setComponents(f+d,k+h,q+p,c+t).normalize();b[3].setComponents(f-d,k-h,q-p,c-t).normalize();b[4].setComponents(f-e,k-l,q-n,c-v).normalize();b[5].setComponents(f+e,k+l,q+n,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);
|
|
|
|
|
|
+THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],k=c[7],m=c[8],p=c[9],n=c[10],q=c[11],r=c[12],u=c[13],w=c[14],
|
|
|
|
+c=c[15];b[0].setComponents(f-a,k-g,q-m,c-r).normalize();b[1].setComponents(f+a,k+g,q+m,c+r).normalize();b[2].setComponents(f+d,k+h,q+p,c+u).normalize();b[3].setComponents(f-d,k-h,q-p,c-u).normalize();b[4].setComponents(f-e,k-l,q-n,c-w).normalize();b[5].setComponents(f+e,k+l,q+n,c+w).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);
|
|
return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;
|
|
return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;
|
|
var g=f.distanceToPoint(a),f=f.distanceToPoint(b);if(0>g&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
|
|
var g=f.distanceToPoint(a),f=f.distanceToPoint(b);if(0>g&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
|
|
THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,
|
|
THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,
|
|
@@ -209,7 +209,7 @@ THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for
|
|
this.verticesNeedUpdate=!0},rotateX:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationY(b);this.applyMatrix(a);return this}}(),rotateZ:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);
|
|
this.verticesNeedUpdate=!0},rotateX:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationY(b);this.applyMatrix(a);return this}}(),rotateZ:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);
|
|
a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),lookAt:function(){var a;return function(b){void 0===a&&(a=new THREE.Object3D);a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),fromBufferGeometry:function(a){function b(a,b,d){var e=void 0!==g?[m[a].clone(),m[b].clone(),m[d].clone()]:[],f=void 0!==h?[c.colors[a].clone(),c.colors[b].clone(),c.colors[d].clone()]:
|
|
a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),lookAt:function(){var a;return function(b){void 0===a&&(a=new THREE.Object3D);a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),fromBufferGeometry:function(a){function b(a,b,d){var e=void 0!==g?[m[a].clone(),m[b].clone(),m[d].clone()]:[],f=void 0!==h?[c.colors[a].clone(),c.colors[b].clone(),c.colors[d].clone()]:
|
|
[],e=new THREE.Face3(a,b,d,e,f);c.faces.push(e);void 0!==l&&c.faceVertexUvs[0].push([p[a].clone(),p[b].clone(),p[d].clone()]);void 0!==k&&c.faceVertexUvs[1].push([n[a].clone(),n[b].clone(),n[d].clone()])}var c=this,d=null!==a.index?a.index.array:void 0,e=a.attributes,f=e.position.array,g=void 0!==e.normal?e.normal.array:void 0,h=void 0!==e.color?e.color.array:void 0,l=void 0!==e.uv?e.uv.array:void 0,k=void 0!==e.uv2?e.uv2.array:void 0;void 0!==k&&(this.faceVertexUvs[1]=[]);for(var m=[],p=[],n=[],
|
|
[],e=new THREE.Face3(a,b,d,e,f);c.faces.push(e);void 0!==l&&c.faceVertexUvs[0].push([p[a].clone(),p[b].clone(),p[d].clone()]);void 0!==k&&c.faceVertexUvs[1].push([n[a].clone(),n[b].clone(),n[d].clone()])}var c=this,d=null!==a.index?a.index.array:void 0,e=a.attributes,f=e.position.array,g=void 0!==e.normal?e.normal.array:void 0,h=void 0!==e.color?e.color.array:void 0,l=void 0!==e.uv?e.uv.array:void 0,k=void 0!==e.uv2?e.uv2.array:void 0;void 0!==k&&(this.faceVertexUvs[1]=[]);for(var m=[],p=[],n=[],
|
|
-q=e=0;e<f.length;e+=3,q+=2)c.vertices.push(new THREE.Vector3(f[e],f[e+1],f[e+2])),void 0!==g&&m.push(new THREE.Vector3(g[e],g[e+1],g[e+2])),void 0!==h&&c.colors.push(new THREE.Color(h[e],h[e+1],h[e+2])),void 0!==l&&p.push(new THREE.Vector2(l[q],l[q+1])),void 0!==k&&n.push(new THREE.Vector2(k[q],k[q+1]));if(void 0!==d)if(f=a.groups,0<f.length)for(e=0;e<f.length;e++)for(var q=f[e],r=q.start,t=q.count,q=r,r=r+t;q<r;q+=3)b(d[q],d[q+1],d[q+2]);else for(e=0;e<d.length;e+=3)b(d[e],d[e+1],d[e+2]);else for(e=
|
|
|
|
|
|
+q=e=0;e<f.length;e+=3,q+=2)c.vertices.push(new THREE.Vector3(f[e],f[e+1],f[e+2])),void 0!==g&&m.push(new THREE.Vector3(g[e],g[e+1],g[e+2])),void 0!==h&&c.colors.push(new THREE.Color(h[e],h[e+1],h[e+2])),void 0!==l&&p.push(new THREE.Vector2(l[q],l[q+1])),void 0!==k&&n.push(new THREE.Vector2(k[q],k[q+1]));if(void 0!==d)if(f=a.groups,0<f.length)for(e=0;e<f.length;e++)for(var q=f[e],r=q.start,u=q.count,q=r,r=r+u;q<r;q+=3)b(d[q],d[q+1],d[q+2]);else for(e=0;e<d.length;e+=3)b(d[e],d[e+1],d[e+2]);else for(e=
|
|
0;e<f.length/3;e+=3)b(e,e+1,e+2);this.computeFaceNormals();null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.translate(a.x,a.y,a.z);return a},normalize:function(){this.computeBoundingSphere();var a=this.boundingSphere.center,b=this.boundingSphere.radius,b=0===b?1:1/b,c=new THREE.Matrix4;c.set(b,0,0,-b*a.x,0,b,0,
|
|
0;e<f.length/3;e+=3)b(e,e+1,e+2);this.computeFaceNormals();null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.translate(a.x,a.y,a.z);return a},normalize:function(){this.computeBoundingSphere();var a=this.boundingSphere.center,b=this.boundingSphere.radius,b=0===b?1:1/b,c=new THREE.Matrix4;c.set(b,0,0,-b*a.x,0,b,0,
|
|
-b*a.y,0,0,b,-b*a.z,0,0,0,1);this.applyMatrix(c);return this},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g);b.subVectors(f,g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,f,g,h=new THREE.Vector3,
|
|
-b*a.y,0,0,b,-b*a.z,0,0,0,1);this.applyMatrix(c);return this},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g);b.subVectors(f,g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,f,g,h=new THREE.Vector3,
|
|
l=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),l.subVectors(e,f),h.cross(l),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=c.vertexNormals,3===e.length?(e[0].copy(d[c.a]),
|
|
l=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),l.subVectors(e,f),h.cross(l),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=c.vertexNormals,3===e.length?(e[0].copy(d[c.a]),
|
|
@@ -217,21 +217,21 @@ e[1].copy(d[c.b]),e[2].copy(d[c.c])):(e[0]=d[c.a].clone(),e[1]=d[c.b].clone(),e[
|
|
e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=this.morphNormals[a].vertexNormals,h,l;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,l={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(l)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;
|
|
e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=this.morphNormals[a].vertexNormals,h,l;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,l={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(l)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;
|
|
f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],l=g.vertexNormals[c],h.copy(e.normal),l.a.copy(e.vertexNormals[0]),l.b.copy(e.vertexNormals[1]),l.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){for(var a=
|
|
f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],l=g.vertexNormals[c],h.copy(e.normal),l.a.copy(e.vertexNormals[0]),l.b.copy(e.vertexNormals[1]),l.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){for(var a=
|
|
0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",
|
|
0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",
|
|
-a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,l=a.faces,k=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var m=0,p=g.length;m<p;m++){var n=g[m].clone();void 0!==b&&n.applyMatrix4(b);f.push(n)}m=0;for(p=l.length;m<p;m++){var g=l[m],q,r=g.vertexNormals,t=g.vertexColors,n=new THREE.Face3(g.a+e,g.b+e,g.c+e);n.normal.copy(g.normal);void 0!==d&&n.normal.applyMatrix3(d).normalize();b=0;for(f=r.length;b<
|
|
|
|
-f;b++)q=r[b].clone(),void 0!==d&&q.applyMatrix3(d).normalize(),n.vertexNormals.push(q);n.color.copy(g.color);b=0;for(f=t.length;b<f;b++)q=t[b],n.vertexColors.push(q.clone());n.materialIndex=g.materialIndex+c;h.push(n)}m=0;for(p=a.length;m<p;m++)if(c=a[m],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());k.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),
|
|
|
|
|
|
+a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,l=a.faces,k=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var m=0,p=g.length;m<p;m++){var n=g[m].clone();void 0!==b&&n.applyMatrix4(b);f.push(n)}m=0;for(p=l.length;m<p;m++){var g=l[m],q,r=g.vertexNormals,u=g.vertexColors,n=new THREE.Face3(g.a+e,g.b+e,g.c+e);n.normal.copy(g.normal);void 0!==d&&n.normal.applyMatrix3(d).normalize();b=0;for(f=r.length;b<
|
|
|
|
+f;b++)q=r[b].clone(),void 0!==d&&q.applyMatrix3(d).normalize(),n.vertexNormals.push(q);n.color.copy(g.color);b=0;for(f=u.length;b<f;b++)q=u[b],n.vertexColors.push(q.clone());n.materialIndex=g.materialIndex+c;h.push(n)}m=0;for(p=a.length;m<p;m++)if(c=a[m],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(c[b].clone());k.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),
|
|
this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]===e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,
|
|
this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]===e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,
|
|
1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=this.vertices.length-b.length;this.vertices=b;return f},sortFacesByMaterialIndex:function(){for(var a=this.faces,b=a.length,c=0;c<b;c++)a[c]._id=c;a.sort(function(a,b){return a.materialIndex-b.materialIndex});var d=this.faceVertexUvs[0],e=this.faceVertexUvs[1],f,g;d&&d.length===b&&(f=[]);e&&e.length===b&&(g=[]);for(c=0;c<b;c++){var h=a[c]._id;f&&f.push(d[h]);g&&g.push(e[h])}f&&(this.faceVertexUvs[0]=f);g&&(this.faceVertexUvs[1]=
|
|
1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=this.vertices.length-b.length;this.vertices=b;return f},sortFacesByMaterialIndex:function(){for(var a=this.faces,b=a.length,c=0;c<b;c++)a[c]._id=c;a.sort(function(a,b){return a.materialIndex-b.materialIndex});var d=this.faceVertexUvs[0],e=this.faceVertexUvs[1],f,g;d&&d.length===b&&(f=[]);e&&e.length===b&&(g=[]);for(c=0;c<b;c++){var h=a[c]._id;f&&f.push(d[h]);g&&g.push(e[h])}f&&(this.faceVertexUvs[0]=f);g&&(this.faceVertexUvs[1]=
|
|
g)},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==k[b])return k[b];k[b]=l.length/3;l.push(a.x,a.y,a.z);return k[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=m.length;m.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=n.length/2;n.push(a.x,a.y);return q[b]}var e={metadata:{version:4.4,type:"Geometry",
|
|
g)},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==k[b])return k[b];k[b]=l.length/3;l.push(a.x,a.y,a.z);return k[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=m.length;m.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=n.length/2;n.push(a.x,a.y);return q[b]}var e={metadata:{version:4.4,type:"Geometry",
|
|
-generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],l=[],k={},m=[],p={},n=[],q={};for(g=0;g<this.faces.length;g++){var r=this.faces[g],t=void 0!==this.faceVertexUvs[0][g],v=0<r.normal.length(),u=0<r.vertexNormals.length,w=1!==r.color.r||1!==r.color.g||1!==r.color.b,
|
|
|
|
-F=0<r.vertexColors.length,x=0,x=a(x,0,0),x=a(x,1,!0),x=a(x,2,!1),x=a(x,3,t),x=a(x,4,v),x=a(x,5,u),x=a(x,6,w),x=a(x,7,F);h.push(x);h.push(r.a,r.b,r.c);h.push(r.materialIndex);t&&(t=this.faceVertexUvs[0][g],h.push(d(t[0]),d(t[1]),d(t[2])));v&&h.push(b(r.normal));u&&(v=r.vertexNormals,h.push(b(v[0]),b(v[1]),b(v[2])));w&&h.push(c(r.color));F&&(r=r.vertexColors,h.push(c(r[0]),c(r[1]),c(r[2])))}e.data={};e.data.vertices=f;e.data.normals=l;0<m.length&&(e.data.colors=m);0<n.length&&(e.data.uvs=[n]);e.data.faces=
|
|
|
|
|
|
+generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],l=[],k={},m=[],p={},n=[],q={};for(g=0;g<this.faces.length;g++){var r=this.faces[g],u=void 0!==this.faceVertexUvs[0][g],w=0<r.normal.length(),t=0<r.vertexNormals.length,v=1!==r.color.r||1!==r.color.g||1!==r.color.b,
|
|
|
|
+F=0<r.vertexColors.length,x=0,x=a(x,0,0),x=a(x,1,!0),x=a(x,2,!1),x=a(x,3,u),x=a(x,4,w),x=a(x,5,t),x=a(x,6,v),x=a(x,7,F);h.push(x);h.push(r.a,r.b,r.c);h.push(r.materialIndex);u&&(u=this.faceVertexUvs[0][g],h.push(d(u[0]),d(u[1]),d(u[2])));w&&h.push(b(r.normal));t&&(w=r.vertexNormals,h.push(b(w[0]),b(w[1]),b(w[2])));v&&h.push(c(r.color));F&&(r=r.vertexColors,h.push(c(r[0]),c(r[1]),c(r[2])))}e.data={};e.data.vertices=f;e.data.normals=l;0<m.length&&(e.data.colors=m);0<n.length&&(e.data.uvs=[n]);e.data.faces=
|
|
h;return e},clone:function(){var a=this.parameters;if(void 0!==a){var b=[],c;for(c in a)b.push(a[c]);a=Object.create(this.constructor.prototype);this.constructor.apply(a,b);return a}return(new this.constructor).copy(this)},copy:function(a){this.vertices=[];this.faces=[];this.faceVertexUvs=[[]];for(var b=a.vertices,c=0,d=b.length;c<d;c++)this.vertices.push(b[c].clone());b=a.faces;c=0;for(d=b.length;c<d;c++)this.faces.push(b[c].clone());c=0;for(d=a.faceVertexUvs.length;c<d;c++){b=a.faceVertexUvs[c];
|
|
h;return e},clone:function(){var a=this.parameters;if(void 0!==a){var b=[],c;for(c in a)b.push(a[c]);a=Object.create(this.constructor.prototype);this.constructor.apply(a,b);return a}return(new this.constructor).copy(this)},copy:function(a){this.vertices=[];this.faces=[];this.faceVertexUvs=[[]];for(var b=a.vertices,c=0,d=b.length;c<d;c++)this.vertices.push(b[c].clone());b=a.faces;c=0;for(d=b.length;c<d;c++)this.faces.push(b[c].clone());c=0;for(d=a.faceVertexUvs.length;c<d;c++){b=a.faceVertexUvs[c];
|
|
void 0===this.faceVertexUvs[c]&&(this.faceVertexUvs[c]=[]);for(var e=0,f=b.length;e<f;e++){for(var g=b[e],h=[],l=0,k=g.length;l<k;l++)h.push(g[l].clone());this.faceVertexUvs[c].push(h)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;
|
|
void 0===this.faceVertexUvs[c]&&(this.faceVertexUvs[c]=[]);for(var e=0,f=b.length;e<f;e++){for(var g=b[e],h=[],l=0,k=g.length;l<k;l++)h.push(g[l].clone());this.faceVertexUvs[c].push(h)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;
|
|
THREE.DirectGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="DirectGeometry";this.indices=[];this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1};
|
|
THREE.DirectGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="DirectGeometry";this.indices=[];this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1};
|
|
THREE.DirectGeometry.prototype={constructor:THREE.DirectGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")},computeGroups:function(a){var b,c=[],
|
|
THREE.DirectGeometry.prototype={constructor:THREE.DirectGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")},computeGroups:function(a){var b,c=[],
|
|
d;a=a.faces;for(var e=0;e<a.length;e++){var f=a[e];f.materialIndex!==d&&(d=f.materialIndex,void 0!==b&&(b.count=3*e-b.start,c.push(b)),b={start:3*e,materialIndex:d})}void 0!==b&&(b.count=3*e-b.start,c.push(b));this.groups=c},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.morphTargets,h=g.length;if(0<h){for(var l=[],k=0;k<h;k++)l[k]=[];this.morphTargets.position=l}var m=a.morphNormals,p=m.length;if(0<p){for(var n=[],k=0;k<p;k++)n[k]=
|
|
d;a=a.faces;for(var e=0;e<a.length;e++){var f=a[e];f.materialIndex!==d&&(d=f.materialIndex,void 0!==b&&(b.count=3*e-b.start,c.push(b)),b={start:3*e,materialIndex:d})}void 0!==b&&(b.count=3*e-b.start,c.push(b));this.groups=c},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.morphTargets,h=g.length;if(0<h){for(var l=[],k=0;k<h;k++)l[k]=[];this.morphTargets.position=l}var m=a.morphNormals,p=m.length;if(0<p){for(var n=[],k=0;k<p;k++)n[k]=
|
|
-[];this.morphTargets.normal=n}for(var q=a.skinIndices,r=a.skinWeights,t=q.length===c.length,v=r.length===c.length,k=0;k<b.length;k++){var u=b[k];this.vertices.push(c[u.a],c[u.b],c[u.c]);var w=u.vertexNormals;3===w.length?this.normals.push(w[0],w[1],w[2]):(w=u.normal,this.normals.push(w,w,w));w=u.vertexColors;3===w.length?this.colors.push(w[0],w[1],w[2]):(w=u.color,this.colors.push(w,w,w));!0===e&&(w=d[0][k],void 0!==w?this.uvs.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",
|
|
|
|
-k),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===f&&(w=d[1][k],void 0!==w?this.uvs2.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",k),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));for(w=0;w<h;w++){var F=g[w].vertices;l[w].push(F[u.a],F[u.b],F[u.c])}for(w=0;w<p;w++)F=m[w].vertexNormals[k],n[w].push(F.a,F.b,F.c);t&&this.skinIndices.push(q[u.a],q[u.b],q[u.c]);v&&this.skinWeights.push(r[u.a],r[u.b],
|
|
|
|
-r[u.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);
|
|
|
|
|
|
+[];this.morphTargets.normal=n}for(var q=a.skinIndices,r=a.skinWeights,u=q.length===c.length,w=r.length===c.length,k=0;k<b.length;k++){var t=b[k];this.vertices.push(c[t.a],c[t.b],c[t.c]);var v=t.vertexNormals;3===v.length?this.normals.push(v[0],v[1],v[2]):(v=t.normal,this.normals.push(v,v,v));v=t.vertexColors;3===v.length?this.colors.push(v[0],v[1],v[2]):(v=t.color,this.colors.push(v,v,v));!0===e&&(v=d[0][k],void 0!==v?this.uvs.push(v[0],v[1],v[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",
|
|
|
|
+k),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===f&&(v=d[1][k],void 0!==v?this.uvs2.push(v[0],v[1],v[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",k),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));for(v=0;v<h;v++){var F=g[v].vertices;l[v].push(F[t.a],F[t.b],F[t.c])}for(v=0;v<p;v++)F=m[v].vertexNormals[k],n[v].push(F.a,F.b,F.c);u&&this.skinIndices.push(q[t.a],q[t.b],q[t.c]);w&&this.skinWeights.push(r[t.a],r[t.b],
|
|
|
|
+r[t.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);
|
|
THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity}};
|
|
THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity}};
|
|
THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addIndex:function(a){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().");this.setIndex(a)},getIndex:function(){return this.index},setIndex:function(a){this.index=a},addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(a,new THREE.BufferAttribute(b,
|
|
THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addIndex:function(a){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().");this.setIndex(a)},getIndex:function(){return this.index},setIndex:function(a){this.index=a},addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(a,new THREE.BufferAttribute(b,
|
|
c))):"index"===a?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(b)):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a]},get drawcalls(){console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups.");return this.groups},get offsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups.");return this.groups},addDrawCall:function(a,
|
|
c))):"index"===a?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(b)):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a]},get drawcalls(){console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups.");return this.groups},get offsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups.");return this.groups},addDrawCall:function(a,
|
|
@@ -249,7 +249,7 @@ c.needsUpdate=!0),b.verticesNeedUpdate=!1);!0===b.normalsNeedUpdate&&(c=this.att
|
|
this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var a=
|
|
this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var a=
|
|
new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
|
|
new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
|
|
this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.index,b=this.attributes,c=this.groups;if(b.position){var d=b.position.array;if(void 0===b.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(d.length),3));else for(var e=b.normal.array,f=0,g=e.length;f<g;f++)e[f]=0;var e=b.normal.array,h,l,k,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,r=new THREE.Vector3;if(a){a=a.array;0===c.length&&this.addGroup(0,a.length);
|
|
this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.index,b=this.attributes,c=this.groups;if(b.position){var d=b.position.array;if(void 0===b.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(d.length),3));else for(var e=b.normal.array,f=0,g=e.length;f<g;f++)e[f]=0;var e=b.normal.array,h,l,k,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,r=new THREE.Vector3;if(a){a=a.array;0===c.length&&this.addGroup(0,a.length);
|
|
-for(var t=0,v=c.length;t<v;++t)for(f=c[t],g=f.start,h=f.count,f=g,g+=h;f<g;f+=3)h=3*a[f+0],l=3*a[f+1],k=3*a[f+2],m.fromArray(d,h),p.fromArray(d,l),n.fromArray(d,k),q.subVectors(n,p),r.subVectors(m,p),q.cross(r),e[h]+=q.x,e[h+1]+=q.y,e[h+2]+=q.z,e[l]+=q.x,e[l+1]+=q.y,e[l+2]+=q.z,e[k]+=q.x,e[k+1]+=q.y,e[k+2]+=q.z}else for(f=0,g=d.length;f<g;f+=9)m.fromArray(d,f),p.fromArray(d,f+3),n.fromArray(d,f+6),q.subVectors(n,p),r.subVectors(m,p),q.cross(r),e[f]=q.x,e[f+1]=q.y,e[f+2]=q.z,e[f+3]=q.x,e[f+4]=q.y,
|
|
|
|
|
|
+for(var u=0,w=c.length;u<w;++u)for(f=c[u],g=f.start,h=f.count,f=g,g+=h;f<g;f+=3)h=3*a[f+0],l=3*a[f+1],k=3*a[f+2],m.fromArray(d,h),p.fromArray(d,l),n.fromArray(d,k),q.subVectors(n,p),r.subVectors(m,p),q.cross(r),e[h]+=q.x,e[h+1]+=q.y,e[h+2]+=q.z,e[l]+=q.x,e[l+1]+=q.y,e[l+2]+=q.z,e[k]+=q.x,e[k+1]+=q.y,e[k+2]+=q.z}else for(f=0,g=d.length;f<g;f+=9)m.fromArray(d,f),p.fromArray(d,f+3),n.fromArray(d,f+6),q.subVectors(n,p),r.subVectors(m,p),q.cross(r),e[f]=q.x,e[f+1]=q.y,e[f+2]=q.z,e[f+3]=q.x,e[f+4]=q.y,
|
|
e[f+5]=q.z,e[f+6]=q.x,e[f+7]=q.y,e[f+8]=q.z;this.normalizeNormals();b.normal.needsUpdate=!0}},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(a){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,
|
|
e[f+5]=q.z,e[f+6]=q.x,e[f+7]=q.y,e[f+8]=q.z;this.normalizeNormals();b.normal.needsUpdate=!0}},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(a){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,
|
|
d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);
|
|
d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);
|
|
if(void 0!==this.parameters){var b=this.parameters,c;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data={attributes:{}};var d=this.index;null!==d&&(b=Array.prototype.slice.call(d.array),a.data.index={type:d.array.constructor.name,array:b});d=this.attributes;for(c in d){var e=d[c],b=Array.prototype.slice.call(e.array);a.data.attributes[c]={itemSize:e.itemSize,type:e.array.constructor.name,array:b}}c=this.groups;0<c.length&&(a.data.groups=JSON.parse(JSON.stringify(c)));c=this.boundingSphere;null!==
|
|
if(void 0!==this.parameters){var b=this.parameters,c;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data={attributes:{}};var d=this.index;null!==d&&(b=Array.prototype.slice.call(d.array),a.data.index={type:d.array.constructor.name,array:b});d=this.attributes;for(c in d){var e=d[c],b=Array.prototype.slice.call(e.array);a.data.attributes[c]={itemSize:e.itemSize,type:e.array.constructor.name,array:b}}c=this.groups;0<c.length&&(a.data.groups=JSON.parse(JSON.stringify(c)));c=this.boundingSphere;null!==
|
|
@@ -289,9 +289,9 @@ e=d[b],f=this._bindings;void 0===e&&(e={},d[b]=e);e[c]=a;a._cacheIndex=f.length;
|
|
this._bindings,c=a._cacheIndex,d=--this._nActiveBindings,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_lendControlInterpolant:function(){var a=this._controlInterpolants,b=this._nActiveControlInterpolants++,c=a[b];void 0===c&&(c=new THREE.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),c.__cacheIndex=b,a[b]=c);return c},_takeBackControlInterpolant:function(a){var b=this._controlInterpolants,c=a.__cacheIndex,d=--this._nActiveControlInterpolants,
|
|
this._bindings,c=a._cacheIndex,d=--this._nActiveBindings,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_lendControlInterpolant:function(){var a=this._controlInterpolants,b=this._nActiveControlInterpolants++,c=a[b];void 0===c&&(c=new THREE.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),c.__cacheIndex=b,a[b]=c);return c},_takeBackControlInterpolant:function(a){var b=this._controlInterpolants,c=a.__cacheIndex,d=--this._nActiveControlInterpolants,
|
|
e=b[d];a.__cacheIndex=d;b[d]=a;e.__cacheIndex=c;b[c]=e},_controlInterpolantsResultBuffer:new Float32Array(1)});
|
|
e=b[d];a.__cacheIndex=d;b[d]=a;e.__cacheIndex=c;b[c]=e},_controlInterpolantsResultBuffer:new Float32Array(1)});
|
|
THREE.AnimationObjectGroup=function(a){this.uuid=THREE.Math.generateUUID();this._objects=Array.prototype.slice.call(arguments);this.nCachedObjects_=0;var b={};this._indicesByUUID=b;for(var c=0,d=arguments.length;c!==d;++c)b[arguments[c].uuid]=c;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}};
|
|
THREE.AnimationObjectGroup=function(a){this.uuid=THREE.Math.generateUUID();this._objects=Array.prototype.slice.call(arguments);this.nCachedObjects_=0;var b={};this._indicesByUUID=b;for(var c=0,d=arguments.length;c!==d;++c)b[arguments[c].uuid]=c;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}};
|
|
-THREE.AnimationObjectGroup.prototype={constructor:THREE.AnimationObjectGroup,add:function(a){for(var b=this._objects,c=b.length,d=this.nCachedObjects_,e=this._indicesByUUID,f=this._paths,g=this._parsedPaths,h=this._bindings,l=h.length,k=0,m=arguments.length;k!==m;++k){var p=arguments[k],n=p.uuid,q=e[n];if(void 0===q){q=c++;e[n]=q;b.push(p);for(var n=0,r=l;n!==r;++n)h[n].push(new THREE.PropertyBinding(p,f[n],g[n]))}else if(q<d){var t=b[q],v=--d,r=b[v];e[r.uuid]=q;b[q]=r;e[n]=v;b[v]=p;n=0;for(r=l;n!==
|
|
|
|
-r;++n){var u=h[n],w=u[q];u[q]=u[v];void 0===w&&(w=new THREE.PropertyBinding(p,f[n],g[n]));u[v]=w}}else b[q]!==t&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=d},remove:function(a){for(var b=this._objects,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var l=arguments[g],k=l.uuid,m=d[k];if(void 0!==m&&m>=c){var p=c++,n=b[p];d[n.uuid]=
|
|
|
|
-m;b[m]=n;d[k]=p;b[p]=l;l=0;for(k=f;l!==k;++l){var n=e[l],q=n[m];n[m]=n[p];n[p]=q}}}this.nCachedObjects_=c},uncache:function(a){for(var b=this._objects,c=b.length,d=this.nCachedObjects_,e=this._indicesByUUID,f=this._bindings,g=f.length,h=0,l=arguments.length;h!==l;++h){var k=arguments[h].uuid,m=e[k];if(void 0!==m)if(delete e[k],m<d){var k=--d,p=b[k],n=--c,q=b[n];e[p.uuid]=m;b[m]=p;e[q.uuid]=k;b[k]=q;b.pop();p=0;for(q=g;p!==q;++p){var r=f[p],t=r[n];r[m]=r[k];r[k]=t;r.pop()}}else for(n=--c,q=b[n],e[q.uuid]=
|
|
|
|
|
|
+THREE.AnimationObjectGroup.prototype={constructor:THREE.AnimationObjectGroup,add:function(a){for(var b=this._objects,c=b.length,d=this.nCachedObjects_,e=this._indicesByUUID,f=this._paths,g=this._parsedPaths,h=this._bindings,l=h.length,k=0,m=arguments.length;k!==m;++k){var p=arguments[k],n=p.uuid,q=e[n];if(void 0===q){q=c++;e[n]=q;b.push(p);for(var n=0,r=l;n!==r;++n)h[n].push(new THREE.PropertyBinding(p,f[n],g[n]))}else if(q<d){var u=b[q],w=--d,r=b[w];e[r.uuid]=q;b[q]=r;e[n]=w;b[w]=p;n=0;for(r=l;n!==
|
|
|
|
+r;++n){var t=h[n],v=t[q];t[q]=t[w];void 0===v&&(v=new THREE.PropertyBinding(p,f[n],g[n]));t[w]=v}}else b[q]!==u&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=d},remove:function(a){for(var b=this._objects,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var l=arguments[g],k=l.uuid,m=d[k];if(void 0!==m&&m>=c){var p=c++,n=b[p];d[n.uuid]=
|
|
|
|
+m;b[m]=n;d[k]=p;b[p]=l;l=0;for(k=f;l!==k;++l){var n=e[l],q=n[m];n[m]=n[p];n[p]=q}}}this.nCachedObjects_=c},uncache:function(a){for(var b=this._objects,c=b.length,d=this.nCachedObjects_,e=this._indicesByUUID,f=this._bindings,g=f.length,h=0,l=arguments.length;h!==l;++h){var k=arguments[h].uuid,m=e[k];if(void 0!==m)if(delete e[k],m<d){var k=--d,p=b[k],n=--c,q=b[n];e[p.uuid]=m;b[m]=p;e[q.uuid]=k;b[k]=q;b.pop();p=0;for(q=g;p!==q;++p){var r=f[p],u=r[n];r[m]=r[k];r[k]=u;r.pop()}}else for(n=--c,q=b[n],e[q.uuid]=
|
|
m,b[m]=q,b.pop(),p=0,q=g;p!==q;++p)r=f[p],r[m]=r[n],r.pop()}this.nCachedObjects_=d},subscribe_:function(a,b){var c=this._bindingsIndicesByPath,d=c[a],e=this._bindings;if(void 0!==d)return e[d];var f=this._paths,g=this._parsedPaths,h=this._objects,l=this.nCachedObjects_,k=Array(h.length),d=e.length;c[a]=d;f.push(a);g.push(b);e.push(k);c=l;for(d=h.length;c!==d;++c)k[c]=new THREE.PropertyBinding(h[c],a,b);return k},unsubscribe_:function(a){var b=this._bindingsIndicesByPath,c=b[a];if(void 0!==c){var d=
|
|
m,b[m]=q,b.pop(),p=0,q=g;p!==q;++p)r=f[p],r[m]=r[n],r.pop()}this.nCachedObjects_=d},subscribe_:function(a,b){var c=this._bindingsIndicesByPath,d=c[a],e=this._bindings;if(void 0!==d)return e[d];var f=this._paths,g=this._parsedPaths,h=this._objects,l=this.nCachedObjects_,k=Array(h.length),d=e.length;c[a]=d;f.push(a);g.push(b);e.push(k);c=l;for(d=h.length;c!==d;++c)k[c]=new THREE.PropertyBinding(h[c],a,b);return k},unsubscribe_:function(a){var b=this._bindingsIndicesByPath,c=b[a];if(void 0!==c){var d=
|
|
this._paths,e=this._parsedPaths,f=this._bindings,g=f.length-1,h=f[g];b[a[g]]=c;f[c]=h;f.pop();e[c]=e[g];e.pop();d[c]=d[g];d.pop()}}};
|
|
this._paths,e=this._parsedPaths,f=this._bindings,g=f.length-1,h=f[g];b[a[g]]=c;f[c]=h;f.pop();e[c]=e[g];e.pop();d[c]=d[g];d.pop()}}};
|
|
THREE.AnimationUtils={arraySlice:function(a,b,c){return THREE.AnimationUtils.isTypedArray(a)?new a.constructor(a.subarray(b,c)):a.slice(b,c)},convertArray:function(a,b,c){return!a||!c&&a.constructor===b?a:"number"===typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a)},isTypedArray:function(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)},getKeyframeOrder:function(a){for(var b=a.length,c=Array(b),d=0;d!==b;++d)c[d]=d;c.sort(function(b,c){return a[b]-a[c]});return c},sortedArray:function(a,
|
|
THREE.AnimationUtils={arraySlice:function(a,b,c){return THREE.AnimationUtils.isTypedArray(a)?new a.constructor(a.subarray(b,c)):a.slice(b,c)},convertArray:function(a,b,c){return!a||!c&&a.constructor===b?a:"number"===typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a)},isTypedArray:function(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)},getKeyframeOrder:function(a){for(var b=a.length,c=Array(b),d=0;d!==b;++d)c[d]=d;c.sort(function(b,c){return a[b]-a[c]});return c},sortedArray:function(a,
|
|
@@ -373,10 +373,10 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
|
|
d(b);e.manager.itemError(a)},!1);void 0!==this.crossOrigin&&(g.crossOrigin=this.crossOrigin);e.manager.itemStart(a);g.src=a;return g},setCrossOrigin:function(a){this.crossOrigin=a},setPath:function(a){this.path=a}};THREE.JSONLoader=function(a){"boolean"===typeof a&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),a=void 0);this.manager=void 0!==a?a:THREE.DefaultLoadingManager;this.withCredentials=!1};
|
|
d(b);e.manager.itemError(a)},!1);void 0!==this.crossOrigin&&(g.crossOrigin=this.crossOrigin);e.manager.itemStart(a);g.src=a;return g},setCrossOrigin:function(a){this.crossOrigin=a},setPath:function(a){this.path=a}};THREE.JSONLoader=function(a){"boolean"===typeof a&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),a=void 0);this.manager=void 0!==a?a:THREE.DefaultLoadingManager;this.withCredentials=!1};
|
|
THREE.JSONLoader.prototype={constructor:THREE.JSONLoader,get statusDomElement(){void 0===this._statusDomElement&&(this._statusDomElement=document.createElement("div"));console.warn("THREE.JSONLoader: .statusDomElement has been removed.");return this._statusDomElement},load:function(a,b,c,d){var e=this,f=this.texturePath&&"string"===typeof this.texturePath?this.texturePath:THREE.Loader.prototype.extractUrlBase(a);c=new THREE.XHRLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.setWithCredentials(this.withCredentials);
|
|
THREE.JSONLoader.prototype={constructor:THREE.JSONLoader,get statusDomElement(){void 0===this._statusDomElement&&(this._statusDomElement=document.createElement("div"));console.warn("THREE.JSONLoader: .statusDomElement has been removed.");return this._statusDomElement},load:function(a,b,c,d){var e=this,f=this.texturePath&&"string"===typeof this.texturePath?this.texturePath:THREE.Loader.prototype.extractUrlBase(a);c=new THREE.XHRLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.setWithCredentials(this.withCredentials);
|
|
c.load(a,function(c){c=JSON.parse(c);var d=c.metadata;if(void 0!==d&&(d=d.type,void 0!==d)){if("object"===d.toLowerCase()){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.ObjectLoader instead.");return}if("scene"===d.toLowerCase()){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.SceneLoader instead.");return}}c=e.parse(c,f);b(c.geometry,c.materials)})},setCrossOrigin:function(a){this.crossOrigin=a},setTexturePath:function(a){this.texturePath=a},parse:function(a,
|
|
c.load(a,function(c){c=JSON.parse(c);var d=c.metadata;if(void 0!==d&&(d=d.type,void 0!==d)){if("object"===d.toLowerCase()){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.ObjectLoader instead.");return}if("scene"===d.toLowerCase()){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.SceneLoader instead.");return}}c=e.parse(c,f);b(c.geometry,c.materials)})},setCrossOrigin:function(a){this.crossOrigin=a},setTexturePath:function(a){this.texturePath=a},parse:function(a,
|
|
-b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,l,k,m,p,n,q,r,t,v,u,w=a.faces;m=a.vertices;var F=a.normals,x=a.colors,A=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&A++;for(d=0;d<A;d++)c.faceVertexUvs[d]=[]}l=0;for(k=m.length;l<k;)d=new THREE.Vector3,d.x=m[l++]*b,d.y=m[l++]*b,d.z=m[l++]*b,c.vertices.push(d);l=0;for(k=w.length;l<k;)if(b=w[l++],q=b&1,h=b&2,d=b&8,p=b&16,r=b&32,m=b&64,b&=128,q){q=new THREE.Face3;q.a=w[l];q.b=w[l+1];q.c=w[l+3];t=new THREE.Face3;
|
|
|
|
-t.a=w[l+1];t.b=w[l+2];t.c=w[l+3];l+=4;h&&(h=w[l++],q.materialIndex=h,t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<A;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)n=w[l++],u=v[2*n],n=v[2*n+1],u=new THREE.Vector2(u,n),2!==g&&c.faceVertexUvs[d][h].push(u),0!==g&&c.faceVertexUvs[d][h+1].push(u);p&&(p=3*w[l++],q.normal.set(F[p++],F[p++],F[p]),t.normal.copy(q.normal));if(r)for(d=0;4>d;d++)p=3*w[l++],r=new THREE.Vector3(F[p++],F[p++],F[p]),2!==d&&q.vertexNormals.push(r),
|
|
|
|
-0!==d&&t.vertexNormals.push(r);m&&(m=w[l++],m=x[m],q.color.setHex(m),t.color.setHex(m));if(b)for(d=0;4>d;d++)m=w[l++],m=x[m],2!==d&&q.vertexColors.push(new THREE.Color(m)),0!==d&&t.vertexColors.push(new THREE.Color(m));c.faces.push(q);c.faces.push(t)}else{q=new THREE.Face3;q.a=w[l++];q.b=w[l++];q.c=w[l++];h&&(h=w[l++],q.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<A;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)n=w[l++],u=v[2*n],n=v[2*n+1],u=new THREE.Vector2(u,n),c.faceVertexUvs[d][h].push(u);
|
|
|
|
-p&&(p=3*w[l++],q.normal.set(F[p++],F[p++],F[p]));if(r)for(d=0;3>d;d++)p=3*w[l++],r=new THREE.Vector3(F[p++],F[p++],F[p]),q.vertexNormals.push(r);m&&(m=w[l++],q.color.setHex(x[m]));if(b)for(d=0;3>d;d++)m=w[l++],q.vertexColors.push(new THREE.Color(x[m]));c.faces.push(q)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+
|
|
|
|
|
|
+b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,l,k,m,p,n,q,r,u,w,t,v=a.faces;m=a.vertices;var F=a.normals,x=a.colors,A=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&A++;for(d=0;d<A;d++)c.faceVertexUvs[d]=[]}l=0;for(k=m.length;l<k;)d=new THREE.Vector3,d.x=m[l++]*b,d.y=m[l++]*b,d.z=m[l++]*b,c.vertices.push(d);l=0;for(k=v.length;l<k;)if(b=v[l++],q=b&1,h=b&2,d=b&8,p=b&16,r=b&32,m=b&64,b&=128,q){q=new THREE.Face3;q.a=v[l];q.b=v[l+1];q.c=v[l+3];u=new THREE.Face3;
|
|
|
|
+u.a=v[l+1];u.b=v[l+2];u.c=v[l+3];l+=4;h&&(h=v[l++],q.materialIndex=h,u.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<A;d++)for(w=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)n=v[l++],t=w[2*n],n=w[2*n+1],t=new THREE.Vector2(t,n),2!==g&&c.faceVertexUvs[d][h].push(t),0!==g&&c.faceVertexUvs[d][h+1].push(t);p&&(p=3*v[l++],q.normal.set(F[p++],F[p++],F[p]),u.normal.copy(q.normal));if(r)for(d=0;4>d;d++)p=3*v[l++],r=new THREE.Vector3(F[p++],F[p++],F[p]),2!==d&&q.vertexNormals.push(r),
|
|
|
|
+0!==d&&u.vertexNormals.push(r);m&&(m=v[l++],m=x[m],q.color.setHex(m),u.color.setHex(m));if(b)for(d=0;4>d;d++)m=v[l++],m=x[m],2!==d&&q.vertexColors.push(new THREE.Color(m)),0!==d&&u.vertexColors.push(new THREE.Color(m));c.faces.push(q);c.faces.push(u)}else{q=new THREE.Face3;q.a=v[l++];q.b=v[l++];q.c=v[l++];h&&(h=v[l++],q.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<A;d++)for(w=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)n=v[l++],t=w[2*n],n=w[2*n+1],t=new THREE.Vector2(t,n),c.faceVertexUvs[d][h].push(t);
|
|
|
|
+p&&(p=3*v[l++],q.normal.set(F[p++],F[p++],F[p]));if(r)for(d=0;3>d;d++)p=3*v[l++],r=new THREE.Vector3(F[p++],F[p++],F[p]),q.vertexNormals.push(r);m&&(m=v[l++],q.color.setHex(x[m]));if(b)for(d=0;3>d;d++)m=v[l++],q.vertexColors.push(new THREE.Color(x[m]));c.faces.push(q)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+
|
|
2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+
|
|
2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+
|
|
") should match.")})();(function(b){if(void 0!==a.morphTargets)for(var d=0,g=a.morphTargets.length;d<g;d++){c.morphTargets[d]={};c.morphTargets[d].name=a.morphTargets[d].name;c.morphTargets[d].vertices=[];for(var h=c.morphTargets[d].vertices,l=a.morphTargets[d].vertices,k=0,m=l.length;k<m;k+=3){var p=new THREE.Vector3;p.x=l[k]*b;p.y=l[k+1]*b;p.z=l[k+2]*b;h.push(p)}}if(void 0!==a.morphColors&&0<a.morphColors.length)for(console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'),
|
|
") should match.")})();(function(b){if(void 0!==a.morphTargets)for(var d=0,g=a.morphTargets.length;d<g;d++){c.morphTargets[d]={};c.morphTargets[d].name=a.morphTargets[d].name;c.morphTargets[d].vertices=[];for(var h=c.morphTargets[d].vertices,l=a.morphTargets[d].vertices,k=0,m=l.length;k<m;k+=3){var p=new THREE.Vector3;p.x=l[k]*b;p.y=l[k+1]*b;p.z=l[k+2]*b;h.push(p)}}if(void 0!==a.morphColors&&0<a.morphColors.length)for(console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'),
|
|
b=c.faces,h=a.morphColors[0].colors,d=0,g=b.length;d<g;d++)b[d].color.fromArray(h,3*d)})(d);(function(){var b=[],d=[];void 0!==a.animation&&d.push(a.animation);void 0!==a.animations&&(a.animations.length?d=d.concat(a.animations):d.push(a.animations));for(var g=0;g<d.length;g++){var h=THREE.AnimationClip.parseAnimation(d[g],c.bones);h&&b.push(h)}c.morphTargets&&(d=THREE.AnimationClip.CreateClipsFromMorphTargetSequences(c.morphTargets,10),b=b.concat(d));0<b.length&&(c.animations=b)})();c.computeFaceNormals();
|
|
b=c.faces,h=a.morphColors[0].colors,d=0,g=b.length;d<g;d++)b[d].color.fromArray(h,3*d)})(d);(function(){var b=[],d=[];void 0!==a.animation&&d.push(a.animation);void 0!==a.animations&&(a.animations.length?d=d.concat(a.animations):d.push(a.animations));for(var g=0;g<d.length;g++){var h=THREE.AnimationClip.parseAnimation(d[g],c.bones);h&&b.push(h)}c.morphTargets&&(d=THREE.AnimationClip.CreateClipsFromMorphTargetSequences(c.morphTargets,10),b=b.concat(d));0<b.length&&(c.animations=b)})();c.computeFaceNormals();
|
|
@@ -473,18 +473,18 @@ THREE.Points.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ra
|
|
b.intersectsBox(g.boundingBox)){var h=h/((this.scale.x+this.scale.y+this.scale.z)/3),l=h*h,h=new THREE.Vector3;if(g instanceof THREE.BufferGeometry){var k=g.index,g=g.attributes.position.array;if(null!==k)for(var m=k.array,k=0,p=m.length;k<p;k++){var n=m[k];h.fromArray(g,3*n);e(h,n)}else for(k=0,m=g.length/3;k<m;k++)h.fromArray(g,3*k),e(h,k)}else for(h=g.vertices,k=0,m=h.length;k<m;k++)e(h[k],k)}}}();THREE.Points.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};
|
|
b.intersectsBox(g.boundingBox)){var h=h/((this.scale.x+this.scale.y+this.scale.z)/3),l=h*h,h=new THREE.Vector3;if(g instanceof THREE.BufferGeometry){var k=g.index,g=g.attributes.position.array;if(null!==k)for(var m=k.array,k=0,p=m.length;k<p;k++){var n=m[k];h.fromArray(g,3*n);e(h,n)}else for(k=0,m=g.length/3;k<m;k++)h.fromArray(g,3*k),e(h,k)}else for(h=g.vertices,k=0,m=h.length;k<m;k++)e(h[k],k)}}}();THREE.Points.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};
|
|
THREE.Line=function(a,b,c){if(1===c)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new THREE.LineSegments(a,b);THREE.Object3D.call(this);this.type="Line";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()})};THREE.Line.prototype=Object.create(THREE.Object3D.prototype);THREE.Line.prototype.constructor=THREE.Line;
|
|
THREE.Line=function(a,b,c){if(1===c)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new THREE.LineSegments(a,b);THREE.Object3D.call(this);this.type="Line";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()})};THREE.Line.prototype=Object.create(THREE.Object3D.prototype);THREE.Line.prototype.constructor=THREE.Line;
|
|
THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.intersectsSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,l=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(g instanceof
|
|
THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.intersectsSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,l=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(g instanceof
|
|
-THREE.BufferGeometry){var n=g.index,q=g.attributes;if(null!==n)for(var g=n.array,q=q.position.array,n=0,r=g.length-1;n<r;n+=p){var t=g[n+1];h.fromArray(q,3*g[n]);l.fromArray(q,3*t);t=b.distanceSqToSegment(h,l,m,k);t>f||(m.applyMatrix4(this.matrixWorld),t=d.ray.origin.distanceTo(m),t<d.near||t>d.far||e.push({distance:t,point:k.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this}))}else for(q=q.position.array,n=0,r=q.length/3-1;n<r;n+=p)h.fromArray(q,3*n),l.fromArray(q,
|
|
|
|
-3*n+3),t=b.distanceSqToSegment(h,l,m,k),t>f||(m.applyMatrix4(this.matrixWorld),t=d.ray.origin.distanceTo(m),t<d.near||t>d.far||e.push({distance:t,point:k.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,l=h.length,n=0;n<l-1;n+=p)t=b.distanceSqToSegment(h[n],h[n+1],m,k),t>f||(m.applyMatrix4(this.matrixWorld),t=d.ray.origin.distanceTo(m),t<d.near||t>d.far||e.push({distance:t,point:k.clone().applyMatrix4(this.matrixWorld),
|
|
|
|
|
|
+THREE.BufferGeometry){var n=g.index,q=g.attributes;if(null!==n)for(var g=n.array,q=q.position.array,n=0,r=g.length-1;n<r;n+=p){var u=g[n+1];h.fromArray(q,3*g[n]);l.fromArray(q,3*u);u=b.distanceSqToSegment(h,l,m,k);u>f||(m.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(m),u<d.near||u>d.far||e.push({distance:u,point:k.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this}))}else for(q=q.position.array,n=0,r=q.length/3-1;n<r;n+=p)h.fromArray(q,3*n),l.fromArray(q,
|
|
|
|
+3*n+3),u=b.distanceSqToSegment(h,l,m,k),u>f||(m.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(m),u<d.near||u>d.far||e.push({distance:u,point:k.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,l=h.length,n=0;n<l-1;n+=p)u=b.distanceSqToSegment(h[n],h[n+1],m,k),u>f||(m.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(m),u<d.near||u>d.far||e.push({distance:u,point:k.clone().applyMatrix4(this.matrixWorld),
|
|
index:n,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};THREE.LineStrip=0;THREE.LinePieces=1;THREE.LineSegments=function(a,b){THREE.Line.call(this,a,b);this.type="LineSegments"};THREE.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegments.prototype.constructor=THREE.LineSegments;
|
|
index:n,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};THREE.LineStrip=0;THREE.LinePieces=1;THREE.LineSegments=function(a,b){THREE.Line.call(this,a,b);this.type="LineSegments"};THREE.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegments.prototype.constructor=THREE.LineSegments;
|
|
THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);THREE.Mesh.prototype.constructor=THREE.Mesh;
|
|
THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);THREE.Mesh.prototype.constructor=THREE.Mesh;
|
|
THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
|
|
THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
|
|
THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
|
|
THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
|
|
-THREE.Mesh.prototype.raycast=function(){function a(a,b,c,d,e,f,g){THREE.Triangle.barycoordFromPoint(a,b,c,d,t);e.multiplyScalar(t.x);f.multiplyScalar(t.y);g.multiplyScalar(t.z);e.add(f).add(g);return e.clone()}function b(a,b,c,d,e,f,g){var h=a.material;if(null===(h.side===THREE.BackSide?c.intersectTriangle(f,e,d,!0,g):c.intersectTriangle(d,e,f,h.side!==THREE.DoubleSide,g)))return null;u.copy(g);u.applyMatrix4(a.matrixWorld);c=b.ray.origin.distanceTo(u);return c<b.near||c>b.far?null:{distance:c,point:u.clone(),
|
|
|
|
-object:a}}function c(c,d,e,f,k,m,p,u){g.fromArray(f,3*m);h.fromArray(f,3*p);l.fromArray(f,3*u);if(c=b(c,d,e,g,h,l,v))k&&(n.fromArray(k,2*m),q.fromArray(k,2*p),r.fromArray(k,2*u),c.uv=a(v,g,h,l,n,q,r)),c.face=new THREE.Face3(m,p,u,THREE.Triangle.normal(g,h,l)),c.faceIndex=m;return c}var d=new THREE.Matrix4,e=new THREE.Ray,f=new THREE.Sphere,g=new THREE.Vector3,h=new THREE.Vector3,l=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector2,q=new THREE.Vector2,
|
|
|
|
-r=new THREE.Vector2,t=new THREE.Vector3,v=new THREE.Vector3,u=new THREE.Vector3;return function(u,t){var x=this.geometry,A=this.material;if(void 0!==A){null===x.boundingSphere&&x.computeBoundingSphere();var z=this.matrixWorld;f.copy(x.boundingSphere);f.applyMatrix4(z);if(!1!==u.ray.intersectsSphere(f)&&(d.getInverse(z),e.copy(u.ray).applyMatrix4(d),null===x.boundingBox||!1!==e.intersectsBox(x.boundingBox))){var B,y;if(x instanceof THREE.BufferGeometry){var H,D,A=x.index,z=x.attributes,x=z.position.array;
|
|
|
|
-void 0!==z.uv&&(B=z.uv.array);if(null!==A)for(var z=A.array,E=0,Q=z.length;E<Q;E+=3){if(A=z[E],H=z[E+1],D=z[E+2],y=c(this,u,e,x,B,A,H,D))y.faceIndex=Math.floor(E/3),t.push(y)}else for(E=0,Q=x.length;E<Q;E+=9)if(A=E/3,H=A+1,D=A+2,y=c(this,u,e,x,B,A,H,D))y.index=A,t.push(y)}else if(x instanceof THREE.Geometry){var M,N,z=A instanceof THREE.MeshFaceMaterial,E=!0===z?A.materials:null,Q=x.vertices;H=x.faces;D=x.faceVertexUvs[0];0<D.length&&(B=D);for(var G=0,J=H.length;G<J;G++){var K=H[G];y=!0===z?E[K.materialIndex]:
|
|
|
|
-A;if(void 0!==y){D=Q[K.a];M=Q[K.b];N=Q[K.c];if(!0===y.morphTargets){y=x.morphTargets;var O=this.morphTargetInfluences;g.set(0,0,0);h.set(0,0,0);l.set(0,0,0);for(var R=0,P=y.length;R<P;R++){var L=O[R];if(0!==L){var C=y[R].vertices;g.addScaledVector(k.subVectors(C[K.a],D),L);h.addScaledVector(m.subVectors(C[K.b],M),L);l.addScaledVector(p.subVectors(C[K.c],N),L)}}g.add(D);h.add(M);l.add(N);D=g;M=h;N=l}if(y=b(this,u,e,D,M,N,v))B&&(O=B[G],n.copy(O[0]),q.copy(O[1]),r.copy(O[2]),y.uv=a(v,D,M,N,n,q,r)),y.face=
|
|
|
|
-K,y.faceIndex=G,t.push(y)}}}}}}}();THREE.Mesh.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
|
|
|
|
|
|
+THREE.Mesh.prototype.raycast=function(){function a(a,b,c,d,e,f,g){THREE.Triangle.barycoordFromPoint(a,b,c,d,u);e.multiplyScalar(u.x);f.multiplyScalar(u.y);g.multiplyScalar(u.z);e.add(f).add(g);return e.clone()}function b(a,b,c,d,e,f,g){var h=a.material;if(null===(h.side===THREE.BackSide?c.intersectTriangle(f,e,d,!0,g):c.intersectTriangle(d,e,f,h.side!==THREE.DoubleSide,g)))return null;t.copy(g);t.applyMatrix4(a.matrixWorld);c=b.ray.origin.distanceTo(t);return c<b.near||c>b.far?null:{distance:c,point:t.clone(),
|
|
|
|
+object:a}}function c(c,d,e,f,k,m,p,t){g.fromArray(f,3*m);h.fromArray(f,3*p);l.fromArray(f,3*t);if(c=b(c,d,e,g,h,l,w))k&&(n.fromArray(k,2*m),q.fromArray(k,2*p),r.fromArray(k,2*t),c.uv=a(w,g,h,l,n,q,r)),c.face=new THREE.Face3(m,p,t,THREE.Triangle.normal(g,h,l)),c.faceIndex=m;return c}var d=new THREE.Matrix4,e=new THREE.Ray,f=new THREE.Sphere,g=new THREE.Vector3,h=new THREE.Vector3,l=new THREE.Vector3,k=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector2,q=new THREE.Vector2,
|
|
|
|
+r=new THREE.Vector2,u=new THREE.Vector3,w=new THREE.Vector3,t=new THREE.Vector3;return function(t,u){var x=this.geometry,A=this.material;if(void 0!==A){null===x.boundingSphere&&x.computeBoundingSphere();var z=this.matrixWorld;f.copy(x.boundingSphere);f.applyMatrix4(z);if(!1!==t.ray.intersectsSphere(f)&&(d.getInverse(z),e.copy(t.ray).applyMatrix4(d),null===x.boundingBox||!1!==e.intersectsBox(x.boundingBox))){var B,y;if(x instanceof THREE.BufferGeometry){var H,D,A=x.index,z=x.attributes,x=z.position.array;
|
|
|
|
+void 0!==z.uv&&(B=z.uv.array);if(null!==A)for(var z=A.array,E=0,Q=z.length;E<Q;E+=3){if(A=z[E],H=z[E+1],D=z[E+2],y=c(this,t,e,x,B,A,H,D))y.faceIndex=Math.floor(E/3),u.push(y)}else for(E=0,Q=x.length;E<Q;E+=9)if(A=E/3,H=A+1,D=A+2,y=c(this,t,e,x,B,A,H,D))y.index=A,u.push(y)}else if(x instanceof THREE.Geometry){var M,N,z=A instanceof THREE.MeshFaceMaterial,E=!0===z?A.materials:null,Q=x.vertices;H=x.faces;D=x.faceVertexUvs[0];0<D.length&&(B=D);for(var G=0,J=H.length;G<J;G++){var K=H[G];y=!0===z?E[K.materialIndex]:
|
|
|
|
+A;if(void 0!==y){D=Q[K.a];M=Q[K.b];N=Q[K.c];if(!0===y.morphTargets){y=x.morphTargets;var O=this.morphTargetInfluences;g.set(0,0,0);h.set(0,0,0);l.set(0,0,0);for(var R=0,P=y.length;R<P;R++){var L=O[R];if(0!==L){var C=y[R].vertices;g.addScaledVector(k.subVectors(C[K.a],D),L);h.addScaledVector(m.subVectors(C[K.b],M),L);l.addScaledVector(p.subVectors(C[K.c],N),L)}}g.add(D);h.add(M);l.add(N);D=g;M=h;N=l}if(y=b(this,t,e,D,M,N,w))B&&(O=B[G],n.copy(O[0]),q.copy(O[1]),r.copy(O[2]),y.uv=a(w,D,M,N,n,q,r)),y.face=
|
|
|
|
+K,y.faceIndex=G,u.push(y)}}}}}}}();THREE.Mesh.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
|
|
THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(a=Math.sqrt(4*this.bones.length),a=THREE.Math.nextPowerOfTwo(Math.ceil(a)),this.boneTextureHeight=this.boneTextureWidth=a=Math.max(a,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType)):
|
|
THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(a=Math.sqrt(4*this.bones.length),a=THREE.Math.nextPowerOfTwo(Math.ceil(a)),this.boneTextureHeight=this.boneTextureWidth=a=Math.max(a,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType)):
|
|
this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};
|
|
this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};
|
|
THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}};
|
|
THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}};
|
|
@@ -587,80 +587,80 @@ THREE.ShaderChunk.common,"vec4 pack1K ( float depth ) {\n depth /= 1000.0;\n
|
|
THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===P&&(a*=d,b*=d,c*=d);s.clearColor(a,b,c,d)}function c(){I.init();s.viewport(fa,ga,ha,ia);b(C.r,C.g,C.b,X)}function d(){ja=ua=null;ka="";qa=-1;la=!0;I.reset()}function e(a){a.preventDefault();d();c();S.clear()}function f(a){a=a.target;a.removeEventListener("dispose",f);a:{var b=S.get(a);if(a.image&&b.__image__webglTextureCube)s.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;s.deleteTexture(b.__webglTexture)}S.delete(a)}da.textures--}
|
|
THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===P&&(a*=d,b*=d,c*=d);s.clearColor(a,b,c,d)}function c(){I.init();s.viewport(fa,ga,ha,ia);b(C.r,C.g,C.b,X)}function d(){ja=ua=null;ka="";qa=-1;la=!0;I.reset()}function e(a){a.preventDefault();d();c();S.clear()}function f(a){a=a.target;a.removeEventListener("dispose",f);a:{var b=S.get(a);if(a.image&&b.__image__webglTextureCube)s.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;s.deleteTexture(b.__webglTexture)}S.delete(a)}da.textures--}
|
|
function g(a){a=a.target;a.removeEventListener("dispose",g);var b=S.get(a),c=S.get(a.texture);if(a&&void 0!==c.__webglTexture){s.deleteTexture(c.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(c=0;6>c;c++)s.deleteFramebuffer(b.__webglFramebuffer[c]),s.deleteRenderbuffer(b.__webglRenderbuffer[c]);else s.deleteFramebuffer(b.__webglFramebuffer),s.deleteRenderbuffer(b.__webglRenderbuffer);S.delete(a.texture);S.delete(a)}da.textures--}function h(a){a=a.target;a.removeEventListener("dispose",
|
|
function g(a){a=a.target;a.removeEventListener("dispose",g);var b=S.get(a),c=S.get(a.texture);if(a&&void 0!==c.__webglTexture){s.deleteTexture(c.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(c=0;6>c;c++)s.deleteFramebuffer(b.__webglFramebuffer[c]),s.deleteRenderbuffer(b.__webglRenderbuffer[c]);else s.deleteFramebuffer(b.__webglFramebuffer),s.deleteRenderbuffer(b.__webglRenderbuffer);S.delete(a.texture);S.delete(a)}da.textures--}function h(a){a=a.target;a.removeEventListener("dispose",
|
|
h);l(a);S.delete(a)}function l(a){var b=S.get(a).program;a.program=void 0;void 0!==b&&ma.releaseProgram(b)}function k(a,b){return b[0]-a[0]}function m(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function n(a,b,c,d,e){var f;c.transparent?
|
|
h);l(a);S.delete(a)}function l(a){var b=S.get(a).program;a.program=void 0;void 0!==b&&ma.releaseProgram(b)}function k(a,b){return b[0]-a[0]}function m(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function n(a,b,c,d,e){var f;c.transparent?
|
|
-(d=aa,f=++na):(d=Y,f=++ea);f=d[f];void 0!==f?(f.id=a.id,f.object=a,f.geometry=b,f.material=c,f.z=V.z,f.group=e):(f={id:a.id,object:a,geometry:b,material:c,z:V.z,group:e},d.push(f))}function q(a,b){if(!1!==a.visible){if(a.layers.test(b.layers))if(a instanceof THREE.Light)U.push(a);else if(a instanceof THREE.Sprite)!1!==a.frustumCulled&&!0!==va.intersectsObject(a)||$.push(a);else if(a instanceof THREE.LensFlare)wa.push(a);else if(a instanceof THREE.ImmediateRenderObject)!0===Z.sortObjects&&(V.setFromMatrixPosition(a.matrixWorld),
|
|
|
|
-V.applyProjection(ra)),n(a,null,a.material,V.z,null);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Points)if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),!1===a.frustumCulled||!0===va.intersectsObject(a)){var c=a.material;if(!0===c.visible){!0===Z.sortObjects&&(V.setFromMatrixPosition(a.matrixWorld),V.applyProjection(ra));var d=oa.update(a);if(c instanceof THREE.MeshFaceMaterial)for(var e=d.groups,f=c.materials,c=0,g=e.length;c<g;c++){var h=e[c],l=f[h.materialIndex];
|
|
|
|
-!0===l.visible&&n(a,d,l,V.z,h)}else n(a,d,c,V.z,null)}}d=a.children;c=0;for(g=d.length;c<g;c++)q(d[c],b)}}function r(a,b,c,d,e){for(var f=0,g=a.length;f<g;f++){var h=a[f],l=h.object,k=h.geometry,n=void 0===e?h.material:e,h=h.group;l.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l.normalMatrix.getNormalMatrix(l.modelViewMatrix);if(l instanceof THREE.ImmediateRenderObject){t(n);var m=v(b,c,d,n,l);ka="";l.render(function(a){Z.renderBufferImmediate(a,m,n)})}else Z.renderBufferDirect(b,
|
|
|
|
-c,d,k,n,l,h)}}function t(a){a.side!==THREE.DoubleSide?I.enable(s.CULL_FACE):I.disable(s.CULL_FACE);I.setFlipSided(a.side===THREE.BackSide);!0===a.transparent?I.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):I.setBlending(THREE.NoBlending);I.setDepthFunc(a.depthFunc);I.setDepthTest(a.depthTest);I.setDepthWrite(a.depthWrite);I.setColorWrite(a.colorWrite);I.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}
|
|
|
|
-function v(a,b,c,d,e){sa=0;var f=S.get(d);void 0===f.program&&(d.needsUpdate=!0);void 0!==f.lightsHash&&f.lightsHash!==W.hash&&(d.needsUpdate=!0);if(d.needsUpdate){a:{var g=S.get(d),k=ma.getParameters(d,b,c,e),n=ma.getProgramCode(d,k),m=g.program,q=!0;if(void 0===m)d.addEventListener("dispose",h);else if(m.code!==n)l(d);else if(void 0!==k.shaderID)break a;else q=!1;q&&(k.shaderID?(m=THREE.ShaderLib[k.shaderID],g.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(m.uniforms),vertexShader:m.vertexShader,
|
|
|
|
-fragmentShader:m.fragmentShader}):g.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader},d.__webglShader=g.__webglShader,m=ma.acquireProgram(d,k,n),g.program=m,d.program=m);k=m.getAttributes();if(d.morphTargets)for(n=d.numSupportedMorphTargets=0;n<Z.maxMorphTargets;n++)0<=k["morphTarget"+n]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(n=d.numSupportedMorphNormals=0;n<Z.maxMorphNormals;n++)0<=k["morphNormal"+n]&&d.numSupportedMorphNormals++;
|
|
|
|
-g.uniformsList=[];var k=g.__webglShader.uniforms,n=g.program.getUniforms(),p;for(p in k)(m=n[p])&&g.uniformsList.push([g.__webglShader.uniforms[p],m]);if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhysicalMaterial||d.lights)g.lightsHash=W.hash,k.ambientLightColor.value=W.ambient,k.directionalLights.value=W.directional,k.pointLights.value=W.point,k.spotLights.value=W.spot,k.hemisphereLights.value=W.hemi}d.needsUpdate=!1}m=n=q=!1;g=f.program;
|
|
|
|
-p=g.getUniforms();k=f.__webglShader.uniforms;g.id!==ua&&(s.useProgram(g.program),ua=g.id,m=n=q=!0);d.id!==qa&&(qa=d.id,n=!0);if(q||a!==ja)s.uniformMatrix4fv(p.projectionMatrix,!1,a.projectionMatrix.elements),ba.logarithmicDepthBuffer&&s.uniform1f(p.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==ja&&(ja=a,la=n=!0),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshPhysicalMaterial||d.envMap)&&void 0!==p.cameraPosition&&(V.setFromMatrixPosition(a.matrixWorld),
|
|
|
|
-s.uniform3f(p.cameraPosition,V.x,V.y,V.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshPhysicalMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&void 0!==p.viewMatrix&&s.uniformMatrix4fv(p.viewMatrix,!1,a.matrixWorldInverse.elements);d.skinning&&(e.bindMatrix&&void 0!==p.bindMatrix&&s.uniformMatrix4fv(p.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&void 0!==p.bindMatrixInverse&&s.uniformMatrix4fv(p.bindMatrixInverse,
|
|
|
|
-!1,e.bindMatrixInverse.elements),ba.floatVertexTextures&&e.skeleton&&e.skeleton.useVertexTexture?(void 0!==p.boneTexture&&(q=u(),s.uniform1i(p.boneTexture,q),Z.setTexture(e.skeleton.boneTexture,q)),void 0!==p.boneTextureWidth&&s.uniform1i(p.boneTextureWidth,e.skeleton.boneTextureWidth),void 0!==p.boneTextureHeight&&s.uniform1i(p.boneTextureHeight,e.skeleton.boneTextureHeight)):e.skeleton&&e.skeleton.boneMatrices&&void 0!==p.boneGlobalMatrices&&s.uniformMatrix4fv(p.boneGlobalMatrices,!1,e.skeleton.boneMatrices));
|
|
|
|
-if(n){c&&d.fog&&(k.fogColor.value=c.color,c instanceof THREE.Fog?(k.fogNear.value=c.near,k.fogFar.value=c.far):c instanceof THREE.FogExp2&&(k.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhysicalMaterial||d.lights)la&&(la=!1,m=!0),c=m,k.ambientLightColor.needsUpdate=c,k.directionalLights.needsUpdate=c,k.pointLights.needsUpdate=c,k.spotLights.needsUpdate=c,k.hemisphereLights.needsUpdate=c;if(d instanceof THREE.MeshBasicMaterial||
|
|
|
|
|
|
+(d=aa,f=++na):(d=Y,f=++ea);f=d[f];void 0!==f?(f.id=a.id,f.object=a,f.geometry=b,f.material=c,f.z=W.z,f.group=e):(f={id:a.id,object:a,geometry:b,material:c,z:W.z,group:e},d.push(f))}function q(a,b){if(!1!==a.visible){if(a.layers.test(b.layers))if(a instanceof THREE.Light)V.push(a);else if(a instanceof THREE.Sprite)!1!==a.frustumCulled&&!0!==va.intersectsObject(a)||$.push(a);else if(a instanceof THREE.LensFlare)wa.push(a);else if(a instanceof THREE.ImmediateRenderObject)!0===Z.sortObjects&&(W.setFromMatrixPosition(a.matrixWorld),
|
|
|
|
+W.applyProjection(ra)),n(a,null,a.material,W.z,null);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Points)if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),!1===a.frustumCulled||!0===va.intersectsObject(a)){var c=a.material;if(!0===c.visible){!0===Z.sortObjects&&(W.setFromMatrixPosition(a.matrixWorld),W.applyProjection(ra));var d=oa.update(a);if(c instanceof THREE.MeshFaceMaterial)for(var e=d.groups,f=c.materials,c=0,g=e.length;c<g;c++){var h=e[c],l=f[h.materialIndex];
|
|
|
|
+!0===l.visible&&n(a,d,l,W.z,h)}else n(a,d,c,W.z,null)}}d=a.children;c=0;for(g=d.length;c<g;c++)q(d[c],b)}}function r(a,b,c,d,e){for(var f=0,g=a.length;f<g;f++){var h=a[f],l=h.object,k=h.geometry,m=void 0===e?h.material:e,h=h.group;l.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l.normalMatrix.getNormalMatrix(l.modelViewMatrix);if(l instanceof THREE.ImmediateRenderObject){u(m);var n=w(b,c,d,m,l);ka="";l.render(function(a){Z.renderBufferImmediate(a,n,m)})}else Z.renderBufferDirect(b,
|
|
|
|
+c,d,k,m,l,h)}}function u(a){a.side!==THREE.DoubleSide?I.enable(s.CULL_FACE):I.disable(s.CULL_FACE);I.setFlipSided(a.side===THREE.BackSide);!0===a.transparent?I.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):I.setBlending(THREE.NoBlending);I.setDepthFunc(a.depthFunc);I.setDepthTest(a.depthTest);I.setDepthWrite(a.depthWrite);I.setColorWrite(a.colorWrite);I.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}
|
|
|
|
+function w(a,b,c,d,e){sa=0;var f=S.get(d);void 0===f.program&&(d.needsUpdate=!0);void 0!==f.lightsHash&&f.lightsHash!==T.hash&&(d.needsUpdate=!0);if(d.needsUpdate){a:{var g=S.get(d),k=ma.getParameters(d,T,c,e),m=ma.getProgramCode(d,k),n=g.program,q=!0;if(void 0===n)d.addEventListener("dispose",h);else if(n.code!==m)l(d);else if(void 0!==k.shaderID)break a;else q=!1;q&&(k.shaderID?(n=THREE.ShaderLib[k.shaderID],g.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,
|
|
|
|
+fragmentShader:n.fragmentShader}):g.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader},d.__webglShader=g.__webglShader,n=ma.acquireProgram(d,k,m),g.program=n,d.program=n);k=n.getAttributes();if(d.morphTargets)for(m=d.numSupportedMorphTargets=0;m<Z.maxMorphTargets;m++)0<=k["morphTarget"+m]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(m=d.numSupportedMorphNormals=0;m<Z.maxMorphNormals;m++)0<=k["morphNormal"+m]&&d.numSupportedMorphNormals++;
|
|
|
|
+g.uniformsList=[];var k=g.__webglShader.uniforms,m=g.program.getUniforms(),p;for(p in k)(n=m[p])&&g.uniformsList.push([g.__webglShader.uniforms[p],n]);if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhysicalMaterial||d.lights)g.lightsHash=T.hash,k.ambientLightColor.value=T.ambient,k.directionalLights.value=T.directional,k.pointLights.value=T.point,k.spotLights.value=T.spot,k.hemisphereLights.value=T.hemi}d.needsUpdate=!1}n=m=q=!1;g=f.program;
|
|
|
|
+p=g.getUniforms();k=f.__webglShader.uniforms;g.id!==ua&&(s.useProgram(g.program),ua=g.id,n=m=q=!0);d.id!==qa&&(qa=d.id,m=!0);if(q||a!==ja)s.uniformMatrix4fv(p.projectionMatrix,!1,a.projectionMatrix.elements),ba.logarithmicDepthBuffer&&s.uniform1f(p.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==ja&&(ja=a,la=m=!0),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshPhysicalMaterial||d.envMap)&&void 0!==p.cameraPosition&&(W.setFromMatrixPosition(a.matrixWorld),
|
|
|
|
+s.uniform3f(p.cameraPosition,W.x,W.y,W.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshPhysicalMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&void 0!==p.viewMatrix&&s.uniformMatrix4fv(p.viewMatrix,!1,a.matrixWorldInverse.elements);d.skinning&&(e.bindMatrix&&void 0!==p.bindMatrix&&s.uniformMatrix4fv(p.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&void 0!==p.bindMatrixInverse&&s.uniformMatrix4fv(p.bindMatrixInverse,
|
|
|
|
+!1,e.bindMatrixInverse.elements),ba.floatVertexTextures&&e.skeleton&&e.skeleton.useVertexTexture?(void 0!==p.boneTexture&&(q=t(),s.uniform1i(p.boneTexture,q),Z.setTexture(e.skeleton.boneTexture,q)),void 0!==p.boneTextureWidth&&s.uniform1i(p.boneTextureWidth,e.skeleton.boneTextureWidth),void 0!==p.boneTextureHeight&&s.uniform1i(p.boneTextureHeight,e.skeleton.boneTextureHeight)):e.skeleton&&e.skeleton.boneMatrices&&void 0!==p.boneGlobalMatrices&&s.uniformMatrix4fv(p.boneGlobalMatrices,!1,e.skeleton.boneMatrices));
|
|
|
|
+if(m){c&&d.fog&&(k.fogColor.value=c.color,c instanceof THREE.Fog?(k.fogNear.value=c.near,k.fogFar.value=c.far):c instanceof THREE.FogExp2&&(k.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhysicalMaterial||d.lights)la&&(la=!1,n=!0),c=n,k.ambientLightColor.needsUpdate=c,k.directionalLights.needsUpdate=c,k.pointLights.needsUpdate=c,k.spotLights.needsUpdate=c,k.hemisphereLights.needsUpdate=c;if(d instanceof THREE.MeshBasicMaterial||
|
|
d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshPhysicalMaterial){k.opacity.value=d.opacity;k.diffuse.value=d.color;d.emissive&&(k.emissive.value=d.emissive);k.map.value=d.map;k.specularMap.value=d.specularMap;k.alphaMap.value=d.alphaMap;d.aoMap&&(k.aoMap.value=d.aoMap,k.aoMapIntensity.value=d.aoMapIntensity);var r;d.map?r=d.map:d.specularMap?r=d.specularMap:d.displacementMap?r=d.displacementMap:d.normalMap?r=d.normalMap:d.bumpMap?r=d.bumpMap:d.alphaMap?
|
|
d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshPhysicalMaterial){k.opacity.value=d.opacity;k.diffuse.value=d.color;d.emissive&&(k.emissive.value=d.emissive);k.map.value=d.map;k.specularMap.value=d.specularMap;k.alphaMap.value=d.alphaMap;d.aoMap&&(k.aoMap.value=d.aoMap,k.aoMapIntensity.value=d.aoMapIntensity);var r;d.map?r=d.map:d.specularMap?r=d.specularMap:d.displacementMap?r=d.displacementMap:d.normalMap?r=d.normalMap:d.bumpMap?r=d.bumpMap:d.alphaMap?
|
|
r=d.alphaMap:d.emissiveMap&&(r=d.emissiveMap);void 0!==r&&(r instanceof THREE.WebGLRenderTarget&&(r=r.texture),c=r.offset,r=r.repeat,k.offsetRepeat.value.set(c.x,c.y,r.x,r.y));k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,
|
|
r=d.alphaMap:d.emissiveMap&&(r=d.emissiveMap);void 0!==r&&(r instanceof THREE.WebGLRenderTarget&&(r=r.texture),c=r.offset,r=r.repeat,k.offsetRepeat.value.set(c.x,c.y,r.x,r.y));k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,
|
|
k.opacity.value=d.opacity,k.dashSize.value=d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointsMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size*G,k.scale.value=E.height/2,k.map.value=d.map,null!==d.map&&(a=d.map.offset,r=d.map.repeat,k.offsetRepeat.value.set(a.x,a.y,r.x,r.y))):d instanceof THREE.MeshPhongMaterial?(k.specular.value=d.specular,k.shininess.value=Math.max(d.shininess,1E-4),d.lightMap&&(k.lightMap.value=d.lightMap,
|
|
k.opacity.value=d.opacity,k.dashSize.value=d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointsMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size*G,k.scale.value=E.height/2,k.map.value=d.map,null!==d.map&&(a=d.map.offset,r=d.map.repeat,k.offsetRepeat.value.set(a.x,a.y,r.x,r.y))):d instanceof THREE.MeshPhongMaterial?(k.specular.value=d.specular,k.shininess.value=Math.max(d.shininess,1E-4),d.lightMap&&(k.lightMap.value=d.lightMap,
|
|
k.lightMapIntensity.value=d.lightMapIntensity),d.emissiveMap&&(k.emissiveMap.value=d.emissiveMap),d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale),d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale)),d.displacementMap&&(k.displacementMap.value=d.displacementMap,k.displacementScale.value=d.displacementScale,k.displacementBias.value=d.displacementBias)):d instanceof THREE.MeshPhysicalMaterial?(k.roughness.value=d.roughness,k.metalness.value=d.metalness,
|
|
k.lightMapIntensity.value=d.lightMapIntensity),d.emissiveMap&&(k.emissiveMap.value=d.emissiveMap),d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale),d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale)),d.displacementMap&&(k.displacementMap.value=d.displacementMap,k.displacementScale.value=d.displacementScale,k.displacementBias.value=d.displacementBias)):d instanceof THREE.MeshPhysicalMaterial?(k.roughness.value=d.roughness,k.metalness.value=d.metalness,
|
|
d.roughnessMap&&(k.roughnessMap.value=d.roughnessMap),d.reflectivityMap&&(k.reflectivityMap.value=d.reflectivityMap),d.metalnessMap&&(k.metalnessMap.value=d.metalnessMap),d.lightMap&&(k.lightMap.value=d.lightMap,k.lightMapIntensity.value=d.lightMapIntensity),d.emissiveMap&&(k.emissiveMap.value=d.emissiveMap),d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale),d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale)),d.displacementMap&&(k.displacementMap.value=
|
|
d.roughnessMap&&(k.roughnessMap.value=d.roughnessMap),d.reflectivityMap&&(k.reflectivityMap.value=d.reflectivityMap),d.metalnessMap&&(k.metalnessMap.value=d.metalnessMap),d.lightMap&&(k.lightMap.value=d.lightMap,k.lightMapIntensity.value=d.lightMapIntensity),d.emissiveMap&&(k.emissiveMap.value=d.emissiveMap),d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale),d.normalMap&&(k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale)),d.displacementMap&&(k.displacementMap.value=
|
|
d.displacementMap,k.displacementScale.value=d.displacementScale,k.displacementBias.value=d.displacementBias),d.envMap&&(k.envMapIntensity.value=d.envMapIntensity)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(k.opacity.value=d.opacity);if(xa.enabled&&e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(a=d=0,r=b.length;a<r;a++)c=b[a],!0===c.castShadow&&(c instanceof THREE.PointLight||c instanceof THREE.SpotLight||
|
|
d.displacementMap,k.displacementScale.value=d.displacementScale,k.displacementBias.value=d.displacementBias),d.envMap&&(k.envMapIntensity.value=d.envMapIntensity)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(k.opacity.value=d.opacity);if(xa.enabled&&e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(a=d=0,r=b.length;a<r;a++)c=b[a],!0===c.castShadow&&(c instanceof THREE.PointLight||c instanceof THREE.SpotLight||
|
|
-c instanceof THREE.DirectionalLight)&&(n=c.shadow,c instanceof THREE.PointLight?(V.setFromMatrixPosition(c.matrixWorld).negate(),n.matrix.identity().setPosition(V),k.shadowDarkness.value[d]=-n.darkness):k.shadowDarkness.value[d]=n.darkness,k.shadowMatrix.value[d]=n.matrix,k.shadowMap.value[d]=n.map,k.shadowMapSize.value[d]=n.mapSize,k.shadowBias.value[d]=n.bias,d++);b=f.uniformsList;f=0;for(d=b.length;f<d;f++)if(a=b[f][0],!1!==a.needsUpdate)switch(c=a.type,k=a.value,r=b[f][1],c){case "1i":s.uniform1i(r,
|
|
|
|
|
|
+c instanceof THREE.DirectionalLight)&&(m=c.shadow,c instanceof THREE.PointLight?(W.setFromMatrixPosition(c.matrixWorld).negate(),m.matrix.identity().setPosition(W),k.shadowDarkness.value[d]=-m.darkness):k.shadowDarkness.value[d]=m.darkness,k.shadowMatrix.value[d]=m.matrix,k.shadowMap.value[d]=m.map,k.shadowMapSize.value[d]=m.mapSize,k.shadowBias.value[d]=m.bias,d++);b=f.uniformsList;f=0;for(d=b.length;f<d;f++)if(a=b[f][0],!1!==a.needsUpdate)switch(c=a.type,k=a.value,r=b[f][1],c){case "1i":s.uniform1i(r,
|
|
k);break;case "1f":s.uniform1f(r,k);break;case "2f":s.uniform2f(r,k[0],k[1]);break;case "3f":s.uniform3f(r,k[0],k[1],k[2]);break;case "4f":s.uniform4f(r,k[0],k[1],k[2],k[3]);break;case "1iv":s.uniform1iv(r,k);break;case "3iv":s.uniform3iv(r,k);break;case "1fv":s.uniform1fv(r,k);break;case "2fv":s.uniform2fv(r,k);break;case "3fv":s.uniform3fv(r,k);break;case "4fv":s.uniform4fv(r,k);break;case "Matrix3fv":s.uniformMatrix3fv(r,!1,k);break;case "Matrix4fv":s.uniformMatrix4fv(r,!1,k);break;case "i":s.uniform1i(r,
|
|
k);break;case "1f":s.uniform1f(r,k);break;case "2f":s.uniform2f(r,k[0],k[1]);break;case "3f":s.uniform3f(r,k[0],k[1],k[2]);break;case "4f":s.uniform4f(r,k[0],k[1],k[2],k[3]);break;case "1iv":s.uniform1iv(r,k);break;case "3iv":s.uniform3iv(r,k);break;case "1fv":s.uniform1fv(r,k);break;case "2fv":s.uniform2fv(r,k);break;case "3fv":s.uniform3fv(r,k);break;case "4fv":s.uniform4fv(r,k);break;case "Matrix3fv":s.uniformMatrix3fv(r,!1,k);break;case "Matrix4fv":s.uniformMatrix4fv(r,!1,k);break;case "i":s.uniform1i(r,
|
|
-k);break;case "f":s.uniform1f(r,k);break;case "v2":s.uniform2f(r,k.x,k.y);break;case "v3":s.uniform3f(r,k.x,k.y,k.z);break;case "v4":s.uniform4f(r,k.x,k.y,k.z,k.w);break;case "c":s.uniform3f(r,k.r,k.g,k.b);break;case "s":for(var t in a.properties)switch(n=a.properties[t],m=r[t],q=k[t],n.type){case "f":s.uniform1f(m,q);break;case "v2":s.uniform2f(m,q.x,q.y);break;case "v3":s.uniform3f(m,q.x,q.y,q.z);break;case "v4":s.uniform4f(m,q.x,q.y,q.z,q.w);break;case "c":s.uniform3f(m,q.r,q.g,q.b)}break;case "sa":for(c=
|
|
|
|
-0;c<k.length;c++)for(t in a.properties)switch(n=a.properties[t],m=r[c][t],q=k[c][t],n.type){case "f":s.uniform1f(m,q);break;case "v2":s.uniform2f(m,q.x,q.y);break;case "v3":s.uniform3f(m,q.x,q.y,q.z);break;case "v4":s.uniform4f(m,q.x,q.y,q.z,q.w);break;case "c":s.uniform3f(m,q.r,q.g,q.b)}break;case "iv1":s.uniform1iv(r,k);break;case "iv":s.uniform3iv(r,k);break;case "fv1":s.uniform1fv(r,k);break;case "fv":s.uniform3fv(r,k);break;case "v2v":void 0===a._array&&(a._array=new Float32Array(2*k.length));
|
|
|
|
-m=c=0;for(n=k.length;c<n;c++,m+=2)a._array[m+0]=k[c].x,a._array[m+1]=k[c].y;s.uniform2fv(r,a._array);break;case "v3v":void 0===a._array&&(a._array=new Float32Array(3*k.length));m=c=0;for(n=k.length;c<n;c++,m+=3)a._array[m+0]=k[c].x,a._array[m+1]=k[c].y,a._array[m+2]=k[c].z;s.uniform3fv(r,a._array);break;case "v4v":void 0===a._array&&(a._array=new Float32Array(4*k.length));m=c=0;for(n=k.length;c<n;c++,m+=4)a._array[m+0]=k[c].x,a._array[m+1]=k[c].y,a._array[m+2]=k[c].z,a._array[m+3]=k[c].w;s.uniform4fv(r,
|
|
|
|
-a._array);break;case "m3":s.uniformMatrix3fv(r,!1,k.elements);break;case "m3v":void 0===a._array&&(a._array=new Float32Array(9*k.length));c=0;for(n=k.length;c<n;c++)k[c].flattenToArrayOffset(a._array,9*c);s.uniformMatrix3fv(r,!1,a._array);break;case "m4":s.uniformMatrix4fv(r,!1,k.elements);break;case "m4v":void 0===a._array&&(a._array=new Float32Array(16*k.length));c=0;for(n=k.length;c<n;c++)k[c].flattenToArrayOffset(a._array,16*c);s.uniformMatrix4fv(r,!1,a._array);break;case "t":m=u();s.uniform1i(r,
|
|
|
|
-m);if(!k)continue;k instanceof THREE.CubeTexture||Array.isArray(k.image)&&6===k.image.length?A(k,m):k instanceof THREE.WebGLRenderTargetCube?z(k.texture,m):k instanceof THREE.WebGLRenderTarget?Z.setTexture(k.texture,m):Z.setTexture(k,m);break;case "tv":void 0===a._array&&(a._array=[]);c=0;for(n=a.value.length;c<n;c++)a._array[c]=u();s.uniform1iv(r,a._array);c=0;for(n=a.value.length;c<n;c++)k=a.value[c],m=a._array[c],k&&(k instanceof THREE.CubeTexture||k.image instanceof Array&&6===k.image.length?
|
|
|
|
-A(k,m):k instanceof THREE.WebGLRenderTarget?Z.setTexture(k.texture,m):k instanceof THREE.WebGLRenderTargetCube?z(k.texture,m):Z.setTexture(k,m));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+c)}}s.uniformMatrix4fv(p.modelViewMatrix,!1,e.modelViewMatrix.elements);p.normalMatrix&&s.uniformMatrix3fv(p.normalMatrix,!1,e.normalMatrix.elements);void 0!==p.modelMatrix&&s.uniformMatrix4fv(p.modelMatrix,!1,e.matrixWorld.elements);return g}function u(){var a=sa;a>=ba.maxTextures&&
|
|
|
|
-console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ba.maxTextures);sa+=1;return a}function w(a,b,c){c?(s.texParameteri(a,s.TEXTURE_WRAP_S,D(b.wrapS)),s.texParameteri(a,s.TEXTURE_WRAP_T,D(b.wrapT)),s.texParameteri(a,s.TEXTURE_MAG_FILTER,D(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,D(b.minFilter))):(s.texParameteri(a,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(a,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===
|
|
|
|
|
|
+k);break;case "f":s.uniform1f(r,k);break;case "v2":s.uniform2f(r,k.x,k.y);break;case "v3":s.uniform3f(r,k.x,k.y,k.z);break;case "v4":s.uniform4f(r,k.x,k.y,k.z,k.w);break;case "c":s.uniform3f(r,k.r,k.g,k.b);break;case "s":for(var v in a.properties)switch(m=a.properties[v],n=r[v],q=k[v],m.type){case "f":s.uniform1f(n,q);break;case "v2":s.uniform2f(n,q.x,q.y);break;case "v3":s.uniform3f(n,q.x,q.y,q.z);break;case "v4":s.uniform4f(n,q.x,q.y,q.z,q.w);break;case "c":s.uniform3f(n,q.r,q.g,q.b)}break;case "sa":for(c=
|
|
|
|
+0;c<k.length;c++)for(v in a.properties)switch(m=a.properties[v],n=r[c][v],q=k[c][v],m.type){case "f":s.uniform1f(n,q);break;case "v2":s.uniform2f(n,q.x,q.y);break;case "v3":s.uniform3f(n,q.x,q.y,q.z);break;case "v4":s.uniform4f(n,q.x,q.y,q.z,q.w);break;case "c":s.uniform3f(n,q.r,q.g,q.b)}break;case "iv1":s.uniform1iv(r,k);break;case "iv":s.uniform3iv(r,k);break;case "fv1":s.uniform1fv(r,k);break;case "fv":s.uniform3fv(r,k);break;case "v2v":void 0===a._array&&(a._array=new Float32Array(2*k.length));
|
|
|
|
+n=c=0;for(m=k.length;c<m;c++,n+=2)a._array[n+0]=k[c].x,a._array[n+1]=k[c].y;s.uniform2fv(r,a._array);break;case "v3v":void 0===a._array&&(a._array=new Float32Array(3*k.length));n=c=0;for(m=k.length;c<m;c++,n+=3)a._array[n+0]=k[c].x,a._array[n+1]=k[c].y,a._array[n+2]=k[c].z;s.uniform3fv(r,a._array);break;case "v4v":void 0===a._array&&(a._array=new Float32Array(4*k.length));n=c=0;for(m=k.length;c<m;c++,n+=4)a._array[n+0]=k[c].x,a._array[n+1]=k[c].y,a._array[n+2]=k[c].z,a._array[n+3]=k[c].w;s.uniform4fv(r,
|
|
|
|
+a._array);break;case "m3":s.uniformMatrix3fv(r,!1,k.elements);break;case "m3v":void 0===a._array&&(a._array=new Float32Array(9*k.length));c=0;for(m=k.length;c<m;c++)k[c].flattenToArrayOffset(a._array,9*c);s.uniformMatrix3fv(r,!1,a._array);break;case "m4":s.uniformMatrix4fv(r,!1,k.elements);break;case "m4v":void 0===a._array&&(a._array=new Float32Array(16*k.length));c=0;for(m=k.length;c<m;c++)k[c].flattenToArrayOffset(a._array,16*c);s.uniformMatrix4fv(r,!1,a._array);break;case "t":n=t();s.uniform1i(r,
|
|
|
|
+n);if(!k)continue;k instanceof THREE.CubeTexture||Array.isArray(k.image)&&6===k.image.length?A(k,n):k instanceof THREE.WebGLRenderTargetCube?z(k.texture,n):k instanceof THREE.WebGLRenderTarget?Z.setTexture(k.texture,n):Z.setTexture(k,n);break;case "tv":void 0===a._array&&(a._array=[]);c=0;for(m=a.value.length;c<m;c++)a._array[c]=t();s.uniform1iv(r,a._array);c=0;for(m=a.value.length;c<m;c++)k=a.value[c],n=a._array[c],k&&(k instanceof THREE.CubeTexture||k.image instanceof Array&&6===k.image.length?
|
|
|
|
+A(k,n):k instanceof THREE.WebGLRenderTarget?Z.setTexture(k.texture,n):k instanceof THREE.WebGLRenderTargetCube?z(k.texture,n):Z.setTexture(k,n));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+c)}}s.uniformMatrix4fv(p.modelViewMatrix,!1,e.modelViewMatrix.elements);p.normalMatrix&&s.uniformMatrix3fv(p.normalMatrix,!1,e.normalMatrix.elements);void 0!==p.modelMatrix&&s.uniformMatrix4fv(p.modelMatrix,!1,e.matrixWorld.elements);return g}function t(){var a=sa;a>=ba.maxTextures&&
|
|
|
|
+console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ba.maxTextures);sa+=1;return a}function v(a,b,c){c?(s.texParameteri(a,s.TEXTURE_WRAP_S,D(b.wrapS)),s.texParameteri(a,s.TEXTURE_WRAP_T,D(b.wrapT)),s.texParameteri(a,s.TEXTURE_MAG_FILTER,D(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,D(b.minFilter))):(s.texParameteri(a,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(a,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===
|
|
THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",b),s.texParameteri(a,s.TEXTURE_MAG_FILTER,H(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,H(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",b));!(c=
|
|
THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",b),s.texParameteri(a,s.TEXTURE_MAG_FILTER,H(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,H(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",b));!(c=
|
|
-T.get("EXT_texture_filter_anisotropic"))||b.type===THREE.FloatType&&null===T.get("OES_texture_float_linear")||b.type===THREE.HalfFloatType&&null===T.get("OES_texture_half_float_linear")||!(1<b.anisotropy||S.get(b).__currentAnisotropy)||(s.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Z.getMaxAnisotropy())),S.get(b).__currentAnisotropy=b.anisotropy)}function F(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*
|
|
|
|
|
|
+U.get("EXT_texture_filter_anisotropic"))||b.type===THREE.FloatType&&null===U.get("OES_texture_float_linear")||b.type===THREE.HalfFloatType&&null===U.get("OES_texture_half_float_linear")||!(1<b.anisotropy||S.get(b).__currentAnisotropy)||(s.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Z.getMaxAnisotropy())),S.get(b).__currentAnisotropy=b.anisotropy)}function F(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*
|
|
c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function x(a){return THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height)}function A(a,b){var c=S.get(a);if(6===a.image.length)if(0<a.version&&c.__version!==a.version){c.__image__webglTextureCube||(a.addEventListener("dispose",f),c.__image__webglTextureCube=
|
|
c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function x(a){return THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height)}function A(a,b){var c=S.get(a);if(6===a.image.length)if(0<a.version&&c.__version!==a.version){c.__image__webglTextureCube||(a.addEventListener("dispose",f),c.__image__webglTextureCube=
|
|
-s.createTexture(),da.textures++);I.activeTexture(s.TEXTURE0+b);I.bindTexture(s.TEXTURE_CUBE_MAP,c.__image__webglTextureCube);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,a.flipY);for(var d=a instanceof THREE.CompressedTexture,e=a.image[0]instanceof THREE.DataTexture,g=[],h=0;6>h;h++)g[h]=!Z.autoScaleCubemaps||d||e?e?a.image[h].image:a.image[h]:F(a.image[h],ba.maxCubemapSize);var k=x(g[0]),l=D(a.format),m=D(a.type);w(s.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var n,q=g[h].mipmaps,p=0,r=q.length;p<r;p++)n=
|
|
|
|
-q[p],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<I.getCompressedTextureFormats().indexOf(l)?I.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,n.width,n.height,0,n.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):I.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,n.width,n.height,0,l,m,n.data);else e?I.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,g[h].width,g[h].height,0,l,m,g[h].data):I.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+
|
|
|
|
-h,0,l,l,m,g[h]);a.generateMipmaps&&k&&s.generateMipmap(s.TEXTURE_CUBE_MAP);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}else I.activeTexture(s.TEXTURE0+b),I.bindTexture(s.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)}function z(a,b){I.activeTexture(s.TEXTURE0+b);I.bindTexture(s.TEXTURE_CUBE_MAP,S.get(a).__webglTexture)}function B(a,b,c){s.bindFramebuffer(s.FRAMEBUFFER,a);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,c,S.get(b.texture).__webglTexture,0)}function y(a,b){s.bindRenderbuffer(s.RENDERBUFFER,
|
|
|
|
|
|
+s.createTexture(),da.textures++);I.activeTexture(s.TEXTURE0+b);I.bindTexture(s.TEXTURE_CUBE_MAP,c.__image__webglTextureCube);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,a.flipY);for(var d=a instanceof THREE.CompressedTexture,e=a.image[0]instanceof THREE.DataTexture,g=[],h=0;6>h;h++)g[h]=!Z.autoScaleCubemaps||d||e?e?a.image[h].image:a.image[h]:F(a.image[h],ba.maxCubemapSize);var k=x(g[0]),l=D(a.format),n=D(a.type);v(s.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var m,q=g[h].mipmaps,p=0,r=q.length;p<r;p++)m=
|
|
|
|
+q[p],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<I.getCompressedTextureFormats().indexOf(l)?I.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):I.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,p,l,m.width,m.height,0,l,n,m.data);else e?I.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,g[h].width,g[h].height,0,l,n,g[h].data):I.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+
|
|
|
|
+h,0,l,l,n,g[h]);a.generateMipmaps&&k&&s.generateMipmap(s.TEXTURE_CUBE_MAP);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}else I.activeTexture(s.TEXTURE0+b),I.bindTexture(s.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)}function z(a,b){I.activeTexture(s.TEXTURE0+b);I.bindTexture(s.TEXTURE_CUBE_MAP,S.get(a).__webglTexture)}function B(a,b,c){s.bindFramebuffer(s.FRAMEBUFFER,a);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,c,S.get(b.texture).__webglTexture,0)}function y(a,b){s.bindRenderbuffer(s.RENDERBUFFER,
|
|
a);b.depthBuffer&&!b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_COMPONENT16,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)):s.renderbufferStorage(s.RENDERBUFFER,s.RGBA4,b.width,b.height)}function H(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||
|
|
a);b.depthBuffer&&!b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_COMPONENT16,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)):s.renderbufferStorage(s.RENDERBUFFER,s.RGBA4,b.width,b.height)}function H(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||
|
|
a===THREE.NearestMipMapLinearFilter?s.NEAREST:s.LINEAR}function D(a){var b;if(a===THREE.RepeatWrapping)return s.REPEAT;if(a===THREE.ClampToEdgeWrapping)return s.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return s.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return s.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return s.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return s.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return s.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return s.LINEAR_MIPMAP_NEAREST;
|
|
a===THREE.NearestMipMapLinearFilter?s.NEAREST:s.LINEAR}function D(a){var b;if(a===THREE.RepeatWrapping)return s.REPEAT;if(a===THREE.ClampToEdgeWrapping)return s.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return s.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return s.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return s.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return s.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return s.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return s.LINEAR_MIPMAP_NEAREST;
|
|
if(a===THREE.LinearMipMapLinearFilter)return s.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return s.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return s.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return s.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return s.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return s.BYTE;if(a===THREE.ShortType)return s.SHORT;if(a===THREE.UnsignedShortType)return s.UNSIGNED_SHORT;if(a===THREE.IntType)return s.INT;if(a===THREE.UnsignedIntType)return s.UNSIGNED_INT;
|
|
if(a===THREE.LinearMipMapLinearFilter)return s.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return s.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return s.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return s.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return s.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return s.BYTE;if(a===THREE.ShortType)return s.SHORT;if(a===THREE.UnsignedShortType)return s.UNSIGNED_SHORT;if(a===THREE.IntType)return s.INT;if(a===THREE.UnsignedIntType)return s.UNSIGNED_INT;
|
|
-if(a===THREE.FloatType)return s.FLOAT;b=T.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return s.ALPHA;if(a===THREE.RGBFormat)return s.RGB;if(a===THREE.RGBAFormat)return s.RGBA;if(a===THREE.LuminanceFormat)return s.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return s.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return s.FUNC_ADD;if(a===THREE.SubtractEquation)return s.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return s.FUNC_REVERSE_SUBTRACT;
|
|
|
|
|
|
+if(a===THREE.FloatType)return s.FLOAT;b=U.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return s.ALPHA;if(a===THREE.RGBFormat)return s.RGB;if(a===THREE.RGBAFormat)return s.RGBA;if(a===THREE.LuminanceFormat)return s.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return s.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return s.FUNC_ADD;if(a===THREE.SubtractEquation)return s.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return s.FUNC_REVERSE_SUBTRACT;
|
|
if(a===THREE.ZeroFactor)return s.ZERO;if(a===THREE.OneFactor)return s.ONE;if(a===THREE.SrcColorFactor)return s.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return s.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return s.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return s.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return s.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return s.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return s.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return s.ONE_MINUS_DST_COLOR;
|
|
if(a===THREE.ZeroFactor)return s.ZERO;if(a===THREE.OneFactor)return s.ONE;if(a===THREE.SrcColorFactor)return s.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return s.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return s.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return s.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return s.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return s.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return s.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return s.ONE_MINUS_DST_COLOR;
|
|
-if(a===THREE.SrcAlphaSaturateFactor)return s.SRC_ALPHA_SATURATE;b=T.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=T.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
|
|
|
|
-if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=T.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var E=void 0!==a.canvas?a.canvas:document.createElement("canvas"),Q=void 0!==
|
|
|
|
-a.context?a.context:null,M=E.width,N=E.height,G=1,J=void 0!==a.alpha?a.alpha:!1,K=void 0!==a.depth?a.depth:!0,O=void 0!==a.stencil?a.stencil:!0,R=void 0!==a.antialias?a.antialias:!1,P=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,L=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,C=new THREE.Color(0),X=0,U=[],Y=[],ea=-1,aa=[],na=-1,pa=new Float32Array(8),$=[],wa=[];this.domElement=E;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=
|
|
|
|
-this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;var Z=this,ua=null,ta=null,qa=-1,ka="",ja=null,sa=0,fa=0,ga=0,ha=E.width,ia=E.height,ya=0,za=0,va=new THREE.Frustum,ra=new THREE.Matrix4,V=new THREE.Vector3,W={hash:"",ambient:[0,0,0],directional:[],point:[],spot:[],hemi:[]},la=!0,da={geometries:0,textures:0},ca={calls:0,vertices:0,faces:0,points:0};this.info={render:ca,memory:da,programs:null};var s;try{J=
|
|
|
|
-{alpha:J,depth:K,stencil:O,antialias:R,premultipliedAlpha:P,preserveDrawingBuffer:L};s=Q||E.getContext("webgl",J)||E.getContext("experimental-webgl",J);if(null===s){if(null!==E.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}E.addEventListener("webglcontextlost",e,!1)}catch(Aa){console.error("THREE.WebGLRenderer: "+Aa)}var T=new THREE.WebGLExtensions(s);T.get("OES_texture_float");T.get("OES_texture_float_linear");T.get("OES_texture_half_float");
|
|
|
|
-T.get("OES_texture_half_float_linear");T.get("OES_standard_derivatives");T.get("ANGLE_instanced_arrays");T.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);var ba=new THREE.WebGLCapabilities(s,T,a),I=new THREE.WebGLState(s,T,D),S=new THREE.WebGLProperties,oa=new THREE.WebGLObjects(s,S,this.info),ma=new THREE.WebGLPrograms(this,ba);this.info.programs=ma.programs;var Ba=new THREE.WebGLBufferRenderer(s,T,ca),Ca=new THREE.WebGLIndexedBufferRenderer(s,T,ca);c();this.context=s;
|
|
|
|
-this.capabilities=ba;this.extensions=T;this.state=I;var xa=new THREE.WebGLShadowMap(this,U,oa);this.shadowMap=xa;var Da=new THREE.SpritePlugin(this,$),Ea=new THREE.LensFlarePlugin(this,wa);this.getContext=function(){return s};this.getContextAttributes=function(){return s.getContextAttributes()};this.forceContextLoss=function(){T.get("WEBGL_lose_context").loseContext()};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=T.get("EXT_texture_filter_anisotropic");return a=
|
|
|
|
-null!==b?s.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return ba.precision};this.getPixelRatio=function(){return G};this.setPixelRatio=function(a){void 0!==a&&(G=a)};this.getSize=function(){return{width:M,height:N}};this.setSize=function(a,b,c){M=a;N=b;E.width=a*G;E.height=b*G;!1!==c&&(E.style.width=a+"px",E.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){fa=a*G;ga=b*G;ha=c*G;ia=d*G;s.viewport(fa,ga,ha,ia)};this.getViewport=
|
|
|
|
|
|
+if(a===THREE.SrcAlphaSaturateFactor)return s.SRC_ALPHA_SATURATE;b=U.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=U.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
|
|
|
|
+if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=U.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var E=void 0!==a.canvas?a.canvas:document.createElement("canvas"),Q=void 0!==
|
|
|
|
+a.context?a.context:null,M=E.width,N=E.height,G=1,J=void 0!==a.alpha?a.alpha:!1,K=void 0!==a.depth?a.depth:!0,O=void 0!==a.stencil?a.stencil:!0,R=void 0!==a.antialias?a.antialias:!1,P=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,L=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,C=new THREE.Color(0),X=0,V=[],Y=[],ea=-1,aa=[],na=-1,pa=new Float32Array(8),$=[],wa=[];this.domElement=E;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=
|
|
|
|
+this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;var Z=this,ua=null,ta=null,qa=-1,ka="",ja=null,sa=0,fa=0,ga=0,ha=E.width,ia=E.height,ya=0,za=0,va=new THREE.Frustum,ra=new THREE.Matrix4,W=new THREE.Vector3,T={hash:"",ambient:[0,0,0],directional:[],point:[],spot:[],hemi:[],shadows:0,shadowsPointLight:0},la=!0,da={geometries:0,textures:0},ca={calls:0,vertices:0,faces:0,points:0};this.info={render:ca,memory:da,
|
|
|
|
+programs:null};var s;try{J={alpha:J,depth:K,stencil:O,antialias:R,premultipliedAlpha:P,preserveDrawingBuffer:L};s=Q||E.getContext("webgl",J)||E.getContext("experimental-webgl",J);if(null===s){if(null!==E.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}E.addEventListener("webglcontextlost",e,!1)}catch(Aa){console.error("THREE.WebGLRenderer: "+Aa)}var U=new THREE.WebGLExtensions(s);U.get("OES_texture_float");U.get("OES_texture_float_linear");
|
|
|
|
+U.get("OES_texture_half_float");U.get("OES_texture_half_float_linear");U.get("OES_standard_derivatives");U.get("ANGLE_instanced_arrays");U.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);var ba=new THREE.WebGLCapabilities(s,U,a),I=new THREE.WebGLState(s,U,D),S=new THREE.WebGLProperties,oa=new THREE.WebGLObjects(s,S,this.info),ma=new THREE.WebGLPrograms(this,ba);this.info.programs=ma.programs;var Ba=new THREE.WebGLBufferRenderer(s,U,ca),Ca=new THREE.WebGLIndexedBufferRenderer(s,
|
|
|
|
+U,ca);c();this.context=s;this.capabilities=ba;this.extensions=U;this.state=I;var xa=new THREE.WebGLShadowMap(this,V,oa);this.shadowMap=xa;var Da=new THREE.SpritePlugin(this,$),Ea=new THREE.LensFlarePlugin(this,wa);this.getContext=function(){return s};this.getContextAttributes=function(){return s.getContextAttributes()};this.forceContextLoss=function(){U.get("WEBGL_lose_context").loseContext()};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=U.get("EXT_texture_filter_anisotropic");
|
|
|
|
+return a=null!==b?s.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return ba.precision};this.getPixelRatio=function(){return G};this.setPixelRatio=function(a){void 0!==a&&(G=a)};this.getSize=function(){return{width:M,height:N}};this.setSize=function(a,b,c){M=a;N=b;E.width=a*G;E.height=b*G;!1!==c&&(E.style.width=a+"px",E.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){fa=a*G;ga=b*G;ha=c*G;ia=d*G;s.viewport(fa,ga,ha,ia)};this.getViewport=
|
|
function(a){a.x=fa/G;a.y=ga/G;a.z=ha/G;a.w=ia/G};this.setScissor=function(a,b,c,d){s.scissor(a*G,b*G,c*G,d*G)};this.enableScissorTest=function(a){I.setScissorTest(a)};this.getClearColor=function(){return C};this.setClearColor=function(a,c){C.set(a);X=void 0!==c?c:1;b(C.r,C.g,C.b,X)};this.getClearAlpha=function(){return X};this.setClearAlpha=function(a){X=a;b(C.r,C.g,C.b,X)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=s.COLOR_BUFFER_BIT;if(void 0===b||b)d|=s.DEPTH_BUFFER_BIT;if(void 0===
|
|
function(a){a.x=fa/G;a.y=ga/G;a.z=ha/G;a.w=ia/G};this.setScissor=function(a,b,c,d){s.scissor(a*G,b*G,c*G,d*G)};this.enableScissorTest=function(a){I.setScissorTest(a)};this.getClearColor=function(){return C};this.setClearColor=function(a,c){C.set(a);X=void 0!==c?c:1;b(C.r,C.g,C.b,X)};this.getClearAlpha=function(){return X};this.setClearAlpha=function(a){X=a;b(C.r,C.g,C.b,X)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=s.COLOR_BUFFER_BIT;if(void 0===b||b)d|=s.DEPTH_BUFFER_BIT;if(void 0===
|
|
c||c)d|=s.STENCIL_BUFFER_BIT;s.clear(d)};this.clearColor=function(){s.clear(s.COLOR_BUFFER_BIT)};this.clearDepth=function(){s.clear(s.DEPTH_BUFFER_BIT)};this.clearStencil=function(){s.clear(s.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){E.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){I.initAttributes();var d=S.get(a);a.hasPositions&&!d.position&&(d.position=
|
|
c||c)d|=s.STENCIL_BUFFER_BIT;s.clear(d)};this.clearColor=function(){s.clear(s.COLOR_BUFFER_BIT)};this.clearDepth=function(){s.clear(s.DEPTH_BUFFER_BIT)};this.clearStencil=function(){s.clear(s.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){E.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){I.initAttributes();var d=S.get(a);a.hasPositions&&!d.position&&(d.position=
|
|
s.createBuffer());a.hasNormals&&!d.normal&&(d.normal=s.createBuffer());a.hasUvs&&!d.uv&&(d.uv=s.createBuffer());a.hasColors&&!d.color&&(d.color=s.createBuffer());b=b.getAttributes();a.hasPositions&&(s.bindBuffer(s.ARRAY_BUFFER,d.position),s.bufferData(s.ARRAY_BUFFER,a.positionArray,s.DYNAMIC_DRAW),I.enableAttribute(b.position),s.vertexAttribPointer(b.position,3,s.FLOAT,!1,0,0));if(a.hasNormals){s.bindBuffer(s.ARRAY_BUFFER,d.normal);if("MeshPhongMaterial"!==c.type&&"MeshPhysicalMaterial"!==c.type&&
|
|
s.createBuffer());a.hasNormals&&!d.normal&&(d.normal=s.createBuffer());a.hasUvs&&!d.uv&&(d.uv=s.createBuffer());a.hasColors&&!d.color&&(d.color=s.createBuffer());b=b.getAttributes();a.hasPositions&&(s.bindBuffer(s.ARRAY_BUFFER,d.position),s.bufferData(s.ARRAY_BUFFER,a.positionArray,s.DYNAMIC_DRAW),I.enableAttribute(b.position),s.vertexAttribPointer(b.position,3,s.FLOAT,!1,0,0));if(a.hasNormals){s.bindBuffer(s.ARRAY_BUFFER,d.normal);if("MeshPhongMaterial"!==c.type&&"MeshPhysicalMaterial"!==c.type&&
|
|
c.shading===THREE.FlatShading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,k=(g[e+1]+g[e+4]+g[e+7])/3,l=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=k;g[e+2]=l;g[e+3]=h;g[e+4]=k;g[e+5]=l;g[e+6]=h;g[e+7]=k;g[e+8]=l}s.bufferData(s.ARRAY_BUFFER,a.normalArray,s.DYNAMIC_DRAW);I.enableAttribute(b.normal);s.vertexAttribPointer(b.normal,3,s.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(s.bindBuffer(s.ARRAY_BUFFER,d.uv),s.bufferData(s.ARRAY_BUFFER,a.uvArray,s.DYNAMIC_DRAW),I.enableAttribute(b.uv),
|
|
c.shading===THREE.FlatShading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,k=(g[e+1]+g[e+4]+g[e+7])/3,l=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=k;g[e+2]=l;g[e+3]=h;g[e+4]=k;g[e+5]=l;g[e+6]=h;g[e+7]=k;g[e+8]=l}s.bufferData(s.ARRAY_BUFFER,a.normalArray,s.DYNAMIC_DRAW);I.enableAttribute(b.normal);s.vertexAttribPointer(b.normal,3,s.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(s.bindBuffer(s.ARRAY_BUFFER,d.uv),s.bufferData(s.ARRAY_BUFFER,a.uvArray,s.DYNAMIC_DRAW),I.enableAttribute(b.uv),
|
|
-s.vertexAttribPointer(b.uv,2,s.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(s.bindBuffer(s.ARRAY_BUFFER,d.color),s.bufferData(s.ARRAY_BUFFER,a.colorArray,s.DYNAMIC_DRAW),I.enableAttribute(b.color),s.vertexAttribPointer(b.color,3,s.FLOAT,!1,0,0));I.disableUnusedAttributes();s.drawArrays(s.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f,g){t(e);var h=v(a,b,c,e,f),l=!1;a=d.id+"_"+h.id+"_"+e.wireframe;a!==ka&&(ka=a,l=!0);b=f.morphTargetInfluences;if(void 0!==
|
|
|
|
-b){a=[];c=0;for(l=b.length;c<l;c++){var m=b[c];a.push([m,c])}a.sort(k);8<a.length&&(a.length=8);var n=d.morphAttributes;c=0;for(l=a.length;c<l;c++)m=a[c],pa[c]=m[0],0!==m[0]?(b=m[1],!0===e.morphTargets&&n.position&&d.addAttribute("morphTarget"+c,n.position[b]),!0===e.morphNormals&&n.normal&&d.addAttribute("morphNormal"+c,n.normal[b])):(!0===e.morphTargets&&d.removeAttribute("morphTarget"+c),!0===e.morphNormals&&d.removeAttribute("morphNormal"+c));a=h.getUniforms();null!==a.morphTargetInfluences&&
|
|
|
|
-s.uniform1fv(a.morphTargetInfluences,pa);l=!0}b=d.index;c=d.attributes.position;!0===e.wireframe&&(b=oa.getWireframeAttribute(d));null!==b?(a=Ca,a.setIndex(b)):a=Ba;if(l){a:{var l=void 0,q;if(d instanceof THREE.InstancedBufferGeometry&&(q=T.get("ANGLE_instanced_arrays"),null===q)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===l&&(l=0);I.initAttributes();var m=d.attributes,
|
|
|
|
-h=h.getAttributes(),n=e.defaultAttributeValues,p;for(p in h){var r=h[p];if(0<=r){var u=m[p];if(void 0!==u){var w=u.itemSize,x=oa.getAttributeBuffer(u);if(u instanceof THREE.InterleavedBufferAttribute){var D=u.data,F=D.stride,u=u.offset;D instanceof THREE.InstancedInterleavedBuffer?(I.enableAttributeAndDivisor(r,D.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=D.meshPerAttribute*D.count)):I.enableAttribute(r);s.bindBuffer(s.ARRAY_BUFFER,x);s.vertexAttribPointer(r,w,s.FLOAT,
|
|
|
|
-!1,F*D.array.BYTES_PER_ELEMENT,(l*F+u)*D.array.BYTES_PER_ELEMENT)}else u instanceof THREE.InstancedBufferAttribute?(I.enableAttributeAndDivisor(r,u.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=u.meshPerAttribute*u.count)):I.enableAttribute(r),s.bindBuffer(s.ARRAY_BUFFER,x),s.vertexAttribPointer(r,w,s.FLOAT,!1,0,l*w*4)}else if(void 0!==n&&(w=n[p],void 0!==w))switch(w.length){case 2:s.vertexAttrib2fv(r,w);break;case 3:s.vertexAttrib3fv(r,w);break;case 4:s.vertexAttrib4fv(r,
|
|
|
|
-w);break;default:s.vertexAttrib1fv(r,w)}}}I.disableUnusedAttributes()}null!==b&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,oa.getAttributeBuffer(b))}q=Infinity;null!==b?q=b.count:void 0!==c&&(q=c.count);p=d.drawRange.start;b=d.drawRange.count;c=null!==g?g.start:0;l=null!==g?g.count:Infinity;g=Math.max(0,p,c);q=Math.min(0+q,p+b,c+l)-1;q=Math.max(0,q-g+1);f instanceof THREE.Mesh?(!0===e.wireframe?(I.setLineWidth(e.wireframeLinewidth*G),a.setMode(s.LINES)):a.setMode(s.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&&
|
|
|
|
|
|
+s.vertexAttribPointer(b.uv,2,s.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(s.bindBuffer(s.ARRAY_BUFFER,d.color),s.bufferData(s.ARRAY_BUFFER,a.colorArray,s.DYNAMIC_DRAW),I.enableAttribute(b.color),s.vertexAttribPointer(b.color,3,s.FLOAT,!1,0,0));I.disableUnusedAttributes();s.drawArrays(s.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f,g){u(e);var h=w(a,b,c,e,f),l=!1;a=d.id+"_"+h.id+"_"+e.wireframe;a!==ka&&(ka=a,l=!0);b=f.morphTargetInfluences;if(void 0!==
|
|
|
|
+b){a=[];c=0;for(l=b.length;c<l;c++){var n=b[c];a.push([n,c])}a.sort(k);8<a.length&&(a.length=8);var m=d.morphAttributes;c=0;for(l=a.length;c<l;c++)n=a[c],pa[c]=n[0],0!==n[0]?(b=n[1],!0===e.morphTargets&&m.position&&d.addAttribute("morphTarget"+c,m.position[b]),!0===e.morphNormals&&m.normal&&d.addAttribute("morphNormal"+c,m.normal[b])):(!0===e.morphTargets&&d.removeAttribute("morphTarget"+c),!0===e.morphNormals&&d.removeAttribute("morphNormal"+c));a=h.getUniforms();null!==a.morphTargetInfluences&&
|
|
|
|
+s.uniform1fv(a.morphTargetInfluences,pa);l=!0}b=d.index;c=d.attributes.position;!0===e.wireframe&&(b=oa.getWireframeAttribute(d));null!==b?(a=Ca,a.setIndex(b)):a=Ba;if(l){a:{var l=void 0,q;if(d instanceof THREE.InstancedBufferGeometry&&(q=U.get("ANGLE_instanced_arrays"),null===q)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===l&&(l=0);I.initAttributes();var n=d.attributes,
|
|
|
|
+h=h.getAttributes(),m=e.defaultAttributeValues,p;for(p in h){var r=h[p];if(0<=r){var t=n[p];if(void 0!==t){var v=t.itemSize,x=oa.getAttributeBuffer(t);if(t instanceof THREE.InterleavedBufferAttribute){var D=t.data,F=D.stride,t=t.offset;D instanceof THREE.InstancedInterleavedBuffer?(I.enableAttributeAndDivisor(r,D.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=D.meshPerAttribute*D.count)):I.enableAttribute(r);s.bindBuffer(s.ARRAY_BUFFER,x);s.vertexAttribPointer(r,v,s.FLOAT,
|
|
|
|
+!1,F*D.array.BYTES_PER_ELEMENT,(l*F+t)*D.array.BYTES_PER_ELEMENT)}else t instanceof THREE.InstancedBufferAttribute?(I.enableAttributeAndDivisor(r,t.meshPerAttribute,q),void 0===d.maxInstancedCount&&(d.maxInstancedCount=t.meshPerAttribute*t.count)):I.enableAttribute(r),s.bindBuffer(s.ARRAY_BUFFER,x),s.vertexAttribPointer(r,v,s.FLOAT,!1,0,l*v*4)}else if(void 0!==m&&(v=m[p],void 0!==v))switch(v.length){case 2:s.vertexAttrib2fv(r,v);break;case 3:s.vertexAttrib3fv(r,v);break;case 4:s.vertexAttrib4fv(r,
|
|
|
|
+v);break;default:s.vertexAttrib1fv(r,v)}}}I.disableUnusedAttributes()}null!==b&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,oa.getAttributeBuffer(b))}q=Infinity;null!==b?q=b.count:void 0!==c&&(q=c.count);p=d.drawRange.start;b=d.drawRange.count;c=null!==g?g.start:0;l=null!==g?g.count:Infinity;g=Math.max(0,p,c);q=Math.min(0+q,p+b,c+l)-1;q=Math.max(0,q-g+1);f instanceof THREE.Mesh?(!0===e.wireframe?(I.setLineWidth(e.wireframeLinewidth*G),a.setMode(s.LINES)):a.setMode(s.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&&
|
|
0<d.maxInstancedCount?a.renderInstances(d):a.render(g,q)):f instanceof THREE.Line?(d=e.linewidth,void 0===d&&(d=1),I.setLineWidth(d*G),f instanceof THREE.LineSegments?a.setMode(s.LINES):a.setMode(s.LINE_STRIP),a.render(g,q)):f instanceof THREE.Points&&(a.setMode(s.POINTS),a.render(g,q))};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;ka="";qa=-1;ja=null;la=!0;!0===a.autoUpdate&&
|
|
0<d.maxInstancedCount?a.renderInstances(d):a.render(g,q)):f instanceof THREE.Line?(d=e.linewidth,void 0===d&&(d=1),I.setLineWidth(d*G),f instanceof THREE.LineSegments?a.setMode(s.LINES):a.setMode(s.LINE_STRIP),a.render(g,q)):f instanceof THREE.Points&&(a.setMode(s.POINTS),a.render(g,q))};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;ka="";qa=-1;ja=null;la=!0;!0===a.autoUpdate&&
|
|
-a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);ra.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);va.setFromMatrix(ra);U.length=0;na=ea=-1;$.length=0;wa.length=0;q(a,b);Y.length=ea+1;aa.length=na+1;!0===Z.sortObjects&&(Y.sort(m),aa.sort(p));var f=U,g,h,k,l=0,n=0,u=0,t,w,v,D=b.matrixWorldInverse,F=0,E=0,B=0,z=0;g=0;for(h=f.length;g<h;g++)if(k=f[g],t=k.color,w=k.intensity,v=k.distance,k instanceof THREE.AmbientLight)l+=t.r,n+=t.g,
|
|
|
|
-u+=t.b;else if(k instanceof THREE.DirectionalLight){k.__webglUniforms||(k.__webglUniforms={direction:new THREE.Vector3,color:new THREE.Color});var A=k.__webglUniforms;A.direction.setFromMatrixPosition(k.matrixWorld);V.setFromMatrixPosition(k.target.matrixWorld);A.direction.sub(V);A.direction.transformDirection(D);A.color.copy(k.color).multiplyScalar(k.intensity);W.directional[F++]=A}else k instanceof THREE.PointLight?(k.__webglUniforms||(k.__webglUniforms={position:new THREE.Vector3,color:new THREE.Color,
|
|
|
|
-distance:0,decay:0}),A=k.__webglUniforms,A.position.setFromMatrixPosition(k.matrixWorld),A.position.applyMatrix4(D),A.color.copy(k.color).multiplyScalar(k.intensity),A.distance=k.distance,A.decay=0===k.distance?0:k.decay,W.point[E++]=A):k instanceof THREE.SpotLight?(k.__webglUniforms||(k.__webglUniforms={position:new THREE.Vector3,direction:new THREE.Vector3,color:new THREE.Color,distance:0,decay:0,angleCos:0}),A=k.__webglUniforms,A.position.setFromMatrixPosition(k.matrixWorld),A.position.applyMatrix4(D),
|
|
|
|
-A.color.copy(t).multiplyScalar(w),A.distance=v,A.direction.setFromMatrixPosition(k.matrixWorld),V.setFromMatrixPosition(k.target.matrixWorld),A.direction.sub(V),A.direction.transformDirection(D),A.angleCos=Math.cos(k.angle),A.exponent=k.exponent,A.decay=0===k.distance?0:k.decay,W.spot[B++]=A):k instanceof THREE.HemisphereLight&&(k.__webglUniforms||(k.__webglUniforms={direction:new THREE.Vector3,skyColor:new THREE.Color,groundColor:new THREE.Color}),A=k.__webglUniforms,A.direction.setFromMatrixPosition(k.matrixWorld),
|
|
|
|
-A.direction.transformDirection(D),A.direction.normalize(),A.skyColor.copy(k.color).multiplyScalar(w),A.groundColor.copy(k.groundColor).multiplyScalar(w),W.hemi[z++]=A);W.ambient[0]=l;W.ambient[1]=n;W.ambient[2]=u;W.directional.length=F;W.point.length=E;W.spot.length=B;W.hemi.length=z;W.hash=F+","+E+","+B+","+z;xa.render(a,b);ca.calls=0;ca.vertices=0;ca.faces=0;ca.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?
|
|
|
|
-(d=a.overrideMaterial,r(Y,b,U,e,d),r(aa,b,U,e,d)):(I.setBlending(THREE.NoBlending),r(Y,b,U,e),r(aa,b,U,e));Da.render(a,b);Ea.render(a,b,ya,za);c&&(a=c.texture,a.generateMipmaps&&x(c)&&a.minFilter!==THREE.NearestFilter&&a.minFilter!==THREE.LinearFilter&&(a=c instanceof THREE.WebGLRenderTargetCube?s.TEXTURE_CUBE_MAP:s.TEXTURE_2D,c=S.get(c.texture).__webglTexture,I.bindTexture(a,c),s.generateMipmap(a),I.bindTexture(a,null)));I.setDepthTest(!0);I.setDepthWrite(!0);I.setColorWrite(!0)}};this.setFaceCulling=
|
|
|
|
-function(a,b){a===THREE.CullFaceNone?I.disable(s.CULL_FACE):(b===THREE.FrontFaceDirectionCW?s.frontFace(s.CW):s.frontFace(s.CCW),a===THREE.CullFaceBack?s.cullFace(s.BACK):a===THREE.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK),I.enable(s.CULL_FACE))};this.setTexture=function(a,b){var c=S.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",
|
|
|
|
-a);else{void 0===c.__webglInit&&(c.__webglInit=!0,a.addEventListener("dispose",f),c.__webglTexture=s.createTexture(),da.textures++);I.activeTexture(s.TEXTURE0+b);I.bindTexture(s.TEXTURE_2D,c.__webglTexture);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,a.flipY);s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);s.pixelStorei(s.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=F(a.image,ba.maxTextureSize);if((a.wrapS!==THREE.ClampToEdgeWrapping||a.wrapT!==THREE.ClampToEdgeWrapping||a.minFilter!==THREE.NearestFilter&&
|
|
|
|
-a.minFilter!==THREE.LinearFilter)&&!1===x(a.image)){d=a.image;if(d instanceof HTMLImageElement||d instanceof HTMLCanvasElement){var e=document.createElement("canvas");e.width=THREE.Math.nearestPowerOfTwo(d.width);e.height=THREE.Math.nearestPowerOfTwo(d.height);e.getContext("2d").drawImage(d,0,0,e.width,e.height);console.warn("THREE.WebGLRenderer: image is not power of two ("+d.width+"x"+d.height+"). Resized to "+e.width+"x"+e.height,d);d=e}a.image=d}var g=a.image,d=x(g),e=D(a.format),h=D(a.type);
|
|
|
|
-w(s.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<k.length&&d){for(var l=0,n=k.length;l<n;l++)g=k[l],I.texImage2D(s.TEXTURE_2D,l,e,g.width,g.height,0,e,h,g.data);a.generateMipmaps=!1}else I.texImage2D(s.TEXTURE_2D,0,e,g.width,g.height,0,e,h,g.data);else if(a instanceof THREE.CompressedTexture)for(l=0,n=k.length;l<n;l++)g=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<I.getCompressedTextureFormats().indexOf(e)?I.compressedTexImage2D(s.TEXTURE_2D,l,e,g.width,
|
|
|
|
-g.height,0,g.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):I.texImage2D(s.TEXTURE_2D,l,e,g.width,g.height,0,e,h,g.data);else if(0<k.length&&d){l=0;for(n=k.length;l<n;l++)g=k[l],I.texImage2D(s.TEXTURE_2D,l,e,e,h,g);a.generateMipmaps=!1}else I.texImage2D(s.TEXTURE_2D,0,e,e,h,a.image);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else I.activeTexture(s.TEXTURE0+b),I.bindTexture(s.TEXTURE_2D,
|
|
|
|
-c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===S.get(a).__webglFramebuffer){var c=S.get(a),d=S.get(a.texture);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",g);d.__webglTexture=s.createTexture();da.textures++;var e=x(a),f=D(a.texture.format),h=D(a.texture.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];I.bindTexture(s.TEXTURE_CUBE_MAP,d.__webglTexture);
|
|
|
|
-w(s.TEXTURE_CUBE_MAP,a.texture,e);for(d=0;6>d;d++)c.__webglFramebuffer[d]=s.createFramebuffer(),c.__webglRenderbuffer[d]=s.createRenderbuffer(),I.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,f,a.width,a.height,0,f,h,null),B(c.__webglFramebuffer[d],a,s.TEXTURE_CUBE_MAP_POSITIVE_X+d),y(c.__webglRenderbuffer[d],a);a.texture.generateMipmaps&&e&&s.generateMipmap(s.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=s.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:
|
|
|
|
-s.createRenderbuffer(),I.bindTexture(s.TEXTURE_2D,d.__webglTexture),w(s.TEXTURE_2D,a.texture,e),I.texImage2D(s.TEXTURE_2D,0,f,a.width,a.height,0,f,h,null),B(c.__webglFramebuffer,a,s.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer):y(c.__webglRenderbuffer,
|
|
|
|
-a),a.texture.generateMipmaps&&e&&s.generateMipmap(s.TEXTURE_2D);b?I.bindTexture(s.TEXTURE_CUBE_MAP,null):I.bindTexture(s.TEXTURE_2D,null);s.bindRenderbuffer(s.RENDERBUFFER,null);s.bindFramebuffer(s.FRAMEBUFFER,null)}a?(c=S.get(a),d=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,e=a.height,h=f=0):(d=null,c=ha,e=ia,f=fa,h=ga);d!==ta&&(s.bindFramebuffer(s.FRAMEBUFFER,d),s.viewport(f,h,c,e),ta=d);b&&(d=S.get(a.texture),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,
|
|
|
|
-s.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,d.__webglTexture,0));ya=c;za=e};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!1===a instanceof THREE.WebGLRenderTarget)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var g=S.get(a).__webglFramebuffer;if(g){var h=!1;g!==ta&&(s.bindFramebuffer(s.FRAMEBUFFER,g),h=!0);try{var k=a.texture;k.format!==THREE.RGBAFormat&&D(k.format)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):
|
|
|
|
-k.type===THREE.UnsignedByteType||D(k.type)===s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)||k.type===THREE.FloatType&&T.get("WEBGL_color_buffer_float")||k.type===THREE.HalfFloatType&&T.get("EXT_color_buffer_half_float")?s.checkFramebufferStatus(s.FRAMEBUFFER)===s.FRAMEBUFFER_COMPLETE?s.readPixels(b,c,d,e,D(k.format),D(k.type),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&
|
|
|
|
-s.bindFramebuffer(s.FRAMEBUFFER,ta)}}}}};
|
|
|
|
|
|
+a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);ra.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);va.setFromMatrix(ra);V.length=0;na=ea=-1;$.length=0;wa.length=0;q(a,b);Y.length=ea+1;aa.length=na+1;!0===Z.sortObjects&&(Y.sort(m),aa.sort(p));var f=V,g,h,k,l=0,n=0,t=0,v,u,w,D=b.matrixWorldInverse,F=0,E=0,B=0,z=0;T.shadows=0;g=T.shadowsPointLight=0;for(h=f.length;g<h;g++)if(k=f[g],v=k.color,u=k.intensity,w=k.distance,k instanceof
|
|
|
|
+THREE.AmbientLight)l+=v.r,n+=v.g,t+=v.b;else if(k instanceof THREE.DirectionalLight){k.__webglUniforms||(k.__webglUniforms={direction:new THREE.Vector3,color:new THREE.Color});var A=k.__webglUniforms;A.direction.setFromMatrixPosition(k.matrixWorld);W.setFromMatrixPosition(k.target.matrixWorld);A.direction.sub(W);A.direction.transformDirection(D);A.color.copy(k.color).multiplyScalar(k.intensity);T.directional[F++]=A;k.castShadow&&T.shadows++}else k instanceof THREE.PointLight?(k.__webglUniforms||(k.__webglUniforms=
|
|
|
|
+{position:new THREE.Vector3,color:new THREE.Color,distance:0,decay:0}),A=k.__webglUniforms,A.position.setFromMatrixPosition(k.matrixWorld),A.position.applyMatrix4(D),A.color.copy(k.color).multiplyScalar(k.intensity),A.distance=k.distance,A.decay=0===k.distance?0:k.decay,T.point[E++]=A,k.castShadow&&(T.shadows++,T.shadowsPointLight++)):k instanceof THREE.SpotLight?(k.__webglUniforms||(k.__webglUniforms={position:new THREE.Vector3,direction:new THREE.Vector3,color:new THREE.Color,distance:0,decay:0,
|
|
|
|
+angleCos:0}),A=k.__webglUniforms,A.position.setFromMatrixPosition(k.matrixWorld),A.position.applyMatrix4(D),A.color.copy(v).multiplyScalar(u),A.distance=w,A.direction.setFromMatrixPosition(k.matrixWorld),W.setFromMatrixPosition(k.target.matrixWorld),A.direction.sub(W),A.direction.transformDirection(D),A.angleCos=Math.cos(k.angle),A.exponent=k.exponent,A.decay=0===k.distance?0:k.decay,T.spot[B++]=A,k.castShadow&&T.shadows++):k instanceof THREE.HemisphereLight&&(k.__webglUniforms||(k.__webglUniforms=
|
|
|
|
+{direction:new THREE.Vector3,skyColor:new THREE.Color,groundColor:new THREE.Color}),A=k.__webglUniforms,A.direction.setFromMatrixPosition(k.matrixWorld),A.direction.transformDirection(D),A.direction.normalize(),A.skyColor.copy(k.color).multiplyScalar(u),A.groundColor.copy(k.groundColor).multiplyScalar(u),T.hemi[z++]=A);T.ambient[0]=l;T.ambient[1]=n;T.ambient[2]=t;T.directional.length=F;T.point.length=E;T.spot.length=B;T.hemi.length=z;T.hash=F+","+E+","+B+","+z;xa.render(a,b);ca.calls=0;ca.vertices=
|
|
|
|
+0;ca.faces=0;ca.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,r(Y,b,V,e,d),r(aa,b,V,e,d)):(I.setBlending(THREE.NoBlending),r(Y,b,V,e),r(aa,b,V,e));Da.render(a,b);Ea.render(a,b,ya,za);c&&(a=c.texture,a.generateMipmaps&&x(c)&&a.minFilter!==THREE.NearestFilter&&a.minFilter!==THREE.LinearFilter&&(a=c instanceof THREE.WebGLRenderTargetCube?s.TEXTURE_CUBE_MAP:s.TEXTURE_2D,c=S.get(c.texture).__webglTexture,
|
|
|
|
+I.bindTexture(a,c),s.generateMipmap(a),I.bindTexture(a,null)));I.setDepthTest(!0);I.setDepthWrite(!0);I.setColorWrite(!0)}};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?I.disable(s.CULL_FACE):(b===THREE.FrontFaceDirectionCW?s.frontFace(s.CW):s.frontFace(s.CCW),a===THREE.CullFaceBack?s.cullFace(s.BACK):a===THREE.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK),I.enable(s.CULL_FACE))};this.setTexture=function(a,b){var c=S.get(a);if(0<a.version&&c.__version!==a.version){var d=
|
|
|
|
+a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a);else{void 0===c.__webglInit&&(c.__webglInit=!0,a.addEventListener("dispose",f),c.__webglTexture=s.createTexture(),da.textures++);I.activeTexture(s.TEXTURE0+b);I.bindTexture(s.TEXTURE_2D,c.__webglTexture);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,a.flipY);s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
|
|
|
|
+a.premultiplyAlpha);s.pixelStorei(s.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=F(a.image,ba.maxTextureSize);if((a.wrapS!==THREE.ClampToEdgeWrapping||a.wrapT!==THREE.ClampToEdgeWrapping||a.minFilter!==THREE.NearestFilter&&a.minFilter!==THREE.LinearFilter)&&!1===x(a.image)){d=a.image;if(d instanceof HTMLImageElement||d instanceof HTMLCanvasElement){var e=document.createElement("canvas");e.width=THREE.Math.nearestPowerOfTwo(d.width);e.height=THREE.Math.nearestPowerOfTwo(d.height);e.getContext("2d").drawImage(d,
|
|
|
|
+0,0,e.width,e.height);console.warn("THREE.WebGLRenderer: image is not power of two ("+d.width+"x"+d.height+"). Resized to "+e.width+"x"+e.height,d);d=e}a.image=d}var g=a.image,d=x(g),e=D(a.format),h=D(a.type);v(s.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<k.length&&d){for(var l=0,n=k.length;l<n;l++)g=k[l],I.texImage2D(s.TEXTURE_2D,l,e,g.width,g.height,0,e,h,g.data);a.generateMipmaps=!1}else I.texImage2D(s.TEXTURE_2D,0,e,g.width,g.height,0,e,h,g.data);else if(a instanceof
|
|
|
|
+THREE.CompressedTexture)for(l=0,n=k.length;l<n;l++)g=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<I.getCompressedTextureFormats().indexOf(e)?I.compressedTexImage2D(s.TEXTURE_2D,l,e,g.width,g.height,0,g.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):I.texImage2D(s.TEXTURE_2D,l,e,g.width,g.height,0,e,h,g.data);else if(0<k.length&&d){l=0;for(n=k.length;l<n;l++)g=k[l],I.texImage2D(s.TEXTURE_2D,l,e,e,h,g);a.generateMipmaps=
|
|
|
|
+!1}else I.texImage2D(s.TEXTURE_2D,0,e,e,h,a.image);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else I.activeTexture(s.TEXTURE0+b),I.bindTexture(s.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===S.get(a).__webglFramebuffer){var c=S.get(a),d=S.get(a.texture);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",
|
|
|
|
+g);d.__webglTexture=s.createTexture();da.textures++;var e=x(a),f=D(a.texture.format),h=D(a.texture.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];I.bindTexture(s.TEXTURE_CUBE_MAP,d.__webglTexture);v(s.TEXTURE_CUBE_MAP,a.texture,e);for(d=0;6>d;d++)c.__webglFramebuffer[d]=s.createFramebuffer(),c.__webglRenderbuffer[d]=s.createRenderbuffer(),I.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+d,0,f,a.width,a.height,0,f,h,null),B(c.__webglFramebuffer[d],a,s.TEXTURE_CUBE_MAP_POSITIVE_X+d),y(c.__webglRenderbuffer[d],
|
|
|
|
+a);a.texture.generateMipmaps&&e&&s.generateMipmap(s.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=s.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:s.createRenderbuffer(),I.bindTexture(s.TEXTURE_2D,d.__webglTexture),v(s.TEXTURE_2D,a.texture,e),I.texImage2D(s.TEXTURE_2D,0,f,a.width,a.height,0,f,h,null),B(c.__webglFramebuffer,a,s.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,
|
|
|
|
+c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer):y(c.__webglRenderbuffer,a),a.texture.generateMipmaps&&e&&s.generateMipmap(s.TEXTURE_2D);b?I.bindTexture(s.TEXTURE_CUBE_MAP,null):I.bindTexture(s.TEXTURE_2D,null);s.bindRenderbuffer(s.RENDERBUFFER,null);s.bindFramebuffer(s.FRAMEBUFFER,null)}a?(c=S.get(a),d=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,e=a.height,h=
|
|
|
|
+f=0):(d=null,c=ha,e=ia,f=fa,h=ga);d!==ta&&(s.bindFramebuffer(s.FRAMEBUFFER,d),s.viewport(f,h,c,e),ta=d);b&&(d=S.get(a.texture),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,d.__webglTexture,0));ya=c;za=e};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!1===a instanceof THREE.WebGLRenderTarget)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var g=S.get(a).__webglFramebuffer;
|
|
|
|
+if(g){var h=!1;g!==ta&&(s.bindFramebuffer(s.FRAMEBUFFER,g),h=!0);try{var k=a.texture;k.format!==THREE.RGBAFormat&&D(k.format)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):k.type===THREE.UnsignedByteType||D(k.type)===s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)||k.type===THREE.FloatType&&U.get("WEBGL_color_buffer_float")||k.type===THREE.HalfFloatType&&U.get("EXT_color_buffer_half_float")?
|
|
|
|
+s.checkFramebufferStatus(s.FRAMEBUFFER)===s.FRAMEBUFFER_COMPLETE?s.readPixels(b,c,d,e,D(k.format),D(k.type),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&s.bindFramebuffer(s.FRAMEBUFFER,ta)}}}}};
|
|
THREE.WebGLRenderTarget=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.width=a;this.height=b;c=c||{};void 0===c.minFilter&&(c.minFilter=THREE.LinearFilter);this.texture=new THREE.Texture(void 0,void 0,c.wrapS,c.wrapT,c.magFilter,c.minFilter,c.format,c.type,c.anisotropy);this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null};
|
|
THREE.WebGLRenderTarget=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.width=a;this.height=b;c=c||{};void 0===c.minFilter&&(c.minFilter=THREE.LinearFilter);this.texture=new THREE.Texture(void 0,void 0,c.wrapS,c.wrapT,c.magFilter,c.minFilter,c.format,c.type,c.anisotropy);this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null};
|
|
THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose()},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.shareDepthFrom=a.shareDepthFrom;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);
|
|
THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose()},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.shareDepthFrom=a.shareDepthFrom;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);
|
|
THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
|
|
THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
|
|
@@ -677,65 +677,65 @@ THREE.WebGLGeometries=function(a,b,c){function d(a){a=a.target;var h=f[a.id];nul
|
|
a.geometry;if(void 0!==f[b.id])return f[b.id];b.addEventListener("dispose",d);var e;b instanceof THREE.BufferGeometry?e=b:b instanceof THREE.Geometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new THREE.BufferGeometry).setFromObject(a)),e=b._bufferGeometry);f[b.id]=e;c.memory.geometries++;return e}};
|
|
a.geometry;if(void 0!==f[b.id])return f[b.id];b.addEventListener("dispose",d);var e;b instanceof THREE.BufferGeometry?e=b:b instanceof THREE.Geometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new THREE.BufferGeometry).setFromObject(a)),e=b._bufferGeometry);f[b.id]=e;c.memory.geometries++;return e}};
|
|
THREE.WebGLObjects=function(a,b,c){function d(c,d){var e=c instanceof THREE.InterleavedBufferAttribute?c.data:c,f=b.get(e);void 0===f.__webglBuffer?(f.__webglBuffer=a.createBuffer(),a.bindBuffer(d,f.__webglBuffer),a.bufferData(d,e.array,e.dynamic?a.DYNAMIC_DRAW:a.STATIC_DRAW),f.version=e.version):f.version!==e.version&&(a.bindBuffer(d,f.__webglBuffer),!1===e.dynamic||-1===e.updateRange.count?a.bufferSubData(d,0,e.array):0===e.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):
|
|
THREE.WebGLObjects=function(a,b,c){function d(c,d){var e=c instanceof THREE.InterleavedBufferAttribute?c.data:c,f=b.get(e);void 0===f.__webglBuffer?(f.__webglBuffer=a.createBuffer(),a.bindBuffer(d,f.__webglBuffer),a.bufferData(d,e.array,e.dynamic?a.DYNAMIC_DRAW:a.STATIC_DRAW),f.version=e.version):f.version!==e.version&&(a.bindBuffer(d,f.__webglBuffer),!1===e.dynamic||-1===e.updateRange.count?a.bufferSubData(d,0,e.array):0===e.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):
|
|
(a.bufferSubData(d,e.updateRange.offset*e.array.BYTES_PER_ELEMENT,e.array.subarray(e.updateRange.offset,e.updateRange.offset+e.updateRange.count)),e.updateRange.count=0),f.version=e.version)}function e(a,b,c){if(b>c){var d=b;b=c;c=d}d=a[b];return void 0===d?(a[b]=[c],!0):-1===d.indexOf(c)?(d.push(c),!0):!1}var f=new THREE.WebGLGeometries(a,b,c);this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.getWireframeAttribute=
|
|
(a.bufferSubData(d,e.updateRange.offset*e.array.BYTES_PER_ELEMENT,e.array.subarray(e.updateRange.offset,e.updateRange.offset+e.updateRange.count)),e.updateRange.count=0),f.version=e.version)}function e(a,b,c){if(b>c){var d=b;b=c;c=d}d=a[b];return void 0===d?(a[b]=[c],!0):-1===d.indexOf(c)?(d.push(c),!0):!1}var f=new THREE.WebGLGeometries(a,b,c);this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.getWireframeAttribute=
|
|
-function(c){var f=b.get(c);if(void 0!==f.wireframe)return f.wireframe;var l=[],k=c.index,m=c.attributes;c=m.position;if(null!==k)for(var m={},k=k.array,p=0,n=k.length;p<n;p+=3){var q=k[p+0],r=k[p+1],t=k[p+2];e(m,q,r)&&l.push(q,r);e(m,r,t)&&l.push(r,t);e(m,t,q)&&l.push(t,q)}else for(k=m.position.array,p=0,n=k.length/3-1;p<n;p+=3)q=p+0,r=p+1,t=p+2,l.push(q,r,r,t,t,q);l=new THREE.BufferAttribute(new (65535<c.count?Uint32Array:Uint16Array)(l),1);d(l,a.ELEMENT_ARRAY_BUFFER);return f.wireframe=l};this.update=
|
|
|
|
|
|
+function(c){var f=b.get(c);if(void 0!==f.wireframe)return f.wireframe;var l=[],k=c.index,m=c.attributes;c=m.position;if(null!==k)for(var m={},k=k.array,p=0,n=k.length;p<n;p+=3){var q=k[p+0],r=k[p+1],u=k[p+2];e(m,q,r)&&l.push(q,r);e(m,r,u)&&l.push(r,u);e(m,u,q)&&l.push(u,q)}else for(k=m.position.array,p=0,n=k.length/3-1;p<n;p+=3)q=p+0,r=p+1,u=p+2,l.push(q,r,r,u,u,q);l=new THREE.BufferAttribute(new (65535<c.count?Uint32Array:Uint16Array)(l),1);d(l,a.ELEMENT_ARRAY_BUFFER);return f.wireframe=l};this.update=
|
|
function(b){var c=f.get(b);b.geometry instanceof THREE.Geometry&&c.updateFromObject(b);b=c.index;var e=c.attributes;null!==b&&d(b,a.ELEMENT_ARRAY_BUFFER);for(var k in e)d(e[k],a.ARRAY_BUFFER);b=c.morphAttributes;for(k in b)for(var e=b[k],m=0,p=e.length;m<p;m++)d(e[m],a.ARRAY_BUFFER);return c}};
|
|
function(b){var c=f.get(b);b.geometry instanceof THREE.Geometry&&c.updateFromObject(b);b=c.index;var e=c.attributes;null!==b&&d(b,a.ELEMENT_ARRAY_BUFFER);for(var k in e)d(e[k],a.ARRAY_BUFFER);b=c.morphAttributes;for(k in b)for(var e=b[k],m=0,p=e.length;m<p;m++)d(e[m],a.ARRAY_BUFFER);return c}};
|
|
THREE.WebGLProgram=function(){function a(a,b,d){a=a||{};return[a.derivatives||b.bumpMap||b.normalMap||b.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(a.fragDepth||b.logarithmicDepthBuffer)&&d.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",a.drawBuffers&&d.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(a.shaderTextureLOD||b.envMap)&&d.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(c).join("\n")}
|
|
THREE.WebGLProgram=function(){function a(a,b,d){a=a||{};return[a.derivatives||b.bumpMap||b.normalMap||b.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(a.fragDepth||b.logarithmicDepthBuffer)&&d.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",a.drawBuffers&&d.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(a.shaderTextureLOD||b.envMap)&&d.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(c).join("\n")}
|
|
-function b(a){var b=[],c;for(c in a){var d=a[c];!1!==d&&b.push("#define "+c+" "+d)}return b.join("\n")}function c(a){return""!==a}var d=0,e=/^([\w\d_]+)\.([\w\d_]+)$/,f=/^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,g=/^([\w\d_]+)\[0\]$/;return function(h,l,k,m){var p=h.context,n=k.extensions,q=k.defines,r=k.__webglShader.vertexShader,t=k.__webglShader.fragmentShader,v="SHADOWMAP_TYPE_BASIC";m.shadowMapType===THREE.PCFShadowMap?v="SHADOWMAP_TYPE_PCF":m.shadowMapType===THREE.PCFSoftShadowMap&&(v="SHADOWMAP_TYPE_PCF_SOFT");
|
|
|
|
-var u="ENVMAP_TYPE_CUBE",w="ENVMAP_MODE_REFLECTION",F="ENVMAP_BLENDING_MULTIPLY";if(m.envMap){switch(k.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:u="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:u="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:u="ENVMAP_TYPE_SPHERE"}switch(k.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:w="ENVMAP_MODE_REFRACTION"}switch(k.combine){case THREE.MultiplyOperation:F=
|
|
|
|
|
|
+function b(a){var b=[],c;for(c in a){var d=a[c];!1!==d&&b.push("#define "+c+" "+d)}return b.join("\n")}function c(a){return""!==a}var d=0,e=/^([\w\d_]+)\.([\w\d_]+)$/,f=/^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,g=/^([\w\d_]+)\[0\]$/;return function(h,l,k,m){var p=h.context,n=k.extensions,q=k.defines,r=k.__webglShader.vertexShader,u=k.__webglShader.fragmentShader,w="SHADOWMAP_TYPE_BASIC";m.shadowMapType===THREE.PCFShadowMap?w="SHADOWMAP_TYPE_PCF":m.shadowMapType===THREE.PCFSoftShadowMap&&(w="SHADOWMAP_TYPE_PCF_SOFT");
|
|
|
|
+var t="ENVMAP_TYPE_CUBE",v="ENVMAP_MODE_REFLECTION",F="ENVMAP_BLENDING_MULTIPLY";if(m.envMap){switch(k.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:t="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:t="ENVMAP_TYPE_SPHERE"}switch(k.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:v="ENVMAP_MODE_REFRACTION"}switch(k.combine){case THREE.MultiplyOperation:F=
|
|
"ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:F="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:F="ENVMAP_BLENDING_ADD"}}var x=0<h.gammaFactor?h.gammaFactor:1,n=a(n,m,h.extensions),A=b(q),z=p.createProgram();k instanceof THREE.RawShaderMaterial?h=q="":(q=["precision "+m.precision+" float;","precision "+m.precision+" int;","#define SHADER_NAME "+k.__webglShader.name,A,m.supportsVertexTextures?"#define VERTEX_TEXTURES":"",h.gammaInput?"#define GAMMA_INPUT":"",h.gammaOutput?"#define GAMMA_OUTPUT":
|
|
"ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:F="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:F="ENVMAP_BLENDING_ADD"}}var x=0<h.gammaFactor?h.gammaFactor:1,n=a(n,m,h.extensions),A=b(q),z=p.createProgram();k instanceof THREE.RawShaderMaterial?h=q="":(q=["precision "+m.precision+" float;","precision "+m.precision+" int;","#define SHADER_NAME "+k.__webglShader.name,A,m.supportsVertexTextures?"#define VERTEX_TEXTURES":"",h.gammaInput?"#define GAMMA_INPUT":"",h.gammaOutput?"#define GAMMA_OUTPUT":
|
|
-"","#define GAMMA_FACTOR "+x,"#define MAX_DIR_LIGHTS "+m.maxDirLights,"#define MAX_POINT_LIGHTS "+m.maxPointLights,"#define MAX_SPOT_LIGHTS "+m.maxSpotLights,"#define MAX_HEMI_LIGHTS "+m.maxHemiLights,"#define MAX_SHADOWS "+m.maxShadows,"#define MAX_BONES "+m.maxBones,m.map?"#define USE_MAP":"",m.envMap?"#define USE_ENVMAP":"",m.envMap?"#define "+w:"",m.lightMap?"#define USE_LIGHTMAP":"",m.aoMap?"#define USE_AOMAP":"",m.emissiveMap?"#define USE_EMISSIVEMAP":"",m.bumpMap?"#define USE_BUMPMAP":"",m.normalMap?
|
|
|
|
|
|
+"","#define GAMMA_FACTOR "+x,"#define MAX_DIR_LIGHTS "+m.maxDirLights,"#define MAX_POINT_LIGHTS "+m.maxPointLights,"#define MAX_SPOT_LIGHTS "+m.maxSpotLights,"#define MAX_HEMI_LIGHTS "+m.maxHemiLights,"#define MAX_SHADOWS "+m.maxShadows,"#define MAX_BONES "+m.maxBones,m.map?"#define USE_MAP":"",m.envMap?"#define USE_ENVMAP":"",m.envMap?"#define "+v:"",m.lightMap?"#define USE_LIGHTMAP":"",m.aoMap?"#define USE_AOMAP":"",m.emissiveMap?"#define USE_EMISSIVEMAP":"",m.bumpMap?"#define USE_BUMPMAP":"",m.normalMap?
|
|
"#define USE_NORMALMAP":"",m.displacementMap&&m.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",m.specularMap?"#define USE_SPECULARMAP":"",m.roughnessMap?"#define USE_ROUGHNESSMAP":"",m.reflectivityMap?"#define USE_REFLECTIVITYMAP":"",m.metalnessMap?"#define USE_METALNESSMAP":"",m.alphaMap?"#define USE_ALPHAMAP":"",m.vertexColors?"#define USE_COLOR":"",m.flatShading?"#define FLAT_SHADED":"",m.skinning?"#define USE_SKINNING":"",m.useVertexTexture?"#define BONE_TEXTURE":"",m.morphTargets?"#define USE_MORPHTARGETS":
|
|
"#define USE_NORMALMAP":"",m.displacementMap&&m.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",m.specularMap?"#define USE_SPECULARMAP":"",m.roughnessMap?"#define USE_ROUGHNESSMAP":"",m.reflectivityMap?"#define USE_REFLECTIVITYMAP":"",m.metalnessMap?"#define USE_METALNESSMAP":"",m.alphaMap?"#define USE_ALPHAMAP":"",m.vertexColors?"#define USE_COLOR":"",m.flatShading?"#define FLAT_SHADED":"",m.skinning?"#define USE_SKINNING":"",m.useVertexTexture?"#define BONE_TEXTURE":"",m.morphTargets?"#define USE_MORPHTARGETS":
|
|
-"",m.morphNormals&&!1===m.flatShading?"#define USE_MORPHNORMALS":"",m.doubleSided?"#define DOUBLE_SIDED":"",m.flipSided?"#define FLIP_SIDED":"",m.shadowMapEnabled?"#define USE_SHADOWMAP":"",m.shadowMapEnabled?"#define "+v:"",m.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",0<m.pointLightShadows?"#define POINT_LIGHT_SHADOWS":"",m.sizeAttenuation?"#define USE_SIZEATTENUATION":"",m.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",m.logarithmicDepthBuffer&&h.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":
|
|
|
|
|
|
+"",m.morphNormals&&!1===m.flatShading?"#define USE_MORPHNORMALS":"",m.doubleSided?"#define DOUBLE_SIDED":"",m.flipSided?"#define FLIP_SIDED":"",m.shadowMapEnabled?"#define USE_SHADOWMAP":"",m.shadowMapEnabled?"#define "+w:"",m.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",0<m.pointLightShadows?"#define POINT_LIGHT_SHADOWS":"",m.sizeAttenuation?"#define USE_SIZEATTENUATION":"",m.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",m.logarithmicDepthBuffer&&h.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":
|
|
"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;",
|
|
"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;",
|
|
"\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(c).join("\n"),h=[n,"precision "+m.precision+" float;","precision "+m.precision+" int;","#define SHADER_NAME "+k.__webglShader.name,
|
|
"\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(c).join("\n"),h=[n,"precision "+m.precision+" float;","precision "+m.precision+" int;","#define SHADER_NAME "+k.__webglShader.name,
|
|
A,"#define MAX_DIR_LIGHTS "+m.maxDirLights,"#define MAX_POINT_LIGHTS "+m.maxPointLights,"#define MAX_SPOT_LIGHTS "+m.maxSpotLights,"#define MAX_HEMI_LIGHTS "+m.maxHemiLights,"#define MAX_SHADOWS "+m.maxShadows,m.alphaTest?"#define ALPHATEST "+m.alphaTest:"",h.gammaInput?"#define GAMMA_INPUT":"",h.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+x,m.useFog&&m.fog?"#define USE_FOG":"",m.useFog&&m.fogExp?"#define FOG_EXP2":"",m.map?"#define USE_MAP":"",m.envMap?"#define USE_ENVMAP":"",m.envMap?
|
|
A,"#define MAX_DIR_LIGHTS "+m.maxDirLights,"#define MAX_POINT_LIGHTS "+m.maxPointLights,"#define MAX_SPOT_LIGHTS "+m.maxSpotLights,"#define MAX_HEMI_LIGHTS "+m.maxHemiLights,"#define MAX_SHADOWS "+m.maxShadows,m.alphaTest?"#define ALPHATEST "+m.alphaTest:"",h.gammaInput?"#define GAMMA_INPUT":"",h.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+x,m.useFog&&m.fog?"#define USE_FOG":"",m.useFog&&m.fogExp?"#define FOG_EXP2":"",m.map?"#define USE_MAP":"",m.envMap?"#define USE_ENVMAP":"",m.envMap?
|
|
-"#define "+u:"",m.envMap?"#define "+w:"",m.envMap?"#define "+F:"",m.lightMap?"#define USE_LIGHTMAP":"",m.aoMap?"#define USE_AOMAP":"",m.emissiveMap?"#define USE_EMISSIVEMAP":"",m.bumpMap?"#define USE_BUMPMAP":"",m.normalMap?"#define USE_NORMALMAP":"",m.specularMap?"#define USE_SPECULARMAP":"",m.roughnessMap?"#define USE_ROUGHNESSMAP":"",m.reflectivityMap?"#define USE_REFLECTIVITYMAP":"",m.metalnessMap?"#define USE_METALNESSMAP":"",m.alphaMap?"#define USE_ALPHAMAP":"",m.vertexColors?"#define USE_COLOR":
|
|
|
|
-"",m.flatShading?"#define FLAT_SHADED":"",m.metal?"#define METAL":"",m.doubleSided?"#define DOUBLE_SIDED":"",m.flipSided?"#define FLIP_SIDED":"",m.shadowMapEnabled?"#define USE_SHADOWMAP":"",m.shadowMapEnabled?"#define "+v:"",m.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",0<m.pointLightShadows?"#define POINT_LIGHT_SHADOWS":"",m.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",m.logarithmicDepthBuffer&&h.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",m.envMap&&h.extensions.get("EXT_shader_texture_lod")?
|
|
|
|
-"#define TEXTURE_CUBE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(c).join("\n"));t=h+t;r=THREE.WebGLShader(p,p.VERTEX_SHADER,q+r);t=THREE.WebGLShader(p,p.FRAGMENT_SHADER,t);p.attachShader(z,r);p.attachShader(z,t);void 0!==k.index0AttributeName?p.bindAttribLocation(z,0,k.index0AttributeName):!0===m.morphTargets&&p.bindAttribLocation(z,0,"position");p.linkProgram(z);m=p.getProgramInfoLog(z);v=p.getShaderInfoLog(r);u=p.getShaderInfoLog(t);F=w=!0;if(!1===p.getProgramParameter(z,
|
|
|
|
-p.LINK_STATUS))w=!1,console.error("THREE.WebGLProgram: shader error: ",p.getError(),"gl.VALIDATE_STATUS",p.getProgramParameter(z,p.VALIDATE_STATUS),"gl.getProgramInfoLog",m,v,u);else if(""!==m)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",m);else if(""===v||""===u)F=!1;F&&(this.diagnostics={runnable:w,material:k,programLog:m,vertexShader:{log:v,prefix:q},fragmentShader:{log:u,prefix:h}});p.deleteShader(r);p.deleteShader(t);var B;this.getUniforms=function(){if(void 0===B){for(var a={},
|
|
|
|
|
|
+"#define "+t:"",m.envMap?"#define "+v:"",m.envMap?"#define "+F:"",m.lightMap?"#define USE_LIGHTMAP":"",m.aoMap?"#define USE_AOMAP":"",m.emissiveMap?"#define USE_EMISSIVEMAP":"",m.bumpMap?"#define USE_BUMPMAP":"",m.normalMap?"#define USE_NORMALMAP":"",m.specularMap?"#define USE_SPECULARMAP":"",m.roughnessMap?"#define USE_ROUGHNESSMAP":"",m.reflectivityMap?"#define USE_REFLECTIVITYMAP":"",m.metalnessMap?"#define USE_METALNESSMAP":"",m.alphaMap?"#define USE_ALPHAMAP":"",m.vertexColors?"#define USE_COLOR":
|
|
|
|
+"",m.flatShading?"#define FLAT_SHADED":"",m.metal?"#define METAL":"",m.doubleSided?"#define DOUBLE_SIDED":"",m.flipSided?"#define FLIP_SIDED":"",m.shadowMapEnabled?"#define USE_SHADOWMAP":"",m.shadowMapEnabled?"#define "+w:"",m.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",0<m.pointLightShadows?"#define POINT_LIGHT_SHADOWS":"",m.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",m.logarithmicDepthBuffer&&h.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",m.envMap&&h.extensions.get("EXT_shader_texture_lod")?
|
|
|
|
+"#define TEXTURE_CUBE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(c).join("\n"));u=h+u;r=THREE.WebGLShader(p,p.VERTEX_SHADER,q+r);u=THREE.WebGLShader(p,p.FRAGMENT_SHADER,u);p.attachShader(z,r);p.attachShader(z,u);void 0!==k.index0AttributeName?p.bindAttribLocation(z,0,k.index0AttributeName):!0===m.morphTargets&&p.bindAttribLocation(z,0,"position");p.linkProgram(z);m=p.getProgramInfoLog(z);w=p.getShaderInfoLog(r);t=p.getShaderInfoLog(u);F=v=!0;if(!1===p.getProgramParameter(z,
|
|
|
|
+p.LINK_STATUS))v=!1,console.error("THREE.WebGLProgram: shader error: ",p.getError(),"gl.VALIDATE_STATUS",p.getProgramParameter(z,p.VALIDATE_STATUS),"gl.getProgramInfoLog",m,w,t);else if(""!==m)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",m);else if(""===w||""===t)F=!1;F&&(this.diagnostics={runnable:v,material:k,programLog:m,vertexShader:{log:w,prefix:q},fragmentShader:{log:t,prefix:h}});p.deleteShader(r);p.deleteShader(u);var B;this.getUniforms=function(){if(void 0===B){for(var a={},
|
|
b=p.getProgramParameter(z,p.ACTIVE_UNIFORMS),c=0;c<b;c++){var d=p.getActiveUniform(z,c).name,h=p.getUniformLocation(z,d),k=e.exec(d);if(k){var d=k[1],k=k[2],l=a[d];l||(l=a[d]={});l[k]=h}else if(k=f.exec(d)){var l=k[1],d=k[2],k=k[3],n=a[l];n||(n=a[l]=[]);(l=n[d])||(l=n[d]={});l[k]=h}else(k=g.exec(d))?(l=k[1],a[l]=h):a[d]=h}B=a}return B};var y;this.getAttributes=function(){if(void 0===y){for(var a={},b=p.getProgramParameter(z,p.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=p.getActiveAttrib(z,c).name;a[d]=
|
|
b=p.getProgramParameter(z,p.ACTIVE_UNIFORMS),c=0;c<b;c++){var d=p.getActiveUniform(z,c).name,h=p.getUniformLocation(z,d),k=e.exec(d);if(k){var d=k[1],k=k[2],l=a[d];l||(l=a[d]={});l[k]=h}else if(k=f.exec(d)){var l=k[1],d=k[2],k=k[3],n=a[l];n||(n=a[l]=[]);(l=n[d])||(l=n[d]={});l[k]=h}else(k=g.exec(d))?(l=k[1],a[l]=h):a[d]=h}B=a}return B};var y;this.getAttributes=function(){if(void 0===y){for(var a={},b=p.getProgramParameter(z,p.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=p.getActiveAttrib(z,c).name;a[d]=
|
|
-p.getAttribLocation(z,d)}y=a}return y};this.destroy=function(){p.deleteProgram(z);this.program=void 0};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");return this.getAttributes()}}});this.id=d++;this.code=l;this.usedTimes=1;this.program=z;this.vertexShader=r;this.fragmentShader=t;return this}}();
|
|
|
|
|
|
+p.getAttribLocation(z,d)}y=a}return y};this.destroy=function(){p.deleteProgram(z);this.program=void 0};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");return this.getAttributes()}}});this.id=d++;this.code=l;this.usedTimes=1;this.program=z;this.vertexShader=r;this.fragmentShader=u;return this}}();
|
|
THREE.WebGLPrograms=function(a,b){var c=[],d={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},e="precision supportsVertexTextures map envMap envMapMode lightMap aoMap emissiveMap bumpMap normalMap displacementMap specularMap roughnessMap reflectivityMap metalnessMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals maxDirLights maxPointLights maxSpotLights maxHemiLights maxShadows shadowMapEnabled pointLightShadows shadowMapType shadowMapDebug alphaTest metal doubleSided flipSided".split(" ");
|
|
THREE.WebGLPrograms=function(a,b){var c=[],d={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},e="precision supportsVertexTextures map envMap envMapMode lightMap aoMap emissiveMap bumpMap normalMap displacementMap specularMap roughnessMap reflectivityMap metalnessMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals maxDirLights maxPointLights maxSpotLights maxHemiLights maxShadows shadowMapEnabled pointLightShadows shadowMapType shadowMapDebug alphaTest metal doubleSided flipSided".split(" ");
|
|
-this.getParameters=function(c,e,h,l){var k,m,p,n,q,r=d[c.type];k=q=n=p=m=0;for(var t=e.length;k<t;k++){var v=e[k];v instanceof THREE.DirectionalLight&&m++;v instanceof THREE.PointLight&&p++;v instanceof THREE.SpotLight&&n++;v instanceof THREE.HemisphereLight&&q++}for(var v=k=t=0,u=e.length;v<u;v++){var w=e[v];!1!==w.castShadow&&((w instanceof THREE.SpotLight||w instanceof THREE.DirectionalLight)&&t++,w instanceof THREE.PointLight&&(t++,k++))}e=t;b.floatVertexTextures&&l&&l.skeleton&&l.skeleton.useVertexTexture?
|
|
|
|
-t=1024:(t=Math.floor((b.maxVertexUniforms-20)/4),void 0!==l&&l instanceof THREE.SkinnedMesh&&(t=Math.min(l.skeleton.bones.length,t),t<l.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+l.skeleton.bones.length+", this GPU supports just "+t+" (try OpenGL instead of ANGLE)")));v=a.getPrecision();null!==c.precision&&(v=b.getMaxPrecision(c.precision),v!==c.precision&&console.warn("THREE.WebGLRenderer.initMaterial:",c.precision,"not supported, using",v,"instead."));return{shaderID:r,
|
|
|
|
-precision:v,supportsVertexTextures:b.vertexTextures,map:!!c.map,envMap:!!c.envMap,envMapMode:c.envMap&&c.envMap.mapping,lightMap:!!c.lightMap,aoMap:!!c.aoMap,emissiveMap:!!c.emissiveMap,bumpMap:!!c.bumpMap,normalMap:!!c.normalMap,displacementMap:!!c.displacementMap,roughnessMap:!!c.roughnessMap,reflectivityMap:!!c.reflectivityMap,metalnessMap:!!c.metalnessMap,specularMap:!!c.specularMap,alphaMap:!!c.alphaMap,combine:c.combine,vertexColors:c.vertexColors,fog:h,useFog:c.fog,fogExp:h instanceof THREE.FogExp2,
|
|
|
|
-flatShading:c.shading===THREE.FlatShading,sizeAttenuation:c.sizeAttenuation,logarithmicDepthBuffer:b.logarithmicDepthBuffer,skinning:c.skinning,maxBones:t,useVertexTexture:b.floatVertexTextures&&l&&l.skeleton&&l.skeleton.useVertexTexture,morphTargets:c.morphTargets,morphNormals:c.morphNormals,maxMorphTargets:a.maxMorphTargets,maxMorphNormals:a.maxMorphNormals,maxDirLights:m,maxPointLights:p,maxSpotLights:n,maxHemiLights:q,maxShadows:e,pointLightShadows:k,shadowMapEnabled:a.shadowMap.enabled&&l.receiveShadow&&
|
|
|
|
-0<e,shadowMapType:a.shadowMap.type,shadowMapDebug:a.shadowMap.debug,alphaTest:c.alphaTest,metal:c.metal,doubleSided:c.side===THREE.DoubleSide,flipSided:c.side===THREE.BackSide}};this.getProgramCode=function(a,b){var c=[];b.shaderID?c.push(b.shaderID):(c.push(a.fragmentShader),c.push(a.vertexShader));if(void 0!==a.defines)for(var d in a.defines)c.push(d),c.push(a.defines[d]);for(d=0;d<e.length;d++){var k=e[d];c.push(k);c.push(b[k])}return c.join()};this.acquireProgram=function(b,d,e){for(var l,k=0,
|
|
|
|
-m=c.length;k<m;k++){var p=c[k];if(p.code===e){l=p;++l.usedTimes;break}}void 0===l&&(l=new THREE.WebGLProgram(a,e,b,d),c.push(l));return l};this.releaseProgram=function(a){if(0===--a.usedTimes){var b=c.indexOf(a);c[b]=c[c.length-1];c.pop();a.destroy()}};this.programs=c};THREE.WebGLProperties=function(){var a={};this.get=function(b){b=b.uuid;var c=a[b];void 0===c&&(c={},a[b]=c);return c};this.delete=function(b){delete a[b.uuid]};this.clear=function(){a={}}};
|
|
|
|
|
|
+this.getParameters=function(c,e,h,l){var k=d[c.type],m;b.floatVertexTextures&&l&&l.skeleton&&l.skeleton.useVertexTexture?m=1024:(m=Math.floor((b.maxVertexUniforms-20)/4),void 0!==l&&l instanceof THREE.SkinnedMesh&&(m=Math.min(l.skeleton.bones.length,m),m<l.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+l.skeleton.bones.length+", this GPU supports just "+m+" (try OpenGL instead of ANGLE)")));var p=a.getPrecision();null!==c.precision&&(p=b.getMaxPrecision(c.precision),p!==c.precision&&
|
|
|
|
+console.warn("THREE.WebGLRenderer.initMaterial:",c.precision,"not supported, using",p,"instead."));return{shaderID:k,precision:p,supportsVertexTextures:b.vertexTextures,map:!!c.map,envMap:!!c.envMap,envMapMode:c.envMap&&c.envMap.mapping,lightMap:!!c.lightMap,aoMap:!!c.aoMap,emissiveMap:!!c.emissiveMap,bumpMap:!!c.bumpMap,normalMap:!!c.normalMap,displacementMap:!!c.displacementMap,roughnessMap:!!c.roughnessMap,reflectivityMap:!!c.reflectivityMap,metalnessMap:!!c.metalnessMap,specularMap:!!c.specularMap,
|
|
|
|
+alphaMap:!!c.alphaMap,combine:c.combine,vertexColors:c.vertexColors,fog:h,useFog:c.fog,fogExp:h instanceof THREE.FogExp2,flatShading:c.shading===THREE.FlatShading,sizeAttenuation:c.sizeAttenuation,logarithmicDepthBuffer:b.logarithmicDepthBuffer,skinning:c.skinning,maxBones:m,useVertexTexture:b.floatVertexTextures&&l&&l.skeleton&&l.skeleton.useVertexTexture,morphTargets:c.morphTargets,morphNormals:c.morphNormals,maxMorphTargets:a.maxMorphTargets,maxMorphNormals:a.maxMorphNormals,maxDirLights:e.directional.length,
|
|
|
|
+maxPointLights:e.point.length,maxSpotLights:e.spot.length,maxHemiLights:e.hemi.length,maxShadows:e.shadows,pointLightShadows:e.shadowsPointLight,shadowMapEnabled:a.shadowMap.enabled&&l.receiveShadow&&0<e.shadows,shadowMapType:a.shadowMap.type,shadowMapDebug:a.shadowMap.debug,alphaTest:c.alphaTest,metal:c.metal,doubleSided:c.side===THREE.DoubleSide,flipSided:c.side===THREE.BackSide}};this.getProgramCode=function(a,b){var c=[];b.shaderID?c.push(b.shaderID):(c.push(a.fragmentShader),c.push(a.vertexShader));
|
|
|
|
+if(void 0!==a.defines)for(var d in a.defines)c.push(d),c.push(a.defines[d]);for(d=0;d<e.length;d++){var k=e[d];c.push(k);c.push(b[k])}return c.join()};this.acquireProgram=function(b,d,e){for(var l,k=0,m=c.length;k<m;k++){var p=c[k];if(p.code===e){l=p;++l.usedTimes;break}}void 0===l&&(l=new THREE.WebGLProgram(a,e,b,d),c.push(l));return l};this.releaseProgram=function(a){if(0===--a.usedTimes){var b=c.indexOf(a);c[b]=c[c.length-1];c.pop();a.destroy()}};this.programs=c};
|
|
|
|
+THREE.WebGLProperties=function(){var a={};this.get=function(b){b=b.uuid;var c=a[b];void 0===c&&(c={},a[b]=c);return c};this.delete=function(b){delete a[b.uuid]};this.clear=function(){a={}}};
|
|
THREE.WebGLShader=function(){function a(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")}return function(b,c,d){var e=b.createShader(c);b.shaderSource(e,d);b.compileShader(e);!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(e)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",c===b.VERTEX_SHADER?"vertex":"fragment",b.getShaderInfoLog(e),a(d));return e}}();
|
|
THREE.WebGLShader=function(){function a(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")}return function(b,c,d){var e=b.createShader(c);b.shaderSource(e,d);b.compileShader(e);!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(e)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",c===b.VERTEX_SHADER?"vertex":"fragment",b.getShaderInfoLog(e),a(d));return e}}();
|
|
THREE.WebGLShadowMap=function(a,b,c){function d(a,b,c,d){var e=a.geometry,f=null,f=n,g=a.customDepthMaterial;c&&(f=q,g=a.customDistanceMaterial);g?f=g:(a=a instanceof THREE.SkinnedMesh&&b.skinning,g=0,void 0!==e.morphTargets&&0<e.morphTargets.length&&b.morphTargets&&(g|=1),a&&(g|=2),f=f[g]);f.visible=b.visible;f.wireframe=b.wireframe;f.wireframeLinewidth=b.wireframeLinewidth;c&&void 0!==f.uniforms.lightPos&&f.uniforms.lightPos.value.copy(d);return f}function e(a,b,c){if(!1!==a.visible){a.layers.test(b.layers)&&
|
|
THREE.WebGLShadowMap=function(a,b,c){function d(a,b,c,d){var e=a.geometry,f=null,f=n,g=a.customDepthMaterial;c&&(f=q,g=a.customDistanceMaterial);g?f=g:(a=a instanceof THREE.SkinnedMesh&&b.skinning,g=0,void 0!==e.morphTargets&&0<e.morphTargets.length&&b.morphTargets&&(g|=1),a&&(g|=2),f=f[g]);f.visible=b.visible;f.wireframe=b.wireframe;f.wireframeLinewidth=b.wireframeLinewidth;c&&void 0!==f.uniforms.lightPos&&f.uniforms.lightPos.value.copy(d);return f}function e(a,b,c){if(!1!==a.visible){a.layers.test(b.layers)&&
|
|
(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Points)&&a.castShadow&&(!1===a.frustumCulled||!0===h.intersectsObject(a))&&!0===a.material.visible&&(a.modelViewMatrix.multiplyMatrices(c.matrixWorldInverse,a.matrixWorld),p.push(a));a=a.children;for(var d=0,f=a.length;d<f;d++)e(a[d],b,c)}}var f=a.context,g=a.state,h=new THREE.Frustum,l=new THREE.Matrix4;new THREE.Vector3;new THREE.Vector3;for(var k=new THREE.Vector3,m=new THREE.Vector3,p=[],n=Array(4),q=Array(4),r=[new THREE.Vector3(1,
|
|
(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Points)&&a.castShadow&&(!1===a.frustumCulled||!0===h.intersectsObject(a))&&!0===a.material.visible&&(a.modelViewMatrix.multiplyMatrices(c.matrixWorldInverse,a.matrixWorld),p.push(a));a=a.children;for(var d=0,f=a.length;d<f;d++)e(a[d],b,c)}}var f=a.context,g=a.state,h=new THREE.Frustum,l=new THREE.Matrix4;new THREE.Vector3;new THREE.Vector3;for(var k=new THREE.Vector3,m=new THREE.Vector3,p=[],n=Array(4),q=Array(4),r=[new THREE.Vector3(1,
|
|
-0,0),new THREE.Vector3(-1,0,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1),new THREE.Vector3(0,1,0),new THREE.Vector3(0,-1,0)],t=[new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1)],v=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],u=new THREE.Vector4,w=THREE.ShaderLib.depthRGBA,F=THREE.UniformsUtils.clone(w.uniforms),x=THREE.ShaderLib.distanceRGBA,
|
|
|
|
-A=THREE.UniformsUtils.clone(x.uniforms),z=0;4!==z;++z){var B=0!==(z&1),y=0!==(z&2),H=new THREE.ShaderMaterial({uniforms:F,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,morphTargets:B,skinning:y});H._shadowPass=!0;n[z]=H;B=new THREE.ShaderMaterial({uniforms:A,vertexShader:x.vertexShader,fragmentShader:x.fragmentShader,morphTargets:B,skinning:y});B._shadowPass=!0;q[z]=B}var D=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;
|
|
|
|
-this.render=function(n,q){var w,x;if(!1!==D.enabled&&(!1!==D.autoUpdate||!1!==D.needsUpdate)){f.clearColor(1,1,1,1);g.disable(f.BLEND);g.enable(f.CULL_FACE);f.frontFace(f.CCW);f.cullFace(D.cullFace===THREE.CullFaceFront?f.FRONT:f.BACK);g.setDepthTest(!0);a.getViewport(u);for(var F=0,A=b.length;F<A;F++){var B=b[F];if(!0===B.castShadow){var z=B.shadow,y=z.camera,H=z.mapSize;if(B instanceof THREE.PointLight){w=6;x=!0;var L=H.x/4,C=H.y/2;v[0].set(2*L,C,L,C);v[1].set(0,C,L,C);v[2].set(3*L,C,L,C);v[3].set(L,
|
|
|
|
-C,L,C);v[4].set(3*L,0,L,C);v[5].set(L,0,L,C)}else w=1,x=!1;null===z.map&&(L=THREE.LinearFilter,D.type===THREE.PCFSoftShadowMap&&(L=THREE.NearestFilter),z.map=new THREE.WebGLRenderTarget(H.x,H.y,{minFilter:L,magFilter:L,format:THREE.RGBAFormat}),z.matrix=new THREE.Matrix4,B instanceof THREE.SpotLight&&(y.aspect=H.x/H.y),y.updateProjectionMatrix());H=z.map;z=z.matrix;m.setFromMatrixPosition(B.matrixWorld);y.position.copy(m);a.setRenderTarget(H);a.clear();for(H=0;H<w;H++)for(x?(k.copy(y.position),k.add(r[H]),
|
|
|
|
-y.up.copy(t[H]),y.lookAt(k),L=v[H],a.setViewport(L.x,L.y,L.z,L.w)):(k.setFromMatrixPosition(B.target.matrixWorld),y.lookAt(k)),y.updateMatrixWorld(),y.matrixWorldInverse.getInverse(y.matrixWorld),z.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),z.multiply(y.projectionMatrix),z.multiply(y.matrixWorldInverse),l.multiplyMatrices(y.projectionMatrix,y.matrixWorldInverse),h.setFromMatrix(l),p.length=0,e(n,q,y),L=0,C=p.length;L<C;L++){var X=p[L],U=c.update(X),Y=X.material;if(Y instanceof THREE.MeshFaceMaterial)for(var ea=
|
|
|
|
-U.groups,Y=Y.materials,aa=0,na=ea.length;aa<na;aa++){var pa=ea[aa],$=Y[pa.materialIndex];!0===$.visible&&($=d(X,$,x,m),a.renderBufferDirect(y,b,null,U,$,X,pa))}else $=d(X,Y,x,m),a.renderBufferDirect(y,b,null,U,$,X,null)}a.resetGLState()}}a.setViewport(u.x,u.y,u.z,u.w);w=a.getClearColor();x=a.getClearAlpha();a.setClearColor(w,x);g.enable(f.BLEND);D.cullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState();D.needsUpdate=!1}}};
|
|
|
|
-THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),f=new Uint8Array(16),g=new Uint8Array(16),h={},l=null,k=null,m=null,p=null,n=null,q=null,r=null,t=null,v=null,u=null,w=null,F=null,x=null,A=null,z=null,B=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),y=void 0,H={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);
|
|
|
|
|
|
+0,0),new THREE.Vector3(-1,0,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1),new THREE.Vector3(0,1,0),new THREE.Vector3(0,-1,0)],u=[new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1)],w=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],t=new THREE.Vector4,v=THREE.ShaderLib.depthRGBA,F=THREE.UniformsUtils.clone(v.uniforms),x=THREE.ShaderLib.distanceRGBA,
|
|
|
|
+A=THREE.UniformsUtils.clone(x.uniforms),z=0;4!==z;++z){var B=0!==(z&1),y=0!==(z&2),H=new THREE.ShaderMaterial({uniforms:F,vertexShader:v.vertexShader,fragmentShader:v.fragmentShader,morphTargets:B,skinning:y});H._shadowPass=!0;n[z]=H;B=new THREE.ShaderMaterial({uniforms:A,vertexShader:x.vertexShader,fragmentShader:x.fragmentShader,morphTargets:B,skinning:y});B._shadowPass=!0;q[z]=B}var D=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;
|
|
|
|
+this.render=function(n,q){var v,x;if(!1!==D.enabled&&(!1!==D.autoUpdate||!1!==D.needsUpdate)){f.clearColor(1,1,1,1);g.disable(f.BLEND);g.enable(f.CULL_FACE);f.frontFace(f.CCW);f.cullFace(D.cullFace===THREE.CullFaceFront?f.FRONT:f.BACK);g.setDepthTest(!0);a.getViewport(t);for(var F=0,A=b.length;F<A;F++){var B=b[F];if(!0===B.castShadow){var z=B.shadow,y=z.camera,H=z.mapSize;if(B instanceof THREE.PointLight){v=6;x=!0;var L=H.x/4,C=H.y/2;w[0].set(2*L,C,L,C);w[1].set(0,C,L,C);w[2].set(3*L,C,L,C);w[3].set(L,
|
|
|
|
+C,L,C);w[4].set(3*L,0,L,C);w[5].set(L,0,L,C)}else v=1,x=!1;null===z.map&&(L=THREE.LinearFilter,D.type===THREE.PCFSoftShadowMap&&(L=THREE.NearestFilter),z.map=new THREE.WebGLRenderTarget(H.x,H.y,{minFilter:L,magFilter:L,format:THREE.RGBAFormat}),z.matrix=new THREE.Matrix4,B instanceof THREE.SpotLight&&(y.aspect=H.x/H.y),y.updateProjectionMatrix());H=z.map;z=z.matrix;m.setFromMatrixPosition(B.matrixWorld);y.position.copy(m);a.setRenderTarget(H);a.clear();for(H=0;H<v;H++)for(x?(k.copy(y.position),k.add(r[H]),
|
|
|
|
+y.up.copy(u[H]),y.lookAt(k),L=w[H],a.setViewport(L.x,L.y,L.z,L.w)):(k.setFromMatrixPosition(B.target.matrixWorld),y.lookAt(k)),y.updateMatrixWorld(),y.matrixWorldInverse.getInverse(y.matrixWorld),z.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),z.multiply(y.projectionMatrix),z.multiply(y.matrixWorldInverse),l.multiplyMatrices(y.projectionMatrix,y.matrixWorldInverse),h.setFromMatrix(l),p.length=0,e(n,q,y),L=0,C=p.length;L<C;L++){var X=p[L],V=c.update(X),Y=X.material;if(Y instanceof THREE.MeshFaceMaterial)for(var ea=
|
|
|
|
+V.groups,Y=Y.materials,aa=0,na=ea.length;aa<na;aa++){var pa=ea[aa],$=Y[pa.materialIndex];!0===$.visible&&($=d(X,$,x,m),a.renderBufferDirect(y,b,null,V,$,X,pa))}else $=d(X,Y,x,m),a.renderBufferDirect(y,b,null,V,$,X,null)}a.resetGLState()}}a.setViewport(t.x,t.y,t.z,t.w);v=a.getClearColor();x=a.getClearAlpha();a.setClearColor(v,x);g.enable(f.BLEND);D.cullFace===THREE.CullFaceFront&&f.cullFace(f.BACK);a.resetGLState();D.needsUpdate=!1}}};
|
|
|
|
+THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),f=new Uint8Array(16),g=new Uint8Array(16),h={},l=null,k=null,m=null,p=null,n=null,q=null,r=null,u=null,w=null,t=null,v=null,F=null,x=null,A=null,z=null,B=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),y=void 0,H={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);
|
|
a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=e.length;a<b;a++)e[a]=0};this.enableAttribute=function(c){e[c]=1;0===f[c]&&(a.enableVertexAttribArray(c),f[c]=1);0!==g[c]&&(b.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c,0),g[c]=0)};this.enableAttributeAndDivisor=function(b,c,d){e[b]=1;0===f[b]&&(a.enableVertexAttribArray(b),f[b]=1);g[b]!==c&&(d.vertexAttribDivisorANGLE(b,c),g[b]=c)};this.disableUnusedAttributes=function(){for(var b=0,c=f.length;b<
|
|
a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=e.length;a<b;a++)e[a]=0};this.enableAttribute=function(c){e[c]=1;0===f[c]&&(a.enableVertexAttribArray(c),f[c]=1);0!==g[c]&&(b.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(c,0),g[c]=0)};this.enableAttributeAndDivisor=function(b,c,d){e[b]=1;0===f[b]&&(a.enableVertexAttribArray(b),f[b]=1);g[b]!==c&&(d.vertexAttribDivisorANGLE(b,c),g[b]=c)};this.disableUnusedAttributes=function(){for(var b=0,c=f.length;b<
|
|
c;b++)f[b]!==e[b]&&(a.disableVertexAttribArray(b),f[b]=0)};this.enable=function(b){!0!==h[b]&&(a.enable(b),h[b]=!0)};this.disable=function(b){!1!==h[b]&&(a.disable(b),h[b]=!1)};this.getCompressedTextureFormats=function(){if(null===l&&(l=[],b.get("WEBGL_compressed_texture_pvrtc")||b.get("WEBGL_compressed_texture_s3tc")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)l.push(c[d]);return l};this.setBlending=function(b,d,e,f,g,h,l){b!==k&&(b===THREE.NoBlending?this.disable(a.BLEND):
|
|
c;b++)f[b]!==e[b]&&(a.disableVertexAttribArray(b),f[b]=0)};this.enable=function(b){!0!==h[b]&&(a.enable(b),h[b]=!0)};this.disable=function(b){!1!==h[b]&&(a.disable(b),h[b]=!1)};this.getCompressedTextureFormats=function(){if(null===l&&(l=[],b.get("WEBGL_compressed_texture_pvrtc")||b.get("WEBGL_compressed_texture_s3tc")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)l.push(c[d]);return l};this.setBlending=function(b,d,e,f,g,h,l){b!==k&&(b===THREE.NoBlending?this.disable(a.BLEND):
|
|
b===THREE.AdditiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):b===THREE.SubtractiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):b===THREE.MultiplyBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):b===THREE.CustomBlending?this.enable(a.BLEND):(this.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,
|
|
b===THREE.AdditiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):b===THREE.SubtractiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):b===THREE.MultiplyBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):b===THREE.CustomBlending?this.enable(a.BLEND):(this.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,
|
|
-a.ONE,a.ONE_MINUS_SRC_ALPHA)),k=b);if(b===THREE.CustomBlending){g=g||d;h=h||e;l=l||f;if(d!==m||g!==q)a.blendEquationSeparate(c(d),c(g)),m=d,q=g;if(e!==p||f!==n||h!==r||l!==t)a.blendFuncSeparate(c(e),c(f),c(h),c(l)),p=e,n=f,r=h,t=l}else t=r=q=n=p=m=null};this.setDepthFunc=function(b){if(v!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);
|
|
|
|
-break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);v=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){u!==b&&(a.depthMask(b),u=b)};this.setColorWrite=function(b){w!==b&&(a.colorMask(b,b,b,b),w=b)};this.setFlipSided=
|
|
|
|
|
|
+a.ONE,a.ONE_MINUS_SRC_ALPHA)),k=b);if(b===THREE.CustomBlending){g=g||d;h=h||e;l=l||f;if(d!==m||g!==q)a.blendEquationSeparate(c(d),c(g)),m=d,q=g;if(e!==p||f!==n||h!==r||l!==u)a.blendFuncSeparate(c(e),c(f),c(h),c(l)),p=e,n=f,r=h,u=l}else u=r=q=n=p=m=null};this.setDepthFunc=function(b){if(w!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);
|
|
|
|
+break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);w=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){t!==b&&(a.depthMask(b),t=b)};this.setColorWrite=function(b){v!==b&&(a.colorMask(b,b,b,b),v=b)};this.setFlipSided=
|
|
function(b){F!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),F=b)};this.setLineWidth=function(b){b!==x&&(a.lineWidth(b),x=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||A===c&&z===d||(a.polygonOffset(c,d),A=c,z=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+B-1);y!==b&&(a.activeTexture(b),y=b)};this.bindTexture=function(b,c){void 0===
|
|
function(b){F!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),F=b)};this.setLineWidth=function(b){b!==x&&(a.lineWidth(b),x=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||A===c&&z===d||(a.polygonOffset(c,d),A=c,z=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+B-1);y!==b&&(a.activeTexture(b),y=b)};this.bindTexture=function(b,c){void 0===
|
|
-y&&d.activeTexture();var e=H[y];void 0===e&&(e={type:void 0,texture:void 0},H[y]=e);if(e.type!==b||e.texture!==c)a.bindTexture(b,c),e.type=b,e.texture=c};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<f.length;b++)1===f[b]&&(a.disableVertexAttribArray(b),f[b]=0);h={};F=w=u=k=l=null}};
|
|
|
|
-THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,l,k,m,p,n=a.context,q=a.state,r,t,v,u,w,F;this.render=function(x,A,z,B){if(0!==b.length){x=new THREE.Vector3;var y=B/z,H=.5*z,D=.5*B,E=16/B,Q=new THREE.Vector2(E*y,E),M=new THREE.Vector3(1,1,0),N=new THREE.Vector2(1,1);if(void 0===v){var E=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),G=new Uint16Array([0,1,2,0,2,3]);r=n.createBuffer();t=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,r);n.bufferData(n.ARRAY_BUFFER,E,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
|
|
|
|
-t);n.bufferData(n.ELEMENT_ARRAY_BUFFER,G,n.STATIC_DRAW);w=n.createTexture();F=n.createTexture();q.bindTexture(n.TEXTURE_2D,w);n.texImage2D(n.TEXTURE_2D,0,n.RGB,16,16,0,n.RGB,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);q.bindTexture(n.TEXTURE_2D,F);n.texImage2D(n.TEXTURE_2D,0,
|
|
|
|
-n.RGBA,16,16,0,n.RGBA,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);var E=(u=0<n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *= visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
|
|
|
|
|
|
+y&&d.activeTexture();var e=H[y];void 0===e&&(e={type:void 0,texture:void 0},H[y]=e);if(e.type!==b||e.texture!==c)a.bindTexture(b,c),e.type=b,e.texture=c};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<f.length;b++)1===f[b]&&(a.disableVertexAttribArray(b),f[b]=0);h={};F=v=t=k=l=null}};
|
|
|
|
+THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,l,k,m,p,n=a.context,q=a.state,r,u,w,t,v,F;this.render=function(x,A,z,B){if(0!==b.length){x=new THREE.Vector3;var y=B/z,H=.5*z,D=.5*B,E=16/B,Q=new THREE.Vector2(E*y,E),M=new THREE.Vector3(1,1,0),N=new THREE.Vector2(1,1);if(void 0===w){var E=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),G=new Uint16Array([0,1,2,0,2,3]);r=n.createBuffer();u=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,r);n.bufferData(n.ARRAY_BUFFER,E,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
|
|
|
|
+u);n.bufferData(n.ELEMENT_ARRAY_BUFFER,G,n.STATIC_DRAW);v=n.createTexture();F=n.createTexture();q.bindTexture(n.TEXTURE_2D,v);n.texImage2D(n.TEXTURE_2D,0,n.RGB,16,16,0,n.RGB,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);q.bindTexture(n.TEXTURE_2D,F);n.texImage2D(n.TEXTURE_2D,0,
|
|
|
|
+n.RGBA,16,16,0,n.RGBA,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);var E=(t=0<n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *= visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
|
|
fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
|
|
fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
|
|
fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
|
|
fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
|
|
-G=n.createProgram(),J=n.createShader(n.FRAGMENT_SHADER),K=n.createShader(n.VERTEX_SHADER),O="precision "+a.getPrecision()+" float;\n";n.shaderSource(J,O+E.fragmentShader);n.shaderSource(K,O+E.vertexShader);n.compileShader(J);n.compileShader(K);n.attachShader(G,J);n.attachShader(G,K);n.linkProgram(G);v=G;m=n.getAttribLocation(v,"position");p=n.getAttribLocation(v,"uv");c=n.getUniformLocation(v,"renderType");d=n.getUniformLocation(v,"map");e=n.getUniformLocation(v,"occlusionMap");f=n.getUniformLocation(v,
|
|
|
|
-"opacity");g=n.getUniformLocation(v,"color");h=n.getUniformLocation(v,"scale");l=n.getUniformLocation(v,"rotation");k=n.getUniformLocation(v,"screenPosition")}n.useProgram(v);q.initAttributes();q.enableAttribute(m);q.enableAttribute(p);q.disableUnusedAttributes();n.uniform1i(e,0);n.uniform1i(d,1);n.bindBuffer(n.ARRAY_BUFFER,r);n.vertexAttribPointer(m,2,n.FLOAT,!1,16,0);n.vertexAttribPointer(p,2,n.FLOAT,!1,16,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t);q.disable(n.CULL_FACE);n.depthMask(!1);G=0;for(J=
|
|
|
|
-b.length;G<J;G++)if(E=16/B,Q.set(E*y,E),K=b[G],x.set(K.matrixWorld.elements[12],K.matrixWorld.elements[13],K.matrixWorld.elements[14]),x.applyMatrix4(A.matrixWorldInverse),x.applyProjection(A.projectionMatrix),M.copy(x),N.x=M.x*H+H,N.y=M.y*D+D,u||0<N.x&&N.x<z&&0<N.y&&N.y<B){q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,null);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,w);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGB,N.x-8,N.y-8,16,16,0);n.uniform1i(c,0);n.uniform2f(h,Q.x,Q.y);n.uniform3f(k,
|
|
|
|
-M.x,M.y,M.z);q.disable(n.BLEND);q.enable(n.DEPTH_TEST);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,F);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,N.x-8,N.y-8,16,16,0);n.uniform1i(c,1);q.disable(n.DEPTH_TEST);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,w);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);K.positionScreen.copy(M);K.customUpdateCallback?K.customUpdateCallback(K):K.updateLensFlares();n.uniform1i(c,2);q.enable(n.BLEND);for(var O=
|
|
|
|
|
|
+G=n.createProgram(),J=n.createShader(n.FRAGMENT_SHADER),K=n.createShader(n.VERTEX_SHADER),O="precision "+a.getPrecision()+" float;\n";n.shaderSource(J,O+E.fragmentShader);n.shaderSource(K,O+E.vertexShader);n.compileShader(J);n.compileShader(K);n.attachShader(G,J);n.attachShader(G,K);n.linkProgram(G);w=G;m=n.getAttribLocation(w,"position");p=n.getAttribLocation(w,"uv");c=n.getUniformLocation(w,"renderType");d=n.getUniformLocation(w,"map");e=n.getUniformLocation(w,"occlusionMap");f=n.getUniformLocation(w,
|
|
|
|
+"opacity");g=n.getUniformLocation(w,"color");h=n.getUniformLocation(w,"scale");l=n.getUniformLocation(w,"rotation");k=n.getUniformLocation(w,"screenPosition")}n.useProgram(w);q.initAttributes();q.enableAttribute(m);q.enableAttribute(p);q.disableUnusedAttributes();n.uniform1i(e,0);n.uniform1i(d,1);n.bindBuffer(n.ARRAY_BUFFER,r);n.vertexAttribPointer(m,2,n.FLOAT,!1,16,0);n.vertexAttribPointer(p,2,n.FLOAT,!1,16,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,u);q.disable(n.CULL_FACE);n.depthMask(!1);G=0;for(J=
|
|
|
|
+b.length;G<J;G++)if(E=16/B,Q.set(E*y,E),K=b[G],x.set(K.matrixWorld.elements[12],K.matrixWorld.elements[13],K.matrixWorld.elements[14]),x.applyMatrix4(A.matrixWorldInverse),x.applyProjection(A.projectionMatrix),M.copy(x),N.x=M.x*H+H,N.y=M.y*D+D,t||0<N.x&&N.x<z&&0<N.y&&N.y<B){q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,null);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,v);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGB,N.x-8,N.y-8,16,16,0);n.uniform1i(c,0);n.uniform2f(h,Q.x,Q.y);n.uniform3f(k,
|
|
|
|
+M.x,M.y,M.z);q.disable(n.BLEND);q.enable(n.DEPTH_TEST);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,F);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,N.x-8,N.y-8,16,16,0);n.uniform1i(c,1);q.disable(n.DEPTH_TEST);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,v);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);K.positionScreen.copy(M);K.customUpdateCallback?K.customUpdateCallback(K):K.updateLensFlares();n.uniform1i(c,2);q.enable(n.BLEND);for(var O=
|
|
0,R=K.lensFlares.length;O<R;O++){var P=K.lensFlares[O];.001<P.opacity&&.001<P.scale&&(M.x=P.x,M.y=P.y,M.z=P.z,E=P.size*P.scale/B,Q.x=E*y,Q.y=E,n.uniform3f(k,M.x,M.y,M.z),n.uniform2f(h,Q.x,Q.y),n.uniform1f(l,P.rotation),n.uniform1f(f,P.opacity),n.uniform3f(g,P.color.r,P.color.g,P.color.b),q.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst),a.setTexture(P.texture,1),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0))}}q.enable(n.CULL_FACE);q.enable(n.DEPTH_TEST);n.depthMask(!0);a.resetGLState()}}};
|
|
0,R=K.lensFlares.length;O<R;O++){var P=K.lensFlares[O];.001<P.opacity&&.001<P.scale&&(M.x=P.x,M.y=P.y,M.z=P.z,E=P.size*P.scale/B,Q.x=E*y,Q.y=E,n.uniform3f(k,M.x,M.y,M.z),n.uniform2f(h,Q.x,Q.y),n.uniform1f(l,P.rotation),n.uniform1f(f,P.opacity),n.uniform3f(g,P.color.r,P.color.g,P.color.b),q.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst),a.setTexture(P.texture,1),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0))}}q.enable(n.CULL_FACE);q.enable(n.DEPTH_TEST);n.depthMask(!0);a.resetGLState()}}};
|
|
-THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,l,k,m,p,n,q,r,t,v,u,w;function F(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,A=a.state,z,B,y,H,D=new THREE.Vector3,E=new THREE.Quaternion,Q=new THREE.Vector3;this.render=function(M,N){if(0!==b.length){if(void 0===y){var G=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),J=new Uint16Array([0,1,2,0,2,3]);z=x.createBuffer();B=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,z);x.bufferData(x.ARRAY_BUFFER,G,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,
|
|
|
|
|
|
+THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,l,k,m,p,n,q,r,u,w,t,v;function F(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,A=a.state,z,B,y,H,D=new THREE.Vector3,E=new THREE.Quaternion,Q=new THREE.Vector3;this.render=function(M,N){if(0!==b.length){if(void 0===y){var G=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),J=new Uint16Array([0,1,2,0,2,3]);z=x.createBuffer();B=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,z);x.bufferData(x.ARRAY_BUFFER,G,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,
|
|
B);x.bufferData(x.ELEMENT_ARRAY_BUFFER,J,x.STATIC_DRAW);var G=x.createProgram(),J=x.createShader(x.VERTEX_SHADER),K=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(J,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
|
|
B);x.bufferData(x.ELEMENT_ARRAY_BUFFER,J,x.STATIC_DRAW);var G=x.createProgram(),J=x.createShader(x.VERTEX_SHADER),K=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(J,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
|
|
x.shaderSource(K,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
|
|
x.shaderSource(K,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
|
|
-x.compileShader(J);x.compileShader(K);x.attachShader(G,J);x.attachShader(G,K);x.linkProgram(G);y=G;u=x.getAttribLocation(y,"position");w=x.getAttribLocation(y,"uv");c=x.getUniformLocation(y,"uvOffset");d=x.getUniformLocation(y,"uvScale");e=x.getUniformLocation(y,"rotation");f=x.getUniformLocation(y,"scale");g=x.getUniformLocation(y,"color");h=x.getUniformLocation(y,"map");l=x.getUniformLocation(y,"opacity");k=x.getUniformLocation(y,"modelViewMatrix");m=x.getUniformLocation(y,"projectionMatrix");p=
|
|
|
|
-x.getUniformLocation(y,"fogType");n=x.getUniformLocation(y,"fogDensity");q=x.getUniformLocation(y,"fogNear");r=x.getUniformLocation(y,"fogFar");t=x.getUniformLocation(y,"fogColor");v=x.getUniformLocation(y,"alphaTest");G=document.createElement("canvas");G.width=8;G.height=8;J=G.getContext("2d");J.fillStyle="white";J.fillRect(0,0,8,8);H=new THREE.Texture(G);H.needsUpdate=!0}x.useProgram(y);A.initAttributes();A.enableAttribute(u);A.enableAttribute(w);A.disableUnusedAttributes();A.disable(x.CULL_FACE);
|
|
|
|
-A.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,z);x.vertexAttribPointer(u,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(w,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,B);x.uniformMatrix4fv(m,!1,N.projectionMatrix.elements);A.activeTexture(x.TEXTURE0);x.uniform1i(h,0);J=G=0;(K=M.fog)?(x.uniform3f(t,K.color.r,K.color.g,K.color.b),K instanceof THREE.Fog?(x.uniform1f(q,K.near),x.uniform1f(r,K.far),x.uniform1i(p,1),J=G=1):K instanceof THREE.FogExp2&&(x.uniform1f(n,K.density),x.uniform1i(p,2),J=G=2)):
|
|
|
|
-(x.uniform1i(p,0),J=G=0);for(var K=0,O=b.length;K<O;K++){var R=b[K];R.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,R.matrixWorld);R.z=-R.modelViewMatrix.elements[14]}b.sort(F);for(var P=[],K=0,O=b.length;K<O;K++){var R=b[K],L=R.material;x.uniform1f(v,L.alphaTest);x.uniformMatrix4fv(k,!1,R.modelViewMatrix.elements);R.matrixWorld.decompose(D,E,Q);P[0]=Q.x;P[1]=Q.y;R=0;M.fog&&L.fog&&(R=J);G!==R&&(x.uniform1i(p,R),G=R);null!==L.map?(x.uniform2f(c,L.map.offset.x,L.map.offset.y),x.uniform2f(d,
|
|
|
|
|
|
+x.compileShader(J);x.compileShader(K);x.attachShader(G,J);x.attachShader(G,K);x.linkProgram(G);y=G;t=x.getAttribLocation(y,"position");v=x.getAttribLocation(y,"uv");c=x.getUniformLocation(y,"uvOffset");d=x.getUniformLocation(y,"uvScale");e=x.getUniformLocation(y,"rotation");f=x.getUniformLocation(y,"scale");g=x.getUniformLocation(y,"color");h=x.getUniformLocation(y,"map");l=x.getUniformLocation(y,"opacity");k=x.getUniformLocation(y,"modelViewMatrix");m=x.getUniformLocation(y,"projectionMatrix");p=
|
|
|
|
+x.getUniformLocation(y,"fogType");n=x.getUniformLocation(y,"fogDensity");q=x.getUniformLocation(y,"fogNear");r=x.getUniformLocation(y,"fogFar");u=x.getUniformLocation(y,"fogColor");w=x.getUniformLocation(y,"alphaTest");G=document.createElement("canvas");G.width=8;G.height=8;J=G.getContext("2d");J.fillStyle="white";J.fillRect(0,0,8,8);H=new THREE.Texture(G);H.needsUpdate=!0}x.useProgram(y);A.initAttributes();A.enableAttribute(t);A.enableAttribute(v);A.disableUnusedAttributes();A.disable(x.CULL_FACE);
|
|
|
|
+A.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,z);x.vertexAttribPointer(t,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,B);x.uniformMatrix4fv(m,!1,N.projectionMatrix.elements);A.activeTexture(x.TEXTURE0);x.uniform1i(h,0);J=G=0;(K=M.fog)?(x.uniform3f(u,K.color.r,K.color.g,K.color.b),K instanceof THREE.Fog?(x.uniform1f(q,K.near),x.uniform1f(r,K.far),x.uniform1i(p,1),J=G=1):K instanceof THREE.FogExp2&&(x.uniform1f(n,K.density),x.uniform1i(p,2),J=G=2)):
|
|
|
|
+(x.uniform1i(p,0),J=G=0);for(var K=0,O=b.length;K<O;K++){var R=b[K];R.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,R.matrixWorld);R.z=-R.modelViewMatrix.elements[14]}b.sort(F);for(var P=[],K=0,O=b.length;K<O;K++){var R=b[K],L=R.material;x.uniform1f(w,L.alphaTest);x.uniformMatrix4fv(k,!1,R.modelViewMatrix.elements);R.matrixWorld.decompose(D,E,Q);P[0]=Q.x;P[1]=Q.y;R=0;M.fog&&L.fog&&(R=J);G!==R&&(x.uniform1i(p,R),G=R);null!==L.map?(x.uniform2f(c,L.map.offset.x,L.map.offset.y),x.uniform2f(d,
|
|
L.map.repeat.x,L.map.repeat.y)):(x.uniform2f(c,0,0),x.uniform2f(d,1,1));x.uniform1f(l,L.opacity);x.uniform3f(g,L.color.r,L.color.g,L.color.b);x.uniform1f(e,L.rotation);x.uniform2fv(f,P);A.setBlending(L.blending,L.blendEquation,L.blendSrc,L.blendDst);A.setDepthTest(L.depthTest);A.setDepthWrite(L.depthWrite);L.map&&L.map.image&&L.map.image.width?a.setTexture(L.map,0):a.setTexture(H,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}A.enable(x.CULL_FACE);a.resetGLState()}}};
|
|
L.map.repeat.x,L.map.repeat.y)):(x.uniform2f(c,0,0),x.uniform2f(d,1,1));x.uniform1f(l,L.opacity);x.uniform3f(g,L.color.r,L.color.g,L.color.b);x.uniform1f(e,L.rotation);x.uniform2fv(f,P);A.setBlending(L.blending,L.blendEquation,L.blendSrc,L.blendDst);A.setDepthTest(L.depthTest);A.setDepthWrite(L.depthWrite);L.map&&L.map.image&&L.map.image.width?a.setTexture(L.map,0):a.setTexture(H,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}A.enable(x.CULL_FACE);a.resetGLState()}}};
|
|
Object.defineProperties(THREE.Box2.prototype,{isIntersectionBox:{value:function(a){console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().");return this.intersectsBox(a)}}});
|
|
Object.defineProperties(THREE.Box2.prototype,{isIntersectionBox:{value:function(a){console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().");return this.intersectsBox(a)}}});
|
|
Object.defineProperties(THREE.Box3.prototype,{isIntersectionBox:{value:function(a){console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().");return this.intersectsBox(a)}},isIntersectionSphere:{value:function(a){console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().");return this.intersectsSphere(a)}}});
|
|
Object.defineProperties(THREE.Box3.prototype,{isIntersectionBox:{value:function(a){console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().");return this.intersectsBox(a)}},isIntersectionSphere:{value:function(a){console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().");return this.intersectsSphere(a)}}});
|
|
@@ -775,7 +775,7 @@ THREE.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been mov
|
|
THREE.CurveUtils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},tangentCubicBezier:function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},tangentSpline:function(a,b,c,d,e){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,d,e){a=.5*(c-a);d=.5*(d-b);var f=e*e;return(2*b-2*c+a+d)*e*f+(-3*b+3*c-2*a-d)*f+a*e+b}};
|
|
THREE.CurveUtils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},tangentCubicBezier:function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},tangentSpline:function(a,b,c,d,e){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,d,e){a=.5*(c-a);d=.5*(d-b);var f=e*e;return(2*b-2*c+a+d)*e*f+(-3*b+3*c-2*a-d)*f+a*e+b}};
|
|
THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Group,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};
|
|
THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Group,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};
|
|
THREE.ShapeUtils={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;e<b;d=e++)c+=a[d].x*a[e].y-a[e].x*a[d].y;return.5*c},triangulate:function(){return function(a,b){var c=a.length;if(3>c)return null;var d=[],e=[],f=[],g,h,l;if(0<THREE.ShapeUtils.area(a))for(h=0;h<c;h++)e[h]=h;else for(h=0;h<c;h++)e[h]=c-1-h;var k=2*c;for(h=c-1;2<c;){if(0>=k--){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}g=h;c<=g&&(g=0);h=g+1;c<=h&&(h=0);l=h+1;c<=l&&(l=0);var m;a:{var p=
|
|
THREE.ShapeUtils={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;e<b;d=e++)c+=a[d].x*a[e].y-a[e].x*a[d].y;return.5*c},triangulate:function(){return function(a,b){var c=a.length;if(3>c)return null;var d=[],e=[],f=[],g,h,l;if(0<THREE.ShapeUtils.area(a))for(h=0;h<c;h++)e[h]=h;else for(h=0;h<c;h++)e[h]=c-1-h;var k=2*c;for(h=c-1;2<c;){if(0>=k--){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}g=h;c<=g&&(g=0);h=g+1;c<=h&&(h=0);l=h+1;c<=l&&(l=0);var m;a:{var p=
|
|
-m=void 0,n=void 0,q=void 0,r=void 0,t=void 0,v=void 0,u=void 0,w=void 0,p=a[e[g]].x,n=a[e[g]].y,q=a[e[h]].x,r=a[e[h]].y,t=a[e[l]].x,v=a[e[l]].y;if(Number.EPSILON>(q-p)*(v-n)-(r-n)*(t-p))m=!1;else{var F=void 0,x=void 0,A=void 0,z=void 0,B=void 0,y=void 0,H=void 0,D=void 0,E=void 0,Q=void 0,E=D=H=w=u=void 0,F=t-q,x=v-r,A=p-t,z=n-v,B=q-p,y=r-n;for(m=0;m<c;m++)if(u=a[e[m]].x,w=a[e[m]].y,!(u===p&&w===n||u===q&&w===r||u===t&&w===v)&&(H=u-p,D=w-n,E=u-q,Q=w-r,u-=t,w-=v,E=F*Q-x*E,H=B*D-y*H,D=A*w-z*u,E>=-Number.EPSILON&&
|
|
|
|
|
|
+m=void 0,n=void 0,q=void 0,r=void 0,u=void 0,w=void 0,t=void 0,v=void 0,p=a[e[g]].x,n=a[e[g]].y,q=a[e[h]].x,r=a[e[h]].y,u=a[e[l]].x,w=a[e[l]].y;if(Number.EPSILON>(q-p)*(w-n)-(r-n)*(u-p))m=!1;else{var F=void 0,x=void 0,A=void 0,z=void 0,B=void 0,y=void 0,H=void 0,D=void 0,E=void 0,Q=void 0,E=D=H=v=t=void 0,F=u-q,x=w-r,A=p-u,z=n-w,B=q-p,y=r-n;for(m=0;m<c;m++)if(t=a[e[m]].x,v=a[e[m]].y,!(t===p&&v===n||t===q&&v===r||t===u&&v===w)&&(H=t-p,D=v-n,E=t-q,Q=v-r,t-=u,v-=w,E=F*Q-x*E,H=B*D-y*H,D=A*v-z*t,E>=-Number.EPSILON&&
|
|
D>=-Number.EPSILON&&H>=-Number.EPSILON)){m=!1;break a}m=!0}}if(m){d.push([a[e[g]],a[e[h]],a[e[l]]]);f.push([e[g],e[h],e[l]]);g=h;for(l=h+1;l<c;g++,l++)e[g]=e[l];c--;k=2*c}}return b?f:d}}(),triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,m=a.x-d.x,p=a.y-d.y,B=h*k-g*l,y=h*m-g*p;if(Math.abs(B)>Number.EPSILON){if(0<B){if(0>y||y>
|
|
D>=-Number.EPSILON&&H>=-Number.EPSILON)){m=!1;break a}m=!0}}if(m){d.push([a[e[g]],a[e[h]],a[e[l]]]);f.push([e[g],e[h],e[l]]);g=h;for(l=h+1;l<c;g++,l++)e[g]=e[l];c--;k=2*c}}return b?f:d}}(),triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,m=a.x-d.x,p=a.y-d.y,B=h*k-g*l,y=h*m-g*p;if(Math.abs(B)>Number.EPSILON){if(0<B){if(0>y||y>
|
|
B)return[];k=l*m-k*p;if(0>k||k>B)return[]}else{if(0<y||y<B)return[];k=l*m-k*p;if(0<k||k<B)return[]}if(0===k)return!f||0!==y&&y!==B?[a]:[];if(k===B)return!f||0!==y&&y!==B?[b]:[];if(0===y)return[d];if(y===B)return[e];f=k/B;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==y||l*m!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,B=d.x,l=e,d=e.x):(b=
|
|
B)return[];k=l*m-k*p;if(0>k||k>B)return[]}else{if(0<y||y<B)return[];k=l*m-k*p;if(0<k||k<B)return[]}if(0===k)return!f||0!==y&&y!==B?[a]:[];if(k===B)return!f||0!==y&&y!==B?[b]:[];if(0===y)return[d];if(y===B)return[e];f=k/B;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==y||l*m!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,B=d.x,l=e,d=e.x):(b=
|
|
e,B=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,B=d.y,l=e,d=e.y):(b=e,B=e.y,l=d,d=d.y));return k<=B?a<B?[]:a===B?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return Math.abs(a)>Number.EPSILON?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,l,k,m={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=
|
|
e,B=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,B=d.y,l=e,d=e.y):(b=e,B=e.y,l=d,d=d.y));return k<=B?a<B?[]:a===B?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return Math.abs(a)>Number.EPSILON?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,l,k,m={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=
|
|
@@ -796,14 +796,14 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=this.actions[this
|
|
THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:"splineThru",args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)};
|
|
THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:"splineThru",args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)};
|
|
THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g,h){var l=this.actions[this.actions.length-1].args;this.absellipse(a+l[l.length-2],b+l[l.length-1],c,d,e,f,g,h)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g,h){var l=[a,b,c,d,e,f,g,h||0];a=new THREE.EllipseCurve(a,b,c,d,e,f,g,h);this.curves.push(a);a=a.getPoint(1);l.push(a.x);l.push(a.y);this.actions.push({action:"ellipse",args:l})};
|
|
THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g,h){var l=this.actions[this.actions.length-1].args;this.absellipse(a+l[l.length-2],b+l[l.length-1],c,d,e,f,g,h)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g,h){var l=[a,b,c,d,e,f,g,h||0];a=new THREE.EllipseCurve(a,b,c,d,e,f,g,h);this.curves.push(a);a=a.getPoint(1);l.push(a.x);l.push(a.y);this.actions.push({action:"ellipse",args:l})};
|
|
THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};
|
|
THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};
|
|
-THREE.Path.prototype.getPoints=function(a,b){a=a||12;for(var c=THREE.ShapeUtils.b2,d=THREE.ShapeUtils.b3,e=[],f,g,h,l,k,m,p,n,q,r,t=0,v=this.actions.length;t<v;t++){q=this.actions[t];var u=q.args;switch(q.action){case "moveTo":e.push(new THREE.Vector2(u[0],u[1]));break;case "lineTo":e.push(new THREE.Vector2(u[0],u[1]));break;case "quadraticCurveTo":f=u[2];g=u[3];k=u[0];m=u[1];0<e.length?(q=e[e.length-1],p=q.x,n=q.y):(q=this.actions[t-1].args,p=q[q.length-2],n=q[q.length-1]);for(u=1;u<=a;u++)r=u/a,
|
|
|
|
-q=c(r,p,k,f),r=c(r,n,m,g),e.push(new THREE.Vector2(q,r));break;case "bezierCurveTo":f=u[4];g=u[5];k=u[0];m=u[1];h=u[2];l=u[3];0<e.length?(q=e[e.length-1],p=q.x,n=q.y):(q=this.actions[t-1].args,p=q[q.length-2],n=q[q.length-1]);for(u=1;u<=a;u++)r=u/a,q=d(r,p,k,h,f),r=d(r,n,m,l,g),e.push(new THREE.Vector2(q,r));break;case "splineThru":q=this.actions[t-1].args;r=[new THREE.Vector2(q[q.length-2],q[q.length-1])];q=a*u[0].length;r=r.concat(u[0]);r=new THREE.SplineCurve(r);for(u=1;u<=q;u++)e.push(r.getPointAt(u/
|
|
|
|
-q));break;case "arc":f=u[0];g=u[1];m=u[2];h=u[3];q=u[4];k=!!u[5];p=q-h;n=2*a;for(u=1;u<=n;u++)r=u/n,k||(r=1-r),r=h+r*p,q=f+m*Math.cos(r),r=g+m*Math.sin(r),e.push(new THREE.Vector2(q,r));break;case "ellipse":f=u[0];g=u[1];m=u[2];l=u[3];h=u[4];q=u[5];k=!!u[6];var w=u[7];p=q-h;n=2*a;var F,x;0!==w&&(F=Math.cos(w),x=Math.sin(w));for(u=1;u<=n;u++){r=u/n;k||(r=1-r);r=h+r*p;q=f+m*Math.cos(r);r=g+l*Math.sin(r);if(0!==w){var A=q;q=(A-f)*F-(r-g)*x+f;r=(A-f)*x+(r-g)*F+g}e.push(new THREE.Vector2(q,r))}}}c=e[e.length-
|
|
|
|
|
|
+THREE.Path.prototype.getPoints=function(a,b){a=a||12;for(var c=THREE.ShapeUtils.b2,d=THREE.ShapeUtils.b3,e=[],f,g,h,l,k,m,p,n,q,r,u=0,w=this.actions.length;u<w;u++){q=this.actions[u];var t=q.args;switch(q.action){case "moveTo":e.push(new THREE.Vector2(t[0],t[1]));break;case "lineTo":e.push(new THREE.Vector2(t[0],t[1]));break;case "quadraticCurveTo":f=t[2];g=t[3];k=t[0];m=t[1];0<e.length?(q=e[e.length-1],p=q.x,n=q.y):(q=this.actions[u-1].args,p=q[q.length-2],n=q[q.length-1]);for(t=1;t<=a;t++)r=t/a,
|
|
|
|
+q=c(r,p,k,f),r=c(r,n,m,g),e.push(new THREE.Vector2(q,r));break;case "bezierCurveTo":f=t[4];g=t[5];k=t[0];m=t[1];h=t[2];l=t[3];0<e.length?(q=e[e.length-1],p=q.x,n=q.y):(q=this.actions[u-1].args,p=q[q.length-2],n=q[q.length-1]);for(t=1;t<=a;t++)r=t/a,q=d(r,p,k,h,f),r=d(r,n,m,l,g),e.push(new THREE.Vector2(q,r));break;case "splineThru":q=this.actions[u-1].args;r=[new THREE.Vector2(q[q.length-2],q[q.length-1])];q=a*t[0].length;r=r.concat(t[0]);r=new THREE.SplineCurve(r);for(t=1;t<=q;t++)e.push(r.getPointAt(t/
|
|
|
|
+q));break;case "arc":f=t[0];g=t[1];m=t[2];h=t[3];q=t[4];k=!!t[5];p=q-h;n=2*a;for(t=1;t<=n;t++)r=t/n,k||(r=1-r),r=h+r*p,q=f+m*Math.cos(r),r=g+m*Math.sin(r),e.push(new THREE.Vector2(q,r));break;case "ellipse":f=t[0];g=t[1];m=t[2];l=t[3];h=t[4];q=t[5];k=!!t[6];var v=t[7];p=q-h;n=2*a;var F,x;0!==v&&(F=Math.cos(v),x=Math.sin(v));for(t=1;t<=n;t++){r=t/n;k||(r=1-r);r=h+r*p;q=f+m*Math.cos(r);r=g+l*Math.sin(r);if(0!==v){var A=q;q=(A-f)*F-(r-g)*x+f;r=(A-f)*x+(r-g)*F+g}e.push(new THREE.Vector2(q,r))}}}c=e[e.length-
|
|
1];Math.abs(c.x-e[0].x)<Number.EPSILON&&Math.abs(c.y-e[0].y)<Number.EPSILON&&e.splice(e.length-1,1);b&&e.push(e[0]);return e};
|
|
1];Math.abs(c.x-e[0].x)<Number.EPSILON&&Math.abs(c.y-e[0].y)<Number.EPSILON&&e.splice(e.length-1,1);b&&e.push(e[0]);return e};
|
|
THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,l=h.y-g.y;if(Math.abs(l)>Number.EPSILON){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||
|
|
THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,l=h.y-g.y;if(Math.abs(l)>Number.EPSILON){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||
|
|
g.x<=a.x&&a.x<=h.x))return!0}return d}var e=THREE.ShapeUtils.isClockWise,f=function(a){for(var b=[],c=new THREE.Path,d=0,e=a.length;d<e;d++){var f=a[d],g=f.args,f=f.action;"moveTo"===f&&0!==c.actions.length&&(b.push(c),c=new THREE.Path);c[f].apply(c,g)}0!==c.actions.length&&b.push(c);return b}(this.actions);if(0===f.length)return[];if(!0===b)return c(f);var g,h,l,k=[];if(1===f.length)return h=f[0],l=new THREE.Shape,l.actions=h.actions,l.curves=h.curves,k.push(l),k;var m=!e(f[0].getPoints()),m=a?!m:
|
|
g.x<=a.x&&a.x<=h.x))return!0}return d}var e=THREE.ShapeUtils.isClockWise,f=function(a){for(var b=[],c=new THREE.Path,d=0,e=a.length;d<e;d++){var f=a[d],g=f.args,f=f.action;"moveTo"===f&&0!==c.actions.length&&(b.push(c),c=new THREE.Path);c[f].apply(c,g)}0!==c.actions.length&&b.push(c);return b}(this.actions);if(0===f.length)return[];if(!0===b)return c(f);var g,h,l,k=[];if(1===f.length)return h=f[0],l=new THREE.Shape,l.actions=h.actions,l.curves=h.curves,k.push(l),k;var m=!e(f[0].getPoints()),m=a?!m:
|
|
-m;l=[];var p=[],n=[],q=0,r;p[q]=void 0;n[q]=[];for(var t=0,v=f.length;t<v;t++)h=f[t],r=h.getPoints(),g=e(r),(g=a?!g:g)?(!m&&p[q]&&q++,p[q]={s:new THREE.Shape,p:r},p[q].s.actions=h.actions,p[q].s.curves=h.curves,m&&q++,n[q]=[]):n[q].push({h:h,p:r[0]});if(!p[0])return c(f);if(1<p.length){t=!1;h=[];e=0;for(f=p.length;e<f;e++)l[e]=[];e=0;for(f=p.length;e<f;e++)for(g=n[e],m=0;m<g.length;m++){q=g[m];r=!0;for(v=0;v<p.length;v++)d(q.p,p[v].p)&&(e!==v&&h.push({froms:e,tos:v,hole:m}),r?(r=!1,l[v].push(q)):
|
|
|
|
-t=!0);r&&l[e].push(q)}0<h.length&&(t||(n=l))}t=0;for(e=p.length;t<e;t++)for(l=p[t].s,k.push(l),h=n[t],f=0,g=h.length;f<g;f++)l.holes.push(h[f].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};
|
|
|
|
|
|
+m;l=[];var p=[],n=[],q=0,r;p[q]=void 0;n[q]=[];for(var u=0,w=f.length;u<w;u++)h=f[u],r=h.getPoints(),g=e(r),(g=a?!g:g)?(!m&&p[q]&&q++,p[q]={s:new THREE.Shape,p:r},p[q].s.actions=h.actions,p[q].s.curves=h.curves,m&&q++,n[q]=[]):n[q].push({h:h,p:r[0]});if(!p[0])return c(f);if(1<p.length){u=!1;h=[];e=0;for(f=p.length;e<f;e++)l[e]=[];e=0;for(f=p.length;e<f;e++)for(g=n[e],m=0;m<g.length;m++){q=g[m];r=!0;for(w=0;w<p.length;w++)d(q.p,p[w].p)&&(e!==w&&h.push({froms:e,tos:w,hole:m}),r?(r=!1,l[w].push(q)):
|
|
|
|
+u=!0);r&&l[e].push(q)}0<h.length&&(u||(n=l))}u=0;for(e=p.length;u<e;u++)for(l=p[u].s,k.push(l),h=n[u],f=0,g=h.length;f<g;f++)l.holes.push(h[f].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};
|
|
THREE.Shape.prototype.getPointsHoles=function(a){for(var b=[],c=0,d=this.holes.length;c<d;c++)b[c]=this.holes[c].getPoints(a);return b};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.extractAllPoints(a)};THREE.Shape.Utils=THREE.ShapeUtils;THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);
|
|
THREE.Shape.prototype.getPointsHoles=function(a){for(var b=[],c=0,d=this.holes.length;c<d;c++)b[c]=this.holes[c].getPoints(a);return b};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.extractAllPoints(a)};THREE.Shape.Utils=THREE.ShapeUtils;THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);
|
|
THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);
|
|
THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);
|
|
THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=THREE.ShapeUtils.b2;return new THREE.Vector2(b(a,this.v0.x,this.v1.x,this.v2.x),b(a,this.v0.y,this.v1.y,this.v2.y))};THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=THREE.CurveUtils.tangentQuadraticBezier;return(new THREE.Vector2(b(a,this.v0.x,this.v1.x,this.v2.x),b(a,this.v0.y,this.v1.y,this.v2.y))).normalize()};
|
|
THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=THREE.ShapeUtils.b2;return new THREE.Vector2(b(a,this.v0.x,this.v1.x,this.v2.x),b(a,this.v0.y,this.v1.y,this.v2.y))};THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=THREE.CurveUtils.tangentQuadraticBezier;return(new THREE.Vector2(b(a,this.v0.x,this.v1.x,this.v2.x),b(a,this.v0.y,this.v1.y,this.v2.y))).normalize()};
|
|
@@ -820,58 +820,58 @@ THREE.CatmullRomCurve3=function(){function a(){}var b=new THREE.Vector3,c=new a,
|
|
b*a};return THREE.Curve.create(function(a){this.points=a||[]},function(a){var g=this.points,h,l;l=g.length;2>l&&console.log("duh, you need at least 2 points");a*=l-1;h=Math.floor(a);a-=h;0===a&&h===l-1&&(h=l-2,a=1);var k,m,p;0===h?(b.subVectors(g[0],g[1]).add(g[0]),k=b):k=g[h-1];m=g[h];p=g[h+1];h+2<l?g=g[h+2]:(b.subVectors(g[l-1],g[l-2]).add(g[l-2]),g=b);if(void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var n="chordal"===this.type?.5:.25;l=Math.pow(k.distanceToSquared(m),n);
|
|
b*a};return THREE.Curve.create(function(a){this.points=a||[]},function(a){var g=this.points,h,l;l=g.length;2>l&&console.log("duh, you need at least 2 points");a*=l-1;h=Math.floor(a);a-=h;0===a&&h===l-1&&(h=l-2,a=1);var k,m,p;0===h?(b.subVectors(g[0],g[1]).add(g[0]),k=b):k=g[h-1];m=g[h];p=g[h+1];h+2<l?g=g[h+2]:(b.subVectors(g[l-1],g[l-2]).add(g[l-2]),g=b);if(void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var n="chordal"===this.type?.5:.25;l=Math.pow(k.distanceToSquared(m),n);
|
|
h=Math.pow(m.distanceToSquared(p),n);n=Math.pow(p.distanceToSquared(g),n);1E-4>h&&(h=1);1E-4>l&&(l=h);1E-4>n&&(n=h);c.initNonuniformCatmullRom(k.x,m.x,p.x,g.x,l,h,n);d.initNonuniformCatmullRom(k.y,m.y,p.y,g.y,l,h,n);e.initNonuniformCatmullRom(k.z,m.z,p.z,g.z,l,h,n)}else"catmullrom"===this.type&&(l=void 0!==this.tension?this.tension:.5,c.initCatmullRom(k.x,m.x,p.x,g.x,l),d.initCatmullRom(k.y,m.y,p.y,g.y,l),e.initCatmullRom(k.z,m.z,p.z,g.z,l));return new THREE.Vector3(c.calc(a),d.calc(a),e.calc(a))})}();
|
|
h=Math.pow(m.distanceToSquared(p),n);n=Math.pow(p.distanceToSquared(g),n);1E-4>h&&(h=1);1E-4>l&&(l=h);1E-4>n&&(n=h);c.initNonuniformCatmullRom(k.x,m.x,p.x,g.x,l,h,n);d.initNonuniformCatmullRom(k.y,m.y,p.y,g.y,l,h,n);e.initNonuniformCatmullRom(k.z,m.z,p.z,g.z,l,h,n)}else"catmullrom"===this.type&&(l=void 0!==this.tension?this.tension:.5,c.initCatmullRom(k.x,m.x,p.x,g.x,l),d.initCatmullRom(k.y,m.y,p.y,g.y,l),e.initCatmullRom(k.z,m.z,p.z,g.z,l));return new THREE.Vector3(c.calc(a),d.calc(a),e.calc(a))})}();
|
|
THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(0<c?0:(Math.floor(Math.abs(c)/b.length)+1)*b.length),d=b[(c-1)%b.length],e=b[c%b.length],f=b[(c+1)%b.length],b=b[(c+2)%b.length],c=THREE.CurveUtils.interpolate;return new THREE.Vector3(c(d.x,e.x,f.x,b.x,a),c(d.y,e.y,f.y,b.y,a),c(d.z,e.z,f.z,b.z,a))});
|
|
THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(0<c?0:(Math.floor(Math.abs(c)/b.length)+1)*b.length),d=b[(c-1)%b.length],e=b[c%b.length],f=b[(c+1)%b.length],b=b[(c+2)%b.length],c=THREE.CurveUtils.interpolate;return new THREE.Vector3(c(d.x,e.x,f.x,b.x,a),c(d.y,e.y,f.y,b.y,a),c(d.z,e.z,f.z,b.z,a))});
|
|
-THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,t){var v,u=h.widthSegments,w=h.heightSegments,F=e/2,x=f/2,A=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",w=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",u=h.depthSegments;var z=u+1,B=w+1,y=e/u,H=f/w,D=new THREE.Vector3;D[v]=0<g?1:-1;for(e=0;e<B;e++)for(f=0;f<z;f++){var E=new THREE.Vector3;E[a]=(f*y-F)*c;E[b]=(e*H-x)*d;E[v]=g;h.vertices.push(E)}for(e=
|
|
|
|
-0;e<w;e++)for(f=0;f<u;f++)x=f+z*e,a=f+z*(e+1),b=f+1+z*(e+1),c=f+1+z*e,d=new THREE.Vector2(f/u,1-e/w),g=new THREE.Vector2(f/u,1-(e+1)/w),v=new THREE.Vector2((f+1)/u,1-(e+1)/w),F=new THREE.Vector2((f+1)/u,1-e/w),x=new THREE.Face3(x+A,a+A,c+A),x.normal.copy(D),x.vertexNormals.push(D.clone(),D.clone(),D.clone()),x.materialIndex=t,h.faces.push(x),h.faceVertexUvs[0].push([d,g,F]),x=new THREE.Face3(a+A,b+A,c+A),x.normal.copy(D),x.vertexNormals.push(D.clone(),D.clone(),D.clone()),x.materialIndex=t,h.faces.push(x),
|
|
|
|
-h.faceVertexUvs[0].push([g.clone(),v,F.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
|
|
|
+THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,u){var w,t=h.widthSegments,v=h.heightSegments,F=e/2,x=f/2,A=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)w="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)w="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)w="x",t=h.depthSegments;var z=t+1,B=v+1,y=e/t,H=f/v,D=new THREE.Vector3;D[w]=0<g?1:-1;for(e=0;e<B;e++)for(f=0;f<z;f++){var E=new THREE.Vector3;E[a]=(f*y-F)*c;E[b]=(e*H-x)*d;E[w]=g;h.vertices.push(E)}for(e=
|
|
|
|
+0;e<v;e++)for(f=0;f<t;f++)x=f+z*e,a=f+z*(e+1),b=f+1+z*(e+1),c=f+1+z*e,d=new THREE.Vector2(f/t,1-e/v),g=new THREE.Vector2(f/t,1-(e+1)/v),w=new THREE.Vector2((f+1)/t,1-(e+1)/v),F=new THREE.Vector2((f+1)/t,1-e/v),x=new THREE.Face3(x+A,a+A,c+A),x.normal.copy(D),x.vertexNormals.push(D.clone(),D.clone(),D.clone()),x.materialIndex=u,h.faces.push(x),h.faceVertexUvs[0].push([d,g,F]),x=new THREE.Face3(a+A,b+A,c+A),x.normal.copy(D),x.vertexNormals.push(D.clone(),D.clone(),D.clone()),x.materialIndex=u,h.faces.push(x),
|
|
|
|
+h.faceVertexUvs[0].push([g.clone(),w,F.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.CubeGeometry=THREE.BoxGeometry;THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};this.fromBufferGeometry(new THREE.CircleBufferGeometry(a,b,c,d))};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
|
|
THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.CubeGeometry=THREE.BoxGeometry;THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};this.fromBufferGeometry(new THREE.CircleBufferGeometry(a,b,c,d))};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
|
|
THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,f=new Float32Array(3*e),g=new Float32Array(3*e),e=new Float32Array(2*e);g[2]=1;e[0]=.5;e[1]=.5;for(var h=0,l=3,k=2;h<=b;h++,l+=3,k+=2){var m=c+h/b*d;f[l]=a*Math.cos(m);f[l+1]=a*Math.sin(m);g[l+2]=1;e[k]=(f[l]/a+1)/2;e[k+1]=(f[l+1]/a+1)/2}c=
|
|
THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,f=new Float32Array(3*e),g=new Float32Array(3*e),e=new Float32Array(2*e);g[2]=1;e[0]=.5;e[1]=.5;for(var h=0,l=3,k=2;h<=b;h++,l+=3,k+=2){var m=c+h/b*d;f[l]=a*Math.cos(m);f[l+1]=a*Math.sin(m);g[l+2]=1;e[k]=(f[l]/a+1)/2;e[k+1]=(f[l+1]/a+1)/2}c=
|
|
[];for(l=1;l<=b;l++)c.push(l,l+1,0);this.setIndex(new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(f,3));this.addAttribute("normal",new THREE.BufferAttribute(g,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
|
|
[];for(l=1;l<=b;l++)c.push(l,l+1,0);this.setIndex(new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(f,3));this.addAttribute("normal",new THREE.BufferAttribute(g,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
|
|
-THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var l=c/2,k,m,p=[],n=[];for(m=0;m<=e;m++){var q=[],r=[],t=m/e,v=t*(b-a)+a;for(k=0;k<=d;k++){var u=k/d,w=new THREE.Vector3;w.x=v*Math.sin(u*h+
|
|
|
|
-g);w.y=-t*c+l;w.z=v*Math.cos(u*h+g);this.vertices.push(w);q.push(this.vertices.length-1);r.push(new THREE.Vector2(u,1-t))}p.push(q);n.push(r)}c=(b-a)/c;for(k=0;k<d;k++)for(0!==a?(g=this.vertices[p[0][k]].clone(),h=this.vertices[p[0][k+1]].clone()):(g=this.vertices[p[1][k]].clone(),h=this.vertices[p[1][k+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),m=0;m<e;m++){var q=p[m][k],r=p[m+1][k],t=p[m+1][k+1],v=p[m][k+1],u=g.clone(),w=g.clone(),
|
|
|
|
-F=h.clone(),x=h.clone(),A=n[m][k].clone(),z=n[m+1][k].clone(),B=n[m+1][k+1].clone(),y=n[m][k+1].clone();this.faces.push(new THREE.Face3(q,r,v,[u,w,x]));this.faceVertexUvs[0].push([A,z,y]);this.faces.push(new THREE.Face3(r,t,v,[w.clone(),F,x.clone()]));this.faceVertexUvs[0].push([z.clone(),B,y.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,l,0)),k=0;k<d;k++)q=p[0][k],r=p[0][k+1],t=this.vertices.length-1,u=new THREE.Vector3(0,1,0),w=new THREE.Vector3(0,1,0),F=new THREE.Vector3(0,
|
|
|
|
-1,0),A=n[0][k].clone(),z=n[0][k+1].clone(),B=new THREE.Vector2(z.x,0),this.faces.push(new THREE.Face3(q,r,t,[u,w,F],void 0,1)),this.faceVertexUvs[0].push([A,z,B]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-l,0)),k=0;k<d;k++)q=p[e][k+1],r=p[e][k],t=this.vertices.length-1,u=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),F=new THREE.Vector3(0,-1,0),A=n[e][k+1].clone(),z=n[e][k].clone(),B=new THREE.Vector2(z.x,1),this.faces.push(new THREE.Face3(q,r,t,[u,w,F],void 0,2)),this.faceVertexUvs[0].push([A,
|
|
|
|
|
|
+THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var l=c/2,k,m,p=[],n=[];for(m=0;m<=e;m++){var q=[],r=[],u=m/e,w=u*(b-a)+a;for(k=0;k<=d;k++){var t=k/d,v=new THREE.Vector3;v.x=w*Math.sin(t*h+
|
|
|
|
+g);v.y=-u*c+l;v.z=w*Math.cos(t*h+g);this.vertices.push(v);q.push(this.vertices.length-1);r.push(new THREE.Vector2(t,1-u))}p.push(q);n.push(r)}c=(b-a)/c;for(k=0;k<d;k++)for(0!==a?(g=this.vertices[p[0][k]].clone(),h=this.vertices[p[0][k+1]].clone()):(g=this.vertices[p[1][k]].clone(),h=this.vertices[p[1][k+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),m=0;m<e;m++){var q=p[m][k],r=p[m+1][k],u=p[m+1][k+1],w=p[m][k+1],t=g.clone(),v=g.clone(),
|
|
|
|
+F=h.clone(),x=h.clone(),A=n[m][k].clone(),z=n[m+1][k].clone(),B=n[m+1][k+1].clone(),y=n[m][k+1].clone();this.faces.push(new THREE.Face3(q,r,w,[t,v,x]));this.faceVertexUvs[0].push([A,z,y]);this.faces.push(new THREE.Face3(r,u,w,[v.clone(),F,x.clone()]));this.faceVertexUvs[0].push([z.clone(),B,y.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,l,0)),k=0;k<d;k++)q=p[0][k],r=p[0][k+1],u=this.vertices.length-1,t=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),F=new THREE.Vector3(0,
|
|
|
|
+1,0),A=n[0][k].clone(),z=n[0][k+1].clone(),B=new THREE.Vector2(z.x,0),this.faces.push(new THREE.Face3(q,r,u,[t,v,F],void 0,1)),this.faceVertexUvs[0].push([A,z,B]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-l,0)),k=0;k<d;k++)q=p[e][k+1],r=p[e][k],u=this.vertices.length-1,t=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),F=new THREE.Vector3(0,-1,0),A=n[e][k+1].clone(),z=n[e][k].clone(),B=new THREE.Vector2(z.x,1),this.faces.push(new THREE.Face3(q,r,u,[t,v,F],void 0,2)),this.faceVertexUvs[0].push([A,
|
|
z,B]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
|
|
z,B]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
|
|
THREE.EdgesGeometry=function(a,b){function c(a,b){return a-b}THREE.BufferGeometry.call(this);var d=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),e=[0,0],f={},g=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var l=h.vertices;h=h.faces;for(var k=0,m=h.length;k<m;k++)for(var p=h[k],n=0;3>n;n++){e[0]=p[g[n]];e[1]=p[g[(n+1)%3]];e.sort(c);var q=e.toString();void 0===f[q]?f[q]={vert1:e[0],vert2:e[1],face1:k,
|
|
THREE.EdgesGeometry=function(a,b){function c(a,b){return a-b}THREE.BufferGeometry.call(this);var d=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),e=[0,0],f={},g=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var l=h.vertices;h=h.faces;for(var k=0,m=h.length;k<m;k++)for(var p=h[k],n=0;3>n;n++){e[0]=p[g[n]];e[1]=p[g[(n+1)%3]];e.sort(c);var q=e.toString();void 0===f[q]?f[q]={vert1:e[0],vert2:e[1],face1:k,
|
|
face2:void 0}:f[q].face2=k}e=[];for(q in f)if(g=f[q],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=d)k=l[g.vert1],e.push(k.x),e.push(k.y),e.push(k.z),k=l[g.vert2],e.push(k.x),e.push(k.y),e.push(k.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(e),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
|
|
face2:void 0}:f[q].face2=k}e=[];for(q in f)if(g=f[q],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=d)k=l[g.vert1],e.push(k.x),e.push(k.y),e.push(k.z),k=l[g.vert2],e.push(k.x),e.push(k.y),e.push(k.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(e),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
|
|
THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
|
|
THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
|
|
THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(Math.abs(d*g-e*f)>Number.EPSILON){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,d>Number.EPSILON?
|
|
THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(Math.abs(d*g-e*f)>Number.EPSILON){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,d>Number.EPSILON?
|
|
-f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(C=a.length;0<=--C;){c=C;d=C-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*m,e=0;e<f;e++){var g=R*e,h=R*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+D,g=g+D,l=l+D,h=h+D;H.faces.push(new THREE.Face3(k,g,h,null,null,1));H.faces.push(new THREE.Face3(g,l,h,null,null,1));k=u.generateSideWallUV(H,
|
|
|
|
-k,g,l,h);H.faceVertexUvs[0].push([k[0],k[1],k[3]]);H.faceVertexUvs[0].push([k[1],k[2],k[3]])}}}function f(a,b,c){H.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=D;b+=D;c+=D;H.faces.push(new THREE.Face3(a,b,c,null,null,0));a=u.generateTopUV(H,a,b,c);H.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,l=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:l-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,
|
|
|
|
-n=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,r=b.extrudePath,t,v=!1,u=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,F,x,A;r&&(t=r.getSpacedPoints(q),v=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(r,q,!1),F=new THREE.Vector3,x=new THREE.Vector3,A=new THREE.Vector3);p||(k=l=m=0);var z,B,y,H=this,D=this.vertices.length,r=a.extractPoints(n),n=r.shape,E=r.holes;if(r=!THREE.ShapeUtils.isClockWise(n)){n=n.reverse();
|
|
|
|
-B=0;for(y=E.length;B<y;B++)z=E[B],THREE.ShapeUtils.isClockWise(z)&&(E[B]=z.reverse());r=!1}var Q=THREE.ShapeUtils.triangulateShape(n,E),M=n;B=0;for(y=E.length;B<y;B++)z=E[B],n=n.concat(z);var N,G,J,K,O,R=n.length,P,L=Q.length,r=[],C=0;J=M.length;N=J-1;for(G=C+1;C<J;C++,N++,G++)N===J&&(N=0),G===J&&(G=0),r[C]=d(M[C],M[N],M[G]);var X=[],U,Y=r.concat();B=0;for(y=E.length;B<y;B++){z=E[B];U=[];C=0;J=z.length;N=J-1;for(G=C+1;C<J;C++,N++,G++)N===J&&(N=0),G===J&&(G=0),U[C]=d(z[C],z[N],z[G]);X.push(U);Y=Y.concat(U)}for(N=
|
|
|
|
-0;N<m;N++){J=N/m;K=l*(1-J);G=k*Math.sin(J*Math.PI/2);C=0;for(J=M.length;C<J;C++)O=c(M[C],r[C],G),f(O.x,O.y,-K);B=0;for(y=E.length;B<y;B++)for(z=E[B],U=X[B],C=0,J=z.length;C<J;C++)O=c(z[C],U[C],G),f(O.x,O.y,-K)}G=k;for(C=0;C<R;C++)O=p?c(n[C],Y[C],G):n[C],v?(x.copy(w.normals[0]).multiplyScalar(O.x),F.copy(w.binormals[0]).multiplyScalar(O.y),A.copy(t[0]).add(x).add(F),f(A.x,A.y,A.z)):f(O.x,O.y,0);for(J=1;J<=q;J++)for(C=0;C<R;C++)O=p?c(n[C],Y[C],G):n[C],v?(x.copy(w.normals[J]).multiplyScalar(O.x),F.copy(w.binormals[J]).multiplyScalar(O.y),
|
|
|
|
-A.copy(t[J]).add(x).add(F),f(A.x,A.y,A.z)):f(O.x,O.y,h/q*J);for(N=m-1;0<=N;N--){J=N/m;K=l*(1-J);G=k*Math.sin(J*Math.PI/2);C=0;for(J=M.length;C<J;C++)O=c(M[C],r[C],G),f(O.x,O.y,h+K);B=0;for(y=E.length;B<y;B++)for(z=E[B],U=X[B],C=0,J=z.length;C<J;C++)O=c(z[C],U[C],G),v?f(O.x,O.y+t[q-1].y,t[q-1].x+K):f(O.x,O.y,h+K)}(function(){if(p){var a;a=0*R;for(C=0;C<L;C++)P=Q[C],g(P[2]+a,P[1]+a,P[0]+a);a=q+2*m;a*=R;for(C=0;C<L;C++)P=Q[C],g(P[0]+a,P[1]+a,P[2]+a)}else{for(C=0;C<L;C++)P=Q[C],g(P[2],P[1],P[0]);for(C=
|
|
|
|
|
|
+f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(C=a.length;0<=--C;){c=C;d=C-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*m,e=0;e<f;e++){var g=R*e,h=R*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+D,g=g+D,l=l+D,h=h+D;H.faces.push(new THREE.Face3(k,g,h,null,null,1));H.faces.push(new THREE.Face3(g,l,h,null,null,1));k=t.generateSideWallUV(H,
|
|
|
|
+k,g,l,h);H.faceVertexUvs[0].push([k[0],k[1],k[3]]);H.faceVertexUvs[0].push([k[1],k[2],k[3]])}}}function f(a,b,c){H.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=D;b+=D;c+=D;H.faces.push(new THREE.Face3(a,b,c,null,null,0));a=t.generateTopUV(H,a,b,c);H.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,l=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:l-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,
|
|
|
|
+n=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,r=b.extrudePath,u,w=!1,t=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,F,x,A;r&&(u=r.getSpacedPoints(q),w=!0,p=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(r,q,!1),F=new THREE.Vector3,x=new THREE.Vector3,A=new THREE.Vector3);p||(k=l=m=0);var z,B,y,H=this,D=this.vertices.length,r=a.extractPoints(n),n=r.shape,E=r.holes;if(r=!THREE.ShapeUtils.isClockWise(n)){n=n.reverse();
|
|
|
|
+B=0;for(y=E.length;B<y;B++)z=E[B],THREE.ShapeUtils.isClockWise(z)&&(E[B]=z.reverse());r=!1}var Q=THREE.ShapeUtils.triangulateShape(n,E),M=n;B=0;for(y=E.length;B<y;B++)z=E[B],n=n.concat(z);var N,G,J,K,O,R=n.length,P,L=Q.length,r=[],C=0;J=M.length;N=J-1;for(G=C+1;C<J;C++,N++,G++)N===J&&(N=0),G===J&&(G=0),r[C]=d(M[C],M[N],M[G]);var X=[],V,Y=r.concat();B=0;for(y=E.length;B<y;B++){z=E[B];V=[];C=0;J=z.length;N=J-1;for(G=C+1;C<J;C++,N++,G++)N===J&&(N=0),G===J&&(G=0),V[C]=d(z[C],z[N],z[G]);X.push(V);Y=Y.concat(V)}for(N=
|
|
|
|
+0;N<m;N++){J=N/m;K=l*(1-J);G=k*Math.sin(J*Math.PI/2);C=0;for(J=M.length;C<J;C++)O=c(M[C],r[C],G),f(O.x,O.y,-K);B=0;for(y=E.length;B<y;B++)for(z=E[B],V=X[B],C=0,J=z.length;C<J;C++)O=c(z[C],V[C],G),f(O.x,O.y,-K)}G=k;for(C=0;C<R;C++)O=p?c(n[C],Y[C],G):n[C],w?(x.copy(v.normals[0]).multiplyScalar(O.x),F.copy(v.binormals[0]).multiplyScalar(O.y),A.copy(u[0]).add(x).add(F),f(A.x,A.y,A.z)):f(O.x,O.y,0);for(J=1;J<=q;J++)for(C=0;C<R;C++)O=p?c(n[C],Y[C],G):n[C],w?(x.copy(v.normals[J]).multiplyScalar(O.x),F.copy(v.binormals[J]).multiplyScalar(O.y),
|
|
|
|
+A.copy(u[J]).add(x).add(F),f(A.x,A.y,A.z)):f(O.x,O.y,h/q*J);for(N=m-1;0<=N;N--){J=N/m;K=l*(1-J);G=k*Math.sin(J*Math.PI/2);C=0;for(J=M.length;C<J;C++)O=c(M[C],r[C],G),f(O.x,O.y,h+K);B=0;for(y=E.length;B<y;B++)for(z=E[B],V=X[B],C=0,J=z.length;C<J;C++)O=c(z[C],V[C],G),w?f(O.x,O.y+u[q-1].y,u[q-1].x+K):f(O.x,O.y,h+K)}(function(){if(p){var a;a=0*R;for(C=0;C<L;C++)P=Q[C],g(P[2]+a,P[1]+a,P[0]+a);a=q+2*m;a*=R;for(C=0;C<L;C++)P=Q[C],g(P[0]+a,P[1]+a,P[2]+a)}else{for(C=0;C<L;C++)P=Q[C],g(P[2],P[1],P[0]);for(C=
|
|
0;C<L;C++)P=Q[C],g(P[0]+R*q,P[1]+R*q,P[2]+R*q)}})();(function(){var a=0;e(M,a);a+=M.length;B=0;for(y=E.length;B<y;B++)z=E[B],e(z,a),a+=z.length})()};
|
|
0;C<L;C++)P=Q[C],g(P[0]+R*q,P[1]+R*q,P[2]+R*q)}})();(function(){var a=0;e(M,a);a+=M.length;B=0;for(y=E.length;B<y;B++)z=E[B],e(z,a),a+=z.length})()};
|
|
THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
|
|
THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
|
|
1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
|
|
1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
|
|
THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var l=e.shape,k=e.holes;if(!THREE.ShapeUtils.isClockWise(l))for(l=l.reverse(),e=0,f=k.length;e<f;e++)g=k[e],THREE.ShapeUtils.isClockWise(g)&&(k[e]=g.reverse());var m=THREE.ShapeUtils.triangulateShape(l,k);e=0;for(f=k.length;e<f;e++)g=k[e],l=l.concat(g);
|
|
THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var l=e.shape,k=e.holes;if(!THREE.ShapeUtils.isClockWise(l))for(l=l.reverse(),e=0,f=k.length;e<f;e++)g=k[e],THREE.ShapeUtils.isClockWise(g)&&(k[e]=g.reverse());var m=THREE.ShapeUtils.triangulateShape(l,k);e=0;for(f=k.length;e<f;e++)g=k[e],l=l.concat(g);
|
|
k=l.length;f=m.length;for(e=0;e<k;e++)g=l[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)k=m[e],l=k[0]+h,g=k[1]+h,k=k[2]+h,this.faces.push(new THREE.Face3(l,g,k,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,l,g,k))};
|
|
k=l.length;f=m.length;for(e=0;e<k;e++)g=l[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)k=m[e],l=k[0]+h,g=k[1]+h,k=k[2]+h,this.faces.push(new THREE.Face3(l,g,k,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,l,g,k))};
|
|
THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var l=c+g*f*d,k=Math.cos(l),m=Math.sin(l),l=0,p=a.length;l<p;l++){var n=a[l],q=new THREE.Vector3;q.x=k*n.x-m*n.y;q.y=m*n.x+k*n.y;q.z=n.z;this.vertices.push(q)}c=a.length;g=0;for(h=b;g<h;g++)for(l=0,p=a.length-1;l<p;l++){b=m=l+c*g;d=m+c;var k=m+1+c,m=m+1,n=g*f,q=l*e,r=
|
|
THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var l=c+g*f*d,k=Math.cos(l),m=Math.sin(l),l=0,p=a.length;l<p;l++){var n=a[l],q=new THREE.Vector3;q.x=k*n.x-m*n.y;q.y=m*n.x+k*n.y;q.z=n.z;this.vertices.push(q)}c=a.length;g=0;for(h=b;g<h;g++)for(l=0,p=a.length-1;l<p;l++){b=m=l+c*g;d=m+c;var k=m+1+c,m=m+1,n=g*f,q=l*e,r=
|
|
-n+f,t=q+e;this.faces.push(new THREE.Face3(b,d,m));this.faceVertexUvs[0].push([new THREE.Vector2(n,q),new THREE.Vector2(r,q),new THREE.Vector2(n,t)]);this.faces.push(new THREE.Face3(d,k,m));this.faceVertexUvs[0].push([new THREE.Vector2(r,q),new THREE.Vector2(r,t),new THREE.Vector2(n,t)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
|
|
|
|
|
|
+n+f,u=q+e;this.faces.push(new THREE.Face3(b,d,m));this.faceVertexUvs[0].push([new THREE.Vector2(n,q),new THREE.Vector2(r,q),new THREE.Vector2(n,u)]);this.faces.push(new THREE.Face3(d,k,m));this.faceVertexUvs[0].push([new THREE.Vector2(r,q),new THREE.Vector2(r,u),new THREE.Vector2(n,u)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
|
|
THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
|
|
THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
|
|
-THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,l=a/c,k=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var m=new Float32Array(g*h*2),p=0,n=0,q=0;q<h;q++)for(var r=q*k-f,t=0;t<g;t++)b[p]=t*l-e,b[p+1]=-r,a[p+2]=1,m[n]=t/c,m[n+1]=1-q/d,p+=3,n+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
|
|
|
|
-d*6);for(q=0;q<d;q++)for(t=0;t<c;t++)f=t+g*(q+1),h=t+1+g*(q+1),l=t+1+g*q,e[p]=t+g*q,e[p+1]=f,e[p+2]=l,e[p+3]=f,e[p+4]=h,e[p+5]=l,p+=6;this.setIndex(new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(m,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
|
|
|
|
|
|
+THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,l=a/c,k=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var m=new Float32Array(g*h*2),p=0,n=0,q=0;q<h;q++)for(var r=q*k-f,u=0;u<g;u++)b[p]=u*l-e,b[p+1]=-r,a[p+2]=1,m[n]=u/c,m[n+1]=1-q/d,p+=3,n+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
|
|
|
|
+d*6);for(q=0;q<d;q++)for(u=0;u<c;u++)f=u+g*(q+1),h=u+1+g*(q+1),l=u+1+g*q,e[p]=u+g*q,e[p+1]=f,e[p+2]=l,e[p+3]=f,e[p+4]=h,e[p+5]=l,p+=6;this.setIndex(new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(m,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
|
|
THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var g,h=[],l=a,k=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var m=new THREE.Vector3,p=e+g/c*f;m.x=l*Math.cos(p);m.y=l*Math.sin(p);this.vertices.push(m);h.push(new THREE.Vector2((m.x/b+1)/2,
|
|
THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var g,h=[],l=a,k=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var m=new THREE.Vector3,p=e+g/c*f;m.x=l*Math.cos(p);m.y=l*Math.sin(p);this.vertices.push(m);h.push(new THREE.Vector2((m.x/b+1)/2,
|
|
(m.y/b+1)/2))}l+=k}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=p=g+e,k=p+c+1,m=p+c+2,this.faces.push(new THREE.Face3(f,k,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[k].clone(),h[m].clone()]),f=p,k=p+c+2,m=p+1,this.faces.push(new THREE.Face3(f,k,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[k].clone(),h[m].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,l)};
|
|
(m.y/b+1)/2))}l+=k}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=p=g+e,k=p+c+1,m=p+c+2,this.faces.push(new THREE.Face3(f,k,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[k].clone(),h[m].clone()]),f=p,k=p+c+2,m=p+1,this.faces.push(new THREE.Face3(f,k,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[k].clone(),h[m].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,l)};
|
|
THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};this.fromBufferGeometry(new THREE.SphereBufferGeometry(a,b,c,d,e,f,g))};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};this.fromBufferGeometry(new THREE.SphereBufferGeometry(a,b,c,d,e,f,g))};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
|
|
THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
|
|
THREE.SphereBufferGeometry=function(a,b,c,d,e,f,g){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;for(var h=f+g,l=(b+1)*(c+1),k=new THREE.BufferAttribute(new Float32Array(3*l),3),m=new THREE.BufferAttribute(new Float32Array(3*
|
|
THREE.SphereBufferGeometry=function(a,b,c,d,e,f,g){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;for(var h=f+g,l=(b+1)*(c+1),k=new THREE.BufferAttribute(new Float32Array(3*l),3),m=new THREE.BufferAttribute(new Float32Array(3*
|
|
-l),3),l=new THREE.BufferAttribute(new Float32Array(2*l),2),p=0,n=[],q=new THREE.Vector3,r=0;r<=c;r++){for(var t=[],v=r/c,u=0;u<=b;u++){var w=u/b,F=-a*Math.cos(d+w*e)*Math.sin(f+v*g),x=a*Math.cos(f+v*g),A=a*Math.sin(d+w*e)*Math.sin(f+v*g);q.set(F,x,A).normalize();k.setXYZ(p,F,x,A);m.setXYZ(p,q.x,q.y,q.z);l.setXY(p,w,1-v);t.push(p);p++}n.push(t)}d=[];for(r=0;r<c;r++)for(u=0;u<b;u++)e=n[r][u+1],g=n[r][u],p=n[r+1][u],q=n[r+1][u+1],(0!==r||0<f)&&d.push(e,g,q),(r!==c-1||h<Math.PI)&&d.push(g,p,q);this.setIndex(new (65535<
|
|
|
|
|
|
+l),3),l=new THREE.BufferAttribute(new Float32Array(2*l),2),p=0,n=[],q=new THREE.Vector3,r=0;r<=c;r++){for(var u=[],w=r/c,t=0;t<=b;t++){var v=t/b,F=-a*Math.cos(d+v*e)*Math.sin(f+w*g),x=a*Math.cos(f+w*g),A=a*Math.sin(d+v*e)*Math.sin(f+w*g);q.set(F,x,A).normalize();k.setXYZ(p,F,x,A);m.setXYZ(p,q.x,q.y,q.z);l.setXY(p,v,1-w);u.push(p);p++}n.push(u)}d=[];for(r=0;r<c;r++)for(t=0;t<b;t++)e=n[r][t+1],g=n[r][t],p=n[r+1][t],q=n[r+1][t+1],(0!==r||0<f)&&d.push(e,g,q),(r!==c-1||h<Math.PI)&&d.push(g,p,q);this.setIndex(new (65535<
|
|
k.count?THREE.Uint32Attribute:THREE.Uint16Attribute)(d,1));this.addAttribute("position",k);this.addAttribute("normal",m);this.addAttribute("uv",l);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
|
|
k.count?THREE.Uint32Attribute:THREE.Uint16Attribute)(d,1));this.addAttribute("position",k);this.addAttribute("normal",m);this.addAttribute("uv",l);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
|
|
THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],l=0;l<=c;l++)for(var k=0;k<=d;k++){var m=k/d*e,p=l/c*Math.PI*2;f.x=a*Math.cos(m);f.y=a*Math.sin(m);var n=new THREE.Vector3;n.x=(a+b*Math.cos(p))*Math.cos(m);n.y=(a+b*Math.cos(p))*Math.sin(m);n.z=b*Math.sin(p);this.vertices.push(n);g.push(new THREE.Vector2(k/
|
|
THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],l=0;l<=c;l++)for(var k=0;k<=d;k++){var m=k/d*e,p=l/c*Math.PI*2;f.x=a*Math.cos(m);f.y=a*Math.sin(m);var n=new THREE.Vector3;n.x=(a+b*Math.cos(p))*Math.cos(m);n.y=(a+b*Math.cos(p))*Math.sin(m);n.z=b*Math.sin(p);this.vertices.push(n);g.push(new THREE.Vector2(k/
|
|
d,l/c));h.push(n.clone().sub(f).normalize())}for(l=1;l<=c;l++)for(k=1;k<=d;k++)a=(d+1)*l+k-1,b=(d+1)*(l-1)+k-1,e=(d+1)*(l-1)+k,f=(d+1)*l+k,m=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),m=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};
|
|
d,l/c));h.push(n.clone().sub(f).normalize())}for(l=1;l<=c;l++)for(k=1;k<=d;k++)a=(d+1)*l+k-1,b=(d+1)*(l-1)+k-1,e=(d+1)*(l-1)+k,f=(d+1)*l+k,m=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),m=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};
|
|
THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
|
|
THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
|
|
THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var l=Array(c),k=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=0;n<c;++n){l[n]=
|
|
THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var l=Array(c),k=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=0;n<c;++n){l[n]=
|
|
-Array(d);var q=n/c*2*e*Math.PI,r=h(q,f,e,a,g),q=h(q+.01,f,e,a,g);k.subVectors(q,r);m.addVectors(q,r);p.crossVectors(k,m);m.crossVectors(p,k);p.normalize();m.normalize();for(q=0;q<d;++q){var t=q/d*2*Math.PI,v=-b*Math.cos(t),t=b*Math.sin(t),u=new THREE.Vector3;u.x=r.x+v*m.x+t*p.x;u.y=r.y+v*m.y+t*p.y;u.z=r.z+v*m.z+t*p.z;l[n][q]=this.vertices.push(u)-1}}for(n=0;n<c;++n)for(q=0;q<d;++q)e=(n+1)%c,f=(q+1)%d,a=l[n][q],b=l[e][q],e=l[e][f],f=l[n][f],g=new THREE.Vector2(n/c,q/d),k=new THREE.Vector2((n+1)/c,
|
|
|
|
|
|
+Array(d);var q=n/c*2*e*Math.PI,r=h(q,f,e,a,g),q=h(q+.01,f,e,a,g);k.subVectors(q,r);m.addVectors(q,r);p.crossVectors(k,m);m.crossVectors(p,k);p.normalize();m.normalize();for(q=0;q<d;++q){var u=q/d*2*Math.PI,w=-b*Math.cos(u),u=b*Math.sin(u),t=new THREE.Vector3;t.x=r.x+w*m.x+u*p.x;t.y=r.y+w*m.y+u*p.y;t.z=r.z+w*m.z+u*p.z;l[n][q]=this.vertices.push(t)-1}}for(n=0;n<c;++n)for(q=0;q<d;++q)e=(n+1)%c,f=(q+1)%d,a=l[n][q],b=l[e][q],e=l[e][f],f=l[n][f],g=new THREE.Vector2(n/c,q/d),k=new THREE.Vector2((n+1)/c,
|
|
q/d),m=new THREE.Vector2((n+1)/c,(q+1)/d),p=new THREE.Vector2(n/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,k,p]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([k.clone(),m,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
|
|
q/d),m=new THREE.Vector2((n+1)/c,(q+1)/d),p=new THREE.Vector2(n/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,k,p]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([k.clone(),m,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
|
|
-THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e,taper:f};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,l,k=b+1,m,p,n,q,r,t=new THREE.Vector3,v,u,w;v=new THREE.TubeGeometry.FrenetFrames(a,b,e);u=v.normals;w=v.binormals;this.tangents=v.tangents;this.normals=u;this.binormals=w;for(v=0;v<k;v++)for(g[v]=[],m=v/(k-1),r=a.getPointAt(m),h=u[v],l=w[v],n=c*f(m),m=0;m<
|
|
|
|
-d;m++)p=m/d*2*Math.PI,q=-n*Math.cos(p),p=n*Math.sin(p),t.copy(r),t.x+=q*h.x+p*l.x,t.y+=q*h.y+p*l.y,t.z+=q*h.z+p*l.z,g[v][m]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(v=0;v<b;v++)for(m=0;m<d;m++)f=e?(v+1)%b:v+1,k=(m+1)%d,a=g[v][m],c=g[f][m],f=g[f][k],k=g[v][k],t=new THREE.Vector2(v/b,m/d),u=new THREE.Vector2((v+1)/b,m/d),w=new THREE.Vector2((v+1)/b,(m+1)/d),h=new THREE.Vector2(v/b,(m+1)/d),this.faces.push(new THREE.Face3(a,c,k)),this.faceVertexUvs[0].push([t,u,h]),this.faces.push(new THREE.Face3(c,
|
|
|
|
-f,k)),this.faceVertexUvs[0].push([u.clone(),w,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
|
|
|
|
|
|
+THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e,taper:f};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,l,k=b+1,m,p,n,q,r,u=new THREE.Vector3,w,t,v;w=new THREE.TubeGeometry.FrenetFrames(a,b,e);t=w.normals;v=w.binormals;this.tangents=w.tangents;this.normals=t;this.binormals=v;for(w=0;w<k;w++)for(g[w]=[],m=w/(k-1),r=a.getPointAt(m),h=t[w],l=v[w],n=c*f(m),m=0;m<
|
|
|
|
+d;m++)p=m/d*2*Math.PI,q=-n*Math.cos(p),p=n*Math.sin(p),u.copy(r),u.x+=q*h.x+p*l.x,u.y+=q*h.y+p*l.y,u.z+=q*h.z+p*l.z,g[w][m]=this.vertices.push(new THREE.Vector3(u.x,u.y,u.z))-1;for(w=0;w<b;w++)for(m=0;m<d;m++)f=e?(w+1)%b:w+1,k=(m+1)%d,a=g[w][m],c=g[f][m],f=g[f][k],k=g[w][k],u=new THREE.Vector2(w/b,m/d),t=new THREE.Vector2((w+1)/b,m/d),v=new THREE.Vector2((w+1)/b,(m+1)/d),h=new THREE.Vector2(w/b,(m+1)/d),this.faces.push(new THREE.Face3(a,c,k)),this.faceVertexUvs[0].push([u,t,h]),this.faces.push(new THREE.Face3(c,
|
|
|
|
+f,k)),this.faceVertexUvs[0].push([t.clone(),v,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
|
|
THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,l=new THREE.Matrix4;b+=1;var k,m,p;this.tangents=e;this.normals=f;this.binormals=g;for(k=0;k<b;k++)m=k/(b-1),e[k]=a.getTangentAt(m),e[k].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;k=Math.abs(e[0].x);m=Math.abs(e[0].y);p=Math.abs(e[0].z);k<=a&&(a=k,d.set(1,0,0));m<=a&&(a=m,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();f[0].crossVectors(e[0],
|
|
THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,l=new THREE.Matrix4;b+=1;var k,m,p;this.tangents=e;this.normals=f;this.binormals=g;for(k=0;k<b;k++)m=k/(b-1),e[k]=a.getTangentAt(m),e[k].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;k=Math.abs(e[0].x);m=Math.abs(e[0].y);p=Math.abs(e[0].z);k<=a&&(a=k,d.set(1,0,0));m<=a&&(a=m,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();f[0].crossVectors(e[0],
|
|
h);g[0].crossVectors(e[0],f[0]);for(k=1;k<b;k++)f[k]=f[k-1].clone(),g[k]=g[k-1].clone(),h.crossVectors(e[k-1],e[k]),h.length()>Number.EPSILON&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[k-1].dot(e[k]),-1,1)),f[k].applyMatrix4(l.makeRotationAxis(h,d))),g[k].crossVectors(e[k],f[k]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),k=1;k<b;k++)f[k].applyMatrix4(l.makeRotationAxis(e[k],d*k)),g[k].crossVectors(e[k],f[k])};
|
|
h);g[0].crossVectors(e[0],f[0]);for(k=1;k<b;k++)f[k]=f[k-1].clone(),g[k]=g[k-1].clone(),h.crossVectors(e[k-1],e[k]),h.length()>Number.EPSILON&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[k-1].dot(e[k]),-1,1)),f[k].applyMatrix4(l.makeRotationAxis(h,d))),g[k].crossVectors(e[k],f[k]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),k=1;k<b;k++)f[k].applyMatrix4(l.makeRotationAxis(e[k],d*k)),g[k].crossVectors(e[k],f[k])};
|
|
-THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=l.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c,d){d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()],void 0,d);l.faces.push(d);v.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(v.z,-v.x);l.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,
|
|
|
|
-b){for(var c=Math.pow(2,b),d=e(l.vertices[a.a]),g=e(l.vertices[a.b]),h=e(l.vertices[a.c]),k=[],m=a.materialIndex,n=0;n<=c;n++){k[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(g.clone().lerp(h,n/c)),r=c-n,t=0;t<=r;t++)k[n][t]=0===t&&n===c?p:e(p.clone().lerp(q,t/r))}for(n=0;n<c;n++)for(t=0;t<2*(c-n)-1;t++)d=Math.floor(t/2),0===t%2?f(k[n][d+1],k[n+1][d],k[n][d],m):f(k[n][d+1],k[n+1][d+1],k[n+1][d],m)}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/
|
|
|
|
-2/Math.PI+.5,a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var l=this,k=0,m=a.length;k<m;k+=3)e(new THREE.Vector3(a[k],a[k+1],a[k+2]));a=this.vertices;for(var p=[],n=k=0,m=b.length;k<m;k+=3,n++){var q=a[b[k]],r=a[b[k+1]],t=a[b[k+2]];p[n]=new THREE.Face3(q.index,r.index,t.index,[q.clone(),r.clone(),t.clone()],void 0,n)}for(var v=new THREE.Vector3,k=0,m=p.length;k<m;k++)g(p[k],d);k=0;for(m=this.faceVertexUvs[0].length;k<
|
|
|
|
|
|
+THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=l.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c,d){d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()],void 0,d);l.faces.push(d);w.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(w.z,-w.x);l.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,
|
|
|
|
+b){for(var c=Math.pow(2,b),d=e(l.vertices[a.a]),g=e(l.vertices[a.b]),h=e(l.vertices[a.c]),k=[],m=a.materialIndex,n=0;n<=c;n++){k[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(g.clone().lerp(h,n/c)),r=c-n,u=0;u<=r;u++)k[n][u]=0===u&&n===c?p:e(p.clone().lerp(q,u/r))}for(n=0;n<c;n++)for(u=0;u<2*(c-n)-1;u++)d=Math.floor(u/2),0===u%2?f(k[n][d+1],k[n+1][d],k[n][d],m):f(k[n][d+1],k[n+1][d+1],k[n+1][d],m)}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/
|
|
|
|
+2/Math.PI+.5,a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var l=this,k=0,m=a.length;k<m;k+=3)e(new THREE.Vector3(a[k],a[k+1],a[k+2]));a=this.vertices;for(var p=[],n=k=0,m=b.length;k<m;k+=3,n++){var q=a[b[k]],r=a[b[k+1]],u=a[b[k+2]];p[n]=new THREE.Face3(q.index,r.index,u.index,[q.clone(),r.clone(),u.clone()],void 0,n)}for(var w=new THREE.Vector3,k=0,m=p.length;k<m;k++)g(p[k],d);k=0;for(m=this.faceVertexUvs[0].length;k<
|
|
m;k++)b=this.faceVertexUvs[0][k],d=b[0].x,a=b[1].x,p=b[2].x,n=Math.max(d,a,p),q=Math.min(d,a,p),.9<n&&.1>q&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));k=0;for(m=this.vertices.length;k<m;k++)this.vertices[k].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
|
|
m;k++)b=this.faceVertexUvs[0][k],d=b[0].x,a=b[1].x,p=b[2].x,n=Math.max(d,a,p),q=Math.min(d,a,p),.9<n&&.1>q&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));k=0;for(m=this.vertices.length;k<m;k++)this.vertices[k].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
|
|
THREE.DodecahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,
|
|
THREE.DodecahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,
|
|
12,14,1,14,5,1,5,9],a,b);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b}};THREE.DodecahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype);THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry;
|
|
12,14,1,14,5,1,5,9],a,b);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b}};THREE.DodecahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype);THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry;
|